@routinecrew/routinecode 2.5.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.
- package/README.md +219 -0
- package/bin/setup.js +367 -0
- package/hooks/hooks-config.json +38 -0
- package/hooks/post-build-check.sh +22 -0
- package/hooks/pre-edit-check.sh +25 -0
- package/hooks/session-start.sh +11 -0
- package/mcp-db-manager/dist/index.mjs +30654 -0
- package/mcp-db-manager/package.json +53 -0
- package/mcp-dev-tester/dist/index.mjs +72 -0
- package/mcp-dev-tester/package.json +29 -0
- package/mcp-doc-fetcher/dist/index.mjs +51 -0
- package/mcp-doc-fetcher/package.json +23 -0
- package/mcp-html-renderer/dist/index.mjs +105 -0
- package/mcp-html-renderer/package.json +35 -0
- package/mcp-intelligence/dist/index.mjs +54 -0
- package/mcp-intelligence/package.json +34 -0
- package/mcp-log-watcher/dist/index.mjs +92 -0
- package/mcp-log-watcher/package.json +27 -0
- package/mcp-plan-manager/dist/index.mjs +104 -0
- package/mcp-plan-manager/package.json +26 -0
- package/mcp-project-context/dist/index.mjs +60 -0
- package/mcp-project-context/package.json +24 -0
- package/mcp-routinecode/dist/index.mjs +56 -0
- package/mcp-routinecode/package.json +24 -0
- package/package.json +56 -0
- package/plugin/.claude-plugin/plugin.json +10 -0
- package/plugin/agents/analyzer.md +68 -0
- package/plugin/agents/crawler.md +70 -0
- package/plugin/agents/explorer.md +74 -0
- package/plugin/agents/implementor.md +113 -0
- package/plugin/agents/looker.md +61 -0
- package/plugin/agents/planner.md +87 -0
- package/plugin/agents/reviewer.md +140 -0
- package/plugin/agents/verifier.md +59 -0
- package/plugin/commands/analyze.md +48 -0
- package/plugin/commands/plan.md +54 -0
- package/plugin/commands/rc.md +86 -0
- package/plugin/routinecode-prompt.md +217 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
var Nx=Object.create;var pc=Object.defineProperty;var Dx=Object.getOwnPropertyDescriptor;var Zx=Object.getOwnPropertyNames;var Rx=Object.getPrototypeOf,Ax=Object.prototype.hasOwnProperty;var Ee=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var _=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ti=(e,t)=>{for(var r in t)pc(e,r,{get:t[r],enumerable:!0})},Ux=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Zx(t))!Ax.call(e,i)&&i!==r&&pc(e,i,{get:()=>t[i],enumerable:!(n=Dx(t,i))||n.enumerable});return e};var mc=(e,t,r)=>(r=e!=null?Nx(Rx(e)):{},Ux(t||!e||!e.__esModule?pc(r,"default",{value:e,enumerable:!0}):r,e));var mo=_(oe=>{"use strict";Object.defineProperty(oe,"__esModule",{value:!0});oe.regexpCode=oe.getEsmExportName=oe.getProperty=oe.safeStringify=oe.stringify=oe.strConcat=oe.addCodeArg=oe.str=oe._=oe.nil=oe._Code=oe.Name=oe.IDENTIFIER=oe._CodeOrName=void 0;var fo=class{};oe._CodeOrName=fo;oe.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Jr=class extends fo{constructor(t){if(super(),!oe.IDENTIFIER.test(t))throw new Error("CodeGen: name must be a valid identifier");this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};oe.Name=Jr;var wt=class extends fo{constructor(t){super(),this._items=typeof t=="string"?[t]:t}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let t=this._items[0];return t===""||t==='""'}get str(){var t;return(t=this._str)!==null&&t!==void 0?t:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var t;return(t=this._names)!==null&&t!==void 0?t:this._names=this._items.reduce((r,n)=>(n instanceof Jr&&(r[n.str]=(r[n.str]||0)+1),r),{})}};oe._Code=wt;oe.nil=new wt("");function Zv(e,...t){let r=[e[0]],n=0;for(;n<t.length;)uf(r,t[n]),r.push(e[++n]);return new wt(r)}oe._=Zv;var cf=new wt("+");function Rv(e,...t){let r=[po(e[0])],n=0;for(;n<t.length;)r.push(cf),uf(r,t[n]),r.push(cf,po(e[++n]));return Sz(r),new wt(r)}oe.str=Rv;function uf(e,t){t instanceof wt?e.push(...t._items):t instanceof Jr?e.push(t):e.push(Pz(t))}oe.addCodeArg=uf;function Sz(e){let t=1;for(;t<e.length-1;){if(e[t]===cf){let r=zz(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}function zz(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string")return t instanceof Jr||e[e.length-1]!=='"'?void 0:typeof t!="string"?`${e.slice(0,-1)}${t}"`:t[0]==='"'?e.slice(0,-1)+t.slice(1):void 0;if(typeof t=="string"&&t[0]==='"'&&!(e instanceof Jr))return`"${e}${t.slice(1)}`}function Iz(e,t){return t.emptyStr()?e:e.emptyStr()?t:Rv`${e}${t}`}oe.strConcat=Iz;function Pz(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:po(Array.isArray(e)?e.join(","):e)}function Tz(e){return new wt(po(e))}oe.stringify=Tz;function po(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}oe.safeStringify=po;function Ez(e){return typeof e=="string"&&oe.IDENTIFIER.test(e)?new wt(`.${e}`):Zv`[${e}]`}oe.getProperty=Ez;function jz(e){if(typeof e=="string"&&oe.IDENTIFIER.test(e))return new wt(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}oe.getEsmExportName=jz;function Oz(e){return new wt(e.toString())}oe.regexpCode=Oz});var ff=_(ct=>{"use strict";Object.defineProperty(ct,"__esModule",{value:!0});ct.ValueScope=ct.ValueScopeName=ct.Scope=ct.varKinds=ct.UsedValueState=void 0;var st=mo(),lf=class extends Error{constructor(t){super(`CodeGen: "code" for ${t} not defined`),this.value=t.value}},vs;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(vs||(ct.UsedValueState=vs={}));ct.varKinds={const:new st.Name("const"),let:new st.Name("let"),var:new st.Name("var")};var ys=class{constructor({prefixes:t,parent:r}={}){this._names={},this._prefixes=t,this._parent=r}toName(t){return t instanceof st.Name?t:this.name(t)}name(t){return new st.Name(this._newName(t))}_newName(t){let r=this._names[t]||this._nameGroup(t);return`${t}${r.index++}`}_nameGroup(t){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(t)||this._prefixes&&!this._prefixes.has(t))throw new Error(`CodeGen: prefix "${t}" is not allowed in this scope`);return this._names[t]={prefix:t,index:0}}};ct.Scope=ys;var _s=class extends st.Name{constructor(t,r){super(r),this.prefix=t}setValue(t,{property:r,itemIndex:n}){this.value=t,this.scopePath=(0,st._)`.${new st.Name(r)}[${n}]`}};ct.ValueScopeName=_s;var Nz=(0,st._)`\n`,df=class extends ys{constructor(t){super(t),this._values={},this._scope=t.scope,this.opts={...t,_n:t.lines?Nz:st.nil}}get(){return this._scope}name(t){return new _s(t,this._newName(t))}value(t,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let i=this.toName(t),{prefix:o}=i,a=(n=r.key)!==null&&n!==void 0?n:r.ref,s=this._values[o];if(s){let l=s.get(a);if(l)return l}else s=this._values[o]=new Map;s.set(a,i);let c=this._scope[o]||(this._scope[o]=[]),u=c.length;return c[u]=r.ref,i.setValue(r,{property:o,itemIndex:u}),i}getValue(t,r){let n=this._values[t];if(n)return n.get(r)}scopeRefs(t,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,st._)`${t}${n.scopePath}`})}scopeCode(t=this._values,r,n){return this._reduceValues(t,i=>{if(i.value===void 0)throw new Error(`CodeGen: name "${i}" has no value`);return i.value.code},r,n)}_reduceValues(t,r,n={},i){let o=st.nil;for(let a in t){let s=t[a];if(!s)continue;let c=n[a]=n[a]||new Map;s.forEach(u=>{if(c.has(u))return;c.set(u,vs.Started);let l=r(u);if(l){let d=this.opts.es5?ct.varKinds.var:ct.varKinds.const;o=(0,st._)`${o}${d} ${u} = ${l};${this.opts._n}`}else if(l=i?.(u))o=(0,st._)`${o}${l}${this.opts._n}`;else throw new lf(u);c.set(u,vs.Completed)})}return o}};ct.ValueScope=df});var B=_(G=>{"use strict";Object.defineProperty(G,"__esModule",{value:!0});G.or=G.and=G.not=G.CodeGen=G.operators=G.varKinds=G.ValueScopeName=G.ValueScope=G.Scope=G.Name=G.regexpCode=G.stringify=G.getProperty=G.nil=G.strConcat=G.str=G._=void 0;var re=mo(),Ot=ff(),xr=mo();Object.defineProperty(G,"_",{enumerable:!0,get:function(){return xr._}});Object.defineProperty(G,"str",{enumerable:!0,get:function(){return xr.str}});Object.defineProperty(G,"strConcat",{enumerable:!0,get:function(){return xr.strConcat}});Object.defineProperty(G,"nil",{enumerable:!0,get:function(){return xr.nil}});Object.defineProperty(G,"getProperty",{enumerable:!0,get:function(){return xr.getProperty}});Object.defineProperty(G,"stringify",{enumerable:!0,get:function(){return xr.stringify}});Object.defineProperty(G,"regexpCode",{enumerable:!0,get:function(){return xr.regexpCode}});Object.defineProperty(G,"Name",{enumerable:!0,get:function(){return xr.Name}});var ks=ff();Object.defineProperty(G,"Scope",{enumerable:!0,get:function(){return ks.Scope}});Object.defineProperty(G,"ValueScope",{enumerable:!0,get:function(){return ks.ValueScope}});Object.defineProperty(G,"ValueScopeName",{enumerable:!0,get:function(){return ks.ValueScopeName}});Object.defineProperty(G,"varKinds",{enumerable:!0,get:function(){return ks.varKinds}});G.operators={GT:new re._Code(">"),GTE:new re._Code(">="),LT:new re._Code("<"),LTE:new re._Code("<="),EQ:new re._Code("==="),NEQ:new re._Code("!=="),NOT:new re._Code("!"),OR:new re._Code("||"),AND:new re._Code("&&"),ADD:new re._Code("+")};var ir=class{optimizeNodes(){return this}optimizeNames(t,r){return this}},pf=class extends ir{constructor(t,r,n){super(),this.varKind=t,this.name=r,this.rhs=n}render({es5:t,_n:r}){let n=t?Ot.varKinds.var:this.varKind,i=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${i};`+r}optimizeNames(t,r){if(t[this.name.str])return this.rhs&&(this.rhs=Nn(this.rhs,t,r)),this}get names(){return this.rhs instanceof re._CodeOrName?this.rhs.names:{}}},$s=class extends ir{constructor(t,r,n){super(),this.lhs=t,this.rhs=r,this.sideEffects=n}render({_n:t}){return`${this.lhs} = ${this.rhs};`+t}optimizeNames(t,r){if(!(this.lhs instanceof re.Name&&!t[this.lhs.str]&&!this.sideEffects))return this.rhs=Nn(this.rhs,t,r),this}get names(){let t=this.lhs instanceof re.Name?{}:{...this.lhs.names};return xs(t,this.rhs)}},mf=class extends $s{constructor(t,r,n,i){super(t,n,i),this.op=r}render({_n:t}){return`${this.lhs} ${this.op}= ${this.rhs};`+t}},hf=class extends ir{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`${this.label}:`+t}},gf=class extends ir{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`break${this.label?` ${this.label}`:""};`+t}},vf=class extends ir{constructor(t){super(),this.error=t}render({_n:t}){return`throw ${this.error};`+t}get names(){return this.error.names}},yf=class extends ir{constructor(t){super(),this.code=t}render({_n:t}){return`${this.code};`+t}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(t,r){return this.code=Nn(this.code,t,r),this}get names(){return this.code instanceof re._CodeOrName?this.code.names:{}}},ho=class extends ir{constructor(t=[]){super(),this.nodes=t}render(t){return this.nodes.reduce((r,n)=>r+n.render(t),"")}optimizeNodes(){let{nodes:t}=this,r=t.length;for(;r--;){let n=t[r].optimizeNodes();Array.isArray(n)?t.splice(r,1,...n):n?t[r]=n:t.splice(r,1)}return t.length>0?this:void 0}optimizeNames(t,r){let{nodes:n}=this,i=n.length;for(;i--;){let o=n[i];o.optimizeNames(t,r)||(Dz(t,o.names),n.splice(i,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((t,r)=>Wr(t,r.names),{})}},or=class extends ho{render(t){return"{"+t._n+super.render(t)+"}"+t._n}},_f=class extends ho{},On=class extends or{};On.kind="else";var Kr=class e extends or{constructor(t,r){super(r),this.condition=t}render(t){let r=`if(${this.condition})`+super.render(t);return this.else&&(r+="else "+this.else.render(t)),r}optimizeNodes(){super.optimizeNodes();let t=this.condition;if(t===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new On(n):n}if(r)return t===!1?r instanceof e?r:r.nodes:this.nodes.length?this:new e(Av(t),r instanceof e?[r]:r.nodes);if(!(t===!1||!this.nodes.length))return this}optimizeNames(t,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(t,r),!!(super.optimizeNames(t,r)||this.else))return this.condition=Nn(this.condition,t,r),this}get names(){let t=super.names;return xs(t,this.condition),this.else&&Wr(t,this.else.names),t}};Kr.kind="if";var Br=class extends or{};Br.kind="for";var $f=class extends Br{constructor(t){super(),this.iteration=t}render(t){return`for(${this.iteration})`+super.render(t)}optimizeNames(t,r){if(super.optimizeNames(t,r))return this.iteration=Nn(this.iteration,t,r),this}get names(){return Wr(super.names,this.iteration.names)}},bf=class extends Br{constructor(t,r,n,i){super(),this.varKind=t,this.name=r,this.from=n,this.to=i}render(t){let r=t.es5?Ot.varKinds.var:this.varKind,{name:n,from:i,to:o}=this;return`for(${r} ${n}=${i}; ${n}<${o}; ${n}++)`+super.render(t)}get names(){let t=xs(super.names,this.from);return xs(t,this.to)}},bs=class extends Br{constructor(t,r,n,i){super(),this.loop=t,this.varKind=r,this.name=n,this.iterable=i}render(t){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(t)}optimizeNames(t,r){if(super.optimizeNames(t,r))return this.iterable=Nn(this.iterable,t,r),this}get names(){return Wr(super.names,this.iterable.names)}},go=class extends or{constructor(t,r,n){super(),this.name=t,this.args=r,this.async=n}render(t){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(t)}};go.kind="func";var vo=class extends ho{render(t){return"return "+super.render(t)}};vo.kind="return";var xf=class extends or{render(t){let r="try"+super.render(t);return this.catch&&(r+=this.catch.render(t)),this.finally&&(r+=this.finally.render(t)),r}optimizeNodes(){var t,r;return super.optimizeNodes(),(t=this.catch)===null||t===void 0||t.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(t,r){var n,i;return super.optimizeNames(t,r),(n=this.catch)===null||n===void 0||n.optimizeNames(t,r),(i=this.finally)===null||i===void 0||i.optimizeNames(t,r),this}get names(){let t=super.names;return this.catch&&Wr(t,this.catch.names),this.finally&&Wr(t,this.finally.names),t}},yo=class extends or{constructor(t){super(),this.error=t}render(t){return`catch(${this.error})`+super.render(t)}};yo.kind="catch";var _o=class extends or{render(t){return"finally"+super.render(t)}};_o.kind="finally";var kf=class{constructor(t,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
|
|
3
|
+
`:""},this._extScope=t,this._scope=new Ot.Scope({parent:t}),this._nodes=[new _f]}toString(){return this._root.render(this.opts)}name(t){return this._scope.name(t)}scopeName(t){return this._extScope.name(t)}scopeValue(t,r){let n=this._extScope.value(t,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(t,r){return this._extScope.getValue(t,r)}scopeRefs(t){return this._extScope.scopeRefs(t,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(t,r,n,i){let o=this._scope.toName(r);return n!==void 0&&i&&(this._constants[o.str]=n),this._leafNode(new pf(t,o,n)),o}const(t,r,n){return this._def(Ot.varKinds.const,t,r,n)}let(t,r,n){return this._def(Ot.varKinds.let,t,r,n)}var(t,r,n){return this._def(Ot.varKinds.var,t,r,n)}assign(t,r,n){return this._leafNode(new $s(t,r,n))}add(t,r){return this._leafNode(new mf(t,G.operators.ADD,r))}code(t){return typeof t=="function"?t():t!==re.nil&&this._leafNode(new yf(t)),this}object(...t){let r=["{"];for(let[n,i]of t)r.length>1&&r.push(","),r.push(n),(n!==i||this.opts.es5)&&(r.push(":"),(0,re.addCodeArg)(r,i));return r.push("}"),new re._Code(r)}if(t,r,n){if(this._blockNode(new Kr(t)),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(t){return this._elseNode(new Kr(t))}else(){return this._elseNode(new On)}endIf(){return this._endBlockNode(Kr,On)}_for(t,r){return this._blockNode(t),r&&this.code(r).endFor(),this}for(t,r){return this._for(new $f(t),r)}forRange(t,r,n,i,o=this.opts.es5?Ot.varKinds.var:Ot.varKinds.let){let a=this._scope.toName(t);return this._for(new bf(o,a,r,n),()=>i(a))}forOf(t,r,n,i=Ot.varKinds.const){let o=this._scope.toName(t);if(this.opts.es5){let a=r instanceof re.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,re._)`${a}.length`,s=>{this.var(o,(0,re._)`${a}[${s}]`),n(o)})}return this._for(new bs("of",i,o,r),()=>n(o))}forIn(t,r,n,i=this.opts.es5?Ot.varKinds.var:Ot.varKinds.const){if(this.opts.ownProperties)return this.forOf(t,(0,re._)`Object.keys(${r})`,n);let o=this._scope.toName(t);return this._for(new bs("in",i,o,r),()=>n(o))}endFor(){return this._endBlockNode(Br)}label(t){return this._leafNode(new hf(t))}break(t){return this._leafNode(new gf(t))}return(t){let r=new vo;if(this._blockNode(r),this.code(t),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(vo)}try(t,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let i=new xf;if(this._blockNode(i),this.code(t),r){let o=this.name("e");this._currNode=i.catch=new yo(o),r(o)}return n&&(this._currNode=i.finally=new _o,this.code(n)),this._endBlockNode(yo,_o)}throw(t){return this._leafNode(new vf(t))}block(t,r){return this._blockStarts.push(this._nodes.length),t&&this.code(t).endBlock(r),this}endBlock(t){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||t!==void 0&&n!==t)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${t} expected`);return this._nodes.length=r,this}func(t,r=re.nil,n,i){return this._blockNode(new go(t,r,n)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(go)}optimize(t=1){for(;t-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(t){return this._currNode.nodes.push(t),this}_blockNode(t){this._currNode.nodes.push(t),this._nodes.push(t)}_endBlockNode(t,r){let n=this._currNode;if(n instanceof t||r&&n instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${t.kind}/${r.kind}`:t.kind}"`)}_elseNode(t){let r=this._currNode;if(!(r instanceof Kr))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=t,this}get _root(){return this._nodes[0]}get _currNode(){let t=this._nodes;return t[t.length-1]}set _currNode(t){let r=this._nodes;r[r.length-1]=t}};G.CodeGen=kf;function Wr(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function xs(e,t){return t instanceof re._CodeOrName?Wr(e,t.names):e}function Nn(e,t,r){if(e instanceof re.Name)return n(e);if(!i(e))return e;return new re._Code(e._items.reduce((o,a)=>(a instanceof re.Name&&(a=n(a)),a instanceof re._Code?o.push(...a._items):o.push(a),o),[]));function n(o){let a=r[o.str];return a===void 0||t[o.str]!==1?o:(delete t[o.str],a)}function i(o){return o instanceof re._Code&&o._items.some(a=>a instanceof re.Name&&t[a.str]===1&&r[a.str]!==void 0)}}function Dz(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}function Av(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:(0,re._)`!${wf(e)}`}G.not=Av;var Zz=Uv(G.operators.AND);function Rz(...e){return e.reduce(Zz)}G.and=Rz;var Az=Uv(G.operators.OR);function Uz(...e){return e.reduce(Az)}G.or=Uz;function Uv(e){return(t,r)=>t===re.nil?r:r===re.nil?t:(0,re._)`${wf(t)} ${e} ${wf(r)}`}function wf(e){return e instanceof re.Name?e:(0,re._)`(${e})`}});var ne=_(X=>{"use strict";Object.defineProperty(X,"__esModule",{value:!0});X.checkStrictMode=X.getErrorPath=X.Type=X.useFunc=X.setEvaluated=X.evaluatedPropsToName=X.mergeEvaluated=X.eachItem=X.unescapeJsonPointer=X.escapeJsonPointer=X.escapeFragment=X.unescapeFragment=X.schemaRefOrVal=X.schemaHasRulesButRef=X.schemaHasRules=X.checkUnknownRules=X.alwaysValidSchema=X.toHash=void 0;var pe=B(),Cz=mo();function Mz(e){let t={};for(let r of e)t[r]=!0;return t}X.toHash=Mz;function qz(e,t){return typeof t=="boolean"?t:Object.keys(t).length===0?!0:(qv(e,t),!Lv(t,e.self.RULES.all))}X.alwaysValidSchema=qz;function qv(e,t=e.schema){let{opts:r,self:n}=e;if(!r.strictSchema||typeof t=="boolean")return;let i=n.RULES.keywords;for(let o in t)i[o]||Jv(e,`unknown keyword: "${o}"`)}X.checkUnknownRules=qv;function Lv(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(t[r])return!0;return!1}X.schemaHasRules=Lv;function Lz(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}X.schemaHasRulesButRef=Lz;function Fz({topSchemaRef:e,schemaPath:t},r,n,i){if(!i){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,pe._)`${r}`}return(0,pe._)`${e}${t}${(0,pe.getProperty)(n)}`}X.schemaRefOrVal=Fz;function Vz(e){return Fv(decodeURIComponent(e))}X.unescapeFragment=Vz;function Jz(e){return encodeURIComponent(zf(e))}X.escapeFragment=Jz;function zf(e){return typeof e=="number"?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}X.escapeJsonPointer=zf;function Fv(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}X.unescapeJsonPointer=Fv;function Kz(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)}X.eachItem=Kz;function Cv({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(i,o,a,s)=>{let c=a===void 0?o:a instanceof pe.Name?(o instanceof pe.Name?e(i,o,a):t(i,o,a),a):o instanceof pe.Name?(t(i,a,o),o):r(o,a);return s===pe.Name&&!(c instanceof pe.Name)?n(i,c):c}}X.mergeEvaluated={props:Cv({mergeNames:(e,t,r)=>e.if((0,pe._)`${r} !== true && ${t} !== undefined`,()=>{e.if((0,pe._)`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,(0,pe._)`${r} || {}`).code((0,pe._)`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if((0,pe._)`${r} !== true`,()=>{t===!0?e.assign(r,!0):(e.assign(r,(0,pe._)`${r} || {}`),If(e,r,t))}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:Vv}),items:Cv({mergeNames:(e,t,r)=>e.if((0,pe._)`${r} !== true && ${t} !== undefined`,()=>e.assign(r,(0,pe._)`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if((0,pe._)`${r} !== true`,()=>e.assign(r,t===!0?!0:(0,pe._)`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function Vv(e,t){if(t===!0)return e.var("props",!0);let r=e.var("props",(0,pe._)`{}`);return t!==void 0&&If(e,r,t),r}X.evaluatedPropsToName=Vv;function If(e,t,r){Object.keys(r).forEach(n=>e.assign((0,pe._)`${t}${(0,pe.getProperty)(n)}`,!0))}X.setEvaluated=If;var Mv={};function Bz(e,t){return e.scopeValue("func",{ref:t,code:Mv[t.code]||(Mv[t.code]=new Cz._Code(t.code))})}X.useFunc=Bz;var Sf;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(Sf||(X.Type=Sf={}));function Wz(e,t,r){if(e instanceof pe.Name){let n=t===Sf.Num;return r?n?(0,pe._)`"[" + ${e} + "]"`:(0,pe._)`"['" + ${e} + "']"`:n?(0,pe._)`"/" + ${e}`:(0,pe._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,pe.getProperty)(e).toString():"/"+zf(e)}X.getErrorPath=Wz;function Jv(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,r===!0)throw new Error(t);e.self.logger.warn(t)}}X.checkStrictMode=Jv});var ar=_(Pf=>{"use strict";Object.defineProperty(Pf,"__esModule",{value:!0});var Ve=B(),Gz={data:new Ve.Name("data"),valCxt:new Ve.Name("valCxt"),instancePath:new Ve.Name("instancePath"),parentData:new Ve.Name("parentData"),parentDataProperty:new Ve.Name("parentDataProperty"),rootData:new Ve.Name("rootData"),dynamicAnchors:new Ve.Name("dynamicAnchors"),vErrors:new Ve.Name("vErrors"),errors:new Ve.Name("errors"),this:new Ve.Name("this"),self:new Ve.Name("self"),scope:new Ve.Name("scope"),json:new Ve.Name("json"),jsonPos:new Ve.Name("jsonPos"),jsonLen:new Ve.Name("jsonLen"),jsonPart:new Ve.Name("jsonPart")};Pf.default=Gz});var $o=_(Je=>{"use strict";Object.defineProperty(Je,"__esModule",{value:!0});Je.extendErrors=Je.resetErrorsCount=Je.reportExtraError=Je.reportError=Je.keyword$DataError=Je.keywordError=void 0;var ie=B(),ws=ne(),Qe=ar();Je.keywordError={message:({keyword:e})=>(0,ie.str)`must pass "${e}" keyword validation`};Je.keyword$DataError={message:({keyword:e,schemaType:t})=>t?(0,ie.str)`"${e}" keyword must be ${t} ($data)`:(0,ie.str)`"${e}" keyword is invalid ($data)`};function Hz(e,t=Je.keywordError,r,n){let{it:i}=e,{gen:o,compositeRule:a,allErrors:s}=i,c=Wv(e,t,r);n??(a||s)?Kv(o,c):Bv(i,(0,ie._)`[${c}]`)}Je.reportError=Hz;function Xz(e,t=Je.keywordError,r){let{it:n}=e,{gen:i,compositeRule:o,allErrors:a}=n,s=Wv(e,t,r);Kv(i,s),o||a||Bv(n,Qe.default.vErrors)}Je.reportExtraError=Xz;function Yz(e,t){e.assign(Qe.default.errors,t),e.if((0,ie._)`${Qe.default.vErrors} !== null`,()=>e.if(t,()=>e.assign((0,ie._)`${Qe.default.vErrors}.length`,t),()=>e.assign(Qe.default.vErrors,null)))}Je.resetErrorsCount=Yz;function Qz({gen:e,keyword:t,schemaValue:r,data:n,errsCount:i,it:o}){if(i===void 0)throw new Error("ajv implementation error");let a=e.name("err");e.forRange("i",i,Qe.default.errors,s=>{e.const(a,(0,ie._)`${Qe.default.vErrors}[${s}]`),e.if((0,ie._)`${a}.instancePath === undefined`,()=>e.assign((0,ie._)`${a}.instancePath`,(0,ie.strConcat)(Qe.default.instancePath,o.errorPath))),e.assign((0,ie._)`${a}.schemaPath`,(0,ie.str)`${o.errSchemaPath}/${t}`),o.opts.verbose&&(e.assign((0,ie._)`${a}.schema`,r),e.assign((0,ie._)`${a}.data`,n))})}Je.extendErrors=Qz;function Kv(e,t){let r=e.const("err",t);e.if((0,ie._)`${Qe.default.vErrors} === null`,()=>e.assign(Qe.default.vErrors,(0,ie._)`[${r}]`),(0,ie._)`${Qe.default.vErrors}.push(${r})`),e.code((0,ie._)`${Qe.default.errors}++`)}function Bv(e,t){let{gen:r,validateName:n,schemaEnv:i}=e;i.$async?r.throw((0,ie._)`new ${e.ValidationError}(${t})`):(r.assign((0,ie._)`${n}.errors`,t),r.return(!1))}var Gr={keyword:new ie.Name("keyword"),schemaPath:new ie.Name("schemaPath"),params:new ie.Name("params"),propertyName:new ie.Name("propertyName"),message:new ie.Name("message"),schema:new ie.Name("schema"),parentSchema:new ie.Name("parentSchema")};function Wv(e,t,r){let{createErrors:n}=e.it;return n===!1?(0,ie._)`{}`:eI(e,t,r)}function eI(e,t,r={}){let{gen:n,it:i}=e,o=[tI(i,r),rI(e,r)];return nI(e,t,o),n.object(...o)}function tI({errorPath:e},{instancePath:t}){let r=t?(0,ie.str)`${e}${(0,ws.getErrorPath)(t,ws.Type.Str)}`:e;return[Qe.default.instancePath,(0,ie.strConcat)(Qe.default.instancePath,r)]}function rI({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:n}){let i=n?t:(0,ie.str)`${t}/${e}`;return r&&(i=(0,ie.str)`${i}${(0,ws.getErrorPath)(r,ws.Type.Str)}`),[Gr.schemaPath,i]}function nI(e,{params:t,message:r},n){let{keyword:i,data:o,schemaValue:a,it:s}=e,{opts:c,propertyName:u,topSchemaRef:l,schemaPath:d}=s;n.push([Gr.keyword,i],[Gr.params,typeof t=="function"?t(e):t||(0,ie._)`{}`]),c.messages&&n.push([Gr.message,typeof r=="function"?r(e):r]),c.verbose&&n.push([Gr.schema,a],[Gr.parentSchema,(0,ie._)`${l}${d}`],[Qe.default.data,o]),u&&n.push([Gr.propertyName,u])}});var Hv=_(Dn=>{"use strict";Object.defineProperty(Dn,"__esModule",{value:!0});Dn.boolOrEmptySchema=Dn.topBoolOrEmptySchema=void 0;var iI=$o(),oI=B(),aI=ar(),sI={message:"boolean schema is false"};function cI(e){let{gen:t,schema:r,validateName:n}=e;r===!1?Gv(e,!1):typeof r=="object"&&r.$async===!0?t.return(aI.default.data):(t.assign((0,oI._)`${n}.errors`,null),t.return(!0))}Dn.topBoolOrEmptySchema=cI;function uI(e,t){let{gen:r,schema:n}=e;n===!1?(r.var(t,!1),Gv(e)):r.var(t,!0)}Dn.boolOrEmptySchema=uI;function Gv(e,t){let{gen:r,data:n}=e,i={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,iI.reportError)(i,sI,void 0,t)}});var Tf=_(Zn=>{"use strict";Object.defineProperty(Zn,"__esModule",{value:!0});Zn.getRules=Zn.isJSONType=void 0;var lI=["string","number","integer","boolean","null","object","array"],dI=new Set(lI);function fI(e){return typeof e=="string"&&dI.has(e)}Zn.isJSONType=fI;function pI(){let e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}Zn.getRules=pI});var Ef=_(kr=>{"use strict";Object.defineProperty(kr,"__esModule",{value:!0});kr.shouldUseRule=kr.shouldUseGroup=kr.schemaHasRulesForType=void 0;function mI({schema:e,self:t},r){let n=t.RULES.types[r];return n&&n!==!0&&Xv(e,n)}kr.schemaHasRulesForType=mI;function Xv(e,t){return t.rules.some(r=>Yv(e,r))}kr.shouldUseGroup=Xv;function Yv(e,t){var r;return e[t.keyword]!==void 0||((r=t.definition.implements)===null||r===void 0?void 0:r.some(n=>e[n]!==void 0))}kr.shouldUseRule=Yv});var bo=_(Ke=>{"use strict";Object.defineProperty(Ke,"__esModule",{value:!0});Ke.reportTypeError=Ke.checkDataTypes=Ke.checkDataType=Ke.coerceAndCheckDataType=Ke.getJSONTypes=Ke.getSchemaTypes=Ke.DataType=void 0;var hI=Tf(),gI=Ef(),vI=$o(),K=B(),Qv=ne(),Rn;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(Rn||(Ke.DataType=Rn={}));function yI(e){let t=ey(e.type);if(t.includes("null")){if(e.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&e.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');e.nullable===!0&&t.push("null")}return t}Ke.getSchemaTypes=yI;function ey(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(hI.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}Ke.getJSONTypes=ey;function _I(e,t){let{gen:r,data:n,opts:i}=e,o=$I(t,i.coerceTypes),a=t.length>0&&!(o.length===0&&t.length===1&&(0,gI.schemaHasRulesForType)(e,t[0]));if(a){let s=Of(t,n,i.strictNumbers,Rn.Wrong);r.if(s,()=>{o.length?bI(e,t,o):Nf(e)})}return a}Ke.coerceAndCheckDataType=_I;var ty=new Set(["string","number","integer","boolean","null"]);function $I(e,t){return t?e.filter(r=>ty.has(r)||t==="array"&&r==="array"):[]}function bI(e,t,r){let{gen:n,data:i,opts:o}=e,a=n.let("dataType",(0,K._)`typeof ${i}`),s=n.let("coerced",(0,K._)`undefined`);o.coerceTypes==="array"&&n.if((0,K._)`${a} == 'object' && Array.isArray(${i}) && ${i}.length == 1`,()=>n.assign(i,(0,K._)`${i}[0]`).assign(a,(0,K._)`typeof ${i}`).if(Of(t,i,o.strictNumbers),()=>n.assign(s,i))),n.if((0,K._)`${s} !== undefined`);for(let u of r)(ty.has(u)||u==="array"&&o.coerceTypes==="array")&&c(u);n.else(),Nf(e),n.endIf(),n.if((0,K._)`${s} !== undefined`,()=>{n.assign(i,s),xI(e,s)});function c(u){switch(u){case"string":n.elseIf((0,K._)`${a} == "number" || ${a} == "boolean"`).assign(s,(0,K._)`"" + ${i}`).elseIf((0,K._)`${i} === null`).assign(s,(0,K._)`""`);return;case"number":n.elseIf((0,K._)`${a} == "boolean" || ${i} === null
|
|
4
|
+
|| (${a} == "string" && ${i} && ${i} == +${i})`).assign(s,(0,K._)`+${i}`);return;case"integer":n.elseIf((0,K._)`${a} === "boolean" || ${i} === null
|
|
5
|
+
|| (${a} === "string" && ${i} && ${i} == +${i} && !(${i} % 1))`).assign(s,(0,K._)`+${i}`);return;case"boolean":n.elseIf((0,K._)`${i} === "false" || ${i} === 0 || ${i} === null`).assign(s,!1).elseIf((0,K._)`${i} === "true" || ${i} === 1`).assign(s,!0);return;case"null":n.elseIf((0,K._)`${i} === "" || ${i} === 0 || ${i} === false`),n.assign(s,null);return;case"array":n.elseIf((0,K._)`${a} === "string" || ${a} === "number"
|
|
6
|
+
|| ${a} === "boolean" || ${i} === null`).assign(s,(0,K._)`[${i}]`)}}}function xI({gen:e,parentData:t,parentDataProperty:r},n){e.if((0,K._)`${t} !== undefined`,()=>e.assign((0,K._)`${t}[${r}]`,n))}function jf(e,t,r,n=Rn.Correct){let i=n===Rn.Correct?K.operators.EQ:K.operators.NEQ,o;switch(e){case"null":return(0,K._)`${t} ${i} null`;case"array":o=(0,K._)`Array.isArray(${t})`;break;case"object":o=(0,K._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":o=a((0,K._)`!(${t} % 1) && !isNaN(${t})`);break;case"number":o=a();break;default:return(0,K._)`typeof ${t} ${i} ${e}`}return n===Rn.Correct?o:(0,K.not)(o);function a(s=K.nil){return(0,K.and)((0,K._)`typeof ${t} == "number"`,s,r?(0,K._)`isFinite(${t})`:K.nil)}}Ke.checkDataType=jf;function Of(e,t,r,n){if(e.length===1)return jf(e[0],t,r,n);let i,o=(0,Qv.toHash)(e);if(o.array&&o.object){let a=(0,K._)`typeof ${t} != "object"`;i=o.null?a:(0,K._)`!${t} || ${a}`,delete o.null,delete o.array,delete o.object}else i=K.nil;o.number&&delete o.integer;for(let a in o)i=(0,K.and)(i,jf(a,t,r,n));return i}Ke.checkDataTypes=Of;var kI={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?(0,K._)`{type: ${e}}`:(0,K._)`{type: ${t}}`};function Nf(e){let t=wI(e);(0,vI.reportError)(t,kI)}Ke.reportTypeError=Nf;function wI(e){let{gen:t,data:r,schema:n}=e,i=(0,Qv.schemaRefOrVal)(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:e}}});var ny=_(Ss=>{"use strict";Object.defineProperty(Ss,"__esModule",{value:!0});Ss.assignDefaults=void 0;var An=B(),SI=ne();function zI(e,t){let{properties:r,items:n}=e.schema;if(t==="object"&&r)for(let i in r)ry(e,i,r[i].default);else t==="array"&&Array.isArray(n)&&n.forEach((i,o)=>ry(e,o,i.default))}Ss.assignDefaults=zI;function ry(e,t,r){let{gen:n,compositeRule:i,data:o,opts:a}=e;if(r===void 0)return;let s=(0,An._)`${o}${(0,An.getProperty)(t)}`;if(i){(0,SI.checkStrictMode)(e,`default is ignored for: ${s}`);return}let c=(0,An._)`${s} === undefined`;a.useDefaults==="empty"&&(c=(0,An._)`${c} || ${s} === null || ${s} === ""`),n.if(c,(0,An._)`${s} = ${(0,An.stringify)(r)}`)}});var St=_(ue=>{"use strict";Object.defineProperty(ue,"__esModule",{value:!0});ue.validateUnion=ue.validateArray=ue.usePattern=ue.callValidateCode=ue.schemaProperties=ue.allSchemaProperties=ue.noPropertyInData=ue.propertyInData=ue.isOwnProperty=ue.hasPropFunc=ue.reportMissingProp=ue.checkMissingProp=ue.checkReportMissingProp=void 0;var ye=B(),Df=ne(),wr=ar(),II=ne();function PI(e,t){let{gen:r,data:n,it:i}=e;r.if(Rf(r,n,t,i.opts.ownProperties),()=>{e.setParams({missingProperty:(0,ye._)`${t}`},!0),e.error()})}ue.checkReportMissingProp=PI;function TI({gen:e,data:t,it:{opts:r}},n,i){return(0,ye.or)(...n.map(o=>(0,ye.and)(Rf(e,t,o,r.ownProperties),(0,ye._)`${i} = ${o}`)))}ue.checkMissingProp=TI;function EI(e,t){e.setParams({missingProperty:t},!0),e.error()}ue.reportMissingProp=EI;function iy(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,ye._)`Object.prototype.hasOwnProperty`})}ue.hasPropFunc=iy;function Zf(e,t,r){return(0,ye._)`${iy(e)}.call(${t}, ${r})`}ue.isOwnProperty=Zf;function jI(e,t,r,n){let i=(0,ye._)`${t}${(0,ye.getProperty)(r)} !== undefined`;return n?(0,ye._)`${i} && ${Zf(e,t,r)}`:i}ue.propertyInData=jI;function Rf(e,t,r,n){let i=(0,ye._)`${t}${(0,ye.getProperty)(r)} === undefined`;return n?(0,ye.or)(i,(0,ye.not)(Zf(e,t,r))):i}ue.noPropertyInData=Rf;function oy(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}ue.allSchemaProperties=oy;function OI(e,t){return oy(t).filter(r=>!(0,Df.alwaysValidSchema)(e,t[r]))}ue.schemaProperties=OI;function NI({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:i,errorPath:o},it:a},s,c,u){let l=u?(0,ye._)`${e}, ${t}, ${n}${i}`:t,d=[[wr.default.instancePath,(0,ye.strConcat)(wr.default.instancePath,o)],[wr.default.parentData,a.parentData],[wr.default.parentDataProperty,a.parentDataProperty],[wr.default.rootData,wr.default.rootData]];a.opts.dynamicRef&&d.push([wr.default.dynamicAnchors,wr.default.dynamicAnchors]);let p=(0,ye._)`${l}, ${r.object(...d)}`;return c!==ye.nil?(0,ye._)`${s}.call(${c}, ${p})`:(0,ye._)`${s}(${p})`}ue.callValidateCode=NI;var DI=(0,ye._)`new RegExp`;function ZI({gen:e,it:{opts:t}},r){let n=t.unicodeRegExp?"u":"",{regExp:i}=t.code,o=i(r,n);return e.scopeValue("pattern",{key:o.toString(),ref:o,code:(0,ye._)`${i.code==="new RegExp"?DI:(0,II.useFunc)(e,i)}(${r}, ${n})`})}ue.usePattern=ZI;function RI(e){let{gen:t,data:r,keyword:n,it:i}=e,o=t.name("valid");if(i.allErrors){let s=t.let("valid",!0);return a(()=>t.assign(s,!1)),s}return t.var(o,!0),a(()=>t.break()),o;function a(s){let c=t.const("len",(0,ye._)`${r}.length`);t.forRange("i",0,c,u=>{e.subschema({keyword:n,dataProp:u,dataPropType:Df.Type.Num},o),t.if((0,ye.not)(o),s)})}}ue.validateArray=RI;function AI(e){let{gen:t,schema:r,keyword:n,it:i}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(c=>(0,Df.alwaysValidSchema)(i,c))&&!i.opts.unevaluated)return;let a=t.let("valid",!1),s=t.name("_valid");t.block(()=>r.forEach((c,u)=>{let l=e.subschema({keyword:n,schemaProp:u,compositeRule:!0},s);t.assign(a,(0,ye._)`${a} || ${s}`),e.mergeValidEvaluated(l,s)||t.if((0,ye.not)(a))})),e.result(a,()=>e.reset(),()=>e.error(!0))}ue.validateUnion=AI});var cy=_(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.validateKeywordUsage=qt.validSchemaType=qt.funcKeywordCode=qt.macroKeywordCode=void 0;var et=B(),Hr=ar(),UI=St(),CI=$o();function MI(e,t){let{gen:r,keyword:n,schema:i,parentSchema:o,it:a}=e,s=t.macro.call(a.self,i,o,a),c=sy(r,n,s);a.opts.validateSchema!==!1&&a.self.validateSchema(s,!0);let u=r.name("valid");e.subschema({schema:s,schemaPath:et.nil,errSchemaPath:`${a.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},u),e.pass(u,()=>e.error(!0))}qt.macroKeywordCode=MI;function qI(e,t){var r;let{gen:n,keyword:i,schema:o,parentSchema:a,$data:s,it:c}=e;FI(c,t);let u=!s&&t.compile?t.compile.call(c.self,o,a,c):t.validate,l=sy(n,i,u),d=n.let("valid");e.block$data(d,p),e.ok((r=t.valid)!==null&&r!==void 0?r:d);function p(){if(t.errors===!1)g(),t.modifying&&ay(e),y(()=>e.error());else{let $=t.async?f():h();t.modifying&&ay(e),y(()=>LI(e,$))}}function f(){let $=n.let("ruleErrs",null);return n.try(()=>g((0,et._)`await `),P=>n.assign(d,!1).if((0,et._)`${P} instanceof ${c.ValidationError}`,()=>n.assign($,(0,et._)`${P}.errors`),()=>n.throw(P))),$}function h(){let $=(0,et._)`${l}.errors`;return n.assign($,null),g(et.nil),$}function g($=t.async?(0,et._)`await `:et.nil){let P=c.opts.passContext?Hr.default.this:Hr.default.self,k=!("compile"in t&&!s||t.schema===!1);n.assign(d,(0,et._)`${$}${(0,UI.callValidateCode)(e,l,P,k)}`,t.modifying)}function y($){var P;n.if((0,et.not)((P=t.valid)!==null&&P!==void 0?P:d),$)}}qt.funcKeywordCode=qI;function ay(e){let{gen:t,data:r,it:n}=e;t.if(n.parentData,()=>t.assign(r,(0,et._)`${n.parentData}[${n.parentDataProperty}]`))}function LI(e,t){let{gen:r}=e;r.if((0,et._)`Array.isArray(${t})`,()=>{r.assign(Hr.default.vErrors,(0,et._)`${Hr.default.vErrors} === null ? ${t} : ${Hr.default.vErrors}.concat(${t})`).assign(Hr.default.errors,(0,et._)`${Hr.default.vErrors}.length`),(0,CI.extendErrors)(e)},()=>e.error())}function FI({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}function sy(e,t,r){if(r===void 0)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,et.stringify)(r)})}function VI(e,t,r=!1){return!t.length||t.some(n=>n==="array"?Array.isArray(e):n==="object"?e&&typeof e=="object"&&!Array.isArray(e):typeof e==n||r&&typeof e>"u")}qt.validSchemaType=VI;function JI({schema:e,opts:t,self:r,errSchemaPath:n},i,o){if(Array.isArray(i.keyword)?!i.keyword.includes(o):i.keyword!==o)throw new Error("ajv implementation error");let a=i.dependencies;if(a?.some(s=>!Object.prototype.hasOwnProperty.call(e,s)))throw new Error(`parent schema must have dependencies of ${o}: ${a.join(",")}`);if(i.validateSchema&&!i.validateSchema(e[o])){let c=`keyword "${o}" value is invalid at path "${n}": `+r.errorsText(i.validateSchema.errors);if(t.validateSchema==="log")r.logger.error(c);else throw new Error(c)}}qt.validateKeywordUsage=JI});var ly=_(Sr=>{"use strict";Object.defineProperty(Sr,"__esModule",{value:!0});Sr.extendSubschemaMode=Sr.extendSubschemaData=Sr.getSubschema=void 0;var Lt=B(),uy=ne();function KI(e,{keyword:t,schemaProp:r,schema:n,schemaPath:i,errSchemaPath:o,topSchemaRef:a}){if(t!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){let s=e.schema[t];return r===void 0?{schema:s,schemaPath:(0,Lt._)`${e.schemaPath}${(0,Lt.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:s[r],schemaPath:(0,Lt._)`${e.schemaPath}${(0,Lt.getProperty)(t)}${(0,Lt.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,uy.escapeFragment)(r)}`}}if(n!==void 0){if(i===void 0||o===void 0||a===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:i,topSchemaRef:a,errSchemaPath:o}}throw new Error('either "keyword" or "schema" must be passed')}Sr.getSubschema=KI;function BI(e,t,{dataProp:r,dataPropType:n,data:i,dataTypes:o,propertyName:a}){if(i!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:s}=t;if(r!==void 0){let{errorPath:u,dataPathArr:l,opts:d}=t,p=s.let("data",(0,Lt._)`${t.data}${(0,Lt.getProperty)(r)}`,!0);c(p),e.errorPath=(0,Lt.str)`${u}${(0,uy.getErrorPath)(r,n,d.jsPropertySyntax)}`,e.parentDataProperty=(0,Lt._)`${r}`,e.dataPathArr=[...l,e.parentDataProperty]}if(i!==void 0){let u=i instanceof Lt.Name?i:s.let("data",i,!0);c(u),a!==void 0&&(e.propertyName=a)}o&&(e.dataTypes=o);function c(u){e.data=u,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,u]}}Sr.extendSubschemaData=BI;function WI(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:i,allErrors:o}){n!==void 0&&(e.compositeRule=n),i!==void 0&&(e.createErrors=i),o!==void 0&&(e.allErrors=o),e.jtdDiscriminator=t,e.jtdMetadata=r}Sr.extendSubschemaMode=WI});var Af=_((tq,dy)=>{"use strict";dy.exports=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,i,o;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(i=n;i--!==0;)if(!e(t[i],r[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(o=Object.keys(t),n=o.length,n!==Object.keys(r).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(r,o[i]))return!1;for(i=n;i--!==0;){var a=o[i];if(!e(t[a],r[a]))return!1}return!0}return t!==t&&r!==r}});var py=_((rq,fy)=>{"use strict";var zr=fy.exports=function(e,t,r){typeof t=="function"&&(r=t,t={}),r=t.cb||r;var n=typeof r=="function"?r:r.pre||function(){},i=r.post||function(){};zs(t,n,i,e,"",e)};zr.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};zr.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};zr.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};zr.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 zs(e,t,r,n,i,o,a,s,c,u){if(n&&typeof n=="object"&&!Array.isArray(n)){t(n,i,o,a,s,c,u);for(var l in n){var d=n[l];if(Array.isArray(d)){if(l in zr.arrayKeywords)for(var p=0;p<d.length;p++)zs(e,t,r,d[p],i+"/"+l+"/"+p,o,i,l,n,p)}else if(l in zr.propsKeywords){if(d&&typeof d=="object")for(var f in d)zs(e,t,r,d[f],i+"/"+l+"/"+GI(f),o,i,l,n,f)}else(l in zr.keywords||e.allKeys&&!(l in zr.skipKeywords))&&zs(e,t,r,d,i+"/"+l,o,i,l,n)}r(n,i,o,a,s,c,u)}}function GI(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}});var xo=_(ut=>{"use strict";Object.defineProperty(ut,"__esModule",{value:!0});ut.getSchemaRefs=ut.resolveUrl=ut.normalizeId=ut._getFullPath=ut.getFullPath=ut.inlineRef=void 0;var HI=ne(),XI=Af(),YI=py(),QI=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function eP(e,t=!0){return typeof e=="boolean"?!0:t===!0?!Uf(e):t?my(e)<=t:!1}ut.inlineRef=eP;var tP=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Uf(e){for(let t in e){if(tP.has(t))return!0;let r=e[t];if(Array.isArray(r)&&r.some(Uf)||typeof r=="object"&&Uf(r))return!0}return!1}function my(e){let t=0;for(let r in e){if(r==="$ref")return 1/0;if(t++,!QI.has(r)&&(typeof e[r]=="object"&&(0,HI.eachItem)(e[r],n=>t+=my(n)),t===1/0))return 1/0}return t}function hy(e,t="",r){r!==!1&&(t=Un(t));let n=e.parse(t);return gy(e,n)}ut.getFullPath=hy;function gy(e,t){return e.serialize(t).split("#")[0]+"#"}ut._getFullPath=gy;var rP=/#\/?$/;function Un(e){return e?e.replace(rP,""):""}ut.normalizeId=Un;function nP(e,t,r){return r=Un(r),e.resolve(t,r)}ut.resolveUrl=nP;var iP=/^[a-z_][-a-z0-9._]*$/i;function oP(e,t){if(typeof e=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,i=Un(e[r]||t),o={"":i},a=hy(n,i,!1),s={},c=new Set;return YI(e,{allKeys:!0},(d,p,f,h)=>{if(h===void 0)return;let g=a+p,y=o[h];typeof d[r]=="string"&&(y=$.call(this,d[r])),P.call(this,d.$anchor),P.call(this,d.$dynamicAnchor),o[p]=y;function $(k){let N=this.opts.uriResolver.resolve;if(k=Un(y?N(y,k):k),c.has(k))throw l(k);c.add(k);let j=this.refs[k];return typeof j=="string"&&(j=this.refs[j]),typeof j=="object"?u(d,j.schema,k):k!==Un(g)&&(k[0]==="#"?(u(d,s[k],k),s[k]=d):this.refs[k]=g),k}function P(k){if(typeof k=="string"){if(!iP.test(k))throw new Error(`invalid anchor "${k}"`);$.call(this,`#${k}`)}}}),s;function u(d,p,f){if(p!==void 0&&!XI(d,p))throw l(f)}function l(d){return new Error(`reference "${d}" resolves to more than one schema`)}}ut.getSchemaRefs=oP});var So=_(Ir=>{"use strict";Object.defineProperty(Ir,"__esModule",{value:!0});Ir.getData=Ir.KeywordCxt=Ir.validateFunctionCode=void 0;var by=Hv(),vy=bo(),Mf=Ef(),Is=bo(),aP=ny(),wo=cy(),Cf=ly(),O=B(),M=ar(),sP=xo(),sr=ne(),ko=$o();function cP(e){if(wy(e)&&(Sy(e),ky(e))){dP(e);return}xy(e,()=>(0,by.topBoolOrEmptySchema)(e))}Ir.validateFunctionCode=cP;function xy({gen:e,validateName:t,schema:r,schemaEnv:n,opts:i},o){i.code.es5?e.func(t,(0,O._)`${M.default.data}, ${M.default.valCxt}`,n.$async,()=>{e.code((0,O._)`"use strict"; ${yy(r,i)}`),lP(e,i),e.code(o)}):e.func(t,(0,O._)`${M.default.data}, ${uP(i)}`,n.$async,()=>e.code(yy(r,i)).code(o))}function uP(e){return(0,O._)`{${M.default.instancePath}="", ${M.default.parentData}, ${M.default.parentDataProperty}, ${M.default.rootData}=${M.default.data}${e.dynamicRef?(0,O._)`, ${M.default.dynamicAnchors}={}`:O.nil}}={}`}function lP(e,t){e.if(M.default.valCxt,()=>{e.var(M.default.instancePath,(0,O._)`${M.default.valCxt}.${M.default.instancePath}`),e.var(M.default.parentData,(0,O._)`${M.default.valCxt}.${M.default.parentData}`),e.var(M.default.parentDataProperty,(0,O._)`${M.default.valCxt}.${M.default.parentDataProperty}`),e.var(M.default.rootData,(0,O._)`${M.default.valCxt}.${M.default.rootData}`),t.dynamicRef&&e.var(M.default.dynamicAnchors,(0,O._)`${M.default.valCxt}.${M.default.dynamicAnchors}`)},()=>{e.var(M.default.instancePath,(0,O._)`""`),e.var(M.default.parentData,(0,O._)`undefined`),e.var(M.default.parentDataProperty,(0,O._)`undefined`),e.var(M.default.rootData,M.default.data),t.dynamicRef&&e.var(M.default.dynamicAnchors,(0,O._)`{}`)})}function dP(e){let{schema:t,opts:r,gen:n}=e;xy(e,()=>{r.$comment&&t.$comment&&Iy(e),gP(e),n.let(M.default.vErrors,null),n.let(M.default.errors,0),r.unevaluated&&fP(e),zy(e),_P(e)})}function fP(e){let{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",(0,O._)`${r}.evaluated`),t.if((0,O._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,O._)`${e.evaluated}.props`,(0,O._)`undefined`)),t.if((0,O._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,O._)`${e.evaluated}.items`,(0,O._)`undefined`))}function yy(e,t){let r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?(0,O._)`/*# sourceURL=${r} */`:O.nil}function pP(e,t){if(wy(e)&&(Sy(e),ky(e))){mP(e,t);return}(0,by.boolOrEmptySchema)(e,t)}function ky({schema:e,self:t}){if(typeof e=="boolean")return!e;for(let r in e)if(t.RULES.all[r])return!0;return!1}function wy(e){return typeof e.schema!="boolean"}function mP(e,t){let{schema:r,gen:n,opts:i}=e;i.$comment&&r.$comment&&Iy(e),vP(e),yP(e);let o=n.const("_errs",M.default.errors);zy(e,o),n.var(t,(0,O._)`${o} === ${M.default.errors}`)}function Sy(e){(0,sr.checkUnknownRules)(e),hP(e)}function zy(e,t){if(e.opts.jtd)return _y(e,[],!1,t);let r=(0,vy.getSchemaTypes)(e.schema),n=(0,vy.coerceAndCheckDataType)(e,r);_y(e,r,!n,t)}function hP(e){let{schema:t,errSchemaPath:r,opts:n,self:i}=e;t.$ref&&n.ignoreKeywordsWithRef&&(0,sr.schemaHasRulesButRef)(t,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function gP(e){let{schema:t,opts:r}=e;t.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,sr.checkStrictMode)(e,"default is ignored in the schema root")}function vP(e){let t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,sP.resolveUrl)(e.opts.uriResolver,e.baseId,t))}function yP(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}function Iy({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:i}){let o=r.$comment;if(i.$comment===!0)e.code((0,O._)`${M.default.self}.logger.log(${o})`);else if(typeof i.$comment=="function"){let a=(0,O.str)`${n}/$comment`,s=e.scopeValue("root",{ref:t.root});e.code((0,O._)`${M.default.self}.opts.$comment(${o}, ${a}, ${s}.schema)`)}}function _P(e){let{gen:t,schemaEnv:r,validateName:n,ValidationError:i,opts:o}=e;r.$async?t.if((0,O._)`${M.default.errors} === 0`,()=>t.return(M.default.data),()=>t.throw((0,O._)`new ${i}(${M.default.vErrors})`)):(t.assign((0,O._)`${n}.errors`,M.default.vErrors),o.unevaluated&&$P(e),t.return((0,O._)`${M.default.errors} === 0`))}function $P({gen:e,evaluated:t,props:r,items:n}){r instanceof O.Name&&e.assign((0,O._)`${t}.props`,r),n instanceof O.Name&&e.assign((0,O._)`${t}.items`,n)}function _y(e,t,r,n){let{gen:i,schema:o,data:a,allErrors:s,opts:c,self:u}=e,{RULES:l}=u;if(o.$ref&&(c.ignoreKeywordsWithRef||!(0,sr.schemaHasRulesButRef)(o,l))){i.block(()=>Ty(e,"$ref",l.all.$ref.definition));return}c.jtd||bP(e,t),i.block(()=>{for(let p of l.rules)d(p);d(l.post)});function d(p){(0,Mf.shouldUseGroup)(o,p)&&(p.type?(i.if((0,Is.checkDataType)(p.type,a,c.strictNumbers)),$y(e,p),t.length===1&&t[0]===p.type&&r&&(i.else(),(0,Is.reportTypeError)(e)),i.endIf()):$y(e,p),s||i.if((0,O._)`${M.default.errors} === ${n||0}`))}}function $y(e,t){let{gen:r,schema:n,opts:{useDefaults:i}}=e;i&&(0,aP.assignDefaults)(e,t.type),r.block(()=>{for(let o of t.rules)(0,Mf.shouldUseRule)(n,o)&&Ty(e,o.keyword,o.definition,t.type)})}function bP(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(xP(e,t),e.opts.allowUnionTypes||kP(e,t),wP(e,e.dataTypes))}function xP(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(r=>{Py(e.dataTypes,r)||qf(e,`type "${r}" not allowed by context "${e.dataTypes.join(",")}"`)}),zP(e,t)}}function kP(e,t){t.length>1&&!(t.length===2&&t.includes("null"))&&qf(e,"use allowUnionTypes to allow union type keyword")}function wP(e,t){let r=e.self.RULES.all;for(let n in r){let i=r[n];if(typeof i=="object"&&(0,Mf.shouldUseRule)(e.schema,i)){let{type:o}=i.definition;o.length&&!o.some(a=>SP(t,a))&&qf(e,`missing type "${o.join(",")}" for keyword "${n}"`)}}}function SP(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function Py(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function zP(e,t){let r=[];for(let n of e.dataTypes)Py(t,n)?r.push(n):t.includes("integer")&&n==="number"&&r.push("integer");e.dataTypes=r}function qf(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,(0,sr.checkStrictMode)(e,t,e.opts.strictTypes)}var Ps=class{constructor(t,r,n){if((0,wo.validateKeywordUsage)(t,r,n),this.gen=t.gen,this.allErrors=t.allErrors,this.keyword=n,this.data=t.data,this.schema=t.schema[n],this.$data=r.$data&&t.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,sr.schemaRefOrVal)(t,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=t.schema,this.params={},this.it=t,this.def=r,this.$data)this.schemaCode=t.gen.const("vSchema",Ey(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,wo.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=t.gen.const("_errs",M.default.errors))}result(t,r,n){this.failResult((0,O.not)(t),r,n)}failResult(t,r,n){this.gen.if(t),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(t,r){this.failResult((0,O.not)(t),void 0,r)}fail(t){if(t===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(t),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(t){if(!this.$data)return this.fail(t);let{schemaCode:r}=this;this.fail((0,O._)`${r} !== undefined && (${(0,O.or)(this.invalid$data(),t)})`)}error(t,r,n){if(r){this.setParams(r),this._error(t,n),this.setParams({});return}this._error(t,n)}_error(t,r){(t?ko.reportExtraError:ko.reportError)(this,this.def.error,r)}$dataError(){(0,ko.reportError)(this,this.def.$dataError||ko.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,ko.resetErrorsCount)(this.gen,this.errsCount)}ok(t){this.allErrors||this.gen.if(t)}setParams(t,r){r?Object.assign(this.params,t):this.params=t}block$data(t,r,n=O.nil){this.gen.block(()=>{this.check$data(t,n),r()})}check$data(t=O.nil,r=O.nil){if(!this.$data)return;let{gen:n,schemaCode:i,schemaType:o,def:a}=this;n.if((0,O.or)((0,O._)`${i} === undefined`,r)),t!==O.nil&&n.assign(t,!0),(o.length||a.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),t!==O.nil&&n.assign(t,!1)),n.else()}invalid$data(){let{gen:t,schemaCode:r,schemaType:n,def:i,it:o}=this;return(0,O.or)(a(),s());function a(){if(n.length){if(!(r instanceof O.Name))throw new Error("ajv implementation error");let c=Array.isArray(n)?n:[n];return(0,O._)`${(0,Is.checkDataTypes)(c,r,o.opts.strictNumbers,Is.DataType.Wrong)}`}return O.nil}function s(){if(i.validateSchema){let c=t.scopeValue("validate$data",{ref:i.validateSchema});return(0,O._)`!${c}(${r})`}return O.nil}}subschema(t,r){let n=(0,Cf.getSubschema)(this.it,t);(0,Cf.extendSubschemaData)(n,this.it,t),(0,Cf.extendSubschemaMode)(n,t);let i={...this.it,...n,items:void 0,props:void 0};return pP(i,r),i}mergeEvaluated(t,r){let{it:n,gen:i}=this;n.opts.unevaluated&&(n.props!==!0&&t.props!==void 0&&(n.props=sr.mergeEvaluated.props(i,t.props,n.props,r)),n.items!==!0&&t.items!==void 0&&(n.items=sr.mergeEvaluated.items(i,t.items,n.items,r)))}mergeValidEvaluated(t,r){let{it:n,gen:i}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return i.if(r,()=>this.mergeEvaluated(t,O.Name)),!0}};Ir.KeywordCxt=Ps;function Ty(e,t,r,n){let i=new Ps(e,r,t);"code"in r?r.code(i,n):i.$data&&r.validate?(0,wo.funcKeywordCode)(i,r):"macro"in r?(0,wo.macroKeywordCode)(i,r):(r.compile||r.validate)&&(0,wo.funcKeywordCode)(i,r)}var IP=/^\/(?:[^~]|~0|~1)*$/,PP=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Ey(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let i,o;if(e==="")return M.default.rootData;if(e[0]==="/"){if(!IP.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);i=e,o=M.default.rootData}else{let u=PP.exec(e);if(!u)throw new Error(`Invalid JSON-pointer: ${e}`);let l=+u[1];if(i=u[2],i==="#"){if(l>=t)throw new Error(c("property/index",l));return n[t-l]}if(l>t)throw new Error(c("data",l));if(o=r[t-l],!i)return o}let a=o,s=i.split("/");for(let u of s)u&&(o=(0,O._)`${o}${(0,O.getProperty)((0,sr.unescapeJsonPointer)(u))}`,a=(0,O._)`${a} && ${o}`);return a;function c(u,l){return`Cannot access ${u} ${l} levels up, current level is ${t}`}}Ir.getData=Ey});var Ts=_(Ff=>{"use strict";Object.defineProperty(Ff,"__esModule",{value:!0});var Lf=class extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}};Ff.default=Lf});var zo=_(Kf=>{"use strict";Object.defineProperty(Kf,"__esModule",{value:!0});var Vf=xo(),Jf=class extends Error{constructor(t,r,n,i){super(i||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,Vf.resolveUrl)(t,r,n),this.missingSchema=(0,Vf.normalizeId)((0,Vf.getFullPath)(t,this.missingRef))}};Kf.default=Jf});var js=_(zt=>{"use strict";Object.defineProperty(zt,"__esModule",{value:!0});zt.resolveSchema=zt.getCompilingSchema=zt.resolveRef=zt.compileSchema=zt.SchemaEnv=void 0;var Nt=B(),TP=Ts(),Xr=ar(),Dt=xo(),jy=ne(),EP=So(),Cn=class{constructor(t){var r;this.refs={},this.dynamicAnchors={};let n;typeof t.schema=="object"&&(n=t.schema),this.schema=t.schema,this.schemaId=t.schemaId,this.root=t.root||this,this.baseId=(r=t.baseId)!==null&&r!==void 0?r:(0,Dt.normalizeId)(n?.[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=n?.$async,this.refs={}}};zt.SchemaEnv=Cn;function Wf(e){let t=Oy.call(this,e);if(t)return t;let r=(0,Dt.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:n,lines:i}=this.opts.code,{ownProperties:o}=this.opts,a=new Nt.CodeGen(this.scope,{es5:n,lines:i,ownProperties:o}),s;e.$async&&(s=a.scopeValue("Error",{ref:TP.default,code:(0,Nt._)`require("ajv/dist/runtime/validation_error").default`}));let c=a.scopeName("validate");e.validateName=c;let u={gen:a,allErrors:this.opts.allErrors,data:Xr.default.data,parentData:Xr.default.parentData,parentDataProperty:Xr.default.parentDataProperty,dataNames:[Xr.default.data],dataPathArr:[Nt.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:a.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,Nt.stringify)(e.schema)}:{ref:e.schema}),validateName:c,ValidationError:s,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:Nt.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Nt._)`""`,opts:this.opts,self:this},l;try{this._compilations.add(e),(0,EP.validateFunctionCode)(u),a.optimize(this.opts.code.optimize);let d=a.toString();l=`${a.scopeRefs(Xr.default.scope)}return ${d}`,this.opts.code.process&&(l=this.opts.code.process(l,e));let f=new Function(`${Xr.default.self}`,`${Xr.default.scope}`,l)(this,this.scope.get());if(this.scope.value(c,{ref:f}),f.errors=null,f.schema=e.schema,f.schemaEnv=e,e.$async&&(f.$async=!0),this.opts.code.source===!0&&(f.source={validateName:c,validateCode:d,scopeValues:a._values}),this.opts.unevaluated){let{props:h,items:g}=u;f.evaluated={props:h instanceof Nt.Name?void 0:h,items:g instanceof Nt.Name?void 0:g,dynamicProps:h instanceof Nt.Name,dynamicItems:g instanceof Nt.Name},f.source&&(f.source.evaluated=(0,Nt.stringify)(f.evaluated))}return e.validate=f,e}catch(d){throw delete e.validate,delete e.validateName,l&&this.logger.error("Error compiling schema, function code:",l),d}finally{this._compilations.delete(e)}}zt.compileSchema=Wf;function jP(e,t,r){var n;r=(0,Dt.resolveUrl)(this.opts.uriResolver,t,r);let i=e.refs[r];if(i)return i;let o=DP.call(this,e,r);if(o===void 0){let a=(n=e.localRefs)===null||n===void 0?void 0:n[r],{schemaId:s}=this.opts;a&&(o=new Cn({schema:a,schemaId:s,root:e,baseId:t}))}if(o!==void 0)return e.refs[r]=OP.call(this,o)}zt.resolveRef=jP;function OP(e){return(0,Dt.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:Wf.call(this,e)}function Oy(e){for(let t of this._compilations)if(NP(t,e))return t}zt.getCompilingSchema=Oy;function NP(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function DP(e,t){let r;for(;typeof(r=this.refs[t])=="string";)t=r;return r||this.schemas[t]||Es.call(this,e,t)}function Es(e,t){let r=this.opts.uriResolver.parse(t),n=(0,Dt._getFullPath)(this.opts.uriResolver,r),i=(0,Dt.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===i)return Bf.call(this,r,e);let o=(0,Dt.normalizeId)(n),a=this.refs[o]||this.schemas[o];if(typeof a=="string"){let s=Es.call(this,e,a);return typeof s?.schema!="object"?void 0:Bf.call(this,r,s)}if(typeof a?.schema=="object"){if(a.validate||Wf.call(this,a),o===(0,Dt.normalizeId)(t)){let{schema:s}=a,{schemaId:c}=this.opts,u=s[c];return u&&(i=(0,Dt.resolveUrl)(this.opts.uriResolver,i,u)),new Cn({schema:s,schemaId:c,root:e,baseId:i})}return Bf.call(this,r,a)}}zt.resolveSchema=Es;var ZP=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Bf(e,{baseId:t,schema:r,root:n}){var i;if(((i=e.fragment)===null||i===void 0?void 0:i[0])!=="/")return;for(let s of e.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let c=r[(0,jy.unescapeFragment)(s)];if(c===void 0)return;r=c;let u=typeof r=="object"&&r[this.opts.schemaId];!ZP.has(s)&&u&&(t=(0,Dt.resolveUrl)(this.opts.uriResolver,t,u))}let o;if(typeof r!="boolean"&&r.$ref&&!(0,jy.schemaHasRulesButRef)(r,this.RULES)){let s=(0,Dt.resolveUrl)(this.opts.uriResolver,t,r.$ref);o=Es.call(this,n,s)}let{schemaId:a}=this.opts;if(o=o||new Cn({schema:r,schemaId:a,root:n,baseId:t}),o.schema!==o.root.schema)return o}});var Ny=_((cq,RP)=>{RP.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 Hf=_((uq,Ay)=>{"use strict";var AP=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),Zy=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 Gf(e){let t="",r=0,n=0;for(n=0;n<e.length;n++)if(r=e[n].charCodeAt(0),r!==48){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[n];break}for(n+=1;n<e.length;n++){if(r=e[n].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[n]}return t}var UP=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function Dy(e){return e.length=0,!0}function CP(e,t,r){if(e.length){let n=Gf(e);if(n!=="")t.push(n);else return r.error=!0,!1;e.length=0}return!0}function MP(e){let t=0,r={error:!1,address:"",zone:""},n=[],i=[],o=!1,a=!1,s=CP;for(let c=0;c<e.length;c++){let u=e[c];if(!(u==="["||u==="]"))if(u===":"){if(o===!0&&(a=!0),!s(i,n,r))break;if(++t>7){r.error=!0;break}c>0&&e[c-1]===":"&&(o=!0),n.push(":");continue}else if(u==="%"){if(!s(i,n,r))break;s=Dy}else{i.push(u);continue}}return i.length&&(s===Dy?r.zone=i.join(""):a?n.push(i.join("")):n.push(Gf(i))),r.address=n.join(""),r}function Ry(e){if(qP(e,":")<2)return{host:e,isIPV6:!1};let t=MP(e);if(t.error)return{host:e,isIPV6:!1};{let r=t.address,n=t.address;return t.zone&&(r+="%"+t.zone,n+="%25"+t.zone),{host:r,isIPV6:!0,escapedHost:n}}}function qP(e,t){let r=0;for(let n=0;n<e.length;n++)e[n]===t&&r++;return r}function LP(e){let t=e,r=[],n=-1,i=0;for(;i=t.length;){if(i===1){if(t===".")break;if(t==="/"){r.push("/");break}else{r.push(t);break}}else if(i===2){if(t[0]==="."){if(t[1]===".")break;if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"&&(t[1]==="."||t[1]==="/")){r.push("/");break}}else if(i===3&&t==="/.."){r.length!==0&&r.pop(),r.push("/");break}if(t[0]==="."){if(t[1]==="."){if(t[2]==="/"){t=t.slice(3);continue}}else if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"&&t[1]==="."){if(t[2]==="/"){t=t.slice(2);continue}else if(t[2]==="."&&t[3]==="/"){t=t.slice(3),r.length!==0&&r.pop();continue}}if((n=t.indexOf("/",1))===-1){r.push(t);break}else r.push(t.slice(0,n)),t=t.slice(n)}return r.join("")}function FP(e,t){let r=t!==!0?escape:unescape;return e.scheme!==void 0&&(e.scheme=r(e.scheme)),e.userinfo!==void 0&&(e.userinfo=r(e.userinfo)),e.host!==void 0&&(e.host=r(e.host)),e.path!==void 0&&(e.path=r(e.path)),e.query!==void 0&&(e.query=r(e.query)),e.fragment!==void 0&&(e.fragment=r(e.fragment)),e}function VP(e){let t=[];if(e.userinfo!==void 0&&(t.push(e.userinfo),t.push("@")),e.host!==void 0){let r=unescape(e.host);if(!Zy(r)){let n=Ry(r);n.isIPV6===!0?r=`[${n.escapedHost}]`:r=e.host}t.push(r)}return(typeof e.port=="number"||typeof e.port=="string")&&(t.push(":"),t.push(String(e.port))),t.length?t.join(""):void 0}Ay.exports={nonSimpleDomain:UP,recomposeAuthority:VP,normalizeComponentEncoding:FP,removeDotSegments:LP,isIPv4:Zy,isUUID:AP,normalizeIPv6:Ry,stringArrayToHexStripped:Gf}});var Ly=_((lq,qy)=>{"use strict";var{isUUID:JP}=Hf(),KP=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,BP=["http","https","ws","wss","urn","urn:uuid"];function WP(e){return BP.indexOf(e)!==-1}function Xf(e){return e.secure===!0?!0:e.secure===!1?!1:e.scheme?e.scheme.length===3&&(e.scheme[0]==="w"||e.scheme[0]==="W")&&(e.scheme[1]==="s"||e.scheme[1]==="S")&&(e.scheme[2]==="s"||e.scheme[2]==="S"):!1}function Uy(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function Cy(e){let t=String(e.scheme).toLowerCase()==="https";return(e.port===(t?443:80)||e.port==="")&&(e.port=void 0),e.path||(e.path="/"),e}function GP(e){return e.secure=Xf(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function HP(e){if((e.port===(Xf(e)?443:80)||e.port==="")&&(e.port=void 0),typeof e.secure=="boolean"&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){let[t,r]=e.resourceName.split("?");e.path=t&&t!=="/"?t:void 0,e.query=r,e.resourceName=void 0}return e.fragment=void 0,e}function XP(e,t){if(!e.path)return e.error="URN can not be parsed",e;let r=e.path.match(KP);if(r){let n=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase(),e.nss=r[2];let i=`${n}:${t.nid||e.nid}`,o=Yf(i);e.path=void 0,o&&(e=o.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e}function YP(e,t){if(e.nid===void 0)throw new Error("URN without nid cannot be serialized");let r=t.scheme||e.scheme||"urn",n=e.nid.toLowerCase(),i=`${r}:${t.nid||n}`,o=Yf(i);o&&(e=o.serialize(e,t));let a=e,s=e.nss;return a.path=`${n||t.nid}:${s}`,t.skipEscape=!0,a}function QP(e,t){let r=e;return r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!JP(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function eT(e){let t=e;return t.nss=(e.uuid||"").toLowerCase(),t}var My={scheme:"http",domainHost:!0,parse:Uy,serialize:Cy},tT={scheme:"https",domainHost:My.domainHost,parse:Uy,serialize:Cy},Os={scheme:"ws",domainHost:!0,parse:GP,serialize:HP},rT={scheme:"wss",domainHost:Os.domainHost,parse:Os.parse,serialize:Os.serialize},nT={scheme:"urn",parse:XP,serialize:YP,skipNormalize:!0},iT={scheme:"urn:uuid",parse:QP,serialize:eT,skipNormalize:!0},Ns={http:My,https:tT,ws:Os,wss:rT,urn:nT,"urn:uuid":iT};Object.setPrototypeOf(Ns,null);function Yf(e){return e&&(Ns[e]||Ns[e.toLowerCase()])||void 0}qy.exports={wsIsSecure:Xf,SCHEMES:Ns,isValidSchemeName:WP,getSchemeHandler:Yf}});var Jy=_((dq,Zs)=>{"use strict";var{normalizeIPv6:oT,removeDotSegments:Io,recomposeAuthority:aT,normalizeComponentEncoding:Ds,isIPv4:sT,nonSimpleDomain:cT}=Hf(),{SCHEMES:uT,getSchemeHandler:Fy}=Ly();function lT(e,t){return typeof e=="string"?e=Ft(cr(e,t),t):typeof e=="object"&&(e=cr(Ft(e,t),t)),e}function dT(e,t,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},i=Vy(cr(e,n),cr(t,n),n,!0);return n.skipEscape=!0,Ft(i,n)}function Vy(e,t,r,n){let i={};return n||(e=cr(Ft(e,r),r),t=cr(Ft(t,r),r)),r=r||{},!r.tolerant&&t.scheme?(i.scheme=t.scheme,i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=Io(t.path||""),i.query=t.query):(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0?(i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=Io(t.path||""),i.query=t.query):(t.path?(t.path[0]==="/"?i.path=Io(t.path):((e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path?i.path="/"+t.path:e.path?i.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:i.path=t.path,i.path=Io(i.path)),i.query=t.query):(i.path=e.path,t.query!==void 0?i.query=t.query:i.query=e.query),i.userinfo=e.userinfo,i.host=e.host,i.port=e.port),i.scheme=e.scheme),i.fragment=t.fragment,i}function fT(e,t,r){return typeof e=="string"?(e=unescape(e),e=Ft(Ds(cr(e,r),!0),{...r,skipEscape:!0})):typeof e=="object"&&(e=Ft(Ds(e,!0),{...r,skipEscape:!0})),typeof t=="string"?(t=unescape(t),t=Ft(Ds(cr(t,r),!0),{...r,skipEscape:!0})):typeof t=="object"&&(t=Ft(Ds(t,!0),{...r,skipEscape:!0})),e.toLowerCase()===t.toLowerCase()}function Ft(e,t){let r={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},n=Object.assign({},t),i=[],o=Fy(n.scheme||r.scheme);o&&o.serialize&&o.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&&i.push(r.scheme,":");let a=aT(r);if(a!==void 0&&(n.reference!=="suffix"&&i.push("//"),i.push(a),r.path&&r.path[0]!=="/"&&i.push("/")),r.path!==void 0){let s=r.path;!n.absolutePath&&(!o||!o.absolutePath)&&(s=Io(s)),a===void 0&&s[0]==="/"&&s[1]==="/"&&(s="/%2F"+s.slice(2)),i.push(s)}return r.query!==void 0&&i.push("?",r.query),r.fragment!==void 0&&i.push("#",r.fragment),i.join("")}var pT=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function cr(e,t){let r=Object.assign({},t),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},i=!1;r.reference==="suffix"&&(r.scheme?e=r.scheme+":"+e:e="//"+e);let o=e.match(pT);if(o){if(n.scheme=o[1],n.userinfo=o[3],n.host=o[4],n.port=parseInt(o[5],10),n.path=o[6]||"",n.query=o[7],n.fragment=o[8],isNaN(n.port)&&(n.port=o[5]),n.host)if(sT(n.host)===!1){let c=oT(n.host);n.host=c.host.toLowerCase(),i=c.isIPV6}else i=!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=Fy(r.scheme||n.scheme);if(!r.unicodeSupport&&(!a||!a.unicodeSupport)&&n.host&&(r.domainHost||a&&a.domainHost)&&i===!1&&cT(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)&&(e.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 Qf={SCHEMES:uT,normalize:lT,resolve:dT,resolveComponent:Vy,equal:fT,serialize:Ft,parse:cr};Zs.exports=Qf;Zs.exports.default=Qf;Zs.exports.fastUri=Qf});var By=_(ep=>{"use strict";Object.defineProperty(ep,"__esModule",{value:!0});var Ky=Jy();Ky.code='require("ajv/dist/runtime/uri").default';ep.default=Ky});var t_=_(Ue=>{"use strict";Object.defineProperty(Ue,"__esModule",{value:!0});Ue.CodeGen=Ue.Name=Ue.nil=Ue.stringify=Ue.str=Ue._=Ue.KeywordCxt=void 0;var mT=So();Object.defineProperty(Ue,"KeywordCxt",{enumerable:!0,get:function(){return mT.KeywordCxt}});var Mn=B();Object.defineProperty(Ue,"_",{enumerable:!0,get:function(){return Mn._}});Object.defineProperty(Ue,"str",{enumerable:!0,get:function(){return Mn.str}});Object.defineProperty(Ue,"stringify",{enumerable:!0,get:function(){return Mn.stringify}});Object.defineProperty(Ue,"nil",{enumerable:!0,get:function(){return Mn.nil}});Object.defineProperty(Ue,"Name",{enumerable:!0,get:function(){return Mn.Name}});Object.defineProperty(Ue,"CodeGen",{enumerable:!0,get:function(){return Mn.CodeGen}});var hT=Ts(),Yy=zo(),gT=Tf(),Po=js(),vT=B(),To=xo(),Rs=bo(),rp=ne(),Wy=Ny(),yT=By(),Qy=(e,t)=>new RegExp(e,t);Qy.code="new RegExp";var _T=["removeAdditional","useDefaults","coerceTypes"],$T=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),bT={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."},xT={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},Gy=200;function kT(e){var t,r,n,i,o,a,s,c,u,l,d,p,f,h,g,y,$,P,k,N,j,ot,ft,Zr,C;let ee=e.strict,te=(t=e.code)===null||t===void 0?void 0:t.optimize,Se=te===!0||te===void 0?1:te||0,ze=(n=(r=e.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:Qy,Ie=(i=e.uriResolver)!==null&&i!==void 0?i:yT.default;return{strictSchema:(a=(o=e.strictSchema)!==null&&o!==void 0?o:ee)!==null&&a!==void 0?a:!0,strictNumbers:(c=(s=e.strictNumbers)!==null&&s!==void 0?s:ee)!==null&&c!==void 0?c:!0,strictTypes:(l=(u=e.strictTypes)!==null&&u!==void 0?u:ee)!==null&&l!==void 0?l:"log",strictTuples:(p=(d=e.strictTuples)!==null&&d!==void 0?d:ee)!==null&&p!==void 0?p:"log",strictRequired:(h=(f=e.strictRequired)!==null&&f!==void 0?f:ee)!==null&&h!==void 0?h:!1,code:e.code?{...e.code,optimize:Se,regExp:ze}:{optimize:Se,regExp:ze},loopRequired:(g=e.loopRequired)!==null&&g!==void 0?g:Gy,loopEnum:(y=e.loopEnum)!==null&&y!==void 0?y:Gy,meta:($=e.meta)!==null&&$!==void 0?$:!0,messages:(P=e.messages)!==null&&P!==void 0?P:!0,inlineRefs:(k=e.inlineRefs)!==null&&k!==void 0?k:!0,schemaId:(N=e.schemaId)!==null&&N!==void 0?N:"$id",addUsedSchema:(j=e.addUsedSchema)!==null&&j!==void 0?j:!0,validateSchema:(ot=e.validateSchema)!==null&&ot!==void 0?ot:!0,validateFormats:(ft=e.validateFormats)!==null&&ft!==void 0?ft:!0,unicodeRegExp:(Zr=e.unicodeRegExp)!==null&&Zr!==void 0?Zr:!0,int32range:(C=e.int32range)!==null&&C!==void 0?C:!0,uriResolver:Ie}}var Eo=class{constructor(t={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,t=this.opts={...t,...kT(t)};let{es5:r,lines:n}=this.opts.code;this.scope=new vT.ValueScope({scope:{},prefixes:$T,es5:r,lines:n}),this.logger=TT(t.logger);let i=t.validateFormats;t.validateFormats=!1,this.RULES=(0,gT.getRules)(),Hy.call(this,bT,t,"NOT SUPPORTED"),Hy.call(this,xT,t,"DEPRECATED","warn"),this._metaOpts=IT.call(this),t.formats&&ST.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),t.keywords&&zT.call(this,t.keywords),typeof t.meta=="object"&&this.addMetaSchema(t.meta),wT.call(this),t.validateFormats=i}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:t,meta:r,schemaId:n}=this.opts,i=Wy;n==="id"&&(i={...Wy},i.id=i.$id,delete i.$id),r&&t&&this.addMetaSchema(i,i[n],!1)}defaultMeta(){let{meta:t,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof t=="object"?t[r]||t:void 0}validate(t,r){let n;if(typeof t=="string"){if(n=this.getSchema(t),!n)throw new Error(`no schema with key or ref "${t}"`)}else n=this.compile(t);let i=n(r);return"$async"in n||(this.errors=n.errors),i}compile(t,r){let n=this._addSchema(t,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(t,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return i.call(this,t,r);async function i(l,d){await o.call(this,l.$schema);let p=this._addSchema(l,d);return p.validate||a.call(this,p)}async function o(l){l&&!this.getSchema(l)&&await i.call(this,{$ref:l},!0)}async function a(l){try{return this._compileSchemaEnv(l)}catch(d){if(!(d instanceof Yy.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 o.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(t,r,n,i=this.opts.validateSchema){if(Array.isArray(t)){for(let a of t)this.addSchema(a,void 0,n,i);return this}let o;if(typeof t=="object"){let{schemaId:a}=this.opts;if(o=t[a],o!==void 0&&typeof o!="string")throw new Error(`schema ${a} must be string`)}return r=(0,To.normalizeId)(r||o),this._checkUnique(r),this.schemas[r]=this._addSchema(t,n,r,i,!0),this}addMetaSchema(t,r,n=this.opts.validateSchema){return this.addSchema(t,r,!0,n),this}validateSchema(t,r){if(typeof t=="boolean")return!0;let n;if(n=t.$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 i=this.validate(n,t);if(!i&&r){let o="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(o);else throw new Error(o)}return i}getSchema(t){let r;for(;typeof(r=Xy.call(this,t))=="string";)t=r;if(r===void 0){let{schemaId:n}=this.opts,i=new Po.SchemaEnv({schema:{},schemaId:n});if(r=Po.resolveSchema.call(this,i,t),!r)return;this.refs[t]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(t){if(t instanceof RegExp)return this._removeAllSchemas(this.schemas,t),this._removeAllSchemas(this.refs,t),this;switch(typeof t){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=Xy.call(this,t);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[t],delete this.refs[t],this}case"object":{let r=t;this._cache.delete(r);let n=t[this.opts.schemaId];return n&&(n=(0,To.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(t){for(let r of t)this.addKeyword(r);return this}addKeyword(t,r){let n;if(typeof t=="string")n=t,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof t=="object"&&r===void 0){if(r=t,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(jT.call(this,n,r),!r)return(0,rp.eachItem)(n,o=>tp.call(this,o)),this;NT.call(this,r);let i={...r,type:(0,Rs.getJSONTypes)(r.type),schemaType:(0,Rs.getJSONTypes)(r.schemaType)};return(0,rp.eachItem)(n,i.type.length===0?o=>tp.call(this,o,i):o=>i.type.forEach(a=>tp.call(this,o,i,a))),this}getKeyword(t){let r=this.RULES.all[t];return typeof r=="object"?r.definition:!!r}removeKeyword(t){let{RULES:r}=this;delete r.keywords[t],delete r.all[t];for(let n of r.rules){let i=n.rules.findIndex(o=>o.keyword===t);i>=0&&n.rules.splice(i,1)}return this}addFormat(t,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[t]=r,this}errorsText(t=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!t||t.length===0?"No errors":t.map(i=>`${n}${i.instancePath} ${i.message}`).reduce((i,o)=>i+r+o)}$dataMetaSchema(t,r){let n=this.RULES.all;t=JSON.parse(JSON.stringify(t));for(let i of r){let o=i.split("/").slice(1),a=t;for(let s of o)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]=e_(l))}}return t}_removeAllSchemas(t,r){for(let n in t){let i=t[n];(!r||r.test(n))&&(typeof i=="string"?delete t[n]:i&&!i.meta&&(this._cache.delete(i.schema),delete t[n]))}}_addSchema(t,r,n,i=this.opts.validateSchema,o=this.opts.addUsedSchema){let a,{schemaId:s}=this.opts;if(typeof t=="object")a=t[s];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof t!="boolean")throw new Error("schema must be object or boolean")}let c=this._cache.get(t);if(c!==void 0)return c;n=(0,To.normalizeId)(a||n);let u=To.getSchemaRefs.call(this,t,n);return c=new Po.SchemaEnv({schema:t,schemaId:s,meta:r,baseId:n,localRefs:u}),this._cache.set(c.schema,c),o&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=c),i&&this.validateSchema(t,!0),c}_checkUnique(t){if(this.schemas[t]||this.refs[t])throw new Error(`schema with key or id "${t}" already exists`)}_compileSchemaEnv(t){if(t.meta?this._compileMetaSchema(t):Po.compileSchema.call(this,t),!t.validate)throw new Error("ajv implementation error");return t.validate}_compileMetaSchema(t){let r=this.opts;this.opts=this._metaOpts;try{Po.compileSchema.call(this,t)}finally{this.opts=r}}};Eo.ValidationError=hT.default;Eo.MissingRefError=Yy.default;Ue.default=Eo;function Hy(e,t,r,n="error"){for(let i in e){let o=i;o in t&&this.logger[n](`${r}: option ${i}. ${e[o]}`)}}function Xy(e){return e=(0,To.normalizeId)(e),this.schemas[e]||this.refs[e]}function wT(){let e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(let t in e)this.addSchema(e[t],t)}function ST(){for(let e in this.opts.formats){let t=this.opts.formats[e];t&&this.addFormat(e,t)}}function zT(e){if(Array.isArray(e)){this.addVocabulary(e);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let t in e){let r=e[t];r.keyword||(r.keyword=t),this.addKeyword(r)}}function IT(){let e={...this.opts};for(let t of _T)delete e[t];return e}var PT={log(){},warn(){},error(){}};function TT(e){if(e===!1)return PT;if(e===void 0)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")}var ET=/^[a-z_$][a-z0-9_$:-]*$/i;function jT(e,t){let{RULES:r}=this;if((0,rp.eachItem)(e,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!ET.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!t&&t.$data&&!("code"in t||"validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}function tp(e,t,r){var n;let i=t?.post;if(r&&i)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:o}=this,a=i?o.post:o.rules.find(({type:c})=>c===r);if(a||(a={type:r,rules:[]},o.rules.push(a)),o.keywords[e]=!0,!t)return;let s={keyword:e,definition:{...t,type:(0,Rs.getJSONTypes)(t.type),schemaType:(0,Rs.getJSONTypes)(t.schemaType)}};t.before?OT.call(this,a,s,t.before):a.rules.push(s),o.all[e]=s,(n=t.implements)===null||n===void 0||n.forEach(c=>this.addKeyword(c))}function OT(e,t,r){let n=e.rules.findIndex(i=>i.keyword===r);n>=0?e.rules.splice(n,0,t):(e.rules.push(t),this.logger.warn(`rule ${r} is not defined`))}function NT(e){let{metaSchema:t}=e;t!==void 0&&(e.$data&&this.opts.$data&&(t=e_(t)),e.validateSchema=this.compile(t,!0))}var DT={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function e_(e){return{anyOf:[e,DT]}}});var r_=_(np=>{"use strict";Object.defineProperty(np,"__esModule",{value:!0});var ZT={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};np.default=ZT});var a_=_(Yr=>{"use strict";Object.defineProperty(Yr,"__esModule",{value:!0});Yr.callRef=Yr.getValidate=void 0;var RT=zo(),n_=St(),lt=B(),qn=ar(),i_=js(),As=ne(),AT={keyword:"$ref",schemaType:"string",code(e){let{gen:t,schema:r,it:n}=e,{baseId:i,schemaEnv:o,validateName:a,opts:s,self:c}=n,{root:u}=o;if((r==="#"||r==="#/")&&i===u.baseId)return d();let l=i_.resolveRef.call(c,u,i,r);if(l===void 0)throw new RT.default(n.opts.uriResolver,i,r);if(l instanceof i_.SchemaEnv)return p(l);return f(l);function d(){if(o===u)return Us(e,a,o,o.$async);let h=t.scopeValue("root",{ref:u});return Us(e,(0,lt._)`${h}.validate`,u,u.$async)}function p(h){let g=o_(e,h);Us(e,g,h,h.$async)}function f(h){let g=t.scopeValue("schema",s.code.source===!0?{ref:h,code:(0,lt.stringify)(h)}:{ref:h}),y=t.name("valid"),$=e.subschema({schema:h,dataTypes:[],schemaPath:lt.nil,topSchemaRef:g,errSchemaPath:r},y);e.mergeEvaluated($),e.ok(y)}}};function o_(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):(0,lt._)`${r.scopeValue("wrapper",{ref:t})}.validate`}Yr.getValidate=o_;function Us(e,t,r,n){let{gen:i,it:o}=e,{allErrors:a,schemaEnv:s,opts:c}=o,u=c.passContext?qn.default.this:lt.nil;n?l():d();function l(){if(!s.$async)throw new Error("async schema referenced by sync schema");let h=i.let("valid");i.try(()=>{i.code((0,lt._)`await ${(0,n_.callValidateCode)(e,t,u)}`),f(t),a||i.assign(h,!0)},g=>{i.if((0,lt._)`!(${g} instanceof ${o.ValidationError})`,()=>i.throw(g)),p(g),a||i.assign(h,!1)}),e.ok(h)}function d(){e.result((0,n_.callValidateCode)(e,t,u),()=>f(t),()=>p(t))}function p(h){let g=(0,lt._)`${h}.errors`;i.assign(qn.default.vErrors,(0,lt._)`${qn.default.vErrors} === null ? ${g} : ${qn.default.vErrors}.concat(${g})`),i.assign(qn.default.errors,(0,lt._)`${qn.default.vErrors}.length`)}function f(h){var g;if(!o.opts.unevaluated)return;let y=(g=r?.validate)===null||g===void 0?void 0:g.evaluated;if(o.props!==!0)if(y&&!y.dynamicProps)y.props!==void 0&&(o.props=As.mergeEvaluated.props(i,y.props,o.props));else{let $=i.var("props",(0,lt._)`${h}.evaluated.props`);o.props=As.mergeEvaluated.props(i,$,o.props,lt.Name)}if(o.items!==!0)if(y&&!y.dynamicItems)y.items!==void 0&&(o.items=As.mergeEvaluated.items(i,y.items,o.items));else{let $=i.var("items",(0,lt._)`${h}.evaluated.items`);o.items=As.mergeEvaluated.items(i,$,o.items,lt.Name)}}}Yr.callRef=Us;Yr.default=AT});var s_=_(ip=>{"use strict";Object.defineProperty(ip,"__esModule",{value:!0});var UT=r_(),CT=a_(),MT=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",UT.default,CT.default];ip.default=MT});var c_=_(op=>{"use strict";Object.defineProperty(op,"__esModule",{value:!0});var Cs=B(),Pr=Cs.operators,Ms={maximum:{okStr:"<=",ok:Pr.LTE,fail:Pr.GT},minimum:{okStr:">=",ok:Pr.GTE,fail:Pr.LT},exclusiveMaximum:{okStr:"<",ok:Pr.LT,fail:Pr.GTE},exclusiveMinimum:{okStr:">",ok:Pr.GT,fail:Pr.LTE}},qT={message:({keyword:e,schemaCode:t})=>(0,Cs.str)`must be ${Ms[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,Cs._)`{comparison: ${Ms[e].okStr}, limit: ${t}}`},LT={keyword:Object.keys(Ms),type:"number",schemaType:"number",$data:!0,error:qT,code(e){let{keyword:t,data:r,schemaCode:n}=e;e.fail$data((0,Cs._)`${r} ${Ms[t].fail} ${n} || isNaN(${r})`)}};op.default=LT});var u_=_(ap=>{"use strict";Object.defineProperty(ap,"__esModule",{value:!0});var jo=B(),FT={message:({schemaCode:e})=>(0,jo.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,jo._)`{multipleOf: ${e}}`},VT={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:FT,code(e){let{gen:t,data:r,schemaCode:n,it:i}=e,o=i.opts.multipleOfPrecision,a=t.let("res"),s=o?(0,jo._)`Math.abs(Math.round(${a}) - ${a}) > 1e-${o}`:(0,jo._)`${a} !== parseInt(${a})`;e.fail$data((0,jo._)`(${n} === 0 || (${a} = ${r}/${n}, ${s}))`)}};ap.default=VT});var d_=_(sp=>{"use strict";Object.defineProperty(sp,"__esModule",{value:!0});function l_(e){let t=e.length,r=0,n=0,i;for(;n<t;)r++,i=e.charCodeAt(n++),i>=55296&&i<=56319&&n<t&&(i=e.charCodeAt(n),(i&64512)===56320&&n++);return r}sp.default=l_;l_.code='require("ajv/dist/runtime/ucs2length").default'});var f_=_(cp=>{"use strict";Object.defineProperty(cp,"__esModule",{value:!0});var Qr=B(),JT=ne(),KT=d_(),BT={message({keyword:e,schemaCode:t}){let r=e==="maxLength"?"more":"fewer";return(0,Qr.str)`must NOT have ${r} than ${t} characters`},params:({schemaCode:e})=>(0,Qr._)`{limit: ${e}}`},WT={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:BT,code(e){let{keyword:t,data:r,schemaCode:n,it:i}=e,o=t==="maxLength"?Qr.operators.GT:Qr.operators.LT,a=i.opts.unicode===!1?(0,Qr._)`${r}.length`:(0,Qr._)`${(0,JT.useFunc)(e.gen,KT.default)}(${r})`;e.fail$data((0,Qr._)`${a} ${o} ${n}`)}};cp.default=WT});var p_=_(up=>{"use strict";Object.defineProperty(up,"__esModule",{value:!0});var GT=St(),HT=ne(),Ln=B(),XT={message:({schemaCode:e})=>(0,Ln.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,Ln._)`{pattern: ${e}}`},YT={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:XT,code(e){let{gen:t,data:r,$data:n,schema:i,schemaCode:o,it:a}=e,s=a.opts.unicodeRegExp?"u":"";if(n){let{regExp:c}=a.opts.code,u=c.code==="new RegExp"?(0,Ln._)`new RegExp`:(0,HT.useFunc)(t,c),l=t.let("valid");t.try(()=>t.assign(l,(0,Ln._)`${u}(${o}, ${s}).test(${r})`),()=>t.assign(l,!1)),e.fail$data((0,Ln._)`!${l}`)}else{let c=(0,GT.usePattern)(e,i);e.fail$data((0,Ln._)`!${c}.test(${r})`)}}};up.default=YT});var m_=_(lp=>{"use strict";Object.defineProperty(lp,"__esModule",{value:!0});var Oo=B(),QT={message({keyword:e,schemaCode:t}){let r=e==="maxProperties"?"more":"fewer";return(0,Oo.str)`must NOT have ${r} than ${t} properties`},params:({schemaCode:e})=>(0,Oo._)`{limit: ${e}}`},eE={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:QT,code(e){let{keyword:t,data:r,schemaCode:n}=e,i=t==="maxProperties"?Oo.operators.GT:Oo.operators.LT;e.fail$data((0,Oo._)`Object.keys(${r}).length ${i} ${n}`)}};lp.default=eE});var h_=_(dp=>{"use strict";Object.defineProperty(dp,"__esModule",{value:!0});var No=St(),Do=B(),tE=ne(),rE={message:({params:{missingProperty:e}})=>(0,Do.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,Do._)`{missingProperty: ${e}}`},nE={keyword:"required",type:"object",schemaType:"array",$data:!0,error:rE,code(e){let{gen:t,schema:r,schemaCode:n,data:i,$data:o,it:a}=e,{opts:s}=a;if(!o&&r.length===0)return;let c=r.length>=s.loopRequired;if(a.allErrors?u():l(),s.strictRequired){let f=e.parentSchema.properties,{definedProperties:h}=e.it;for(let g of r)if(f?.[g]===void 0&&!h.has(g)){let y=a.schemaEnv.baseId+a.errSchemaPath,$=`required property "${g}" is not defined at "${y}" (strictRequired)`;(0,tE.checkStrictMode)(a,$,a.opts.strictRequired)}}function u(){if(c||o)e.block$data(Do.nil,d);else for(let f of r)(0,No.checkReportMissingProp)(e,f)}function l(){let f=t.let("missing");if(c||o){let h=t.let("valid",!0);e.block$data(h,()=>p(f,h)),e.ok(h)}else t.if((0,No.checkMissingProp)(e,r,f)),(0,No.reportMissingProp)(e,f),t.else()}function d(){t.forOf("prop",n,f=>{e.setParams({missingProperty:f}),t.if((0,No.noPropertyInData)(t,i,f,s.ownProperties),()=>e.error())})}function p(f,h){e.setParams({missingProperty:f}),t.forOf(f,n,()=>{t.assign(h,(0,No.propertyInData)(t,i,f,s.ownProperties)),t.if((0,Do.not)(h),()=>{e.error(),t.break()})},Do.nil)}}};dp.default=nE});var g_=_(fp=>{"use strict";Object.defineProperty(fp,"__esModule",{value:!0});var Zo=B(),iE={message({keyword:e,schemaCode:t}){let r=e==="maxItems"?"more":"fewer";return(0,Zo.str)`must NOT have ${r} than ${t} items`},params:({schemaCode:e})=>(0,Zo._)`{limit: ${e}}`},oE={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:iE,code(e){let{keyword:t,data:r,schemaCode:n}=e,i=t==="maxItems"?Zo.operators.GT:Zo.operators.LT;e.fail$data((0,Zo._)`${r}.length ${i} ${n}`)}};fp.default=oE});var qs=_(pp=>{"use strict";Object.defineProperty(pp,"__esModule",{value:!0});var v_=Af();v_.code='require("ajv/dist/runtime/equal").default';pp.default=v_});var y_=_(hp=>{"use strict";Object.defineProperty(hp,"__esModule",{value:!0});var mp=bo(),Ce=B(),aE=ne(),sE=qs(),cE={message:({params:{i:e,j:t}})=>(0,Ce.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,Ce._)`{i: ${e}, j: ${t}}`},uE={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:cE,code(e){let{gen:t,data:r,$data:n,schema:i,parentSchema:o,schemaCode:a,it:s}=e;if(!n&&!i)return;let c=t.let("valid"),u=o.items?(0,mp.getSchemaTypes)(o.items):[];e.block$data(c,l,(0,Ce._)`${a} === false`),e.ok(c);function l(){let h=t.let("i",(0,Ce._)`${r}.length`),g=t.let("j");e.setParams({i:h,j:g}),t.assign(c,!0),t.if((0,Ce._)`${h} > 1`,()=>(d()?p:f)(h,g))}function d(){return u.length>0&&!u.some(h=>h==="object"||h==="array")}function p(h,g){let y=t.name("item"),$=(0,mp.checkDataTypes)(u,y,s.opts.strictNumbers,mp.DataType.Wrong),P=t.const("indices",(0,Ce._)`{}`);t.for((0,Ce._)`;${h}--;`,()=>{t.let(y,(0,Ce._)`${r}[${h}]`),t.if($,(0,Ce._)`continue`),u.length>1&&t.if((0,Ce._)`typeof ${y} == "string"`,(0,Ce._)`${y} += "_"`),t.if((0,Ce._)`typeof ${P}[${y}] == "number"`,()=>{t.assign(g,(0,Ce._)`${P}[${y}]`),e.error(),t.assign(c,!1).break()}).code((0,Ce._)`${P}[${y}] = ${h}`)})}function f(h,g){let y=(0,aE.useFunc)(t,sE.default),$=t.name("outer");t.label($).for((0,Ce._)`;${h}--;`,()=>t.for((0,Ce._)`${g} = ${h}; ${g}--;`,()=>t.if((0,Ce._)`${y}(${r}[${h}], ${r}[${g}])`,()=>{e.error(),t.assign(c,!1).break($)})))}}};hp.default=uE});var __=_(vp=>{"use strict";Object.defineProperty(vp,"__esModule",{value:!0});var gp=B(),lE=ne(),dE=qs(),fE={message:"must be equal to constant",params:({schemaCode:e})=>(0,gp._)`{allowedValue: ${e}}`},pE={keyword:"const",$data:!0,error:fE,code(e){let{gen:t,data:r,$data:n,schemaCode:i,schema:o}=e;n||o&&typeof o=="object"?e.fail$data((0,gp._)`!${(0,lE.useFunc)(t,dE.default)}(${r}, ${i})`):e.fail((0,gp._)`${o} !== ${r}`)}};vp.default=pE});var $_=_(yp=>{"use strict";Object.defineProperty(yp,"__esModule",{value:!0});var Ro=B(),mE=ne(),hE=qs(),gE={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,Ro._)`{allowedValues: ${e}}`},vE={keyword:"enum",schemaType:"array",$data:!0,error:gE,code(e){let{gen:t,data:r,$data:n,schema:i,schemaCode:o,it:a}=e;if(!n&&i.length===0)throw new Error("enum must have non-empty array");let s=i.length>=a.opts.loopEnum,c,u=()=>c??(c=(0,mE.useFunc)(t,hE.default)),l;if(s||n)l=t.let("valid"),e.block$data(l,d);else{if(!Array.isArray(i))throw new Error("ajv implementation error");let f=t.const("vSchema",o);l=(0,Ro.or)(...i.map((h,g)=>p(f,g)))}e.pass(l);function d(){t.assign(l,!1),t.forOf("v",o,f=>t.if((0,Ro._)`${u()}(${r}, ${f})`,()=>t.assign(l,!0).break()))}function p(f,h){let g=i[h];return typeof g=="object"&&g!==null?(0,Ro._)`${u()}(${r}, ${f}[${h}])`:(0,Ro._)`${r} === ${g}`}}};yp.default=vE});var b_=_(_p=>{"use strict";Object.defineProperty(_p,"__esModule",{value:!0});var yE=c_(),_E=u_(),$E=f_(),bE=p_(),xE=m_(),kE=h_(),wE=g_(),SE=y_(),zE=__(),IE=$_(),PE=[yE.default,_E.default,$E.default,bE.default,xE.default,kE.default,wE.default,SE.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},zE.default,IE.default];_p.default=PE});var bp=_(Ao=>{"use strict";Object.defineProperty(Ao,"__esModule",{value:!0});Ao.validateAdditionalItems=void 0;var en=B(),$p=ne(),TE={message:({params:{len:e}})=>(0,en.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,en._)`{limit: ${e}}`},EE={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:TE,code(e){let{parentSchema:t,it:r}=e,{items:n}=t;if(!Array.isArray(n)){(0,$p.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}x_(e,n)}};function x_(e,t){let{gen:r,schema:n,data:i,keyword:o,it:a}=e;a.items=!0;let s=r.const("len",(0,en._)`${i}.length`);if(n===!1)e.setParams({len:t.length}),e.pass((0,en._)`${s} <= ${t.length}`);else if(typeof n=="object"&&!(0,$p.alwaysValidSchema)(a,n)){let u=r.var("valid",(0,en._)`${s} <= ${t.length}`);r.if((0,en.not)(u),()=>c(u)),e.ok(u)}function c(u){r.forRange("i",t.length,s,l=>{e.subschema({keyword:o,dataProp:l,dataPropType:$p.Type.Num},u),a.allErrors||r.if((0,en.not)(u),()=>r.break())})}}Ao.validateAdditionalItems=x_;Ao.default=EE});var xp=_(Uo=>{"use strict";Object.defineProperty(Uo,"__esModule",{value:!0});Uo.validateTuple=void 0;var k_=B(),Ls=ne(),jE=St(),OE={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:r}=e;if(Array.isArray(t))return w_(e,"additionalItems",t);r.items=!0,!(0,Ls.alwaysValidSchema)(r,t)&&e.ok((0,jE.validateArray)(e))}};function w_(e,t,r=e.schema){let{gen:n,parentSchema:i,data:o,keyword:a,it:s}=e;l(i),s.opts.unevaluated&&r.length&&s.items!==!0&&(s.items=Ls.mergeEvaluated.items(n,r.length,s.items));let c=n.name("valid"),u=n.const("len",(0,k_._)`${o}.length`);r.forEach((d,p)=>{(0,Ls.alwaysValidSchema)(s,d)||(n.if((0,k_._)`${u} > ${p}`,()=>e.subschema({keyword:a,schemaProp:p,dataProp:p},c)),e.ok(c))});function l(d){let{opts:p,errSchemaPath:f}=s,h=r.length,g=h===d.minItems&&(h===d.maxItems||d[t]===!1);if(p.strictTuples&&!g){let y=`"${a}" is ${h}-tuple, but minItems or maxItems/${t} are not specified or different at path "${f}"`;(0,Ls.checkStrictMode)(s,y,p.strictTuples)}}}Uo.validateTuple=w_;Uo.default=OE});var S_=_(kp=>{"use strict";Object.defineProperty(kp,"__esModule",{value:!0});var NE=xp(),DE={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,NE.validateTuple)(e,"items")};kp.default=DE});var I_=_(wp=>{"use strict";Object.defineProperty(wp,"__esModule",{value:!0});var z_=B(),ZE=ne(),RE=St(),AE=bp(),UE={message:({params:{len:e}})=>(0,z_.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,z_._)`{limit: ${e}}`},CE={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:UE,code(e){let{schema:t,parentSchema:r,it:n}=e,{prefixItems:i}=r;n.items=!0,!(0,ZE.alwaysValidSchema)(n,t)&&(i?(0,AE.validateAdditionalItems)(e,i):e.ok((0,RE.validateArray)(e)))}};wp.default=CE});var P_=_(Sp=>{"use strict";Object.defineProperty(Sp,"__esModule",{value:!0});var It=B(),Fs=ne(),ME={message:({params:{min:e,max:t}})=>t===void 0?(0,It.str)`must contain at least ${e} valid item(s)`:(0,It.str)`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?(0,It._)`{minContains: ${e}}`:(0,It._)`{minContains: ${e}, maxContains: ${t}}`},qE={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:ME,code(e){let{gen:t,schema:r,parentSchema:n,data:i,it:o}=e,a,s,{minContains:c,maxContains:u}=n;o.opts.next?(a=c===void 0?1:c,s=u):a=1;let l=t.const("len",(0,It._)`${i}.length`);if(e.setParams({min:a,max:s}),s===void 0&&a===0){(0,Fs.checkStrictMode)(o,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(s!==void 0&&a>s){(0,Fs.checkStrictMode)(o,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,Fs.alwaysValidSchema)(o,r)){let g=(0,It._)`${l} >= ${a}`;s!==void 0&&(g=(0,It._)`${g} && ${l} <= ${s}`),e.pass(g);return}o.items=!0;let d=t.name("valid");s===void 0&&a===1?f(d,()=>t.if(d,()=>t.break())):a===0?(t.let(d,!0),s!==void 0&&t.if((0,It._)`${i}.length > 0`,p)):(t.let(d,!1),p()),e.result(d,()=>e.reset());function p(){let g=t.name("_valid"),y=t.let("count",0);f(g,()=>t.if(g,()=>h(y)))}function f(g,y){t.forRange("i",0,l,$=>{e.subschema({keyword:"contains",dataProp:$,dataPropType:Fs.Type.Num,compositeRule:!0},g),y()})}function h(g){t.code((0,It._)`${g}++`),s===void 0?t.if((0,It._)`${g} >= ${a}`,()=>t.assign(d,!0).break()):(t.if((0,It._)`${g} > ${s}`,()=>t.assign(d,!1).break()),a===1?t.assign(d,!0):t.if((0,It._)`${g} >= ${a}`,()=>t.assign(d,!0)))}}};Sp.default=qE});var j_=_(Vt=>{"use strict";Object.defineProperty(Vt,"__esModule",{value:!0});Vt.validateSchemaDeps=Vt.validatePropertyDeps=Vt.error=void 0;var zp=B(),LE=ne(),Co=St();Vt.error={message:({params:{property:e,depsCount:t,deps:r}})=>{let n=t===1?"property":"properties";return(0,zp.str)`must have ${n} ${r} when property ${e} is present`},params:({params:{property:e,depsCount:t,deps:r,missingProperty:n}})=>(0,zp._)`{property: ${e},
|
|
7
|
+
missingProperty: ${n},
|
|
8
|
+
depsCount: ${t},
|
|
9
|
+
deps: ${r}}`};var FE={keyword:"dependencies",type:"object",schemaType:"object",error:Vt.error,code(e){let[t,r]=VE(e);T_(e,t),E_(e,r)}};function VE({schema:e}){let t={},r={};for(let n in e){if(n==="__proto__")continue;let i=Array.isArray(e[n])?t:r;i[n]=e[n]}return[t,r]}function T_(e,t=e.schema){let{gen:r,data:n,it:i}=e;if(Object.keys(t).length===0)return;let o=r.let("missing");for(let a in t){let s=t[a];if(s.length===0)continue;let c=(0,Co.propertyInData)(r,n,a,i.opts.ownProperties);e.setParams({property:a,depsCount:s.length,deps:s.join(", ")}),i.allErrors?r.if(c,()=>{for(let u of s)(0,Co.checkReportMissingProp)(e,u)}):(r.if((0,zp._)`${c} && (${(0,Co.checkMissingProp)(e,s,o)})`),(0,Co.reportMissingProp)(e,o),r.else())}}Vt.validatePropertyDeps=T_;function E_(e,t=e.schema){let{gen:r,data:n,keyword:i,it:o}=e,a=r.name("valid");for(let s in t)(0,LE.alwaysValidSchema)(o,t[s])||(r.if((0,Co.propertyInData)(r,n,s,o.opts.ownProperties),()=>{let c=e.subschema({keyword:i,schemaProp:s},a);e.mergeValidEvaluated(c,a)},()=>r.var(a,!0)),e.ok(a))}Vt.validateSchemaDeps=E_;Vt.default=FE});var N_=_(Ip=>{"use strict";Object.defineProperty(Ip,"__esModule",{value:!0});var O_=B(),JE=ne(),KE={message:"property name must be valid",params:({params:e})=>(0,O_._)`{propertyName: ${e.propertyName}}`},BE={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:KE,code(e){let{gen:t,schema:r,data:n,it:i}=e;if((0,JE.alwaysValidSchema)(i,r))return;let o=t.name("valid");t.forIn("key",n,a=>{e.setParams({propertyName:a}),e.subschema({keyword:"propertyNames",data:a,dataTypes:["string"],propertyName:a,compositeRule:!0},o),t.if((0,O_.not)(o),()=>{e.error(!0),i.allErrors||t.break()})}),e.ok(o)}};Ip.default=BE});var Tp=_(Pp=>{"use strict";Object.defineProperty(Pp,"__esModule",{value:!0});var Vs=St(),Zt=B(),WE=ar(),Js=ne(),GE={message:"must NOT have additional properties",params:({params:e})=>(0,Zt._)`{additionalProperty: ${e.additionalProperty}}`},HE={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:GE,code(e){let{gen:t,schema:r,parentSchema:n,data:i,errsCount:o,it:a}=e;if(!o)throw new Error("ajv implementation error");let{allErrors:s,opts:c}=a;if(a.props=!0,c.removeAdditional!=="all"&&(0,Js.alwaysValidSchema)(a,r))return;let u=(0,Vs.allSchemaProperties)(n.properties),l=(0,Vs.allSchemaProperties)(n.patternProperties);d(),e.ok((0,Zt._)`${o} === ${WE.default.errors}`);function d(){t.forIn("key",i,y=>{!u.length&&!l.length?h(y):t.if(p(y),()=>h(y))})}function p(y){let $;if(u.length>8){let P=(0,Js.schemaRefOrVal)(a,n.properties,"properties");$=(0,Vs.isOwnProperty)(t,P,y)}else u.length?$=(0,Zt.or)(...u.map(P=>(0,Zt._)`${y} === ${P}`)):$=Zt.nil;return l.length&&($=(0,Zt.or)($,...l.map(P=>(0,Zt._)`${(0,Vs.usePattern)(e,P)}.test(${y})`))),(0,Zt.not)($)}function f(y){t.code((0,Zt._)`delete ${i}[${y}]`)}function h(y){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){f(y);return}if(r===!1){e.setParams({additionalProperty:y}),e.error(),s||t.break();return}if(typeof r=="object"&&!(0,Js.alwaysValidSchema)(a,r)){let $=t.name("valid");c.removeAdditional==="failing"?(g(y,$,!1),t.if((0,Zt.not)($),()=>{e.reset(),f(y)})):(g(y,$),s||t.if((0,Zt.not)($),()=>t.break()))}}function g(y,$,P){let k={keyword:"additionalProperties",dataProp:y,dataPropType:Js.Type.Str};P===!1&&Object.assign(k,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(k,$)}}};Pp.default=HE});var R_=_(jp=>{"use strict";Object.defineProperty(jp,"__esModule",{value:!0});var XE=So(),D_=St(),Ep=ne(),Z_=Tp(),YE={keyword:"properties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,parentSchema:n,data:i,it:o}=e;o.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&Z_.default.code(new XE.KeywordCxt(o,Z_.default,"additionalProperties"));let a=(0,D_.allSchemaProperties)(r);for(let d of a)o.definedProperties.add(d);o.opts.unevaluated&&a.length&&o.props!==!0&&(o.props=Ep.mergeEvaluated.props(t,(0,Ep.toHash)(a),o.props));let s=a.filter(d=>!(0,Ep.alwaysValidSchema)(o,r[d]));if(s.length===0)return;let c=t.name("valid");for(let d of s)u(d)?l(d):(t.if((0,D_.propertyInData)(t,i,d,o.opts.ownProperties)),l(d),o.allErrors||t.else().var(c,!0),t.endIf()),e.it.definedProperties.add(d),e.ok(c);function u(d){return o.opts.useDefaults&&!o.compositeRule&&r[d].default!==void 0}function l(d){e.subschema({keyword:"properties",schemaProp:d,dataProp:d},c)}}};jp.default=YE});var M_=_(Op=>{"use strict";Object.defineProperty(Op,"__esModule",{value:!0});var A_=St(),Ks=B(),U_=ne(),C_=ne(),QE={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,data:n,parentSchema:i,it:o}=e,{opts:a}=o,s=(0,A_.allSchemaProperties)(r),c=s.filter(g=>(0,U_.alwaysValidSchema)(o,r[g]));if(s.length===0||c.length===s.length&&(!o.opts.unevaluated||o.props===!0))return;let u=a.strictSchema&&!a.allowMatchingProperties&&i.properties,l=t.name("valid");o.props!==!0&&!(o.props instanceof Ks.Name)&&(o.props=(0,C_.evaluatedPropsToName)(t,o.props));let{props:d}=o;p();function p(){for(let g of s)u&&f(g),o.allErrors?h(g):(t.var(l,!0),h(g),t.if(l))}function f(g){for(let y in u)new RegExp(g).test(y)&&(0,U_.checkStrictMode)(o,`property ${y} matches pattern ${g} (use allowMatchingProperties)`)}function h(g){t.forIn("key",n,y=>{t.if((0,Ks._)`${(0,A_.usePattern)(e,g)}.test(${y})`,()=>{let $=c.includes(g);$||e.subschema({keyword:"patternProperties",schemaProp:g,dataProp:y,dataPropType:C_.Type.Str},l),o.opts.unevaluated&&d!==!0?t.assign((0,Ks._)`${d}[${y}]`,!0):!$&&!o.allErrors&&t.if((0,Ks.not)(l),()=>t.break())})})}}};Op.default=QE});var q_=_(Np=>{"use strict";Object.defineProperty(Np,"__esModule",{value:!0});var ej=ne(),tj={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:r,it:n}=e;if((0,ej.alwaysValidSchema)(n,r)){e.fail();return}let i=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),e.failResult(i,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};Np.default=tj});var L_=_(Dp=>{"use strict";Object.defineProperty(Dp,"__esModule",{value:!0});var rj=St(),nj={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:rj.validateUnion,error:{message:"must match a schema in anyOf"}};Dp.default=nj});var F_=_(Zp=>{"use strict";Object.defineProperty(Zp,"__esModule",{value:!0});var Bs=B(),ij=ne(),oj={message:"must match exactly one schema in oneOf",params:({params:e})=>(0,Bs._)`{passingSchemas: ${e.passing}}`},aj={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:oj,code(e){let{gen:t,schema:r,parentSchema:n,it:i}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(i.opts.discriminator&&n.discriminator)return;let o=r,a=t.let("valid",!1),s=t.let("passing",null),c=t.name("_valid");e.setParams({passing:s}),t.block(u),e.result(a,()=>e.reset(),()=>e.error(!0));function u(){o.forEach((l,d)=>{let p;(0,ij.alwaysValidSchema)(i,l)?t.var(c,!0):p=e.subschema({keyword:"oneOf",schemaProp:d,compositeRule:!0},c),d>0&&t.if((0,Bs._)`${c} && ${a}`).assign(a,!1).assign(s,(0,Bs._)`[${s}, ${d}]`).else(),t.if(c,()=>{t.assign(a,!0),t.assign(s,d),p&&e.mergeEvaluated(p,Bs.Name)})})}}};Zp.default=aj});var V_=_(Rp=>{"use strict";Object.defineProperty(Rp,"__esModule",{value:!0});var sj=ne(),cj={keyword:"allOf",schemaType:"array",code(e){let{gen:t,schema:r,it:n}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");let i=t.name("valid");r.forEach((o,a)=>{if((0,sj.alwaysValidSchema)(n,o))return;let s=e.subschema({keyword:"allOf",schemaProp:a},i);e.ok(i),e.mergeEvaluated(s)})}};Rp.default=cj});var B_=_(Ap=>{"use strict";Object.defineProperty(Ap,"__esModule",{value:!0});var Ws=B(),K_=ne(),uj={message:({params:e})=>(0,Ws.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,Ws._)`{failingKeyword: ${e.ifClause}}`},lj={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:uj,code(e){let{gen:t,parentSchema:r,it:n}=e;r.then===void 0&&r.else===void 0&&(0,K_.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let i=J_(n,"then"),o=J_(n,"else");if(!i&&!o)return;let a=t.let("valid",!0),s=t.name("_valid");if(c(),e.reset(),i&&o){let l=t.let("ifClause");e.setParams({ifClause:l}),t.if(s,u("then",l),u("else",l))}else i?t.if(s,u("then")):t.if((0,Ws.not)(s),u("else"));e.pass(a,()=>e.error(!0));function c(){let l=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},s);e.mergeEvaluated(l)}function u(l,d){return()=>{let p=e.subschema({keyword:l},s);t.assign(a,s),e.mergeValidEvaluated(p,a),d?t.assign(d,(0,Ws._)`${l}`):e.setParams({ifClause:l})}}}};function J_(e,t){let r=e.schema[t];return r!==void 0&&!(0,K_.alwaysValidSchema)(e,r)}Ap.default=lj});var W_=_(Up=>{"use strict";Object.defineProperty(Up,"__esModule",{value:!0});var dj=ne(),fj={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){t.if===void 0&&(0,dj.checkStrictMode)(r,`"${e}" without "if" is ignored`)}};Up.default=fj});var G_=_(Cp=>{"use strict";Object.defineProperty(Cp,"__esModule",{value:!0});var pj=bp(),mj=S_(),hj=xp(),gj=I_(),vj=P_(),yj=j_(),_j=N_(),$j=Tp(),bj=R_(),xj=M_(),kj=q_(),wj=L_(),Sj=F_(),zj=V_(),Ij=B_(),Pj=W_();function Tj(e=!1){let t=[kj.default,wj.default,Sj.default,zj.default,Ij.default,Pj.default,_j.default,$j.default,yj.default,bj.default,xj.default];return e?t.push(mj.default,gj.default):t.push(pj.default,hj.default),t.push(vj.default),t}Cp.default=Tj});var H_=_(Mp=>{"use strict";Object.defineProperty(Mp,"__esModule",{value:!0});var we=B(),Ej={message:({schemaCode:e})=>(0,we.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,we._)`{format: ${e}}`},jj={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:Ej,code(e,t){let{gen:r,data:n,$data:i,schema:o,schemaCode:a,it:s}=e,{opts:c,errSchemaPath:u,schemaEnv:l,self:d}=s;if(!c.validateFormats)return;i?p():f();function p(){let h=r.scopeValue("formats",{ref:d.formats,code:c.code.formats}),g=r.const("fDef",(0,we._)`${h}[${a}]`),y=r.let("fType"),$=r.let("format");r.if((0,we._)`typeof ${g} == "object" && !(${g} instanceof RegExp)`,()=>r.assign(y,(0,we._)`${g}.type || "string"`).assign($,(0,we._)`${g}.validate`),()=>r.assign(y,(0,we._)`"string"`).assign($,g)),e.fail$data((0,we.or)(P(),k()));function P(){return c.strictSchema===!1?we.nil:(0,we._)`${a} && !${$}`}function k(){let N=l.$async?(0,we._)`(${g}.async ? await ${$}(${n}) : ${$}(${n}))`:(0,we._)`${$}(${n})`,j=(0,we._)`(typeof ${$} == "function" ? ${N} : ${$}.test(${n}))`;return(0,we._)`${$} && ${$} !== true && ${y} === ${t} && !${j}`}}function f(){let h=d.formats[o];if(!h){P();return}if(h===!0)return;let[g,y,$]=k(h);g===t&&e.pass(N());function P(){if(c.strictSchema===!1){d.logger.warn(j());return}throw new Error(j());function j(){return`unknown format "${o}" ignored in schema at path "${u}"`}}function k(j){let ot=j instanceof RegExp?(0,we.regexpCode)(j):c.code.formats?(0,we._)`${c.code.formats}${(0,we.getProperty)(o)}`:void 0,ft=r.scopeValue("formats",{key:o,ref:j,code:ot});return typeof j=="object"&&!(j instanceof RegExp)?[j.type||"string",j.validate,(0,we._)`${ft}.validate`]:["string",j,ft]}function N(){if(typeof h=="object"&&!(h instanceof RegExp)&&h.async){if(!l.$async)throw new Error("async format in sync schema");return(0,we._)`await ${$}(${n})`}return typeof y=="function"?(0,we._)`${$}(${n})`:(0,we._)`${$}.test(${n})`}}}};Mp.default=jj});var X_=_(qp=>{"use strict";Object.defineProperty(qp,"__esModule",{value:!0});var Oj=H_(),Nj=[Oj.default];qp.default=Nj});var Y_=_(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 e$=_(Lp=>{"use strict";Object.defineProperty(Lp,"__esModule",{value:!0});var Dj=s_(),Zj=b_(),Rj=G_(),Aj=X_(),Q_=Y_(),Uj=[Dj.default,Zj.default,(0,Rj.default)(),Aj.default,Q_.metadataVocabulary,Q_.contentVocabulary];Lp.default=Uj});var r$=_(Gs=>{"use strict";Object.defineProperty(Gs,"__esModule",{value:!0});Gs.DiscrError=void 0;var t$;(function(e){e.Tag="tag",e.Mapping="mapping"})(t$||(Gs.DiscrError=t$={}))});var i$=_(Vp=>{"use strict";Object.defineProperty(Vp,"__esModule",{value:!0});var Vn=B(),Fp=r$(),n$=js(),Cj=zo(),Mj=ne(),qj={message:({params:{discrError:e,tagName:t}})=>e===Fp.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>(0,Vn._)`{error: ${e}, tag: ${r}, tagValue: ${t}}`},Lj={keyword:"discriminator",type:"object",schemaType:"object",error:qj,code(e){let{gen:t,data:r,schema:n,parentSchema:i,it:o}=e,{oneOf:a}=i;if(!o.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=t.let("valid",!1),u=t.const("tag",(0,Vn._)`${r}${(0,Vn.getProperty)(s)}`);t.if((0,Vn._)`typeof ${u} == "string"`,()=>l(),()=>e.error(!1,{discrError:Fp.DiscrError.Tag,tag:u,tagName:s})),e.ok(c);function l(){let f=p();t.if(!1);for(let h in f)t.elseIf((0,Vn._)`${u} === ${h}`),t.assign(c,d(f[h]));t.else(),e.error(!1,{discrError:Fp.DiscrError.Mapping,tag:u,tagName:s}),t.endIf()}function d(f){let h=t.name("valid"),g=e.subschema({keyword:"oneOf",schemaProp:f},h);return e.mergeEvaluated(g,Vn.Name),h}function p(){var f;let h={},g=$(i),y=!0;for(let N=0;N<a.length;N++){let j=a[N];if(j?.$ref&&!(0,Mj.schemaHasRulesButRef)(j,o.self.RULES)){let ft=j.$ref;if(j=n$.resolveRef.call(o.self,o.schemaEnv.root,o.baseId,ft),j instanceof n$.SchemaEnv&&(j=j.schema),j===void 0)throw new Cj.default(o.opts.uriResolver,o.baseId,ft)}let ot=(f=j?.properties)===null||f===void 0?void 0:f[s];if(typeof ot!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${s}"`);y=y&&(g||$(j)),P(ot,N)}if(!y)throw new Error(`discriminator: "${s}" must be required`);return h;function $({required:N}){return Array.isArray(N)&&N.includes(s)}function P(N,j){if(N.const)k(N.const,j);else if(N.enum)for(let ot of N.enum)k(ot,j);else throw new Error(`discriminator: "properties/${s}" must have "const" or "enum"`)}function k(N,j){if(typeof N!="string"||N in h)throw new Error(`discriminator: "${s}" values must be unique strings`);h[N]=j}}}};Vp.default=Lj});var o$=_((Qq,Fj)=>{Fj.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 Kp=_((_e,Jp)=>{"use strict";Object.defineProperty(_e,"__esModule",{value:!0});_e.MissingRefError=_e.ValidationError=_e.CodeGen=_e.Name=_e.nil=_e.stringify=_e.str=_e._=_e.KeywordCxt=_e.Ajv=void 0;var Vj=t_(),Jj=e$(),Kj=i$(),a$=o$(),Bj=["/properties"],Hs="http://json-schema.org/draft-07/schema",Jn=class extends Vj.default{_addVocabularies(){super._addVocabularies(),Jj.default.forEach(t=>this.addVocabulary(t)),this.opts.discriminator&&this.addKeyword(Kj.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let t=this.opts.$data?this.$dataMetaSchema(a$,Bj):a$;this.addMetaSchema(t,Hs,!1),this.refs["http://json-schema.org/schema"]=Hs}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Hs)?Hs:void 0)}};_e.Ajv=Jn;Jp.exports=_e=Jn;Jp.exports.Ajv=Jn;Object.defineProperty(_e,"__esModule",{value:!0});_e.default=Jn;var Wj=So();Object.defineProperty(_e,"KeywordCxt",{enumerable:!0,get:function(){return Wj.KeywordCxt}});var Kn=B();Object.defineProperty(_e,"_",{enumerable:!0,get:function(){return Kn._}});Object.defineProperty(_e,"str",{enumerable:!0,get:function(){return Kn.str}});Object.defineProperty(_e,"stringify",{enumerable:!0,get:function(){return Kn.stringify}});Object.defineProperty(_e,"nil",{enumerable:!0,get:function(){return Kn.nil}});Object.defineProperty(_e,"Name",{enumerable:!0,get:function(){return Kn.Name}});Object.defineProperty(_e,"CodeGen",{enumerable:!0,get:function(){return Kn.CodeGen}});var Gj=Ts();Object.defineProperty(_e,"ValidationError",{enumerable:!0,get:function(){return Gj.default}});var Hj=zo();Object.defineProperty(_e,"MissingRefError",{enumerable:!0,get:function(){return Hj.default}})});var m$=_(Kt=>{"use strict";Object.defineProperty(Kt,"__esModule",{value:!0});Kt.formatNames=Kt.fastFormats=Kt.fullFormats=void 0;function Jt(e,t){return{validate:e,compare:t}}Kt.fullFormats={date:Jt(l$,Hp),time:Jt(Wp(!0),Xp),"date-time":Jt(s$(!0),f$),"iso-time":Jt(Wp(),d$),"iso-date-time":Jt(s$(),p$),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:rO,"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:uO,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:nO,int32:{type:"number",validate:aO},int64:{type:"number",validate:sO},float:{type:"number",validate:u$},double:{type:"number",validate:u$},password:!0,binary:!0};Kt.fastFormats={...Kt.fullFormats,date:Jt(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,Hp),time:Jt(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,Xp),"date-time":Jt(/^\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,f$),"iso-time":Jt(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,d$),"iso-date-time":Jt(/^\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,p$),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};Kt.formatNames=Object.keys(Kt.fullFormats);function Xj(e){return e%4===0&&(e%100!==0||e%400===0)}var Yj=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,Qj=[0,31,28,31,30,31,30,31,31,30,31,30,31];function l$(e){let t=Yj.exec(e);if(!t)return!1;let r=+t[1],n=+t[2],i=+t[3];return n>=1&&n<=12&&i>=1&&i<=(n===2&&Xj(r)?29:Qj[n])}function Hp(e,t){if(e&&t)return e>t?1:e<t?-1:0}var Bp=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function Wp(e){return function(r){let n=Bp.exec(r);if(!n)return!1;let i=+n[1],o=+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||e&&!s)return!1;if(i<=23&&o<=59&&a<60)return!0;let d=o-l*c,p=i-u*c-(d<0?1:0);return(p===23||p===-1)&&(d===59||d===-1)&&a<61}}function Xp(e,t){if(!(e&&t))return;let r=new Date("2020-01-01T"+e).valueOf(),n=new Date("2020-01-01T"+t).valueOf();if(r&&n)return r-n}function d$(e,t){if(!(e&&t))return;let r=Bp.exec(e),n=Bp.exec(t);if(r&&n)return e=r[1]+r[2]+r[3],t=n[1]+n[2]+n[3],e>t?1:e<t?-1:0}var Gp=/t|\s/i;function s$(e){let t=Wp(e);return function(n){let i=n.split(Gp);return i.length===2&&l$(i[0])&&t(i[1])}}function f$(e,t){if(!(e&&t))return;let r=new Date(e).valueOf(),n=new Date(t).valueOf();if(r&&n)return r-n}function p$(e,t){if(!(e&&t))return;let[r,n]=e.split(Gp),[i,o]=t.split(Gp),a=Hp(r,i);if(a!==void 0)return a||Xp(n,o)}var eO=/\/|:/,tO=/^(?:[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 rO(e){return eO.test(e)&&tO.test(e)}var c$=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function nO(e){return c$.lastIndex=0,c$.test(e)}var iO=-(2**31),oO=2**31-1;function aO(e){return Number.isInteger(e)&&e<=oO&&e>=iO}function sO(e){return Number.isInteger(e)}function u$(){return!0}var cO=/[^\\]\\Z/;function uO(e){if(cO.test(e))return!1;try{return new RegExp(e),!0}catch{return!1}}});var h$=_(Bn=>{"use strict";Object.defineProperty(Bn,"__esModule",{value:!0});Bn.formatLimitDefinition=void 0;var lO=Kp(),Rt=B(),Tr=Rt.operators,Xs={formatMaximum:{okStr:"<=",ok:Tr.LTE,fail:Tr.GT},formatMinimum:{okStr:">=",ok:Tr.GTE,fail:Tr.LT},formatExclusiveMaximum:{okStr:"<",ok:Tr.LT,fail:Tr.GTE},formatExclusiveMinimum:{okStr:">",ok:Tr.GT,fail:Tr.LTE}},dO={message:({keyword:e,schemaCode:t})=>(0,Rt.str)`should be ${Xs[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,Rt._)`{comparison: ${Xs[e].okStr}, limit: ${t}}`};Bn.formatLimitDefinition={keyword:Object.keys(Xs),type:"string",schemaType:"string",$data:!0,error:dO,code(e){let{gen:t,data:r,schemaCode:n,keyword:i,it:o}=e,{opts:a,self:s}=o;if(!a.validateFormats)return;let c=new lO.KeywordCxt(o,s.RULES.all.format.definition,"format");c.$data?u():l();function u(){let p=t.scopeValue("formats",{ref:s.formats,code:a.code.formats}),f=t.const("fmt",(0,Rt._)`${p}[${c.schemaCode}]`);e.fail$data((0,Rt.or)((0,Rt._)`typeof ${f} != "object"`,(0,Rt._)`${f} instanceof RegExp`,(0,Rt._)`typeof ${f}.compare != "function"`,d(f)))}function l(){let p=c.schema,f=s.formats[p];if(!f||f===!0)return;if(typeof f!="object"||f instanceof RegExp||typeof f.compare!="function")throw new Error(`"${i}": format "${p}" does not define "compare" function`);let h=t.scopeValue("formats",{key:p,ref:f,code:a.code.formats?(0,Rt._)`${a.code.formats}${(0,Rt.getProperty)(p)}`:void 0});e.fail$data(d(h))}function d(p){return(0,Rt._)`${p}.compare(${r}, ${n}) ${Xs[i].fail} 0`}},dependencies:["format"]};var fO=e=>(e.addKeyword(Bn.formatLimitDefinition),e);Bn.default=fO});var _$=_((Mo,y$)=>{"use strict";Object.defineProperty(Mo,"__esModule",{value:!0});var Wn=m$(),pO=h$(),Yp=B(),g$=new Yp.Name("fullFormats"),mO=new Yp.Name("fastFormats"),Qp=(e,t={keywords:!0})=>{if(Array.isArray(t))return v$(e,t,Wn.fullFormats,g$),e;let[r,n]=t.mode==="fast"?[Wn.fastFormats,mO]:[Wn.fullFormats,g$],i=t.formats||Wn.formatNames;return v$(e,i,r,n),t.keywords&&(0,pO.default)(e),e};Qp.get=(e,t="full")=>{let n=(t==="fast"?Wn.fastFormats:Wn.fullFormats)[e];if(!n)throw new Error(`Unknown format "${e}"`);return n};function v$(e,t,r,n){var i,o;(i=(o=e.opts.code).formats)!==null&&i!==void 0||(o.formats=(0,Yp._)`require("ajv-formats/dist/formats").${n}`);for(let a of t)e.addFormat(a,r[a])}y$.exports=Mo=Qp;Object.defineProperty(Mo,"__esModule",{value:!0});Mo.default=Qp});var je=_(em=>{"use strict";em.fromCallback=function(e){return Object.defineProperty(function(...t){if(typeof t[t.length-1]=="function")e.apply(this,t);else return new Promise((r,n)=>{t.push((i,o)=>i!=null?n(i):r(o)),e.apply(this,t)})},"name",{value:e.name})};em.fromPromise=function(e){return Object.defineProperty(function(...t){let r=t[t.length-1];if(typeof r!="function")return e.apply(this,t);t.pop(),e.apply(this,t).then(n=>r(null,n),r)},"name",{value:e.name})}});var I$=_((_2,z$)=>{var Er=Ee("constants"),vO=process.cwd,nc=null,yO=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return nc||(nc=vO.call(process)),nc};try{process.cwd()}catch{}typeof process.chdir=="function"&&(tm=process.chdir,process.chdir=function(e){nc=null,tm.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,tm));var tm;z$.exports=_O;function _O(e){Er.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&t(e),e.lutimes||r(e),e.chown=o(e.chown),e.fchown=o(e.fchown),e.lchown=o(e.lchown),e.chmod=n(e.chmod),e.fchmod=n(e.fchmod),e.lchmod=n(e.lchmod),e.chownSync=a(e.chownSync),e.fchownSync=a(e.fchownSync),e.lchownSync=a(e.lchownSync),e.chmodSync=i(e.chmodSync),e.fchmodSync=i(e.fchmodSync),e.lchmodSync=i(e.lchmodSync),e.stat=s(e.stat),e.fstat=s(e.fstat),e.lstat=s(e.lstat),e.statSync=c(e.statSync),e.fstatSync=c(e.fstatSync),e.lstatSync=c(e.lstatSync),e.chmod&&!e.lchmod&&(e.lchmod=function(l,d,p){p&&process.nextTick(p)},e.lchmodSync=function(){}),e.chown&&!e.lchown&&(e.lchown=function(l,d,p,f){f&&process.nextTick(f)},e.lchownSync=function(){}),yO==="win32"&&(e.rename=typeof e.rename!="function"?e.rename:(function(l){function d(p,f,h){var g=Date.now(),y=0;l(p,f,function $(P){if(P&&(P.code==="EACCES"||P.code==="EPERM"||P.code==="EBUSY")&&Date.now()-g<6e4){setTimeout(function(){e.stat(f,function(k,N){k&&k.code==="ENOENT"?l(p,f,$):h(P)})},y),y<100&&(y+=10);return}h&&h(P)})}return Object.setPrototypeOf&&Object.setPrototypeOf(d,l),d})(e.rename)),e.read=typeof e.read!="function"?e.read:(function(l){function d(p,f,h,g,y,$){var P;if($&&typeof $=="function"){var k=0;P=function(N,j,ot){if(N&&N.code==="EAGAIN"&&k<10)return k++,l.call(e,p,f,h,g,y,P);$.apply(this,arguments)}}return l.call(e,p,f,h,g,y,P)}return Object.setPrototypeOf&&Object.setPrototypeOf(d,l),d})(e.read),e.readSync=typeof e.readSync!="function"?e.readSync:(function(l){return function(d,p,f,h,g){for(var y=0;;)try{return l.call(e,d,p,f,h,g)}catch($){if($.code==="EAGAIN"&&y<10){y++;continue}throw $}}})(e.readSync);function t(l){l.lchmod=function(d,p,f){l.open(d,Er.O_WRONLY|Er.O_SYMLINK,p,function(h,g){if(h){f&&f(h);return}l.fchmod(g,p,function(y){l.close(g,function($){f&&f(y||$)})})})},l.lchmodSync=function(d,p){var f=l.openSync(d,Er.O_WRONLY|Er.O_SYMLINK,p),h=!0,g;try{g=l.fchmodSync(f,p),h=!1}finally{if(h)try{l.closeSync(f)}catch{}else l.closeSync(f)}return g}}function r(l){Er.hasOwnProperty("O_SYMLINK")&&l.futimes?(l.lutimes=function(d,p,f,h){l.open(d,Er.O_SYMLINK,function(g,y){if(g){h&&h(g);return}l.futimes(y,p,f,function($){l.close(y,function(P){h&&h($||P)})})})},l.lutimesSync=function(d,p,f){var h=l.openSync(d,Er.O_SYMLINK),g,y=!0;try{g=l.futimesSync(h,p,f),y=!1}finally{if(y)try{l.closeSync(h)}catch{}else l.closeSync(h)}return g}):l.futimes&&(l.lutimes=function(d,p,f,h){h&&process.nextTick(h)},l.lutimesSync=function(){})}function n(l){return l&&function(d,p,f){return l.call(e,d,p,function(h){u(h)&&(h=null),f&&f.apply(this,arguments)})}}function i(l){return l&&function(d,p){try{return l.call(e,d,p)}catch(f){if(!u(f))throw f}}}function o(l){return l&&function(d,p,f,h){return l.call(e,d,p,f,function(g){u(g)&&(g=null),h&&h.apply(this,arguments)})}}function a(l){return l&&function(d,p,f){try{return l.call(e,d,p,f)}catch(h){if(!u(h))throw h}}}function s(l){return l&&function(d,p,f){typeof p=="function"&&(f=p,p=null);function h(g,y){y&&(y.uid<0&&(y.uid+=4294967296),y.gid<0&&(y.gid+=4294967296)),f&&f.apply(this,arguments)}return p?l.call(e,d,p,h):l.call(e,d,h)}}function c(l){return l&&function(d,p){var f=p?l.call(e,d,p):l.call(e,d);return f&&(f.uid<0&&(f.uid+=4294967296),f.gid<0&&(f.gid+=4294967296)),f}}function u(l){if(!l||l.code==="ENOSYS")return!0;var d=!process.getuid||process.getuid()!==0;return!!(d&&(l.code==="EINVAL"||l.code==="EPERM"))}}});var E$=_(($2,T$)=>{var P$=Ee("stream").Stream;T$.exports=$O;function $O(e){return{ReadStream:t,WriteStream:r};function t(n,i){if(!(this instanceof t))return new t(n,i);P$.call(this);var o=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,i=i||{};for(var a=Object.keys(i),s=0,c=a.length;s<c;s++){var u=a[s];this[u]=i[u]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){o._read()});return}e.open(this.path,this.flags,this.mode,function(l,d){if(l){o.emit("error",l),o.readable=!1;return}o.fd=d,o.emit("open",d),o._read()})}function r(n,i){if(!(this instanceof r))return new r(n,i);P$.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,i=i||{};for(var o=Object.keys(i),a=0,s=o.length;a<s;a++){var c=o[a];this[c]=i[c]}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}});var O$=_((b2,j$)=>{"use strict";j$.exports=xO;var bO=Object.getPrototypeOf||function(e){return e.__proto__};function xO(e){if(e===null||typeof e!="object")return e;if(e instanceof Object)var t={__proto__:bO(e)};else var t=Object.create(null);return Object.getOwnPropertyNames(e).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))}),t}});var Hn=_((x2,im)=>{var xe=Ee("fs"),kO=I$(),wO=E$(),SO=O$(),ic=Ee("util"),Me,ac;typeof Symbol=="function"&&typeof Symbol.for=="function"?(Me=Symbol.for("graceful-fs.queue"),ac=Symbol.for("graceful-fs.previous")):(Me="___graceful-fs.queue",ac="___graceful-fs.previous");function zO(){}function Z$(e,t){Object.defineProperty(e,Me,{get:function(){return t}})}var tn=zO;ic.debuglog?tn=ic.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(tn=function(){var e=ic.format.apply(ic,arguments);e="GFS4: "+e.split(/\n/).join(`
|
|
10
|
+
GFS4: `),console.error(e)});xe[Me]||(N$=global[Me]||[],Z$(xe,N$),xe.close=(function(e){function t(r,n){return e.call(xe,r,function(i){i||D$(),typeof n=="function"&&n.apply(this,arguments)})}return Object.defineProperty(t,ac,{value:e}),t})(xe.close),xe.closeSync=(function(e){function t(r){e.apply(xe,arguments),D$()}return Object.defineProperty(t,ac,{value:e}),t})(xe.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){tn(xe[Me]),Ee("assert").equal(xe[Me].length,0)}));var N$;global[Me]||Z$(global,xe[Me]);im.exports=rm(SO(xe));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!xe.__patched&&(im.exports=rm(xe),xe.__patched=!0);function rm(e){kO(e),e.gracefulify=rm,e.createReadStream=j,e.createWriteStream=ot;var t=e.readFile;e.readFile=r;function r(C,ee,te){return typeof ee=="function"&&(te=ee,ee=null),Se(C,ee,te);function Se(ze,Ie,be,ke){return t(ze,Ie,function(me){me&&(me.code==="EMFILE"||me.code==="ENFILE")?Gn([Se,[ze,Ie,be],me,ke||Date.now(),Date.now()]):typeof be=="function"&&be.apply(this,arguments)})}}var n=e.writeFile;e.writeFile=i;function i(C,ee,te,Se){return typeof te=="function"&&(Se=te,te=null),ze(C,ee,te,Se);function ze(Ie,be,ke,me,Ne){return n(Ie,be,ke,function($e){$e&&($e.code==="EMFILE"||$e.code==="ENFILE")?Gn([ze,[Ie,be,ke,me],$e,Ne||Date.now(),Date.now()]):typeof me=="function"&&me.apply(this,arguments)})}}var o=e.appendFile;o&&(e.appendFile=a);function a(C,ee,te,Se){return typeof te=="function"&&(Se=te,te=null),ze(C,ee,te,Se);function ze(Ie,be,ke,me,Ne){return o(Ie,be,ke,function($e){$e&&($e.code==="EMFILE"||$e.code==="ENFILE")?Gn([ze,[Ie,be,ke,me],$e,Ne||Date.now(),Date.now()]):typeof me=="function"&&me.apply(this,arguments)})}}var s=e.copyFile;s&&(e.copyFile=c);function c(C,ee,te,Se){return typeof te=="function"&&(Se=te,te=0),ze(C,ee,te,Se);function ze(Ie,be,ke,me,Ne){return s(Ie,be,ke,function($e){$e&&($e.code==="EMFILE"||$e.code==="ENFILE")?Gn([ze,[Ie,be,ke,me],$e,Ne||Date.now(),Date.now()]):typeof me=="function"&&me.apply(this,arguments)})}}var u=e.readdir;e.readdir=d;var l=/^v[0-5]\./;function d(C,ee,te){typeof ee=="function"&&(te=ee,ee=null);var Se=l.test(process.version)?function(be,ke,me,Ne){return u(be,ze(be,ke,me,Ne))}:function(be,ke,me,Ne){return u(be,ke,ze(be,ke,me,Ne))};return Se(C,ee,te);function ze(Ie,be,ke,me){return function(Ne,$e){Ne&&(Ne.code==="EMFILE"||Ne.code==="ENFILE")?Gn([Se,[Ie,be,ke],Ne,me||Date.now(),Date.now()]):($e&&$e.sort&&$e.sort(),typeof ke=="function"&&ke.call(this,Ne,$e))}}}if(process.version.substr(0,4)==="v0.8"){var p=wO(e);$=p.ReadStream,k=p.WriteStream}var f=e.ReadStream;f&&($.prototype=Object.create(f.prototype),$.prototype.open=P);var h=e.WriteStream;h&&(k.prototype=Object.create(h.prototype),k.prototype.open=N),Object.defineProperty(e,"ReadStream",{get:function(){return $},set:function(C){$=C},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return k},set:function(C){k=C},enumerable:!0,configurable:!0});var g=$;Object.defineProperty(e,"FileReadStream",{get:function(){return g},set:function(C){g=C},enumerable:!0,configurable:!0});var y=k;Object.defineProperty(e,"FileWriteStream",{get:function(){return y},set:function(C){y=C},enumerable:!0,configurable:!0});function $(C,ee){return this instanceof $?(f.apply(this,arguments),this):$.apply(Object.create($.prototype),arguments)}function P(){var C=this;Zr(C.path,C.flags,C.mode,function(ee,te){ee?(C.autoClose&&C.destroy(),C.emit("error",ee)):(C.fd=te,C.emit("open",te),C.read())})}function k(C,ee){return this instanceof k?(h.apply(this,arguments),this):k.apply(Object.create(k.prototype),arguments)}function N(){var C=this;Zr(C.path,C.flags,C.mode,function(ee,te){ee?(C.destroy(),C.emit("error",ee)):(C.fd=te,C.emit("open",te))})}function j(C,ee){return new e.ReadStream(C,ee)}function ot(C,ee){return new e.WriteStream(C,ee)}var ft=e.open;e.open=Zr;function Zr(C,ee,te,Se){return typeof te=="function"&&(Se=te,te=null),ze(C,ee,te,Se);function ze(Ie,be,ke,me,Ne){return ft(Ie,be,ke,function($e,k4){$e&&($e.code==="EMFILE"||$e.code==="ENFILE")?Gn([ze,[Ie,be,ke,me],$e,Ne||Date.now(),Date.now()]):typeof me=="function"&&me.apply(this,arguments)})}}return e}function Gn(e){tn("ENQUEUE",e[0].name,e[1]),xe[Me].push(e),nm()}var oc;function D$(){for(var e=Date.now(),t=0;t<xe[Me].length;++t)xe[Me][t].length>2&&(xe[Me][t][3]=e,xe[Me][t][4]=e);nm()}function nm(){if(clearTimeout(oc),oc=void 0,xe[Me].length!==0){var e=xe[Me].shift(),t=e[0],r=e[1],n=e[2],i=e[3],o=e[4];if(i===void 0)tn("RETRY",t.name,r),t.apply(null,r);else if(Date.now()-i>=6e4){tn("TIMEOUT",t.name,r);var a=r.pop();typeof a=="function"&&a.call(null,n)}else{var s=Date.now()-o,c=Math.max(o-i,1),u=Math.min(c*1.2,100);s>=u?(tn("RETRY",t.name,r),t.apply(null,r.concat([i]))):xe[Me].push(e)}oc===void 0&&(oc=setTimeout(nm,0))}}});var rt=_(ur=>{"use strict";var R$=je().fromCallback,tt=Hn(),IO=["access","appendFile","chmod","chown","close","copyFile","cp","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","glob","lchmod","lchown","lutimes","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","statfs","symlink","truncate","unlink","utimes","writeFile"].filter(e=>typeof tt[e]=="function");Object.assign(ur,tt);IO.forEach(e=>{ur[e]=R$(tt[e])});ur.exists=function(e,t){return typeof t=="function"?tt.exists(e,t):new Promise(r=>tt.exists(e,r))};ur.read=function(e,t,r,n,i,o){return typeof o=="function"?tt.read(e,t,r,n,i,o):new Promise((a,s)=>{tt.read(e,t,r,n,i,(c,u,l)=>{if(c)return s(c);a({bytesRead:u,buffer:l})})})};ur.write=function(e,t,...r){return typeof r[r.length-1]=="function"?tt.write(e,t,...r):new Promise((n,i)=>{tt.write(e,t,...r,(o,a,s)=>{if(o)return i(o);n({bytesWritten:a,buffer:s})})})};ur.readv=function(e,t,...r){return typeof r[r.length-1]=="function"?tt.readv(e,t,...r):new Promise((n,i)=>{tt.readv(e,t,...r,(o,a,s)=>{if(o)return i(o);n({bytesRead:a,buffers:s})})})};ur.writev=function(e,t,...r){return typeof r[r.length-1]=="function"?tt.writev(e,t,...r):new Promise((n,i)=>{tt.writev(e,t,...r,(o,a,s)=>{if(o)return i(o);n({bytesWritten:a,buffers:s})})})};typeof tt.realpath.native=="function"?ur.realpath.native=R$(tt.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")});var U$=_((w2,A$)=>{"use strict";var PO=Ee("path");A$.exports.checkPath=function(t){if(process.platform==="win32"&&/[<>:"|?*]/.test(t.replace(PO.parse(t).root,""))){let n=new Error(`Path contains invalid characters: ${t}`);throw n.code="EINVAL",n}}});var L$=_((S2,om)=>{"use strict";var C$=rt(),{checkPath:M$}=U$(),q$=e=>{let t={mode:511};return typeof e=="number"?e:{...t,...e}.mode};om.exports.makeDir=async(e,t)=>(M$(e),C$.mkdir(e,{mode:q$(t),recursive:!0}));om.exports.makeDirSync=(e,t)=>(M$(e),C$.mkdirSync(e,{mode:q$(t),recursive:!0}))});var At=_((z2,F$)=>{"use strict";var TO=je().fromPromise,{makeDir:EO,makeDirSync:am}=L$(),sm=TO(EO);F$.exports={mkdirs:sm,mkdirsSync:am,mkdirp:sm,mkdirpSync:am,ensureDir:sm,ensureDirSync:am}});var jr=_((I2,J$)=>{"use strict";var jO=je().fromPromise,V$=rt();function OO(e){return V$.access(e).then(()=>!0).catch(()=>!1)}J$.exports={pathExists:jO(OO),pathExistsSync:V$.existsSync}});var cm=_((P2,K$)=>{"use strict";var Xn=rt(),NO=je().fromPromise;async function DO(e,t,r){let n=await Xn.open(e,"r+"),i=null;try{await Xn.futimes(n,t,r)}finally{try{await Xn.close(n)}catch(o){i=o}}if(i)throw i}function ZO(e,t,r){let n=Xn.openSync(e,"r+");return Xn.futimesSync(n,t,r),Xn.closeSync(n)}K$.exports={utimesMillis:NO(DO),utimesMillisSync:ZO}});var rn=_((T2,H$)=>{"use strict";var Yn=rt(),Oe=Ee("path"),B$=je().fromPromise;function RO(e,t,r){let n=r.dereference?i=>Yn.stat(i,{bigint:!0}):i=>Yn.lstat(i,{bigint:!0});return Promise.all([n(e),n(t).catch(i=>{if(i.code==="ENOENT")return null;throw i})]).then(([i,o])=>({srcStat:i,destStat:o}))}function AO(e,t,r){let n,i=r.dereference?a=>Yn.statSync(a,{bigint:!0}):a=>Yn.lstatSync(a,{bigint:!0}),o=i(e);try{n=i(t)}catch(a){if(a.code==="ENOENT")return{srcStat:o,destStat:null};throw a}return{srcStat:o,destStat:n}}async function UO(e,t,r,n){let{srcStat:i,destStat:o}=await RO(e,t,n);if(o){if(qo(i,o)){let a=Oe.basename(e),s=Oe.basename(t);if(r==="move"&&a!==s&&a.toLowerCase()===s.toLowerCase())return{srcStat:i,destStat:o,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(i.isDirectory()&&!o.isDirectory())throw new Error(`Cannot overwrite non-directory '${t}' with directory '${e}'.`);if(!i.isDirectory()&&o.isDirectory())throw new Error(`Cannot overwrite directory '${t}' with non-directory '${e}'.`)}if(i.isDirectory()&&um(e,t))throw new Error(sc(e,t,r));return{srcStat:i,destStat:o}}function CO(e,t,r,n){let{srcStat:i,destStat:o}=AO(e,t,n);if(o){if(qo(i,o)){let a=Oe.basename(e),s=Oe.basename(t);if(r==="move"&&a!==s&&a.toLowerCase()===s.toLowerCase())return{srcStat:i,destStat:o,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(i.isDirectory()&&!o.isDirectory())throw new Error(`Cannot overwrite non-directory '${t}' with directory '${e}'.`);if(!i.isDirectory()&&o.isDirectory())throw new Error(`Cannot overwrite directory '${t}' with non-directory '${e}'.`)}if(i.isDirectory()&&um(e,t))throw new Error(sc(e,t,r));return{srcStat:i,destStat:o}}async function W$(e,t,r,n){let i=Oe.resolve(Oe.dirname(e)),o=Oe.resolve(Oe.dirname(r));if(o===i||o===Oe.parse(o).root)return;let a;try{a=await Yn.stat(o,{bigint:!0})}catch(s){if(s.code==="ENOENT")return;throw s}if(qo(t,a))throw new Error(sc(e,r,n));return W$(e,t,o,n)}function G$(e,t,r,n){let i=Oe.resolve(Oe.dirname(e)),o=Oe.resolve(Oe.dirname(r));if(o===i||o===Oe.parse(o).root)return;let a;try{a=Yn.statSync(o,{bigint:!0})}catch(s){if(s.code==="ENOENT")return;throw s}if(qo(t,a))throw new Error(sc(e,r,n));return G$(e,t,o,n)}function qo(e,t){return t.ino!==void 0&&t.dev!==void 0&&t.ino===e.ino&&t.dev===e.dev}function um(e,t){let r=Oe.resolve(e).split(Oe.sep).filter(i=>i),n=Oe.resolve(t).split(Oe.sep).filter(i=>i);return r.every((i,o)=>n[o]===i)}function sc(e,t,r){return`Cannot ${r} '${e}' to a subdirectory of itself, '${t}'.`}H$.exports={checkPaths:B$(UO),checkPathsSync:CO,checkParentPaths:B$(W$),checkParentPathsSync:G$,isSrcSubdir:um,areIdentical:qo}});var Y$=_((E2,X$)=>{"use strict";async function MO(e,t){let r=[];for await(let n of e)r.push(t(n).then(()=>null,i=>i??new Error("unknown error")));await Promise.all(r.map(n=>n.then(i=>{if(i!==null)throw i})))}X$.exports={asyncIteratorConcurrentProcess:MO}});var nb=_((j2,rb)=>{"use strict";var Be=rt(),Lo=Ee("path"),{mkdirs:qO}=At(),{pathExists:LO}=jr(),{utimesMillis:FO}=cm(),Fo=rn(),{asyncIteratorConcurrentProcess:VO}=Y$();async function JO(e,t,r={}){typeof r=="function"&&(r={filter:r}),r.clobber="clobber"in r?!!r.clobber:!0,r.overwrite="overwrite"in r?!!r.overwrite:r.clobber,r.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
|
|
11
|
+
|
|
12
|
+
see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0001");let{srcStat:n,destStat:i}=await Fo.checkPaths(e,t,"copy",r);if(await Fo.checkParentPaths(e,n,t,"copy"),!await eb(e,t,r))return;let a=Lo.dirname(t);await LO(a)||await qO(a),await tb(i,e,t,r)}async function eb(e,t,r){return r.filter?r.filter(e,t):!0}async function tb(e,t,r,n){let o=await(n.dereference?Be.stat:Be.lstat)(t);if(o.isDirectory())return GO(o,e,t,r,n);if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return KO(o,e,t,r,n);if(o.isSymbolicLink())return HO(e,t,r,n);throw o.isSocket()?new Error(`Cannot copy a socket file: ${t}`):o.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${t}`):new Error(`Unknown file: ${t}`)}async function KO(e,t,r,n,i){if(!t)return Q$(e,r,n,i);if(i.overwrite)return await Be.unlink(n),Q$(e,r,n,i);if(i.errorOnExist)throw new Error(`'${n}' already exists`)}async function Q$(e,t,r,n){if(await Be.copyFile(t,r),n.preserveTimestamps){BO(e.mode)&&await WO(r,e.mode);let i=await Be.stat(t);await FO(r,i.atime,i.mtime)}return Be.chmod(r,e.mode)}function BO(e){return(e&128)===0}function WO(e,t){return Be.chmod(e,t|128)}async function GO(e,t,r,n,i){t||await Be.mkdir(n),await VO(await Be.opendir(r),async o=>{let a=Lo.join(r,o.name),s=Lo.join(n,o.name);if(await eb(a,s,i)){let{destStat:u}=await Fo.checkPaths(a,s,"copy",i);await tb(u,a,s,i)}}),t||await Be.chmod(n,e.mode)}async function HO(e,t,r,n){let i=await Be.readlink(t);if(n.dereference&&(i=Lo.resolve(process.cwd(),i)),!e)return Be.symlink(i,r);let o=null;try{o=await Be.readlink(r)}catch(a){if(a.code==="EINVAL"||a.code==="UNKNOWN")return Be.symlink(i,r);throw a}if(n.dereference&&(o=Lo.resolve(process.cwd(),o)),i!==o){if(Fo.isSrcSubdir(i,o))throw new Error(`Cannot copy '${i}' to a subdirectory of itself, '${o}'.`);if(Fo.isSrcSubdir(o,i))throw new Error(`Cannot overwrite '${o}' with '${i}'.`)}return await Be.unlink(r),Be.symlink(i,r)}rb.exports=JO});var cb=_((O2,sb)=>{"use strict";var nt=Hn(),Vo=Ee("path"),XO=At().mkdirsSync,YO=cm().utimesMillisSync,Jo=rn();function QO(e,t,r){typeof r=="function"&&(r={filter:r}),r=r||{},r.clobber="clobber"in r?!!r.clobber:!0,r.overwrite="overwrite"in r?!!r.overwrite:r.clobber,r.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
|
|
13
|
+
|
|
14
|
+
see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0002");let{srcStat:n,destStat:i}=Jo.checkPathsSync(e,t,"copy",r);if(Jo.checkParentPathsSync(e,n,t,"copy"),r.filter&&!r.filter(e,t))return;let o=Vo.dirname(t);return nt.existsSync(o)||XO(o),ib(i,e,t,r)}function ib(e,t,r,n){let o=(n.dereference?nt.statSync:nt.lstatSync)(t);if(o.isDirectory())return aN(o,e,t,r,n);if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return eN(o,e,t,r,n);if(o.isSymbolicLink())return uN(e,t,r,n);throw o.isSocket()?new Error(`Cannot copy a socket file: ${t}`):o.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${t}`):new Error(`Unknown file: ${t}`)}function eN(e,t,r,n,i){return t?tN(e,r,n,i):ob(e,r,n,i)}function tN(e,t,r,n){if(n.overwrite)return nt.unlinkSync(r),ob(e,t,r,n);if(n.errorOnExist)throw new Error(`'${r}' already exists`)}function ob(e,t,r,n){return nt.copyFileSync(t,r),n.preserveTimestamps&&rN(e.mode,t,r),lm(r,e.mode)}function rN(e,t,r){return nN(e)&&iN(r,e),oN(t,r)}function nN(e){return(e&128)===0}function iN(e,t){return lm(e,t|128)}function lm(e,t){return nt.chmodSync(e,t)}function oN(e,t){let r=nt.statSync(e);return YO(t,r.atime,r.mtime)}function aN(e,t,r,n,i){return t?ab(r,n,i):sN(e.mode,r,n,i)}function sN(e,t,r,n){return nt.mkdirSync(r),ab(t,r,n),lm(r,e)}function ab(e,t,r){let n=nt.opendirSync(e);try{let i;for(;(i=n.readSync())!==null;)cN(i.name,e,t,r)}finally{n.closeSync()}}function cN(e,t,r,n){let i=Vo.join(t,e),o=Vo.join(r,e);if(n.filter&&!n.filter(i,o))return;let{destStat:a}=Jo.checkPathsSync(i,o,"copy",n);return ib(a,i,o,n)}function uN(e,t,r,n){let i=nt.readlinkSync(t);if(n.dereference&&(i=Vo.resolve(process.cwd(),i)),e){let o;try{o=nt.readlinkSync(r)}catch(a){if(a.code==="EINVAL"||a.code==="UNKNOWN")return nt.symlinkSync(i,r);throw a}if(n.dereference&&(o=Vo.resolve(process.cwd(),o)),i!==o){if(Jo.isSrcSubdir(i,o))throw new Error(`Cannot copy '${i}' to a subdirectory of itself, '${o}'.`);if(Jo.isSrcSubdir(o,i))throw new Error(`Cannot overwrite '${o}' with '${i}'.`)}return lN(i,r)}else return nt.symlinkSync(i,r)}function lN(e,t){return nt.unlinkSync(t),nt.symlinkSync(e,t)}sb.exports=QO});var cc=_((N2,ub)=>{"use strict";var dN=je().fromPromise;ub.exports={copy:dN(nb()),copySync:cb()}});var Ko=_((D2,db)=>{"use strict";var lb=Hn(),fN=je().fromCallback;function pN(e,t){lb.rm(e,{recursive:!0,force:!0},t)}function mN(e){lb.rmSync(e,{recursive:!0,force:!0})}db.exports={remove:fN(pN),removeSync:mN}});var _b=_((Z2,yb)=>{"use strict";var hN=je().fromPromise,mb=rt(),hb=Ee("path"),gb=At(),vb=Ko(),fb=hN(async function(t){let r;try{r=await mb.readdir(t)}catch{return gb.mkdirs(t)}return Promise.all(r.map(n=>vb.remove(hb.join(t,n))))});function pb(e){let t;try{t=mb.readdirSync(e)}catch{return gb.mkdirsSync(e)}t.forEach(r=>{r=hb.join(e,r),vb.removeSync(r)})}yb.exports={emptyDirSync:pb,emptydirSync:pb,emptyDir:fb,emptydir:fb}});var kb=_((R2,xb)=>{"use strict";var gN=je().fromPromise,$b=Ee("path"),lr=rt(),bb=At();async function vN(e){let t;try{t=await lr.stat(e)}catch{}if(t&&t.isFile())return;let r=$b.dirname(e),n=null;try{n=await lr.stat(r)}catch(i){if(i.code==="ENOENT"){await bb.mkdirs(r),await lr.writeFile(e,"");return}else throw i}n.isDirectory()?await lr.writeFile(e,""):await lr.readdir(r)}function yN(e){let t;try{t=lr.statSync(e)}catch{}if(t&&t.isFile())return;let r=$b.dirname(e);try{lr.statSync(r).isDirectory()||lr.readdirSync(r)}catch(n){if(n&&n.code==="ENOENT")bb.mkdirsSync(r);else throw n}lr.writeFileSync(e,"")}xb.exports={createFile:gN(vN),createFileSync:yN}});var Pb=_((A2,Ib)=>{"use strict";var _N=je().fromPromise,wb=Ee("path"),Or=rt(),Sb=At(),{pathExists:$N}=jr(),{areIdentical:zb}=rn();async function bN(e,t){let r;try{r=await Or.lstat(t)}catch{}let n;try{n=await Or.lstat(e)}catch(a){throw a.message=a.message.replace("lstat","ensureLink"),a}if(r&&zb(n,r))return;let i=wb.dirname(t);await $N(i)||await Sb.mkdirs(i),await Or.link(e,t)}function xN(e,t){let r;try{r=Or.lstatSync(t)}catch{}try{let o=Or.lstatSync(e);if(r&&zb(o,r))return}catch(o){throw o.message=o.message.replace("lstat","ensureLink"),o}let n=wb.dirname(t);return Or.existsSync(n)||Sb.mkdirsSync(n),Or.linkSync(e,t)}Ib.exports={createLink:_N(bN),createLinkSync:xN}});var Eb=_((U2,Tb)=>{"use strict";var Nr=Ee("path"),Bo=rt(),{pathExists:kN}=jr(),wN=je().fromPromise;async function SN(e,t){if(Nr.isAbsolute(e)){try{await Bo.lstat(e)}catch(o){throw o.message=o.message.replace("lstat","ensureSymlink"),o}return{toCwd:e,toDst:e}}let r=Nr.dirname(t),n=Nr.join(r,e);if(await kN(n))return{toCwd:n,toDst:e};try{await Bo.lstat(e)}catch(o){throw o.message=o.message.replace("lstat","ensureSymlink"),o}return{toCwd:e,toDst:Nr.relative(r,e)}}function zN(e,t){if(Nr.isAbsolute(e)){if(!Bo.existsSync(e))throw new Error("absolute srcpath does not exist");return{toCwd:e,toDst:e}}let r=Nr.dirname(t),n=Nr.join(r,e);if(Bo.existsSync(n))return{toCwd:n,toDst:e};if(!Bo.existsSync(e))throw new Error("relative srcpath does not exist");return{toCwd:e,toDst:Nr.relative(r,e)}}Tb.exports={symlinkPaths:wN(SN),symlinkPathsSync:zN}});var Nb=_((C2,Ob)=>{"use strict";var jb=rt(),IN=je().fromPromise;async function PN(e,t){if(t)return t;let r;try{r=await jb.lstat(e)}catch{return"file"}return r&&r.isDirectory()?"dir":"file"}function TN(e,t){if(t)return t;let r;try{r=jb.lstatSync(e)}catch{return"file"}return r&&r.isDirectory()?"dir":"file"}Ob.exports={symlinkType:IN(PN),symlinkTypeSync:TN}});var Rb=_((M2,Zb)=>{"use strict";var EN=je().fromPromise,Dr=Ee("path"),dt=rt(),{mkdirs:jN,mkdirsSync:ON}=At(),{symlinkPaths:NN,symlinkPathsSync:DN}=Eb(),{symlinkType:ZN,symlinkTypeSync:RN}=Nb(),{pathExists:AN}=jr(),{areIdentical:Db}=rn();async function UN(e,t,r){let n;try{n=await dt.lstat(t)}catch{}if(n&&n.isSymbolicLink()){let s;if(Dr.isAbsolute(e))s=await dt.stat(e);else{let u=Dr.dirname(t),l=Dr.join(u,e);try{s=await dt.stat(l)}catch{s=await dt.stat(e)}}let c=await dt.stat(t);if(Db(s,c))return}let i=await NN(e,t);e=i.toDst;let o=await ZN(i.toCwd,r),a=Dr.dirname(t);return await AN(a)||await jN(a),dt.symlink(e,t,o)}function CN(e,t,r){let n;try{n=dt.lstatSync(t)}catch{}if(n&&n.isSymbolicLink()){let s;if(Dr.isAbsolute(e))s=dt.statSync(e);else{let u=Dr.dirname(t),l=Dr.join(u,e);try{s=dt.statSync(l)}catch{s=dt.statSync(e)}}let c=dt.statSync(t);if(Db(s,c))return}let i=DN(e,t);e=i.toDst,r=RN(i.toCwd,r);let o=Dr.dirname(t);return dt.existsSync(o)||ON(o),dt.symlinkSync(e,t,r)}Zb.exports={createSymlink:EN(UN),createSymlinkSync:CN}});var Vb=_((q2,Fb)=>{"use strict";var{createFile:Ab,createFileSync:Ub}=kb(),{createLink:Cb,createLinkSync:Mb}=Pb(),{createSymlink:qb,createSymlinkSync:Lb}=Rb();Fb.exports={createFile:Ab,createFileSync:Ub,ensureFile:Ab,ensureFileSync:Ub,createLink:Cb,createLinkSync:Mb,ensureLink:Cb,ensureLinkSync:Mb,createSymlink:qb,createSymlinkSync:Lb,ensureSymlink:qb,ensureSymlinkSync:Lb}});var uc=_((L2,Jb)=>{function MN(e,{EOL:t=`
|
|
15
|
+
`,finalEOL:r=!0,replacer:n=null,spaces:i}={}){let o=r?t:"";return JSON.stringify(e,n,i).replace(/\n/g,t)+o}function qN(e){return Buffer.isBuffer(e)&&(e=e.toString("utf8")),e.replace(/^\uFEFF/,"")}Jb.exports={stringify:MN,stripBom:qN}});var Gb=_((F2,Wb)=>{var Qn;try{Qn=Hn()}catch{Qn=Ee("fs")}var lc=je(),{stringify:Kb,stripBom:Bb}=uc();async function LN(e,t={}){typeof t=="string"&&(t={encoding:t});let r=t.fs||Qn,n="throws"in t?t.throws:!0,i=await lc.fromCallback(r.readFile)(e,t);i=Bb(i);let o;try{o=JSON.parse(i,t?t.reviver:null)}catch(a){if(n)throw a.message=`${e}: ${a.message}`,a;return null}return o}var FN=lc.fromPromise(LN);function VN(e,t={}){typeof t=="string"&&(t={encoding:t});let r=t.fs||Qn,n="throws"in t?t.throws:!0;try{let i=r.readFileSync(e,t);return i=Bb(i),JSON.parse(i,t.reviver)}catch(i){if(n)throw i.message=`${e}: ${i.message}`,i;return null}}async function JN(e,t,r={}){let n=r.fs||Qn,i=Kb(t,r);await lc.fromCallback(n.writeFile)(e,i,r)}var KN=lc.fromPromise(JN);function BN(e,t,r={}){let n=r.fs||Qn,i=Kb(t,r);return n.writeFileSync(e,i,r)}Wb.exports={readFile:FN,readFileSync:VN,writeFile:KN,writeFileSync:BN}});var Xb=_((V2,Hb)=>{"use strict";var dc=Gb();Hb.exports={readJson:dc.readFile,readJsonSync:dc.readFileSync,writeJson:dc.writeFile,writeJsonSync:dc.writeFileSync}});var fc=_((J2,ex)=>{"use strict";var WN=je().fromPromise,dm=rt(),Yb=Ee("path"),Qb=At(),GN=jr().pathExists;async function HN(e,t,r="utf-8"){let n=Yb.dirname(e);return await GN(n)||await Qb.mkdirs(n),dm.writeFile(e,t,r)}function XN(e,...t){let r=Yb.dirname(e);dm.existsSync(r)||Qb.mkdirsSync(r),dm.writeFileSync(e,...t)}ex.exports={outputFile:WN(HN),outputFileSync:XN}});var rx=_((K2,tx)=>{"use strict";var{stringify:YN}=uc(),{outputFile:QN}=fc();async function e4(e,t,r={}){let n=YN(t,r);await QN(e,n,r)}tx.exports=e4});var ix=_((B2,nx)=>{"use strict";var{stringify:t4}=uc(),{outputFileSync:r4}=fc();function n4(e,t,r){let n=t4(t,r);r4(e,n,r)}nx.exports=n4});var ax=_((W2,ox)=>{"use strict";var i4=je().fromPromise,it=Xb();it.outputJson=i4(rx());it.outputJsonSync=ix();it.outputJSON=it.outputJson;it.outputJSONSync=it.outputJsonSync;it.writeJSON=it.writeJson;it.writeJSONSync=it.writeJsonSync;it.readJSON=it.readJson;it.readJSONSync=it.readJsonSync;ox.exports=it});var dx=_((G2,lx)=>{"use strict";var o4=rt(),sx=Ee("path"),{copy:a4}=cc(),{remove:ux}=Ko(),{mkdirp:s4}=At(),{pathExists:c4}=jr(),cx=rn();async function u4(e,t,r={}){let n=r.overwrite||r.clobber||!1,{srcStat:i,isChangingCase:o=!1}=await cx.checkPaths(e,t,"move",r);await cx.checkParentPaths(e,i,t,"move");let a=sx.dirname(t);return sx.parse(a).root!==a&&await s4(a),l4(e,t,n,o)}async function l4(e,t,r,n){if(!n){if(r)await ux(t);else if(await c4(t))throw new Error("dest already exists.")}try{await o4.rename(e,t)}catch(i){if(i.code!=="EXDEV")throw i;await d4(e,t,r)}}async function d4(e,t,r){return await a4(e,t,{overwrite:r,errorOnExist:!0,preserveTimestamps:!0}),ux(e)}lx.exports=u4});var gx=_((H2,hx)=>{"use strict";var px=Hn(),pm=Ee("path"),f4=cc().copySync,mx=Ko().removeSync,p4=At().mkdirpSync,fx=rn();function m4(e,t,r){r=r||{};let n=r.overwrite||r.clobber||!1,{srcStat:i,isChangingCase:o=!1}=fx.checkPathsSync(e,t,"move",r);return fx.checkParentPathsSync(e,i,t,"move"),h4(t)||p4(pm.dirname(t)),g4(e,t,n,o)}function h4(e){let t=pm.dirname(e);return pm.parse(t).root===t}function g4(e,t,r,n){if(n)return fm(e,t,r);if(r)return mx(t),fm(e,t,r);if(px.existsSync(t))throw new Error("dest already exists.");return fm(e,t,r)}function fm(e,t,r){try{px.renameSync(e,t)}catch(n){if(n.code!=="EXDEV")throw n;return v4(e,t,r)}}function v4(e,t,r){return f4(e,t,{overwrite:r,errorOnExist:!0,preserveTimestamps:!0}),mx(e)}hx.exports=m4});var yx=_((X2,vx)=>{"use strict";var y4=je().fromPromise;vx.exports={move:y4(dx()),moveSync:gx()}});var $x=_((Y2,_x)=>{"use strict";_x.exports={...rt(),...cc(),..._b(),...Vb(),...ax(),...At(),...yx(),...fc(),...jr(),...Ko()}});var Y;(function(e){e.assertEqual=i=>{};function t(i){}e.assertIs=t;function r(i){throw new Error}e.assertNever=r,e.arrayToEnum=i=>{let o={};for(let a of i)o[a]=a;return o},e.getValidEnumValues=i=>{let o=e.objectKeys(i).filter(s=>typeof i[i[s]]!="number"),a={};for(let s of o)a[s]=i[s];return e.objectValues(a)},e.objectValues=i=>e.objectKeys(i).map(function(o){return i[o]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let o=[];for(let a in i)Object.prototype.hasOwnProperty.call(i,a)&&o.push(a);return o},e.find=(i,o)=>{for(let a of i)if(o(a))return a},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function n(i,o=" | "){return i.map(a=>typeof a=="string"?`'${a}'`:a).join(o)}e.joinValues=n,e.jsonStringifyReplacer=(i,o)=>typeof o=="bigint"?o.toString():o})(Y||(Y={}));var gm;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(gm||(gm={}));var z=Y.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Wt=e=>{switch(typeof e){case"undefined":return z.undefined;case"string":return z.string;case"number":return Number.isNaN(e)?z.nan:z.number;case"boolean":return z.boolean;case"function":return z.function;case"bigint":return z.bigint;case"symbol":return z.symbol;case"object":return Array.isArray(e)?z.array:e===null?z.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?z.promise:typeof Map<"u"&&e instanceof Map?z.map:typeof Set<"u"&&e instanceof Set?z.set:typeof Date<"u"&&e instanceof Date?z.date:z.object;default:return z.unknown}};var b=Y.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 pt=class e extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){let r=t||function(o){return o.message},n={_errors:[]},i=o=>{for(let a of o.issues)if(a.code==="invalid_union")a.unionErrors.map(i);else if(a.code==="invalid_return_type")i(a.returnTypeError);else if(a.code==="invalid_arguments")i(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 i(this),n}static assert(t){if(!(t instanceof e))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Y.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){let r=Object.create(null),n=[];for(let i of this.issues)if(i.path.length>0){let o=i.path[0];r[o]=r[o]||[],r[o].push(t(i))}else n.push(t(i));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};pt.create=e=>new pt(e);var Cx=(e,t)=>{let r;switch(e.code){case b.invalid_type:e.received===z.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case b.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,Y.jsonStringifyReplacer)}`;break;case b.unrecognized_keys:r=`Unrecognized key(s) in object: ${Y.joinValues(e.keys,", ")}`;break;case b.invalid_union:r="Invalid input";break;case b.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Y.joinValues(e.options)}`;break;case b.invalid_enum_value:r=`Invalid enum value. Expected ${Y.joinValues(e.options)}, received '${e.received}'`;break;case b.invalid_arguments:r="Invalid function arguments";break;case b.invalid_return_type:r="Invalid function return type";break;case b.invalid_date:r="Invalid date";break;case b.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:Y.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case b.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case b.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case b.custom:r="Invalid input";break;case b.invalid_intersection_types:r="Intersection results could not be merged";break;case b.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case b.not_finite:r="Number must be finite";break;default:r=t.defaultError,Y.assertNever(e)}return{message:r}},dr=Cx;var Mx=dr;function ri(){return Mx}var Go=e=>{let{data:t,path:r,errorMaps:n,issueData:i}=e,o=[...r,...i.path||[]],a={...i,path:o};if(i.message!==void 0)return{...i,path:o,message:i.message};let s="",c=n.filter(u=>!!u).slice().reverse();for(let u of c)s=u(a,{data:t,defaultError:s}).message;return{...i,path:o,message:s}};function w(e,t){let r=ri(),n=Go({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===dr?void 0:dr].filter(i=>!!i)});e.common.issues.push(n)}var qe=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){let n=[];for(let i of r){if(i.status==="aborted")return A;i.status==="dirty"&&t.dirty(),n.push(i.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){let n=[];for(let i of r){let o=await i.key,a=await i.value;n.push({key:o,value:a})}return e.mergeObjectSync(t,n)}static mergeObjectSync(t,r){let n={};for(let i of r){let{key:o,value:a}=i;if(o.status==="aborted"||a.status==="aborted")return A;o.status==="dirty"&&t.dirty(),a.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof a.value<"u"||i.alwaysSet)&&(n[o.value]=a.value)}return{status:t.value,value:n}}},A=Object.freeze({status:"aborted"}),nn=e=>({status:"dirty",value:e}),We=e=>({status:"valid",value:e}),hc=e=>e.status==="aborted",gc=e=>e.status==="dirty",Rr=e=>e.status==="valid",ni=e=>typeof Promise<"u"&&e instanceof Promise;var T;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(T||(T={}));var _t=class{constructor(t,r,n,i){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},vm=(e,t)=>{if(Rr(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new pt(e.common.issues);return this._error=r,this._error}}};function L(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:i}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(a,s)=>{let{message:c}=e;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:i}}var W=class{get description(){return this._def.description}_getType(t){return Wt(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:Wt(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new qe,ctx:{common:t.parent.common,data:t.data,parsedType:Wt(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(ni(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){let r=this._parse(t);return Promise.resolve(r)}parse(t,r){let n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){let n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Wt(t)},i=this._parseSync({data:t,path:n.path,parent:n});return vm(n,i)}"~validate"(t){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Wt(t)};if(!this["~standard"].async)try{let n=this._parseSync({data:t,path:[],parent:r});return Rr(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:r}).then(n=>Rr(n)?{value:n.value}:{issues:r.common.issues})}async parseAsync(t,r){let n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Wt(t)},i=this._parse({data:t,path:n.path,parent:n}),o=await(ni(i)?i:Promise.resolve(i));return vm(n,o)}refine(t,r){let n=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,o)=>{let a=t(i),s=()=>o.addIssue({code:b.custom,...n(i)});return typeof Promise<"u"&&a instanceof Promise?a.then(c=>c?!0:(s(),!1)):a?!0:(s(),!1)})}refinement(t,r){return this._refinement((n,i)=>t(n)?!0:(i.addIssue(typeof r=="function"?r(n,i):r),!1))}_refinement(t){return new Et({schema:this,typeName:D.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return Tt.create(this,this._def)}nullable(){return Xt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return pr.create(this)}promise(){return Ar.create(this,this._def)}or(t){return un.create([this,t],this._def)}and(t){return ln.create(this,t,this._def)}transform(t){return new Et({...L(this._def),schema:this,typeName:D.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new hn({...L(this._def),innerType:this,defaultValue:r,typeName:D.ZodDefault})}brand(){return new Ho({typeName:D.ZodBranded,type:this,...L(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new gn({...L(this._def),innerType:this,catchValue:r,typeName:D.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return Xo.create(this,t)}readonly(){return vn.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},qx=/^c[^\s-]{8,}$/i,Lx=/^[0-9a-z]+$/,Fx=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Vx=/^[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,Jx=/^[a-z0-9_-]{21}$/i,Kx=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Bx=/^[-+]?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)?)??$/,Wx=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Gx="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",vc,Hx=/^(?:(?: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])$/,Xx=/^(?:(?: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])$/,Yx=/^(([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]))$/,Qx=/^(([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])$/,ek=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,tk=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,ym="((\\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])))",rk=new RegExp(`^${ym}$`);function _m(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);let r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function nk(e){return new RegExp(`^${_m(e)}$`)}function ik(e){let t=`${ym}T${_m(e)}`,r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function ok(e,t){return!!((t==="v4"||!t)&&Hx.test(e)||(t==="v6"||!t)&&Yx.test(e))}function ak(e,t){if(!Kx.test(e))return!1;try{let[r]=e.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),i=JSON.parse(atob(n));return!(typeof i!="object"||i===null||"typ"in i&&i?.typ!=="JWT"||!i.alg||t&&i.alg!==t)}catch{return!1}}function sk(e,t){return!!((t==="v4"||!t)&&Xx.test(e)||(t==="v6"||!t)&&Qx.test(e))}var an=class e extends W{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==z.string){let o=this._getOrReturnCtx(t);return w(o,{code:b.invalid_type,expected:z.string,received:o.parsedType}),A}let n=new qe,i;for(let o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(i=this._getOrReturnCtx(t,i),w(i,{code:b.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="max")t.data.length>o.value&&(i=this._getOrReturnCtx(t,i),w(i,{code:b.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="length"){let a=t.data.length>o.value,s=t.data.length<o.value;(a||s)&&(i=this._getOrReturnCtx(t,i),a?w(i,{code:b.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):s&&w(i,{code:b.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),n.dirty())}else if(o.kind==="email")Wx.test(t.data)||(i=this._getOrReturnCtx(t,i),w(i,{validation:"email",code:b.invalid_string,message:o.message}),n.dirty());else if(o.kind==="emoji")vc||(vc=new RegExp(Gx,"u")),vc.test(t.data)||(i=this._getOrReturnCtx(t,i),w(i,{validation:"emoji",code:b.invalid_string,message:o.message}),n.dirty());else if(o.kind==="uuid")Vx.test(t.data)||(i=this._getOrReturnCtx(t,i),w(i,{validation:"uuid",code:b.invalid_string,message:o.message}),n.dirty());else if(o.kind==="nanoid")Jx.test(t.data)||(i=this._getOrReturnCtx(t,i),w(i,{validation:"nanoid",code:b.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid")qx.test(t.data)||(i=this._getOrReturnCtx(t,i),w(i,{validation:"cuid",code:b.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid2")Lx.test(t.data)||(i=this._getOrReturnCtx(t,i),w(i,{validation:"cuid2",code:b.invalid_string,message:o.message}),n.dirty());else if(o.kind==="ulid")Fx.test(t.data)||(i=this._getOrReturnCtx(t,i),w(i,{validation:"ulid",code:b.invalid_string,message:o.message}),n.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{i=this._getOrReturnCtx(t,i),w(i,{validation:"url",code:b.invalid_string,message:o.message}),n.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(t.data)||(i=this._getOrReturnCtx(t,i),w(i,{validation:"regex",code:b.invalid_string,message:o.message}),n.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="includes"?t.data.includes(o.value,o.position)||(i=this._getOrReturnCtx(t,i),w(i,{code:b.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),n.dirty()):o.kind==="toLowerCase"?t.data=t.data.toLowerCase():o.kind==="toUpperCase"?t.data=t.data.toUpperCase():o.kind==="startsWith"?t.data.startsWith(o.value)||(i=this._getOrReturnCtx(t,i),w(i,{code:b.invalid_string,validation:{startsWith:o.value},message:o.message}),n.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(i=this._getOrReturnCtx(t,i),w(i,{code:b.invalid_string,validation:{endsWith:o.value},message:o.message}),n.dirty()):o.kind==="datetime"?ik(o).test(t.data)||(i=this._getOrReturnCtx(t,i),w(i,{code:b.invalid_string,validation:"datetime",message:o.message}),n.dirty()):o.kind==="date"?rk.test(t.data)||(i=this._getOrReturnCtx(t,i),w(i,{code:b.invalid_string,validation:"date",message:o.message}),n.dirty()):o.kind==="time"?nk(o).test(t.data)||(i=this._getOrReturnCtx(t,i),w(i,{code:b.invalid_string,validation:"time",message:o.message}),n.dirty()):o.kind==="duration"?Bx.test(t.data)||(i=this._getOrReturnCtx(t,i),w(i,{validation:"duration",code:b.invalid_string,message:o.message}),n.dirty()):o.kind==="ip"?ok(t.data,o.version)||(i=this._getOrReturnCtx(t,i),w(i,{validation:"ip",code:b.invalid_string,message:o.message}),n.dirty()):o.kind==="jwt"?ak(t.data,o.alg)||(i=this._getOrReturnCtx(t,i),w(i,{validation:"jwt",code:b.invalid_string,message:o.message}),n.dirty()):o.kind==="cidr"?sk(t.data,o.version)||(i=this._getOrReturnCtx(t,i),w(i,{validation:"cidr",code:b.invalid_string,message:o.message}),n.dirty()):o.kind==="base64"?ek.test(t.data)||(i=this._getOrReturnCtx(t,i),w(i,{validation:"base64",code:b.invalid_string,message:o.message}),n.dirty()):o.kind==="base64url"?tk.test(t.data)||(i=this._getOrReturnCtx(t,i),w(i,{validation:"base64url",code:b.invalid_string,message:o.message}),n.dirty()):Y.assertNever(o);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(i=>t.test(i),{validation:r,code:b.invalid_string,...T.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...T.errToObj(t)})}url(t){return this._addCheck({kind:"url",...T.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...T.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...T.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...T.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...T.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...T.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...T.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...T.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...T.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...T.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...T.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...T.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...T.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...T.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...T.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...T.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,...T.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...T.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...T.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...T.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...T.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...T.errToObj(r)})}nonempty(t){return this.min(1,T.errToObj(t))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};an.create=e=>new an({checks:[],typeName:D.ZodString,coerce:e?.coerce??!1,...L(e)});function ck(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,i=r>n?r:n,o=Number.parseInt(e.toFixed(i).replace(".","")),a=Number.parseInt(t.toFixed(i).replace(".",""));return o%a/10**i}var ii=class e extends W{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==z.number){let o=this._getOrReturnCtx(t);return w(o,{code:b.invalid_type,expected:z.number,received:o.parsedType}),A}let n,i=new qe;for(let o of this._def.checks)o.kind==="int"?Y.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),w(n,{code:b.invalid_type,expected:"integer",received:"float",message:o.message}),i.dirty()):o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(n=this._getOrReturnCtx(t,n),w(n,{code:b.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(n=this._getOrReturnCtx(t,n),w(n,{code:b.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?ck(t.data,o.value)!==0&&(n=this._getOrReturnCtx(t,n),w(n,{code:b.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),w(n,{code:b.not_finite,message:o.message}),i.dirty()):Y.assertNever(o);return{status:i.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,T.toString(r))}gt(t,r){return this.setLimit("min",t,!1,T.toString(r))}lte(t,r){return this.setLimit("max",t,!0,T.toString(r))}lt(t,r){return this.setLimit("max",t,!1,T.toString(r))}setLimit(t,r,n,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:T.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:T.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:T.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:T.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:T.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:T.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:T.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:T.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:T.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:T.toString(t)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Y.isInteger(t.value))}get isFinite(){let t=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}};ii.create=e=>new ii({checks:[],typeName:D.ZodNumber,coerce:e?.coerce||!1,...L(e)});var oi=class e extends W{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==z.bigint)return this._getInvalidInput(t);let n,i=new qe;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(n=this._getOrReturnCtx(t,n),w(n,{code:b.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(n=this._getOrReturnCtx(t,n),w(n,{code:b.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),w(n,{code:b.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):Y.assertNever(o);return{status:i.value,value:t.data}}_getInvalidInput(t){let r=this._getOrReturnCtx(t);return w(r,{code:b.invalid_type,expected:z.bigint,received:r.parsedType}),A}gte(t,r){return this.setLimit("min",t,!0,T.toString(r))}gt(t,r){return this.setLimit("min",t,!1,T.toString(r))}lte(t,r){return this.setLimit("max",t,!0,T.toString(r))}lt(t,r){return this.setLimit("max",t,!1,T.toString(r))}setLimit(t,r,n,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:T.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:T.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:T.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:T.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:T.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:T.toString(r)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};oi.create=e=>new oi({checks:[],typeName:D.ZodBigInt,coerce:e?.coerce??!1,...L(e)});var ai=class extends W{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==z.boolean){let n=this._getOrReturnCtx(t);return w(n,{code:b.invalid_type,expected:z.boolean,received:n.parsedType}),A}return We(t.data)}};ai.create=e=>new ai({typeName:D.ZodBoolean,coerce:e?.coerce||!1,...L(e)});var si=class e extends W{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==z.date){let o=this._getOrReturnCtx(t);return w(o,{code:b.invalid_type,expected:z.date,received:o.parsedType}),A}if(Number.isNaN(t.data.getTime())){let o=this._getOrReturnCtx(t);return w(o,{code:b.invalid_date}),A}let n=new qe,i;for(let o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(i=this._getOrReturnCtx(t,i),w(i,{code:b.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),n.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(i=this._getOrReturnCtx(t,i),w(i,{code:b.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),n.dirty()):Y.assertNever(o);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:T.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:T.toString(r)})}get minDate(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}};si.create=e=>new si({checks:[],coerce:e?.coerce||!1,typeName:D.ZodDate,...L(e)});var ci=class extends W{_parse(t){if(this._getType(t)!==z.symbol){let n=this._getOrReturnCtx(t);return w(n,{code:b.invalid_type,expected:z.symbol,received:n.parsedType}),A}return We(t.data)}};ci.create=e=>new ci({typeName:D.ZodSymbol,...L(e)});var sn=class extends W{_parse(t){if(this._getType(t)!==z.undefined){let n=this._getOrReturnCtx(t);return w(n,{code:b.invalid_type,expected:z.undefined,received:n.parsedType}),A}return We(t.data)}};sn.create=e=>new sn({typeName:D.ZodUndefined,...L(e)});var cn=class extends W{_parse(t){if(this._getType(t)!==z.null){let n=this._getOrReturnCtx(t);return w(n,{code:b.invalid_type,expected:z.null,received:n.parsedType}),A}return We(t.data)}};cn.create=e=>new cn({typeName:D.ZodNull,...L(e)});var ui=class extends W{constructor(){super(...arguments),this._any=!0}_parse(t){return We(t.data)}};ui.create=e=>new ui({typeName:D.ZodAny,...L(e)});var fr=class extends W{constructor(){super(...arguments),this._unknown=!0}_parse(t){return We(t.data)}};fr.create=e=>new fr({typeName:D.ZodUnknown,...L(e)});var Ut=class extends W{_parse(t){let r=this._getOrReturnCtx(t);return w(r,{code:b.invalid_type,expected:z.never,received:r.parsedType}),A}};Ut.create=e=>new Ut({typeName:D.ZodNever,...L(e)});var li=class extends W{_parse(t){if(this._getType(t)!==z.undefined){let n=this._getOrReturnCtx(t);return w(n,{code:b.invalid_type,expected:z.void,received:n.parsedType}),A}return We(t.data)}};li.create=e=>new li({typeName:D.ZodVoid,...L(e)});var pr=class e extends W{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),i=this._def;if(r.parsedType!==z.array)return w(r,{code:b.invalid_type,expected:z.array,received:r.parsedType}),A;if(i.exactLength!==null){let a=r.data.length>i.exactLength.value,s=r.data.length<i.exactLength.value;(a||s)&&(w(r,{code:a?b.too_big:b.too_small,minimum:s?i.exactLength.value:void 0,maximum:a?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),n.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(w(r,{code:b.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(w(r,{code:b.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((a,s)=>i.type._parseAsync(new _t(r,a,r.path,s)))).then(a=>qe.mergeArray(n,a));let o=[...r.data].map((a,s)=>i.type._parseSync(new _t(r,a,r.path,s)));return qe.mergeArray(n,o)}get element(){return this._def.type}min(t,r){return new e({...this._def,minLength:{value:t,message:T.toString(r)}})}max(t,r){return new e({...this._def,maxLength:{value:t,message:T.toString(r)}})}length(t,r){return new e({...this._def,exactLength:{value:t,message:T.toString(r)}})}nonempty(t){return this.min(1,t)}};pr.create=(e,t)=>new pr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:D.ZodArray,...L(t)});function on(e){if(e instanceof mt){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=Tt.create(on(n))}return new mt({...e._def,shape:()=>t})}else return e instanceof pr?new pr({...e._def,type:on(e.element)}):e instanceof Tt?Tt.create(on(e.unwrap())):e instanceof Xt?Xt.create(on(e.unwrap())):e instanceof Ht?Ht.create(e.items.map(t=>on(t))):e}var mt=class e extends W{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),r=Y.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==z.object){let u=this._getOrReturnCtx(t);return w(u,{code:b.invalid_type,expected:z.object,received:u.parsedType}),A}let{status:n,ctx:i}=this._processInputParams(t),{shape:o,keys:a}=this._getCached(),s=[];if(!(this._def.catchall instanceof Ut&&this._def.unknownKeys==="strip"))for(let u in i.data)a.includes(u)||s.push(u);let c=[];for(let u of a){let l=o[u],d=i.data[u];c.push({key:{status:"valid",value:u},value:l._parse(new _t(i,d,i.path,u)),alwaysSet:u in i.data})}if(this._def.catchall instanceof Ut){let u=this._def.unknownKeys;if(u==="passthrough")for(let l of s)c.push({key:{status:"valid",value:l},value:{status:"valid",value:i.data[l]}});else if(u==="strict")s.length>0&&(w(i,{code:b.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=i.data[l];c.push({key:{status:"valid",value:l},value:u._parse(new _t(i,d,i.path,l)),alwaysSet:l in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let u=[];for(let l of c){let d=await l.key,p=await l.value;u.push({key:d,value:p,alwaysSet:l.alwaysSet})}return u}).then(u=>qe.mergeObjectSync(n,u)):qe.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(t){return T.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{let i=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:T.errToObj(t).message??i}:{message:i}}}:{}})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:D.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let r={};for(let n of Y.objectKeys(t))t[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}omit(t){let r={};for(let n of Y.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}deepPartial(){return on(this)}partial(t){let r={};for(let n of Y.objectKeys(this.shape)){let i=this.shape[n];t&&!t[n]?r[n]=i:r[n]=i.optional()}return new e({...this._def,shape:()=>r})}required(t){let r={};for(let n of Y.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let o=this.shape[n];for(;o instanceof Tt;)o=o._def.innerType;r[n]=o}return new e({...this._def,shape:()=>r})}keyof(){return $m(Y.objectKeys(this.shape))}};mt.create=(e,t)=>new mt({shape:()=>e,unknownKeys:"strip",catchall:Ut.create(),typeName:D.ZodObject,...L(t)});mt.strictCreate=(e,t)=>new mt({shape:()=>e,unknownKeys:"strict",catchall:Ut.create(),typeName:D.ZodObject,...L(t)});mt.lazycreate=(e,t)=>new mt({shape:e,unknownKeys:"strip",catchall:Ut.create(),typeName:D.ZodObject,...L(t)});var un=class extends W{_parse(t){let{ctx:r}=this._processInputParams(t),n=this._def.options;function i(o){for(let s of o)if(s.result.status==="valid")return s.result;for(let s of o)if(s.result.status==="dirty")return r.common.issues.push(...s.ctx.common.issues),s.result;let a=o.map(s=>new pt(s.ctx.common.issues));return w(r,{code:b.invalid_union,unionErrors:a}),A}if(r.common.async)return Promise.all(n.map(async o=>{let a={...r,common:{...r.common,issues:[]},parent:null};return{result:await o._parseAsync({data:r.data,path:r.path,parent:a}),ctx:a}})).then(i);{let o,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"&&!o&&(o={result:l,ctx:u}),u.common.issues.length&&a.push(u.common.issues)}if(o)return r.common.issues.push(...o.ctx.common.issues),o.result;let s=a.map(c=>new pt(c));return w(r,{code:b.invalid_union,unionErrors:s}),A}}get options(){return this._def.options}};un.create=(e,t)=>new un({options:e,typeName:D.ZodUnion,...L(t)});var Gt=e=>e instanceof dn?Gt(e.schema):e instanceof Et?Gt(e.innerType()):e instanceof fn?[e.value]:e instanceof pn?e.options:e instanceof mn?Y.objectValues(e.enum):e instanceof hn?Gt(e._def.innerType):e instanceof sn?[void 0]:e instanceof cn?[null]:e instanceof Tt?[void 0,...Gt(e.unwrap())]:e instanceof Xt?[null,...Gt(e.unwrap())]:e instanceof Ho||e instanceof vn?Gt(e.unwrap()):e instanceof gn?Gt(e._def.innerType):[],yc=class e extends W{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==z.object)return w(r,{code:b.invalid_type,expected:z.object,received:r.parsedType}),A;let n=this.discriminator,i=r.data[n],o=this.optionsMap.get(i);return o?r.common.async?o._parseAsync({data:r.data,path:r.path,parent:r}):o._parseSync({data:r.data,path:r.path,parent:r}):(w(r,{code:b.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(t,r,n){let i=new Map;for(let o of r){let a=Gt(o.shape[t]);if(!a.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let s of a){if(i.has(s))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(s)}`);i.set(s,o)}}return new e({typeName:D.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:i,...L(n)})}};function _c(e,t){let r=Wt(e),n=Wt(t);if(e===t)return{valid:!0,data:e};if(r===z.object&&n===z.object){let i=Y.objectKeys(t),o=Y.objectKeys(e).filter(s=>i.indexOf(s)!==-1),a={...e,...t};for(let s of o){let c=_c(e[s],t[s]);if(!c.valid)return{valid:!1};a[s]=c.data}return{valid:!0,data:a}}else if(r===z.array&&n===z.array){if(e.length!==t.length)return{valid:!1};let i=[];for(let o=0;o<e.length;o++){let a=e[o],s=t[o],c=_c(a,s);if(!c.valid)return{valid:!1};i.push(c.data)}return{valid:!0,data:i}}else return r===z.date&&n===z.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var ln=class extends W{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),i=(o,a)=>{if(hc(o)||hc(a))return A;let s=_c(o.value,a.value);return s.valid?((gc(o)||gc(a))&&r.dirty(),{status:r.value,value:s.data}):(w(n,{code:b.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(([o,a])=>i(o,a)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};ln.create=(e,t,r)=>new ln({left:e,right:t,typeName:D.ZodIntersection,...L(r)});var Ht=class e extends W{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==z.array)return w(n,{code:b.invalid_type,expected:z.array,received:n.parsedType}),A;if(n.data.length<this._def.items.length)return w(n,{code:b.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),A;!this._def.rest&&n.data.length>this._def.items.length&&(w(n,{code:b.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let o=[...n.data].map((a,s)=>{let c=this._def.items[s]||this._def.rest;return c?c._parse(new _t(n,a,n.path,s)):null}).filter(a=>!!a);return n.common.async?Promise.all(o).then(a=>qe.mergeArray(r,a)):qe.mergeArray(r,o)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};Ht.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ht({items:e,typeName:D.ZodTuple,rest:null,...L(t)})};var $c=class e extends W{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==z.object)return w(n,{code:b.invalid_type,expected:z.object,received:n.parsedType}),A;let i=[],o=this._def.keyType,a=this._def.valueType;for(let s in n.data)i.push({key:o._parse(new _t(n,s,n.path,s)),value:a._parse(new _t(n,n.data[s],n.path,s)),alwaysSet:s in n.data});return n.common.async?qe.mergeObjectAsync(r,i):qe.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof W?new e({keyType:t,valueType:r,typeName:D.ZodRecord,...L(n)}):new e({keyType:an.create(),valueType:t,typeName:D.ZodRecord,...L(r)})}},di=class extends W{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==z.map)return w(n,{code:b.invalid_type,expected:z.map,received:n.parsedType}),A;let i=this._def.keyType,o=this._def.valueType,a=[...n.data.entries()].map(([s,c],u)=>({key:i._parse(new _t(n,s,n.path,[u,"key"])),value:o._parse(new _t(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}}}};di.create=(e,t,r)=>new di({valueType:t,keyType:e,typeName:D.ZodMap,...L(r)});var fi=class e extends W{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==z.set)return w(n,{code:b.invalid_type,expected:z.set,received:n.parsedType}),A;let i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(w(n,{code:b.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&n.data.size>i.maxSize.value&&(w(n,{code:b.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());let o=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)=>o._parse(new _t(n,c,n.path,u)));return n.common.async?Promise.all(s).then(c=>a(c)):a(s)}min(t,r){return new e({...this._def,minSize:{value:t,message:T.toString(r)}})}max(t,r){return new e({...this._def,maxSize:{value:t,message:T.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};fi.create=(e,t)=>new fi({valueType:e,minSize:null,maxSize:null,typeName:D.ZodSet,...L(t)});var bc=class e extends W{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==z.function)return w(r,{code:b.invalid_type,expected:z.function,received:r.parsedType}),A;function n(s,c){return Go({data:s,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,ri(),dr].filter(u=>!!u),issueData:{code:b.invalid_arguments,argumentsError:c}})}function i(s,c){return Go({data:s,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,ri(),dr].filter(u=>!!u),issueData:{code:b.invalid_return_type,returnTypeError:c}})}let o={errorMap:r.common.contextualErrorMap},a=r.data;if(this._def.returns instanceof Ar){let s=this;return We(async function(...c){let u=new pt([]),l=await s._def.args.parseAsync(c,o).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,o).catch(f=>{throw u.addIssue(i(d,f)),u})})}else{let s=this;return We(function(...c){let u=s._def.args.safeParse(c,o);if(!u.success)throw new pt([n(c,u.error)]);let l=Reflect.apply(a,this,u.data),d=s._def.returns.safeParse(l,o);if(!d.success)throw new pt([i(l,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:Ht.create(t).rest(fr.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new e({args:t||Ht.create([]).rest(fr.create()),returns:r||fr.create(),typeName:D.ZodFunction,...L(n)})}},dn=class extends W{get schema(){return this._def.getter()}_parse(t){let{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};dn.create=(e,t)=>new dn({getter:e,typeName:D.ZodLazy,...L(t)});var fn=class extends W{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return w(r,{received:r.data,code:b.invalid_literal,expected:this._def.value}),A}return{status:"valid",value:t.data}}get value(){return this._def.value}};fn.create=(e,t)=>new fn({value:e,typeName:D.ZodLiteral,...L(t)});function $m(e,t){return new pn({values:e,typeName:D.ZodEnum,...L(t)})}var pn=class e extends W{_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return w(r,{expected:Y.joinValues(n),received:r.parsedType,code:b.invalid_type}),A}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let r=this._getOrReturnCtx(t),n=this._def.values;return w(r,{received:r.data,code:b.invalid_enum_value,options:n}),A}return We(t.data)}get options(){return this._def.values}get enum(){let t={};for(let r of this._def.values)t[r]=r;return t}get Values(){let t={};for(let r of this._def.values)t[r]=r;return t}get Enum(){let t={};for(let r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return e.create(t,{...this._def,...r})}exclude(t,r=this._def){return e.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}};pn.create=$m;var mn=class extends W{_parse(t){let r=Y.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==z.string&&n.parsedType!==z.number){let i=Y.objectValues(r);return w(n,{expected:Y.joinValues(i),received:n.parsedType,code:b.invalid_type}),A}if(this._cache||(this._cache=new Set(Y.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let i=Y.objectValues(r);return w(n,{received:n.data,code:b.invalid_enum_value,options:i}),A}return We(t.data)}get enum(){return this._def.values}};mn.create=(e,t)=>new mn({values:e,typeName:D.ZodNativeEnum,...L(t)});var Ar=class extends W{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==z.promise&&r.common.async===!1)return w(r,{code:b.invalid_type,expected:z.promise,received:r.parsedType}),A;let n=r.parsedType===z.promise?r.data:Promise.resolve(r.data);return We(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}};Ar.create=(e,t)=>new Ar({type:e,typeName:D.ZodPromise,...L(t)});var Et=class extends W{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===D.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:r,ctx:n}=this._processInputParams(t),i=this._def.effect||null,o={addIssue:a=>{w(n,a),a.fatal?r.abort():r.dirty()},get path(){return n.path}};if(o.addIssue=o.addIssue.bind(o),i.type==="preprocess"){let a=i.transform(n.data,o);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"?nn(c.value):r.value==="dirty"?nn(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"?nn(s.value):r.value==="dirty"?nn(s.value):s}}if(i.type==="refinement"){let a=s=>{let c=i.refinement(s,o);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return 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(i.type==="transform")if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Rr(a))return A;let s=i.transform(a.value,o);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=>Rr(a)?Promise.resolve(i.transform(a.value,o)).then(s=>({status:r.value,value:s})):A);Y.assertNever(i)}};Et.create=(e,t,r)=>new Et({schema:e,typeName:D.ZodEffects,effect:t,...L(r)});Et.createWithPreprocess=(e,t,r)=>new Et({schema:t,effect:{type:"preprocess",transform:e},typeName:D.ZodEffects,...L(r)});var Tt=class extends W{_parse(t){return this._getType(t)===z.undefined?We(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Tt.create=(e,t)=>new Tt({innerType:e,typeName:D.ZodOptional,...L(t)});var Xt=class extends W{_parse(t){return this._getType(t)===z.null?We(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Xt.create=(e,t)=>new Xt({innerType:e,typeName:D.ZodNullable,...L(t)});var hn=class extends W{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return r.parsedType===z.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};hn.create=(e,t)=>new hn({innerType:e,typeName:D.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...L(t)});var gn=class extends W{_parse(t){let{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return ni(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new pt(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new pt(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};gn.create=(e,t)=>new gn({innerType:e,typeName:D.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...L(t)});var pi=class extends W{_parse(t){if(this._getType(t)!==z.nan){let n=this._getOrReturnCtx(t);return w(n,{code:b.invalid_type,expected:z.nan,received:n.parsedType}),A}return{status:"valid",value:t.data}}};pi.create=e=>new pi({typeName:D.ZodNaN,...L(e)});var Ho=class extends W{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},Xo=class e extends W{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{let o=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?A:o.status==="dirty"?(r.dirty(),nn(o.value)):this._def.out._parseAsync({data:o.value,path:n.path,parent:n})})();{let i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?A:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(t,r){return new e({in:t,out:r,typeName:D.ZodPipeline})}},vn=class extends W{_parse(t){let r=this._def.innerType._parse(t),n=i=>(Rr(i)&&(i.value=Object.freeze(i.value)),i);return ni(r)?r.then(i=>n(i)):n(r)}unwrap(){return this._def.innerType}};vn.create=(e,t)=>new vn({innerType:e,typeName:D.ZodReadonly,...L(t)});var L4={object:mt.lazycreate},D;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(D||(D={}));var F4=an.create,V4=ii.create,J4=pi.create,K4=oi.create,B4=ai.create,W4=si.create,G4=ci.create,H4=sn.create,X4=cn.create,Y4=ui.create,Q4=fr.create,e1=Ut.create,t1=li.create,r1=pr.create,uk=mt.create,n1=mt.strictCreate,i1=un.create,o1=yc.create,a1=ln.create,s1=Ht.create,c1=$c.create,u1=di.create,l1=fi.create,d1=bc.create,f1=dn.create,p1=fn.create,m1=pn.create,h1=mn.create,g1=Ar.create,v1=Et.create,y1=Tt.create,_1=Xt.create,$1=Et.createWithPreprocess,b1=Xo.create;var bm=Object.freeze({status:"aborted"});function m(e,t,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(e))return;s._zod.traits.add(e),t(s,c);let u=a.prototype,l=Object.keys(u);for(let d=0;d<l.length;d++){let p=l[d];p in s||(s[p]=u[p].bind(s))}}let i=r?.Parent??Object;class o extends i{}Object.defineProperty(o,"name",{value:e});function a(s){var c;let u=r?.Parent?new o: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(e)}),Object.defineProperty(a,"name",{value:e}),a}var Ct=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Ur=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},Yo={};function Te(e){return e&&Object.assign(Yo,e),Yo}var x={};ti(x,{BIGINT_FORMAT_RANGES:()=>jc,Class:()=>kc,NUMBER_FORMAT_RANGES:()=>Ec,aborted:()=>vr,allowsEval:()=>zc,assert:()=>gk,assertEqual:()=>fk,assertIs:()=>mk,assertNever:()=>hk,assertNotEqual:()=>pk,assignProp:()=>hr,base64ToUint8Array:()=>Tm,base64urlToUint8Array:()=>Ik,cached:()=>_n,captureStackTrace:()=>ea,cleanEnum:()=>zk,cleanRegex:()=>gi,clone:()=>Ge,cloneDef:()=>yk,createTransparentProxy:()=>wk,defineLazy:()=>F,esc:()=>Qo,escapeRegex:()=>$t,extend:()=>Sm,finalizeIssue:()=>at,floatSafeRemainder:()=>wc,getElementAtPath:()=>_k,getEnumValues:()=>hi,getLengthableOrigin:()=>_i,getParsedType:()=>kk,getSizableOrigin:()=>yi,hexToUint8Array:()=>Tk,isObject:()=>Cr,isPlainObject:()=>gr,issue:()=>$n,joinValues:()=>Z,jsonStringifyReplacer:()=>yn,merge:()=>Sk,mergeDefs:()=>Yt,normalizeParams:()=>S,nullish:()=>mr,numKeys:()=>xk,objectClone:()=>vk,omit:()=>wm,optionalKeys:()=>Tc,parsedType:()=>U,partial:()=>Im,pick:()=>km,prefixIssues:()=>ht,primitiveTypes:()=>Pc,promiseAllObject:()=>$k,propertyKeyTypes:()=>vi,randomString:()=>bk,required:()=>Pm,safeExtend:()=>zm,shallowClone:()=>Ic,slugify:()=>Sc,stringifyPrimitive:()=>R,uint8ArrayToBase64:()=>Em,uint8ArrayToBase64url:()=>Pk,uint8ArrayToHex:()=>Ek,unwrapMessage:()=>mi});function fk(e){return e}function pk(e){return e}function mk(e){}function hk(e){throw new Error("Unexpected value in exhaustive check")}function gk(e){}function hi(e){let t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,i])=>t.indexOf(+n)===-1).map(([n,i])=>i)}function Z(e,t="|"){return e.map(r=>R(r)).join(t)}function yn(e,t){return typeof t=="bigint"?t.toString():t}function _n(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function mr(e){return e==null}function gi(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function wc(e,t){let r=(e.toString().split(".")[1]||"").length,n=t.toString(),i=(n.split(".")[1]||"").length;if(i===0&&/\d?e-\d?/.test(n)){let c=n.match(/\d?e-(\d?)/);c?.[1]&&(i=Number.parseInt(c[1]))}let o=r>i?r:i,a=Number.parseInt(e.toFixed(o).replace(".","")),s=Number.parseInt(t.toFixed(o).replace(".",""));return a%s/10**o}var xm=Symbol("evaluating");function F(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==xm)return n===void 0&&(n=xm,n=r()),n},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}function vk(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function hr(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Yt(...e){let t={};for(let r of e){let n=Object.getOwnPropertyDescriptors(r);Object.assign(t,n)}return Object.defineProperties({},t)}function yk(e){return Yt(e._zod.def)}function _k(e,t){return t?t.reduce((r,n)=>r?.[n],e):e}function $k(e){let t=Object.keys(e),r=t.map(n=>e[n]);return Promise.all(r).then(n=>{let i={};for(let o=0;o<t.length;o++)i[t[o]]=n[o];return i})}function bk(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let n=0;n<e;n++)r+=t[Math.floor(Math.random()*t.length)];return r}function Qo(e){return JSON.stringify(e)}function Sc(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var ea="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Cr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var zc=_n(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function gr(e){if(Cr(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(Cr(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Ic(e){return gr(e)?{...e}:Array.isArray(e)?[...e]:e}function xk(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}var kk=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},vi=new Set(["string","number","symbol"]),Pc=new Set(["string","number","bigint","boolean","symbol","undefined"]);function $t(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ge(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}function S(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function wk(e){let t;return new Proxy({},{get(r,n,i){return t??(t=e()),Reflect.get(t,n,i)},set(r,n,i,o){return t??(t=e()),Reflect.set(t,n,i,o)},has(r,n){return t??(t=e()),Reflect.has(t,n)},deleteProperty(r,n){return t??(t=e()),Reflect.deleteProperty(t,n)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,n){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,n)},defineProperty(r,n,i){return t??(t=e()),Reflect.defineProperty(t,n,i)}})}function R(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function Tc(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var Ec={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]},jc={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function km(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let o=Yt(e._zod.def,{get shape(){let a={};for(let s in t){if(!(s in r.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&(a[s]=r.shape[s])}return hr(this,"shape",a),a},checks:[]});return Ge(e,o)}function wm(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let o=Yt(e._zod.def,{get shape(){let a={...e._zod.def.shape};for(let s in t){if(!(s in r.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&delete a[s]}return hr(this,"shape",a),a},checks:[]});return Ge(e,o)}function Sm(e,t){if(!gr(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let o=e._zod.def.shape;for(let a in t)if(Object.getOwnPropertyDescriptor(o,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let i=Yt(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t};return hr(this,"shape",o),o}});return Ge(e,i)}function zm(e,t){if(!gr(t))throw new Error("Invalid input to safeExtend: expected a plain object");let r=Yt(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return hr(this,"shape",n),n}});return Ge(e,r)}function Sk(e,t){let r=Yt(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return hr(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return Ge(e,r)}function Im(e,t,r){let i=t._zod.def.checks;if(i&&i.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let a=Yt(t._zod.def,{get shape(){let s=t._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]=e?new e({type:"optional",innerType:s[u]}):s[u])}else for(let u in s)c[u]=e?new e({type:"optional",innerType:s[u]}):s[u];return hr(this,"shape",c),c},checks:[]});return Ge(t,a)}function Pm(e,t,r){let n=Yt(t._zod.def,{get shape(){let i=t._zod.def.shape,o={...i};if(r)for(let a in r){if(!(a in o))throw new Error(`Unrecognized key: "${a}"`);r[a]&&(o[a]=new e({type:"nonoptional",innerType:i[a]}))}else for(let a in i)o[a]=new e({type:"nonoptional",innerType:i[a]});return hr(this,"shape",o),o}});return Ge(t,n)}function vr(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function ht(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function mi(e){return typeof e=="string"?e:e?.message}function at(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let i=mi(e.inst?._zod.def?.error?.(e))??mi(t?.error?.(e))??mi(r.customError?.(e))??mi(r.localeError?.(e))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}function yi(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function _i(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function U(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function $n(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}function zk(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function Tm(e){let t=atob(e),r=new Uint8Array(t.length);for(let n=0;n<t.length;n++)r[n]=t.charCodeAt(n);return r}function Em(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function Ik(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return Tm(t+r)}function Pk(e){return Em(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Tk(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let n=0;n<t.length;n+=2)r[n/2]=Number.parseInt(t.slice(n,n+2),16);return r}function Ek(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var kc=class{constructor(...t){}};var jm=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,yn,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},ta=m("$ZodError",jm),$i=m("$ZodError",jm,{Parent:Error});function ra(e,t=r=>r.message){let r={},n=[];for(let i of e.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(t(i))):n.push(t(i));return{formErrors:n,fieldErrors:r}}function na(e,t=r=>r.message){let r={_errors:[]},n=i=>{for(let o of i.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(a=>n({issues:a}));else if(o.code==="invalid_key")n({issues:o.issues});else if(o.code==="invalid_element")n({issues:o.issues});else if(o.path.length===0)r._errors.push(t(o));else{let a=r,s=0;for(;s<o.path.length;){let c=o.path[s];s===o.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(t(o))):a[c]=a[c]||{_errors:[]},a=a[c],s++}}};return n(e),r}var bi=e=>(t,r,n,i)=>{let o=n?Object.assign(n,{async:!1}):{async:!1},a=t._zod.run({value:r,issues:[]},o);if(a instanceof Promise)throw new Ct;if(a.issues.length){let s=new(i?.Err??e)(a.issues.map(c=>at(c,o,Te())));throw ea(s,i?.callee),s}return a.value},xi=bi($i),ki=e=>async(t,r,n,i)=>{let o=n?Object.assign(n,{async:!0}):{async:!0},a=t._zod.run({value:r,issues:[]},o);if(a instanceof Promise&&(a=await a),a.issues.length){let s=new(i?.Err??e)(a.issues.map(c=>at(c,o,Te())));throw ea(s,i?.callee),s}return a.value},wi=ki($i),Si=e=>(t,r,n)=>{let i=n?{...n,async:!1}:{async:!1},o=t._zod.run({value:r,issues:[]},i);if(o instanceof Promise)throw new Ct;return o.issues.length?{success:!1,error:new(e??ta)(o.issues.map(a=>at(a,i,Te())))}:{success:!0,data:o.value}},bn=Si($i),zi=e=>async(t,r,n)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},o=t._zod.run({value:r,issues:[]},i);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(a=>at(a,i,Te())))}:{success:!0,data:o.value}},Ii=zi($i),Om=e=>(t,r,n)=>{let i=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return bi(e)(t,r,i)};var Nm=e=>(t,r,n)=>bi(e)(t,r,n);var Dm=e=>async(t,r,n)=>{let i=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return ki(e)(t,r,i)};var Zm=e=>async(t,r,n)=>ki(e)(t,r,n);var Rm=e=>(t,r,n)=>{let i=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Si(e)(t,r,i)};var Am=e=>(t,r,n)=>Si(e)(t,r,n);var Um=e=>async(t,r,n)=>{let i=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return zi(e)(t,r,i)};var Cm=e=>async(t,r,n)=>zi(e)(t,r,n);var bt={};ti(bt,{base64:()=>Bc,base64url:()=>ia,bigint:()=>Qc,boolean:()=>tu,browserEmail:()=>Ck,cidrv4:()=>Jc,cidrv6:()=>Kc,cuid:()=>Oc,cuid2:()=>Nc,date:()=>Gc,datetime:()=>Xc,domain:()=>Lk,duration:()=>Uc,e164:()=>Wc,email:()=>Mc,emoji:()=>qc,extendedDuration:()=>Ok,guid:()=>Cc,hex:()=>Fk,hostname:()=>qk,html5Email:()=>Rk,idnEmail:()=>Uk,integer:()=>eu,ipv4:()=>Lc,ipv6:()=>Fc,ksuid:()=>Rc,lowercase:()=>iu,mac:()=>Vc,md5_base64:()=>Jk,md5_base64url:()=>Kk,md5_hex:()=>Vk,nanoid:()=>Ac,null:()=>ru,number:()=>oa,rfc5322Email:()=>Ak,sha1_base64:()=>Wk,sha1_base64url:()=>Gk,sha1_hex:()=>Bk,sha256_base64:()=>Xk,sha256_base64url:()=>Yk,sha256_hex:()=>Hk,sha384_base64:()=>ew,sha384_base64url:()=>tw,sha384_hex:()=>Qk,sha512_base64:()=>nw,sha512_base64url:()=>iw,sha512_hex:()=>rw,string:()=>Yc,time:()=>Hc,ulid:()=>Dc,undefined:()=>nu,unicodeEmail:()=>Mm,uppercase:()=>ou,uuid:()=>Mr,uuid4:()=>Nk,uuid6:()=>Dk,uuid7:()=>Zk,xid:()=>Zc});var Oc=/^[cC][^\s-]{8,}$/,Nc=/^[0-9a-z]+$/,Dc=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Zc=/^[0-9a-vA-V]{20}$/,Rc=/^[A-Za-z0-9]{27}$/,Ac=/^[a-zA-Z0-9_-]{21}$/,Uc=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Ok=/^[-+]?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)?)??$/,Cc=/^([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})$/,Mr=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Nk=Mr(4),Dk=Mr(6),Zk=Mr(7),Mc=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Rk=/^[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])?)*$/,Ak=/^(([^<>()\[\]\\.,;:\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,}))$/,Mm=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,Uk=Mm,Ck=/^[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])?)*$/,Mk="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function qc(){return new RegExp(Mk,"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])$/,Fc=/^(([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}|:))$/,Vc=e=>{let t=$t(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},Jc=/^((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])$/,Kc=/^(([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])$/,Bc=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ia=/^[A-Za-z0-9_-]*$/,qk=/^(?=.{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])?)*\.?$/,Lk=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Wc=/^\+[1-9]\d{6,14}$/,qm="(?:(?:\\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(`^${qm}$`);function Lm(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Hc(e){return new RegExp(`^${Lm(e)}$`)}function Xc(e){let t=Lm({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let n=`${t}(?:${r.join("|")})`;return new RegExp(`^${qm}T(?:${n})$`)}var Yc=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Qc=/^-?\d+n?$/,eu=/^-?\d+$/,oa=/^-?\d+(?:\.\d+)?$/,tu=/^(?:true|false)$/i,ru=/^null$/i;var nu=/^undefined$/i;var iu=/^[^A-Z]*$/,ou=/^[^a-z]*$/,Fk=/^[0-9a-fA-F]*$/;function Pi(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function Ti(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var Vk=/^[0-9a-fA-F]{32}$/,Jk=Pi(22,"=="),Kk=Ti(22),Bk=/^[0-9a-fA-F]{40}$/,Wk=Pi(27,"="),Gk=Ti(27),Hk=/^[0-9a-fA-F]{64}$/,Xk=Pi(43,"="),Yk=Ti(43),Qk=/^[0-9a-fA-F]{96}$/,ew=Pi(64,""),tw=Ti(64),rw=/^[0-9a-fA-F]{128}$/,nw=Pi(86,"=="),iw=Ti(86);var le=m("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Vm={number:"number",bigint:"bigint",object:"date"},au=m("$ZodCheckLessThan",(e,t)=>{le.init(e,t);let r=Vm[typeof t.value];e._zod.onattach.push(n=>{let i=n._zod.bag,o=(t.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<o&&(t.inclusive?i.maximum=t.value:i.exclusiveMaximum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),su=m("$ZodCheckGreaterThan",(e,t)=>{le.init(e,t);let r=Vm[typeof t.value];e._zod.onattach.push(n=>{let i=n._zod.bag,o=(t.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>o&&(t.inclusive?i.minimum=t.value:i.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Jm=m("$ZodCheckMultipleOf",(e,t)=>{le.init(e,t),e._zod.onattach.push(r=>{var n;(n=r._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):wc(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),Km=m("$ZodCheckNumberFormat",(e,t)=>{le.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[i,o]=Ec[t.format];e._zod.onattach.push(a=>{let s=a._zod.bag;s.format=t.format,s.minimum=i,s.maximum=o,r&&(s.pattern=eu)}),e._zod.check=a=>{let s=a.value;if(r){if(!Number.isInteger(s)){a.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:s,inst:e});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:e,origin:n,inclusive:!0,continue:!t.abort}):a.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}s<i&&a.issues.push({origin:"number",input:s,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>o&&a.issues.push({origin:"number",input:s,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),Bm=m("$ZodCheckBigIntFormat",(e,t)=>{le.init(e,t);let[r,n]=jc[t.format];e._zod.onattach.push(i=>{let o=i._zod.bag;o.format=t.format,o.minimum=r,o.maximum=n}),e._zod.check=i=>{let o=i.value;o<r&&i.issues.push({origin:"bigint",input:o,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),o>n&&i.issues.push({origin:"bigint",input:o,code:"too_big",maximum:n,inclusive:!0,inst:e,continue:!t.abort})}}),Wm=m("$ZodCheckMaxSize",(e,t)=>{var r;le.init(e,t),(r=e._zod.def).when??(r.when=n=>{let i=n.value;return!mr(i)&&i.size!==void 0}),e._zod.onattach.push(n=>{let i=n._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<i&&(n._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let i=n.value;i.size<=t.maximum||n.issues.push({origin:yi(i),code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),Gm=m("$ZodCheckMinSize",(e,t)=>{var r;le.init(e,t),(r=e._zod.def).when??(r.when=n=>{let i=n.value;return!mr(i)&&i.size!==void 0}),e._zod.onattach.push(n=>{let i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let i=n.value;i.size>=t.minimum||n.issues.push({origin:yi(i),code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),Hm=m("$ZodCheckSizeEquals",(e,t)=>{var r;le.init(e,t),(r=e._zod.def).when??(r.when=n=>{let i=n.value;return!mr(i)&&i.size!==void 0}),e._zod.onattach.push(n=>{let i=n._zod.bag;i.minimum=t.size,i.maximum=t.size,i.size=t.size}),e._zod.check=n=>{let i=n.value,o=i.size;if(o===t.size)return;let a=o>t.size;n.issues.push({origin:yi(i),...a?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Xm=m("$ZodCheckMaxLength",(e,t)=>{var r;le.init(e,t),(r=e._zod.def).when??(r.when=n=>{let i=n.value;return!mr(i)&&i.length!==void 0}),e._zod.onattach.push(n=>{let i=n._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<i&&(n._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let i=n.value;if(i.length<=t.maximum)return;let a=_i(i);n.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),Ym=m("$ZodCheckMinLength",(e,t)=>{var r;le.init(e,t),(r=e._zod.def).when??(r.when=n=>{let i=n.value;return!mr(i)&&i.length!==void 0}),e._zod.onattach.push(n=>{let i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let i=n.value;if(i.length>=t.minimum)return;let a=_i(i);n.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),Qm=m("$ZodCheckLengthEquals",(e,t)=>{var r;le.init(e,t),(r=e._zod.def).when??(r.when=n=>{let i=n.value;return!mr(i)&&i.length!==void 0}),e._zod.onattach.push(n=>{let i=n._zod.bag;i.minimum=t.length,i.maximum=t.length,i.length=t.length}),e._zod.check=n=>{let i=n.value,o=i.length;if(o===t.length)return;let a=_i(i),s=o>t.length;n.issues.push({origin:a,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Ei=m("$ZodCheckStringFormat",(e,t)=>{var r,n;le.init(e,t),e._zod.onattach.push(i=>{let o=i._zod.bag;o.format=t.format,t.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),eh=m("$ZodCheckRegex",(e,t)=>{Ei.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),th=m("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=iu),Ei.init(e,t)}),rh=m("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=ou),Ei.init(e,t)}),nh=m("$ZodCheckIncludes",(e,t)=>{le.init(e,t);let r=$t(t.includes),n=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=n,e._zod.onattach.push(i=>{let o=i._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=i=>{i.value.includes(t.includes,t.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:i.value,inst:e,continue:!t.abort})}}),ih=m("$ZodCheckStartsWith",(e,t)=>{le.init(e,t);let r=new RegExp(`^${$t(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{let i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),oh=m("$ZodCheckEndsWith",(e,t)=>{le.init(e,t);let r=new RegExp(`.*${$t(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{let i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}});function Fm(e,t,r){e.issues.length&&t.issues.push(...ht(r,e.issues))}var ah=m("$ZodCheckProperty",(e,t)=>{le.init(e,t),e._zod.check=r=>{let n=t.schema._zod.run({value:r.value[t.property],issues:[]},{});if(n instanceof Promise)return n.then(i=>Fm(i,r,t.property));Fm(n,r,t.property)}}),sh=m("$ZodCheckMimeType",(e,t)=>{le.init(e,t);let r=new Set(t.mime);e._zod.onattach.push(n=>{n._zod.bag.mime=t.mime}),e._zod.check=n=>{r.has(n.value.type)||n.issues.push({code:"invalid_value",values:t.mime,input:n.value.type,inst:e,continue:!t.abort})}}),ch=m("$ZodCheckOverwrite",(e,t)=>{le.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});var aa=class{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let n=t.split(`
|
|
16
|
+
`).filter(a=>a),i=Math.min(...n.map(a=>a.length-a.trimStart().length)),o=n.map(a=>a.slice(i)).map(a=>" ".repeat(this.indent*2)+a);for(let a of o)this.content.push(a)}compile(){let t=Function,r=this?.args,i=[...(this?.content??[""]).map(o=>` ${o}`)];return new t(...r,i.join(`
|
|
17
|
+
`))}};var lh={major:4,minor:3,patch:6};var q=m("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=lh;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let i of n)for(let o of i._zod.onattach)o(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let i=(a,s,c)=>{let u=vr(a),l;for(let d of s){if(d._zod.def.when){if(!d._zod.def.when(a))continue}else if(u)continue;let p=a.issues.length,f=d._zod.check(a);if(f instanceof Promise&&c?.async===!1)throw new Ct;if(l||f instanceof Promise)l=(l??Promise.resolve()).then(async()=>{await f,a.issues.length!==p&&(u||(u=vr(a,p)))});else{if(a.issues.length===p)continue;u||(u=vr(a,p))}}return l?l.then(()=>a):a},o=(a,s,c)=>{if(vr(a))return a.aborted=!0,a;let u=i(s,n,c);if(u instanceof Promise){if(c.async===!1)throw new Ct;return u.then(l=>e._zod.parse(l,c))}return e._zod.parse(u,c)};e._zod.run=(a,s)=>{if(s.skipChecks)return e._zod.parse(a,s);if(s.direction==="backward"){let u=e._zod.parse({value:a.value,issues:[]},{...s,skipChecks:!0});return u instanceof Promise?u.then(l=>o(l,a,s)):o(u,a,s)}let c=e._zod.parse(a,s);if(c instanceof Promise){if(s.async===!1)throw new Ct;return c.then(u=>i(u,n,s))}return i(c,n,s)}}F(e,"~standard",()=>({validate:i=>{try{let o=bn(e,i);return o.success?{value:o.data}:{issues:o.error?.issues}}catch{return Ii(e,i).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}))}),qr=m("$ZodString",(e,t)=>{q.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Yc(e._zod.bag),e._zod.parse=(r,n)=>{if(t.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:e}),r}}),se=m("$ZodStringFormat",(e,t)=>{Ei.init(e,t),qr.init(e,t)}),uu=m("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Cc),se.init(e,t)}),lu=m("$ZodUUID",(e,t)=>{if(t.version){let n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(n===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Mr(n))}else t.pattern??(t.pattern=Mr());se.init(e,t)}),du=m("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Mc),se.init(e,t)}),fu=m("$ZodURL",(e,t)=>{se.init(e,t),e._zod.check=r=>{try{let n=r.value.trim(),i=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=i.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),pu=m("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=qc()),se.init(e,t)}),mu=m("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Ac),se.init(e,t)}),hu=m("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Oc),se.init(e,t)}),gu=m("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Nc),se.init(e,t)}),vu=m("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Dc),se.init(e,t)}),yu=m("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Zc),se.init(e,t)}),_u=m("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Rc),se.init(e,t)}),$u=m("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Xc(t)),se.init(e,t)}),bu=m("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Gc),se.init(e,t)}),xu=m("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Hc(t)),se.init(e,t)}),ku=m("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Uc),se.init(e,t)}),wu=m("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Lc),se.init(e,t),e._zod.bag.format="ipv4"}),Su=m("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Fc),se.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),zu=m("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=Vc(t.delimiter)),se.init(e,t),e._zod.bag.format="mac"}),Iu=m("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Jc),se.init(e,t)}),Pu=m("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Kc),se.init(e,t),e._zod.check=r=>{let n=r.value.split("/");try{if(n.length!==2)throw new Error;let[i,o]=n;if(!o)throw new Error;let a=Number(o);if(`${a}`!==o)throw new Error;if(a<0||a>128)throw new Error;new URL(`http://[${i}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function xh(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var Tu=m("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Bc),se.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{xh(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function ow(e){if(!ia.test(e))return!1;let t=e.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return xh(r)}var Eu=m("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=ia),se.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{ow(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),ju=m("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Wc),se.init(e,t)});function aw(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[n]=r;if(!n)return!1;let i=JSON.parse(atob(n));return!("typ"in i&&i?.typ!=="JWT"||!i.alg||t&&(!("alg"in i)||i.alg!==t))}catch{return!1}}var Ou=m("$ZodJWT",(e,t)=>{se.init(e,t),e._zod.check=r=>{aw(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),Nu=m("$ZodCustomStringFormat",(e,t)=>{se.init(e,t),e._zod.check=r=>{t.fn(r.value)||r.issues.push({code:"invalid_format",format:t.format,input:r.value,inst:e,continue:!t.abort})}}),fa=m("$ZodNumber",(e,t)=>{q.init(e,t),e._zod.pattern=e._zod.bag.pattern??oa,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let i=r.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return r;let o=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...o?{received:o}:{}}),r}}),Du=m("$ZodNumberFormat",(e,t)=>{Km.init(e,t),fa.init(e,t)}),ji=m("$ZodBoolean",(e,t)=>{q.init(e,t),e._zod.pattern=tu,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}let i=r.value;return typeof i=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),r}}),pa=m("$ZodBigInt",(e,t)=>{q.init(e,t),e._zod.pattern=Qc,e._zod.parse=(r,n)=>{if(t.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:e}),r}}),Zu=m("$ZodBigIntFormat",(e,t)=>{Bm.init(e,t),pa.init(e,t)}),Ru=m("$ZodSymbol",(e,t)=>{q.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;return typeof i=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:i,inst:e}),r}}),Au=m("$ZodUndefined",(e,t)=>{q.init(e,t),e._zod.pattern=nu,e._zod.values=new Set([void 0]),e._zod.optin="optional",e._zod.optout="optional",e._zod.parse=(r,n)=>{let i=r.value;return typeof i>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:i,inst:e}),r}}),Uu=m("$ZodNull",(e,t)=>{q.init(e,t),e._zod.pattern=ru,e._zod.values=new Set([null]),e._zod.parse=(r,n)=>{let i=r.value;return i===null||r.issues.push({expected:"null",code:"invalid_type",input:i,inst:e}),r}}),Cu=m("$ZodAny",(e,t)=>{q.init(e,t),e._zod.parse=r=>r}),Mu=m("$ZodUnknown",(e,t)=>{q.init(e,t),e._zod.parse=r=>r}),qu=m("$ZodNever",(e,t)=>{q.init(e,t),e._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)}),Lu=m("$ZodVoid",(e,t)=>{q.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;return typeof i>"u"||r.issues.push({expected:"void",code:"invalid_type",input:i,inst:e}),r}}),Fu=m("$ZodDate",(e,t)=>{q.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let i=r.value,o=i instanceof Date;return o&&!Number.isNaN(i.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:i,...o?{received:"Invalid Date"}:{},inst:e}),r}});function dh(e,t,r){e.issues.length&&t.issues.push(...ht(r,e.issues)),t.value[r]=e.value}var Vu=m("$ZodArray",(e,t)=>{q.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),r;r.value=Array(i.length);let o=[];for(let a=0;a<i.length;a++){let s=i[a],c=t.element._zod.run({value:s,issues:[]},n);c instanceof Promise?o.push(c.then(u=>dh(u,r,a))):dh(c,r,a)}return o.length?Promise.all(o).then(()=>r):r}});function da(e,t,r,n,i){if(e.issues.length){if(i&&!(r in n))return;t.issues.push(...ht(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}function kh(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);let r=Tc(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function wh(e,t,r,n,i,o){let a=[],s=i.keySet,c=i.catchall._zod,u=c.def.type,l=c.optout==="optional";for(let d in t){if(s.has(d))continue;if(u==="never"){a.push(d);continue}let p=c.run({value:t[d],issues:[]},n);p instanceof Promise?e.push(p.then(f=>da(f,r,d,t,l))):da(p,r,d,t,l)}return a.length&&r.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:o}),e.length?Promise.all(e).then(()=>r):r}var Sh=m("$ZodObject",(e,t)=>{if(q.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let s=t.shape;Object.defineProperty(t,"shape",{get:()=>{let c={...s};return Object.defineProperty(t,"shape",{value:c}),c}})}let n=_n(()=>kh(t));F(e._zod,"propValues",()=>{let s=t.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 i=Cr,o=t.catchall,a;e._zod.parse=(s,c)=>{a??(a=n.value);let u=s.value;if(!i(u))return s.issues.push({expected:"object",code:"invalid_type",input:u,inst:e}),s;s.value={};let l=[],d=a.shape;for(let p of a.keys){let f=d[p],h=f._zod.optout==="optional",g=f._zod.run({value:u[p],issues:[]},c);g instanceof Promise?l.push(g.then(y=>da(y,s,p,u,h))):da(g,s,p,u,h)}return o?wh(l,u,s,c,n.value,e):l.length?Promise.all(l).then(()=>s):s}}),zh=m("$ZodObjectJIT",(e,t)=>{Sh.init(e,t);let r=e._zod.parse,n=_n(()=>kh(t)),i=p=>{let f=new aa(["shape","payload","ctx"]),h=n.value,g=k=>{let N=Qo(k);return`shape[${N}]._zod.run({ value: input[${N}], issues: [] }, ctx)`};f.write("const input = payload.value;");let y=Object.create(null),$=0;for(let k of h.keys)y[k]=`key_${$++}`;f.write("const newResult = {};");for(let k of h.keys){let N=y[k],j=Qo(k),ft=p[k]?._zod?.optout==="optional";f.write(`const ${N} = ${g(k)};`),ft?f.write(`
|
|
18
|
+
if (${N}.issues.length) {
|
|
19
|
+
if (${j} in input) {
|
|
20
|
+
payload.issues = payload.issues.concat(${N}.issues.map(iss => ({
|
|
21
|
+
...iss,
|
|
22
|
+
path: iss.path ? [${j}, ...iss.path] : [${j}]
|
|
23
|
+
})));
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
if (${N}.value === undefined) {
|
|
28
|
+
if (${j} in input) {
|
|
29
|
+
newResult[${j}] = undefined;
|
|
30
|
+
}
|
|
31
|
+
} else {
|
|
32
|
+
newResult[${j}] = ${N}.value;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
`):f.write(`
|
|
36
|
+
if (${N}.issues.length) {
|
|
37
|
+
payload.issues = payload.issues.concat(${N}.issues.map(iss => ({
|
|
38
|
+
...iss,
|
|
39
|
+
path: iss.path ? [${j}, ...iss.path] : [${j}]
|
|
40
|
+
})));
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (${N}.value === undefined) {
|
|
44
|
+
if (${j} in input) {
|
|
45
|
+
newResult[${j}] = undefined;
|
|
46
|
+
}
|
|
47
|
+
} else {
|
|
48
|
+
newResult[${j}] = ${N}.value;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
`)}f.write("payload.value = newResult;"),f.write("return payload;");let P=f.compile();return(k,N)=>P(p,k,N)},o,a=Cr,s=!Yo.jitless,u=s&&zc.value,l=t.catchall,d;e._zod.parse=(p,f)=>{d??(d=n.value);let h=p.value;return a(h)?s&&u&&f?.async===!1&&f.jitless!==!0?(o||(o=i(t.shape)),p=o(p,f),l?wh([],h,p,f,d,e):p):r(p,f):(p.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),p)}});function fh(e,t,r,n){for(let o of e)if(o.issues.length===0)return t.value=o.value,t;let i=e.filter(o=>!vr(o));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(o=>o.issues.map(a=>at(a,n,Te())))}),t)}var Oi=m("$ZodUnion",(e,t)=>{q.init(e,t),F(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),F(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),F(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),F(e._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){let i=t.options.map(o=>o._zod.pattern);return new RegExp(`^(${i.map(o=>gi(o.source)).join("|")})$`)}});let r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(i,o)=>{if(r)return n(i,o);let a=!1,s=[];for(let c of t.options){let u=c._zod.run({value:i.value,issues:[]},o);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=>fh(c,i,e,o)):fh(s,i,e,o)}});function ph(e,t,r,n){let i=e.filter(o=>o.issues.length===0);return i.length===1?(t.value=i[0].value,t):(i.length===0?t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(o=>o.issues.map(a=>at(a,n,Te())))}):t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:[],inclusive:!1}),t)}var Ju=m("$ZodXor",(e,t)=>{Oi.init(e,t),t.inclusive=!1;let r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(i,o)=>{if(r)return n(i,o);let a=!1,s=[];for(let c of t.options){let u=c._zod.run({value:i.value,issues:[]},o);u instanceof Promise?(s.push(u),a=!0):s.push(u)}return a?Promise.all(s).then(c=>ph(c,i,e,o)):ph(s,i,e,o)}}),Ku=m("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Oi.init(e,t);let r=e._zod.parse;F(e._zod,"propValues",()=>{let i={};for(let o of t.options){let a=o._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(o)}"`);for(let[s,c]of Object.entries(a)){i[s]||(i[s]=new Set);for(let u of c)i[s].add(u)}}return i});let n=_n(()=>{let i=t.options,o=new Map;for(let a of i){let s=a._zod.propValues?.[t.discriminator];if(!s||s.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(let c of s){if(o.has(c))throw new Error(`Duplicate discriminator value "${String(c)}"`);o.set(c,a)}}return o});e._zod.parse=(i,o)=>{let a=i.value;if(!Cr(a))return i.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),i;let s=n.value.get(a?.[t.discriminator]);return s?s._zod.run(i,o):t.unionFallback?r(i,o):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:a,path:[t.discriminator],inst:e}),i)}}),Bu=m("$ZodIntersection",(e,t)=>{q.init(e,t),e._zod.parse=(r,n)=>{let i=r.value,o=t.left._zod.run({value:i,issues:[]},n),a=t.right._zod.run({value:i,issues:[]},n);return o instanceof Promise||a instanceof Promise?Promise.all([o,a]).then(([c,u])=>mh(r,c,u)):mh(r,o,a)}});function cu(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(gr(e)&&gr(t)){let r=Object.keys(t),n=Object.keys(e).filter(o=>r.indexOf(o)!==-1),i={...e,...t};for(let o of n){let a=cu(e[o],t[o]);if(!a.valid)return{valid:!1,mergeErrorPath:[o,...a.mergeErrorPath]};i[o]=a.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let n=0;n<e.length;n++){let i=e[n],o=t[n],a=cu(i,o);if(!a.valid)return{valid:!1,mergeErrorPath:[n,...a.mergeErrorPath]};r.push(a.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function mh(e,t,r){let n=new Map,i;for(let s of t.issues)if(s.code==="unrecognized_keys"){i??(i=s);for(let c of s.keys)n.has(c)||n.set(c,{}),n.get(c).l=!0}else e.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 e.issues.push(s);let o=[...n].filter(([,s])=>s.l&&s.r).map(([s])=>s);if(o.length&&i&&e.issues.push({...i,keys:o}),vr(e))return e;let a=cu(t.value,r.value);if(!a.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return e.value=a.data,e}var ma=m("$ZodTuple",(e,t)=>{q.init(e,t);let r=t.items;e._zod.parse=(n,i)=>{let o=n.value;if(!Array.isArray(o))return n.issues.push({input:o,inst:e,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(!t.rest){let l=o.length>r.length,d=o.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:o,inst:e,origin:"array"}),n}let u=-1;for(let l of r){if(u++,u>=o.length&&u>=c)continue;let d=l._zod.run({value:o[u],issues:[]},i);d instanceof Promise?a.push(d.then(p=>sa(p,n,u))):sa(d,n,u)}if(t.rest){let l=o.slice(r.length);for(let d of l){u++;let p=t.rest._zod.run({value:d,issues:[]},i);p instanceof Promise?a.push(p.then(f=>sa(f,n,u))):sa(p,n,u)}}return a.length?Promise.all(a).then(()=>n):n}});function sa(e,t,r){e.issues.length&&t.issues.push(...ht(r,e.issues)),t.value[r]=e.value}var Wu=m("$ZodRecord",(e,t)=>{q.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!gr(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),r;let o=[],a=t.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=t.valueType._zod.run({value:i[u],issues:[]},n);l instanceof Promise?o.push(l.then(d=>{d.issues.length&&r.issues.push(...ht(u,d.issues)),r.value[u]=d.value})):(l.issues.length&&r.issues.push(...ht(u,l.issues)),r.value[u]=l.value)}let c;for(let u in i)s.has(u)||(c=c??[],c.push(u));c&&c.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:c})}else{r.value={};for(let s of Reflect.ownKeys(i)){if(s==="__proto__")continue;let c=t.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"&&oa.test(s)&&c.issues.length){let d=t.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){t.mode==="loose"?r.value[s]=i[s]:r.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(d=>at(d,n,Te())),input:s,path:[s],inst:e});continue}let l=t.valueType._zod.run({value:i[s],issues:[]},n);l instanceof Promise?o.push(l.then(d=>{d.issues.length&&r.issues.push(...ht(s,d.issues)),r.value[c.value]=d.value})):(l.issues.length&&r.issues.push(...ht(s,l.issues)),r.value[c.value]=l.value)}}return o.length?Promise.all(o).then(()=>r):r}}),Gu=m("$ZodMap",(e,t)=>{q.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!(i instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:i,inst:e}),r;let o=[];r.value=new Map;for(let[a,s]of i){let c=t.keyType._zod.run({value:a,issues:[]},n),u=t.valueType._zod.run({value:s,issues:[]},n);c instanceof Promise||u instanceof Promise?o.push(Promise.all([c,u]).then(([l,d])=>{hh(l,d,r,a,i,e,n)})):hh(c,u,r,a,i,e,n)}return o.length?Promise.all(o).then(()=>r):r}});function hh(e,t,r,n,i,o,a){e.issues.length&&(vi.has(typeof n)?r.issues.push(...ht(n,e.issues)):r.issues.push({code:"invalid_key",origin:"map",input:i,inst:o,issues:e.issues.map(s=>at(s,a,Te()))})),t.issues.length&&(vi.has(typeof n)?r.issues.push(...ht(n,t.issues)):r.issues.push({origin:"map",code:"invalid_element",input:i,inst:o,key:n,issues:t.issues.map(s=>at(s,a,Te()))})),r.value.set(e.value,t.value)}var Hu=m("$ZodSet",(e,t)=>{q.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!(i instanceof Set))return r.issues.push({input:i,inst:e,expected:"set",code:"invalid_type"}),r;let o=[];r.value=new Set;for(let a of i){let s=t.valueType._zod.run({value:a,issues:[]},n);s instanceof Promise?o.push(s.then(c=>gh(c,r))):gh(s,r)}return o.length?Promise.all(o).then(()=>r):r}});function gh(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}var Xu=m("$ZodEnum",(e,t)=>{q.init(e,t);let r=hi(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(i=>vi.has(typeof i)).map(i=>typeof i=="string"?$t(i):i.toString()).join("|")})$`),e._zod.parse=(i,o)=>{let a=i.value;return n.has(a)||i.issues.push({code:"invalid_value",values:r,input:a,inst:e}),i}}),Yu=m("$ZodLiteral",(e,t)=>{if(q.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?$t(n):n?$t(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,i)=>{let o=n.value;return r.has(o)||n.issues.push({code:"invalid_value",values:t.values,input:o,inst:e}),n}}),Qu=m("$ZodFile",(e,t)=>{q.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;return i instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:i,inst:e}),r}}),el=m("$ZodTransform",(e,t)=>{q.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Ur(e.constructor.name);let i=t.transform(r.value,r);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(a=>(r.value=a,r));if(i instanceof Promise)throw new Ct;return r.value=i,r}});function vh(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}var ha=m("$ZodOptional",(e,t)=>{q.init(e,t),e._zod.optin="optional",e._zod.optout="optional",F(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),F(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${gi(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){let i=t.innerType._zod.run(r,n);return i instanceof Promise?i.then(o=>vh(o,r.value)):vh(i,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}}),tl=m("$ZodExactOptional",(e,t)=>{ha.init(e,t),F(e._zod,"values",()=>t.innerType._zod.values),F(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(r,n)=>t.innerType._zod.run(r,n)}),rl=m("$ZodNullable",(e,t)=>{q.init(e,t),F(e._zod,"optin",()=>t.innerType._zod.optin),F(e._zod,"optout",()=>t.innerType._zod.optout),F(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${gi(r.source)}|null)$`):void 0}),F(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)}),nl=m("$ZodDefault",(e,t)=>{q.init(e,t),e._zod.optin="optional",F(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);if(r.value===void 0)return r.value=t.defaultValue,r;let i=t.innerType._zod.run(r,n);return i instanceof Promise?i.then(o=>yh(o,t)):yh(i,t)}});function yh(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var il=m("$ZodPrefault",(e,t)=>{q.init(e,t),e._zod.optin="optional",F(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>(n.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,n))}),ol=m("$ZodNonOptional",(e,t)=>{q.init(e,t),F(e._zod,"values",()=>{let r=t.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),e._zod.parse=(r,n)=>{let i=t.innerType._zod.run(r,n);return i instanceof Promise?i.then(o=>_h(o,e)):_h(i,e)}});function _h(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}var al=m("$ZodSuccess",(e,t)=>{q.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Ur("ZodSuccess");let i=t.innerType._zod.run(r,n);return i instanceof Promise?i.then(o=>(r.value=o.issues.length===0,r)):(r.value=i.issues.length===0,r)}}),sl=m("$ZodCatch",(e,t)=>{q.init(e,t),F(e._zod,"optin",()=>t.innerType._zod.optin),F(e._zod,"optout",()=>t.innerType._zod.optout),F(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);let i=t.innerType._zod.run(r,n);return i instanceof Promise?i.then(o=>(r.value=o.value,o.issues.length&&(r.value=t.catchValue({...r,error:{issues:o.issues.map(a=>at(a,n,Te()))},input:r.value}),r.issues=[]),r)):(r.value=i.value,i.issues.length&&(r.value=t.catchValue({...r,error:{issues:i.issues.map(o=>at(o,n,Te()))},input:r.value}),r.issues=[]),r)}}),cl=m("$ZodNaN",(e,t)=>{q.init(e,t),e._zod.parse=(r,n)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:e,expected:"nan",code:"invalid_type"}),r)}),ul=m("$ZodPipe",(e,t)=>{q.init(e,t),F(e._zod,"values",()=>t.in._zod.values),F(e._zod,"optin",()=>t.in._zod.optin),F(e._zod,"optout",()=>t.out._zod.optout),F(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let o=t.out._zod.run(r,n);return o instanceof Promise?o.then(a=>ca(a,t.in,n)):ca(o,t.in,n)}let i=t.in._zod.run(r,n);return i instanceof Promise?i.then(o=>ca(o,t.out,n)):ca(i,t.out,n)}});function ca(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}var Ni=m("$ZodCodec",(e,t)=>{q.init(e,t),F(e._zod,"values",()=>t.in._zod.values),F(e._zod,"optin",()=>t.in._zod.optin),F(e._zod,"optout",()=>t.out._zod.optout),F(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if((n.direction||"forward")==="forward"){let o=t.in._zod.run(r,n);return o instanceof Promise?o.then(a=>ua(a,t,n)):ua(o,t,n)}else{let o=t.out._zod.run(r,n);return o instanceof Promise?o.then(a=>ua(a,t,n)):ua(o,t,n)}}});function ua(e,t,r){if(e.issues.length)return e.aborted=!0,e;if((r.direction||"forward")==="forward"){let i=t.transform(e.value,e);return i instanceof Promise?i.then(o=>la(e,o,t.out,r)):la(e,i,t.out,r)}else{let i=t.reverseTransform(e.value,e);return i instanceof Promise?i.then(o=>la(e,o,t.in,r)):la(e,i,t.in,r)}}function la(e,t,r,n){return e.issues.length?(e.aborted=!0,e):r._zod.run({value:t,issues:e.issues},n)}var ll=m("$ZodReadonly",(e,t)=>{q.init(e,t),F(e._zod,"propValues",()=>t.innerType._zod.propValues),F(e._zod,"values",()=>t.innerType._zod.values),F(e._zod,"optin",()=>t.innerType?._zod?.optin),F(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);let i=t.innerType._zod.run(r,n);return i instanceof Promise?i.then($h):$h(i)}});function $h(e){return e.value=Object.freeze(e.value),e}var dl=m("$ZodTemplateLiteral",(e,t)=>{q.init(e,t);let r=[];for(let n of t.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 i=n._zod.pattern instanceof RegExp?n._zod.pattern.source:n._zod.pattern;if(!i)throw new Error(`Invalid template literal part: ${n._zod.traits}`);let o=i.startsWith("^")?1:0,a=i.endsWith("$")?i.length-1:i.length;r.push(i.slice(o,a))}else if(n===null||Pc.has(typeof n))r.push($t(`${n}`));else throw new Error(`Invalid template literal part: ${n}`);e._zod.pattern=new RegExp(`^${r.join("")}$`),e._zod.parse=(n,i)=>typeof n.value!="string"?(n.issues.push({input:n.value,inst:e,expected:"string",code:"invalid_type"}),n):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(n.value)||n.issues.push({input:n.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),n)}),fl=m("$ZodFunction",(e,t)=>(q.init(e,t),e._def=t,e._zod.def=t,e.implement=r=>{if(typeof r!="function")throw new Error("implement() must be called with a function");return function(...n){let i=e._def.input?xi(e._def.input,n):n,o=Reflect.apply(r,this,i);return e._def.output?xi(e._def.output,o):o}},e.implementAsync=r=>{if(typeof r!="function")throw new Error("implementAsync() must be called with a function");return async function(...n){let i=e._def.input?await wi(e._def.input,n):n,o=await Reflect.apply(r,this,i);return e._def.output?await wi(e._def.output,o):o}},e._zod.parse=(r,n)=>typeof r.value!="function"?(r.issues.push({code:"invalid_type",expected:"function",input:r.value,inst:e}),r):(e._def.output&&e._def.output._zod.def.type==="promise"?r.value=e.implementAsync(r.value):r.value=e.implement(r.value),r),e.input=(...r)=>{let n=e.constructor;return Array.isArray(r[0])?new n({type:"function",input:new ma({type:"tuple",items:r[0],rest:r[1]}),output:e._def.output}):new n({type:"function",input:r[0],output:e._def.output})},e.output=r=>{let n=e.constructor;return new n({type:"function",input:e._def.input,output:r})},e)),pl=m("$ZodPromise",(e,t)=>{q.init(e,t),e._zod.parse=(r,n)=>Promise.resolve(r.value).then(i=>t.innerType._zod.run({value:i,issues:[]},n))}),ml=m("$ZodLazy",(e,t)=>{q.init(e,t),F(e._zod,"innerType",()=>t.getter()),F(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),F(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),F(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),F(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(r,n)=>e._zod.innerType._zod.run(r,n)}),hl=m("$ZodCustom",(e,t)=>{le.init(e,t),q.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,i=t.fn(n);if(i instanceof Promise)return i.then(o=>bh(o,r,n,e));bh(i,r,n,e)}});function bh(e,t,r,n){if(!e){let i={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(i.params=n._zod.def.params),t.issues.push($n(i))}}var cw=()=>{let e={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 t(i){return e[i]??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 i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,a=U(i.input),s=n[a]??a;return`Invalid input: expected ${o}, received ${s}`}case"invalid_value":return i.values.length===1?`Invalid input: expected ${R(i.values[0])}`:`Invalid option: expected one of ${Z(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",a=t(i.origin);return a?`Too big: expected ${i.origin??"value"} to have ${o}${i.maximum.toString()} ${a.unit??"elements"}`:`Too big: expected ${i.origin??"value"} to be ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",a=t(i.origin);return a?`Too small: expected ${i.origin} to have ${o}${i.minimum.toString()} ${a.unit}`:`Too small: expected ${i.origin} to be ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Invalid string: must start with "${o.prefix}"`:o.format==="ends_with"?`Invalid string: must end with "${o.suffix}"`:o.format==="includes"?`Invalid string: must include "${o.includes}"`:o.format==="regex"?`Invalid string: must match pattern ${o.pattern}`:`Invalid ${r[o.format]??i.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${i.divisor}`;case"unrecognized_keys":return`Unrecognized key${i.keys.length>1?"s":""}: ${Z(i.keys,", ")}`;case"invalid_key":return`Invalid key in ${i.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${i.origin}`;default:return"Invalid input"}}};function gl(){return{localeError:cw()}}var Ih;var yl=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let n=r[0];return this._map.set(t,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let n={...this.get(r)??{}};delete n.id;let i={...n,...this._map.get(t)};return Object.keys(i).length?i:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function _l(){return new yl}(Ih=globalThis).__zod_globalRegistry??(Ih.__zod_globalRegistry=_l());var He=globalThis.__zod_globalRegistry;function $l(e,t){return new e({type:"string",...S(t)})}function ga(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...S(t)})}function Di(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...S(t)})}function va(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...S(t)})}function ya(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...S(t)})}function _a(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...S(t)})}function $a(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...S(t)})}function Zi(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...S(t)})}function ba(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...S(t)})}function xa(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...S(t)})}function ka(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...S(t)})}function wa(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...S(t)})}function Sa(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...S(t)})}function za(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...S(t)})}function Ia(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...S(t)})}function Pa(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...S(t)})}function Ta(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...S(t)})}function bl(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...S(t)})}function Ea(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...S(t)})}function ja(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...S(t)})}function Oa(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...S(t)})}function Na(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...S(t)})}function Da(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...S(t)})}function Za(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...S(t)})}function xl(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...S(t)})}function kl(e,t){return new e({type:"string",format:"date",check:"string_format",...S(t)})}function wl(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...S(t)})}function Sl(e,t){return new e({type:"string",format:"duration",check:"string_format",...S(t)})}function zl(e,t){return new e({type:"number",checks:[],...S(t)})}function Il(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...S(t)})}function Pl(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...S(t)})}function Tl(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...S(t)})}function El(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...S(t)})}function jl(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...S(t)})}function Ol(e,t){return new e({type:"boolean",...S(t)})}function Nl(e,t){return new e({type:"bigint",...S(t)})}function Dl(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...S(t)})}function Zl(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...S(t)})}function Rl(e,t){return new e({type:"symbol",...S(t)})}function Al(e,t){return new e({type:"undefined",...S(t)})}function Ul(e,t){return new e({type:"null",...S(t)})}function Cl(e){return new e({type:"any"})}function Ml(e){return new e({type:"unknown"})}function ql(e,t){return new e({type:"never",...S(t)})}function Ll(e,t){return new e({type:"void",...S(t)})}function Fl(e,t){return new e({type:"date",...S(t)})}function Vl(e,t){return new e({type:"nan",...S(t)})}function Qt(e,t){return new au({check:"less_than",...S(t),value:e,inclusive:!1})}function gt(e,t){return new au({check:"less_than",...S(t),value:e,inclusive:!0})}function er(e,t){return new su({check:"greater_than",...S(t),value:e,inclusive:!1})}function Xe(e,t){return new su({check:"greater_than",...S(t),value:e,inclusive:!0})}function Jl(e){return er(0,e)}function Kl(e){return Qt(0,e)}function Bl(e){return gt(0,e)}function Wl(e){return Xe(0,e)}function Lr(e,t){return new Jm({check:"multiple_of",...S(t),value:e})}function Fr(e,t){return new Wm({check:"max_size",...S(t),maximum:e})}function tr(e,t){return new Gm({check:"min_size",...S(t),minimum:e})}function xn(e,t){return new Hm({check:"size_equals",...S(t),size:e})}function kn(e,t){return new Xm({check:"max_length",...S(t),maximum:e})}function yr(e,t){return new Ym({check:"min_length",...S(t),minimum:e})}function wn(e,t){return new Qm({check:"length_equals",...S(t),length:e})}function Ri(e,t){return new eh({check:"string_format",format:"regex",...S(t),pattern:e})}function Ai(e){return new th({check:"string_format",format:"lowercase",...S(e)})}function Ui(e){return new rh({check:"string_format",format:"uppercase",...S(e)})}function Ci(e,t){return new nh({check:"string_format",format:"includes",...S(t),includes:e})}function Mi(e,t){return new ih({check:"string_format",format:"starts_with",...S(t),prefix:e})}function qi(e,t){return new oh({check:"string_format",format:"ends_with",...S(t),suffix:e})}function Gl(e,t,r){return new ah({check:"property",property:e,schema:t,...S(r)})}function Li(e,t){return new sh({check:"mime_type",mime:e,...S(t)})}function Mt(e){return new ch({check:"overwrite",tx:e})}function Fi(e){return Mt(t=>t.normalize(e))}function Vi(){return Mt(e=>e.trim())}function Ji(){return Mt(e=>e.toLowerCase())}function Ki(){return Mt(e=>e.toUpperCase())}function Ra(){return Mt(e=>Sc(e))}function Ph(e,t,r){return new e({type:"array",element:t,...S(r)})}function Hl(e,t){return new e({type:"file",...S(t)})}function Xl(e,t,r){let n=S(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}function Yl(e,t,r){return new e({type:"custom",check:"custom",fn:t,...S(r)})}function Ql(e){let t=fw(r=>(r.addIssue=n=>{if(typeof n=="string")r.issues.push($n(n,r.value,t._zod.def));else{let i=n;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=r.value),i.inst??(i.inst=t),i.continue??(i.continue=!t._zod.def.abort),r.issues.push($n(i))}},e(r.value,r)));return t}function fw(e,t){let r=new le({check:"custom",...S(t)});return r._zod.check=e,r}function ed(e){let t=new le({check:"describe"});return t._zod.onattach=[r=>{let n=He.get(r)??{};He.add(r,{...n,description:e})}],t._zod.check=()=>{},t}function td(e){let t=new le({check:"meta"});return t._zod.onattach=[r=>{let n=He.get(r)??{};He.add(r,{...n,...e})}],t._zod.check=()=>{},t}function rd(e,t){let r=S(t),n=r.truthy??["true","1","yes","on","y","enabled"],i=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(n=n.map(f=>typeof f=="string"?f.toLowerCase():f),i=i.map(f=>typeof f=="string"?f.toLowerCase():f));let o=new Set(n),a=new Set(i),s=e.Codec??Ni,c=e.Boolean??ji,u=e.String??qr,l=new u({type:"string",error:r.error}),d=new c({type:"boolean",error:r.error}),p=new s({type:"pipe",in:l,out:d,transform:((f,h)=>{let g=f;return r.case!=="sensitive"&&(g=g.toLowerCase()),o.has(g)?!0:a.has(g)?!1:(h.issues.push({code:"invalid_value",expected:"stringbool",values:[...o,...a],input:h.value,inst:p,continue:!1}),{})}),reverseTransform:((f,h)=>f===!0?n[0]||"true":i[0]||"false"),error:r.error});return p}function Sn(e,t,r,n={}){let i=S(n),o={...S(n),check:"string_format",type:"string",format:t,fn:typeof r=="function"?r:s=>r.test(s),...i};return r instanceof RegExp&&(o.pattern=r),new e(o)}function Aa(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??He,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function he(e,t,r={path:[],schemaPath:[]}){var n;let i=e._zod.def,o=t.seen.get(e);if(o)return o.count++,r.schemaPath.includes(e)&&(o.cycle=r.path),o.schema;let a={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,a);let s=e._zod.toJSONSchema?.();if(s)a.schema=s;else{let l={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,l);else{let p=a.schema,f=t.processors[i.type];if(!f)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);f(e,t,p,l)}let d=e._zod.parent;d&&(a.ref||(a.ref=d),he(d,t,l),t.seen.get(d).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(a.schema,c),t.io==="input"&&Ye(e)&&(delete a.schema.examples,delete a.schema.default),t.io==="input"&&a.schema._prefault&&((n=a.schema).default??(n.default=a.schema._prefault)),delete a.schema._prefault,t.seen.get(e).schema}function Ua(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let n=new Map;for(let a of e.seen.entries()){let s=e.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 i=a=>{let s=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let d=e.external.registry.get(a[0])?.id,p=e.external.uri??(h=>h);if(d)return{ref:p(d)};let f=a[1].defId??a[1].schema.id??`schema${e.counter++}`;return a[1].defId=f,{defId:f,ref:`${p("__shared")}#/${s}/${f}`}}if(a[1]===r)return{ref:"#"};let u=`#/${s}/`,l=a[1].schema.id??`__schema${e.counter++}`;return{defId:l,ref:u+l}},o=a=>{if(a[1].schema.$ref)return;let s=a[1],{ref:c,defId:u}=i(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(e.cycles==="throw")for(let a of e.seen.entries()){let s=a[1];if(s.cycle)throw new Error(`Cycle detected: #/${s.cycle?.join("/")}/<root>
|
|
52
|
+
|
|
53
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let a of e.seen.entries()){let s=a[1];if(t===a[0]){o(a);continue}if(e.external){let u=e.external.registry.get(a[0])?.id;if(t!==a[0]&&u){o(a);continue}}if(e.metadataRegistry.get(a[0])?.id){o(a);continue}if(s.cycle){o(a);continue}if(s.count>1&&e.reused==="ref"){o(a);continue}}}function Ca(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let n=a=>{let s=e.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 p=e.seen.get(l),f=p.schema;if(f.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.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 g in c)g==="$ref"||g==="allOf"||g in u||delete c[g];if(f.$ref&&p.def)for(let g in c)g==="$ref"||g==="allOf"||g in p.def&&JSON.stringify(c[g])===JSON.stringify(p.def[g])&&delete c[g]}let d=a._zod.parent;if(d&&d!==l){n(d);let p=e.seen.get(d);if(p?.schema.$ref&&(c.$ref=p.schema.$ref,p.def))for(let f in c)f==="$ref"||f==="allOf"||f in p.def&&JSON.stringify(c[f])===JSON.stringify(p.def[f])&&delete c[f]}e.override({zodSchema:a,jsonSchema:c,path:s.path??[]})};for(let a of[...e.seen.entries()].reverse())n(a[0]);let i={};if(e.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let a=e.external.registry.get(t)?.id;if(!a)throw new Error("Schema is missing an `id` property");i.$id=e.external.uri(a)}Object.assign(i,r.def??r.schema);let o=e.external?.defs??{};for(let a of e.seen.entries()){let s=a[1];s.def&&s.defId&&(o[s.defId]=s.def)}e.external||Object.keys(o).length>0&&(e.target==="draft-2020-12"?i.$defs=o:i.definitions=o);try{let a=JSON.parse(JSON.stringify(i));return Object.defineProperty(a,"~standard",{value:{...t["~standard"],jsonSchema:{input:Bi(t,"input",e.processors),output:Bi(t,"output",e.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function Ye(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let n=e._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return Ye(n.element,r);if(n.type==="set")return Ye(n.valueType,r);if(n.type==="lazy")return Ye(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 Ye(n.innerType,r);if(n.type==="intersection")return Ye(n.left,r)||Ye(n.right,r);if(n.type==="record"||n.type==="map")return Ye(n.keyType,r)||Ye(n.valueType,r);if(n.type==="pipe")return Ye(n.in,r)||Ye(n.out,r);if(n.type==="object"){for(let i in n.shape)if(Ye(n.shape[i],r))return!0;return!1}if(n.type==="union"){for(let i of n.options)if(Ye(i,r))return!0;return!1}if(n.type==="tuple"){for(let i of n.items)if(Ye(i,r))return!0;return!!(n.rest&&Ye(n.rest,r))}return!1}var Th=(e,t={})=>r=>{let n=Aa({...r,processors:t});return he(e,n),Ua(n,e),Ca(n,e)},Bi=(e,t,r={})=>n=>{let{libraryOptions:i,target:o}=n??{},a=Aa({...i??{},target:o,io:t,processors:r});return he(e,a),Ua(a,e),Ca(a,e)};var pw={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Eh=(e,t,r,n)=>{let i=r;i.type="string";let{minimum:o,maximum:a,format:s,patterns:c,contentEncoding:u}=e._zod.bag;if(typeof o=="number"&&(i.minLength=o),typeof a=="number"&&(i.maxLength=a),s&&(i.format=pw[s]??s,i.format===""&&delete i.format,s==="time"&&delete i.format),u&&(i.contentEncoding=u),c&&c.size>0){let l=[...c];l.length===1?i.pattern=l[0].source:l.length>1&&(i.allOf=[...l.map(d=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},jh=(e,t,r,n)=>{let i=r,{minimum:o,maximum:a,format:s,multipleOf:c,exclusiveMaximum:u,exclusiveMinimum:l}=e._zod.bag;typeof s=="string"&&s.includes("int")?i.type="integer":i.type="number",typeof l=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l),typeof o=="number"&&(i.minimum=o,typeof l=="number"&&t.target!=="draft-04"&&(l>=o?delete i.minimum:delete i.exclusiveMinimum)),typeof u=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(i.maximum=u,i.exclusiveMaximum=!0):i.exclusiveMaximum=u),typeof a=="number"&&(i.maximum=a,typeof u=="number"&&t.target!=="draft-04"&&(u<=a?delete i.maximum:delete i.exclusiveMaximum)),typeof c=="number"&&(i.multipleOf=c)},Oh=(e,t,r,n)=>{r.type="boolean"},Nh=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},Dh=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},Zh=(e,t,r,n)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},Rh=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},Ah=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},Uh=(e,t,r,n)=>{r.not={}},Ch=(e,t,r,n)=>{},Mh=(e,t,r,n)=>{},qh=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},Lh=(e,t,r,n)=>{let i=e._zod.def,o=hi(i.entries);o.every(a=>typeof a=="number")&&(r.type="number"),o.every(a=>typeof a=="string")&&(r.type="string"),r.enum=o},Fh=(e,t,r,n)=>{let i=e._zod.def,o=[];for(let a of i.values)if(a===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof a=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");o.push(Number(a))}else o.push(a);if(o.length!==0)if(o.length===1){let a=o[0];r.type=a===null?"null":typeof a,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[a]:r.const=a}else o.every(a=>typeof a=="number")&&(r.type="number"),o.every(a=>typeof a=="string")&&(r.type="string"),o.every(a=>typeof a=="boolean")&&(r.type="boolean"),o.every(a=>a===null)&&(r.type="null"),r.enum=o},Vh=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},Jh=(e,t,r,n)=>{let i=r,o=e._zod.pattern;if(!o)throw new Error("Pattern not found in template literal");i.type="string",i.pattern=o.source},Kh=(e,t,r,n)=>{let i=r,o={type:"string",format:"binary",contentEncoding:"binary"},{minimum:a,maximum:s,mime:c}=e._zod.bag;a!==void 0&&(o.minLength=a),s!==void 0&&(o.maxLength=s),c?c.length===1?(o.contentMediaType=c[0],Object.assign(i,o)):(Object.assign(i,o),i.anyOf=c.map(u=>({contentMediaType:u}))):Object.assign(i,o)},Bh=(e,t,r,n)=>{r.type="boolean"},Wh=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Gh=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},Hh=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Xh=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},Yh=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},Qh=(e,t,r,n)=>{let i=r,o=e._zod.def,{minimum:a,maximum:s}=e._zod.bag;typeof a=="number"&&(i.minItems=a),typeof s=="number"&&(i.maxItems=s),i.type="array",i.items=he(o.element,t,{...n,path:[...n.path,"items"]})},eg=(e,t,r,n)=>{let i=r,o=e._zod.def;i.type="object",i.properties={};let a=o.shape;for(let u in a)i.properties[u]=he(a[u],t,{...n,path:[...n.path,"properties",u]});let s=new Set(Object.keys(a)),c=new Set([...s].filter(u=>{let l=o.shape[u]._zod;return t.io==="input"?l.optin===void 0:l.optout===void 0}));c.size>0&&(i.required=Array.from(c)),o.catchall?._zod.def.type==="never"?i.additionalProperties=!1:o.catchall?o.catchall&&(i.additionalProperties=he(o.catchall,t,{...n,path:[...n.path,"additionalProperties"]})):t.io==="output"&&(i.additionalProperties=!1)},nd=(e,t,r,n)=>{let i=e._zod.def,o=i.inclusive===!1,a=i.options.map((s,c)=>he(s,t,{...n,path:[...n.path,o?"oneOf":"anyOf",c]}));o?r.oneOf=a:r.anyOf=a},tg=(e,t,r,n)=>{let i=e._zod.def,o=he(i.left,t,{...n,path:[...n.path,"allOf",0]}),a=he(i.right,t,{...n,path:[...n.path,"allOf",1]}),s=u=>"allOf"in u&&Object.keys(u).length===1,c=[...s(o)?o.allOf:[o],...s(a)?a.allOf:[a]];r.allOf=c},rg=(e,t,r,n)=>{let i=r,o=e._zod.def;i.type="array";let a=t.target==="draft-2020-12"?"prefixItems":"items",s=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",c=o.items.map((p,f)=>he(p,t,{...n,path:[...n.path,a,f]})),u=o.rest?he(o.rest,t,{...n,path:[...n.path,s,...t.target==="openapi-3.0"?[o.items.length]:[]]}):null;t.target==="draft-2020-12"?(i.prefixItems=c,u&&(i.items=u)):t.target==="openapi-3.0"?(i.items={anyOf:c},u&&i.items.anyOf.push(u),i.minItems=c.length,u||(i.maxItems=c.length)):(i.items=c,u&&(i.additionalItems=u));let{minimum:l,maximum:d}=e._zod.bag;typeof l=="number"&&(i.minItems=l),typeof d=="number"&&(i.maxItems=d)},ng=(e,t,r,n)=>{let i=r,o=e._zod.def;i.type="object";let a=o.keyType,c=a._zod.bag?.patterns;if(o.mode==="loose"&&c&&c.size>0){let l=he(o.valueType,t,{...n,path:[...n.path,"patternProperties","*"]});i.patternProperties={};for(let d of c)i.patternProperties[d.source]=l}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(i.propertyNames=he(o.keyType,t,{...n,path:[...n.path,"propertyNames"]})),i.additionalProperties=he(o.valueType,t,{...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&&(i.required=l)}},ig=(e,t,r,n)=>{let i=e._zod.def,o=he(i.innerType,t,n),a=t.seen.get(e);t.target==="openapi-3.0"?(a.ref=i.innerType,r.nullable=!0):r.anyOf=[o,{type:"null"}]},og=(e,t,r,n)=>{let i=e._zod.def;he(i.innerType,t,n);let o=t.seen.get(e);o.ref=i.innerType},ag=(e,t,r,n)=>{let i=e._zod.def;he(i.innerType,t,n);let o=t.seen.get(e);o.ref=i.innerType,r.default=JSON.parse(JSON.stringify(i.defaultValue))},sg=(e,t,r,n)=>{let i=e._zod.def;he(i.innerType,t,n);let o=t.seen.get(e);o.ref=i.innerType,t.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},cg=(e,t,r,n)=>{let i=e._zod.def;he(i.innerType,t,n);let o=t.seen.get(e);o.ref=i.innerType;let a;try{a=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=a},ug=(e,t,r,n)=>{let i=e._zod.def,o=t.io==="input"?i.in._zod.def.type==="transform"?i.out:i.in:i.out;he(o,t,n);let a=t.seen.get(e);a.ref=o},lg=(e,t,r,n)=>{let i=e._zod.def;he(i.innerType,t,n);let o=t.seen.get(e);o.ref=i.innerType,r.readOnly=!0},dg=(e,t,r,n)=>{let i=e._zod.def;he(i.innerType,t,n);let o=t.seen.get(e);o.ref=i.innerType},id=(e,t,r,n)=>{let i=e._zod.def;he(i.innerType,t,n);let o=t.seen.get(e);o.ref=i.innerType},fg=(e,t,r,n)=>{let i=e._zod.innerType;he(i,t,n);let o=t.seen.get(e);o.ref=i};function zn(e){return!!e._zod}function _r(e,t){return zn(e)?bn(e,t):e.safeParse(t)}function Ma(e){if(!e)return;let t;if(zn(e)?t=e._zod?.def?.shape:t=e.shape,!!t){if(typeof t=="function")try{return t()}catch{return}return t}}function gg(e){if(zn(e)){let o=e._zod?.def;if(o){if(o.value!==void 0)return o.value;if(Array.isArray(o.values)&&o.values.length>0)return o.values[0]}}let r=e._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=e.value;if(n!==void 0)return n}var Wi={};ti(Wi,{ZodAny:()=>Dg,ZodArray:()=>Ug,ZodBase64:()=>Pd,ZodBase64URL:()=>Td,ZodBigInt:()=>Ga,ZodBigIntFormat:()=>Od,ZodBoolean:()=>Wa,ZodCIDRv4:()=>zd,ZodCIDRv6:()=>Id,ZodCUID:()=>_d,ZodCUID2:()=>$d,ZodCatch:()=>iv,ZodCodec:()=>Cd,ZodCustom:()=>es,ZodCustomStringFormat:()=>Hi,ZodDate:()=>Dd,ZodDefault:()=>Yg,ZodDiscriminatedUnion:()=>Mg,ZodE164:()=>Ed,ZodEmail:()=>gd,ZodEmoji:()=>vd,ZodEnum:()=>Gi,ZodExactOptional:()=>Gg,ZodFile:()=>Bg,ZodFunction:()=>pv,ZodGUID:()=>La,ZodIPv4:()=>wd,ZodIPv6:()=>Sd,ZodIntersection:()=>qg,ZodJWT:()=>jd,ZodKSUID:()=>kd,ZodLazy:()=>lv,ZodLiteral:()=>Kg,ZodMAC:()=>Eg,ZodMap:()=>Vg,ZodNaN:()=>av,ZodNanoID:()=>yd,ZodNever:()=>Rg,ZodNonOptional:()=>Ad,ZodNull:()=>Ng,ZodNullable:()=>Xg,ZodNumber:()=>Ba,ZodNumberFormat:()=>In,ZodObject:()=>Ha,ZodOptional:()=>Rd,ZodPipe:()=>Ud,ZodPrefault:()=>ev,ZodPromise:()=>fv,ZodReadonly:()=>sv,ZodRecord:()=>Qa,ZodSet:()=>Jg,ZodString:()=>Ja,ZodStringFormat:()=>de,ZodSuccess:()=>nv,ZodSymbol:()=>jg,ZodTemplateLiteral:()=>uv,ZodTransform:()=>Wg,ZodTuple:()=>Lg,ZodType:()=>V,ZodULID:()=>bd,ZodURL:()=>Ka,ZodUUID:()=>rr,ZodUndefined:()=>Og,ZodUnion:()=>Xa,ZodUnknown:()=>Zg,ZodVoid:()=>Ag,ZodXID:()=>xd,ZodXor:()=>Cg,_ZodString:()=>hd,_default:()=>Qg,_function:()=>jS,any:()=>pS,array:()=>H,base64:()=>Hw,base64url:()=>Xw,bigint:()=>cS,boolean:()=>Pe,catch:()=>ov,check:()=>OS,cidrv4:()=>Ww,cidrv6:()=>Gw,codec:()=>PS,cuid:()=>Mw,cuid2:()=>qw,custom:()=>Md,date:()=>hS,describe:()=>NS,discriminatedUnion:()=>Ya,e164:()=>Yw,email:()=>Ew,emoji:()=>Uw,enum:()=>Fe,exactOptional:()=>Hg,file:()=>wS,float32:()=>iS,float64:()=>oS,function:()=>jS,guid:()=>jw,hash:()=>nS,hex:()=>rS,hostname:()=>tS,httpUrl:()=>Aw,instanceof:()=>ZS,int:()=>md,int32:()=>aS,int64:()=>uS,intersection:()=>Yi,ipv4:()=>Jw,ipv6:()=>Bw,json:()=>AS,jwt:()=>Qw,keyof:()=>gS,ksuid:()=>Vw,lazy:()=>dv,literal:()=>E,looseObject:()=>Le,looseRecord:()=>$S,mac:()=>Kw,map:()=>bS,meta:()=>DS,nan:()=>IS,nanoid:()=>Cw,nativeEnum:()=>kS,never:()=>Nd,nonoptional:()=>rv,null:()=>Xi,nullable:()=>Fa,nullish:()=>SS,number:()=>ae,object:()=>I,optional:()=>ve,partialRecord:()=>_S,pipe:()=>Va,prefault:()=>tv,preprocess:()=>ts,promise:()=>ES,readonly:()=>cv,record:()=>ge,refine:()=>mv,set:()=>xS,strictObject:()=>vS,string:()=>v,stringFormat:()=>eS,stringbool:()=>RS,success:()=>zS,superRefine:()=>hv,symbol:()=>dS,templateLiteral:()=>TS,transform:()=>Zd,tuple:()=>Fg,uint32:()=>sS,uint64:()=>lS,ulid:()=>Lw,undefined:()=>fS,union:()=>ce,unknown:()=>fe,url:()=>Rw,uuid:()=>Ow,uuidv4:()=>Nw,uuidv6:()=>Dw,uuidv7:()=>Zw,void:()=>mS,xid:()=>Fw,xor:()=>yS});var qa={};ti(qa,{endsWith:()=>qi,gt:()=>er,gte:()=>Xe,includes:()=>Ci,length:()=>wn,lowercase:()=>Ai,lt:()=>Qt,lte:()=>gt,maxLength:()=>kn,maxSize:()=>Fr,mime:()=>Li,minLength:()=>yr,minSize:()=>tr,multipleOf:()=>Lr,negative:()=>Kl,nonnegative:()=>Wl,nonpositive:()=>Bl,normalize:()=>Fi,overwrite:()=>Mt,positive:()=>Jl,property:()=>Gl,regex:()=>Ri,size:()=>xn,slugify:()=>Ra,startsWith:()=>Mi,toLowerCase:()=>Ji,toUpperCase:()=>Ki,trim:()=>Vi,uppercase:()=>Ui});var Vr={};ti(Vr,{ZodISODate:()=>cd,ZodISODateTime:()=>ad,ZodISODuration:()=>fd,ZodISOTime:()=>ld,date:()=>ud,datetime:()=>sd,duration:()=>pd,time:()=>dd});var ad=m("ZodISODateTime",(e,t)=>{$u.init(e,t),de.init(e,t)});function sd(e){return xl(ad,e)}var cd=m("ZodISODate",(e,t)=>{bu.init(e,t),de.init(e,t)});function ud(e){return kl(cd,e)}var ld=m("ZodISOTime",(e,t)=>{xu.init(e,t),de.init(e,t)});function dd(e){return wl(ld,e)}var fd=m("ZodISODuration",(e,t)=>{ku.init(e,t),de.init(e,t)});function pd(e){return Sl(fd,e)}var vg=(e,t)=>{ta.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>na(e,r)},flatten:{value:r=>ra(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,yn,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,yn,2)}},isEmpty:{get(){return e.issues.length===0}}})},k6=m("ZodError",vg),vt=m("ZodError",vg,{Parent:Error});var yg=bi(vt),_g=ki(vt),$g=Si(vt),bg=zi(vt),xg=Om(vt),kg=Nm(vt),wg=Dm(vt),Sg=Zm(vt),zg=Rm(vt),Ig=Am(vt),Pg=Um(vt),Tg=Cm(vt);var V=m("ZodType",(e,t)=>(q.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Bi(e,"input"),output:Bi(e,"output")}}),e.toJSONSchema=Th(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone(x.mergeDefs(t,{checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0}),e.with=e.check,e.clone=(r,n)=>Ge(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.parse=(r,n)=>yg(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>$g(e,r,n),e.parseAsync=async(r,n)=>_g(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>bg(e,r,n),e.spa=e.safeParseAsync,e.encode=(r,n)=>xg(e,r,n),e.decode=(r,n)=>kg(e,r,n),e.encodeAsync=async(r,n)=>wg(e,r,n),e.decodeAsync=async(r,n)=>Sg(e,r,n),e.safeEncode=(r,n)=>zg(e,r,n),e.safeDecode=(r,n)=>Ig(e,r,n),e.safeEncodeAsync=async(r,n)=>Pg(e,r,n),e.safeDecodeAsync=async(r,n)=>Tg(e,r,n),e.refine=(r,n)=>e.check(mv(r,n)),e.superRefine=r=>e.check(hv(r)),e.overwrite=r=>e.check(Mt(r)),e.optional=()=>ve(e),e.exactOptional=()=>Hg(e),e.nullable=()=>Fa(e),e.nullish=()=>ve(Fa(e)),e.nonoptional=r=>rv(e,r),e.array=()=>H(e),e.or=r=>ce([e,r]),e.and=r=>Yi(e,r),e.transform=r=>Va(e,Zd(r)),e.default=r=>Qg(e,r),e.prefault=r=>tv(e,r),e.catch=r=>ov(e,r),e.pipe=r=>Va(e,r),e.readonly=()=>cv(e),e.describe=r=>{let n=e.clone();return He.add(n,{description:r}),n},Object.defineProperty(e,"description",{get(){return He.get(e)?.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return He.get(e);let n=e.clone();return He.add(n,r[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=r=>r(e),e)),hd=m("_ZodString",(e,t)=>{qr.init(e,t),V.init(e,t),e._zod.processJSONSchema=(n,i,o)=>Eh(e,n,i,o);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...n)=>e.check(Ri(...n)),e.includes=(...n)=>e.check(Ci(...n)),e.startsWith=(...n)=>e.check(Mi(...n)),e.endsWith=(...n)=>e.check(qi(...n)),e.min=(...n)=>e.check(yr(...n)),e.max=(...n)=>e.check(kn(...n)),e.length=(...n)=>e.check(wn(...n)),e.nonempty=(...n)=>e.check(yr(1,...n)),e.lowercase=n=>e.check(Ai(n)),e.uppercase=n=>e.check(Ui(n)),e.trim=()=>e.check(Vi()),e.normalize=(...n)=>e.check(Fi(...n)),e.toLowerCase=()=>e.check(Ji()),e.toUpperCase=()=>e.check(Ki()),e.slugify=()=>e.check(Ra())}),Ja=m("ZodString",(e,t)=>{qr.init(e,t),hd.init(e,t),e.email=r=>e.check(ga(gd,r)),e.url=r=>e.check(Zi(Ka,r)),e.jwt=r=>e.check(Za(jd,r)),e.emoji=r=>e.check(ba(vd,r)),e.guid=r=>e.check(Di(La,r)),e.uuid=r=>e.check(va(rr,r)),e.uuidv4=r=>e.check(ya(rr,r)),e.uuidv6=r=>e.check(_a(rr,r)),e.uuidv7=r=>e.check($a(rr,r)),e.nanoid=r=>e.check(xa(yd,r)),e.guid=r=>e.check(Di(La,r)),e.cuid=r=>e.check(ka(_d,r)),e.cuid2=r=>e.check(wa($d,r)),e.ulid=r=>e.check(Sa(bd,r)),e.base64=r=>e.check(Oa(Pd,r)),e.base64url=r=>e.check(Na(Td,r)),e.xid=r=>e.check(za(xd,r)),e.ksuid=r=>e.check(Ia(kd,r)),e.ipv4=r=>e.check(Pa(wd,r)),e.ipv6=r=>e.check(Ta(Sd,r)),e.cidrv4=r=>e.check(Ea(zd,r)),e.cidrv6=r=>e.check(ja(Id,r)),e.e164=r=>e.check(Da(Ed,r)),e.datetime=r=>e.check(sd(r)),e.date=r=>e.check(ud(r)),e.time=r=>e.check(dd(r)),e.duration=r=>e.check(pd(r))});function v(e){return $l(Ja,e)}var de=m("ZodStringFormat",(e,t)=>{se.init(e,t),hd.init(e,t)}),gd=m("ZodEmail",(e,t)=>{du.init(e,t),de.init(e,t)});function Ew(e){return ga(gd,e)}var La=m("ZodGUID",(e,t)=>{uu.init(e,t),de.init(e,t)});function jw(e){return Di(La,e)}var rr=m("ZodUUID",(e,t)=>{lu.init(e,t),de.init(e,t)});function Ow(e){return va(rr,e)}function Nw(e){return ya(rr,e)}function Dw(e){return _a(rr,e)}function Zw(e){return $a(rr,e)}var Ka=m("ZodURL",(e,t)=>{fu.init(e,t),de.init(e,t)});function Rw(e){return Zi(Ka,e)}function Aw(e){return Zi(Ka,{protocol:/^https?$/,hostname:bt.domain,...x.normalizeParams(e)})}var vd=m("ZodEmoji",(e,t)=>{pu.init(e,t),de.init(e,t)});function Uw(e){return ba(vd,e)}var yd=m("ZodNanoID",(e,t)=>{mu.init(e,t),de.init(e,t)});function Cw(e){return xa(yd,e)}var _d=m("ZodCUID",(e,t)=>{hu.init(e,t),de.init(e,t)});function Mw(e){return ka(_d,e)}var $d=m("ZodCUID2",(e,t)=>{gu.init(e,t),de.init(e,t)});function qw(e){return wa($d,e)}var bd=m("ZodULID",(e,t)=>{vu.init(e,t),de.init(e,t)});function Lw(e){return Sa(bd,e)}var xd=m("ZodXID",(e,t)=>{yu.init(e,t),de.init(e,t)});function Fw(e){return za(xd,e)}var kd=m("ZodKSUID",(e,t)=>{_u.init(e,t),de.init(e,t)});function Vw(e){return Ia(kd,e)}var wd=m("ZodIPv4",(e,t)=>{wu.init(e,t),de.init(e,t)});function Jw(e){return Pa(wd,e)}var Eg=m("ZodMAC",(e,t)=>{zu.init(e,t),de.init(e,t)});function Kw(e){return bl(Eg,e)}var Sd=m("ZodIPv6",(e,t)=>{Su.init(e,t),de.init(e,t)});function Bw(e){return Ta(Sd,e)}var zd=m("ZodCIDRv4",(e,t)=>{Iu.init(e,t),de.init(e,t)});function Ww(e){return Ea(zd,e)}var Id=m("ZodCIDRv6",(e,t)=>{Pu.init(e,t),de.init(e,t)});function Gw(e){return ja(Id,e)}var Pd=m("ZodBase64",(e,t)=>{Tu.init(e,t),de.init(e,t)});function Hw(e){return Oa(Pd,e)}var Td=m("ZodBase64URL",(e,t)=>{Eu.init(e,t),de.init(e,t)});function Xw(e){return Na(Td,e)}var Ed=m("ZodE164",(e,t)=>{ju.init(e,t),de.init(e,t)});function Yw(e){return Da(Ed,e)}var jd=m("ZodJWT",(e,t)=>{Ou.init(e,t),de.init(e,t)});function Qw(e){return Za(jd,e)}var Hi=m("ZodCustomStringFormat",(e,t)=>{Nu.init(e,t),de.init(e,t)});function eS(e,t,r={}){return Sn(Hi,e,t,r)}function tS(e){return Sn(Hi,"hostname",bt.hostname,e)}function rS(e){return Sn(Hi,"hex",bt.hex,e)}function nS(e,t){let r=t?.enc??"hex",n=`${e}_${r}`,i=bt[n];if(!i)throw new Error(`Unrecognized hash format: ${n}`);return Sn(Hi,n,i,t)}var Ba=m("ZodNumber",(e,t)=>{fa.init(e,t),V.init(e,t),e._zod.processJSONSchema=(n,i,o)=>jh(e,n,i,o),e.gt=(n,i)=>e.check(er(n,i)),e.gte=(n,i)=>e.check(Xe(n,i)),e.min=(n,i)=>e.check(Xe(n,i)),e.lt=(n,i)=>e.check(Qt(n,i)),e.lte=(n,i)=>e.check(gt(n,i)),e.max=(n,i)=>e.check(gt(n,i)),e.int=n=>e.check(md(n)),e.safe=n=>e.check(md(n)),e.positive=n=>e.check(er(0,n)),e.nonnegative=n=>e.check(Xe(0,n)),e.negative=n=>e.check(Qt(0,n)),e.nonpositive=n=>e.check(gt(0,n)),e.multipleOf=(n,i)=>e.check(Lr(n,i)),e.step=(n,i)=>e.check(Lr(n,i)),e.finite=()=>e;let r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function ae(e){return zl(Ba,e)}var In=m("ZodNumberFormat",(e,t)=>{Du.init(e,t),Ba.init(e,t)});function md(e){return Il(In,e)}function iS(e){return Pl(In,e)}function oS(e){return Tl(In,e)}function aS(e){return El(In,e)}function sS(e){return jl(In,e)}var Wa=m("ZodBoolean",(e,t)=>{ji.init(e,t),V.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Oh(e,r,n,i)});function Pe(e){return Ol(Wa,e)}var Ga=m("ZodBigInt",(e,t)=>{pa.init(e,t),V.init(e,t),e._zod.processJSONSchema=(n,i,o)=>Nh(e,n,i,o),e.gte=(n,i)=>e.check(Xe(n,i)),e.min=(n,i)=>e.check(Xe(n,i)),e.gt=(n,i)=>e.check(er(n,i)),e.gte=(n,i)=>e.check(Xe(n,i)),e.min=(n,i)=>e.check(Xe(n,i)),e.lt=(n,i)=>e.check(Qt(n,i)),e.lte=(n,i)=>e.check(gt(n,i)),e.max=(n,i)=>e.check(gt(n,i)),e.positive=n=>e.check(er(BigInt(0),n)),e.negative=n=>e.check(Qt(BigInt(0),n)),e.nonpositive=n=>e.check(gt(BigInt(0),n)),e.nonnegative=n=>e.check(Xe(BigInt(0),n)),e.multipleOf=(n,i)=>e.check(Lr(n,i));let r=e._zod.bag;e.minValue=r.minimum??null,e.maxValue=r.maximum??null,e.format=r.format??null});function cS(e){return Nl(Ga,e)}var Od=m("ZodBigIntFormat",(e,t)=>{Zu.init(e,t),Ga.init(e,t)});function uS(e){return Dl(Od,e)}function lS(e){return Zl(Od,e)}var jg=m("ZodSymbol",(e,t)=>{Ru.init(e,t),V.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Dh(e,r,n,i)});function dS(e){return Rl(jg,e)}var Og=m("ZodUndefined",(e,t)=>{Au.init(e,t),V.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Rh(e,r,n,i)});function fS(e){return Al(Og,e)}var Ng=m("ZodNull",(e,t)=>{Uu.init(e,t),V.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Zh(e,r,n,i)});function Xi(e){return Ul(Ng,e)}var Dg=m("ZodAny",(e,t)=>{Cu.init(e,t),V.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Ch(e,r,n,i)});function pS(){return Cl(Dg)}var Zg=m("ZodUnknown",(e,t)=>{Mu.init(e,t),V.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Mh(e,r,n,i)});function fe(){return Ml(Zg)}var Rg=m("ZodNever",(e,t)=>{qu.init(e,t),V.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Uh(e,r,n,i)});function Nd(e){return ql(Rg,e)}var Ag=m("ZodVoid",(e,t)=>{Lu.init(e,t),V.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Ah(e,r,n,i)});function mS(e){return Ll(Ag,e)}var Dd=m("ZodDate",(e,t)=>{Fu.init(e,t),V.init(e,t),e._zod.processJSONSchema=(n,i,o)=>qh(e,n,i,o),e.min=(n,i)=>e.check(Xe(n,i)),e.max=(n,i)=>e.check(gt(n,i));let r=e._zod.bag;e.minDate=r.minimum?new Date(r.minimum):null,e.maxDate=r.maximum?new Date(r.maximum):null});function hS(e){return Fl(Dd,e)}var Ug=m("ZodArray",(e,t)=>{Vu.init(e,t),V.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Qh(e,r,n,i),e.element=t.element,e.min=(r,n)=>e.check(yr(r,n)),e.nonempty=r=>e.check(yr(1,r)),e.max=(r,n)=>e.check(kn(r,n)),e.length=(r,n)=>e.check(wn(r,n)),e.unwrap=()=>e.element});function H(e,t){return Ph(Ug,e,t)}function gS(e){let t=e._zod.def.shape;return Fe(Object.keys(t))}var Ha=m("ZodObject",(e,t)=>{zh.init(e,t),V.init(e,t),e._zod.processJSONSchema=(r,n,i)=>eg(e,r,n,i),x.defineLazy(e,"shape",()=>t.shape),e.keyof=()=>Fe(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:fe()}),e.loose=()=>e.clone({...e._zod.def,catchall:fe()}),e.strict=()=>e.clone({...e._zod.def,catchall:Nd()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>x.extend(e,r),e.safeExtend=r=>x.safeExtend(e,r),e.merge=r=>x.merge(e,r),e.pick=r=>x.pick(e,r),e.omit=r=>x.omit(e,r),e.partial=(...r)=>x.partial(Rd,e,r[0]),e.required=(...r)=>x.required(Ad,e,r[0])});function I(e,t){let r={type:"object",shape:e??{},...x.normalizeParams(t)};return new Ha(r)}function vS(e,t){return new Ha({type:"object",shape:e,catchall:Nd(),...x.normalizeParams(t)})}function Le(e,t){return new Ha({type:"object",shape:e,catchall:fe(),...x.normalizeParams(t)})}var Xa=m("ZodUnion",(e,t)=>{Oi.init(e,t),V.init(e,t),e._zod.processJSONSchema=(r,n,i)=>nd(e,r,n,i),e.options=t.options});function ce(e,t){return new Xa({type:"union",options:e,...x.normalizeParams(t)})}var Cg=m("ZodXor",(e,t)=>{Xa.init(e,t),Ju.init(e,t),e._zod.processJSONSchema=(r,n,i)=>nd(e,r,n,i),e.options=t.options});function yS(e,t){return new Cg({type:"union",options:e,inclusive:!1,...x.normalizeParams(t)})}var Mg=m("ZodDiscriminatedUnion",(e,t)=>{Xa.init(e,t),Ku.init(e,t)});function Ya(e,t,r){return new Mg({type:"union",options:t,discriminator:e,...x.normalizeParams(r)})}var qg=m("ZodIntersection",(e,t)=>{Bu.init(e,t),V.init(e,t),e._zod.processJSONSchema=(r,n,i)=>tg(e,r,n,i)});function Yi(e,t){return new qg({type:"intersection",left:e,right:t})}var Lg=m("ZodTuple",(e,t)=>{ma.init(e,t),V.init(e,t),e._zod.processJSONSchema=(r,n,i)=>rg(e,r,n,i),e.rest=r=>e.clone({...e._zod.def,rest:r})});function Fg(e,t,r){let n=t instanceof q,i=n?r:t,o=n?t:null;return new Lg({type:"tuple",items:e,rest:o,...x.normalizeParams(i)})}var Qa=m("ZodRecord",(e,t)=>{Wu.init(e,t),V.init(e,t),e._zod.processJSONSchema=(r,n,i)=>ng(e,r,n,i),e.keyType=t.keyType,e.valueType=t.valueType});function ge(e,t,r){return new Qa({type:"record",keyType:e,valueType:t,...x.normalizeParams(r)})}function _S(e,t,r){let n=Ge(e);return n._zod.values=void 0,new Qa({type:"record",keyType:n,valueType:t,...x.normalizeParams(r)})}function $S(e,t,r){return new Qa({type:"record",keyType:e,valueType:t,mode:"loose",...x.normalizeParams(r)})}var Vg=m("ZodMap",(e,t)=>{Gu.init(e,t),V.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Xh(e,r,n,i),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...r)=>e.check(tr(...r)),e.nonempty=r=>e.check(tr(1,r)),e.max=(...r)=>e.check(Fr(...r)),e.size=(...r)=>e.check(xn(...r))});function bS(e,t,r){return new Vg({type:"map",keyType:e,valueType:t,...x.normalizeParams(r)})}var Jg=m("ZodSet",(e,t)=>{Hu.init(e,t),V.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Yh(e,r,n,i),e.min=(...r)=>e.check(tr(...r)),e.nonempty=r=>e.check(tr(1,r)),e.max=(...r)=>e.check(Fr(...r)),e.size=(...r)=>e.check(xn(...r))});function xS(e,t){return new Jg({type:"set",valueType:e,...x.normalizeParams(t)})}var Gi=m("ZodEnum",(e,t)=>{Xu.init(e,t),V.init(e,t),e._zod.processJSONSchema=(n,i,o)=>Lh(e,n,i,o),e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(n,i)=>{let o={};for(let a of n)if(r.has(a))o[a]=t.entries[a];else throw new Error(`Key ${a} not found in enum`);return new Gi({...t,checks:[],...x.normalizeParams(i),entries:o})},e.exclude=(n,i)=>{let o={...t.entries};for(let a of n)if(r.has(a))delete o[a];else throw new Error(`Key ${a} not found in enum`);return new Gi({...t,checks:[],...x.normalizeParams(i),entries:o})}});function Fe(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new Gi({type:"enum",entries:r,...x.normalizeParams(t)})}function kS(e,t){return new Gi({type:"enum",entries:e,...x.normalizeParams(t)})}var Kg=m("ZodLiteral",(e,t)=>{Yu.init(e,t),V.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Fh(e,r,n,i),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function E(e,t){return new Kg({type:"literal",values:Array.isArray(e)?e:[e],...x.normalizeParams(t)})}var Bg=m("ZodFile",(e,t)=>{Qu.init(e,t),V.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Kh(e,r,n,i),e.min=(r,n)=>e.check(tr(r,n)),e.max=(r,n)=>e.check(Fr(r,n)),e.mime=(r,n)=>e.check(Li(Array.isArray(r)?r:[r],n))});function wS(e){return Hl(Bg,e)}var Wg=m("ZodTransform",(e,t)=>{el.init(e,t),V.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Hh(e,r,n,i),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Ur(e.constructor.name);r.addIssue=o=>{if(typeof o=="string")r.issues.push(x.issue(o,r.value,t));else{let a=o;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=r.value),a.inst??(a.inst=e),r.issues.push(x.issue(a))}};let i=t.transform(r.value,r);return i instanceof Promise?i.then(o=>(r.value=o,r)):(r.value=i,r)}});function Zd(e){return new Wg({type:"transform",transform:e})}var Rd=m("ZodOptional",(e,t)=>{ha.init(e,t),V.init(e,t),e._zod.processJSONSchema=(r,n,i)=>id(e,r,n,i),e.unwrap=()=>e._zod.def.innerType});function ve(e){return new Rd({type:"optional",innerType:e})}var Gg=m("ZodExactOptional",(e,t)=>{tl.init(e,t),V.init(e,t),e._zod.processJSONSchema=(r,n,i)=>id(e,r,n,i),e.unwrap=()=>e._zod.def.innerType});function Hg(e){return new Gg({type:"optional",innerType:e})}var Xg=m("ZodNullable",(e,t)=>{rl.init(e,t),V.init(e,t),e._zod.processJSONSchema=(r,n,i)=>ig(e,r,n,i),e.unwrap=()=>e._zod.def.innerType});function Fa(e){return new Xg({type:"nullable",innerType:e})}function SS(e){return ve(Fa(e))}var Yg=m("ZodDefault",(e,t)=>{nl.init(e,t),V.init(e,t),e._zod.processJSONSchema=(r,n,i)=>ag(e,r,n,i),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Qg(e,t){return new Yg({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():x.shallowClone(t)}})}var ev=m("ZodPrefault",(e,t)=>{il.init(e,t),V.init(e,t),e._zod.processJSONSchema=(r,n,i)=>sg(e,r,n,i),e.unwrap=()=>e._zod.def.innerType});function tv(e,t){return new ev({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():x.shallowClone(t)}})}var Ad=m("ZodNonOptional",(e,t)=>{ol.init(e,t),V.init(e,t),e._zod.processJSONSchema=(r,n,i)=>og(e,r,n,i),e.unwrap=()=>e._zod.def.innerType});function rv(e,t){return new Ad({type:"nonoptional",innerType:e,...x.normalizeParams(t)})}var nv=m("ZodSuccess",(e,t)=>{al.init(e,t),V.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Bh(e,r,n,i),e.unwrap=()=>e._zod.def.innerType});function zS(e){return new nv({type:"success",innerType:e})}var iv=m("ZodCatch",(e,t)=>{sl.init(e,t),V.init(e,t),e._zod.processJSONSchema=(r,n,i)=>cg(e,r,n,i),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function ov(e,t){return new iv({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}var av=m("ZodNaN",(e,t)=>{cl.init(e,t),V.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Vh(e,r,n,i)});function IS(e){return Vl(av,e)}var Ud=m("ZodPipe",(e,t)=>{ul.init(e,t),V.init(e,t),e._zod.processJSONSchema=(r,n,i)=>ug(e,r,n,i),e.in=t.in,e.out=t.out});function Va(e,t){return new Ud({type:"pipe",in:e,out:t})}var Cd=m("ZodCodec",(e,t)=>{Ud.init(e,t),Ni.init(e,t)});function PS(e,t,r){return new Cd({type:"pipe",in:e,out:t,transform:r.decode,reverseTransform:r.encode})}var sv=m("ZodReadonly",(e,t)=>{ll.init(e,t),V.init(e,t),e._zod.processJSONSchema=(r,n,i)=>lg(e,r,n,i),e.unwrap=()=>e._zod.def.innerType});function cv(e){return new sv({type:"readonly",innerType:e})}var uv=m("ZodTemplateLiteral",(e,t)=>{dl.init(e,t),V.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Jh(e,r,n,i)});function TS(e,t){return new uv({type:"template_literal",parts:e,...x.normalizeParams(t)})}var lv=m("ZodLazy",(e,t)=>{ml.init(e,t),V.init(e,t),e._zod.processJSONSchema=(r,n,i)=>fg(e,r,n,i),e.unwrap=()=>e._zod.def.getter()});function dv(e){return new lv({type:"lazy",getter:e})}var fv=m("ZodPromise",(e,t)=>{pl.init(e,t),V.init(e,t),e._zod.processJSONSchema=(r,n,i)=>dg(e,r,n,i),e.unwrap=()=>e._zod.def.innerType});function ES(e){return new fv({type:"promise",innerType:e})}var pv=m("ZodFunction",(e,t)=>{fl.init(e,t),V.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Gh(e,r,n,i)});function jS(e){return new pv({type:"function",input:Array.isArray(e?.input)?Fg(e?.input):e?.input??H(fe()),output:e?.output??fe()})}var es=m("ZodCustom",(e,t)=>{hl.init(e,t),V.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Wh(e,r,n,i)});function OS(e){let t=new le({check:"custom"});return t._zod.check=e,t}function Md(e,t){return Xl(es,e??(()=>!0),t)}function mv(e,t={}){return Yl(es,e,t)}function hv(e){return Ql(e)}var NS=ed,DS=td;function ZS(e,t={}){let r=new es({type:"custom",check:"custom",fn:n=>n instanceof e,abort:!0,...x.normalizeParams(t)});return r._zod.bag.Class=e,r._zod.check=n=>{n.value instanceof e||n.issues.push({code:"invalid_type",expected:e.name,input:n.value,inst:r,path:[...r._zod.def.path??[]]})},r}var RS=(...e)=>rd({Codec:Cd,Boolean:Wa,String:Ja},...e);function AS(e){let t=dv(()=>ce([v(e),ae(),Pe(),Xi(),H(t),ge(v(),t)]));return t}function ts(e,t){return Va(Zd(e),t)}var gv;gv||(gv={});var j6={...Wi,...qa,iso:Vr};Te(gl());var Ld="2025-11-25";var vv=[Ld,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],$r="io.modelcontextprotocol/related-task",ns="2.0",De=Md(e=>e!==null&&(typeof e=="object"||typeof e=="function")),yv=ce([v(),ae().int()]),_v=v(),H6=Le({ttl:ce([ae(),Xi()]).optional(),pollInterval:ae().optional()}),qS=I({ttl:ae().optional()}),LS=I({taskId:v()}),Fd=Le({progressToken:yv.optional(),[$r]:LS.optional()}),yt=I({_meta:Fd.optional()}),Qi=yt.extend({task:qS.optional()}),$v=e=>Qi.safeParse(e).success,Ze=I({method:v(),params:yt.loose().optional()}),xt=I({_meta:Fd.optional()}),kt=I({method:v(),params:xt.loose().optional()}),Re=Le({_meta:Fd.optional()}),is=ce([v(),ae().int()]),bv=I({jsonrpc:E(ns),id:is,...Ze.shape}).strict(),Vd=e=>bv.safeParse(e).success,xv=I({jsonrpc:E(ns),...kt.shape}).strict(),kv=e=>xv.safeParse(e).success,Jd=I({jsonrpc:E(ns),id:is,result:Re}).strict(),eo=e=>Jd.safeParse(e).success;var Q;(function(e){e[e.ConnectionClosed=-32e3]="ConnectionClosed",e[e.RequestTimeout=-32001]="RequestTimeout",e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(Q||(Q={}));var Kd=I({jsonrpc:E(ns),id:is.optional(),error:I({code:ae().int(),message:v(),data:fe().optional()})}).strict();var wv=e=>Kd.safeParse(e).success;var Sv=ce([bv,xv,Jd,Kd]),X6=ce([Jd,Kd]),os=Re.strict(),FS=xt.extend({requestId:is.optional(),reason:v().optional()}),as=kt.extend({method:E("notifications/cancelled"),params:FS}),VS=I({src:v(),mimeType:v().optional(),sizes:H(v()).optional(),theme:Fe(["light","dark"]).optional()}),to=I({icons:H(VS).optional()}),Pn=I({name:v(),title:v().optional()}),zv=Pn.extend({...Pn.shape,...to.shape,version:v(),websiteUrl:v().optional(),description:v().optional()}),JS=Yi(I({applyDefaults:Pe().optional()}),ge(v(),fe())),KS=ts(e=>e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,Yi(I({form:JS.optional(),url:De.optional()}),ge(v(),fe()).optional())),BS=Le({list:De.optional(),cancel:De.optional(),requests:Le({sampling:Le({createMessage:De.optional()}).optional(),elicitation:Le({create:De.optional()}).optional()}).optional()}),WS=Le({list:De.optional(),cancel:De.optional(),requests:Le({tools:Le({call:De.optional()}).optional()}).optional()}),GS=I({experimental:ge(v(),De).optional(),sampling:I({context:De.optional(),tools:De.optional()}).optional(),elicitation:KS.optional(),roots:I({listChanged:Pe().optional()}).optional(),tasks:BS.optional()}),HS=yt.extend({protocolVersion:v(),capabilities:GS,clientInfo:zv}),Bd=Ze.extend({method:E("initialize"),params:HS});var XS=I({experimental:ge(v(),De).optional(),logging:De.optional(),completions:De.optional(),prompts:I({listChanged:Pe().optional()}).optional(),resources:I({subscribe:Pe().optional(),listChanged:Pe().optional()}).optional(),tools:I({listChanged:Pe().optional()}).optional(),tasks:WS.optional()}),YS=Re.extend({protocolVersion:v(),capabilities:XS,serverInfo:zv,instructions:v().optional()}),Wd=kt.extend({method:E("notifications/initialized"),params:xt.optional()});var ss=Ze.extend({method:E("ping"),params:yt.optional()}),QS=I({progress:ae(),total:ve(ae()),message:ve(v())}),e0=I({...xt.shape,...QS.shape,progressToken:yv}),cs=kt.extend({method:E("notifications/progress"),params:e0}),t0=yt.extend({cursor:_v.optional()}),ro=Ze.extend({params:t0.optional()}),no=Re.extend({nextCursor:_v.optional()}),r0=Fe(["working","input_required","completed","failed","cancelled"]),io=I({taskId:v(),status:r0,ttl:ce([ae(),Xi()]),createdAt:v(),lastUpdatedAt:v(),pollInterval:ve(ae()),statusMessage:ve(v())}),Tn=Re.extend({task:io}),n0=xt.merge(io),oo=kt.extend({method:E("notifications/tasks/status"),params:n0}),us=Ze.extend({method:E("tasks/get"),params:yt.extend({taskId:v()})}),ls=Re.merge(io),ds=Ze.extend({method:E("tasks/result"),params:yt.extend({taskId:v()})}),Y6=Re.loose(),fs=ro.extend({method:E("tasks/list")}),ps=no.extend({tasks:H(io)}),ms=Ze.extend({method:E("tasks/cancel"),params:yt.extend({taskId:v()})}),Iv=Re.merge(io),Pv=I({uri:v(),mimeType:ve(v()),_meta:ge(v(),fe()).optional()}),Tv=Pv.extend({text:v()}),Gd=v().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),Ev=Pv.extend({blob:Gd}),ao=Fe(["user","assistant"]),En=I({audience:H(ao).optional(),priority:ae().min(0).max(1).optional(),lastModified:Vr.datetime({offset:!0}).optional()}),jv=I({...Pn.shape,...to.shape,uri:v(),description:ve(v()),mimeType:ve(v()),annotations:En.optional(),_meta:ve(Le({}))}),i0=I({...Pn.shape,...to.shape,uriTemplate:v(),description:ve(v()),mimeType:ve(v()),annotations:En.optional(),_meta:ve(Le({}))}),o0=ro.extend({method:E("resources/list")}),a0=no.extend({resources:H(jv)}),s0=ro.extend({method:E("resources/templates/list")}),c0=no.extend({resourceTemplates:H(i0)}),Hd=yt.extend({uri:v()}),u0=Hd,l0=Ze.extend({method:E("resources/read"),params:u0}),d0=Re.extend({contents:H(ce([Tv,Ev]))}),f0=kt.extend({method:E("notifications/resources/list_changed"),params:xt.optional()}),p0=Hd,m0=Ze.extend({method:E("resources/subscribe"),params:p0}),h0=Hd,g0=Ze.extend({method:E("resources/unsubscribe"),params:h0}),v0=xt.extend({uri:v()}),y0=kt.extend({method:E("notifications/resources/updated"),params:v0}),_0=I({name:v(),description:ve(v()),required:ve(Pe())}),$0=I({...Pn.shape,...to.shape,description:ve(v()),arguments:ve(H(_0)),_meta:ve(Le({}))}),b0=ro.extend({method:E("prompts/list")}),x0=no.extend({prompts:H($0)}),k0=yt.extend({name:v(),arguments:ge(v(),v()).optional()}),w0=Ze.extend({method:E("prompts/get"),params:k0}),Xd=I({type:E("text"),text:v(),annotations:En.optional(),_meta:ge(v(),fe()).optional()}),Yd=I({type:E("image"),data:Gd,mimeType:v(),annotations:En.optional(),_meta:ge(v(),fe()).optional()}),Qd=I({type:E("audio"),data:Gd,mimeType:v(),annotations:En.optional(),_meta:ge(v(),fe()).optional()}),S0=I({type:E("tool_use"),name:v(),id:v(),input:ge(v(),fe()),_meta:ge(v(),fe()).optional()}),z0=I({type:E("resource"),resource:ce([Tv,Ev]),annotations:En.optional(),_meta:ge(v(),fe()).optional()}),I0=jv.extend({type:E("resource_link")}),ef=ce([Xd,Yd,Qd,I0,z0]),P0=I({role:ao,content:ef}),T0=Re.extend({description:v().optional(),messages:H(P0)}),E0=kt.extend({method:E("notifications/prompts/list_changed"),params:xt.optional()}),j0=I({title:v().optional(),readOnlyHint:Pe().optional(),destructiveHint:Pe().optional(),idempotentHint:Pe().optional(),openWorldHint:Pe().optional()}),O0=I({taskSupport:Fe(["required","optional","forbidden"]).optional()}),Ov=I({...Pn.shape,...to.shape,description:v().optional(),inputSchema:I({type:E("object"),properties:ge(v(),De).optional(),required:H(v()).optional()}).catchall(fe()),outputSchema:I({type:E("object"),properties:ge(v(),De).optional(),required:H(v()).optional()}).catchall(fe()).optional(),annotations:j0.optional(),execution:O0.optional(),_meta:ge(v(),fe()).optional()}),tf=ro.extend({method:E("tools/list")}),N0=no.extend({tools:H(Ov)}),hs=Re.extend({content:H(ef).default([]),structuredContent:ge(v(),fe()).optional(),isError:Pe().optional()}),Q6=hs.or(Re.extend({toolResult:fe()})),D0=Qi.extend({name:v(),arguments:ge(v(),fe()).optional()}),so=Ze.extend({method:E("tools/call"),params:D0}),Z0=kt.extend({method:E("notifications/tools/list_changed"),params:xt.optional()}),eA=I({autoRefresh:Pe().default(!0),debounceMs:ae().int().nonnegative().default(300)}),co=Fe(["debug","info","notice","warning","error","critical","alert","emergency"]),R0=yt.extend({level:co}),rf=Ze.extend({method:E("logging/setLevel"),params:R0}),A0=xt.extend({level:co,logger:v().optional(),data:fe()}),U0=kt.extend({method:E("notifications/message"),params:A0}),C0=I({name:v().optional()}),M0=I({hints:H(C0).optional(),costPriority:ae().min(0).max(1).optional(),speedPriority:ae().min(0).max(1).optional(),intelligencePriority:ae().min(0).max(1).optional()}),q0=I({mode:Fe(["auto","required","none"]).optional()}),L0=I({type:E("tool_result"),toolUseId:v().describe("The unique identifier for the corresponding tool call."),content:H(ef).default([]),structuredContent:I({}).loose().optional(),isError:Pe().optional(),_meta:ge(v(),fe()).optional()}),F0=Ya("type",[Xd,Yd,Qd]),rs=Ya("type",[Xd,Yd,Qd,S0,L0]),V0=I({role:ao,content:ce([rs,H(rs)]),_meta:ge(v(),fe()).optional()}),J0=Qi.extend({messages:H(V0),modelPreferences:M0.optional(),systemPrompt:v().optional(),includeContext:Fe(["none","thisServer","allServers"]).optional(),temperature:ae().optional(),maxTokens:ae().int(),stopSequences:H(v()).optional(),metadata:De.optional(),tools:H(Ov).optional(),toolChoice:q0.optional()}),K0=Ze.extend({method:E("sampling/createMessage"),params:J0}),uo=Re.extend({model:v(),stopReason:ve(Fe(["endTurn","stopSequence","maxTokens"]).or(v())),role:ao,content:F0}),nf=Re.extend({model:v(),stopReason:ve(Fe(["endTurn","stopSequence","maxTokens","toolUse"]).or(v())),role:ao,content:ce([rs,H(rs)])}),B0=I({type:E("boolean"),title:v().optional(),description:v().optional(),default:Pe().optional()}),W0=I({type:E("string"),title:v().optional(),description:v().optional(),minLength:ae().optional(),maxLength:ae().optional(),format:Fe(["email","uri","date","date-time"]).optional(),default:v().optional()}),G0=I({type:Fe(["number","integer"]),title:v().optional(),description:v().optional(),minimum:ae().optional(),maximum:ae().optional(),default:ae().optional()}),H0=I({type:E("string"),title:v().optional(),description:v().optional(),enum:H(v()),default:v().optional()}),X0=I({type:E("string"),title:v().optional(),description:v().optional(),oneOf:H(I({const:v(),title:v()})),default:v().optional()}),Y0=I({type:E("string"),title:v().optional(),description:v().optional(),enum:H(v()),enumNames:H(v()).optional(),default:v().optional()}),Q0=ce([H0,X0]),ez=I({type:E("array"),title:v().optional(),description:v().optional(),minItems:ae().optional(),maxItems:ae().optional(),items:I({type:E("string"),enum:H(v())}),default:H(v()).optional()}),tz=I({type:E("array"),title:v().optional(),description:v().optional(),minItems:ae().optional(),maxItems:ae().optional(),items:I({anyOf:H(I({const:v(),title:v()}))}),default:H(v()).optional()}),rz=ce([ez,tz]),nz=ce([Y0,Q0,rz]),iz=ce([nz,B0,W0,G0]),oz=Qi.extend({mode:E("form").optional(),message:v(),requestedSchema:I({type:E("object"),properties:ge(v(),iz),required:H(v()).optional()})}),az=Qi.extend({mode:E("url"),message:v(),elicitationId:v(),url:v().url()}),sz=ce([oz,az]),cz=Ze.extend({method:E("elicitation/create"),params:sz}),uz=xt.extend({elicitationId:v()}),lz=kt.extend({method:E("notifications/elicitation/complete"),params:uz}),jn=Re.extend({action:Fe(["accept","decline","cancel"]),content:ts(e=>e===null?void 0:e,ge(v(),ce([v(),ae(),Pe(),H(v())])).optional())}),dz=I({type:E("ref/resource"),uri:v()});var fz=I({type:E("ref/prompt"),name:v()}),pz=yt.extend({ref:ce([fz,dz]),argument:I({name:v(),value:v()}),context:I({arguments:ge(v(),v()).optional()}).optional()}),mz=Ze.extend({method:E("completion/complete"),params:pz});var hz=Re.extend({completion:Le({values:H(v()).max(100),total:ve(ae().int()),hasMore:ve(Pe())})}),gz=I({uri:v().startsWith("file://"),name:v().optional(),_meta:ge(v(),fe()).optional()}),vz=Ze.extend({method:E("roots/list"),params:yt.optional()}),of=Re.extend({roots:H(gz)}),yz=kt.extend({method:E("notifications/roots/list_changed"),params:xt.optional()}),tA=ce([ss,Bd,mz,rf,w0,b0,o0,s0,l0,m0,g0,so,tf,us,ds,fs,ms]),rA=ce([as,cs,Wd,yz,oo]),nA=ce([os,uo,nf,jn,of,ls,ps,Tn]),iA=ce([ss,K0,cz,vz,us,ds,fs,ms]),oA=ce([as,cs,U0,y0,f0,Z0,E0,oo,lz]),aA=ce([os,YS,hz,T0,x0,a0,c0,d0,hs,N0,ls,ps,Tn]),J=class e extends Error{constructor(t,r,n){super(`MCP error ${t}: ${r}`),this.code=t,this.data=n,this.name="McpError"}static fromError(t,r,n){if(t===Q.UrlElicitationRequired&&n){let i=n;if(i.elicitations)return new qd(i.elicitations,r)}return new e(t,r,n)}},qd=class extends J{constructor(t,r=`URL elicitation${t.length>1?"s":""} required`){super(Q.UrlElicitationRequired,r,{elicitations:t})}get elicitations(){return this.data?.elicitations??[]}};function br(e){return e==="completed"||e==="failed"||e==="cancelled"}var MA=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function af(e){let r=Ma(e)?.method;if(!r)throw new Error("Schema is missing a method literal");let n=gg(r);if(typeof n!="string")throw new Error("Schema method literal must be a string");return n}function sf(e,t){let r=_r(e,t);if(!r.success)throw r.error;return r.data}var wz=6e4,gs=class{constructor(t){this._options=t,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(as,r=>{this._oncancel(r)}),this.setNotificationHandler(cs,r=>{this._onprogress(r)}),this.setRequestHandler(ss,r=>({})),this._taskStore=t?.taskStore,this._taskMessageQueue=t?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(us,async(r,n)=>{let i=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!i)throw new J(Q.InvalidParams,"Failed to retrieve task: Task not found");return{...i}}),this.setRequestHandler(ds,async(r,n)=>{let i=async()=>{let o=r.params.taskId;if(this._taskMessageQueue){let s;for(;s=await this._taskMessageQueue.dequeue(o,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,p=new J(d.error.code,d.error.message,d.error.data);l(p)}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(o,n.sessionId);if(!a)throw new J(Q.InvalidParams,`Task not found: ${o}`);if(!br(a.status))return await this._waitForTaskUpdate(o,n.signal),await i();if(br(a.status)){let s=await this._taskStore.getTaskResult(o,n.sessionId);return this._clearTaskQueue(o),{...s,_meta:{...s._meta,[$r]:{taskId:o}}}}return await i()};return await i()}),this.setRequestHandler(fs,async(r,n)=>{try{let{tasks:i,nextCursor:o}=await this._taskStore.listTasks(r.params?.cursor,n.sessionId);return{tasks:i,nextCursor:o,_meta:{}}}catch(i){throw new J(Q.InvalidParams,`Failed to list tasks: ${i instanceof Error?i.message:String(i)}`)}}),this.setRequestHandler(ms,async(r,n)=>{try{let i=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!i)throw new J(Q.InvalidParams,`Task not found: ${r.params.taskId}`);if(br(i.status))throw new J(Q.InvalidParams,`Cannot cancel task in terminal status: ${i.status}`);await this._taskStore.updateTaskStatus(r.params.taskId,"cancelled","Client cancelled task execution.",n.sessionId),this._clearTaskQueue(r.params.taskId);let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new J(Q.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...o}}catch(i){throw i instanceof J?i:new J(Q.InvalidRequest,`Failed to cancel task: ${i instanceof Error?i.message:String(i)}`)}}))}async _oncancel(t){if(!t.params.requestId)return;this._requestHandlerAbortControllers.get(t.params.requestId)?.abort(t.params.reason)}_setupTimeout(t,r,n,i,o=!1){this._timeoutInfo.set(t,{timeoutId:setTimeout(i,r),startTime:Date.now(),timeout:r,maxTotalTimeout:n,resetTimeoutOnProgress:o,onTimeout:i})}_resetTimeout(t){let r=this._timeoutInfo.get(t);if(!r)return!1;let n=Date.now()-r.startTime;if(r.maxTotalTimeout&&n>=r.maxTotalTimeout)throw this._timeoutInfo.delete(t),J.fromError(Q.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:r.maxTotalTimeout,totalElapsed:n});return clearTimeout(r.timeoutId),r.timeoutId=setTimeout(r.onTimeout,r.timeout),!0}_cleanupTimeout(t){let r=this._timeoutInfo.get(t);r&&(clearTimeout(r.timeoutId),this._timeoutInfo.delete(t))}async connect(t){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=t;let r=this.transport?.onclose;this._transport.onclose=()=>{r?.(),this._onclose()};let n=this.transport?.onerror;this._transport.onerror=o=>{n?.(o),this._onerror(o)};let i=this._transport?.onmessage;this._transport.onmessage=(o,a)=>{i?.(o,a),eo(o)||wv(o)?this._onresponse(o):Vd(o)?this._onrequest(o,a):kv(o)?this._onnotification(o):this._onerror(new Error(`Unknown message type: ${JSON.stringify(o)}`))},await this._transport.start()}_onclose(){let t=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let n of this._timeoutInfo.values())clearTimeout(n.timeoutId);this._timeoutInfo.clear();for(let n of this._requestHandlerAbortControllers.values())n.abort();this._requestHandlerAbortControllers.clear();let r=J.fromError(Q.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let n of t.values())n(r)}_onerror(t){this.onerror?.(t)}_onnotification(t){let r=this._notificationHandlers.get(t.method)??this.fallbackNotificationHandler;r!==void 0&&Promise.resolve().then(()=>r(t)).catch(n=>this._onerror(new Error(`Uncaught error in notification handler: ${n}`)))}_onrequest(t,r){let n=this._requestHandlers.get(t.method)??this.fallbackRequestHandler,i=this._transport,o=t.params?._meta?.[$r]?.taskId;if(n===void 0){let l={jsonrpc:"2.0",id:t.id,error:{code:Q.MethodNotFound,message:"Method not found"}};o&&this._taskMessageQueue?this._enqueueTaskMessage(o,{type:"error",message:l,timestamp:Date.now()},i?.sessionId).catch(d=>this._onerror(new Error(`Failed to enqueue error response: ${d}`))):i?.send(l).catch(d=>this._onerror(new Error(`Failed to send an error response: ${d}`)));return}let a=new AbortController;this._requestHandlerAbortControllers.set(t.id,a);let s=$v(t.params)?t.params.task:void 0,c=this._taskStore?this.requestTaskStore(t,i?.sessionId):void 0,u={signal:a.signal,sessionId:i?.sessionId,_meta:t.params?._meta,sendNotification:async l=>{if(a.signal.aborted)return;let d={relatedRequestId:t.id};o&&(d.relatedTask={taskId:o}),await this.notification(l,d)},sendRequest:async(l,d,p)=>{if(a.signal.aborted)throw new J(Q.ConnectionClosed,"Request was cancelled");let f={...p,relatedRequestId:t.id};o&&!f.relatedTask&&(f.relatedTask={taskId:o});let h=f.relatedTask?.taskId??o;return h&&c&&await c.updateTaskStatus(h,"input_required"),await this.request(l,d,f)},authInfo:r?.authInfo,requestId:t.id,requestInfo:r?.requestInfo,taskId:o,taskStore:c,taskRequestedTtl:s?.ttl,closeSSEStream:r?.closeSSEStream,closeStandaloneSSEStream:r?.closeStandaloneSSEStream};Promise.resolve().then(()=>{s&&this.assertTaskHandlerCapability(t.method)}).then(()=>n(t,u)).then(async l=>{if(a.signal.aborted)return;let d={result:l,jsonrpc:"2.0",id:t.id};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"response",message:d,timestamp:Date.now()},i?.sessionId):await i?.send(d)},async l=>{if(a.signal.aborted)return;let d={jsonrpc:"2.0",id:t.id,error:{code:Number.isSafeInteger(l.code)?l.code:Q.InternalError,message:l.message??"Internal error",...l.data!==void 0&&{data:l.data}}};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"error",message:d,timestamp:Date.now()},i?.sessionId):await i?.send(d)}).catch(l=>this._onerror(new Error(`Failed to send response: ${l}`))).finally(()=>{this._requestHandlerAbortControllers.get(t.id)===a&&this._requestHandlerAbortControllers.delete(t.id)})}_onprogress(t){let{progressToken:r,...n}=t.params,i=Number(r),o=this._progressHandlers.get(i);if(!o){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(t)}`));return}let a=this._responseHandlers.get(i),s=this._timeoutInfo.get(i);if(s&&a&&s.resetTimeoutOnProgress)try{this._resetTimeout(i)}catch(c){this._responseHandlers.delete(i),this._progressHandlers.delete(i),this._cleanupTimeout(i),a(c);return}o(n)}_onresponse(t){let r=Number(t.id),n=this._requestResolvers.get(r);if(n){if(this._requestResolvers.delete(r),eo(t))n(t);else{let a=new J(t.error.code,t.error.message,t.error.data);n(a)}return}let i=this._responseHandlers.get(r);if(i===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(t)}`));return}this._responseHandlers.delete(r),this._cleanupTimeout(r);let o=!1;if(eo(t)&&t.result&&typeof t.result=="object"){let a=t.result;if(a.task&&typeof a.task=="object"){let s=a.task;typeof s.taskId=="string"&&(o=!0,this._taskProgressTokens.set(s.taskId,r))}}if(o||this._progressHandlers.delete(r),eo(t))i(t);else{let a=J.fromError(t.error.code,t.error.message,t.error.data);i(a)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(t,r,n){let{task:i}=n??{};if(!i){try{yield{type:"result",result:await this.request(t,r,n)}}catch(a){yield{type:"error",error:a instanceof J?a:new J(Q.InternalError,String(a))}}return}let o;try{let a=await this.request(t,Tn,n);if(a.task)o=a.task.taskId,yield{type:"taskCreated",task:a.task};else throw new J(Q.InternalError,"Task creation did not return a task");for(;;){let s=await this.getTask({taskId:o},n);if(yield{type:"taskStatus",task:s},br(s.status)){s.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:o},r,n)}:s.status==="failed"?yield{type:"error",error:new J(Q.InternalError,`Task ${o} failed`)}:s.status==="cancelled"&&(yield{type:"error",error:new J(Q.InternalError,`Task ${o} was cancelled`)});return}if(s.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:o},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 J?a:new J(Q.InternalError,String(a))}}}request(t,r,n){let{relatedRequestId:i,resumptionToken:o,onresumptiontoken:a,task:s,relatedTask:c}=n??{};return new Promise((u,l)=>{let d=P=>{l(P)};if(!this._transport){d(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method),s&&this.assertTaskCapability(t.method)}catch(P){d(P);return}n?.signal?.throwIfAborted();let p=this._requestMessageId++,f={...t,jsonrpc:"2.0",id:p};n?.onprogress&&(this._progressHandlers.set(p,n.onprogress),f.params={...t.params,_meta:{...t.params?._meta||{},progressToken:p}}),s&&(f.params={...f.params,task:s}),c&&(f.params={...f.params,_meta:{...f.params?._meta||{},[$r]:c}});let h=P=>{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(P)}},{relatedRequestId:i,resumptionToken:o,onresumptiontoken:a}).catch(N=>this._onerror(new Error(`Failed to send cancellation: ${N}`)));let k=P instanceof J?P:new J(Q.RequestTimeout,String(P));l(k)};this._responseHandlers.set(p,P=>{if(!n?.signal?.aborted){if(P instanceof Error)return l(P);try{let k=_r(r,P.result);k.success?u(k.data):l(k.error)}catch(k){l(k)}}}),n?.signal?.addEventListener("abort",()=>{h(n?.signal?.reason)});let g=n?.timeout??wz,y=()=>h(J.fromError(Q.RequestTimeout,"Request timed out",{timeout:g}));this._setupTimeout(p,g,n?.maxTotalTimeout,y,n?.resetTimeoutOnProgress??!1);let $=c?.taskId;if($){let P=k=>{let N=this._responseHandlers.get(p);N?N(k):this._onerror(new Error(`Response handler missing for side-channeled request ${p}`))};this._requestResolvers.set(p,P),this._enqueueTaskMessage($,{type:"request",message:f,timestamp:Date.now()}).catch(k=>{this._cleanupTimeout(p),l(k)})}else this._transport.send(f,{relatedRequestId:i,resumptionToken:o,onresumptiontoken:a}).catch(P=>{this._cleanupTimeout(p),l(P)})})}async getTask(t,r){return this.request({method:"tasks/get",params:t},ls,r)}async getTaskResult(t,r,n){return this.request({method:"tasks/result",params:t},r,n)}async listTasks(t,r){return this.request({method:"tasks/list",params:t},ps,r)}async cancelTask(t,r){return this.request({method:"tasks/cancel",params:t},Iv,r)}async notification(t,r){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(t.method);let n=r?.relatedTask?.taskId;if(n){let s={...t,jsonrpc:"2.0",params:{...t.params,_meta:{...t.params?._meta||{},[$r]:r.relatedTask}}};await this._enqueueTaskMessage(n,{type:"notification",message:s,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(t.method)&&!t.params&&!r?.relatedRequestId&&!r?.relatedTask){if(this._pendingDebouncedNotifications.has(t.method))return;this._pendingDebouncedNotifications.add(t.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(t.method),!this._transport)return;let s={...t,jsonrpc:"2.0"};r?.relatedTask&&(s={...s,params:{...s.params,_meta:{...s.params?._meta||{},[$r]:r.relatedTask}}}),this._transport?.send(s,r).catch(c=>this._onerror(c))});return}let a={...t,jsonrpc:"2.0"};r?.relatedTask&&(a={...a,params:{...a.params,_meta:{...a.params?._meta||{},[$r]:r.relatedTask}}}),await this._transport.send(a,r)}setRequestHandler(t,r){let n=af(t);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(i,o)=>{let a=sf(t,i);return Promise.resolve(r(a,o))})}removeRequestHandler(t){this._requestHandlers.delete(t)}assertCanSetRequestHandler(t){if(this._requestHandlers.has(t))throw new Error(`A request handler for ${t} already exists, which would be overridden`)}setNotificationHandler(t,r){let n=af(t);this._notificationHandlers.set(n,i=>{let o=sf(t,i);return Promise.resolve(r(o))})}removeNotificationHandler(t){this._notificationHandlers.delete(t)}_cleanupTaskProgressHandler(t){let r=this._taskProgressTokens.get(t);r!==void 0&&(this._progressHandlers.delete(r),this._taskProgressTokens.delete(t))}async _enqueueTaskMessage(t,r,n){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let i=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(t,r,n,i)}async _clearTaskQueue(t,r){if(this._taskMessageQueue){let n=await this._taskMessageQueue.dequeueAll(t,r);for(let i of n)if(i.type==="request"&&Vd(i.message)){let o=i.message.id,a=this._requestResolvers.get(o);a?(a(new J(Q.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(o)):this._onerror(new Error(`Resolver missing for request ${o} during task ${t} cleanup`))}}}async _waitForTaskUpdate(t,r){let n=this._options?.defaultTaskPollInterval??1e3;try{let i=await this._taskStore?.getTask(t);i?.pollInterval&&(n=i.pollInterval)}catch{}return new Promise((i,o)=>{if(r.aborted){o(new J(Q.InvalidRequest,"Request cancelled"));return}let a=setTimeout(i,n);r.addEventListener("abort",()=>{clearTimeout(a),o(new J(Q.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(t,r){let n=this._taskStore;if(!n)throw new Error("No task store configured");return{createTask:async i=>{if(!t)throw new Error("No request provided");return await n.createTask(i,t.id,{method:t.method,params:t.params},r)},getTask:async i=>{let o=await n.getTask(i,r);if(!o)throw new J(Q.InvalidParams,"Failed to retrieve task: Task not found");return o},storeTaskResult:async(i,o,a)=>{await n.storeTaskResult(i,o,a,r);let s=await n.getTask(i,r);if(s){let c=oo.parse({method:"notifications/tasks/status",params:s});await this.notification(c),br(s.status)&&this._cleanupTaskProgressHandler(i)}},getTaskResult:i=>n.getTaskResult(i,r),updateTaskStatus:async(i,o,a)=>{let s=await n.getTask(i,r);if(!s)throw new J(Q.InvalidParams,`Task "${i}" not found - it may have been cleaned up`);if(br(s.status))throw new J(Q.InvalidParams,`Cannot update task "${i}" from terminal status "${s.status}" to "${o}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await n.updateTaskStatus(i,o,a,r);let c=await n.getTask(i,r);if(c){let u=oo.parse({method:"notifications/tasks/status",params:c});await this.notification(u),br(c.status)&&this._cleanupTaskProgressHandler(i)}},listTasks:i=>n.listTasks(i,r)}}};function Nv(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Dv(e,t){let r={...e};for(let n in t){let i=n,o=t[i];if(o===void 0)continue;let a=r[i];Nv(a)&&Nv(o)?r[i]={...a,...o}:r[i]=o}return r}var $$=mc(Kp(),1),b$=mc(_$(),1);function hO(){let e=new $$.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,b$.default)(e),e}var Ys=class{constructor(t){this._ajv=t??hO()}getValidator(t){let r="$id"in t&&typeof t.$id=="string"?this._ajv.getSchema(t.$id)??this._ajv.compile(t):this._ajv.compile(t);return n=>r(n)?{valid:!0,data:n,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(r.errors)}}};var Qs=class{constructor(t){this._server=t}requestStream(t,r,n){return this._server.requestStream(t,r,n)}createMessageStream(t,r){let n=this._server.getClientCapabilities();if((t.tools||t.toolChoice)&&!n?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if(t.messages.length>0){let i=t.messages[t.messages.length-1],o=Array.isArray(i.content)?i.content:[i.content],a=o.some(l=>l.type==="tool_result"),s=t.messages.length>1?t.messages[t.messages.length-2]:void 0,c=s?Array.isArray(s.content)?s.content:[s.content]:[],u=c.some(l=>l.type==="tool_use");if(a){if(o.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(o.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:t},uo,r)}elicitInputStream(t,r){let n=this._server.getClientCapabilities(),i=t.mode??"form";switch(i){case"url":{if(!n?.elicitation?.url)throw new Error("Client does not support url elicitation.");break}case"form":{if(!n?.elicitation?.form)throw new Error("Client does not support form elicitation.");break}}let o=i==="form"&&t.mode===void 0?{...t,mode:"form"}:t;return this.requestStream({method:"elicitation/create",params:o},jn,r)}async getTask(t,r){return this._server.getTask({taskId:t},r)}async getTaskResult(t,r,n){return this._server.getTaskResult({taskId:t},r,n)}async listTasks(t,r){return this._server.listTasks(t?{cursor:t}:void 0,r)}async cancelTask(t,r){return this._server.cancelTask({taskId:t},r)}};function x$(e,t,r){if(!e)throw new Error(`${r} does not support task creation (required for ${t})`);switch(t){case"tools/call":if(!e.tools?.call)throw new Error(`${r} does not support task creation for tools/call (required for ${t})`);break;default:break}}function k$(e,t,r){if(!e)throw new Error(`${r} does not support task creation (required for ${t})`);switch(t){case"sampling/createMessage":if(!e.sampling?.createMessage)throw new Error(`${r} does not support task creation for sampling/createMessage (required for ${t})`);break;case"elicitation/create":if(!e.elicitation?.create)throw new Error(`${r} does not support task creation for elicitation/create (required for ${t})`);break;default:break}}var ec=class extends gs{constructor(t,r){super(r),this._serverInfo=t,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(co.options.map((n,i)=>[n,i])),this.isMessageIgnored=(n,i)=>{let o=this._loggingLevels.get(i);return o?this.LOG_LEVEL_SEVERITY.get(n)<this.LOG_LEVEL_SEVERITY.get(o):!1},this._capabilities=r?.capabilities??{},this._instructions=r?.instructions,this._jsonSchemaValidator=r?.jsonSchemaValidator??new Ys,this.setRequestHandler(Bd,n=>this._oninitialize(n)),this.setNotificationHandler(Wd,()=>this.oninitialized?.()),this._capabilities.logging&&this.setRequestHandler(rf,async(n,i)=>{let o=i.sessionId||i.requestInfo?.headers["mcp-session-id"]||void 0,{level:a}=n.params,s=co.safeParse(a);return s.success&&this._loggingLevels.set(o,s.data),{}})}get experimental(){return this._experimental||(this._experimental={tasks:new Qs(this)}),this._experimental}registerCapabilities(t){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=Dv(this._capabilities,t)}setRequestHandler(t,r){let i=Ma(t)?.method;if(!i)throw new Error("Schema is missing a method literal");let o;if(zn(i)){let s=i;o=s._zod?.def?.value??s.value}else{let s=i;o=s._def?.value??s.value}if(typeof o!="string")throw new Error("Schema method literal must be a string");if(o==="tools/call"){let s=async(c,u)=>{let l=_r(so,c);if(!l.success){let h=l.error instanceof Error?l.error.message:String(l.error);throw new J(Q.InvalidParams,`Invalid tools/call request: ${h}`)}let{params:d}=l.data,p=await Promise.resolve(r(c,u));if(d.task){let h=_r(Tn,p);if(!h.success){let g=h.error instanceof Error?h.error.message:String(h.error);throw new J(Q.InvalidParams,`Invalid task creation result: ${g}`)}return h.data}let f=_r(hs,p);if(!f.success){let h=f.error instanceof Error?f.error.message:String(f.error);throw new J(Q.InvalidParams,`Invalid tools/call result: ${h}`)}return f.data};return super.setRequestHandler(t,s)}return super.setRequestHandler(t,r)}assertCapabilityForMethod(t){switch(t){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw new Error(`Client does not support sampling (required for ${t})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new Error(`Client does not support elicitation (required for ${t})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new Error(`Client does not support listing roots (required for ${t})`);break;case"ping":break}}assertNotificationCapability(t){switch(t){case"notifications/message":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${t})`);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 ${t})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new Error(`Server does not support notifying of tool list changes (required for ${t})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new Error(`Server does not support notifying of prompt list changes (required for ${t})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new Error(`Client does not support URL elicitation (required for ${t})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(t){if(this._capabilities)switch(t){case"completion/complete":if(!this._capabilities.completions)throw new Error(`Server does not support completions (required for ${t})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${t})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new Error(`Server does not support prompts (required for ${t})`);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 ${t})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new Error(`Server does not support tools (required for ${t})`);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 ${t})`);break;case"ping":case"initialize":break}}assertTaskCapability(t){k$(this._clientCapabilities?.tasks?.requests,t,"Client")}assertTaskHandlerCapability(t){this._capabilities&&x$(this._capabilities.tasks?.requests,t,"Server")}async _oninitialize(t){let r=t.params.protocolVersion;return this._clientCapabilities=t.params.capabilities,this._clientVersion=t.params.clientInfo,{protocolVersion:vv.includes(r)?r:Ld,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"},os)}async createMessage(t,r){if((t.tools||t.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if(t.messages.length>0){let n=t.messages[t.messages.length-1],i=Array.isArray(n.content)?n.content:[n.content],o=i.some(u=>u.type==="tool_result"),a=t.messages.length>1?t.messages[t.messages.length-2]:void 0,s=a?Array.isArray(a.content)?a.content:[a.content]:[],c=s.some(u=>u.type==="tool_use");if(o){if(i.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(i.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 t.tools?this.request({method:"sampling/createMessage",params:t},nf,r):this.request({method:"sampling/createMessage",params:t},uo,r)}async elicitInput(t,r){switch(t.mode??"form"){case"url":{if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support url elicitation.");let i=t;return this.request({method:"elicitation/create",params:i},jn,r)}case"form":{if(!this._clientCapabilities?.elicitation?.form)throw new Error("Client does not support form elicitation.");let i=t.mode==="form"?t:{...t,mode:"form"},o=await this.request({method:"elicitation/create",params:i},jn,r);if(o.action==="accept"&&o.content&&i.requestedSchema)try{let s=this._jsonSchemaValidator.getValidator(i.requestedSchema)(o.content);if(!s.valid)throw new J(Q.InvalidParams,`Elicitation response content does not match requested schema: ${s.errorMessage}`)}catch(a){throw a instanceof J?a:new J(Q.InternalError,`Error validating elicitation response: ${a instanceof Error?a.message:String(a)}`)}return o}}}createElicitationCompletionNotifier(t,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:t}},r)}async listRoots(t,r){return this.request({method:"roots/list",params:t},of,r)}async sendLoggingMessage(t,r){if(this._capabilities.logging&&!this.isMessageIgnored(t.level,r))return this.notification({method:"notifications/message",params:t})}async sendResourceUpdated(t){return this.notification({method:"notifications/resources/updated",params:t})}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"})}};import S$ from"node:process";var tc=class{append(t){this._buffer=this._buffer?Buffer.concat([this._buffer,t]):t}readMessage(){if(!this._buffer)return null;let t=this._buffer.indexOf(`
|
|
54
|
+
`);if(t===-1)return null;let r=this._buffer.toString("utf8",0,t).replace(/\r$/,"");return this._buffer=this._buffer.subarray(t+1),gO(r)}clear(){this._buffer=void 0}};function gO(e){return Sv.parse(JSON.parse(e))}function w$(e){return JSON.stringify(e)+`
|
|
55
|
+
`}var rc=class{constructor(t=S$.stdin,r=S$.stdout){this._stdin=t,this._stdout=r,this._readBuffer=new tc,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 t=this._readBuffer.readMessage();if(t===null)break;this.onmessage?.(t)}catch(t){this.onerror?.(t)}}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(t){return new Promise(r=>{let n=w$(t);this._stdout.write(n)?r():this._stdout.once("drain",r)})}};var Bt=mc($x(),1);import Pt from"path";import{execSync as _4}from"child_process";async function xx(e,t,r){let n={success:!0,backend:null,frontend:null},i=t||Pt.basename(e);if(r==="all"||r==="backend"){let o=Pt.join(e,`${i}-backend`);await Bt.default.pathExists(o)&&(n.backend=bx(o,"pnpm build"))}if(r==="all"||r==="frontend"){let o=Pt.join(e,`${i}-frontend`);await Bt.default.pathExists(o)&&(n.frontend=bx(o,"npm run build"))}return n.success=(n.backend===null||n.backend.success)&&(n.frontend===null||n.frontend.success),n}function bx(e,t){try{return{success:!0,output:(_4(t,{cwd:e,timeout:3e5,encoding:"utf-8",stdio:["ignore","pipe","pipe"]})||"").slice(-500)}}catch(r){return{success:!1,output:((r.stdout||"")+`
|
|
56
|
+
`+(r.stderr||"")).slice(-2e3),exitCode:r.status}}}async function kx(e,t){let r=Pt.join(e,".dev-cycle","contracts"),n=t||Pt.basename(e),i=await Bt.default.pathExists(Pt.join(r,"spec.json")),o=await Bt.default.pathExists(Pt.join(r,"api-contract.json")),a=await Bt.default.pathExists(Pt.join(r,"db-schema.json")),s=Pt.join(e,`${n}-backend`),c=Pt.join(e,`${n}-frontend`),u=await Bt.default.pathExists(s),l=await Bt.default.pathExists(c),d=[],p=[];if(i)try{let h=await Bt.default.readJSON(Pt.join(r,"spec.json"));d=(h.entities||[]).map(g=>g.name),p=h.relations||[]}catch{}let f=0;if(o)try{f=(await Bt.default.readJSON(Pt.join(r,"api-contract.json"))).endpoints?.length||0}catch{}return{projectDir:e,projectName:n,spec:i?{exists:!0,entities:d,relations:p}:{exists:!1},contracts:{apiContract:o?{exists:!0,endpoints:f}:{exists:!1},dbSchema:a?{exists:!0}:{exists:!1}},backend:{exists:u,dir:u?s:null},frontend:{exists:l,dir:l?c:null}}}import*as Sx from"fs";var ei=new Map,wx=3,$4="/tmp/routinecode-escalation.json";function mm(e,t){try{Sx.writeFileSync($4,JSON.stringify({escalated:e,issueId:t??null,updatedAt:new Date().toISOString()}))}catch{}}function zx(e){let{issueId:t,approach:r,result:n,reason:i}=e,o=ei.get(t)??[],a={approach:r,result:n,reason:i,ts:new Date().toISOString()};if(o.push(a),ei.set(t,o),n==="success")return ei.delete(t),mm(!1),{attemptNumber:o.length,shouldEscalate:!1,history:[]};let c=o.filter(u=>u.result==="fail").length>=wx;return c&&mm(!0,t),{attemptNumber:o.length,shouldEscalate:c,history:o}}function Ix(e){let t=ei.get(e)??[],r=t.filter(n=>n.result==="fail");return{totalAttempts:t.length,failedAttempts:r.length,shouldEscalate:r.length>=wx,approaches:t.map(n=>`[${n.result}] ${n.approach}${n.reason?` (${n.reason})`:""}`)}}function Px(e){let t=ei.has(e);return ei.delete(e),mm(!1),{cleared:t}}var Wo=new Map;function Tx(e){let{agentId:t,agentType:r,files:n,taskDescription:i}=e,o=[];for(let s of n){let c=Wo.get(s);c&&c.agentId!==t&&o.push({file:s,heldBy:`${c.agentType}:${c.agentId}`,taskDescription:c.taskDescription})}if(o.length>0)return{locked:!1,conflicts:o};let a=new Date().toISOString();for(let s of n)Wo.set(s,{agentId:t,agentType:r,taskDescription:i,lockedAt:a});return{locked:!0,conflicts:[]}}function Ex(e){let t=0;for(let[r,n]of Wo.entries())n.agentId===e&&(Wo.delete(r),t++);return{released:t}}function jx(e){let t=[];for(let r of e){let n=Wo.get(r);n&&t.push({file:r,heldBy:`${n.agentType}:${n.agentId}`,since:n.lockedAt})}return{hasConflicts:t.length>0,conflicts:t}}var b4=process.env.PROJECT_DIR||process.cwd(),Ox=process.env.PROJECT_NAME||"",hm=new ec({name:"mcp-routinecode",version:"2.0.0"},{capabilities:{tools:{}}});hm.setRequestHandler(tf,async()=>({tools:[{name:"build_check",description:"\uBC31\uC5D4\uB4DC(pnpm build)\uC640 \uD504\uB860\uD2B8\uC5D4\uB4DC(npm run build)\uB97C \uBE4C\uB4DC\uD558\uACE0 \uACB0\uACFC\uB97C \uBC18\uD658\uD569\uB2C8\uB2E4. \uCF54\uB4DC \uC0DD\uC131/\uC218\uC815 \uD6C4 \uD638\uCD9C\uD558\uC138\uC694.",inputSchema:{type:"object",properties:{projectDir:{type:"string",description:"\uD504\uB85C\uC81D\uD2B8 \uB8E8\uD2B8 \uB514\uB809\uD1A0\uB9AC"},target:{type:"string",enum:["all","backend","frontend"],description:"\uBE4C\uB4DC \uB300\uC0C1 (\uAE30\uBCF8: all)"}}}},{name:"project_state",description:"\uD504\uB85C\uC81D\uD2B8\uC758 \uD604\uC7AC \uC0C1\uD0DC\uB97C \uC870\uD68C\uD569\uB2C8\uB2E4. spec/contract/\uCF54\uB4DC \uC874\uC7AC \uC5EC\uBD80, entity \uBAA9\uB85D, \uBE4C\uB4DC \uC0C1\uD0DC\uB97C \uBC18\uD658\uD569\uB2C8\uB2E4.",inputSchema:{type:"object",properties:{projectDir:{type:"string",description:"\uD504\uB85C\uC81D\uD2B8 \uB8E8\uD2B8 \uB514\uB809\uD1A0\uB9AC"}}}},{name:"record_attempt",description:"\uC218\uC815 \uC2DC\uB3C4\uB97C \uAE30\uB85D\uD569\uB2C8\uB2E4. 3\uD68C \uC2E4\uD328 \uC2DC shouldEscalate=true\uB97C \uBC18\uD658\uD558\uBA70, \uC774 \uACBD\uC6B0 \uC989\uC2DC \uC218\uC815\uC744 \uC911\uB2E8\uD558\uACE0 reviewer\uC5D0\uAC8C \uC704\uC784\uD574\uC57C \uD569\uB2C8\uB2E4.",inputSchema:{type:"object",properties:{issueId:{type:"string",description:"\uC774\uC288 \uC2DD\uBCC4\uC790 (\uC5D0\uB7EC \uBA54\uC2DC\uC9C0 \uB610\uB294 \uC124\uBA85)"},approach:{type:"string",description:"\uC2DC\uB3C4\uD55C \uC811\uADFC \uBC29\uC2DD"},result:{type:"string",enum:["success","fail"],description:"\uACB0\uACFC"},reason:{type:"string",description:"\uC2E4\uD328 \uC774\uC720 (fail\uC77C \uB54C)"}},required:["issueId","approach","result"]}},{name:"check_escalation",description:"\uD2B9\uC815 \uC774\uC288\uC758 \uC5D0\uC2A4\uCEEC\uB808\uC774\uC158 \uC0C1\uD0DC\uB97C \uD655\uC778\uD569\uB2C8\uB2E4.",inputSchema:{type:"object",properties:{issueId:{type:"string",description:"\uC774\uC288 \uC2DD\uBCC4\uC790"}},required:["issueId"]}},{name:"clear_attempts",description:"\uC774\uC288\uC758 \uC2DC\uB3C4 \uAE30\uB85D\uC744 \uCD08\uAE30\uD654\uD569\uB2C8\uB2E4. \uC774\uC288\uAC00 \uD574\uACB0\uB418\uC5C8\uAC70\uB098 \uB2E4\uB978 \uC811\uADFC\uC774 \uD544\uC694\uD560 \uB54C \uC0AC\uC6A9\uD569\uB2C8\uB2E4.",inputSchema:{type:"object",properties:{issueId:{type:"string",description:"\uC774\uC288 \uC2DD\uBCC4\uC790"}},required:["issueId"]}},{name:"lock_files",description:"\uC5D0\uC774\uC804\uD2B8\uAC00 \uC791\uC5C5\uD560 \uD30C\uC77C\uC744 \uC120\uC810 \uB4F1\uB85D\uD569\uB2C8\uB2E4. \uB2E4\uB978 \uC5D0\uC774\uC804\uD2B8\uAC00 \uAC19\uC740 \uD30C\uC77C\uC744 \uC218\uC815 \uC911\uC774\uBA74 \uCDA9\uB3CC\uC744 \uBC18\uD658\uD569\uB2C8\uB2E4.",inputSchema:{type:"object",properties:{agentId:{type:"string",description:"Agent tool\uC774 \uC0DD\uC131\uD55C ID"},agentType:{type:"string",description:"\uC5D0\uC774\uC804\uD2B8 \uC720\uD615 (implementor, explorer \uB4F1)"},files:{type:"array",items:{type:"string"},description:"\uC218\uC815 \uC608\uC815 \uD30C\uC77C \uACBD\uB85C"},taskDescription:{type:"string",description:"\uC791\uC5C5 \uC124\uBA85"}},required:["agentId","agentType","files","taskDescription"]}},{name:"release_files",description:"\uC5D0\uC774\uC804\uD2B8 \uC791\uC5C5 \uC644\uB8CC \uD6C4 \uD30C\uC77C \uC7A0\uAE08\uC744 \uD574\uC81C\uD569\uB2C8\uB2E4.",inputSchema:{type:"object",properties:{agentId:{type:"string",description:"Agent ID"}},required:["agentId"]}},{name:"check_conflicts",description:"\uD30C\uC77C \uBAA9\uB85D\uC5D0 \uB300\uD55C \uC7A0\uAE08 \uCDA9\uB3CC\uC744 \uD655\uC778\uD569\uB2C8\uB2E4.",inputSchema:{type:"object",properties:{files:{type:"array",items:{type:"string"},description:"\uD655\uC778\uD560 \uD30C\uC77C \uACBD\uB85C"}},required:["files"]}}]}));hm.setRequestHandler(so,async e=>{let{name:t,arguments:r}=e.params,n=r?.projectDir||b4;try{switch(t){case"build_check":{let i=r?.target||"all",o=await xx(n,Ox,i);return{content:[{type:"text",text:JSON.stringify(o,null,2)}]}}case"project_state":{let i=await kx(n,Ox);return{content:[{type:"text",text:JSON.stringify(i,null,2)}]}}case"record_attempt":{let i=zx({issueId:r.issueId,approach:r.approach,result:r.result,reason:r?.reason});return{content:[{type:"text",text:JSON.stringify(i,null,2)}]}}case"check_escalation":{let i=Ix(r.issueId);return{content:[{type:"text",text:JSON.stringify(i,null,2)}]}}case"clear_attempts":{let i=Px(r.issueId);return{content:[{type:"text",text:JSON.stringify(i,null,2)}]}}case"lock_files":{let i=Tx({agentId:r.agentId,agentType:r.agentType,files:r.files,taskDescription:r.taskDescription});return{content:[{type:"text",text:JSON.stringify(i,null,2)}]}}case"release_files":{let i=Ex(r.agentId);return{content:[{type:"text",text:JSON.stringify(i,null,2)}]}}case"check_conflicts":{let i=jx(r.files);return{content:[{type:"text",text:JSON.stringify(i,null,2)}]}}default:return{content:[{type:"text",text:`Unknown tool: ${t}`}],isError:!0}}}catch(i){return{content:[{type:"text",text:`Error: ${i.message}`}],isError:!0}}});async function x4(){let e=new rc;await hm.connect(e)}x4().catch(e=>{console.error("mcp-routinecode failed to start:",e),process.exit(1)});
|