claude-mem 10.0.8 → 10.2.0

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.
@@ -1,60 +1,85 @@
1
1
  #!/usr/bin/env node
2
- "use strict";var Vy=Object.create;var Ss=Object.defineProperty;var Jy=Object.getOwnPropertyDescriptor;var Ky=Object.getOwnPropertyNames;var Hy=Object.getPrototypeOf,Wy=Object.prototype.hasOwnProperty;var S=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),$n=(t,e)=>{for(var r in e)Ss(t,r,{get:e[r],enumerable:!0})},Gy=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Ky(e))!Wy.call(t,o)&&o!==r&&Ss(t,o,{get:()=>e[o],enumerable:!(n=Jy(e,o))||n.enumerable});return t};var si=(t,e,r)=>(r=t!=null?Vy(Hy(t)):{},Gy(e||!t||!t.__esModule?Ss(r,"default",{value:t,enumerable:!0}):r,t));var Do=S(re=>{"use strict";Object.defineProperty(re,"__esModule",{value:!0});re.regexpCode=re.getEsmExportName=re.getProperty=re.safeStringify=re.stringify=re.strConcat=re.addCodeArg=re.str=re._=re.nil=re._Code=re.Name=re.IDENTIFIER=re._CodeOrName=void 0;var Oo=class{};re._CodeOrName=Oo;re.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var _r=class extends Oo{constructor(e){if(super(),!re.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}}};re.Name=_r;var rt=class extends Oo{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 _r&&(r[n.str]=(r[n.str]||0)+1),r),{})}};re._Code=rt;re.nil=new rt("");function Mg(t,...e){let r=[t[0]],n=0;for(;n<e.length;)bd(r,e[n]),r.push(t[++n]);return new rt(r)}re._=Mg;var $d=new rt("+");function Lg(t,...e){let r=[jo(t[0])],n=0;for(;n<e.length;)r.push($d),bd(r,e[n]),r.push($d,jo(t[++n]));return AS(r),new rt(r)}re.str=Lg;function bd(t,e){e instanceof rt?t.push(...e._items):e instanceof _r?t.push(e):t.push(CS(e))}re.addCodeArg=bd;function AS(t){let e=1;for(;e<t.length-1;){if(t[e]===$d){let r=US(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function US(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof _r||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 _r))return`"${t}${e.slice(1)}`}function ZS(t,e){return e.emptyStr()?t:t.emptyStr()?e:Lg`${t}${e}`}re.strConcat=ZS;function CS(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:jo(Array.isArray(t)?t.join(","):t)}function MS(t){return new rt(jo(t))}re.stringify=MS;function jo(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}re.safeStringify=jo;function LS(t){return typeof t=="string"&&re.IDENTIFIER.test(t)?new rt(`.${t}`):Mg`[${t}]`}re.getProperty=LS;function qS(t){if(typeof t=="string"&&re.IDENTIFIER.test(t))return new rt(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}re.getEsmExportName=qS;function FS(t){return new rt(t.toString())}re.regexpCode=FS});var Sd=S(qe=>{"use strict";Object.defineProperty(qe,"__esModule",{value:!0});qe.ValueScope=qe.ValueScopeName=qe.Scope=qe.varKinds=qe.UsedValueState=void 0;var Le=Do(),xd=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},Oa;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(Oa||(qe.UsedValueState=Oa={}));qe.varKinds={const:new Le.Name("const"),let:new Le.Name("let"),var:new Le.Name("var")};var ja=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof Le.Name?e:this.name(e)}name(e){return new Le.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}}};qe.Scope=ja;var Da=class extends Le.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=(0,Le._)`.${new Le.Name(r)}[${n}]`}};qe.ValueScopeName=Da;var VS=(0,Le._)`\n`,kd=class extends ja{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?VS:Le.nil}}get(){return this._scope}name(e){return new Da(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:i}=o,a=(n=r.key)!==null&&n!==void 0?n:r.ref,s=this._values[i];if(s){let l=s.get(a);if(l)return l}else s=this._values[i]=new Map;s.set(a,o);let c=this._scope[i]||(this._scope[i]=[]),u=c.length;return c[u]=r.ref,o.setValue(r,{property:i,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,Le._)`${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 i=Le.nil;for(let a in e){let s=e[a];if(!s)continue;let c=n[a]=n[a]||new Map;s.forEach(u=>{if(c.has(u))return;c.set(u,Oa.Started);let l=r(u);if(l){let d=this.opts.es5?qe.varKinds.var:qe.varKinds.const;i=(0,Le._)`${i}${d} ${u} = ${l};${this.opts._n}`}else if(l=o?.(u))i=(0,Le._)`${i}${l}${this.opts._n}`;else throw new xd(u);c.set(u,Oa.Completed)})}return i}};qe.ValueScope=kd});var K=S(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 Q=Do(),dt=Sd(),tr=Do();Object.defineProperty(W,"_",{enumerable:!0,get:function(){return tr._}});Object.defineProperty(W,"str",{enumerable:!0,get:function(){return tr.str}});Object.defineProperty(W,"strConcat",{enumerable:!0,get:function(){return tr.strConcat}});Object.defineProperty(W,"nil",{enumerable:!0,get:function(){return tr.nil}});Object.defineProperty(W,"getProperty",{enumerable:!0,get:function(){return tr.getProperty}});Object.defineProperty(W,"stringify",{enumerable:!0,get:function(){return tr.stringify}});Object.defineProperty(W,"regexpCode",{enumerable:!0,get:function(){return tr.regexpCode}});Object.defineProperty(W,"Name",{enumerable:!0,get:function(){return tr.Name}});var Ua=Sd();Object.defineProperty(W,"Scope",{enumerable:!0,get:function(){return Ua.Scope}});Object.defineProperty(W,"ValueScope",{enumerable:!0,get:function(){return Ua.ValueScope}});Object.defineProperty(W,"ValueScopeName",{enumerable:!0,get:function(){return Ua.ValueScopeName}});Object.defineProperty(W,"varKinds",{enumerable:!0,get:function(){return Ua.varKinds}});W.operators={GT:new Q._Code(">"),GTE:new Q._Code(">="),LT:new Q._Code("<"),LTE:new Q._Code("<="),EQ:new Q._Code("==="),NEQ:new Q._Code("!=="),NOT:new Q._Code("!"),OR:new Q._Code("||"),AND:new Q._Code("&&"),ADD:new Q._Code("+")};var Ut=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},wd=class extends Ut{constructor(e,r,n){super(),this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?dt.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=rn(this.rhs,e,r)),this}get names(){return this.rhs instanceof Q._CodeOrName?this.rhs.names:{}}},Na=class extends Ut{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 Q.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=rn(this.rhs,e,r),this}get names(){let e=this.lhs instanceof Q.Name?{}:{...this.lhs.names};return Aa(e,this.rhs)}},zd=class extends Na{constructor(e,r,n,o){super(e,n,o),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},Id=class extends Ut{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},Ed=class extends Ut{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},Td=class extends Ut{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},Pd=class extends Ut{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=rn(this.code,e,r),this}get names(){return this.code instanceof Q._CodeOrName?this.code.names:{}}},No=class extends Ut{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 i=n[o];i.optimizeNames(e,r)||(JS(e,i.names),n.splice(o,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>br(e,r.names),{})}},Zt=class extends No{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},Od=class extends No{},tn=class extends Zt{};tn.kind="else";var yr=class t extends Zt{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 tn(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(qg(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=rn(this.condition,e,r),this}get names(){let e=super.names;return Aa(e,this.condition),this.else&&br(e,this.else.names),e}};yr.kind="if";var $r=class extends Zt{};$r.kind="for";var jd=class extends $r{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=rn(this.iteration,e,r),this}get names(){return br(super.names,this.iteration.names)}},Dd=class extends $r{constructor(e,r,n,o){super(),this.varKind=e,this.name=r,this.from=n,this.to=o}render(e){let r=e.es5?dt.varKinds.var:this.varKind,{name:n,from:o,to:i}=this;return`for(${r} ${n}=${o}; ${n}<${i}; ${n}++)`+super.render(e)}get names(){let e=Aa(super.names,this.from);return Aa(e,this.to)}},Ra=class extends $r{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=rn(this.iterable,e,r),this}get names(){return br(super.names,this.iterable.names)}},Ro=class extends Zt{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)}};Ro.kind="func";var Ao=class extends No{render(e){return"return "+super.render(e)}};Ao.kind="return";var Nd=class extends Zt{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&&br(e,this.catch.names),this.finally&&br(e,this.finally.names),e}},Uo=class extends Zt{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};Uo.kind="catch";var Zo=class extends Zt{render(e){return"finally"+super.render(e)}};Zo.kind="finally";var Rd=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
3
- `:""},this._extScope=e,this._scope=new dt.Scope({parent:e}),this._nodes=[new Od]}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 i=this._scope.toName(r);return n!==void 0&&o&&(this._constants[i.str]=n),this._leafNode(new wd(e,i,n)),i}const(e,r,n){return this._def(dt.varKinds.const,e,r,n)}let(e,r,n){return this._def(dt.varKinds.let,e,r,n)}var(e,r,n){return this._def(dt.varKinds.var,e,r,n)}assign(e,r,n){return this._leafNode(new Na(e,r,n))}add(e,r){return this._leafNode(new zd(e,W.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==Q.nil&&this._leafNode(new Pd(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,Q.addCodeArg)(r,o));return r.push("}"),new Q._Code(r)}if(e,r,n){if(this._blockNode(new yr(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 yr(e))}else(){return this._elseNode(new tn)}endIf(){return this._endBlockNode(yr,tn)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new jd(e),r)}forRange(e,r,n,o,i=this.opts.es5?dt.varKinds.var:dt.varKinds.let){let a=this._scope.toName(e);return this._for(new Dd(i,a,r,n),()=>o(a))}forOf(e,r,n,o=dt.varKinds.const){let i=this._scope.toName(e);if(this.opts.es5){let a=r instanceof Q.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,Q._)`${a}.length`,s=>{this.var(i,(0,Q._)`${a}[${s}]`),n(i)})}return this._for(new Ra("of",o,i,r),()=>n(i))}forIn(e,r,n,o=this.opts.es5?dt.varKinds.var:dt.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,Q._)`Object.keys(${r})`,n);let i=this._scope.toName(e);return this._for(new Ra("in",o,i,r),()=>n(i))}endFor(){return this._endBlockNode($r)}label(e){return this._leafNode(new Id(e))}break(e){return this._leafNode(new Ed(e))}return(e){let r=new Ao;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Ao)}try(e,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let o=new Nd;if(this._blockNode(o),this.code(e),r){let i=this.name("e");this._currNode=o.catch=new Uo(i),r(i)}return n&&(this._currNode=o.finally=new Zo,this.code(n)),this._endBlockNode(Uo,Zo)}throw(e){return this._leafNode(new Td(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=Q.nil,n,o){return this._blockNode(new Ro(e,r,n)),o&&this.code(o).endFunc(),this}endFunc(){return this._endBlockNode(Ro)}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 yr))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=Rd;function br(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}function Aa(t,e){return e instanceof Q._CodeOrName?br(t,e.names):t}function rn(t,e,r){if(t instanceof Q.Name)return n(t);if(!o(t))return t;return new Q._Code(t._items.reduce((i,a)=>(a instanceof Q.Name&&(a=n(a)),a instanceof Q._Code?i.push(...a._items):i.push(a),i),[]));function n(i){let a=r[i.str];return a===void 0||e[i.str]!==1?i:(delete e[i.str],a)}function o(i){return i instanceof Q._Code&&i._items.some(a=>a instanceof Q.Name&&e[a.str]===1&&r[a.str]!==void 0)}}function JS(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}function qg(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,Q._)`!${Ad(t)}`}W.not=qg;var KS=Fg(W.operators.AND);function HS(...t){return t.reduce(KS)}W.and=HS;var WS=Fg(W.operators.OR);function GS(...t){return t.reduce(WS)}W.or=GS;function Fg(t){return(e,r)=>e===Q.nil?r:r===Q.nil?e:(0,Q._)`${Ad(e)} ${t} ${Ad(r)}`}function Ad(t){return t instanceof Q.Name?t:(0,Q._)`(${t})`}});var ee=S(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 le=K(),BS=Do();function XS(t){let e={};for(let r of t)e[r]=!0;return e}B.toHash=XS;function YS(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(Kg(t,e),!Hg(e,t.self.RULES.all))}B.alwaysValidSchema=YS;function Kg(t,e=t.schema){let{opts:r,self:n}=t;if(!r.strictSchema||typeof e=="boolean")return;let o=n.RULES.keywords;for(let i in e)o[i]||Bg(t,`unknown keyword: "${i}"`)}B.checkUnknownRules=Kg;function Hg(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}B.schemaHasRules=Hg;function QS(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=QS;function ew({topSchemaRef:t,schemaPath:e},r,n,o){if(!o){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,le._)`${r}`}return(0,le._)`${t}${e}${(0,le.getProperty)(n)}`}B.schemaRefOrVal=ew;function tw(t){return Wg(decodeURIComponent(t))}B.unescapeFragment=tw;function rw(t){return encodeURIComponent(Zd(t))}B.escapeFragment=rw;function Zd(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}B.escapeJsonPointer=Zd;function Wg(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}B.unescapeJsonPointer=Wg;function nw(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}B.eachItem=nw;function Vg({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:n}){return(o,i,a,s)=>{let c=a===void 0?i:a instanceof le.Name?(i instanceof le.Name?t(o,i,a):e(o,i,a),a):i instanceof le.Name?(e(o,a,i),i):r(i,a);return s===le.Name&&!(c instanceof le.Name)?n(o,c):c}}B.mergeEvaluated={props:Vg({mergeNames:(t,e,r)=>t.if((0,le._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,le._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,le._)`${r} || {}`).code((0,le._)`Object.assign(${r}, ${e})`))}),mergeToName:(t,e,r)=>t.if((0,le._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,le._)`${r} || {}`),Cd(t,r,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:Gg}),items:Vg({mergeNames:(t,e,r)=>t.if((0,le._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,le._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),mergeToName:(t,e,r)=>t.if((0,le._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,le._)`${r} > ${e} ? ${r} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function Gg(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,le._)`{}`);return e!==void 0&&Cd(t,r,e),r}B.evaluatedPropsToName=Gg;function Cd(t,e,r){Object.keys(r).forEach(n=>t.assign((0,le._)`${e}${(0,le.getProperty)(n)}`,!0))}B.setEvaluated=Cd;var Jg={};function ow(t,e){return t.scopeValue("func",{ref:e,code:Jg[e.code]||(Jg[e.code]=new BS._Code(e.code))})}B.useFunc=ow;var Ud;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(Ud||(B.Type=Ud={}));function iw(t,e,r){if(t instanceof le.Name){let n=e===Ud.Num;return r?n?(0,le._)`"[" + ${t} + "]"`:(0,le._)`"['" + ${t} + "']"`:n?(0,le._)`"/" + ${t}`:(0,le._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,le.getProperty)(t).toString():"/"+Zd(t)}B.getErrorPath=iw;function Bg(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=Bg});var Ct=S(Md=>{"use strict";Object.defineProperty(Md,"__esModule",{value:!0});var Pe=K(),aw={data:new Pe.Name("data"),valCxt:new Pe.Name("valCxt"),instancePath:new Pe.Name("instancePath"),parentData:new Pe.Name("parentData"),parentDataProperty:new Pe.Name("parentDataProperty"),rootData:new Pe.Name("rootData"),dynamicAnchors:new Pe.Name("dynamicAnchors"),vErrors:new Pe.Name("vErrors"),errors:new Pe.Name("errors"),this:new Pe.Name("this"),self:new Pe.Name("self"),scope:new Pe.Name("scope"),json:new Pe.Name("json"),jsonPos:new Pe.Name("jsonPos"),jsonLen:new Pe.Name("jsonLen"),jsonPart:new Pe.Name("jsonPart")};Md.default=aw});var Co=S(Oe=>{"use strict";Object.defineProperty(Oe,"__esModule",{value:!0});Oe.extendErrors=Oe.resetErrorsCount=Oe.reportExtraError=Oe.reportError=Oe.keyword$DataError=Oe.keywordError=void 0;var te=K(),Za=ee(),Ze=Ct();Oe.keywordError={message:({keyword:t})=>(0,te.str)`must pass "${t}" keyword validation`};Oe.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,te.str)`"${t}" keyword must be ${e} ($data)`:(0,te.str)`"${t}" keyword is invalid ($data)`};function sw(t,e=Oe.keywordError,r,n){let{it:o}=t,{gen:i,compositeRule:a,allErrors:s}=o,c=Qg(t,e,r);n??(a||s)?Xg(i,c):Yg(o,(0,te._)`[${c}]`)}Oe.reportError=sw;function cw(t,e=Oe.keywordError,r){let{it:n}=t,{gen:o,compositeRule:i,allErrors:a}=n,s=Qg(t,e,r);Xg(o,s),i||a||Yg(n,Ze.default.vErrors)}Oe.reportExtraError=cw;function uw(t,e){t.assign(Ze.default.errors,e),t.if((0,te._)`${Ze.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,te._)`${Ze.default.vErrors}.length`,e),()=>t.assign(Ze.default.vErrors,null)))}Oe.resetErrorsCount=uw;function lw({gen:t,keyword:e,schemaValue:r,data:n,errsCount:o,it:i}){if(o===void 0)throw new Error("ajv implementation error");let a=t.name("err");t.forRange("i",o,Ze.default.errors,s=>{t.const(a,(0,te._)`${Ze.default.vErrors}[${s}]`),t.if((0,te._)`${a}.instancePath === undefined`,()=>t.assign((0,te._)`${a}.instancePath`,(0,te.strConcat)(Ze.default.instancePath,i.errorPath))),t.assign((0,te._)`${a}.schemaPath`,(0,te.str)`${i.errSchemaPath}/${e}`),i.opts.verbose&&(t.assign((0,te._)`${a}.schema`,r),t.assign((0,te._)`${a}.data`,n))})}Oe.extendErrors=lw;function Xg(t,e){let r=t.const("err",e);t.if((0,te._)`${Ze.default.vErrors} === null`,()=>t.assign(Ze.default.vErrors,(0,te._)`[${r}]`),(0,te._)`${Ze.default.vErrors}.push(${r})`),t.code((0,te._)`${Ze.default.errors}++`)}function Yg(t,e){let{gen:r,validateName:n,schemaEnv:o}=t;o.$async?r.throw((0,te._)`new ${t.ValidationError}(${e})`):(r.assign((0,te._)`${n}.errors`,e),r.return(!1))}var xr={keyword:new te.Name("keyword"),schemaPath:new te.Name("schemaPath"),params:new te.Name("params"),propertyName:new te.Name("propertyName"),message:new te.Name("message"),schema:new te.Name("schema"),parentSchema:new te.Name("parentSchema")};function Qg(t,e,r){let{createErrors:n}=t.it;return n===!1?(0,te._)`{}`:dw(t,e,r)}function dw(t,e,r={}){let{gen:n,it:o}=t,i=[pw(o,r),fw(t,r)];return mw(t,e,i),n.object(...i)}function pw({errorPath:t},{instancePath:e}){let r=e?(0,te.str)`${t}${(0,Za.getErrorPath)(e,Za.Type.Str)}`:t;return[Ze.default.instancePath,(0,te.strConcat)(Ze.default.instancePath,r)]}function fw({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:n}){let o=n?e:(0,te.str)`${e}/${t}`;return r&&(o=(0,te.str)`${o}${(0,Za.getErrorPath)(r,Za.Type.Str)}`),[xr.schemaPath,o]}function mw(t,{params:e,message:r},n){let{keyword:o,data:i,schemaValue:a,it:s}=t,{opts:c,propertyName:u,topSchemaRef:l,schemaPath:d}=s;n.push([xr.keyword,o],[xr.params,typeof e=="function"?e(t):e||(0,te._)`{}`]),c.messages&&n.push([xr.message,typeof r=="function"?r(t):r]),c.verbose&&n.push([xr.schema,a],[xr.parentSchema,(0,te._)`${l}${d}`],[Ze.default.data,i]),u&&n.push([xr.propertyName,u])}});var tv=S(nn=>{"use strict";Object.defineProperty(nn,"__esModule",{value:!0});nn.boolOrEmptySchema=nn.topBoolOrEmptySchema=void 0;var hw=Co(),gw=K(),vw=Ct(),_w={message:"boolean schema is false"};function yw(t){let{gen:e,schema:r,validateName:n}=t;r===!1?ev(t,!1):typeof r=="object"&&r.$async===!0?e.return(vw.default.data):(e.assign((0,gw._)`${n}.errors`,null),e.return(!0))}nn.topBoolOrEmptySchema=yw;function $w(t,e){let{gen:r,schema:n}=t;n===!1?(r.var(e,!1),ev(t)):r.var(e,!0)}nn.boolOrEmptySchema=$w;function ev(t,e){let{gen:r,data:n}=t,o={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,hw.reportError)(o,_w,void 0,e)}});var Ld=S(on=>{"use strict";Object.defineProperty(on,"__esModule",{value:!0});on.getRules=on.isJSONType=void 0;var bw=["string","number","integer","boolean","null","object","array"],xw=new Set(bw);function kw(t){return typeof t=="string"&&xw.has(t)}on.isJSONType=kw;function Sw(){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:{}}}on.getRules=Sw});var qd=S(rr=>{"use strict";Object.defineProperty(rr,"__esModule",{value:!0});rr.shouldUseRule=rr.shouldUseGroup=rr.schemaHasRulesForType=void 0;function ww({schema:t,self:e},r){let n=e.RULES.types[r];return n&&n!==!0&&rv(t,n)}rr.schemaHasRulesForType=ww;function rv(t,e){return e.rules.some(r=>nv(t,r))}rr.shouldUseGroup=rv;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))}rr.shouldUseRule=nv});var Mo=S(je=>{"use strict";Object.defineProperty(je,"__esModule",{value:!0});je.reportTypeError=je.checkDataTypes=je.checkDataType=je.coerceAndCheckDataType=je.getJSONTypes=je.getSchemaTypes=je.DataType=void 0;var zw=Ld(),Iw=qd(),Ew=Co(),J=K(),ov=ee(),an;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(an||(je.DataType=an={}));function Tw(t){let e=iv(t.type);if(e.includes("null")){if(t.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&t.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');t.nullable===!0&&e.push("null")}return e}je.getSchemaTypes=Tw;function iv(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(zw.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}je.getJSONTypes=iv;function Pw(t,e){let{gen:r,data:n,opts:o}=t,i=Ow(e,o.coerceTypes),a=e.length>0&&!(i.length===0&&e.length===1&&(0,Iw.schemaHasRulesForType)(t,e[0]));if(a){let s=Vd(e,n,o.strictNumbers,an.Wrong);r.if(s,()=>{i.length?jw(t,e,i):Jd(t)})}return a}je.coerceAndCheckDataType=Pw;var av=new Set(["string","number","integer","boolean","null"]);function Ow(t,e){return e?t.filter(r=>av.has(r)||e==="array"&&r==="array"):[]}function jw(t,e,r){let{gen:n,data:o,opts:i}=t,a=n.let("dataType",(0,J._)`typeof ${o}`),s=n.let("coerced",(0,J._)`undefined`);i.coerceTypes==="array"&&n.if((0,J._)`${a} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,()=>n.assign(o,(0,J._)`${o}[0]`).assign(a,(0,J._)`typeof ${o}`).if(Vd(e,o,i.strictNumbers),()=>n.assign(s,o))),n.if((0,J._)`${s} !== undefined`);for(let u of r)(av.has(u)||u==="array"&&i.coerceTypes==="array")&&c(u);n.else(),Jd(t),n.endIf(),n.if((0,J._)`${s} !== undefined`,()=>{n.assign(o,s),Dw(t,s)});function c(u){switch(u){case"string":n.elseIf((0,J._)`${a} == "number" || ${a} == "boolean"`).assign(s,(0,J._)`"" + ${o}`).elseIf((0,J._)`${o} === null`).assign(s,(0,J._)`""`);return;case"number":n.elseIf((0,J._)`${a} == "boolean" || ${o} === null
4
- || (${a} == "string" && ${o} && ${o} == +${o})`).assign(s,(0,J._)`+${o}`);return;case"integer":n.elseIf((0,J._)`${a} === "boolean" || ${o} === null
5
- || (${a} === "string" && ${o} && ${o} == +${o} && !(${o} % 1))`).assign(s,(0,J._)`+${o}`);return;case"boolean":n.elseIf((0,J._)`${o} === "false" || ${o} === 0 || ${o} === null`).assign(s,!1).elseIf((0,J._)`${o} === "true" || ${o} === 1`).assign(s,!0);return;case"null":n.elseIf((0,J._)`${o} === "" || ${o} === 0 || ${o} === false`),n.assign(s,null);return;case"array":n.elseIf((0,J._)`${a} === "string" || ${a} === "number"
6
- || ${a} === "boolean" || ${o} === null`).assign(s,(0,J._)`[${o}]`)}}}function Dw({gen:t,parentData:e,parentDataProperty:r},n){t.if((0,J._)`${e} !== undefined`,()=>t.assign((0,J._)`${e}[${r}]`,n))}function Fd(t,e,r,n=an.Correct){let o=n===an.Correct?J.operators.EQ:J.operators.NEQ,i;switch(t){case"null":return(0,J._)`${e} ${o} null`;case"array":i=(0,J._)`Array.isArray(${e})`;break;case"object":i=(0,J._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":i=a((0,J._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":i=a();break;default:return(0,J._)`typeof ${e} ${o} ${t}`}return n===an.Correct?i:(0,J.not)(i);function a(s=J.nil){return(0,J.and)((0,J._)`typeof ${e} == "number"`,s,r?(0,J._)`isFinite(${e})`:J.nil)}}je.checkDataType=Fd;function Vd(t,e,r,n){if(t.length===1)return Fd(t[0],e,r,n);let o,i=(0,ov.toHash)(t);if(i.array&&i.object){let a=(0,J._)`typeof ${e} != "object"`;o=i.null?a:(0,J._)`!${e} || ${a}`,delete i.null,delete i.array,delete i.object}else o=J.nil;i.number&&delete i.integer;for(let a in i)o=(0,J.and)(o,Fd(a,e,r,n));return o}je.checkDataTypes=Vd;var Nw={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,J._)`{type: ${t}}`:(0,J._)`{type: ${e}}`};function Jd(t){let e=Rw(t);(0,Ew.reportError)(e,Nw)}je.reportTypeError=Jd;function Rw(t){let{gen:e,data:r,schema:n}=t,o=(0,ov.schemaRefOrVal)(t,n,"type");return{gen:e,keyword:"type",data:r,schema:n.type,schemaCode:o,schemaValue:o,parentSchema:n,params:{},it:t}}});var cv=S(Ca=>{"use strict";Object.defineProperty(Ca,"__esModule",{value:!0});Ca.assignDefaults=void 0;var sn=K(),Aw=ee();function Uw(t,e){let{properties:r,items:n}=t.schema;if(e==="object"&&r)for(let o in r)sv(t,o,r[o].default);else e==="array"&&Array.isArray(n)&&n.forEach((o,i)=>sv(t,i,o.default))}Ca.assignDefaults=Uw;function sv(t,e,r){let{gen:n,compositeRule:o,data:i,opts:a}=t;if(r===void 0)return;let s=(0,sn._)`${i}${(0,sn.getProperty)(e)}`;if(o){(0,Aw.checkStrictMode)(t,`default is ignored for: ${s}`);return}let c=(0,sn._)`${s} === undefined`;a.useDefaults==="empty"&&(c=(0,sn._)`${c} || ${s} === null || ${s} === ""`),n.if(c,(0,sn._)`${s} = ${(0,sn.stringify)(r)}`)}});var nt=S(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=K(),Kd=ee(),nr=Ct(),Zw=ee();function Cw(t,e){let{gen:r,data:n,it:o}=t;r.if(Wd(r,n,e,o.opts.ownProperties),()=>{t.setParams({missingProperty:(0,me._)`${e}`},!0),t.error()})}ae.checkReportMissingProp=Cw;function Mw({gen:t,data:e,it:{opts:r}},n,o){return(0,me.or)(...n.map(i=>(0,me.and)(Wd(t,e,i,r.ownProperties),(0,me._)`${o} = ${i}`)))}ae.checkMissingProp=Mw;function Lw(t,e){t.setParams({missingProperty:e},!0),t.error()}ae.reportMissingProp=Lw;function uv(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,me._)`Object.prototype.hasOwnProperty`})}ae.hasPropFunc=uv;function Hd(t,e,r){return(0,me._)`${uv(t)}.call(${e}, ${r})`}ae.isOwnProperty=Hd;function qw(t,e,r,n){let o=(0,me._)`${e}${(0,me.getProperty)(r)} !== undefined`;return n?(0,me._)`${o} && ${Hd(t,e,r)}`:o}ae.propertyInData=qw;function Wd(t,e,r,n){let o=(0,me._)`${e}${(0,me.getProperty)(r)} === undefined`;return n?(0,me.or)(o,(0,me.not)(Hd(t,e,r))):o}ae.noPropertyInData=Wd;function lv(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}ae.allSchemaProperties=lv;function Fw(t,e){return lv(e).filter(r=>!(0,Kd.alwaysValidSchema)(t,e[r]))}ae.schemaProperties=Fw;function Vw({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:o,errorPath:i},it:a},s,c,u){let l=u?(0,me._)`${t}, ${e}, ${n}${o}`:e,d=[[nr.default.instancePath,(0,me.strConcat)(nr.default.instancePath,i)],[nr.default.parentData,a.parentData],[nr.default.parentDataProperty,a.parentDataProperty],[nr.default.rootData,nr.default.rootData]];a.opts.dynamicRef&&d.push([nr.default.dynamicAnchors,nr.default.dynamicAnchors]);let m=(0,me._)`${l}, ${r.object(...d)}`;return c!==me.nil?(0,me._)`${s}.call(${c}, ${m})`:(0,me._)`${s}(${m})`}ae.callValidateCode=Vw;var Jw=(0,me._)`new RegExp`;function Kw({gen:t,it:{opts:e}},r){let n=e.unicodeRegExp?"u":"",{regExp:o}=e.code,i=o(r,n);return t.scopeValue("pattern",{key:i.toString(),ref:i,code:(0,me._)`${o.code==="new RegExp"?Jw:(0,Zw.useFunc)(t,o)}(${r}, ${n})`})}ae.usePattern=Kw;function Hw(t){let{gen:e,data:r,keyword:n,it:o}=t,i=e.name("valid");if(o.allErrors){let s=e.let("valid",!0);return a(()=>e.assign(s,!1)),s}return e.var(i,!0),a(()=>e.break()),i;function a(s){let c=e.const("len",(0,me._)`${r}.length`);e.forRange("i",0,c,u=>{t.subschema({keyword:n,dataProp:u,dataPropType:Kd.Type.Num},i),e.if((0,me.not)(i),s)})}}ae.validateArray=Hw;function Ww(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,Kd.alwaysValidSchema)(o,c))&&!o.opts.unevaluated)return;let a=e.let("valid",!1),s=e.name("_valid");e.block(()=>r.forEach((c,u)=>{let l=t.subschema({keyword:n,schemaProp:u,compositeRule:!0},s);e.assign(a,(0,me._)`${a} || ${s}`),t.mergeValidEvaluated(l,s)||e.if((0,me.not)(a))})),t.result(a,()=>t.reset(),()=>t.error(!0))}ae.validateUnion=Ww});var fv=S(yt=>{"use strict";Object.defineProperty(yt,"__esModule",{value:!0});yt.validateKeywordUsage=yt.validSchemaType=yt.funcKeywordCode=yt.macroKeywordCode=void 0;var Ce=K(),kr=Ct(),Gw=nt(),Bw=Co();function Xw(t,e){let{gen:r,keyword:n,schema:o,parentSchema:i,it:a}=t,s=e.macro.call(a.self,o,i,a),c=pv(r,n,s);a.opts.validateSchema!==!1&&a.self.validateSchema(s,!0);let u=r.name("valid");t.subschema({schema:s,schemaPath:Ce.nil,errSchemaPath:`${a.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},u),t.pass(u,()=>t.error(!0))}yt.macroKeywordCode=Xw;function Yw(t,e){var r;let{gen:n,keyword:o,schema:i,parentSchema:a,$data:s,it:c}=t;e0(c,e);let u=!s&&e.compile?e.compile.call(c.self,i,a,c):e.validate,l=pv(n,o,u),d=n.let("valid");t.block$data(d,m),t.ok((r=e.valid)!==null&&r!==void 0?r:d);function m(){if(e.errors===!1)v(),e.modifying&&dv(t),$(()=>t.error());else{let k=e.async?f():g();e.modifying&&dv(t),$(()=>Qw(t,k))}}function f(){let k=n.let("ruleErrs",null);return n.try(()=>v((0,Ce._)`await `),O=>n.assign(d,!1).if((0,Ce._)`${O} instanceof ${c.ValidationError}`,()=>n.assign(k,(0,Ce._)`${O}.errors`),()=>n.throw(O))),k}function g(){let k=(0,Ce._)`${l}.errors`;return n.assign(k,null),v(Ce.nil),k}function v(k=e.async?(0,Ce._)`await `:Ce.nil){let O=c.opts.passContext?kr.default.this:kr.default.self,I=!("compile"in e&&!s||e.schema===!1);n.assign(d,(0,Ce._)`${k}${(0,Gw.callValidateCode)(t,l,O,I)}`,e.modifying)}function $(k){var O;n.if((0,Ce.not)((O=e.valid)!==null&&O!==void 0?O:d),k)}}yt.funcKeywordCode=Yw;function dv(t){let{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0,Ce._)`${n.parentData}[${n.parentDataProperty}]`))}function Qw(t,e){let{gen:r}=t;r.if((0,Ce._)`Array.isArray(${e})`,()=>{r.assign(kr.default.vErrors,(0,Ce._)`${kr.default.vErrors} === null ? ${e} : ${kr.default.vErrors}.concat(${e})`).assign(kr.default.errors,(0,Ce._)`${kr.default.vErrors}.length`),(0,Bw.extendErrors)(t)},()=>t.error())}function e0({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function pv(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,Ce.stringify)(r)})}function t0(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")}yt.validSchemaType=t0;function r0({schema:t,opts:e,self:r,errSchemaPath:n},o,i){if(Array.isArray(o.keyword)?!o.keyword.includes(i):o.keyword!==i)throw new Error("ajv implementation error");let a=o.dependencies;if(a?.some(s=>!Object.prototype.hasOwnProperty.call(t,s)))throw new Error(`parent schema must have dependencies of ${i}: ${a.join(",")}`);if(o.validateSchema&&!o.validateSchema(t[i])){let c=`keyword "${i}" value is invalid at path "${n}": `+r.errorsText(o.validateSchema.errors);if(e.validateSchema==="log")r.logger.error(c);else throw new Error(c)}}yt.validateKeywordUsage=r0});var hv=S(or=>{"use strict";Object.defineProperty(or,"__esModule",{value:!0});or.extendSubschemaMode=or.extendSubschemaData=or.getSubschema=void 0;var $t=K(),mv=ee();function n0(t,{keyword:e,schemaProp:r,schema:n,schemaPath:o,errSchemaPath:i,topSchemaRef:a}){if(e!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let s=t.schema[e];return r===void 0?{schema:s,schemaPath:(0,$t._)`${t.schemaPath}${(0,$t.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:s[r],schemaPath:(0,$t._)`${t.schemaPath}${(0,$t.getProperty)(e)}${(0,$t.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,mv.escapeFragment)(r)}`}}if(n!==void 0){if(o===void 0||i===void 0||a===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:o,topSchemaRef:a,errSchemaPath:i}}throw new Error('either "keyword" or "schema" must be passed')}or.getSubschema=n0;function o0(t,e,{dataProp:r,dataPropType:n,data:o,dataTypes:i,propertyName:a}){if(o!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:s}=e;if(r!==void 0){let{errorPath:u,dataPathArr:l,opts:d}=e,m=s.let("data",(0,$t._)`${e.data}${(0,$t.getProperty)(r)}`,!0);c(m),t.errorPath=(0,$t.str)`${u}${(0,mv.getErrorPath)(r,n,d.jsPropertySyntax)}`,t.parentDataProperty=(0,$t._)`${r}`,t.dataPathArr=[...l,t.parentDataProperty]}if(o!==void 0){let u=o instanceof $t.Name?o:s.let("data",o,!0);c(u),a!==void 0&&(t.propertyName=a)}i&&(t.dataTypes=i);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]}}or.extendSubschemaData=o0;function i0(t,{jtdDiscriminator:e,jtdMetadata:r,compositeRule:n,createErrors:o,allErrors:i}){n!==void 0&&(t.compositeRule=n),o!==void 0&&(t.createErrors=o),i!==void 0&&(t.allErrors=i),t.jtdDiscriminator=e,t.jtdMetadata=r}or.extendSubschemaMode=i0});var Gd=S((mU,gv)=>{"use strict";gv.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,i;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(i=Object.keys(e),n=i.length,n!==Object.keys(r).length)return!1;for(o=n;o--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[o]))return!1;for(o=n;o--!==0;){var a=i[o];if(!t(e[a],r[a]))return!1}return!0}return e!==e&&r!==r}});var _v=S((hU,vv)=>{"use strict";var ir=vv.exports=function(t,e,r){typeof e=="function"&&(r=e,e={}),r=e.cb||r;var n=typeof r=="function"?r:r.pre||function(){},o=r.post||function(){};Ma(e,n,o,t,"",t)};ir.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};ir.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};ir.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};ir.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 Ma(t,e,r,n,o,i,a,s,c,u){if(n&&typeof n=="object"&&!Array.isArray(n)){e(n,o,i,a,s,c,u);for(var l in n){var d=n[l];if(Array.isArray(d)){if(l in ir.arrayKeywords)for(var m=0;m<d.length;m++)Ma(t,e,r,d[m],o+"/"+l+"/"+m,i,o,l,n,m)}else if(l in ir.propsKeywords){if(d&&typeof d=="object")for(var f in d)Ma(t,e,r,d[f],o+"/"+l+"/"+a0(f),i,o,l,n,f)}else(l in ir.keywords||t.allKeys&&!(l in ir.skipKeywords))&&Ma(t,e,r,d,o+"/"+l,i,o,l,n)}r(n,o,i,a,s,c,u)}}function a0(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var Lo=S(Fe=>{"use strict";Object.defineProperty(Fe,"__esModule",{value:!0});Fe.getSchemaRefs=Fe.resolveUrl=Fe.normalizeId=Fe._getFullPath=Fe.getFullPath=Fe.inlineRef=void 0;var s0=ee(),c0=Gd(),u0=_v(),l0=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function d0(t,e=!0){return typeof t=="boolean"?!0:e===!0?!Bd(t):e?yv(t)<=e:!1}Fe.inlineRef=d0;var p0=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Bd(t){for(let e in t){if(p0.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(Bd)||typeof r=="object"&&Bd(r))return!0}return!1}function yv(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!l0.has(r)&&(typeof t[r]=="object"&&(0,s0.eachItem)(t[r],n=>e+=yv(n)),e===1/0))return 1/0}return e}function $v(t,e="",r){r!==!1&&(e=cn(e));let n=t.parse(e);return bv(t,n)}Fe.getFullPath=$v;function bv(t,e){return t.serialize(e).split("#")[0]+"#"}Fe._getFullPath=bv;var f0=/#\/?$/;function cn(t){return t?t.replace(f0,""):""}Fe.normalizeId=cn;function m0(t,e,r){return r=cn(r),t.resolve(e,r)}Fe.resolveUrl=m0;var h0=/^[a-z_][-a-z0-9._]*$/i;function g0(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,o=cn(t[r]||e),i={"":o},a=$v(n,o,!1),s={},c=new Set;return u0(t,{allKeys:!0},(d,m,f,g)=>{if(g===void 0)return;let v=a+m,$=i[g];typeof d[r]=="string"&&($=k.call(this,d[r])),O.call(this,d.$anchor),O.call(this,d.$dynamicAnchor),i[m]=$;function k(I){let Z=this.opts.uriResolver.resolve;if(I=cn($?Z($,I):I),c.has(I))throw l(I);c.add(I);let j=this.refs[I];return typeof j=="string"&&(j=this.refs[j]),typeof j=="object"?u(d,j.schema,I):I!==cn(v)&&(I[0]==="#"?(u(d,s[I],I),s[I]=d):this.refs[I]=v),I}function O(I){if(typeof I=="string"){if(!h0.test(I))throw new Error(`invalid anchor "${I}"`);k.call(this,`#${I}`)}}}),s;function u(d,m,f){if(m!==void 0&&!c0(d,m))throw l(f)}function l(d){return new Error(`reference "${d}" resolves to more than one schema`)}}Fe.getSchemaRefs=g0});var Vo=S(ar=>{"use strict";Object.defineProperty(ar,"__esModule",{value:!0});ar.getData=ar.KeywordCxt=ar.validateFunctionCode=void 0;var zv=tv(),xv=Mo(),Yd=qd(),La=Mo(),v0=cv(),Fo=fv(),Xd=hv(),P=K(),C=Ct(),_0=Lo(),Mt=ee(),qo=Co();function y0(t){if(Tv(t)&&(Pv(t),Ev(t))){x0(t);return}Iv(t,()=>(0,zv.topBoolOrEmptySchema)(t))}ar.validateFunctionCode=y0;function Iv({gen:t,validateName:e,schema:r,schemaEnv:n,opts:o},i){o.code.es5?t.func(e,(0,P._)`${C.default.data}, ${C.default.valCxt}`,n.$async,()=>{t.code((0,P._)`"use strict"; ${kv(r,o)}`),b0(t,o),t.code(i)}):t.func(e,(0,P._)`${C.default.data}, ${$0(o)}`,n.$async,()=>t.code(kv(r,o)).code(i))}function $0(t){return(0,P._)`{${C.default.instancePath}="", ${C.default.parentData}, ${C.default.parentDataProperty}, ${C.default.rootData}=${C.default.data}${t.dynamicRef?(0,P._)`, ${C.default.dynamicAnchors}={}`:P.nil}}={}`}function b0(t,e){t.if(C.default.valCxt,()=>{t.var(C.default.instancePath,(0,P._)`${C.default.valCxt}.${C.default.instancePath}`),t.var(C.default.parentData,(0,P._)`${C.default.valCxt}.${C.default.parentData}`),t.var(C.default.parentDataProperty,(0,P._)`${C.default.valCxt}.${C.default.parentDataProperty}`),t.var(C.default.rootData,(0,P._)`${C.default.valCxt}.${C.default.rootData}`),e.dynamicRef&&t.var(C.default.dynamicAnchors,(0,P._)`${C.default.valCxt}.${C.default.dynamicAnchors}`)},()=>{t.var(C.default.instancePath,(0,P._)`""`),t.var(C.default.parentData,(0,P._)`undefined`),t.var(C.default.parentDataProperty,(0,P._)`undefined`),t.var(C.default.rootData,C.default.data),e.dynamicRef&&t.var(C.default.dynamicAnchors,(0,P._)`{}`)})}function x0(t){let{schema:e,opts:r,gen:n}=t;Iv(t,()=>{r.$comment&&e.$comment&&jv(t),I0(t),n.let(C.default.vErrors,null),n.let(C.default.errors,0),r.unevaluated&&k0(t),Ov(t),P0(t)})}function k0(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,P._)`${r}.evaluated`),e.if((0,P._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,P._)`${t.evaluated}.props`,(0,P._)`undefined`)),e.if((0,P._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,P._)`${t.evaluated}.items`,(0,P._)`undefined`))}function kv(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,P._)`/*# sourceURL=${r} */`:P.nil}function S0(t,e){if(Tv(t)&&(Pv(t),Ev(t))){w0(t,e);return}(0,zv.boolOrEmptySchema)(t,e)}function Ev({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 Tv(t){return typeof t.schema!="boolean"}function w0(t,e){let{schema:r,gen:n,opts:o}=t;o.$comment&&r.$comment&&jv(t),E0(t),T0(t);let i=n.const("_errs",C.default.errors);Ov(t,i),n.var(e,(0,P._)`${i} === ${C.default.errors}`)}function Pv(t){(0,Mt.checkUnknownRules)(t),z0(t)}function Ov(t,e){if(t.opts.jtd)return Sv(t,[],!1,e);let r=(0,xv.getSchemaTypes)(t.schema),n=(0,xv.coerceAndCheckDataType)(t,r);Sv(t,r,!n,e)}function z0(t){let{schema:e,errSchemaPath:r,opts:n,self:o}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,Mt.schemaHasRulesButRef)(e,o.RULES)&&o.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function I0(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,Mt.checkStrictMode)(t,"default is ignored in the schema root")}function E0(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,_0.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function T0(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function jv({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:o}){let i=r.$comment;if(o.$comment===!0)t.code((0,P._)`${C.default.self}.logger.log(${i})`);else if(typeof o.$comment=="function"){let a=(0,P.str)`${n}/$comment`,s=t.scopeValue("root",{ref:e.root});t.code((0,P._)`${C.default.self}.opts.$comment(${i}, ${a}, ${s}.schema)`)}}function P0(t){let{gen:e,schemaEnv:r,validateName:n,ValidationError:o,opts:i}=t;r.$async?e.if((0,P._)`${C.default.errors} === 0`,()=>e.return(C.default.data),()=>e.throw((0,P._)`new ${o}(${C.default.vErrors})`)):(e.assign((0,P._)`${n}.errors`,C.default.vErrors),i.unevaluated&&O0(t),e.return((0,P._)`${C.default.errors} === 0`))}function O0({gen:t,evaluated:e,props:r,items:n}){r instanceof P.Name&&t.assign((0,P._)`${e}.props`,r),n instanceof P.Name&&t.assign((0,P._)`${e}.items`,n)}function Sv(t,e,r,n){let{gen:o,schema:i,data:a,allErrors:s,opts:c,self:u}=t,{RULES:l}=u;if(i.$ref&&(c.ignoreKeywordsWithRef||!(0,Mt.schemaHasRulesButRef)(i,l))){o.block(()=>Nv(t,"$ref",l.all.$ref.definition));return}c.jtd||j0(t,e),o.block(()=>{for(let m of l.rules)d(m);d(l.post)});function d(m){(0,Yd.shouldUseGroup)(i,m)&&(m.type?(o.if((0,La.checkDataType)(m.type,a,c.strictNumbers)),wv(t,m),e.length===1&&e[0]===m.type&&r&&(o.else(),(0,La.reportTypeError)(t)),o.endIf()):wv(t,m),s||o.if((0,P._)`${C.default.errors} === ${n||0}`))}}function wv(t,e){let{gen:r,schema:n,opts:{useDefaults:o}}=t;o&&(0,v0.assignDefaults)(t,e.type),r.block(()=>{for(let i of e.rules)(0,Yd.shouldUseRule)(n,i)&&Nv(t,i.keyword,i.definition,e.type)})}function j0(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(D0(t,e),t.opts.allowUnionTypes||N0(t,e),R0(t,t.dataTypes))}function D0(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{Dv(t.dataTypes,r)||Qd(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),U0(t,e)}}function N0(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&Qd(t,"use allowUnionTypes to allow union type keyword")}function R0(t,e){let r=t.self.RULES.all;for(let n in r){let o=r[n];if(typeof o=="object"&&(0,Yd.shouldUseRule)(t.schema,o)){let{type:i}=o.definition;i.length&&!i.some(a=>A0(e,a))&&Qd(t,`missing type "${i.join(",")}" for keyword "${n}"`)}}}function A0(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function Dv(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function U0(t,e){let r=[];for(let n of t.dataTypes)Dv(e,n)?r.push(n):e.includes("integer")&&n==="number"&&r.push("integer");t.dataTypes=r}function Qd(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,Mt.checkStrictMode)(t,e,t.opts.strictTypes)}var qa=class{constructor(e,r,n){if((0,Fo.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,Mt.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",Rv(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,Fo.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",C.default.errors))}result(e,r,n){this.failResult((0,P.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,P.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,P._)`${r} !== undefined && (${(0,P.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?qo.reportExtraError:qo.reportError)(this,this.def.error,r)}$dataError(){(0,qo.reportError)(this,this.def.$dataError||qo.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,qo.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=P.nil){this.gen.block(()=>{this.check$data(e,n),r()})}check$data(e=P.nil,r=P.nil){if(!this.$data)return;let{gen:n,schemaCode:o,schemaType:i,def:a}=this;n.if((0,P.or)((0,P._)`${o} === undefined`,r)),e!==P.nil&&n.assign(e,!0),(i.length||a.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==P.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:n,def:o,it:i}=this;return(0,P.or)(a(),s());function a(){if(n.length){if(!(r instanceof P.Name))throw new Error("ajv implementation error");let c=Array.isArray(n)?n:[n];return(0,P._)`${(0,La.checkDataTypes)(c,r,i.opts.strictNumbers,La.DataType.Wrong)}`}return P.nil}function s(){if(o.validateSchema){let c=e.scopeValue("validate$data",{ref:o.validateSchema});return(0,P._)`!${c}(${r})`}return P.nil}}subschema(e,r){let n=(0,Xd.getSubschema)(this.it,e);(0,Xd.extendSubschemaData)(n,this.it,e),(0,Xd.extendSubschemaMode)(n,e);let o={...this.it,...n,items:void 0,props:void 0};return S0(o,r),o}mergeEvaluated(e,r){let{it:n,gen:o}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=Mt.mergeEvaluated.props(o,e.props,n.props,r)),n.items!==!0&&e.items!==void 0&&(n.items=Mt.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,P.Name)),!0}};ar.KeywordCxt=qa;function Nv(t,e,r,n){let o=new qa(t,r,e);"code"in r?r.code(o,n):o.$data&&r.validate?(0,Fo.funcKeywordCode)(o,r):"macro"in r?(0,Fo.macroKeywordCode)(o,r):(r.compile||r.validate)&&(0,Fo.funcKeywordCode)(o,r)}var Z0=/^\/(?:[^~]|~0|~1)*$/,C0=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Rv(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let o,i;if(t==="")return C.default.rootData;if(t[0]==="/"){if(!Z0.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);o=t,i=C.default.rootData}else{let u=C0.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(i=r[e-l],!o)return i}let a=i,s=o.split("/");for(let u of s)u&&(i=(0,P._)`${i}${(0,P.getProperty)((0,Mt.unescapeJsonPointer)(u))}`,a=(0,P._)`${a} && ${i}`);return a;function c(u,l){return`Cannot access ${u} ${l} levels up, current level is ${e}`}}ar.getData=Rv});var Fa=S(tp=>{"use strict";Object.defineProperty(tp,"__esModule",{value:!0});var ep=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};tp.default=ep});var Jo=S(op=>{"use strict";Object.defineProperty(op,"__esModule",{value:!0});var rp=Lo(),np=class extends Error{constructor(e,r,n,o){super(o||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,rp.resolveUrl)(e,r,n),this.missingSchema=(0,rp.normalizeId)((0,rp.getFullPath)(e,this.missingRef))}};op.default=np});var Ja=S(ot=>{"use strict";Object.defineProperty(ot,"__esModule",{value:!0});ot.resolveSchema=ot.getCompilingSchema=ot.resolveRef=ot.compileSchema=ot.SchemaEnv=void 0;var pt=K(),M0=Fa(),Sr=Ct(),ft=Lo(),Av=ee(),L0=Vo(),un=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,ft.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}};ot.SchemaEnv=un;function ap(t){let e=Uv.call(this,t);if(e)return e;let r=(0,ft.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:n,lines:o}=this.opts.code,{ownProperties:i}=this.opts,a=new pt.CodeGen(this.scope,{es5:n,lines:o,ownProperties:i}),s;t.$async&&(s=a.scopeValue("Error",{ref:M0.default,code:(0,pt._)`require("ajv/dist/runtime/validation_error").default`}));let c=a.scopeName("validate");t.validateName=c;let u={gen:a,allErrors:this.opts.allErrors,data:Sr.default.data,parentData:Sr.default.parentData,parentDataProperty:Sr.default.parentDataProperty,dataNames:[Sr.default.data],dataPathArr:[pt.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:a.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,pt.stringify)(t.schema)}:{ref:t.schema}),validateName:c,ValidationError:s,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:pt.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,pt._)`""`,opts:this.opts,self:this},l;try{this._compilations.add(t),(0,L0.validateFunctionCode)(u),a.optimize(this.opts.code.optimize);let d=a.toString();l=`${a.scopeRefs(Sr.default.scope)}return ${d}`,this.opts.code.process&&(l=this.opts.code.process(l,t));let f=new Function(`${Sr.default.self}`,`${Sr.default.scope}`,l)(this,this.scope.get());if(this.scope.value(c,{ref:f}),f.errors=null,f.schema=t.schema,f.schemaEnv=t,t.$async&&(f.$async=!0),this.opts.code.source===!0&&(f.source={validateName:c,validateCode:d,scopeValues:a._values}),this.opts.unevaluated){let{props:g,items:v}=u;f.evaluated={props:g instanceof pt.Name?void 0:g,items:v instanceof pt.Name?void 0:v,dynamicProps:g instanceof pt.Name,dynamicItems:v instanceof pt.Name},f.source&&(f.source.evaluated=(0,pt.stringify)(f.evaluated))}return t.validate=f,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)}}ot.compileSchema=ap;function q0(t,e,r){var n;r=(0,ft.resolveUrl)(this.opts.uriResolver,e,r);let o=t.refs[r];if(o)return o;let i=J0.call(this,t,r);if(i===void 0){let a=(n=t.localRefs)===null||n===void 0?void 0:n[r],{schemaId:s}=this.opts;a&&(i=new un({schema:a,schemaId:s,root:t,baseId:e}))}if(i!==void 0)return t.refs[r]=F0.call(this,i)}ot.resolveRef=q0;function F0(t){return(0,ft.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:ap.call(this,t)}function Uv(t){for(let e of this._compilations)if(V0(e,t))return e}ot.getCompilingSchema=Uv;function V0(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function J0(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||Va.call(this,t,e)}function Va(t,e){let r=this.opts.uriResolver.parse(e),n=(0,ft._getFullPath)(this.opts.uriResolver,r),o=(0,ft.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===o)return ip.call(this,r,t);let i=(0,ft.normalizeId)(n),a=this.refs[i]||this.schemas[i];if(typeof a=="string"){let s=Va.call(this,t,a);return typeof s?.schema!="object"?void 0:ip.call(this,r,s)}if(typeof a?.schema=="object"){if(a.validate||ap.call(this,a),i===(0,ft.normalizeId)(e)){let{schema:s}=a,{schemaId:c}=this.opts,u=s[c];return u&&(o=(0,ft.resolveUrl)(this.opts.uriResolver,o,u)),new un({schema:s,schemaId:c,root:t,baseId:o})}return ip.call(this,r,a)}}ot.resolveSchema=Va;var K0=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function ip(t,{baseId:e,schema:r,root:n}){var o;if(((o=t.fragment)===null||o===void 0?void 0:o[0])!=="/")return;for(let s of t.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let c=r[(0,Av.unescapeFragment)(s)];if(c===void 0)return;r=c;let u=typeof r=="object"&&r[this.opts.schemaId];!K0.has(s)&&u&&(e=(0,ft.resolveUrl)(this.opts.uriResolver,e,u))}let i;if(typeof r!="boolean"&&r.$ref&&!(0,Av.schemaHasRulesButRef)(r,this.RULES)){let s=(0,ft.resolveUrl)(this.opts.uriResolver,e,r.$ref);i=Va.call(this,n,s)}let{schemaId:a}=this.opts;if(i=i||new un({schema:r,schemaId:a,root:n,baseId:e}),i.schema!==i.root.schema)return i}});var Zv=S((bU,H0)=>{H0.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 cp=S((xU,qv)=>{"use strict";var W0=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),Mv=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);function sp(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 G0=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function Cv(t){return t.length=0,!0}function B0(t,e,r){if(t.length){let n=sp(t);if(n!=="")e.push(n);else return r.error=!0,!1;t.length=0}return!0}function X0(t){let e=0,r={error:!1,address:"",zone:""},n=[],o=[],i=!1,a=!1,s=B0;for(let c=0;c<t.length;c++){let u=t[c];if(!(u==="["||u==="]"))if(u===":"){if(i===!0&&(a=!0),!s(o,n,r))break;if(++e>7){r.error=!0;break}c>0&&t[c-1]===":"&&(i=!0),n.push(":");continue}else if(u==="%"){if(!s(o,n,r))break;s=Cv}else{o.push(u);continue}}return o.length&&(s===Cv?r.zone=o.join(""):a?n.push(o.join("")):n.push(sp(o))),r.address=n.join(""),r}function Lv(t){if(Y0(t,":")<2)return{host:t,isIPV6:!1};let e=X0(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 Y0(t,e){let r=0;for(let n=0;n<t.length;n++)t[n]===e&&r++;return r}function Q0(t){let e=t,r=[],n=-1,o=0;for(;o=e.length;){if(o===1){if(e===".")break;if(e==="/"){r.push("/");break}else{r.push(e);break}}else if(o===2){if(e[0]==="."){if(e[1]===".")break;if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&(e[1]==="."||e[1]==="/")){r.push("/");break}}else if(o===3&&e==="/.."){r.length!==0&&r.pop(),r.push("/");break}if(e[0]==="."){if(e[1]==="."){if(e[2]==="/"){e=e.slice(3);continue}}else if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&e[1]==="."){if(e[2]==="/"){e=e.slice(2);continue}else if(e[2]==="."&&e[3]==="/"){e=e.slice(3),r.length!==0&&r.pop();continue}}if((n=e.indexOf("/",1))===-1){r.push(e);break}else r.push(e.slice(0,n)),e=e.slice(n)}return r.join("")}function ez(t,e){let r=e!==!0?escape:unescape;return t.scheme!==void 0&&(t.scheme=r(t.scheme)),t.userinfo!==void 0&&(t.userinfo=r(t.userinfo)),t.host!==void 0&&(t.host=r(t.host)),t.path!==void 0&&(t.path=r(t.path)),t.query!==void 0&&(t.query=r(t.query)),t.fragment!==void 0&&(t.fragment=r(t.fragment)),t}function tz(t){let e=[];if(t.userinfo!==void 0&&(e.push(t.userinfo),e.push("@")),t.host!==void 0){let r=unescape(t.host);if(!Mv(r)){let n=Lv(r);n.isIPV6===!0?r=`[${n.escapedHost}]`:r=t.host}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}qv.exports={nonSimpleDomain:G0,recomposeAuthority:tz,normalizeComponentEncoding:ez,removeDotSegments:Q0,isIPv4:Mv,isUUID:W0,normalizeIPv6:Lv,stringArrayToHexStripped:sp}});var Hv=S((kU,Kv)=>{"use strict";var{isUUID:rz}=cp(),nz=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,oz=["http","https","ws","wss","urn","urn:uuid"];function iz(t){return oz.indexOf(t)!==-1}function up(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 Fv(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function Vv(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 az(t){return t.secure=up(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function sz(t){if((t.port===(up(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 cz(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(nz);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}`,i=lp(o);t.path=void 0,i&&(t=i.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}function uz(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}`,i=lp(o);i&&(t=i.serialize(t,e));let a=t,s=t.nss;return a.path=`${n||e.nid}:${s}`,e.skipEscape=!0,a}function lz(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!rz(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function dz(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var Jv={scheme:"http",domainHost:!0,parse:Fv,serialize:Vv},pz={scheme:"https",domainHost:Jv.domainHost,parse:Fv,serialize:Vv},Ka={scheme:"ws",domainHost:!0,parse:az,serialize:sz},fz={scheme:"wss",domainHost:Ka.domainHost,parse:Ka.parse,serialize:Ka.serialize},mz={scheme:"urn",parse:cz,serialize:uz,skipNormalize:!0},hz={scheme:"urn:uuid",parse:lz,serialize:dz,skipNormalize:!0},Ha={http:Jv,https:pz,ws:Ka,wss:fz,urn:mz,"urn:uuid":hz};Object.setPrototypeOf(Ha,null);function lp(t){return t&&(Ha[t]||Ha[t.toLowerCase()])||void 0}Kv.exports={wsIsSecure:up,SCHEMES:Ha,isValidSchemeName:iz,getSchemeHandler:lp}});var Bv=S((SU,Ga)=>{"use strict";var{normalizeIPv6:gz,removeDotSegments:Ko,recomposeAuthority:vz,normalizeComponentEncoding:Wa,isIPv4:_z,nonSimpleDomain:yz}=cp(),{SCHEMES:$z,getSchemeHandler:Wv}=Hv();function bz(t,e){return typeof t=="string"?t=bt(Lt(t,e),e):typeof t=="object"&&(t=Lt(bt(t,e),e)),t}function xz(t,e,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},o=Gv(Lt(t,n),Lt(e,n),n,!0);return n.skipEscape=!0,bt(o,n)}function Gv(t,e,r,n){let o={};return n||(t=Lt(bt(t,r),r),e=Lt(bt(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=Ko(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=Ko(e.path||""),o.query=e.query):(e.path?(e.path[0]==="/"?o.path=Ko(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=Ko(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 kz(t,e,r){return typeof t=="string"?(t=unescape(t),t=bt(Wa(Lt(t,r),!0),{...r,skipEscape:!0})):typeof t=="object"&&(t=bt(Wa(t,!0),{...r,skipEscape:!0})),typeof e=="string"?(e=unescape(e),e=bt(Wa(Lt(e,r),!0),{...r,skipEscape:!0})):typeof e=="object"&&(e=bt(Wa(e,!0),{...r,skipEscape:!0})),t.toLowerCase()===e.toLowerCase()}function bt(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=[],i=Wv(n.scheme||r.scheme);i&&i.serialize&&i.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=unescape(r.path):(r.path=escape(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&o.push(r.scheme,":");let a=vz(r);if(a!==void 0&&(n.reference!=="suffix"&&o.push("//"),o.push(a),r.path&&r.path[0]!=="/"&&o.push("/")),r.path!==void 0){let s=r.path;!n.absolutePath&&(!i||!i.absolutePath)&&(s=Ko(s)),a===void 0&&s[0]==="/"&&s[1]==="/"&&(s="/%2F"+s.slice(2)),o.push(s)}return r.query!==void 0&&o.push("?",r.query),r.fragment!==void 0&&o.push("#",r.fragment),o.join("")}var Sz=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function Lt(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;r.reference==="suffix"&&(r.scheme?t=r.scheme+":"+t:t="//"+t);let i=t.match(Sz);if(i){if(n.scheme=i[1],n.userinfo=i[3],n.host=i[4],n.port=parseInt(i[5],10),n.path=i[6]||"",n.query=i[7],n.fragment=i[8],isNaN(n.port)&&(n.port=i[5]),n.host)if(_z(n.host)===!1){let c=gz(n.host);n.host=c.host.toLowerCase(),o=c.isIPV6}else o=!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 a=Wv(r.scheme||n.scheme);if(!r.unicodeSupport&&(!a||!a.unicodeSupport)&&n.host&&(r.domainHost||a&&a.domainHost)&&o===!1&&yz(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(s){n.error=n.error||"Host's domain name can not be converted to ASCII: "+s}(!a||a&&!a.skipNormalize)&&(t.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=unescape(n.host))),n.path&&(n.path=escape(unescape(n.path))),n.fragment&&(n.fragment=encodeURI(decodeURIComponent(n.fragment)))),a&&a.parse&&a.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return n}var dp={SCHEMES:$z,normalize:bz,resolve:xz,resolveComponent:Gv,equal:kz,serialize:bt,parse:Lt};Ga.exports=dp;Ga.exports.default=dp;Ga.exports.fastUri=dp});var Yv=S(pp=>{"use strict";Object.defineProperty(pp,"__esModule",{value:!0});var Xv=Bv();Xv.code='require("ajv/dist/runtime/uri").default';pp.default=Xv});var a_=S(we=>{"use strict";Object.defineProperty(we,"__esModule",{value:!0});we.CodeGen=we.Name=we.nil=we.stringify=we.str=we._=we.KeywordCxt=void 0;var wz=Vo();Object.defineProperty(we,"KeywordCxt",{enumerable:!0,get:function(){return wz.KeywordCxt}});var ln=K();Object.defineProperty(we,"_",{enumerable:!0,get:function(){return ln._}});Object.defineProperty(we,"str",{enumerable:!0,get:function(){return ln.str}});Object.defineProperty(we,"stringify",{enumerable:!0,get:function(){return ln.stringify}});Object.defineProperty(we,"nil",{enumerable:!0,get:function(){return ln.nil}});Object.defineProperty(we,"Name",{enumerable:!0,get:function(){return ln.Name}});Object.defineProperty(we,"CodeGen",{enumerable:!0,get:function(){return ln.CodeGen}});var zz=Fa(),n_=Jo(),Iz=Ld(),Ho=Ja(),Ez=K(),Wo=Lo(),Ba=Mo(),mp=ee(),Qv=Zv(),Tz=Yv(),o_=(t,e)=>new RegExp(t,e);o_.code="new RegExp";var Pz=["removeAdditional","useDefaults","coerceTypes"],Oz=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),jz={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."},Dz={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},e_=200;function Nz(t){var e,r,n,o,i,a,s,c,u,l,d,m,f,g,v,$,k,O,I,Z,j,at,st,bs,xs;let yn=t.strict,ks=(e=t.code)===null||e===void 0?void 0:e.optimize,vf=ks===!0||ks===void 0?1:ks||0,_f=(n=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:o_,Fy=(o=t.uriResolver)!==null&&o!==void 0?o:Tz.default;return{strictSchema:(a=(i=t.strictSchema)!==null&&i!==void 0?i:yn)!==null&&a!==void 0?a:!0,strictNumbers:(c=(s=t.strictNumbers)!==null&&s!==void 0?s:yn)!==null&&c!==void 0?c:!0,strictTypes:(l=(u=t.strictTypes)!==null&&u!==void 0?u:yn)!==null&&l!==void 0?l:"log",strictTuples:(m=(d=t.strictTuples)!==null&&d!==void 0?d:yn)!==null&&m!==void 0?m:"log",strictRequired:(g=(f=t.strictRequired)!==null&&f!==void 0?f:yn)!==null&&g!==void 0?g:!1,code:t.code?{...t.code,optimize:vf,regExp:_f}:{optimize:vf,regExp:_f},loopRequired:(v=t.loopRequired)!==null&&v!==void 0?v:e_,loopEnum:($=t.loopEnum)!==null&&$!==void 0?$:e_,meta:(k=t.meta)!==null&&k!==void 0?k:!0,messages:(O=t.messages)!==null&&O!==void 0?O:!0,inlineRefs:(I=t.inlineRefs)!==null&&I!==void 0?I:!0,schemaId:(Z=t.schemaId)!==null&&Z!==void 0?Z:"$id",addUsedSchema:(j=t.addUsedSchema)!==null&&j!==void 0?j:!0,validateSchema:(at=t.validateSchema)!==null&&at!==void 0?at:!0,validateFormats:(st=t.validateFormats)!==null&&st!==void 0?st:!0,unicodeRegExp:(bs=t.unicodeRegExp)!==null&&bs!==void 0?bs:!0,int32range:(xs=t.int32range)!==null&&xs!==void 0?xs:!0,uriResolver:Fy}}var Go=class{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...Nz(e)};let{es5:r,lines:n}=this.opts.code;this.scope=new Ez.ValueScope({scope:{},prefixes:Oz,es5:r,lines:n}),this.logger=Mz(e.logger);let o=e.validateFormats;e.validateFormats=!1,this.RULES=(0,Iz.getRules)(),t_.call(this,jz,e,"NOT SUPPORTED"),t_.call(this,Dz,e,"DEPRECATED","warn"),this._metaOpts=Zz.call(this),e.formats&&Az.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&Uz.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),Rz.call(this),e.validateFormats=o}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:n}=this.opts,o=Qv;n==="id"&&(o={...Qv},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 i.call(this,l.$schema);let m=this._addSchema(l,d);return m.validate||a.call(this,m)}async function i(l){l&&!this.getSchema(l)&&await o.call(this,{$ref:l},!0)}async function a(l){try{return this._compileSchemaEnv(l)}catch(d){if(!(d instanceof n_.default))throw d;return s.call(this,d),await c.call(this,d.missingSchema),a.call(this,l)}}function s({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 i.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 a of e)this.addSchema(a,void 0,n,o);return this}let i;if(typeof e=="object"){let{schemaId:a}=this.opts;if(i=e[a],i!==void 0&&typeof i!="string")throw new Error(`schema ${a} must be string`)}return r=(0,Wo.normalizeId)(r||i),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 i="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(i);else throw new Error(i)}return o}getSchema(e){let r;for(;typeof(r=r_.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:n}=this.opts,o=new Ho.SchemaEnv({schema:{},schemaId:n});if(r=Ho.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=r_.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,Wo.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(qz.call(this,n,r),!r)return(0,mp.eachItem)(n,i=>fp.call(this,i)),this;Vz.call(this,r);let o={...r,type:(0,Ba.getJSONTypes)(r.type),schemaType:(0,Ba.getJSONTypes)(r.schemaType)};return(0,mp.eachItem)(n,o.type.length===0?i=>fp.call(this,i,o):i=>o.type.forEach(a=>fp.call(this,i,o,a))),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(i=>i.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,i)=>o+r+i)}$dataMetaSchema(e,r){let n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let o of r){let i=o.split("/").slice(1),a=e;for(let s of i)a=a[s];for(let s in n){let c=n[s];if(typeof c!="object")continue;let{$data:u}=c.definition,l=a[s];u&&l&&(a[s]=i_(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,i=this.opts.addUsedSchema){let a,{schemaId:s}=this.opts;if(typeof e=="object")a=e[s];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,Wo.normalizeId)(a||n);let u=Wo.getSchemaRefs.call(this,e,n);return c=new Ho.SchemaEnv({schema:e,schemaId:s,meta:r,baseId:n,localRefs:u}),this._cache.set(c.schema,c),i&&!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):Ho.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{Ho.compileSchema.call(this,e)}finally{this.opts=r}}};Go.ValidationError=zz.default;Go.MissingRefError=n_.default;we.default=Go;function t_(t,e,r,n="error"){for(let o in t){let i=o;i in e&&this.logger[n](`${r}: option ${o}. ${t[i]}`)}}function r_(t){return t=(0,Wo.normalizeId)(t),this.schemas[t]||this.refs[t]}function Rz(){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 Az(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function Uz(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 Zz(){let t={...this.opts};for(let e of Pz)delete t[e];return t}var Cz={log(){},warn(){},error(){}};function Mz(t){if(t===!1)return Cz;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 Lz=/^[a-z_$][a-z0-9_$:-]*$/i;function qz(t,e){let{RULES:r}=this;if((0,mp.eachItem)(t,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!Lz.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 fp(t,e,r){var n;let o=e?.post;if(r&&o)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:i}=this,a=o?i.post:i.rules.find(({type:c})=>c===r);if(a||(a={type:r,rules:[]},i.rules.push(a)),i.keywords[t]=!0,!e)return;let s={keyword:t,definition:{...e,type:(0,Ba.getJSONTypes)(e.type),schemaType:(0,Ba.getJSONTypes)(e.schemaType)}};e.before?Fz.call(this,a,s,e.before):a.rules.push(s),i.all[t]=s,(n=e.implements)===null||n===void 0||n.forEach(c=>this.addKeyword(c))}function Fz(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 Vz(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=i_(e)),t.validateSchema=this.compile(e,!0))}var Jz={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function i_(t){return{anyOf:[t,Jz]}}});var s_=S(hp=>{"use strict";Object.defineProperty(hp,"__esModule",{value:!0});var Kz={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};hp.default=Kz});var d_=S(wr=>{"use strict";Object.defineProperty(wr,"__esModule",{value:!0});wr.callRef=wr.getValidate=void 0;var Hz=Jo(),c_=nt(),Ve=K(),dn=Ct(),u_=Ja(),Xa=ee(),Wz={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:r,it:n}=t,{baseId:o,schemaEnv:i,validateName:a,opts:s,self:c}=n,{root:u}=i;if((r==="#"||r==="#/")&&o===u.baseId)return d();let l=u_.resolveRef.call(c,u,o,r);if(l===void 0)throw new Hz.default(n.opts.uriResolver,o,r);if(l instanceof u_.SchemaEnv)return m(l);return f(l);function d(){if(i===u)return Ya(t,a,i,i.$async);let g=e.scopeValue("root",{ref:u});return Ya(t,(0,Ve._)`${g}.validate`,u,u.$async)}function m(g){let v=l_(t,g);Ya(t,v,g,g.$async)}function f(g){let v=e.scopeValue("schema",s.code.source===!0?{ref:g,code:(0,Ve.stringify)(g)}:{ref:g}),$=e.name("valid"),k=t.subschema({schema:g,dataTypes:[],schemaPath:Ve.nil,topSchemaRef:v,errSchemaPath:r},$);t.mergeEvaluated(k),t.ok($)}}};function l_(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,Ve._)`${r.scopeValue("wrapper",{ref:e})}.validate`}wr.getValidate=l_;function Ya(t,e,r,n){let{gen:o,it:i}=t,{allErrors:a,schemaEnv:s,opts:c}=i,u=c.passContext?dn.default.this:Ve.nil;n?l():d();function l(){if(!s.$async)throw new Error("async schema referenced by sync schema");let g=o.let("valid");o.try(()=>{o.code((0,Ve._)`await ${(0,c_.callValidateCode)(t,e,u)}`),f(e),a||o.assign(g,!0)},v=>{o.if((0,Ve._)`!(${v} instanceof ${i.ValidationError})`,()=>o.throw(v)),m(v),a||o.assign(g,!1)}),t.ok(g)}function d(){t.result((0,c_.callValidateCode)(t,e,u),()=>f(e),()=>m(e))}function m(g){let v=(0,Ve._)`${g}.errors`;o.assign(dn.default.vErrors,(0,Ve._)`${dn.default.vErrors} === null ? ${v} : ${dn.default.vErrors}.concat(${v})`),o.assign(dn.default.errors,(0,Ve._)`${dn.default.vErrors}.length`)}function f(g){var v;if(!i.opts.unevaluated)return;let $=(v=r?.validate)===null||v===void 0?void 0:v.evaluated;if(i.props!==!0)if($&&!$.dynamicProps)$.props!==void 0&&(i.props=Xa.mergeEvaluated.props(o,$.props,i.props));else{let k=o.var("props",(0,Ve._)`${g}.evaluated.props`);i.props=Xa.mergeEvaluated.props(o,k,i.props,Ve.Name)}if(i.items!==!0)if($&&!$.dynamicItems)$.items!==void 0&&(i.items=Xa.mergeEvaluated.items(o,$.items,i.items));else{let k=o.var("items",(0,Ve._)`${g}.evaluated.items`);i.items=Xa.mergeEvaluated.items(o,k,i.items,Ve.Name)}}}wr.callRef=Ya;wr.default=Wz});var p_=S(gp=>{"use strict";Object.defineProperty(gp,"__esModule",{value:!0});var Gz=s_(),Bz=d_(),Xz=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",Gz.default,Bz.default];gp.default=Xz});var f_=S(vp=>{"use strict";Object.defineProperty(vp,"__esModule",{value:!0});var Qa=K(),sr=Qa.operators,es={maximum:{okStr:"<=",ok:sr.LTE,fail:sr.GT},minimum:{okStr:">=",ok:sr.GTE,fail:sr.LT},exclusiveMaximum:{okStr:"<",ok:sr.LT,fail:sr.GTE},exclusiveMinimum:{okStr:">",ok:sr.GT,fail:sr.LTE}},Yz={message:({keyword:t,schemaCode:e})=>(0,Qa.str)`must be ${es[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,Qa._)`{comparison: ${es[t].okStr}, limit: ${e}}`},Qz={keyword:Object.keys(es),type:"number",schemaType:"number",$data:!0,error:Yz,code(t){let{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0,Qa._)`${r} ${es[e].fail} ${n} || isNaN(${r})`)}};vp.default=Qz});var m_=S(_p=>{"use strict";Object.defineProperty(_p,"__esModule",{value:!0});var Bo=K(),eI={message:({schemaCode:t})=>(0,Bo.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,Bo._)`{multipleOf: ${t}}`},tI={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:eI,code(t){let{gen:e,data:r,schemaCode:n,it:o}=t,i=o.opts.multipleOfPrecision,a=e.let("res"),s=i?(0,Bo._)`Math.abs(Math.round(${a}) - ${a}) > 1e-${i}`:(0,Bo._)`${a} !== parseInt(${a})`;t.fail$data((0,Bo._)`(${n} === 0 || (${a} = ${r}/${n}, ${s}))`)}};_p.default=tI});var g_=S(yp=>{"use strict";Object.defineProperty(yp,"__esModule",{value:!0});function h_(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}yp.default=h_;h_.code='require("ajv/dist/runtime/ucs2length").default'});var v_=S($p=>{"use strict";Object.defineProperty($p,"__esModule",{value:!0});var zr=K(),rI=ee(),nI=g_(),oI={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,zr.str)`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>(0,zr._)`{limit: ${t}}`},iI={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:oI,code(t){let{keyword:e,data:r,schemaCode:n,it:o}=t,i=e==="maxLength"?zr.operators.GT:zr.operators.LT,a=o.opts.unicode===!1?(0,zr._)`${r}.length`:(0,zr._)`${(0,rI.useFunc)(t.gen,nI.default)}(${r})`;t.fail$data((0,zr._)`${a} ${i} ${n}`)}};$p.default=iI});var __=S(bp=>{"use strict";Object.defineProperty(bp,"__esModule",{value:!0});var aI=nt(),sI=ee(),pn=K(),cI={message:({schemaCode:t})=>(0,pn.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,pn._)`{pattern: ${t}}`},uI={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:cI,code(t){let{gen:e,data:r,$data:n,schema:o,schemaCode:i,it:a}=t,s=a.opts.unicodeRegExp?"u":"";if(n){let{regExp:c}=a.opts.code,u=c.code==="new RegExp"?(0,pn._)`new RegExp`:(0,sI.useFunc)(e,c),l=e.let("valid");e.try(()=>e.assign(l,(0,pn._)`${u}(${i}, ${s}).test(${r})`),()=>e.assign(l,!1)),t.fail$data((0,pn._)`!${l}`)}else{let c=(0,aI.usePattern)(t,o);t.fail$data((0,pn._)`!${c}.test(${r})`)}}};bp.default=uI});var y_=S(xp=>{"use strict";Object.defineProperty(xp,"__esModule",{value:!0});var Xo=K(),lI={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,Xo.str)`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>(0,Xo._)`{limit: ${t}}`},dI={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:lI,code(t){let{keyword:e,data:r,schemaCode:n}=t,o=e==="maxProperties"?Xo.operators.GT:Xo.operators.LT;t.fail$data((0,Xo._)`Object.keys(${r}).length ${o} ${n}`)}};xp.default=dI});var $_=S(kp=>{"use strict";Object.defineProperty(kp,"__esModule",{value:!0});var Yo=nt(),Qo=K(),pI=ee(),fI={message:({params:{missingProperty:t}})=>(0,Qo.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,Qo._)`{missingProperty: ${t}}`},mI={keyword:"required",type:"object",schemaType:"array",$data:!0,error:fI,code(t){let{gen:e,schema:r,schemaCode:n,data:o,$data:i,it:a}=t,{opts:s}=a;if(!i&&r.length===0)return;let c=r.length>=s.loopRequired;if(a.allErrors?u():l(),s.strictRequired){let f=t.parentSchema.properties,{definedProperties:g}=t.it;for(let v of r)if(f?.[v]===void 0&&!g.has(v)){let $=a.schemaEnv.baseId+a.errSchemaPath,k=`required property "${v}" is not defined at "${$}" (strictRequired)`;(0,pI.checkStrictMode)(a,k,a.opts.strictRequired)}}function u(){if(c||i)t.block$data(Qo.nil,d);else for(let f of r)(0,Yo.checkReportMissingProp)(t,f)}function l(){let f=e.let("missing");if(c||i){let g=e.let("valid",!0);t.block$data(g,()=>m(f,g)),t.ok(g)}else e.if((0,Yo.checkMissingProp)(t,r,f)),(0,Yo.reportMissingProp)(t,f),e.else()}function d(){e.forOf("prop",n,f=>{t.setParams({missingProperty:f}),e.if((0,Yo.noPropertyInData)(e,o,f,s.ownProperties),()=>t.error())})}function m(f,g){t.setParams({missingProperty:f}),e.forOf(f,n,()=>{e.assign(g,(0,Yo.propertyInData)(e,o,f,s.ownProperties)),e.if((0,Qo.not)(g),()=>{t.error(),e.break()})},Qo.nil)}}};kp.default=mI});var b_=S(Sp=>{"use strict";Object.defineProperty(Sp,"__esModule",{value:!0});var ei=K(),hI={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,ei.str)`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>(0,ei._)`{limit: ${t}}`},gI={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:hI,code(t){let{keyword:e,data:r,schemaCode:n}=t,o=e==="maxItems"?ei.operators.GT:ei.operators.LT;t.fail$data((0,ei._)`${r}.length ${o} ${n}`)}};Sp.default=gI});var ts=S(wp=>{"use strict";Object.defineProperty(wp,"__esModule",{value:!0});var x_=Gd();x_.code='require("ajv/dist/runtime/equal").default';wp.default=x_});var k_=S(Ip=>{"use strict";Object.defineProperty(Ip,"__esModule",{value:!0});var zp=Mo(),ze=K(),vI=ee(),_I=ts(),yI={message:({params:{i:t,j:e}})=>(0,ze.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,ze._)`{i: ${t}, j: ${e}}`},$I={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:yI,code(t){let{gen:e,data:r,$data:n,schema:o,parentSchema:i,schemaCode:a,it:s}=t;if(!n&&!o)return;let c=e.let("valid"),u=i.items?(0,zp.getSchemaTypes)(i.items):[];t.block$data(c,l,(0,ze._)`${a} === false`),t.ok(c);function l(){let g=e.let("i",(0,ze._)`${r}.length`),v=e.let("j");t.setParams({i:g,j:v}),e.assign(c,!0),e.if((0,ze._)`${g} > 1`,()=>(d()?m:f)(g,v))}function d(){return u.length>0&&!u.some(g=>g==="object"||g==="array")}function m(g,v){let $=e.name("item"),k=(0,zp.checkDataTypes)(u,$,s.opts.strictNumbers,zp.DataType.Wrong),O=e.const("indices",(0,ze._)`{}`);e.for((0,ze._)`;${g}--;`,()=>{e.let($,(0,ze._)`${r}[${g}]`),e.if(k,(0,ze._)`continue`),u.length>1&&e.if((0,ze._)`typeof ${$} == "string"`,(0,ze._)`${$} += "_"`),e.if((0,ze._)`typeof ${O}[${$}] == "number"`,()=>{e.assign(v,(0,ze._)`${O}[${$}]`),t.error(),e.assign(c,!1).break()}).code((0,ze._)`${O}[${$}] = ${g}`)})}function f(g,v){let $=(0,vI.useFunc)(e,_I.default),k=e.name("outer");e.label(k).for((0,ze._)`;${g}--;`,()=>e.for((0,ze._)`${v} = ${g}; ${v}--;`,()=>e.if((0,ze._)`${$}(${r}[${g}], ${r}[${v}])`,()=>{t.error(),e.assign(c,!1).break(k)})))}}};Ip.default=$I});var S_=S(Tp=>{"use strict";Object.defineProperty(Tp,"__esModule",{value:!0});var Ep=K(),bI=ee(),xI=ts(),kI={message:"must be equal to constant",params:({schemaCode:t})=>(0,Ep._)`{allowedValue: ${t}}`},SI={keyword:"const",$data:!0,error:kI,code(t){let{gen:e,data:r,$data:n,schemaCode:o,schema:i}=t;n||i&&typeof i=="object"?t.fail$data((0,Ep._)`!${(0,bI.useFunc)(e,xI.default)}(${r}, ${o})`):t.fail((0,Ep._)`${i} !== ${r}`)}};Tp.default=SI});var w_=S(Pp=>{"use strict";Object.defineProperty(Pp,"__esModule",{value:!0});var ti=K(),wI=ee(),zI=ts(),II={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,ti._)`{allowedValues: ${t}}`},EI={keyword:"enum",schemaType:"array",$data:!0,error:II,code(t){let{gen:e,data:r,$data:n,schema:o,schemaCode:i,it:a}=t;if(!n&&o.length===0)throw new Error("enum must have non-empty array");let s=o.length>=a.opts.loopEnum,c,u=()=>c??(c=(0,wI.useFunc)(e,zI.default)),l;if(s||n)l=e.let("valid"),t.block$data(l,d);else{if(!Array.isArray(o))throw new Error("ajv implementation error");let f=e.const("vSchema",i);l=(0,ti.or)(...o.map((g,v)=>m(f,v)))}t.pass(l);function d(){e.assign(l,!1),e.forOf("v",i,f=>e.if((0,ti._)`${u()}(${r}, ${f})`,()=>e.assign(l,!0).break()))}function m(f,g){let v=o[g];return typeof v=="object"&&v!==null?(0,ti._)`${u()}(${r}, ${f}[${g}])`:(0,ti._)`${r} === ${v}`}}};Pp.default=EI});var z_=S(Op=>{"use strict";Object.defineProperty(Op,"__esModule",{value:!0});var TI=f_(),PI=m_(),OI=v_(),jI=__(),DI=y_(),NI=$_(),RI=b_(),AI=k_(),UI=S_(),ZI=w_(),CI=[TI.default,PI.default,OI.default,jI.default,DI.default,NI.default,RI.default,AI.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},UI.default,ZI.default];Op.default=CI});var Dp=S(ri=>{"use strict";Object.defineProperty(ri,"__esModule",{value:!0});ri.validateAdditionalItems=void 0;var Ir=K(),jp=ee(),MI={message:({params:{len:t}})=>(0,Ir.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,Ir._)`{limit: ${t}}`},LI={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:MI,code(t){let{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){(0,jp.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}I_(t,n)}};function I_(t,e){let{gen:r,schema:n,data:o,keyword:i,it:a}=t;a.items=!0;let s=r.const("len",(0,Ir._)`${o}.length`);if(n===!1)t.setParams({len:e.length}),t.pass((0,Ir._)`${s} <= ${e.length}`);else if(typeof n=="object"&&!(0,jp.alwaysValidSchema)(a,n)){let u=r.var("valid",(0,Ir._)`${s} <= ${e.length}`);r.if((0,Ir.not)(u),()=>c(u)),t.ok(u)}function c(u){r.forRange("i",e.length,s,l=>{t.subschema({keyword:i,dataProp:l,dataPropType:jp.Type.Num},u),a.allErrors||r.if((0,Ir.not)(u),()=>r.break())})}}ri.validateAdditionalItems=I_;ri.default=LI});var Np=S(ni=>{"use strict";Object.defineProperty(ni,"__esModule",{value:!0});ni.validateTuple=void 0;var E_=K(),rs=ee(),qI=nt(),FI={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return T_(t,"additionalItems",e);r.items=!0,!(0,rs.alwaysValidSchema)(r,e)&&t.ok((0,qI.validateArray)(t))}};function T_(t,e,r=t.schema){let{gen:n,parentSchema:o,data:i,keyword:a,it:s}=t;l(o),s.opts.unevaluated&&r.length&&s.items!==!0&&(s.items=rs.mergeEvaluated.items(n,r.length,s.items));let c=n.name("valid"),u=n.const("len",(0,E_._)`${i}.length`);r.forEach((d,m)=>{(0,rs.alwaysValidSchema)(s,d)||(n.if((0,E_._)`${u} > ${m}`,()=>t.subschema({keyword:a,schemaProp:m,dataProp:m},c)),t.ok(c))});function l(d){let{opts:m,errSchemaPath:f}=s,g=r.length,v=g===d.minItems&&(g===d.maxItems||d[e]===!1);if(m.strictTuples&&!v){let $=`"${a}" is ${g}-tuple, but minItems or maxItems/${e} are not specified or different at path "${f}"`;(0,rs.checkStrictMode)(s,$,m.strictTuples)}}}ni.validateTuple=T_;ni.default=FI});var P_=S(Rp=>{"use strict";Object.defineProperty(Rp,"__esModule",{value:!0});var VI=Np(),JI={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,VI.validateTuple)(t,"items")};Rp.default=JI});var j_=S(Ap=>{"use strict";Object.defineProperty(Ap,"__esModule",{value:!0});var O_=K(),KI=ee(),HI=nt(),WI=Dp(),GI={message:({params:{len:t}})=>(0,O_.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,O_._)`{limit: ${t}}`},BI={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:GI,code(t){let{schema:e,parentSchema:r,it:n}=t,{prefixItems:o}=r;n.items=!0,!(0,KI.alwaysValidSchema)(n,e)&&(o?(0,WI.validateAdditionalItems)(t,o):t.ok((0,HI.validateArray)(t)))}};Ap.default=BI});var D_=S(Up=>{"use strict";Object.defineProperty(Up,"__esModule",{value:!0});var it=K(),ns=ee(),XI={message:({params:{min:t,max:e}})=>e===void 0?(0,it.str)`must contain at least ${t} valid item(s)`:(0,it.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,it._)`{minContains: ${t}}`:(0,it._)`{minContains: ${t}, maxContains: ${e}}`},YI={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:XI,code(t){let{gen:e,schema:r,parentSchema:n,data:o,it:i}=t,a,s,{minContains:c,maxContains:u}=n;i.opts.next?(a=c===void 0?1:c,s=u):a=1;let l=e.const("len",(0,it._)`${o}.length`);if(t.setParams({min:a,max:s}),s===void 0&&a===0){(0,ns.checkStrictMode)(i,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(s!==void 0&&a>s){(0,ns.checkStrictMode)(i,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,ns.alwaysValidSchema)(i,r)){let v=(0,it._)`${l} >= ${a}`;s!==void 0&&(v=(0,it._)`${v} && ${l} <= ${s}`),t.pass(v);return}i.items=!0;let d=e.name("valid");s===void 0&&a===1?f(d,()=>e.if(d,()=>e.break())):a===0?(e.let(d,!0),s!==void 0&&e.if((0,it._)`${o}.length > 0`,m)):(e.let(d,!1),m()),t.result(d,()=>t.reset());function m(){let v=e.name("_valid"),$=e.let("count",0);f(v,()=>e.if(v,()=>g($)))}function f(v,$){e.forRange("i",0,l,k=>{t.subschema({keyword:"contains",dataProp:k,dataPropType:ns.Type.Num,compositeRule:!0},v),$()})}function g(v){e.code((0,it._)`${v}++`),s===void 0?e.if((0,it._)`${v} >= ${a}`,()=>e.assign(d,!0).break()):(e.if((0,it._)`${v} > ${s}`,()=>e.assign(d,!1).break()),a===1?e.assign(d,!0):e.if((0,it._)`${v} >= ${a}`,()=>e.assign(d,!0)))}}};Up.default=YI});var A_=S(xt=>{"use strict";Object.defineProperty(xt,"__esModule",{value:!0});xt.validateSchemaDeps=xt.validatePropertyDeps=xt.error=void 0;var Zp=K(),QI=ee(),oi=nt();xt.error={message:({params:{property:t,depsCount:e,deps:r}})=>{let n=e===1?"property":"properties";return(0,Zp.str)`must have ${n} ${r} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:r,missingProperty:n}})=>(0,Zp._)`{property: ${t},
7
- missingProperty: ${n},
2
+ "use strict";var Ch=Object.create;var Gn=Object.defineProperty;var Mh=Object.getOwnPropertyDescriptor;var Dh=Object.getOwnPropertyNames;var jh=Object.getPrototypeOf,Zh=Object.prototype.hasOwnProperty;var $=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),cc=(t,e)=>{for(var r in e)Gn(t,r,{get:e[r],enumerable:!0})},Lh=(t,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Dh(e))!Zh.call(t,n)&&n!==r&&Gn(t,n,{get:()=>e[n],enumerable:!(o=Mh(e,n))||o.enumerable});return t};var vo=(t,e,r)=>(r=t!=null?Ch(jh(t)):{},Lh(e||!t||!t.__esModule?Gn(r,"default",{value:t,enumerable:!0}):r,t));var Fr=$(q=>{"use strict";Object.defineProperty(q,"__esModule",{value:!0});q.regexpCode=q.getEsmExportName=q.getProperty=q.safeStringify=q.stringify=q.strConcat=q.addCodeArg=q.str=q._=q.nil=q._Code=q.Name=q.IDENTIFIER=q._CodeOrName=void 0;var qr=class{};q._CodeOrName=qr;q.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var xt=class extends qr{constructor(e){if(super(),!q.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}}};q.Name=xt;var Ne=class extends qr{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,o)=>`${r}${o}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,o)=>(o instanceof xt&&(r[o.str]=(r[o.str]||0)+1),r),{})}};q._Code=Ne;q.nil=new Ne("");function Ep(t,...e){let r=[t[0]],o=0;for(;o<e.length;)ui(r,e[o]),r.push(t[++o]);return new Ne(r)}q._=Ep;var ci=new Ne("+");function kp(t,...e){let r=[Ur(t[0])],o=0;for(;o<e.length;)r.push(ci),ui(r,e[o]),r.push(ci,Ur(t[++o]));return av(r),new Ne(r)}q.str=kp;function ui(t,e){e instanceof Ne?t.push(...e._items):e instanceof xt?t.push(e):t.push(lv(e))}q.addCodeArg=ui;function av(t){let e=1;for(;e<t.length-1;){if(t[e]===ci){let r=cv(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function cv(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof xt||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 xt))return`"${t}${e.slice(1)}`}function uv(t,e){return e.emptyStr()?t:t.emptyStr()?e:kp`${t}${e}`}q.strConcat=uv;function lv(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:Ur(Array.isArray(t)?t.join(","):t)}function dv(t){return new Ne(Ur(t))}q.stringify=dv;function Ur(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}q.safeStringify=Ur;function pv(t){return typeof t=="string"&&q.IDENTIFIER.test(t)?new Ne(`.${t}`):Ep`[${t}]`}q.getProperty=pv;function fv(t){if(typeof t=="string"&&q.IDENTIFIER.test(t))return new Ne(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}q.getEsmExportName=fv;function mv(t){return new Ne(t.toString())}q.regexpCode=mv});var pi=$(we=>{"use strict";Object.defineProperty(we,"__esModule",{value:!0});we.ValueScope=we.ValueScopeName=we.Scope=we.varKinds=we.UsedValueState=void 0;var Se=Fr(),li=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},rn;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(rn||(we.UsedValueState=rn={}));we.varKinds={const:new Se.Name("const"),let:new Se.Name("let"),var:new Se.Name("var")};var on=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof Se.Name?e:this.name(e)}name(e){return new Se.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,o;if(!((o=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||o===void 0)&&o.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}}};we.Scope=on;var nn=class extends Se.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:o}){this.value=e,this.scopePath=(0,Se._)`.${new Se.Name(r)}[${o}]`}};we.ValueScopeName=nn;var hv=(0,Se._)`\n`,di=class extends on{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?hv:Se.nil}}get(){return this._scope}name(e){return new nn(e,this._newName(e))}value(e,r){var o;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let n=this.toName(e),{prefix:s}=n,i=(o=r.key)!==null&&o!==void 0?o: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,n);let c=this._scope[s]||(this._scope[s]=[]),u=c.length;return c[u]=r.ref,n.setValue(r,{property:s,itemIndex:u}),n}getValue(e,r){let o=this._values[e];if(o)return o.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,o=>{if(o.scopePath===void 0)throw new Error(`CodeGen: name "${o}" has no value`);return(0,Se._)`${e}${o.scopePath}`})}scopeCode(e=this._values,r,o){return this._reduceValues(e,n=>{if(n.value===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return n.value.code},r,o)}_reduceValues(e,r,o={},n){let s=Se.nil;for(let i in e){let a=e[i];if(!a)continue;let c=o[i]=o[i]||new Map;a.forEach(u=>{if(c.has(u))return;c.set(u,rn.Started);let l=r(u);if(l){let d=this.opts.es5?we.varKinds.var:we.varKinds.const;s=(0,Se._)`${s}${d} ${u} = ${l};${this.opts._n}`}else if(l=n?.(u))s=(0,Se._)`${s}${l}${this.opts._n}`;else throw new li(u);c.set(u,rn.Completed)})}return s}};we.ValueScope=di});var I=$(A=>{"use strict";Object.defineProperty(A,"__esModule",{value:!0});A.or=A.and=A.not=A.CodeGen=A.operators=A.varKinds=A.ValueScopeName=A.ValueScope=A.Scope=A.Name=A.regexpCode=A.stringify=A.getProperty=A.nil=A.strConcat=A.str=A._=void 0;var D=Fr(),Ze=pi(),ht=Fr();Object.defineProperty(A,"_",{enumerable:!0,get:function(){return ht._}});Object.defineProperty(A,"str",{enumerable:!0,get:function(){return ht.str}});Object.defineProperty(A,"strConcat",{enumerable:!0,get:function(){return ht.strConcat}});Object.defineProperty(A,"nil",{enumerable:!0,get:function(){return ht.nil}});Object.defineProperty(A,"getProperty",{enumerable:!0,get:function(){return ht.getProperty}});Object.defineProperty(A,"stringify",{enumerable:!0,get:function(){return ht.stringify}});Object.defineProperty(A,"regexpCode",{enumerable:!0,get:function(){return ht.regexpCode}});Object.defineProperty(A,"Name",{enumerable:!0,get:function(){return ht.Name}});var un=pi();Object.defineProperty(A,"Scope",{enumerable:!0,get:function(){return un.Scope}});Object.defineProperty(A,"ValueScope",{enumerable:!0,get:function(){return un.ValueScope}});Object.defineProperty(A,"ValueScopeName",{enumerable:!0,get:function(){return un.ValueScopeName}});Object.defineProperty(A,"varKinds",{enumerable:!0,get:function(){return un.varKinds}});A.operators={GT:new D._Code(">"),GTE:new D._Code(">="),LT:new D._Code("<"),LTE:new D._Code("<="),EQ:new D._Code("==="),NEQ:new D._Code("!=="),NOT:new D._Code("!"),OR:new D._Code("||"),AND:new D._Code("&&"),ADD:new D._Code("+")};var rt=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},fi=class extends rt{constructor(e,r,o){super(),this.varKind=e,this.name=r,this.rhs=o}render({es5:e,_n:r}){let o=e?Ze.varKinds.var:this.varKind,n=this.rhs===void 0?"":` = ${this.rhs}`;return`${o} ${this.name}${n};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=Gt(this.rhs,e,r)),this}get names(){return this.rhs instanceof D._CodeOrName?this.rhs.names:{}}},sn=class extends rt{constructor(e,r,o){super(),this.lhs=e,this.rhs=r,this.sideEffects=o}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof D.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=Gt(this.rhs,e,r),this}get names(){let e=this.lhs instanceof D.Name?{}:{...this.lhs.names};return cn(e,this.rhs)}},mi=class extends sn{constructor(e,r,o,n){super(e,o,n),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},hi=class extends rt{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},gi=class extends rt{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},_i=class extends rt{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},yi=class extends rt{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=Gt(this.code,e,r),this}get names(){return this.code instanceof D._CodeOrName?this.code.names:{}}},Vr=class extends rt{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,o)=>r+o.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let o=e[r].optimizeNodes();Array.isArray(o)?e.splice(r,1,...o):o?e[r]=o:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:o}=this,n=o.length;for(;n--;){let s=o[n];s.optimizeNames(e,r)||(gv(e,s.names),o.splice(n,1))}return o.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>Pt(e,r.names),{})}},ot=class extends Vr{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},vi=class extends Vr{},Kt=class extends ot{};Kt.kind="else";var Et=class t extends ot{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 o=r.optimizeNodes();r=this.else=Array.isArray(o)?new Kt(o):o}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(Pp(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var o;if(this.else=(o=this.else)===null||o===void 0?void 0:o.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=Gt(this.condition,e,r),this}get names(){let e=super.names;return cn(e,this.condition),this.else&&Pt(e,this.else.names),e}};Et.kind="if";var kt=class extends ot{};kt.kind="for";var $i=class extends kt{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=Gt(this.iteration,e,r),this}get names(){return Pt(super.names,this.iteration.names)}},bi=class extends kt{constructor(e,r,o,n){super(),this.varKind=e,this.name=r,this.from=o,this.to=n}render(e){let r=e.es5?Ze.varKinds.var:this.varKind,{name:o,from:n,to:s}=this;return`for(${r} ${o}=${n}; ${o}<${s}; ${o}++)`+super.render(e)}get names(){let e=cn(super.names,this.from);return cn(e,this.to)}},an=class extends kt{constructor(e,r,o,n){super(),this.loop=e,this.varKind=r,this.name=o,this.iterable=n}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=Gt(this.iterable,e,r),this}get names(){return Pt(super.names,this.iterable.names)}},Hr=class extends ot{constructor(e,r,o){super(),this.name=e,this.args=r,this.async=o}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};Hr.kind="func";var Jr=class extends Vr{render(e){return"return "+super.render(e)}};Jr.kind="return";var Si=class extends ot{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 o,n;return super.optimizeNames(e,r),(o=this.catch)===null||o===void 0||o.optimizeNames(e,r),(n=this.finally)===null||n===void 0||n.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&Pt(e,this.catch.names),this.finally&&Pt(e,this.finally.names),e}},Kr=class extends ot{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};Kr.kind="catch";var Gr=class extends ot{render(e){return"finally"+super.render(e)}};Gr.kind="finally";var wi=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
3
+ `:""},this._extScope=e,this._scope=new Ze.Scope({parent:e}),this._nodes=[new vi]}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 o=this._extScope.value(e,r);return(this._values[o.prefix]||(this._values[o.prefix]=new Set)).add(o),o}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,o,n){let s=this._scope.toName(r);return o!==void 0&&n&&(this._constants[s.str]=o),this._leafNode(new fi(e,s,o)),s}const(e,r,o){return this._def(Ze.varKinds.const,e,r,o)}let(e,r,o){return this._def(Ze.varKinds.let,e,r,o)}var(e,r,o){return this._def(Ze.varKinds.var,e,r,o)}assign(e,r,o){return this._leafNode(new sn(e,r,o))}add(e,r){return this._leafNode(new mi(e,A.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==D.nil&&this._leafNode(new yi(e)),this}object(...e){let r=["{"];for(let[o,n]of e)r.length>1&&r.push(","),r.push(o),(o!==n||this.opts.es5)&&(r.push(":"),(0,D.addCodeArg)(r,n));return r.push("}"),new D._Code(r)}if(e,r,o){if(this._blockNode(new Et(e)),r&&o)this.code(r).else().code(o).endIf();else if(r)this.code(r).endIf();else if(o)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new Et(e))}else(){return this._elseNode(new Kt)}endIf(){return this._endBlockNode(Et,Kt)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new $i(e),r)}forRange(e,r,o,n,s=this.opts.es5?Ze.varKinds.var:Ze.varKinds.let){let i=this._scope.toName(e);return this._for(new bi(s,i,r,o),()=>n(i))}forOf(e,r,o,n=Ze.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let i=r instanceof D.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,D._)`${i}.length`,a=>{this.var(s,(0,D._)`${i}[${a}]`),o(s)})}return this._for(new an("of",n,s,r),()=>o(s))}forIn(e,r,o,n=this.opts.es5?Ze.varKinds.var:Ze.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,D._)`Object.keys(${r})`,o);let s=this._scope.toName(e);return this._for(new an("in",n,s,r),()=>o(s))}endFor(){return this._endBlockNode(kt)}label(e){return this._leafNode(new hi(e))}break(e){return this._leafNode(new gi(e))}return(e){let r=new Jr;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Jr)}try(e,r,o){if(!r&&!o)throw new Error('CodeGen: "try" without "catch" and "finally"');let n=new Si;if(this._blockNode(n),this.code(e),r){let s=this.name("e");this._currNode=n.catch=new Kr(s),r(s)}return o&&(this._currNode=n.finally=new Gr,this.code(o)),this._endBlockNode(Kr,Gr)}throw(e){return this._leafNode(new _i(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 o=this._nodes.length-r;if(o<0||e!==void 0&&o!==e)throw new Error(`CodeGen: wrong number of nodes: ${o} vs ${e} expected`);return this._nodes.length=r,this}func(e,r=D.nil,o,n){return this._blockNode(new Hr(e,r,o)),n&&this.code(n).endFunc(),this}endFunc(){return this._endBlockNode(Hr)}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 o=this._currNode;if(o instanceof e||r&&o 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 Et))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}};A.CodeGen=wi;function Pt(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}function cn(t,e){return e instanceof D._CodeOrName?Pt(t,e.names):t}function Gt(t,e,r){if(t instanceof D.Name)return o(t);if(!n(t))return t;return new D._Code(t._items.reduce((s,i)=>(i instanceof D.Name&&(i=o(i)),i instanceof D._Code?s.push(...i._items):s.push(i),s),[]));function o(s){let i=r[s.str];return i===void 0||e[s.str]!==1?s:(delete e[s.str],i)}function n(s){return s instanceof D._Code&&s._items.some(i=>i instanceof D.Name&&e[i.str]===1&&r[i.str]!==void 0)}}function gv(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}function Pp(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,D._)`!${zi(t)}`}A.not=Pp;var _v=Tp(A.operators.AND);function yv(...t){return t.reduce(_v)}A.and=yv;var vv=Tp(A.operators.OR);function $v(...t){return t.reduce(vv)}A.or=$v;function Tp(t){return(e,r)=>e===D.nil?r:r===D.nil?e:(0,D._)`${zi(e)} ${t} ${zi(r)}`}function zi(t){return t instanceof D.Name?t:(0,D._)`(${t})`}});var Z=$(N=>{"use strict";Object.defineProperty(N,"__esModule",{value:!0});N.checkStrictMode=N.getErrorPath=N.Type=N.useFunc=N.setEvaluated=N.evaluatedPropsToName=N.mergeEvaluated=N.eachItem=N.unescapeJsonPointer=N.escapeJsonPointer=N.escapeFragment=N.unescapeFragment=N.schemaRefOrVal=N.schemaHasRulesButRef=N.schemaHasRules=N.checkUnknownRules=N.alwaysValidSchema=N.toHash=void 0;var H=I(),bv=Fr();function Sv(t){let e={};for(let r of t)e[r]=!0;return e}N.toHash=Sv;function wv(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(Ip(t,e),!Ap(e,t.self.RULES.all))}N.alwaysValidSchema=wv;function Ip(t,e=t.schema){let{opts:r,self:o}=t;if(!r.strictSchema||typeof e=="boolean")return;let n=o.RULES.keywords;for(let s in e)n[s]||Mp(t,`unknown keyword: "${s}"`)}N.checkUnknownRules=Ip;function Ap(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}N.schemaHasRules=Ap;function zv(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}N.schemaHasRulesButRef=zv;function xv({topSchemaRef:t,schemaPath:e},r,o,n){if(!n){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,H._)`${r}`}return(0,H._)`${t}${e}${(0,H.getProperty)(o)}`}N.schemaRefOrVal=xv;function Ev(t){return Np(decodeURIComponent(t))}N.unescapeFragment=Ev;function kv(t){return encodeURIComponent(Ei(t))}N.escapeFragment=kv;function Ei(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}N.escapeJsonPointer=Ei;function Np(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}N.unescapeJsonPointer=Np;function Pv(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}N.eachItem=Pv;function Op({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:o}){return(n,s,i,a)=>{let c=i===void 0?s:i instanceof H.Name?(s instanceof H.Name?t(n,s,i):e(n,s,i),i):s instanceof H.Name?(e(n,i,s),s):r(s,i);return a===H.Name&&!(c instanceof H.Name)?o(n,c):c}}N.mergeEvaluated={props:Op({mergeNames:(t,e,r)=>t.if((0,H._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,H._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,H._)`${r} || {}`).code((0,H._)`Object.assign(${r}, ${e})`))}),mergeToName:(t,e,r)=>t.if((0,H._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,H._)`${r} || {}`),ki(t,r,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:Cp}),items:Op({mergeNames:(t,e,r)=>t.if((0,H._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,H._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),mergeToName:(t,e,r)=>t.if((0,H._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,H._)`${r} > ${e} ? ${r} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function Cp(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,H._)`{}`);return e!==void 0&&ki(t,r,e),r}N.evaluatedPropsToName=Cp;function ki(t,e,r){Object.keys(r).forEach(o=>t.assign((0,H._)`${e}${(0,H.getProperty)(o)}`,!0))}N.setEvaluated=ki;var Rp={};function Tv(t,e){return t.scopeValue("func",{ref:e,code:Rp[e.code]||(Rp[e.code]=new bv._Code(e.code))})}N.useFunc=Tv;var xi;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(xi||(N.Type=xi={}));function Ov(t,e,r){if(t instanceof H.Name){let o=e===xi.Num;return r?o?(0,H._)`"[" + ${t} + "]"`:(0,H._)`"['" + ${t} + "']"`:o?(0,H._)`"/" + ${t}`:(0,H._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,H.getProperty)(t).toString():"/"+Ei(t)}N.getErrorPath=Ov;function Mp(t,e,r=t.opts.strictSchema){if(r){if(e=`strict mode: ${e}`,r===!0)throw new Error(e);t.self.logger.warn(e)}}N.checkStrictMode=Mp});var nt=$(Pi=>{"use strict";Object.defineProperty(Pi,"__esModule",{value:!0});var me=I(),Rv={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")};Pi.default=Rv});var Wr=$(he=>{"use strict";Object.defineProperty(he,"__esModule",{value:!0});he.extendErrors=he.resetErrorsCount=he.reportExtraError=he.reportError=he.keyword$DataError=he.keywordError=void 0;var L=I(),ln=Z(),ve=nt();he.keywordError={message:({keyword:t})=>(0,L.str)`must pass "${t}" keyword validation`};he.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,L.str)`"${t}" keyword must be ${e} ($data)`:(0,L.str)`"${t}" keyword is invalid ($data)`};function Iv(t,e=he.keywordError,r,o){let{it:n}=t,{gen:s,compositeRule:i,allErrors:a}=n,c=Zp(t,e,r);o??(i||a)?Dp(s,c):jp(n,(0,L._)`[${c}]`)}he.reportError=Iv;function Av(t,e=he.keywordError,r){let{it:o}=t,{gen:n,compositeRule:s,allErrors:i}=o,a=Zp(t,e,r);Dp(n,a),s||i||jp(o,ve.default.vErrors)}he.reportExtraError=Av;function Nv(t,e){t.assign(ve.default.errors,e),t.if((0,L._)`${ve.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,L._)`${ve.default.vErrors}.length`,e),()=>t.assign(ve.default.vErrors,null)))}he.resetErrorsCount=Nv;function Cv({gen:t,keyword:e,schemaValue:r,data:o,errsCount:n,it:s}){if(n===void 0)throw new Error("ajv implementation error");let i=t.name("err");t.forRange("i",n,ve.default.errors,a=>{t.const(i,(0,L._)`${ve.default.vErrors}[${a}]`),t.if((0,L._)`${i}.instancePath === undefined`,()=>t.assign((0,L._)`${i}.instancePath`,(0,L.strConcat)(ve.default.instancePath,s.errorPath))),t.assign((0,L._)`${i}.schemaPath`,(0,L.str)`${s.errSchemaPath}/${e}`),s.opts.verbose&&(t.assign((0,L._)`${i}.schema`,r),t.assign((0,L._)`${i}.data`,o))})}he.extendErrors=Cv;function Dp(t,e){let r=t.const("err",e);t.if((0,L._)`${ve.default.vErrors} === null`,()=>t.assign(ve.default.vErrors,(0,L._)`[${r}]`),(0,L._)`${ve.default.vErrors}.push(${r})`),t.code((0,L._)`${ve.default.errors}++`)}function jp(t,e){let{gen:r,validateName:o,schemaEnv:n}=t;n.$async?r.throw((0,L._)`new ${t.ValidationError}(${e})`):(r.assign((0,L._)`${o}.errors`,e),r.return(!1))}var Tt={keyword:new L.Name("keyword"),schemaPath:new L.Name("schemaPath"),params:new L.Name("params"),propertyName:new L.Name("propertyName"),message:new L.Name("message"),schema:new L.Name("schema"),parentSchema:new L.Name("parentSchema")};function Zp(t,e,r){let{createErrors:o}=t.it;return o===!1?(0,L._)`{}`:Mv(t,e,r)}function Mv(t,e,r={}){let{gen:o,it:n}=t,s=[Dv(n,r),jv(t,r)];return Zv(t,e,s),o.object(...s)}function Dv({errorPath:t},{instancePath:e}){let r=e?(0,L.str)`${t}${(0,ln.getErrorPath)(e,ln.Type.Str)}`:t;return[ve.default.instancePath,(0,L.strConcat)(ve.default.instancePath,r)]}function jv({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:o}){let n=o?e:(0,L.str)`${e}/${t}`;return r&&(n=(0,L.str)`${n}${(0,ln.getErrorPath)(r,ln.Type.Str)}`),[Tt.schemaPath,n]}function Zv(t,{params:e,message:r},o){let{keyword:n,data:s,schemaValue:i,it:a}=t,{opts:c,propertyName:u,topSchemaRef:l,schemaPath:d}=a;o.push([Tt.keyword,n],[Tt.params,typeof e=="function"?e(t):e||(0,L._)`{}`]),c.messages&&o.push([Tt.message,typeof r=="function"?r(t):r]),c.verbose&&o.push([Tt.schema,i],[Tt.parentSchema,(0,L._)`${l}${d}`],[ve.default.data,s]),u&&o.push([Tt.propertyName,u])}});var qp=$(Wt=>{"use strict";Object.defineProperty(Wt,"__esModule",{value:!0});Wt.boolOrEmptySchema=Wt.topBoolOrEmptySchema=void 0;var Lv=Wr(),qv=I(),Uv=nt(),Fv={message:"boolean schema is false"};function Vv(t){let{gen:e,schema:r,validateName:o}=t;r===!1?Lp(t,!1):typeof r=="object"&&r.$async===!0?e.return(Uv.default.data):(e.assign((0,qv._)`${o}.errors`,null),e.return(!0))}Wt.topBoolOrEmptySchema=Vv;function Hv(t,e){let{gen:r,schema:o}=t;o===!1?(r.var(e,!1),Lp(t)):r.var(e,!0)}Wt.boolOrEmptySchema=Hv;function Lp(t,e){let{gen:r,data:o}=t,n={gen:r,keyword:"false schema",data:o,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,Lv.reportError)(n,Fv,void 0,e)}});var Ti=$(Bt=>{"use strict";Object.defineProperty(Bt,"__esModule",{value:!0});Bt.getRules=Bt.isJSONType=void 0;var Jv=["string","number","integer","boolean","null","object","array"],Kv=new Set(Jv);function Gv(t){return typeof t=="string"&&Kv.has(t)}Bt.isJSONType=Gv;function Wv(){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:{}}}Bt.getRules=Wv});var Oi=$(gt=>{"use strict";Object.defineProperty(gt,"__esModule",{value:!0});gt.shouldUseRule=gt.shouldUseGroup=gt.schemaHasRulesForType=void 0;function Bv({schema:t,self:e},r){let o=e.RULES.types[r];return o&&o!==!0&&Up(t,o)}gt.schemaHasRulesForType=Bv;function Up(t,e){return e.rules.some(r=>Fp(t,r))}gt.shouldUseGroup=Up;function Fp(t,e){var r;return t[e.keyword]!==void 0||((r=e.definition.implements)===null||r===void 0?void 0:r.some(o=>t[o]!==void 0))}gt.shouldUseRule=Fp});var Br=$(ge=>{"use strict";Object.defineProperty(ge,"__esModule",{value:!0});ge.reportTypeError=ge.checkDataTypes=ge.checkDataType=ge.coerceAndCheckDataType=ge.getJSONTypes=ge.getSchemaTypes=ge.DataType=void 0;var Yv=Ti(),Xv=Oi(),Qv=Wr(),R=I(),Vp=Z(),Yt;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(Yt||(ge.DataType=Yt={}));function e$(t){let e=Hp(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}ge.getSchemaTypes=e$;function Hp(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(Yv.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}ge.getJSONTypes=Hp;function t$(t,e){let{gen:r,data:o,opts:n}=t,s=r$(e,n.coerceTypes),i=e.length>0&&!(s.length===0&&e.length===1&&(0,Xv.schemaHasRulesForType)(t,e[0]));if(i){let a=Ii(e,o,n.strictNumbers,Yt.Wrong);r.if(a,()=>{s.length?o$(t,e,s):Ai(t)})}return i}ge.coerceAndCheckDataType=t$;var Jp=new Set(["string","number","integer","boolean","null"]);function r$(t,e){return e?t.filter(r=>Jp.has(r)||e==="array"&&r==="array"):[]}function o$(t,e,r){let{gen:o,data:n,opts:s}=t,i=o.let("dataType",(0,R._)`typeof ${n}`),a=o.let("coerced",(0,R._)`undefined`);s.coerceTypes==="array"&&o.if((0,R._)`${i} == 'object' && Array.isArray(${n}) && ${n}.length == 1`,()=>o.assign(n,(0,R._)`${n}[0]`).assign(i,(0,R._)`typeof ${n}`).if(Ii(e,n,s.strictNumbers),()=>o.assign(a,n))),o.if((0,R._)`${a} !== undefined`);for(let u of r)(Jp.has(u)||u==="array"&&s.coerceTypes==="array")&&c(u);o.else(),Ai(t),o.endIf(),o.if((0,R._)`${a} !== undefined`,()=>{o.assign(n,a),n$(t,a)});function c(u){switch(u){case"string":o.elseIf((0,R._)`${i} == "number" || ${i} == "boolean"`).assign(a,(0,R._)`"" + ${n}`).elseIf((0,R._)`${n} === null`).assign(a,(0,R._)`""`);return;case"number":o.elseIf((0,R._)`${i} == "boolean" || ${n} === null
4
+ || (${i} == "string" && ${n} && ${n} == +${n})`).assign(a,(0,R._)`+${n}`);return;case"integer":o.elseIf((0,R._)`${i} === "boolean" || ${n} === null
5
+ || (${i} === "string" && ${n} && ${n} == +${n} && !(${n} % 1))`).assign(a,(0,R._)`+${n}`);return;case"boolean":o.elseIf((0,R._)`${n} === "false" || ${n} === 0 || ${n} === null`).assign(a,!1).elseIf((0,R._)`${n} === "true" || ${n} === 1`).assign(a,!0);return;case"null":o.elseIf((0,R._)`${n} === "" || ${n} === 0 || ${n} === false`),o.assign(a,null);return;case"array":o.elseIf((0,R._)`${i} === "string" || ${i} === "number"
6
+ || ${i} === "boolean" || ${n} === null`).assign(a,(0,R._)`[${n}]`)}}}function n$({gen:t,parentData:e,parentDataProperty:r},o){t.if((0,R._)`${e} !== undefined`,()=>t.assign((0,R._)`${e}[${r}]`,o))}function Ri(t,e,r,o=Yt.Correct){let n=o===Yt.Correct?R.operators.EQ:R.operators.NEQ,s;switch(t){case"null":return(0,R._)`${e} ${n} null`;case"array":s=(0,R._)`Array.isArray(${e})`;break;case"object":s=(0,R._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":s=i((0,R._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":s=i();break;default:return(0,R._)`typeof ${e} ${n} ${t}`}return o===Yt.Correct?s:(0,R.not)(s);function i(a=R.nil){return(0,R.and)((0,R._)`typeof ${e} == "number"`,a,r?(0,R._)`isFinite(${e})`:R.nil)}}ge.checkDataType=Ri;function Ii(t,e,r,o){if(t.length===1)return Ri(t[0],e,r,o);let n,s=(0,Vp.toHash)(t);if(s.array&&s.object){let i=(0,R._)`typeof ${e} != "object"`;n=s.null?i:(0,R._)`!${e} || ${i}`,delete s.null,delete s.array,delete s.object}else n=R.nil;s.number&&delete s.integer;for(let i in s)n=(0,R.and)(n,Ri(i,e,r,o));return n}ge.checkDataTypes=Ii;var s$={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,R._)`{type: ${t}}`:(0,R._)`{type: ${e}}`};function Ai(t){let e=i$(t);(0,Qv.reportError)(e,s$)}ge.reportTypeError=Ai;function i$(t){let{gen:e,data:r,schema:o}=t,n=(0,Vp.schemaRefOrVal)(t,o,"type");return{gen:e,keyword:"type",data:r,schema:o.type,schemaCode:n,schemaValue:n,parentSchema:o,params:{},it:t}}});var Gp=$(dn=>{"use strict";Object.defineProperty(dn,"__esModule",{value:!0});dn.assignDefaults=void 0;var Xt=I(),a$=Z();function c$(t,e){let{properties:r,items:o}=t.schema;if(e==="object"&&r)for(let n in r)Kp(t,n,r[n].default);else e==="array"&&Array.isArray(o)&&o.forEach((n,s)=>Kp(t,s,n.default))}dn.assignDefaults=c$;function Kp(t,e,r){let{gen:o,compositeRule:n,data:s,opts:i}=t;if(r===void 0)return;let a=(0,Xt._)`${s}${(0,Xt.getProperty)(e)}`;if(n){(0,a$.checkStrictMode)(t,`default is ignored for: ${a}`);return}let c=(0,Xt._)`${a} === undefined`;i.useDefaults==="empty"&&(c=(0,Xt._)`${c} || ${a} === null || ${a} === ""`),o.if(c,(0,Xt._)`${a} = ${(0,Xt.stringify)(r)}`)}});var Ce=$(V=>{"use strict";Object.defineProperty(V,"__esModule",{value:!0});V.validateUnion=V.validateArray=V.usePattern=V.callValidateCode=V.schemaProperties=V.allSchemaProperties=V.noPropertyInData=V.propertyInData=V.isOwnProperty=V.hasPropFunc=V.reportMissingProp=V.checkMissingProp=V.checkReportMissingProp=void 0;var B=I(),Ni=Z(),_t=nt(),u$=Z();function l$(t,e){let{gen:r,data:o,it:n}=t;r.if(Mi(r,o,e,n.opts.ownProperties),()=>{t.setParams({missingProperty:(0,B._)`${e}`},!0),t.error()})}V.checkReportMissingProp=l$;function d$({gen:t,data:e,it:{opts:r}},o,n){return(0,B.or)(...o.map(s=>(0,B.and)(Mi(t,e,s,r.ownProperties),(0,B._)`${n} = ${s}`)))}V.checkMissingProp=d$;function p$(t,e){t.setParams({missingProperty:e},!0),t.error()}V.reportMissingProp=p$;function Wp(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,B._)`Object.prototype.hasOwnProperty`})}V.hasPropFunc=Wp;function Ci(t,e,r){return(0,B._)`${Wp(t)}.call(${e}, ${r})`}V.isOwnProperty=Ci;function f$(t,e,r,o){let n=(0,B._)`${e}${(0,B.getProperty)(r)} !== undefined`;return o?(0,B._)`${n} && ${Ci(t,e,r)}`:n}V.propertyInData=f$;function Mi(t,e,r,o){let n=(0,B._)`${e}${(0,B.getProperty)(r)} === undefined`;return o?(0,B.or)(n,(0,B.not)(Ci(t,e,r))):n}V.noPropertyInData=Mi;function Bp(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}V.allSchemaProperties=Bp;function m$(t,e){return Bp(e).filter(r=>!(0,Ni.alwaysValidSchema)(t,e[r]))}V.schemaProperties=m$;function h$({schemaCode:t,data:e,it:{gen:r,topSchemaRef:o,schemaPath:n,errorPath:s},it:i},a,c,u){let l=u?(0,B._)`${t}, ${e}, ${o}${n}`:e,d=[[_t.default.instancePath,(0,B.strConcat)(_t.default.instancePath,s)],[_t.default.parentData,i.parentData],[_t.default.parentDataProperty,i.parentDataProperty],[_t.default.rootData,_t.default.rootData]];i.opts.dynamicRef&&d.push([_t.default.dynamicAnchors,_t.default.dynamicAnchors]);let p=(0,B._)`${l}, ${r.object(...d)}`;return c!==B.nil?(0,B._)`${a}.call(${c}, ${p})`:(0,B._)`${a}(${p})`}V.callValidateCode=h$;var g$=(0,B._)`new RegExp`;function _$({gen:t,it:{opts:e}},r){let o=e.unicodeRegExp?"u":"",{regExp:n}=e.code,s=n(r,o);return t.scopeValue("pattern",{key:s.toString(),ref:s,code:(0,B._)`${n.code==="new RegExp"?g$:(0,u$.useFunc)(t,n)}(${r}, ${o})`})}V.usePattern=_$;function y$(t){let{gen:e,data:r,keyword:o,it:n}=t,s=e.name("valid");if(n.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,B._)`${r}.length`);e.forRange("i",0,c,u=>{t.subschema({keyword:o,dataProp:u,dataPropType:Ni.Type.Num},s),e.if((0,B.not)(s),a)})}}V.validateArray=y$;function v$(t){let{gen:e,schema:r,keyword:o,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(c=>(0,Ni.alwaysValidSchema)(n,c))&&!n.opts.unevaluated)return;let i=e.let("valid",!1),a=e.name("_valid");e.block(()=>r.forEach((c,u)=>{let l=t.subschema({keyword:o,schemaProp:u,compositeRule:!0},a);e.assign(i,(0,B._)`${i} || ${a}`),t.mergeValidEvaluated(l,a)||e.if((0,B.not)(i))})),t.result(i,()=>t.reset(),()=>t.error(!0))}V.validateUnion=v$});var Qp=$(He=>{"use strict";Object.defineProperty(He,"__esModule",{value:!0});He.validateKeywordUsage=He.validSchemaType=He.funcKeywordCode=He.macroKeywordCode=void 0;var $e=I(),Ot=nt(),$$=Ce(),b$=Wr();function S$(t,e){let{gen:r,keyword:o,schema:n,parentSchema:s,it:i}=t,a=e.macro.call(i.self,n,s,i),c=Xp(r,o,a);i.opts.validateSchema!==!1&&i.self.validateSchema(a,!0);let u=r.name("valid");t.subschema({schema:a,schemaPath:$e.nil,errSchemaPath:`${i.errSchemaPath}/${o}`,topSchemaRef:c,compositeRule:!0},u),t.pass(u,()=>t.error(!0))}He.macroKeywordCode=S$;function w$(t,e){var r;let{gen:o,keyword:n,schema:s,parentSchema:i,$data:a,it:c}=t;x$(c,e);let u=!a&&e.compile?e.compile.call(c.self,s,i,c):e.validate,l=Xp(o,n,u),d=o.let("valid");t.block$data(d,p),t.ok((r=e.valid)!==null&&r!==void 0?r:d);function p(){if(e.errors===!1)_(),e.modifying&&Yp(t),y(()=>t.error());else{let v=e.async?f():m();e.modifying&&Yp(t),y(()=>z$(t,v))}}function f(){let v=o.let("ruleErrs",null);return o.try(()=>_((0,$e._)`await `),E=>o.assign(d,!1).if((0,$e._)`${E} instanceof ${c.ValidationError}`,()=>o.assign(v,(0,$e._)`${E}.errors`),()=>o.throw(E))),v}function m(){let v=(0,$e._)`${l}.errors`;return o.assign(v,null),_($e.nil),v}function _(v=e.async?(0,$e._)`await `:$e.nil){let E=c.opts.passContext?Ot.default.this:Ot.default.self,S=!("compile"in e&&!a||e.schema===!1);o.assign(d,(0,$e._)`${v}${(0,$$.callValidateCode)(t,l,E,S)}`,e.modifying)}function y(v){var E;o.if((0,$e.not)((E=e.valid)!==null&&E!==void 0?E:d),v)}}He.funcKeywordCode=w$;function Yp(t){let{gen:e,data:r,it:o}=t;e.if(o.parentData,()=>e.assign(r,(0,$e._)`${o.parentData}[${o.parentDataProperty}]`))}function z$(t,e){let{gen:r}=t;r.if((0,$e._)`Array.isArray(${e})`,()=>{r.assign(Ot.default.vErrors,(0,$e._)`${Ot.default.vErrors} === null ? ${e} : ${Ot.default.vErrors}.concat(${e})`).assign(Ot.default.errors,(0,$e._)`${Ot.default.vErrors}.length`),(0,b$.extendErrors)(t)},()=>t.error())}function x$({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function Xp(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,$e.stringify)(r)})}function E$(t,e,r=!1){return!e.length||e.some(o=>o==="array"?Array.isArray(t):o==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==o||r&&typeof t>"u")}He.validSchemaType=E$;function k$({schema:t,opts:e,self:r,errSchemaPath:o},n,s){if(Array.isArray(n.keyword)?!n.keyword.includes(s):n.keyword!==s)throw new Error("ajv implementation error");let i=n.dependencies;if(i?.some(a=>!Object.prototype.hasOwnProperty.call(t,a)))throw new Error(`parent schema must have dependencies of ${s}: ${i.join(",")}`);if(n.validateSchema&&!n.validateSchema(t[s])){let c=`keyword "${s}" value is invalid at path "${o}": `+r.errorsText(n.validateSchema.errors);if(e.validateSchema==="log")r.logger.error(c);else throw new Error(c)}}He.validateKeywordUsage=k$});var tf=$(yt=>{"use strict";Object.defineProperty(yt,"__esModule",{value:!0});yt.extendSubschemaMode=yt.extendSubschemaData=yt.getSubschema=void 0;var Je=I(),ef=Z();function P$(t,{keyword:e,schemaProp:r,schema:o,schemaPath:n,errSchemaPath:s,topSchemaRef:i}){if(e!==void 0&&o!==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,Je._)`${t.schemaPath}${(0,Je.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:a[r],schemaPath:(0,Je._)`${t.schemaPath}${(0,Je.getProperty)(e)}${(0,Je.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,ef.escapeFragment)(r)}`}}if(o!==void 0){if(n===void 0||s===void 0||i===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:o,schemaPath:n,topSchemaRef:i,errSchemaPath:s}}throw new Error('either "keyword" or "schema" must be passed')}yt.getSubschema=P$;function T$(t,e,{dataProp:r,dataPropType:o,data:n,dataTypes:s,propertyName:i}){if(n!==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,Je._)`${e.data}${(0,Je.getProperty)(r)}`,!0);c(p),t.errorPath=(0,Je.str)`${u}${(0,ef.getErrorPath)(r,o,d.jsPropertySyntax)}`,t.parentDataProperty=(0,Je._)`${r}`,t.dataPathArr=[...l,t.parentDataProperty]}if(n!==void 0){let u=n instanceof Je.Name?n:a.let("data",n,!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]}}yt.extendSubschemaData=T$;function O$(t,{jtdDiscriminator:e,jtdMetadata:r,compositeRule:o,createErrors:n,allErrors:s}){o!==void 0&&(t.compositeRule=o),n!==void 0&&(t.createErrors=n),s!==void 0&&(t.allErrors=s),t.jtdDiscriminator=e,t.jtdMetadata=r}yt.extendSubschemaMode=O$});var Di=$((VO,rf)=>{"use strict";rf.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 o,n,s;if(Array.isArray(e)){if(o=e.length,o!=r.length)return!1;for(n=o;n--!==0;)if(!t(e[n],r[n]))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),o=s.length,o!==Object.keys(r).length)return!1;for(n=o;n--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[n]))return!1;for(n=o;n--!==0;){var i=s[n];if(!t(e[i],r[i]))return!1}return!0}return e!==e&&r!==r}});var nf=$((HO,of)=>{"use strict";var vt=of.exports=function(t,e,r){typeof e=="function"&&(r=e,e={}),r=e.cb||r;var o=typeof r=="function"?r:r.pre||function(){},n=r.post||function(){};pn(e,o,n,t,"",t)};vt.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};vt.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};vt.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};vt.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 pn(t,e,r,o,n,s,i,a,c,u){if(o&&typeof o=="object"&&!Array.isArray(o)){e(o,n,s,i,a,c,u);for(var l in o){var d=o[l];if(Array.isArray(d)){if(l in vt.arrayKeywords)for(var p=0;p<d.length;p++)pn(t,e,r,d[p],n+"/"+l+"/"+p,s,n,l,o,p)}else if(l in vt.propsKeywords){if(d&&typeof d=="object")for(var f in d)pn(t,e,r,d[f],n+"/"+l+"/"+R$(f),s,n,l,o,f)}else(l in vt.keywords||t.allKeys&&!(l in vt.skipKeywords))&&pn(t,e,r,d,n+"/"+l,s,n,l,o)}r(o,n,s,i,a,c,u)}}function R$(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var Yr=$(ze=>{"use strict";Object.defineProperty(ze,"__esModule",{value:!0});ze.getSchemaRefs=ze.resolveUrl=ze.normalizeId=ze._getFullPath=ze.getFullPath=ze.inlineRef=void 0;var I$=Z(),A$=Di(),N$=nf(),C$=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function M$(t,e=!0){return typeof t=="boolean"?!0:e===!0?!ji(t):e?sf(t)<=e:!1}ze.inlineRef=M$;var D$=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function ji(t){for(let e in t){if(D$.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(ji)||typeof r=="object"&&ji(r))return!0}return!1}function sf(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!C$.has(r)&&(typeof t[r]=="object"&&(0,I$.eachItem)(t[r],o=>e+=sf(o)),e===1/0))return 1/0}return e}function af(t,e="",r){r!==!1&&(e=Qt(e));let o=t.parse(e);return cf(t,o)}ze.getFullPath=af;function cf(t,e){return t.serialize(e).split("#")[0]+"#"}ze._getFullPath=cf;var j$=/#\/?$/;function Qt(t){return t?t.replace(j$,""):""}ze.normalizeId=Qt;function Z$(t,e,r){return r=Qt(r),t.resolve(e,r)}ze.resolveUrl=Z$;var L$=/^[a-z_][-a-z0-9._]*$/i;function q$(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:o}=this.opts,n=Qt(t[r]||e),s={"":n},i=af(o,n,!1),a={},c=new Set;return N$(t,{allKeys:!0},(d,p,f,m)=>{if(m===void 0)return;let _=i+p,y=s[m];typeof d[r]=="string"&&(y=v.call(this,d[r])),E.call(this,d.$anchor),E.call(this,d.$dynamicAnchor),s[p]=y;function v(S){let k=this.opts.uriResolver.resolve;if(S=Qt(y?k(y,S):S),c.has(S))throw l(S);c.add(S);let w=this.refs[S];return typeof w=="string"&&(w=this.refs[w]),typeof w=="object"?u(d,w.schema,S):S!==Qt(_)&&(S[0]==="#"?(u(d,a[S],S),a[S]=d):this.refs[S]=_),S}function E(S){if(typeof S=="string"){if(!L$.test(S))throw new Error(`invalid anchor "${S}"`);v.call(this,`#${S}`)}}}),a;function u(d,p,f){if(p!==void 0&&!A$(d,p))throw l(f)}function l(d){return new Error(`reference "${d}" resolves to more than one schema`)}}ze.getSchemaRefs=q$});var eo=$($t=>{"use strict";Object.defineProperty($t,"__esModule",{value:!0});$t.getData=$t.KeywordCxt=$t.validateFunctionCode=void 0;var ff=qp(),uf=Br(),Li=Oi(),fn=Br(),U$=Gp(),Qr=Qp(),Zi=tf(),x=I(),T=nt(),F$=Yr(),st=Z(),Xr=Wr();function V$(t){if(gf(t)&&(_f(t),hf(t))){K$(t);return}mf(t,()=>(0,ff.topBoolOrEmptySchema)(t))}$t.validateFunctionCode=V$;function mf({gen:t,validateName:e,schema:r,schemaEnv:o,opts:n},s){n.code.es5?t.func(e,(0,x._)`${T.default.data}, ${T.default.valCxt}`,o.$async,()=>{t.code((0,x._)`"use strict"; ${lf(r,n)}`),J$(t,n),t.code(s)}):t.func(e,(0,x._)`${T.default.data}, ${H$(n)}`,o.$async,()=>t.code(lf(r,n)).code(s))}function H$(t){return(0,x._)`{${T.default.instancePath}="", ${T.default.parentData}, ${T.default.parentDataProperty}, ${T.default.rootData}=${T.default.data}${t.dynamicRef?(0,x._)`, ${T.default.dynamicAnchors}={}`:x.nil}}={}`}function J$(t,e){t.if(T.default.valCxt,()=>{t.var(T.default.instancePath,(0,x._)`${T.default.valCxt}.${T.default.instancePath}`),t.var(T.default.parentData,(0,x._)`${T.default.valCxt}.${T.default.parentData}`),t.var(T.default.parentDataProperty,(0,x._)`${T.default.valCxt}.${T.default.parentDataProperty}`),t.var(T.default.rootData,(0,x._)`${T.default.valCxt}.${T.default.rootData}`),e.dynamicRef&&t.var(T.default.dynamicAnchors,(0,x._)`${T.default.valCxt}.${T.default.dynamicAnchors}`)},()=>{t.var(T.default.instancePath,(0,x._)`""`),t.var(T.default.parentData,(0,x._)`undefined`),t.var(T.default.parentDataProperty,(0,x._)`undefined`),t.var(T.default.rootData,T.default.data),e.dynamicRef&&t.var(T.default.dynamicAnchors,(0,x._)`{}`)})}function K$(t){let{schema:e,opts:r,gen:o}=t;mf(t,()=>{r.$comment&&e.$comment&&vf(t),X$(t),o.let(T.default.vErrors,null),o.let(T.default.errors,0),r.unevaluated&&G$(t),yf(t),tb(t)})}function G$(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,x._)`${r}.evaluated`),e.if((0,x._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,x._)`${t.evaluated}.props`,(0,x._)`undefined`)),e.if((0,x._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,x._)`${t.evaluated}.items`,(0,x._)`undefined`))}function lf(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,x._)`/*# sourceURL=${r} */`:x.nil}function W$(t,e){if(gf(t)&&(_f(t),hf(t))){B$(t,e);return}(0,ff.boolOrEmptySchema)(t,e)}function hf({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 gf(t){return typeof t.schema!="boolean"}function B$(t,e){let{schema:r,gen:o,opts:n}=t;n.$comment&&r.$comment&&vf(t),Q$(t),eb(t);let s=o.const("_errs",T.default.errors);yf(t,s),o.var(e,(0,x._)`${s} === ${T.default.errors}`)}function _f(t){(0,st.checkUnknownRules)(t),Y$(t)}function yf(t,e){if(t.opts.jtd)return df(t,[],!1,e);let r=(0,uf.getSchemaTypes)(t.schema),o=(0,uf.coerceAndCheckDataType)(t,r);df(t,r,!o,e)}function Y$(t){let{schema:e,errSchemaPath:r,opts:o,self:n}=t;e.$ref&&o.ignoreKeywordsWithRef&&(0,st.schemaHasRulesButRef)(e,n.RULES)&&n.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function X$(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,st.checkStrictMode)(t,"default is ignored in the schema root")}function Q$(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,F$.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function eb(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function vf({gen:t,schemaEnv:e,schema:r,errSchemaPath:o,opts:n}){let s=r.$comment;if(n.$comment===!0)t.code((0,x._)`${T.default.self}.logger.log(${s})`);else if(typeof n.$comment=="function"){let i=(0,x.str)`${o}/$comment`,a=t.scopeValue("root",{ref:e.root});t.code((0,x._)`${T.default.self}.opts.$comment(${s}, ${i}, ${a}.schema)`)}}function tb(t){let{gen:e,schemaEnv:r,validateName:o,ValidationError:n,opts:s}=t;r.$async?e.if((0,x._)`${T.default.errors} === 0`,()=>e.return(T.default.data),()=>e.throw((0,x._)`new ${n}(${T.default.vErrors})`)):(e.assign((0,x._)`${o}.errors`,T.default.vErrors),s.unevaluated&&rb(t),e.return((0,x._)`${T.default.errors} === 0`))}function rb({gen:t,evaluated:e,props:r,items:o}){r instanceof x.Name&&t.assign((0,x._)`${e}.props`,r),o instanceof x.Name&&t.assign((0,x._)`${e}.items`,o)}function df(t,e,r,o){let{gen:n,schema:s,data:i,allErrors:a,opts:c,self:u}=t,{RULES:l}=u;if(s.$ref&&(c.ignoreKeywordsWithRef||!(0,st.schemaHasRulesButRef)(s,l))){n.block(()=>bf(t,"$ref",l.all.$ref.definition));return}c.jtd||ob(t,e),n.block(()=>{for(let p of l.rules)d(p);d(l.post)});function d(p){(0,Li.shouldUseGroup)(s,p)&&(p.type?(n.if((0,fn.checkDataType)(p.type,i,c.strictNumbers)),pf(t,p),e.length===1&&e[0]===p.type&&r&&(n.else(),(0,fn.reportTypeError)(t)),n.endIf()):pf(t,p),a||n.if((0,x._)`${T.default.errors} === ${o||0}`))}}function pf(t,e){let{gen:r,schema:o,opts:{useDefaults:n}}=t;n&&(0,U$.assignDefaults)(t,e.type),r.block(()=>{for(let s of e.rules)(0,Li.shouldUseRule)(o,s)&&bf(t,s.keyword,s.definition,e.type)})}function ob(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(nb(t,e),t.opts.allowUnionTypes||sb(t,e),ib(t,t.dataTypes))}function nb(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{$f(t.dataTypes,r)||qi(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),cb(t,e)}}function sb(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&qi(t,"use allowUnionTypes to allow union type keyword")}function ib(t,e){let r=t.self.RULES.all;for(let o in r){let n=r[o];if(typeof n=="object"&&(0,Li.shouldUseRule)(t.schema,n)){let{type:s}=n.definition;s.length&&!s.some(i=>ab(e,i))&&qi(t,`missing type "${s.join(",")}" for keyword "${o}"`)}}}function ab(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function $f(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function cb(t,e){let r=[];for(let o of t.dataTypes)$f(e,o)?r.push(o):e.includes("integer")&&o==="number"&&r.push("integer");t.dataTypes=r}function qi(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,st.checkStrictMode)(t,e,t.opts.strictTypes)}var mn=class{constructor(e,r,o){if((0,Qr.validateKeywordUsage)(e,r,o),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=o,this.data=e.data,this.schema=e.schema[o],this.$data=r.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,st.schemaRefOrVal)(e,this.schema,o,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",Sf(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,Qr.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${o} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=e.gen.const("_errs",T.default.errors))}result(e,r,o){this.failResult((0,x.not)(e),r,o)}failResult(e,r,o){this.gen.if(e),o?o():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,x.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,x._)`${r} !== undefined && (${(0,x.or)(this.invalid$data(),e)})`)}error(e,r,o){if(r){this.setParams(r),this._error(e,o),this.setParams({});return}this._error(e,o)}_error(e,r){(e?Xr.reportExtraError:Xr.reportError)(this,this.def.error,r)}$dataError(){(0,Xr.reportError)(this,this.def.$dataError||Xr.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Xr.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,o=x.nil){this.gen.block(()=>{this.check$data(e,o),r()})}check$data(e=x.nil,r=x.nil){if(!this.$data)return;let{gen:o,schemaCode:n,schemaType:s,def:i}=this;o.if((0,x.or)((0,x._)`${n} === undefined`,r)),e!==x.nil&&o.assign(e,!0),(s.length||i.validateSchema)&&(o.elseIf(this.invalid$data()),this.$dataError(),e!==x.nil&&o.assign(e,!1)),o.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:o,def:n,it:s}=this;return(0,x.or)(i(),a());function i(){if(o.length){if(!(r instanceof x.Name))throw new Error("ajv implementation error");let c=Array.isArray(o)?o:[o];return(0,x._)`${(0,fn.checkDataTypes)(c,r,s.opts.strictNumbers,fn.DataType.Wrong)}`}return x.nil}function a(){if(n.validateSchema){let c=e.scopeValue("validate$data",{ref:n.validateSchema});return(0,x._)`!${c}(${r})`}return x.nil}}subschema(e,r){let o=(0,Zi.getSubschema)(this.it,e);(0,Zi.extendSubschemaData)(o,this.it,e),(0,Zi.extendSubschemaMode)(o,e);let n={...this.it,...o,items:void 0,props:void 0};return W$(n,r),n}mergeEvaluated(e,r){let{it:o,gen:n}=this;o.opts.unevaluated&&(o.props!==!0&&e.props!==void 0&&(o.props=st.mergeEvaluated.props(n,e.props,o.props,r)),o.items!==!0&&e.items!==void 0&&(o.items=st.mergeEvaluated.items(n,e.items,o.items,r)))}mergeValidEvaluated(e,r){let{it:o,gen:n}=this;if(o.opts.unevaluated&&(o.props!==!0||o.items!==!0))return n.if(r,()=>this.mergeEvaluated(e,x.Name)),!0}};$t.KeywordCxt=mn;function bf(t,e,r,o){let n=new mn(t,r,e);"code"in r?r.code(n,o):n.$data&&r.validate?(0,Qr.funcKeywordCode)(n,r):"macro"in r?(0,Qr.macroKeywordCode)(n,r):(r.compile||r.validate)&&(0,Qr.funcKeywordCode)(n,r)}var ub=/^\/(?:[^~]|~0|~1)*$/,lb=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Sf(t,{dataLevel:e,dataNames:r,dataPathArr:o}){let n,s;if(t==="")return T.default.rootData;if(t[0]==="/"){if(!ub.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);n=t,s=T.default.rootData}else{let u=lb.exec(t);if(!u)throw new Error(`Invalid JSON-pointer: ${t}`);let l=+u[1];if(n=u[2],n==="#"){if(l>=e)throw new Error(c("property/index",l));return o[e-l]}if(l>e)throw new Error(c("data",l));if(s=r[e-l],!n)return s}let i=s,a=n.split("/");for(let u of a)u&&(s=(0,x._)`${s}${(0,x.getProperty)((0,st.unescapeJsonPointer)(u))}`,i=(0,x._)`${i} && ${s}`);return i;function c(u,l){return`Cannot access ${u} ${l} levels up, current level is ${e}`}}$t.getData=Sf});var hn=$(Fi=>{"use strict";Object.defineProperty(Fi,"__esModule",{value:!0});var Ui=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};Fi.default=Ui});var to=$(Ji=>{"use strict";Object.defineProperty(Ji,"__esModule",{value:!0});var Vi=Yr(),Hi=class extends Error{constructor(e,r,o,n){super(n||`can't resolve reference ${o} from id ${r}`),this.missingRef=(0,Vi.resolveUrl)(e,r,o),this.missingSchema=(0,Vi.normalizeId)((0,Vi.getFullPath)(e,this.missingRef))}};Ji.default=Hi});var _n=$(Me=>{"use strict";Object.defineProperty(Me,"__esModule",{value:!0});Me.resolveSchema=Me.getCompilingSchema=Me.resolveRef=Me.compileSchema=Me.SchemaEnv=void 0;var Le=I(),db=hn(),Rt=nt(),qe=Yr(),wf=Z(),pb=eo(),er=class{constructor(e){var r;this.refs={},this.dynamicAnchors={};let o;typeof e.schema=="object"&&(o=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,qe.normalizeId)(o?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=o?.$async,this.refs={}}};Me.SchemaEnv=er;function Gi(t){let e=zf.call(this,t);if(e)return e;let r=(0,qe.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:o,lines:n}=this.opts.code,{ownProperties:s}=this.opts,i=new Le.CodeGen(this.scope,{es5:o,lines:n,ownProperties:s}),a;t.$async&&(a=i.scopeValue("Error",{ref:db.default,code:(0,Le._)`require("ajv/dist/runtime/validation_error").default`}));let c=i.scopeName("validate");t.validateName=c;let u={gen:i,allErrors:this.opts.allErrors,data:Rt.default.data,parentData:Rt.default.parentData,parentDataProperty:Rt.default.parentDataProperty,dataNames:[Rt.default.data],dataPathArr:[Le.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:i.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,Le.stringify)(t.schema)}:{ref:t.schema}),validateName:c,ValidationError:a,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:Le.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Le._)`""`,opts:this.opts,self:this},l;try{this._compilations.add(t),(0,pb.validateFunctionCode)(u),i.optimize(this.opts.code.optimize);let d=i.toString();l=`${i.scopeRefs(Rt.default.scope)}return ${d}`,this.opts.code.process&&(l=this.opts.code.process(l,t));let f=new Function(`${Rt.default.self}`,`${Rt.default.scope}`,l)(this,this.scope.get());if(this.scope.value(c,{ref:f}),f.errors=null,f.schema=t.schema,f.schemaEnv=t,t.$async&&(f.$async=!0),this.opts.code.source===!0&&(f.source={validateName:c,validateCode:d,scopeValues:i._values}),this.opts.unevaluated){let{props:m,items:_}=u;f.evaluated={props:m instanceof Le.Name?void 0:m,items:_ instanceof Le.Name?void 0:_,dynamicProps:m instanceof Le.Name,dynamicItems:_ instanceof Le.Name},f.source&&(f.source.evaluated=(0,Le.stringify)(f.evaluated))}return t.validate=f,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)}}Me.compileSchema=Gi;function fb(t,e,r){var o;r=(0,qe.resolveUrl)(this.opts.uriResolver,e,r);let n=t.refs[r];if(n)return n;let s=gb.call(this,t,r);if(s===void 0){let i=(o=t.localRefs)===null||o===void 0?void 0:o[r],{schemaId:a}=this.opts;i&&(s=new er({schema:i,schemaId:a,root:t,baseId:e}))}if(s!==void 0)return t.refs[r]=mb.call(this,s)}Me.resolveRef=fb;function mb(t){return(0,qe.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:Gi.call(this,t)}function zf(t){for(let e of this._compilations)if(hb(e,t))return e}Me.getCompilingSchema=zf;function hb(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function gb(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||gn.call(this,t,e)}function gn(t,e){let r=this.opts.uriResolver.parse(e),o=(0,qe._getFullPath)(this.opts.uriResolver,r),n=(0,qe.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&o===n)return Ki.call(this,r,t);let s=(0,qe.normalizeId)(o),i=this.refs[s]||this.schemas[s];if(typeof i=="string"){let a=gn.call(this,t,i);return typeof a?.schema!="object"?void 0:Ki.call(this,r,a)}if(typeof i?.schema=="object"){if(i.validate||Gi.call(this,i),s===(0,qe.normalizeId)(e)){let{schema:a}=i,{schemaId:c}=this.opts,u=a[c];return u&&(n=(0,qe.resolveUrl)(this.opts.uriResolver,n,u)),new er({schema:a,schemaId:c,root:t,baseId:n})}return Ki.call(this,r,i)}}Me.resolveSchema=gn;var _b=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Ki(t,{baseId:e,schema:r,root:o}){var n;if(((n=t.fragment)===null||n===void 0?void 0:n[0])!=="/")return;for(let a of t.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let c=r[(0,wf.unescapeFragment)(a)];if(c===void 0)return;r=c;let u=typeof r=="object"&&r[this.opts.schemaId];!_b.has(a)&&u&&(e=(0,qe.resolveUrl)(this.opts.uriResolver,e,u))}let s;if(typeof r!="boolean"&&r.$ref&&!(0,wf.schemaHasRulesButRef)(r,this.RULES)){let a=(0,qe.resolveUrl)(this.opts.uriResolver,e,r.$ref);s=gn.call(this,o,a)}let{schemaId:i}=this.opts;if(s=s||new er({schema:r,schemaId:i,root:o,baseId:e}),s.schema!==s.root.schema)return s}});var xf=$((YO,yb)=>{yb.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 Yi=$((XO,Rf)=>{"use strict";var vb=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),kf=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),Wi=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),Pf=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),$b=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function Bi(t){let e="",r=0,o=0;for(o=0;o<t.length;o++)if(r=t[o].charCodeAt(0),r!==48){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[o];break}for(o+=1;o<t.length;o++){if(r=t[o].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[o]}return e}var bb=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function Ef(t){return t.length=0,!0}function Sb(t,e,r){if(t.length){let o=Bi(t);if(o!=="")e.push(o);else return r.error=!0,!1;t.length=0}return!0}function wb(t){let e=0,r={error:!1,address:"",zone:""},o=[],n=[],s=!1,i=!1,a=Sb;for(let c=0;c<t.length;c++){let u=t[c];if(!(u==="["||u==="]"))if(u===":"){if(s===!0&&(i=!0),!a(n,o,r))break;if(++e>7){r.error=!0;break}c>0&&t[c-1]===":"&&(s=!0),o.push(":");continue}else if(u==="%"){if(!a(n,o,r))break;a=Ef}else{n.push(u);continue}}return n.length&&(a===Ef?r.zone=n.join(""):i?o.push(n.join("")):o.push(Bi(n))),r.address=o.join(""),r}function Tf(t){if(zb(t,":")<2)return{host:t,isIPV6:!1};let e=wb(t);if(e.error)return{host:t,isIPV6:!1};{let r=e.address,o=e.address;return e.zone&&(r+="%"+e.zone,o+="%25"+e.zone),{host:r,isIPV6:!0,escapedHost:o}}}function zb(t,e){let r=0;for(let o=0;o<t.length;o++)t[o]===e&&r++;return r}function xb(t){let e=t,r=[],o=-1,n=0;for(;n=e.length;){if(n===1){if(e===".")break;if(e==="/"){r.push("/");break}else{r.push(e);break}}else if(n===2){if(e[0]==="."){if(e[1]===".")break;if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&(e[1]==="."||e[1]==="/")){r.push("/");break}}else if(n===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((o=e.indexOf("/",1))===-1){r.push(e);break}else r.push(e.slice(0,o)),e=e.slice(o)}return r.join("")}var Eb={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},kb=/[@/?#:]/g,Pb=/[@/?#]/g;function Of(t,e){let r=e?Pb:kb;return r.lastIndex=0,t.replace(r,o=>Eb[o])}function Tb(t,e=!1){if(t.indexOf("%")===-1)return t;let r="";for(let o=0;o<t.length;o++){if(t[o]==="%"&&o+2<t.length){let n=t.slice(o+1,o+3);if(Wi(n)){let s=n.toUpperCase(),i=String.fromCharCode(parseInt(s,16));e&&Pf(i)?r+=i:r+="%"+s,o+=2;continue}}r+=t[o]}return r}function Ob(t){let e="";for(let r=0;r<t.length;r++){if(t[r]==="%"&&r+2<t.length){let o=t.slice(r+1,r+3);if(Wi(o)){let n=o.toUpperCase(),s=String.fromCharCode(parseInt(n,16));s!=="."&&Pf(s)?e+=s:e+="%"+n,r+=2;continue}}$b(t[r])?e+=t[r]:e+=escape(t[r])}return e}function Rb(t){let e="";for(let r=0;r<t.length;r++){if(t[r]==="%"&&r+2<t.length){let o=t.slice(r+1,r+3);if(Wi(o)){e+="%"+o.toUpperCase(),r+=2;continue}}e+=escape(t[r])}return e}function Ib(t){let e=[];if(t.userinfo!==void 0&&(e.push(t.userinfo),e.push("@")),t.host!==void 0){let r=unescape(t.host);if(!kf(r)){let o=Tf(r);o.isIPV6===!0?r=`[${o.escapedHost}]`:r=Of(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}Rf.exports={nonSimpleDomain:bb,recomposeAuthority:Ib,reescapeHostDelimiters:Of,normalizePercentEncoding:Tb,normalizePathEncoding:Ob,escapePreservingEscapes:Rb,removeDotSegments:xb,isIPv4:kf,isUUID:vb,normalizeIPv6:Tf,stringArrayToHexStripped:Bi}});var Mf=$((QO,Cf)=>{"use strict";var{isUUID:Ab}=Yi(),Nb=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,Cb=["http","https","ws","wss","urn","urn:uuid"];function Mb(t){return Cb.indexOf(t)!==-1}function Xi(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 If(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function Af(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 Db(t){return t.secure=Xi(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function jb(t){if((t.port===(Xi(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 Zb(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(Nb);if(r){let o=e.scheme||t.scheme||"urn";t.nid=r[1].toLowerCase(),t.nss=r[2];let n=`${o}:${e.nid||t.nid}`,s=Qi(n);t.path=void 0,s&&(t=s.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}function Lb(t,e){if(t.nid===void 0)throw new Error("URN without nid cannot be serialized");let r=e.scheme||t.scheme||"urn",o=t.nid.toLowerCase(),n=`${r}:${e.nid||o}`,s=Qi(n);s&&(t=s.serialize(t,e));let i=t,a=t.nss;return i.path=`${o||e.nid}:${a}`,e.skipEscape=!0,i}function qb(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!Ab(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function Ub(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var Nf={scheme:"http",domainHost:!0,parse:If,serialize:Af},Fb={scheme:"https",domainHost:Nf.domainHost,parse:If,serialize:Af},yn={scheme:"ws",domainHost:!0,parse:Db,serialize:jb},Vb={scheme:"wss",domainHost:yn.domainHost,parse:yn.parse,serialize:yn.serialize},Hb={scheme:"urn",parse:Zb,serialize:Lb,skipNormalize:!0},Jb={scheme:"urn:uuid",parse:qb,serialize:Ub,skipNormalize:!0},vn={http:Nf,https:Fb,ws:yn,wss:Vb,urn:Hb,"urn:uuid":Jb};Object.setPrototypeOf(vn,null);function Qi(t){return t&&(vn[t]||vn[t.toLowerCase()])||void 0}Cf.exports={wsIsSecure:Xi,SCHEMES:vn,isValidSchemeName:Mb,getSchemeHandler:Qi}});var Uf=$((eR,$n)=>{"use strict";var{normalizeIPv6:Kb,removeDotSegments:ro,recomposeAuthority:Gb,normalizePercentEncoding:Wb,normalizePathEncoding:Bb,escapePreservingEscapes:Yb,reescapeHostDelimiters:Xb,isIPv4:Qb,nonSimpleDomain:e0}=Yi(),{SCHEMES:t0,getSchemeHandler:jf}=Mf();function r0(t,e){return typeof t=="string"?t=a0(t,e):typeof t=="object"&&(t=tr(It(t,e),e)),t}function o0(t,e,r){let o=r?Object.assign({scheme:"null"},r):{scheme:"null"},n=Zf(tr(t,o),tr(e,o),o,!0);return o.skipEscape=!0,It(n,o)}function Zf(t,e,r,o){let n={};return o||(t=tr(It(t,r),r),e=tr(It(e,r),r)),r=r||{},!r.tolerant&&e.scheme?(n.scheme=e.scheme,n.userinfo=e.userinfo,n.host=e.host,n.port=e.port,n.path=ro(e.path||""),n.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(n.userinfo=e.userinfo,n.host=e.host,n.port=e.port,n.path=ro(e.path||""),n.query=e.query):(e.path?(e.path[0]==="/"?n.path=ro(e.path):((t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)&&!t.path?n.path="/"+e.path:t.path?n.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+e.path:n.path=e.path,n.path=ro(n.path)),n.query=e.query):(n.path=t.path,e.query!==void 0?n.query=e.query:n.query=t.query),n.userinfo=t.userinfo,n.host=t.host,n.port=t.port),n.scheme=t.scheme),n.fragment=e.fragment,n}function n0(t,e,r){let o=Df(t,r),n=Df(e,r);return o!==void 0&&n!==void 0&&o.toLowerCase()===n.toLowerCase()}function It(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:""},o=Object.assign({},e),n=[],s=jf(o.scheme||r.scheme);s&&s.serialize&&s.serialize(r,o),r.path!==void 0&&(o.skipEscape?r.path=Wb(r.path):(r.path=Yb(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),o.reference!=="suffix"&&r.scheme&&n.push(r.scheme,":");let i=Gb(r);if(i!==void 0&&(o.reference!=="suffix"&&n.push("//"),n.push(i),r.path&&r.path[0]!=="/"&&n.push("/")),r.path!==void 0){let a=r.path;!o.absolutePath&&(!s||!s.absolutePath)&&(a=ro(a)),i===void 0&&a[0]==="/"&&a[1]==="/"&&(a="/%2F"+a.slice(2)),n.push(a)}return r.query!==void 0&&n.push("?",r.query),r.fragment!==void 0&&n.push("#",r.fragment),n.join("")}var s0=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function i0(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 Lf(t,e){let r=Object.assign({},e),o={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},n=!1,s=!1;r.reference==="suffix"&&(r.scheme?t=r.scheme+":"+t:t="//"+t);let i=t.match(s0);if(i){o.scheme=i[1],o.userinfo=i[3],o.host=i[4],o.port=parseInt(i[5],10),o.path=i[6]||"",o.query=i[7],o.fragment=i[8],isNaN(o.port)&&(o.port=i[5]);let a=i0(o,i);if(a!==void 0&&(o.error=o.error||a,n=!0),o.host)if(Qb(o.host)===!1){let l=Kb(o.host);o.host=l.host.toLowerCase(),s=l.isIPV6}else s=!0;o.scheme===void 0&&o.userinfo===void 0&&o.host===void 0&&o.port===void 0&&o.query===void 0&&!o.path?o.reference="same-document":o.scheme===void 0?o.reference="relative":o.fragment===void 0?o.reference="absolute":o.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==o.reference&&(o.error=o.error||"URI is not a "+r.reference+" reference.");let c=jf(r.scheme||o.scheme);if(!r.unicodeSupport&&(!c||!c.unicodeSupport)&&o.host&&(r.domainHost||c&&c.domainHost)&&s===!1&&e0(o.host))try{o.host=URL.domainToASCII(o.host.toLowerCase())}catch(u){o.error=o.error||"Host's domain name can not be converted to ASCII: "+u}if((!c||c&&!c.skipNormalize)&&(t.indexOf("%")!==-1&&(o.scheme!==void 0&&(o.scheme=unescape(o.scheme)),o.host!==void 0&&(o.host=Xb(unescape(o.host),s))),o.path&&(o.path=Bb(o.path)),o.fragment))try{o.fragment=encodeURI(decodeURIComponent(o.fragment))}catch{o.error=o.error||"URI malformed"}c&&c.parse&&c.parse(o,r)}else o.error=o.error||"URI can not be parsed.";return{parsed:o,malformedAuthorityOrPort:n}}function tr(t,e){return Lf(t,e).parsed}function a0(t,e){return qf(t,e).normalized}function qf(t,e){let{parsed:r,malformedAuthorityOrPort:o}=Lf(t,e);return{normalized:o?t:It(r,e),malformedAuthorityOrPort:o}}function Df(t,e){if(typeof t=="string"){let{normalized:r,malformedAuthorityOrPort:o}=qf(t,e);return o?void 0:r}if(typeof t=="object")return It(t,e)}var ea={SCHEMES:t0,normalize:r0,resolve:o0,resolveComponent:Zf,equal:n0,serialize:It,parse:tr};$n.exports=ea;$n.exports.default=ea;$n.exports.fastUri=ea});var Vf=$(ta=>{"use strict";Object.defineProperty(ta,"__esModule",{value:!0});var Ff=Uf();Ff.code='require("ajv/dist/runtime/uri").default';ta.default=Ff});var Xf=$(pe=>{"use strict";Object.defineProperty(pe,"__esModule",{value:!0});pe.CodeGen=pe.Name=pe.nil=pe.stringify=pe.str=pe._=pe.KeywordCxt=void 0;var c0=eo();Object.defineProperty(pe,"KeywordCxt",{enumerable:!0,get:function(){return c0.KeywordCxt}});var rr=I();Object.defineProperty(pe,"_",{enumerable:!0,get:function(){return rr._}});Object.defineProperty(pe,"str",{enumerable:!0,get:function(){return rr.str}});Object.defineProperty(pe,"stringify",{enumerable:!0,get:function(){return rr.stringify}});Object.defineProperty(pe,"nil",{enumerable:!0,get:function(){return rr.nil}});Object.defineProperty(pe,"Name",{enumerable:!0,get:function(){return rr.Name}});Object.defineProperty(pe,"CodeGen",{enumerable:!0,get:function(){return rr.CodeGen}});var u0=hn(),Wf=to(),l0=Ti(),oo=_n(),d0=I(),no=Yr(),bn=Br(),oa=Z(),Hf=xf(),p0=Vf(),Bf=(t,e)=>new RegExp(t,e);Bf.code="new RegExp";var f0=["removeAdditional","useDefaults","coerceTypes"],m0=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),h0={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."},g0={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},Jf=200;function _0(t){var e,r,o,n,s,i,a,c,u,l,d,p,f,m,_,y,v,E,S,k,w,Ee,Oe,dr,Jn;let pr=t.strict,Kn=(e=t.code)===null||e===void 0?void 0:e.optimize,ic=Kn===!0||Kn===void 0?1:Kn||0,ac=(o=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&o!==void 0?o:Bf,Nh=(n=t.uriResolver)!==null&&n!==void 0?n:p0.default;return{strictSchema:(i=(s=t.strictSchema)!==null&&s!==void 0?s:pr)!==null&&i!==void 0?i:!0,strictNumbers:(c=(a=t.strictNumbers)!==null&&a!==void 0?a:pr)!==null&&c!==void 0?c:!0,strictTypes:(l=(u=t.strictTypes)!==null&&u!==void 0?u:pr)!==null&&l!==void 0?l:"log",strictTuples:(p=(d=t.strictTuples)!==null&&d!==void 0?d:pr)!==null&&p!==void 0?p:"log",strictRequired:(m=(f=t.strictRequired)!==null&&f!==void 0?f:pr)!==null&&m!==void 0?m:!1,code:t.code?{...t.code,optimize:ic,regExp:ac}:{optimize:ic,regExp:ac},loopRequired:(_=t.loopRequired)!==null&&_!==void 0?_:Jf,loopEnum:(y=t.loopEnum)!==null&&y!==void 0?y:Jf,meta:(v=t.meta)!==null&&v!==void 0?v:!0,messages:(E=t.messages)!==null&&E!==void 0?E:!0,inlineRefs:(S=t.inlineRefs)!==null&&S!==void 0?S:!0,schemaId:(k=t.schemaId)!==null&&k!==void 0?k:"$id",addUsedSchema:(w=t.addUsedSchema)!==null&&w!==void 0?w:!0,validateSchema:(Ee=t.validateSchema)!==null&&Ee!==void 0?Ee:!0,validateFormats:(Oe=t.validateFormats)!==null&&Oe!==void 0?Oe:!0,unicodeRegExp:(dr=t.unicodeRegExp)!==null&&dr!==void 0?dr:!0,int32range:(Jn=t.int32range)!==null&&Jn!==void 0?Jn:!0,uriResolver:Nh}}var so=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,..._0(e)};let{es5:r,lines:o}=this.opts.code;this.scope=new d0.ValueScope({scope:{},prefixes:m0,es5:r,lines:o}),this.logger=w0(e.logger);let n=e.validateFormats;e.validateFormats=!1,this.RULES=(0,l0.getRules)(),Kf.call(this,h0,e,"NOT SUPPORTED"),Kf.call(this,g0,e,"DEPRECATED","warn"),this._metaOpts=b0.call(this),e.formats&&v0.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&$0.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),y0.call(this),e.validateFormats=n}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:o}=this.opts,n=Hf;o==="id"&&(n={...Hf},n.id=n.$id,delete n.$id),r&&e&&this.addMetaSchema(n,n[o],!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 o;if(typeof e=="string"){if(o=this.getSchema(e),!o)throw new Error(`no schema with key or ref "${e}"`)}else o=this.compile(e);let n=o(r);return"$async"in o||(this.errors=o.errors),n}compile(e,r){let o=this._addSchema(e,r);return o.validate||this._compileSchemaEnv(o)}compileAsync(e,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:o}=this.opts;return n.call(this,e,r);async function n(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 n.call(this,{$ref:l},!0)}async function i(l){try{return this._compileSchemaEnv(l)}catch(d){if(!(d instanceof Wf.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]=o(l))}finally{delete this._loading[l]}}}addSchema(e,r,o,n=this.opts.validateSchema){if(Array.isArray(e)){for(let i of e)this.addSchema(i,void 0,o,n);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,no.normalizeId)(r||s),this._checkUnique(r),this.schemas[r]=this._addSchema(e,o,r,n,!0),this}addMetaSchema(e,r,o=this.opts.validateSchema){return this.addSchema(e,r,!0,o),this}validateSchema(e,r){if(typeof e=="boolean")return!0;let o;if(o=e.$schema,o!==void 0&&typeof o!="string")throw new Error("$schema must be a string");if(o=o||this.opts.defaultMeta||this.defaultMeta(),!o)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let n=this.validate(o,e);if(!n&&r){let s="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(s);else throw new Error(s)}return n}getSchema(e){let r;for(;typeof(r=Gf.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:o}=this.opts,n=new oo.SchemaEnv({schema:{},schemaId:o});if(r=oo.resolveSchema.call(this,n,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=Gf.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 o=e[this.opts.schemaId];return o&&(o=(0,no.normalizeId)(o),delete this.schemas[o],delete this.refs[o]),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 o;if(typeof e=="string")o=e,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=o);else if(typeof e=="object"&&r===void 0){if(r=e,o=r.keyword,Array.isArray(o)&&!o.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(x0.call(this,o,r),!r)return(0,oa.eachItem)(o,s=>ra.call(this,s)),this;k0.call(this,r);let n={...r,type:(0,bn.getJSONTypes)(r.type),schemaType:(0,bn.getJSONTypes)(r.schemaType)};return(0,oa.eachItem)(o,n.type.length===0?s=>ra.call(this,s,n):s=>n.type.forEach(i=>ra.call(this,s,n,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 o of r.rules){let n=o.rules.findIndex(s=>s.keyword===e);n>=0&&o.rules.splice(n,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:o="data"}={}){return!e||e.length===0?"No errors":e.map(n=>`${o}${n.instancePath} ${n.message}`).reduce((n,s)=>n+r+s)}$dataMetaSchema(e,r){let o=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let n of r){let s=n.split("/").slice(1),i=e;for(let a of s)i=i[a];for(let a in o){let c=o[a];if(typeof c!="object")continue;let{$data:u}=c.definition,l=i[a];u&&l&&(i[a]=Yf(l))}}return e}_removeAllSchemas(e,r){for(let o in e){let n=e[o];(!r||r.test(o))&&(typeof n=="string"?delete e[o]:n&&!n.meta&&(this._cache.delete(n.schema),delete e[o]))}}_addSchema(e,r,o,n=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;o=(0,no.normalizeId)(i||o);let u=no.getSchemaRefs.call(this,e,o);return c=new oo.SchemaEnv({schema:e,schemaId:a,meta:r,baseId:o,localRefs:u}),this._cache.set(c.schema,c),s&&!o.startsWith("#")&&(o&&this._checkUnique(o),this.refs[o]=c),n&&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):oo.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{oo.compileSchema.call(this,e)}finally{this.opts=r}}};so.ValidationError=u0.default;so.MissingRefError=Wf.default;pe.default=so;function Kf(t,e,r,o="error"){for(let n in t){let s=n;s in e&&this.logger[o](`${r}: option ${n}. ${t[s]}`)}}function Gf(t){return t=(0,no.normalizeId)(t),this.schemas[t]||this.refs[t]}function y0(){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 v0(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function $0(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 b0(){let t={...this.opts};for(let e of f0)delete t[e];return t}var S0={log(){},warn(){},error(){}};function w0(t){if(t===!1)return S0;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 z0=/^[a-z_$][a-z0-9_$:-]*$/i;function x0(t,e){let{RULES:r}=this;if((0,oa.eachItem)(t,o=>{if(r.keywords[o])throw new Error(`Keyword ${o} is already defined`);if(!z0.test(o))throw new Error(`Keyword ${o} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function ra(t,e,r){var o;let n=e?.post;if(r&&n)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:s}=this,i=n?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,bn.getJSONTypes)(e.type),schemaType:(0,bn.getJSONTypes)(e.schemaType)}};e.before?E0.call(this,i,a,e.before):i.rules.push(a),s.all[t]=a,(o=e.implements)===null||o===void 0||o.forEach(c=>this.addKeyword(c))}function E0(t,e,r){let o=t.rules.findIndex(n=>n.keyword===r);o>=0?t.rules.splice(o,0,e):(t.rules.push(e),this.logger.warn(`rule ${r} is not defined`))}function k0(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=Yf(e)),t.validateSchema=this.compile(e,!0))}var P0={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Yf(t){return{anyOf:[t,P0]}}});var Qf=$(na=>{"use strict";Object.defineProperty(na,"__esModule",{value:!0});var T0={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};na.default=T0});var om=$(At=>{"use strict";Object.defineProperty(At,"__esModule",{value:!0});At.callRef=At.getValidate=void 0;var O0=to(),em=Ce(),xe=I(),or=nt(),tm=_n(),Sn=Z(),R0={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:r,it:o}=t,{baseId:n,schemaEnv:s,validateName:i,opts:a,self:c}=o,{root:u}=s;if((r==="#"||r==="#/")&&n===u.baseId)return d();let l=tm.resolveRef.call(c,u,n,r);if(l===void 0)throw new O0.default(o.opts.uriResolver,n,r);if(l instanceof tm.SchemaEnv)return p(l);return f(l);function d(){if(s===u)return wn(t,i,s,s.$async);let m=e.scopeValue("root",{ref:u});return wn(t,(0,xe._)`${m}.validate`,u,u.$async)}function p(m){let _=rm(t,m);wn(t,_,m,m.$async)}function f(m){let _=e.scopeValue("schema",a.code.source===!0?{ref:m,code:(0,xe.stringify)(m)}:{ref:m}),y=e.name("valid"),v=t.subschema({schema:m,dataTypes:[],schemaPath:xe.nil,topSchemaRef:_,errSchemaPath:r},y);t.mergeEvaluated(v),t.ok(y)}}};function rm(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,xe._)`${r.scopeValue("wrapper",{ref:e})}.validate`}At.getValidate=rm;function wn(t,e,r,o){let{gen:n,it:s}=t,{allErrors:i,schemaEnv:a,opts:c}=s,u=c.passContext?or.default.this:xe.nil;o?l():d();function l(){if(!a.$async)throw new Error("async schema referenced by sync schema");let m=n.let("valid");n.try(()=>{n.code((0,xe._)`await ${(0,em.callValidateCode)(t,e,u)}`),f(e),i||n.assign(m,!0)},_=>{n.if((0,xe._)`!(${_} instanceof ${s.ValidationError})`,()=>n.throw(_)),p(_),i||n.assign(m,!1)}),t.ok(m)}function d(){t.result((0,em.callValidateCode)(t,e,u),()=>f(e),()=>p(e))}function p(m){let _=(0,xe._)`${m}.errors`;n.assign(or.default.vErrors,(0,xe._)`${or.default.vErrors} === null ? ${_} : ${or.default.vErrors}.concat(${_})`),n.assign(or.default.errors,(0,xe._)`${or.default.vErrors}.length`)}function f(m){var _;if(!s.opts.unevaluated)return;let y=(_=r?.validate)===null||_===void 0?void 0:_.evaluated;if(s.props!==!0)if(y&&!y.dynamicProps)y.props!==void 0&&(s.props=Sn.mergeEvaluated.props(n,y.props,s.props));else{let v=n.var("props",(0,xe._)`${m}.evaluated.props`);s.props=Sn.mergeEvaluated.props(n,v,s.props,xe.Name)}if(s.items!==!0)if(y&&!y.dynamicItems)y.items!==void 0&&(s.items=Sn.mergeEvaluated.items(n,y.items,s.items));else{let v=n.var("items",(0,xe._)`${m}.evaluated.items`);s.items=Sn.mergeEvaluated.items(n,v,s.items,xe.Name)}}}At.callRef=wn;At.default=R0});var nm=$(sa=>{"use strict";Object.defineProperty(sa,"__esModule",{value:!0});var I0=Qf(),A0=om(),N0=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",I0.default,A0.default];sa.default=N0});var sm=$(ia=>{"use strict";Object.defineProperty(ia,"__esModule",{value:!0});var zn=I(),bt=zn.operators,xn={maximum:{okStr:"<=",ok:bt.LTE,fail:bt.GT},minimum:{okStr:">=",ok:bt.GTE,fail:bt.LT},exclusiveMaximum:{okStr:"<",ok:bt.LT,fail:bt.GTE},exclusiveMinimum:{okStr:">",ok:bt.GT,fail:bt.LTE}},C0={message:({keyword:t,schemaCode:e})=>(0,zn.str)`must be ${xn[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,zn._)`{comparison: ${xn[t].okStr}, limit: ${e}}`},M0={keyword:Object.keys(xn),type:"number",schemaType:"number",$data:!0,error:C0,code(t){let{keyword:e,data:r,schemaCode:o}=t;t.fail$data((0,zn._)`${r} ${xn[e].fail} ${o} || isNaN(${r})`)}};ia.default=M0});var im=$(aa=>{"use strict";Object.defineProperty(aa,"__esModule",{value:!0});var io=I(),D0={message:({schemaCode:t})=>(0,io.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,io._)`{multipleOf: ${t}}`},j0={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:D0,code(t){let{gen:e,data:r,schemaCode:o,it:n}=t,s=n.opts.multipleOfPrecision,i=e.let("res"),a=s?(0,io._)`Math.abs(Math.round(${i}) - ${i}) > 1e-${s}`:(0,io._)`${i} !== parseInt(${i})`;t.fail$data((0,io._)`(${o} === 0 || (${i} = ${r}/${o}, ${a}))`)}};aa.default=j0});var cm=$(ca=>{"use strict";Object.defineProperty(ca,"__esModule",{value:!0});function am(t){let e=t.length,r=0,o=0,n;for(;o<e;)r++,n=t.charCodeAt(o++),n>=55296&&n<=56319&&o<e&&(n=t.charCodeAt(o),(n&64512)===56320&&o++);return r}ca.default=am;am.code='require("ajv/dist/runtime/ucs2length").default'});var um=$(ua=>{"use strict";Object.defineProperty(ua,"__esModule",{value:!0});var Nt=I(),Z0=Z(),L0=cm(),q0={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,Nt.str)`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>(0,Nt._)`{limit: ${t}}`},U0={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:q0,code(t){let{keyword:e,data:r,schemaCode:o,it:n}=t,s=e==="maxLength"?Nt.operators.GT:Nt.operators.LT,i=n.opts.unicode===!1?(0,Nt._)`${r}.length`:(0,Nt._)`${(0,Z0.useFunc)(t.gen,L0.default)}(${r})`;t.fail$data((0,Nt._)`${i} ${s} ${o}`)}};ua.default=U0});var lm=$(la=>{"use strict";Object.defineProperty(la,"__esModule",{value:!0});var F0=Ce(),V0=Z(),nr=I(),H0={message:({schemaCode:t})=>(0,nr.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,nr._)`{pattern: ${t}}`},J0={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:H0,code(t){let{gen:e,data:r,$data:o,schema:n,schemaCode:s,it:i}=t,a=i.opts.unicodeRegExp?"u":"";if(o){let{regExp:c}=i.opts.code,u=c.code==="new RegExp"?(0,nr._)`new RegExp`:(0,V0.useFunc)(e,c),l=e.let("valid");e.try(()=>e.assign(l,(0,nr._)`${u}(${s}, ${a}).test(${r})`),()=>e.assign(l,!1)),t.fail$data((0,nr._)`!${l}`)}else{let c=(0,F0.usePattern)(t,n);t.fail$data((0,nr._)`!${c}.test(${r})`)}}};la.default=J0});var dm=$(da=>{"use strict";Object.defineProperty(da,"__esModule",{value:!0});var ao=I(),K0={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,ao.str)`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>(0,ao._)`{limit: ${t}}`},G0={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:K0,code(t){let{keyword:e,data:r,schemaCode:o}=t,n=e==="maxProperties"?ao.operators.GT:ao.operators.LT;t.fail$data((0,ao._)`Object.keys(${r}).length ${n} ${o}`)}};da.default=G0});var pm=$(pa=>{"use strict";Object.defineProperty(pa,"__esModule",{value:!0});var co=Ce(),uo=I(),W0=Z(),B0={message:({params:{missingProperty:t}})=>(0,uo.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,uo._)`{missingProperty: ${t}}`},Y0={keyword:"required",type:"object",schemaType:"array",$data:!0,error:B0,code(t){let{gen:e,schema:r,schemaCode:o,data:n,$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 f=t.parentSchema.properties,{definedProperties:m}=t.it;for(let _ of r)if(f?.[_]===void 0&&!m.has(_)){let y=i.schemaEnv.baseId+i.errSchemaPath,v=`required property "${_}" is not defined at "${y}" (strictRequired)`;(0,W0.checkStrictMode)(i,v,i.opts.strictRequired)}}function u(){if(c||s)t.block$data(uo.nil,d);else for(let f of r)(0,co.checkReportMissingProp)(t,f)}function l(){let f=e.let("missing");if(c||s){let m=e.let("valid",!0);t.block$data(m,()=>p(f,m)),t.ok(m)}else e.if((0,co.checkMissingProp)(t,r,f)),(0,co.reportMissingProp)(t,f),e.else()}function d(){e.forOf("prop",o,f=>{t.setParams({missingProperty:f}),e.if((0,co.noPropertyInData)(e,n,f,a.ownProperties),()=>t.error())})}function p(f,m){t.setParams({missingProperty:f}),e.forOf(f,o,()=>{e.assign(m,(0,co.propertyInData)(e,n,f,a.ownProperties)),e.if((0,uo.not)(m),()=>{t.error(),e.break()})},uo.nil)}}};pa.default=Y0});var fm=$(fa=>{"use strict";Object.defineProperty(fa,"__esModule",{value:!0});var lo=I(),X0={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,lo.str)`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>(0,lo._)`{limit: ${t}}`},Q0={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:X0,code(t){let{keyword:e,data:r,schemaCode:o}=t,n=e==="maxItems"?lo.operators.GT:lo.operators.LT;t.fail$data((0,lo._)`${r}.length ${n} ${o}`)}};fa.default=Q0});var En=$(ma=>{"use strict";Object.defineProperty(ma,"__esModule",{value:!0});var mm=Di();mm.code='require("ajv/dist/runtime/equal").default';ma.default=mm});var hm=$(ga=>{"use strict";Object.defineProperty(ga,"__esModule",{value:!0});var ha=Br(),fe=I(),eS=Z(),tS=En(),rS={message:({params:{i:t,j:e}})=>(0,fe.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,fe._)`{i: ${t}, j: ${e}}`},oS={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:rS,code(t){let{gen:e,data:r,$data:o,schema:n,parentSchema:s,schemaCode:i,it:a}=t;if(!o&&!n)return;let c=e.let("valid"),u=s.items?(0,ha.getSchemaTypes)(s.items):[];t.block$data(c,l,(0,fe._)`${i} === false`),t.ok(c);function l(){let m=e.let("i",(0,fe._)`${r}.length`),_=e.let("j");t.setParams({i:m,j:_}),e.assign(c,!0),e.if((0,fe._)`${m} > 1`,()=>(d()?p:f)(m,_))}function d(){return u.length>0&&!u.some(m=>m==="object"||m==="array")}function p(m,_){let y=e.name("item"),v=(0,ha.checkDataTypes)(u,y,a.opts.strictNumbers,ha.DataType.Wrong),E=e.const("indices",(0,fe._)`{}`);e.for((0,fe._)`;${m}--;`,()=>{e.let(y,(0,fe._)`${r}[${m}]`),e.if(v,(0,fe._)`continue`),u.length>1&&e.if((0,fe._)`typeof ${y} == "string"`,(0,fe._)`${y} += "_"`),e.if((0,fe._)`typeof ${E}[${y}] == "number"`,()=>{e.assign(_,(0,fe._)`${E}[${y}]`),t.error(),e.assign(c,!1).break()}).code((0,fe._)`${E}[${y}] = ${m}`)})}function f(m,_){let y=(0,eS.useFunc)(e,tS.default),v=e.name("outer");e.label(v).for((0,fe._)`;${m}--;`,()=>e.for((0,fe._)`${_} = ${m}; ${_}--;`,()=>e.if((0,fe._)`${y}(${r}[${m}], ${r}[${_}])`,()=>{t.error(),e.assign(c,!1).break(v)})))}}};ga.default=oS});var gm=$(ya=>{"use strict";Object.defineProperty(ya,"__esModule",{value:!0});var _a=I(),nS=Z(),sS=En(),iS={message:"must be equal to constant",params:({schemaCode:t})=>(0,_a._)`{allowedValue: ${t}}`},aS={keyword:"const",$data:!0,error:iS,code(t){let{gen:e,data:r,$data:o,schemaCode:n,schema:s}=t;o||s&&typeof s=="object"?t.fail$data((0,_a._)`!${(0,nS.useFunc)(e,sS.default)}(${r}, ${n})`):t.fail((0,_a._)`${s} !== ${r}`)}};ya.default=aS});var _m=$(va=>{"use strict";Object.defineProperty(va,"__esModule",{value:!0});var po=I(),cS=Z(),uS=En(),lS={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,po._)`{allowedValues: ${t}}`},dS={keyword:"enum",schemaType:"array",$data:!0,error:lS,code(t){let{gen:e,data:r,$data:o,schema:n,schemaCode:s,it:i}=t;if(!o&&n.length===0)throw new Error("enum must have non-empty array");let a=n.length>=i.opts.loopEnum,c,u=()=>c??(c=(0,cS.useFunc)(e,uS.default)),l;if(a||o)l=e.let("valid"),t.block$data(l,d);else{if(!Array.isArray(n))throw new Error("ajv implementation error");let f=e.const("vSchema",s);l=(0,po.or)(...n.map((m,_)=>p(f,_)))}t.pass(l);function d(){e.assign(l,!1),e.forOf("v",s,f=>e.if((0,po._)`${u()}(${r}, ${f})`,()=>e.assign(l,!0).break()))}function p(f,m){let _=n[m];return typeof _=="object"&&_!==null?(0,po._)`${u()}(${r}, ${f}[${m}])`:(0,po._)`${r} === ${_}`}}};va.default=dS});var ym=$($a=>{"use strict";Object.defineProperty($a,"__esModule",{value:!0});var pS=sm(),fS=im(),mS=um(),hS=lm(),gS=dm(),_S=pm(),yS=fm(),vS=hm(),$S=gm(),bS=_m(),SS=[pS.default,fS.default,mS.default,hS.default,gS.default,_S.default,yS.default,vS.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},$S.default,bS.default];$a.default=SS});var Sa=$(fo=>{"use strict";Object.defineProperty(fo,"__esModule",{value:!0});fo.validateAdditionalItems=void 0;var Ct=I(),ba=Z(),wS={message:({params:{len:t}})=>(0,Ct.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,Ct._)`{limit: ${t}}`},zS={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:wS,code(t){let{parentSchema:e,it:r}=t,{items:o}=e;if(!Array.isArray(o)){(0,ba.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}vm(t,o)}};function vm(t,e){let{gen:r,schema:o,data:n,keyword:s,it:i}=t;i.items=!0;let a=r.const("len",(0,Ct._)`${n}.length`);if(o===!1)t.setParams({len:e.length}),t.pass((0,Ct._)`${a} <= ${e.length}`);else if(typeof o=="object"&&!(0,ba.alwaysValidSchema)(i,o)){let u=r.var("valid",(0,Ct._)`${a} <= ${e.length}`);r.if((0,Ct.not)(u),()=>c(u)),t.ok(u)}function c(u){r.forRange("i",e.length,a,l=>{t.subschema({keyword:s,dataProp:l,dataPropType:ba.Type.Num},u),i.allErrors||r.if((0,Ct.not)(u),()=>r.break())})}}fo.validateAdditionalItems=vm;fo.default=zS});var wa=$(mo=>{"use strict";Object.defineProperty(mo,"__esModule",{value:!0});mo.validateTuple=void 0;var $m=I(),kn=Z(),xS=Ce(),ES={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return bm(t,"additionalItems",e);r.items=!0,!(0,kn.alwaysValidSchema)(r,e)&&t.ok((0,xS.validateArray)(t))}};function bm(t,e,r=t.schema){let{gen:o,parentSchema:n,data:s,keyword:i,it:a}=t;l(n),a.opts.unevaluated&&r.length&&a.items!==!0&&(a.items=kn.mergeEvaluated.items(o,r.length,a.items));let c=o.name("valid"),u=o.const("len",(0,$m._)`${s}.length`);r.forEach((d,p)=>{(0,kn.alwaysValidSchema)(a,d)||(o.if((0,$m._)`${u} > ${p}`,()=>t.subschema({keyword:i,schemaProp:p,dataProp:p},c)),t.ok(c))});function l(d){let{opts:p,errSchemaPath:f}=a,m=r.length,_=m===d.minItems&&(m===d.maxItems||d[e]===!1);if(p.strictTuples&&!_){let y=`"${i}" is ${m}-tuple, but minItems or maxItems/${e} are not specified or different at path "${f}"`;(0,kn.checkStrictMode)(a,y,p.strictTuples)}}}mo.validateTuple=bm;mo.default=ES});var Sm=$(za=>{"use strict";Object.defineProperty(za,"__esModule",{value:!0});var kS=wa(),PS={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,kS.validateTuple)(t,"items")};za.default=PS});var zm=$(xa=>{"use strict";Object.defineProperty(xa,"__esModule",{value:!0});var wm=I(),TS=Z(),OS=Ce(),RS=Sa(),IS={message:({params:{len:t}})=>(0,wm.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,wm._)`{limit: ${t}}`},AS={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:IS,code(t){let{schema:e,parentSchema:r,it:o}=t,{prefixItems:n}=r;o.items=!0,!(0,TS.alwaysValidSchema)(o,e)&&(n?(0,RS.validateAdditionalItems)(t,n):t.ok((0,OS.validateArray)(t)))}};xa.default=AS});var xm=$(Ea=>{"use strict";Object.defineProperty(Ea,"__esModule",{value:!0});var De=I(),Pn=Z(),NS={message:({params:{min:t,max:e}})=>e===void 0?(0,De.str)`must contain at least ${t} valid item(s)`:(0,De.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,De._)`{minContains: ${t}}`:(0,De._)`{minContains: ${t}, maxContains: ${e}}`},CS={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:NS,code(t){let{gen:e,schema:r,parentSchema:o,data:n,it:s}=t,i,a,{minContains:c,maxContains:u}=o;s.opts.next?(i=c===void 0?1:c,a=u):i=1;let l=e.const("len",(0,De._)`${n}.length`);if(t.setParams({min:i,max:a}),a===void 0&&i===0){(0,Pn.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&i>a){(0,Pn.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,Pn.alwaysValidSchema)(s,r)){let _=(0,De._)`${l} >= ${i}`;a!==void 0&&(_=(0,De._)`${_} && ${l} <= ${a}`),t.pass(_);return}s.items=!0;let d=e.name("valid");a===void 0&&i===1?f(d,()=>e.if(d,()=>e.break())):i===0?(e.let(d,!0),a!==void 0&&e.if((0,De._)`${n}.length > 0`,p)):(e.let(d,!1),p()),t.result(d,()=>t.reset());function p(){let _=e.name("_valid"),y=e.let("count",0);f(_,()=>e.if(_,()=>m(y)))}function f(_,y){e.forRange("i",0,l,v=>{t.subschema({keyword:"contains",dataProp:v,dataPropType:Pn.Type.Num,compositeRule:!0},_),y()})}function m(_){e.code((0,De._)`${_}++`),a===void 0?e.if((0,De._)`${_} >= ${i}`,()=>e.assign(d,!0).break()):(e.if((0,De._)`${_} > ${a}`,()=>e.assign(d,!1).break()),i===1?e.assign(d,!0):e.if((0,De._)`${_} >= ${i}`,()=>e.assign(d,!0)))}}};Ea.default=CS});var Pm=$(Ke=>{"use strict";Object.defineProperty(Ke,"__esModule",{value:!0});Ke.validateSchemaDeps=Ke.validatePropertyDeps=Ke.error=void 0;var ka=I(),MS=Z(),ho=Ce();Ke.error={message:({params:{property:t,depsCount:e,deps:r}})=>{let o=e===1?"property":"properties";return(0,ka.str)`must have ${o} ${r} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:r,missingProperty:o}})=>(0,ka._)`{property: ${t},
7
+ missingProperty: ${o},
8
8
  depsCount: ${e},
9
- deps: ${r}}`};var eE={keyword:"dependencies",type:"object",schemaType:"object",error:xt.error,code(t){let[e,r]=tE(t);N_(t,e),R_(t,r)}};function tE({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 N_(t,e=t.schema){let{gen:r,data:n,it:o}=t;if(Object.keys(e).length===0)return;let i=r.let("missing");for(let a in e){let s=e[a];if(s.length===0)continue;let c=(0,oi.propertyInData)(r,n,a,o.opts.ownProperties);t.setParams({property:a,depsCount:s.length,deps:s.join(", ")}),o.allErrors?r.if(c,()=>{for(let u of s)(0,oi.checkReportMissingProp)(t,u)}):(r.if((0,Zp._)`${c} && (${(0,oi.checkMissingProp)(t,s,i)})`),(0,oi.reportMissingProp)(t,i),r.else())}}xt.validatePropertyDeps=N_;function R_(t,e=t.schema){let{gen:r,data:n,keyword:o,it:i}=t,a=r.name("valid");for(let s in e)(0,QI.alwaysValidSchema)(i,e[s])||(r.if((0,oi.propertyInData)(r,n,s,i.opts.ownProperties),()=>{let c=t.subschema({keyword:o,schemaProp:s},a);t.mergeValidEvaluated(c,a)},()=>r.var(a,!0)),t.ok(a))}xt.validateSchemaDeps=R_;xt.default=eE});var Z_=S(Cp=>{"use strict";Object.defineProperty(Cp,"__esModule",{value:!0});var U_=K(),rE=ee(),nE={message:"property name must be valid",params:({params:t})=>(0,U_._)`{propertyName: ${t.propertyName}}`},oE={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:nE,code(t){let{gen:e,schema:r,data:n,it:o}=t;if((0,rE.alwaysValidSchema)(o,r))return;let i=e.name("valid");e.forIn("key",n,a=>{t.setParams({propertyName:a}),t.subschema({keyword:"propertyNames",data:a,dataTypes:["string"],propertyName:a,compositeRule:!0},i),e.if((0,U_.not)(i),()=>{t.error(!0),o.allErrors||e.break()})}),t.ok(i)}};Cp.default=oE});var Lp=S(Mp=>{"use strict";Object.defineProperty(Mp,"__esModule",{value:!0});var os=nt(),mt=K(),iE=Ct(),is=ee(),aE={message:"must NOT have additional properties",params:({params:t})=>(0,mt._)`{additionalProperty: ${t.additionalProperty}}`},sE={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:aE,code(t){let{gen:e,schema:r,parentSchema:n,data:o,errsCount:i,it:a}=t;if(!i)throw new Error("ajv implementation error");let{allErrors:s,opts:c}=a;if(a.props=!0,c.removeAdditional!=="all"&&(0,is.alwaysValidSchema)(a,r))return;let u=(0,os.allSchemaProperties)(n.properties),l=(0,os.allSchemaProperties)(n.patternProperties);d(),t.ok((0,mt._)`${i} === ${iE.default.errors}`);function d(){e.forIn("key",o,$=>{!u.length&&!l.length?g($):e.if(m($),()=>g($))})}function m($){let k;if(u.length>8){let O=(0,is.schemaRefOrVal)(a,n.properties,"properties");k=(0,os.isOwnProperty)(e,O,$)}else u.length?k=(0,mt.or)(...u.map(O=>(0,mt._)`${$} === ${O}`)):k=mt.nil;return l.length&&(k=(0,mt.or)(k,...l.map(O=>(0,mt._)`${(0,os.usePattern)(t,O)}.test(${$})`))),(0,mt.not)(k)}function f($){e.code((0,mt._)`delete ${o}[${$}]`)}function g($){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){f($);return}if(r===!1){t.setParams({additionalProperty:$}),t.error(),s||e.break();return}if(typeof r=="object"&&!(0,is.alwaysValidSchema)(a,r)){let k=e.name("valid");c.removeAdditional==="failing"?(v($,k,!1),e.if((0,mt.not)(k),()=>{t.reset(),f($)})):(v($,k),s||e.if((0,mt.not)(k),()=>e.break()))}}function v($,k,O){let I={keyword:"additionalProperties",dataProp:$,dataPropType:is.Type.Str};O===!1&&Object.assign(I,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(I,k)}}};Mp.default=sE});var L_=S(Fp=>{"use strict";Object.defineProperty(Fp,"__esModule",{value:!0});var cE=Vo(),C_=nt(),qp=ee(),M_=Lp(),uE={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,parentSchema:n,data:o,it:i}=t;i.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&M_.default.code(new cE.KeywordCxt(i,M_.default,"additionalProperties"));let a=(0,C_.allSchemaProperties)(r);for(let d of a)i.definedProperties.add(d);i.opts.unevaluated&&a.length&&i.props!==!0&&(i.props=qp.mergeEvaluated.props(e,(0,qp.toHash)(a),i.props));let s=a.filter(d=>!(0,qp.alwaysValidSchema)(i,r[d]));if(s.length===0)return;let c=e.name("valid");for(let d of s)u(d)?l(d):(e.if((0,C_.propertyInData)(e,o,d,i.opts.ownProperties)),l(d),i.allErrors||e.else().var(c,!0),e.endIf()),t.it.definedProperties.add(d),t.ok(c);function u(d){return i.opts.useDefaults&&!i.compositeRule&&r[d].default!==void 0}function l(d){t.subschema({keyword:"properties",schemaProp:d,dataProp:d},c)}}};Fp.default=uE});var J_=S(Vp=>{"use strict";Object.defineProperty(Vp,"__esModule",{value:!0});var q_=nt(),as=K(),F_=ee(),V_=ee(),lE={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,data:n,parentSchema:o,it:i}=t,{opts:a}=i,s=(0,q_.allSchemaProperties)(r),c=s.filter(v=>(0,F_.alwaysValidSchema)(i,r[v]));if(s.length===0||c.length===s.length&&(!i.opts.unevaluated||i.props===!0))return;let u=a.strictSchema&&!a.allowMatchingProperties&&o.properties,l=e.name("valid");i.props!==!0&&!(i.props instanceof as.Name)&&(i.props=(0,V_.evaluatedPropsToName)(e,i.props));let{props:d}=i;m();function m(){for(let v of s)u&&f(v),i.allErrors?g(v):(e.var(l,!0),g(v),e.if(l))}function f(v){for(let $ in u)new RegExp(v).test($)&&(0,F_.checkStrictMode)(i,`property ${$} matches pattern ${v} (use allowMatchingProperties)`)}function g(v){e.forIn("key",n,$=>{e.if((0,as._)`${(0,q_.usePattern)(t,v)}.test(${$})`,()=>{let k=c.includes(v);k||t.subschema({keyword:"patternProperties",schemaProp:v,dataProp:$,dataPropType:V_.Type.Str},l),i.opts.unevaluated&&d!==!0?e.assign((0,as._)`${d}[${$}]`,!0):!k&&!i.allErrors&&e.if((0,as.not)(l),()=>e.break())})})}}};Vp.default=lE});var K_=S(Jp=>{"use strict";Object.defineProperty(Jp,"__esModule",{value:!0});var dE=ee(),pE={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:n}=t;if((0,dE.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"}};Jp.default=pE});var H_=S(Kp=>{"use strict";Object.defineProperty(Kp,"__esModule",{value:!0});var fE=nt(),mE={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:fE.validateUnion,error:{message:"must match a schema in anyOf"}};Kp.default=mE});var W_=S(Hp=>{"use strict";Object.defineProperty(Hp,"__esModule",{value:!0});var ss=K(),hE=ee(),gE={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,ss._)`{passingSchemas: ${t.passing}}`},vE={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:gE,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 i=r,a=e.let("valid",!1),s=e.let("passing",null),c=e.name("_valid");t.setParams({passing:s}),e.block(u),t.result(a,()=>t.reset(),()=>t.error(!0));function u(){i.forEach((l,d)=>{let m;(0,hE.alwaysValidSchema)(o,l)?e.var(c,!0):m=t.subschema({keyword:"oneOf",schemaProp:d,compositeRule:!0},c),d>0&&e.if((0,ss._)`${c} && ${a}`).assign(a,!1).assign(s,(0,ss._)`[${s}, ${d}]`).else(),e.if(c,()=>{e.assign(a,!0),e.assign(s,d),m&&t.mergeEvaluated(m,ss.Name)})})}}};Hp.default=vE});var G_=S(Wp=>{"use strict";Object.defineProperty(Wp,"__esModule",{value:!0});var _E=ee(),yE={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((i,a)=>{if((0,_E.alwaysValidSchema)(n,i))return;let s=t.subschema({keyword:"allOf",schemaProp:a},o);t.ok(o),t.mergeEvaluated(s)})}};Wp.default=yE});var Y_=S(Gp=>{"use strict";Object.defineProperty(Gp,"__esModule",{value:!0});var cs=K(),X_=ee(),$E={message:({params:t})=>(0,cs.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,cs._)`{failingKeyword: ${t.ifClause}}`},bE={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:$E,code(t){let{gen:e,parentSchema:r,it:n}=t;r.then===void 0&&r.else===void 0&&(0,X_.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let o=B_(n,"then"),i=B_(n,"else");if(!o&&!i)return;let a=e.let("valid",!0),s=e.name("_valid");if(c(),t.reset(),o&&i){let l=e.let("ifClause");t.setParams({ifClause:l}),e.if(s,u("then",l),u("else",l))}else o?e.if(s,u("then")):e.if((0,cs.not)(s),u("else"));t.pass(a,()=>t.error(!0));function c(){let l=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},s);t.mergeEvaluated(l)}function u(l,d){return()=>{let m=t.subschema({keyword:l},s);e.assign(a,s),t.mergeValidEvaluated(m,a),d?e.assign(d,(0,cs._)`${l}`):t.setParams({ifClause:l})}}}};function B_(t,e){let r=t.schema[e];return r!==void 0&&!(0,X_.alwaysValidSchema)(t,r)}Gp.default=bE});var Q_=S(Bp=>{"use strict";Object.defineProperty(Bp,"__esModule",{value:!0});var xE=ee(),kE={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,xE.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};Bp.default=kE});var ey=S(Xp=>{"use strict";Object.defineProperty(Xp,"__esModule",{value:!0});var SE=Dp(),wE=P_(),zE=Np(),IE=j_(),EE=D_(),TE=A_(),PE=Z_(),OE=Lp(),jE=L_(),DE=J_(),NE=K_(),RE=H_(),AE=W_(),UE=G_(),ZE=Y_(),CE=Q_();function ME(t=!1){let e=[NE.default,RE.default,AE.default,UE.default,ZE.default,CE.default,PE.default,OE.default,TE.default,jE.default,DE.default];return t?e.push(wE.default,IE.default):e.push(SE.default,zE.default),e.push(EE.default),e}Xp.default=ME});var ty=S(Yp=>{"use strict";Object.defineProperty(Yp,"__esModule",{value:!0});var ge=K(),LE={message:({schemaCode:t})=>(0,ge.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,ge._)`{format: ${t}}`},qE={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:LE,code(t,e){let{gen:r,data:n,$data:o,schema:i,schemaCode:a,it:s}=t,{opts:c,errSchemaPath:u,schemaEnv:l,self:d}=s;if(!c.validateFormats)return;o?m():f();function m(){let g=r.scopeValue("formats",{ref:d.formats,code:c.code.formats}),v=r.const("fDef",(0,ge._)`${g}[${a}]`),$=r.let("fType"),k=r.let("format");r.if((0,ge._)`typeof ${v} == "object" && !(${v} instanceof RegExp)`,()=>r.assign($,(0,ge._)`${v}.type || "string"`).assign(k,(0,ge._)`${v}.validate`),()=>r.assign($,(0,ge._)`"string"`).assign(k,v)),t.fail$data((0,ge.or)(O(),I()));function O(){return c.strictSchema===!1?ge.nil:(0,ge._)`${a} && !${k}`}function I(){let Z=l.$async?(0,ge._)`(${v}.async ? await ${k}(${n}) : ${k}(${n}))`:(0,ge._)`${k}(${n})`,j=(0,ge._)`(typeof ${k} == "function" ? ${Z} : ${k}.test(${n}))`;return(0,ge._)`${k} && ${k} !== true && ${$} === ${e} && !${j}`}}function f(){let g=d.formats[i];if(!g){O();return}if(g===!0)return;let[v,$,k]=I(g);v===e&&t.pass(Z());function O(){if(c.strictSchema===!1){d.logger.warn(j());return}throw new Error(j());function j(){return`unknown format "${i}" ignored in schema at path "${u}"`}}function I(j){let at=j instanceof RegExp?(0,ge.regexpCode)(j):c.code.formats?(0,ge._)`${c.code.formats}${(0,ge.getProperty)(i)}`:void 0,st=r.scopeValue("formats",{key:i,ref:j,code:at});return typeof j=="object"&&!(j instanceof RegExp)?[j.type||"string",j.validate,(0,ge._)`${st}.validate`]:["string",j,st]}function Z(){if(typeof g=="object"&&!(g instanceof RegExp)&&g.async){if(!l.$async)throw new Error("async format in sync schema");return(0,ge._)`await ${k}(${n})`}return typeof $=="function"?(0,ge._)`${k}(${n})`:(0,ge._)`${k}.test(${n})`}}}};Yp.default=qE});var ry=S(Qp=>{"use strict";Object.defineProperty(Qp,"__esModule",{value:!0});var FE=ty(),VE=[FE.default];Qp.default=VE});var ny=S(fn=>{"use strict";Object.defineProperty(fn,"__esModule",{value:!0});fn.contentVocabulary=fn.metadataVocabulary=void 0;fn.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];fn.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var iy=S(ef=>{"use strict";Object.defineProperty(ef,"__esModule",{value:!0});var JE=p_(),KE=z_(),HE=ey(),WE=ry(),oy=ny(),GE=[JE.default,KE.default,(0,HE.default)(),WE.default,oy.metadataVocabulary,oy.contentVocabulary];ef.default=GE});var sy=S(us=>{"use strict";Object.defineProperty(us,"__esModule",{value:!0});us.DiscrError=void 0;var ay;(function(t){t.Tag="tag",t.Mapping="mapping"})(ay||(us.DiscrError=ay={}))});var uy=S(rf=>{"use strict";Object.defineProperty(rf,"__esModule",{value:!0});var mn=K(),tf=sy(),cy=Ja(),BE=Jo(),XE=ee(),YE={message:({params:{discrError:t,tagName:e}})=>t===tf.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>(0,mn._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`},QE={keyword:"discriminator",type:"object",schemaType:"object",error:YE,code(t){let{gen:e,data:r,schema:n,parentSchema:o,it:i}=t,{oneOf:a}=o;if(!i.opts.discriminator)throw new Error("discriminator: requires discriminator option");let s=n.propertyName;if(typeof s!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!a)throw new Error("discriminator: requires oneOf keyword");let c=e.let("valid",!1),u=e.const("tag",(0,mn._)`${r}${(0,mn.getProperty)(s)}`);e.if((0,mn._)`typeof ${u} == "string"`,()=>l(),()=>t.error(!1,{discrError:tf.DiscrError.Tag,tag:u,tagName:s})),t.ok(c);function l(){let f=m();e.if(!1);for(let g in f)e.elseIf((0,mn._)`${u} === ${g}`),e.assign(c,d(f[g]));e.else(),t.error(!1,{discrError:tf.DiscrError.Mapping,tag:u,tagName:s}),e.endIf()}function d(f){let g=e.name("valid"),v=t.subschema({keyword:"oneOf",schemaProp:f},g);return t.mergeEvaluated(v,mn.Name),g}function m(){var f;let g={},v=k(o),$=!0;for(let Z=0;Z<a.length;Z++){let j=a[Z];if(j?.$ref&&!(0,XE.schemaHasRulesButRef)(j,i.self.RULES)){let st=j.$ref;if(j=cy.resolveRef.call(i.self,i.schemaEnv.root,i.baseId,st),j instanceof cy.SchemaEnv&&(j=j.schema),j===void 0)throw new BE.default(i.opts.uriResolver,i.baseId,st)}let at=(f=j?.properties)===null||f===void 0?void 0:f[s];if(typeof at!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${s}"`);$=$&&(v||k(j)),O(at,Z)}if(!$)throw new Error(`discriminator: "${s}" must be required`);return g;function k({required:Z}){return Array.isArray(Z)&&Z.includes(s)}function O(Z,j){if(Z.const)I(Z.const,j);else if(Z.enum)for(let at of Z.enum)I(at,j);else throw new Error(`discriminator: "properties/${s}" must have "const" or "enum"`)}function I(Z,j){if(typeof Z!="string"||Z in g)throw new Error(`discriminator: "${s}" values must be unique strings`);g[Z]=j}}}};rf.default=QE});var ly=S((pZ,eT)=>{eT.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 of=S((he,nf)=>{"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 tT=a_(),rT=iy(),nT=uy(),dy=ly(),oT=["/properties"],ls="http://json-schema.org/draft-07/schema",hn=class extends tT.default{_addVocabularies(){super._addVocabularies(),rT.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(nT.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(dy,oT):dy;this.addMetaSchema(e,ls,!1),this.refs["http://json-schema.org/schema"]=ls}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(ls)?ls:void 0)}};he.Ajv=hn;nf.exports=he=hn;nf.exports.Ajv=hn;Object.defineProperty(he,"__esModule",{value:!0});he.default=hn;var iT=Vo();Object.defineProperty(he,"KeywordCxt",{enumerable:!0,get:function(){return iT.KeywordCxt}});var gn=K();Object.defineProperty(he,"_",{enumerable:!0,get:function(){return gn._}});Object.defineProperty(he,"str",{enumerable:!0,get:function(){return gn.str}});Object.defineProperty(he,"stringify",{enumerable:!0,get:function(){return gn.stringify}});Object.defineProperty(he,"nil",{enumerable:!0,get:function(){return gn.nil}});Object.defineProperty(he,"Name",{enumerable:!0,get:function(){return gn.Name}});Object.defineProperty(he,"CodeGen",{enumerable:!0,get:function(){return gn.CodeGen}});var aT=Fa();Object.defineProperty(he,"ValidationError",{enumerable:!0,get:function(){return aT.default}});var sT=Jo();Object.defineProperty(he,"MissingRefError",{enumerable:!0,get:function(){return sT.default}})});var yy=S(St=>{"use strict";Object.defineProperty(St,"__esModule",{value:!0});St.formatNames=St.fastFormats=St.fullFormats=void 0;function kt(t,e){return{validate:t,compare:e}}St.fullFormats={date:kt(hy,uf),time:kt(sf(!0),lf),"date-time":kt(py(!0),vy),"iso-time":kt(sf(),gy),"iso-date-time":kt(py(),_y),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:fT,"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:$T,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:mT,int32:{type:"number",validate:vT},int64:{type:"number",validate:_T},float:{type:"number",validate:my},double:{type:"number",validate:my},password:!0,binary:!0};St.fastFormats={...St.fullFormats,date:kt(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,uf),time:kt(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,lf),"date-time":kt(/^\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,vy),"iso-time":kt(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,gy),"iso-date-time":kt(/^\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,_y),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};St.formatNames=Object.keys(St.fullFormats);function cT(t){return t%4===0&&(t%100!==0||t%400===0)}var uT=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,lT=[0,31,28,31,30,31,30,31,31,30,31,30,31];function hy(t){let e=uT.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&&cT(r)?29:lT[n])}function uf(t,e){if(t&&e)return t>e?1:t<e?-1:0}var af=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function sf(t){return function(r){let n=af.exec(r);if(!n)return!1;let o=+n[1],i=+n[2],a=+n[3],s=n[4],c=n[5]==="-"?-1:1,u=+(n[6]||0),l=+(n[7]||0);if(u>23||l>59||t&&!s)return!1;if(o<=23&&i<=59&&a<60)return!0;let d=i-l*c,m=o-u*c-(d<0?1:0);return(m===23||m===-1)&&(d===59||d===-1)&&a<61}}function lf(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 gy(t,e){if(!(t&&e))return;let r=af.exec(t),n=af.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 cf=/t|\s/i;function py(t){let e=sf(t);return function(n){let o=n.split(cf);return o.length===2&&hy(o[0])&&e(o[1])}}function vy(t,e){if(!(t&&e))return;let r=new Date(t).valueOf(),n=new Date(e).valueOf();if(r&&n)return r-n}function _y(t,e){if(!(t&&e))return;let[r,n]=t.split(cf),[o,i]=e.split(cf),a=uf(r,o);if(a!==void 0)return a||lf(n,i)}var dT=/\/|:/,pT=/^(?:[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 fT(t){return dT.test(t)&&pT.test(t)}var fy=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function mT(t){return fy.lastIndex=0,fy.test(t)}var hT=-(2**31),gT=2**31-1;function vT(t){return Number.isInteger(t)&&t<=gT&&t>=hT}function _T(t){return Number.isInteger(t)}function my(){return!0}var yT=/[^\\]\\Z/;function $T(t){if(yT.test(t))return!1;try{return new RegExp(t),!0}catch{return!1}}});var $y=S(vn=>{"use strict";Object.defineProperty(vn,"__esModule",{value:!0});vn.formatLimitDefinition=void 0;var bT=of(),ht=K(),cr=ht.operators,ds={formatMaximum:{okStr:"<=",ok:cr.LTE,fail:cr.GT},formatMinimum:{okStr:">=",ok:cr.GTE,fail:cr.LT},formatExclusiveMaximum:{okStr:"<",ok:cr.LT,fail:cr.GTE},formatExclusiveMinimum:{okStr:">",ok:cr.GT,fail:cr.LTE}},xT={message:({keyword:t,schemaCode:e})=>(0,ht.str)`should be ${ds[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,ht._)`{comparison: ${ds[t].okStr}, limit: ${e}}`};vn.formatLimitDefinition={keyword:Object.keys(ds),type:"string",schemaType:"string",$data:!0,error:xT,code(t){let{gen:e,data:r,schemaCode:n,keyword:o,it:i}=t,{opts:a,self:s}=i;if(!a.validateFormats)return;let c=new bT.KeywordCxt(i,s.RULES.all.format.definition,"format");c.$data?u():l();function u(){let m=e.scopeValue("formats",{ref:s.formats,code:a.code.formats}),f=e.const("fmt",(0,ht._)`${m}[${c.schemaCode}]`);t.fail$data((0,ht.or)((0,ht._)`typeof ${f} != "object"`,(0,ht._)`${f} instanceof RegExp`,(0,ht._)`typeof ${f}.compare != "function"`,d(f)))}function l(){let m=c.schema,f=s.formats[m];if(!f||f===!0)return;if(typeof f!="object"||f instanceof RegExp||typeof f.compare!="function")throw new Error(`"${o}": format "${m}" does not define "compare" function`);let g=e.scopeValue("formats",{key:m,ref:f,code:a.code.formats?(0,ht._)`${a.code.formats}${(0,ht.getProperty)(m)}`:void 0});t.fail$data(d(g))}function d(m){return(0,ht._)`${m}.compare(${r}, ${n}) ${ds[o].fail} 0`}},dependencies:["format"]};var kT=t=>(t.addKeyword(vn.formatLimitDefinition),t);vn.default=kT});var Sy=S((ii,ky)=>{"use strict";Object.defineProperty(ii,"__esModule",{value:!0});var _n=yy(),ST=$y(),df=K(),by=new df.Name("fullFormats"),wT=new df.Name("fastFormats"),pf=(t,e={keywords:!0})=>{if(Array.isArray(e))return xy(t,e,_n.fullFormats,by),t;let[r,n]=e.mode==="fast"?[_n.fastFormats,wT]:[_n.fullFormats,by],o=e.formats||_n.formatNames;return xy(t,o,r,n),e.keywords&&(0,ST.default)(t),t};pf.get=(t,e="full")=>{let n=(e==="fast"?_n.fastFormats:_n.fullFormats)[t];if(!n)throw new Error(`Unknown format "${t}"`);return n};function xy(t,e,r,n){var o,i;(o=(i=t.opts.code).formats)!==null&&o!==void 0||(i.formats=(0,df._)`require("ajv-formats/dist/formats").${n}`);for(let a of e)t.addFormat(a,r[a])}ky.exports=ii=pf;Object.defineProperty(ii,"__esModule",{value:!0});ii.default=pf});var zt=require("fs"),bn=require("path"),$f=require("os"),ws=(i=>(i[i.DEBUG=0]="DEBUG",i[i.INFO=1]="INFO",i[i.WARN=2]="WARN",i[i.ERROR=3]="ERROR",i[i.SILENT=4]="SILENT",i))(ws||{}),yf=(0,bn.join)((0,$f.homedir)(),".claude-mem"),zs=class{level=null;useColor;logFilePath=null;logFileInitialized=!1;constructor(){this.useColor=process.stdout.isTTY??!1}ensureLogFileInitialized(){if(!this.logFileInitialized){this.logFileInitialized=!0;try{let e=(0,bn.join)(yf,"logs");(0,zt.existsSync)(e)||(0,zt.mkdirSync)(e,{recursive:!0});let r=new Date().toISOString().split("T")[0];this.logFilePath=(0,bn.join)(e,`claude-mem-${r}.log`)}catch(e){console.error("[LOGGER] Failed to initialize log file:",e),this.logFilePath=null}}}getLevel(){if(this.level===null)try{let e=(0,bn.join)(yf,"settings.json");if((0,zt.existsSync)(e)){let r=(0,zt.readFileSync)(e,"utf-8"),o=(JSON.parse(r).CLAUDE_MEM_LOG_LEVEL||"INFO").toUpperCase();this.level=ws[o]??1}else this.level=1}catch{this.level=1}return this.level}correlationId(e,r){return`obs-${e}-${r}`}sessionId(e){return`session-${e}`}formatData(e){if(e==null)return"";if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean")return e.toString();if(typeof e=="object"){if(e instanceof Error)return this.getLevel()===0?`${e.message}
10
- ${e.stack}`:e.message;if(Array.isArray(e))return`[${e.length} items]`;let r=Object.keys(e);return r.length===0?"{}":r.length<=3?JSON.stringify(e):`{${r.length} keys: ${r.slice(0,3).join(", ")}...}`}return String(e)}formatTool(e,r){if(!r)return e;let n=r;if(typeof r=="string")try{n=JSON.parse(r)}catch{n=r}if(e==="Bash"&&n.command)return`${e}(${n.command})`;if(n.file_path)return`${e}(${n.file_path})`;if(n.notebook_path)return`${e}(${n.notebook_path})`;if(e==="Glob"&&n.pattern)return`${e}(${n.pattern})`;if(e==="Grep"&&n.pattern)return`${e}(${n.pattern})`;if(n.url)return`${e}(${n.url})`;if(n.query)return`${e}(${n.query})`;if(e==="Task"){if(n.subagent_type)return`${e}(${n.subagent_type})`;if(n.description)return`${e}(${n.description})`}return e==="Skill"&&n.skill?`${e}(${n.skill})`:e==="LSP"&&n.operation?`${e}(${n.operation})`:e}formatTimestamp(e){let r=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),o=String(e.getDate()).padStart(2,"0"),i=String(e.getHours()).padStart(2,"0"),a=String(e.getMinutes()).padStart(2,"0"),s=String(e.getSeconds()).padStart(2,"0"),c=String(e.getMilliseconds()).padStart(3,"0");return`${r}-${n}-${o} ${i}:${a}:${s}.${c}`}log(e,r,n,o,i){if(e<this.getLevel())return;this.ensureLogFileInitialized();let a=this.formatTimestamp(new Date),s=ws[e].padEnd(5),c=r.padEnd(6),u="";o?.correlationId?u=`[${o.correlationId}] `:o?.sessionId&&(u=`[session-${o.sessionId}] `);let l="";i!=null&&(i instanceof Error?l=this.getLevel()===0?`
11
- ${i.message}
12
- ${i.stack}`:` ${i.message}`:this.getLevel()===0&&typeof i=="object"?l=`
13
- `+JSON.stringify(i,null,2):l=" "+this.formatData(i));let d="";if(o){let{sessionId:f,memorySessionId:g,correlationId:v,...$}=o;Object.keys($).length>0&&(d=` {${Object.entries($).map(([O,I])=>`${O}=${I}`).join(", ")}}`)}let m=`[${a}] [${s}] [${c}] ${u}${n}${d}${l}`;if(this.logFilePath)try{(0,zt.appendFileSync)(this.logFilePath,m+`
9
+ deps: ${r}}`};var DS={keyword:"dependencies",type:"object",schemaType:"object",error:Ke.error,code(t){let[e,r]=jS(t);Em(t,e),km(t,r)}};function jS({schema:t}){let e={},r={};for(let o in t){if(o==="__proto__")continue;let n=Array.isArray(t[o])?e:r;n[o]=t[o]}return[e,r]}function Em(t,e=t.schema){let{gen:r,data:o,it:n}=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,ho.propertyInData)(r,o,i,n.opts.ownProperties);t.setParams({property:i,depsCount:a.length,deps:a.join(", ")}),n.allErrors?r.if(c,()=>{for(let u of a)(0,ho.checkReportMissingProp)(t,u)}):(r.if((0,ka._)`${c} && (${(0,ho.checkMissingProp)(t,a,s)})`),(0,ho.reportMissingProp)(t,s),r.else())}}Ke.validatePropertyDeps=Em;function km(t,e=t.schema){let{gen:r,data:o,keyword:n,it:s}=t,i=r.name("valid");for(let a in e)(0,MS.alwaysValidSchema)(s,e[a])||(r.if((0,ho.propertyInData)(r,o,a,s.opts.ownProperties),()=>{let c=t.subschema({keyword:n,schemaProp:a},i);t.mergeValidEvaluated(c,i)},()=>r.var(i,!0)),t.ok(i))}Ke.validateSchemaDeps=km;Ke.default=DS});var Om=$(Pa=>{"use strict";Object.defineProperty(Pa,"__esModule",{value:!0});var Tm=I(),ZS=Z(),LS={message:"property name must be valid",params:({params:t})=>(0,Tm._)`{propertyName: ${t.propertyName}}`},qS={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:LS,code(t){let{gen:e,schema:r,data:o,it:n}=t;if((0,ZS.alwaysValidSchema)(n,r))return;let s=e.name("valid");e.forIn("key",o,i=>{t.setParams({propertyName:i}),t.subschema({keyword:"propertyNames",data:i,dataTypes:["string"],propertyName:i,compositeRule:!0},s),e.if((0,Tm.not)(s),()=>{t.error(!0),n.allErrors||e.break()})}),t.ok(s)}};Pa.default=qS});var Oa=$(Ta=>{"use strict";Object.defineProperty(Ta,"__esModule",{value:!0});var Tn=Ce(),Ue=I(),US=nt(),On=Z(),FS={message:"must NOT have additional properties",params:({params:t})=>(0,Ue._)`{additionalProperty: ${t.additionalProperty}}`},VS={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:FS,code(t){let{gen:e,schema:r,parentSchema:o,data:n,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,On.alwaysValidSchema)(i,r))return;let u=(0,Tn.allSchemaProperties)(o.properties),l=(0,Tn.allSchemaProperties)(o.patternProperties);d(),t.ok((0,Ue._)`${s} === ${US.default.errors}`);function d(){e.forIn("key",n,y=>{!u.length&&!l.length?m(y):e.if(p(y),()=>m(y))})}function p(y){let v;if(u.length>8){let E=(0,On.schemaRefOrVal)(i,o.properties,"properties");v=(0,Tn.isOwnProperty)(e,E,y)}else u.length?v=(0,Ue.or)(...u.map(E=>(0,Ue._)`${y} === ${E}`)):v=Ue.nil;return l.length&&(v=(0,Ue.or)(v,...l.map(E=>(0,Ue._)`${(0,Tn.usePattern)(t,E)}.test(${y})`))),(0,Ue.not)(v)}function f(y){e.code((0,Ue._)`delete ${n}[${y}]`)}function m(y){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){f(y);return}if(r===!1){t.setParams({additionalProperty:y}),t.error(),a||e.break();return}if(typeof r=="object"&&!(0,On.alwaysValidSchema)(i,r)){let v=e.name("valid");c.removeAdditional==="failing"?(_(y,v,!1),e.if((0,Ue.not)(v),()=>{t.reset(),f(y)})):(_(y,v),a||e.if((0,Ue.not)(v),()=>e.break()))}}function _(y,v,E){let S={keyword:"additionalProperties",dataProp:y,dataPropType:On.Type.Str};E===!1&&Object.assign(S,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(S,v)}}};Ta.default=VS});var Am=$(Ia=>{"use strict";Object.defineProperty(Ia,"__esModule",{value:!0});var HS=eo(),Rm=Ce(),Ra=Z(),Im=Oa(),JS={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,parentSchema:o,data:n,it:s}=t;s.opts.removeAdditional==="all"&&o.additionalProperties===void 0&&Im.default.code(new HS.KeywordCxt(s,Im.default,"additionalProperties"));let i=(0,Rm.allSchemaProperties)(r);for(let d of i)s.definedProperties.add(d);s.opts.unevaluated&&i.length&&s.props!==!0&&(s.props=Ra.mergeEvaluated.props(e,(0,Ra.toHash)(i),s.props));let a=i.filter(d=>!(0,Ra.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,Rm.propertyInData)(e,n,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)}}};Ia.default=JS});var Dm=$(Aa=>{"use strict";Object.defineProperty(Aa,"__esModule",{value:!0});var Nm=Ce(),Rn=I(),Cm=Z(),Mm=Z(),KS={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,data:o,parentSchema:n,it:s}=t,{opts:i}=s,a=(0,Nm.allSchemaProperties)(r),c=a.filter(_=>(0,Cm.alwaysValidSchema)(s,r[_]));if(a.length===0||c.length===a.length&&(!s.opts.unevaluated||s.props===!0))return;let u=i.strictSchema&&!i.allowMatchingProperties&&n.properties,l=e.name("valid");s.props!==!0&&!(s.props instanceof Rn.Name)&&(s.props=(0,Mm.evaluatedPropsToName)(e,s.props));let{props:d}=s;p();function p(){for(let _ of a)u&&f(_),s.allErrors?m(_):(e.var(l,!0),m(_),e.if(l))}function f(_){for(let y in u)new RegExp(_).test(y)&&(0,Cm.checkStrictMode)(s,`property ${y} matches pattern ${_} (use allowMatchingProperties)`)}function m(_){e.forIn("key",o,y=>{e.if((0,Rn._)`${(0,Nm.usePattern)(t,_)}.test(${y})`,()=>{let v=c.includes(_);v||t.subschema({keyword:"patternProperties",schemaProp:_,dataProp:y,dataPropType:Mm.Type.Str},l),s.opts.unevaluated&&d!==!0?e.assign((0,Rn._)`${d}[${y}]`,!0):!v&&!s.allErrors&&e.if((0,Rn.not)(l),()=>e.break())})})}}};Aa.default=KS});var jm=$(Na=>{"use strict";Object.defineProperty(Na,"__esModule",{value:!0});var GS=Z(),WS={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:o}=t;if((0,GS.alwaysValidSchema)(o,r)){t.fail();return}let n=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},n),t.failResult(n,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};Na.default=WS});var Zm=$(Ca=>{"use strict";Object.defineProperty(Ca,"__esModule",{value:!0});var BS=Ce(),YS={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:BS.validateUnion,error:{message:"must match a schema in anyOf"}};Ca.default=YS});var Lm=$(Ma=>{"use strict";Object.defineProperty(Ma,"__esModule",{value:!0});var In=I(),XS=Z(),QS={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,In._)`{passingSchemas: ${t.passing}}`},ew={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:QS,code(t){let{gen:e,schema:r,parentSchema:o,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(n.opts.discriminator&&o.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,XS.alwaysValidSchema)(n,l)?e.var(c,!0):p=t.subschema({keyword:"oneOf",schemaProp:d,compositeRule:!0},c),d>0&&e.if((0,In._)`${c} && ${i}`).assign(i,!1).assign(a,(0,In._)`[${a}, ${d}]`).else(),e.if(c,()=>{e.assign(i,!0),e.assign(a,d),p&&t.mergeEvaluated(p,In.Name)})})}}};Ma.default=ew});var qm=$(Da=>{"use strict";Object.defineProperty(Da,"__esModule",{value:!0});var tw=Z(),rw={keyword:"allOf",schemaType:"array",code(t){let{gen:e,schema:r,it:o}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");let n=e.name("valid");r.forEach((s,i)=>{if((0,tw.alwaysValidSchema)(o,s))return;let a=t.subschema({keyword:"allOf",schemaProp:i},n);t.ok(n),t.mergeEvaluated(a)})}};Da.default=rw});var Vm=$(ja=>{"use strict";Object.defineProperty(ja,"__esModule",{value:!0});var An=I(),Fm=Z(),ow={message:({params:t})=>(0,An.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,An._)`{failingKeyword: ${t.ifClause}}`},nw={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:ow,code(t){let{gen:e,parentSchema:r,it:o}=t;r.then===void 0&&r.else===void 0&&(0,Fm.checkStrictMode)(o,'"if" without "then" and "else" is ignored');let n=Um(o,"then"),s=Um(o,"else");if(!n&&!s)return;let i=e.let("valid",!0),a=e.name("_valid");if(c(),t.reset(),n&&s){let l=e.let("ifClause");t.setParams({ifClause:l}),e.if(a,u("then",l),u("else",l))}else n?e.if(a,u("then")):e.if((0,An.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,An._)`${l}`):t.setParams({ifClause:l})}}}};function Um(t,e){let r=t.schema[e];return r!==void 0&&!(0,Fm.alwaysValidSchema)(t,r)}ja.default=nw});var Hm=$(Za=>{"use strict";Object.defineProperty(Za,"__esModule",{value:!0});var sw=Z(),iw={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,sw.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};Za.default=iw});var Jm=$(La=>{"use strict";Object.defineProperty(La,"__esModule",{value:!0});var aw=Sa(),cw=Sm(),uw=wa(),lw=zm(),dw=xm(),pw=Pm(),fw=Om(),mw=Oa(),hw=Am(),gw=Dm(),_w=jm(),yw=Zm(),vw=Lm(),$w=qm(),bw=Vm(),Sw=Hm();function ww(t=!1){let e=[_w.default,yw.default,vw.default,$w.default,bw.default,Sw.default,fw.default,mw.default,pw.default,hw.default,gw.default];return t?e.push(cw.default,lw.default):e.push(aw.default,uw.default),e.push(dw.default),e}La.default=ww});var Km=$(qa=>{"use strict";Object.defineProperty(qa,"__esModule",{value:!0});var ne=I(),zw={message:({schemaCode:t})=>(0,ne.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,ne._)`{format: ${t}}`},xw={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:zw,code(t,e){let{gen:r,data:o,$data:n,schema:s,schemaCode:i,it:a}=t,{opts:c,errSchemaPath:u,schemaEnv:l,self:d}=a;if(!c.validateFormats)return;n?p():f();function p(){let m=r.scopeValue("formats",{ref:d.formats,code:c.code.formats}),_=r.const("fDef",(0,ne._)`${m}[${i}]`),y=r.let("fType"),v=r.let("format");r.if((0,ne._)`typeof ${_} == "object" && !(${_} instanceof RegExp)`,()=>r.assign(y,(0,ne._)`${_}.type || "string"`).assign(v,(0,ne._)`${_}.validate`),()=>r.assign(y,(0,ne._)`"string"`).assign(v,_)),t.fail$data((0,ne.or)(E(),S()));function E(){return c.strictSchema===!1?ne.nil:(0,ne._)`${i} && !${v}`}function S(){let k=l.$async?(0,ne._)`(${_}.async ? await ${v}(${o}) : ${v}(${o}))`:(0,ne._)`${v}(${o})`,w=(0,ne._)`(typeof ${v} == "function" ? ${k} : ${v}.test(${o}))`;return(0,ne._)`${v} && ${v} !== true && ${y} === ${e} && !${w}`}}function f(){let m=d.formats[s];if(!m){E();return}if(m===!0)return;let[_,y,v]=S(m);_===e&&t.pass(k());function E(){if(c.strictSchema===!1){d.logger.warn(w());return}throw new Error(w());function w(){return`unknown format "${s}" ignored in schema at path "${u}"`}}function S(w){let Ee=w instanceof RegExp?(0,ne.regexpCode)(w):c.code.formats?(0,ne._)`${c.code.formats}${(0,ne.getProperty)(s)}`:void 0,Oe=r.scopeValue("formats",{key:s,ref:w,code:Ee});return typeof w=="object"&&!(w instanceof RegExp)?[w.type||"string",w.validate,(0,ne._)`${Oe}.validate`]:["string",w,Oe]}function k(){if(typeof m=="object"&&!(m instanceof RegExp)&&m.async){if(!l.$async)throw new Error("async format in sync schema");return(0,ne._)`await ${v}(${o})`}return typeof y=="function"?(0,ne._)`${v}(${o})`:(0,ne._)`${v}.test(${o})`}}}};qa.default=xw});var Gm=$(Ua=>{"use strict";Object.defineProperty(Ua,"__esModule",{value:!0});var Ew=Km(),kw=[Ew.default];Ua.default=kw});var Wm=$(sr=>{"use strict";Object.defineProperty(sr,"__esModule",{value:!0});sr.contentVocabulary=sr.metadataVocabulary=void 0;sr.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];sr.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var Ym=$(Fa=>{"use strict";Object.defineProperty(Fa,"__esModule",{value:!0});var Pw=nm(),Tw=ym(),Ow=Jm(),Rw=Gm(),Bm=Wm(),Iw=[Pw.default,Tw.default,(0,Ow.default)(),Rw.default,Bm.metadataVocabulary,Bm.contentVocabulary];Fa.default=Iw});var Qm=$(Nn=>{"use strict";Object.defineProperty(Nn,"__esModule",{value:!0});Nn.DiscrError=void 0;var Xm;(function(t){t.Tag="tag",t.Mapping="mapping"})(Xm||(Nn.DiscrError=Xm={}))});var th=$(Ha=>{"use strict";Object.defineProperty(Ha,"__esModule",{value:!0});var ir=I(),Va=Qm(),eh=_n(),Aw=to(),Nw=Z(),Cw={message:({params:{discrError:t,tagName:e}})=>t===Va.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>(0,ir._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`},Mw={keyword:"discriminator",type:"object",schemaType:"object",error:Cw,code(t){let{gen:e,data:r,schema:o,parentSchema:n,it:s}=t,{oneOf:i}=n;if(!s.opts.discriminator)throw new Error("discriminator: requires discriminator option");let a=o.propertyName;if(typeof a!="string")throw new Error("discriminator: requires propertyName");if(o.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,ir._)`${r}${(0,ir.getProperty)(a)}`);e.if((0,ir._)`typeof ${u} == "string"`,()=>l(),()=>t.error(!1,{discrError:Va.DiscrError.Tag,tag:u,tagName:a})),t.ok(c);function l(){let f=p();e.if(!1);for(let m in f)e.elseIf((0,ir._)`${u} === ${m}`),e.assign(c,d(f[m]));e.else(),t.error(!1,{discrError:Va.DiscrError.Mapping,tag:u,tagName:a}),e.endIf()}function d(f){let m=e.name("valid"),_=t.subschema({keyword:"oneOf",schemaProp:f},m);return t.mergeEvaluated(_,ir.Name),m}function p(){var f;let m={},_=v(n),y=!0;for(let k=0;k<i.length;k++){let w=i[k];if(w?.$ref&&!(0,Nw.schemaHasRulesButRef)(w,s.self.RULES)){let Oe=w.$ref;if(w=eh.resolveRef.call(s.self,s.schemaEnv.root,s.baseId,Oe),w instanceof eh.SchemaEnv&&(w=w.schema),w===void 0)throw new Aw.default(s.opts.uriResolver,s.baseId,Oe)}let Ee=(f=w?.properties)===null||f===void 0?void 0:f[a];if(typeof Ee!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);y=y&&(_||v(w)),E(Ee,k)}if(!y)throw new Error(`discriminator: "${a}" must be required`);return m;function v({required:k}){return Array.isArray(k)&&k.includes(a)}function E(k,w){if(k.const)S(k.const,w);else if(k.enum)for(let Ee of k.enum)S(Ee,w);else throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function S(k,w){if(typeof k!="string"||k in m)throw new Error(`discriminator: "${a}" values must be unique strings`);m[k]=w}}}};Ha.default=Mw});var rh=$((UR,Dw)=>{Dw.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 Ka=$((Y,Ja)=>{"use strict";Object.defineProperty(Y,"__esModule",{value:!0});Y.MissingRefError=Y.ValidationError=Y.CodeGen=Y.Name=Y.nil=Y.stringify=Y.str=Y._=Y.KeywordCxt=Y.Ajv=void 0;var jw=Xf(),Zw=Ym(),Lw=th(),oh=rh(),qw=["/properties"],Cn="http://json-schema.org/draft-07/schema",ar=class extends jw.default{_addVocabularies(){super._addVocabularies(),Zw.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(Lw.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(oh,qw):oh;this.addMetaSchema(e,Cn,!1),this.refs["http://json-schema.org/schema"]=Cn}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Cn)?Cn:void 0)}};Y.Ajv=ar;Ja.exports=Y=ar;Ja.exports.Ajv=ar;Object.defineProperty(Y,"__esModule",{value:!0});Y.default=ar;var Uw=eo();Object.defineProperty(Y,"KeywordCxt",{enumerable:!0,get:function(){return Uw.KeywordCxt}});var cr=I();Object.defineProperty(Y,"_",{enumerable:!0,get:function(){return cr._}});Object.defineProperty(Y,"str",{enumerable:!0,get:function(){return cr.str}});Object.defineProperty(Y,"stringify",{enumerable:!0,get:function(){return cr.stringify}});Object.defineProperty(Y,"nil",{enumerable:!0,get:function(){return cr.nil}});Object.defineProperty(Y,"Name",{enumerable:!0,get:function(){return cr.Name}});Object.defineProperty(Y,"CodeGen",{enumerable:!0,get:function(){return cr.CodeGen}});var Fw=hn();Object.defineProperty(Y,"ValidationError",{enumerable:!0,get:function(){return Fw.default}});var Vw=to();Object.defineProperty(Y,"MissingRefError",{enumerable:!0,get:function(){return Vw.default}})});var dh=$(We=>{"use strict";Object.defineProperty(We,"__esModule",{value:!0});We.formatNames=We.fastFormats=We.fullFormats=void 0;function Ge(t,e){return{validate:t,compare:e}}We.fullFormats={date:Ge(ah,Ya),time:Ge(Wa(!0),Xa),"date-time":Ge(nh(!0),uh),"iso-time":Ge(Wa(),ch),"iso-date-time":Ge(nh(),lh),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:Bw,"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:oz,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:Yw,int32:{type:"number",validate:ez},int64:{type:"number",validate:tz},float:{type:"number",validate:ih},double:{type:"number",validate:ih},password:!0,binary:!0};We.fastFormats={...We.fullFormats,date:Ge(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,Ya),time:Ge(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,Xa),"date-time":Ge(/^\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,uh),"iso-time":Ge(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,ch),"iso-date-time":Ge(/^\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,lh),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};We.formatNames=Object.keys(We.fullFormats);function Hw(t){return t%4===0&&(t%100!==0||t%400===0)}var Jw=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,Kw=[0,31,28,31,30,31,30,31,31,30,31,30,31];function ah(t){let e=Jw.exec(t);if(!e)return!1;let r=+e[1],o=+e[2],n=+e[3];return o>=1&&o<=12&&n>=1&&n<=(o===2&&Hw(r)?29:Kw[o])}function Ya(t,e){if(t&&e)return t>e?1:t<e?-1:0}var Ga=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function Wa(t){return function(r){let o=Ga.exec(r);if(!o)return!1;let n=+o[1],s=+o[2],i=+o[3],a=o[4],c=o[5]==="-"?-1:1,u=+(o[6]||0),l=+(o[7]||0);if(u>23||l>59||t&&!a)return!1;if(n<=23&&s<=59&&i<60)return!0;let d=s-l*c,p=n-u*c-(d<0?1:0);return(p===23||p===-1)&&(d===59||d===-1)&&i<61}}function Xa(t,e){if(!(t&&e))return;let r=new Date("2020-01-01T"+t).valueOf(),o=new Date("2020-01-01T"+e).valueOf();if(r&&o)return r-o}function ch(t,e){if(!(t&&e))return;let r=Ga.exec(t),o=Ga.exec(e);if(r&&o)return t=r[1]+r[2]+r[3],e=o[1]+o[2]+o[3],t>e?1:t<e?-1:0}var Ba=/t|\s/i;function nh(t){let e=Wa(t);return function(o){let n=o.split(Ba);return n.length===2&&ah(n[0])&&e(n[1])}}function uh(t,e){if(!(t&&e))return;let r=new Date(t).valueOf(),o=new Date(e).valueOf();if(r&&o)return r-o}function lh(t,e){if(!(t&&e))return;let[r,o]=t.split(Ba),[n,s]=e.split(Ba),i=Ya(r,n);if(i!==void 0)return i||Xa(o,s)}var Gw=/\/|:/,Ww=/^(?:[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 Bw(t){return Gw.test(t)&&Ww.test(t)}var sh=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function Yw(t){return sh.lastIndex=0,sh.test(t)}var Xw=-(2**31),Qw=2**31-1;function ez(t){return Number.isInteger(t)&&t<=Qw&&t>=Xw}function tz(t){return Number.isInteger(t)}function ih(){return!0}var rz=/[^\\]\\Z/;function oz(t){if(rz.test(t))return!1;try{return new RegExp(t),!0}catch{return!1}}});var ph=$(ur=>{"use strict";Object.defineProperty(ur,"__esModule",{value:!0});ur.formatLimitDefinition=void 0;var nz=Ka(),Fe=I(),St=Fe.operators,Mn={formatMaximum:{okStr:"<=",ok:St.LTE,fail:St.GT},formatMinimum:{okStr:">=",ok:St.GTE,fail:St.LT},formatExclusiveMaximum:{okStr:"<",ok:St.LT,fail:St.GTE},formatExclusiveMinimum:{okStr:">",ok:St.GT,fail:St.LTE}},sz={message:({keyword:t,schemaCode:e})=>(0,Fe.str)`should be ${Mn[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,Fe._)`{comparison: ${Mn[t].okStr}, limit: ${e}}`};ur.formatLimitDefinition={keyword:Object.keys(Mn),type:"string",schemaType:"string",$data:!0,error:sz,code(t){let{gen:e,data:r,schemaCode:o,keyword:n,it:s}=t,{opts:i,self:a}=s;if(!i.validateFormats)return;let c=new nz.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}),f=e.const("fmt",(0,Fe._)`${p}[${c.schemaCode}]`);t.fail$data((0,Fe.or)((0,Fe._)`typeof ${f} != "object"`,(0,Fe._)`${f} instanceof RegExp`,(0,Fe._)`typeof ${f}.compare != "function"`,d(f)))}function l(){let p=c.schema,f=a.formats[p];if(!f||f===!0)return;if(typeof f!="object"||f instanceof RegExp||typeof f.compare!="function")throw new Error(`"${n}": format "${p}" does not define "compare" function`);let m=e.scopeValue("formats",{key:p,ref:f,code:i.code.formats?(0,Fe._)`${i.code.formats}${(0,Fe.getProperty)(p)}`:void 0});t.fail$data(d(m))}function d(p){return(0,Fe._)`${p}.compare(${r}, ${o}) ${Mn[n].fail} 0`}},dependencies:["format"]};var iz=t=>(t.addKeyword(ur.formatLimitDefinition),t);ur.default=iz});var gh=$((go,hh)=>{"use strict";Object.defineProperty(go,"__esModule",{value:!0});var lr=dh(),az=ph(),Qa=I(),fh=new Qa.Name("fullFormats"),cz=new Qa.Name("fastFormats"),ec=(t,e={keywords:!0})=>{if(Array.isArray(e))return mh(t,e,lr.fullFormats,fh),t;let[r,o]=e.mode==="fast"?[lr.fastFormats,cz]:[lr.fullFormats,fh],n=e.formats||lr.formatNames;return mh(t,n,r,o),e.keywords&&(0,az.default)(t),t};ec.get=(t,e="full")=>{let o=(e==="fast"?lr.fastFormats:lr.fullFormats)[t];if(!o)throw new Error(`Unknown format "${t}"`);return o};function mh(t,e,r,o){var n,s;(n=(s=t.opts.code).formats)!==null&&n!==void 0||(s.formats=(0,Qa._)`require("ajv-formats/dist/formats").${o}`);for(let i of e)t.addFormat(i,r[i])}hh.exports=go=ec;Object.defineProperty(go,"__esModule",{value:!0});go.default=ec});var Ye=require("fs"),fr=require("path"),lc=require("os"),Wn=(s=>(s[s.DEBUG=0]="DEBUG",s[s.INFO=1]="INFO",s[s.WARN=2]="WARN",s[s.ERROR=3]="ERROR",s[s.SILENT=4]="SILENT",s))(Wn||{}),uc=(0,fr.join)((0,lc.homedir)(),".claude-mem"),Bn=class{level=null;useColor;logFilePath=null;logFileInitialized=!1;constructor(){this.useColor=process.stdout.isTTY??!1}ensureLogFileInitialized(){if(!this.logFileInitialized){this.logFileInitialized=!0;try{let e=(0,fr.join)(uc,"logs");(0,Ye.existsSync)(e)||(0,Ye.mkdirSync)(e,{recursive:!0});let r=new Date().toISOString().split("T")[0];this.logFilePath=(0,fr.join)(e,`claude-mem-${r}.log`)}catch(e){console.error("[LOGGER] Failed to initialize log file:",e),this.logFilePath=null}}}getLevel(){if(this.level===null)try{let e=(0,fr.join)(uc,"settings.json");if((0,Ye.existsSync)(e)){let r=(0,Ye.readFileSync)(e,"utf-8"),n=(JSON.parse(r).CLAUDE_MEM_LOG_LEVEL||"INFO").toUpperCase();this.level=Wn[n]??1}else this.level=1}catch{this.level=1}return this.level}correlationId(e,r){return`obs-${e}-${r}`}sessionId(e){return`session-${e}`}formatData(e){if(e==null)return"";if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean")return e.toString();if(typeof e=="object"){if(e instanceof Error)return this.getLevel()===0?`${e.message}
10
+ ${e.stack}`:e.message;if(Array.isArray(e))return`[${e.length} items]`;let r=Object.keys(e);return r.length===0?"{}":r.length<=3?JSON.stringify(e):`{${r.length} keys: ${r.slice(0,3).join(", ")}...}`}return String(e)}formatTool(e,r){if(!r)return e;let o=r;if(typeof r=="string")try{o=JSON.parse(r)}catch{o=r}if(e==="Bash"&&o.command)return`${e}(${o.command})`;if(o.file_path)return`${e}(${o.file_path})`;if(o.notebook_path)return`${e}(${o.notebook_path})`;if(e==="Glob"&&o.pattern)return`${e}(${o.pattern})`;if(e==="Grep"&&o.pattern)return`${e}(${o.pattern})`;if(o.url)return`${e}(${o.url})`;if(o.query)return`${e}(${o.query})`;if(e==="Task"){if(o.subagent_type)return`${e}(${o.subagent_type})`;if(o.description)return`${e}(${o.description})`}return e==="Skill"&&o.skill?`${e}(${o.skill})`:e==="LSP"&&o.operation?`${e}(${o.operation})`:e}formatTimestamp(e){let r=e.getFullYear(),o=String(e.getMonth()+1).padStart(2,"0"),n=String(e.getDate()).padStart(2,"0"),s=String(e.getHours()).padStart(2,"0"),i=String(e.getMinutes()).padStart(2,"0"),a=String(e.getSeconds()).padStart(2,"0"),c=String(e.getMilliseconds()).padStart(3,"0");return`${r}-${o}-${n} ${s}:${i}:${a}.${c}`}log(e,r,o,n,s){if(e<this.getLevel())return;this.ensureLogFileInitialized();let i=this.formatTimestamp(new Date),a=Wn[e].padEnd(5),c=r.padEnd(6),u="";n?.correlationId?u=`[${n.correlationId}] `:n?.sessionId&&(u=`[session-${n.sessionId}] `);let l="";s!=null&&(s instanceof Error?l=this.getLevel()===0?`
11
+ ${s.message}
12
+ ${s.stack}`:` ${s.message}`:this.getLevel()===0&&typeof s=="object"?l=`
13
+ `+JSON.stringify(s,null,2):l=" "+this.formatData(s));let d="";if(n){let{sessionId:f,memorySessionId:m,correlationId:_,...y}=n;Object.keys(y).length>0&&(d=` {${Object.entries(y).map(([E,S])=>`${E}=${S}`).join(", ")}}`)}let p=`[${i}] [${a}] [${c}] ${u}${o}${d}${l}`;if(this.logFilePath)try{(0,Ye.appendFileSync)(this.logFilePath,p+`
14
14
  `,"utf8")}catch(f){process.stderr.write(`[LOGGER] Failed to write to log file: ${f}
15
- `)}else process.stderr.write(m+`
16
- `)}debug(e,r,n,o){this.log(0,e,r,n,o)}info(e,r,n,o){this.log(1,e,r,n,o)}warn(e,r,n,o){this.log(2,e,r,n,o)}error(e,r,n,o){this.log(3,e,r,n,o)}dataIn(e,r,n,o){this.info(e,`\u2192 ${r}`,n,o)}dataOut(e,r,n,o){this.info(e,`\u2190 ${r}`,n,o)}success(e,r,n,o){this.info(e,`\u2713 ${r}`,n,o)}failure(e,r,n,o){this.error(e,`\u2717 ${r}`,n,o)}timing(e,r,n,o){this.info(e,`\u23F1 ${r}`,o,{duration:`${n}ms`})}happyPathError(e,r,n,o,i=""){let u=((new Error().stack||"").split(`
17
- `)[2]||"").match(/at\s+(?:.*\s+)?\(?([^:]+):(\d+):(\d+)\)?/),l=u?`${u[1].split("/").pop()}:${u[2]}`:"unknown",d={...n,location:l};return this.warn(e,`[HAPPY-PATH] ${r}`,d,o),i}},ve=new zs;var X;(function(t){t.assertEqual=o=>{};function e(o){}t.assertIs=e;function r(o){throw new Error}t.assertNever=r,t.arrayToEnum=o=>{let i={};for(let a of o)i[a]=a;return i},t.getValidEnumValues=o=>{let i=t.objectKeys(o).filter(s=>typeof o[o[s]]!="number"),a={};for(let s of i)a[s]=o[s];return t.objectValues(a)},t.objectValues=o=>t.objectKeys(o).map(function(i){return o[i]}),t.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{let i=[];for(let a in o)Object.prototype.hasOwnProperty.call(o,a)&&i.push(a);return i},t.find=(o,i)=>{for(let a of o)if(i(a))return a},t.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function n(o,i=" | "){return o.map(a=>typeof a=="string"?`'${a}'`:a).join(i)}t.joinValues=n,t.jsonStringifyReplacer=(o,i)=>typeof i=="bigint"?i.toString():i})(X||(X={}));var bf;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(bf||(bf={}));var w=X.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),It=t=>{switch(typeof t){case"undefined":return w.undefined;case"string":return w.string;case"number":return Number.isNaN(t)?w.nan:w.number;case"boolean":return w.boolean;case"function":return w.function;case"bigint":return w.bigint;case"symbol":return w.symbol;case"object":return Array.isArray(t)?w.array:t===null?w.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?w.promise:typeof Map<"u"&&t instanceof Map?w.map:typeof Set<"u"&&t instanceof Set?w.set:typeof Date<"u"&&t instanceof Date?w.date:w.object;default:return w.unknown}};var _=X.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"]);var Je=class t extends Error{get errors(){return this.issues}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}format(e){let r=e||function(i){return i.message},n={_errors:[]},o=i=>{for(let a of i.issues)if(a.code==="invalid_union")a.unionErrors.map(o);else if(a.code==="invalid_return_type")o(a.returnTypeError);else if(a.code==="invalid_arguments")o(a.argumentsError);else if(a.path.length===0)n._errors.push(r(a));else{let s=n,c=0;for(;c<a.path.length;){let u=a.path[c];c===a.path.length-1?(s[u]=s[u]||{_errors:[]},s[u]._errors.push(r(a))):s[u]=s[u]||{_errors:[]},s=s[u],c++}}};return o(this),n}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,X.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r=Object.create(null),n=[];for(let o of this.issues)if(o.path.length>0){let i=o.path[0];r[i]=r[i]||[],r[i].push(e(o))}else n.push(e(o));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};Je.create=t=>new Je(t);var By=(t,e)=>{let r;switch(t.code){case _.invalid_type:t.received===w.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case _.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,X.jsonStringifyReplacer)}`;break;case _.unrecognized_keys:r=`Unrecognized key(s) in object: ${X.joinValues(t.keys,", ")}`;break;case _.invalid_union:r="Invalid input";break;case _.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${X.joinValues(t.options)}`;break;case _.invalid_enum_value:r=`Invalid enum value. Expected ${X.joinValues(t.options)}, received '${t.received}'`;break;case _.invalid_arguments:r="Invalid function arguments";break;case _.invalid_return_type:r="Invalid function return type";break;case _.invalid_date:r="Invalid date";break;case _.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}"`:X.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case _.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==="bigint"?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 _.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 _.custom:r="Invalid input";break;case _.invalid_intersection_types:r="Intersection results could not be merged";break;case _.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case _.not_finite:r="Number must be finite";break;default:r=e.defaultError,X.assertNever(t)}return{message:r}},Vt=By;var Xy=Vt;function xn(){return Xy}var ci=t=>{let{data:e,path:r,errorMaps:n,issueData:o}=t,i=[...r,...o.path||[]],a={...o,path:i};if(o.message!==void 0)return{...o,path:i,message:o.message};let s="",c=n.filter(u=>!!u).slice().reverse();for(let u of c)s=u(a,{data:e,defaultError:s}).message;return{...o,path:i,message:s}};function b(t,e){let r=xn(),n=ci({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===Vt?void 0:Vt].filter(o=>!!o)});t.common.issues.push(n)}var Ie=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 A;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){let i=await o.key,a=await o.value;n.push({key:i,value:a})}return t.mergeObjectSync(e,n)}static mergeObjectSync(e,r){let n={};for(let o of r){let{key:i,value:a}=o;if(i.status==="aborted"||a.status==="aborted")return A;i.status==="dirty"&&e.dirty(),a.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof a.value<"u"||o.alwaysSet)&&(n[i.value]=a.value)}return{status:e.value,value:n}}},A=Object.freeze({status:"aborted"}),Er=t=>({status:"dirty",value:t}),De=t=>({status:"valid",value:t}),Is=t=>t.status==="aborted",Es=t=>t.status==="dirty",ur=t=>t.status==="valid",kn=t=>typeof Promise<"u"&&t instanceof Promise;var E;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(E||(E={}));var Xe=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||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},xf=(t,e)=>{if(ur(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 Je(t.common.issues);return this._error=r,this._error}}};function L(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:(a,s)=>{let{message:c}=t;return a.code==="invalid_enum_value"?{message:c??s.defaultError}:typeof s.data>"u"?{message:c??n??s.defaultError}:a.code!=="invalid_type"?{message:s.defaultError}:{message:c??r??s.defaultError}},description:o}}var H=class{get description(){return this._def.description}_getType(e){return It(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:It(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Ie,ctx:{common:e.parent.common,data:e.data,parsedType:It(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(kn(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){let n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:It(e)},o=this._parseSync({data:e,path:n.path,parent:n});return xf(n,o)}"~validate"(e){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:It(e)};if(!this["~standard"].async)try{let n=this._parseSync({data:e,path:[],parent:r});return ur(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(n=>ur(n)?{value:n.value}:{issues:r.common.issues})}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:It(e)},o=this._parse({data:e,path:n.path,parent:n}),i=await(kn(o)?o:Promise.resolve(o));return xf(n,i)}refine(e,r){let n=o=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(o):r;return this._refinement((o,i)=>{let a=e(o),s=()=>i.addIssue({code:_.custom,...n(o)});return typeof Promise<"u"&&a instanceof Promise?a.then(c=>c?!0:(s(),!1)):a?!0:(s(),!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 ut({schema:this,typeName:D.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}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),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return ct.create(this,this._def)}nullable(){return Pt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Kt.create(this)}promise(){return lr.create(this,this._def)}or(e){return Dr.create([this,e],this._def)}and(e){return Nr.create(this,e,this._def)}transform(e){return new ut({...L(this._def),schema:this,typeName:D.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new Cr({...L(this._def),innerType:this,defaultValue:r,typeName:D.ZodDefault})}brand(){return new ui({typeName:D.ZodBranded,type:this,...L(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new Mr({...L(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 li.create(this,e)}readonly(){return Lr.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Yy=/^c[^\s-]{8,}$/i,Qy=/^[0-9a-z]+$/,e$=/^[0-9A-HJKMNP-TV-Z]{26}$/i,t$=/^[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,r$=/^[a-z0-9_-]{21}$/i,n$=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,o$=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,i$=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,a$="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Ts,s$=/^(?:(?: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])$/,c$=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,u$=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,l$=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,d$=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,p$=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,kf="((\\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])))",f$=new RegExp(`^${kf}$`);function Sf(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function m$(t){return new RegExp(`^${Sf(t)}$`)}function h$(t){let e=`${kf}T${Sf(t)}`,r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function g$(t,e){return!!((e==="v4"||!e)&&s$.test(t)||(e==="v6"||!e)&&u$.test(t))}function v$(t,e){if(!n$.test(t))return!1;try{let[r]=t.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),o=JSON.parse(atob(n));return!(typeof o!="object"||o===null||"typ"in o&&o?.typ!=="JWT"||!o.alg||e&&o.alg!==e)}catch{return!1}}function _$(t,e){return!!((e==="v4"||!e)&&c$.test(t)||(e==="v6"||!e)&&l$.test(t))}var Pr=class t extends H{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==w.string){let i=this._getOrReturnCtx(e);return b(i,{code:_.invalid_type,expected:w.string,received:i.parsedType}),A}let n=new Ie,o;for(let i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(o=this._getOrReturnCtx(e,o),b(o,{code:_.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="max")e.data.length>i.value&&(o=this._getOrReturnCtx(e,o),b(o,{code:_.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){let a=e.data.length>i.value,s=e.data.length<i.value;(a||s)&&(o=this._getOrReturnCtx(e,o),a?b(o,{code:_.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):s&&b(o,{code:_.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")i$.test(e.data)||(o=this._getOrReturnCtx(e,o),b(o,{validation:"email",code:_.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")Ts||(Ts=new RegExp(a$,"u")),Ts.test(e.data)||(o=this._getOrReturnCtx(e,o),b(o,{validation:"emoji",code:_.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")t$.test(e.data)||(o=this._getOrReturnCtx(e,o),b(o,{validation:"uuid",code:_.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")r$.test(e.data)||(o=this._getOrReturnCtx(e,o),b(o,{validation:"nanoid",code:_.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")Yy.test(e.data)||(o=this._getOrReturnCtx(e,o),b(o,{validation:"cuid",code:_.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")Qy.test(e.data)||(o=this._getOrReturnCtx(e,o),b(o,{validation:"cuid2",code:_.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")e$.test(e.data)||(o=this._getOrReturnCtx(e,o),b(o,{validation:"ulid",code:_.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{o=this._getOrReturnCtx(e,o),b(o,{validation:"url",code:_.invalid_string,message:i.message}),n.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(o=this._getOrReturnCtx(e,o),b(o,{validation:"regex",code:_.invalid_string,message:i.message}),n.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(o=this._getOrReturnCtx(e,o),b(o,{code:_.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),n.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(o=this._getOrReturnCtx(e,o),b(o,{code:_.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(o=this._getOrReturnCtx(e,o),b(o,{code:_.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?h$(i).test(e.data)||(o=this._getOrReturnCtx(e,o),b(o,{code:_.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?f$.test(e.data)||(o=this._getOrReturnCtx(e,o),b(o,{code:_.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?m$(i).test(e.data)||(o=this._getOrReturnCtx(e,o),b(o,{code:_.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?o$.test(e.data)||(o=this._getOrReturnCtx(e,o),b(o,{validation:"duration",code:_.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?g$(e.data,i.version)||(o=this._getOrReturnCtx(e,o),b(o,{validation:"ip",code:_.invalid_string,message:i.message}),n.dirty()):i.kind==="jwt"?v$(e.data,i.alg)||(o=this._getOrReturnCtx(e,o),b(o,{validation:"jwt",code:_.invalid_string,message:i.message}),n.dirty()):i.kind==="cidr"?_$(e.data,i.version)||(o=this._getOrReturnCtx(e,o),b(o,{validation:"cidr",code:_.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?d$.test(e.data)||(o=this._getOrReturnCtx(e,o),b(o,{validation:"base64",code:_.invalid_string,message:i.message}),n.dirty()):i.kind==="base64url"?p$.test(e.data)||(o=this._getOrReturnCtx(e,o),b(o,{validation:"base64url",code:_.invalid_string,message:i.message}),n.dirty()):X.assertNever(i);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(o=>e.test(o),{validation:r,code:_.invalid_string,...E.errToObj(n)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...E.errToObj(e)})}url(e){return this._addCheck({kind:"url",...E.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...E.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...E.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...E.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...E.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...E.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...E.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...E.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...E.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...E.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...E.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...E.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...E.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...E.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...E.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...E.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...E.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...E.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...E.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...E.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...E.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...E.errToObj(r)})}nonempty(e){return this.min(1,E.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 isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}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 isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}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 isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}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}};Pr.create=t=>new Pr({checks:[],typeName:D.ZodString,coerce:t?.coerce??!1,...L(t)});function y$(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,o=r>n?r:n,i=Number.parseInt(t.toFixed(o).replace(".","")),a=Number.parseInt(e.toFixed(o).replace(".",""));return i%a/10**o}var Sn=class t extends H{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)!==w.number){let i=this._getOrReturnCtx(e);return b(i,{code:_.invalid_type,expected:w.number,received:i.parsedType}),A}let n,o=new Ie;for(let i of this._def.checks)i.kind==="int"?X.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),b(n,{code:_.invalid_type,expected:"integer",received:"float",message:i.message}),o.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),b(n,{code:_.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),b(n,{code:_.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="multipleOf"?y$(e.data,i.value)!==0&&(n=this._getOrReturnCtx(e,n),b(n,{code:_.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),b(n,{code:_.not_finite,message:i.message}),o.dirty()):X.assertNever(i);return{status:o.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,E.toString(r))}gt(e,r){return this.setLimit("min",e,!1,E.toString(r))}lte(e,r){return this.setLimit("max",e,!0,E.toString(r))}lt(e,r){return this.setLimit("max",e,!1,E.toString(r))}setLimit(e,r,n,o){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:E.toString(o)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:E.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:E.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:E.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:E.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:E.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:E.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:E.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:E.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:E.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"&&X.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)}};Sn.create=t=>new Sn({checks:[],typeName:D.ZodNumber,coerce:t?.coerce||!1,...L(t)});var wn=class t extends H{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==w.bigint)return this._getInvalidInput(e);let n,o=new Ie;for(let i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),b(n,{code:_.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),b(n,{code:_.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),b(n,{code:_.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):X.assertNever(i);return{status:o.value,value:e.data}}_getInvalidInput(e){let r=this._getOrReturnCtx(e);return b(r,{code:_.invalid_type,expected:w.bigint,received:r.parsedType}),A}gte(e,r){return this.setLimit("min",e,!0,E.toString(r))}gt(e,r){return this.setLimit("min",e,!1,E.toString(r))}lte(e,r){return this.setLimit("max",e,!0,E.toString(r))}lt(e,r){return this.setLimit("max",e,!1,E.toString(r))}setLimit(e,r,n,o){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:E.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:E.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:E.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:E.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:E.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:E.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}};wn.create=t=>new wn({checks:[],typeName:D.ZodBigInt,coerce:t?.coerce??!1,...L(t)});var zn=class extends H{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==w.boolean){let n=this._getOrReturnCtx(e);return b(n,{code:_.invalid_type,expected:w.boolean,received:n.parsedType}),A}return De(e.data)}};zn.create=t=>new zn({typeName:D.ZodBoolean,coerce:t?.coerce||!1,...L(t)});var In=class t extends H{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==w.date){let i=this._getOrReturnCtx(e);return b(i,{code:_.invalid_type,expected:w.date,received:i.parsedType}),A}if(Number.isNaN(e.data.getTime())){let i=this._getOrReturnCtx(e);return b(i,{code:_.invalid_date}),A}let n=new Ie,o;for(let i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(o=this._getOrReturnCtx(e,o),b(o,{code:_.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),n.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(o=this._getOrReturnCtx(e,o),b(o,{code:_.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):X.assertNever(i);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:E.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:E.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}};In.create=t=>new In({checks:[],coerce:t?.coerce||!1,typeName:D.ZodDate,...L(t)});var En=class extends H{_parse(e){if(this._getType(e)!==w.symbol){let n=this._getOrReturnCtx(e);return b(n,{code:_.invalid_type,expected:w.symbol,received:n.parsedType}),A}return De(e.data)}};En.create=t=>new En({typeName:D.ZodSymbol,...L(t)});var Or=class extends H{_parse(e){if(this._getType(e)!==w.undefined){let n=this._getOrReturnCtx(e);return b(n,{code:_.invalid_type,expected:w.undefined,received:n.parsedType}),A}return De(e.data)}};Or.create=t=>new Or({typeName:D.ZodUndefined,...L(t)});var jr=class extends H{_parse(e){if(this._getType(e)!==w.null){let n=this._getOrReturnCtx(e);return b(n,{code:_.invalid_type,expected:w.null,received:n.parsedType}),A}return De(e.data)}};jr.create=t=>new jr({typeName:D.ZodNull,...L(t)});var Tn=class extends H{constructor(){super(...arguments),this._any=!0}_parse(e){return De(e.data)}};Tn.create=t=>new Tn({typeName:D.ZodAny,...L(t)});var Jt=class extends H{constructor(){super(...arguments),this._unknown=!0}_parse(e){return De(e.data)}};Jt.create=t=>new Jt({typeName:D.ZodUnknown,...L(t)});var gt=class extends H{_parse(e){let r=this._getOrReturnCtx(e);return b(r,{code:_.invalid_type,expected:w.never,received:r.parsedType}),A}};gt.create=t=>new gt({typeName:D.ZodNever,...L(t)});var Pn=class extends H{_parse(e){if(this._getType(e)!==w.undefined){let n=this._getOrReturnCtx(e);return b(n,{code:_.invalid_type,expected:w.void,received:n.parsedType}),A}return De(e.data)}};Pn.create=t=>new Pn({typeName:D.ZodVoid,...L(t)});var Kt=class t extends H{_parse(e){let{ctx:r,status:n}=this._processInputParams(e),o=this._def;if(r.parsedType!==w.array)return b(r,{code:_.invalid_type,expected:w.array,received:r.parsedType}),A;if(o.exactLength!==null){let a=r.data.length>o.exactLength.value,s=r.data.length<o.exactLength.value;(a||s)&&(b(r,{code:a?_.too_big:_.too_small,minimum:s?o.exactLength.value:void 0,maximum:a?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&&(b(r,{code:_.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&&(b(r,{code:_.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((a,s)=>o.type._parseAsync(new Xe(r,a,r.path,s)))).then(a=>Ie.mergeArray(n,a));let i=[...r.data].map((a,s)=>o.type._parseSync(new Xe(r,a,r.path,s)));return Ie.mergeArray(n,i)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:E.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:E.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:E.toString(r)}})}nonempty(e){return this.min(1,e)}};Kt.create=(t,e)=>new Kt({type:t,minLength:null,maxLength:null,exactLength:null,typeName:D.ZodArray,...L(e)});function Tr(t){if(t instanceof Ke){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=ct.create(Tr(n))}return new Ke({...t._def,shape:()=>e})}else return t instanceof Kt?new Kt({...t._def,type:Tr(t.element)}):t instanceof ct?ct.create(Tr(t.unwrap())):t instanceof Pt?Pt.create(Tr(t.unwrap())):t instanceof Tt?Tt.create(t.items.map(e=>Tr(e))):t}var Ke=class t extends H{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=X.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==w.object){let u=this._getOrReturnCtx(e);return b(u,{code:_.invalid_type,expected:w.object,received:u.parsedType}),A}let{status:n,ctx:o}=this._processInputParams(e),{shape:i,keys:a}=this._getCached(),s=[];if(!(this._def.catchall instanceof gt&&this._def.unknownKeys==="strip"))for(let u in o.data)a.includes(u)||s.push(u);let c=[];for(let u of a){let l=i[u],d=o.data[u];c.push({key:{status:"valid",value:u},value:l._parse(new Xe(o,d,o.path,u)),alwaysSet:u in o.data})}if(this._def.catchall instanceof gt){let u=this._def.unknownKeys;if(u==="passthrough")for(let l of s)c.push({key:{status:"valid",value:l},value:{status:"valid",value:o.data[l]}});else if(u==="strict")s.length>0&&(b(o,{code:_.unrecognized_keys,keys:s}),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 s){let d=o.data[l];c.push({key:{status:"valid",value:l},value:u._parse(new Xe(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,m=await l.value;u.push({key:d,value:m,alwaysSet:l.alwaysSet})}return u}).then(u=>Ie.mergeObjectSync(n,u)):Ie.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(e){return E.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{let o=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:E.errToObj(e).message??o}:{message:o}}}:{}})}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={};for(let n of X.objectKeys(e))e[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new t({...this._def,shape:()=>r})}omit(e){let r={};for(let n of X.objectKeys(this.shape))e[n]||(r[n]=this.shape[n]);return new t({...this._def,shape:()=>r})}deepPartial(){return Tr(this)}partial(e){let r={};for(let n of X.objectKeys(this.shape)){let o=this.shape[n];e&&!e[n]?r[n]=o:r[n]=o.optional()}return new t({...this._def,shape:()=>r})}required(e){let r={};for(let n of X.objectKeys(this.shape))if(e&&!e[n])r[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof ct;)i=i._def.innerType;r[n]=i}return new t({...this._def,shape:()=>r})}keyof(){return wf(X.objectKeys(this.shape))}};Ke.create=(t,e)=>new Ke({shape:()=>t,unknownKeys:"strip",catchall:gt.create(),typeName:D.ZodObject,...L(e)});Ke.strictCreate=(t,e)=>new Ke({shape:()=>t,unknownKeys:"strict",catchall:gt.create(),typeName:D.ZodObject,...L(e)});Ke.lazycreate=(t,e)=>new Ke({shape:t,unknownKeys:"strip",catchall:gt.create(),typeName:D.ZodObject,...L(e)});var Dr=class extends H{_parse(e){let{ctx:r}=this._processInputParams(e),n=this._def.options;function o(i){for(let s of i)if(s.result.status==="valid")return s.result;for(let s of i)if(s.result.status==="dirty")return r.common.issues.push(...s.ctx.common.issues),s.result;let a=i.map(s=>new Je(s.ctx.common.issues));return b(r,{code:_.invalid_union,unionErrors:a}),A}if(r.common.async)return Promise.all(n.map(async i=>{let a={...r,common:{...r.common,issues:[]},parent:null};return{result:await i._parseAsync({data:r.data,path:r.path,parent:a}),ctx:a}})).then(o);{let i,a=[];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"&&!i&&(i={result:l,ctx:u}),u.common.issues.length&&a.push(u.common.issues)}if(i)return r.common.issues.push(...i.ctx.common.issues),i.result;let s=a.map(c=>new Je(c));return b(r,{code:_.invalid_union,unionErrors:s}),A}}get options(){return this._def.options}};Dr.create=(t,e)=>new Dr({options:t,typeName:D.ZodUnion,...L(e)});var Et=t=>t instanceof Rr?Et(t.schema):t instanceof ut?Et(t.innerType()):t instanceof Ar?[t.value]:t instanceof Ur?t.options:t instanceof Zr?X.objectValues(t.enum):t instanceof Cr?Et(t._def.innerType):t instanceof Or?[void 0]:t instanceof jr?[null]:t instanceof ct?[void 0,...Et(t.unwrap())]:t instanceof Pt?[null,...Et(t.unwrap())]:t instanceof ui||t instanceof Lr?Et(t.unwrap()):t instanceof Mr?Et(t._def.innerType):[],Ps=class t extends H{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==w.object)return b(r,{code:_.invalid_type,expected:w.object,received:r.parsedType}),A;let n=this.discriminator,o=r.data[n],i=this.optionsMap.get(o);return i?r.common.async?i._parseAsync({data:r.data,path:r.path,parent:r}):i._parseSync({data:r.data,path:r.path,parent:r}):(b(r,{code:_.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),A)}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 i of r){let a=Et(i.shape[e]);if(!a.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let s of a){if(o.has(s))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(s)}`);o.set(s,i)}}return new t({typeName:D.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:o,...L(n)})}};function Os(t,e){let r=It(t),n=It(e);if(t===e)return{valid:!0,data:t};if(r===w.object&&n===w.object){let o=X.objectKeys(e),i=X.objectKeys(t).filter(s=>o.indexOf(s)!==-1),a={...t,...e};for(let s of i){let c=Os(t[s],e[s]);if(!c.valid)return{valid:!1};a[s]=c.data}return{valid:!0,data:a}}else if(r===w.array&&n===w.array){if(t.length!==e.length)return{valid:!1};let o=[];for(let i=0;i<t.length;i++){let a=t[i],s=e[i],c=Os(a,s);if(!c.valid)return{valid:!1};o.push(c.data)}return{valid:!0,data:o}}else return r===w.date&&n===w.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var Nr=class extends H{_parse(e){let{status:r,ctx:n}=this._processInputParams(e),o=(i,a)=>{if(Is(i)||Is(a))return A;let s=Os(i.value,a.value);return s.valid?((Es(i)||Es(a))&&r.dirty(),{status:r.value,value:s.data}):(b(n,{code:_.invalid_intersection_types}),A)};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(([i,a])=>o(i,a)):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}))}};Nr.create=(t,e,r)=>new Nr({left:t,right:e,typeName:D.ZodIntersection,...L(r)});var Tt=class t extends H{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==w.array)return b(n,{code:_.invalid_type,expected:w.array,received:n.parsedType}),A;if(n.data.length<this._def.items.length)return b(n,{code:_.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),A;!this._def.rest&&n.data.length>this._def.items.length&&(b(n,{code:_.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let i=[...n.data].map((a,s)=>{let c=this._def.items[s]||this._def.rest;return c?c._parse(new Xe(n,a,n.path,s)):null}).filter(a=>!!a);return n.common.async?Promise.all(i).then(a=>Ie.mergeArray(r,a)):Ie.mergeArray(r,i)}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,...L(e)})};var js=class t extends H{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!==w.object)return b(n,{code:_.invalid_type,expected:w.object,received:n.parsedType}),A;let o=[],i=this._def.keyType,a=this._def.valueType;for(let s in n.data)o.push({key:i._parse(new Xe(n,s,n.path,s)),value:a._parse(new Xe(n,n.data[s],n.path,s)),alwaysSet:s in n.data});return n.common.async?Ie.mergeObjectAsync(r,o):Ie.mergeObjectSync(r,o)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof H?new t({keyType:e,valueType:r,typeName:D.ZodRecord,...L(n)}):new t({keyType:Pr.create(),valueType:e,typeName:D.ZodRecord,...L(r)})}},On=class extends H{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!==w.map)return b(n,{code:_.invalid_type,expected:w.map,received:n.parsedType}),A;let o=this._def.keyType,i=this._def.valueType,a=[...n.data.entries()].map(([s,c],u)=>({key:o._parse(new Xe(n,s,n.path,[u,"key"])),value:i._parse(new Xe(n,c,n.path,[u,"value"]))}));if(n.common.async){let s=new Map;return Promise.resolve().then(async()=>{for(let c of a){let u=await c.key,l=await c.value;if(u.status==="aborted"||l.status==="aborted")return A;(u.status==="dirty"||l.status==="dirty")&&r.dirty(),s.set(u.value,l.value)}return{status:r.value,value:s}})}else{let s=new Map;for(let c of a){let u=c.key,l=c.value;if(u.status==="aborted"||l.status==="aborted")return A;(u.status==="dirty"||l.status==="dirty")&&r.dirty(),s.set(u.value,l.value)}return{status:r.value,value:s}}}};On.create=(t,e,r)=>new On({valueType:e,keyType:t,typeName:D.ZodMap,...L(r)});var jn=class t extends H{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==w.set)return b(n,{code:_.invalid_type,expected:w.set,received:n.parsedType}),A;let o=this._def;o.minSize!==null&&n.data.size<o.minSize.value&&(b(n,{code:_.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&&(b(n,{code:_.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),r.dirty());let i=this._def.valueType;function a(c){let u=new Set;for(let l of c){if(l.status==="aborted")return A;l.status==="dirty"&&r.dirty(),u.add(l.value)}return{status:r.value,value:u}}let s=[...n.data.values()].map((c,u)=>i._parse(new Xe(n,c,n.path,u)));return n.common.async?Promise.all(s).then(c=>a(c)):a(s)}min(e,r){return new t({...this._def,minSize:{value:e,message:E.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:E.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};jn.create=(t,e)=>new jn({valueType:t,minSize:null,maxSize:null,typeName:D.ZodSet,...L(e)});var Ds=class t extends H{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==w.function)return b(r,{code:_.invalid_type,expected:w.function,received:r.parsedType}),A;function n(s,c){return ci({data:s,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,xn(),Vt].filter(u=>!!u),issueData:{code:_.invalid_arguments,argumentsError:c}})}function o(s,c){return ci({data:s,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,xn(),Vt].filter(u=>!!u),issueData:{code:_.invalid_return_type,returnTypeError:c}})}let i={errorMap:r.common.contextualErrorMap},a=r.data;if(this._def.returns instanceof lr){let s=this;return De(async function(...c){let u=new Je([]),l=await s._def.args.parseAsync(c,i).catch(f=>{throw u.addIssue(n(c,f)),u}),d=await Reflect.apply(a,this,l);return await s._def.returns._def.type.parseAsync(d,i).catch(f=>{throw u.addIssue(o(d,f)),u})})}else{let s=this;return De(function(...c){let u=s._def.args.safeParse(c,i);if(!u.success)throw new Je([n(c,u.error)]);let l=Reflect.apply(a,this,u.data),d=s._def.returns.safeParse(l,i);if(!d.success)throw new Je([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,...L(n)})}},Rr=class extends H{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})}};Rr.create=(t,e)=>new Rr({getter:t,typeName:D.ZodLazy,...L(e)});var Ar=class extends H{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return b(r,{received:r.data,code:_.invalid_literal,expected:this._def.value}),A}return{status:"valid",value:e.data}}get value(){return this._def.value}};Ar.create=(t,e)=>new Ar({value:t,typeName:D.ZodLiteral,...L(e)});function wf(t,e){return new Ur({values:t,typeName:D.ZodEnum,...L(e)})}var Ur=class t extends H{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return b(r,{expected:X.joinValues(n),received:r.parsedType,code:_.invalid_type}),A}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let r=this._getOrReturnCtx(e),n=this._def.values;return b(r,{received:r.data,code:_.invalid_enum_value,options:n}),A}return De(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,r=this._def){return t.create(e,{...this._def,...r})}exclude(e,r=this._def){return t.create(this.options.filter(n=>!e.includes(n)),{...this._def,...r})}};Ur.create=wf;var Zr=class extends H{_parse(e){let r=X.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==w.string&&n.parsedType!==w.number){let o=X.objectValues(r);return b(n,{expected:X.joinValues(o),received:n.parsedType,code:_.invalid_type}),A}if(this._cache||(this._cache=new Set(X.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let o=X.objectValues(r);return b(n,{received:n.data,code:_.invalid_enum_value,options:o}),A}return De(e.data)}get enum(){return this._def.values}};Zr.create=(t,e)=>new Zr({values:t,typeName:D.ZodNativeEnum,...L(e)});var lr=class extends H{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==w.promise&&r.common.async===!1)return b(r,{code:_.invalid_type,expected:w.promise,received:r.parsedType}),A;let n=r.parsedType===w.promise?r.data:Promise.resolve(r.data);return De(n.then(o=>this._def.type.parseAsync(o,{path:r.path,errorMap:r.common.contextualErrorMap})))}};lr.create=(t,e)=>new lr({type:t,typeName:D.ZodPromise,...L(e)});var ut=class extends H{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,i={addIssue:a=>{b(n,a),a.fatal?r.abort():r.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),o.type==="preprocess"){let a=o.transform(n.data,i);if(n.common.async)return Promise.resolve(a).then(async s=>{if(r.value==="aborted")return A;let c=await this._def.schema._parseAsync({data:s,path:n.path,parent:n});return c.status==="aborted"?A:c.status==="dirty"?Er(c.value):r.value==="dirty"?Er(c.value):c});{if(r.value==="aborted")return A;let s=this._def.schema._parseSync({data:a,path:n.path,parent:n});return s.status==="aborted"?A:s.status==="dirty"?Er(s.value):r.value==="dirty"?Er(s.value):s}}if(o.type==="refinement"){let a=s=>{let c=o.refinement(s,i);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 s};if(n.common.async===!1){let s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?A:(s.status==="dirty"&&r.dirty(),a(s.value),{status:r.value,value:s.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>s.status==="aborted"?A:(s.status==="dirty"&&r.dirty(),a(s.value).then(()=>({status:r.value,value:s.value}))))}if(o.type==="transform")if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!ur(a))return A;let s=o.transform(a.value,i);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:s}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>ur(a)?Promise.resolve(o.transform(a.value,i)).then(s=>({status:r.value,value:s})):A);X.assertNever(o)}};ut.create=(t,e,r)=>new ut({schema:t,typeName:D.ZodEffects,effect:e,...L(r)});ut.createWithPreprocess=(t,e,r)=>new ut({schema:e,effect:{type:"preprocess",transform:t},typeName:D.ZodEffects,...L(r)});var ct=class extends H{_parse(e){return this._getType(e)===w.undefined?De(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};ct.create=(t,e)=>new ct({innerType:t,typeName:D.ZodOptional,...L(e)});var Pt=class extends H{_parse(e){return this._getType(e)===w.null?De(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Pt.create=(t,e)=>new Pt({innerType:t,typeName:D.ZodNullable,...L(e)});var Cr=class extends H{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===w.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Cr.create=(t,e)=>new Cr({innerType:t,typeName:D.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...L(e)});var Mr=class extends H{_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 kn(o)?o.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Je(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Je(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Mr.create=(t,e)=>new Mr({innerType:t,typeName:D.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...L(e)});var Dn=class extends H{_parse(e){if(this._getType(e)!==w.nan){let n=this._getOrReturnCtx(e);return b(n,{code:_.invalid_type,expected:w.nan,received:n.parsedType}),A}return{status:"valid",value:e.data}}};Dn.create=t=>new Dn({typeName:D.ZodNaN,...L(t)});var ui=class extends H{_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}},li=class t extends H{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let i=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?A:i.status==="dirty"?(r.dirty(),Er(i.value)):this._def.out._parseAsync({data:i.value,path:n.path,parent:n})})();{let o=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?A: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})}},Lr=class extends H{_parse(e){let r=this._def.innerType._parse(e),n=o=>(ur(o)&&(o.value=Object.freeze(o.value)),o);return kn(r)?r.then(o=>n(o)):n(r)}unwrap(){return this._def.innerType}};Lr.create=(t,e)=>new Lr({innerType:t,typeName:D.ZodReadonly,...L(e)});var tP={object:Ke.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 rP=Pr.create,nP=Sn.create,oP=Dn.create,iP=wn.create,aP=zn.create,sP=In.create,cP=En.create,uP=Or.create,lP=jr.create,dP=Tn.create,pP=Jt.create,fP=gt.create,mP=Pn.create,hP=Kt.create,$$=Ke.create,gP=Ke.strictCreate,vP=Dr.create,_P=Ps.create,yP=Nr.create,$P=Tt.create,bP=js.create,xP=On.create,kP=jn.create,SP=Ds.create,wP=Rr.create,zP=Ar.create,IP=Ur.create,EP=Zr.create,TP=lr.create,PP=ut.create,OP=ct.create,jP=Pt.create,DP=ut.createWithPreprocess,NP=li.create;var zf=Object.freeze({status:"aborted"});function p(t,e,r){function n(s,c){if(s._zod||Object.defineProperty(s,"_zod",{value:{def:c,constr:a,traits:new Set},enumerable:!1}),s._zod.traits.has(t))return;s._zod.traits.add(t),e(s,c);let u=a.prototype,l=Object.keys(u);for(let d=0;d<l.length;d++){let m=l[d];m in s||(s[m]=u[m].bind(s))}}let o=r?.Parent??Object;class i extends o{}Object.defineProperty(i,"name",{value:t});function a(s){var c;let u=r?.Parent?new i:this;n(u,s),(c=u._zod).deferred??(c.deferred=[]);for(let l of u._zod.deferred)l();return u}return Object.defineProperty(a,"init",{value:n}),Object.defineProperty(a,Symbol.hasInstance,{value:s=>r?.Parent&&s instanceof r.Parent?!0:s?._zod?.traits?.has(t)}),Object.defineProperty(a,"name",{value:t}),a}var vt=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},dr=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}},di={};function ye(t){return t&&Object.assign(di,t),di}var y={};$n(y,{BIGINT_FORMAT_RANGES:()=>Fs,Class:()=>Rs,NUMBER_FORMAT_RANGES:()=>qs,aborted:()=>Bt,allowsEval:()=>Zs,assert:()=>I$,assertEqual:()=>k$,assertIs:()=>w$,assertNever:()=>z$,assertNotEqual:()=>S$,assignProp:()=>Wt,base64ToUint8Array:()=>Nf,base64urlToUint8Array:()=>Z$,cached:()=>Fr,captureStackTrace:()=>fi,cleanEnum:()=>U$,cleanRegex:()=>An,clone:()=>Ne,cloneDef:()=>T$,createTransparentProxy:()=>R$,defineLazy:()=>q,esc:()=>pi,escapeRegex:()=>Ye,extend:()=>Pf,finalizeIssue:()=>Me,floatSafeRemainder:()=>As,getElementAtPath:()=>P$,getEnumValues:()=>Rn,getLengthableOrigin:()=>Cn,getParsedType:()=>N$,getSizableOrigin:()=>Zn,hexToUint8Array:()=>M$,isObject:()=>pr,isPlainObject:()=>Gt,issue:()=>Vr,joinValues:()=>N,jsonStringifyReplacer:()=>qr,merge:()=>A$,mergeDefs:()=>Ot,normalizeParams:()=>x,nullish:()=>Ht,numKeys:()=>D$,objectClone:()=>E$,omit:()=>Tf,optionalKeys:()=>Ls,parsedType:()=>U,partial:()=>jf,pick:()=>Ef,prefixIssues:()=>He,primitiveTypes:()=>Ms,promiseAllObject:()=>O$,propertyKeyTypes:()=>Un,randomString:()=>j$,required:()=>Df,safeExtend:()=>Of,shallowClone:()=>Cs,slugify:()=>Us,stringifyPrimitive:()=>R,uint8ArrayToBase64:()=>Rf,uint8ArrayToBase64url:()=>C$,uint8ArrayToHex:()=>L$,unwrapMessage:()=>Nn});function k$(t){return t}function S$(t){return t}function w$(t){}function z$(t){throw new Error("Unexpected value in exhaustive check")}function I$(t){}function Rn(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 N(t,e="|"){return t.map(r=>R(r)).join(e)}function qr(t,e){return typeof e=="bigint"?e.toString():e}function Fr(t){return{get value(){{let r=t();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function Ht(t){return t==null}function An(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}function As(t,e){let r=(t.toString().split(".")[1]||"").length,n=e.toString(),o=(n.split(".")[1]||"").length;if(o===0&&/\d?e-\d?/.test(n)){let c=n.match(/\d?e-(\d?)/);c?.[1]&&(o=Number.parseInt(c[1]))}let i=r>o?r:o,a=Number.parseInt(t.toFixed(i).replace(".","")),s=Number.parseInt(e.toFixed(i).replace(".",""));return a%s/10**i}var If=Symbol("evaluating");function q(t,e,r){let n;Object.defineProperty(t,e,{get(){if(n!==If)return n===void 0&&(n=If,n=r()),n},set(o){Object.defineProperty(t,e,{value:o})},configurable:!0})}function E$(t){return Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))}function Wt(t,e,r){Object.defineProperty(t,e,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Ot(...t){let e={};for(let r of t){let n=Object.getOwnPropertyDescriptors(r);Object.assign(e,n)}return Object.defineProperties({},e)}function T$(t){return Ot(t._zod.def)}function P$(t,e){return e?e.reduce((r,n)=>r?.[n],t):t}function O$(t){let e=Object.keys(t),r=e.map(n=>t[n]);return Promise.all(r).then(n=>{let o={};for(let i=0;i<e.length;i++)o[e[i]]=n[i];return o})}function j$(t=10){let e="abcdefghijklmnopqrstuvwxyz",r="";for(let n=0;n<t;n++)r+=e[Math.floor(Math.random()*e.length)];return r}function pi(t){return JSON.stringify(t)}function Us(t){return t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var fi="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function pr(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}var Zs=Fr(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});function Gt(t){if(pr(t)===!1)return!1;let e=t.constructor;if(e===void 0||typeof e!="function")return!0;let r=e.prototype;return!(pr(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Cs(t){return Gt(t)?{...t}:Array.isArray(t)?[...t]:t}function D$(t){let e=0;for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&e++;return e}var N$=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}`)}},Un=new Set(["string","number","symbol"]),Ms=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Ye(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ne(t,e,r){let n=new t._zod.constr(e??t._zod.def);return(!e||r?.parent)&&(n._zod.parent=t),n}function x(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 R$(t){let e;return new Proxy({},{get(r,n,o){return e??(e=t()),Reflect.get(e,n,o)},set(r,n,o,i){return e??(e=t()),Reflect.set(e,n,o,i)},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 R(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}function Ls(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}var qs={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]},Fs={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Ef(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 i=Ot(t._zod.def,{get shape(){let a={};for(let s in e){if(!(s in r.shape))throw new Error(`Unrecognized key: "${s}"`);e[s]&&(a[s]=r.shape[s])}return Wt(this,"shape",a),a},checks:[]});return Ne(t,i)}function Tf(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 i=Ot(t._zod.def,{get shape(){let a={...t._zod.def.shape};for(let s in e){if(!(s in r.shape))throw new Error(`Unrecognized key: "${s}"`);e[s]&&delete a[s]}return Wt(this,"shape",a),a},checks:[]});return Ne(t,i)}function Pf(t,e){if(!Gt(e))throw new Error("Invalid input to extend: expected a plain object");let r=t._zod.def.checks;if(r&&r.length>0){let i=t._zod.def.shape;for(let a in e)if(Object.getOwnPropertyDescriptor(i,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let o=Ot(t._zod.def,{get shape(){let i={...t._zod.def.shape,...e};return Wt(this,"shape",i),i}});return Ne(t,o)}function Of(t,e){if(!Gt(e))throw new Error("Invalid input to safeExtend: expected a plain object");let r=Ot(t._zod.def,{get shape(){let n={...t._zod.def.shape,...e};return Wt(this,"shape",n),n}});return Ne(t,r)}function A$(t,e){let r=Ot(t._zod.def,{get shape(){let n={...t._zod.def.shape,...e._zod.def.shape};return Wt(this,"shape",n),n},get catchall(){return e._zod.def.catchall},checks:[]});return Ne(t,r)}function jf(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 a=Ot(e._zod.def,{get shape(){let s=e._zod.def.shape,c={...s};if(r)for(let u in r){if(!(u in s))throw new Error(`Unrecognized key: "${u}"`);r[u]&&(c[u]=t?new t({type:"optional",innerType:s[u]}):s[u])}else for(let u in s)c[u]=t?new t({type:"optional",innerType:s[u]}):s[u];return Wt(this,"shape",c),c},checks:[]});return Ne(e,a)}function Df(t,e,r){let n=Ot(e._zod.def,{get shape(){let o=e._zod.def.shape,i={...o};if(r)for(let a in r){if(!(a in i))throw new Error(`Unrecognized key: "${a}"`);r[a]&&(i[a]=new t({type:"nonoptional",innerType:o[a]}))}else for(let a in o)i[a]=new t({type:"nonoptional",innerType:o[a]});return Wt(this,"shape",i),i}});return Ne(e,n)}function Bt(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 He(t,e){return e.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(t),r})}function Nn(t){return typeof t=="string"?t:t?.message}function Me(t,e,r){let n={...t,path:t.path??[]};if(!t.message){let o=Nn(t.inst?._zod.def?.error?.(t))??Nn(e?.error?.(t))??Nn(r.customError?.(t))??Nn(r.localeError?.(t))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,e?.reportInput||delete n.input,n}function Zn(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}function Cn(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function U(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 Vr(...t){let[e,r,n]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:n}:{...e}}function U$(t){return Object.entries(t).filter(([e,r])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function Nf(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 Rf(t){let e="";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return btoa(e)}function Z$(t){let e=t.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-e.length%4)%4);return Nf(e+r)}function C$(t){return Rf(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function M$(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 L$(t){return Array.from(t).map(e=>e.toString(16).padStart(2,"0")).join("")}var Rs=class{constructor(...e){}};var Af=(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,qr,2),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:!1})},mi=p("$ZodError",Af),Mn=p("$ZodError",Af,{Parent:Error});function hi(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 gi(t,e=r=>r.message){let r={_errors:[]},n=o=>{for(let i of o.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(a=>n({issues:a}));else if(i.code==="invalid_key")n({issues:i.issues});else if(i.code==="invalid_element")n({issues:i.issues});else if(i.path.length===0)r._errors.push(e(i));else{let a=r,s=0;for(;s<i.path.length;){let c=i.path[s];s===i.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(e(i))):a[c]=a[c]||{_errors:[]},a=a[c],s++}}};return n(t),r}var Ln=t=>(e,r,n,o)=>{let i=n?Object.assign(n,{async:!1}):{async:!1},a=e._zod.run({value:r,issues:[]},i);if(a instanceof Promise)throw new vt;if(a.issues.length){let s=new(o?.Err??t)(a.issues.map(c=>Me(c,i,ye())));throw fi(s,o?.callee),s}return a.value},qn=Ln(Mn),Fn=t=>async(e,r,n,o)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},a=e._zod.run({value:r,issues:[]},i);if(a instanceof Promise&&(a=await a),a.issues.length){let s=new(o?.Err??t)(a.issues.map(c=>Me(c,i,ye())));throw fi(s,o?.callee),s}return a.value},Vn=Fn(Mn),Jn=t=>(e,r,n)=>{let o=n?{...n,async:!1}:{async:!1},i=e._zod.run({value:r,issues:[]},o);if(i instanceof Promise)throw new vt;return i.issues.length?{success:!1,error:new(t??mi)(i.issues.map(a=>Me(a,o,ye())))}:{success:!0,data:i.value}},Jr=Jn(Mn),Kn=t=>async(e,r,n)=>{let o=n?Object.assign(n,{async:!0}):{async:!0},i=e._zod.run({value:r,issues:[]},o);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new t(i.issues.map(a=>Me(a,o,ye())))}:{success:!0,data:i.value}},Hn=Kn(Mn),Uf=t=>(e,r,n)=>{let o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Ln(t)(e,r,o)};var Zf=t=>(e,r,n)=>Ln(t)(e,r,n);var Cf=t=>async(e,r,n)=>{let o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Fn(t)(e,r,o)};var Mf=t=>async(e,r,n)=>Fn(t)(e,r,n);var Lf=t=>(e,r,n)=>{let o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Jn(t)(e,r,o)};var qf=t=>(e,r,n)=>Jn(t)(e,r,n);var Ff=t=>async(e,r,n)=>{let o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Kn(t)(e,r,o)};var Vf=t=>async(e,r,n)=>Kn(t)(e,r,n);var Qe={};$n(Qe,{base64:()=>ic,base64url:()=>vi,bigint:()=>dc,boolean:()=>fc,browserEmail:()=>B$,cidrv4:()=>nc,cidrv6:()=>oc,cuid:()=>Vs,cuid2:()=>Js,date:()=>sc,datetime:()=>uc,domain:()=>Q$,duration:()=>Bs,e164:()=>ac,email:()=>Ys,emoji:()=>Qs,extendedDuration:()=>F$,guid:()=>Xs,hex:()=>eb,hostname:()=>Y$,html5Email:()=>H$,idnEmail:()=>G$,integer:()=>pc,ipv4:()=>ec,ipv6:()=>tc,ksuid:()=>Ws,lowercase:()=>gc,mac:()=>rc,md5_base64:()=>rb,md5_base64url:()=>nb,md5_hex:()=>tb,nanoid:()=>Gs,null:()=>mc,number:()=>_i,rfc5322Email:()=>W$,sha1_base64:()=>ib,sha1_base64url:()=>ab,sha1_hex:()=>ob,sha256_base64:()=>cb,sha256_base64url:()=>ub,sha256_hex:()=>sb,sha384_base64:()=>db,sha384_base64url:()=>pb,sha384_hex:()=>lb,sha512_base64:()=>mb,sha512_base64url:()=>hb,sha512_hex:()=>fb,string:()=>lc,time:()=>cc,ulid:()=>Ks,undefined:()=>hc,unicodeEmail:()=>Jf,uppercase:()=>vc,uuid:()=>fr,uuid4:()=>V$,uuid6:()=>J$,uuid7:()=>K$,xid:()=>Hs});var Vs=/^[cC][^\s-]{8,}$/,Js=/^[0-9a-z]+$/,Ks=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Hs=/^[0-9a-vA-V]{20}$/,Ws=/^[A-Za-z0-9]{27}$/,Gs=/^[a-zA-Z0-9_-]{21}$/,Bs=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,F$=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Xs=/^([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})$/,fr=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)$/,V$=fr(4),J$=fr(6),K$=fr(7),Ys=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,H$=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,W$=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,Jf=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,G$=Jf,B$=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,X$="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Qs(){return new RegExp(X$,"u")}var ec=/^(?:(?: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])$/,tc=/^(([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}|:))$/,rc=t=>{let e=Ye(t??":");return new RegExp(`^(?:[0-9A-F]{2}${e}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${e}){5}[0-9a-f]{2}$`)},nc=/^((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])$/,oc=/^(([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])$/,ic=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,vi=/^[A-Za-z0-9_-]*$/,Y$=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,Q$=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,ac=/^\+[1-9]\d{6,14}$/,Kf="(?:(?:\\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])))",sc=new RegExp(`^${Kf}$`);function Hf(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 cc(t){return new RegExp(`^${Hf(t)}$`)}function uc(t){let e=Hf({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(`^${Kf}T(?:${n})$`)}var lc=t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},dc=/^-?\d+n?$/,pc=/^-?\d+$/,_i=/^-?\d+(?:\.\d+)?$/,fc=/^(?:true|false)$/i,mc=/^null$/i;var hc=/^undefined$/i;var gc=/^[^A-Z]*$/,vc=/^[^a-z]*$/,eb=/^[0-9a-fA-F]*$/;function Wn(t,e){return new RegExp(`^[A-Za-z0-9+/]{${t}}${e}$`)}function Gn(t){return new RegExp(`^[A-Za-z0-9_-]{${t}}$`)}var tb=/^[0-9a-fA-F]{32}$/,rb=Wn(22,"=="),nb=Gn(22),ob=/^[0-9a-fA-F]{40}$/,ib=Wn(27,"="),ab=Gn(27),sb=/^[0-9a-fA-F]{64}$/,cb=Wn(43,"="),ub=Gn(43),lb=/^[0-9a-fA-F]{96}$/,db=Wn(64,""),pb=Gn(64),fb=/^[0-9a-fA-F]{128}$/,mb=Wn(86,"=="),hb=Gn(86);var se=p("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),Gf={number:"number",bigint:"bigint",object:"date"},_c=p("$ZodCheckLessThan",(t,e)=>{se.init(t,e);let r=Gf[typeof e.value];t._zod.onattach.push(n=>{let o=n._zod.bag,i=(e.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value<i&&(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})}}),yc=p("$ZodCheckGreaterThan",(t,e)=>{se.init(t,e);let r=Gf[typeof e.value];t._zod.onattach.push(n=>{let o=n._zod.bag,i=(e.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>i&&(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})}}),Bf=p("$ZodCheckMultipleOf",(t,e)=>{se.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):As(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})}}),Xf=p("$ZodCheckNumberFormat",(t,e)=>{se.init(t,e),e.format=e.format||"float64";let r=e.format?.includes("int"),n=r?"int":"number",[o,i]=qs[e.format];t._zod.onattach.push(a=>{let s=a._zod.bag;s.format=e.format,s.minimum=o,s.maximum=i,r&&(s.pattern=pc)}),t._zod.check=a=>{let s=a.value;if(r){if(!Number.isInteger(s)){a.issues.push({expected:n,format:e.format,code:"invalid_type",continue:!1,input:s,inst:t});return}if(!Number.isSafeInteger(s)){s>0?a.issues.push({input:s,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}):a.issues.push({input:s,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}}s<o&&a.issues.push({origin:"number",input:s,code:"too_small",minimum:o,inclusive:!0,inst:t,continue:!e.abort}),s>i&&a.issues.push({origin:"number",input:s,code:"too_big",maximum:i,inclusive:!0,inst:t,continue:!e.abort})}}),Yf=p("$ZodCheckBigIntFormat",(t,e)=>{se.init(t,e);let[r,n]=Fs[e.format];t._zod.onattach.push(o=>{let i=o._zod.bag;i.format=e.format,i.minimum=r,i.maximum=n}),t._zod.check=o=>{let i=o.value;i<r&&o.issues.push({origin:"bigint",input:i,code:"too_small",minimum:r,inclusive:!0,inst:t,continue:!e.abort}),i>n&&o.issues.push({origin:"bigint",input:i,code:"too_big",maximum:n,inclusive:!0,inst:t,continue:!e.abort})}}),Qf=p("$ZodCheckMaxSize",(t,e)=>{var r;se.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!Ht(o)&&o.size!==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;o.size<=e.maximum||n.issues.push({origin:Zn(o),code:"too_big",maximum:e.maximum,inclusive:!0,input:o,inst:t,continue:!e.abort})}}),em=p("$ZodCheckMinSize",(t,e)=>{var r;se.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!Ht(o)&&o.size!==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;o.size>=e.minimum||n.issues.push({origin:Zn(o),code:"too_small",minimum:e.minimum,inclusive:!0,input:o,inst:t,continue:!e.abort})}}),tm=p("$ZodCheckSizeEquals",(t,e)=>{var r;se.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!Ht(o)&&o.size!==void 0}),t._zod.onattach.push(n=>{let o=n._zod.bag;o.minimum=e.size,o.maximum=e.size,o.size=e.size}),t._zod.check=n=>{let o=n.value,i=o.size;if(i===e.size)return;let a=i>e.size;n.issues.push({origin:Zn(o),...a?{code:"too_big",maximum:e.size}:{code:"too_small",minimum:e.size},inclusive:!0,exact:!0,input:n.value,inst:t,continue:!e.abort})}}),rm=p("$ZodCheckMaxLength",(t,e)=>{var r;se.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!Ht(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 a=Cn(o);n.issues.push({origin:a,code:"too_big",maximum:e.maximum,inclusive:!0,input:o,inst:t,continue:!e.abort})}}),nm=p("$ZodCheckMinLength",(t,e)=>{var r;se.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!Ht(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 a=Cn(o);n.issues.push({origin:a,code:"too_small",minimum:e.minimum,inclusive:!0,input:o,inst:t,continue:!e.abort})}}),om=p("$ZodCheckLengthEquals",(t,e)=>{var r;se.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!Ht(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,i=o.length;if(i===e.length)return;let a=Cn(o),s=i>e.length;n.issues.push({origin:a,...s?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:n.value,inst:t,continue:!e.abort})}}),Bn=p("$ZodCheckStringFormat",(t,e)=>{var r,n;se.init(t,e),t._zod.onattach.push(o=>{let i=o._zod.bag;i.format=e.format,e.pattern&&(i.patterns??(i.patterns=new Set),i.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=()=>{})}),im=p("$ZodCheckRegex",(t,e)=>{Bn.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})}}),am=p("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=gc),Bn.init(t,e)}),sm=p("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=vc),Bn.init(t,e)}),cm=p("$ZodCheckIncludes",(t,e)=>{se.init(t,e);let r=Ye(e.includes),n=new RegExp(typeof e.position=="number"?`^.{${e.position}}${r}`:r);e.pattern=n,t._zod.onattach.push(o=>{let i=o._zod.bag;i.patterns??(i.patterns=new Set),i.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})}}),um=p("$ZodCheckStartsWith",(t,e)=>{se.init(t,e);let r=new RegExp(`^${Ye(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})}}),lm=p("$ZodCheckEndsWith",(t,e)=>{se.init(t,e);let r=new RegExp(`.*${Ye(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})}});function Wf(t,e,r){t.issues.length&&e.issues.push(...He(r,t.issues))}var dm=p("$ZodCheckProperty",(t,e)=>{se.init(t,e),t._zod.check=r=>{let n=e.schema._zod.run({value:r.value[e.property],issues:[]},{});if(n instanceof Promise)return n.then(o=>Wf(o,r,e.property));Wf(n,r,e.property)}}),pm=p("$ZodCheckMimeType",(t,e)=>{se.init(t,e);let r=new Set(e.mime);t._zod.onattach.push(n=>{n._zod.bag.mime=e.mime}),t._zod.check=n=>{r.has(n.value.type)||n.issues.push({code:"invalid_value",values:e.mime,input:n.value.type,inst:t,continue:!e.abort})}}),fm=p("$ZodCheckOverwrite",(t,e)=>{se.init(t,e),t._zod.check=r=>{r.value=e.tx(r.value)}});var yi=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let n=e.split(`
18
- `).filter(a=>a),o=Math.min(...n.map(a=>a.length-a.trimStart().length)),i=n.map(a=>a.slice(o)).map(a=>" ".repeat(this.indent*2)+a);for(let a of i)this.content.push(a)}compile(){let e=Function,r=this?.args,o=[...(this?.content??[""]).map(i=>` ${i}`)];return new e(...r,o.join(`
19
- `))}};var hm={major:4,minor:3,patch:6};var M=p("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=hm;let n=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&n.unshift(t);for(let o of n)for(let i of o._zod.onattach)i(t);if(n.length===0)(r=t._zod).deferred??(r.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{let o=(a,s,c)=>{let u=Bt(a),l;for(let d of s){if(d._zod.def.when){if(!d._zod.def.when(a))continue}else if(u)continue;let m=a.issues.length,f=d._zod.check(a);if(f instanceof Promise&&c?.async===!1)throw new vt;if(l||f instanceof Promise)l=(l??Promise.resolve()).then(async()=>{await f,a.issues.length!==m&&(u||(u=Bt(a,m)))});else{if(a.issues.length===m)continue;u||(u=Bt(a,m))}}return l?l.then(()=>a):a},i=(a,s,c)=>{if(Bt(a))return a.aborted=!0,a;let u=o(s,n,c);if(u instanceof Promise){if(c.async===!1)throw new vt;return u.then(l=>t._zod.parse(l,c))}return t._zod.parse(u,c)};t._zod.run=(a,s)=>{if(s.skipChecks)return t._zod.parse(a,s);if(s.direction==="backward"){let u=t._zod.parse({value:a.value,issues:[]},{...s,skipChecks:!0});return u instanceof Promise?u.then(l=>i(l,a,s)):i(u,a,s)}let c=t._zod.parse(a,s);if(c instanceof Promise){if(s.async===!1)throw new vt;return c.then(u=>o(u,n,s))}return o(c,n,s)}}q(t,"~standard",()=>({validate:o=>{try{let i=Jr(t,o);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return Hn(t,o).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}))}),mr=p("$ZodString",(t,e)=>{M.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??lc(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}}),oe=p("$ZodStringFormat",(t,e)=>{Bn.init(t,e),mr.init(t,e)}),bc=p("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=Xs),oe.init(t,e)}),xc=p("$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=fr(n))}else e.pattern??(e.pattern=fr());oe.init(t,e)}),kc=p("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=Ys),oe.init(t,e)}),Sc=p("$ZodURL",(t,e)=>{oe.init(t,e),t._zod.check=r=>{try{let n=r.value.trim(),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})}}}),wc=p("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=Qs()),oe.init(t,e)}),zc=p("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=Gs),oe.init(t,e)}),Ic=p("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=Vs),oe.init(t,e)}),Ec=p("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=Js),oe.init(t,e)}),Tc=p("$ZodULID",(t,e)=>{e.pattern??(e.pattern=Ks),oe.init(t,e)}),Pc=p("$ZodXID",(t,e)=>{e.pattern??(e.pattern=Hs),oe.init(t,e)}),Oc=p("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=Ws),oe.init(t,e)}),jc=p("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=uc(e)),oe.init(t,e)}),Dc=p("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=sc),oe.init(t,e)}),Nc=p("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=cc(e)),oe.init(t,e)}),Rc=p("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=Bs),oe.init(t,e)}),Ac=p("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=ec),oe.init(t,e),t._zod.bag.format="ipv4"}),Uc=p("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=tc),oe.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})}}}),Zc=p("$ZodMAC",(t,e)=>{e.pattern??(e.pattern=rc(e.delimiter)),oe.init(t,e),t._zod.bag.format="mac"}),Cc=p("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=nc),oe.init(t,e)}),Mc=p("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=oc),oe.init(t,e),t._zod.check=r=>{let n=r.value.split("/");try{if(n.length!==2)throw new Error;let[o,i]=n;if(!i)throw new Error;let a=Number(i);if(`${a}`!==i)throw new Error;if(a<0||a>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 Im(t){if(t==="")return!0;if(t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}var Lc=p("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=ic),oe.init(t,e),t._zod.bag.contentEncoding="base64",t._zod.check=r=>{Im(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:t,continue:!e.abort})}});function gb(t){if(!vi.test(t))return!1;let e=t.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=");return Im(r)}var qc=p("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=vi),oe.init(t,e),t._zod.bag.contentEncoding="base64url",t._zod.check=r=>{gb(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:t,continue:!e.abort})}}),Fc=p("$ZodE164",(t,e)=>{e.pattern??(e.pattern=ac),oe.init(t,e)});function vb(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 Vc=p("$ZodJWT",(t,e)=>{oe.init(t,e),t._zod.check=r=>{vb(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:t,continue:!e.abort})}}),Jc=p("$ZodCustomStringFormat",(t,e)=>{oe.init(t,e),t._zod.check=r=>{e.fn(r.value)||r.issues.push({code:"invalid_format",format:e.format,input:r.value,inst:t,continue:!e.abort})}}),wi=p("$ZodNumber",(t,e)=>{M.init(t,e),t._zod.pattern=t._zod.bag.pattern??_i,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 i=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,...i?{received:i}:{}}),r}}),Kc=p("$ZodNumberFormat",(t,e)=>{Xf.init(t,e),wi.init(t,e)}),Xn=p("$ZodBoolean",(t,e)=>{M.init(t,e),t._zod.pattern=fc,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}}),zi=p("$ZodBigInt",(t,e)=>{M.init(t,e),t._zod.pattern=dc,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:t}),r}}),Hc=p("$ZodBigIntFormat",(t,e)=>{Yf.init(t,e),zi.init(t,e)}),Wc=p("$ZodSymbol",(t,e)=>{M.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;return typeof o=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:o,inst:t}),r}}),Gc=p("$ZodUndefined",(t,e)=>{M.init(t,e),t._zod.pattern=hc,t._zod.values=new Set([void 0]),t._zod.optin="optional",t._zod.optout="optional",t._zod.parse=(r,n)=>{let o=r.value;return typeof o>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:o,inst:t}),r}}),Bc=p("$ZodNull",(t,e)=>{M.init(t,e),t._zod.pattern=mc,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}}),Xc=p("$ZodAny",(t,e)=>{M.init(t,e),t._zod.parse=r=>r}),Yc=p("$ZodUnknown",(t,e)=>{M.init(t,e),t._zod.parse=r=>r}),Qc=p("$ZodNever",(t,e)=>{M.init(t,e),t._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:t}),r)}),eu=p("$ZodVoid",(t,e)=>{M.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;return typeof o>"u"||r.issues.push({expected:"void",code:"invalid_type",input:o,inst:t}),r}}),tu=p("$ZodDate",(t,e)=>{M.init(t,e),t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=new Date(r.value)}catch{}let o=r.value,i=o instanceof Date;return i&&!Number.isNaN(o.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:o,...i?{received:"Invalid Date"}:{},inst:t}),r}});function gm(t,e,r){t.issues.length&&e.issues.push(...He(r,t.issues)),e.value[r]=t.value}var ru=p("$ZodArray",(t,e)=>{M.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 i=[];for(let a=0;a<o.length;a++){let s=o[a],c=e.element._zod.run({value:s,issues:[]},n);c instanceof Promise?i.push(c.then(u=>gm(u,r,a))):gm(c,r,a)}return i.length?Promise.all(i).then(()=>r):r}});function Si(t,e,r,n,o){if(t.issues.length){if(o&&!(r in n))return;e.issues.push(...He(r,t.issues))}t.value===void 0?r in n&&(e.value[r]=void 0):e.value[r]=t.value}function Em(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=Ls(t.shape);return{...t,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(r)}}function Tm(t,e,r,n,o,i){let a=[],s=o.keySet,c=o.catchall._zod,u=c.def.type,l=c.optout==="optional";for(let d in e){if(s.has(d))continue;if(u==="never"){a.push(d);continue}let m=c.run({value:e[d],issues:[]},n);m instanceof Promise?t.push(m.then(f=>Si(f,r,d,e,l))):Si(m,r,d,e,l)}return a.length&&r.issues.push({code:"unrecognized_keys",keys:a,input:e,inst:i}),t.length?Promise.all(t).then(()=>r):r}var Pm=p("$ZodObject",(t,e)=>{if(M.init(t,e),!Object.getOwnPropertyDescriptor(e,"shape")?.get){let s=e.shape;Object.defineProperty(e,"shape",{get:()=>{let c={...s};return Object.defineProperty(e,"shape",{value:c}),c}})}let n=Fr(()=>Em(e));q(t._zod,"propValues",()=>{let s=e.shape,c={};for(let u in s){let l=s[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=pr,i=e.catchall,a;t._zod.parse=(s,c)=>{a??(a=n.value);let u=s.value;if(!o(u))return s.issues.push({expected:"object",code:"invalid_type",input:u,inst:t}),s;s.value={};let l=[],d=a.shape;for(let m of a.keys){let f=d[m],g=f._zod.optout==="optional",v=f._zod.run({value:u[m],issues:[]},c);v instanceof Promise?l.push(v.then($=>Si($,s,m,u,g))):Si(v,s,m,u,g)}return i?Tm(l,u,s,c,n.value,t):l.length?Promise.all(l).then(()=>s):s}}),Om=p("$ZodObjectJIT",(t,e)=>{Pm.init(t,e);let r=t._zod.parse,n=Fr(()=>Em(e)),o=m=>{let f=new yi(["shape","payload","ctx"]),g=n.value,v=I=>{let Z=pi(I);return`shape[${Z}]._zod.run({ value: input[${Z}], issues: [] }, ctx)`};f.write("const input = payload.value;");let $=Object.create(null),k=0;for(let I of g.keys)$[I]=`key_${k++}`;f.write("const newResult = {};");for(let I of g.keys){let Z=$[I],j=pi(I),st=m[I]?._zod?.optout==="optional";f.write(`const ${Z} = ${v(I)};`),st?f.write(`
20
- if (${Z}.issues.length) {
21
- if (${j} in input) {
22
- payload.issues = payload.issues.concat(${Z}.issues.map(iss => ({
15
+ `)}else process.stderr.write(p+`
16
+ `)}debug(e,r,o,n){this.log(0,e,r,o,n)}info(e,r,o,n){this.log(1,e,r,o,n)}warn(e,r,o,n){this.log(2,e,r,o,n)}error(e,r,o,n){this.log(3,e,r,o,n)}dataIn(e,r,o,n){this.info(e,`\u2192 ${r}`,o,n)}dataOut(e,r,o,n){this.info(e,`\u2190 ${r}`,o,n)}success(e,r,o,n){this.info(e,`\u2713 ${r}`,o,n)}failure(e,r,o,n){this.error(e,`\u2717 ${r}`,o,n)}timing(e,r,o,n){this.info(e,`\u23F1 ${r}`,n,{duration:`${o}ms`})}happyPathError(e,r,o,n,s=""){let u=((new Error().stack||"").split(`
17
+ `)[2]||"").match(/at\s+(?:.*\s+)?\(?([^:]+):(\d+):(\d+)\)?/),l=u?`${u[1].split("/").pop()}:${u[2]}`:"unknown",d={...o,location:l};return this.warn(e,`[HAPPY-PATH] ${r}`,d,n),s}},re=new Bn;var dc;function g(t,e,r){function o(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 n=r?.Parent??Object;class s extends n{}Object.defineProperty(s,"name",{value:t});function i(a){var c;let u=r?.Parent?new s:this;o(u,a),(c=u._zod).deferred??(c.deferred=[]);for(let l of u._zod.deferred)l();return u}return Object.defineProperty(i,"init",{value:o}),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 Ve=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Mt=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}};(dc=globalThis).__zod_globalConfig??(dc.__zod_globalConfig={});var Dt=globalThis.__zod_globalConfig;function ke(t){return t&&Object.assign(Dt,t),Dt}var j={};cc(j,{BIGINT_FORMAT_RANGES:()=>hc,Class:()=>Xn,NUMBER_FORMAT_RANGES:()=>ns,aborted:()=>lt,allowsEval:()=>ts,assert:()=>Hh,assertEqual:()=>qh,assertIs:()=>Fh,assertNever:()=>Vh,assertNotEqual:()=>Uh,assignProp:()=>ct,base64ToUint8Array:()=>_c,base64urlToUint8Array:()=>cg,cached:()=>Zt,captureStackTrace:()=>So,cleanEnum:()=>ag,cleanRegex:()=>_r,clone:()=>je,cloneDef:()=>Kh,createTransparentProxy:()=>Qh,defineLazy:()=>U,esc:()=>bo,escapeRegex:()=>Qe,explicitlyAborted:()=>ss,extend:()=>rg,finalizeIssue:()=>Re,floatSafeRemainder:()=>Qn,getElementAtPath:()=>Gh,getEnumValues:()=>hr,getLengthableOrigin:()=>yr,getParsedType:()=>Xh,getSizableOrigin:()=>gc,hexToUint8Array:()=>lg,isObject:()=>wt,isPlainObject:()=>ut,issue:()=>Lt,joinValues:()=>$o,jsonStringifyReplacer:()=>jt,merge:()=>ng,mergeDefs:()=>Xe,normalizeParams:()=>P,nullish:()=>gr,numKeys:()=>Yh,objectClone:()=>Jh,omit:()=>tg,optionalKeys:()=>os,parsedType:()=>is,partial:()=>sg,pick:()=>eg,prefixIssues:()=>et,primitiveTypes:()=>mc,promiseAllObject:()=>Wh,propertyKeyTypes:()=>rs,randomString:()=>Bh,required:()=>ig,safeExtend:()=>og,shallowClone:()=>fc,slugify:()=>es,stringifyPrimitive:()=>wo,uint8ArrayToBase64:()=>yc,uint8ArrayToBase64url:()=>ug,uint8ArrayToHex:()=>dg,unwrapMessage:()=>mr});function qh(t){return t}function Uh(t){return t}function Fh(t){}function Vh(t){throw new Error("Unexpected value in exhaustive check")}function Hh(t){}function hr(t){let e=Object.values(t).filter(o=>typeof o=="number");return Object.entries(t).filter(([o,n])=>e.indexOf(+o)===-1).map(([o,n])=>n)}function $o(t,e="|"){return t.map(r=>wo(r)).join(e)}function jt(t,e){return typeof e=="bigint"?e.toString():e}function Zt(t){return{get value(){{let r=t();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function gr(t){return t==null}function _r(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}function Qn(t,e){let r=t/e,o=Math.round(r),n=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-o)<n?0:r-o}var pc=Symbol("evaluating");function U(t,e,r){let o;Object.defineProperty(t,e,{get(){if(o!==pc)return o===void 0&&(o=pc,o=r()),o},set(n){Object.defineProperty(t,e,{value:n})},configurable:!0})}function Jh(t){return Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))}function ct(t,e,r){Object.defineProperty(t,e,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Xe(...t){let e={};for(let r of t){let o=Object.getOwnPropertyDescriptors(r);Object.assign(e,o)}return Object.defineProperties({},e)}function Kh(t){return Xe(t._zod.def)}function Gh(t,e){return e?e.reduce((r,o)=>r?.[o],t):t}function Wh(t){let e=Object.keys(t),r=e.map(o=>t[o]);return Promise.all(r).then(o=>{let n={};for(let s=0;s<e.length;s++)n[e[s]]=o[s];return n})}function Bh(t=10){let e="abcdefghijklmnopqrstuvwxyz",r="";for(let o=0;o<t;o++)r+=e[Math.floor(Math.random()*e.length)];return r}function bo(t){return JSON.stringify(t)}function es(t){return t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var So="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function wt(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}var ts=Zt(()=>{if(Dt.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});function ut(t){if(wt(t)===!1)return!1;let e=t.constructor;if(e===void 0||typeof e!="function")return!0;let r=e.prototype;return!(wt(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function fc(t){return ut(t)?{...t}:Array.isArray(t)?[...t]:t instanceof Map?new Map(t):t instanceof Set?new Set(t):t}function Yh(t){let e=0;for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&e++;return e}var Xh=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}`)}},rs=new Set(["string","number","symbol"]),mc=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Qe(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function je(t,e,r){let o=new t._zod.constr(e??t._zod.def);return(!e||r?.parent)&&(o._zod.parent=t),o}function P(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 Qh(t){let e;return new Proxy({},{get(r,o,n){return e??(e=t()),Reflect.get(e,o,n)},set(r,o,n,s){return e??(e=t()),Reflect.set(e,o,n,s)},has(r,o){return e??(e=t()),Reflect.has(e,o)},deleteProperty(r,o){return e??(e=t()),Reflect.deleteProperty(e,o)},ownKeys(r){return e??(e=t()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(r,o){return e??(e=t()),Reflect.getOwnPropertyDescriptor(e,o)},defineProperty(r,o,n){return e??(e=t()),Reflect.defineProperty(e,o,n)}})}function wo(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}function os(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}var ns={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]},hc={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function eg(t,e){let r=t._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let s=Xe(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 ct(this,"shape",i),i},checks:[]});return je(t,s)}function tg(t,e){let r=t._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let s=Xe(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 ct(this,"shape",i),i},checks:[]});return je(t,s)}function rg(t,e){if(!ut(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 n=Xe(t._zod.def,{get shape(){let s={...t._zod.def.shape,...e};return ct(this,"shape",s),s}});return je(t,n)}function og(t,e){if(!ut(e))throw new Error("Invalid input to safeExtend: expected a plain object");let r=Xe(t._zod.def,{get shape(){let o={...t._zod.def.shape,...e};return ct(this,"shape",o),o}});return je(t,r)}function ng(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=Xe(t._zod.def,{get shape(){let o={...t._zod.def.shape,...e._zod.def.shape};return ct(this,"shape",o),o},get catchall(){return e._zod.def.catchall},checks:e._zod.def.checks??[]});return je(t,r)}function sg(t,e,r){let n=e._zod.def.checks;if(n&&n.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let i=Xe(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 ct(this,"shape",c),c},checks:[]});return je(e,i)}function ig(t,e,r){let o=Xe(e._zod.def,{get shape(){let n=e._zod.def.shape,s={...n};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:n[i]}))}else for(let i in n)s[i]=new t({type:"nonoptional",innerType:n[i]});return ct(this,"shape",s),s}});return je(e,o)}function lt(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 ss(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 et(t,e){return e.map(r=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(t),r})}function mr(t){return typeof t=="string"?t:t?.message}function Re(t,e,r){let o=t.message?t.message:mr(t.inst?._zod.def?.error?.(t))??mr(e?.error?.(t))??mr(r.customError?.(t))??mr(r.localeError?.(t))??"Invalid input",{inst:n,continue:s,input:i,...a}=t;return a.path??(a.path=[]),a.message=o,e?.reportInput&&(a.input=i),a}function gc(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}function yr(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function is(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 Lt(...t){let[e,r,o]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:o}:{...e}}function ag(t){return Object.entries(t).filter(([e,r])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function _c(t){let e=atob(t),r=new Uint8Array(e.length);for(let o=0;o<e.length;o++)r[o]=e.charCodeAt(o);return r}function yc(t){let e="";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return btoa(e)}function cg(t){let e=t.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-e.length%4)%4);return _c(e+r)}function ug(t){return yc(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function lg(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 o=0;o<e.length;o+=2)r[o/2]=Number.parseInt(e.slice(o,o+2),16);return r}function dg(t){return Array.from(t).map(e=>e.toString(16).padStart(2,"0")).join("")}var Xn=class{constructor(...e){}};var vc=(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,jt,2),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:!1})},zo=g("$ZodError",vc),as=g("$ZodError",vc,{Parent:Error});function $c(t,e=r=>r.message){let r={},o=[];for(let n of t.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(e(n))):o.push(e(n));return{formErrors:o,fieldErrors:r}}function bc(t,e=r=>r.message){let r={_errors:[]},o=(n,s=[])=>{for(let i of n.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(a=>o({issues:a},[...s,...i.path]));else if(i.code==="invalid_key")o({issues:i.issues},[...s,...i.path]);else if(i.code==="invalid_element")o({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 o(t),r}var xo=t=>(e,r,o,n)=>{let s=o?{...o,async:!1}:{async:!1},i=e._zod.run({value:r,issues:[]},s);if(i instanceof Promise)throw new Ve;if(i.issues.length){let a=new(n?.Err??t)(i.issues.map(c=>Re(c,s,ke())));throw So(a,n?.callee),a}return i.value};var Eo=t=>async(e,r,o,n)=>{let s=o?{...o,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(n?.Err??t)(i.issues.map(c=>Re(c,s,ke())));throw So(a,n?.callee),a}return i.value};var vr=t=>(e,r,o)=>{let n=o?{...o,async:!1}:{async:!1},s=e._zod.run({value:r,issues:[]},n);if(s instanceof Promise)throw new Ve;return s.issues.length?{success:!1,error:new(t??zo)(s.issues.map(i=>Re(i,n,ke())))}:{success:!0,data:s.value}},$r=vr(as),br=t=>async(e,r,o)=>{let n=o?{...o,async:!0}:{async:!0},s=e._zod.run({value:r,issues:[]},n);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new t(s.issues.map(i=>Re(i,n,ke())))}:{success:!0,data:s.value}},ko=br(as),Sc=t=>(e,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return xo(t)(e,r,n)};var wc=t=>(e,r,o)=>xo(t)(e,r,o);var zc=t=>async(e,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Eo(t)(e,r,n)};var xc=t=>async(e,r,o)=>Eo(t)(e,r,o);var Ec=t=>(e,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return vr(t)(e,r,n)};var kc=t=>(e,r,o)=>vr(t)(e,r,o);var Pc=t=>async(e,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return br(t)(e,r,n)};var Tc=t=>async(e,r,o)=>br(t)(e,r,o);var Oc=/^[cC][0-9a-z]{6,}$/,Rc=/^[0-9a-z]+$/,Ic=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Ac=/^[0-9a-vA-V]{20}$/,Nc=/^[A-Za-z0-9]{27}$/,Cc=/^[a-zA-Z0-9_-]{21}$/,Mc=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var Dc=/^([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})$/,cs=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 jc=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var fg="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Zc(){return new RegExp(fg,"u")}var Lc=/^(?:(?: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])$/,qc=/^(([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 Uc=/^((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])$/,Fc=/^(([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])$/,Vc=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,us=/^[A-Za-z0-9_-]*$/;var Hc=/^https?$/,Jc=/^\+[1-9]\d{6,14}$/,Kc="(?:(?:\\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])))",Gc=new RegExp(`^${Kc}$`);function Wc(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 Bc(t){return new RegExp(`^${Wc(t)}$`)}function Yc(t){let e=Wc({precision:t.precision}),r=["Z"];t.local&&r.push(""),t.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let o=`${e}(?:${r.join("|")})`;return new RegExp(`^${Kc}T(?:${o})$`)}var Xc=t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)};var Qc=/^-?\d+$/,ls=/^-?\d+(?:\.\d+)?$/,eu=/^(?:true|false)$/i,tu=/^null$/i;var ru=/^[^A-Z]*$/,ou=/^[^a-z]*$/;var ce=g("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),nu={number:"number",bigint:"bigint",object:"date"},ds=g("$ZodCheckLessThan",(t,e)=>{ce.init(t,e);let r=nu[typeof e.value];t._zod.onattach.push(o=>{let n=o._zod.bag,s=(e.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value<s&&(e.inclusive?n.maximum=e.value:n.exclusiveMaximum=e.value)}),t._zod.check=o=>{(e.inclusive?o.value<=e.value:o.value<e.value)||o.issues.push({origin:r,code:"too_big",maximum:typeof e.value=="object"?e.value.getTime():e.value,input:o.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),ps=g("$ZodCheckGreaterThan",(t,e)=>{ce.init(t,e);let r=nu[typeof e.value];t._zod.onattach.push(o=>{let n=o._zod.bag,s=(e.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>s&&(e.inclusive?n.minimum=e.value:n.exclusiveMinimum=e.value)}),t._zod.check=o=>{(e.inclusive?o.value>=e.value:o.value>e.value)||o.issues.push({origin:r,code:"too_small",minimum:typeof e.value=="object"?e.value.getTime():e.value,input:o.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),su=g("$ZodCheckMultipleOf",(t,e)=>{ce.init(t,e),t._zod.onattach.push(r=>{var o;(o=r._zod.bag).multipleOf??(o.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):Qn(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})}}),iu=g("$ZodCheckNumberFormat",(t,e)=>{ce.init(t,e),e.format=e.format||"float64";let r=e.format?.includes("int"),o=r?"int":"number",[n,s]=ns[e.format];t._zod.onattach.push(i=>{let a=i._zod.bag;a.format=e.format,a.minimum=n,a.maximum=s,r&&(a.pattern=Qc)}),t._zod.check=i=>{let a=i.value;if(r){if(!Number.isInteger(a)){i.issues.push({expected:o,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:o,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:o,inclusive:!0,continue:!e.abort});return}}a<n&&i.issues.push({origin:"number",input:a,code:"too_small",minimum:n,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 au=g("$ZodCheckMaxLength",(t,e)=>{var r;ce.init(t,e),(r=t._zod.def).when??(r.when=o=>{let n=o.value;return!gr(n)&&n.length!==void 0}),t._zod.onattach.push(o=>{let n=o._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<n&&(o._zod.bag.maximum=e.maximum)}),t._zod.check=o=>{let n=o.value;if(n.length<=e.maximum)return;let i=yr(n);o.issues.push({origin:i,code:"too_big",maximum:e.maximum,inclusive:!0,input:n,inst:t,continue:!e.abort})}}),cu=g("$ZodCheckMinLength",(t,e)=>{var r;ce.init(t,e),(r=t._zod.def).when??(r.when=o=>{let n=o.value;return!gr(n)&&n.length!==void 0}),t._zod.onattach.push(o=>{let n=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>n&&(o._zod.bag.minimum=e.minimum)}),t._zod.check=o=>{let n=o.value;if(n.length>=e.minimum)return;let i=yr(n);o.issues.push({origin:i,code:"too_small",minimum:e.minimum,inclusive:!0,input:n,inst:t,continue:!e.abort})}}),uu=g("$ZodCheckLengthEquals",(t,e)=>{var r;ce.init(t,e),(r=t._zod.def).when??(r.when=o=>{let n=o.value;return!gr(n)&&n.length!==void 0}),t._zod.onattach.push(o=>{let n=o._zod.bag;n.minimum=e.length,n.maximum=e.length,n.length=e.length}),t._zod.check=o=>{let n=o.value,s=n.length;if(s===e.length)return;let i=yr(n),a=s>e.length;o.issues.push({origin:i,...a?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:o.value,inst:t,continue:!e.abort})}}),Sr=g("$ZodCheckStringFormat",(t,e)=>{var r,o;ce.init(t,e),t._zod.onattach.push(n=>{let s=n._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=n=>{e.pattern.lastIndex=0,!e.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:e.format,input:n.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(o=t._zod).check??(o.check=()=>{})}),lu=g("$ZodCheckRegex",(t,e)=>{Sr.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})}}),du=g("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=ru),Sr.init(t,e)}),pu=g("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=ou),Sr.init(t,e)}),fu=g("$ZodCheckIncludes",(t,e)=>{ce.init(t,e);let r=Qe(e.includes),o=new RegExp(typeof e.position=="number"?`^.{${e.position}}${r}`:r);e.pattern=o,t._zod.onattach.push(n=>{let s=n._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(o)}),t._zod.check=n=>{n.value.includes(e.includes,e.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:n.value,inst:t,continue:!e.abort})}}),mu=g("$ZodCheckStartsWith",(t,e)=>{ce.init(t,e);let r=new RegExp(`^${Qe(e.prefix)}.*`);e.pattern??(e.pattern=r),t._zod.onattach.push(o=>{let n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),t._zod.check=o=>{o.value.startsWith(e.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:o.value,inst:t,continue:!e.abort})}}),hu=g("$ZodCheckEndsWith",(t,e)=>{ce.init(t,e);let r=new RegExp(`.*${Qe(e.suffix)}$`);e.pattern??(e.pattern=r),t._zod.onattach.push(o=>{let n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),t._zod.check=o=>{o.value.endsWith(e.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:o.value,inst:t,continue:!e.abort})}});var gu=g("$ZodCheckOverwrite",(t,e)=>{ce.init(t,e),t._zod.check=r=>{r.value=e.tx(r.value)}});var To=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 o=e.split(`
18
+ `).filter(i=>i),n=Math.min(...o.map(i=>i.length-i.trimStart().length)),s=o.map(i=>i.slice(n)).map(i=>" ".repeat(this.indent*2)+i);for(let i of s)this.content.push(i)}compile(){let e=Function,r=this?.args,n=[...(this?.content??[""]).map(s=>` ${s}`)];return new e(...r,n.join(`
19
+ `))}};var yu={major:4,minor:4,patch:3};var K=g("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=yu;let o=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&o.unshift(t);for(let n of o)for(let s of n._zod.onattach)s(t);if(o.length===0)(r=t._zod).deferred??(r.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{let n=(i,a,c)=>{let u=lt(i),l;for(let d of a){if(d._zod.def.when){if(ss(i)||!d._zod.def.when(i))continue}else if(u)continue;let p=i.issues.length,f=d._zod.check(i);if(f instanceof Promise&&c?.async===!1)throw new Ve;if(l||f instanceof Promise)l=(l??Promise.resolve()).then(async()=>{await f,i.issues.length!==p&&(u||(u=lt(i,p)))});else{if(i.issues.length===p)continue;u||(u=lt(i,p))}}return l?l.then(()=>i):i},s=(i,a,c)=>{if(lt(i))return i.aborted=!0,i;let u=n(a,o,c);if(u instanceof Promise){if(c.async===!1)throw new Ve;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 Ve;return c.then(u=>n(u,o,a))}return n(c,o,a)}}U(t,"~standard",()=>({validate:n=>{try{let s=$r(t,n);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return ko(t,n).then(i=>i.success?{value:i.data}:{issues:i.error?.issues})}},vendor:"zod",version:1}))}),Io=g("$ZodString",(t,e)=>{K.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??Xc(t._zod.bag),t._zod.parse=(r,o)=>{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}}),G=g("$ZodStringFormat",(t,e)=>{Sr.init(t,e),Io.init(t,e)}),ku=g("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=Dc),G.init(t,e)}),Pu=g("$ZodUUID",(t,e)=>{if(e.version){let o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(o===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=cs(o))}else e.pattern??(e.pattern=cs());G.init(t,e)}),Tu=g("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=jc),G.init(t,e)}),Ou=g("$ZodURL",(t,e)=>{G.init(t,e),t._zod.check=r=>{try{let o=r.value.trim();if(!e.normalize&&e.protocol?.source===Hc.source&&!/^https?:\/\//i.test(o)){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:t,continue:!e.abort});return}let n=new URL(o);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(n.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(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.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=n.href:r.value=o;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:t,continue:!e.abort})}}}),Ru=g("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=Zc()),G.init(t,e)}),Iu=g("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=Cc),G.init(t,e)}),Au=g("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=Oc),G.init(t,e)}),Nu=g("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=Rc),G.init(t,e)}),Cu=g("$ZodULID",(t,e)=>{e.pattern??(e.pattern=Ic),G.init(t,e)}),Mu=g("$ZodXID",(t,e)=>{e.pattern??(e.pattern=Ac),G.init(t,e)}),Du=g("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=Nc),G.init(t,e)}),ju=g("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=Yc(e)),G.init(t,e)}),Zu=g("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=Gc),G.init(t,e)}),Lu=g("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=Bc(e)),G.init(t,e)}),qu=g("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=Mc),G.init(t,e)}),Uu=g("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=Lc),G.init(t,e),t._zod.bag.format="ipv4"}),Fu=g("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=qc),G.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 Vu=g("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=Uc),G.init(t,e)}),Hu=g("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=Fc),G.init(t,e),t._zod.check=r=>{let o=r.value.split("/");try{if(o.length!==2)throw new Error;let[n,s]=o;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://[${n}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:t,continue:!e.abort})}}});function Ju(t){if(t==="")return!0;if(/\s/.test(t)||t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}var Ku=g("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=Vc),G.init(t,e),t._zod.bag.contentEncoding="base64",t._zod.check=r=>{Ju(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:t,continue:!e.abort})}});function gg(t){if(!us.test(t))return!1;let e=t.replace(/[-_]/g,o=>o==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=");return Ju(r)}var Gu=g("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=us),G.init(t,e),t._zod.bag.contentEncoding="base64url",t._zod.check=r=>{gg(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:t,continue:!e.abort})}}),Wu=g("$ZodE164",(t,e)=>{e.pattern??(e.pattern=Jc),G.init(t,e)});function _g(t,e=null){try{let r=t.split(".");if(r.length!==3)return!1;let[o]=r;if(!o)return!1;let n=JSON.parse(atob(o));return!("typ"in n&&n?.typ!=="JWT"||!n.alg||e&&(!("alg"in n)||n.alg!==e))}catch{return!1}}var Bu=g("$ZodJWT",(t,e)=>{G.init(t,e),t._zod.check=r=>{_g(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:t,continue:!e.abort})}});var ms=g("$ZodNumber",(t,e)=>{K.init(t,e),t._zod.pattern=t._zod.bag.pattern??ls,t._zod.parse=(r,o)=>{if(e.coerce)try{r.value=Number(r.value)}catch{}let n=r.value;if(typeof n=="number"&&!Number.isNaN(n)&&Number.isFinite(n))return r;let s=typeof n=="number"?Number.isNaN(n)?"NaN":Number.isFinite(n)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:n,inst:t,...s?{received:s}:{}}),r}}),Yu=g("$ZodNumberFormat",(t,e)=>{iu.init(t,e),ms.init(t,e)}),Xu=g("$ZodBoolean",(t,e)=>{K.init(t,e),t._zod.pattern=eu,t._zod.parse=(r,o)=>{if(e.coerce)try{r.value=!!r.value}catch{}let n=r.value;return typeof n=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:t}),r}});var Qu=g("$ZodNull",(t,e)=>{K.init(t,e),t._zod.pattern=tu,t._zod.values=new Set([null]),t._zod.parse=(r,o)=>{let n=r.value;return n===null||r.issues.push({expected:"null",code:"invalid_type",input:n,inst:t}),r}});var el=g("$ZodUnknown",(t,e)=>{K.init(t,e),t._zod.parse=r=>r}),tl=g("$ZodNever",(t,e)=>{K.init(t,e),t._zod.parse=(r,o)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:t}),r)});function vu(t,e,r){t.issues.length&&e.issues.push(...et(r,t.issues)),e.value[r]=t.value}var rl=g("$ZodArray",(t,e)=>{K.init(t,e),t._zod.parse=(r,o)=>{let n=r.value;if(!Array.isArray(n))return r.issues.push({expected:"array",code:"invalid_type",input:n,inst:t}),r;r.value=Array(n.length);let s=[];for(let i=0;i<n.length;i++){let a=n[i],c=e.element._zod.run({value:a,issues:[]},o);c instanceof Promise?s.push(c.then(u=>vu(u,r,i))):vu(c,r,i)}return s.length?Promise.all(s).then(()=>r):r}});function Ro(t,e,r,o,n,s){let i=r in o;if(t.issues.length){if(n&&s&&!i)return;e.issues.push(...et(r,t.issues))}if(!i&&!n){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 ol(t){let e=Object.keys(t.shape);for(let o of e)if(!t.shape?.[o]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${o}": expected a Zod schema`);let r=os(t.shape);return{...t,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(r)}}function nl(t,e,r,o,n,s){let i=[],a=n.keySet,c=n.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 f=c.run({value:e[p],issues:[]},o);f instanceof Promise?t.push(f.then(m=>Ro(m,r,p,e,l,d))):Ro(f,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 yg=g("$ZodObject",(t,e)=>{if(K.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 o=Zt(()=>ol(e));U(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 n=wt,s=e.catchall,i;t._zod.parse=(a,c)=>{i??(i=o.value);let u=a.value;if(!n(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 f=d[p],m=f._zod.optin==="optional",_=f._zod.optout==="optional",y=f._zod.run({value:u[p],issues:[]},c);y instanceof Promise?l.push(y.then(v=>Ro(v,a,p,u,m,_))):Ro(y,a,p,u,m,_)}return s?nl(l,u,a,c,o.value,t):l.length?Promise.all(l).then(()=>a):a}}),sl=g("$ZodObjectJIT",(t,e)=>{yg.init(t,e);let r=t._zod.parse,o=Zt(()=>ol(e)),n=p=>{let f=new To(["shape","payload","ctx"]),m=o.value,_=S=>{let k=bo(S);return`shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`};f.write("const input = payload.value;");let y=Object.create(null),v=0;for(let S of m.keys)y[S]=`key_${v++}`;f.write("const newResult = {};");for(let S of m.keys){let k=y[S],w=bo(S),Ee=p[S],Oe=Ee?._zod?.optin==="optional",dr=Ee?._zod?.optout==="optional";f.write(`const ${k} = ${_(S)};`),Oe&&dr?f.write(`
20
+ if (${k}.issues.length) {
21
+ if (${w} in input) {
22
+ payload.issues = payload.issues.concat(${k}.issues.map(iss => ({
23
23
  ...iss,
24
- path: iss.path ? [${j}, ...iss.path] : [${j}]
24
+ path: iss.path ? [${w}, ...iss.path] : [${w}]
25
25
  })));
26
26
  }
27
27
  }
28
28
 
29
- if (${Z}.value === undefined) {
30
- if (${j} in input) {
31
- newResult[${j}] = undefined;
29
+ if (${k}.value === undefined) {
30
+ if (${w} in input) {
31
+ newResult[${w}] = undefined;
32
32
  }
33
33
  } else {
34
- newResult[${j}] = ${Z}.value;
34
+ newResult[${w}] = ${k}.value;
35
35
  }
36
36
 
37
- `):f.write(`
38
- if (${Z}.issues.length) {
39
- payload.issues = payload.issues.concat(${Z}.issues.map(iss => ({
37
+ `):Oe?f.write(`
38
+ if (${k}.issues.length) {
39
+ payload.issues = payload.issues.concat(${k}.issues.map(iss => ({
40
40
  ...iss,
41
- path: iss.path ? [${j}, ...iss.path] : [${j}]
41
+ path: iss.path ? [${w}, ...iss.path] : [${w}]
42
42
  })));
43
43
  }
44
44
 
45
- if (${Z}.value === undefined) {
46
- if (${j} in input) {
47
- newResult[${j}] = undefined;
45
+ if (${k}.value === undefined) {
46
+ if (${w} in input) {
47
+ newResult[${w}] = undefined;
48
48
  }
49
49
  } else {
50
- newResult[${j}] = ${Z}.value;
50
+ newResult[${w}] = ${k}.value;
51
51
  }
52
52
 
53
- `)}f.write("payload.value = newResult;"),f.write("return payload;");let O=f.compile();return(I,Z)=>O(m,I,Z)},i,a=pr,s=!di.jitless,u=s&&Zs.value,l=e.catchall,d;t._zod.parse=(m,f)=>{d??(d=n.value);let g=m.value;return a(g)?s&&u&&f?.async===!1&&f.jitless!==!0?(i||(i=o(e.shape)),m=i(m,f),l?Tm([],g,m,f,d,t):m):r(m,f):(m.issues.push({expected:"object",code:"invalid_type",input:g,inst:t}),m)}});function vm(t,e,r,n){for(let i of t)if(i.issues.length===0)return e.value=i.value,e;let o=t.filter(i=>!Bt(i));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(i=>i.issues.map(a=>Me(a,n,ye())))}),e)}var Yn=p("$ZodUnion",(t,e)=>{M.init(t,e),q(t._zod,"optin",()=>e.options.some(o=>o._zod.optin==="optional")?"optional":void 0),q(t._zod,"optout",()=>e.options.some(o=>o._zod.optout==="optional")?"optional":void 0),q(t._zod,"values",()=>{if(e.options.every(o=>o._zod.values))return new Set(e.options.flatMap(o=>Array.from(o._zod.values)))}),q(t._zod,"pattern",()=>{if(e.options.every(o=>o._zod.pattern)){let o=e.options.map(i=>i._zod.pattern);return new RegExp(`^(${o.map(i=>An(i.source)).join("|")})$`)}});let r=e.options.length===1,n=e.options[0]._zod.run;t._zod.parse=(o,i)=>{if(r)return n(o,i);let a=!1,s=[];for(let c of e.options){let u=c._zod.run({value:o.value,issues:[]},i);if(u instanceof Promise)s.push(u),a=!0;else{if(u.issues.length===0)return u;s.push(u)}}return a?Promise.all(s).then(c=>vm(c,o,t,i)):vm(s,o,t,i)}});function _m(t,e,r,n){let o=t.filter(i=>i.issues.length===0);return o.length===1?(e.value=o[0].value,e):(o.length===0?e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(i=>i.issues.map(a=>Me(a,n,ye())))}):e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:[],inclusive:!1}),e)}var nu=p("$ZodXor",(t,e)=>{Yn.init(t,e),e.inclusive=!1;let r=e.options.length===1,n=e.options[0]._zod.run;t._zod.parse=(o,i)=>{if(r)return n(o,i);let a=!1,s=[];for(let c of e.options){let u=c._zod.run({value:o.value,issues:[]},i);u instanceof Promise?(s.push(u),a=!0):s.push(u)}return a?Promise.all(s).then(c=>_m(c,o,t,i)):_m(s,o,t,i)}}),ou=p("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,Yn.init(t,e);let r=t._zod.parse;q(t._zod,"propValues",()=>{let o={};for(let i of e.options){let a=i._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(i)}"`);for(let[s,c]of Object.entries(a)){o[s]||(o[s]=new Set);for(let u of c)o[s].add(u)}}return o});let n=Fr(()=>{let o=e.options,i=new Map;for(let a of o){let s=a._zod.propValues?.[e.discriminator];if(!s||s.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(a)}"`);for(let c of s){if(i.has(c))throw new Error(`Duplicate discriminator value "${String(c)}"`);i.set(c,a)}}return i});t._zod.parse=(o,i)=>{let a=o.value;if(!pr(a))return o.issues.push({code:"invalid_type",expected:"object",input:a,inst:t}),o;let s=n.value.get(a?.[e.discriminator]);return s?s._zod.run(o,i):e.unionFallback?r(o,i):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,input:a,path:[e.discriminator],inst:t}),o)}}),iu=p("$ZodIntersection",(t,e)=>{M.init(t,e),t._zod.parse=(r,n)=>{let o=r.value,i=e.left._zod.run({value:o,issues:[]},n),a=e.right._zod.run({value:o,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([c,u])=>ym(r,c,u)):ym(r,i,a)}});function $c(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(Gt(t)&&Gt(e)){let r=Object.keys(e),n=Object.keys(t).filter(i=>r.indexOf(i)!==-1),o={...t,...e};for(let i of n){let a=$c(t[i],e[i]);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};o[i]=a.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],i=e[n],a=$c(o,i);if(!a.valid)return{valid:!1,mergeErrorPath:[n,...a.mergeErrorPath]};r.push(a.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function ym(t,e,r){let n=new Map,o;for(let s of e.issues)if(s.code==="unrecognized_keys"){o??(o=s);for(let c of s.keys)n.has(c)||n.set(c,{}),n.get(c).l=!0}else t.issues.push(s);for(let s of r.issues)if(s.code==="unrecognized_keys")for(let c of s.keys)n.has(c)||n.set(c,{}),n.get(c).r=!0;else t.issues.push(s);let i=[...n].filter(([,s])=>s.l&&s.r).map(([s])=>s);if(i.length&&o&&t.issues.push({...o,keys:i}),Bt(t))return t;let a=$c(e.value,r.value);if(!a.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return t.value=a.data,t}var Ii=p("$ZodTuple",(t,e)=>{M.init(t,e);let r=e.items;t._zod.parse=(n,o)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({input:i,inst:t,expected:"tuple",code:"invalid_type"}),n;n.value=[];let a=[],s=[...r].reverse().findIndex(l=>l._zod.optin!=="optional"),c=s===-1?0:r.length-s;if(!e.rest){let l=i.length>r.length,d=i.length<c-1;if(l||d)return n.issues.push({...l?{code:"too_big",maximum:r.length,inclusive:!0}:{code:"too_small",minimum:r.length},input:i,inst:t,origin:"array"}),n}let u=-1;for(let l of r){if(u++,u>=i.length&&u>=c)continue;let d=l._zod.run({value:i[u],issues:[]},o);d instanceof Promise?a.push(d.then(m=>$i(m,n,u))):$i(d,n,u)}if(e.rest){let l=i.slice(r.length);for(let d of l){u++;let m=e.rest._zod.run({value:d,issues:[]},o);m instanceof Promise?a.push(m.then(f=>$i(f,n,u))):$i(m,n,u)}}return a.length?Promise.all(a).then(()=>n):n}});function $i(t,e,r){t.issues.length&&e.issues.push(...He(r,t.issues)),e.value[r]=t.value}var au=p("$ZodRecord",(t,e)=>{M.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!Gt(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:t}),r;let i=[],a=e.keyType._zod.values;if(a){r.value={};let s=new Set;for(let u of a)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){s.add(typeof u=="number"?u.toString():u);let l=e.valueType._zod.run({value:o[u],issues:[]},n);l instanceof Promise?i.push(l.then(d=>{d.issues.length&&r.issues.push(...He(u,d.issues)),r.value[u]=d.value})):(l.issues.length&&r.issues.push(...He(u,l.issues)),r.value[u]=l.value)}let c;for(let u in o)s.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 s of Reflect.ownKeys(o)){if(s==="__proto__")continue;let c=e.keyType._zod.run({value:s,issues:[]},n);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof s=="string"&&_i.test(s)&&c.issues.length){let d=e.keyType._zod.run({value:Number(s),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[s]=o[s]:r.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(d=>Me(d,n,ye())),input:s,path:[s],inst:t});continue}let l=e.valueType._zod.run({value:o[s],issues:[]},n);l instanceof Promise?i.push(l.then(d=>{d.issues.length&&r.issues.push(...He(s,d.issues)),r.value[c.value]=d.value})):(l.issues.length&&r.issues.push(...He(s,l.issues)),r.value[c.value]=l.value)}}return i.length?Promise.all(i).then(()=>r):r}}),su=p("$ZodMap",(t,e)=>{M.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!(o instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:o,inst:t}),r;let i=[];r.value=new Map;for(let[a,s]of o){let c=e.keyType._zod.run({value:a,issues:[]},n),u=e.valueType._zod.run({value:s,issues:[]},n);c instanceof Promise||u instanceof Promise?i.push(Promise.all([c,u]).then(([l,d])=>{$m(l,d,r,a,o,t,n)})):$m(c,u,r,a,o,t,n)}return i.length?Promise.all(i).then(()=>r):r}});function $m(t,e,r,n,o,i,a){t.issues.length&&(Un.has(typeof n)?r.issues.push(...He(n,t.issues)):r.issues.push({code:"invalid_key",origin:"map",input:o,inst:i,issues:t.issues.map(s=>Me(s,a,ye()))})),e.issues.length&&(Un.has(typeof n)?r.issues.push(...He(n,e.issues)):r.issues.push({origin:"map",code:"invalid_element",input:o,inst:i,key:n,issues:e.issues.map(s=>Me(s,a,ye()))})),r.value.set(t.value,e.value)}var cu=p("$ZodSet",(t,e)=>{M.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!(o instanceof Set))return r.issues.push({input:o,inst:t,expected:"set",code:"invalid_type"}),r;let i=[];r.value=new Set;for(let a of o){let s=e.valueType._zod.run({value:a,issues:[]},n);s instanceof Promise?i.push(s.then(c=>bm(c,r))):bm(s,r)}return i.length?Promise.all(i).then(()=>r):r}});function bm(t,e){t.issues.length&&e.issues.push(...t.issues),e.value.add(t.value)}var uu=p("$ZodEnum",(t,e)=>{M.init(t,e);let r=Rn(e.entries),n=new Set(r);t._zod.values=n,t._zod.pattern=new RegExp(`^(${r.filter(o=>Un.has(typeof o)).map(o=>typeof o=="string"?Ye(o):o.toString()).join("|")})$`),t._zod.parse=(o,i)=>{let a=o.value;return n.has(a)||o.issues.push({code:"invalid_value",values:r,input:a,inst:t}),o}}),lu=p("$ZodLiteral",(t,e)=>{if(M.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"?Ye(n):n?Ye(n.toString()):String(n)).join("|")})$`),t._zod.parse=(n,o)=>{let i=n.value;return r.has(i)||n.issues.push({code:"invalid_value",values:e.values,input:i,inst:t}),n}}),du=p("$ZodFile",(t,e)=>{M.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;return o instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:o,inst:t}),r}}),pu=p("$ZodTransform",(t,e)=>{M.init(t,e),t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new dr(t.constructor.name);let o=e.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(a=>(r.value=a,r));if(o instanceof Promise)throw new vt;return r.value=o,r}});function xm(t,e){return t.issues.length&&e===void 0?{issues:[],value:void 0}:t}var Ei=p("$ZodOptional",(t,e)=>{M.init(t,e),t._zod.optin="optional",t._zod.optout="optional",q(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),q(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${An(r.source)})?$`):void 0}),t._zod.parse=(r,n)=>{if(e.innerType._zod.optin==="optional"){let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>xm(i,r.value)):xm(o,r.value)}return r.value===void 0?r:e.innerType._zod.run(r,n)}}),fu=p("$ZodExactOptional",(t,e)=>{Ei.init(t,e),q(t._zod,"values",()=>e.innerType._zod.values),q(t._zod,"pattern",()=>e.innerType._zod.pattern),t._zod.parse=(r,n)=>e.innerType._zod.run(r,n)}),mu=p("$ZodNullable",(t,e)=>{M.init(t,e),q(t._zod,"optin",()=>e.innerType._zod.optin),q(t._zod,"optout",()=>e.innerType._zod.optout),q(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${An(r.source)}|null)$`):void 0}),q(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)}),hu=p("$ZodDefault",(t,e)=>{M.init(t,e),t._zod.optin="optional",q(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(i=>km(i,e)):km(o,e)}});function km(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}var gu=p("$ZodPrefault",(t,e)=>{M.init(t,e),t._zod.optin="optional",q(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))}),vu=p("$ZodNonOptional",(t,e)=>{M.init(t,e),q(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(i=>Sm(i,t)):Sm(o,t)}});function Sm(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 _u=p("$ZodSuccess",(t,e)=>{M.init(t,e),t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new dr("ZodSuccess");let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>(r.value=i.issues.length===0,r)):(r.value=o.issues.length===0,r)}}),yu=p("$ZodCatch",(t,e)=>{M.init(t,e),q(t._zod,"optin",()=>e.innerType._zod.optin),q(t._zod,"optout",()=>e.innerType._zod.optout),q(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(i=>(r.value=i.value,i.issues.length&&(r.value=e.catchValue({...r,error:{issues:i.issues.map(a=>Me(a,n,ye()))},input:r.value}),r.issues=[]),r)):(r.value=o.value,o.issues.length&&(r.value=e.catchValue({...r,error:{issues:o.issues.map(i=>Me(i,n,ye()))},input:r.value}),r.issues=[]),r)}}),$u=p("$ZodNaN",(t,e)=>{M.init(t,e),t._zod.parse=(r,n)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:t,expected:"nan",code:"invalid_type"}),r)}),bu=p("$ZodPipe",(t,e)=>{M.init(t,e),q(t._zod,"values",()=>e.in._zod.values),q(t._zod,"optin",()=>e.in._zod.optin),q(t._zod,"optout",()=>e.out._zod.optout),q(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(r,n)=>{if(n.direction==="backward"){let i=e.out._zod.run(r,n);return i instanceof Promise?i.then(a=>bi(a,e.in,n)):bi(i,e.in,n)}let o=e.in._zod.run(r,n);return o instanceof Promise?o.then(i=>bi(i,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},r)}var Qn=p("$ZodCodec",(t,e)=>{M.init(t,e),q(t._zod,"values",()=>e.in._zod.values),q(t._zod,"optin",()=>e.in._zod.optin),q(t._zod,"optout",()=>e.out._zod.optout),q(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(r,n)=>{if((n.direction||"forward")==="forward"){let i=e.in._zod.run(r,n);return i instanceof Promise?i.then(a=>xi(a,e,n)):xi(i,e,n)}else{let i=e.out._zod.run(r,n);return i instanceof Promise?i.then(a=>xi(a,e,n)):xi(i,e,n)}}});function xi(t,e,r){if(t.issues.length)return t.aborted=!0,t;if((r.direction||"forward")==="forward"){let o=e.transform(t.value,t);return o instanceof Promise?o.then(i=>ki(t,i,e.out,r)):ki(t,o,e.out,r)}else{let o=e.reverseTransform(t.value,t);return o instanceof Promise?o.then(i=>ki(t,i,e.in,r)):ki(t,o,e.in,r)}}function ki(t,e,r,n){return t.issues.length?(t.aborted=!0,t):r._zod.run({value:e,issues:t.issues},n)}var xu=p("$ZodReadonly",(t,e)=>{M.init(t,e),q(t._zod,"propValues",()=>e.innerType._zod.propValues),q(t._zod,"values",()=>e.innerType._zod.values),q(t._zod,"optin",()=>e.innerType?._zod?.optin),q(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(wm):wm(o)}});function wm(t){return t.value=Object.freeze(t.value),t}var ku=p("$ZodTemplateLiteral",(t,e)=>{M.init(t,e);let r=[];for(let n of e.parts)if(typeof n=="object"&&n!==null){if(!n._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...n._zod.traits].shift()}`);let o=n._zod.pattern instanceof RegExp?n._zod.pattern.source:n._zod.pattern;if(!o)throw new Error(`Invalid template literal part: ${n._zod.traits}`);let i=o.startsWith("^")?1:0,a=o.endsWith("$")?o.length-1:o.length;r.push(o.slice(i,a))}else if(n===null||Ms.has(typeof n))r.push(Ye(`${n}`));else throw new Error(`Invalid template literal part: ${n}`);t._zod.pattern=new RegExp(`^${r.join("")}$`),t._zod.parse=(n,o)=>typeof n.value!="string"?(n.issues.push({input:n.value,inst:t,expected:"string",code:"invalid_type"}),n):(t._zod.pattern.lastIndex=0,t._zod.pattern.test(n.value)||n.issues.push({input:n.value,inst:t,code:"invalid_format",format:e.format??"template_literal",pattern:t._zod.pattern.source}),n)}),Su=p("$ZodFunction",(t,e)=>(M.init(t,e),t._def=e,t._zod.def=e,t.implement=r=>{if(typeof r!="function")throw new Error("implement() must be called with a function");return function(...n){let o=t._def.input?qn(t._def.input,n):n,i=Reflect.apply(r,this,o);return t._def.output?qn(t._def.output,i):i}},t.implementAsync=r=>{if(typeof r!="function")throw new Error("implementAsync() must be called with a function");return async function(...n){let o=t._def.input?await Vn(t._def.input,n):n,i=await Reflect.apply(r,this,o);return t._def.output?await Vn(t._def.output,i):i}},t._zod.parse=(r,n)=>typeof r.value!="function"?(r.issues.push({code:"invalid_type",expected:"function",input:r.value,inst:t}),r):(t._def.output&&t._def.output._zod.def.type==="promise"?r.value=t.implementAsync(r.value):r.value=t.implement(r.value),r),t.input=(...r)=>{let n=t.constructor;return Array.isArray(r[0])?new n({type:"function",input:new Ii({type:"tuple",items:r[0],rest:r[1]}),output:t._def.output}):new n({type:"function",input:r[0],output:t._def.output})},t.output=r=>{let n=t.constructor;return new n({type:"function",input:t._def.input,output:r})},t)),wu=p("$ZodPromise",(t,e)=>{M.init(t,e),t._zod.parse=(r,n)=>Promise.resolve(r.value).then(o=>e.innerType._zod.run({value:o,issues:[]},n))}),zu=p("$ZodLazy",(t,e)=>{M.init(t,e),q(t._zod,"innerType",()=>e.getter()),q(t._zod,"pattern",()=>t._zod.innerType?._zod?.pattern),q(t._zod,"propValues",()=>t._zod.innerType?._zod?.propValues),q(t._zod,"optin",()=>t._zod.innerType?._zod?.optin??void 0),q(t._zod,"optout",()=>t._zod.innerType?._zod?.optout??void 0),t._zod.parse=(r,n)=>t._zod.innerType._zod.run(r,n)}),Iu=p("$ZodCustom",(t,e)=>{se.init(t,e),M.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(i=>zm(i,r,n,t));zm(o,r,n,t)}});function zm(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(Vr(o))}}var yb=()=>{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 i=n[o.expected]??o.expected,a=U(o.input),s=n[a]??a;return`Invalid input: expected ${i}, received ${s}`}case"invalid_value":return o.values.length===1?`Invalid input: expected ${R(o.values[0])}`:`Invalid option: expected one of ${N(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",a=e(o.origin);return a?`Too big: expected ${o.origin??"value"} to have ${i}${o.maximum.toString()} ${a.unit??"elements"}`:`Too big: expected ${o.origin??"value"} to be ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",a=e(o.origin);return a?`Too small: expected ${o.origin} to have ${i}${o.minimum.toString()} ${a.unit}`:`Too small: expected ${o.origin} to be ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;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]??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":""}: ${N(o.keys,", ")}`;case"invalid_key":return`Invalid key in ${o.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${o.origin}`;default:return"Invalid input"}}};function Eu(){return{localeError:yb()}}var jm;var Pu=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 Ou(){return new Pu}(jm=globalThis).__zod_globalRegistry??(jm.__zod_globalRegistry=Ou());var Re=globalThis.__zod_globalRegistry;function ju(t,e){return new t({type:"string",...x(e)})}function Ti(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...x(e)})}function eo(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...x(e)})}function Pi(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...x(e)})}function Oi(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...x(e)})}function ji(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...x(e)})}function Di(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...x(e)})}function to(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...x(e)})}function Ni(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...x(e)})}function Ri(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...x(e)})}function Ai(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...x(e)})}function Ui(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...x(e)})}function Zi(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...x(e)})}function Ci(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...x(e)})}function Mi(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...x(e)})}function Li(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...x(e)})}function qi(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...x(e)})}function Du(t,e){return new t({type:"string",format:"mac",check:"string_format",abort:!1,...x(e)})}function Fi(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...x(e)})}function Vi(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...x(e)})}function Ji(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...x(e)})}function Ki(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...x(e)})}function Hi(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...x(e)})}function Wi(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...x(e)})}function Nu(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...x(e)})}function Ru(t,e){return new t({type:"string",format:"date",check:"string_format",...x(e)})}function Au(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...x(e)})}function Uu(t,e){return new t({type:"string",format:"duration",check:"string_format",...x(e)})}function Zu(t,e){return new t({type:"number",checks:[],...x(e)})}function Cu(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...x(e)})}function Mu(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float32",...x(e)})}function Lu(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float64",...x(e)})}function qu(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"int32",...x(e)})}function Fu(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"uint32",...x(e)})}function Vu(t,e){return new t({type:"boolean",...x(e)})}function Ju(t,e){return new t({type:"bigint",...x(e)})}function Ku(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...x(e)})}function Hu(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...x(e)})}function Wu(t,e){return new t({type:"symbol",...x(e)})}function Gu(t,e){return new t({type:"undefined",...x(e)})}function Bu(t,e){return new t({type:"null",...x(e)})}function Xu(t){return new t({type:"any"})}function Yu(t){return new t({type:"unknown"})}function Qu(t,e){return new t({type:"never",...x(e)})}function el(t,e){return new t({type:"void",...x(e)})}function tl(t,e){return new t({type:"date",...x(e)})}function rl(t,e){return new t({type:"nan",...x(e)})}function jt(t,e){return new _c({check:"less_than",...x(e),value:t,inclusive:!1})}function We(t,e){return new _c({check:"less_than",...x(e),value:t,inclusive:!0})}function Dt(t,e){return new yc({check:"greater_than",...x(e),value:t,inclusive:!1})}function Ae(t,e){return new yc({check:"greater_than",...x(e),value:t,inclusive:!0})}function nl(t){return Dt(0,t)}function ol(t){return jt(0,t)}function il(t){return We(0,t)}function al(t){return Ae(0,t)}function hr(t,e){return new Bf({check:"multiple_of",...x(e),value:t})}function gr(t,e){return new Qf({check:"max_size",...x(e),maximum:t})}function Nt(t,e){return new em({check:"min_size",...x(e),minimum:t})}function Kr(t,e){return new tm({check:"size_equals",...x(e),size:t})}function Hr(t,e){return new rm({check:"max_length",...x(e),maximum:t})}function Xt(t,e){return new nm({check:"min_length",...x(e),minimum:t})}function Wr(t,e){return new om({check:"length_equals",...x(e),length:t})}function ro(t,e){return new im({check:"string_format",format:"regex",...x(e),pattern:t})}function no(t){return new am({check:"string_format",format:"lowercase",...x(t)})}function oo(t){return new sm({check:"string_format",format:"uppercase",...x(t)})}function io(t,e){return new cm({check:"string_format",format:"includes",...x(e),includes:t})}function ao(t,e){return new um({check:"string_format",format:"starts_with",...x(e),prefix:t})}function so(t,e){return new lm({check:"string_format",format:"ends_with",...x(e),suffix:t})}function sl(t,e,r){return new dm({check:"property",property:t,schema:e,...x(r)})}function co(t,e){return new pm({check:"mime_type",mime:t,...x(e)})}function _t(t){return new fm({check:"overwrite",tx:t})}function uo(t){return _t(e=>e.normalize(t))}function lo(){return _t(t=>t.trim())}function po(){return _t(t=>t.toLowerCase())}function fo(){return _t(t=>t.toUpperCase())}function Gi(){return _t(t=>Us(t))}function Dm(t,e,r){return new t({type:"array",element:e,...x(r)})}function cl(t,e){return new t({type:"file",...x(e)})}function ul(t,e,r){let n=x(r);return n.abort??(n.abort=!0),new t({type:"custom",check:"custom",fn:e,...n})}function ll(t,e,r){return new t({type:"custom",check:"custom",fn:e,...x(r)})}function dl(t){let e=kb(r=>(r.addIssue=n=>{if(typeof n=="string")r.issues.push(Vr(n,r.value,e._zod.def));else{let o=n;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=r.value),o.inst??(o.inst=e),o.continue??(o.continue=!e._zod.def.abort),r.issues.push(Vr(o))}},t(r.value,r)));return e}function kb(t,e){let r=new se({check:"custom",...x(e)});return r._zod.check=t,r}function pl(t){let e=new se({check:"describe"});return e._zod.onattach=[r=>{let n=Re.get(r)??{};Re.add(r,{...n,description:t})}],e._zod.check=()=>{},e}function fl(t){let e=new se({check:"meta"});return e._zod.onattach=[r=>{let n=Re.get(r)??{};Re.add(r,{...n,...t})}],e._zod.check=()=>{},e}function ml(t,e){let r=x(e),n=r.truthy??["true","1","yes","on","y","enabled"],o=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(n=n.map(f=>typeof f=="string"?f.toLowerCase():f),o=o.map(f=>typeof f=="string"?f.toLowerCase():f));let i=new Set(n),a=new Set(o),s=t.Codec??Qn,c=t.Boolean??Xn,u=t.String??mr,l=new u({type:"string",error:r.error}),d=new c({type:"boolean",error:r.error}),m=new s({type:"pipe",in:l,out:d,transform:((f,g)=>{let v=f;return r.case!=="sensitive"&&(v=v.toLowerCase()),i.has(v)?!0:a.has(v)?!1:(g.issues.push({code:"invalid_value",expected:"stringbool",values:[...i,...a],input:g.value,inst:m,continue:!1}),{})}),reverseTransform:((f,g)=>f===!0?n[0]||"true":o[0]||"false"),error:r.error});return m}function Gr(t,e,r,n={}){let o=x(n),i={...x(n),check:"string_format",type:"string",format:e,fn:typeof r=="function"?r:s=>r.test(s),...o};return r instanceof RegExp&&(i.pattern=r),new t(i)}function Bi(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??Re,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 de(t,e,r={path:[],schemaPath:[]}){var n;let o=t._zod.def,i=e.seen.get(t);if(i)return i.count++,r.schemaPath.includes(t)&&(i.cycle=r.path),i.schema;let a={schema:{},count:1,cycle:void 0,path:r.path};e.seen.set(t,a);let s=t._zod.toJSONSchema?.();if(s)a.schema=s;else{let l={...r,schemaPath:[...r.schemaPath,t],path:r.path};if(t._zod.processJSONSchema)t._zod.processJSONSchema(e,a.schema,l);else{let m=a.schema,f=e.processors[o.type];if(!f)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);f(t,e,m,l)}let d=t._zod.parent;d&&(a.ref||(a.ref=d),de(d,e,l),e.seen.get(d).isParent=!0)}let c=e.metadataRegistry.get(t);return c&&Object.assign(a.schema,c),e.io==="input"&&Ue(t)&&(delete a.schema.examples,delete a.schema.default),e.io==="input"&&a.schema._prefault&&((n=a.schema).default??(n.default=a.schema._prefault)),delete a.schema._prefault,e.seen.get(t).schema}function Xi(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 a of t.seen.entries()){let s=t.metadataRegistry.get(a[0])?.id;if(s){let c=n.get(s);if(c&&c!==a[0])throw new Error(`Duplicate schema id "${s}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(s,a[0])}}let o=a=>{let s=t.target==="draft-2020-12"?"$defs":"definitions";if(t.external){let d=t.external.registry.get(a[0])?.id,m=t.external.uri??(g=>g);if(d)return{ref:m(d)};let f=a[1].defId??a[1].schema.id??`schema${t.counter++}`;return a[1].defId=f,{defId:f,ref:`${m("__shared")}#/${s}/${f}`}}if(a[1]===r)return{ref:"#"};let u=`#/${s}/`,l=a[1].schema.id??`__schema${t.counter++}`;return{defId:l,ref:u+l}},i=a=>{if(a[1].schema.$ref)return;let s=a[1],{ref:c,defId:u}=o(a);s.def={...s.schema},u&&(s.defId=u);let l=s.schema;for(let d in l)delete l[d];l.$ref=c};if(t.cycles==="throw")for(let a of t.seen.entries()){let s=a[1];if(s.cycle)throw new Error(`Cycle detected: #/${s.cycle?.join("/")}/<root>
53
+ `):f.write(`
54
+ const ${k}_present = ${w} in input;
55
+ if (${k}.issues.length) {
56
+ payload.issues = payload.issues.concat(${k}.issues.map(iss => ({
57
+ ...iss,
58
+ path: iss.path ? [${w}, ...iss.path] : [${w}]
59
+ })));
60
+ }
61
+ if (!${k}_present && !${k}.issues.length) {
62
+ payload.issues.push({
63
+ code: "invalid_type",
64
+ expected: "nonoptional",
65
+ input: undefined,
66
+ path: [${w}]
67
+ });
68
+ }
69
+
70
+ if (${k}_present) {
71
+ if (${k}.value === undefined) {
72
+ newResult[${w}] = undefined;
73
+ } else {
74
+ newResult[${w}] = ${k}.value;
75
+ }
76
+ }
77
+
78
+ `)}f.write("payload.value = newResult;"),f.write("return payload;");let E=f.compile();return(S,k)=>E(p,S,k)},s,i=wt,a=!Dt.jitless,u=a&&ts.value,l=e.catchall,d;t._zod.parse=(p,f)=>{d??(d=o.value);let m=p.value;return i(m)?a&&u&&f?.async===!1&&f.jitless!==!0?(s||(s=n(e.shape)),p=s(p,f),l?nl([],m,p,f,d,t):p):r(p,f):(p.issues.push({expected:"object",code:"invalid_type",input:m,inst:t}),p)}});function $u(t,e,r,o){for(let s of t)if(s.issues.length===0)return e.value=s.value,e;let n=t.filter(s=>!lt(s));return n.length===1?(e.value=n[0].value,n[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(s=>s.issues.map(i=>Re(i,o,ke())))}),e)}var hs=g("$ZodUnion",(t,e)=>{K.init(t,e),U(t._zod,"optin",()=>e.options.some(o=>o._zod.optin==="optional")?"optional":void 0),U(t._zod,"optout",()=>e.options.some(o=>o._zod.optout==="optional")?"optional":void 0),U(t._zod,"values",()=>{if(e.options.every(o=>o._zod.values))return new Set(e.options.flatMap(o=>Array.from(o._zod.values)))}),U(t._zod,"pattern",()=>{if(e.options.every(o=>o._zod.pattern)){let o=e.options.map(n=>n._zod.pattern);return new RegExp(`^(${o.map(n=>_r(n.source)).join("|")})$`)}});let r=e.options.length===1?e.options[0]._zod.run:null;t._zod.parse=(o,n)=>{if(r)return r(o,n);let s=!1,i=[];for(let a of e.options){let c=a._zod.run({value:o.value,issues:[]},n);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=>$u(a,o,t,n)):$u(i,o,t,n)}});var il=g("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,hs.init(t,e);let r=t._zod.parse;U(t._zod,"propValues",()=>{let n={};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)){n[a]||(n[a]=new Set);for(let u of c)n[a].add(u)}}return n});let o=Zt(()=>{let n=e.options,s=new Map;for(let i of n){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=(n,s)=>{let i=n.value;if(!wt(i))return n.issues.push({code:"invalid_type",expected:"object",input:i,inst:t}),n;let a=o.value.get(i?.[e.discriminator]);return a?a._zod.run(n,s):e.unionFallback||s.direction==="backward"?r(n,s):(n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,options:Array.from(o.value.keys()),input:i,path:[e.discriminator],inst:t}),n)}}),al=g("$ZodIntersection",(t,e)=>{K.init(t,e),t._zod.parse=(r,o)=>{let n=r.value,s=e.left._zod.run({value:n,issues:[]},o),i=e.right._zod.run({value:n,issues:[]},o);return s instanceof Promise||i instanceof Promise?Promise.all([s,i]).then(([c,u])=>bu(r,c,u)):bu(r,s,i)}});function fs(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(ut(t)&&ut(e)){let r=Object.keys(e),o=Object.keys(t).filter(s=>r.indexOf(s)!==-1),n={...t,...e};for(let s of o){let i=fs(t[s],e[s]);if(!i.valid)return{valid:!1,mergeErrorPath:[s,...i.mergeErrorPath]};n[s]=i.data}return{valid:!0,data:n}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let o=0;o<t.length;o++){let n=t[o],s=e[o],i=fs(n,s);if(!i.valid)return{valid:!1,mergeErrorPath:[o,...i.mergeErrorPath]};r.push(i.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function bu(t,e,r){let o=new Map,n;for(let a of e.issues)if(a.code==="unrecognized_keys"){n??(n=a);for(let c of a.keys)o.has(c)||o.set(c,{}),o.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)o.has(c)||o.set(c,{}),o.get(c).r=!0;else t.issues.push(a);let s=[...o].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(s.length&&n&&t.issues.push({...n,keys:s}),lt(t))return t;let i=fs(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 cl=g("$ZodRecord",(t,e)=>{K.init(t,e),t._zod.parse=(r,o)=>{let n=r.value;if(!ut(n))return r.issues.push({expected:"record",code:"invalid_type",input:n,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:[]},o);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(f=>Re(f,o,ke())),input:u,path:[u],inst:t});continue}let d=l.value,p=e.valueType._zod.run({value:n[u],issues:[]},o);p instanceof Promise?s.push(p.then(f=>{f.issues.length&&r.issues.push(...et(u,f.issues)),r.value[d]=f.value})):(p.issues.length&&r.issues.push(...et(u,p.issues)),r.value[d]=p.value)}let c;for(let u in n)a.has(u)||(c=c??[],c.push(u));c&&c.length>0&&r.issues.push({code:"unrecognized_keys",input:n,inst:t,keys:c})}else{r.value={};for(let a of Reflect.ownKeys(n)){if(a==="__proto__"||!Object.prototype.propertyIsEnumerable.call(n,a))continue;let c=e.keyType._zod.run({value:a,issues:[]},o);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&ls.test(a)&&c.issues.length){let d=e.keyType._zod.run({value:Number(a),issues:[]},o);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]=n[a]:r.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(d=>Re(d,o,ke())),input:a,path:[a],inst:t});continue}let l=e.valueType._zod.run({value:n[a],issues:[]},o);l instanceof Promise?s.push(l.then(d=>{d.issues.length&&r.issues.push(...et(a,d.issues)),r.value[c.value]=d.value})):(l.issues.length&&r.issues.push(...et(a,l.issues)),r.value[c.value]=l.value)}}return s.length?Promise.all(s).then(()=>r):r}});var ul=g("$ZodEnum",(t,e)=>{K.init(t,e);let r=hr(e.entries),o=new Set(r);t._zod.values=o,t._zod.pattern=new RegExp(`^(${r.filter(n=>rs.has(typeof n)).map(n=>typeof n=="string"?Qe(n):n.toString()).join("|")})$`),t._zod.parse=(n,s)=>{let i=n.value;return o.has(i)||n.issues.push({code:"invalid_value",values:r,input:i,inst:t}),n}}),ll=g("$ZodLiteral",(t,e)=>{if(K.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(o=>typeof o=="string"?Qe(o):o?Qe(o.toString()):String(o)).join("|")})$`),t._zod.parse=(o,n)=>{let s=o.value;return r.has(s)||o.issues.push({code:"invalid_value",values:e.values,input:s,inst:t}),o}});var dl=g("$ZodTransform",(t,e)=>{K.init(t,e),t._zod.optin="optional",t._zod.parse=(r,o)=>{if(o.direction==="backward")throw new Mt(t.constructor.name);let n=e.transform(r.value,r);if(o.async)return(n instanceof Promise?n:Promise.resolve(n)).then(i=>(r.value=i,r.fallback=!0,r));if(n instanceof Promise)throw new Ve;return r.value=n,r.fallback=!0,r}});function Su(t,e){return e===void 0&&(t.issues.length||t.fallback)?{issues:[],value:void 0}:t}var gs=g("$ZodOptional",(t,e)=>{K.init(t,e),t._zod.optin="optional",t._zod.optout="optional",U(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),U(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${_r(r.source)})?$`):void 0}),t._zod.parse=(r,o)=>{if(e.innerType._zod.optin==="optional"){let n=r.value,s=e.innerType._zod.run(r,o);return s instanceof Promise?s.then(i=>Su(i,n)):Su(s,n)}return r.value===void 0?r:e.innerType._zod.run(r,o)}}),pl=g("$ZodExactOptional",(t,e)=>{gs.init(t,e),U(t._zod,"values",()=>e.innerType._zod.values),U(t._zod,"pattern",()=>e.innerType._zod.pattern),t._zod.parse=(r,o)=>e.innerType._zod.run(r,o)}),fl=g("$ZodNullable",(t,e)=>{K.init(t,e),U(t._zod,"optin",()=>e.innerType._zod.optin),U(t._zod,"optout",()=>e.innerType._zod.optout),U(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${_r(r.source)}|null)$`):void 0}),U(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),t._zod.parse=(r,o)=>r.value===null?r:e.innerType._zod.run(r,o)}),ml=g("$ZodDefault",(t,e)=>{K.init(t,e),t._zod.optin="optional",U(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,o)=>{if(o.direction==="backward")return e.innerType._zod.run(r,o);if(r.value===void 0)return r.value=e.defaultValue,r;let n=e.innerType._zod.run(r,o);return n instanceof Promise?n.then(s=>wu(s,e)):wu(n,e)}});function wu(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}var hl=g("$ZodPrefault",(t,e)=>{K.init(t,e),t._zod.optin="optional",U(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,o)=>(o.direction==="backward"||r.value===void 0&&(r.value=e.defaultValue),e.innerType._zod.run(r,o))}),gl=g("$ZodNonOptional",(t,e)=>{K.init(t,e),U(t._zod,"values",()=>{let r=e.innerType._zod.values;return r?new Set([...r].filter(o=>o!==void 0)):void 0}),t._zod.parse=(r,o)=>{let n=e.innerType._zod.run(r,o);return n instanceof Promise?n.then(s=>zu(s,t)):zu(n,t)}});function zu(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 _l=g("$ZodCatch",(t,e)=>{K.init(t,e),t._zod.optin="optional",U(t._zod,"optout",()=>e.innerType._zod.optout),U(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,o)=>{if(o.direction==="backward")return e.innerType._zod.run(r,o);let n=e.innerType._zod.run(r,o);return n instanceof Promise?n.then(s=>(r.value=s.value,s.issues.length&&(r.value=e.catchValue({...r,error:{issues:s.issues.map(i=>Re(i,o,ke()))},input:r.value}),r.issues=[],r.fallback=!0),r)):(r.value=n.value,n.issues.length&&(r.value=e.catchValue({...r,error:{issues:n.issues.map(s=>Re(s,o,ke()))},input:r.value}),r.issues=[],r.fallback=!0),r)}});var _s=g("$ZodPipe",(t,e)=>{K.init(t,e),U(t._zod,"values",()=>e.in._zod.values),U(t._zod,"optin",()=>e.in._zod.optin),U(t._zod,"optout",()=>e.out._zod.optout),U(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(r,o)=>{if(o.direction==="backward"){let s=e.out._zod.run(r,o);return s instanceof Promise?s.then(i=>Oo(i,e.in,o)):Oo(s,e.in,o)}let n=e.in._zod.run(r,o);return n instanceof Promise?n.then(s=>Oo(s,e.out,o)):Oo(n,e.out,o)}});function Oo(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 yl=g("$ZodPreprocess",(t,e)=>{_s.init(t,e)}),vl=g("$ZodReadonly",(t,e)=>{K.init(t,e),U(t._zod,"propValues",()=>e.innerType._zod.propValues),U(t._zod,"values",()=>e.innerType._zod.values),U(t._zod,"optin",()=>e.innerType?._zod?.optin),U(t._zod,"optout",()=>e.innerType?._zod?.optout),t._zod.parse=(r,o)=>{if(o.direction==="backward")return e.innerType._zod.run(r,o);let n=e.innerType._zod.run(r,o);return n instanceof Promise?n.then(xu):xu(n)}});function xu(t){return t.value=Object.freeze(t.value),t}var $l=g("$ZodCustom",(t,e)=>{ce.init(t,e),K.init(t,e),t._zod.parse=(r,o)=>r,t._zod.check=r=>{let o=r.value,n=e.fn(o);if(n instanceof Promise)return n.then(s=>Eu(s,r,o,t));Eu(n,r,o,t)}});function Eu(t,e,r,o){if(!t){let n={code:"custom",input:r,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(n.params=o._zod.def.params),e.issues.push(Lt(n))}}var vg=()=>{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(n){return t[n]??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"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let s=o[n.expected]??n.expected,i=is(n.input),a=o[i]??i;return`Invalid input: expected ${s}, received ${a}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${wo(n.values[0])}`:`Invalid option: expected one of ${$o(n.values,"|")}`;case"too_big":{let s=n.inclusive?"<=":"<",i=e(n.origin);return i?`Too big: expected ${n.origin??"value"} to have ${s}${n.maximum.toString()} ${i.unit??"elements"}`:`Too big: expected ${n.origin??"value"} to be ${s}${n.maximum.toString()}`}case"too_small":{let s=n.inclusive?">=":">",i=e(n.origin);return i?`Too small: expected ${n.origin} to have ${s}${n.minimum.toString()} ${i.unit}`:`Too small: expected ${n.origin} to be ${s}${n.minimum.toString()}`}case"invalid_format":{let s=n;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]??n.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${$o(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":return n.options&&Array.isArray(n.options)&&n.options.length>0?`Invalid discriminator value. Expected ${n.options.map(i=>`'${i}'`).join(" | ")}`:"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}};function bl(){return{localeError:vg()}}var Sl;var ys=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...r){let o=r[0];return this._map.set(e,o),o&&typeof o=="object"&&"id"in o&&this._idmap.set(o.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 o={...this.get(r)??{}};delete o.id;let n={...o,...this._map.get(e)};return Object.keys(n).length?n:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function $g(){return new ys}(Sl=globalThis).__zod_globalRegistry??(Sl.__zod_globalRegistry=$g());var zt=globalThis.__zod_globalRegistry;function wl(t,e){return new t({type:"string",...P(e)})}function zl(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...P(e)})}function vs(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...P(e)})}function xl(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...P(e)})}function El(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...P(e)})}function kl(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...P(e)})}function Pl(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...P(e)})}function Tl(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...P(e)})}function Ol(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...P(e)})}function Rl(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...P(e)})}function Il(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...P(e)})}function Al(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...P(e)})}function Nl(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...P(e)})}function Cl(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...P(e)})}function Ml(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...P(e)})}function Dl(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...P(e)})}function jl(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...P(e)})}function Zl(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...P(e)})}function Ll(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...P(e)})}function ql(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...P(e)})}function Ul(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...P(e)})}function Fl(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...P(e)})}function Vl(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...P(e)})}function Hl(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...P(e)})}function Jl(t,e){return new t({type:"string",format:"date",check:"string_format",...P(e)})}function Kl(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...P(e)})}function Gl(t,e){return new t({type:"string",format:"duration",check:"string_format",...P(e)})}function Wl(t,e){return new t({type:"number",checks:[],...P(e)})}function Bl(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...P(e)})}function Yl(t,e){return new t({type:"boolean",...P(e)})}function Xl(t,e){return new t({type:"null",...P(e)})}function Ql(t){return new t({type:"unknown"})}function ed(t,e){return new t({type:"never",...P(e)})}function Ao(t,e){return new ds({check:"less_than",...P(e),value:t,inclusive:!1})}function wr(t,e){return new ds({check:"less_than",...P(e),value:t,inclusive:!0})}function No(t,e){return new ps({check:"greater_than",...P(e),value:t,inclusive:!1})}function zr(t,e){return new ps({check:"greater_than",...P(e),value:t,inclusive:!0})}function Co(t,e){return new su({check:"multiple_of",...P(e),value:t})}function Mo(t,e){return new au({check:"max_length",...P(e),maximum:t})}function qt(t,e){return new cu({check:"min_length",...P(e),minimum:t})}function Do(t,e){return new uu({check:"length_equals",...P(e),length:t})}function $s(t,e){return new lu({check:"string_format",format:"regex",...P(e),pattern:t})}function bs(t){return new du({check:"string_format",format:"lowercase",...P(t)})}function Ss(t){return new pu({check:"string_format",format:"uppercase",...P(t)})}function ws(t,e){return new fu({check:"string_format",format:"includes",...P(e),includes:t})}function zs(t,e){return new mu({check:"string_format",format:"starts_with",...P(e),prefix:t})}function xs(t,e){return new hu({check:"string_format",format:"ends_with",...P(e),suffix:t})}function dt(t){return new gu({check:"overwrite",tx:t})}function Es(t){return dt(e=>e.normalize(t))}function ks(){return dt(t=>t.trim())}function Ps(){return dt(t=>t.toLowerCase())}function Ts(){return dt(t=>t.toUpperCase())}function Os(){return dt(t=>es(t))}function td(t,e,r){return new t({type:"array",element:e,...P(r)})}function rd(t,e,r){let o=P(r);return o.abort??(o.abort=!0),new t({type:"custom",check:"custom",fn:e,...o})}function od(t,e,r){return new t({type:"custom",check:"custom",fn:e,...P(r)})}function nd(t,e){let r=bg(o=>(o.addIssue=n=>{if(typeof n=="string")o.issues.push(Lt(n,o.value,r._zod.def));else{let s=n;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=o.value),s.inst??(s.inst=r),s.continue??(s.continue=!r._zod.def.abort),o.issues.push(Lt(s))}},t(o.value,o)),e);return r}function bg(t,e){let r=new ce({check:"custom",...P(e)});return r._zod.check=t,r}function Rs(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??zt,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 oe(t,e,r={path:[],schemaPath:[]}){var o;let n=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,f=e.processors[n.type];if(!f)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);f(t,e,p,l)}let d=t._zod.parent;d&&(i.ref||(i.ref=d),oe(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"&&_e(t)&&(delete i.schema.examples,delete i.schema.default),e.io==="input"&&"_prefault"in i.schema&&((o=i.schema).default??(o.default=i.schema._prefault)),delete i.schema._prefault,e.seen.get(t).schema}function Is(t,e){let r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=new Map;for(let i of t.seen.entries()){let a=t.metadataRegistry.get(i[0])?.id;if(a){let c=o.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.`);o.set(a,i[0])}}let n=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??(m=>m);if(d)return{ref:p(d)};let f=i[1].defId??i[1].schema.id??`schema${t.counter++}`;return i[1].defId=f,{defId:f,ref:`${p("__shared")}#/${a}/${f}`}}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}=n(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>
54
79
 
55
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let a of t.seen.entries()){let s=a[1];if(e===a[0]){i(a);continue}if(t.external){let u=t.external.registry.get(a[0])?.id;if(e!==a[0]&&u){i(a);continue}}if(t.metadataRegistry.get(a[0])?.id){i(a);continue}if(s.cycle){i(a);continue}if(s.count>1&&t.reused==="ref"){i(a);continue}}}function Yi(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 s=t.seen.get(a);if(s.ref===null)return;let c=s.def??s.schema,u={...c},l=s.ref;if(s.ref=null,l){n(l);let m=t.seen.get(l),f=m.schema;if(f.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(f)):Object.assign(c,f),Object.assign(c,u),a._zod.parent===l)for(let v in c)v==="$ref"||v==="allOf"||v in u||delete c[v];if(f.$ref&&m.def)for(let v in c)v==="$ref"||v==="allOf"||v in m.def&&JSON.stringify(c[v])===JSON.stringify(m.def[v])&&delete c[v]}let d=a._zod.parent;if(d&&d!==l){n(d);let m=t.seen.get(d);if(m?.schema.$ref&&(c.$ref=m.schema.$ref,m.def))for(let f in c)f==="$ref"||f==="allOf"||f in m.def&&JSON.stringify(c[f])===JSON.stringify(m.def[f])&&delete c[f]}t.override({zodSchema:a,jsonSchema:c,path:s.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 i=t.external?.defs??{};for(let a of t.seen.entries()){let s=a[1];s.def&&s.defId&&(i[s.defId]=s.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:mo(e,"input",t.processors),output:mo(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")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 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 Nm=(t,e={})=>r=>{let n=Bi({...r,processors:e});return de(t,n),Xi(n,t),Yi(n,t)},mo=(t,e,r={})=>n=>{let{libraryOptions:o,target:i}=n??{},a=Bi({...o??{},target:i,io:e,processors:r});return de(t,a),Xi(a,t),Yi(a,t)};var Sb={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Rm=(t,e,r,n)=>{let o=r;o.type="string";let{minimum:i,maximum:a,format:s,patterns:c,contentEncoding:u}=t._zod.bag;if(typeof i=="number"&&(o.minLength=i),typeof a=="number"&&(o.maxLength=a),s&&(o.format=Sb[s]??s,o.format===""&&delete o.format,s==="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}))])}},Am=(t,e,r,n)=>{let o=r,{minimum:i,maximum:a,format:s,multipleOf:c,exclusiveMaximum:u,exclusiveMinimum:l}=t._zod.bag;typeof s=="string"&&s.includes("int")?o.type="integer":o.type="number",typeof l=="number"&&(e.target==="draft-04"||e.target==="openapi-3.0"?(o.minimum=l,o.exclusiveMinimum=!0):o.exclusiveMinimum=l),typeof i=="number"&&(o.minimum=i,typeof l=="number"&&e.target!=="draft-04"&&(l>=i?delete o.minimum:delete o.exclusiveMinimum)),typeof u=="number"&&(e.target==="draft-04"||e.target==="openapi-3.0"?(o.maximum=u,o.exclusiveMaximum=!0):o.exclusiveMaximum=u),typeof a=="number"&&(o.maximum=a,typeof u=="number"&&e.target!=="draft-04"&&(u<=a?delete o.maximum:delete o.exclusiveMaximum)),typeof c=="number"&&(o.multipleOf=c)},Um=(t,e,r,n)=>{r.type="boolean"},Zm=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},Cm=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},Mm=(t,e,r,n)=>{e.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},Lm=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},qm=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},Fm=(t,e,r,n)=>{r.not={}},Vm=(t,e,r,n)=>{},Jm=(t,e,r,n)=>{},Km=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},Hm=(t,e,r,n)=>{let o=t._zod.def,i=Rn(o.entries);i.every(a=>typeof a=="number")&&(r.type="number"),i.every(a=>typeof a=="string")&&(r.type="string"),r.enum=i},Wm=(t,e,r,n)=>{let o=t._zod.def,i=[];for(let a of o.values)if(a===void 0){if(e.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof a=="bigint"){if(e.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");i.push(Number(a))}else i.push(a);if(i.length!==0)if(i.length===1){let a=i[0];r.type=a===null?"null":typeof a,e.target==="draft-04"||e.target==="openapi-3.0"?r.enum=[a]:r.const=a}else i.every(a=>typeof a=="number")&&(r.type="number"),i.every(a=>typeof a=="string")&&(r.type="string"),i.every(a=>typeof a=="boolean")&&(r.type="boolean"),i.every(a=>a===null)&&(r.type="null"),r.enum=i},Gm=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},Bm=(t,e,r,n)=>{let o=r,i=t._zod.pattern;if(!i)throw new Error("Pattern not found in template literal");o.type="string",o.pattern=i.source},Xm=(t,e,r,n)=>{let o=r,i={type:"string",format:"binary",contentEncoding:"binary"},{minimum:a,maximum:s,mime:c}=t._zod.bag;a!==void 0&&(i.minLength=a),s!==void 0&&(i.maxLength=s),c?c.length===1?(i.contentMediaType=c[0],Object.assign(o,i)):(Object.assign(o,i),o.anyOf=c.map(u=>({contentMediaType:u}))):Object.assign(o,i)},Ym=(t,e,r,n)=>{r.type="boolean"},Qm=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},eh=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},th=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},rh=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},nh=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},oh=(t,e,r,n)=>{let o=r,i=t._zod.def,{minimum:a,maximum:s}=t._zod.bag;typeof a=="number"&&(o.minItems=a),typeof s=="number"&&(o.maxItems=s),o.type="array",o.items=de(i.element,e,{...n,path:[...n.path,"items"]})},ih=(t,e,r,n)=>{let o=r,i=t._zod.def;o.type="object",o.properties={};let a=i.shape;for(let u in a)o.properties[u]=de(a[u],e,{...n,path:[...n.path,"properties",u]});let s=new Set(Object.keys(a)),c=new Set([...s].filter(u=>{let l=i.shape[u]._zod;return e.io==="input"?l.optin===void 0:l.optout===void 0}));c.size>0&&(o.required=Array.from(c)),i.catchall?._zod.def.type==="never"?o.additionalProperties=!1:i.catchall?i.catchall&&(o.additionalProperties=de(i.catchall,e,{...n,path:[...n.path,"additionalProperties"]})):e.io==="output"&&(o.additionalProperties=!1)},hl=(t,e,r,n)=>{let o=t._zod.def,i=o.inclusive===!1,a=o.options.map((s,c)=>de(s,e,{...n,path:[...n.path,i?"oneOf":"anyOf",c]}));i?r.oneOf=a:r.anyOf=a},ah=(t,e,r,n)=>{let o=t._zod.def,i=de(o.left,e,{...n,path:[...n.path,"allOf",0]}),a=de(o.right,e,{...n,path:[...n.path,"allOf",1]}),s=u=>"allOf"in u&&Object.keys(u).length===1,c=[...s(i)?i.allOf:[i],...s(a)?a.allOf:[a]];r.allOf=c},sh=(t,e,r,n)=>{let o=r,i=t._zod.def;o.type="array";let a=e.target==="draft-2020-12"?"prefixItems":"items",s=e.target==="draft-2020-12"||e.target==="openapi-3.0"?"items":"additionalItems",c=i.items.map((m,f)=>de(m,e,{...n,path:[...n.path,a,f]})),u=i.rest?de(i.rest,e,{...n,path:[...n.path,s,...e.target==="openapi-3.0"?[i.items.length]:[]]}):null;e.target==="draft-2020-12"?(o.prefixItems=c,u&&(o.items=u)):e.target==="openapi-3.0"?(o.items={anyOf:c},u&&o.items.anyOf.push(u),o.minItems=c.length,u||(o.maxItems=c.length)):(o.items=c,u&&(o.additionalItems=u));let{minimum:l,maximum:d}=t._zod.bag;typeof l=="number"&&(o.minItems=l),typeof d=="number"&&(o.maxItems=d)},ch=(t,e,r,n)=>{let o=r,i=t._zod.def;o.type="object";let a=i.keyType,c=a._zod.bag?.patterns;if(i.mode==="loose"&&c&&c.size>0){let l=de(i.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=de(i.keyType,e,{...n,path:[...n.path,"propertyNames"]})),o.additionalProperties=de(i.valueType,e,{...n,path:[...n.path,"additionalProperties"]});let u=a._zod.values;if(u){let l=[...u].filter(d=>typeof d=="string"||typeof d=="number");l.length>0&&(o.required=l)}},uh=(t,e,r,n)=>{let o=t._zod.def,i=de(o.innerType,e,n),a=e.seen.get(t);e.target==="openapi-3.0"?(a.ref=o.innerType,r.nullable=!0):r.anyOf=[i,{type:"null"}]},lh=(t,e,r,n)=>{let o=t._zod.def;de(o.innerType,e,n);let i=e.seen.get(t);i.ref=o.innerType},dh=(t,e,r,n)=>{let o=t._zod.def;de(o.innerType,e,n);let i=e.seen.get(t);i.ref=o.innerType,r.default=JSON.parse(JSON.stringify(o.defaultValue))},ph=(t,e,r,n)=>{let o=t._zod.def;de(o.innerType,e,n);let i=e.seen.get(t);i.ref=o.innerType,e.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},fh=(t,e,r,n)=>{let o=t._zod.def;de(o.innerType,e,n);let i=e.seen.get(t);i.ref=o.innerType;let a;try{a=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=a},mh=(t,e,r,n)=>{let o=t._zod.def,i=e.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;de(i,e,n);let a=e.seen.get(t);a.ref=i},hh=(t,e,r,n)=>{let o=t._zod.def;de(o.innerType,e,n);let i=e.seen.get(t);i.ref=o.innerType,r.readOnly=!0},gh=(t,e,r,n)=>{let o=t._zod.def;de(o.innerType,e,n);let i=e.seen.get(t);i.ref=o.innerType},gl=(t,e,r,n)=>{let o=t._zod.def;de(o.innerType,e,n);let i=e.seen.get(t);i.ref=o.innerType},vh=(t,e,r,n)=>{let o=t._zod.innerType;de(o,e,n);let i=e.seen.get(t);i.ref=o};function Br(t){return!!t._zod}function Yt(t,e){return Br(t)?Jr(t,e):t.safeParse(e)}function Qi(t){if(!t)return;let e;if(Br(t)?e=t._zod?.def?.shape:e=t.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function bh(t){if(Br(t)){let i=t._zod?.def;if(i){if(i.value!==void 0)return i.value;if(Array.isArray(i.values)&&i.values.length>0)return i.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 ho={};$n(ho,{ZodAny:()=>Ch,ZodArray:()=>Fh,ZodBase64:()=>Ml,ZodBase64URL:()=>Ll,ZodBigInt:()=>ca,ZodBigIntFormat:()=>Vl,ZodBoolean:()=>sa,ZodCIDRv4:()=>Zl,ZodCIDRv6:()=>Cl,ZodCUID:()=>Ol,ZodCUID2:()=>jl,ZodCatch:()=>ug,ZodCodec:()=>Xl,ZodCustom:()=>fa,ZodCustomStringFormat:()=>vo,ZodDate:()=>Kl,ZodDefault:()=>ng,ZodDiscriminatedUnion:()=>Jh,ZodE164:()=>ql,ZodEmail:()=>El,ZodEmoji:()=>Tl,ZodEnum:()=>go,ZodExactOptional:()=>eg,ZodFile:()=>Yh,ZodFunction:()=>_g,ZodGUID:()=>ta,ZodIPv4:()=>Al,ZodIPv6:()=>Ul,ZodIntersection:()=>Kh,ZodJWT:()=>Fl,ZodKSUID:()=>Rl,ZodLazy:()=>hg,ZodLiteral:()=>Xh,ZodMAC:()=>Rh,ZodMap:()=>Gh,ZodNaN:()=>dg,ZodNanoID:()=>Pl,ZodNever:()=>Lh,ZodNonOptional:()=>Gl,ZodNull:()=>Zh,ZodNullable:()=>rg,ZodNumber:()=>aa,ZodNumberFormat:()=>Xr,ZodObject:()=>ua,ZodOptional:()=>Wl,ZodPipe:()=>Bl,ZodPrefault:()=>ig,ZodPromise:()=>vg,ZodReadonly:()=>pg,ZodRecord:()=>pa,ZodSet:()=>Bh,ZodString:()=>oa,ZodStringFormat:()=>ce,ZodSuccess:()=>cg,ZodSymbol:()=>Ah,ZodTemplateLiteral:()=>mg,ZodTransform:()=>Qh,ZodTuple:()=>Hh,ZodType:()=>F,ZodULID:()=>Dl,ZodURL:()=>ia,ZodUUID:()=>Rt,ZodUndefined:()=>Uh,ZodUnion:()=>la,ZodUnknown:()=>Mh,ZodVoid:()=>qh,ZodXID:()=>Nl,ZodXor:()=>Vh,_ZodString:()=>Il,_default:()=>og,_function:()=>qx,any:()=>Sx,array:()=>G,base64:()=>sx,base64url:()=>cx,bigint:()=>yx,boolean:()=>_e,catch:()=>lg,check:()=>Fx,cidrv4:()=>ix,cidrv6:()=>ax,codec:()=>Cx,cuid:()=>Xb,cuid2:()=>Yb,custom:()=>Yl,date:()=>zx,describe:()=>Vx,discriminatedUnion:()=>da,e164:()=>ux,email:()=>Lb,emoji:()=>Gb,enum:()=>Te,exactOptional:()=>tg,file:()=>Rx,float32:()=>hx,float64:()=>gx,function:()=>qx,guid:()=>qb,hash:()=>mx,hex:()=>fx,hostname:()=>px,httpUrl:()=>Wb,instanceof:()=>Kx,int:()=>zl,int32:()=>vx,int64:()=>$x,intersection:()=>yo,ipv4:()=>rx,ipv6:()=>ox,json:()=>Wx,jwt:()=>lx,keyof:()=>Ix,ksuid:()=>tx,lazy:()=>gg,literal:()=>T,looseObject:()=>Ee,looseRecord:()=>Ox,mac:()=>nx,map:()=>jx,meta:()=>Jx,nan:()=>Zx,nanoid:()=>Bb,nativeEnum:()=>Nx,never:()=>Jl,nonoptional:()=>sg,null:()=>_o,nullable:()=>ra,nullish:()=>Ax,number:()=>ne,object:()=>z,optional:()=>fe,partialRecord:()=>Px,pipe:()=>na,prefault:()=>ag,preprocess:()=>ma,promise:()=>Lx,readonly:()=>fg,record:()=>pe,refine:()=>yg,set:()=>Dx,strictObject:()=>Ex,string:()=>h,stringFormat:()=>dx,stringbool:()=>Hx,success:()=>Ux,superRefine:()=>$g,symbol:()=>xx,templateLiteral:()=>Mx,transform:()=>Hl,tuple:()=>Wh,uint32:()=>_x,uint64:()=>bx,ulid:()=>Qb,undefined:()=>kx,union:()=>ie,unknown:()=>ue,url:()=>Hb,uuid:()=>Fb,uuidv4:()=>Vb,uuidv6:()=>Jb,uuidv7:()=>Kb,void:()=>wx,xid:()=>ex,xor:()=>Tx});var ea={};$n(ea,{endsWith:()=>so,gt:()=>Dt,gte:()=>Ae,includes:()=>io,length:()=>Wr,lowercase:()=>no,lt:()=>jt,lte:()=>We,maxLength:()=>Hr,maxSize:()=>gr,mime:()=>co,minLength:()=>Xt,minSize:()=>Nt,multipleOf:()=>hr,negative:()=>ol,nonnegative:()=>al,nonpositive:()=>il,normalize:()=>uo,overwrite:()=>_t,positive:()=>nl,property:()=>sl,regex:()=>ro,size:()=>Kr,slugify:()=>Gi,startsWith:()=>ao,toLowerCase:()=>po,toUpperCase:()=>fo,trim:()=>lo,uppercase:()=>oo});var vr={};$n(vr,{ZodISODate:()=>$l,ZodISODateTime:()=>_l,ZodISODuration:()=>Sl,ZodISOTime:()=>xl,date:()=>bl,datetime:()=>yl,duration:()=>wl,time:()=>kl});var _l=p("ZodISODateTime",(t,e)=>{jc.init(t,e),ce.init(t,e)});function yl(t){return Nu(_l,t)}var $l=p("ZodISODate",(t,e)=>{Dc.init(t,e),ce.init(t,e)});function bl(t){return Ru($l,t)}var xl=p("ZodISOTime",(t,e)=>{Nc.init(t,e),ce.init(t,e)});function kl(t){return Au(xl,t)}var Sl=p("ZodISODuration",(t,e)=>{Rc.init(t,e),ce.init(t,e)});function wl(t){return Uu(Sl,t)}var xh=(t,e)=>{mi.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:r=>gi(t,r)},flatten:{value:r=>hi(t,r)},addIssue:{value:r=>{t.issues.push(r),t.message=JSON.stringify(t.issues,qr,2)}},addIssues:{value:r=>{t.issues.push(...r),t.message=JSON.stringify(t.issues,qr,2)}},isEmpty:{get(){return t.issues.length===0}}})},AN=p("ZodError",xh),Ge=p("ZodError",xh,{Parent:Error});var kh=Ln(Ge),Sh=Fn(Ge),wh=Jn(Ge),zh=Kn(Ge),Ih=Uf(Ge),Eh=Zf(Ge),Th=Cf(Ge),Ph=Mf(Ge),Oh=Lf(Ge),jh=qf(Ge),Dh=Ff(Ge),Nh=Vf(Ge);var F=p("ZodType",(t,e)=>(M.init(t,e),Object.assign(t["~standard"],{jsonSchema:{input:mo(t,"input"),output:mo(t,"output")}}),t.toJSONSchema=Nm(t,{}),t.def=e,t.type=e.type,Object.defineProperty(t,"_def",{value:e}),t.check=(...r)=>t.clone(y.mergeDefs(e,{checks:[...e.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0}),t.with=t.check,t.clone=(r,n)=>Ne(t,r,n),t.brand=()=>t,t.register=((r,n)=>(r.add(t,n),t)),t.parse=(r,n)=>kh(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>wh(t,r,n),t.parseAsync=async(r,n)=>Sh(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>zh(t,r,n),t.spa=t.safeParseAsync,t.encode=(r,n)=>Ih(t,r,n),t.decode=(r,n)=>Eh(t,r,n),t.encodeAsync=async(r,n)=>Th(t,r,n),t.decodeAsync=async(r,n)=>Ph(t,r,n),t.safeEncode=(r,n)=>Oh(t,r,n),t.safeDecode=(r,n)=>jh(t,r,n),t.safeEncodeAsync=async(r,n)=>Dh(t,r,n),t.safeDecodeAsync=async(r,n)=>Nh(t,r,n),t.refine=(r,n)=>t.check(yg(r,n)),t.superRefine=r=>t.check($g(r)),t.overwrite=r=>t.check(_t(r)),t.optional=()=>fe(t),t.exactOptional=()=>tg(t),t.nullable=()=>ra(t),t.nullish=()=>fe(ra(t)),t.nonoptional=r=>sg(t,r),t.array=()=>G(t),t.or=r=>ie([t,r]),t.and=r=>yo(t,r),t.transform=r=>na(t,Hl(r)),t.default=r=>og(t,r),t.prefault=r=>ag(t,r),t.catch=r=>lg(t,r),t.pipe=r=>na(t,r),t.readonly=()=>fg(t),t.describe=r=>{let n=t.clone();return Re.add(n,{description:r}),n},Object.defineProperty(t,"description",{get(){return Re.get(t)?.description},configurable:!0}),t.meta=(...r)=>{if(r.length===0)return Re.get(t);let n=t.clone();return Re.add(n,r[0]),n},t.isOptional=()=>t.safeParse(void 0).success,t.isNullable=()=>t.safeParse(null).success,t.apply=r=>r(t),t)),Il=p("_ZodString",(t,e)=>{mr.init(t,e),F.init(t,e),t._zod.processJSONSchema=(n,o,i)=>Rm(t,n,o,i);let r=t._zod.bag;t.format=r.format??null,t.minLength=r.minimum??null,t.maxLength=r.maximum??null,t.regex=(...n)=>t.check(ro(...n)),t.includes=(...n)=>t.check(io(...n)),t.startsWith=(...n)=>t.check(ao(...n)),t.endsWith=(...n)=>t.check(so(...n)),t.min=(...n)=>t.check(Xt(...n)),t.max=(...n)=>t.check(Hr(...n)),t.length=(...n)=>t.check(Wr(...n)),t.nonempty=(...n)=>t.check(Xt(1,...n)),t.lowercase=n=>t.check(no(n)),t.uppercase=n=>t.check(oo(n)),t.trim=()=>t.check(lo()),t.normalize=(...n)=>t.check(uo(...n)),t.toLowerCase=()=>t.check(po()),t.toUpperCase=()=>t.check(fo()),t.slugify=()=>t.check(Gi())}),oa=p("ZodString",(t,e)=>{mr.init(t,e),Il.init(t,e),t.email=r=>t.check(Ti(El,r)),t.url=r=>t.check(to(ia,r)),t.jwt=r=>t.check(Wi(Fl,r)),t.emoji=r=>t.check(Ni(Tl,r)),t.guid=r=>t.check(eo(ta,r)),t.uuid=r=>t.check(Pi(Rt,r)),t.uuidv4=r=>t.check(Oi(Rt,r)),t.uuidv6=r=>t.check(ji(Rt,r)),t.uuidv7=r=>t.check(Di(Rt,r)),t.nanoid=r=>t.check(Ri(Pl,r)),t.guid=r=>t.check(eo(ta,r)),t.cuid=r=>t.check(Ai(Ol,r)),t.cuid2=r=>t.check(Ui(jl,r)),t.ulid=r=>t.check(Zi(Dl,r)),t.base64=r=>t.check(Ji(Ml,r)),t.base64url=r=>t.check(Ki(Ll,r)),t.xid=r=>t.check(Ci(Nl,r)),t.ksuid=r=>t.check(Mi(Rl,r)),t.ipv4=r=>t.check(Li(Al,r)),t.ipv6=r=>t.check(qi(Ul,r)),t.cidrv4=r=>t.check(Fi(Zl,r)),t.cidrv6=r=>t.check(Vi(Cl,r)),t.e164=r=>t.check(Hi(ql,r)),t.datetime=r=>t.check(yl(r)),t.date=r=>t.check(bl(r)),t.time=r=>t.check(kl(r)),t.duration=r=>t.check(wl(r))});function h(t){return ju(oa,t)}var ce=p("ZodStringFormat",(t,e)=>{oe.init(t,e),Il.init(t,e)}),El=p("ZodEmail",(t,e)=>{kc.init(t,e),ce.init(t,e)});function Lb(t){return Ti(El,t)}var ta=p("ZodGUID",(t,e)=>{bc.init(t,e),ce.init(t,e)});function qb(t){return eo(ta,t)}var Rt=p("ZodUUID",(t,e)=>{xc.init(t,e),ce.init(t,e)});function Fb(t){return Pi(Rt,t)}function Vb(t){return Oi(Rt,t)}function Jb(t){return ji(Rt,t)}function Kb(t){return Di(Rt,t)}var ia=p("ZodURL",(t,e)=>{Sc.init(t,e),ce.init(t,e)});function Hb(t){return to(ia,t)}function Wb(t){return to(ia,{protocol:/^https?$/,hostname:Qe.domain,...y.normalizeParams(t)})}var Tl=p("ZodEmoji",(t,e)=>{wc.init(t,e),ce.init(t,e)});function Gb(t){return Ni(Tl,t)}var Pl=p("ZodNanoID",(t,e)=>{zc.init(t,e),ce.init(t,e)});function Bb(t){return Ri(Pl,t)}var Ol=p("ZodCUID",(t,e)=>{Ic.init(t,e),ce.init(t,e)});function Xb(t){return Ai(Ol,t)}var jl=p("ZodCUID2",(t,e)=>{Ec.init(t,e),ce.init(t,e)});function Yb(t){return Ui(jl,t)}var Dl=p("ZodULID",(t,e)=>{Tc.init(t,e),ce.init(t,e)});function Qb(t){return Zi(Dl,t)}var Nl=p("ZodXID",(t,e)=>{Pc.init(t,e),ce.init(t,e)});function ex(t){return Ci(Nl,t)}var Rl=p("ZodKSUID",(t,e)=>{Oc.init(t,e),ce.init(t,e)});function tx(t){return Mi(Rl,t)}var Al=p("ZodIPv4",(t,e)=>{Ac.init(t,e),ce.init(t,e)});function rx(t){return Li(Al,t)}var Rh=p("ZodMAC",(t,e)=>{Zc.init(t,e),ce.init(t,e)});function nx(t){return Du(Rh,t)}var Ul=p("ZodIPv6",(t,e)=>{Uc.init(t,e),ce.init(t,e)});function ox(t){return qi(Ul,t)}var Zl=p("ZodCIDRv4",(t,e)=>{Cc.init(t,e),ce.init(t,e)});function ix(t){return Fi(Zl,t)}var Cl=p("ZodCIDRv6",(t,e)=>{Mc.init(t,e),ce.init(t,e)});function ax(t){return Vi(Cl,t)}var Ml=p("ZodBase64",(t,e)=>{Lc.init(t,e),ce.init(t,e)});function sx(t){return Ji(Ml,t)}var Ll=p("ZodBase64URL",(t,e)=>{qc.init(t,e),ce.init(t,e)});function cx(t){return Ki(Ll,t)}var ql=p("ZodE164",(t,e)=>{Fc.init(t,e),ce.init(t,e)});function ux(t){return Hi(ql,t)}var Fl=p("ZodJWT",(t,e)=>{Vc.init(t,e),ce.init(t,e)});function lx(t){return Wi(Fl,t)}var vo=p("ZodCustomStringFormat",(t,e)=>{Jc.init(t,e),ce.init(t,e)});function dx(t,e,r={}){return Gr(vo,t,e,r)}function px(t){return Gr(vo,"hostname",Qe.hostname,t)}function fx(t){return Gr(vo,"hex",Qe.hex,t)}function mx(t,e){let r=e?.enc??"hex",n=`${t}_${r}`,o=Qe[n];if(!o)throw new Error(`Unrecognized hash format: ${n}`);return Gr(vo,n,o,e)}var aa=p("ZodNumber",(t,e)=>{wi.init(t,e),F.init(t,e),t._zod.processJSONSchema=(n,o,i)=>Am(t,n,o,i),t.gt=(n,o)=>t.check(Dt(n,o)),t.gte=(n,o)=>t.check(Ae(n,o)),t.min=(n,o)=>t.check(Ae(n,o)),t.lt=(n,o)=>t.check(jt(n,o)),t.lte=(n,o)=>t.check(We(n,o)),t.max=(n,o)=>t.check(We(n,o)),t.int=n=>t.check(zl(n)),t.safe=n=>t.check(zl(n)),t.positive=n=>t.check(Dt(0,n)),t.nonnegative=n=>t.check(Ae(0,n)),t.negative=n=>t.check(jt(0,n)),t.nonpositive=n=>t.check(We(0,n)),t.multipleOf=(n,o)=>t.check(hr(n,o)),t.step=(n,o)=>t.check(hr(n,o)),t.finite=()=>t;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 ne(t){return Zu(aa,t)}var Xr=p("ZodNumberFormat",(t,e)=>{Kc.init(t,e),aa.init(t,e)});function zl(t){return Cu(Xr,t)}function hx(t){return Mu(Xr,t)}function gx(t){return Lu(Xr,t)}function vx(t){return qu(Xr,t)}function _x(t){return Fu(Xr,t)}var sa=p("ZodBoolean",(t,e)=>{Xn.init(t,e),F.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Um(t,r,n,o)});function _e(t){return Vu(sa,t)}var ca=p("ZodBigInt",(t,e)=>{zi.init(t,e),F.init(t,e),t._zod.processJSONSchema=(n,o,i)=>Zm(t,n,o,i),t.gte=(n,o)=>t.check(Ae(n,o)),t.min=(n,o)=>t.check(Ae(n,o)),t.gt=(n,o)=>t.check(Dt(n,o)),t.gte=(n,o)=>t.check(Ae(n,o)),t.min=(n,o)=>t.check(Ae(n,o)),t.lt=(n,o)=>t.check(jt(n,o)),t.lte=(n,o)=>t.check(We(n,o)),t.max=(n,o)=>t.check(We(n,o)),t.positive=n=>t.check(Dt(BigInt(0),n)),t.negative=n=>t.check(jt(BigInt(0),n)),t.nonpositive=n=>t.check(We(BigInt(0),n)),t.nonnegative=n=>t.check(Ae(BigInt(0),n)),t.multipleOf=(n,o)=>t.check(hr(n,o));let r=t._zod.bag;t.minValue=r.minimum??null,t.maxValue=r.maximum??null,t.format=r.format??null});function yx(t){return Ju(ca,t)}var Vl=p("ZodBigIntFormat",(t,e)=>{Hc.init(t,e),ca.init(t,e)});function $x(t){return Ku(Vl,t)}function bx(t){return Hu(Vl,t)}var Ah=p("ZodSymbol",(t,e)=>{Wc.init(t,e),F.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Cm(t,r,n,o)});function xx(t){return Wu(Ah,t)}var Uh=p("ZodUndefined",(t,e)=>{Gc.init(t,e),F.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Lm(t,r,n,o)});function kx(t){return Gu(Uh,t)}var Zh=p("ZodNull",(t,e)=>{Bc.init(t,e),F.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Mm(t,r,n,o)});function _o(t){return Bu(Zh,t)}var Ch=p("ZodAny",(t,e)=>{Xc.init(t,e),F.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Vm(t,r,n,o)});function Sx(){return Xu(Ch)}var Mh=p("ZodUnknown",(t,e)=>{Yc.init(t,e),F.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Jm(t,r,n,o)});function ue(){return Yu(Mh)}var Lh=p("ZodNever",(t,e)=>{Qc.init(t,e),F.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Fm(t,r,n,o)});function Jl(t){return Qu(Lh,t)}var qh=p("ZodVoid",(t,e)=>{eu.init(t,e),F.init(t,e),t._zod.processJSONSchema=(r,n,o)=>qm(t,r,n,o)});function wx(t){return el(qh,t)}var Kl=p("ZodDate",(t,e)=>{tu.init(t,e),F.init(t,e),t._zod.processJSONSchema=(n,o,i)=>Km(t,n,o,i),t.min=(n,o)=>t.check(Ae(n,o)),t.max=(n,o)=>t.check(We(n,o));let r=t._zod.bag;t.minDate=r.minimum?new Date(r.minimum):null,t.maxDate=r.maximum?new Date(r.maximum):null});function zx(t){return tl(Kl,t)}var Fh=p("ZodArray",(t,e)=>{ru.init(t,e),F.init(t,e),t._zod.processJSONSchema=(r,n,o)=>oh(t,r,n,o),t.element=e.element,t.min=(r,n)=>t.check(Xt(r,n)),t.nonempty=r=>t.check(Xt(1,r)),t.max=(r,n)=>t.check(Hr(r,n)),t.length=(r,n)=>t.check(Wr(r,n)),t.unwrap=()=>t.element});function G(t,e){return Dm(Fh,t,e)}function Ix(t){let e=t._zod.def.shape;return Te(Object.keys(e))}var ua=p("ZodObject",(t,e)=>{Om.init(t,e),F.init(t,e),t._zod.processJSONSchema=(r,n,o)=>ih(t,r,n,o),y.defineLazy(t,"shape",()=>e.shape),t.keyof=()=>Te(Object.keys(t._zod.def.shape)),t.catchall=r=>t.clone({...t._zod.def,catchall:r}),t.passthrough=()=>t.clone({...t._zod.def,catchall:ue()}),t.loose=()=>t.clone({...t._zod.def,catchall:ue()}),t.strict=()=>t.clone({...t._zod.def,catchall:Jl()}),t.strip=()=>t.clone({...t._zod.def,catchall:void 0}),t.extend=r=>y.extend(t,r),t.safeExtend=r=>y.safeExtend(t,r),t.merge=r=>y.merge(t,r),t.pick=r=>y.pick(t,r),t.omit=r=>y.omit(t,r),t.partial=(...r)=>y.partial(Wl,t,r[0]),t.required=(...r)=>y.required(Gl,t,r[0])});function z(t,e){let r={type:"object",shape:t??{},...y.normalizeParams(e)};return new ua(r)}function Ex(t,e){return new ua({type:"object",shape:t,catchall:Jl(),...y.normalizeParams(e)})}function Ee(t,e){return new ua({type:"object",shape:t,catchall:ue(),...y.normalizeParams(e)})}var la=p("ZodUnion",(t,e)=>{Yn.init(t,e),F.init(t,e),t._zod.processJSONSchema=(r,n,o)=>hl(t,r,n,o),t.options=e.options});function ie(t,e){return new la({type:"union",options:t,...y.normalizeParams(e)})}var Vh=p("ZodXor",(t,e)=>{la.init(t,e),nu.init(t,e),t._zod.processJSONSchema=(r,n,o)=>hl(t,r,n,o),t.options=e.options});function Tx(t,e){return new Vh({type:"union",options:t,inclusive:!1,...y.normalizeParams(e)})}var Jh=p("ZodDiscriminatedUnion",(t,e)=>{la.init(t,e),ou.init(t,e)});function da(t,e,r){return new Jh({type:"union",options:e,discriminator:t,...y.normalizeParams(r)})}var Kh=p("ZodIntersection",(t,e)=>{iu.init(t,e),F.init(t,e),t._zod.processJSONSchema=(r,n,o)=>ah(t,r,n,o)});function yo(t,e){return new Kh({type:"intersection",left:t,right:e})}var Hh=p("ZodTuple",(t,e)=>{Ii.init(t,e),F.init(t,e),t._zod.processJSONSchema=(r,n,o)=>sh(t,r,n,o),t.rest=r=>t.clone({...t._zod.def,rest:r})});function Wh(t,e,r){let n=e instanceof M,o=n?r:e,i=n?e:null;return new Hh({type:"tuple",items:t,rest:i,...y.normalizeParams(o)})}var pa=p("ZodRecord",(t,e)=>{au.init(t,e),F.init(t,e),t._zod.processJSONSchema=(r,n,o)=>ch(t,r,n,o),t.keyType=e.keyType,t.valueType=e.valueType});function pe(t,e,r){return new pa({type:"record",keyType:t,valueType:e,...y.normalizeParams(r)})}function Px(t,e,r){let n=Ne(t);return n._zod.values=void 0,new pa({type:"record",keyType:n,valueType:e,...y.normalizeParams(r)})}function Ox(t,e,r){return new pa({type:"record",keyType:t,valueType:e,mode:"loose",...y.normalizeParams(r)})}var Gh=p("ZodMap",(t,e)=>{su.init(t,e),F.init(t,e),t._zod.processJSONSchema=(r,n,o)=>rh(t,r,n,o),t.keyType=e.keyType,t.valueType=e.valueType,t.min=(...r)=>t.check(Nt(...r)),t.nonempty=r=>t.check(Nt(1,r)),t.max=(...r)=>t.check(gr(...r)),t.size=(...r)=>t.check(Kr(...r))});function jx(t,e,r){return new Gh({type:"map",keyType:t,valueType:e,...y.normalizeParams(r)})}var Bh=p("ZodSet",(t,e)=>{cu.init(t,e),F.init(t,e),t._zod.processJSONSchema=(r,n,o)=>nh(t,r,n,o),t.min=(...r)=>t.check(Nt(...r)),t.nonempty=r=>t.check(Nt(1,r)),t.max=(...r)=>t.check(gr(...r)),t.size=(...r)=>t.check(Kr(...r))});function Dx(t,e){return new Bh({type:"set",valueType:t,...y.normalizeParams(e)})}var go=p("ZodEnum",(t,e)=>{uu.init(t,e),F.init(t,e),t._zod.processJSONSchema=(n,o,i)=>Hm(t,n,o,i),t.enum=e.entries,t.options=Object.values(e.entries);let r=new Set(Object.keys(e.entries));t.extract=(n,o)=>{let i={};for(let a of n)if(r.has(a))i[a]=e.entries[a];else throw new Error(`Key ${a} not found in enum`);return new go({...e,checks:[],...y.normalizeParams(o),entries:i})},t.exclude=(n,o)=>{let i={...e.entries};for(let a of n)if(r.has(a))delete i[a];else throw new Error(`Key ${a} not found in enum`);return new go({...e,checks:[],...y.normalizeParams(o),entries:i})}});function Te(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new go({type:"enum",entries:r,...y.normalizeParams(e)})}function Nx(t,e){return new go({type:"enum",entries:t,...y.normalizeParams(e)})}var Xh=p("ZodLiteral",(t,e)=>{lu.init(t,e),F.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Wm(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 T(t,e){return new Xh({type:"literal",values:Array.isArray(t)?t:[t],...y.normalizeParams(e)})}var Yh=p("ZodFile",(t,e)=>{du.init(t,e),F.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Xm(t,r,n,o),t.min=(r,n)=>t.check(Nt(r,n)),t.max=(r,n)=>t.check(gr(r,n)),t.mime=(r,n)=>t.check(co(Array.isArray(r)?r:[r],n))});function Rx(t){return cl(Yh,t)}var Qh=p("ZodTransform",(t,e)=>{pu.init(t,e),F.init(t,e),t._zod.processJSONSchema=(r,n,o)=>th(t,r,n,o),t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new dr(t.constructor.name);r.addIssue=i=>{if(typeof i=="string")r.issues.push(y.issue(i,r.value,e));else{let a=i;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=r.value),a.inst??(a.inst=t),r.issues.push(y.issue(a))}};let o=e.transform(r.value,r);return o instanceof Promise?o.then(i=>(r.value=i,r)):(r.value=o,r)}});function Hl(t){return new Qh({type:"transform",transform:t})}var Wl=p("ZodOptional",(t,e)=>{Ei.init(t,e),F.init(t,e),t._zod.processJSONSchema=(r,n,o)=>gl(t,r,n,o),t.unwrap=()=>t._zod.def.innerType});function fe(t){return new Wl({type:"optional",innerType:t})}var eg=p("ZodExactOptional",(t,e)=>{fu.init(t,e),F.init(t,e),t._zod.processJSONSchema=(r,n,o)=>gl(t,r,n,o),t.unwrap=()=>t._zod.def.innerType});function tg(t){return new eg({type:"optional",innerType:t})}var rg=p("ZodNullable",(t,e)=>{mu.init(t,e),F.init(t,e),t._zod.processJSONSchema=(r,n,o)=>uh(t,r,n,o),t.unwrap=()=>t._zod.def.innerType});function ra(t){return new rg({type:"nullable",innerType:t})}function Ax(t){return fe(ra(t))}var ng=p("ZodDefault",(t,e)=>{hu.init(t,e),F.init(t,e),t._zod.processJSONSchema=(r,n,o)=>dh(t,r,n,o),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function og(t,e){return new ng({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():y.shallowClone(e)}})}var ig=p("ZodPrefault",(t,e)=>{gu.init(t,e),F.init(t,e),t._zod.processJSONSchema=(r,n,o)=>ph(t,r,n,o),t.unwrap=()=>t._zod.def.innerType});function ag(t,e){return new ig({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():y.shallowClone(e)}})}var Gl=p("ZodNonOptional",(t,e)=>{vu.init(t,e),F.init(t,e),t._zod.processJSONSchema=(r,n,o)=>lh(t,r,n,o),t.unwrap=()=>t._zod.def.innerType});function sg(t,e){return new Gl({type:"nonoptional",innerType:t,...y.normalizeParams(e)})}var cg=p("ZodSuccess",(t,e)=>{_u.init(t,e),F.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Ym(t,r,n,o),t.unwrap=()=>t._zod.def.innerType});function Ux(t){return new cg({type:"success",innerType:t})}var ug=p("ZodCatch",(t,e)=>{yu.init(t,e),F.init(t,e),t._zod.processJSONSchema=(r,n,o)=>fh(t,r,n,o),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function lg(t,e){return new ug({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}var dg=p("ZodNaN",(t,e)=>{$u.init(t,e),F.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Gm(t,r,n,o)});function Zx(t){return rl(dg,t)}var Bl=p("ZodPipe",(t,e)=>{bu.init(t,e),F.init(t,e),t._zod.processJSONSchema=(r,n,o)=>mh(t,r,n,o),t.in=e.in,t.out=e.out});function na(t,e){return new Bl({type:"pipe",in:t,out:e})}var Xl=p("ZodCodec",(t,e)=>{Bl.init(t,e),Qn.init(t,e)});function Cx(t,e,r){return new Xl({type:"pipe",in:t,out:e,transform:r.decode,reverseTransform:r.encode})}var pg=p("ZodReadonly",(t,e)=>{xu.init(t,e),F.init(t,e),t._zod.processJSONSchema=(r,n,o)=>hh(t,r,n,o),t.unwrap=()=>t._zod.def.innerType});function fg(t){return new pg({type:"readonly",innerType:t})}var mg=p("ZodTemplateLiteral",(t,e)=>{ku.init(t,e),F.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Bm(t,r,n,o)});function Mx(t,e){return new mg({type:"template_literal",parts:t,...y.normalizeParams(e)})}var hg=p("ZodLazy",(t,e)=>{zu.init(t,e),F.init(t,e),t._zod.processJSONSchema=(r,n,o)=>vh(t,r,n,o),t.unwrap=()=>t._zod.def.getter()});function gg(t){return new hg({type:"lazy",getter:t})}var vg=p("ZodPromise",(t,e)=>{wu.init(t,e),F.init(t,e),t._zod.processJSONSchema=(r,n,o)=>gh(t,r,n,o),t.unwrap=()=>t._zod.def.innerType});function Lx(t){return new vg({type:"promise",innerType:t})}var _g=p("ZodFunction",(t,e)=>{Su.init(t,e),F.init(t,e),t._zod.processJSONSchema=(r,n,o)=>eh(t,r,n,o)});function qx(t){return new _g({type:"function",input:Array.isArray(t?.input)?Wh(t?.input):t?.input??G(ue()),output:t?.output??ue()})}var fa=p("ZodCustom",(t,e)=>{Iu.init(t,e),F.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Qm(t,r,n,o)});function Fx(t){let e=new se({check:"custom"});return e._zod.check=t,e}function Yl(t,e){return ul(fa,t??(()=>!0),e)}function yg(t,e={}){return ll(fa,t,e)}function $g(t){return dl(t)}var Vx=pl,Jx=fl;function Kx(t,e={}){let r=new fa({type:"custom",check:"custom",fn:n=>n instanceof t,abort:!0,...y.normalizeParams(e)});return r._zod.bag.Class=t,r._zod.check=n=>{n.value instanceof t||n.issues.push({code:"invalid_type",expected:t.name,input:n.value,inst:r,path:[...r._zod.def.path??[]]})},r}var Hx=(...t)=>ml({Codec:Xl,Boolean:sa,String:oa},...t);function Wx(t){let e=gg(()=>ie([h(t),ne(),_e(),_o(),G(e),pe(h(),e)]));return e}function ma(t,e){return na(Hl(t),e)}var bg;bg||(bg={});var VN={...ho,...ea,iso:vr};ye(Eu());var ed="2025-11-25";var xg=[ed,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],Qt="io.modelcontextprotocol/related-task",ga="2.0",be=Yl(t=>t!==null&&(typeof t=="object"||typeof t=="function")),kg=ie([h(),ne().int()]),Sg=h(),u4=Ee({ttl:ie([ne(),_o()]).optional(),pollInterval:ne().optional()}),Yx=z({ttl:ne().optional()}),Qx=z({taskId:h()}),td=Ee({progressToken:kg.optional(),[Qt]:Qx.optional()}),Be=z({_meta:td.optional()}),$o=Be.extend({task:Yx.optional()}),wg=t=>$o.safeParse(t).success,xe=z({method:h(),params:Be.loose().optional()}),et=z({_meta:td.optional()}),tt=z({method:h(),params:et.loose().optional()}),ke=Ee({_meta:td.optional()}),va=ie([h(),ne().int()]),zg=z({jsonrpc:T(ga),id:va,...xe.shape}).strict(),rd=t=>zg.safeParse(t).success,Ig=z({jsonrpc:T(ga),...tt.shape}).strict(),Eg=t=>Ig.safeParse(t).success,nd=z({jsonrpc:T(ga),id:va,result:ke}).strict(),bo=t=>nd.safeParse(t).success;var Y;(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"})(Y||(Y={}));var od=z({jsonrpc:T(ga),id:va.optional(),error:z({code:ne().int(),message:h(),data:ue().optional()})}).strict();var Tg=t=>od.safeParse(t).success;var Pg=ie([zg,Ig,nd,od]),l4=ie([nd,od]),_a=ke.strict(),ek=et.extend({requestId:va.optional(),reason:h().optional()}),ya=tt.extend({method:T("notifications/cancelled"),params:ek}),tk=z({src:h(),mimeType:h().optional(),sizes:G(h()).optional(),theme:Te(["light","dark"]).optional()}),xo=z({icons:G(tk).optional()}),Yr=z({name:h(),title:h().optional()}),Og=Yr.extend({...Yr.shape,...xo.shape,version:h(),websiteUrl:h().optional(),description:h().optional()}),rk=yo(z({applyDefaults:_e().optional()}),pe(h(),ue())),nk=ma(t=>t&&typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length===0?{form:{}}:t,yo(z({form:rk.optional(),url:be.optional()}),pe(h(),ue()).optional())),ok=Ee({list:be.optional(),cancel:be.optional(),requests:Ee({sampling:Ee({createMessage:be.optional()}).optional(),elicitation:Ee({create:be.optional()}).optional()}).optional()}),ik=Ee({list:be.optional(),cancel:be.optional(),requests:Ee({tools:Ee({call:be.optional()}).optional()}).optional()}),ak=z({experimental:pe(h(),be).optional(),sampling:z({context:be.optional(),tools:be.optional()}).optional(),elicitation:nk.optional(),roots:z({listChanged:_e().optional()}).optional(),tasks:ok.optional()}),sk=Be.extend({protocolVersion:h(),capabilities:ak,clientInfo:Og}),id=xe.extend({method:T("initialize"),params:sk});var ck=z({experimental:pe(h(),be).optional(),logging:be.optional(),completions:be.optional(),prompts:z({listChanged:_e().optional()}).optional(),resources:z({subscribe:_e().optional(),listChanged:_e().optional()}).optional(),tools:z({listChanged:_e().optional()}).optional(),tasks:ik.optional()}),uk=ke.extend({protocolVersion:h(),capabilities:ck,serverInfo:Og,instructions:h().optional()}),ad=tt.extend({method:T("notifications/initialized"),params:et.optional()});var $a=xe.extend({method:T("ping"),params:Be.optional()}),lk=z({progress:ne(),total:fe(ne()),message:fe(h())}),dk=z({...et.shape,...lk.shape,progressToken:kg}),ba=tt.extend({method:T("notifications/progress"),params:dk}),pk=Be.extend({cursor:Sg.optional()}),ko=xe.extend({params:pk.optional()}),So=ke.extend({nextCursor:Sg.optional()}),fk=Te(["working","input_required","completed","failed","cancelled"]),wo=z({taskId:h(),status:fk,ttl:ie([ne(),_o()]),createdAt:h(),lastUpdatedAt:h(),pollInterval:fe(ne()),statusMessage:fe(h())}),Qr=ke.extend({task:wo}),mk=et.merge(wo),zo=tt.extend({method:T("notifications/tasks/status"),params:mk}),xa=xe.extend({method:T("tasks/get"),params:Be.extend({taskId:h()})}),ka=ke.merge(wo),Sa=xe.extend({method:T("tasks/result"),params:Be.extend({taskId:h()})}),d4=ke.loose(),wa=ko.extend({method:T("tasks/list")}),za=So.extend({tasks:G(wo)}),Ia=xe.extend({method:T("tasks/cancel"),params:Be.extend({taskId:h()})}),jg=ke.merge(wo),Dg=z({uri:h(),mimeType:fe(h()),_meta:pe(h(),ue()).optional()}),Ng=Dg.extend({text:h()}),sd=h().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),Rg=Dg.extend({blob:sd}),Io=Te(["user","assistant"]),en=z({audience:G(Io).optional(),priority:ne().min(0).max(1).optional(),lastModified:vr.datetime({offset:!0}).optional()}),Ag=z({...Yr.shape,...xo.shape,uri:h(),description:fe(h()),mimeType:fe(h()),annotations:en.optional(),_meta:fe(Ee({}))}),hk=z({...Yr.shape,...xo.shape,uriTemplate:h(),description:fe(h()),mimeType:fe(h()),annotations:en.optional(),_meta:fe(Ee({}))}),gk=ko.extend({method:T("resources/list")}),vk=So.extend({resources:G(Ag)}),_k=ko.extend({method:T("resources/templates/list")}),yk=So.extend({resourceTemplates:G(hk)}),cd=Be.extend({uri:h()}),$k=cd,bk=xe.extend({method:T("resources/read"),params:$k}),xk=ke.extend({contents:G(ie([Ng,Rg]))}),kk=tt.extend({method:T("notifications/resources/list_changed"),params:et.optional()}),Sk=cd,wk=xe.extend({method:T("resources/subscribe"),params:Sk}),zk=cd,Ik=xe.extend({method:T("resources/unsubscribe"),params:zk}),Ek=et.extend({uri:h()}),Tk=tt.extend({method:T("notifications/resources/updated"),params:Ek}),Pk=z({name:h(),description:fe(h()),required:fe(_e())}),Ok=z({...Yr.shape,...xo.shape,description:fe(h()),arguments:fe(G(Pk)),_meta:fe(Ee({}))}),jk=ko.extend({method:T("prompts/list")}),Dk=So.extend({prompts:G(Ok)}),Nk=Be.extend({name:h(),arguments:pe(h(),h()).optional()}),Rk=xe.extend({method:T("prompts/get"),params:Nk}),ud=z({type:T("text"),text:h(),annotations:en.optional(),_meta:pe(h(),ue()).optional()}),ld=z({type:T("image"),data:sd,mimeType:h(),annotations:en.optional(),_meta:pe(h(),ue()).optional()}),dd=z({type:T("audio"),data:sd,mimeType:h(),annotations:en.optional(),_meta:pe(h(),ue()).optional()}),Ak=z({type:T("tool_use"),name:h(),id:h(),input:pe(h(),ue()),_meta:pe(h(),ue()).optional()}),Uk=z({type:T("resource"),resource:ie([Ng,Rg]),annotations:en.optional(),_meta:pe(h(),ue()).optional()}),Zk=Ag.extend({type:T("resource_link")}),pd=ie([ud,ld,dd,Zk,Uk]),Ck=z({role:Io,content:pd}),Mk=ke.extend({description:h().optional(),messages:G(Ck)}),Lk=tt.extend({method:T("notifications/prompts/list_changed"),params:et.optional()}),qk=z({title:h().optional(),readOnlyHint:_e().optional(),destructiveHint:_e().optional(),idempotentHint:_e().optional(),openWorldHint:_e().optional()}),Fk=z({taskSupport:Te(["required","optional","forbidden"]).optional()}),Ug=z({...Yr.shape,...xo.shape,description:h().optional(),inputSchema:z({type:T("object"),properties:pe(h(),be).optional(),required:G(h()).optional()}).catchall(ue()),outputSchema:z({type:T("object"),properties:pe(h(),be).optional(),required:G(h()).optional()}).catchall(ue()).optional(),annotations:qk.optional(),execution:Fk.optional(),_meta:pe(h(),ue()).optional()}),fd=ko.extend({method:T("tools/list")}),Vk=So.extend({tools:G(Ug)}),Ea=ke.extend({content:G(pd).default([]),structuredContent:pe(h(),ue()).optional(),isError:_e().optional()}),p4=Ea.or(ke.extend({toolResult:ue()})),Jk=$o.extend({name:h(),arguments:pe(h(),ue()).optional()}),Eo=xe.extend({method:T("tools/call"),params:Jk}),Kk=tt.extend({method:T("notifications/tools/list_changed"),params:et.optional()}),f4=z({autoRefresh:_e().default(!0),debounceMs:ne().int().nonnegative().default(300)}),To=Te(["debug","info","notice","warning","error","critical","alert","emergency"]),Hk=Be.extend({level:To}),md=xe.extend({method:T("logging/setLevel"),params:Hk}),Wk=et.extend({level:To,logger:h().optional(),data:ue()}),Gk=tt.extend({method:T("notifications/message"),params:Wk}),Bk=z({name:h().optional()}),Xk=z({hints:G(Bk).optional(),costPriority:ne().min(0).max(1).optional(),speedPriority:ne().min(0).max(1).optional(),intelligencePriority:ne().min(0).max(1).optional()}),Yk=z({mode:Te(["auto","required","none"]).optional()}),Qk=z({type:T("tool_result"),toolUseId:h().describe("The unique identifier for the corresponding tool call."),content:G(pd).default([]),structuredContent:z({}).loose().optional(),isError:_e().optional(),_meta:pe(h(),ue()).optional()}),eS=da("type",[ud,ld,dd]),ha=da("type",[ud,ld,dd,Ak,Qk]),tS=z({role:Io,content:ie([ha,G(ha)]),_meta:pe(h(),ue()).optional()}),rS=$o.extend({messages:G(tS),modelPreferences:Xk.optional(),systemPrompt:h().optional(),includeContext:Te(["none","thisServer","allServers"]).optional(),temperature:ne().optional(),maxTokens:ne().int(),stopSequences:G(h()).optional(),metadata:be.optional(),tools:G(Ug).optional(),toolChoice:Yk.optional()}),nS=xe.extend({method:T("sampling/createMessage"),params:rS}),hd=ke.extend({model:h(),stopReason:fe(Te(["endTurn","stopSequence","maxTokens"]).or(h())),role:Io,content:eS}),gd=ke.extend({model:h(),stopReason:fe(Te(["endTurn","stopSequence","maxTokens","toolUse"]).or(h())),role:Io,content:ie([ha,G(ha)])}),oS=z({type:T("boolean"),title:h().optional(),description:h().optional(),default:_e().optional()}),iS=z({type:T("string"),title:h().optional(),description:h().optional(),minLength:ne().optional(),maxLength:ne().optional(),format:Te(["email","uri","date","date-time"]).optional(),default:h().optional()}),aS=z({type:Te(["number","integer"]),title:h().optional(),description:h().optional(),minimum:ne().optional(),maximum:ne().optional(),default:ne().optional()}),sS=z({type:T("string"),title:h().optional(),description:h().optional(),enum:G(h()),default:h().optional()}),cS=z({type:T("string"),title:h().optional(),description:h().optional(),oneOf:G(z({const:h(),title:h()})),default:h().optional()}),uS=z({type:T("string"),title:h().optional(),description:h().optional(),enum:G(h()),enumNames:G(h()).optional(),default:h().optional()}),lS=ie([sS,cS]),dS=z({type:T("array"),title:h().optional(),description:h().optional(),minItems:ne().optional(),maxItems:ne().optional(),items:z({type:T("string"),enum:G(h())}),default:G(h()).optional()}),pS=z({type:T("array"),title:h().optional(),description:h().optional(),minItems:ne().optional(),maxItems:ne().optional(),items:z({anyOf:G(z({const:h(),title:h()}))}),default:G(h()).optional()}),fS=ie([dS,pS]),mS=ie([uS,lS,fS]),hS=ie([mS,oS,iS,aS]),gS=$o.extend({mode:T("form").optional(),message:h(),requestedSchema:z({type:T("object"),properties:pe(h(),hS),required:G(h()).optional()})}),vS=$o.extend({mode:T("url"),message:h(),elicitationId:h(),url:h().url()}),_S=ie([gS,vS]),yS=xe.extend({method:T("elicitation/create"),params:_S}),$S=et.extend({elicitationId:h()}),bS=tt.extend({method:T("notifications/elicitation/complete"),params:$S}),Ta=ke.extend({action:Te(["accept","decline","cancel"]),content:ma(t=>t===null?void 0:t,pe(h(),ie([h(),ne(),_e(),G(h())])).optional())}),xS=z({type:T("ref/resource"),uri:h()});var kS=z({type:T("ref/prompt"),name:h()}),SS=Be.extend({ref:ie([kS,xS]),argument:z({name:h(),value:h()}),context:z({arguments:pe(h(),h()).optional()}).optional()}),wS=xe.extend({method:T("completion/complete"),params:SS});var zS=ke.extend({completion:Ee({values:G(h()).max(100),total:fe(ne().int()),hasMore:fe(_e())})}),IS=z({uri:h().startsWith("file://"),name:h().optional(),_meta:pe(h(),ue()).optional()}),ES=xe.extend({method:T("roots/list"),params:Be.optional()}),vd=ke.extend({roots:G(IS)}),TS=tt.extend({method:T("notifications/roots/list_changed"),params:et.optional()}),m4=ie([$a,id,wS,md,Rk,jk,gk,_k,bk,wk,Ik,Eo,fd,xa,Sa,wa,Ia]),h4=ie([ya,ba,ad,TS,zo]),g4=ie([_a,hd,gd,Ta,vd,ka,za,Qr]),v4=ie([$a,nS,yS,ES,xa,Sa,wa,Ia]),_4=ie([ya,ba,Gk,Tk,kk,Kk,Lk,zo,bS]),y4=ie([_a,uk,zS,Mk,Dk,vk,yk,xk,Ea,Vk,ka,za,Qr]),V=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===Y.UrlElicitationRequired&&n){let o=n;if(o.elicitations)return new Ql(o.elicitations,r)}return new t(e,r,n)}},Ql=class extends V{constructor(e,r=`URL elicitation${e.length>1?"s":""} required`){super(Y.UrlElicitationRequired,r,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}};function er(t){return t==="completed"||t==="failed"||t==="cancelled"}var Q4=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function _d(t){let r=Qi(t)?.method;if(!r)throw new Error("Schema is missing a method literal");let n=bh(r);if(typeof n!="string")throw new Error("Schema method literal must be a string");return n}function yd(t,e){let r=Yt(t,e);if(!r.success)throw r.error;return r.data}var RS=6e4,Pa=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(ya,r=>{this._oncancel(r)}),this.setNotificationHandler(ba,r=>{this._onprogress(r)}),this.setRequestHandler($a,r=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(xa,async(r,n)=>{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new V(Y.InvalidParams,"Failed to retrieve task: Task not found");return{...o}}),this.setRequestHandler(Sa,async(r,n)=>{let o=async()=>{let i=r.params.taskId;if(this._taskMessageQueue){let s;for(;s=await this._taskMessageQueue.dequeue(i,n.sessionId);){if(s.type==="response"||s.type==="error"){let c=s.message,u=c.id,l=this._requestResolvers.get(u);if(l)if(this._requestResolvers.delete(u),s.type==="response")l(c);else{let d=c,m=new V(d.error.code,d.error.message,d.error.data);l(m)}else{let d=s.type==="response"?"Response":"Error";this._onerror(new Error(`${d} handler missing for request ${u}`))}continue}await this._transport?.send(s.message,{relatedRequestId:n.requestId})}}let a=await this._taskStore.getTask(i,n.sessionId);if(!a)throw new V(Y.InvalidParams,`Task not found: ${i}`);if(!er(a.status))return await this._waitForTaskUpdate(i,n.signal),await o();if(er(a.status)){let s=await this._taskStore.getTaskResult(i,n.sessionId);return this._clearTaskQueue(i),{...s,_meta:{...s._meta,[Qt]:{taskId:i}}}}return await o()};return await o()}),this.setRequestHandler(wa,async(r,n)=>{try{let{tasks:o,nextCursor:i}=await this._taskStore.listTasks(r.params?.cursor,n.sessionId);return{tasks:o,nextCursor:i,_meta:{}}}catch(o){throw new V(Y.InvalidParams,`Failed to list tasks: ${o instanceof Error?o.message:String(o)}`)}}),this.setRequestHandler(Ia,async(r,n)=>{try{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new V(Y.InvalidParams,`Task not found: ${r.params.taskId}`);if(er(o.status))throw new V(Y.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 i=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!i)throw new V(Y.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...i}}catch(o){throw o instanceof V?o:new V(Y.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,i=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(o,r),startTime:Date.now(),timeout:r,maxTotalTimeout:n,resetTimeoutOnProgress:i,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),V.fromError(Y.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=i=>{n?.(i),this._onerror(i)};let o=this._transport?.onmessage;this._transport.onmessage=(i,a)=>{o?.(i,a),bo(i)||Tg(i)?this._onresponse(i):rd(i)?this._onrequest(i,a):Eg(i)?this._onnotification(i):this._onerror(new Error(`Unknown message type: ${JSON.stringify(i)}`))},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=V.fromError(Y.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,i=e.params?._meta?.[Qt]?.taskId;if(n===void 0){let l={jsonrpc:"2.0",id:e.id,error:{code:Y.MethodNotFound,message:"Method not found"}};i&&this._taskMessageQueue?this._enqueueTaskMessage(i,{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 a=new AbortController;this._requestHandlerAbortControllers.set(e.id,a);let s=wg(e.params)?e.params.task:void 0,c=this._taskStore?this.requestTaskStore(e,o?.sessionId):void 0,u={signal:a.signal,sessionId:o?.sessionId,_meta:e.params?._meta,sendNotification:async l=>{if(a.signal.aborted)return;let d={relatedRequestId:e.id};i&&(d.relatedTask={taskId:i}),await this.notification(l,d)},sendRequest:async(l,d,m)=>{if(a.signal.aborted)throw new V(Y.ConnectionClosed,"Request was cancelled");let f={...m,relatedRequestId:e.id};i&&!f.relatedTask&&(f.relatedTask={taskId:i});let g=f.relatedTask?.taskId??i;return g&&c&&await c.updateTaskStatus(g,"input_required"),await this.request(l,d,f)},authInfo:r?.authInfo,requestId:e.id,requestInfo:r?.requestInfo,taskId:i,taskStore:c,taskRequestedTtl:s?.ttl,closeSSEStream:r?.closeSSEStream,closeStandaloneSSEStream:r?.closeStandaloneSSEStream};Promise.resolve().then(()=>{s&&this.assertTaskHandlerCapability(e.method)}).then(()=>n(e,u)).then(async l=>{if(a.signal.aborted)return;let d={result:l,jsonrpc:"2.0",id:e.id};i&&this._taskMessageQueue?await this._enqueueTaskMessage(i,{type:"response",message:d,timestamp:Date.now()},o?.sessionId):await o?.send(d)},async l=>{if(a.signal.aborted)return;let d={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(l.code)?l.code:Y.InternalError,message:l.message??"Internal error",...l.data!==void 0&&{data:l.data}}};i&&this._taskMessageQueue?await this._enqueueTaskMessage(i,{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),i=this._progressHandlers.get(o);if(!i){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let a=this._responseHandlers.get(o),s=this._timeoutInfo.get(o);if(s&&a&&s.resetTimeoutOnProgress)try{this._resetTimeout(o)}catch(c){this._responseHandlers.delete(o),this._progressHandlers.delete(o),this._cleanupTimeout(o),a(c);return}i(n)}_onresponse(e){let r=Number(e.id),n=this._requestResolvers.get(r);if(n){if(this._requestResolvers.delete(r),bo(e))n(e);else{let a=new V(e.error.code,e.error.message,e.error.data);n(a)}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 i=!1;if(bo(e)&&e.result&&typeof e.result=="object"){let a=e.result;if(a.task&&typeof a.task=="object"){let s=a.task;typeof s.taskId=="string"&&(i=!0,this._taskProgressTokens.set(s.taskId,r))}}if(i||this._progressHandlers.delete(r),bo(e))o(e);else{let a=V.fromError(e.error.code,e.error.message,e.error.data);o(a)}}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(a){yield{type:"error",error:a instanceof V?a:new V(Y.InternalError,String(a))}}return}let i;try{let a=await this.request(e,Qr,n);if(a.task)i=a.task.taskId,yield{type:"taskCreated",task:a.task};else throw new V(Y.InternalError,"Task creation did not return a task");for(;;){let s=await this.getTask({taskId:i},n);if(yield{type:"taskStatus",task:s},er(s.status)){s.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:i},r,n)}:s.status==="failed"?yield{type:"error",error:new V(Y.InternalError,`Task ${i} failed`)}:s.status==="cancelled"&&(yield{type:"error",error:new V(Y.InternalError,`Task ${i} was cancelled`)});return}if(s.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:i},r,n)};return}let c=s.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(u=>setTimeout(u,c)),n?.signal?.throwIfAborted()}}catch(a){yield{type:"error",error:a instanceof V?a:new V(Y.InternalError,String(a))}}}request(e,r,n){let{relatedRequestId:o,resumptionToken:i,onresumptiontoken:a,task:s,relatedTask:c}=n??{};return new Promise((u,l)=>{let d=O=>{l(O)};if(!this._transport){d(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),s&&this.assertTaskCapability(e.method)}catch(O){d(O);return}n?.signal?.throwIfAborted();let m=this._requestMessageId++,f={...e,jsonrpc:"2.0",id:m};n?.onprogress&&(this._progressHandlers.set(m,n.onprogress),f.params={...e.params,_meta:{...e.params?._meta||{},progressToken:m}}),s&&(f.params={...f.params,task:s}),c&&(f.params={...f.params,_meta:{...f.params?._meta||{},[Qt]:c}});let g=O=>{this._responseHandlers.delete(m),this._progressHandlers.delete(m),this._cleanupTimeout(m),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:m,reason:String(O)}},{relatedRequestId:o,resumptionToken:i,onresumptiontoken:a}).catch(Z=>this._onerror(new Error(`Failed to send cancellation: ${Z}`)));let I=O instanceof V?O:new V(Y.RequestTimeout,String(O));l(I)};this._responseHandlers.set(m,O=>{if(!n?.signal?.aborted){if(O instanceof Error)return l(O);try{let I=Yt(r,O.result);I.success?u(I.data):l(I.error)}catch(I){l(I)}}}),n?.signal?.addEventListener("abort",()=>{g(n?.signal?.reason)});let v=n?.timeout??RS,$=()=>g(V.fromError(Y.RequestTimeout,"Request timed out",{timeout:v}));this._setupTimeout(m,v,n?.maxTotalTimeout,$,n?.resetTimeoutOnProgress??!1);let k=c?.taskId;if(k){let O=I=>{let Z=this._responseHandlers.get(m);Z?Z(I):this._onerror(new Error(`Response handler missing for side-channeled request ${m}`))};this._requestResolvers.set(m,O),this._enqueueTaskMessage(k,{type:"request",message:f,timestamp:Date.now()}).catch(I=>{this._cleanupTimeout(m),l(I)})}else this._transport.send(f,{relatedRequestId:o,resumptionToken:i,onresumptiontoken:a}).catch(O=>{this._cleanupTimeout(m),l(O)})})}async getTask(e,r){return this.request({method:"tasks/get",params:e},ka,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},za,r)}async cancelTask(e,r){return this.request({method:"tasks/cancel",params:e},jg,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 s={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[Qt]:r.relatedTask}}};await this._enqueueTaskMessage(n,{type:"notification",message:s,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 s={...e,jsonrpc:"2.0"};r?.relatedTask&&(s={...s,params:{...s.params,_meta:{...s.params?._meta||{},[Qt]:r.relatedTask}}}),this._transport?.send(s,r).catch(c=>this._onerror(c))});return}let a={...e,jsonrpc:"2.0"};r?.relatedTask&&(a={...a,params:{...a.params,_meta:{...a.params?._meta||{},[Qt]:r.relatedTask}}}),await this._transport.send(a,r)}setRequestHandler(e,r){let n=_d(e);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(o,i)=>{let a=yd(e,o);return Promise.resolve(r(a,i))})}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=_d(e);this._notificationHandlers.set(n,o=>{let i=yd(e,o);return Promise.resolve(r(i))})}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"&&rd(o.message)){let i=o.message.id,a=this._requestResolvers.get(i);a?(a(new V(Y.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(i)):this._onerror(new Error(`Resolver missing for request ${i} 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,i)=>{if(r.aborted){i(new V(Y.InvalidRequest,"Request cancelled"));return}let a=setTimeout(o,n);r.addEventListener("abort",()=>{clearTimeout(a),i(new V(Y.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 i=await n.getTask(o,r);if(!i)throw new V(Y.InvalidParams,"Failed to retrieve task: Task not found");return i},storeTaskResult:async(o,i,a)=>{await n.storeTaskResult(o,i,a,r);let s=await n.getTask(o,r);if(s){let c=zo.parse({method:"notifications/tasks/status",params:s});await this.notification(c),er(s.status)&&this._cleanupTaskProgressHandler(o)}},getTaskResult:o=>n.getTaskResult(o,r),updateTaskStatus:async(o,i,a)=>{let s=await n.getTask(o,r);if(!s)throw new V(Y.InvalidParams,`Task "${o}" not found - it may have been cleaned up`);if(er(s.status))throw new V(Y.InvalidParams,`Cannot update task "${o}" from terminal status "${s.status}" to "${i}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await n.updateTaskStatus(o,i,a,r);let c=await n.getTask(o,r);if(c){let u=zo.parse({method:"notifications/tasks/status",params:c});await this.notification(u),er(c.status)&&this._cleanupTaskProgressHandler(o)}},listTasks:o=>n.listTasks(o,r)}}};function Zg(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function Cg(t,e){let r={...t};for(let n in e){let o=n,i=e[o];if(i===void 0)continue;let a=r[o];Zg(a)&&Zg(i)?r[o]={...a,...i}:r[o]=i}return r}var wy=si(of(),1),zy=si(Sy(),1);function zT(){let t=new wy.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,zy.default)(t),t}var ps=class{constructor(e){this._ajv=e??zT()}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 fs=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 Iy(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 Ey(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 ms=class extends Pa{constructor(e,r){super(r),this._serverInfo=e,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(To.options.map((n,o)=>[n,o])),this.isMessageIgnored=(n,o)=>{let i=this._loggingLevels.get(o);return i?this.LOG_LEVEL_SEVERITY.get(n)<this.LOG_LEVEL_SEVERITY.get(i):!1},this._capabilities=r?.capabilities??{},this._instructions=r?.instructions,this._jsonSchemaValidator=r?.jsonSchemaValidator??new ps,this.setRequestHandler(id,n=>this._oninitialize(n)),this.setNotificationHandler(ad,()=>this.oninitialized?.()),this._capabilities.logging&&this.setRequestHandler(md,async(n,o)=>{let i=o.sessionId||o.requestInfo?.headers["mcp-session-id"]||void 0,{level:a}=n.params,s=To.safeParse(a);return s.success&&this._loggingLevels.set(i,s.data),{}})}get experimental(){return this._experimental||(this._experimental={tasks:new fs(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=Cg(this._capabilities,e)}setRequestHandler(e,r){let o=Qi(e)?.method;if(!o)throw new Error("Schema is missing a method literal");let i;if(Br(o)){let s=o;i=s._zod?.def?.value??s.value}else{let s=o;i=s._def?.value??s.value}if(typeof i!="string")throw new Error("Schema method literal must be a string");if(i==="tools/call"){let s=async(c,u)=>{let l=Yt(Eo,c);if(!l.success){let g=l.error instanceof Error?l.error.message:String(l.error);throw new V(Y.InvalidParams,`Invalid tools/call request: ${g}`)}let{params:d}=l.data,m=await Promise.resolve(r(c,u));if(d.task){let g=Yt(Qr,m);if(!g.success){let v=g.error instanceof Error?g.error.message:String(g.error);throw new V(Y.InvalidParams,`Invalid task creation result: ${v}`)}return g.data}let f=Yt(Ea,m);if(!f.success){let g=f.error instanceof Error?f.error.message:String(f.error);throw new V(Y.InvalidParams,`Invalid tools/call result: ${g}`)}return f.data};return super.setRequestHandler(e,s)}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){Ey(this._clientCapabilities?.tasks?.requests,e,"Client")}assertTaskHandlerCapability(e){this._capabilities&&Iy(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:xg.includes(r)?r:ed,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"},_a)}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],i=o.some(u=>u.type==="tool_result"),a=e.messages.length>1?e.messages[e.messages.length-2]:void 0,s=a?Array.isArray(a.content)?a.content:[a.content]:[],c=s.some(u=>u.type==="tool_use");if(i){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(s.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},gd,r):this.request({method:"sampling/createMessage",params:e},hd,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},Ta,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"},i=await this.request({method:"elicitation/create",params:o},Ta,r);if(i.action==="accept"&&i.content&&o.requestedSchema)try{let s=this._jsonSchemaValidator.getValidator(o.requestedSchema)(i.content);if(!s.valid)throw new V(Y.InvalidParams,`Elicitation response content does not match requested schema: ${s.errorMessage}`)}catch(a){throw a instanceof V?a:new V(Y.InternalError,`Error validating elicitation response: ${a instanceof Error?a.message:String(a)}`)}return i}}}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},vd,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 ff=si(require("node:process"),1);var hs=class{append(e){this._buffer=this._buffer?Buffer.concat([this._buffer,e]):e}readMessage(){if(!this._buffer)return null;let e=this._buffer.indexOf(`
56
- `);if(e===-1)return null;let r=this._buffer.toString("utf8",0,e).replace(/\r$/,"");return this._buffer=this._buffer.subarray(e+1),IT(r)}clear(){this._buffer=void 0}};function IT(t){return Pg.parse(JSON.parse(t))}function Ty(t){return JSON.stringify(t)+`
57
- `}var gs=class{constructor(e=ff.default.stdin,r=ff.default.stdout){this._stdin=e,this._stdout=r,this._readBuffer=new hs,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=Ty(e);this._stdout.write(n)?r():this._stdout.once("drain",r)})}};var hf=si(require("path"),1);var mf={DEFAULT:3e5,HEALTH_CHECK:3e3,POST_SPAWN_WAIT:5e3,PORT_IN_USE_WAIT:3e3,WORKER_STARTUP_WAIT:1e3,PRE_RESTART_SETTLE_DELAY:2e3,POWERSHELL_COMMAND:1e4,WINDOWS_MULTIPLIER:1.5};function Py(t){return process.platform==="win32"?Math.round(t*mf.WINDOWS_MULTIPLIER):t}var wt=require("fs"),vs=require("path"),Dy=require("os");var Oy="bugfix,feature,refactor,discovery,decision,change",jy="how-it-works,why-it-exists,what-changed,problem-solution,gotcha,pattern,trade-off";var qt=class{static DEFAULTS={CLAUDE_MEM_MODEL:"claude-sonnet-4-5",CLAUDE_MEM_CONTEXT_OBSERVATIONS:"50",CLAUDE_MEM_WORKER_PORT:"37777",CLAUDE_MEM_WORKER_HOST:"127.0.0.1",CLAUDE_MEM_SKIP_TOOLS:"ListMcpResourcesTool,SlashCommand,Skill,TodoWrite,AskUserQuestion",CLAUDE_MEM_PROVIDER:"claude",CLAUDE_MEM_CLAUDE_AUTH_METHOD:"cli",CLAUDE_MEM_GEMINI_API_KEY:"",CLAUDE_MEM_GEMINI_MODEL:"gemini-2.5-flash-lite",CLAUDE_MEM_GEMINI_RATE_LIMITING_ENABLED:"true",CLAUDE_MEM_OPENROUTER_API_KEY:"",CLAUDE_MEM_OPENROUTER_MODEL:"xiaomi/mimo-v2-flash:free",CLAUDE_MEM_OPENROUTER_SITE_URL:"",CLAUDE_MEM_OPENROUTER_APP_NAME:"claude-mem",CLAUDE_MEM_OPENROUTER_MAX_CONTEXT_MESSAGES:"20",CLAUDE_MEM_OPENROUTER_MAX_TOKENS:"100000",CLAUDE_MEM_DATA_DIR:(0,vs.join)((0,Dy.homedir)(),".claude-mem"),CLAUDE_MEM_LOG_LEVEL:"INFO",CLAUDE_MEM_PYTHON_VERSION:"3.13",CLAUDE_CODE_PATH:"",CLAUDE_MEM_MODE:"code",CLAUDE_MEM_CONTEXT_SHOW_READ_TOKENS:"true",CLAUDE_MEM_CONTEXT_SHOW_WORK_TOKENS:"true",CLAUDE_MEM_CONTEXT_SHOW_SAVINGS_AMOUNT:"true",CLAUDE_MEM_CONTEXT_SHOW_SAVINGS_PERCENT:"true",CLAUDE_MEM_CONTEXT_OBSERVATION_TYPES:Oy,CLAUDE_MEM_CONTEXT_OBSERVATION_CONCEPTS:jy,CLAUDE_MEM_CONTEXT_FULL_COUNT:"5",CLAUDE_MEM_CONTEXT_FULL_FIELD:"narrative",CLAUDE_MEM_CONTEXT_SESSION_COUNT:"10",CLAUDE_MEM_CONTEXT_SHOW_LAST_SUMMARY:"true",CLAUDE_MEM_CONTEXT_SHOW_LAST_MESSAGE:"false",CLAUDE_MEM_FOLDER_CLAUDEMD_ENABLED:"false",CLAUDE_MEM_EXCLUDED_PROJECTS:"",CLAUDE_MEM_FOLDER_MD_EXCLUDE:"[]",CLAUDE_MEM_CHROMA_MODE:"local",CLAUDE_MEM_CHROMA_HOST:"127.0.0.1",CLAUDE_MEM_CHROMA_PORT:"8000",CLAUDE_MEM_CHROMA_SSL:"false",CLAUDE_MEM_CHROMA_API_KEY:"",CLAUDE_MEM_CHROMA_TENANT:"default_tenant",CLAUDE_MEM_CHROMA_DATABASE:"default_database"};static getAllDefaults(){return{...this.DEFAULTS}}static get(e){return this.DEFAULTS[e]}static getInt(e){let r=this.get(e);return parseInt(r,10)}static getBool(e){let r=this.get(e);return r==="true"||r===!0}static applyEnvOverrides(e){let r={...e};for(let n of Object.keys(this.DEFAULTS))process.env[n]!==void 0&&(r[n]=process.env[n]);return r}static loadFromFile(e){try{if(!(0,wt.existsSync)(e)){let a=this.getAllDefaults();try{let s=(0,vs.dirname)(e);(0,wt.existsSync)(s)||(0,wt.mkdirSync)(s,{recursive:!0}),(0,wt.writeFileSync)(e,JSON.stringify(a,null,2),"utf-8"),console.log("[SETTINGS] Created settings file with defaults:",e)}catch(s){console.warn("[SETTINGS] Failed to create settings file, using in-memory defaults:",e,s)}return this.applyEnvOverrides(a)}let r=(0,wt.readFileSync)(e,"utf-8"),n=JSON.parse(r),o=n;if(n.env&&typeof n.env=="object"){o=n.env;try{(0,wt.writeFileSync)(e,JSON.stringify(o,null,2),"utf-8"),console.log("[SETTINGS] Migrated settings file from nested to flat schema:",e)}catch(a){console.warn("[SETTINGS] Failed to auto-migrate settings file:",e,a)}}let i={...this.DEFAULTS};for(let a of Object.keys(this.DEFAULTS))o[a]!==void 0&&(i[a]=o[a]);return this.applyEnvOverrides(i)}catch(r){return console.warn("[SETTINGS] Failed to load settings, using defaults:",e,r),this.applyEnvOverrides(this.getAllDefaults())}}};var $e=require("path"),Ny=require("os");var Ry=require("url");var PT={};function ET(){return typeof __dirname<"u"?__dirname:(0,$e.dirname)((0,Ry.fileURLToPath)(PT.url))}var AZ=ET(),Ft=qt.get("CLAUDE_MEM_DATA_DIR"),_s=process.env.CLAUDE_CONFIG_DIR||(0,$e.join)((0,Ny.homedir)(),".claude"),TT=(0,$e.join)(_s,"plugins","marketplaces","thedotmack"),UZ=(0,$e.join)(Ft,"archives"),ZZ=(0,$e.join)(Ft,"logs"),CZ=(0,$e.join)(Ft,"trash"),MZ=(0,$e.join)(Ft,"backups"),LZ=(0,$e.join)(Ft,"modes"),qZ=(0,$e.join)(Ft,"settings.json"),FZ=(0,$e.join)(Ft,"claude-mem.db"),VZ=(0,$e.join)(Ft,"vector-db"),JZ=(0,$e.join)(Ft,"observer-sessions"),KZ=(0,$e.join)(_s,"settings.json"),HZ=(0,$e.join)(_s,"commands"),WZ=(0,$e.join)(_s,"CLAUDE.md");var eC=(()=>{let t=process.env.CLAUDE_MEM_HEALTH_TIMEOUT_MS;if(t){let e=parseInt(t,10);if(Number.isFinite(e)&&e>=500&&e<=3e5)return e;ve.warn("SYSTEM","Invalid CLAUDE_MEM_HEALTH_TIMEOUT_MS, using default",{value:t,min:500,max:3e5})}return Py(mf.HEALTH_CHECK)})();var ys=null,$s=null;function Ay(){if(ys!==null)return ys;let t=hf.default.join(qt.get("CLAUDE_MEM_DATA_DIR"),"settings.json"),e=qt.loadFromFile(t);return ys=parseInt(e.CLAUDE_MEM_WORKER_PORT,10),ys}function Uy(){if($s!==null)return $s;let t=hf.default.join(qt.get("CLAUDE_MEM_DATA_DIR"),"settings.json");return $s=qt.loadFromFile(t).CLAUDE_MEM_WORKER_HOST,$s}var OT="10.0.8";console.log=(...t)=>{ve.error("CONSOLE","Intercepted console output (MCP protocol protection)",void 0,{args:t})};var jT=Ay(),DT=Uy(),ai=`http://${DT}:${jT}`,Zy={search:"/api/search",timeline:"/api/timeline"};async function Cy(t,e){ve.debug("SYSTEM","\u2192 Worker API",void 0,{endpoint:t,params:e});try{let r=new URLSearchParams;for(let[a,s]of Object.entries(e))s!=null&&r.append(a,String(s));let n=`${ai}${t}?${r}`,o=await fetch(n);if(!o.ok){let a=await o.text();throw new Error(`Worker API error (${o.status}): ${a}`)}let i=await o.json();return ve.debug("SYSTEM","\u2190 Worker API success",void 0,{endpoint:t}),i}catch(r){return ve.error("SYSTEM","\u2190 Worker API error",{endpoint:t},r),{content:[{type:"text",text:`Error calling Worker API: ${r instanceof Error?r.message:String(r)}`}],isError:!0}}}async function My(t,e){ve.debug("HTTP","Worker API request (POST)",void 0,{endpoint:t});try{let r=`${ai}${t}`,n=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!n.ok){let i=await n.text();throw new Error(`Worker API error (${n.status}): ${i}`)}let o=await n.json();return ve.debug("HTTP","Worker API success (POST)",void 0,{endpoint:t}),{content:[{type:"text",text:JSON.stringify(o,null,2)}]}}catch(r){return ve.error("HTTP","Worker API error (POST)",{endpoint:t},r),{content:[{type:"text",text:`Error calling Worker API: ${r instanceof Error?r.message:String(r)}`}],isError:!0}}}async function NT(){try{return(await fetch(`${ai}/api/health`)).ok}catch(t){return ve.debug("SYSTEM","Worker health check failed",{},t),!1}}var Ly=[{name:"__IMPORTANT",description:`3-LAYER WORKFLOW (ALWAYS FOLLOW):
80
+ 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 As(t,e){let r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=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){o(d);let f=t.seen.get(d),m=f.schema;if(m.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(m)):Object.assign(u,m),Object.assign(u,l),a._zod.parent===d)for(let y in u)y==="$ref"||y==="allOf"||y in l||delete u[y];if(m.$ref&&f.def)for(let y in u)y==="$ref"||y==="allOf"||y in f.def&&JSON.stringify(u[y])===JSON.stringify(f.def[y])&&delete u[y]}let p=a._zod.parent;if(p&&p!==d){o(p);let f=t.seen.get(p);if(f?.schema.$ref&&(u.$ref=f.schema.$ref,f.def))for(let m in u)m==="$ref"||m==="allOf"||m in f.def&&JSON.stringify(u[m])===JSON.stringify(f.def[m])&&delete u[m]}t.override({zodSchema:a,jsonSchema:u,path:c.path??[]})};for(let a of[...t.seen.entries()].reverse())o(a[0]);let n={};if(t.target==="draft-2020-12"?n.$schema="https://json-schema.org/draft/2020-12/schema":t.target==="draft-07"?n.$schema="http://json-schema.org/draft-07/schema#":t.target==="draft-04"?n.$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");n.$id=t.external.uri(a)}Object.assign(n,r.def??r.schema);let s=t.metadataRegistry.get(e)?.id;s!==void 0&&n.id===s&&delete n.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"?n.$defs=i:n.definitions=i);try{let a=JSON.parse(JSON.stringify(n));return Object.defineProperty(a,"~standard",{value:{...e["~standard"],jsonSchema:{input:xr(e,"input",t.processors),output:xr(e,"output",t.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function _e(t,e){let r=e??{seen:new Set};if(r.seen.has(t))return!1;r.seen.add(t);let o=t._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return _e(o.element,r);if(o.type==="set")return _e(o.valueType,r);if(o.type==="lazy")return _e(o.getter(),r);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault")return _e(o.innerType,r);if(o.type==="intersection")return _e(o.left,r)||_e(o.right,r);if(o.type==="record"||o.type==="map")return _e(o.keyType,r)||_e(o.valueType,r);if(o.type==="pipe")return t._zod.traits.has("$ZodCodec")?!0:_e(o.in,r)||_e(o.out,r);if(o.type==="object"){for(let n in o.shape)if(_e(o.shape[n],r))return!0;return!1}if(o.type==="union"){for(let n of o.options)if(_e(n,r))return!0;return!1}if(o.type==="tuple"){for(let n of o.items)if(_e(n,r))return!0;return!!(o.rest&&_e(o.rest,r))}return!1}var sd=(t,e={})=>r=>{let o=Rs({...r,processors:e});return oe(t,o),Is(o,t),As(o,t)},xr=(t,e,r={})=>o=>{let{libraryOptions:n,target:s}=o??{},i=Rs({...n??{},target:s,io:e,processors:r});return oe(t,i),Is(i,t),As(i,t)};var Sg={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},id=(t,e,r,o)=>{let n=r;n.type="string";let{minimum:s,maximum:i,format:a,patterns:c,contentEncoding:u}=t._zod.bag;if(typeof s=="number"&&(n.minLength=s),typeof i=="number"&&(n.maxLength=i),a&&(n.format=Sg[a]??a,n.format===""&&delete n.format,a==="time"&&delete n.format),u&&(n.contentEncoding=u),c&&c.size>0){let l=[...c];l.length===1?n.pattern=l[0].source:l.length>1&&(n.allOf=[...l.map(d=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},ad=(t,e,r,o)=>{let n=r,{minimum:s,maximum:i,format:a,multipleOf:c,exclusiveMaximum:u,exclusiveMinimum:l}=t._zod.bag;typeof a=="string"&&a.includes("int")?n.type="integer":n.type="number";let d=typeof l=="number"&&l>=(s??Number.NEGATIVE_INFINITY),p=typeof u=="number"&&u<=(i??Number.POSITIVE_INFINITY),f=e.target==="draft-04"||e.target==="openapi-3.0";d?f?(n.minimum=l,n.exclusiveMinimum=!0):n.exclusiveMinimum=l:typeof s=="number"&&(n.minimum=s),p?f?(n.maximum=u,n.exclusiveMaximum=!0):n.exclusiveMaximum=u:typeof i=="number"&&(n.maximum=i),typeof c=="number"&&(n.multipleOf=c)},cd=(t,e,r,o)=>{r.type="boolean"};var ud=(t,e,r,o)=>{e.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"};var ld=(t,e,r,o)=>{r.not={}};var dd=(t,e,r,o)=>{};var pd=(t,e,r,o)=>{let n=t._zod.def,s=hr(n.entries);s.every(i=>typeof i=="number")&&(r.type="number"),s.every(i=>typeof i=="string")&&(r.type="string"),r.enum=s},fd=(t,e,r,o)=>{let n=t._zod.def,s=[];for(let i of n.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 md=(t,e,r,o)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")};var hd=(t,e,r,o)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")};var gd=(t,e,r,o)=>{let n=r,s=t._zod.def,{minimum:i,maximum:a}=t._zod.bag;typeof i=="number"&&(n.minItems=i),typeof a=="number"&&(n.maxItems=a),n.type="array",n.items=oe(s.element,e,{...o,path:[...o.path,"items"]})},_d=(t,e,r,o)=>{let n=r,s=t._zod.def;n.type="object",n.properties={};let i=s.shape;for(let u in i)n.properties[u]=oe(i[u],e,{...o,path:[...o.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&&(n.required=Array.from(c)),s.catchall?._zod.def.type==="never"?n.additionalProperties=!1:s.catchall?s.catchall&&(n.additionalProperties=oe(s.catchall,e,{...o,path:[...o.path,"additionalProperties"]})):e.io==="output"&&(n.additionalProperties=!1)},yd=(t,e,r,o)=>{let n=t._zod.def,s=n.inclusive===!1,i=n.options.map((a,c)=>oe(a,e,{...o,path:[...o.path,s?"oneOf":"anyOf",c]}));s?r.oneOf=i:r.anyOf=i},vd=(t,e,r,o)=>{let n=t._zod.def,s=oe(n.left,e,{...o,path:[...o.path,"allOf",0]}),i=oe(n.right,e,{...o,path:[...o.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 $d=(t,e,r,o)=>{let n=r,s=t._zod.def;n.type="object";let i=s.keyType,c=i._zod.bag?.patterns;if(s.mode==="loose"&&c&&c.size>0){let l=oe(s.valueType,e,{...o,path:[...o.path,"patternProperties","*"]});n.patternProperties={};for(let d of c)n.patternProperties[d.source]=l}else(e.target==="draft-07"||e.target==="draft-2020-12")&&(n.propertyNames=oe(s.keyType,e,{...o,path:[...o.path,"propertyNames"]})),n.additionalProperties=oe(s.valueType,e,{...o,path:[...o.path,"additionalProperties"]});let u=i._zod.values;if(u){let l=[...u].filter(d=>typeof d=="string"||typeof d=="number");l.length>0&&(n.required=l)}},bd=(t,e,r,o)=>{let n=t._zod.def,s=oe(n.innerType,e,o),i=e.seen.get(t);e.target==="openapi-3.0"?(i.ref=n.innerType,r.nullable=!0):r.anyOf=[s,{type:"null"}]},Sd=(t,e,r,o)=>{let n=t._zod.def;oe(n.innerType,e,o);let s=e.seen.get(t);s.ref=n.innerType},wd=(t,e,r,o)=>{let n=t._zod.def;oe(n.innerType,e,o);let s=e.seen.get(t);s.ref=n.innerType,r.default=JSON.parse(JSON.stringify(n.defaultValue))},zd=(t,e,r,o)=>{let n=t._zod.def;oe(n.innerType,e,o);let s=e.seen.get(t);s.ref=n.innerType,e.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(n.defaultValue)))},xd=(t,e,r,o)=>{let n=t._zod.def;oe(n.innerType,e,o);let s=e.seen.get(t);s.ref=n.innerType;let i;try{i=n.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=i},Ed=(t,e,r,o)=>{let n=t._zod.def,s=n.in._zod.traits.has("$ZodTransform"),i=e.io==="input"?s?n.out:n.in:n.out;oe(i,e,o);let a=e.seen.get(t);a.ref=i},kd=(t,e,r,o)=>{let n=t._zod.def;oe(n.innerType,e,o);let s=e.seen.get(t);s.ref=n.innerType,r.readOnly=!0};var Ns=(t,e,r,o)=>{let n=t._zod.def;oe(n.innerType,e,o);let s=e.seen.get(t);s.ref=n.innerType};function Ut(t){return!!t._zod}function pt(t,e){return Ut(t)?$r(t,e):t.safeParse(e)}function jo(t){if(!t)return;let e;if(Ut(t)?e=t._zod?.def?.shape:e=t.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function Pd(t){if(Ut(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 o=t.value;if(o!==void 0)return o}var kr={};cc(kr,{ZodISODate:()=>Od,ZodISODateTime:()=>Td,ZodISODuration:()=>Id,ZodISOTime:()=>Rd,date:()=>Ms,datetime:()=>Cs,duration:()=>js,time:()=>Ds});var Td=g("ZodISODateTime",(t,e)=>{ju.init(t,e),X.init(t,e)});function Cs(t){return Hl(Td,t)}var Od=g("ZodISODate",(t,e)=>{Zu.init(t,e),X.init(t,e)});function Ms(t){return Jl(Od,t)}var Rd=g("ZodISOTime",(t,e)=>{Lu.init(t,e),X.init(t,e)});function Ds(t){return Kl(Rd,t)}var Id=g("ZodISODuration",(t,e)=>{qu.init(t,e),X.init(t,e)});function js(t){return Gl(Id,t)}var Rg=(t,e)=>{zo.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:r=>bc(t,r)},flatten:{value:r=>$c(t,r)},addIssue:{value:r=>{t.issues.push(r),t.message=JSON.stringify(t.issues,jt,2)}},addIssues:{value:r=>{t.issues.push(...r),t.message=JSON.stringify(t.issues,jt,2)}},isEmpty:{get(){return t.issues.length===0}}})};var Pe=g("ZodError",Rg,{Parent:Error});var Ad=xo(Pe),Nd=Eo(Pe),Cd=vr(Pe),Md=br(Pe),Dd=Sc(Pe),jd=wc(Pe),Zd=zc(Pe),Ld=xc(Pe),qd=Ec(Pe),Ud=kc(Pe),Fd=Pc(Pe),Vd=Tc(Pe);var Hd=new WeakMap;function Pr(t,e,r){let o=Object.getPrototypeOf(t),n=Hd.get(o);if(n||(n=new Set,Hd.set(o,n)),!n.has(e)){n.add(e);for(let s in r){let i=r[s];Object.defineProperty(o,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 te=g("ZodType",(t,e)=>(K.init(t,e),Object.assign(t["~standard"],{jsonSchema:{input:xr(t,"input"),output:xr(t,"output")}}),t.toJSONSchema=sd(t,{}),t.def=e,t.type=e.type,Object.defineProperty(t,"_def",{value:e}),t.parse=(r,o)=>Ad(t,r,o,{callee:t.parse}),t.safeParse=(r,o)=>Cd(t,r,o),t.parseAsync=async(r,o)=>Nd(t,r,o,{callee:t.parseAsync}),t.safeParseAsync=async(r,o)=>Md(t,r,o),t.spa=t.safeParseAsync,t.encode=(r,o)=>Dd(t,r,o),t.decode=(r,o)=>jd(t,r,o),t.encodeAsync=async(r,o)=>Zd(t,r,o),t.decodeAsync=async(r,o)=>Ld(t,r,o),t.safeEncode=(r,o)=>qd(t,r,o),t.safeDecode=(r,o)=>Ud(t,r,o),t.safeEncodeAsync=async(r,o)=>Fd(t,r,o),t.safeDecodeAsync=async(r,o)=>Vd(t,r,o),Pr(t,"ZodType",{check(...r){let o=this.def;return this.clone(j.mergeDefs(o,{checks:[...o.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},with(...r){return this.check(...r)},clone(r,o){return je(this,r,o)},brand(){return this},register(r,o){return r.add(this,o),this},refine(r,o){return this.check(b_(r,o))},superRefine(r,o){return this.check(S_(r,o))},overwrite(r){return this.check(dt(r))},optional(){return ee(this)},exactOptional(){return u_(this)},nullable(){return Wd(this)},nullish(){return ee(Wd(this))},nonoptional(r){return h_(this,r)},array(){return M(this)},or(r){return W([this,r])},and(r){return Lo(this,r)},transform(r){return Bd(this,rp(r))},default(r){return p_(this,r)},prefault(r){return m_(this,r)},catch(r){return __(this,r)},pipe(r){return Bd(this,r)},readonly(){return $_(this)},describe(r){let o=this.clone();return zt.add(o,{description:r}),o},meta(...r){if(r.length===0)return zt.get(this);let o=this.clone();return zt.add(o,r[0]),o},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(r){return r(this)}}),Object.defineProperty(t,"description",{get(){return zt.get(t)?.description},configurable:!0}),t)),Yd=g("_ZodString",(t,e)=>{Io.init(t,e),te.init(t,e),t._zod.processJSONSchema=(o,n,s)=>id(t,o,n,s);let r=t._zod.bag;t.format=r.format??null,t.minLength=r.minimum??null,t.maxLength=r.maximum??null,Pr(t,"_ZodString",{regex(...o){return this.check($s(...o))},includes(...o){return this.check(ws(...o))},startsWith(...o){return this.check(zs(...o))},endsWith(...o){return this.check(xs(...o))},min(...o){return this.check(qt(...o))},max(...o){return this.check(Mo(...o))},length(...o){return this.check(Do(...o))},nonempty(...o){return this.check(qt(1,...o))},lowercase(o){return this.check(bs(o))},uppercase(o){return this.check(Ss(o))},trim(){return this.check(ks())},normalize(...o){return this.check(Es(...o))},toLowerCase(){return this.check(Ps())},toUpperCase(){return this.check(Ts())},slugify(){return this.check(Os())}})}),Ag=g("ZodString",(t,e)=>{Io.init(t,e),Yd.init(t,e),t.email=r=>t.check(zl(Ng,r)),t.url=r=>t.check(Tl(Cg,r)),t.jwt=r=>t.check(Vl(Bg,r)),t.emoji=r=>t.check(Ol(Mg,r)),t.guid=r=>t.check(vs(Jd,r)),t.uuid=r=>t.check(xl(Zo,r)),t.uuidv4=r=>t.check(El(Zo,r)),t.uuidv6=r=>t.check(kl(Zo,r)),t.uuidv7=r=>t.check(Pl(Zo,r)),t.nanoid=r=>t.check(Rl(Dg,r)),t.guid=r=>t.check(vs(Jd,r)),t.cuid=r=>t.check(Il(jg,r)),t.cuid2=r=>t.check(Al(Zg,r)),t.ulid=r=>t.check(Nl(Lg,r)),t.base64=r=>t.check(ql(Kg,r)),t.base64url=r=>t.check(Ul(Gg,r)),t.xid=r=>t.check(Cl(qg,r)),t.ksuid=r=>t.check(Ml(Ug,r)),t.ipv4=r=>t.check(Dl(Fg,r)),t.ipv6=r=>t.check(jl(Vg,r)),t.cidrv4=r=>t.check(Zl(Hg,r)),t.cidrv6=r=>t.check(Ll(Jg,r)),t.e164=r=>t.check(Fl(Wg,r)),t.datetime=r=>t.check(Cs(r)),t.date=r=>t.check(Ms(r)),t.time=r=>t.check(Ds(r)),t.duration=r=>t.check(js(r))});function h(t){return wl(Ag,t)}var X=g("ZodStringFormat",(t,e)=>{G.init(t,e),Yd.init(t,e)}),Ng=g("ZodEmail",(t,e)=>{Tu.init(t,e),X.init(t,e)});var Jd=g("ZodGUID",(t,e)=>{ku.init(t,e),X.init(t,e)});var Zo=g("ZodUUID",(t,e)=>{Pu.init(t,e),X.init(t,e)});var Cg=g("ZodURL",(t,e)=>{Ou.init(t,e),X.init(t,e)});var Mg=g("ZodEmoji",(t,e)=>{Ru.init(t,e),X.init(t,e)});var Dg=g("ZodNanoID",(t,e)=>{Iu.init(t,e),X.init(t,e)});var jg=g("ZodCUID",(t,e)=>{Au.init(t,e),X.init(t,e)});var Zg=g("ZodCUID2",(t,e)=>{Nu.init(t,e),X.init(t,e)});var Lg=g("ZodULID",(t,e)=>{Cu.init(t,e),X.init(t,e)});var qg=g("ZodXID",(t,e)=>{Mu.init(t,e),X.init(t,e)});var Ug=g("ZodKSUID",(t,e)=>{Du.init(t,e),X.init(t,e)});var Fg=g("ZodIPv4",(t,e)=>{Uu.init(t,e),X.init(t,e)});var Vg=g("ZodIPv6",(t,e)=>{Fu.init(t,e),X.init(t,e)});var Hg=g("ZodCIDRv4",(t,e)=>{Vu.init(t,e),X.init(t,e)});var Jg=g("ZodCIDRv6",(t,e)=>{Hu.init(t,e),X.init(t,e)});var Kg=g("ZodBase64",(t,e)=>{Ku.init(t,e),X.init(t,e)});var Gg=g("ZodBase64URL",(t,e)=>{Gu.init(t,e),X.init(t,e)});var Wg=g("ZodE164",(t,e)=>{Wu.init(t,e),X.init(t,e)});var Bg=g("ZodJWT",(t,e)=>{Bu.init(t,e),X.init(t,e)});var Xd=g("ZodNumber",(t,e)=>{ms.init(t,e),te.init(t,e),t._zod.processJSONSchema=(o,n,s)=>ad(t,o,n,s),Pr(t,"ZodNumber",{gt(o,n){return this.check(No(o,n))},gte(o,n){return this.check(zr(o,n))},min(o,n){return this.check(zr(o,n))},lt(o,n){return this.check(Ao(o,n))},lte(o,n){return this.check(wr(o,n))},max(o,n){return this.check(wr(o,n))},int(o){return this.check(Kd(o))},safe(o){return this.check(Kd(o))},positive(o){return this.check(No(0,o))},nonnegative(o){return this.check(zr(0,o))},negative(o){return this.check(Ao(0,o))},nonpositive(o){return this.check(wr(0,o))},multipleOf(o,n){return this.check(Co(o,n))},step(o,n){return this.check(Co(o,n))},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 F(t){return Wl(Xd,t)}var Yg=g("ZodNumberFormat",(t,e)=>{Yu.init(t,e),Xd.init(t,e)});function Kd(t){return Bl(Yg,t)}var Xg=g("ZodBoolean",(t,e)=>{Xu.init(t,e),te.init(t,e),t._zod.processJSONSchema=(r,o,n)=>cd(t,r,o,n)});function ie(t){return Yl(Xg,t)}var Qg=g("ZodNull",(t,e)=>{Qu.init(t,e),te.init(t,e),t._zod.processJSONSchema=(r,o,n)=>ud(t,r,o,n)});function Qd(t){return Xl(Qg,t)}var e_=g("ZodUnknown",(t,e)=>{el.init(t,e),te.init(t,e),t._zod.processJSONSchema=(r,o,n)=>dd(t,r,o,n)});function Q(){return Ql(e_)}var t_=g("ZodNever",(t,e)=>{tl.init(t,e),te.init(t,e),t._zod.processJSONSchema=(r,o,n)=>ld(t,r,o,n)});function r_(t){return ed(t_,t)}var o_=g("ZodArray",(t,e)=>{rl.init(t,e),te.init(t,e),t._zod.processJSONSchema=(r,o,n)=>gd(t,r,o,n),t.element=e.element,Pr(t,"ZodArray",{min(r,o){return this.check(qt(r,o))},nonempty(r){return this.check(qt(1,r))},max(r,o){return this.check(Mo(r,o))},length(r,o){return this.check(Do(r,o))},unwrap(){return this.element}})});function M(t,e){return td(o_,t,e)}var ep=g("ZodObject",(t,e)=>{sl.init(t,e),te.init(t,e),t._zod.processJSONSchema=(r,o,n)=>_d(t,r,o,n),j.defineLazy(t,"shape",()=>e.shape),Pr(t,"ZodObject",{keyof(){return be(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:Q()})},loose(){return this.clone({...this._zod.def,catchall:Q()})},strict(){return this.clone({...this._zod.def,catchall:r_()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return j.extend(this,r)},safeExtend(r){return j.safeExtend(this,r)},merge(r){return j.merge(this,r)},pick(r){return j.pick(this,r)},omit(r){return j.omit(this,r)},partial(...r){return j.partial(op,this,r[0])},required(...r){return j.required(np,this,r[0])}})});function b(t,e){let r={type:"object",shape:t??{},...j.normalizeParams(e)};return new ep(r)}function ye(t,e){return new ep({type:"object",shape:t,catchall:Q(),...j.normalizeParams(e)})}var tp=g("ZodUnion",(t,e)=>{hs.init(t,e),te.init(t,e),t._zod.processJSONSchema=(r,o,n)=>yd(t,r,o,n),t.options=e.options});function W(t,e){return new tp({type:"union",options:t,...j.normalizeParams(e)})}var n_=g("ZodDiscriminatedUnion",(t,e)=>{tp.init(t,e),il.init(t,e)});function Ls(t,e,r){return new n_({type:"union",options:e,discriminator:t,...j.normalizeParams(r)})}var s_=g("ZodIntersection",(t,e)=>{al.init(t,e),te.init(t,e),t._zod.processJSONSchema=(r,o,n)=>vd(t,r,o,n)});function Lo(t,e){return new s_({type:"intersection",left:t,right:e})}var Gd=g("ZodRecord",(t,e)=>{cl.init(t,e),te.init(t,e),t._zod.processJSONSchema=(r,o,n)=>$d(t,r,o,n),t.keyType=e.keyType,t.valueType=e.valueType});function J(t,e,r){return!e||!e._zod?new Gd({type:"record",keyType:h(),valueType:t,...j.normalizeParams(e)}):new Gd({type:"record",keyType:t,valueType:e,...j.normalizeParams(r)})}var Zs=g("ZodEnum",(t,e)=>{ul.init(t,e),te.init(t,e),t._zod.processJSONSchema=(o,n,s)=>pd(t,o,n,s),t.enum=e.entries,t.options=Object.values(e.entries);let r=new Set(Object.keys(e.entries));t.extract=(o,n)=>{let s={};for(let i of o)if(r.has(i))s[i]=e.entries[i];else throw new Error(`Key ${i} not found in enum`);return new Zs({...e,checks:[],...j.normalizeParams(n),entries:s})},t.exclude=(o,n)=>{let s={...e.entries};for(let i of o)if(r.has(i))delete s[i];else throw new Error(`Key ${i} not found in enum`);return new Zs({...e,checks:[],...j.normalizeParams(n),entries:s})}});function be(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(o=>[o,o])):t;return new Zs({type:"enum",entries:r,...j.normalizeParams(e)})}var i_=g("ZodLiteral",(t,e)=>{ll.init(t,e),te.init(t,e),t._zod.processJSONSchema=(r,o,n)=>fd(t,r,o,n),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 z(t,e){return new i_({type:"literal",values:Array.isArray(t)?t:[t],...j.normalizeParams(e)})}var a_=g("ZodTransform",(t,e)=>{dl.init(t,e),te.init(t,e),t._zod.processJSONSchema=(r,o,n)=>hd(t,r,o,n),t._zod.parse=(r,o)=>{if(o.direction==="backward")throw new Mt(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"),i.input??(i.input=r.value),i.inst??(i.inst=t),r.issues.push(j.issue(i))}};let n=e.transform(r.value,r);return n instanceof Promise?n.then(s=>(r.value=s,r.fallback=!0,r)):(r.value=n,r.fallback=!0,r)}});function rp(t){return new a_({type:"transform",transform:t})}var op=g("ZodOptional",(t,e)=>{gs.init(t,e),te.init(t,e),t._zod.processJSONSchema=(r,o,n)=>Ns(t,r,o,n),t.unwrap=()=>t._zod.def.innerType});function ee(t){return new op({type:"optional",innerType:t})}var c_=g("ZodExactOptional",(t,e)=>{pl.init(t,e),te.init(t,e),t._zod.processJSONSchema=(r,o,n)=>Ns(t,r,o,n),t.unwrap=()=>t._zod.def.innerType});function u_(t){return new c_({type:"optional",innerType:t})}var l_=g("ZodNullable",(t,e)=>{fl.init(t,e),te.init(t,e),t._zod.processJSONSchema=(r,o,n)=>bd(t,r,o,n),t.unwrap=()=>t._zod.def.innerType});function Wd(t){return new l_({type:"nullable",innerType:t})}var d_=g("ZodDefault",(t,e)=>{ml.init(t,e),te.init(t,e),t._zod.processJSONSchema=(r,o,n)=>wd(t,r,o,n),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function p_(t,e){return new d_({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():j.shallowClone(e)}})}var f_=g("ZodPrefault",(t,e)=>{hl.init(t,e),te.init(t,e),t._zod.processJSONSchema=(r,o,n)=>zd(t,r,o,n),t.unwrap=()=>t._zod.def.innerType});function m_(t,e){return new f_({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():j.shallowClone(e)}})}var np=g("ZodNonOptional",(t,e)=>{gl.init(t,e),te.init(t,e),t._zod.processJSONSchema=(r,o,n)=>Sd(t,r,o,n),t.unwrap=()=>t._zod.def.innerType});function h_(t,e){return new np({type:"nonoptional",innerType:t,...j.normalizeParams(e)})}var g_=g("ZodCatch",(t,e)=>{_l.init(t,e),te.init(t,e),t._zod.processJSONSchema=(r,o,n)=>xd(t,r,o,n),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function __(t,e){return new g_({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}var sp=g("ZodPipe",(t,e)=>{_s.init(t,e),te.init(t,e),t._zod.processJSONSchema=(r,o,n)=>Ed(t,r,o,n),t.in=e.in,t.out=e.out});function Bd(t,e){return new sp({type:"pipe",in:t,out:e})}var y_=g("ZodPreprocess",(t,e)=>{sp.init(t,e),yl.init(t,e)}),v_=g("ZodReadonly",(t,e)=>{vl.init(t,e),te.init(t,e),t._zod.processJSONSchema=(r,o,n)=>kd(t,r,o,n),t.unwrap=()=>t._zod.def.innerType});function $_(t){return new v_({type:"readonly",innerType:t})}var ip=g("ZodCustom",(t,e)=>{$l.init(t,e),te.init(t,e),t._zod.processJSONSchema=(r,o,n)=>md(t,r,o,n)});function ap(t,e){return rd(ip,t??(()=>!0),e)}function b_(t,e={}){return od(ip,t,e)}function S_(t,e){return nd(t,e)}function qs(t,e){return new y_({type:"pipe",in:rp(t),out:e})}ke(bl());var Fs="2025-11-25";var cp=[Fs,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],ft="io.modelcontextprotocol/related-task",Uo="2.0",se=ap(t=>t!==null&&(typeof t=="object"||typeof t=="function")),up=W([h(),F().int()]),lp=h(),UE=ye({ttl:F().optional(),pollInterval:F().optional()}),w_=b({ttl:F().optional()}),z_=b({taskId:h()}),Vs=ye({progressToken:up.optional(),[ft]:z_.optional()}),Te=b({_meta:Vs.optional()}),Tr=Te.extend({task:w_.optional()}),dp=t=>Tr.safeParse(t).success,ue=b({method:h(),params:Te.loose().optional()}),Ie=b({_meta:Vs.optional()}),Ae=b({method:h(),params:Ie.loose().optional()}),le=ye({_meta:Vs.optional()}),Fo=W([h(),F().int()]),pp=b({jsonrpc:z(Uo),id:Fo,...ue.shape}).strict(),Hs=t=>pp.safeParse(t).success,fp=b({jsonrpc:z(Uo),...Ae.shape}).strict(),mp=t=>fp.safeParse(t).success,Js=b({jsonrpc:z(Uo),id:Fo,result:le}).strict(),Or=t=>Js.safeParse(t).success;var C;(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"})(C||(C={}));var Ks=b({jsonrpc:z(Uo),id:Fo.optional(),error:b({code:F().int(),message:h(),data:Q().optional()})}).strict();var hp=t=>Ks.safeParse(t).success;var gp=W([pp,fp,Js,Ks]),FE=W([Js,Ks]),Vo=le.strict(),x_=Ie.extend({requestId:Fo.optional(),reason:h().optional()}),Ho=Ae.extend({method:z("notifications/cancelled"),params:x_}),E_=b({src:h(),mimeType:h().optional(),sizes:M(h()).optional(),theme:be(["light","dark"]).optional()}),Rr=b({icons:M(E_).optional()}),Ft=b({name:h(),title:h().optional()}),_p=Ft.extend({...Ft.shape,...Rr.shape,version:h(),websiteUrl:h().optional(),description:h().optional()}),k_=Lo(b({applyDefaults:ie().optional()}),J(h(),Q())),P_=qs(t=>t&&typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length===0?{form:{}}:t,Lo(b({form:k_.optional(),url:se.optional()}),J(h(),Q()).optional())),T_=ye({list:se.optional(),cancel:se.optional(),requests:ye({sampling:ye({createMessage:se.optional()}).optional(),elicitation:ye({create:se.optional()}).optional()}).optional()}),O_=ye({list:se.optional(),cancel:se.optional(),requests:ye({tools:ye({call:se.optional()}).optional()}).optional()}),R_=b({experimental:J(h(),se).optional(),sampling:b({context:se.optional(),tools:se.optional()}).optional(),elicitation:P_.optional(),roots:b({listChanged:ie().optional()}).optional(),tasks:T_.optional(),extensions:J(h(),se).optional()}),I_=Te.extend({protocolVersion:h(),capabilities:R_,clientInfo:_p}),Gs=ue.extend({method:z("initialize"),params:I_});var A_=b({experimental:J(h(),se).optional(),logging:se.optional(),completions:se.optional(),prompts:b({listChanged:ie().optional()}).optional(),resources:b({subscribe:ie().optional(),listChanged:ie().optional()}).optional(),tools:b({listChanged:ie().optional()}).optional(),tasks:O_.optional(),extensions:J(h(),se).optional()}),N_=le.extend({protocolVersion:h(),capabilities:A_,serverInfo:_p,instructions:h().optional()}),Ws=Ae.extend({method:z("notifications/initialized"),params:Ie.optional()});var Jo=ue.extend({method:z("ping"),params:Te.optional()}),C_=b({progress:F(),total:ee(F()),message:ee(h())}),M_=b({...Ie.shape,...C_.shape,progressToken:up}),Ko=Ae.extend({method:z("notifications/progress"),params:M_}),D_=Te.extend({cursor:lp.optional()}),Ir=ue.extend({params:D_.optional()}),Ar=le.extend({nextCursor:lp.optional()}),j_=be(["working","input_required","completed","failed","cancelled"]),Nr=b({taskId:h(),status:j_,ttl:W([F(),Qd()]),createdAt:h(),lastUpdatedAt:h(),pollInterval:ee(F()),statusMessage:ee(h())}),Vt=le.extend({task:Nr}),Z_=Ie.merge(Nr),Cr=Ae.extend({method:z("notifications/tasks/status"),params:Z_}),Go=ue.extend({method:z("tasks/get"),params:Te.extend({taskId:h()})}),Wo=le.merge(Nr),Bo=ue.extend({method:z("tasks/result"),params:Te.extend({taskId:h()})}),VE=le.loose(),Yo=Ir.extend({method:z("tasks/list")}),Xo=Ar.extend({tasks:M(Nr)}),Qo=ue.extend({method:z("tasks/cancel"),params:Te.extend({taskId:h()})}),yp=le.merge(Nr),vp=b({uri:h(),mimeType:ee(h()),_meta:J(h(),Q()).optional()}),$p=vp.extend({text:h()}),Bs=h().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),bp=vp.extend({blob:Bs}),Mr=be(["user","assistant"]),Ht=b({audience:M(Mr).optional(),priority:F().min(0).max(1).optional(),lastModified:kr.datetime({offset:!0}).optional()}),Sp=b({...Ft.shape,...Rr.shape,uri:h(),description:ee(h()),mimeType:ee(h()),size:ee(F()),annotations:Ht.optional(),_meta:ee(ye({}))}),L_=b({...Ft.shape,...Rr.shape,uriTemplate:h(),description:ee(h()),mimeType:ee(h()),annotations:Ht.optional(),_meta:ee(ye({}))}),q_=Ir.extend({method:z("resources/list")}),U_=Ar.extend({resources:M(Sp)}),F_=Ir.extend({method:z("resources/templates/list")}),V_=Ar.extend({resourceTemplates:M(L_)}),Ys=Te.extend({uri:h()}),H_=Ys,J_=ue.extend({method:z("resources/read"),params:H_}),K_=le.extend({contents:M(W([$p,bp]))}),G_=Ae.extend({method:z("notifications/resources/list_changed"),params:Ie.optional()}),W_=Ys,B_=ue.extend({method:z("resources/subscribe"),params:W_}),Y_=Ys,X_=ue.extend({method:z("resources/unsubscribe"),params:Y_}),Q_=Ie.extend({uri:h()}),ey=Ae.extend({method:z("notifications/resources/updated"),params:Q_}),ty=b({name:h(),description:ee(h()),required:ee(ie())}),ry=b({...Ft.shape,...Rr.shape,description:ee(h()),arguments:ee(M(ty)),_meta:ee(ye({}))}),oy=Ir.extend({method:z("prompts/list")}),ny=Ar.extend({prompts:M(ry)}),sy=Te.extend({name:h(),arguments:J(h(),h()).optional()}),iy=ue.extend({method:z("prompts/get"),params:sy}),Xs=b({type:z("text"),text:h(),annotations:Ht.optional(),_meta:J(h(),Q()).optional()}),Qs=b({type:z("image"),data:Bs,mimeType:h(),annotations:Ht.optional(),_meta:J(h(),Q()).optional()}),ei=b({type:z("audio"),data:Bs,mimeType:h(),annotations:Ht.optional(),_meta:J(h(),Q()).optional()}),ay=b({type:z("tool_use"),name:h(),id:h(),input:J(h(),Q()),_meta:J(h(),Q()).optional()}),cy=b({type:z("resource"),resource:W([$p,bp]),annotations:Ht.optional(),_meta:J(h(),Q()).optional()}),uy=Sp.extend({type:z("resource_link")}),ti=W([Xs,Qs,ei,uy,cy]),ly=b({role:Mr,content:ti}),dy=le.extend({description:h().optional(),messages:M(ly)}),py=Ae.extend({method:z("notifications/prompts/list_changed"),params:Ie.optional()}),fy=b({title:h().optional(),readOnlyHint:ie().optional(),destructiveHint:ie().optional(),idempotentHint:ie().optional(),openWorldHint:ie().optional()}),my=b({taskSupport:be(["required","optional","forbidden"]).optional()}),wp=b({...Ft.shape,...Rr.shape,description:h().optional(),inputSchema:b({type:z("object"),properties:J(h(),se).optional(),required:M(h()).optional()}).catchall(Q()),outputSchema:b({type:z("object"),properties:J(h(),se).optional(),required:M(h()).optional()}).catchall(Q()).optional(),annotations:fy.optional(),execution:my.optional(),_meta:J(h(),Q()).optional()}),ri=Ir.extend({method:z("tools/list")}),hy=Ar.extend({tools:M(wp)}),en=le.extend({content:M(ti).default([]),structuredContent:J(h(),Q()).optional(),isError:ie().optional()}),HE=en.or(le.extend({toolResult:Q()})),gy=Tr.extend({name:h(),arguments:J(h(),Q()).optional()}),Dr=ue.extend({method:z("tools/call"),params:gy}),_y=Ae.extend({method:z("notifications/tools/list_changed"),params:Ie.optional()}),JE=b({autoRefresh:ie().default(!0),debounceMs:F().int().nonnegative().default(300)}),jr=be(["debug","info","notice","warning","error","critical","alert","emergency"]),yy=Te.extend({level:jr}),oi=ue.extend({method:z("logging/setLevel"),params:yy}),vy=Ie.extend({level:jr,logger:h().optional(),data:Q()}),$y=Ae.extend({method:z("notifications/message"),params:vy}),by=b({name:h().optional()}),Sy=b({hints:M(by).optional(),costPriority:F().min(0).max(1).optional(),speedPriority:F().min(0).max(1).optional(),intelligencePriority:F().min(0).max(1).optional()}),wy=b({mode:be(["auto","required","none"]).optional()}),zy=b({type:z("tool_result"),toolUseId:h().describe("The unique identifier for the corresponding tool call."),content:M(ti).default([]),structuredContent:b({}).loose().optional(),isError:ie().optional(),_meta:J(h(),Q()).optional()}),xy=Ls("type",[Xs,Qs,ei]),qo=Ls("type",[Xs,Qs,ei,ay,zy]),Ey=b({role:Mr,content:W([qo,M(qo)]),_meta:J(h(),Q()).optional()}),ky=Tr.extend({messages:M(Ey),modelPreferences:Sy.optional(),systemPrompt:h().optional(),includeContext:be(["none","thisServer","allServers"]).optional(),temperature:F().optional(),maxTokens:F().int(),stopSequences:M(h()).optional(),metadata:se.optional(),tools:M(wp).optional(),toolChoice:wy.optional()}),Py=ue.extend({method:z("sampling/createMessage"),params:ky}),Zr=le.extend({model:h(),stopReason:ee(be(["endTurn","stopSequence","maxTokens"]).or(h())),role:Mr,content:xy}),ni=le.extend({model:h(),stopReason:ee(be(["endTurn","stopSequence","maxTokens","toolUse"]).or(h())),role:Mr,content:W([qo,M(qo)])}),Ty=b({type:z("boolean"),title:h().optional(),description:h().optional(),default:ie().optional()}),Oy=b({type:z("string"),title:h().optional(),description:h().optional(),minLength:F().optional(),maxLength:F().optional(),format:be(["email","uri","date","date-time"]).optional(),default:h().optional()}),Ry=b({type:be(["number","integer"]),title:h().optional(),description:h().optional(),minimum:F().optional(),maximum:F().optional(),default:F().optional()}),Iy=b({type:z("string"),title:h().optional(),description:h().optional(),enum:M(h()),default:h().optional()}),Ay=b({type:z("string"),title:h().optional(),description:h().optional(),oneOf:M(b({const:h(),title:h()})),default:h().optional()}),Ny=b({type:z("string"),title:h().optional(),description:h().optional(),enum:M(h()),enumNames:M(h()).optional(),default:h().optional()}),Cy=W([Iy,Ay]),My=b({type:z("array"),title:h().optional(),description:h().optional(),minItems:F().optional(),maxItems:F().optional(),items:b({type:z("string"),enum:M(h())}),default:M(h()).optional()}),Dy=b({type:z("array"),title:h().optional(),description:h().optional(),minItems:F().optional(),maxItems:F().optional(),items:b({anyOf:M(b({const:h(),title:h()}))}),default:M(h()).optional()}),jy=W([My,Dy]),Zy=W([Ny,Cy,jy]),Ly=W([Zy,Ty,Oy,Ry]),qy=Tr.extend({mode:z("form").optional(),message:h(),requestedSchema:b({type:z("object"),properties:J(h(),Ly),required:M(h()).optional()})}),Uy=Tr.extend({mode:z("url"),message:h(),elicitationId:h(),url:h().url()}),Fy=W([qy,Uy]),Vy=ue.extend({method:z("elicitation/create"),params:Fy}),Hy=Ie.extend({elicitationId:h()}),Jy=Ae.extend({method:z("notifications/elicitation/complete"),params:Hy}),Jt=le.extend({action:be(["accept","decline","cancel"]),content:qs(t=>t===null?void 0:t,J(h(),W([h(),F(),ie(),M(h())])).optional())}),Ky=b({type:z("ref/resource"),uri:h()});var Gy=b({type:z("ref/prompt"),name:h()}),Wy=Te.extend({ref:W([Gy,Ky]),argument:b({name:h(),value:h()}),context:b({arguments:J(h(),h()).optional()}).optional()}),By=ue.extend({method:z("completion/complete"),params:Wy});var Yy=le.extend({completion:ye({values:M(h()).max(100),total:ee(F().int()),hasMore:ee(ie())})}),Xy=b({uri:h().startsWith("file://"),name:h().optional(),_meta:J(h(),Q()).optional()}),Qy=ue.extend({method:z("roots/list"),params:Te.optional()}),si=le.extend({roots:M(Xy)}),ev=Ae.extend({method:z("notifications/roots/list_changed"),params:Ie.optional()}),KE=W([Jo,Gs,By,oi,iy,oy,q_,F_,J_,B_,X_,Dr,ri,Go,Bo,Yo,Qo]),GE=W([Ho,Ko,Ws,ev,Cr]),WE=W([Vo,Zr,ni,Jt,si,Wo,Xo,Vt]),BE=W([Jo,Py,Vy,Qy,Go,Bo,Yo,Qo]),YE=W([Ho,Ko,$y,ey,G_,_y,py,Cr,Jy]),XE=W([Vo,N_,Yy,dy,ny,U_,V_,K_,en,hy,Wo,Xo,Vt]),O=class t extends Error{constructor(e,r,o){super(`MCP error ${e}: ${r}`),this.code=e,this.data=o,this.name="McpError"}static fromError(e,r,o){if(e===C.UrlElicitationRequired&&o){let n=o;if(n.elicitations)return new Us(n.elicitations,r)}return new t(e,r,o)}},Us=class extends O{constructor(e,r=`URL elicitation${e.length>1?"s":""} required`){super(C.UrlElicitationRequired,r,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}};function mt(t){return t==="completed"||t==="failed"||t==="cancelled"}var Rk=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function ii(t){let r=jo(t)?.method;if(!r)throw new Error("Schema is missing a method literal");let o=Pd(r);if(typeof o!="string")throw new Error("Schema method literal must be a string");return o}function ai(t,e){let r=pt(t,e);if(!r.success)throw r.error;return r.data}var iv=6e4,tn=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(Ho,r=>{this._oncancel(r)}),this.setNotificationHandler(Ko,r=>{this._onprogress(r)}),this.setRequestHandler(Jo,r=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(Go,async(r,o)=>{let n=await this._taskStore.getTask(r.params.taskId,o.sessionId);if(!n)throw new O(C.InvalidParams,"Failed to retrieve task: Task not found");return{...n}}),this.setRequestHandler(Bo,async(r,o)=>{let n=async()=>{let s=r.params.taskId;if(this._taskMessageQueue){let a;for(;a=await this._taskMessageQueue.dequeue(s,o.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 O(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:o.requestId})}}let i=await this._taskStore.getTask(s,o.sessionId);if(!i)throw new O(C.InvalidParams,`Task not found: ${s}`);if(!mt(i.status))return await this._waitForTaskUpdate(s,o.signal),await n();if(mt(i.status)){let a=await this._taskStore.getTaskResult(s,o.sessionId);return this._clearTaskQueue(s),{...a,_meta:{...a._meta,[ft]:{taskId:s}}}}return await n()};return await n()}),this.setRequestHandler(Yo,async(r,o)=>{try{let{tasks:n,nextCursor:s}=await this._taskStore.listTasks(r.params?.cursor,o.sessionId);return{tasks:n,nextCursor:s,_meta:{}}}catch(n){throw new O(C.InvalidParams,`Failed to list tasks: ${n instanceof Error?n.message:String(n)}`)}}),this.setRequestHandler(Qo,async(r,o)=>{try{let n=await this._taskStore.getTask(r.params.taskId,o.sessionId);if(!n)throw new O(C.InvalidParams,`Task not found: ${r.params.taskId}`);if(mt(n.status))throw new O(C.InvalidParams,`Cannot cancel task in terminal status: ${n.status}`);await this._taskStore.updateTaskStatus(r.params.taskId,"cancelled","Client cancelled task execution.",o.sessionId),this._clearTaskQueue(r.params.taskId);let s=await this._taskStore.getTask(r.params.taskId,o.sessionId);if(!s)throw new O(C.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...s}}catch(n){throw n instanceof O?n:new O(C.InvalidRequest,`Failed to cancel task: ${n instanceof Error?n.message:String(n)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,r,o,n,s=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(n,r),startTime:Date.now(),timeout:r,maxTotalTimeout:o,resetTimeoutOnProgress:s,onTimeout:n})}_resetTimeout(e){let r=this._timeoutInfo.get(e);if(!r)return!1;let o=Date.now()-r.startTime;if(r.maxTotalTimeout&&o>=r.maxTotalTimeout)throw this._timeoutInfo.delete(e),O.fromError(C.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:r.maxTotalTimeout,totalElapsed:o});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 o=this.transport?.onerror;this._transport.onerror=s=>{o?.(s),this._onerror(s)};let n=this._transport?.onmessage;this._transport.onmessage=(s,i)=>{n?.(s,i),Or(s)||hp(s)?this._onresponse(s):Hs(s)?this._onrequest(s,i):mp(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 o of this._timeoutInfo.values())clearTimeout(o.timeoutId);this._timeoutInfo.clear();for(let o of this._requestHandlerAbortControllers.values())o.abort();this._requestHandlerAbortControllers.clear();let r=O.fromError(C.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let o of e.values())o(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(o=>this._onerror(new Error(`Uncaught error in notification handler: ${o}`)))}_onrequest(e,r){let o=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,n=this._transport,s=e.params?._meta?.[ft]?.taskId;if(o===void 0){let l={jsonrpc:"2.0",id:e.id,error:{code:C.MethodNotFound,message:"Method not found"}};s&&this._taskMessageQueue?this._enqueueTaskMessage(s,{type:"error",message:l,timestamp:Date.now()},n?.sessionId).catch(d=>this._onerror(new Error(`Failed to enqueue error response: ${d}`))):n?.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=dp(e.params)?e.params.task:void 0,c=this._taskStore?this.requestTaskStore(e,n?.sessionId):void 0,u={signal:i.signal,sessionId:n?.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 O(C.ConnectionClosed,"Request was cancelled");let f={...p,relatedRequestId:e.id};s&&!f.relatedTask&&(f.relatedTask={taskId:s});let m=f.relatedTask?.taskId??s;return m&&c&&await c.updateTaskStatus(m,"input_required"),await this.request(l,d,f)},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(()=>o(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()},n?.sessionId):await n?.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:C.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()},n?.sessionId):await n?.send(d)}).catch(l=>this._onerror(new Error(`Failed to send response: ${l}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===i&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){let{progressToken:r,...o}=e.params,n=Number(r),s=this._progressHandlers.get(n);if(!s){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let i=this._responseHandlers.get(n),a=this._timeoutInfo.get(n);if(a&&i&&a.resetTimeoutOnProgress)try{this._resetTimeout(n)}catch(c){this._responseHandlers.delete(n),this._progressHandlers.delete(n),this._cleanupTimeout(n),i(c);return}s(o)}_onresponse(e){let r=Number(e.id),o=this._requestResolvers.get(r);if(o){if(this._requestResolvers.delete(r),Or(e))o(e);else{let i=new O(e.error.code,e.error.message,e.error.data);o(i)}return}let n=this._responseHandlers.get(r);if(n===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(Or(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),Or(e))n(e);else{let i=O.fromError(e.error.code,e.error.message,e.error.data);n(i)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,r,o){let{task:n}=o??{};if(!n){try{yield{type:"result",result:await this.request(e,r,o)}}catch(i){yield{type:"error",error:i instanceof O?i:new O(C.InternalError,String(i))}}return}let s;try{let i=await this.request(e,Vt,o);if(i.task)s=i.task.taskId,yield{type:"taskCreated",task:i.task};else throw new O(C.InternalError,"Task creation did not return a task");for(;;){let a=await this.getTask({taskId:s},o);if(yield{type:"taskStatus",task:a},mt(a.status)){a.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:s},r,o)}:a.status==="failed"?yield{type:"error",error:new O(C.InternalError,`Task ${s} failed`)}:a.status==="cancelled"&&(yield{type:"error",error:new O(C.InternalError,`Task ${s} was cancelled`)});return}if(a.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:s},r,o)};return}let c=a.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(u=>setTimeout(u,c)),o?.signal?.throwIfAborted()}}catch(i){yield{type:"error",error:i instanceof O?i:new O(C.InternalError,String(i))}}}request(e,r,o){let{relatedRequestId:n,resumptionToken:s,onresumptiontoken:i,task:a,relatedTask:c}=o??{};return new Promise((u,l)=>{let d=E=>{l(E)};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(E){d(E);return}o?.signal?.throwIfAborted();let p=this._requestMessageId++,f={...e,jsonrpc:"2.0",id:p};o?.onprogress&&(this._progressHandlers.set(p,o.onprogress),f.params={...e.params,_meta:{...e.params?._meta||{},progressToken:p}}),a&&(f.params={...f.params,task:a}),c&&(f.params={...f.params,_meta:{...f.params?._meta||{},[ft]:c}});let m=E=>{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(E)}},{relatedRequestId:n,resumptionToken:s,onresumptiontoken:i}).catch(k=>this._onerror(new Error(`Failed to send cancellation: ${k}`)));let S=E instanceof O?E:new O(C.RequestTimeout,String(E));l(S)};this._responseHandlers.set(p,E=>{if(!o?.signal?.aborted){if(E instanceof Error)return l(E);try{let S=pt(r,E.result);S.success?u(S.data):l(S.error)}catch(S){l(S)}}}),o?.signal?.addEventListener("abort",()=>{m(o?.signal?.reason)});let _=o?.timeout??iv,y=()=>m(O.fromError(C.RequestTimeout,"Request timed out",{timeout:_}));this._setupTimeout(p,_,o?.maxTotalTimeout,y,o?.resetTimeoutOnProgress??!1);let v=c?.taskId;if(v){let E=S=>{let k=this._responseHandlers.get(p);k?k(S):this._onerror(new Error(`Response handler missing for side-channeled request ${p}`))};this._requestResolvers.set(p,E),this._enqueueTaskMessage(v,{type:"request",message:f,timestamp:Date.now()}).catch(S=>{this._cleanupTimeout(p),l(S)})}else this._transport.send(f,{relatedRequestId:n,resumptionToken:s,onresumptiontoken:i}).catch(E=>{this._cleanupTimeout(p),l(E)})})}async getTask(e,r){return this.request({method:"tasks/get",params:e},Wo,r)}async getTaskResult(e,r,o){return this.request({method:"tasks/result",params:e},r,o)}async listTasks(e,r){return this.request({method:"tasks/list",params:e},Xo,r)}async cancelTask(e,r){return this.request({method:"tasks/cancel",params:e},yp,r)}async notification(e,r){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);let o=r?.relatedTask?.taskId;if(o){let a={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[ft]:r.relatedTask}}};await this._enqueueTaskMessage(o,{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||{},[ft]: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||{},[ft]:r.relatedTask}}}),await this._transport.send(i,r)}setRequestHandler(e,r){let o=ii(e);this.assertRequestHandlerCapability(o),this._requestHandlers.set(o,(n,s)=>{let i=ai(e,n);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 o=ii(e);this._notificationHandlers.set(o,n=>{let s=ai(e,n);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,o){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let n=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,r,o,n)}async _clearTaskQueue(e,r){if(this._taskMessageQueue){let o=await this._taskMessageQueue.dequeueAll(e,r);for(let n of o)if(n.type==="request"&&Hs(n.message)){let s=n.message.id,i=this._requestResolvers.get(s);i?(i(new O(C.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 o=this._options?.defaultTaskPollInterval??1e3;try{let n=await this._taskStore?.getTask(e);n?.pollInterval&&(o=n.pollInterval)}catch{}return new Promise((n,s)=>{if(r.aborted){s(new O(C.InvalidRequest,"Request cancelled"));return}let i=setTimeout(n,o);r.addEventListener("abort",()=>{clearTimeout(i),s(new O(C.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,r){let o=this._taskStore;if(!o)throw new Error("No task store configured");return{createTask:async n=>{if(!e)throw new Error("No request provided");return await o.createTask(n,e.id,{method:e.method,params:e.params},r)},getTask:async n=>{let s=await o.getTask(n,r);if(!s)throw new O(C.InvalidParams,"Failed to retrieve task: Task not found");return s},storeTaskResult:async(n,s,i)=>{await o.storeTaskResult(n,s,i,r);let a=await o.getTask(n,r);if(a){let c=Cr.parse({method:"notifications/tasks/status",params:a});await this.notification(c),mt(a.status)&&this._cleanupTaskProgressHandler(n)}},getTaskResult:n=>o.getTaskResult(n,r),updateTaskStatus:async(n,s,i)=>{let a=await o.getTask(n,r);if(!a)throw new O(C.InvalidParams,`Task "${n}" not found - it may have been cleaned up`);if(mt(a.status))throw new O(C.InvalidParams,`Cannot update task "${n}" from terminal status "${a.status}" to "${s}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await o.updateTaskStatus(n,s,i,r);let c=await o.getTask(n,r);if(c){let u=Cr.parse({method:"notifications/tasks/status",params:c});await this.notification(u),mt(c.status)&&this._cleanupTaskProgressHandler(n)}},listTasks:n=>o.listTasks(n,r)}}};function zp(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function xp(t,e){let r={...t};for(let o in e){let n=o,s=e[n];if(s===void 0)continue;let i=r[n];zp(i)&&zp(s)?r[n]={...i,...s}:r[n]=s}return r}var _h=vo(Ka(),1),yh=vo(gh(),1);function uz(){let t=new _h.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,yh.default)(t),t}var Dn=class{constructor(e){this._ajv=e??uz()}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 o=>r(o)?{valid:!0,data:o,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(r.errors)}}};var jn=class{constructor(e){this._server=e}requestStream(e,r,o){return this._server.requestStream(e,r,o)}createMessageStream(e,r){let o=this._server.getClientCapabilities();if((e.tools||e.toolChoice)&&!o?.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],s=Array.isArray(n.content)?n.content:[n.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},Zr,r)}elicitInputStream(e,r){let o=this._server.getClientCapabilities(),n=e.mode??"form";switch(n){case"url":{if(!o?.elicitation?.url)throw new Error("Client does not support url elicitation.");break}case"form":{if(!o?.elicitation?.form)throw new Error("Client does not support form elicitation.");break}}let s=n==="form"&&e.mode===void 0?{...e,mode:"form"}:e;return this.requestStream({method:"elicitation/create",params:s},Jt,r)}async getTask(e,r){return this._server.getTask({taskId:e},r)}async getTaskResult(e,r,o){return this._server.getTaskResult({taskId:e},r,o)}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 vh(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 $h(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 Zn=class extends tn{constructor(e,r){super(r),this._serverInfo=e,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(jr.options.map((o,n)=>[o,n])),this.isMessageIgnored=(o,n)=>{let s=this._loggingLevels.get(n);return s?this.LOG_LEVEL_SEVERITY.get(o)<this.LOG_LEVEL_SEVERITY.get(s):!1},this._capabilities=r?.capabilities??{},this._instructions=r?.instructions,this._jsonSchemaValidator=r?.jsonSchemaValidator??new Dn,this.setRequestHandler(Gs,o=>this._oninitialize(o)),this.setNotificationHandler(Ws,()=>this.oninitialized?.()),this._capabilities.logging&&this.setRequestHandler(oi,async(o,n)=>{let s=n.sessionId||n.requestInfo?.headers["mcp-session-id"]||void 0,{level:i}=o.params,a=jr.safeParse(i);return a.success&&this._loggingLevels.set(s,a.data),{}})}get experimental(){return this._experimental||(this._experimental={tasks:new jn(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=xp(this._capabilities,e)}setRequestHandler(e,r){let n=jo(e)?.method;if(!n)throw new Error("Schema is missing a method literal");let s;if(Ut(n)){let a=n;s=a._zod?.def?.value??a.value}else{let a=n;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=pt(Dr,c);if(!l.success){let m=l.error instanceof Error?l.error.message:String(l.error);throw new O(C.InvalidParams,`Invalid tools/call request: ${m}`)}let{params:d}=l.data,p=await Promise.resolve(r(c,u));if(d.task){let m=pt(Vt,p);if(!m.success){let _=m.error instanceof Error?m.error.message:String(m.error);throw new O(C.InvalidParams,`Invalid task creation result: ${_}`)}return m.data}let f=pt(en,p);if(!f.success){let m=f.error instanceof Error?f.error.message:String(f.error);throw new O(C.InvalidParams,`Invalid tools/call result: ${m}`)}return f.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){$h(this._clientCapabilities?.tasks?.requests,e,"Client")}assertTaskHandlerCapability(e){this._capabilities&&vh(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:cp.includes(r)?r:Fs,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"},Vo)}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 o=e.messages[e.messages.length-1],n=Array.isArray(o.content)?o.content:[o.content],s=n.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(n.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(n.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},ni,r):this.request({method:"sampling/createMessage",params:e},Zr,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 n=e;return this.request({method:"elicitation/create",params:n},Jt,r)}case"form":{if(!this._clientCapabilities?.elicitation?.form)throw new Error("Client does not support form elicitation.");let n=e.mode==="form"?e:{...e,mode:"form"},s=await this.request({method:"elicitation/create",params:n},Jt,r);if(s.action==="accept"&&s.content&&n.requestedSchema)try{let a=this._jsonSchemaValidator.getValidator(n.requestedSchema)(s.content);if(!a.valid)throw new O(C.InvalidParams,`Elicitation response content does not match requested schema: ${a.errorMessage}`)}catch(i){throw i instanceof O?i:new O(C.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},si,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 tc=vo(require("node:process"),1);var Ln=class{append(e){this._buffer=this._buffer?Buffer.concat([this._buffer,e]):e}readMessage(){if(!this._buffer)return null;let e=this._buffer.indexOf(`
81
+ `);if(e===-1)return null;let r=this._buffer.toString("utf8",0,e).replace(/\r$/,"");return this._buffer=this._buffer.subarray(e+1),lz(r)}clear(){this._buffer=void 0}};function lz(t){return gp.parse(JSON.parse(t))}function bh(t){return JSON.stringify(t)+`
82
+ `}var qn=class{constructor(e=tc.default.stdin,r=tc.default.stdout){this._stdin=e,this._stdout=r,this._readBuffer=new Ln,this._started=!1,this._ondata=o=>{this._readBuffer.append(o),this.processReadBuffer()},this._onerror=o=>{this.onerror?.(o)}}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 o=bh(e);this._stdout.write(o)?r():this._stdout.once("drain",r)})}};var oc=vo(require("path"),1);var rc={DEFAULT:3e5,HEALTH_CHECK:3e3,POST_SPAWN_WAIT:5e3,PORT_IN_USE_WAIT:3e3,WORKER_STARTUP_WAIT:1e3,PRE_RESTART_SETTLE_DELAY:2e3,POWERSHELL_COMMAND:1e4,WINDOWS_MULTIPLIER:1.5};function Sh(t){return process.platform==="win32"?Math.round(t*rc.WINDOWS_MULTIPLIER):t}var Be=require("fs"),Un=require("path"),xh=require("os");var wh="bugfix,feature,refactor,discovery,decision,change",zh="how-it-works,why-it-exists,what-changed,problem-solution,gotcha,pattern,trade-off";var it=class{static DEFAULTS={CLAUDE_MEM_MODEL:"claude-sonnet-4-5",CLAUDE_MEM_CONTEXT_OBSERVATIONS:"50",CLAUDE_MEM_WORKER_PORT:"37777",CLAUDE_MEM_WORKER_HOST:"127.0.0.1",CLAUDE_MEM_SKIP_TOOLS:"ListMcpResourcesTool,SlashCommand,Skill,TodoWrite,AskUserQuestion",CLAUDE_MEM_PROVIDER:"claude",CLAUDE_MEM_CLAUDE_AUTH_METHOD:"cli",CLAUDE_MEM_GEMINI_API_KEY:"",CLAUDE_MEM_GEMINI_MODEL:"gemini-2.5-flash-lite",CLAUDE_MEM_GEMINI_RATE_LIMITING_ENABLED:"true",CLAUDE_MEM_OPENROUTER_API_KEY:"",CLAUDE_MEM_OPENROUTER_MODEL:"xiaomi/mimo-v2-flash:free",CLAUDE_MEM_OPENROUTER_SITE_URL:"",CLAUDE_MEM_OPENROUTER_APP_NAME:"claude-mem",CLAUDE_MEM_OPENROUTER_MAX_CONTEXT_MESSAGES:"20",CLAUDE_MEM_OPENROUTER_MAX_TOKENS:"100000",CLAUDE_MEM_DATA_DIR:(0,Un.join)((0,xh.homedir)(),".claude-mem"),CLAUDE_MEM_LOG_LEVEL:"INFO",CLAUDE_MEM_PYTHON_VERSION:"3.13",CLAUDE_CODE_PATH:"",CLAUDE_MEM_MODE:"code",CLAUDE_MEM_CONTEXT_SHOW_READ_TOKENS:"false",CLAUDE_MEM_CONTEXT_SHOW_WORK_TOKENS:"false",CLAUDE_MEM_CONTEXT_SHOW_SAVINGS_AMOUNT:"false",CLAUDE_MEM_CONTEXT_SHOW_SAVINGS_PERCENT:"true",CLAUDE_MEM_CONTEXT_OBSERVATION_TYPES:wh,CLAUDE_MEM_CONTEXT_OBSERVATION_CONCEPTS:zh,CLAUDE_MEM_CONTEXT_FULL_COUNT:"0",CLAUDE_MEM_CONTEXT_FULL_FIELD:"narrative",CLAUDE_MEM_CONTEXT_SESSION_COUNT:"10",CLAUDE_MEM_CONTEXT_SHOW_LAST_SUMMARY:"true",CLAUDE_MEM_CONTEXT_SHOW_LAST_MESSAGE:"false",CLAUDE_MEM_FOLDER_CLAUDEMD_ENABLED:"false",CLAUDE_MEM_MAX_CONCURRENT_AGENTS:"2",CLAUDE_MEM_EXCLUDED_PROJECTS:"",CLAUDE_MEM_FOLDER_MD_EXCLUDE:"[]",CLAUDE_MEM_CHROMA_MODE:"local",CLAUDE_MEM_CHROMA_HOST:"127.0.0.1",CLAUDE_MEM_CHROMA_PORT:"8000",CLAUDE_MEM_CHROMA_SSL:"false",CLAUDE_MEM_CHROMA_API_KEY:"",CLAUDE_MEM_CHROMA_TENANT:"default_tenant",CLAUDE_MEM_CHROMA_DATABASE:"default_database"};static getAllDefaults(){return{...this.DEFAULTS}}static get(e){return this.DEFAULTS[e]}static getInt(e){let r=this.get(e);return parseInt(r,10)}static getBool(e){let r=this.get(e);return r==="true"||r===!0}static applyEnvOverrides(e){let r={...e};for(let o of Object.keys(this.DEFAULTS))process.env[o]!==void 0&&(r[o]=process.env[o]);return r}static loadFromFile(e){try{if(!(0,Be.existsSync)(e)){let i=this.getAllDefaults();try{let a=(0,Un.dirname)(e);(0,Be.existsSync)(a)||(0,Be.mkdirSync)(a,{recursive:!0}),(0,Be.writeFileSync)(e,JSON.stringify(i,null,2),"utf-8"),console.log("[SETTINGS] Created settings file with defaults:",e)}catch(a){console.warn("[SETTINGS] Failed to create settings file, using in-memory defaults:",e,a)}return this.applyEnvOverrides(i)}let r=(0,Be.readFileSync)(e,"utf-8"),o=JSON.parse(r),n=o;if(o.env&&typeof o.env=="object"){n=o.env;try{(0,Be.writeFileSync)(e,JSON.stringify(n,null,2),"utf-8"),console.log("[SETTINGS] Migrated settings file from nested to flat schema:",e)}catch(i){console.warn("[SETTINGS] Failed to auto-migrate settings file:",e,i)}}let s={...this.DEFAULTS};for(let i of Object.keys(this.DEFAULTS))n[i]!==void 0&&(s[i]=n[i]);return this.applyEnvOverrides(s)}catch(r){return console.warn("[SETTINGS] Failed to load settings, using defaults:",e,r),this.applyEnvOverrides(this.getAllDefaults())}}};var ae=require("path"),Eh=require("os");var kh=require("url");var fz={};function dz(){return typeof __dirname<"u"?__dirname:(0,ae.dirname)((0,kh.fileURLToPath)(fz.url))}var fI=dz(),at=it.get("CLAUDE_MEM_DATA_DIR"),Fn=process.env.CLAUDE_CONFIG_DIR||(0,ae.join)((0,Eh.homedir)(),".claude"),pz=(0,ae.join)(Fn,"plugins","marketplaces","thedotmack"),mI=(0,ae.join)(at,"archives"),hI=(0,ae.join)(at,"logs"),gI=(0,ae.join)(at,"trash"),_I=(0,ae.join)(at,"backups"),yI=(0,ae.join)(at,"modes"),vI=(0,ae.join)(at,"settings.json"),$I=(0,ae.join)(at,"claude-mem.db"),bI=(0,ae.join)(at,"vector-db"),SI=(0,ae.join)(at,"observer-sessions"),wI=(0,ae.join)(Fn,"settings.json"),zI=(0,ae.join)(Fn,"commands"),xI=(0,ae.join)(Fn,"CLAUDE.md");var RI=(()=>{let t=process.env.CLAUDE_MEM_HEALTH_TIMEOUT_MS;if(t){let e=parseInt(t,10);if(Number.isFinite(e)&&e>=500&&e<=3e5)return e;re.warn("SYSTEM","Invalid CLAUDE_MEM_HEALTH_TIMEOUT_MS, using default",{value:t,min:500,max:3e5})}return Sh(rc.HEALTH_CHECK)})();var Vn=null,Hn=null;function Ph(){if(Vn!==null)return Vn;let t=oc.default.join(it.get("CLAUDE_MEM_DATA_DIR"),"settings.json"),e=it.loadFromFile(t);return Vn=parseInt(e.CLAUDE_MEM_WORKER_PORT,10),Vn}function Th(){if(Hn!==null)return Hn;let t=oc.default.join(it.get("CLAUDE_MEM_DATA_DIR"),"settings.json");return Hn=it.loadFromFile(t).CLAUDE_MEM_WORKER_HOST,Hn}var mz="10.2.0";console.log=(...t)=>{re.error("CONSOLE","Intercepted console output (MCP protocol protection)",void 0,{args:t})};var hz=Ph(),gz=Th(),yo=`http://${gz}:${hz}`,Oh={search:"/api/search",timeline:"/api/timeline"};async function Rh(t,e){re.debug("SYSTEM","\u2192 Worker API",void 0,{endpoint:t,params:e});try{let r=new URLSearchParams;for(let[i,a]of Object.entries(e))a!=null&&r.append(i,String(a));let o=`${yo}${t}?${r}`,n=await fetch(o);if(!n.ok){let i=await n.text();throw new Error(`Worker API error (${n.status}): ${i}`)}let s=await n.json();return re.debug("SYSTEM","\u2190 Worker API success",void 0,{endpoint:t}),s}catch(r){return re.error("SYSTEM","\u2190 Worker API error",{endpoint:t},r),{content:[{type:"text",text:`Error calling Worker API: ${r instanceof Error?r.message:String(r)}`}],isError:!0}}}async function Ih(t,e){re.debug("HTTP","Worker API request (POST)",void 0,{endpoint:t});try{let r=`${yo}${t}`,o=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!o.ok){let s=await o.text();throw new Error(`Worker API error (${o.status}): ${s}`)}let n=await o.json();return re.debug("HTTP","Worker API success (POST)",void 0,{endpoint:t}),{content:[{type:"text",text:JSON.stringify(n,null,2)}]}}catch(r){return re.error("HTTP","Worker API error (POST)",{endpoint:t},r),{content:[{type:"text",text:`Error calling Worker API: ${r instanceof Error?r.message:String(r)}`}],isError:!0}}}async function _z(){try{return(await fetch(`${yo}/api/health`)).ok}catch(t){return re.debug("SYSTEM","Worker health check failed",{},t),!1}}var Ah=[{name:"__IMPORTANT",description:`3-LAYER WORKFLOW (ALWAYS FOLLOW):
58
83
  1. search(query) \u2192 Get index with IDs (~50-100 tokens/result)
59
84
  2. timeline(anchor=ID) \u2192 Get context around interesting results
60
85
  3. get_observations([IDs]) \u2192 Fetch full details ONLY for filtered IDs
@@ -74,4 +99,4 @@ NEVER fetch full details without filtering first. 10x token savings.`,inputSchem
74
99
  \`get_observations(ids=[...])\` # ALWAYS batch for 2+ items
75
100
  Returns: Complete details (~500-1000 tokens/result)
76
101
 
77
- **Why:** 10x token savings. Never fetch full details without filtering first.`}]})},{name:"search",description:"Step 1: Search memory. Returns index with IDs. Params: query, limit, project, type, obs_type, dateStart, dateEnd, offset, orderBy",inputSchema:{type:"object",properties:{},additionalProperties:!0},handler:async t=>{let e=Zy.search;return await Cy(e,t)}},{name:"timeline",description:"Step 2: Get context around results. Params: anchor (observation ID) OR query (finds anchor automatically), depth_before, depth_after, project",inputSchema:{type:"object",properties:{},additionalProperties:!0},handler:async t=>{let e=Zy.timeline;return await Cy(e,t)}},{name:"get_observations",description:"Step 3: Fetch full details for filtered IDs. Params: ids (array of observation IDs, required), orderBy, limit, project",inputSchema:{type:"object",properties:{ids:{type:"array",items:{type:"number"},description:"Array of observation IDs to fetch (required)"}},required:["ids"],additionalProperties:!0},handler:async t=>await My("/api/observations/batch",t)},{name:"save_memory",description:"Save a manual memory/observation for semantic search. Use this to remember important information.",inputSchema:{type:"object",properties:{text:{type:"string",description:"Content to remember (required)"},title:{type:"string",description:"Short title (auto-generated from text if omitted)"},project:{type:"string",description:'Project name (uses "claude-mem" if omitted)'}},required:["text"]},handler:async t=>await My("/api/memory/save",t)}],gf=new ms({name:"mcp-search-server",version:OT},{capabilities:{tools:{}}});gf.setRequestHandler(fd,async()=>({tools:Ly.map(t=>({name:t.name,description:t.description,inputSchema:t.inputSchema}))}));gf.setRequestHandler(Eo,async t=>{let e=Ly.find(r=>r.name===t.params.name);if(!e)throw new Error(`Unknown tool: ${t.params.name}`);try{return await e.handler(t.params.arguments||{})}catch(r){return ve.error("SYSTEM","Tool execution failed",{tool:t.params.name},r),{content:[{type:"text",text:`Tool execution failed: ${r instanceof Error?r.message:String(r)}`}],isError:!0}}});async function qy(){ve.info("SYSTEM","MCP server shutting down"),process.exit(0)}process.on("SIGTERM",qy);process.on("SIGINT",qy);async function RT(){let t=new gs;await gf.connect(t),ve.info("SYSTEM","Claude-mem search server started"),setTimeout(async()=>{await NT()?ve.info("SYSTEM","Worker available",void 0,{workerUrl:ai}):(ve.error("SYSTEM","Worker not available",void 0,{workerUrl:ai}),ve.error("SYSTEM","Tools will fail until Worker is started"),ve.error("SYSTEM","Start Worker with: npm run worker:restart"))},0)}RT().catch(t=>{ve.error("SYSTEM","Fatal error",void 0,t),process.exit(0)});
102
+ **Why:** 10x token savings. Never fetch full details without filtering first.`}]})},{name:"search",description:"Step 1: Search memory. Returns index with IDs. Params: query, limit, project, type, obs_type, dateStart, dateEnd, offset, orderBy",inputSchema:{type:"object",properties:{},additionalProperties:!0},handler:async t=>{let e=Oh.search;return await Rh(e,t)}},{name:"timeline",description:"Step 2: Get context around results. Params: anchor (observation ID) OR query (finds anchor automatically), depth_before, depth_after, project",inputSchema:{type:"object",properties:{},additionalProperties:!0},handler:async t=>{let e=Oh.timeline;return await Rh(e,t)}},{name:"get_observations",description:"Step 3: Fetch full details for filtered IDs. Params: ids (array of observation IDs, required), orderBy, limit, project",inputSchema:{type:"object",properties:{ids:{type:"array",items:{type:"number"},description:"Array of observation IDs to fetch (required)"}},required:["ids"],additionalProperties:!0},handler:async t=>await Ih("/api/observations/batch",t)},{name:"save_memory",description:"Save a manual memory/observation for semantic search. Use this to remember important information.",inputSchema:{type:"object",properties:{text:{type:"string",description:"Content to remember (required)"},title:{type:"string",description:"Short title (auto-generated from text if omitted)"},project:{type:"string",description:'Project name (uses "claude-mem" if omitted)'}},required:["text"]},handler:async t=>await Ih("/api/memory/save",t)}],nc=new Zn({name:"claude-mem",version:mz},{capabilities:{tools:{}}});nc.setRequestHandler(ri,async()=>({tools:Ah.map(t=>({name:t.name,description:t.description,inputSchema:t.inputSchema}))}));nc.setRequestHandler(Dr,async t=>{let e=Ah.find(r=>r.name===t.params.name);if(!e)throw new Error(`Unknown tool: ${t.params.name}`);try{return await e.handler(t.params.arguments||{})}catch(r){return re.error("SYSTEM","Tool execution failed",{tool:t.params.name},r),{content:[{type:"text",text:`Tool execution failed: ${r instanceof Error?r.message:String(r)}`}],isError:!0}}});var yz=3e4,_o=null;function vz(){if(process.platform==="win32")return;let t=process.ppid;_o=setInterval(()=>{(process.ppid===1||process.ppid!==t)&&(re.info("SYSTEM","Parent process died, self-exiting to prevent orphan",{initialPpid:t,currentPpid:process.ppid}),sc())},yz),_o.unref&&_o.unref()}function sc(){_o&&clearInterval(_o),re.info("SYSTEM","MCP server shutting down"),process.exit(0)}process.on("SIGTERM",sc);process.on("SIGINT",sc);async function $z(){let t=new qn;await nc.connect(t),re.info("SYSTEM","Claude-mem search server started"),vz(),setTimeout(async()=>{await _z()?re.info("SYSTEM","Worker available",void 0,{workerUrl:yo}):(re.error("SYSTEM","Worker not available",void 0,{workerUrl:yo}),re.error("SYSTEM","Tools will fail until Worker is started"),re.error("SYSTEM","Start Worker with: npm run worker:restart"))},0)}$z().catch(t=>{re.error("SYSTEM","Fatal error",void 0,t),process.exit(0)});