@softspark/jira-mcp 1.0.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/dist/index.js ADDED
@@ -0,0 +1,149 @@
1
+ import {homedir}from'os';import {join,resolve}from'path';import {mkdir,readFile,writeFile,rename,access}from'fs/promises';import ng from'process';var Jg=Object.create;var da=Object.defineProperty;var Hg=Object.getOwnPropertyDescriptor;var Gg=Object.getOwnPropertyNames;var Bg=Object.getPrototypeOf,Kg=Object.prototype.hasOwnProperty;var Wg=(t,e)=>()=>(t&&(e=t(t=0)),e);var w=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),zo=(t,e)=>{for(var r in e)da(t,r,{get:e[r],enumerable:true});},Yg=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Gg(e))!Kg.call(t,o)&&o!==r&&da(t,o,{get:()=>e[o],enumerable:!(n=Hg(e,o))||n.enumerable});return t};var ju=(t,e,r)=>(r=t!=null?Jg(Bg(t)):{},Yg(da(r,"default",{value:t,enumerable:true}),t));var Hn=w(Y=>{Object.defineProperty(Y,"__esModule",{value:true});Y.regexpCode=Y.getEsmExportName=Y.getProperty=Y.safeStringify=Y.stringify=Y.strConcat=Y.addCodeArg=Y.str=Y._=Y.nil=Y._Code=Y.Name=Y.IDENTIFIER=Y._CodeOrName=void 0;var Vn=class{};Y._CodeOrName=Vn;Y.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var yr=class extends Vn{constructor(e){if(super(),!Y.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e;}toString(){return this.str}emptyStr(){return false}get names(){return {[this.str]:1}}};Y.Name=yr;var We=class extends Vn{constructor(e){super(),this._items=typeof e=="string"?[e]:e;}toString(){return this.str}emptyStr(){if(this._items.length>1)return false;let e=this._items[0];return e===""||e==='""'}get str(){var e;return (e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var e;return (e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,n)=>(n instanceof yr&&(r[n.str]=(r[n.str]||0)+1),r),{})}};Y._Code=We;Y.nil=new We("");function ff(t,...e){let r=[t[0]],n=0;for(;n<e.length;)$i(r,e[n]),r.push(t[++n]);return new We(r)}Y._=ff;var wi=new We("+");function mf(t,...e){let r=[Jn(t[0])],n=0;for(;n<e.length;)r.push(wi),$i(r,e[n]),r.push(wi,Jn(t[++n]));return hx(r),new We(r)}Y.str=mf;function $i(t,e){e instanceof We?t.push(...e._items):e instanceof yr?t.push(e):t.push(_x(e));}Y.addCodeArg=$i;function hx(t){let e=1;for(;e<t.length-1;){if(t[e]===wi){let r=gx(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+";}e++;}}function gx(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof yr||t[t.length-1]!=='"'?void 0:typeof e!="string"?`${t.slice(0,-1)}${e}"`:e[0]==='"'?t.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(t instanceof yr))return `"${t}${e.slice(1)}`}function yx(t,e){return e.emptyStr()?t:t.emptyStr()?e:mf`${t}${e}`}Y.strConcat=yx;function _x(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:Jn(Array.isArray(t)?t.join(","):t)}function vx(t){return new We(Jn(t))}Y.stringify=vx;function Jn(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}Y.safeStringify=Jn;function kx(t){return typeof t=="string"&&Y.IDENTIFIER.test(t)?new We(`.${t}`):ff`[${t}]`}Y.getProperty=kx;function xx(t){if(typeof t=="string"&&Y.IDENTIFIER.test(t))return new We(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}Y.getEsmExportName=xx;function bx(t){return new We(t.toString())}Y.regexpCode=bx;});var Ti=w(Me=>{Object.defineProperty(Me,"__esModule",{value:true});Me.ValueScope=Me.ValueScopeName=Me.Scope=Me.varKinds=Me.UsedValueState=void 0;var De=Hn(),Si=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value;}},ls;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed";})(ls||(Me.UsedValueState=ls={}));Me.varKinds={const:new De.Name("const"),let:new De.Name("let"),var:new De.Name("var")};var ds=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r;}toName(e){return e instanceof De.Name?e:this.name(e)}name(e){return new De.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return `${e}${r.index++}`}_nameGroup(e){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};Me.Scope=ds;var ps=class extends De.Name{constructor(e,r){super(r),this.prefix=e;}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=(0, De._)`.${new De.Name(r)}[${n}]`;}};Me.ValueScopeName=ps;var wx=(0, De._)`\n`,zi=class extends ds{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?wx:De.nil};}get(){return this._scope}name(e){return new ps(e,this._newName(e))}value(e,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let o=this.toName(e),{prefix:s}=o,a=(n=r.key)!==null&&n!==void 0?n:r.ref,i=this._values[s];if(i){let l=i.get(a);if(l)return l}else i=this._values[s]=new Map;i.set(a,o);let c=this._scope[s]||(this._scope[s]=[]),u=c.length;return c[u]=r.ref,o.setValue(r,{property:s,itemIndex:u}),o}getValue(e,r){let n=this._values[e];if(n)return n.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return (0, De._)`${e}${n.scopePath}`})}scopeCode(e=this._values,r,n){return this._reduceValues(e,o=>{if(o.value===void 0)throw new Error(`CodeGen: name "${o}" has no value`);return o.value.code},r,n)}_reduceValues(e,r,n={},o){let s=De.nil;for(let a in e){let i=e[a];if(!i)continue;let c=n[a]=n[a]||new Map;i.forEach(u=>{if(c.has(u))return;c.set(u,ls.Started);let l=r(u);if(l){let d=this.opts.es5?Me.varKinds.var:Me.varKinds.const;s=(0, De._)`${s}${d} ${u} = ${l};${this.opts._n}`;}else if(l=o?.(u))s=(0, De._)`${s}${l}${this.opts._n}`;else throw new Si(u);c.set(u,ls.Completed);});}return s}};Me.ValueScope=zi;});var L=w(U=>{Object.defineProperty(U,"__esModule",{value:true});U.or=U.and=U.not=U.CodeGen=U.operators=U.varKinds=U.ValueScopeName=U.ValueScope=U.Scope=U.Name=U.regexpCode=U.stringify=U.getProperty=U.nil=U.strConcat=U.str=U._=void 0;var B=Hn(),rt=Ti(),Ut=Hn();Object.defineProperty(U,"_",{enumerable:true,get:function(){return Ut._}});Object.defineProperty(U,"str",{enumerable:true,get:function(){return Ut.str}});Object.defineProperty(U,"strConcat",{enumerable:true,get:function(){return Ut.strConcat}});Object.defineProperty(U,"nil",{enumerable:true,get:function(){return Ut.nil}});Object.defineProperty(U,"getProperty",{enumerable:true,get:function(){return Ut.getProperty}});Object.defineProperty(U,"stringify",{enumerable:true,get:function(){return Ut.stringify}});Object.defineProperty(U,"regexpCode",{enumerable:true,get:function(){return Ut.regexpCode}});Object.defineProperty(U,"Name",{enumerable:true,get:function(){return Ut.Name}});var gs=Ti();Object.defineProperty(U,"Scope",{enumerable:true,get:function(){return gs.Scope}});Object.defineProperty(U,"ValueScope",{enumerable:true,get:function(){return gs.ValueScope}});Object.defineProperty(U,"ValueScopeName",{enumerable:true,get:function(){return gs.ValueScopeName}});Object.defineProperty(U,"varKinds",{enumerable:true,get:function(){return gs.varKinds}});U.operators={GT:new B._Code(">"),GTE:new B._Code(">="),LT:new B._Code("<"),LTE:new B._Code("<="),EQ:new B._Code("==="),NEQ:new B._Code("!=="),NOT:new B._Code("!"),OR:new B._Code("||"),AND:new B._Code("&&"),ADD:new B._Code("+")};var zt=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},Pi=class extends zt{constructor(e,r,n){super(),this.varKind=e,this.name=r,this.rhs=n;}render({es5:e,_n:r}){let n=e?rt.varKinds.var:this.varKind,o=this.rhs===void 0?"":` = ${this.rhs}`;return `${n} ${this.name}${o};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=Kr(this.rhs,e,r)),this}get names(){return this.rhs instanceof B._CodeOrName?this.rhs.names:{}}},fs=class extends zt{constructor(e,r,n){super(),this.lhs=e,this.rhs=r,this.sideEffects=n;}render({_n:e}){return `${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof B.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=Kr(this.rhs,e,r),this}get names(){let e=this.lhs instanceof B.Name?{}:{...this.lhs.names};return hs(e,this.rhs)}},Ei=class extends fs{constructor(e,r,n,o){super(e,n,o),this.op=r;}render({_n:e}){return `${this.lhs} ${this.op}= ${this.rhs};`+e}},Ri=class extends zt{constructor(e){super(),this.label=e,this.names={};}render({_n:e}){return `${this.label}:`+e}},Ii=class extends zt{constructor(e){super(),this.label=e,this.names={};}render({_n:e}){return `break${this.label?` ${this.label}`:""};`+e}},ji=class extends zt{constructor(e){super(),this.error=e;}render({_n:e}){return `throw ${this.error};`+e}get names(){return this.error.names}},Ci=class extends zt{constructor(e){super(),this.code=e;}render({_n:e}){return `${this.code};`+e}optimizeNodes(){return `${this.code}`?this:void 0}optimizeNames(e,r){return this.code=Kr(this.code,e,r),this}get names(){return this.code instanceof B._CodeOrName?this.code.names:{}}},Gn=class extends zt{constructor(e=[]){super(),this.nodes=e;}render(e){return this.nodes.reduce((r,n)=>r+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let n=e[r].optimizeNodes();Array.isArray(n)?e.splice(r,1,...n):n?e[r]=n:e.splice(r,1);}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:n}=this,o=n.length;for(;o--;){let s=n[o];s.optimizeNames(e,r)||($x(e,s.names),n.splice(o,1));}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>kr(e,r.names),{})}},Tt=class extends Gn{render(e){return "{"+e._n+super.render(e)+"}"+e._n}},Oi=class extends Gn{},Br=class extends Tt{};Br.kind="else";var _r=class t extends Tt{constructor(e,r){super(r),this.condition=e;}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===true)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new Br(n):n;}if(r)return e===false?r instanceof t?r:r.nodes:this.nodes.length?this:new t(hf(e),r instanceof t?[r]:r.nodes);if(!(e===false||!this.nodes.length))return this}optimizeNames(e,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=Kr(this.condition,e,r),this}get names(){let e=super.names;return hs(e,this.condition),this.else&&kr(e,this.else.names),e}};_r.kind="if";var vr=class extends Tt{};vr.kind="for";var Ni=class extends vr{constructor(e){super(),this.iteration=e;}render(e){return `for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=Kr(this.iteration,e,r),this}get names(){return kr(super.names,this.iteration.names)}},Ai=class extends vr{constructor(e,r,n,o){super(),this.varKind=e,this.name=r,this.from=n,this.to=o;}render(e){let r=e.es5?rt.varKinds.var:this.varKind,{name:n,from:o,to:s}=this;return `for(${r} ${n}=${o}; ${n}<${s}; ${n}++)`+super.render(e)}get names(){let e=hs(super.names,this.from);return hs(e,this.to)}},ms=class extends vr{constructor(e,r,n,o){super(),this.loop=e,this.varKind=r,this.name=n,this.iterable=o;}render(e){return `for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=Kr(this.iterable,e,r),this}get names(){return kr(super.names,this.iterable.names)}},Bn=class extends Tt{constructor(e,r,n){super(),this.name=e,this.args=r,this.async=n;}render(e){return `${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};Bn.kind="func";var Kn=class extends Gn{render(e){return "return "+super.render(e)}};Kn.kind="return";var Zi=class extends Tt{render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var n,o;return super.optimizeNames(e,r),(n=this.catch)===null||n===void 0||n.optimizeNames(e,r),(o=this.finally)===null||o===void 0||o.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&kr(e,this.catch.names),this.finally&&kr(e,this.finally.names),e}},Wn=class extends Tt{constructor(e){super(),this.error=e;}render(e){return `catch(${this.error})`+super.render(e)}};Wn.kind="catch";var Yn=class extends Tt{render(e){return "finally"+super.render(e)}};Yn.kind="finally";var Di=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
2
+ `:""},this._extScope=e,this._scope=new rt.Scope({parent:e}),this._nodes=[new Oi];}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,r){let n=this._extScope.value(e,r);return (this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,r){return this._extScope.getValue(e,r)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,r,n,o){let s=this._scope.toName(r);return n!==void 0&&o&&(this._constants[s.str]=n),this._leafNode(new Pi(e,s,n)),s}const(e,r,n){return this._def(rt.varKinds.const,e,r,n)}let(e,r,n){return this._def(rt.varKinds.let,e,r,n)}var(e,r,n){return this._def(rt.varKinds.var,e,r,n)}assign(e,r,n){return this._leafNode(new fs(e,r,n))}add(e,r){return this._leafNode(new Ei(e,U.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==B.nil&&this._leafNode(new Ci(e)),this}object(...e){let r=["{"];for(let[n,o]of e)r.length>1&&r.push(","),r.push(n),(n!==o||this.opts.es5)&&(r.push(":"),(0, B.addCodeArg)(r,o));return r.push("}"),new B._Code(r)}if(e,r,n){if(this._blockNode(new _r(e)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new _r(e))}else(){return this._elseNode(new Br)}endIf(){return this._endBlockNode(_r,Br)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new Ni(e),r)}forRange(e,r,n,o,s=this.opts.es5?rt.varKinds.var:rt.varKinds.let){let a=this._scope.toName(e);return this._for(new Ai(s,a,r,n),()=>o(a))}forOf(e,r,n,o=rt.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let a=r instanceof B.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0, B._)`${a}.length`,i=>{this.var(s,(0, B._)`${a}[${i}]`),n(s);})}return this._for(new ms("of",o,s,r),()=>n(s))}forIn(e,r,n,o=this.opts.es5?rt.varKinds.var:rt.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0, B._)`Object.keys(${r})`,n);let s=this._scope.toName(e);return this._for(new ms("in",o,s,r),()=>n(s))}endFor(){return this._endBlockNode(vr)}label(e){return this._leafNode(new Ri(e))}break(e){return this._leafNode(new Ii(e))}return(e){let r=new Kn;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Kn)}try(e,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let o=new Zi;if(this._blockNode(o),this.code(e),r){let s=this.name("e");this._currNode=o.catch=new Wn(s),r(s);}return n&&(this._currNode=o.finally=new Yn,this.code(n)),this._endBlockNode(Wn,Yn)}throw(e){return this._leafNode(new ji(e))}block(e,r){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(r),this}endBlock(e){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||e!==void 0&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=r,this}func(e,r=B.nil,n,o){return this._blockNode(new Bn(e,r,n)),o&&this.code(o).endFunc(),this}endFunc(){return this._endBlockNode(Bn)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants);}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e);}_endBlockNode(e,r){let n=this._currNode;if(n instanceof e||r&&n instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${e.kind}/${r.kind}`:e.kind}"`)}_elseNode(e){let r=this._currNode;if(!(r instanceof _r))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let r=this._nodes;r[r.length-1]=e;}};U.CodeGen=Di;function kr(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}function hs(t,e){return e instanceof B._CodeOrName?kr(t,e.names):t}function Kr(t,e,r){if(t instanceof B.Name)return n(t);if(!o(t))return t;return new B._Code(t._items.reduce((s,a)=>(a instanceof B.Name&&(a=n(a)),a instanceof B._Code?s.push(...a._items):s.push(a),s),[]));function n(s){let a=r[s.str];return a===void 0||e[s.str]!==1?s:(delete e[s.str],a)}function o(s){return s instanceof B._Code&&s._items.some(a=>a instanceof B.Name&&e[a.str]===1&&r[a.str]!==void 0)}}function $x(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0);}function hf(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0, B._)`!${Mi(t)}`}U.not=hf;var Sx=gf(U.operators.AND);function zx(...t){return t.reduce(Sx)}U.and=zx;var Tx=gf(U.operators.OR);function Px(...t){return t.reduce(Tx)}U.or=Px;function gf(t){return (e,r)=>e===B.nil?r:r===B.nil?e:(0, B._)`${Mi(e)} ${t} ${Mi(r)}`}function Mi(t){return t instanceof B.Name?t:(0, B._)`(${t})`}});var K=w(F=>{Object.defineProperty(F,"__esModule",{value:true});F.checkStrictMode=F.getErrorPath=F.Type=F.useFunc=F.setEvaluated=F.evaluatedPropsToName=F.mergeEvaluated=F.eachItem=F.unescapeJsonPointer=F.escapeJsonPointer=F.escapeFragment=F.unescapeFragment=F.schemaRefOrVal=F.schemaHasRulesButRef=F.schemaHasRules=F.checkUnknownRules=F.alwaysValidSchema=F.toHash=void 0;var re=L(),Ex=Hn();function Rx(t){let e={};for(let r of t)e[r]=true;return e}F.toHash=Rx;function Ix(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?true:(vf(t,e),!kf(e,t.self.RULES.all))}F.alwaysValidSchema=Ix;function vf(t,e=t.schema){let{opts:r,self:n}=t;if(!r.strictSchema||typeof e=="boolean")return;let o=n.RULES.keywords;for(let s in e)o[s]||wf(t,`unknown keyword: "${s}"`);}F.checkUnknownRules=vf;function kf(t,e){if(typeof t=="boolean")return !t;for(let r in t)if(e[r])return true;return false}F.schemaHasRules=kf;function jx(t,e){if(typeof t=="boolean")return !t;for(let r in t)if(r!=="$ref"&&e.all[r])return true;return false}F.schemaHasRulesButRef=jx;function Cx({topSchemaRef:t,schemaPath:e},r,n,o){if(!o){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return (0, re._)`${r}`}return (0, re._)`${t}${e}${(0, re.getProperty)(n)}`}F.schemaRefOrVal=Cx;function Ox(t){return xf(decodeURIComponent(t))}F.unescapeFragment=Ox;function Nx(t){return encodeURIComponent(Li(t))}F.escapeFragment=Nx;function Li(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}F.escapeJsonPointer=Li;function xf(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}F.unescapeJsonPointer=xf;function Ax(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t);}F.eachItem=Ax;function yf({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:n}){return (o,s,a,i)=>{let c=a===void 0?s:a instanceof re.Name?(s instanceof re.Name?t(o,s,a):e(o,s,a),a):s instanceof re.Name?(e(o,a,s),s):r(s,a);return i===re.Name&&!(c instanceof re.Name)?n(o,c):c}}F.mergeEvaluated={props:yf({mergeNames:(t,e,r)=>t.if((0, re._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0, re._)`${e} === true`,()=>t.assign(r,true),()=>t.assign(r,(0, re._)`${r} || {}`).code((0, re._)`Object.assign(${r}, ${e})`));}),mergeToName:(t,e,r)=>t.if((0, re._)`${r} !== true`,()=>{e===true?t.assign(r,true):(t.assign(r,(0, re._)`${r} || {}`),Ui(t,r,e));}),mergeValues:(t,e)=>t===true?true:{...t,...e},resultToName:bf}),items:yf({mergeNames:(t,e,r)=>t.if((0, re._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0, re._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),mergeToName:(t,e,r)=>t.if((0, re._)`${r} !== true`,()=>t.assign(r,e===true?true:(0, re._)`${r} > ${e} ? ${r} : ${e}`)),mergeValues:(t,e)=>t===true?true:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function bf(t,e){if(e===true)return t.var("props",true);let r=t.var("props",(0, re._)`{}`);return e!==void 0&&Ui(t,r,e),r}F.evaluatedPropsToName=bf;function Ui(t,e,r){Object.keys(r).forEach(n=>t.assign((0, re._)`${e}${(0, re.getProperty)(n)}`,true));}F.setEvaluated=Ui;var _f={};function Zx(t,e){return t.scopeValue("func",{ref:e,code:_f[e.code]||(_f[e.code]=new Ex._Code(e.code))})}F.useFunc=Zx;var qi;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str";})(qi||(F.Type=qi={}));function Dx(t,e,r){if(t instanceof re.Name){let n=e===qi.Num;return r?n?(0, re._)`"[" + ${t} + "]"`:(0, re._)`"['" + ${t} + "']"`:n?(0, re._)`"/" + ${t}`:(0, re._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0, re.getProperty)(t).toString():"/"+Li(t)}F.getErrorPath=Dx;function wf(t,e,r=t.opts.strictSchema){if(r){if(e=`strict mode: ${e}`,r===true)throw new Error(e);t.self.logger.warn(e);}}F.checkStrictMode=wf;});var Pt=w(Fi=>{Object.defineProperty(Fi,"__esModule",{value:true});var ze=L(),Mx={data:new ze.Name("data"),valCxt:new ze.Name("valCxt"),instancePath:new ze.Name("instancePath"),parentData:new ze.Name("parentData"),parentDataProperty:new ze.Name("parentDataProperty"),rootData:new ze.Name("rootData"),dynamicAnchors:new ze.Name("dynamicAnchors"),vErrors:new ze.Name("vErrors"),errors:new ze.Name("errors"),this:new ze.Name("this"),self:new ze.Name("self"),scope:new ze.Name("scope"),json:new ze.Name("json"),jsonPos:new ze.Name("jsonPos"),jsonLen:new ze.Name("jsonLen"),jsonPart:new ze.Name("jsonPart")};Fi.default=Mx;});var Qn=w(Te=>{Object.defineProperty(Te,"__esModule",{value:true});Te.extendErrors=Te.resetErrorsCount=Te.reportExtraError=Te.reportError=Te.keyword$DataError=Te.keywordError=void 0;var W=L(),ys=K(),Ce=Pt();Te.keywordError={message:({keyword:t})=>(0, W.str)`must pass "${t}" keyword validation`};Te.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0, W.str)`"${t}" keyword must be ${e} ($data)`:(0, W.str)`"${t}" keyword is invalid ($data)`};function qx(t,e=Te.keywordError,r,n){let{it:o}=t,{gen:s,compositeRule:a,allErrors:i}=o,c=zf(t,e,r);n??(a||i)?$f(s,c):Sf(o,(0, W._)`[${c}]`);}Te.reportError=qx;function Lx(t,e=Te.keywordError,r){let{it:n}=t,{gen:o,compositeRule:s,allErrors:a}=n,i=zf(t,e,r);$f(o,i),s||a||Sf(n,Ce.default.vErrors);}Te.reportExtraError=Lx;function Ux(t,e){t.assign(Ce.default.errors,e),t.if((0, W._)`${Ce.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0, W._)`${Ce.default.vErrors}.length`,e),()=>t.assign(Ce.default.vErrors,null)));}Te.resetErrorsCount=Ux;function Fx({gen:t,keyword:e,schemaValue:r,data:n,errsCount:o,it:s}){if(o===void 0)throw new Error("ajv implementation error");let a=t.name("err");t.forRange("i",o,Ce.default.errors,i=>{t.const(a,(0, W._)`${Ce.default.vErrors}[${i}]`),t.if((0, W._)`${a}.instancePath === undefined`,()=>t.assign((0, W._)`${a}.instancePath`,(0, W.strConcat)(Ce.default.instancePath,s.errorPath))),t.assign((0, W._)`${a}.schemaPath`,(0, W.str)`${s.errSchemaPath}/${e}`),s.opts.verbose&&(t.assign((0, W._)`${a}.schema`,r),t.assign((0, W._)`${a}.data`,n));});}Te.extendErrors=Fx;function $f(t,e){let r=t.const("err",e);t.if((0, W._)`${Ce.default.vErrors} === null`,()=>t.assign(Ce.default.vErrors,(0, W._)`[${r}]`),(0, W._)`${Ce.default.vErrors}.push(${r})`),t.code((0, W._)`${Ce.default.errors}++`);}function Sf(t,e){let{gen:r,validateName:n,schemaEnv:o}=t;o.$async?r.throw((0, W._)`new ${t.ValidationError}(${e})`):(r.assign((0, W._)`${n}.errors`,e),r.return(false));}var xr={keyword:new W.Name("keyword"),schemaPath:new W.Name("schemaPath"),params:new W.Name("params"),propertyName:new W.Name("propertyName"),message:new W.Name("message"),schema:new W.Name("schema"),parentSchema:new W.Name("parentSchema")};function zf(t,e,r){let{createErrors:n}=t.it;return n===false?(0, W._)`{}`:Vx(t,e,r)}function Vx(t,e,r={}){let{gen:n,it:o}=t,s=[Jx(o,r),Hx(t,r)];return Gx(t,e,s),n.object(...s)}function Jx({errorPath:t},{instancePath:e}){let r=e?(0, W.str)`${t}${(0, ys.getErrorPath)(e,ys.Type.Str)}`:t;return [Ce.default.instancePath,(0, W.strConcat)(Ce.default.instancePath,r)]}function Hx({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:n}){let o=n?e:(0, W.str)`${e}/${t}`;return r&&(o=(0, W.str)`${o}${(0, ys.getErrorPath)(r,ys.Type.Str)}`),[xr.schemaPath,o]}function Gx(t,{params:e,message:r},n){let{keyword:o,data:s,schemaValue:a,it:i}=t,{opts:c,propertyName:u,topSchemaRef:l,schemaPath:d}=i;n.push([xr.keyword,o],[xr.params,typeof e=="function"?e(t):e||(0, W._)`{}`]),c.messages&&n.push([xr.message,typeof r=="function"?r(t):r]),c.verbose&&n.push([xr.schema,a],[xr.parentSchema,(0, W._)`${l}${d}`],[Ce.default.data,s]),u&&n.push([xr.propertyName,u]);}});var Pf=w(Wr=>{Object.defineProperty(Wr,"__esModule",{value:true});Wr.boolOrEmptySchema=Wr.topBoolOrEmptySchema=void 0;var Bx=Qn(),Kx=L(),Wx=Pt(),Yx={message:"boolean schema is false"};function Qx(t){let{gen:e,schema:r,validateName:n}=t;r===false?Tf(t,false):typeof r=="object"&&r.$async===true?e.return(Wx.default.data):(e.assign((0, Kx._)`${n}.errors`,null),e.return(true));}Wr.topBoolOrEmptySchema=Qx;function Xx(t,e){let{gen:r,schema:n}=t;n===false?(r.var(e,false),Tf(t)):r.var(e,true);}Wr.boolOrEmptySchema=Xx;function Tf(t,e){let{gen:r,data:n}=t,o={gen:r,keyword:"false schema",data:n,schema:false,schemaCode:false,schemaValue:false,params:{},it:t};(0, Bx.reportError)(o,Yx,void 0,e);}});var Vi=w(Yr=>{Object.defineProperty(Yr,"__esModule",{value:true});Yr.getRules=Yr.isJSONType=void 0;var eb=["string","number","integer","boolean","null","object","array"],tb=new Set(eb);function rb(t){return typeof t=="string"&&tb.has(t)}Yr.isJSONType=rb;function nb(){let t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return {types:{...t,integer:true,boolean:true,null:true},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}Yr.getRules=nb;});var Ji=w(Ft=>{Object.defineProperty(Ft,"__esModule",{value:true});Ft.shouldUseRule=Ft.shouldUseGroup=Ft.schemaHasRulesForType=void 0;function ob({schema:t,self:e},r){let n=e.RULES.types[r];return n&&n!==true&&Ef(t,n)}Ft.schemaHasRulesForType=ob;function Ef(t,e){return e.rules.some(r=>Rf(t,r))}Ft.shouldUseGroup=Ef;function Rf(t,e){var r;return t[e.keyword]!==void 0||((r=e.definition.implements)===null||r===void 0?void 0:r.some(n=>t[n]!==void 0))}Ft.shouldUseRule=Rf;});var Xn=w(Pe=>{Object.defineProperty(Pe,"__esModule",{value:true});Pe.reportTypeError=Pe.checkDataTypes=Pe.checkDataType=Pe.coerceAndCheckDataType=Pe.getJSONTypes=Pe.getSchemaTypes=Pe.DataType=void 0;var sb=Vi(),ab=Ji(),ib=Qn(),M=L(),If=K(),Qr;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong";})(Qr||(Pe.DataType=Qr={}));function cb(t){let e=jf(t.type);if(e.includes("null")){if(t.nullable===false)throw new Error("type: null contradicts nullable: false")}else {if(!e.length&&t.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');t.nullable===true&&e.push("null");}return e}Pe.getSchemaTypes=cb;function jf(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(sb.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}Pe.getJSONTypes=jf;function ub(t,e){let{gen:r,data:n,opts:o}=t,s=lb(e,o.coerceTypes),a=e.length>0&&!(s.length===0&&e.length===1&&(0, ab.schemaHasRulesForType)(t,e[0]));if(a){let i=Gi(e,n,o.strictNumbers,Qr.Wrong);r.if(i,()=>{s.length?db(t,e,s):Bi(t);});}return a}Pe.coerceAndCheckDataType=ub;var Cf=new Set(["string","number","integer","boolean","null"]);function lb(t,e){return e?t.filter(r=>Cf.has(r)||e==="array"&&r==="array"):[]}function db(t,e,r){let{gen:n,data:o,opts:s}=t,a=n.let("dataType",(0, M._)`typeof ${o}`),i=n.let("coerced",(0, M._)`undefined`);s.coerceTypes==="array"&&n.if((0, M._)`${a} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,()=>n.assign(o,(0, M._)`${o}[0]`).assign(a,(0, M._)`typeof ${o}`).if(Gi(e,o,s.strictNumbers),()=>n.assign(i,o))),n.if((0, M._)`${i} !== undefined`);for(let u of r)(Cf.has(u)||u==="array"&&s.coerceTypes==="array")&&c(u);n.else(),Bi(t),n.endIf(),n.if((0, M._)`${i} !== undefined`,()=>{n.assign(o,i),pb(t,i);});function c(u){switch(u){case "string":n.elseIf((0, M._)`${a} == "number" || ${a} == "boolean"`).assign(i,(0, M._)`"" + ${o}`).elseIf((0, M._)`${o} === null`).assign(i,(0, M._)`""`);return;case "number":n.elseIf((0, M._)`${a} == "boolean" || ${o} === null
3
+ || (${a} == "string" && ${o} && ${o} == +${o})`).assign(i,(0, M._)`+${o}`);return;case "integer":n.elseIf((0, M._)`${a} === "boolean" || ${o} === null
4
+ || (${a} === "string" && ${o} && ${o} == +${o} && !(${o} % 1))`).assign(i,(0, M._)`+${o}`);return;case "boolean":n.elseIf((0, M._)`${o} === "false" || ${o} === 0 || ${o} === null`).assign(i,false).elseIf((0, M._)`${o} === "true" || ${o} === 1`).assign(i,true);return;case "null":n.elseIf((0, M._)`${o} === "" || ${o} === 0 || ${o} === false`),n.assign(i,null);return;case "array":n.elseIf((0, M._)`${a} === "string" || ${a} === "number"
5
+ || ${a} === "boolean" || ${o} === null`).assign(i,(0, M._)`[${o}]`);}}}function pb({gen:t,parentData:e,parentDataProperty:r},n){t.if((0, M._)`${e} !== undefined`,()=>t.assign((0, M._)`${e}[${r}]`,n));}function Hi(t,e,r,n=Qr.Correct){let o=n===Qr.Correct?M.operators.EQ:M.operators.NEQ,s;switch(t){case "null":return (0, M._)`${e} ${o} null`;case "array":s=(0, M._)`Array.isArray(${e})`;break;case "object":s=(0, M._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case "integer":s=a((0, M._)`!(${e} % 1) && !isNaN(${e})`);break;case "number":s=a();break;default:return (0, M._)`typeof ${e} ${o} ${t}`}return n===Qr.Correct?s:(0, M.not)(s);function a(i=M.nil){return (0, M.and)((0, M._)`typeof ${e} == "number"`,i,r?(0, M._)`isFinite(${e})`:M.nil)}}Pe.checkDataType=Hi;function Gi(t,e,r,n){if(t.length===1)return Hi(t[0],e,r,n);let o,s=(0, If.toHash)(t);if(s.array&&s.object){let a=(0, M._)`typeof ${e} != "object"`;o=s.null?a:(0, M._)`!${e} || ${a}`,delete s.null,delete s.array,delete s.object;}else o=M.nil;s.number&&delete s.integer;for(let a in s)o=(0, M.and)(o,Hi(a,e,r,n));return o}Pe.checkDataTypes=Gi;var fb={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0, M._)`{type: ${t}}`:(0, M._)`{type: ${e}}`};function Bi(t){let e=mb(t);(0, ib.reportError)(e,fb);}Pe.reportTypeError=Bi;function mb(t){let{gen:e,data:r,schema:n}=t,o=(0, If.schemaRefOrVal)(t,n,"type");return {gen:e,keyword:"type",data:r,schema:n.type,schemaCode:o,schemaValue:o,parentSchema:n,params:{},it:t}}});var Nf=w(_s=>{Object.defineProperty(_s,"__esModule",{value:true});_s.assignDefaults=void 0;var Xr=L(),hb=K();function gb(t,e){let{properties:r,items:n}=t.schema;if(e==="object"&&r)for(let o in r)Of(t,o,r[o].default);else e==="array"&&Array.isArray(n)&&n.forEach((o,s)=>Of(t,s,o.default));}_s.assignDefaults=gb;function Of(t,e,r){let{gen:n,compositeRule:o,data:s,opts:a}=t;if(r===void 0)return;let i=(0, Xr._)`${s}${(0, Xr.getProperty)(e)}`;if(o){(0, hb.checkStrictMode)(t,`default is ignored for: ${i}`);return}let c=(0, Xr._)`${i} === undefined`;a.useDefaults==="empty"&&(c=(0, Xr._)`${c} || ${i} === null || ${i} === ""`),n.if(c,(0, Xr._)`${i} = ${(0, Xr.stringify)(r)}`);}});var Ye=w(te=>{Object.defineProperty(te,"__esModule",{value:true});te.validateUnion=te.validateArray=te.usePattern=te.callValidateCode=te.schemaProperties=te.allSchemaProperties=te.noPropertyInData=te.propertyInData=te.isOwnProperty=te.hasPropFunc=te.reportMissingProp=te.checkMissingProp=te.checkReportMissingProp=void 0;var ce=L(),Ki=K(),Vt=Pt(),yb=K();function _b(t,e){let{gen:r,data:n,it:o}=t;r.if(Yi(r,n,e,o.opts.ownProperties),()=>{t.setParams({missingProperty:(0, ce._)`${e}`},true),t.error();});}te.checkReportMissingProp=_b;function vb({gen:t,data:e,it:{opts:r}},n,o){return (0, ce.or)(...n.map(s=>(0, ce.and)(Yi(t,e,s,r.ownProperties),(0, ce._)`${o} = ${s}`)))}te.checkMissingProp=vb;function kb(t,e){t.setParams({missingProperty:e},true),t.error();}te.reportMissingProp=kb;function Af(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0, ce._)`Object.prototype.hasOwnProperty`})}te.hasPropFunc=Af;function Wi(t,e,r){return (0, ce._)`${Af(t)}.call(${e}, ${r})`}te.isOwnProperty=Wi;function xb(t,e,r,n){let o=(0, ce._)`${e}${(0, ce.getProperty)(r)} !== undefined`;return n?(0, ce._)`${o} && ${Wi(t,e,r)}`:o}te.propertyInData=xb;function Yi(t,e,r,n){let o=(0, ce._)`${e}${(0, ce.getProperty)(r)} === undefined`;return n?(0, ce.or)(o,(0, ce.not)(Wi(t,e,r))):o}te.noPropertyInData=Yi;function Zf(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}te.allSchemaProperties=Zf;function bb(t,e){return Zf(e).filter(r=>!(0, Ki.alwaysValidSchema)(t,e[r]))}te.schemaProperties=bb;function wb({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:o,errorPath:s},it:a},i,c,u){let l=u?(0, ce._)`${t}, ${e}, ${n}${o}`:e,d=[[Vt.default.instancePath,(0, ce.strConcat)(Vt.default.instancePath,s)],[Vt.default.parentData,a.parentData],[Vt.default.parentDataProperty,a.parentDataProperty],[Vt.default.rootData,Vt.default.rootData]];a.opts.dynamicRef&&d.push([Vt.default.dynamicAnchors,Vt.default.dynamicAnchors]);let p=(0, ce._)`${l}, ${r.object(...d)}`;return c!==ce.nil?(0, ce._)`${i}.call(${c}, ${p})`:(0, ce._)`${i}(${p})`}te.callValidateCode=wb;var $b=(0, ce._)`new RegExp`;function Sb({gen:t,it:{opts:e}},r){let n=e.unicodeRegExp?"u":"",{regExp:o}=e.code,s=o(r,n);return t.scopeValue("pattern",{key:s.toString(),ref:s,code:(0, ce._)`${o.code==="new RegExp"?$b:(0, yb.useFunc)(t,o)}(${r}, ${n})`})}te.usePattern=Sb;function zb(t){let{gen:e,data:r,keyword:n,it:o}=t,s=e.name("valid");if(o.allErrors){let i=e.let("valid",true);return a(()=>e.assign(i,false)),i}return e.var(s,true),a(()=>e.break()),s;function a(i){let c=e.const("len",(0, ce._)`${r}.length`);e.forRange("i",0,c,u=>{t.subschema({keyword:n,dataProp:u,dataPropType:Ki.Type.Num},s),e.if((0, ce.not)(s),i);});}}te.validateArray=zb;function Tb(t){let{gen:e,schema:r,keyword:n,it:o}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(c=>(0, Ki.alwaysValidSchema)(o,c))&&!o.opts.unevaluated)return;let a=e.let("valid",false),i=e.name("_valid");e.block(()=>r.forEach((c,u)=>{let l=t.subschema({keyword:n,schemaProp:u,compositeRule:true},i);e.assign(a,(0, ce._)`${a} || ${i}`),t.mergeValidEvaluated(l,i)||e.if((0, ce.not)(a));})),t.result(a,()=>t.reset(),()=>t.error(true));}te.validateUnion=Tb;});var qf=w(mt=>{Object.defineProperty(mt,"__esModule",{value:true});mt.validateKeywordUsage=mt.validSchemaType=mt.funcKeywordCode=mt.macroKeywordCode=void 0;var Oe=L(),br=Pt(),Pb=Ye(),Eb=Qn();function Rb(t,e){let{gen:r,keyword:n,schema:o,parentSchema:s,it:a}=t,i=e.macro.call(a.self,o,s,a),c=Mf(r,n,i);a.opts.validateSchema!==false&&a.self.validateSchema(i,true);let u=r.name("valid");t.subschema({schema:i,schemaPath:Oe.nil,errSchemaPath:`${a.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:true},u),t.pass(u,()=>t.error(true));}mt.macroKeywordCode=Rb;function Ib(t,e){var r;let{gen:n,keyword:o,schema:s,parentSchema:a,$data:i,it:c}=t;Cb(c,e);let u=!i&&e.compile?e.compile.call(c.self,s,a,c):e.validate,l=Mf(n,o,u),d=n.let("valid");t.block$data(d,p),t.ok((r=e.valid)!==null&&r!==void 0?r:d);function p(){if(e.errors===false)y(),e.modifying&&Df(t),v(()=>t.error());else {let k=e.async?f():g();e.modifying&&Df(t),v(()=>jb(t,k));}}function f(){let k=n.let("ruleErrs",null);return n.try(()=>y((0, Oe._)`await `),S=>n.assign(d,false).if((0, Oe._)`${S} instanceof ${c.ValidationError}`,()=>n.assign(k,(0, Oe._)`${S}.errors`),()=>n.throw(S))),k}function g(){let k=(0, Oe._)`${l}.errors`;return n.assign(k,null),y(Oe.nil),k}function y(k=e.async?(0, Oe._)`await `:Oe.nil){let S=c.opts.passContext?br.default.this:br.default.self,b=!("compile"in e&&!i||e.schema===false);n.assign(d,(0, Oe._)`${k}${(0, Pb.callValidateCode)(t,l,S,b)}`,e.modifying);}function v(k){var S;n.if((0, Oe.not)((S=e.valid)!==null&&S!==void 0?S:d),k);}}mt.funcKeywordCode=Ib;function Df(t){let{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0, Oe._)`${n.parentData}[${n.parentDataProperty}]`));}function jb(t,e){let{gen:r}=t;r.if((0, Oe._)`Array.isArray(${e})`,()=>{r.assign(br.default.vErrors,(0, Oe._)`${br.default.vErrors} === null ? ${e} : ${br.default.vErrors}.concat(${e})`).assign(br.default.errors,(0, Oe._)`${br.default.vErrors}.length`),(0, Eb.extendErrors)(t);},()=>t.error());}function Cb({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function Mf(t,e,r){if(r===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0, Oe.stringify)(r)})}function Ob(t,e,r=false){return !e.length||e.some(n=>n==="array"?Array.isArray(t):n==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==n||r&&typeof t>"u")}mt.validSchemaType=Ob;function Nb({schema:t,opts:e,self:r,errSchemaPath:n},o,s){if(Array.isArray(o.keyword)?!o.keyword.includes(s):o.keyword!==s)throw new Error("ajv implementation error");let a=o.dependencies;if(a?.some(i=>!Object.prototype.hasOwnProperty.call(t,i)))throw new Error(`parent schema must have dependencies of ${s}: ${a.join(",")}`);if(o.validateSchema&&!o.validateSchema(t[s])){let c=`keyword "${s}" value is invalid at path "${n}": `+r.errorsText(o.validateSchema.errors);if(e.validateSchema==="log")r.logger.error(c);else throw new Error(c)}}mt.validateKeywordUsage=Nb;});var Uf=w(Jt=>{Object.defineProperty(Jt,"__esModule",{value:true});Jt.extendSubschemaMode=Jt.extendSubschemaData=Jt.getSubschema=void 0;var ht=L(),Lf=K();function Ab(t,{keyword:e,schemaProp:r,schema:n,schemaPath:o,errSchemaPath:s,topSchemaRef:a}){if(e!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let i=t.schema[e];return r===void 0?{schema:i,schemaPath:(0, ht._)`${t.schemaPath}${(0, ht.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:i[r],schemaPath:(0, ht._)`${t.schemaPath}${(0, ht.getProperty)(e)}${(0, ht.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0, Lf.escapeFragment)(r)}`}}if(n!==void 0){if(o===void 0||s===void 0||a===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return {schema:n,schemaPath:o,topSchemaRef:a,errSchemaPath:s}}throw new Error('either "keyword" or "schema" must be passed')}Jt.getSubschema=Ab;function Zb(t,e,{dataProp:r,dataPropType:n,data:o,dataTypes:s,propertyName:a}){if(o!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:i}=e;if(r!==void 0){let{errorPath:u,dataPathArr:l,opts:d}=e,p=i.let("data",(0, ht._)`${e.data}${(0, ht.getProperty)(r)}`,true);c(p),t.errorPath=(0, ht.str)`${u}${(0, Lf.getErrorPath)(r,n,d.jsPropertySyntax)}`,t.parentDataProperty=(0, ht._)`${r}`,t.dataPathArr=[...l,t.parentDataProperty];}if(o!==void 0){let u=o instanceof ht.Name?o:i.let("data",o,true);c(u),a!==void 0&&(t.propertyName=a);}s&&(t.dataTypes=s);function c(u){t.data=u,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,u];}}Jt.extendSubschemaData=Zb;function Db(t,{jtdDiscriminator:e,jtdMetadata:r,compositeRule:n,createErrors:o,allErrors:s}){n!==void 0&&(t.compositeRule=n),o!==void 0&&(t.createErrors=o),s!==void 0&&(t.allErrors=s),t.jtdDiscriminator=e,t.jtdMetadata=r;}Jt.extendSubschemaMode=Db;});var Qi=w((vC,Ff)=>{Ff.exports=function t(e,r){if(e===r)return true;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return false;var n,o,s;if(Array.isArray(e)){if(n=e.length,n!=r.length)return false;for(o=n;o--!==0;)if(!t(e[o],r[o]))return false;return true}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(s=Object.keys(e),n=s.length,n!==Object.keys(r).length)return false;for(o=n;o--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[o]))return false;for(o=n;o--!==0;){var a=s[o];if(!t(e[a],r[a]))return false}return true}return e!==e&&r!==r};});var Jf=w((kC,Vf)=>{var Ht=Vf.exports=function(t,e,r){typeof e=="function"&&(r=e,e={}),r=e.cb||r;var n=typeof r=="function"?r:r.pre||function(){},o=r.post||function(){};vs(e,n,o,t,"",t);};Ht.keywords={additionalItems:true,items:true,contains:true,additionalProperties:true,propertyNames:true,not:true,if:true,then:true,else:true};Ht.arrayKeywords={items:true,allOf:true,anyOf:true,oneOf:true};Ht.propsKeywords={$defs:true,definitions:true,properties:true,patternProperties:true,dependencies:true};Ht.skipKeywords={default:true,enum:true,const:true,required:true,maximum:true,minimum:true,exclusiveMaximum:true,exclusiveMinimum:true,multipleOf:true,maxLength:true,minLength:true,pattern:true,format:true,maxItems:true,minItems:true,uniqueItems:true,maxProperties:true,minProperties:true};function vs(t,e,r,n,o,s,a,i,c,u){if(n&&typeof n=="object"&&!Array.isArray(n)){e(n,o,s,a,i,c,u);for(var l in n){var d=n[l];if(Array.isArray(d)){if(l in Ht.arrayKeywords)for(var p=0;p<d.length;p++)vs(t,e,r,d[p],o+"/"+l+"/"+p,s,o,l,n,p);}else if(l in Ht.propsKeywords){if(d&&typeof d=="object")for(var f in d)vs(t,e,r,d[f],o+"/"+l+"/"+Mb(f),s,o,l,n,f);}else (l in Ht.keywords||t.allKeys&&!(l in Ht.skipKeywords))&&vs(t,e,r,d,o+"/"+l,s,o,l,n);}r(n,o,s,a,i,c,u);}}function Mb(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var eo=w(qe=>{Object.defineProperty(qe,"__esModule",{value:true});qe.getSchemaRefs=qe.resolveUrl=qe.normalizeId=qe._getFullPath=qe.getFullPath=qe.inlineRef=void 0;var qb=K(),Lb=Qi(),Ub=Jf(),Fb=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function Vb(t,e=true){return typeof t=="boolean"?true:e===true?!Xi(t):e?Hf(t)<=e:false}qe.inlineRef=Vb;var Jb=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Xi(t){for(let e in t){if(Jb.has(e))return true;let r=t[e];if(Array.isArray(r)&&r.some(Xi)||typeof r=="object"&&Xi(r))return true}return false}function Hf(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!Fb.has(r)&&(typeof t[r]=="object"&&(0, qb.eachItem)(t[r],n=>e+=Hf(n)),e===1/0))return 1/0}return e}function Gf(t,e="",r){r!==false&&(e=en(e));let n=t.parse(e);return Bf(t,n)}qe.getFullPath=Gf;function Bf(t,e){return t.serialize(e).split("#")[0]+"#"}qe._getFullPath=Bf;var Hb=/#\/?$/;function en(t){return t?t.replace(Hb,""):""}qe.normalizeId=en;function Gb(t,e,r){return r=en(r),t.resolve(e,r)}qe.resolveUrl=Gb;var Bb=/^[a-z_][-a-z0-9._]*$/i;function Kb(t,e){if(typeof t=="boolean")return {};let{schemaId:r,uriResolver:n}=this.opts,o=en(t[r]||e),s={"":o},a=Gf(n,o,false),i={},c=new Set;return Ub(t,{allKeys:true},(d,p,f,g)=>{if(g===void 0)return;let y=a+p,v=s[g];typeof d[r]=="string"&&(v=k.call(this,d[r])),S.call(this,d.$anchor),S.call(this,d.$dynamicAnchor),s[p]=v;function k(b){let R=this.opts.uriResolver.resolve;if(b=en(v?R(v,b):b),c.has(b))throw l(b);c.add(b);let C=this.refs[b];return typeof C=="string"&&(C=this.refs[C]),typeof C=="object"?u(d,C.schema,b):b!==en(y)&&(b[0]==="#"?(u(d,i[b],b),i[b]=d):this.refs[b]=y),b}function S(b){if(typeof b=="string"){if(!Bb.test(b))throw new Error(`invalid anchor "${b}"`);k.call(this,`#${b}`);}}}),i;function u(d,p,f){if(p!==void 0&&!Lb(d,p))throw l(f)}function l(d){return new Error(`reference "${d}" resolves to more than one schema`)}}qe.getSchemaRefs=Kb;});var no=w(Gt=>{Object.defineProperty(Gt,"__esModule",{value:true});Gt.getData=Gt.KeywordCxt=Gt.validateFunctionCode=void 0;var Xf=Pf(),Kf=Xn(),tc=Ji(),ks=Xn(),Wb=Nf(),ro=qf(),ec=Uf(),E=L(),N=Pt(),Yb=eo(),Et=K(),to=Qn();function Qb(t){if(rm(t)&&(nm(t),tm(t))){tw(t);return}em(t,()=>(0, Xf.topBoolOrEmptySchema)(t));}Gt.validateFunctionCode=Qb;function em({gen:t,validateName:e,schema:r,schemaEnv:n,opts:o},s){o.code.es5?t.func(e,(0, E._)`${N.default.data}, ${N.default.valCxt}`,n.$async,()=>{t.code((0, E._)`"use strict"; ${Wf(r,o)}`),ew(t,o),t.code(s);}):t.func(e,(0, E._)`${N.default.data}, ${Xb(o)}`,n.$async,()=>t.code(Wf(r,o)).code(s));}function Xb(t){return (0, E._)`{${N.default.instancePath}="", ${N.default.parentData}, ${N.default.parentDataProperty}, ${N.default.rootData}=${N.default.data}${t.dynamicRef?(0, E._)`, ${N.default.dynamicAnchors}={}`:E.nil}}={}`}function ew(t,e){t.if(N.default.valCxt,()=>{t.var(N.default.instancePath,(0, E._)`${N.default.valCxt}.${N.default.instancePath}`),t.var(N.default.parentData,(0, E._)`${N.default.valCxt}.${N.default.parentData}`),t.var(N.default.parentDataProperty,(0, E._)`${N.default.valCxt}.${N.default.parentDataProperty}`),t.var(N.default.rootData,(0, E._)`${N.default.valCxt}.${N.default.rootData}`),e.dynamicRef&&t.var(N.default.dynamicAnchors,(0, E._)`${N.default.valCxt}.${N.default.dynamicAnchors}`);},()=>{t.var(N.default.instancePath,(0, E._)`""`),t.var(N.default.parentData,(0, E._)`undefined`),t.var(N.default.parentDataProperty,(0, E._)`undefined`),t.var(N.default.rootData,N.default.data),e.dynamicRef&&t.var(N.default.dynamicAnchors,(0, E._)`{}`);});}function tw(t){let{schema:e,opts:r,gen:n}=t;em(t,()=>{r.$comment&&e.$comment&&sm(t),aw(t),n.let(N.default.vErrors,null),n.let(N.default.errors,0),r.unevaluated&&rw(t),om(t),uw(t);});}function rw(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0, E._)`${r}.evaluated`),e.if((0, E._)`${t.evaluated}.dynamicProps`,()=>e.assign((0, E._)`${t.evaluated}.props`,(0, E._)`undefined`)),e.if((0, E._)`${t.evaluated}.dynamicItems`,()=>e.assign((0, E._)`${t.evaluated}.items`,(0, E._)`undefined`));}function Wf(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0, E._)`/*# sourceURL=${r} */`:E.nil}function nw(t,e){if(rm(t)&&(nm(t),tm(t))){ow(t,e);return}(0, Xf.boolOrEmptySchema)(t,e);}function tm({schema:t,self:e}){if(typeof t=="boolean")return !t;for(let r in t)if(e.RULES.all[r])return true;return false}function rm(t){return typeof t.schema!="boolean"}function ow(t,e){let{schema:r,gen:n,opts:o}=t;o.$comment&&r.$comment&&sm(t),iw(t),cw(t);let s=n.const("_errs",N.default.errors);om(t,s),n.var(e,(0, E._)`${s} === ${N.default.errors}`);}function nm(t){(0, Et.checkUnknownRules)(t),sw(t);}function om(t,e){if(t.opts.jtd)return Yf(t,[],false,e);let r=(0, Kf.getSchemaTypes)(t.schema),n=(0, Kf.coerceAndCheckDataType)(t,r);Yf(t,r,!n,e);}function sw(t){let{schema:e,errSchemaPath:r,opts:n,self:o}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0, Et.schemaHasRulesButRef)(e,o.RULES)&&o.logger.warn(`$ref: keywords ignored in schema at path "${r}"`);}function aw(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0, Et.checkStrictMode)(t,"default is ignored in the schema root");}function iw(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0, Yb.resolveUrl)(t.opts.uriResolver,t.baseId,e));}function cw(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function sm({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:o}){let s=r.$comment;if(o.$comment===true)t.code((0, E._)`${N.default.self}.logger.log(${s})`);else if(typeof o.$comment=="function"){let a=(0, E.str)`${n}/$comment`,i=t.scopeValue("root",{ref:e.root});t.code((0, E._)`${N.default.self}.opts.$comment(${s}, ${a}, ${i}.schema)`);}}function uw(t){let{gen:e,schemaEnv:r,validateName:n,ValidationError:o,opts:s}=t;r.$async?e.if((0, E._)`${N.default.errors} === 0`,()=>e.return(N.default.data),()=>e.throw((0, E._)`new ${o}(${N.default.vErrors})`)):(e.assign((0, E._)`${n}.errors`,N.default.vErrors),s.unevaluated&&lw(t),e.return((0, E._)`${N.default.errors} === 0`));}function lw({gen:t,evaluated:e,props:r,items:n}){r instanceof E.Name&&t.assign((0, E._)`${e}.props`,r),n instanceof E.Name&&t.assign((0, E._)`${e}.items`,n);}function Yf(t,e,r,n){let{gen:o,schema:s,data:a,allErrors:i,opts:c,self:u}=t,{RULES:l}=u;if(s.$ref&&(c.ignoreKeywordsWithRef||!(0, Et.schemaHasRulesButRef)(s,l))){o.block(()=>im(t,"$ref",l.all.$ref.definition));return}c.jtd||dw(t,e),o.block(()=>{for(let p of l.rules)d(p);d(l.post);});function d(p){(0, tc.shouldUseGroup)(s,p)&&(p.type?(o.if((0, ks.checkDataType)(p.type,a,c.strictNumbers)),Qf(t,p),e.length===1&&e[0]===p.type&&r&&(o.else(),(0, ks.reportTypeError)(t)),o.endIf()):Qf(t,p),i||o.if((0, E._)`${N.default.errors} === ${n||0}`));}}function Qf(t,e){let{gen:r,schema:n,opts:{useDefaults:o}}=t;o&&(0, Wb.assignDefaults)(t,e.type),r.block(()=>{for(let s of e.rules)(0, tc.shouldUseRule)(n,s)&&im(t,s.keyword,s.definition,e.type);});}function dw(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(pw(t,e),t.opts.allowUnionTypes||fw(t,e),mw(t,t.dataTypes));}function pw(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{am(t.dataTypes,r)||rc(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`);}),gw(t,e);}}function fw(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&rc(t,"use allowUnionTypes to allow union type keyword");}function mw(t,e){let r=t.self.RULES.all;for(let n in r){let o=r[n];if(typeof o=="object"&&(0, tc.shouldUseRule)(t.schema,o)){let{type:s}=o.definition;s.length&&!s.some(a=>hw(e,a))&&rc(t,`missing type "${s.join(",")}" for keyword "${n}"`);}}}function hw(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function am(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function gw(t,e){let r=[];for(let n of t.dataTypes)am(e,n)?r.push(n):e.includes("integer")&&n==="number"&&r.push("integer");t.dataTypes=r;}function rc(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0, Et.checkStrictMode)(t,e,t.opts.strictTypes);}var xs=class{constructor(e,r,n){if((0, ro.validateKeywordUsage)(e,r,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=r.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0, Et.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=r,this.$data)this.schemaCode=e.gen.const("vSchema",cm(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0, ro.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!==false)&&(this.errsCount=e.gen.const("_errs",N.default.errors));}result(e,r,n){this.failResult((0, E.not)(e),r,n);}failResult(e,r,n){this.gen.if(e),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else();}pass(e,r){this.failResult((0, E.not)(e),void 0,r);}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(false);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else();}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:r}=this;this.fail((0, E._)`${r} !== undefined && (${(0, E.or)(this.invalid$data(),e)})`);}error(e,r,n){if(r){this.setParams(r),this._error(e,n),this.setParams({});return}this._error(e,n);}_error(e,r){(e?to.reportExtraError:to.reportError)(this,this.def.error,r);}$dataError(){(0, to.reportError)(this,this.def.$dataError||to.keyword$DataError);}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0, to.resetErrorsCount)(this.gen,this.errsCount);}ok(e){this.allErrors||this.gen.if(e);}setParams(e,r){r?Object.assign(this.params,e):this.params=e;}block$data(e,r,n=E.nil){this.gen.block(()=>{this.check$data(e,n),r();});}check$data(e=E.nil,r=E.nil){if(!this.$data)return;let{gen:n,schemaCode:o,schemaType:s,def:a}=this;n.if((0, E.or)((0, E._)`${o} === undefined`,r)),e!==E.nil&&n.assign(e,true),(s.length||a.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==E.nil&&n.assign(e,false)),n.else();}invalid$data(){let{gen:e,schemaCode:r,schemaType:n,def:o,it:s}=this;return (0, E.or)(a(),i());function a(){if(n.length){if(!(r instanceof E.Name))throw new Error("ajv implementation error");let c=Array.isArray(n)?n:[n];return (0, E._)`${(0, ks.checkDataTypes)(c,r,s.opts.strictNumbers,ks.DataType.Wrong)}`}return E.nil}function i(){if(o.validateSchema){let c=e.scopeValue("validate$data",{ref:o.validateSchema});return (0, E._)`!${c}(${r})`}return E.nil}}subschema(e,r){let n=(0, ec.getSubschema)(this.it,e);(0, ec.extendSubschemaData)(n,this.it,e),(0, ec.extendSubschemaMode)(n,e);let o={...this.it,...n,items:void 0,props:void 0};return nw(o,r),o}mergeEvaluated(e,r){let{it:n,gen:o}=this;n.opts.unevaluated&&(n.props!==true&&e.props!==void 0&&(n.props=Et.mergeEvaluated.props(o,e.props,n.props,r)),n.items!==true&&e.items!==void 0&&(n.items=Et.mergeEvaluated.items(o,e.items,n.items,r)));}mergeValidEvaluated(e,r){let{it:n,gen:o}=this;if(n.opts.unevaluated&&(n.props!==true||n.items!==true))return o.if(r,()=>this.mergeEvaluated(e,E.Name)),true}};Gt.KeywordCxt=xs;function im(t,e,r,n){let o=new xs(t,r,e);"code"in r?r.code(o,n):o.$data&&r.validate?(0, ro.funcKeywordCode)(o,r):"macro"in r?(0, ro.macroKeywordCode)(o,r):(r.compile||r.validate)&&(0, ro.funcKeywordCode)(o,r);}var yw=/^\/(?:[^~]|~0|~1)*$/,_w=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function cm(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let o,s;if(t==="")return N.default.rootData;if(t[0]==="/"){if(!yw.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);o=t,s=N.default.rootData;}else {let u=_w.exec(t);if(!u)throw new Error(`Invalid JSON-pointer: ${t}`);let l=+u[1];if(o=u[2],o==="#"){if(l>=e)throw new Error(c("property/index",l));return n[e-l]}if(l>e)throw new Error(c("data",l));if(s=r[e-l],!o)return s}let a=s,i=o.split("/");for(let u of i)u&&(s=(0, E._)`${s}${(0, E.getProperty)((0, Et.unescapeJsonPointer)(u))}`,a=(0, E._)`${a} && ${s}`);return a;function c(u,l){return `Cannot access ${u} ${l} levels up, current level is ${e}`}}Gt.getData=cm;});var bs=w(oc=>{Object.defineProperty(oc,"__esModule",{value:true});var nc=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=true;}};oc.default=nc;});var oo=w(ic=>{Object.defineProperty(ic,"__esModule",{value:true});var sc=eo(),ac=class extends Error{constructor(e,r,n,o){super(o||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0, sc.resolveUrl)(e,r,n),this.missingSchema=(0, sc.normalizeId)((0, sc.getFullPath)(e,this.missingRef));}};ic.default=ac;});var $s=w(Qe=>{Object.defineProperty(Qe,"__esModule",{value:true});Qe.resolveSchema=Qe.getCompilingSchema=Qe.resolveRef=Qe.compileSchema=Qe.SchemaEnv=void 0;var nt=L(),vw=bs(),wr=Pt(),ot=eo(),um=K(),kw=no(),tn=class{constructor(e){var r;this.refs={},this.dynamicAnchors={};let n;typeof e.schema=="object"&&(n=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(r=e.baseId)!==null&&r!==void 0?r:(0, ot.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={};}};Qe.SchemaEnv=tn;function uc(t){let e=lm.call(this,t);if(e)return e;let r=(0, ot.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:n,lines:o}=this.opts.code,{ownProperties:s}=this.opts,a=new nt.CodeGen(this.scope,{es5:n,lines:o,ownProperties:s}),i;t.$async&&(i=a.scopeValue("Error",{ref:vw.default,code:(0, nt._)`require("ajv/dist/runtime/validation_error").default`}));let c=a.scopeName("validate");t.validateName=c;let u={gen:a,allErrors:this.opts.allErrors,data:wr.default.data,parentData:wr.default.parentData,parentDataProperty:wr.default.parentDataProperty,dataNames:[wr.default.data],dataPathArr:[nt.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:a.scopeValue("schema",this.opts.code.source===true?{ref:t.schema,code:(0, nt.stringify)(t.schema)}:{ref:t.schema}),validateName:c,ValidationError:i,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:nt.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0, nt._)`""`,opts:this.opts,self:this},l;try{this._compilations.add(t),(0,kw.validateFunctionCode)(u),a.optimize(this.opts.code.optimize);let d=a.toString();l=`${a.scopeRefs(wr.default.scope)}return ${d}`,this.opts.code.process&&(l=this.opts.code.process(l,t));let f=new Function(`${wr.default.self}`,`${wr.default.scope}`,l)(this,this.scope.get());if(this.scope.value(c,{ref:f}),f.errors=null,f.schema=t.schema,f.schemaEnv=t,t.$async&&(f.$async=!0),this.opts.code.source===!0&&(f.source={validateName:c,validateCode:d,scopeValues:a._values}),this.opts.unevaluated){let{props:g,items:y}=u;f.evaluated={props:g instanceof nt.Name?void 0:g,items:y instanceof nt.Name?void 0:y,dynamicProps:g instanceof nt.Name,dynamicItems:y instanceof nt.Name},f.source&&(f.source.evaluated=(0,nt.stringify)(f.evaluated));}return t.validate=f,t}catch(d){throw delete t.validate,delete t.validateName,l&&this.logger.error("Error compiling schema, function code:",l),d}finally{this._compilations.delete(t);}}Qe.compileSchema=uc;function xw(t,e,r){var n;r=(0, ot.resolveUrl)(this.opts.uriResolver,e,r);let o=t.refs[r];if(o)return o;let s=$w.call(this,t,r);if(s===void 0){let a=(n=t.localRefs)===null||n===void 0?void 0:n[r],{schemaId:i}=this.opts;a&&(s=new tn({schema:a,schemaId:i,root:t,baseId:e}));}if(s!==void 0)return t.refs[r]=bw.call(this,s)}Qe.resolveRef=xw;function bw(t){return (0, ot.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:uc.call(this,t)}function lm(t){for(let e of this._compilations)if(ww(e,t))return e}Qe.getCompilingSchema=lm;function ww(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function $w(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||ws.call(this,t,e)}function ws(t,e){let r=this.opts.uriResolver.parse(e),n=(0, ot._getFullPath)(this.opts.uriResolver,r),o=(0, ot.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===o)return cc.call(this,r,t);let s=(0, ot.normalizeId)(n),a=this.refs[s]||this.schemas[s];if(typeof a=="string"){let i=ws.call(this,t,a);return typeof i?.schema!="object"?void 0:cc.call(this,r,i)}if(typeof a?.schema=="object"){if(a.validate||uc.call(this,a),s===(0, ot.normalizeId)(e)){let{schema:i}=a,{schemaId:c}=this.opts,u=i[c];return u&&(o=(0, ot.resolveUrl)(this.opts.uriResolver,o,u)),new tn({schema:i,schemaId:c,root:t,baseId:o})}return cc.call(this,r,a)}}Qe.resolveSchema=ws;var Sw=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function cc(t,{baseId:e,schema:r,root:n}){var o;if(((o=t.fragment)===null||o===void 0?void 0:o[0])!=="/")return;for(let i of t.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let c=r[(0, um.unescapeFragment)(i)];if(c===void 0)return;r=c;let u=typeof r=="object"&&r[this.opts.schemaId];!Sw.has(i)&&u&&(e=(0, ot.resolveUrl)(this.opts.uriResolver,e,u));}let s;if(typeof r!="boolean"&&r.$ref&&!(0, um.schemaHasRulesButRef)(r,this.RULES)){let i=(0, ot.resolveUrl)(this.opts.uriResolver,e,r.$ref);s=ws.call(this,n,i);}let{schemaId:a}=this.opts;if(s=s||new tn({schema:r,schemaId:a,root:n,baseId:e}),s.schema!==s.root.schema)return s}});var dm=w((zC,zw)=>{zw.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:false};});var dc=w((TC,hm)=>{var Tw=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),fm=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 lc(t){let e="",r=0,n=0;for(n=0;n<t.length;n++)if(r=t[n].charCodeAt(0),r!==48){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return "";e+=t[n];break}for(n+=1;n<t.length;n++){if(r=t[n].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return "";e+=t[n];}return e}var Pw=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function pm(t){return t.length=0,true}function Ew(t,e,r){if(t.length){let n=lc(t);if(n!=="")e.push(n);else return r.error=true,false;t.length=0;}return true}function Rw(t){let e=0,r={error:false,address:"",zone:""},n=[],o=[],s=false,a=false,i=Ew;for(let c=0;c<t.length;c++){let u=t[c];if(!(u==="["||u==="]"))if(u===":"){if(s===true&&(a=true),!i(o,n,r))break;if(++e>7){r.error=true;break}c>0&&t[c-1]===":"&&(s=true),n.push(":");continue}else if(u==="%"){if(!i(o,n,r))break;i=pm;}else {o.push(u);continue}}return o.length&&(i===pm?r.zone=o.join(""):a?n.push(o.join("")):n.push(lc(o))),r.address=n.join(""),r}function mm(t){if(Iw(t,":")<2)return {host:t,isIPV6:false};let e=Rw(t);if(e.error)return {host:t,isIPV6:false};{let r=e.address,n=e.address;return e.zone&&(r+="%"+e.zone,n+="%25"+e.zone),{host:r,isIPV6:true,escapedHost:n}}}function Iw(t,e){let r=0;for(let n=0;n<t.length;n++)t[n]===e&&r++;return r}function jw(t){let e=t,r=[],n=-1,o=0;for(;o=e.length;){if(o===1){if(e===".")break;if(e==="/"){r.push("/");break}else {r.push(e);break}}else if(o===2){if(e[0]==="."){if(e[1]===".")break;if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&(e[1]==="."||e[1]==="/")){r.push("/");break}}else if(o===3&&e==="/.."){r.length!==0&&r.pop(),r.push("/");break}if(e[0]==="."){if(e[1]==="."){if(e[2]==="/"){e=e.slice(3);continue}}else if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&e[1]==="."){if(e[2]==="/"){e=e.slice(2);continue}else if(e[2]==="."&&e[3]==="/"){e=e.slice(3),r.length!==0&&r.pop();continue}}if((n=e.indexOf("/",1))===-1){r.push(e);break}else r.push(e.slice(0,n)),e=e.slice(n);}return r.join("")}function Cw(t,e){let r=e!==true?escape:unescape;return t.scheme!==void 0&&(t.scheme=r(t.scheme)),t.userinfo!==void 0&&(t.userinfo=r(t.userinfo)),t.host!==void 0&&(t.host=r(t.host)),t.path!==void 0&&(t.path=r(t.path)),t.query!==void 0&&(t.query=r(t.query)),t.fragment!==void 0&&(t.fragment=r(t.fragment)),t}function Ow(t){let e=[];if(t.userinfo!==void 0&&(e.push(t.userinfo),e.push("@")),t.host!==void 0){let r=unescape(t.host);if(!fm(r)){let n=mm(r);n.isIPV6===true?r=`[${n.escapedHost}]`:r=t.host;}e.push(r);}return (typeof t.port=="number"||typeof t.port=="string")&&(e.push(":"),e.push(String(t.port))),e.length?e.join(""):void 0}hm.exports={nonSimpleDomain:Pw,recomposeAuthority:Ow,normalizeComponentEncoding:Cw,removeDotSegments:jw,isIPv4:fm,isUUID:Tw,normalizeIPv6:mm,stringArrayToHexStripped:lc};});var km=w((PC,vm)=>{var{isUUID:Nw}=dc(),Aw=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,Zw=["http","https","ws","wss","urn","urn:uuid"];function Dw(t){return Zw.indexOf(t)!==-1}function pc(t){return t.secure===true?true:t.secure===false?false:t.scheme?t.scheme.length===3&&(t.scheme[0]==="w"||t.scheme[0]==="W")&&(t.scheme[1]==="s"||t.scheme[1]==="S")&&(t.scheme[2]==="s"||t.scheme[2]==="S"):false}function gm(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function ym(t){let e=String(t.scheme).toLowerCase()==="https";return (t.port===(e?443:80)||t.port==="")&&(t.port=void 0),t.path||(t.path="/"),t}function Mw(t){return t.secure=pc(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function qw(t){if((t.port===(pc(t)?443:80)||t.port==="")&&(t.port=void 0),typeof t.secure=="boolean"&&(t.scheme=t.secure?"wss":"ws",t.secure=void 0),t.resourceName){let[e,r]=t.resourceName.split("?");t.path=e&&e!=="/"?e:void 0,t.query=r,t.resourceName=void 0;}return t.fragment=void 0,t}function Lw(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(Aw);if(r){let n=e.scheme||t.scheme||"urn";t.nid=r[1].toLowerCase(),t.nss=r[2];let o=`${n}:${e.nid||t.nid}`,s=fc(o);t.path=void 0,s&&(t=s.parse(t,e));}else t.error=t.error||"URN can not be parsed.";return t}function Uw(t,e){if(t.nid===void 0)throw new Error("URN without nid cannot be serialized");let r=e.scheme||t.scheme||"urn",n=t.nid.toLowerCase(),o=`${r}:${e.nid||n}`,s=fc(o);s&&(t=s.serialize(t,e));let a=t,i=t.nss;return a.path=`${n||e.nid}:${i}`,e.skipEscape=true,a}function Fw(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!Nw(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function Vw(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var _m={scheme:"http",domainHost:true,parse:gm,serialize:ym},Jw={scheme:"https",domainHost:_m.domainHost,parse:gm,serialize:ym},Ss={scheme:"ws",domainHost:true,parse:Mw,serialize:qw},Hw={scheme:"wss",domainHost:Ss.domainHost,parse:Ss.parse,serialize:Ss.serialize},Gw={scheme:"urn",parse:Lw,serialize:Uw,skipNormalize:true},Bw={scheme:"urn:uuid",parse:Fw,serialize:Vw,skipNormalize:true},zs={http:_m,https:Jw,ws:Ss,wss:Hw,urn:Gw,"urn:uuid":Bw};Object.setPrototypeOf(zs,null);function fc(t){return t&&(zs[t]||zs[t.toLowerCase()])||void 0}vm.exports={wsIsSecure:pc,SCHEMES:zs,isValidSchemeName:Dw,getSchemeHandler:fc};});var wm=w((EC,Ps)=>{var{normalizeIPv6:Kw,removeDotSegments:so,recomposeAuthority:Ww,normalizeComponentEncoding:Ts,isIPv4:Yw,nonSimpleDomain:Qw}=dc(),{SCHEMES:Xw,getSchemeHandler:xm}=km();function e0(t,e){return typeof t=="string"?t=gt(Rt(t,e),e):typeof t=="object"&&(t=Rt(gt(t,e),e)),t}function t0(t,e,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},o=bm(Rt(t,n),Rt(e,n),n,true);return n.skipEscape=true,gt(o,n)}function bm(t,e,r,n){let o={};return n||(t=Rt(gt(t,r),r),e=Rt(gt(e,r),r)),r=r||{},!r.tolerant&&e.scheme?(o.scheme=e.scheme,o.userinfo=e.userinfo,o.host=e.host,o.port=e.port,o.path=so(e.path||""),o.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(o.userinfo=e.userinfo,o.host=e.host,o.port=e.port,o.path=so(e.path||""),o.query=e.query):(e.path?(e.path[0]==="/"?o.path=so(e.path):((t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)&&!t.path?o.path="/"+e.path:t.path?o.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+e.path:o.path=e.path,o.path=so(o.path)),o.query=e.query):(o.path=t.path,e.query!==void 0?o.query=e.query:o.query=t.query),o.userinfo=t.userinfo,o.host=t.host,o.port=t.port),o.scheme=t.scheme),o.fragment=e.fragment,o}function r0(t,e,r){return typeof t=="string"?(t=unescape(t),t=gt(Ts(Rt(t,r),true),{...r,skipEscape:true})):typeof t=="object"&&(t=gt(Ts(t,true),{...r,skipEscape:true})),typeof e=="string"?(e=unescape(e),e=gt(Ts(Rt(e,r),true),{...r,skipEscape:true})):typeof e=="object"&&(e=gt(Ts(e,true),{...r,skipEscape:true})),t.toLowerCase()===e.toLowerCase()}function gt(t,e){let r={host:t.host,scheme:t.scheme,userinfo:t.userinfo,port:t.port,path:t.path,query:t.query,nid:t.nid,nss:t.nss,uuid:t.uuid,fragment:t.fragment,reference:t.reference,resourceName:t.resourceName,secure:t.secure,error:""},n=Object.assign({},e),o=[],s=xm(n.scheme||r.scheme);s&&s.serialize&&s.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=unescape(r.path):(r.path=escape(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&o.push(r.scheme,":");let a=Ww(r);if(a!==void 0&&(n.reference!=="suffix"&&o.push("//"),o.push(a),r.path&&r.path[0]!=="/"&&o.push("/")),r.path!==void 0){let i=r.path;!n.absolutePath&&(!s||!s.absolutePath)&&(i=so(i)),a===void 0&&i[0]==="/"&&i[1]==="/"&&(i="/%2F"+i.slice(2)),o.push(i);}return r.query!==void 0&&o.push("?",r.query),r.fragment!==void 0&&o.push("#",r.fragment),o.join("")}var n0=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function Rt(t,e){let r=Object.assign({},e),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},o=false;r.reference==="suffix"&&(r.scheme?t=r.scheme+":"+t:t="//"+t);let s=t.match(n0);if(s){if(n.scheme=s[1],n.userinfo=s[3],n.host=s[4],n.port=parseInt(s[5],10),n.path=s[6]||"",n.query=s[7],n.fragment=s[8],isNaN(n.port)&&(n.port=s[5]),n.host)if(Yw(n.host)===false){let c=Kw(n.host);n.host=c.host.toLowerCase(),o=c.isIPV6;}else o=true;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=xm(r.scheme||n.scheme);if(!r.unicodeSupport&&(!a||!a.unicodeSupport)&&n.host&&(r.domainHost||a&&a.domainHost)&&o===false&&Qw(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase());}catch(i){n.error=n.error||"Host's domain name can not be converted to ASCII: "+i;}(!a||a&&!a.skipNormalize)&&(t.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=unescape(n.host))),n.path&&(n.path=escape(unescape(n.path))),n.fragment&&(n.fragment=encodeURI(decodeURIComponent(n.fragment)))),a&&a.parse&&a.parse(n,r);}else n.error=n.error||"URI can not be parsed.";return n}var mc={SCHEMES:Xw,normalize:e0,resolve:t0,resolveComponent:bm,equal:r0,serialize:gt,parse:Rt};Ps.exports=mc;Ps.exports.default=mc;Ps.exports.fastUri=mc;});var Sm=w(hc=>{Object.defineProperty(hc,"__esModule",{value:true});var $m=wm();$m.code='require("ajv/dist/runtime/uri").default';hc.default=$m;});var Cm=w(xe=>{Object.defineProperty(xe,"__esModule",{value:true});xe.CodeGen=xe.Name=xe.nil=xe.stringify=xe.str=xe._=xe.KeywordCxt=void 0;var o0=no();Object.defineProperty(xe,"KeywordCxt",{enumerable:true,get:function(){return o0.KeywordCxt}});var rn=L();Object.defineProperty(xe,"_",{enumerable:true,get:function(){return rn._}});Object.defineProperty(xe,"str",{enumerable:true,get:function(){return rn.str}});Object.defineProperty(xe,"stringify",{enumerable:true,get:function(){return rn.stringify}});Object.defineProperty(xe,"nil",{enumerable:true,get:function(){return rn.nil}});Object.defineProperty(xe,"Name",{enumerable:true,get:function(){return rn.Name}});Object.defineProperty(xe,"CodeGen",{enumerable:true,get:function(){return rn.CodeGen}});var s0=bs(),Rm=oo(),a0=Vi(),ao=$s(),i0=L(),io=eo(),Es=Xn(),yc=K(),zm=dm(),c0=Sm(),Im=(t,e)=>new RegExp(t,e);Im.code="new RegExp";var u0=["removeAdditional","useDefaults","coerceTypes"],l0=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),d0={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."},p0={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},Tm=200;function f0(t){var e,r,n,o,s,a,i,c,u,l,d,p,f,g,y,v,k,S,b,R,C,Ie,Fe,Ir,ua;let hn=t.strict,la=(e=t.code)===null||e===void 0?void 0:e.optimize,Ru=la===true||la===void 0?1:la||0,Iu=(n=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:Im,Vg=(o=t.uriResolver)!==null&&o!==void 0?o:c0.default;return {strictSchema:(a=(s=t.strictSchema)!==null&&s!==void 0?s:hn)!==null&&a!==void 0?a:true,strictNumbers:(c=(i=t.strictNumbers)!==null&&i!==void 0?i:hn)!==null&&c!==void 0?c:true,strictTypes:(l=(u=t.strictTypes)!==null&&u!==void 0?u:hn)!==null&&l!==void 0?l:"log",strictTuples:(p=(d=t.strictTuples)!==null&&d!==void 0?d:hn)!==null&&p!==void 0?p:"log",strictRequired:(g=(f=t.strictRequired)!==null&&f!==void 0?f:hn)!==null&&g!==void 0?g:false,code:t.code?{...t.code,optimize:Ru,regExp:Iu}:{optimize:Ru,regExp:Iu},loopRequired:(y=t.loopRequired)!==null&&y!==void 0?y:Tm,loopEnum:(v=t.loopEnum)!==null&&v!==void 0?v:Tm,meta:(k=t.meta)!==null&&k!==void 0?k:true,messages:(S=t.messages)!==null&&S!==void 0?S:true,inlineRefs:(b=t.inlineRefs)!==null&&b!==void 0?b:true,schemaId:(R=t.schemaId)!==null&&R!==void 0?R:"$id",addUsedSchema:(C=t.addUsedSchema)!==null&&C!==void 0?C:true,validateSchema:(Ie=t.validateSchema)!==null&&Ie!==void 0?Ie:true,validateFormats:(Fe=t.validateFormats)!==null&&Fe!==void 0?Fe:true,unicodeRegExp:(Ir=t.unicodeRegExp)!==null&&Ir!==void 0?Ir:true,int32range:(ua=t.int32range)!==null&&ua!==void 0?ua:true,uriResolver:Vg}}var co=class{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...f0(e)};let{es5:r,lines:n}=this.opts.code;this.scope=new i0.ValueScope({scope:{},prefixes:l0,es5:r,lines:n}),this.logger=v0(e.logger);let o=e.validateFormats;e.validateFormats=false,this.RULES=(0, a0.getRules)(),Pm.call(this,d0,e,"NOT SUPPORTED"),Pm.call(this,p0,e,"DEPRECATED","warn"),this._metaOpts=y0.call(this),e.formats&&h0.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&g0.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),m0.call(this),e.validateFormats=o;}_addVocabularies(){this.addKeyword("$async");}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:n}=this.opts,o=zm;n==="id"&&(o={...zm},o.id=o.$id,delete o.$id),r&&e&&this.addMetaSchema(o,o[n],false);}defaultMeta(){let{meta:e,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[r]||e:void 0}validate(e,r){let n;if(typeof e=="string"){if(n=this.getSchema(e),!n)throw new Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);let o=n(r);return "$async"in n||(this.errors=n.errors),o}compile(e,r){let n=this._addSchema(e,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return o.call(this,e,r);async function o(l,d){await s.call(this,l.$schema);let p=this._addSchema(l,d);return p.validate||a.call(this,p)}async function s(l){l&&!this.getSchema(l)&&await o.call(this,{$ref:l},true);}async function a(l){try{return this._compileSchemaEnv(l)}catch(d){if(!(d instanceof Rm.default))throw d;return i.call(this,d),await c.call(this,d.missingSchema),a.call(this,l)}}function i({missingSchema:l,missingRef:d}){if(this.refs[l])throw new Error(`AnySchema ${l} is loaded but ${d} cannot be resolved`)}async function c(l){let d=await u.call(this,l);this.refs[l]||await s.call(this,d.$schema),this.refs[l]||this.addSchema(d,l,r);}async function u(l){let d=this._loading[l];if(d)return d;try{return await(this._loading[l]=n(l))}finally{delete this._loading[l];}}}addSchema(e,r,n,o=this.opts.validateSchema){if(Array.isArray(e)){for(let a of e)this.addSchema(a,void 0,n,o);return this}let s;if(typeof e=="object"){let{schemaId:a}=this.opts;if(s=e[a],s!==void 0&&typeof s!="string")throw new Error(`schema ${a} must be string`)}return r=(0, io.normalizeId)(r||s),this._checkUnique(r),this.schemas[r]=this._addSchema(e,n,r,o,true),this}addMetaSchema(e,r,n=this.opts.validateSchema){return this.addSchema(e,r,true,n),this}validateSchema(e,r){if(typeof e=="boolean")return true;let n;if(n=e.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,true;let o=this.validate(n,e);if(!o&&r){let s="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(s);else throw new Error(s)}return o}getSchema(e){let r;for(;typeof(r=Em.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:n}=this.opts,o=new ao.SchemaEnv({schema:{},schemaId:n});if(r=ao.resolveSchema.call(this,o,e),!r)return;this.refs[e]=r;}return r.validate||this._compileSchemaEnv(r)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case "undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case "string":{let r=Em.call(this,e);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[e],delete this.refs[e],this}case "object":{let r=e;this._cache.delete(r);let n=e[this.opts.schemaId];return n&&(n=(0, io.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let r of e)this.addKeyword(r);return this}addKeyword(e,r){let n;if(typeof e=="string")n=e,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof e=="object"&&r===void 0){if(r=e,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(x0.call(this,n,r),!r)return (0, yc.eachItem)(n,s=>gc.call(this,s)),this;w0.call(this,r);let o={...r,type:(0, Es.getJSONTypes)(r.type),schemaType:(0, Es.getJSONTypes)(r.schemaType)};return (0, yc.eachItem)(n,o.type.length===0?s=>gc.call(this,s,o):s=>o.type.forEach(a=>gc.call(this,s,o,a))),this}getKeyword(e){let r=this.RULES.all[e];return typeof r=="object"?r.definition:!!r}removeKeyword(e){let{RULES:r}=this;delete r.keywords[e],delete r.all[e];for(let n of r.rules){let o=n.rules.findIndex(s=>s.keyword===e);o>=0&&n.rules.splice(o,1);}return this}addFormat(e,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[e]=r,this}errorsText(e=this.errors,{separator:r=", ",dataVar:n="data"}={}){return !e||e.length===0?"No errors":e.map(o=>`${n}${o.instancePath} ${o.message}`).reduce((o,s)=>o+r+s)}$dataMetaSchema(e,r){let n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let o of r){let s=o.split("/").slice(1),a=e;for(let i of s)a=a[i];for(let i in n){let c=n[i];if(typeof c!="object")continue;let{$data:u}=c.definition,l=a[i];u&&l&&(a[i]=jm(l));}}return e}_removeAllSchemas(e,r){for(let n in e){let o=e[n];(!r||r.test(n))&&(typeof o=="string"?delete e[n]:o&&!o.meta&&(this._cache.delete(o.schema),delete e[n]));}}_addSchema(e,r,n,o=this.opts.validateSchema,s=this.opts.addUsedSchema){let a,{schemaId:i}=this.opts;if(typeof e=="object")a=e[i];else {if(this.opts.jtd)throw new Error("schema must be object");if(typeof e!="boolean")throw new Error("schema must be object or boolean")}let c=this._cache.get(e);if(c!==void 0)return c;n=(0, io.normalizeId)(a||n);let u=io.getSchemaRefs.call(this,e,n);return c=new ao.SchemaEnv({schema:e,schemaId:i,meta:r,baseId:n,localRefs:u}),this._cache.set(c.schema,c),s&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=c),o&&this.validateSchema(e,true),c}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):ao.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let r=this.opts;this.opts=this._metaOpts;try{ao.compileSchema.call(this,e);}finally{this.opts=r;}}};co.ValidationError=s0.default;co.MissingRefError=Rm.default;xe.default=co;function Pm(t,e,r,n="error"){for(let o in t){let s=o;s in e&&this.logger[n](`${r}: option ${o}. ${t[s]}`);}}function Em(t){return t=(0, io.normalizeId)(t),this.schemas[t]||this.refs[t]}function m0(){let t=this.opts.schemas;if(t)if(Array.isArray(t))this.addSchema(t);else for(let e in t)this.addSchema(t[e],e);}function h0(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e);}}function g0(t){if(Array.isArray(t)){this.addVocabulary(t);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in t){let r=t[e];r.keyword||(r.keyword=e),this.addKeyword(r);}}function y0(){let t={...this.opts};for(let e of u0)delete t[e];return t}var _0={log(){},warn(){},error(){}};function v0(t){if(t===false)return _0;if(t===void 0)return console;if(t.log&&t.warn&&t.error)return t;throw new Error("logger must implement log, warn and error methods")}var k0=/^[a-z_$][a-z0-9_$:-]*$/i;function x0(t,e){let{RULES:r}=this;if((0, yc.eachItem)(t,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!k0.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function gc(t,e,r){var n;let o=e?.post;if(r&&o)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:s}=this,a=o?s.post:s.rules.find(({type:c})=>c===r);if(a||(a={type:r,rules:[]},s.rules.push(a)),s.keywords[t]=true,!e)return;let i={keyword:t,definition:{...e,type:(0, Es.getJSONTypes)(e.type),schemaType:(0, Es.getJSONTypes)(e.schemaType)}};e.before?b0.call(this,a,i,e.before):a.rules.push(i),s.all[t]=i,(n=e.implements)===null||n===void 0||n.forEach(c=>this.addKeyword(c));}function b0(t,e,r){let n=t.rules.findIndex(o=>o.keyword===r);n>=0?t.rules.splice(n,0,e):(t.rules.push(e),this.logger.warn(`rule ${r} is not defined`));}function w0(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=jm(e)),t.validateSchema=this.compile(e,true));}var $0={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function jm(t){return {anyOf:[t,$0]}}});var Om=w(_c=>{Object.defineProperty(_c,"__esModule",{value:true});var S0={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};_c.default=S0;});var Dm=w($r=>{Object.defineProperty($r,"__esModule",{value:true});$r.callRef=$r.getValidate=void 0;var z0=oo(),Nm=Ye(),Le=L(),nn=Pt(),Am=$s(),Rs=K(),T0={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:r,it:n}=t,{baseId:o,schemaEnv:s,validateName:a,opts:i,self:c}=n,{root:u}=s;if((r==="#"||r==="#/")&&o===u.baseId)return d();let l=Am.resolveRef.call(c,u,o,r);if(l===void 0)throw new z0.default(n.opts.uriResolver,o,r);if(l instanceof Am.SchemaEnv)return p(l);return f(l);function d(){if(s===u)return Is(t,a,s,s.$async);let g=e.scopeValue("root",{ref:u});return Is(t,(0, Le._)`${g}.validate`,u,u.$async)}function p(g){let y=Zm(t,g);Is(t,y,g,g.$async);}function f(g){let y=e.scopeValue("schema",i.code.source===true?{ref:g,code:(0, Le.stringify)(g)}:{ref:g}),v=e.name("valid"),k=t.subschema({schema:g,dataTypes:[],schemaPath:Le.nil,topSchemaRef:y,errSchemaPath:r},v);t.mergeEvaluated(k),t.ok(v);}}};function Zm(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0, Le._)`${r.scopeValue("wrapper",{ref:e})}.validate`}$r.getValidate=Zm;function Is(t,e,r,n){let{gen:o,it:s}=t,{allErrors:a,schemaEnv:i,opts:c}=s,u=c.passContext?nn.default.this:Le.nil;n?l():d();function l(){if(!i.$async)throw new Error("async schema referenced by sync schema");let g=o.let("valid");o.try(()=>{o.code((0, Le._)`await ${(0, Nm.callValidateCode)(t,e,u)}`),f(e),a||o.assign(g,true);},y=>{o.if((0, Le._)`!(${y} instanceof ${s.ValidationError})`,()=>o.throw(y)),p(y),a||o.assign(g,false);}),t.ok(g);}function d(){t.result((0, Nm.callValidateCode)(t,e,u),()=>f(e),()=>p(e));}function p(g){let y=(0, Le._)`${g}.errors`;o.assign(nn.default.vErrors,(0, Le._)`${nn.default.vErrors} === null ? ${y} : ${nn.default.vErrors}.concat(${y})`),o.assign(nn.default.errors,(0, Le._)`${nn.default.vErrors}.length`);}function f(g){var y;if(!s.opts.unevaluated)return;let v=(y=r?.validate)===null||y===void 0?void 0:y.evaluated;if(s.props!==true)if(v&&!v.dynamicProps)v.props!==void 0&&(s.props=Rs.mergeEvaluated.props(o,v.props,s.props));else {let k=o.var("props",(0, Le._)`${g}.evaluated.props`);s.props=Rs.mergeEvaluated.props(o,k,s.props,Le.Name);}if(s.items!==true)if(v&&!v.dynamicItems)v.items!==void 0&&(s.items=Rs.mergeEvaluated.items(o,v.items,s.items));else {let k=o.var("items",(0, Le._)`${g}.evaluated.items`);s.items=Rs.mergeEvaluated.items(o,k,s.items,Le.Name);}}}$r.callRef=Is;$r.default=T0;});var Mm=w(vc=>{Object.defineProperty(vc,"__esModule",{value:true});var P0=Om(),E0=Dm(),R0=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",P0.default,E0.default];vc.default=R0;});var qm=w(kc=>{Object.defineProperty(kc,"__esModule",{value:true});var js=L(),Bt=js.operators,Cs={maximum:{okStr:"<=",ok:Bt.LTE,fail:Bt.GT},minimum:{okStr:">=",ok:Bt.GTE,fail:Bt.LT},exclusiveMaximum:{okStr:"<",ok:Bt.LT,fail:Bt.GTE},exclusiveMinimum:{okStr:">",ok:Bt.GT,fail:Bt.LTE}},I0={message:({keyword:t,schemaCode:e})=>(0, js.str)`must be ${Cs[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0, js._)`{comparison: ${Cs[t].okStr}, limit: ${e}}`},j0={keyword:Object.keys(Cs),type:"number",schemaType:"number",$data:true,error:I0,code(t){let{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0, js._)`${r} ${Cs[e].fail} ${n} || isNaN(${r})`);}};kc.default=j0;});var Lm=w(xc=>{Object.defineProperty(xc,"__esModule",{value:true});var uo=L(),C0={message:({schemaCode:t})=>(0, uo.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0, uo._)`{multipleOf: ${t}}`},O0={keyword:"multipleOf",type:"number",schemaType:"number",$data:true,error:C0,code(t){let{gen:e,data:r,schemaCode:n,it:o}=t,s=o.opts.multipleOfPrecision,a=e.let("res"),i=s?(0, uo._)`Math.abs(Math.round(${a}) - ${a}) > 1e-${s}`:(0, uo._)`${a} !== parseInt(${a})`;t.fail$data((0, uo._)`(${n} === 0 || (${a} = ${r}/${n}, ${i}))`);}};xc.default=O0;});var Fm=w(bc=>{Object.defineProperty(bc,"__esModule",{value:true});function Um(t){let e=t.length,r=0,n=0,o;for(;n<e;)r++,o=t.charCodeAt(n++),o>=55296&&o<=56319&&n<e&&(o=t.charCodeAt(n),(o&64512)===56320&&n++);return r}bc.default=Um;Um.code='require("ajv/dist/runtime/ucs2length").default';});var Vm=w(wc=>{Object.defineProperty(wc,"__esModule",{value:true});var Sr=L(),N0=K(),A0=Fm(),Z0={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return (0, Sr.str)`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>(0, Sr._)`{limit: ${t}}`},D0={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:true,error:Z0,code(t){let{keyword:e,data:r,schemaCode:n,it:o}=t,s=e==="maxLength"?Sr.operators.GT:Sr.operators.LT,a=o.opts.unicode===false?(0, Sr._)`${r}.length`:(0, Sr._)`${(0, N0.useFunc)(t.gen,A0.default)}(${r})`;t.fail$data((0, Sr._)`${a} ${s} ${n}`);}};wc.default=D0;});var Jm=w($c=>{Object.defineProperty($c,"__esModule",{value:true});var M0=Ye(),q0=K(),on=L(),L0={message:({schemaCode:t})=>(0, on.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0, on._)`{pattern: ${t}}`},U0={keyword:"pattern",type:"string",schemaType:"string",$data:true,error:L0,code(t){let{gen:e,data:r,$data:n,schema:o,schemaCode:s,it:a}=t,i=a.opts.unicodeRegExp?"u":"";if(n){let{regExp:c}=a.opts.code,u=c.code==="new RegExp"?(0, on._)`new RegExp`:(0, q0.useFunc)(e,c),l=e.let("valid");e.try(()=>e.assign(l,(0, on._)`${u}(${s}, ${i}).test(${r})`),()=>e.assign(l,false)),t.fail$data((0, on._)`!${l}`);}else {let c=(0, M0.usePattern)(t,o);t.fail$data((0, on._)`!${c}.test(${r})`);}}};$c.default=U0;});var Hm=w(Sc=>{Object.defineProperty(Sc,"__esModule",{value:true});var lo=L(),F0={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return (0, lo.str)`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>(0, lo._)`{limit: ${t}}`},V0={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:true,error:F0,code(t){let{keyword:e,data:r,schemaCode:n}=t,o=e==="maxProperties"?lo.operators.GT:lo.operators.LT;t.fail$data((0, lo._)`Object.keys(${r}).length ${o} ${n}`);}};Sc.default=V0;});var Gm=w(zc=>{Object.defineProperty(zc,"__esModule",{value:true});var po=Ye(),fo=L(),J0=K(),H0={message:({params:{missingProperty:t}})=>(0, fo.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0, fo._)`{missingProperty: ${t}}`},G0={keyword:"required",type:"object",schemaType:"array",$data:true,error:H0,code(t){let{gen:e,schema:r,schemaCode:n,data:o,$data:s,it:a}=t,{opts:i}=a;if(!s&&r.length===0)return;let c=r.length>=i.loopRequired;if(a.allErrors?u():l(),i.strictRequired){let f=t.parentSchema.properties,{definedProperties:g}=t.it;for(let y of r)if(f?.[y]===void 0&&!g.has(y)){let v=a.schemaEnv.baseId+a.errSchemaPath,k=`required property "${y}" is not defined at "${v}" (strictRequired)`;(0, J0.checkStrictMode)(a,k,a.opts.strictRequired);}}function u(){if(c||s)t.block$data(fo.nil,d);else for(let f of r)(0, po.checkReportMissingProp)(t,f);}function l(){let f=e.let("missing");if(c||s){let g=e.let("valid",true);t.block$data(g,()=>p(f,g)),t.ok(g);}else e.if((0, po.checkMissingProp)(t,r,f)),(0, po.reportMissingProp)(t,f),e.else();}function d(){e.forOf("prop",n,f=>{t.setParams({missingProperty:f}),e.if((0, po.noPropertyInData)(e,o,f,i.ownProperties),()=>t.error());});}function p(f,g){t.setParams({missingProperty:f}),e.forOf(f,n,()=>{e.assign(g,(0, po.propertyInData)(e,o,f,i.ownProperties)),e.if((0, fo.not)(g),()=>{t.error(),e.break();});},fo.nil);}}};zc.default=G0;});var Bm=w(Tc=>{Object.defineProperty(Tc,"__esModule",{value:true});var mo=L(),B0={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return (0, mo.str)`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>(0, mo._)`{limit: ${t}}`},K0={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:true,error:B0,code(t){let{keyword:e,data:r,schemaCode:n}=t,o=e==="maxItems"?mo.operators.GT:mo.operators.LT;t.fail$data((0, mo._)`${r}.length ${o} ${n}`);}};Tc.default=K0;});var Os=w(Pc=>{Object.defineProperty(Pc,"__esModule",{value:true});var Km=Qi();Km.code='require("ajv/dist/runtime/equal").default';Pc.default=Km;});var Wm=w(Rc=>{Object.defineProperty(Rc,"__esModule",{value:true});var Ec=Xn(),be=L(),W0=K(),Y0=Os(),Q0={message:({params:{i:t,j:e}})=>(0, be.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0, be._)`{i: ${t}, j: ${e}}`},X0={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:true,error:Q0,code(t){let{gen:e,data:r,$data:n,schema:o,parentSchema:s,schemaCode:a,it:i}=t;if(!n&&!o)return;let c=e.let("valid"),u=s.items?(0, Ec.getSchemaTypes)(s.items):[];t.block$data(c,l,(0, be._)`${a} === false`),t.ok(c);function l(){let g=e.let("i",(0, be._)`${r}.length`),y=e.let("j");t.setParams({i:g,j:y}),e.assign(c,true),e.if((0, be._)`${g} > 1`,()=>(d()?p:f)(g,y));}function d(){return u.length>0&&!u.some(g=>g==="object"||g==="array")}function p(g,y){let v=e.name("item"),k=(0, Ec.checkDataTypes)(u,v,i.opts.strictNumbers,Ec.DataType.Wrong),S=e.const("indices",(0, be._)`{}`);e.for((0, be._)`;${g}--;`,()=>{e.let(v,(0, be._)`${r}[${g}]`),e.if(k,(0, be._)`continue`),u.length>1&&e.if((0, be._)`typeof ${v} == "string"`,(0, be._)`${v} += "_"`),e.if((0, be._)`typeof ${S}[${v}] == "number"`,()=>{e.assign(y,(0, be._)`${S}[${v}]`),t.error(),e.assign(c,false).break();}).code((0, be._)`${S}[${v}] = ${g}`);});}function f(g,y){let v=(0, W0.useFunc)(e,Y0.default),k=e.name("outer");e.label(k).for((0, be._)`;${g}--;`,()=>e.for((0, be._)`${y} = ${g}; ${y}--;`,()=>e.if((0, be._)`${v}(${r}[${g}], ${r}[${y}])`,()=>{t.error(),e.assign(c,false).break(k);})));}}};Rc.default=X0;});var Ym=w(jc=>{Object.defineProperty(jc,"__esModule",{value:true});var Ic=L(),e$=K(),t$=Os(),r$={message:"must be equal to constant",params:({schemaCode:t})=>(0, Ic._)`{allowedValue: ${t}}`},n$={keyword:"const",$data:true,error:r$,code(t){let{gen:e,data:r,$data:n,schemaCode:o,schema:s}=t;n||s&&typeof s=="object"?t.fail$data((0, Ic._)`!${(0, e$.useFunc)(e,t$.default)}(${r}, ${o})`):t.fail((0, Ic._)`${s} !== ${r}`);}};jc.default=n$;});var Qm=w(Cc=>{Object.defineProperty(Cc,"__esModule",{value:true});var ho=L(),o$=K(),s$=Os(),a$={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0, ho._)`{allowedValues: ${t}}`},i$={keyword:"enum",schemaType:"array",$data:true,error:a$,code(t){let{gen:e,data:r,$data:n,schema:o,schemaCode:s,it:a}=t;if(!n&&o.length===0)throw new Error("enum must have non-empty array");let i=o.length>=a.opts.loopEnum,c,u=()=>c??(c=(0, o$.useFunc)(e,s$.default)),l;if(i||n)l=e.let("valid"),t.block$data(l,d);else {if(!Array.isArray(o))throw new Error("ajv implementation error");let f=e.const("vSchema",s);l=(0, ho.or)(...o.map((g,y)=>p(f,y)));}t.pass(l);function d(){e.assign(l,false),e.forOf("v",s,f=>e.if((0, ho._)`${u()}(${r}, ${f})`,()=>e.assign(l,true).break()));}function p(f,g){let y=o[g];return typeof y=="object"&&y!==null?(0, ho._)`${u()}(${r}, ${f}[${g}])`:(0, ho._)`${r} === ${y}`}}};Cc.default=i$;});var Xm=w(Oc=>{Object.defineProperty(Oc,"__esModule",{value:true});var c$=qm(),u$=Lm(),l$=Vm(),d$=Jm(),p$=Hm(),f$=Gm(),m$=Bm(),h$=Wm(),g$=Ym(),y$=Qm(),_$=[c$.default,u$.default,l$.default,d$.default,p$.default,f$.default,m$.default,h$.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},g$.default,y$.default];Oc.default=_$;});var Ac=w(go=>{Object.defineProperty(go,"__esModule",{value:true});go.validateAdditionalItems=void 0;var zr=L(),Nc=K(),v$={message:({params:{len:t}})=>(0, zr.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0, zr._)`{limit: ${t}}`},k$={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:v$,code(t){let{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){(0, Nc.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}eh(t,n);}};function eh(t,e){let{gen:r,schema:n,data:o,keyword:s,it:a}=t;a.items=true;let i=r.const("len",(0, zr._)`${o}.length`);if(n===false)t.setParams({len:e.length}),t.pass((0, zr._)`${i} <= ${e.length}`);else if(typeof n=="object"&&!(0, Nc.alwaysValidSchema)(a,n)){let u=r.var("valid",(0, zr._)`${i} <= ${e.length}`);r.if((0, zr.not)(u),()=>c(u)),t.ok(u);}function c(u){r.forRange("i",e.length,i,l=>{t.subschema({keyword:s,dataProp:l,dataPropType:Nc.Type.Num},u),a.allErrors||r.if((0, zr.not)(u),()=>r.break());});}}go.validateAdditionalItems=eh;go.default=k$;});var Zc=w(yo=>{Object.defineProperty(yo,"__esModule",{value:true});yo.validateTuple=void 0;var th=L(),Ns=K(),x$=Ye(),b$={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return rh(t,"additionalItems",e);r.items=true,!(0, Ns.alwaysValidSchema)(r,e)&&t.ok((0, x$.validateArray)(t));}};function rh(t,e,r=t.schema){let{gen:n,parentSchema:o,data:s,keyword:a,it:i}=t;l(o),i.opts.unevaluated&&r.length&&i.items!==true&&(i.items=Ns.mergeEvaluated.items(n,r.length,i.items));let c=n.name("valid"),u=n.const("len",(0, th._)`${s}.length`);r.forEach((d,p)=>{(0, Ns.alwaysValidSchema)(i,d)||(n.if((0, th._)`${u} > ${p}`,()=>t.subschema({keyword:a,schemaProp:p,dataProp:p},c)),t.ok(c));});function l(d){let{opts:p,errSchemaPath:f}=i,g=r.length,y=g===d.minItems&&(g===d.maxItems||d[e]===false);if(p.strictTuples&&!y){let v=`"${a}" is ${g}-tuple, but minItems or maxItems/${e} are not specified or different at path "${f}"`;(0, Ns.checkStrictMode)(i,v,p.strictTuples);}}}yo.validateTuple=rh;yo.default=b$;});var nh=w(Dc=>{Object.defineProperty(Dc,"__esModule",{value:true});var w$=Zc(),$$={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0, w$.validateTuple)(t,"items")};Dc.default=$$;});var sh=w(Mc=>{Object.defineProperty(Mc,"__esModule",{value:true});var oh=L(),S$=K(),z$=Ye(),T$=Ac(),P$={message:({params:{len:t}})=>(0, oh.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0, oh._)`{limit: ${t}}`},E$={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:P$,code(t){let{schema:e,parentSchema:r,it:n}=t,{prefixItems:o}=r;n.items=true,!(0, S$.alwaysValidSchema)(n,e)&&(o?(0, T$.validateAdditionalItems)(t,o):t.ok((0, z$.validateArray)(t)));}};Mc.default=E$;});var ah=w(qc=>{Object.defineProperty(qc,"__esModule",{value:true});var Xe=L(),As=K(),R$={message:({params:{min:t,max:e}})=>e===void 0?(0, Xe.str)`must contain at least ${t} valid item(s)`:(0, Xe.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0, Xe._)`{minContains: ${t}}`:(0, Xe._)`{minContains: ${t}, maxContains: ${e}}`},I$={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:true,error:R$,code(t){let{gen:e,schema:r,parentSchema:n,data:o,it:s}=t,a,i,{minContains:c,maxContains:u}=n;s.opts.next?(a=c===void 0?1:c,i=u):a=1;let l=e.const("len",(0, Xe._)`${o}.length`);if(t.setParams({min:a,max:i}),i===void 0&&a===0){(0, As.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(i!==void 0&&a>i){(0, As.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0, As.alwaysValidSchema)(s,r)){let y=(0, Xe._)`${l} >= ${a}`;i!==void 0&&(y=(0, Xe._)`${y} && ${l} <= ${i}`),t.pass(y);return}s.items=true;let d=e.name("valid");i===void 0&&a===1?f(d,()=>e.if(d,()=>e.break())):a===0?(e.let(d,true),i!==void 0&&e.if((0, Xe._)`${o}.length > 0`,p)):(e.let(d,false),p()),t.result(d,()=>t.reset());function p(){let y=e.name("_valid"),v=e.let("count",0);f(y,()=>e.if(y,()=>g(v)));}function f(y,v){e.forRange("i",0,l,k=>{t.subschema({keyword:"contains",dataProp:k,dataPropType:As.Type.Num,compositeRule:true},y),v();});}function g(y){e.code((0, Xe._)`${y}++`),i===void 0?e.if((0, Xe._)`${y} >= ${a}`,()=>e.assign(d,true).break()):(e.if((0, Xe._)`${y} > ${i}`,()=>e.assign(d,false).break()),a===1?e.assign(d,true):e.if((0, Xe._)`${y} >= ${a}`,()=>e.assign(d,true)));}}};qc.default=I$;});var uh=w(yt=>{Object.defineProperty(yt,"__esModule",{value:true});yt.validateSchemaDeps=yt.validatePropertyDeps=yt.error=void 0;var Lc=L(),j$=K(),_o=Ye();yt.error={message:({params:{property:t,depsCount:e,deps:r}})=>{let n=e===1?"property":"properties";return (0, Lc.str)`must have ${n} ${r} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:r,missingProperty:n}})=>(0, Lc._)`{property: ${t},
6
+ missingProperty: ${n},
7
+ depsCount: ${e},
8
+ deps: ${r}}`};var C$={keyword:"dependencies",type:"object",schemaType:"object",error:yt.error,code(t){let[e,r]=O$(t);ih(t,e),ch(t,r);}};function O$({schema:t}){let e={},r={};for(let n in t){if(n==="__proto__")continue;let o=Array.isArray(t[n])?e:r;o[n]=t[n];}return [e,r]}function ih(t,e=t.schema){let{gen:r,data:n,it:o}=t;if(Object.keys(e).length===0)return;let s=r.let("missing");for(let a in e){let i=e[a];if(i.length===0)continue;let c=(0, _o.propertyInData)(r,n,a,o.opts.ownProperties);t.setParams({property:a,depsCount:i.length,deps:i.join(", ")}),o.allErrors?r.if(c,()=>{for(let u of i)(0, _o.checkReportMissingProp)(t,u);}):(r.if((0, Lc._)`${c} && (${(0, _o.checkMissingProp)(t,i,s)})`),(0, _o.reportMissingProp)(t,s),r.else());}}yt.validatePropertyDeps=ih;function ch(t,e=t.schema){let{gen:r,data:n,keyword:o,it:s}=t,a=r.name("valid");for(let i in e)(0, j$.alwaysValidSchema)(s,e[i])||(r.if((0, _o.propertyInData)(r,n,i,s.opts.ownProperties),()=>{let c=t.subschema({keyword:o,schemaProp:i},a);t.mergeValidEvaluated(c,a);},()=>r.var(a,true)),t.ok(a));}yt.validateSchemaDeps=ch;yt.default=C$;});var dh=w(Uc=>{Object.defineProperty(Uc,"__esModule",{value:true});var lh=L(),N$=K(),A$={message:"property name must be valid",params:({params:t})=>(0, lh._)`{propertyName: ${t.propertyName}}`},Z$={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:A$,code(t){let{gen:e,schema:r,data:n,it:o}=t;if((0, N$.alwaysValidSchema)(o,r))return;let s=e.name("valid");e.forIn("key",n,a=>{t.setParams({propertyName:a}),t.subschema({keyword:"propertyNames",data:a,dataTypes:["string"],propertyName:a,compositeRule:true},s),e.if((0, lh.not)(s),()=>{t.error(true),o.allErrors||e.break();});}),t.ok(s);}};Uc.default=Z$;});var Vc=w(Fc=>{Object.defineProperty(Fc,"__esModule",{value:true});var Zs=Ye(),st=L(),D$=Pt(),Ds=K(),M$={message:"must NOT have additional properties",params:({params:t})=>(0, st._)`{additionalProperty: ${t.additionalProperty}}`},q$={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:true,trackErrors:true,error:M$,code(t){let{gen:e,schema:r,parentSchema:n,data:o,errsCount:s,it:a}=t;if(!s)throw new Error("ajv implementation error");let{allErrors:i,opts:c}=a;if(a.props=true,c.removeAdditional!=="all"&&(0, Ds.alwaysValidSchema)(a,r))return;let u=(0, Zs.allSchemaProperties)(n.properties),l=(0, Zs.allSchemaProperties)(n.patternProperties);d(),t.ok((0, st._)`${s} === ${D$.default.errors}`);function d(){e.forIn("key",o,v=>{!u.length&&!l.length?g(v):e.if(p(v),()=>g(v));});}function p(v){let k;if(u.length>8){let S=(0, Ds.schemaRefOrVal)(a,n.properties,"properties");k=(0, Zs.isOwnProperty)(e,S,v);}else u.length?k=(0, st.or)(...u.map(S=>(0, st._)`${v} === ${S}`)):k=st.nil;return l.length&&(k=(0, st.or)(k,...l.map(S=>(0, st._)`${(0, Zs.usePattern)(t,S)}.test(${v})`))),(0, st.not)(k)}function f(v){e.code((0, st._)`delete ${o}[${v}]`);}function g(v){if(c.removeAdditional==="all"||c.removeAdditional&&r===false){f(v);return}if(r===false){t.setParams({additionalProperty:v}),t.error(),i||e.break();return}if(typeof r=="object"&&!(0, Ds.alwaysValidSchema)(a,r)){let k=e.name("valid");c.removeAdditional==="failing"?(y(v,k,false),e.if((0, st.not)(k),()=>{t.reset(),f(v);})):(y(v,k),i||e.if((0, st.not)(k),()=>e.break()));}}function y(v,k,S){let b={keyword:"additionalProperties",dataProp:v,dataPropType:Ds.Type.Str};S===false&&Object.assign(b,{compositeRule:true,createErrors:false,allErrors:false}),t.subschema(b,k);}}};Fc.default=q$;});var mh=w(Hc=>{Object.defineProperty(Hc,"__esModule",{value:true});var L$=no(),ph=Ye(),Jc=K(),fh=Vc(),U$={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,parentSchema:n,data:o,it:s}=t;s.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&fh.default.code(new L$.KeywordCxt(s,fh.default,"additionalProperties"));let a=(0, ph.allSchemaProperties)(r);for(let d of a)s.definedProperties.add(d);s.opts.unevaluated&&a.length&&s.props!==true&&(s.props=Jc.mergeEvaluated.props(e,(0, Jc.toHash)(a),s.props));let i=a.filter(d=>!(0, Jc.alwaysValidSchema)(s,r[d]));if(i.length===0)return;let c=e.name("valid");for(let d of i)u(d)?l(d):(e.if((0, ph.propertyInData)(e,o,d,s.opts.ownProperties)),l(d),s.allErrors||e.else().var(c,true),e.endIf()),t.it.definedProperties.add(d),t.ok(c);function u(d){return s.opts.useDefaults&&!s.compositeRule&&r[d].default!==void 0}function l(d){t.subschema({keyword:"properties",schemaProp:d,dataProp:d},c);}}};Hc.default=U$;});var _h=w(Gc=>{Object.defineProperty(Gc,"__esModule",{value:true});var hh=Ye(),Ms=L(),gh=K(),yh=K(),F$={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,data:n,parentSchema:o,it:s}=t,{opts:a}=s,i=(0, hh.allSchemaProperties)(r),c=i.filter(y=>(0, gh.alwaysValidSchema)(s,r[y]));if(i.length===0||c.length===i.length&&(!s.opts.unevaluated||s.props===true))return;let u=a.strictSchema&&!a.allowMatchingProperties&&o.properties,l=e.name("valid");s.props!==true&&!(s.props instanceof Ms.Name)&&(s.props=(0, yh.evaluatedPropsToName)(e,s.props));let{props:d}=s;p();function p(){for(let y of i)u&&f(y),s.allErrors?g(y):(e.var(l,true),g(y),e.if(l));}function f(y){for(let v in u)new RegExp(y).test(v)&&(0, gh.checkStrictMode)(s,`property ${v} matches pattern ${y} (use allowMatchingProperties)`);}function g(y){e.forIn("key",n,v=>{e.if((0, Ms._)`${(0, hh.usePattern)(t,y)}.test(${v})`,()=>{let k=c.includes(y);k||t.subschema({keyword:"patternProperties",schemaProp:y,dataProp:v,dataPropType:yh.Type.Str},l),s.opts.unevaluated&&d!==true?e.assign((0, Ms._)`${d}[${v}]`,true):!k&&!s.allErrors&&e.if((0, Ms.not)(l),()=>e.break());});});}}};Gc.default=F$;});var vh=w(Bc=>{Object.defineProperty(Bc,"__esModule",{value:true});var V$=K(),J$={keyword:"not",schemaType:["object","boolean"],trackErrors:true,code(t){let{gen:e,schema:r,it:n}=t;if((0, V$.alwaysValidSchema)(n,r)){t.fail();return}let o=e.name("valid");t.subschema({keyword:"not",compositeRule:true,createErrors:false,allErrors:false},o),t.failResult(o,()=>t.reset(),()=>t.error());},error:{message:"must NOT be valid"}};Bc.default=J$;});var kh=w(Kc=>{Object.defineProperty(Kc,"__esModule",{value:true});var H$=Ye(),G$={keyword:"anyOf",schemaType:"array",trackErrors:true,code:H$.validateUnion,error:{message:"must match a schema in anyOf"}};Kc.default=G$;});var xh=w(Wc=>{Object.defineProperty(Wc,"__esModule",{value:true});var qs=L(),B$=K(),K$={message:"must match exactly one schema in oneOf",params:({params:t})=>(0, qs._)`{passingSchemas: ${t.passing}}`},W$={keyword:"oneOf",schemaType:"array",trackErrors:true,error:K$,code(t){let{gen:e,schema:r,parentSchema:n,it:o}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(o.opts.discriminator&&n.discriminator)return;let s=r,a=e.let("valid",false),i=e.let("passing",null),c=e.name("_valid");t.setParams({passing:i}),e.block(u),t.result(a,()=>t.reset(),()=>t.error(true));function u(){s.forEach((l,d)=>{let p;(0, B$.alwaysValidSchema)(o,l)?e.var(c,true):p=t.subschema({keyword:"oneOf",schemaProp:d,compositeRule:true},c),d>0&&e.if((0, qs._)`${c} && ${a}`).assign(a,false).assign(i,(0, qs._)`[${i}, ${d}]`).else(),e.if(c,()=>{e.assign(a,true),e.assign(i,d),p&&t.mergeEvaluated(p,qs.Name);});});}}};Wc.default=W$;});var bh=w(Yc=>{Object.defineProperty(Yc,"__esModule",{value:true});var Y$=K(),Q$={keyword:"allOf",schemaType:"array",code(t){let{gen:e,schema:r,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");let o=e.name("valid");r.forEach((s,a)=>{if((0, Y$.alwaysValidSchema)(n,s))return;let i=t.subschema({keyword:"allOf",schemaProp:a},o);t.ok(o),t.mergeEvaluated(i);});}};Yc.default=Q$;});var Sh=w(Qc=>{Object.defineProperty(Qc,"__esModule",{value:true});var Ls=L(),$h=K(),X$={message:({params:t})=>(0, Ls.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0, Ls._)`{failingKeyword: ${t.ifClause}}`},eS={keyword:"if",schemaType:["object","boolean"],trackErrors:true,error:X$,code(t){let{gen:e,parentSchema:r,it:n}=t;r.then===void 0&&r.else===void 0&&(0, $h.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let o=wh(n,"then"),s=wh(n,"else");if(!o&&!s)return;let a=e.let("valid",true),i=e.name("_valid");if(c(),t.reset(),o&&s){let l=e.let("ifClause");t.setParams({ifClause:l}),e.if(i,u("then",l),u("else",l));}else o?e.if(i,u("then")):e.if((0, Ls.not)(i),u("else"));t.pass(a,()=>t.error(true));function c(){let l=t.subschema({keyword:"if",compositeRule:true,createErrors:false,allErrors:false},i);t.mergeEvaluated(l);}function u(l,d){return ()=>{let p=t.subschema({keyword:l},i);e.assign(a,i),t.mergeValidEvaluated(p,a),d?e.assign(d,(0, Ls._)`${l}`):t.setParams({ifClause:l});}}}};function wh(t,e){let r=t.schema[e];return r!==void 0&&!(0, $h.alwaysValidSchema)(t,r)}Qc.default=eS;});var zh=w(Xc=>{Object.defineProperty(Xc,"__esModule",{value:true});var tS=K(),rS={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0, tS.checkStrictMode)(r,`"${t}" without "if" is ignored`);}};Xc.default=rS;});var Th=w(eu=>{Object.defineProperty(eu,"__esModule",{value:true});var nS=Ac(),oS=nh(),sS=Zc(),aS=sh(),iS=ah(),cS=uh(),uS=dh(),lS=Vc(),dS=mh(),pS=_h(),fS=vh(),mS=kh(),hS=xh(),gS=bh(),yS=Sh(),_S=zh();function vS(t=false){let e=[fS.default,mS.default,hS.default,gS.default,yS.default,_S.default,uS.default,lS.default,cS.default,dS.default,pS.default];return t?e.push(oS.default,aS.default):e.push(nS.default,sS.default),e.push(iS.default),e}eu.default=vS;});var Ph=w(tu=>{Object.defineProperty(tu,"__esModule",{value:true});var me=L(),kS={message:({schemaCode:t})=>(0, me.str)`must match format "${t}"`,params:({schemaCode:t})=>(0, me._)`{format: ${t}}`},xS={keyword:"format",type:["number","string"],schemaType:"string",$data:true,error:kS,code(t,e){let{gen:r,data:n,$data:o,schema:s,schemaCode:a,it:i}=t,{opts:c,errSchemaPath:u,schemaEnv:l,self:d}=i;if(!c.validateFormats)return;o?p():f();function p(){let g=r.scopeValue("formats",{ref:d.formats,code:c.code.formats}),y=r.const("fDef",(0, me._)`${g}[${a}]`),v=r.let("fType"),k=r.let("format");r.if((0, me._)`typeof ${y} == "object" && !(${y} instanceof RegExp)`,()=>r.assign(v,(0, me._)`${y}.type || "string"`).assign(k,(0, me._)`${y}.validate`),()=>r.assign(v,(0, me._)`"string"`).assign(k,y)),t.fail$data((0, me.or)(S(),b()));function S(){return c.strictSchema===false?me.nil:(0, me._)`${a} && !${k}`}function b(){let R=l.$async?(0, me._)`(${y}.async ? await ${k}(${n}) : ${k}(${n}))`:(0, me._)`${k}(${n})`,C=(0, me._)`(typeof ${k} == "function" ? ${R} : ${k}.test(${n}))`;return (0, me._)`${k} && ${k} !== true && ${v} === ${e} && !${C}`}}function f(){let g=d.formats[s];if(!g){S();return}if(g===true)return;let[y,v,k]=b(g);y===e&&t.pass(R());function S(){if(c.strictSchema===false){d.logger.warn(C());return}throw new Error(C());function C(){return `unknown format "${s}" ignored in schema at path "${u}"`}}function b(C){let Ie=C instanceof RegExp?(0, me.regexpCode)(C):c.code.formats?(0, me._)`${c.code.formats}${(0, me.getProperty)(s)}`:void 0,Fe=r.scopeValue("formats",{key:s,ref:C,code:Ie});return typeof C=="object"&&!(C instanceof RegExp)?[C.type||"string",C.validate,(0, me._)`${Fe}.validate`]:["string",C,Fe]}function R(){if(typeof g=="object"&&!(g instanceof RegExp)&&g.async){if(!l.$async)throw new Error("async format in sync schema");return (0, me._)`await ${k}(${n})`}return typeof v=="function"?(0, me._)`${k}(${n})`:(0, me._)`${k}.test(${n})`}}}};tu.default=xS;});var Eh=w(ru=>{Object.defineProperty(ru,"__esModule",{value:true});var bS=Ph(),wS=[bS.default];ru.default=wS;});var Rh=w(sn=>{Object.defineProperty(sn,"__esModule",{value:true});sn.contentVocabulary=sn.metadataVocabulary=void 0;sn.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];sn.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"];});var jh=w(nu=>{Object.defineProperty(nu,"__esModule",{value:true});var $S=Mm(),SS=Xm(),zS=Th(),TS=Eh(),Ih=Rh(),PS=[$S.default,SS.default,(0, zS.default)(),TS.default,Ih.metadataVocabulary,Ih.contentVocabulary];nu.default=PS;});var Oh=w(Us=>{Object.defineProperty(Us,"__esModule",{value:true});Us.DiscrError=void 0;var Ch;(function(t){t.Tag="tag",t.Mapping="mapping";})(Ch||(Us.DiscrError=Ch={}));});var Ah=w(su=>{Object.defineProperty(su,"__esModule",{value:true});var an=L(),ou=Oh(),Nh=$s(),ES=oo(),RS=K(),IS={message:({params:{discrError:t,tagName:e}})=>t===ou.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>(0, an._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`},jS={keyword:"discriminator",type:"object",schemaType:"object",error:IS,code(t){let{gen:e,data:r,schema:n,parentSchema:o,it:s}=t,{oneOf:a}=o;if(!s.opts.discriminator)throw new Error("discriminator: requires discriminator option");let i=n.propertyName;if(typeof i!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!a)throw new Error("discriminator: requires oneOf keyword");let c=e.let("valid",false),u=e.const("tag",(0, an._)`${r}${(0, an.getProperty)(i)}`);e.if((0, an._)`typeof ${u} == "string"`,()=>l(),()=>t.error(false,{discrError:ou.DiscrError.Tag,tag:u,tagName:i})),t.ok(c);function l(){let f=p();e.if(false);for(let g in f)e.elseIf((0, an._)`${u} === ${g}`),e.assign(c,d(f[g]));e.else(),t.error(false,{discrError:ou.DiscrError.Mapping,tag:u,tagName:i}),e.endIf();}function d(f){let g=e.name("valid"),y=t.subschema({keyword:"oneOf",schemaProp:f},g);return t.mergeEvaluated(y,an.Name),g}function p(){var f;let g={},y=k(o),v=true;for(let R=0;R<a.length;R++){let C=a[R];if(C?.$ref&&!(0, RS.schemaHasRulesButRef)(C,s.self.RULES)){let Fe=C.$ref;if(C=Nh.resolveRef.call(s.self,s.schemaEnv.root,s.baseId,Fe),C instanceof Nh.SchemaEnv&&(C=C.schema),C===void 0)throw new ES.default(s.opts.uriResolver,s.baseId,Fe)}let Ie=(f=C?.properties)===null||f===void 0?void 0:f[i];if(typeof Ie!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${i}"`);v=v&&(y||k(C)),S(Ie,R);}if(!v)throw new Error(`discriminator: "${i}" must be required`);return g;function k({required:R}){return Array.isArray(R)&&R.includes(i)}function S(R,C){if(R.const)b(R.const,C);else if(R.enum)for(let Ie of R.enum)b(Ie,C);else throw new Error(`discriminator: "properties/${i}" must have "const" or "enum"`)}function b(R,C){if(typeof R!="string"||R in g)throw new Error(`discriminator: "${i}" values must be unique strings`);g[R]=C;}}}};su.default=jS;});var Zh=w((yO,CS)=>{CS.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:true,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:true,readOnly:{type:"boolean",default:false},examples:{type:"array",items:true},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:true},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:false},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:true,enum:{type:"array",items:true,minItems:1,uniqueItems:true},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:true}]},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:true};});var iu=w((ue,au)=>{Object.defineProperty(ue,"__esModule",{value:true});ue.MissingRefError=ue.ValidationError=ue.CodeGen=ue.Name=ue.nil=ue.stringify=ue.str=ue._=ue.KeywordCxt=ue.Ajv=void 0;var OS=Cm(),NS=jh(),AS=Ah(),Dh=Zh(),ZS=["/properties"],Fs="http://json-schema.org/draft-07/schema",cn=class extends OS.default{_addVocabularies(){super._addVocabularies(),NS.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(AS.default);}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(Dh,ZS):Dh;this.addMetaSchema(e,Fs,false),this.refs["http://json-schema.org/schema"]=Fs;}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Fs)?Fs:void 0)}};ue.Ajv=cn;au.exports=ue=cn;au.exports.Ajv=cn;Object.defineProperty(ue,"__esModule",{value:true});ue.default=cn;var DS=no();Object.defineProperty(ue,"KeywordCxt",{enumerable:true,get:function(){return DS.KeywordCxt}});var un=L();Object.defineProperty(ue,"_",{enumerable:true,get:function(){return un._}});Object.defineProperty(ue,"str",{enumerable:true,get:function(){return un.str}});Object.defineProperty(ue,"stringify",{enumerable:true,get:function(){return un.stringify}});Object.defineProperty(ue,"nil",{enumerable:true,get:function(){return un.nil}});Object.defineProperty(ue,"Name",{enumerable:true,get:function(){return un.Name}});Object.defineProperty(ue,"CodeGen",{enumerable:true,get:function(){return un.CodeGen}});var MS=bs();Object.defineProperty(ue,"ValidationError",{enumerable:true,get:function(){return MS.default}});var qS=oo();Object.defineProperty(ue,"MissingRefError",{enumerable:true,get:function(){return qS.default}});});var Hh=w(vt=>{Object.defineProperty(vt,"__esModule",{value:true});vt.formatNames=vt.fastFormats=vt.fullFormats=void 0;function _t(t,e){return {validate:t,compare:e}}vt.fullFormats={date:_t(Uh,du),time:_t(uu(true),pu),"date-time":_t(Mh(true),Vh),"iso-time":_t(uu(),Fh),"iso-date-time":_t(Mh(),Jh),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:HS,"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:XS,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:GS,int32:{type:"number",validate:WS},int64:{type:"number",validate:YS},float:{type:"number",validate:Lh},double:{type:"number",validate:Lh},password:true,binary:true};vt.fastFormats={...vt.fullFormats,date:_t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,du),time:_t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,pu),"date-time":_t(/^\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,Vh),"iso-time":_t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,Fh),"iso-date-time":_t(/^\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,Jh),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};vt.formatNames=Object.keys(vt.fullFormats);function LS(t){return t%4===0&&(t%100!==0||t%400===0)}var US=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,FS=[0,31,28,31,30,31,30,31,31,30,31,30,31];function Uh(t){let e=US.exec(t);if(!e)return false;let r=+e[1],n=+e[2],o=+e[3];return n>=1&&n<=12&&o>=1&&o<=(n===2&&LS(r)?29:FS[n])}function du(t,e){if(t&&e)return t>e?1:t<e?-1:0}var cu=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function uu(t){return function(r){let n=cu.exec(r);if(!n)return false;let o=+n[1],s=+n[2],a=+n[3],i=n[4],c=n[5]==="-"?-1:1,u=+(n[6]||0),l=+(n[7]||0);if(u>23||l>59||t&&!i)return false;if(o<=23&&s<=59&&a<60)return true;let d=s-l*c,p=o-u*c-(d<0?1:0);return (p===23||p===-1)&&(d===59||d===-1)&&a<61}}function pu(t,e){if(!(t&&e))return;let r=new Date("2020-01-01T"+t).valueOf(),n=new Date("2020-01-01T"+e).valueOf();if(r&&n)return r-n}function Fh(t,e){if(!(t&&e))return;let r=cu.exec(t),n=cu.exec(e);if(r&&n)return t=r[1]+r[2]+r[3],e=n[1]+n[2]+n[3],t>e?1:t<e?-1:0}var lu=/t|\s/i;function Mh(t){let e=uu(t);return function(n){let o=n.split(lu);return o.length===2&&Uh(o[0])&&e(o[1])}}function Vh(t,e){if(!(t&&e))return;let r=new Date(t).valueOf(),n=new Date(e).valueOf();if(r&&n)return r-n}function Jh(t,e){if(!(t&&e))return;let[r,n]=t.split(lu),[o,s]=e.split(lu),a=du(r,o);if(a!==void 0)return a||pu(n,s)}var VS=/\/|:/,JS=/^(?:[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 HS(t){return VS.test(t)&&JS.test(t)}var qh=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function GS(t){return qh.lastIndex=0,qh.test(t)}var BS=-2147483648,KS=2**31-1;function WS(t){return Number.isInteger(t)&&t<=KS&&t>=BS}function YS(t){return Number.isInteger(t)}function Lh(){return true}var QS=/[^\\]\\Z/;function XS(t){if(QS.test(t))return false;try{return new RegExp(t),!0}catch{return false}}});var Gh=w(ln=>{Object.defineProperty(ln,"__esModule",{value:true});ln.formatLimitDefinition=void 0;var ez=iu(),at=L(),Kt=at.operators,Vs={formatMaximum:{okStr:"<=",ok:Kt.LTE,fail:Kt.GT},formatMinimum:{okStr:">=",ok:Kt.GTE,fail:Kt.LT},formatExclusiveMaximum:{okStr:"<",ok:Kt.LT,fail:Kt.GTE},formatExclusiveMinimum:{okStr:">",ok:Kt.GT,fail:Kt.LTE}},tz={message:({keyword:t,schemaCode:e})=>(0, at.str)`should be ${Vs[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0, at._)`{comparison: ${Vs[t].okStr}, limit: ${e}}`};ln.formatLimitDefinition={keyword:Object.keys(Vs),type:"string",schemaType:"string",$data:true,error:tz,code(t){let{gen:e,data:r,schemaCode:n,keyword:o,it:s}=t,{opts:a,self:i}=s;if(!a.validateFormats)return;let c=new ez.KeywordCxt(s,i.RULES.all.format.definition,"format");c.$data?u():l();function u(){let p=e.scopeValue("formats",{ref:i.formats,code:a.code.formats}),f=e.const("fmt",(0, at._)`${p}[${c.schemaCode}]`);t.fail$data((0, at.or)((0, at._)`typeof ${f} != "object"`,(0, at._)`${f} instanceof RegExp`,(0, at._)`typeof ${f}.compare != "function"`,d(f)));}function l(){let p=c.schema,f=i.formats[p];if(!f||f===true)return;if(typeof f!="object"||f instanceof RegExp||typeof f.compare!="function")throw new Error(`"${o}": format "${p}" does not define "compare" function`);let g=e.scopeValue("formats",{key:p,ref:f,code:a.code.formats?(0, at._)`${a.code.formats}${(0, at.getProperty)(p)}`:void 0});t.fail$data(d(g));}function d(p){return (0, at._)`${p}.compare(${r}, ${n}) ${Vs[o].fail} 0`}},dependencies:["format"]};var rz=t=>(t.addKeyword(ln.formatLimitDefinition),t);ln.default=rz;});var Yh=w((vo,Wh)=>{Object.defineProperty(vo,"__esModule",{value:true});var dn=Hh(),nz=Gh(),fu=L(),Bh=new fu.Name("fullFormats"),oz=new fu.Name("fastFormats"),mu=(t,e={keywords:true})=>{if(Array.isArray(e))return Kh(t,e,dn.fullFormats,Bh),t;let[r,n]=e.mode==="fast"?[dn.fastFormats,oz]:[dn.fullFormats,Bh],o=e.formats||dn.formatNames;return Kh(t,o,r,n),e.keywords&&(0, nz.default)(t),t};mu.get=(t,e="full")=>{let n=(e==="fast"?dn.fastFormats:dn.fullFormats)[t];if(!n)throw new Error(`Unknown format "${t}"`);return n};function Kh(t,e,r,n){var o,s;(o=(s=t.opts.code).formats)!==null&&o!==void 0||(s.formats=(0, fu._)`require("ajv-formats/dist/formats").${n}`);for(let a of e)t.addFormat(a,r[a]);}Wh.exports=vo=mu;Object.defineProperty(vo,"__esModule",{value:true});vo.default=mu;});var lg={};zo(lg,{GLOBAL_CACHE_DIR:()=>ta,GLOBAL_CONFIG_DIR:()=>Er,GLOBAL_CONFIG_PATH:()=>vu,GLOBAL_CREDENTIALS_PATH:()=>ku,GLOBAL_STATE_PATH:()=>fz,GLOBAL_TASK_TEMPLATES_DIR:()=>ug,GLOBAL_TEMPLATES_DIR:()=>cg,GLOBAL_USERS_PATH:()=>pz,GLOBAL_WORKFLOWS_PATH:()=>dz,ensureGlobalDirs:()=>mz});async function mz(){await mkdir(Er,{recursive:true}),await mkdir(ta,{recursive:true}),await mkdir(ug,{recursive:true});}var Er,vu,ku,ta,dz,pz,fz,cg,ug,xu=Wg(()=>{Er=join(homedir(),".softspark","jira-mcp"),vu=join(Er,"config.json"),ku=join(Er,"credentials.json"),ta=join(Er,"cache"),dz=join(ta,"workflows.json"),pz=join(ta,"users.json"),fz=join(Er,"state.json"),cg=join(Er,"templates"),ug=join(cg,"tasks");});var A={};zo(A,{BRAND:()=>wy,DIRTY:()=>Qt,EMPTY_PATH:()=>ty,INVALID:()=>I,NEVER:()=>i_,OK:()=>$e,ParseStatus:()=>ye,Schema:()=>q,ZodAny:()=>At,ZodArray:()=>wt,ZodBigInt:()=>er,ZodBoolean:()=>tr,ZodBranded:()=>yn,ZodCatch:()=>pr,ZodDate:()=>rr,ZodDefault:()=>dr,ZodDiscriminatedUnion:()=>Eo,ZodEffects:()=>He,ZodEnum:()=>ur,ZodError:()=>Ne,ZodFirstPartyTypeKind:()=>O,ZodFunction:()=>Io,ZodIntersection:()=>ar,ZodIssueCode:()=>_,ZodLazy:()=>ir,ZodLiteral:()=>cr,ZodMap:()=>Zr,ZodNaN:()=>Mr,ZodNativeEnum:()=>lr,ZodNever:()=>et,ZodNull:()=>or,ZodNullable:()=>dt,ZodNumber:()=>Xt,ZodObject:()=>Ae,ZodOptional:()=>Ve,ZodParsedType:()=>$,ZodPipeline:()=>_n,ZodPromise:()=>Zt,ZodReadonly:()=>fr,ZodRecord:()=>Ro,ZodSchema:()=>q,ZodSet:()=>Dr,ZodString:()=>Nt,ZodSymbol:()=>Nr,ZodTransformer:()=>He,ZodTuple:()=>lt,ZodType:()=>q,ZodUndefined:()=>nr,ZodUnion:()=>sr,ZodUnknown:()=>bt,ZodVoid:()=>Ar,addIssueToContext:()=>x,any:()=>jy,array:()=>Ay,bigint:()=>Ty,boolean:()=>Fu,coerce:()=>a_,custom:()=>qu,date:()=>Py,datetimeRegex:()=>Du,defaultErrorMap:()=>kt,discriminatedUnion:()=>qy,effect:()=>Qy,enum:()=>Ky,function:()=>Hy,getErrorMap:()=>jr,getParsedType:()=>ut,instanceof:()=>Sy,intersection:()=>Ly,isAborted:()=>To,isAsync:()=>Cr,isDirty:()=>Po,isValid:()=>Ot,late:()=>$y,lazy:()=>Gy,literal:()=>By,makeIssue:()=>gn,map:()=>Vy,nan:()=>zy,nativeEnum:()=>Wy,never:()=>Oy,null:()=>Iy,nullable:()=>e_,number:()=>Uu,object:()=>Zy,objectUtil:()=>pa,oboolean:()=>s_,onumber:()=>o_,optional:()=>Xy,ostring:()=>n_,pipeline:()=>r_,preprocess:()=>t_,promise:()=>Yy,quotelessJson:()=>Qg,record:()=>Fy,set:()=>Jy,setErrorMap:()=>ey,strictObject:()=>Dy,string:()=>Lu,symbol:()=>Ey,transformer:()=>Qy,tuple:()=>Uy,undefined:()=>Ry,union:()=>My,unknown:()=>Cy,util:()=>V,void:()=>Ny});var V;(function(t){t.assertEqual=o=>{};function e(o){}t.assertIs=e;function r(o){throw new Error}t.assertNever=r,t.arrayToEnum=o=>{let s={};for(let a of o)s[a]=a;return s},t.getValidEnumValues=o=>{let s=t.objectKeys(o).filter(i=>typeof o[o[i]]!="number"),a={};for(let i of s)a[i]=o[i];return t.objectValues(a)},t.objectValues=o=>t.objectKeys(o).map(function(s){return o[s]}),t.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{let s=[];for(let a in o)Object.prototype.hasOwnProperty.call(o,a)&&s.push(a);return s},t.find=(o,s)=>{for(let a of o)if(s(a))return a},t.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function n(o,s=" | "){return o.map(a=>typeof a=="string"?`'${a}'`:a).join(s)}t.joinValues=n,t.jsonStringifyReplacer=(o,s)=>typeof s=="bigint"?s.toString():s;})(V||(V={}));var pa;(function(t){t.mergeShapes=(e,r)=>({...e,...r});})(pa||(pa={}));var $=V.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ut=t=>{switch(typeof t){case "undefined":return $.undefined;case "string":return $.string;case "number":return Number.isNaN(t)?$.nan:$.number;case "boolean":return $.boolean;case "function":return $.function;case "bigint":return $.bigint;case "symbol":return $.symbol;case "object":return Array.isArray(t)?$.array:t===null?$.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?$.promise:typeof Map<"u"&&t instanceof Map?$.map:typeof Set<"u"&&t instanceof Set?$.set:typeof Date<"u"&&t instanceof Date?$.date:$.object;default:return $.unknown}};var _=V.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"]),Qg=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),Ne=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n];},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n];};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e;}format(e){let r=e||function(s){return s.message},n={_errors:[]},o=s=>{for(let a of s.issues)if(a.code==="invalid_union")a.unionErrors.map(o);else if(a.code==="invalid_return_type")o(a.returnTypeError);else if(a.code==="invalid_arguments")o(a.argumentsError);else if(a.path.length===0)n._errors.push(r(a));else {let i=n,c=0;for(;c<a.path.length;){let u=a.path[c];c===a.path.length-1?(i[u]=i[u]||{_errors:[]},i[u]._errors.push(r(a))):i[u]=i[u]||{_errors:[]},i=i[u],c++;}}};return o(this),n}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,V.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},n=[];for(let o of this.issues)if(o.path.length>0){let s=o.path[0];r[s]=r[s]||[],r[s].push(e(o));}else n.push(e(o));return {formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};Ne.create=t=>new Ne(t);var Xg=(t,e)=>{let r;switch(t.code){case _.invalid_type:t.received===$.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case _.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,V.jsonStringifyReplacer)}`;break;case _.unrecognized_keys:r=`Unrecognized key(s) in object: ${V.joinValues(t.keys,", ")}`;break;case _.invalid_union:r="Invalid input";break;case _.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${V.joinValues(t.options)}`;break;case _.invalid_enum_value:r=`Invalid enum value. Expected ${V.joinValues(t.options)}, received '${t.received}'`;break;case _.invalid_arguments:r="Invalid function arguments";break;case _.invalid_return_type:r="Invalid function return type";break;case _.invalid_date:r="Invalid date";break;case _.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:V.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case _.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case _.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case _.custom:r="Invalid input";break;case _.invalid_intersection_types:r="Intersection results could not be merged";break;case _.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case _.not_finite:r="Number must be finite";break;default:r=e.defaultError,V.assertNever(t);}return {message:r}},kt=Xg;var Cu=kt;function ey(t){Cu=t;}function jr(){return Cu}var gn=t=>{let{data:e,path:r,errorMaps:n,issueData:o}=t,s=[...r,...o.path||[]],a={...o,path:s};if(o.message!==void 0)return {...o,path:s,message:o.message};let i="",c=n.filter(u=>!!u).slice().reverse();for(let u of c)i=u(a,{data:e,defaultError:i}).message;return {...o,path:s,message:i}},ty=[];function x(t,e){let r=jr(),n=gn({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===kt?void 0:kt].filter(o=>!!o)});t.common.issues.push(n);}var ye=class t{constructor(){this.value="valid";}dirty(){this.value==="valid"&&(this.value="dirty");}abort(){this.value!=="aborted"&&(this.value="aborted");}static mergeArray(e,r){let n=[];for(let o of r){if(o.status==="aborted")return I;o.status==="dirty"&&e.dirty(),n.push(o.value);}return {status:e.value,value:n}}static async mergeObjectAsync(e,r){let n=[];for(let o of r){let s=await o.key,a=await o.value;n.push({key:s,value:a});}return t.mergeObjectSync(e,n)}static mergeObjectSync(e,r){let n={};for(let o of r){let{key:s,value:a}=o;if(s.status==="aborted"||a.status==="aborted")return I;s.status==="dirty"&&e.dirty(),a.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof a.value<"u"||o.alwaysSet)&&(n[s.value]=a.value);}return {status:e.value,value:n}}},I=Object.freeze({status:"aborted"}),Qt=t=>({status:"dirty",value:t}),$e=t=>({status:"valid",value:t}),To=t=>t.status==="aborted",Po=t=>t.status==="dirty",Ot=t=>t.status==="valid",Cr=t=>typeof Promise<"u"&&t instanceof Promise;var T;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message;})(T||(T={}));var Je=class{constructor(e,r,n,o){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=o;}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Ou=(t,e)=>{if(Ot(e))return {success:true,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return {success:false,get error(){if(this._error)return this._error;let r=new Ne(t.common.issues);return this._error=r,this._error}}};function Z(t){if(!t)return {};let{errorMap:e,invalid_type_error:r,required_error:n,description:o}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:o}:{errorMap:(a,i)=>{let{message:c}=t;return a.code==="invalid_enum_value"?{message:c??i.defaultError}:typeof i.data>"u"?{message:c??n??i.defaultError}:a.code!=="invalid_type"?{message:i.defaultError}:{message:c??r??i.defaultError}},description:o}}var q=class{get description(){return this._def.description}_getType(e){return ut(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:ut(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return {status:new ye,ctx:{common:e.parent.common,data:e.data,parsedType:ut(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(Cr(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){let n={common:{issues:[],async:r?.async??false,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ut(e)},o=this._parseSync({data:e,path:n.path,parent:n});return Ou(n,o)}"~validate"(e){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ut(e)};if(!this["~standard"].async)try{let n=this._parseSync({data:e,path:[],parent:r});return Ot(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=true),r.common={issues:[],async:true};}return this._parseAsync({data:e,path:[],parent:r}).then(n=>Ot(n)?{value:n.value}:{issues:r.common.issues})}async parseAsync(e,r){let n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:true},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ut(e)},o=this._parse({data:e,path:n.path,parent:n}),s=await(Cr(o)?o:Promise.resolve(o));return Ou(n,s)}refine(e,r){let n=o=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(o):r;return this._refinement((o,s)=>{let a=e(o),i=()=>s.addIssue({code:_.custom,...n(o)});return typeof Promise<"u"&&a instanceof Promise?a.then(c=>c?true:(i(),false)):a?true:(i(),false)})}refinement(e,r){return this._refinement((n,o)=>e(n)?true:(o.addIssue(typeof r=="function"?r(n,o):r),false))}_refinement(e){return new He({schema:this,typeName:O.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)};}optional(){return Ve.create(this,this._def)}nullable(){return dt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return wt.create(this)}promise(){return Zt.create(this,this._def)}or(e){return sr.create([this,e],this._def)}and(e){return ar.create(this,e,this._def)}transform(e){return new He({...Z(this._def),schema:this,typeName:O.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new dr({...Z(this._def),innerType:this,defaultValue:r,typeName:O.ZodDefault})}brand(){return new yn({typeName:O.ZodBranded,type:this,...Z(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new pr({...Z(this._def),innerType:this,catchValue:r,typeName:O.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return _n.create(this,e)}readonly(){return fr.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},ry=/^c[^\s-]{8,}$/i,ny=/^[0-9a-z]+$/,oy=/^[0-9A-HJKMNP-TV-Z]{26}$/i,sy=/^[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,ay=/^[a-z0-9_-]{21}$/i,iy=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,cy=/^[-+]?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)?)??$/,uy=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,ly="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",fa,dy=/^(?:(?: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])$/,py=/^(?:(?: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])$/,fy=/^(([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]))$/,my=/^(([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])$/,hy=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,gy=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Au="((\\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])))",yy=new RegExp(`^${Au}$`);function Zu(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let r=t.precision?"+":"?";return `([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function _y(t){return new RegExp(`^${Zu(t)}$`)}function Du(t){let e=`${Au}T${Zu(t)}`,r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function vy(t,e){return !!((e==="v4"||!e)&&dy.test(t)||(e==="v6"||!e)&&fy.test(t))}function ky(t,e){if(!iy.test(t))return false;try{let[r]=t.split(".");if(!r)return !1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),o=JSON.parse(atob(n));return !(typeof o!="object"||o===null||"typ"in o&&o?.typ!=="JWT"||!o.alg||e&&o.alg!==e)}catch{return false}}function xy(t,e){return !!((e==="v4"||!e)&&py.test(t)||(e==="v6"||!e)&&my.test(t))}var Nt=class t extends q{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==$.string){let s=this._getOrReturnCtx(e);return x(s,{code:_.invalid_type,expected:$.string,received:s.parsedType}),I}let n=new ye,o;for(let s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(o=this._getOrReturnCtx(e,o),x(o,{code:_.too_small,minimum:s.value,type:"string",inclusive:true,exact:false,message:s.message}),n.dirty());else if(s.kind==="max")e.data.length>s.value&&(o=this._getOrReturnCtx(e,o),x(o,{code:_.too_big,maximum:s.value,type:"string",inclusive:true,exact:false,message:s.message}),n.dirty());else if(s.kind==="length"){let a=e.data.length>s.value,i=e.data.length<s.value;(a||i)&&(o=this._getOrReturnCtx(e,o),a?x(o,{code:_.too_big,maximum:s.value,type:"string",inclusive:true,exact:true,message:s.message}):i&&x(o,{code:_.too_small,minimum:s.value,type:"string",inclusive:true,exact:true,message:s.message}),n.dirty());}else if(s.kind==="email")uy.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"email",code:_.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")fa||(fa=new RegExp(ly,"u")),fa.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"emoji",code:_.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")sy.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"uuid",code:_.invalid_string,message:s.message}),n.dirty());else if(s.kind==="nanoid")ay.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"nanoid",code:_.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")ry.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"cuid",code:_.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")ny.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"cuid2",code:_.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")oy.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"ulid",code:_.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(e.data);}catch{o=this._getOrReturnCtx(e,o),x(o,{validation:"url",code:_.invalid_string,message:s.message}),n.dirty();}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"regex",code:_.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(o=this._getOrReturnCtx(e,o),x(o,{code:_.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),n.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(o=this._getOrReturnCtx(e,o),x(o,{code:_.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(o=this._getOrReturnCtx(e,o),x(o,{code:_.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?Du(s).test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{code:_.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="date"?yy.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{code:_.invalid_string,validation:"date",message:s.message}),n.dirty()):s.kind==="time"?_y(s).test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{code:_.invalid_string,validation:"time",message:s.message}),n.dirty()):s.kind==="duration"?cy.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"duration",code:_.invalid_string,message:s.message}),n.dirty()):s.kind==="ip"?vy(e.data,s.version)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"ip",code:_.invalid_string,message:s.message}),n.dirty()):s.kind==="jwt"?ky(e.data,s.alg)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"jwt",code:_.invalid_string,message:s.message}),n.dirty()):s.kind==="cidr"?xy(e.data,s.version)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"cidr",code:_.invalid_string,message:s.message}),n.dirty()):s.kind==="base64"?hy.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"base64",code:_.invalid_string,message:s.message}),n.dirty()):s.kind==="base64url"?gy.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"base64url",code:_.invalid_string,message:s.message}),n.dirty()):V.assertNever(s);return {status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(o=>e.test(o),{validation:r,code:_.invalid_string,...T.errToObj(n)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...T.errToObj(e)})}url(e){return this._addCheck({kind:"url",...T.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...T.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...T.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...T.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...T.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...T.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...T.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...T.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...T.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...T.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...T.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...T.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:false,local:false,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??false,local:e?.local??false,...T.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...T.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...T.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...T.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...T.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...T.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...T.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...T.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...T.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...T.errToObj(r)})}nonempty(e){return this.min(1,T.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return !!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return !!this._def.checks.find(e=>e.kind==="date")}get isTime(){return !!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return !!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return !!this._def.checks.find(e=>e.kind==="email")}get isURL(){return !!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return !!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return !!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return !!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return !!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return !!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return !!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return !!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return !!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return !!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return !!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};Nt.create=t=>new Nt({checks:[],typeName:O.ZodString,coerce:t?.coerce??false,...Z(t)});function by(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,o=r>n?r:n,s=Number.parseInt(t.toFixed(o).replace(".","")),a=Number.parseInt(e.toFixed(o).replace(".",""));return s%a/10**o}var Xt=class t extends q{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf;}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==$.number){let s=this._getOrReturnCtx(e);return x(s,{code:_.invalid_type,expected:$.number,received:s.parsedType}),I}let n,o=new ye;for(let s of this._def.checks)s.kind==="int"?V.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{code:_.invalid_type,expected:"integer",received:"float",message:s.message}),o.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),x(n,{code:_.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:false,message:s.message}),o.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),x(n,{code:_.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:false,message:s.message}),o.dirty()):s.kind==="multipleOf"?by(e.data,s.value)!==0&&(n=this._getOrReturnCtx(e,n),x(n,{code:_.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{code:_.not_finite,message:s.message}),o.dirty()):V.assertNever(s);return {status:o.value,value:e.data}}gte(e,r){return this.setLimit("min",e,true,T.toString(r))}gt(e,r){return this.setLimit("min",e,false,T.toString(r))}lte(e,r){return this.setLimit("max",e,true,T.toString(r))}lt(e,r){return this.setLimit("max",e,false,T.toString(r))}setLimit(e,r,n,o){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:T.toString(o)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:T.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:false,message:T.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:false,message:T.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:true,message:T.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:true,message:T.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:T.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:T.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:true,value:Number.MIN_SAFE_INTEGER,message:T.toString(e)})._addCheck({kind:"max",inclusive:true,value:Number.MAX_SAFE_INTEGER,message:T.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return !!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&V.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return true;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);}return Number.isFinite(r)&&Number.isFinite(e)}};Xt.create=t=>new Xt({checks:[],typeName:O.ZodNumber,coerce:t?.coerce||false,...Z(t)});var er=class t extends q{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte;}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data);}catch{return this._getInvalidInput(e)}if(this._getType(e)!==$.bigint)return this._getInvalidInput(e);let n,o=new ye;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),x(n,{code:_.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),x(n,{code:_.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),x(n,{code:_.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):V.assertNever(s);return {status:o.value,value:e.data}}_getInvalidInput(e){let r=this._getOrReturnCtx(e);return x(r,{code:_.invalid_type,expected:$.bigint,received:r.parsedType}),I}gte(e,r){return this.setLimit("min",e,true,T.toString(r))}gt(e,r){return this.setLimit("min",e,false,T.toString(r))}lte(e,r){return this.setLimit("max",e,true,T.toString(r))}lt(e,r){return this.setLimit("max",e,false,T.toString(r))}setLimit(e,r,n,o){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:T.toString(o)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:false,message:T.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:false,message:T.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:true,message:T.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:true,message:T.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:T.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};er.create=t=>new er({checks:[],typeName:O.ZodBigInt,coerce:t?.coerce??false,...Z(t)});var tr=class extends q{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==$.boolean){let n=this._getOrReturnCtx(e);return x(n,{code:_.invalid_type,expected:$.boolean,received:n.parsedType}),I}return $e(e.data)}};tr.create=t=>new tr({typeName:O.ZodBoolean,coerce:t?.coerce||false,...Z(t)});var rr=class t extends q{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==$.date){let s=this._getOrReturnCtx(e);return x(s,{code:_.invalid_type,expected:$.date,received:s.parsedType}),I}if(Number.isNaN(e.data.getTime())){let s=this._getOrReturnCtx(e);return x(s,{code:_.invalid_date}),I}let n=new ye,o;for(let s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(o=this._getOrReturnCtx(e,o),x(o,{code:_.too_small,message:s.message,inclusive:true,exact:false,minimum:s.value,type:"date"}),n.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(o=this._getOrReturnCtx(e,o),x(o,{code:_.too_big,message:s.message,inclusive:true,exact:false,maximum:s.value,type:"date"}),n.dirty()):V.assertNever(s);return {status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:T.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:T.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};rr.create=t=>new rr({checks:[],coerce:t?.coerce||false,typeName:O.ZodDate,...Z(t)});var Nr=class extends q{_parse(e){if(this._getType(e)!==$.symbol){let n=this._getOrReturnCtx(e);return x(n,{code:_.invalid_type,expected:$.symbol,received:n.parsedType}),I}return $e(e.data)}};Nr.create=t=>new Nr({typeName:O.ZodSymbol,...Z(t)});var nr=class extends q{_parse(e){if(this._getType(e)!==$.undefined){let n=this._getOrReturnCtx(e);return x(n,{code:_.invalid_type,expected:$.undefined,received:n.parsedType}),I}return $e(e.data)}};nr.create=t=>new nr({typeName:O.ZodUndefined,...Z(t)});var or=class extends q{_parse(e){if(this._getType(e)!==$.null){let n=this._getOrReturnCtx(e);return x(n,{code:_.invalid_type,expected:$.null,received:n.parsedType}),I}return $e(e.data)}};or.create=t=>new or({typeName:O.ZodNull,...Z(t)});var At=class extends q{constructor(){super(...arguments),this._any=true;}_parse(e){return $e(e.data)}};At.create=t=>new At({typeName:O.ZodAny,...Z(t)});var bt=class extends q{constructor(){super(...arguments),this._unknown=true;}_parse(e){return $e(e.data)}};bt.create=t=>new bt({typeName:O.ZodUnknown,...Z(t)});var et=class extends q{_parse(e){let r=this._getOrReturnCtx(e);return x(r,{code:_.invalid_type,expected:$.never,received:r.parsedType}),I}};et.create=t=>new et({typeName:O.ZodNever,...Z(t)});var Ar=class extends q{_parse(e){if(this._getType(e)!==$.undefined){let n=this._getOrReturnCtx(e);return x(n,{code:_.invalid_type,expected:$.void,received:n.parsedType}),I}return $e(e.data)}};Ar.create=t=>new Ar({typeName:O.ZodVoid,...Z(t)});var wt=class t extends q{_parse(e){let{ctx:r,status:n}=this._processInputParams(e),o=this._def;if(r.parsedType!==$.array)return x(r,{code:_.invalid_type,expected:$.array,received:r.parsedType}),I;if(o.exactLength!==null){let a=r.data.length>o.exactLength.value,i=r.data.length<o.exactLength.value;(a||i)&&(x(r,{code:a?_.too_big:_.too_small,minimum:i?o.exactLength.value:void 0,maximum:a?o.exactLength.value:void 0,type:"array",inclusive:true,exact:true,message:o.exactLength.message}),n.dirty());}if(o.minLength!==null&&r.data.length<o.minLength.value&&(x(r,{code:_.too_small,minimum:o.minLength.value,type:"array",inclusive:true,exact:false,message:o.minLength.message}),n.dirty()),o.maxLength!==null&&r.data.length>o.maxLength.value&&(x(r,{code:_.too_big,maximum:o.maxLength.value,type:"array",inclusive:true,exact:false,message:o.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((a,i)=>o.type._parseAsync(new Je(r,a,r.path,i)))).then(a=>ye.mergeArray(n,a));let s=[...r.data].map((a,i)=>o.type._parseSync(new Je(r,a,r.path,i)));return ye.mergeArray(n,s)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:T.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:T.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:T.toString(r)}})}nonempty(e){return this.min(1,e)}};wt.create=(t,e)=>new wt({type:t,minLength:null,maxLength:null,exactLength:null,typeName:O.ZodArray,...Z(e)});function Or(t){if(t instanceof Ae){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=Ve.create(Or(n));}return new Ae({...t._def,shape:()=>e})}else return t instanceof wt?new wt({...t._def,type:Or(t.element)}):t instanceof Ve?Ve.create(Or(t.unwrap())):t instanceof dt?dt.create(Or(t.unwrap())):t instanceof lt?lt.create(t.items.map(e=>Or(e))):t}var Ae=class t extends q{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend;}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=V.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==$.object){let u=this._getOrReturnCtx(e);return x(u,{code:_.invalid_type,expected:$.object,received:u.parsedType}),I}let{status:n,ctx:o}=this._processInputParams(e),{shape:s,keys:a}=this._getCached(),i=[];if(!(this._def.catchall instanceof et&&this._def.unknownKeys==="strip"))for(let u in o.data)a.includes(u)||i.push(u);let c=[];for(let u of a){let l=s[u],d=o.data[u];c.push({key:{status:"valid",value:u},value:l._parse(new Je(o,d,o.path,u)),alwaysSet:u in o.data});}if(this._def.catchall instanceof et){let u=this._def.unknownKeys;if(u==="passthrough")for(let l of i)c.push({key:{status:"valid",value:l},value:{status:"valid",value:o.data[l]}});else if(u==="strict")i.length>0&&(x(o,{code:_.unrecognized_keys,keys:i}),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 i){let d=o.data[l];c.push({key:{status:"valid",value:l},value:u._parse(new Je(o,d,o.path,l)),alwaysSet:l in o.data});}}return o.common.async?Promise.resolve().then(async()=>{let u=[];for(let l of c){let d=await l.key,p=await l.value;u.push({key:d,value:p,alwaysSet:l.alwaysSet});}return u}).then(u=>ye.mergeObjectSync(n,u)):ye.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(e){return T.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{let o=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:T.errToObj(e).message??o}:{message:o}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:O.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let r={};for(let n of V.objectKeys(e))e[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new t({...this._def,shape:()=>r})}omit(e){let r={};for(let n of V.objectKeys(this.shape))e[n]||(r[n]=this.shape[n]);return new t({...this._def,shape:()=>r})}deepPartial(){return Or(this)}partial(e){let r={};for(let n of V.objectKeys(this.shape)){let o=this.shape[n];e&&!e[n]?r[n]=o:r[n]=o.optional();}return new t({...this._def,shape:()=>r})}required(e){let r={};for(let n of V.objectKeys(this.shape))if(e&&!e[n])r[n]=this.shape[n];else {let s=this.shape[n];for(;s instanceof Ve;)s=s._def.innerType;r[n]=s;}return new t({...this._def,shape:()=>r})}keyof(){return Mu(V.objectKeys(this.shape))}};Ae.create=(t,e)=>new Ae({shape:()=>t,unknownKeys:"strip",catchall:et.create(),typeName:O.ZodObject,...Z(e)});Ae.strictCreate=(t,e)=>new Ae({shape:()=>t,unknownKeys:"strict",catchall:et.create(),typeName:O.ZodObject,...Z(e)});Ae.lazycreate=(t,e)=>new Ae({shape:t,unknownKeys:"strip",catchall:et.create(),typeName:O.ZodObject,...Z(e)});var sr=class extends q{_parse(e){let{ctx:r}=this._processInputParams(e),n=this._def.options;function o(s){for(let i of s)if(i.result.status==="valid")return i.result;for(let i of s)if(i.result.status==="dirty")return r.common.issues.push(...i.ctx.common.issues),i.result;let a=s.map(i=>new Ne(i.ctx.common.issues));return x(r,{code:_.invalid_union,unionErrors:a}),I}if(r.common.async)return Promise.all(n.map(async s=>{let a={...r,common:{...r.common,issues:[]},parent:null};return {result:await s._parseAsync({data:r.data,path:r.path,parent:a}),ctx:a}})).then(o);{let s,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"&&!s&&(s={result:l,ctx:u}),u.common.issues.length&&a.push(u.common.issues);}if(s)return r.common.issues.push(...s.ctx.common.issues),s.result;let i=a.map(c=>new Ne(c));return x(r,{code:_.invalid_union,unionErrors:i}),I}}get options(){return this._def.options}};sr.create=(t,e)=>new sr({options:t,typeName:O.ZodUnion,...Z(e)});var xt=t=>t instanceof ir?xt(t.schema):t instanceof He?xt(t.innerType()):t instanceof cr?[t.value]:t instanceof ur?t.options:t instanceof lr?V.objectValues(t.enum):t instanceof dr?xt(t._def.innerType):t instanceof nr?[void 0]:t instanceof or?[null]:t instanceof Ve?[void 0,...xt(t.unwrap())]:t instanceof dt?[null,...xt(t.unwrap())]:t instanceof yn||t instanceof fr?xt(t.unwrap()):t instanceof pr?xt(t._def.innerType):[],Eo=class t extends q{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==$.object)return x(r,{code:_.invalid_type,expected:$.object,received:r.parsedType}),I;let n=this.discriminator,o=r.data[n],s=this.optionsMap.get(o);return s?r.common.async?s._parseAsync({data:r.data,path:r.path,parent:r}):s._parseSync({data:r.data,path:r.path,parent:r}):(x(r,{code:_.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),I)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){let o=new Map;for(let s of r){let a=xt(s.shape[e]);if(!a.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let i of a){if(o.has(i))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(i)}`);o.set(i,s);}}return new t({typeName:O.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:o,...Z(n)})}};function ma(t,e){let r=ut(t),n=ut(e);if(t===e)return {valid:true,data:t};if(r===$.object&&n===$.object){let o=V.objectKeys(e),s=V.objectKeys(t).filter(i=>o.indexOf(i)!==-1),a={...t,...e};for(let i of s){let c=ma(t[i],e[i]);if(!c.valid)return {valid:false};a[i]=c.data;}return {valid:true,data:a}}else if(r===$.array&&n===$.array){if(t.length!==e.length)return {valid:false};let o=[];for(let s=0;s<t.length;s++){let a=t[s],i=e[s],c=ma(a,i);if(!c.valid)return {valid:false};o.push(c.data);}return {valid:true,data:o}}else return r===$.date&&n===$.date&&+t==+e?{valid:true,data:t}:{valid:false}}var ar=class extends q{_parse(e){let{status:r,ctx:n}=this._processInputParams(e),o=(s,a)=>{if(To(s)||To(a))return I;let i=ma(s.value,a.value);return i.valid?((Po(s)||Po(a))&&r.dirty(),{status:r.value,value:i.data}):(x(n,{code:_.invalid_intersection_types}),I)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([s,a])=>o(s,a)):o(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};ar.create=(t,e,r)=>new ar({left:t,right:e,typeName:O.ZodIntersection,...Z(r)});var lt=class t extends q{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==$.array)return x(n,{code:_.invalid_type,expected:$.array,received:n.parsedType}),I;if(n.data.length<this._def.items.length)return x(n,{code:_.too_small,minimum:this._def.items.length,inclusive:true,exact:false,type:"array"}),I;!this._def.rest&&n.data.length>this._def.items.length&&(x(n,{code:_.too_big,maximum:this._def.items.length,inclusive:true,exact:false,type:"array"}),r.dirty());let s=[...n.data].map((a,i)=>{let c=this._def.items[i]||this._def.rest;return c?c._parse(new Je(n,a,n.path,i)):null}).filter(a=>!!a);return n.common.async?Promise.all(s).then(a=>ye.mergeArray(r,a)):ye.mergeArray(r,s)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};lt.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new lt({items:t,typeName:O.ZodTuple,rest:null,...Z(e)})};var Ro=class t extends q{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==$.object)return x(n,{code:_.invalid_type,expected:$.object,received:n.parsedType}),I;let o=[],s=this._def.keyType,a=this._def.valueType;for(let i in n.data)o.push({key:s._parse(new Je(n,i,n.path,i)),value:a._parse(new Je(n,n.data[i],n.path,i)),alwaysSet:i in n.data});return n.common.async?ye.mergeObjectAsync(r,o):ye.mergeObjectSync(r,o)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof q?new t({keyType:e,valueType:r,typeName:O.ZodRecord,...Z(n)}):new t({keyType:Nt.create(),valueType:e,typeName:O.ZodRecord,...Z(r)})}},Zr=class extends q{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==$.map)return x(n,{code:_.invalid_type,expected:$.map,received:n.parsedType}),I;let o=this._def.keyType,s=this._def.valueType,a=[...n.data.entries()].map(([i,c],u)=>({key:o._parse(new Je(n,i,n.path,[u,"key"])),value:s._parse(new Je(n,c,n.path,[u,"value"]))}));if(n.common.async){let i=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 I;(u.status==="dirty"||l.status==="dirty")&&r.dirty(),i.set(u.value,l.value);}return {status:r.value,value:i}})}else {let i=new Map;for(let c of a){let u=c.key,l=c.value;if(u.status==="aborted"||l.status==="aborted")return I;(u.status==="dirty"||l.status==="dirty")&&r.dirty(),i.set(u.value,l.value);}return {status:r.value,value:i}}}};Zr.create=(t,e,r)=>new Zr({valueType:e,keyType:t,typeName:O.ZodMap,...Z(r)});var Dr=class t extends q{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==$.set)return x(n,{code:_.invalid_type,expected:$.set,received:n.parsedType}),I;let o=this._def;o.minSize!==null&&n.data.size<o.minSize.value&&(x(n,{code:_.too_small,minimum:o.minSize.value,type:"set",inclusive:true,exact:false,message:o.minSize.message}),r.dirty()),o.maxSize!==null&&n.data.size>o.maxSize.value&&(x(n,{code:_.too_big,maximum:o.maxSize.value,type:"set",inclusive:true,exact:false,message:o.maxSize.message}),r.dirty());let s=this._def.valueType;function a(c){let u=new Set;for(let l of c){if(l.status==="aborted")return I;l.status==="dirty"&&r.dirty(),u.add(l.value);}return {status:r.value,value:u}}let i=[...n.data.values()].map((c,u)=>s._parse(new Je(n,c,n.path,u)));return n.common.async?Promise.all(i).then(c=>a(c)):a(i)}min(e,r){return new t({...this._def,minSize:{value:e,message:T.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:T.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};Dr.create=(t,e)=>new Dr({valueType:t,minSize:null,maxSize:null,typeName:O.ZodSet,...Z(e)});var Io=class t extends q{constructor(){super(...arguments),this.validate=this.implement;}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==$.function)return x(r,{code:_.invalid_type,expected:$.function,received:r.parsedType}),I;function n(i,c){return gn({data:i,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,jr(),kt].filter(u=>!!u),issueData:{code:_.invalid_arguments,argumentsError:c}})}function o(i,c){return gn({data:i,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,jr(),kt].filter(u=>!!u),issueData:{code:_.invalid_return_type,returnTypeError:c}})}let s={errorMap:r.common.contextualErrorMap},a=r.data;if(this._def.returns instanceof Zt){let i=this;return $e(async function(...c){let u=new Ne([]),l=await i._def.args.parseAsync(c,s).catch(f=>{throw u.addIssue(n(c,f)),u}),d=await Reflect.apply(a,this,l);return await i._def.returns._def.type.parseAsync(d,s).catch(f=>{throw u.addIssue(o(d,f)),u})})}else {let i=this;return $e(function(...c){let u=i._def.args.safeParse(c,s);if(!u.success)throw new Ne([n(c,u.error)]);let l=Reflect.apply(a,this,u.data),d=i._def.returns.safeParse(l,s);if(!d.success)throw new Ne([o(l,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:lt.create(e).rest(bt.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new t({args:e||lt.create([]).rest(bt.create()),returns:r||bt.create(),typeName:O.ZodFunction,...Z(n)})}},ir=class extends q{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};ir.create=(t,e)=>new ir({getter:t,typeName:O.ZodLazy,...Z(e)});var cr=class extends q{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return x(r,{received:r.data,code:_.invalid_literal,expected:this._def.value}),I}return {status:"valid",value:e.data}}get value(){return this._def.value}};cr.create=(t,e)=>new cr({value:t,typeName:O.ZodLiteral,...Z(e)});function Mu(t,e){return new ur({values:t,typeName:O.ZodEnum,...Z(e)})}var ur=class t extends q{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return x(r,{expected:V.joinValues(n),received:r.parsedType,code:_.invalid_type}),I}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let r=this._getOrReturnCtx(e),n=this._def.values;return x(r,{received:r.data,code:_.invalid_enum_value,options:n}),I}return $e(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return t.create(e,{...this._def,...r})}exclude(e,r=this._def){return t.create(this.options.filter(n=>!e.includes(n)),{...this._def,...r})}};ur.create=Mu;var lr=class extends q{_parse(e){let r=V.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==$.string&&n.parsedType!==$.number){let o=V.objectValues(r);return x(n,{expected:V.joinValues(o),received:n.parsedType,code:_.invalid_type}),I}if(this._cache||(this._cache=new Set(V.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let o=V.objectValues(r);return x(n,{received:n.data,code:_.invalid_enum_value,options:o}),I}return $e(e.data)}get enum(){return this._def.values}};lr.create=(t,e)=>new lr({values:t,typeName:O.ZodNativeEnum,...Z(e)});var Zt=class extends q{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==$.promise&&r.common.async===false)return x(r,{code:_.invalid_type,expected:$.promise,received:r.parsedType}),I;let n=r.parsedType===$.promise?r.data:Promise.resolve(r.data);return $e(n.then(o=>this._def.type.parseAsync(o,{path:r.path,errorMap:r.common.contextualErrorMap})))}};Zt.create=(t,e)=>new Zt({type:t,typeName:O.ZodPromise,...Z(e)});var He=class extends q{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===O.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),o=this._def.effect||null,s={addIssue:a=>{x(n,a),a.fatal?r.abort():r.dirty();},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),o.type==="preprocess"){let a=o.transform(n.data,s);if(n.common.async)return Promise.resolve(a).then(async i=>{if(r.value==="aborted")return I;let c=await this._def.schema._parseAsync({data:i,path:n.path,parent:n});return c.status==="aborted"?I:c.status==="dirty"?Qt(c.value):r.value==="dirty"?Qt(c.value):c});{if(r.value==="aborted")return I;let i=this._def.schema._parseSync({data:a,path:n.path,parent:n});return i.status==="aborted"?I:i.status==="dirty"?Qt(i.value):r.value==="dirty"?Qt(i.value):i}}if(o.type==="refinement"){let a=i=>{let c=o.refinement(i,s);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return i};if(n.common.async===false){let i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?I:(i.status==="dirty"&&r.dirty(),a(i.value),{status:r.value,value:i.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(i=>i.status==="aborted"?I:(i.status==="dirty"&&r.dirty(),a(i.value).then(()=>({status:r.value,value:i.value}))))}if(o.type==="transform")if(n.common.async===false){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Ot(a))return I;let i=o.transform(a.value,s);if(i instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return {status:r.value,value:i}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>Ot(a)?Promise.resolve(o.transform(a.value,s)).then(i=>({status:r.value,value:i})):I);V.assertNever(o);}};He.create=(t,e,r)=>new He({schema:t,typeName:O.ZodEffects,effect:e,...Z(r)});He.createWithPreprocess=(t,e,r)=>new He({schema:e,effect:{type:"preprocess",transform:t},typeName:O.ZodEffects,...Z(r)});var Ve=class extends q{_parse(e){return this._getType(e)===$.undefined?$e(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Ve.create=(t,e)=>new Ve({innerType:t,typeName:O.ZodOptional,...Z(e)});var dt=class extends q{_parse(e){return this._getType(e)===$.null?$e(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};dt.create=(t,e)=>new dt({innerType:t,typeName:O.ZodNullable,...Z(e)});var dr=class extends q{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===$.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};dr.create=(t,e)=>new dr({innerType:t,typeName:O.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Z(e)});var pr=class extends q{_parse(e){let{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},o=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Cr(o)?o.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Ne(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Ne(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};pr.create=(t,e)=>new pr({innerType:t,typeName:O.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Z(e)});var Mr=class extends q{_parse(e){if(this._getType(e)!==$.nan){let n=this._getOrReturnCtx(e);return x(n,{code:_.invalid_type,expected:$.nan,received:n.parsedType}),I}return {status:"valid",value:e.data}}};Mr.create=t=>new Mr({typeName:O.ZodNaN,...Z(t)});var wy=Symbol("zod_brand"),yn=class extends q{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},_n=class t extends q{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return (async()=>{let s=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?I:s.status==="dirty"?(r.dirty(),Qt(s.value)):this._def.out._parseAsync({data:s.value,path:n.path,parent:n})})();{let o=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?I:o.status==="dirty"?(r.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:n.path,parent:n})}}static create(e,r){return new t({in:e,out:r,typeName:O.ZodPipeline})}},fr=class extends q{_parse(e){let r=this._def.innerType._parse(e),n=o=>(Ot(o)&&(o.value=Object.freeze(o.value)),o);return Cr(r)?r.then(o=>n(o)):n(r)}unwrap(){return this._def.innerType}};fr.create=(t,e)=>new fr({innerType:t,typeName:O.ZodReadonly,...Z(e)});function Nu(t,e){let r=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof r=="string"?{message:r}:r}function qu(t,e={},r){return t?At.create().superRefine((n,o)=>{let s=t(n);if(s instanceof Promise)return s.then(a=>{if(!a){let i=Nu(e,n),c=i.fatal??r??true;o.addIssue({code:"custom",...i,fatal:c});}});if(!s){let a=Nu(e,n),i=a.fatal??r??true;o.addIssue({code:"custom",...a,fatal:i});}}):At.create()}var $y={object:Ae.lazycreate},O;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly";})(O||(O={}));var Sy=(t,e={message:`Input not instance of ${t.name}`})=>qu(r=>r instanceof t,e),Lu=Nt.create,Uu=Xt.create,zy=Mr.create,Ty=er.create,Fu=tr.create,Py=rr.create,Ey=Nr.create,Ry=nr.create,Iy=or.create,jy=At.create,Cy=bt.create,Oy=et.create,Ny=Ar.create,Ay=wt.create,Zy=Ae.create,Dy=Ae.strictCreate,My=sr.create,qy=Eo.create,Ly=ar.create,Uy=lt.create,Fy=Ro.create,Vy=Zr.create,Jy=Dr.create,Hy=Io.create,Gy=ir.create,By=cr.create,Ky=ur.create,Wy=lr.create,Yy=Zt.create,Qy=He.create,Xy=Ve.create,e_=dt.create,t_=He.createWithPreprocess,r_=_n.create,n_=()=>Lu().optional(),o_=()=>Uu().optional(),s_=()=>Fu().optional(),a_={string:(t=>Nt.create({...t,coerce:true})),number:(t=>Xt.create({...t,coerce:true})),boolean:(t=>tr.create({...t,coerce:true})),bigint:(t=>er.create({...t,coerce:true})),date:(t=>rr.create({...t,coerce:true}))};var i_=I;function h(t,e,r){function n(i,c){var u;Object.defineProperty(i,"_zod",{value:i._zod??{},enumerable:false}),(u=i._zod).traits??(u.traits=new Set),i._zod.traits.add(t),e(i,c);for(let l in a.prototype)l in i||Object.defineProperty(i,l,{value:a.prototype[l].bind(i)});i._zod.constr=a,i._zod.def=c;}let o=r?.Parent??Object;class s extends o{}Object.defineProperty(s,"name",{value:t});function a(i){var c;let u=r?.Parent?new s:this;n(u,i),(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:i=>r?.Parent&&i instanceof r.Parent?true:i?._zod?.traits?.has(t)}),Object.defineProperty(a,"name",{value:t}),a}var $t=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");}},jo={};function Ge(t){return t&&Object.assign(jo,t),jo}var Q={};zo(Q,{BIGINT_FORMAT_RANGES:()=>Ju,Class:()=>ga,NUMBER_FORMAT_RANGES:()=>$a,aborted:()=>hr,allowsEval:()=>xa,assert:()=>p_,assertEqual:()=>c_,assertIs:()=>l_,assertNever:()=>d_,assertNotEqual:()=>u_,assignProp:()=>ka,cached:()=>kn,captureStackTrace:()=>Oo,cleanEnum:()=>S_,cleanRegex:()=>bn,clone:()=>pt,createTransparentProxy:()=>__,defineLazy:()=>ne,esc:()=>mr,escapeRegex:()=>Dt,extend:()=>x_,finalizeIssue:()=>tt,floatSafeRemainder:()=>va,getElementAtPath:()=>f_,getEnumValues:()=>ya,getLengthableOrigin:()=>wn,getParsedType:()=>y_,getSizableOrigin:()=>Hu,isObject:()=>qr,isPlainObject:()=>Lr,issue:()=>Sa,joinValues:()=>Co,jsonStringifyReplacer:()=>_a,merge:()=>b_,normalizeParams:()=>j,nullish:()=>xn,numKeys:()=>g_,omit:()=>k_,optionalKeys:()=>wa,partial:()=>w_,pick:()=>v_,prefixIssues:()=>ft,primitiveTypes:()=>Vu,promiseAllObject:()=>m_,propertyKeyTypes:()=>ba,randomString:()=>h_,required:()=>$_,stringifyPrimitive:()=>No,unwrapMessage:()=>vn});function c_(t){return t}function u_(t){return t}function l_(t){}function d_(t){throw new Error}function p_(t){}function ya(t){let e=Object.values(t).filter(n=>typeof n=="number");return Object.entries(t).filter(([n,o])=>e.indexOf(+n)===-1).map(([n,o])=>o)}function Co(t,e="|"){return t.map(r=>No(r)).join(e)}function _a(t,e){return typeof e=="bigint"?e.toString():e}function kn(t){return {get value(){{let r=t();return Object.defineProperty(this,"value",{value:r}),r}}}}function xn(t){return t==null}function bn(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}function va(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,o=r>n?r:n,s=Number.parseInt(t.toFixed(o).replace(".","")),a=Number.parseInt(e.toFixed(o).replace(".",""));return s%a/10**o}function ne(t,e,r){Object.defineProperty(t,e,{get(){{let o=r();return t[e]=o,o}},set(o){Object.defineProperty(t,e,{value:o});},configurable:true});}function ka(t,e,r){Object.defineProperty(t,e,{value:r,writable:true,enumerable:true,configurable:true});}function f_(t,e){return e?e.reduce((r,n)=>r?.[n],t):t}function m_(t){let e=Object.keys(t),r=e.map(n=>t[n]);return Promise.all(r).then(n=>{let o={};for(let s=0;s<e.length;s++)o[e[s]]=n[s];return o})}function h_(t=10){let e="abcdefghijklmnopqrstuvwxyz",r="";for(let n=0;n<t;n++)r+=e[Math.floor(Math.random()*e.length)];return r}function mr(t){return JSON.stringify(t)}var Oo=Error.captureStackTrace?Error.captureStackTrace:(...t)=>{};function qr(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}var xa=kn(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return false;try{let t=Function;return new t(""),!0}catch{return false}});function Lr(t){if(qr(t)===false)return false;let e=t.constructor;if(e===void 0)return true;let r=e.prototype;return !(qr(r)===false||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===false)}function g_(t){let e=0;for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&e++;return e}var y_=t=>{let e=typeof t;switch(e){case "undefined":return "undefined";case "string":return "string";case "number":return Number.isNaN(t)?"nan":"number";case "boolean":return "boolean";case "function":return "function";case "bigint":return "bigint";case "symbol":return "symbol";case "object":return Array.isArray(t)?"array":t===null?"null":t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?"promise":typeof Map<"u"&&t instanceof Map?"map":typeof Set<"u"&&t instanceof Set?"set":typeof Date<"u"&&t instanceof Date?"date":typeof File<"u"&&t instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${e}`)}},ba=new Set(["string","number","symbol"]),Vu=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Dt(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function pt(t,e,r){let n=new t._zod.constr(e??t._zod.def);return (!e||r?.parent)&&(n._zod.parent=t),n}function j(t){let e=t;if(!e)return {};if(typeof e=="string")return {error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message;}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}function __(t){let e;return new Proxy({},{get(r,n,o){return e??(e=t()),Reflect.get(e,n,o)},set(r,n,o,s){return e??(e=t()),Reflect.set(e,n,o,s)},has(r,n){return e??(e=t()),Reflect.has(e,n)},deleteProperty(r,n){return e??(e=t()),Reflect.deleteProperty(e,n)},ownKeys(r){return e??(e=t()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(r,n){return e??(e=t()),Reflect.getOwnPropertyDescriptor(e,n)},defineProperty(r,n,o){return e??(e=t()),Reflect.defineProperty(e,n,o)}})}function No(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}function wa(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}var $a={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]},Ju={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function v_(t,e){let r={},n=t._zod.def;for(let o in e){if(!(o in n.shape))throw new Error(`Unrecognized key: "${o}"`);e[o]&&(r[o]=n.shape[o]);}return pt(t,{...t._zod.def,shape:r,checks:[]})}function k_(t,e){let r={...t._zod.def.shape},n=t._zod.def;for(let o in e){if(!(o in n.shape))throw new Error(`Unrecognized key: "${o}"`);e[o]&&delete r[o];}return pt(t,{...t._zod.def,shape:r,checks:[]})}function x_(t,e){if(!Lr(e))throw new Error("Invalid input to extend: expected a plain object");let r={...t._zod.def,get shape(){let n={...t._zod.def.shape,...e};return ka(this,"shape",n),n},checks:[]};return pt(t,r)}function b_(t,e){return pt(t,{...t._zod.def,get shape(){let r={...t._zod.def.shape,...e._zod.def.shape};return ka(this,"shape",r),r},catchall:e._zod.def.catchall,checks:[]})}function w_(t,e,r){let n=e._zod.def.shape,o={...n};if(r)for(let s in r){if(!(s in n))throw new Error(`Unrecognized key: "${s}"`);r[s]&&(o[s]=t?new t({type:"optional",innerType:n[s]}):n[s]);}else for(let s in n)o[s]=t?new t({type:"optional",innerType:n[s]}):n[s];return pt(e,{...e._zod.def,shape:o,checks:[]})}function $_(t,e,r){let n=e._zod.def.shape,o={...n};if(r)for(let s in r){if(!(s in o))throw new Error(`Unrecognized key: "${s}"`);r[s]&&(o[s]=new t({type:"nonoptional",innerType:n[s]}));}else for(let s in n)o[s]=new t({type:"nonoptional",innerType:n[s]});return pt(e,{...e._zod.def,shape:o,checks:[]})}function hr(t,e=0){for(let r=e;r<t.issues.length;r++)if(t.issues[r]?.continue!==true)return true;return false}function ft(t,e){return e.map(r=>{var n;return (n=r).path??(n.path=[]),r.path.unshift(t),r})}function vn(t){return typeof t=="string"?t:t?.message}function tt(t,e,r){let n={...t,path:t.path??[]};if(!t.message){let o=vn(t.inst?._zod.def?.error?.(t))??vn(e?.error?.(t))??vn(r.customError?.(t))??vn(r.localeError?.(t))??"Invalid input";n.message=o;}return delete n.inst,delete n.continue,e?.reportInput||delete n.input,n}function Hu(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}function wn(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function Sa(...t){let[e,r,n]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:n}:{...e}}function S_(t){return Object.entries(t).filter(([e,r])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}var ga=class{constructor(...e){}};var Gu=(t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:false}),Object.defineProperty(t,"issues",{value:e,enumerable:false}),Object.defineProperty(t,"message",{get(){return JSON.stringify(e,_a,2)},enumerable:true}),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:false});},Ao=h("$ZodError",Gu),za=h("$ZodError",Gu,{Parent:Error});function Bu(t,e=r=>r.message){let r={},n=[];for(let o of t.issues)o.path.length>0?(r[o.path[0]]=r[o.path[0]]||[],r[o.path[0]].push(e(o))):n.push(e(o));return {formErrors:n,fieldErrors:r}}function Ku(t,e){let r=e||function(s){return s.message},n={_errors:[]},o=s=>{for(let a of s.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(i=>o({issues:i}));else if(a.code==="invalid_key")o({issues:a.issues});else if(a.code==="invalid_element")o({issues:a.issues});else if(a.path.length===0)n._errors.push(r(a));else {let i=n,c=0;for(;c<a.path.length;){let u=a.path[c];c===a.path.length-1?(i[u]=i[u]||{_errors:[]},i[u]._errors.push(r(a))):i[u]=i[u]||{_errors:[]},i=i[u],c++;}}};return o(t),n}var Wu=t=>(e,r,n,o)=>{let s=n?Object.assign(n,{async:false}):{async:false},a=e._zod.run({value:r,issues:[]},s);if(a instanceof Promise)throw new $t;if(a.issues.length){let i=new(o?.Err??t)(a.issues.map(c=>tt(c,s,Ge())));throw Oo(i,o?.callee),i}return a.value};var Yu=t=>async(e,r,n,o)=>{let s=n?Object.assign(n,{async:true}):{async:true},a=e._zod.run({value:r,issues:[]},s);if(a instanceof Promise&&(a=await a),a.issues.length){let i=new(o?.Err??t)(a.issues.map(c=>tt(c,s,Ge())));throw Oo(i,o?.callee),i}return a.value};var Ta=t=>(e,r,n)=>{let o=n?{...n,async:false}:{async:false},s=e._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new $t;return s.issues.length?{success:false,error:new(t??Ao)(s.issues.map(a=>tt(a,o,Ge())))}:{success:true,data:s.value}},$n=Ta(za),Pa=t=>async(e,r,n)=>{let o=n?Object.assign(n,{async:true}):{async:true},s=e._zod.run({value:r,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:false,error:new t(s.issues.map(a=>tt(a,o,Ge())))}:{success:true,data:s.value}},Zo=Pa(za);var Qu=/^[cC][^\s-]{8,}$/,Xu=/^[0-9a-z]+$/,el=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,tl=/^[0-9a-vA-V]{20}$/,rl=/^[A-Za-z0-9]{27}$/,nl=/^[a-zA-Z0-9_-]{21}$/,ol=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var sl=/^([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})$/,Ea=t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/;var al=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var T_="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function il(){return new RegExp(T_,"u")}var cl=/^(?:(?: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])$/,ul=/^(([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})$/,ll=/^((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])$/,dl=/^(([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])$/,pl=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Ra=/^[A-Za-z0-9_-]*$/,fl=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/;var ml=/^\+(?:[0-9]){6,14}[0-9]$/,hl="(?:(?:\\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])))",gl=new RegExp(`^${hl}$`);function yl(t){let e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof t.precision=="number"?t.precision===-1?`${e}`:t.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${t.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function _l(t){return new RegExp(`^${yl(t)}$`)}function vl(t){let e=yl({precision:t.precision}),r=["Z"];t.local&&r.push(""),t.offset&&r.push("([+-]\\d{2}:\\d{2})");let n=`${e}(?:${r.join("|")})`;return new RegExp(`^${hl}T(?:${n})$`)}var kl=t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)};var xl=/^\d+$/,bl=/^-?\d+(?:\.\d+)?/i,wl=/true|false/i,$l=/null/i;var Sl=/^[^A-Z]*$/,zl=/^[^a-z]*$/;var Se=h("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[]);}),Tl={number:"number",bigint:"bigint",object:"date"},ja=h("$ZodCheckLessThan",(t,e)=>{Se.init(t,e);let r=Tl[typeof e.value];t._zod.onattach.push(n=>{let o=n._zod.bag,s=(e.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value<s&&(e.inclusive?o.maximum=e.value:o.exclusiveMaximum=e.value);}),t._zod.check=n=>{(e.inclusive?n.value<=e.value:n.value<e.value)||n.issues.push({origin:r,code:"too_big",maximum:e.value,input:n.value,inclusive:e.inclusive,inst:t,continue:!e.abort});};}),Ca=h("$ZodCheckGreaterThan",(t,e)=>{Se.init(t,e);let r=Tl[typeof e.value];t._zod.onattach.push(n=>{let o=n._zod.bag,s=(e.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>s&&(e.inclusive?o.minimum=e.value:o.exclusiveMinimum=e.value);}),t._zod.check=n=>{(e.inclusive?n.value>=e.value:n.value>e.value)||n.issues.push({origin:r,code:"too_small",minimum:e.value,input:n.value,inclusive:e.inclusive,inst:t,continue:!e.abort});};}),Pl=h("$ZodCheckMultipleOf",(t,e)=>{Se.init(t,e),t._zod.onattach.push(r=>{var n;(n=r._zod.bag).multipleOf??(n.multipleOf=e.value);}),t._zod.check=r=>{if(typeof r.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%e.value===BigInt(0):va(r.value,e.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:e.value,input:r.value,inst:t,continue:!e.abort});};}),El=h("$ZodCheckNumberFormat",(t,e)=>{Se.init(t,e),e.format=e.format||"float64";let r=e.format?.includes("int"),n=r?"int":"number",[o,s]=$a[e.format];t._zod.onattach.push(a=>{let i=a._zod.bag;i.format=e.format,i.minimum=o,i.maximum=s,r&&(i.pattern=xl);}),t._zod.check=a=>{let i=a.value;if(r){if(!Number.isInteger(i)){a.issues.push({expected:n,format:e.format,code:"invalid_type",input:i,inst:t});return}if(!Number.isSafeInteger(i)){i>0?a.issues.push({input:i,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,continue:!e.abort}):a.issues.push({input:i,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,continue:!e.abort});return}}i<o&&a.issues.push({origin:"number",input:i,code:"too_small",minimum:o,inclusive:true,inst:t,continue:!e.abort}),i>s&&a.issues.push({origin:"number",input:i,code:"too_big",maximum:s,inst:t});};});var Rl=h("$ZodCheckMaxLength",(t,e)=>{var r;Se.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return !xn(o)&&o.length!==void 0}),t._zod.onattach.push(n=>{let o=n._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<o&&(n._zod.bag.maximum=e.maximum);}),t._zod.check=n=>{let o=n.value;if(o.length<=e.maximum)return;let a=wn(o);n.issues.push({origin:a,code:"too_big",maximum:e.maximum,inclusive:true,input:o,inst:t,continue:!e.abort});};}),Il=h("$ZodCheckMinLength",(t,e)=>{var r;Se.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return !xn(o)&&o.length!==void 0}),t._zod.onattach.push(n=>{let o=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>o&&(n._zod.bag.minimum=e.minimum);}),t._zod.check=n=>{let o=n.value;if(o.length>=e.minimum)return;let a=wn(o);n.issues.push({origin:a,code:"too_small",minimum:e.minimum,inclusive:true,input:o,inst:t,continue:!e.abort});};}),jl=h("$ZodCheckLengthEquals",(t,e)=>{var r;Se.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return !xn(o)&&o.length!==void 0}),t._zod.onattach.push(n=>{let o=n._zod.bag;o.minimum=e.length,o.maximum=e.length,o.length=e.length;}),t._zod.check=n=>{let o=n.value,s=o.length;if(s===e.length)return;let a=wn(o),i=s>e.length;n.issues.push({origin:a,...i?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:true,exact:true,input:n.value,inst:t,continue:!e.abort});};}),Sn=h("$ZodCheckStringFormat",(t,e)=>{var r,n;Se.init(t,e),t._zod.onattach.push(o=>{let s=o._zod.bag;s.format=e.format,e.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(e.pattern));}),e.pattern?(r=t._zod).check??(r.check=o=>{e.pattern.lastIndex=0,!e.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:e.format,input:o.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort});}):(n=t._zod).check??(n.check=()=>{});}),Cl=h("$ZodCheckRegex",(t,e)=>{Sn.init(t,e),t._zod.check=r=>{e.pattern.lastIndex=0,!e.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort});};}),Ol=h("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=Sl),Sn.init(t,e);}),Nl=h("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=zl),Sn.init(t,e);}),Al=h("$ZodCheckIncludes",(t,e)=>{Se.init(t,e);let r=Dt(e.includes),n=new RegExp(typeof e.position=="number"?`^.{${e.position}}${r}`:r);e.pattern=n,t._zod.onattach.push(o=>{let s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n);}),t._zod.check=o=>{o.value.includes(e.includes,e.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:o.value,inst:t,continue:!e.abort});};}),Zl=h("$ZodCheckStartsWith",(t,e)=>{Se.init(t,e);let r=new RegExp(`^${Dt(e.prefix)}.*`);e.pattern??(e.pattern=r),t._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r);}),t._zod.check=n=>{n.value.startsWith(e.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:n.value,inst:t,continue:!e.abort});};}),Dl=h("$ZodCheckEndsWith",(t,e)=>{Se.init(t,e);let r=new RegExp(`.*${Dt(e.suffix)}$`);e.pattern??(e.pattern=r),t._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r);}),t._zod.check=n=>{n.value.endsWith(e.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:n.value,inst:t,continue:!e.abort});};});var Ml=h("$ZodCheckOverwrite",(t,e)=>{Se.init(t,e),t._zod.check=r=>{r.value=e.tx(r.value);};});var Do=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e);}indented(e){this.indent+=1,e(this),this.indent-=1;}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let n=e.split(`
9
+ `).filter(a=>a),o=Math.min(...n.map(a=>a.length-a.trimStart().length)),s=n.map(a=>a.slice(o)).map(a=>" ".repeat(this.indent*2)+a);for(let a of s)this.content.push(a);}compile(){let e=Function,r=this?.args,o=[...(this?.content??[""]).map(s=>` ${s}`)];return new e(...r,o.join(`
10
+ `))}};var Ll={major:4,minor:0,patch:0};var oe=h("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=Ll;let n=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&n.unshift(t);for(let o of n)for(let s of o._zod.onattach)s(t);if(n.length===0)(r=t._zod).deferred??(r.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse;});else {let o=(s,a,i)=>{let c=hr(s),u;for(let l of a){if(l._zod.def.when){if(!l._zod.def.when(s))continue}else if(c)continue;let d=s.issues.length,p=l._zod.check(s);if(p instanceof Promise&&i?.async===false)throw new $t;if(u||p instanceof Promise)u=(u??Promise.resolve()).then(async()=>{await p,s.issues.length!==d&&(c||(c=hr(s,d)));});else {if(s.issues.length===d)continue;c||(c=hr(s,d));}}return u?u.then(()=>s):s};t._zod.run=(s,a)=>{let i=t._zod.parse(s,a);if(i instanceof Promise){if(a.async===false)throw new $t;return i.then(c=>o(c,n,a))}return o(i,n,a)};}t["~standard"]={validate:o=>{try{let s=$n(t,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return Zo(t,o).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1};}),qo=h("$ZodString",(t,e)=>{oe.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??kl(t._zod.bag),t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=String(r.value);}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:t}),r};}),ae=h("$ZodStringFormat",(t,e)=>{Sn.init(t,e),qo.init(t,e);}),Yl=h("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=sl),ae.init(t,e);}),Ql=h("$ZodUUID",(t,e)=>{if(e.version){let n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(n===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=Ea(n));}else e.pattern??(e.pattern=Ea());ae.init(t,e);}),Xl=h("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=al),ae.init(t,e);}),ed=h("$ZodURL",(t,e)=>{ae.init(t,e),t._zod.check=r=>{try{let n=r.value,o=new URL(n),s=o.href;e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(o.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:fl.source,input:r.value,inst:t,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:r.value,inst:t,continue:!e.abort})),!n.endsWith("/")&&s.endsWith("/")?r.value=s.slice(0,-1):r.value=s;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:t,continue:!e.abort});}};}),td=h("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=il()),ae.init(t,e);}),rd=h("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=nl),ae.init(t,e);}),nd=h("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=Qu),ae.init(t,e);}),od=h("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=Xu),ae.init(t,e);}),sd=h("$ZodULID",(t,e)=>{e.pattern??(e.pattern=el),ae.init(t,e);}),ad=h("$ZodXID",(t,e)=>{e.pattern??(e.pattern=tl),ae.init(t,e);}),id=h("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=rl),ae.init(t,e);}),cd=h("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=vl(e)),ae.init(t,e);}),ud=h("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=gl),ae.init(t,e);}),ld=h("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=_l(e)),ae.init(t,e);}),dd=h("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=ol),ae.init(t,e);}),pd=h("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=cl),ae.init(t,e),t._zod.onattach.push(r=>{let n=r._zod.bag;n.format="ipv4";});}),fd=h("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=ul),ae.init(t,e),t._zod.onattach.push(r=>{let n=r._zod.bag;n.format="ipv6";}),t._zod.check=r=>{try{new URL(`http://[${r.value}]`);}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:t,continue:!e.abort});}};}),md=h("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=ll),ae.init(t,e);}),hd=h("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=dl),ae.init(t,e),t._zod.check=r=>{let[n,o]=r.value.split("/");try{if(!o)throw new Error;let s=Number(o);if(`${s}`!==o)throw new Error;if(s<0||s>128)throw new Error;new URL(`http://[${n}]`);}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:t,continue:!e.abort});}};});function gd(t){if(t==="")return true;if(t.length%4!==0)return false;try{return atob(t),!0}catch{return false}}var yd=h("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=pl),ae.init(t,e),t._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64";}),t._zod.check=r=>{gd(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:t,continue:!e.abort});};});function P_(t){if(!Ra.test(t))return false;let e=t.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=");return gd(r)}var _d=h("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=Ra),ae.init(t,e),t._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64url";}),t._zod.check=r=>{P_(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:t,continue:!e.abort});};}),vd=h("$ZodE164",(t,e)=>{e.pattern??(e.pattern=ml),ae.init(t,e);});function E_(t,e=null){try{let r=t.split(".");if(r.length!==3)return !1;let[n]=r;if(!n)return !1;let o=JSON.parse(atob(n));return !("typ"in o&&o?.typ!=="JWT"||!o.alg||e&&(!("alg"in o)||o.alg!==e))}catch{return false}}var kd=h("$ZodJWT",(t,e)=>{ae.init(t,e),t._zod.check=r=>{E_(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:t,continue:!e.abort});};});var Na=h("$ZodNumber",(t,e)=>{oe.init(t,e),t._zod.pattern=t._zod.bag.pattern??bl,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=Number(r.value);}catch{}let o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;let s=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:t,...s?{received:s}:{}}),r};}),xd=h("$ZodNumber",(t,e)=>{El.init(t,e),Na.init(t,e);}),bd=h("$ZodBoolean",(t,e)=>{oe.init(t,e),t._zod.pattern=wl,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=!!r.value;}catch{}let o=r.value;return typeof o=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:t}),r};});var wd=h("$ZodNull",(t,e)=>{oe.init(t,e),t._zod.pattern=$l,t._zod.values=new Set([null]),t._zod.parse=(r,n)=>{let o=r.value;return o===null||r.issues.push({expected:"null",code:"invalid_type",input:o,inst:t}),r};});var $d=h("$ZodUnknown",(t,e)=>{oe.init(t,e),t._zod.parse=r=>r;}),Sd=h("$ZodNever",(t,e)=>{oe.init(t,e),t._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:t}),r);});function Ul(t,e,r){t.issues.length&&e.issues.push(...ft(r,t.issues)),e.value[r]=t.value;}var zd=h("$ZodArray",(t,e)=>{oe.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:t}),r;r.value=Array(o.length);let s=[];for(let a=0;a<o.length;a++){let i=o[a],c=e.element._zod.run({value:i,issues:[]},n);c instanceof Promise?s.push(c.then(u=>Ul(u,r,a))):Ul(c,r,a);}return s.length?Promise.all(s).then(()=>r):r};});function Mo(t,e,r){t.issues.length&&e.issues.push(...ft(r,t.issues)),e.value[r]=t.value;}function Fl(t,e,r,n){t.issues.length?n[r]===void 0?r in n?e.value[r]=void 0:e.value[r]=t.value:e.issues.push(...ft(r,t.issues)):t.value===void 0?r in n&&(e.value[r]=void 0):e.value[r]=t.value;}var Td=h("$ZodObject",(t,e)=>{oe.init(t,e);let r=kn(()=>{let d=Object.keys(e.shape);for(let f of d)if(!(e.shape[f]instanceof oe))throw new Error(`Invalid element at key "${f}": expected a Zod schema`);let p=wa(e.shape);return {shape:e.shape,keys:d,keySet:new Set(d),numKeys:d.length,optionalKeys:new Set(p)}});ne(t._zod,"propValues",()=>{let d=e.shape,p={};for(let f in d){let g=d[f]._zod;if(g.values){p[f]??(p[f]=new Set);for(let y of g.values)p[f].add(y);}}return p});let n=d=>{let p=new Do(["shape","payload","ctx"]),f=r.value,g=S=>{let b=mr(S);return `shape[${b}]._zod.run({ value: input[${b}], issues: [] }, ctx)`};p.write("const input = payload.value;");let y=Object.create(null),v=0;for(let S of f.keys)y[S]=`key_${v++}`;p.write("const newResult = {}");for(let S of f.keys)if(f.optionalKeys.has(S)){let b=y[S];p.write(`const ${b} = ${g(S)};`);let R=mr(S);p.write(`
11
+ if (${b}.issues.length) {
12
+ if (input[${R}] === undefined) {
13
+ if (${R} in input) {
14
+ newResult[${R}] = undefined;
15
+ }
16
+ } else {
17
+ payload.issues = payload.issues.concat(
18
+ ${b}.issues.map((iss) => ({
19
+ ...iss,
20
+ path: iss.path ? [${R}, ...iss.path] : [${R}],
21
+ }))
22
+ );
23
+ }
24
+ } else if (${b}.value === undefined) {
25
+ if (${R} in input) newResult[${R}] = undefined;
26
+ } else {
27
+ newResult[${R}] = ${b}.value;
28
+ }
29
+ `);}else {let b=y[S];p.write(`const ${b} = ${g(S)};`),p.write(`
30
+ if (${b}.issues.length) payload.issues = payload.issues.concat(${b}.issues.map(iss => ({
31
+ ...iss,
32
+ path: iss.path ? [${mr(S)}, ...iss.path] : [${mr(S)}]
33
+ })));`),p.write(`newResult[${mr(S)}] = ${b}.value`);}p.write("payload.value = newResult;"),p.write("return payload;");let k=p.compile();return (S,b)=>k(d,S,b)},o,s=qr,a=!jo.jitless,c=a&&xa.value,u=e.catchall,l;t._zod.parse=(d,p)=>{l??(l=r.value);let f=d.value;if(!s(f))return d.issues.push({expected:"object",code:"invalid_type",input:f,inst:t}),d;let g=[];if(a&&c&&p?.async===false&&p.jitless!==true)o||(o=n(e.shape)),d=o(d,p);else {d.value={};let b=l.shape;for(let R of l.keys){let C=b[R],Ie=C._zod.run({value:f[R],issues:[]},p),Fe=C._zod.optin==="optional"&&C._zod.optout==="optional";Ie instanceof Promise?g.push(Ie.then(Ir=>Fe?Fl(Ir,d,R,f):Mo(Ir,d,R))):Fe?Fl(Ie,d,R,f):Mo(Ie,d,R);}}if(!u)return g.length?Promise.all(g).then(()=>d):d;let y=[],v=l.keySet,k=u._zod,S=k.def.type;for(let b of Object.keys(f)){if(v.has(b))continue;if(S==="never"){y.push(b);continue}let R=k.run({value:f[b],issues:[]},p);R instanceof Promise?g.push(R.then(C=>Mo(C,d,b))):Mo(R,d,b);}return y.length&&d.issues.push({code:"unrecognized_keys",keys:y,input:f,inst:t}),g.length?Promise.all(g).then(()=>d):d};});function Vl(t,e,r,n){for(let o of t)if(o.issues.length===0)return e.value=o.value,e;return e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(o=>o.issues.map(s=>tt(s,n,Ge())))}),e}var Aa=h("$ZodUnion",(t,e)=>{oe.init(t,e),ne(t._zod,"optin",()=>e.options.some(r=>r._zod.optin==="optional")?"optional":void 0),ne(t._zod,"optout",()=>e.options.some(r=>r._zod.optout==="optional")?"optional":void 0),ne(t._zod,"values",()=>{if(e.options.every(r=>r._zod.values))return new Set(e.options.flatMap(r=>Array.from(r._zod.values)))}),ne(t._zod,"pattern",()=>{if(e.options.every(r=>r._zod.pattern)){let r=e.options.map(n=>n._zod.pattern);return new RegExp(`^(${r.map(n=>bn(n.source)).join("|")})$`)}}),t._zod.parse=(r,n)=>{let o=false,s=[];for(let a of e.options){let i=a._zod.run({value:r.value,issues:[]},n);if(i instanceof Promise)s.push(i),o=true;else {if(i.issues.length===0)return i;s.push(i);}}return o?Promise.all(s).then(a=>Vl(a,r,t,n)):Vl(s,r,t,n)};}),Pd=h("$ZodDiscriminatedUnion",(t,e)=>{Aa.init(t,e);let r=t._zod.parse;ne(t._zod,"propValues",()=>{let o={};for(let s of e.options){let a=s._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(let[i,c]of Object.entries(a)){o[i]||(o[i]=new Set);for(let u of c)o[i].add(u);}}return o});let n=kn(()=>{let o=e.options,s=new Map;for(let a of o){let i=a._zod.propValues[e.discriminator];if(!i||i.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(a)}"`);for(let c of i){if(s.has(c))throw new Error(`Duplicate discriminator value "${String(c)}"`);s.set(c,a);}}return s});t._zod.parse=(o,s)=>{let a=o.value;if(!qr(a))return o.issues.push({code:"invalid_type",expected:"object",input:a,inst:t}),o;let i=n.value.get(a?.[e.discriminator]);return i?i._zod.run(o,s):e.unionFallback?r(o,s):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:a,path:[e.discriminator],inst:t}),o)};}),Ed=h("$ZodIntersection",(t,e)=>{oe.init(t,e),t._zod.parse=(r,n)=>{let o=r.value,s=e.left._zod.run({value:o,issues:[]},n),a=e.right._zod.run({value:o,issues:[]},n);return s instanceof Promise||a instanceof Promise?Promise.all([s,a]).then(([c,u])=>Jl(r,c,u)):Jl(r,s,a)};});function Oa(t,e){if(t===e)return {valid:true,data:t};if(t instanceof Date&&e instanceof Date&&+t==+e)return {valid:true,data:t};if(Lr(t)&&Lr(e)){let r=Object.keys(e),n=Object.keys(t).filter(s=>r.indexOf(s)!==-1),o={...t,...e};for(let s of n){let a=Oa(t[s],e[s]);if(!a.valid)return {valid:false,mergeErrorPath:[s,...a.mergeErrorPath]};o[s]=a.data;}return {valid:true,data:o}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return {valid:false,mergeErrorPath:[]};let r=[];for(let n=0;n<t.length;n++){let o=t[n],s=e[n],a=Oa(o,s);if(!a.valid)return {valid:false,mergeErrorPath:[n,...a.mergeErrorPath]};r.push(a.data);}return {valid:true,data:r}}return {valid:false,mergeErrorPath:[]}}function Jl(t,e,r){if(e.issues.length&&t.issues.push(...e.issues),r.issues.length&&t.issues.push(...r.issues),hr(t))return t;let n=Oa(e.value,r.value);if(!n.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(n.mergeErrorPath)}`);return t.value=n.data,t}var Rd=h("$ZodRecord",(t,e)=>{oe.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!Lr(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:t}),r;let s=[];if(e.keyType._zod.values){let a=e.keyType._zod.values;r.value={};for(let c of a)if(typeof c=="string"||typeof c=="number"||typeof c=="symbol"){let u=e.valueType._zod.run({value:o[c],issues:[]},n);u instanceof Promise?s.push(u.then(l=>{l.issues.length&&r.issues.push(...ft(c,l.issues)),r.value[c]=l.value;})):(u.issues.length&&r.issues.push(...ft(c,u.issues)),r.value[c]=u.value);}let i;for(let c in o)a.has(c)||(i=i??[],i.push(c));i&&i.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:t,keys:i});}else {r.value={};for(let a of Reflect.ownKeys(o)){if(a==="__proto__")continue;let i=e.keyType._zod.run({value:a,issues:[]},n);if(i instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(i.issues.length){r.issues.push({origin:"record",code:"invalid_key",issues:i.issues.map(u=>tt(u,n,Ge())),input:a,path:[a],inst:t}),r.value[i.value]=i.value;continue}let c=e.valueType._zod.run({value:o[a],issues:[]},n);c instanceof Promise?s.push(c.then(u=>{u.issues.length&&r.issues.push(...ft(a,u.issues)),r.value[i.value]=u.value;})):(c.issues.length&&r.issues.push(...ft(a,c.issues)),r.value[i.value]=c.value);}}return s.length?Promise.all(s).then(()=>r):r};});var Id=h("$ZodEnum",(t,e)=>{oe.init(t,e);let r=ya(e.entries);t._zod.values=new Set(r),t._zod.pattern=new RegExp(`^(${r.filter(n=>ba.has(typeof n)).map(n=>typeof n=="string"?Dt(n):n.toString()).join("|")})$`),t._zod.parse=(n,o)=>{let s=n.value;return t._zod.values.has(s)||n.issues.push({code:"invalid_value",values:r,input:s,inst:t}),n};}),jd=h("$ZodLiteral",(t,e)=>{oe.init(t,e),t._zod.values=new Set(e.values),t._zod.pattern=new RegExp(`^(${e.values.map(r=>typeof r=="string"?Dt(r):r?r.toString():String(r)).join("|")})$`),t._zod.parse=(r,n)=>{let o=r.value;return t._zod.values.has(o)||r.issues.push({code:"invalid_value",values:e.values,input:o,inst:t}),r};});var Cd=h("$ZodTransform",(t,e)=>{oe.init(t,e),t._zod.parse=(r,n)=>{let o=e.transform(r.value,r);if(n.async)return (o instanceof Promise?o:Promise.resolve(o)).then(a=>(r.value=a,r));if(o instanceof Promise)throw new $t;return r.value=o,r};}),Od=h("$ZodOptional",(t,e)=>{oe.init(t,e),t._zod.optin="optional",t._zod.optout="optional",ne(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),ne(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${bn(r.source)})?$`):void 0}),t._zod.parse=(r,n)=>e.innerType._zod.optin==="optional"?e.innerType._zod.run(r,n):r.value===void 0?r:e.innerType._zod.run(r,n);}),Nd=h("$ZodNullable",(t,e)=>{oe.init(t,e),ne(t._zod,"optin",()=>e.innerType._zod.optin),ne(t._zod,"optout",()=>e.innerType._zod.optout),ne(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${bn(r.source)}|null)$`):void 0}),ne(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),t._zod.parse=(r,n)=>r.value===null?r:e.innerType._zod.run(r,n);}),Ad=h("$ZodDefault",(t,e)=>{oe.init(t,e),t._zod.optin="optional",ne(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>{if(r.value===void 0)return r.value=e.defaultValue,r;let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>Hl(s,e)):Hl(o,e)};});function Hl(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}var Zd=h("$ZodPrefault",(t,e)=>{oe.init(t,e),t._zod.optin="optional",ne(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>(r.value===void 0&&(r.value=e.defaultValue),e.innerType._zod.run(r,n));}),Dd=h("$ZodNonOptional",(t,e)=>{oe.init(t,e),ne(t._zod,"values",()=>{let r=e.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),t._zod.parse=(r,n)=>{let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>Gl(s,t)):Gl(o,t)};});function Gl(t,e){return !t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:e}),t}var Md=h("$ZodCatch",(t,e)=>{oe.init(t,e),t._zod.optin="optional",ne(t._zod,"optout",()=>e.innerType._zod.optout),ne(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>{let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>(r.value=s.value,s.issues.length&&(r.value=e.catchValue({...r,error:{issues:s.issues.map(a=>tt(a,n,Ge()))},input:r.value}),r.issues=[]),r)):(r.value=o.value,o.issues.length&&(r.value=e.catchValue({...r,error:{issues:o.issues.map(s=>tt(s,n,Ge()))},input:r.value}),r.issues=[]),r)};});var qd=h("$ZodPipe",(t,e)=>{oe.init(t,e),ne(t._zod,"values",()=>e.in._zod.values),ne(t._zod,"optin",()=>e.in._zod.optin),ne(t._zod,"optout",()=>e.out._zod.optout),t._zod.parse=(r,n)=>{let o=e.in._zod.run(r,n);return o instanceof Promise?o.then(s=>Bl(s,e,n)):Bl(o,e,n)};});function Bl(t,e,r){return hr(t)?t:e.out._zod.run({value:t.value,issues:t.issues},r)}var Ld=h("$ZodReadonly",(t,e)=>{oe.init(t,e),ne(t._zod,"propValues",()=>e.innerType._zod.propValues),ne(t._zod,"values",()=>e.innerType._zod.values),ne(t._zod,"optin",()=>e.innerType._zod.optin),ne(t._zod,"optout",()=>e.innerType._zod.optout),t._zod.parse=(r,n)=>{let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(Kl):Kl(o)};});function Kl(t){return t.value=Object.freeze(t.value),t}var Ud=h("$ZodCustom",(t,e)=>{Se.init(t,e),oe.init(t,e),t._zod.parse=(r,n)=>r,t._zod.check=r=>{let n=r.value,o=e.fn(n);if(o instanceof Promise)return o.then(s=>Wl(s,r,n,t));Wl(o,r,n,t);};});function Wl(t,e,r,n){if(!t){let o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),e.issues.push(Sa(o));}}var R_=t=>{let e=typeof t;switch(e){case "number":return Number.isNaN(t)?"NaN":"number";case "object":{if(Array.isArray(t))return "array";if(t===null)return "null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return e},I_=()=>{let t={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"}};function e(n){return t[n]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",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"};return n=>{switch(n.code){case "invalid_type":return `Invalid input: expected ${n.expected}, received ${R_(n.input)}`;case "invalid_value":return n.values.length===1?`Invalid input: expected ${No(n.values[0])}`:`Invalid option: expected one of ${Co(n.values,"|")}`;case "too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Too big: expected ${n.origin??"value"} to have ${o}${n.maximum.toString()} ${s.unit??"elements"}`:`Too big: expected ${n.origin??"value"} to be ${o}${n.maximum.toString()}`}case "too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Too small: expected ${n.origin} to have ${o}${n.minimum.toString()} ${s.unit}`:`Too small: expected ${n.origin} to be ${o}${n.minimum.toString()}`}case "invalid_format":{let o=n;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]??n.format}`}case "not_multiple_of":return `Invalid number: must be a multiple of ${n.divisor}`;case "unrecognized_keys":return `Unrecognized key${n.keys.length>1?"s":""}: ${Co(n.keys,", ")}`;case "invalid_key":return `Invalid key in ${n.origin}`;case "invalid_union":return "Invalid input";case "invalid_element":return `Invalid value in ${n.origin}`;default:return "Invalid input"}}};function Fd(){return {localeError:I_()}}var Za=class{constructor(){this._map=new Map,this._idmap=new Map;}add(e,...r){let n=r[0];if(this._map.set(e,n),n&&typeof n=="object"&&"id"in n){if(this._idmap.has(n.id))throw new Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,e);}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(e){let r=this._map.get(e);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(e),this}get(e){let r=e._zod.parent;if(r){let n={...this.get(r)??{}};return delete n.id,{...n,...this._map.get(e)}}return this._map.get(e)}has(e){return this._map.has(e)}};function j_(){return new Za}var zn=j_();function Vd(t,e){return new t({type:"string",...j(e)})}function Jd(t,e){return new t({type:"string",format:"email",check:"string_format",abort:false,...j(e)})}function Da(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:false,...j(e)})}function Hd(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:false,...j(e)})}function Gd(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:false,version:"v4",...j(e)})}function Bd(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:false,version:"v6",...j(e)})}function Kd(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:false,version:"v7",...j(e)})}function Wd(t,e){return new t({type:"string",format:"url",check:"string_format",abort:false,...j(e)})}function Yd(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:false,...j(e)})}function Qd(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:false,...j(e)})}function Xd(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:false,...j(e)})}function ep(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:false,...j(e)})}function tp(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:false,...j(e)})}function rp(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:false,...j(e)})}function np(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:false,...j(e)})}function op(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:false,...j(e)})}function sp(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:false,...j(e)})}function ap(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:false,...j(e)})}function ip(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:false,...j(e)})}function cp(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:false,...j(e)})}function up(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:false,...j(e)})}function lp(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:false,...j(e)})}function dp(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:false,...j(e)})}function pp(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:false,local:false,precision:null,...j(e)})}function fp(t,e){return new t({type:"string",format:"date",check:"string_format",...j(e)})}function mp(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...j(e)})}function hp(t,e){return new t({type:"string",format:"duration",check:"string_format",...j(e)})}function gp(t,e){return new t({type:"number",checks:[],...j(e)})}function yp(t,e){return new t({type:"number",check:"number_format",abort:false,format:"safeint",...j(e)})}function _p(t,e){return new t({type:"boolean",...j(e)})}function vp(t,e){return new t({type:"null",...j(e)})}function kp(t){return new t({type:"unknown"})}function xp(t,e){return new t({type:"never",...j(e)})}function Lo(t,e){return new ja({check:"less_than",...j(e),value:t,inclusive:false})}function Tn(t,e){return new ja({check:"less_than",...j(e),value:t,inclusive:true})}function Uo(t,e){return new Ca({check:"greater_than",...j(e),value:t,inclusive:false})}function Pn(t,e){return new Ca({check:"greater_than",...j(e),value:t,inclusive:true})}function Fo(t,e){return new Pl({check:"multiple_of",...j(e),value:t})}function Vo(t,e){return new Rl({check:"max_length",...j(e),maximum:t})}function Ur(t,e){return new Il({check:"min_length",...j(e),minimum:t})}function Jo(t,e){return new jl({check:"length_equals",...j(e),length:t})}function Ma(t,e){return new Cl({check:"string_format",format:"regex",...j(e),pattern:t})}function qa(t){return new Ol({check:"string_format",format:"lowercase",...j(t)})}function La(t){return new Nl({check:"string_format",format:"uppercase",...j(t)})}function Ua(t,e){return new Al({check:"string_format",format:"includes",...j(e),includes:t})}function Fa(t,e){return new Zl({check:"string_format",format:"starts_with",...j(e),prefix:t})}function Va(t,e){return new Dl({check:"string_format",format:"ends_with",...j(e),suffix:t})}function gr(t){return new Ml({check:"overwrite",tx:t})}function Ja(t){return gr(e=>e.normalize(t))}function Ha(){return gr(t=>t.trim())}function Ga(){return gr(t=>t.toLowerCase())}function Ba(){return gr(t=>t.toUpperCase())}function bp(t,e,r){return new t({type:"array",element:e,...j(r)})}function wp(t,e,r){let n=j(r);return n.abort??(n.abort=true),new t({type:"custom",check:"custom",fn:e,...n})}function $p(t,e,r){return new t({type:"custom",check:"custom",fn:e,...j(r)})}function Fr(t){return !!t._zod}function Mt(t,e){return Fr(t)?$n(t,e):t.safeParse(e)}function Ho(t){if(!t)return;let e;if(Fr(t)?e=t._zod?.def?.shape:e=t.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function Sp(t){if(Fr(t)){let s=t._zod?.def;if(s){if(s.value!==void 0)return s.value;if(Array.isArray(s.values)&&s.values.length>0)return s.values[0]}}let r=t._def;if(r){if(r.value!==void 0)return r.value;if(Array.isArray(r.values)&&r.values.length>0)return r.values[0]}let n=t.value;if(n!==void 0)return n}var Rn={};zo(Rn,{ZodISODate:()=>Tp,ZodISODateTime:()=>zp,ZodISODuration:()=>Ep,ZodISOTime:()=>Pp,date:()=>Wa,datetime:()=>Ka,duration:()=>Qa,time:()=>Ya});var zp=h("ZodISODateTime",(t,e)=>{cd.init(t,e),le.init(t,e);});function Ka(t){return pp(zp,t)}var Tp=h("ZodISODate",(t,e)=>{ud.init(t,e),le.init(t,e);});function Wa(t){return fp(Tp,t)}var Pp=h("ZodISOTime",(t,e)=>{ld.init(t,e),le.init(t,e);});function Ya(t){return mp(Pp,t)}var Ep=h("ZodISODuration",(t,e)=>{dd.init(t,e),le.init(t,e);});function Qa(t){return hp(Ep,t)}var Rp=(t,e)=>{Ao.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:r=>Ku(t,r)},flatten:{value:r=>Bu(t,r)},addIssue:{value:r=>t.issues.push(r)},addIssues:{value:r=>t.issues.push(...r)},isEmpty:{get(){return t.issues.length===0}}});};h("ZodError",Rp);var In=h("ZodError",Rp,{Parent:Error});var Ip=Wu(In),jp=Yu(In),Cp=Ta(In),Op=Pa(In);var fe=h("ZodType",(t,e)=>(oe.init(t,e),t.def=e,Object.defineProperty(t,"_def",{value:e}),t.check=(...r)=>t.clone({...e,checks:[...e.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),t.clone=(r,n)=>pt(t,r,n),t.brand=()=>t,t.register=((r,n)=>(r.add(t,n),t)),t.parse=(r,n)=>Ip(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>Cp(t,r,n),t.parseAsync=async(r,n)=>jp(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>Op(t,r,n),t.spa=t.safeParseAsync,t.refine=(r,n)=>t.check(Ev(r,n)),t.superRefine=r=>t.check(Rv(r)),t.overwrite=r=>t.check(gr(r)),t.optional=()=>pe(t),t.nullable=()=>Zp(t),t.nullish=()=>pe(Zp(t)),t.nonoptional=r=>bv(t,r),t.array=()=>G(t),t.or=r=>ie([t,r]),t.and=r=>Bo(t,r),t.transform=r=>ei(t,Fp(r)),t.default=r=>vv(t,r),t.prefault=r=>xv(t,r),t.catch=r=>$v(t,r),t.pipe=r=>ei(t,r),t.readonly=()=>Tv(t),t.describe=r=>{let n=t.clone();return zn.add(n,{description:r}),n},Object.defineProperty(t,"description",{get(){return zn.get(t)?.description},configurable:true}),t.meta=(...r)=>{if(r.length===0)return zn.get(t);let n=t.clone();return zn.add(n,r[0]),n},t.isOptional=()=>t.safeParse(void 0).success,t.isNullable=()=>t.safeParse(null).success,t)),Dp=h("_ZodString",(t,e)=>{qo.init(t,e),fe.init(t,e);let r=t._zod.bag;t.format=r.format??null,t.minLength=r.minimum??null,t.maxLength=r.maximum??null,t.regex=(...n)=>t.check(Ma(...n)),t.includes=(...n)=>t.check(Ua(...n)),t.startsWith=(...n)=>t.check(Fa(...n)),t.endsWith=(...n)=>t.check(Va(...n)),t.min=(...n)=>t.check(Ur(...n)),t.max=(...n)=>t.check(Vo(...n)),t.length=(...n)=>t.check(Jo(...n)),t.nonempty=(...n)=>t.check(Ur(1,...n)),t.lowercase=n=>t.check(qa(n)),t.uppercase=n=>t.check(La(n)),t.trim=()=>t.check(Ha()),t.normalize=(...n)=>t.check(Ja(...n)),t.toLowerCase=()=>t.check(Ga()),t.toUpperCase=()=>t.check(Ba());}),L_=h("ZodString",(t,e)=>{qo.init(t,e),Dp.init(t,e),t.email=r=>t.check(Jd(U_,r)),t.url=r=>t.check(Wd(F_,r)),t.jwt=r=>t.check(dp(ov,r)),t.emoji=r=>t.check(Yd(V_,r)),t.guid=r=>t.check(Da(Np,r)),t.uuid=r=>t.check(Hd(Go,r)),t.uuidv4=r=>t.check(Gd(Go,r)),t.uuidv6=r=>t.check(Bd(Go,r)),t.uuidv7=r=>t.check(Kd(Go,r)),t.nanoid=r=>t.check(Qd(J_,r)),t.guid=r=>t.check(Da(Np,r)),t.cuid=r=>t.check(Xd(H_,r)),t.cuid2=r=>t.check(ep(G_,r)),t.ulid=r=>t.check(tp(B_,r)),t.base64=r=>t.check(cp(tv,r)),t.base64url=r=>t.check(up(rv,r)),t.xid=r=>t.check(rp(K_,r)),t.ksuid=r=>t.check(np(W_,r)),t.ipv4=r=>t.check(op(Y_,r)),t.ipv6=r=>t.check(sp(Q_,r)),t.cidrv4=r=>t.check(ap(X_,r)),t.cidrv6=r=>t.check(ip(ev,r)),t.e164=r=>t.check(lp(nv,r)),t.datetime=r=>t.check(Ka(r)),t.date=r=>t.check(Wa(r)),t.time=r=>t.check(Ya(r)),t.duration=r=>t.check(Qa(r));});function m(t){return Vd(L_,t)}var le=h("ZodStringFormat",(t,e)=>{ae.init(t,e),Dp.init(t,e);}),U_=h("ZodEmail",(t,e)=>{Xl.init(t,e),le.init(t,e);});var Np=h("ZodGUID",(t,e)=>{Yl.init(t,e),le.init(t,e);});var Go=h("ZodUUID",(t,e)=>{Ql.init(t,e),le.init(t,e);});var F_=h("ZodURL",(t,e)=>{ed.init(t,e),le.init(t,e);});var V_=h("ZodEmoji",(t,e)=>{td.init(t,e),le.init(t,e);});var J_=h("ZodNanoID",(t,e)=>{rd.init(t,e),le.init(t,e);});var H_=h("ZodCUID",(t,e)=>{nd.init(t,e),le.init(t,e);});var G_=h("ZodCUID2",(t,e)=>{od.init(t,e),le.init(t,e);});var B_=h("ZodULID",(t,e)=>{sd.init(t,e),le.init(t,e);});var K_=h("ZodXID",(t,e)=>{ad.init(t,e),le.init(t,e);});var W_=h("ZodKSUID",(t,e)=>{id.init(t,e),le.init(t,e);});var Y_=h("ZodIPv4",(t,e)=>{pd.init(t,e),le.init(t,e);});var Q_=h("ZodIPv6",(t,e)=>{fd.init(t,e),le.init(t,e);});var X_=h("ZodCIDRv4",(t,e)=>{md.init(t,e),le.init(t,e);});var ev=h("ZodCIDRv6",(t,e)=>{hd.init(t,e),le.init(t,e);});var tv=h("ZodBase64",(t,e)=>{yd.init(t,e),le.init(t,e);});var rv=h("ZodBase64URL",(t,e)=>{_d.init(t,e),le.init(t,e);});var nv=h("ZodE164",(t,e)=>{vd.init(t,e),le.init(t,e);});var ov=h("ZodJWT",(t,e)=>{kd.init(t,e),le.init(t,e);});var Mp=h("ZodNumber",(t,e)=>{Na.init(t,e),fe.init(t,e),t.gt=(n,o)=>t.check(Uo(n,o)),t.gte=(n,o)=>t.check(Pn(n,o)),t.min=(n,o)=>t.check(Pn(n,o)),t.lt=(n,o)=>t.check(Lo(n,o)),t.lte=(n,o)=>t.check(Tn(n,o)),t.max=(n,o)=>t.check(Tn(n,o)),t.int=n=>t.check(Ap(n)),t.safe=n=>t.check(Ap(n)),t.positive=n=>t.check(Uo(0,n)),t.nonnegative=n=>t.check(Pn(0,n)),t.negative=n=>t.check(Lo(0,n)),t.nonpositive=n=>t.check(Tn(0,n)),t.multipleOf=(n,o)=>t.check(Fo(n,o)),t.step=(n,o)=>t.check(Fo(n,o)),t.finite=()=>t;let r=t._zod.bag;t.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),t.isFinite=true,t.format=r.format??null;});function ee(t){return gp(Mp,t)}var sv=h("ZodNumberFormat",(t,e)=>{xd.init(t,e),Mp.init(t,e);});function Ap(t){return yp(sv,t)}var av=h("ZodBoolean",(t,e)=>{bd.init(t,e),fe.init(t,e);});function ge(t){return _p(av,t)}var iv=h("ZodNull",(t,e)=>{wd.init(t,e),fe.init(t,e);});function qp(t){return vp(iv,t)}var cv=h("ZodUnknown",(t,e)=>{$d.init(t,e),fe.init(t,e);});function de(){return kp(cv)}var uv=h("ZodNever",(t,e)=>{Sd.init(t,e),fe.init(t,e);});function lv(t){return xp(uv,t)}var dv=h("ZodArray",(t,e)=>{zd.init(t,e),fe.init(t,e),t.element=e.element,t.min=(r,n)=>t.check(Ur(r,n)),t.nonempty=r=>t.check(Ur(1,r)),t.max=(r,n)=>t.check(Vo(r,n)),t.length=(r,n)=>t.check(Jo(r,n)),t.unwrap=()=>t.element;});function G(t,e){return bp(dv,t,e)}var Lp=h("ZodObject",(t,e)=>{Td.init(t,e),fe.init(t,e),Q.defineLazy(t,"shape",()=>e.shape),t.keyof=()=>Ze(Object.keys(t._zod.def.shape)),t.catchall=r=>t.clone({...t._zod.def,catchall:r}),t.passthrough=()=>t.clone({...t._zod.def,catchall:de()}),t.loose=()=>t.clone({...t._zod.def,catchall:de()}),t.strict=()=>t.clone({...t._zod.def,catchall:lv()}),t.strip=()=>t.clone({...t._zod.def,catchall:void 0}),t.extend=r=>Q.extend(t,r),t.merge=r=>Q.merge(t,r),t.pick=r=>Q.pick(t,r),t.omit=r=>Q.omit(t,r),t.partial=(...r)=>Q.partial(Vp,t,r[0]),t.required=(...r)=>Q.required(Jp,t,r[0]);});function z(t,e){let r={type:"object",get shape(){return Q.assignProp(this,"shape",{...t}),this.shape},...Q.normalizeParams(e)};return new Lp(r)}function je(t,e){return new Lp({type:"object",get shape(){return Q.assignProp(this,"shape",{...t}),this.shape},catchall:de(),...Q.normalizeParams(e)})}var Up=h("ZodUnion",(t,e)=>{Aa.init(t,e),fe.init(t,e),t.options=e.options;});function ie(t,e){return new Up({type:"union",options:t,...Q.normalizeParams(e)})}var pv=h("ZodDiscriminatedUnion",(t,e)=>{Up.init(t,e),Pd.init(t,e);});function ti(t,e,r){return new pv({type:"union",options:e,discriminator:t,...Q.normalizeParams(r)})}var fv=h("ZodIntersection",(t,e)=>{Ed.init(t,e),fe.init(t,e);});function Bo(t,e){return new fv({type:"intersection",left:t,right:e})}var mv=h("ZodRecord",(t,e)=>{Rd.init(t,e),fe.init(t,e),t.keyType=e.keyType,t.valueType=e.valueType;});function se(t,e,r){return new mv({type:"record",keyType:t,valueType:e,...Q.normalizeParams(r)})}var Xa=h("ZodEnum",(t,e)=>{Id.init(t,e),fe.init(t,e),t.enum=e.entries,t.options=Object.values(e.entries);let r=new Set(Object.keys(e.entries));t.extract=(n,o)=>{let s={};for(let a of n)if(r.has(a))s[a]=e.entries[a];else throw new Error(`Key ${a} not found in enum`);return new Xa({...e,checks:[],...Q.normalizeParams(o),entries:s})},t.exclude=(n,o)=>{let s={...e.entries};for(let a of n)if(r.has(a))delete s[a];else throw new Error(`Key ${a} not found in enum`);return new Xa({...e,checks:[],...Q.normalizeParams(o),entries:s})};});function Ze(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new Xa({type:"enum",entries:r,...Q.normalizeParams(e)})}var hv=h("ZodLiteral",(t,e)=>{jd.init(t,e),fe.init(t,e),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}});});function P(t,e){return new hv({type:"literal",values:Array.isArray(t)?t:[t],...Q.normalizeParams(e)})}var gv=h("ZodTransform",(t,e)=>{Cd.init(t,e),fe.init(t,e),t._zod.parse=(r,n)=>{r.addIssue=s=>{if(typeof s=="string")r.issues.push(Q.issue(s,r.value,e));else {let a=s;a.fatal&&(a.continue=false),a.code??(a.code="custom"),a.input??(a.input=r.value),a.inst??(a.inst=t),a.continue??(a.continue=true),r.issues.push(Q.issue(a));}};let o=e.transform(r.value,r);return o instanceof Promise?o.then(s=>(r.value=s,r)):(r.value=o,r)};});function Fp(t){return new gv({type:"transform",transform:t})}var Vp=h("ZodOptional",(t,e)=>{Od.init(t,e),fe.init(t,e),t.unwrap=()=>t._zod.def.innerType;});function pe(t){return new Vp({type:"optional",innerType:t})}var yv=h("ZodNullable",(t,e)=>{Nd.init(t,e),fe.init(t,e),t.unwrap=()=>t._zod.def.innerType;});function Zp(t){return new yv({type:"nullable",innerType:t})}var _v=h("ZodDefault",(t,e)=>{Ad.init(t,e),fe.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap;});function vv(t,e){return new _v({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():e}})}var kv=h("ZodPrefault",(t,e)=>{Zd.init(t,e),fe.init(t,e),t.unwrap=()=>t._zod.def.innerType;});function xv(t,e){return new kv({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():e}})}var Jp=h("ZodNonOptional",(t,e)=>{Dd.init(t,e),fe.init(t,e),t.unwrap=()=>t._zod.def.innerType;});function bv(t,e){return new Jp({type:"nonoptional",innerType:t,...Q.normalizeParams(e)})}var wv=h("ZodCatch",(t,e)=>{Md.init(t,e),fe.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap;});function $v(t,e){return new wv({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}var Sv=h("ZodPipe",(t,e)=>{qd.init(t,e),fe.init(t,e),t.in=e.in,t.out=e.out;});function ei(t,e){return new Sv({type:"pipe",in:t,out:e})}var zv=h("ZodReadonly",(t,e)=>{Ld.init(t,e),fe.init(t,e);});function Tv(t){return new zv({type:"readonly",innerType:t})}var Hp=h("ZodCustom",(t,e)=>{Ud.init(t,e),fe.init(t,e);});function Pv(t){let e=new Se({check:"custom"});return e._zod.check=t,e}function Gp(t,e){return wp(Hp,t??(()=>true),e)}function Ev(t,e={}){return $p(Hp,t,e)}function Rv(t){let e=Pv(r=>(r.addIssue=n=>{if(typeof n=="string")r.issues.push(Q.issue(n,r.value,e._zod.def));else {let o=n;o.fatal&&(o.continue=false),o.code??(o.code="custom"),o.input??(o.input=r.value),o.inst??(o.inst=e),o.continue??(o.continue=!e._zod.def.abort),r.issues.push(Q.issue(o));}},t(r.value,r)));return e}function ri(t,e){return ei(Fp(t),e)}Ge(Fd());var oi="2025-11-25";var Bp=[oi,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],qt="io.modelcontextprotocol/related-task",Wo="2.0",he=Gp(t=>t!==null&&(typeof t=="object"||typeof t=="function")),Kp=ie([m(),ee().int()]),Wp=m();je({ttl:ee().optional(),pollInterval:ee().optional()});var Iv=z({ttl:ee().optional()}),jv=z({taskId:m()}),si=je({progressToken:Kp.optional(),[qt]:jv.optional()}),Ue=z({_meta:si.optional()}),jn=Ue.extend({task:Iv.optional()}),Yp=t=>jn.safeParse(t).success,_e=z({method:m(),params:Ue.loose().optional()}),Be=z({_meta:si.optional()}),Ke=z({method:m(),params:Be.loose().optional()}),ve=je({_meta:si.optional()}),Yo=ie([m(),ee().int()]),Qp=z({jsonrpc:P(Wo),id:Yo,..._e.shape}).strict(),ai=t=>Qp.safeParse(t).success,Xp=z({jsonrpc:P(Wo),...Ke.shape}).strict(),ef=t=>Xp.safeParse(t).success,ii=z({jsonrpc:P(Wo),id:Yo,result:ve}).strict(),Cn=t=>ii.safeParse(t).success;var H;(function(t){t[t.ConnectionClosed=-32e3]="ConnectionClosed",t[t.RequestTimeout=-32001]="RequestTimeout",t[t.ParseError=-32700]="ParseError",t[t.InvalidRequest=-32600]="InvalidRequest",t[t.MethodNotFound=-32601]="MethodNotFound",t[t.InvalidParams=-32602]="InvalidParams",t[t.InternalError=-32603]="InternalError",t[t.UrlElicitationRequired=-32042]="UrlElicitationRequired";})(H||(H={}));var ci=z({jsonrpc:P(Wo),id:Yo.optional(),error:z({code:ee().int(),message:m(),data:de().optional()})}).strict();var tf=t=>ci.safeParse(t).success;var rf=ie([Qp,Xp,ii,ci]);ie([ii,ci]);var Qo=ve.strict(),Cv=Be.extend({requestId:Yo.optional(),reason:m().optional()}),Xo=Ke.extend({method:P("notifications/cancelled"),params:Cv}),Ov=z({src:m(),mimeType:m().optional(),sizes:G(m()).optional(),theme:Ze(["light","dark"]).optional()}),On=z({icons:G(Ov).optional()}),Vr=z({name:m(),title:m().optional()}),nf=Vr.extend({...Vr.shape,...On.shape,version:m(),websiteUrl:m().optional(),description:m().optional()}),Nv=Bo(z({applyDefaults:ge().optional()}),se(m(),de())),Av=ri(t=>t&&typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length===0?{form:{}}:t,Bo(z({form:Nv.optional(),url:he.optional()}),se(m(),de()).optional())),Zv=je({list:he.optional(),cancel:he.optional(),requests:je({sampling:je({createMessage:he.optional()}).optional(),elicitation:je({create:he.optional()}).optional()}).optional()}),Dv=je({list:he.optional(),cancel:he.optional(),requests:je({tools:je({call:he.optional()}).optional()}).optional()}),Mv=z({experimental:se(m(),he).optional(),sampling:z({context:he.optional(),tools:he.optional()}).optional(),elicitation:Av.optional(),roots:z({listChanged:ge().optional()}).optional(),tasks:Zv.optional(),extensions:se(m(),he).optional()}),qv=Ue.extend({protocolVersion:m(),capabilities:Mv,clientInfo:nf}),ui=_e.extend({method:P("initialize"),params:qv});var Lv=z({experimental:se(m(),he).optional(),logging:he.optional(),completions:he.optional(),prompts:z({listChanged:ge().optional()}).optional(),resources:z({subscribe:ge().optional(),listChanged:ge().optional()}).optional(),tools:z({listChanged:ge().optional()}).optional(),tasks:Dv.optional(),extensions:se(m(),he).optional()}),Uv=ve.extend({protocolVersion:m(),capabilities:Lv,serverInfo:nf,instructions:m().optional()}),li=Ke.extend({method:P("notifications/initialized"),params:Be.optional()});var es=_e.extend({method:P("ping"),params:Ue.optional()}),Fv=z({progress:ee(),total:pe(ee()),message:pe(m())}),Vv=z({...Be.shape,...Fv.shape,progressToken:Kp}),ts=Ke.extend({method:P("notifications/progress"),params:Vv}),Jv=Ue.extend({cursor:Wp.optional()}),Nn=_e.extend({params:Jv.optional()}),An=ve.extend({nextCursor:Wp.optional()}),Hv=Ze(["working","input_required","completed","failed","cancelled"]),Zn=z({taskId:m(),status:Hv,ttl:ie([ee(),qp()]),createdAt:m(),lastUpdatedAt:m(),pollInterval:pe(ee()),statusMessage:pe(m())}),Jr=ve.extend({task:Zn}),Gv=Be.merge(Zn),Dn=Ke.extend({method:P("notifications/tasks/status"),params:Gv}),rs=_e.extend({method:P("tasks/get"),params:Ue.extend({taskId:m()})}),ns=ve.merge(Zn),os=_e.extend({method:P("tasks/result"),params:Ue.extend({taskId:m()})});ve.loose();var ss=Nn.extend({method:P("tasks/list")}),as=An.extend({tasks:G(Zn)}),is=_e.extend({method:P("tasks/cancel"),params:Ue.extend({taskId:m()})}),of=ve.merge(Zn),sf=z({uri:m(),mimeType:pe(m()),_meta:se(m(),de()).optional()}),af=sf.extend({text:m()}),di=m().refine(t=>{try{return atob(t),!0}catch{return false}},{message:"Invalid Base64 string"}),cf=sf.extend({blob:di}),Mn=Ze(["user","assistant"]),Hr=z({audience:G(Mn).optional(),priority:ee().min(0).max(1).optional(),lastModified:Rn.datetime({offset:true}).optional()}),uf=z({...Vr.shape,...On.shape,uri:m(),description:pe(m()),mimeType:pe(m()),size:pe(ee()),annotations:Hr.optional(),_meta:pe(je({}))}),Bv=z({...Vr.shape,...On.shape,uriTemplate:m(),description:pe(m()),mimeType:pe(m()),annotations:Hr.optional(),_meta:pe(je({}))}),Kv=Nn.extend({method:P("resources/list")}),Wv=An.extend({resources:G(uf)}),Yv=Nn.extend({method:P("resources/templates/list")}),Qv=An.extend({resourceTemplates:G(Bv)}),pi=Ue.extend({uri:m()}),Xv=pi,ek=_e.extend({method:P("resources/read"),params:Xv}),tk=ve.extend({contents:G(ie([af,cf]))}),rk=Ke.extend({method:P("notifications/resources/list_changed"),params:Be.optional()}),nk=pi,ok=_e.extend({method:P("resources/subscribe"),params:nk}),sk=pi,ak=_e.extend({method:P("resources/unsubscribe"),params:sk}),ik=Be.extend({uri:m()}),ck=Ke.extend({method:P("notifications/resources/updated"),params:ik}),uk=z({name:m(),description:pe(m()),required:pe(ge())}),lk=z({...Vr.shape,...On.shape,description:pe(m()),arguments:pe(G(uk)),_meta:pe(je({}))}),dk=Nn.extend({method:P("prompts/list")}),pk=An.extend({prompts:G(lk)}),fk=Ue.extend({name:m(),arguments:se(m(),m()).optional()}),mk=_e.extend({method:P("prompts/get"),params:fk}),fi=z({type:P("text"),text:m(),annotations:Hr.optional(),_meta:se(m(),de()).optional()}),mi=z({type:P("image"),data:di,mimeType:m(),annotations:Hr.optional(),_meta:se(m(),de()).optional()}),hi=z({type:P("audio"),data:di,mimeType:m(),annotations:Hr.optional(),_meta:se(m(),de()).optional()}),hk=z({type:P("tool_use"),name:m(),id:m(),input:se(m(),de()),_meta:se(m(),de()).optional()}),gk=z({type:P("resource"),resource:ie([af,cf]),annotations:Hr.optional(),_meta:se(m(),de()).optional()}),yk=uf.extend({type:P("resource_link")}),gi=ie([fi,mi,hi,yk,gk]),_k=z({role:Mn,content:gi}),vk=ve.extend({description:m().optional(),messages:G(_k)}),kk=Ke.extend({method:P("notifications/prompts/list_changed"),params:Be.optional()}),xk=z({title:m().optional(),readOnlyHint:ge().optional(),destructiveHint:ge().optional(),idempotentHint:ge().optional(),openWorldHint:ge().optional()}),bk=z({taskSupport:Ze(["required","optional","forbidden"]).optional()}),lf=z({...Vr.shape,...On.shape,description:m().optional(),inputSchema:z({type:P("object"),properties:se(m(),he).optional(),required:G(m()).optional()}).catchall(de()),outputSchema:z({type:P("object"),properties:se(m(),he).optional(),required:G(m()).optional()}).catchall(de()).optional(),annotations:xk.optional(),execution:bk.optional(),_meta:se(m(),de()).optional()}),yi=Nn.extend({method:P("tools/list")}),wk=An.extend({tools:G(lf)}),cs=ve.extend({content:G(gi).default([]),structuredContent:se(m(),de()).optional(),isError:ge().optional()});cs.or(ve.extend({toolResult:de()}));var $k=jn.extend({name:m(),arguments:se(m(),de()).optional()}),qn=_e.extend({method:P("tools/call"),params:$k}),Sk=Ke.extend({method:P("notifications/tools/list_changed"),params:Be.optional()});z({autoRefresh:ge().default(true),debounceMs:ee().int().nonnegative().default(300)});var Ln=Ze(["debug","info","notice","warning","error","critical","alert","emergency"]),zk=Ue.extend({level:Ln}),_i=_e.extend({method:P("logging/setLevel"),params:zk}),Tk=Be.extend({level:Ln,logger:m().optional(),data:de()}),Pk=Ke.extend({method:P("notifications/message"),params:Tk}),Ek=z({name:m().optional()}),Rk=z({hints:G(Ek).optional(),costPriority:ee().min(0).max(1).optional(),speedPriority:ee().min(0).max(1).optional(),intelligencePriority:ee().min(0).max(1).optional()}),Ik=z({mode:Ze(["auto","required","none"]).optional()}),jk=z({type:P("tool_result"),toolUseId:m().describe("The unique identifier for the corresponding tool call."),content:G(gi).default([]),structuredContent:z({}).loose().optional(),isError:ge().optional(),_meta:se(m(),de()).optional()}),Ck=ti("type",[fi,mi,hi]),Ko=ti("type",[fi,mi,hi,hk,jk]),Ok=z({role:Mn,content:ie([Ko,G(Ko)]),_meta:se(m(),de()).optional()}),Nk=jn.extend({messages:G(Ok),modelPreferences:Rk.optional(),systemPrompt:m().optional(),includeContext:Ze(["none","thisServer","allServers"]).optional(),temperature:ee().optional(),maxTokens:ee().int(),stopSequences:G(m()).optional(),metadata:he.optional(),tools:G(lf).optional(),toolChoice:Ik.optional()}),Ak=_e.extend({method:P("sampling/createMessage"),params:Nk}),Un=ve.extend({model:m(),stopReason:pe(Ze(["endTurn","stopSequence","maxTokens"]).or(m())),role:Mn,content:Ck}),vi=ve.extend({model:m(),stopReason:pe(Ze(["endTurn","stopSequence","maxTokens","toolUse"]).or(m())),role:Mn,content:ie([Ko,G(Ko)])}),Zk=z({type:P("boolean"),title:m().optional(),description:m().optional(),default:ge().optional()}),Dk=z({type:P("string"),title:m().optional(),description:m().optional(),minLength:ee().optional(),maxLength:ee().optional(),format:Ze(["email","uri","date","date-time"]).optional(),default:m().optional()}),Mk=z({type:Ze(["number","integer"]),title:m().optional(),description:m().optional(),minimum:ee().optional(),maximum:ee().optional(),default:ee().optional()}),qk=z({type:P("string"),title:m().optional(),description:m().optional(),enum:G(m()),default:m().optional()}),Lk=z({type:P("string"),title:m().optional(),description:m().optional(),oneOf:G(z({const:m(),title:m()})),default:m().optional()}),Uk=z({type:P("string"),title:m().optional(),description:m().optional(),enum:G(m()),enumNames:G(m()).optional(),default:m().optional()}),Fk=ie([qk,Lk]),Vk=z({type:P("array"),title:m().optional(),description:m().optional(),minItems:ee().optional(),maxItems:ee().optional(),items:z({type:P("string"),enum:G(m())}),default:G(m()).optional()}),Jk=z({type:P("array"),title:m().optional(),description:m().optional(),minItems:ee().optional(),maxItems:ee().optional(),items:z({anyOf:G(z({const:m(),title:m()}))}),default:G(m()).optional()}),Hk=ie([Vk,Jk]),Gk=ie([Uk,Fk,Hk]),Bk=ie([Gk,Zk,Dk,Mk]),Kk=jn.extend({mode:P("form").optional(),message:m(),requestedSchema:z({type:P("object"),properties:se(m(),Bk),required:G(m()).optional()})}),Wk=jn.extend({mode:P("url"),message:m(),elicitationId:m(),url:m().url()}),Yk=ie([Kk,Wk]),Qk=_e.extend({method:P("elicitation/create"),params:Yk}),Xk=Be.extend({elicitationId:m()}),ex=Ke.extend({method:P("notifications/elicitation/complete"),params:Xk}),Gr=ve.extend({action:Ze(["accept","decline","cancel"]),content:ri(t=>t===null?void 0:t,se(m(),ie([m(),ee(),ge(),G(m())])).optional())}),tx=z({type:P("ref/resource"),uri:m()});var rx=z({type:P("ref/prompt"),name:m()}),nx=Ue.extend({ref:ie([rx,tx]),argument:z({name:m(),value:m()}),context:z({arguments:se(m(),m()).optional()}).optional()}),ox=_e.extend({method:P("completion/complete"),params:nx});var sx=ve.extend({completion:je({values:G(m()).max(100),total:pe(ee().int()),hasMore:pe(ge())})}),ax=z({uri:m().startsWith("file://"),name:m().optional(),_meta:se(m(),de()).optional()}),ix=_e.extend({method:P("roots/list"),params:Ue.optional()}),ki=ve.extend({roots:G(ax)}),cx=Ke.extend({method:P("notifications/roots/list_changed"),params:Be.optional()});ie([es,ui,ox,_i,mk,dk,Kv,Yv,ek,ok,ak,qn,yi,rs,os,ss,is]);ie([Xo,ts,li,cx,Dn]);ie([Qo,Un,vi,Gr,ki,ns,as,Jr]);ie([es,Ak,Qk,ix,rs,os,ss,is]);ie([Xo,ts,Pk,ck,rk,Sk,kk,Dn,ex]);ie([Qo,Uv,sx,vk,pk,Wv,Qv,tk,cs,wk,ns,as,Jr]);var D=class t extends Error{constructor(e,r,n){super(`MCP error ${e}: ${r}`),this.code=e,this.data=n,this.name="McpError";}static fromError(e,r,n){if(e===H.UrlElicitationRequired&&n){let o=n;if(o.elicitations)return new ni(o.elicitations,r)}return new t(e,r,n)}},ni=class extends D{constructor(e,r=`URL elicitation${e.length>1?"s":""} required`){super(H.UrlElicitationRequired,r,{elicitations:e});}get elicitations(){return this.data?.elicitations??[]}};function Lt(t){return t==="completed"||t==="failed"||t==="cancelled"}new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function xi(t){let r=Ho(t)?.method;if(!r)throw new Error("Schema is missing a method literal");let n=Sp(r);if(typeof n!="string")throw new Error("Schema method literal must be a string");return n}function bi(t,e){let r=Mt(t,e);if(!r.success)throw r.error;return r.data}var mx=6e4,us=class{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(Xo,r=>{this._oncancel(r);}),this.setNotificationHandler(ts,r=>{this._onprogress(r);}),this.setRequestHandler(es,r=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(rs,async(r,n)=>{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new D(H.InvalidParams,"Failed to retrieve task: Task not found");return {...o}}),this.setRequestHandler(os,async(r,n)=>{let o=async()=>{let s=r.params.taskId;if(this._taskMessageQueue){let i;for(;i=await this._taskMessageQueue.dequeue(s,n.sessionId);){if(i.type==="response"||i.type==="error"){let c=i.message,u=c.id,l=this._requestResolvers.get(u);if(l)if(this._requestResolvers.delete(u),i.type==="response")l(c);else {let d=c,p=new D(d.error.code,d.error.message,d.error.data);l(p);}else {let d=i.type==="response"?"Response":"Error";this._onerror(new Error(`${d} handler missing for request ${u}`));}continue}await this._transport?.send(i.message,{relatedRequestId:n.requestId});}}let a=await this._taskStore.getTask(s,n.sessionId);if(!a)throw new D(H.InvalidParams,`Task not found: ${s}`);if(!Lt(a.status))return await this._waitForTaskUpdate(s,n.signal),await o();if(Lt(a.status)){let i=await this._taskStore.getTaskResult(s,n.sessionId);return this._clearTaskQueue(s),{...i,_meta:{...i._meta,[qt]:{taskId:s}}}}return await o()};return await o()}),this.setRequestHandler(ss,async(r,n)=>{try{let{tasks:o,nextCursor:s}=await this._taskStore.listTasks(r.params?.cursor,n.sessionId);return {tasks:o,nextCursor:s,_meta:{}}}catch(o){throw new D(H.InvalidParams,`Failed to list tasks: ${o instanceof Error?o.message:String(o)}`)}}),this.setRequestHandler(is,async(r,n)=>{try{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new D(H.InvalidParams,`Task not found: ${r.params.taskId}`);if(Lt(o.status))throw new D(H.InvalidParams,`Cannot cancel task in terminal status: ${o.status}`);await this._taskStore.updateTaskStatus(r.params.taskId,"cancelled","Client cancelled task execution.",n.sessionId),this._clearTaskQueue(r.params.taskId);let s=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!s)throw new D(H.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return {_meta:{},...s}}catch(o){throw o instanceof D?o:new D(H.InvalidRequest,`Failed to cancel task: ${o instanceof Error?o.message:String(o)}`)}}));}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason);}_setupTimeout(e,r,n,o,s=false){this._timeoutInfo.set(e,{timeoutId:setTimeout(o,r),startTime:Date.now(),timeout:r,maxTotalTimeout:n,resetTimeoutOnProgress:s,onTimeout:o});}_resetTimeout(e){let r=this._timeoutInfo.get(e);if(!r)return false;let n=Date.now()-r.startTime;if(r.maxTotalTimeout&&n>=r.maxTotalTimeout)throw this._timeoutInfo.delete(e),D.fromError(H.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:r.maxTotalTimeout,totalElapsed:n});return clearTimeout(r.timeoutId),r.timeoutId=setTimeout(r.onTimeout,r.timeout),true}_cleanupTimeout(e){let r=this._timeoutInfo.get(e);r&&(clearTimeout(r.timeoutId),this._timeoutInfo.delete(e));}async connect(e){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=e;let r=this.transport?.onclose;this._transport.onclose=()=>{r?.(),this._onclose();};let n=this.transport?.onerror;this._transport.onerror=s=>{n?.(s),this._onerror(s);};let o=this._transport?.onmessage;this._transport.onmessage=(s,a)=>{o?.(s,a),Cn(s)||tf(s)?this._onresponse(s):ai(s)?this._onrequest(s,a):ef(s)?this._onnotification(s):this._onerror(new Error(`Unknown message type: ${JSON.stringify(s)}`));},await this._transport.start();}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let n of this._timeoutInfo.values())clearTimeout(n.timeoutId);this._timeoutInfo.clear();for(let n of this._requestHandlerAbortControllers.values())n.abort();this._requestHandlerAbortControllers.clear();let r=D.fromError(H.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let n of e.values())n(r);}_onerror(e){this.onerror?.(e);}_onnotification(e){let r=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;r!==void 0&&Promise.resolve().then(()=>r(e)).catch(n=>this._onerror(new Error(`Uncaught error in notification handler: ${n}`)));}_onrequest(e,r){let n=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,o=this._transport,s=e.params?._meta?.[qt]?.taskId;if(n===void 0){let l={jsonrpc:"2.0",id:e.id,error:{code:H.MethodNotFound,message:"Method not found"}};s&&this._taskMessageQueue?this._enqueueTaskMessage(s,{type:"error",message:l,timestamp:Date.now()},o?.sessionId).catch(d=>this._onerror(new Error(`Failed to enqueue error response: ${d}`))):o?.send(l).catch(d=>this._onerror(new Error(`Failed to send an error response: ${d}`)));return}let a=new AbortController;this._requestHandlerAbortControllers.set(e.id,a);let i=Yp(e.params)?e.params.task:void 0,c=this._taskStore?this.requestTaskStore(e,o?.sessionId):void 0,u={signal:a.signal,sessionId:o?.sessionId,_meta:e.params?._meta,sendNotification:async l=>{if(a.signal.aborted)return;let d={relatedRequestId:e.id};s&&(d.relatedTask={taskId:s}),await this.notification(l,d);},sendRequest:async(l,d,p)=>{if(a.signal.aborted)throw new D(H.ConnectionClosed,"Request was cancelled");let f={...p,relatedRequestId:e.id};s&&!f.relatedTask&&(f.relatedTask={taskId:s});let g=f.relatedTask?.taskId??s;return g&&c&&await c.updateTaskStatus(g,"input_required"),await this.request(l,d,f)},authInfo:r?.authInfo,requestId:e.id,requestInfo:r?.requestInfo,taskId:s,taskStore:c,taskRequestedTtl:i?.ttl,closeSSEStream:r?.closeSSEStream,closeStandaloneSSEStream:r?.closeStandaloneSSEStream};Promise.resolve().then(()=>{i&&this.assertTaskHandlerCapability(e.method);}).then(()=>n(e,u)).then(async l=>{if(a.signal.aborted)return;let d={result:l,jsonrpc:"2.0",id:e.id};s&&this._taskMessageQueue?await this._enqueueTaskMessage(s,{type:"response",message:d,timestamp:Date.now()},o?.sessionId):await o?.send(d);},async l=>{if(a.signal.aborted)return;let d={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(l.code)?l.code:H.InternalError,message:l.message??"Internal error",...l.data!==void 0&&{data:l.data}}};s&&this._taskMessageQueue?await this._enqueueTaskMessage(s,{type:"error",message:d,timestamp:Date.now()},o?.sessionId):await o?.send(d);}).catch(l=>this._onerror(new Error(`Failed to send response: ${l}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===a&&this._requestHandlerAbortControllers.delete(e.id);});}_onprogress(e){let{progressToken:r,...n}=e.params,o=Number(r),s=this._progressHandlers.get(o);if(!s){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let a=this._responseHandlers.get(o),i=this._timeoutInfo.get(o);if(i&&a&&i.resetTimeoutOnProgress)try{this._resetTimeout(o);}catch(c){this._responseHandlers.delete(o),this._progressHandlers.delete(o),this._cleanupTimeout(o),a(c);return}s(n);}_onresponse(e){let r=Number(e.id),n=this._requestResolvers.get(r);if(n){if(this._requestResolvers.delete(r),Cn(e))n(e);else {let a=new D(e.error.code,e.error.message,e.error.data);n(a);}return}let o=this._responseHandlers.get(r);if(o===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(r),this._cleanupTimeout(r);let s=false;if(Cn(e)&&e.result&&typeof e.result=="object"){let a=e.result;if(a.task&&typeof a.task=="object"){let i=a.task;typeof i.taskId=="string"&&(s=true,this._taskProgressTokens.set(i.taskId,r));}}if(s||this._progressHandlers.delete(r),Cn(e))o(e);else {let a=D.fromError(e.error.code,e.error.message,e.error.data);o(a);}}get transport(){return this._transport}async close(){await this._transport?.close();}async*requestStream(e,r,n){let{task:o}=n??{};if(!o){try{yield {type:"result",result:await this.request(e,r,n)};}catch(a){yield {type:"error",error:a instanceof D?a:new D(H.InternalError,String(a))};}return}let s;try{let a=await this.request(e,Jr,n);if(a.task)s=a.task.taskId,yield {type:"taskCreated",task:a.task};else throw new D(H.InternalError,"Task creation did not return a task");for(;;){let i=await this.getTask({taskId:s},n);if(yield {type:"taskStatus",task:i},Lt(i.status)){i.status==="completed"?yield {type:"result",result:await this.getTaskResult({taskId:s},r,n)}:i.status==="failed"?yield {type:"error",error:new D(H.InternalError,`Task ${s} failed`)}:i.status==="cancelled"&&(yield {type:"error",error:new D(H.InternalError,`Task ${s} was cancelled`)});return}if(i.status==="input_required"){yield {type:"result",result:await this.getTaskResult({taskId:s},r,n)};return}let c=i.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(u=>setTimeout(u,c)),n?.signal?.throwIfAborted();}}catch(a){yield {type:"error",error:a instanceof D?a:new D(H.InternalError,String(a))};}}request(e,r,n){let{relatedRequestId:o,resumptionToken:s,onresumptiontoken:a,task:i,relatedTask:c}=n??{};return new Promise((u,l)=>{let d=S=>{l(S);};if(!this._transport){d(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===true)try{this.assertCapabilityForMethod(e.method),i&&this.assertTaskCapability(e.method);}catch(S){d(S);return}n?.signal?.throwIfAborted();let p=this._requestMessageId++,f={...e,jsonrpc:"2.0",id:p};n?.onprogress&&(this._progressHandlers.set(p,n.onprogress),f.params={...e.params,_meta:{...e.params?._meta||{},progressToken:p}}),i&&(f.params={...f.params,task:i}),c&&(f.params={...f.params,_meta:{...f.params?._meta||{},[qt]:c}});let g=S=>{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(S)}},{relatedRequestId:o,resumptionToken:s,onresumptiontoken:a}).catch(R=>this._onerror(new Error(`Failed to send cancellation: ${R}`)));let b=S instanceof D?S:new D(H.RequestTimeout,String(S));l(b);};this._responseHandlers.set(p,S=>{if(!n?.signal?.aborted){if(S instanceof Error)return l(S);try{let b=Mt(r,S.result);b.success?u(b.data):l(b.error);}catch(b){l(b);}}}),n?.signal?.addEventListener("abort",()=>{g(n?.signal?.reason);});let y=n?.timeout??mx,v=()=>g(D.fromError(H.RequestTimeout,"Request timed out",{timeout:y}));this._setupTimeout(p,y,n?.maxTotalTimeout,v,n?.resetTimeoutOnProgress??false);let k=c?.taskId;if(k){let S=b=>{let R=this._responseHandlers.get(p);R?R(b):this._onerror(new Error(`Response handler missing for side-channeled request ${p}`));};this._requestResolvers.set(p,S),this._enqueueTaskMessage(k,{type:"request",message:f,timestamp:Date.now()}).catch(b=>{this._cleanupTimeout(p),l(b);});}else this._transport.send(f,{relatedRequestId:o,resumptionToken:s,onresumptiontoken:a}).catch(S=>{this._cleanupTimeout(p),l(S);});})}async getTask(e,r){return this.request({method:"tasks/get",params:e},ns,r)}async getTaskResult(e,r,n){return this.request({method:"tasks/result",params:e},r,n)}async listTasks(e,r){return this.request({method:"tasks/list",params:e},as,r)}async cancelTask(e,r){return this.request({method:"tasks/cancel",params:e},of,r)}async notification(e,r){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);let n=r?.relatedTask?.taskId;if(n){let i={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[qt]:r.relatedTask}}};await this._enqueueTaskMessage(n,{type:"notification",message:i,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!r?.relatedRequestId&&!r?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let i={...e,jsonrpc:"2.0"};r?.relatedTask&&(i={...i,params:{...i.params,_meta:{...i.params?._meta||{},[qt]:r.relatedTask}}}),this._transport?.send(i,r).catch(c=>this._onerror(c));});return}let a={...e,jsonrpc:"2.0"};r?.relatedTask&&(a={...a,params:{...a.params,_meta:{...a.params?._meta||{},[qt]:r.relatedTask}}}),await this._transport.send(a,r);}setRequestHandler(e,r){let n=xi(e);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(o,s)=>{let a=bi(e,o);return Promise.resolve(r(a,s))});}removeRequestHandler(e){this._requestHandlers.delete(e);}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,r){let n=xi(e);this._notificationHandlers.set(n,o=>{let s=bi(e,o);return Promise.resolve(r(s))});}removeNotificationHandler(e){this._notificationHandlers.delete(e);}_cleanupTaskProgressHandler(e){let r=this._taskProgressTokens.get(e);r!==void 0&&(this._progressHandlers.delete(r),this._taskProgressTokens.delete(e));}async _enqueueTaskMessage(e,r,n){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let o=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,r,n,o);}async _clearTaskQueue(e,r){if(this._taskMessageQueue){let n=await this._taskMessageQueue.dequeueAll(e,r);for(let o of n)if(o.type==="request"&&ai(o.message)){let s=o.message.id,a=this._requestResolvers.get(s);a?(a(new D(H.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(s)):this._onerror(new Error(`Resolver missing for request ${s} during task ${e} cleanup`));}}}async _waitForTaskUpdate(e,r){let n=this._options?.defaultTaskPollInterval??1e3;try{let o=await this._taskStore?.getTask(e);o?.pollInterval&&(n=o.pollInterval);}catch{}return new Promise((o,s)=>{if(r.aborted){s(new D(H.InvalidRequest,"Request cancelled"));return}let a=setTimeout(o,n);r.addEventListener("abort",()=>{clearTimeout(a),s(new D(H.InvalidRequest,"Request cancelled"));},{once:true});})}requestTaskStore(e,r){let n=this._taskStore;if(!n)throw new Error("No task store configured");return {createTask:async o=>{if(!e)throw new Error("No request provided");return await n.createTask(o,e.id,{method:e.method,params:e.params},r)},getTask:async o=>{let s=await n.getTask(o,r);if(!s)throw new D(H.InvalidParams,"Failed to retrieve task: Task not found");return s},storeTaskResult:async(o,s,a)=>{await n.storeTaskResult(o,s,a,r);let i=await n.getTask(o,r);if(i){let c=Dn.parse({method:"notifications/tasks/status",params:i});await this.notification(c),Lt(i.status)&&this._cleanupTaskProgressHandler(o);}},getTaskResult:o=>n.getTaskResult(o,r),updateTaskStatus:async(o,s,a)=>{let i=await n.getTask(o,r);if(!i)throw new D(H.InvalidParams,`Task "${o}" not found - it may have been cleaned up`);if(Lt(i.status))throw new D(H.InvalidParams,`Cannot update task "${o}" from terminal status "${i.status}" to "${s}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await n.updateTaskStatus(o,s,a,r);let c=await n.getTask(o,r);if(c){let u=Dn.parse({method:"notifications/tasks/status",params:c});await this.notification(u),Lt(c.status)&&this._cleanupTaskProgressHandler(o);}},listTasks:o=>n.listTasks(o,r)}}};function df(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function pf(t,e){let r={...t};for(let n in e){let o=n,s=e[o];if(s===void 0)continue;let a=r[o];df(a)&&df(s)?r[o]={...a,...s}:r[o]=s;}return r}var Qh=ju(iu()),Xh=ju(Yh());function sz(){let t=new Qh.default({strict:false,validateFormats:true,validateSchema:false,allErrors:true});return (0, Xh.default)(t),t}var Js=class{constructor(e){this._ajv=e??sz();}getValidator(e){let r="$id"in e&&typeof e.$id=="string"?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return n=>r(n)?{valid:true,data:n,errorMessage:void 0}:{valid:false,data:void 0,errorMessage:this._ajv.errorsText(r.errors)}}};var Hs=class{constructor(e){this._server=e;}requestStream(e,r,n){return this._server.requestStream(e,r,n)}createMessageStream(e,r){let n=this._server.getClientCapabilities();if((e.tools||e.toolChoice)&&!n?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if(e.messages.length>0){let o=e.messages[e.messages.length-1],s=Array.isArray(o.content)?o.content:[o.content],a=s.some(l=>l.type==="tool_result"),i=e.messages.length>1?e.messages[e.messages.length-2]:void 0,c=i?Array.isArray(i.content)?i.content:[i.content]:[],u=c.some(l=>l.type==="tool_use");if(a){if(s.some(l=>l.type!=="tool_result"))throw new Error("The last message must contain only tool_result content if any is present");if(!u)throw new Error("tool_result blocks are not matching any tool_use from the previous message")}if(u){let l=new Set(c.filter(p=>p.type==="tool_use").map(p=>p.id)),d=new Set(s.filter(p=>p.type==="tool_result").map(p=>p.toolUseId));if(l.size!==d.size||![...l].every(p=>d.has(p)))throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return this.requestStream({method:"sampling/createMessage",params:e},Un,r)}elicitInputStream(e,r){let n=this._server.getClientCapabilities(),o=e.mode??"form";switch(o){case "url":{if(!n?.elicitation?.url)throw new Error("Client does not support url elicitation.");break}case "form":{if(!n?.elicitation?.form)throw new Error("Client does not support form elicitation.");break}}let s=o==="form"&&e.mode===void 0?{...e,mode:"form"}:e;return this.requestStream({method:"elicitation/create",params:s},Gr,r)}async getTask(e,r){return this._server.getTask({taskId:e},r)}async getTaskResult(e,r,n){return this._server.getTaskResult({taskId:e},r,n)}async listTasks(e,r){return this._server.listTasks(e?{cursor:e}:void 0,r)}async cancelTask(e,r){return this._server.cancelTask({taskId:e},r)}};function eg(t,e,r){if(!t)throw new Error(`${r} does not support task creation (required for ${e})`);switch(e){case "tools/call":if(!t.tools?.call)throw new Error(`${r} does not support task creation for tools/call (required for ${e})`);break;}}function tg(t,e,r){if(!t)throw new Error(`${r} does not support task creation (required for ${e})`);switch(e){case "sampling/createMessage":if(!t.sampling?.createMessage)throw new Error(`${r} does not support task creation for sampling/createMessage (required for ${e})`);break;case "elicitation/create":if(!t.elicitation?.create)throw new Error(`${r} does not support task creation for elicitation/create (required for ${e})`);break;}}var Gs=class extends us{constructor(e,r){super(r),this._serverInfo=e,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(Ln.options.map((n,o)=>[n,o])),this.isMessageIgnored=(n,o)=>{let s=this._loggingLevels.get(o);return s?this.LOG_LEVEL_SEVERITY.get(n)<this.LOG_LEVEL_SEVERITY.get(s):false},this._capabilities=r?.capabilities??{},this._instructions=r?.instructions,this._jsonSchemaValidator=r?.jsonSchemaValidator??new Js,this.setRequestHandler(ui,n=>this._oninitialize(n)),this.setNotificationHandler(li,()=>this.oninitialized?.()),this._capabilities.logging&&this.setRequestHandler(_i,async(n,o)=>{let s=o.sessionId||o.requestInfo?.headers["mcp-session-id"]||void 0,{level:a}=n.params,i=Ln.safeParse(a);return i.success&&this._loggingLevels.set(s,i.data),{}});}get experimental(){return this._experimental||(this._experimental={tasks:new Hs(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=pf(this._capabilities,e);}setRequestHandler(e,r){let o=Ho(e)?.method;if(!o)throw new Error("Schema is missing a method literal");let s;if(Fr(o)){let i=o;s=i._zod?.def?.value??i.value;}else {let i=o;s=i._def?.value??i.value;}if(typeof s!="string")throw new Error("Schema method literal must be a string");if(s==="tools/call"){let i=async(c,u)=>{let l=Mt(qn,c);if(!l.success){let g=l.error instanceof Error?l.error.message:String(l.error);throw new D(H.InvalidParams,`Invalid tools/call request: ${g}`)}let{params:d}=l.data,p=await Promise.resolve(r(c,u));if(d.task){let g=Mt(Jr,p);if(!g.success){let y=g.error instanceof Error?g.error.message:String(g.error);throw new D(H.InvalidParams,`Invalid task creation result: ${y}`)}return g.data}let f=Mt(cs,p);if(!f.success){let g=f.error instanceof Error?f.error.message:String(f.error);throw new D(H.InvalidParams,`Invalid tools/call result: ${g}`)}return f.data};return super.setRequestHandler(e,i)}return super.setRequestHandler(e,r)}assertCapabilityForMethod(e){switch(e){case "sampling/createMessage":if(!this._clientCapabilities?.sampling)throw new Error(`Client does not support sampling (required for ${e})`);break;case "elicitation/create":if(!this._clientCapabilities?.elicitation)throw new Error(`Client does not support elicitation (required for ${e})`);break;case "roots/list":if(!this._clientCapabilities?.roots)throw new Error(`Client does not support listing roots (required for ${e})`);break;}}assertNotificationCapability(e){switch(e){case "notifications/message":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case "notifications/resources/updated":case "notifications/resources/list_changed":if(!this._capabilities.resources)throw new Error(`Server does not support notifying about resources (required for ${e})`);break;case "notifications/tools/list_changed":if(!this._capabilities.tools)throw new Error(`Server does not support notifying of tool list changes (required for ${e})`);break;case "notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new Error(`Server does not support notifying of prompt list changes (required for ${e})`);break;case "notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new Error(`Client does not support URL elicitation (required for ${e})`);break;}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case "completion/complete":if(!this._capabilities.completions)throw new Error(`Server does not support completions (required for ${e})`);break;case "logging/setLevel":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case "prompts/get":case "prompts/list":if(!this._capabilities.prompts)throw new Error(`Server does not support prompts (required for ${e})`);break;case "resources/list":case "resources/templates/list":case "resources/read":if(!this._capabilities.resources)throw new Error(`Server does not support resources (required for ${e})`);break;case "tools/call":case "tools/list":if(!this._capabilities.tools)throw new Error(`Server does not support tools (required for ${e})`);break;case "tasks/get":case "tasks/list":case "tasks/result":case "tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Server does not support tasks capability (required for ${e})`);break;}}assertTaskCapability(e){tg(this._clientCapabilities?.tasks?.requests,e,"Client");}assertTaskHandlerCapability(e){this._capabilities&&eg(this._capabilities.tasks?.requests,e,"Server");}async _oninitialize(e){let r=e.params.protocolVersion;return this._clientCapabilities=e.params.capabilities,this._clientVersion=e.params.clientInfo,{protocolVersion:Bp.includes(r)?r:oi,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"},Qo)}async createMessage(e,r){if((e.tools||e.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if(e.messages.length>0){let n=e.messages[e.messages.length-1],o=Array.isArray(n.content)?n.content:[n.content],s=o.some(u=>u.type==="tool_result"),a=e.messages.length>1?e.messages[e.messages.length-2]:void 0,i=a?Array.isArray(a.content)?a.content:[a.content]:[],c=i.some(u=>u.type==="tool_use");if(s){if(o.some(u=>u.type!=="tool_result"))throw new Error("The last message must contain only tool_result content if any is present");if(!c)throw new Error("tool_result blocks are not matching any tool_use from the previous message")}if(c){let u=new Set(i.filter(d=>d.type==="tool_use").map(d=>d.id)),l=new Set(o.filter(d=>d.type==="tool_result").map(d=>d.toolUseId));if(u.size!==l.size||![...u].every(d=>l.has(d)))throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return e.tools?this.request({method:"sampling/createMessage",params:e},vi,r):this.request({method:"sampling/createMessage",params:e},Un,r)}async elicitInput(e,r){switch(e.mode??"form"){case "url":{if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support url elicitation.");let o=e;return this.request({method:"elicitation/create",params:o},Gr,r)}case "form":{if(!this._clientCapabilities?.elicitation?.form)throw new Error("Client does not support form elicitation.");let o=e.mode==="form"?e:{...e,mode:"form"},s=await this.request({method:"elicitation/create",params:o},Gr,r);if(s.action==="accept"&&s.content&&o.requestedSchema)try{let i=this._jsonSchemaValidator.getValidator(o.requestedSchema)(s.content);if(!i.valid)throw new D(H.InvalidParams,`Elicitation response content does not match requested schema: ${i.errorMessage}`)}catch(a){throw a instanceof D?a:new D(H.InternalError,`Error validating elicitation response: ${a instanceof Error?a.message:String(a)}`)}return s}}}createElicitationCompletionNotifier(e,r){if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support URL elicitation (required for notifications/elicitation/complete)");return ()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:e}},r)}async listRoots(e,r){return this.request({method:"roots/list",params:e},ki,r)}async sendLoggingMessage(e,r){if(this._capabilities.logging&&!this.isMessageIgnored(e.level,r))return this.notification({method:"notifications/message",params:e})}async sendResourceUpdated(e){return this.notification({method:"notifications/resources/updated",params:e})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}};var Bs=class{append(e){this._buffer=this._buffer?Buffer.concat([this._buffer,e]):e;}readMessage(){if(!this._buffer)return null;let e=this._buffer.indexOf(`
34
+ `);if(e===-1)return null;let r=this._buffer.toString("utf8",0,e).replace(/\r$/,"");return this._buffer=this._buffer.subarray(e+1),az(r)}clear(){this._buffer=void 0;}};function az(t){return rf.parse(JSON.parse(t))}function rg(t){return JSON.stringify(t)+`
35
+ `}var Ks=class{constructor(e=ng.stdin,r=ng.stdout){this._stdin=e,this._stdout=r,this._readBuffer=new Bs,this._started=false,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=true,this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror);}processReadBuffer(){for(;;)try{let e=this._readBuffer.readMessage();if(e===null)break;this.onmessage?.(e);}catch(e){this.onerror?.(e);}}async close(){this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),this._stdin.listenerCount("data")===0&&this._stdin.pause(),this._readBuffer.clear(),this.onclose?.();}send(e){return new Promise(r=>{let n=rg(e);this._stdout.write(n)?r():this._stdout.once("drain",r);})}};var og="1.0.0";async function Tr(t){try{return await access(t),!0}catch{return false}}var cz=["pl","en","de","es","fr","pt","it","nl"],Ws=A.enum(cz),sg="pl",uz=A.object({url:A.string().url(),language:Ws.optional()}),ag=A.object({projects:A.record(A.string(),uz),default_project:A.string(),default_language:Ws.optional()}).refine(t=>t.default_project in t.projects,{message:"default_project must reference a configured project"}),pn=A.object({username:A.string().email(),api_token:A.string().min(1)}),hu=A.object({default:pn,instances:A.record(A.string().url(),pn).optional()}),ig=A.union([pn,hu]),gu=A.object({url:A.string().url(),username:A.string().email(),api_token:A.string().min(1),language:Ws});A.object({projects:A.record(A.string(),gu),default_project:A.string(),default_language:Ws,credentials:pn});var Wt=class extends Error{code;constructor(e,r){super(e),this.name="JiraMcpError",this.code=r;}},Ys=class extends Wt{constructor(e,r="CONFIG_ERROR"){super(e,r),this.name="ConfigError";}},ko=class extends Ys{constructor(e){super(e,"CONFIG_NOT_FOUND"),this.name="ConfigNotFoundError";}},it=class extends Ys{constructor(e){super(e,"CONFIG_VALIDATION"),this.name="ConfigValidationError";}},It=class extends Wt{constructor(e,r="JIRA_CONNECTION"){super(e,r),this.name="JiraConnectionError";}},Qs=class extends It{constructor(e){super(e,"JIRA_AUTH"),this.name="JiraAuthenticationError";}},Xs=class extends It{constructor(e){super(e,"JIRA_PERMISSION"),this.name="JiraPermissionError";}},xo=class extends Wt{constructor(e,r="CACHE_ERROR"){super(e,r),this.name="CacheError";}},fn=class extends xo{constructor(e){super(e,"CACHE_NOT_FOUND"),this.name="CacheNotFoundError";}},Yt=class extends xo{constructor(e){super(e,"CACHE_CORRUPTION"),this.name="CacheCorruptionError";}},Pr=class extends xo{constructor(e){super(e,"TASK_NOT_FOUND"),this.name="TaskNotFoundError";}},yu=class extends Wt{constructor(e,r="TEMPLATE_ERROR"){super(e,r),this.name="TemplateError";}},ea=class extends yu{constructor(e){super(e,"TEMPLATE_NOT_FOUND"),this.name="TemplateNotFoundError";}};xu();async function gz(t){let e=process.env.JIRA_CONFIG_PATH;if(e)return resolve(e);let r=resolve(process.cwd(),"config.json");return await Tr(r)?r:vu}async function yz(t){let e=process.env.JIRA_CREDENTIALS_PATH;if(e)return resolve(e);let r=resolve(process.cwd(),"credentials.json");return await Tr(r)?r:ku}async function dg(t,e){if(!await Tr(t))throw new ko(`${e} not found: ${t}`);let r;try{r=await readFile(t,"utf-8");}catch(n){let o=n instanceof Error?n.message:String(n);throw new ko(`Failed to read ${e}: ${o}`)}try{return JSON.parse(r)}catch(n){let o=n instanceof Error?n.message:String(n);throw new it(`Invalid JSON in ${e}: ${o}`)}}function _z(t){let e=pn.safeParse(t);if(e.success&&!("default"in t))return {default:e.data,instances:{}};let r=hu.safeParse(t);if(r.success)return {default:r.data.default,instances:r.data.instances??{}};throw new it("Credentials file format not recognized. Expected { username, api_token } or { default: { username, api_token }, instances?: {} }.")}function vz(t,e){return t.instances[e]??t.default}async function pg(t){let e=await gz(),r=await yz(),n=await dg(e,"configuration file"),o=ag.safeParse(n);if(!o.success)throw new it(`Configuration validation failed: ${o.error.message}`);let s=o.data,a=await dg(r,"credentials file"),i=ig.safeParse(a);if(!i.success)throw new it(`Credentials validation failed: ${i.error.message}`);let c=_z(i.data),u=s.default_language??sg,l={};for(let[d,p]of Object.entries(s.projects)){let f=vz(c,p.url),g={url:p.url,username:f.username,api_token:f.api_token,language:p.language??u},y=gu.safeParse(g);if(!y.success)throw new it(`Project '${d}' validation failed: ${y.error.message}`);l[d]=y.data;}return {projects:l,default_project:s.default_project,default_language:u,credentials:c.default}}function fg(t){let e=new Map;for(let[n,o]of Object.entries(t.projects)){let s=e.get(o.url);s?s.keys.push(n):e.set(o.url,{keys:[n]});}let r=[];for(let[n,{keys:o}]of e){let s=o[0];if(!s)continue;let a=t.projects[s];a&&r.push({url:n,username:a.username,api_token:a.api_token,projectKeys:o});}return r}var kz=1e3,xz=["summary","status","assignee","priority","issuetype","created","updated","project","customfield_10014"],ra=class{authToken;instanceUrl;constructor(e){this.instanceUrl=e.url,this.authToken=Buffer.from(`${e.username}:${e.api_token}`).toString("base64");}async request(e,r,n,o){let s=new URL(r,this.instanceUrl);if(o)for(let[c,u]of Object.entries(o))s.searchParams.set(c,u);let a={Authorization:`Basic ${this.authToken}`,Accept:"application/json"};n!==void 0&&(a["Content-Type"]="application/json");let i=await fetch(s.toString(),{method:e,headers:a,body:n!==void 0?JSON.stringify(n):void 0});if(!i.ok){let u=await i.text()||i.statusText;throw i.status===401?new Qs(`Authentication failed: ${u}`):i.status===403?new Xs(`Permission denied: ${u}`):new It(`Jira API error (${i.status}): ${u}`)}if(i.status!==204)return await i.json()}async searchIssues(e,r){return ((await this.request("GET","/rest/api/3/search",void 0,{jql:e,fields:(r?[...r]:xz).join(","),maxResults:String(kz)})).issues??[]).map(s=>{let a=s.fields;return {key:s.key,summary:a.summary,status:a.status?.name??"Unknown",assignee:a.assignee?.emailAddress??null,priority:a.priority?.name??"None",issueType:a.issuetype?.name??a.issueType?.name??"Unknown",created:a.created,updated:a.updated,projectKey:s.key.split("-")[0]??"",epicLink:a.customfield_10014??null}})}async getIssue(e){let r=["summary","description","status","assignee","priority","issuetype","created","updated","project","comment","timetracking"],n=await this.request("GET",`/rest/api/3/issue/${encodeURIComponent(e)}`,void 0,{fields:r.join(",")}),o=n.fields,s=(o.comment?.comments??[]).map(a=>({id:a.id??"",author:a.author?.emailAddress??a.author?.displayName??"Unknown",body:a.body??null,created:a.created??""}));return {key:n.key,summary:o.summary,description:o.description??null,status:o.status?.name??"Unknown",assignee:o.assignee?.emailAddress??null,priority:o.priority?.name??"None",issueType:o.issuetype?.name??o.issueType?.name??"Unknown",created:o.created,updated:o.updated,projectKey:n.key.split("-")[0]??"",comments:s,timeTracking:{originalEstimate:o.timetracking?.originalEstimate??null,remainingEstimate:o.timetracking?.remainingEstimate??null,timeSpent:o.timetracking?.timeSpent??null,originalEstimateSeconds:o.timetracking?.originalEstimateSeconds??null,remainingEstimateSeconds:o.timetracking?.remainingEstimateSeconds??null,timeSpentSeconds:o.timetracking?.timeSpentSeconds??null}}}async addComment(e,r){let n=await this.request("POST",`/rest/api/3/issue/${encodeURIComponent(e)}/comment`,{body:r});return {id:n.id??"",author:n.author?.emailAddress??n.author?.displayName??"Unknown",body:n.body??null,created:n.created??""}}async getTransitions(e){return ((await this.request("GET",`/rest/api/3/issue/${encodeURIComponent(e)}/transitions`)).transitions??[]).map(n=>({id:n.id??"",name:n.name??"",toStatus:n.to?.name??""}))}async doTransition(e,r){await this.request("POST",`/rest/api/3/issue/${encodeURIComponent(e)}/transitions`,{transition:{id:r}});}async assignIssue(e,r){await this.request("PUT",`/rest/api/3/issue/${encodeURIComponent(e)}/assignee`,{accountId:r});}async findUser(e){let n=(await this.request("GET","/rest/api/3/user/search",void 0,{query:e,maxResults:"1"}))?.[0];if(!n?.accountId)throw new It(`User not found for email: ${e}`);return n.accountId}async addWorklog(e,r,n){let o={timeSpentSeconds:r};n&&(o.comment=n);let s=await this.request("POST",`/rest/api/3/issue/${encodeURIComponent(e)}/worklog`,o);return {id:s.id??"",timeSpent:s.timeSpent??"",timeSpentSeconds:s.timeSpentSeconds??r,created:s.created??""}}async getTimeTracking(e){let n=(await this.request("GET",`/rest/api/3/issue/${encodeURIComponent(e)}`,void 0,{fields:"timetracking"})).fields.timetracking;return {originalEstimate:n?.originalEstimate??null,remainingEstimate:n?.remainingEstimate??null,timeSpent:n?.timeSpent??null,originalEstimateSeconds:n?.originalEstimateSeconds??null,remainingEstimateSeconds:n?.remainingEstimateSeconds??null,timeSpentSeconds:n?.timeSpentSeconds??null}}async createIssue(e){let r=await this.request("POST","/rest/api/3/issue",{fields:e});return {key:r.key,id:r.id,url:`${this.instanceUrl}/browse/${r.key}`}}async updateIssue(e,r){await this.request("PUT",`/rest/api/3/issue/${encodeURIComponent(e)}`,{fields:r});}async getFields(){return (await this.request("GET","/rest/api/3/field")).map(r=>({id:r.id??"",name:r.name??"",custom:r.custom??false,...r.schema?.custom!==void 0?{schema:{custom:r.schema.custom}}:{}}))}async searchUsers(e,r=50){return (await this.request("GET","/rest/api/3/user/search",void 0,{query:e,maxResults:String(r)})??[]).map(o=>({accountId:o.accountId,emailAddress:o.emailAddress??null,displayName:o.displayName??"Unknown",active:o.active}))}async getProjectStatuses(e){return (await this.request("GET",`/rest/api/3/project/${encodeURIComponent(e)}/statuses`)).map(n=>({id:n.id,name:n.name,statuses:n.statuses.map(o=>({name:o.name??"",id:o.id??""}))}))}};var na=class{byProject=new Map;byUrl=new Map;config;constructor(e){this.config=e,this.#e();}getConnector(e){let r=this.byProject.get(e);if(!r)throw new it(`Project '${e}' not found in configuration`);return r}getConnectorForTask(e){let r=e.split("-")[0];if(!r)throw new it(`Invalid task key format: '${e}'. Expected 'PROJECT-NUMBER'.`);return this.getConnector(r)}getInstances(){return this.byUrl}#e(){let e=new Map;for(let[r,n]of Object.entries(this.config.projects)){let o=e.get(n.url);o?o.push(r):e.set(n.url,[r]);}for(let[r,n]of e){let o=n[0];if(!o)continue;let s=this.config.projects[o];if(!s)continue;let a=new ra(s),i={connector:a,projectKeys:n};this.byUrl.set(r,i);for(let c of n)this.byProject.set(c,a);}}};var bo="1.0",bz=A.object({key:A.string(),summary:A.string(),status:A.string(),assignee:A.string().nullable(),priority:A.string(),issue_type:A.string(),created:A.string(),updated:A.string(),project_key:A.string(),project_url:A.string().url(),epic_link:A.string().nullable()}),wz=A.object({version:A.string(),last_sync:A.string(),jira_user:A.string()}),bu=A.object({metadata:wz,tasks:A.array(bz)});function Ez(t){return t.replaceAll("@","_at_").replaceAll(".","_")}var oa=class{cacheDir;jiraUser;cachePath;constructor(e,r){this.cacheDir=e,this.jiraUser=r,this.cachePath=join(e,`tasks_${Ez(r)}.json`);}async initialize(){if(await mkdir(this.cacheDir,{recursive:true}),await Tr(this.cachePath)){try{await this.load();}catch(r){if(!(r instanceof fn)){let n=r instanceof Error?r.message:String(r);throw new Yt(`Existing cache is corrupted: ${n}`)}}return}let e={metadata:{version:bo,last_sync:new Date().toISOString(),jira_user:this.jiraUser},tasks:[]};await this.#e(e);}async load(){if(!await Tr(this.cachePath))throw new fn(`Cache not found: ${this.cachePath}`);let e;try{e=await readFile(this.cachePath,"utf-8");}catch(o){let s=o instanceof Error?o.message:String(o);throw new fn(`Failed to read cache file: ${s}`)}let r;try{r=JSON.parse(e);}catch(o){let s=o instanceof Error?o.message:String(o);throw new Yt(`Cache file is corrupted (invalid JSON): ${s}`)}let n=bu.safeParse(r);if(!n.success)throw new Yt(`Cache data failed validation: ${n.error.message}`);if(n.data.metadata.version!==bo)throw new Yt(`Cache version ${n.data.metadata.version} !== ${bo}`);return n.data}async save(e){let r={metadata:{version:bo,last_sync:new Date().toISOString(),jira_user:this.jiraUser},tasks:[...e]},n=bu.safeParse(r);if(!n.success)throw new Yt(`Task data failed validation: ${n.error.message}`);await this.#e(n.data);}async getTask(e){let n=(await this.load()).tasks.find(o=>o.key===e);if(!n)throw new Pr(`Task ${e} not found in cache`);return n}async getAllTasks(){return (await this.load()).tasks}async updateTask(e,r){let n=await this.load(),o=n.tasks.findIndex(c=>c.key===e);if(o===-1)throw new Pr(`Task ${e} not found in cache`);let s=n.tasks[o];if(!s)throw new Pr(`Task ${e} not found in cache`);let a={...s,...r,key:e,updated:new Date().toISOString()},i=[...n.tasks.slice(0,o),a,...n.tasks.slice(o+1)];return await this.save(i),a}async deleteTask(e){let r=await this.load(),n=r.tasks.filter(o=>o.key!==e);if(n.length===r.tasks.length)throw new Pr(`Task ${e} not found in cache`);await this.save(n);}async getMetadata(){return (await this.load()).metadata}async#e(e){let r=`${this.cachePath}.tmp`,n=JSON.stringify(e,null,2);await writeFile(r,n,"utf-8"),await rename(r,this.cachePath);}};function mg(t){return t.replace(/([+\-&|!(){}[\]^~*?\\:"])/g,"\\$1")}var sa=class{#e;#t;#r;constructor(e,r,n){this.#e=e,this.#t=r,this.#r=n;}async sync(e){let r=e?.jql??`assignee = "${mg(this.#t.credentials.username)}" ORDER BY updated DESC`,n=fg(this.#t);if(e?.projectKey){let s=this.#t.projects[e.projectKey];s&&(n=n.filter(a=>a.url===s.url));}let o=[];for(let s of n){let c=(await this.#r(s.url,s.username,s.api_token).searchIssues(r)).map(u=>this.#n(u,s.url));o.push(...c);}return await this.#e.save(o),o.length}#n(e,r){let n=e.fields.assignee?.emailAddress??null,o=e.fields.priority?.name??"None",s=e.fields.customfield_10014??null;return {key:e.key,summary:e.fields.summary,status:e.fields.status.name,assignee:n,priority:o,issue_type:e.fields.issuetype.name,created:e.fields.created,updated:e.fields.updated,project_key:e.fields.project.key,project_url:r,epic_link:s}}};var hg=[{id:"status-update",name:"Status Update",description:"Standard status update with completed work, next steps, and blockers",category:"workflow",variables:[{name:"completed",description:"Work completed since last update",required:true,example:"Implemented user authentication flow"},{name:"next_steps",description:"Planned next steps",required:true,example:"Add unit tests for auth module"},{name:"blockers",description:"Current blockers or impediments",required:false,defaultValue:"None",example:"Waiting for API credentials"}],body:`## Status Update
36
+
37
+ ### Completed
38
+ {{completed}}
39
+
40
+ ### Next Steps
41
+ {{next_steps}}
42
+
43
+ {{#blockers}}### Blockers
44
+ {{blockers}}{{/blockers}}`},{id:"blocker-notification",name:"Blocker Notification",description:"Notify about a blocking issue with impact and needed action",category:"communication",variables:[{name:"blocked_by",description:"What is causing the blockage",required:true,example:"Missing database credentials for staging"},{name:"impact",description:"Impact if blocker is not resolved",required:true,example:"Cannot proceed with integration testing"},{name:"needed_action",description:"What action is needed to unblock",required:true,example:"DevOps to provision staging DB credentials"},{name:"deadline",description:"When this needs to be resolved",required:false,defaultValue:"ASAP",example:"2026-04-15"}],body:`## Blocker
45
+
46
+ **Blocked by:** {{blocked_by}}
47
+
48
+ ### Impact
49
+ {{impact}}
50
+
51
+ ### Action Needed
52
+ {{needed_action}}
53
+
54
+ **Deadline:** {{deadline}}`},{id:"handoff-transition",name:"Task Handoff",description:"Provide context when handing off a task to another person",category:"workflow",variables:[{name:"from_person",description:"Person handing off",required:true,example:"John"},{name:"to_person",description:"Person receiving",required:true,example:"Jane"},{name:"context",description:"Current state and context",required:true,example:"Auth module is 80% complete, all tests passing"},{name:"remaining_work",description:"What still needs to be done",required:true,example:"Add OAuth2 provider support"},{name:"decisions",description:"Key decisions already made",required:false,example:"Using JWT for session management"}],body:`## Task Handoff
55
+
56
+ **From:** {{from_person}} **To:** {{to_person}}
57
+
58
+ ### Context
59
+ {{context}}
60
+
61
+ ### Remaining Work
62
+ {{remaining_work}}
63
+
64
+ {{#decisions}}### Key Decisions Made
65
+ {{decisions}}{{/decisions}}`},{id:"review-request",name:"Review Request",description:"Request a code review with context and focus areas",category:"communication",variables:[{name:"reviewer",description:"Who should review",required:true,example:"Jane"},{name:"summary",description:"Summary of changes",required:true,example:"Added user authentication with JWT"},{name:"link",description:"PR or branch link",required:true,example:"https://github.com/org/repo/pull/123"},{name:"focus_areas",description:"What to focus the review on",required:false,example:"Security of token generation"}],body:`## Review Request
66
+
67
+ **Reviewer:** {{reviewer}}
68
+
69
+ ### Changes
70
+ {{summary}}
71
+
72
+ **Link:** {{link}}
73
+
74
+ {{#focus_areas}}### Focus Areas
75
+ {{focus_areas}}{{/focus_areas}}`},{id:"sprint-update",name:"Sprint Update",description:"Sprint progress report with risks and decisions needed",category:"reporting",variables:[{name:"progress",description:"Sprint progress summary",required:true,example:"7 of 10 stories completed"},{name:"risks",description:"Current risks to sprint goal",required:true,example:"Auth integration may slip to next sprint"},{name:"decisions_needed",description:"Decisions that need to be made",required:false,example:"Should we de-scope OAuth2 support?"}],body:`## Sprint Update
76
+
77
+ ### Progress
78
+ {{progress}}
79
+
80
+ ### Risks
81
+ {{risks}}
82
+
83
+ {{#decisions_needed}}### Decisions Needed
84
+ {{decisions_needed}}{{/decisions_needed}}`},{id:"bug-report",name:"Bug Report",description:"Structured bug report with reproduction steps",category:"development",variables:[{name:"steps",description:"Steps to reproduce",required:true,example:`1. Login as admin
85
+ 2. Navigate to /settings
86
+ 3. Click "Save"`},{name:"expected",description:"Expected behavior",required:true,example:"Settings should be saved"},{name:"actual",description:"Actual behavior",required:true,example:"Error 500 returned"},{name:"environment",description:"Environment details",required:false,example:"Chrome 120, macOS 14.2"}],body:`## Bug Report
87
+
88
+ ### Steps to Reproduce
89
+ {{steps}}
90
+
91
+ ### Expected
92
+ {{expected}}
93
+
94
+ ### Actual
95
+ {{actual}}
96
+
97
+ {{#environment}}### Environment
98
+ {{environment}}{{/environment}}`},{id:"deployment-note",name:"Deployment Note",description:"Document a deployment with changes and rollback plan",category:"development",variables:[{name:"changes",description:"What was deployed",required:true,example:"User auth module v2.1"},{name:"rollback_plan",description:"How to rollback if needed",required:true,example:"Revert to tag v2.0.3"},{name:"monitoring",description:"What to monitor after deploy",required:false,example:"Watch error rate on /api/auth/*"}],body:`## Deployment Note
99
+
100
+ ### Changes
101
+ {{changes}}
102
+
103
+ ### Rollback Plan
104
+ {{rollback_plan}}
105
+
106
+ {{#monitoring}}### Monitoring
107
+ {{monitoring}}{{/monitoring}}`},{id:"time-log-summary",name:"Time Log Summary",description:"Summary of work performed with time spent",category:"reporting",variables:[{name:"duration",description:"Time spent",required:true,example:"2h 30m"},{name:"work_description",description:"What was done",required:true,example:"Refactored authentication middleware"}],body:`## Time Logged
108
+
109
+ **Duration:** {{duration}}
110
+
111
+ ### Work Performed
112
+ {{work_description}}`}];var aa=class{templates;constructor(e){let r=new Map;for(let n of hg)r.set(n.id,n);if(e)for(let n of e)r.set(n.id,n);this.templates=r;}getTemplate(e){let r=this.templates.get(e);if(!r)throw new ea(`Template "${e}" not found. Use listTemplates() to see available templates.`);return r}listTemplates(e){let r=[...this.templates.values()];return e?r.filter(n=>n.category===e):r}listCategories(){let e=new Set;for(let r of this.templates.values())e.add(r.category);return [...e]}};function wu(t){return {version:1,type:"doc",content:[{type:"paragraph",content:[{type:"text",text:t}]}]}}function Rr(t){let e=t.replace(/\\n/g,`
113
+ `);if(e.trim().length===0)return wu(e);try{let r=kg(e);return r.length===0?wu(e):{version:1,type:"doc",content:r}}catch{return wu(e)}}function Rz(t){return {lines:t.split(`
114
+ `),pos:0}}function $o(t){return t.lines[t.pos]}function Ct(t){let e=t.lines[t.pos]??"";return t.pos++,e}function So(t){return t.pos<t.lines.length}var yg=/^(#{1,6})\s+(.+)$/,Su=/^(\s*)[-*+]\s+(.*)$/,zu=/^(\s*)\d+\.\s+(.*)$/,_g=/^```(\w*)$/,Tu=/^>\s?(.*)$/,vg=/^(?:---+|\*\*\*+|___+)\s*$/;function kg(t){let e=Rz(t),r=[];for(;So(e);){let n=$o(e);if(n===void 0)break;if(n.trim()===""){Ct(e);continue}let o=_g.exec(n);if(o){r.push(Iz(e,o[1]??""));continue}if(vg.test(n)){Ct(e),r.push({type:"rule"});continue}let s=yg.exec(n);if(s){Ct(e);let a=(s[1]??"#").length,i=s[2]??"";r.push({type:"heading",attrs:{level:a},content:bg(i)});continue}if(Tu.test(n)){r.push(jz(e));continue}if(Su.test(n)){r.push(Cz(e));continue}if(zu.test(n)){r.push(Oz(e));continue}r.push(Nz(e));}return r}function Iz(t,e){Ct(t);let r=[];for(;So(t);){let o=$o(t);if(o!==void 0&&/^```\s*$/.test(o)){Ct(t);break}r.push(Ct(t));}let n=r.join(`
115
+ `);return {type:"codeBlock",attrs:{language:e||"text"},content:n.length>0?[{type:"text",text:n}]:[]}}function jz(t){let e=[];for(;So(t);){let o=$o(t);if(o===void 0)break;let s=Tu.exec(o);if(!s)break;Ct(t),e.push(s[1]??"");}let r=e.join(`
116
+ `),n=kg(r);return {type:"blockquote",content:n.length>0?n:[Pu([])]}}function Cz(t){return {type:"bulletList",content:xg(t,Su)}}function Oz(t){let e=xg(t,zu);return {type:"orderedList",attrs:{order:1},content:e}}function xg(t,e){let r=[];for(;So(t);){let n=$o(t);if(n===void 0)break;let o=e.exec(n);if(!o)break;Ct(t);let s=o[2]??"";r.push({type:"listItem",content:[Pu(bg(s))]});}return r}function Nz(t){let e=[];for(;So(t);){let n=$o(t);if(n===void 0||n.trim()===""||yg.test(n)||_g.test(n)||vg.test(n)||Tu.test(n)||Su.test(n)||zu.test(n))break;let o=Ct(t);if(o.endsWith(" ")||o.endsWith("\\")){let s=o.endsWith("\\")?o.slice(0,-1):o.trimEnd();e.push(s),e.push(`
117
+ `);}else e.push(o);}let r=e.join(" ").replace(/ \n /g,`
118
+ `);return Pu(Az(r))}function Pu(t){return {type:"paragraph",content:t.length>0?t:[{type:"text",text:" "}]}}function bg(t){return t.length===0?[]:wo(t)}function Az(t){if(t.length===0)return [];let e=t.split(`
119
+ `),r=[];for(let n=0;n<e.length;n++){let o=e[n];o!==void 0&&o.length>0&&r.push(...wo(o)),n<e.length-1&&r.push({type:"hardBreak"});}return r}function wo(t){let e=[],r=0,n="";function o(){n.length>0&&(e.push({type:"text",text:n}),n="");}for(;r<t.length;){let s=t[r],a=t[r+1];if(s==="\\"&&r+1<t.length){n+=t[r+1]??"",r+=2;continue}if(s==="`"){let i=t.indexOf("`",r+1);if(i!==-1){o();let c=t.slice(r+1,i);e.push(gg(c,[{type:"code"}])),r=i+1;continue}}if(s==="*"&&a==="*"||s==="_"&&a==="_"){let i=t.slice(r,r+2),c=t.indexOf(i,r+2);if(c!==-1){o();let u=t.slice(r+2,c),l=wo(u);for(let d of l)e.push($u(d,{type:"strong"}));r=c+2;continue}}if(s==="~"&&a==="~"){let i=t.indexOf("~~",r+2);if(i!==-1){o();let c=t.slice(r+2,i),u=wo(c);for(let l of u)e.push($u(l,{type:"strike"}));r=i+2;continue}}if((s==="*"||s==="_")&&a!==s){let i=Zz(t,s,r+1);if(i!==-1){o();let c=t.slice(r+1,i),u=wo(c);for(let l of u)e.push($u(l,{type:"em"}));r=i+1;continue}}if(s==="["){let i=Dz(t,r);if(i){o(),e.push(gg(i.text,[{type:"link",attrs:{href:i.href}}])),r=i.endPos;continue}}n+=s,r++;}return o(),e}function Zz(t,e,r){let n=r;for(;n<t.length;){if(t[n]==="\\"){n+=2;continue}if(t[n]===e){if(t[n+1]===e){n+=2;continue}return n}n++;}return -1}function Dz(t,e){if(t[e]!=="[")return;let r=t.indexOf("]",e+1);if(r===-1||t[r+1]!=="(")return;let n=t.indexOf(")",r+2);if(n!==-1)return {text:t.slice(e+1,r),href:t.slice(r+2,n),endPos:n+1}}function gg(t,e){return e.length===0?{type:"text",text:t}:{type:"text",text:t,marks:e}}function $u(t,e){if(t.type!=="text")return t;let r=t.marks??[];return {type:"text",text:t.text??"",marks:[...r,e]}}var wg="(No content)";function ia(t){if(t==null)return wg;try{let e=ct(t.content??[]).trim();return e.length>0?e:wg}catch{return `[ADF conversion failed]
120
+
121
+ ${JSON.stringify(t,null,2)}`}}function ct(t){return t.map(Mz).join("")}function Mz(t){switch(t.type){case "text":return qz(t.text??"",t.marks??[]);case "paragraph":return ct(t.content??[])+`
122
+
123
+ `;case "heading":{let e=t.attrs?.level??1;return `${"#".repeat(Math.min(e,6))} ${ct(t.content??[]).trim()}
124
+
125
+ `}case "bulletList":return $g(t.content??[],"-")+`
126
+ `;case "orderedList":return $g(t.content??[],"1.")+`
127
+ `;case "listItem":return ct(t.content??[]);case "codeBlock":{let e=t.attrs?.language??"",r=ct(t.content??[]).trim();return `\`\`\`${e}
128
+ ${r}
129
+ \`\`\`
130
+
131
+ `}case "blockquote":return ct(t.content??[]).trim().split(`
132
+ `).map(e=>`> ${e}`).join(`
133
+ `)+`
134
+
135
+ `;case "rule":return `---
136
+
137
+ `;case "hardBreak":return `
138
+ `;case "mention":return t.attrs?.text??"@unknown";case "emoji":return t.attrs?.shortName??"";case "inlineCard":{let e=t.attrs?.url;return e?`[${e}](${e})`:""}case "panel":{let e=t.attrs?.panelType??"info",r=ct(t.content??[]).trim();return `> **${e.toUpperCase()}:** ${r}
139
+
140
+ `}case "table":return Lz(t.content??[])+`
141
+ `;case "tableRow":case "tableHeader":case "tableCell":return ct(t.content??[]);case "mediaSingle":case "media":return `[media]
142
+
143
+ `;case "status":{let e=t.attrs?.text;return e?`[${e}]`:""}default:return t.content?ct(t.content):t.text??""}}function qz(t,e){let r=t;for(let n of e)switch(n.type){case "strong":r=`**${r}**`;break;case "em":r=`*${r}*`;break;case "strike":r=`~~${r}~~`;break;case "code":r=`\`${r}\``;break;case "link":{let o=n.attrs?.href;o&&(r=`[${r}](${o})`);break}case "underline":r=`<u>${r}</u>`;break;}return r}function $g(t,e){return t.map(r=>{let n=ct(r.content??[]).trim();return `${e} ${n}`}).join(`
144
+ `)}function Lz(t){if(t.length===0)return "";let e=[],r=false;for(let s of t){let a=[];for(let i of s.content??[])i.type==="tableHeader"&&(r=true),a.push(ct(i.content??[]).trim());e.push(a);}if(e.length===0)return "";let n=[],o=e[0]??[];if(n.push("| "+o.join(" | ")+" |"),r){n.push("| "+o.map(()=>"---").join(" | ")+" |");for(let s=1;s<e.length;s++){let a=e[s]??[];n.push("| "+a.join(" | ")+" |");}}else {n.push("| "+o.map(()=>"---").join(" | ")+" |");for(let s=1;s<e.length;s++){let a=e[s]??[];n.push("| "+a.join(" | ")+" |");}}return n.join(`
145
+ `)+`
146
+ `}var Uz=/(\d+)\s*h/i,Fz=/(\d+)\s*m/i,Vz=/\d+\s*d/i;function Sg(t){let e=t.trim();if(e.length===0)throw new Error("Invalid time format: empty string. Use: '2h', '30m', or '2h 30m'");if(Vz.test(e))throw new Error("Days (d) not supported. Use hours (h) and minutes (m) only. Example: '2h', '30m', or '2h 30m'");let r=0,n=Uz.exec(e);n?.[1]&&(r+=parseInt(n[1],10)*3600);let o=Fz.exec(e);if(o?.[1]&&(r+=parseInt(o[1],10)*60),r===0)throw new Error(`Invalid time format: '${t}'. Use: '2h', '30m', or '2h 30m'`);return r}var ca=class{constructor(e,r){this.connector=e;this.cacheManager=r;}connector;cacheManager;async changeStatus(e,r){let n=await this.connector.getTransitions(e),o=n.find(a=>a.toStatus.toLowerCase()===r.toLowerCase())??n.find(a=>a.name.toLowerCase()===r.toLowerCase());if(!o){let a=n.map(i=>`${i.name} -> ${i.toStatus}`).join(", ");throw new It(`Status '${r}' not available for ${e}. Available transitions: ${a}`)}await this.connector.doTransition(e,o.id);let s=await this.cacheManager.updateTask(e,{status:o.toStatus||r});return {taskKey:e,updatedTask:s}}async getAvailableStatuses(e){return (await this.connector.getTransitions(e)).map(n=>({id:n.id,name:n.name,toStatus:n.toStatus}))}async addComment(e,r){let n=Rr(r),o=await this.connector.addComment(e,n);return {taskKey:e,commentId:o.id,author:o.author,bodyMarkdown:ia(o.body),created:o.created}}async reassign(e,r){if(r){let o=await this.connector.findUser(r);await this.connector.assignIssue(e,o);}else await this.connector.assignIssue(e,null);let n=await this.cacheManager.updateTask(e,{assignee:r??null});return {taskKey:e,updatedTask:n}}async getTaskDetails(e){let r=await this.connector.getIssue(e),n=r.comments.map(o=>({id:o.id,author:o.author,body:ia(o.body),created:o.created}));return {key:r.key,summary:r.summary,description:ia(r.description),status:r.status,assignee:r.assignee,priority:r.priority,issueType:r.issueType,created:r.created,updated:r.updated,comments:n}}async logTime(e,r,n){let o=Sg(r),s=n?Rr(n):void 0,a=await this.connector.addWorklog(e,o,s);try{await this.cacheManager.deleteTask(e);}catch{}return {taskKey:e,worklogId:a.id,timeSpent:r,timeSpentSeconds:a.timeSpentSeconds}}async getTimeTracking(e){let r=await this.connector.getTimeTracking(e);return {taskKey:e,originalEstimate:r.originalEstimate,remainingEstimate:r.remainingEstimate,timeSpent:r.timeSpent}}};function X(t){return {content:[{type:"text",text:JSON.stringify({success:true,...t},null,2)}]}}function J(t){let e=t instanceof Error?t.message:String(t),r=t instanceof Wt?t.code:"UNKNOWN_ERROR";return {content:[{type:"text",text:JSON.stringify({success:false,error:e,code:r},null,2)}],isError:true}}function Ee(t,e,r){let n=t.getConnectorForTask(r);return new ca(n,e)}async function zg(t,e){try{let r={...t.jql?{jql:t.jql}:{},...t.project_key?{projectKey:t.project_key}:{}},n=await e.syncer.sync(r);return X({tasks_synced:n,message:`Synced ${n} tasks`})}catch(r){return J(r)}}async function Tg(t,e){try{if(t.task_key){let n=await e.cacheManager.getTask(t.task_key);return X({task:n})}let r=await e.cacheManager.getAllTasks();return X({tasks:r,count:r.length})}catch(r){return J(r)}}async function Pg(t,e){try{let n=await Ee(e.pool,e.cacheManager,t.task_key).changeStatus(t.task_key,t.status);return X({task:n.updatedTask,message:`Updated ${t.task_key} status to '${t.status}'`})}catch(r){return J(r)}}async function Eg(t,e){try{let n=await Ee(e.pool,e.cacheManager,t.task_key).addComment(t.task_key,t.comment);return X({comment:{id:n.commentId,author:n.author,body:n.bodyMarkdown,created:n.created},message:`Added comment to ${t.task_key}`})}catch(r){return J(r)}}async function Rg(t,e){try{let r=Ee(e.pool,e.cacheManager,t.task_key),n=t.assignee_email?.trim()||null,o=await r.reassign(t.task_key,n),s=n?`Reassigned ${t.task_key} to ${n}`:`Unassigned ${t.task_key}`;return X({task:o.updatedTask,message:s})}catch(r){return J(r)}}async function Ig(t,e){try{let n=await Ee(e.pool,e.cacheManager,t.task_key).getAvailableStatuses(t.task_key);return X({task_key:t.task_key,statuses:n.map(o=>({id:o.id,name:o.name,to_status:o.toStatus}))})}catch(r){return J(r)}}async function jg(t,e){try{let n=await Ee(e.pool,e.cacheManager,t.task_key).getTaskDetails(t.task_key),o=t.task_key.split("-")[0]??"",s=e.config.projects[o]?.language??e.config.default_language;return X({task:n,language:s,message:`Retrieved details for ${t.task_key}`})}catch(r){return J(r)}}async function Cg(t,e){try{let r=e.config.projects[t.project_key],n=r?.language??e.config.default_language;return X({project_key:t.project_key,language:n,source:r?.language?"project":"default",message:`Project ${t.project_key} language: ${n}`})}catch(r){return J(r)}}async function Og(t,e){try{let n=await Ee(e.pool,e.cacheManager,t.task_key).logTime(t.task_key,t.time_spent,t.comment);return X({message:`Logged ${t.time_spent} to ${t.task_key}`,worklog_id:n.worklogId,time_spent:n.timeSpent,time_spent_seconds:n.timeSpentSeconds})}catch(r){return J(r)}}async function Ng(t,e){try{let n=await Ee(e.pool,e.cacheManager,t.task_key).getTimeTracking(t.task_key);return X({task_key:t.task_key,time_tracking:{original_estimate:n.originalEstimate,time_spent:n.timeSpent,remaining_estimate:n.remainingEstimate},message:`Retrieved time tracking for ${t.task_key}`})}catch(r){return J(r)}}var Eu={WORKFLOW:"workflow",COMMUNICATION:"communication",REPORTING:"reporting",DEVELOPMENT:"development"};function Jz(t){return Object.values(Eu).includes(t)}async function Ag(t,e){try{let r;if(t.category){if(!Jz(t.category)){let s=Object.values(Eu).join(", ");return J(new Error(`Invalid category '${t.category}'. Valid categories: ${s}`))}r=t.category;}let n=e.templateRegistry.listTemplates(r),o=e.templateRegistry.listCategories();return X({templates:n.map(s=>({id:s.id,name:s.name,description:s.description,category:s.category,variables:s.variables.map(a=>({name:a.name,description:a.description,required:a.required,example:a.example}))})),categories:o,count:n.length})}catch(r){return J(r)}}var Hz=/\{\{#(\w+)\}\}([\s\S]*?)\{\{\/\1\}\}/g,Gz=/\{\{(\w+)\}\}/g;function Bz(t){let e=new Map;for(let r of t.variables)r.defaultValue!==void 0&&e.set(r.name,r.defaultValue);return e}function Kz(t,e){let r=[];for(let n of t.variables)n.required&&!(n.name in e)&&r.push(n.name);return r}function Wz(t){return t.replace(/\n{3,}/g,`
147
+
148
+ `)}function Zg(t,e){let r=Kz(t,e);if(r.length>0)return {success:false,error:`Missing required variables: ${r.join(", ")}`,missingVariables:r};let n=Bz(t),o=t.body;return o=o.replace(Hz,(s,a,i)=>{let c=e[a];return c!==void 0&&c!==""?i:""}),o=o.replace(Gz,(s,a)=>{if(a in e)return e[a]??"";let i=n.get(a);return i!==void 0?i:""}),o=Wz(o).trim(),{success:true,markdown:o}}async function Dg(t,e){try{if(t.template_id&&t.markdown)return J(new Error("Provide either template_id or markdown, not both."));if(!t.template_id&&!t.markdown)return J(new Error("Provide either template_id (with variables) or markdown."));let r,n;if(t.template_id){let a=e.templateRegistry.getTemplate(t.template_id),i=Zg(a,t.variables??{});if(!i.success)return J(new Error(i.error));r=i.markdown,n={template_id:a.id,template_name:a.name};}else r=t.markdown??"";let s=await Ee(e.pool,e.cacheManager,t.task_key).addComment(t.task_key,r);return X({comment:{id:s.commentId,author:s.author,body:s.bodyMarkdown,created:s.created},...n?{template:n}:{},message:`Added comment to ${t.task_key}`})}catch(r){return J(r)}}async function Yz(t){return (await t.getFields()).find(n=>n.custom&&n.name.toLowerCase()==="epic link")?.id}async function Mg(t,e){try{let r=e.pool.getConnector(t.project_key),n={project:{key:t.project_key},summary:t.summary,issuetype:{name:t.type??"Task"},priority:{name:t.priority??"Medium"}};if(t.description&&(n.description=Rr(t.description)),t.labels&&t.labels.length>0&&(n.labels=t.labels),t.assignee_email){let s=await r.findUser(t.assignee_email);n.assignee={accountId:s};}if(t.epic_key){let s=await Yz(r);s&&(n[s]=t.epic_key);}let o=await r.createIssue(n);return X({issue_key:o.key,url:o.url,summary:t.summary,message:`Created ${o.key}: ${t.summary}`})}catch(r){return J(r)}}async function qg(t,e){try{let r=t.task_key.split("-")[0]??"",n=e.pool.getConnector(r),o={};if(t.summary!==void 0&&(o.summary=t.summary),t.description!==void 0&&(o.description=Rr(t.description)),t.priority!==void 0&&(o.priority={name:t.priority}),t.labels!==void 0&&(o.labels=t.labels),Object.keys(o).length===0)return J(new Error("No fields to update. Provide at least one of: summary, description, priority, labels."));await n.updateIssue(t.task_key,o);let s=Object.keys(o).join(", ");return X({task_key:t.task_key,updated_fields:s,message:`Updated ${t.task_key}: ${s}`})}catch(r){return J(r)}}var Qz=50,Xz=["summary","status","assignee","priority","issuetype","created","updated","project","customfield_10014"];async function Lg(t,e){try{let r=t.project_key??e.config.default_project,n=e.pool.getConnector(r),o=t.max_results??Qz,s=await n.searchIssues(t.jql,Xz),a=s.slice(0,o);return X({results:a,count:a.length,total_available:s.length,message:`Found ${a.length} issue(s) matching JQL query`})}catch(r){return J(r)}}function eT(t){return {instanceUrl:t.instanceUrl,async searchIssues(e){return (await t.searchIssues(e)).map(n=>({key:n.key,fields:{summary:n.summary,status:{name:n.status},assignee:n.assignee?{emailAddress:n.assignee}:null,priority:n.priority?{name:n.priority}:null,issuetype:{name:n.issueType},created:n.created,updated:n.updated,project:{key:n.projectKey},customfield_10014:n.epicLink}}))}}}var tT=[{name:"sync_tasks",description:"Sync tasks from Jira to local cache. By default syncs from all configured instances. Optionally scope to a single project or provide a custom JQL query.",inputSchema:{type:"object",properties:{project_key:{type:"string",description:"Optional project key to sync from a single instance."},jql:{type:"string",description:"Optional JQL query. If omitted, fetches tasks assigned to the current user."}}}},{name:"read_cached_tasks",description:"Read tasks from local cache without hitting the Jira API. Returns a single task when task_key is provided, or all cached tasks otherwise.",inputSchema:{type:"object",properties:{task_key:{type:"string",description:'Optional task key (e.g. "PROJ-123"). If omitted, returns all cached tasks.'}}}},{name:"update_task_status",description:"Change a task status via Jira workflow transition and update the local cache.",inputSchema:{type:"object",properties:{task_key:{type:"string",description:'Task key (e.g. "PROJ-123").'},status:{type:"string",description:'Target status name (e.g. "In Progress", "Done"). Use get_task_statuses first to check valid transitions.'}},required:["task_key","status"]}},{name:"add_task_comment",description:"Add a markdown comment to a Jira task. The markdown is automatically converted to ADF format.",inputSchema:{type:"object",properties:{task_key:{type:"string",description:'Task key (e.g. "PROJ-123").'},comment:{type:"string",description:"Comment text in markdown format."}},required:["task_key","comment"]}},{name:"reassign_task",description:"Reassign a task to a different user by email, or unassign by providing an empty string or omitting assignee_email.",inputSchema:{type:"object",properties:{task_key:{type:"string",description:'Task key (e.g. "PROJ-123").'},assignee_email:{type:"string",description:"Email of the new assignee. Empty string or omit to unassign."}},required:["task_key"]}},{name:"get_task_statuses",description:"Get available workflow transitions for a task. Call this before update_task_status to see valid target statuses.",inputSchema:{type:"object",properties:{task_key:{type:"string",description:'Task key (e.g. "PROJ-123").'}},required:["task_key"]}},{name:"get_task_details",description:"Get full task details from Jira including description and all comments, with ADF content converted to markdown.",inputSchema:{type:"object",properties:{task_key:{type:"string",description:'Task key (e.g. "PROJ-123").'}},required:["task_key"]}},{name:"log_task_time",description:"Log work time to a Jira task. Uses hours and minutes format only (no days). Invalidates cache after logging.",inputSchema:{type:"object",properties:{task_key:{type:"string",description:'Task key (e.g. "PROJ-123").'},time_spent:{type:"string",description:'Time in format "2h", "30m", or "2h 30m". Days are not supported.'},comment:{type:"string",description:"Optional work description."}},required:["task_key","time_spent"]}},{name:"get_task_time_tracking",description:"Get time tracking information for a Jira task (original estimate, time spent, remaining estimate).",inputSchema:{type:"object",properties:{task_key:{type:"string",description:'Task key (e.g. "PROJ-123").'}},required:["task_key"]}},{name:"list_comment_templates",description:"List all available comment templates with optional category filter. Returns template metadata including required variables.",inputSchema:{type:"object",properties:{category:{type:"string",description:'Optional category filter: "workflow", "communication", "reporting", or "development".',enum:["workflow","communication","reporting","development"]}}}},{name:"add_templated_comment",description:"Add a comment using a registered template (with variable substitution) or raw markdown. Provide exactly one of template_id or markdown.",inputSchema:{type:"object",properties:{task_key:{type:"string",description:'Task key (e.g. "PROJ-123").'},template_id:{type:"string",description:"Template identifier. Use list_comment_templates to see available templates."},variables:{type:"object",description:"Key-value map of template variables. Required when using template_id.",additionalProperties:{type:"string"}},markdown:{type:"string",description:"Raw markdown comment. Use instead of template_id for freeform comments."}},required:["task_key"]}},{name:"create_task",description:"Create a new Jira issue with optional description, assignee, labels, and epic link.",inputSchema:{type:"object",properties:{project_key:{type:"string",description:'Project key (e.g. "DEVOPS"). Determines which Jira instance to use.'},summary:{type:"string",description:"Issue title / summary."},description:{type:"string",description:"Optional issue description in markdown format. Automatically converted to ADF."},type:{type:"string",description:'Issue type name (default "Task"). E.g. "Bug", "Story", "Epic".'},priority:{type:"string",description:'Priority name (default "Medium"). E.g. "High", "Low", "Critical".'},assignee_email:{type:"string",description:"Email of the assignee. Resolved to Jira account ID."},labels:{type:"array",items:{type:"string"},description:"Array of label strings to apply to the issue."},epic_key:{type:"string",description:'Epic issue key to link this issue under (e.g. "PROJ-100").'}},required:["project_key","summary"]}},{name:"get_project_language",description:"Get the configured language for a project. Use before writing comments or descriptions to determine the correct language.",inputSchema:{type:"object",properties:{project_key:{type:"string",description:'Project key (e.g. "DEVOPS"). Inferred from task key prefix.'}},required:["project_key"]}},{name:"update_task",description:"Update an existing Jira issue. Only provided fields are changed; omitted fields are left untouched.",inputSchema:{type:"object",properties:{task_key:{type:"string",description:'Task key (e.g. "DEVOPS-37"). Project is inferred from the key prefix.'},summary:{type:"string",description:"New issue title / summary."},description:{type:"string",description:"New issue description in markdown format. Automatically converted to ADF."},priority:{type:"string",description:'New priority name. E.g. "Medium", "Low", "Critical".'},labels:{type:"array",items:{type:"string"},description:"New set of label strings (replaces existing labels)."}},required:["task_key"]}},{name:"search_tasks",description:"Search Jira issues using JQL. Returns results directly without caching.",inputSchema:{type:"object",properties:{jql:{type:"string",description:"JQL query string."},max_results:{type:"number",description:"Maximum number of results to return (default 50)."},project_key:{type:"string",description:"Optional project key to determine which Jira instance to query. Defaults to the configured default project."}},required:["jql"]}}];function Fg(){return new Gs({name:"@softspark/jira-mcp",version:og},{capabilities:{tools:{}}})}async function rT(){let t=await pg(),e=new na(t),{GLOBAL_CACHE_DIR:r}=await Promise.resolve().then(()=>(xu(),lg)),n=r,o=new oa(n,t.credentials.username);await o.initialize();let s=new aa,a=new sa(o,t,(u,l,d)=>eT(e.getConnector(sT(t,u)??""))),i=Fg();i.setRequestHandler(yi,()=>({tools:tT})),i.setRequestHandler(qn,async u=>{let{name:l}=u.params,d=u.params.arguments??{};switch(l){case "sync_tasks":return zg({project_key:we(d.project_key),jql:we(d.jql)},{syncer:a});case "read_cached_tasks":return Tg({task_key:we(d.task_key)},{cacheManager:o});case "update_task_status":return Pg({task_key:Re(d.task_key,"task_key"),status:Re(d.status,"status")},{pool:e,cacheManager:o});case "add_task_comment":return Eg({task_key:Re(d.task_key,"task_key"),comment:Re(d.comment,"comment")},{pool:e,cacheManager:o});case "reassign_task":return Rg({task_key:Re(d.task_key,"task_key"),assignee_email:we(d.assignee_email)},{pool:e,cacheManager:o});case "get_task_statuses":return Ig({task_key:Re(d.task_key,"task_key")},{pool:e,cacheManager:o});case "get_task_details":return jg({task_key:Re(d.task_key,"task_key")},{pool:e,cacheManager:o,config:t});case "log_task_time":return Og({task_key:Re(d.task_key,"task_key"),time_spent:Re(d.time_spent,"time_spent"),comment:we(d.comment)},{pool:e,cacheManager:o});case "get_task_time_tracking":return Ng({task_key:Re(d.task_key,"task_key")},{pool:e,cacheManager:o});case "list_comment_templates":return Ag({category:we(d.category)},{templateRegistry:s});case "add_templated_comment":return Dg({task_key:Re(d.task_key,"task_key"),template_id:we(d.template_id),variables:oT(d.variables),markdown:we(d.markdown)},{pool:e,cacheManager:o,templateRegistry:s});case "create_task":return Mg({project_key:Re(d.project_key,"project_key"),summary:Re(d.summary,"summary"),description:we(d.description),type:we(d.type),priority:we(d.priority),assignee_email:we(d.assignee_email),labels:Ug(d.labels),epic_key:we(d.epic_key)},{pool:e,cacheManager:o});case "get_project_language":return Cg({project_key:Re(d.project_key,"project_key")},{config:t});case "update_task":return qg({task_key:Re(d.task_key,"task_key"),summary:we(d.summary),description:we(d.description),priority:we(d.priority),labels:Ug(d.labels)},{pool:e});case "search_tasks":return Lg({jql:Re(d.jql,"jql"),max_results:nT(d.max_results),project_key:we(d.project_key)},{pool:e,config:t});default:return J(new Error(`Unknown tool: ${l}`))}});let c=new Ks;await i.connect(c);}function we(t){return typeof t=="string"?t:void 0}function Re(t,e){if(typeof t!="string"||t.length===0)throw new Error(`Missing required parameter: ${e}`);return t}function nT(t){return typeof t=="number"?t:void 0}function Ug(t){if(Array.isArray(t))return t.map(e=>String(e))}function oT(t){if(t==null||typeof t!="object"||Array.isArray(t))return;let e={};for(let[r,n]of Object.entries(t))e[r]=String(n);return e}function sT(t,e){for(let[r,n]of Object.entries(t.projects))if(n.url===e)return r}export{Fg as createServer,rT as startServer};//# sourceMappingURL=index.js.map
149
+ //# sourceMappingURL=index.js.map