@sura_ai/mcp-server 0.5.2 → 0.7.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 +62 -61
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var BV=Object.create;var{getPrototypeOf:vV,defineProperty:_N,getOwnPropertyNames:JV}=Object;var HV=Object.prototype.hasOwnProperty;var kY=($,I,U)=>{U=$!=null?BV(vV($)):{};let D=I||!$||!$.__esModule?_N(U,"default",{value:$,enumerable:!0}):U;for(let b of JV($))if(!HV.call(D,b))_N(D,b,{get:()=>$[b],enumerable:!0});return D};var R=($,I)=>()=>(I||$((I={exports:{}}).exports,I),I.exports);var Z6=($,I)=>{for(var U in I)_N($,U,{get:I[U],enumerable:!0,configurable:!0,set:(D)=>I[U]=()=>D})};var iU=R((C5)=>{Object.defineProperty(C5,"__esModule",{value:!0});C5.regexpCode=C5.getEsmExportName=C5.getProperty=C5.safeStringify=C5.stringify=C5.strConcat=C5.addCodeArg=C5.str=C5._=C5.nil=C5._Code=C5.Name=C5.IDENTIFIER=C5._CodeOrName=void 0;class vA{}C5._CodeOrName=vA;C5.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class rI extends vA{constructor($){super();if(!C5.IDENTIFIER.test($))throw new Error("CodeGen: name must be a valid identifier");this.str=$}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}C5.Name=rI;class W6 extends vA{constructor($){super();this._items=typeof $==="string"?[$]:$}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let $=this._items[0];return $===""||$==='""'}get str(){var $;return($=this._str)!==null&&$!==void 0?$:this._str=this._items.reduce((I,U)=>`${I}${U}`,"")}get names(){var $;return($=this._names)!==null&&$!==void 0?$:this._names=this._items.reduce((I,U)=>{if(U instanceof rI)I[U.str]=(I[U.str]||0)+1;return I},{})}}C5._Code=W6;C5.nil=new W6("");function T5($,...I){let U=[$[0]],D=0;while(D<I.length)L9(U,I[D]),U.push($[++D]);return new W6(U)}C5._=T5;var H9=new W6("+");function _5($,...I){let U=[uU($[0])],D=0;while(D<I.length)U.push(H9),L9(U,I[D]),U.push(H9,uU($[++D]));return Wk(U),new W6(U)}C5.str=_5;function L9($,I){if(I instanceof W6)$.push(...I._items);else if(I instanceof rI)$.push(I);else $.push(Yk(I))}C5.addCodeArg=L9;function Wk($){let I=1;while(I<$.length-1){if($[I]===H9){let U=Gk($[I-1],$[I+1]);if(U!==void 0){$.splice(I-1,3,U);continue}$[I++]="+"}I++}}function Gk($,I){if(I==='""')return $;if($==='""')return I;if(typeof $=="string"){if(I instanceof rI||$[$.length-1]!=='"')return;if(typeof I!="string")return`${$.slice(0,-1)}${I}"`;if(I[0]==='"')return $.slice(0,-1)+I.slice(1);return}if(typeof I=="string"&&I[0]==='"'&&!($ instanceof rI))return`"${$}${I.slice(1)}`;return}function Qk($,I){return I.emptyStr()?$:$.emptyStr()?I:_5`${$}${I}`}C5.strConcat=Qk;function Yk($){return typeof $=="number"||typeof $=="boolean"||$===null?$:uU(Array.isArray($)?$.join(","):$)}function Bk($){return new W6(uU($))}C5.stringify=Bk;function uU($){return JSON.stringify($).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}C5.safeStringify=uU;function vk($){return typeof $=="string"&&C5.IDENTIFIER.test($)?new W6(`.${$}`):T5`[${$}]`}C5.getProperty=vk;function Jk($){if(typeof $=="string"&&C5.IDENTIFIER.test($))return new W6(`${$}`);throw new Error(`CodeGen: invalid export name: ${$}, use explicit $id name mapping`)}C5.getEsmExportName=Jk;function Hk($){return new W6($.toString())}C5.regexpCode=Hk});var K9=R((y5)=>{Object.defineProperty(y5,"__esModule",{value:!0});y5.ValueScope=y5.ValueScopeName=y5.Scope=y5.varKinds=y5.UsedValueState=void 0;var c$=iU();class f5 extends Error{constructor($){super(`CodeGen: "code" for ${$} not defined`);this.value=$.value}}var HA;(function($){$[$.Started=0]="Started",$[$.Completed=1]="Completed"})(HA||(y5.UsedValueState=HA={}));y5.varKinds={const:new c$.Name("const"),let:new c$.Name("let"),var:new c$.Name("var")};class V9{constructor({prefixes:$,parent:I}={}){this._names={},this._prefixes=$,this._parent=I}toName($){return $ instanceof c$.Name?$:this.name($)}name($){return new c$.Name(this._newName($))}_newName($){let I=this._names[$]||this._nameGroup($);return`${$}${I.index++}`}_nameGroup($){var I,U;if(((U=(I=this._parent)===null||I===void 0?void 0:I._prefixes)===null||U===void 0?void 0:U.has($))||this._prefixes&&!this._prefixes.has($))throw new Error(`CodeGen: prefix "${$}" is not allowed in this scope`);return this._names[$]={prefix:$,index:0}}}y5.Scope=V9;class M9 extends c$.Name{constructor($,I){super(I);this.prefix=$}setValue($,{property:I,itemIndex:U}){this.value=$,this.scopePath=c$._`.${new c$.Name(I)}[${U}]`}}y5.ValueScopeName=M9;var Rk=c$._`\n`;class g5 extends V9{constructor($){super($);this._values={},this._scope=$.scope,this.opts={...$,_n:$.lines?Rk:c$.nil}}get(){return this._scope}name($){return new M9($,this._newName($))}value($,I){var U;if(I.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let D=this.toName($),{prefix:b}=D,w=(U=I.key)!==null&&U!==void 0?U:I.ref,A=this._values[b];if(A){let X=A.get(w);if(X)return X}else A=this._values[b]=new Map;A.set(w,D);let N=this._scope[b]||(this._scope[b]=[]),O=N.length;return N[O]=I.ref,D.setValue(I,{property:b,itemIndex:O}),D}getValue($,I){let U=this._values[$];if(!U)return;return U.get(I)}scopeRefs($,I=this._values){return this._reduceValues(I,(U)=>{if(U.scopePath===void 0)throw new Error(`CodeGen: name "${U}" has no value`);return c$._`${$}${U.scopePath}`})}scopeCode($=this._values,I,U){return this._reduceValues($,(D)=>{if(D.value===void 0)throw new Error(`CodeGen: name "${D}" has no value`);return D.value.code},I,U)}_reduceValues($,I,U={},D){let b=c$.nil;for(let w in $){let A=$[w];if(!A)continue;let N=U[w]=U[w]||new Map;A.forEach((O)=>{if(N.has(O))return;N.set(O,HA.Started);let X=I(O);if(X){let G=this.opts.es5?y5.varKinds.var:y5.varKinds.const;b=c$._`${b}${G} ${O} = ${X};${this.opts._n}`}else if(X=D===null||D===void 0?void 0:D(O))b=c$._`${b}${X}${this.opts._n}`;else throw new f5(O);N.set(O,HA.Completed)})}return b}}y5.ValueScope=g5});var d=R((r$)=>{Object.defineProperty(r$,"__esModule",{value:!0});r$.or=r$.and=r$.not=r$.CodeGen=r$.operators=r$.varKinds=r$.ValueScopeName=r$.ValueScope=r$.Scope=r$.Name=r$.regexpCode=r$.stringify=r$.getProperty=r$.nil=r$.strConcat=r$.str=r$._=void 0;var U$=iU(),G6=K9(),v4=iU();Object.defineProperty(r$,"_",{enumerable:!0,get:function(){return v4._}});Object.defineProperty(r$,"str",{enumerable:!0,get:function(){return v4.str}});Object.defineProperty(r$,"strConcat",{enumerable:!0,get:function(){return v4.strConcat}});Object.defineProperty(r$,"nil",{enumerable:!0,get:function(){return v4.nil}});Object.defineProperty(r$,"getProperty",{enumerable:!0,get:function(){return v4.getProperty}});Object.defineProperty(r$,"stringify",{enumerable:!0,get:function(){return v4.stringify}});Object.defineProperty(r$,"regexpCode",{enumerable:!0,get:function(){return v4.regexpCode}});Object.defineProperty(r$,"Name",{enumerable:!0,get:function(){return v4.Name}});var FA=K9();Object.defineProperty(r$,"Scope",{enumerable:!0,get:function(){return FA.Scope}});Object.defineProperty(r$,"ValueScope",{enumerable:!0,get:function(){return FA.ValueScope}});Object.defineProperty(r$,"ValueScopeName",{enumerable:!0,get:function(){return FA.ValueScopeName}});Object.defineProperty(r$,"varKinds",{enumerable:!0,get:function(){return FA.varKinds}});r$.operators={GT:new U$._Code(">"),GTE:new U$._Code(">="),LT:new U$._Code("<"),LTE:new U$._Code("<="),EQ:new U$._Code("==="),NEQ:new U$._Code("!=="),NOT:new U$._Code("!"),OR:new U$._Code("||"),AND:new U$._Code("&&"),ADD:new U$._Code("+")};class J4{optimizeNodes(){return this}optimizeNames($,I){return this}}class l5 extends J4{constructor($,I,U){super();this.varKind=$,this.name=I,this.rhs=U}render({es5:$,_n:I}){let U=$?G6.varKinds.var:this.varKind,D=this.rhs===void 0?"":` = ${this.rhs}`;return`${U} ${this.name}${D};`+I}optimizeNames($,I){if(!$[this.name.str])return;if(this.rhs)this.rhs=oI(this.rhs,$,I);return this}get names(){return this.rhs instanceof U$._CodeOrName?this.rhs.names:{}}}class k9 extends J4{constructor($,I,U){super();this.lhs=$,this.rhs=I,this.sideEffects=U}render({_n:$}){return`${this.lhs} = ${this.rhs};`+$}optimizeNames($,I){if(this.lhs instanceof U$.Name&&!$[this.lhs.str]&&!this.sideEffects)return;return this.rhs=oI(this.rhs,$,I),this}get names(){let $=this.lhs instanceof U$.Name?{}:{...this.lhs.names};return KA($,this.rhs)}}class h5 extends k9{constructor($,I,U,D){super($,U,D);this.op=I}render({_n:$}){return`${this.lhs} ${this.op}= ${this.rhs};`+$}}class u5 extends J4{constructor($){super();this.label=$,this.names={}}render({_n:$}){return`${this.label}:`+$}}class i5 extends J4{constructor($){super();this.label=$,this.names={}}render({_n:$}){return`break${this.label?` ${this.label}`:""};`+$}}class n5 extends J4{constructor($){super();this.error=$}render({_n:$}){return`throw ${this.error};`+$}get names(){return this.error.names}}class c5 extends J4{constructor($){super();this.code=$}render({_n:$}){return`${this.code};`+$}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames($,I){return this.code=oI(this.code,$,I),this}get names(){return this.code instanceof U$._CodeOrName?this.code.names:{}}}class qA extends J4{constructor($=[]){super();this.nodes=$}render($){return this.nodes.reduce((I,U)=>I+U.render($),"")}optimizeNodes(){let{nodes:$}=this,I=$.length;while(I--){let U=$[I].optimizeNodes();if(Array.isArray(U))$.splice(I,1,...U);else if(U)$[I]=U;else $.splice(I,1)}return $.length>0?this:void 0}optimizeNames($,I){let{nodes:U}=this,D=U.length;while(D--){let b=U[D];if(b.optimizeNames($,I))continue;Zk($,b.names),U.splice(D,1)}return U.length>0?this:void 0}get names(){return this.nodes.reduce(($,I)=>i4($,I.names),{})}}class H4 extends qA{render($){return"{"+$._n+super.render($)+"}"+$._n}}class r5 extends qA{}class nU extends H4{}nU.kind="else";class u6 extends H4{constructor($,I){super(I);this.condition=$}render($){let I=`if(${this.condition})`+super.render($);if(this.else)I+="else "+this.else.render($);return I}optimizeNodes(){super.optimizeNodes();let $=this.condition;if($===!0)return this.nodes;let I=this.else;if(I){let U=I.optimizeNodes();I=this.else=Array.isArray(U)?new nU(U):U}if(I){if($===!1)return I instanceof u6?I:I.nodes;if(this.nodes.length)return this;return new u6(t5($),I instanceof u6?[I]:I.nodes)}if($===!1||!this.nodes.length)return;return this}optimizeNames($,I){var U;if(this.else=(U=this.else)===null||U===void 0?void 0:U.optimizeNames($,I),!(super.optimizeNames($,I)||this.else))return;return this.condition=oI(this.condition,$,I),this}get names(){let $=super.names;if(KA($,this.condition),this.else)i4($,this.else.names);return $}}u6.kind="if";class mI extends H4{}mI.kind="for";class m5 extends mI{constructor($){super();this.iteration=$}render($){return`for(${this.iteration})`+super.render($)}optimizeNames($,I){if(!super.optimizeNames($,I))return;return this.iteration=oI(this.iteration,$,I),this}get names(){return i4(super.names,this.iteration.names)}}class o5 extends mI{constructor($,I,U,D){super();this.varKind=$,this.name=I,this.from=U,this.to=D}render($){let I=$.es5?G6.varKinds.var:this.varKind,{name:U,from:D,to:b}=this;return`for(${I} ${U}=${D}; ${U}<${b}; ${U}++)`+super.render($)}get names(){let $=KA(super.names,this.from);return KA($,this.to)}}class F9 extends mI{constructor($,I,U,D){super();this.loop=$,this.varKind=I,this.name=U,this.iterable=D}render($){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render($)}optimizeNames($,I){if(!super.optimizeNames($,I))return;return this.iterable=oI(this.iterable,$,I),this}get names(){return i4(super.names,this.iterable.names)}}class LA extends H4{constructor($,I,U){super();this.name=$,this.args=I,this.async=U}render($){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render($)}}LA.kind="func";class zA extends qA{render($){return"return "+super.render($)}}zA.kind="return";class d5 extends H4{render($){let I="try"+super.render($);if(this.catch)I+=this.catch.render($);if(this.finally)I+=this.finally.render($);return I}optimizeNodes(){var $,I;return super.optimizeNodes(),($=this.catch)===null||$===void 0||$.optimizeNodes(),(I=this.finally)===null||I===void 0||I.optimizeNodes(),this}optimizeNames($,I){var U,D;return super.optimizeNames($,I),(U=this.catch)===null||U===void 0||U.optimizeNames($,I),(D=this.finally)===null||D===void 0||D.optimizeNames($,I),this}get names(){let $=super.names;if(this.catch)i4($,this.catch.names);if(this.finally)i4($,this.finally.names);return $}}class VA extends H4{constructor($){super();this.error=$}render($){return`catch(${this.error})`+super.render($)}}VA.kind="catch";class MA extends H4{render($){return"finally"+super.render($)}}MA.kind="finally";class p5{constructor($,I={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...I,_n:I.lines?`
|
|
3
|
-
`:""},this._extScope=$,this._scope=new G6.Scope({parent:$}),this._nodes=[new r5]}toString(){return this._root.render(this.opts)}name($){return this._scope.name($)}scopeName($){return this._extScope.name($)}scopeValue($,I){let U=this._extScope.value($,I);return(this._values[U.prefix]||(this._values[U.prefix]=new Set)).add(U),U}getScopeValue($,I){return this._extScope.getValue($,I)}scopeRefs($){return this._extScope.scopeRefs($,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def($,I,U,D){let b=this._scope.toName(I);if(U!==void 0&&D)this._constants[b.str]=U;return this._leafNode(new l5($,b,U)),b}const($,I,U){return this._def(G6.varKinds.const,$,I,U)}let($,I,U){return this._def(G6.varKinds.let,$,I,U)}var($,I,U){return this._def(G6.varKinds.var,$,I,U)}assign($,I,U){return this._leafNode(new k9($,I,U))}add($,I){return this._leafNode(new h5($,r$.operators.ADD,I))}code($){if(typeof $=="function")$();else if($!==U$.nil)this._leafNode(new c5($));return this}object(...$){let I=["{"];for(let[U,D]of $){if(I.length>1)I.push(",");if(I.push(U),U!==D||this.opts.es5)I.push(":"),U$.addCodeArg(I,D)}return I.push("}"),new U$._Code(I)}if($,I,U){if(this._blockNode(new u6($)),I&&U)this.code(I).else().code(U).endIf();else if(I)this.code(I).endIf();else if(U)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf($){return this._elseNode(new u6($))}else(){return this._elseNode(new nU)}endIf(){return this._endBlockNode(u6,nU)}_for($,I){if(this._blockNode($),I)this.code(I).endFor();return this}for($,I){return this._for(new m5($),I)}forRange($,I,U,D,b=this.opts.es5?G6.varKinds.var:G6.varKinds.let){let w=this._scope.toName($);return this._for(new o5(b,w,I,U),()=>D(w))}forOf($,I,U,D=G6.varKinds.const){let b=this._scope.toName($);if(this.opts.es5){let w=I instanceof U$.Name?I:this.var("_arr",I);return this.forRange("_i",0,U$._`${w}.length`,(A)=>{this.var(b,U$._`${w}[${A}]`),U(b)})}return this._for(new F9("of",D,b,I),()=>U(b))}forIn($,I,U,D=this.opts.es5?G6.varKinds.var:G6.varKinds.const){if(this.opts.ownProperties)return this.forOf($,U$._`Object.keys(${I})`,U);let b=this._scope.toName($);return this._for(new F9("in",D,b,I),()=>U(b))}endFor(){return this._endBlockNode(mI)}label($){return this._leafNode(new u5($))}break($){return this._leafNode(new i5($))}return($){let I=new zA;if(this._blockNode(I),this.code($),I.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(zA)}try($,I,U){if(!I&&!U)throw new Error('CodeGen: "try" without "catch" and "finally"');let D=new d5;if(this._blockNode(D),this.code($),I){let b=this.name("e");this._currNode=D.catch=new VA(b),I(b)}if(U)this._currNode=D.finally=new MA,this.code(U);return this._endBlockNode(VA,MA)}throw($){return this._leafNode(new n5($))}block($,I){if(this._blockStarts.push(this._nodes.length),$)this.code($).endBlock(I);return this}endBlock($){let I=this._blockStarts.pop();if(I===void 0)throw new Error("CodeGen: not in self-balancing block");let U=this._nodes.length-I;if(U<0||$!==void 0&&U!==$)throw new Error(`CodeGen: wrong number of nodes: ${U} vs ${$} expected`);return this._nodes.length=I,this}func($,I=U$.nil,U,D){if(this._blockNode(new LA($,I,U)),D)this.code(D).endFunc();return this}endFunc(){return this._endBlockNode(LA)}optimize($=1){while($-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode($){return this._currNode.nodes.push($),this}_blockNode($){this._currNode.nodes.push($),this._nodes.push($)}_endBlockNode($,I){let U=this._currNode;if(U instanceof $||I&&U instanceof I)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${I?`${$.kind}/${I.kind}`:$.kind}"`)}_elseNode($){let I=this._currNode;if(!(I instanceof u6))throw new Error('CodeGen: "else" without "if"');return this._currNode=I.else=$,this}get _root(){return this._nodes[0]}get _currNode(){let $=this._nodes;return $[$.length-1]}set _currNode($){let I=this._nodes;I[I.length-1]=$}}r$.CodeGen=p5;function i4($,I){for(let U in I)$[U]=($[U]||0)+(I[U]||0);return $}function KA($,I){return I instanceof U$._CodeOrName?i4($,I.names):$}function oI($,I,U){if($ instanceof U$.Name)return D($);if(!b($))return $;return new U$._Code($._items.reduce((w,A)=>{if(A instanceof U$.Name)A=D(A);if(A instanceof U$._Code)w.push(...A._items);else w.push(A);return w},[]));function D(w){let A=U[w.str];if(A===void 0||I[w.str]!==1)return w;return delete I[w.str],A}function b(w){return w instanceof U$._Code&&w._items.some((A)=>A instanceof U$.Name&&I[A.str]===1&&U[A.str]!==void 0)}}function Zk($,I){for(let U in I)$[U]=($[U]||0)-(I[U]||0)}function t5($){return typeof $=="boolean"||typeof $=="number"||$===null?!$:U$._`!${q9($)}`}r$.not=t5;var fk=a5(r$.operators.AND);function gk(...$){return $.reduce(fk)}r$.and=gk;var yk=a5(r$.operators.OR);function xk(...$){return $.reduce(yk)}r$.or=xk;function a5($){return(I,U)=>I===U$.nil?U:U===U$.nil?I:U$._`${q9(I)} ${$} ${q9(U)}`}function q9($){return $ instanceof U$.Name?$:U$._`(${$})`}});var w$=R((Av)=>{Object.defineProperty(Av,"__esModule",{value:!0});Av.checkStrictMode=Av.getErrorPath=Av.Type=Av.useFunc=Av.setEvaluated=Av.evaluatedPropsToName=Av.mergeEvaluated=Av.eachItem=Av.unescapeJsonPointer=Av.escapeJsonPointer=Av.escapeFragment=Av.unescapeFragment=Av.schemaRefOrVal=Av.schemaHasRulesButRef=Av.schemaHasRules=Av.checkUnknownRules=Av.alwaysValidSchema=Av.toHash=void 0;var v$=d(),ik=iU();function nk($){let I={};for(let U of $)I[U]=!0;return I}Av.toHash=nk;function ck($,I){if(typeof I=="boolean")return I;if(Object.keys(I).length===0)return!0;return Iv($,I),!Uv(I,$.self.RULES.all)}Av.alwaysValidSchema=ck;function Iv($,I=$.schema){let{opts:U,self:D}=$;if(!U.strictSchema)return;if(typeof I==="boolean")return;let b=D.RULES.keywords;for(let w in I)if(!b[w])wv($,`unknown keyword: "${w}"`)}Av.checkUnknownRules=Iv;function Uv($,I){if(typeof $=="boolean")return!$;for(let U in $)if(I[U])return!0;return!1}Av.schemaHasRules=Uv;function rk($,I){if(typeof $=="boolean")return!$;for(let U in $)if(U!=="$ref"&&I.all[U])return!0;return!1}Av.schemaHasRulesButRef=rk;function mk({topSchemaRef:$,schemaPath:I},U,D,b){if(!b){if(typeof U=="number"||typeof U=="boolean")return U;if(typeof U=="string")return v$._`${U}`}return v$._`${$}${I}${v$.getProperty(D)}`}Av.schemaRefOrVal=mk;function ok($){return bv(decodeURIComponent($))}Av.unescapeFragment=ok;function dk($){return encodeURIComponent(j9($))}Av.escapeFragment=dk;function j9($){if(typeof $=="number")return`${$}`;return $.replace(/~/g,"~0").replace(/\//g,"~1")}Av.escapeJsonPointer=j9;function bv($){return $.replace(/~1/g,"/").replace(/~0/g,"~")}Av.unescapeJsonPointer=bv;function pk($,I){if(Array.isArray($))for(let U of $)I(U);else I($)}Av.eachItem=pk;function s5({mergeNames:$,mergeToName:I,mergeValues:U,resultToName:D}){return(b,w,A,N)=>{let O=A===void 0?w:A instanceof v$.Name?(w instanceof v$.Name?$(b,w,A):I(b,w,A),A):w instanceof v$.Name?(I(b,A,w),w):U(w,A);return N===v$.Name&&!(O instanceof v$.Name)?D(b,O):O}}Av.mergeEvaluated={props:s5({mergeNames:($,I,U)=>$.if(v$._`${U} !== true && ${I} !== undefined`,()=>{$.if(v$._`${I} === true`,()=>$.assign(U,!0),()=>$.assign(U,v$._`${U} || {}`).code(v$._`Object.assign(${U}, ${I})`))}),mergeToName:($,I,U)=>$.if(v$._`${U} !== true`,()=>{if(I===!0)$.assign(U,!0);else $.assign(U,v$._`${U} || {}`),S9($,U,I)}),mergeValues:($,I)=>$===!0?!0:{...$,...I},resultToName:Dv}),items:s5({mergeNames:($,I,U)=>$.if(v$._`${U} !== true && ${I} !== undefined`,()=>$.assign(U,v$._`${I} === true ? true : ${U} > ${I} ? ${U} : ${I}`)),mergeToName:($,I,U)=>$.if(v$._`${U} !== true`,()=>$.assign(U,I===!0?!0:v$._`${U} > ${I} ? ${U} : ${I}`)),mergeValues:($,I)=>$===!0?!0:Math.max($,I),resultToName:($,I)=>$.var("items",I)})};function Dv($,I){if(I===!0)return $.var("props",!0);let U=$.var("props",v$._`{}`);if(I!==void 0)S9($,U,I);return U}Av.evaluatedPropsToName=Dv;function S9($,I,U){Object.keys(U).forEach((D)=>$.assign(v$._`${I}${v$.getProperty(D)}`,!0))}Av.setEvaluated=S9;var $v={};function tk($,I){return $.scopeValue("func",{ref:I,code:$v[I.code]||($v[I.code]=new ik._Code(I.code))})}Av.useFunc=tk;var E9;(function($){$[$.Num=0]="Num",$[$.Str=1]="Str"})(E9||(Av.Type=E9={}));function ak($,I,U){if($ instanceof v$.Name){let D=I===E9.Num;return U?D?v$._`"[" + ${$} + "]"`:v$._`"['" + ${$} + "']"`:D?v$._`"/" + ${$}`:v$._`"/" + ${$}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return U?v$.getProperty($).toString():"/"+j9($)}Av.getErrorPath=ak;function wv($,I,U=$.opts.strictSchema){if(!U)return;if(I=`strict mode: ${I}`,U===!0)throw new Error(I);$.self.logger.warn(I)}Av.checkStrictMode=wv});var i6=R((Ov)=>{Object.defineProperty(Ov,"__esModule",{value:!0});var C$=d(),vE={data:new C$.Name("data"),valCxt:new C$.Name("valCxt"),instancePath:new C$.Name("instancePath"),parentData:new C$.Name("parentData"),parentDataProperty:new C$.Name("parentDataProperty"),rootData:new C$.Name("rootData"),dynamicAnchors:new C$.Name("dynamicAnchors"),vErrors:new C$.Name("vErrors"),errors:new C$.Name("errors"),this:new C$.Name("this"),self:new C$.Name("self"),scope:new C$.Name("scope"),json:new C$.Name("json"),jsonPos:new C$.Name("jsonPos"),jsonLen:new C$.Name("jsonLen"),jsonPart:new C$.Name("jsonPart")};Ov.default=vE});var cU=R((Qv)=>{Object.defineProperty(Qv,"__esModule",{value:!0});Qv.extendErrors=Qv.resetErrorsCount=Qv.reportExtraError=Qv.reportError=Qv.keyword$DataError=Qv.keywordError=void 0;var b$=d(),EA=w$(),l$=i6();Qv.keywordError={message:({keyword:$})=>b$.str`must pass "${$}" keyword validation`};Qv.keyword$DataError={message:({keyword:$,schemaType:I})=>I?b$.str`"${$}" keyword must be ${I} ($data)`:b$.str`"${$}" keyword is invalid ($data)`};function HE($,I=Qv.keywordError,U,D){let{it:b}=$,{gen:w,compositeRule:A,allErrors:N}=b,O=Gv($,I,U);if(D!==null&&D!==void 0?D:A||N)Xv(w,O);else Wv(b,b$._`[${O}]`)}Qv.reportError=HE;function LE($,I=Qv.keywordError,U){let{it:D}=$,{gen:b,compositeRule:w,allErrors:A}=D,N=Gv($,I,U);if(Xv(b,N),!(w||A))Wv(D,l$.default.vErrors)}Qv.reportExtraError=LE;function zE($,I){$.assign(l$.default.errors,I),$.if(b$._`${l$.default.vErrors} !== null`,()=>$.if(I,()=>$.assign(b$._`${l$.default.vErrors}.length`,I),()=>$.assign(l$.default.vErrors,null)))}Qv.resetErrorsCount=zE;function VE({gen:$,keyword:I,schemaValue:U,data:D,errsCount:b,it:w}){if(b===void 0)throw new Error("ajv implementation error");let A=$.name("err");$.forRange("i",b,l$.default.errors,(N)=>{if($.const(A,b$._`${l$.default.vErrors}[${N}]`),$.if(b$._`${A}.instancePath === undefined`,()=>$.assign(b$._`${A}.instancePath`,b$.strConcat(l$.default.instancePath,w.errorPath))),$.assign(b$._`${A}.schemaPath`,b$.str`${w.errSchemaPath}/${I}`),w.opts.verbose)$.assign(b$._`${A}.schema`,U),$.assign(b$._`${A}.data`,D)})}Qv.extendErrors=VE;function Xv($,I){let U=$.const("err",I);$.if(b$._`${l$.default.vErrors} === null`,()=>$.assign(l$.default.vErrors,b$._`[${U}]`),b$._`${l$.default.vErrors}.push(${U})`),$.code(b$._`${l$.default.errors}++`)}function Wv($,I){let{gen:U,validateName:D,schemaEnv:b}=$;if(b.$async)U.throw(b$._`new ${$.ValidationError}(${I})`);else U.assign(b$._`${D}.errors`,I),U.return(!1)}var n4={keyword:new b$.Name("keyword"),schemaPath:new b$.Name("schemaPath"),params:new b$.Name("params"),propertyName:new b$.Name("propertyName"),message:new b$.Name("message"),schema:new b$.Name("schema"),parentSchema:new b$.Name("parentSchema")};function Gv($,I,U){let{createErrors:D}=$.it;if(D===!1)return b$._`{}`;return ME($,I,U)}function ME($,I,U={}){let{gen:D,it:b}=$,w=[KE(b,U),FE($,U)];return qE($,I,w),D.object(...w)}function KE({errorPath:$},{instancePath:I}){let U=I?b$.str`${$}${EA.getErrorPath(I,EA.Type.Str)}`:$;return[l$.default.instancePath,b$.strConcat(l$.default.instancePath,U)]}function FE({keyword:$,it:{errSchemaPath:I}},{schemaPath:U,parentSchema:D}){let b=D?I:b$.str`${I}/${$}`;if(U)b=b$.str`${b}${EA.getErrorPath(U,EA.Type.Str)}`;return[n4.schemaPath,b]}function qE($,{params:I,message:U},D){let{keyword:b,data:w,schemaValue:A,it:N}=$,{opts:O,propertyName:X,topSchemaRef:G,schemaPath:Q}=N;if(D.push([n4.keyword,b],[n4.params,typeof I=="function"?I($):I||b$._`{}`]),O.messages)D.push([n4.message,typeof U=="function"?U($):U]);if(O.verbose)D.push([n4.schema,A],[n4.parentSchema,b$._`${G}${Q}`],[l$.default.data,w]);if(X)D.push([n4.propertyName,X])}});var Hv=R((vv)=>{Object.defineProperty(vv,"__esModule",{value:!0});vv.boolOrEmptySchema=vv.topBoolOrEmptySchema=void 0;var PE=cU(),RE=d(),TE=i6(),_E={message:"boolean schema is false"};function CE($){let{gen:I,schema:U,validateName:D}=$;if(U===!1)Bv($,!1);else if(typeof U=="object"&&U.$async===!0)I.return(TE.default.data);else I.assign(RE._`${D}.errors`,null),I.return(!0)}vv.topBoolOrEmptySchema=CE;function ZE($,I){let{gen:U,schema:D}=$;if(D===!1)U.var(I,!1),Bv($);else U.var(I,!0)}vv.boolOrEmptySchema=ZE;function Bv($,I){let{gen:U,data:D}=$,b={gen:U,keyword:"false schema",data:D,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:$};PE.reportError(b,_E,void 0,I)}});var R9=R((Lv)=>{Object.defineProperty(Lv,"__esModule",{value:!0});Lv.getRules=Lv.isJSONType=void 0;var gE=["string","number","integer","boolean","null","object","array"],yE=new Set(gE);function xE($){return typeof $=="string"&&yE.has($)}Lv.isJSONType=xE;function lE(){let $={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...$,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},$.number,$.string,$.array,$.object],post:{rules:[]},all:{},keywords:{}}}Lv.getRules=lE});var T9=R((Kv)=>{Object.defineProperty(Kv,"__esModule",{value:!0});Kv.shouldUseRule=Kv.shouldUseGroup=Kv.schemaHasRulesForType=void 0;function uE({schema:$,self:I},U){let D=I.RULES.types[U];return D&&D!==!0&&Vv($,D)}Kv.schemaHasRulesForType=uE;function Vv($,I){return I.rules.some((U)=>Mv($,U))}Kv.shouldUseGroup=Vv;function Mv($,I){var U;return $[I.keyword]!==void 0||((U=I.definition.implements)===null||U===void 0?void 0:U.some((D)=>$[D]!==void 0))}Kv.shouldUseRule=Mv});var rU=R((jv)=>{Object.defineProperty(jv,"__esModule",{value:!0});jv.reportTypeError=jv.checkDataTypes=jv.checkDataType=jv.coerceAndCheckDataType=jv.getJSONTypes=jv.getSchemaTypes=jv.DataType=void 0;var cE=R9(),rE=T9(),mE=cU(),o=d(),qv=w$(),dI;(function($){$[$.Correct=0]="Correct",$[$.Wrong=1]="Wrong"})(dI||(jv.DataType=dI={}));function oE($){let I=kv($.type);if(I.includes("null")){if($.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!I.length&&$.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');if($.nullable===!0)I.push("null")}return I}jv.getSchemaTypes=oE;function kv($){let I=Array.isArray($)?$:$?[$]:[];if(I.every(cE.isJSONType))return I;throw new Error("type must be JSONType or JSONType[]: "+I.join(","))}jv.getJSONTypes=kv;function dE($,I){let{gen:U,data:D,opts:b}=$,w=pE(I,b.coerceTypes),A=I.length>0&&!(w.length===0&&I.length===1&&rE.schemaHasRulesForType($,I[0]));if(A){let N=C9(I,D,b.strictNumbers,dI.Wrong);U.if(N,()=>{if(w.length)tE($,I,w);else Z9($)})}return A}jv.coerceAndCheckDataType=dE;var Ev=new Set(["string","number","integer","boolean","null"]);function pE($,I){return I?$.filter((U)=>Ev.has(U)||I==="array"&&U==="array"):[]}function tE($,I,U){let{gen:D,data:b,opts:w}=$,A=D.let("dataType",o._`typeof ${b}`),N=D.let("coerced",o._`undefined`);if(w.coerceTypes==="array")D.if(o._`${A} == 'object' && Array.isArray(${b}) && ${b}.length == 1`,()=>D.assign(b,o._`${b}[0]`).assign(A,o._`typeof ${b}`).if(C9(I,b,w.strictNumbers),()=>D.assign(N,b)));D.if(o._`${N} !== undefined`);for(let X of U)if(Ev.has(X)||X==="array"&&w.coerceTypes==="array")O(X);D.else(),Z9($),D.endIf(),D.if(o._`${N} !== undefined`,()=>{D.assign(b,N),aE($,N)});function O(X){switch(X){case"string":D.elseIf(o._`${A} == "number" || ${A} == "boolean"`).assign(N,o._`"" + ${b}`).elseIf(o._`${b} === null`).assign(N,o._`""`);return;case"number":D.elseIf(o._`${A} == "boolean" || ${b} === null
|
|
4
|
-
|| (${
|
|
5
|
-
|| (${
|
|
6
|
-
|| ${A} === "boolean" || ${b} === null`).assign(N,o._`[${b}]`)}}}function aE({gen:$,parentData:I,parentDataProperty:U},D){$.if(o._`${I} !== undefined`,()=>$.assign(o._`${I}[${U}]`,D))}function _9($,I,U,D=dI.Correct){let b=D===dI.Correct?o.operators.EQ:o.operators.NEQ,w;switch($){case"null":return o._`${I} ${b} null`;case"array":w=o._`Array.isArray(${I})`;break;case"object":w=o._`${I} && typeof ${I} == "object" && !Array.isArray(${I})`;break;case"integer":w=A(o._`!(${I} % 1) && !isNaN(${I})`);break;case"number":w=A();break;default:return o._`typeof ${I} ${b} ${$}`}return D===dI.Correct?w:o.not(w);function A(N=o.nil){return o.and(o._`typeof ${I} == "number"`,N,U?o._`isFinite(${I})`:o.nil)}}jv.checkDataType=_9;function C9($,I,U,D){if($.length===1)return _9($[0],I,U,D);let b,w=qv.toHash($);if(w.array&&w.object){let A=o._`typeof ${I} != "object"`;b=w.null?A:o._`!${I} || ${A}`,delete w.null,delete w.array,delete w.object}else b=o.nil;if(w.number)delete w.integer;for(let A in w)b=o.and(b,_9(A,I,U,D));return b}jv.checkDataTypes=C9;var eE={message:({schema:$})=>`must be ${$}`,params:({schema:$,schemaValue:I})=>typeof $=="string"?o._`{type: ${$}}`:o._`{type: ${I}}`};function Z9($){let I=sE($);mE.reportError(I,eE)}jv.reportTypeError=Z9;function sE($){let{gen:I,data:U,schema:D}=$,b=qv.schemaRefOrVal($,D,"type");return{gen:I,keyword:"type",data:U,schema:D.type,schemaCode:b,schemaValue:b,parentSchema:D,params:{},it:$}}});var _v=R((Rv)=>{Object.defineProperty(Rv,"__esModule",{value:!0});Rv.assignDefaults=void 0;var pI=d(),Aj=w$();function Nj($,I){let{properties:U,items:D}=$.schema;if(I==="object"&&U)for(let b in U)Pv($,b,U[b].default);else if(I==="array"&&Array.isArray(D))D.forEach((b,w)=>Pv($,w,b.default))}Rv.assignDefaults=Nj;function Pv($,I,U){let{gen:D,compositeRule:b,data:w,opts:A}=$;if(U===void 0)return;let N=pI._`${w}${pI.getProperty(I)}`;if(b){Aj.checkStrictMode($,`default is ignored for: ${N}`);return}let O=pI._`${N} === undefined`;if(A.useDefaults==="empty")O=pI._`${O} || ${N} === null || ${N} === ""`;D.if(O,pI._`${N} = ${pI.stringify(U)}`)}});var b6=R((fv)=>{Object.defineProperty(fv,"__esModule",{value:!0});fv.validateUnion=fv.validateArray=fv.usePattern=fv.callValidateCode=fv.schemaProperties=fv.allSchemaProperties=fv.noPropertyInData=fv.propertyInData=fv.isOwnProperty=fv.hasPropFunc=fv.reportMissingProp=fv.checkMissingProp=fv.checkReportMissingProp=void 0;var J$=d(),f9=w$(),L4=i6(),Oj=w$();function Xj($,I){let{gen:U,data:D,it:b}=$;U.if(y9(U,D,I,b.opts.ownProperties),()=>{$.setParams({missingProperty:J$._`${I}`},!0),$.error()})}fv.checkReportMissingProp=Xj;function Wj({gen:$,data:I,it:{opts:U}},D,b){return J$.or(...D.map((w)=>J$.and(y9($,I,w,U.ownProperties),J$._`${b} = ${w}`)))}fv.checkMissingProp=Wj;function Gj($,I){$.setParams({missingProperty:I},!0),$.error()}fv.reportMissingProp=Gj;function Cv($){return $.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:J$._`Object.prototype.hasOwnProperty`})}fv.hasPropFunc=Cv;function g9($,I,U){return J$._`${Cv($)}.call(${I}, ${U})`}fv.isOwnProperty=g9;function Qj($,I,U,D){let b=J$._`${I}${J$.getProperty(U)} !== undefined`;return D?J$._`${b} && ${g9($,I,U)}`:b}fv.propertyInData=Qj;function y9($,I,U,D){let b=J$._`${I}${J$.getProperty(U)} === undefined`;return D?J$.or(b,J$.not(g9($,I,U))):b}fv.noPropertyInData=y9;function Zv($){return $?Object.keys($).filter((I)=>I!=="__proto__"):[]}fv.allSchemaProperties=Zv;function Yj($,I){return Zv(I).filter((U)=>!f9.alwaysValidSchema($,I[U]))}fv.schemaProperties=Yj;function Bj({schemaCode:$,data:I,it:{gen:U,topSchemaRef:D,schemaPath:b,errorPath:w},it:A},N,O,X){let G=X?J$._`${$}, ${I}, ${D}${b}`:I,Q=[[L4.default.instancePath,J$.strConcat(L4.default.instancePath,w)],[L4.default.parentData,A.parentData],[L4.default.parentDataProperty,A.parentDataProperty],[L4.default.rootData,L4.default.rootData]];if(A.opts.dynamicRef)Q.push([L4.default.dynamicAnchors,L4.default.dynamicAnchors]);let Y=J$._`${G}, ${U.object(...Q)}`;return O!==J$.nil?J$._`${N}.call(${O}, ${Y})`:J$._`${N}(${Y})`}fv.callValidateCode=Bj;var vj=J$._`new RegExp`;function Jj({gen:$,it:{opts:I}},U){let D=I.unicodeRegExp?"u":"",{regExp:b}=I.code,w=b(U,D);return $.scopeValue("pattern",{key:w.toString(),ref:w,code:J$._`${b.code==="new RegExp"?vj:Oj.useFunc($,b)}(${U}, ${D})`})}fv.usePattern=Jj;function Hj($){let{gen:I,data:U,keyword:D,it:b}=$,w=I.name("valid");if(b.allErrors){let N=I.let("valid",!0);return A(()=>I.assign(N,!1)),N}return I.var(w,!0),A(()=>I.break()),w;function A(N){let O=I.const("len",J$._`${U}.length`);I.forRange("i",0,O,(X)=>{$.subschema({keyword:D,dataProp:X,dataPropType:f9.Type.Num},w),I.if(J$.not(w),N)})}}fv.validateArray=Hj;function Lj($){let{gen:I,schema:U,keyword:D,it:b}=$;if(!Array.isArray(U))throw new Error("ajv implementation error");if(U.some((O)=>f9.alwaysValidSchema(b,O))&&!b.opts.unevaluated)return;let A=I.let("valid",!1),N=I.name("_valid");I.block(()=>U.forEach((O,X)=>{let G=$.subschema({keyword:D,schemaProp:X,compositeRule:!0},N);if(I.assign(A,J$._`${A} || ${N}`),!$.mergeValidEvaluated(G,N))I.if(J$.not(A))})),$.result(A,()=>$.reset(),()=>$.error(!0))}fv.validateUnion=Lj});var uv=R((lv)=>{Object.defineProperty(lv,"__esModule",{value:!0});lv.validateKeywordUsage=lv.validSchemaType=lv.funcKeywordCode=lv.macroKeywordCode=void 0;var h$=d(),c4=i6(),Tj=b6(),_j=cU();function Cj($,I){let{gen:U,keyword:D,schema:b,parentSchema:w,it:A}=$,N=I.macro.call(A.self,b,w,A),O=xv(U,D,N);if(A.opts.validateSchema!==!1)A.self.validateSchema(N,!0);let X=U.name("valid");$.subschema({schema:N,schemaPath:h$.nil,errSchemaPath:`${A.errSchemaPath}/${D}`,topSchemaRef:O,compositeRule:!0},X),$.pass(X,()=>$.error(!0))}lv.macroKeywordCode=Cj;function Zj($,I){var U;let{gen:D,keyword:b,schema:w,parentSchema:A,$data:N,it:O}=$;gj(O,I);let X=!N&&I.compile?I.compile.call(O.self,w,A,O):I.validate,G=xv(D,b,X),Q=D.let("valid");$.block$data(Q,Y),$.ok((U=I.valid)!==null&&U!==void 0?U:Q);function Y(){if(I.errors===!1){if(L(),I.modifying)yv($);K(()=>$.error())}else{let k=I.async?B():J();if(I.modifying)yv($);K(()=>fj($,k))}}function B(){let k=D.let("ruleErrs",null);return D.try(()=>L(h$._`await `),(g)=>D.assign(Q,!1).if(h$._`${g} instanceof ${O.ValidationError}`,()=>D.assign(k,h$._`${g}.errors`),()=>D.throw(g))),k}function J(){let k=h$._`${G}.errors`;return D.assign(k,null),L(h$.nil),k}function L(k=I.async?h$._`await `:h$.nil){let g=O.opts.passContext?c4.default.this:c4.default.self,x=!(("compile"in I)&&!N||I.schema===!1);D.assign(Q,h$._`${k}${Tj.callValidateCode($,G,g,x)}`,I.modifying)}function K(k){var g;D.if(h$.not((g=I.valid)!==null&&g!==void 0?g:Q),k)}}lv.funcKeywordCode=Zj;function yv($){let{gen:I,data:U,it:D}=$;I.if(D.parentData,()=>I.assign(U,h$._`${D.parentData}[${D.parentDataProperty}]`))}function fj($,I){let{gen:U}=$;U.if(h$._`Array.isArray(${I})`,()=>{U.assign(c4.default.vErrors,h$._`${c4.default.vErrors} === null ? ${I} : ${c4.default.vErrors}.concat(${I})`).assign(c4.default.errors,h$._`${c4.default.vErrors}.length`),_j.extendErrors($)},()=>$.error())}function gj({schemaEnv:$},I){if(I.async&&!$.$async)throw new Error("async keyword in sync schema")}function xv($,I,U){if(U===void 0)throw new Error(`keyword "${I}" failed to compile`);return $.scopeValue("keyword",typeof U=="function"?{ref:U}:{ref:U,code:h$.stringify(U)})}function yj($,I,U=!1){return!I.length||I.some((D)=>D==="array"?Array.isArray($):D==="object"?$&&typeof $=="object"&&!Array.isArray($):typeof $==D||U&&typeof $=="undefined")}lv.validSchemaType=yj;function xj({schema:$,opts:I,self:U,errSchemaPath:D},b,w){if(Array.isArray(b.keyword)?!b.keyword.includes(w):b.keyword!==w)throw new Error("ajv implementation error");let A=b.dependencies;if(A===null||A===void 0?void 0:A.some((N)=>!Object.prototype.hasOwnProperty.call($,N)))throw new Error(`parent schema must have dependencies of ${w}: ${A.join(",")}`);if(b.validateSchema){if(!b.validateSchema($[w])){let O=`keyword "${w}" value is invalid at path "${D}": `+U.errorsText(b.validateSchema.errors);if(I.validateSchema==="log")U.logger.error(O);else throw new Error(O)}}}lv.validateKeywordUsage=xj});var rv=R((nv)=>{Object.defineProperty(nv,"__esModule",{value:!0});nv.extendSubschemaMode=nv.extendSubschemaData=nv.getSubschema=void 0;var j6=d(),iv=w$();function ij($,{keyword:I,schemaProp:U,schema:D,schemaPath:b,errSchemaPath:w,topSchemaRef:A}){if(I!==void 0&&D!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(I!==void 0){let N=$.schema[I];return U===void 0?{schema:N,schemaPath:j6._`${$.schemaPath}${j6.getProperty(I)}`,errSchemaPath:`${$.errSchemaPath}/${I}`}:{schema:N[U],schemaPath:j6._`${$.schemaPath}${j6.getProperty(I)}${j6.getProperty(U)}`,errSchemaPath:`${$.errSchemaPath}/${I}/${iv.escapeFragment(U)}`}}if(D!==void 0){if(b===void 0||w===void 0||A===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:D,schemaPath:b,topSchemaRef:A,errSchemaPath:w}}throw new Error('either "keyword" or "schema" must be passed')}nv.getSubschema=ij;function nj($,I,{dataProp:U,dataPropType:D,data:b,dataTypes:w,propertyName:A}){if(b!==void 0&&U!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:N}=I;if(U!==void 0){let{errorPath:X,dataPathArr:G,opts:Q}=I,Y=N.let("data",j6._`${I.data}${j6.getProperty(U)}`,!0);O(Y),$.errorPath=j6.str`${X}${iv.getErrorPath(U,D,Q.jsPropertySyntax)}`,$.parentDataProperty=j6._`${U}`,$.dataPathArr=[...G,$.parentDataProperty]}if(b!==void 0){let X=b instanceof j6.Name?b:N.let("data",b,!0);if(O(X),A!==void 0)$.propertyName=A}if(w)$.dataTypes=w;function O(X){$.data=X,$.dataLevel=I.dataLevel+1,$.dataTypes=[],I.definedProperties=new Set,$.parentData=I.data,$.dataNames=[...I.dataNames,X]}}nv.extendSubschemaData=nj;function cj($,{jtdDiscriminator:I,jtdMetadata:U,compositeRule:D,createErrors:b,allErrors:w}){if(D!==void 0)$.compositeRule=D;if(b!==void 0)$.createErrors=b;if(w!==void 0)$.allErrors=w;$.jtdDiscriminator=I,$.jtdMetadata=U}nv.extendSubschemaMode=cj});var x9=R((su,mv)=>{mv.exports=function $(I,U){if(I===U)return!0;if(I&&U&&typeof I=="object"&&typeof U=="object"){if(I.constructor!==U.constructor)return!1;var D,b,w;if(Array.isArray(I)){if(D=I.length,D!=U.length)return!1;for(b=D;b--!==0;)if(!$(I[b],U[b]))return!1;return!0}if(I.constructor===RegExp)return I.source===U.source&&I.flags===U.flags;if(I.valueOf!==Object.prototype.valueOf)return I.valueOf()===U.valueOf();if(I.toString!==Object.prototype.toString)return I.toString()===U.toString();if(w=Object.keys(I),D=w.length,D!==Object.keys(U).length)return!1;for(b=D;b--!==0;)if(!Object.prototype.hasOwnProperty.call(U,w[b]))return!1;for(b=D;b--!==0;){var A=w[b];if(!$(I[A],U[A]))return!1}return!0}return I!==I&&U!==U}});var dv=R(($i,ov)=>{var z4=ov.exports=function($,I,U){if(typeof I=="function")U=I,I={};U=I.cb||U;var D=typeof U=="function"?U:U.pre||function(){},b=U.post||function(){};jA(I,D,b,$,"",$)};z4.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};z4.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};z4.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};z4.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function jA($,I,U,D,b,w,A,N,O,X){if(D&&typeof D=="object"&&!Array.isArray(D)){I(D,b,w,A,N,O,X);for(var G in D){var Q=D[G];if(Array.isArray(Q)){if(G in z4.arrayKeywords)for(var Y=0;Y<Q.length;Y++)jA($,I,U,Q[Y],b+"/"+G+"/"+Y,w,b,G,D,Y)}else if(G in z4.propsKeywords){if(Q&&typeof Q=="object")for(var B in Q)jA($,I,U,Q[B],b+"/"+G+"/"+oj(B),w,b,G,D,B)}else if(G in z4.keywords||$.allKeys&&!(G in z4.skipKeywords))jA($,I,U,Q,b+"/"+G,w,b,G,D)}U(D,b,w,A,N,O,X)}}function oj($){return $.replace(/~/g,"~0").replace(/\//g,"~1")}});var mU=R((ev)=>{Object.defineProperty(ev,"__esModule",{value:!0});ev.getSchemaRefs=ev.resolveUrl=ev.normalizeId=ev._getFullPath=ev.getFullPath=ev.inlineRef=void 0;var dj=w$(),pj=x9(),tj=dv(),aj=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function ej($,I=!0){if(typeof $=="boolean")return!0;if(I===!0)return!l9($);if(!I)return!1;return pv($)<=I}ev.inlineRef=ej;var sj=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function l9($){for(let I in $){if(sj.has(I))return!0;let U=$[I];if(Array.isArray(U)&&U.some(l9))return!0;if(typeof U=="object"&&l9(U))return!0}return!1}function pv($){let I=0;for(let U in $){if(U==="$ref")return 1/0;if(I++,aj.has(U))continue;if(typeof $[U]=="object")dj.eachItem($[U],(D)=>I+=pv(D));if(I===1/0)return 1/0}return I}function tv($,I="",U){if(U!==!1)I=tI(I);let D=$.parse(I);return av($,D)}ev.getFullPath=tv;function av($,I){return $.serialize(I).split("#")[0]+"#"}ev._getFullPath=av;var $S=/#\/?$/;function tI($){return $?$.replace($S,""):""}ev.normalizeId=tI;function IS($,I,U){return U=tI(U),$.resolve(I,U)}ev.resolveUrl=IS;var US=/^[a-z_][-a-z0-9._]*$/i;function bS($,I){if(typeof $=="boolean")return{};let{schemaId:U,uriResolver:D}=this.opts,b=tI($[U]||I),w={"":b},A=tv(D,b,!1),N={},O=new Set;return tj($,{allKeys:!0},(Q,Y,B,J)=>{if(J===void 0)return;let L=A+Y,K=w[J];if(typeof Q[U]=="string")K=k.call(this,Q[U]);g.call(this,Q.$anchor),g.call(this,Q.$dynamicAnchor),w[Y]=K;function k(x){let a=this.opts.uriResolver.resolve;if(x=tI(K?a(K,x):x),O.has(x))throw G(x);O.add(x);let h=this.refs[x];if(typeof h=="string")h=this.refs[h];if(typeof h=="object")X(Q,h.schema,x);else if(x!==tI(L))if(x[0]==="#")X(Q,N[x],x),N[x]=Q;else this.refs[x]=L;return x}function g(x){if(typeof x=="string"){if(!US.test(x))throw new Error(`invalid anchor "${x}"`);k.call(this,`#${x}`)}}}),N;function X(Q,Y,B){if(Y!==void 0&&!pj(Q,Y))throw G(B)}function G(Q){return new Error(`reference "${Q}" resolves to more than one schema`)}}ev.getSchemaRefs=bS});var pU=R((BJ)=>{Object.defineProperty(BJ,"__esModule",{value:!0});BJ.getData=BJ.KeywordCxt=BJ.validateFunctionCode=void 0;var DJ=Hv(),$J=rU(),u9=T9(),SA=rU(),XS=_v(),dU=uv(),h9=rv(),y=d(),c=i6(),WS=mU(),n6=w$(),oU=cU();function GS($){if(NJ($)){if(OJ($),AJ($)){BS($);return}}wJ($,()=>DJ.topBoolOrEmptySchema($))}BJ.validateFunctionCode=GS;function wJ({gen:$,validateName:I,schema:U,schemaEnv:D,opts:b},w){if(b.code.es5)$.func(I,y._`${c.default.data}, ${c.default.valCxt}`,D.$async,()=>{$.code(y._`"use strict"; ${IJ(U,b)}`),YS($,b),$.code(w)});else $.func(I,y._`${c.default.data}, ${QS(b)}`,D.$async,()=>$.code(IJ(U,b)).code(w))}function QS($){return y._`{${c.default.instancePath}="", ${c.default.parentData}, ${c.default.parentDataProperty}, ${c.default.rootData}=${c.default.data}${$.dynamicRef?y._`, ${c.default.dynamicAnchors}={}`:y.nil}}={}`}function YS($,I){$.if(c.default.valCxt,()=>{if($.var(c.default.instancePath,y._`${c.default.valCxt}.${c.default.instancePath}`),$.var(c.default.parentData,y._`${c.default.valCxt}.${c.default.parentData}`),$.var(c.default.parentDataProperty,y._`${c.default.valCxt}.${c.default.parentDataProperty}`),$.var(c.default.rootData,y._`${c.default.valCxt}.${c.default.rootData}`),I.dynamicRef)$.var(c.default.dynamicAnchors,y._`${c.default.valCxt}.${c.default.dynamicAnchors}`)},()=>{if($.var(c.default.instancePath,y._`""`),$.var(c.default.parentData,y._`undefined`),$.var(c.default.parentDataProperty,y._`undefined`),$.var(c.default.rootData,c.default.data),I.dynamicRef)$.var(c.default.dynamicAnchors,y._`{}`)})}function BS($){let{schema:I,opts:U,gen:D}=$;wJ($,()=>{if(U.$comment&&I.$comment)WJ($);if(zS($),D.let(c.default.vErrors,null),D.let(c.default.errors,0),U.unevaluated)vS($);XJ($),KS($)});return}function vS($){let{gen:I,validateName:U}=$;$.evaluated=I.const("evaluated",y._`${U}.evaluated`),I.if(y._`${$.evaluated}.dynamicProps`,()=>I.assign(y._`${$.evaluated}.props`,y._`undefined`)),I.if(y._`${$.evaluated}.dynamicItems`,()=>I.assign(y._`${$.evaluated}.items`,y._`undefined`))}function IJ($,I){let U=typeof $=="object"&&$[I.schemaId];return U&&(I.code.source||I.code.process)?y._`/*# sourceURL=${U} */`:y.nil}function JS($,I){if(NJ($)){if(OJ($),AJ($)){HS($,I);return}}DJ.boolOrEmptySchema($,I)}function AJ({schema:$,self:I}){if(typeof $=="boolean")return!$;for(let U in $)if(I.RULES.all[U])return!0;return!1}function NJ($){return typeof $.schema!="boolean"}function HS($,I){let{schema:U,gen:D,opts:b}=$;if(b.$comment&&U.$comment)WJ($);VS($),MS($);let w=D.const("_errs",c.default.errors);XJ($,w),D.var(I,y._`${w} === ${c.default.errors}`)}function OJ($){n6.checkUnknownRules($),LS($)}function XJ($,I){if($.opts.jtd)return UJ($,[],!1,I);let U=$J.getSchemaTypes($.schema),D=$J.coerceAndCheckDataType($,U);UJ($,U,!D,I)}function LS($){let{schema:I,errSchemaPath:U,opts:D,self:b}=$;if(I.$ref&&D.ignoreKeywordsWithRef&&n6.schemaHasRulesButRef(I,b.RULES))b.logger.warn(`$ref: keywords ignored in schema at path "${U}"`)}function zS($){let{schema:I,opts:U}=$;if(I.default!==void 0&&U.useDefaults&&U.strictSchema)n6.checkStrictMode($,"default is ignored in the schema root")}function VS($){let I=$.schema[$.opts.schemaId];if(I)$.baseId=WS.resolveUrl($.opts.uriResolver,$.baseId,I)}function MS($){if($.schema.$async&&!$.schemaEnv.$async)throw new Error("async schema in sync schema")}function WJ({gen:$,schemaEnv:I,schema:U,errSchemaPath:D,opts:b}){let w=U.$comment;if(b.$comment===!0)$.code(y._`${c.default.self}.logger.log(${w})`);else if(typeof b.$comment=="function"){let A=y.str`${D}/$comment`,N=$.scopeValue("root",{ref:I.root});$.code(y._`${c.default.self}.opts.$comment(${w}, ${A}, ${N}.schema)`)}}function KS($){let{gen:I,schemaEnv:U,validateName:D,ValidationError:b,opts:w}=$;if(U.$async)I.if(y._`${c.default.errors} === 0`,()=>I.return(c.default.data),()=>I.throw(y._`new ${b}(${c.default.vErrors})`));else{if(I.assign(y._`${D}.errors`,c.default.vErrors),w.unevaluated)FS($);I.return(y._`${c.default.errors} === 0`)}}function FS({gen:$,evaluated:I,props:U,items:D}){if(U instanceof y.Name)$.assign(y._`${I}.props`,U);if(D instanceof y.Name)$.assign(y._`${I}.items`,D)}function UJ($,I,U,D){let{gen:b,schema:w,data:A,allErrors:N,opts:O,self:X}=$,{RULES:G}=X;if(w.$ref&&(O.ignoreKeywordsWithRef||!n6.schemaHasRulesButRef(w,G))){b.block(()=>QJ($,"$ref",G.all.$ref.definition));return}if(!O.jtd)qS($,I);b.block(()=>{for(let Y of G.rules)Q(Y);Q(G.post)});function Q(Y){if(!u9.shouldUseGroup(w,Y))return;if(Y.type){if(b.if(SA.checkDataType(Y.type,A,O.strictNumbers)),bJ($,Y),I.length===1&&I[0]===Y.type&&U)b.else(),SA.reportTypeError($);b.endIf()}else bJ($,Y);if(!N)b.if(y._`${c.default.errors} === ${D||0}`)}}function bJ($,I){let{gen:U,schema:D,opts:{useDefaults:b}}=$;if(b)XS.assignDefaults($,I.type);U.block(()=>{for(let w of I.rules)if(u9.shouldUseRule(D,w))QJ($,w.keyword,w.definition,I.type)})}function qS($,I){if($.schemaEnv.meta||!$.opts.strictTypes)return;if(kS($,I),!$.opts.allowUnionTypes)ES($,I);jS($,$.dataTypes)}function kS($,I){if(!I.length)return;if(!$.dataTypes.length){$.dataTypes=I;return}I.forEach((U)=>{if(!GJ($.dataTypes,U))i9($,`type "${U}" not allowed by context "${$.dataTypes.join(",")}"`)}),PS($,I)}function ES($,I){if(I.length>1&&!(I.length===2&&I.includes("null")))i9($,"use allowUnionTypes to allow union type keyword")}function jS($,I){let U=$.self.RULES.all;for(let D in U){let b=U[D];if(typeof b=="object"&&u9.shouldUseRule($.schema,b)){let{type:w}=b.definition;if(w.length&&!w.some((A)=>SS(I,A)))i9($,`missing type "${w.join(",")}" for keyword "${D}"`)}}}function SS($,I){return $.includes(I)||I==="number"&&$.includes("integer")}function GJ($,I){return $.includes(I)||I==="integer"&&$.includes("number")}function PS($,I){let U=[];for(let D of $.dataTypes)if(GJ(I,D))U.push(D);else if(I.includes("integer")&&D==="number")U.push("integer");$.dataTypes=U}function i9($,I){let U=$.schemaEnv.baseId+$.errSchemaPath;I+=` at "${U}" (strictTypes)`,n6.checkStrictMode($,I,$.opts.strictTypes)}class n9{constructor($,I,U){if(dU.validateKeywordUsage($,I,U),this.gen=$.gen,this.allErrors=$.allErrors,this.keyword=U,this.data=$.data,this.schema=$.schema[U],this.$data=I.$data&&$.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=n6.schemaRefOrVal($,this.schema,U,this.$data),this.schemaType=I.schemaType,this.parentSchema=$.schema,this.params={},this.it=$,this.def=I,this.$data)this.schemaCode=$.gen.const("vSchema",YJ(this.$data,$));else if(this.schemaCode=this.schemaValue,!dU.validSchemaType(this.schema,I.schemaType,I.allowUndefined))throw new Error(`${U} value must be ${JSON.stringify(I.schemaType)}`);if("code"in I?I.trackErrors:I.errors!==!1)this.errsCount=$.gen.const("_errs",c.default.errors)}result($,I,U){this.failResult(y.not($),I,U)}failResult($,I,U){if(this.gen.if($),U)U();else this.error();if(I){if(this.gen.else(),I(),this.allErrors)this.gen.endIf()}else if(this.allErrors)this.gen.endIf();else this.gen.else()}pass($,I){this.failResult(y.not($),void 0,I)}fail($){if($===void 0){if(this.error(),!this.allErrors)this.gen.if(!1);return}if(this.gen.if($),this.error(),this.allErrors)this.gen.endIf();else this.gen.else()}fail$data($){if(!this.$data)return this.fail($);let{schemaCode:I}=this;this.fail(y._`${I} !== undefined && (${y.or(this.invalid$data(),$)})`)}error($,I,U){if(I){this.setParams(I),this._error($,U),this.setParams({});return}this._error($,U)}_error($,I){($?oU.reportExtraError:oU.reportError)(this,this.def.error,I)}$dataError(){oU.reportError(this,this.def.$dataError||oU.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');oU.resetErrorsCount(this.gen,this.errsCount)}ok($){if(!this.allErrors)this.gen.if($)}setParams($,I){if(I)Object.assign(this.params,$);else this.params=$}block$data($,I,U=y.nil){this.gen.block(()=>{this.check$data($,U),I()})}check$data($=y.nil,I=y.nil){if(!this.$data)return;let{gen:U,schemaCode:D,schemaType:b,def:w}=this;if(U.if(y.or(y._`${D} === undefined`,I)),$!==y.nil)U.assign($,!0);if(b.length||w.validateSchema){if(U.elseIf(this.invalid$data()),this.$dataError(),$!==y.nil)U.assign($,!1)}U.else()}invalid$data(){let{gen:$,schemaCode:I,schemaType:U,def:D,it:b}=this;return y.or(w(),A());function w(){if(U.length){if(!(I instanceof y.Name))throw new Error("ajv implementation error");let N=Array.isArray(U)?U:[U];return y._`${SA.checkDataTypes(N,I,b.opts.strictNumbers,SA.DataType.Wrong)}`}return y.nil}function A(){if(D.validateSchema){let N=$.scopeValue("validate$data",{ref:D.validateSchema});return y._`!${N}(${I})`}return y.nil}}subschema($,I){let U=h9.getSubschema(this.it,$);h9.extendSubschemaData(U,this.it,$),h9.extendSubschemaMode(U,$);let D={...this.it,...U,items:void 0,props:void 0};return JS(D,I),D}mergeEvaluated($,I){let{it:U,gen:D}=this;if(!U.opts.unevaluated)return;if(U.props!==!0&&$.props!==void 0)U.props=n6.mergeEvaluated.props(D,$.props,U.props,I);if(U.items!==!0&&$.items!==void 0)U.items=n6.mergeEvaluated.items(D,$.items,U.items,I)}mergeValidEvaluated($,I){let{it:U,gen:D}=this;if(U.opts.unevaluated&&(U.props!==!0||U.items!==!0))return D.if(I,()=>this.mergeEvaluated($,y.Name)),!0}}BJ.KeywordCxt=n9;function QJ($,I,U,D){let b=new n9($,U,I);if("code"in U)U.code(b,D);else if(b.$data&&U.validate)dU.funcKeywordCode(b,U);else if("macro"in U)dU.macroKeywordCode(b,U);else if(U.compile||U.validate)dU.funcKeywordCode(b,U)}var RS=/^\/(?:[^~]|~0|~1)*$/,TS=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function YJ($,{dataLevel:I,dataNames:U,dataPathArr:D}){let b,w;if($==="")return c.default.rootData;if($[0]==="/"){if(!RS.test($))throw new Error(`Invalid JSON-pointer: ${$}`);b=$,w=c.default.rootData}else{let X=TS.exec($);if(!X)throw new Error(`Invalid JSON-pointer: ${$}`);let G=+X[1];if(b=X[2],b==="#"){if(G>=I)throw new Error(O("property/index",G));return D[I-G]}if(G>I)throw new Error(O("data",G));if(w=U[I-G],!b)return w}let A=w,N=b.split("/");for(let X of N)if(X)w=y._`${w}${y.getProperty(n6.unescapeJsonPointer(X))}`,A=y._`${A} && ${w}`;return A;function O(X,G){return`Cannot access ${X} ${G} levels up, current level is ${I}`}}BJ.getData=YJ});var PA=R((HJ)=>{Object.defineProperty(HJ,"__esModule",{value:!0});class JJ extends Error{constructor($){super("validation failed");this.errors=$,this.ajv=this.validation=!0}}HJ.default=JJ});var tU=R((zJ)=>{Object.defineProperty(zJ,"__esModule",{value:!0});var c9=mU();class LJ extends Error{constructor($,I,U,D){super(D||`can't resolve reference ${U} from id ${I}`);this.missingRef=c9.resolveUrl($,I,U),this.missingSchema=c9.normalizeId(c9.getFullPath($,this.missingRef))}}zJ.default=LJ});var TA=R((KJ)=>{Object.defineProperty(KJ,"__esModule",{value:!0});KJ.resolveSchema=KJ.getCompilingSchema=KJ.resolveRef=KJ.compileSchema=KJ.SchemaEnv=void 0;var Q6=d(),gS=PA(),r4=i6(),Y6=mU(),VJ=w$(),yS=pU();class aU{constructor($){var I;this.refs={},this.dynamicAnchors={};let U;if(typeof $.schema=="object")U=$.schema;this.schema=$.schema,this.schemaId=$.schemaId,this.root=$.root||this,this.baseId=(I=$.baseId)!==null&&I!==void 0?I:Y6.normalizeId(U===null||U===void 0?void 0:U[$.schemaId||"$id"]),this.schemaPath=$.schemaPath,this.localRefs=$.localRefs,this.meta=$.meta,this.$async=U===null||U===void 0?void 0:U.$async,this.refs={}}}KJ.SchemaEnv=aU;function m9($){let I=MJ.call(this,$);if(I)return I;let U=Y6.getFullPath(this.opts.uriResolver,$.root.baseId),{es5:D,lines:b}=this.opts.code,{ownProperties:w}=this.opts,A=new Q6.CodeGen(this.scope,{es5:D,lines:b,ownProperties:w}),N;if($.$async)N=A.scopeValue("Error",{ref:gS.default,code:Q6._`require("ajv/dist/runtime/validation_error").default`});let O=A.scopeName("validate");$.validateName=O;let X={gen:A,allErrors:this.opts.allErrors,data:r4.default.data,parentData:r4.default.parentData,parentDataProperty:r4.default.parentDataProperty,dataNames:[r4.default.data],dataPathArr:[Q6.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:A.scopeValue("schema",this.opts.code.source===!0?{ref:$.schema,code:Q6.stringify($.schema)}:{ref:$.schema}),validateName:O,ValidationError:N,schema:$.schema,schemaEnv:$,rootId:U,baseId:$.baseId||U,schemaPath:Q6.nil,errSchemaPath:$.schemaPath||(this.opts.jtd?"":"#"),errorPath:Q6._`""`,opts:this.opts,self:this},G;try{this._compilations.add($),yS.validateFunctionCode(X),A.optimize(this.opts.code.optimize);let Q=A.toString();if(G=`${A.scopeRefs(r4.default.scope)}return ${Q}`,this.opts.code.process)G=this.opts.code.process(G,$);let B=new Function(`${r4.default.self}`,`${r4.default.scope}`,G)(this,this.scope.get());if(this.scope.value(O,{ref:B}),B.errors=null,B.schema=$.schema,B.schemaEnv=$,$.$async)B.$async=!0;if(this.opts.code.source===!0)B.source={validateName:O,validateCode:Q,scopeValues:A._values};if(this.opts.unevaluated){let{props:J,items:L}=X;if(B.evaluated={props:J instanceof Q6.Name?void 0:J,items:L instanceof Q6.Name?void 0:L,dynamicProps:J instanceof Q6.Name,dynamicItems:L instanceof Q6.Name},B.source)B.source.evaluated=Q6.stringify(B.evaluated)}return $.validate=B,$}catch(Q){if(delete $.validate,delete $.validateName,G)this.logger.error("Error compiling schema, function code:",G);throw Q}finally{this._compilations.delete($)}}KJ.compileSchema=m9;function xS($,I,U){var D;U=Y6.resolveUrl(this.opts.uriResolver,I,U);let b=$.refs[U];if(b)return b;let w=uS.call(this,$,U);if(w===void 0){let A=(D=$.localRefs)===null||D===void 0?void 0:D[U],{schemaId:N}=this.opts;if(A)w=new aU({schema:A,schemaId:N,root:$,baseId:I})}if(w===void 0)return;return $.refs[U]=lS.call(this,w)}KJ.resolveRef=xS;function lS($){if(Y6.inlineRef($.schema,this.opts.inlineRefs))return $.schema;return $.validate?$:m9.call(this,$)}function MJ($){for(let I of this._compilations)if(hS(I,$))return I}KJ.getCompilingSchema=MJ;function hS($,I){return $.schema===I.schema&&$.root===I.root&&$.baseId===I.baseId}function uS($,I){let U;while(typeof(U=this.refs[I])=="string")I=U;return U||this.schemas[I]||RA.call(this,$,I)}function RA($,I){let U=this.opts.uriResolver.parse(I),D=Y6._getFullPath(this.opts.uriResolver,U),b=Y6.getFullPath(this.opts.uriResolver,$.baseId,void 0);if(Object.keys($.schema).length>0&&D===b)return r9.call(this,U,$);let w=Y6.normalizeId(D),A=this.refs[w]||this.schemas[w];if(typeof A=="string"){let N=RA.call(this,$,A);if(typeof(N===null||N===void 0?void 0:N.schema)!=="object")return;return r9.call(this,U,N)}if(typeof(A===null||A===void 0?void 0:A.schema)!=="object")return;if(!A.validate)m9.call(this,A);if(w===Y6.normalizeId(I)){let{schema:N}=A,{schemaId:O}=this.opts,X=N[O];if(X)b=Y6.resolveUrl(this.opts.uriResolver,b,X);return new aU({schema:N,schemaId:O,root:$,baseId:b})}return r9.call(this,U,A)}KJ.resolveSchema=RA;var iS=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function r9($,{baseId:I,schema:U,root:D}){var b;if(((b=$.fragment)===null||b===void 0?void 0:b[0])!=="/")return;for(let N of $.fragment.slice(1).split("/")){if(typeof U==="boolean")return;let O=U[VJ.unescapeFragment(N)];if(O===void 0)return;U=O;let X=typeof U==="object"&&U[this.opts.schemaId];if(!iS.has(N)&&X)I=Y6.resolveUrl(this.opts.uriResolver,I,X)}let w;if(typeof U!="boolean"&&U.$ref&&!VJ.schemaHasRulesButRef(U,this.RULES)){let N=Y6.resolveUrl(this.opts.uriResolver,I,U.$ref);w=RA.call(this,D,N)}let{schemaId:A}=this.opts;if(w=w||new aU({schema:U,schemaId:A,root:D,baseId:I}),w.schema!==w.root.schema)return w;return}});var qJ=R((Ai,oS)=>{oS.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var d9=R((Ni,SJ)=>{var dS=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),EJ=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 o9($){let I="",U=0,D=0;for(D=0;D<$.length;D++){if(U=$[D].charCodeAt(0),U===48)continue;if(!(U>=48&&U<=57||U>=65&&U<=70||U>=97&&U<=102))return"";I+=$[D];break}for(D+=1;D<$.length;D++){if(U=$[D].charCodeAt(0),!(U>=48&&U<=57||U>=65&&U<=70||U>=97&&U<=102))return"";I+=$[D]}return I}var pS=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function kJ($){return $.length=0,!0}function tS($,I,U){if($.length){let D=o9($);if(D!=="")I.push(D);else return U.error=!0,!1;$.length=0}return!0}function aS($){let I=0,U={error:!1,address:"",zone:""},D=[],b=[],w=!1,A=!1,N=tS;for(let O=0;O<$.length;O++){let X=$[O];if(X==="["||X==="]")continue;if(X===":"){if(w===!0)A=!0;if(!N(b,D,U))break;if(++I>7){U.error=!0;break}if(O>0&&$[O-1]===":")w=!0;D.push(":");continue}else if(X==="%"){if(!N(b,D,U))break;N=kJ}else{b.push(X);continue}}if(b.length)if(N===kJ)U.zone=b.join("");else if(A)D.push(b.join(""));else D.push(o9(b));return U.address=D.join(""),U}function jJ($){if(eS($,":")<2)return{host:$,isIPV6:!1};let I=aS($);if(!I.error){let{address:U,address:D}=I;if(I.zone)U+="%"+I.zone,D+="%25"+I.zone;return{host:U,isIPV6:!0,escapedHost:D}}else return{host:$,isIPV6:!1}}function eS($,I){let U=0;for(let D=0;D<$.length;D++)if($[D]===I)U++;return U}function sS($){let I=$,U=[],D=-1,b=0;while(b=I.length){if(b===1)if(I===".")break;else if(I==="/"){U.push("/");break}else{U.push(I);break}else if(b===2){if(I[0]==="."){if(I[1]===".")break;else if(I[1]==="/"){I=I.slice(2);continue}}else if(I[0]==="/"){if(I[1]==="."||I[1]==="/"){U.push("/");break}}}else if(b===3){if(I==="/.."){if(U.length!==0)U.pop();U.push("/");break}}if(I[0]==="."){if(I[1]==="."){if(I[2]==="/"){I=I.slice(3);continue}}else if(I[1]==="/"){I=I.slice(2);continue}}else if(I[0]==="/"){if(I[1]==="."){if(I[2]==="/"){I=I.slice(2);continue}else if(I[2]==="."){if(I[3]==="/"){if(I=I.slice(3),U.length!==0)U.pop();continue}}}}if((D=I.indexOf("/",1))===-1){U.push(I);break}else U.push(I.slice(0,D)),I=I.slice(D)}return U.join("")}function $P($,I){let U=I!==!0?escape:unescape;if($.scheme!==void 0)$.scheme=U($.scheme);if($.userinfo!==void 0)$.userinfo=U($.userinfo);if($.host!==void 0)$.host=U($.host);if($.path!==void 0)$.path=U($.path);if($.query!==void 0)$.query=U($.query);if($.fragment!==void 0)$.fragment=U($.fragment);return $}function IP($){let I=[];if($.userinfo!==void 0)I.push($.userinfo),I.push("@");if($.host!==void 0){let U=unescape($.host);if(!EJ(U)){let D=jJ(U);if(D.isIPV6===!0)U=`[${D.escapedHost}]`;else U=$.host}I.push(U)}if(typeof $.port==="number"||typeof $.port==="string")I.push(":"),I.push(String($.port));return I.length?I.join(""):void 0}SJ.exports={nonSimpleDomain:pS,recomposeAuthority:IP,normalizeComponentEncoding:$P,removeDotSegments:sS,isIPv4:EJ,isUUID:dS,normalizeIPv6:jJ,stringArrayToHexStripped:o9}});var CJ=R((Oi,_J)=>{var{isUUID:UP}=d9(),bP=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,DP=["http","https","ws","wss","urn","urn:uuid"];function wP($){return DP.indexOf($)!==-1}function p9($){if($.secure===!0)return!0;else if($.secure===!1)return!1;else if($.scheme)return $.scheme.length===3&&($.scheme[0]==="w"||$.scheme[0]==="W")&&($.scheme[1]==="s"||$.scheme[1]==="S")&&($.scheme[2]==="s"||$.scheme[2]==="S");else return!1}function PJ($){if(!$.host)$.error=$.error||"HTTP URIs must have a host.";return $}function RJ($){let I=String($.scheme).toLowerCase()==="https";if($.port===(I?443:80)||$.port==="")$.port=void 0;if(!$.path)$.path="/";return $}function AP($){return $.secure=p9($),$.resourceName=($.path||"/")+($.query?"?"+$.query:""),$.path=void 0,$.query=void 0,$}function NP($){if($.port===(p9($)?443:80)||$.port==="")$.port=void 0;if(typeof $.secure==="boolean")$.scheme=$.secure?"wss":"ws",$.secure=void 0;if($.resourceName){let[I,U]=$.resourceName.split("?");$.path=I&&I!=="/"?I:void 0,$.query=U,$.resourceName=void 0}return $.fragment=void 0,$}function OP($,I){if(!$.path)return $.error="URN can not be parsed",$;let U=$.path.match(bP);if(U){let D=I.scheme||$.scheme||"urn";$.nid=U[1].toLowerCase(),$.nss=U[2];let b=`${D}:${I.nid||$.nid}`,w=t9(b);if($.path=void 0,w)$=w.parse($,I)}else $.error=$.error||"URN can not be parsed.";return $}function XP($,I){if($.nid===void 0)throw new Error("URN without nid cannot be serialized");let U=I.scheme||$.scheme||"urn",D=$.nid.toLowerCase(),b=`${U}:${I.nid||D}`,w=t9(b);if(w)$=w.serialize($,I);let A=$,N=$.nss;return A.path=`${D||I.nid}:${N}`,I.skipEscape=!0,A}function WP($,I){let U=$;if(U.uuid=U.nss,U.nss=void 0,!I.tolerant&&(!U.uuid||!UP(U.uuid)))U.error=U.error||"UUID is not valid.";return U}function GP($){let I=$;return I.nss=($.uuid||"").toLowerCase(),I}var TJ={scheme:"http",domainHost:!0,parse:PJ,serialize:RJ},QP={scheme:"https",domainHost:TJ.domainHost,parse:PJ,serialize:RJ},_A={scheme:"ws",domainHost:!0,parse:AP,serialize:NP},YP={scheme:"wss",domainHost:_A.domainHost,parse:_A.parse,serialize:_A.serialize},BP={scheme:"urn",parse:OP,serialize:XP,skipNormalize:!0},vP={scheme:"urn:uuid",parse:WP,serialize:GP,skipNormalize:!0},CA={http:TJ,https:QP,ws:_A,wss:YP,urn:BP,"urn:uuid":vP};Object.setPrototypeOf(CA,null);function t9($){return $&&(CA[$]||CA[$.toLowerCase()])||void 0}_J.exports={wsIsSecure:p9,SCHEMES:CA,isValidSchemeName:wP,getSchemeHandler:t9}});var gJ=R((Xi,fA)=>{var{normalizeIPv6:JP,removeDotSegments:eU,recomposeAuthority:HP,normalizeComponentEncoding:ZA,isIPv4:LP,nonSimpleDomain:zP}=d9(),{SCHEMES:VP,getSchemeHandler:ZJ}=CJ();function MP($,I){if(typeof $==="string")$=S6(c6($,I),I);else if(typeof $==="object")$=c6(S6($,I),I);return $}function KP($,I,U){let D=U?Object.assign({scheme:"null"},U):{scheme:"null"},b=fJ(c6($,D),c6(I,D),D,!0);return D.skipEscape=!0,S6(b,D)}function fJ($,I,U,D){let b={};if(!D)$=c6(S6($,U),U),I=c6(S6(I,U),U);if(U=U||{},!U.tolerant&&I.scheme)b.scheme=I.scheme,b.userinfo=I.userinfo,b.host=I.host,b.port=I.port,b.path=eU(I.path||""),b.query=I.query;else{if(I.userinfo!==void 0||I.host!==void 0||I.port!==void 0)b.userinfo=I.userinfo,b.host=I.host,b.port=I.port,b.path=eU(I.path||""),b.query=I.query;else{if(!I.path)if(b.path=$.path,I.query!==void 0)b.query=I.query;else b.query=$.query;else{if(I.path[0]==="/")b.path=eU(I.path);else{if(($.userinfo!==void 0||$.host!==void 0||$.port!==void 0)&&!$.path)b.path="/"+I.path;else if(!$.path)b.path=I.path;else b.path=$.path.slice(0,$.path.lastIndexOf("/")+1)+I.path;b.path=eU(b.path)}b.query=I.query}b.userinfo=$.userinfo,b.host=$.host,b.port=$.port}b.scheme=$.scheme}return b.fragment=I.fragment,b}function FP($,I,U){if(typeof $==="string")$=unescape($),$=S6(ZA(c6($,U),!0),{...U,skipEscape:!0});else if(typeof $==="object")$=S6(ZA($,!0),{...U,skipEscape:!0});if(typeof I==="string")I=unescape(I),I=S6(ZA(c6(I,U),!0),{...U,skipEscape:!0});else if(typeof I==="object")I=S6(ZA(I,!0),{...U,skipEscape:!0});return $.toLowerCase()===I.toLowerCase()}function S6($,I){let U={host:$.host,scheme:$.scheme,userinfo:$.userinfo,port:$.port,path:$.path,query:$.query,nid:$.nid,nss:$.nss,uuid:$.uuid,fragment:$.fragment,reference:$.reference,resourceName:$.resourceName,secure:$.secure,error:""},D=Object.assign({},I),b=[],w=ZJ(D.scheme||U.scheme);if(w&&w.serialize)w.serialize(U,D);if(U.path!==void 0)if(!D.skipEscape){if(U.path=escape(U.path),U.scheme!==void 0)U.path=U.path.split("%3A").join(":")}else U.path=unescape(U.path);if(D.reference!=="suffix"&&U.scheme)b.push(U.scheme,":");let A=HP(U);if(A!==void 0){if(D.reference!=="suffix")b.push("//");if(b.push(A),U.path&&U.path[0]!=="/")b.push("/")}if(U.path!==void 0){let N=U.path;if(!D.absolutePath&&(!w||!w.absolutePath))N=eU(N);if(A===void 0&&N[0]==="/"&&N[1]==="/")N="/%2F"+N.slice(2);b.push(N)}if(U.query!==void 0)b.push("?",U.query);if(U.fragment!==void 0)b.push("#",U.fragment);return b.join("")}var qP=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function c6($,I){let U=Object.assign({},I),D={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},b=!1;if(U.reference==="suffix")if(U.scheme)$=U.scheme+":"+$;else $="//"+$;let w=$.match(qP);if(w){if(D.scheme=w[1],D.userinfo=w[3],D.host=w[4],D.port=parseInt(w[5],10),D.path=w[6]||"",D.query=w[7],D.fragment=w[8],isNaN(D.port))D.port=w[5];if(D.host)if(LP(D.host)===!1){let O=JP(D.host);D.host=O.host.toLowerCase(),b=O.isIPV6}else b=!0;if(D.scheme===void 0&&D.userinfo===void 0&&D.host===void 0&&D.port===void 0&&D.query===void 0&&!D.path)D.reference="same-document";else if(D.scheme===void 0)D.reference="relative";else if(D.fragment===void 0)D.reference="absolute";else D.reference="uri";if(U.reference&&U.reference!=="suffix"&&U.reference!==D.reference)D.error=D.error||"URI is not a "+U.reference+" reference.";let A=ZJ(U.scheme||D.scheme);if(!U.unicodeSupport&&(!A||!A.unicodeSupport)){if(D.host&&(U.domainHost||A&&A.domainHost)&&b===!1&&zP(D.host))try{D.host=URL.domainToASCII(D.host.toLowerCase())}catch(N){D.error=D.error||"Host's domain name can not be converted to ASCII: "+N}}if(!A||A&&!A.skipNormalize){if($.indexOf("%")!==-1){if(D.scheme!==void 0)D.scheme=unescape(D.scheme);if(D.host!==void 0)D.host=unescape(D.host)}if(D.path)D.path=escape(unescape(D.path));if(D.fragment)D.fragment=encodeURI(decodeURIComponent(D.fragment))}if(A&&A.parse)A.parse(D,U)}else D.error=D.error||"URI can not be parsed.";return D}var a9={SCHEMES:VP,normalize:MP,resolve:KP,resolveComponent:fJ,equal:FP,serialize:S6,parse:c6};fA.exports=a9;fA.exports.default=a9;fA.exports.fastUri=a9});var lJ=R((xJ)=>{Object.defineProperty(xJ,"__esModule",{value:!0});var yJ=gJ();yJ.code='require("ajv/dist/runtime/uri").default';xJ.default=yJ});var oJ=R((r6)=>{Object.defineProperty(r6,"__esModule",{value:!0});r6.CodeGen=r6.Name=r6.nil=r6.stringify=r6.str=r6._=r6.KeywordCxt=void 0;var EP=pU();Object.defineProperty(r6,"KeywordCxt",{enumerable:!0,get:function(){return EP.KeywordCxt}});var aI=d();Object.defineProperty(r6,"_",{enumerable:!0,get:function(){return aI._}});Object.defineProperty(r6,"str",{enumerable:!0,get:function(){return aI.str}});Object.defineProperty(r6,"stringify",{enumerable:!0,get:function(){return aI.stringify}});Object.defineProperty(r6,"nil",{enumerable:!0,get:function(){return aI.nil}});Object.defineProperty(r6,"Name",{enumerable:!0,get:function(){return aI.Name}});Object.defineProperty(r6,"CodeGen",{enumerable:!0,get:function(){return aI.CodeGen}});var jP=PA(),cJ=tU(),SP=R9(),sU=TA(),PP=d(),$b=mU(),gA=rU(),s9=w$(),hJ=qJ(),RP=lJ(),rJ=($,I)=>new RegExp($,I);rJ.code="new RegExp";var TP=["removeAdditional","useDefaults","coerceTypes"],_P=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),CP={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."},ZP={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},uJ=200;function fP($){var I,U,D,b,w,A,N,O,X,G,Q,Y,B,J,L,K,k,g,x,a,h,z6,C6,PN,RN;let J1=$.strict,TN=(I=$.code)===null||I===void 0?void 0:I.optimize,FY=TN===!0||TN===void 0?1:TN||0,qY=(D=(U=$.code)===null||U===void 0?void 0:U.regExp)!==null&&D!==void 0?D:rJ,YV=(b=$.uriResolver)!==null&&b!==void 0?b:RP.default;return{strictSchema:(A=(w=$.strictSchema)!==null&&w!==void 0?w:J1)!==null&&A!==void 0?A:!0,strictNumbers:(O=(N=$.strictNumbers)!==null&&N!==void 0?N:J1)!==null&&O!==void 0?O:!0,strictTypes:(G=(X=$.strictTypes)!==null&&X!==void 0?X:J1)!==null&&G!==void 0?G:"log",strictTuples:(Y=(Q=$.strictTuples)!==null&&Q!==void 0?Q:J1)!==null&&Y!==void 0?Y:"log",strictRequired:(J=(B=$.strictRequired)!==null&&B!==void 0?B:J1)!==null&&J!==void 0?J:!1,code:$.code?{...$.code,optimize:FY,regExp:qY}:{optimize:FY,regExp:qY},loopRequired:(L=$.loopRequired)!==null&&L!==void 0?L:uJ,loopEnum:(K=$.loopEnum)!==null&&K!==void 0?K:uJ,meta:(k=$.meta)!==null&&k!==void 0?k:!0,messages:(g=$.messages)!==null&&g!==void 0?g:!0,inlineRefs:(x=$.inlineRefs)!==null&&x!==void 0?x:!0,schemaId:(a=$.schemaId)!==null&&a!==void 0?a:"$id",addUsedSchema:(h=$.addUsedSchema)!==null&&h!==void 0?h:!0,validateSchema:(z6=$.validateSchema)!==null&&z6!==void 0?z6:!0,validateFormats:(C6=$.validateFormats)!==null&&C6!==void 0?C6:!0,unicodeRegExp:(PN=$.unicodeRegExp)!==null&&PN!==void 0?PN:!0,int32range:(RN=$.int32range)!==null&&RN!==void 0?RN:!0,uriResolver:YV}}class yA{constructor($={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,$=this.opts={...$,...fP($)};let{es5:I,lines:U}=this.opts.code;this.scope=new PP.ValueScope({scope:{},prefixes:_P,es5:I,lines:U}),this.logger=uP($.logger);let D=$.validateFormats;if($.validateFormats=!1,this.RULES=SP.getRules(),iJ.call(this,CP,$,"NOT SUPPORTED"),iJ.call(this,ZP,$,"DEPRECATED","warn"),this._metaOpts=lP.call(this),$.formats)yP.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),$.keywords)xP.call(this,$.keywords);if(typeof $.meta=="object")this.addMetaSchema($.meta);gP.call(this),$.validateFormats=D}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:$,meta:I,schemaId:U}=this.opts,D=hJ;if(U==="id")D={...hJ},D.id=D.$id,delete D.$id;if(I&&$)this.addMetaSchema(D,D[U],!1)}defaultMeta(){let{meta:$,schemaId:I}=this.opts;return this.opts.defaultMeta=typeof $=="object"?$[I]||$:void 0}validate($,I){let U;if(typeof $=="string"){if(U=this.getSchema($),!U)throw new Error(`no schema with key or ref "${$}"`)}else U=this.compile($);let D=U(I);if(!("$async"in U))this.errors=U.errors;return D}compile($,I){let U=this._addSchema($,I);return U.validate||this._compileSchemaEnv(U)}compileAsync($,I){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:U}=this.opts;return D.call(this,$,I);async function D(X,G){await b.call(this,X.$schema);let Q=this._addSchema(X,G);return Q.validate||w.call(this,Q)}async function b(X){if(X&&!this.getSchema(X))await D.call(this,{$ref:X},!0)}async function w(X){try{return this._compileSchemaEnv(X)}catch(G){if(!(G instanceof cJ.default))throw G;return A.call(this,G),await N.call(this,G.missingSchema),w.call(this,X)}}function A({missingSchema:X,missingRef:G}){if(this.refs[X])throw new Error(`AnySchema ${X} is loaded but ${G} cannot be resolved`)}async function N(X){let G=await O.call(this,X);if(!this.refs[X])await b.call(this,G.$schema);if(!this.refs[X])this.addSchema(G,X,I)}async function O(X){let G=this._loading[X];if(G)return G;try{return await(this._loading[X]=U(X))}finally{delete this._loading[X]}}}addSchema($,I,U,D=this.opts.validateSchema){if(Array.isArray($)){for(let w of $)this.addSchema(w,void 0,U,D);return this}let b;if(typeof $==="object"){let{schemaId:w}=this.opts;if(b=$[w],b!==void 0&&typeof b!="string")throw new Error(`schema ${w} must be string`)}return I=$b.normalizeId(I||b),this._checkUnique(I),this.schemas[I]=this._addSchema($,U,I,D,!0),this}addMetaSchema($,I,U=this.opts.validateSchema){return this.addSchema($,I,!0,U),this}validateSchema($,I){if(typeof $=="boolean")return!0;let U;if(U=$.$schema,U!==void 0&&typeof U!="string")throw new Error("$schema must be a string");if(U=U||this.opts.defaultMeta||this.defaultMeta(),!U)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let D=this.validate(U,$);if(!D&&I){let b="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(b);else throw new Error(b)}return D}getSchema($){let I;while(typeof(I=nJ.call(this,$))=="string")$=I;if(I===void 0){let{schemaId:U}=this.opts,D=new sU.SchemaEnv({schema:{},schemaId:U});if(I=sU.resolveSchema.call(this,D,$),!I)return;this.refs[$]=I}return I.validate||this._compileSchemaEnv(I)}removeSchema($){if($ instanceof RegExp)return this._removeAllSchemas(this.schemas,$),this._removeAllSchemas(this.refs,$),this;switch(typeof $){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let I=nJ.call(this,$);if(typeof I=="object")this._cache.delete(I.schema);return delete this.schemas[$],delete this.refs[$],this}case"object":{let I=$;this._cache.delete(I);let U=$[this.opts.schemaId];if(U)U=$b.normalizeId(U),delete this.schemas[U],delete this.refs[U];return this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary($){for(let I of $)this.addKeyword(I);return this}addKeyword($,I){let U;if(typeof $=="string"){if(U=$,typeof I=="object")this.logger.warn("these parameters are deprecated, see docs for addKeyword"),I.keyword=U}else if(typeof $=="object"&&I===void 0){if(I=$,U=I.keyword,Array.isArray(U)&&!U.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(nP.call(this,U,I),!I)return s9.eachItem(U,(b)=>e9.call(this,b)),this;rP.call(this,I);let D={...I,type:gA.getJSONTypes(I.type),schemaType:gA.getJSONTypes(I.schemaType)};return s9.eachItem(U,D.type.length===0?(b)=>e9.call(this,b,D):(b)=>D.type.forEach((w)=>e9.call(this,b,D,w))),this}getKeyword($){let I=this.RULES.all[$];return typeof I=="object"?I.definition:!!I}removeKeyword($){let{RULES:I}=this;delete I.keywords[$],delete I.all[$];for(let U of I.rules){let D=U.rules.findIndex((b)=>b.keyword===$);if(D>=0)U.rules.splice(D,1)}return this}addFormat($,I){if(typeof I=="string")I=new RegExp(I);return this.formats[$]=I,this}errorsText($=this.errors,{separator:I=", ",dataVar:U="data"}={}){if(!$||$.length===0)return"No errors";return $.map((D)=>`${U}${D.instancePath} ${D.message}`).reduce((D,b)=>D+I+b)}$dataMetaSchema($,I){let U=this.RULES.all;$=JSON.parse(JSON.stringify($));for(let D of I){let b=D.split("/").slice(1),w=$;for(let A of b)w=w[A];for(let A in U){let N=U[A];if(typeof N!="object")continue;let{$data:O}=N.definition,X=w[A];if(O&&X)w[A]=mJ(X)}}return $}_removeAllSchemas($,I){for(let U in $){let D=$[U];if(!I||I.test(U)){if(typeof D=="string")delete $[U];else if(D&&!D.meta)this._cache.delete(D.schema),delete $[U]}}}_addSchema($,I,U,D=this.opts.validateSchema,b=this.opts.addUsedSchema){let w,{schemaId:A}=this.opts;if(typeof $=="object")w=$[A];else if(this.opts.jtd)throw new Error("schema must be object");else if(typeof $!="boolean")throw new Error("schema must be object or boolean");let N=this._cache.get($);if(N!==void 0)return N;U=$b.normalizeId(w||U);let O=$b.getSchemaRefs.call(this,$,U);if(N=new sU.SchemaEnv({schema:$,schemaId:A,meta:I,baseId:U,localRefs:O}),this._cache.set(N.schema,N),b&&!U.startsWith("#")){if(U)this._checkUnique(U);this.refs[U]=N}if(D)this.validateSchema($,!0);return N}_checkUnique($){if(this.schemas[$]||this.refs[$])throw new Error(`schema with key or id "${$}" already exists`)}_compileSchemaEnv($){if($.meta)this._compileMetaSchema($);else sU.compileSchema.call(this,$);if(!$.validate)throw new Error("ajv implementation error");return $.validate}_compileMetaSchema($){let I=this.opts;this.opts=this._metaOpts;try{sU.compileSchema.call(this,$)}finally{this.opts=I}}}yA.ValidationError=jP.default;yA.MissingRefError=cJ.default;r6.default=yA;function iJ($,I,U,D="error"){for(let b in $){let w=b;if(w in I)this.logger[D](`${U}: option ${b}. ${$[w]}`)}}function nJ($){return $=$b.normalizeId($),this.schemas[$]||this.refs[$]}function gP(){let $=this.opts.schemas;if(!$)return;if(Array.isArray($))this.addSchema($);else for(let I in $)this.addSchema($[I],I)}function yP(){for(let $ in this.opts.formats){let I=this.opts.formats[$];if(I)this.addFormat($,I)}}function xP($){if(Array.isArray($)){this.addVocabulary($);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let I in $){let U=$[I];if(!U.keyword)U.keyword=I;this.addKeyword(U)}}function lP(){let $={...this.opts};for(let I of TP)delete $[I];return $}var hP={log(){},warn(){},error(){}};function uP($){if($===!1)return hP;if($===void 0)return console;if($.log&&$.warn&&$.error)return $;throw new Error("logger must implement log, warn and error methods")}var iP=/^[a-z_$][a-z0-9_$:-]*$/i;function nP($,I){let{RULES:U}=this;if(s9.eachItem($,(D)=>{if(U.keywords[D])throw new Error(`Keyword ${D} is already defined`);if(!iP.test(D))throw new Error(`Keyword ${D} has invalid name`)}),!I)return;if(I.$data&&!(("code"in I)||("validate"in I)))throw new Error('$data keyword must have "code" or "validate" function')}function e9($,I,U){var D;let b=I===null||I===void 0?void 0:I.post;if(U&&b)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:w}=this,A=b?w.post:w.rules.find(({type:O})=>O===U);if(!A)A={type:U,rules:[]},w.rules.push(A);if(w.keywords[$]=!0,!I)return;let N={keyword:$,definition:{...I,type:gA.getJSONTypes(I.type),schemaType:gA.getJSONTypes(I.schemaType)}};if(I.before)cP.call(this,A,N,I.before);else A.rules.push(N);w.all[$]=N,(D=I.implements)===null||D===void 0||D.forEach((O)=>this.addKeyword(O))}function cP($,I,U){let D=$.rules.findIndex((b)=>b.keyword===U);if(D>=0)$.rules.splice(D,0,I);else $.rules.push(I),this.logger.warn(`rule ${U} is not defined`)}function rP($){let{metaSchema:I}=$;if(I===void 0)return;if($.$data&&this.opts.$data)I=mJ(I);$.validateSchema=this.compile(I,!0)}var mP={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function mJ($){return{anyOf:[$,mP]}}});var pJ=R((dJ)=>{Object.defineProperty(dJ,"__esModule",{value:!0});var pP={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};dJ.default=pP});var IH=R((sJ)=>{Object.defineProperty(sJ,"__esModule",{value:!0});sJ.callRef=sJ.getValidate=void 0;var aP=tU(),tJ=b6(),m$=d(),eI=i6(),aJ=TA(),xA=w$(),eP={keyword:"$ref",schemaType:"string",code($){let{gen:I,schema:U,it:D}=$,{baseId:b,schemaEnv:w,validateName:A,opts:N,self:O}=D,{root:X}=w;if((U==="#"||U==="#/")&&b===X.baseId)return Q();let G=aJ.resolveRef.call(O,X,b,U);if(G===void 0)throw new aP.default(D.opts.uriResolver,b,U);if(G instanceof aJ.SchemaEnv)return Y(G);return B(G);function Q(){if(w===X)return lA($,A,w,w.$async);let J=I.scopeValue("root",{ref:X});return lA($,m$._`${J}.validate`,X,X.$async)}function Y(J){let L=eJ($,J);lA($,L,J,J.$async)}function B(J){let L=I.scopeValue("schema",N.code.source===!0?{ref:J,code:m$.stringify(J)}:{ref:J}),K=I.name("valid"),k=$.subschema({schema:J,dataTypes:[],schemaPath:m$.nil,topSchemaRef:L,errSchemaPath:U},K);$.mergeEvaluated(k),$.ok(K)}}};function eJ($,I){let{gen:U}=$;return I.validate?U.scopeValue("validate",{ref:I.validate}):m$._`${U.scopeValue("wrapper",{ref:I})}.validate`}sJ.getValidate=eJ;function lA($,I,U,D){let{gen:b,it:w}=$,{allErrors:A,schemaEnv:N,opts:O}=w,X=O.passContext?eI.default.this:m$.nil;if(D)G();else Q();function G(){if(!N.$async)throw new Error("async schema referenced by sync schema");let J=b.let("valid");b.try(()=>{if(b.code(m$._`await ${tJ.callValidateCode($,I,X)}`),B(I),!A)b.assign(J,!0)},(L)=>{if(b.if(m$._`!(${L} instanceof ${w.ValidationError})`,()=>b.throw(L)),Y(L),!A)b.assign(J,!1)}),$.ok(J)}function Q(){$.result(tJ.callValidateCode($,I,X),()=>B(I),()=>Y(I))}function Y(J){let L=m$._`${J}.errors`;b.assign(eI.default.vErrors,m$._`${eI.default.vErrors} === null ? ${L} : ${eI.default.vErrors}.concat(${L})`),b.assign(eI.default.errors,m$._`${eI.default.vErrors}.length`)}function B(J){var L;if(!w.opts.unevaluated)return;let K=(L=U===null||U===void 0?void 0:U.validate)===null||L===void 0?void 0:L.evaluated;if(w.props!==!0)if(K&&!K.dynamicProps){if(K.props!==void 0)w.props=xA.mergeEvaluated.props(b,K.props,w.props)}else{let k=b.var("props",m$._`${J}.evaluated.props`);w.props=xA.mergeEvaluated.props(b,k,w.props,m$.Name)}if(w.items!==!0)if(K&&!K.dynamicItems){if(K.items!==void 0)w.items=xA.mergeEvaluated.items(b,K.items,w.items)}else{let k=b.var("items",m$._`${J}.evaluated.items`);w.items=xA.mergeEvaluated.items(b,k,w.items,m$.Name)}}}sJ.callRef=lA;sJ.default=eP});var bH=R((UH)=>{Object.defineProperty(UH,"__esModule",{value:!0});var IR=pJ(),UR=IH(),bR=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",IR.default,UR.default];UH.default=bR});var wH=R((DH)=>{Object.defineProperty(DH,"__esModule",{value:!0});var hA=d(),V4=hA.operators,uA={maximum:{okStr:"<=",ok:V4.LTE,fail:V4.GT},minimum:{okStr:">=",ok:V4.GTE,fail:V4.LT},exclusiveMaximum:{okStr:"<",ok:V4.LT,fail:V4.GTE},exclusiveMinimum:{okStr:">",ok:V4.GT,fail:V4.LTE}},wR={message:({keyword:$,schemaCode:I})=>hA.str`must be ${uA[$].okStr} ${I}`,params:({keyword:$,schemaCode:I})=>hA._`{comparison: ${uA[$].okStr}, limit: ${I}}`},AR={keyword:Object.keys(uA),type:"number",schemaType:"number",$data:!0,error:wR,code($){let{keyword:I,data:U,schemaCode:D}=$;$.fail$data(hA._`${U} ${uA[I].fail} ${D} || isNaN(${U})`)}};DH.default=AR});var NH=R((AH)=>{Object.defineProperty(AH,"__esModule",{value:!0});var Ib=d(),OR={message:({schemaCode:$})=>Ib.str`must be multiple of ${$}`,params:({schemaCode:$})=>Ib._`{multipleOf: ${$}}`},XR={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:OR,code($){let{gen:I,data:U,schemaCode:D,it:b}=$,w=b.opts.multipleOfPrecision,A=I.let("res"),N=w?Ib._`Math.abs(Math.round(${A}) - ${A}) > 1e-${w}`:Ib._`${A} !== parseInt(${A})`;$.fail$data(Ib._`(${D} === 0 || (${A} = ${U}/${D}, ${N}))`)}};AH.default=XR});var WH=R((XH)=>{Object.defineProperty(XH,"__esModule",{value:!0});function OH($){let I=$.length,U=0,D=0,b;while(D<I)if(U++,b=$.charCodeAt(D++),b>=55296&&b<=56319&&D<I){if(b=$.charCodeAt(D),(b&64512)===56320)D++}return U}XH.default=OH;OH.code='require("ajv/dist/runtime/ucs2length").default'});var QH=R((GH)=>{Object.defineProperty(GH,"__esModule",{value:!0});var m4=d(),QR=w$(),YR=WH(),BR={message({keyword:$,schemaCode:I}){let U=$==="maxLength"?"more":"fewer";return m4.str`must NOT have ${U} than ${I} characters`},params:({schemaCode:$})=>m4._`{limit: ${$}}`},vR={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:BR,code($){let{keyword:I,data:U,schemaCode:D,it:b}=$,w=I==="maxLength"?m4.operators.GT:m4.operators.LT,A=b.opts.unicode===!1?m4._`${U}.length`:m4._`${QR.useFunc($.gen,YR.default)}(${U})`;$.fail$data(m4._`${A} ${w} ${D}`)}};GH.default=vR});var BH=R((YH)=>{Object.defineProperty(YH,"__esModule",{value:!0});var HR=b6(),iA=d(),LR={message:({schemaCode:$})=>iA.str`must match pattern "${$}"`,params:({schemaCode:$})=>iA._`{pattern: ${$}}`},zR={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:LR,code($){let{data:I,$data:U,schema:D,schemaCode:b,it:w}=$,A=w.opts.unicodeRegExp?"u":"",N=U?iA._`(new RegExp(${b}, ${A}))`:HR.usePattern($,D);$.fail$data(iA._`!${N}.test(${I})`)}};YH.default=zR});var JH=R((vH)=>{Object.defineProperty(vH,"__esModule",{value:!0});var Ub=d(),MR={message({keyword:$,schemaCode:I}){let U=$==="maxProperties"?"more":"fewer";return Ub.str`must NOT have ${U} than ${I} properties`},params:({schemaCode:$})=>Ub._`{limit: ${$}}`},KR={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:MR,code($){let{keyword:I,data:U,schemaCode:D}=$,b=I==="maxProperties"?Ub.operators.GT:Ub.operators.LT;$.fail$data(Ub._`Object.keys(${U}).length ${b} ${D}`)}};vH.default=KR});var LH=R((HH)=>{Object.defineProperty(HH,"__esModule",{value:!0});var bb=b6(),Db=d(),qR=w$(),kR={message:({params:{missingProperty:$}})=>Db.str`must have required property '${$}'`,params:({params:{missingProperty:$}})=>Db._`{missingProperty: ${$}}`},ER={keyword:"required",type:"object",schemaType:"array",$data:!0,error:kR,code($){let{gen:I,schema:U,schemaCode:D,data:b,$data:w,it:A}=$,{opts:N}=A;if(!w&&U.length===0)return;let O=U.length>=N.loopRequired;if(A.allErrors)X();else G();if(N.strictRequired){let B=$.parentSchema.properties,{definedProperties:J}=$.it;for(let L of U)if((B===null||B===void 0?void 0:B[L])===void 0&&!J.has(L)){let K=A.schemaEnv.baseId+A.errSchemaPath,k=`required property "${L}" is not defined at "${K}" (strictRequired)`;qR.checkStrictMode(A,k,A.opts.strictRequired)}}function X(){if(O||w)$.block$data(Db.nil,Q);else for(let B of U)bb.checkReportMissingProp($,B)}function G(){let B=I.let("missing");if(O||w){let J=I.let("valid",!0);$.block$data(J,()=>Y(B,J)),$.ok(J)}else I.if(bb.checkMissingProp($,U,B)),bb.reportMissingProp($,B),I.else()}function Q(){I.forOf("prop",D,(B)=>{$.setParams({missingProperty:B}),I.if(bb.noPropertyInData(I,b,B,N.ownProperties),()=>$.error())})}function Y(B,J){$.setParams({missingProperty:B}),I.forOf(B,D,()=>{I.assign(J,bb.propertyInData(I,b,B,N.ownProperties)),I.if(Db.not(J),()=>{$.error(),I.break()})},Db.nil)}}};HH.default=ER});var VH=R((zH)=>{Object.defineProperty(zH,"__esModule",{value:!0});var wb=d(),SR={message({keyword:$,schemaCode:I}){let U=$==="maxItems"?"more":"fewer";return wb.str`must NOT have ${U} than ${I} items`},params:({schemaCode:$})=>wb._`{limit: ${$}}`},PR={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:SR,code($){let{keyword:I,data:U,schemaCode:D}=$,b=I==="maxItems"?wb.operators.GT:wb.operators.LT;$.fail$data(wb._`${U}.length ${b} ${D}`)}};zH.default=PR});var nA=R((KH)=>{Object.defineProperty(KH,"__esModule",{value:!0});var MH=x9();MH.code='require("ajv/dist/runtime/equal").default';KH.default=MH});var qH=R((FH)=>{Object.defineProperty(FH,"__esModule",{value:!0});var $8=rU(),R$=d(),_R=w$(),CR=nA(),ZR={message:({params:{i:$,j:I}})=>R$.str`must NOT have duplicate items (items ## ${I} and ${$} are identical)`,params:({params:{i:$,j:I}})=>R$._`{i: ${$}, j: ${I}}`},fR={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:ZR,code($){let{gen:I,data:U,$data:D,schema:b,parentSchema:w,schemaCode:A,it:N}=$;if(!D&&!b)return;let O=I.let("valid"),X=w.items?$8.getSchemaTypes(w.items):[];$.block$data(O,G,R$._`${A} === false`),$.ok(O);function G(){let J=I.let("i",R$._`${U}.length`),L=I.let("j");$.setParams({i:J,j:L}),I.assign(O,!0),I.if(R$._`${J} > 1`,()=>(Q()?Y:B)(J,L))}function Q(){return X.length>0&&!X.some((J)=>J==="object"||J==="array")}function Y(J,L){let K=I.name("item"),k=$8.checkDataTypes(X,K,N.opts.strictNumbers,$8.DataType.Wrong),g=I.const("indices",R$._`{}`);I.for(R$._`;${J}--;`,()=>{if(I.let(K,R$._`${U}[${J}]`),I.if(k,R$._`continue`),X.length>1)I.if(R$._`typeof ${K} == "string"`,R$._`${K} += "_"`);I.if(R$._`typeof ${g}[${K}] == "number"`,()=>{I.assign(L,R$._`${g}[${K}]`),$.error(),I.assign(O,!1).break()}).code(R$._`${g}[${K}] = ${J}`)})}function B(J,L){let K=_R.useFunc(I,CR.default),k=I.name("outer");I.label(k).for(R$._`;${J}--;`,()=>I.for(R$._`${L} = ${J}; ${L}--;`,()=>I.if(R$._`${K}(${U}[${J}], ${U}[${L}])`,()=>{$.error(),I.assign(O,!1).break(k)})))}}};FH.default=fR});var EH=R((kH)=>{Object.defineProperty(kH,"__esModule",{value:!0});var I8=d(),yR=w$(),xR=nA(),lR={message:"must be equal to constant",params:({schemaCode:$})=>I8._`{allowedValue: ${$}}`},hR={keyword:"const",$data:!0,error:lR,code($){let{gen:I,data:U,$data:D,schemaCode:b,schema:w}=$;if(D||w&&typeof w=="object")$.fail$data(I8._`!${yR.useFunc(I,xR.default)}(${U}, ${b})`);else $.fail(I8._`${w} !== ${U}`)}};kH.default=hR});var SH=R((jH)=>{Object.defineProperty(jH,"__esModule",{value:!0});var Ab=d(),iR=w$(),nR=nA(),cR={message:"must be equal to one of the allowed values",params:({schemaCode:$})=>Ab._`{allowedValues: ${$}}`},rR={keyword:"enum",schemaType:"array",$data:!0,error:cR,code($){let{gen:I,data:U,$data:D,schema:b,schemaCode:w,it:A}=$;if(!D&&b.length===0)throw new Error("enum must have non-empty array");let N=b.length>=A.opts.loopEnum,O,X=()=>O!==null&&O!==void 0?O:O=iR.useFunc(I,nR.default),G;if(N||D)G=I.let("valid"),$.block$data(G,Q);else{if(!Array.isArray(b))throw new Error("ajv implementation error");let B=I.const("vSchema",w);G=Ab.or(...b.map((J,L)=>Y(B,L)))}$.pass(G);function Q(){I.assign(G,!1),I.forOf("v",w,(B)=>I.if(Ab._`${X()}(${U}, ${B})`,()=>I.assign(G,!0).break()))}function Y(B,J){let L=b[J];return typeof L==="object"&&L!==null?Ab._`${X()}(${U}, ${B}[${J}])`:Ab._`${U} === ${L}`}}};jH.default=rR});var RH=R((PH)=>{Object.defineProperty(PH,"__esModule",{value:!0});var oR=wH(),dR=NH(),pR=QH(),tR=BH(),aR=JH(),eR=LH(),sR=VH(),$T=qH(),IT=EH(),UT=SH(),bT=[oR.default,dR.default,pR.default,tR.default,aR.default,eR.default,sR.default,$T.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},IT.default,UT.default];PH.default=bT});var b8=R((_H)=>{Object.defineProperty(_H,"__esModule",{value:!0});_H.validateAdditionalItems=void 0;var o4=d(),U8=w$(),wT={message:({params:{len:$}})=>o4.str`must NOT have more than ${$} items`,params:({params:{len:$}})=>o4._`{limit: ${$}}`},AT={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:wT,code($){let{parentSchema:I,it:U}=$,{items:D}=I;if(!Array.isArray(D)){U8.checkStrictMode(U,'"additionalItems" is ignored when "items" is not an array of schemas');return}TH($,D)}};function TH($,I){let{gen:U,schema:D,data:b,keyword:w,it:A}=$;A.items=!0;let N=U.const("len",o4._`${b}.length`);if(D===!1)$.setParams({len:I.length}),$.pass(o4._`${N} <= ${I.length}`);else if(typeof D=="object"&&!U8.alwaysValidSchema(A,D)){let X=U.var("valid",o4._`${N} <= ${I.length}`);U.if(o4.not(X),()=>O(X)),$.ok(X)}function O(X){U.forRange("i",I.length,N,(G)=>{if($.subschema({keyword:w,dataProp:G,dataPropType:U8.Type.Num},X),!A.allErrors)U.if(o4.not(X),()=>U.break())})}}_H.validateAdditionalItems=TH;_H.default=AT});var D8=R((gH)=>{Object.defineProperty(gH,"__esModule",{value:!0});gH.validateTuple=void 0;var ZH=d(),cA=w$(),OT=b6(),XT={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code($){let{schema:I,it:U}=$;if(Array.isArray(I))return fH($,"additionalItems",I);if(U.items=!0,cA.alwaysValidSchema(U,I))return;$.ok(OT.validateArray($))}};function fH($,I,U=$.schema){let{gen:D,parentSchema:b,data:w,keyword:A,it:N}=$;if(G(b),N.opts.unevaluated&&U.length&&N.items!==!0)N.items=cA.mergeEvaluated.items(D,U.length,N.items);let O=D.name("valid"),X=D.const("len",ZH._`${w}.length`);U.forEach((Q,Y)=>{if(cA.alwaysValidSchema(N,Q))return;D.if(ZH._`${X} > ${Y}`,()=>$.subschema({keyword:A,schemaProp:Y,dataProp:Y},O)),$.ok(O)});function G(Q){let{opts:Y,errSchemaPath:B}=N,J=U.length,L=J===Q.minItems&&(J===Q.maxItems||Q[I]===!1);if(Y.strictTuples&&!L){let K=`"${A}" is ${J}-tuple, but minItems or maxItems/${I} are not specified or different at path "${B}"`;cA.checkStrictMode(N,K,Y.strictTuples)}}}gH.validateTuple=fH;gH.default=XT});var lH=R((xH)=>{Object.defineProperty(xH,"__esModule",{value:!0});var GT=D8(),QT={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:($)=>GT.validateTuple($,"items")};xH.default=QT});var iH=R((uH)=>{Object.defineProperty(uH,"__esModule",{value:!0});var hH=d(),BT=w$(),vT=b6(),JT=b8(),HT={message:({params:{len:$}})=>hH.str`must NOT have more than ${$} items`,params:({params:{len:$}})=>hH._`{limit: ${$}}`},LT={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:HT,code($){let{schema:I,parentSchema:U,it:D}=$,{prefixItems:b}=U;if(D.items=!0,BT.alwaysValidSchema(D,I))return;if(b)JT.validateAdditionalItems($,b);else $.ok(vT.validateArray($))}};uH.default=LT});var cH=R((nH)=>{Object.defineProperty(nH,"__esModule",{value:!0});var D6=d(),rA=w$(),VT={message:({params:{min:$,max:I}})=>I===void 0?D6.str`must contain at least ${$} valid item(s)`:D6.str`must contain at least ${$} and no more than ${I} valid item(s)`,params:({params:{min:$,max:I}})=>I===void 0?D6._`{minContains: ${$}}`:D6._`{minContains: ${$}, maxContains: ${I}}`},MT={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:VT,code($){let{gen:I,schema:U,parentSchema:D,data:b,it:w}=$,A,N,{minContains:O,maxContains:X}=D;if(w.opts.next)A=O===void 0?1:O,N=X;else A=1;let G=I.const("len",D6._`${b}.length`);if($.setParams({min:A,max:N}),N===void 0&&A===0){rA.checkStrictMode(w,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(N!==void 0&&A>N){rA.checkStrictMode(w,'"minContains" > "maxContains" is always invalid'),$.fail();return}if(rA.alwaysValidSchema(w,U)){let L=D6._`${G} >= ${A}`;if(N!==void 0)L=D6._`${L} && ${G} <= ${N}`;$.pass(L);return}w.items=!0;let Q=I.name("valid");if(N===void 0&&A===1)B(Q,()=>I.if(Q,()=>I.break()));else if(A===0){if(I.let(Q,!0),N!==void 0)I.if(D6._`${b}.length > 0`,Y)}else I.let(Q,!1),Y();$.result(Q,()=>$.reset());function Y(){let L=I.name("_valid"),K=I.let("count",0);B(L,()=>I.if(L,()=>J(K)))}function B(L,K){I.forRange("i",0,G,(k)=>{$.subschema({keyword:"contains",dataProp:k,dataPropType:rA.Type.Num,compositeRule:!0},L),K()})}function J(L){if(I.code(D6._`${L}++`),N===void 0)I.if(D6._`${L} >= ${A}`,()=>I.assign(Q,!0).break());else if(I.if(D6._`${L} > ${N}`,()=>I.assign(Q,!1).break()),A===1)I.assign(Q,!0);else I.if(D6._`${L} >= ${A}`,()=>I.assign(Q,!0))}}};nH.default=MT});var tH=R((oH)=>{Object.defineProperty(oH,"__esModule",{value:!0});oH.validateSchemaDeps=oH.validatePropertyDeps=oH.error=void 0;var w8=d(),FT=w$(),Nb=b6();oH.error={message:({params:{property:$,depsCount:I,deps:U}})=>{let D=I===1?"property":"properties";return w8.str`must have ${D} ${U} when property ${$} is present`},params:({params:{property:$,depsCount:I,deps:U,missingProperty:D}})=>w8._`{property: ${$},
|
|
2
|
+
var iV=Object.create;var{getPrototypeOf:nV,defineProperty:u0,getOwnPropertyNames:rV}=Object;var cV=Object.prototype.hasOwnProperty;var dY=($,I,U)=>{U=$!=null?iV(nV($)):{};let D=I||!$||!$.__esModule?u0(U,"default",{value:$,enumerable:!0}):U;for(let b of rV($))if(!cV.call(D,b))u0(D,b,{get:()=>$[b],enumerable:!0});return D};var T=($,I)=>()=>(I||$((I={exports:{}}).exports,I),I.exports);var f6=($,I)=>{for(var U in I)u0($,U,{get:I[U],enumerable:!0,configurable:!0,set:(D)=>I[U]=()=>D})};var n1=T((U5)=>{Object.defineProperty(U5,"__esModule",{value:!0});U5.regexpCode=U5.getEsmExportName=U5.getProperty=U5.safeStringify=U5.stringify=U5.strConcat=U5.addCodeArg=U5.str=U5._=U5.nil=U5._Code=U5.Name=U5.IDENTIFIER=U5._CodeOrName=void 0;class zO{}U5._CodeOrName=zO;U5.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class cI extends zO{constructor($){super();if(!U5.IDENTIFIER.test($))throw new Error("CodeGen: name must be a valid identifier");this.str=$}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}U5.Name=cI;class W6 extends zO{constructor($){super();this._items=typeof $==="string"?[$]:$}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let $=this._items[0];return $===""||$==='""'}get str(){var $;return($=this._str)!==null&&$!==void 0?$:this._str=this._items.reduce((I,U)=>`${I}${U}`,"")}get names(){var $;return($=this._names)!==null&&$!==void 0?$:this._names=this._items.reduce((I,U)=>{if(U instanceof cI)I[U.str]=(I[U.str]||0)+1;return I},{})}}U5._Code=W6;U5.nil=new W6("");function $5($,...I){let U=[$[0]],D=0;while(D<I.length)S9(U,I[D]),U.push($[++D]);return new W6(U)}U5._=$5;var E9=new W6("+");function I5($,...I){let U=[i1($[0])],D=0;while(D<I.length)U.push(E9),S9(U,I[D]),U.push(E9,i1($[++D]));return xq(U),new W6(U)}U5.str=I5;function S9($,I){if(I instanceof W6)$.push(...I._items);else if(I instanceof cI)$.push(I);else $.push(uq(I))}U5.addCodeArg=S9;function xq($){let I=1;while(I<$.length-1){if($[I]===E9){let U=lq($[I-1],$[I+1]);if(U!==void 0){$.splice(I-1,3,U);continue}$[I++]="+"}I++}}function lq($,I){if(I==='""')return $;if($==='""')return I;if(typeof $=="string"){if(I instanceof cI||$[$.length-1]!=='"')return;if(typeof I!="string")return`${$.slice(0,-1)}${I}"`;if(I[0]==='"')return $.slice(0,-1)+I.slice(1);return}if(typeof I=="string"&&I[0]==='"'&&!($ instanceof cI))return`"${$}${I.slice(1)}`;return}function hq($,I){return I.emptyStr()?$:$.emptyStr()?I:I5`${$}${I}`}U5.strConcat=hq;function uq($){return typeof $=="number"||typeof $=="boolean"||$===null?$:i1(Array.isArray($)?$.join(","):$)}function iq($){return new W6(i1($))}U5.stringify=iq;function i1($){return JSON.stringify($).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}U5.safeStringify=i1;function nq($){return typeof $=="string"&&U5.IDENTIFIER.test($)?new W6(`.${$}`):$5`[${$}]`}U5.getProperty=nq;function rq($){if(typeof $=="string"&&U5.IDENTIFIER.test($))return new W6(`${$}`);throw new Error(`CodeGen: invalid export name: ${$}, use explicit $id name mapping`)}U5.getEsmExportName=rq;function cq($){return new W6($.toString())}U5.regexpCode=cq});var T9=T((w5)=>{Object.defineProperty(w5,"__esModule",{value:!0});w5.ValueScope=w5.ValueScopeName=w5.Scope=w5.varKinds=w5.UsedValueState=void 0;var r$=n1();class D5 extends Error{constructor($){super(`CodeGen: "code" for ${$} not defined`);this.value=$.value}}var kO;(function($){$[$.Started=0]="Started",$[$.Completed=1]="Completed"})(kO||(w5.UsedValueState=kO={}));w5.varKinds={const:new r$.Name("const"),let:new r$.Name("let"),var:new r$.Name("var")};class P9{constructor({prefixes:$,parent:I}={}){this._names={},this._prefixes=$,this._parent=I}toName($){return $ instanceof r$.Name?$:this.name($)}name($){return new r$.Name(this._newName($))}_newName($){let I=this._names[$]||this._nameGroup($);return`${$}${I.index++}`}_nameGroup($){var I,U;if(((U=(I=this._parent)===null||I===void 0?void 0:I._prefixes)===null||U===void 0?void 0:U.has($))||this._prefixes&&!this._prefixes.has($))throw new Error(`CodeGen: prefix "${$}" is not allowed in this scope`);return this._names[$]={prefix:$,index:0}}}w5.Scope=P9;class R9 extends r$.Name{constructor($,I){super(I);this.prefix=$}setValue($,{property:I,itemIndex:U}){this.value=$,this.scopePath=r$._`.${new r$.Name(I)}[${U}]`}}w5.ValueScopeName=R9;var DE=r$._`\n`;class A5 extends P9{constructor($){super($);this._values={},this._scope=$.scope,this.opts={...$,_n:$.lines?DE:r$.nil}}get(){return this._scope}name($){return new R9($,this._newName($))}value($,I){var U;if(I.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let D=this.toName($),{prefix:b}=D,A=(U=I.key)!==null&&U!==void 0?U:I.ref,w=this._values[b];if(w){let X=w.get(A);if(X)return X}else w=this._values[b]=new Map;w.set(A,D);let O=this._scope[b]||(this._scope[b]=[]),N=O.length;return O[N]=I.ref,D.setValue(I,{property:b,itemIndex:N}),D}getValue($,I){let U=this._values[$];if(!U)return;return U.get(I)}scopeRefs($,I=this._values){return this._reduceValues(I,(U)=>{if(U.scopePath===void 0)throw new Error(`CodeGen: name "${U}" has no value`);return r$._`${$}${U.scopePath}`})}scopeCode($=this._values,I,U){return this._reduceValues($,(D)=>{if(D.value===void 0)throw new Error(`CodeGen: name "${D}" has no value`);return D.value.code},I,U)}_reduceValues($,I,U={},D){let b=r$.nil;for(let A in $){let w=$[A];if(!w)continue;let O=U[A]=U[A]||new Map;w.forEach((N)=>{if(O.has(N))return;O.set(N,kO.Started);let X=I(N);if(X){let G=this.opts.es5?w5.varKinds.var:w5.varKinds.const;b=r$._`${b}${G} ${N} = ${X};${this.opts._n}`}else if(X=D===null||D===void 0?void 0:D(N))b=r$._`${b}${X}${this.opts._n}`;else throw new D5(N);O.set(N,kO.Completed)})}return b}}w5.ValueScope=A5});var d=T((c$)=>{Object.defineProperty(c$,"__esModule",{value:!0});c$.or=c$.and=c$.not=c$.CodeGen=c$.operators=c$.varKinds=c$.ValueScopeName=c$.ValueScope=c$.Scope=c$.Name=c$.regexpCode=c$.stringify=c$.getProperty=c$.nil=c$.strConcat=c$.str=c$._=void 0;var U$=n1(),G6=T9(),B4=n1();Object.defineProperty(c$,"_",{enumerable:!0,get:function(){return B4._}});Object.defineProperty(c$,"str",{enumerable:!0,get:function(){return B4.str}});Object.defineProperty(c$,"strConcat",{enumerable:!0,get:function(){return B4.strConcat}});Object.defineProperty(c$,"nil",{enumerable:!0,get:function(){return B4.nil}});Object.defineProperty(c$,"getProperty",{enumerable:!0,get:function(){return B4.getProperty}});Object.defineProperty(c$,"stringify",{enumerable:!0,get:function(){return B4.stringify}});Object.defineProperty(c$,"regexpCode",{enumerable:!0,get:function(){return B4.regexpCode}});Object.defineProperty(c$,"Name",{enumerable:!0,get:function(){return B4.Name}});var RO=T9();Object.defineProperty(c$,"Scope",{enumerable:!0,get:function(){return RO.Scope}});Object.defineProperty(c$,"ValueScope",{enumerable:!0,get:function(){return RO.ValueScope}});Object.defineProperty(c$,"ValueScopeName",{enumerable:!0,get:function(){return RO.ValueScopeName}});Object.defineProperty(c$,"varKinds",{enumerable:!0,get:function(){return RO.varKinds}});c$.operators={GT:new U$._Code(">"),GTE:new U$._Code(">="),LT:new U$._Code("<"),LTE:new U$._Code("<="),EQ:new U$._Code("==="),NEQ:new U$._Code("!=="),NOT:new U$._Code("!"),OR:new U$._Code("||"),AND:new U$._Code("&&"),ADD:new U$._Code("+")};class L4{optimizeNodes(){return this}optimizeNames($,I){return this}}class N5 extends L4{constructor($,I,U){super();this.varKind=$,this.name=I,this.rhs=U}render({es5:$,_n:I}){let U=$?G6.varKinds.var:this.varKind,D=this.rhs===void 0?"":` = ${this.rhs}`;return`${U} ${this.name}${D};`+I}optimizeNames($,I){if(!$[this.name.str])return;if(this.rhs)this.rhs=oI(this.rhs,$,I);return this}get names(){return this.rhs instanceof U$._CodeOrName?this.rhs.names:{}}}class f9 extends L4{constructor($,I,U){super();this.lhs=$,this.rhs=I,this.sideEffects=U}render({_n:$}){return`${this.lhs} = ${this.rhs};`+$}optimizeNames($,I){if(this.lhs instanceof U$.Name&&!$[this.lhs.str]&&!this.sideEffects)return;return this.rhs=oI(this.rhs,$,I),this}get names(){let $=this.lhs instanceof U$.Name?{}:{...this.lhs.names};return PO($,this.rhs)}}class X5 extends f9{constructor($,I,U,D){super($,U,D);this.op=I}render({_n:$}){return`${this.lhs} ${this.op}= ${this.rhs};`+$}}class W5 extends L4{constructor($){super();this.label=$,this.names={}}render({_n:$}){return`${this.label}:`+$}}class G5 extends L4{constructor($){super();this.label=$,this.names={}}render({_n:$}){return`break${this.label?` ${this.label}`:""};`+$}}class Q5 extends L4{constructor($){super();this.error=$}render({_n:$}){return`throw ${this.error};`+$}get names(){return this.error.names}}class Y5 extends L4{constructor($){super();this.code=$}render({_n:$}){return`${this.code};`+$}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames($,I){return this.code=oI(this.code,$,I),this}get names(){return this.code instanceof U$._CodeOrName?this.code.names:{}}}class TO extends L4{constructor($=[]){super();this.nodes=$}render($){return this.nodes.reduce((I,U)=>I+U.render($),"")}optimizeNodes(){let{nodes:$}=this,I=$.length;while(I--){let U=$[I].optimizeNodes();if(Array.isArray(U))$.splice(I,1,...U);else if(U)$[I]=U;else $.splice(I,1)}return $.length>0?this:void 0}optimizeNames($,I){let{nodes:U}=this,D=U.length;while(D--){let b=U[D];if(b.optimizeNames($,I))continue;NE($,b.names),U.splice(D,1)}return U.length>0?this:void 0}get names(){return this.nodes.reduce(($,I)=>i4($,I.names),{})}}class J4 extends TO{render($){return"{"+$._n+super.render($)+"}"+$._n}}class v5 extends TO{}class r1 extends J4{}r1.kind="else";class u6 extends J4{constructor($,I){super(I);this.condition=$}render($){let I=`if(${this.condition})`+super.render($);if(this.else)I+="else "+this.else.render($);return I}optimizeNodes(){super.optimizeNodes();let $=this.condition;if($===!0)return this.nodes;let I=this.else;if(I){let U=I.optimizeNodes();I=this.else=Array.isArray(U)?new r1(U):U}if(I){if($===!1)return I instanceof u6?I:I.nodes;if(this.nodes.length)return this;return new u6(M5($),I instanceof u6?[I]:I.nodes)}if($===!1||!this.nodes.length)return;return this}optimizeNames($,I){var U;if(this.else=(U=this.else)===null||U===void 0?void 0:U.optimizeNames($,I),!(super.optimizeNames($,I)||this.else))return;return this.condition=oI(this.condition,$,I),this}get names(){let $=super.names;if(PO($,this.condition),this.else)i4($,this.else.names);return $}}u6.kind="if";class mI extends J4{}mI.kind="for";class B5 extends mI{constructor($){super();this.iteration=$}render($){return`for(${this.iteration})`+super.render($)}optimizeNames($,I){if(!super.optimizeNames($,I))return;return this.iteration=oI(this.iteration,$,I),this}get names(){return i4(super.names,this.iteration.names)}}class L5 extends mI{constructor($,I,U,D){super();this.varKind=$,this.name=I,this.from=U,this.to=D}render($){let I=$.es5?G6.varKinds.var:this.varKind,{name:U,from:D,to:b}=this;return`for(${I} ${U}=${D}; ${U}<${b}; ${U}++)`+super.render($)}get names(){let $=PO(super.names,this.from);return PO($,this.to)}}class _9 extends mI{constructor($,I,U,D){super();this.loop=$,this.varKind=I,this.name=U,this.iterable=D}render($){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render($)}optimizeNames($,I){if(!super.optimizeNames($,I))return;return this.iterable=oI(this.iterable,$,I),this}get names(){return i4(super.names,this.iterable.names)}}class qO extends J4{constructor($,I,U){super();this.name=$,this.args=I,this.async=U}render($){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render($)}}qO.kind="func";class EO extends TO{render($){return"return "+super.render($)}}EO.kind="return";class J5 extends J4{render($){let I="try"+super.render($);if(this.catch)I+=this.catch.render($);if(this.finally)I+=this.finally.render($);return I}optimizeNodes(){var $,I;return super.optimizeNodes(),($=this.catch)===null||$===void 0||$.optimizeNodes(),(I=this.finally)===null||I===void 0||I.optimizeNodes(),this}optimizeNames($,I){var U,D;return super.optimizeNames($,I),(U=this.catch)===null||U===void 0||U.optimizeNames($,I),(D=this.finally)===null||D===void 0||D.optimizeNames($,I),this}get names(){let $=super.names;if(this.catch)i4($,this.catch.names);if(this.finally)i4($,this.finally.names);return $}}class SO extends J4{constructor($){super();this.error=$}render($){return`catch(${this.error})`+super.render($)}}SO.kind="catch";class jO extends J4{render($){return"finally"+super.render($)}}jO.kind="finally";class H5{constructor($,I={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...I,_n:I.lines?`
|
|
3
|
+
`:""},this._extScope=$,this._scope=new G6.Scope({parent:$}),this._nodes=[new v5]}toString(){return this._root.render(this.opts)}name($){return this._scope.name($)}scopeName($){return this._extScope.name($)}scopeValue($,I){let U=this._extScope.value($,I);return(this._values[U.prefix]||(this._values[U.prefix]=new Set)).add(U),U}getScopeValue($,I){return this._extScope.getValue($,I)}scopeRefs($){return this._extScope.scopeRefs($,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def($,I,U,D){let b=this._scope.toName(I);if(U!==void 0&&D)this._constants[b.str]=U;return this._leafNode(new N5($,b,U)),b}const($,I,U){return this._def(G6.varKinds.const,$,I,U)}let($,I,U){return this._def(G6.varKinds.let,$,I,U)}var($,I,U){return this._def(G6.varKinds.var,$,I,U)}assign($,I,U){return this._leafNode(new f9($,I,U))}add($,I){return this._leafNode(new X5($,c$.operators.ADD,I))}code($){if(typeof $=="function")$();else if($!==U$.nil)this._leafNode(new Y5($));return this}object(...$){let I=["{"];for(let[U,D]of $){if(I.length>1)I.push(",");if(I.push(U),U!==D||this.opts.es5)I.push(":"),U$.addCodeArg(I,D)}return I.push("}"),new U$._Code(I)}if($,I,U){if(this._blockNode(new u6($)),I&&U)this.code(I).else().code(U).endIf();else if(I)this.code(I).endIf();else if(U)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf($){return this._elseNode(new u6($))}else(){return this._elseNode(new r1)}endIf(){return this._endBlockNode(u6,r1)}_for($,I){if(this._blockNode($),I)this.code(I).endFor();return this}for($,I){return this._for(new B5($),I)}forRange($,I,U,D,b=this.opts.es5?G6.varKinds.var:G6.varKinds.let){let A=this._scope.toName($);return this._for(new L5(b,A,I,U),()=>D(A))}forOf($,I,U,D=G6.varKinds.const){let b=this._scope.toName($);if(this.opts.es5){let A=I instanceof U$.Name?I:this.var("_arr",I);return this.forRange("_i",0,U$._`${A}.length`,(w)=>{this.var(b,U$._`${A}[${w}]`),U(b)})}return this._for(new _9("of",D,b,I),()=>U(b))}forIn($,I,U,D=this.opts.es5?G6.varKinds.var:G6.varKinds.const){if(this.opts.ownProperties)return this.forOf($,U$._`Object.keys(${I})`,U);let b=this._scope.toName($);return this._for(new _9("in",D,b,I),()=>U(b))}endFor(){return this._endBlockNode(mI)}label($){return this._leafNode(new W5($))}break($){return this._leafNode(new G5($))}return($){let I=new EO;if(this._blockNode(I),this.code($),I.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(EO)}try($,I,U){if(!I&&!U)throw new Error('CodeGen: "try" without "catch" and "finally"');let D=new J5;if(this._blockNode(D),this.code($),I){let b=this.name("e");this._currNode=D.catch=new SO(b),I(b)}if(U)this._currNode=D.finally=new jO,this.code(U);return this._endBlockNode(SO,jO)}throw($){return this._leafNode(new Q5($))}block($,I){if(this._blockStarts.push(this._nodes.length),$)this.code($).endBlock(I);return this}endBlock($){let I=this._blockStarts.pop();if(I===void 0)throw new Error("CodeGen: not in self-balancing block");let U=this._nodes.length-I;if(U<0||$!==void 0&&U!==$)throw new Error(`CodeGen: wrong number of nodes: ${U} vs ${$} expected`);return this._nodes.length=I,this}func($,I=U$.nil,U,D){if(this._blockNode(new qO($,I,U)),D)this.code(D).endFunc();return this}endFunc(){return this._endBlockNode(qO)}optimize($=1){while($-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode($){return this._currNode.nodes.push($),this}_blockNode($){this._currNode.nodes.push($),this._nodes.push($)}_endBlockNode($,I){let U=this._currNode;if(U instanceof $||I&&U instanceof I)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${I?`${$.kind}/${I.kind}`:$.kind}"`)}_elseNode($){let I=this._currNode;if(!(I instanceof u6))throw new Error('CodeGen: "else" without "if"');return this._currNode=I.else=$,this}get _root(){return this._nodes[0]}get _currNode(){let $=this._nodes;return $[$.length-1]}set _currNode($){let I=this._nodes;I[I.length-1]=$}}c$.CodeGen=H5;function i4($,I){for(let U in I)$[U]=($[U]||0)+(I[U]||0);return $}function PO($,I){return I instanceof U$._CodeOrName?i4($,I.names):$}function oI($,I,U){if($ instanceof U$.Name)return D($);if(!b($))return $;return new U$._Code($._items.reduce((A,w)=>{if(w instanceof U$.Name)w=D(w);if(w instanceof U$._Code)A.push(...w._items);else A.push(w);return A},[]));function D(A){let w=U[A.str];if(w===void 0||I[A.str]!==1)return A;return delete I[A.str],w}function b(A){return A instanceof U$._Code&&A._items.some((w)=>w instanceof U$.Name&&I[w.str]===1&&U[w.str]!==void 0)}}function NE($,I){for(let U in I)$[U]=($[U]||0)-(I[U]||0)}function M5($){return typeof $=="boolean"||typeof $=="number"||$===null?!$:U$._`!${C9($)}`}c$.not=M5;var XE=V5(c$.operators.AND);function WE(...$){return $.reduce(XE)}c$.and=WE;var GE=V5(c$.operators.OR);function QE(...$){return $.reduce(GE)}c$.or=QE;function V5($){return(I,U)=>I===U$.nil?U:U===U$.nil?I:U$._`${C9(I)} ${$} ${C9(U)}`}function C9($){return $ instanceof U$.Name?$:U$._`(${$})`}});var A$=T((P5)=>{Object.defineProperty(P5,"__esModule",{value:!0});P5.checkStrictMode=P5.getErrorPath=P5.Type=P5.useFunc=P5.setEvaluated=P5.evaluatedPropsToName=P5.mergeEvaluated=P5.eachItem=P5.unescapeJsonPointer=P5.escapeJsonPointer=P5.escapeFragment=P5.unescapeFragment=P5.schemaRefOrVal=P5.schemaHasRulesButRef=P5.schemaHasRules=P5.checkUnknownRules=P5.alwaysValidSchema=P5.toHash=void 0;var B$=d(),LE=n1();function JE($){let I={};for(let U of $)I[U]=!0;return I}P5.toHash=JE;function HE($,I){if(typeof I=="boolean")return I;if(Object.keys(I).length===0)return!0;return k5($,I),!q5(I,$.self.RULES.all)}P5.alwaysValidSchema=HE;function k5($,I=$.schema){let{opts:U,self:D}=$;if(!U.strictSchema)return;if(typeof I==="boolean")return;let b=D.RULES.keywords;for(let A in I)if(!b[A])j5($,`unknown keyword: "${A}"`)}P5.checkUnknownRules=k5;function q5($,I){if(typeof $=="boolean")return!$;for(let U in $)if(I[U])return!0;return!1}P5.schemaHasRules=q5;function ME($,I){if(typeof $=="boolean")return!$;for(let U in $)if(U!=="$ref"&&I.all[U])return!0;return!1}P5.schemaHasRulesButRef=ME;function VE({topSchemaRef:$,schemaPath:I},U,D,b){if(!b){if(typeof U=="number"||typeof U=="boolean")return U;if(typeof U=="string")return B$._`${U}`}return B$._`${$}${I}${B$.getProperty(D)}`}P5.schemaRefOrVal=VE;function KE($){return E5(decodeURIComponent($))}P5.unescapeFragment=KE;function zE($){return encodeURIComponent(g9($))}P5.escapeFragment=zE;function g9($){if(typeof $=="number")return`${$}`;return $.replace(/~/g,"~0").replace(/\//g,"~1")}P5.escapeJsonPointer=g9;function E5($){return $.replace(/~1/g,"/").replace(/~0/g,"~")}P5.unescapeJsonPointer=E5;function FE($,I){if(Array.isArray($))for(let U of $)I(U);else I($)}P5.eachItem=FE;function z5({mergeNames:$,mergeToName:I,mergeValues:U,resultToName:D}){return(b,A,w,O)=>{let N=w===void 0?A:w instanceof B$.Name?(A instanceof B$.Name?$(b,A,w):I(b,A,w),w):A instanceof B$.Name?(I(b,w,A),A):U(A,w);return O===B$.Name&&!(N instanceof B$.Name)?D(b,N):N}}P5.mergeEvaluated={props:z5({mergeNames:($,I,U)=>$.if(B$._`${U} !== true && ${I} !== undefined`,()=>{$.if(B$._`${I} === true`,()=>$.assign(U,!0),()=>$.assign(U,B$._`${U} || {}`).code(B$._`Object.assign(${U}, ${I})`))}),mergeToName:($,I,U)=>$.if(B$._`${U} !== true`,()=>{if(I===!0)$.assign(U,!0);else $.assign(U,B$._`${U} || {}`),y9($,U,I)}),mergeValues:($,I)=>$===!0?!0:{...$,...I},resultToName:S5}),items:z5({mergeNames:($,I,U)=>$.if(B$._`${U} !== true && ${I} !== undefined`,()=>$.assign(U,B$._`${I} === true ? true : ${U} > ${I} ? ${U} : ${I}`)),mergeToName:($,I,U)=>$.if(B$._`${U} !== true`,()=>$.assign(U,I===!0?!0:B$._`${U} > ${I} ? ${U} : ${I}`)),mergeValues:($,I)=>$===!0?!0:Math.max($,I),resultToName:($,I)=>$.var("items",I)})};function S5($,I){if(I===!0)return $.var("props",!0);let U=$.var("props",B$._`{}`);if(I!==void 0)y9($,U,I);return U}P5.evaluatedPropsToName=S5;function y9($,I,U){Object.keys(U).forEach((D)=>$.assign(B$._`${I}${B$.getProperty(D)}`,!0))}P5.setEvaluated=y9;var F5={};function kE($,I){return $.scopeValue("func",{ref:I,code:F5[I.code]||(F5[I.code]=new LE._Code(I.code))})}P5.useFunc=kE;var Z9;(function($){$[$.Num=0]="Num",$[$.Str=1]="Str"})(Z9||(P5.Type=Z9={}));function qE($,I,U){if($ instanceof B$.Name){let D=I===Z9.Num;return U?D?B$._`"[" + ${$} + "]"`:B$._`"['" + ${$} + "']"`:D?B$._`"/" + ${$}`:B$._`"/" + ${$}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return U?B$.getProperty($).toString():"/"+g9($)}P5.getErrorPath=qE;function j5($,I,U=$.opts.strictSchema){if(!U)return;if(I=`strict mode: ${I}`,U===!0)throw new Error(I);$.self.logger.warn(I)}P5.checkStrictMode=j5});var i6=T((T5)=>{Object.defineProperty(T5,"__esModule",{value:!0});var C$=d(),nE={data:new C$.Name("data"),valCxt:new C$.Name("valCxt"),instancePath:new C$.Name("instancePath"),parentData:new C$.Name("parentData"),parentDataProperty:new C$.Name("parentDataProperty"),rootData:new C$.Name("rootData"),dynamicAnchors:new C$.Name("dynamicAnchors"),vErrors:new C$.Name("vErrors"),errors:new C$.Name("errors"),this:new C$.Name("this"),self:new C$.Name("self"),scope:new C$.Name("scope"),json:new C$.Name("json"),jsonPos:new C$.Name("jsonPos"),jsonLen:new C$.Name("jsonLen"),jsonPart:new C$.Name("jsonPart")};T5.default=nE});var c1=T((Z5)=>{Object.defineProperty(Z5,"__esModule",{value:!0});Z5.extendErrors=Z5.resetErrorsCount=Z5.reportExtraError=Z5.reportError=Z5.keyword$DataError=Z5.keywordError=void 0;var b$=d(),CO=A$(),l$=i6();Z5.keywordError={message:({keyword:$})=>b$.str`must pass "${$}" keyword validation`};Z5.keyword$DataError={message:({keyword:$,schemaType:I})=>I?b$.str`"${$}" keyword must be ${I} ($data)`:b$.str`"${$}" keyword is invalid ($data)`};function cE($,I=Z5.keywordError,U,D){let{it:b}=$,{gen:A,compositeRule:w,allErrors:O}=b,N=f5($,I,U);if(D!==null&&D!==void 0?D:w||O)_5(A,N);else C5(b,b$._`[${N}]`)}Z5.reportError=cE;function mE($,I=Z5.keywordError,U){let{it:D}=$,{gen:b,compositeRule:A,allErrors:w}=D,O=f5($,I,U);if(_5(b,O),!(A||w))C5(D,l$.default.vErrors)}Z5.reportExtraError=mE;function oE($,I){$.assign(l$.default.errors,I),$.if(b$._`${l$.default.vErrors} !== null`,()=>$.if(I,()=>$.assign(b$._`${l$.default.vErrors}.length`,I),()=>$.assign(l$.default.vErrors,null)))}Z5.resetErrorsCount=oE;function dE({gen:$,keyword:I,schemaValue:U,data:D,errsCount:b,it:A}){if(b===void 0)throw new Error("ajv implementation error");let w=$.name("err");$.forRange("i",b,l$.default.errors,(O)=>{if($.const(w,b$._`${l$.default.vErrors}[${O}]`),$.if(b$._`${w}.instancePath === undefined`,()=>$.assign(b$._`${w}.instancePath`,b$.strConcat(l$.default.instancePath,A.errorPath))),$.assign(b$._`${w}.schemaPath`,b$.str`${A.errSchemaPath}/${I}`),A.opts.verbose)$.assign(b$._`${w}.schema`,U),$.assign(b$._`${w}.data`,D)})}Z5.extendErrors=dE;function _5($,I){let U=$.const("err",I);$.if(b$._`${l$.default.vErrors} === null`,()=>$.assign(l$.default.vErrors,b$._`[${U}]`),b$._`${l$.default.vErrors}.push(${U})`),$.code(b$._`${l$.default.errors}++`)}function C5($,I){let{gen:U,validateName:D,schemaEnv:b}=$;if(b.$async)U.throw(b$._`new ${$.ValidationError}(${I})`);else U.assign(b$._`${D}.errors`,I),U.return(!1)}var n4={keyword:new b$.Name("keyword"),schemaPath:new b$.Name("schemaPath"),params:new b$.Name("params"),propertyName:new b$.Name("propertyName"),message:new b$.Name("message"),schema:new b$.Name("schema"),parentSchema:new b$.Name("parentSchema")};function f5($,I,U){let{createErrors:D}=$.it;if(D===!1)return b$._`{}`;return pE($,I,U)}function pE($,I,U={}){let{gen:D,it:b}=$,A=[tE(b,U),aE($,U)];return eE($,I,A),D.object(...A)}function tE({errorPath:$},{instancePath:I}){let U=I?b$.str`${$}${CO.getErrorPath(I,CO.Type.Str)}`:$;return[l$.default.instancePath,b$.strConcat(l$.default.instancePath,U)]}function aE({keyword:$,it:{errSchemaPath:I}},{schemaPath:U,parentSchema:D}){let b=D?I:b$.str`${I}/${$}`;if(U)b=b$.str`${b}${CO.getErrorPath(U,CO.Type.Str)}`;return[n4.schemaPath,b]}function eE($,{params:I,message:U},D){let{keyword:b,data:A,schemaValue:w,it:O}=$,{opts:N,propertyName:X,topSchemaRef:G,schemaPath:Q}=O;if(D.push([n4.keyword,b],[n4.params,typeof I=="function"?I($):I||b$._`{}`]),N.messages)D.push([n4.message,typeof U=="function"?U($):U]);if(N.verbose)D.push([n4.schema,w],[n4.parentSchema,b$._`${G}${Q}`],[l$.default.data,A]);if(X)D.push([n4.propertyName,X])}});var h5=T((x5)=>{Object.defineProperty(x5,"__esModule",{value:!0});x5.boolOrEmptySchema=x5.topBoolOrEmptySchema=void 0;var bS=c1(),DS=d(),AS=i6(),wS={message:"boolean schema is false"};function OS($){let{gen:I,schema:U,validateName:D}=$;if(U===!1)y5($,!1);else if(typeof U=="object"&&U.$async===!0)I.return(AS.default.data);else I.assign(DS._`${D}.errors`,null),I.return(!0)}x5.topBoolOrEmptySchema=OS;function NS($,I){let{gen:U,schema:D}=$;if(D===!1)U.var(I,!1),y5($);else U.var(I,!0)}x5.boolOrEmptySchema=NS;function y5($,I){let{gen:U,data:D}=$,b={gen:U,keyword:"false schema",data:D,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:$};bS.reportError(b,wS,void 0,I)}});var l9=T((u5)=>{Object.defineProperty(u5,"__esModule",{value:!0});u5.getRules=u5.isJSONType=void 0;var WS=["string","number","integer","boolean","null","object","array"],GS=new Set(WS);function QS($){return typeof $=="string"&&GS.has($)}u5.isJSONType=QS;function YS(){let $={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...$,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},$.number,$.string,$.array,$.object],post:{rules:[]},all:{},keywords:{}}}u5.getRules=YS});var h9=T((c5)=>{Object.defineProperty(c5,"__esModule",{value:!0});c5.shouldUseRule=c5.shouldUseGroup=c5.schemaHasRulesForType=void 0;function BS({schema:$,self:I},U){let D=I.RULES.types[U];return D&&D!==!0&&n5($,D)}c5.schemaHasRulesForType=BS;function n5($,I){return I.rules.some((U)=>r5($,U))}c5.shouldUseGroup=n5;function r5($,I){var U;return $[I.keyword]!==void 0||((U=I.definition.implements)===null||U===void 0?void 0:U.some((D)=>$[D]!==void 0))}c5.shouldUseRule=r5});var m1=T((t5)=>{Object.defineProperty(t5,"__esModule",{value:!0});t5.reportTypeError=t5.checkDataTypes=t5.checkDataType=t5.coerceAndCheckDataType=t5.getJSONTypes=t5.getSchemaTypes=t5.DataType=void 0;var HS=l9(),MS=h9(),VS=c1(),o=d(),o5=A$(),dI;(function($){$[$.Correct=0]="Correct",$[$.Wrong=1]="Wrong"})(dI||(t5.DataType=dI={}));function KS($){let I=d5($.type);if(I.includes("null")){if($.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!I.length&&$.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');if($.nullable===!0)I.push("null")}return I}t5.getSchemaTypes=KS;function d5($){let I=Array.isArray($)?$:$?[$]:[];if(I.every(HS.isJSONType))return I;throw new Error("type must be JSONType or JSONType[]: "+I.join(","))}t5.getJSONTypes=d5;function zS($,I){let{gen:U,data:D,opts:b}=$,A=FS(I,b.coerceTypes),w=I.length>0&&!(A.length===0&&I.length===1&&MS.schemaHasRulesForType($,I[0]));if(w){let O=i9(I,D,b.strictNumbers,dI.Wrong);U.if(O,()=>{if(A.length)kS($,I,A);else n9($)})}return w}t5.coerceAndCheckDataType=zS;var p5=new Set(["string","number","integer","boolean","null"]);function FS($,I){return I?$.filter((U)=>p5.has(U)||I==="array"&&U==="array"):[]}function kS($,I,U){let{gen:D,data:b,opts:A}=$,w=D.let("dataType",o._`typeof ${b}`),O=D.let("coerced",o._`undefined`);if(A.coerceTypes==="array")D.if(o._`${w} == 'object' && Array.isArray(${b}) && ${b}.length == 1`,()=>D.assign(b,o._`${b}[0]`).assign(w,o._`typeof ${b}`).if(i9(I,b,A.strictNumbers),()=>D.assign(O,b)));D.if(o._`${O} !== undefined`);for(let X of U)if(p5.has(X)||X==="array"&&A.coerceTypes==="array")N(X);D.else(),n9($),D.endIf(),D.if(o._`${O} !== undefined`,()=>{D.assign(b,O),qS($,O)});function N(X){switch(X){case"string":D.elseIf(o._`${w} == "number" || ${w} == "boolean"`).assign(O,o._`"" + ${b}`).elseIf(o._`${b} === null`).assign(O,o._`""`);return;case"number":D.elseIf(o._`${w} == "boolean" || ${b} === null
|
|
4
|
+
|| (${w} == "string" && ${b} && ${b} == +${b})`).assign(O,o._`+${b}`);return;case"integer":D.elseIf(o._`${w} === "boolean" || ${b} === null
|
|
5
|
+
|| (${w} === "string" && ${b} && ${b} == +${b} && !(${b} % 1))`).assign(O,o._`+${b}`);return;case"boolean":D.elseIf(o._`${b} === "false" || ${b} === 0 || ${b} === null`).assign(O,!1).elseIf(o._`${b} === "true" || ${b} === 1`).assign(O,!0);return;case"null":D.elseIf(o._`${b} === "" || ${b} === 0 || ${b} === false`),D.assign(O,null);return;case"array":D.elseIf(o._`${w} === "string" || ${w} === "number"
|
|
6
|
+
|| ${w} === "boolean" || ${b} === null`).assign(O,o._`[${b}]`)}}}function qS({gen:$,parentData:I,parentDataProperty:U},D){$.if(o._`${I} !== undefined`,()=>$.assign(o._`${I}[${U}]`,D))}function u9($,I,U,D=dI.Correct){let b=D===dI.Correct?o.operators.EQ:o.operators.NEQ,A;switch($){case"null":return o._`${I} ${b} null`;case"array":A=o._`Array.isArray(${I})`;break;case"object":A=o._`${I} && typeof ${I} == "object" && !Array.isArray(${I})`;break;case"integer":A=w(o._`!(${I} % 1) && !isNaN(${I})`);break;case"number":A=w();break;default:return o._`typeof ${I} ${b} ${$}`}return D===dI.Correct?A:o.not(A);function w(O=o.nil){return o.and(o._`typeof ${I} == "number"`,O,U?o._`isFinite(${I})`:o.nil)}}t5.checkDataType=u9;function i9($,I,U,D){if($.length===1)return u9($[0],I,U,D);let b,A=o5.toHash($);if(A.array&&A.object){let w=o._`typeof ${I} != "object"`;b=A.null?w:o._`!${I} || ${w}`,delete A.null,delete A.array,delete A.object}else b=o.nil;if(A.number)delete A.integer;for(let w in A)b=o.and(b,u9(w,I,U,D));return b}t5.checkDataTypes=i9;var ES={message:({schema:$})=>`must be ${$}`,params:({schema:$,schemaValue:I})=>typeof $=="string"?o._`{type: ${$}}`:o._`{type: ${I}}`};function n9($){let I=SS($);VS.reportError(I,ES)}t5.reportTypeError=n9;function SS($){let{gen:I,data:U,schema:D}=$,b=o5.schemaRefOrVal($,D,"type");return{gen:I,keyword:"type",data:U,schema:D.type,schemaCode:b,schemaValue:b,parentSchema:D,params:{},it:$}}});var IL=T((s5)=>{Object.defineProperty(s5,"__esModule",{value:!0});s5.assignDefaults=void 0;var pI=d(),fS=A$();function ZS($,I){let{properties:U,items:D}=$.schema;if(I==="object"&&U)for(let b in U)e5($,b,U[b].default);else if(I==="array"&&Array.isArray(D))D.forEach((b,A)=>e5($,A,b.default))}s5.assignDefaults=ZS;function e5($,I,U){let{gen:D,compositeRule:b,data:A,opts:w}=$;if(U===void 0)return;let O=pI._`${A}${pI.getProperty(I)}`;if(b){fS.checkStrictMode($,`default is ignored for: ${O}`);return}let N=pI._`${O} === undefined`;if(w.useDefaults==="empty")N=pI._`${N} || ${O} === null || ${O} === ""`;D.if(N,pI._`${O} = ${pI.stringify(U)}`)}});var b6=T((DL)=>{Object.defineProperty(DL,"__esModule",{value:!0});DL.validateUnion=DL.validateArray=DL.usePattern=DL.callValidateCode=DL.schemaProperties=DL.allSchemaProperties=DL.noPropertyInData=DL.propertyInData=DL.isOwnProperty=DL.hasPropFunc=DL.reportMissingProp=DL.checkMissingProp=DL.checkReportMissingProp=void 0;var L$=d(),r9=A$(),H4=i6(),gS=A$();function yS($,I){let{gen:U,data:D,it:b}=$;U.if(m9(U,D,I,b.opts.ownProperties),()=>{$.setParams({missingProperty:L$._`${I}`},!0),$.error()})}DL.checkReportMissingProp=yS;function xS({gen:$,data:I,it:{opts:U}},D,b){return L$.or(...D.map((A)=>L$.and(m9($,I,A,U.ownProperties),L$._`${b} = ${A}`)))}DL.checkMissingProp=xS;function lS($,I){$.setParams({missingProperty:I},!0),$.error()}DL.reportMissingProp=lS;function UL($){return $.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:L$._`Object.prototype.hasOwnProperty`})}DL.hasPropFunc=UL;function c9($,I,U){return L$._`${UL($)}.call(${I}, ${U})`}DL.isOwnProperty=c9;function hS($,I,U,D){let b=L$._`${I}${L$.getProperty(U)} !== undefined`;return D?L$._`${b} && ${c9($,I,U)}`:b}DL.propertyInData=hS;function m9($,I,U,D){let b=L$._`${I}${L$.getProperty(U)} === undefined`;return D?L$.or(b,L$.not(c9($,I,U))):b}DL.noPropertyInData=m9;function bL($){return $?Object.keys($).filter((I)=>I!=="__proto__"):[]}DL.allSchemaProperties=bL;function uS($,I){return bL(I).filter((U)=>!r9.alwaysValidSchema($,I[U]))}DL.schemaProperties=uS;function iS({schemaCode:$,data:I,it:{gen:U,topSchemaRef:D,schemaPath:b,errorPath:A},it:w},O,N,X){let G=X?L$._`${$}, ${I}, ${D}${b}`:I,Q=[[H4.default.instancePath,L$.strConcat(H4.default.instancePath,A)],[H4.default.parentData,w.parentData],[H4.default.parentDataProperty,w.parentDataProperty],[H4.default.rootData,H4.default.rootData]];if(w.opts.dynamicRef)Q.push([H4.default.dynamicAnchors,H4.default.dynamicAnchors]);let Y=L$._`${G}, ${U.object(...Q)}`;return N!==L$.nil?L$._`${O}.call(${N}, ${Y})`:L$._`${O}(${Y})`}DL.callValidateCode=iS;var nS=L$._`new RegExp`;function rS({gen:$,it:{opts:I}},U){let D=I.unicodeRegExp?"u":"",{regExp:b}=I.code,A=b(U,D);return $.scopeValue("pattern",{key:A.toString(),ref:A,code:L$._`${b.code==="new RegExp"?nS:gS.useFunc($,b)}(${U}, ${D})`})}DL.usePattern=rS;function cS($){let{gen:I,data:U,keyword:D,it:b}=$,A=I.name("valid");if(b.allErrors){let O=I.let("valid",!0);return w(()=>I.assign(O,!1)),O}return I.var(A,!0),w(()=>I.break()),A;function w(O){let N=I.const("len",L$._`${U}.length`);I.forRange("i",0,N,(X)=>{$.subschema({keyword:D,dataProp:X,dataPropType:r9.Type.Num},A),I.if(L$.not(A),O)})}}DL.validateArray=cS;function mS($){let{gen:I,schema:U,keyword:D,it:b}=$;if(!Array.isArray(U))throw new Error("ajv implementation error");if(U.some((N)=>r9.alwaysValidSchema(b,N))&&!b.opts.unevaluated)return;let w=I.let("valid",!1),O=I.name("_valid");I.block(()=>U.forEach((N,X)=>{let G=$.subschema({keyword:D,schemaProp:X,compositeRule:!0},O);if(I.assign(w,L$._`${w} || ${O}`),!$.mergeValidEvaluated(G,O))I.if(L$.not(w))})),$.result(w,()=>$.reset(),()=>$.error(!0))}DL.validateUnion=mS});var WL=T((NL)=>{Object.defineProperty(NL,"__esModule",{value:!0});NL.validateKeywordUsage=NL.validSchemaType=NL.funcKeywordCode=NL.macroKeywordCode=void 0;var h$=d(),r4=i6(),Aj=b6(),wj=c1();function Oj($,I){let{gen:U,keyword:D,schema:b,parentSchema:A,it:w}=$,O=I.macro.call(w.self,b,A,w),N=OL(U,D,O);if(w.opts.validateSchema!==!1)w.self.validateSchema(O,!0);let X=U.name("valid");$.subschema({schema:O,schemaPath:h$.nil,errSchemaPath:`${w.errSchemaPath}/${D}`,topSchemaRef:N,compositeRule:!0},X),$.pass(X,()=>$.error(!0))}NL.macroKeywordCode=Oj;function Nj($,I){var U;let{gen:D,keyword:b,schema:A,parentSchema:w,$data:O,it:N}=$;Wj(N,I);let X=!O&&I.compile?I.compile.call(N.self,A,w,N):I.validate,G=OL(D,b,X),Q=D.let("valid");$.block$data(Q,Y),$.ok((U=I.valid)!==null&&U!==void 0?U:Q);function Y(){if(I.errors===!1){if(H(),I.modifying)wL($);z(()=>$.error())}else{let q=I.async?v():L();if(I.modifying)wL($);z(()=>Xj($,q))}}function v(){let q=D.let("ruleErrs",null);return D.try(()=>H(h$._`await `),(g)=>D.assign(Q,!1).if(h$._`${g} instanceof ${N.ValidationError}`,()=>D.assign(q,h$._`${g}.errors`),()=>D.throw(g))),q}function L(){let q=h$._`${G}.errors`;return D.assign(q,null),H(h$.nil),q}function H(q=I.async?h$._`await `:h$.nil){let g=N.opts.passContext?r4.default.this:r4.default.self,x=!(("compile"in I)&&!O||I.schema===!1);D.assign(Q,h$._`${q}${Aj.callValidateCode($,G,g,x)}`,I.modifying)}function z(q){var g;D.if(h$.not((g=I.valid)!==null&&g!==void 0?g:Q),q)}}NL.funcKeywordCode=Nj;function wL($){let{gen:I,data:U,it:D}=$;I.if(D.parentData,()=>I.assign(U,h$._`${D.parentData}[${D.parentDataProperty}]`))}function Xj($,I){let{gen:U}=$;U.if(h$._`Array.isArray(${I})`,()=>{U.assign(r4.default.vErrors,h$._`${r4.default.vErrors} === null ? ${I} : ${r4.default.vErrors}.concat(${I})`).assign(r4.default.errors,h$._`${r4.default.vErrors}.length`),wj.extendErrors($)},()=>$.error())}function Wj({schemaEnv:$},I){if(I.async&&!$.$async)throw new Error("async keyword in sync schema")}function OL($,I,U){if(U===void 0)throw new Error(`keyword "${I}" failed to compile`);return $.scopeValue("keyword",typeof U=="function"?{ref:U}:{ref:U,code:h$.stringify(U)})}function Gj($,I,U=!1){return!I.length||I.some((D)=>D==="array"?Array.isArray($):D==="object"?$&&typeof $=="object"&&!Array.isArray($):typeof $==D||U&&typeof $=="undefined")}NL.validSchemaType=Gj;function Qj({schema:$,opts:I,self:U,errSchemaPath:D},b,A){if(Array.isArray(b.keyword)?!b.keyword.includes(A):b.keyword!==A)throw new Error("ajv implementation error");let w=b.dependencies;if(w===null||w===void 0?void 0:w.some((O)=>!Object.prototype.hasOwnProperty.call($,O)))throw new Error(`parent schema must have dependencies of ${A}: ${w.join(",")}`);if(b.validateSchema){if(!b.validateSchema($[A])){let N=`keyword "${A}" value is invalid at path "${D}": `+U.errorsText(b.validateSchema.errors);if(I.validateSchema==="log")U.logger.error(N);else throw new Error(N)}}}NL.validateKeywordUsage=Qj});var vL=T((QL)=>{Object.defineProperty(QL,"__esModule",{value:!0});QL.extendSubschemaMode=QL.extendSubschemaData=QL.getSubschema=void 0;var S6=d(),GL=A$();function Lj($,{keyword:I,schemaProp:U,schema:D,schemaPath:b,errSchemaPath:A,topSchemaRef:w}){if(I!==void 0&&D!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(I!==void 0){let O=$.schema[I];return U===void 0?{schema:O,schemaPath:S6._`${$.schemaPath}${S6.getProperty(I)}`,errSchemaPath:`${$.errSchemaPath}/${I}`}:{schema:O[U],schemaPath:S6._`${$.schemaPath}${S6.getProperty(I)}${S6.getProperty(U)}`,errSchemaPath:`${$.errSchemaPath}/${I}/${GL.escapeFragment(U)}`}}if(D!==void 0){if(b===void 0||A===void 0||w===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:D,schemaPath:b,topSchemaRef:w,errSchemaPath:A}}throw new Error('either "keyword" or "schema" must be passed')}QL.getSubschema=Lj;function Jj($,I,{dataProp:U,dataPropType:D,data:b,dataTypes:A,propertyName:w}){if(b!==void 0&&U!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:O}=I;if(U!==void 0){let{errorPath:X,dataPathArr:G,opts:Q}=I,Y=O.let("data",S6._`${I.data}${S6.getProperty(U)}`,!0);N(Y),$.errorPath=S6.str`${X}${GL.getErrorPath(U,D,Q.jsPropertySyntax)}`,$.parentDataProperty=S6._`${U}`,$.dataPathArr=[...G,$.parentDataProperty]}if(b!==void 0){let X=b instanceof S6.Name?b:O.let("data",b,!0);if(N(X),w!==void 0)$.propertyName=w}if(A)$.dataTypes=A;function N(X){$.data=X,$.dataLevel=I.dataLevel+1,$.dataTypes=[],I.definedProperties=new Set,$.parentData=I.data,$.dataNames=[...I.dataNames,X]}}QL.extendSubschemaData=Jj;function Hj($,{jtdDiscriminator:I,jtdMetadata:U,compositeRule:D,createErrors:b,allErrors:A}){if(D!==void 0)$.compositeRule=D;if(b!==void 0)$.createErrors=b;if(A!==void 0)$.allErrors=A;$.jtdDiscriminator=I,$.jtdMetadata=U}QL.extendSubschemaMode=Hj});var o9=T((ni,BL)=>{BL.exports=function $(I,U){if(I===U)return!0;if(I&&U&&typeof I=="object"&&typeof U=="object"){if(I.constructor!==U.constructor)return!1;var D,b,A;if(Array.isArray(I)){if(D=I.length,D!=U.length)return!1;for(b=D;b--!==0;)if(!$(I[b],U[b]))return!1;return!0}if(I.constructor===RegExp)return I.source===U.source&&I.flags===U.flags;if(I.valueOf!==Object.prototype.valueOf)return I.valueOf()===U.valueOf();if(I.toString!==Object.prototype.toString)return I.toString()===U.toString();if(A=Object.keys(I),D=A.length,D!==Object.keys(U).length)return!1;for(b=D;b--!==0;)if(!Object.prototype.hasOwnProperty.call(U,A[b]))return!1;for(b=D;b--!==0;){var w=A[b];if(!$(I[w],U[w]))return!1}return!0}return I!==I&&U!==U}});var JL=T((ri,LL)=>{var M4=LL.exports=function($,I,U){if(typeof I=="function")U=I,I={};U=I.cb||U;var D=typeof U=="function"?U:U.pre||function(){},b=U.post||function(){};fO(I,D,b,$,"",$)};M4.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};M4.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};M4.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};M4.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function fO($,I,U,D,b,A,w,O,N,X){if(D&&typeof D=="object"&&!Array.isArray(D)){I(D,b,A,w,O,N,X);for(var G in D){var Q=D[G];if(Array.isArray(Q)){if(G in M4.arrayKeywords)for(var Y=0;Y<Q.length;Y++)fO($,I,U,Q[Y],b+"/"+G+"/"+Y,A,b,G,D,Y)}else if(G in M4.propsKeywords){if(Q&&typeof Q=="object")for(var v in Q)fO($,I,U,Q[v],b+"/"+G+"/"+Kj(v),A,b,G,D,v)}else if(G in M4.keywords||$.allKeys&&!(G in M4.skipKeywords))fO($,I,U,Q,b+"/"+G,A,b,G,D)}U(D,b,A,w,O,N,X)}}function Kj($){return $.replace(/~/g,"~0").replace(/\//g,"~1")}});var o1=T((KL)=>{Object.defineProperty(KL,"__esModule",{value:!0});KL.getSchemaRefs=KL.resolveUrl=KL.normalizeId=KL._getFullPath=KL.getFullPath=KL.inlineRef=void 0;var zj=A$(),Fj=o9(),kj=JL(),qj=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function Ej($,I=!0){if(typeof $=="boolean")return!0;if(I===!0)return!d9($);if(!I)return!1;return HL($)<=I}KL.inlineRef=Ej;var Sj=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function d9($){for(let I in $){if(Sj.has(I))return!0;let U=$[I];if(Array.isArray(U)&&U.some(d9))return!0;if(typeof U=="object"&&d9(U))return!0}return!1}function HL($){let I=0;for(let U in $){if(U==="$ref")return 1/0;if(I++,qj.has(U))continue;if(typeof $[U]=="object")zj.eachItem($[U],(D)=>I+=HL(D));if(I===1/0)return 1/0}return I}function ML($,I="",U){if(U!==!1)I=tI(I);let D=$.parse(I);return VL($,D)}KL.getFullPath=ML;function VL($,I){return $.serialize(I).split("#")[0]+"#"}KL._getFullPath=VL;var jj=/#\/?$/;function tI($){return $?$.replace(jj,""):""}KL.normalizeId=tI;function Pj($,I,U){return U=tI(U),$.resolve(I,U)}KL.resolveUrl=Pj;var Rj=/^[a-z_][-a-z0-9._]*$/i;function Tj($,I){if(typeof $=="boolean")return{};let{schemaId:U,uriResolver:D}=this.opts,b=tI($[U]||I),A={"":b},w=ML(D,b,!1),O={},N=new Set;return kj($,{allKeys:!0},(Q,Y,v,L)=>{if(L===void 0)return;let H=w+Y,z=A[L];if(typeof Q[U]=="string")z=q.call(this,Q[U]);g.call(this,Q.$anchor),g.call(this,Q.$dynamicAnchor),A[Y]=z;function q(x){let a=this.opts.uriResolver.resolve;if(x=tI(z?a(z,x):x),N.has(x))throw G(x);N.add(x);let h=this.refs[x];if(typeof h=="string")h=this.refs[h];if(typeof h=="object")X(Q,h.schema,x);else if(x!==tI(H))if(x[0]==="#")X(Q,O[x],x),O[x]=Q;else this.refs[x]=H;return x}function g(x){if(typeof x=="string"){if(!Rj.test(x))throw new Error(`invalid anchor "${x}"`);q.call(this,`#${x}`)}}}),O;function X(Q,Y,v){if(Y!==void 0&&!Fj(Q,Y))throw G(v)}function G(Q){return new Error(`reference "${Q}" resolves to more than one schema`)}}KL.getSchemaRefs=Tj});var t1=T((yL)=>{Object.defineProperty(yL,"__esModule",{value:!0});yL.getData=yL.KeywordCxt=yL.validateFunctionCode=void 0;var SL=h5(),FL=m1(),t9=h9(),ZO=m1(),yj=IL(),p1=WL(),p9=vL(),y=d(),r=i6(),xj=o1(),n6=A$(),d1=c1();function lj($){if(RL($)){if(TL($),PL($)){ij($);return}}jL($,()=>SL.topBoolOrEmptySchema($))}yL.validateFunctionCode=lj;function jL({gen:$,validateName:I,schema:U,schemaEnv:D,opts:b},A){if(b.code.es5)$.func(I,y._`${r.default.data}, ${r.default.valCxt}`,D.$async,()=>{$.code(y._`"use strict"; ${kL(U,b)}`),uj($,b),$.code(A)});else $.func(I,y._`${r.default.data}, ${hj(b)}`,D.$async,()=>$.code(kL(U,b)).code(A))}function hj($){return y._`{${r.default.instancePath}="", ${r.default.parentData}, ${r.default.parentDataProperty}, ${r.default.rootData}=${r.default.data}${$.dynamicRef?y._`, ${r.default.dynamicAnchors}={}`:y.nil}}={}`}function uj($,I){$.if(r.default.valCxt,()=>{if($.var(r.default.instancePath,y._`${r.default.valCxt}.${r.default.instancePath}`),$.var(r.default.parentData,y._`${r.default.valCxt}.${r.default.parentData}`),$.var(r.default.parentDataProperty,y._`${r.default.valCxt}.${r.default.parentDataProperty}`),$.var(r.default.rootData,y._`${r.default.valCxt}.${r.default.rootData}`),I.dynamicRef)$.var(r.default.dynamicAnchors,y._`${r.default.valCxt}.${r.default.dynamicAnchors}`)},()=>{if($.var(r.default.instancePath,y._`""`),$.var(r.default.parentData,y._`undefined`),$.var(r.default.parentDataProperty,y._`undefined`),$.var(r.default.rootData,r.default.data),I.dynamicRef)$.var(r.default.dynamicAnchors,y._`{}`)})}function ij($){let{schema:I,opts:U,gen:D}=$;jL($,()=>{if(U.$comment&&I.$comment)CL($);if(oj($),D.let(r.default.vErrors,null),D.let(r.default.errors,0),U.unevaluated)nj($);_L($),tj($)});return}function nj($){let{gen:I,validateName:U}=$;$.evaluated=I.const("evaluated",y._`${U}.evaluated`),I.if(y._`${$.evaluated}.dynamicProps`,()=>I.assign(y._`${$.evaluated}.props`,y._`undefined`)),I.if(y._`${$.evaluated}.dynamicItems`,()=>I.assign(y._`${$.evaluated}.items`,y._`undefined`))}function kL($,I){let U=typeof $=="object"&&$[I.schemaId];return U&&(I.code.source||I.code.process)?y._`/*# sourceURL=${U} */`:y.nil}function rj($,I){if(RL($)){if(TL($),PL($)){cj($,I);return}}SL.boolOrEmptySchema($,I)}function PL({schema:$,self:I}){if(typeof $=="boolean")return!$;for(let U in $)if(I.RULES.all[U])return!0;return!1}function RL($){return typeof $.schema!="boolean"}function cj($,I){let{schema:U,gen:D,opts:b}=$;if(b.$comment&&U.$comment)CL($);dj($),pj($);let A=D.const("_errs",r.default.errors);_L($,A),D.var(I,y._`${A} === ${r.default.errors}`)}function TL($){n6.checkUnknownRules($),mj($)}function _L($,I){if($.opts.jtd)return qL($,[],!1,I);let U=FL.getSchemaTypes($.schema),D=FL.coerceAndCheckDataType($,U);qL($,U,!D,I)}function mj($){let{schema:I,errSchemaPath:U,opts:D,self:b}=$;if(I.$ref&&D.ignoreKeywordsWithRef&&n6.schemaHasRulesButRef(I,b.RULES))b.logger.warn(`$ref: keywords ignored in schema at path "${U}"`)}function oj($){let{schema:I,opts:U}=$;if(I.default!==void 0&&U.useDefaults&&U.strictSchema)n6.checkStrictMode($,"default is ignored in the schema root")}function dj($){let I=$.schema[$.opts.schemaId];if(I)$.baseId=xj.resolveUrl($.opts.uriResolver,$.baseId,I)}function pj($){if($.schema.$async&&!$.schemaEnv.$async)throw new Error("async schema in sync schema")}function CL({gen:$,schemaEnv:I,schema:U,errSchemaPath:D,opts:b}){let A=U.$comment;if(b.$comment===!0)$.code(y._`${r.default.self}.logger.log(${A})`);else if(typeof b.$comment=="function"){let w=y.str`${D}/$comment`,O=$.scopeValue("root",{ref:I.root});$.code(y._`${r.default.self}.opts.$comment(${A}, ${w}, ${O}.schema)`)}}function tj($){let{gen:I,schemaEnv:U,validateName:D,ValidationError:b,opts:A}=$;if(U.$async)I.if(y._`${r.default.errors} === 0`,()=>I.return(r.default.data),()=>I.throw(y._`new ${b}(${r.default.vErrors})`));else{if(I.assign(y._`${D}.errors`,r.default.vErrors),A.unevaluated)aj($);I.return(y._`${r.default.errors} === 0`)}}function aj({gen:$,evaluated:I,props:U,items:D}){if(U instanceof y.Name)$.assign(y._`${I}.props`,U);if(D instanceof y.Name)$.assign(y._`${I}.items`,D)}function qL($,I,U,D){let{gen:b,schema:A,data:w,allErrors:O,opts:N,self:X}=$,{RULES:G}=X;if(A.$ref&&(N.ignoreKeywordsWithRef||!n6.schemaHasRulesButRef(A,G))){b.block(()=>ZL($,"$ref",G.all.$ref.definition));return}if(!N.jtd)ej($,I);b.block(()=>{for(let Y of G.rules)Q(Y);Q(G.post)});function Q(Y){if(!t9.shouldUseGroup(A,Y))return;if(Y.type){if(b.if(ZO.checkDataType(Y.type,w,N.strictNumbers)),EL($,Y),I.length===1&&I[0]===Y.type&&U)b.else(),ZO.reportTypeError($);b.endIf()}else EL($,Y);if(!O)b.if(y._`${r.default.errors} === ${D||0}`)}}function EL($,I){let{gen:U,schema:D,opts:{useDefaults:b}}=$;if(b)yj.assignDefaults($,I.type);U.block(()=>{for(let A of I.rules)if(t9.shouldUseRule(D,A))ZL($,A.keyword,A.definition,I.type)})}function ej($,I){if($.schemaEnv.meta||!$.opts.strictTypes)return;if(sj($,I),!$.opts.allowUnionTypes)$P($,I);IP($,$.dataTypes)}function sj($,I){if(!I.length)return;if(!$.dataTypes.length){$.dataTypes=I;return}I.forEach((U)=>{if(!fL($.dataTypes,U))a9($,`type "${U}" not allowed by context "${$.dataTypes.join(",")}"`)}),bP($,I)}function $P($,I){if(I.length>1&&!(I.length===2&&I.includes("null")))a9($,"use allowUnionTypes to allow union type keyword")}function IP($,I){let U=$.self.RULES.all;for(let D in U){let b=U[D];if(typeof b=="object"&&t9.shouldUseRule($.schema,b)){let{type:A}=b.definition;if(A.length&&!A.some((w)=>UP(I,w)))a9($,`missing type "${A.join(",")}" for keyword "${D}"`)}}}function UP($,I){return $.includes(I)||I==="number"&&$.includes("integer")}function fL($,I){return $.includes(I)||I==="integer"&&$.includes("number")}function bP($,I){let U=[];for(let D of $.dataTypes)if(fL(I,D))U.push(D);else if(I.includes("integer")&&D==="number")U.push("integer");$.dataTypes=U}function a9($,I){let U=$.schemaEnv.baseId+$.errSchemaPath;I+=` at "${U}" (strictTypes)`,n6.checkStrictMode($,I,$.opts.strictTypes)}class e9{constructor($,I,U){if(p1.validateKeywordUsage($,I,U),this.gen=$.gen,this.allErrors=$.allErrors,this.keyword=U,this.data=$.data,this.schema=$.schema[U],this.$data=I.$data&&$.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=n6.schemaRefOrVal($,this.schema,U,this.$data),this.schemaType=I.schemaType,this.parentSchema=$.schema,this.params={},this.it=$,this.def=I,this.$data)this.schemaCode=$.gen.const("vSchema",gL(this.$data,$));else if(this.schemaCode=this.schemaValue,!p1.validSchemaType(this.schema,I.schemaType,I.allowUndefined))throw new Error(`${U} value must be ${JSON.stringify(I.schemaType)}`);if("code"in I?I.trackErrors:I.errors!==!1)this.errsCount=$.gen.const("_errs",r.default.errors)}result($,I,U){this.failResult(y.not($),I,U)}failResult($,I,U){if(this.gen.if($),U)U();else this.error();if(I){if(this.gen.else(),I(),this.allErrors)this.gen.endIf()}else if(this.allErrors)this.gen.endIf();else this.gen.else()}pass($,I){this.failResult(y.not($),void 0,I)}fail($){if($===void 0){if(this.error(),!this.allErrors)this.gen.if(!1);return}if(this.gen.if($),this.error(),this.allErrors)this.gen.endIf();else this.gen.else()}fail$data($){if(!this.$data)return this.fail($);let{schemaCode:I}=this;this.fail(y._`${I} !== undefined && (${y.or(this.invalid$data(),$)})`)}error($,I,U){if(I){this.setParams(I),this._error($,U),this.setParams({});return}this._error($,U)}_error($,I){($?d1.reportExtraError:d1.reportError)(this,this.def.error,I)}$dataError(){d1.reportError(this,this.def.$dataError||d1.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');d1.resetErrorsCount(this.gen,this.errsCount)}ok($){if(!this.allErrors)this.gen.if($)}setParams($,I){if(I)Object.assign(this.params,$);else this.params=$}block$data($,I,U=y.nil){this.gen.block(()=>{this.check$data($,U),I()})}check$data($=y.nil,I=y.nil){if(!this.$data)return;let{gen:U,schemaCode:D,schemaType:b,def:A}=this;if(U.if(y.or(y._`${D} === undefined`,I)),$!==y.nil)U.assign($,!0);if(b.length||A.validateSchema){if(U.elseIf(this.invalid$data()),this.$dataError(),$!==y.nil)U.assign($,!1)}U.else()}invalid$data(){let{gen:$,schemaCode:I,schemaType:U,def:D,it:b}=this;return y.or(A(),w());function A(){if(U.length){if(!(I instanceof y.Name))throw new Error("ajv implementation error");let O=Array.isArray(U)?U:[U];return y._`${ZO.checkDataTypes(O,I,b.opts.strictNumbers,ZO.DataType.Wrong)}`}return y.nil}function w(){if(D.validateSchema){let O=$.scopeValue("validate$data",{ref:D.validateSchema});return y._`!${O}(${I})`}return y.nil}}subschema($,I){let U=p9.getSubschema(this.it,$);p9.extendSubschemaData(U,this.it,$),p9.extendSubschemaMode(U,$);let D={...this.it,...U,items:void 0,props:void 0};return rj(D,I),D}mergeEvaluated($,I){let{it:U,gen:D}=this;if(!U.opts.unevaluated)return;if(U.props!==!0&&$.props!==void 0)U.props=n6.mergeEvaluated.props(D,$.props,U.props,I);if(U.items!==!0&&$.items!==void 0)U.items=n6.mergeEvaluated.items(D,$.items,U.items,I)}mergeValidEvaluated($,I){let{it:U,gen:D}=this;if(U.opts.unevaluated&&(U.props!==!0||U.items!==!0))return D.if(I,()=>this.mergeEvaluated($,y.Name)),!0}}yL.KeywordCxt=e9;function ZL($,I,U,D){let b=new e9($,U,I);if("code"in U)U.code(b,D);else if(b.$data&&U.validate)p1.funcKeywordCode(b,U);else if("macro"in U)p1.macroKeywordCode(b,U);else if(U.compile||U.validate)p1.funcKeywordCode(b,U)}var DP=/^\/(?:[^~]|~0|~1)*$/,AP=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function gL($,{dataLevel:I,dataNames:U,dataPathArr:D}){let b,A;if($==="")return r.default.rootData;if($[0]==="/"){if(!DP.test($))throw new Error(`Invalid JSON-pointer: ${$}`);b=$,A=r.default.rootData}else{let X=AP.exec($);if(!X)throw new Error(`Invalid JSON-pointer: ${$}`);let G=+X[1];if(b=X[2],b==="#"){if(G>=I)throw new Error(N("property/index",G));return D[I-G]}if(G>I)throw new Error(N("data",G));if(A=U[I-G],!b)return A}let w=A,O=b.split("/");for(let X of O)if(X)A=y._`${A}${y.getProperty(n6.unescapeJsonPointer(X))}`,w=y._`${w} && ${A}`;return w;function N(X,G){return`Cannot access ${X} ${G} levels up, current level is ${I}`}}yL.getData=gL});var gO=T((hL)=>{Object.defineProperty(hL,"__esModule",{value:!0});class lL extends Error{constructor($){super("validation failed");this.errors=$,this.ajv=this.validation=!0}}hL.default=lL});var a1=T((iL)=>{Object.defineProperty(iL,"__esModule",{value:!0});var s9=o1();class uL extends Error{constructor($,I,U,D){super(D||`can't resolve reference ${U} from id ${I}`);this.missingRef=s9.resolveUrl($,I,U),this.missingSchema=s9.normalizeId(s9.getFullPath($,this.missingRef))}}iL.default=uL});var xO=T((cL)=>{Object.defineProperty(cL,"__esModule",{value:!0});cL.resolveSchema=cL.getCompilingSchema=cL.resolveRef=cL.compileSchema=cL.SchemaEnv=void 0;var Q6=d(),WP=gO(),c4=i6(),Y6=o1(),nL=A$(),GP=t1();class e1{constructor($){var I;this.refs={},this.dynamicAnchors={};let U;if(typeof $.schema=="object")U=$.schema;this.schema=$.schema,this.schemaId=$.schemaId,this.root=$.root||this,this.baseId=(I=$.baseId)!==null&&I!==void 0?I:Y6.normalizeId(U===null||U===void 0?void 0:U[$.schemaId||"$id"]),this.schemaPath=$.schemaPath,this.localRefs=$.localRefs,this.meta=$.meta,this.$async=U===null||U===void 0?void 0:U.$async,this.refs={}}}cL.SchemaEnv=e1;function I8($){let I=rL.call(this,$);if(I)return I;let U=Y6.getFullPath(this.opts.uriResolver,$.root.baseId),{es5:D,lines:b}=this.opts.code,{ownProperties:A}=this.opts,w=new Q6.CodeGen(this.scope,{es5:D,lines:b,ownProperties:A}),O;if($.$async)O=w.scopeValue("Error",{ref:WP.default,code:Q6._`require("ajv/dist/runtime/validation_error").default`});let N=w.scopeName("validate");$.validateName=N;let X={gen:w,allErrors:this.opts.allErrors,data:c4.default.data,parentData:c4.default.parentData,parentDataProperty:c4.default.parentDataProperty,dataNames:[c4.default.data],dataPathArr:[Q6.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:w.scopeValue("schema",this.opts.code.source===!0?{ref:$.schema,code:Q6.stringify($.schema)}:{ref:$.schema}),validateName:N,ValidationError:O,schema:$.schema,schemaEnv:$,rootId:U,baseId:$.baseId||U,schemaPath:Q6.nil,errSchemaPath:$.schemaPath||(this.opts.jtd?"":"#"),errorPath:Q6._`""`,opts:this.opts,self:this},G;try{this._compilations.add($),GP.validateFunctionCode(X),w.optimize(this.opts.code.optimize);let Q=w.toString();if(G=`${w.scopeRefs(c4.default.scope)}return ${Q}`,this.opts.code.process)G=this.opts.code.process(G,$);let v=new Function(`${c4.default.self}`,`${c4.default.scope}`,G)(this,this.scope.get());if(this.scope.value(N,{ref:v}),v.errors=null,v.schema=$.schema,v.schemaEnv=$,$.$async)v.$async=!0;if(this.opts.code.source===!0)v.source={validateName:N,validateCode:Q,scopeValues:w._values};if(this.opts.unevaluated){let{props:L,items:H}=X;if(v.evaluated={props:L instanceof Q6.Name?void 0:L,items:H instanceof Q6.Name?void 0:H,dynamicProps:L instanceof Q6.Name,dynamicItems:H instanceof Q6.Name},v.source)v.source.evaluated=Q6.stringify(v.evaluated)}return $.validate=v,$}catch(Q){if(delete $.validate,delete $.validateName,G)this.logger.error("Error compiling schema, function code:",G);throw Q}finally{this._compilations.delete($)}}cL.compileSchema=I8;function QP($,I,U){var D;U=Y6.resolveUrl(this.opts.uriResolver,I,U);let b=$.refs[U];if(b)return b;let A=BP.call(this,$,U);if(A===void 0){let w=(D=$.localRefs)===null||D===void 0?void 0:D[U],{schemaId:O}=this.opts;if(w)A=new e1({schema:w,schemaId:O,root:$,baseId:I})}if(A===void 0)return;return $.refs[U]=YP.call(this,A)}cL.resolveRef=QP;function YP($){if(Y6.inlineRef($.schema,this.opts.inlineRefs))return $.schema;return $.validate?$:I8.call(this,$)}function rL($){for(let I of this._compilations)if(vP(I,$))return I}cL.getCompilingSchema=rL;function vP($,I){return $.schema===I.schema&&$.root===I.root&&$.baseId===I.baseId}function BP($,I){let U;while(typeof(U=this.refs[I])=="string")I=U;return U||this.schemas[I]||yO.call(this,$,I)}function yO($,I){let U=this.opts.uriResolver.parse(I),D=Y6._getFullPath(this.opts.uriResolver,U),b=Y6.getFullPath(this.opts.uriResolver,$.baseId,void 0);if(Object.keys($.schema).length>0&&D===b)return $8.call(this,U,$);let A=Y6.normalizeId(D),w=this.refs[A]||this.schemas[A];if(typeof w=="string"){let O=yO.call(this,$,w);if(typeof(O===null||O===void 0?void 0:O.schema)!=="object")return;return $8.call(this,U,O)}if(typeof(w===null||w===void 0?void 0:w.schema)!=="object")return;if(!w.validate)I8.call(this,w);if(A===Y6.normalizeId(I)){let{schema:O}=w,{schemaId:N}=this.opts,X=O[N];if(X)b=Y6.resolveUrl(this.opts.uriResolver,b,X);return new e1({schema:O,schemaId:N,root:$,baseId:b})}return $8.call(this,U,w)}cL.resolveSchema=yO;var LP=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function $8($,{baseId:I,schema:U,root:D}){var b;if(((b=$.fragment)===null||b===void 0?void 0:b[0])!=="/")return;for(let O of $.fragment.slice(1).split("/")){if(typeof U==="boolean")return;let N=U[nL.unescapeFragment(O)];if(N===void 0)return;U=N;let X=typeof U==="object"&&U[this.opts.schemaId];if(!LP.has(O)&&X)I=Y6.resolveUrl(this.opts.uriResolver,I,X)}let A;if(typeof U!="boolean"&&U.$ref&&!nL.schemaHasRulesButRef(U,this.RULES)){let O=Y6.resolveUrl(this.opts.uriResolver,I,U.$ref);A=yO.call(this,D,O)}let{schemaId:w}=this.opts;if(A=A||new e1({schema:U,schemaId:w,root:D,baseId:I}),A.schema!==A.root.schema)return A;return}});var oL=T((ti,KP)=>{KP.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var b8=T((ai,aL)=>{var zP=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),pL=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 U8($){let I="",U=0,D=0;for(D=0;D<$.length;D++){if(U=$[D].charCodeAt(0),U===48)continue;if(!(U>=48&&U<=57||U>=65&&U<=70||U>=97&&U<=102))return"";I+=$[D];break}for(D+=1;D<$.length;D++){if(U=$[D].charCodeAt(0),!(U>=48&&U<=57||U>=65&&U<=70||U>=97&&U<=102))return"";I+=$[D]}return I}var FP=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function dL($){return $.length=0,!0}function kP($,I,U){if($.length){let D=U8($);if(D!=="")I.push(D);else return U.error=!0,!1;$.length=0}return!0}function qP($){let I=0,U={error:!1,address:"",zone:""},D=[],b=[],A=!1,w=!1,O=kP;for(let N=0;N<$.length;N++){let X=$[N];if(X==="["||X==="]")continue;if(X===":"){if(A===!0)w=!0;if(!O(b,D,U))break;if(++I>7){U.error=!0;break}if(N>0&&$[N-1]===":")A=!0;D.push(":");continue}else if(X==="%"){if(!O(b,D,U))break;O=dL}else{b.push(X);continue}}if(b.length)if(O===dL)U.zone=b.join("");else if(w)D.push(b.join(""));else D.push(U8(b));return U.address=D.join(""),U}function tL($){if(EP($,":")<2)return{host:$,isIPV6:!1};let I=qP($);if(!I.error){let{address:U,address:D}=I;if(I.zone)U+="%"+I.zone,D+="%25"+I.zone;return{host:U,isIPV6:!0,escapedHost:D}}else return{host:$,isIPV6:!1}}function EP($,I){let U=0;for(let D=0;D<$.length;D++)if($[D]===I)U++;return U}function SP($){let I=$,U=[],D=-1,b=0;while(b=I.length){if(b===1)if(I===".")break;else if(I==="/"){U.push("/");break}else{U.push(I);break}else if(b===2){if(I[0]==="."){if(I[1]===".")break;else if(I[1]==="/"){I=I.slice(2);continue}}else if(I[0]==="/"){if(I[1]==="."||I[1]==="/"){U.push("/");break}}}else if(b===3){if(I==="/.."){if(U.length!==0)U.pop();U.push("/");break}}if(I[0]==="."){if(I[1]==="."){if(I[2]==="/"){I=I.slice(3);continue}}else if(I[1]==="/"){I=I.slice(2);continue}}else if(I[0]==="/"){if(I[1]==="."){if(I[2]==="/"){I=I.slice(2);continue}else if(I[2]==="."){if(I[3]==="/"){if(I=I.slice(3),U.length!==0)U.pop();continue}}}}if((D=I.indexOf("/",1))===-1){U.push(I);break}else U.push(I.slice(0,D)),I=I.slice(D)}return U.join("")}function jP($,I){let U=I!==!0?escape:unescape;if($.scheme!==void 0)$.scheme=U($.scheme);if($.userinfo!==void 0)$.userinfo=U($.userinfo);if($.host!==void 0)$.host=U($.host);if($.path!==void 0)$.path=U($.path);if($.query!==void 0)$.query=U($.query);if($.fragment!==void 0)$.fragment=U($.fragment);return $}function PP($){let I=[];if($.userinfo!==void 0)I.push($.userinfo),I.push("@");if($.host!==void 0){let U=unescape($.host);if(!pL(U)){let D=tL(U);if(D.isIPV6===!0)U=`[${D.escapedHost}]`;else U=$.host}I.push(U)}if(typeof $.port==="number"||typeof $.port==="string")I.push(":"),I.push(String($.port));return I.length?I.join(""):void 0}aL.exports={nonSimpleDomain:FP,recomposeAuthority:PP,normalizeComponentEncoding:jP,removeDotSegments:SP,isIPv4:pL,isUUID:zP,normalizeIPv6:tL,stringArrayToHexStripped:U8}});var UJ=T((ei,IJ)=>{var{isUUID:RP}=b8(),TP=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,_P=["http","https","ws","wss","urn","urn:uuid"];function CP($){return _P.indexOf($)!==-1}function D8($){if($.secure===!0)return!0;else if($.secure===!1)return!1;else if($.scheme)return $.scheme.length===3&&($.scheme[0]==="w"||$.scheme[0]==="W")&&($.scheme[1]==="s"||$.scheme[1]==="S")&&($.scheme[2]==="s"||$.scheme[2]==="S");else return!1}function eL($){if(!$.host)$.error=$.error||"HTTP URIs must have a host.";return $}function sL($){let I=String($.scheme).toLowerCase()==="https";if($.port===(I?443:80)||$.port==="")$.port=void 0;if(!$.path)$.path="/";return $}function fP($){return $.secure=D8($),$.resourceName=($.path||"/")+($.query?"?"+$.query:""),$.path=void 0,$.query=void 0,$}function ZP($){if($.port===(D8($)?443:80)||$.port==="")$.port=void 0;if(typeof $.secure==="boolean")$.scheme=$.secure?"wss":"ws",$.secure=void 0;if($.resourceName){let[I,U]=$.resourceName.split("?");$.path=I&&I!=="/"?I:void 0,$.query=U,$.resourceName=void 0}return $.fragment=void 0,$}function gP($,I){if(!$.path)return $.error="URN can not be parsed",$;let U=$.path.match(TP);if(U){let D=I.scheme||$.scheme||"urn";$.nid=U[1].toLowerCase(),$.nss=U[2];let b=`${D}:${I.nid||$.nid}`,A=A8(b);if($.path=void 0,A)$=A.parse($,I)}else $.error=$.error||"URN can not be parsed.";return $}function yP($,I){if($.nid===void 0)throw new Error("URN without nid cannot be serialized");let U=I.scheme||$.scheme||"urn",D=$.nid.toLowerCase(),b=`${U}:${I.nid||D}`,A=A8(b);if(A)$=A.serialize($,I);let w=$,O=$.nss;return w.path=`${D||I.nid}:${O}`,I.skipEscape=!0,w}function xP($,I){let U=$;if(U.uuid=U.nss,U.nss=void 0,!I.tolerant&&(!U.uuid||!RP(U.uuid)))U.error=U.error||"UUID is not valid.";return U}function lP($){let I=$;return I.nss=($.uuid||"").toLowerCase(),I}var $J={scheme:"http",domainHost:!0,parse:eL,serialize:sL},hP={scheme:"https",domainHost:$J.domainHost,parse:eL,serialize:sL},lO={scheme:"ws",domainHost:!0,parse:fP,serialize:ZP},uP={scheme:"wss",domainHost:lO.domainHost,parse:lO.parse,serialize:lO.serialize},iP={scheme:"urn",parse:gP,serialize:yP,skipNormalize:!0},nP={scheme:"urn:uuid",parse:xP,serialize:lP,skipNormalize:!0},hO={http:$J,https:hP,ws:lO,wss:uP,urn:iP,"urn:uuid":nP};Object.setPrototypeOf(hO,null);function A8($){return $&&(hO[$]||hO[$.toLowerCase()])||void 0}IJ.exports={wsIsSecure:D8,SCHEMES:hO,isValidSchemeName:CP,getSchemeHandler:A8}});var AJ=T((si,iO)=>{var{normalizeIPv6:rP,removeDotSegments:s1,recomposeAuthority:cP,normalizeComponentEncoding:uO,isIPv4:mP,nonSimpleDomain:oP}=b8(),{SCHEMES:dP,getSchemeHandler:bJ}=UJ();function pP($,I){if(typeof $==="string")$=j6(r6($,I),I);else if(typeof $==="object")$=r6(j6($,I),I);return $}function tP($,I,U){let D=U?Object.assign({scheme:"null"},U):{scheme:"null"},b=DJ(r6($,D),r6(I,D),D,!0);return D.skipEscape=!0,j6(b,D)}function DJ($,I,U,D){let b={};if(!D)$=r6(j6($,U),U),I=r6(j6(I,U),U);if(U=U||{},!U.tolerant&&I.scheme)b.scheme=I.scheme,b.userinfo=I.userinfo,b.host=I.host,b.port=I.port,b.path=s1(I.path||""),b.query=I.query;else{if(I.userinfo!==void 0||I.host!==void 0||I.port!==void 0)b.userinfo=I.userinfo,b.host=I.host,b.port=I.port,b.path=s1(I.path||""),b.query=I.query;else{if(!I.path)if(b.path=$.path,I.query!==void 0)b.query=I.query;else b.query=$.query;else{if(I.path[0]==="/")b.path=s1(I.path);else{if(($.userinfo!==void 0||$.host!==void 0||$.port!==void 0)&&!$.path)b.path="/"+I.path;else if(!$.path)b.path=I.path;else b.path=$.path.slice(0,$.path.lastIndexOf("/")+1)+I.path;b.path=s1(b.path)}b.query=I.query}b.userinfo=$.userinfo,b.host=$.host,b.port=$.port}b.scheme=$.scheme}return b.fragment=I.fragment,b}function aP($,I,U){if(typeof $==="string")$=unescape($),$=j6(uO(r6($,U),!0),{...U,skipEscape:!0});else if(typeof $==="object")$=j6(uO($,!0),{...U,skipEscape:!0});if(typeof I==="string")I=unescape(I),I=j6(uO(r6(I,U),!0),{...U,skipEscape:!0});else if(typeof I==="object")I=j6(uO(I,!0),{...U,skipEscape:!0});return $.toLowerCase()===I.toLowerCase()}function j6($,I){let U={host:$.host,scheme:$.scheme,userinfo:$.userinfo,port:$.port,path:$.path,query:$.query,nid:$.nid,nss:$.nss,uuid:$.uuid,fragment:$.fragment,reference:$.reference,resourceName:$.resourceName,secure:$.secure,error:""},D=Object.assign({},I),b=[],A=bJ(D.scheme||U.scheme);if(A&&A.serialize)A.serialize(U,D);if(U.path!==void 0)if(!D.skipEscape){if(U.path=escape(U.path),U.scheme!==void 0)U.path=U.path.split("%3A").join(":")}else U.path=unescape(U.path);if(D.reference!=="suffix"&&U.scheme)b.push(U.scheme,":");let w=cP(U);if(w!==void 0){if(D.reference!=="suffix")b.push("//");if(b.push(w),U.path&&U.path[0]!=="/")b.push("/")}if(U.path!==void 0){let O=U.path;if(!D.absolutePath&&(!A||!A.absolutePath))O=s1(O);if(w===void 0&&O[0]==="/"&&O[1]==="/")O="/%2F"+O.slice(2);b.push(O)}if(U.query!==void 0)b.push("?",U.query);if(U.fragment!==void 0)b.push("#",U.fragment);return b.join("")}var eP=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function r6($,I){let U=Object.assign({},I),D={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},b=!1;if(U.reference==="suffix")if(U.scheme)$=U.scheme+":"+$;else $="//"+$;let A=$.match(eP);if(A){if(D.scheme=A[1],D.userinfo=A[3],D.host=A[4],D.port=parseInt(A[5],10),D.path=A[6]||"",D.query=A[7],D.fragment=A[8],isNaN(D.port))D.port=A[5];if(D.host)if(mP(D.host)===!1){let N=rP(D.host);D.host=N.host.toLowerCase(),b=N.isIPV6}else b=!0;if(D.scheme===void 0&&D.userinfo===void 0&&D.host===void 0&&D.port===void 0&&D.query===void 0&&!D.path)D.reference="same-document";else if(D.scheme===void 0)D.reference="relative";else if(D.fragment===void 0)D.reference="absolute";else D.reference="uri";if(U.reference&&U.reference!=="suffix"&&U.reference!==D.reference)D.error=D.error||"URI is not a "+U.reference+" reference.";let w=bJ(U.scheme||D.scheme);if(!U.unicodeSupport&&(!w||!w.unicodeSupport)){if(D.host&&(U.domainHost||w&&w.domainHost)&&b===!1&&oP(D.host))try{D.host=URL.domainToASCII(D.host.toLowerCase())}catch(O){D.error=D.error||"Host's domain name can not be converted to ASCII: "+O}}if(!w||w&&!w.skipNormalize){if($.indexOf("%")!==-1){if(D.scheme!==void 0)D.scheme=unescape(D.scheme);if(D.host!==void 0)D.host=unescape(D.host)}if(D.path)D.path=escape(unescape(D.path));if(D.fragment)D.fragment=encodeURI(decodeURIComponent(D.fragment))}if(w&&w.parse)w.parse(D,U)}else D.error=D.error||"URI can not be parsed.";return D}var w8={SCHEMES:dP,normalize:pP,resolve:tP,resolveComponent:DJ,equal:aP,serialize:j6,parse:r6};iO.exports=w8;iO.exports.default=w8;iO.exports.fastUri=w8});var NJ=T((OJ)=>{Object.defineProperty(OJ,"__esModule",{value:!0});var wJ=AJ();wJ.code='require("ajv/dist/runtime/uri").default';OJ.default=wJ});var LJ=T((c6)=>{Object.defineProperty(c6,"__esModule",{value:!0});c6.CodeGen=c6.Name=c6.nil=c6.stringify=c6.str=c6._=c6.KeywordCxt=void 0;var $R=t1();Object.defineProperty(c6,"KeywordCxt",{enumerable:!0,get:function(){return $R.KeywordCxt}});var aI=d();Object.defineProperty(c6,"_",{enumerable:!0,get:function(){return aI._}});Object.defineProperty(c6,"str",{enumerable:!0,get:function(){return aI.str}});Object.defineProperty(c6,"stringify",{enumerable:!0,get:function(){return aI.stringify}});Object.defineProperty(c6,"nil",{enumerable:!0,get:function(){return aI.nil}});Object.defineProperty(c6,"Name",{enumerable:!0,get:function(){return aI.Name}});Object.defineProperty(c6,"CodeGen",{enumerable:!0,get:function(){return aI.CodeGen}});var IR=gO(),YJ=a1(),UR=l9(),$b=xO(),bR=d(),Ib=o1(),nO=m1(),N8=A$(),XJ=oL(),DR=NJ(),vJ=($,I)=>new RegExp($,I);vJ.code="new RegExp";var AR=["removeAdditional","useDefaults","coerceTypes"],wR=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),OR={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."},NR={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},WJ=200;function XR($){var I,U,D,b,A,w,O,N,X,G,Q,Y,v,L,H,z,q,g,x,a,h,M6,C6,x0,l0;let JU=$.strict,h0=(I=$.code)===null||I===void 0?void 0:I.optimize,mY=h0===!0||h0===void 0?1:h0||0,oY=(D=(U=$.code)===null||U===void 0?void 0:U.regExp)!==null&&D!==void 0?D:vJ,uV=(b=$.uriResolver)!==null&&b!==void 0?b:DR.default;return{strictSchema:(w=(A=$.strictSchema)!==null&&A!==void 0?A:JU)!==null&&w!==void 0?w:!0,strictNumbers:(N=(O=$.strictNumbers)!==null&&O!==void 0?O:JU)!==null&&N!==void 0?N:!0,strictTypes:(G=(X=$.strictTypes)!==null&&X!==void 0?X:JU)!==null&&G!==void 0?G:"log",strictTuples:(Y=(Q=$.strictTuples)!==null&&Q!==void 0?Q:JU)!==null&&Y!==void 0?Y:"log",strictRequired:(L=(v=$.strictRequired)!==null&&v!==void 0?v:JU)!==null&&L!==void 0?L:!1,code:$.code?{...$.code,optimize:mY,regExp:oY}:{optimize:mY,regExp:oY},loopRequired:(H=$.loopRequired)!==null&&H!==void 0?H:WJ,loopEnum:(z=$.loopEnum)!==null&&z!==void 0?z:WJ,meta:(q=$.meta)!==null&&q!==void 0?q:!0,messages:(g=$.messages)!==null&&g!==void 0?g:!0,inlineRefs:(x=$.inlineRefs)!==null&&x!==void 0?x:!0,schemaId:(a=$.schemaId)!==null&&a!==void 0?a:"$id",addUsedSchema:(h=$.addUsedSchema)!==null&&h!==void 0?h:!0,validateSchema:(M6=$.validateSchema)!==null&&M6!==void 0?M6:!0,validateFormats:(C6=$.validateFormats)!==null&&C6!==void 0?C6:!0,unicodeRegExp:(x0=$.unicodeRegExp)!==null&&x0!==void 0?x0:!0,int32range:(l0=$.int32range)!==null&&l0!==void 0?l0:!0,uriResolver:uV}}class rO{constructor($={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,$=this.opts={...$,...XR($)};let{es5:I,lines:U}=this.opts.code;this.scope=new bR.ValueScope({scope:{},prefixes:wR,es5:I,lines:U}),this.logger=BR($.logger);let D=$.validateFormats;if($.validateFormats=!1,this.RULES=UR.getRules(),GJ.call(this,OR,$,"NOT SUPPORTED"),GJ.call(this,NR,$,"DEPRECATED","warn"),this._metaOpts=YR.call(this),$.formats)GR.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),$.keywords)QR.call(this,$.keywords);if(typeof $.meta=="object")this.addMetaSchema($.meta);WR.call(this),$.validateFormats=D}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:$,meta:I,schemaId:U}=this.opts,D=XJ;if(U==="id")D={...XJ},D.id=D.$id,delete D.$id;if(I&&$)this.addMetaSchema(D,D[U],!1)}defaultMeta(){let{meta:$,schemaId:I}=this.opts;return this.opts.defaultMeta=typeof $=="object"?$[I]||$:void 0}validate($,I){let U;if(typeof $=="string"){if(U=this.getSchema($),!U)throw new Error(`no schema with key or ref "${$}"`)}else U=this.compile($);let D=U(I);if(!("$async"in U))this.errors=U.errors;return D}compile($,I){let U=this._addSchema($,I);return U.validate||this._compileSchemaEnv(U)}compileAsync($,I){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:U}=this.opts;return D.call(this,$,I);async function D(X,G){await b.call(this,X.$schema);let Q=this._addSchema(X,G);return Q.validate||A.call(this,Q)}async function b(X){if(X&&!this.getSchema(X))await D.call(this,{$ref:X},!0)}async function A(X){try{return this._compileSchemaEnv(X)}catch(G){if(!(G instanceof YJ.default))throw G;return w.call(this,G),await O.call(this,G.missingSchema),A.call(this,X)}}function w({missingSchema:X,missingRef:G}){if(this.refs[X])throw new Error(`AnySchema ${X} is loaded but ${G} cannot be resolved`)}async function O(X){let G=await N.call(this,X);if(!this.refs[X])await b.call(this,G.$schema);if(!this.refs[X])this.addSchema(G,X,I)}async function N(X){let G=this._loading[X];if(G)return G;try{return await(this._loading[X]=U(X))}finally{delete this._loading[X]}}}addSchema($,I,U,D=this.opts.validateSchema){if(Array.isArray($)){for(let A of $)this.addSchema(A,void 0,U,D);return this}let b;if(typeof $==="object"){let{schemaId:A}=this.opts;if(b=$[A],b!==void 0&&typeof b!="string")throw new Error(`schema ${A} must be string`)}return I=Ib.normalizeId(I||b),this._checkUnique(I),this.schemas[I]=this._addSchema($,U,I,D,!0),this}addMetaSchema($,I,U=this.opts.validateSchema){return this.addSchema($,I,!0,U),this}validateSchema($,I){if(typeof $=="boolean")return!0;let U;if(U=$.$schema,U!==void 0&&typeof U!="string")throw new Error("$schema must be a string");if(U=U||this.opts.defaultMeta||this.defaultMeta(),!U)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let D=this.validate(U,$);if(!D&&I){let b="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(b);else throw new Error(b)}return D}getSchema($){let I;while(typeof(I=QJ.call(this,$))=="string")$=I;if(I===void 0){let{schemaId:U}=this.opts,D=new $b.SchemaEnv({schema:{},schemaId:U});if(I=$b.resolveSchema.call(this,D,$),!I)return;this.refs[$]=I}return I.validate||this._compileSchemaEnv(I)}removeSchema($){if($ instanceof RegExp)return this._removeAllSchemas(this.schemas,$),this._removeAllSchemas(this.refs,$),this;switch(typeof $){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let I=QJ.call(this,$);if(typeof I=="object")this._cache.delete(I.schema);return delete this.schemas[$],delete this.refs[$],this}case"object":{let I=$;this._cache.delete(I);let U=$[this.opts.schemaId];if(U)U=Ib.normalizeId(U),delete this.schemas[U],delete this.refs[U];return this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary($){for(let I of $)this.addKeyword(I);return this}addKeyword($,I){let U;if(typeof $=="string"){if(U=$,typeof I=="object")this.logger.warn("these parameters are deprecated, see docs for addKeyword"),I.keyword=U}else if(typeof $=="object"&&I===void 0){if(I=$,U=I.keyword,Array.isArray(U)&&!U.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(JR.call(this,U,I),!I)return N8.eachItem(U,(b)=>O8.call(this,b)),this;MR.call(this,I);let D={...I,type:nO.getJSONTypes(I.type),schemaType:nO.getJSONTypes(I.schemaType)};return N8.eachItem(U,D.type.length===0?(b)=>O8.call(this,b,D):(b)=>D.type.forEach((A)=>O8.call(this,b,D,A))),this}getKeyword($){let I=this.RULES.all[$];return typeof I=="object"?I.definition:!!I}removeKeyword($){let{RULES:I}=this;delete I.keywords[$],delete I.all[$];for(let U of I.rules){let D=U.rules.findIndex((b)=>b.keyword===$);if(D>=0)U.rules.splice(D,1)}return this}addFormat($,I){if(typeof I=="string")I=new RegExp(I);return this.formats[$]=I,this}errorsText($=this.errors,{separator:I=", ",dataVar:U="data"}={}){if(!$||$.length===0)return"No errors";return $.map((D)=>`${U}${D.instancePath} ${D.message}`).reduce((D,b)=>D+I+b)}$dataMetaSchema($,I){let U=this.RULES.all;$=JSON.parse(JSON.stringify($));for(let D of I){let b=D.split("/").slice(1),A=$;for(let w of b)A=A[w];for(let w in U){let O=U[w];if(typeof O!="object")continue;let{$data:N}=O.definition,X=A[w];if(N&&X)A[w]=BJ(X)}}return $}_removeAllSchemas($,I){for(let U in $){let D=$[U];if(!I||I.test(U)){if(typeof D=="string")delete $[U];else if(D&&!D.meta)this._cache.delete(D.schema),delete $[U]}}}_addSchema($,I,U,D=this.opts.validateSchema,b=this.opts.addUsedSchema){let A,{schemaId:w}=this.opts;if(typeof $=="object")A=$[w];else if(this.opts.jtd)throw new Error("schema must be object");else if(typeof $!="boolean")throw new Error("schema must be object or boolean");let O=this._cache.get($);if(O!==void 0)return O;U=Ib.normalizeId(A||U);let N=Ib.getSchemaRefs.call(this,$,U);if(O=new $b.SchemaEnv({schema:$,schemaId:w,meta:I,baseId:U,localRefs:N}),this._cache.set(O.schema,O),b&&!U.startsWith("#")){if(U)this._checkUnique(U);this.refs[U]=O}if(D)this.validateSchema($,!0);return O}_checkUnique($){if(this.schemas[$]||this.refs[$])throw new Error(`schema with key or id "${$}" already exists`)}_compileSchemaEnv($){if($.meta)this._compileMetaSchema($);else $b.compileSchema.call(this,$);if(!$.validate)throw new Error("ajv implementation error");return $.validate}_compileMetaSchema($){let I=this.opts;this.opts=this._metaOpts;try{$b.compileSchema.call(this,$)}finally{this.opts=I}}}rO.ValidationError=IR.default;rO.MissingRefError=YJ.default;c6.default=rO;function GJ($,I,U,D="error"){for(let b in $){let A=b;if(A in I)this.logger[D](`${U}: option ${b}. ${$[A]}`)}}function QJ($){return $=Ib.normalizeId($),this.schemas[$]||this.refs[$]}function WR(){let $=this.opts.schemas;if(!$)return;if(Array.isArray($))this.addSchema($);else for(let I in $)this.addSchema($[I],I)}function GR(){for(let $ in this.opts.formats){let I=this.opts.formats[$];if(I)this.addFormat($,I)}}function QR($){if(Array.isArray($)){this.addVocabulary($);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let I in $){let U=$[I];if(!U.keyword)U.keyword=I;this.addKeyword(U)}}function YR(){let $={...this.opts};for(let I of AR)delete $[I];return $}var vR={log(){},warn(){},error(){}};function BR($){if($===!1)return vR;if($===void 0)return console;if($.log&&$.warn&&$.error)return $;throw new Error("logger must implement log, warn and error methods")}var LR=/^[a-z_$][a-z0-9_$:-]*$/i;function JR($,I){let{RULES:U}=this;if(N8.eachItem($,(D)=>{if(U.keywords[D])throw new Error(`Keyword ${D} is already defined`);if(!LR.test(D))throw new Error(`Keyword ${D} has invalid name`)}),!I)return;if(I.$data&&!(("code"in I)||("validate"in I)))throw new Error('$data keyword must have "code" or "validate" function')}function O8($,I,U){var D;let b=I===null||I===void 0?void 0:I.post;if(U&&b)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:A}=this,w=b?A.post:A.rules.find(({type:N})=>N===U);if(!w)w={type:U,rules:[]},A.rules.push(w);if(A.keywords[$]=!0,!I)return;let O={keyword:$,definition:{...I,type:nO.getJSONTypes(I.type),schemaType:nO.getJSONTypes(I.schemaType)}};if(I.before)HR.call(this,w,O,I.before);else w.rules.push(O);A.all[$]=O,(D=I.implements)===null||D===void 0||D.forEach((N)=>this.addKeyword(N))}function HR($,I,U){let D=$.rules.findIndex((b)=>b.keyword===U);if(D>=0)$.rules.splice(D,0,I);else $.rules.push(I),this.logger.warn(`rule ${U} is not defined`)}function MR($){let{metaSchema:I}=$;if(I===void 0)return;if($.$data&&this.opts.$data)I=BJ(I);$.validateSchema=this.compile(I,!0)}var VR={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function BJ($){return{anyOf:[$,VR]}}});var HJ=T((JJ)=>{Object.defineProperty(JJ,"__esModule",{value:!0});var FR={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};JJ.default=FR});var kJ=T((zJ)=>{Object.defineProperty(zJ,"__esModule",{value:!0});zJ.callRef=zJ.getValidate=void 0;var qR=a1(),MJ=b6(),m$=d(),eI=i6(),VJ=xO(),cO=A$(),ER={keyword:"$ref",schemaType:"string",code($){let{gen:I,schema:U,it:D}=$,{baseId:b,schemaEnv:A,validateName:w,opts:O,self:N}=D,{root:X}=A;if((U==="#"||U==="#/")&&b===X.baseId)return Q();let G=VJ.resolveRef.call(N,X,b,U);if(G===void 0)throw new qR.default(D.opts.uriResolver,b,U);if(G instanceof VJ.SchemaEnv)return Y(G);return v(G);function Q(){if(A===X)return mO($,w,A,A.$async);let L=I.scopeValue("root",{ref:X});return mO($,m$._`${L}.validate`,X,X.$async)}function Y(L){let H=KJ($,L);mO($,H,L,L.$async)}function v(L){let H=I.scopeValue("schema",O.code.source===!0?{ref:L,code:m$.stringify(L)}:{ref:L}),z=I.name("valid"),q=$.subschema({schema:L,dataTypes:[],schemaPath:m$.nil,topSchemaRef:H,errSchemaPath:U},z);$.mergeEvaluated(q),$.ok(z)}}};function KJ($,I){let{gen:U}=$;return I.validate?U.scopeValue("validate",{ref:I.validate}):m$._`${U.scopeValue("wrapper",{ref:I})}.validate`}zJ.getValidate=KJ;function mO($,I,U,D){let{gen:b,it:A}=$,{allErrors:w,schemaEnv:O,opts:N}=A,X=N.passContext?eI.default.this:m$.nil;if(D)G();else Q();function G(){if(!O.$async)throw new Error("async schema referenced by sync schema");let L=b.let("valid");b.try(()=>{if(b.code(m$._`await ${MJ.callValidateCode($,I,X)}`),v(I),!w)b.assign(L,!0)},(H)=>{if(b.if(m$._`!(${H} instanceof ${A.ValidationError})`,()=>b.throw(H)),Y(H),!w)b.assign(L,!1)}),$.ok(L)}function Q(){$.result(MJ.callValidateCode($,I,X),()=>v(I),()=>Y(I))}function Y(L){let H=m$._`${L}.errors`;b.assign(eI.default.vErrors,m$._`${eI.default.vErrors} === null ? ${H} : ${eI.default.vErrors}.concat(${H})`),b.assign(eI.default.errors,m$._`${eI.default.vErrors}.length`)}function v(L){var H;if(!A.opts.unevaluated)return;let z=(H=U===null||U===void 0?void 0:U.validate)===null||H===void 0?void 0:H.evaluated;if(A.props!==!0)if(z&&!z.dynamicProps){if(z.props!==void 0)A.props=cO.mergeEvaluated.props(b,z.props,A.props)}else{let q=b.var("props",m$._`${L}.evaluated.props`);A.props=cO.mergeEvaluated.props(b,q,A.props,m$.Name)}if(A.items!==!0)if(z&&!z.dynamicItems){if(z.items!==void 0)A.items=cO.mergeEvaluated.items(b,z.items,A.items)}else{let q=b.var("items",m$._`${L}.evaluated.items`);A.items=cO.mergeEvaluated.items(b,q,A.items,m$.Name)}}}zJ.callRef=mO;zJ.default=ER});var EJ=T((qJ)=>{Object.defineProperty(qJ,"__esModule",{value:!0});var PR=HJ(),RR=kJ(),TR=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",PR.default,RR.default];qJ.default=TR});var jJ=T((SJ)=>{Object.defineProperty(SJ,"__esModule",{value:!0});var oO=d(),V4=oO.operators,dO={maximum:{okStr:"<=",ok:V4.LTE,fail:V4.GT},minimum:{okStr:">=",ok:V4.GTE,fail:V4.LT},exclusiveMaximum:{okStr:"<",ok:V4.LT,fail:V4.GTE},exclusiveMinimum:{okStr:">",ok:V4.GT,fail:V4.LTE}},CR={message:({keyword:$,schemaCode:I})=>oO.str`must be ${dO[$].okStr} ${I}`,params:({keyword:$,schemaCode:I})=>oO._`{comparison: ${dO[$].okStr}, limit: ${I}}`},fR={keyword:Object.keys(dO),type:"number",schemaType:"number",$data:!0,error:CR,code($){let{keyword:I,data:U,schemaCode:D}=$;$.fail$data(oO._`${U} ${dO[I].fail} ${D} || isNaN(${U})`)}};SJ.default=fR});var RJ=T((PJ)=>{Object.defineProperty(PJ,"__esModule",{value:!0});var Ub=d(),gR={message:({schemaCode:$})=>Ub.str`must be multiple of ${$}`,params:({schemaCode:$})=>Ub._`{multipleOf: ${$}}`},yR={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:gR,code($){let{gen:I,data:U,schemaCode:D,it:b}=$,A=b.opts.multipleOfPrecision,w=I.let("res"),O=A?Ub._`Math.abs(Math.round(${w}) - ${w}) > 1e-${A}`:Ub._`${w} !== parseInt(${w})`;$.fail$data(Ub._`(${D} === 0 || (${w} = ${U}/${D}, ${O}))`)}};PJ.default=yR});var CJ=T((_J)=>{Object.defineProperty(_J,"__esModule",{value:!0});function TJ($){let I=$.length,U=0,D=0,b;while(D<I)if(U++,b=$.charCodeAt(D++),b>=55296&&b<=56319&&D<I){if(b=$.charCodeAt(D),(b&64512)===56320)D++}return U}_J.default=TJ;TJ.code='require("ajv/dist/runtime/ucs2length").default'});var ZJ=T((fJ)=>{Object.defineProperty(fJ,"__esModule",{value:!0});var m4=d(),hR=A$(),uR=CJ(),iR={message({keyword:$,schemaCode:I}){let U=$==="maxLength"?"more":"fewer";return m4.str`must NOT have ${U} than ${I} characters`},params:({schemaCode:$})=>m4._`{limit: ${$}}`},nR={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:iR,code($){let{keyword:I,data:U,schemaCode:D,it:b}=$,A=I==="maxLength"?m4.operators.GT:m4.operators.LT,w=b.opts.unicode===!1?m4._`${U}.length`:m4._`${hR.useFunc($.gen,uR.default)}(${U})`;$.fail$data(m4._`${w} ${A} ${D}`)}};fJ.default=nR});var yJ=T((gJ)=>{Object.defineProperty(gJ,"__esModule",{value:!0});var cR=b6(),pO=d(),mR={message:({schemaCode:$})=>pO.str`must match pattern "${$}"`,params:({schemaCode:$})=>pO._`{pattern: ${$}}`},oR={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:mR,code($){let{data:I,$data:U,schema:D,schemaCode:b,it:A}=$,w=A.opts.unicodeRegExp?"u":"",O=U?pO._`(new RegExp(${b}, ${w}))`:cR.usePattern($,D);$.fail$data(pO._`!${O}.test(${I})`)}};gJ.default=oR});var lJ=T((xJ)=>{Object.defineProperty(xJ,"__esModule",{value:!0});var bb=d(),pR={message({keyword:$,schemaCode:I}){let U=$==="maxProperties"?"more":"fewer";return bb.str`must NOT have ${U} than ${I} properties`},params:({schemaCode:$})=>bb._`{limit: ${$}}`},tR={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:pR,code($){let{keyword:I,data:U,schemaCode:D}=$,b=I==="maxProperties"?bb.operators.GT:bb.operators.LT;$.fail$data(bb._`Object.keys(${U}).length ${b} ${D}`)}};xJ.default=tR});var uJ=T((hJ)=>{Object.defineProperty(hJ,"__esModule",{value:!0});var Db=b6(),Ab=d(),eR=A$(),sR={message:({params:{missingProperty:$}})=>Ab.str`must have required property '${$}'`,params:({params:{missingProperty:$}})=>Ab._`{missingProperty: ${$}}`},$T={keyword:"required",type:"object",schemaType:"array",$data:!0,error:sR,code($){let{gen:I,schema:U,schemaCode:D,data:b,$data:A,it:w}=$,{opts:O}=w;if(!A&&U.length===0)return;let N=U.length>=O.loopRequired;if(w.allErrors)X();else G();if(O.strictRequired){let v=$.parentSchema.properties,{definedProperties:L}=$.it;for(let H of U)if((v===null||v===void 0?void 0:v[H])===void 0&&!L.has(H)){let z=w.schemaEnv.baseId+w.errSchemaPath,q=`required property "${H}" is not defined at "${z}" (strictRequired)`;eR.checkStrictMode(w,q,w.opts.strictRequired)}}function X(){if(N||A)$.block$data(Ab.nil,Q);else for(let v of U)Db.checkReportMissingProp($,v)}function G(){let v=I.let("missing");if(N||A){let L=I.let("valid",!0);$.block$data(L,()=>Y(v,L)),$.ok(L)}else I.if(Db.checkMissingProp($,U,v)),Db.reportMissingProp($,v),I.else()}function Q(){I.forOf("prop",D,(v)=>{$.setParams({missingProperty:v}),I.if(Db.noPropertyInData(I,b,v,O.ownProperties),()=>$.error())})}function Y(v,L){$.setParams({missingProperty:v}),I.forOf(v,D,()=>{I.assign(L,Db.propertyInData(I,b,v,O.ownProperties)),I.if(Ab.not(L),()=>{$.error(),I.break()})},Ab.nil)}}};hJ.default=$T});var nJ=T((iJ)=>{Object.defineProperty(iJ,"__esModule",{value:!0});var wb=d(),UT={message({keyword:$,schemaCode:I}){let U=$==="maxItems"?"more":"fewer";return wb.str`must NOT have ${U} than ${I} items`},params:({schemaCode:$})=>wb._`{limit: ${$}}`},bT={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:UT,code($){let{keyword:I,data:U,schemaCode:D}=$,b=I==="maxItems"?wb.operators.GT:wb.operators.LT;$.fail$data(wb._`${U}.length ${b} ${D}`)}};iJ.default=bT});var tO=T((cJ)=>{Object.defineProperty(cJ,"__esModule",{value:!0});var rJ=o9();rJ.code='require("ajv/dist/runtime/equal").default';cJ.default=rJ});var oJ=T((mJ)=>{Object.defineProperty(mJ,"__esModule",{value:!0});var X8=m1(),R$=d(),wT=A$(),OT=tO(),NT={message:({params:{i:$,j:I}})=>R$.str`must NOT have duplicate items (items ## ${I} and ${$} are identical)`,params:({params:{i:$,j:I}})=>R$._`{i: ${$}, j: ${I}}`},XT={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:NT,code($){let{gen:I,data:U,$data:D,schema:b,parentSchema:A,schemaCode:w,it:O}=$;if(!D&&!b)return;let N=I.let("valid"),X=A.items?X8.getSchemaTypes(A.items):[];$.block$data(N,G,R$._`${w} === false`),$.ok(N);function G(){let L=I.let("i",R$._`${U}.length`),H=I.let("j");$.setParams({i:L,j:H}),I.assign(N,!0),I.if(R$._`${L} > 1`,()=>(Q()?Y:v)(L,H))}function Q(){return X.length>0&&!X.some((L)=>L==="object"||L==="array")}function Y(L,H){let z=I.name("item"),q=X8.checkDataTypes(X,z,O.opts.strictNumbers,X8.DataType.Wrong),g=I.const("indices",R$._`{}`);I.for(R$._`;${L}--;`,()=>{if(I.let(z,R$._`${U}[${L}]`),I.if(q,R$._`continue`),X.length>1)I.if(R$._`typeof ${z} == "string"`,R$._`${z} += "_"`);I.if(R$._`typeof ${g}[${z}] == "number"`,()=>{I.assign(H,R$._`${g}[${z}]`),$.error(),I.assign(N,!1).break()}).code(R$._`${g}[${z}] = ${L}`)})}function v(L,H){let z=wT.useFunc(I,OT.default),q=I.name("outer");I.label(q).for(R$._`;${L}--;`,()=>I.for(R$._`${H} = ${L}; ${H}--;`,()=>I.if(R$._`${z}(${U}[${L}], ${U}[${H}])`,()=>{$.error(),I.assign(N,!1).break(q)})))}}};mJ.default=XT});var pJ=T((dJ)=>{Object.defineProperty(dJ,"__esModule",{value:!0});var W8=d(),GT=A$(),QT=tO(),YT={message:"must be equal to constant",params:({schemaCode:$})=>W8._`{allowedValue: ${$}}`},vT={keyword:"const",$data:!0,error:YT,code($){let{gen:I,data:U,$data:D,schemaCode:b,schema:A}=$;if(D||A&&typeof A=="object")$.fail$data(W8._`!${GT.useFunc(I,QT.default)}(${U}, ${b})`);else $.fail(W8._`${A} !== ${U}`)}};dJ.default=vT});var aJ=T((tJ)=>{Object.defineProperty(tJ,"__esModule",{value:!0});var Ob=d(),LT=A$(),JT=tO(),HT={message:"must be equal to one of the allowed values",params:({schemaCode:$})=>Ob._`{allowedValues: ${$}}`},MT={keyword:"enum",schemaType:"array",$data:!0,error:HT,code($){let{gen:I,data:U,$data:D,schema:b,schemaCode:A,it:w}=$;if(!D&&b.length===0)throw new Error("enum must have non-empty array");let O=b.length>=w.opts.loopEnum,N,X=()=>N!==null&&N!==void 0?N:N=LT.useFunc(I,JT.default),G;if(O||D)G=I.let("valid"),$.block$data(G,Q);else{if(!Array.isArray(b))throw new Error("ajv implementation error");let v=I.const("vSchema",A);G=Ob.or(...b.map((L,H)=>Y(v,H)))}$.pass(G);function Q(){I.assign(G,!1),I.forOf("v",A,(v)=>I.if(Ob._`${X()}(${U}, ${v})`,()=>I.assign(G,!0).break()))}function Y(v,L){let H=b[L];return typeof H==="object"&&H!==null?Ob._`${X()}(${U}, ${v}[${L}])`:Ob._`${U} === ${H}`}}};tJ.default=MT});var sJ=T((eJ)=>{Object.defineProperty(eJ,"__esModule",{value:!0});var KT=jJ(),zT=RJ(),FT=ZJ(),kT=yJ(),qT=lJ(),ET=uJ(),ST=nJ(),jT=oJ(),PT=pJ(),RT=aJ(),TT=[KT.default,zT.default,FT.default,kT.default,qT.default,ET.default,ST.default,jT.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},PT.default,RT.default];eJ.default=TT});var Q8=T((IH)=>{Object.defineProperty(IH,"__esModule",{value:!0});IH.validateAdditionalItems=void 0;var o4=d(),G8=A$(),CT={message:({params:{len:$}})=>o4.str`must NOT have more than ${$} items`,params:({params:{len:$}})=>o4._`{limit: ${$}}`},fT={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:CT,code($){let{parentSchema:I,it:U}=$,{items:D}=I;if(!Array.isArray(D)){G8.checkStrictMode(U,'"additionalItems" is ignored when "items" is not an array of schemas');return}$H($,D)}};function $H($,I){let{gen:U,schema:D,data:b,keyword:A,it:w}=$;w.items=!0;let O=U.const("len",o4._`${b}.length`);if(D===!1)$.setParams({len:I.length}),$.pass(o4._`${O} <= ${I.length}`);else if(typeof D=="object"&&!G8.alwaysValidSchema(w,D)){let X=U.var("valid",o4._`${O} <= ${I.length}`);U.if(o4.not(X),()=>N(X)),$.ok(X)}function N(X){U.forRange("i",I.length,O,(G)=>{if($.subschema({keyword:A,dataProp:G,dataPropType:G8.Type.Num},X),!w.allErrors)U.if(o4.not(X),()=>U.break())})}}IH.validateAdditionalItems=$H;IH.default=fT});var Y8=T((AH)=>{Object.defineProperty(AH,"__esModule",{value:!0});AH.validateTuple=void 0;var bH=d(),aO=A$(),gT=b6(),yT={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code($){let{schema:I,it:U}=$;if(Array.isArray(I))return DH($,"additionalItems",I);if(U.items=!0,aO.alwaysValidSchema(U,I))return;$.ok(gT.validateArray($))}};function DH($,I,U=$.schema){let{gen:D,parentSchema:b,data:A,keyword:w,it:O}=$;if(G(b),O.opts.unevaluated&&U.length&&O.items!==!0)O.items=aO.mergeEvaluated.items(D,U.length,O.items);let N=D.name("valid"),X=D.const("len",bH._`${A}.length`);U.forEach((Q,Y)=>{if(aO.alwaysValidSchema(O,Q))return;D.if(bH._`${X} > ${Y}`,()=>$.subschema({keyword:w,schemaProp:Y,dataProp:Y},N)),$.ok(N)});function G(Q){let{opts:Y,errSchemaPath:v}=O,L=U.length,H=L===Q.minItems&&(L===Q.maxItems||Q[I]===!1);if(Y.strictTuples&&!H){let z=`"${w}" is ${L}-tuple, but minItems or maxItems/${I} are not specified or different at path "${v}"`;aO.checkStrictMode(O,z,Y.strictTuples)}}}AH.validateTuple=DH;AH.default=yT});var NH=T((OH)=>{Object.defineProperty(OH,"__esModule",{value:!0});var lT=Y8(),hT={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:($)=>lT.validateTuple($,"items")};OH.default=hT});var GH=T((WH)=>{Object.defineProperty(WH,"__esModule",{value:!0});var XH=d(),iT=A$(),nT=b6(),rT=Q8(),cT={message:({params:{len:$}})=>XH.str`must NOT have more than ${$} items`,params:({params:{len:$}})=>XH._`{limit: ${$}}`},mT={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:cT,code($){let{schema:I,parentSchema:U,it:D}=$,{prefixItems:b}=U;if(D.items=!0,iT.alwaysValidSchema(D,I))return;if(b)rT.validateAdditionalItems($,b);else $.ok(nT.validateArray($))}};WH.default=mT});var YH=T((QH)=>{Object.defineProperty(QH,"__esModule",{value:!0});var D6=d(),eO=A$(),dT={message:({params:{min:$,max:I}})=>I===void 0?D6.str`must contain at least ${$} valid item(s)`:D6.str`must contain at least ${$} and no more than ${I} valid item(s)`,params:({params:{min:$,max:I}})=>I===void 0?D6._`{minContains: ${$}}`:D6._`{minContains: ${$}, maxContains: ${I}}`},pT={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:dT,code($){let{gen:I,schema:U,parentSchema:D,data:b,it:A}=$,w,O,{minContains:N,maxContains:X}=D;if(A.opts.next)w=N===void 0?1:N,O=X;else w=1;let G=I.const("len",D6._`${b}.length`);if($.setParams({min:w,max:O}),O===void 0&&w===0){eO.checkStrictMode(A,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(O!==void 0&&w>O){eO.checkStrictMode(A,'"minContains" > "maxContains" is always invalid'),$.fail();return}if(eO.alwaysValidSchema(A,U)){let H=D6._`${G} >= ${w}`;if(O!==void 0)H=D6._`${H} && ${G} <= ${O}`;$.pass(H);return}A.items=!0;let Q=I.name("valid");if(O===void 0&&w===1)v(Q,()=>I.if(Q,()=>I.break()));else if(w===0){if(I.let(Q,!0),O!==void 0)I.if(D6._`${b}.length > 0`,Y)}else I.let(Q,!1),Y();$.result(Q,()=>$.reset());function Y(){let H=I.name("_valid"),z=I.let("count",0);v(H,()=>I.if(H,()=>L(z)))}function v(H,z){I.forRange("i",0,G,(q)=>{$.subschema({keyword:"contains",dataProp:q,dataPropType:eO.Type.Num,compositeRule:!0},H),z()})}function L(H){if(I.code(D6._`${H}++`),O===void 0)I.if(D6._`${H} >= ${w}`,()=>I.assign(Q,!0).break());else if(I.if(D6._`${H} > ${O}`,()=>I.assign(Q,!1).break()),w===1)I.assign(Q,!0);else I.if(D6._`${H} >= ${w}`,()=>I.assign(Q,!0))}}};QH.default=pT});var MH=T((LH)=>{Object.defineProperty(LH,"__esModule",{value:!0});LH.validateSchemaDeps=LH.validatePropertyDeps=LH.error=void 0;var v8=d(),aT=A$(),Nb=b6();LH.error={message:({params:{property:$,depsCount:I,deps:U}})=>{let D=I===1?"property":"properties";return v8.str`must have ${D} ${U} when property ${$} is present`},params:({params:{property:$,depsCount:I,deps:U,missingProperty:D}})=>v8._`{property: ${$},
|
|
7
7
|
missingProperty: ${D},
|
|
8
8
|
depsCount: ${I},
|
|
9
|
-
deps: ${U}}`};var qT={keyword:"dependencies",type:"object",schemaType:"object",error:oH.error,code($){let[I,U]=kT($);rH($,I),mH($,U)}};function kT({schema:$}){let I={},U={};for(let D in $){if(D==="__proto__")continue;let b=Array.isArray($[D])?I:U;b[D]=$[D]}return[I,U]}function rH($,I=$.schema){let{gen:U,data:D,it:b}=$;if(Object.keys(I).length===0)return;let w=U.let("missing");for(let A in I){let N=I[A];if(N.length===0)continue;let O=Nb.propertyInData(U,D,A,b.opts.ownProperties);if($.setParams({property:A,depsCount:N.length,deps:N.join(", ")}),b.allErrors)U.if(O,()=>{for(let X of N)Nb.checkReportMissingProp($,X)});else U.if(w8._`${O} && (${Nb.checkMissingProp($,N,w)})`),Nb.reportMissingProp($,w),U.else()}}oH.validatePropertyDeps=rH;function mH($,I=$.schema){let{gen:U,data:D,keyword:b,it:w}=$,A=U.name("valid");for(let N in I){if(FT.alwaysValidSchema(w,I[N]))continue;U.if(Nb.propertyInData(U,D,N,w.opts.ownProperties),()=>{let O=$.subschema({keyword:b,schemaProp:N},A);$.mergeValidEvaluated(O,A)},()=>U.var(A,!0)),$.ok(A)}}oH.validateSchemaDeps=mH;oH.default=qT});var sH=R((eH)=>{Object.defineProperty(eH,"__esModule",{value:!0});var aH=d(),ST=w$(),PT={message:"property name must be valid",params:({params:$})=>aH._`{propertyName: ${$.propertyName}}`},RT={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:PT,code($){let{gen:I,schema:U,data:D,it:b}=$;if(ST.alwaysValidSchema(b,U))return;let w=I.name("valid");I.forIn("key",D,(A)=>{$.setParams({propertyName:A}),$.subschema({keyword:"propertyNames",data:A,dataTypes:["string"],propertyName:A,compositeRule:!0},w),I.if(aH.not(w),()=>{if($.error(!0),!b.allErrors)I.break()})}),$.ok(w)}};eH.default=RT});var A8=R(($L)=>{Object.defineProperty($L,"__esModule",{value:!0});var mA=b6(),B6=d(),_T=i6(),oA=w$(),CT={message:"must NOT have additional properties",params:({params:$})=>B6._`{additionalProperty: ${$.additionalProperty}}`},ZT={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:CT,code($){let{gen:I,schema:U,parentSchema:D,data:b,errsCount:w,it:A}=$;if(!w)throw new Error("ajv implementation error");let{allErrors:N,opts:O}=A;if(A.props=!0,O.removeAdditional!=="all"&&oA.alwaysValidSchema(A,U))return;let X=mA.allSchemaProperties(D.properties),G=mA.allSchemaProperties(D.patternProperties);Q(),$.ok(B6._`${w} === ${_T.default.errors}`);function Q(){I.forIn("key",b,(K)=>{if(!X.length&&!G.length)J(K);else I.if(Y(K),()=>J(K))})}function Y(K){let k;if(X.length>8){let g=oA.schemaRefOrVal(A,D.properties,"properties");k=mA.isOwnProperty(I,g,K)}else if(X.length)k=B6.or(...X.map((g)=>B6._`${K} === ${g}`));else k=B6.nil;if(G.length)k=B6.or(k,...G.map((g)=>B6._`${mA.usePattern($,g)}.test(${K})`));return B6.not(k)}function B(K){I.code(B6._`delete ${b}[${K}]`)}function J(K){if(O.removeAdditional==="all"||O.removeAdditional&&U===!1){B(K);return}if(U===!1){if($.setParams({additionalProperty:K}),$.error(),!N)I.break();return}if(typeof U=="object"&&!oA.alwaysValidSchema(A,U)){let k=I.name("valid");if(O.removeAdditional==="failing")L(K,k,!1),I.if(B6.not(k),()=>{$.reset(),B(K)});else if(L(K,k),!N)I.if(B6.not(k),()=>I.break())}}function L(K,k,g){let x={keyword:"additionalProperties",dataProp:K,dataPropType:oA.Type.Str};if(g===!1)Object.assign(x,{compositeRule:!0,createErrors:!1,allErrors:!1});$.subschema(x,k)}}};$L.default=ZT});var DL=R((bL)=>{Object.defineProperty(bL,"__esModule",{value:!0});var gT=pU(),IL=b6(),N8=w$(),UL=A8(),yT={keyword:"properties",type:"object",schemaType:"object",code($){let{gen:I,schema:U,parentSchema:D,data:b,it:w}=$;if(w.opts.removeAdditional==="all"&&D.additionalProperties===void 0)UL.default.code(new gT.KeywordCxt(w,UL.default,"additionalProperties"));let A=IL.allSchemaProperties(U);for(let Q of A)w.definedProperties.add(Q);if(w.opts.unevaluated&&A.length&&w.props!==!0)w.props=N8.mergeEvaluated.props(I,N8.toHash(A),w.props);let N=A.filter((Q)=>!N8.alwaysValidSchema(w,U[Q]));if(N.length===0)return;let O=I.name("valid");for(let Q of N){if(X(Q))G(Q);else{if(I.if(IL.propertyInData(I,b,Q,w.opts.ownProperties)),G(Q),!w.allErrors)I.else().var(O,!0);I.endIf()}$.it.definedProperties.add(Q),$.ok(O)}function X(Q){return w.opts.useDefaults&&!w.compositeRule&&U[Q].default!==void 0}function G(Q){$.subschema({keyword:"properties",schemaProp:Q,dataProp:Q},O)}}};bL.default=yT});var XL=R((OL)=>{Object.defineProperty(OL,"__esModule",{value:!0});var wL=b6(),dA=d(),AL=w$(),NL=w$(),lT={keyword:"patternProperties",type:"object",schemaType:"object",code($){let{gen:I,schema:U,data:D,parentSchema:b,it:w}=$,{opts:A}=w,N=wL.allSchemaProperties(U),O=N.filter((L)=>AL.alwaysValidSchema(w,U[L]));if(N.length===0||O.length===N.length&&(!w.opts.unevaluated||w.props===!0))return;let X=A.strictSchema&&!A.allowMatchingProperties&&b.properties,G=I.name("valid");if(w.props!==!0&&!(w.props instanceof dA.Name))w.props=NL.evaluatedPropsToName(I,w.props);let{props:Q}=w;Y();function Y(){for(let L of N){if(X)B(L);if(w.allErrors)J(L);else I.var(G,!0),J(L),I.if(G)}}function B(L){for(let K in X)if(new RegExp(L).test(K))AL.checkStrictMode(w,`property ${K} matches pattern ${L} (use allowMatchingProperties)`)}function J(L){I.forIn("key",D,(K)=>{I.if(dA._`${wL.usePattern($,L)}.test(${K})`,()=>{let k=O.includes(L);if(!k)$.subschema({keyword:"patternProperties",schemaProp:L,dataProp:K,dataPropType:NL.Type.Str},G);if(w.opts.unevaluated&&Q!==!0)I.assign(dA._`${Q}[${K}]`,!0);else if(!k&&!w.allErrors)I.if(dA.not(G),()=>I.break())})})}}};OL.default=lT});var GL=R((WL)=>{Object.defineProperty(WL,"__esModule",{value:!0});var uT=w$(),iT={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code($){let{gen:I,schema:U,it:D}=$;if(uT.alwaysValidSchema(D,U)){$.fail();return}let b=I.name("valid");$.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},b),$.failResult(b,()=>$.reset(),()=>$.error())},error:{message:"must NOT be valid"}};WL.default=iT});var YL=R((QL)=>{Object.defineProperty(QL,"__esModule",{value:!0});var cT=b6(),rT={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:cT.validateUnion,error:{message:"must match a schema in anyOf"}};QL.default=rT});var vL=R((BL)=>{Object.defineProperty(BL,"__esModule",{value:!0});var pA=d(),oT=w$(),dT={message:"must match exactly one schema in oneOf",params:({params:$})=>pA._`{passingSchemas: ${$.passing}}`},pT={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:dT,code($){let{gen:I,schema:U,parentSchema:D,it:b}=$;if(!Array.isArray(U))throw new Error("ajv implementation error");if(b.opts.discriminator&&D.discriminator)return;let w=U,A=I.let("valid",!1),N=I.let("passing",null),O=I.name("_valid");$.setParams({passing:N}),I.block(X),$.result(A,()=>$.reset(),()=>$.error(!0));function X(){w.forEach((G,Q)=>{let Y;if(oT.alwaysValidSchema(b,G))I.var(O,!0);else Y=$.subschema({keyword:"oneOf",schemaProp:Q,compositeRule:!0},O);if(Q>0)I.if(pA._`${O} && ${A}`).assign(A,!1).assign(N,pA._`[${N}, ${Q}]`).else();I.if(O,()=>{if(I.assign(A,!0),I.assign(N,Q),Y)$.mergeEvaluated(Y,pA.Name)})})}}};BL.default=pT});var HL=R((JL)=>{Object.defineProperty(JL,"__esModule",{value:!0});var aT=w$(),eT={keyword:"allOf",schemaType:"array",code($){let{gen:I,schema:U,it:D}=$;if(!Array.isArray(U))throw new Error("ajv implementation error");let b=I.name("valid");U.forEach((w,A)=>{if(aT.alwaysValidSchema(D,w))return;let N=$.subschema({keyword:"allOf",schemaProp:A},b);$.ok(b),$.mergeEvaluated(N)})}};JL.default=eT});var ML=R((VL)=>{Object.defineProperty(VL,"__esModule",{value:!0});var tA=d(),zL=w$(),$2={message:({params:$})=>tA.str`must match "${$.ifClause}" schema`,params:({params:$})=>tA._`{failingKeyword: ${$.ifClause}}`},I2={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:$2,code($){let{gen:I,parentSchema:U,it:D}=$;if(U.then===void 0&&U.else===void 0)zL.checkStrictMode(D,'"if" without "then" and "else" is ignored');let b=LL(D,"then"),w=LL(D,"else");if(!b&&!w)return;let A=I.let("valid",!0),N=I.name("_valid");if(O(),$.reset(),b&&w){let G=I.let("ifClause");$.setParams({ifClause:G}),I.if(N,X("then",G),X("else",G))}else if(b)I.if(N,X("then"));else I.if(tA.not(N),X("else"));$.pass(A,()=>$.error(!0));function O(){let G=$.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},N);$.mergeEvaluated(G)}function X(G,Q){return()=>{let Y=$.subschema({keyword:G},N);if(I.assign(A,N),$.mergeValidEvaluated(Y,A),Q)I.assign(Q,tA._`${G}`);else $.setParams({ifClause:G})}}}};function LL($,I){let U=$.schema[I];return U!==void 0&&!zL.alwaysValidSchema($,U)}VL.default=I2});var FL=R((KL)=>{Object.defineProperty(KL,"__esModule",{value:!0});var b2=w$(),D2={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:$,parentSchema:I,it:U}){if(I.if===void 0)b2.checkStrictMode(U,`"${$}" without "if" is ignored`)}};KL.default=D2});var kL=R((qL)=>{Object.defineProperty(qL,"__esModule",{value:!0});var A2=b8(),N2=lH(),O2=D8(),X2=iH(),W2=cH(),G2=tH(),Q2=sH(),Y2=A8(),B2=DL(),v2=XL(),J2=GL(),H2=YL(),L2=vL(),z2=HL(),V2=ML(),M2=FL();function K2($=!1){let I=[J2.default,H2.default,L2.default,z2.default,V2.default,M2.default,Q2.default,Y2.default,G2.default,B2.default,v2.default];if($)I.push(N2.default,X2.default);else I.push(A2.default,O2.default);return I.push(W2.default),I}qL.default=K2});var jL=R((EL)=>{Object.defineProperty(EL,"__esModule",{value:!0});var M$=d(),q2={message:({schemaCode:$})=>M$.str`must match format "${$}"`,params:({schemaCode:$})=>M$._`{format: ${$}}`},k2={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:q2,code($,I){let{gen:U,data:D,$data:b,schema:w,schemaCode:A,it:N}=$,{opts:O,errSchemaPath:X,schemaEnv:G,self:Q}=N;if(!O.validateFormats)return;if(b)Y();else B();function Y(){let J=U.scopeValue("formats",{ref:Q.formats,code:O.code.formats}),L=U.const("fDef",M$._`${J}[${A}]`),K=U.let("fType"),k=U.let("format");U.if(M$._`typeof ${L} == "object" && !(${L} instanceof RegExp)`,()=>U.assign(K,M$._`${L}.type || "string"`).assign(k,M$._`${L}.validate`),()=>U.assign(K,M$._`"string"`).assign(k,L)),$.fail$data(M$.or(g(),x()));function g(){if(O.strictSchema===!1)return M$.nil;return M$._`${A} && !${k}`}function x(){let a=G.$async?M$._`(${L}.async ? await ${k}(${D}) : ${k}(${D}))`:M$._`${k}(${D})`,h=M$._`(typeof ${k} == "function" ? ${a} : ${k}.test(${D}))`;return M$._`${k} && ${k} !== true && ${K} === ${I} && !${h}`}}function B(){let J=Q.formats[w];if(!J){g();return}if(J===!0)return;let[L,K,k]=x(J);if(L===I)$.pass(a());function g(){if(O.strictSchema===!1){Q.logger.warn(h());return}throw new Error(h());function h(){return`unknown format "${w}" ignored in schema at path "${X}"`}}function x(h){let z6=h instanceof RegExp?M$.regexpCode(h):O.code.formats?M$._`${O.code.formats}${M$.getProperty(w)}`:void 0,C6=U.scopeValue("formats",{key:w,ref:h,code:z6});if(typeof h=="object"&&!(h instanceof RegExp))return[h.type||"string",h.validate,M$._`${C6}.validate`];return["string",h,C6]}function a(){if(typeof J=="object"&&!(J instanceof RegExp)&&J.async){if(!G.$async)throw new Error("async format in sync schema");return M$._`await ${k}(${D})`}return typeof K=="function"?M$._`${k}(${D})`:M$._`${k}.test(${D})`}}}};EL.default=k2});var PL=R((SL)=>{Object.defineProperty(SL,"__esModule",{value:!0});var j2=jL(),S2=[j2.default];SL.default=S2});var _L=R((RL)=>{Object.defineProperty(RL,"__esModule",{value:!0});RL.contentVocabulary=RL.metadataVocabulary=void 0;RL.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];RL.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var fL=R((ZL)=>{Object.defineProperty(ZL,"__esModule",{value:!0});var T2=bH(),_2=RH(),C2=kL(),Z2=PL(),CL=_L(),f2=[T2.default,_2.default,C2.default(),Z2.default,CL.metadataVocabulary,CL.contentVocabulary];ZL.default=f2});var lL=R((yL)=>{Object.defineProperty(yL,"__esModule",{value:!0});yL.DiscrError=void 0;var gL;(function($){$.Tag="tag",$.Mapping="mapping"})(gL||(yL.DiscrError=gL={}))});var iL=R((uL)=>{Object.defineProperty(uL,"__esModule",{value:!0});var sI=d(),O8=lL(),hL=TA(),y2=tU(),x2=w$(),l2={message:({params:{discrError:$,tagName:I}})=>$===O8.DiscrError.Tag?`tag "${I}" must be string`:`value of tag "${I}" must be in oneOf`,params:({params:{discrError:$,tag:I,tagName:U}})=>sI._`{error: ${$}, tag: ${U}, tagValue: ${I}}`},h2={keyword:"discriminator",type:"object",schemaType:"object",error:l2,code($){let{gen:I,data:U,schema:D,parentSchema:b,it:w}=$,{oneOf:A}=b;if(!w.opts.discriminator)throw new Error("discriminator: requires discriminator option");let N=D.propertyName;if(typeof N!="string")throw new Error("discriminator: requires propertyName");if(D.mapping)throw new Error("discriminator: mapping is not supported");if(!A)throw new Error("discriminator: requires oneOf keyword");let O=I.let("valid",!1),X=I.const("tag",sI._`${U}${sI.getProperty(N)}`);I.if(sI._`typeof ${X} == "string"`,()=>G(),()=>$.error(!1,{discrError:O8.DiscrError.Tag,tag:X,tagName:N})),$.ok(O);function G(){let B=Y();I.if(!1);for(let J in B)I.elseIf(sI._`${X} === ${J}`),I.assign(O,Q(B[J]));I.else(),$.error(!1,{discrError:O8.DiscrError.Mapping,tag:X,tagName:N}),I.endIf()}function Q(B){let J=I.name("valid"),L=$.subschema({keyword:"oneOf",schemaProp:B},J);return $.mergeEvaluated(L,sI.Name),J}function Y(){var B;let J={},L=k(b),K=!0;for(let a=0;a<A.length;a++){let h=A[a];if((h===null||h===void 0?void 0:h.$ref)&&!x2.schemaHasRulesButRef(h,w.self.RULES)){let C6=h.$ref;if(h=hL.resolveRef.call(w.self,w.schemaEnv.root,w.baseId,C6),h instanceof hL.SchemaEnv)h=h.schema;if(h===void 0)throw new y2.default(w.opts.uriResolver,w.baseId,C6)}let z6=(B=h===null||h===void 0?void 0:h.properties)===null||B===void 0?void 0:B[N];if(typeof z6!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${N}"`);K=K&&(L||k(h)),g(z6,a)}if(!K)throw new Error(`discriminator: "${N}" must be required`);return J;function k({required:a}){return Array.isArray(a)&&a.includes(N)}function g(a,h){if(a.const)x(a.const,h);else if(a.enum)for(let z6 of a.enum)x(z6,h);else throw new Error(`discriminator: "properties/${N}" must have "const" or "enum"`)}function x(a,h){if(typeof a!="string"||a in J)throw new Error(`discriminator: "${N}" values must be unique strings`);J[a]=h}}}};uL.default=h2});var nL=R((bn,i2)=>{i2.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var W8=R((o$,X8)=>{Object.defineProperty(o$,"__esModule",{value:!0});o$.MissingRefError=o$.ValidationError=o$.CodeGen=o$.Name=o$.nil=o$.stringify=o$.str=o$._=o$.KeywordCxt=o$.Ajv=void 0;var n2=oJ(),c2=fL(),r2=iL(),cL=nL(),m2=["/properties"],aA="http://json-schema.org/draft-07/schema";class Ob extends n2.default{_addVocabularies(){if(super._addVocabularies(),c2.default.forEach(($)=>this.addVocabulary($)),this.opts.discriminator)this.addKeyword(r2.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let $=this.opts.$data?this.$dataMetaSchema(cL,m2):cL;this.addMetaSchema($,aA,!1),this.refs["http://json-schema.org/schema"]=aA}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(aA)?aA:void 0)}}o$.Ajv=Ob;X8.exports=o$=Ob;X8.exports.Ajv=Ob;Object.defineProperty(o$,"__esModule",{value:!0});o$.default=Ob;var o2=pU();Object.defineProperty(o$,"KeywordCxt",{enumerable:!0,get:function(){return o2.KeywordCxt}});var $1=d();Object.defineProperty(o$,"_",{enumerable:!0,get:function(){return $1._}});Object.defineProperty(o$,"str",{enumerable:!0,get:function(){return $1.str}});Object.defineProperty(o$,"stringify",{enumerable:!0,get:function(){return $1.stringify}});Object.defineProperty(o$,"nil",{enumerable:!0,get:function(){return $1.nil}});Object.defineProperty(o$,"Name",{enumerable:!0,get:function(){return $1.Name}});Object.defineProperty(o$,"CodeGen",{enumerable:!0,get:function(){return $1.CodeGen}});var d2=PA();Object.defineProperty(o$,"ValidationError",{enumerable:!0,get:function(){return d2.default}});var p2=tU();Object.defineProperty(o$,"MissingRefError",{enumerable:!0,get:function(){return p2.default}})});var $z=R((eL)=>{Object.defineProperty(eL,"__esModule",{value:!0});eL.formatNames=eL.fastFormats=eL.fullFormats=void 0;function P6($,I){return{validate:$,compare:I}}eL.fullFormats={date:P6(dL,B8),time:P6(Q8(!0),v8),"date-time":P6(rL(!0),tL),"iso-time":P6(Q8(),pL),"iso-date-time":P6(rL(),aL),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:b_,"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:W_,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:D_,int32:{type:"number",validate:N_},int64:{type:"number",validate:O_},float:{type:"number",validate:oL},double:{type:"number",validate:oL},password:!0,binary:!0};eL.fastFormats={...eL.fullFormats,date:P6(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,B8),time:P6(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,v8),"date-time":P6(/^\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,tL),"iso-time":P6(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,pL),"iso-date-time":P6(/^\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,aL),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};eL.formatNames=Object.keys(eL.fullFormats);function e2($){return $%4===0&&($%100!==0||$%400===0)}var s2=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,$_=[0,31,28,31,30,31,30,31,31,30,31,30,31];function dL($){let I=s2.exec($);if(!I)return!1;let U=+I[1],D=+I[2],b=+I[3];return D>=1&&D<=12&&b>=1&&b<=(D===2&&e2(U)?29:$_[D])}function B8($,I){if(!($&&I))return;if($>I)return 1;if($<I)return-1;return 0}var G8=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function Q8($){return function I(U){let D=G8.exec(U);if(!D)return!1;let b=+D[1],w=+D[2],A=+D[3],N=D[4],O=D[5]==="-"?-1:1,X=+(D[6]||0),G=+(D[7]||0);if(X>23||G>59||$&&!N)return!1;if(b<=23&&w<=59&&A<60)return!0;let Q=w-G*O,Y=b-X*O-(Q<0?1:0);return(Y===23||Y===-1)&&(Q===59||Q===-1)&&A<61}}function v8($,I){if(!($&&I))return;let U=new Date("2020-01-01T"+$).valueOf(),D=new Date("2020-01-01T"+I).valueOf();if(!(U&&D))return;return U-D}function pL($,I){if(!($&&I))return;let U=G8.exec($),D=G8.exec(I);if(!(U&&D))return;if($=U[1]+U[2]+U[3],I=D[1]+D[2]+D[3],$>I)return 1;if($<I)return-1;return 0}var Y8=/t|\s/i;function rL($){let I=Q8($);return function U(D){let b=D.split(Y8);return b.length===2&&dL(b[0])&&I(b[1])}}function tL($,I){if(!($&&I))return;let U=new Date($).valueOf(),D=new Date(I).valueOf();if(!(U&&D))return;return U-D}function aL($,I){if(!($&&I))return;let[U,D]=$.split(Y8),[b,w]=I.split(Y8),A=B8(U,b);if(A===void 0)return;return A||v8(D,w)}var I_=/\/|:/,U_=/^(?:[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 b_($){return I_.test($)&&U_.test($)}var mL=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function D_($){return mL.lastIndex=0,mL.test($)}var w_=-2147483648,A_=2147483647;function N_($){return Number.isInteger($)&&$<=A_&&$>=w_}function O_($){return Number.isInteger($)}function oL(){return!0}var X_=/[^\\]\\Z/;function W_($){if(X_.test($))return!1;try{return new RegExp($),!0}catch(I){return!1}}});var Uz=R((Iz)=>{Object.defineProperty(Iz,"__esModule",{value:!0});Iz.formatLimitDefinition=void 0;var Q_=W8(),v6=d(),M4=v6.operators,eA={formatMaximum:{okStr:"<=",ok:M4.LTE,fail:M4.GT},formatMinimum:{okStr:">=",ok:M4.GTE,fail:M4.LT},formatExclusiveMaximum:{okStr:"<",ok:M4.LT,fail:M4.GTE},formatExclusiveMinimum:{okStr:">",ok:M4.GT,fail:M4.LTE}},Y_={message:({keyword:$,schemaCode:I})=>v6.str`should be ${eA[$].okStr} ${I}`,params:({keyword:$,schemaCode:I})=>v6._`{comparison: ${eA[$].okStr}, limit: ${I}}`};Iz.formatLimitDefinition={keyword:Object.keys(eA),type:"string",schemaType:"string",$data:!0,error:Y_,code($){let{gen:I,data:U,schemaCode:D,keyword:b,it:w}=$,{opts:A,self:N}=w;if(!A.validateFormats)return;let O=new Q_.KeywordCxt(w,N.RULES.all.format.definition,"format");if(O.$data)X();else G();function X(){let Y=I.scopeValue("formats",{ref:N.formats,code:A.code.formats}),B=I.const("fmt",v6._`${Y}[${O.schemaCode}]`);$.fail$data(v6.or(v6._`typeof ${B} != "object"`,v6._`${B} instanceof RegExp`,v6._`typeof ${B}.compare != "function"`,Q(B)))}function G(){let Y=O.schema,B=N.formats[Y];if(!B||B===!0)return;if(typeof B!="object"||B instanceof RegExp||typeof B.compare!="function")throw new Error(`"${b}": format "${Y}" does not define "compare" function`);let J=I.scopeValue("formats",{key:Y,ref:B,code:A.code.formats?v6._`${A.code.formats}${v6.getProperty(Y)}`:void 0});$.fail$data(Q(J))}function Q(Y){return v6._`${Y}.compare(${U}, ${D}) ${eA[b].fail} 0`}},dependencies:["format"]};var B_=($)=>{return $.addKeyword(Iz.formatLimitDefinition),$};Iz.default=B_});var Az=R((Xb,wz)=>{Object.defineProperty(Xb,"__esModule",{value:!0});var I1=$z(),J_=Uz(),L8=d(),bz=new L8.Name("fullFormats"),H_=new L8.Name("fastFormats"),z8=($,I={keywords:!0})=>{if(Array.isArray(I))return Dz($,I,I1.fullFormats,bz),$;let[U,D]=I.mode==="fast"?[I1.fastFormats,H_]:[I1.fullFormats,bz],b=I.formats||I1.formatNames;if(Dz($,b,U,D),I.keywords)J_.default($);return $};z8.get=($,I="full")=>{let D=(I==="fast"?I1.fastFormats:I1.fullFormats)[$];if(!D)throw new Error(`Unknown format "${$}"`);return D};function Dz($,I,U,D){var b,w;(b=(w=$.opts.code).formats)!==null&&b!==void 0||(w.formats=L8._`require("ajv-formats/dist/formats").${D}`);for(let A of I)$.addFormat(A,U[A])}wz.exports=Xb=z8;Object.defineProperty(Xb,"__esModule",{value:!0});Xb.default=z8});var s;(function($){$.assertEqual=(b)=>{};function I(b){}$.assertIs=I;function U(b){throw new Error}$.assertNever=U,$.arrayToEnum=(b)=>{let w={};for(let A of b)w[A]=A;return w},$.getValidEnumValues=(b)=>{let w=$.objectKeys(b).filter((N)=>typeof b[b[N]]!=="number"),A={};for(let N of w)A[N]=b[N];return $.objectValues(A)},$.objectValues=(b)=>{return $.objectKeys(b).map(function(w){return b[w]})},$.objectKeys=typeof Object.keys==="function"?(b)=>Object.keys(b):(b)=>{let w=[];for(let A in b)if(Object.prototype.hasOwnProperty.call(b,A))w.push(A);return w},$.find=(b,w)=>{for(let A of b)if(w(A))return A;return},$.isInteger=typeof Number.isInteger==="function"?(b)=>Number.isInteger(b):(b)=>typeof b==="number"&&Number.isFinite(b)&&Math.floor(b)===b;function D(b,w=" | "){return b.map((A)=>typeof A==="string"?`'${A}'`:A).join(w)}$.joinValues=D,$.jsonStringifyReplacer=(b,w)=>{if(typeof w==="bigint")return w.toString();return w}})(s||(s={}));var EY;(function($){$.mergeShapes=(I,U)=>{return{...I,...U}}})(EY||(EY={}));var j=s.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),f6=($)=>{switch(typeof $){case"undefined":return j.undefined;case"string":return j.string;case"number":return Number.isNaN($)?j.nan:j.number;case"boolean":return j.boolean;case"function":return j.function;case"bigint":return j.bigint;case"symbol":return j.symbol;case"object":if(Array.isArray($))return j.array;if($===null)return j.null;if($.then&&typeof $.then==="function"&&$.catch&&typeof $.catch==="function")return j.promise;if(typeof Map!=="undefined"&&$ instanceof Map)return j.map;if(typeof Set!=="undefined"&&$ instanceof Set)return j.set;if(typeof Date!=="undefined"&&$ instanceof Date)return j.date;return j.object;default:return j.unknown}};var V=s.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"]);class d$ extends Error{get errors(){return this.issues}constructor($){super();this.issues=[],this.addIssue=(U)=>{this.issues=[...this.issues,U]},this.addIssues=(U=[])=>{this.issues=[...this.issues,...U]};let I=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,I);else this.__proto__=I;this.name="ZodError",this.issues=$}format($){let I=$||function(b){return b.message},U={_errors:[]},D=(b)=>{for(let w of b.issues)if(w.code==="invalid_union")w.unionErrors.map(D);else if(w.code==="invalid_return_type")D(w.returnTypeError);else if(w.code==="invalid_arguments")D(w.argumentsError);else if(w.path.length===0)U._errors.push(I(w));else{let A=U,N=0;while(N<w.path.length){let O=w.path[N];if(N!==w.path.length-1)A[O]=A[O]||{_errors:[]};else A[O]=A[O]||{_errors:[]},A[O]._errors.push(I(w));A=A[O],N++}}};return D(this),U}static assert($){if(!($ instanceof d$))throw new Error(`Not a ZodError: ${$}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,s.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten($=(I)=>I.message){let I=Object.create(null),U=[];for(let D of this.issues)if(D.path.length>0){let b=D.path[0];I[b]=I[b]||[],I[b].push($(D))}else U.push($(D));return{formErrors:U,fieldErrors:I}}get formErrors(){return this.flatten()}}d$.create=($)=>{return new d$($)};var LV=($,I)=>{let U;switch($.code){case V.invalid_type:if($.received===j.undefined)U="Required";else U=`Expected ${$.expected}, received ${$.received}`;break;case V.invalid_literal:U=`Invalid literal value, expected ${JSON.stringify($.expected,s.jsonStringifyReplacer)}`;break;case V.unrecognized_keys:U=`Unrecognized key(s) in object: ${s.joinValues($.keys,", ")}`;break;case V.invalid_union:U="Invalid input";break;case V.invalid_union_discriminator:U=`Invalid discriminator value. Expected ${s.joinValues($.options)}`;break;case V.invalid_enum_value:U=`Invalid enum value. Expected ${s.joinValues($.options)}, received '${$.received}'`;break;case V.invalid_arguments:U="Invalid function arguments";break;case V.invalid_return_type:U="Invalid function return type";break;case V.invalid_date:U="Invalid date";break;case V.invalid_string:if(typeof $.validation==="object")if("includes"in $.validation){if(U=`Invalid input: must include "${$.validation.includes}"`,typeof $.validation.position==="number")U=`${U} at one or more positions greater than or equal to ${$.validation.position}`}else if("startsWith"in $.validation)U=`Invalid input: must start with "${$.validation.startsWith}"`;else if("endsWith"in $.validation)U=`Invalid input: must end with "${$.validation.endsWith}"`;else s.assertNever($.validation);else if($.validation!=="regex")U=`Invalid ${$.validation}`;else U="Invalid";break;case V.too_small:if($.type==="array")U=`Array must contain ${$.exact?"exactly":$.inclusive?"at least":"more than"} ${$.minimum} element(s)`;else if($.type==="string")U=`String must contain ${$.exact?"exactly":$.inclusive?"at least":"over"} ${$.minimum} character(s)`;else if($.type==="number")U=`Number must be ${$.exact?"exactly equal to ":$.inclusive?"greater than or equal to ":"greater than "}${$.minimum}`;else if($.type==="bigint")U=`Number must be ${$.exact?"exactly equal to ":$.inclusive?"greater than or equal to ":"greater than "}${$.minimum}`;else if($.type==="date")U=`Date must be ${$.exact?"exactly equal to ":$.inclusive?"greater than or equal to ":"greater than "}${new Date(Number($.minimum))}`;else U="Invalid input";break;case V.too_big:if($.type==="array")U=`Array must contain ${$.exact?"exactly":$.inclusive?"at most":"less than"} ${$.maximum} element(s)`;else if($.type==="string")U=`String must contain ${$.exact?"exactly":$.inclusive?"at most":"under"} ${$.maximum} character(s)`;else if($.type==="number")U=`Number must be ${$.exact?"exactly":$.inclusive?"less than or equal to":"less than"} ${$.maximum}`;else if($.type==="bigint")U=`BigInt must be ${$.exact?"exactly":$.inclusive?"less than or equal to":"less than"} ${$.maximum}`;else if($.type==="date")U=`Date must be ${$.exact?"exactly":$.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number($.maximum))}`;else U="Invalid input";break;case V.custom:U="Invalid input";break;case V.invalid_intersection_types:U="Intersection results could not be merged";break;case V.not_multiple_of:U=`Number must be a multiple of ${$.multipleOf}`;break;case V.not_finite:U="Number must be finite";break;default:U=I.defaultError,s.assertNever($)}return{message:U}},p6=LV;var zV=p6;function H1(){return zV}var ab=($)=>{let{data:I,path:U,errorMaps:D,issueData:b}=$,w=[...U,...b.path||[]],A={...b,path:w};if(b.message!==void 0)return{...b,path:w,message:b.message};let N="",O=D.filter((X)=>!!X).slice().reverse();for(let X of O)N=X(A,{data:I,defaultError:N}).message;return{...b,path:w,message:N}};function S($,I){let U=H1(),D=ab({issueData:I,data:$.data,path:$.path,errorMaps:[$.common.contextualErrorMap,$.schemaErrorMap,U,U===p6?void 0:p6].filter((b)=>!!b)});$.common.issues.push(D)}class T${constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray($,I){let U=[];for(let D of I){if(D.status==="aborted")return u;if(D.status==="dirty")$.dirty();U.push(D.value)}return{status:$.value,value:U}}static async mergeObjectAsync($,I){let U=[];for(let D of I){let b=await D.key,w=await D.value;U.push({key:b,value:w})}return T$.mergeObjectSync($,U)}static mergeObjectSync($,I){let U={};for(let D of I){let{key:b,value:w}=D;if(b.status==="aborted")return u;if(w.status==="aborted")return u;if(b.status==="dirty")$.dirty();if(w.status==="dirty")$.dirty();if(b.value!=="__proto__"&&(typeof w.value!=="undefined"||D.alwaysSet))U[b.value]=w.value}return{status:$.value,value:U}}}var u=Object.freeze({status:"aborted"}),a4=($)=>({status:"dirty",value:$}),Z$=($)=>({status:"valid",value:$}),CN=($)=>$.status==="aborted",ZN=($)=>$.status==="dirty",j4=($)=>$.status==="valid",L1=($)=>typeof Promise!=="undefined"&&$ instanceof Promise;var C;(function($){$.errToObj=(I)=>typeof I==="string"?{message:I}:I||{},$.toString=(I)=>typeof I==="string"?I:I?.message})(C||(C={}));class w6{constructor($,I,U,D){this._cachedPath=[],this.parent=$,this.data=I,this._path=U,this._key=D}get path(){if(!this._cachedPath.length)if(Array.isArray(this._key))this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}var jY=($,I)=>{if(j4(I))return{success:!0,data:I.value};else{if(!$.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let U=new d$($.common.issues);return this._error=U,this._error}}}};function r($){if(!$)return{};let{errorMap:I,invalid_type_error:U,required_error:D,description:b}=$;if(I&&(U||D))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(I)return{errorMap:I,description:b};return{errorMap:(A,N)=>{let{message:O}=$;if(A.code==="invalid_enum_value")return{message:O??N.defaultError};if(typeof N.data==="undefined")return{message:O??D??N.defaultError};if(A.code!=="invalid_type")return{message:N.defaultError};return{message:O??U??N.defaultError}},description:b}}class t{get description(){return this._def.description}_getType($){return f6($.data)}_getOrReturnCtx($,I){return I||{common:$.parent.common,data:$.data,parsedType:f6($.data),schemaErrorMap:this._def.errorMap,path:$.path,parent:$.parent}}_processInputParams($){return{status:new T$,ctx:{common:$.parent.common,data:$.data,parsedType:f6($.data),schemaErrorMap:this._def.errorMap,path:$.path,parent:$.parent}}}_parseSync($){let I=this._parse($);if(L1(I))throw new Error("Synchronous parse encountered promise.");return I}_parseAsync($){let I=this._parse($);return Promise.resolve(I)}parse($,I){let U=this.safeParse($,I);if(U.success)return U.data;throw U.error}safeParse($,I){let U={common:{issues:[],async:I?.async??!1,contextualErrorMap:I?.errorMap},path:I?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:f6($)},D=this._parseSync({data:$,path:U.path,parent:U});return jY(U,D)}"~validate"($){let I={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:f6($)};if(!this["~standard"].async)try{let U=this._parseSync({data:$,path:[],parent:I});return j4(U)?{value:U.value}:{issues:I.common.issues}}catch(U){if(U?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;I.common={issues:[],async:!0}}return this._parseAsync({data:$,path:[],parent:I}).then((U)=>j4(U)?{value:U.value}:{issues:I.common.issues})}async parseAsync($,I){let U=await this.safeParseAsync($,I);if(U.success)return U.data;throw U.error}async safeParseAsync($,I){let U={common:{issues:[],contextualErrorMap:I?.errorMap,async:!0},path:I?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:f6($)},D=this._parse({data:$,path:U.path,parent:U}),b=await(L1(D)?D:Promise.resolve(D));return jY(U,b)}refine($,I){let U=(D)=>{if(typeof I==="string"||typeof I==="undefined")return{message:I};else if(typeof I==="function")return I(D);else return I};return this._refinement((D,b)=>{let w=$(D),A=()=>b.addIssue({code:V.custom,...U(D)});if(typeof Promise!=="undefined"&&w instanceof Promise)return w.then((N)=>{if(!N)return A(),!1;else return!0});if(!w)return A(),!1;else return!0})}refinement($,I){return this._refinement((U,D)=>{if(!$(U))return D.addIssue(typeof I==="function"?I(U,D):I),!1;else return!0})}_refinement($){return new K6({schema:this,typeName:F.ZodEffects,effect:{type:"refinement",refinement:$}})}superRefine($){return this._refinement($)}constructor($){this.spa=this.safeParseAsync,this._def=$,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:(I)=>this["~validate"](I)}}optional(){return M6.create(this,this._def)}nullable(){return t6.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return V6.create(this)}promise(){return UI.create(this,this._def)}or($){return F1.create([this,$],this._def)}and($){return q1.create(this,$,this._def)}transform($){return new K6({...r(this._def),schema:this,typeName:F.ZodEffects,effect:{type:"transform",transform:$}})}default($){let I=typeof $==="function"?$:()=>$;return new S1({...r(this._def),innerType:this,defaultValue:I,typeName:F.ZodDefault})}brand(){return new xN({typeName:F.ZodBranded,type:this,...r(this._def)})}catch($){let I=typeof $==="function"?$:()=>$;return new P1({...r(this._def),innerType:this,catchValue:I,typeName:F.ZodCatch})}describe($){return new this.constructor({...this._def,description:$})}pipe($){return wD.create(this,$)}readonly(){return R1.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}var VV=/^c[^\s-]{8,}$/i,MV=/^[0-9a-z]+$/,KV=/^[0-9A-HJKMNP-TV-Z]{26}$/i,FV=/^[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,qV=/^[a-z0-9_-]{21}$/i,kV=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,EV=/^[-+]?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)?)??$/,jV=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,SV="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",fN,PV=/^(?:(?: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])$/,RV=/^(?:(?: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])$/,TV=/^(([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]))$/,_V=/^(([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])$/,CV=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,ZV=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,SY="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",fV=new RegExp(`^${SY}$`);function PY($){let I="[0-5]\\d";if($.precision)I=`${I}\\.\\d{${$.precision}}`;else if($.precision==null)I=`${I}(\\.\\d+)?`;let U=$.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${I})${U}`}function gV($){return new RegExp(`^${PY($)}$`)}function yV($){let I=`${SY}T${PY($)}`,U=[];if(U.push($.local?"Z?":"Z"),$.offset)U.push("([+-]\\d{2}:?\\d{2})");return I=`${I}(${U.join("|")})`,new RegExp(`^${I}$`)}function xV($,I){if((I==="v4"||!I)&&PV.test($))return!0;if((I==="v6"||!I)&&TV.test($))return!0;return!1}function lV($,I){if(!kV.test($))return!1;try{let[U]=$.split(".");if(!U)return!1;let D=U.replace(/-/g,"+").replace(/_/g,"/").padEnd(U.length+(4-U.length%4)%4,"="),b=JSON.parse(atob(D));if(typeof b!=="object"||b===null)return!1;if("typ"in b&&b?.typ!=="JWT")return!1;if(!b.alg)return!1;if(I&&b.alg!==I)return!1;return!0}catch{return!1}}function hV($,I){if((I==="v4"||!I)&&RV.test($))return!0;if((I==="v6"||!I)&&_V.test($))return!0;return!1}class y6 extends t{_parse($){if(this._def.coerce)$.data=String($.data);if(this._getType($)!==j.string){let b=this._getOrReturnCtx($);return S(b,{code:V.invalid_type,expected:j.string,received:b.parsedType}),u}let U=new T$,D=void 0;for(let b of this._def.checks)if(b.kind==="min"){if($.data.length<b.value)D=this._getOrReturnCtx($,D),S(D,{code:V.too_small,minimum:b.value,type:"string",inclusive:!0,exact:!1,message:b.message}),U.dirty()}else if(b.kind==="max"){if($.data.length>b.value)D=this._getOrReturnCtx($,D),S(D,{code:V.too_big,maximum:b.value,type:"string",inclusive:!0,exact:!1,message:b.message}),U.dirty()}else if(b.kind==="length"){let w=$.data.length>b.value,A=$.data.length<b.value;if(w||A){if(D=this._getOrReturnCtx($,D),w)S(D,{code:V.too_big,maximum:b.value,type:"string",inclusive:!0,exact:!0,message:b.message});else if(A)S(D,{code:V.too_small,minimum:b.value,type:"string",inclusive:!0,exact:!0,message:b.message});U.dirty()}}else if(b.kind==="email"){if(!jV.test($.data))D=this._getOrReturnCtx($,D),S(D,{validation:"email",code:V.invalid_string,message:b.message}),U.dirty()}else if(b.kind==="emoji"){if(!fN)fN=new RegExp(SV,"u");if(!fN.test($.data))D=this._getOrReturnCtx($,D),S(D,{validation:"emoji",code:V.invalid_string,message:b.message}),U.dirty()}else if(b.kind==="uuid"){if(!FV.test($.data))D=this._getOrReturnCtx($,D),S(D,{validation:"uuid",code:V.invalid_string,message:b.message}),U.dirty()}else if(b.kind==="nanoid"){if(!qV.test($.data))D=this._getOrReturnCtx($,D),S(D,{validation:"nanoid",code:V.invalid_string,message:b.message}),U.dirty()}else if(b.kind==="cuid"){if(!VV.test($.data))D=this._getOrReturnCtx($,D),S(D,{validation:"cuid",code:V.invalid_string,message:b.message}),U.dirty()}else if(b.kind==="cuid2"){if(!MV.test($.data))D=this._getOrReturnCtx($,D),S(D,{validation:"cuid2",code:V.invalid_string,message:b.message}),U.dirty()}else if(b.kind==="ulid"){if(!KV.test($.data))D=this._getOrReturnCtx($,D),S(D,{validation:"ulid",code:V.invalid_string,message:b.message}),U.dirty()}else if(b.kind==="url")try{new URL($.data)}catch{D=this._getOrReturnCtx($,D),S(D,{validation:"url",code:V.invalid_string,message:b.message}),U.dirty()}else if(b.kind==="regex"){if(b.regex.lastIndex=0,!b.regex.test($.data))D=this._getOrReturnCtx($,D),S(D,{validation:"regex",code:V.invalid_string,message:b.message}),U.dirty()}else if(b.kind==="trim")$.data=$.data.trim();else if(b.kind==="includes"){if(!$.data.includes(b.value,b.position))D=this._getOrReturnCtx($,D),S(D,{code:V.invalid_string,validation:{includes:b.value,position:b.position},message:b.message}),U.dirty()}else if(b.kind==="toLowerCase")$.data=$.data.toLowerCase();else if(b.kind==="toUpperCase")$.data=$.data.toUpperCase();else if(b.kind==="startsWith"){if(!$.data.startsWith(b.value))D=this._getOrReturnCtx($,D),S(D,{code:V.invalid_string,validation:{startsWith:b.value},message:b.message}),U.dirty()}else if(b.kind==="endsWith"){if(!$.data.endsWith(b.value))D=this._getOrReturnCtx($,D),S(D,{code:V.invalid_string,validation:{endsWith:b.value},message:b.message}),U.dirty()}else if(b.kind==="datetime"){if(!yV(b).test($.data))D=this._getOrReturnCtx($,D),S(D,{code:V.invalid_string,validation:"datetime",message:b.message}),U.dirty()}else if(b.kind==="date"){if(!fV.test($.data))D=this._getOrReturnCtx($,D),S(D,{code:V.invalid_string,validation:"date",message:b.message}),U.dirty()}else if(b.kind==="time"){if(!gV(b).test($.data))D=this._getOrReturnCtx($,D),S(D,{code:V.invalid_string,validation:"time",message:b.message}),U.dirty()}else if(b.kind==="duration"){if(!EV.test($.data))D=this._getOrReturnCtx($,D),S(D,{validation:"duration",code:V.invalid_string,message:b.message}),U.dirty()}else if(b.kind==="ip"){if(!xV($.data,b.version))D=this._getOrReturnCtx($,D),S(D,{validation:"ip",code:V.invalid_string,message:b.message}),U.dirty()}else if(b.kind==="jwt"){if(!lV($.data,b.alg))D=this._getOrReturnCtx($,D),S(D,{validation:"jwt",code:V.invalid_string,message:b.message}),U.dirty()}else if(b.kind==="cidr"){if(!hV($.data,b.version))D=this._getOrReturnCtx($,D),S(D,{validation:"cidr",code:V.invalid_string,message:b.message}),U.dirty()}else if(b.kind==="base64"){if(!CV.test($.data))D=this._getOrReturnCtx($,D),S(D,{validation:"base64",code:V.invalid_string,message:b.message}),U.dirty()}else if(b.kind==="base64url"){if(!ZV.test($.data))D=this._getOrReturnCtx($,D),S(D,{validation:"base64url",code:V.invalid_string,message:b.message}),U.dirty()}else s.assertNever(b);return{status:U.value,value:$.data}}_regex($,I,U){return this.refinement((D)=>$.test(D),{validation:I,code:V.invalid_string,...C.errToObj(U)})}_addCheck($){return new y6({...this._def,checks:[...this._def.checks,$]})}email($){return this._addCheck({kind:"email",...C.errToObj($)})}url($){return this._addCheck({kind:"url",...C.errToObj($)})}emoji($){return this._addCheck({kind:"emoji",...C.errToObj($)})}uuid($){return this._addCheck({kind:"uuid",...C.errToObj($)})}nanoid($){return this._addCheck({kind:"nanoid",...C.errToObj($)})}cuid($){return this._addCheck({kind:"cuid",...C.errToObj($)})}cuid2($){return this._addCheck({kind:"cuid2",...C.errToObj($)})}ulid($){return this._addCheck({kind:"ulid",...C.errToObj($)})}base64($){return this._addCheck({kind:"base64",...C.errToObj($)})}base64url($){return this._addCheck({kind:"base64url",...C.errToObj($)})}jwt($){return this._addCheck({kind:"jwt",...C.errToObj($)})}ip($){return this._addCheck({kind:"ip",...C.errToObj($)})}cidr($){return this._addCheck({kind:"cidr",...C.errToObj($)})}datetime($){if(typeof $==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:$});return this._addCheck({kind:"datetime",precision:typeof $?.precision==="undefined"?null:$?.precision,offset:$?.offset??!1,local:$?.local??!1,...C.errToObj($?.message)})}date($){return this._addCheck({kind:"date",message:$})}time($){if(typeof $==="string")return this._addCheck({kind:"time",precision:null,message:$});return this._addCheck({kind:"time",precision:typeof $?.precision==="undefined"?null:$?.precision,...C.errToObj($?.message)})}duration($){return this._addCheck({kind:"duration",...C.errToObj($)})}regex($,I){return this._addCheck({kind:"regex",regex:$,...C.errToObj(I)})}includes($,I){return this._addCheck({kind:"includes",value:$,position:I?.position,...C.errToObj(I?.message)})}startsWith($,I){return this._addCheck({kind:"startsWith",value:$,...C.errToObj(I)})}endsWith($,I){return this._addCheck({kind:"endsWith",value:$,...C.errToObj(I)})}min($,I){return this._addCheck({kind:"min",value:$,...C.errToObj(I)})}max($,I){return this._addCheck({kind:"max",value:$,...C.errToObj(I)})}length($,I){return this._addCheck({kind:"length",value:$,...C.errToObj(I)})}nonempty($){return this.min(1,C.errToObj($))}trim(){return new y6({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new y6({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new y6({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(($)=>$.kind==="datetime")}get isDate(){return!!this._def.checks.find(($)=>$.kind==="date")}get isTime(){return!!this._def.checks.find(($)=>$.kind==="time")}get isDuration(){return!!this._def.checks.find(($)=>$.kind==="duration")}get isEmail(){return!!this._def.checks.find(($)=>$.kind==="email")}get isURL(){return!!this._def.checks.find(($)=>$.kind==="url")}get isEmoji(){return!!this._def.checks.find(($)=>$.kind==="emoji")}get isUUID(){return!!this._def.checks.find(($)=>$.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(($)=>$.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(($)=>$.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(($)=>$.kind==="cuid2")}get isULID(){return!!this._def.checks.find(($)=>$.kind==="ulid")}get isIP(){return!!this._def.checks.find(($)=>$.kind==="ip")}get isCIDR(){return!!this._def.checks.find(($)=>$.kind==="cidr")}get isBase64(){return!!this._def.checks.find(($)=>$.kind==="base64")}get isBase64url(){return!!this._def.checks.find(($)=>$.kind==="base64url")}get minLength(){let $=null;for(let I of this._def.checks)if(I.kind==="min"){if($===null||I.value>$)$=I.value}return $}get maxLength(){let $=null;for(let I of this._def.checks)if(I.kind==="max"){if($===null||I.value<$)$=I.value}return $}}y6.create=($)=>{return new y6({checks:[],typeName:F.ZodString,coerce:$?.coerce??!1,...r($)})};function uV($,I){let U=($.toString().split(".")[1]||"").length,D=(I.toString().split(".")[1]||"").length,b=U>D?U:D,w=Number.parseInt($.toFixed(b).replace(".","")),A=Number.parseInt(I.toFixed(b).replace(".",""));return w%A/10**b}class s4 extends t{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse($){if(this._def.coerce)$.data=Number($.data);if(this._getType($)!==j.number){let b=this._getOrReturnCtx($);return S(b,{code:V.invalid_type,expected:j.number,received:b.parsedType}),u}let U=void 0,D=new T$;for(let b of this._def.checks)if(b.kind==="int"){if(!s.isInteger($.data))U=this._getOrReturnCtx($,U),S(U,{code:V.invalid_type,expected:"integer",received:"float",message:b.message}),D.dirty()}else if(b.kind==="min"){if(b.inclusive?$.data<b.value:$.data<=b.value)U=this._getOrReturnCtx($,U),S(U,{code:V.too_small,minimum:b.value,type:"number",inclusive:b.inclusive,exact:!1,message:b.message}),D.dirty()}else if(b.kind==="max"){if(b.inclusive?$.data>b.value:$.data>=b.value)U=this._getOrReturnCtx($,U),S(U,{code:V.too_big,maximum:b.value,type:"number",inclusive:b.inclusive,exact:!1,message:b.message}),D.dirty()}else if(b.kind==="multipleOf"){if(uV($.data,b.value)!==0)U=this._getOrReturnCtx($,U),S(U,{code:V.not_multiple_of,multipleOf:b.value,message:b.message}),D.dirty()}else if(b.kind==="finite"){if(!Number.isFinite($.data))U=this._getOrReturnCtx($,U),S(U,{code:V.not_finite,message:b.message}),D.dirty()}else s.assertNever(b);return{status:D.value,value:$.data}}gte($,I){return this.setLimit("min",$,!0,C.toString(I))}gt($,I){return this.setLimit("min",$,!1,C.toString(I))}lte($,I){return this.setLimit("max",$,!0,C.toString(I))}lt($,I){return this.setLimit("max",$,!1,C.toString(I))}setLimit($,I,U,D){return new s4({...this._def,checks:[...this._def.checks,{kind:$,value:I,inclusive:U,message:C.toString(D)}]})}_addCheck($){return new s4({...this._def,checks:[...this._def.checks,$]})}int($){return this._addCheck({kind:"int",message:C.toString($)})}positive($){return this._addCheck({kind:"min",value:0,inclusive:!1,message:C.toString($)})}negative($){return this._addCheck({kind:"max",value:0,inclusive:!1,message:C.toString($)})}nonpositive($){return this._addCheck({kind:"max",value:0,inclusive:!0,message:C.toString($)})}nonnegative($){return this._addCheck({kind:"min",value:0,inclusive:!0,message:C.toString($)})}multipleOf($,I){return this._addCheck({kind:"multipleOf",value:$,message:C.toString(I)})}finite($){return this._addCheck({kind:"finite",message:C.toString($)})}safe($){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:C.toString($)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:C.toString($)})}get minValue(){let $=null;for(let I of this._def.checks)if(I.kind==="min"){if($===null||I.value>$)$=I.value}return $}get maxValue(){let $=null;for(let I of this._def.checks)if(I.kind==="max"){if($===null||I.value<$)$=I.value}return $}get isInt(){return!!this._def.checks.find(($)=>$.kind==="int"||$.kind==="multipleOf"&&s.isInteger($.value))}get isFinite(){let $=null,I=null;for(let U of this._def.checks)if(U.kind==="finite"||U.kind==="int"||U.kind==="multipleOf")return!0;else if(U.kind==="min"){if(I===null||U.value>I)I=U.value}else if(U.kind==="max"){if($===null||U.value<$)$=U.value}return Number.isFinite(I)&&Number.isFinite($)}}s4.create=($)=>{return new s4({checks:[],typeName:F.ZodNumber,coerce:$?.coerce||!1,...r($)})};class $I extends t{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse($){if(this._def.coerce)try{$.data=BigInt($.data)}catch{return this._getInvalidInput($)}if(this._getType($)!==j.bigint)return this._getInvalidInput($);let U=void 0,D=new T$;for(let b of this._def.checks)if(b.kind==="min"){if(b.inclusive?$.data<b.value:$.data<=b.value)U=this._getOrReturnCtx($,U),S(U,{code:V.too_small,type:"bigint",minimum:b.value,inclusive:b.inclusive,message:b.message}),D.dirty()}else if(b.kind==="max"){if(b.inclusive?$.data>b.value:$.data>=b.value)U=this._getOrReturnCtx($,U),S(U,{code:V.too_big,type:"bigint",maximum:b.value,inclusive:b.inclusive,message:b.message}),D.dirty()}else if(b.kind==="multipleOf"){if($.data%b.value!==BigInt(0))U=this._getOrReturnCtx($,U),S(U,{code:V.not_multiple_of,multipleOf:b.value,message:b.message}),D.dirty()}else s.assertNever(b);return{status:D.value,value:$.data}}_getInvalidInput($){let I=this._getOrReturnCtx($);return S(I,{code:V.invalid_type,expected:j.bigint,received:I.parsedType}),u}gte($,I){return this.setLimit("min",$,!0,C.toString(I))}gt($,I){return this.setLimit("min",$,!1,C.toString(I))}lte($,I){return this.setLimit("max",$,!0,C.toString(I))}lt($,I){return this.setLimit("max",$,!1,C.toString(I))}setLimit($,I,U,D){return new $I({...this._def,checks:[...this._def.checks,{kind:$,value:I,inclusive:U,message:C.toString(D)}]})}_addCheck($){return new $I({...this._def,checks:[...this._def.checks,$]})}positive($){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:C.toString($)})}negative($){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:C.toString($)})}nonpositive($){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:C.toString($)})}nonnegative($){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:C.toString($)})}multipleOf($,I){return this._addCheck({kind:"multipleOf",value:$,message:C.toString(I)})}get minValue(){let $=null;for(let I of this._def.checks)if(I.kind==="min"){if($===null||I.value>$)$=I.value}return $}get maxValue(){let $=null;for(let I of this._def.checks)if(I.kind==="max"){if($===null||I.value<$)$=I.value}return $}}$I.create=($)=>{return new $I({checks:[],typeName:F.ZodBigInt,coerce:$?.coerce??!1,...r($)})};class eb extends t{_parse($){if(this._def.coerce)$.data=Boolean($.data);if(this._getType($)!==j.boolean){let U=this._getOrReturnCtx($);return S(U,{code:V.invalid_type,expected:j.boolean,received:U.parsedType}),u}return Z$($.data)}}eb.create=($)=>{return new eb({typeName:F.ZodBoolean,coerce:$?.coerce||!1,...r($)})};class V1 extends t{_parse($){if(this._def.coerce)$.data=new Date($.data);if(this._getType($)!==j.date){let b=this._getOrReturnCtx($);return S(b,{code:V.invalid_type,expected:j.date,received:b.parsedType}),u}if(Number.isNaN($.data.getTime())){let b=this._getOrReturnCtx($);return S(b,{code:V.invalid_date}),u}let U=new T$,D=void 0;for(let b of this._def.checks)if(b.kind==="min"){if($.data.getTime()<b.value)D=this._getOrReturnCtx($,D),S(D,{code:V.too_small,message:b.message,inclusive:!0,exact:!1,minimum:b.value,type:"date"}),U.dirty()}else if(b.kind==="max"){if($.data.getTime()>b.value)D=this._getOrReturnCtx($,D),S(D,{code:V.too_big,message:b.message,inclusive:!0,exact:!1,maximum:b.value,type:"date"}),U.dirty()}else s.assertNever(b);return{status:U.value,value:new Date($.data.getTime())}}_addCheck($){return new V1({...this._def,checks:[...this._def.checks,$]})}min($,I){return this._addCheck({kind:"min",value:$.getTime(),message:C.toString(I)})}max($,I){return this._addCheck({kind:"max",value:$.getTime(),message:C.toString(I)})}get minDate(){let $=null;for(let I of this._def.checks)if(I.kind==="min"){if($===null||I.value>$)$=I.value}return $!=null?new Date($):null}get maxDate(){let $=null;for(let I of this._def.checks)if(I.kind==="max"){if($===null||I.value<$)$=I.value}return $!=null?new Date($):null}}V1.create=($)=>{return new V1({checks:[],coerce:$?.coerce||!1,typeName:F.ZodDate,...r($)})};class sb extends t{_parse($){if(this._getType($)!==j.symbol){let U=this._getOrReturnCtx($);return S(U,{code:V.invalid_type,expected:j.symbol,received:U.parsedType}),u}return Z$($.data)}}sb.create=($)=>{return new sb({typeName:F.ZodSymbol,...r($)})};class M1 extends t{_parse($){if(this._getType($)!==j.undefined){let U=this._getOrReturnCtx($);return S(U,{code:V.invalid_type,expected:j.undefined,received:U.parsedType}),u}return Z$($.data)}}M1.create=($)=>{return new M1({typeName:F.ZodUndefined,...r($)})};class K1 extends t{_parse($){if(this._getType($)!==j.null){let U=this._getOrReturnCtx($);return S(U,{code:V.invalid_type,expected:j.null,received:U.parsedType}),u}return Z$($.data)}}K1.create=($)=>{return new K1({typeName:F.ZodNull,...r($)})};class $D extends t{constructor(){super(...arguments);this._any=!0}_parse($){return Z$($.data)}}$D.create=($)=>{return new $D({typeName:F.ZodAny,...r($)})};class S4 extends t{constructor(){super(...arguments);this._unknown=!0}_parse($){return Z$($.data)}}S4.create=($)=>{return new S4({typeName:F.ZodUnknown,...r($)})};class x6 extends t{_parse($){let I=this._getOrReturnCtx($);return S(I,{code:V.invalid_type,expected:j.never,received:I.parsedType}),u}}x6.create=($)=>{return new x6({typeName:F.ZodNever,...r($)})};class ID extends t{_parse($){if(this._getType($)!==j.undefined){let U=this._getOrReturnCtx($);return S(U,{code:V.invalid_type,expected:j.void,received:U.parsedType}),u}return Z$($.data)}}ID.create=($)=>{return new ID({typeName:F.ZodVoid,...r($)})};class V6 extends t{_parse($){let{ctx:I,status:U}=this._processInputParams($),D=this._def;if(I.parsedType!==j.array)return S(I,{code:V.invalid_type,expected:j.array,received:I.parsedType}),u;if(D.exactLength!==null){let w=I.data.length>D.exactLength.value,A=I.data.length<D.exactLength.value;if(w||A)S(I,{code:w?V.too_big:V.too_small,minimum:A?D.exactLength.value:void 0,maximum:w?D.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:D.exactLength.message}),U.dirty()}if(D.minLength!==null){if(I.data.length<D.minLength.value)S(I,{code:V.too_small,minimum:D.minLength.value,type:"array",inclusive:!0,exact:!1,message:D.minLength.message}),U.dirty()}if(D.maxLength!==null){if(I.data.length>D.maxLength.value)S(I,{code:V.too_big,maximum:D.maxLength.value,type:"array",inclusive:!0,exact:!1,message:D.maxLength.message}),U.dirty()}if(I.common.async)return Promise.all([...I.data].map((w,A)=>{return D.type._parseAsync(new w6(I,w,I.path,A))})).then((w)=>{return T$.mergeArray(U,w)});let b=[...I.data].map((w,A)=>{return D.type._parseSync(new w6(I,w,I.path,A))});return T$.mergeArray(U,b)}get element(){return this._def.type}min($,I){return new V6({...this._def,minLength:{value:$,message:C.toString(I)}})}max($,I){return new V6({...this._def,maxLength:{value:$,message:C.toString(I)}})}length($,I){return new V6({...this._def,exactLength:{value:$,message:C.toString(I)}})}nonempty($){return this.min(1,$)}}V6.create=($,I)=>{return new V6({type:$,minLength:null,maxLength:null,exactLength:null,typeName:F.ZodArray,...r(I)})};function e4($){if($ instanceof L$){let I={};for(let U in $.shape){let D=$.shape[U];I[U]=M6.create(e4(D))}return new L$({...$._def,shape:()=>I})}else if($ instanceof V6)return new V6({...$._def,type:e4($.element)});else if($ instanceof M6)return M6.create(e4($.unwrap()));else if($ instanceof t6)return t6.create(e4($.unwrap()));else if($ instanceof l6)return l6.create($.items.map((I)=>e4(I)));else return $}class L$ extends t{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let $=this._def.shape(),I=s.objectKeys($);return this._cached={shape:$,keys:I},this._cached}_parse($){if(this._getType($)!==j.object){let O=this._getOrReturnCtx($);return S(O,{code:V.invalid_type,expected:j.object,received:O.parsedType}),u}let{status:U,ctx:D}=this._processInputParams($),{shape:b,keys:w}=this._getCached(),A=[];if(!(this._def.catchall instanceof x6&&this._def.unknownKeys==="strip")){for(let O in D.data)if(!w.includes(O))A.push(O)}let N=[];for(let O of w){let X=b[O],G=D.data[O];N.push({key:{status:"valid",value:O},value:X._parse(new w6(D,G,D.path,O)),alwaysSet:O in D.data})}if(this._def.catchall instanceof x6){let O=this._def.unknownKeys;if(O==="passthrough")for(let X of A)N.push({key:{status:"valid",value:X},value:{status:"valid",value:D.data[X]}});else if(O==="strict"){if(A.length>0)S(D,{code:V.unrecognized_keys,keys:A}),U.dirty()}else if(O==="strip");else throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let O=this._def.catchall;for(let X of A){let G=D.data[X];N.push({key:{status:"valid",value:X},value:O._parse(new w6(D,G,D.path,X)),alwaysSet:X in D.data})}}if(D.common.async)return Promise.resolve().then(async()=>{let O=[];for(let X of N){let G=await X.key,Q=await X.value;O.push({key:G,value:Q,alwaysSet:X.alwaysSet})}return O}).then((O)=>{return T$.mergeObjectSync(U,O)});else return T$.mergeObjectSync(U,N)}get shape(){return this._def.shape()}strict($){return C.errToObj,new L$({...this._def,unknownKeys:"strict",...$!==void 0?{errorMap:(I,U)=>{let D=this._def.errorMap?.(I,U).message??U.defaultError;if(I.code==="unrecognized_keys")return{message:C.errToObj($).message??D};return{message:D}}}:{}})}strip(){return new L$({...this._def,unknownKeys:"strip"})}passthrough(){return new L$({...this._def,unknownKeys:"passthrough"})}extend($){return new L$({...this._def,shape:()=>({...this._def.shape(),...$})})}merge($){return new L$({unknownKeys:$._def.unknownKeys,catchall:$._def.catchall,shape:()=>({...this._def.shape(),...$._def.shape()}),typeName:F.ZodObject})}setKey($,I){return this.augment({[$]:I})}catchall($){return new L$({...this._def,catchall:$})}pick($){let I={};for(let U of s.objectKeys($))if($[U]&&this.shape[U])I[U]=this.shape[U];return new L$({...this._def,shape:()=>I})}omit($){let I={};for(let U of s.objectKeys(this.shape))if(!$[U])I[U]=this.shape[U];return new L$({...this._def,shape:()=>I})}deepPartial(){return e4(this)}partial($){let I={};for(let U of s.objectKeys(this.shape)){let D=this.shape[U];if($&&!$[U])I[U]=D;else I[U]=D.optional()}return new L$({...this._def,shape:()=>I})}required($){let I={};for(let U of s.objectKeys(this.shape))if($&&!$[U])I[U]=this.shape[U];else{let b=this.shape[U];while(b instanceof M6)b=b._def.innerType;I[U]=b}return new L$({...this._def,shape:()=>I})}keyof(){return RY(s.objectKeys(this.shape))}}L$.create=($,I)=>{return new L$({shape:()=>$,unknownKeys:"strip",catchall:x6.create(),typeName:F.ZodObject,...r(I)})};L$.strictCreate=($,I)=>{return new L$({shape:()=>$,unknownKeys:"strict",catchall:x6.create(),typeName:F.ZodObject,...r(I)})};L$.lazycreate=($,I)=>{return new L$({shape:$,unknownKeys:"strip",catchall:x6.create(),typeName:F.ZodObject,...r(I)})};class F1 extends t{_parse($){let{ctx:I}=this._processInputParams($),U=this._def.options;function D(b){for(let A of b)if(A.result.status==="valid")return A.result;for(let A of b)if(A.result.status==="dirty")return I.common.issues.push(...A.ctx.common.issues),A.result;let w=b.map((A)=>new d$(A.ctx.common.issues));return S(I,{code:V.invalid_union,unionErrors:w}),u}if(I.common.async)return Promise.all(U.map(async(b)=>{let w={...I,common:{...I.common,issues:[]},parent:null};return{result:await b._parseAsync({data:I.data,path:I.path,parent:w}),ctx:w}})).then(D);else{let b=void 0,w=[];for(let N of U){let O={...I,common:{...I.common,issues:[]},parent:null},X=N._parseSync({data:I.data,path:I.path,parent:O});if(X.status==="valid")return X;else if(X.status==="dirty"&&!b)b={result:X,ctx:O};if(O.common.issues.length)w.push(O.common.issues)}if(b)return I.common.issues.push(...b.ctx.common.issues),b.result;let A=w.map((N)=>new d$(N));return S(I,{code:V.invalid_union,unionErrors:A}),u}}get options(){return this._def.options}}F1.create=($,I)=>{return new F1({options:$,typeName:F.ZodUnion,...r(I)})};var g6=($)=>{if($ instanceof k1)return g6($.schema);else if($ instanceof K6)return g6($.innerType());else if($ instanceof E1)return[$.value];else if($ instanceof P4)return $.options;else if($ instanceof j1)return s.objectValues($.enum);else if($ instanceof S1)return g6($._def.innerType);else if($ instanceof M1)return[void 0];else if($ instanceof K1)return[null];else if($ instanceof M6)return[void 0,...g6($.unwrap())];else if($ instanceof t6)return[null,...g6($.unwrap())];else if($ instanceof xN)return g6($.unwrap());else if($ instanceof R1)return g6($.unwrap());else if($ instanceof P1)return g6($._def.innerType);else return[]};class yN extends t{_parse($){let{ctx:I}=this._processInputParams($);if(I.parsedType!==j.object)return S(I,{code:V.invalid_type,expected:j.object,received:I.parsedType}),u;let U=this.discriminator,D=I.data[U],b=this.optionsMap.get(D);if(!b)return S(I,{code:V.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[U]}),u;if(I.common.async)return b._parseAsync({data:I.data,path:I.path,parent:I});else return b._parseSync({data:I.data,path:I.path,parent:I})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create($,I,U){let D=new Map;for(let b of I){let w=g6(b.shape[$]);if(!w.length)throw new Error(`A discriminator value for key \`${$}\` could not be extracted from all schema options`);for(let A of w){if(D.has(A))throw new Error(`Discriminator property ${String($)} has duplicate value ${String(A)}`);D.set(A,b)}}return new yN({typeName:F.ZodDiscriminatedUnion,discriminator:$,options:I,optionsMap:D,...r(U)})}}function gN($,I){let U=f6($),D=f6(I);if($===I)return{valid:!0,data:$};else if(U===j.object&&D===j.object){let b=s.objectKeys(I),w=s.objectKeys($).filter((N)=>b.indexOf(N)!==-1),A={...$,...I};for(let N of w){let O=gN($[N],I[N]);if(!O.valid)return{valid:!1};A[N]=O.data}return{valid:!0,data:A}}else if(U===j.array&&D===j.array){if($.length!==I.length)return{valid:!1};let b=[];for(let w=0;w<$.length;w++){let A=$[w],N=I[w],O=gN(A,N);if(!O.valid)return{valid:!1};b.push(O.data)}return{valid:!0,data:b}}else if(U===j.date&&D===j.date&&+$===+I)return{valid:!0,data:$};else return{valid:!1}}class q1 extends t{_parse($){let{status:I,ctx:U}=this._processInputParams($),D=(b,w)=>{if(CN(b)||CN(w))return u;let A=gN(b.value,w.value);if(!A.valid)return S(U,{code:V.invalid_intersection_types}),u;if(ZN(b)||ZN(w))I.dirty();return{status:I.value,value:A.data}};if(U.common.async)return Promise.all([this._def.left._parseAsync({data:U.data,path:U.path,parent:U}),this._def.right._parseAsync({data:U.data,path:U.path,parent:U})]).then(([b,w])=>D(b,w));else return D(this._def.left._parseSync({data:U.data,path:U.path,parent:U}),this._def.right._parseSync({data:U.data,path:U.path,parent:U}))}}q1.create=($,I,U)=>{return new q1({left:$,right:I,typeName:F.ZodIntersection,...r(U)})};class l6 extends t{_parse($){let{status:I,ctx:U}=this._processInputParams($);if(U.parsedType!==j.array)return S(U,{code:V.invalid_type,expected:j.array,received:U.parsedType}),u;if(U.data.length<this._def.items.length)return S(U,{code:V.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),u;if(!this._def.rest&&U.data.length>this._def.items.length)S(U,{code:V.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),I.dirty();let b=[...U.data].map((w,A)=>{let N=this._def.items[A]||this._def.rest;if(!N)return null;return N._parse(new w6(U,w,U.path,A))}).filter((w)=>!!w);if(U.common.async)return Promise.all(b).then((w)=>{return T$.mergeArray(I,w)});else return T$.mergeArray(I,b)}get items(){return this._def.items}rest($){return new l6({...this._def,rest:$})}}l6.create=($,I)=>{if(!Array.isArray($))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new l6({items:$,typeName:F.ZodTuple,rest:null,...r(I)})};class UD extends t{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse($){let{status:I,ctx:U}=this._processInputParams($);if(U.parsedType!==j.object)return S(U,{code:V.invalid_type,expected:j.object,received:U.parsedType}),u;let D=[],b=this._def.keyType,w=this._def.valueType;for(let A in U.data)D.push({key:b._parse(new w6(U,A,U.path,A)),value:w._parse(new w6(U,U.data[A],U.path,A)),alwaysSet:A in U.data});if(U.common.async)return T$.mergeObjectAsync(I,D);else return T$.mergeObjectSync(I,D)}get element(){return this._def.valueType}static create($,I,U){if(I instanceof t)return new UD({keyType:$,valueType:I,typeName:F.ZodRecord,...r(U)});return new UD({keyType:y6.create(),valueType:$,typeName:F.ZodRecord,...r(I)})}}class bD extends t{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse($){let{status:I,ctx:U}=this._processInputParams($);if(U.parsedType!==j.map)return S(U,{code:V.invalid_type,expected:j.map,received:U.parsedType}),u;let D=this._def.keyType,b=this._def.valueType,w=[...U.data.entries()].map(([A,N],O)=>{return{key:D._parse(new w6(U,A,U.path,[O,"key"])),value:b._parse(new w6(U,N,U.path,[O,"value"]))}});if(U.common.async){let A=new Map;return Promise.resolve().then(async()=>{for(let N of w){let O=await N.key,X=await N.value;if(O.status==="aborted"||X.status==="aborted")return u;if(O.status==="dirty"||X.status==="dirty")I.dirty();A.set(O.value,X.value)}return{status:I.value,value:A}})}else{let A=new Map;for(let N of w){let{key:O,value:X}=N;if(O.status==="aborted"||X.status==="aborted")return u;if(O.status==="dirty"||X.status==="dirty")I.dirty();A.set(O.value,X.value)}return{status:I.value,value:A}}}}bD.create=($,I,U)=>{return new bD({valueType:I,keyType:$,typeName:F.ZodMap,...r(U)})};class II extends t{_parse($){let{status:I,ctx:U}=this._processInputParams($);if(U.parsedType!==j.set)return S(U,{code:V.invalid_type,expected:j.set,received:U.parsedType}),u;let D=this._def;if(D.minSize!==null){if(U.data.size<D.minSize.value)S(U,{code:V.too_small,minimum:D.minSize.value,type:"set",inclusive:!0,exact:!1,message:D.minSize.message}),I.dirty()}if(D.maxSize!==null){if(U.data.size>D.maxSize.value)S(U,{code:V.too_big,maximum:D.maxSize.value,type:"set",inclusive:!0,exact:!1,message:D.maxSize.message}),I.dirty()}let b=this._def.valueType;function w(N){let O=new Set;for(let X of N){if(X.status==="aborted")return u;if(X.status==="dirty")I.dirty();O.add(X.value)}return{status:I.value,value:O}}let A=[...U.data.values()].map((N,O)=>b._parse(new w6(U,N,U.path,O)));if(U.common.async)return Promise.all(A).then((N)=>w(N));else return w(A)}min($,I){return new II({...this._def,minSize:{value:$,message:C.toString(I)}})}max($,I){return new II({...this._def,maxSize:{value:$,message:C.toString(I)}})}size($,I){return this.min($,I).max($,I)}nonempty($){return this.min(1,$)}}II.create=($,I)=>{return new II({valueType:$,minSize:null,maxSize:null,typeName:F.ZodSet,...r(I)})};class z1 extends t{constructor(){super(...arguments);this.validate=this.implement}_parse($){let{ctx:I}=this._processInputParams($);if(I.parsedType!==j.function)return S(I,{code:V.invalid_type,expected:j.function,received:I.parsedType}),u;function U(A,N){return ab({data:A,path:I.path,errorMaps:[I.common.contextualErrorMap,I.schemaErrorMap,H1(),p6].filter((O)=>!!O),issueData:{code:V.invalid_arguments,argumentsError:N}})}function D(A,N){return ab({data:A,path:I.path,errorMaps:[I.common.contextualErrorMap,I.schemaErrorMap,H1(),p6].filter((O)=>!!O),issueData:{code:V.invalid_return_type,returnTypeError:N}})}let b={errorMap:I.common.contextualErrorMap},w=I.data;if(this._def.returns instanceof UI){let A=this;return Z$(async function(...N){let O=new d$([]),X=await A._def.args.parseAsync(N,b).catch((Y)=>{throw O.addIssue(U(N,Y)),O}),G=await Reflect.apply(w,this,X);return await A._def.returns._def.type.parseAsync(G,b).catch((Y)=>{throw O.addIssue(D(G,Y)),O})})}else{let A=this;return Z$(function(...N){let O=A._def.args.safeParse(N,b);if(!O.success)throw new d$([U(N,O.error)]);let X=Reflect.apply(w,this,O.data),G=A._def.returns.safeParse(X,b);if(!G.success)throw new d$([D(X,G.error)]);return G.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...$){return new z1({...this._def,args:l6.create($).rest(S4.create())})}returns($){return new z1({...this._def,returns:$})}implement($){return this.parse($)}strictImplement($){return this.parse($)}static create($,I,U){return new z1({args:$?$:l6.create([]).rest(S4.create()),returns:I||S4.create(),typeName:F.ZodFunction,...r(U)})}}class k1 extends t{get schema(){return this._def.getter()}_parse($){let{ctx:I}=this._processInputParams($);return this._def.getter()._parse({data:I.data,path:I.path,parent:I})}}k1.create=($,I)=>{return new k1({getter:$,typeName:F.ZodLazy,...r(I)})};class E1 extends t{_parse($){if($.data!==this._def.value){let I=this._getOrReturnCtx($);return S(I,{received:I.data,code:V.invalid_literal,expected:this._def.value}),u}return{status:"valid",value:$.data}}get value(){return this._def.value}}E1.create=($,I)=>{return new E1({value:$,typeName:F.ZodLiteral,...r(I)})};function RY($,I){return new P4({values:$,typeName:F.ZodEnum,...r(I)})}class P4 extends t{_parse($){if(typeof $.data!=="string"){let I=this._getOrReturnCtx($),U=this._def.values;return S(I,{expected:s.joinValues(U),received:I.parsedType,code:V.invalid_type}),u}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has($.data)){let I=this._getOrReturnCtx($),U=this._def.values;return S(I,{received:I.data,code:V.invalid_enum_value,options:U}),u}return Z$($.data)}get options(){return this._def.values}get enum(){let $={};for(let I of this._def.values)$[I]=I;return $}get Values(){let $={};for(let I of this._def.values)$[I]=I;return $}get Enum(){let $={};for(let I of this._def.values)$[I]=I;return $}extract($,I=this._def){return P4.create($,{...this._def,...I})}exclude($,I=this._def){return P4.create(this.options.filter((U)=>!$.includes(U)),{...this._def,...I})}}P4.create=RY;class j1 extends t{_parse($){let I=s.getValidEnumValues(this._def.values),U=this._getOrReturnCtx($);if(U.parsedType!==j.string&&U.parsedType!==j.number){let D=s.objectValues(I);return S(U,{expected:s.joinValues(D),received:U.parsedType,code:V.invalid_type}),u}if(!this._cache)this._cache=new Set(s.getValidEnumValues(this._def.values));if(!this._cache.has($.data)){let D=s.objectValues(I);return S(U,{received:U.data,code:V.invalid_enum_value,options:D}),u}return Z$($.data)}get enum(){return this._def.values}}j1.create=($,I)=>{return new j1({values:$,typeName:F.ZodNativeEnum,...r(I)})};class UI extends t{unwrap(){return this._def.type}_parse($){let{ctx:I}=this._processInputParams($);if(I.parsedType!==j.promise&&I.common.async===!1)return S(I,{code:V.invalid_type,expected:j.promise,received:I.parsedType}),u;let U=I.parsedType===j.promise?I.data:Promise.resolve(I.data);return Z$(U.then((D)=>{return this._def.type.parseAsync(D,{path:I.path,errorMap:I.common.contextualErrorMap})}))}}UI.create=($,I)=>{return new UI({type:$,typeName:F.ZodPromise,...r(I)})};class K6 extends t{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===F.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse($){let{status:I,ctx:U}=this._processInputParams($),D=this._def.effect||null,b={addIssue:(w)=>{if(S(U,w),w.fatal)I.abort();else I.dirty()},get path(){return U.path}};if(b.addIssue=b.addIssue.bind(b),D.type==="preprocess"){let w=D.transform(U.data,b);if(U.common.async)return Promise.resolve(w).then(async(A)=>{if(I.value==="aborted")return u;let N=await this._def.schema._parseAsync({data:A,path:U.path,parent:U});if(N.status==="aborted")return u;if(N.status==="dirty")return a4(N.value);if(I.value==="dirty")return a4(N.value);return N});else{if(I.value==="aborted")return u;let A=this._def.schema._parseSync({data:w,path:U.path,parent:U});if(A.status==="aborted")return u;if(A.status==="dirty")return a4(A.value);if(I.value==="dirty")return a4(A.value);return A}}if(D.type==="refinement"){let w=(A)=>{let N=D.refinement(A,b);if(U.common.async)return Promise.resolve(N);if(N instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return A};if(U.common.async===!1){let A=this._def.schema._parseSync({data:U.data,path:U.path,parent:U});if(A.status==="aborted")return u;if(A.status==="dirty")I.dirty();return w(A.value),{status:I.value,value:A.value}}else return this._def.schema._parseAsync({data:U.data,path:U.path,parent:U}).then((A)=>{if(A.status==="aborted")return u;if(A.status==="dirty")I.dirty();return w(A.value).then(()=>{return{status:I.value,value:A.value}})})}if(D.type==="transform")if(U.common.async===!1){let w=this._def.schema._parseSync({data:U.data,path:U.path,parent:U});if(!j4(w))return u;let A=D.transform(w.value,b);if(A instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:I.value,value:A}}else return this._def.schema._parseAsync({data:U.data,path:U.path,parent:U}).then((w)=>{if(!j4(w))return u;return Promise.resolve(D.transform(w.value,b)).then((A)=>({status:I.value,value:A}))});s.assertNever(D)}}K6.create=($,I,U)=>{return new K6({schema:$,typeName:F.ZodEffects,effect:I,...r(U)})};K6.createWithPreprocess=($,I,U)=>{return new K6({schema:I,effect:{type:"preprocess",transform:$},typeName:F.ZodEffects,...r(U)})};class M6 extends t{_parse($){if(this._getType($)===j.undefined)return Z$(void 0);return this._def.innerType._parse($)}unwrap(){return this._def.innerType}}M6.create=($,I)=>{return new M6({innerType:$,typeName:F.ZodOptional,...r(I)})};class t6 extends t{_parse($){if(this._getType($)===j.null)return Z$(null);return this._def.innerType._parse($)}unwrap(){return this._def.innerType}}t6.create=($,I)=>{return new t6({innerType:$,typeName:F.ZodNullable,...r(I)})};class S1 extends t{_parse($){let{ctx:I}=this._processInputParams($),U=I.data;if(I.parsedType===j.undefined)U=this._def.defaultValue();return this._def.innerType._parse({data:U,path:I.path,parent:I})}removeDefault(){return this._def.innerType}}S1.create=($,I)=>{return new S1({innerType:$,typeName:F.ZodDefault,defaultValue:typeof I.default==="function"?I.default:()=>I.default,...r(I)})};class P1 extends t{_parse($){let{ctx:I}=this._processInputParams($),U={...I,common:{...I.common,issues:[]}},D=this._def.innerType._parse({data:U.data,path:U.path,parent:{...U}});if(L1(D))return D.then((b)=>{return{status:"valid",value:b.status==="valid"?b.value:this._def.catchValue({get error(){return new d$(U.common.issues)},input:U.data})}});else return{status:"valid",value:D.status==="valid"?D.value:this._def.catchValue({get error(){return new d$(U.common.issues)},input:U.data})}}removeCatch(){return this._def.innerType}}P1.create=($,I)=>{return new P1({innerType:$,typeName:F.ZodCatch,catchValue:typeof I.catch==="function"?I.catch:()=>I.catch,...r(I)})};class DD extends t{_parse($){if(this._getType($)!==j.nan){let U=this._getOrReturnCtx($);return S(U,{code:V.invalid_type,expected:j.nan,received:U.parsedType}),u}return{status:"valid",value:$.data}}}DD.create=($)=>{return new DD({typeName:F.ZodNaN,...r($)})};var xZ=Symbol("zod_brand");class xN extends t{_parse($){let{ctx:I}=this._processInputParams($),U=I.data;return this._def.type._parse({data:U,path:I.path,parent:I})}unwrap(){return this._def.type}}class wD extends t{_parse($){let{status:I,ctx:U}=this._processInputParams($);if(U.common.async)return(async()=>{let b=await this._def.in._parseAsync({data:U.data,path:U.path,parent:U});if(b.status==="aborted")return u;if(b.status==="dirty")return I.dirty(),a4(b.value);else return this._def.out._parseAsync({data:b.value,path:U.path,parent:U})})();else{let D=this._def.in._parseSync({data:U.data,path:U.path,parent:U});if(D.status==="aborted")return u;if(D.status==="dirty")return I.dirty(),{status:"dirty",value:D.value};else return this._def.out._parseSync({data:D.value,path:U.path,parent:U})}}static create($,I){return new wD({in:$,out:I,typeName:F.ZodPipeline})}}class R1 extends t{_parse($){let I=this._def.innerType._parse($),U=(D)=>{if(j4(D))D.value=Object.freeze(D.value);return D};return L1(I)?I.then((D)=>U(D)):U(I)}unwrap(){return this._def.innerType}}R1.create=($,I)=>{return new R1({innerType:$,typeName:F.ZodReadonly,...r(I)})};var lZ={object:L$.lazycreate},F;(function($){$.ZodString="ZodString",$.ZodNumber="ZodNumber",$.ZodNaN="ZodNaN",$.ZodBigInt="ZodBigInt",$.ZodBoolean="ZodBoolean",$.ZodDate="ZodDate",$.ZodSymbol="ZodSymbol",$.ZodUndefined="ZodUndefined",$.ZodNull="ZodNull",$.ZodAny="ZodAny",$.ZodUnknown="ZodUnknown",$.ZodNever="ZodNever",$.ZodVoid="ZodVoid",$.ZodArray="ZodArray",$.ZodObject="ZodObject",$.ZodUnion="ZodUnion",$.ZodDiscriminatedUnion="ZodDiscriminatedUnion",$.ZodIntersection="ZodIntersection",$.ZodTuple="ZodTuple",$.ZodRecord="ZodRecord",$.ZodMap="ZodMap",$.ZodSet="ZodSet",$.ZodFunction="ZodFunction",$.ZodLazy="ZodLazy",$.ZodLiteral="ZodLiteral",$.ZodEnum="ZodEnum",$.ZodEffects="ZodEffects",$.ZodNativeEnum="ZodNativeEnum",$.ZodOptional="ZodOptional",$.ZodNullable="ZodNullable",$.ZodDefault="ZodDefault",$.ZodCatch="ZodCatch",$.ZodPromise="ZodPromise",$.ZodBranded="ZodBranded",$.ZodPipeline="ZodPipeline",$.ZodReadonly="ZodReadonly"})(F||(F={}));var hZ=y6.create,uZ=s4.create,iZ=DD.create,nZ=$I.create,cZ=eb.create,rZ=V1.create,mZ=sb.create,oZ=M1.create,dZ=K1.create,pZ=$D.create,tZ=S4.create,aZ=x6.create,eZ=ID.create,sZ=V6.create,TY=L$.create,$f=L$.strictCreate,If=F1.create,Uf=yN.create,bf=q1.create,Df=l6.create,wf=UD.create,Af=bD.create,Nf=II.create,Of=z1.create,Xf=k1.create,Wf=E1.create,Gf=P4.create,Qf=j1.create,Yf=UI.create,Bf=K6.create,vf=M6.create,Jf=t6.create,Hf=K6.createWithPreprocess,Lf=wD.create;var N6={};Z6(N6,{version:()=>rO,util:()=>M,treeifyError:()=>tN,toJSONSchema:()=>l4,toDotPath:()=>yY,safeParseAsync:()=>b4,safeParse:()=>U4,safeEncodeAsync:()=>cY,safeEncode:()=>iY,safeDecodeAsync:()=>rY,safeDecode:()=>nY,registry:()=>P0,regexes:()=>t$,process:()=>N$,prettifyError:()=>aN,parseAsync:()=>C4,parse:()=>_4,meta:()=>Nw,locales:()=>BI,isValidJWT:()=>WB,isValidBase64URL:()=>XB,isValidBase64:()=>aO,initializeContext:()=>N4,globalRegistry:()=>f$,globalConfig:()=>T1,formatError:()=>h1,flattenError:()=>l1,finalize:()=>X4,extractDefs:()=>O4,encodeAsync:()=>hY,encode:()=>xY,describe:()=>Aw,decodeAsync:()=>uY,decode:()=>lY,createToJSONSchemaMethod:()=>bW,createStandardJSONSchemaMethod:()=>RI,config:()=>z$,clone:()=>k$,_xor:()=>iK,_xid:()=>NU,_void:()=>d0,_uuidv7:()=>IU,_uuidv6:()=>$U,_uuidv4:()=>s1,_uuid:()=>e1,_url:()=>JI,_uppercase:()=>VI,_unknown:()=>m0,_union:()=>uK,_undefined:()=>n0,_ulid:()=>AU,_uint64:()=>u0,_uint32:()=>y0,_tuple:()=>rK,_trim:()=>EI,_transform:()=>eK,_toUpperCase:()=>SI,_toLowerCase:()=>jI,_templateLiteral:()=>NF,_symbol:()=>i0,_superRefine:()=>ww,_success:()=>bF,_stringbool:()=>Ow,_stringFormat:()=>x4,_string:()=>R0,_startsWith:()=>KI,_slugify:()=>PI,_size:()=>HI,_set:()=>dK,_safeParseAsync:()=>XI,_safeParse:()=>OI,_safeEncodeAsync:()=>BD,_safeEncode:()=>QD,_safeDecodeAsync:()=>vD,_safeDecode:()=>YD,_regex:()=>LI,_refine:()=>Dw,_record:()=>mK,_readonly:()=>AF,_property:()=>Iw,_promise:()=>XF,_positive:()=>a0,_pipe:()=>wF,_parseAsync:()=>NI,_parse:()=>AI,_overwrite:()=>A6,_optional:()=>sK,_number:()=>_0,_nullable:()=>$F,_null:()=>c0,_normalize:()=>kI,_nonpositive:()=>s0,_nonoptional:()=>UF,_nonnegative:()=>$w,_never:()=>o0,_negative:()=>e0,_nativeEnum:()=>tK,_nanoid:()=>bU,_nan:()=>t0,_multipleOf:()=>w4,_minSize:()=>A4,_minLength:()=>h6,_min:()=>g$,_mime:()=>qI,_maxSize:()=>f4,_maxLength:()=>g4,_max:()=>a$,_map:()=>oK,_mac:()=>T0,_lte:()=>a$,_lt:()=>q6,_lowercase:()=>zI,_literal:()=>aK,_length:()=>y4,_lazy:()=>OF,_ksuid:()=>OU,_jwt:()=>JU,_isoTime:()=>tX,_isoDuration:()=>aX,_isoDateTime:()=>dX,_isoDate:()=>pX,_ipv6:()=>WU,_ipv4:()=>XU,_intersection:()=>cK,_int64:()=>h0,_int32:()=>g0,_int:()=>C0,_includes:()=>MI,_guid:()=>vI,_gte:()=>g$,_gt:()=>k6,_float64:()=>f0,_float32:()=>Z0,_file:()=>Uw,_enum:()=>pK,_endsWith:()=>FI,_encodeAsync:()=>WD,_encode:()=>OD,_emoji:()=>UU,_email:()=>a1,_e164:()=>vU,_discriminatedUnion:()=>nK,_default:()=>IF,_decodeAsync:()=>GD,_decode:()=>XD,_date:()=>p0,_custom:()=>bw,_cuid2:()=>wU,_cuid:()=>DU,_coercedString:()=>mX,_coercedNumber:()=>eX,_coercedDate:()=>IW,_coercedBoolean:()=>sX,_coercedBigint:()=>$W,_cidrv6:()=>QU,_cidrv4:()=>GU,_check:()=>HB,_catch:()=>DF,_boolean:()=>x0,_bigint:()=>l0,_base64url:()=>BU,_base64:()=>YU,_array:()=>UW,_any:()=>r0,TimePrecision:()=>oX,NEVER:()=>lN,JSONSchemaGenerator:()=>iW,JSONSchema:()=>LB,Doc:()=>zD,$output:()=>nX,$input:()=>cX,$constructor:()=>v,$brand:()=>hN,$ZodXor:()=>D0,$ZodXID:()=>ZD,$ZodVoid:()=>$0,$ZodUnknown:()=>eD,$ZodUnion:()=>QI,$ZodUndefined:()=>pD,$ZodUUID:()=>ED,$ZodURL:()=>SD,$ZodULID:()=>CD,$ZodType:()=>n,$ZodTuple:()=>r1,$ZodTransform:()=>Y0,$ZodTemplateLiteral:()=>q0,$ZodSymbol:()=>dD,$ZodSuccess:()=>z0,$ZodStringFormat:()=>A$,$ZodString:()=>D4,$ZodSet:()=>X0,$ZodRegistry:()=>rX,$ZodRecord:()=>N0,$ZodRealError:()=>i$,$ZodReadonly:()=>F0,$ZodPromise:()=>E0,$ZodPrefault:()=>H0,$ZodPipe:()=>K0,$ZodOptional:()=>B0,$ZodObjectJIT:()=>eO,$ZodObject:()=>b0,$ZodNumberFormat:()=>mD,$ZodNumber:()=>n1,$ZodNullable:()=>v0,$ZodNull:()=>tD,$ZodNonOptional:()=>L0,$ZodNever:()=>sD,$ZodNanoID:()=>RD,$ZodNaN:()=>M0,$ZodMap:()=>O0,$ZodMAC:()=>xD,$ZodLiteral:()=>G0,$ZodLazy:()=>j0,$ZodKSUID:()=>fD,$ZodJWT:()=>cD,$ZodIntersection:()=>A0,$ZodISOTime:()=>pO,$ZodISODuration:()=>tO,$ZodISODateTime:()=>oO,$ZodISODate:()=>dO,$ZodIPv6:()=>yD,$ZodIPv4:()=>gD,$ZodGUID:()=>kD,$ZodFunction:()=>k0,$ZodFile:()=>Q0,$ZodError:()=>x1,$ZodEnum:()=>W0,$ZodEncodeError:()=>R4,$ZodEmoji:()=>PD,$ZodEmail:()=>jD,$ZodE164:()=>nD,$ZodDiscriminatedUnion:()=>w0,$ZodDefault:()=>J0,$ZodDate:()=>I0,$ZodCustomStringFormat:()=>rD,$ZodCustom:()=>S0,$ZodCodec:()=>YI,$ZodCheckUpperCase:()=>xO,$ZodCheckStringFormat:()=>WI,$ZodCheckStartsWith:()=>hO,$ZodCheckSizeEquals:()=>_O,$ZodCheckRegex:()=>gO,$ZodCheckProperty:()=>iO,$ZodCheckOverwrite:()=>cO,$ZodCheckNumberFormat:()=>SO,$ZodCheckMultipleOf:()=>jO,$ZodCheckMinSize:()=>TO,$ZodCheckMinLength:()=>ZO,$ZodCheckMimeType:()=>nO,$ZodCheckMaxSize:()=>RO,$ZodCheckMaxLength:()=>CO,$ZodCheckLowerCase:()=>yO,$ZodCheckLessThan:()=>HD,$ZodCheckLengthEquals:()=>fO,$ZodCheckIncludes:()=>lO,$ZodCheckGreaterThan:()=>LD,$ZodCheckEndsWith:()=>uO,$ZodCheckBigIntFormat:()=>PO,$ZodCheck:()=>X$,$ZodCatch:()=>V0,$ZodCUID2:()=>_D,$ZodCUID:()=>TD,$ZodCIDRv6:()=>hD,$ZodCIDRv4:()=>lD,$ZodBoolean:()=>GI,$ZodBigIntFormat:()=>oD,$ZodBigInt:()=>c1,$ZodBase64URL:()=>iD,$ZodBase64:()=>uD,$ZodAsyncError:()=>F6,$ZodArray:()=>U0,$ZodAny:()=>aD});var lN=Object.freeze({status:"aborted"});function v($,I,U){function D(N,O){if(!N._zod)Object.defineProperty(N,"_zod",{value:{def:O,constr:A,traits:new Set},enumerable:!1});if(N._zod.traits.has($))return;N._zod.traits.add($),I(N,O);let X=A.prototype,G=Object.keys(X);for(let Q=0;Q<G.length;Q++){let Y=G[Q];if(!(Y in N))N[Y]=X[Y].bind(N)}}let b=U?.Parent??Object;class w extends b{}Object.defineProperty(w,"name",{value:$});function A(N){var O;let X=U?.Parent?new w:this;D(X,N),(O=X._zod).deferred??(O.deferred=[]);for(let G of X._zod.deferred)G();return X}return Object.defineProperty(A,"init",{value:D}),Object.defineProperty(A,Symbol.hasInstance,{value:(N)=>{if(U?.Parent&&N instanceof U.Parent)return!0;return N?._zod?.traits?.has($)}}),Object.defineProperty(A,"name",{value:$}),A}var hN=Symbol("zod_brand");class F6 extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class R4 extends Error{constructor($){super(`Encountered unidirectional transform during encode: ${$}`);this.name="ZodEncodeError"}}var T1={};function z$($){if($)Object.assign(T1,$);return T1}var M={};Z6(M,{unwrapMessage:()=>_1,uint8ArrayToHex:()=>QM,uint8ArrayToBase64url:()=>WM,uint8ArrayToBase64:()=>ZY,stringifyPrimitive:()=>q,slugify:()=>nN,shallowClone:()=>rN,safeExtend:()=>DM,required:()=>NM,randomString:()=>aV,propertyKeyTypes:()=>f1,promiseAllObject:()=>tV,primitiveTypes:()=>mN,prefixIssues:()=>p$,pick:()=>IM,partial:()=>AM,optionalKeys:()=>oN,omit:()=>UM,objectClone:()=>oV,numKeys:()=>eV,nullish:()=>a6,normalizeParams:()=>E,mergeDefs:()=>s6,merge:()=>wM,jsonStringifyReplacer:()=>bI,joinValues:()=>z,issue:()=>wI,isPlainObject:()=>$4,isObject:()=>T4,hexToUint8Array:()=>GM,getSizableOrigin:()=>g1,getParsedType:()=>sV,getLengthableOrigin:()=>y1,getEnumValues:()=>C1,getElementAtPath:()=>pV,floatSafeRemainder:()=>iN,finalizeIssue:()=>u$,extend:()=>bM,escapeRegex:()=>s$,esc:()=>AD,defineLazy:()=>e,createTransparentProxy:()=>$M,cloneDef:()=>dV,clone:()=>k$,cleanRegex:()=>Z1,cleanEnum:()=>OM,captureStackTrace:()=>ND,cached:()=>DI,base64urlToUint8Array:()=>XM,base64ToUint8Array:()=>CY,assignProp:()=>e6,assertNotEqual:()=>nV,assertNever:()=>rV,assertIs:()=>cV,assertEqual:()=>iV,assert:()=>mV,allowsEval:()=>cN,aborted:()=>I4,NUMBER_FORMAT_RANGES:()=>dN,Class:()=>fY,BIGINT_FORMAT_RANGES:()=>pN});function iV($){return $}function nV($){return $}function cV($){}function rV($){throw new Error("Unexpected value in exhaustive check")}function mV($){}function C1($){let I=Object.values($).filter((D)=>typeof D==="number");return Object.entries($).filter(([D,b])=>I.indexOf(+D)===-1).map(([D,b])=>b)}function z($,I="|"){return $.map((U)=>q(U)).join(I)}function bI($,I){if(typeof I==="bigint")return I.toString();return I}function DI($){return{get value(){{let U=$();return Object.defineProperty(this,"value",{value:U}),U}throw new Error("cached value already set")}}}function a6($){return $===null||$===void 0}function Z1($){let I=$.startsWith("^")?1:0,U=$.endsWith("$")?$.length-1:$.length;return $.slice(I,U)}function iN($,I){let U=($.toString().split(".")[1]||"").length,D=I.toString(),b=(D.split(".")[1]||"").length;if(b===0&&/\d?e-\d?/.test(D)){let O=D.match(/\d?e-(\d?)/);if(O?.[1])b=Number.parseInt(O[1])}let w=U>b?U:b,A=Number.parseInt($.toFixed(w).replace(".","")),N=Number.parseInt(I.toFixed(w).replace(".",""));return A%N/10**w}var _Y=Symbol("evaluating");function e($,I,U){let D=void 0;Object.defineProperty($,I,{get(){if(D===_Y)return;if(D===void 0)D=_Y,D=U();return D},set(b){Object.defineProperty($,I,{value:b})},configurable:!0})}function oV($){return Object.create(Object.getPrototypeOf($),Object.getOwnPropertyDescriptors($))}function e6($,I,U){Object.defineProperty($,I,{value:U,writable:!0,enumerable:!0,configurable:!0})}function s6(...$){let I={};for(let U of $){let D=Object.getOwnPropertyDescriptors(U);Object.assign(I,D)}return Object.defineProperties({},I)}function dV($){return s6($._zod.def)}function pV($,I){if(!I)return $;return I.reduce((U,D)=>U?.[D],$)}function tV($){let I=Object.keys($),U=I.map((D)=>$[D]);return Promise.all(U).then((D)=>{let b={};for(let w=0;w<I.length;w++)b[I[w]]=D[w];return b})}function aV($=10){let U="";for(let D=0;D<$;D++)U+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return U}function AD($){return JSON.stringify($)}function nN($){return $.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var ND="captureStackTrace"in Error?Error.captureStackTrace:(...$)=>{};function T4($){return typeof $==="object"&&$!==null&&!Array.isArray($)}var cN=DI(()=>{if(typeof navigator!=="undefined"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch($){return!1}});function $4($){if(T4($)===!1)return!1;let I=$.constructor;if(I===void 0)return!0;if(typeof I!=="function")return!0;let U=I.prototype;if(T4(U)===!1)return!1;if(Object.prototype.hasOwnProperty.call(U,"isPrototypeOf")===!1)return!1;return!0}function rN($){if($4($))return{...$};if(Array.isArray($))return[...$];return $}function eV($){let I=0;for(let U in $)if(Object.prototype.hasOwnProperty.call($,U))I++;return I}var sV=($)=>{let I=typeof $;switch(I){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN($)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray($))return"array";if($===null)return"null";if($.then&&typeof $.then==="function"&&$.catch&&typeof $.catch==="function")return"promise";if(typeof Map!=="undefined"&&$ instanceof Map)return"map";if(typeof Set!=="undefined"&&$ instanceof Set)return"set";if(typeof Date!=="undefined"&&$ instanceof Date)return"date";if(typeof File!=="undefined"&&$ instanceof File)return"file";return"object";default:throw new Error(`Unknown data type: ${I}`)}},f1=new Set(["string","number","symbol"]),mN=new Set(["string","number","bigint","boolean","symbol","undefined"]);function s$($){return $.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function k$($,I,U){let D=new $._zod.constr(I??$._zod.def);if(!I||U?.parent)D._zod.parent=$;return D}function E($){let I=$;if(!I)return{};if(typeof I==="string")return{error:()=>I};if(I?.message!==void 0){if(I?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");I.error=I.message}if(delete I.message,typeof I.error==="string")return{...I,error:()=>I.error};return I}function $M($){let I;return new Proxy({},{get(U,D,b){return I??(I=$()),Reflect.get(I,D,b)},set(U,D,b,w){return I??(I=$()),Reflect.set(I,D,b,w)},has(U,D){return I??(I=$()),Reflect.has(I,D)},deleteProperty(U,D){return I??(I=$()),Reflect.deleteProperty(I,D)},ownKeys(U){return I??(I=$()),Reflect.ownKeys(I)},getOwnPropertyDescriptor(U,D){return I??(I=$()),Reflect.getOwnPropertyDescriptor(I,D)},defineProperty(U,D,b){return I??(I=$()),Reflect.defineProperty(I,D,b)}})}function q($){if(typeof $==="bigint")return $.toString()+"n";if(typeof $==="string")return`"${$}"`;return`${$}`}function oN($){return Object.keys($).filter((I)=>{return $[I]._zod.optin==="optional"&&$[I]._zod.optout==="optional"})}var dN={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},pN={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function IM($,I){let U=$._zod.def,D=s6($._zod.def,{get shape(){let b={};for(let w in I){if(!(w in U.shape))throw new Error(`Unrecognized key: "${w}"`);if(!I[w])continue;b[w]=U.shape[w]}return e6(this,"shape",b),b},checks:[]});return k$($,D)}function UM($,I){let U=$._zod.def,D=s6($._zod.def,{get shape(){let b={...$._zod.def.shape};for(let w in I){if(!(w in U.shape))throw new Error(`Unrecognized key: "${w}"`);if(!I[w])continue;delete b[w]}return e6(this,"shape",b),b},checks:[]});return k$($,D)}function bM($,I){if(!$4(I))throw new Error("Invalid input to extend: expected a plain object");let U=$._zod.def.checks;if(U&&U.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");let b=s6($._zod.def,{get shape(){let w={...$._zod.def.shape,...I};return e6(this,"shape",w),w},checks:[]});return k$($,b)}function DM($,I){if(!$4(I))throw new Error("Invalid input to safeExtend: expected a plain object");let U={...$._zod.def,get shape(){let D={...$._zod.def.shape,...I};return e6(this,"shape",D),D},checks:$._zod.def.checks};return k$($,U)}function wM($,I){let U=s6($._zod.def,{get shape(){let D={...$._zod.def.shape,...I._zod.def.shape};return e6(this,"shape",D),D},get catchall(){return I._zod.def.catchall},checks:[]});return k$($,U)}function AM($,I,U){let D=s6(I._zod.def,{get shape(){let b=I._zod.def.shape,w={...b};if(U)for(let A in U){if(!(A in b))throw new Error(`Unrecognized key: "${A}"`);if(!U[A])continue;w[A]=$?new $({type:"optional",innerType:b[A]}):b[A]}else for(let A in b)w[A]=$?new $({type:"optional",innerType:b[A]}):b[A];return e6(this,"shape",w),w},checks:[]});return k$(I,D)}function NM($,I,U){let D=s6(I._zod.def,{get shape(){let b=I._zod.def.shape,w={...b};if(U)for(let A in U){if(!(A in w))throw new Error(`Unrecognized key: "${A}"`);if(!U[A])continue;w[A]=new $({type:"nonoptional",innerType:b[A]})}else for(let A in b)w[A]=new $({type:"nonoptional",innerType:b[A]});return e6(this,"shape",w),w},checks:[]});return k$(I,D)}function I4($,I=0){if($.aborted===!0)return!0;for(let U=I;U<$.issues.length;U++)if($.issues[U]?.continue!==!0)return!0;return!1}function p$($,I){return I.map((U)=>{var D;return(D=U).path??(D.path=[]),U.path.unshift($),U})}function _1($){return typeof $==="string"?$:$?.message}function u$($,I,U){let D={...$,path:$.path??[]};if(!$.message){let b=_1($.inst?._zod.def?.error?.($))??_1(I?.error?.($))??_1(U.customError?.($))??_1(U.localeError?.($))??"Invalid input";D.message=b}if(delete D.inst,delete D.continue,!I?.reportInput)delete D.input;return D}function g1($){if($ instanceof Set)return"set";if($ instanceof Map)return"map";if($ instanceof File)return"file";return"unknown"}function y1($){if(Array.isArray($))return"array";if(typeof $==="string")return"string";return"unknown"}function wI(...$){let[I,U,D]=$;if(typeof I==="string")return{message:I,code:"custom",input:U,inst:D};return{...I}}function OM($){return Object.entries($).filter(([I,U])=>{return Number.isNaN(Number.parseInt(I,10))}).map((I)=>I[1])}function CY($){let I=atob($),U=new Uint8Array(I.length);for(let D=0;D<I.length;D++)U[D]=I.charCodeAt(D);return U}function ZY($){let I="";for(let U=0;U<$.length;U++)I+=String.fromCharCode($[U]);return btoa(I)}function XM($){let I=$.replace(/-/g,"+").replace(/_/g,"/"),U="=".repeat((4-I.length%4)%4);return CY(I+U)}function WM($){return ZY($).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function GM($){let I=$.replace(/^0x/,"");if(I.length%2!==0)throw new Error("Invalid hex string length");let U=new Uint8Array(I.length/2);for(let D=0;D<I.length;D+=2)U[D/2]=Number.parseInt(I.slice(D,D+2),16);return U}function QM($){return Array.from($).map((I)=>I.toString(16).padStart(2,"0")).join("")}class fY{constructor(...$){}}var gY=($,I)=>{$.name="$ZodError",Object.defineProperty($,"_zod",{value:$._zod,enumerable:!1}),Object.defineProperty($,"issues",{value:I,enumerable:!1}),$.message=JSON.stringify(I,bI,2),Object.defineProperty($,"toString",{value:()=>$.message,enumerable:!1})},x1=v("$ZodError",gY),i$=v("$ZodError",gY,{Parent:Error});function l1($,I=(U)=>U.message){let U={},D=[];for(let b of $.issues)if(b.path.length>0)U[b.path[0]]=U[b.path[0]]||[],U[b.path[0]].push(I(b));else D.push(I(b));return{formErrors:D,fieldErrors:U}}function h1($,I=(U)=>U.message){let U={_errors:[]},D=(b)=>{for(let w of b.issues)if(w.code==="invalid_union"&&w.errors.length)w.errors.map((A)=>D({issues:A}));else if(w.code==="invalid_key")D({issues:w.issues});else if(w.code==="invalid_element")D({issues:w.issues});else if(w.path.length===0)U._errors.push(I(w));else{let A=U,N=0;while(N<w.path.length){let O=w.path[N];if(N!==w.path.length-1)A[O]=A[O]||{_errors:[]};else A[O]=A[O]||{_errors:[]},A[O]._errors.push(I(w));A=A[O],N++}}};return D($),U}function tN($,I=(U)=>U.message){let U={errors:[]},D=(b,w=[])=>{var A,N;for(let O of b.issues)if(O.code==="invalid_union"&&O.errors.length)O.errors.map((X)=>D({issues:X},O.path));else if(O.code==="invalid_key")D({issues:O.issues},O.path);else if(O.code==="invalid_element")D({issues:O.issues},O.path);else{let X=[...w,...O.path];if(X.length===0){U.errors.push(I(O));continue}let G=U,Q=0;while(Q<X.length){let Y=X[Q],B=Q===X.length-1;if(typeof Y==="string")G.properties??(G.properties={}),(A=G.properties)[Y]??(A[Y]={errors:[]}),G=G.properties[Y];else G.items??(G.items=[]),(N=G.items)[Y]??(N[Y]={errors:[]}),G=G.items[Y];if(B)G.errors.push(I(O));Q++}}};return D($),U}function yY($){let I=[],U=$.map((D)=>typeof D==="object"?D.key:D);for(let D of U)if(typeof D==="number")I.push(`[${D}]`);else if(typeof D==="symbol")I.push(`[${JSON.stringify(String(D))}]`);else if(/[^\w$]/.test(D))I.push(`[${JSON.stringify(D)}]`);else{if(I.length)I.push(".");I.push(D)}return I.join("")}function aN($){let I=[],U=[...$.issues].sort((D,b)=>(D.path??[]).length-(b.path??[]).length);for(let D of U)if(I.push(`✖ ${D.message}`),D.path?.length)I.push(` → at ${yY(D.path)}`);return I.join(`
|
|
10
|
-
`)}var AI=($)=>(I,U,D,b)=>{let w=D?Object.assign(D,{async:!1}):{async:!1},A=I._zod.run({value:U,issues:[]},w);if(A instanceof Promise)throw new F6;if(A.issues.length){let N=new(b?.Err??$)(A.issues.map((O)=>u$(O,w,z$())));throw ND(N,b?.callee),N}return A.value},_4=AI(i$),NI=($)=>async(I,U,D,b)=>{let w=D?Object.assign(D,{async:!0}):{async:!0},A=I._zod.run({value:U,issues:[]},w);if(A instanceof Promise)A=await A;if(A.issues.length){let N=new(b?.Err??$)(A.issues.map((O)=>u$(O,w,z$())));throw ND(N,b?.callee),N}return A.value},C4=NI(i$),OI=($)=>(I,U,D)=>{let b=D?{...D,async:!1}:{async:!1},w=I._zod.run({value:U,issues:[]},b);if(w instanceof Promise)throw new F6;return w.issues.length?{success:!1,error:new($??x1)(w.issues.map((A)=>u$(A,b,z$())))}:{success:!0,data:w.value}},U4=OI(i$),XI=($)=>async(I,U,D)=>{let b=D?Object.assign(D,{async:!0}):{async:!0},w=I._zod.run({value:U,issues:[]},b);if(w instanceof Promise)w=await w;return w.issues.length?{success:!1,error:new $(w.issues.map((A)=>u$(A,b,z$())))}:{success:!0,data:w.value}},b4=XI(i$),OD=($)=>(I,U,D)=>{let b=D?Object.assign(D,{direction:"backward"}):{direction:"backward"};return AI($)(I,U,b)},xY=OD(i$),XD=($)=>(I,U,D)=>{return AI($)(I,U,D)},lY=XD(i$),WD=($)=>async(I,U,D)=>{let b=D?Object.assign(D,{direction:"backward"}):{direction:"backward"};return NI($)(I,U,b)},hY=WD(i$),GD=($)=>async(I,U,D)=>{return NI($)(I,U,D)},uY=GD(i$),QD=($)=>(I,U,D)=>{let b=D?Object.assign(D,{direction:"backward"}):{direction:"backward"};return OI($)(I,U,b)},iY=QD(i$),YD=($)=>(I,U,D)=>{return OI($)(I,U,D)},nY=YD(i$),BD=($)=>async(I,U,D)=>{let b=D?Object.assign(D,{direction:"backward"}):{direction:"backward"};return XI($)(I,U,b)},cY=BD(i$),vD=($)=>async(I,U,D)=>{return XI($)(I,U,D)},rY=vD(i$);var t$={};Z6(t$,{xid:()=>IO,uuid7:()=>HM,uuid6:()=>JM,uuid4:()=>vM,uuid:()=>Z4,uppercase:()=>EO,unicodeEmail:()=>mY,undefined:()=>qO,ulid:()=>$O,time:()=>JO,string:()=>LO,sha512_hex:()=>xM,sha512_base64url:()=>hM,sha512_base64:()=>lM,sha384_hex:()=>fM,sha384_base64url:()=>yM,sha384_base64:()=>gM,sha256_hex:()=>_M,sha256_base64url:()=>ZM,sha256_base64:()=>CM,sha1_hex:()=>PM,sha1_base64url:()=>TM,sha1_base64:()=>RM,rfc5322Email:()=>zM,number:()=>MO,null:()=>FO,nanoid:()=>bO,md5_hex:()=>EM,md5_base64url:()=>SM,md5_base64:()=>jM,mac:()=>WO,lowercase:()=>kO,ksuid:()=>UO,ipv6:()=>XO,ipv4:()=>OO,integer:()=>VO,idnEmail:()=>VM,html5Email:()=>LM,hostname:()=>FM,hex:()=>kM,guid:()=>wO,extendedDuration:()=>BM,emoji:()=>NO,email:()=>AO,e164:()=>BO,duration:()=>DO,domain:()=>qM,datetime:()=>HO,date:()=>vO,cuid2:()=>sN,cuid:()=>eN,cidrv6:()=>QO,cidrv4:()=>GO,browserEmail:()=>MM,boolean:()=>KO,bigint:()=>zO,base64url:()=>JD,base64:()=>YO});var eN=/^[cC][^\s-]{8,}$/,sN=/^[0-9a-z]+$/,$O=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,IO=/^[0-9a-vA-V]{20}$/,UO=/^[A-Za-z0-9]{27}$/,bO=/^[a-zA-Z0-9_-]{21}$/,DO=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,BM=/^[-+]?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)?)??$/,wO=/^([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})$/,Z4=($)=>{if(!$)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${$}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)},vM=Z4(4),JM=Z4(6),HM=Z4(7),AO=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,LM=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,zM=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,mY=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,VM=mY,MM=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,KM="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function NO(){return new RegExp(KM,"u")}var OO=/^(?:(?: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])$/,XO=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,WO=($)=>{let I=s$($??":");return new RegExp(`^(?:[0-9A-F]{2}${I}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${I}){5}[0-9a-f]{2}$`)},GO=/^((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])$/,QO=/^(([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])$/,YO=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,JD=/^[A-Za-z0-9_-]*$/,FM=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,qM=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,BO=/^\+(?:[0-9]){6,14}[0-9]$/,oY="(?:(?:\\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])))",vO=new RegExp(`^${oY}$`);function dY($){return typeof $.precision==="number"?$.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":$.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${$.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function JO($){return new RegExp(`^${dY($)}$`)}function HO($){let I=dY({precision:$.precision}),U=["Z"];if($.local)U.push("");if($.offset)U.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let D=`${I}(?:${U.join("|")})`;return new RegExp(`^${oY}T(?:${D})$`)}var LO=($)=>{let I=$?`[\\s\\S]{${$?.minimum??0},${$?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${I}$`)},zO=/^-?\d+n?$/,VO=/^-?\d+$/,MO=/^-?\d+(?:\.\d+)?/,KO=/^(?:true|false)$/i,FO=/^null$/i;var qO=/^undefined$/i;var kO=/^[^A-Z]*$/,EO=/^[^a-z]*$/,kM=/^[0-9a-fA-F]*$/;function u1($,I){return new RegExp(`^[A-Za-z0-9+/]{${$}}${I}$`)}function i1($){return new RegExp(`^[A-Za-z0-9_-]{${$}}$`)}var EM=/^[0-9a-fA-F]{32}$/,jM=u1(22,"=="),SM=i1(22),PM=/^[0-9a-fA-F]{40}$/,RM=u1(27,"="),TM=i1(27),_M=/^[0-9a-fA-F]{64}$/,CM=u1(43,"="),ZM=i1(43),fM=/^[0-9a-fA-F]{96}$/,gM=u1(64,""),yM=i1(64),xM=/^[0-9a-fA-F]{128}$/,lM=u1(86,"=="),hM=i1(86);var X$=v("$ZodCheck",($,I)=>{var U;$._zod??($._zod={}),$._zod.def=I,(U=$._zod).onattach??(U.onattach=[])}),tY={number:"number",bigint:"bigint",object:"date"},HD=v("$ZodCheckLessThan",($,I)=>{X$.init($,I);let U=tY[typeof I.value];$._zod.onattach.push((D)=>{let b=D._zod.bag,w=(I.inclusive?b.maximum:b.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(I.value<w)if(I.inclusive)b.maximum=I.value;else b.exclusiveMaximum=I.value}),$._zod.check=(D)=>{if(I.inclusive?D.value<=I.value:D.value<I.value)return;D.issues.push({origin:U,code:"too_big",maximum:I.value,input:D.value,inclusive:I.inclusive,inst:$,continue:!I.abort})}}),LD=v("$ZodCheckGreaterThan",($,I)=>{X$.init($,I);let U=tY[typeof I.value];$._zod.onattach.push((D)=>{let b=D._zod.bag,w=(I.inclusive?b.minimum:b.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(I.value>w)if(I.inclusive)b.minimum=I.value;else b.exclusiveMinimum=I.value}),$._zod.check=(D)=>{if(I.inclusive?D.value>=I.value:D.value>I.value)return;D.issues.push({origin:U,code:"too_small",minimum:I.value,input:D.value,inclusive:I.inclusive,inst:$,continue:!I.abort})}}),jO=v("$ZodCheckMultipleOf",($,I)=>{X$.init($,I),$._zod.onattach.push((U)=>{var D;(D=U._zod.bag).multipleOf??(D.multipleOf=I.value)}),$._zod.check=(U)=>{if(typeof U.value!==typeof I.value)throw new Error("Cannot mix number and bigint in multiple_of check.");if(typeof U.value==="bigint"?U.value%I.value===BigInt(0):iN(U.value,I.value)===0)return;U.issues.push({origin:typeof U.value,code:"not_multiple_of",divisor:I.value,input:U.value,inst:$,continue:!I.abort})}}),SO=v("$ZodCheckNumberFormat",($,I)=>{X$.init($,I),I.format=I.format||"float64";let U=I.format?.includes("int"),D=U?"int":"number",[b,w]=dN[I.format];$._zod.onattach.push((A)=>{let N=A._zod.bag;if(N.format=I.format,N.minimum=b,N.maximum=w,U)N.pattern=VO}),$._zod.check=(A)=>{let N=A.value;if(U){if(!Number.isInteger(N)){A.issues.push({expected:D,format:I.format,code:"invalid_type",continue:!1,input:N,inst:$});return}if(!Number.isSafeInteger(N)){if(N>0)A.issues.push({input:N,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:D,continue:!I.abort});else A.issues.push({input:N,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:D,continue:!I.abort});return}}if(N<b)A.issues.push({origin:"number",input:N,code:"too_small",minimum:b,inclusive:!0,inst:$,continue:!I.abort});if(N>w)A.issues.push({origin:"number",input:N,code:"too_big",maximum:w,inst:$})}}),PO=v("$ZodCheckBigIntFormat",($,I)=>{X$.init($,I);let[U,D]=pN[I.format];$._zod.onattach.push((b)=>{let w=b._zod.bag;w.format=I.format,w.minimum=U,w.maximum=D}),$._zod.check=(b)=>{let w=b.value;if(w<U)b.issues.push({origin:"bigint",input:w,code:"too_small",minimum:U,inclusive:!0,inst:$,continue:!I.abort});if(w>D)b.issues.push({origin:"bigint",input:w,code:"too_big",maximum:D,inst:$})}}),RO=v("$ZodCheckMaxSize",($,I)=>{var U;X$.init($,I),(U=$._zod.def).when??(U.when=(D)=>{let b=D.value;return!a6(b)&&b.size!==void 0}),$._zod.onattach.push((D)=>{let b=D._zod.bag.maximum??Number.POSITIVE_INFINITY;if(I.maximum<b)D._zod.bag.maximum=I.maximum}),$._zod.check=(D)=>{let b=D.value;if(b.size<=I.maximum)return;D.issues.push({origin:g1(b),code:"too_big",maximum:I.maximum,inclusive:!0,input:b,inst:$,continue:!I.abort})}}),TO=v("$ZodCheckMinSize",($,I)=>{var U;X$.init($,I),(U=$._zod.def).when??(U.when=(D)=>{let b=D.value;return!a6(b)&&b.size!==void 0}),$._zod.onattach.push((D)=>{let b=D._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(I.minimum>b)D._zod.bag.minimum=I.minimum}),$._zod.check=(D)=>{let b=D.value;if(b.size>=I.minimum)return;D.issues.push({origin:g1(b),code:"too_small",minimum:I.minimum,inclusive:!0,input:b,inst:$,continue:!I.abort})}}),_O=v("$ZodCheckSizeEquals",($,I)=>{var U;X$.init($,I),(U=$._zod.def).when??(U.when=(D)=>{let b=D.value;return!a6(b)&&b.size!==void 0}),$._zod.onattach.push((D)=>{let b=D._zod.bag;b.minimum=I.size,b.maximum=I.size,b.size=I.size}),$._zod.check=(D)=>{let b=D.value,w=b.size;if(w===I.size)return;let A=w>I.size;D.issues.push({origin:g1(b),...A?{code:"too_big",maximum:I.size}:{code:"too_small",minimum:I.size},inclusive:!0,exact:!0,input:D.value,inst:$,continue:!I.abort})}}),CO=v("$ZodCheckMaxLength",($,I)=>{var U;X$.init($,I),(U=$._zod.def).when??(U.when=(D)=>{let b=D.value;return!a6(b)&&b.length!==void 0}),$._zod.onattach.push((D)=>{let b=D._zod.bag.maximum??Number.POSITIVE_INFINITY;if(I.maximum<b)D._zod.bag.maximum=I.maximum}),$._zod.check=(D)=>{let b=D.value;if(b.length<=I.maximum)return;let A=y1(b);D.issues.push({origin:A,code:"too_big",maximum:I.maximum,inclusive:!0,input:b,inst:$,continue:!I.abort})}}),ZO=v("$ZodCheckMinLength",($,I)=>{var U;X$.init($,I),(U=$._zod.def).when??(U.when=(D)=>{let b=D.value;return!a6(b)&&b.length!==void 0}),$._zod.onattach.push((D)=>{let b=D._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(I.minimum>b)D._zod.bag.minimum=I.minimum}),$._zod.check=(D)=>{let b=D.value;if(b.length>=I.minimum)return;let A=y1(b);D.issues.push({origin:A,code:"too_small",minimum:I.minimum,inclusive:!0,input:b,inst:$,continue:!I.abort})}}),fO=v("$ZodCheckLengthEquals",($,I)=>{var U;X$.init($,I),(U=$._zod.def).when??(U.when=(D)=>{let b=D.value;return!a6(b)&&b.length!==void 0}),$._zod.onattach.push((D)=>{let b=D._zod.bag;b.minimum=I.length,b.maximum=I.length,b.length=I.length}),$._zod.check=(D)=>{let b=D.value,w=b.length;if(w===I.length)return;let A=y1(b),N=w>I.length;D.issues.push({origin:A,...N?{code:"too_big",maximum:I.length}:{code:"too_small",minimum:I.length},inclusive:!0,exact:!0,input:D.value,inst:$,continue:!I.abort})}}),WI=v("$ZodCheckStringFormat",($,I)=>{var U,D;if(X$.init($,I),$._zod.onattach.push((b)=>{let w=b._zod.bag;if(w.format=I.format,I.pattern)w.patterns??(w.patterns=new Set),w.patterns.add(I.pattern)}),I.pattern)(U=$._zod).check??(U.check=(b)=>{if(I.pattern.lastIndex=0,I.pattern.test(b.value))return;b.issues.push({origin:"string",code:"invalid_format",format:I.format,input:b.value,...I.pattern?{pattern:I.pattern.toString()}:{},inst:$,continue:!I.abort})});else(D=$._zod).check??(D.check=()=>{})}),gO=v("$ZodCheckRegex",($,I)=>{WI.init($,I),$._zod.check=(U)=>{if(I.pattern.lastIndex=0,I.pattern.test(U.value))return;U.issues.push({origin:"string",code:"invalid_format",format:"regex",input:U.value,pattern:I.pattern.toString(),inst:$,continue:!I.abort})}}),yO=v("$ZodCheckLowerCase",($,I)=>{I.pattern??(I.pattern=kO),WI.init($,I)}),xO=v("$ZodCheckUpperCase",($,I)=>{I.pattern??(I.pattern=EO),WI.init($,I)}),lO=v("$ZodCheckIncludes",($,I)=>{X$.init($,I);let U=s$(I.includes),D=new RegExp(typeof I.position==="number"?`^.{${I.position}}${U}`:U);I.pattern=D,$._zod.onattach.push((b)=>{let w=b._zod.bag;w.patterns??(w.patterns=new Set),w.patterns.add(D)}),$._zod.check=(b)=>{if(b.value.includes(I.includes,I.position))return;b.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:I.includes,input:b.value,inst:$,continue:!I.abort})}}),hO=v("$ZodCheckStartsWith",($,I)=>{X$.init($,I);let U=new RegExp(`^${s$(I.prefix)}.*`);I.pattern??(I.pattern=U),$._zod.onattach.push((D)=>{let b=D._zod.bag;b.patterns??(b.patterns=new Set),b.patterns.add(U)}),$._zod.check=(D)=>{if(D.value.startsWith(I.prefix))return;D.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:I.prefix,input:D.value,inst:$,continue:!I.abort})}}),uO=v("$ZodCheckEndsWith",($,I)=>{X$.init($,I);let U=new RegExp(`.*${s$(I.suffix)}$`);I.pattern??(I.pattern=U),$._zod.onattach.push((D)=>{let b=D._zod.bag;b.patterns??(b.patterns=new Set),b.patterns.add(U)}),$._zod.check=(D)=>{if(D.value.endsWith(I.suffix))return;D.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:I.suffix,input:D.value,inst:$,continue:!I.abort})}});function pY($,I,U){if($.issues.length)I.issues.push(...p$(U,$.issues))}var iO=v("$ZodCheckProperty",($,I)=>{X$.init($,I),$._zod.check=(U)=>{let D=I.schema._zod.run({value:U.value[I.property],issues:[]},{});if(D instanceof Promise)return D.then((b)=>pY(b,U,I.property));pY(D,U,I.property);return}}),nO=v("$ZodCheckMimeType",($,I)=>{X$.init($,I);let U=new Set(I.mime);$._zod.onattach.push((D)=>{D._zod.bag.mime=I.mime}),$._zod.check=(D)=>{if(U.has(D.value.type))return;D.issues.push({code:"invalid_value",values:I.mime,input:D.value.type,inst:$,continue:!I.abort})}}),cO=v("$ZodCheckOverwrite",($,I)=>{X$.init($,I),$._zod.check=(U)=>{U.value=I.tx(U.value)}});class zD{constructor($=[]){if(this.content=[],this.indent=0,this)this.args=$}indented($){this.indent+=1,$(this),this.indent-=1}write($){if(typeof $==="function"){$(this,{execution:"sync"}),$(this,{execution:"async"});return}let U=$.split(`
|
|
11
|
-
`).filter((
|
|
12
|
-
`))}}var rO={major:4,minor:2,patch:1};var n=v("$ZodType",($,I)=>{var U;$??($={}),$._zod.def=I,$._zod.bag=$._zod.bag||{},$._zod.version=rO;let D=[...$._zod.def.checks??[]];if($._zod.traits.has("$ZodCheck"))D.unshift($);for(let b of D)for(let w of b._zod.onattach)w($);if(D.length===0)(U=$._zod).deferred??(U.deferred=[]),$._zod.deferred?.push(()=>{$._zod.run=$._zod.parse});else{let b=(A,N,O)=>{let X=I4(A),G;for(let Q of N){if(Q._zod.def.when){if(!Q._zod.def.when(A))continue}else if(X)continue;let Y=A.issues.length,B=Q._zod.check(A);if(B instanceof Promise&&O?.async===!1)throw new F6;if(G||B instanceof Promise)G=(G??Promise.resolve()).then(async()=>{if(await B,A.issues.length===Y)return;if(!X)X=I4(A,Y)});else{if(A.issues.length===Y)continue;if(!X)X=I4(A,Y)}}if(G)return G.then(()=>{return A});return A},w=(A,N,O)=>{if(I4(A))return A.aborted=!0,A;let X=b(N,D,O);if(X instanceof Promise){if(O.async===!1)throw new F6;return X.then((G)=>$._zod.parse(G,O))}return $._zod.parse(X,O)};$._zod.run=(A,N)=>{if(N.skipChecks)return $._zod.parse(A,N);if(N.direction==="backward"){let X=$._zod.parse({value:A.value,issues:[]},{...N,skipChecks:!0});if(X instanceof Promise)return X.then((G)=>{return w(G,A,N)});return w(X,A,N)}let O=$._zod.parse(A,N);if(O instanceof Promise){if(N.async===!1)throw new F6;return O.then((X)=>b(X,D,N))}return b(O,D,N)}}$["~standard"]={validate:(b)=>{try{let w=U4($,b);return w.success?{value:w.data}:{issues:w.error?.issues}}catch(w){return b4($,b).then((A)=>A.success?{value:A.data}:{issues:A.error?.issues})}},vendor:"zod",version:1}}),D4=v("$ZodString",($,I)=>{n.init($,I),$._zod.pattern=[...$?._zod.bag?.patterns??[]].pop()??LO($._zod.bag),$._zod.parse=(U,D)=>{if(I.coerce)try{U.value=String(U.value)}catch(b){}if(typeof U.value==="string")return U;return U.issues.push({expected:"string",code:"invalid_type",input:U.value,inst:$}),U}}),A$=v("$ZodStringFormat",($,I)=>{WI.init($,I),D4.init($,I)}),kD=v("$ZodGUID",($,I)=>{I.pattern??(I.pattern=wO),A$.init($,I)}),ED=v("$ZodUUID",($,I)=>{if(I.version){let D={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[I.version];if(D===void 0)throw new Error(`Invalid UUID version: "${I.version}"`);I.pattern??(I.pattern=Z4(D))}else I.pattern??(I.pattern=Z4());A$.init($,I)}),jD=v("$ZodEmail",($,I)=>{I.pattern??(I.pattern=AO),A$.init($,I)}),SD=v("$ZodURL",($,I)=>{A$.init($,I),$._zod.check=(U)=>{try{let D=U.value.trim(),b=new URL(D);if(I.hostname){if(I.hostname.lastIndex=0,!I.hostname.test(b.hostname))U.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:I.hostname.source,input:U.value,inst:$,continue:!I.abort})}if(I.protocol){if(I.protocol.lastIndex=0,!I.protocol.test(b.protocol.endsWith(":")?b.protocol.slice(0,-1):b.protocol))U.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:I.protocol.source,input:U.value,inst:$,continue:!I.abort})}if(I.normalize)U.value=b.href;else U.value=D;return}catch(D){U.issues.push({code:"invalid_format",format:"url",input:U.value,inst:$,continue:!I.abort})}}}),PD=v("$ZodEmoji",($,I)=>{I.pattern??(I.pattern=NO()),A$.init($,I)}),RD=v("$ZodNanoID",($,I)=>{I.pattern??(I.pattern=bO),A$.init($,I)}),TD=v("$ZodCUID",($,I)=>{I.pattern??(I.pattern=eN),A$.init($,I)}),_D=v("$ZodCUID2",($,I)=>{I.pattern??(I.pattern=sN),A$.init($,I)}),CD=v("$ZodULID",($,I)=>{I.pattern??(I.pattern=$O),A$.init($,I)}),ZD=v("$ZodXID",($,I)=>{I.pattern??(I.pattern=IO),A$.init($,I)}),fD=v("$ZodKSUID",($,I)=>{I.pattern??(I.pattern=UO),A$.init($,I)}),oO=v("$ZodISODateTime",($,I)=>{I.pattern??(I.pattern=HO(I)),A$.init($,I)}),dO=v("$ZodISODate",($,I)=>{I.pattern??(I.pattern=vO),A$.init($,I)}),pO=v("$ZodISOTime",($,I)=>{I.pattern??(I.pattern=JO(I)),A$.init($,I)}),tO=v("$ZodISODuration",($,I)=>{I.pattern??(I.pattern=DO),A$.init($,I)}),gD=v("$ZodIPv4",($,I)=>{I.pattern??(I.pattern=OO),A$.init($,I),$._zod.bag.format="ipv4"}),yD=v("$ZodIPv6",($,I)=>{I.pattern??(I.pattern=XO),A$.init($,I),$._zod.bag.format="ipv6",$._zod.check=(U)=>{try{new URL(`http://[${U.value}]`)}catch{U.issues.push({code:"invalid_format",format:"ipv6",input:U.value,inst:$,continue:!I.abort})}}}),xD=v("$ZodMAC",($,I)=>{I.pattern??(I.pattern=WO(I.delimiter)),A$.init($,I),$._zod.bag.format="mac"}),lD=v("$ZodCIDRv4",($,I)=>{I.pattern??(I.pattern=GO),A$.init($,I)}),hD=v("$ZodCIDRv6",($,I)=>{I.pattern??(I.pattern=QO),A$.init($,I),$._zod.check=(U)=>{let D=U.value.split("/");try{if(D.length!==2)throw new Error;let[b,w]=D;if(!w)throw new Error;let A=Number(w);if(`${A}`!==w)throw new Error;if(A<0||A>128)throw new Error;new URL(`http://[${b}]`)}catch{U.issues.push({code:"invalid_format",format:"cidrv6",input:U.value,inst:$,continue:!I.abort})}}});function aO($){if($==="")return!0;if($.length%4!==0)return!1;try{return atob($),!0}catch{return!1}}var uD=v("$ZodBase64",($,I)=>{I.pattern??(I.pattern=YO),A$.init($,I),$._zod.bag.contentEncoding="base64",$._zod.check=(U)=>{if(aO(U.value))return;U.issues.push({code:"invalid_format",format:"base64",input:U.value,inst:$,continue:!I.abort})}});function XB($){if(!JD.test($))return!1;let I=$.replace(/[-_]/g,(D)=>D==="-"?"+":"/"),U=I.padEnd(Math.ceil(I.length/4)*4,"=");return aO(U)}var iD=v("$ZodBase64URL",($,I)=>{I.pattern??(I.pattern=JD),A$.init($,I),$._zod.bag.contentEncoding="base64url",$._zod.check=(U)=>{if(XB(U.value))return;U.issues.push({code:"invalid_format",format:"base64url",input:U.value,inst:$,continue:!I.abort})}}),nD=v("$ZodE164",($,I)=>{I.pattern??(I.pattern=BO),A$.init($,I)});function WB($,I=null){try{let U=$.split(".");if(U.length!==3)return!1;let[D]=U;if(!D)return!1;let b=JSON.parse(atob(D));if("typ"in b&&b?.typ!=="JWT")return!1;if(!b.alg)return!1;if(I&&(!("alg"in b)||b.alg!==I))return!1;return!0}catch{return!1}}var cD=v("$ZodJWT",($,I)=>{A$.init($,I),$._zod.check=(U)=>{if(WB(U.value,I.alg))return;U.issues.push({code:"invalid_format",format:"jwt",input:U.value,inst:$,continue:!I.abort})}}),rD=v("$ZodCustomStringFormat",($,I)=>{A$.init($,I),$._zod.check=(U)=>{if(I.fn(U.value))return;U.issues.push({code:"invalid_format",format:I.format,input:U.value,inst:$,continue:!I.abort})}}),n1=v("$ZodNumber",($,I)=>{n.init($,I),$._zod.pattern=$._zod.bag.pattern??MO,$._zod.parse=(U,D)=>{if(I.coerce)try{U.value=Number(U.value)}catch(A){}let b=U.value;if(typeof b==="number"&&!Number.isNaN(b)&&Number.isFinite(b))return U;let w=typeof b==="number"?Number.isNaN(b)?"NaN":!Number.isFinite(b)?"Infinity":void 0:void 0;return U.issues.push({expected:"number",code:"invalid_type",input:b,inst:$,...w?{received:w}:{}}),U}}),mD=v("$ZodNumberFormat",($,I)=>{SO.init($,I),n1.init($,I)}),GI=v("$ZodBoolean",($,I)=>{n.init($,I),$._zod.pattern=KO,$._zod.parse=(U,D)=>{if(I.coerce)try{U.value=Boolean(U.value)}catch(w){}let b=U.value;if(typeof b==="boolean")return U;return U.issues.push({expected:"boolean",code:"invalid_type",input:b,inst:$}),U}}),c1=v("$ZodBigInt",($,I)=>{n.init($,I),$._zod.pattern=zO,$._zod.parse=(U,D)=>{if(I.coerce)try{U.value=BigInt(U.value)}catch(b){}if(typeof U.value==="bigint")return U;return U.issues.push({expected:"bigint",code:"invalid_type",input:U.value,inst:$}),U}}),oD=v("$ZodBigIntFormat",($,I)=>{PO.init($,I),c1.init($,I)}),dD=v("$ZodSymbol",($,I)=>{n.init($,I),$._zod.parse=(U,D)=>{let b=U.value;if(typeof b==="symbol")return U;return U.issues.push({expected:"symbol",code:"invalid_type",input:b,inst:$}),U}}),pD=v("$ZodUndefined",($,I)=>{n.init($,I),$._zod.pattern=qO,$._zod.values=new Set([void 0]),$._zod.optin="optional",$._zod.optout="optional",$._zod.parse=(U,D)=>{let b=U.value;if(typeof b==="undefined")return U;return U.issues.push({expected:"undefined",code:"invalid_type",input:b,inst:$}),U}}),tD=v("$ZodNull",($,I)=>{n.init($,I),$._zod.pattern=FO,$._zod.values=new Set([null]),$._zod.parse=(U,D)=>{let b=U.value;if(b===null)return U;return U.issues.push({expected:"null",code:"invalid_type",input:b,inst:$}),U}}),aD=v("$ZodAny",($,I)=>{n.init($,I),$._zod.parse=(U)=>U}),eD=v("$ZodUnknown",($,I)=>{n.init($,I),$._zod.parse=(U)=>U}),sD=v("$ZodNever",($,I)=>{n.init($,I),$._zod.parse=(U,D)=>{return U.issues.push({expected:"never",code:"invalid_type",input:U.value,inst:$}),U}}),$0=v("$ZodVoid",($,I)=>{n.init($,I),$._zod.parse=(U,D)=>{let b=U.value;if(typeof b==="undefined")return U;return U.issues.push({expected:"void",code:"invalid_type",input:b,inst:$}),U}}),I0=v("$ZodDate",($,I)=>{n.init($,I),$._zod.parse=(U,D)=>{if(I.coerce)try{U.value=new Date(U.value)}catch(N){}let b=U.value,w=b instanceof Date;if(w&&!Number.isNaN(b.getTime()))return U;return U.issues.push({expected:"date",code:"invalid_type",input:b,...w?{received:"Invalid Date"}:{},inst:$}),U}});function eY($,I,U){if($.issues.length)I.issues.push(...p$(U,$.issues));I.value[U]=$.value}var U0=v("$ZodArray",($,I)=>{n.init($,I),$._zod.parse=(U,D)=>{let b=U.value;if(!Array.isArray(b))return U.issues.push({expected:"array",code:"invalid_type",input:b,inst:$}),U;U.value=Array(b.length);let w=[];for(let A=0;A<b.length;A++){let N=b[A],O=I.element._zod.run({value:N,issues:[]},D);if(O instanceof Promise)w.push(O.then((X)=>eY(X,U,A)));else eY(O,U,A)}if(w.length)return Promise.all(w).then(()=>U);return U}});function qD($,I,U,D){if($.issues.length)I.issues.push(...p$(U,$.issues));if($.value===void 0){if(U in D)I.value[U]=void 0}else I.value[U]=$.value}function GB($){let I=Object.keys($.shape);for(let D of I)if(!$.shape?.[D]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${D}": expected a Zod schema`);let U=oN($.shape);return{...$,keys:I,keySet:new Set(I),numKeys:I.length,optionalKeys:new Set(U)}}function QB($,I,U,D,b,w){let A=[],N=b.keySet,O=b.catchall._zod,X=O.def.type;for(let G in I){if(N.has(G))continue;if(X==="never"){A.push(G);continue}let Q=O.run({value:I[G],issues:[]},D);if(Q instanceof Promise)$.push(Q.then((Y)=>qD(Y,U,G,I)));else qD(Q,U,G,I)}if(A.length)U.issues.push({code:"unrecognized_keys",keys:A,input:I,inst:w});if(!$.length)return U;return Promise.all($).then(()=>{return U})}var b0=v("$ZodObject",($,I)=>{if(n.init($,I),!Object.getOwnPropertyDescriptor(I,"shape")?.get){let N=I.shape;Object.defineProperty(I,"shape",{get:()=>{let O={...N};return Object.defineProperty(I,"shape",{value:O}),O}})}let D=DI(()=>GB(I));e($._zod,"propValues",()=>{let N=I.shape,O={};for(let X in N){let G=N[X]._zod;if(G.values){O[X]??(O[X]=new Set);for(let Q of G.values)O[X].add(Q)}}return O});let b=T4,w=I.catchall,A;$._zod.parse=(N,O)=>{A??(A=D.value);let X=N.value;if(!b(X))return N.issues.push({expected:"object",code:"invalid_type",input:X,inst:$}),N;N.value={};let G=[],Q=A.shape;for(let Y of A.keys){let J=Q[Y]._zod.run({value:X[Y],issues:[]},O);if(J instanceof Promise)G.push(J.then((L)=>qD(L,N,Y,X)));else qD(J,N,Y,X)}if(!w)return G.length?Promise.all(G).then(()=>N):N;return QB(G,X,N,O,D.value,$)}}),eO=v("$ZodObjectJIT",($,I)=>{b0.init($,I);let U=$._zod.parse,D=DI(()=>GB(I)),b=(Y)=>{let B=new zD(["shape","payload","ctx"]),J=D.value,L=(x)=>{let a=AD(x);return`shape[${a}]._zod.run({ value: input[${a}], issues: [] }, ctx)`};B.write("const input = payload.value;");let K=Object.create(null),k=0;for(let x of J.keys)K[x]=`key_${k++}`;B.write("const newResult = {};");for(let x of J.keys){let a=K[x],h=AD(x);B.write(`const ${a} = ${L(x)};`),B.write(`
|
|
9
|
+
deps: ${U}}`};var eT={keyword:"dependencies",type:"object",schemaType:"object",error:LH.error,code($){let[I,U]=sT($);vH($,I),BH($,U)}};function sT({schema:$}){let I={},U={};for(let D in $){if(D==="__proto__")continue;let b=Array.isArray($[D])?I:U;b[D]=$[D]}return[I,U]}function vH($,I=$.schema){let{gen:U,data:D,it:b}=$;if(Object.keys(I).length===0)return;let A=U.let("missing");for(let w in I){let O=I[w];if(O.length===0)continue;let N=Nb.propertyInData(U,D,w,b.opts.ownProperties);if($.setParams({property:w,depsCount:O.length,deps:O.join(", ")}),b.allErrors)U.if(N,()=>{for(let X of O)Nb.checkReportMissingProp($,X)});else U.if(v8._`${N} && (${Nb.checkMissingProp($,O,A)})`),Nb.reportMissingProp($,A),U.else()}}LH.validatePropertyDeps=vH;function BH($,I=$.schema){let{gen:U,data:D,keyword:b,it:A}=$,w=U.name("valid");for(let O in I){if(aT.alwaysValidSchema(A,I[O]))continue;U.if(Nb.propertyInData(U,D,O,A.opts.ownProperties),()=>{let N=$.subschema({keyword:b,schemaProp:O},w);$.mergeValidEvaluated(N,w)},()=>U.var(w,!0)),$.ok(w)}}LH.validateSchemaDeps=BH;LH.default=eT});var zH=T((KH)=>{Object.defineProperty(KH,"__esModule",{value:!0});var VH=d(),U2=A$(),b2={message:"property name must be valid",params:({params:$})=>VH._`{propertyName: ${$.propertyName}}`},D2={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:b2,code($){let{gen:I,schema:U,data:D,it:b}=$;if(U2.alwaysValidSchema(b,U))return;let A=I.name("valid");I.forIn("key",D,(w)=>{$.setParams({propertyName:w}),$.subschema({keyword:"propertyNames",data:w,dataTypes:["string"],propertyName:w,compositeRule:!0},A),I.if(VH.not(A),()=>{if($.error(!0),!b.allErrors)I.break()})}),$.ok(A)}};KH.default=D2});var B8=T((FH)=>{Object.defineProperty(FH,"__esModule",{value:!0});var sO=b6(),v6=d(),w2=i6(),$0=A$(),O2={message:"must NOT have additional properties",params:({params:$})=>v6._`{additionalProperty: ${$.additionalProperty}}`},N2={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:O2,code($){let{gen:I,schema:U,parentSchema:D,data:b,errsCount:A,it:w}=$;if(!A)throw new Error("ajv implementation error");let{allErrors:O,opts:N}=w;if(w.props=!0,N.removeAdditional!=="all"&&$0.alwaysValidSchema(w,U))return;let X=sO.allSchemaProperties(D.properties),G=sO.allSchemaProperties(D.patternProperties);Q(),$.ok(v6._`${A} === ${w2.default.errors}`);function Q(){I.forIn("key",b,(z)=>{if(!X.length&&!G.length)L(z);else I.if(Y(z),()=>L(z))})}function Y(z){let q;if(X.length>8){let g=$0.schemaRefOrVal(w,D.properties,"properties");q=sO.isOwnProperty(I,g,z)}else if(X.length)q=v6.or(...X.map((g)=>v6._`${z} === ${g}`));else q=v6.nil;if(G.length)q=v6.or(q,...G.map((g)=>v6._`${sO.usePattern($,g)}.test(${z})`));return v6.not(q)}function v(z){I.code(v6._`delete ${b}[${z}]`)}function L(z){if(N.removeAdditional==="all"||N.removeAdditional&&U===!1){v(z);return}if(U===!1){if($.setParams({additionalProperty:z}),$.error(),!O)I.break();return}if(typeof U=="object"&&!$0.alwaysValidSchema(w,U)){let q=I.name("valid");if(N.removeAdditional==="failing")H(z,q,!1),I.if(v6.not(q),()=>{$.reset(),v(z)});else if(H(z,q),!O)I.if(v6.not(q),()=>I.break())}}function H(z,q,g){let x={keyword:"additionalProperties",dataProp:z,dataPropType:$0.Type.Str};if(g===!1)Object.assign(x,{compositeRule:!0,createErrors:!1,allErrors:!1});$.subschema(x,q)}}};FH.default=N2});var SH=T((EH)=>{Object.defineProperty(EH,"__esModule",{value:!0});var W2=t1(),kH=b6(),L8=A$(),qH=B8(),G2={keyword:"properties",type:"object",schemaType:"object",code($){let{gen:I,schema:U,parentSchema:D,data:b,it:A}=$;if(A.opts.removeAdditional==="all"&&D.additionalProperties===void 0)qH.default.code(new W2.KeywordCxt(A,qH.default,"additionalProperties"));let w=kH.allSchemaProperties(U);for(let Q of w)A.definedProperties.add(Q);if(A.opts.unevaluated&&w.length&&A.props!==!0)A.props=L8.mergeEvaluated.props(I,L8.toHash(w),A.props);let O=w.filter((Q)=>!L8.alwaysValidSchema(A,U[Q]));if(O.length===0)return;let N=I.name("valid");for(let Q of O){if(X(Q))G(Q);else{if(I.if(kH.propertyInData(I,b,Q,A.opts.ownProperties)),G(Q),!A.allErrors)I.else().var(N,!0);I.endIf()}$.it.definedProperties.add(Q),$.ok(N)}function X(Q){return A.opts.useDefaults&&!A.compositeRule&&U[Q].default!==void 0}function G(Q){$.subschema({keyword:"properties",schemaProp:Q,dataProp:Q},N)}}};EH.default=G2});var _H=T((TH)=>{Object.defineProperty(TH,"__esModule",{value:!0});var jH=b6(),I0=d(),PH=A$(),RH=A$(),Y2={keyword:"patternProperties",type:"object",schemaType:"object",code($){let{gen:I,schema:U,data:D,parentSchema:b,it:A}=$,{opts:w}=A,O=jH.allSchemaProperties(U),N=O.filter((H)=>PH.alwaysValidSchema(A,U[H]));if(O.length===0||N.length===O.length&&(!A.opts.unevaluated||A.props===!0))return;let X=w.strictSchema&&!w.allowMatchingProperties&&b.properties,G=I.name("valid");if(A.props!==!0&&!(A.props instanceof I0.Name))A.props=RH.evaluatedPropsToName(I,A.props);let{props:Q}=A;Y();function Y(){for(let H of O){if(X)v(H);if(A.allErrors)L(H);else I.var(G,!0),L(H),I.if(G)}}function v(H){for(let z in X)if(new RegExp(H).test(z))PH.checkStrictMode(A,`property ${z} matches pattern ${H} (use allowMatchingProperties)`)}function L(H){I.forIn("key",D,(z)=>{I.if(I0._`${jH.usePattern($,H)}.test(${z})`,()=>{let q=N.includes(H);if(!q)$.subschema({keyword:"patternProperties",schemaProp:H,dataProp:z,dataPropType:RH.Type.Str},G);if(A.opts.unevaluated&&Q!==!0)I.assign(I0._`${Q}[${z}]`,!0);else if(!q&&!A.allErrors)I.if(I0.not(G),()=>I.break())})})}}};TH.default=Y2});var fH=T((CH)=>{Object.defineProperty(CH,"__esModule",{value:!0});var B2=A$(),L2={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code($){let{gen:I,schema:U,it:D}=$;if(B2.alwaysValidSchema(D,U)){$.fail();return}let b=I.name("valid");$.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},b),$.failResult(b,()=>$.reset(),()=>$.error())},error:{message:"must NOT be valid"}};CH.default=L2});var gH=T((ZH)=>{Object.defineProperty(ZH,"__esModule",{value:!0});var H2=b6(),M2={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:H2.validateUnion,error:{message:"must match a schema in anyOf"}};ZH.default=M2});var xH=T((yH)=>{Object.defineProperty(yH,"__esModule",{value:!0});var U0=d(),K2=A$(),z2={message:"must match exactly one schema in oneOf",params:({params:$})=>U0._`{passingSchemas: ${$.passing}}`},F2={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:z2,code($){let{gen:I,schema:U,parentSchema:D,it:b}=$;if(!Array.isArray(U))throw new Error("ajv implementation error");if(b.opts.discriminator&&D.discriminator)return;let A=U,w=I.let("valid",!1),O=I.let("passing",null),N=I.name("_valid");$.setParams({passing:O}),I.block(X),$.result(w,()=>$.reset(),()=>$.error(!0));function X(){A.forEach((G,Q)=>{let Y;if(K2.alwaysValidSchema(b,G))I.var(N,!0);else Y=$.subschema({keyword:"oneOf",schemaProp:Q,compositeRule:!0},N);if(Q>0)I.if(U0._`${N} && ${w}`).assign(w,!1).assign(O,U0._`[${O}, ${Q}]`).else();I.if(N,()=>{if(I.assign(w,!0),I.assign(O,Q),Y)$.mergeEvaluated(Y,U0.Name)})})}}};yH.default=F2});var hH=T((lH)=>{Object.defineProperty(lH,"__esModule",{value:!0});var q2=A$(),E2={keyword:"allOf",schemaType:"array",code($){let{gen:I,schema:U,it:D}=$;if(!Array.isArray(U))throw new Error("ajv implementation error");let b=I.name("valid");U.forEach((A,w)=>{if(q2.alwaysValidSchema(D,A))return;let O=$.subschema({keyword:"allOf",schemaProp:w},b);$.ok(b),$.mergeEvaluated(O)})}};lH.default=E2});var rH=T((nH)=>{Object.defineProperty(nH,"__esModule",{value:!0});var b0=d(),iH=A$(),j2={message:({params:$})=>b0.str`must match "${$.ifClause}" schema`,params:({params:$})=>b0._`{failingKeyword: ${$.ifClause}}`},P2={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:j2,code($){let{gen:I,parentSchema:U,it:D}=$;if(U.then===void 0&&U.else===void 0)iH.checkStrictMode(D,'"if" without "then" and "else" is ignored');let b=uH(D,"then"),A=uH(D,"else");if(!b&&!A)return;let w=I.let("valid",!0),O=I.name("_valid");if(N(),$.reset(),b&&A){let G=I.let("ifClause");$.setParams({ifClause:G}),I.if(O,X("then",G),X("else",G))}else if(b)I.if(O,X("then"));else I.if(b0.not(O),X("else"));$.pass(w,()=>$.error(!0));function N(){let G=$.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},O);$.mergeEvaluated(G)}function X(G,Q){return()=>{let Y=$.subschema({keyword:G},O);if(I.assign(w,O),$.mergeValidEvaluated(Y,w),Q)I.assign(Q,b0._`${G}`);else $.setParams({ifClause:G})}}}};function uH($,I){let U=$.schema[I];return U!==void 0&&!iH.alwaysValidSchema($,U)}nH.default=P2});var mH=T((cH)=>{Object.defineProperty(cH,"__esModule",{value:!0});var T2=A$(),_2={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:$,parentSchema:I,it:U}){if(I.if===void 0)T2.checkStrictMode(U,`"${$}" without "if" is ignored`)}};cH.default=_2});var dH=T((oH)=>{Object.defineProperty(oH,"__esModule",{value:!0});var f2=Q8(),Z2=NH(),g2=Y8(),y2=GH(),x2=YH(),l2=MH(),h2=zH(),u2=B8(),i2=SH(),n2=_H(),r2=fH(),c2=gH(),m2=xH(),o2=hH(),d2=rH(),p2=mH();function t2($=!1){let I=[r2.default,c2.default,m2.default,o2.default,d2.default,p2.default,h2.default,u2.default,l2.default,i2.default,n2.default];if($)I.push(Z2.default,y2.default);else I.push(f2.default,g2.default);return I.push(x2.default),I}oH.default=t2});var tH=T((pH)=>{Object.defineProperty(pH,"__esModule",{value:!0});var K$=d(),e2={message:({schemaCode:$})=>K$.str`must match format "${$}"`,params:({schemaCode:$})=>K$._`{format: ${$}}`},s2={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:e2,code($,I){let{gen:U,data:D,$data:b,schema:A,schemaCode:w,it:O}=$,{opts:N,errSchemaPath:X,schemaEnv:G,self:Q}=O;if(!N.validateFormats)return;if(b)Y();else v();function Y(){let L=U.scopeValue("formats",{ref:Q.formats,code:N.code.formats}),H=U.const("fDef",K$._`${L}[${w}]`),z=U.let("fType"),q=U.let("format");U.if(K$._`typeof ${H} == "object" && !(${H} instanceof RegExp)`,()=>U.assign(z,K$._`${H}.type || "string"`).assign(q,K$._`${H}.validate`),()=>U.assign(z,K$._`"string"`).assign(q,H)),$.fail$data(K$.or(g(),x()));function g(){if(N.strictSchema===!1)return K$.nil;return K$._`${w} && !${q}`}function x(){let a=G.$async?K$._`(${H}.async ? await ${q}(${D}) : ${q}(${D}))`:K$._`${q}(${D})`,h=K$._`(typeof ${q} == "function" ? ${a} : ${q}.test(${D}))`;return K$._`${q} && ${q} !== true && ${z} === ${I} && !${h}`}}function v(){let L=Q.formats[A];if(!L){g();return}if(L===!0)return;let[H,z,q]=x(L);if(H===I)$.pass(a());function g(){if(N.strictSchema===!1){Q.logger.warn(h());return}throw new Error(h());function h(){return`unknown format "${A}" ignored in schema at path "${X}"`}}function x(h){let M6=h instanceof RegExp?K$.regexpCode(h):N.code.formats?K$._`${N.code.formats}${K$.getProperty(A)}`:void 0,C6=U.scopeValue("formats",{key:A,ref:h,code:M6});if(typeof h=="object"&&!(h instanceof RegExp))return[h.type||"string",h.validate,K$._`${C6}.validate`];return["string",h,C6]}function a(){if(typeof L=="object"&&!(L instanceof RegExp)&&L.async){if(!G.$async)throw new Error("async format in sync schema");return K$._`await ${q}(${D})`}return typeof z=="function"?K$._`${q}(${D})`:K$._`${q}.test(${D})`}}}};pH.default=s2});var eH=T((aH)=>{Object.defineProperty(aH,"__esModule",{value:!0});var I_=tH(),U_=[I_.default];aH.default=U_});var IM=T((sH)=>{Object.defineProperty(sH,"__esModule",{value:!0});sH.contentVocabulary=sH.metadataVocabulary=void 0;sH.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];sH.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var DM=T((bM)=>{Object.defineProperty(bM,"__esModule",{value:!0});var A_=EJ(),w_=sJ(),O_=dH(),N_=eH(),UM=IM(),X_=[A_.default,w_.default,O_.default(),N_.default,UM.metadataVocabulary,UM.contentVocabulary];bM.default=X_});var NM=T((wM)=>{Object.defineProperty(wM,"__esModule",{value:!0});wM.DiscrError=void 0;var AM;(function($){$.Tag="tag",$.Mapping="mapping"})(AM||(wM.DiscrError=AM={}))});var GM=T((WM)=>{Object.defineProperty(WM,"__esModule",{value:!0});var sI=d(),J8=NM(),XM=xO(),G_=a1(),Q_=A$(),Y_={message:({params:{discrError:$,tagName:I}})=>$===J8.DiscrError.Tag?`tag "${I}" must be string`:`value of tag "${I}" must be in oneOf`,params:({params:{discrError:$,tag:I,tagName:U}})=>sI._`{error: ${$}, tag: ${U}, tagValue: ${I}}`},v_={keyword:"discriminator",type:"object",schemaType:"object",error:Y_,code($){let{gen:I,data:U,schema:D,parentSchema:b,it:A}=$,{oneOf:w}=b;if(!A.opts.discriminator)throw new Error("discriminator: requires discriminator option");let O=D.propertyName;if(typeof O!="string")throw new Error("discriminator: requires propertyName");if(D.mapping)throw new Error("discriminator: mapping is not supported");if(!w)throw new Error("discriminator: requires oneOf keyword");let N=I.let("valid",!1),X=I.const("tag",sI._`${U}${sI.getProperty(O)}`);I.if(sI._`typeof ${X} == "string"`,()=>G(),()=>$.error(!1,{discrError:J8.DiscrError.Tag,tag:X,tagName:O})),$.ok(N);function G(){let v=Y();I.if(!1);for(let L in v)I.elseIf(sI._`${X} === ${L}`),I.assign(N,Q(v[L]));I.else(),$.error(!1,{discrError:J8.DiscrError.Mapping,tag:X,tagName:O}),I.endIf()}function Q(v){let L=I.name("valid"),H=$.subschema({keyword:"oneOf",schemaProp:v},L);return $.mergeEvaluated(H,sI.Name),L}function Y(){var v;let L={},H=q(b),z=!0;for(let a=0;a<w.length;a++){let h=w[a];if((h===null||h===void 0?void 0:h.$ref)&&!Q_.schemaHasRulesButRef(h,A.self.RULES)){let C6=h.$ref;if(h=XM.resolveRef.call(A.self,A.schemaEnv.root,A.baseId,C6),h instanceof XM.SchemaEnv)h=h.schema;if(h===void 0)throw new G_.default(A.opts.uriResolver,A.baseId,C6)}let M6=(v=h===null||h===void 0?void 0:h.properties)===null||v===void 0?void 0:v[O];if(typeof M6!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${O}"`);z=z&&(H||q(h)),g(M6,a)}if(!z)throw new Error(`discriminator: "${O}" must be required`);return L;function q({required:a}){return Array.isArray(a)&&a.includes(O)}function g(a,h){if(a.const)x(a.const,h);else if(a.enum)for(let M6 of a.enum)x(M6,h);else throw new Error(`discriminator: "properties/${O}" must have "const" or "enum"`)}function x(a,h){if(typeof a!="string"||a in L)throw new Error(`discriminator: "${O}" values must be unique strings`);L[a]=h}}}};WM.default=v_});var QM=T((dn,L_)=>{L_.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var M8=T((o$,H8)=>{Object.defineProperty(o$,"__esModule",{value:!0});o$.MissingRefError=o$.ValidationError=o$.CodeGen=o$.Name=o$.nil=o$.stringify=o$.str=o$._=o$.KeywordCxt=o$.Ajv=void 0;var J_=LJ(),H_=DM(),M_=GM(),YM=QM(),V_=["/properties"],D0="http://json-schema.org/draft-07/schema";class Xb extends J_.default{_addVocabularies(){if(super._addVocabularies(),H_.default.forEach(($)=>this.addVocabulary($)),this.opts.discriminator)this.addKeyword(M_.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let $=this.opts.$data?this.$dataMetaSchema(YM,V_):YM;this.addMetaSchema($,D0,!1),this.refs["http://json-schema.org/schema"]=D0}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(D0)?D0:void 0)}}o$.Ajv=Xb;H8.exports=o$=Xb;H8.exports.Ajv=Xb;Object.defineProperty(o$,"__esModule",{value:!0});o$.default=Xb;var K_=t1();Object.defineProperty(o$,"KeywordCxt",{enumerable:!0,get:function(){return K_.KeywordCxt}});var $U=d();Object.defineProperty(o$,"_",{enumerable:!0,get:function(){return $U._}});Object.defineProperty(o$,"str",{enumerable:!0,get:function(){return $U.str}});Object.defineProperty(o$,"stringify",{enumerable:!0,get:function(){return $U.stringify}});Object.defineProperty(o$,"nil",{enumerable:!0,get:function(){return $U.nil}});Object.defineProperty(o$,"Name",{enumerable:!0,get:function(){return $U.Name}});Object.defineProperty(o$,"CodeGen",{enumerable:!0,get:function(){return $U.CodeGen}});var z_=gO();Object.defineProperty(o$,"ValidationError",{enumerable:!0,get:function(){return z_.default}});var F_=a1();Object.defineProperty(o$,"MissingRefError",{enumerable:!0,get:function(){return F_.default}})});var FM=T((KM)=>{Object.defineProperty(KM,"__esModule",{value:!0});KM.formatNames=KM.fastFormats=KM.fullFormats=void 0;function P6($,I){return{validate:$,compare:I}}KM.fullFormats={date:P6(JM,F8),time:P6(K8(!0),k8),"date-time":P6(vM(!0),MM),"iso-time":P6(K8(),HM),"iso-date-time":P6(vM(),VM),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:T_,"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:x_,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:__,int32:{type:"number",validate:Z_},int64:{type:"number",validate:g_},float:{type:"number",validate:LM},double:{type:"number",validate:LM},password:!0,binary:!0};KM.fastFormats={...KM.fullFormats,date:P6(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,F8),time:P6(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,k8),"date-time":P6(/^\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,MM),"iso-time":P6(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,HM),"iso-date-time":P6(/^\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,VM),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};KM.formatNames=Object.keys(KM.fullFormats);function E_($){return $%4===0&&($%100!==0||$%400===0)}var S_=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,j_=[0,31,28,31,30,31,30,31,31,30,31,30,31];function JM($){let I=S_.exec($);if(!I)return!1;let U=+I[1],D=+I[2],b=+I[3];return D>=1&&D<=12&&b>=1&&b<=(D===2&&E_(U)?29:j_[D])}function F8($,I){if(!($&&I))return;if($>I)return 1;if($<I)return-1;return 0}var V8=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function K8($){return function I(U){let D=V8.exec(U);if(!D)return!1;let b=+D[1],A=+D[2],w=+D[3],O=D[4],N=D[5]==="-"?-1:1,X=+(D[6]||0),G=+(D[7]||0);if(X>23||G>59||$&&!O)return!1;if(b<=23&&A<=59&&w<60)return!0;let Q=A-G*N,Y=b-X*N-(Q<0?1:0);return(Y===23||Y===-1)&&(Q===59||Q===-1)&&w<61}}function k8($,I){if(!($&&I))return;let U=new Date("2020-01-01T"+$).valueOf(),D=new Date("2020-01-01T"+I).valueOf();if(!(U&&D))return;return U-D}function HM($,I){if(!($&&I))return;let U=V8.exec($),D=V8.exec(I);if(!(U&&D))return;if($=U[1]+U[2]+U[3],I=D[1]+D[2]+D[3],$>I)return 1;if($<I)return-1;return 0}var z8=/t|\s/i;function vM($){let I=K8($);return function U(D){let b=D.split(z8);return b.length===2&&JM(b[0])&&I(b[1])}}function MM($,I){if(!($&&I))return;let U=new Date($).valueOf(),D=new Date(I).valueOf();if(!(U&&D))return;return U-D}function VM($,I){if(!($&&I))return;let[U,D]=$.split(z8),[b,A]=I.split(z8),w=F8(U,b);if(w===void 0)return;return w||k8(D,A)}var P_=/\/|:/,R_=/^(?:[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 T_($){return P_.test($)&&R_.test($)}var BM=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function __($){return BM.lastIndex=0,BM.test($)}var C_=-2147483648,f_=2147483647;function Z_($){return Number.isInteger($)&&$<=f_&&$>=C_}function g_($){return Number.isInteger($)}function LM(){return!0}var y_=/[^\\]\\Z/;function x_($){if(y_.test($))return!1;try{return new RegExp($),!0}catch(I){return!1}}});var qM=T((kM)=>{Object.defineProperty(kM,"__esModule",{value:!0});kM.formatLimitDefinition=void 0;var h_=M8(),B6=d(),K4=B6.operators,A0={formatMaximum:{okStr:"<=",ok:K4.LTE,fail:K4.GT},formatMinimum:{okStr:">=",ok:K4.GTE,fail:K4.LT},formatExclusiveMaximum:{okStr:"<",ok:K4.LT,fail:K4.GTE},formatExclusiveMinimum:{okStr:">",ok:K4.GT,fail:K4.LTE}},u_={message:({keyword:$,schemaCode:I})=>B6.str`should be ${A0[$].okStr} ${I}`,params:({keyword:$,schemaCode:I})=>B6._`{comparison: ${A0[$].okStr}, limit: ${I}}`};kM.formatLimitDefinition={keyword:Object.keys(A0),type:"string",schemaType:"string",$data:!0,error:u_,code($){let{gen:I,data:U,schemaCode:D,keyword:b,it:A}=$,{opts:w,self:O}=A;if(!w.validateFormats)return;let N=new h_.KeywordCxt(A,O.RULES.all.format.definition,"format");if(N.$data)X();else G();function X(){let Y=I.scopeValue("formats",{ref:O.formats,code:w.code.formats}),v=I.const("fmt",B6._`${Y}[${N.schemaCode}]`);$.fail$data(B6.or(B6._`typeof ${v} != "object"`,B6._`${v} instanceof RegExp`,B6._`typeof ${v}.compare != "function"`,Q(v)))}function G(){let Y=N.schema,v=O.formats[Y];if(!v||v===!0)return;if(typeof v!="object"||v instanceof RegExp||typeof v.compare!="function")throw new Error(`"${b}": format "${Y}" does not define "compare" function`);let L=I.scopeValue("formats",{key:Y,ref:v,code:w.code.formats?B6._`${w.code.formats}${B6.getProperty(Y)}`:void 0});$.fail$data(Q(L))}function Q(Y){return B6._`${Y}.compare(${U}, ${D}) ${A0[b].fail} 0`}},dependencies:["format"]};var i_=($)=>{return $.addKeyword(kM.formatLimitDefinition),$};kM.default=i_});var PM=T((Wb,jM)=>{Object.defineProperty(Wb,"__esModule",{value:!0});var IU=FM(),r_=qM(),S8=d(),EM=new S8.Name("fullFormats"),c_=new S8.Name("fastFormats"),j8=($,I={keywords:!0})=>{if(Array.isArray(I))return SM($,I,IU.fullFormats,EM),$;let[U,D]=I.mode==="fast"?[IU.fastFormats,c_]:[IU.fullFormats,EM],b=I.formats||IU.formatNames;if(SM($,b,U,D),I.keywords)r_.default($);return $};j8.get=($,I="full")=>{let D=(I==="fast"?IU.fastFormats:IU.fullFormats)[$];if(!D)throw new Error(`Unknown format "${$}"`);return D};function SM($,I,U,D){var b,A;(b=(A=$.opts.code).formats)!==null&&b!==void 0||(A.formats=S8._`require("ajv-formats/dist/formats").${D}`);for(let w of I)$.addFormat(w,U[w])}jM.exports=Wb=j8;Object.defineProperty(Wb,"__esModule",{value:!0});Wb.default=j8});var s;(function($){$.assertEqual=(b)=>{};function I(b){}$.assertIs=I;function U(b){throw new Error}$.assertNever=U,$.arrayToEnum=(b)=>{let A={};for(let w of b)A[w]=w;return A},$.getValidEnumValues=(b)=>{let A=$.objectKeys(b).filter((O)=>typeof b[b[O]]!=="number"),w={};for(let O of A)w[O]=b[O];return $.objectValues(w)},$.objectValues=(b)=>{return $.objectKeys(b).map(function(A){return b[A]})},$.objectKeys=typeof Object.keys==="function"?(b)=>Object.keys(b):(b)=>{let A=[];for(let w in b)if(Object.prototype.hasOwnProperty.call(b,w))A.push(w);return A},$.find=(b,A)=>{for(let w of b)if(A(w))return w;return},$.isInteger=typeof Number.isInteger==="function"?(b)=>Number.isInteger(b):(b)=>typeof b==="number"&&Number.isFinite(b)&&Math.floor(b)===b;function D(b,A=" | "){return b.map((w)=>typeof w==="string"?`'${w}'`:w).join(A)}$.joinValues=D,$.jsonStringifyReplacer=(b,A)=>{if(typeof A==="bigint")return A.toString();return A}})(s||(s={}));var pY;(function($){$.mergeShapes=(I,U)=>{return{...I,...U}}})(pY||(pY={}));var S=s.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Z6=($)=>{switch(typeof $){case"undefined":return S.undefined;case"string":return S.string;case"number":return Number.isNaN($)?S.nan:S.number;case"boolean":return S.boolean;case"function":return S.function;case"bigint":return S.bigint;case"symbol":return S.symbol;case"object":if(Array.isArray($))return S.array;if($===null)return S.null;if($.then&&typeof $.then==="function"&&$.catch&&typeof $.catch==="function")return S.promise;if(typeof Map!=="undefined"&&$ instanceof Map)return S.map;if(typeof Set!=="undefined"&&$ instanceof Set)return S.set;if(typeof Date!=="undefined"&&$ instanceof Date)return S.date;return S.object;default:return S.unknown}};var V=s.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"]);class d$ extends Error{get errors(){return this.issues}constructor($){super();this.issues=[],this.addIssue=(U)=>{this.issues=[...this.issues,U]},this.addIssues=(U=[])=>{this.issues=[...this.issues,...U]};let I=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,I);else this.__proto__=I;this.name="ZodError",this.issues=$}format($){let I=$||function(b){return b.message},U={_errors:[]},D=(b)=>{for(let A of b.issues)if(A.code==="invalid_union")A.unionErrors.map(D);else if(A.code==="invalid_return_type")D(A.returnTypeError);else if(A.code==="invalid_arguments")D(A.argumentsError);else if(A.path.length===0)U._errors.push(I(A));else{let w=U,O=0;while(O<A.path.length){let N=A.path[O];if(O!==A.path.length-1)w[N]=w[N]||{_errors:[]};else w[N]=w[N]||{_errors:[]},w[N]._errors.push(I(A));w=w[N],O++}}};return D(this),U}static assert($){if(!($ instanceof d$))throw new Error(`Not a ZodError: ${$}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,s.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten($=(I)=>I.message){let I=Object.create(null),U=[];for(let D of this.issues)if(D.path.length>0){let b=D.path[0];I[b]=I[b]||[],I[b].push($(D))}else U.push($(D));return{formErrors:U,fieldErrors:I}}get formErrors(){return this.flatten()}}d$.create=($)=>{return new d$($)};var mV=($,I)=>{let U;switch($.code){case V.invalid_type:if($.received===S.undefined)U="Required";else U=`Expected ${$.expected}, received ${$.received}`;break;case V.invalid_literal:U=`Invalid literal value, expected ${JSON.stringify($.expected,s.jsonStringifyReplacer)}`;break;case V.unrecognized_keys:U=`Unrecognized key(s) in object: ${s.joinValues($.keys,", ")}`;break;case V.invalid_union:U="Invalid input";break;case V.invalid_union_discriminator:U=`Invalid discriminator value. Expected ${s.joinValues($.options)}`;break;case V.invalid_enum_value:U=`Invalid enum value. Expected ${s.joinValues($.options)}, received '${$.received}'`;break;case V.invalid_arguments:U="Invalid function arguments";break;case V.invalid_return_type:U="Invalid function return type";break;case V.invalid_date:U="Invalid date";break;case V.invalid_string:if(typeof $.validation==="object")if("includes"in $.validation){if(U=`Invalid input: must include "${$.validation.includes}"`,typeof $.validation.position==="number")U=`${U} at one or more positions greater than or equal to ${$.validation.position}`}else if("startsWith"in $.validation)U=`Invalid input: must start with "${$.validation.startsWith}"`;else if("endsWith"in $.validation)U=`Invalid input: must end with "${$.validation.endsWith}"`;else s.assertNever($.validation);else if($.validation!=="regex")U=`Invalid ${$.validation}`;else U="Invalid";break;case V.too_small:if($.type==="array")U=`Array must contain ${$.exact?"exactly":$.inclusive?"at least":"more than"} ${$.minimum} element(s)`;else if($.type==="string")U=`String must contain ${$.exact?"exactly":$.inclusive?"at least":"over"} ${$.minimum} character(s)`;else if($.type==="number")U=`Number must be ${$.exact?"exactly equal to ":$.inclusive?"greater than or equal to ":"greater than "}${$.minimum}`;else if($.type==="bigint")U=`Number must be ${$.exact?"exactly equal to ":$.inclusive?"greater than or equal to ":"greater than "}${$.minimum}`;else if($.type==="date")U=`Date must be ${$.exact?"exactly equal to ":$.inclusive?"greater than or equal to ":"greater than "}${new Date(Number($.minimum))}`;else U="Invalid input";break;case V.too_big:if($.type==="array")U=`Array must contain ${$.exact?"exactly":$.inclusive?"at most":"less than"} ${$.maximum} element(s)`;else if($.type==="string")U=`String must contain ${$.exact?"exactly":$.inclusive?"at most":"under"} ${$.maximum} character(s)`;else if($.type==="number")U=`Number must be ${$.exact?"exactly":$.inclusive?"less than or equal to":"less than"} ${$.maximum}`;else if($.type==="bigint")U=`BigInt must be ${$.exact?"exactly":$.inclusive?"less than or equal to":"less than"} ${$.maximum}`;else if($.type==="date")U=`Date must be ${$.exact?"exactly":$.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number($.maximum))}`;else U="Invalid input";break;case V.custom:U="Invalid input";break;case V.invalid_intersection_types:U="Intersection results could not be merged";break;case V.not_multiple_of:U=`Number must be a multiple of ${$.multipleOf}`;break;case V.not_finite:U="Number must be finite";break;default:U=I.defaultError,s.assertNever($)}return{message:U}},p6=mV;var oV=p6;function HU(){return oV}var DD=($)=>{let{data:I,path:U,errorMaps:D,issueData:b}=$,A=[...U,...b.path||[]],w={...b,path:A};if(b.message!==void 0)return{...b,path:A,message:b.message};let O="",N=D.filter((X)=>!!X).slice().reverse();for(let X of N)O=X(w,{data:I,defaultError:O}).message;return{...b,path:A,message:O}};function P($,I){let U=HU(),D=DD({issueData:I,data:$.data,path:$.path,errorMaps:[$.common.contextualErrorMap,$.schemaErrorMap,U,U===p6?void 0:p6].filter((b)=>!!b)});$.common.issues.push(D)}class T${constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray($,I){let U=[];for(let D of I){if(D.status==="aborted")return u;if(D.status==="dirty")$.dirty();U.push(D.value)}return{status:$.value,value:U}}static async mergeObjectAsync($,I){let U=[];for(let D of I){let b=await D.key,A=await D.value;U.push({key:b,value:A})}return T$.mergeObjectSync($,U)}static mergeObjectSync($,I){let U={};for(let D of I){let{key:b,value:A}=D;if(b.status==="aborted")return u;if(A.status==="aborted")return u;if(b.status==="dirty")$.dirty();if(A.status==="dirty")$.dirty();if(b.value!=="__proto__"&&(typeof A.value!=="undefined"||D.alwaysSet))U[b.value]=A.value}return{status:$.value,value:U}}}var u=Object.freeze({status:"aborted"}),a4=($)=>({status:"dirty",value:$}),f$=($)=>({status:"valid",value:$}),i0=($)=>$.status==="aborted",n0=($)=>$.status==="dirty",S4=($)=>$.status==="valid",MU=($)=>typeof Promise!=="undefined"&&$ instanceof Promise;var C;(function($){$.errToObj=(I)=>typeof I==="string"?{message:I}:I||{},$.toString=(I)=>typeof I==="string"?I:I?.message})(C||(C={}));class A6{constructor($,I,U,D){this._cachedPath=[],this.parent=$,this.data=I,this._path=U,this._key=D}get path(){if(!this._cachedPath.length)if(Array.isArray(this._key))this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}var tY=($,I)=>{if(S4(I))return{success:!0,data:I.value};else{if(!$.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let U=new d$($.common.issues);return this._error=U,this._error}}}};function c($){if(!$)return{};let{errorMap:I,invalid_type_error:U,required_error:D,description:b}=$;if(I&&(U||D))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(I)return{errorMap:I,description:b};return{errorMap:(w,O)=>{let{message:N}=$;if(w.code==="invalid_enum_value")return{message:N??O.defaultError};if(typeof O.data==="undefined")return{message:N??D??O.defaultError};if(w.code!=="invalid_type")return{message:O.defaultError};return{message:N??U??O.defaultError}},description:b}}class t{get description(){return this._def.description}_getType($){return Z6($.data)}_getOrReturnCtx($,I){return I||{common:$.parent.common,data:$.data,parsedType:Z6($.data),schemaErrorMap:this._def.errorMap,path:$.path,parent:$.parent}}_processInputParams($){return{status:new T$,ctx:{common:$.parent.common,data:$.data,parsedType:Z6($.data),schemaErrorMap:this._def.errorMap,path:$.path,parent:$.parent}}}_parseSync($){let I=this._parse($);if(MU(I))throw new Error("Synchronous parse encountered promise.");return I}_parseAsync($){let I=this._parse($);return Promise.resolve(I)}parse($,I){let U=this.safeParse($,I);if(U.success)return U.data;throw U.error}safeParse($,I){let U={common:{issues:[],async:I?.async??!1,contextualErrorMap:I?.errorMap},path:I?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:Z6($)},D=this._parseSync({data:$,path:U.path,parent:U});return tY(U,D)}"~validate"($){let I={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:Z6($)};if(!this["~standard"].async)try{let U=this._parseSync({data:$,path:[],parent:I});return S4(U)?{value:U.value}:{issues:I.common.issues}}catch(U){if(U?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;I.common={issues:[],async:!0}}return this._parseAsync({data:$,path:[],parent:I}).then((U)=>S4(U)?{value:U.value}:{issues:I.common.issues})}async parseAsync($,I){let U=await this.safeParseAsync($,I);if(U.success)return U.data;throw U.error}async safeParseAsync($,I){let U={common:{issues:[],contextualErrorMap:I?.errorMap,async:!0},path:I?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:Z6($)},D=this._parse({data:$,path:U.path,parent:U}),b=await(MU(D)?D:Promise.resolve(D));return tY(U,b)}refine($,I){let U=(D)=>{if(typeof I==="string"||typeof I==="undefined")return{message:I};else if(typeof I==="function")return I(D);else return I};return this._refinement((D,b)=>{let A=$(D),w=()=>b.addIssue({code:V.custom,...U(D)});if(typeof Promise!=="undefined"&&A instanceof Promise)return A.then((O)=>{if(!O)return w(),!1;else return!0});if(!A)return w(),!1;else return!0})}refinement($,I){return this._refinement((U,D)=>{if(!$(U))return D.addIssue(typeof I==="function"?I(U,D):I),!1;else return!0})}_refinement($){return new z6({schema:this,typeName:F.ZodEffects,effect:{type:"refinement",refinement:$}})}superRefine($){return this._refinement($)}constructor($){this.spa=this.safeParseAsync,this._def=$,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:(I)=>this["~validate"](I)}}optional(){return K6.create(this,this._def)}nullable(){return t6.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return V6.create(this)}promise(){return UI.create(this,this._def)}or($){return kU.create([this,$],this._def)}and($){return qU.create(this,$,this._def)}transform($){return new z6({...c(this._def),schema:this,typeName:F.ZodEffects,effect:{type:"transform",transform:$}})}default($){let I=typeof $==="function"?$:()=>$;return new PU({...c(this._def),innerType:this,defaultValue:I,typeName:F.ZodDefault})}brand(){return new o0({typeName:F.ZodBranded,type:this,...c(this._def)})}catch($){let I=typeof $==="function"?$:()=>$;return new RU({...c(this._def),innerType:this,catchValue:I,typeName:F.ZodCatch})}describe($){return new this.constructor({...this._def,description:$})}pipe($){return QD.create(this,$)}readonly(){return TU.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}var dV=/^c[^\s-]{8,}$/i,pV=/^[0-9a-z]+$/,tV=/^[0-9A-HJKMNP-TV-Z]{26}$/i,aV=/^[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,eV=/^[a-z0-9_-]{21}$/i,sV=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,$K=/^[-+]?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)?)??$/,IK=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,UK="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",r0,bK=/^(?:(?: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])$/,DK=/^(?:(?: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])$/,AK=/^(([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]))$/,wK=/^(([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])$/,OK=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,NK=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,aY="((\\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])))",XK=new RegExp(`^${aY}$`);function eY($){let I="[0-5]\\d";if($.precision)I=`${I}\\.\\d{${$.precision}}`;else if($.precision==null)I=`${I}(\\.\\d+)?`;let U=$.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${I})${U}`}function WK($){return new RegExp(`^${eY($)}$`)}function GK($){let I=`${aY}T${eY($)}`,U=[];if(U.push($.local?"Z?":"Z"),$.offset)U.push("([+-]\\d{2}:?\\d{2})");return I=`${I}(${U.join("|")})`,new RegExp(`^${I}$`)}function QK($,I){if((I==="v4"||!I)&&bK.test($))return!0;if((I==="v6"||!I)&&AK.test($))return!0;return!1}function YK($,I){if(!sV.test($))return!1;try{let[U]=$.split(".");if(!U)return!1;let D=U.replace(/-/g,"+").replace(/_/g,"/").padEnd(U.length+(4-U.length%4)%4,"="),b=JSON.parse(atob(D));if(typeof b!=="object"||b===null)return!1;if("typ"in b&&b?.typ!=="JWT")return!1;if(!b.alg)return!1;if(I&&b.alg!==I)return!1;return!0}catch{return!1}}function vK($,I){if((I==="v4"||!I)&&DK.test($))return!0;if((I==="v6"||!I)&&wK.test($))return!0;return!1}class y6 extends t{_parse($){if(this._def.coerce)$.data=String($.data);if(this._getType($)!==S.string){let b=this._getOrReturnCtx($);return P(b,{code:V.invalid_type,expected:S.string,received:b.parsedType}),u}let U=new T$,D=void 0;for(let b of this._def.checks)if(b.kind==="min"){if($.data.length<b.value)D=this._getOrReturnCtx($,D),P(D,{code:V.too_small,minimum:b.value,type:"string",inclusive:!0,exact:!1,message:b.message}),U.dirty()}else if(b.kind==="max"){if($.data.length>b.value)D=this._getOrReturnCtx($,D),P(D,{code:V.too_big,maximum:b.value,type:"string",inclusive:!0,exact:!1,message:b.message}),U.dirty()}else if(b.kind==="length"){let A=$.data.length>b.value,w=$.data.length<b.value;if(A||w){if(D=this._getOrReturnCtx($,D),A)P(D,{code:V.too_big,maximum:b.value,type:"string",inclusive:!0,exact:!0,message:b.message});else if(w)P(D,{code:V.too_small,minimum:b.value,type:"string",inclusive:!0,exact:!0,message:b.message});U.dirty()}}else if(b.kind==="email"){if(!IK.test($.data))D=this._getOrReturnCtx($,D),P(D,{validation:"email",code:V.invalid_string,message:b.message}),U.dirty()}else if(b.kind==="emoji"){if(!r0)r0=new RegExp(UK,"u");if(!r0.test($.data))D=this._getOrReturnCtx($,D),P(D,{validation:"emoji",code:V.invalid_string,message:b.message}),U.dirty()}else if(b.kind==="uuid"){if(!aV.test($.data))D=this._getOrReturnCtx($,D),P(D,{validation:"uuid",code:V.invalid_string,message:b.message}),U.dirty()}else if(b.kind==="nanoid"){if(!eV.test($.data))D=this._getOrReturnCtx($,D),P(D,{validation:"nanoid",code:V.invalid_string,message:b.message}),U.dirty()}else if(b.kind==="cuid"){if(!dV.test($.data))D=this._getOrReturnCtx($,D),P(D,{validation:"cuid",code:V.invalid_string,message:b.message}),U.dirty()}else if(b.kind==="cuid2"){if(!pV.test($.data))D=this._getOrReturnCtx($,D),P(D,{validation:"cuid2",code:V.invalid_string,message:b.message}),U.dirty()}else if(b.kind==="ulid"){if(!tV.test($.data))D=this._getOrReturnCtx($,D),P(D,{validation:"ulid",code:V.invalid_string,message:b.message}),U.dirty()}else if(b.kind==="url")try{new URL($.data)}catch{D=this._getOrReturnCtx($,D),P(D,{validation:"url",code:V.invalid_string,message:b.message}),U.dirty()}else if(b.kind==="regex"){if(b.regex.lastIndex=0,!b.regex.test($.data))D=this._getOrReturnCtx($,D),P(D,{validation:"regex",code:V.invalid_string,message:b.message}),U.dirty()}else if(b.kind==="trim")$.data=$.data.trim();else if(b.kind==="includes"){if(!$.data.includes(b.value,b.position))D=this._getOrReturnCtx($,D),P(D,{code:V.invalid_string,validation:{includes:b.value,position:b.position},message:b.message}),U.dirty()}else if(b.kind==="toLowerCase")$.data=$.data.toLowerCase();else if(b.kind==="toUpperCase")$.data=$.data.toUpperCase();else if(b.kind==="startsWith"){if(!$.data.startsWith(b.value))D=this._getOrReturnCtx($,D),P(D,{code:V.invalid_string,validation:{startsWith:b.value},message:b.message}),U.dirty()}else if(b.kind==="endsWith"){if(!$.data.endsWith(b.value))D=this._getOrReturnCtx($,D),P(D,{code:V.invalid_string,validation:{endsWith:b.value},message:b.message}),U.dirty()}else if(b.kind==="datetime"){if(!GK(b).test($.data))D=this._getOrReturnCtx($,D),P(D,{code:V.invalid_string,validation:"datetime",message:b.message}),U.dirty()}else if(b.kind==="date"){if(!XK.test($.data))D=this._getOrReturnCtx($,D),P(D,{code:V.invalid_string,validation:"date",message:b.message}),U.dirty()}else if(b.kind==="time"){if(!WK(b).test($.data))D=this._getOrReturnCtx($,D),P(D,{code:V.invalid_string,validation:"time",message:b.message}),U.dirty()}else if(b.kind==="duration"){if(!$K.test($.data))D=this._getOrReturnCtx($,D),P(D,{validation:"duration",code:V.invalid_string,message:b.message}),U.dirty()}else if(b.kind==="ip"){if(!QK($.data,b.version))D=this._getOrReturnCtx($,D),P(D,{validation:"ip",code:V.invalid_string,message:b.message}),U.dirty()}else if(b.kind==="jwt"){if(!YK($.data,b.alg))D=this._getOrReturnCtx($,D),P(D,{validation:"jwt",code:V.invalid_string,message:b.message}),U.dirty()}else if(b.kind==="cidr"){if(!vK($.data,b.version))D=this._getOrReturnCtx($,D),P(D,{validation:"cidr",code:V.invalid_string,message:b.message}),U.dirty()}else if(b.kind==="base64"){if(!OK.test($.data))D=this._getOrReturnCtx($,D),P(D,{validation:"base64",code:V.invalid_string,message:b.message}),U.dirty()}else if(b.kind==="base64url"){if(!NK.test($.data))D=this._getOrReturnCtx($,D),P(D,{validation:"base64url",code:V.invalid_string,message:b.message}),U.dirty()}else s.assertNever(b);return{status:U.value,value:$.data}}_regex($,I,U){return this.refinement((D)=>$.test(D),{validation:I,code:V.invalid_string,...C.errToObj(U)})}_addCheck($){return new y6({...this._def,checks:[...this._def.checks,$]})}email($){return this._addCheck({kind:"email",...C.errToObj($)})}url($){return this._addCheck({kind:"url",...C.errToObj($)})}emoji($){return this._addCheck({kind:"emoji",...C.errToObj($)})}uuid($){return this._addCheck({kind:"uuid",...C.errToObj($)})}nanoid($){return this._addCheck({kind:"nanoid",...C.errToObj($)})}cuid($){return this._addCheck({kind:"cuid",...C.errToObj($)})}cuid2($){return this._addCheck({kind:"cuid2",...C.errToObj($)})}ulid($){return this._addCheck({kind:"ulid",...C.errToObj($)})}base64($){return this._addCheck({kind:"base64",...C.errToObj($)})}base64url($){return this._addCheck({kind:"base64url",...C.errToObj($)})}jwt($){return this._addCheck({kind:"jwt",...C.errToObj($)})}ip($){return this._addCheck({kind:"ip",...C.errToObj($)})}cidr($){return this._addCheck({kind:"cidr",...C.errToObj($)})}datetime($){if(typeof $==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:$});return this._addCheck({kind:"datetime",precision:typeof $?.precision==="undefined"?null:$?.precision,offset:$?.offset??!1,local:$?.local??!1,...C.errToObj($?.message)})}date($){return this._addCheck({kind:"date",message:$})}time($){if(typeof $==="string")return this._addCheck({kind:"time",precision:null,message:$});return this._addCheck({kind:"time",precision:typeof $?.precision==="undefined"?null:$?.precision,...C.errToObj($?.message)})}duration($){return this._addCheck({kind:"duration",...C.errToObj($)})}regex($,I){return this._addCheck({kind:"regex",regex:$,...C.errToObj(I)})}includes($,I){return this._addCheck({kind:"includes",value:$,position:I?.position,...C.errToObj(I?.message)})}startsWith($,I){return this._addCheck({kind:"startsWith",value:$,...C.errToObj(I)})}endsWith($,I){return this._addCheck({kind:"endsWith",value:$,...C.errToObj(I)})}min($,I){return this._addCheck({kind:"min",value:$,...C.errToObj(I)})}max($,I){return this._addCheck({kind:"max",value:$,...C.errToObj(I)})}length($,I){return this._addCheck({kind:"length",value:$,...C.errToObj(I)})}nonempty($){return this.min(1,C.errToObj($))}trim(){return new y6({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new y6({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new y6({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(($)=>$.kind==="datetime")}get isDate(){return!!this._def.checks.find(($)=>$.kind==="date")}get isTime(){return!!this._def.checks.find(($)=>$.kind==="time")}get isDuration(){return!!this._def.checks.find(($)=>$.kind==="duration")}get isEmail(){return!!this._def.checks.find(($)=>$.kind==="email")}get isURL(){return!!this._def.checks.find(($)=>$.kind==="url")}get isEmoji(){return!!this._def.checks.find(($)=>$.kind==="emoji")}get isUUID(){return!!this._def.checks.find(($)=>$.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(($)=>$.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(($)=>$.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(($)=>$.kind==="cuid2")}get isULID(){return!!this._def.checks.find(($)=>$.kind==="ulid")}get isIP(){return!!this._def.checks.find(($)=>$.kind==="ip")}get isCIDR(){return!!this._def.checks.find(($)=>$.kind==="cidr")}get isBase64(){return!!this._def.checks.find(($)=>$.kind==="base64")}get isBase64url(){return!!this._def.checks.find(($)=>$.kind==="base64url")}get minLength(){let $=null;for(let I of this._def.checks)if(I.kind==="min"){if($===null||I.value>$)$=I.value}return $}get maxLength(){let $=null;for(let I of this._def.checks)if(I.kind==="max"){if($===null||I.value<$)$=I.value}return $}}y6.create=($)=>{return new y6({checks:[],typeName:F.ZodString,coerce:$?.coerce??!1,...c($)})};function BK($,I){let U=($.toString().split(".")[1]||"").length,D=(I.toString().split(".")[1]||"").length,b=U>D?U:D,A=Number.parseInt($.toFixed(b).replace(".","")),w=Number.parseInt(I.toFixed(b).replace(".",""));return A%w/10**b}class s4 extends t{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse($){if(this._def.coerce)$.data=Number($.data);if(this._getType($)!==S.number){let b=this._getOrReturnCtx($);return P(b,{code:V.invalid_type,expected:S.number,received:b.parsedType}),u}let U=void 0,D=new T$;for(let b of this._def.checks)if(b.kind==="int"){if(!s.isInteger($.data))U=this._getOrReturnCtx($,U),P(U,{code:V.invalid_type,expected:"integer",received:"float",message:b.message}),D.dirty()}else if(b.kind==="min"){if(b.inclusive?$.data<b.value:$.data<=b.value)U=this._getOrReturnCtx($,U),P(U,{code:V.too_small,minimum:b.value,type:"number",inclusive:b.inclusive,exact:!1,message:b.message}),D.dirty()}else if(b.kind==="max"){if(b.inclusive?$.data>b.value:$.data>=b.value)U=this._getOrReturnCtx($,U),P(U,{code:V.too_big,maximum:b.value,type:"number",inclusive:b.inclusive,exact:!1,message:b.message}),D.dirty()}else if(b.kind==="multipleOf"){if(BK($.data,b.value)!==0)U=this._getOrReturnCtx($,U),P(U,{code:V.not_multiple_of,multipleOf:b.value,message:b.message}),D.dirty()}else if(b.kind==="finite"){if(!Number.isFinite($.data))U=this._getOrReturnCtx($,U),P(U,{code:V.not_finite,message:b.message}),D.dirty()}else s.assertNever(b);return{status:D.value,value:$.data}}gte($,I){return this.setLimit("min",$,!0,C.toString(I))}gt($,I){return this.setLimit("min",$,!1,C.toString(I))}lte($,I){return this.setLimit("max",$,!0,C.toString(I))}lt($,I){return this.setLimit("max",$,!1,C.toString(I))}setLimit($,I,U,D){return new s4({...this._def,checks:[...this._def.checks,{kind:$,value:I,inclusive:U,message:C.toString(D)}]})}_addCheck($){return new s4({...this._def,checks:[...this._def.checks,$]})}int($){return this._addCheck({kind:"int",message:C.toString($)})}positive($){return this._addCheck({kind:"min",value:0,inclusive:!1,message:C.toString($)})}negative($){return this._addCheck({kind:"max",value:0,inclusive:!1,message:C.toString($)})}nonpositive($){return this._addCheck({kind:"max",value:0,inclusive:!0,message:C.toString($)})}nonnegative($){return this._addCheck({kind:"min",value:0,inclusive:!0,message:C.toString($)})}multipleOf($,I){return this._addCheck({kind:"multipleOf",value:$,message:C.toString(I)})}finite($){return this._addCheck({kind:"finite",message:C.toString($)})}safe($){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:C.toString($)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:C.toString($)})}get minValue(){let $=null;for(let I of this._def.checks)if(I.kind==="min"){if($===null||I.value>$)$=I.value}return $}get maxValue(){let $=null;for(let I of this._def.checks)if(I.kind==="max"){if($===null||I.value<$)$=I.value}return $}get isInt(){return!!this._def.checks.find(($)=>$.kind==="int"||$.kind==="multipleOf"&&s.isInteger($.value))}get isFinite(){let $=null,I=null;for(let U of this._def.checks)if(U.kind==="finite"||U.kind==="int"||U.kind==="multipleOf")return!0;else if(U.kind==="min"){if(I===null||U.value>I)I=U.value}else if(U.kind==="max"){if($===null||U.value<$)$=U.value}return Number.isFinite(I)&&Number.isFinite($)}}s4.create=($)=>{return new s4({checks:[],typeName:F.ZodNumber,coerce:$?.coerce||!1,...c($)})};class $I extends t{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse($){if(this._def.coerce)try{$.data=BigInt($.data)}catch{return this._getInvalidInput($)}if(this._getType($)!==S.bigint)return this._getInvalidInput($);let U=void 0,D=new T$;for(let b of this._def.checks)if(b.kind==="min"){if(b.inclusive?$.data<b.value:$.data<=b.value)U=this._getOrReturnCtx($,U),P(U,{code:V.too_small,type:"bigint",minimum:b.value,inclusive:b.inclusive,message:b.message}),D.dirty()}else if(b.kind==="max"){if(b.inclusive?$.data>b.value:$.data>=b.value)U=this._getOrReturnCtx($,U),P(U,{code:V.too_big,type:"bigint",maximum:b.value,inclusive:b.inclusive,message:b.message}),D.dirty()}else if(b.kind==="multipleOf"){if($.data%b.value!==BigInt(0))U=this._getOrReturnCtx($,U),P(U,{code:V.not_multiple_of,multipleOf:b.value,message:b.message}),D.dirty()}else s.assertNever(b);return{status:D.value,value:$.data}}_getInvalidInput($){let I=this._getOrReturnCtx($);return P(I,{code:V.invalid_type,expected:S.bigint,received:I.parsedType}),u}gte($,I){return this.setLimit("min",$,!0,C.toString(I))}gt($,I){return this.setLimit("min",$,!1,C.toString(I))}lte($,I){return this.setLimit("max",$,!0,C.toString(I))}lt($,I){return this.setLimit("max",$,!1,C.toString(I))}setLimit($,I,U,D){return new $I({...this._def,checks:[...this._def.checks,{kind:$,value:I,inclusive:U,message:C.toString(D)}]})}_addCheck($){return new $I({...this._def,checks:[...this._def.checks,$]})}positive($){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:C.toString($)})}negative($){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:C.toString($)})}nonpositive($){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:C.toString($)})}nonnegative($){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:C.toString($)})}multipleOf($,I){return this._addCheck({kind:"multipleOf",value:$,message:C.toString(I)})}get minValue(){let $=null;for(let I of this._def.checks)if(I.kind==="min"){if($===null||I.value>$)$=I.value}return $}get maxValue(){let $=null;for(let I of this._def.checks)if(I.kind==="max"){if($===null||I.value<$)$=I.value}return $}}$I.create=($)=>{return new $I({checks:[],typeName:F.ZodBigInt,coerce:$?.coerce??!1,...c($)})};class AD extends t{_parse($){if(this._def.coerce)$.data=Boolean($.data);if(this._getType($)!==S.boolean){let U=this._getOrReturnCtx($);return P(U,{code:V.invalid_type,expected:S.boolean,received:U.parsedType}),u}return f$($.data)}}AD.create=($)=>{return new AD({typeName:F.ZodBoolean,coerce:$?.coerce||!1,...c($)})};class KU extends t{_parse($){if(this._def.coerce)$.data=new Date($.data);if(this._getType($)!==S.date){let b=this._getOrReturnCtx($);return P(b,{code:V.invalid_type,expected:S.date,received:b.parsedType}),u}if(Number.isNaN($.data.getTime())){let b=this._getOrReturnCtx($);return P(b,{code:V.invalid_date}),u}let U=new T$,D=void 0;for(let b of this._def.checks)if(b.kind==="min"){if($.data.getTime()<b.value)D=this._getOrReturnCtx($,D),P(D,{code:V.too_small,message:b.message,inclusive:!0,exact:!1,minimum:b.value,type:"date"}),U.dirty()}else if(b.kind==="max"){if($.data.getTime()>b.value)D=this._getOrReturnCtx($,D),P(D,{code:V.too_big,message:b.message,inclusive:!0,exact:!1,maximum:b.value,type:"date"}),U.dirty()}else s.assertNever(b);return{status:U.value,value:new Date($.data.getTime())}}_addCheck($){return new KU({...this._def,checks:[...this._def.checks,$]})}min($,I){return this._addCheck({kind:"min",value:$.getTime(),message:C.toString(I)})}max($,I){return this._addCheck({kind:"max",value:$.getTime(),message:C.toString(I)})}get minDate(){let $=null;for(let I of this._def.checks)if(I.kind==="min"){if($===null||I.value>$)$=I.value}return $!=null?new Date($):null}get maxDate(){let $=null;for(let I of this._def.checks)if(I.kind==="max"){if($===null||I.value<$)$=I.value}return $!=null?new Date($):null}}KU.create=($)=>{return new KU({checks:[],coerce:$?.coerce||!1,typeName:F.ZodDate,...c($)})};class wD extends t{_parse($){if(this._getType($)!==S.symbol){let U=this._getOrReturnCtx($);return P(U,{code:V.invalid_type,expected:S.symbol,received:U.parsedType}),u}return f$($.data)}}wD.create=($)=>{return new wD({typeName:F.ZodSymbol,...c($)})};class zU extends t{_parse($){if(this._getType($)!==S.undefined){let U=this._getOrReturnCtx($);return P(U,{code:V.invalid_type,expected:S.undefined,received:U.parsedType}),u}return f$($.data)}}zU.create=($)=>{return new zU({typeName:F.ZodUndefined,...c($)})};class FU extends t{_parse($){if(this._getType($)!==S.null){let U=this._getOrReturnCtx($);return P(U,{code:V.invalid_type,expected:S.null,received:U.parsedType}),u}return f$($.data)}}FU.create=($)=>{return new FU({typeName:F.ZodNull,...c($)})};class OD extends t{constructor(){super(...arguments);this._any=!0}_parse($){return f$($.data)}}OD.create=($)=>{return new OD({typeName:F.ZodAny,...c($)})};class j4 extends t{constructor(){super(...arguments);this._unknown=!0}_parse($){return f$($.data)}}j4.create=($)=>{return new j4({typeName:F.ZodUnknown,...c($)})};class x6 extends t{_parse($){let I=this._getOrReturnCtx($);return P(I,{code:V.invalid_type,expected:S.never,received:I.parsedType}),u}}x6.create=($)=>{return new x6({typeName:F.ZodNever,...c($)})};class ND extends t{_parse($){if(this._getType($)!==S.undefined){let U=this._getOrReturnCtx($);return P(U,{code:V.invalid_type,expected:S.void,received:U.parsedType}),u}return f$($.data)}}ND.create=($)=>{return new ND({typeName:F.ZodVoid,...c($)})};class V6 extends t{_parse($){let{ctx:I,status:U}=this._processInputParams($),D=this._def;if(I.parsedType!==S.array)return P(I,{code:V.invalid_type,expected:S.array,received:I.parsedType}),u;if(D.exactLength!==null){let A=I.data.length>D.exactLength.value,w=I.data.length<D.exactLength.value;if(A||w)P(I,{code:A?V.too_big:V.too_small,minimum:w?D.exactLength.value:void 0,maximum:A?D.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:D.exactLength.message}),U.dirty()}if(D.minLength!==null){if(I.data.length<D.minLength.value)P(I,{code:V.too_small,minimum:D.minLength.value,type:"array",inclusive:!0,exact:!1,message:D.minLength.message}),U.dirty()}if(D.maxLength!==null){if(I.data.length>D.maxLength.value)P(I,{code:V.too_big,maximum:D.maxLength.value,type:"array",inclusive:!0,exact:!1,message:D.maxLength.message}),U.dirty()}if(I.common.async)return Promise.all([...I.data].map((A,w)=>{return D.type._parseAsync(new A6(I,A,I.path,w))})).then((A)=>{return T$.mergeArray(U,A)});let b=[...I.data].map((A,w)=>{return D.type._parseSync(new A6(I,A,I.path,w))});return T$.mergeArray(U,b)}get element(){return this._def.type}min($,I){return new V6({...this._def,minLength:{value:$,message:C.toString(I)}})}max($,I){return new V6({...this._def,maxLength:{value:$,message:C.toString(I)}})}length($,I){return new V6({...this._def,exactLength:{value:$,message:C.toString(I)}})}nonempty($){return this.min(1,$)}}V6.create=($,I)=>{return new V6({type:$,minLength:null,maxLength:null,exactLength:null,typeName:F.ZodArray,...c(I)})};function e4($){if($ instanceof H$){let I={};for(let U in $.shape){let D=$.shape[U];I[U]=K6.create(e4(D))}return new H$({...$._def,shape:()=>I})}else if($ instanceof V6)return new V6({...$._def,type:e4($.element)});else if($ instanceof K6)return K6.create(e4($.unwrap()));else if($ instanceof t6)return t6.create(e4($.unwrap()));else if($ instanceof l6)return l6.create($.items.map((I)=>e4(I)));else return $}class H$ extends t{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let $=this._def.shape(),I=s.objectKeys($);return this._cached={shape:$,keys:I},this._cached}_parse($){if(this._getType($)!==S.object){let N=this._getOrReturnCtx($);return P(N,{code:V.invalid_type,expected:S.object,received:N.parsedType}),u}let{status:U,ctx:D}=this._processInputParams($),{shape:b,keys:A}=this._getCached(),w=[];if(!(this._def.catchall instanceof x6&&this._def.unknownKeys==="strip")){for(let N in D.data)if(!A.includes(N))w.push(N)}let O=[];for(let N of A){let X=b[N],G=D.data[N];O.push({key:{status:"valid",value:N},value:X._parse(new A6(D,G,D.path,N)),alwaysSet:N in D.data})}if(this._def.catchall instanceof x6){let N=this._def.unknownKeys;if(N==="passthrough")for(let X of w)O.push({key:{status:"valid",value:X},value:{status:"valid",value:D.data[X]}});else if(N==="strict"){if(w.length>0)P(D,{code:V.unrecognized_keys,keys:w}),U.dirty()}else if(N==="strip");else throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let N=this._def.catchall;for(let X of w){let G=D.data[X];O.push({key:{status:"valid",value:X},value:N._parse(new A6(D,G,D.path,X)),alwaysSet:X in D.data})}}if(D.common.async)return Promise.resolve().then(async()=>{let N=[];for(let X of O){let G=await X.key,Q=await X.value;N.push({key:G,value:Q,alwaysSet:X.alwaysSet})}return N}).then((N)=>{return T$.mergeObjectSync(U,N)});else return T$.mergeObjectSync(U,O)}get shape(){return this._def.shape()}strict($){return C.errToObj,new H$({...this._def,unknownKeys:"strict",...$!==void 0?{errorMap:(I,U)=>{let D=this._def.errorMap?.(I,U).message??U.defaultError;if(I.code==="unrecognized_keys")return{message:C.errToObj($).message??D};return{message:D}}}:{}})}strip(){return new H$({...this._def,unknownKeys:"strip"})}passthrough(){return new H$({...this._def,unknownKeys:"passthrough"})}extend($){return new H$({...this._def,shape:()=>({...this._def.shape(),...$})})}merge($){return new H$({unknownKeys:$._def.unknownKeys,catchall:$._def.catchall,shape:()=>({...this._def.shape(),...$._def.shape()}),typeName:F.ZodObject})}setKey($,I){return this.augment({[$]:I})}catchall($){return new H$({...this._def,catchall:$})}pick($){let I={};for(let U of s.objectKeys($))if($[U]&&this.shape[U])I[U]=this.shape[U];return new H$({...this._def,shape:()=>I})}omit($){let I={};for(let U of s.objectKeys(this.shape))if(!$[U])I[U]=this.shape[U];return new H$({...this._def,shape:()=>I})}deepPartial(){return e4(this)}partial($){let I={};for(let U of s.objectKeys(this.shape)){let D=this.shape[U];if($&&!$[U])I[U]=D;else I[U]=D.optional()}return new H$({...this._def,shape:()=>I})}required($){let I={};for(let U of s.objectKeys(this.shape))if($&&!$[U])I[U]=this.shape[U];else{let b=this.shape[U];while(b instanceof K6)b=b._def.innerType;I[U]=b}return new H$({...this._def,shape:()=>I})}keyof(){return sY(s.objectKeys(this.shape))}}H$.create=($,I)=>{return new H$({shape:()=>$,unknownKeys:"strip",catchall:x6.create(),typeName:F.ZodObject,...c(I)})};H$.strictCreate=($,I)=>{return new H$({shape:()=>$,unknownKeys:"strict",catchall:x6.create(),typeName:F.ZodObject,...c(I)})};H$.lazycreate=($,I)=>{return new H$({shape:$,unknownKeys:"strip",catchall:x6.create(),typeName:F.ZodObject,...c(I)})};class kU extends t{_parse($){let{ctx:I}=this._processInputParams($),U=this._def.options;function D(b){for(let w of b)if(w.result.status==="valid")return w.result;for(let w of b)if(w.result.status==="dirty")return I.common.issues.push(...w.ctx.common.issues),w.result;let A=b.map((w)=>new d$(w.ctx.common.issues));return P(I,{code:V.invalid_union,unionErrors:A}),u}if(I.common.async)return Promise.all(U.map(async(b)=>{let A={...I,common:{...I.common,issues:[]},parent:null};return{result:await b._parseAsync({data:I.data,path:I.path,parent:A}),ctx:A}})).then(D);else{let b=void 0,A=[];for(let O of U){let N={...I,common:{...I.common,issues:[]},parent:null},X=O._parseSync({data:I.data,path:I.path,parent:N});if(X.status==="valid")return X;else if(X.status==="dirty"&&!b)b={result:X,ctx:N};if(N.common.issues.length)A.push(N.common.issues)}if(b)return I.common.issues.push(...b.ctx.common.issues),b.result;let w=A.map((O)=>new d$(O));return P(I,{code:V.invalid_union,unionErrors:w}),u}}get options(){return this._def.options}}kU.create=($,I)=>{return new kU({options:$,typeName:F.ZodUnion,...c(I)})};var g6=($)=>{if($ instanceof EU)return g6($.schema);else if($ instanceof z6)return g6($.innerType());else if($ instanceof SU)return[$.value];else if($ instanceof P4)return $.options;else if($ instanceof jU)return s.objectValues($.enum);else if($ instanceof PU)return g6($._def.innerType);else if($ instanceof zU)return[void 0];else if($ instanceof FU)return[null];else if($ instanceof K6)return[void 0,...g6($.unwrap())];else if($ instanceof t6)return[null,...g6($.unwrap())];else if($ instanceof o0)return g6($.unwrap());else if($ instanceof TU)return g6($.unwrap());else if($ instanceof RU)return g6($._def.innerType);else return[]};class m0 extends t{_parse($){let{ctx:I}=this._processInputParams($);if(I.parsedType!==S.object)return P(I,{code:V.invalid_type,expected:S.object,received:I.parsedType}),u;let U=this.discriminator,D=I.data[U],b=this.optionsMap.get(D);if(!b)return P(I,{code:V.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[U]}),u;if(I.common.async)return b._parseAsync({data:I.data,path:I.path,parent:I});else return b._parseSync({data:I.data,path:I.path,parent:I})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create($,I,U){let D=new Map;for(let b of I){let A=g6(b.shape[$]);if(!A.length)throw new Error(`A discriminator value for key \`${$}\` could not be extracted from all schema options`);for(let w of A){if(D.has(w))throw new Error(`Discriminator property ${String($)} has duplicate value ${String(w)}`);D.set(w,b)}}return new m0({typeName:F.ZodDiscriminatedUnion,discriminator:$,options:I,optionsMap:D,...c(U)})}}function c0($,I){let U=Z6($),D=Z6(I);if($===I)return{valid:!0,data:$};else if(U===S.object&&D===S.object){let b=s.objectKeys(I),A=s.objectKeys($).filter((O)=>b.indexOf(O)!==-1),w={...$,...I};for(let O of A){let N=c0($[O],I[O]);if(!N.valid)return{valid:!1};w[O]=N.data}return{valid:!0,data:w}}else if(U===S.array&&D===S.array){if($.length!==I.length)return{valid:!1};let b=[];for(let A=0;A<$.length;A++){let w=$[A],O=I[A],N=c0(w,O);if(!N.valid)return{valid:!1};b.push(N.data)}return{valid:!0,data:b}}else if(U===S.date&&D===S.date&&+$===+I)return{valid:!0,data:$};else return{valid:!1}}class qU extends t{_parse($){let{status:I,ctx:U}=this._processInputParams($),D=(b,A)=>{if(i0(b)||i0(A))return u;let w=c0(b.value,A.value);if(!w.valid)return P(U,{code:V.invalid_intersection_types}),u;if(n0(b)||n0(A))I.dirty();return{status:I.value,value:w.data}};if(U.common.async)return Promise.all([this._def.left._parseAsync({data:U.data,path:U.path,parent:U}),this._def.right._parseAsync({data:U.data,path:U.path,parent:U})]).then(([b,A])=>D(b,A));else return D(this._def.left._parseSync({data:U.data,path:U.path,parent:U}),this._def.right._parseSync({data:U.data,path:U.path,parent:U}))}}qU.create=($,I,U)=>{return new qU({left:$,right:I,typeName:F.ZodIntersection,...c(U)})};class l6 extends t{_parse($){let{status:I,ctx:U}=this._processInputParams($);if(U.parsedType!==S.array)return P(U,{code:V.invalid_type,expected:S.array,received:U.parsedType}),u;if(U.data.length<this._def.items.length)return P(U,{code:V.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),u;if(!this._def.rest&&U.data.length>this._def.items.length)P(U,{code:V.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),I.dirty();let b=[...U.data].map((A,w)=>{let O=this._def.items[w]||this._def.rest;if(!O)return null;return O._parse(new A6(U,A,U.path,w))}).filter((A)=>!!A);if(U.common.async)return Promise.all(b).then((A)=>{return T$.mergeArray(I,A)});else return T$.mergeArray(I,b)}get items(){return this._def.items}rest($){return new l6({...this._def,rest:$})}}l6.create=($,I)=>{if(!Array.isArray($))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new l6({items:$,typeName:F.ZodTuple,rest:null,...c(I)})};class XD extends t{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse($){let{status:I,ctx:U}=this._processInputParams($);if(U.parsedType!==S.object)return P(U,{code:V.invalid_type,expected:S.object,received:U.parsedType}),u;let D=[],b=this._def.keyType,A=this._def.valueType;for(let w in U.data)D.push({key:b._parse(new A6(U,w,U.path,w)),value:A._parse(new A6(U,U.data[w],U.path,w)),alwaysSet:w in U.data});if(U.common.async)return T$.mergeObjectAsync(I,D);else return T$.mergeObjectSync(I,D)}get element(){return this._def.valueType}static create($,I,U){if(I instanceof t)return new XD({keyType:$,valueType:I,typeName:F.ZodRecord,...c(U)});return new XD({keyType:y6.create(),valueType:$,typeName:F.ZodRecord,...c(I)})}}class WD extends t{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse($){let{status:I,ctx:U}=this._processInputParams($);if(U.parsedType!==S.map)return P(U,{code:V.invalid_type,expected:S.map,received:U.parsedType}),u;let D=this._def.keyType,b=this._def.valueType,A=[...U.data.entries()].map(([w,O],N)=>{return{key:D._parse(new A6(U,w,U.path,[N,"key"])),value:b._parse(new A6(U,O,U.path,[N,"value"]))}});if(U.common.async){let w=new Map;return Promise.resolve().then(async()=>{for(let O of A){let N=await O.key,X=await O.value;if(N.status==="aborted"||X.status==="aborted")return u;if(N.status==="dirty"||X.status==="dirty")I.dirty();w.set(N.value,X.value)}return{status:I.value,value:w}})}else{let w=new Map;for(let O of A){let{key:N,value:X}=O;if(N.status==="aborted"||X.status==="aborted")return u;if(N.status==="dirty"||X.status==="dirty")I.dirty();w.set(N.value,X.value)}return{status:I.value,value:w}}}}WD.create=($,I,U)=>{return new WD({valueType:I,keyType:$,typeName:F.ZodMap,...c(U)})};class II extends t{_parse($){let{status:I,ctx:U}=this._processInputParams($);if(U.parsedType!==S.set)return P(U,{code:V.invalid_type,expected:S.set,received:U.parsedType}),u;let D=this._def;if(D.minSize!==null){if(U.data.size<D.minSize.value)P(U,{code:V.too_small,minimum:D.minSize.value,type:"set",inclusive:!0,exact:!1,message:D.minSize.message}),I.dirty()}if(D.maxSize!==null){if(U.data.size>D.maxSize.value)P(U,{code:V.too_big,maximum:D.maxSize.value,type:"set",inclusive:!0,exact:!1,message:D.maxSize.message}),I.dirty()}let b=this._def.valueType;function A(O){let N=new Set;for(let X of O){if(X.status==="aborted")return u;if(X.status==="dirty")I.dirty();N.add(X.value)}return{status:I.value,value:N}}let w=[...U.data.values()].map((O,N)=>b._parse(new A6(U,O,U.path,N)));if(U.common.async)return Promise.all(w).then((O)=>A(O));else return A(w)}min($,I){return new II({...this._def,minSize:{value:$,message:C.toString(I)}})}max($,I){return new II({...this._def,maxSize:{value:$,message:C.toString(I)}})}size($,I){return this.min($,I).max($,I)}nonempty($){return this.min(1,$)}}II.create=($,I)=>{return new II({valueType:$,minSize:null,maxSize:null,typeName:F.ZodSet,...c(I)})};class VU extends t{constructor(){super(...arguments);this.validate=this.implement}_parse($){let{ctx:I}=this._processInputParams($);if(I.parsedType!==S.function)return P(I,{code:V.invalid_type,expected:S.function,received:I.parsedType}),u;function U(w,O){return DD({data:w,path:I.path,errorMaps:[I.common.contextualErrorMap,I.schemaErrorMap,HU(),p6].filter((N)=>!!N),issueData:{code:V.invalid_arguments,argumentsError:O}})}function D(w,O){return DD({data:w,path:I.path,errorMaps:[I.common.contextualErrorMap,I.schemaErrorMap,HU(),p6].filter((N)=>!!N),issueData:{code:V.invalid_return_type,returnTypeError:O}})}let b={errorMap:I.common.contextualErrorMap},A=I.data;if(this._def.returns instanceof UI){let w=this;return f$(async function(...O){let N=new d$([]),X=await w._def.args.parseAsync(O,b).catch((Y)=>{throw N.addIssue(U(O,Y)),N}),G=await Reflect.apply(A,this,X);return await w._def.returns._def.type.parseAsync(G,b).catch((Y)=>{throw N.addIssue(D(G,Y)),N})})}else{let w=this;return f$(function(...O){let N=w._def.args.safeParse(O,b);if(!N.success)throw new d$([U(O,N.error)]);let X=Reflect.apply(A,this,N.data),G=w._def.returns.safeParse(X,b);if(!G.success)throw new d$([D(X,G.error)]);return G.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...$){return new VU({...this._def,args:l6.create($).rest(j4.create())})}returns($){return new VU({...this._def,returns:$})}implement($){return this.parse($)}strictImplement($){return this.parse($)}static create($,I,U){return new VU({args:$?$:l6.create([]).rest(j4.create()),returns:I||j4.create(),typeName:F.ZodFunction,...c(U)})}}class EU extends t{get schema(){return this._def.getter()}_parse($){let{ctx:I}=this._processInputParams($);return this._def.getter()._parse({data:I.data,path:I.path,parent:I})}}EU.create=($,I)=>{return new EU({getter:$,typeName:F.ZodLazy,...c(I)})};class SU extends t{_parse($){if($.data!==this._def.value){let I=this._getOrReturnCtx($);return P(I,{received:I.data,code:V.invalid_literal,expected:this._def.value}),u}return{status:"valid",value:$.data}}get value(){return this._def.value}}SU.create=($,I)=>{return new SU({value:$,typeName:F.ZodLiteral,...c(I)})};function sY($,I){return new P4({values:$,typeName:F.ZodEnum,...c(I)})}class P4 extends t{_parse($){if(typeof $.data!=="string"){let I=this._getOrReturnCtx($),U=this._def.values;return P(I,{expected:s.joinValues(U),received:I.parsedType,code:V.invalid_type}),u}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has($.data)){let I=this._getOrReturnCtx($),U=this._def.values;return P(I,{received:I.data,code:V.invalid_enum_value,options:U}),u}return f$($.data)}get options(){return this._def.values}get enum(){let $={};for(let I of this._def.values)$[I]=I;return $}get Values(){let $={};for(let I of this._def.values)$[I]=I;return $}get Enum(){let $={};for(let I of this._def.values)$[I]=I;return $}extract($,I=this._def){return P4.create($,{...this._def,...I})}exclude($,I=this._def){return P4.create(this.options.filter((U)=>!$.includes(U)),{...this._def,...I})}}P4.create=sY;class jU extends t{_parse($){let I=s.getValidEnumValues(this._def.values),U=this._getOrReturnCtx($);if(U.parsedType!==S.string&&U.parsedType!==S.number){let D=s.objectValues(I);return P(U,{expected:s.joinValues(D),received:U.parsedType,code:V.invalid_type}),u}if(!this._cache)this._cache=new Set(s.getValidEnumValues(this._def.values));if(!this._cache.has($.data)){let D=s.objectValues(I);return P(U,{received:U.data,code:V.invalid_enum_value,options:D}),u}return f$($.data)}get enum(){return this._def.values}}jU.create=($,I)=>{return new jU({values:$,typeName:F.ZodNativeEnum,...c(I)})};class UI extends t{unwrap(){return this._def.type}_parse($){let{ctx:I}=this._processInputParams($);if(I.parsedType!==S.promise&&I.common.async===!1)return P(I,{code:V.invalid_type,expected:S.promise,received:I.parsedType}),u;let U=I.parsedType===S.promise?I.data:Promise.resolve(I.data);return f$(U.then((D)=>{return this._def.type.parseAsync(D,{path:I.path,errorMap:I.common.contextualErrorMap})}))}}UI.create=($,I)=>{return new UI({type:$,typeName:F.ZodPromise,...c(I)})};class z6 extends t{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===F.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse($){let{status:I,ctx:U}=this._processInputParams($),D=this._def.effect||null,b={addIssue:(A)=>{if(P(U,A),A.fatal)I.abort();else I.dirty()},get path(){return U.path}};if(b.addIssue=b.addIssue.bind(b),D.type==="preprocess"){let A=D.transform(U.data,b);if(U.common.async)return Promise.resolve(A).then(async(w)=>{if(I.value==="aborted")return u;let O=await this._def.schema._parseAsync({data:w,path:U.path,parent:U});if(O.status==="aborted")return u;if(O.status==="dirty")return a4(O.value);if(I.value==="dirty")return a4(O.value);return O});else{if(I.value==="aborted")return u;let w=this._def.schema._parseSync({data:A,path:U.path,parent:U});if(w.status==="aborted")return u;if(w.status==="dirty")return a4(w.value);if(I.value==="dirty")return a4(w.value);return w}}if(D.type==="refinement"){let A=(w)=>{let O=D.refinement(w,b);if(U.common.async)return Promise.resolve(O);if(O instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return w};if(U.common.async===!1){let w=this._def.schema._parseSync({data:U.data,path:U.path,parent:U});if(w.status==="aborted")return u;if(w.status==="dirty")I.dirty();return A(w.value),{status:I.value,value:w.value}}else return this._def.schema._parseAsync({data:U.data,path:U.path,parent:U}).then((w)=>{if(w.status==="aborted")return u;if(w.status==="dirty")I.dirty();return A(w.value).then(()=>{return{status:I.value,value:w.value}})})}if(D.type==="transform")if(U.common.async===!1){let A=this._def.schema._parseSync({data:U.data,path:U.path,parent:U});if(!S4(A))return u;let w=D.transform(A.value,b);if(w instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:I.value,value:w}}else return this._def.schema._parseAsync({data:U.data,path:U.path,parent:U}).then((A)=>{if(!S4(A))return u;return Promise.resolve(D.transform(A.value,b)).then((w)=>({status:I.value,value:w}))});s.assertNever(D)}}z6.create=($,I,U)=>{return new z6({schema:$,typeName:F.ZodEffects,effect:I,...c(U)})};z6.createWithPreprocess=($,I,U)=>{return new z6({schema:I,effect:{type:"preprocess",transform:$},typeName:F.ZodEffects,...c(U)})};class K6 extends t{_parse($){if(this._getType($)===S.undefined)return f$(void 0);return this._def.innerType._parse($)}unwrap(){return this._def.innerType}}K6.create=($,I)=>{return new K6({innerType:$,typeName:F.ZodOptional,...c(I)})};class t6 extends t{_parse($){if(this._getType($)===S.null)return f$(null);return this._def.innerType._parse($)}unwrap(){return this._def.innerType}}t6.create=($,I)=>{return new t6({innerType:$,typeName:F.ZodNullable,...c(I)})};class PU extends t{_parse($){let{ctx:I}=this._processInputParams($),U=I.data;if(I.parsedType===S.undefined)U=this._def.defaultValue();return this._def.innerType._parse({data:U,path:I.path,parent:I})}removeDefault(){return this._def.innerType}}PU.create=($,I)=>{return new PU({innerType:$,typeName:F.ZodDefault,defaultValue:typeof I.default==="function"?I.default:()=>I.default,...c(I)})};class RU extends t{_parse($){let{ctx:I}=this._processInputParams($),U={...I,common:{...I.common,issues:[]}},D=this._def.innerType._parse({data:U.data,path:U.path,parent:{...U}});if(MU(D))return D.then((b)=>{return{status:"valid",value:b.status==="valid"?b.value:this._def.catchValue({get error(){return new d$(U.common.issues)},input:U.data})}});else return{status:"valid",value:D.status==="valid"?D.value:this._def.catchValue({get error(){return new d$(U.common.issues)},input:U.data})}}removeCatch(){return this._def.innerType}}RU.create=($,I)=>{return new RU({innerType:$,typeName:F.ZodCatch,catchValue:typeof I.catch==="function"?I.catch:()=>I.catch,...c(I)})};class GD extends t{_parse($){if(this._getType($)!==S.nan){let U=this._getOrReturnCtx($);return P(U,{code:V.invalid_type,expected:S.nan,received:U.parsedType}),u}return{status:"valid",value:$.data}}}GD.create=($)=>{return new GD({typeName:F.ZodNaN,...c($)})};var PZ=Symbol("zod_brand");class o0 extends t{_parse($){let{ctx:I}=this._processInputParams($),U=I.data;return this._def.type._parse({data:U,path:I.path,parent:I})}unwrap(){return this._def.type}}class QD extends t{_parse($){let{status:I,ctx:U}=this._processInputParams($);if(U.common.async)return(async()=>{let b=await this._def.in._parseAsync({data:U.data,path:U.path,parent:U});if(b.status==="aborted")return u;if(b.status==="dirty")return I.dirty(),a4(b.value);else return this._def.out._parseAsync({data:b.value,path:U.path,parent:U})})();else{let D=this._def.in._parseSync({data:U.data,path:U.path,parent:U});if(D.status==="aborted")return u;if(D.status==="dirty")return I.dirty(),{status:"dirty",value:D.value};else return this._def.out._parseSync({data:D.value,path:U.path,parent:U})}}static create($,I){return new QD({in:$,out:I,typeName:F.ZodPipeline})}}class TU extends t{_parse($){let I=this._def.innerType._parse($),U=(D)=>{if(S4(D))D.value=Object.freeze(D.value);return D};return MU(I)?I.then((D)=>U(D)):U(I)}unwrap(){return this._def.innerType}}TU.create=($,I)=>{return new TU({innerType:$,typeName:F.ZodReadonly,...c(I)})};var RZ={object:H$.lazycreate},F;(function($){$.ZodString="ZodString",$.ZodNumber="ZodNumber",$.ZodNaN="ZodNaN",$.ZodBigInt="ZodBigInt",$.ZodBoolean="ZodBoolean",$.ZodDate="ZodDate",$.ZodSymbol="ZodSymbol",$.ZodUndefined="ZodUndefined",$.ZodNull="ZodNull",$.ZodAny="ZodAny",$.ZodUnknown="ZodUnknown",$.ZodNever="ZodNever",$.ZodVoid="ZodVoid",$.ZodArray="ZodArray",$.ZodObject="ZodObject",$.ZodUnion="ZodUnion",$.ZodDiscriminatedUnion="ZodDiscriminatedUnion",$.ZodIntersection="ZodIntersection",$.ZodTuple="ZodTuple",$.ZodRecord="ZodRecord",$.ZodMap="ZodMap",$.ZodSet="ZodSet",$.ZodFunction="ZodFunction",$.ZodLazy="ZodLazy",$.ZodLiteral="ZodLiteral",$.ZodEnum="ZodEnum",$.ZodEffects="ZodEffects",$.ZodNativeEnum="ZodNativeEnum",$.ZodOptional="ZodOptional",$.ZodNullable="ZodNullable",$.ZodDefault="ZodDefault",$.ZodCatch="ZodCatch",$.ZodPromise="ZodPromise",$.ZodBranded="ZodBranded",$.ZodPipeline="ZodPipeline",$.ZodReadonly="ZodReadonly"})(F||(F={}));var TZ=y6.create,_Z=s4.create,CZ=GD.create,fZ=$I.create,ZZ=AD.create,gZ=KU.create,yZ=wD.create,xZ=zU.create,lZ=FU.create,hZ=OD.create,uZ=j4.create,iZ=x6.create,nZ=ND.create,rZ=V6.create,$v=H$.create,cZ=H$.strictCreate,mZ=kU.create,oZ=m0.create,dZ=qU.create,pZ=l6.create,tZ=XD.create,aZ=WD.create,eZ=II.create,sZ=VU.create,$g=EU.create,Ig=SU.create,Ug=P4.create,bg=jU.create,Dg=UI.create,Ag=z6.create,wg=K6.create,Og=t6.create,Ng=z6.createWithPreprocess,Xg=QD.create;var O6={};f6(O6,{version:()=>$X,util:()=>K,treeifyError:()=>AN,toJSONSchema:()=>l4,toDotPath:()=>wv,safeParseAsync:()=>b4,safeParse:()=>U4,safeEncodeAsync:()=>Yv,safeEncode:()=>Gv,safeDecodeAsync:()=>vv,safeDecode:()=>Qv,registry:()=>gA,regexes:()=>t$,process:()=>O$,prettifyError:()=>wN,parseAsync:()=>C4,parse:()=>_4,meta:()=>vw,locales:()=>vI,isValidJWT:()=>Cv,isValidBase64URL:()=>_v,isValidBase64:()=>wX,initializeContext:()=>O4,globalRegistry:()=>Z$,globalConfig:()=>_U,formatError:()=>uU,flattenError:()=>hU,finalize:()=>X4,extractDefs:()=>N4,encodeAsync:()=>Xv,encode:()=>Ov,describe:()=>Yw,decodeAsync:()=>Wv,decode:()=>Nv,createToJSONSchemaMethod:()=>QW,createStandardJSONSchemaMethod:()=>RI,config:()=>M$,clone:()=>q$,_xor:()=>LF,_xid:()=>N1,_void:()=>Iw,_uuidv7:()=>U1,_uuidv6:()=>I1,_uuidv4:()=>$1,_uuid:()=>sU,_url:()=>LI,_uppercase:()=>VI,_unknown:()=>sA,_union:()=>BF,_undefined:()=>tA,_ulid:()=>O1,_uint64:()=>dA,_uint32:()=>rA,_tuple:()=>MF,_trim:()=>EI,_transform:()=>EF,_toUpperCase:()=>jI,_toLowerCase:()=>SI,_templateLiteral:()=>ZF,_symbol:()=>pA,_superRefine:()=>Qw,_success:()=>TF,_stringbool:()=>Bw,_stringFormat:()=>x4,_string:()=>yA,_startsWith:()=>zI,_slugify:()=>PI,_size:()=>JI,_set:()=>zF,_safeParseAsync:()=>XI,_safeParse:()=>NI,_safeEncodeAsync:()=>KD,_safeEncode:()=>MD,_safeDecodeAsync:()=>zD,_safeDecode:()=>VD,_regex:()=>HI,_refine:()=>Gw,_record:()=>VF,_readonly:()=>fF,_property:()=>Nw,_promise:()=>yF,_positive:()=>Dw,_pipe:()=>CF,_parseAsync:()=>OI,_parse:()=>wI,_overwrite:()=>w6,_optional:()=>SF,_number:()=>lA,_nullable:()=>jF,_null:()=>aA,_normalize:()=>qI,_nonpositive:()=>ww,_nonoptional:()=>RF,_nonnegative:()=>Ow,_never:()=>$w,_negative:()=>Aw,_nativeEnum:()=>kF,_nanoid:()=>D1,_nan:()=>bw,_multipleOf:()=>A4,_minSize:()=>w4,_minLength:()=>h6,_min:()=>g$,_mime:()=>kI,_maxSize:()=>Z4,_maxLength:()=>g4,_max:()=>a$,_map:()=>KF,_mac:()=>xA,_lte:()=>a$,_lt:()=>k6,_lowercase:()=>MI,_literal:()=>qF,_length:()=>y4,_lazy:()=>gF,_ksuid:()=>X1,_jwt:()=>J1,_isoTime:()=>AW,_isoDuration:()=>wW,_isoDateTime:()=>bW,_isoDate:()=>DW,_ipv6:()=>G1,_ipv4:()=>W1,_intersection:()=>HF,_int64:()=>oA,_int32:()=>nA,_int:()=>hA,_includes:()=>KI,_guid:()=>BI,_gte:()=>g$,_gt:()=>q6,_float64:()=>iA,_float32:()=>uA,_file:()=>Xw,_enum:()=>FF,_endsWith:()=>FI,_encodeAsync:()=>JD,_encode:()=>BD,_emoji:()=>b1,_email:()=>eU,_e164:()=>L1,_discriminatedUnion:()=>JF,_default:()=>PF,_decodeAsync:()=>HD,_decode:()=>LD,_date:()=>Uw,_custom:()=>Ww,_cuid2:()=>w1,_cuid:()=>A1,_coercedString:()=>IW,_coercedNumber:()=>OW,_coercedDate:()=>WW,_coercedBoolean:()=>NW,_coercedBigint:()=>XW,_cidrv6:()=>Y1,_cidrv4:()=>Q1,_check:()=>hv,_catch:()=>_F,_boolean:()=>cA,_bigint:()=>mA,_base64url:()=>B1,_base64:()=>v1,_array:()=>GW,_any:()=>eA,TimePrecision:()=>UW,NEVER:()=>d0,JSONSchemaGenerator:()=>aW,JSONSchema:()=>uv,Doc:()=>ED,$output:()=>eX,$input:()=>sX,$constructor:()=>B,$brand:()=>p0,$ZodXor:()=>GA,$ZodXID:()=>uD,$ZodVoid:()=>OA,$ZodUnknown:()=>AA,$ZodUnion:()=>QI,$ZodUndefined:()=>UA,$ZodUUID:()=>CD,$ZodURL:()=>ZD,$ZodULID:()=>hD,$ZodType:()=>n,$ZodTuple:()=>mU,$ZodTransform:()=>VA,$ZodTemplateLiteral:()=>TA,$ZodSymbol:()=>IA,$ZodSuccess:()=>EA,$ZodStringFormat:()=>w$,$ZodString:()=>D4,$ZodSet:()=>LA,$ZodRegistry:()=>$W,$ZodRecord:()=>vA,$ZodRealError:()=>i$,$ZodReadonly:()=>RA,$ZodPromise:()=>CA,$ZodPrefault:()=>kA,$ZodPipe:()=>PA,$ZodOptional:()=>KA,$ZodObjectJIT:()=>OX,$ZodObject:()=>WA,$ZodNumberFormat:()=>sD,$ZodNumber:()=>rU,$ZodNullable:()=>zA,$ZodNull:()=>bA,$ZodNonOptional:()=>qA,$ZodNever:()=>wA,$ZodNanoID:()=>yD,$ZodNaN:()=>jA,$ZodMap:()=>BA,$ZodMAC:()=>cD,$ZodLiteral:()=>HA,$ZodLazy:()=>fA,$ZodKSUID:()=>iD,$ZodJWT:()=>aD,$ZodIntersection:()=>YA,$ZodISOTime:()=>DX,$ZodISODuration:()=>AX,$ZodISODateTime:()=>UX,$ZodISODate:()=>bX,$ZodIPv6:()=>rD,$ZodIPv4:()=>nD,$ZodGUID:()=>_D,$ZodFunction:()=>_A,$ZodFile:()=>MA,$ZodError:()=>lU,$ZodEnum:()=>JA,$ZodEncodeError:()=>R4,$ZodEmoji:()=>gD,$ZodEmail:()=>fD,$ZodE164:()=>tD,$ZodDiscriminatedUnion:()=>QA,$ZodDefault:()=>FA,$ZodDate:()=>NA,$ZodCustomStringFormat:()=>eD,$ZodCustom:()=>ZA,$ZodCodec:()=>YI,$ZodCheckUpperCase:()=>oN,$ZodCheckStringFormat:()=>WI,$ZodCheckStartsWith:()=>pN,$ZodCheckSizeEquals:()=>uN,$ZodCheckRegex:()=>cN,$ZodCheckProperty:()=>aN,$ZodCheckOverwrite:()=>sN,$ZodCheckNumberFormat:()=>yN,$ZodCheckMultipleOf:()=>gN,$ZodCheckMinSize:()=>hN,$ZodCheckMinLength:()=>nN,$ZodCheckMimeType:()=>eN,$ZodCheckMaxSize:()=>lN,$ZodCheckMaxLength:()=>iN,$ZodCheckLowerCase:()=>mN,$ZodCheckLessThan:()=>kD,$ZodCheckLengthEquals:()=>rN,$ZodCheckIncludes:()=>dN,$ZodCheckGreaterThan:()=>qD,$ZodCheckEndsWith:()=>tN,$ZodCheckBigIntFormat:()=>xN,$ZodCheck:()=>X$,$ZodCatch:()=>SA,$ZodCUID2:()=>lD,$ZodCUID:()=>xD,$ZodCIDRv6:()=>oD,$ZodCIDRv4:()=>mD,$ZodBoolean:()=>GI,$ZodBigIntFormat:()=>$A,$ZodBigInt:()=>cU,$ZodBase64URL:()=>pD,$ZodBase64:()=>dD,$ZodAsyncError:()=>F6,$ZodArray:()=>XA,$ZodAny:()=>DA});var d0=Object.freeze({status:"aborted"});function B($,I,U){function D(O,N){if(!O._zod)Object.defineProperty(O,"_zod",{value:{def:N,constr:w,traits:new Set},enumerable:!1});if(O._zod.traits.has($))return;O._zod.traits.add($),I(O,N);let X=w.prototype,G=Object.keys(X);for(let Q=0;Q<G.length;Q++){let Y=G[Q];if(!(Y in O))O[Y]=X[Y].bind(O)}}let b=U?.Parent??Object;class A extends b{}Object.defineProperty(A,"name",{value:$});function w(O){var N;let X=U?.Parent?new A:this;D(X,O),(N=X._zod).deferred??(N.deferred=[]);for(let G of X._zod.deferred)G();return X}return Object.defineProperty(w,"init",{value:D}),Object.defineProperty(w,Symbol.hasInstance,{value:(O)=>{if(U?.Parent&&O instanceof U.Parent)return!0;return O?._zod?.traits?.has($)}}),Object.defineProperty(w,"name",{value:$}),w}var p0=Symbol("zod_brand");class F6 extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class R4 extends Error{constructor($){super(`Encountered unidirectional transform during encode: ${$}`);this.name="ZodEncodeError"}}var _U={};function M$($){if($)Object.assign(_U,$);return _U}var K={};f6(K,{unwrapMessage:()=>CU,uint8ArrayToHex:()=>hK,uint8ArrayToBase64url:()=>xK,uint8ArrayToBase64:()=>bv,stringifyPrimitive:()=>k,slugify:()=>e0,shallowClone:()=>$N,safeExtend:()=>_K,required:()=>ZK,randomString:()=>qK,propertyKeyTypes:()=>gU,promiseAllObject:()=>kK,primitiveTypes:()=>IN,prefixIssues:()=>p$,pick:()=>PK,partial:()=>fK,optionalKeys:()=>UN,omit:()=>RK,objectClone:()=>KK,numKeys:()=>EK,nullish:()=>a6,normalizeParams:()=>E,mergeDefs:()=>s6,merge:()=>CK,jsonStringifyReplacer:()=>bI,joinValues:()=>M,issue:()=>AI,isPlainObject:()=>$4,isObject:()=>T4,hexToUint8Array:()=>lK,getSizableOrigin:()=>yU,getParsedType:()=>SK,getLengthableOrigin:()=>xU,getEnumValues:()=>fU,getElementAtPath:()=>FK,floatSafeRemainder:()=>a0,finalizeIssue:()=>u$,extend:()=>TK,escapeRegex:()=>s$,esc:()=>YD,defineLazy:()=>e,createTransparentProxy:()=>jK,cloneDef:()=>zK,clone:()=>q$,cleanRegex:()=>ZU,cleanEnum:()=>gK,captureStackTrace:()=>vD,cached:()=>DI,base64urlToUint8Array:()=>yK,base64ToUint8Array:()=>Uv,assignProp:()=>e6,assertNotEqual:()=>JK,assertNever:()=>MK,assertIs:()=>HK,assertEqual:()=>LK,assert:()=>VK,allowsEval:()=>s0,aborted:()=>I4,NUMBER_FORMAT_RANGES:()=>bN,Class:()=>Dv,BIGINT_FORMAT_RANGES:()=>DN});function LK($){return $}function JK($){return $}function HK($){}function MK($){throw new Error("Unexpected value in exhaustive check")}function VK($){}function fU($){let I=Object.values($).filter((D)=>typeof D==="number");return Object.entries($).filter(([D,b])=>I.indexOf(+D)===-1).map(([D,b])=>b)}function M($,I="|"){return $.map((U)=>k(U)).join(I)}function bI($,I){if(typeof I==="bigint")return I.toString();return I}function DI($){return{get value(){{let U=$();return Object.defineProperty(this,"value",{value:U}),U}throw new Error("cached value already set")}}}function a6($){return $===null||$===void 0}function ZU($){let I=$.startsWith("^")?1:0,U=$.endsWith("$")?$.length-1:$.length;return $.slice(I,U)}function a0($,I){let U=($.toString().split(".")[1]||"").length,D=I.toString(),b=(D.split(".")[1]||"").length;if(b===0&&/\d?e-\d?/.test(D)){let N=D.match(/\d?e-(\d?)/);if(N?.[1])b=Number.parseInt(N[1])}let A=U>b?U:b,w=Number.parseInt($.toFixed(A).replace(".","")),O=Number.parseInt(I.toFixed(A).replace(".",""));return w%O/10**A}var Iv=Symbol("evaluating");function e($,I,U){let D=void 0;Object.defineProperty($,I,{get(){if(D===Iv)return;if(D===void 0)D=Iv,D=U();return D},set(b){Object.defineProperty($,I,{value:b})},configurable:!0})}function KK($){return Object.create(Object.getPrototypeOf($),Object.getOwnPropertyDescriptors($))}function e6($,I,U){Object.defineProperty($,I,{value:U,writable:!0,enumerable:!0,configurable:!0})}function s6(...$){let I={};for(let U of $){let D=Object.getOwnPropertyDescriptors(U);Object.assign(I,D)}return Object.defineProperties({},I)}function zK($){return s6($._zod.def)}function FK($,I){if(!I)return $;return I.reduce((U,D)=>U?.[D],$)}function kK($){let I=Object.keys($),U=I.map((D)=>$[D]);return Promise.all(U).then((D)=>{let b={};for(let A=0;A<I.length;A++)b[I[A]]=D[A];return b})}function qK($=10){let U="";for(let D=0;D<$;D++)U+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return U}function YD($){return JSON.stringify($)}function e0($){return $.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var vD="captureStackTrace"in Error?Error.captureStackTrace:(...$)=>{};function T4($){return typeof $==="object"&&$!==null&&!Array.isArray($)}var s0=DI(()=>{if(typeof navigator!=="undefined"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch($){return!1}});function $4($){if(T4($)===!1)return!1;let I=$.constructor;if(I===void 0)return!0;if(typeof I!=="function")return!0;let U=I.prototype;if(T4(U)===!1)return!1;if(Object.prototype.hasOwnProperty.call(U,"isPrototypeOf")===!1)return!1;return!0}function $N($){if($4($))return{...$};if(Array.isArray($))return[...$];return $}function EK($){let I=0;for(let U in $)if(Object.prototype.hasOwnProperty.call($,U))I++;return I}var SK=($)=>{let I=typeof $;switch(I){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN($)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray($))return"array";if($===null)return"null";if($.then&&typeof $.then==="function"&&$.catch&&typeof $.catch==="function")return"promise";if(typeof Map!=="undefined"&&$ instanceof Map)return"map";if(typeof Set!=="undefined"&&$ instanceof Set)return"set";if(typeof Date!=="undefined"&&$ instanceof Date)return"date";if(typeof File!=="undefined"&&$ instanceof File)return"file";return"object";default:throw new Error(`Unknown data type: ${I}`)}},gU=new Set(["string","number","symbol"]),IN=new Set(["string","number","bigint","boolean","symbol","undefined"]);function s$($){return $.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function q$($,I,U){let D=new $._zod.constr(I??$._zod.def);if(!I||U?.parent)D._zod.parent=$;return D}function E($){let I=$;if(!I)return{};if(typeof I==="string")return{error:()=>I};if(I?.message!==void 0){if(I?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");I.error=I.message}if(delete I.message,typeof I.error==="string")return{...I,error:()=>I.error};return I}function jK($){let I;return new Proxy({},{get(U,D,b){return I??(I=$()),Reflect.get(I,D,b)},set(U,D,b,A){return I??(I=$()),Reflect.set(I,D,b,A)},has(U,D){return I??(I=$()),Reflect.has(I,D)},deleteProperty(U,D){return I??(I=$()),Reflect.deleteProperty(I,D)},ownKeys(U){return I??(I=$()),Reflect.ownKeys(I)},getOwnPropertyDescriptor(U,D){return I??(I=$()),Reflect.getOwnPropertyDescriptor(I,D)},defineProperty(U,D,b){return I??(I=$()),Reflect.defineProperty(I,D,b)}})}function k($){if(typeof $==="bigint")return $.toString()+"n";if(typeof $==="string")return`"${$}"`;return`${$}`}function UN($){return Object.keys($).filter((I)=>{return $[I]._zod.optin==="optional"&&$[I]._zod.optout==="optional"})}var bN={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},DN={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function PK($,I){let U=$._zod.def,D=s6($._zod.def,{get shape(){let b={};for(let A in I){if(!(A in U.shape))throw new Error(`Unrecognized key: "${A}"`);if(!I[A])continue;b[A]=U.shape[A]}return e6(this,"shape",b),b},checks:[]});return q$($,D)}function RK($,I){let U=$._zod.def,D=s6($._zod.def,{get shape(){let b={...$._zod.def.shape};for(let A in I){if(!(A in U.shape))throw new Error(`Unrecognized key: "${A}"`);if(!I[A])continue;delete b[A]}return e6(this,"shape",b),b},checks:[]});return q$($,D)}function TK($,I){if(!$4(I))throw new Error("Invalid input to extend: expected a plain object");let U=$._zod.def.checks;if(U&&U.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");let b=s6($._zod.def,{get shape(){let A={...$._zod.def.shape,...I};return e6(this,"shape",A),A},checks:[]});return q$($,b)}function _K($,I){if(!$4(I))throw new Error("Invalid input to safeExtend: expected a plain object");let U={...$._zod.def,get shape(){let D={...$._zod.def.shape,...I};return e6(this,"shape",D),D},checks:$._zod.def.checks};return q$($,U)}function CK($,I){let U=s6($._zod.def,{get shape(){let D={...$._zod.def.shape,...I._zod.def.shape};return e6(this,"shape",D),D},get catchall(){return I._zod.def.catchall},checks:[]});return q$($,U)}function fK($,I,U){let D=s6(I._zod.def,{get shape(){let b=I._zod.def.shape,A={...b};if(U)for(let w in U){if(!(w in b))throw new Error(`Unrecognized key: "${w}"`);if(!U[w])continue;A[w]=$?new $({type:"optional",innerType:b[w]}):b[w]}else for(let w in b)A[w]=$?new $({type:"optional",innerType:b[w]}):b[w];return e6(this,"shape",A),A},checks:[]});return q$(I,D)}function ZK($,I,U){let D=s6(I._zod.def,{get shape(){let b=I._zod.def.shape,A={...b};if(U)for(let w in U){if(!(w in A))throw new Error(`Unrecognized key: "${w}"`);if(!U[w])continue;A[w]=new $({type:"nonoptional",innerType:b[w]})}else for(let w in b)A[w]=new $({type:"nonoptional",innerType:b[w]});return e6(this,"shape",A),A},checks:[]});return q$(I,D)}function I4($,I=0){if($.aborted===!0)return!0;for(let U=I;U<$.issues.length;U++)if($.issues[U]?.continue!==!0)return!0;return!1}function p$($,I){return I.map((U)=>{var D;return(D=U).path??(D.path=[]),U.path.unshift($),U})}function CU($){return typeof $==="string"?$:$?.message}function u$($,I,U){let D={...$,path:$.path??[]};if(!$.message){let b=CU($.inst?._zod.def?.error?.($))??CU(I?.error?.($))??CU(U.customError?.($))??CU(U.localeError?.($))??"Invalid input";D.message=b}if(delete D.inst,delete D.continue,!I?.reportInput)delete D.input;return D}function yU($){if($ instanceof Set)return"set";if($ instanceof Map)return"map";if($ instanceof File)return"file";return"unknown"}function xU($){if(Array.isArray($))return"array";if(typeof $==="string")return"string";return"unknown"}function AI(...$){let[I,U,D]=$;if(typeof I==="string")return{message:I,code:"custom",input:U,inst:D};return{...I}}function gK($){return Object.entries($).filter(([I,U])=>{return Number.isNaN(Number.parseInt(I,10))}).map((I)=>I[1])}function Uv($){let I=atob($),U=new Uint8Array(I.length);for(let D=0;D<I.length;D++)U[D]=I.charCodeAt(D);return U}function bv($){let I="";for(let U=0;U<$.length;U++)I+=String.fromCharCode($[U]);return btoa(I)}function yK($){let I=$.replace(/-/g,"+").replace(/_/g,"/"),U="=".repeat((4-I.length%4)%4);return Uv(I+U)}function xK($){return bv($).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function lK($){let I=$.replace(/^0x/,"");if(I.length%2!==0)throw new Error("Invalid hex string length");let U=new Uint8Array(I.length/2);for(let D=0;D<I.length;D+=2)U[D/2]=Number.parseInt(I.slice(D,D+2),16);return U}function hK($){return Array.from($).map((I)=>I.toString(16).padStart(2,"0")).join("")}class Dv{constructor(...$){}}var Av=($,I)=>{$.name="$ZodError",Object.defineProperty($,"_zod",{value:$._zod,enumerable:!1}),Object.defineProperty($,"issues",{value:I,enumerable:!1}),$.message=JSON.stringify(I,bI,2),Object.defineProperty($,"toString",{value:()=>$.message,enumerable:!1})},lU=B("$ZodError",Av),i$=B("$ZodError",Av,{Parent:Error});function hU($,I=(U)=>U.message){let U={},D=[];for(let b of $.issues)if(b.path.length>0)U[b.path[0]]=U[b.path[0]]||[],U[b.path[0]].push(I(b));else D.push(I(b));return{formErrors:D,fieldErrors:U}}function uU($,I=(U)=>U.message){let U={_errors:[]},D=(b)=>{for(let A of b.issues)if(A.code==="invalid_union"&&A.errors.length)A.errors.map((w)=>D({issues:w}));else if(A.code==="invalid_key")D({issues:A.issues});else if(A.code==="invalid_element")D({issues:A.issues});else if(A.path.length===0)U._errors.push(I(A));else{let w=U,O=0;while(O<A.path.length){let N=A.path[O];if(O!==A.path.length-1)w[N]=w[N]||{_errors:[]};else w[N]=w[N]||{_errors:[]},w[N]._errors.push(I(A));w=w[N],O++}}};return D($),U}function AN($,I=(U)=>U.message){let U={errors:[]},D=(b,A=[])=>{var w,O;for(let N of b.issues)if(N.code==="invalid_union"&&N.errors.length)N.errors.map((X)=>D({issues:X},N.path));else if(N.code==="invalid_key")D({issues:N.issues},N.path);else if(N.code==="invalid_element")D({issues:N.issues},N.path);else{let X=[...A,...N.path];if(X.length===0){U.errors.push(I(N));continue}let G=U,Q=0;while(Q<X.length){let Y=X[Q],v=Q===X.length-1;if(typeof Y==="string")G.properties??(G.properties={}),(w=G.properties)[Y]??(w[Y]={errors:[]}),G=G.properties[Y];else G.items??(G.items=[]),(O=G.items)[Y]??(O[Y]={errors:[]}),G=G.items[Y];if(v)G.errors.push(I(N));Q++}}};return D($),U}function wv($){let I=[],U=$.map((D)=>typeof D==="object"?D.key:D);for(let D of U)if(typeof D==="number")I.push(`[${D}]`);else if(typeof D==="symbol")I.push(`[${JSON.stringify(String(D))}]`);else if(/[^\w$]/.test(D))I.push(`[${JSON.stringify(D)}]`);else{if(I.length)I.push(".");I.push(D)}return I.join("")}function wN($){let I=[],U=[...$.issues].sort((D,b)=>(D.path??[]).length-(b.path??[]).length);for(let D of U)if(I.push(`✖ ${D.message}`),D.path?.length)I.push(` → at ${wv(D.path)}`);return I.join(`
|
|
10
|
+
`)}var wI=($)=>(I,U,D,b)=>{let A=D?Object.assign(D,{async:!1}):{async:!1},w=I._zod.run({value:U,issues:[]},A);if(w instanceof Promise)throw new F6;if(w.issues.length){let O=new(b?.Err??$)(w.issues.map((N)=>u$(N,A,M$())));throw vD(O,b?.callee),O}return w.value},_4=wI(i$),OI=($)=>async(I,U,D,b)=>{let A=D?Object.assign(D,{async:!0}):{async:!0},w=I._zod.run({value:U,issues:[]},A);if(w instanceof Promise)w=await w;if(w.issues.length){let O=new(b?.Err??$)(w.issues.map((N)=>u$(N,A,M$())));throw vD(O,b?.callee),O}return w.value},C4=OI(i$),NI=($)=>(I,U,D)=>{let b=D?{...D,async:!1}:{async:!1},A=I._zod.run({value:U,issues:[]},b);if(A instanceof Promise)throw new F6;return A.issues.length?{success:!1,error:new($??lU)(A.issues.map((w)=>u$(w,b,M$())))}:{success:!0,data:A.value}},U4=NI(i$),XI=($)=>async(I,U,D)=>{let b=D?Object.assign(D,{async:!0}):{async:!0},A=I._zod.run({value:U,issues:[]},b);if(A instanceof Promise)A=await A;return A.issues.length?{success:!1,error:new $(A.issues.map((w)=>u$(w,b,M$())))}:{success:!0,data:A.value}},b4=XI(i$),BD=($)=>(I,U,D)=>{let b=D?Object.assign(D,{direction:"backward"}):{direction:"backward"};return wI($)(I,U,b)},Ov=BD(i$),LD=($)=>(I,U,D)=>{return wI($)(I,U,D)},Nv=LD(i$),JD=($)=>async(I,U,D)=>{let b=D?Object.assign(D,{direction:"backward"}):{direction:"backward"};return OI($)(I,U,b)},Xv=JD(i$),HD=($)=>async(I,U,D)=>{return OI($)(I,U,D)},Wv=HD(i$),MD=($)=>(I,U,D)=>{let b=D?Object.assign(D,{direction:"backward"}):{direction:"backward"};return NI($)(I,U,b)},Gv=MD(i$),VD=($)=>(I,U,D)=>{return NI($)(I,U,D)},Qv=VD(i$),KD=($)=>async(I,U,D)=>{let b=D?Object.assign(D,{direction:"backward"}):{direction:"backward"};return XI($)(I,U,b)},Yv=KD(i$),zD=($)=>async(I,U,D)=>{return XI($)(I,U,D)},vv=zD(i$);var t$={};f6(t$,{xid:()=>WN,uuid7:()=>cK,uuid6:()=>rK,uuid4:()=>nK,uuid:()=>f4,uppercase:()=>ZN,unicodeEmail:()=>Bv,undefined:()=>CN,ulid:()=>XN,time:()=>qN,string:()=>SN,sha512_hex:()=>Qz,sha512_base64url:()=>vz,sha512_base64:()=>Yz,sha384_hex:()=>Xz,sha384_base64url:()=>Gz,sha384_base64:()=>Wz,sha256_hex:()=>wz,sha256_base64url:()=>Nz,sha256_base64:()=>Oz,sha1_hex:()=>bz,sha1_base64url:()=>Az,sha1_base64:()=>Dz,rfc5322Email:()=>oK,number:()=>RN,null:()=>_N,nanoid:()=>QN,md5_hex:()=>$z,md5_base64url:()=>Uz,md5_base64:()=>Iz,mac:()=>MN,lowercase:()=>fN,ksuid:()=>GN,ipv6:()=>HN,ipv4:()=>JN,integer:()=>PN,idnEmail:()=>dK,html5Email:()=>mK,hostname:()=>aK,hex:()=>sK,guid:()=>vN,extendedDuration:()=>iK,emoji:()=>LN,email:()=>BN,e164:()=>FN,duration:()=>YN,domain:()=>eK,datetime:()=>EN,date:()=>kN,cuid2:()=>NN,cuid:()=>ON,cidrv6:()=>KN,cidrv4:()=>VN,browserEmail:()=>pK,boolean:()=>TN,bigint:()=>jN,base64url:()=>FD,base64:()=>zN});var ON=/^[cC][^\s-]{8,}$/,NN=/^[0-9a-z]+$/,XN=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,WN=/^[0-9a-vA-V]{20}$/,GN=/^[A-Za-z0-9]{27}$/,QN=/^[a-zA-Z0-9_-]{21}$/,YN=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,iK=/^[-+]?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)?)??$/,vN=/^([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})$/,f4=($)=>{if(!$)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${$}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)},nK=f4(4),rK=f4(6),cK=f4(7),BN=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,mK=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,oK=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,Bv=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,dK=Bv,pK=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,tK="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function LN(){return new RegExp(tK,"u")}var JN=/^(?:(?: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])$/,HN=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,MN=($)=>{let I=s$($??":");return new RegExp(`^(?:[0-9A-F]{2}${I}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${I}){5}[0-9a-f]{2}$`)},VN=/^((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])$/,KN=/^(([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])$/,zN=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,FD=/^[A-Za-z0-9_-]*$/,aK=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,eK=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,FN=/^\+(?:[0-9]){6,14}[0-9]$/,Lv="(?:(?:\\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])))",kN=new RegExp(`^${Lv}$`);function Jv($){return typeof $.precision==="number"?$.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":$.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${$.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function qN($){return new RegExp(`^${Jv($)}$`)}function EN($){let I=Jv({precision:$.precision}),U=["Z"];if($.local)U.push("");if($.offset)U.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let D=`${I}(?:${U.join("|")})`;return new RegExp(`^${Lv}T(?:${D})$`)}var SN=($)=>{let I=$?`[\\s\\S]{${$?.minimum??0},${$?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${I}$`)},jN=/^-?\d+n?$/,PN=/^-?\d+$/,RN=/^-?\d+(?:\.\d+)?/,TN=/^(?:true|false)$/i,_N=/^null$/i;var CN=/^undefined$/i;var fN=/^[^A-Z]*$/,ZN=/^[^a-z]*$/,sK=/^[0-9a-fA-F]*$/;function iU($,I){return new RegExp(`^[A-Za-z0-9+/]{${$}}${I}$`)}function nU($){return new RegExp(`^[A-Za-z0-9_-]{${$}}$`)}var $z=/^[0-9a-fA-F]{32}$/,Iz=iU(22,"=="),Uz=nU(22),bz=/^[0-9a-fA-F]{40}$/,Dz=iU(27,"="),Az=nU(27),wz=/^[0-9a-fA-F]{64}$/,Oz=iU(43,"="),Nz=nU(43),Xz=/^[0-9a-fA-F]{96}$/,Wz=iU(64,""),Gz=nU(64),Qz=/^[0-9a-fA-F]{128}$/,Yz=iU(86,"=="),vz=nU(86);var X$=B("$ZodCheck",($,I)=>{var U;$._zod??($._zod={}),$._zod.def=I,(U=$._zod).onattach??(U.onattach=[])}),Mv={number:"number",bigint:"bigint",object:"date"},kD=B("$ZodCheckLessThan",($,I)=>{X$.init($,I);let U=Mv[typeof I.value];$._zod.onattach.push((D)=>{let b=D._zod.bag,A=(I.inclusive?b.maximum:b.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(I.value<A)if(I.inclusive)b.maximum=I.value;else b.exclusiveMaximum=I.value}),$._zod.check=(D)=>{if(I.inclusive?D.value<=I.value:D.value<I.value)return;D.issues.push({origin:U,code:"too_big",maximum:I.value,input:D.value,inclusive:I.inclusive,inst:$,continue:!I.abort})}}),qD=B("$ZodCheckGreaterThan",($,I)=>{X$.init($,I);let U=Mv[typeof I.value];$._zod.onattach.push((D)=>{let b=D._zod.bag,A=(I.inclusive?b.minimum:b.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(I.value>A)if(I.inclusive)b.minimum=I.value;else b.exclusiveMinimum=I.value}),$._zod.check=(D)=>{if(I.inclusive?D.value>=I.value:D.value>I.value)return;D.issues.push({origin:U,code:"too_small",minimum:I.value,input:D.value,inclusive:I.inclusive,inst:$,continue:!I.abort})}}),gN=B("$ZodCheckMultipleOf",($,I)=>{X$.init($,I),$._zod.onattach.push((U)=>{var D;(D=U._zod.bag).multipleOf??(D.multipleOf=I.value)}),$._zod.check=(U)=>{if(typeof U.value!==typeof I.value)throw new Error("Cannot mix number and bigint in multiple_of check.");if(typeof U.value==="bigint"?U.value%I.value===BigInt(0):a0(U.value,I.value)===0)return;U.issues.push({origin:typeof U.value,code:"not_multiple_of",divisor:I.value,input:U.value,inst:$,continue:!I.abort})}}),yN=B("$ZodCheckNumberFormat",($,I)=>{X$.init($,I),I.format=I.format||"float64";let U=I.format?.includes("int"),D=U?"int":"number",[b,A]=bN[I.format];$._zod.onattach.push((w)=>{let O=w._zod.bag;if(O.format=I.format,O.minimum=b,O.maximum=A,U)O.pattern=PN}),$._zod.check=(w)=>{let O=w.value;if(U){if(!Number.isInteger(O)){w.issues.push({expected:D,format:I.format,code:"invalid_type",continue:!1,input:O,inst:$});return}if(!Number.isSafeInteger(O)){if(O>0)w.issues.push({input:O,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:D,continue:!I.abort});else w.issues.push({input:O,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:D,continue:!I.abort});return}}if(O<b)w.issues.push({origin:"number",input:O,code:"too_small",minimum:b,inclusive:!0,inst:$,continue:!I.abort});if(O>A)w.issues.push({origin:"number",input:O,code:"too_big",maximum:A,inst:$})}}),xN=B("$ZodCheckBigIntFormat",($,I)=>{X$.init($,I);let[U,D]=DN[I.format];$._zod.onattach.push((b)=>{let A=b._zod.bag;A.format=I.format,A.minimum=U,A.maximum=D}),$._zod.check=(b)=>{let A=b.value;if(A<U)b.issues.push({origin:"bigint",input:A,code:"too_small",minimum:U,inclusive:!0,inst:$,continue:!I.abort});if(A>D)b.issues.push({origin:"bigint",input:A,code:"too_big",maximum:D,inst:$})}}),lN=B("$ZodCheckMaxSize",($,I)=>{var U;X$.init($,I),(U=$._zod.def).when??(U.when=(D)=>{let b=D.value;return!a6(b)&&b.size!==void 0}),$._zod.onattach.push((D)=>{let b=D._zod.bag.maximum??Number.POSITIVE_INFINITY;if(I.maximum<b)D._zod.bag.maximum=I.maximum}),$._zod.check=(D)=>{let b=D.value;if(b.size<=I.maximum)return;D.issues.push({origin:yU(b),code:"too_big",maximum:I.maximum,inclusive:!0,input:b,inst:$,continue:!I.abort})}}),hN=B("$ZodCheckMinSize",($,I)=>{var U;X$.init($,I),(U=$._zod.def).when??(U.when=(D)=>{let b=D.value;return!a6(b)&&b.size!==void 0}),$._zod.onattach.push((D)=>{let b=D._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(I.minimum>b)D._zod.bag.minimum=I.minimum}),$._zod.check=(D)=>{let b=D.value;if(b.size>=I.minimum)return;D.issues.push({origin:yU(b),code:"too_small",minimum:I.minimum,inclusive:!0,input:b,inst:$,continue:!I.abort})}}),uN=B("$ZodCheckSizeEquals",($,I)=>{var U;X$.init($,I),(U=$._zod.def).when??(U.when=(D)=>{let b=D.value;return!a6(b)&&b.size!==void 0}),$._zod.onattach.push((D)=>{let b=D._zod.bag;b.minimum=I.size,b.maximum=I.size,b.size=I.size}),$._zod.check=(D)=>{let b=D.value,A=b.size;if(A===I.size)return;let w=A>I.size;D.issues.push({origin:yU(b),...w?{code:"too_big",maximum:I.size}:{code:"too_small",minimum:I.size},inclusive:!0,exact:!0,input:D.value,inst:$,continue:!I.abort})}}),iN=B("$ZodCheckMaxLength",($,I)=>{var U;X$.init($,I),(U=$._zod.def).when??(U.when=(D)=>{let b=D.value;return!a6(b)&&b.length!==void 0}),$._zod.onattach.push((D)=>{let b=D._zod.bag.maximum??Number.POSITIVE_INFINITY;if(I.maximum<b)D._zod.bag.maximum=I.maximum}),$._zod.check=(D)=>{let b=D.value;if(b.length<=I.maximum)return;let w=xU(b);D.issues.push({origin:w,code:"too_big",maximum:I.maximum,inclusive:!0,input:b,inst:$,continue:!I.abort})}}),nN=B("$ZodCheckMinLength",($,I)=>{var U;X$.init($,I),(U=$._zod.def).when??(U.when=(D)=>{let b=D.value;return!a6(b)&&b.length!==void 0}),$._zod.onattach.push((D)=>{let b=D._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(I.minimum>b)D._zod.bag.minimum=I.minimum}),$._zod.check=(D)=>{let b=D.value;if(b.length>=I.minimum)return;let w=xU(b);D.issues.push({origin:w,code:"too_small",minimum:I.minimum,inclusive:!0,input:b,inst:$,continue:!I.abort})}}),rN=B("$ZodCheckLengthEquals",($,I)=>{var U;X$.init($,I),(U=$._zod.def).when??(U.when=(D)=>{let b=D.value;return!a6(b)&&b.length!==void 0}),$._zod.onattach.push((D)=>{let b=D._zod.bag;b.minimum=I.length,b.maximum=I.length,b.length=I.length}),$._zod.check=(D)=>{let b=D.value,A=b.length;if(A===I.length)return;let w=xU(b),O=A>I.length;D.issues.push({origin:w,...O?{code:"too_big",maximum:I.length}:{code:"too_small",minimum:I.length},inclusive:!0,exact:!0,input:D.value,inst:$,continue:!I.abort})}}),WI=B("$ZodCheckStringFormat",($,I)=>{var U,D;if(X$.init($,I),$._zod.onattach.push((b)=>{let A=b._zod.bag;if(A.format=I.format,I.pattern)A.patterns??(A.patterns=new Set),A.patterns.add(I.pattern)}),I.pattern)(U=$._zod).check??(U.check=(b)=>{if(I.pattern.lastIndex=0,I.pattern.test(b.value))return;b.issues.push({origin:"string",code:"invalid_format",format:I.format,input:b.value,...I.pattern?{pattern:I.pattern.toString()}:{},inst:$,continue:!I.abort})});else(D=$._zod).check??(D.check=()=>{})}),cN=B("$ZodCheckRegex",($,I)=>{WI.init($,I),$._zod.check=(U)=>{if(I.pattern.lastIndex=0,I.pattern.test(U.value))return;U.issues.push({origin:"string",code:"invalid_format",format:"regex",input:U.value,pattern:I.pattern.toString(),inst:$,continue:!I.abort})}}),mN=B("$ZodCheckLowerCase",($,I)=>{I.pattern??(I.pattern=fN),WI.init($,I)}),oN=B("$ZodCheckUpperCase",($,I)=>{I.pattern??(I.pattern=ZN),WI.init($,I)}),dN=B("$ZodCheckIncludes",($,I)=>{X$.init($,I);let U=s$(I.includes),D=new RegExp(typeof I.position==="number"?`^.{${I.position}}${U}`:U);I.pattern=D,$._zod.onattach.push((b)=>{let A=b._zod.bag;A.patterns??(A.patterns=new Set),A.patterns.add(D)}),$._zod.check=(b)=>{if(b.value.includes(I.includes,I.position))return;b.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:I.includes,input:b.value,inst:$,continue:!I.abort})}}),pN=B("$ZodCheckStartsWith",($,I)=>{X$.init($,I);let U=new RegExp(`^${s$(I.prefix)}.*`);I.pattern??(I.pattern=U),$._zod.onattach.push((D)=>{let b=D._zod.bag;b.patterns??(b.patterns=new Set),b.patterns.add(U)}),$._zod.check=(D)=>{if(D.value.startsWith(I.prefix))return;D.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:I.prefix,input:D.value,inst:$,continue:!I.abort})}}),tN=B("$ZodCheckEndsWith",($,I)=>{X$.init($,I);let U=new RegExp(`.*${s$(I.suffix)}$`);I.pattern??(I.pattern=U),$._zod.onattach.push((D)=>{let b=D._zod.bag;b.patterns??(b.patterns=new Set),b.patterns.add(U)}),$._zod.check=(D)=>{if(D.value.endsWith(I.suffix))return;D.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:I.suffix,input:D.value,inst:$,continue:!I.abort})}});function Hv($,I,U){if($.issues.length)I.issues.push(...p$(U,$.issues))}var aN=B("$ZodCheckProperty",($,I)=>{X$.init($,I),$._zod.check=(U)=>{let D=I.schema._zod.run({value:U.value[I.property],issues:[]},{});if(D instanceof Promise)return D.then((b)=>Hv(b,U,I.property));Hv(D,U,I.property);return}}),eN=B("$ZodCheckMimeType",($,I)=>{X$.init($,I);let U=new Set(I.mime);$._zod.onattach.push((D)=>{D._zod.bag.mime=I.mime}),$._zod.check=(D)=>{if(U.has(D.value.type))return;D.issues.push({code:"invalid_value",values:I.mime,input:D.value.type,inst:$,continue:!I.abort})}}),sN=B("$ZodCheckOverwrite",($,I)=>{X$.init($,I),$._zod.check=(U)=>{U.value=I.tx(U.value)}});class ED{constructor($=[]){if(this.content=[],this.indent=0,this)this.args=$}indented($){this.indent+=1,$(this),this.indent-=1}write($){if(typeof $==="function"){$(this,{execution:"sync"}),$(this,{execution:"async"});return}let U=$.split(`
|
|
11
|
+
`).filter((A)=>A),D=Math.min(...U.map((A)=>A.length-A.trimStart().length)),b=U.map((A)=>A.slice(D)).map((A)=>" ".repeat(this.indent*2)+A);for(let A of b)this.content.push(A)}compile(){let $=Function,I=this?.args,D=[...(this?.content??[""]).map((b)=>` ${b}`)];return new $(...I,D.join(`
|
|
12
|
+
`))}}var $X={major:4,minor:2,patch:1};var n=B("$ZodType",($,I)=>{var U;$??($={}),$._zod.def=I,$._zod.bag=$._zod.bag||{},$._zod.version=$X;let D=[...$._zod.def.checks??[]];if($._zod.traits.has("$ZodCheck"))D.unshift($);for(let b of D)for(let A of b._zod.onattach)A($);if(D.length===0)(U=$._zod).deferred??(U.deferred=[]),$._zod.deferred?.push(()=>{$._zod.run=$._zod.parse});else{let b=(w,O,N)=>{let X=I4(w),G;for(let Q of O){if(Q._zod.def.when){if(!Q._zod.def.when(w))continue}else if(X)continue;let Y=w.issues.length,v=Q._zod.check(w);if(v instanceof Promise&&N?.async===!1)throw new F6;if(G||v instanceof Promise)G=(G??Promise.resolve()).then(async()=>{if(await v,w.issues.length===Y)return;if(!X)X=I4(w,Y)});else{if(w.issues.length===Y)continue;if(!X)X=I4(w,Y)}}if(G)return G.then(()=>{return w});return w},A=(w,O,N)=>{if(I4(w))return w.aborted=!0,w;let X=b(O,D,N);if(X instanceof Promise){if(N.async===!1)throw new F6;return X.then((G)=>$._zod.parse(G,N))}return $._zod.parse(X,N)};$._zod.run=(w,O)=>{if(O.skipChecks)return $._zod.parse(w,O);if(O.direction==="backward"){let X=$._zod.parse({value:w.value,issues:[]},{...O,skipChecks:!0});if(X instanceof Promise)return X.then((G)=>{return A(G,w,O)});return A(X,w,O)}let N=$._zod.parse(w,O);if(N instanceof Promise){if(O.async===!1)throw new F6;return N.then((X)=>b(X,D,O))}return b(N,D,O)}}$["~standard"]={validate:(b)=>{try{let A=U4($,b);return A.success?{value:A.data}:{issues:A.error?.issues}}catch(A){return b4($,b).then((w)=>w.success?{value:w.data}:{issues:w.error?.issues})}},vendor:"zod",version:1}}),D4=B("$ZodString",($,I)=>{n.init($,I),$._zod.pattern=[...$?._zod.bag?.patterns??[]].pop()??SN($._zod.bag),$._zod.parse=(U,D)=>{if(I.coerce)try{U.value=String(U.value)}catch(b){}if(typeof U.value==="string")return U;return U.issues.push({expected:"string",code:"invalid_type",input:U.value,inst:$}),U}}),w$=B("$ZodStringFormat",($,I)=>{WI.init($,I),D4.init($,I)}),_D=B("$ZodGUID",($,I)=>{I.pattern??(I.pattern=vN),w$.init($,I)}),CD=B("$ZodUUID",($,I)=>{if(I.version){let D={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[I.version];if(D===void 0)throw new Error(`Invalid UUID version: "${I.version}"`);I.pattern??(I.pattern=f4(D))}else I.pattern??(I.pattern=f4());w$.init($,I)}),fD=B("$ZodEmail",($,I)=>{I.pattern??(I.pattern=BN),w$.init($,I)}),ZD=B("$ZodURL",($,I)=>{w$.init($,I),$._zod.check=(U)=>{try{let D=U.value.trim(),b=new URL(D);if(I.hostname){if(I.hostname.lastIndex=0,!I.hostname.test(b.hostname))U.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:I.hostname.source,input:U.value,inst:$,continue:!I.abort})}if(I.protocol){if(I.protocol.lastIndex=0,!I.protocol.test(b.protocol.endsWith(":")?b.protocol.slice(0,-1):b.protocol))U.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:I.protocol.source,input:U.value,inst:$,continue:!I.abort})}if(I.normalize)U.value=b.href;else U.value=D;return}catch(D){U.issues.push({code:"invalid_format",format:"url",input:U.value,inst:$,continue:!I.abort})}}}),gD=B("$ZodEmoji",($,I)=>{I.pattern??(I.pattern=LN()),w$.init($,I)}),yD=B("$ZodNanoID",($,I)=>{I.pattern??(I.pattern=QN),w$.init($,I)}),xD=B("$ZodCUID",($,I)=>{I.pattern??(I.pattern=ON),w$.init($,I)}),lD=B("$ZodCUID2",($,I)=>{I.pattern??(I.pattern=NN),w$.init($,I)}),hD=B("$ZodULID",($,I)=>{I.pattern??(I.pattern=XN),w$.init($,I)}),uD=B("$ZodXID",($,I)=>{I.pattern??(I.pattern=WN),w$.init($,I)}),iD=B("$ZodKSUID",($,I)=>{I.pattern??(I.pattern=GN),w$.init($,I)}),UX=B("$ZodISODateTime",($,I)=>{I.pattern??(I.pattern=EN(I)),w$.init($,I)}),bX=B("$ZodISODate",($,I)=>{I.pattern??(I.pattern=kN),w$.init($,I)}),DX=B("$ZodISOTime",($,I)=>{I.pattern??(I.pattern=qN(I)),w$.init($,I)}),AX=B("$ZodISODuration",($,I)=>{I.pattern??(I.pattern=YN),w$.init($,I)}),nD=B("$ZodIPv4",($,I)=>{I.pattern??(I.pattern=JN),w$.init($,I),$._zod.bag.format="ipv4"}),rD=B("$ZodIPv6",($,I)=>{I.pattern??(I.pattern=HN),w$.init($,I),$._zod.bag.format="ipv6",$._zod.check=(U)=>{try{new URL(`http://[${U.value}]`)}catch{U.issues.push({code:"invalid_format",format:"ipv6",input:U.value,inst:$,continue:!I.abort})}}}),cD=B("$ZodMAC",($,I)=>{I.pattern??(I.pattern=MN(I.delimiter)),w$.init($,I),$._zod.bag.format="mac"}),mD=B("$ZodCIDRv4",($,I)=>{I.pattern??(I.pattern=VN),w$.init($,I)}),oD=B("$ZodCIDRv6",($,I)=>{I.pattern??(I.pattern=KN),w$.init($,I),$._zod.check=(U)=>{let D=U.value.split("/");try{if(D.length!==2)throw new Error;let[b,A]=D;if(!A)throw new Error;let w=Number(A);if(`${w}`!==A)throw new Error;if(w<0||w>128)throw new Error;new URL(`http://[${b}]`)}catch{U.issues.push({code:"invalid_format",format:"cidrv6",input:U.value,inst:$,continue:!I.abort})}}});function wX($){if($==="")return!0;if($.length%4!==0)return!1;try{return atob($),!0}catch{return!1}}var dD=B("$ZodBase64",($,I)=>{I.pattern??(I.pattern=zN),w$.init($,I),$._zod.bag.contentEncoding="base64",$._zod.check=(U)=>{if(wX(U.value))return;U.issues.push({code:"invalid_format",format:"base64",input:U.value,inst:$,continue:!I.abort})}});function _v($){if(!FD.test($))return!1;let I=$.replace(/[-_]/g,(D)=>D==="-"?"+":"/"),U=I.padEnd(Math.ceil(I.length/4)*4,"=");return wX(U)}var pD=B("$ZodBase64URL",($,I)=>{I.pattern??(I.pattern=FD),w$.init($,I),$._zod.bag.contentEncoding="base64url",$._zod.check=(U)=>{if(_v(U.value))return;U.issues.push({code:"invalid_format",format:"base64url",input:U.value,inst:$,continue:!I.abort})}}),tD=B("$ZodE164",($,I)=>{I.pattern??(I.pattern=FN),w$.init($,I)});function Cv($,I=null){try{let U=$.split(".");if(U.length!==3)return!1;let[D]=U;if(!D)return!1;let b=JSON.parse(atob(D));if("typ"in b&&b?.typ!=="JWT")return!1;if(!b.alg)return!1;if(I&&(!("alg"in b)||b.alg!==I))return!1;return!0}catch{return!1}}var aD=B("$ZodJWT",($,I)=>{w$.init($,I),$._zod.check=(U)=>{if(Cv(U.value,I.alg))return;U.issues.push({code:"invalid_format",format:"jwt",input:U.value,inst:$,continue:!I.abort})}}),eD=B("$ZodCustomStringFormat",($,I)=>{w$.init($,I),$._zod.check=(U)=>{if(I.fn(U.value))return;U.issues.push({code:"invalid_format",format:I.format,input:U.value,inst:$,continue:!I.abort})}}),rU=B("$ZodNumber",($,I)=>{n.init($,I),$._zod.pattern=$._zod.bag.pattern??RN,$._zod.parse=(U,D)=>{if(I.coerce)try{U.value=Number(U.value)}catch(w){}let b=U.value;if(typeof b==="number"&&!Number.isNaN(b)&&Number.isFinite(b))return U;let A=typeof b==="number"?Number.isNaN(b)?"NaN":!Number.isFinite(b)?"Infinity":void 0:void 0;return U.issues.push({expected:"number",code:"invalid_type",input:b,inst:$,...A?{received:A}:{}}),U}}),sD=B("$ZodNumberFormat",($,I)=>{yN.init($,I),rU.init($,I)}),GI=B("$ZodBoolean",($,I)=>{n.init($,I),$._zod.pattern=TN,$._zod.parse=(U,D)=>{if(I.coerce)try{U.value=Boolean(U.value)}catch(A){}let b=U.value;if(typeof b==="boolean")return U;return U.issues.push({expected:"boolean",code:"invalid_type",input:b,inst:$}),U}}),cU=B("$ZodBigInt",($,I)=>{n.init($,I),$._zod.pattern=jN,$._zod.parse=(U,D)=>{if(I.coerce)try{U.value=BigInt(U.value)}catch(b){}if(typeof U.value==="bigint")return U;return U.issues.push({expected:"bigint",code:"invalid_type",input:U.value,inst:$}),U}}),$A=B("$ZodBigIntFormat",($,I)=>{xN.init($,I),cU.init($,I)}),IA=B("$ZodSymbol",($,I)=>{n.init($,I),$._zod.parse=(U,D)=>{let b=U.value;if(typeof b==="symbol")return U;return U.issues.push({expected:"symbol",code:"invalid_type",input:b,inst:$}),U}}),UA=B("$ZodUndefined",($,I)=>{n.init($,I),$._zod.pattern=CN,$._zod.values=new Set([void 0]),$._zod.optin="optional",$._zod.optout="optional",$._zod.parse=(U,D)=>{let b=U.value;if(typeof b==="undefined")return U;return U.issues.push({expected:"undefined",code:"invalid_type",input:b,inst:$}),U}}),bA=B("$ZodNull",($,I)=>{n.init($,I),$._zod.pattern=_N,$._zod.values=new Set([null]),$._zod.parse=(U,D)=>{let b=U.value;if(b===null)return U;return U.issues.push({expected:"null",code:"invalid_type",input:b,inst:$}),U}}),DA=B("$ZodAny",($,I)=>{n.init($,I),$._zod.parse=(U)=>U}),AA=B("$ZodUnknown",($,I)=>{n.init($,I),$._zod.parse=(U)=>U}),wA=B("$ZodNever",($,I)=>{n.init($,I),$._zod.parse=(U,D)=>{return U.issues.push({expected:"never",code:"invalid_type",input:U.value,inst:$}),U}}),OA=B("$ZodVoid",($,I)=>{n.init($,I),$._zod.parse=(U,D)=>{let b=U.value;if(typeof b==="undefined")return U;return U.issues.push({expected:"void",code:"invalid_type",input:b,inst:$}),U}}),NA=B("$ZodDate",($,I)=>{n.init($,I),$._zod.parse=(U,D)=>{if(I.coerce)try{U.value=new Date(U.value)}catch(O){}let b=U.value,A=b instanceof Date;if(A&&!Number.isNaN(b.getTime()))return U;return U.issues.push({expected:"date",code:"invalid_type",input:b,...A?{received:"Invalid Date"}:{},inst:$}),U}});function Kv($,I,U){if($.issues.length)I.issues.push(...p$(U,$.issues));I.value[U]=$.value}var XA=B("$ZodArray",($,I)=>{n.init($,I),$._zod.parse=(U,D)=>{let b=U.value;if(!Array.isArray(b))return U.issues.push({expected:"array",code:"invalid_type",input:b,inst:$}),U;U.value=Array(b.length);let A=[];for(let w=0;w<b.length;w++){let O=b[w],N=I.element._zod.run({value:O,issues:[]},D);if(N instanceof Promise)A.push(N.then((X)=>Kv(X,U,w)));else Kv(N,U,w)}if(A.length)return Promise.all(A).then(()=>U);return U}});function TD($,I,U,D){if($.issues.length)I.issues.push(...p$(U,$.issues));if($.value===void 0){if(U in D)I.value[U]=void 0}else I.value[U]=$.value}function fv($){let I=Object.keys($.shape);for(let D of I)if(!$.shape?.[D]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${D}": expected a Zod schema`);let U=UN($.shape);return{...$,keys:I,keySet:new Set(I),numKeys:I.length,optionalKeys:new Set(U)}}function Zv($,I,U,D,b,A){let w=[],O=b.keySet,N=b.catchall._zod,X=N.def.type;for(let G in I){if(O.has(G))continue;if(X==="never"){w.push(G);continue}let Q=N.run({value:I[G],issues:[]},D);if(Q instanceof Promise)$.push(Q.then((Y)=>TD(Y,U,G,I)));else TD(Q,U,G,I)}if(w.length)U.issues.push({code:"unrecognized_keys",keys:w,input:I,inst:A});if(!$.length)return U;return Promise.all($).then(()=>{return U})}var WA=B("$ZodObject",($,I)=>{if(n.init($,I),!Object.getOwnPropertyDescriptor(I,"shape")?.get){let O=I.shape;Object.defineProperty(I,"shape",{get:()=>{let N={...O};return Object.defineProperty(I,"shape",{value:N}),N}})}let D=DI(()=>fv(I));e($._zod,"propValues",()=>{let O=I.shape,N={};for(let X in O){let G=O[X]._zod;if(G.values){N[X]??(N[X]=new Set);for(let Q of G.values)N[X].add(Q)}}return N});let b=T4,A=I.catchall,w;$._zod.parse=(O,N)=>{w??(w=D.value);let X=O.value;if(!b(X))return O.issues.push({expected:"object",code:"invalid_type",input:X,inst:$}),O;O.value={};let G=[],Q=w.shape;for(let Y of w.keys){let L=Q[Y]._zod.run({value:X[Y],issues:[]},N);if(L instanceof Promise)G.push(L.then((H)=>TD(H,O,Y,X)));else TD(L,O,Y,X)}if(!A)return G.length?Promise.all(G).then(()=>O):O;return Zv(G,X,O,N,D.value,$)}}),OX=B("$ZodObjectJIT",($,I)=>{WA.init($,I);let U=$._zod.parse,D=DI(()=>fv(I)),b=(Y)=>{let v=new ED(["shape","payload","ctx"]),L=D.value,H=(x)=>{let a=YD(x);return`shape[${a}]._zod.run({ value: input[${a}], issues: [] }, ctx)`};v.write("const input = payload.value;");let z=Object.create(null),q=0;for(let x of L.keys)z[x]=`key_${q++}`;v.write("const newResult = {};");for(let x of L.keys){let a=z[x],h=YD(x);v.write(`const ${a} = ${H(x)};`),v.write(`
|
|
13
13
|
if (${a}.issues.length) {
|
|
14
14
|
payload.issues = payload.issues.concat(${a}.issues.map(iss => ({
|
|
15
15
|
...iss,
|
|
@@ -26,61 +26,62 @@ var BV=Object.create;var{getPrototypeOf:vV,defineProperty:_N,getOwnPropertyNames
|
|
|
26
26
|
newResult[${h}] = ${a}.value;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
`)}B.write("payload.value = newResult;"),B.write("return payload;");let g=B.compile();return(x,a)=>g(Y,x,a)},w,A=T4,N=!T1.jitless,X=N&&cN.value,G=I.catchall,Q;$._zod.parse=(Y,B)=>{Q??(Q=D.value);let J=Y.value;if(!A(J))return Y.issues.push({expected:"object",code:"invalid_type",input:J,inst:$}),Y;if(N&&X&&B?.async===!1&&B.jitless!==!0){if(!w)w=b(I.shape);if(Y=w(Y,B),!G)return Y;return QB([],J,Y,B,Q,$)}return U(Y,B)}});function sY($,I,U,D){for(let w of $)if(w.issues.length===0)return I.value=w.value,I;let b=$.filter((w)=>!I4(w));if(b.length===1)return I.value=b[0].value,b[0];return I.issues.push({code:"invalid_union",input:I.value,inst:U,errors:$.map((w)=>w.issues.map((A)=>u$(A,D,z$())))}),I}var QI=v("$ZodUnion",($,I)=>{n.init($,I),e($._zod,"optin",()=>I.options.some((b)=>b._zod.optin==="optional")?"optional":void 0),e($._zod,"optout",()=>I.options.some((b)=>b._zod.optout==="optional")?"optional":void 0),e($._zod,"values",()=>{if(I.options.every((b)=>b._zod.values))return new Set(I.options.flatMap((b)=>Array.from(b._zod.values)));return}),e($._zod,"pattern",()=>{if(I.options.every((b)=>b._zod.pattern)){let b=I.options.map((w)=>w._zod.pattern);return new RegExp(`^(${b.map((w)=>Z1(w.source)).join("|")})$`)}return});let U=I.options.length===1,D=I.options[0]._zod.run;$._zod.parse=(b,w)=>{if(U)return D(b,w);let A=!1,N=[];for(let O of I.options){let X=O._zod.run({value:b.value,issues:[]},w);if(X instanceof Promise)N.push(X),A=!0;else{if(X.issues.length===0)return X;N.push(X)}}if(!A)return sY(N,b,$,w);return Promise.all(N).then((O)=>{return sY(O,b,$,w)})}});function $B($,I,U,D){let b=$.filter((w)=>w.issues.length===0);if(b.length===1)return I.value=b[0].value,I;if(b.length===0)I.issues.push({code:"invalid_union",input:I.value,inst:U,errors:$.map((w)=>w.issues.map((A)=>u$(A,D,z$())))});else I.issues.push({code:"invalid_union",input:I.value,inst:U,errors:[],inclusive:!1});return I}var D0=v("$ZodXor",($,I)=>{QI.init($,I),I.inclusive=!1;let U=I.options.length===1,D=I.options[0]._zod.run;$._zod.parse=(b,w)=>{if(U)return D(b,w);let A=!1,N=[];for(let O of I.options){let X=O._zod.run({value:b.value,issues:[]},w);if(X instanceof Promise)N.push(X),A=!0;else N.push(X)}if(!A)return $B(N,b,$,w);return Promise.all(N).then((O)=>{return $B(O,b,$,w)})}}),w0=v("$ZodDiscriminatedUnion",($,I)=>{I.inclusive=!1,QI.init($,I);let U=$._zod.parse;e($._zod,"propValues",()=>{let b={};for(let w of I.options){let A=w._zod.propValues;if(!A||Object.keys(A).length===0)throw new Error(`Invalid discriminated union option at index "${I.options.indexOf(w)}"`);for(let[N,O]of Object.entries(A)){if(!b[N])b[N]=new Set;for(let X of O)b[N].add(X)}}return b});let D=DI(()=>{let b=I.options,w=new Map;for(let A of b){let N=A._zod.propValues?.[I.discriminator];if(!N||N.size===0)throw new Error(`Invalid discriminated union option at index "${I.options.indexOf(A)}"`);for(let O of N){if(w.has(O))throw new Error(`Duplicate discriminator value "${String(O)}"`);w.set(O,A)}}return w});$._zod.parse=(b,w)=>{let A=b.value;if(!T4(A))return b.issues.push({code:"invalid_type",expected:"object",input:A,inst:$}),b;let N=D.value.get(A?.[I.discriminator]);if(N)return N._zod.run(b,w);if(I.unionFallback)return U(b,w);return b.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:I.discriminator,input:A,path:[I.discriminator],inst:$}),b}}),A0=v("$ZodIntersection",($,I)=>{n.init($,I),$._zod.parse=(U,D)=>{let b=U.value,w=I.left._zod.run({value:b,issues:[]},D),A=I.right._zod.run({value:b,issues:[]},D);if(w instanceof Promise||A instanceof Promise)return Promise.all([w,A]).then(([O,X])=>{return IB(U,O,X)});return IB(U,w,A)}});function mO($,I){if($===I)return{valid:!0,data:$};if($ instanceof Date&&I instanceof Date&&+$===+I)return{valid:!0,data:$};if($4($)&&$4(I)){let U=Object.keys(I),D=Object.keys($).filter((w)=>U.indexOf(w)!==-1),b={...$,...I};for(let w of D){let A=mO($[w],I[w]);if(!A.valid)return{valid:!1,mergeErrorPath:[w,...A.mergeErrorPath]};b[w]=A.data}return{valid:!0,data:b}}if(Array.isArray($)&&Array.isArray(I)){if($.length!==I.length)return{valid:!1,mergeErrorPath:[]};let U=[];for(let D=0;D<$.length;D++){let b=$[D],w=I[D],A=mO(b,w);if(!A.valid)return{valid:!1,mergeErrorPath:[D,...A.mergeErrorPath]};U.push(A.data)}return{valid:!0,data:U}}return{valid:!1,mergeErrorPath:[]}}function IB($,I,U){if(I.issues.length)$.issues.push(...I.issues);if(U.issues.length)$.issues.push(...U.issues);if(I4($))return $;let D=mO(I.value,U.value);if(!D.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(D.mergeErrorPath)}`);return $.value=D.data,$}var r1=v("$ZodTuple",($,I)=>{n.init($,I);let U=I.items;$._zod.parse=(D,b)=>{let w=D.value;if(!Array.isArray(w))return D.issues.push({input:w,inst:$,expected:"tuple",code:"invalid_type"}),D;D.value=[];let A=[],N=[...U].reverse().findIndex((G)=>G._zod.optin!=="optional"),O=N===-1?0:U.length-N;if(!I.rest){let G=w.length>U.length,Q=w.length<O-1;if(G||Q)return D.issues.push({...G?{code:"too_big",maximum:U.length}:{code:"too_small",minimum:U.length},input:w,inst:$,origin:"array"}),D}let X=-1;for(let G of U){if(X++,X>=w.length){if(X>=O)continue}let Q=G._zod.run({value:w[X],issues:[]},b);if(Q instanceof Promise)A.push(Q.then((Y)=>VD(Y,D,X)));else VD(Q,D,X)}if(I.rest){let G=w.slice(U.length);for(let Q of G){X++;let Y=I.rest._zod.run({value:Q,issues:[]},b);if(Y instanceof Promise)A.push(Y.then((B)=>VD(B,D,X)));else VD(Y,D,X)}}if(A.length)return Promise.all(A).then(()=>D);return D}});function VD($,I,U){if($.issues.length)I.issues.push(...p$(U,$.issues));I.value[U]=$.value}var N0=v("$ZodRecord",($,I)=>{n.init($,I),$._zod.parse=(U,D)=>{let b=U.value;if(!$4(b))return U.issues.push({expected:"record",code:"invalid_type",input:b,inst:$}),U;let w=[],A=I.keyType._zod.values;if(A){U.value={};let N=new Set;for(let X of A)if(typeof X==="string"||typeof X==="number"||typeof X==="symbol"){N.add(typeof X==="number"?X.toString():X);let G=I.valueType._zod.run({value:b[X],issues:[]},D);if(G instanceof Promise)w.push(G.then((Q)=>{if(Q.issues.length)U.issues.push(...p$(X,Q.issues));U.value[X]=Q.value}));else{if(G.issues.length)U.issues.push(...p$(X,G.issues));U.value[X]=G.value}}let O;for(let X in b)if(!N.has(X))O=O??[],O.push(X);if(O&&O.length>0)U.issues.push({code:"unrecognized_keys",input:b,inst:$,keys:O})}else{U.value={};for(let N of Reflect.ownKeys(b)){if(N==="__proto__")continue;let O=I.keyType._zod.run({value:N,issues:[]},D);if(O instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(O.issues.length){if(I.mode==="loose")U.value[N]=b[N];else U.issues.push({code:"invalid_key",origin:"record",issues:O.issues.map((G)=>u$(G,D,z$())),input:N,path:[N],inst:$});continue}let X=I.valueType._zod.run({value:b[N],issues:[]},D);if(X instanceof Promise)w.push(X.then((G)=>{if(G.issues.length)U.issues.push(...p$(N,G.issues));U.value[O.value]=G.value}));else{if(X.issues.length)U.issues.push(...p$(N,X.issues));U.value[O.value]=X.value}}}if(w.length)return Promise.all(w).then(()=>U);return U}}),O0=v("$ZodMap",($,I)=>{n.init($,I),$._zod.parse=(U,D)=>{let b=U.value;if(!(b instanceof Map))return U.issues.push({expected:"map",code:"invalid_type",input:b,inst:$}),U;let w=[];U.value=new Map;for(let[A,N]of b){let O=I.keyType._zod.run({value:A,issues:[]},D),X=I.valueType._zod.run({value:N,issues:[]},D);if(O instanceof Promise||X instanceof Promise)w.push(Promise.all([O,X]).then(([G,Q])=>{UB(G,Q,U,A,b,$,D)}));else UB(O,X,U,A,b,$,D)}if(w.length)return Promise.all(w).then(()=>U);return U}});function UB($,I,U,D,b,w,A){if($.issues.length)if(f1.has(typeof D))U.issues.push(...p$(D,$.issues));else U.issues.push({code:"invalid_key",origin:"map",input:b,inst:w,issues:$.issues.map((N)=>u$(N,A,z$()))});if(I.issues.length)if(f1.has(typeof D))U.issues.push(...p$(D,I.issues));else U.issues.push({origin:"map",code:"invalid_element",input:b,inst:w,key:D,issues:I.issues.map((N)=>u$(N,A,z$()))});U.value.set($.value,I.value)}var X0=v("$ZodSet",($,I)=>{n.init($,I),$._zod.parse=(U,D)=>{let b=U.value;if(!(b instanceof Set))return U.issues.push({input:b,inst:$,expected:"set",code:"invalid_type"}),U;let w=[];U.value=new Set;for(let A of b){let N=I.valueType._zod.run({value:A,issues:[]},D);if(N instanceof Promise)w.push(N.then((O)=>bB(O,U)));else bB(N,U)}if(w.length)return Promise.all(w).then(()=>U);return U}});function bB($,I){if($.issues.length)I.issues.push(...$.issues);I.value.add($.value)}var W0=v("$ZodEnum",($,I)=>{n.init($,I);let U=C1(I.entries),D=new Set(U);$._zod.values=D,$._zod.pattern=new RegExp(`^(${U.filter((b)=>f1.has(typeof b)).map((b)=>typeof b==="string"?s$(b):b.toString()).join("|")})$`),$._zod.parse=(b,w)=>{let A=b.value;if(D.has(A))return b;return b.issues.push({code:"invalid_value",values:U,input:A,inst:$}),b}}),G0=v("$ZodLiteral",($,I)=>{if(n.init($,I),I.values.length===0)throw new Error("Cannot create literal schema with no valid values");let U=new Set(I.values);$._zod.values=U,$._zod.pattern=new RegExp(`^(${I.values.map((D)=>typeof D==="string"?s$(D):D?s$(D.toString()):String(D)).join("|")})$`),$._zod.parse=(D,b)=>{let w=D.value;if(U.has(w))return D;return D.issues.push({code:"invalid_value",values:I.values,input:w,inst:$}),D}}),Q0=v("$ZodFile",($,I)=>{n.init($,I),$._zod.parse=(U,D)=>{let b=U.value;if(b instanceof File)return U;return U.issues.push({expected:"file",code:"invalid_type",input:b,inst:$}),U}}),Y0=v("$ZodTransform",($,I)=>{n.init($,I),$._zod.parse=(U,D)=>{if(D.direction==="backward")throw new R4($.constructor.name);let b=I.transform(U.value,U);if(D.async)return(b instanceof Promise?b:Promise.resolve(b)).then((A)=>{return U.value=A,U});if(b instanceof Promise)throw new F6;return U.value=b,U}});function DB($,I){if($.issues.length&&I===void 0)return{issues:[],value:void 0};return $}var B0=v("$ZodOptional",($,I)=>{n.init($,I),$._zod.optin="optional",$._zod.optout="optional",e($._zod,"values",()=>{return I.innerType._zod.values?new Set([...I.innerType._zod.values,void 0]):void 0}),e($._zod,"pattern",()=>{let U=I.innerType._zod.pattern;return U?new RegExp(`^(${Z1(U.source)})?$`):void 0}),$._zod.parse=(U,D)=>{if(I.innerType._zod.optin==="optional"){let b=I.innerType._zod.run(U,D);if(b instanceof Promise)return b.then((w)=>DB(w,U.value));return DB(b,U.value)}if(U.value===void 0)return U;return I.innerType._zod.run(U,D)}}),v0=v("$ZodNullable",($,I)=>{n.init($,I),e($._zod,"optin",()=>I.innerType._zod.optin),e($._zod,"optout",()=>I.innerType._zod.optout),e($._zod,"pattern",()=>{let U=I.innerType._zod.pattern;return U?new RegExp(`^(${Z1(U.source)}|null)$`):void 0}),e($._zod,"values",()=>{return I.innerType._zod.values?new Set([...I.innerType._zod.values,null]):void 0}),$._zod.parse=(U,D)=>{if(U.value===null)return U;return I.innerType._zod.run(U,D)}}),J0=v("$ZodDefault",($,I)=>{n.init($,I),$._zod.optin="optional",e($._zod,"values",()=>I.innerType._zod.values),$._zod.parse=(U,D)=>{if(D.direction==="backward")return I.innerType._zod.run(U,D);if(U.value===void 0)return U.value=I.defaultValue,U;let b=I.innerType._zod.run(U,D);if(b instanceof Promise)return b.then((w)=>wB(w,I));return wB(b,I)}});function wB($,I){if($.value===void 0)$.value=I.defaultValue;return $}var H0=v("$ZodPrefault",($,I)=>{n.init($,I),$._zod.optin="optional",e($._zod,"values",()=>I.innerType._zod.values),$._zod.parse=(U,D)=>{if(D.direction==="backward")return I.innerType._zod.run(U,D);if(U.value===void 0)U.value=I.defaultValue;return I.innerType._zod.run(U,D)}}),L0=v("$ZodNonOptional",($,I)=>{n.init($,I),e($._zod,"values",()=>{let U=I.innerType._zod.values;return U?new Set([...U].filter((D)=>D!==void 0)):void 0}),$._zod.parse=(U,D)=>{let b=I.innerType._zod.run(U,D);if(b instanceof Promise)return b.then((w)=>AB(w,$));return AB(b,$)}});function AB($,I){if(!$.issues.length&&$.value===void 0)$.issues.push({code:"invalid_type",expected:"nonoptional",input:$.value,inst:I});return $}var z0=v("$ZodSuccess",($,I)=>{n.init($,I),$._zod.parse=(U,D)=>{if(D.direction==="backward")throw new R4("ZodSuccess");let b=I.innerType._zod.run(U,D);if(b instanceof Promise)return b.then((w)=>{return U.value=w.issues.length===0,U});return U.value=b.issues.length===0,U}}),V0=v("$ZodCatch",($,I)=>{n.init($,I),e($._zod,"optin",()=>I.innerType._zod.optin),e($._zod,"optout",()=>I.innerType._zod.optout),e($._zod,"values",()=>I.innerType._zod.values),$._zod.parse=(U,D)=>{if(D.direction==="backward")return I.innerType._zod.run(U,D);let b=I.innerType._zod.run(U,D);if(b instanceof Promise)return b.then((w)=>{if(U.value=w.value,w.issues.length)U.value=I.catchValue({...U,error:{issues:w.issues.map((A)=>u$(A,D,z$()))},input:U.value}),U.issues=[];return U});if(U.value=b.value,b.issues.length)U.value=I.catchValue({...U,error:{issues:b.issues.map((w)=>u$(w,D,z$()))},input:U.value}),U.issues=[];return U}}),M0=v("$ZodNaN",($,I)=>{n.init($,I),$._zod.parse=(U,D)=>{if(typeof U.value!=="number"||!Number.isNaN(U.value))return U.issues.push({input:U.value,inst:$,expected:"nan",code:"invalid_type"}),U;return U}}),K0=v("$ZodPipe",($,I)=>{n.init($,I),e($._zod,"values",()=>I.in._zod.values),e($._zod,"optin",()=>I.in._zod.optin),e($._zod,"optout",()=>I.out._zod.optout),e($._zod,"propValues",()=>I.in._zod.propValues),$._zod.parse=(U,D)=>{if(D.direction==="backward"){let w=I.out._zod.run(U,D);if(w instanceof Promise)return w.then((A)=>MD(A,I.in,D));return MD(w,I.in,D)}let b=I.in._zod.run(U,D);if(b instanceof Promise)return b.then((w)=>MD(w,I.out,D));return MD(b,I.out,D)}});function MD($,I,U){if($.issues.length)return $.aborted=!0,$;return I._zod.run({value:$.value,issues:$.issues},U)}var YI=v("$ZodCodec",($,I)=>{n.init($,I),e($._zod,"values",()=>I.in._zod.values),e($._zod,"optin",()=>I.in._zod.optin),e($._zod,"optout",()=>I.out._zod.optout),e($._zod,"propValues",()=>I.in._zod.propValues),$._zod.parse=(U,D)=>{if((D.direction||"forward")==="forward"){let w=I.in._zod.run(U,D);if(w instanceof Promise)return w.then((A)=>KD(A,I,D));return KD(w,I,D)}else{let w=I.out._zod.run(U,D);if(w instanceof Promise)return w.then((A)=>KD(A,I,D));return KD(w,I,D)}}});function KD($,I,U){if($.issues.length)return $.aborted=!0,$;if((U.direction||"forward")==="forward"){let b=I.transform($.value,$);if(b instanceof Promise)return b.then((w)=>FD($,w,I.out,U));return FD($,b,I.out,U)}else{let b=I.reverseTransform($.value,$);if(b instanceof Promise)return b.then((w)=>FD($,w,I.in,U));return FD($,b,I.in,U)}}function FD($,I,U,D){if($.issues.length)return $.aborted=!0,$;return U._zod.run({value:I,issues:$.issues},D)}var F0=v("$ZodReadonly",($,I)=>{n.init($,I),e($._zod,"propValues",()=>I.innerType._zod.propValues),e($._zod,"values",()=>I.innerType._zod.values),e($._zod,"optin",()=>I.innerType?._zod?.optin),e($._zod,"optout",()=>I.innerType?._zod?.optout),$._zod.parse=(U,D)=>{if(D.direction==="backward")return I.innerType._zod.run(U,D);let b=I.innerType._zod.run(U,D);if(b instanceof Promise)return b.then(NB);return NB(b)}});function NB($){return $.value=Object.freeze($.value),$}var q0=v("$ZodTemplateLiteral",($,I)=>{n.init($,I);let U=[];for(let D of I.parts)if(typeof D==="object"&&D!==null){if(!D._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...D._zod.traits].shift()}`);let b=D._zod.pattern instanceof RegExp?D._zod.pattern.source:D._zod.pattern;if(!b)throw new Error(`Invalid template literal part: ${D._zod.traits}`);let w=b.startsWith("^")?1:0,A=b.endsWith("$")?b.length-1:b.length;U.push(b.slice(w,A))}else if(D===null||mN.has(typeof D))U.push(s$(`${D}`));else throw new Error(`Invalid template literal part: ${D}`);$._zod.pattern=new RegExp(`^${U.join("")}$`),$._zod.parse=(D,b)=>{if(typeof D.value!=="string")return D.issues.push({input:D.value,inst:$,expected:"template_literal",code:"invalid_type"}),D;if($._zod.pattern.lastIndex=0,!$._zod.pattern.test(D.value))return D.issues.push({input:D.value,inst:$,code:"invalid_format",format:I.format??"template_literal",pattern:$._zod.pattern.source}),D;return D}}),k0=v("$ZodFunction",($,I)=>{return n.init($,I),$._def=I,$._zod.def=I,$.implement=(U)=>{if(typeof U!=="function")throw new Error("implement() must be called with a function");return function(...D){let b=$._def.input?_4($._def.input,D):D,w=Reflect.apply(U,this,b);if($._def.output)return _4($._def.output,w);return w}},$.implementAsync=(U)=>{if(typeof U!=="function")throw new Error("implementAsync() must be called with a function");return async function(...D){let b=$._def.input?await C4($._def.input,D):D,w=await Reflect.apply(U,this,b);if($._def.output)return await C4($._def.output,w);return w}},$._zod.parse=(U,D)=>{if(typeof U.value!=="function")return U.issues.push({code:"invalid_type",expected:"function",input:U.value,inst:$}),U;if($._def.output&&$._def.output._zod.def.type==="promise")U.value=$.implementAsync(U.value);else U.value=$.implement(U.value);return U},$.input=(...U)=>{let D=$.constructor;if(Array.isArray(U[0]))return new D({type:"function",input:new r1({type:"tuple",items:U[0],rest:U[1]}),output:$._def.output});return new D({type:"function",input:U[0],output:$._def.output})},$.output=(U)=>{return new $.constructor({type:"function",input:$._def.input,output:U})},$}),E0=v("$ZodPromise",($,I)=>{n.init($,I),$._zod.parse=(U,D)=>{return Promise.resolve(U.value).then((b)=>I.innerType._zod.run({value:b,issues:[]},D))}}),j0=v("$ZodLazy",($,I)=>{n.init($,I),e($._zod,"innerType",()=>I.getter()),e($._zod,"pattern",()=>$._zod.innerType?._zod?.pattern),e($._zod,"propValues",()=>$._zod.innerType?._zod?.propValues),e($._zod,"optin",()=>$._zod.innerType?._zod?.optin??void 0),e($._zod,"optout",()=>$._zod.innerType?._zod?.optout??void 0),$._zod.parse=(U,D)=>{return $._zod.innerType._zod.run(U,D)}}),S0=v("$ZodCustom",($,I)=>{X$.init($,I),n.init($,I),$._zod.parse=(U,D)=>{return U},$._zod.check=(U)=>{let D=U.value,b=I.fn(D);if(b instanceof Promise)return b.then((w)=>OB(w,U,D,$));OB(b,U,D,$);return}});function OB($,I,U,D){if(!$){let b={code:"custom",input:U,inst:D,path:[...D._zod.def.path??[]],continue:!D._zod.def.abort};if(D._zod.def.params)b.params=D._zod.def.params;I.issues.push(wI(b))}}var BI={};Z6(BI,{zhTW:()=>uX,zhCN:()=>hX,yo:()=>iX,vi:()=>lX,ur:()=>xX,uk:()=>t1,ua:()=>yX,tr:()=>gX,th:()=>fX,ta:()=>ZX,sv:()=>CX,sl:()=>_X,ru:()=>TX,pt:()=>RX,ps:()=>SX,pl:()=>PX,ota:()=>jX,no:()=>EX,nl:()=>kX,ms:()=>qX,mk:()=>FX,lt:()=>KX,ko:()=>MX,km:()=>o1,kh:()=>VX,ka:()=>zX,ja:()=>LX,it:()=>HX,is:()=>JX,id:()=>vX,hu:()=>BX,he:()=>YX,frCA:()=>QX,fr:()=>GX,fi:()=>WX,fa:()=>XX,es:()=>OX,eo:()=>NX,en:()=>m1,de:()=>AX,da:()=>wX,cs:()=>DX,ca:()=>bX,bg:()=>UX,be:()=>IX,az:()=>$X,ar:()=>sO});var iM=()=>{let $={string:{unit:"حرف",verb:"أن يحوي"},file:{unit:"بايت",verb:"أن يحوي"},array:{unit:"عنصر",verb:"أن يحوي"},set:{unit:"عنصر",verb:"أن يحوي"}};function I(b){return $[b]??null}let U=(b)=>{let w=typeof b;switch(w){case"number":return Number.isNaN(b)?"NaN":"number";case"object":{if(Array.isArray(b))return"array";if(b===null)return"null";if(Object.getPrototypeOf(b)!==Object.prototype&&b.constructor)return b.constructor.name}}return w},D={regex:"مدخل",email:"بريد إلكتروني",url:"رابط",emoji:"إيموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاريخ ووقت بمعيار ISO",date:"تاريخ بمعيار ISO",time:"وقت بمعيار ISO",duration:"مدة بمعيار ISO",ipv4:"عنوان IPv4",ipv6:"عنوان IPv6",cidrv4:"مدى عناوين بصيغة IPv4",cidrv6:"مدى عناوين بصيغة IPv6",base64:"نَص بترميز base64-encoded",base64url:"نَص بترميز base64url-encoded",json_string:"نَص على هيئة JSON",e164:"رقم هاتف بمعيار E.164",jwt:"JWT",template_literal:"مدخل"};return(b)=>{switch(b.code){case"invalid_type":return`مدخلات غير مقبولة: يفترض إدخال ${b.expected}، ولكن تم إدخال ${U(b.input)}`;case"invalid_value":if(b.values.length===1)return`مدخلات غير مقبولة: يفترض إدخال ${q(b.values[0])}`;return`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${z(b.values,"|")}`;case"too_big":{let w=b.inclusive?"<=":"<",A=I(b.origin);if(A)return` أكبر من اللازم: يفترض أن تكون ${b.origin??"القيمة"} ${w} ${b.maximum.toString()} ${A.unit??"عنصر"}`;return`أكبر من اللازم: يفترض أن تكون ${b.origin??"القيمة"} ${w} ${b.maximum.toString()}`}case"too_small":{let w=b.inclusive?">=":">",A=I(b.origin);if(A)return`أصغر من اللازم: يفترض لـ ${b.origin} أن يكون ${w} ${b.minimum.toString()} ${A.unit}`;return`أصغر من اللازم: يفترض لـ ${b.origin} أن يكون ${w} ${b.minimum.toString()}`}case"invalid_format":{let w=b;if(w.format==="starts_with")return`نَص غير مقبول: يجب أن يبدأ بـ "${b.prefix}"`;if(w.format==="ends_with")return`نَص غير مقبول: يجب أن ينتهي بـ "${w.suffix}"`;if(w.format==="includes")return`نَص غير مقبول: يجب أن يتضمَّن "${w.includes}"`;if(w.format==="regex")return`نَص غير مقبول: يجب أن يطابق النمط ${w.pattern}`;return`${D[w.format]??b.format} غير مقبول`}case"not_multiple_of":return`رقم غير مقبول: يجب أن يكون من مضاعفات ${b.divisor}`;case"unrecognized_keys":return`معرف${b.keys.length>1?"ات":""} غريب${b.keys.length>1?"ة":""}: ${z(b.keys,"، ")}`;case"invalid_key":return`معرف غير مقبول في ${b.origin}`;case"invalid_union":return"مدخل غير مقبول";case"invalid_element":return`مدخل غير مقبول في ${b.origin}`;default:return"مدخل غير مقبول"}}};function sO(){return{localeError:iM()}}var nM=()=>{let $={string:{unit:"simvol",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"element",verb:"olmalıdır"},set:{unit:"element",verb:"olmalıdır"}};function I(b){return $[b]??null}let U=(b)=>{let w=typeof b;switch(w){case"number":return Number.isNaN(b)?"NaN":"number";case"object":{if(Array.isArray(b))return"array";if(b===null)return"null";if(Object.getPrototypeOf(b)!==Object.prototype&&b.constructor)return b.constructor.name}}return w},D={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(b)=>{switch(b.code){case"invalid_type":return`Yanlış dəyər: gözlənilən ${b.expected}, daxil olan ${U(b.input)}`;case"invalid_value":if(b.values.length===1)return`Yanlış dəyər: gözlənilən ${q(b.values[0])}`;return`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${z(b.values,"|")}`;case"too_big":{let w=b.inclusive?"<=":"<",A=I(b.origin);if(A)return`Çox böyük: gözlənilən ${b.origin??"dəyər"} ${w}${b.maximum.toString()} ${A.unit??"element"}`;return`Çox böyük: gözlənilən ${b.origin??"dəyər"} ${w}${b.maximum.toString()}`}case"too_small":{let w=b.inclusive?">=":">",A=I(b.origin);if(A)return`Çox kiçik: gözlənilən ${b.origin} ${w}${b.minimum.toString()} ${A.unit}`;return`Çox kiçik: gözlənilən ${b.origin} ${w}${b.minimum.toString()}`}case"invalid_format":{let w=b;if(w.format==="starts_with")return`Yanlış mətn: "${w.prefix}" ilə başlamalıdır`;if(w.format==="ends_with")return`Yanlış mətn: "${w.suffix}" ilə bitməlidir`;if(w.format==="includes")return`Yanlış mətn: "${w.includes}" daxil olmalıdır`;if(w.format==="regex")return`Yanlış mətn: ${w.pattern} şablonuna uyğun olmalıdır`;return`Yanlış ${D[w.format]??b.format}`}case"not_multiple_of":return`Yanlış ədəd: ${b.divisor} ilə bölünə bilən olmalıdır`;case"unrecognized_keys":return`Tanınmayan açar${b.keys.length>1?"lar":""}: ${z(b.keys,", ")}`;case"invalid_key":return`${b.origin} daxilində yanlış açar`;case"invalid_union":return"Yanlış dəyər";case"invalid_element":return`${b.origin} daxilində yanlış dəyər`;default:return"Yanlış dəyər"}}};function $X(){return{localeError:nM()}}function YB($,I,U,D){let b=Math.abs($),w=b%10,A=b%100;if(A>=11&&A<=19)return D;if(w===1)return I;if(w>=2&&w<=4)return U;return D}var cM=()=>{let $={string:{unit:{one:"сімвал",few:"сімвалы",many:"сімвалаў"},verb:"мець"},array:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},set:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},file:{unit:{one:"байт",few:"байты",many:"байтаў"},verb:"мець"}};function I(b){return $[b]??null}let U=(b)=>{let w=typeof b;switch(w){case"number":return Number.isNaN(b)?"NaN":"лік";case"object":{if(Array.isArray(b))return"масіў";if(b===null)return"null";if(Object.getPrototypeOf(b)!==Object.prototype&&b.constructor)return b.constructor.name}}return w},D={regex:"увод",email:"email адрас",url:"URL",emoji:"эмодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата і час",date:"ISO дата",time:"ISO час",duration:"ISO працягласць",ipv4:"IPv4 адрас",ipv6:"IPv6 адрас",cidrv4:"IPv4 дыяпазон",cidrv6:"IPv6 дыяпазон",base64:"радок у фармаце base64",base64url:"радок у фармаце base64url",json_string:"JSON радок",e164:"нумар E.164",jwt:"JWT",template_literal:"увод"};return(b)=>{switch(b.code){case"invalid_type":return`Няправільны ўвод: чакаўся ${b.expected}, атрымана ${U(b.input)}`;case"invalid_value":if(b.values.length===1)return`Няправільны ўвод: чакалася ${q(b.values[0])}`;return`Няправільны варыянт: чакаўся адзін з ${z(b.values,"|")}`;case"too_big":{let w=b.inclusive?"<=":"<",A=I(b.origin);if(A){let N=Number(b.maximum),O=YB(N,A.unit.one,A.unit.few,A.unit.many);return`Занадта вялікі: чакалася, што ${b.origin??"значэнне"} павінна ${A.verb} ${w}${b.maximum.toString()} ${O}`}return`Занадта вялікі: чакалася, што ${b.origin??"значэнне"} павінна быць ${w}${b.maximum.toString()}`}case"too_small":{let w=b.inclusive?">=":">",A=I(b.origin);if(A){let N=Number(b.minimum),O=YB(N,A.unit.one,A.unit.few,A.unit.many);return`Занадта малы: чакалася, што ${b.origin} павінна ${A.verb} ${w}${b.minimum.toString()} ${O}`}return`Занадта малы: чакалася, што ${b.origin} павінна быць ${w}${b.minimum.toString()}`}case"invalid_format":{let w=b;if(w.format==="starts_with")return`Няправільны радок: павінен пачынацца з "${w.prefix}"`;if(w.format==="ends_with")return`Няправільны радок: павінен заканчвацца на "${w.suffix}"`;if(w.format==="includes")return`Няправільны радок: павінен змяшчаць "${w.includes}"`;if(w.format==="regex")return`Няправільны радок: павінен адпавядаць шаблону ${w.pattern}`;return`Няправільны ${D[w.format]??b.format}`}case"not_multiple_of":return`Няправільны лік: павінен быць кратным ${b.divisor}`;case"unrecognized_keys":return`Нераспазнаны ${b.keys.length>1?"ключы":"ключ"}: ${z(b.keys,", ")}`;case"invalid_key":return`Няправільны ключ у ${b.origin}`;case"invalid_union":return"Няправільны ўвод";case"invalid_element":return`Няправільнае значэнне ў ${b.origin}`;default:return"Няправільны ўвод"}}};function IX(){return{localeError:cM()}}var rM=($)=>{let I=typeof $;switch(I){case"number":return Number.isNaN($)?"NaN":"число";case"object":{if(Array.isArray($))return"масив";if($===null)return"null";if(Object.getPrototypeOf($)!==Object.prototype&&$.constructor)return $.constructor.name}}return I},mM=()=>{let $={string:{unit:"символа",verb:"да съдържа"},file:{unit:"байта",verb:"да съдържа"},array:{unit:"елемента",verb:"да съдържа"},set:{unit:"елемента",verb:"да съдържа"}};function I(D){return $[D]??null}let U={regex:"вход",email:"имейл адрес",url:"URL",emoji:"емоджи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO време",date:"ISO дата",time:"ISO време",duration:"ISO продължителност",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"base64-кодиран низ",base64url:"base64url-кодиран низ",json_string:"JSON низ",e164:"E.164 номер",jwt:"JWT",template_literal:"вход"};return(D)=>{switch(D.code){case"invalid_type":return`Невалиден вход: очакван ${D.expected}, получен ${rM(D.input)}`;case"invalid_value":if(D.values.length===1)return`Невалиден вход: очакван ${q(D.values[0])}`;return`Невалидна опция: очаквано едно от ${z(D.values,"|")}`;case"too_big":{let b=D.inclusive?"<=":"<",w=I(D.origin);if(w)return`Твърде голямо: очаква се ${D.origin??"стойност"} да съдържа ${b}${D.maximum.toString()} ${w.unit??"елемента"}`;return`Твърде голямо: очаква се ${D.origin??"стойност"} да бъде ${b}${D.maximum.toString()}`}case"too_small":{let b=D.inclusive?">=":">",w=I(D.origin);if(w)return`Твърде малко: очаква се ${D.origin} да съдържа ${b}${D.minimum.toString()} ${w.unit}`;return`Твърде малко: очаква се ${D.origin} да бъде ${b}${D.minimum.toString()}`}case"invalid_format":{let b=D;if(b.format==="starts_with")return`Невалиден низ: трябва да започва с "${b.prefix}"`;if(b.format==="ends_with")return`Невалиден низ: трябва да завършва с "${b.suffix}"`;if(b.format==="includes")return`Невалиден низ: трябва да включва "${b.includes}"`;if(b.format==="regex")return`Невалиден низ: трябва да съвпада с ${b.pattern}`;let w="Невалиден";if(b.format==="emoji")w="Невалидно";if(b.format==="datetime")w="Невалидно";if(b.format==="date")w="Невалидна";if(b.format==="time")w="Невалидно";if(b.format==="duration")w="Невалидна";return`${w} ${U[b.format]??D.format}`}case"not_multiple_of":return`Невалидно число: трябва да бъде кратно на ${D.divisor}`;case"unrecognized_keys":return`Неразпознат${D.keys.length>1?"и":""} ключ${D.keys.length>1?"ове":""}: ${z(D.keys,", ")}`;case"invalid_key":return`Невалиден ключ в ${D.origin}`;case"invalid_union":return"Невалиден вход";case"invalid_element":return`Невалидна стойност в ${D.origin}`;default:return"Невалиден вход"}}};function UX(){return{localeError:mM()}}var oM=()=>{let $={string:{unit:"caràcters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function I(b){return $[b]??null}let U=(b)=>{let w=typeof b;switch(w){case"number":return Number.isNaN(b)?"NaN":"number";case"object":{if(Array.isArray(b))return"array";if(b===null)return"null";if(Object.getPrototypeOf(b)!==Object.prototype&&b.constructor)return b.constructor.name}}return w},D={regex:"entrada",email:"adreça electrònica",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:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adreça IPv4",ipv6:"adreça IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"};return(b)=>{switch(b.code){case"invalid_type":return`Tipus invàlid: s'esperava ${b.expected}, s'ha rebut ${U(b.input)}`;case"invalid_value":if(b.values.length===1)return`Valor invàlid: s'esperava ${q(b.values[0])}`;return`Opció invàlida: s'esperava una de ${z(b.values," o ")}`;case"too_big":{let w=b.inclusive?"com a màxim":"menys de",A=I(b.origin);if(A)return`Massa gran: s'esperava que ${b.origin??"el valor"} contingués ${w} ${b.maximum.toString()} ${A.unit??"elements"}`;return`Massa gran: s'esperava que ${b.origin??"el valor"} fos ${w} ${b.maximum.toString()}`}case"too_small":{let w=b.inclusive?"com a mínim":"més de",A=I(b.origin);if(A)return`Massa petit: s'esperava que ${b.origin} contingués ${w} ${b.minimum.toString()} ${A.unit}`;return`Massa petit: s'esperava que ${b.origin} fos ${w} ${b.minimum.toString()}`}case"invalid_format":{let w=b;if(w.format==="starts_with")return`Format invàlid: ha de començar amb "${w.prefix}"`;if(w.format==="ends_with")return`Format invàlid: ha d'acabar amb "${w.suffix}"`;if(w.format==="includes")return`Format invàlid: ha d'incloure "${w.includes}"`;if(w.format==="regex")return`Format invàlid: ha de coincidir amb el patró ${w.pattern}`;return`Format invàlid per a ${D[w.format]??b.format}`}case"not_multiple_of":return`Número invàlid: ha de ser múltiple de ${b.divisor}`;case"unrecognized_keys":return`Clau${b.keys.length>1?"s":""} no reconeguda${b.keys.length>1?"s":""}: ${z(b.keys,", ")}`;case"invalid_key":return`Clau invàlida a ${b.origin}`;case"invalid_union":return"Entrada invàlida";case"invalid_element":return`Element invàlid a ${b.origin}`;default:return"Entrada invàlida"}}};function bX(){return{localeError:oM()}}var dM=()=>{let $={string:{unit:"znaků",verb:"mít"},file:{unit:"bajtů",verb:"mít"},array:{unit:"prvků",verb:"mít"},set:{unit:"prvků",verb:"mít"}};function I(b){return $[b]??null}let U=(b)=>{let w=typeof b;switch(w){case"number":return Number.isNaN(b)?"NaN":"číslo";case"string":return"řetězec";case"boolean":return"boolean";case"bigint":return"bigint";case"function":return"funkce";case"symbol":return"symbol";case"undefined":return"undefined";case"object":{if(Array.isArray(b))return"pole";if(b===null)return"null";if(Object.getPrototypeOf(b)!==Object.prototype&&b.constructor)return b.constructor.name}}return w},D={regex:"regulární výraz",email:"e-mailová adresa",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:"datum a čas ve formátu ISO",date:"datum ve formátu ISO",time:"čas ve formátu ISO",duration:"doba trvání ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"řetězec zakódovaný ve formátu base64",base64url:"řetězec zakódovaný ve formátu base64url",json_string:"řetězec ve formátu JSON",e164:"číslo E.164",jwt:"JWT",template_literal:"vstup"};return(b)=>{switch(b.code){case"invalid_type":return`Neplatný vstup: očekáváno ${b.expected}, obdrženo ${U(b.input)}`;case"invalid_value":if(b.values.length===1)return`Neplatný vstup: očekáváno ${q(b.values[0])}`;return`Neplatná možnost: očekávána jedna z hodnot ${z(b.values,"|")}`;case"too_big":{let w=b.inclusive?"<=":"<",A=I(b.origin);if(A)return`Hodnota je příliš velká: ${b.origin??"hodnota"} musí mít ${w}${b.maximum.toString()} ${A.unit??"prvků"}`;return`Hodnota je příliš velká: ${b.origin??"hodnota"} musí být ${w}${b.maximum.toString()}`}case"too_small":{let w=b.inclusive?">=":">",A=I(b.origin);if(A)return`Hodnota je příliš malá: ${b.origin??"hodnota"} musí mít ${w}${b.minimum.toString()} ${A.unit??"prvků"}`;return`Hodnota je příliš malá: ${b.origin??"hodnota"} musí být ${w}${b.minimum.toString()}`}case"invalid_format":{let w=b;if(w.format==="starts_with")return`Neplatný řetězec: musí začínat na "${w.prefix}"`;if(w.format==="ends_with")return`Neplatný řetězec: musí končit na "${w.suffix}"`;if(w.format==="includes")return`Neplatný řetězec: musí obsahovat "${w.includes}"`;if(w.format==="regex")return`Neplatný řetězec: musí odpovídat vzoru ${w.pattern}`;return`Neplatný formát ${D[w.format]??b.format}`}case"not_multiple_of":return`Neplatné číslo: musí být násobkem ${b.divisor}`;case"unrecognized_keys":return`Neznámé klíče: ${z(b.keys,", ")}`;case"invalid_key":return`Neplatný klíč v ${b.origin}`;case"invalid_union":return"Neplatný vstup";case"invalid_element":return`Neplatná hodnota v ${b.origin}`;default:return"Neplatný vstup"}}};function DX(){return{localeError:dM()}}var pM=()=>{let $={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}},I={string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"sæt",file:"fil"};function U(A){return $[A]??null}function D(A){return I[A]??A}let b=(A)=>{let N=typeof A;switch(N){case"number":return Number.isNaN(A)?"NaN":"tal";case"object":{if(Array.isArray(A))return"liste";if(A===null)return"null";if(Object.getPrototypeOf(A)!==Object.prototype&&A.constructor)return A.constructor.name;return"objekt"}}return N},w={regex:"input",email:"e-mailadresse",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 dato- og klokkeslæt",date:"ISO-dato",time:"ISO-klokkeslæt",duration:"ISO-varighed",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"};return(A)=>{switch(A.code){case"invalid_type":return`Ugyldigt input: forventede ${D(A.expected)}, fik ${D(b(A.input))}`;case"invalid_value":if(A.values.length===1)return`Ugyldig værdi: forventede ${q(A.values[0])}`;return`Ugyldigt valg: forventede en af følgende ${z(A.values,"|")}`;case"too_big":{let N=A.inclusive?"<=":"<",O=U(A.origin),X=D(A.origin);if(O)return`For stor: forventede ${X??"value"} ${O.verb} ${N} ${A.maximum.toString()} ${O.unit??"elementer"}`;return`For stor: forventede ${X??"value"} havde ${N} ${A.maximum.toString()}`}case"too_small":{let N=A.inclusive?">=":">",O=U(A.origin),X=D(A.origin);if(O)return`For lille: forventede ${X} ${O.verb} ${N} ${A.minimum.toString()} ${O.unit}`;return`For lille: forventede ${X} havde ${N} ${A.minimum.toString()}`}case"invalid_format":{let N=A;if(N.format==="starts_with")return`Ugyldig streng: skal starte med "${N.prefix}"`;if(N.format==="ends_with")return`Ugyldig streng: skal ende med "${N.suffix}"`;if(N.format==="includes")return`Ugyldig streng: skal indeholde "${N.includes}"`;if(N.format==="regex")return`Ugyldig streng: skal matche mønsteret ${N.pattern}`;return`Ugyldig ${w[N.format]??A.format}`}case"not_multiple_of":return`Ugyldigt tal: skal være deleligt med ${A.divisor}`;case"unrecognized_keys":return`${A.keys.length>1?"Ukendte nøgler":"Ukendt nøgle"}: ${z(A.keys,", ")}`;case"invalid_key":return`Ugyldig nøgle i ${A.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig værdi i ${A.origin}`;default:return"Ugyldigt input"}}};function wX(){return{localeError:pM()}}var tM=()=>{let $={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function I(b){return $[b]??null}let U=(b)=>{let w=typeof b;switch(w){case"number":return Number.isNaN(b)?"NaN":"Zahl";case"object":{if(Array.isArray(b))return"Array";if(b===null)return"null";if(Object.getPrototypeOf(b)!==Object.prototype&&b.constructor)return b.constructor.name}}return w},D={regex:"Eingabe",email:"E-Mail-Adresse",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-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"};return(b)=>{switch(b.code){case"invalid_type":return`Ungültige Eingabe: erwartet ${b.expected}, erhalten ${U(b.input)}`;case"invalid_value":if(b.values.length===1)return`Ungültige Eingabe: erwartet ${q(b.values[0])}`;return`Ungültige Option: erwartet eine von ${z(b.values,"|")}`;case"too_big":{let w=b.inclusive?"<=":"<",A=I(b.origin);if(A)return`Zu groß: erwartet, dass ${b.origin??"Wert"} ${w}${b.maximum.toString()} ${A.unit??"Elemente"} hat`;return`Zu groß: erwartet, dass ${b.origin??"Wert"} ${w}${b.maximum.toString()} ist`}case"too_small":{let w=b.inclusive?">=":">",A=I(b.origin);if(A)return`Zu klein: erwartet, dass ${b.origin} ${w}${b.minimum.toString()} ${A.unit} hat`;return`Zu klein: erwartet, dass ${b.origin} ${w}${b.minimum.toString()} ist`}case"invalid_format":{let w=b;if(w.format==="starts_with")return`Ungültiger String: muss mit "${w.prefix}" beginnen`;if(w.format==="ends_with")return`Ungültiger String: muss mit "${w.suffix}" enden`;if(w.format==="includes")return`Ungültiger String: muss "${w.includes}" enthalten`;if(w.format==="regex")return`Ungültiger String: muss dem Muster ${w.pattern} entsprechen`;return`Ungültig: ${D[w.format]??b.format}`}case"not_multiple_of":return`Ungültige Zahl: muss ein Vielfaches von ${b.divisor} sein`;case"unrecognized_keys":return`${b.keys.length>1?"Unbekannte Schlüssel":"Unbekannter Schlüssel"}: ${z(b.keys,", ")}`;case"invalid_key":return`Ungültiger Schlüssel in ${b.origin}`;case"invalid_union":return"Ungültige Eingabe";case"invalid_element":return`Ungültiger Wert in ${b.origin}`;default:return"Ungültige Eingabe"}}};function AX(){return{localeError:tM()}}var aM=($)=>{let I=typeof $;switch(I){case"number":return Number.isNaN($)?"NaN":"number";case"object":{if(Array.isArray($))return"array";if($===null)return"null";if(Object.getPrototypeOf($)!==Object.prototype&&$.constructor)return $.constructor.name}}return I},eM=()=>{let $={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 I(D){return $[D]??null}let U={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return(D)=>{switch(D.code){case"invalid_type":return`Invalid input: expected ${D.expected}, received ${aM(D.input)}`;case"invalid_value":if(D.values.length===1)return`Invalid input: expected ${q(D.values[0])}`;return`Invalid option: expected one of ${z(D.values,"|")}`;case"too_big":{let b=D.inclusive?"<=":"<",w=I(D.origin);if(w)return`Too big: expected ${D.origin??"value"} to have ${b}${D.maximum.toString()} ${w.unit??"elements"}`;return`Too big: expected ${D.origin??"value"} to be ${b}${D.maximum.toString()}`}case"too_small":{let b=D.inclusive?">=":">",w=I(D.origin);if(w)return`Too small: expected ${D.origin} to have ${b}${D.minimum.toString()} ${w.unit}`;return`Too small: expected ${D.origin} to be ${b}${D.minimum.toString()}`}case"invalid_format":{let b=D;if(b.format==="starts_with")return`Invalid string: must start with "${b.prefix}"`;if(b.format==="ends_with")return`Invalid string: must end with "${b.suffix}"`;if(b.format==="includes")return`Invalid string: must include "${b.includes}"`;if(b.format==="regex")return`Invalid string: must match pattern ${b.pattern}`;return`Invalid ${U[b.format]??D.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${D.divisor}`;case"unrecognized_keys":return`Unrecognized key${D.keys.length>1?"s":""}: ${z(D.keys,", ")}`;case"invalid_key":return`Invalid key in ${D.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${D.origin}`;default:return"Invalid input"}}};function m1(){return{localeError:eM()}}var sM=($)=>{let I=typeof $;switch(I){case"number":return Number.isNaN($)?"NaN":"nombro";case"object":{if(Array.isArray($))return"tabelo";if($===null)return"senvalora";if(Object.getPrototypeOf($)!==Object.prototype&&$.constructor)return $.constructor.name}}return I},$K=()=>{let $={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function I(D){return $[D]??null}let U={regex:"enigo",email:"retadreso",url:"URL",emoji:"emoĝio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-daŭro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"};return(D)=>{switch(D.code){case"invalid_type":return`Nevalida enigo: atendiĝis ${D.expected}, riceviĝis ${sM(D.input)}`;case"invalid_value":if(D.values.length===1)return`Nevalida enigo: atendiĝis ${q(D.values[0])}`;return`Nevalida opcio: atendiĝis unu el ${z(D.values,"|")}`;case"too_big":{let b=D.inclusive?"<=":"<",w=I(D.origin);if(w)return`Tro granda: atendiĝis ke ${D.origin??"valoro"} havu ${b}${D.maximum.toString()} ${w.unit??"elementojn"}`;return`Tro granda: atendiĝis ke ${D.origin??"valoro"} havu ${b}${D.maximum.toString()}`}case"too_small":{let b=D.inclusive?">=":">",w=I(D.origin);if(w)return`Tro malgranda: atendiĝis ke ${D.origin} havu ${b}${D.minimum.toString()} ${w.unit}`;return`Tro malgranda: atendiĝis ke ${D.origin} estu ${b}${D.minimum.toString()}`}case"invalid_format":{let b=D;if(b.format==="starts_with")return`Nevalida karaktraro: devas komenciĝi per "${b.prefix}"`;if(b.format==="ends_with")return`Nevalida karaktraro: devas finiĝi per "${b.suffix}"`;if(b.format==="includes")return`Nevalida karaktraro: devas inkluzivi "${b.includes}"`;if(b.format==="regex")return`Nevalida karaktraro: devas kongrui kun la modelo ${b.pattern}`;return`Nevalida ${U[b.format]??D.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${D.divisor}`;case"unrecognized_keys":return`Nekonata${D.keys.length>1?"j":""} ŝlosilo${D.keys.length>1?"j":""}: ${z(D.keys,", ")}`;case"invalid_key":return`Nevalida ŝlosilo en ${D.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${D.origin}`;default:return"Nevalida enigo"}}};function NX(){return{localeError:$K()}}var IK=()=>{let $={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}},I={string:"texto",number:"número",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"número grande",symbol:"símbolo",undefined:"indefinido",null:"nulo",function:"función",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeración",union:"unión",literal:"literal",promise:"promesa",void:"vacío",never:"nunca",unknown:"desconocido",any:"cualquiera"};function U(A){return $[A]??null}function D(A){return I[A]??A}let b=(A)=>{let N=typeof A;switch(N){case"number":return Number.isNaN(A)?"NaN":"number";case"object":{if(Array.isArray(A))return"array";if(A===null)return"null";if(Object.getPrototypeOf(A)!==Object.prototype)return A.constructor.name;return"object"}}return N},w={regex:"entrada",email:"dirección de correo electrónico",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:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duración ISO",ipv4:"dirección IPv4",ipv6:"dirección IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"};return(A)=>{switch(A.code){case"invalid_type":return`Entrada inválida: se esperaba ${D(A.expected)}, recibido ${D(b(A.input))}`;case"invalid_value":if(A.values.length===1)return`Entrada inválida: se esperaba ${q(A.values[0])}`;return`Opción inválida: se esperaba una de ${z(A.values,"|")}`;case"too_big":{let N=A.inclusive?"<=":"<",O=U(A.origin),X=D(A.origin);if(O)return`Demasiado grande: se esperaba que ${X??"valor"} tuviera ${N}${A.maximum.toString()} ${O.unit??"elementos"}`;return`Demasiado grande: se esperaba que ${X??"valor"} fuera ${N}${A.maximum.toString()}`}case"too_small":{let N=A.inclusive?">=":">",O=U(A.origin),X=D(A.origin);if(O)return`Demasiado pequeño: se esperaba que ${X} tuviera ${N}${A.minimum.toString()} ${O.unit}`;return`Demasiado pequeño: se esperaba que ${X} fuera ${N}${A.minimum.toString()}`}case"invalid_format":{let N=A;if(N.format==="starts_with")return`Cadena inválida: debe comenzar con "${N.prefix}"`;if(N.format==="ends_with")return`Cadena inválida: debe terminar en "${N.suffix}"`;if(N.format==="includes")return`Cadena inválida: debe incluir "${N.includes}"`;if(N.format==="regex")return`Cadena inválida: debe coincidir con el patrón ${N.pattern}`;return`Inválido ${w[N.format]??A.format}`}case"not_multiple_of":return`Número inválido: debe ser múltiplo de ${A.divisor}`;case"unrecognized_keys":return`Llave${A.keys.length>1?"s":""} desconocida${A.keys.length>1?"s":""}: ${z(A.keys,", ")}`;case"invalid_key":return`Llave inválida en ${D(A.origin)}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido en ${D(A.origin)}`;default:return"Entrada inválida"}}};function OX(){return{localeError:IK()}}var UK=()=>{let $={string:{unit:"کاراکتر",verb:"داشته باشد"},file:{unit:"بایت",verb:"داشته باشد"},array:{unit:"آیتم",verb:"داشته باشد"},set:{unit:"آیتم",verb:"داشته باشد"}};function I(b){return $[b]??null}let U=(b)=>{let w=typeof b;switch(w){case"number":return Number.isNaN(b)?"NaN":"عدد";case"object":{if(Array.isArray(b))return"آرایه";if(b===null)return"null";if(Object.getPrototypeOf(b)!==Object.prototype&&b.constructor)return b.constructor.name}}return w},D={regex:"ورودی",email:"آدرس ایمیل",url:"URL",emoji:"ایموجی",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاریخ و زمان ایزو",date:"تاریخ ایزو",time:"زمان ایزو",duration:"مدت زمان ایزو",ipv4:"IPv4 آدرس",ipv6:"IPv6 آدرس",cidrv4:"IPv4 دامنه",cidrv6:"IPv6 دامنه",base64:"base64-encoded رشته",base64url:"base64url-encoded رشته",json_string:"JSON رشته",e164:"E.164 عدد",jwt:"JWT",template_literal:"ورودی"};return(b)=>{switch(b.code){case"invalid_type":return`ورودی نامعتبر: میبایست ${b.expected} میبود، ${U(b.input)} دریافت شد`;case"invalid_value":if(b.values.length===1)return`ورودی نامعتبر: میبایست ${q(b.values[0])} میبود`;return`گزینه نامعتبر: میبایست یکی از ${z(b.values,"|")} میبود`;case"too_big":{let w=b.inclusive?"<=":"<",A=I(b.origin);if(A)return`خیلی بزرگ: ${b.origin??"مقدار"} باید ${w}${b.maximum.toString()} ${A.unit??"عنصر"} باشد`;return`خیلی بزرگ: ${b.origin??"مقدار"} باید ${w}${b.maximum.toString()} باشد`}case"too_small":{let w=b.inclusive?">=":">",A=I(b.origin);if(A)return`خیلی کوچک: ${b.origin} باید ${w}${b.minimum.toString()} ${A.unit} باشد`;return`خیلی کوچک: ${b.origin} باید ${w}${b.minimum.toString()} باشد`}case"invalid_format":{let w=b;if(w.format==="starts_with")return`رشته نامعتبر: باید با "${w.prefix}" شروع شود`;if(w.format==="ends_with")return`رشته نامعتبر: باید با "${w.suffix}" تمام شود`;if(w.format==="includes")return`رشته نامعتبر: باید شامل "${w.includes}" باشد`;if(w.format==="regex")return`رشته نامعتبر: باید با الگوی ${w.pattern} مطابقت داشته باشد`;return`${D[w.format]??b.format} نامعتبر`}case"not_multiple_of":return`عدد نامعتبر: باید مضرب ${b.divisor} باشد`;case"unrecognized_keys":return`کلید${b.keys.length>1?"های":""} ناشناس: ${z(b.keys,", ")}`;case"invalid_key":return`کلید ناشناس در ${b.origin}`;case"invalid_union":return"ورودی نامعتبر";case"invalid_element":return`مقدار نامعتبر در ${b.origin}`;default:return"ورودی نامعتبر"}}};function XX(){return{localeError:UK()}}var bK=()=>{let $={string:{unit:"merkkiä",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"päivämäärän"}};function I(b){return $[b]??null}let U=(b)=>{let w=typeof b;switch(w){case"number":return Number.isNaN(b)?"NaN":"number";case"object":{if(Array.isArray(b))return"array";if(b===null)return"null";if(Object.getPrototypeOf(b)!==Object.prototype&&b.constructor)return b.constructor.name}}return w},D={regex:"säännöllinen lauseke",email:"sähköpostiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-päivämäärä",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"};return(b)=>{switch(b.code){case"invalid_type":return`Virheellinen tyyppi: odotettiin ${b.expected}, oli ${U(b.input)}`;case"invalid_value":if(b.values.length===1)return`Virheellinen syöte: täytyy olla ${q(b.values[0])}`;return`Virheellinen valinta: täytyy olla yksi seuraavista: ${z(b.values,"|")}`;case"too_big":{let w=b.inclusive?"<=":"<",A=I(b.origin);if(A)return`Liian suuri: ${A.subject} täytyy olla ${w}${b.maximum.toString()} ${A.unit}`.trim();return`Liian suuri: arvon täytyy olla ${w}${b.maximum.toString()}`}case"too_small":{let w=b.inclusive?">=":">",A=I(b.origin);if(A)return`Liian pieni: ${A.subject} täytyy olla ${w}${b.minimum.toString()} ${A.unit}`.trim();return`Liian pieni: arvon täytyy olla ${w}${b.minimum.toString()}`}case"invalid_format":{let w=b;if(w.format==="starts_with")return`Virheellinen syöte: täytyy alkaa "${w.prefix}"`;if(w.format==="ends_with")return`Virheellinen syöte: täytyy loppua "${w.suffix}"`;if(w.format==="includes")return`Virheellinen syöte: täytyy sisältää "${w.includes}"`;if(w.format==="regex")return`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${w.pattern}`;return`Virheellinen ${D[w.format]??b.format}`}case"not_multiple_of":return`Virheellinen luku: täytyy olla luvun ${b.divisor} monikerta`;case"unrecognized_keys":return`${b.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${z(b.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen syöte"}}};function WX(){return{localeError:bK()}}var DK=()=>{let $={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function I(b){return $[b]??null}let U=(b)=>{let w=typeof b;switch(w){case"number":return Number.isNaN(b)?"NaN":"nombre";case"object":{if(Array.isArray(b))return"tableau";if(b===null)return"null";if(Object.getPrototypeOf(b)!==Object.prototype&&b.constructor)return b.constructor.name}}return w},D={regex:"entrée",email:"adresse e-mail",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:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"};return(b)=>{switch(b.code){case"invalid_type":return`Entrée invalide : ${b.expected} attendu, ${U(b.input)} reçu`;case"invalid_value":if(b.values.length===1)return`Entrée invalide : ${q(b.values[0])} attendu`;return`Option invalide : une valeur parmi ${z(b.values,"|")} attendue`;case"too_big":{let w=b.inclusive?"<=":"<",A=I(b.origin);if(A)return`Trop grand : ${b.origin??"valeur"} doit ${A.verb} ${w}${b.maximum.toString()} ${A.unit??"élément(s)"}`;return`Trop grand : ${b.origin??"valeur"} doit être ${w}${b.maximum.toString()}`}case"too_small":{let w=b.inclusive?">=":">",A=I(b.origin);if(A)return`Trop petit : ${b.origin} doit ${A.verb} ${w}${b.minimum.toString()} ${A.unit}`;return`Trop petit : ${b.origin} doit être ${w}${b.minimum.toString()}`}case"invalid_format":{let w=b;if(w.format==="starts_with")return`Chaîne invalide : doit commencer par "${w.prefix}"`;if(w.format==="ends_with")return`Chaîne invalide : doit se terminer par "${w.suffix}"`;if(w.format==="includes")return`Chaîne invalide : doit inclure "${w.includes}"`;if(w.format==="regex")return`Chaîne invalide : doit correspondre au modèle ${w.pattern}`;return`${D[w.format]??b.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${b.divisor}`;case"unrecognized_keys":return`Clé${b.keys.length>1?"s":""} non reconnue${b.keys.length>1?"s":""} : ${z(b.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${b.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${b.origin}`;default:return"Entrée invalide"}}};function GX(){return{localeError:DK()}}var wK=()=>{let $={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function I(b){return $[b]??null}let U=(b)=>{let w=typeof b;switch(w){case"number":return Number.isNaN(b)?"NaN":"number";case"object":{if(Array.isArray(b))return"array";if(b===null)return"null";if(Object.getPrototypeOf(b)!==Object.prototype&&b.constructor)return b.constructor.name}}return w},D={regex:"entrée",email:"adresse courriel",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:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"};return(b)=>{switch(b.code){case"invalid_type":return`Entrée invalide : attendu ${b.expected}, reçu ${U(b.input)}`;case"invalid_value":if(b.values.length===1)return`Entrée invalide : attendu ${q(b.values[0])}`;return`Option invalide : attendu l'une des valeurs suivantes ${z(b.values,"|")}`;case"too_big":{let w=b.inclusive?"≤":"<",A=I(b.origin);if(A)return`Trop grand : attendu que ${b.origin??"la valeur"} ait ${w}${b.maximum.toString()} ${A.unit}`;return`Trop grand : attendu que ${b.origin??"la valeur"} soit ${w}${b.maximum.toString()}`}case"too_small":{let w=b.inclusive?"≥":">",A=I(b.origin);if(A)return`Trop petit : attendu que ${b.origin} ait ${w}${b.minimum.toString()} ${A.unit}`;return`Trop petit : attendu que ${b.origin} soit ${w}${b.minimum.toString()}`}case"invalid_format":{let w=b;if(w.format==="starts_with")return`Chaîne invalide : doit commencer par "${w.prefix}"`;if(w.format==="ends_with")return`Chaîne invalide : doit se terminer par "${w.suffix}"`;if(w.format==="includes")return`Chaîne invalide : doit inclure "${w.includes}"`;if(w.format==="regex")return`Chaîne invalide : doit correspondre au motif ${w.pattern}`;return`${D[w.format]??b.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${b.divisor}`;case"unrecognized_keys":return`Clé${b.keys.length>1?"s":""} non reconnue${b.keys.length>1?"s":""} : ${z(b.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${b.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${b.origin}`;default:return"Entrée invalide"}}};function QX(){return{localeError:wK()}}var AK=()=>{let $={string:{label:"מחרוזת",gender:"f"},number:{label:"מספר",gender:"m"},boolean:{label:"ערך בוליאני",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"תאריך",gender:"m"},array:{label:"מערך",gender:"m"},object:{label:"אובייקט",gender:"m"},null:{label:"ערך ריק (null)",gender:"m"},undefined:{label:"ערך לא מוגדר (undefined)",gender:"m"},symbol:{label:"סימבול (Symbol)",gender:"m"},function:{label:"פונקציה",gender:"f"},map:{label:"מפה (Map)",gender:"f"},set:{label:"קבוצה (Set)",gender:"f"},file:{label:"קובץ",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"ערך לא ידוע",gender:"m"},value:{label:"ערך",gender:"m"}},I={string:{unit:"תווים",shortLabel:"קצר",longLabel:"ארוך"},file:{unit:"בייטים",shortLabel:"קטן",longLabel:"גדול"},array:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},set:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},number:{unit:"",shortLabel:"קטן",longLabel:"גדול"}},U=(X)=>X?$[X]:void 0,D=(X)=>{let G=U(X);if(G)return G.label;return X??$.unknown.label},b=(X)=>`ה${D(X)}`,w=(X)=>{return(U(X)?.gender??"m")==="f"?"צריכה להיות":"צריך להיות"},A=(X)=>{if(!X)return null;return I[X]??null},N=(X)=>{let G=typeof X;switch(G){case"number":return Number.isNaN(X)?"NaN":"number";case"object":{if(Array.isArray(X))return"array";if(X===null)return"null";if(Object.getPrototypeOf(X)!==Object.prototype&&X.constructor)return X.constructor.name;return"object"}default:return G}},O={regex:{label:"קלט",gender:"m"},email:{label:"כתובת אימייל",gender:"f"},url:{label:"כתובת רשת",gender:"f"},emoji:{label:"אימוג'י",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"תאריך וזמן ISO",gender:"m"},date:{label:"תאריך ISO",gender:"m"},time:{label:"זמן ISO",gender:"m"},duration:{label:"משך זמן ISO",gender:"m"},ipv4:{label:"כתובת IPv4",gender:"f"},ipv6:{label:"כתובת IPv6",gender:"f"},cidrv4:{label:"טווח IPv4",gender:"m"},cidrv6:{label:"טווח IPv6",gender:"m"},base64:{label:"מחרוזת בבסיס 64",gender:"f"},base64url:{label:"מחרוזת בבסיס 64 לכתובות רשת",gender:"f"},json_string:{label:"מחרוזת JSON",gender:"f"},e164:{label:"מספר E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"קלט",gender:"m"},includes:{label:"קלט",gender:"m"},lowercase:{label:"קלט",gender:"m"},starts_with:{label:"קלט",gender:"m"},uppercase:{label:"קלט",gender:"m"}};return(X)=>{switch(X.code){case"invalid_type":{let G=X.expected,Q=D(G),Y=N(X.input),B=$[Y]?.label??Y;return`קלט לא תקין: צריך להיות ${Q}, התקבל ${B}`}case"invalid_value":{if(X.values.length===1)return`ערך לא תקין: הערך חייב להיות ${q(X.values[0])}`;let G=X.values.map((B)=>q(B));if(X.values.length===2)return`ערך לא תקין: האפשרויות המתאימות הן ${G[0]} או ${G[1]}`;let Q=G[G.length-1];return`ערך לא תקין: האפשרויות המתאימות הן ${G.slice(0,-1).join(", ")} או ${Q}`}case"too_big":{let G=A(X.origin),Q=b(X.origin??"value");if(X.origin==="string")return`${G?.longLabel??"ארוך"} מדי: ${Q} צריכה להכיל ${X.maximum.toString()} ${G?.unit??""} ${X.inclusive?"או פחות":"לכל היותר"}`.trim();if(X.origin==="number"){let J=X.inclusive?`קטן או שווה ל-${X.maximum}`:`קטן מ-${X.maximum}`;return`גדול מדי: ${Q} צריך להיות ${J}`}if(X.origin==="array"||X.origin==="set"){let J=X.origin==="set"?"צריכה":"צריך",L=X.inclusive?`${X.maximum} ${G?.unit??""} או פחות`:`פחות מ-${X.maximum} ${G?.unit??""}`;return`גדול מדי: ${Q} ${J} להכיל ${L}`.trim()}let Y=X.inclusive?"<=":"<",B=w(X.origin??"value");if(G?.unit)return`${G.longLabel} מדי: ${Q} ${B} ${Y}${X.maximum.toString()} ${G.unit}`;return`${G?.longLabel??"גדול"} מדי: ${Q} ${B} ${Y}${X.maximum.toString()}`}case"too_small":{let G=A(X.origin),Q=b(X.origin??"value");if(X.origin==="string")return`${G?.shortLabel??"קצר"} מדי: ${Q} צריכה להכיל ${X.minimum.toString()} ${G?.unit??""} ${X.inclusive?"או יותר":"לפחות"}`.trim();if(X.origin==="number"){let J=X.inclusive?`גדול או שווה ל-${X.minimum}`:`גדול מ-${X.minimum}`;return`קטן מדי: ${Q} צריך להיות ${J}`}if(X.origin==="array"||X.origin==="set"){let J=X.origin==="set"?"צריכה":"צריך";if(X.minimum===1&&X.inclusive){let K=X.origin==="set"?"לפחות פריט אחד":"לפחות פריט אחד";return`קטן מדי: ${Q} ${J} להכיל ${K}`}let L=X.inclusive?`${X.minimum} ${G?.unit??""} או יותר`:`יותר מ-${X.minimum} ${G?.unit??""}`;return`קטן מדי: ${Q} ${J} להכיל ${L}`.trim()}let Y=X.inclusive?">=":">",B=w(X.origin??"value");if(G?.unit)return`${G.shortLabel} מדי: ${Q} ${B} ${Y}${X.minimum.toString()} ${G.unit}`;return`${G?.shortLabel??"קטן"} מדי: ${Q} ${B} ${Y}${X.minimum.toString()}`}case"invalid_format":{let G=X;if(G.format==="starts_with")return`המחרוזת חייבת להתחיל ב "${G.prefix}"`;if(G.format==="ends_with")return`המחרוזת חייבת להסתיים ב "${G.suffix}"`;if(G.format==="includes")return`המחרוזת חייבת לכלול "${G.includes}"`;if(G.format==="regex")return`המחרוזת חייבת להתאים לתבנית ${G.pattern}`;let Q=O[G.format],Y=Q?.label??G.format,J=(Q?.gender??"m")==="f"?"תקינה":"תקין";return`${Y} לא ${J}`}case"not_multiple_of":return`מספר לא תקין: חייב להיות מכפלה של ${X.divisor}`;case"unrecognized_keys":return`מפתח${X.keys.length>1?"ות":""} לא מזוה${X.keys.length>1?"ים":"ה"}: ${z(X.keys,", ")}`;case"invalid_key":return"שדה לא תקין באובייקט";case"invalid_union":return"קלט לא תקין";case"invalid_element":return`ערך לא תקין ב${b(X.origin??"array")}`;default:return"קלט לא תקין"}}};function YX(){return{localeError:AK()}}var NK=()=>{let $={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function I(b){return $[b]??null}let U=(b)=>{let w=typeof b;switch(w){case"number":return Number.isNaN(b)?"NaN":"szám";case"object":{if(Array.isArray(b))return"tömb";if(b===null)return"null";if(Object.getPrototypeOf(b)!==Object.prototype&&b.constructor)return b.constructor.name}}return w},D={regex:"bemenet",email:"email cím",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 időbélyeg",date:"ISO dátum",time:"ISO idő",duration:"ISO időintervallum",ipv4:"IPv4 cím",ipv6:"IPv6 cím",cidrv4:"IPv4 tartomány",cidrv6:"IPv6 tartomány",base64:"base64-kódolt string",base64url:"base64url-kódolt string",json_string:"JSON string",e164:"E.164 szám",jwt:"JWT",template_literal:"bemenet"};return(b)=>{switch(b.code){case"invalid_type":return`Érvénytelen bemenet: a várt érték ${b.expected}, a kapott érték ${U(b.input)}`;case"invalid_value":if(b.values.length===1)return`Érvénytelen bemenet: a várt érték ${q(b.values[0])}`;return`Érvénytelen opció: valamelyik érték várt ${z(b.values,"|")}`;case"too_big":{let w=b.inclusive?"<=":"<",A=I(b.origin);if(A)return`Túl nagy: ${b.origin??"érték"} mérete túl nagy ${w}${b.maximum.toString()} ${A.unit??"elem"}`;return`Túl nagy: a bemeneti érték ${b.origin??"érték"} túl nagy: ${w}${b.maximum.toString()}`}case"too_small":{let w=b.inclusive?">=":">",A=I(b.origin);if(A)return`Túl kicsi: a bemeneti érték ${b.origin} mérete túl kicsi ${w}${b.minimum.toString()} ${A.unit}`;return`Túl kicsi: a bemeneti érték ${b.origin} túl kicsi ${w}${b.minimum.toString()}`}case"invalid_format":{let w=b;if(w.format==="starts_with")return`Érvénytelen string: "${w.prefix}" értékkel kell kezdődnie`;if(w.format==="ends_with")return`Érvénytelen string: "${w.suffix}" értékkel kell végződnie`;if(w.format==="includes")return`Érvénytelen string: "${w.includes}" értéket kell tartalmaznia`;if(w.format==="regex")return`Érvénytelen string: ${w.pattern} mintának kell megfelelnie`;return`Érvénytelen ${D[w.format]??b.format}`}case"not_multiple_of":return`Érvénytelen szám: ${b.divisor} többszörösének kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${b.keys.length>1?"s":""}: ${z(b.keys,", ")}`;case"invalid_key":return`Érvénytelen kulcs ${b.origin}`;case"invalid_union":return"Érvénytelen bemenet";case"invalid_element":return`Érvénytelen érték: ${b.origin}`;default:return"Érvénytelen bemenet"}}};function BX(){return{localeError:NK()}}var OK=()=>{let $={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function I(b){return $[b]??null}let U=(b)=>{let w=typeof b;switch(w){case"number":return Number.isNaN(b)?"NaN":"number";case"object":{if(Array.isArray(b))return"array";if(b===null)return"null";if(Object.getPrototypeOf(b)!==Object.prototype&&b.constructor)return b.constructor.name}}return w},D={regex:"input",email:"alamat email",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:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"};return(b)=>{switch(b.code){case"invalid_type":return`Input tidak valid: diharapkan ${b.expected}, diterima ${U(b.input)}`;case"invalid_value":if(b.values.length===1)return`Input tidak valid: diharapkan ${q(b.values[0])}`;return`Pilihan tidak valid: diharapkan salah satu dari ${z(b.values,"|")}`;case"too_big":{let w=b.inclusive?"<=":"<",A=I(b.origin);if(A)return`Terlalu besar: diharapkan ${b.origin??"value"} memiliki ${w}${b.maximum.toString()} ${A.unit??"elemen"}`;return`Terlalu besar: diharapkan ${b.origin??"value"} menjadi ${w}${b.maximum.toString()}`}case"too_small":{let w=b.inclusive?">=":">",A=I(b.origin);if(A)return`Terlalu kecil: diharapkan ${b.origin} memiliki ${w}${b.minimum.toString()} ${A.unit}`;return`Terlalu kecil: diharapkan ${b.origin} menjadi ${w}${b.minimum.toString()}`}case"invalid_format":{let w=b;if(w.format==="starts_with")return`String tidak valid: harus dimulai dengan "${w.prefix}"`;if(w.format==="ends_with")return`String tidak valid: harus berakhir dengan "${w.suffix}"`;if(w.format==="includes")return`String tidak valid: harus menyertakan "${w.includes}"`;if(w.format==="regex")return`String tidak valid: harus sesuai pola ${w.pattern}`;return`${D[w.format]??b.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${b.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${b.keys.length>1?"s":""}: ${z(b.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${b.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${b.origin}`;default:return"Input tidak valid"}}};function vX(){return{localeError:OK()}}var XK=($)=>{let I=typeof $;switch(I){case"number":return Number.isNaN($)?"NaN":"númer";case"object":{if(Array.isArray($))return"fylki";if($===null)return"null";if(Object.getPrototypeOf($)!==Object.prototype&&$.constructor)return $.constructor.name}}return I},WK=()=>{let $={string:{unit:"stafi",verb:"að hafa"},file:{unit:"bæti",verb:"að hafa"},array:{unit:"hluti",verb:"að hafa"},set:{unit:"hluti",verb:"að hafa"}};function I(D){return $[D]??null}let U={regex:"gildi",email:"netfang",url:"vefslóð",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og tími",date:"ISO dagsetning",time:"ISO tími",duration:"ISO tímalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 tölugildi",jwt:"JWT",template_literal:"gildi"};return(D)=>{switch(D.code){case"invalid_type":return`Rangt gildi: Þú slóst inn ${XK(D.input)} þar sem á að vera ${D.expected}`;case"invalid_value":if(D.values.length===1)return`Rangt gildi: gert ráð fyrir ${q(D.values[0])}`;return`Ógilt val: má vera eitt af eftirfarandi ${z(D.values,"|")}`;case"too_big":{let b=D.inclusive?"<=":"<",w=I(D.origin);if(w)return`Of stórt: gert er ráð fyrir að ${D.origin??"gildi"} hafi ${b}${D.maximum.toString()} ${w.unit??"hluti"}`;return`Of stórt: gert er ráð fyrir að ${D.origin??"gildi"} sé ${b}${D.maximum.toString()}`}case"too_small":{let b=D.inclusive?">=":">",w=I(D.origin);if(w)return`Of lítið: gert er ráð fyrir að ${D.origin} hafi ${b}${D.minimum.toString()} ${w.unit}`;return`Of lítið: gert er ráð fyrir að ${D.origin} sé ${b}${D.minimum.toString()}`}case"invalid_format":{let b=D;if(b.format==="starts_with")return`Ógildur strengur: verður að byrja á "${b.prefix}"`;if(b.format==="ends_with")return`Ógildur strengur: verður að enda á "${b.suffix}"`;if(b.format==="includes")return`Ógildur strengur: verður að innihalda "${b.includes}"`;if(b.format==="regex")return`Ógildur strengur: verður að fylgja mynstri ${b.pattern}`;return`Rangt ${U[b.format]??D.format}`}case"not_multiple_of":return`Röng tala: verður að vera margfeldi af ${D.divisor}`;case"unrecognized_keys":return`Óþekkt ${D.keys.length>1?"ir lyklar":"ur lykill"}: ${z(D.keys,", ")}`;case"invalid_key":return`Rangur lykill í ${D.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi í ${D.origin}`;default:return"Rangt gildi"}}};function JX(){return{localeError:WK()}}var GK=()=>{let $={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function I(b){return $[b]??null}let U=(b)=>{let w=typeof b;switch(w){case"number":return Number.isNaN(b)?"NaN":"numero";case"object":{if(Array.isArray(b))return"vettore";if(b===null)return"null";if(Object.getPrototypeOf(b)!==Object.prototype&&b.constructor)return b.constructor.name}}return w},D={regex:"input",email:"indirizzo email",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:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"};return(b)=>{switch(b.code){case"invalid_type":return`Input non valido: atteso ${b.expected}, ricevuto ${U(b.input)}`;case"invalid_value":if(b.values.length===1)return`Input non valido: atteso ${q(b.values[0])}`;return`Opzione non valida: atteso uno tra ${z(b.values,"|")}`;case"too_big":{let w=b.inclusive?"<=":"<",A=I(b.origin);if(A)return`Troppo grande: ${b.origin??"valore"} deve avere ${w}${b.maximum.toString()} ${A.unit??"elementi"}`;return`Troppo grande: ${b.origin??"valore"} deve essere ${w}${b.maximum.toString()}`}case"too_small":{let w=b.inclusive?">=":">",A=I(b.origin);if(A)return`Troppo piccolo: ${b.origin} deve avere ${w}${b.minimum.toString()} ${A.unit}`;return`Troppo piccolo: ${b.origin} deve essere ${w}${b.minimum.toString()}`}case"invalid_format":{let w=b;if(w.format==="starts_with")return`Stringa non valida: deve iniziare con "${w.prefix}"`;if(w.format==="ends_with")return`Stringa non valida: deve terminare con "${w.suffix}"`;if(w.format==="includes")return`Stringa non valida: deve includere "${w.includes}"`;if(w.format==="regex")return`Stringa non valida: deve corrispondere al pattern ${w.pattern}`;return`Invalid ${D[w.format]??b.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${b.divisor}`;case"unrecognized_keys":return`Chiav${b.keys.length>1?"i":"e"} non riconosciut${b.keys.length>1?"e":"a"}: ${z(b.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${b.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${b.origin}`;default:return"Input non valido"}}};function HX(){return{localeError:GK()}}var QK=()=>{let $={string:{unit:"文字",verb:"である"},file:{unit:"バイト",verb:"である"},array:{unit:"要素",verb:"である"},set:{unit:"要素",verb:"である"}};function I(b){return $[b]??null}let U=(b)=>{let w=typeof b;switch(w){case"number":return Number.isNaN(b)?"NaN":"数値";case"object":{if(Array.isArray(b))return"配列";if(b===null)return"null";if(Object.getPrototypeOf(b)!==Object.prototype&&b.constructor)return b.constructor.name}}return w},D={regex:"入力値",email:"メールアドレス",url:"URL",emoji:"絵文字",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日時",date:"ISO日付",time:"ISO時刻",duration:"ISO期間",ipv4:"IPv4アドレス",ipv6:"IPv6アドレス",cidrv4:"IPv4範囲",cidrv6:"IPv6範囲",base64:"base64エンコード文字列",base64url:"base64urlエンコード文字列",json_string:"JSON文字列",e164:"E.164番号",jwt:"JWT",template_literal:"入力値"};return(b)=>{switch(b.code){case"invalid_type":return`無効な入力: ${b.expected}が期待されましたが、${U(b.input)}が入力されました`;case"invalid_value":if(b.values.length===1)return`無効な入力: ${q(b.values[0])}が期待されました`;return`無効な選択: ${z(b.values,"、")}のいずれかである必要があります`;case"too_big":{let w=b.inclusive?"以下である":"より小さい",A=I(b.origin);if(A)return`大きすぎる値: ${b.origin??"値"}は${b.maximum.toString()}${A.unit??"要素"}${w}必要があります`;return`大きすぎる値: ${b.origin??"値"}は${b.maximum.toString()}${w}必要があります`}case"too_small":{let w=b.inclusive?"以上である":"より大きい",A=I(b.origin);if(A)return`小さすぎる値: ${b.origin}は${b.minimum.toString()}${A.unit}${w}必要があります`;return`小さすぎる値: ${b.origin}は${b.minimum.toString()}${w}必要があります`}case"invalid_format":{let w=b;if(w.format==="starts_with")return`無効な文字列: "${w.prefix}"で始まる必要があります`;if(w.format==="ends_with")return`無効な文字列: "${w.suffix}"で終わる必要があります`;if(w.format==="includes")return`無効な文字列: "${w.includes}"を含む必要があります`;if(w.format==="regex")return`無効な文字列: パターン${w.pattern}に一致する必要があります`;return`無効な${D[w.format]??b.format}`}case"not_multiple_of":return`無効な数値: ${b.divisor}の倍数である必要があります`;case"unrecognized_keys":return`認識されていないキー${b.keys.length>1?"群":""}: ${z(b.keys,"、")}`;case"invalid_key":return`${b.origin}内の無効なキー`;case"invalid_union":return"無効な入力";case"invalid_element":return`${b.origin}内の無効な値`;default:return"無効な入力"}}};function LX(){return{localeError:QK()}}var YK=($)=>{let I=typeof $;switch(I){case"number":return Number.isNaN($)?"NaN":"რიცხვი";case"object":{if(Array.isArray($))return"მასივი";if($===null)return"null";if(Object.getPrototypeOf($)!==Object.prototype&&$.constructor)return $.constructor.name}}return{string:"სტრინგი",boolean:"ბულეანი",undefined:"undefined",bigint:"bigint",symbol:"symbol",function:"ფუნქცია"}[I]??I},BK=()=>{let $={string:{unit:"სიმბოლო",verb:"უნდა შეიცავდეს"},file:{unit:"ბაიტი",verb:"უნდა შეიცავდეს"},array:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"},set:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"}};function I(D){return $[D]??null}let U={regex:"შეყვანა",email:"ელ-ფოსტის მისამართი",url:"URL",emoji:"ემოჯი",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"თარიღი-დრო",date:"თარიღი",time:"დრო",duration:"ხანგრძლივობა",ipv4:"IPv4 მისამართი",ipv6:"IPv6 მისამართი",cidrv4:"IPv4 დიაპაზონი",cidrv6:"IPv6 დიაპაზონი",base64:"base64-კოდირებული სტრინგი",base64url:"base64url-კოდირებული სტრინგი",json_string:"JSON სტრინგი",e164:"E.164 ნომერი",jwt:"JWT",template_literal:"შეყვანა"};return(D)=>{switch(D.code){case"invalid_type":return`არასწორი შეყვანა: მოსალოდნელი ${D.expected}, მიღებული ${YK(D.input)}`;case"invalid_value":if(D.values.length===1)return`არასწორი შეყვანა: მოსალოდნელი ${q(D.values[0])}`;return`არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${z(D.values,"|")}-დან`;case"too_big":{let b=D.inclusive?"<=":"<",w=I(D.origin);if(w)return`ზედმეტად დიდი: მოსალოდნელი ${D.origin??"მნიშვნელობა"} ${w.verb} ${b}${D.maximum.toString()} ${w.unit}`;return`ზედმეტად დიდი: მოსალოდნელი ${D.origin??"მნიშვნელობა"} იყოს ${b}${D.maximum.toString()}`}case"too_small":{let b=D.inclusive?">=":">",w=I(D.origin);if(w)return`ზედმეტად პატარა: მოსალოდნელი ${D.origin} ${w.verb} ${b}${D.minimum.toString()} ${w.unit}`;return`ზედმეტად პატარა: მოსალოდნელი ${D.origin} იყოს ${b}${D.minimum.toString()}`}case"invalid_format":{let b=D;if(b.format==="starts_with")return`არასწორი სტრინგი: უნდა იწყებოდეს "${b.prefix}"-ით`;if(b.format==="ends_with")return`არასწორი სტრინგი: უნდა მთავრდებოდეს "${b.suffix}"-ით`;if(b.format==="includes")return`არასწორი სტრინგი: უნდა შეიცავდეს "${b.includes}"-ს`;if(b.format==="regex")return`არასწორი სტრინგი: უნდა შეესაბამებოდეს შაბლონს ${b.pattern}`;return`არასწორი ${U[b.format]??D.format}`}case"not_multiple_of":return`არასწორი რიცხვი: უნდა იყოს ${D.divisor}-ის ჯერადი`;case"unrecognized_keys":return`უცნობი გასაღებ${D.keys.length>1?"ები":"ი"}: ${z(D.keys,", ")}`;case"invalid_key":return`არასწორი გასაღები ${D.origin}-ში`;case"invalid_union":return"არასწორი შეყვანა";case"invalid_element":return`არასწორი მნიშვნელობა ${D.origin}-ში`;default:return"არასწორი შეყვანა"}}};function zX(){return{localeError:BK()}}var vK=()=>{let $={string:{unit:"តួអក្សរ",verb:"គួរមាន"},file:{unit:"បៃ",verb:"គួរមាន"},array:{unit:"ធាតុ",verb:"គួរមាន"},set:{unit:"ធាតុ",verb:"គួរមាន"}};function I(b){return $[b]??null}let U=(b)=>{let w=typeof b;switch(w){case"number":return Number.isNaN(b)?"មិនមែនជាលេខ (NaN)":"លេខ";case"object":{if(Array.isArray(b))return"អារេ (Array)";if(b===null)return"គ្មានតម្លៃ (null)";if(Object.getPrototypeOf(b)!==Object.prototype&&b.constructor)return b.constructor.name}}return w},D={regex:"ទិន្នន័យបញ្ចូល",email:"អាសយដ្ឋានអ៊ីមែល",url:"URL",emoji:"សញ្ញាអារម្មណ៍",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"កាលបរិច្ឆេទ និងម៉ោង ISO",date:"កាលបរិច្ឆេទ ISO",time:"ម៉ោង ISO",duration:"រយៈពេល ISO",ipv4:"អាសយដ្ឋាន IPv4",ipv6:"អាសយដ្ឋាន IPv6",cidrv4:"ដែនអាសយដ្ឋាន IPv4",cidrv6:"ដែនអាសយដ្ឋាន IPv6",base64:"ខ្សែអក្សរអ៊ិកូដ base64",base64url:"ខ្សែអក្សរអ៊ិកូដ base64url",json_string:"ខ្សែអក្សរ JSON",e164:"លេខ E.164",jwt:"JWT",template_literal:"ទិន្នន័យបញ្ចូល"};return(b)=>{switch(b.code){case"invalid_type":return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${b.expected} ប៉ុន្តែទទួលបាន ${U(b.input)}`;case"invalid_value":if(b.values.length===1)return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${q(b.values[0])}`;return`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${z(b.values,"|")}`;case"too_big":{let w=b.inclusive?"<=":"<",A=I(b.origin);if(A)return`ធំពេក៖ ត្រូវការ ${b.origin??"តម្លៃ"} ${w} ${b.maximum.toString()} ${A.unit??"ធាតុ"}`;return`ធំពេក៖ ត្រូវការ ${b.origin??"តម្លៃ"} ${w} ${b.maximum.toString()}`}case"too_small":{let w=b.inclusive?">=":">",A=I(b.origin);if(A)return`តូចពេក៖ ត្រូវការ ${b.origin} ${w} ${b.minimum.toString()} ${A.unit}`;return`តូចពេក៖ ត្រូវការ ${b.origin} ${w} ${b.minimum.toString()}`}case"invalid_format":{let w=b;if(w.format==="starts_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${w.prefix}"`;if(w.format==="ends_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${w.suffix}"`;if(w.format==="includes")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${w.includes}"`;if(w.format==="regex")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${w.pattern}`;return`មិនត្រឹមត្រូវ៖ ${D[w.format]??b.format}`}case"not_multiple_of":return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${b.divisor}`;case"unrecognized_keys":return`រកឃើញសោមិនស្គាល់៖ ${z(b.keys,", ")}`;case"invalid_key":return`សោមិនត្រឹមត្រូវនៅក្នុង ${b.origin}`;case"invalid_union":return"ទិន្នន័យមិនត្រឹមត្រូវ";case"invalid_element":return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${b.origin}`;default:return"ទិន្នន័យមិនត្រឹមត្រូវ"}}};function o1(){return{localeError:vK()}}function VX(){return o1()}var JK=()=>{let $={string:{unit:"문자",verb:"to have"},file:{unit:"바이트",verb:"to have"},array:{unit:"개",verb:"to have"},set:{unit:"개",verb:"to have"}};function I(b){return $[b]??null}let U=(b)=>{let w=typeof b;switch(w){case"number":return Number.isNaN(b)?"NaN":"number";case"object":{if(Array.isArray(b))return"array";if(b===null)return"null";if(Object.getPrototypeOf(b)!==Object.prototype&&b.constructor)return b.constructor.name}}return w},D={regex:"입력",email:"이메일 주소",url:"URL",emoji:"이모지",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 날짜시간",date:"ISO 날짜",time:"ISO 시간",duration:"ISO 기간",ipv4:"IPv4 주소",ipv6:"IPv6 주소",cidrv4:"IPv4 범위",cidrv6:"IPv6 범위",base64:"base64 인코딩 문자열",base64url:"base64url 인코딩 문자열",json_string:"JSON 문자열",e164:"E.164 번호",jwt:"JWT",template_literal:"입력"};return(b)=>{switch(b.code){case"invalid_type":return`잘못된 입력: 예상 타입은 ${b.expected}, 받은 타입은 ${U(b.input)}입니다`;case"invalid_value":if(b.values.length===1)return`잘못된 입력: 값은 ${q(b.values[0])} 이어야 합니다`;return`잘못된 옵션: ${z(b.values,"또는 ")} 중 하나여야 합니다`;case"too_big":{let w=b.inclusive?"이하":"미만",A=w==="미만"?"이어야 합니다":"여야 합니다",N=I(b.origin),O=N?.unit??"요소";if(N)return`${b.origin??"값"}이 너무 큽니다: ${b.maximum.toString()}${O} ${w}${A}`;return`${b.origin??"값"}이 너무 큽니다: ${b.maximum.toString()} ${w}${A}`}case"too_small":{let w=b.inclusive?"이상":"초과",A=w==="이상"?"이어야 합니다":"여야 합니다",N=I(b.origin),O=N?.unit??"요소";if(N)return`${b.origin??"값"}이 너무 작습니다: ${b.minimum.toString()}${O} ${w}${A}`;return`${b.origin??"값"}이 너무 작습니다: ${b.minimum.toString()} ${w}${A}`}case"invalid_format":{let w=b;if(w.format==="starts_with")return`잘못된 문자열: "${w.prefix}"(으)로 시작해야 합니다`;if(w.format==="ends_with")return`잘못된 문자열: "${w.suffix}"(으)로 끝나야 합니다`;if(w.format==="includes")return`잘못된 문자열: "${w.includes}"을(를) 포함해야 합니다`;if(w.format==="regex")return`잘못된 문자열: 정규식 ${w.pattern} 패턴과 일치해야 합니다`;return`잘못된 ${D[w.format]??b.format}`}case"not_multiple_of":return`잘못된 숫자: ${b.divisor}의 배수여야 합니다`;case"unrecognized_keys":return`인식할 수 없는 키: ${z(b.keys,", ")}`;case"invalid_key":return`잘못된 키: ${b.origin}`;case"invalid_union":return"잘못된 입력";case"invalid_element":return`잘못된 값: ${b.origin}`;default:return"잘못된 입력"}}};function MX(){return{localeError:JK()}}var HK=($)=>{return p1(typeof $,$)},p1=($,I=void 0)=>{switch($){case"number":return Number.isNaN(I)?"NaN":"skaičius";case"bigint":return"sveikasis skaičius";case"string":return"eilutė";case"boolean":return"loginė reikšmė";case"undefined":case"void":return"neapibrėžta reikšmė";case"function":return"funkcija";case"symbol":return"simbolis";case"object":{if(I===void 0)return"nežinomas objektas";if(I===null)return"nulinė reikšmė";if(Array.isArray(I))return"masyvas";if(Object.getPrototypeOf(I)!==Object.prototype&&I.constructor)return I.constructor.name;return"objektas"}case"null":return"nulinė reikšmė"}return $},d1=($)=>{return $.charAt(0).toUpperCase()+$.slice(1)};function BB($){let I=Math.abs($),U=I%10,D=I%100;if(D>=11&&D<=19||U===0)return"many";if(U===1)return"one";return"few"}var LK=()=>{let $={string:{unit:{one:"simbolis",few:"simboliai",many:"simbolių"},verb:{smaller:{inclusive:"turi būti ne ilgesnė kaip",notInclusive:"turi būti trumpesnė kaip"},bigger:{inclusive:"turi būti ne trumpesnė kaip",notInclusive:"turi būti ilgesnė kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"baitų"},verb:{smaller:{inclusive:"turi būti ne didesnis kaip",notInclusive:"turi būti mažesnis kaip"},bigger:{inclusive:"turi būti ne mažesnis kaip",notInclusive:"turi būti didesnis kaip"}}},array:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}},set:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}}};function I(D,b,w,A){let N=$[D]??null;if(N===null)return N;return{unit:N.unit[b],verb:N.verb[A][w?"inclusive":"notInclusive"]}}let U={regex:"įvestis",email:"el. pašto adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukmė",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 užkoduota eilutė",base64url:"base64url užkoduota eilutė",json_string:"JSON eilutė",e164:"E.164 numeris",jwt:"JWT",template_literal:"įvestis"};return(D)=>{switch(D.code){case"invalid_type":return`Gautas tipas ${HK(D.input)}, o tikėtasi - ${p1(D.expected)}`;case"invalid_value":if(D.values.length===1)return`Privalo būti ${q(D.values[0])}`;return`Privalo būti vienas iš ${z(D.values,"|")} pasirinkimų`;case"too_big":{let b=p1(D.origin),w=I(D.origin,BB(Number(D.maximum)),D.inclusive??!1,"smaller");if(w?.verb)return`${d1(b??D.origin??"reikšmė")} ${w.verb} ${D.maximum.toString()} ${w.unit??"elementų"}`;let A=D.inclusive?"ne didesnis kaip":"mažesnis kaip";return`${d1(b??D.origin??"reikšmė")} turi būti ${A} ${D.maximum.toString()} ${w?.unit}`}case"too_small":{let b=p1(D.origin),w=I(D.origin,BB(Number(D.minimum)),D.inclusive??!1,"bigger");if(w?.verb)return`${d1(b??D.origin??"reikšmė")} ${w.verb} ${D.minimum.toString()} ${w.unit??"elementų"}`;let A=D.inclusive?"ne mažesnis kaip":"didesnis kaip";return`${d1(b??D.origin??"reikšmė")} turi būti ${A} ${D.minimum.toString()} ${w?.unit}`}case"invalid_format":{let b=D;if(b.format==="starts_with")return`Eilutė privalo prasidėti "${b.prefix}"`;if(b.format==="ends_with")return`Eilutė privalo pasibaigti "${b.suffix}"`;if(b.format==="includes")return`Eilutė privalo įtraukti "${b.includes}"`;if(b.format==="regex")return`Eilutė privalo atitikti ${b.pattern}`;return`Neteisingas ${U[b.format]??D.format}`}case"not_multiple_of":return`Skaičius privalo būti ${D.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpažint${D.keys.length>1?"i":"as"} rakt${D.keys.length>1?"ai":"as"}: ${z(D.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga įvestis";case"invalid_element":{let b=p1(D.origin);return`${d1(b??D.origin??"reikšmė")} turi klaidingą įvestį`}default:return"Klaidinga įvestis"}}};function KX(){return{localeError:LK()}}var zK=()=>{let $={string:{unit:"знаци",verb:"да имаат"},file:{unit:"бајти",verb:"да имаат"},array:{unit:"ставки",verb:"да имаат"},set:{unit:"ставки",verb:"да имаат"}};function I(b){return $[b]??null}let U=(b)=>{let w=typeof b;switch(w){case"number":return Number.isNaN(b)?"NaN":"број";case"object":{if(Array.isArray(b))return"низа";if(b===null)return"null";if(Object.getPrototypeOf(b)!==Object.prototype&&b.constructor)return b.constructor.name}}return w},D={regex:"внес",email:"адреса на е-пошта",url:"URL",emoji:"емоџи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO датум и време",date:"ISO датум",time:"ISO време",duration:"ISO времетраење",ipv4:"IPv4 адреса",ipv6:"IPv6 адреса",cidrv4:"IPv4 опсег",cidrv6:"IPv6 опсег",base64:"base64-енкодирана низа",base64url:"base64url-енкодирана низа",json_string:"JSON низа",e164:"E.164 број",jwt:"JWT",template_literal:"внес"};return(b)=>{switch(b.code){case"invalid_type":return`Грешен внес: се очекува ${b.expected}, примено ${U(b.input)}`;case"invalid_value":if(b.values.length===1)return`Invalid input: expected ${q(b.values[0])}`;return`Грешана опција: се очекува една ${z(b.values,"|")}`;case"too_big":{let w=b.inclusive?"<=":"<",A=I(b.origin);if(A)return`Премногу голем: се очекува ${b.origin??"вредноста"} да има ${w}${b.maximum.toString()} ${A.unit??"елементи"}`;return`Премногу голем: се очекува ${b.origin??"вредноста"} да биде ${w}${b.maximum.toString()}`}case"too_small":{let w=b.inclusive?">=":">",A=I(b.origin);if(A)return`Премногу мал: се очекува ${b.origin} да има ${w}${b.minimum.toString()} ${A.unit}`;return`Премногу мал: се очекува ${b.origin} да биде ${w}${b.minimum.toString()}`}case"invalid_format":{let w=b;if(w.format==="starts_with")return`Неважечка низа: мора да започнува со "${w.prefix}"`;if(w.format==="ends_with")return`Неважечка низа: мора да завршува со "${w.suffix}"`;if(w.format==="includes")return`Неважечка низа: мора да вклучува "${w.includes}"`;if(w.format==="regex")return`Неважечка низа: мора да одгоара на патернот ${w.pattern}`;return`Invalid ${D[w.format]??b.format}`}case"not_multiple_of":return`Грешен број: мора да биде делив со ${b.divisor}`;case"unrecognized_keys":return`${b.keys.length>1?"Непрепознаени клучеви":"Непрепознаен клуч"}: ${z(b.keys,", ")}`;case"invalid_key":return`Грешен клуч во ${b.origin}`;case"invalid_union":return"Грешен внес";case"invalid_element":return`Грешна вредност во ${b.origin}`;default:return"Грешен внес"}}};function FX(){return{localeError:zK()}}var VK=()=>{let $={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function I(b){return $[b]??null}let U=(b)=>{let w=typeof b;switch(w){case"number":return Number.isNaN(b)?"NaN":"nombor";case"object":{if(Array.isArray(b))return"array";if(b===null)return"null";if(Object.getPrototypeOf(b)!==Object.prototype&&b.constructor)return b.constructor.name}}return w},D={regex:"input",email:"alamat e-mel",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:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"};return(b)=>{switch(b.code){case"invalid_type":return`Input tidak sah: dijangka ${b.expected}, diterima ${U(b.input)}`;case"invalid_value":if(b.values.length===1)return`Input tidak sah: dijangka ${q(b.values[0])}`;return`Pilihan tidak sah: dijangka salah satu daripada ${z(b.values,"|")}`;case"too_big":{let w=b.inclusive?"<=":"<",A=I(b.origin);if(A)return`Terlalu besar: dijangka ${b.origin??"nilai"} ${A.verb} ${w}${b.maximum.toString()} ${A.unit??"elemen"}`;return`Terlalu besar: dijangka ${b.origin??"nilai"} adalah ${w}${b.maximum.toString()}`}case"too_small":{let w=b.inclusive?">=":">",A=I(b.origin);if(A)return`Terlalu kecil: dijangka ${b.origin} ${A.verb} ${w}${b.minimum.toString()} ${A.unit}`;return`Terlalu kecil: dijangka ${b.origin} adalah ${w}${b.minimum.toString()}`}case"invalid_format":{let w=b;if(w.format==="starts_with")return`String tidak sah: mesti bermula dengan "${w.prefix}"`;if(w.format==="ends_with")return`String tidak sah: mesti berakhir dengan "${w.suffix}"`;if(w.format==="includes")return`String tidak sah: mesti mengandungi "${w.includes}"`;if(w.format==="regex")return`String tidak sah: mesti sepadan dengan corak ${w.pattern}`;return`${D[w.format]??b.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${b.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${z(b.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${b.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${b.origin}`;default:return"Input tidak sah"}}};function qX(){return{localeError:VK()}}var MK=()=>{let $={string:{unit:"tekens",verb:"te hebben"},file:{unit:"bytes",verb:"te hebben"},array:{unit:"elementen",verb:"te hebben"},set:{unit:"elementen",verb:"te hebben"}};function I(b){return $[b]??null}let U=(b)=>{let w=typeof b;switch(w){case"number":return Number.isNaN(b)?"NaN":"getal";case"object":{if(Array.isArray(b))return"array";if(b===null)return"null";if(Object.getPrototypeOf(b)!==Object.prototype&&b.constructor)return b.constructor.name}}return w},D={regex:"invoer",email:"emailadres",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 datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"};return(b)=>{switch(b.code){case"invalid_type":return`Ongeldige invoer: verwacht ${b.expected}, ontving ${U(b.input)}`;case"invalid_value":if(b.values.length===1)return`Ongeldige invoer: verwacht ${q(b.values[0])}`;return`Ongeldige optie: verwacht één van ${z(b.values,"|")}`;case"too_big":{let w=b.inclusive?"<=":"<",A=I(b.origin);if(A)return`Te groot: verwacht dat ${b.origin??"waarde"} ${A.verb} ${w}${b.maximum.toString()} ${A.unit??"elementen"}`;return`Te groot: verwacht dat ${b.origin??"waarde"} ${w}${b.maximum.toString()} is`}case"too_small":{let w=b.inclusive?">=":">",A=I(b.origin);if(A)return`Te klein: verwacht dat ${b.origin} ${A.verb} ${w}${b.minimum.toString()} ${A.unit}`;return`Te klein: verwacht dat ${b.origin} ${w}${b.minimum.toString()} is`}case"invalid_format":{let w=b;if(w.format==="starts_with")return`Ongeldige tekst: moet met "${w.prefix}" beginnen`;if(w.format==="ends_with")return`Ongeldige tekst: moet op "${w.suffix}" eindigen`;if(w.format==="includes")return`Ongeldige tekst: moet "${w.includes}" bevatten`;if(w.format==="regex")return`Ongeldige tekst: moet overeenkomen met patroon ${w.pattern}`;return`Ongeldig: ${D[w.format]??b.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${b.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${b.keys.length>1?"s":""}: ${z(b.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${b.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${b.origin}`;default:return"Ongeldige invoer"}}};function kX(){return{localeError:MK()}}var KK=()=>{let $={string:{unit:"tegn",verb:"å ha"},file:{unit:"bytes",verb:"å ha"},array:{unit:"elementer",verb:"å inneholde"},set:{unit:"elementer",verb:"å inneholde"}};function I(b){return $[b]??null}let U=(b)=>{let w=typeof b;switch(w){case"number":return Number.isNaN(b)?"NaN":"tall";case"object":{if(Array.isArray(b))return"liste";if(b===null)return"null";if(Object.getPrototypeOf(b)!==Object.prototype&&b.constructor)return b.constructor.name}}return w},D={regex:"input",email:"e-postadresse",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 dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"};return(b)=>{switch(b.code){case"invalid_type":return`Ugyldig input: forventet ${b.expected}, fikk ${U(b.input)}`;case"invalid_value":if(b.values.length===1)return`Ugyldig verdi: forventet ${q(b.values[0])}`;return`Ugyldig valg: forventet en av ${z(b.values,"|")}`;case"too_big":{let w=b.inclusive?"<=":"<",A=I(b.origin);if(A)return`For stor(t): forventet ${b.origin??"value"} til å ha ${w}${b.maximum.toString()} ${A.unit??"elementer"}`;return`For stor(t): forventet ${b.origin??"value"} til å ha ${w}${b.maximum.toString()}`}case"too_small":{let w=b.inclusive?">=":">",A=I(b.origin);if(A)return`For lite(n): forventet ${b.origin} til å ha ${w}${b.minimum.toString()} ${A.unit}`;return`For lite(n): forventet ${b.origin} til å ha ${w}${b.minimum.toString()}`}case"invalid_format":{let w=b;if(w.format==="starts_with")return`Ugyldig streng: må starte med "${w.prefix}"`;if(w.format==="ends_with")return`Ugyldig streng: må ende med "${w.suffix}"`;if(w.format==="includes")return`Ugyldig streng: må inneholde "${w.includes}"`;if(w.format==="regex")return`Ugyldig streng: må matche mønsteret ${w.pattern}`;return`Ugyldig ${D[w.format]??b.format}`}case"not_multiple_of":return`Ugyldig tall: må være et multiplum av ${b.divisor}`;case"unrecognized_keys":return`${b.keys.length>1?"Ukjente nøkler":"Ukjent nøkkel"}: ${z(b.keys,", ")}`;case"invalid_key":return`Ugyldig nøkkel i ${b.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${b.origin}`;default:return"Ugyldig input"}}};function EX(){return{localeError:KK()}}var FK=()=>{let $={string:{unit:"harf",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"unsur",verb:"olmalıdır"},set:{unit:"unsur",verb:"olmalıdır"}};function I(b){return $[b]??null}let U=(b)=>{let w=typeof b;switch(w){case"number":return Number.isNaN(b)?"NaN":"numara";case"object":{if(Array.isArray(b))return"saf";if(b===null)return"gayb";if(Object.getPrototypeOf(b)!==Object.prototype&&b.constructor)return b.constructor.name}}return w},D={regex:"giren",email:"epostagâh",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 hengâmı",date:"ISO tarihi",time:"ISO zamanı",duration:"ISO müddeti",ipv4:"IPv4 nişânı",ipv6:"IPv6 nişânı",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-şifreli metin",base64url:"base64url-şifreli metin",json_string:"JSON metin",e164:"E.164 sayısı",jwt:"JWT",template_literal:"giren"};return(b)=>{switch(b.code){case"invalid_type":return`Fâsit giren: umulan ${b.expected}, alınan ${U(b.input)}`;case"invalid_value":if(b.values.length===1)return`Fâsit giren: umulan ${q(b.values[0])}`;return`Fâsit tercih: mûteberler ${z(b.values,"|")}`;case"too_big":{let w=b.inclusive?"<=":"<",A=I(b.origin);if(A)return`Fazla büyük: ${b.origin??"value"}, ${w}${b.maximum.toString()} ${A.unit??"elements"} sahip olmalıydı.`;return`Fazla büyük: ${b.origin??"value"}, ${w}${b.maximum.toString()} olmalıydı.`}case"too_small":{let w=b.inclusive?">=":">",A=I(b.origin);if(A)return`Fazla küçük: ${b.origin}, ${w}${b.minimum.toString()} ${A.unit} sahip olmalıydı.`;return`Fazla küçük: ${b.origin}, ${w}${b.minimum.toString()} olmalıydı.`}case"invalid_format":{let w=b;if(w.format==="starts_with")return`Fâsit metin: "${w.prefix}" ile başlamalı.`;if(w.format==="ends_with")return`Fâsit metin: "${w.suffix}" ile bitmeli.`;if(w.format==="includes")return`Fâsit metin: "${w.includes}" ihtivâ etmeli.`;if(w.format==="regex")return`Fâsit metin: ${w.pattern} nakşına uymalı.`;return`Fâsit ${D[w.format]??b.format}`}case"not_multiple_of":return`Fâsit sayı: ${b.divisor} katı olmalıydı.`;case"unrecognized_keys":return`Tanınmayan anahtar ${b.keys.length>1?"s":""}: ${z(b.keys,", ")}`;case"invalid_key":return`${b.origin} için tanınmayan anahtar var.`;case"invalid_union":return"Giren tanınamadı.";case"invalid_element":return`${b.origin} için tanınmayan kıymet var.`;default:return"Kıymet tanınamadı."}}};function jX(){return{localeError:FK()}}var qK=()=>{let $={string:{unit:"توکي",verb:"ولري"},file:{unit:"بایټس",verb:"ولري"},array:{unit:"توکي",verb:"ولري"},set:{unit:"توکي",verb:"ولري"}};function I(b){return $[b]??null}let U=(b)=>{let w=typeof b;switch(w){case"number":return Number.isNaN(b)?"NaN":"عدد";case"object":{if(Array.isArray(b))return"ارې";if(b===null)return"null";if(Object.getPrototypeOf(b)!==Object.prototype&&b.constructor)return b.constructor.name}}return w},D={regex:"ورودي",email:"بریښنالیک",url:"یو آر ال",emoji:"ایموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"نیټه او وخت",date:"نېټه",time:"وخت",duration:"موده",ipv4:"د IPv4 پته",ipv6:"د IPv6 پته",cidrv4:"د IPv4 ساحه",cidrv6:"د IPv6 ساحه",base64:"base64-encoded متن",base64url:"base64url-encoded متن",json_string:"JSON متن",e164:"د E.164 شمېره",jwt:"JWT",template_literal:"ورودي"};return(b)=>{switch(b.code){case"invalid_type":return`ناسم ورودي: باید ${b.expected} وای, مګر ${U(b.input)} ترلاسه شو`;case"invalid_value":if(b.values.length===1)return`ناسم ورودي: باید ${q(b.values[0])} وای`;return`ناسم انتخاب: باید یو له ${z(b.values,"|")} څخه وای`;case"too_big":{let w=b.inclusive?"<=":"<",A=I(b.origin);if(A)return`ډیر لوی: ${b.origin??"ارزښت"} باید ${w}${b.maximum.toString()} ${A.unit??"عنصرونه"} ولري`;return`ډیر لوی: ${b.origin??"ارزښت"} باید ${w}${b.maximum.toString()} وي`}case"too_small":{let w=b.inclusive?">=":">",A=I(b.origin);if(A)return`ډیر کوچنی: ${b.origin} باید ${w}${b.minimum.toString()} ${A.unit} ولري`;return`ډیر کوچنی: ${b.origin} باید ${w}${b.minimum.toString()} وي`}case"invalid_format":{let w=b;if(w.format==="starts_with")return`ناسم متن: باید د "${w.prefix}" سره پیل شي`;if(w.format==="ends_with")return`ناسم متن: باید د "${w.suffix}" سره پای ته ورسيږي`;if(w.format==="includes")return`ناسم متن: باید "${w.includes}" ولري`;if(w.format==="regex")return`ناسم متن: باید د ${w.pattern} سره مطابقت ولري`;return`${D[w.format]??b.format} ناسم دی`}case"not_multiple_of":return`ناسم عدد: باید د ${b.divisor} مضرب وي`;case"unrecognized_keys":return`ناسم ${b.keys.length>1?"کلیډونه":"کلیډ"}: ${z(b.keys,", ")}`;case"invalid_key":return`ناسم کلیډ په ${b.origin} کې`;case"invalid_union":return"ناسمه ورودي";case"invalid_element":return`ناسم عنصر په ${b.origin} کې`;default:return"ناسمه ورودي"}}};function SX(){return{localeError:qK()}}var kK=()=>{let $={string:{unit:"znaków",verb:"mieć"},file:{unit:"bajtów",verb:"mieć"},array:{unit:"elementów",verb:"mieć"},set:{unit:"elementów",verb:"mieć"}};function I(b){return $[b]??null}let U=(b)=>{let w=typeof b;switch(w){case"number":return Number.isNaN(b)?"NaN":"liczba";case"object":{if(Array.isArray(b))return"tablica";if(b===null)return"null";if(Object.getPrototypeOf(b)!==Object.prototype&&b.constructor)return b.constructor.name}}return w},D={regex:"wyrażenie",email:"adres email",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:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ciąg znaków zakodowany w formacie base64",base64url:"ciąg znaków zakodowany w formacie base64url",json_string:"ciąg znaków w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wejście"};return(b)=>{switch(b.code){case"invalid_type":return`Nieprawidłowe dane wejściowe: oczekiwano ${b.expected}, otrzymano ${U(b.input)}`;case"invalid_value":if(b.values.length===1)return`Nieprawidłowe dane wejściowe: oczekiwano ${q(b.values[0])}`;return`Nieprawidłowa opcja: oczekiwano jednej z wartości ${z(b.values,"|")}`;case"too_big":{let w=b.inclusive?"<=":"<",A=I(b.origin);if(A)return`Za duża wartość: oczekiwano, że ${b.origin??"wartość"} będzie mieć ${w}${b.maximum.toString()} ${A.unit??"elementów"}`;return`Zbyt duż(y/a/e): oczekiwano, że ${b.origin??"wartość"} będzie wynosić ${w}${b.maximum.toString()}`}case"too_small":{let w=b.inclusive?">=":">",A=I(b.origin);if(A)return`Za mała wartość: oczekiwano, że ${b.origin??"wartość"} będzie mieć ${w}${b.minimum.toString()} ${A.unit??"elementów"}`;return`Zbyt mał(y/a/e): oczekiwano, że ${b.origin??"wartość"} będzie wynosić ${w}${b.minimum.toString()}`}case"invalid_format":{let w=b;if(w.format==="starts_with")return`Nieprawidłowy ciąg znaków: musi zaczynać się od "${w.prefix}"`;if(w.format==="ends_with")return`Nieprawidłowy ciąg znaków: musi kończyć się na "${w.suffix}"`;if(w.format==="includes")return`Nieprawidłowy ciąg znaków: musi zawierać "${w.includes}"`;if(w.format==="regex")return`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${w.pattern}`;return`Nieprawidłow(y/a/e) ${D[w.format]??b.format}`}case"not_multiple_of":return`Nieprawidłowa liczba: musi być wielokrotnością ${b.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${b.keys.length>1?"s":""}: ${z(b.keys,", ")}`;case"invalid_key":return`Nieprawidłowy klucz w ${b.origin}`;case"invalid_union":return"Nieprawidłowe dane wejściowe";case"invalid_element":return`Nieprawidłowa wartość w ${b.origin}`;default:return"Nieprawidłowe dane wejściowe"}}};function PX(){return{localeError:kK()}}var EK=()=>{let $={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function I(b){return $[b]??null}let U=(b)=>{let w=typeof b;switch(w){case"number":return Number.isNaN(b)?"NaN":"número";case"object":{if(Array.isArray(b))return"array";if(b===null)return"nulo";if(Object.getPrototypeOf(b)!==Object.prototype&&b.constructor)return b.constructor.name}}return w},D={regex:"padrão",email:"endereço de e-mail",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:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"duração ISO",ipv4:"endereço IPv4",ipv6:"endereço IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"};return(b)=>{switch(b.code){case"invalid_type":return`Tipo inválido: esperado ${b.expected}, recebido ${U(b.input)}`;case"invalid_value":if(b.values.length===1)return`Entrada inválida: esperado ${q(b.values[0])}`;return`Opção inválida: esperada uma das ${z(b.values,"|")}`;case"too_big":{let w=b.inclusive?"<=":"<",A=I(b.origin);if(A)return`Muito grande: esperado que ${b.origin??"valor"} tivesse ${w}${b.maximum.toString()} ${A.unit??"elementos"}`;return`Muito grande: esperado que ${b.origin??"valor"} fosse ${w}${b.maximum.toString()}`}case"too_small":{let w=b.inclusive?">=":">",A=I(b.origin);if(A)return`Muito pequeno: esperado que ${b.origin} tivesse ${w}${b.minimum.toString()} ${A.unit}`;return`Muito pequeno: esperado que ${b.origin} fosse ${w}${b.minimum.toString()}`}case"invalid_format":{let w=b;if(w.format==="starts_with")return`Texto inválido: deve começar com "${w.prefix}"`;if(w.format==="ends_with")return`Texto inválido: deve terminar com "${w.suffix}"`;if(w.format==="includes")return`Texto inválido: deve incluir "${w.includes}"`;if(w.format==="regex")return`Texto inválido: deve corresponder ao padrão ${w.pattern}`;return`${D[w.format]??b.format} inválido`}case"not_multiple_of":return`Número inválido: deve ser múltiplo de ${b.divisor}`;case"unrecognized_keys":return`Chave${b.keys.length>1?"s":""} desconhecida${b.keys.length>1?"s":""}: ${z(b.keys,", ")}`;case"invalid_key":return`Chave inválida em ${b.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido em ${b.origin}`;default:return"Campo inválido"}}};function RX(){return{localeError:EK()}}function vB($,I,U,D){let b=Math.abs($),w=b%10,A=b%100;if(A>=11&&A<=19)return D;if(w===1)return I;if(w>=2&&w<=4)return U;return D}var jK=()=>{let $={string:{unit:{one:"символ",few:"символа",many:"символов"},verb:"иметь"},file:{unit:{one:"байт",few:"байта",many:"байт"},verb:"иметь"},array:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"},set:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"}};function I(b){return $[b]??null}let U=(b)=>{let w=typeof b;switch(w){case"number":return Number.isNaN(b)?"NaN":"число";case"object":{if(Array.isArray(b))return"массив";if(b===null)return"null";if(Object.getPrototypeOf(b)!==Object.prototype&&b.constructor)return b.constructor.name}}return w},D={regex:"ввод",email:"email адрес",url:"URL",emoji:"эмодзи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата и время",date:"ISO дата",time:"ISO время",duration:"ISO длительность",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"строка в формате base64",base64url:"строка в формате base64url",json_string:"JSON строка",e164:"номер E.164",jwt:"JWT",template_literal:"ввод"};return(b)=>{switch(b.code){case"invalid_type":return`Неверный ввод: ожидалось ${b.expected}, получено ${U(b.input)}`;case"invalid_value":if(b.values.length===1)return`Неверный ввод: ожидалось ${q(b.values[0])}`;return`Неверный вариант: ожидалось одно из ${z(b.values,"|")}`;case"too_big":{let w=b.inclusive?"<=":"<",A=I(b.origin);if(A){let N=Number(b.maximum),O=vB(N,A.unit.one,A.unit.few,A.unit.many);return`Слишком большое значение: ожидалось, что ${b.origin??"значение"} будет иметь ${w}${b.maximum.toString()} ${O}`}return`Слишком большое значение: ожидалось, что ${b.origin??"значение"} будет ${w}${b.maximum.toString()}`}case"too_small":{let w=b.inclusive?">=":">",A=I(b.origin);if(A){let N=Number(b.minimum),O=vB(N,A.unit.one,A.unit.few,A.unit.many);return`Слишком маленькое значение: ожидалось, что ${b.origin} будет иметь ${w}${b.minimum.toString()} ${O}`}return`Слишком маленькое значение: ожидалось, что ${b.origin} будет ${w}${b.minimum.toString()}`}case"invalid_format":{let w=b;if(w.format==="starts_with")return`Неверная строка: должна начинаться с "${w.prefix}"`;if(w.format==="ends_with")return`Неверная строка: должна заканчиваться на "${w.suffix}"`;if(w.format==="includes")return`Неверная строка: должна содержать "${w.includes}"`;if(w.format==="regex")return`Неверная строка: должна соответствовать шаблону ${w.pattern}`;return`Неверный ${D[w.format]??b.format}`}case"not_multiple_of":return`Неверное число: должно быть кратным ${b.divisor}`;case"unrecognized_keys":return`Нераспознанн${b.keys.length>1?"ые":"ый"} ключ${b.keys.length>1?"и":""}: ${z(b.keys,", ")}`;case"invalid_key":return`Неверный ключ в ${b.origin}`;case"invalid_union":return"Неверные входные данные";case"invalid_element":return`Неверное значение в ${b.origin}`;default:return"Неверные входные данные"}}};function TX(){return{localeError:jK()}}var SK=()=>{let $={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function I(b){return $[b]??null}let U=(b)=>{let w=typeof b;switch(w){case"number":return Number.isNaN(b)?"NaN":"število";case"object":{if(Array.isArray(b))return"tabela";if(b===null)return"null";if(Object.getPrototypeOf(b)!==Object.prototype&&b.constructor)return b.constructor.name}}return w},D={regex:"vnos",email:"e-poštni naslov",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 datum in čas",date:"ISO datum",time:"ISO čas",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 številka",jwt:"JWT",template_literal:"vnos"};return(b)=>{switch(b.code){case"invalid_type":return`Neveljaven vnos: pričakovano ${b.expected}, prejeto ${U(b.input)}`;case"invalid_value":if(b.values.length===1)return`Neveljaven vnos: pričakovano ${q(b.values[0])}`;return`Neveljavna možnost: pričakovano eno izmed ${z(b.values,"|")}`;case"too_big":{let w=b.inclusive?"<=":"<",A=I(b.origin);if(A)return`Preveliko: pričakovano, da bo ${b.origin??"vrednost"} imelo ${w}${b.maximum.toString()} ${A.unit??"elementov"}`;return`Preveliko: pričakovano, da bo ${b.origin??"vrednost"} ${w}${b.maximum.toString()}`}case"too_small":{let w=b.inclusive?">=":">",A=I(b.origin);if(A)return`Premajhno: pričakovano, da bo ${b.origin} imelo ${w}${b.minimum.toString()} ${A.unit}`;return`Premajhno: pričakovano, da bo ${b.origin} ${w}${b.minimum.toString()}`}case"invalid_format":{let w=b;if(w.format==="starts_with")return`Neveljaven niz: mora se začeti z "${w.prefix}"`;if(w.format==="ends_with")return`Neveljaven niz: mora se končati z "${w.suffix}"`;if(w.format==="includes")return`Neveljaven niz: mora vsebovati "${w.includes}"`;if(w.format==="regex")return`Neveljaven niz: mora ustrezati vzorcu ${w.pattern}`;return`Neveljaven ${D[w.format]??b.format}`}case"not_multiple_of":return`Neveljavno število: mora biti večkratnik ${b.divisor}`;case"unrecognized_keys":return`Neprepoznan${b.keys.length>1?"i ključi":" ključ"}: ${z(b.keys,", ")}`;case"invalid_key":return`Neveljaven ključ v ${b.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${b.origin}`;default:return"Neveljaven vnos"}}};function _X(){return{localeError:SK()}}var PK=()=>{let $={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att innehålla"},set:{unit:"objekt",verb:"att innehålla"}};function I(b){return $[b]??null}let U=(b)=>{let w=typeof b;switch(w){case"number":return Number.isNaN(b)?"NaN":"antal";case"object":{if(Array.isArray(b))return"lista";if(b===null)return"null";if(Object.getPrototypeOf(b)!==Object.prototype&&b.constructor)return b.constructor.name}}return w},D={regex:"reguljärt uttryck",email:"e-postadress",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-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad sträng",base64url:"base64url-kodad sträng",json_string:"JSON-sträng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"};return(b)=>{switch(b.code){case"invalid_type":return`Ogiltig inmatning: förväntat ${b.expected}, fick ${U(b.input)}`;case"invalid_value":if(b.values.length===1)return`Ogiltig inmatning: förväntat ${q(b.values[0])}`;return`Ogiltigt val: förväntade en av ${z(b.values,"|")}`;case"too_big":{let w=b.inclusive?"<=":"<",A=I(b.origin);if(A)return`För stor(t): förväntade ${b.origin??"värdet"} att ha ${w}${b.maximum.toString()} ${A.unit??"element"}`;return`För stor(t): förväntat ${b.origin??"värdet"} att ha ${w}${b.maximum.toString()}`}case"too_small":{let w=b.inclusive?">=":">",A=I(b.origin);if(A)return`För lite(t): förväntade ${b.origin??"värdet"} att ha ${w}${b.minimum.toString()} ${A.unit}`;return`För lite(t): förväntade ${b.origin??"värdet"} att ha ${w}${b.minimum.toString()}`}case"invalid_format":{let w=b;if(w.format==="starts_with")return`Ogiltig sträng: måste börja med "${w.prefix}"`;if(w.format==="ends_with")return`Ogiltig sträng: måste sluta med "${w.suffix}"`;if(w.format==="includes")return`Ogiltig sträng: måste innehålla "${w.includes}"`;if(w.format==="regex")return`Ogiltig sträng: måste matcha mönstret "${w.pattern}"`;return`Ogiltig(t) ${D[w.format]??b.format}`}case"not_multiple_of":return`Ogiltigt tal: måste vara en multipel av ${b.divisor}`;case"unrecognized_keys":return`${b.keys.length>1?"Okända nycklar":"Okänd nyckel"}: ${z(b.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${b.origin??"värdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt värde i ${b.origin??"värdet"}`;default:return"Ogiltig input"}}};function CX(){return{localeError:PK()}}var RK=()=>{let $={string:{unit:"எழுத்துக்கள்",verb:"கொண்டிருக்க வேண்டும்"},file:{unit:"பைட்டுகள்",verb:"கொண்டிருக்க வேண்டும்"},array:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},set:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"}};function I(b){return $[b]??null}let U=(b)=>{let w=typeof b;switch(w){case"number":return Number.isNaN(b)?"எண் அல்லாதது":"எண்";case"object":{if(Array.isArray(b))return"அணி";if(b===null)return"வெறுமை";if(Object.getPrototypeOf(b)!==Object.prototype&&b.constructor)return b.constructor.name}}return w},D={regex:"உள்ளீடு",email:"மின்னஞ்சல் முகவரி",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 தேதி நேரம்",date:"ISO தேதி",time:"ISO நேரம்",duration:"ISO கால அளவு",ipv4:"IPv4 முகவரி",ipv6:"IPv6 முகவரி",cidrv4:"IPv4 வரம்பு",cidrv6:"IPv6 வரம்பு",base64:"base64-encoded சரம்",base64url:"base64url-encoded சரம்",json_string:"JSON சரம்",e164:"E.164 எண்",jwt:"JWT",template_literal:"input"};return(b)=>{switch(b.code){case"invalid_type":return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${b.expected}, பெறப்பட்டது ${U(b.input)}`;case"invalid_value":if(b.values.length===1)return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${q(b.values[0])}`;return`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${z(b.values,"|")} இல் ஒன்று`;case"too_big":{let w=b.inclusive?"<=":"<",A=I(b.origin);if(A)return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${b.origin??"மதிப்பு"} ${w}${b.maximum.toString()} ${A.unit??"உறுப்புகள்"} ஆக இருக்க வேண்டும்`;return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${b.origin??"மதிப்பு"} ${w}${b.maximum.toString()} ஆக இருக்க வேண்டும்`}case"too_small":{let w=b.inclusive?">=":">",A=I(b.origin);if(A)return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${b.origin} ${w}${b.minimum.toString()} ${A.unit} ஆக இருக்க வேண்டும்`;return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${b.origin} ${w}${b.minimum.toString()} ஆக இருக்க வேண்டும்`}case"invalid_format":{let w=b;if(w.format==="starts_with")return`தவறான சரம்: "${w.prefix}" இல் தொடங்க வேண்டும்`;if(w.format==="ends_with")return`தவறான சரம்: "${w.suffix}" இல் முடிவடைய வேண்டும்`;if(w.format==="includes")return`தவறான சரம்: "${w.includes}" ஐ உள்ளடக்க வேண்டும்`;if(w.format==="regex")return`தவறான சரம்: ${w.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`;return`தவறான ${D[w.format]??b.format}`}case"not_multiple_of":return`தவறான எண்: ${b.divisor} இன் பலமாக இருக்க வேண்டும்`;case"unrecognized_keys":return`அடையாளம் தெரியாத விசை${b.keys.length>1?"கள்":""}: ${z(b.keys,", ")}`;case"invalid_key":return`${b.origin} இல் தவறான விசை`;case"invalid_union":return"தவறான உள்ளீடு";case"invalid_element":return`${b.origin} இல் தவறான மதிப்பு`;default:return"தவறான உள்ளீடு"}}};function ZX(){return{localeError:RK()}}var TK=()=>{let $={string:{unit:"ตัวอักษร",verb:"ควรมี"},file:{unit:"ไบต์",verb:"ควรมี"},array:{unit:"รายการ",verb:"ควรมี"},set:{unit:"รายการ",verb:"ควรมี"}};function I(b){return $[b]??null}let U=(b)=>{let w=typeof b;switch(w){case"number":return Number.isNaN(b)?"ไม่ใช่ตัวเลข (NaN)":"ตัวเลข";case"object":{if(Array.isArray(b))return"อาร์เรย์ (Array)";if(b===null)return"ไม่มีค่า (null)";if(Object.getPrototypeOf(b)!==Object.prototype&&b.constructor)return b.constructor.name}}return w},D={regex:"ข้อมูลที่ป้อน",email:"ที่อยู่อีเมล",url:"URL",emoji:"อิโมจิ",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"วันที่เวลาแบบ ISO",date:"วันที่แบบ ISO",time:"เวลาแบบ ISO",duration:"ช่วงเวลาแบบ ISO",ipv4:"ที่อยู่ IPv4",ipv6:"ที่อยู่ IPv6",cidrv4:"ช่วง IP แบบ IPv4",cidrv6:"ช่วง IP แบบ IPv6",base64:"ข้อความแบบ Base64",base64url:"ข้อความแบบ Base64 สำหรับ URL",json_string:"ข้อความแบบ JSON",e164:"เบอร์โทรศัพท์ระหว่างประเทศ (E.164)",jwt:"โทเคน JWT",template_literal:"ข้อมูลที่ป้อน"};return(b)=>{switch(b.code){case"invalid_type":return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${b.expected} แต่ได้รับ ${U(b.input)}`;case"invalid_value":if(b.values.length===1)return`ค่าไม่ถูกต้อง: ควรเป็น ${q(b.values[0])}`;return`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${z(b.values,"|")}`;case"too_big":{let w=b.inclusive?"ไม่เกิน":"น้อยกว่า",A=I(b.origin);if(A)return`เกินกำหนด: ${b.origin??"ค่า"} ควรมี${w} ${b.maximum.toString()} ${A.unit??"รายการ"}`;return`เกินกำหนด: ${b.origin??"ค่า"} ควรมี${w} ${b.maximum.toString()}`}case"too_small":{let w=b.inclusive?"อย่างน้อย":"มากกว่า",A=I(b.origin);if(A)return`น้อยกว่ากำหนด: ${b.origin} ควรมี${w} ${b.minimum.toString()} ${A.unit}`;return`น้อยกว่ากำหนด: ${b.origin} ควรมี${w} ${b.minimum.toString()}`}case"invalid_format":{let w=b;if(w.format==="starts_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${w.prefix}"`;if(w.format==="ends_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${w.suffix}"`;if(w.format==="includes")return`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${w.includes}" อยู่ในข้อความ`;if(w.format==="regex")return`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${w.pattern}`;return`รูปแบบไม่ถูกต้อง: ${D[w.format]??b.format}`}case"not_multiple_of":return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${b.divisor} ได้ลงตัว`;case"unrecognized_keys":return`พบคีย์ที่ไม่รู้จัก: ${z(b.keys,", ")}`;case"invalid_key":return`คีย์ไม่ถูกต้องใน ${b.origin}`;case"invalid_union":return"ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";case"invalid_element":return`ข้อมูลไม่ถูกต้องใน ${b.origin}`;default:return"ข้อมูลไม่ถูกต้อง"}}};function fX(){return{localeError:TK()}}var _K=($)=>{let I=typeof $;switch(I){case"number":return Number.isNaN($)?"NaN":"number";case"object":{if(Array.isArray($))return"array";if($===null)return"null";if(Object.getPrototypeOf($)!==Object.prototype&&$.constructor)return $.constructor.name}}return I},CK=()=>{let $={string:{unit:"karakter",verb:"olmalı"},file:{unit:"bayt",verb:"olmalı"},array:{unit:"öğe",verb:"olmalı"},set:{unit:"öğe",verb:"olmalı"}};function I(D){return $[D]??null}let U={regex:"girdi",email:"e-posta adresi",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 tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO süre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aralığı",cidrv6:"IPv6 aralığı",base64:"base64 ile şifrelenmiş metin",base64url:"base64url ile şifrelenmiş metin",json_string:"JSON dizesi",e164:"E.164 sayısı",jwt:"JWT",template_literal:"Şablon dizesi"};return(D)=>{switch(D.code){case"invalid_type":return`Geçersiz değer: beklenen ${D.expected}, alınan ${_K(D.input)}`;case"invalid_value":if(D.values.length===1)return`Geçersiz değer: beklenen ${q(D.values[0])}`;return`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${z(D.values,"|")}`;case"too_big":{let b=D.inclusive?"<=":"<",w=I(D.origin);if(w)return`Çok büyük: beklenen ${D.origin??"değer"} ${b}${D.maximum.toString()} ${w.unit??"öğe"}`;return`Çok büyük: beklenen ${D.origin??"değer"} ${b}${D.maximum.toString()}`}case"too_small":{let b=D.inclusive?">=":">",w=I(D.origin);if(w)return`Çok küçük: beklenen ${D.origin} ${b}${D.minimum.toString()} ${w.unit}`;return`Çok küçük: beklenen ${D.origin} ${b}${D.minimum.toString()}`}case"invalid_format":{let b=D;if(b.format==="starts_with")return`Geçersiz metin: "${b.prefix}" ile başlamalı`;if(b.format==="ends_with")return`Geçersiz metin: "${b.suffix}" ile bitmeli`;if(b.format==="includes")return`Geçersiz metin: "${b.includes}" içermeli`;if(b.format==="regex")return`Geçersiz metin: ${b.pattern} desenine uymalı`;return`Geçersiz ${U[b.format]??D.format}`}case"not_multiple_of":return`Geçersiz sayı: ${D.divisor} ile tam bölünebilmeli`;case"unrecognized_keys":return`Tanınmayan anahtar${D.keys.length>1?"lar":""}: ${z(D.keys,", ")}`;case"invalid_key":return`${D.origin} içinde geçersiz anahtar`;case"invalid_union":return"Geçersiz değer";case"invalid_element":return`${D.origin} içinde geçersiz değer`;default:return"Geçersiz değer"}}};function gX(){return{localeError:CK()}}var ZK=()=>{let $={string:{unit:"символів",verb:"матиме"},file:{unit:"байтів",verb:"матиме"},array:{unit:"елементів",verb:"матиме"},set:{unit:"елементів",verb:"матиме"}};function I(b){return $[b]??null}let U=(b)=>{let w=typeof b;switch(w){case"number":return Number.isNaN(b)?"NaN":"число";case"object":{if(Array.isArray(b))return"масив";if(b===null)return"null";if(Object.getPrototypeOf(b)!==Object.prototype&&b.constructor)return b.constructor.name}}return w},D={regex:"вхідні дані",email:"адреса електронної пошти",url:"URL",emoji:"емодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"дата та час ISO",date:"дата ISO",time:"час ISO",duration:"тривалість ISO",ipv4:"адреса IPv4",ipv6:"адреса IPv6",cidrv4:"діапазон IPv4",cidrv6:"діапазон IPv6",base64:"рядок у кодуванні base64",base64url:"рядок у кодуванні base64url",json_string:"рядок JSON",e164:"номер E.164",jwt:"JWT",template_literal:"вхідні дані"};return(b)=>{switch(b.code){case"invalid_type":return`Неправильні вхідні дані: очікується ${b.expected}, отримано ${U(b.input)}`;case"invalid_value":if(b.values.length===1)return`Неправильні вхідні дані: очікується ${q(b.values[0])}`;return`Неправильна опція: очікується одне з ${z(b.values,"|")}`;case"too_big":{let w=b.inclusive?"<=":"<",A=I(b.origin);if(A)return`Занадто велике: очікується, що ${b.origin??"значення"} ${A.verb} ${w}${b.maximum.toString()} ${A.unit??"елементів"}`;return`Занадто велике: очікується, що ${b.origin??"значення"} буде ${w}${b.maximum.toString()}`}case"too_small":{let w=b.inclusive?">=":">",A=I(b.origin);if(A)return`Занадто мале: очікується, що ${b.origin} ${A.verb} ${w}${b.minimum.toString()} ${A.unit}`;return`Занадто мале: очікується, що ${b.origin} буде ${w}${b.minimum.toString()}`}case"invalid_format":{let w=b;if(w.format==="starts_with")return`Неправильний рядок: повинен починатися з "${w.prefix}"`;if(w.format==="ends_with")return`Неправильний рядок: повинен закінчуватися на "${w.suffix}"`;if(w.format==="includes")return`Неправильний рядок: повинен містити "${w.includes}"`;if(w.format==="regex")return`Неправильний рядок: повинен відповідати шаблону ${w.pattern}`;return`Неправильний ${D[w.format]??b.format}`}case"not_multiple_of":return`Неправильне число: повинно бути кратним ${b.divisor}`;case"unrecognized_keys":return`Нерозпізнаний ключ${b.keys.length>1?"і":""}: ${z(b.keys,", ")}`;case"invalid_key":return`Неправильний ключ у ${b.origin}`;case"invalid_union":return"Неправильні вхідні дані";case"invalid_element":return`Неправильне значення у ${b.origin}`;default:return"Неправильні вхідні дані"}}};function t1(){return{localeError:ZK()}}function yX(){return t1()}var fK=()=>{let $={string:{unit:"حروف",verb:"ہونا"},file:{unit:"بائٹس",verb:"ہونا"},array:{unit:"آئٹمز",verb:"ہونا"},set:{unit:"آئٹمز",verb:"ہونا"}};function I(b){return $[b]??null}let U=(b)=>{let w=typeof b;switch(w){case"number":return Number.isNaN(b)?"NaN":"نمبر";case"object":{if(Array.isArray(b))return"آرے";if(b===null)return"نل";if(Object.getPrototypeOf(b)!==Object.prototype&&b.constructor)return b.constructor.name}}return w},D={regex:"ان پٹ",email:"ای میل ایڈریس",url:"یو آر ایل",emoji:"ایموجی",uuid:"یو یو آئی ڈی",uuidv4:"یو یو آئی ڈی وی 4",uuidv6:"یو یو آئی ڈی وی 6",nanoid:"نینو آئی ڈی",guid:"جی یو آئی ڈی",cuid:"سی یو آئی ڈی",cuid2:"سی یو آئی ڈی 2",ulid:"یو ایل آئی ڈی",xid:"ایکس آئی ڈی",ksuid:"کے ایس یو آئی ڈی",datetime:"آئی ایس او ڈیٹ ٹائم",date:"آئی ایس او تاریخ",time:"آئی ایس او وقت",duration:"آئی ایس او مدت",ipv4:"آئی پی وی 4 ایڈریس",ipv6:"آئی پی وی 6 ایڈریس",cidrv4:"آئی پی وی 4 رینج",cidrv6:"آئی پی وی 6 رینج",base64:"بیس 64 ان کوڈڈ سٹرنگ",base64url:"بیس 64 یو آر ایل ان کوڈڈ سٹرنگ",json_string:"جے ایس او این سٹرنگ",e164:"ای 164 نمبر",jwt:"جے ڈبلیو ٹی",template_literal:"ان پٹ"};return(b)=>{switch(b.code){case"invalid_type":return`غلط ان پٹ: ${b.expected} متوقع تھا، ${U(b.input)} موصول ہوا`;case"invalid_value":if(b.values.length===1)return`غلط ان پٹ: ${q(b.values[0])} متوقع تھا`;return`غلط آپشن: ${z(b.values,"|")} میں سے ایک متوقع تھا`;case"too_big":{let w=b.inclusive?"<=":"<",A=I(b.origin);if(A)return`بہت بڑا: ${b.origin??"ویلیو"} کے ${w}${b.maximum.toString()} ${A.unit??"عناصر"} ہونے متوقع تھے`;return`بہت بڑا: ${b.origin??"ویلیو"} کا ${w}${b.maximum.toString()} ہونا متوقع تھا`}case"too_small":{let w=b.inclusive?">=":">",A=I(b.origin);if(A)return`بہت چھوٹا: ${b.origin} کے ${w}${b.minimum.toString()} ${A.unit} ہونے متوقع تھے`;return`بہت چھوٹا: ${b.origin} کا ${w}${b.minimum.toString()} ہونا متوقع تھا`}case"invalid_format":{let w=b;if(w.format==="starts_with")return`غلط سٹرنگ: "${w.prefix}" سے شروع ہونا چاہیے`;if(w.format==="ends_with")return`غلط سٹرنگ: "${w.suffix}" پر ختم ہونا چاہیے`;if(w.format==="includes")return`غلط سٹرنگ: "${w.includes}" شامل ہونا چاہیے`;if(w.format==="regex")return`غلط سٹرنگ: پیٹرن ${w.pattern} سے میچ ہونا چاہیے`;return`غلط ${D[w.format]??b.format}`}case"not_multiple_of":return`غلط نمبر: ${b.divisor} کا مضاعف ہونا چاہیے`;case"unrecognized_keys":return`غیر تسلیم شدہ کی${b.keys.length>1?"ز":""}: ${z(b.keys,"، ")}`;case"invalid_key":return`${b.origin} میں غلط کی`;case"invalid_union":return"غلط ان پٹ";case"invalid_element":return`${b.origin} میں غلط ویلیو`;default:return"غلط ان پٹ"}}};function xX(){return{localeError:fK()}}var gK=()=>{let $={string:{unit:"ký tự",verb:"có"},file:{unit:"byte",verb:"có"},array:{unit:"phần tử",verb:"có"},set:{unit:"phần tử",verb:"có"}};function I(b){return $[b]??null}let U=(b)=>{let w=typeof b;switch(w){case"number":return Number.isNaN(b)?"NaN":"số";case"object":{if(Array.isArray(b))return"mảng";if(b===null)return"null";if(Object.getPrototypeOf(b)!==Object.prototype&&b.constructor)return b.constructor.name}}return w},D={regex:"đầu vào",email:"địa chỉ email",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:"ngày giờ ISO",date:"ngày ISO",time:"giờ ISO",duration:"khoảng thời gian ISO",ipv4:"địa chỉ IPv4",ipv6:"địa chỉ IPv6",cidrv4:"dải IPv4",cidrv6:"dải IPv6",base64:"chuỗi mã hóa base64",base64url:"chuỗi mã hóa base64url",json_string:"chuỗi JSON",e164:"số E.164",jwt:"JWT",template_literal:"đầu vào"};return(b)=>{switch(b.code){case"invalid_type":return`Đầu vào không hợp lệ: mong đợi ${b.expected}, nhận được ${U(b.input)}`;case"invalid_value":if(b.values.length===1)return`Đầu vào không hợp lệ: mong đợi ${q(b.values[0])}`;return`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${z(b.values,"|")}`;case"too_big":{let w=b.inclusive?"<=":"<",A=I(b.origin);if(A)return`Quá lớn: mong đợi ${b.origin??"giá trị"} ${A.verb} ${w}${b.maximum.toString()} ${A.unit??"phần tử"}`;return`Quá lớn: mong đợi ${b.origin??"giá trị"} ${w}${b.maximum.toString()}`}case"too_small":{let w=b.inclusive?">=":">",A=I(b.origin);if(A)return`Quá nhỏ: mong đợi ${b.origin} ${A.verb} ${w}${b.minimum.toString()} ${A.unit}`;return`Quá nhỏ: mong đợi ${b.origin} ${w}${b.minimum.toString()}`}case"invalid_format":{let w=b;if(w.format==="starts_with")return`Chuỗi không hợp lệ: phải bắt đầu bằng "${w.prefix}"`;if(w.format==="ends_with")return`Chuỗi không hợp lệ: phải kết thúc bằng "${w.suffix}"`;if(w.format==="includes")return`Chuỗi không hợp lệ: phải bao gồm "${w.includes}"`;if(w.format==="regex")return`Chuỗi không hợp lệ: phải khớp với mẫu ${w.pattern}`;return`${D[w.format]??b.format} không hợp lệ`}case"not_multiple_of":return`Số không hợp lệ: phải là bội số của ${b.divisor}`;case"unrecognized_keys":return`Khóa không được nhận dạng: ${z(b.keys,", ")}`;case"invalid_key":return`Khóa không hợp lệ trong ${b.origin}`;case"invalid_union":return"Đầu vào không hợp lệ";case"invalid_element":return`Giá trị không hợp lệ trong ${b.origin}`;default:return"Đầu vào không hợp lệ"}}};function lX(){return{localeError:gK()}}var yK=()=>{let $={string:{unit:"字符",verb:"包含"},file:{unit:"字节",verb:"包含"},array:{unit:"项",verb:"包含"},set:{unit:"项",verb:"包含"}};function I(b){return $[b]??null}let U=(b)=>{let w=typeof b;switch(w){case"number":return Number.isNaN(b)?"非数字(NaN)":"数字";case"object":{if(Array.isArray(b))return"数组";if(b===null)return"空值(null)";if(Object.getPrototypeOf(b)!==Object.prototype&&b.constructor)return b.constructor.name}}return w},D={regex:"输入",email:"电子邮件",url:"URL",emoji:"表情符号",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日期时间",date:"ISO日期",time:"ISO时间",duration:"ISO时长",ipv4:"IPv4地址",ipv6:"IPv6地址",cidrv4:"IPv4网段",cidrv6:"IPv6网段",base64:"base64编码字符串",base64url:"base64url编码字符串",json_string:"JSON字符串",e164:"E.164号码",jwt:"JWT",template_literal:"输入"};return(b)=>{switch(b.code){case"invalid_type":return`无效输入:期望 ${b.expected},实际接收 ${U(b.input)}`;case"invalid_value":if(b.values.length===1)return`无效输入:期望 ${q(b.values[0])}`;return`无效选项:期望以下之一 ${z(b.values,"|")}`;case"too_big":{let w=b.inclusive?"<=":"<",A=I(b.origin);if(A)return`数值过大:期望 ${b.origin??"值"} ${w}${b.maximum.toString()} ${A.unit??"个元素"}`;return`数值过大:期望 ${b.origin??"值"} ${w}${b.maximum.toString()}`}case"too_small":{let w=b.inclusive?">=":">",A=I(b.origin);if(A)return`数值过小:期望 ${b.origin} ${w}${b.minimum.toString()} ${A.unit}`;return`数值过小:期望 ${b.origin} ${w}${b.minimum.toString()}`}case"invalid_format":{let w=b;if(w.format==="starts_with")return`无效字符串:必须以 "${w.prefix}" 开头`;if(w.format==="ends_with")return`无效字符串:必须以 "${w.suffix}" 结尾`;if(w.format==="includes")return`无效字符串:必须包含 "${w.includes}"`;if(w.format==="regex")return`无效字符串:必须满足正则表达式 ${w.pattern}`;return`无效${D[w.format]??b.format}`}case"not_multiple_of":return`无效数字:必须是 ${b.divisor} 的倍数`;case"unrecognized_keys":return`出现未知的键(key): ${z(b.keys,", ")}`;case"invalid_key":return`${b.origin} 中的键(key)无效`;case"invalid_union":return"无效输入";case"invalid_element":return`${b.origin} 中包含无效值(value)`;default:return"无效输入"}}};function hX(){return{localeError:yK()}}var xK=()=>{let $={string:{unit:"字元",verb:"擁有"},file:{unit:"位元組",verb:"擁有"},array:{unit:"項目",verb:"擁有"},set:{unit:"項目",verb:"擁有"}};function I(b){return $[b]??null}let U=(b)=>{let w=typeof b;switch(w){case"number":return Number.isNaN(b)?"NaN":"number";case"object":{if(Array.isArray(b))return"array";if(b===null)return"null";if(Object.getPrototypeOf(b)!==Object.prototype&&b.constructor)return b.constructor.name}}return w},D={regex:"輸入",email:"郵件地址",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 日期時間",date:"ISO 日期",time:"ISO 時間",duration:"ISO 期間",ipv4:"IPv4 位址",ipv6:"IPv6 位址",cidrv4:"IPv4 範圍",cidrv6:"IPv6 範圍",base64:"base64 編碼字串",base64url:"base64url 編碼字串",json_string:"JSON 字串",e164:"E.164 數值",jwt:"JWT",template_literal:"輸入"};return(b)=>{switch(b.code){case"invalid_type":return`無效的輸入值:預期為 ${b.expected},但收到 ${U(b.input)}`;case"invalid_value":if(b.values.length===1)return`無效的輸入值:預期為 ${q(b.values[0])}`;return`無效的選項:預期為以下其中之一 ${z(b.values,"|")}`;case"too_big":{let w=b.inclusive?"<=":"<",A=I(b.origin);if(A)return`數值過大:預期 ${b.origin??"值"} 應為 ${w}${b.maximum.toString()} ${A.unit??"個元素"}`;return`數值過大:預期 ${b.origin??"值"} 應為 ${w}${b.maximum.toString()}`}case"too_small":{let w=b.inclusive?">=":">",A=I(b.origin);if(A)return`數值過小:預期 ${b.origin} 應為 ${w}${b.minimum.toString()} ${A.unit}`;return`數值過小:預期 ${b.origin} 應為 ${w}${b.minimum.toString()}`}case"invalid_format":{let w=b;if(w.format==="starts_with")return`無效的字串:必須以 "${w.prefix}" 開頭`;if(w.format==="ends_with")return`無效的字串:必須以 "${w.suffix}" 結尾`;if(w.format==="includes")return`無效的字串:必須包含 "${w.includes}"`;if(w.format==="regex")return`無效的字串:必須符合格式 ${w.pattern}`;return`無效的 ${D[w.format]??b.format}`}case"not_multiple_of":return`無效的數字:必須為 ${b.divisor} 的倍數`;case"unrecognized_keys":return`無法識別的鍵值${b.keys.length>1?"們":""}:${z(b.keys,"、")}`;case"invalid_key":return`${b.origin} 中有無效的鍵值`;case"invalid_union":return"無效的輸入值";case"invalid_element":return`${b.origin} 中有無效的值`;default:return"無效的輸入值"}}};function uX(){return{localeError:xK()}}var lK=()=>{let $={string:{unit:"àmi",verb:"ní"},file:{unit:"bytes",verb:"ní"},array:{unit:"nkan",verb:"ní"},set:{unit:"nkan",verb:"ní"}};function I(b){return $[b]??null}let U=(b)=>{let w=typeof b;switch(w){case"number":return Number.isNaN(b)?"NaN":"nọ́mbà";case"object":{if(Array.isArray(b))return"akopọ";if(b===null)return"null";if(Object.getPrototypeOf(b)!==Object.prototype&&b.constructor)return b.constructor.name}}return w},D={regex:"ẹ̀rọ ìbáwọlé",email:"àdírẹ́sì ìmẹ́lì",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:"àkókò ISO",date:"ọjọ́ ISO",time:"àkókò ISO",duration:"àkókò tó pé ISO",ipv4:"àdírẹ́sì IPv4",ipv6:"àdírẹ́sì IPv6",cidrv4:"àgbègbè IPv4",cidrv6:"àgbègbè IPv6",base64:"ọ̀rọ̀ tí a kọ́ ní base64",base64url:"ọ̀rọ̀ base64url",json_string:"ọ̀rọ̀ JSON",e164:"nọ́mbà E.164",jwt:"JWT",template_literal:"ẹ̀rọ ìbáwọlé"};return(b)=>{switch(b.code){case"invalid_type":return`Ìbáwọlé aṣìṣe: a ní láti fi ${b.expected}, àmọ̀ a rí ${U(b.input)}`;case"invalid_value":if(b.values.length===1)return`Ìbáwọlé aṣìṣe: a ní láti fi ${q(b.values[0])}`;return`Àṣàyàn aṣìṣe: yan ọ̀kan lára ${z(b.values,"|")}`;case"too_big":{let w=b.inclusive?"<=":"<",A=I(b.origin);if(A)return`Tó pọ̀ jù: a ní láti jẹ́ pé ${b.origin??"iye"} ${A.verb} ${w}${b.maximum} ${A.unit}`;return`Tó pọ̀ jù: a ní láti jẹ́ ${w}${b.maximum}`}case"too_small":{let w=b.inclusive?">=":">",A=I(b.origin);if(A)return`Kéré ju: a ní láti jẹ́ pé ${b.origin} ${A.verb} ${w}${b.minimum} ${A.unit}`;return`Kéré ju: a ní láti jẹ́ ${w}${b.minimum}`}case"invalid_format":{let w=b;if(w.format==="starts_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bẹ̀rẹ̀ pẹ̀lú "${w.prefix}"`;if(w.format==="ends_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ parí pẹ̀lú "${w.suffix}"`;if(w.format==="includes")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ ní "${w.includes}"`;if(w.format==="regex")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bá àpẹẹrẹ mu ${w.pattern}`;return`Aṣìṣe: ${D[w.format]??b.format}`}case"not_multiple_of":return`Nọ́mbà aṣìṣe: gbọ́dọ̀ jẹ́ èyà pípín ti ${b.divisor}`;case"unrecognized_keys":return`Bọtìnì àìmọ̀: ${z(b.keys,", ")}`;case"invalid_key":return`Bọtìnì aṣìṣe nínú ${b.origin}`;case"invalid_union":return"Ìbáwọlé aṣìṣe";case"invalid_element":return`Iye aṣìṣe nínú ${b.origin}`;default:return"Ìbáwọlé aṣìṣe"}}};function iX(){return{localeError:lK()}}var JB,nX=Symbol("ZodOutput"),cX=Symbol("ZodInput");class rX{constructor(){this._map=new WeakMap,this._idmap=new Map}add($,...I){let U=I[0];if(this._map.set($,U),U&&typeof U==="object"&&"id"in U){if(this._idmap.has(U.id))throw new Error(`ID ${U.id} already exists in the registry`);this._idmap.set(U.id,$)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove($){let I=this._map.get($);if(I&&typeof I==="object"&&"id"in I)this._idmap.delete(I.id);return this._map.delete($),this}get($){let I=$._zod.parent;if(I){let U={...this.get(I)??{}};delete U.id;let D={...U,...this._map.get($)};return Object.keys(D).length?D:void 0}return this._map.get($)}has($){return this._map.has($)}}function P0(){return new rX}(JB=globalThis).__zod_globalRegistry??(JB.__zod_globalRegistry=P0());var f$=globalThis.__zod_globalRegistry;function R0($,I){return new $({type:"string",...E(I)})}function mX($,I){return new $({type:"string",coerce:!0,...E(I)})}function a1($,I){return new $({type:"string",format:"email",check:"string_format",abort:!1,...E(I)})}function vI($,I){return new $({type:"string",format:"guid",check:"string_format",abort:!1,...E(I)})}function e1($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,...E(I)})}function s1($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...E(I)})}function $U($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...E(I)})}function IU($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...E(I)})}function JI($,I){return new $({type:"string",format:"url",check:"string_format",abort:!1,...E(I)})}function UU($,I){return new $({type:"string",format:"emoji",check:"string_format",abort:!1,...E(I)})}function bU($,I){return new $({type:"string",format:"nanoid",check:"string_format",abort:!1,...E(I)})}function DU($,I){return new $({type:"string",format:"cuid",check:"string_format",abort:!1,...E(I)})}function wU($,I){return new $({type:"string",format:"cuid2",check:"string_format",abort:!1,...E(I)})}function AU($,I){return new $({type:"string",format:"ulid",check:"string_format",abort:!1,...E(I)})}function NU($,I){return new $({type:"string",format:"xid",check:"string_format",abort:!1,...E(I)})}function OU($,I){return new $({type:"string",format:"ksuid",check:"string_format",abort:!1,...E(I)})}function XU($,I){return new $({type:"string",format:"ipv4",check:"string_format",abort:!1,...E(I)})}function WU($,I){return new $({type:"string",format:"ipv6",check:"string_format",abort:!1,...E(I)})}function T0($,I){return new $({type:"string",format:"mac",check:"string_format",abort:!1,...E(I)})}function GU($,I){return new $({type:"string",format:"cidrv4",check:"string_format",abort:!1,...E(I)})}function QU($,I){return new $({type:"string",format:"cidrv6",check:"string_format",abort:!1,...E(I)})}function YU($,I){return new $({type:"string",format:"base64",check:"string_format",abort:!1,...E(I)})}function BU($,I){return new $({type:"string",format:"base64url",check:"string_format",abort:!1,...E(I)})}function vU($,I){return new $({type:"string",format:"e164",check:"string_format",abort:!1,...E(I)})}function JU($,I){return new $({type:"string",format:"jwt",check:"string_format",abort:!1,...E(I)})}var oX={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function dX($,I){return new $({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...E(I)})}function pX($,I){return new $({type:"string",format:"date",check:"string_format",...E(I)})}function tX($,I){return new $({type:"string",format:"time",check:"string_format",precision:null,...E(I)})}function aX($,I){return new $({type:"string",format:"duration",check:"string_format",...E(I)})}function _0($,I){return new $({type:"number",checks:[],...E(I)})}function eX($,I){return new $({type:"number",coerce:!0,checks:[],...E(I)})}function C0($,I){return new $({type:"number",check:"number_format",abort:!1,format:"safeint",...E(I)})}function Z0($,I){return new $({type:"number",check:"number_format",abort:!1,format:"float32",...E(I)})}function f0($,I){return new $({type:"number",check:"number_format",abort:!1,format:"float64",...E(I)})}function g0($,I){return new $({type:"number",check:"number_format",abort:!1,format:"int32",...E(I)})}function y0($,I){return new $({type:"number",check:"number_format",abort:!1,format:"uint32",...E(I)})}function x0($,I){return new $({type:"boolean",...E(I)})}function sX($,I){return new $({type:"boolean",coerce:!0,...E(I)})}function l0($,I){return new $({type:"bigint",...E(I)})}function $W($,I){return new $({type:"bigint",coerce:!0,...E(I)})}function h0($,I){return new $({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...E(I)})}function u0($,I){return new $({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...E(I)})}function i0($,I){return new $({type:"symbol",...E(I)})}function n0($,I){return new $({type:"undefined",...E(I)})}function c0($,I){return new $({type:"null",...E(I)})}function r0($){return new $({type:"any"})}function m0($){return new $({type:"unknown"})}function o0($,I){return new $({type:"never",...E(I)})}function d0($,I){return new $({type:"void",...E(I)})}function p0($,I){return new $({type:"date",...E(I)})}function IW($,I){return new $({type:"date",coerce:!0,...E(I)})}function t0($,I){return new $({type:"nan",...E(I)})}function q6($,I){return new HD({check:"less_than",...E(I),value:$,inclusive:!1})}function a$($,I){return new HD({check:"less_than",...E(I),value:$,inclusive:!0})}function k6($,I){return new LD({check:"greater_than",...E(I),value:$,inclusive:!1})}function g$($,I){return new LD({check:"greater_than",...E(I),value:$,inclusive:!0})}function a0($){return k6(0,$)}function e0($){return q6(0,$)}function s0($){return a$(0,$)}function $w($){return g$(0,$)}function w4($,I){return new jO({check:"multiple_of",...E(I),value:$})}function f4($,I){return new RO({check:"max_size",...E(I),maximum:$})}function A4($,I){return new TO({check:"min_size",...E(I),minimum:$})}function HI($,I){return new _O({check:"size_equals",...E(I),size:$})}function g4($,I){return new CO({check:"max_length",...E(I),maximum:$})}function h6($,I){return new ZO({check:"min_length",...E(I),minimum:$})}function y4($,I){return new fO({check:"length_equals",...E(I),length:$})}function LI($,I){return new gO({check:"string_format",format:"regex",...E(I),pattern:$})}function zI($){return new yO({check:"string_format",format:"lowercase",...E($)})}function VI($){return new xO({check:"string_format",format:"uppercase",...E($)})}function MI($,I){return new lO({check:"string_format",format:"includes",...E(I),includes:$})}function KI($,I){return new hO({check:"string_format",format:"starts_with",...E(I),prefix:$})}function FI($,I){return new uO({check:"string_format",format:"ends_with",...E(I),suffix:$})}function Iw($,I,U){return new iO({check:"property",property:$,schema:I,...E(U)})}function qI($,I){return new nO({check:"mime_type",mime:$,...E(I)})}function A6($){return new cO({check:"overwrite",tx:$})}function kI($){return A6((I)=>I.normalize($))}function EI(){return A6(($)=>$.trim())}function jI(){return A6(($)=>$.toLowerCase())}function SI(){return A6(($)=>$.toUpperCase())}function PI(){return A6(($)=>nN($))}function UW($,I,U){return new $({type:"array",element:I,...E(U)})}function uK($,I,U){return new $({type:"union",options:I,...E(U)})}function iK($,I,U){return new $({type:"union",options:I,inclusive:!1,...E(U)})}function nK($,I,U,D){return new $({type:"union",options:U,discriminator:I,...E(D)})}function cK($,I,U){return new $({type:"intersection",left:I,right:U})}function rK($,I,U,D){let b=U instanceof n;return new $({type:"tuple",items:I,rest:b?U:null,...E(b?D:U)})}function mK($,I,U,D){return new $({type:"record",keyType:I,valueType:U,...E(D)})}function oK($,I,U,D){return new $({type:"map",keyType:I,valueType:U,...E(D)})}function dK($,I,U){return new $({type:"set",valueType:I,...E(U)})}function pK($,I,U){let D=Array.isArray(I)?Object.fromEntries(I.map((b)=>[b,b])):I;return new $({type:"enum",entries:D,...E(U)})}function tK($,I,U){return new $({type:"enum",entries:I,...E(U)})}function aK($,I,U){return new $({type:"literal",values:Array.isArray(I)?I:[I],...E(U)})}function Uw($,I){return new $({type:"file",...E(I)})}function eK($,I){return new $({type:"transform",transform:I})}function sK($,I){return new $({type:"optional",innerType:I})}function $F($,I){return new $({type:"nullable",innerType:I})}function IF($,I,U){return new $({type:"default",innerType:I,get defaultValue(){return typeof U==="function"?U():rN(U)}})}function UF($,I,U){return new $({type:"nonoptional",innerType:I,...E(U)})}function bF($,I){return new $({type:"success",innerType:I})}function DF($,I,U){return new $({type:"catch",innerType:I,catchValue:typeof U==="function"?U:()=>U})}function wF($,I,U){return new $({type:"pipe",in:I,out:U})}function AF($,I){return new $({type:"readonly",innerType:I})}function NF($,I,U){return new $({type:"template_literal",parts:I,...E(U)})}function OF($,I){return new $({type:"lazy",getter:I})}function XF($,I){return new $({type:"promise",innerType:I})}function bw($,I,U){let D=E(U);return D.abort??(D.abort=!0),new $({type:"custom",check:"custom",fn:I,...D})}function Dw($,I,U){return new $({type:"custom",check:"custom",fn:I,...E(U)})}function ww($){let I=HB((U)=>{return U.addIssue=(D)=>{if(typeof D==="string")U.issues.push(wI(D,U.value,I._zod.def));else{let b=D;if(b.fatal)b.continue=!1;b.code??(b.code="custom"),b.input??(b.input=U.value),b.inst??(b.inst=I),b.continue??(b.continue=!I._zod.def.abort),U.issues.push(wI(b))}},$(U.value,U)});return I}function HB($,I){let U=new X$({check:"custom",...E(I)});return U._zod.check=$,U}function Aw($){let I=new X$({check:"describe"});return I._zod.onattach=[(U)=>{let D=f$.get(U)??{};f$.add(U,{...D,description:$})}],I._zod.check=()=>{},I}function Nw($){let I=new X$({check:"meta"});return I._zod.onattach=[(U)=>{let D=f$.get(U)??{};f$.add(U,{...D,...$})}],I._zod.check=()=>{},I}function Ow($,I){let U=E(I),D=U.truthy??["true","1","yes","on","y","enabled"],b=U.falsy??["false","0","no","off","n","disabled"];if(U.case!=="sensitive")D=D.map((B)=>typeof B==="string"?B.toLowerCase():B),b=b.map((B)=>typeof B==="string"?B.toLowerCase():B);let w=new Set(D),A=new Set(b),N=$.Codec??YI,O=$.Boolean??GI,G=new($.String??D4)({type:"string",error:U.error}),Q=new O({type:"boolean",error:U.error}),Y=new N({type:"pipe",in:G,out:Q,transform:(B,J)=>{let L=B;if(U.case!=="sensitive")L=L.toLowerCase();if(w.has(L))return!0;else if(A.has(L))return!1;else return J.issues.push({code:"invalid_value",expected:"stringbool",values:[...w,...A],input:J.value,inst:Y,continue:!1}),{}},reverseTransform:(B,J)=>{if(B===!0)return D[0]||"true";else return b[0]||"false"},error:U.error});return Y}function x4($,I,U,D={}){let b=E(D),w={...E(D),check:"string_format",type:"string",format:I,fn:typeof U==="function"?U:(N)=>U.test(N),...b};if(U instanceof RegExp)w.pattern=U;return new $(w)}function N4($){let I=$?.target??"draft-2020-12";if(I==="draft-4")I="draft-04";if(I==="draft-7")I="draft-07";return{processors:$.processors??{},metadataRegistry:$?.metadata??f$,target:I,unrepresentable:$?.unrepresentable??"throw",override:$?.override??(()=>{}),io:$?.io??"output",counter:0,seen:new Map,cycles:$?.cycles??"ref",reused:$?.reused??"inline",external:$?.external??void 0}}function N$($,I,U={path:[],schemaPath:[]}){var D;let b=$._zod.def,w=I.seen.get($);if(w){if(w.count++,U.schemaPath.includes($))w.cycle=U.path;return w.schema}let A={schema:{},count:1,cycle:void 0,path:U.path};I.seen.set($,A);let N=$._zod.toJSONSchema?.();if(N)A.schema=N;else{let G={...U,schemaPath:[...U.schemaPath,$],path:U.path},Q=$._zod.parent;if(Q)A.ref=Q,N$(Q,I,G),I.seen.get(Q).isParent=!0;else if($._zod.processJSONSchema)$._zod.processJSONSchema(I,A.schema,G);else{let Y=A.schema,B=I.processors[b.type];if(!B)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${b.type}`);B($,I,Y,G)}}let O=I.metadataRegistry.get($);if(O)Object.assign(A.schema,O);if(I.io==="input"&&y$($))delete A.schema.examples,delete A.schema.default;if(I.io==="input"&&A.schema._prefault)(D=A.schema).default??(D.default=A.schema._prefault);return delete A.schema._prefault,I.seen.get($).schema}function O4($,I){let U=$.seen.get(I);if(!U)throw new Error("Unprocessed schema. This is a bug in Zod.");let D=(w)=>{let A=$.target==="draft-2020-12"?"$defs":"definitions";if($.external){let G=$.external.registry.get(w[0])?.id,Q=$.external.uri??((B)=>B);if(G)return{ref:Q(G)};let Y=w[1].defId??w[1].schema.id??`schema${$.counter++}`;return w[1].defId=Y,{defId:Y,ref:`${Q("__shared")}#/${A}/${Y}`}}if(w[1]===U)return{ref:"#"};let O=`${"#"}/${A}/`,X=w[1].schema.id??`__schema${$.counter++}`;return{defId:X,ref:O+X}},b=(w)=>{if(w[1].schema.$ref)return;let A=w[1],{ref:N,defId:O}=D(w);if(A.def={...A.schema},O)A.defId=O;let X=A.schema;for(let G in X)delete X[G];X.$ref=N};if($.cycles==="throw")for(let w of $.seen.entries()){let A=w[1];if(A.cycle)throw new Error(`Cycle detected: #/${A.cycle?.join("/")}/<root>
|
|
30
|
-
|
|
31
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let w of $.seen.entries()){let A=w[1];if(I===w[0]){b(w);continue}if($.external){let O=$.external.registry.get(w[0])?.id;if(I!==w[0]&&O){b(w);continue}}if($.metadataRegistry.get(w[0])?.id){b(w);continue}if(A.cycle){b(w);continue}if(A.count>1){if($.reused==="ref"){b(w);continue}}}}function X4($,I){let U=$.seen.get(I);if(!U)throw new Error("Unprocessed schema. This is a bug in Zod.");let D=(A)=>{let N=$.seen.get(A),O=N.def??N.schema,X={...O};if(N.ref===null)return;let G=N.ref;if(N.ref=null,G){D(G);let Q=$.seen.get(G).schema;if(Q.$ref&&($.target==="draft-07"||$.target==="draft-04"||$.target==="openapi-3.0"))O.allOf=O.allOf??[],O.allOf.push(Q);else Object.assign(O,Q),Object.assign(O,X)}if(!N.isParent)$.override({zodSchema:A,jsonSchema:O,path:N.path??[]})};for(let A of[...$.seen.entries()].reverse())D(A[0]);let b={};if($.target==="draft-2020-12")b.$schema="https://json-schema.org/draft/2020-12/schema";else if($.target==="draft-07")b.$schema="http://json-schema.org/draft-07/schema#";else if($.target==="draft-04")b.$schema="http://json-schema.org/draft-04/schema#";else if($.target==="openapi-3.0");if($.external?.uri){let A=$.external.registry.get(I)?.id;if(!A)throw new Error("Schema is missing an `id` property");b.$id=$.external.uri(A)}Object.assign(b,U.def??U.schema);let w=$.external?.defs??{};for(let A of $.seen.entries()){let N=A[1];if(N.def&&N.defId)w[N.defId]=N.def}if($.external);else if(Object.keys(w).length>0)if($.target==="draft-2020-12")b.$defs=w;else b.definitions=w;try{let A=JSON.parse(JSON.stringify(b));return Object.defineProperty(A,"~standard",{value:{...I["~standard"],jsonSchema:{input:RI(I,"input"),output:RI(I,"output")}},enumerable:!1,writable:!1}),A}catch(A){throw new Error("Error converting schema to JSON.")}}function y$($,I){let U=I??{seen:new Set};if(U.seen.has($))return!1;U.seen.add($);let D=$._zod.def;if(D.type==="transform")return!0;if(D.type==="array")return y$(D.element,U);if(D.type==="set")return y$(D.valueType,U);if(D.type==="lazy")return y$(D.getter(),U);if(D.type==="promise"||D.type==="optional"||D.type==="nonoptional"||D.type==="nullable"||D.type==="readonly"||D.type==="default"||D.type==="prefault")return y$(D.innerType,U);if(D.type==="intersection")return y$(D.left,U)||y$(D.right,U);if(D.type==="record"||D.type==="map")return y$(D.keyType,U)||y$(D.valueType,U);if(D.type==="pipe")return y$(D.in,U)||y$(D.out,U);if(D.type==="object"){for(let b in D.shape)if(y$(D.shape[b],U))return!0;return!1}if(D.type==="union"){for(let b of D.options)if(y$(b,U))return!0;return!1}if(D.type==="tuple"){for(let b of D.items)if(y$(b,U))return!0;if(D.rest&&y$(D.rest,U))return!0;return!1}return!1}var bW=($,I={})=>(U)=>{let D=N4({...U,processors:I});return N$($,D),O4(D,$),X4(D,$)},RI=($,I)=>(U)=>{let{libraryOptions:D,target:b}=U??{},w=N4({...D??{},target:b,io:I,processors:{}});return N$($,w),O4(w,$),X4(w,$)};var WF={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},DW=($,I,U,D)=>{let b=U;b.type="string";let{minimum:w,maximum:A,format:N,patterns:O,contentEncoding:X}=$._zod.bag;if(typeof w==="number")b.minLength=w;if(typeof A==="number")b.maxLength=A;if(N){if(b.format=WF[N]??N,b.format==="")delete b.format}if(X)b.contentEncoding=X;if(O&&O.size>0){let G=[...O];if(G.length===1)b.pattern=G[0].source;else if(G.length>1)b.allOf=[...G.map((Q)=>({...I.target==="draft-07"||I.target==="draft-04"||I.target==="openapi-3.0"?{type:"string"}:{},pattern:Q.source}))]}},wW=($,I,U,D)=>{let b=U,{minimum:w,maximum:A,format:N,multipleOf:O,exclusiveMaximum:X,exclusiveMinimum:G}=$._zod.bag;if(typeof N==="string"&&N.includes("int"))b.type="integer";else b.type="number";if(typeof G==="number")if(I.target==="draft-04"||I.target==="openapi-3.0")b.minimum=G,b.exclusiveMinimum=!0;else b.exclusiveMinimum=G;if(typeof w==="number"){if(b.minimum=w,typeof G==="number"&&I.target!=="draft-04")if(G>=w)delete b.minimum;else delete b.exclusiveMinimum}if(typeof X==="number")if(I.target==="draft-04"||I.target==="openapi-3.0")b.maximum=X,b.exclusiveMaximum=!0;else b.exclusiveMaximum=X;if(typeof A==="number"){if(b.maximum=A,typeof X==="number"&&I.target!=="draft-04")if(X<=A)delete b.maximum;else delete b.exclusiveMaximum}if(typeof O==="number")b.multipleOf=O},AW=($,I,U,D)=>{U.type="boolean"},NW=($,I,U,D)=>{if(I.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},OW=($,I,U,D)=>{if(I.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},XW=($,I,U,D)=>{if(I.target==="openapi-3.0")U.type="string",U.nullable=!0,U.enum=[null];else U.type="null"},WW=($,I,U,D)=>{if(I.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},GW=($,I,U,D)=>{if(I.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},QW=($,I,U,D)=>{U.not={}},YW=($,I,U,D)=>{},BW=($,I,U,D)=>{},vW=($,I,U,D)=>{if(I.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},JW=($,I,U,D)=>{let b=$._zod.def,w=C1(b.entries);if(w.every((A)=>typeof A==="number"))U.type="number";if(w.every((A)=>typeof A==="string"))U.type="string";U.enum=w},HW=($,I,U,D)=>{let b=$._zod.def,w=[];for(let A of b.values)if(A===void 0){if(I.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof A==="bigint")if(I.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");else w.push(Number(A));else w.push(A);if(w.length===0);else if(w.length===1){let A=w[0];if(U.type=A===null?"null":typeof A,I.target==="draft-04"||I.target==="openapi-3.0")U.enum=[A];else U.const=A}else{if(w.every((A)=>typeof A==="number"))U.type="number";if(w.every((A)=>typeof A==="string"))U.type="string";if(w.every((A)=>typeof A==="boolean"))U.type="boolean";if(w.every((A)=>A===null))U.type="null";U.enum=w}},LW=($,I,U,D)=>{if(I.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},zW=($,I,U,D)=>{let b=U,w=$._zod.pattern;if(!w)throw new Error("Pattern not found in template literal");b.type="string",b.pattern=w.source},VW=($,I,U,D)=>{let b=U,w={type:"string",format:"binary",contentEncoding:"binary"},{minimum:A,maximum:N,mime:O}=$._zod.bag;if(A!==void 0)w.minLength=A;if(N!==void 0)w.maxLength=N;if(O)if(O.length===1)w.contentMediaType=O[0],Object.assign(b,w);else b.anyOf=O.map((X)=>{return{...w,contentMediaType:X}});else Object.assign(b,w)},MW=($,I,U,D)=>{U.type="boolean"},KW=($,I,U,D)=>{if(I.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},FW=($,I,U,D)=>{if(I.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},qW=($,I,U,D)=>{if(I.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},kW=($,I,U,D)=>{if(I.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},EW=($,I,U,D)=>{if(I.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},jW=($,I,U,D)=>{let b=U,w=$._zod.def,{minimum:A,maximum:N}=$._zod.bag;if(typeof A==="number")b.minItems=A;if(typeof N==="number")b.maxItems=N;b.type="array",b.items=N$(w.element,I,{...D,path:[...D.path,"items"]})},SW=($,I,U,D)=>{let b=U,w=$._zod.def;b.type="object",b.properties={};let A=w.shape;for(let X in A)b.properties[X]=N$(A[X],I,{...D,path:[...D.path,"properties",X]});let N=new Set(Object.keys(A)),O=new Set([...N].filter((X)=>{let G=w.shape[X]._zod;if(I.io==="input")return G.optin===void 0;else return G.optout===void 0}));if(O.size>0)b.required=Array.from(O);if(w.catchall?._zod.def.type==="never")b.additionalProperties=!1;else if(!w.catchall){if(I.io==="output")b.additionalProperties=!1}else if(w.catchall)b.additionalProperties=N$(w.catchall,I,{...D,path:[...D.path,"additionalProperties"]})},Ww=($,I,U,D)=>{let b=$._zod.def,w=b.inclusive===!1,A=b.options.map((N,O)=>N$(N,I,{...D,path:[...D.path,w?"oneOf":"anyOf",O]}));if(w)U.oneOf=A;else U.anyOf=A},PW=($,I,U,D)=>{let b=$._zod.def,w=N$(b.left,I,{...D,path:[...D.path,"allOf",0]}),A=N$(b.right,I,{...D,path:[...D.path,"allOf",1]}),N=(X)=>("allOf"in X)&&Object.keys(X).length===1,O=[...N(w)?w.allOf:[w],...N(A)?A.allOf:[A]];U.allOf=O},RW=($,I,U,D)=>{let b=U,w=$._zod.def;b.type="array";let A=I.target==="draft-2020-12"?"prefixItems":"items",N=I.target==="draft-2020-12"?"items":I.target==="openapi-3.0"?"items":"additionalItems",O=w.items.map((Y,B)=>N$(Y,I,{...D,path:[...D.path,A,B]})),X=w.rest?N$(w.rest,I,{...D,path:[...D.path,N,...I.target==="openapi-3.0"?[w.items.length]:[]]}):null;if(I.target==="draft-2020-12"){if(b.prefixItems=O,X)b.items=X}else if(I.target==="openapi-3.0"){if(b.items={anyOf:O},X)b.items.anyOf.push(X);if(b.minItems=O.length,!X)b.maxItems=O.length}else if(b.items=O,X)b.additionalItems=X;let{minimum:G,maximum:Q}=$._zod.bag;if(typeof G==="number")b.minItems=G;if(typeof Q==="number")b.maxItems=Q},TW=($,I,U,D)=>{let b=U,w=$._zod.def;if(b.type="object",I.target==="draft-07"||I.target==="draft-2020-12")b.propertyNames=N$(w.keyType,I,{...D,path:[...D.path,"propertyNames"]});b.additionalProperties=N$(w.valueType,I,{...D,path:[...D.path,"additionalProperties"]})},_W=($,I,U,D)=>{let b=$._zod.def,w=N$(b.innerType,I,D),A=I.seen.get($);if(I.target==="openapi-3.0")A.ref=b.innerType,U.nullable=!0;else U.anyOf=[w,{type:"null"}]},CW=($,I,U,D)=>{let b=$._zod.def;N$(b.innerType,I,D);let w=I.seen.get($);w.ref=b.innerType},ZW=($,I,U,D)=>{let b=$._zod.def;N$(b.innerType,I,D);let w=I.seen.get($);w.ref=b.innerType,U.default=JSON.parse(JSON.stringify(b.defaultValue))},fW=($,I,U,D)=>{let b=$._zod.def;N$(b.innerType,I,D);let w=I.seen.get($);if(w.ref=b.innerType,I.io==="input")U._prefault=JSON.parse(JSON.stringify(b.defaultValue))},gW=($,I,U,D)=>{let b=$._zod.def;N$(b.innerType,I,D);let w=I.seen.get($);w.ref=b.innerType;let A;try{A=b.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}U.default=A},yW=($,I,U,D)=>{let b=$._zod.def,w=I.io==="input"?b.in._zod.def.type==="transform"?b.out:b.in:b.out;N$(w,I,D);let A=I.seen.get($);A.ref=w},xW=($,I,U,D)=>{let b=$._zod.def;N$(b.innerType,I,D);let w=I.seen.get($);w.ref=b.innerType,U.readOnly=!0},lW=($,I,U,D)=>{let b=$._zod.def;N$(b.innerType,I,D);let w=I.seen.get($);w.ref=b.innerType},hW=($,I,U,D)=>{let b=$._zod.def;N$(b.innerType,I,D);let w=I.seen.get($);w.ref=b.innerType},uW=($,I,U,D)=>{let b=$._zod.innerType;N$(b,I,D);let w=I.seen.get($);w.ref=b},Xw={string:DW,number:wW,boolean:AW,bigint:NW,symbol:OW,null:XW,undefined:WW,void:GW,never:QW,any:YW,unknown:BW,date:vW,enum:JW,literal:HW,nan:LW,template_literal:zW,file:VW,success:MW,custom:KW,function:FW,transform:qW,map:kW,set:EW,array:jW,object:SW,union:Ww,intersection:PW,tuple:RW,record:TW,nullable:_W,nonoptional:CW,default:ZW,prefault:fW,catch:gW,pipe:yW,readonly:xW,promise:lW,optional:hW,lazy:uW};function l4($,I){if("_idmap"in $){let D=$,b=N4({...I,processors:Xw}),w={};for(let O of D._idmap.entries()){let[X,G]=O;N$(G,b)}let A={},N={registry:D,uri:I?.uri,defs:w};b.external=N;for(let O of D._idmap.entries()){let[X,G]=O;O4(b,G),A[X]=X4(b,G)}if(Object.keys(w).length>0){let O=b.target==="draft-2020-12"?"$defs":"definitions";A.__shared={[O]:w}}return{schemas:A}}let U=N4({...I,processors:Xw});return N$($,U),O4(U,$),X4(U,$)}class iW{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter($){this.ctx.counter=$}get seen(){return this.ctx.seen}constructor($){let I=$?.target??"draft-2020-12";if(I==="draft-4")I="draft-04";if(I==="draft-7")I="draft-07";this.ctx=N4({processors:Xw,target:I,...$?.metadata&&{metadata:$.metadata},...$?.unrepresentable&&{unrepresentable:$.unrepresentable},...$?.override&&{override:$.override},...$?.io&&{io:$.io}})}process($,I={path:[],schemaPath:[]}){return N$($,this.ctx,I)}emit($,I){if(I){if(I.cycles)this.ctx.cycles=I.cycles;if(I.reused)this.ctx.reused=I.reused;if(I.external)this.ctx.external=I.external}O4(this.ctx,$);let U=X4(this.ctx,$),{"~standard":D,...b}=U;return b}}var LB={};var YF=v("ZodMiniType",($,I)=>{if(!$._zod)throw new Error("Uninitialized schema in ZodMiniType.");n.init($,I),$.def=I,$.type=I.type,$.parse=(U,D)=>_4($,U,D,{callee:$.parse}),$.safeParse=(U,D)=>U4($,U,D),$.parseAsync=async(U,D)=>C4($,U,D,{callee:$.parseAsync}),$.safeParseAsync=async(U,D)=>b4($,U,D),$.check=(...U)=>{return $.clone({...I,checks:[...I.checks??[],...U.map((D)=>typeof D==="function"?{_zod:{check:D,def:{check:"custom"},onattach:[]}}:D)]})},$.clone=(U,D)=>k$($,U,D),$.brand=()=>$,$.register=(U,D)=>{return U.add($,D),$}});var BF=v("ZodMiniObject",($,I)=>{b0.init($,I),YF.init($,I),M.defineLazy($,"shape",()=>I.shape)});function nW($,I){let U={type:"object",shape:$??{},...M.normalizeParams(I)};return new BF(U)}function $6($){return!!$._zod}function h4($){let I=Object.values($);if(I.length===0)return nW({});let U=I.every($6),D=I.every((b)=>!$6(b));if(U)return nW($);if(D)return TY($);throw new Error("Mixed Zod versions detected in object shape.")}function W4($,I){if($6($))return U4($,I);return $.safeParse(I)}async function Gw($,I){if($6($))return await b4($,I);return await $.safeParseAsync(I)}function G4($){if(!$)return;let I;if($6($))I=$._zod?.def?.shape;else I=$.shape;if(!I)return;if(typeof I==="function")try{return I()}catch{return}return I}function TI($){if(!$)return;if(typeof $==="object"){let I=$,U=$;if(!I._def&&!U._zod){let D=Object.values($);if(D.length>0&&D.every((b)=>typeof b==="object"&&b!==null&&(b._def!==void 0||b._zod!==void 0||typeof b.parse==="function")))return h4($)}}if($6($)){let U=$._zod?.def;if(U&&(U.type==="object"||U.shape!==void 0))return $}else if($.shape!==void 0)return $;return}function Qw($){if($&&typeof $==="object"){if("message"in $&&typeof $.message==="string")return $.message;if("issues"in $&&Array.isArray($.issues)&&$.issues.length>0){let I=$.issues[0];if(I&&typeof I==="object"&&"message"in I)return String(I.message)}try{return JSON.stringify($)}catch{return String($)}}return String($)}function zB($){return $.description}function VB($){if($6($))return $._zod?.def?.type==="optional";let I=$;if(typeof $.isOptional==="function")return $.isOptional();return I._def?.typeName==="ZodOptional"}function Yw($){if($6($)){let w=$._zod?.def;if(w){if(w.value!==void 0)return w.value;if(Array.isArray(w.values)&&w.values.length>0)return w.values[0]}}let U=$._def;if(U){if(U.value!==void 0)return U.value;if(Array.isArray(U.values)&&U.values.length>0)return U.values[0]}let D=$.value;if(D!==void 0)return D;return}var W={};Z6(W,{xor:()=>W7,xid:()=>fB,void:()=>A7,uuidv7:()=>jB,uuidv6:()=>EB,uuidv4:()=>kB,uuid:()=>qB,util:()=>M,url:()=>SB,uppercase:()=>VI,unknown:()=>G$,union:()=>Q$,undefined:()=>D7,ulid:()=>ZB,uint64:()=>U7,uint32:()=>sB,tuple:()=>zG,trim:()=>EI,treeifyError:()=>tN,transform:()=>lw,toUpperCase:()=>SI,toLowerCase:()=>jI,toJSONSchema:()=>l4,templateLiteral:()=>M7,symbol:()=>b7,superRefine:()=>nG,success:()=>L7,stringbool:()=>S7,stringFormat:()=>mB,string:()=>H,strictObject:()=>X7,startsWith:()=>KI,slugify:()=>PI,size:()=>HI,setErrorMap:()=>zF,set:()=>B7,safeParseAsync:()=>aW,safeParse:()=>tW,safeEncodeAsync:()=>DG,safeEncode:()=>UG,safeDecodeAsync:()=>wG,safeDecode:()=>bG,registry:()=>P0,regexes:()=>t$,regex:()=>LI,refine:()=>iG,record:()=>O$,readonly:()=>gG,property:()=>Iw,promise:()=>K7,prettifyError:()=>aN,preprocess:()=>PU,prefault:()=>PG,positive:()=>a0,pipe:()=>VU,partialRecord:()=>G7,parseAsync:()=>pW,parse:()=>dW,overwrite:()=>A6,optional:()=>B$,object:()=>T,number:()=>D$,nullish:()=>H7,nullable:()=>zU,null:()=>KU,normalize:()=>kI,nonpositive:()=>s0,nonoptional:()=>RG,nonnegative:()=>$w,never:()=>xw,negative:()=>e0,nativeEnum:()=>v7,nanoid:()=>TB,nan:()=>z7,multipleOf:()=>w4,minSize:()=>A4,minLength:()=>h6,mime:()=>qI,meta:()=>E7,maxSize:()=>f4,maxLength:()=>g4,map:()=>Y7,mac:()=>xB,lte:()=>a$,lt:()=>q6,lowercase:()=>zI,looseRecord:()=>Q7,looseObject:()=>E$,locales:()=>BI,literal:()=>Z,length:()=>y4,lazy:()=>lG,ksuid:()=>gB,keyof:()=>O7,jwt:()=>rB,json:()=>P7,iso:()=>Q4,ipv6:()=>lB,ipv4:()=>yB,intersection:()=>xI,int64:()=>I7,int32:()=>eB,int:()=>zw,instanceof:()=>j7,includes:()=>MI,httpUrl:()=>PB,hostname:()=>oB,hex:()=>dB,hash:()=>pB,guid:()=>FB,gte:()=>g$,gt:()=>k6,globalRegistry:()=>f$,getErrorMap:()=>VF,function:()=>F7,fromJSONSchema:()=>T7,formatError:()=>h1,float64:()=>aB,float32:()=>tB,flattenError:()=>l1,file:()=>J7,enum:()=>j$,endsWith:()=>FI,encodeAsync:()=>$G,encode:()=>eW,emoji:()=>RB,email:()=>KB,e164:()=>cB,discriminatedUnion:()=>EU,describe:()=>k7,decodeAsync:()=>IG,decode:()=>sW,date:()=>N7,custom:()=>nw,cuid2:()=>CB,cuid:()=>_B,core:()=>N6,config:()=>z$,coerce:()=>rG,codec:()=>V7,clone:()=>k$,cidrv6:()=>uB,cidrv4:()=>hB,check:()=>q7,catch:()=>CG,boolean:()=>V$,bigint:()=>$7,base64url:()=>nB,base64:()=>iB,array:()=>p,any:()=>w7,_function:()=>F7,_default:()=>jG,_ZodString:()=>Vw,ZodXor:()=>vG,ZodXID:()=>jw,ZodVoid:()=>YG,ZodUnknown:()=>GG,ZodUnion:()=>kU,ZodUndefined:()=>OG,ZodUUID:()=>E6,ZodURL:()=>MU,ZodULID:()=>Ew,ZodType:()=>m,ZodTuple:()=>LG,ZodTransform:()=>qG,ZodTemplateLiteral:()=>yG,ZodSymbol:()=>NG,ZodSuccess:()=>TG,ZodStringFormat:()=>W$,ZodString:()=>CI,ZodSet:()=>MG,ZodRecord:()=>jU,ZodRealError:()=>n$,ZodReadonly:()=>fG,ZodPromise:()=>hG,ZodPrefault:()=>SG,ZodPipe:()=>uw,ZodOptional:()=>lI,ZodObject:()=>qU,ZodNumberFormat:()=>u4,ZodNumber:()=>fI,ZodNullable:()=>kG,ZodNull:()=>XG,ZodNonOptional:()=>hw,ZodNever:()=>QG,ZodNanoID:()=>Fw,ZodNaN:()=>ZG,ZodMap:()=>VG,ZodMAC:()=>AG,ZodLiteral:()=>KG,ZodLazy:()=>xG,ZodKSUID:()=>Sw,ZodJWT:()=>gw,ZodIssueCode:()=>LF,ZodIntersection:()=>HG,ZodISOTime:()=>Hw,ZodISODuration:()=>Lw,ZodISODateTime:()=>vw,ZodISODate:()=>Jw,ZodIPv6:()=>Rw,ZodIPv4:()=>Pw,ZodGUID:()=>LU,ZodFunction:()=>uG,ZodFirstPartyTypeKind:()=>cG,ZodFile:()=>FG,ZodError:()=>JF,ZodEnum:()=>_I,ZodEmoji:()=>Kw,ZodEmail:()=>Mw,ZodE164:()=>fw,ZodDiscriminatedUnion:()=>JG,ZodDefault:()=>EG,ZodDate:()=>FU,ZodCustomStringFormat:()=>ZI,ZodCustom:()=>SU,ZodCodec:()=>iw,ZodCatch:()=>_G,ZodCUID2:()=>kw,ZodCUID:()=>qw,ZodCIDRv6:()=>_w,ZodCIDRv4:()=>Tw,ZodBoolean:()=>gI,ZodBigIntFormat:()=>yw,ZodBigInt:()=>yI,ZodBase64URL:()=>Zw,ZodBase64:()=>Cw,ZodArray:()=>BG,ZodAny:()=>WG,TimePrecision:()=>oX,NEVER:()=>lN,$output:()=>nX,$input:()=>cX,$brand:()=>hN});var HU={};Z6(HU,{xor:()=>W7,xid:()=>fB,void:()=>A7,uuidv7:()=>jB,uuidv6:()=>EB,uuidv4:()=>kB,uuid:()=>qB,url:()=>SB,unknown:()=>G$,union:()=>Q$,undefined:()=>D7,ulid:()=>ZB,uint64:()=>U7,uint32:()=>sB,tuple:()=>zG,transform:()=>lw,templateLiteral:()=>M7,symbol:()=>b7,superRefine:()=>nG,success:()=>L7,stringbool:()=>S7,stringFormat:()=>mB,string:()=>H,strictObject:()=>X7,set:()=>B7,refine:()=>iG,record:()=>O$,readonly:()=>gG,promise:()=>K7,preprocess:()=>PU,prefault:()=>PG,pipe:()=>VU,partialRecord:()=>G7,optional:()=>B$,object:()=>T,number:()=>D$,nullish:()=>H7,nullable:()=>zU,null:()=>KU,nonoptional:()=>RG,never:()=>xw,nativeEnum:()=>v7,nanoid:()=>TB,nan:()=>z7,meta:()=>E7,map:()=>Y7,mac:()=>xB,looseRecord:()=>Q7,looseObject:()=>E$,literal:()=>Z,lazy:()=>lG,ksuid:()=>gB,keyof:()=>O7,jwt:()=>rB,json:()=>P7,ipv6:()=>lB,ipv4:()=>yB,intersection:()=>xI,int64:()=>I7,int32:()=>eB,int:()=>zw,instanceof:()=>j7,httpUrl:()=>PB,hostname:()=>oB,hex:()=>dB,hash:()=>pB,guid:()=>FB,function:()=>F7,float64:()=>aB,float32:()=>tB,file:()=>J7,enum:()=>j$,emoji:()=>RB,email:()=>KB,e164:()=>cB,discriminatedUnion:()=>EU,describe:()=>k7,date:()=>N7,custom:()=>nw,cuid2:()=>CB,cuid:()=>_B,codec:()=>V7,cidrv6:()=>uB,cidrv4:()=>hB,check:()=>q7,catch:()=>CG,boolean:()=>V$,bigint:()=>$7,base64url:()=>nB,base64:()=>iB,array:()=>p,any:()=>w7,_function:()=>F7,_default:()=>jG,_ZodString:()=>Vw,ZodXor:()=>vG,ZodXID:()=>jw,ZodVoid:()=>YG,ZodUnknown:()=>GG,ZodUnion:()=>kU,ZodUndefined:()=>OG,ZodUUID:()=>E6,ZodURL:()=>MU,ZodULID:()=>Ew,ZodType:()=>m,ZodTuple:()=>LG,ZodTransform:()=>qG,ZodTemplateLiteral:()=>yG,ZodSymbol:()=>NG,ZodSuccess:()=>TG,ZodStringFormat:()=>W$,ZodString:()=>CI,ZodSet:()=>MG,ZodRecord:()=>jU,ZodReadonly:()=>fG,ZodPromise:()=>hG,ZodPrefault:()=>SG,ZodPipe:()=>uw,ZodOptional:()=>lI,ZodObject:()=>qU,ZodNumberFormat:()=>u4,ZodNumber:()=>fI,ZodNullable:()=>kG,ZodNull:()=>XG,ZodNonOptional:()=>hw,ZodNever:()=>QG,ZodNanoID:()=>Fw,ZodNaN:()=>ZG,ZodMap:()=>VG,ZodMAC:()=>AG,ZodLiteral:()=>KG,ZodLazy:()=>xG,ZodKSUID:()=>Sw,ZodJWT:()=>gw,ZodIntersection:()=>HG,ZodIPv6:()=>Rw,ZodIPv4:()=>Pw,ZodGUID:()=>LU,ZodFunction:()=>uG,ZodFile:()=>FG,ZodEnum:()=>_I,ZodEmoji:()=>Kw,ZodEmail:()=>Mw,ZodE164:()=>fw,ZodDiscriminatedUnion:()=>JG,ZodDefault:()=>EG,ZodDate:()=>FU,ZodCustomStringFormat:()=>ZI,ZodCustom:()=>SU,ZodCodec:()=>iw,ZodCatch:()=>_G,ZodCUID2:()=>kw,ZodCUID:()=>qw,ZodCIDRv6:()=>_w,ZodCIDRv4:()=>Tw,ZodBoolean:()=>gI,ZodBigIntFormat:()=>yw,ZodBigInt:()=>yI,ZodBase64URL:()=>Zw,ZodBase64:()=>Cw,ZodArray:()=>BG,ZodAny:()=>WG});var Bw={};Z6(Bw,{uppercase:()=>VI,trim:()=>EI,toUpperCase:()=>SI,toLowerCase:()=>jI,startsWith:()=>KI,slugify:()=>PI,size:()=>HI,regex:()=>LI,property:()=>Iw,positive:()=>a0,overwrite:()=>A6,normalize:()=>kI,nonpositive:()=>s0,nonnegative:()=>$w,negative:()=>e0,multipleOf:()=>w4,minSize:()=>A4,minLength:()=>h6,mime:()=>qI,maxSize:()=>f4,maxLength:()=>g4,lte:()=>a$,lt:()=>q6,lowercase:()=>zI,length:()=>y4,includes:()=>MI,gte:()=>g$,gt:()=>k6,endsWith:()=>FI});var Q4={};Z6(Q4,{time:()=>mW,duration:()=>oW,datetime:()=>cW,date:()=>rW,ZodISOTime:()=>Hw,ZodISODuration:()=>Lw,ZodISODateTime:()=>vw,ZodISODate:()=>Jw});var vw=v("ZodISODateTime",($,I)=>{oO.init($,I),W$.init($,I)});function cW($){return dX(vw,$)}var Jw=v("ZodISODate",($,I)=>{dO.init($,I),W$.init($,I)});function rW($){return pX(Jw,$)}var Hw=v("ZodISOTime",($,I)=>{pO.init($,I),W$.init($,I)});function mW($){return tX(Hw,$)}var Lw=v("ZodISODuration",($,I)=>{tO.init($,I),W$.init($,I)});function oW($){return aX(Lw,$)}var MB=($,I)=>{x1.init($,I),$.name="ZodError",Object.defineProperties($,{format:{value:(U)=>h1($,U)},flatten:{value:(U)=>l1($,U)},addIssue:{value:(U)=>{$.issues.push(U),$.message=JSON.stringify($.issues,bI,2)}},addIssues:{value:(U)=>{$.issues.push(...U),$.message=JSON.stringify($.issues,bI,2)}},isEmpty:{get(){return $.issues.length===0}}})},JF=v("ZodError",MB),n$=v("ZodError",MB,{Parent:Error});var dW=AI(n$),pW=NI(n$),tW=OI(n$),aW=XI(n$),eW=OD(n$),sW=XD(n$),$G=WD(n$),IG=GD(n$),UG=QD(n$),bG=YD(n$),DG=BD(n$),wG=vD(n$);var m=v("ZodType",($,I)=>{return n.init($,I),Object.assign($["~standard"],{jsonSchema:{input:RI($,"input"),output:RI($,"output")}}),$.toJSONSchema=bW($,{}),$.def=I,$.type=I.type,Object.defineProperty($,"_def",{value:I}),$.check=(...U)=>{return $.clone(M.mergeDefs(I,{checks:[...I.checks??[],...U.map((D)=>typeof D==="function"?{_zod:{check:D,def:{check:"custom"},onattach:[]}}:D)]}))},$.clone=(U,D)=>k$($,U,D),$.brand=()=>$,$.register=(U,D)=>{return U.add($,D),$},$.parse=(U,D)=>dW($,U,D,{callee:$.parse}),$.safeParse=(U,D)=>tW($,U,D),$.parseAsync=async(U,D)=>pW($,U,D,{callee:$.parseAsync}),$.safeParseAsync=async(U,D)=>aW($,U,D),$.spa=$.safeParseAsync,$.encode=(U,D)=>eW($,U,D),$.decode=(U,D)=>sW($,U,D),$.encodeAsync=async(U,D)=>$G($,U,D),$.decodeAsync=async(U,D)=>IG($,U,D),$.safeEncode=(U,D)=>UG($,U,D),$.safeDecode=(U,D)=>bG($,U,D),$.safeEncodeAsync=async(U,D)=>DG($,U,D),$.safeDecodeAsync=async(U,D)=>wG($,U,D),$.refine=(U,D)=>$.check(iG(U,D)),$.superRefine=(U)=>$.check(nG(U)),$.overwrite=(U)=>$.check(A6(U)),$.optional=()=>B$($),$.nullable=()=>zU($),$.nullish=()=>B$(zU($)),$.nonoptional=(U)=>RG($,U),$.array=()=>p($),$.or=(U)=>Q$([$,U]),$.and=(U)=>xI($,U),$.transform=(U)=>VU($,lw(U)),$.default=(U)=>jG($,U),$.prefault=(U)=>PG($,U),$.catch=(U)=>CG($,U),$.pipe=(U)=>VU($,U),$.readonly=()=>gG($),$.describe=(U)=>{let D=$.clone();return f$.add(D,{description:U}),D},Object.defineProperty($,"description",{get(){return f$.get($)?.description},configurable:!0}),$.meta=(...U)=>{if(U.length===0)return f$.get($);let D=$.clone();return f$.add(D,U[0]),D},$.isOptional=()=>$.safeParse(void 0).success,$.isNullable=()=>$.safeParse(null).success,$}),Vw=v("_ZodString",($,I)=>{D4.init($,I),m.init($,I),$._zod.processJSONSchema=(D,b,w)=>DW($,D,b,w);let U=$._zod.bag;$.format=U.format??null,$.minLength=U.minimum??null,$.maxLength=U.maximum??null,$.regex=(...D)=>$.check(LI(...D)),$.includes=(...D)=>$.check(MI(...D)),$.startsWith=(...D)=>$.check(KI(...D)),$.endsWith=(...D)=>$.check(FI(...D)),$.min=(...D)=>$.check(h6(...D)),$.max=(...D)=>$.check(g4(...D)),$.length=(...D)=>$.check(y4(...D)),$.nonempty=(...D)=>$.check(h6(1,...D)),$.lowercase=(D)=>$.check(zI(D)),$.uppercase=(D)=>$.check(VI(D)),$.trim=()=>$.check(EI()),$.normalize=(...D)=>$.check(kI(...D)),$.toLowerCase=()=>$.check(jI()),$.toUpperCase=()=>$.check(SI()),$.slugify=()=>$.check(PI())}),CI=v("ZodString",($,I)=>{D4.init($,I),Vw.init($,I),$.email=(U)=>$.check(a1(Mw,U)),$.url=(U)=>$.check(JI(MU,U)),$.jwt=(U)=>$.check(JU(gw,U)),$.emoji=(U)=>$.check(UU(Kw,U)),$.guid=(U)=>$.check(vI(LU,U)),$.uuid=(U)=>$.check(e1(E6,U)),$.uuidv4=(U)=>$.check(s1(E6,U)),$.uuidv6=(U)=>$.check($U(E6,U)),$.uuidv7=(U)=>$.check(IU(E6,U)),$.nanoid=(U)=>$.check(bU(Fw,U)),$.guid=(U)=>$.check(vI(LU,U)),$.cuid=(U)=>$.check(DU(qw,U)),$.cuid2=(U)=>$.check(wU(kw,U)),$.ulid=(U)=>$.check(AU(Ew,U)),$.base64=(U)=>$.check(YU(Cw,U)),$.base64url=(U)=>$.check(BU(Zw,U)),$.xid=(U)=>$.check(NU(jw,U)),$.ksuid=(U)=>$.check(OU(Sw,U)),$.ipv4=(U)=>$.check(XU(Pw,U)),$.ipv6=(U)=>$.check(WU(Rw,U)),$.cidrv4=(U)=>$.check(GU(Tw,U)),$.cidrv6=(U)=>$.check(QU(_w,U)),$.e164=(U)=>$.check(vU(fw,U)),$.datetime=(U)=>$.check(cW(U)),$.date=(U)=>$.check(rW(U)),$.time=(U)=>$.check(mW(U)),$.duration=(U)=>$.check(oW(U))});function H($){return R0(CI,$)}var W$=v("ZodStringFormat",($,I)=>{A$.init($,I),Vw.init($,I)}),Mw=v("ZodEmail",($,I)=>{jD.init($,I),W$.init($,I)});function KB($){return a1(Mw,$)}var LU=v("ZodGUID",($,I)=>{kD.init($,I),W$.init($,I)});function FB($){return vI(LU,$)}var E6=v("ZodUUID",($,I)=>{ED.init($,I),W$.init($,I)});function qB($){return e1(E6,$)}function kB($){return s1(E6,$)}function EB($){return $U(E6,$)}function jB($){return IU(E6,$)}var MU=v("ZodURL",($,I)=>{SD.init($,I),W$.init($,I)});function SB($){return JI(MU,$)}function PB($){return JI(MU,{protocol:/^https?$/,hostname:t$.domain,...M.normalizeParams($)})}var Kw=v("ZodEmoji",($,I)=>{PD.init($,I),W$.init($,I)});function RB($){return UU(Kw,$)}var Fw=v("ZodNanoID",($,I)=>{RD.init($,I),W$.init($,I)});function TB($){return bU(Fw,$)}var qw=v("ZodCUID",($,I)=>{TD.init($,I),W$.init($,I)});function _B($){return DU(qw,$)}var kw=v("ZodCUID2",($,I)=>{_D.init($,I),W$.init($,I)});function CB($){return wU(kw,$)}var Ew=v("ZodULID",($,I)=>{CD.init($,I),W$.init($,I)});function ZB($){return AU(Ew,$)}var jw=v("ZodXID",($,I)=>{ZD.init($,I),W$.init($,I)});function fB($){return NU(jw,$)}var Sw=v("ZodKSUID",($,I)=>{fD.init($,I),W$.init($,I)});function gB($){return OU(Sw,$)}var Pw=v("ZodIPv4",($,I)=>{gD.init($,I),W$.init($,I)});function yB($){return XU(Pw,$)}var AG=v("ZodMAC",($,I)=>{xD.init($,I),W$.init($,I)});function xB($){return T0(AG,$)}var Rw=v("ZodIPv6",($,I)=>{yD.init($,I),W$.init($,I)});function lB($){return WU(Rw,$)}var Tw=v("ZodCIDRv4",($,I)=>{lD.init($,I),W$.init($,I)});function hB($){return GU(Tw,$)}var _w=v("ZodCIDRv6",($,I)=>{hD.init($,I),W$.init($,I)});function uB($){return QU(_w,$)}var Cw=v("ZodBase64",($,I)=>{uD.init($,I),W$.init($,I)});function iB($){return YU(Cw,$)}var Zw=v("ZodBase64URL",($,I)=>{iD.init($,I),W$.init($,I)});function nB($){return BU(Zw,$)}var fw=v("ZodE164",($,I)=>{nD.init($,I),W$.init($,I)});function cB($){return vU(fw,$)}var gw=v("ZodJWT",($,I)=>{cD.init($,I),W$.init($,I)});function rB($){return JU(gw,$)}var ZI=v("ZodCustomStringFormat",($,I)=>{rD.init($,I),W$.init($,I)});function mB($,I,U={}){return x4(ZI,$,I,U)}function oB($){return x4(ZI,"hostname",t$.hostname,$)}function dB($){return x4(ZI,"hex",t$.hex,$)}function pB($,I){let U=I?.enc??"hex",D=`${$}_${U}`,b=t$[D];if(!b)throw new Error(`Unrecognized hash format: ${D}`);return x4(ZI,D,b,I)}var fI=v("ZodNumber",($,I)=>{n1.init($,I),m.init($,I),$._zod.processJSONSchema=(D,b,w)=>wW($,D,b,w),$.gt=(D,b)=>$.check(k6(D,b)),$.gte=(D,b)=>$.check(g$(D,b)),$.min=(D,b)=>$.check(g$(D,b)),$.lt=(D,b)=>$.check(q6(D,b)),$.lte=(D,b)=>$.check(a$(D,b)),$.max=(D,b)=>$.check(a$(D,b)),$.int=(D)=>$.check(zw(D)),$.safe=(D)=>$.check(zw(D)),$.positive=(D)=>$.check(k6(0,D)),$.nonnegative=(D)=>$.check(g$(0,D)),$.negative=(D)=>$.check(q6(0,D)),$.nonpositive=(D)=>$.check(a$(0,D)),$.multipleOf=(D,b)=>$.check(w4(D,b)),$.step=(D,b)=>$.check(w4(D,b)),$.finite=()=>$;let U=$._zod.bag;$.minValue=Math.max(U.minimum??Number.NEGATIVE_INFINITY,U.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,$.maxValue=Math.min(U.maximum??Number.POSITIVE_INFINITY,U.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,$.isInt=(U.format??"").includes("int")||Number.isSafeInteger(U.multipleOf??0.5),$.isFinite=!0,$.format=U.format??null});function D$($){return _0(fI,$)}var u4=v("ZodNumberFormat",($,I)=>{mD.init($,I),fI.init($,I)});function zw($){return C0(u4,$)}function tB($){return Z0(u4,$)}function aB($){return f0(u4,$)}function eB($){return g0(u4,$)}function sB($){return y0(u4,$)}var gI=v("ZodBoolean",($,I)=>{GI.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>AW($,U,D,b)});function V$($){return x0(gI,$)}var yI=v("ZodBigInt",($,I)=>{c1.init($,I),m.init($,I),$._zod.processJSONSchema=(D,b,w)=>NW($,D,b,w),$.gte=(D,b)=>$.check(g$(D,b)),$.min=(D,b)=>$.check(g$(D,b)),$.gt=(D,b)=>$.check(k6(D,b)),$.gte=(D,b)=>$.check(g$(D,b)),$.min=(D,b)=>$.check(g$(D,b)),$.lt=(D,b)=>$.check(q6(D,b)),$.lte=(D,b)=>$.check(a$(D,b)),$.max=(D,b)=>$.check(a$(D,b)),$.positive=(D)=>$.check(k6(BigInt(0),D)),$.negative=(D)=>$.check(q6(BigInt(0),D)),$.nonpositive=(D)=>$.check(a$(BigInt(0),D)),$.nonnegative=(D)=>$.check(g$(BigInt(0),D)),$.multipleOf=(D,b)=>$.check(w4(D,b));let U=$._zod.bag;$.minValue=U.minimum??null,$.maxValue=U.maximum??null,$.format=U.format??null});function $7($){return l0(yI,$)}var yw=v("ZodBigIntFormat",($,I)=>{oD.init($,I),yI.init($,I)});function I7($){return h0(yw,$)}function U7($){return u0(yw,$)}var NG=v("ZodSymbol",($,I)=>{dD.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>OW($,U,D,b)});function b7($){return i0(NG,$)}var OG=v("ZodUndefined",($,I)=>{pD.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>WW($,U,D,b)});function D7($){return n0(OG,$)}var XG=v("ZodNull",($,I)=>{tD.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>XW($,U,D,b)});function KU($){return c0(XG,$)}var WG=v("ZodAny",($,I)=>{aD.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>YW($,U,D,b)});function w7(){return r0(WG)}var GG=v("ZodUnknown",($,I)=>{eD.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>BW($,U,D,b)});function G$(){return m0(GG)}var QG=v("ZodNever",($,I)=>{sD.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>QW($,U,D,b)});function xw($){return o0(QG,$)}var YG=v("ZodVoid",($,I)=>{$0.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>GW($,U,D,b)});function A7($){return d0(YG,$)}var FU=v("ZodDate",($,I)=>{I0.init($,I),m.init($,I),$._zod.processJSONSchema=(D,b,w)=>vW($,D,b,w),$.min=(D,b)=>$.check(g$(D,b)),$.max=(D,b)=>$.check(a$(D,b));let U=$._zod.bag;$.minDate=U.minimum?new Date(U.minimum):null,$.maxDate=U.maximum?new Date(U.maximum):null});function N7($){return p0(FU,$)}var BG=v("ZodArray",($,I)=>{U0.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>jW($,U,D,b),$.element=I.element,$.min=(U,D)=>$.check(h6(U,D)),$.nonempty=(U)=>$.check(h6(1,U)),$.max=(U,D)=>$.check(g4(U,D)),$.length=(U,D)=>$.check(y4(U,D)),$.unwrap=()=>$.element});function p($,I){return UW(BG,$,I)}function O7($){let I=$._zod.def.shape;return j$(Object.keys(I))}var qU=v("ZodObject",($,I)=>{eO.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>SW($,U,D,b),M.defineLazy($,"shape",()=>{return I.shape}),$.keyof=()=>j$(Object.keys($._zod.def.shape)),$.catchall=(U)=>$.clone({...$._zod.def,catchall:U}),$.passthrough=()=>$.clone({...$._zod.def,catchall:G$()}),$.loose=()=>$.clone({...$._zod.def,catchall:G$()}),$.strict=()=>$.clone({...$._zod.def,catchall:xw()}),$.strip=()=>$.clone({...$._zod.def,catchall:void 0}),$.extend=(U)=>{return M.extend($,U)},$.safeExtend=(U)=>{return M.safeExtend($,U)},$.merge=(U)=>M.merge($,U),$.pick=(U)=>M.pick($,U),$.omit=(U)=>M.omit($,U),$.partial=(...U)=>M.partial(lI,$,U[0]),$.required=(...U)=>M.required(hw,$,U[0])});function T($,I){let U={type:"object",shape:$??{},...M.normalizeParams(I)};return new qU(U)}function X7($,I){return new qU({type:"object",shape:$,catchall:xw(),...M.normalizeParams(I)})}function E$($,I){return new qU({type:"object",shape:$,catchall:G$(),...M.normalizeParams(I)})}var kU=v("ZodUnion",($,I)=>{QI.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>Ww($,U,D,b),$.options=I.options});function Q$($,I){return new kU({type:"union",options:$,...M.normalizeParams(I)})}var vG=v("ZodXor",($,I)=>{kU.init($,I),D0.init($,I),$._zod.processJSONSchema=(U,D,b)=>Ww($,U,D,b),$.options=I.options});function W7($,I){return new vG({type:"union",options:$,inclusive:!1,...M.normalizeParams(I)})}var JG=v("ZodDiscriminatedUnion",($,I)=>{kU.init($,I),w0.init($,I)});function EU($,I,U){return new JG({type:"union",options:I,discriminator:$,...M.normalizeParams(U)})}var HG=v("ZodIntersection",($,I)=>{A0.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>PW($,U,D,b)});function xI($,I){return new HG({type:"intersection",left:$,right:I})}var LG=v("ZodTuple",($,I)=>{r1.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>RW($,U,D,b),$.rest=(U)=>$.clone({...$._zod.def,rest:U})});function zG($,I,U){let D=I instanceof n,b=D?U:I;return new LG({type:"tuple",items:$,rest:D?I:null,...M.normalizeParams(b)})}var jU=v("ZodRecord",($,I)=>{N0.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>TW($,U,D,b),$.keyType=I.keyType,$.valueType=I.valueType});function O$($,I,U){return new jU({type:"record",keyType:$,valueType:I,...M.normalizeParams(U)})}function G7($,I,U){let D=k$($);return D._zod.values=void 0,new jU({type:"record",keyType:D,valueType:I,...M.normalizeParams(U)})}function Q7($,I,U){return new jU({type:"record",keyType:$,valueType:I,mode:"loose",...M.normalizeParams(U)})}var VG=v("ZodMap",($,I)=>{O0.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>kW($,U,D,b),$.keyType=I.keyType,$.valueType=I.valueType});function Y7($,I,U){return new VG({type:"map",keyType:$,valueType:I,...M.normalizeParams(U)})}var MG=v("ZodSet",($,I)=>{X0.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>EW($,U,D,b),$.min=(...U)=>$.check(A4(...U)),$.nonempty=(U)=>$.check(A4(1,U)),$.max=(...U)=>$.check(f4(...U)),$.size=(...U)=>$.check(HI(...U))});function B7($,I){return new MG({type:"set",valueType:$,...M.normalizeParams(I)})}var _I=v("ZodEnum",($,I)=>{W0.init($,I),m.init($,I),$._zod.processJSONSchema=(D,b,w)=>JW($,D,b,w),$.enum=I.entries,$.options=Object.values(I.entries);let U=new Set(Object.keys(I.entries));$.extract=(D,b)=>{let w={};for(let A of D)if(U.has(A))w[A]=I.entries[A];else throw new Error(`Key ${A} not found in enum`);return new _I({...I,checks:[],...M.normalizeParams(b),entries:w})},$.exclude=(D,b)=>{let w={...I.entries};for(let A of D)if(U.has(A))delete w[A];else throw new Error(`Key ${A} not found in enum`);return new _I({...I,checks:[],...M.normalizeParams(b),entries:w})}});function j$($,I){let U=Array.isArray($)?Object.fromEntries($.map((D)=>[D,D])):$;return new _I({type:"enum",entries:U,...M.normalizeParams(I)})}function v7($,I){return new _I({type:"enum",entries:$,...M.normalizeParams(I)})}var KG=v("ZodLiteral",($,I)=>{G0.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>HW($,U,D,b),$.values=new Set(I.values),Object.defineProperty($,"value",{get(){if(I.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return I.values[0]}})});function Z($,I){return new KG({type:"literal",values:Array.isArray($)?$:[$],...M.normalizeParams(I)})}var FG=v("ZodFile",($,I)=>{Q0.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>VW($,U,D,b),$.min=(U,D)=>$.check(A4(U,D)),$.max=(U,D)=>$.check(f4(U,D)),$.mime=(U,D)=>$.check(qI(Array.isArray(U)?U:[U],D))});function J7($){return Uw(FG,$)}var qG=v("ZodTransform",($,I)=>{Y0.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>qW($,U,D,b),$._zod.parse=(U,D)=>{if(D.direction==="backward")throw new R4($.constructor.name);U.addIssue=(w)=>{if(typeof w==="string")U.issues.push(M.issue(w,U.value,I));else{let A=w;if(A.fatal)A.continue=!1;A.code??(A.code="custom"),A.input??(A.input=U.value),A.inst??(A.inst=$),U.issues.push(M.issue(A))}};let b=I.transform(U.value,U);if(b instanceof Promise)return b.then((w)=>{return U.value=w,U});return U.value=b,U}});function lw($){return new qG({type:"transform",transform:$})}var lI=v("ZodOptional",($,I)=>{B0.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>hW($,U,D,b),$.unwrap=()=>$._zod.def.innerType});function B$($){return new lI({type:"optional",innerType:$})}var kG=v("ZodNullable",($,I)=>{v0.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>_W($,U,D,b),$.unwrap=()=>$._zod.def.innerType});function zU($){return new kG({type:"nullable",innerType:$})}function H7($){return B$(zU($))}var EG=v("ZodDefault",($,I)=>{J0.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>ZW($,U,D,b),$.unwrap=()=>$._zod.def.innerType,$.removeDefault=$.unwrap});function jG($,I){return new EG({type:"default",innerType:$,get defaultValue(){return typeof I==="function"?I():M.shallowClone(I)}})}var SG=v("ZodPrefault",($,I)=>{H0.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>fW($,U,D,b),$.unwrap=()=>$._zod.def.innerType});function PG($,I){return new SG({type:"prefault",innerType:$,get defaultValue(){return typeof I==="function"?I():M.shallowClone(I)}})}var hw=v("ZodNonOptional",($,I)=>{L0.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>CW($,U,D,b),$.unwrap=()=>$._zod.def.innerType});function RG($,I){return new hw({type:"nonoptional",innerType:$,...M.normalizeParams(I)})}var TG=v("ZodSuccess",($,I)=>{z0.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>MW($,U,D,b),$.unwrap=()=>$._zod.def.innerType});function L7($){return new TG({type:"success",innerType:$})}var _G=v("ZodCatch",($,I)=>{V0.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>gW($,U,D,b),$.unwrap=()=>$._zod.def.innerType,$.removeCatch=$.unwrap});function CG($,I){return new _G({type:"catch",innerType:$,catchValue:typeof I==="function"?I:()=>I})}var ZG=v("ZodNaN",($,I)=>{M0.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>LW($,U,D,b)});function z7($){return t0(ZG,$)}var uw=v("ZodPipe",($,I)=>{K0.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>yW($,U,D,b),$.in=I.in,$.out=I.out});function VU($,I){return new uw({type:"pipe",in:$,out:I})}var iw=v("ZodCodec",($,I)=>{uw.init($,I),YI.init($,I)});function V7($,I,U){return new iw({type:"pipe",in:$,out:I,transform:U.decode,reverseTransform:U.encode})}var fG=v("ZodReadonly",($,I)=>{F0.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>xW($,U,D,b),$.unwrap=()=>$._zod.def.innerType});function gG($){return new fG({type:"readonly",innerType:$})}var yG=v("ZodTemplateLiteral",($,I)=>{q0.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>zW($,U,D,b)});function M7($,I){return new yG({type:"template_literal",parts:$,...M.normalizeParams(I)})}var xG=v("ZodLazy",($,I)=>{j0.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>uW($,U,D,b),$.unwrap=()=>$._zod.def.getter()});function lG($){return new xG({type:"lazy",getter:$})}var hG=v("ZodPromise",($,I)=>{E0.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>lW($,U,D,b),$.unwrap=()=>$._zod.def.innerType});function K7($){return new hG({type:"promise",innerType:$})}var uG=v("ZodFunction",($,I)=>{k0.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>FW($,U,D,b)});function F7($){return new uG({type:"function",input:Array.isArray($?.input)?zG($?.input):$?.input??p(G$()),output:$?.output??G$()})}var SU=v("ZodCustom",($,I)=>{S0.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>KW($,U,D,b)});function q7($){let I=new X$({check:"custom"});return I._zod.check=$,I}function nw($,I){return bw(SU,$??(()=>!0),I)}function iG($,I={}){return Dw(SU,$,I)}function nG($){return ww($)}var k7=Aw,E7=Nw;function j7($,I={error:`Input not instance of ${$.name}`}){let U=new SU({type:"custom",check:"custom",fn:(D)=>D instanceof $,abort:!0,...M.normalizeParams(I)});return U._zod.bag.Class=$,U}var S7=(...$)=>Ow({Codec:iw,Boolean:gI,String:CI},...$);function P7($){let I=lG(()=>{return Q$([H($),D$(),V$(),KU(),p(I),O$(H(),I)])});return I}function PU($,I){return VU(lw($),I)}var LF={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function zF($){z$({customError:$})}function VF(){return z$().customError}var cG;(function($){})(cG||(cG={}));var P={...HU,...Bw,iso:Q4};function MF($,I){let U=$.$schema;if(U==="https://json-schema.org/draft/2020-12/schema")return"draft-2020-12";if(U==="http://json-schema.org/draft-07/schema#")return"draft-7";if(U==="http://json-schema.org/draft-04/schema#")return"draft-4";return I??"draft-2020-12"}function KF($,I){if(!$.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let U=$.slice(1).split("/").filter(Boolean);if(U.length===0)return I.rootSchema;let D=I.version==="draft-2020-12"?"$defs":"definitions";if(U[0]===D){let b=U[1];if(!b||!I.defs[b])throw new Error(`Reference not found: ${$}`);return I.defs[b]}throw new Error(`Reference not found: ${$}`)}function R7($,I){if($.not!==void 0){if(typeof $.not==="object"&&Object.keys($.not).length===0)return P.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if($.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if($.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if($.if!==void 0||$.then!==void 0||$.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if($.dependentSchemas!==void 0||$.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if($.$ref){let b=$.$ref;if(I.refs.has(b))return I.refs.get(b);if(I.processing.has(b))return P.lazy(()=>{if(!I.refs.has(b))throw new Error(`Circular reference not resolved: ${b}`);return I.refs.get(b)});I.processing.add(b);let w=KF(b,I),A=_$(w,I);return I.refs.set(b,A),I.processing.delete(b),A}if($.enum!==void 0){let b=$.enum;if(I.version==="openapi-3.0"&&$.nullable===!0&&b.length===1&&b[0]===null)return P.null();if(b.length===0)return P.never();if(b.length===1)return P.literal(b[0]);if(b.every((A)=>typeof A==="string"))return P.enum(b);let w=b.map((A)=>P.literal(A));if(w.length<2)return w[0];return P.union([w[0],w[1],...w.slice(2)])}if($.const!==void 0)return P.literal($.const);let U=$.type;if(Array.isArray(U)){let b=U.map((w)=>{let A={...$,type:w};return R7(A,I)});if(b.length===0)return P.never();if(b.length===1)return b[0];return P.union(b)}if(!U)return P.any();let D;switch(U){case"string":{let b=P.string();if($.format){let w=$.format;if(w==="email")b=b.check(P.email());else if(w==="uri"||w==="uri-reference")b=b.check(P.url());else if(w==="uuid"||w==="guid")b=b.check(P.uuid());else if(w==="date-time")b=b.check(P.iso.datetime());else if(w==="date")b=b.check(P.iso.date());else if(w==="time")b=b.check(P.iso.time());else if(w==="duration")b=b.check(P.iso.duration());else if(w==="ipv4")b=b.check(P.ipv4());else if(w==="ipv6")b=b.check(P.ipv6());else if(w==="mac")b=b.check(P.mac());else if(w==="cidr")b=b.check(P.cidrv4());else if(w==="cidr-v6")b=b.check(P.cidrv6());else if(w==="base64")b=b.check(P.base64());else if(w==="base64url")b=b.check(P.base64url());else if(w==="e164")b=b.check(P.e164());else if(w==="jwt")b=b.check(P.jwt());else if(w==="emoji")b=b.check(P.emoji());else if(w==="nanoid")b=b.check(P.nanoid());else if(w==="cuid")b=b.check(P.cuid());else if(w==="cuid2")b=b.check(P.cuid2());else if(w==="ulid")b=b.check(P.ulid());else if(w==="xid")b=b.check(P.xid());else if(w==="ksuid")b=b.check(P.ksuid())}if(typeof $.minLength==="number")b=b.min($.minLength);if(typeof $.maxLength==="number")b=b.max($.maxLength);if($.pattern)b=b.regex(new RegExp($.pattern));D=b;break}case"number":case"integer":{let b=U==="integer"?P.number().int():P.number();if(typeof $.minimum==="number")b=b.min($.minimum);if(typeof $.maximum==="number")b=b.max($.maximum);if(typeof $.exclusiveMinimum==="number")b=b.gt($.exclusiveMinimum);else if($.exclusiveMinimum===!0&&typeof $.minimum==="number")b=b.gt($.minimum);if(typeof $.exclusiveMaximum==="number")b=b.lt($.exclusiveMaximum);else if($.exclusiveMaximum===!0&&typeof $.maximum==="number")b=b.lt($.maximum);if(typeof $.multipleOf==="number")b=b.multipleOf($.multipleOf);D=b;break}case"boolean":{D=P.boolean();break}case"null":{D=P.null();break}case"object":{let b={},w=$.properties||{},A=new Set($.required||[]);for(let[O,X]of Object.entries(w)){let G=_$(X,I);b[O]=A.has(O)?G:G.optional()}if($.propertyNames){let O=_$($.propertyNames,I),X=$.additionalProperties&&typeof $.additionalProperties==="object"?_$($.additionalProperties,I):P.any();if(Object.keys(b).length===0){D=P.record(O,X);break}let G=P.object(b).passthrough(),Q=P.looseRecord(O,X);D=P.intersection(G,Q);break}if($.patternProperties){let O=$.patternProperties,X=Object.keys(O),G=[];for(let Y of X){let B=_$(O[Y],I),J=P.string().regex(new RegExp(Y));G.push(P.looseRecord(J,B))}let Q=[];if(Object.keys(b).length>0)Q.push(P.object(b).passthrough());if(Q.push(...G),Q.length===0)D=P.object({}).passthrough();else if(Q.length===1)D=Q[0];else{let Y=P.intersection(Q[0],Q[1]);for(let B=2;B<Q.length;B++)Y=P.intersection(Y,Q[B]);D=Y}break}let N=P.object(b);if($.additionalProperties===!1)D=N.strict();else if(typeof $.additionalProperties==="object")D=N.catchall(_$($.additionalProperties,I));else D=N.passthrough();break}case"array":{let{prefixItems:b,items:w}=$;if(b&&Array.isArray(b)){let A=b.map((O)=>_$(O,I)),N=w&&typeof w==="object"&&!Array.isArray(w)?_$(w,I):void 0;if(N)D=P.tuple(A).rest(N);else D=P.tuple(A);if(typeof $.minItems==="number")D=D.check(P.minLength($.minItems));if(typeof $.maxItems==="number")D=D.check(P.maxLength($.maxItems))}else if(Array.isArray(w)){let A=w.map((O)=>_$(O,I)),N=$.additionalItems&&typeof $.additionalItems==="object"?_$($.additionalItems,I):void 0;if(N)D=P.tuple(A).rest(N);else D=P.tuple(A);if(typeof $.minItems==="number")D=D.check(P.minLength($.minItems));if(typeof $.maxItems==="number")D=D.check(P.maxLength($.maxItems))}else if(w!==void 0){let A=_$(w,I),N=P.array(A);if(typeof $.minItems==="number")N=N.min($.minItems);if(typeof $.maxItems==="number")N=N.max($.maxItems);D=N}else D=P.array(P.any());break}default:throw new Error(`Unsupported type: ${U}`)}if($.description)D=D.describe($.description);if($.default!==void 0)D=D.default($.default);return D}function _$($,I){if(typeof $==="boolean")return $?P.any():P.never();let U=R7($,I),D=$.type||$.enum!==void 0||$.const!==void 0;if($.anyOf&&Array.isArray($.anyOf)){let b=$.anyOf.map((A)=>_$(A,I)),w=P.union(b);U=D?P.intersection(U,w):w}if($.oneOf&&Array.isArray($.oneOf)){let b=$.oneOf.map((A)=>_$(A,I)),w=P.xor(b);U=D?P.intersection(U,w):w}if($.allOf&&Array.isArray($.allOf))if($.allOf.length===0)U=D?U:P.any();else{let b=D?U:_$($.allOf[0],I),w=D?0:1;for(let A=w;A<$.allOf.length;A++)b=P.intersection(b,_$($.allOf[A],I));U=b}if($.nullable===!0&&I.version==="openapi-3.0")U=P.nullable(U);if($.readOnly===!0)U=P.readonly(U);return U}function T7($,I){if(typeof $==="boolean")return $?P.any():P.never();let U=MF($,I?.defaultTarget),D=$.$defs||$.definitions||{};return _$($,{version:U,defs:D,refs:new Map,processing:new Set,rootSchema:$})}var rG={};Z6(rG,{string:()=>FF,number:()=>qF,date:()=>jF,boolean:()=>kF,bigint:()=>EF});function FF($){return mX(CI,$)}function qF($){return eX(fI,$)}function kF($){return sX(gI,$)}function EF($){return $W(yI,$)}function jF($){return IW(FU,$)}z$(m1());var mG="2025-11-25";var _7=[mG,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],Y4="io.modelcontextprotocol/related-task",rw="2.0",F$=nw(($)=>$!==null&&(typeof $==="object"||typeof $==="function")),C7=Q$([H(),D$().int()]),Z7=H(),vx=E$({ttl:D$().optional(),pollInterval:D$().optional()}),SF=T({ttl:D$().optional()}),PF=T({taskId:H()}),oG=E$({progressToken:C7.optional(),[Y4]:PF.optional()}),e$=T({_meta:oG.optional()}),RU=e$.extend({task:SF.optional()}),f7=($)=>RU.safeParse($).success,S$=T({method:H(),params:e$.loose().optional()}),I6=T({_meta:oG.optional()}),U6=T({method:H(),params:I6.loose().optional()}),P$=E$({_meta:oG.optional()}),mw=Q$([H(),D$().int()]),g7=T({jsonrpc:Z(rw),id:mw,...S$.shape}).strict(),dG=($)=>g7.safeParse($).success,y7=T({jsonrpc:Z(rw),...U6.shape}).strict(),x7=($)=>y7.safeParse($).success,pG=T({jsonrpc:Z(rw),id:mw,result:P$}).strict(),TU=($)=>pG.safeParse($).success;var l;(function($){$[$.ConnectionClosed=-32000]="ConnectionClosed",$[$.RequestTimeout=-32001]="RequestTimeout",$[$.ParseError=-32700]="ParseError",$[$.InvalidRequest=-32600]="InvalidRequest",$[$.MethodNotFound=-32601]="MethodNotFound",$[$.InvalidParams=-32602]="InvalidParams",$[$.InternalError=-32603]="InternalError",$[$.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(l||(l={}));var tG=T({jsonrpc:Z(rw),id:mw.optional(),error:T({code:D$().int(),message:H(),data:G$().optional()})}).strict();var l7=($)=>tG.safeParse($).success;var h7=Q$([g7,y7,pG,tG]),Jx=Q$([pG,tG]),ow=P$.strict(),RF=I6.extend({requestId:mw.optional(),reason:H().optional()}),dw=U6.extend({method:Z("notifications/cancelled"),params:RF}),TF=T({src:H(),mimeType:H().optional(),sizes:p(H()).optional(),theme:j$(["light","dark"]).optional()}),_U=T({icons:p(TF).optional()}),hI=T({name:H(),title:H().optional()}),u7=hI.extend({...hI.shape,..._U.shape,version:H(),websiteUrl:H().optional(),description:H().optional()}),_F=xI(T({applyDefaults:V$().optional()}),O$(H(),G$())),CF=PU(($)=>{if($&&typeof $==="object"&&!Array.isArray($)){if(Object.keys($).length===0)return{form:{}}}return $},xI(T({form:_F.optional(),url:F$.optional()}),O$(H(),G$()).optional())),ZF=E$({list:F$.optional(),cancel:F$.optional(),requests:E$({sampling:E$({createMessage:F$.optional()}).optional(),elicitation:E$({create:F$.optional()}).optional()}).optional()}),fF=E$({list:F$.optional(),cancel:F$.optional(),requests:E$({tools:E$({call:F$.optional()}).optional()}).optional()}),gF=T({experimental:O$(H(),F$).optional(),sampling:T({context:F$.optional(),tools:F$.optional()}).optional(),elicitation:CF.optional(),roots:T({listChanged:V$().optional()}).optional(),tasks:ZF.optional(),extensions:O$(H(),F$).optional()}),yF=e$.extend({protocolVersion:H(),capabilities:gF,clientInfo:u7}),aG=S$.extend({method:Z("initialize"),params:yF});var xF=T({experimental:O$(H(),F$).optional(),logging:F$.optional(),completions:F$.optional(),prompts:T({listChanged:V$().optional()}).optional(),resources:T({subscribe:V$().optional(),listChanged:V$().optional()}).optional(),tools:T({listChanged:V$().optional()}).optional(),tasks:fF.optional(),extensions:O$(H(),F$).optional()}),lF=P$.extend({protocolVersion:H(),capabilities:xF,serverInfo:u7,instructions:H().optional()}),eG=U6.extend({method:Z("notifications/initialized"),params:I6.optional()});var pw=S$.extend({method:Z("ping"),params:e$.optional()}),hF=T({progress:D$(),total:B$(D$()),message:B$(H())}),uF=T({...I6.shape,...hF.shape,progressToken:C7}),tw=U6.extend({method:Z("notifications/progress"),params:uF}),iF=e$.extend({cursor:Z7.optional()}),CU=S$.extend({params:iF.optional()}),ZU=P$.extend({nextCursor:Z7.optional()}),nF=j$(["working","input_required","completed","failed","cancelled"]),fU=T({taskId:H(),status:nF,ttl:Q$([D$(),KU()]),createdAt:H(),lastUpdatedAt:H(),pollInterval:B$(D$()),statusMessage:B$(H())}),uI=P$.extend({task:fU}),cF=I6.merge(fU),gU=U6.extend({method:Z("notifications/tasks/status"),params:cF}),aw=S$.extend({method:Z("tasks/get"),params:e$.extend({taskId:H()})}),ew=P$.merge(fU),sw=S$.extend({method:Z("tasks/result"),params:e$.extend({taskId:H()})}),Hx=P$.loose(),$A=CU.extend({method:Z("tasks/list")}),IA=ZU.extend({tasks:p(fU)}),UA=S$.extend({method:Z("tasks/cancel"),params:e$.extend({taskId:H()})}),i7=P$.merge(fU),n7=T({uri:H(),mimeType:B$(H()),_meta:O$(H(),G$()).optional()}),c7=n7.extend({text:H()}),sG=H().refine(($)=>{try{return atob($),!0}catch{return!1}},{message:"Invalid Base64 string"}),r7=n7.extend({blob:sG}),yU=j$(["user","assistant"]),iI=T({audience:p(yU).optional(),priority:D$().min(0).max(1).optional(),lastModified:Q4.datetime({offset:!0}).optional()}),m7=T({...hI.shape,..._U.shape,uri:H(),description:B$(H()),mimeType:B$(H()),size:B$(D$()),annotations:iI.optional(),_meta:B$(E$({}))}),rF=T({...hI.shape,..._U.shape,uriTemplate:H(),description:B$(H()),mimeType:B$(H()),annotations:iI.optional(),_meta:B$(E$({}))}),bA=CU.extend({method:Z("resources/list")}),mF=ZU.extend({resources:p(m7)}),DA=CU.extend({method:Z("resources/templates/list")}),oF=ZU.extend({resourceTemplates:p(rF)}),$9=e$.extend({uri:H()}),dF=$9,wA=S$.extend({method:Z("resources/read"),params:dF}),pF=P$.extend({contents:p(Q$([c7,r7]))}),tF=U6.extend({method:Z("notifications/resources/list_changed"),params:I6.optional()}),aF=$9,eF=S$.extend({method:Z("resources/subscribe"),params:aF}),sF=$9,$q=S$.extend({method:Z("resources/unsubscribe"),params:sF}),Iq=I6.extend({uri:H()}),Uq=U6.extend({method:Z("notifications/resources/updated"),params:Iq}),bq=T({name:H(),description:B$(H()),required:B$(V$())}),Dq=T({...hI.shape,..._U.shape,description:B$(H()),arguments:B$(p(bq)),_meta:B$(E$({}))}),AA=CU.extend({method:Z("prompts/list")}),wq=ZU.extend({prompts:p(Dq)}),Aq=e$.extend({name:H(),arguments:O$(H(),H()).optional()}),NA=S$.extend({method:Z("prompts/get"),params:Aq}),I9=T({type:Z("text"),text:H(),annotations:iI.optional(),_meta:O$(H(),G$()).optional()}),U9=T({type:Z("image"),data:sG,mimeType:H(),annotations:iI.optional(),_meta:O$(H(),G$()).optional()}),b9=T({type:Z("audio"),data:sG,mimeType:H(),annotations:iI.optional(),_meta:O$(H(),G$()).optional()}),Nq=T({type:Z("tool_use"),name:H(),id:H(),input:O$(H(),G$()),_meta:O$(H(),G$()).optional()}),Oq=T({type:Z("resource"),resource:Q$([c7,r7]),annotations:iI.optional(),_meta:O$(H(),G$()).optional()}),Xq=m7.extend({type:Z("resource_link")}),D9=Q$([I9,U9,b9,Xq,Oq]),Wq=T({role:yU,content:D9}),Gq=P$.extend({description:H().optional(),messages:p(Wq)}),Qq=U6.extend({method:Z("notifications/prompts/list_changed"),params:I6.optional()}),Yq=T({title:H().optional(),readOnlyHint:V$().optional(),destructiveHint:V$().optional(),idempotentHint:V$().optional(),openWorldHint:V$().optional()}),Bq=T({taskSupport:j$(["required","optional","forbidden"]).optional()}),o7=T({...hI.shape,..._U.shape,description:H().optional(),inputSchema:T({type:Z("object"),properties:O$(H(),F$).optional(),required:p(H()).optional()}).catchall(G$()),outputSchema:T({type:Z("object"),properties:O$(H(),F$).optional(),required:p(H()).optional()}).catchall(G$()).optional(),annotations:Yq.optional(),execution:Bq.optional(),_meta:O$(H(),G$()).optional()}),OA=CU.extend({method:Z("tools/list")}),vq=ZU.extend({tools:p(o7)}),XA=P$.extend({content:p(D9).default([]),structuredContent:O$(H(),G$()).optional(),isError:V$().optional()}),Lx=XA.or(P$.extend({toolResult:G$()})),Jq=RU.extend({name:H(),arguments:O$(H(),G$()).optional()}),nI=S$.extend({method:Z("tools/call"),params:Jq}),Hq=U6.extend({method:Z("notifications/tools/list_changed"),params:I6.optional()}),zx=T({autoRefresh:V$().default(!0),debounceMs:D$().int().nonnegative().default(300)}),xU=j$(["debug","info","notice","warning","error","critical","alert","emergency"]),Lq=e$.extend({level:xU}),w9=S$.extend({method:Z("logging/setLevel"),params:Lq}),zq=I6.extend({level:xU,logger:H().optional(),data:G$()}),Vq=U6.extend({method:Z("notifications/message"),params:zq}),Mq=T({name:H().optional()}),Kq=T({hints:p(Mq).optional(),costPriority:D$().min(0).max(1).optional(),speedPriority:D$().min(0).max(1).optional(),intelligencePriority:D$().min(0).max(1).optional()}),Fq=T({mode:j$(["auto","required","none"]).optional()}),qq=T({type:Z("tool_result"),toolUseId:H().describe("The unique identifier for the corresponding tool call."),content:p(D9).default([]),structuredContent:T({}).loose().optional(),isError:V$().optional(),_meta:O$(H(),G$()).optional()}),kq=EU("type",[I9,U9,b9]),cw=EU("type",[I9,U9,b9,Nq,qq]),Eq=T({role:yU,content:Q$([cw,p(cw)]),_meta:O$(H(),G$()).optional()}),jq=RU.extend({messages:p(Eq),modelPreferences:Kq.optional(),systemPrompt:H().optional(),includeContext:j$(["none","thisServer","allServers"]).optional(),temperature:D$().optional(),maxTokens:D$().int(),stopSequences:p(H()).optional(),metadata:F$.optional(),tools:p(o7).optional(),toolChoice:Fq.optional()}),Sq=S$.extend({method:Z("sampling/createMessage"),params:jq}),lU=P$.extend({model:H(),stopReason:B$(j$(["endTurn","stopSequence","maxTokens"]).or(H())),role:yU,content:kq}),A9=P$.extend({model:H(),stopReason:B$(j$(["endTurn","stopSequence","maxTokens","toolUse"]).or(H())),role:yU,content:Q$([cw,p(cw)])}),Pq=T({type:Z("boolean"),title:H().optional(),description:H().optional(),default:V$().optional()}),Rq=T({type:Z("string"),title:H().optional(),description:H().optional(),minLength:D$().optional(),maxLength:D$().optional(),format:j$(["email","uri","date","date-time"]).optional(),default:H().optional()}),Tq=T({type:j$(["number","integer"]),title:H().optional(),description:H().optional(),minimum:D$().optional(),maximum:D$().optional(),default:D$().optional()}),_q=T({type:Z("string"),title:H().optional(),description:H().optional(),enum:p(H()),default:H().optional()}),Cq=T({type:Z("string"),title:H().optional(),description:H().optional(),oneOf:p(T({const:H(),title:H()})),default:H().optional()}),Zq=T({type:Z("string"),title:H().optional(),description:H().optional(),enum:p(H()),enumNames:p(H()).optional(),default:H().optional()}),fq=Q$([_q,Cq]),gq=T({type:Z("array"),title:H().optional(),description:H().optional(),minItems:D$().optional(),maxItems:D$().optional(),items:T({type:Z("string"),enum:p(H())}),default:p(H()).optional()}),yq=T({type:Z("array"),title:H().optional(),description:H().optional(),minItems:D$().optional(),maxItems:D$().optional(),items:T({anyOf:p(T({const:H(),title:H()}))}),default:p(H()).optional()}),xq=Q$([gq,yq]),lq=Q$([Zq,fq,xq]),hq=Q$([lq,Pq,Rq,Tq]),uq=RU.extend({mode:Z("form").optional(),message:H(),requestedSchema:T({type:Z("object"),properties:O$(H(),hq),required:p(H()).optional()})}),iq=RU.extend({mode:Z("url"),message:H(),elicitationId:H(),url:H().url()}),nq=Q$([uq,iq]),cq=S$.extend({method:Z("elicitation/create"),params:nq}),rq=I6.extend({elicitationId:H()}),mq=U6.extend({method:Z("notifications/elicitation/complete"),params:rq}),cI=P$.extend({action:j$(["accept","decline","cancel"]),content:PU(($)=>$===null?void 0:$,O$(H(),Q$([H(),D$(),V$(),p(H())])).optional())}),oq=T({type:Z("ref/resource"),uri:H()});var dq=T({type:Z("ref/prompt"),name:H()}),pq=e$.extend({ref:Q$([dq,oq]),argument:T({name:H(),value:H()}),context:T({arguments:O$(H(),H()).optional()}).optional()}),WA=S$.extend({method:Z("completion/complete"),params:pq});function d7($){if($.params.ref.type!=="ref/prompt")throw new TypeError(`Expected CompleteRequestPrompt, but got ${$.params.ref.type}`)}function p7($){if($.params.ref.type!=="ref/resource")throw new TypeError(`Expected CompleteRequestResourceTemplate, but got ${$.params.ref.type}`)}var tq=P$.extend({completion:E$({values:p(H()).max(100),total:B$(D$().int()),hasMore:B$(V$())})}),aq=T({uri:H().startsWith("file://"),name:H().optional(),_meta:O$(H(),G$()).optional()}),eq=S$.extend({method:Z("roots/list"),params:e$.optional()}),N9=P$.extend({roots:p(aq)}),sq=U6.extend({method:Z("notifications/roots/list_changed"),params:I6.optional()}),Vx=Q$([pw,aG,WA,w9,NA,AA,bA,DA,wA,eF,$q,nI,OA,aw,sw,$A,UA]),Mx=Q$([dw,tw,eG,sq,gU]),Kx=Q$([ow,lU,A9,cI,N9,ew,IA,uI]),Fx=Q$([pw,Sq,cq,eq,aw,sw,$A,UA]),qx=Q$([dw,tw,Vq,Uq,tF,Hq,Qq,gU,mq]),kx=Q$([ow,lF,tq,Gq,wq,mF,oF,pF,XA,vq,ew,IA,uI]);class f extends Error{constructor($,I,U){super(`MCP error ${$}: ${I}`);this.code=$,this.data=U,this.name="McpError"}static fromError($,I,U){if($===l.UrlElicitationRequired&&U){let D=U;if(D.elicitations)return new t7(D.elicitations,I)}return new f($,I,U)}}class t7 extends f{constructor($,I=`URL elicitation${$.length>1?"s":""} required`){super(l.UrlElicitationRequired,I,{elicitations:$})}get elicitations(){return this.data?.elicitations??[]}}function B4($){return $==="completed"||$==="failed"||$==="cancelled"}var e7=Symbol("Let zodToJsonSchema decide on which parser to use");var a7={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref",openAiAnyTypeName:"OpenAiAnyType"},s7=($)=>typeof $==="string"?{...a7,name:$}:{...a7,...$};var $5=($)=>{let I=s7($),U=I.name!==void 0?[...I.basePath,I.definitionPath,I.name]:I.basePath;return{...I,flags:{hasReferencedOpenAiAnyType:!1},currentPath:U,propertyPath:void 0,seen:new Map(Object.entries(I.definitions).map(([D,b])=>[b._def,{def:b._def,path:[...I.basePath,I.definitionPath,D],jsonSchema:void 0}]))}};function O9($,I,U,D){if(!D?.errorMessages)return;if(U)$.errorMessage={...$.errorMessage,[I]:U}}function I$($,I,U,D,b){$[I]=U,O9($,I,D,b)}var GA=($,I)=>{let U=0;for(;U<$.length&&U<I.length;U++)if($[U]!==I[U])break;return[($.length-U).toString(),...I.slice(U)].join("/")};function H$($){if($.target!=="openAi")return{};let I=[...$.basePath,$.definitionPath,$.openAiAnyTypeName];return $.flags.hasReferencedOpenAiAnyType=!0,{$ref:$.$refStrategy==="relative"?GA(I,$.currentPath):I.join("/")}}function I5($,I){let U={type:"array"};if($.type?._def&&$.type?._def?.typeName!==F.ZodAny)U.items=i($.type._def,{...I,currentPath:[...I.currentPath,"items"]});if($.minLength)I$(U,"minItems",$.minLength.value,$.minLength.message,I);if($.maxLength)I$(U,"maxItems",$.maxLength.value,$.maxLength.message,I);if($.exactLength)I$(U,"minItems",$.exactLength.value,$.exactLength.message,I),I$(U,"maxItems",$.exactLength.value,$.exactLength.message,I);return U}function U5($,I){let U={type:"integer",format:"int64"};if(!$.checks)return U;for(let D of $.checks)switch(D.kind){case"min":if(I.target==="jsonSchema7")if(D.inclusive)I$(U,"minimum",D.value,D.message,I);else I$(U,"exclusiveMinimum",D.value,D.message,I);else{if(!D.inclusive)U.exclusiveMinimum=!0;I$(U,"minimum",D.value,D.message,I)}break;case"max":if(I.target==="jsonSchema7")if(D.inclusive)I$(U,"maximum",D.value,D.message,I);else I$(U,"exclusiveMaximum",D.value,D.message,I);else{if(!D.inclusive)U.exclusiveMaximum=!0;I$(U,"maximum",D.value,D.message,I)}break;case"multipleOf":I$(U,"multipleOf",D.value,D.message,I);break}return U}function b5(){return{type:"boolean"}}function QA($,I){return i($.type._def,I)}var D5=($,I)=>{return i($.innerType._def,I)};function X9($,I,U){let D=U??I.dateStrategy;if(Array.isArray(D))return{anyOf:D.map((b,w)=>X9($,I,b))};switch(D){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return $k($,I)}}var $k=($,I)=>{let U={type:"integer",format:"unix-time"};if(I.target==="openApi3")return U;for(let D of $.checks)switch(D.kind){case"min":I$(U,"minimum",D.value,D.message,I);break;case"max":I$(U,"maximum",D.value,D.message,I);break}return U};function w5($,I){return{...i($.innerType._def,I),default:$.defaultValue()}}function A5($,I){return I.effectStrategy==="input"?i($.schema._def,I):H$(I)}function N5($){return{type:"string",enum:Array.from($.values)}}var Ik=($)=>{if("type"in $&&$.type==="string")return!1;return"allOf"in $};function O5($,I){let U=[i($.left._def,{...I,currentPath:[...I.currentPath,"allOf","0"]}),i($.right._def,{...I,currentPath:[...I.currentPath,"allOf","1"]})].filter((w)=>!!w),D=I.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,b=[];return U.forEach((w)=>{if(Ik(w)){if(b.push(...w.allOf),w.unevaluatedProperties===void 0)D=void 0}else{let A=w;if("additionalProperties"in w&&w.additionalProperties===!1){let{additionalProperties:N,...O}=w;A=O}else D=void 0;b.push(A)}}),b.length?{allOf:b,...D}:void 0}function X5($,I){let U=typeof $.value;if(U!=="bigint"&&U!=="number"&&U!=="boolean"&&U!=="string")return{type:Array.isArray($.value)?"array":"object"};if(I.target==="openApi3")return{type:U==="bigint"?"integer":U,enum:[$.value]};return{type:U==="bigint"?"integer":U,const:$.value}}var W9=void 0,O6={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>{if(W9===void 0)W9=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u");return W9},uuid:/^[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}$/,ipv4:/^(?:(?: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])$/,ipv4Cidr:/^(?:(?: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])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([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])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function YA($,I){let U={type:"string"};if($.checks)for(let D of $.checks)switch(D.kind){case"min":I$(U,"minLength",typeof U.minLength==="number"?Math.max(U.minLength,D.value):D.value,D.message,I);break;case"max":I$(U,"maxLength",typeof U.maxLength==="number"?Math.min(U.maxLength,D.value):D.value,D.message,I);break;case"email":switch(I.emailStrategy){case"format:email":X6(U,"email",D.message,I);break;case"format:idn-email":X6(U,"idn-email",D.message,I);break;case"pattern:zod":x$(U,O6.email,D.message,I);break}break;case"url":X6(U,"uri",D.message,I);break;case"uuid":X6(U,"uuid",D.message,I);break;case"regex":x$(U,D.regex,D.message,I);break;case"cuid":x$(U,O6.cuid,D.message,I);break;case"cuid2":x$(U,O6.cuid2,D.message,I);break;case"startsWith":x$(U,RegExp(`^${G9(D.value,I)}`),D.message,I);break;case"endsWith":x$(U,RegExp(`${G9(D.value,I)}$`),D.message,I);break;case"datetime":X6(U,"date-time",D.message,I);break;case"date":X6(U,"date",D.message,I);break;case"time":X6(U,"time",D.message,I);break;case"duration":X6(U,"duration",D.message,I);break;case"length":I$(U,"minLength",typeof U.minLength==="number"?Math.max(U.minLength,D.value):D.value,D.message,I),I$(U,"maxLength",typeof U.maxLength==="number"?Math.min(U.maxLength,D.value):D.value,D.message,I);break;case"includes":{x$(U,RegExp(G9(D.value,I)),D.message,I);break}case"ip":{if(D.version!=="v6")X6(U,"ipv4",D.message,I);if(D.version!=="v4")X6(U,"ipv6",D.message,I);break}case"base64url":x$(U,O6.base64url,D.message,I);break;case"jwt":x$(U,O6.jwt,D.message,I);break;case"cidr":{if(D.version!=="v6")x$(U,O6.ipv4Cidr,D.message,I);if(D.version!=="v4")x$(U,O6.ipv6Cidr,D.message,I);break}case"emoji":x$(U,O6.emoji(),D.message,I);break;case"ulid":{x$(U,O6.ulid,D.message,I);break}case"base64":{switch(I.base64Strategy){case"format:binary":{X6(U,"binary",D.message,I);break}case"contentEncoding:base64":{I$(U,"contentEncoding","base64",D.message,I);break}case"pattern:zod":{x$(U,O6.base64,D.message,I);break}}break}case"nanoid":x$(U,O6.nanoid,D.message,I);case"toLowerCase":case"toUpperCase":case"trim":break;default:((b)=>{})(D)}return U}function G9($,I){return I.patternStrategy==="escape"?bk($):$}var Uk=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function bk($){let I="";for(let U=0;U<$.length;U++){if(!Uk.has($[U]))I+="\\";I+=$[U]}return I}function X6($,I,U,D){if($.format||$.anyOf?.some((b)=>b.format)){if(!$.anyOf)$.anyOf=[];if($.format){if($.anyOf.push({format:$.format,...$.errorMessage&&D.errorMessages&&{errorMessage:{format:$.errorMessage.format}}}),delete $.format,$.errorMessage){if(delete $.errorMessage.format,Object.keys($.errorMessage).length===0)delete $.errorMessage}}$.anyOf.push({format:I,...U&&D.errorMessages&&{errorMessage:{format:U}}})}else I$($,"format",I,U,D)}function x$($,I,U,D){if($.pattern||$.allOf?.some((b)=>b.pattern)){if(!$.allOf)$.allOf=[];if($.pattern){if($.allOf.push({pattern:$.pattern,...$.errorMessage&&D.errorMessages&&{errorMessage:{pattern:$.errorMessage.pattern}}}),delete $.pattern,$.errorMessage){if(delete $.errorMessage.pattern,Object.keys($.errorMessage).length===0)delete $.errorMessage}}$.allOf.push({pattern:W5(I,D),...U&&D.errorMessages&&{errorMessage:{pattern:U}}})}else I$($,"pattern",W5(I,D),U,D)}function W5($,I){if(!I.applyRegexFlags||!$.flags)return $.source;let U={i:$.flags.includes("i"),m:$.flags.includes("m"),s:$.flags.includes("s")},D=U.i?$.source.toLowerCase():$.source,b="",w=!1,A=!1,N=!1;for(let O=0;O<D.length;O++){if(w){b+=D[O],w=!1;continue}if(U.i){if(A){if(D[O].match(/[a-z]/)){if(N)b+=D[O],b+=`${D[O-2]}-${D[O]}`.toUpperCase(),N=!1;else if(D[O+1]==="-"&&D[O+2]?.match(/[a-z]/))b+=D[O],N=!0;else b+=`${D[O]}${D[O].toUpperCase()}`;continue}}else if(D[O].match(/[a-z]/)){b+=`[${D[O]}${D[O].toUpperCase()}]`;continue}}if(U.m){if(D[O]==="^"){b+=`(^|(?<=[\r
|
|
32
|
-
]))`;continue}else if(D[
|
|
33
|
-
]))`;continue}}if(U.s&&D[
|
|
34
|
-
`:`[${D[
|
|
35
|
-
]`;continue}if(b+=D[O],D[O]==="\\")w=!0;else if(A&&D[O]==="]")A=!1;else if(!A&&D[O]==="[")A=!0}try{new RegExp(b)}catch{return console.warn(`Could not convert regex pattern at ${I.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),$.source}return b}function BA($,I){if(I.target==="openAi")console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead.");if(I.target==="openApi3"&&$.keyType?._def.typeName===F.ZodEnum)return{type:"object",required:$.keyType._def.values,properties:$.keyType._def.values.reduce((D,b)=>({...D,[b]:i($.valueType._def,{...I,currentPath:[...I.currentPath,"properties",b]})??H$(I)}),{}),additionalProperties:I.rejectedAdditionalProperties};let U={type:"object",additionalProperties:i($.valueType._def,{...I,currentPath:[...I.currentPath,"additionalProperties"]})??I.allowedAdditionalProperties};if(I.target==="openApi3")return U;if($.keyType?._def.typeName===F.ZodString&&$.keyType._def.checks?.length){let{type:D,...b}=YA($.keyType._def,I);return{...U,propertyNames:b}}else if($.keyType?._def.typeName===F.ZodEnum)return{...U,propertyNames:{enum:$.keyType._def.values}};else if($.keyType?._def.typeName===F.ZodBranded&&$.keyType._def.type._def.typeName===F.ZodString&&$.keyType._def.type._def.checks?.length){let{type:D,...b}=QA($.keyType._def,I);return{...U,propertyNames:b}}return U}function G5($,I){if(I.mapStrategy==="record")return BA($,I);let U=i($.keyType._def,{...I,currentPath:[...I.currentPath,"items","items","0"]})||H$(I),D=i($.valueType._def,{...I,currentPath:[...I.currentPath,"items","items","1"]})||H$(I);return{type:"array",maxItems:125,items:{type:"array",items:[U,D],minItems:2,maxItems:2}}}function Q5($){let I=$.values,D=Object.keys($.values).filter((w)=>{return typeof I[I[w]]!=="number"}).map((w)=>I[w]),b=Array.from(new Set(D.map((w)=>typeof w)));return{type:b.length===1?b[0]==="string"?"string":"number":["string","number"],enum:D}}function Y5($){return $.target==="openAi"?void 0:{not:H$({...$,currentPath:[...$.currentPath,"not"]})}}function B5($){return $.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}var hU={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function J5($,I){if(I.target==="openApi3")return v5($,I);let U=$.options instanceof Map?Array.from($.options.values()):$.options;if(U.every((D)=>(D._def.typeName in hU)&&(!D._def.checks||!D._def.checks.length))){let D=U.reduce((b,w)=>{let A=hU[w._def.typeName];return A&&!b.includes(A)?[...b,A]:b},[]);return{type:D.length>1?D:D[0]}}else if(U.every((D)=>D._def.typeName==="ZodLiteral"&&!D.description)){let D=U.reduce((b,w)=>{let A=typeof w._def.value;switch(A){case"string":case"number":case"boolean":return[...b,A];case"bigint":return[...b,"integer"];case"object":if(w._def.value===null)return[...b,"null"];case"symbol":case"undefined":case"function":default:return b}},[]);if(D.length===U.length){let b=D.filter((w,A,N)=>N.indexOf(w)===A);return{type:b.length>1?b:b[0],enum:U.reduce((w,A)=>{return w.includes(A._def.value)?w:[...w,A._def.value]},[])}}}else if(U.every((D)=>D._def.typeName==="ZodEnum"))return{type:"string",enum:U.reduce((D,b)=>[...D,...b._def.values.filter((w)=>!D.includes(w))],[])};return v5($,I)}var v5=($,I)=>{let U=($.options instanceof Map?Array.from($.options.values()):$.options).map((D,b)=>i(D._def,{...I,currentPath:[...I.currentPath,"anyOf",`${b}`]})).filter((D)=>!!D&&(!I.strictUnions||typeof D==="object"&&Object.keys(D).length>0));return U.length?{anyOf:U}:void 0};function H5($,I){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes($.innerType._def.typeName)&&(!$.innerType._def.checks||!$.innerType._def.checks.length)){if(I.target==="openApi3")return{type:hU[$.innerType._def.typeName],nullable:!0};return{type:[hU[$.innerType._def.typeName],"null"]}}if(I.target==="openApi3"){let D=i($.innerType._def,{...I,currentPath:[...I.currentPath]});if(D&&"$ref"in D)return{allOf:[D],nullable:!0};return D&&{...D,nullable:!0}}let U=i($.innerType._def,{...I,currentPath:[...I.currentPath,"anyOf","0"]});return U&&{anyOf:[U,{type:"null"}]}}function L5($,I){let U={type:"number"};if(!$.checks)return U;for(let D of $.checks)switch(D.kind){case"int":U.type="integer",O9(U,"type",D.message,I);break;case"min":if(I.target==="jsonSchema7")if(D.inclusive)I$(U,"minimum",D.value,D.message,I);else I$(U,"exclusiveMinimum",D.value,D.message,I);else{if(!D.inclusive)U.exclusiveMinimum=!0;I$(U,"minimum",D.value,D.message,I)}break;case"max":if(I.target==="jsonSchema7")if(D.inclusive)I$(U,"maximum",D.value,D.message,I);else I$(U,"exclusiveMaximum",D.value,D.message,I);else{if(!D.inclusive)U.exclusiveMaximum=!0;I$(U,"maximum",D.value,D.message,I)}break;case"multipleOf":I$(U,"multipleOf",D.value,D.message,I);break}return U}function z5($,I){let U=I.target==="openAi",D={type:"object",properties:{}},b=[],w=$.shape();for(let N in w){let O=w[N];if(O===void 0||O._def===void 0)continue;let X=wk(O);if(X&&U){if(O._def.typeName==="ZodOptional")O=O._def.innerType;if(!O.isNullable())O=O.nullable();X=!1}let G=i(O._def,{...I,currentPath:[...I.currentPath,"properties",N],propertyPath:[...I.currentPath,"properties",N]});if(G===void 0)continue;if(D.properties[N]=G,!X)b.push(N)}if(b.length)D.required=b;let A=Dk($,I);if(A!==void 0)D.additionalProperties=A;return D}function Dk($,I){if($.catchall._def.typeName!=="ZodNever")return i($.catchall._def,{...I,currentPath:[...I.currentPath,"additionalProperties"]});switch($.unknownKeys){case"passthrough":return I.allowedAdditionalProperties;case"strict":return I.rejectedAdditionalProperties;case"strip":return I.removeAdditionalStrategy==="strict"?I.allowedAdditionalProperties:I.rejectedAdditionalProperties}}function wk($){try{return $.isOptional()}catch{return!0}}var V5=($,I)=>{if(I.currentPath.toString()===I.propertyPath?.toString())return i($.innerType._def,I);let U=i($.innerType._def,{...I,currentPath:[...I.currentPath,"anyOf","1"]});return U?{anyOf:[{not:H$(I)},U]}:H$(I)};var M5=($,I)=>{if(I.pipeStrategy==="input")return i($.in._def,I);else if(I.pipeStrategy==="output")return i($.out._def,I);let U=i($.in._def,{...I,currentPath:[...I.currentPath,"allOf","0"]}),D=i($.out._def,{...I,currentPath:[...I.currentPath,"allOf",U?"1":"0"]});return{allOf:[U,D].filter((b)=>b!==void 0)}};function K5($,I){return i($.type._def,I)}function F5($,I){let D={type:"array",uniqueItems:!0,items:i($.valueType._def,{...I,currentPath:[...I.currentPath,"items"]})};if($.minSize)I$(D,"minItems",$.minSize.value,$.minSize.message,I);if($.maxSize)I$(D,"maxItems",$.maxSize.value,$.maxSize.message,I);return D}function q5($,I){if($.rest)return{type:"array",minItems:$.items.length,items:$.items.map((U,D)=>i(U._def,{...I,currentPath:[...I.currentPath,"items",`${D}`]})).reduce((U,D)=>D===void 0?U:[...U,D],[]),additionalItems:i($.rest._def,{...I,currentPath:[...I.currentPath,"additionalItems"]})};else return{type:"array",minItems:$.items.length,maxItems:$.items.length,items:$.items.map((U,D)=>i(U._def,{...I,currentPath:[...I.currentPath,"items",`${D}`]})).reduce((U,D)=>D===void 0?U:[...U,D],[])}}function k5($){return{not:H$($)}}function E5($){return H$($)}var j5=($,I)=>{return i($.innerType._def,I)};var S5=($,I,U)=>{switch(I){case F.ZodString:return YA($,U);case F.ZodNumber:return L5($,U);case F.ZodObject:return z5($,U);case F.ZodBigInt:return U5($,U);case F.ZodBoolean:return b5();case F.ZodDate:return X9($,U);case F.ZodUndefined:return k5(U);case F.ZodNull:return B5(U);case F.ZodArray:return I5($,U);case F.ZodUnion:case F.ZodDiscriminatedUnion:return J5($,U);case F.ZodIntersection:return O5($,U);case F.ZodTuple:return q5($,U);case F.ZodRecord:return BA($,U);case F.ZodLiteral:return X5($,U);case F.ZodEnum:return N5($);case F.ZodNativeEnum:return Q5($);case F.ZodNullable:return H5($,U);case F.ZodOptional:return V5($,U);case F.ZodMap:return G5($,U);case F.ZodSet:return F5($,U);case F.ZodLazy:return()=>$.getter()._def;case F.ZodPromise:return K5($,U);case F.ZodNaN:case F.ZodNever:return Y5(U);case F.ZodEffects:return A5($,U);case F.ZodAny:return H$(U);case F.ZodUnknown:return E5(U);case F.ZodDefault:return w5($,U);case F.ZodBranded:return QA($,U);case F.ZodReadonly:return j5($,U);case F.ZodCatch:return D5($,U);case F.ZodPipeline:return M5($,U);case F.ZodFunction:case F.ZodVoid:case F.ZodSymbol:return;default:return((D)=>{return})(I)}};function i($,I,U=!1){let D=I.seen.get($);if(I.override){let N=I.override?.($,I,D,U);if(N!==e7)return N}if(D&&!U){let N=Ak(D,I);if(N!==void 0)return N}let b={def:$,path:I.currentPath,jsonSchema:void 0};I.seen.set($,b);let w=S5($,$.typeName,I),A=typeof w==="function"?i(w(),I):w;if(A)Nk($,I,A);if(I.postProcess){let N=I.postProcess(A,$,I);return b.jsonSchema=A,N}return b.jsonSchema=A,A}var Ak=($,I)=>{switch(I.$refStrategy){case"root":return{$ref:$.path.join("/")};case"relative":return{$ref:GA(I.currentPath,$.path)};case"none":case"seen":{if($.path.length<I.currentPath.length&&$.path.every((U,D)=>I.currentPath[D]===U))return console.warn(`Recursive reference detected at ${I.currentPath.join("/")}! Defaulting to any`),H$(I);return I.$refStrategy==="seen"?H$(I):void 0}}},Nk=($,I,U)=>{if($.description){if(U.description=$.description,I.markdownDescription)U.markdownDescription=$.description}return U};var Q9=($,I)=>{let U=$5(I),D=typeof I==="object"&&I.definitions?Object.entries(I.definitions).reduce((O,[X,G])=>({...O,[X]:i(G._def,{...U,currentPath:[...U.basePath,U.definitionPath,X]},!0)??H$(U)}),{}):void 0,b=typeof I==="string"?I:I?.nameStrategy==="title"?void 0:I?.name,w=i($._def,b===void 0?U:{...U,currentPath:[...U.basePath,U.definitionPath,b]},!1)??H$(U),A=typeof I==="object"&&I.name!==void 0&&I.nameStrategy==="title"?I.name:void 0;if(A!==void 0)w.title=A;if(U.flags.hasReferencedOpenAiAnyType){if(!D)D={};if(!D[U.openAiAnyTypeName])D[U.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:U.$refStrategy==="relative"?"1":[...U.basePath,U.definitionPath,U.openAiAnyTypeName].join("/")}}}let N=b===void 0?D?{...w,[U.definitionPath]:D}:w:{$ref:[...U.$refStrategy==="relative"?[]:U.basePath,U.definitionPath,b].join("/"),[U.definitionPath]:{...D,[b]:w}};if(U.target==="jsonSchema7")N.$schema="http://json-schema.org/draft-07/schema#";else if(U.target==="jsonSchema2019-09"||U.target==="openAi")N.$schema="https://json-schema.org/draft/2019-09/schema#";if(U.target==="openAi"&&(("anyOf"in N)||("oneOf"in N)||("allOf"in N)||("type"in N)&&Array.isArray(N.type)))console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property.");return N};function Ok($){if(!$)return"draft-7";if($==="jsonSchema7"||$==="draft-7")return"draft-7";if($==="jsonSchema2019-09"||$==="draft-2020-12")return"draft-2020-12";return"draft-7"}function Y9($,I){if($6($))return l4($,{target:Ok(I?.target),io:I?.pipeStrategy??"input"});return Q9($,{strictUnions:I?.strictUnions??!0,pipeStrategy:I?.pipeStrategy??"input"})}function B9($){let U=G4($)?.method;if(!U)throw new Error("Schema is missing a method literal");let D=Yw(U);if(typeof D!=="string")throw new Error("Schema method literal must be a string");return D}function v9($,I){let U=W4($,I);if(!U.success)throw U.error;return U.data}var Xk=60000;class J9{constructor($){if(this._options=$,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(dw,(I)=>{this._oncancel(I)}),this.setNotificationHandler(tw,(I)=>{this._onprogress(I)}),this.setRequestHandler(pw,(I)=>({})),this._taskStore=$?.taskStore,this._taskMessageQueue=$?.taskMessageQueue,this._taskStore)this.setRequestHandler(aw,async(I,U)=>{let D=await this._taskStore.getTask(I.params.taskId,U.sessionId);if(!D)throw new f(l.InvalidParams,"Failed to retrieve task: Task not found");return{...D}}),this.setRequestHandler(sw,async(I,U)=>{let D=async()=>{let b=I.params.taskId;if(this._taskMessageQueue){let A;while(A=await this._taskMessageQueue.dequeue(b,U.sessionId)){if(A.type==="response"||A.type==="error"){let N=A.message,O=N.id,X=this._requestResolvers.get(O);if(X)if(this._requestResolvers.delete(O),A.type==="response")X(N);else{let G=N,Q=new f(G.error.code,G.error.message,G.error.data);X(Q)}else{let G=A.type==="response"?"Response":"Error";this._onerror(new Error(`${G} handler missing for request ${O}`))}continue}await this._transport?.send(A.message,{relatedRequestId:U.requestId})}}let w=await this._taskStore.getTask(b,U.sessionId);if(!w)throw new f(l.InvalidParams,`Task not found: ${b}`);if(!B4(w.status))return await this._waitForTaskUpdate(b,U.signal),await D();if(B4(w.status)){let A=await this._taskStore.getTaskResult(b,U.sessionId);return this._clearTaskQueue(b),{...A,_meta:{...A._meta,[Y4]:{taskId:b}}}}return await D()};return await D()}),this.setRequestHandler($A,async(I,U)=>{try{let{tasks:D,nextCursor:b}=await this._taskStore.listTasks(I.params?.cursor,U.sessionId);return{tasks:D,nextCursor:b,_meta:{}}}catch(D){throw new f(l.InvalidParams,`Failed to list tasks: ${D instanceof Error?D.message:String(D)}`)}}),this.setRequestHandler(UA,async(I,U)=>{try{let D=await this._taskStore.getTask(I.params.taskId,U.sessionId);if(!D)throw new f(l.InvalidParams,`Task not found: ${I.params.taskId}`);if(B4(D.status))throw new f(l.InvalidParams,`Cannot cancel task in terminal status: ${D.status}`);await this._taskStore.updateTaskStatus(I.params.taskId,"cancelled","Client cancelled task execution.",U.sessionId),this._clearTaskQueue(I.params.taskId);let b=await this._taskStore.getTask(I.params.taskId,U.sessionId);if(!b)throw new f(l.InvalidParams,`Task not found after cancellation: ${I.params.taskId}`);return{_meta:{},...b}}catch(D){if(D instanceof f)throw D;throw new f(l.InvalidRequest,`Failed to cancel task: ${D instanceof Error?D.message:String(D)}`)}})}async _oncancel($){if(!$.params.requestId)return;this._requestHandlerAbortControllers.get($.params.requestId)?.abort($.params.reason)}_setupTimeout($,I,U,D,b=!1){this._timeoutInfo.set($,{timeoutId:setTimeout(D,I),startTime:Date.now(),timeout:I,maxTotalTimeout:U,resetTimeoutOnProgress:b,onTimeout:D})}_resetTimeout($){let I=this._timeoutInfo.get($);if(!I)return!1;let U=Date.now()-I.startTime;if(I.maxTotalTimeout&&U>=I.maxTotalTimeout)throw this._timeoutInfo.delete($),f.fromError(l.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:I.maxTotalTimeout,totalElapsed:U});return clearTimeout(I.timeoutId),I.timeoutId=setTimeout(I.onTimeout,I.timeout),!0}_cleanupTimeout($){let I=this._timeoutInfo.get($);if(I)clearTimeout(I.timeoutId),this._timeoutInfo.delete($)}async connect($){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=$;let I=this.transport?.onclose;this._transport.onclose=()=>{I?.(),this._onclose()};let U=this.transport?.onerror;this._transport.onerror=(b)=>{U?.(b),this._onerror(b)};let D=this._transport?.onmessage;this._transport.onmessage=(b,w)=>{if(D?.(b,w),TU(b)||l7(b))this._onresponse(b);else if(dG(b))this._onrequest(b,w);else if(x7(b))this._onnotification(b);else this._onerror(new Error(`Unknown message type: ${JSON.stringify(b)}`))},await this._transport.start()}_onclose(){let $=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let U of this._timeoutInfo.values())clearTimeout(U.timeoutId);this._timeoutInfo.clear();for(let U of this._requestHandlerAbortControllers.values())U.abort();this._requestHandlerAbortControllers.clear();let I=f.fromError(l.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let U of $.values())U(I)}_onerror($){this.onerror?.($)}_onnotification($){let I=this._notificationHandlers.get($.method)??this.fallbackNotificationHandler;if(I===void 0)return;Promise.resolve().then(()=>I($)).catch((U)=>this._onerror(new Error(`Uncaught error in notification handler: ${U}`)))}_onrequest($,I){let U=this._requestHandlers.get($.method)??this.fallbackRequestHandler,D=this._transport,b=$.params?._meta?.[Y4]?.taskId;if(U===void 0){let X={jsonrpc:"2.0",id:$.id,error:{code:l.MethodNotFound,message:"Method not found"}};if(b&&this._taskMessageQueue)this._enqueueTaskMessage(b,{type:"error",message:X,timestamp:Date.now()},D?.sessionId).catch((G)=>this._onerror(new Error(`Failed to enqueue error response: ${G}`)));else D?.send(X).catch((G)=>this._onerror(new Error(`Failed to send an error response: ${G}`)));return}let w=new AbortController;this._requestHandlerAbortControllers.set($.id,w);let A=f7($.params)?$.params.task:void 0,N=this._taskStore?this.requestTaskStore($,D?.sessionId):void 0,O={signal:w.signal,sessionId:D?.sessionId,_meta:$.params?._meta,sendNotification:async(X)=>{if(w.signal.aborted)return;let G={relatedRequestId:$.id};if(b)G.relatedTask={taskId:b};await this.notification(X,G)},sendRequest:async(X,G,Q)=>{if(w.signal.aborted)throw new f(l.ConnectionClosed,"Request was cancelled");let Y={...Q,relatedRequestId:$.id};if(b&&!Y.relatedTask)Y.relatedTask={taskId:b};let B=Y.relatedTask?.taskId??b;if(B&&N)await N.updateTaskStatus(B,"input_required");return await this.request(X,G,Y)},authInfo:I?.authInfo,requestId:$.id,requestInfo:I?.requestInfo,taskId:b,taskStore:N,taskRequestedTtl:A?.ttl,closeSSEStream:I?.closeSSEStream,closeStandaloneSSEStream:I?.closeStandaloneSSEStream};Promise.resolve().then(()=>{if(A)this.assertTaskHandlerCapability($.method)}).then(()=>U($,O)).then(async(X)=>{if(w.signal.aborted)return;let G={result:X,jsonrpc:"2.0",id:$.id};if(b&&this._taskMessageQueue)await this._enqueueTaskMessage(b,{type:"response",message:G,timestamp:Date.now()},D?.sessionId);else await D?.send(G)},async(X)=>{if(w.signal.aborted)return;let G={jsonrpc:"2.0",id:$.id,error:{code:Number.isSafeInteger(X.code)?X.code:l.InternalError,message:X.message??"Internal error",...X.data!==void 0&&{data:X.data}}};if(b&&this._taskMessageQueue)await this._enqueueTaskMessage(b,{type:"error",message:G,timestamp:Date.now()},D?.sessionId);else await D?.send(G)}).catch((X)=>this._onerror(new Error(`Failed to send response: ${X}`))).finally(()=>{if(this._requestHandlerAbortControllers.get($.id)===w)this._requestHandlerAbortControllers.delete($.id)})}_onprogress($){let{progressToken:I,...U}=$.params,D=Number(I),b=this._progressHandlers.get(D);if(!b){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify($)}`));return}let w=this._responseHandlers.get(D),A=this._timeoutInfo.get(D);if(A&&w&&A.resetTimeoutOnProgress)try{this._resetTimeout(D)}catch(N){this._responseHandlers.delete(D),this._progressHandlers.delete(D),this._cleanupTimeout(D),w(N);return}b(U)}_onresponse($){let I=Number($.id),U=this._requestResolvers.get(I);if(U){if(this._requestResolvers.delete(I),TU($))U($);else{let w=new f($.error.code,$.error.message,$.error.data);U(w)}return}let D=this._responseHandlers.get(I);if(D===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify($)}`));return}this._responseHandlers.delete(I),this._cleanupTimeout(I);let b=!1;if(TU($)&&$.result&&typeof $.result==="object"){let w=$.result;if(w.task&&typeof w.task==="object"){let A=w.task;if(typeof A.taskId==="string")b=!0,this._taskProgressTokens.set(A.taskId,I)}}if(!b)this._progressHandlers.delete(I);if(TU($))D($);else{let w=f.fromError($.error.code,$.error.message,$.error.data);D(w)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream($,I,U){let{task:D}=U??{};if(!D){try{yield{type:"result",result:await this.request($,I,U)}}catch(w){yield{type:"error",error:w instanceof f?w:new f(l.InternalError,String(w))}}return}let b;try{let w=await this.request($,uI,U);if(w.task)b=w.task.taskId,yield{type:"taskCreated",task:w.task};else throw new f(l.InternalError,"Task creation did not return a task");while(!0){let A=await this.getTask({taskId:b},U);if(yield{type:"taskStatus",task:A},B4(A.status)){if(A.status==="completed")yield{type:"result",result:await this.getTaskResult({taskId:b},I,U)};else if(A.status==="failed")yield{type:"error",error:new f(l.InternalError,`Task ${b} failed`)};else if(A.status==="cancelled")yield{type:"error",error:new f(l.InternalError,`Task ${b} was cancelled`)};return}if(A.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:b},I,U)};return}let N=A.pollInterval??this._options?.defaultTaskPollInterval??1000;await new Promise((O)=>setTimeout(O,N)),U?.signal?.throwIfAborted()}}catch(w){yield{type:"error",error:w instanceof f?w:new f(l.InternalError,String(w))}}}request($,I,U){let{relatedRequestId:D,resumptionToken:b,onresumptiontoken:w,task:A,relatedTask:N}=U??{};return new Promise((O,X)=>{let G=(k)=>{X(k)};if(!this._transport){G(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{if(this.assertCapabilityForMethod($.method),A)this.assertTaskCapability($.method)}catch(k){G(k);return}U?.signal?.throwIfAborted();let Q=this._requestMessageId++,Y={...$,jsonrpc:"2.0",id:Q};if(U?.onprogress)this._progressHandlers.set(Q,U.onprogress),Y.params={...$.params,_meta:{...$.params?._meta||{},progressToken:Q}};if(A)Y.params={...Y.params,task:A};if(N)Y.params={...Y.params,_meta:{...Y.params?._meta||{},[Y4]:N}};let B=(k)=>{this._responseHandlers.delete(Q),this._progressHandlers.delete(Q),this._cleanupTimeout(Q),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:Q,reason:String(k)}},{relatedRequestId:D,resumptionToken:b,onresumptiontoken:w}).catch((x)=>this._onerror(new Error(`Failed to send cancellation: ${x}`)));let g=k instanceof f?k:new f(l.RequestTimeout,String(k));X(g)};this._responseHandlers.set(Q,(k)=>{if(U?.signal?.aborted)return;if(k instanceof Error)return X(k);try{let g=W4(I,k.result);if(!g.success)X(g.error);else O(g.data)}catch(g){X(g)}}),U?.signal?.addEventListener("abort",()=>{B(U?.signal?.reason)});let J=U?.timeout??Xk,L=()=>B(f.fromError(l.RequestTimeout,"Request timed out",{timeout:J}));this._setupTimeout(Q,J,U?.maxTotalTimeout,L,U?.resetTimeoutOnProgress??!1);let K=N?.taskId;if(K){let k=(g)=>{let x=this._responseHandlers.get(Q);if(x)x(g);else this._onerror(new Error(`Response handler missing for side-channeled request ${Q}`))};this._requestResolvers.set(Q,k),this._enqueueTaskMessage(K,{type:"request",message:Y,timestamp:Date.now()}).catch((g)=>{this._cleanupTimeout(Q),X(g)})}else this._transport.send(Y,{relatedRequestId:D,resumptionToken:b,onresumptiontoken:w}).catch((k)=>{this._cleanupTimeout(Q),X(k)})})}async getTask($,I){return this.request({method:"tasks/get",params:$},ew,I)}async getTaskResult($,I,U){return this.request({method:"tasks/result",params:$},I,U)}async listTasks($,I){return this.request({method:"tasks/list",params:$},IA,I)}async cancelTask($,I){return this.request({method:"tasks/cancel",params:$},i7,I)}async notification($,I){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability($.method);let U=I?.relatedTask?.taskId;if(U){let A={...$,jsonrpc:"2.0",params:{...$.params,_meta:{...$.params?._meta||{},[Y4]:I.relatedTask}}};await this._enqueueTaskMessage(U,{type:"notification",message:A,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes($.method)&&!$.params&&!I?.relatedRequestId&&!I?.relatedTask){if(this._pendingDebouncedNotifications.has($.method))return;this._pendingDebouncedNotifications.add($.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete($.method),!this._transport)return;let A={...$,jsonrpc:"2.0"};if(I?.relatedTask)A={...A,params:{...A.params,_meta:{...A.params?._meta||{},[Y4]:I.relatedTask}}};this._transport?.send(A,I).catch((N)=>this._onerror(N))});return}let w={...$,jsonrpc:"2.0"};if(I?.relatedTask)w={...w,params:{...w.params,_meta:{...w.params?._meta||{},[Y4]:I.relatedTask}}};await this._transport.send(w,I)}setRequestHandler($,I){let U=B9($);this.assertRequestHandlerCapability(U),this._requestHandlers.set(U,(D,b)=>{let w=v9($,D);return Promise.resolve(I(w,b))})}removeRequestHandler($){this._requestHandlers.delete($)}assertCanSetRequestHandler($){if(this._requestHandlers.has($))throw new Error(`A request handler for ${$} already exists, which would be overridden`)}setNotificationHandler($,I){let U=B9($);this._notificationHandlers.set(U,(D)=>{let b=v9($,D);return Promise.resolve(I(b))})}removeNotificationHandler($){this._notificationHandlers.delete($)}_cleanupTaskProgressHandler($){let I=this._taskProgressTokens.get($);if(I!==void 0)this._progressHandlers.delete(I),this._taskProgressTokens.delete($)}async _enqueueTaskMessage($,I,U){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let D=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue($,I,U,D)}async _clearTaskQueue($,I){if(this._taskMessageQueue){let U=await this._taskMessageQueue.dequeueAll($,I);for(let D of U)if(D.type==="request"&&dG(D.message)){let b=D.message.id,w=this._requestResolvers.get(b);if(w)w(new f(l.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(b);else this._onerror(new Error(`Resolver missing for request ${b} during task ${$} cleanup`))}}}async _waitForTaskUpdate($,I){let U=this._options?.defaultTaskPollInterval??1000;try{let D=await this._taskStore?.getTask($);if(D?.pollInterval)U=D.pollInterval}catch{}return new Promise((D,b)=>{if(I.aborted){b(new f(l.InvalidRequest,"Request cancelled"));return}let w=setTimeout(D,U);I.addEventListener("abort",()=>{clearTimeout(w),b(new f(l.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore($,I){let U=this._taskStore;if(!U)throw new Error("No task store configured");return{createTask:async(D)=>{if(!$)throw new Error("No request provided");return await U.createTask(D,$.id,{method:$.method,params:$.params},I)},getTask:async(D)=>{let b=await U.getTask(D,I);if(!b)throw new f(l.InvalidParams,"Failed to retrieve task: Task not found");return b},storeTaskResult:async(D,b,w)=>{await U.storeTaskResult(D,b,w,I);let A=await U.getTask(D,I);if(A){let N=gU.parse({method:"notifications/tasks/status",params:A});if(await this.notification(N),B4(A.status))this._cleanupTaskProgressHandler(D)}},getTaskResult:(D)=>{return U.getTaskResult(D,I)},updateTaskStatus:async(D,b,w)=>{let A=await U.getTask(D,I);if(!A)throw new f(l.InvalidParams,`Task "${D}" not found - it may have been cleaned up`);if(B4(A.status))throw new f(l.InvalidParams,`Cannot update task "${D}" from terminal status "${A.status}" to "${b}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await U.updateTaskStatus(D,b,w,I);let N=await U.getTask(D,I);if(N){let O=gU.parse({method:"notifications/tasks/status",params:N});if(await this.notification(O),B4(N.status))this._cleanupTaskProgressHandler(D)}},listTasks:(D)=>{return U.listTasks(D,I)}}}}function P5($){return $!==null&&typeof $==="object"&&!Array.isArray($)}function R5($,I){let U={...$};for(let D in I){let b=D,w=I[b];if(w===void 0)continue;let A=U[b];if(P5(A)&&P5(w))U[b]={...A,...w};else U[b]=w}return U}var Nz=kY(W8(),1),Oz=kY(Az(),1);function L_(){let $=new Nz.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return Oz.default($),$}class V8{constructor($){this._ajv=$??L_()}getValidator($){let I="$id"in $&&typeof $.$id==="string"?this._ajv.getSchema($.$id)??this._ajv.compile($):this._ajv.compile($);return(U)=>{if(I(U))return{valid:!0,data:U,errorMessage:void 0};else return{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(I.errors)}}}}class M8{constructor($){this._server=$}requestStream($,I,U){return this._server.requestStream($,I,U)}createMessageStream($,I){let U=this._server.getClientCapabilities();if(($.tools||$.toolChoice)&&!U?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if($.messages.length>0){let D=$.messages[$.messages.length-1],b=Array.isArray(D.content)?D.content:[D.content],w=b.some((X)=>X.type==="tool_result"),A=$.messages.length>1?$.messages[$.messages.length-2]:void 0,N=A?Array.isArray(A.content)?A.content:[A.content]:[],O=N.some((X)=>X.type==="tool_use");if(w){if(b.some((X)=>X.type!=="tool_result"))throw new Error("The last message must contain only tool_result content if any is present");if(!O)throw new Error("tool_result blocks are not matching any tool_use from the previous message")}if(O){let X=new Set(N.filter((Q)=>Q.type==="tool_use").map((Q)=>Q.id)),G=new Set(b.filter((Q)=>Q.type==="tool_result").map((Q)=>Q.toolUseId));if(X.size!==G.size||![...X].every((Q)=>G.has(Q)))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:$},lU,I)}elicitInputStream($,I){let U=this._server.getClientCapabilities(),D=$.mode??"form";switch(D){case"url":{if(!U?.elicitation?.url)throw new Error("Client does not support url elicitation.");break}case"form":{if(!U?.elicitation?.form)throw new Error("Client does not support form elicitation.");break}}let b=D==="form"&&$.mode===void 0?{...$,mode:"form"}:$;return this.requestStream({method:"elicitation/create",params:b},cI,I)}async getTask($,I){return this._server.getTask({taskId:$},I)}async getTaskResult($,I,U){return this._server.getTaskResult({taskId:$},I,U)}async listTasks($,I){return this._server.listTasks($?{cursor:$}:void 0,I)}async cancelTask($,I){return this._server.cancelTask({taskId:$},I)}}function Xz($,I,U){if(!$)throw new Error(`${U} does not support task creation (required for ${I})`);switch(I){case"tools/call":if(!$.tools?.call)throw new Error(`${U} does not support task creation for tools/call (required for ${I})`);break;default:break}}function Wz($,I,U){if(!$)throw new Error(`${U} does not support task creation (required for ${I})`);switch(I){case"sampling/createMessage":if(!$.sampling?.createMessage)throw new Error(`${U} does not support task creation for sampling/createMessage (required for ${I})`);break;case"elicitation/create":if(!$.elicitation?.create)throw new Error(`${U} does not support task creation for elicitation/create (required for ${I})`);break;default:break}}class K8 extends J9{constructor($,I){super(I);if(this._serverInfo=$,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(xU.options.map((U,D)=>[U,D])),this.isMessageIgnored=(U,D)=>{let b=this._loggingLevels.get(D);return b?this.LOG_LEVEL_SEVERITY.get(U)<this.LOG_LEVEL_SEVERITY.get(b):!1},this._capabilities=I?.capabilities??{},this._instructions=I?.instructions,this._jsonSchemaValidator=I?.jsonSchemaValidator??new V8,this.setRequestHandler(aG,(U)=>this._oninitialize(U)),this.setNotificationHandler(eG,()=>this.oninitialized?.()),this._capabilities.logging)this.setRequestHandler(w9,async(U,D)=>{let b=D.sessionId||D.requestInfo?.headers["mcp-session-id"]||void 0,{level:w}=U.params,A=xU.safeParse(w);if(A.success)this._loggingLevels.set(b,A.data);return{}})}get experimental(){if(!this._experimental)this._experimental={tasks:new M8(this)};return this._experimental}registerCapabilities($){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=R5(this._capabilities,$)}setRequestHandler($,I){let D=G4($)?.method;if(!D)throw new Error("Schema is missing a method literal");let b;if($6(D)){let A=D;b=A._zod?.def?.value??A.value}else{let A=D;b=A._def?.value??A.value}if(typeof b!=="string")throw new Error("Schema method literal must be a string");if(b==="tools/call"){let A=async(N,O)=>{let X=W4(nI,N);if(!X.success){let B=X.error instanceof Error?X.error.message:String(X.error);throw new f(l.InvalidParams,`Invalid tools/call request: ${B}`)}let{params:G}=X.data,Q=await Promise.resolve(I(N,O));if(G.task){let B=W4(uI,Q);if(!B.success){let J=B.error instanceof Error?B.error.message:String(B.error);throw new f(l.InvalidParams,`Invalid task creation result: ${J}`)}return B.data}let Y=W4(XA,Q);if(!Y.success){let B=Y.error instanceof Error?Y.error.message:String(Y.error);throw new f(l.InvalidParams,`Invalid tools/call result: ${B}`)}return Y.data};return super.setRequestHandler($,A)}return super.setRequestHandler($,I)}assertCapabilityForMethod($){switch($){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw new Error(`Client does not support sampling (required for ${$})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new Error(`Client does not support elicitation (required for ${$})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new Error(`Client does not support listing roots (required for ${$})`);break;case"ping":break}}assertNotificationCapability($){switch($){case"notifications/message":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${$})`);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 ${$})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new Error(`Server does not support notifying of tool list changes (required for ${$})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new Error(`Server does not support notifying of prompt list changes (required for ${$})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new Error(`Client does not support URL elicitation (required for ${$})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability($){if(!this._capabilities)return;switch($){case"completion/complete":if(!this._capabilities.completions)throw new Error(`Server does not support completions (required for ${$})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${$})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new Error(`Server does not support prompts (required for ${$})`);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 ${$})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new Error(`Server does not support tools (required for ${$})`);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 ${$})`);break;case"ping":case"initialize":break}}assertTaskCapability($){Wz(this._clientCapabilities?.tasks?.requests,$,"Client")}assertTaskHandlerCapability($){if(!this._capabilities)return;Xz(this._capabilities.tasks?.requests,$,"Server")}async _oninitialize($){let I=$.params.protocolVersion;return this._clientCapabilities=$.params.capabilities,this._clientVersion=$.params.clientInfo,{protocolVersion:_7.includes(I)?I:mG,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"},ow)}async createMessage($,I){if($.tools||$.toolChoice){if(!this._clientCapabilities?.sampling?.tools)throw new Error("Client does not support sampling tools capability.")}if($.messages.length>0){let U=$.messages[$.messages.length-1],D=Array.isArray(U.content)?U.content:[U.content],b=D.some((O)=>O.type==="tool_result"),w=$.messages.length>1?$.messages[$.messages.length-2]:void 0,A=w?Array.isArray(w.content)?w.content:[w.content]:[],N=A.some((O)=>O.type==="tool_use");if(b){if(D.some((O)=>O.type!=="tool_result"))throw new Error("The last message must contain only tool_result content if any is present");if(!N)throw new Error("tool_result blocks are not matching any tool_use from the previous message")}if(N){let O=new Set(A.filter((G)=>G.type==="tool_use").map((G)=>G.id)),X=new Set(D.filter((G)=>G.type==="tool_result").map((G)=>G.toolUseId));if(O.size!==X.size||![...O].every((G)=>X.has(G)))throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}if($.tools)return this.request({method:"sampling/createMessage",params:$},A9,I);return this.request({method:"sampling/createMessage",params:$},lU,I)}async elicitInput($,I){switch($.mode??"form"){case"url":{if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support url elicitation.");let D=$;return this.request({method:"elicitation/create",params:D},cI,I)}case"form":{if(!this._clientCapabilities?.elicitation?.form)throw new Error("Client does not support form elicitation.");let D=$.mode==="form"?$:{...$,mode:"form"},b=await this.request({method:"elicitation/create",params:D},cI,I);if(b.action==="accept"&&b.content&&D.requestedSchema)try{let A=this._jsonSchemaValidator.getValidator(D.requestedSchema)(b.content);if(!A.valid)throw new f(l.InvalidParams,`Elicitation response content does not match requested schema: ${A.errorMessage}`)}catch(w){if(w instanceof f)throw w;throw new f(l.InternalError,`Error validating elicitation response: ${w instanceof Error?w.message:String(w)}`)}return b}}}createElicitationCompletionNotifier($,I){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:$}},I)}async listRoots($,I){return this.request({method:"roots/list",params:$},N9,I)}async sendLoggingMessage($,I){if(this._capabilities.logging){if(!this.isMessageIgnored($.level,I))return this.notification({method:"notifications/message",params:$})}}async sendResourceUpdated($){return this.notification({method:"notifications/resources/updated",params:$})}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 Qz=Symbol.for("mcp.completable");function F8($){return!!$&&typeof $==="object"&&Qz in $}function Yz($){return $[Qz]?.complete}var Gz;(function($){$.Completable="McpCompletable"})(Gz||(Gz={}));var z_=/^[A-Za-z0-9._-]{1,128}$/;function V_($){let I=[];if($.length===0)return{isValid:!1,warnings:["Tool name cannot be empty"]};if($.length>128)return{isValid:!1,warnings:[`Tool name exceeds maximum length of 128 characters (current: ${$.length})`]};if($.includes(" "))I.push("Tool name contains spaces, which may cause parsing issues");if($.includes(","))I.push("Tool name contains commas, which may cause parsing issues");if($.startsWith("-")||$.endsWith("-"))I.push("Tool name starts or ends with a dash, which may cause parsing issues in some contexts");if($.startsWith(".")||$.endsWith("."))I.push("Tool name starts or ends with a dot, which may cause parsing issues in some contexts");if(!z_.test($)){let U=$.split("").filter((D)=>!/[A-Za-z0-9._-]/.test(D)).filter((D,b,w)=>w.indexOf(D)===b);return I.push(`Tool name contains invalid characters: ${U.map((D)=>`"${D}"`).join(", ")}`,"Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)"),{isValid:!1,warnings:I}}return{isValid:!0,warnings:I}}function M_($,I){if(I.length>0){console.warn(`Tool name validation warning for "${$}":`);for(let U of I)console.warn(` - ${U}`);console.warn("Tool registration will proceed, but this may cause compatibility issues."),console.warn("Consider updating the tool name to conform to the MCP tool naming standard."),console.warn("See SEP: Specify Format for Tool Names (https://github.com/modelcontextprotocol/modelcontextprotocol/issues/986) for more details.")}}function q8($){let I=V_($);return M_($,I.warnings),I.isValid}class k8{constructor($){this._mcpServer=$}registerToolTask($,I,U){let D={taskSupport:"required",...I.execution};if(D.taskSupport==="forbidden")throw new Error(`Cannot register task-based tool '${$}' with taskSupport 'forbidden'. Use registerTool() instead.`);return this._mcpServer._createRegisteredTool($,I.title,I.description,I.inputSchema,I.outputSchema,I.annotations,D,I._meta,U)}}class j8{constructor($,I){this._registeredResources={},this._registeredResourceTemplates={},this._registeredTools={},this._registeredPrompts={},this._toolHandlersInitialized=!1,this._completionHandlerInitialized=!1,this._resourceHandlersInitialized=!1,this._promptHandlersInitialized=!1,this.server=new K8($,I)}get experimental(){if(!this._experimental)this._experimental={tasks:new k8(this)};return this._experimental}async connect($){return await this.server.connect($)}async close(){await this.server.close()}setToolRequestHandlers(){if(this._toolHandlersInitialized)return;this.server.assertCanSetRequestHandler(K4(OA)),this.server.assertCanSetRequestHandler(K4(nI)),this.server.registerCapabilities({tools:{listChanged:!0}}),this.server.setRequestHandler(OA,()=>({tools:Object.entries(this._registeredTools).filter(([,$])=>$.enabled).map(([$,I])=>{let U={name:$,title:I.title,description:I.description,inputSchema:(()=>{let D=TI(I.inputSchema);return D?Y9(D,{strictUnions:!0,pipeStrategy:"input"}):K_})(),annotations:I.annotations,execution:I.execution,_meta:I._meta};if(I.outputSchema){let D=TI(I.outputSchema);if(D)U.outputSchema=Y9(D,{strictUnions:!0,pipeStrategy:"output"})}return U})})),this.server.setRequestHandler(nI,async($,I)=>{try{let U=this._registeredTools[$.params.name];if(!U)throw new f(l.InvalidParams,`Tool ${$.params.name} not found`);if(!U.enabled)throw new f(l.InvalidParams,`Tool ${$.params.name} disabled`);let D=!!$.params.task,b=U.execution?.taskSupport,w="createTask"in U.handler;if((b==="required"||b==="optional")&&!w)throw new f(l.InternalError,`Tool ${$.params.name} has taskSupport '${b}' but was not registered with registerToolTask`);if(b==="required"&&!D)throw new f(l.MethodNotFound,`Tool ${$.params.name} requires task augmentation (taskSupport: 'required')`);if(b==="optional"&&!D&&w)return await this.handleAutomaticTaskPolling(U,$,I);let A=await this.validateToolInput(U,$.params.arguments,$.params.name),N=await this.executeToolHandler(U,A,I);if(D)return N;return await this.validateToolOutput(U,N,$.params.name),N}catch(U){if(U instanceof f){if(U.code===l.UrlElicitationRequired)throw U}return this.createToolError(U instanceof Error?U.message:String(U))}}),this._toolHandlersInitialized=!0}createToolError($){return{content:[{type:"text",text:$}],isError:!0}}async validateToolInput($,I,U){if(!$.inputSchema)return;let b=TI($.inputSchema)??$.inputSchema,w=await Gw(b,I);if(!w.success){let A="error"in w?w.error:"Unknown error",N=Qw(A);throw new f(l.InvalidParams,`Input validation error: Invalid arguments for tool ${U}: ${N}`)}return w.data}async validateToolOutput($,I,U){if(!$.outputSchema)return;if(!("content"in I))return;if(I.isError)return;if(!I.structuredContent)throw new f(l.InvalidParams,`Output validation error: Tool ${U} has an output schema but no structured content was provided`);let D=TI($.outputSchema),b=await Gw(D,I.structuredContent);if(!b.success){let w="error"in b?b.error:"Unknown error",A=Qw(w);throw new f(l.InvalidParams,`Output validation error: Invalid structured content for tool ${U}: ${A}`)}}async executeToolHandler($,I,U){let D=$.handler;if("createTask"in D){if(!U.taskStore)throw new Error("No task store provided.");let w={...U,taskStore:U.taskStore};if($.inputSchema){let A=D;return await Promise.resolve(A.createTask(I,w))}else{let A=D;return await Promise.resolve(A.createTask(w))}}if($.inputSchema){let w=D;return await Promise.resolve(w(I,U))}else{let w=D;return await Promise.resolve(w(U))}}async handleAutomaticTaskPolling($,I,U){if(!U.taskStore)throw new Error("No task store provided for task-capable tool.");let D=await this.validateToolInput($,I.params.arguments,I.params.name),b=$.handler,w={...U,taskStore:U.taskStore},A=D?await Promise.resolve(b.createTask(D,w)):await Promise.resolve(b.createTask(w)),N=A.task.taskId,O=A.task,X=O.pollInterval??5000;while(O.status!=="completed"&&O.status!=="failed"&&O.status!=="cancelled"){await new Promise((Q)=>setTimeout(Q,X));let G=await U.taskStore.getTask(N);if(!G)throw new f(l.InternalError,`Task ${N} not found during polling`);O=G}return await U.taskStore.getTaskResult(N)}setCompletionRequestHandler(){if(this._completionHandlerInitialized)return;this.server.assertCanSetRequestHandler(K4(WA)),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler(WA,async($)=>{switch($.params.ref.type){case"ref/prompt":return d7($),this.handlePromptCompletion($,$.params.ref);case"ref/resource":return p7($),this.handleResourceCompletion($,$.params.ref);default:throw new f(l.InvalidParams,`Invalid completion reference: ${$.params.ref}`)}}),this._completionHandlerInitialized=!0}async handlePromptCompletion($,I){let U=this._registeredPrompts[I.name];if(!U)throw new f(l.InvalidParams,`Prompt ${I.name} not found`);if(!U.enabled)throw new f(l.InvalidParams,`Prompt ${I.name} disabled`);if(!U.argsSchema)return Wb;let b=G4(U.argsSchema)?.[$.params.argument.name];if(!F8(b))return Wb;let w=Yz(b);if(!w)return Wb;let A=await w($.params.argument.value,$.params.context);return vz(A)}async handleResourceCompletion($,I){let U=Object.values(this._registeredResourceTemplates).find((w)=>w.resourceTemplate.uriTemplate.toString()===I.uri);if(!U){if(this._registeredResources[I.uri])return Wb;throw new f(l.InvalidParams,`Resource template ${$.params.ref.uri} not found`)}let D=U.resourceTemplate.completeCallback($.params.argument.name);if(!D)return Wb;let b=await D($.params.argument.value,$.params.context);return vz(b)}setResourceRequestHandlers(){if(this._resourceHandlersInitialized)return;this.server.assertCanSetRequestHandler(K4(bA)),this.server.assertCanSetRequestHandler(K4(DA)),this.server.assertCanSetRequestHandler(K4(wA)),this.server.registerCapabilities({resources:{listChanged:!0}}),this.server.setRequestHandler(bA,async($,I)=>{let U=Object.entries(this._registeredResources).filter(([b,w])=>w.enabled).map(([b,w])=>({uri:b,name:w.name,...w.metadata})),D=[];for(let b of Object.values(this._registeredResourceTemplates)){if(!b.resourceTemplate.listCallback)continue;let w=await b.resourceTemplate.listCallback(I);for(let A of w.resources)D.push({...b.metadata,...A})}return{resources:[...U,...D]}}),this.server.setRequestHandler(DA,async()=>{return{resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([I,U])=>({name:I,uriTemplate:U.resourceTemplate.uriTemplate.toString(),...U.metadata}))}}),this.server.setRequestHandler(wA,async($,I)=>{let U=new URL($.params.uri),D=this._registeredResources[U.toString()];if(D){if(!D.enabled)throw new f(l.InvalidParams,`Resource ${U} disabled`);return D.readCallback(U,I)}for(let b of Object.values(this._registeredResourceTemplates)){let w=b.resourceTemplate.uriTemplate.match(U.toString());if(w)return b.readCallback(U,w,I)}throw new f(l.InvalidParams,`Resource ${U} not found`)}),this._resourceHandlersInitialized=!0}setPromptRequestHandlers(){if(this._promptHandlersInitialized)return;this.server.assertCanSetRequestHandler(K4(AA)),this.server.assertCanSetRequestHandler(K4(NA)),this.server.registerCapabilities({prompts:{listChanged:!0}}),this.server.setRequestHandler(AA,()=>({prompts:Object.entries(this._registeredPrompts).filter(([,$])=>$.enabled).map(([$,I])=>{return{name:$,title:I.title,description:I.description,arguments:I.argsSchema?F_(I.argsSchema):void 0}})})),this.server.setRequestHandler(NA,async($,I)=>{let U=this._registeredPrompts[$.params.name];if(!U)throw new f(l.InvalidParams,`Prompt ${$.params.name} not found`);if(!U.enabled)throw new f(l.InvalidParams,`Prompt ${$.params.name} disabled`);if(U.argsSchema){let D=TI(U.argsSchema),b=await Gw(D,$.params.arguments);if(!b.success){let N="error"in b?b.error:"Unknown error",O=Qw(N);throw new f(l.InvalidParams,`Invalid arguments for prompt ${$.params.name}: ${O}`)}let w=b.data,A=U.callback;return await Promise.resolve(A(w,I))}else{let D=U.callback;return await Promise.resolve(D(I))}}),this._promptHandlersInitialized=!0}resource($,I,...U){let D;if(typeof U[0]==="object")D=U.shift();let b=U[0];if(typeof I==="string"){if(this._registeredResources[I])throw new Error(`Resource ${I} is already registered`);let w=this._createRegisteredResource($,void 0,I,D,b);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),w}else{if(this._registeredResourceTemplates[$])throw new Error(`Resource template ${$} is already registered`);let w=this._createRegisteredResourceTemplate($,void 0,I,D,b);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),w}}registerResource($,I,U,D){if(typeof I==="string"){if(this._registeredResources[I])throw new Error(`Resource ${I} is already registered`);let b=this._createRegisteredResource($,U.title,I,U,D);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),b}else{if(this._registeredResourceTemplates[$])throw new Error(`Resource template ${$} is already registered`);let b=this._createRegisteredResourceTemplate($,U.title,I,U,D);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),b}}_createRegisteredResource($,I,U,D,b){let w={name:$,title:I,metadata:D,readCallback:b,enabled:!0,disable:()=>w.update({enabled:!1}),enable:()=>w.update({enabled:!0}),remove:()=>w.update({uri:null}),update:(A)=>{if(typeof A.uri!=="undefined"&&A.uri!==U){if(delete this._registeredResources[U],A.uri)this._registeredResources[A.uri]=w}if(typeof A.name!=="undefined")w.name=A.name;if(typeof A.title!=="undefined")w.title=A.title;if(typeof A.metadata!=="undefined")w.metadata=A.metadata;if(typeof A.callback!=="undefined")w.readCallback=A.callback;if(typeof A.enabled!=="undefined")w.enabled=A.enabled;this.sendResourceListChanged()}};return this._registeredResources[U]=w,w}_createRegisteredResourceTemplate($,I,U,D,b){let w={resourceTemplate:U,title:I,metadata:D,readCallback:b,enabled:!0,disable:()=>w.update({enabled:!1}),enable:()=>w.update({enabled:!0}),remove:()=>w.update({name:null}),update:(O)=>{if(typeof O.name!=="undefined"&&O.name!==$){if(delete this._registeredResourceTemplates[$],O.name)this._registeredResourceTemplates[O.name]=w}if(typeof O.title!=="undefined")w.title=O.title;if(typeof O.template!=="undefined")w.resourceTemplate=O.template;if(typeof O.metadata!=="undefined")w.metadata=O.metadata;if(typeof O.callback!=="undefined")w.readCallback=O.callback;if(typeof O.enabled!=="undefined")w.enabled=O.enabled;this.sendResourceListChanged()}};this._registeredResourceTemplates[$]=w;let A=U.uriTemplate.variableNames;if(Array.isArray(A)&&A.some((O)=>!!U.completeCallback(O)))this.setCompletionRequestHandler();return w}_createRegisteredPrompt($,I,U,D,b){let w={title:I,description:U,argsSchema:D===void 0?void 0:h4(D),callback:b,enabled:!0,disable:()=>w.update({enabled:!1}),enable:()=>w.update({enabled:!0}),remove:()=>w.update({name:null}),update:(A)=>{if(typeof A.name!=="undefined"&&A.name!==$){if(delete this._registeredPrompts[$],A.name)this._registeredPrompts[A.name]=w}if(typeof A.title!=="undefined")w.title=A.title;if(typeof A.description!=="undefined")w.description=A.description;if(typeof A.argsSchema!=="undefined")w.argsSchema=h4(A.argsSchema);if(typeof A.callback!=="undefined")w.callback=A.callback;if(typeof A.enabled!=="undefined")w.enabled=A.enabled;this.sendPromptListChanged()}};if(this._registeredPrompts[$]=w,D){if(Object.values(D).some((N)=>{let O=N instanceof lI?N._def?.innerType:N;return F8(O)}))this.setCompletionRequestHandler()}return w}_createRegisteredTool($,I,U,D,b,w,A,N,O){q8($);let X={title:I,description:U,inputSchema:Bz(D),outputSchema:Bz(b),annotations:w,execution:A,_meta:N,handler:O,enabled:!0,disable:()=>X.update({enabled:!1}),enable:()=>X.update({enabled:!0}),remove:()=>X.update({name:null}),update:(G)=>{if(typeof G.name!=="undefined"&&G.name!==$){if(typeof G.name==="string")q8(G.name);if(delete this._registeredTools[$],G.name)this._registeredTools[G.name]=X}if(typeof G.title!=="undefined")X.title=G.title;if(typeof G.description!=="undefined")X.description=G.description;if(typeof G.paramsSchema!=="undefined")X.inputSchema=h4(G.paramsSchema);if(typeof G.outputSchema!=="undefined")X.outputSchema=h4(G.outputSchema);if(typeof G.callback!=="undefined")X.handler=G.callback;if(typeof G.annotations!=="undefined")X.annotations=G.annotations;if(typeof G._meta!=="undefined")X._meta=G._meta;if(typeof G.enabled!=="undefined")X.enabled=G.enabled;this.sendToolListChanged()}};return this._registeredTools[$]=X,this.setToolRequestHandlers(),this.sendToolListChanged(),X}tool($,...I){if(this._registeredTools[$])throw new Error(`Tool ${$} is already registered`);let U,D,b,w;if(typeof I[0]==="string")U=I.shift();if(I.length>1){let N=I[0];if(E8(N)){if(D=I.shift(),I.length>1&&typeof I[0]==="object"&&I[0]!==null&&!E8(I[0]))w=I.shift()}else if(typeof N==="object"&&N!==null){if(Object.values(N).some((O)=>typeof O==="object"&&O!==null))throw new Error(`Tool ${$} expected a Zod schema or ToolAnnotations, but received an unrecognized object`);w=I.shift()}}let A=I[0];return this._createRegisteredTool($,void 0,U,D,b,w,{taskSupport:"forbidden"},void 0,A)}registerTool($,I,U){if(this._registeredTools[$])throw new Error(`Tool ${$} is already registered`);let{title:D,description:b,inputSchema:w,outputSchema:A,annotations:N,_meta:O}=I;return this._createRegisteredTool($,D,b,w,A,N,{taskSupport:"forbidden"},O,U)}prompt($,...I){if(this._registeredPrompts[$])throw new Error(`Prompt ${$} is already registered`);let U;if(typeof I[0]==="string")U=I.shift();let D;if(I.length>1)D=I.shift();let b=I[0],w=this._createRegisteredPrompt($,void 0,U,D,b);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),w}registerPrompt($,I,U){if(this._registeredPrompts[$])throw new Error(`Prompt ${$} is already registered`);let{title:D,description:b,argsSchema:w}=I,A=this._createRegisteredPrompt($,D,b,w,U);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),A}isConnected(){return this.server.transport!==void 0}async sendLoggingMessage($,I){return this.server.sendLoggingMessage($,I)}sendResourceListChanged(){if(this.isConnected())this.server.sendResourceListChanged()}sendToolListChanged(){if(this.isConnected())this.server.sendToolListChanged()}sendPromptListChanged(){if(this.isConnected())this.server.sendPromptListChanged()}}var K_={type:"object",properties:{}};function Jz($){return $!==null&&typeof $==="object"&&"parse"in $&&typeof $.parse==="function"&&"safeParse"in $&&typeof $.safeParse==="function"}function Hz($){return"_def"in $||"_zod"in $||Jz($)}function E8($){if(typeof $!=="object"||$===null)return!1;if(Hz($))return!1;if(Object.keys($).length===0)return!0;return Object.values($).some(Jz)}function Bz($){if(!$)return;if(E8($))return h4($);if(!Hz($))throw new Error("inputSchema must be a Zod schema or raw shape, received an unrecognized object");return $}function F_($){let I=G4($);if(!I)return[];return Object.entries(I).map(([U,D])=>{let b=zB(D),w=VB(D);return{name:U,description:b,required:!w}})}function K4($){let U=G4($)?.method;if(!U)throw new Error("Schema is missing a method literal");let D=Yw(U);if(typeof D==="string")return D;throw new Error("Schema method literal must be a string")}function vz($){return{completion:{values:$.slice(0,100),total:$.length,hasMore:$.length>100}}}var Wb={completion:{values:[],hasMore:!1}};import zz from"node:process";class S8{append($){this._buffer=this._buffer?Buffer.concat([this._buffer,$]):$}readMessage(){if(!this._buffer)return null;let $=this._buffer.indexOf(`
|
|
36
|
-
`);if($===-1)return null;let I=this._buffer.toString("utf8",0,$).replace(/\r$/,"");return this._buffer=this._buffer.subarray($+1),
|
|
37
|
-
`}class P8{constructor($=zz.stdin,I=zz.stdout){this._stdin=$,this._stdout=I,this._readBuffer=new S8,this._started=!1,this._ondata=(U)=>{this._readBuffer.append(U),this.processReadBuffer()},this._onerror=(U)=>{this.onerror?.(U)}}async start(){if(this._started)throw new Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");this._started=!0,this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror)}processReadBuffer(){while(!0)try{let $=this._readBuffer.readMessage();if($===null)break;this.onmessage?.($)}catch($){this.onerror?.($)}}async close(){if(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($){return new Promise((I)=>{let U=Lz($);if(this._stdout.write(U))I();else this._stdout.once("drain",I)})}}var{create:k_,defineProperty:Vz,getOwnPropertyDescriptor:E_,getOwnPropertyNames:Mz,getPrototypeOf:j_}=Object,S_=Object.prototype.hasOwnProperty,J6=($,I)=>function(){return I||$[Mz($)[0]]((I={exports:{}}).exports,I),I.exports},P_=($,I,U,D)=>{if(I&&typeof I==="object"||typeof I==="function"){for(var b=Mz(I),w=0,A=b.length,N;w<A;w++)if(N=b[w],!S_.call($,N)&&N!==U)Vz($,N,{get:((O)=>I[O]).bind(null,N),enumerable:!(D=E_(I,N))||D.enumerable})}return $},Y$=($,I,U)=>(U=$!=null?k_(j_($)):{},P_(I||!$||!$.__esModule?Vz(U,"default",{value:$,enumerable:!0}):U,$)),Kz=J6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"($,I){function U(D){return I.exports=U=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(b){return typeof b}:function(b){return b&&typeof Symbol=="function"&&b.constructor===Symbol&&b!==Symbol.prototype?"symbol":typeof b},I.exports.__esModule=!0,I.exports.default=I.exports,U(D)}I.exports=U,I.exports.__esModule=!0,I.exports.default=I.exports}}),R_=J6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"($,I){var U=Kz().default;function D(b,w){if(U(b)!="object"||!b)return b;var A=b[Symbol.toPrimitive];if(A!==void 0){var N=A.call(b,w||"default");if(U(N)!="object")return N;throw new TypeError("@@toPrimitive must return a primitive value.")}return(w==="string"?String:Number)(b)}I.exports=D,I.exports.__esModule=!0,I.exports.default=I.exports}}),T_=J6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"($,I){var U=Kz().default,D=R_();function b(w){var A=D(w,"string");return U(A)=="symbol"?A:A+""}I.exports=b,I.exports.__esModule=!0,I.exports.default=I.exports}}),R6=J6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"($,I){var U=T_();function D(b,w,A){return(w=U(w))in b?Object.defineProperty(b,w,{value:A,enumerable:!0,configurable:!0,writable:!0}):b[w]=A,b}I.exports=D,I.exports.__esModule=!0,I.exports.default=I.exports}}),q$=J6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"($,I){var U=R6();function D(w,A){var N=Object.keys(w);if(Object.getOwnPropertySymbols){var O=Object.getOwnPropertySymbols(w);A&&(O=O.filter(function(X){return Object.getOwnPropertyDescriptor(w,X).enumerable})),N.push.apply(N,O)}return N}function b(w){for(var A=1;A<arguments.length;A++){var N=arguments[A]!=null?arguments[A]:{};A%2?D(Object(N),!0).forEach(function(O){U(w,O,N[O])}):Object.getOwnPropertyDescriptors?Object.defineProperties(w,Object.getOwnPropertyDescriptors(N)):D(Object(N)).forEach(function(O){Object.defineProperty(w,O,Object.getOwnPropertyDescriptor(N,O))})}return w}I.exports=b,I.exports.__esModule=!0,I.exports.default=I.exports}});function T6($){let I={subscribe(U){let D=null,b=!1,w=!1,A=!1;function N(){if(D===null){A=!0;return}if(w)return;if(w=!0,typeof D==="function")D();else if(D)D.unsubscribe()}if(D=$({next(O){var X;if(b)return;(X=U.next)===null||X===void 0||X.call(U,O)},error(O){var X;if(b)return;b=!0,(X=U.error)===null||X===void 0||X.call(U,O),N()},complete(){var O;if(b)return;b=!0,(O=U.complete)===null||O===void 0||O.call(U),N()}}),A)N();return{unsubscribe:N}},pipe(...U){return U.reduce(__,I)}};return I}function __($,I){return I($)}function R8($){let I=new AbortController;return new Promise((D,b)=>{let w=!1;function A(){if(w)return;w=!0,N.unsubscribe()}I.signal.addEventListener("abort",()=>{b(I.signal.reason)});let N=$.subscribe({next(O){w=!0,D(O),A()},error(O){b(O)},complete(){I.abort(),A()}})})}function T8($){return(I)=>{let U=0,D=null,b=[];function w(){if(D)return;D=I.subscribe({next(N){for(let X of b){var O;(O=X.next)===null||O===void 0||O.call(X,N)}},error(N){for(let X of b){var O;(O=X.error)===null||O===void 0||O.call(X,N)}},complete(){for(let O of b){var N;(N=O.complete)===null||N===void 0||N.call(O)}}})}function A(){if(U===0&&D){let N=D;D=null,N.unsubscribe()}}return T6((N)=>{return U++,b.push(N),w(),{unsubscribe(){U--,A();let O=b.findIndex((X)=>X===N);if(O>-1)b.splice(O,1)}}})}}var an=Symbol();function sA($){let I=$,U=[],D=(A)=>{if(I!==void 0)A.next(I);U.push(A)},b=(A)=>{U.splice(U.indexOf(A),1)},w=T6((A)=>{return D(A),()=>{b(A)}});return w.next=(A)=>{if(I===A)return;I=A;for(let N of U)N.next(A)},w.get=()=>I,w}function Fz($){return T6((I)=>{function U(b=0,w=$.op){let A=$.links[b];if(!A)throw new Error("No more links to execute - did you forget to add an ending link?");return A({op:w,next(O){return U(b+1,O)}})}return U().subscribe(I)})}function m6($){return!!$&&!Array.isArray($)&&typeof $==="object"}function $N(){return Object.create(null)}var U1={PARSE_ERROR:-32700,BAD_REQUEST:-32600,INTERNAL_SERVER_ERROR:-32603,NOT_IMPLEMENTED:-32603,BAD_GATEWAY:-32603,SERVICE_UNAVAILABLE:-32603,GATEWAY_TIMEOUT:-32603,UNAUTHORIZED:-32001,PAYMENT_REQUIRED:-32002,FORBIDDEN:-32003,NOT_FOUND:-32004,METHOD_NOT_SUPPORTED:-32005,TIMEOUT:-32008,CONFLICT:-32009,PRECONDITION_FAILED:-32012,PAYLOAD_TOO_LARGE:-32013,UNSUPPORTED_MEDIA_TYPE:-32015,UNPROCESSABLE_CONTENT:-32022,PRECONDITION_REQUIRED:-32028,TOO_MANY_REQUESTS:-32029,CLIENT_CLOSED_REQUEST:-32099};var qz=[U1.BAD_GATEWAY,U1.SERVICE_UNAVAILABLE,U1.GATEWAY_TIMEOUT,U1.INTERNAL_SERVER_ERROR];var{create:Z_,defineProperty:Ez,getOwnPropertyDescriptor:f_,getOwnPropertyNames:jz,getPrototypeOf:g_}=Object,y_=Object.prototype.hasOwnProperty,Gb=($,I)=>function(){return I||$[jz($)[0]]((I={exports:{}}).exports,I),I.exports},x_=($,I,U,D)=>{if(I&&typeof I==="object"||typeof I==="function"){for(var b=jz(I),w=0,A=b.length,N;w<A;w++)if(N=b[w],!y_.call($,N)&&N!==U)Ez($,N,{get:((O)=>I[O]).bind(null,N),enumerable:!(D=f_(I,N))||D.enumerable})}return $},Qb=($,I,U)=>(U=$!=null?Z_(g_($)):{},x_(I||!$||!$.__esModule?Ez(U,"default",{value:$,enumerable:!0}):U,$)),Sz=()=>{},kz=($)=>{if(Object.freeze)Object.freeze($)};function Pz($,I,U){var D;let b=I.join(".");return(D=U[b])!==null&&D!==void 0||(U[b]=new Proxy(Sz,{get(w,A){if(typeof A!=="string"||A==="then")return;return Pz($,[...I,A],U)},apply(w,A,N){let O=I[I.length-1];if(O==="valueOf"||O==="toString"||O==="toJSON")return`tRPC.proxy(${I.slice(0,-1).join(".")})`;let X={args:N,path:I};if(O==="call")X={args:N.length>=2?[N[1]]:[],path:I.slice(0,-1)};else if(O==="apply")X={args:N.length>=2?N[1]:[],path:I.slice(0,-1)};return kz(X.args),kz(X.path),$(X)}})),U[b]}var IN=($)=>Pz($,[],$N()),_8=($)=>{return new Proxy(Sz,{get(I,U){if(U==="then")return;return $(U)}})};var Rz=Gb({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"($,I){function U(D){return I.exports=U=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(b){return typeof b}:function(b){return b&&typeof Symbol=="function"&&b.constructor===Symbol&&b!==Symbol.prototype?"symbol":typeof b},I.exports.__esModule=!0,I.exports.default=I.exports,U(D)}I.exports=U,I.exports.__esModule=!0,I.exports.default=I.exports}}),l_=Gb({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"($,I){var U=Rz().default;function D(b,w){if(U(b)!="object"||!b)return b;var A=b[Symbol.toPrimitive];if(A!==void 0){var N=A.call(b,w||"default");if(U(N)!="object")return N;throw new TypeError("@@toPrimitive must return a primitive value.")}return(w==="string"?String:Number)(b)}I.exports=D,I.exports.__esModule=!0,I.exports.default=I.exports}}),h_=Gb({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"($,I){var U=Rz().default,D=l_();function b(w){var A=D(w,"string");return U(A)=="symbol"?A:A+""}I.exports=b,I.exports.__esModule=!0,I.exports.default=I.exports}}),C8=Gb({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"($,I){var U=h_();function D(b,w,A){return(w=U(w))in b?Object.defineProperty(b,w,{value:A,enumerable:!0,configurable:!0,writable:!0}):b[w]=A,b}I.exports=D,I.exports.__esModule=!0,I.exports.default=I.exports}}),UN=Gb({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"($,I){var U=C8();function D(w,A){var N=Object.keys(w);if(Object.getOwnPropertySymbols){var O=Object.getOwnPropertySymbols(w);A&&(O=O.filter(function(X){return Object.getOwnPropertyDescriptor(w,X).enumerable})),N.push.apply(N,O)}return N}function b(w){for(var A=1;A<arguments.length;A++){var N=arguments[A]!=null?arguments[A]:{};A%2?D(Object(N),!0).forEach(function(O){U(w,O,N[O])}):Object.getOwnPropertyDescriptors?Object.defineProperties(w,Object.getOwnPropertyDescriptors(N)):D(Object(N)).forEach(function(O){Object.defineProperty(w,O,Object.getOwnPropertyDescriptor(N,O))})}return w}I.exports=b,I.exports.__esModule=!0,I.exports.default=I.exports}}),Qc=Qb(UN(),1);var Jc=Qb(C8(),1);var bN=Qb(UN(),1);function n_($,I){if("error"in $){let D=I.deserialize($.error);return{ok:!1,error:bN.default(bN.default({},$),{},{error:D})}}return{ok:!0,result:bN.default(bN.default({},$.result),(!$.result.type||$.result.type==="data")&&{type:"data",data:I.deserialize($.result.data)})}}var Z8=class extends Error{constructor(){super("Unable to transform response from server")}};function f8($,I){let U;try{U=n_($,I)}catch(D){throw new Z8}if(!U.ok&&(!m6(U.error.error)||typeof U.error.error.code!=="number"))throw new Z8;if(U.ok&&!m6(U.result))throw new Z8;return U}var Hc=Qb(UN(),1);var Lc=Symbol();var DN=Y$(R6(),1),b1=Y$(q$(),1);function Tz($){return $ instanceof F4}function o_($){return m6($)&&m6($.error)&&typeof $.error.code==="number"&&typeof $.error.message==="string"}function d_($,I){if(typeof $==="string")return $;if(m6($)&&typeof $.message==="string")return $.message;return I}var F4=class $ extends Error{constructor(I,U){var D,b;let w=U===null||U===void 0?void 0:U.cause;super(I,{cause:w});DN.default(this,"cause",void 0),DN.default(this,"shape",void 0),DN.default(this,"data",void 0),DN.default(this,"meta",void 0),this.meta=U===null||U===void 0?void 0:U.meta,this.cause=w,this.shape=U===null||U===void 0||(D=U.result)===null||D===void 0?void 0:D.error,this.data=U===null||U===void 0||(b=U.result)===null||b===void 0?void 0:b.error.data,this.name="TRPCClientError",Object.setPrototypeOf(this,$.prototype)}static from(I,U={}){let D=I;if(Tz(D)){if(U.meta)D.meta=b1.default(b1.default({},D.meta),U.meta);return D}if(o_(D))return new $(D.error.message,b1.default(b1.default({},U),{},{result:D,cause:U.cause}));return new $(d_(D,"Unknown error"),b1.default(b1.default({},U),{},{cause:D}))}};function wN($){let I=$;if(!I)return{input:{serialize:(U)=>U,deserialize:(U)=>U},output:{serialize:(U)=>U,deserialize:(U)=>U}};if("input"in I)return I;return{input:I,output:I}}var _z=($)=>typeof $==="function";function Cz($){if($)return $;if(typeof window!=="undefined"&&_z(window.fetch))return window.fetch;if(typeof globalThis!=="undefined"&&_z(globalThis.fetch))return globalThis.fetch;throw new Error("No fetch implementation found")}var Yb=Y$(q$(),1);function AN($){return{url:$.url.toString(),fetch:$.fetch,transformer:wN($.transformer),methodOverride:$.methodOverride}}function p_($){let I={};for(let U=0;U<$.length;U++){let D=$[U];I[U]=D}return I}var t_={query:"GET",mutation:"POST",subscription:"PATCH"};function Zz($){return"input"in $?$.transformer.input.serialize($.input):p_($.inputs.map((I)=>$.transformer.input.serialize(I)))}var D1=($)=>{let I=$.url.split("?"),D=I[0].replace(/\/$/,"")+"/"+$.path,b=[];if(I[1])b.push(I[1]);if("inputs"in $)b.push("batch=1");if($.type==="query"||$.type==="subscription"){let w=Zz($);if(w!==void 0&&$.methodOverride!=="POST")b.push(`input=${encodeURIComponent(JSON.stringify(w))}`)}if(b.length)D+="?"+b.join("&");return D},fz=($)=>{if($.type==="query"&&$.methodOverride!=="POST")return;let I=Zz($);return I!==void 0?JSON.stringify(I):void 0},g8=($)=>{return NN(Yb.default(Yb.default({},$),{},{contentTypeHeader:"application/json",getUrl:D1,getBody:fz}))},a_=class extends Error{constructor(){super("AbortError");this.name="AbortError",this.message="AbortError"}},e_=($)=>{var I;if(!($===null||$===void 0?void 0:$.aborted))return;if((I=$.throwIfAborted)===null||I===void 0||I.call($),typeof DOMException!=="undefined")throw new DOMException("AbortError","AbortError");throw new a_};async function gz($){var I,U;e_($.signal);let D=$.getUrl($),b=$.getBody($),w=(I=$.methodOverride)!==null&&I!==void 0?I:t_[$.type],A=await(async()=>{let O=await $.headers();if(Symbol.iterator in O)return Object.fromEntries(O);return O})(),N=Yb.default(Yb.default(Yb.default({},$.contentTypeHeader&&w!=="GET"?{"content-type":$.contentTypeHeader}:{}),$.trpcAcceptHeader?{[(U=$.trpcAcceptHeaderKey)!==null&&U!==void 0?U:"trpc-accept"]:$.trpcAcceptHeader}:void 0),A);return Cz($.fetch)(D,{method:w,signal:$.signal,body:b,headers:N})}async function NN($){let I={},U=await gz($);I.response=U;let D=await U.json();return I.responseJSON=D,{json:D,meta:I}}function yz($){return $ instanceof Uint8Array||$ instanceof Blob}function xz($){return $ instanceof FormData}var w1=Y$(q$(),1),s_=($)=>{if("input"in $){let{input:I}=$;if(xz(I)){if($.type!=="mutation"&&$.methodOverride!=="POST")throw new Error("FormData is only supported for mutations");return NN(w1.default(w1.default({},$),{},{contentTypeHeader:void 0,getUrl:D1,getBody:()=>I}))}if(yz(I)){if($.type!=="mutation"&&$.methodOverride!=="POST")throw new Error("Octet type input is only supported for mutations");return NN(w1.default(w1.default({},$),{},{contentTypeHeader:"application/octet-stream",getUrl:D1,getBody:()=>I}))}}return g8($)};function y8($){let I=AN($);return()=>{return(U)=>{let{op:D}=U;return T6((b)=>{let{path:w,input:A,type:N}=D;if(N==="subscription")throw new Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");let O=s_(w1.default(w1.default({},I),{},{type:N,path:w,input:A,signal:D.signal,headers(){if(!$.headers)return{};if(typeof $.headers==="function")return $.headers({op:D});return $.headers}})),X=void 0;return O.then((G)=>{X=G.meta;let Q=f8(G.json,I.transformer.output);if(!Q.ok){b.error(F4.from(Q.error,{meta:X}));return}b.next({context:G.meta,result:Q.result}),b.complete()}).catch((G)=>{b.error(F4.from(G,{meta:X}))}),()=>{}})}}}var vr=Y$(q$(),1);var Lr=Y$(q$(),1);var x8=($,...I)=>{return typeof $==="function"?$(...I):$},qr=Y$(R6(),1);function $C(){let $,I;return{promise:new Promise((D,b)=>{$=D,I=b}),resolve:$,reject:I}}async function IC($){let I=await x8($.url);if(!$.connectionParams)return I;let D=`${I.includes("?")?"&":"?"}connectionParams=1`;return I+D}async function UC($,I){let U={method:"connectionParams",data:await x8($)};return I.encode(U)}var kr=Y$(R6(),1);var q4=Y$(R6(),1);function bC($){let{promise:I,resolve:U,reject:D}=$C();return $.addEventListener("open",()=>{$.removeEventListener("error",D),U()}),$.addEventListener("error",D),I}function DC($,{intervalMs:I,pongTimeoutMs:U}){let D,b;function w(){D=setTimeout(()=>{$.send("PING"),b=setTimeout(()=>{$.close()},U)},I)}function A(){clearTimeout(D),w()}function N(){clearTimeout(b),A()}$.addEventListener("open",w),$.addEventListener("message",({data:O})=>{if(clearTimeout(D),w(),O==="PONG")N()}),$.addEventListener("close",()=>{clearTimeout(D),clearTimeout(b)})}var wC=class ${constructor(I){var U;if(q4.default(this,"id",++$.connectCount),q4.default(this,"WebSocketPonyfill",void 0),q4.default(this,"urlOptions",void 0),q4.default(this,"keepAliveOpts",void 0),q4.default(this,"encoder",void 0),q4.default(this,"wsObservable",sA(null)),q4.default(this,"openPromise",null),this.WebSocketPonyfill=(U=I.WebSocketPonyfill)!==null&&U!==void 0?U:WebSocket,!this.WebSocketPonyfill)throw new Error("No WebSocket implementation found - you probably don't want to use this on the server, but if you do you need to pass a `WebSocket`-ponyfill");this.urlOptions=I.urlOptions,this.keepAliveOpts=I.keepAlive,this.encoder=I.encoder}get ws(){return this.wsObservable.get()}set ws(I){this.wsObservable.next(I)}isOpen(){return!!this.ws&&this.ws.readyState===this.WebSocketPonyfill.OPEN&&!this.openPromise}isClosed(){return!!this.ws&&(this.ws.readyState===this.WebSocketPonyfill.CLOSING||this.ws.readyState===this.WebSocketPonyfill.CLOSED)}async open(){var I=this;if(I.openPromise)return I.openPromise;I.id=++$.connectCount;let U=IC(I.urlOptions).then((D)=>new I.WebSocketPonyfill(D));I.openPromise=U.then(async(D)=>{if(I.ws=D,D.binaryType="arraybuffer",D.addEventListener("message",function({data:b}){if(b==="PING")this.send("PONG")}),I.keepAliveOpts.enabled)DC(D,I.keepAliveOpts);if(D.addEventListener("close",()=>{if(I.ws===D)I.ws=null}),await bC(D),I.urlOptions.connectionParams)D.send(await UC(I.urlOptions.connectionParams,I.encoder))});try{await I.openPromise}finally{I.openPromise=null}}async close(){var I=this;try{await I.openPromise}finally{var U;(U=I.ws)===null||U===void 0||U.close()}}};q4.default(wC,"connectCount",0);var Er=Y$(R6(),1),jr=Y$(q$(),1);var l8=Y$(R6(),1),lz=Y$(q$(),1),AC=class{constructor($){l8.default(this,"links",void 0),l8.default(this,"runtime",void 0),l8.default(this,"requestId",void 0),this.requestId=0,this.runtime={},this.links=$.links.map((I)=>I(this.runtime))}$request($){var I;return Fz({links:this.links,op:lz.default(lz.default({},$),{},{context:(I=$.context)!==null&&I!==void 0?I:{},id:++this.requestId})}).pipe(T8())}async requestAsPromise($){var I=this;try{let U=I.$request($);return(await R8(U)).result.data}catch(U){throw F4.from(U)}}query($,I,U){return this.requestAsPromise({type:"query",path:$,input:I,context:U===null||U===void 0?void 0:U.context,signal:U===null||U===void 0?void 0:U.signal})}mutation($,I,U){return this.requestAsPromise({type:"mutation",path:$,input:I,context:U===null||U===void 0?void 0:U.context,signal:U===null||U===void 0?void 0:U.signal})}subscription($,I,U){return this.$request({type:"subscription",path:$,input:I,context:U.context,signal:U.signal}).subscribe({next(b){switch(b.result.type){case"state":{var w;(w=U.onConnectionStateChange)===null||w===void 0||w.call(U,b.result);break}case"started":{var A;(A=U.onStarted)===null||A===void 0||A.call(U,{context:b.context});break}case"stopped":{var N;(N=U.onStopped)===null||N===void 0||N.call(U);break}case"data":case void 0:{var O;(O=U.onData)===null||O===void 0||O.call(U,b.result.data);break}}},error(b){var w;(w=U.onError)===null||w===void 0||w.call(U,b)},complete(){var b;(b=U.onComplete)===null||b===void 0||b.call(U)}})}};var NC=Symbol.for("trpc_untypedClient"),OC={query:"query",mutate:"mutation",subscribe:"subscription"},XC=($)=>{return OC[$]};function WC($){let I=IN(({path:U,args:D})=>{let b=[...U],w=XC(b.pop()),A=b.join(".");return $[w](A,...D)});return _8((U)=>{if(U===NC)return $;return I[U]})}function hz($){let I=new AC($);return WC(I)}var Um=Y$(q$(),1);var bm=Y$(q$(),1);var GC=J6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js"($,I){function U(b){var w,A,N,O=2;for(typeof Symbol!="undefined"&&(A=Symbol.asyncIterator,N=Symbol.iterator);O--;){if(A&&(w=b[A])!=null)return w.call(b);if(N&&(w=b[N])!=null)return new D(w.call(b));A="@@asyncIterator",N="@@iterator"}throw new TypeError("Object is not async iterable")}function D(b){function w(A){if(Object(A)!==A)return Promise.reject(new TypeError(A+" is not an object."));var N=A.done;return Promise.resolve(A.value).then(function(O){return{value:O,done:N}})}return D=function A(N){this.s=N,this.n=N.next},D.prototype={s:null,n:null,next:function A(){return w(this.n.apply(this.s,arguments))},return:function A(N){var O=this.s.return;return O===void 0?Promise.resolve({value:N,done:!0}):w(O.apply(this.s,arguments))},throw:function A(N){var O=this.s.return;return O===void 0?Promise.reject(N):w(O.apply(this.s,arguments))}},new D(b)}I.exports=U,I.exports.__esModule=!0,I.exports.default=I.exports}}),Dm=Y$(GC(),1);var wm=Y$(q$(),1);var QC=J6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js"($,I){function U(){var D=typeof SuppressedError=="function"?SuppressedError:function(N,O){var X=Error();return X.name="SuppressedError",X.error=N,X.suppressed=O,X},b={},w=[];function A(N,O){if(O!=null){if(Object(O)!==O)throw new TypeError("using declarations can only be used with objects, functions, null, or undefined.");if(N)var X=O[Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose")];if(X===void 0&&(X=O[Symbol.dispose||Symbol.for("Symbol.dispose")],N))var G=X;if(typeof X!="function")throw new TypeError("Object is not disposable.");G&&(X=function Q(){try{G.call(O)}catch(Y){return Promise.reject(Y)}}),w.push({v:O,d:X,a:N})}else N&&w.push({d:O,a:N});return O}return{e:b,u:A.bind(null,!1),a:A.bind(null,!0),d:function N(){var O,X=this.e,G=0;function Q(){for(;O=w.pop();)try{if(!O.a&&G===1)return G=0,w.push(O),Promise.resolve().then(Q);if(O.d){var B=O.d.call(O.v);if(O.a)return G|=2,Promise.resolve(B).then(Q,Y)}else G|=1}catch(J){return Y(J)}if(G===1)return X!==b?Promise.reject(X):Promise.resolve();if(X!==b)throw X}function Y(B){return X=X!==b?new D(B,X):B,Q()}return Q()}}}I.exports=U,I.exports.__esModule=!0,I.exports.default=I.exports}}),uz=J6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/OverloadYield.js"($,I){function U(D,b){this.v=D,this.k=b}I.exports=U,I.exports.__esModule=!0,I.exports.default=I.exports}}),YC=J6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/awaitAsyncGenerator.js"($,I){var U=uz();function D(b){return new U(b,0)}I.exports=D,I.exports.__esModule=!0,I.exports.default=I.exports}}),BC=J6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/wrapAsyncGenerator.js"($,I){var U=uz();function D(w){return function(){return new b(w.apply(this,arguments))}}function b(w){var A,N;function O(G,Q){try{var Y=w[G](Q),B=Y.value,J=B instanceof U;Promise.resolve(J?B.v:B).then(function(L){if(J){var K=G==="return"?"return":"next";if(!B.k||L.done)return O(K,L);L=w[K](L).value}X(Y.done?"return":"normal",L)},function(L){O("throw",L)})}catch(L){X("throw",L)}}function X(G,Q){switch(G){case"return":A.resolve({value:Q,done:!0});break;case"throw":A.reject(Q);break;default:A.resolve({value:Q,done:!1})}(A=A.next)?O(A.key,A.arg):N=null}this._invoke=function(G,Q){return new Promise(function(Y,B){var J={key:G,arg:Q,resolve:Y,reject:B,next:null};N?N=N.next=J:(A=N=J,O(G,Q))})},typeof w.return!="function"&&(this.return=void 0)}b.prototype[typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},b.prototype.next=function(w){return this._invoke("next",w)},b.prototype.throw=function(w){return this._invoke("throw",w)},b.prototype.return=function(w){return this._invoke("return",w)},I.exports=D,I.exports.__esModule=!0,I.exports.default=I.exports}}),Am=Y$(QC(),1),Nm=Y$(YC(),1),Om=Y$(BC(),1),Xm=Y$(q$(),1);class h8{constructor(){this.keyToValue=new Map,this.valueToKey=new Map}set($,I){this.keyToValue.set($,I),this.valueToKey.set(I,$)}getByKey($){return this.keyToValue.get($)}getByValue($){return this.valueToKey.get($)}clear(){this.keyToValue.clear(),this.valueToKey.clear()}}class Bb{constructor($){this.generateIdentifier=$,this.kv=new h8}register($,I){if(this.kv.getByValue($))return;if(!I)I=this.generateIdentifier($);this.kv.set(I,$)}clear(){this.kv.clear()}getIdentifier($){return this.kv.getByValue($)}getValue($){return this.kv.getByKey($)}}class u8 extends Bb{constructor(){super(($)=>$.name);this.classToAllowedProps=new Map}register($,I){if(typeof I==="object"){if(I.allowProps)this.classToAllowedProps.set($,I.allowProps);super.register($,I.identifier)}else super.register($,I)}getAllowedProps($){return this.classToAllowedProps.get($)}}function vC($){if("values"in Object)return Object.values($);let I=[];for(let U in $)if($.hasOwnProperty(U))I.push($[U]);return I}function iz($,I){let U=vC($);if("find"in U)return U.find(I);let D=U;for(let b=0;b<D.length;b++){let w=D[b];if(I(w))return w}return}function d4($,I){Object.entries($).forEach(([U,D])=>I(D,U))}function A1($,I){return $.indexOf(I)!==-1}function i8($,I){for(let U=0;U<$.length;U++){let D=$[U];if(I(D))return D}return}class n8{constructor(){this.transfomers={}}register($){this.transfomers[$.name]=$}findApplicable($){return iz(this.transfomers,(I)=>I.isApplicable($))}findByName($){return this.transfomers[$]}}var JC=($)=>Object.prototype.toString.call($).slice(8,-1),c8=($)=>typeof $==="undefined",HC=($)=>$===null,p4=($)=>{if(typeof $!=="object"||$===null)return!1;if($===Object.prototype)return!1;if(Object.getPrototypeOf($)===null)return!0;return Object.getPrototypeOf($)===Object.prototype},ON=($)=>p4($)&&Object.keys($).length===0,H6=($)=>Array.isArray($),LC=($)=>typeof $==="string",zC=($)=>typeof $==="number"&&!isNaN($),VC=($)=>typeof $==="boolean",nz=($)=>$ instanceof RegExp,k4=($)=>$ instanceof Map,E4=($)=>$ instanceof Set,r8=($)=>JC($)==="Symbol",cz=($)=>$ instanceof Date&&!isNaN($.valueOf()),XN=($)=>$ instanceof Error,m8=($)=>typeof $==="number"&&isNaN($),rz=($)=>VC($)||HC($)||c8($)||zC($)||LC($)||r8($),mz=($)=>typeof $==="bigint",oz=($)=>$===1/0||$===-1/0,dz=($)=>ArrayBuffer.isView($)&&!($ instanceof DataView),pz=($)=>$ instanceof URL;var WN=($)=>$.replace(/\\/g,"\\\\").replace(/\./g,"\\."),GN=($)=>$.map(String).map(WN).join("."),N1=($,I)=>{let U=[],D="";for(let w=0;w<$.length;w++){let A=$.charAt(w);if(!I&&A==="\\"){let X=$.charAt(w+1);if(X==="\\"){D+="\\",w++;continue}else if(X!==".")throw Error("invalid path")}if(A==="\\"&&$.charAt(w+1)==="."){D+=".",w++;continue}if(A==="."){U.push(D),D="";continue}D+=A}let b=D;return U.push(b),U};function _6($,I,U,D){return{isApplicable:$,annotation:I,transform:U,untransform:D}}var tz=[_6(c8,"undefined",()=>null,()=>{return}),_6(mz,"bigint",($)=>$.toString(),($)=>{if(typeof BigInt!=="undefined")return BigInt($);return console.error("Please add a BigInt polyfill."),$}),_6(cz,"Date",($)=>$.toISOString(),($)=>new Date($)),_6(XN,"Error",($,I)=>{let U={name:$.name,message:$.message};if("cause"in $)U.cause=$.cause;return I.allowedErrorProps.forEach((D)=>{U[D]=$[D]}),U},($,I)=>{let U=new Error($.message,{cause:$.cause});return U.name=$.name,U.stack=$.stack,I.allowedErrorProps.forEach((D)=>{U[D]=$[D]}),U}),_6(nz,"regexp",($)=>""+$,($)=>{let I=$.slice(1,$.lastIndexOf("/")),U=$.slice($.lastIndexOf("/")+1);return new RegExp(I,U)}),_6(E4,"set",($)=>[...$.values()],($)=>new Set($)),_6(k4,"map",($)=>[...$.entries()],($)=>new Map($)),_6(($)=>m8($)||oz($),"number",($)=>{if(m8($))return"NaN";if($>0)return"Infinity";else return"-Infinity"},Number),_6(($)=>$===0&&1/$===-1/0,"number",()=>{return"-0"},Number),_6(pz,"URL",($)=>$.toString(),($)=>new URL($))];function QN($,I,U,D){return{isApplicable:$,annotation:I,transform:U,untransform:D}}var az=QN(($,I)=>{if(r8($))return!!I.symbolRegistry.getIdentifier($);return!1},($,I)=>{return["symbol",I.symbolRegistry.getIdentifier($)]},($)=>$.description,($,I,U)=>{let D=U.symbolRegistry.getValue(I[1]);if(!D)throw new Error("Trying to deserialize unknown symbol");return D}),MC=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce(($,I)=>{return $[I.name]=I,$},{}),ez=QN(dz,($)=>["typed-array",$.constructor.name],($)=>[...$],($,I)=>{let U=MC[I[1]];if(!U)throw new Error("Trying to deserialize unknown typed array");return new U($)});function o8($,I){if($?.constructor)return!!I.classRegistry.getIdentifier($.constructor);return!1}var sz=QN(o8,($,I)=>{return["class",I.classRegistry.getIdentifier($.constructor)]},($,I)=>{let U=I.classRegistry.getAllowedProps($.constructor);if(!U)return{...$};let D={};return U.forEach((b)=>{D[b]=$[b]}),D},($,I,U)=>{let D=U.classRegistry.getValue(I[1]);if(!D)throw new Error(`Trying to deserialize unknown class '${I[1]}' - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564`);return Object.assign(Object.create(D.prototype),$)}),$3=QN(($,I)=>{return!!I.customTransformerRegistry.findApplicable($)},($,I)=>{return["custom",I.customTransformerRegistry.findApplicable($).name]},($,I)=>{return I.customTransformerRegistry.findApplicable($).serialize($)},($,I,U)=>{let D=U.customTransformerRegistry.findByName(I[1]);if(!D)throw new Error("Trying to deserialize unknown custom value");return D.deserialize($)}),KC=[sz,az,$3,ez],d8=($,I)=>{let U=i8(KC,(b)=>b.isApplicable($,I));if(U)return{value:U.transform($,I),type:U.annotation($,I)};let D=i8(tz,(b)=>b.isApplicable($,I));if(D)return{value:D.transform($,I),type:D.annotation};return},I3={};tz.forEach(($)=>{I3[$.annotation]=$});var U3=($,I,U)=>{if(H6(I))switch(I[0]){case"symbol":return az.untransform($,I,U);case"class":return sz.untransform($,I,U);case"custom":return $3.untransform($,I,U);case"typed-array":return ez.untransform($,I,U);default:throw new Error("Unknown transformation: "+I)}else{let D=I3[I];if(!D)throw new Error("Unknown transformation: "+I);return D.untransform($,U)}};var O1=($,I)=>{if(I>$.size)throw new Error("index out of bounds");let U=$.keys();while(I>0)U.next(),I--;return U.next().value};function b3($){if(A1($,"__proto__"))throw new Error("__proto__ is not allowed as a property");if(A1($,"prototype"))throw new Error("prototype is not allowed as a property");if(A1($,"constructor"))throw new Error("constructor is not allowed as a property")}var D3=($,I)=>{b3(I);for(let U=0;U<I.length;U++){let D=I[U];if(E4($))$=O1($,+D);else if(k4($)){let b=+D,w=+I[++U]===0?"key":"value",A=O1($,b);switch(w){case"key":$=A;break;case"value":$=$.get(A);break}}else $=$[D]}return $},YN=($,I,U)=>{if(b3(I),I.length===0)return U($);let D=$;for(let w=0;w<I.length-1;w++){let A=I[w];if(H6(D)){let N=+A;D=D[N]}else if(p4(D))D=D[A];else if(E4(D)){let N=+A;D=O1(D,N)}else if(k4(D)){if(w===I.length-2)break;let O=+A,X=+I[++w]===0?"key":"value",G=O1(D,O);switch(X){case"key":D=G;break;case"value":D=D.get(G);break}}}let b=I[I.length-1];if(H6(D))D[+b]=U(D[+b]);else if(p4(D))D[b]=U(D[b]);if(E4(D)){let w=O1(D,+b),A=U(w);if(w!==A)D.delete(w),D.add(A)}if(k4(D)){let w=+I[I.length-2],A=O1(D,w);switch(+b===0?"key":"value"){case"key":{let O=U(A);if(D.set(O,D.get(A)),O!==A)D.delete(A);break}case"value":{D.set(A,U(D.get(A)));break}}}return $};var w3=($)=>$<1;function p8($,I,U,D=[]){if(!$)return;let b=w3(U);if(!H6($)){d4($,(N,O)=>p8(N,I,U,[...D,...N1(O,b)]));return}let[w,A]=$;if(A)d4(A,(N,O)=>{p8(N,I,U,[...D,...N1(O,b)])});I(w,D)}function A3($,I,U,D){return p8(I,(b,w)=>{$=YN($,w,(A)=>U3(A,b,D))},U),$}function N3($,I,U){let D=w3(U);function b(w,A){let N=D3($,N1(A,D));w.map((O)=>N1(O,D)).forEach((O)=>{$=YN($,O,()=>N)})}if(H6(I)){let[w,A]=I;if(w.forEach((N)=>{$=YN($,N1(N,D),()=>$)}),A)d4(A,b)}else d4(I,b);return $}var FC=($,I)=>p4($)||H6($)||k4($)||E4($)||XN($)||o8($,I);function qC($,I,U){let D=U.get($);if(D)D.push(I);else U.set($,[I])}function O3($,I){let U={},D=void 0;if($.forEach((b)=>{if(b.length<=1)return;if(!I)b=b.map((N)=>N.map(String)).sort((N,O)=>N.length-O.length);let[w,...A]=b;if(w.length===0)D=A.map(GN);else U[GN(w)]=A.map(GN)}),D)if(ON(U))return[D];else return[D,U];else return ON(U)?void 0:U}var t8=($,I,U,D,b=[],w=[],A=new Map)=>{let N=rz($);if(!N){qC($,b,I);let B=A.get($);if(B)return D?{transformedValue:null}:B}if(!FC($,U)){let B=d8($,U),J=B?{transformedValue:B.value,annotations:[B.type]}:{transformedValue:$};if(!N)A.set($,J);return J}if(A1(w,$))return{transformedValue:null};let O=d8($,U),X=O?.value??$,G=H6(X)?[]:{},Q={};d4(X,(B,J)=>{if(J==="__proto__"||J==="constructor"||J==="prototype")throw new Error(`Detected property ${J}. This is a prototype pollution risk, please remove it from your object.`);let L=t8(B,I,U,D,[...b,J],[...w,$],A);if(G[J]=L.transformedValue,H6(L.annotations))Q[WN(J)]=L.annotations;else if(p4(L.annotations))d4(L.annotations,(K,k)=>{Q[WN(J)+"."+k]=K})});let Y=ON(Q)?{transformedValue:G,annotations:O?[O.type]:void 0}:{transformedValue:G,annotations:O?[O.type,Q]:Q};if(!N)A.set($,Y);return Y};function BN($){return Object.prototype.toString.call($).slice(8,-1)}function vN($){return BN($)==="Array"}function a8($){if(BN($)!=="Object")return!1;let I=Object.getPrototypeOf($);return!!I&&I.constructor===Object&&I===Object.prototype}function kC($,I,U,D,b){let w={}.propertyIsEnumerable.call(D,I)?"enumerable":"nonenumerable";if(w==="enumerable")$[I]=U;if(b&&w==="nonenumerable")Object.defineProperty($,I,{value:U,enumerable:!1,writable:!0,configurable:!0})}function JN($,I={}){if(vN($))return $.map((b)=>JN(b,I));if(!a8($))return $;let U=Object.getOwnPropertyNames($),D=Object.getOwnPropertySymbols($);return[...U,...D].reduce((b,w)=>{if(w==="__proto__")return b;if(vN(I.props)&&!I.props.includes(w))return b;let A=$[w],N=JN(A,I);return kC(b,w,N,$,I.nonenumerable),b},{})}class $${constructor({dedupe:$=!1}={}){this.classRegistry=new u8,this.symbolRegistry=new Bb((I)=>I.description??""),this.customTransformerRegistry=new n8,this.allowedErrorProps=[],this.dedupe=$}serialize($){let I=new Map,U=t8($,I,this,this.dedupe),D={json:U.transformedValue};if(U.annotations)D.meta={...D.meta,values:U.annotations};let b=O3(I,this.dedupe);if(b)D.meta={...D.meta,referentialEqualities:b};if(D.meta)D.meta.v=1;return D}deserialize($,I){let{json:U,meta:D}=$,b=I?.inPlace?U:JN(U);if(D?.values)b=A3(b,D.values,D.v??0,this);if(D?.referentialEqualities)b=N3(b,D.referentialEqualities,D.v??0);return b}stringify($){return JSON.stringify(this.serialize($))}parse($){return this.deserialize(JSON.parse($),{inPlace:!0})}registerClass($,I){this.classRegistry.register($,I)}registerSymbol($,I){this.symbolRegistry.register($,I)}registerCustom($,I){this.customTransformerRegistry.register({name:I,...$})}allowErrorProps(...$){this.allowedErrorProps.push(...$)}}$$.defaultInstance=new $$;$$.serialize=$$.defaultInstance.serialize.bind($$.defaultInstance);$$.deserialize=$$.defaultInstance.deserialize.bind($$.defaultInstance);$$.stringify=$$.defaultInstance.stringify.bind($$.defaultInstance);$$.parse=$$.defaultInstance.parse.bind($$.defaultInstance);$$.registerClass=$$.defaultInstance.registerClass.bind($$.defaultInstance);$$.registerSymbol=$$.defaultInstance.registerSymbol.bind($$.defaultInstance);$$.registerCustom=$$.defaultInstance.registerCustom.bind($$.defaultInstance);$$.allowErrorProps=$$.defaultInstance.allowErrorProps.bind($$.defaultInstance);var X3=$$;var{serialize:tm,deserialize:am,stringify:em,parse:sm,registerClass:$o,registerCustom:Io,registerSymbol:Uo,allowErrorProps:bo}=$$;class e8{trpc;constructor($){this.trpc=hz({links:[y8({url:`${$.apiUrl}/trpc`,transformer:X3,headers:()=>({Authorization:`Bearer ${$.apiKey}`})})]})}async whoami(){return this.trpc.apiKeys.whoami.query()}async search($){return this.trpc.search.blocks.query($)}async getContent($){return this.trpc.mcpTools.getContent.query($)}async readImage($){return this.trpc.mcpTools.readImage.query($)}async setImage($){return this.trpc.mcpTools.setImage.mutate($)}async situate($){return this.trpc.mcpTools.situate.query($)}async getWorkspaceContext(){return this.trpc.mcpTools.getWorkspaceContext.query()}async strReplaceBlock($){return this.trpc.mcpTools.strReplaceBlock.mutate($)}async insertBlock($){return this.trpc.mcpTools.insertBlock.mutate($)}async insertMatrix($){return this.trpc.mcpTools.insertMatrix.mutate($)}async createMatrixFromArtifact($){return this.trpc.mcpTools.createMatrixFromArtifact.mutate($)}async deleteBlock($){return this.trpc.mcpTools.deleteBlock.mutate($)}async createDocument($){return this.trpc.mcpTools.createDocument.mutate($)}async createLiterature($){return this.trpc.mcpTools.createLiterature.mutate($)}async searchArtifacts($){return this.trpc.mcpTools.searchArtifacts.query($)}async createRecord($){return this.trpc.mcpTools.createRecord.mutate($)}async listProcedureNodes($){return this.trpc.mcpTools.listProcedureNodes.query($)}async buildProcedureTree($){return this.trpc.mcpTools.buildProcedureTree.mutate($)}async insertProcedureNode($){return this.trpc.mcpTools.insertProcedureNode.mutate($)}async updateProcedureNode($){return this.trpc.mcpTools.updateProcedureNode.mutate($)}async updateArtifact($){return this.trpc.mcpTools.updateArtifact.mutate($)}async createArtifact($){return this.trpc.mcpTools.createArtifact.mutate($)}async reorderProcedureNodes($){return this.trpc.mcpTools.reorderProcedureNodes.mutate($)}async deleteProcedureNode($){return this.trpc.mcpTools.deleteProcedureNode.mutate($)}async appendMatrixRows($){return this.trpc.mcpTools.appendMatrixRows.mutate($)}async updateMatrixRows($){return this.trpc.mcpTools.updateMatrixRows.mutate($)}async deleteMatrixRows($){return this.trpc.mcpTools.deleteMatrixRows.mutate($)}async rebindMatrixToNode($){return this.trpc.mcpTools.rebindMatrixToNode.mutate($)}async deleteMatrix($){return this.trpc.mcpTools.deleteMatrix.mutate($)}async attachMatrix($){return this.trpc.mcpTools.attachMatrix.mutate($)}async listMatrixReferences($){let U=(await this.trpc.mcpTools.listMatrixReferences.query($)).references??[];return{success:!0,matrixId:$.matrixId,references:U,totalCount:U.length}}async linkArtifactToNode($){return this.trpc.mcpTools.linkArtifactToNode.mutate($)}async updateEdge($){return this.trpc.mcpTools.updateEdge.mutate($)}async updateArtifactLinkRelation($){return this.trpc.mcpTools.updateArtifactLinkRelation.mutate($)}async unlinkArtifactFromNode($){return this.trpc.mcpTools.unlinkArtifactFromNode.mutate($)}async listNodeArtifactLinks($){return this.trpc.mcpTools.listNodeArtifactLinks.query($)}async instantiateArtifactTemplate($){return this.trpc.mcpTools.instantiateArtifactTemplate.mutate($)}}function s8($="SURA MCP"){return{info:(I,...U)=>{},error:(I,...U)=>{},warn:(I,...U)=>{},debug:(I,...U)=>{if(process.env.DEBUG);}}}var o6=s8();async function W3($){let I=s8();I.info("Initializing server context...");let U=new e8({apiUrl:$.apiUrl,apiKey:$.apiKey});I.info("Resolving user identity from API key...");let D;try{D=(await U.whoami()).userId,I.info(`Resolved user: ${D.slice(0,8)}...`)}catch(w){I.error("Failed to resolve user identity from API key:",w),I.error("Ensure SURA_API_URL is correct and the API server is running."),process.exit(1)}I.info(`API URL: ${$.apiUrl}`);let b={userId:D,client:U,log:I};try{I.info("Loading workspace context..."),b.workspaceContext=await U.getWorkspaceContext();let w=b.workspaceContext.orgs.length,A=b.workspaceContext.orgs.reduce((N,O)=>N+O.workspaces.length,0);I.info(`Workspace context loaded: ${w} org(s), ${A} workspace(s)`)}catch(w){I.warn("Failed to load workspace context at startup (will retry on first tool call):",w)}return b}var d6=W.enum(["document","record"]),HN=["paragraph","heading","bulletListItem","numberedListItem","checkListItem","codeBlock","quote","table","divider","referenceList","annotationList","referenceItem","structure","structuredMatrix","procedureTree"],LN=["literature","document","record","annotation","artifact"],zN=["molecule","reaction"],EC=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,jC=/^(lit|doc|rec|art)-[0-9a-f]{8}$/i,VN=W.string().refine(($)=>EC.test($)||jC.test($),{message:"Must be a full UUID or a short entity ref (e.g., lit-a3f7e2b9, rec-1f30176d)"}),X1=50,MN=50;var $Q=W.object({blockType:W.enum(HN).default("paragraph").describe("Type of block to create. Default: paragraph"),content:W.string().describe("Text content for the block"),headingLevel:W.number().int().min(1).max(3).optional().describe("Heading level (1-3) if blockType is heading"),checked:W.boolean().optional().describe("Checked state for checkListItem"),title:W.string().optional().describe('Title for referenceList container (default: "References")'),refNumber:W.number().int().min(1).optional().describe("Reference number for referenceItem (e.g., 1, 2, 3)"),refId:W.string().optional().describe('Stable ref ID for citation linking (e.g., "lit-a3f7e2b9"). Auto-generated from linkedEntityId if omitted.'),refType:W.enum(LN).optional().describe("Type of reference: literature, document, record, or annotation"),linkedEntityId:VN.optional().describe("Linked entity handle (literature, document, record, or artifact). Accepts a full UUID OR a short ref like lit-a3f7e2b9 / rec-1f30176d — the form situate/search return; the executor resolves it to the full UUID."),entityTitle:W.string().optional().describe("Cached title of the linked entity"),doi:W.string().optional().describe("DOI for literature references"),smiles:W.string().optional().describe('SMILES string (e.g., "CCO" for ethanol, "CC(=O)C.N>>CC(N)C.O" for reactions). Required for molecule blocks.'),structureType:W.enum(zN).optional().describe('Structure type for molecule blocks: "molecule" (default) or "reaction"'),moleculeName:W.string().optional().describe('Name of the molecule or reaction (e.g., "Ethanol", "Reductive amination")'),moleculeDescription:W.string().optional().describe("Optional description or notes for the molecule block"),matrixId:W.string().optional().describe("UUID of the linked data matrix for structuredMatrix blocks"),nodeRef:W.string().optional().describe("Procedure tree node ID for structuredMatrix blocks"),matrixLabel:W.string().optional().describe("Display label for structuredMatrix blocks"),showPreview:W.boolean().optional().describe("Whether structuredMatrix should show its inline preview"),recordId:W.string().uuid().optional().describe("Record UUID for procedureTree blocks. The executor auto-fills this from the entityId of a record context — agents should omit it.")});var SC=W.enum(["text","number","unit","select","boolean"]),PC=W.enum(["mandatory","recommended","optional"]),G3=W.object({key:W.string().min(1).describe("Stable column key"),label:W.string().min(1).describe("Human-readable column label"),type:SC.describe("Column type"),unit:W.string().optional().describe("Optional display unit"),mandation:PC.describe("Field importance level"),description:W.string().optional().describe("Optional field description"),standardRef:W.string().optional().describe("Optional ontology reference"),options:W.array(W.string()).optional().describe("Allowed values for select columns"),hidden:W.boolean().optional().describe("UI-hidden column. Still surfaced to agents in matrix TOON (with a `hidden` marker in the cols legend) and preserved across row mutations. Use for preset-internal linkage (e.g. stoichiometry `compoundId`).")}),W1=W.record(W.string(),W.union([W.string(),W.number(),W.boolean(),W.null()])),Q3=W.enum(["generic","stoichiometry"]),IQ=W.object({entityType:d6.describe('Entity type: "document" or "record"'),entityId:W.string().uuid().describe("Document or record ID"),kind:Q3.optional().describe('Typed preset. Defaults to "generic". Use "stoichiometry" for reaction stoichiometry matrices (client-side calc engine derives m/V/n from M/ρ/equiv). When "stoichiometry", `columns` is ignored — the server fills in the stoichiometry preset.'),label:W.string().min(1).describe("Matrix label shown in the editor"),columns:W.array(G3).max(X1).optional().describe('Matrix column definitions. Required for `kind="generic"` (the default). Ignored for `kind="stoichiometry"` (preset columns override).'),rows:W.array(W1).optional().describe("Matrix rows"),nodeRef:W.string().optional().describe("Optional procedure tree node ID for record matrices"),afterBlockId:W.string().optional().describe("Insert AFTER this block ID (sibling insertion)"),beforeBlockId:W.string().optional().describe("Insert BEFORE this block ID (sibling insertion)"),parentBlockId:W.string().optional().describe("Insert as CHILD of this container block"),childPosition:W.string().optional().describe('Position within parent children: "first", "last" (default), or child block ID to insert after'),showPreview:W.boolean().optional().default(!0).describe("Whether the structured matrix block should show its preview")}).refine(($)=>{return[$.afterBlockId,$.beforeBlockId,$.parentBlockId].filter(Boolean).length<=1},{message:"Use only one positioning mode: afterBlockId, beforeBlockId, OR parentBlockId"}).refine(($)=>{if($.childPosition&&!$.parentBlockId)return!1;return!0},{message:"childPosition can only be used with parentBlockId"}).refine(($)=>{if($.kind==="stoichiometry")return!0;return($.columns?.length??0)>=1},{message:'`columns` is required for `kind="generic"` (omit or use `kind="stoichiometry"` for the preset).',path:["columns"]}),vb={name:"insert_matrix",description:"Create a structured data matrix AND insert its linked `structuredMatrix` block in one call.\n\nThe tool performs two writes atomically from the agent's perspective:\n1. Insert a new `data_matrices` row (columns + rows + label). The row starts at `version: 0`; all subsequent edits go through the `*_matrix_rows` / `rebind_matrix_to_node` / `delete_matrix` tools and each bumps `version`.\n2. Insert a `structuredMatrix` block referencing the new matrix id.\n\nTwo binding modes (both valid for records and documents):\n- **Body-level (default)**: omit `nodeRef`. The matrix belongs to the entity and the block lives at the top-level of the document/record body. Use this for free-standing tabular data (reagent inventory, condition sets attached to the whole experiment, etc).\n- **Node-attached**: pass `nodeRef` = procedure node UUID (records only). The matrix is logically scoped to that node and surfaces in `list_procedure_nodes` under that node's `matrixCount`. Use this when the matrix captures data produced inside a specific procedure step (e.g. readings per screening condition).\n\n**Typed presets via `kind`:**\n- `kind=\"generic\"` (default): supply your own `columns`.\n- `kind=\"stoichiometry\"`: choose this whenever you want reaction stoichiometry semantics — mixing reactants, reagents, solvents, catalysts, products and deriving the missing quantities. `columns` is ignored; the server fills the stoichiometry preset (Compound, Role, Phase, Equiv, Limiting, M, ρ, Purity, Stock c, Stock wt%, V, m, n, c, plus three hidden columns: `compoundId` linking to a `chemical` artifact, `cBasis` controlling how `c` is computed, and `cBasisManualVolume` for manual-basis rows).\n - Row shape: `{ compound, compoundId?, role, phase?, equiv?, limiting?, molecularWeight?, density?, purity?, stockMolarity?, stockWtPercent?, volume?, mass?, moles?, concentration?, cBasis?, cBasisManualVolume? }`.\n - **Phase grouping** (`phase` column): free-form text label that groups rows for per-phase volume totals. Use for biphasic syntheses (e.g. `phase: \"aqueous\"` vs `phase: \"oil\"`) or to sum per-mixture volumes within a single-pot reaction (e.g. `phase: \"aqueous\"` for water + dissolved CTAC + TEA). Leave blank for single-phase matrices. The UI renders a totals strip below the table; agents can read back via `get_content` to verify mass/volume balance per phase.\n - **Client-side calc engine auto-derives empty cells on every render. Do NOT pre-compute values you can leave null.** The identities propagated are: `n = m / M`, `n = V · c`, `m = V · ρ · purity` (neat liquids), `n = stockMolarity · V` (aqueous stock), `n = stockWtPercent · ρ_soln · V / M` (wt%-labelled stock), `n_i = equiv_i · n_limiting` (by row), and the reverse `equiv_i = n_i / n_limiting` (so molar ratios surface even when the user only entered masses). Derivation respects user-entered values — any non-null cell is treated as locked and never overwritten.\n - Limiting reactant: set `limiting: true` on exactly one reactant row (the engine also auto-picks the first reactant with enough info if none is flagged). Other reactants should carry `equiv` (molar ratio relative to limiting).\n - Units are fixed: M in g/mol, ρ in g/mL, V in mL, m in g, n in mmol, c in mol/L, purity as a decimal fraction (0–1), stockMolarity in mol/L, stockWtPercent in 0–100.\n - **Stock solution inputs**: for aqueous reagents (e.g. \"2 M NaOH\", \"25 wt% CTAC\"), prefer `stockMolarity` or `stockWtPercent` over `purity`. `purity` describes the dissolved compound itself (a neat liquid descriptor); `stockMolarity`/`stockWtPercent` describe the solution. Use only one of stockMolarity / stockWtPercent per row.\n - **Concentration basis** (`cBasis`, `cBasisManualVolume`): the displayed `c` is `n / V_ref` where the reference volume is picked per row. Defaults — solvent rows use `\"none\"` (c blank), non-solvent rows with a `phase` tag use `\"phase\"` (c relative to V_phase), other non-solvent rows use `\"total\"` (c relative to V_total). Leave `cBasis` null to inherit the default; explicit values are `\"none\" | \"phase\" | \"total\" | \"manual\"`. `\"manual\"` requires `cBasisManualVolume` (mL) and uses that as V_ref. Don't set these unless the user has chosen a non-default basis.\n - Minimal pattern for a reaction: one reactant with `{ role: 'reactant', limiting: true, equiv: 1, molecularWeight, mass OR volume }`; additional reactants with `{ role: 'reactant', equiv, molecularWeight }` (cells left null; the engine fills them from the limiting moles).\n\nIf a procedure node is later deleted, its matrices' `nodeRef` is cleared to null (FK `ON DELETE SET NULL`) and they surface in `list_procedure_nodes` as orphans — rebind via `rebind_matrix_to_node` or drop via `delete_matrix`.\n\nPositioning for the block:\n- `afterBlockId`: insert as SIBLING after the specified block\n- `beforeBlockId`: insert as SIBLING before the specified block\n- `parentBlockId`: insert as CHILD of a container block (e.g. inside a procedure section)\n- Omit all three: append the block at the end of the document. Safe for parallel `insert_matrix` calls — each one appends after the current tail, so agents can batch inserts instead of serialising on `afterBlockId`.\n\nExamples:\n- Body-level matrix appended after an existing block:\n `insert_matrix(entityType=\"record\", entityId=\"...\", afterBlockId=\"...\", label=\"Aqueous phase composition\", columns=[...], rows=[...])`\n- Node-attached matrix nested inside a procedure section:\n `insert_matrix(entityType=\"record\", entityId=\"...\", parentBlockId=\"...\", childPosition=\"last\", label=\"Screening Matrix\", columns=[...], rows=[...], nodeRef=\"...\")`\n\n**Record draft-gate:** matrices on records require the record to be in `draft` status. `completed` / `locked` records return a structured `record_not_draft` error — stop and surface it to the user; agents cannot flip record status themselves."};var UQ=W.object({matrixId:W.string().uuid().describe("UUID of the target data_matrix."),rows:W.array(W1).min(1).describe("New rows to append at the END of the existing rows array. **Row objects must be keyed by `col.key` (the stable column id), NOT `col.label`.** Unknown keys are retained in JSONB but never rendered and cannot be selected by `rowMatch` later. Call `get_content` on the owning entity first to read the column schema (`cols: key(Label,type[,unit])`)."),version:W.number().int().min(0).describe("Current matrix version (optimistic locking). Must equal the server's stored version; otherwise returns a matrix_version_conflict error with the actual version. Get the current version from `get_content` / `list_procedure_nodes` / prior tool output.")}),Jb={name:"append_matrix_rows",description:["Append rows to the end of an existing data matrix (body-level or node-attached).","**Row objects must be keyed by `col.key`, not `col.label`.** Read the schema first via `get_content` on the owning entity; the matrix TOON shows `cols: key(Label,type[,unit])` and a `{key1,key2,...}` row header. Writing under a label-name that differs from the key persists opaque JSONB that the UI cannot render.","Bumps `version` on success; stale `version` returns a structured `matrix_version_conflict` error with the current server version so you can re-fetch and retry.","Only draft records are writable; completed/locked records return a `record_not_draft` error. Matrices on documents/literature/artifacts have no draft gate.","Prefer this over rewriting the entire matrix via the legacy path — row identity is preserved for downstream consumers.",'**Stoichiometry matrices** (`kind=stoichiometry` in the matrix header): leave cells empty (`null`) whenever the client-side calc engine should derive them from the chemistry identities (n = m/M, n = V·c, m = V·ρ·purity, n = stockMolarity·V, n = stockWtPercent·ρ_soln·V/M, n_i = equiv_i · n_limiting, equiv_i = n_i / n_limiting). Only persist values you explicitly measured or want to lock. For aqueous reagent stocks (NaOH(aq), CTAC(aq), TEA(aq)) prefer `stockMolarity` (mol/L) or `stockWtPercent` (0–100) over `purity`. Must preserve `compoundId` (hidden column) verbatim on any row you touch — it is the link to the chemical artifact that auto-fills M and ρ. Two more hidden row keys control how the displayed `c` is computed: `cBasis` (one of `null` | `"none"` | `"phase"` | `"total"` | `"manual"`; null = let the engine pick a default from role+phase, "phase" = c relative to V_phase, "total" = c relative to V_total, "manual" = c relative to `cBasisManualVolume`, "none" = blank c) and `cBasisManualVolume` (mL, only used when cBasis="manual"). Leave both null unless the user has explicitly set them.'].join(" ")};var bQ=W.object({matrixId:W.string().uuid().describe("UUID of the workspace-owned matrix to attach."),entityType:W.enum(["record","artifact","document","literature"]).describe("Owner entity type. Typical use: `record` or `artifact`. Literature attach is currently not supported server-side and will fail."),entityId:W.string().uuid().describe("Owner entity UUID. The owner MUST live in the same workspace as the matrix, or the server rejects with invalid_matrix_owner."),nodeRef:W.string().uuid().optional().describe("Optional: if provided, AND the owner is a record, also bind the matrix to this procedure node in the same call. The node must belong to `entityId`."),version:W.number().int().min(0).describe("Current matrix version (optimistic locking). Must equal the server's stored version; otherwise returns a matrix_version_conflict error.")}),Hb={name:"attach_matrix",description:["Bind a workspace-owned (orphan) matrix to a provenance owner. Matrices become workspace-owned when their original record/document is deleted — the trigger promotes them instead of cascading. This tool claims them back to a new record or artifact in the same workspace.","Workspace match is enforced server-side: the owner entity MUST live in the same workspace as the matrix. Cross-workspace attach returns an `invalid_matrix_owner` error.","If `nodeRef` is provided and `entityType` is `record`, the matrix is also bound to that procedure node in the same call (combines attach + rebind). The node must belong to the target record.","Bumps `version` on success; stale `version` returns a structured `matrix_version_conflict` error.","Only draft records are writable; attaching to a completed/locked record returns `record_not_draft`.","Use `list_matrix_references` first if you want to see which documents/records embed the matrix before attaching."].join(" ")};var G1=W.enum(["procedure","characterization","observation","step"]),Q1=W.object({type:W.literal("file"),target:W.enum(["local","server","url"]),path:W.string().min(1),format:W.string().min(1),label:W.string().min(1),instrument:W.string().optional(),metadata:W.record(W.string(),W.union([W.string(),W.number(),W.boolean()])).optional()}),Y3=W.object({artifactId:W.string().uuid(),role:W.enum(["input","output","derived_from","referenced"]),context:W.record(W.string(),W.unknown()).optional()}),B3=W.object({matrixId:W.string().uuid()}),Lb=W.object({tempId:W.string().min(1).describe("Agent-chosen temporary id; remapped to a real uuid on insert. Must be unique within the input list."),parentTempId:W.string().nullable().optional().describe("tempId of the parent node, or null/omit for a root node of the tree."),label:W.string().min(1).describe("Human-readable node label."),type:G1.describe("Node type: procedure (top-level), step (intermediate), characterization (measurement), observation (note)."),order:W.number().int().min(0).optional().describe("Order within siblings. Defaults to append (one past the last existing sibling)."),copyable:W.boolean().optional().describe('Whether this node is template-copyable. MUST be false when type === "observation".'),analyticalData:W.array(Q1).optional().describe("File references attached to this node (the typed `analytical_data` JSONB field). Artifact links live in `artifactLinks` below."),artifactLinks:W.array(Y3).optional().describe("Existing artifacts to link to this node at creation time. Use when the agent already has artifactIds in context (e.g., from `search` or a prior `create_artifact` call). For new artifacts, prefer `create_artifact({ linkToNode })` instead. Failures on individual links are non-fatal — the node is still created and a per-node summary is returned."),matrices:W.array(B3).optional().describe("Existing data matrices to bind to this node at creation time. Workspace orphans are attached + bound; matrices already owned by this record are rebound. Cross-record matrices are rejected (would steal them from the other tree). For new matrices, call `insert_matrix(nodeRef=…)` after the tree exists."),body:W.string().optional().describe('This node\'s prose, as markdown — the same syntax you use for document/record content (headings, bullet/numbered lists, **bold**, *italic*, `code`, [[mention:type:uuid|Label]], etc.). Seeds the node body so the text renders under the node in the procedure tree. Authored once at creation; edit the prose directly afterwards. Renders once the record body has a `procedureTree` block (insert one with `insert_block(blockType:"procedureTree")` if absent). Do NOT dump step prose as loose body paragraphs — put it here so it attaches to the node.')}).refine(($)=>!($.type==="observation"&&$.copyable===!0),{message:'copyable must be false (or omitted) when type is "observation".',path:["copyable"]});var v3=W.enum(["replace","append"]),DQ=W.object({recordId:W.string().uuid().describe("Target record UUID. Must be in draft status."),nodes:W.array(Lb).min(1).describe("Flat procedure-tree list. Each node carries a tempId (and optional parentTempId) that the server remaps to real uuids."),mode:v3.describe('"replace" deletes the existing tree first (destructive); "append" grafts the new nodes on top of the current structure.'),confirm:W.literal(!0).optional().describe('MUST be set to true when mode="replace" — model-level self-check that the caller understands the existing tree (and its orphaned matrices) will be cleared.'),rootParentId:W.string().uuid().optional().describe("Append mode only — existing node uuid under which the new roots should be grafted. Omit to graft as top-level siblings.")}).refine(($)=>!($.mode==="replace"&&$.confirm!==!0),{message:'mode="replace" requires confirm: true — destructive operation.',path:["confirm"]}).refine(($)=>!($.mode==="replace"&&$.rootParentId!==void 0),{message:"rootParentId is only valid in append mode; replace wipes the tree first.",path:["rootParentId"]}),zb={name:"build_procedure_tree",description:["Atomically build or augment the procedure-node tree of an ELN record from a canonical JSON tree.","Input is a flat list of nodes using `tempId` / `parentTempId` references; the server remaps to real uuids and returns the mapping.","Modes:","- `append`: grafts the new subtree onto existing structure (either as new roots or under `rootParentId`).","- `replace` (destructive): deletes the entire existing tree first, then inserts the new one. **Requires `confirm: true`** and will orphan any matrices that were bound to deleted nodes — check with `list_procedure_nodes` first.","Only draft records are writable; completed/locked records return a `record_not_draft` error.",'`type === "observation"` nodes must have `copyable` omitted or `false`.',"For surgical edits to a single node prefer `insert_procedure_node` / `update_procedure_node` over a full rebuild."].join(" ")};var J3=["sample","dataset","protocol","file","equipment","chemical","model","reaction"],RC=["molecule","material","mixture","biomacromolecule"],TC=W.enum(RC),H3=["active","depleted","archived","draft"],KN=W.enum(J3),Y1=W.enum(H3),_C=W.enum(["merge","replace"]).default("merge").describe('How to apply `properties`. "merge" (default): top-level keys in `properties` are merged into the existing JSONB; pass `null` for a key to delete it. "replace": the supplied object fully overwrites the existing JSONB.'),wQ=W.object({id:W.string().uuid().describe("UUID of the artifact to update."),name:W.string().min(1).optional().describe("Display name (skip to keep existing)."),description:W.string().optional().describe("Plain-text description. Pass an empty string to clear."),tags:W.array(W.string()).optional().describe("Replaces the tag set. Pass an empty array to clear all tags. Omit to leave tags untouched."),properties:W.record(W.string(),W.unknown()).optional().describe("Free-form JSONB blob. By default merged into existing properties (see `propertiesMode`). Common keys per type: sample → batch, storage_conditions, preparation_date; dataset → format, row_count, source_instrument; chemical → cas_number, molecular_formula, supplier; equipment → model, serial, last_calibration. Advisory only — any keys allowed."),propertiesMode:_C.optional(),structureClass:TC.optional().describe("Chemical structure-class discriminator (molecule | material | mixture | biomacromolecule). Only meaningful for chemical artifacts — it selects the typed property schema. Changing it RETAINS prior class-specific values as unmapped custom properties; nothing is dropped."),artifactType:KN.optional().describe("Change the artifact type. Note: existing `properties` are NOT auto-migrated to the new type's advisory schema."),status:Y1.optional().describe("Lifecycle status: active | depleted | archived | draft."),storageRef:W.string().optional().describe("Free-form storage pointer (path, URL, locker code)."),location:W.string().optional().describe("Free-form physical/logical location."),parentId:W.string().uuid().nullable().optional().describe("Parent artifact UUID for hierarchies (e.g. sub-samples). Pass null to detach."),templateId:W.string().uuid().nullable().optional().describe("Template binding. Pass null to detach.")}).refine(($)=>$.name!==void 0||$.description!==void 0||$.tags!==void 0||$.properties!==void 0||$.structureClass!==void 0||$.artifactType!==void 0||$.status!==void 0||$.storageRef!==void 0||$.location!==void 0||$.parentId!==void 0||$.templateId!==void 0,{message:"Provide at least one field to update (name, description, tags, properties, structureClass, artifactType, status, storageRef, location, parentId, templateId)."}),Vb={name:"update_artifact",description:["Update non-identity fields of an artifact (name, description, tags, properties, structureClass, artifactType, status, storageRef, location, parentId, templateId).",'`properties` (JSONB) is merged into the existing blob by default — pass `propertiesMode: "replace"` for full overwrite. Use null on a key in merge mode to delete it.',"Identity fields (id, workspaceId, orgId, createdBy*, sourceRecordId, deletedAt, timestamps) are never writable through this tool.","Soft-delete and link mutations have their own paths and are out of scope.","Unrecognized property keys are accepted (custom JSONB) but trigger a warning that returns the full typed schema for the artifact type. Use the schema to self-correct on the next call."].join(" ")};var L3=W.object({cid:W.number().int().positive().optional().describe("PubChem CID. Most specific identifier — bypasses lookup."),cas:W.string().optional().describe('CAS Registry Number (e.g. "71-43-2"). Resolved via PubChem CID lookup.'),inchiKey:W.string().optional().describe('27-character InChIKey (e.g. "UHOVQNZJYSORNB-UHFFFAOYSA-N"). Most reliable for exact-compound lookup.'),name:W.string().optional().describe("Compound name (IUPAC, common, brand). Resolved via PubChem name search; uses the top match.")}).refine(($)=>$.cid||$.cas||$.inchiKey||$.name,{message:"enrichFromPubchem requires at least one of: cid, cas, inchiKey, name"}),AQ=W.object({name:W.string().min(1).max(500).describe('Display name for the artifact (e.g. "DMSN_66c", "TEOS lot 4").'),artifactType:KN.describe('sample | dataset | protocol | file | equipment | chemical | model | reaction. `chemical` is the substance (one per workspace per InChIKey/CCDC); `sample` is a physical instance of a chemical (set `parentId` to the chemical artifact). `reaction` is a sibling type — a transformation (e.g. "Suzuki coupling"), never a sub-flavor of chemical.'),workspaceId:W.string().uuid().optional().describe("Workspace ID. The workspace's orgId is used as the artifact's org (any organizationId passed alongside is ignored). When omitted, falls back to the user's first workspace."),organizationId:W.string().uuid().optional().describe("Organization ID. Ignored when workspaceId is provided — derived from the workspace. Auto-resolved to the user's first org only when nothing more specific is passed."),description:W.string().optional().describe("Plain-text description."),tags:W.array(W.string()).optional().describe("Tag names. Resolved to canonical tag IDs server-side (alias-aware)."),properties:W.record(W.string(),W.unknown()).optional().describe(["Free-form JSONB blob. Common keys per type: sample → batch, storage_conditions, preparation_date; dataset → format, row_count, source_instrument; equipment → model, serial, last_calibration; reaction → transformation_class (required: molecular | sol_gel | polymerization | crystallization | self_assembly | mechanochemistry | biological | other), transformation_summary (free-text for non-molecular), rxn_smiles (molecular only), precursor_smiles, reaction_class, description.",'For chemical artifacts, set `properties.structureClass` to one of: "molecule" (default; PubChem-shaped — iupac_name, molecular_formula, cas_number, canonical_smiles, inchi, inchi_key, molecular_weight, density, ghs_*, …), "material" (MOFs/COFs/zeolites/perovskites — topology, space_group, unit_cell, ccdc_number, framework_formula, bet_surface_area, pore_volume, pore_size, skeletal_density), "mixture" (solutions/electrolytes — components JSON-array of `{artifactId, ratio, role?}`, solvent, concentration_basis), or "biomacromolecule" (proteins/oligonucleotides — uniprot_id, pdb_id, sequence, molecular_weight, pi).',"The server validates keys against the chosen class's typed schema and returns near-match suggestions for likely typos (warn-but-accept). Unknown keys are stored either way; the warning surfaces in the response so you can self-correct on the next call.","Advisory only — any keys allowed."].join(" ")),status:Y1.optional().describe('Lifecycle status (default: active). Use "draft" for partially-known artifacts the user still needs to verify.'),storageRef:W.string().optional().describe("Free-form storage pointer (path, URL, locker code)."),location:W.string().optional().describe("Free-form physical/logical location."),parentId:W.string().uuid().optional().describe("Parent artifact UUID for hierarchies (e.g. sub-samples)."),sourceRecordId:W.string().uuid().optional().describe('UUID of the record this artifact was extracted/derived from. Sets provenance for the entity-search "derived from" view.'),templateId:W.string().uuid().optional().describe("Optional template binding."),enrichFromPubchem:L3.optional().describe('When set and artifactType is "chemical" with structureClass molecule (or absent), resolve the identifier (cid > inchiKey > cas > name) and auto-fill missing properties from PubChem. Agent-supplied properties always win — enrichment never overwrites. PubChem does NOT index periodic materials, mixtures, biomacromolecules, or reactions, so this is a no-op (logged) for those classes. Failures (no match, PubChem unreachable) do NOT block creation; the artifact is still created with whatever was provided, and the enrichment status is reported in the result.'),linkToNode:W.object({nodeId:W.string().uuid(),role:W.enum(["input","output","derived_from","referenced"]),context:W.record(W.string(),W.unknown()).optional()}).optional().describe("When set, immediately link the newly-created artifact to this procedure node. Equivalent to: `create_artifact(...)` → `link_artifact_to_node({ nodeId, artifactId, role })` — provided as a convenience for the common create-and-link flow. Per-link failures are non-fatal: the artifact is still created and the link error is surfaced in the response.")}),Mb={name:"create_artifact",description:["Create a new artifact (sample, dataset, protocol, file, equipment, chemical, model, or reaction).","Pass `workspaceId` to control where it lands; otherwise the user's first workspace is used. Artifacts are workspace-level — there is no space association.",'`createdBySource` is forced to "agent" — never user-controllable through this tool.',"`properties` is free-form JSONB; advisory keys per type are listed in the field description but never enforced.","For molecular chemical artifacts: prefer `enrichFromPubchem: { cas | cid | inchiKey | name }` over hand-assembling properties — the server canonicalizes via PubChem, dedups by InChIKey within the workspace, and auto-fills SMILES/InChI/formula/MW/GHS/transport/descriptors with fillIfAbsent semantics (your `properties` always win). Enrichment failures don't block creation.",'For periodic materials (MOFs/COFs/zeolites/perovskites): set `properties.structureClass = "material"` and supply the structural identity tuple (topology + space_group + unit_cell + ccdc_number) by hand — PubChem does NOT index periodic structures.','For mixtures (solutions/electrolytes): set `properties.structureClass = "mixture"` and reference component chemicals via `properties.components` (JSON array of {artifactId, ratio, role?}). Each component should already exist as a chemical artifact in the workspace.','For reactions: set `artifactType = "reaction"` and supply `properties.transformation_class` — one of: molecular, sol_gel, polymerization, crystallization, self_assembly, mechanochemistry, biological, other. For `molecular` reactions also supply `rxn_smiles`. For everything else write a short `transformation_summary` describing what is actually happening. Reactions are sibling artifacts, not chemicals.','For samples (physical instances of a chemical): set `artifactType = "sample"` and `parentId = <chemical artifact id>`; the chemical\'s typed properties flow through the UI when the sample is displayed.',"Use this when the user asks to register a new sample, dataset, instrument, chemical, material, mixture, or reaction. To attach the new artifact to a procedure node, pass `linkToNode` (artifact + node + role) — atomic create-and-link.","Unrecognized property keys are accepted (custom JSONB) but trigger a warning that returns the full typed schema for the artifact type. Use the schema to self-correct on the next call."].join(" ")};var NQ=W.object({title:W.string().min(1).max(500).describe("Title for the new document"),content:W.string().optional().describe("Optional initial content in markdown format"),organizationId:W.string().uuid().optional().describe("Organization ID (auto-resolved if omitted; ignored when spaceId is provided — derived from the space instead)"),workspaceId:W.string().uuid().optional().describe("Workspace ID (auto-resolved if omitted; ignored when spaceId is provided — derived from the space instead)"),spaceId:W.string().uuid().optional().describe("Optional space ID. When provided the document is created inside that space and workspace/organization are derived from it. Caller must be a member of the space with write access. Omit for a private (workspace-only) document."),tags:W.array(W.string()).optional().describe("Canonical tag display names to assign to the new document. Existing tags are matched case-insensitively; unknown tags are auto-created within the org. Renaming/merging tags later via the canonical tag system is rename-safe.")}),Kb={name:"create_document",description:"Create a new document. By default the document is private to the user in their current workspace. Pass `spaceId` to create it inside a specific space (shared with space members); workspace and organization are then derived from the space automatically. Use this when the user asks you to create a new document, draft, or note. You can optionally provide initial content in markdown format. "+'The document is attributed to the user as creator; `createdBySource` is forced to "agent" — never user-controllable through this tool.'};var OQ=W.object({title:W.string().min(1).max(500).describe("Paper title"),doi:W.string().optional().describe("DOI for metadata resolution and CORE full text fetch"),authors:W.array(W.string()).optional().describe('Author full names (e.g., ["John Smith", "Jane Doe"]). Omit when a DOI is available so the server can resolve authoritative metadata.'),journal:W.string().optional().describe("Journal name"),year:W.number().int().positive().optional().describe("Publication year"),sourceUrl:W.string().url().optional().describe("Publisher page URL where the paper can be found"),organizationId:W.string().uuid().optional().describe("Organization ID (auto-resolved if omitted)"),workspaceId:W.string().uuid().optional().describe("Workspace to assign the paper to"),spaceId:W.string().uuid().optional().describe("Space within workspace"),fetchFullText:W.boolean().optional().default(!1).describe("When true, fetches full text from CORE and stores as structured content blocks. Requires DOI. Default false for metadata-only creation."),tags:W.array(W.string()).optional().describe("Canonical tag display names to assign to the literature item. Merged with any tags resolved from the DOI metadata (the union is applied).")}),Fb={name:"create_literature",description:"Import a research paper into the user's library. Creates a literature item with bibliographic metadata. If a DOI is provided, the server will try to resolve authoritative metadata before creating the item. Set fetchFullText=true to also fetch and parse the full text from CORE (requires DOI). If a DOI is provided and already exists in the library, returns the existing item (idempotent). Use this when the user explicitly asks to import or add a paper to their library. "+'The item is attributed to the user as creator; `createdBySource` is forced to "agent" — never user-controllable through this tool.'};var XQ=W.object({artifactId:W.string().uuid().describe("UUID of the source artifact to derive the matrix from. Reaction artifacts synthesize a stoichiometry matrix from their typed `linkSlots`; other artifact types (protocols, equipment, …) copy a column schema from one of their attached matrices."),workspaceId:W.string().uuid().describe("Workspace scope. Must match the source artifact and (if provided) the target entity."),entityType:W.enum(["record","artifact","document","literature"]).optional().describe("Owner entity type for the spawned matrix. Omit to create a workspace-orphan matrix. Typical use: `record` paired with a `nodeRef`."),entityId:W.string().uuid().optional().describe("Owner entity UUID. Required when `entityType` is set."),nodeRef:W.string().uuid().optional().describe('Procedure node UUID. When set with `entityType: "record"` AND the source is a reaction artifact, also ensures a procedure_node ↔ reaction artifact link exists (idempotent — duplicate calls are safe).'),matrixId:W.string().uuid().optional().describe("Optional: UUID of a specific matrix attached to the source artifact to copy from. REQUIRED when the source artifact has multiple attached matrices (non-reaction sources). Passing it on a reaction artifact forces the column-copy path instead of the synthesize-from-linkSlots default."),label:W.string().min(1).optional().describe('Optional matrix label. Defaults to "Stoichiometry — <reaction name>" for reaction sources, or the source matrix label for column-copy sources.')}),qb={name:"create_matrix_from_artifact",description:["Spawn a new matrix from a source artifact. Two modes, auto-selected by source artifact type (override with `matrixId`):","(1) **Reaction artifact** (default for `artifactType: \"reaction\"`): walks the artifact's typed `linkSlots` (reactant / product / reagent / catalyst / solvent), pulls each linked chemical artifact's name + MW + density, and emits one stoichiometry row per bound slot using the slot's `stoichCoefficient`. Slots without a `defaultArtifactId` are skipped — fill those by hand on the derived matrix.","(2) **Column-copy** (any artifact with attached matrices — protocols, equipment, custom artifact types, or reaction artifacts when `matrixId` is passed): copies the column schema (NOT the rows — pure template) from one of the source artifact's attached matrices to a new matrix on the target. The agent fills the rows. If the source artifact has multiple attached matrices and `matrixId` is omitted, the call returns a structured `ambiguous_matrix_selection` error listing the available matrix IDs so the agent can re-call with a selector. If the source has zero attached matrices and is not a reaction, returns `no_matrices_on_artifact`.","In both modes, `derivedFromArtifactId` is stamped on the new matrix for provenance. Frozen invariant: edits to the source artifact / matrix never propagate forward; this is a one-shot copy at instantiation time.",'When `entityType: "record"` + `nodeRef` are set AND the source is a reaction artifact, the matrix is bound to the procedure node AND a `procedure_node → reaction artifact` link is ensured (created if absent). One call replaces "link reaction to node" + "spawn matrix" + "bind to node."',"Returns the new matrix in the same shape as `insert_matrix`."].join(" ")};var WQ=W.object({title:W.string().min(1).max(500).describe("Title for the new record."),organizationId:W.string().uuid().optional().describe("Organization ID. Ignored when spaceId or workspaceId is provided — derived from the parent scope. Auto-resolved to the user's first org only when nothing more specific is passed."),workspaceId:W.string().uuid().optional().describe("Workspace ID. Ignored when spaceId is provided — derived from the space. Otherwise the workspace's organizationId is used as the record's org (any organizationId passed alongside is ignored)."),spaceId:W.string().uuid().optional().describe("Optional space to attach the record to. When omitted the record lives at workspace level only."),recordDate:W.string().regex(/^\d{4}-\d{2}-\d{2}$/,"Expected YYYY-MM-DD").optional().describe("ISO date (YYYY-MM-DD) of the research activity, used for calendar navigation. Defaults to today."),recordType:W.string().max(120).optional().describe('Freeform record category (e.g. "Experiment", "Characterization", "Protocol").'),collaborators:W.array(W.string().uuid()).optional().describe("User ids participating in this research activity."),tags:W.array(W.string()).optional().describe("Canonical tag display names to assign to the new record. Existing tags are matched case-insensitively; unknown tags are auto-created within the org. Renaming/merging tags later via the canonical tag system is rename-safe."),initialTree:W.array(Lb).optional().describe("Optional flat procedure-tree list built via parentTempId. Inserted after the record is created; on success the response carries a tempId → nodeId map.")}),kb={name:"create_record",description:["Create a new ELN research record in the user's workspace.","Records are always created in `draft` status and begin empty — you can populate the prose body with the edit tools afterwards.","Pass `spaceId` to attach the record to a specific space; otherwise it lives at workspace level only.","Provide `initialTree` to stand up the procedure-node tree in the same call (topological insert, parentTempId → parentId).",'`type === "observation"` nodes are required to have `copyable === false` (or omitted).',"Use this when the user asks you to create a new record, experiment entry, or lab notebook page.",'The record is attributed to the user as creator; `createdBySource` is forced to "agent" — never user-controllable through this tool.'].join(" ")};var FN=W.object({entityType:d6.describe('Entity type: "document" or "record"'),entityId:W.string().uuid().describe("Document or record ID"),blockId:W.string().optional().describe("Block ID to delete (for single delete)"),blockIds:W.array(W.string()).max(MN).optional().describe(`Array of block IDs to delete (batch mode, max ${MN})`)}),CC=FN.refine(($)=>{let I=$.blockId!==void 0,U=$.blockIds!==void 0&&$.blockIds.length>0;return I!==U},{message:"Provide either blockId (single delete) or blockIds (batch delete), not both"}),Eb={name:"delete_block",description:"Delete blocks from a document. Supports single (blockId) or batch (blockIds) mode. Batch mode is more efficient for deleting multiple blocks in one operation. Be careful - this permanently removes blocks and their content. Use get_content first to verify blocks before deleting. "+"Records: only `draft` records are writable; `completed`/`locked` records return a `record_not_draft` error — do not try to flip the status yourself. "+"Do NOT attempt to delete `procedureTree`, `procedureSection`, or `nodeArtifacts` blocks on records — those are sync projections of table-backed rows and re-render on every sync; use the `*_procedure_node` tools to mutate the tree instead."};var GQ=W.object({matrixId:W.string().uuid().describe("UUID of the matrix to delete."),version:W.number().int().min(0).describe("Current matrix version (optimistic locking). Must equal the server's stored version; otherwise returns a matrix_version_conflict error."),acknowledgeDataLoss:W.literal(!0).describe("Model-level confirmation: MUST be set to true. Deleting the matrix removes all rows AND the linked structuredMatrix block from the owning document/record. Not recoverable outside of version snapshots.")}),jb={name:"delete_matrix",description:["Delete a data matrix row AND the `structuredMatrix` block that references it in the owning document/record. Both writes happen in the same tool call.","Requires `acknowledgeDataLoss: true` as a model-level self-check — prefer `delete_matrix_rows` or `rebind_matrix_to_node` for less-destructive edits.","Bumps `version` on success; stale `version` returns a structured `matrix_version_conflict` error with the current server version.","Only draft records are writable; completed/locked records return a `record_not_draft` error. Matrices on documents/literature/artifacts have no draft gate.","Undo path: `record_versions` snapshots capture matrix state together with Y.js content when a version is cut, so a prior snapshot restore can recover an accidentally deleted matrix for records under version control."].join(" ")};var ZC=W.record(W.string(),W.union([W.string(),W.number(),W.boolean(),W.null()])).describe("Row match: every provided key/value must equal the row's current value. Matches all rows where the criteria hold."),QQ=W.object({matrixId:W.string().uuid().describe("UUID of the target data_matrix."),rowIndices:W.array(W.number().int().min(0)).min(1).optional().describe("Absolute 0-based indices of rows to delete in the current rows array. Indices resolve against the pre-delete snapshot (batch-safe)."),rowMatch:ZC.optional(),version:W.number().int().min(0).describe("Current matrix version (optimistic locking). Must equal the server's stored version; otherwise returns a matrix_version_conflict error.")}).refine(($)=>{let I=$.rowIndices!==void 0,U=$.rowMatch!==void 0;return I!==U},{message:"Provide exactly one of `rowIndices` (absolute indices) or `rowMatch` (by column values).",path:["rowIndices"]}),Sb={name:"delete_matrix_rows",description:["Remove rows from an existing data matrix, either by absolute `rowIndices` or by `rowMatch` (every column/value in the match must equal the row's current cell). Match mode deletes every row that satisfies the criteria.","**`rowMatch` MUST use `col.key` as each object key, NOT `col.label`** — the schema is visible via `get_content` on the owning entity (`cols: key(Label,type[,unit])` + `{key1,key2,...}` row header).","Bumps `version` on success; stale `version` returns a structured `matrix_version_conflict` error with the current server version so you can re-fetch and retry.","To remove the matrix itself (row + structuredMatrix block) use `delete_matrix`. This tool only prunes rows.","Only draft records are writable; completed/locked records return a `record_not_draft` error."].join(" ")};var YQ=W.object({nodeId:W.string().uuid().describe("UUID of the procedure node to delete."),acknowledgeCascade:W.literal(!0).describe("Model-level confirmation: MUST be set to true. Deleting a node cascades to all descendants via FK and orphans any bound matrices (matrix.nodeRef → null).")}),Pb={name:"delete_procedure_node",description:["Delete a procedure-tree node and all of its descendants (FK cascade).","Any matrices bound to deleted nodes have their `nodeRef` cleared — the response lists the orphaned matrix ids so the agent can rebind or drop them via the matrix tools.","Requires `acknowledgeCascade: true` as a model-level self-check — check `list_procedure_nodes` before deleting to understand the subtree you are about to remove.","Only draft records are writable; completed/locked records return a `record_not_draft` error."].join(" ")};function K$($){return` ${$.map((U)=>{if(U===null||U===void 0||U==="")return"";let D=String(U);return D.includes(",")?`"${D}"`:D}).join(",")}`}function qN($){if(!$)return"";let I=[];if($.previousBlock)I.push(`After: [${$.previousBlock.type} | ${$.previousBlock.id}]`);if($.nextBlock)I.push(`Before: [${$.nextBlock.type} | ${$.nextBlock.id}]`);return I.join(", ")}function M3($,I,U=150){let D=0,b=Math.min($.length,I.length);while(D<b&&$[D]===I[D])D++;let w=0;while(w<b-D&&$.at(1+w)===I.at(1+w))w++;let A=Math.floor(U/2),N=Math.max(0,D-A),O=Math.min($.length,$.length-w+A),X=Math.min(I.length,I.length-w+A),G=N>0?"...":"",Q=O<$.length?"...":"",Y=X<I.length?"...":"",B=`${G}${$.slice(N,O)}${Q}`,J=`${G}${I.slice(N,X)}${Y}`;return`--- before
|
|
38
|
-
${
|
|
29
|
+
`)}v.write("payload.value = newResult;"),v.write("return payload;");let g=v.compile();return(x,a)=>g(Y,x,a)},A,w=T4,O=!_U.jitless,X=O&&s0.value,G=I.catchall,Q;$._zod.parse=(Y,v)=>{Q??(Q=D.value);let L=Y.value;if(!w(L))return Y.issues.push({expected:"object",code:"invalid_type",input:L,inst:$}),Y;if(O&&X&&v?.async===!1&&v.jitless!==!0){if(!A)A=b(I.shape);if(Y=A(Y,v),!G)return Y;return Zv([],L,Y,v,Q,$)}return U(Y,v)}});function zv($,I,U,D){for(let A of $)if(A.issues.length===0)return I.value=A.value,I;let b=$.filter((A)=>!I4(A));if(b.length===1)return I.value=b[0].value,b[0];return I.issues.push({code:"invalid_union",input:I.value,inst:U,errors:$.map((A)=>A.issues.map((w)=>u$(w,D,M$())))}),I}var QI=B("$ZodUnion",($,I)=>{n.init($,I),e($._zod,"optin",()=>I.options.some((b)=>b._zod.optin==="optional")?"optional":void 0),e($._zod,"optout",()=>I.options.some((b)=>b._zod.optout==="optional")?"optional":void 0),e($._zod,"values",()=>{if(I.options.every((b)=>b._zod.values))return new Set(I.options.flatMap((b)=>Array.from(b._zod.values)));return}),e($._zod,"pattern",()=>{if(I.options.every((b)=>b._zod.pattern)){let b=I.options.map((A)=>A._zod.pattern);return new RegExp(`^(${b.map((A)=>ZU(A.source)).join("|")})$`)}return});let U=I.options.length===1,D=I.options[0]._zod.run;$._zod.parse=(b,A)=>{if(U)return D(b,A);let w=!1,O=[];for(let N of I.options){let X=N._zod.run({value:b.value,issues:[]},A);if(X instanceof Promise)O.push(X),w=!0;else{if(X.issues.length===0)return X;O.push(X)}}if(!w)return zv(O,b,$,A);return Promise.all(O).then((N)=>{return zv(N,b,$,A)})}});function Fv($,I,U,D){let b=$.filter((A)=>A.issues.length===0);if(b.length===1)return I.value=b[0].value,I;if(b.length===0)I.issues.push({code:"invalid_union",input:I.value,inst:U,errors:$.map((A)=>A.issues.map((w)=>u$(w,D,M$())))});else I.issues.push({code:"invalid_union",input:I.value,inst:U,errors:[],inclusive:!1});return I}var GA=B("$ZodXor",($,I)=>{QI.init($,I),I.inclusive=!1;let U=I.options.length===1,D=I.options[0]._zod.run;$._zod.parse=(b,A)=>{if(U)return D(b,A);let w=!1,O=[];for(let N of I.options){let X=N._zod.run({value:b.value,issues:[]},A);if(X instanceof Promise)O.push(X),w=!0;else O.push(X)}if(!w)return Fv(O,b,$,A);return Promise.all(O).then((N)=>{return Fv(N,b,$,A)})}}),QA=B("$ZodDiscriminatedUnion",($,I)=>{I.inclusive=!1,QI.init($,I);let U=$._zod.parse;e($._zod,"propValues",()=>{let b={};for(let A of I.options){let w=A._zod.propValues;if(!w||Object.keys(w).length===0)throw new Error(`Invalid discriminated union option at index "${I.options.indexOf(A)}"`);for(let[O,N]of Object.entries(w)){if(!b[O])b[O]=new Set;for(let X of N)b[O].add(X)}}return b});let D=DI(()=>{let b=I.options,A=new Map;for(let w of b){let O=w._zod.propValues?.[I.discriminator];if(!O||O.size===0)throw new Error(`Invalid discriminated union option at index "${I.options.indexOf(w)}"`);for(let N of O){if(A.has(N))throw new Error(`Duplicate discriminator value "${String(N)}"`);A.set(N,w)}}return A});$._zod.parse=(b,A)=>{let w=b.value;if(!T4(w))return b.issues.push({code:"invalid_type",expected:"object",input:w,inst:$}),b;let O=D.value.get(w?.[I.discriminator]);if(O)return O._zod.run(b,A);if(I.unionFallback)return U(b,A);return b.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:I.discriminator,input:w,path:[I.discriminator],inst:$}),b}}),YA=B("$ZodIntersection",($,I)=>{n.init($,I),$._zod.parse=(U,D)=>{let b=U.value,A=I.left._zod.run({value:b,issues:[]},D),w=I.right._zod.run({value:b,issues:[]},D);if(A instanceof Promise||w instanceof Promise)return Promise.all([A,w]).then(([N,X])=>{return kv(U,N,X)});return kv(U,A,w)}});function IX($,I){if($===I)return{valid:!0,data:$};if($ instanceof Date&&I instanceof Date&&+$===+I)return{valid:!0,data:$};if($4($)&&$4(I)){let U=Object.keys(I),D=Object.keys($).filter((A)=>U.indexOf(A)!==-1),b={...$,...I};for(let A of D){let w=IX($[A],I[A]);if(!w.valid)return{valid:!1,mergeErrorPath:[A,...w.mergeErrorPath]};b[A]=w.data}return{valid:!0,data:b}}if(Array.isArray($)&&Array.isArray(I)){if($.length!==I.length)return{valid:!1,mergeErrorPath:[]};let U=[];for(let D=0;D<$.length;D++){let b=$[D],A=I[D],w=IX(b,A);if(!w.valid)return{valid:!1,mergeErrorPath:[D,...w.mergeErrorPath]};U.push(w.data)}return{valid:!0,data:U}}return{valid:!1,mergeErrorPath:[]}}function kv($,I,U){if(I.issues.length)$.issues.push(...I.issues);if(U.issues.length)$.issues.push(...U.issues);if(I4($))return $;let D=IX(I.value,U.value);if(!D.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(D.mergeErrorPath)}`);return $.value=D.data,$}var mU=B("$ZodTuple",($,I)=>{n.init($,I);let U=I.items;$._zod.parse=(D,b)=>{let A=D.value;if(!Array.isArray(A))return D.issues.push({input:A,inst:$,expected:"tuple",code:"invalid_type"}),D;D.value=[];let w=[],O=[...U].reverse().findIndex((G)=>G._zod.optin!=="optional"),N=O===-1?0:U.length-O;if(!I.rest){let G=A.length>U.length,Q=A.length<N-1;if(G||Q)return D.issues.push({...G?{code:"too_big",maximum:U.length}:{code:"too_small",minimum:U.length},input:A,inst:$,origin:"array"}),D}let X=-1;for(let G of U){if(X++,X>=A.length){if(X>=N)continue}let Q=G._zod.run({value:A[X],issues:[]},b);if(Q instanceof Promise)w.push(Q.then((Y)=>SD(Y,D,X)));else SD(Q,D,X)}if(I.rest){let G=A.slice(U.length);for(let Q of G){X++;let Y=I.rest._zod.run({value:Q,issues:[]},b);if(Y instanceof Promise)w.push(Y.then((v)=>SD(v,D,X)));else SD(Y,D,X)}}if(w.length)return Promise.all(w).then(()=>D);return D}});function SD($,I,U){if($.issues.length)I.issues.push(...p$(U,$.issues));I.value[U]=$.value}var vA=B("$ZodRecord",($,I)=>{n.init($,I),$._zod.parse=(U,D)=>{let b=U.value;if(!$4(b))return U.issues.push({expected:"record",code:"invalid_type",input:b,inst:$}),U;let A=[],w=I.keyType._zod.values;if(w){U.value={};let O=new Set;for(let X of w)if(typeof X==="string"||typeof X==="number"||typeof X==="symbol"){O.add(typeof X==="number"?X.toString():X);let G=I.valueType._zod.run({value:b[X],issues:[]},D);if(G instanceof Promise)A.push(G.then((Q)=>{if(Q.issues.length)U.issues.push(...p$(X,Q.issues));U.value[X]=Q.value}));else{if(G.issues.length)U.issues.push(...p$(X,G.issues));U.value[X]=G.value}}let N;for(let X in b)if(!O.has(X))N=N??[],N.push(X);if(N&&N.length>0)U.issues.push({code:"unrecognized_keys",input:b,inst:$,keys:N})}else{U.value={};for(let O of Reflect.ownKeys(b)){if(O==="__proto__")continue;let N=I.keyType._zod.run({value:O,issues:[]},D);if(N instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(N.issues.length){if(I.mode==="loose")U.value[O]=b[O];else U.issues.push({code:"invalid_key",origin:"record",issues:N.issues.map((G)=>u$(G,D,M$())),input:O,path:[O],inst:$});continue}let X=I.valueType._zod.run({value:b[O],issues:[]},D);if(X instanceof Promise)A.push(X.then((G)=>{if(G.issues.length)U.issues.push(...p$(O,G.issues));U.value[N.value]=G.value}));else{if(X.issues.length)U.issues.push(...p$(O,X.issues));U.value[N.value]=X.value}}}if(A.length)return Promise.all(A).then(()=>U);return U}}),BA=B("$ZodMap",($,I)=>{n.init($,I),$._zod.parse=(U,D)=>{let b=U.value;if(!(b instanceof Map))return U.issues.push({expected:"map",code:"invalid_type",input:b,inst:$}),U;let A=[];U.value=new Map;for(let[w,O]of b){let N=I.keyType._zod.run({value:w,issues:[]},D),X=I.valueType._zod.run({value:O,issues:[]},D);if(N instanceof Promise||X instanceof Promise)A.push(Promise.all([N,X]).then(([G,Q])=>{qv(G,Q,U,w,b,$,D)}));else qv(N,X,U,w,b,$,D)}if(A.length)return Promise.all(A).then(()=>U);return U}});function qv($,I,U,D,b,A,w){if($.issues.length)if(gU.has(typeof D))U.issues.push(...p$(D,$.issues));else U.issues.push({code:"invalid_key",origin:"map",input:b,inst:A,issues:$.issues.map((O)=>u$(O,w,M$()))});if(I.issues.length)if(gU.has(typeof D))U.issues.push(...p$(D,I.issues));else U.issues.push({origin:"map",code:"invalid_element",input:b,inst:A,key:D,issues:I.issues.map((O)=>u$(O,w,M$()))});U.value.set($.value,I.value)}var LA=B("$ZodSet",($,I)=>{n.init($,I),$._zod.parse=(U,D)=>{let b=U.value;if(!(b instanceof Set))return U.issues.push({input:b,inst:$,expected:"set",code:"invalid_type"}),U;let A=[];U.value=new Set;for(let w of b){let O=I.valueType._zod.run({value:w,issues:[]},D);if(O instanceof Promise)A.push(O.then((N)=>Ev(N,U)));else Ev(O,U)}if(A.length)return Promise.all(A).then(()=>U);return U}});function Ev($,I){if($.issues.length)I.issues.push(...$.issues);I.value.add($.value)}var JA=B("$ZodEnum",($,I)=>{n.init($,I);let U=fU(I.entries),D=new Set(U);$._zod.values=D,$._zod.pattern=new RegExp(`^(${U.filter((b)=>gU.has(typeof b)).map((b)=>typeof b==="string"?s$(b):b.toString()).join("|")})$`),$._zod.parse=(b,A)=>{let w=b.value;if(D.has(w))return b;return b.issues.push({code:"invalid_value",values:U,input:w,inst:$}),b}}),HA=B("$ZodLiteral",($,I)=>{if(n.init($,I),I.values.length===0)throw new Error("Cannot create literal schema with no valid values");let U=new Set(I.values);$._zod.values=U,$._zod.pattern=new RegExp(`^(${I.values.map((D)=>typeof D==="string"?s$(D):D?s$(D.toString()):String(D)).join("|")})$`),$._zod.parse=(D,b)=>{let A=D.value;if(U.has(A))return D;return D.issues.push({code:"invalid_value",values:I.values,input:A,inst:$}),D}}),MA=B("$ZodFile",($,I)=>{n.init($,I),$._zod.parse=(U,D)=>{let b=U.value;if(b instanceof File)return U;return U.issues.push({expected:"file",code:"invalid_type",input:b,inst:$}),U}}),VA=B("$ZodTransform",($,I)=>{n.init($,I),$._zod.parse=(U,D)=>{if(D.direction==="backward")throw new R4($.constructor.name);let b=I.transform(U.value,U);if(D.async)return(b instanceof Promise?b:Promise.resolve(b)).then((w)=>{return U.value=w,U});if(b instanceof Promise)throw new F6;return U.value=b,U}});function Sv($,I){if($.issues.length&&I===void 0)return{issues:[],value:void 0};return $}var KA=B("$ZodOptional",($,I)=>{n.init($,I),$._zod.optin="optional",$._zod.optout="optional",e($._zod,"values",()=>{return I.innerType._zod.values?new Set([...I.innerType._zod.values,void 0]):void 0}),e($._zod,"pattern",()=>{let U=I.innerType._zod.pattern;return U?new RegExp(`^(${ZU(U.source)})?$`):void 0}),$._zod.parse=(U,D)=>{if(I.innerType._zod.optin==="optional"){let b=I.innerType._zod.run(U,D);if(b instanceof Promise)return b.then((A)=>Sv(A,U.value));return Sv(b,U.value)}if(U.value===void 0)return U;return I.innerType._zod.run(U,D)}}),zA=B("$ZodNullable",($,I)=>{n.init($,I),e($._zod,"optin",()=>I.innerType._zod.optin),e($._zod,"optout",()=>I.innerType._zod.optout),e($._zod,"pattern",()=>{let U=I.innerType._zod.pattern;return U?new RegExp(`^(${ZU(U.source)}|null)$`):void 0}),e($._zod,"values",()=>{return I.innerType._zod.values?new Set([...I.innerType._zod.values,null]):void 0}),$._zod.parse=(U,D)=>{if(U.value===null)return U;return I.innerType._zod.run(U,D)}}),FA=B("$ZodDefault",($,I)=>{n.init($,I),$._zod.optin="optional",e($._zod,"values",()=>I.innerType._zod.values),$._zod.parse=(U,D)=>{if(D.direction==="backward")return I.innerType._zod.run(U,D);if(U.value===void 0)return U.value=I.defaultValue,U;let b=I.innerType._zod.run(U,D);if(b instanceof Promise)return b.then((A)=>jv(A,I));return jv(b,I)}});function jv($,I){if($.value===void 0)$.value=I.defaultValue;return $}var kA=B("$ZodPrefault",($,I)=>{n.init($,I),$._zod.optin="optional",e($._zod,"values",()=>I.innerType._zod.values),$._zod.parse=(U,D)=>{if(D.direction==="backward")return I.innerType._zod.run(U,D);if(U.value===void 0)U.value=I.defaultValue;return I.innerType._zod.run(U,D)}}),qA=B("$ZodNonOptional",($,I)=>{n.init($,I),e($._zod,"values",()=>{let U=I.innerType._zod.values;return U?new Set([...U].filter((D)=>D!==void 0)):void 0}),$._zod.parse=(U,D)=>{let b=I.innerType._zod.run(U,D);if(b instanceof Promise)return b.then((A)=>Pv(A,$));return Pv(b,$)}});function Pv($,I){if(!$.issues.length&&$.value===void 0)$.issues.push({code:"invalid_type",expected:"nonoptional",input:$.value,inst:I});return $}var EA=B("$ZodSuccess",($,I)=>{n.init($,I),$._zod.parse=(U,D)=>{if(D.direction==="backward")throw new R4("ZodSuccess");let b=I.innerType._zod.run(U,D);if(b instanceof Promise)return b.then((A)=>{return U.value=A.issues.length===0,U});return U.value=b.issues.length===0,U}}),SA=B("$ZodCatch",($,I)=>{n.init($,I),e($._zod,"optin",()=>I.innerType._zod.optin),e($._zod,"optout",()=>I.innerType._zod.optout),e($._zod,"values",()=>I.innerType._zod.values),$._zod.parse=(U,D)=>{if(D.direction==="backward")return I.innerType._zod.run(U,D);let b=I.innerType._zod.run(U,D);if(b instanceof Promise)return b.then((A)=>{if(U.value=A.value,A.issues.length)U.value=I.catchValue({...U,error:{issues:A.issues.map((w)=>u$(w,D,M$()))},input:U.value}),U.issues=[];return U});if(U.value=b.value,b.issues.length)U.value=I.catchValue({...U,error:{issues:b.issues.map((A)=>u$(A,D,M$()))},input:U.value}),U.issues=[];return U}}),jA=B("$ZodNaN",($,I)=>{n.init($,I),$._zod.parse=(U,D)=>{if(typeof U.value!=="number"||!Number.isNaN(U.value))return U.issues.push({input:U.value,inst:$,expected:"nan",code:"invalid_type"}),U;return U}}),PA=B("$ZodPipe",($,I)=>{n.init($,I),e($._zod,"values",()=>I.in._zod.values),e($._zod,"optin",()=>I.in._zod.optin),e($._zod,"optout",()=>I.out._zod.optout),e($._zod,"propValues",()=>I.in._zod.propValues),$._zod.parse=(U,D)=>{if(D.direction==="backward"){let A=I.out._zod.run(U,D);if(A instanceof Promise)return A.then((w)=>jD(w,I.in,D));return jD(A,I.in,D)}let b=I.in._zod.run(U,D);if(b instanceof Promise)return b.then((A)=>jD(A,I.out,D));return jD(b,I.out,D)}});function jD($,I,U){if($.issues.length)return $.aborted=!0,$;return I._zod.run({value:$.value,issues:$.issues},U)}var YI=B("$ZodCodec",($,I)=>{n.init($,I),e($._zod,"values",()=>I.in._zod.values),e($._zod,"optin",()=>I.in._zod.optin),e($._zod,"optout",()=>I.out._zod.optout),e($._zod,"propValues",()=>I.in._zod.propValues),$._zod.parse=(U,D)=>{if((D.direction||"forward")==="forward"){let A=I.in._zod.run(U,D);if(A instanceof Promise)return A.then((w)=>PD(w,I,D));return PD(A,I,D)}else{let A=I.out._zod.run(U,D);if(A instanceof Promise)return A.then((w)=>PD(w,I,D));return PD(A,I,D)}}});function PD($,I,U){if($.issues.length)return $.aborted=!0,$;if((U.direction||"forward")==="forward"){let b=I.transform($.value,$);if(b instanceof Promise)return b.then((A)=>RD($,A,I.out,U));return RD($,b,I.out,U)}else{let b=I.reverseTransform($.value,$);if(b instanceof Promise)return b.then((A)=>RD($,A,I.in,U));return RD($,b,I.in,U)}}function RD($,I,U,D){if($.issues.length)return $.aborted=!0,$;return U._zod.run({value:I,issues:$.issues},D)}var RA=B("$ZodReadonly",($,I)=>{n.init($,I),e($._zod,"propValues",()=>I.innerType._zod.propValues),e($._zod,"values",()=>I.innerType._zod.values),e($._zod,"optin",()=>I.innerType?._zod?.optin),e($._zod,"optout",()=>I.innerType?._zod?.optout),$._zod.parse=(U,D)=>{if(D.direction==="backward")return I.innerType._zod.run(U,D);let b=I.innerType._zod.run(U,D);if(b instanceof Promise)return b.then(Rv);return Rv(b)}});function Rv($){return $.value=Object.freeze($.value),$}var TA=B("$ZodTemplateLiteral",($,I)=>{n.init($,I);let U=[];for(let D of I.parts)if(typeof D==="object"&&D!==null){if(!D._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...D._zod.traits].shift()}`);let b=D._zod.pattern instanceof RegExp?D._zod.pattern.source:D._zod.pattern;if(!b)throw new Error(`Invalid template literal part: ${D._zod.traits}`);let A=b.startsWith("^")?1:0,w=b.endsWith("$")?b.length-1:b.length;U.push(b.slice(A,w))}else if(D===null||IN.has(typeof D))U.push(s$(`${D}`));else throw new Error(`Invalid template literal part: ${D}`);$._zod.pattern=new RegExp(`^${U.join("")}$`),$._zod.parse=(D,b)=>{if(typeof D.value!=="string")return D.issues.push({input:D.value,inst:$,expected:"template_literal",code:"invalid_type"}),D;if($._zod.pattern.lastIndex=0,!$._zod.pattern.test(D.value))return D.issues.push({input:D.value,inst:$,code:"invalid_format",format:I.format??"template_literal",pattern:$._zod.pattern.source}),D;return D}}),_A=B("$ZodFunction",($,I)=>{return n.init($,I),$._def=I,$._zod.def=I,$.implement=(U)=>{if(typeof U!=="function")throw new Error("implement() must be called with a function");return function(...D){let b=$._def.input?_4($._def.input,D):D,A=Reflect.apply(U,this,b);if($._def.output)return _4($._def.output,A);return A}},$.implementAsync=(U)=>{if(typeof U!=="function")throw new Error("implementAsync() must be called with a function");return async function(...D){let b=$._def.input?await C4($._def.input,D):D,A=await Reflect.apply(U,this,b);if($._def.output)return await C4($._def.output,A);return A}},$._zod.parse=(U,D)=>{if(typeof U.value!=="function")return U.issues.push({code:"invalid_type",expected:"function",input:U.value,inst:$}),U;if($._def.output&&$._def.output._zod.def.type==="promise")U.value=$.implementAsync(U.value);else U.value=$.implement(U.value);return U},$.input=(...U)=>{let D=$.constructor;if(Array.isArray(U[0]))return new D({type:"function",input:new mU({type:"tuple",items:U[0],rest:U[1]}),output:$._def.output});return new D({type:"function",input:U[0],output:$._def.output})},$.output=(U)=>{return new $.constructor({type:"function",input:$._def.input,output:U})},$}),CA=B("$ZodPromise",($,I)=>{n.init($,I),$._zod.parse=(U,D)=>{return Promise.resolve(U.value).then((b)=>I.innerType._zod.run({value:b,issues:[]},D))}}),fA=B("$ZodLazy",($,I)=>{n.init($,I),e($._zod,"innerType",()=>I.getter()),e($._zod,"pattern",()=>$._zod.innerType?._zod?.pattern),e($._zod,"propValues",()=>$._zod.innerType?._zod?.propValues),e($._zod,"optin",()=>$._zod.innerType?._zod?.optin??void 0),e($._zod,"optout",()=>$._zod.innerType?._zod?.optout??void 0),$._zod.parse=(U,D)=>{return $._zod.innerType._zod.run(U,D)}}),ZA=B("$ZodCustom",($,I)=>{X$.init($,I),n.init($,I),$._zod.parse=(U,D)=>{return U},$._zod.check=(U)=>{let D=U.value,b=I.fn(D);if(b instanceof Promise)return b.then((A)=>Tv(A,U,D,$));Tv(b,U,D,$);return}});function Tv($,I,U,D){if(!$){let b={code:"custom",input:U,inst:D,path:[...D._zod.def.path??[]],continue:!D._zod.def.abort};if(D._zod.def.params)b.params=D._zod.def.params;I.issues.push(AI(b))}}var vI={};f6(vI,{zhTW:()=>tX,zhCN:()=>pX,yo:()=>aX,vi:()=>dX,ur:()=>oX,uk:()=>aU,ua:()=>mX,tr:()=>cX,th:()=>rX,ta:()=>nX,sv:()=>iX,sl:()=>uX,ru:()=>hX,pt:()=>lX,ps:()=>yX,pl:()=>xX,ota:()=>gX,no:()=>ZX,nl:()=>fX,ms:()=>CX,mk:()=>_X,lt:()=>TX,ko:()=>RX,km:()=>dU,kh:()=>PX,ka:()=>jX,ja:()=>SX,it:()=>EX,is:()=>qX,id:()=>kX,hu:()=>FX,he:()=>zX,frCA:()=>KX,fr:()=>VX,fi:()=>MX,fa:()=>HX,es:()=>JX,eo:()=>LX,en:()=>oU,de:()=>BX,da:()=>vX,cs:()=>YX,ca:()=>QX,bg:()=>GX,be:()=>WX,az:()=>XX,ar:()=>NX});var Lz=()=>{let $={string:{unit:"حرف",verb:"أن يحوي"},file:{unit:"بايت",verb:"أن يحوي"},array:{unit:"عنصر",verb:"أن يحوي"},set:{unit:"عنصر",verb:"أن يحوي"}};function I(b){return $[b]??null}let U=(b)=>{let A=typeof b;switch(A){case"number":return Number.isNaN(b)?"NaN":"number";case"object":{if(Array.isArray(b))return"array";if(b===null)return"null";if(Object.getPrototypeOf(b)!==Object.prototype&&b.constructor)return b.constructor.name}}return A},D={regex:"مدخل",email:"بريد إلكتروني",url:"رابط",emoji:"إيموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاريخ ووقت بمعيار ISO",date:"تاريخ بمعيار ISO",time:"وقت بمعيار ISO",duration:"مدة بمعيار ISO",ipv4:"عنوان IPv4",ipv6:"عنوان IPv6",cidrv4:"مدى عناوين بصيغة IPv4",cidrv6:"مدى عناوين بصيغة IPv6",base64:"نَص بترميز base64-encoded",base64url:"نَص بترميز base64url-encoded",json_string:"نَص على هيئة JSON",e164:"رقم هاتف بمعيار E.164",jwt:"JWT",template_literal:"مدخل"};return(b)=>{switch(b.code){case"invalid_type":return`مدخلات غير مقبولة: يفترض إدخال ${b.expected}، ولكن تم إدخال ${U(b.input)}`;case"invalid_value":if(b.values.length===1)return`مدخلات غير مقبولة: يفترض إدخال ${k(b.values[0])}`;return`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${M(b.values,"|")}`;case"too_big":{let A=b.inclusive?"<=":"<",w=I(b.origin);if(w)return` أكبر من اللازم: يفترض أن تكون ${b.origin??"القيمة"} ${A} ${b.maximum.toString()} ${w.unit??"عنصر"}`;return`أكبر من اللازم: يفترض أن تكون ${b.origin??"القيمة"} ${A} ${b.maximum.toString()}`}case"too_small":{let A=b.inclusive?">=":">",w=I(b.origin);if(w)return`أصغر من اللازم: يفترض لـ ${b.origin} أن يكون ${A} ${b.minimum.toString()} ${w.unit}`;return`أصغر من اللازم: يفترض لـ ${b.origin} أن يكون ${A} ${b.minimum.toString()}`}case"invalid_format":{let A=b;if(A.format==="starts_with")return`نَص غير مقبول: يجب أن يبدأ بـ "${b.prefix}"`;if(A.format==="ends_with")return`نَص غير مقبول: يجب أن ينتهي بـ "${A.suffix}"`;if(A.format==="includes")return`نَص غير مقبول: يجب أن يتضمَّن "${A.includes}"`;if(A.format==="regex")return`نَص غير مقبول: يجب أن يطابق النمط ${A.pattern}`;return`${D[A.format]??b.format} غير مقبول`}case"not_multiple_of":return`رقم غير مقبول: يجب أن يكون من مضاعفات ${b.divisor}`;case"unrecognized_keys":return`معرف${b.keys.length>1?"ات":""} غريب${b.keys.length>1?"ة":""}: ${M(b.keys,"، ")}`;case"invalid_key":return`معرف غير مقبول في ${b.origin}`;case"invalid_union":return"مدخل غير مقبول";case"invalid_element":return`مدخل غير مقبول في ${b.origin}`;default:return"مدخل غير مقبول"}}};function NX(){return{localeError:Lz()}}var Jz=()=>{let $={string:{unit:"simvol",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"element",verb:"olmalıdır"},set:{unit:"element",verb:"olmalıdır"}};function I(b){return $[b]??null}let U=(b)=>{let A=typeof b;switch(A){case"number":return Number.isNaN(b)?"NaN":"number";case"object":{if(Array.isArray(b))return"array";if(b===null)return"null";if(Object.getPrototypeOf(b)!==Object.prototype&&b.constructor)return b.constructor.name}}return A},D={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(b)=>{switch(b.code){case"invalid_type":return`Yanlış dəyər: gözlənilən ${b.expected}, daxil olan ${U(b.input)}`;case"invalid_value":if(b.values.length===1)return`Yanlış dəyər: gözlənilən ${k(b.values[0])}`;return`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${M(b.values,"|")}`;case"too_big":{let A=b.inclusive?"<=":"<",w=I(b.origin);if(w)return`Çox böyük: gözlənilən ${b.origin??"dəyər"} ${A}${b.maximum.toString()} ${w.unit??"element"}`;return`Çox böyük: gözlənilən ${b.origin??"dəyər"} ${A}${b.maximum.toString()}`}case"too_small":{let A=b.inclusive?">=":">",w=I(b.origin);if(w)return`Çox kiçik: gözlənilən ${b.origin} ${A}${b.minimum.toString()} ${w.unit}`;return`Çox kiçik: gözlənilən ${b.origin} ${A}${b.minimum.toString()}`}case"invalid_format":{let A=b;if(A.format==="starts_with")return`Yanlış mətn: "${A.prefix}" ilə başlamalıdır`;if(A.format==="ends_with")return`Yanlış mətn: "${A.suffix}" ilə bitməlidir`;if(A.format==="includes")return`Yanlış mətn: "${A.includes}" daxil olmalıdır`;if(A.format==="regex")return`Yanlış mətn: ${A.pattern} şablonuna uyğun olmalıdır`;return`Yanlış ${D[A.format]??b.format}`}case"not_multiple_of":return`Yanlış ədəd: ${b.divisor} ilə bölünə bilən olmalıdır`;case"unrecognized_keys":return`Tanınmayan açar${b.keys.length>1?"lar":""}: ${M(b.keys,", ")}`;case"invalid_key":return`${b.origin} daxilində yanlış açar`;case"invalid_union":return"Yanlış dəyər";case"invalid_element":return`${b.origin} daxilində yanlış dəyər`;default:return"Yanlış dəyər"}}};function XX(){return{localeError:Jz()}}function gv($,I,U,D){let b=Math.abs($),A=b%10,w=b%100;if(w>=11&&w<=19)return D;if(A===1)return I;if(A>=2&&A<=4)return U;return D}var Hz=()=>{let $={string:{unit:{one:"сімвал",few:"сімвалы",many:"сімвалаў"},verb:"мець"},array:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},set:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},file:{unit:{one:"байт",few:"байты",many:"байтаў"},verb:"мець"}};function I(b){return $[b]??null}let U=(b)=>{let A=typeof b;switch(A){case"number":return Number.isNaN(b)?"NaN":"лік";case"object":{if(Array.isArray(b))return"масіў";if(b===null)return"null";if(Object.getPrototypeOf(b)!==Object.prototype&&b.constructor)return b.constructor.name}}return A},D={regex:"увод",email:"email адрас",url:"URL",emoji:"эмодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата і час",date:"ISO дата",time:"ISO час",duration:"ISO працягласць",ipv4:"IPv4 адрас",ipv6:"IPv6 адрас",cidrv4:"IPv4 дыяпазон",cidrv6:"IPv6 дыяпазон",base64:"радок у фармаце base64",base64url:"радок у фармаце base64url",json_string:"JSON радок",e164:"нумар E.164",jwt:"JWT",template_literal:"увод"};return(b)=>{switch(b.code){case"invalid_type":return`Няправільны ўвод: чакаўся ${b.expected}, атрымана ${U(b.input)}`;case"invalid_value":if(b.values.length===1)return`Няправільны ўвод: чакалася ${k(b.values[0])}`;return`Няправільны варыянт: чакаўся адзін з ${M(b.values,"|")}`;case"too_big":{let A=b.inclusive?"<=":"<",w=I(b.origin);if(w){let O=Number(b.maximum),N=gv(O,w.unit.one,w.unit.few,w.unit.many);return`Занадта вялікі: чакалася, што ${b.origin??"значэнне"} павінна ${w.verb} ${A}${b.maximum.toString()} ${N}`}return`Занадта вялікі: чакалася, што ${b.origin??"значэнне"} павінна быць ${A}${b.maximum.toString()}`}case"too_small":{let A=b.inclusive?">=":">",w=I(b.origin);if(w){let O=Number(b.minimum),N=gv(O,w.unit.one,w.unit.few,w.unit.many);return`Занадта малы: чакалася, што ${b.origin} павінна ${w.verb} ${A}${b.minimum.toString()} ${N}`}return`Занадта малы: чакалася, што ${b.origin} павінна быць ${A}${b.minimum.toString()}`}case"invalid_format":{let A=b;if(A.format==="starts_with")return`Няправільны радок: павінен пачынацца з "${A.prefix}"`;if(A.format==="ends_with")return`Няправільны радок: павінен заканчвацца на "${A.suffix}"`;if(A.format==="includes")return`Няправільны радок: павінен змяшчаць "${A.includes}"`;if(A.format==="regex")return`Няправільны радок: павінен адпавядаць шаблону ${A.pattern}`;return`Няправільны ${D[A.format]??b.format}`}case"not_multiple_of":return`Няправільны лік: павінен быць кратным ${b.divisor}`;case"unrecognized_keys":return`Нераспазнаны ${b.keys.length>1?"ключы":"ключ"}: ${M(b.keys,", ")}`;case"invalid_key":return`Няправільны ключ у ${b.origin}`;case"invalid_union":return"Няправільны ўвод";case"invalid_element":return`Няправільнае значэнне ў ${b.origin}`;default:return"Няправільны ўвод"}}};function WX(){return{localeError:Hz()}}var Mz=($)=>{let I=typeof $;switch(I){case"number":return Number.isNaN($)?"NaN":"число";case"object":{if(Array.isArray($))return"масив";if($===null)return"null";if(Object.getPrototypeOf($)!==Object.prototype&&$.constructor)return $.constructor.name}}return I},Vz=()=>{let $={string:{unit:"символа",verb:"да съдържа"},file:{unit:"байта",verb:"да съдържа"},array:{unit:"елемента",verb:"да съдържа"},set:{unit:"елемента",verb:"да съдържа"}};function I(D){return $[D]??null}let U={regex:"вход",email:"имейл адрес",url:"URL",emoji:"емоджи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO време",date:"ISO дата",time:"ISO време",duration:"ISO продължителност",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"base64-кодиран низ",base64url:"base64url-кодиран низ",json_string:"JSON низ",e164:"E.164 номер",jwt:"JWT",template_literal:"вход"};return(D)=>{switch(D.code){case"invalid_type":return`Невалиден вход: очакван ${D.expected}, получен ${Mz(D.input)}`;case"invalid_value":if(D.values.length===1)return`Невалиден вход: очакван ${k(D.values[0])}`;return`Невалидна опция: очаквано едно от ${M(D.values,"|")}`;case"too_big":{let b=D.inclusive?"<=":"<",A=I(D.origin);if(A)return`Твърде голямо: очаква се ${D.origin??"стойност"} да съдържа ${b}${D.maximum.toString()} ${A.unit??"елемента"}`;return`Твърде голямо: очаква се ${D.origin??"стойност"} да бъде ${b}${D.maximum.toString()}`}case"too_small":{let b=D.inclusive?">=":">",A=I(D.origin);if(A)return`Твърде малко: очаква се ${D.origin} да съдържа ${b}${D.minimum.toString()} ${A.unit}`;return`Твърде малко: очаква се ${D.origin} да бъде ${b}${D.minimum.toString()}`}case"invalid_format":{let b=D;if(b.format==="starts_with")return`Невалиден низ: трябва да започва с "${b.prefix}"`;if(b.format==="ends_with")return`Невалиден низ: трябва да завършва с "${b.suffix}"`;if(b.format==="includes")return`Невалиден низ: трябва да включва "${b.includes}"`;if(b.format==="regex")return`Невалиден низ: трябва да съвпада с ${b.pattern}`;let A="Невалиден";if(b.format==="emoji")A="Невалидно";if(b.format==="datetime")A="Невалидно";if(b.format==="date")A="Невалидна";if(b.format==="time")A="Невалидно";if(b.format==="duration")A="Невалидна";return`${A} ${U[b.format]??D.format}`}case"not_multiple_of":return`Невалидно число: трябва да бъде кратно на ${D.divisor}`;case"unrecognized_keys":return`Неразпознат${D.keys.length>1?"и":""} ключ${D.keys.length>1?"ове":""}: ${M(D.keys,", ")}`;case"invalid_key":return`Невалиден ключ в ${D.origin}`;case"invalid_union":return"Невалиден вход";case"invalid_element":return`Невалидна стойност в ${D.origin}`;default:return"Невалиден вход"}}};function GX(){return{localeError:Vz()}}var Kz=()=>{let $={string:{unit:"caràcters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function I(b){return $[b]??null}let U=(b)=>{let A=typeof b;switch(A){case"number":return Number.isNaN(b)?"NaN":"number";case"object":{if(Array.isArray(b))return"array";if(b===null)return"null";if(Object.getPrototypeOf(b)!==Object.prototype&&b.constructor)return b.constructor.name}}return A},D={regex:"entrada",email:"adreça electrònica",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:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adreça IPv4",ipv6:"adreça IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"};return(b)=>{switch(b.code){case"invalid_type":return`Tipus invàlid: s'esperava ${b.expected}, s'ha rebut ${U(b.input)}`;case"invalid_value":if(b.values.length===1)return`Valor invàlid: s'esperava ${k(b.values[0])}`;return`Opció invàlida: s'esperava una de ${M(b.values," o ")}`;case"too_big":{let A=b.inclusive?"com a màxim":"menys de",w=I(b.origin);if(w)return`Massa gran: s'esperava que ${b.origin??"el valor"} contingués ${A} ${b.maximum.toString()} ${w.unit??"elements"}`;return`Massa gran: s'esperava que ${b.origin??"el valor"} fos ${A} ${b.maximum.toString()}`}case"too_small":{let A=b.inclusive?"com a mínim":"més de",w=I(b.origin);if(w)return`Massa petit: s'esperava que ${b.origin} contingués ${A} ${b.minimum.toString()} ${w.unit}`;return`Massa petit: s'esperava que ${b.origin} fos ${A} ${b.minimum.toString()}`}case"invalid_format":{let A=b;if(A.format==="starts_with")return`Format invàlid: ha de començar amb "${A.prefix}"`;if(A.format==="ends_with")return`Format invàlid: ha d'acabar amb "${A.suffix}"`;if(A.format==="includes")return`Format invàlid: ha d'incloure "${A.includes}"`;if(A.format==="regex")return`Format invàlid: ha de coincidir amb el patró ${A.pattern}`;return`Format invàlid per a ${D[A.format]??b.format}`}case"not_multiple_of":return`Número invàlid: ha de ser múltiple de ${b.divisor}`;case"unrecognized_keys":return`Clau${b.keys.length>1?"s":""} no reconeguda${b.keys.length>1?"s":""}: ${M(b.keys,", ")}`;case"invalid_key":return`Clau invàlida a ${b.origin}`;case"invalid_union":return"Entrada invàlida";case"invalid_element":return`Element invàlid a ${b.origin}`;default:return"Entrada invàlida"}}};function QX(){return{localeError:Kz()}}var zz=()=>{let $={string:{unit:"znaků",verb:"mít"},file:{unit:"bajtů",verb:"mít"},array:{unit:"prvků",verb:"mít"},set:{unit:"prvků",verb:"mít"}};function I(b){return $[b]??null}let U=(b)=>{let A=typeof b;switch(A){case"number":return Number.isNaN(b)?"NaN":"číslo";case"string":return"řetězec";case"boolean":return"boolean";case"bigint":return"bigint";case"function":return"funkce";case"symbol":return"symbol";case"undefined":return"undefined";case"object":{if(Array.isArray(b))return"pole";if(b===null)return"null";if(Object.getPrototypeOf(b)!==Object.prototype&&b.constructor)return b.constructor.name}}return A},D={regex:"regulární výraz",email:"e-mailová adresa",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:"datum a čas ve formátu ISO",date:"datum ve formátu ISO",time:"čas ve formátu ISO",duration:"doba trvání ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"řetězec zakódovaný ve formátu base64",base64url:"řetězec zakódovaný ve formátu base64url",json_string:"řetězec ve formátu JSON",e164:"číslo E.164",jwt:"JWT",template_literal:"vstup"};return(b)=>{switch(b.code){case"invalid_type":return`Neplatný vstup: očekáváno ${b.expected}, obdrženo ${U(b.input)}`;case"invalid_value":if(b.values.length===1)return`Neplatný vstup: očekáváno ${k(b.values[0])}`;return`Neplatná možnost: očekávána jedna z hodnot ${M(b.values,"|")}`;case"too_big":{let A=b.inclusive?"<=":"<",w=I(b.origin);if(w)return`Hodnota je příliš velká: ${b.origin??"hodnota"} musí mít ${A}${b.maximum.toString()} ${w.unit??"prvků"}`;return`Hodnota je příliš velká: ${b.origin??"hodnota"} musí být ${A}${b.maximum.toString()}`}case"too_small":{let A=b.inclusive?">=":">",w=I(b.origin);if(w)return`Hodnota je příliš malá: ${b.origin??"hodnota"} musí mít ${A}${b.minimum.toString()} ${w.unit??"prvků"}`;return`Hodnota je příliš malá: ${b.origin??"hodnota"} musí být ${A}${b.minimum.toString()}`}case"invalid_format":{let A=b;if(A.format==="starts_with")return`Neplatný řetězec: musí začínat na "${A.prefix}"`;if(A.format==="ends_with")return`Neplatný řetězec: musí končit na "${A.suffix}"`;if(A.format==="includes")return`Neplatný řetězec: musí obsahovat "${A.includes}"`;if(A.format==="regex")return`Neplatný řetězec: musí odpovídat vzoru ${A.pattern}`;return`Neplatný formát ${D[A.format]??b.format}`}case"not_multiple_of":return`Neplatné číslo: musí být násobkem ${b.divisor}`;case"unrecognized_keys":return`Neznámé klíče: ${M(b.keys,", ")}`;case"invalid_key":return`Neplatný klíč v ${b.origin}`;case"invalid_union":return"Neplatný vstup";case"invalid_element":return`Neplatná hodnota v ${b.origin}`;default:return"Neplatný vstup"}}};function YX(){return{localeError:zz()}}var Fz=()=>{let $={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}},I={string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"sæt",file:"fil"};function U(w){return $[w]??null}function D(w){return I[w]??w}let b=(w)=>{let O=typeof w;switch(O){case"number":return Number.isNaN(w)?"NaN":"tal";case"object":{if(Array.isArray(w))return"liste";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype&&w.constructor)return w.constructor.name;return"objekt"}}return O},A={regex:"input",email:"e-mailadresse",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 dato- og klokkeslæt",date:"ISO-dato",time:"ISO-klokkeslæt",duration:"ISO-varighed",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"};return(w)=>{switch(w.code){case"invalid_type":return`Ugyldigt input: forventede ${D(w.expected)}, fik ${D(b(w.input))}`;case"invalid_value":if(w.values.length===1)return`Ugyldig værdi: forventede ${k(w.values[0])}`;return`Ugyldigt valg: forventede en af følgende ${M(w.values,"|")}`;case"too_big":{let O=w.inclusive?"<=":"<",N=U(w.origin),X=D(w.origin);if(N)return`For stor: forventede ${X??"value"} ${N.verb} ${O} ${w.maximum.toString()} ${N.unit??"elementer"}`;return`For stor: forventede ${X??"value"} havde ${O} ${w.maximum.toString()}`}case"too_small":{let O=w.inclusive?">=":">",N=U(w.origin),X=D(w.origin);if(N)return`For lille: forventede ${X} ${N.verb} ${O} ${w.minimum.toString()} ${N.unit}`;return`For lille: forventede ${X} havde ${O} ${w.minimum.toString()}`}case"invalid_format":{let O=w;if(O.format==="starts_with")return`Ugyldig streng: skal starte med "${O.prefix}"`;if(O.format==="ends_with")return`Ugyldig streng: skal ende med "${O.suffix}"`;if(O.format==="includes")return`Ugyldig streng: skal indeholde "${O.includes}"`;if(O.format==="regex")return`Ugyldig streng: skal matche mønsteret ${O.pattern}`;return`Ugyldig ${A[O.format]??w.format}`}case"not_multiple_of":return`Ugyldigt tal: skal være deleligt med ${w.divisor}`;case"unrecognized_keys":return`${w.keys.length>1?"Ukendte nøgler":"Ukendt nøgle"}: ${M(w.keys,", ")}`;case"invalid_key":return`Ugyldig nøgle i ${w.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig værdi i ${w.origin}`;default:return"Ugyldigt input"}}};function vX(){return{localeError:Fz()}}var kz=()=>{let $={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function I(b){return $[b]??null}let U=(b)=>{let A=typeof b;switch(A){case"number":return Number.isNaN(b)?"NaN":"Zahl";case"object":{if(Array.isArray(b))return"Array";if(b===null)return"null";if(Object.getPrototypeOf(b)!==Object.prototype&&b.constructor)return b.constructor.name}}return A},D={regex:"Eingabe",email:"E-Mail-Adresse",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-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"};return(b)=>{switch(b.code){case"invalid_type":return`Ungültige Eingabe: erwartet ${b.expected}, erhalten ${U(b.input)}`;case"invalid_value":if(b.values.length===1)return`Ungültige Eingabe: erwartet ${k(b.values[0])}`;return`Ungültige Option: erwartet eine von ${M(b.values,"|")}`;case"too_big":{let A=b.inclusive?"<=":"<",w=I(b.origin);if(w)return`Zu groß: erwartet, dass ${b.origin??"Wert"} ${A}${b.maximum.toString()} ${w.unit??"Elemente"} hat`;return`Zu groß: erwartet, dass ${b.origin??"Wert"} ${A}${b.maximum.toString()} ist`}case"too_small":{let A=b.inclusive?">=":">",w=I(b.origin);if(w)return`Zu klein: erwartet, dass ${b.origin} ${A}${b.minimum.toString()} ${w.unit} hat`;return`Zu klein: erwartet, dass ${b.origin} ${A}${b.minimum.toString()} ist`}case"invalid_format":{let A=b;if(A.format==="starts_with")return`Ungültiger String: muss mit "${A.prefix}" beginnen`;if(A.format==="ends_with")return`Ungültiger String: muss mit "${A.suffix}" enden`;if(A.format==="includes")return`Ungültiger String: muss "${A.includes}" enthalten`;if(A.format==="regex")return`Ungültiger String: muss dem Muster ${A.pattern} entsprechen`;return`Ungültig: ${D[A.format]??b.format}`}case"not_multiple_of":return`Ungültige Zahl: muss ein Vielfaches von ${b.divisor} sein`;case"unrecognized_keys":return`${b.keys.length>1?"Unbekannte Schlüssel":"Unbekannter Schlüssel"}: ${M(b.keys,", ")}`;case"invalid_key":return`Ungültiger Schlüssel in ${b.origin}`;case"invalid_union":return"Ungültige Eingabe";case"invalid_element":return`Ungültiger Wert in ${b.origin}`;default:return"Ungültige Eingabe"}}};function BX(){return{localeError:kz()}}var qz=($)=>{let I=typeof $;switch(I){case"number":return Number.isNaN($)?"NaN":"number";case"object":{if(Array.isArray($))return"array";if($===null)return"null";if(Object.getPrototypeOf($)!==Object.prototype&&$.constructor)return $.constructor.name}}return I},Ez=()=>{let $={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 I(D){return $[D]??null}let U={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return(D)=>{switch(D.code){case"invalid_type":return`Invalid input: expected ${D.expected}, received ${qz(D.input)}`;case"invalid_value":if(D.values.length===1)return`Invalid input: expected ${k(D.values[0])}`;return`Invalid option: expected one of ${M(D.values,"|")}`;case"too_big":{let b=D.inclusive?"<=":"<",A=I(D.origin);if(A)return`Too big: expected ${D.origin??"value"} to have ${b}${D.maximum.toString()} ${A.unit??"elements"}`;return`Too big: expected ${D.origin??"value"} to be ${b}${D.maximum.toString()}`}case"too_small":{let b=D.inclusive?">=":">",A=I(D.origin);if(A)return`Too small: expected ${D.origin} to have ${b}${D.minimum.toString()} ${A.unit}`;return`Too small: expected ${D.origin} to be ${b}${D.minimum.toString()}`}case"invalid_format":{let b=D;if(b.format==="starts_with")return`Invalid string: must start with "${b.prefix}"`;if(b.format==="ends_with")return`Invalid string: must end with "${b.suffix}"`;if(b.format==="includes")return`Invalid string: must include "${b.includes}"`;if(b.format==="regex")return`Invalid string: must match pattern ${b.pattern}`;return`Invalid ${U[b.format]??D.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${D.divisor}`;case"unrecognized_keys":return`Unrecognized key${D.keys.length>1?"s":""}: ${M(D.keys,", ")}`;case"invalid_key":return`Invalid key in ${D.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${D.origin}`;default:return"Invalid input"}}};function oU(){return{localeError:Ez()}}var Sz=($)=>{let I=typeof $;switch(I){case"number":return Number.isNaN($)?"NaN":"nombro";case"object":{if(Array.isArray($))return"tabelo";if($===null)return"senvalora";if(Object.getPrototypeOf($)!==Object.prototype&&$.constructor)return $.constructor.name}}return I},jz=()=>{let $={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function I(D){return $[D]??null}let U={regex:"enigo",email:"retadreso",url:"URL",emoji:"emoĝio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-daŭro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"};return(D)=>{switch(D.code){case"invalid_type":return`Nevalida enigo: atendiĝis ${D.expected}, riceviĝis ${Sz(D.input)}`;case"invalid_value":if(D.values.length===1)return`Nevalida enigo: atendiĝis ${k(D.values[0])}`;return`Nevalida opcio: atendiĝis unu el ${M(D.values,"|")}`;case"too_big":{let b=D.inclusive?"<=":"<",A=I(D.origin);if(A)return`Tro granda: atendiĝis ke ${D.origin??"valoro"} havu ${b}${D.maximum.toString()} ${A.unit??"elementojn"}`;return`Tro granda: atendiĝis ke ${D.origin??"valoro"} havu ${b}${D.maximum.toString()}`}case"too_small":{let b=D.inclusive?">=":">",A=I(D.origin);if(A)return`Tro malgranda: atendiĝis ke ${D.origin} havu ${b}${D.minimum.toString()} ${A.unit}`;return`Tro malgranda: atendiĝis ke ${D.origin} estu ${b}${D.minimum.toString()}`}case"invalid_format":{let b=D;if(b.format==="starts_with")return`Nevalida karaktraro: devas komenciĝi per "${b.prefix}"`;if(b.format==="ends_with")return`Nevalida karaktraro: devas finiĝi per "${b.suffix}"`;if(b.format==="includes")return`Nevalida karaktraro: devas inkluzivi "${b.includes}"`;if(b.format==="regex")return`Nevalida karaktraro: devas kongrui kun la modelo ${b.pattern}`;return`Nevalida ${U[b.format]??D.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${D.divisor}`;case"unrecognized_keys":return`Nekonata${D.keys.length>1?"j":""} ŝlosilo${D.keys.length>1?"j":""}: ${M(D.keys,", ")}`;case"invalid_key":return`Nevalida ŝlosilo en ${D.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${D.origin}`;default:return"Nevalida enigo"}}};function LX(){return{localeError:jz()}}var Pz=()=>{let $={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}},I={string:"texto",number:"número",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"número grande",symbol:"símbolo",undefined:"indefinido",null:"nulo",function:"función",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeración",union:"unión",literal:"literal",promise:"promesa",void:"vacío",never:"nunca",unknown:"desconocido",any:"cualquiera"};function U(w){return $[w]??null}function D(w){return I[w]??w}let b=(w)=>{let O=typeof w;switch(O){case"number":return Number.isNaN(w)?"NaN":"number";case"object":{if(Array.isArray(w))return"array";if(w===null)return"null";if(Object.getPrototypeOf(w)!==Object.prototype)return w.constructor.name;return"object"}}return O},A={regex:"entrada",email:"dirección de correo electrónico",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:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duración ISO",ipv4:"dirección IPv4",ipv6:"dirección IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"};return(w)=>{switch(w.code){case"invalid_type":return`Entrada inválida: se esperaba ${D(w.expected)}, recibido ${D(b(w.input))}`;case"invalid_value":if(w.values.length===1)return`Entrada inválida: se esperaba ${k(w.values[0])}`;return`Opción inválida: se esperaba una de ${M(w.values,"|")}`;case"too_big":{let O=w.inclusive?"<=":"<",N=U(w.origin),X=D(w.origin);if(N)return`Demasiado grande: se esperaba que ${X??"valor"} tuviera ${O}${w.maximum.toString()} ${N.unit??"elementos"}`;return`Demasiado grande: se esperaba que ${X??"valor"} fuera ${O}${w.maximum.toString()}`}case"too_small":{let O=w.inclusive?">=":">",N=U(w.origin),X=D(w.origin);if(N)return`Demasiado pequeño: se esperaba que ${X} tuviera ${O}${w.minimum.toString()} ${N.unit}`;return`Demasiado pequeño: se esperaba que ${X} fuera ${O}${w.minimum.toString()}`}case"invalid_format":{let O=w;if(O.format==="starts_with")return`Cadena inválida: debe comenzar con "${O.prefix}"`;if(O.format==="ends_with")return`Cadena inválida: debe terminar en "${O.suffix}"`;if(O.format==="includes")return`Cadena inválida: debe incluir "${O.includes}"`;if(O.format==="regex")return`Cadena inválida: debe coincidir con el patrón ${O.pattern}`;return`Inválido ${A[O.format]??w.format}`}case"not_multiple_of":return`Número inválido: debe ser múltiplo de ${w.divisor}`;case"unrecognized_keys":return`Llave${w.keys.length>1?"s":""} desconocida${w.keys.length>1?"s":""}: ${M(w.keys,", ")}`;case"invalid_key":return`Llave inválida en ${D(w.origin)}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido en ${D(w.origin)}`;default:return"Entrada inválida"}}};function JX(){return{localeError:Pz()}}var Rz=()=>{let $={string:{unit:"کاراکتر",verb:"داشته باشد"},file:{unit:"بایت",verb:"داشته باشد"},array:{unit:"آیتم",verb:"داشته باشد"},set:{unit:"آیتم",verb:"داشته باشد"}};function I(b){return $[b]??null}let U=(b)=>{let A=typeof b;switch(A){case"number":return Number.isNaN(b)?"NaN":"عدد";case"object":{if(Array.isArray(b))return"آرایه";if(b===null)return"null";if(Object.getPrototypeOf(b)!==Object.prototype&&b.constructor)return b.constructor.name}}return A},D={regex:"ورودی",email:"آدرس ایمیل",url:"URL",emoji:"ایموجی",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاریخ و زمان ایزو",date:"تاریخ ایزو",time:"زمان ایزو",duration:"مدت زمان ایزو",ipv4:"IPv4 آدرس",ipv6:"IPv6 آدرس",cidrv4:"IPv4 دامنه",cidrv6:"IPv6 دامنه",base64:"base64-encoded رشته",base64url:"base64url-encoded رشته",json_string:"JSON رشته",e164:"E.164 عدد",jwt:"JWT",template_literal:"ورودی"};return(b)=>{switch(b.code){case"invalid_type":return`ورودی نامعتبر: میبایست ${b.expected} میبود، ${U(b.input)} دریافت شد`;case"invalid_value":if(b.values.length===1)return`ورودی نامعتبر: میبایست ${k(b.values[0])} میبود`;return`گزینه نامعتبر: میبایست یکی از ${M(b.values,"|")} میبود`;case"too_big":{let A=b.inclusive?"<=":"<",w=I(b.origin);if(w)return`خیلی بزرگ: ${b.origin??"مقدار"} باید ${A}${b.maximum.toString()} ${w.unit??"عنصر"} باشد`;return`خیلی بزرگ: ${b.origin??"مقدار"} باید ${A}${b.maximum.toString()} باشد`}case"too_small":{let A=b.inclusive?">=":">",w=I(b.origin);if(w)return`خیلی کوچک: ${b.origin} باید ${A}${b.minimum.toString()} ${w.unit} باشد`;return`خیلی کوچک: ${b.origin} باید ${A}${b.minimum.toString()} باشد`}case"invalid_format":{let A=b;if(A.format==="starts_with")return`رشته نامعتبر: باید با "${A.prefix}" شروع شود`;if(A.format==="ends_with")return`رشته نامعتبر: باید با "${A.suffix}" تمام شود`;if(A.format==="includes")return`رشته نامعتبر: باید شامل "${A.includes}" باشد`;if(A.format==="regex")return`رشته نامعتبر: باید با الگوی ${A.pattern} مطابقت داشته باشد`;return`${D[A.format]??b.format} نامعتبر`}case"not_multiple_of":return`عدد نامعتبر: باید مضرب ${b.divisor} باشد`;case"unrecognized_keys":return`کلید${b.keys.length>1?"های":""} ناشناس: ${M(b.keys,", ")}`;case"invalid_key":return`کلید ناشناس در ${b.origin}`;case"invalid_union":return"ورودی نامعتبر";case"invalid_element":return`مقدار نامعتبر در ${b.origin}`;default:return"ورودی نامعتبر"}}};function HX(){return{localeError:Rz()}}var Tz=()=>{let $={string:{unit:"merkkiä",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"päivämäärän"}};function I(b){return $[b]??null}let U=(b)=>{let A=typeof b;switch(A){case"number":return Number.isNaN(b)?"NaN":"number";case"object":{if(Array.isArray(b))return"array";if(b===null)return"null";if(Object.getPrototypeOf(b)!==Object.prototype&&b.constructor)return b.constructor.name}}return A},D={regex:"säännöllinen lauseke",email:"sähköpostiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-päivämäärä",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"};return(b)=>{switch(b.code){case"invalid_type":return`Virheellinen tyyppi: odotettiin ${b.expected}, oli ${U(b.input)}`;case"invalid_value":if(b.values.length===1)return`Virheellinen syöte: täytyy olla ${k(b.values[0])}`;return`Virheellinen valinta: täytyy olla yksi seuraavista: ${M(b.values,"|")}`;case"too_big":{let A=b.inclusive?"<=":"<",w=I(b.origin);if(w)return`Liian suuri: ${w.subject} täytyy olla ${A}${b.maximum.toString()} ${w.unit}`.trim();return`Liian suuri: arvon täytyy olla ${A}${b.maximum.toString()}`}case"too_small":{let A=b.inclusive?">=":">",w=I(b.origin);if(w)return`Liian pieni: ${w.subject} täytyy olla ${A}${b.minimum.toString()} ${w.unit}`.trim();return`Liian pieni: arvon täytyy olla ${A}${b.minimum.toString()}`}case"invalid_format":{let A=b;if(A.format==="starts_with")return`Virheellinen syöte: täytyy alkaa "${A.prefix}"`;if(A.format==="ends_with")return`Virheellinen syöte: täytyy loppua "${A.suffix}"`;if(A.format==="includes")return`Virheellinen syöte: täytyy sisältää "${A.includes}"`;if(A.format==="regex")return`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${A.pattern}`;return`Virheellinen ${D[A.format]??b.format}`}case"not_multiple_of":return`Virheellinen luku: täytyy olla luvun ${b.divisor} monikerta`;case"unrecognized_keys":return`${b.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${M(b.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen syöte"}}};function MX(){return{localeError:Tz()}}var _z=()=>{let $={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function I(b){return $[b]??null}let U=(b)=>{let A=typeof b;switch(A){case"number":return Number.isNaN(b)?"NaN":"nombre";case"object":{if(Array.isArray(b))return"tableau";if(b===null)return"null";if(Object.getPrototypeOf(b)!==Object.prototype&&b.constructor)return b.constructor.name}}return A},D={regex:"entrée",email:"adresse e-mail",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:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"};return(b)=>{switch(b.code){case"invalid_type":return`Entrée invalide : ${b.expected} attendu, ${U(b.input)} reçu`;case"invalid_value":if(b.values.length===1)return`Entrée invalide : ${k(b.values[0])} attendu`;return`Option invalide : une valeur parmi ${M(b.values,"|")} attendue`;case"too_big":{let A=b.inclusive?"<=":"<",w=I(b.origin);if(w)return`Trop grand : ${b.origin??"valeur"} doit ${w.verb} ${A}${b.maximum.toString()} ${w.unit??"élément(s)"}`;return`Trop grand : ${b.origin??"valeur"} doit être ${A}${b.maximum.toString()}`}case"too_small":{let A=b.inclusive?">=":">",w=I(b.origin);if(w)return`Trop petit : ${b.origin} doit ${w.verb} ${A}${b.minimum.toString()} ${w.unit}`;return`Trop petit : ${b.origin} doit être ${A}${b.minimum.toString()}`}case"invalid_format":{let A=b;if(A.format==="starts_with")return`Chaîne invalide : doit commencer par "${A.prefix}"`;if(A.format==="ends_with")return`Chaîne invalide : doit se terminer par "${A.suffix}"`;if(A.format==="includes")return`Chaîne invalide : doit inclure "${A.includes}"`;if(A.format==="regex")return`Chaîne invalide : doit correspondre au modèle ${A.pattern}`;return`${D[A.format]??b.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${b.divisor}`;case"unrecognized_keys":return`Clé${b.keys.length>1?"s":""} non reconnue${b.keys.length>1?"s":""} : ${M(b.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${b.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${b.origin}`;default:return"Entrée invalide"}}};function VX(){return{localeError:_z()}}var Cz=()=>{let $={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function I(b){return $[b]??null}let U=(b)=>{let A=typeof b;switch(A){case"number":return Number.isNaN(b)?"NaN":"number";case"object":{if(Array.isArray(b))return"array";if(b===null)return"null";if(Object.getPrototypeOf(b)!==Object.prototype&&b.constructor)return b.constructor.name}}return A},D={regex:"entrée",email:"adresse courriel",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:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"};return(b)=>{switch(b.code){case"invalid_type":return`Entrée invalide : attendu ${b.expected}, reçu ${U(b.input)}`;case"invalid_value":if(b.values.length===1)return`Entrée invalide : attendu ${k(b.values[0])}`;return`Option invalide : attendu l'une des valeurs suivantes ${M(b.values,"|")}`;case"too_big":{let A=b.inclusive?"≤":"<",w=I(b.origin);if(w)return`Trop grand : attendu que ${b.origin??"la valeur"} ait ${A}${b.maximum.toString()} ${w.unit}`;return`Trop grand : attendu que ${b.origin??"la valeur"} soit ${A}${b.maximum.toString()}`}case"too_small":{let A=b.inclusive?"≥":">",w=I(b.origin);if(w)return`Trop petit : attendu que ${b.origin} ait ${A}${b.minimum.toString()} ${w.unit}`;return`Trop petit : attendu que ${b.origin} soit ${A}${b.minimum.toString()}`}case"invalid_format":{let A=b;if(A.format==="starts_with")return`Chaîne invalide : doit commencer par "${A.prefix}"`;if(A.format==="ends_with")return`Chaîne invalide : doit se terminer par "${A.suffix}"`;if(A.format==="includes")return`Chaîne invalide : doit inclure "${A.includes}"`;if(A.format==="regex")return`Chaîne invalide : doit correspondre au motif ${A.pattern}`;return`${D[A.format]??b.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${b.divisor}`;case"unrecognized_keys":return`Clé${b.keys.length>1?"s":""} non reconnue${b.keys.length>1?"s":""} : ${M(b.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${b.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${b.origin}`;default:return"Entrée invalide"}}};function KX(){return{localeError:Cz()}}var fz=()=>{let $={string:{label:"מחרוזת",gender:"f"},number:{label:"מספר",gender:"m"},boolean:{label:"ערך בוליאני",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"תאריך",gender:"m"},array:{label:"מערך",gender:"m"},object:{label:"אובייקט",gender:"m"},null:{label:"ערך ריק (null)",gender:"m"},undefined:{label:"ערך לא מוגדר (undefined)",gender:"m"},symbol:{label:"סימבול (Symbol)",gender:"m"},function:{label:"פונקציה",gender:"f"},map:{label:"מפה (Map)",gender:"f"},set:{label:"קבוצה (Set)",gender:"f"},file:{label:"קובץ",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"ערך לא ידוע",gender:"m"},value:{label:"ערך",gender:"m"}},I={string:{unit:"תווים",shortLabel:"קצר",longLabel:"ארוך"},file:{unit:"בייטים",shortLabel:"קטן",longLabel:"גדול"},array:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},set:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},number:{unit:"",shortLabel:"קטן",longLabel:"גדול"}},U=(X)=>X?$[X]:void 0,D=(X)=>{let G=U(X);if(G)return G.label;return X??$.unknown.label},b=(X)=>`ה${D(X)}`,A=(X)=>{return(U(X)?.gender??"m")==="f"?"צריכה להיות":"צריך להיות"},w=(X)=>{if(!X)return null;return I[X]??null},O=(X)=>{let G=typeof X;switch(G){case"number":return Number.isNaN(X)?"NaN":"number";case"object":{if(Array.isArray(X))return"array";if(X===null)return"null";if(Object.getPrototypeOf(X)!==Object.prototype&&X.constructor)return X.constructor.name;return"object"}default:return G}},N={regex:{label:"קלט",gender:"m"},email:{label:"כתובת אימייל",gender:"f"},url:{label:"כתובת רשת",gender:"f"},emoji:{label:"אימוג'י",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"תאריך וזמן ISO",gender:"m"},date:{label:"תאריך ISO",gender:"m"},time:{label:"זמן ISO",gender:"m"},duration:{label:"משך זמן ISO",gender:"m"},ipv4:{label:"כתובת IPv4",gender:"f"},ipv6:{label:"כתובת IPv6",gender:"f"},cidrv4:{label:"טווח IPv4",gender:"m"},cidrv6:{label:"טווח IPv6",gender:"m"},base64:{label:"מחרוזת בבסיס 64",gender:"f"},base64url:{label:"מחרוזת בבסיס 64 לכתובות רשת",gender:"f"},json_string:{label:"מחרוזת JSON",gender:"f"},e164:{label:"מספר E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"קלט",gender:"m"},includes:{label:"קלט",gender:"m"},lowercase:{label:"קלט",gender:"m"},starts_with:{label:"קלט",gender:"m"},uppercase:{label:"קלט",gender:"m"}};return(X)=>{switch(X.code){case"invalid_type":{let G=X.expected,Q=D(G),Y=O(X.input),v=$[Y]?.label??Y;return`קלט לא תקין: צריך להיות ${Q}, התקבל ${v}`}case"invalid_value":{if(X.values.length===1)return`ערך לא תקין: הערך חייב להיות ${k(X.values[0])}`;let G=X.values.map((v)=>k(v));if(X.values.length===2)return`ערך לא תקין: האפשרויות המתאימות הן ${G[0]} או ${G[1]}`;let Q=G[G.length-1];return`ערך לא תקין: האפשרויות המתאימות הן ${G.slice(0,-1).join(", ")} או ${Q}`}case"too_big":{let G=w(X.origin),Q=b(X.origin??"value");if(X.origin==="string")return`${G?.longLabel??"ארוך"} מדי: ${Q} צריכה להכיל ${X.maximum.toString()} ${G?.unit??""} ${X.inclusive?"או פחות":"לכל היותר"}`.trim();if(X.origin==="number"){let L=X.inclusive?`קטן או שווה ל-${X.maximum}`:`קטן מ-${X.maximum}`;return`גדול מדי: ${Q} צריך להיות ${L}`}if(X.origin==="array"||X.origin==="set"){let L=X.origin==="set"?"צריכה":"צריך",H=X.inclusive?`${X.maximum} ${G?.unit??""} או פחות`:`פחות מ-${X.maximum} ${G?.unit??""}`;return`גדול מדי: ${Q} ${L} להכיל ${H}`.trim()}let Y=X.inclusive?"<=":"<",v=A(X.origin??"value");if(G?.unit)return`${G.longLabel} מדי: ${Q} ${v} ${Y}${X.maximum.toString()} ${G.unit}`;return`${G?.longLabel??"גדול"} מדי: ${Q} ${v} ${Y}${X.maximum.toString()}`}case"too_small":{let G=w(X.origin),Q=b(X.origin??"value");if(X.origin==="string")return`${G?.shortLabel??"קצר"} מדי: ${Q} צריכה להכיל ${X.minimum.toString()} ${G?.unit??""} ${X.inclusive?"או יותר":"לפחות"}`.trim();if(X.origin==="number"){let L=X.inclusive?`גדול או שווה ל-${X.minimum}`:`גדול מ-${X.minimum}`;return`קטן מדי: ${Q} צריך להיות ${L}`}if(X.origin==="array"||X.origin==="set"){let L=X.origin==="set"?"צריכה":"צריך";if(X.minimum===1&&X.inclusive){let z=X.origin==="set"?"לפחות פריט אחד":"לפחות פריט אחד";return`קטן מדי: ${Q} ${L} להכיל ${z}`}let H=X.inclusive?`${X.minimum} ${G?.unit??""} או יותר`:`יותר מ-${X.minimum} ${G?.unit??""}`;return`קטן מדי: ${Q} ${L} להכיל ${H}`.trim()}let Y=X.inclusive?">=":">",v=A(X.origin??"value");if(G?.unit)return`${G.shortLabel} מדי: ${Q} ${v} ${Y}${X.minimum.toString()} ${G.unit}`;return`${G?.shortLabel??"קטן"} מדי: ${Q} ${v} ${Y}${X.minimum.toString()}`}case"invalid_format":{let G=X;if(G.format==="starts_with")return`המחרוזת חייבת להתחיל ב "${G.prefix}"`;if(G.format==="ends_with")return`המחרוזת חייבת להסתיים ב "${G.suffix}"`;if(G.format==="includes")return`המחרוזת חייבת לכלול "${G.includes}"`;if(G.format==="regex")return`המחרוזת חייבת להתאים לתבנית ${G.pattern}`;let Q=N[G.format],Y=Q?.label??G.format,L=(Q?.gender??"m")==="f"?"תקינה":"תקין";return`${Y} לא ${L}`}case"not_multiple_of":return`מספר לא תקין: חייב להיות מכפלה של ${X.divisor}`;case"unrecognized_keys":return`מפתח${X.keys.length>1?"ות":""} לא מזוה${X.keys.length>1?"ים":"ה"}: ${M(X.keys,", ")}`;case"invalid_key":return"שדה לא תקין באובייקט";case"invalid_union":return"קלט לא תקין";case"invalid_element":return`ערך לא תקין ב${b(X.origin??"array")}`;default:return"קלט לא תקין"}}};function zX(){return{localeError:fz()}}var Zz=()=>{let $={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function I(b){return $[b]??null}let U=(b)=>{let A=typeof b;switch(A){case"number":return Number.isNaN(b)?"NaN":"szám";case"object":{if(Array.isArray(b))return"tömb";if(b===null)return"null";if(Object.getPrototypeOf(b)!==Object.prototype&&b.constructor)return b.constructor.name}}return A},D={regex:"bemenet",email:"email cím",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 időbélyeg",date:"ISO dátum",time:"ISO idő",duration:"ISO időintervallum",ipv4:"IPv4 cím",ipv6:"IPv6 cím",cidrv4:"IPv4 tartomány",cidrv6:"IPv6 tartomány",base64:"base64-kódolt string",base64url:"base64url-kódolt string",json_string:"JSON string",e164:"E.164 szám",jwt:"JWT",template_literal:"bemenet"};return(b)=>{switch(b.code){case"invalid_type":return`Érvénytelen bemenet: a várt érték ${b.expected}, a kapott érték ${U(b.input)}`;case"invalid_value":if(b.values.length===1)return`Érvénytelen bemenet: a várt érték ${k(b.values[0])}`;return`Érvénytelen opció: valamelyik érték várt ${M(b.values,"|")}`;case"too_big":{let A=b.inclusive?"<=":"<",w=I(b.origin);if(w)return`Túl nagy: ${b.origin??"érték"} mérete túl nagy ${A}${b.maximum.toString()} ${w.unit??"elem"}`;return`Túl nagy: a bemeneti érték ${b.origin??"érték"} túl nagy: ${A}${b.maximum.toString()}`}case"too_small":{let A=b.inclusive?">=":">",w=I(b.origin);if(w)return`Túl kicsi: a bemeneti érték ${b.origin} mérete túl kicsi ${A}${b.minimum.toString()} ${w.unit}`;return`Túl kicsi: a bemeneti érték ${b.origin} túl kicsi ${A}${b.minimum.toString()}`}case"invalid_format":{let A=b;if(A.format==="starts_with")return`Érvénytelen string: "${A.prefix}" értékkel kell kezdődnie`;if(A.format==="ends_with")return`Érvénytelen string: "${A.suffix}" értékkel kell végződnie`;if(A.format==="includes")return`Érvénytelen string: "${A.includes}" értéket kell tartalmaznia`;if(A.format==="regex")return`Érvénytelen string: ${A.pattern} mintának kell megfelelnie`;return`Érvénytelen ${D[A.format]??b.format}`}case"not_multiple_of":return`Érvénytelen szám: ${b.divisor} többszörösének kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${b.keys.length>1?"s":""}: ${M(b.keys,", ")}`;case"invalid_key":return`Érvénytelen kulcs ${b.origin}`;case"invalid_union":return"Érvénytelen bemenet";case"invalid_element":return`Érvénytelen érték: ${b.origin}`;default:return"Érvénytelen bemenet"}}};function FX(){return{localeError:Zz()}}var gz=()=>{let $={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function I(b){return $[b]??null}let U=(b)=>{let A=typeof b;switch(A){case"number":return Number.isNaN(b)?"NaN":"number";case"object":{if(Array.isArray(b))return"array";if(b===null)return"null";if(Object.getPrototypeOf(b)!==Object.prototype&&b.constructor)return b.constructor.name}}return A},D={regex:"input",email:"alamat email",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:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"};return(b)=>{switch(b.code){case"invalid_type":return`Input tidak valid: diharapkan ${b.expected}, diterima ${U(b.input)}`;case"invalid_value":if(b.values.length===1)return`Input tidak valid: diharapkan ${k(b.values[0])}`;return`Pilihan tidak valid: diharapkan salah satu dari ${M(b.values,"|")}`;case"too_big":{let A=b.inclusive?"<=":"<",w=I(b.origin);if(w)return`Terlalu besar: diharapkan ${b.origin??"value"} memiliki ${A}${b.maximum.toString()} ${w.unit??"elemen"}`;return`Terlalu besar: diharapkan ${b.origin??"value"} menjadi ${A}${b.maximum.toString()}`}case"too_small":{let A=b.inclusive?">=":">",w=I(b.origin);if(w)return`Terlalu kecil: diharapkan ${b.origin} memiliki ${A}${b.minimum.toString()} ${w.unit}`;return`Terlalu kecil: diharapkan ${b.origin} menjadi ${A}${b.minimum.toString()}`}case"invalid_format":{let A=b;if(A.format==="starts_with")return`String tidak valid: harus dimulai dengan "${A.prefix}"`;if(A.format==="ends_with")return`String tidak valid: harus berakhir dengan "${A.suffix}"`;if(A.format==="includes")return`String tidak valid: harus menyertakan "${A.includes}"`;if(A.format==="regex")return`String tidak valid: harus sesuai pola ${A.pattern}`;return`${D[A.format]??b.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${b.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${b.keys.length>1?"s":""}: ${M(b.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${b.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${b.origin}`;default:return"Input tidak valid"}}};function kX(){return{localeError:gz()}}var yz=($)=>{let I=typeof $;switch(I){case"number":return Number.isNaN($)?"NaN":"númer";case"object":{if(Array.isArray($))return"fylki";if($===null)return"null";if(Object.getPrototypeOf($)!==Object.prototype&&$.constructor)return $.constructor.name}}return I},xz=()=>{let $={string:{unit:"stafi",verb:"að hafa"},file:{unit:"bæti",verb:"að hafa"},array:{unit:"hluti",verb:"að hafa"},set:{unit:"hluti",verb:"að hafa"}};function I(D){return $[D]??null}let U={regex:"gildi",email:"netfang",url:"vefslóð",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og tími",date:"ISO dagsetning",time:"ISO tími",duration:"ISO tímalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 tölugildi",jwt:"JWT",template_literal:"gildi"};return(D)=>{switch(D.code){case"invalid_type":return`Rangt gildi: Þú slóst inn ${yz(D.input)} þar sem á að vera ${D.expected}`;case"invalid_value":if(D.values.length===1)return`Rangt gildi: gert ráð fyrir ${k(D.values[0])}`;return`Ógilt val: má vera eitt af eftirfarandi ${M(D.values,"|")}`;case"too_big":{let b=D.inclusive?"<=":"<",A=I(D.origin);if(A)return`Of stórt: gert er ráð fyrir að ${D.origin??"gildi"} hafi ${b}${D.maximum.toString()} ${A.unit??"hluti"}`;return`Of stórt: gert er ráð fyrir að ${D.origin??"gildi"} sé ${b}${D.maximum.toString()}`}case"too_small":{let b=D.inclusive?">=":">",A=I(D.origin);if(A)return`Of lítið: gert er ráð fyrir að ${D.origin} hafi ${b}${D.minimum.toString()} ${A.unit}`;return`Of lítið: gert er ráð fyrir að ${D.origin} sé ${b}${D.minimum.toString()}`}case"invalid_format":{let b=D;if(b.format==="starts_with")return`Ógildur strengur: verður að byrja á "${b.prefix}"`;if(b.format==="ends_with")return`Ógildur strengur: verður að enda á "${b.suffix}"`;if(b.format==="includes")return`Ógildur strengur: verður að innihalda "${b.includes}"`;if(b.format==="regex")return`Ógildur strengur: verður að fylgja mynstri ${b.pattern}`;return`Rangt ${U[b.format]??D.format}`}case"not_multiple_of":return`Röng tala: verður að vera margfeldi af ${D.divisor}`;case"unrecognized_keys":return`Óþekkt ${D.keys.length>1?"ir lyklar":"ur lykill"}: ${M(D.keys,", ")}`;case"invalid_key":return`Rangur lykill í ${D.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi í ${D.origin}`;default:return"Rangt gildi"}}};function qX(){return{localeError:xz()}}var lz=()=>{let $={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function I(b){return $[b]??null}let U=(b)=>{let A=typeof b;switch(A){case"number":return Number.isNaN(b)?"NaN":"numero";case"object":{if(Array.isArray(b))return"vettore";if(b===null)return"null";if(Object.getPrototypeOf(b)!==Object.prototype&&b.constructor)return b.constructor.name}}return A},D={regex:"input",email:"indirizzo email",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:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"};return(b)=>{switch(b.code){case"invalid_type":return`Input non valido: atteso ${b.expected}, ricevuto ${U(b.input)}`;case"invalid_value":if(b.values.length===1)return`Input non valido: atteso ${k(b.values[0])}`;return`Opzione non valida: atteso uno tra ${M(b.values,"|")}`;case"too_big":{let A=b.inclusive?"<=":"<",w=I(b.origin);if(w)return`Troppo grande: ${b.origin??"valore"} deve avere ${A}${b.maximum.toString()} ${w.unit??"elementi"}`;return`Troppo grande: ${b.origin??"valore"} deve essere ${A}${b.maximum.toString()}`}case"too_small":{let A=b.inclusive?">=":">",w=I(b.origin);if(w)return`Troppo piccolo: ${b.origin} deve avere ${A}${b.minimum.toString()} ${w.unit}`;return`Troppo piccolo: ${b.origin} deve essere ${A}${b.minimum.toString()}`}case"invalid_format":{let A=b;if(A.format==="starts_with")return`Stringa non valida: deve iniziare con "${A.prefix}"`;if(A.format==="ends_with")return`Stringa non valida: deve terminare con "${A.suffix}"`;if(A.format==="includes")return`Stringa non valida: deve includere "${A.includes}"`;if(A.format==="regex")return`Stringa non valida: deve corrispondere al pattern ${A.pattern}`;return`Invalid ${D[A.format]??b.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${b.divisor}`;case"unrecognized_keys":return`Chiav${b.keys.length>1?"i":"e"} non riconosciut${b.keys.length>1?"e":"a"}: ${M(b.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${b.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${b.origin}`;default:return"Input non valido"}}};function EX(){return{localeError:lz()}}var hz=()=>{let $={string:{unit:"文字",verb:"である"},file:{unit:"バイト",verb:"である"},array:{unit:"要素",verb:"である"},set:{unit:"要素",verb:"である"}};function I(b){return $[b]??null}let U=(b)=>{let A=typeof b;switch(A){case"number":return Number.isNaN(b)?"NaN":"数値";case"object":{if(Array.isArray(b))return"配列";if(b===null)return"null";if(Object.getPrototypeOf(b)!==Object.prototype&&b.constructor)return b.constructor.name}}return A},D={regex:"入力値",email:"メールアドレス",url:"URL",emoji:"絵文字",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日時",date:"ISO日付",time:"ISO時刻",duration:"ISO期間",ipv4:"IPv4アドレス",ipv6:"IPv6アドレス",cidrv4:"IPv4範囲",cidrv6:"IPv6範囲",base64:"base64エンコード文字列",base64url:"base64urlエンコード文字列",json_string:"JSON文字列",e164:"E.164番号",jwt:"JWT",template_literal:"入力値"};return(b)=>{switch(b.code){case"invalid_type":return`無効な入力: ${b.expected}が期待されましたが、${U(b.input)}が入力されました`;case"invalid_value":if(b.values.length===1)return`無効な入力: ${k(b.values[0])}が期待されました`;return`無効な選択: ${M(b.values,"、")}のいずれかである必要があります`;case"too_big":{let A=b.inclusive?"以下である":"より小さい",w=I(b.origin);if(w)return`大きすぎる値: ${b.origin??"値"}は${b.maximum.toString()}${w.unit??"要素"}${A}必要があります`;return`大きすぎる値: ${b.origin??"値"}は${b.maximum.toString()}${A}必要があります`}case"too_small":{let A=b.inclusive?"以上である":"より大きい",w=I(b.origin);if(w)return`小さすぎる値: ${b.origin}は${b.minimum.toString()}${w.unit}${A}必要があります`;return`小さすぎる値: ${b.origin}は${b.minimum.toString()}${A}必要があります`}case"invalid_format":{let A=b;if(A.format==="starts_with")return`無効な文字列: "${A.prefix}"で始まる必要があります`;if(A.format==="ends_with")return`無効な文字列: "${A.suffix}"で終わる必要があります`;if(A.format==="includes")return`無効な文字列: "${A.includes}"を含む必要があります`;if(A.format==="regex")return`無効な文字列: パターン${A.pattern}に一致する必要があります`;return`無効な${D[A.format]??b.format}`}case"not_multiple_of":return`無効な数値: ${b.divisor}の倍数である必要があります`;case"unrecognized_keys":return`認識されていないキー${b.keys.length>1?"群":""}: ${M(b.keys,"、")}`;case"invalid_key":return`${b.origin}内の無効なキー`;case"invalid_union":return"無効な入力";case"invalid_element":return`${b.origin}内の無効な値`;default:return"無効な入力"}}};function SX(){return{localeError:hz()}}var uz=($)=>{let I=typeof $;switch(I){case"number":return Number.isNaN($)?"NaN":"რიცხვი";case"object":{if(Array.isArray($))return"მასივი";if($===null)return"null";if(Object.getPrototypeOf($)!==Object.prototype&&$.constructor)return $.constructor.name}}return{string:"სტრინგი",boolean:"ბულეანი",undefined:"undefined",bigint:"bigint",symbol:"symbol",function:"ფუნქცია"}[I]??I},iz=()=>{let $={string:{unit:"სიმბოლო",verb:"უნდა შეიცავდეს"},file:{unit:"ბაიტი",verb:"უნდა შეიცავდეს"},array:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"},set:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"}};function I(D){return $[D]??null}let U={regex:"შეყვანა",email:"ელ-ფოსტის მისამართი",url:"URL",emoji:"ემოჯი",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"თარიღი-დრო",date:"თარიღი",time:"დრო",duration:"ხანგრძლივობა",ipv4:"IPv4 მისამართი",ipv6:"IPv6 მისამართი",cidrv4:"IPv4 დიაპაზონი",cidrv6:"IPv6 დიაპაზონი",base64:"base64-კოდირებული სტრინგი",base64url:"base64url-კოდირებული სტრინგი",json_string:"JSON სტრინგი",e164:"E.164 ნომერი",jwt:"JWT",template_literal:"შეყვანა"};return(D)=>{switch(D.code){case"invalid_type":return`არასწორი შეყვანა: მოსალოდნელი ${D.expected}, მიღებული ${uz(D.input)}`;case"invalid_value":if(D.values.length===1)return`არასწორი შეყვანა: მოსალოდნელი ${k(D.values[0])}`;return`არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${M(D.values,"|")}-დან`;case"too_big":{let b=D.inclusive?"<=":"<",A=I(D.origin);if(A)return`ზედმეტად დიდი: მოსალოდნელი ${D.origin??"მნიშვნელობა"} ${A.verb} ${b}${D.maximum.toString()} ${A.unit}`;return`ზედმეტად დიდი: მოსალოდნელი ${D.origin??"მნიშვნელობა"} იყოს ${b}${D.maximum.toString()}`}case"too_small":{let b=D.inclusive?">=":">",A=I(D.origin);if(A)return`ზედმეტად პატარა: მოსალოდნელი ${D.origin} ${A.verb} ${b}${D.minimum.toString()} ${A.unit}`;return`ზედმეტად პატარა: მოსალოდნელი ${D.origin} იყოს ${b}${D.minimum.toString()}`}case"invalid_format":{let b=D;if(b.format==="starts_with")return`არასწორი სტრინგი: უნდა იწყებოდეს "${b.prefix}"-ით`;if(b.format==="ends_with")return`არასწორი სტრინგი: უნდა მთავრდებოდეს "${b.suffix}"-ით`;if(b.format==="includes")return`არასწორი სტრინგი: უნდა შეიცავდეს "${b.includes}"-ს`;if(b.format==="regex")return`არასწორი სტრინგი: უნდა შეესაბამებოდეს შაბლონს ${b.pattern}`;return`არასწორი ${U[b.format]??D.format}`}case"not_multiple_of":return`არასწორი რიცხვი: უნდა იყოს ${D.divisor}-ის ჯერადი`;case"unrecognized_keys":return`უცნობი გასაღებ${D.keys.length>1?"ები":"ი"}: ${M(D.keys,", ")}`;case"invalid_key":return`არასწორი გასაღები ${D.origin}-ში`;case"invalid_union":return"არასწორი შეყვანა";case"invalid_element":return`არასწორი მნიშვნელობა ${D.origin}-ში`;default:return"არასწორი შეყვანა"}}};function jX(){return{localeError:iz()}}var nz=()=>{let $={string:{unit:"តួអក្សរ",verb:"គួរមាន"},file:{unit:"បៃ",verb:"គួរមាន"},array:{unit:"ធាតុ",verb:"គួរមាន"},set:{unit:"ធាតុ",verb:"គួរមាន"}};function I(b){return $[b]??null}let U=(b)=>{let A=typeof b;switch(A){case"number":return Number.isNaN(b)?"មិនមែនជាលេខ (NaN)":"លេខ";case"object":{if(Array.isArray(b))return"អារេ (Array)";if(b===null)return"គ្មានតម្លៃ (null)";if(Object.getPrototypeOf(b)!==Object.prototype&&b.constructor)return b.constructor.name}}return A},D={regex:"ទិន្នន័យបញ្ចូល",email:"អាសយដ្ឋានអ៊ីមែល",url:"URL",emoji:"សញ្ញាអារម្មណ៍",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"កាលបរិច្ឆេទ និងម៉ោង ISO",date:"កាលបរិច្ឆេទ ISO",time:"ម៉ោង ISO",duration:"រយៈពេល ISO",ipv4:"អាសយដ្ឋាន IPv4",ipv6:"អាសយដ្ឋាន IPv6",cidrv4:"ដែនអាសយដ្ឋាន IPv4",cidrv6:"ដែនអាសយដ្ឋាន IPv6",base64:"ខ្សែអក្សរអ៊ិកូដ base64",base64url:"ខ្សែអក្សរអ៊ិកូដ base64url",json_string:"ខ្សែអក្សរ JSON",e164:"លេខ E.164",jwt:"JWT",template_literal:"ទិន្នន័យបញ្ចូល"};return(b)=>{switch(b.code){case"invalid_type":return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${b.expected} ប៉ុន្តែទទួលបាន ${U(b.input)}`;case"invalid_value":if(b.values.length===1)return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${k(b.values[0])}`;return`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${M(b.values,"|")}`;case"too_big":{let A=b.inclusive?"<=":"<",w=I(b.origin);if(w)return`ធំពេក៖ ត្រូវការ ${b.origin??"តម្លៃ"} ${A} ${b.maximum.toString()} ${w.unit??"ធាតុ"}`;return`ធំពេក៖ ត្រូវការ ${b.origin??"តម្លៃ"} ${A} ${b.maximum.toString()}`}case"too_small":{let A=b.inclusive?">=":">",w=I(b.origin);if(w)return`តូចពេក៖ ត្រូវការ ${b.origin} ${A} ${b.minimum.toString()} ${w.unit}`;return`តូចពេក៖ ត្រូវការ ${b.origin} ${A} ${b.minimum.toString()}`}case"invalid_format":{let A=b;if(A.format==="starts_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${A.prefix}"`;if(A.format==="ends_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${A.suffix}"`;if(A.format==="includes")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${A.includes}"`;if(A.format==="regex")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${A.pattern}`;return`មិនត្រឹមត្រូវ៖ ${D[A.format]??b.format}`}case"not_multiple_of":return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${b.divisor}`;case"unrecognized_keys":return`រកឃើញសោមិនស្គាល់៖ ${M(b.keys,", ")}`;case"invalid_key":return`សោមិនត្រឹមត្រូវនៅក្នុង ${b.origin}`;case"invalid_union":return"ទិន្នន័យមិនត្រឹមត្រូវ";case"invalid_element":return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${b.origin}`;default:return"ទិន្នន័យមិនត្រឹមត្រូវ"}}};function dU(){return{localeError:nz()}}function PX(){return dU()}var rz=()=>{let $={string:{unit:"문자",verb:"to have"},file:{unit:"바이트",verb:"to have"},array:{unit:"개",verb:"to have"},set:{unit:"개",verb:"to have"}};function I(b){return $[b]??null}let U=(b)=>{let A=typeof b;switch(A){case"number":return Number.isNaN(b)?"NaN":"number";case"object":{if(Array.isArray(b))return"array";if(b===null)return"null";if(Object.getPrototypeOf(b)!==Object.prototype&&b.constructor)return b.constructor.name}}return A},D={regex:"입력",email:"이메일 주소",url:"URL",emoji:"이모지",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 날짜시간",date:"ISO 날짜",time:"ISO 시간",duration:"ISO 기간",ipv4:"IPv4 주소",ipv6:"IPv6 주소",cidrv4:"IPv4 범위",cidrv6:"IPv6 범위",base64:"base64 인코딩 문자열",base64url:"base64url 인코딩 문자열",json_string:"JSON 문자열",e164:"E.164 번호",jwt:"JWT",template_literal:"입력"};return(b)=>{switch(b.code){case"invalid_type":return`잘못된 입력: 예상 타입은 ${b.expected}, 받은 타입은 ${U(b.input)}입니다`;case"invalid_value":if(b.values.length===1)return`잘못된 입력: 값은 ${k(b.values[0])} 이어야 합니다`;return`잘못된 옵션: ${M(b.values,"또는 ")} 중 하나여야 합니다`;case"too_big":{let A=b.inclusive?"이하":"미만",w=A==="미만"?"이어야 합니다":"여야 합니다",O=I(b.origin),N=O?.unit??"요소";if(O)return`${b.origin??"값"}이 너무 큽니다: ${b.maximum.toString()}${N} ${A}${w}`;return`${b.origin??"값"}이 너무 큽니다: ${b.maximum.toString()} ${A}${w}`}case"too_small":{let A=b.inclusive?"이상":"초과",w=A==="이상"?"이어야 합니다":"여야 합니다",O=I(b.origin),N=O?.unit??"요소";if(O)return`${b.origin??"값"}이 너무 작습니다: ${b.minimum.toString()}${N} ${A}${w}`;return`${b.origin??"값"}이 너무 작습니다: ${b.minimum.toString()} ${A}${w}`}case"invalid_format":{let A=b;if(A.format==="starts_with")return`잘못된 문자열: "${A.prefix}"(으)로 시작해야 합니다`;if(A.format==="ends_with")return`잘못된 문자열: "${A.suffix}"(으)로 끝나야 합니다`;if(A.format==="includes")return`잘못된 문자열: "${A.includes}"을(를) 포함해야 합니다`;if(A.format==="regex")return`잘못된 문자열: 정규식 ${A.pattern} 패턴과 일치해야 합니다`;return`잘못된 ${D[A.format]??b.format}`}case"not_multiple_of":return`잘못된 숫자: ${b.divisor}의 배수여야 합니다`;case"unrecognized_keys":return`인식할 수 없는 키: ${M(b.keys,", ")}`;case"invalid_key":return`잘못된 키: ${b.origin}`;case"invalid_union":return"잘못된 입력";case"invalid_element":return`잘못된 값: ${b.origin}`;default:return"잘못된 입력"}}};function RX(){return{localeError:rz()}}var cz=($)=>{return tU(typeof $,$)},tU=($,I=void 0)=>{switch($){case"number":return Number.isNaN(I)?"NaN":"skaičius";case"bigint":return"sveikasis skaičius";case"string":return"eilutė";case"boolean":return"loginė reikšmė";case"undefined":case"void":return"neapibrėžta reikšmė";case"function":return"funkcija";case"symbol":return"simbolis";case"object":{if(I===void 0)return"nežinomas objektas";if(I===null)return"nulinė reikšmė";if(Array.isArray(I))return"masyvas";if(Object.getPrototypeOf(I)!==Object.prototype&&I.constructor)return I.constructor.name;return"objektas"}case"null":return"nulinė reikšmė"}return $},pU=($)=>{return $.charAt(0).toUpperCase()+$.slice(1)};function yv($){let I=Math.abs($),U=I%10,D=I%100;if(D>=11&&D<=19||U===0)return"many";if(U===1)return"one";return"few"}var mz=()=>{let $={string:{unit:{one:"simbolis",few:"simboliai",many:"simbolių"},verb:{smaller:{inclusive:"turi būti ne ilgesnė kaip",notInclusive:"turi būti trumpesnė kaip"},bigger:{inclusive:"turi būti ne trumpesnė kaip",notInclusive:"turi būti ilgesnė kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"baitų"},verb:{smaller:{inclusive:"turi būti ne didesnis kaip",notInclusive:"turi būti mažesnis kaip"},bigger:{inclusive:"turi būti ne mažesnis kaip",notInclusive:"turi būti didesnis kaip"}}},array:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}},set:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}}};function I(D,b,A,w){let O=$[D]??null;if(O===null)return O;return{unit:O.unit[b],verb:O.verb[w][A?"inclusive":"notInclusive"]}}let U={regex:"įvestis",email:"el. pašto adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukmė",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 užkoduota eilutė",base64url:"base64url užkoduota eilutė",json_string:"JSON eilutė",e164:"E.164 numeris",jwt:"JWT",template_literal:"įvestis"};return(D)=>{switch(D.code){case"invalid_type":return`Gautas tipas ${cz(D.input)}, o tikėtasi - ${tU(D.expected)}`;case"invalid_value":if(D.values.length===1)return`Privalo būti ${k(D.values[0])}`;return`Privalo būti vienas iš ${M(D.values,"|")} pasirinkimų`;case"too_big":{let b=tU(D.origin),A=I(D.origin,yv(Number(D.maximum)),D.inclusive??!1,"smaller");if(A?.verb)return`${pU(b??D.origin??"reikšmė")} ${A.verb} ${D.maximum.toString()} ${A.unit??"elementų"}`;let w=D.inclusive?"ne didesnis kaip":"mažesnis kaip";return`${pU(b??D.origin??"reikšmė")} turi būti ${w} ${D.maximum.toString()} ${A?.unit}`}case"too_small":{let b=tU(D.origin),A=I(D.origin,yv(Number(D.minimum)),D.inclusive??!1,"bigger");if(A?.verb)return`${pU(b??D.origin??"reikšmė")} ${A.verb} ${D.minimum.toString()} ${A.unit??"elementų"}`;let w=D.inclusive?"ne mažesnis kaip":"didesnis kaip";return`${pU(b??D.origin??"reikšmė")} turi būti ${w} ${D.minimum.toString()} ${A?.unit}`}case"invalid_format":{let b=D;if(b.format==="starts_with")return`Eilutė privalo prasidėti "${b.prefix}"`;if(b.format==="ends_with")return`Eilutė privalo pasibaigti "${b.suffix}"`;if(b.format==="includes")return`Eilutė privalo įtraukti "${b.includes}"`;if(b.format==="regex")return`Eilutė privalo atitikti ${b.pattern}`;return`Neteisingas ${U[b.format]??D.format}`}case"not_multiple_of":return`Skaičius privalo būti ${D.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpažint${D.keys.length>1?"i":"as"} rakt${D.keys.length>1?"ai":"as"}: ${M(D.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga įvestis";case"invalid_element":{let b=tU(D.origin);return`${pU(b??D.origin??"reikšmė")} turi klaidingą įvestį`}default:return"Klaidinga įvestis"}}};function TX(){return{localeError:mz()}}var oz=()=>{let $={string:{unit:"знаци",verb:"да имаат"},file:{unit:"бајти",verb:"да имаат"},array:{unit:"ставки",verb:"да имаат"},set:{unit:"ставки",verb:"да имаат"}};function I(b){return $[b]??null}let U=(b)=>{let A=typeof b;switch(A){case"number":return Number.isNaN(b)?"NaN":"број";case"object":{if(Array.isArray(b))return"низа";if(b===null)return"null";if(Object.getPrototypeOf(b)!==Object.prototype&&b.constructor)return b.constructor.name}}return A},D={regex:"внес",email:"адреса на е-пошта",url:"URL",emoji:"емоџи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO датум и време",date:"ISO датум",time:"ISO време",duration:"ISO времетраење",ipv4:"IPv4 адреса",ipv6:"IPv6 адреса",cidrv4:"IPv4 опсег",cidrv6:"IPv6 опсег",base64:"base64-енкодирана низа",base64url:"base64url-енкодирана низа",json_string:"JSON низа",e164:"E.164 број",jwt:"JWT",template_literal:"внес"};return(b)=>{switch(b.code){case"invalid_type":return`Грешен внес: се очекува ${b.expected}, примено ${U(b.input)}`;case"invalid_value":if(b.values.length===1)return`Invalid input: expected ${k(b.values[0])}`;return`Грешана опција: се очекува една ${M(b.values,"|")}`;case"too_big":{let A=b.inclusive?"<=":"<",w=I(b.origin);if(w)return`Премногу голем: се очекува ${b.origin??"вредноста"} да има ${A}${b.maximum.toString()} ${w.unit??"елементи"}`;return`Премногу голем: се очекува ${b.origin??"вредноста"} да биде ${A}${b.maximum.toString()}`}case"too_small":{let A=b.inclusive?">=":">",w=I(b.origin);if(w)return`Премногу мал: се очекува ${b.origin} да има ${A}${b.minimum.toString()} ${w.unit}`;return`Премногу мал: се очекува ${b.origin} да биде ${A}${b.minimum.toString()}`}case"invalid_format":{let A=b;if(A.format==="starts_with")return`Неважечка низа: мора да започнува со "${A.prefix}"`;if(A.format==="ends_with")return`Неважечка низа: мора да завршува со "${A.suffix}"`;if(A.format==="includes")return`Неважечка низа: мора да вклучува "${A.includes}"`;if(A.format==="regex")return`Неважечка низа: мора да одгоара на патернот ${A.pattern}`;return`Invalid ${D[A.format]??b.format}`}case"not_multiple_of":return`Грешен број: мора да биде делив со ${b.divisor}`;case"unrecognized_keys":return`${b.keys.length>1?"Непрепознаени клучеви":"Непрепознаен клуч"}: ${M(b.keys,", ")}`;case"invalid_key":return`Грешен клуч во ${b.origin}`;case"invalid_union":return"Грешен внес";case"invalid_element":return`Грешна вредност во ${b.origin}`;default:return"Грешен внес"}}};function _X(){return{localeError:oz()}}var dz=()=>{let $={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function I(b){return $[b]??null}let U=(b)=>{let A=typeof b;switch(A){case"number":return Number.isNaN(b)?"NaN":"nombor";case"object":{if(Array.isArray(b))return"array";if(b===null)return"null";if(Object.getPrototypeOf(b)!==Object.prototype&&b.constructor)return b.constructor.name}}return A},D={regex:"input",email:"alamat e-mel",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:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"};return(b)=>{switch(b.code){case"invalid_type":return`Input tidak sah: dijangka ${b.expected}, diterima ${U(b.input)}`;case"invalid_value":if(b.values.length===1)return`Input tidak sah: dijangka ${k(b.values[0])}`;return`Pilihan tidak sah: dijangka salah satu daripada ${M(b.values,"|")}`;case"too_big":{let A=b.inclusive?"<=":"<",w=I(b.origin);if(w)return`Terlalu besar: dijangka ${b.origin??"nilai"} ${w.verb} ${A}${b.maximum.toString()} ${w.unit??"elemen"}`;return`Terlalu besar: dijangka ${b.origin??"nilai"} adalah ${A}${b.maximum.toString()}`}case"too_small":{let A=b.inclusive?">=":">",w=I(b.origin);if(w)return`Terlalu kecil: dijangka ${b.origin} ${w.verb} ${A}${b.minimum.toString()} ${w.unit}`;return`Terlalu kecil: dijangka ${b.origin} adalah ${A}${b.minimum.toString()}`}case"invalid_format":{let A=b;if(A.format==="starts_with")return`String tidak sah: mesti bermula dengan "${A.prefix}"`;if(A.format==="ends_with")return`String tidak sah: mesti berakhir dengan "${A.suffix}"`;if(A.format==="includes")return`String tidak sah: mesti mengandungi "${A.includes}"`;if(A.format==="regex")return`String tidak sah: mesti sepadan dengan corak ${A.pattern}`;return`${D[A.format]??b.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${b.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${M(b.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${b.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${b.origin}`;default:return"Input tidak sah"}}};function CX(){return{localeError:dz()}}var pz=()=>{let $={string:{unit:"tekens",verb:"te hebben"},file:{unit:"bytes",verb:"te hebben"},array:{unit:"elementen",verb:"te hebben"},set:{unit:"elementen",verb:"te hebben"}};function I(b){return $[b]??null}let U=(b)=>{let A=typeof b;switch(A){case"number":return Number.isNaN(b)?"NaN":"getal";case"object":{if(Array.isArray(b))return"array";if(b===null)return"null";if(Object.getPrototypeOf(b)!==Object.prototype&&b.constructor)return b.constructor.name}}return A},D={regex:"invoer",email:"emailadres",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 datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"};return(b)=>{switch(b.code){case"invalid_type":return`Ongeldige invoer: verwacht ${b.expected}, ontving ${U(b.input)}`;case"invalid_value":if(b.values.length===1)return`Ongeldige invoer: verwacht ${k(b.values[0])}`;return`Ongeldige optie: verwacht één van ${M(b.values,"|")}`;case"too_big":{let A=b.inclusive?"<=":"<",w=I(b.origin);if(w)return`Te groot: verwacht dat ${b.origin??"waarde"} ${w.verb} ${A}${b.maximum.toString()} ${w.unit??"elementen"}`;return`Te groot: verwacht dat ${b.origin??"waarde"} ${A}${b.maximum.toString()} is`}case"too_small":{let A=b.inclusive?">=":">",w=I(b.origin);if(w)return`Te klein: verwacht dat ${b.origin} ${w.verb} ${A}${b.minimum.toString()} ${w.unit}`;return`Te klein: verwacht dat ${b.origin} ${A}${b.minimum.toString()} is`}case"invalid_format":{let A=b;if(A.format==="starts_with")return`Ongeldige tekst: moet met "${A.prefix}" beginnen`;if(A.format==="ends_with")return`Ongeldige tekst: moet op "${A.suffix}" eindigen`;if(A.format==="includes")return`Ongeldige tekst: moet "${A.includes}" bevatten`;if(A.format==="regex")return`Ongeldige tekst: moet overeenkomen met patroon ${A.pattern}`;return`Ongeldig: ${D[A.format]??b.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${b.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${b.keys.length>1?"s":""}: ${M(b.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${b.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${b.origin}`;default:return"Ongeldige invoer"}}};function fX(){return{localeError:pz()}}var tz=()=>{let $={string:{unit:"tegn",verb:"å ha"},file:{unit:"bytes",verb:"å ha"},array:{unit:"elementer",verb:"å inneholde"},set:{unit:"elementer",verb:"å inneholde"}};function I(b){return $[b]??null}let U=(b)=>{let A=typeof b;switch(A){case"number":return Number.isNaN(b)?"NaN":"tall";case"object":{if(Array.isArray(b))return"liste";if(b===null)return"null";if(Object.getPrototypeOf(b)!==Object.prototype&&b.constructor)return b.constructor.name}}return A},D={regex:"input",email:"e-postadresse",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 dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"};return(b)=>{switch(b.code){case"invalid_type":return`Ugyldig input: forventet ${b.expected}, fikk ${U(b.input)}`;case"invalid_value":if(b.values.length===1)return`Ugyldig verdi: forventet ${k(b.values[0])}`;return`Ugyldig valg: forventet en av ${M(b.values,"|")}`;case"too_big":{let A=b.inclusive?"<=":"<",w=I(b.origin);if(w)return`For stor(t): forventet ${b.origin??"value"} til å ha ${A}${b.maximum.toString()} ${w.unit??"elementer"}`;return`For stor(t): forventet ${b.origin??"value"} til å ha ${A}${b.maximum.toString()}`}case"too_small":{let A=b.inclusive?">=":">",w=I(b.origin);if(w)return`For lite(n): forventet ${b.origin} til å ha ${A}${b.minimum.toString()} ${w.unit}`;return`For lite(n): forventet ${b.origin} til å ha ${A}${b.minimum.toString()}`}case"invalid_format":{let A=b;if(A.format==="starts_with")return`Ugyldig streng: må starte med "${A.prefix}"`;if(A.format==="ends_with")return`Ugyldig streng: må ende med "${A.suffix}"`;if(A.format==="includes")return`Ugyldig streng: må inneholde "${A.includes}"`;if(A.format==="regex")return`Ugyldig streng: må matche mønsteret ${A.pattern}`;return`Ugyldig ${D[A.format]??b.format}`}case"not_multiple_of":return`Ugyldig tall: må være et multiplum av ${b.divisor}`;case"unrecognized_keys":return`${b.keys.length>1?"Ukjente nøkler":"Ukjent nøkkel"}: ${M(b.keys,", ")}`;case"invalid_key":return`Ugyldig nøkkel i ${b.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${b.origin}`;default:return"Ugyldig input"}}};function ZX(){return{localeError:tz()}}var az=()=>{let $={string:{unit:"harf",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"unsur",verb:"olmalıdır"},set:{unit:"unsur",verb:"olmalıdır"}};function I(b){return $[b]??null}let U=(b)=>{let A=typeof b;switch(A){case"number":return Number.isNaN(b)?"NaN":"numara";case"object":{if(Array.isArray(b))return"saf";if(b===null)return"gayb";if(Object.getPrototypeOf(b)!==Object.prototype&&b.constructor)return b.constructor.name}}return A},D={regex:"giren",email:"epostagâh",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 hengâmı",date:"ISO tarihi",time:"ISO zamanı",duration:"ISO müddeti",ipv4:"IPv4 nişânı",ipv6:"IPv6 nişânı",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-şifreli metin",base64url:"base64url-şifreli metin",json_string:"JSON metin",e164:"E.164 sayısı",jwt:"JWT",template_literal:"giren"};return(b)=>{switch(b.code){case"invalid_type":return`Fâsit giren: umulan ${b.expected}, alınan ${U(b.input)}`;case"invalid_value":if(b.values.length===1)return`Fâsit giren: umulan ${k(b.values[0])}`;return`Fâsit tercih: mûteberler ${M(b.values,"|")}`;case"too_big":{let A=b.inclusive?"<=":"<",w=I(b.origin);if(w)return`Fazla büyük: ${b.origin??"value"}, ${A}${b.maximum.toString()} ${w.unit??"elements"} sahip olmalıydı.`;return`Fazla büyük: ${b.origin??"value"}, ${A}${b.maximum.toString()} olmalıydı.`}case"too_small":{let A=b.inclusive?">=":">",w=I(b.origin);if(w)return`Fazla küçük: ${b.origin}, ${A}${b.minimum.toString()} ${w.unit} sahip olmalıydı.`;return`Fazla küçük: ${b.origin}, ${A}${b.minimum.toString()} olmalıydı.`}case"invalid_format":{let A=b;if(A.format==="starts_with")return`Fâsit metin: "${A.prefix}" ile başlamalı.`;if(A.format==="ends_with")return`Fâsit metin: "${A.suffix}" ile bitmeli.`;if(A.format==="includes")return`Fâsit metin: "${A.includes}" ihtivâ etmeli.`;if(A.format==="regex")return`Fâsit metin: ${A.pattern} nakşına uymalı.`;return`Fâsit ${D[A.format]??b.format}`}case"not_multiple_of":return`Fâsit sayı: ${b.divisor} katı olmalıydı.`;case"unrecognized_keys":return`Tanınmayan anahtar ${b.keys.length>1?"s":""}: ${M(b.keys,", ")}`;case"invalid_key":return`${b.origin} için tanınmayan anahtar var.`;case"invalid_union":return"Giren tanınamadı.";case"invalid_element":return`${b.origin} için tanınmayan kıymet var.`;default:return"Kıymet tanınamadı."}}};function gX(){return{localeError:az()}}var ez=()=>{let $={string:{unit:"توکي",verb:"ولري"},file:{unit:"بایټس",verb:"ولري"},array:{unit:"توکي",verb:"ولري"},set:{unit:"توکي",verb:"ولري"}};function I(b){return $[b]??null}let U=(b)=>{let A=typeof b;switch(A){case"number":return Number.isNaN(b)?"NaN":"عدد";case"object":{if(Array.isArray(b))return"ارې";if(b===null)return"null";if(Object.getPrototypeOf(b)!==Object.prototype&&b.constructor)return b.constructor.name}}return A},D={regex:"ورودي",email:"بریښنالیک",url:"یو آر ال",emoji:"ایموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"نیټه او وخت",date:"نېټه",time:"وخت",duration:"موده",ipv4:"د IPv4 پته",ipv6:"د IPv6 پته",cidrv4:"د IPv4 ساحه",cidrv6:"د IPv6 ساحه",base64:"base64-encoded متن",base64url:"base64url-encoded متن",json_string:"JSON متن",e164:"د E.164 شمېره",jwt:"JWT",template_literal:"ورودي"};return(b)=>{switch(b.code){case"invalid_type":return`ناسم ورودي: باید ${b.expected} وای, مګر ${U(b.input)} ترلاسه شو`;case"invalid_value":if(b.values.length===1)return`ناسم ورودي: باید ${k(b.values[0])} وای`;return`ناسم انتخاب: باید یو له ${M(b.values,"|")} څخه وای`;case"too_big":{let A=b.inclusive?"<=":"<",w=I(b.origin);if(w)return`ډیر لوی: ${b.origin??"ارزښت"} باید ${A}${b.maximum.toString()} ${w.unit??"عنصرونه"} ولري`;return`ډیر لوی: ${b.origin??"ارزښت"} باید ${A}${b.maximum.toString()} وي`}case"too_small":{let A=b.inclusive?">=":">",w=I(b.origin);if(w)return`ډیر کوچنی: ${b.origin} باید ${A}${b.minimum.toString()} ${w.unit} ولري`;return`ډیر کوچنی: ${b.origin} باید ${A}${b.minimum.toString()} وي`}case"invalid_format":{let A=b;if(A.format==="starts_with")return`ناسم متن: باید د "${A.prefix}" سره پیل شي`;if(A.format==="ends_with")return`ناسم متن: باید د "${A.suffix}" سره پای ته ورسيږي`;if(A.format==="includes")return`ناسم متن: باید "${A.includes}" ولري`;if(A.format==="regex")return`ناسم متن: باید د ${A.pattern} سره مطابقت ولري`;return`${D[A.format]??b.format} ناسم دی`}case"not_multiple_of":return`ناسم عدد: باید د ${b.divisor} مضرب وي`;case"unrecognized_keys":return`ناسم ${b.keys.length>1?"کلیډونه":"کلیډ"}: ${M(b.keys,", ")}`;case"invalid_key":return`ناسم کلیډ په ${b.origin} کې`;case"invalid_union":return"ناسمه ورودي";case"invalid_element":return`ناسم عنصر په ${b.origin} کې`;default:return"ناسمه ورودي"}}};function yX(){return{localeError:ez()}}var sz=()=>{let $={string:{unit:"znaków",verb:"mieć"},file:{unit:"bajtów",verb:"mieć"},array:{unit:"elementów",verb:"mieć"},set:{unit:"elementów",verb:"mieć"}};function I(b){return $[b]??null}let U=(b)=>{let A=typeof b;switch(A){case"number":return Number.isNaN(b)?"NaN":"liczba";case"object":{if(Array.isArray(b))return"tablica";if(b===null)return"null";if(Object.getPrototypeOf(b)!==Object.prototype&&b.constructor)return b.constructor.name}}return A},D={regex:"wyrażenie",email:"adres email",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:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ciąg znaków zakodowany w formacie base64",base64url:"ciąg znaków zakodowany w formacie base64url",json_string:"ciąg znaków w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wejście"};return(b)=>{switch(b.code){case"invalid_type":return`Nieprawidłowe dane wejściowe: oczekiwano ${b.expected}, otrzymano ${U(b.input)}`;case"invalid_value":if(b.values.length===1)return`Nieprawidłowe dane wejściowe: oczekiwano ${k(b.values[0])}`;return`Nieprawidłowa opcja: oczekiwano jednej z wartości ${M(b.values,"|")}`;case"too_big":{let A=b.inclusive?"<=":"<",w=I(b.origin);if(w)return`Za duża wartość: oczekiwano, że ${b.origin??"wartość"} będzie mieć ${A}${b.maximum.toString()} ${w.unit??"elementów"}`;return`Zbyt duż(y/a/e): oczekiwano, że ${b.origin??"wartość"} będzie wynosić ${A}${b.maximum.toString()}`}case"too_small":{let A=b.inclusive?">=":">",w=I(b.origin);if(w)return`Za mała wartość: oczekiwano, że ${b.origin??"wartość"} będzie mieć ${A}${b.minimum.toString()} ${w.unit??"elementów"}`;return`Zbyt mał(y/a/e): oczekiwano, że ${b.origin??"wartość"} będzie wynosić ${A}${b.minimum.toString()}`}case"invalid_format":{let A=b;if(A.format==="starts_with")return`Nieprawidłowy ciąg znaków: musi zaczynać się od "${A.prefix}"`;if(A.format==="ends_with")return`Nieprawidłowy ciąg znaków: musi kończyć się na "${A.suffix}"`;if(A.format==="includes")return`Nieprawidłowy ciąg znaków: musi zawierać "${A.includes}"`;if(A.format==="regex")return`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${A.pattern}`;return`Nieprawidłow(y/a/e) ${D[A.format]??b.format}`}case"not_multiple_of":return`Nieprawidłowa liczba: musi być wielokrotnością ${b.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${b.keys.length>1?"s":""}: ${M(b.keys,", ")}`;case"invalid_key":return`Nieprawidłowy klucz w ${b.origin}`;case"invalid_union":return"Nieprawidłowe dane wejściowe";case"invalid_element":return`Nieprawidłowa wartość w ${b.origin}`;default:return"Nieprawidłowe dane wejściowe"}}};function xX(){return{localeError:sz()}}var $F=()=>{let $={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function I(b){return $[b]??null}let U=(b)=>{let A=typeof b;switch(A){case"number":return Number.isNaN(b)?"NaN":"número";case"object":{if(Array.isArray(b))return"array";if(b===null)return"nulo";if(Object.getPrototypeOf(b)!==Object.prototype&&b.constructor)return b.constructor.name}}return A},D={regex:"padrão",email:"endereço de e-mail",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:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"duração ISO",ipv4:"endereço IPv4",ipv6:"endereço IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"};return(b)=>{switch(b.code){case"invalid_type":return`Tipo inválido: esperado ${b.expected}, recebido ${U(b.input)}`;case"invalid_value":if(b.values.length===1)return`Entrada inválida: esperado ${k(b.values[0])}`;return`Opção inválida: esperada uma das ${M(b.values,"|")}`;case"too_big":{let A=b.inclusive?"<=":"<",w=I(b.origin);if(w)return`Muito grande: esperado que ${b.origin??"valor"} tivesse ${A}${b.maximum.toString()} ${w.unit??"elementos"}`;return`Muito grande: esperado que ${b.origin??"valor"} fosse ${A}${b.maximum.toString()}`}case"too_small":{let A=b.inclusive?">=":">",w=I(b.origin);if(w)return`Muito pequeno: esperado que ${b.origin} tivesse ${A}${b.minimum.toString()} ${w.unit}`;return`Muito pequeno: esperado que ${b.origin} fosse ${A}${b.minimum.toString()}`}case"invalid_format":{let A=b;if(A.format==="starts_with")return`Texto inválido: deve começar com "${A.prefix}"`;if(A.format==="ends_with")return`Texto inválido: deve terminar com "${A.suffix}"`;if(A.format==="includes")return`Texto inválido: deve incluir "${A.includes}"`;if(A.format==="regex")return`Texto inválido: deve corresponder ao padrão ${A.pattern}`;return`${D[A.format]??b.format} inválido`}case"not_multiple_of":return`Número inválido: deve ser múltiplo de ${b.divisor}`;case"unrecognized_keys":return`Chave${b.keys.length>1?"s":""} desconhecida${b.keys.length>1?"s":""}: ${M(b.keys,", ")}`;case"invalid_key":return`Chave inválida em ${b.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido em ${b.origin}`;default:return"Campo inválido"}}};function lX(){return{localeError:$F()}}function xv($,I,U,D){let b=Math.abs($),A=b%10,w=b%100;if(w>=11&&w<=19)return D;if(A===1)return I;if(A>=2&&A<=4)return U;return D}var IF=()=>{let $={string:{unit:{one:"символ",few:"символа",many:"символов"},verb:"иметь"},file:{unit:{one:"байт",few:"байта",many:"байт"},verb:"иметь"},array:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"},set:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"}};function I(b){return $[b]??null}let U=(b)=>{let A=typeof b;switch(A){case"number":return Number.isNaN(b)?"NaN":"число";case"object":{if(Array.isArray(b))return"массив";if(b===null)return"null";if(Object.getPrototypeOf(b)!==Object.prototype&&b.constructor)return b.constructor.name}}return A},D={regex:"ввод",email:"email адрес",url:"URL",emoji:"эмодзи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата и время",date:"ISO дата",time:"ISO время",duration:"ISO длительность",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"строка в формате base64",base64url:"строка в формате base64url",json_string:"JSON строка",e164:"номер E.164",jwt:"JWT",template_literal:"ввод"};return(b)=>{switch(b.code){case"invalid_type":return`Неверный ввод: ожидалось ${b.expected}, получено ${U(b.input)}`;case"invalid_value":if(b.values.length===1)return`Неверный ввод: ожидалось ${k(b.values[0])}`;return`Неверный вариант: ожидалось одно из ${M(b.values,"|")}`;case"too_big":{let A=b.inclusive?"<=":"<",w=I(b.origin);if(w){let O=Number(b.maximum),N=xv(O,w.unit.one,w.unit.few,w.unit.many);return`Слишком большое значение: ожидалось, что ${b.origin??"значение"} будет иметь ${A}${b.maximum.toString()} ${N}`}return`Слишком большое значение: ожидалось, что ${b.origin??"значение"} будет ${A}${b.maximum.toString()}`}case"too_small":{let A=b.inclusive?">=":">",w=I(b.origin);if(w){let O=Number(b.minimum),N=xv(O,w.unit.one,w.unit.few,w.unit.many);return`Слишком маленькое значение: ожидалось, что ${b.origin} будет иметь ${A}${b.minimum.toString()} ${N}`}return`Слишком маленькое значение: ожидалось, что ${b.origin} будет ${A}${b.minimum.toString()}`}case"invalid_format":{let A=b;if(A.format==="starts_with")return`Неверная строка: должна начинаться с "${A.prefix}"`;if(A.format==="ends_with")return`Неверная строка: должна заканчиваться на "${A.suffix}"`;if(A.format==="includes")return`Неверная строка: должна содержать "${A.includes}"`;if(A.format==="regex")return`Неверная строка: должна соответствовать шаблону ${A.pattern}`;return`Неверный ${D[A.format]??b.format}`}case"not_multiple_of":return`Неверное число: должно быть кратным ${b.divisor}`;case"unrecognized_keys":return`Нераспознанн${b.keys.length>1?"ые":"ый"} ключ${b.keys.length>1?"и":""}: ${M(b.keys,", ")}`;case"invalid_key":return`Неверный ключ в ${b.origin}`;case"invalid_union":return"Неверные входные данные";case"invalid_element":return`Неверное значение в ${b.origin}`;default:return"Неверные входные данные"}}};function hX(){return{localeError:IF()}}var UF=()=>{let $={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function I(b){return $[b]??null}let U=(b)=>{let A=typeof b;switch(A){case"number":return Number.isNaN(b)?"NaN":"število";case"object":{if(Array.isArray(b))return"tabela";if(b===null)return"null";if(Object.getPrototypeOf(b)!==Object.prototype&&b.constructor)return b.constructor.name}}return A},D={regex:"vnos",email:"e-poštni naslov",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 datum in čas",date:"ISO datum",time:"ISO čas",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 številka",jwt:"JWT",template_literal:"vnos"};return(b)=>{switch(b.code){case"invalid_type":return`Neveljaven vnos: pričakovano ${b.expected}, prejeto ${U(b.input)}`;case"invalid_value":if(b.values.length===1)return`Neveljaven vnos: pričakovano ${k(b.values[0])}`;return`Neveljavna možnost: pričakovano eno izmed ${M(b.values,"|")}`;case"too_big":{let A=b.inclusive?"<=":"<",w=I(b.origin);if(w)return`Preveliko: pričakovano, da bo ${b.origin??"vrednost"} imelo ${A}${b.maximum.toString()} ${w.unit??"elementov"}`;return`Preveliko: pričakovano, da bo ${b.origin??"vrednost"} ${A}${b.maximum.toString()}`}case"too_small":{let A=b.inclusive?">=":">",w=I(b.origin);if(w)return`Premajhno: pričakovano, da bo ${b.origin} imelo ${A}${b.minimum.toString()} ${w.unit}`;return`Premajhno: pričakovano, da bo ${b.origin} ${A}${b.minimum.toString()}`}case"invalid_format":{let A=b;if(A.format==="starts_with")return`Neveljaven niz: mora se začeti z "${A.prefix}"`;if(A.format==="ends_with")return`Neveljaven niz: mora se končati z "${A.suffix}"`;if(A.format==="includes")return`Neveljaven niz: mora vsebovati "${A.includes}"`;if(A.format==="regex")return`Neveljaven niz: mora ustrezati vzorcu ${A.pattern}`;return`Neveljaven ${D[A.format]??b.format}`}case"not_multiple_of":return`Neveljavno število: mora biti večkratnik ${b.divisor}`;case"unrecognized_keys":return`Neprepoznan${b.keys.length>1?"i ključi":" ključ"}: ${M(b.keys,", ")}`;case"invalid_key":return`Neveljaven ključ v ${b.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${b.origin}`;default:return"Neveljaven vnos"}}};function uX(){return{localeError:UF()}}var bF=()=>{let $={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att innehålla"},set:{unit:"objekt",verb:"att innehålla"}};function I(b){return $[b]??null}let U=(b)=>{let A=typeof b;switch(A){case"number":return Number.isNaN(b)?"NaN":"antal";case"object":{if(Array.isArray(b))return"lista";if(b===null)return"null";if(Object.getPrototypeOf(b)!==Object.prototype&&b.constructor)return b.constructor.name}}return A},D={regex:"reguljärt uttryck",email:"e-postadress",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-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad sträng",base64url:"base64url-kodad sträng",json_string:"JSON-sträng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"};return(b)=>{switch(b.code){case"invalid_type":return`Ogiltig inmatning: förväntat ${b.expected}, fick ${U(b.input)}`;case"invalid_value":if(b.values.length===1)return`Ogiltig inmatning: förväntat ${k(b.values[0])}`;return`Ogiltigt val: förväntade en av ${M(b.values,"|")}`;case"too_big":{let A=b.inclusive?"<=":"<",w=I(b.origin);if(w)return`För stor(t): förväntade ${b.origin??"värdet"} att ha ${A}${b.maximum.toString()} ${w.unit??"element"}`;return`För stor(t): förväntat ${b.origin??"värdet"} att ha ${A}${b.maximum.toString()}`}case"too_small":{let A=b.inclusive?">=":">",w=I(b.origin);if(w)return`För lite(t): förväntade ${b.origin??"värdet"} att ha ${A}${b.minimum.toString()} ${w.unit}`;return`För lite(t): förväntade ${b.origin??"värdet"} att ha ${A}${b.minimum.toString()}`}case"invalid_format":{let A=b;if(A.format==="starts_with")return`Ogiltig sträng: måste börja med "${A.prefix}"`;if(A.format==="ends_with")return`Ogiltig sträng: måste sluta med "${A.suffix}"`;if(A.format==="includes")return`Ogiltig sträng: måste innehålla "${A.includes}"`;if(A.format==="regex")return`Ogiltig sträng: måste matcha mönstret "${A.pattern}"`;return`Ogiltig(t) ${D[A.format]??b.format}`}case"not_multiple_of":return`Ogiltigt tal: måste vara en multipel av ${b.divisor}`;case"unrecognized_keys":return`${b.keys.length>1?"Okända nycklar":"Okänd nyckel"}: ${M(b.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${b.origin??"värdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt värde i ${b.origin??"värdet"}`;default:return"Ogiltig input"}}};function iX(){return{localeError:bF()}}var DF=()=>{let $={string:{unit:"எழுத்துக்கள்",verb:"கொண்டிருக்க வேண்டும்"},file:{unit:"பைட்டுகள்",verb:"கொண்டிருக்க வேண்டும்"},array:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},set:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"}};function I(b){return $[b]??null}let U=(b)=>{let A=typeof b;switch(A){case"number":return Number.isNaN(b)?"எண் அல்லாதது":"எண்";case"object":{if(Array.isArray(b))return"அணி";if(b===null)return"வெறுமை";if(Object.getPrototypeOf(b)!==Object.prototype&&b.constructor)return b.constructor.name}}return A},D={regex:"உள்ளீடு",email:"மின்னஞ்சல் முகவரி",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 தேதி நேரம்",date:"ISO தேதி",time:"ISO நேரம்",duration:"ISO கால அளவு",ipv4:"IPv4 முகவரி",ipv6:"IPv6 முகவரி",cidrv4:"IPv4 வரம்பு",cidrv6:"IPv6 வரம்பு",base64:"base64-encoded சரம்",base64url:"base64url-encoded சரம்",json_string:"JSON சரம்",e164:"E.164 எண்",jwt:"JWT",template_literal:"input"};return(b)=>{switch(b.code){case"invalid_type":return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${b.expected}, பெறப்பட்டது ${U(b.input)}`;case"invalid_value":if(b.values.length===1)return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${k(b.values[0])}`;return`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${M(b.values,"|")} இல் ஒன்று`;case"too_big":{let A=b.inclusive?"<=":"<",w=I(b.origin);if(w)return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${b.origin??"மதிப்பு"} ${A}${b.maximum.toString()} ${w.unit??"உறுப்புகள்"} ஆக இருக்க வேண்டும்`;return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${b.origin??"மதிப்பு"} ${A}${b.maximum.toString()} ஆக இருக்க வேண்டும்`}case"too_small":{let A=b.inclusive?">=":">",w=I(b.origin);if(w)return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${b.origin} ${A}${b.minimum.toString()} ${w.unit} ஆக இருக்க வேண்டும்`;return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${b.origin} ${A}${b.minimum.toString()} ஆக இருக்க வேண்டும்`}case"invalid_format":{let A=b;if(A.format==="starts_with")return`தவறான சரம்: "${A.prefix}" இல் தொடங்க வேண்டும்`;if(A.format==="ends_with")return`தவறான சரம்: "${A.suffix}" இல் முடிவடைய வேண்டும்`;if(A.format==="includes")return`தவறான சரம்: "${A.includes}" ஐ உள்ளடக்க வேண்டும்`;if(A.format==="regex")return`தவறான சரம்: ${A.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`;return`தவறான ${D[A.format]??b.format}`}case"not_multiple_of":return`தவறான எண்: ${b.divisor} இன் பலமாக இருக்க வேண்டும்`;case"unrecognized_keys":return`அடையாளம் தெரியாத விசை${b.keys.length>1?"கள்":""}: ${M(b.keys,", ")}`;case"invalid_key":return`${b.origin} இல் தவறான விசை`;case"invalid_union":return"தவறான உள்ளீடு";case"invalid_element":return`${b.origin} இல் தவறான மதிப்பு`;default:return"தவறான உள்ளீடு"}}};function nX(){return{localeError:DF()}}var AF=()=>{let $={string:{unit:"ตัวอักษร",verb:"ควรมี"},file:{unit:"ไบต์",verb:"ควรมี"},array:{unit:"รายการ",verb:"ควรมี"},set:{unit:"รายการ",verb:"ควรมี"}};function I(b){return $[b]??null}let U=(b)=>{let A=typeof b;switch(A){case"number":return Number.isNaN(b)?"ไม่ใช่ตัวเลข (NaN)":"ตัวเลข";case"object":{if(Array.isArray(b))return"อาร์เรย์ (Array)";if(b===null)return"ไม่มีค่า (null)";if(Object.getPrototypeOf(b)!==Object.prototype&&b.constructor)return b.constructor.name}}return A},D={regex:"ข้อมูลที่ป้อน",email:"ที่อยู่อีเมล",url:"URL",emoji:"อิโมจิ",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"วันที่เวลาแบบ ISO",date:"วันที่แบบ ISO",time:"เวลาแบบ ISO",duration:"ช่วงเวลาแบบ ISO",ipv4:"ที่อยู่ IPv4",ipv6:"ที่อยู่ IPv6",cidrv4:"ช่วง IP แบบ IPv4",cidrv6:"ช่วง IP แบบ IPv6",base64:"ข้อความแบบ Base64",base64url:"ข้อความแบบ Base64 สำหรับ URL",json_string:"ข้อความแบบ JSON",e164:"เบอร์โทรศัพท์ระหว่างประเทศ (E.164)",jwt:"โทเคน JWT",template_literal:"ข้อมูลที่ป้อน"};return(b)=>{switch(b.code){case"invalid_type":return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${b.expected} แต่ได้รับ ${U(b.input)}`;case"invalid_value":if(b.values.length===1)return`ค่าไม่ถูกต้อง: ควรเป็น ${k(b.values[0])}`;return`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${M(b.values,"|")}`;case"too_big":{let A=b.inclusive?"ไม่เกิน":"น้อยกว่า",w=I(b.origin);if(w)return`เกินกำหนด: ${b.origin??"ค่า"} ควรมี${A} ${b.maximum.toString()} ${w.unit??"รายการ"}`;return`เกินกำหนด: ${b.origin??"ค่า"} ควรมี${A} ${b.maximum.toString()}`}case"too_small":{let A=b.inclusive?"อย่างน้อย":"มากกว่า",w=I(b.origin);if(w)return`น้อยกว่ากำหนด: ${b.origin} ควรมี${A} ${b.minimum.toString()} ${w.unit}`;return`น้อยกว่ากำหนด: ${b.origin} ควรมี${A} ${b.minimum.toString()}`}case"invalid_format":{let A=b;if(A.format==="starts_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${A.prefix}"`;if(A.format==="ends_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${A.suffix}"`;if(A.format==="includes")return`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${A.includes}" อยู่ในข้อความ`;if(A.format==="regex")return`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${A.pattern}`;return`รูปแบบไม่ถูกต้อง: ${D[A.format]??b.format}`}case"not_multiple_of":return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${b.divisor} ได้ลงตัว`;case"unrecognized_keys":return`พบคีย์ที่ไม่รู้จัก: ${M(b.keys,", ")}`;case"invalid_key":return`คีย์ไม่ถูกต้องใน ${b.origin}`;case"invalid_union":return"ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";case"invalid_element":return`ข้อมูลไม่ถูกต้องใน ${b.origin}`;default:return"ข้อมูลไม่ถูกต้อง"}}};function rX(){return{localeError:AF()}}var wF=($)=>{let I=typeof $;switch(I){case"number":return Number.isNaN($)?"NaN":"number";case"object":{if(Array.isArray($))return"array";if($===null)return"null";if(Object.getPrototypeOf($)!==Object.prototype&&$.constructor)return $.constructor.name}}return I},OF=()=>{let $={string:{unit:"karakter",verb:"olmalı"},file:{unit:"bayt",verb:"olmalı"},array:{unit:"öğe",verb:"olmalı"},set:{unit:"öğe",verb:"olmalı"}};function I(D){return $[D]??null}let U={regex:"girdi",email:"e-posta adresi",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 tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO süre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aralığı",cidrv6:"IPv6 aralığı",base64:"base64 ile şifrelenmiş metin",base64url:"base64url ile şifrelenmiş metin",json_string:"JSON dizesi",e164:"E.164 sayısı",jwt:"JWT",template_literal:"Şablon dizesi"};return(D)=>{switch(D.code){case"invalid_type":return`Geçersiz değer: beklenen ${D.expected}, alınan ${wF(D.input)}`;case"invalid_value":if(D.values.length===1)return`Geçersiz değer: beklenen ${k(D.values[0])}`;return`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${M(D.values,"|")}`;case"too_big":{let b=D.inclusive?"<=":"<",A=I(D.origin);if(A)return`Çok büyük: beklenen ${D.origin??"değer"} ${b}${D.maximum.toString()} ${A.unit??"öğe"}`;return`Çok büyük: beklenen ${D.origin??"değer"} ${b}${D.maximum.toString()}`}case"too_small":{let b=D.inclusive?">=":">",A=I(D.origin);if(A)return`Çok küçük: beklenen ${D.origin} ${b}${D.minimum.toString()} ${A.unit}`;return`Çok küçük: beklenen ${D.origin} ${b}${D.minimum.toString()}`}case"invalid_format":{let b=D;if(b.format==="starts_with")return`Geçersiz metin: "${b.prefix}" ile başlamalı`;if(b.format==="ends_with")return`Geçersiz metin: "${b.suffix}" ile bitmeli`;if(b.format==="includes")return`Geçersiz metin: "${b.includes}" içermeli`;if(b.format==="regex")return`Geçersiz metin: ${b.pattern} desenine uymalı`;return`Geçersiz ${U[b.format]??D.format}`}case"not_multiple_of":return`Geçersiz sayı: ${D.divisor} ile tam bölünebilmeli`;case"unrecognized_keys":return`Tanınmayan anahtar${D.keys.length>1?"lar":""}: ${M(D.keys,", ")}`;case"invalid_key":return`${D.origin} içinde geçersiz anahtar`;case"invalid_union":return"Geçersiz değer";case"invalid_element":return`${D.origin} içinde geçersiz değer`;default:return"Geçersiz değer"}}};function cX(){return{localeError:OF()}}var NF=()=>{let $={string:{unit:"символів",verb:"матиме"},file:{unit:"байтів",verb:"матиме"},array:{unit:"елементів",verb:"матиме"},set:{unit:"елементів",verb:"матиме"}};function I(b){return $[b]??null}let U=(b)=>{let A=typeof b;switch(A){case"number":return Number.isNaN(b)?"NaN":"число";case"object":{if(Array.isArray(b))return"масив";if(b===null)return"null";if(Object.getPrototypeOf(b)!==Object.prototype&&b.constructor)return b.constructor.name}}return A},D={regex:"вхідні дані",email:"адреса електронної пошти",url:"URL",emoji:"емодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"дата та час ISO",date:"дата ISO",time:"час ISO",duration:"тривалість ISO",ipv4:"адреса IPv4",ipv6:"адреса IPv6",cidrv4:"діапазон IPv4",cidrv6:"діапазон IPv6",base64:"рядок у кодуванні base64",base64url:"рядок у кодуванні base64url",json_string:"рядок JSON",e164:"номер E.164",jwt:"JWT",template_literal:"вхідні дані"};return(b)=>{switch(b.code){case"invalid_type":return`Неправильні вхідні дані: очікується ${b.expected}, отримано ${U(b.input)}`;case"invalid_value":if(b.values.length===1)return`Неправильні вхідні дані: очікується ${k(b.values[0])}`;return`Неправильна опція: очікується одне з ${M(b.values,"|")}`;case"too_big":{let A=b.inclusive?"<=":"<",w=I(b.origin);if(w)return`Занадто велике: очікується, що ${b.origin??"значення"} ${w.verb} ${A}${b.maximum.toString()} ${w.unit??"елементів"}`;return`Занадто велике: очікується, що ${b.origin??"значення"} буде ${A}${b.maximum.toString()}`}case"too_small":{let A=b.inclusive?">=":">",w=I(b.origin);if(w)return`Занадто мале: очікується, що ${b.origin} ${w.verb} ${A}${b.minimum.toString()} ${w.unit}`;return`Занадто мале: очікується, що ${b.origin} буде ${A}${b.minimum.toString()}`}case"invalid_format":{let A=b;if(A.format==="starts_with")return`Неправильний рядок: повинен починатися з "${A.prefix}"`;if(A.format==="ends_with")return`Неправильний рядок: повинен закінчуватися на "${A.suffix}"`;if(A.format==="includes")return`Неправильний рядок: повинен містити "${A.includes}"`;if(A.format==="regex")return`Неправильний рядок: повинен відповідати шаблону ${A.pattern}`;return`Неправильний ${D[A.format]??b.format}`}case"not_multiple_of":return`Неправильне число: повинно бути кратним ${b.divisor}`;case"unrecognized_keys":return`Нерозпізнаний ключ${b.keys.length>1?"і":""}: ${M(b.keys,", ")}`;case"invalid_key":return`Неправильний ключ у ${b.origin}`;case"invalid_union":return"Неправильні вхідні дані";case"invalid_element":return`Неправильне значення у ${b.origin}`;default:return"Неправильні вхідні дані"}}};function aU(){return{localeError:NF()}}function mX(){return aU()}var XF=()=>{let $={string:{unit:"حروف",verb:"ہونا"},file:{unit:"بائٹس",verb:"ہونا"},array:{unit:"آئٹمز",verb:"ہونا"},set:{unit:"آئٹمز",verb:"ہونا"}};function I(b){return $[b]??null}let U=(b)=>{let A=typeof b;switch(A){case"number":return Number.isNaN(b)?"NaN":"نمبر";case"object":{if(Array.isArray(b))return"آرے";if(b===null)return"نل";if(Object.getPrototypeOf(b)!==Object.prototype&&b.constructor)return b.constructor.name}}return A},D={regex:"ان پٹ",email:"ای میل ایڈریس",url:"یو آر ایل",emoji:"ایموجی",uuid:"یو یو آئی ڈی",uuidv4:"یو یو آئی ڈی وی 4",uuidv6:"یو یو آئی ڈی وی 6",nanoid:"نینو آئی ڈی",guid:"جی یو آئی ڈی",cuid:"سی یو آئی ڈی",cuid2:"سی یو آئی ڈی 2",ulid:"یو ایل آئی ڈی",xid:"ایکس آئی ڈی",ksuid:"کے ایس یو آئی ڈی",datetime:"آئی ایس او ڈیٹ ٹائم",date:"آئی ایس او تاریخ",time:"آئی ایس او وقت",duration:"آئی ایس او مدت",ipv4:"آئی پی وی 4 ایڈریس",ipv6:"آئی پی وی 6 ایڈریس",cidrv4:"آئی پی وی 4 رینج",cidrv6:"آئی پی وی 6 رینج",base64:"بیس 64 ان کوڈڈ سٹرنگ",base64url:"بیس 64 یو آر ایل ان کوڈڈ سٹرنگ",json_string:"جے ایس او این سٹرنگ",e164:"ای 164 نمبر",jwt:"جے ڈبلیو ٹی",template_literal:"ان پٹ"};return(b)=>{switch(b.code){case"invalid_type":return`غلط ان پٹ: ${b.expected} متوقع تھا، ${U(b.input)} موصول ہوا`;case"invalid_value":if(b.values.length===1)return`غلط ان پٹ: ${k(b.values[0])} متوقع تھا`;return`غلط آپشن: ${M(b.values,"|")} میں سے ایک متوقع تھا`;case"too_big":{let A=b.inclusive?"<=":"<",w=I(b.origin);if(w)return`بہت بڑا: ${b.origin??"ویلیو"} کے ${A}${b.maximum.toString()} ${w.unit??"عناصر"} ہونے متوقع تھے`;return`بہت بڑا: ${b.origin??"ویلیو"} کا ${A}${b.maximum.toString()} ہونا متوقع تھا`}case"too_small":{let A=b.inclusive?">=":">",w=I(b.origin);if(w)return`بہت چھوٹا: ${b.origin} کے ${A}${b.minimum.toString()} ${w.unit} ہونے متوقع تھے`;return`بہت چھوٹا: ${b.origin} کا ${A}${b.minimum.toString()} ہونا متوقع تھا`}case"invalid_format":{let A=b;if(A.format==="starts_with")return`غلط سٹرنگ: "${A.prefix}" سے شروع ہونا چاہیے`;if(A.format==="ends_with")return`غلط سٹرنگ: "${A.suffix}" پر ختم ہونا چاہیے`;if(A.format==="includes")return`غلط سٹرنگ: "${A.includes}" شامل ہونا چاہیے`;if(A.format==="regex")return`غلط سٹرنگ: پیٹرن ${A.pattern} سے میچ ہونا چاہیے`;return`غلط ${D[A.format]??b.format}`}case"not_multiple_of":return`غلط نمبر: ${b.divisor} کا مضاعف ہونا چاہیے`;case"unrecognized_keys":return`غیر تسلیم شدہ کی${b.keys.length>1?"ز":""}: ${M(b.keys,"، ")}`;case"invalid_key":return`${b.origin} میں غلط کی`;case"invalid_union":return"غلط ان پٹ";case"invalid_element":return`${b.origin} میں غلط ویلیو`;default:return"غلط ان پٹ"}}};function oX(){return{localeError:XF()}}var WF=()=>{let $={string:{unit:"ký tự",verb:"có"},file:{unit:"byte",verb:"có"},array:{unit:"phần tử",verb:"có"},set:{unit:"phần tử",verb:"có"}};function I(b){return $[b]??null}let U=(b)=>{let A=typeof b;switch(A){case"number":return Number.isNaN(b)?"NaN":"số";case"object":{if(Array.isArray(b))return"mảng";if(b===null)return"null";if(Object.getPrototypeOf(b)!==Object.prototype&&b.constructor)return b.constructor.name}}return A},D={regex:"đầu vào",email:"địa chỉ email",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:"ngày giờ ISO",date:"ngày ISO",time:"giờ ISO",duration:"khoảng thời gian ISO",ipv4:"địa chỉ IPv4",ipv6:"địa chỉ IPv6",cidrv4:"dải IPv4",cidrv6:"dải IPv6",base64:"chuỗi mã hóa base64",base64url:"chuỗi mã hóa base64url",json_string:"chuỗi JSON",e164:"số E.164",jwt:"JWT",template_literal:"đầu vào"};return(b)=>{switch(b.code){case"invalid_type":return`Đầu vào không hợp lệ: mong đợi ${b.expected}, nhận được ${U(b.input)}`;case"invalid_value":if(b.values.length===1)return`Đầu vào không hợp lệ: mong đợi ${k(b.values[0])}`;return`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${M(b.values,"|")}`;case"too_big":{let A=b.inclusive?"<=":"<",w=I(b.origin);if(w)return`Quá lớn: mong đợi ${b.origin??"giá trị"} ${w.verb} ${A}${b.maximum.toString()} ${w.unit??"phần tử"}`;return`Quá lớn: mong đợi ${b.origin??"giá trị"} ${A}${b.maximum.toString()}`}case"too_small":{let A=b.inclusive?">=":">",w=I(b.origin);if(w)return`Quá nhỏ: mong đợi ${b.origin} ${w.verb} ${A}${b.minimum.toString()} ${w.unit}`;return`Quá nhỏ: mong đợi ${b.origin} ${A}${b.minimum.toString()}`}case"invalid_format":{let A=b;if(A.format==="starts_with")return`Chuỗi không hợp lệ: phải bắt đầu bằng "${A.prefix}"`;if(A.format==="ends_with")return`Chuỗi không hợp lệ: phải kết thúc bằng "${A.suffix}"`;if(A.format==="includes")return`Chuỗi không hợp lệ: phải bao gồm "${A.includes}"`;if(A.format==="regex")return`Chuỗi không hợp lệ: phải khớp với mẫu ${A.pattern}`;return`${D[A.format]??b.format} không hợp lệ`}case"not_multiple_of":return`Số không hợp lệ: phải là bội số của ${b.divisor}`;case"unrecognized_keys":return`Khóa không được nhận dạng: ${M(b.keys,", ")}`;case"invalid_key":return`Khóa không hợp lệ trong ${b.origin}`;case"invalid_union":return"Đầu vào không hợp lệ";case"invalid_element":return`Giá trị không hợp lệ trong ${b.origin}`;default:return"Đầu vào không hợp lệ"}}};function dX(){return{localeError:WF()}}var GF=()=>{let $={string:{unit:"字符",verb:"包含"},file:{unit:"字节",verb:"包含"},array:{unit:"项",verb:"包含"},set:{unit:"项",verb:"包含"}};function I(b){return $[b]??null}let U=(b)=>{let A=typeof b;switch(A){case"number":return Number.isNaN(b)?"非数字(NaN)":"数字";case"object":{if(Array.isArray(b))return"数组";if(b===null)return"空值(null)";if(Object.getPrototypeOf(b)!==Object.prototype&&b.constructor)return b.constructor.name}}return A},D={regex:"输入",email:"电子邮件",url:"URL",emoji:"表情符号",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日期时间",date:"ISO日期",time:"ISO时间",duration:"ISO时长",ipv4:"IPv4地址",ipv6:"IPv6地址",cidrv4:"IPv4网段",cidrv6:"IPv6网段",base64:"base64编码字符串",base64url:"base64url编码字符串",json_string:"JSON字符串",e164:"E.164号码",jwt:"JWT",template_literal:"输入"};return(b)=>{switch(b.code){case"invalid_type":return`无效输入:期望 ${b.expected},实际接收 ${U(b.input)}`;case"invalid_value":if(b.values.length===1)return`无效输入:期望 ${k(b.values[0])}`;return`无效选项:期望以下之一 ${M(b.values,"|")}`;case"too_big":{let A=b.inclusive?"<=":"<",w=I(b.origin);if(w)return`数值过大:期望 ${b.origin??"值"} ${A}${b.maximum.toString()} ${w.unit??"个元素"}`;return`数值过大:期望 ${b.origin??"值"} ${A}${b.maximum.toString()}`}case"too_small":{let A=b.inclusive?">=":">",w=I(b.origin);if(w)return`数值过小:期望 ${b.origin} ${A}${b.minimum.toString()} ${w.unit}`;return`数值过小:期望 ${b.origin} ${A}${b.minimum.toString()}`}case"invalid_format":{let A=b;if(A.format==="starts_with")return`无效字符串:必须以 "${A.prefix}" 开头`;if(A.format==="ends_with")return`无效字符串:必须以 "${A.suffix}" 结尾`;if(A.format==="includes")return`无效字符串:必须包含 "${A.includes}"`;if(A.format==="regex")return`无效字符串:必须满足正则表达式 ${A.pattern}`;return`无效${D[A.format]??b.format}`}case"not_multiple_of":return`无效数字:必须是 ${b.divisor} 的倍数`;case"unrecognized_keys":return`出现未知的键(key): ${M(b.keys,", ")}`;case"invalid_key":return`${b.origin} 中的键(key)无效`;case"invalid_union":return"无效输入";case"invalid_element":return`${b.origin} 中包含无效值(value)`;default:return"无效输入"}}};function pX(){return{localeError:GF()}}var QF=()=>{let $={string:{unit:"字元",verb:"擁有"},file:{unit:"位元組",verb:"擁有"},array:{unit:"項目",verb:"擁有"},set:{unit:"項目",verb:"擁有"}};function I(b){return $[b]??null}let U=(b)=>{let A=typeof b;switch(A){case"number":return Number.isNaN(b)?"NaN":"number";case"object":{if(Array.isArray(b))return"array";if(b===null)return"null";if(Object.getPrototypeOf(b)!==Object.prototype&&b.constructor)return b.constructor.name}}return A},D={regex:"輸入",email:"郵件地址",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 日期時間",date:"ISO 日期",time:"ISO 時間",duration:"ISO 期間",ipv4:"IPv4 位址",ipv6:"IPv6 位址",cidrv4:"IPv4 範圍",cidrv6:"IPv6 範圍",base64:"base64 編碼字串",base64url:"base64url 編碼字串",json_string:"JSON 字串",e164:"E.164 數值",jwt:"JWT",template_literal:"輸入"};return(b)=>{switch(b.code){case"invalid_type":return`無效的輸入值:預期為 ${b.expected},但收到 ${U(b.input)}`;case"invalid_value":if(b.values.length===1)return`無效的輸入值:預期為 ${k(b.values[0])}`;return`無效的選項:預期為以下其中之一 ${M(b.values,"|")}`;case"too_big":{let A=b.inclusive?"<=":"<",w=I(b.origin);if(w)return`數值過大:預期 ${b.origin??"值"} 應為 ${A}${b.maximum.toString()} ${w.unit??"個元素"}`;return`數值過大:預期 ${b.origin??"值"} 應為 ${A}${b.maximum.toString()}`}case"too_small":{let A=b.inclusive?">=":">",w=I(b.origin);if(w)return`數值過小:預期 ${b.origin} 應為 ${A}${b.minimum.toString()} ${w.unit}`;return`數值過小:預期 ${b.origin} 應為 ${A}${b.minimum.toString()}`}case"invalid_format":{let A=b;if(A.format==="starts_with")return`無效的字串:必須以 "${A.prefix}" 開頭`;if(A.format==="ends_with")return`無效的字串:必須以 "${A.suffix}" 結尾`;if(A.format==="includes")return`無效的字串:必須包含 "${A.includes}"`;if(A.format==="regex")return`無效的字串:必須符合格式 ${A.pattern}`;return`無效的 ${D[A.format]??b.format}`}case"not_multiple_of":return`無效的數字:必須為 ${b.divisor} 的倍數`;case"unrecognized_keys":return`無法識別的鍵值${b.keys.length>1?"們":""}:${M(b.keys,"、")}`;case"invalid_key":return`${b.origin} 中有無效的鍵值`;case"invalid_union":return"無效的輸入值";case"invalid_element":return`${b.origin} 中有無效的值`;default:return"無效的輸入值"}}};function tX(){return{localeError:QF()}}var YF=()=>{let $={string:{unit:"àmi",verb:"ní"},file:{unit:"bytes",verb:"ní"},array:{unit:"nkan",verb:"ní"},set:{unit:"nkan",verb:"ní"}};function I(b){return $[b]??null}let U=(b)=>{let A=typeof b;switch(A){case"number":return Number.isNaN(b)?"NaN":"nọ́mbà";case"object":{if(Array.isArray(b))return"akopọ";if(b===null)return"null";if(Object.getPrototypeOf(b)!==Object.prototype&&b.constructor)return b.constructor.name}}return A},D={regex:"ẹ̀rọ ìbáwọlé",email:"àdírẹ́sì ìmẹ́lì",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:"àkókò ISO",date:"ọjọ́ ISO",time:"àkókò ISO",duration:"àkókò tó pé ISO",ipv4:"àdírẹ́sì IPv4",ipv6:"àdírẹ́sì IPv6",cidrv4:"àgbègbè IPv4",cidrv6:"àgbègbè IPv6",base64:"ọ̀rọ̀ tí a kọ́ ní base64",base64url:"ọ̀rọ̀ base64url",json_string:"ọ̀rọ̀ JSON",e164:"nọ́mbà E.164",jwt:"JWT",template_literal:"ẹ̀rọ ìbáwọlé"};return(b)=>{switch(b.code){case"invalid_type":return`Ìbáwọlé aṣìṣe: a ní láti fi ${b.expected}, àmọ̀ a rí ${U(b.input)}`;case"invalid_value":if(b.values.length===1)return`Ìbáwọlé aṣìṣe: a ní láti fi ${k(b.values[0])}`;return`Àṣàyàn aṣìṣe: yan ọ̀kan lára ${M(b.values,"|")}`;case"too_big":{let A=b.inclusive?"<=":"<",w=I(b.origin);if(w)return`Tó pọ̀ jù: a ní láti jẹ́ pé ${b.origin??"iye"} ${w.verb} ${A}${b.maximum} ${w.unit}`;return`Tó pọ̀ jù: a ní láti jẹ́ ${A}${b.maximum}`}case"too_small":{let A=b.inclusive?">=":">",w=I(b.origin);if(w)return`Kéré ju: a ní láti jẹ́ pé ${b.origin} ${w.verb} ${A}${b.minimum} ${w.unit}`;return`Kéré ju: a ní láti jẹ́ ${A}${b.minimum}`}case"invalid_format":{let A=b;if(A.format==="starts_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bẹ̀rẹ̀ pẹ̀lú "${A.prefix}"`;if(A.format==="ends_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ parí pẹ̀lú "${A.suffix}"`;if(A.format==="includes")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ ní "${A.includes}"`;if(A.format==="regex")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bá àpẹẹrẹ mu ${A.pattern}`;return`Aṣìṣe: ${D[A.format]??b.format}`}case"not_multiple_of":return`Nọ́mbà aṣìṣe: gbọ́dọ̀ jẹ́ èyà pípín ti ${b.divisor}`;case"unrecognized_keys":return`Bọtìnì àìmọ̀: ${M(b.keys,", ")}`;case"invalid_key":return`Bọtìnì aṣìṣe nínú ${b.origin}`;case"invalid_union":return"Ìbáwọlé aṣìṣe";case"invalid_element":return`Iye aṣìṣe nínú ${b.origin}`;default:return"Ìbáwọlé aṣìṣe"}}};function aX(){return{localeError:YF()}}var lv,eX=Symbol("ZodOutput"),sX=Symbol("ZodInput");class $W{constructor(){this._map=new WeakMap,this._idmap=new Map}add($,...I){let U=I[0];if(this._map.set($,U),U&&typeof U==="object"&&"id"in U){if(this._idmap.has(U.id))throw new Error(`ID ${U.id} already exists in the registry`);this._idmap.set(U.id,$)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove($){let I=this._map.get($);if(I&&typeof I==="object"&&"id"in I)this._idmap.delete(I.id);return this._map.delete($),this}get($){let I=$._zod.parent;if(I){let U={...this.get(I)??{}};delete U.id;let D={...U,...this._map.get($)};return Object.keys(D).length?D:void 0}return this._map.get($)}has($){return this._map.has($)}}function gA(){return new $W}(lv=globalThis).__zod_globalRegistry??(lv.__zod_globalRegistry=gA());var Z$=globalThis.__zod_globalRegistry;function yA($,I){return new $({type:"string",...E(I)})}function IW($,I){return new $({type:"string",coerce:!0,...E(I)})}function eU($,I){return new $({type:"string",format:"email",check:"string_format",abort:!1,...E(I)})}function BI($,I){return new $({type:"string",format:"guid",check:"string_format",abort:!1,...E(I)})}function sU($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,...E(I)})}function $1($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...E(I)})}function I1($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...E(I)})}function U1($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...E(I)})}function LI($,I){return new $({type:"string",format:"url",check:"string_format",abort:!1,...E(I)})}function b1($,I){return new $({type:"string",format:"emoji",check:"string_format",abort:!1,...E(I)})}function D1($,I){return new $({type:"string",format:"nanoid",check:"string_format",abort:!1,...E(I)})}function A1($,I){return new $({type:"string",format:"cuid",check:"string_format",abort:!1,...E(I)})}function w1($,I){return new $({type:"string",format:"cuid2",check:"string_format",abort:!1,...E(I)})}function O1($,I){return new $({type:"string",format:"ulid",check:"string_format",abort:!1,...E(I)})}function N1($,I){return new $({type:"string",format:"xid",check:"string_format",abort:!1,...E(I)})}function X1($,I){return new $({type:"string",format:"ksuid",check:"string_format",abort:!1,...E(I)})}function W1($,I){return new $({type:"string",format:"ipv4",check:"string_format",abort:!1,...E(I)})}function G1($,I){return new $({type:"string",format:"ipv6",check:"string_format",abort:!1,...E(I)})}function xA($,I){return new $({type:"string",format:"mac",check:"string_format",abort:!1,...E(I)})}function Q1($,I){return new $({type:"string",format:"cidrv4",check:"string_format",abort:!1,...E(I)})}function Y1($,I){return new $({type:"string",format:"cidrv6",check:"string_format",abort:!1,...E(I)})}function v1($,I){return new $({type:"string",format:"base64",check:"string_format",abort:!1,...E(I)})}function B1($,I){return new $({type:"string",format:"base64url",check:"string_format",abort:!1,...E(I)})}function L1($,I){return new $({type:"string",format:"e164",check:"string_format",abort:!1,...E(I)})}function J1($,I){return new $({type:"string",format:"jwt",check:"string_format",abort:!1,...E(I)})}var UW={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function bW($,I){return new $({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...E(I)})}function DW($,I){return new $({type:"string",format:"date",check:"string_format",...E(I)})}function AW($,I){return new $({type:"string",format:"time",check:"string_format",precision:null,...E(I)})}function wW($,I){return new $({type:"string",format:"duration",check:"string_format",...E(I)})}function lA($,I){return new $({type:"number",checks:[],...E(I)})}function OW($,I){return new $({type:"number",coerce:!0,checks:[],...E(I)})}function hA($,I){return new $({type:"number",check:"number_format",abort:!1,format:"safeint",...E(I)})}function uA($,I){return new $({type:"number",check:"number_format",abort:!1,format:"float32",...E(I)})}function iA($,I){return new $({type:"number",check:"number_format",abort:!1,format:"float64",...E(I)})}function nA($,I){return new $({type:"number",check:"number_format",abort:!1,format:"int32",...E(I)})}function rA($,I){return new $({type:"number",check:"number_format",abort:!1,format:"uint32",...E(I)})}function cA($,I){return new $({type:"boolean",...E(I)})}function NW($,I){return new $({type:"boolean",coerce:!0,...E(I)})}function mA($,I){return new $({type:"bigint",...E(I)})}function XW($,I){return new $({type:"bigint",coerce:!0,...E(I)})}function oA($,I){return new $({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...E(I)})}function dA($,I){return new $({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...E(I)})}function pA($,I){return new $({type:"symbol",...E(I)})}function tA($,I){return new $({type:"undefined",...E(I)})}function aA($,I){return new $({type:"null",...E(I)})}function eA($){return new $({type:"any"})}function sA($){return new $({type:"unknown"})}function $w($,I){return new $({type:"never",...E(I)})}function Iw($,I){return new $({type:"void",...E(I)})}function Uw($,I){return new $({type:"date",...E(I)})}function WW($,I){return new $({type:"date",coerce:!0,...E(I)})}function bw($,I){return new $({type:"nan",...E(I)})}function k6($,I){return new kD({check:"less_than",...E(I),value:$,inclusive:!1})}function a$($,I){return new kD({check:"less_than",...E(I),value:$,inclusive:!0})}function q6($,I){return new qD({check:"greater_than",...E(I),value:$,inclusive:!1})}function g$($,I){return new qD({check:"greater_than",...E(I),value:$,inclusive:!0})}function Dw($){return q6(0,$)}function Aw($){return k6(0,$)}function ww($){return a$(0,$)}function Ow($){return g$(0,$)}function A4($,I){return new gN({check:"multiple_of",...E(I),value:$})}function Z4($,I){return new lN({check:"max_size",...E(I),maximum:$})}function w4($,I){return new hN({check:"min_size",...E(I),minimum:$})}function JI($,I){return new uN({check:"size_equals",...E(I),size:$})}function g4($,I){return new iN({check:"max_length",...E(I),maximum:$})}function h6($,I){return new nN({check:"min_length",...E(I),minimum:$})}function y4($,I){return new rN({check:"length_equals",...E(I),length:$})}function HI($,I){return new cN({check:"string_format",format:"regex",...E(I),pattern:$})}function MI($){return new mN({check:"string_format",format:"lowercase",...E($)})}function VI($){return new oN({check:"string_format",format:"uppercase",...E($)})}function KI($,I){return new dN({check:"string_format",format:"includes",...E(I),includes:$})}function zI($,I){return new pN({check:"string_format",format:"starts_with",...E(I),prefix:$})}function FI($,I){return new tN({check:"string_format",format:"ends_with",...E(I),suffix:$})}function Nw($,I,U){return new aN({check:"property",property:$,schema:I,...E(U)})}function kI($,I){return new eN({check:"mime_type",mime:$,...E(I)})}function w6($){return new sN({check:"overwrite",tx:$})}function qI($){return w6((I)=>I.normalize($))}function EI(){return w6(($)=>$.trim())}function SI(){return w6(($)=>$.toLowerCase())}function jI(){return w6(($)=>$.toUpperCase())}function PI(){return w6(($)=>e0($))}function GW($,I,U){return new $({type:"array",element:I,...E(U)})}function BF($,I,U){return new $({type:"union",options:I,...E(U)})}function LF($,I,U){return new $({type:"union",options:I,inclusive:!1,...E(U)})}function JF($,I,U,D){return new $({type:"union",options:U,discriminator:I,...E(D)})}function HF($,I,U){return new $({type:"intersection",left:I,right:U})}function MF($,I,U,D){let b=U instanceof n;return new $({type:"tuple",items:I,rest:b?U:null,...E(b?D:U)})}function VF($,I,U,D){return new $({type:"record",keyType:I,valueType:U,...E(D)})}function KF($,I,U,D){return new $({type:"map",keyType:I,valueType:U,...E(D)})}function zF($,I,U){return new $({type:"set",valueType:I,...E(U)})}function FF($,I,U){let D=Array.isArray(I)?Object.fromEntries(I.map((b)=>[b,b])):I;return new $({type:"enum",entries:D,...E(U)})}function kF($,I,U){return new $({type:"enum",entries:I,...E(U)})}function qF($,I,U){return new $({type:"literal",values:Array.isArray(I)?I:[I],...E(U)})}function Xw($,I){return new $({type:"file",...E(I)})}function EF($,I){return new $({type:"transform",transform:I})}function SF($,I){return new $({type:"optional",innerType:I})}function jF($,I){return new $({type:"nullable",innerType:I})}function PF($,I,U){return new $({type:"default",innerType:I,get defaultValue(){return typeof U==="function"?U():$N(U)}})}function RF($,I,U){return new $({type:"nonoptional",innerType:I,...E(U)})}function TF($,I){return new $({type:"success",innerType:I})}function _F($,I,U){return new $({type:"catch",innerType:I,catchValue:typeof U==="function"?U:()=>U})}function CF($,I,U){return new $({type:"pipe",in:I,out:U})}function fF($,I){return new $({type:"readonly",innerType:I})}function ZF($,I,U){return new $({type:"template_literal",parts:I,...E(U)})}function gF($,I){return new $({type:"lazy",getter:I})}function yF($,I){return new $({type:"promise",innerType:I})}function Ww($,I,U){let D=E(U);return D.abort??(D.abort=!0),new $({type:"custom",check:"custom",fn:I,...D})}function Gw($,I,U){return new $({type:"custom",check:"custom",fn:I,...E(U)})}function Qw($){let I=hv((U)=>{return U.addIssue=(D)=>{if(typeof D==="string")U.issues.push(AI(D,U.value,I._zod.def));else{let b=D;if(b.fatal)b.continue=!1;b.code??(b.code="custom"),b.input??(b.input=U.value),b.inst??(b.inst=I),b.continue??(b.continue=!I._zod.def.abort),U.issues.push(AI(b))}},$(U.value,U)});return I}function hv($,I){let U=new X$({check:"custom",...E(I)});return U._zod.check=$,U}function Yw($){let I=new X$({check:"describe"});return I._zod.onattach=[(U)=>{let D=Z$.get(U)??{};Z$.add(U,{...D,description:$})}],I._zod.check=()=>{},I}function vw($){let I=new X$({check:"meta"});return I._zod.onattach=[(U)=>{let D=Z$.get(U)??{};Z$.add(U,{...D,...$})}],I._zod.check=()=>{},I}function Bw($,I){let U=E(I),D=U.truthy??["true","1","yes","on","y","enabled"],b=U.falsy??["false","0","no","off","n","disabled"];if(U.case!=="sensitive")D=D.map((v)=>typeof v==="string"?v.toLowerCase():v),b=b.map((v)=>typeof v==="string"?v.toLowerCase():v);let A=new Set(D),w=new Set(b),O=$.Codec??YI,N=$.Boolean??GI,G=new($.String??D4)({type:"string",error:U.error}),Q=new N({type:"boolean",error:U.error}),Y=new O({type:"pipe",in:G,out:Q,transform:(v,L)=>{let H=v;if(U.case!=="sensitive")H=H.toLowerCase();if(A.has(H))return!0;else if(w.has(H))return!1;else return L.issues.push({code:"invalid_value",expected:"stringbool",values:[...A,...w],input:L.value,inst:Y,continue:!1}),{}},reverseTransform:(v,L)=>{if(v===!0)return D[0]||"true";else return b[0]||"false"},error:U.error});return Y}function x4($,I,U,D={}){let b=E(D),A={...E(D),check:"string_format",type:"string",format:I,fn:typeof U==="function"?U:(O)=>U.test(O),...b};if(U instanceof RegExp)A.pattern=U;return new $(A)}function O4($){let I=$?.target??"draft-2020-12";if(I==="draft-4")I="draft-04";if(I==="draft-7")I="draft-07";return{processors:$.processors??{},metadataRegistry:$?.metadata??Z$,target:I,unrepresentable:$?.unrepresentable??"throw",override:$?.override??(()=>{}),io:$?.io??"output",counter:0,seen:new Map,cycles:$?.cycles??"ref",reused:$?.reused??"inline",external:$?.external??void 0}}function O$($,I,U={path:[],schemaPath:[]}){var D;let b=$._zod.def,A=I.seen.get($);if(A){if(A.count++,U.schemaPath.includes($))A.cycle=U.path;return A.schema}let w={schema:{},count:1,cycle:void 0,path:U.path};I.seen.set($,w);let O=$._zod.toJSONSchema?.();if(O)w.schema=O;else{let G={...U,schemaPath:[...U.schemaPath,$],path:U.path},Q=$._zod.parent;if(Q)w.ref=Q,O$(Q,I,G),I.seen.get(Q).isParent=!0;else if($._zod.processJSONSchema)$._zod.processJSONSchema(I,w.schema,G);else{let Y=w.schema,v=I.processors[b.type];if(!v)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${b.type}`);v($,I,Y,G)}}let N=I.metadataRegistry.get($);if(N)Object.assign(w.schema,N);if(I.io==="input"&&y$($))delete w.schema.examples,delete w.schema.default;if(I.io==="input"&&w.schema._prefault)(D=w.schema).default??(D.default=w.schema._prefault);return delete w.schema._prefault,I.seen.get($).schema}function N4($,I){let U=$.seen.get(I);if(!U)throw new Error("Unprocessed schema. This is a bug in Zod.");let D=(A)=>{let w=$.target==="draft-2020-12"?"$defs":"definitions";if($.external){let G=$.external.registry.get(A[0])?.id,Q=$.external.uri??((v)=>v);if(G)return{ref:Q(G)};let Y=A[1].defId??A[1].schema.id??`schema${$.counter++}`;return A[1].defId=Y,{defId:Y,ref:`${Q("__shared")}#/${w}/${Y}`}}if(A[1]===U)return{ref:"#"};let N=`${"#"}/${w}/`,X=A[1].schema.id??`__schema${$.counter++}`;return{defId:X,ref:N+X}},b=(A)=>{if(A[1].schema.$ref)return;let w=A[1],{ref:O,defId:N}=D(A);if(w.def={...w.schema},N)w.defId=N;let X=w.schema;for(let G in X)delete X[G];X.$ref=O};if($.cycles==="throw")for(let A of $.seen.entries()){let w=A[1];if(w.cycle)throw new Error(`Cycle detected: #/${w.cycle?.join("/")}/<root>
|
|
30
|
+
|
|
31
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let A of $.seen.entries()){let w=A[1];if(I===A[0]){b(A);continue}if($.external){let N=$.external.registry.get(A[0])?.id;if(I!==A[0]&&N){b(A);continue}}if($.metadataRegistry.get(A[0])?.id){b(A);continue}if(w.cycle){b(A);continue}if(w.count>1){if($.reused==="ref"){b(A);continue}}}}function X4($,I){let U=$.seen.get(I);if(!U)throw new Error("Unprocessed schema. This is a bug in Zod.");let D=(w)=>{let O=$.seen.get(w),N=O.def??O.schema,X={...N};if(O.ref===null)return;let G=O.ref;if(O.ref=null,G){D(G);let Q=$.seen.get(G).schema;if(Q.$ref&&($.target==="draft-07"||$.target==="draft-04"||$.target==="openapi-3.0"))N.allOf=N.allOf??[],N.allOf.push(Q);else Object.assign(N,Q),Object.assign(N,X)}if(!O.isParent)$.override({zodSchema:w,jsonSchema:N,path:O.path??[]})};for(let w of[...$.seen.entries()].reverse())D(w[0]);let b={};if($.target==="draft-2020-12")b.$schema="https://json-schema.org/draft/2020-12/schema";else if($.target==="draft-07")b.$schema="http://json-schema.org/draft-07/schema#";else if($.target==="draft-04")b.$schema="http://json-schema.org/draft-04/schema#";else if($.target==="openapi-3.0");if($.external?.uri){let w=$.external.registry.get(I)?.id;if(!w)throw new Error("Schema is missing an `id` property");b.$id=$.external.uri(w)}Object.assign(b,U.def??U.schema);let A=$.external?.defs??{};for(let w of $.seen.entries()){let O=w[1];if(O.def&&O.defId)A[O.defId]=O.def}if($.external);else if(Object.keys(A).length>0)if($.target==="draft-2020-12")b.$defs=A;else b.definitions=A;try{let w=JSON.parse(JSON.stringify(b));return Object.defineProperty(w,"~standard",{value:{...I["~standard"],jsonSchema:{input:RI(I,"input"),output:RI(I,"output")}},enumerable:!1,writable:!1}),w}catch(w){throw new Error("Error converting schema to JSON.")}}function y$($,I){let U=I??{seen:new Set};if(U.seen.has($))return!1;U.seen.add($);let D=$._zod.def;if(D.type==="transform")return!0;if(D.type==="array")return y$(D.element,U);if(D.type==="set")return y$(D.valueType,U);if(D.type==="lazy")return y$(D.getter(),U);if(D.type==="promise"||D.type==="optional"||D.type==="nonoptional"||D.type==="nullable"||D.type==="readonly"||D.type==="default"||D.type==="prefault")return y$(D.innerType,U);if(D.type==="intersection")return y$(D.left,U)||y$(D.right,U);if(D.type==="record"||D.type==="map")return y$(D.keyType,U)||y$(D.valueType,U);if(D.type==="pipe")return y$(D.in,U)||y$(D.out,U);if(D.type==="object"){for(let b in D.shape)if(y$(D.shape[b],U))return!0;return!1}if(D.type==="union"){for(let b of D.options)if(y$(b,U))return!0;return!1}if(D.type==="tuple"){for(let b of D.items)if(y$(b,U))return!0;if(D.rest&&y$(D.rest,U))return!0;return!1}return!1}var QW=($,I={})=>(U)=>{let D=O4({...U,processors:I});return O$($,D),N4(D,$),X4(D,$)},RI=($,I)=>(U)=>{let{libraryOptions:D,target:b}=U??{},A=O4({...D??{},target:b,io:I,processors:{}});return O$($,A),N4(A,$),X4(A,$)};var xF={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},YW=($,I,U,D)=>{let b=U;b.type="string";let{minimum:A,maximum:w,format:O,patterns:N,contentEncoding:X}=$._zod.bag;if(typeof A==="number")b.minLength=A;if(typeof w==="number")b.maxLength=w;if(O){if(b.format=xF[O]??O,b.format==="")delete b.format}if(X)b.contentEncoding=X;if(N&&N.size>0){let G=[...N];if(G.length===1)b.pattern=G[0].source;else if(G.length>1)b.allOf=[...G.map((Q)=>({...I.target==="draft-07"||I.target==="draft-04"||I.target==="openapi-3.0"?{type:"string"}:{},pattern:Q.source}))]}},vW=($,I,U,D)=>{let b=U,{minimum:A,maximum:w,format:O,multipleOf:N,exclusiveMaximum:X,exclusiveMinimum:G}=$._zod.bag;if(typeof O==="string"&&O.includes("int"))b.type="integer";else b.type="number";if(typeof G==="number")if(I.target==="draft-04"||I.target==="openapi-3.0")b.minimum=G,b.exclusiveMinimum=!0;else b.exclusiveMinimum=G;if(typeof A==="number"){if(b.minimum=A,typeof G==="number"&&I.target!=="draft-04")if(G>=A)delete b.minimum;else delete b.exclusiveMinimum}if(typeof X==="number")if(I.target==="draft-04"||I.target==="openapi-3.0")b.maximum=X,b.exclusiveMaximum=!0;else b.exclusiveMaximum=X;if(typeof w==="number"){if(b.maximum=w,typeof X==="number"&&I.target!=="draft-04")if(X<=w)delete b.maximum;else delete b.exclusiveMaximum}if(typeof N==="number")b.multipleOf=N},BW=($,I,U,D)=>{U.type="boolean"},LW=($,I,U,D)=>{if(I.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},JW=($,I,U,D)=>{if(I.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},HW=($,I,U,D)=>{if(I.target==="openapi-3.0")U.type="string",U.nullable=!0,U.enum=[null];else U.type="null"},MW=($,I,U,D)=>{if(I.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},VW=($,I,U,D)=>{if(I.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},KW=($,I,U,D)=>{U.not={}},zW=($,I,U,D)=>{},FW=($,I,U,D)=>{},kW=($,I,U,D)=>{if(I.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},qW=($,I,U,D)=>{let b=$._zod.def,A=fU(b.entries);if(A.every((w)=>typeof w==="number"))U.type="number";if(A.every((w)=>typeof w==="string"))U.type="string";U.enum=A},EW=($,I,U,D)=>{let b=$._zod.def,A=[];for(let w of b.values)if(w===void 0){if(I.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof w==="bigint")if(I.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");else A.push(Number(w));else A.push(w);if(A.length===0);else if(A.length===1){let w=A[0];if(U.type=w===null?"null":typeof w,I.target==="draft-04"||I.target==="openapi-3.0")U.enum=[w];else U.const=w}else{if(A.every((w)=>typeof w==="number"))U.type="number";if(A.every((w)=>typeof w==="string"))U.type="string";if(A.every((w)=>typeof w==="boolean"))U.type="boolean";if(A.every((w)=>w===null))U.type="null";U.enum=A}},SW=($,I,U,D)=>{if(I.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},jW=($,I,U,D)=>{let b=U,A=$._zod.pattern;if(!A)throw new Error("Pattern not found in template literal");b.type="string",b.pattern=A.source},PW=($,I,U,D)=>{let b=U,A={type:"string",format:"binary",contentEncoding:"binary"},{minimum:w,maximum:O,mime:N}=$._zod.bag;if(w!==void 0)A.minLength=w;if(O!==void 0)A.maxLength=O;if(N)if(N.length===1)A.contentMediaType=N[0],Object.assign(b,A);else b.anyOf=N.map((X)=>{return{...A,contentMediaType:X}});else Object.assign(b,A)},RW=($,I,U,D)=>{U.type="boolean"},TW=($,I,U,D)=>{if(I.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},_W=($,I,U,D)=>{if(I.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},CW=($,I,U,D)=>{if(I.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},fW=($,I,U,D)=>{if(I.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},ZW=($,I,U,D)=>{if(I.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},gW=($,I,U,D)=>{let b=U,A=$._zod.def,{minimum:w,maximum:O}=$._zod.bag;if(typeof w==="number")b.minItems=w;if(typeof O==="number")b.maxItems=O;b.type="array",b.items=O$(A.element,I,{...D,path:[...D.path,"items"]})},yW=($,I,U,D)=>{let b=U,A=$._zod.def;b.type="object",b.properties={};let w=A.shape;for(let X in w)b.properties[X]=O$(w[X],I,{...D,path:[...D.path,"properties",X]});let O=new Set(Object.keys(w)),N=new Set([...O].filter((X)=>{let G=A.shape[X]._zod;if(I.io==="input")return G.optin===void 0;else return G.optout===void 0}));if(N.size>0)b.required=Array.from(N);if(A.catchall?._zod.def.type==="never")b.additionalProperties=!1;else if(!A.catchall){if(I.io==="output")b.additionalProperties=!1}else if(A.catchall)b.additionalProperties=O$(A.catchall,I,{...D,path:[...D.path,"additionalProperties"]})},Jw=($,I,U,D)=>{let b=$._zod.def,A=b.inclusive===!1,w=b.options.map((O,N)=>O$(O,I,{...D,path:[...D.path,A?"oneOf":"anyOf",N]}));if(A)U.oneOf=w;else U.anyOf=w},xW=($,I,U,D)=>{let b=$._zod.def,A=O$(b.left,I,{...D,path:[...D.path,"allOf",0]}),w=O$(b.right,I,{...D,path:[...D.path,"allOf",1]}),O=(X)=>("allOf"in X)&&Object.keys(X).length===1,N=[...O(A)?A.allOf:[A],...O(w)?w.allOf:[w]];U.allOf=N},lW=($,I,U,D)=>{let b=U,A=$._zod.def;b.type="array";let w=I.target==="draft-2020-12"?"prefixItems":"items",O=I.target==="draft-2020-12"?"items":I.target==="openapi-3.0"?"items":"additionalItems",N=A.items.map((Y,v)=>O$(Y,I,{...D,path:[...D.path,w,v]})),X=A.rest?O$(A.rest,I,{...D,path:[...D.path,O,...I.target==="openapi-3.0"?[A.items.length]:[]]}):null;if(I.target==="draft-2020-12"){if(b.prefixItems=N,X)b.items=X}else if(I.target==="openapi-3.0"){if(b.items={anyOf:N},X)b.items.anyOf.push(X);if(b.minItems=N.length,!X)b.maxItems=N.length}else if(b.items=N,X)b.additionalItems=X;let{minimum:G,maximum:Q}=$._zod.bag;if(typeof G==="number")b.minItems=G;if(typeof Q==="number")b.maxItems=Q},hW=($,I,U,D)=>{let b=U,A=$._zod.def;if(b.type="object",I.target==="draft-07"||I.target==="draft-2020-12")b.propertyNames=O$(A.keyType,I,{...D,path:[...D.path,"propertyNames"]});b.additionalProperties=O$(A.valueType,I,{...D,path:[...D.path,"additionalProperties"]})},uW=($,I,U,D)=>{let b=$._zod.def,A=O$(b.innerType,I,D),w=I.seen.get($);if(I.target==="openapi-3.0")w.ref=b.innerType,U.nullable=!0;else U.anyOf=[A,{type:"null"}]},iW=($,I,U,D)=>{let b=$._zod.def;O$(b.innerType,I,D);let A=I.seen.get($);A.ref=b.innerType},nW=($,I,U,D)=>{let b=$._zod.def;O$(b.innerType,I,D);let A=I.seen.get($);A.ref=b.innerType,U.default=JSON.parse(JSON.stringify(b.defaultValue))},rW=($,I,U,D)=>{let b=$._zod.def;O$(b.innerType,I,D);let A=I.seen.get($);if(A.ref=b.innerType,I.io==="input")U._prefault=JSON.parse(JSON.stringify(b.defaultValue))},cW=($,I,U,D)=>{let b=$._zod.def;O$(b.innerType,I,D);let A=I.seen.get($);A.ref=b.innerType;let w;try{w=b.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}U.default=w},mW=($,I,U,D)=>{let b=$._zod.def,A=I.io==="input"?b.in._zod.def.type==="transform"?b.out:b.in:b.out;O$(A,I,D);let w=I.seen.get($);w.ref=A},oW=($,I,U,D)=>{let b=$._zod.def;O$(b.innerType,I,D);let A=I.seen.get($);A.ref=b.innerType,U.readOnly=!0},dW=($,I,U,D)=>{let b=$._zod.def;O$(b.innerType,I,D);let A=I.seen.get($);A.ref=b.innerType},pW=($,I,U,D)=>{let b=$._zod.def;O$(b.innerType,I,D);let A=I.seen.get($);A.ref=b.innerType},tW=($,I,U,D)=>{let b=$._zod.innerType;O$(b,I,D);let A=I.seen.get($);A.ref=b},Lw={string:YW,number:vW,boolean:BW,bigint:LW,symbol:JW,null:HW,undefined:MW,void:VW,never:KW,any:zW,unknown:FW,date:kW,enum:qW,literal:EW,nan:SW,template_literal:jW,file:PW,success:RW,custom:TW,function:_W,transform:CW,map:fW,set:ZW,array:gW,object:yW,union:Jw,intersection:xW,tuple:lW,record:hW,nullable:uW,nonoptional:iW,default:nW,prefault:rW,catch:cW,pipe:mW,readonly:oW,promise:dW,optional:pW,lazy:tW};function l4($,I){if("_idmap"in $){let D=$,b=O4({...I,processors:Lw}),A={};for(let N of D._idmap.entries()){let[X,G]=N;O$(G,b)}let w={},O={registry:D,uri:I?.uri,defs:A};b.external=O;for(let N of D._idmap.entries()){let[X,G]=N;N4(b,G),w[X]=X4(b,G)}if(Object.keys(A).length>0){let N=b.target==="draft-2020-12"?"$defs":"definitions";w.__shared={[N]:A}}return{schemas:w}}let U=O4({...I,processors:Lw});return O$($,U),N4(U,$),X4(U,$)}class aW{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter($){this.ctx.counter=$}get seen(){return this.ctx.seen}constructor($){let I=$?.target??"draft-2020-12";if(I==="draft-4")I="draft-04";if(I==="draft-7")I="draft-07";this.ctx=O4({processors:Lw,target:I,...$?.metadata&&{metadata:$.metadata},...$?.unrepresentable&&{unrepresentable:$.unrepresentable},...$?.override&&{override:$.override},...$?.io&&{io:$.io}})}process($,I={path:[],schemaPath:[]}){return O$($,this.ctx,I)}emit($,I){if(I){if(I.cycles)this.ctx.cycles=I.cycles;if(I.reused)this.ctx.reused=I.reused;if(I.external)this.ctx.external=I.external}N4(this.ctx,$);let U=X4(this.ctx,$),{"~standard":D,...b}=U;return b}}var uv={};var uF=B("ZodMiniType",($,I)=>{if(!$._zod)throw new Error("Uninitialized schema in ZodMiniType.");n.init($,I),$.def=I,$.type=I.type,$.parse=(U,D)=>_4($,U,D,{callee:$.parse}),$.safeParse=(U,D)=>U4($,U,D),$.parseAsync=async(U,D)=>C4($,U,D,{callee:$.parseAsync}),$.safeParseAsync=async(U,D)=>b4($,U,D),$.check=(...U)=>{return $.clone({...I,checks:[...I.checks??[],...U.map((D)=>typeof D==="function"?{_zod:{check:D,def:{check:"custom"},onattach:[]}}:D)]})},$.clone=(U,D)=>q$($,U,D),$.brand=()=>$,$.register=(U,D)=>{return U.add($,D),$}});var iF=B("ZodMiniObject",($,I)=>{WA.init($,I),uF.init($,I),K.defineLazy($,"shape",()=>I.shape)});function eW($,I){let U={type:"object",shape:$??{},...K.normalizeParams(I)};return new iF(U)}function $6($){return!!$._zod}function h4($){let I=Object.values($);if(I.length===0)return eW({});let U=I.every($6),D=I.every((b)=>!$6(b));if(U)return eW($);if(D)return $v($);throw new Error("Mixed Zod versions detected in object shape.")}function W4($,I){if($6($))return U4($,I);return $.safeParse(I)}async function Hw($,I){if($6($))return await b4($,I);return await $.safeParseAsync(I)}function G4($){if(!$)return;let I;if($6($))I=$._zod?.def?.shape;else I=$.shape;if(!I)return;if(typeof I==="function")try{return I()}catch{return}return I}function TI($){if(!$)return;if(typeof $==="object"){let I=$,U=$;if(!I._def&&!U._zod){let D=Object.values($);if(D.length>0&&D.every((b)=>typeof b==="object"&&b!==null&&(b._def!==void 0||b._zod!==void 0||typeof b.parse==="function")))return h4($)}}if($6($)){let U=$._zod?.def;if(U&&(U.type==="object"||U.shape!==void 0))return $}else if($.shape!==void 0)return $;return}function Mw($){if($&&typeof $==="object"){if("message"in $&&typeof $.message==="string")return $.message;if("issues"in $&&Array.isArray($.issues)&&$.issues.length>0){let I=$.issues[0];if(I&&typeof I==="object"&&"message"in I)return String(I.message)}try{return JSON.stringify($)}catch{return String($)}}return String($)}function iv($){return $.description}function nv($){if($6($))return $._zod?.def?.type==="optional";let I=$;if(typeof $.isOptional==="function")return $.isOptional();return I._def?.typeName==="ZodOptional"}function Vw($){if($6($)){let A=$._zod?.def;if(A){if(A.value!==void 0)return A.value;if(Array.isArray(A.values)&&A.values.length>0)return A.values[0]}}let U=$._def;if(U){if(U.value!==void 0)return U.value;if(Array.isArray(U.values)&&U.values.length>0)return U.values[0]}let D=$.value;if(D!==void 0)return D;return}var W={};f6(W,{xor:()=>CB,xid:()=>DB,void:()=>PB,uuidv7:()=>tv,uuidv6:()=>pv,uuidv4:()=>dv,uuid:()=>ov,util:()=>K,url:()=>av,uppercase:()=>VI,unknown:()=>G$,union:()=>Q$,undefined:()=>SB,ulid:()=>bB,uint64:()=>qB,uint32:()=>zB,tuple:()=>jG,trim:()=>EI,treeifyError:()=>AN,transform:()=>mw,toUpperCase:()=>jI,toLowerCase:()=>SI,toJSONSchema:()=>l4,templateLiteral:()=>rB,symbol:()=>EB,superRefine:()=>eG,success:()=>uB,stringbool:()=>aB,stringFormat:()=>BB,string:()=>J,strictObject:()=>_B,startsWith:()=>zI,slugify:()=>PI,size:()=>JI,setErrorMap:()=>oF,set:()=>yB,safeParseAsync:()=>wG,safeParse:()=>AG,safeEncodeAsync:()=>YG,safeEncode:()=>GG,safeDecodeAsync:()=>vG,safeDecode:()=>QG,registry:()=>gA,regexes:()=>t$,regex:()=>HI,refine:()=>aG,record:()=>N$,readonly:()=>cG,property:()=>Nw,promise:()=>cB,prettifyError:()=>wN,preprocess:()=>R1,prefault:()=>xG,positive:()=>Dw,pipe:()=>K1,partialRecord:()=>fB,parseAsync:()=>DG,parse:()=>bG,overwrite:()=>w6,optional:()=>v$,object:()=>_,number:()=>D$,nullish:()=>hB,nullable:()=>V1,null:()=>F1,normalize:()=>qI,nonpositive:()=>ww,nonoptional:()=>lG,nonnegative:()=>Ow,never:()=>cw,negative:()=>Aw,nativeEnum:()=>xB,nanoid:()=>$B,nan:()=>iB,multipleOf:()=>A4,minSize:()=>w4,minLength:()=>h6,mime:()=>kI,meta:()=>pB,maxSize:()=>Z4,maxLength:()=>g4,map:()=>gB,mac:()=>OB,lte:()=>a$,lt:()=>k6,lowercase:()=>MI,looseRecord:()=>ZB,looseObject:()=>E$,locales:()=>vI,literal:()=>f,length:()=>y4,lazy:()=>dG,ksuid:()=>AB,keyof:()=>TB,jwt:()=>vB,json:()=>eB,iso:()=>Q4,ipv6:()=>NB,ipv4:()=>wB,intersection:()=>xI,int64:()=>kB,int32:()=>KB,int:()=>Ew,instanceof:()=>tB,includes:()=>KI,httpUrl:()=>ev,hostname:()=>LB,hex:()=>JB,hash:()=>HB,guid:()=>mv,gte:()=>g$,gt:()=>q6,globalRegistry:()=>Z$,getErrorMap:()=>dF,function:()=>mB,fromJSONSchema:()=>$7,formatError:()=>uU,float64:()=>VB,float32:()=>MB,flattenError:()=>hU,file:()=>lB,enum:()=>S$,endsWith:()=>FI,encodeAsync:()=>XG,encode:()=>OG,emoji:()=>sv,email:()=>cv,e164:()=>YB,discriminatedUnion:()=>S1,describe:()=>dB,decodeAsync:()=>WG,decode:()=>NG,date:()=>RB,custom:()=>tw,cuid2:()=>UB,cuid:()=>IB,core:()=>O6,config:()=>M$,coerce:()=>$9,codec:()=>nB,clone:()=>q$,cidrv6:()=>WB,cidrv4:()=>XB,check:()=>oB,catch:()=>iG,boolean:()=>V$,bigint:()=>FB,base64url:()=>QB,base64:()=>GB,array:()=>p,any:()=>jB,_function:()=>mB,_default:()=>gG,_ZodString:()=>Sw,ZodXor:()=>kG,ZodXID:()=>fw,ZodVoid:()=>zG,ZodUnknown:()=>VG,ZodUnion:()=>E1,ZodUndefined:()=>JG,ZodUUID:()=>E6,ZodURL:()=>z1,ZodULID:()=>Cw,ZodType:()=>m,ZodTuple:()=>SG,ZodTransform:()=>CG,ZodTemplateLiteral:()=>mG,ZodSymbol:()=>LG,ZodSuccess:()=>hG,ZodStringFormat:()=>W$,ZodString:()=>CI,ZodSet:()=>RG,ZodRecord:()=>j1,ZodRealError:()=>n$,ZodReadonly:()=>rG,ZodPromise:()=>pG,ZodPrefault:()=>yG,ZodPipe:()=>dw,ZodOptional:()=>lI,ZodObject:()=>q1,ZodNumberFormat:()=>u4,ZodNumber:()=>ZI,ZodNullable:()=>fG,ZodNull:()=>HG,ZodNonOptional:()=>ow,ZodNever:()=>KG,ZodNanoID:()=>Rw,ZodNaN:()=>nG,ZodMap:()=>PG,ZodMAC:()=>BG,ZodLiteral:()=>TG,ZodLazy:()=>oG,ZodKSUID:()=>Zw,ZodJWT:()=>nw,ZodIssueCode:()=>mF,ZodIntersection:()=>EG,ZodISOTime:()=>kw,ZodISODuration:()=>qw,ZodISODateTime:()=>zw,ZodISODate:()=>Fw,ZodIPv6:()=>yw,ZodIPv4:()=>gw,ZodGUID:()=>M1,ZodFunction:()=>tG,ZodFirstPartyTypeKind:()=>sG,ZodFile:()=>_G,ZodError:()=>rF,ZodEnum:()=>_I,ZodEmoji:()=>Pw,ZodEmail:()=>jw,ZodE164:()=>iw,ZodDiscriminatedUnion:()=>qG,ZodDefault:()=>ZG,ZodDate:()=>k1,ZodCustomStringFormat:()=>fI,ZodCustom:()=>P1,ZodCodec:()=>pw,ZodCatch:()=>uG,ZodCUID2:()=>_w,ZodCUID:()=>Tw,ZodCIDRv6:()=>lw,ZodCIDRv4:()=>xw,ZodBoolean:()=>gI,ZodBigIntFormat:()=>rw,ZodBigInt:()=>yI,ZodBase64URL:()=>uw,ZodBase64:()=>hw,ZodArray:()=>FG,ZodAny:()=>MG,TimePrecision:()=>UW,NEVER:()=>d0,$output:()=>eX,$input:()=>sX,$brand:()=>p0});var H1={};f6(H1,{xor:()=>CB,xid:()=>DB,void:()=>PB,uuidv7:()=>tv,uuidv6:()=>pv,uuidv4:()=>dv,uuid:()=>ov,url:()=>av,unknown:()=>G$,union:()=>Q$,undefined:()=>SB,ulid:()=>bB,uint64:()=>qB,uint32:()=>zB,tuple:()=>jG,transform:()=>mw,templateLiteral:()=>rB,symbol:()=>EB,superRefine:()=>eG,success:()=>uB,stringbool:()=>aB,stringFormat:()=>BB,string:()=>J,strictObject:()=>_B,set:()=>yB,refine:()=>aG,record:()=>N$,readonly:()=>cG,promise:()=>cB,preprocess:()=>R1,prefault:()=>xG,pipe:()=>K1,partialRecord:()=>fB,optional:()=>v$,object:()=>_,number:()=>D$,nullish:()=>hB,nullable:()=>V1,null:()=>F1,nonoptional:()=>lG,never:()=>cw,nativeEnum:()=>xB,nanoid:()=>$B,nan:()=>iB,meta:()=>pB,map:()=>gB,mac:()=>OB,looseRecord:()=>ZB,looseObject:()=>E$,literal:()=>f,lazy:()=>dG,ksuid:()=>AB,keyof:()=>TB,jwt:()=>vB,json:()=>eB,ipv6:()=>NB,ipv4:()=>wB,intersection:()=>xI,int64:()=>kB,int32:()=>KB,int:()=>Ew,instanceof:()=>tB,httpUrl:()=>ev,hostname:()=>LB,hex:()=>JB,hash:()=>HB,guid:()=>mv,function:()=>mB,float64:()=>VB,float32:()=>MB,file:()=>lB,enum:()=>S$,emoji:()=>sv,email:()=>cv,e164:()=>YB,discriminatedUnion:()=>S1,describe:()=>dB,date:()=>RB,custom:()=>tw,cuid2:()=>UB,cuid:()=>IB,codec:()=>nB,cidrv6:()=>WB,cidrv4:()=>XB,check:()=>oB,catch:()=>iG,boolean:()=>V$,bigint:()=>FB,base64url:()=>QB,base64:()=>GB,array:()=>p,any:()=>jB,_function:()=>mB,_default:()=>gG,_ZodString:()=>Sw,ZodXor:()=>kG,ZodXID:()=>fw,ZodVoid:()=>zG,ZodUnknown:()=>VG,ZodUnion:()=>E1,ZodUndefined:()=>JG,ZodUUID:()=>E6,ZodURL:()=>z1,ZodULID:()=>Cw,ZodType:()=>m,ZodTuple:()=>SG,ZodTransform:()=>CG,ZodTemplateLiteral:()=>mG,ZodSymbol:()=>LG,ZodSuccess:()=>hG,ZodStringFormat:()=>W$,ZodString:()=>CI,ZodSet:()=>RG,ZodRecord:()=>j1,ZodReadonly:()=>rG,ZodPromise:()=>pG,ZodPrefault:()=>yG,ZodPipe:()=>dw,ZodOptional:()=>lI,ZodObject:()=>q1,ZodNumberFormat:()=>u4,ZodNumber:()=>ZI,ZodNullable:()=>fG,ZodNull:()=>HG,ZodNonOptional:()=>ow,ZodNever:()=>KG,ZodNanoID:()=>Rw,ZodNaN:()=>nG,ZodMap:()=>PG,ZodMAC:()=>BG,ZodLiteral:()=>TG,ZodLazy:()=>oG,ZodKSUID:()=>Zw,ZodJWT:()=>nw,ZodIntersection:()=>EG,ZodIPv6:()=>yw,ZodIPv4:()=>gw,ZodGUID:()=>M1,ZodFunction:()=>tG,ZodFile:()=>_G,ZodEnum:()=>_I,ZodEmoji:()=>Pw,ZodEmail:()=>jw,ZodE164:()=>iw,ZodDiscriminatedUnion:()=>qG,ZodDefault:()=>ZG,ZodDate:()=>k1,ZodCustomStringFormat:()=>fI,ZodCustom:()=>P1,ZodCodec:()=>pw,ZodCatch:()=>uG,ZodCUID2:()=>_w,ZodCUID:()=>Tw,ZodCIDRv6:()=>lw,ZodCIDRv4:()=>xw,ZodBoolean:()=>gI,ZodBigIntFormat:()=>rw,ZodBigInt:()=>yI,ZodBase64URL:()=>uw,ZodBase64:()=>hw,ZodArray:()=>FG,ZodAny:()=>MG});var Kw={};f6(Kw,{uppercase:()=>VI,trim:()=>EI,toUpperCase:()=>jI,toLowerCase:()=>SI,startsWith:()=>zI,slugify:()=>PI,size:()=>JI,regex:()=>HI,property:()=>Nw,positive:()=>Dw,overwrite:()=>w6,normalize:()=>qI,nonpositive:()=>ww,nonnegative:()=>Ow,negative:()=>Aw,multipleOf:()=>A4,minSize:()=>w4,minLength:()=>h6,mime:()=>kI,maxSize:()=>Z4,maxLength:()=>g4,lte:()=>a$,lt:()=>k6,lowercase:()=>MI,length:()=>y4,includes:()=>KI,gte:()=>g$,gt:()=>q6,endsWith:()=>FI});var Q4={};f6(Q4,{time:()=>IG,duration:()=>UG,datetime:()=>sW,date:()=>$G,ZodISOTime:()=>kw,ZodISODuration:()=>qw,ZodISODateTime:()=>zw,ZodISODate:()=>Fw});var zw=B("ZodISODateTime",($,I)=>{UX.init($,I),W$.init($,I)});function sW($){return bW(zw,$)}var Fw=B("ZodISODate",($,I)=>{bX.init($,I),W$.init($,I)});function $G($){return DW(Fw,$)}var kw=B("ZodISOTime",($,I)=>{DX.init($,I),W$.init($,I)});function IG($){return AW(kw,$)}var qw=B("ZodISODuration",($,I)=>{AX.init($,I),W$.init($,I)});function UG($){return wW(qw,$)}var rv=($,I)=>{lU.init($,I),$.name="ZodError",Object.defineProperties($,{format:{value:(U)=>uU($,U)},flatten:{value:(U)=>hU($,U)},addIssue:{value:(U)=>{$.issues.push(U),$.message=JSON.stringify($.issues,bI,2)}},addIssues:{value:(U)=>{$.issues.push(...U),$.message=JSON.stringify($.issues,bI,2)}},isEmpty:{get(){return $.issues.length===0}}})},rF=B("ZodError",rv),n$=B("ZodError",rv,{Parent:Error});var bG=wI(n$),DG=OI(n$),AG=NI(n$),wG=XI(n$),OG=BD(n$),NG=LD(n$),XG=JD(n$),WG=HD(n$),GG=MD(n$),QG=VD(n$),YG=KD(n$),vG=zD(n$);var m=B("ZodType",($,I)=>{return n.init($,I),Object.assign($["~standard"],{jsonSchema:{input:RI($,"input"),output:RI($,"output")}}),$.toJSONSchema=QW($,{}),$.def=I,$.type=I.type,Object.defineProperty($,"_def",{value:I}),$.check=(...U)=>{return $.clone(K.mergeDefs(I,{checks:[...I.checks??[],...U.map((D)=>typeof D==="function"?{_zod:{check:D,def:{check:"custom"},onattach:[]}}:D)]}))},$.clone=(U,D)=>q$($,U,D),$.brand=()=>$,$.register=(U,D)=>{return U.add($,D),$},$.parse=(U,D)=>bG($,U,D,{callee:$.parse}),$.safeParse=(U,D)=>AG($,U,D),$.parseAsync=async(U,D)=>DG($,U,D,{callee:$.parseAsync}),$.safeParseAsync=async(U,D)=>wG($,U,D),$.spa=$.safeParseAsync,$.encode=(U,D)=>OG($,U,D),$.decode=(U,D)=>NG($,U,D),$.encodeAsync=async(U,D)=>XG($,U,D),$.decodeAsync=async(U,D)=>WG($,U,D),$.safeEncode=(U,D)=>GG($,U,D),$.safeDecode=(U,D)=>QG($,U,D),$.safeEncodeAsync=async(U,D)=>YG($,U,D),$.safeDecodeAsync=async(U,D)=>vG($,U,D),$.refine=(U,D)=>$.check(aG(U,D)),$.superRefine=(U)=>$.check(eG(U)),$.overwrite=(U)=>$.check(w6(U)),$.optional=()=>v$($),$.nullable=()=>V1($),$.nullish=()=>v$(V1($)),$.nonoptional=(U)=>lG($,U),$.array=()=>p($),$.or=(U)=>Q$([$,U]),$.and=(U)=>xI($,U),$.transform=(U)=>K1($,mw(U)),$.default=(U)=>gG($,U),$.prefault=(U)=>xG($,U),$.catch=(U)=>iG($,U),$.pipe=(U)=>K1($,U),$.readonly=()=>cG($),$.describe=(U)=>{let D=$.clone();return Z$.add(D,{description:U}),D},Object.defineProperty($,"description",{get(){return Z$.get($)?.description},configurable:!0}),$.meta=(...U)=>{if(U.length===0)return Z$.get($);let D=$.clone();return Z$.add(D,U[0]),D},$.isOptional=()=>$.safeParse(void 0).success,$.isNullable=()=>$.safeParse(null).success,$}),Sw=B("_ZodString",($,I)=>{D4.init($,I),m.init($,I),$._zod.processJSONSchema=(D,b,A)=>YW($,D,b,A);let U=$._zod.bag;$.format=U.format??null,$.minLength=U.minimum??null,$.maxLength=U.maximum??null,$.regex=(...D)=>$.check(HI(...D)),$.includes=(...D)=>$.check(KI(...D)),$.startsWith=(...D)=>$.check(zI(...D)),$.endsWith=(...D)=>$.check(FI(...D)),$.min=(...D)=>$.check(h6(...D)),$.max=(...D)=>$.check(g4(...D)),$.length=(...D)=>$.check(y4(...D)),$.nonempty=(...D)=>$.check(h6(1,...D)),$.lowercase=(D)=>$.check(MI(D)),$.uppercase=(D)=>$.check(VI(D)),$.trim=()=>$.check(EI()),$.normalize=(...D)=>$.check(qI(...D)),$.toLowerCase=()=>$.check(SI()),$.toUpperCase=()=>$.check(jI()),$.slugify=()=>$.check(PI())}),CI=B("ZodString",($,I)=>{D4.init($,I),Sw.init($,I),$.email=(U)=>$.check(eU(jw,U)),$.url=(U)=>$.check(LI(z1,U)),$.jwt=(U)=>$.check(J1(nw,U)),$.emoji=(U)=>$.check(b1(Pw,U)),$.guid=(U)=>$.check(BI(M1,U)),$.uuid=(U)=>$.check(sU(E6,U)),$.uuidv4=(U)=>$.check($1(E6,U)),$.uuidv6=(U)=>$.check(I1(E6,U)),$.uuidv7=(U)=>$.check(U1(E6,U)),$.nanoid=(U)=>$.check(D1(Rw,U)),$.guid=(U)=>$.check(BI(M1,U)),$.cuid=(U)=>$.check(A1(Tw,U)),$.cuid2=(U)=>$.check(w1(_w,U)),$.ulid=(U)=>$.check(O1(Cw,U)),$.base64=(U)=>$.check(v1(hw,U)),$.base64url=(U)=>$.check(B1(uw,U)),$.xid=(U)=>$.check(N1(fw,U)),$.ksuid=(U)=>$.check(X1(Zw,U)),$.ipv4=(U)=>$.check(W1(gw,U)),$.ipv6=(U)=>$.check(G1(yw,U)),$.cidrv4=(U)=>$.check(Q1(xw,U)),$.cidrv6=(U)=>$.check(Y1(lw,U)),$.e164=(U)=>$.check(L1(iw,U)),$.datetime=(U)=>$.check(sW(U)),$.date=(U)=>$.check($G(U)),$.time=(U)=>$.check(IG(U)),$.duration=(U)=>$.check(UG(U))});function J($){return yA(CI,$)}var W$=B("ZodStringFormat",($,I)=>{w$.init($,I),Sw.init($,I)}),jw=B("ZodEmail",($,I)=>{fD.init($,I),W$.init($,I)});function cv($){return eU(jw,$)}var M1=B("ZodGUID",($,I)=>{_D.init($,I),W$.init($,I)});function mv($){return BI(M1,$)}var E6=B("ZodUUID",($,I)=>{CD.init($,I),W$.init($,I)});function ov($){return sU(E6,$)}function dv($){return $1(E6,$)}function pv($){return I1(E6,$)}function tv($){return U1(E6,$)}var z1=B("ZodURL",($,I)=>{ZD.init($,I),W$.init($,I)});function av($){return LI(z1,$)}function ev($){return LI(z1,{protocol:/^https?$/,hostname:t$.domain,...K.normalizeParams($)})}var Pw=B("ZodEmoji",($,I)=>{gD.init($,I),W$.init($,I)});function sv($){return b1(Pw,$)}var Rw=B("ZodNanoID",($,I)=>{yD.init($,I),W$.init($,I)});function $B($){return D1(Rw,$)}var Tw=B("ZodCUID",($,I)=>{xD.init($,I),W$.init($,I)});function IB($){return A1(Tw,$)}var _w=B("ZodCUID2",($,I)=>{lD.init($,I),W$.init($,I)});function UB($){return w1(_w,$)}var Cw=B("ZodULID",($,I)=>{hD.init($,I),W$.init($,I)});function bB($){return O1(Cw,$)}var fw=B("ZodXID",($,I)=>{uD.init($,I),W$.init($,I)});function DB($){return N1(fw,$)}var Zw=B("ZodKSUID",($,I)=>{iD.init($,I),W$.init($,I)});function AB($){return X1(Zw,$)}var gw=B("ZodIPv4",($,I)=>{nD.init($,I),W$.init($,I)});function wB($){return W1(gw,$)}var BG=B("ZodMAC",($,I)=>{cD.init($,I),W$.init($,I)});function OB($){return xA(BG,$)}var yw=B("ZodIPv6",($,I)=>{rD.init($,I),W$.init($,I)});function NB($){return G1(yw,$)}var xw=B("ZodCIDRv4",($,I)=>{mD.init($,I),W$.init($,I)});function XB($){return Q1(xw,$)}var lw=B("ZodCIDRv6",($,I)=>{oD.init($,I),W$.init($,I)});function WB($){return Y1(lw,$)}var hw=B("ZodBase64",($,I)=>{dD.init($,I),W$.init($,I)});function GB($){return v1(hw,$)}var uw=B("ZodBase64URL",($,I)=>{pD.init($,I),W$.init($,I)});function QB($){return B1(uw,$)}var iw=B("ZodE164",($,I)=>{tD.init($,I),W$.init($,I)});function YB($){return L1(iw,$)}var nw=B("ZodJWT",($,I)=>{aD.init($,I),W$.init($,I)});function vB($){return J1(nw,$)}var fI=B("ZodCustomStringFormat",($,I)=>{eD.init($,I),W$.init($,I)});function BB($,I,U={}){return x4(fI,$,I,U)}function LB($){return x4(fI,"hostname",t$.hostname,$)}function JB($){return x4(fI,"hex",t$.hex,$)}function HB($,I){let U=I?.enc??"hex",D=`${$}_${U}`,b=t$[D];if(!b)throw new Error(`Unrecognized hash format: ${D}`);return x4(fI,D,b,I)}var ZI=B("ZodNumber",($,I)=>{rU.init($,I),m.init($,I),$._zod.processJSONSchema=(D,b,A)=>vW($,D,b,A),$.gt=(D,b)=>$.check(q6(D,b)),$.gte=(D,b)=>$.check(g$(D,b)),$.min=(D,b)=>$.check(g$(D,b)),$.lt=(D,b)=>$.check(k6(D,b)),$.lte=(D,b)=>$.check(a$(D,b)),$.max=(D,b)=>$.check(a$(D,b)),$.int=(D)=>$.check(Ew(D)),$.safe=(D)=>$.check(Ew(D)),$.positive=(D)=>$.check(q6(0,D)),$.nonnegative=(D)=>$.check(g$(0,D)),$.negative=(D)=>$.check(k6(0,D)),$.nonpositive=(D)=>$.check(a$(0,D)),$.multipleOf=(D,b)=>$.check(A4(D,b)),$.step=(D,b)=>$.check(A4(D,b)),$.finite=()=>$;let U=$._zod.bag;$.minValue=Math.max(U.minimum??Number.NEGATIVE_INFINITY,U.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,$.maxValue=Math.min(U.maximum??Number.POSITIVE_INFINITY,U.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,$.isInt=(U.format??"").includes("int")||Number.isSafeInteger(U.multipleOf??0.5),$.isFinite=!0,$.format=U.format??null});function D$($){return lA(ZI,$)}var u4=B("ZodNumberFormat",($,I)=>{sD.init($,I),ZI.init($,I)});function Ew($){return hA(u4,$)}function MB($){return uA(u4,$)}function VB($){return iA(u4,$)}function KB($){return nA(u4,$)}function zB($){return rA(u4,$)}var gI=B("ZodBoolean",($,I)=>{GI.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>BW($,U,D,b)});function V$($){return cA(gI,$)}var yI=B("ZodBigInt",($,I)=>{cU.init($,I),m.init($,I),$._zod.processJSONSchema=(D,b,A)=>LW($,D,b,A),$.gte=(D,b)=>$.check(g$(D,b)),$.min=(D,b)=>$.check(g$(D,b)),$.gt=(D,b)=>$.check(q6(D,b)),$.gte=(D,b)=>$.check(g$(D,b)),$.min=(D,b)=>$.check(g$(D,b)),$.lt=(D,b)=>$.check(k6(D,b)),$.lte=(D,b)=>$.check(a$(D,b)),$.max=(D,b)=>$.check(a$(D,b)),$.positive=(D)=>$.check(q6(BigInt(0),D)),$.negative=(D)=>$.check(k6(BigInt(0),D)),$.nonpositive=(D)=>$.check(a$(BigInt(0),D)),$.nonnegative=(D)=>$.check(g$(BigInt(0),D)),$.multipleOf=(D,b)=>$.check(A4(D,b));let U=$._zod.bag;$.minValue=U.minimum??null,$.maxValue=U.maximum??null,$.format=U.format??null});function FB($){return mA(yI,$)}var rw=B("ZodBigIntFormat",($,I)=>{$A.init($,I),yI.init($,I)});function kB($){return oA(rw,$)}function qB($){return dA(rw,$)}var LG=B("ZodSymbol",($,I)=>{IA.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>JW($,U,D,b)});function EB($){return pA(LG,$)}var JG=B("ZodUndefined",($,I)=>{UA.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>MW($,U,D,b)});function SB($){return tA(JG,$)}var HG=B("ZodNull",($,I)=>{bA.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>HW($,U,D,b)});function F1($){return aA(HG,$)}var MG=B("ZodAny",($,I)=>{DA.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>zW($,U,D,b)});function jB(){return eA(MG)}var VG=B("ZodUnknown",($,I)=>{AA.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>FW($,U,D,b)});function G$(){return sA(VG)}var KG=B("ZodNever",($,I)=>{wA.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>KW($,U,D,b)});function cw($){return $w(KG,$)}var zG=B("ZodVoid",($,I)=>{OA.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>VW($,U,D,b)});function PB($){return Iw(zG,$)}var k1=B("ZodDate",($,I)=>{NA.init($,I),m.init($,I),$._zod.processJSONSchema=(D,b,A)=>kW($,D,b,A),$.min=(D,b)=>$.check(g$(D,b)),$.max=(D,b)=>$.check(a$(D,b));let U=$._zod.bag;$.minDate=U.minimum?new Date(U.minimum):null,$.maxDate=U.maximum?new Date(U.maximum):null});function RB($){return Uw(k1,$)}var FG=B("ZodArray",($,I)=>{XA.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>gW($,U,D,b),$.element=I.element,$.min=(U,D)=>$.check(h6(U,D)),$.nonempty=(U)=>$.check(h6(1,U)),$.max=(U,D)=>$.check(g4(U,D)),$.length=(U,D)=>$.check(y4(U,D)),$.unwrap=()=>$.element});function p($,I){return GW(FG,$,I)}function TB($){let I=$._zod.def.shape;return S$(Object.keys(I))}var q1=B("ZodObject",($,I)=>{OX.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>yW($,U,D,b),K.defineLazy($,"shape",()=>{return I.shape}),$.keyof=()=>S$(Object.keys($._zod.def.shape)),$.catchall=(U)=>$.clone({...$._zod.def,catchall:U}),$.passthrough=()=>$.clone({...$._zod.def,catchall:G$()}),$.loose=()=>$.clone({...$._zod.def,catchall:G$()}),$.strict=()=>$.clone({...$._zod.def,catchall:cw()}),$.strip=()=>$.clone({...$._zod.def,catchall:void 0}),$.extend=(U)=>{return K.extend($,U)},$.safeExtend=(U)=>{return K.safeExtend($,U)},$.merge=(U)=>K.merge($,U),$.pick=(U)=>K.pick($,U),$.omit=(U)=>K.omit($,U),$.partial=(...U)=>K.partial(lI,$,U[0]),$.required=(...U)=>K.required(ow,$,U[0])});function _($,I){let U={type:"object",shape:$??{},...K.normalizeParams(I)};return new q1(U)}function _B($,I){return new q1({type:"object",shape:$,catchall:cw(),...K.normalizeParams(I)})}function E$($,I){return new q1({type:"object",shape:$,catchall:G$(),...K.normalizeParams(I)})}var E1=B("ZodUnion",($,I)=>{QI.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>Jw($,U,D,b),$.options=I.options});function Q$($,I){return new E1({type:"union",options:$,...K.normalizeParams(I)})}var kG=B("ZodXor",($,I)=>{E1.init($,I),GA.init($,I),$._zod.processJSONSchema=(U,D,b)=>Jw($,U,D,b),$.options=I.options});function CB($,I){return new kG({type:"union",options:$,inclusive:!1,...K.normalizeParams(I)})}var qG=B("ZodDiscriminatedUnion",($,I)=>{E1.init($,I),QA.init($,I)});function S1($,I,U){return new qG({type:"union",options:I,discriminator:$,...K.normalizeParams(U)})}var EG=B("ZodIntersection",($,I)=>{YA.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>xW($,U,D,b)});function xI($,I){return new EG({type:"intersection",left:$,right:I})}var SG=B("ZodTuple",($,I)=>{mU.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>lW($,U,D,b),$.rest=(U)=>$.clone({...$._zod.def,rest:U})});function jG($,I,U){let D=I instanceof n,b=D?U:I;return new SG({type:"tuple",items:$,rest:D?I:null,...K.normalizeParams(b)})}var j1=B("ZodRecord",($,I)=>{vA.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>hW($,U,D,b),$.keyType=I.keyType,$.valueType=I.valueType});function N$($,I,U){return new j1({type:"record",keyType:$,valueType:I,...K.normalizeParams(U)})}function fB($,I,U){let D=q$($);return D._zod.values=void 0,new j1({type:"record",keyType:D,valueType:I,...K.normalizeParams(U)})}function ZB($,I,U){return new j1({type:"record",keyType:$,valueType:I,mode:"loose",...K.normalizeParams(U)})}var PG=B("ZodMap",($,I)=>{BA.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>fW($,U,D,b),$.keyType=I.keyType,$.valueType=I.valueType});function gB($,I,U){return new PG({type:"map",keyType:$,valueType:I,...K.normalizeParams(U)})}var RG=B("ZodSet",($,I)=>{LA.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>ZW($,U,D,b),$.min=(...U)=>$.check(w4(...U)),$.nonempty=(U)=>$.check(w4(1,U)),$.max=(...U)=>$.check(Z4(...U)),$.size=(...U)=>$.check(JI(...U))});function yB($,I){return new RG({type:"set",valueType:$,...K.normalizeParams(I)})}var _I=B("ZodEnum",($,I)=>{JA.init($,I),m.init($,I),$._zod.processJSONSchema=(D,b,A)=>qW($,D,b,A),$.enum=I.entries,$.options=Object.values(I.entries);let U=new Set(Object.keys(I.entries));$.extract=(D,b)=>{let A={};for(let w of D)if(U.has(w))A[w]=I.entries[w];else throw new Error(`Key ${w} not found in enum`);return new _I({...I,checks:[],...K.normalizeParams(b),entries:A})},$.exclude=(D,b)=>{let A={...I.entries};for(let w of D)if(U.has(w))delete A[w];else throw new Error(`Key ${w} not found in enum`);return new _I({...I,checks:[],...K.normalizeParams(b),entries:A})}});function S$($,I){let U=Array.isArray($)?Object.fromEntries($.map((D)=>[D,D])):$;return new _I({type:"enum",entries:U,...K.normalizeParams(I)})}function xB($,I){return new _I({type:"enum",entries:$,...K.normalizeParams(I)})}var TG=B("ZodLiteral",($,I)=>{HA.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>EW($,U,D,b),$.values=new Set(I.values),Object.defineProperty($,"value",{get(){if(I.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return I.values[0]}})});function f($,I){return new TG({type:"literal",values:Array.isArray($)?$:[$],...K.normalizeParams(I)})}var _G=B("ZodFile",($,I)=>{MA.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>PW($,U,D,b),$.min=(U,D)=>$.check(w4(U,D)),$.max=(U,D)=>$.check(Z4(U,D)),$.mime=(U,D)=>$.check(kI(Array.isArray(U)?U:[U],D))});function lB($){return Xw(_G,$)}var CG=B("ZodTransform",($,I)=>{VA.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>CW($,U,D,b),$._zod.parse=(U,D)=>{if(D.direction==="backward")throw new R4($.constructor.name);U.addIssue=(A)=>{if(typeof A==="string")U.issues.push(K.issue(A,U.value,I));else{let w=A;if(w.fatal)w.continue=!1;w.code??(w.code="custom"),w.input??(w.input=U.value),w.inst??(w.inst=$),U.issues.push(K.issue(w))}};let b=I.transform(U.value,U);if(b instanceof Promise)return b.then((A)=>{return U.value=A,U});return U.value=b,U}});function mw($){return new CG({type:"transform",transform:$})}var lI=B("ZodOptional",($,I)=>{KA.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>pW($,U,D,b),$.unwrap=()=>$._zod.def.innerType});function v$($){return new lI({type:"optional",innerType:$})}var fG=B("ZodNullable",($,I)=>{zA.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>uW($,U,D,b),$.unwrap=()=>$._zod.def.innerType});function V1($){return new fG({type:"nullable",innerType:$})}function hB($){return v$(V1($))}var ZG=B("ZodDefault",($,I)=>{FA.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>nW($,U,D,b),$.unwrap=()=>$._zod.def.innerType,$.removeDefault=$.unwrap});function gG($,I){return new ZG({type:"default",innerType:$,get defaultValue(){return typeof I==="function"?I():K.shallowClone(I)}})}var yG=B("ZodPrefault",($,I)=>{kA.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>rW($,U,D,b),$.unwrap=()=>$._zod.def.innerType});function xG($,I){return new yG({type:"prefault",innerType:$,get defaultValue(){return typeof I==="function"?I():K.shallowClone(I)}})}var ow=B("ZodNonOptional",($,I)=>{qA.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>iW($,U,D,b),$.unwrap=()=>$._zod.def.innerType});function lG($,I){return new ow({type:"nonoptional",innerType:$,...K.normalizeParams(I)})}var hG=B("ZodSuccess",($,I)=>{EA.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>RW($,U,D,b),$.unwrap=()=>$._zod.def.innerType});function uB($){return new hG({type:"success",innerType:$})}var uG=B("ZodCatch",($,I)=>{SA.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>cW($,U,D,b),$.unwrap=()=>$._zod.def.innerType,$.removeCatch=$.unwrap});function iG($,I){return new uG({type:"catch",innerType:$,catchValue:typeof I==="function"?I:()=>I})}var nG=B("ZodNaN",($,I)=>{jA.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>SW($,U,D,b)});function iB($){return bw(nG,$)}var dw=B("ZodPipe",($,I)=>{PA.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>mW($,U,D,b),$.in=I.in,$.out=I.out});function K1($,I){return new dw({type:"pipe",in:$,out:I})}var pw=B("ZodCodec",($,I)=>{dw.init($,I),YI.init($,I)});function nB($,I,U){return new pw({type:"pipe",in:$,out:I,transform:U.decode,reverseTransform:U.encode})}var rG=B("ZodReadonly",($,I)=>{RA.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>oW($,U,D,b),$.unwrap=()=>$._zod.def.innerType});function cG($){return new rG({type:"readonly",innerType:$})}var mG=B("ZodTemplateLiteral",($,I)=>{TA.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>jW($,U,D,b)});function rB($,I){return new mG({type:"template_literal",parts:$,...K.normalizeParams(I)})}var oG=B("ZodLazy",($,I)=>{fA.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>tW($,U,D,b),$.unwrap=()=>$._zod.def.getter()});function dG($){return new oG({type:"lazy",getter:$})}var pG=B("ZodPromise",($,I)=>{CA.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>dW($,U,D,b),$.unwrap=()=>$._zod.def.innerType});function cB($){return new pG({type:"promise",innerType:$})}var tG=B("ZodFunction",($,I)=>{_A.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>_W($,U,D,b)});function mB($){return new tG({type:"function",input:Array.isArray($?.input)?jG($?.input):$?.input??p(G$()),output:$?.output??G$()})}var P1=B("ZodCustom",($,I)=>{ZA.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>TW($,U,D,b)});function oB($){let I=new X$({check:"custom"});return I._zod.check=$,I}function tw($,I){return Ww(P1,$??(()=>!0),I)}function aG($,I={}){return Gw(P1,$,I)}function eG($){return Qw($)}var dB=Yw,pB=vw;function tB($,I={error:`Input not instance of ${$.name}`}){let U=new P1({type:"custom",check:"custom",fn:(D)=>D instanceof $,abort:!0,...K.normalizeParams(I)});return U._zod.bag.Class=$,U}var aB=(...$)=>Bw({Codec:pw,Boolean:gI,String:CI},...$);function eB($){let I=dG(()=>{return Q$([J($),D$(),V$(),F1(),p(I),N$(J(),I)])});return I}function R1($,I){return K1(mw($),I)}var mF={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function oF($){M$({customError:$})}function dF(){return M$().customError}var sG;(function($){})(sG||(sG={}));var R={...H1,...Kw,iso:Q4};function pF($,I){let U=$.$schema;if(U==="https://json-schema.org/draft/2020-12/schema")return"draft-2020-12";if(U==="http://json-schema.org/draft-07/schema#")return"draft-7";if(U==="http://json-schema.org/draft-04/schema#")return"draft-4";return I??"draft-2020-12"}function tF($,I){if(!$.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let U=$.slice(1).split("/").filter(Boolean);if(U.length===0)return I.rootSchema;let D=I.version==="draft-2020-12"?"$defs":"definitions";if(U[0]===D){let b=U[1];if(!b||!I.defs[b])throw new Error(`Reference not found: ${$}`);return I.defs[b]}throw new Error(`Reference not found: ${$}`)}function sB($,I){if($.not!==void 0){if(typeof $.not==="object"&&Object.keys($.not).length===0)return R.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if($.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if($.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if($.if!==void 0||$.then!==void 0||$.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if($.dependentSchemas!==void 0||$.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if($.$ref){let b=$.$ref;if(I.refs.has(b))return I.refs.get(b);if(I.processing.has(b))return R.lazy(()=>{if(!I.refs.has(b))throw new Error(`Circular reference not resolved: ${b}`);return I.refs.get(b)});I.processing.add(b);let A=tF(b,I),w=_$(A,I);return I.refs.set(b,w),I.processing.delete(b),w}if($.enum!==void 0){let b=$.enum;if(I.version==="openapi-3.0"&&$.nullable===!0&&b.length===1&&b[0]===null)return R.null();if(b.length===0)return R.never();if(b.length===1)return R.literal(b[0]);if(b.every((w)=>typeof w==="string"))return R.enum(b);let A=b.map((w)=>R.literal(w));if(A.length<2)return A[0];return R.union([A[0],A[1],...A.slice(2)])}if($.const!==void 0)return R.literal($.const);let U=$.type;if(Array.isArray(U)){let b=U.map((A)=>{let w={...$,type:A};return sB(w,I)});if(b.length===0)return R.never();if(b.length===1)return b[0];return R.union(b)}if(!U)return R.any();let D;switch(U){case"string":{let b=R.string();if($.format){let A=$.format;if(A==="email")b=b.check(R.email());else if(A==="uri"||A==="uri-reference")b=b.check(R.url());else if(A==="uuid"||A==="guid")b=b.check(R.uuid());else if(A==="date-time")b=b.check(R.iso.datetime());else if(A==="date")b=b.check(R.iso.date());else if(A==="time")b=b.check(R.iso.time());else if(A==="duration")b=b.check(R.iso.duration());else if(A==="ipv4")b=b.check(R.ipv4());else if(A==="ipv6")b=b.check(R.ipv6());else if(A==="mac")b=b.check(R.mac());else if(A==="cidr")b=b.check(R.cidrv4());else if(A==="cidr-v6")b=b.check(R.cidrv6());else if(A==="base64")b=b.check(R.base64());else if(A==="base64url")b=b.check(R.base64url());else if(A==="e164")b=b.check(R.e164());else if(A==="jwt")b=b.check(R.jwt());else if(A==="emoji")b=b.check(R.emoji());else if(A==="nanoid")b=b.check(R.nanoid());else if(A==="cuid")b=b.check(R.cuid());else if(A==="cuid2")b=b.check(R.cuid2());else if(A==="ulid")b=b.check(R.ulid());else if(A==="xid")b=b.check(R.xid());else if(A==="ksuid")b=b.check(R.ksuid())}if(typeof $.minLength==="number")b=b.min($.minLength);if(typeof $.maxLength==="number")b=b.max($.maxLength);if($.pattern)b=b.regex(new RegExp($.pattern));D=b;break}case"number":case"integer":{let b=U==="integer"?R.number().int():R.number();if(typeof $.minimum==="number")b=b.min($.minimum);if(typeof $.maximum==="number")b=b.max($.maximum);if(typeof $.exclusiveMinimum==="number")b=b.gt($.exclusiveMinimum);else if($.exclusiveMinimum===!0&&typeof $.minimum==="number")b=b.gt($.minimum);if(typeof $.exclusiveMaximum==="number")b=b.lt($.exclusiveMaximum);else if($.exclusiveMaximum===!0&&typeof $.maximum==="number")b=b.lt($.maximum);if(typeof $.multipleOf==="number")b=b.multipleOf($.multipleOf);D=b;break}case"boolean":{D=R.boolean();break}case"null":{D=R.null();break}case"object":{let b={},A=$.properties||{},w=new Set($.required||[]);for(let[N,X]of Object.entries(A)){let G=_$(X,I);b[N]=w.has(N)?G:G.optional()}if($.propertyNames){let N=_$($.propertyNames,I),X=$.additionalProperties&&typeof $.additionalProperties==="object"?_$($.additionalProperties,I):R.any();if(Object.keys(b).length===0){D=R.record(N,X);break}let G=R.object(b).passthrough(),Q=R.looseRecord(N,X);D=R.intersection(G,Q);break}if($.patternProperties){let N=$.patternProperties,X=Object.keys(N),G=[];for(let Y of X){let v=_$(N[Y],I),L=R.string().regex(new RegExp(Y));G.push(R.looseRecord(L,v))}let Q=[];if(Object.keys(b).length>0)Q.push(R.object(b).passthrough());if(Q.push(...G),Q.length===0)D=R.object({}).passthrough();else if(Q.length===1)D=Q[0];else{let Y=R.intersection(Q[0],Q[1]);for(let v=2;v<Q.length;v++)Y=R.intersection(Y,Q[v]);D=Y}break}let O=R.object(b);if($.additionalProperties===!1)D=O.strict();else if(typeof $.additionalProperties==="object")D=O.catchall(_$($.additionalProperties,I));else D=O.passthrough();break}case"array":{let{prefixItems:b,items:A}=$;if(b&&Array.isArray(b)){let w=b.map((N)=>_$(N,I)),O=A&&typeof A==="object"&&!Array.isArray(A)?_$(A,I):void 0;if(O)D=R.tuple(w).rest(O);else D=R.tuple(w);if(typeof $.minItems==="number")D=D.check(R.minLength($.minItems));if(typeof $.maxItems==="number")D=D.check(R.maxLength($.maxItems))}else if(Array.isArray(A)){let w=A.map((N)=>_$(N,I)),O=$.additionalItems&&typeof $.additionalItems==="object"?_$($.additionalItems,I):void 0;if(O)D=R.tuple(w).rest(O);else D=R.tuple(w);if(typeof $.minItems==="number")D=D.check(R.minLength($.minItems));if(typeof $.maxItems==="number")D=D.check(R.maxLength($.maxItems))}else if(A!==void 0){let w=_$(A,I),O=R.array(w);if(typeof $.minItems==="number")O=O.min($.minItems);if(typeof $.maxItems==="number")O=O.max($.maxItems);D=O}else D=R.array(R.any());break}default:throw new Error(`Unsupported type: ${U}`)}if($.description)D=D.describe($.description);if($.default!==void 0)D=D.default($.default);return D}function _$($,I){if(typeof $==="boolean")return $?R.any():R.never();let U=sB($,I),D=$.type||$.enum!==void 0||$.const!==void 0;if($.anyOf&&Array.isArray($.anyOf)){let b=$.anyOf.map((w)=>_$(w,I)),A=R.union(b);U=D?R.intersection(U,A):A}if($.oneOf&&Array.isArray($.oneOf)){let b=$.oneOf.map((w)=>_$(w,I)),A=R.xor(b);U=D?R.intersection(U,A):A}if($.allOf&&Array.isArray($.allOf))if($.allOf.length===0)U=D?U:R.any();else{let b=D?U:_$($.allOf[0],I),A=D?0:1;for(let w=A;w<$.allOf.length;w++)b=R.intersection(b,_$($.allOf[w],I));U=b}if($.nullable===!0&&I.version==="openapi-3.0")U=R.nullable(U);if($.readOnly===!0)U=R.readonly(U);return U}function $7($,I){if(typeof $==="boolean")return $?R.any():R.never();let U=pF($,I?.defaultTarget),D=$.$defs||$.definitions||{};return _$($,{version:U,defs:D,refs:new Map,processing:new Set,rootSchema:$})}var $9={};f6($9,{string:()=>aF,number:()=>eF,date:()=>Ik,boolean:()=>sF,bigint:()=>$k});function aF($){return IW(CI,$)}function eF($){return OW(ZI,$)}function sF($){return NW(gI,$)}function $k($){return XW(yI,$)}function Ik($){return WW(k1,$)}M$(oU());var I9="2025-11-25";var I7=[I9,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],Y4="io.modelcontextprotocol/related-task",ew="2.0",F$=tw(($)=>$!==null&&(typeof $==="object"||typeof $==="function")),U7=Q$([J(),D$().int()]),b7=J(),Al=E$({ttl:D$().optional(),pollInterval:D$().optional()}),Uk=_({ttl:D$().optional()}),bk=_({taskId:J()}),U9=E$({progressToken:U7.optional(),[Y4]:bk.optional()}),e$=_({_meta:U9.optional()}),T1=e$.extend({task:Uk.optional()}),D7=($)=>T1.safeParse($).success,j$=_({method:J(),params:e$.loose().optional()}),I6=_({_meta:U9.optional()}),U6=_({method:J(),params:I6.loose().optional()}),P$=E$({_meta:U9.optional()}),sw=Q$([J(),D$().int()]),A7=_({jsonrpc:f(ew),id:sw,...j$.shape}).strict(),b9=($)=>A7.safeParse($).success,w7=_({jsonrpc:f(ew),...U6.shape}).strict(),O7=($)=>w7.safeParse($).success,D9=_({jsonrpc:f(ew),id:sw,result:P$}).strict(),_1=($)=>D9.safeParse($).success;var l;(function($){$[$.ConnectionClosed=-32000]="ConnectionClosed",$[$.RequestTimeout=-32001]="RequestTimeout",$[$.ParseError=-32700]="ParseError",$[$.InvalidRequest=-32600]="InvalidRequest",$[$.MethodNotFound=-32601]="MethodNotFound",$[$.InvalidParams=-32602]="InvalidParams",$[$.InternalError=-32603]="InternalError",$[$.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(l||(l={}));var A9=_({jsonrpc:f(ew),id:sw.optional(),error:_({code:D$().int(),message:J(),data:G$().optional()})}).strict();var N7=($)=>A9.safeParse($).success;var X7=Q$([A7,w7,D9,A9]),wl=Q$([D9,A9]),$O=P$.strict(),Dk=I6.extend({requestId:sw.optional(),reason:J().optional()}),IO=U6.extend({method:f("notifications/cancelled"),params:Dk}),Ak=_({src:J(),mimeType:J().optional(),sizes:p(J()).optional(),theme:S$(["light","dark"]).optional()}),C1=_({icons:p(Ak).optional()}),hI=_({name:J(),title:J().optional()}),W7=hI.extend({...hI.shape,...C1.shape,version:J(),websiteUrl:J().optional(),description:J().optional()}),wk=xI(_({applyDefaults:V$().optional()}),N$(J(),G$())),Ok=R1(($)=>{if($&&typeof $==="object"&&!Array.isArray($)){if(Object.keys($).length===0)return{form:{}}}return $},xI(_({form:wk.optional(),url:F$.optional()}),N$(J(),G$()).optional())),Nk=E$({list:F$.optional(),cancel:F$.optional(),requests:E$({sampling:E$({createMessage:F$.optional()}).optional(),elicitation:E$({create:F$.optional()}).optional()}).optional()}),Xk=E$({list:F$.optional(),cancel:F$.optional(),requests:E$({tools:E$({call:F$.optional()}).optional()}).optional()}),Wk=_({experimental:N$(J(),F$).optional(),sampling:_({context:F$.optional(),tools:F$.optional()}).optional(),elicitation:Ok.optional(),roots:_({listChanged:V$().optional()}).optional(),tasks:Nk.optional(),extensions:N$(J(),F$).optional()}),Gk=e$.extend({protocolVersion:J(),capabilities:Wk,clientInfo:W7}),w9=j$.extend({method:f("initialize"),params:Gk});var Qk=_({experimental:N$(J(),F$).optional(),logging:F$.optional(),completions:F$.optional(),prompts:_({listChanged:V$().optional()}).optional(),resources:_({subscribe:V$().optional(),listChanged:V$().optional()}).optional(),tools:_({listChanged:V$().optional()}).optional(),tasks:Xk.optional(),extensions:N$(J(),F$).optional()}),Yk=P$.extend({protocolVersion:J(),capabilities:Qk,serverInfo:W7,instructions:J().optional()}),O9=U6.extend({method:f("notifications/initialized"),params:I6.optional()});var UO=j$.extend({method:f("ping"),params:e$.optional()}),vk=_({progress:D$(),total:v$(D$()),message:v$(J())}),Bk=_({...I6.shape,...vk.shape,progressToken:U7}),bO=U6.extend({method:f("notifications/progress"),params:Bk}),Lk=e$.extend({cursor:b7.optional()}),f1=j$.extend({params:Lk.optional()}),Z1=P$.extend({nextCursor:b7.optional()}),Jk=S$(["working","input_required","completed","failed","cancelled"]),g1=_({taskId:J(),status:Jk,ttl:Q$([D$(),F1()]),createdAt:J(),lastUpdatedAt:J(),pollInterval:v$(D$()),statusMessage:v$(J())}),uI=P$.extend({task:g1}),Hk=I6.merge(g1),y1=U6.extend({method:f("notifications/tasks/status"),params:Hk}),DO=j$.extend({method:f("tasks/get"),params:e$.extend({taskId:J()})}),AO=P$.merge(g1),wO=j$.extend({method:f("tasks/result"),params:e$.extend({taskId:J()})}),Ol=P$.loose(),OO=f1.extend({method:f("tasks/list")}),NO=Z1.extend({tasks:p(g1)}),XO=j$.extend({method:f("tasks/cancel"),params:e$.extend({taskId:J()})}),G7=P$.merge(g1),Q7=_({uri:J(),mimeType:v$(J()),_meta:N$(J(),G$()).optional()}),Y7=Q7.extend({text:J()}),N9=J().refine(($)=>{try{return atob($),!0}catch{return!1}},{message:"Invalid Base64 string"}),v7=Q7.extend({blob:N9}),x1=S$(["user","assistant"]),iI=_({audience:p(x1).optional(),priority:D$().min(0).max(1).optional(),lastModified:Q4.datetime({offset:!0}).optional()}),B7=_({...hI.shape,...C1.shape,uri:J(),description:v$(J()),mimeType:v$(J()),size:v$(D$()),annotations:iI.optional(),_meta:v$(E$({}))}),Mk=_({...hI.shape,...C1.shape,uriTemplate:J(),description:v$(J()),mimeType:v$(J()),annotations:iI.optional(),_meta:v$(E$({}))}),WO=f1.extend({method:f("resources/list")}),Vk=Z1.extend({resources:p(B7)}),GO=f1.extend({method:f("resources/templates/list")}),Kk=Z1.extend({resourceTemplates:p(Mk)}),X9=e$.extend({uri:J()}),zk=X9,QO=j$.extend({method:f("resources/read"),params:zk}),Fk=P$.extend({contents:p(Q$([Y7,v7]))}),kk=U6.extend({method:f("notifications/resources/list_changed"),params:I6.optional()}),qk=X9,Ek=j$.extend({method:f("resources/subscribe"),params:qk}),Sk=X9,jk=j$.extend({method:f("resources/unsubscribe"),params:Sk}),Pk=I6.extend({uri:J()}),Rk=U6.extend({method:f("notifications/resources/updated"),params:Pk}),Tk=_({name:J(),description:v$(J()),required:v$(V$())}),_k=_({...hI.shape,...C1.shape,description:v$(J()),arguments:v$(p(Tk)),_meta:v$(E$({}))}),YO=f1.extend({method:f("prompts/list")}),Ck=Z1.extend({prompts:p(_k)}),fk=e$.extend({name:J(),arguments:N$(J(),J()).optional()}),vO=j$.extend({method:f("prompts/get"),params:fk}),W9=_({type:f("text"),text:J(),annotations:iI.optional(),_meta:N$(J(),G$()).optional()}),G9=_({type:f("image"),data:N9,mimeType:J(),annotations:iI.optional(),_meta:N$(J(),G$()).optional()}),Q9=_({type:f("audio"),data:N9,mimeType:J(),annotations:iI.optional(),_meta:N$(J(),G$()).optional()}),Zk=_({type:f("tool_use"),name:J(),id:J(),input:N$(J(),G$()),_meta:N$(J(),G$()).optional()}),gk=_({type:f("resource"),resource:Q$([Y7,v7]),annotations:iI.optional(),_meta:N$(J(),G$()).optional()}),yk=B7.extend({type:f("resource_link")}),Y9=Q$([W9,G9,Q9,yk,gk]),xk=_({role:x1,content:Y9}),lk=P$.extend({description:J().optional(),messages:p(xk)}),hk=U6.extend({method:f("notifications/prompts/list_changed"),params:I6.optional()}),uk=_({title:J().optional(),readOnlyHint:V$().optional(),destructiveHint:V$().optional(),idempotentHint:V$().optional(),openWorldHint:V$().optional()}),ik=_({taskSupport:S$(["required","optional","forbidden"]).optional()}),L7=_({...hI.shape,...C1.shape,description:J().optional(),inputSchema:_({type:f("object"),properties:N$(J(),F$).optional(),required:p(J()).optional()}).catchall(G$()),outputSchema:_({type:f("object"),properties:N$(J(),F$).optional(),required:p(J()).optional()}).catchall(G$()).optional(),annotations:uk.optional(),execution:ik.optional(),_meta:N$(J(),G$()).optional()}),BO=f1.extend({method:f("tools/list")}),nk=Z1.extend({tools:p(L7)}),LO=P$.extend({content:p(Y9).default([]),structuredContent:N$(J(),G$()).optional(),isError:V$().optional()}),Nl=LO.or(P$.extend({toolResult:G$()})),rk=T1.extend({name:J(),arguments:N$(J(),G$()).optional()}),nI=j$.extend({method:f("tools/call"),params:rk}),ck=U6.extend({method:f("notifications/tools/list_changed"),params:I6.optional()}),Xl=_({autoRefresh:V$().default(!0),debounceMs:D$().int().nonnegative().default(300)}),l1=S$(["debug","info","notice","warning","error","critical","alert","emergency"]),mk=e$.extend({level:l1}),v9=j$.extend({method:f("logging/setLevel"),params:mk}),ok=I6.extend({level:l1,logger:J().optional(),data:G$()}),dk=U6.extend({method:f("notifications/message"),params:ok}),pk=_({name:J().optional()}),tk=_({hints:p(pk).optional(),costPriority:D$().min(0).max(1).optional(),speedPriority:D$().min(0).max(1).optional(),intelligencePriority:D$().min(0).max(1).optional()}),ak=_({mode:S$(["auto","required","none"]).optional()}),ek=_({type:f("tool_result"),toolUseId:J().describe("The unique identifier for the corresponding tool call."),content:p(Y9).default([]),structuredContent:_({}).loose().optional(),isError:V$().optional(),_meta:N$(J(),G$()).optional()}),sk=S1("type",[W9,G9,Q9]),aw=S1("type",[W9,G9,Q9,Zk,ek]),$q=_({role:x1,content:Q$([aw,p(aw)]),_meta:N$(J(),G$()).optional()}),Iq=T1.extend({messages:p($q),modelPreferences:tk.optional(),systemPrompt:J().optional(),includeContext:S$(["none","thisServer","allServers"]).optional(),temperature:D$().optional(),maxTokens:D$().int(),stopSequences:p(J()).optional(),metadata:F$.optional(),tools:p(L7).optional(),toolChoice:ak.optional()}),Uq=j$.extend({method:f("sampling/createMessage"),params:Iq}),h1=P$.extend({model:J(),stopReason:v$(S$(["endTurn","stopSequence","maxTokens"]).or(J())),role:x1,content:sk}),B9=P$.extend({model:J(),stopReason:v$(S$(["endTurn","stopSequence","maxTokens","toolUse"]).or(J())),role:x1,content:Q$([aw,p(aw)])}),bq=_({type:f("boolean"),title:J().optional(),description:J().optional(),default:V$().optional()}),Dq=_({type:f("string"),title:J().optional(),description:J().optional(),minLength:D$().optional(),maxLength:D$().optional(),format:S$(["email","uri","date","date-time"]).optional(),default:J().optional()}),Aq=_({type:S$(["number","integer"]),title:J().optional(),description:J().optional(),minimum:D$().optional(),maximum:D$().optional(),default:D$().optional()}),wq=_({type:f("string"),title:J().optional(),description:J().optional(),enum:p(J()),default:J().optional()}),Oq=_({type:f("string"),title:J().optional(),description:J().optional(),oneOf:p(_({const:J(),title:J()})),default:J().optional()}),Nq=_({type:f("string"),title:J().optional(),description:J().optional(),enum:p(J()),enumNames:p(J()).optional(),default:J().optional()}),Xq=Q$([wq,Oq]),Wq=_({type:f("array"),title:J().optional(),description:J().optional(),minItems:D$().optional(),maxItems:D$().optional(),items:_({type:f("string"),enum:p(J())}),default:p(J()).optional()}),Gq=_({type:f("array"),title:J().optional(),description:J().optional(),minItems:D$().optional(),maxItems:D$().optional(),items:_({anyOf:p(_({const:J(),title:J()}))}),default:p(J()).optional()}),Qq=Q$([Wq,Gq]),Yq=Q$([Nq,Xq,Qq]),vq=Q$([Yq,bq,Dq,Aq]),Bq=T1.extend({mode:f("form").optional(),message:J(),requestedSchema:_({type:f("object"),properties:N$(J(),vq),required:p(J()).optional()})}),Lq=T1.extend({mode:f("url"),message:J(),elicitationId:J(),url:J().url()}),Jq=Q$([Bq,Lq]),Hq=j$.extend({method:f("elicitation/create"),params:Jq}),Mq=I6.extend({elicitationId:J()}),Vq=U6.extend({method:f("notifications/elicitation/complete"),params:Mq}),rI=P$.extend({action:S$(["accept","decline","cancel"]),content:R1(($)=>$===null?void 0:$,N$(J(),Q$([J(),D$(),V$(),p(J())])).optional())}),Kq=_({type:f("ref/resource"),uri:J()});var zq=_({type:f("ref/prompt"),name:J()}),Fq=e$.extend({ref:Q$([zq,Kq]),argument:_({name:J(),value:J()}),context:_({arguments:N$(J(),J()).optional()}).optional()}),JO=j$.extend({method:f("completion/complete"),params:Fq});function J7($){if($.params.ref.type!=="ref/prompt")throw new TypeError(`Expected CompleteRequestPrompt, but got ${$.params.ref.type}`)}function H7($){if($.params.ref.type!=="ref/resource")throw new TypeError(`Expected CompleteRequestResourceTemplate, but got ${$.params.ref.type}`)}var kq=P$.extend({completion:E$({values:p(J()).max(100),total:v$(D$().int()),hasMore:v$(V$())})}),qq=_({uri:J().startsWith("file://"),name:J().optional(),_meta:N$(J(),G$()).optional()}),Eq=j$.extend({method:f("roots/list"),params:e$.optional()}),L9=P$.extend({roots:p(qq)}),Sq=U6.extend({method:f("notifications/roots/list_changed"),params:I6.optional()}),Wl=Q$([UO,w9,JO,v9,vO,YO,WO,GO,QO,Ek,jk,nI,BO,DO,wO,OO,XO]),Gl=Q$([IO,bO,O9,Sq,y1]),Ql=Q$([$O,h1,B9,rI,L9,AO,NO,uI]),Yl=Q$([UO,Uq,Hq,Eq,DO,wO,OO,XO]),vl=Q$([IO,bO,dk,Rk,kk,ck,hk,y1,Vq]),Bl=Q$([$O,Yk,kq,lk,Ck,Vk,Kk,Fk,LO,nk,AO,NO,uI]);class Z extends Error{constructor($,I,U){super(`MCP error ${$}: ${I}`);this.code=$,this.data=U,this.name="McpError"}static fromError($,I,U){if($===l.UrlElicitationRequired&&U){let D=U;if(D.elicitations)return new M7(D.elicitations,I)}return new Z($,I,U)}}class M7 extends Z{constructor($,I=`URL elicitation${$.length>1?"s":""} required`){super(l.UrlElicitationRequired,I,{elicitations:$})}get elicitations(){return this.data?.elicitations??[]}}function v4($){return $==="completed"||$==="failed"||$==="cancelled"}var K7=Symbol("Let zodToJsonSchema decide on which parser to use");var V7={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref",openAiAnyTypeName:"OpenAiAnyType"},z7=($)=>typeof $==="string"?{...V7,name:$}:{...V7,...$};var F7=($)=>{let I=z7($),U=I.name!==void 0?[...I.basePath,I.definitionPath,I.name]:I.basePath;return{...I,flags:{hasReferencedOpenAiAnyType:!1},currentPath:U,propertyPath:void 0,seen:new Map(Object.entries(I.definitions).map(([D,b])=>[b._def,{def:b._def,path:[...I.basePath,I.definitionPath,D],jsonSchema:void 0}]))}};function J9($,I,U,D){if(!D?.errorMessages)return;if(U)$.errorMessage={...$.errorMessage,[I]:U}}function I$($,I,U,D,b){$[I]=U,J9($,I,D,b)}var HO=($,I)=>{let U=0;for(;U<$.length&&U<I.length;U++)if($[U]!==I[U])break;return[($.length-U).toString(),...I.slice(U)].join("/")};function J$($){if($.target!=="openAi")return{};let I=[...$.basePath,$.definitionPath,$.openAiAnyTypeName];return $.flags.hasReferencedOpenAiAnyType=!0,{$ref:$.$refStrategy==="relative"?HO(I,$.currentPath):I.join("/")}}function k7($,I){let U={type:"array"};if($.type?._def&&$.type?._def?.typeName!==F.ZodAny)U.items=i($.type._def,{...I,currentPath:[...I.currentPath,"items"]});if($.minLength)I$(U,"minItems",$.minLength.value,$.minLength.message,I);if($.maxLength)I$(U,"maxItems",$.maxLength.value,$.maxLength.message,I);if($.exactLength)I$(U,"minItems",$.exactLength.value,$.exactLength.message,I),I$(U,"maxItems",$.exactLength.value,$.exactLength.message,I);return U}function q7($,I){let U={type:"integer",format:"int64"};if(!$.checks)return U;for(let D of $.checks)switch(D.kind){case"min":if(I.target==="jsonSchema7")if(D.inclusive)I$(U,"minimum",D.value,D.message,I);else I$(U,"exclusiveMinimum",D.value,D.message,I);else{if(!D.inclusive)U.exclusiveMinimum=!0;I$(U,"minimum",D.value,D.message,I)}break;case"max":if(I.target==="jsonSchema7")if(D.inclusive)I$(U,"maximum",D.value,D.message,I);else I$(U,"exclusiveMaximum",D.value,D.message,I);else{if(!D.inclusive)U.exclusiveMaximum=!0;I$(U,"maximum",D.value,D.message,I)}break;case"multipleOf":I$(U,"multipleOf",D.value,D.message,I);break}return U}function E7(){return{type:"boolean"}}function MO($,I){return i($.type._def,I)}var S7=($,I)=>{return i($.innerType._def,I)};function H9($,I,U){let D=U??I.dateStrategy;if(Array.isArray(D))return{anyOf:D.map((b,A)=>H9($,I,b))};switch(D){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return jq($,I)}}var jq=($,I)=>{let U={type:"integer",format:"unix-time"};if(I.target==="openApi3")return U;for(let D of $.checks)switch(D.kind){case"min":I$(U,"minimum",D.value,D.message,I);break;case"max":I$(U,"maximum",D.value,D.message,I);break}return U};function j7($,I){return{...i($.innerType._def,I),default:$.defaultValue()}}function P7($,I){return I.effectStrategy==="input"?i($.schema._def,I):J$(I)}function R7($){return{type:"string",enum:Array.from($.values)}}var Pq=($)=>{if("type"in $&&$.type==="string")return!1;return"allOf"in $};function T7($,I){let U=[i($.left._def,{...I,currentPath:[...I.currentPath,"allOf","0"]}),i($.right._def,{...I,currentPath:[...I.currentPath,"allOf","1"]})].filter((A)=>!!A),D=I.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,b=[];return U.forEach((A)=>{if(Pq(A)){if(b.push(...A.allOf),A.unevaluatedProperties===void 0)D=void 0}else{let w=A;if("additionalProperties"in A&&A.additionalProperties===!1){let{additionalProperties:O,...N}=A;w=N}else D=void 0;b.push(w)}}),b.length?{allOf:b,...D}:void 0}function _7($,I){let U=typeof $.value;if(U!=="bigint"&&U!=="number"&&U!=="boolean"&&U!=="string")return{type:Array.isArray($.value)?"array":"object"};if(I.target==="openApi3")return{type:U==="bigint"?"integer":U,enum:[$.value]};return{type:U==="bigint"?"integer":U,const:$.value}}var M9=void 0,N6={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>{if(M9===void 0)M9=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u");return M9},uuid:/^[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}$/,ipv4:/^(?:(?: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])$/,ipv4Cidr:/^(?:(?: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])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([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])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function VO($,I){let U={type:"string"};if($.checks)for(let D of $.checks)switch(D.kind){case"min":I$(U,"minLength",typeof U.minLength==="number"?Math.max(U.minLength,D.value):D.value,D.message,I);break;case"max":I$(U,"maxLength",typeof U.maxLength==="number"?Math.min(U.maxLength,D.value):D.value,D.message,I);break;case"email":switch(I.emailStrategy){case"format:email":X6(U,"email",D.message,I);break;case"format:idn-email":X6(U,"idn-email",D.message,I);break;case"pattern:zod":x$(U,N6.email,D.message,I);break}break;case"url":X6(U,"uri",D.message,I);break;case"uuid":X6(U,"uuid",D.message,I);break;case"regex":x$(U,D.regex,D.message,I);break;case"cuid":x$(U,N6.cuid,D.message,I);break;case"cuid2":x$(U,N6.cuid2,D.message,I);break;case"startsWith":x$(U,RegExp(`^${V9(D.value,I)}`),D.message,I);break;case"endsWith":x$(U,RegExp(`${V9(D.value,I)}$`),D.message,I);break;case"datetime":X6(U,"date-time",D.message,I);break;case"date":X6(U,"date",D.message,I);break;case"time":X6(U,"time",D.message,I);break;case"duration":X6(U,"duration",D.message,I);break;case"length":I$(U,"minLength",typeof U.minLength==="number"?Math.max(U.minLength,D.value):D.value,D.message,I),I$(U,"maxLength",typeof U.maxLength==="number"?Math.min(U.maxLength,D.value):D.value,D.message,I);break;case"includes":{x$(U,RegExp(V9(D.value,I)),D.message,I);break}case"ip":{if(D.version!=="v6")X6(U,"ipv4",D.message,I);if(D.version!=="v4")X6(U,"ipv6",D.message,I);break}case"base64url":x$(U,N6.base64url,D.message,I);break;case"jwt":x$(U,N6.jwt,D.message,I);break;case"cidr":{if(D.version!=="v6")x$(U,N6.ipv4Cidr,D.message,I);if(D.version!=="v4")x$(U,N6.ipv6Cidr,D.message,I);break}case"emoji":x$(U,N6.emoji(),D.message,I);break;case"ulid":{x$(U,N6.ulid,D.message,I);break}case"base64":{switch(I.base64Strategy){case"format:binary":{X6(U,"binary",D.message,I);break}case"contentEncoding:base64":{I$(U,"contentEncoding","base64",D.message,I);break}case"pattern:zod":{x$(U,N6.base64,D.message,I);break}}break}case"nanoid":x$(U,N6.nanoid,D.message,I);case"toLowerCase":case"toUpperCase":case"trim":break;default:((b)=>{})(D)}return U}function V9($,I){return I.patternStrategy==="escape"?Tq($):$}var Rq=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function Tq($){let I="";for(let U=0;U<$.length;U++){if(!Rq.has($[U]))I+="\\";I+=$[U]}return I}function X6($,I,U,D){if($.format||$.anyOf?.some((b)=>b.format)){if(!$.anyOf)$.anyOf=[];if($.format){if($.anyOf.push({format:$.format,...$.errorMessage&&D.errorMessages&&{errorMessage:{format:$.errorMessage.format}}}),delete $.format,$.errorMessage){if(delete $.errorMessage.format,Object.keys($.errorMessage).length===0)delete $.errorMessage}}$.anyOf.push({format:I,...U&&D.errorMessages&&{errorMessage:{format:U}}})}else I$($,"format",I,U,D)}function x$($,I,U,D){if($.pattern||$.allOf?.some((b)=>b.pattern)){if(!$.allOf)$.allOf=[];if($.pattern){if($.allOf.push({pattern:$.pattern,...$.errorMessage&&D.errorMessages&&{errorMessage:{pattern:$.errorMessage.pattern}}}),delete $.pattern,$.errorMessage){if(delete $.errorMessage.pattern,Object.keys($.errorMessage).length===0)delete $.errorMessage}}$.allOf.push({pattern:C7(I,D),...U&&D.errorMessages&&{errorMessage:{pattern:U}}})}else I$($,"pattern",C7(I,D),U,D)}function C7($,I){if(!I.applyRegexFlags||!$.flags)return $.source;let U={i:$.flags.includes("i"),m:$.flags.includes("m"),s:$.flags.includes("s")},D=U.i?$.source.toLowerCase():$.source,b="",A=!1,w=!1,O=!1;for(let N=0;N<D.length;N++){if(A){b+=D[N],A=!1;continue}if(U.i){if(w){if(D[N].match(/[a-z]/)){if(O)b+=D[N],b+=`${D[N-2]}-${D[N]}`.toUpperCase(),O=!1;else if(D[N+1]==="-"&&D[N+2]?.match(/[a-z]/))b+=D[N],O=!0;else b+=`${D[N]}${D[N].toUpperCase()}`;continue}}else if(D[N].match(/[a-z]/)){b+=`[${D[N]}${D[N].toUpperCase()}]`;continue}}if(U.m){if(D[N]==="^"){b+=`(^|(?<=[\r
|
|
32
|
+
]))`;continue}else if(D[N]==="$"){b+=`($|(?=[\r
|
|
33
|
+
]))`;continue}}if(U.s&&D[N]==="."){b+=w?`${D[N]}\r
|
|
34
|
+
`:`[${D[N]}\r
|
|
35
|
+
]`;continue}if(b+=D[N],D[N]==="\\")A=!0;else if(w&&D[N]==="]")w=!1;else if(!w&&D[N]==="[")w=!0}try{new RegExp(b)}catch{return console.warn(`Could not convert regex pattern at ${I.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),$.source}return b}function KO($,I){if(I.target==="openAi")console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead.");if(I.target==="openApi3"&&$.keyType?._def.typeName===F.ZodEnum)return{type:"object",required:$.keyType._def.values,properties:$.keyType._def.values.reduce((D,b)=>({...D,[b]:i($.valueType._def,{...I,currentPath:[...I.currentPath,"properties",b]})??J$(I)}),{}),additionalProperties:I.rejectedAdditionalProperties};let U={type:"object",additionalProperties:i($.valueType._def,{...I,currentPath:[...I.currentPath,"additionalProperties"]})??I.allowedAdditionalProperties};if(I.target==="openApi3")return U;if($.keyType?._def.typeName===F.ZodString&&$.keyType._def.checks?.length){let{type:D,...b}=VO($.keyType._def,I);return{...U,propertyNames:b}}else if($.keyType?._def.typeName===F.ZodEnum)return{...U,propertyNames:{enum:$.keyType._def.values}};else if($.keyType?._def.typeName===F.ZodBranded&&$.keyType._def.type._def.typeName===F.ZodString&&$.keyType._def.type._def.checks?.length){let{type:D,...b}=MO($.keyType._def,I);return{...U,propertyNames:b}}return U}function f7($,I){if(I.mapStrategy==="record")return KO($,I);let U=i($.keyType._def,{...I,currentPath:[...I.currentPath,"items","items","0"]})||J$(I),D=i($.valueType._def,{...I,currentPath:[...I.currentPath,"items","items","1"]})||J$(I);return{type:"array",maxItems:125,items:{type:"array",items:[U,D],minItems:2,maxItems:2}}}function Z7($){let I=$.values,D=Object.keys($.values).filter((A)=>{return typeof I[I[A]]!=="number"}).map((A)=>I[A]),b=Array.from(new Set(D.map((A)=>typeof A)));return{type:b.length===1?b[0]==="string"?"string":"number":["string","number"],enum:D}}function g7($){return $.target==="openAi"?void 0:{not:J$({...$,currentPath:[...$.currentPath,"not"]})}}function y7($){return $.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}var u1={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function l7($,I){if(I.target==="openApi3")return x7($,I);let U=$.options instanceof Map?Array.from($.options.values()):$.options;if(U.every((D)=>(D._def.typeName in u1)&&(!D._def.checks||!D._def.checks.length))){let D=U.reduce((b,A)=>{let w=u1[A._def.typeName];return w&&!b.includes(w)?[...b,w]:b},[]);return{type:D.length>1?D:D[0]}}else if(U.every((D)=>D._def.typeName==="ZodLiteral"&&!D.description)){let D=U.reduce((b,A)=>{let w=typeof A._def.value;switch(w){case"string":case"number":case"boolean":return[...b,w];case"bigint":return[...b,"integer"];case"object":if(A._def.value===null)return[...b,"null"];case"symbol":case"undefined":case"function":default:return b}},[]);if(D.length===U.length){let b=D.filter((A,w,O)=>O.indexOf(A)===w);return{type:b.length>1?b:b[0],enum:U.reduce((A,w)=>{return A.includes(w._def.value)?A:[...A,w._def.value]},[])}}}else if(U.every((D)=>D._def.typeName==="ZodEnum"))return{type:"string",enum:U.reduce((D,b)=>[...D,...b._def.values.filter((A)=>!D.includes(A))],[])};return x7($,I)}var x7=($,I)=>{let U=($.options instanceof Map?Array.from($.options.values()):$.options).map((D,b)=>i(D._def,{...I,currentPath:[...I.currentPath,"anyOf",`${b}`]})).filter((D)=>!!D&&(!I.strictUnions||typeof D==="object"&&Object.keys(D).length>0));return U.length?{anyOf:U}:void 0};function h7($,I){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes($.innerType._def.typeName)&&(!$.innerType._def.checks||!$.innerType._def.checks.length)){if(I.target==="openApi3")return{type:u1[$.innerType._def.typeName],nullable:!0};return{type:[u1[$.innerType._def.typeName],"null"]}}if(I.target==="openApi3"){let D=i($.innerType._def,{...I,currentPath:[...I.currentPath]});if(D&&"$ref"in D)return{allOf:[D],nullable:!0};return D&&{...D,nullable:!0}}let U=i($.innerType._def,{...I,currentPath:[...I.currentPath,"anyOf","0"]});return U&&{anyOf:[U,{type:"null"}]}}function u7($,I){let U={type:"number"};if(!$.checks)return U;for(let D of $.checks)switch(D.kind){case"int":U.type="integer",J9(U,"type",D.message,I);break;case"min":if(I.target==="jsonSchema7")if(D.inclusive)I$(U,"minimum",D.value,D.message,I);else I$(U,"exclusiveMinimum",D.value,D.message,I);else{if(!D.inclusive)U.exclusiveMinimum=!0;I$(U,"minimum",D.value,D.message,I)}break;case"max":if(I.target==="jsonSchema7")if(D.inclusive)I$(U,"maximum",D.value,D.message,I);else I$(U,"exclusiveMaximum",D.value,D.message,I);else{if(!D.inclusive)U.exclusiveMaximum=!0;I$(U,"maximum",D.value,D.message,I)}break;case"multipleOf":I$(U,"multipleOf",D.value,D.message,I);break}return U}function i7($,I){let U=I.target==="openAi",D={type:"object",properties:{}},b=[],A=$.shape();for(let O in A){let N=A[O];if(N===void 0||N._def===void 0)continue;let X=Cq(N);if(X&&U){if(N._def.typeName==="ZodOptional")N=N._def.innerType;if(!N.isNullable())N=N.nullable();X=!1}let G=i(N._def,{...I,currentPath:[...I.currentPath,"properties",O],propertyPath:[...I.currentPath,"properties",O]});if(G===void 0)continue;if(D.properties[O]=G,!X)b.push(O)}if(b.length)D.required=b;let w=_q($,I);if(w!==void 0)D.additionalProperties=w;return D}function _q($,I){if($.catchall._def.typeName!=="ZodNever")return i($.catchall._def,{...I,currentPath:[...I.currentPath,"additionalProperties"]});switch($.unknownKeys){case"passthrough":return I.allowedAdditionalProperties;case"strict":return I.rejectedAdditionalProperties;case"strip":return I.removeAdditionalStrategy==="strict"?I.allowedAdditionalProperties:I.rejectedAdditionalProperties}}function Cq($){try{return $.isOptional()}catch{return!0}}var n7=($,I)=>{if(I.currentPath.toString()===I.propertyPath?.toString())return i($.innerType._def,I);let U=i($.innerType._def,{...I,currentPath:[...I.currentPath,"anyOf","1"]});return U?{anyOf:[{not:J$(I)},U]}:J$(I)};var r7=($,I)=>{if(I.pipeStrategy==="input")return i($.in._def,I);else if(I.pipeStrategy==="output")return i($.out._def,I);let U=i($.in._def,{...I,currentPath:[...I.currentPath,"allOf","0"]}),D=i($.out._def,{...I,currentPath:[...I.currentPath,"allOf",U?"1":"0"]});return{allOf:[U,D].filter((b)=>b!==void 0)}};function c7($,I){return i($.type._def,I)}function m7($,I){let D={type:"array",uniqueItems:!0,items:i($.valueType._def,{...I,currentPath:[...I.currentPath,"items"]})};if($.minSize)I$(D,"minItems",$.minSize.value,$.minSize.message,I);if($.maxSize)I$(D,"maxItems",$.maxSize.value,$.maxSize.message,I);return D}function o7($,I){if($.rest)return{type:"array",minItems:$.items.length,items:$.items.map((U,D)=>i(U._def,{...I,currentPath:[...I.currentPath,"items",`${D}`]})).reduce((U,D)=>D===void 0?U:[...U,D],[]),additionalItems:i($.rest._def,{...I,currentPath:[...I.currentPath,"additionalItems"]})};else return{type:"array",minItems:$.items.length,maxItems:$.items.length,items:$.items.map((U,D)=>i(U._def,{...I,currentPath:[...I.currentPath,"items",`${D}`]})).reduce((U,D)=>D===void 0?U:[...U,D],[])}}function d7($){return{not:J$($)}}function p7($){return J$($)}var t7=($,I)=>{return i($.innerType._def,I)};var a7=($,I,U)=>{switch(I){case F.ZodString:return VO($,U);case F.ZodNumber:return u7($,U);case F.ZodObject:return i7($,U);case F.ZodBigInt:return q7($,U);case F.ZodBoolean:return E7();case F.ZodDate:return H9($,U);case F.ZodUndefined:return d7(U);case F.ZodNull:return y7(U);case F.ZodArray:return k7($,U);case F.ZodUnion:case F.ZodDiscriminatedUnion:return l7($,U);case F.ZodIntersection:return T7($,U);case F.ZodTuple:return o7($,U);case F.ZodRecord:return KO($,U);case F.ZodLiteral:return _7($,U);case F.ZodEnum:return R7($);case F.ZodNativeEnum:return Z7($);case F.ZodNullable:return h7($,U);case F.ZodOptional:return n7($,U);case F.ZodMap:return f7($,U);case F.ZodSet:return m7($,U);case F.ZodLazy:return()=>$.getter()._def;case F.ZodPromise:return c7($,U);case F.ZodNaN:case F.ZodNever:return g7(U);case F.ZodEffects:return P7($,U);case F.ZodAny:return J$(U);case F.ZodUnknown:return p7(U);case F.ZodDefault:return j7($,U);case F.ZodBranded:return MO($,U);case F.ZodReadonly:return t7($,U);case F.ZodCatch:return S7($,U);case F.ZodPipeline:return r7($,U);case F.ZodFunction:case F.ZodVoid:case F.ZodSymbol:return;default:return((D)=>{return})(I)}};function i($,I,U=!1){let D=I.seen.get($);if(I.override){let O=I.override?.($,I,D,U);if(O!==K7)return O}if(D&&!U){let O=fq(D,I);if(O!==void 0)return O}let b={def:$,path:I.currentPath,jsonSchema:void 0};I.seen.set($,b);let A=a7($,$.typeName,I),w=typeof A==="function"?i(A(),I):A;if(w)Zq($,I,w);if(I.postProcess){let O=I.postProcess(w,$,I);return b.jsonSchema=w,O}return b.jsonSchema=w,w}var fq=($,I)=>{switch(I.$refStrategy){case"root":return{$ref:$.path.join("/")};case"relative":return{$ref:HO(I.currentPath,$.path)};case"none":case"seen":{if($.path.length<I.currentPath.length&&$.path.every((U,D)=>I.currentPath[D]===U))return console.warn(`Recursive reference detected at ${I.currentPath.join("/")}! Defaulting to any`),J$(I);return I.$refStrategy==="seen"?J$(I):void 0}}},Zq=($,I,U)=>{if($.description){if(U.description=$.description,I.markdownDescription)U.markdownDescription=$.description}return U};var K9=($,I)=>{let U=F7(I),D=typeof I==="object"&&I.definitions?Object.entries(I.definitions).reduce((N,[X,G])=>({...N,[X]:i(G._def,{...U,currentPath:[...U.basePath,U.definitionPath,X]},!0)??J$(U)}),{}):void 0,b=typeof I==="string"?I:I?.nameStrategy==="title"?void 0:I?.name,A=i($._def,b===void 0?U:{...U,currentPath:[...U.basePath,U.definitionPath,b]},!1)??J$(U),w=typeof I==="object"&&I.name!==void 0&&I.nameStrategy==="title"?I.name:void 0;if(w!==void 0)A.title=w;if(U.flags.hasReferencedOpenAiAnyType){if(!D)D={};if(!D[U.openAiAnyTypeName])D[U.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:U.$refStrategy==="relative"?"1":[...U.basePath,U.definitionPath,U.openAiAnyTypeName].join("/")}}}let O=b===void 0?D?{...A,[U.definitionPath]:D}:A:{$ref:[...U.$refStrategy==="relative"?[]:U.basePath,U.definitionPath,b].join("/"),[U.definitionPath]:{...D,[b]:A}};if(U.target==="jsonSchema7")O.$schema="http://json-schema.org/draft-07/schema#";else if(U.target==="jsonSchema2019-09"||U.target==="openAi")O.$schema="https://json-schema.org/draft/2019-09/schema#";if(U.target==="openAi"&&(("anyOf"in O)||("oneOf"in O)||("allOf"in O)||("type"in O)&&Array.isArray(O.type)))console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property.");return O};function gq($){if(!$)return"draft-7";if($==="jsonSchema7"||$==="draft-7")return"draft-7";if($==="jsonSchema2019-09"||$==="draft-2020-12")return"draft-2020-12";return"draft-7"}function z9($,I){if($6($))return l4($,{target:gq(I?.target),io:I?.pipeStrategy??"input"});return K9($,{strictUnions:I?.strictUnions??!0,pipeStrategy:I?.pipeStrategy??"input"})}function F9($){let U=G4($)?.method;if(!U)throw new Error("Schema is missing a method literal");let D=Vw(U);if(typeof D!=="string")throw new Error("Schema method literal must be a string");return D}function k9($,I){let U=W4($,I);if(!U.success)throw U.error;return U.data}var yq=60000;class q9{constructor($){if(this._options=$,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(IO,(I)=>{this._oncancel(I)}),this.setNotificationHandler(bO,(I)=>{this._onprogress(I)}),this.setRequestHandler(UO,(I)=>({})),this._taskStore=$?.taskStore,this._taskMessageQueue=$?.taskMessageQueue,this._taskStore)this.setRequestHandler(DO,async(I,U)=>{let D=await this._taskStore.getTask(I.params.taskId,U.sessionId);if(!D)throw new Z(l.InvalidParams,"Failed to retrieve task: Task not found");return{...D}}),this.setRequestHandler(wO,async(I,U)=>{let D=async()=>{let b=I.params.taskId;if(this._taskMessageQueue){let w;while(w=await this._taskMessageQueue.dequeue(b,U.sessionId)){if(w.type==="response"||w.type==="error"){let O=w.message,N=O.id,X=this._requestResolvers.get(N);if(X)if(this._requestResolvers.delete(N),w.type==="response")X(O);else{let G=O,Q=new Z(G.error.code,G.error.message,G.error.data);X(Q)}else{let G=w.type==="response"?"Response":"Error";this._onerror(new Error(`${G} handler missing for request ${N}`))}continue}await this._transport?.send(w.message,{relatedRequestId:U.requestId})}}let A=await this._taskStore.getTask(b,U.sessionId);if(!A)throw new Z(l.InvalidParams,`Task not found: ${b}`);if(!v4(A.status))return await this._waitForTaskUpdate(b,U.signal),await D();if(v4(A.status)){let w=await this._taskStore.getTaskResult(b,U.sessionId);return this._clearTaskQueue(b),{...w,_meta:{...w._meta,[Y4]:{taskId:b}}}}return await D()};return await D()}),this.setRequestHandler(OO,async(I,U)=>{try{let{tasks:D,nextCursor:b}=await this._taskStore.listTasks(I.params?.cursor,U.sessionId);return{tasks:D,nextCursor:b,_meta:{}}}catch(D){throw new Z(l.InvalidParams,`Failed to list tasks: ${D instanceof Error?D.message:String(D)}`)}}),this.setRequestHandler(XO,async(I,U)=>{try{let D=await this._taskStore.getTask(I.params.taskId,U.sessionId);if(!D)throw new Z(l.InvalidParams,`Task not found: ${I.params.taskId}`);if(v4(D.status))throw new Z(l.InvalidParams,`Cannot cancel task in terminal status: ${D.status}`);await this._taskStore.updateTaskStatus(I.params.taskId,"cancelled","Client cancelled task execution.",U.sessionId),this._clearTaskQueue(I.params.taskId);let b=await this._taskStore.getTask(I.params.taskId,U.sessionId);if(!b)throw new Z(l.InvalidParams,`Task not found after cancellation: ${I.params.taskId}`);return{_meta:{},...b}}catch(D){if(D instanceof Z)throw D;throw new Z(l.InvalidRequest,`Failed to cancel task: ${D instanceof Error?D.message:String(D)}`)}})}async _oncancel($){if(!$.params.requestId)return;this._requestHandlerAbortControllers.get($.params.requestId)?.abort($.params.reason)}_setupTimeout($,I,U,D,b=!1){this._timeoutInfo.set($,{timeoutId:setTimeout(D,I),startTime:Date.now(),timeout:I,maxTotalTimeout:U,resetTimeoutOnProgress:b,onTimeout:D})}_resetTimeout($){let I=this._timeoutInfo.get($);if(!I)return!1;let U=Date.now()-I.startTime;if(I.maxTotalTimeout&&U>=I.maxTotalTimeout)throw this._timeoutInfo.delete($),Z.fromError(l.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:I.maxTotalTimeout,totalElapsed:U});return clearTimeout(I.timeoutId),I.timeoutId=setTimeout(I.onTimeout,I.timeout),!0}_cleanupTimeout($){let I=this._timeoutInfo.get($);if(I)clearTimeout(I.timeoutId),this._timeoutInfo.delete($)}async connect($){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=$;let I=this.transport?.onclose;this._transport.onclose=()=>{I?.(),this._onclose()};let U=this.transport?.onerror;this._transport.onerror=(b)=>{U?.(b),this._onerror(b)};let D=this._transport?.onmessage;this._transport.onmessage=(b,A)=>{if(D?.(b,A),_1(b)||N7(b))this._onresponse(b);else if(b9(b))this._onrequest(b,A);else if(O7(b))this._onnotification(b);else this._onerror(new Error(`Unknown message type: ${JSON.stringify(b)}`))},await this._transport.start()}_onclose(){let $=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let U of this._timeoutInfo.values())clearTimeout(U.timeoutId);this._timeoutInfo.clear();for(let U of this._requestHandlerAbortControllers.values())U.abort();this._requestHandlerAbortControllers.clear();let I=Z.fromError(l.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let U of $.values())U(I)}_onerror($){this.onerror?.($)}_onnotification($){let I=this._notificationHandlers.get($.method)??this.fallbackNotificationHandler;if(I===void 0)return;Promise.resolve().then(()=>I($)).catch((U)=>this._onerror(new Error(`Uncaught error in notification handler: ${U}`)))}_onrequest($,I){let U=this._requestHandlers.get($.method)??this.fallbackRequestHandler,D=this._transport,b=$.params?._meta?.[Y4]?.taskId;if(U===void 0){let X={jsonrpc:"2.0",id:$.id,error:{code:l.MethodNotFound,message:"Method not found"}};if(b&&this._taskMessageQueue)this._enqueueTaskMessage(b,{type:"error",message:X,timestamp:Date.now()},D?.sessionId).catch((G)=>this._onerror(new Error(`Failed to enqueue error response: ${G}`)));else D?.send(X).catch((G)=>this._onerror(new Error(`Failed to send an error response: ${G}`)));return}let A=new AbortController;this._requestHandlerAbortControllers.set($.id,A);let w=D7($.params)?$.params.task:void 0,O=this._taskStore?this.requestTaskStore($,D?.sessionId):void 0,N={signal:A.signal,sessionId:D?.sessionId,_meta:$.params?._meta,sendNotification:async(X)=>{if(A.signal.aborted)return;let G={relatedRequestId:$.id};if(b)G.relatedTask={taskId:b};await this.notification(X,G)},sendRequest:async(X,G,Q)=>{if(A.signal.aborted)throw new Z(l.ConnectionClosed,"Request was cancelled");let Y={...Q,relatedRequestId:$.id};if(b&&!Y.relatedTask)Y.relatedTask={taskId:b};let v=Y.relatedTask?.taskId??b;if(v&&O)await O.updateTaskStatus(v,"input_required");return await this.request(X,G,Y)},authInfo:I?.authInfo,requestId:$.id,requestInfo:I?.requestInfo,taskId:b,taskStore:O,taskRequestedTtl:w?.ttl,closeSSEStream:I?.closeSSEStream,closeStandaloneSSEStream:I?.closeStandaloneSSEStream};Promise.resolve().then(()=>{if(w)this.assertTaskHandlerCapability($.method)}).then(()=>U($,N)).then(async(X)=>{if(A.signal.aborted)return;let G={result:X,jsonrpc:"2.0",id:$.id};if(b&&this._taskMessageQueue)await this._enqueueTaskMessage(b,{type:"response",message:G,timestamp:Date.now()},D?.sessionId);else await D?.send(G)},async(X)=>{if(A.signal.aborted)return;let G={jsonrpc:"2.0",id:$.id,error:{code:Number.isSafeInteger(X.code)?X.code:l.InternalError,message:X.message??"Internal error",...X.data!==void 0&&{data:X.data}}};if(b&&this._taskMessageQueue)await this._enqueueTaskMessage(b,{type:"error",message:G,timestamp:Date.now()},D?.sessionId);else await D?.send(G)}).catch((X)=>this._onerror(new Error(`Failed to send response: ${X}`))).finally(()=>{if(this._requestHandlerAbortControllers.get($.id)===A)this._requestHandlerAbortControllers.delete($.id)})}_onprogress($){let{progressToken:I,...U}=$.params,D=Number(I),b=this._progressHandlers.get(D);if(!b){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify($)}`));return}let A=this._responseHandlers.get(D),w=this._timeoutInfo.get(D);if(w&&A&&w.resetTimeoutOnProgress)try{this._resetTimeout(D)}catch(O){this._responseHandlers.delete(D),this._progressHandlers.delete(D),this._cleanupTimeout(D),A(O);return}b(U)}_onresponse($){let I=Number($.id),U=this._requestResolvers.get(I);if(U){if(this._requestResolvers.delete(I),_1($))U($);else{let A=new Z($.error.code,$.error.message,$.error.data);U(A)}return}let D=this._responseHandlers.get(I);if(D===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify($)}`));return}this._responseHandlers.delete(I),this._cleanupTimeout(I);let b=!1;if(_1($)&&$.result&&typeof $.result==="object"){let A=$.result;if(A.task&&typeof A.task==="object"){let w=A.task;if(typeof w.taskId==="string")b=!0,this._taskProgressTokens.set(w.taskId,I)}}if(!b)this._progressHandlers.delete(I);if(_1($))D($);else{let A=Z.fromError($.error.code,$.error.message,$.error.data);D(A)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream($,I,U){let{task:D}=U??{};if(!D){try{yield{type:"result",result:await this.request($,I,U)}}catch(A){yield{type:"error",error:A instanceof Z?A:new Z(l.InternalError,String(A))}}return}let b;try{let A=await this.request($,uI,U);if(A.task)b=A.task.taskId,yield{type:"taskCreated",task:A.task};else throw new Z(l.InternalError,"Task creation did not return a task");while(!0){let w=await this.getTask({taskId:b},U);if(yield{type:"taskStatus",task:w},v4(w.status)){if(w.status==="completed")yield{type:"result",result:await this.getTaskResult({taskId:b},I,U)};else if(w.status==="failed")yield{type:"error",error:new Z(l.InternalError,`Task ${b} failed`)};else if(w.status==="cancelled")yield{type:"error",error:new Z(l.InternalError,`Task ${b} was cancelled`)};return}if(w.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:b},I,U)};return}let O=w.pollInterval??this._options?.defaultTaskPollInterval??1000;await new Promise((N)=>setTimeout(N,O)),U?.signal?.throwIfAborted()}}catch(A){yield{type:"error",error:A instanceof Z?A:new Z(l.InternalError,String(A))}}}request($,I,U){let{relatedRequestId:D,resumptionToken:b,onresumptiontoken:A,task:w,relatedTask:O}=U??{};return new Promise((N,X)=>{let G=(q)=>{X(q)};if(!this._transport){G(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{if(this.assertCapabilityForMethod($.method),w)this.assertTaskCapability($.method)}catch(q){G(q);return}U?.signal?.throwIfAborted();let Q=this._requestMessageId++,Y={...$,jsonrpc:"2.0",id:Q};if(U?.onprogress)this._progressHandlers.set(Q,U.onprogress),Y.params={...$.params,_meta:{...$.params?._meta||{},progressToken:Q}};if(w)Y.params={...Y.params,task:w};if(O)Y.params={...Y.params,_meta:{...Y.params?._meta||{},[Y4]:O}};let v=(q)=>{this._responseHandlers.delete(Q),this._progressHandlers.delete(Q),this._cleanupTimeout(Q),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:Q,reason:String(q)}},{relatedRequestId:D,resumptionToken:b,onresumptiontoken:A}).catch((x)=>this._onerror(new Error(`Failed to send cancellation: ${x}`)));let g=q instanceof Z?q:new Z(l.RequestTimeout,String(q));X(g)};this._responseHandlers.set(Q,(q)=>{if(U?.signal?.aborted)return;if(q instanceof Error)return X(q);try{let g=W4(I,q.result);if(!g.success)X(g.error);else N(g.data)}catch(g){X(g)}}),U?.signal?.addEventListener("abort",()=>{v(U?.signal?.reason)});let L=U?.timeout??yq,H=()=>v(Z.fromError(l.RequestTimeout,"Request timed out",{timeout:L}));this._setupTimeout(Q,L,U?.maxTotalTimeout,H,U?.resetTimeoutOnProgress??!1);let z=O?.taskId;if(z){let q=(g)=>{let x=this._responseHandlers.get(Q);if(x)x(g);else this._onerror(new Error(`Response handler missing for side-channeled request ${Q}`))};this._requestResolvers.set(Q,q),this._enqueueTaskMessage(z,{type:"request",message:Y,timestamp:Date.now()}).catch((g)=>{this._cleanupTimeout(Q),X(g)})}else this._transport.send(Y,{relatedRequestId:D,resumptionToken:b,onresumptiontoken:A}).catch((q)=>{this._cleanupTimeout(Q),X(q)})})}async getTask($,I){return this.request({method:"tasks/get",params:$},AO,I)}async getTaskResult($,I,U){return this.request({method:"tasks/result",params:$},I,U)}async listTasks($,I){return this.request({method:"tasks/list",params:$},NO,I)}async cancelTask($,I){return this.request({method:"tasks/cancel",params:$},G7,I)}async notification($,I){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability($.method);let U=I?.relatedTask?.taskId;if(U){let w={...$,jsonrpc:"2.0",params:{...$.params,_meta:{...$.params?._meta||{},[Y4]:I.relatedTask}}};await this._enqueueTaskMessage(U,{type:"notification",message:w,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes($.method)&&!$.params&&!I?.relatedRequestId&&!I?.relatedTask){if(this._pendingDebouncedNotifications.has($.method))return;this._pendingDebouncedNotifications.add($.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete($.method),!this._transport)return;let w={...$,jsonrpc:"2.0"};if(I?.relatedTask)w={...w,params:{...w.params,_meta:{...w.params?._meta||{},[Y4]:I.relatedTask}}};this._transport?.send(w,I).catch((O)=>this._onerror(O))});return}let A={...$,jsonrpc:"2.0"};if(I?.relatedTask)A={...A,params:{...A.params,_meta:{...A.params?._meta||{},[Y4]:I.relatedTask}}};await this._transport.send(A,I)}setRequestHandler($,I){let U=F9($);this.assertRequestHandlerCapability(U),this._requestHandlers.set(U,(D,b)=>{let A=k9($,D);return Promise.resolve(I(A,b))})}removeRequestHandler($){this._requestHandlers.delete($)}assertCanSetRequestHandler($){if(this._requestHandlers.has($))throw new Error(`A request handler for ${$} already exists, which would be overridden`)}setNotificationHandler($,I){let U=F9($);this._notificationHandlers.set(U,(D)=>{let b=k9($,D);return Promise.resolve(I(b))})}removeNotificationHandler($){this._notificationHandlers.delete($)}_cleanupTaskProgressHandler($){let I=this._taskProgressTokens.get($);if(I!==void 0)this._progressHandlers.delete(I),this._taskProgressTokens.delete($)}async _enqueueTaskMessage($,I,U){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let D=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue($,I,U,D)}async _clearTaskQueue($,I){if(this._taskMessageQueue){let U=await this._taskMessageQueue.dequeueAll($,I);for(let D of U)if(D.type==="request"&&b9(D.message)){let b=D.message.id,A=this._requestResolvers.get(b);if(A)A(new Z(l.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(b);else this._onerror(new Error(`Resolver missing for request ${b} during task ${$} cleanup`))}}}async _waitForTaskUpdate($,I){let U=this._options?.defaultTaskPollInterval??1000;try{let D=await this._taskStore?.getTask($);if(D?.pollInterval)U=D.pollInterval}catch{}return new Promise((D,b)=>{if(I.aborted){b(new Z(l.InvalidRequest,"Request cancelled"));return}let A=setTimeout(D,U);I.addEventListener("abort",()=>{clearTimeout(A),b(new Z(l.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore($,I){let U=this._taskStore;if(!U)throw new Error("No task store configured");return{createTask:async(D)=>{if(!$)throw new Error("No request provided");return await U.createTask(D,$.id,{method:$.method,params:$.params},I)},getTask:async(D)=>{let b=await U.getTask(D,I);if(!b)throw new Z(l.InvalidParams,"Failed to retrieve task: Task not found");return b},storeTaskResult:async(D,b,A)=>{await U.storeTaskResult(D,b,A,I);let w=await U.getTask(D,I);if(w){let O=y1.parse({method:"notifications/tasks/status",params:w});if(await this.notification(O),v4(w.status))this._cleanupTaskProgressHandler(D)}},getTaskResult:(D)=>{return U.getTaskResult(D,I)},updateTaskStatus:async(D,b,A)=>{let w=await U.getTask(D,I);if(!w)throw new Z(l.InvalidParams,`Task "${D}" not found - it may have been cleaned up`);if(v4(w.status))throw new Z(l.InvalidParams,`Cannot update task "${D}" from terminal status "${w.status}" to "${b}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await U.updateTaskStatus(D,b,A,I);let O=await U.getTask(D,I);if(O){let N=y1.parse({method:"notifications/tasks/status",params:O});if(await this.notification(N),v4(O.status))this._cleanupTaskProgressHandler(D)}},listTasks:(D)=>{return U.listTasks(D,I)}}}}function e7($){return $!==null&&typeof $==="object"&&!Array.isArray($)}function s7($,I){let U={...$};for(let D in I){let b=D,A=I[b];if(A===void 0)continue;let w=U[b];if(e7(w)&&e7(A))U[b]={...w,...A};else U[b]=A}return U}var RM=dY(M8(),1),TM=dY(PM(),1);function m_(){let $=new RM.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return TM.default($),$}class P8{constructor($){this._ajv=$??m_()}getValidator($){let I="$id"in $&&typeof $.$id==="string"?this._ajv.getSchema($.$id)??this._ajv.compile($):this._ajv.compile($);return(U)=>{if(I(U))return{valid:!0,data:U,errorMessage:void 0};else return{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(I.errors)}}}}class R8{constructor($){this._server=$}requestStream($,I,U){return this._server.requestStream($,I,U)}createMessageStream($,I){let U=this._server.getClientCapabilities();if(($.tools||$.toolChoice)&&!U?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if($.messages.length>0){let D=$.messages[$.messages.length-1],b=Array.isArray(D.content)?D.content:[D.content],A=b.some((X)=>X.type==="tool_result"),w=$.messages.length>1?$.messages[$.messages.length-2]:void 0,O=w?Array.isArray(w.content)?w.content:[w.content]:[],N=O.some((X)=>X.type==="tool_use");if(A){if(b.some((X)=>X.type!=="tool_result"))throw new Error("The last message must contain only tool_result content if any is present");if(!N)throw new Error("tool_result blocks are not matching any tool_use from the previous message")}if(N){let X=new Set(O.filter((Q)=>Q.type==="tool_use").map((Q)=>Q.id)),G=new Set(b.filter((Q)=>Q.type==="tool_result").map((Q)=>Q.toolUseId));if(X.size!==G.size||![...X].every((Q)=>G.has(Q)))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:$},h1,I)}elicitInputStream($,I){let U=this._server.getClientCapabilities(),D=$.mode??"form";switch(D){case"url":{if(!U?.elicitation?.url)throw new Error("Client does not support url elicitation.");break}case"form":{if(!U?.elicitation?.form)throw new Error("Client does not support form elicitation.");break}}let b=D==="form"&&$.mode===void 0?{...$,mode:"form"}:$;return this.requestStream({method:"elicitation/create",params:b},rI,I)}async getTask($,I){return this._server.getTask({taskId:$},I)}async getTaskResult($,I,U){return this._server.getTaskResult({taskId:$},I,U)}async listTasks($,I){return this._server.listTasks($?{cursor:$}:void 0,I)}async cancelTask($,I){return this._server.cancelTask({taskId:$},I)}}function _M($,I,U){if(!$)throw new Error(`${U} does not support task creation (required for ${I})`);switch(I){case"tools/call":if(!$.tools?.call)throw new Error(`${U} does not support task creation for tools/call (required for ${I})`);break;default:break}}function CM($,I,U){if(!$)throw new Error(`${U} does not support task creation (required for ${I})`);switch(I){case"sampling/createMessage":if(!$.sampling?.createMessage)throw new Error(`${U} does not support task creation for sampling/createMessage (required for ${I})`);break;case"elicitation/create":if(!$.elicitation?.create)throw new Error(`${U} does not support task creation for elicitation/create (required for ${I})`);break;default:break}}class T8 extends q9{constructor($,I){super(I);if(this._serverInfo=$,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(l1.options.map((U,D)=>[U,D])),this.isMessageIgnored=(U,D)=>{let b=this._loggingLevels.get(D);return b?this.LOG_LEVEL_SEVERITY.get(U)<this.LOG_LEVEL_SEVERITY.get(b):!1},this._capabilities=I?.capabilities??{},this._instructions=I?.instructions,this._jsonSchemaValidator=I?.jsonSchemaValidator??new P8,this.setRequestHandler(w9,(U)=>this._oninitialize(U)),this.setNotificationHandler(O9,()=>this.oninitialized?.()),this._capabilities.logging)this.setRequestHandler(v9,async(U,D)=>{let b=D.sessionId||D.requestInfo?.headers["mcp-session-id"]||void 0,{level:A}=U.params,w=l1.safeParse(A);if(w.success)this._loggingLevels.set(b,w.data);return{}})}get experimental(){if(!this._experimental)this._experimental={tasks:new R8(this)};return this._experimental}registerCapabilities($){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=s7(this._capabilities,$)}setRequestHandler($,I){let D=G4($)?.method;if(!D)throw new Error("Schema is missing a method literal");let b;if($6(D)){let w=D;b=w._zod?.def?.value??w.value}else{let w=D;b=w._def?.value??w.value}if(typeof b!=="string")throw new Error("Schema method literal must be a string");if(b==="tools/call"){let w=async(O,N)=>{let X=W4(nI,O);if(!X.success){let v=X.error instanceof Error?X.error.message:String(X.error);throw new Z(l.InvalidParams,`Invalid tools/call request: ${v}`)}let{params:G}=X.data,Q=await Promise.resolve(I(O,N));if(G.task){let v=W4(uI,Q);if(!v.success){let L=v.error instanceof Error?v.error.message:String(v.error);throw new Z(l.InvalidParams,`Invalid task creation result: ${L}`)}return v.data}let Y=W4(LO,Q);if(!Y.success){let v=Y.error instanceof Error?Y.error.message:String(Y.error);throw new Z(l.InvalidParams,`Invalid tools/call result: ${v}`)}return Y.data};return super.setRequestHandler($,w)}return super.setRequestHandler($,I)}assertCapabilityForMethod($){switch($){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw new Error(`Client does not support sampling (required for ${$})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new Error(`Client does not support elicitation (required for ${$})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new Error(`Client does not support listing roots (required for ${$})`);break;case"ping":break}}assertNotificationCapability($){switch($){case"notifications/message":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${$})`);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 ${$})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new Error(`Server does not support notifying of tool list changes (required for ${$})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new Error(`Server does not support notifying of prompt list changes (required for ${$})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new Error(`Client does not support URL elicitation (required for ${$})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability($){if(!this._capabilities)return;switch($){case"completion/complete":if(!this._capabilities.completions)throw new Error(`Server does not support completions (required for ${$})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${$})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new Error(`Server does not support prompts (required for ${$})`);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 ${$})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new Error(`Server does not support tools (required for ${$})`);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 ${$})`);break;case"ping":case"initialize":break}}assertTaskCapability($){CM(this._clientCapabilities?.tasks?.requests,$,"Client")}assertTaskHandlerCapability($){if(!this._capabilities)return;_M(this._capabilities.tasks?.requests,$,"Server")}async _oninitialize($){let I=$.params.protocolVersion;return this._clientCapabilities=$.params.capabilities,this._clientVersion=$.params.clientInfo,{protocolVersion:I7.includes(I)?I:I9,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"},$O)}async createMessage($,I){if($.tools||$.toolChoice){if(!this._clientCapabilities?.sampling?.tools)throw new Error("Client does not support sampling tools capability.")}if($.messages.length>0){let U=$.messages[$.messages.length-1],D=Array.isArray(U.content)?U.content:[U.content],b=D.some((N)=>N.type==="tool_result"),A=$.messages.length>1?$.messages[$.messages.length-2]:void 0,w=A?Array.isArray(A.content)?A.content:[A.content]:[],O=w.some((N)=>N.type==="tool_use");if(b){if(D.some((N)=>N.type!=="tool_result"))throw new Error("The last message must contain only tool_result content if any is present");if(!O)throw new Error("tool_result blocks are not matching any tool_use from the previous message")}if(O){let N=new Set(w.filter((G)=>G.type==="tool_use").map((G)=>G.id)),X=new Set(D.filter((G)=>G.type==="tool_result").map((G)=>G.toolUseId));if(N.size!==X.size||![...N].every((G)=>X.has(G)))throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}if($.tools)return this.request({method:"sampling/createMessage",params:$},B9,I);return this.request({method:"sampling/createMessage",params:$},h1,I)}async elicitInput($,I){switch($.mode??"form"){case"url":{if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support url elicitation.");let D=$;return this.request({method:"elicitation/create",params:D},rI,I)}case"form":{if(!this._clientCapabilities?.elicitation?.form)throw new Error("Client does not support form elicitation.");let D=$.mode==="form"?$:{...$,mode:"form"},b=await this.request({method:"elicitation/create",params:D},rI,I);if(b.action==="accept"&&b.content&&D.requestedSchema)try{let w=this._jsonSchemaValidator.getValidator(D.requestedSchema)(b.content);if(!w.valid)throw new Z(l.InvalidParams,`Elicitation response content does not match requested schema: ${w.errorMessage}`)}catch(A){if(A instanceof Z)throw A;throw new Z(l.InternalError,`Error validating elicitation response: ${A instanceof Error?A.message:String(A)}`)}return b}}}createElicitationCompletionNotifier($,I){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:$}},I)}async listRoots($,I){return this.request({method:"roots/list",params:$},L9,I)}async sendLoggingMessage($,I){if(this._capabilities.logging){if(!this.isMessageIgnored($.level,I))return this.notification({method:"notifications/message",params:$})}}async sendResourceUpdated($){return this.notification({method:"notifications/resources/updated",params:$})}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 ZM=Symbol.for("mcp.completable");function _8($){return!!$&&typeof $==="object"&&ZM in $}function gM($){return $[ZM]?.complete}var fM;(function($){$.Completable="McpCompletable"})(fM||(fM={}));var o_=/^[A-Za-z0-9._-]{1,128}$/;function d_($){let I=[];if($.length===0)return{isValid:!1,warnings:["Tool name cannot be empty"]};if($.length>128)return{isValid:!1,warnings:[`Tool name exceeds maximum length of 128 characters (current: ${$.length})`]};if($.includes(" "))I.push("Tool name contains spaces, which may cause parsing issues");if($.includes(","))I.push("Tool name contains commas, which may cause parsing issues");if($.startsWith("-")||$.endsWith("-"))I.push("Tool name starts or ends with a dash, which may cause parsing issues in some contexts");if($.startsWith(".")||$.endsWith("."))I.push("Tool name starts or ends with a dot, which may cause parsing issues in some contexts");if(!o_.test($)){let U=$.split("").filter((D)=>!/[A-Za-z0-9._-]/.test(D)).filter((D,b,A)=>A.indexOf(D)===b);return I.push(`Tool name contains invalid characters: ${U.map((D)=>`"${D}"`).join(", ")}`,"Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)"),{isValid:!1,warnings:I}}return{isValid:!0,warnings:I}}function p_($,I){if(I.length>0){console.warn(`Tool name validation warning for "${$}":`);for(let U of I)console.warn(` - ${U}`);console.warn("Tool registration will proceed, but this may cause compatibility issues."),console.warn("Consider updating the tool name to conform to the MCP tool naming standard."),console.warn("See SEP: Specify Format for Tool Names (https://github.com/modelcontextprotocol/modelcontextprotocol/issues/986) for more details.")}}function C8($){let I=d_($);return p_($,I.warnings),I.isValid}class f8{constructor($){this._mcpServer=$}registerToolTask($,I,U){let D={taskSupport:"required",...I.execution};if(D.taskSupport==="forbidden")throw new Error(`Cannot register task-based tool '${$}' with taskSupport 'forbidden'. Use registerTool() instead.`);return this._mcpServer._createRegisteredTool($,I.title,I.description,I.inputSchema,I.outputSchema,I.annotations,D,I._meta,U)}}class g8{constructor($,I){this._registeredResources={},this._registeredResourceTemplates={},this._registeredTools={},this._registeredPrompts={},this._toolHandlersInitialized=!1,this._completionHandlerInitialized=!1,this._resourceHandlersInitialized=!1,this._promptHandlersInitialized=!1,this.server=new T8($,I)}get experimental(){if(!this._experimental)this._experimental={tasks:new f8(this)};return this._experimental}async connect($){return await this.server.connect($)}async close(){await this.server.close()}setToolRequestHandlers(){if(this._toolHandlersInitialized)return;this.server.assertCanSetRequestHandler(z4(BO)),this.server.assertCanSetRequestHandler(z4(nI)),this.server.registerCapabilities({tools:{listChanged:!0}}),this.server.setRequestHandler(BO,()=>({tools:Object.entries(this._registeredTools).filter(([,$])=>$.enabled).map(([$,I])=>{let U={name:$,title:I.title,description:I.description,inputSchema:(()=>{let D=TI(I.inputSchema);return D?z9(D,{strictUnions:!0,pipeStrategy:"input"}):t_})(),annotations:I.annotations,execution:I.execution,_meta:I._meta};if(I.outputSchema){let D=TI(I.outputSchema);if(D)U.outputSchema=z9(D,{strictUnions:!0,pipeStrategy:"output"})}return U})})),this.server.setRequestHandler(nI,async($,I)=>{try{let U=this._registeredTools[$.params.name];if(!U)throw new Z(l.InvalidParams,`Tool ${$.params.name} not found`);if(!U.enabled)throw new Z(l.InvalidParams,`Tool ${$.params.name} disabled`);let D=!!$.params.task,b=U.execution?.taskSupport,A="createTask"in U.handler;if((b==="required"||b==="optional")&&!A)throw new Z(l.InternalError,`Tool ${$.params.name} has taskSupport '${b}' but was not registered with registerToolTask`);if(b==="required"&&!D)throw new Z(l.MethodNotFound,`Tool ${$.params.name} requires task augmentation (taskSupport: 'required')`);if(b==="optional"&&!D&&A)return await this.handleAutomaticTaskPolling(U,$,I);let w=await this.validateToolInput(U,$.params.arguments,$.params.name),O=await this.executeToolHandler(U,w,I);if(D)return O;return await this.validateToolOutput(U,O,$.params.name),O}catch(U){if(U instanceof Z){if(U.code===l.UrlElicitationRequired)throw U}return this.createToolError(U instanceof Error?U.message:String(U))}}),this._toolHandlersInitialized=!0}createToolError($){return{content:[{type:"text",text:$}],isError:!0}}async validateToolInput($,I,U){if(!$.inputSchema)return;let b=TI($.inputSchema)??$.inputSchema,A=await Hw(b,I);if(!A.success){let w="error"in A?A.error:"Unknown error",O=Mw(w);throw new Z(l.InvalidParams,`Input validation error: Invalid arguments for tool ${U}: ${O}`)}return A.data}async validateToolOutput($,I,U){if(!$.outputSchema)return;if(!("content"in I))return;if(I.isError)return;if(!I.structuredContent)throw new Z(l.InvalidParams,`Output validation error: Tool ${U} has an output schema but no structured content was provided`);let D=TI($.outputSchema),b=await Hw(D,I.structuredContent);if(!b.success){let A="error"in b?b.error:"Unknown error",w=Mw(A);throw new Z(l.InvalidParams,`Output validation error: Invalid structured content for tool ${U}: ${w}`)}}async executeToolHandler($,I,U){let D=$.handler;if("createTask"in D){if(!U.taskStore)throw new Error("No task store provided.");let A={...U,taskStore:U.taskStore};if($.inputSchema){let w=D;return await Promise.resolve(w.createTask(I,A))}else{let w=D;return await Promise.resolve(w.createTask(A))}}if($.inputSchema){let A=D;return await Promise.resolve(A(I,U))}else{let A=D;return await Promise.resolve(A(U))}}async handleAutomaticTaskPolling($,I,U){if(!U.taskStore)throw new Error("No task store provided for task-capable tool.");let D=await this.validateToolInput($,I.params.arguments,I.params.name),b=$.handler,A={...U,taskStore:U.taskStore},w=D?await Promise.resolve(b.createTask(D,A)):await Promise.resolve(b.createTask(A)),O=w.task.taskId,N=w.task,X=N.pollInterval??5000;while(N.status!=="completed"&&N.status!=="failed"&&N.status!=="cancelled"){await new Promise((Q)=>setTimeout(Q,X));let G=await U.taskStore.getTask(O);if(!G)throw new Z(l.InternalError,`Task ${O} not found during polling`);N=G}return await U.taskStore.getTaskResult(O)}setCompletionRequestHandler(){if(this._completionHandlerInitialized)return;this.server.assertCanSetRequestHandler(z4(JO)),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler(JO,async($)=>{switch($.params.ref.type){case"ref/prompt":return J7($),this.handlePromptCompletion($,$.params.ref);case"ref/resource":return H7($),this.handleResourceCompletion($,$.params.ref);default:throw new Z(l.InvalidParams,`Invalid completion reference: ${$.params.ref}`)}}),this._completionHandlerInitialized=!0}async handlePromptCompletion($,I){let U=this._registeredPrompts[I.name];if(!U)throw new Z(l.InvalidParams,`Prompt ${I.name} not found`);if(!U.enabled)throw new Z(l.InvalidParams,`Prompt ${I.name} disabled`);if(!U.argsSchema)return Gb;let b=G4(U.argsSchema)?.[$.params.argument.name];if(!_8(b))return Gb;let A=gM(b);if(!A)return Gb;let w=await A($.params.argument.value,$.params.context);return xM(w)}async handleResourceCompletion($,I){let U=Object.values(this._registeredResourceTemplates).find((A)=>A.resourceTemplate.uriTemplate.toString()===I.uri);if(!U){if(this._registeredResources[I.uri])return Gb;throw new Z(l.InvalidParams,`Resource template ${$.params.ref.uri} not found`)}let D=U.resourceTemplate.completeCallback($.params.argument.name);if(!D)return Gb;let b=await D($.params.argument.value,$.params.context);return xM(b)}setResourceRequestHandlers(){if(this._resourceHandlersInitialized)return;this.server.assertCanSetRequestHandler(z4(WO)),this.server.assertCanSetRequestHandler(z4(GO)),this.server.assertCanSetRequestHandler(z4(QO)),this.server.registerCapabilities({resources:{listChanged:!0}}),this.server.setRequestHandler(WO,async($,I)=>{let U=Object.entries(this._registeredResources).filter(([b,A])=>A.enabled).map(([b,A])=>({uri:b,name:A.name,...A.metadata})),D=[];for(let b of Object.values(this._registeredResourceTemplates)){if(!b.resourceTemplate.listCallback)continue;let A=await b.resourceTemplate.listCallback(I);for(let w of A.resources)D.push({...b.metadata,...w})}return{resources:[...U,...D]}}),this.server.setRequestHandler(GO,async()=>{return{resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([I,U])=>({name:I,uriTemplate:U.resourceTemplate.uriTemplate.toString(),...U.metadata}))}}),this.server.setRequestHandler(QO,async($,I)=>{let U=new URL($.params.uri),D=this._registeredResources[U.toString()];if(D){if(!D.enabled)throw new Z(l.InvalidParams,`Resource ${U} disabled`);return D.readCallback(U,I)}for(let b of Object.values(this._registeredResourceTemplates)){let A=b.resourceTemplate.uriTemplate.match(U.toString());if(A)return b.readCallback(U,A,I)}throw new Z(l.InvalidParams,`Resource ${U} not found`)}),this._resourceHandlersInitialized=!0}setPromptRequestHandlers(){if(this._promptHandlersInitialized)return;this.server.assertCanSetRequestHandler(z4(YO)),this.server.assertCanSetRequestHandler(z4(vO)),this.server.registerCapabilities({prompts:{listChanged:!0}}),this.server.setRequestHandler(YO,()=>({prompts:Object.entries(this._registeredPrompts).filter(([,$])=>$.enabled).map(([$,I])=>{return{name:$,title:I.title,description:I.description,arguments:I.argsSchema?a_(I.argsSchema):void 0}})})),this.server.setRequestHandler(vO,async($,I)=>{let U=this._registeredPrompts[$.params.name];if(!U)throw new Z(l.InvalidParams,`Prompt ${$.params.name} not found`);if(!U.enabled)throw new Z(l.InvalidParams,`Prompt ${$.params.name} disabled`);if(U.argsSchema){let D=TI(U.argsSchema),b=await Hw(D,$.params.arguments);if(!b.success){let O="error"in b?b.error:"Unknown error",N=Mw(O);throw new Z(l.InvalidParams,`Invalid arguments for prompt ${$.params.name}: ${N}`)}let A=b.data,w=U.callback;return await Promise.resolve(w(A,I))}else{let D=U.callback;return await Promise.resolve(D(I))}}),this._promptHandlersInitialized=!0}resource($,I,...U){let D;if(typeof U[0]==="object")D=U.shift();let b=U[0];if(typeof I==="string"){if(this._registeredResources[I])throw new Error(`Resource ${I} is already registered`);let A=this._createRegisteredResource($,void 0,I,D,b);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),A}else{if(this._registeredResourceTemplates[$])throw new Error(`Resource template ${$} is already registered`);let A=this._createRegisteredResourceTemplate($,void 0,I,D,b);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),A}}registerResource($,I,U,D){if(typeof I==="string"){if(this._registeredResources[I])throw new Error(`Resource ${I} is already registered`);let b=this._createRegisteredResource($,U.title,I,U,D);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),b}else{if(this._registeredResourceTemplates[$])throw new Error(`Resource template ${$} is already registered`);let b=this._createRegisteredResourceTemplate($,U.title,I,U,D);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),b}}_createRegisteredResource($,I,U,D,b){let A={name:$,title:I,metadata:D,readCallback:b,enabled:!0,disable:()=>A.update({enabled:!1}),enable:()=>A.update({enabled:!0}),remove:()=>A.update({uri:null}),update:(w)=>{if(typeof w.uri!=="undefined"&&w.uri!==U){if(delete this._registeredResources[U],w.uri)this._registeredResources[w.uri]=A}if(typeof w.name!=="undefined")A.name=w.name;if(typeof w.title!=="undefined")A.title=w.title;if(typeof w.metadata!=="undefined")A.metadata=w.metadata;if(typeof w.callback!=="undefined")A.readCallback=w.callback;if(typeof w.enabled!=="undefined")A.enabled=w.enabled;this.sendResourceListChanged()}};return this._registeredResources[U]=A,A}_createRegisteredResourceTemplate($,I,U,D,b){let A={resourceTemplate:U,title:I,metadata:D,readCallback:b,enabled:!0,disable:()=>A.update({enabled:!1}),enable:()=>A.update({enabled:!0}),remove:()=>A.update({name:null}),update:(N)=>{if(typeof N.name!=="undefined"&&N.name!==$){if(delete this._registeredResourceTemplates[$],N.name)this._registeredResourceTemplates[N.name]=A}if(typeof N.title!=="undefined")A.title=N.title;if(typeof N.template!=="undefined")A.resourceTemplate=N.template;if(typeof N.metadata!=="undefined")A.metadata=N.metadata;if(typeof N.callback!=="undefined")A.readCallback=N.callback;if(typeof N.enabled!=="undefined")A.enabled=N.enabled;this.sendResourceListChanged()}};this._registeredResourceTemplates[$]=A;let w=U.uriTemplate.variableNames;if(Array.isArray(w)&&w.some((N)=>!!U.completeCallback(N)))this.setCompletionRequestHandler();return A}_createRegisteredPrompt($,I,U,D,b){let A={title:I,description:U,argsSchema:D===void 0?void 0:h4(D),callback:b,enabled:!0,disable:()=>A.update({enabled:!1}),enable:()=>A.update({enabled:!0}),remove:()=>A.update({name:null}),update:(w)=>{if(typeof w.name!=="undefined"&&w.name!==$){if(delete this._registeredPrompts[$],w.name)this._registeredPrompts[w.name]=A}if(typeof w.title!=="undefined")A.title=w.title;if(typeof w.description!=="undefined")A.description=w.description;if(typeof w.argsSchema!=="undefined")A.argsSchema=h4(w.argsSchema);if(typeof w.callback!=="undefined")A.callback=w.callback;if(typeof w.enabled!=="undefined")A.enabled=w.enabled;this.sendPromptListChanged()}};if(this._registeredPrompts[$]=A,D){if(Object.values(D).some((O)=>{let N=O instanceof lI?O._def?.innerType:O;return _8(N)}))this.setCompletionRequestHandler()}return A}_createRegisteredTool($,I,U,D,b,A,w,O,N){C8($);let X={title:I,description:U,inputSchema:yM(D),outputSchema:yM(b),annotations:A,execution:w,_meta:O,handler:N,enabled:!0,disable:()=>X.update({enabled:!1}),enable:()=>X.update({enabled:!0}),remove:()=>X.update({name:null}),update:(G)=>{if(typeof G.name!=="undefined"&&G.name!==$){if(typeof G.name==="string")C8(G.name);if(delete this._registeredTools[$],G.name)this._registeredTools[G.name]=X}if(typeof G.title!=="undefined")X.title=G.title;if(typeof G.description!=="undefined")X.description=G.description;if(typeof G.paramsSchema!=="undefined")X.inputSchema=h4(G.paramsSchema);if(typeof G.outputSchema!=="undefined")X.outputSchema=h4(G.outputSchema);if(typeof G.callback!=="undefined")X.handler=G.callback;if(typeof G.annotations!=="undefined")X.annotations=G.annotations;if(typeof G._meta!=="undefined")X._meta=G._meta;if(typeof G.enabled!=="undefined")X.enabled=G.enabled;this.sendToolListChanged()}};return this._registeredTools[$]=X,this.setToolRequestHandlers(),this.sendToolListChanged(),X}tool($,...I){if(this._registeredTools[$])throw new Error(`Tool ${$} is already registered`);let U,D,b,A;if(typeof I[0]==="string")U=I.shift();if(I.length>1){let O=I[0];if(Z8(O)){if(D=I.shift(),I.length>1&&typeof I[0]==="object"&&I[0]!==null&&!Z8(I[0]))A=I.shift()}else if(typeof O==="object"&&O!==null){if(Object.values(O).some((N)=>typeof N==="object"&&N!==null))throw new Error(`Tool ${$} expected a Zod schema or ToolAnnotations, but received an unrecognized object`);A=I.shift()}}let w=I[0];return this._createRegisteredTool($,void 0,U,D,b,A,{taskSupport:"forbidden"},void 0,w)}registerTool($,I,U){if(this._registeredTools[$])throw new Error(`Tool ${$} is already registered`);let{title:D,description:b,inputSchema:A,outputSchema:w,annotations:O,_meta:N}=I;return this._createRegisteredTool($,D,b,A,w,O,{taskSupport:"forbidden"},N,U)}prompt($,...I){if(this._registeredPrompts[$])throw new Error(`Prompt ${$} is already registered`);let U;if(typeof I[0]==="string")U=I.shift();let D;if(I.length>1)D=I.shift();let b=I[0],A=this._createRegisteredPrompt($,void 0,U,D,b);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),A}registerPrompt($,I,U){if(this._registeredPrompts[$])throw new Error(`Prompt ${$} is already registered`);let{title:D,description:b,argsSchema:A}=I,w=this._createRegisteredPrompt($,D,b,A,U);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),w}isConnected(){return this.server.transport!==void 0}async sendLoggingMessage($,I){return this.server.sendLoggingMessage($,I)}sendResourceListChanged(){if(this.isConnected())this.server.sendResourceListChanged()}sendToolListChanged(){if(this.isConnected())this.server.sendToolListChanged()}sendPromptListChanged(){if(this.isConnected())this.server.sendPromptListChanged()}}var t_={type:"object",properties:{}};function lM($){return $!==null&&typeof $==="object"&&"parse"in $&&typeof $.parse==="function"&&"safeParse"in $&&typeof $.safeParse==="function"}function hM($){return"_def"in $||"_zod"in $||lM($)}function Z8($){if(typeof $!=="object"||$===null)return!1;if(hM($))return!1;if(Object.keys($).length===0)return!0;return Object.values($).some(lM)}function yM($){if(!$)return;if(Z8($))return h4($);if(!hM($))throw new Error("inputSchema must be a Zod schema or raw shape, received an unrecognized object");return $}function a_($){let I=G4($);if(!I)return[];return Object.entries(I).map(([U,D])=>{let b=iv(D),A=nv(D);return{name:U,description:b,required:!A}})}function z4($){let U=G4($)?.method;if(!U)throw new Error("Schema is missing a method literal");let D=Vw(U);if(typeof D==="string")return D;throw new Error("Schema method literal must be a string")}function xM($){return{completion:{values:$.slice(0,100),total:$.length,hasMore:$.length>100}}}var Gb={completion:{values:[],hasMore:!1}};import iM from"node:process";class y8{append($){this._buffer=this._buffer?Buffer.concat([this._buffer,$]):$}readMessage(){if(!this._buffer)return null;let $=this._buffer.indexOf(`
|
|
36
|
+
`);if($===-1)return null;let I=this._buffer.toString("utf8",0,$).replace(/\r$/,"");return this._buffer=this._buffer.subarray($+1),e_(I)}clear(){this._buffer=void 0}}function e_($){return X7.parse(JSON.parse($))}function uM($){return JSON.stringify($)+`
|
|
37
|
+
`}class x8{constructor($=iM.stdin,I=iM.stdout){this._stdin=$,this._stdout=I,this._readBuffer=new y8,this._started=!1,this._ondata=(U)=>{this._readBuffer.append(U),this.processReadBuffer()},this._onerror=(U)=>{this.onerror?.(U)}}async start(){if(this._started)throw new Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");this._started=!0,this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror)}processReadBuffer(){while(!0)try{let $=this._readBuffer.readMessage();if($===null)break;this.onmessage?.($)}catch($){this.onerror?.($)}}async close(){if(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($){return new Promise((I)=>{let U=uM($);if(this._stdout.write(U))I();else this._stdout.once("drain",I)})}}var{create:s_,defineProperty:nM,getOwnPropertyDescriptor:$C,getOwnPropertyNames:rM,getPrototypeOf:IC}=Object,UC=Object.prototype.hasOwnProperty,L6=($,I)=>function(){return I||$[rM($)[0]]((I={exports:{}}).exports,I),I.exports},bC=($,I,U,D)=>{if(I&&typeof I==="object"||typeof I==="function"){for(var b=rM(I),A=0,w=b.length,O;A<w;A++)if(O=b[A],!UC.call($,O)&&O!==U)nM($,O,{get:((N)=>I[N]).bind(null,O),enumerable:!(D=$C(I,O))||D.enumerable})}return $},Y$=($,I,U)=>(U=$!=null?s_(IC($)):{},bC(I||!$||!$.__esModule?nM(U,"default",{value:$,enumerable:!0}):U,$)),cM=L6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"($,I){function U(D){return I.exports=U=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(b){return typeof b}:function(b){return b&&typeof Symbol=="function"&&b.constructor===Symbol&&b!==Symbol.prototype?"symbol":typeof b},I.exports.__esModule=!0,I.exports.default=I.exports,U(D)}I.exports=U,I.exports.__esModule=!0,I.exports.default=I.exports}}),DC=L6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"($,I){var U=cM().default;function D(b,A){if(U(b)!="object"||!b)return b;var w=b[Symbol.toPrimitive];if(w!==void 0){var O=w.call(b,A||"default");if(U(O)!="object")return O;throw new TypeError("@@toPrimitive must return a primitive value.")}return(A==="string"?String:Number)(b)}I.exports=D,I.exports.__esModule=!0,I.exports.default=I.exports}}),AC=L6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"($,I){var U=cM().default,D=DC();function b(A){var w=D(A,"string");return U(w)=="symbol"?w:w+""}I.exports=b,I.exports.__esModule=!0,I.exports.default=I.exports}}),R6=L6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"($,I){var U=AC();function D(b,A,w){return(A=U(A))in b?Object.defineProperty(b,A,{value:w,enumerable:!0,configurable:!0,writable:!0}):b[A]=w,b}I.exports=D,I.exports.__esModule=!0,I.exports.default=I.exports}}),k$=L6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"($,I){var U=R6();function D(A,w){var O=Object.keys(A);if(Object.getOwnPropertySymbols){var N=Object.getOwnPropertySymbols(A);w&&(N=N.filter(function(X){return Object.getOwnPropertyDescriptor(A,X).enumerable})),O.push.apply(O,N)}return O}function b(A){for(var w=1;w<arguments.length;w++){var O=arguments[w]!=null?arguments[w]:{};w%2?D(Object(O),!0).forEach(function(N){U(A,N,O[N])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(O)):D(Object(O)).forEach(function(N){Object.defineProperty(A,N,Object.getOwnPropertyDescriptor(O,N))})}return A}I.exports=b,I.exports.__esModule=!0,I.exports.default=I.exports}});function T6($){let I={subscribe(U){let D=null,b=!1,A=!1,w=!1;function O(){if(D===null){w=!0;return}if(A)return;if(A=!0,typeof D==="function")D();else if(D)D.unsubscribe()}if(D=$({next(N){var X;if(b)return;(X=U.next)===null||X===void 0||X.call(U,N)},error(N){var X;if(b)return;b=!0,(X=U.error)===null||X===void 0||X.call(U,N),O()},complete(){var N;if(b)return;b=!0,(N=U.complete)===null||N===void 0||N.call(U),O()}}),w)O();return{unsubscribe:O}},pipe(...U){return U.reduce(wC,I)}};return I}function wC($,I){return I($)}function l8($){let I=new AbortController;return new Promise((D,b)=>{let A=!1;function w(){if(A)return;A=!0,O.unsubscribe()}I.signal.addEventListener("abort",()=>{b(I.signal.reason)});let O=$.subscribe({next(N){A=!0,D(N),w()},error(N){b(N)},complete(){I.abort(),w()}})})}function h8($){return(I)=>{let U=0,D=null,b=[];function A(){if(D)return;D=I.subscribe({next(O){for(let X of b){var N;(N=X.next)===null||N===void 0||N.call(X,O)}},error(O){for(let X of b){var N;(N=X.error)===null||N===void 0||N.call(X,O)}},complete(){for(let N of b){var O;(O=N.complete)===null||O===void 0||O.call(N)}}})}function w(){if(U===0&&D){let O=D;D=null,O.unsubscribe()}}return T6((O)=>{return U++,b.push(O),A(),{unsubscribe(){U--,w();let N=b.findIndex((X)=>X===O);if(N>-1)b.splice(N,1)}}})}}var ur=Symbol();function w0($){let I=$,U=[],D=(w)=>{if(I!==void 0)w.next(I);U.push(w)},b=(w)=>{U.splice(U.indexOf(w),1)},A=T6((w)=>{return D(w),()=>{b(w)}});return A.next=(w)=>{if(I===w)return;I=w;for(let O of U)O.next(w)},A.get=()=>I,A}function mM($){return T6((I)=>{function U(b=0,A=$.op){let w=$.links[b];if(!w)throw new Error("No more links to execute - did you forget to add an ending link?");return w({op:A,next(N){return U(b+1,N)}})}return U().subscribe(I)})}function m6($){return!!$&&!Array.isArray($)&&typeof $==="object"}function O0(){return Object.create(null)}var UU={PARSE_ERROR:-32700,BAD_REQUEST:-32600,INTERNAL_SERVER_ERROR:-32603,NOT_IMPLEMENTED:-32603,BAD_GATEWAY:-32603,SERVICE_UNAVAILABLE:-32603,GATEWAY_TIMEOUT:-32603,UNAUTHORIZED:-32001,PAYMENT_REQUIRED:-32002,FORBIDDEN:-32003,NOT_FOUND:-32004,METHOD_NOT_SUPPORTED:-32005,TIMEOUT:-32008,CONFLICT:-32009,PRECONDITION_FAILED:-32012,PAYLOAD_TOO_LARGE:-32013,UNSUPPORTED_MEDIA_TYPE:-32015,UNPROCESSABLE_CONTENT:-32022,PRECONDITION_REQUIRED:-32028,TOO_MANY_REQUESTS:-32029,CLIENT_CLOSED_REQUEST:-32099};var oM=[UU.BAD_GATEWAY,UU.SERVICE_UNAVAILABLE,UU.GATEWAY_TIMEOUT,UU.INTERNAL_SERVER_ERROR];var{create:NC,defineProperty:pM,getOwnPropertyDescriptor:XC,getOwnPropertyNames:tM,getPrototypeOf:WC}=Object,GC=Object.prototype.hasOwnProperty,Qb=($,I)=>function(){return I||$[tM($)[0]]((I={exports:{}}).exports,I),I.exports},QC=($,I,U,D)=>{if(I&&typeof I==="object"||typeof I==="function"){for(var b=tM(I),A=0,w=b.length,O;A<w;A++)if(O=b[A],!GC.call($,O)&&O!==U)pM($,O,{get:((N)=>I[N]).bind(null,O),enumerable:!(D=XC(I,O))||D.enumerable})}return $},Yb=($,I,U)=>(U=$!=null?NC(WC($)):{},QC(I||!$||!$.__esModule?pM(U,"default",{value:$,enumerable:!0}):U,$)),aM=()=>{},dM=($)=>{if(Object.freeze)Object.freeze($)};function eM($,I,U){var D;let b=I.join(".");return(D=U[b])!==null&&D!==void 0||(U[b]=new Proxy(aM,{get(A,w){if(typeof w!=="string"||w==="then")return;return eM($,[...I,w],U)},apply(A,w,O){let N=I[I.length-1];if(N==="valueOf"||N==="toString"||N==="toJSON")return`tRPC.proxy(${I.slice(0,-1).join(".")})`;let X={args:O,path:I};if(N==="call")X={args:O.length>=2?[O[1]]:[],path:I.slice(0,-1)};else if(N==="apply")X={args:O.length>=2?O[1]:[],path:I.slice(0,-1)};return dM(X.args),dM(X.path),$(X)}})),U[b]}var N0=($)=>eM($,[],O0()),u8=($)=>{return new Proxy(aM,{get(I,U){if(U==="then")return;return $(U)}})};var sM=Qb({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"($,I){function U(D){return I.exports=U=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(b){return typeof b}:function(b){return b&&typeof Symbol=="function"&&b.constructor===Symbol&&b!==Symbol.prototype?"symbol":typeof b},I.exports.__esModule=!0,I.exports.default=I.exports,U(D)}I.exports=U,I.exports.__esModule=!0,I.exports.default=I.exports}}),YC=Qb({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"($,I){var U=sM().default;function D(b,A){if(U(b)!="object"||!b)return b;var w=b[Symbol.toPrimitive];if(w!==void 0){var O=w.call(b,A||"default");if(U(O)!="object")return O;throw new TypeError("@@toPrimitive must return a primitive value.")}return(A==="string"?String:Number)(b)}I.exports=D,I.exports.__esModule=!0,I.exports.default=I.exports}}),vC=Qb({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"($,I){var U=sM().default,D=YC();function b(A){var w=D(A,"string");return U(w)=="symbol"?w:w+""}I.exports=b,I.exports.__esModule=!0,I.exports.default=I.exports}}),i8=Qb({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"($,I){var U=vC();function D(b,A,w){return(A=U(A))in b?Object.defineProperty(b,A,{value:w,enumerable:!0,configurable:!0,writable:!0}):b[A]=w,b}I.exports=D,I.exports.__esModule=!0,I.exports.default=I.exports}}),X0=Qb({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"($,I){var U=i8();function D(A,w){var O=Object.keys(A);if(Object.getOwnPropertySymbols){var N=Object.getOwnPropertySymbols(A);w&&(N=N.filter(function(X){return Object.getOwnPropertyDescriptor(A,X).enumerable})),O.push.apply(O,N)}return O}function b(A){for(var w=1;w<arguments.length;w++){var O=arguments[w]!=null?arguments[w]:{};w%2?D(Object(O),!0).forEach(function(N){U(A,N,O[N])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(O)):D(Object(O)).forEach(function(N){Object.defineProperty(A,N,Object.getOwnPropertyDescriptor(O,N))})}return A}I.exports=b,I.exports.__esModule=!0,I.exports.default=I.exports}}),Uc=Yb(X0(),1);var wc=Yb(i8(),1);var W0=Yb(X0(),1);function JC($,I){if("error"in $){let D=I.deserialize($.error);return{ok:!1,error:W0.default(W0.default({},$),{},{error:D})}}return{ok:!0,result:W0.default(W0.default({},$.result),(!$.result.type||$.result.type==="data")&&{type:"data",data:I.deserialize($.result.data)})}}var n8=class extends Error{constructor(){super("Unable to transform response from server")}};function r8($,I){let U;try{U=JC($,I)}catch(D){throw new n8}if(!U.ok&&(!m6(U.error.error)||typeof U.error.error.code!=="number"))throw new n8;if(U.ok&&!m6(U.result))throw new n8;return U}var Oc=Yb(X0(),1);var Nc=Symbol();var G0=Y$(R6(),1),bU=Y$(k$(),1);function $3($){return $ instanceof F4}function KC($){return m6($)&&m6($.error)&&typeof $.error.code==="number"&&typeof $.error.message==="string"}function zC($,I){if(typeof $==="string")return $;if(m6($)&&typeof $.message==="string")return $.message;return I}var F4=class $ extends Error{constructor(I,U){var D,b;let A=U===null||U===void 0?void 0:U.cause;super(I,{cause:A});G0.default(this,"cause",void 0),G0.default(this,"shape",void 0),G0.default(this,"data",void 0),G0.default(this,"meta",void 0),this.meta=U===null||U===void 0?void 0:U.meta,this.cause=A,this.shape=U===null||U===void 0||(D=U.result)===null||D===void 0?void 0:D.error,this.data=U===null||U===void 0||(b=U.result)===null||b===void 0?void 0:b.error.data,this.name="TRPCClientError",Object.setPrototypeOf(this,$.prototype)}static from(I,U={}){let D=I;if($3(D)){if(U.meta)D.meta=bU.default(bU.default({},D.meta),U.meta);return D}if(KC(D))return new $(D.error.message,bU.default(bU.default({},U),{},{result:D,cause:U.cause}));return new $(zC(D,"Unknown error"),bU.default(bU.default({},U),{},{cause:D}))}};function Q0($){let I=$;if(!I)return{input:{serialize:(U)=>U,deserialize:(U)=>U},output:{serialize:(U)=>U,deserialize:(U)=>U}};if("input"in I)return I;return{input:I,output:I}}var I3=($)=>typeof $==="function";function U3($){if($)return $;if(typeof window!=="undefined"&&I3(window.fetch))return window.fetch;if(typeof globalThis!=="undefined"&&I3(globalThis.fetch))return globalThis.fetch;throw new Error("No fetch implementation found")}var vb=Y$(k$(),1);function Y0($){return{url:$.url.toString(),fetch:$.fetch,transformer:Q0($.transformer),methodOverride:$.methodOverride}}function FC($){let I={};for(let U=0;U<$.length;U++){let D=$[U];I[U]=D}return I}var kC={query:"GET",mutation:"POST",subscription:"PATCH"};function b3($){return"input"in $?$.transformer.input.serialize($.input):FC($.inputs.map((I)=>$.transformer.input.serialize(I)))}var DU=($)=>{let I=$.url.split("?"),D=I[0].replace(/\/$/,"")+"/"+$.path,b=[];if(I[1])b.push(I[1]);if("inputs"in $)b.push("batch=1");if($.type==="query"||$.type==="subscription"){let A=b3($);if(A!==void 0&&$.methodOverride!=="POST")b.push(`input=${encodeURIComponent(JSON.stringify(A))}`)}if(b.length)D+="?"+b.join("&");return D},D3=($)=>{if($.type==="query"&&$.methodOverride!=="POST")return;let I=b3($);return I!==void 0?JSON.stringify(I):void 0},c8=($)=>{return v0(vb.default(vb.default({},$),{},{contentTypeHeader:"application/json",getUrl:DU,getBody:D3}))},qC=class extends Error{constructor(){super("AbortError");this.name="AbortError",this.message="AbortError"}},EC=($)=>{var I;if(!($===null||$===void 0?void 0:$.aborted))return;if((I=$.throwIfAborted)===null||I===void 0||I.call($),typeof DOMException!=="undefined")throw new DOMException("AbortError","AbortError");throw new qC};async function A3($){var I,U;EC($.signal);let D=$.getUrl($),b=$.getBody($),A=(I=$.methodOverride)!==null&&I!==void 0?I:kC[$.type],w=await(async()=>{let N=await $.headers();if(Symbol.iterator in N)return Object.fromEntries(N);return N})(),O=vb.default(vb.default(vb.default({},$.contentTypeHeader&&A!=="GET"?{"content-type":$.contentTypeHeader}:{}),$.trpcAcceptHeader?{[(U=$.trpcAcceptHeaderKey)!==null&&U!==void 0?U:"trpc-accept"]:$.trpcAcceptHeader}:void 0),w);return U3($.fetch)(D,{method:A,signal:$.signal,body:b,headers:O})}async function v0($){let I={},U=await A3($);I.response=U;let D=await U.json();return I.responseJSON=D,{json:D,meta:I}}function w3($){return $ instanceof Uint8Array||$ instanceof Blob}function O3($){return $ instanceof FormData}var AU=Y$(k$(),1),SC=($)=>{if("input"in $){let{input:I}=$;if(O3(I)){if($.type!=="mutation"&&$.methodOverride!=="POST")throw new Error("FormData is only supported for mutations");return v0(AU.default(AU.default({},$),{},{contentTypeHeader:void 0,getUrl:DU,getBody:()=>I}))}if(w3(I)){if($.type!=="mutation"&&$.methodOverride!=="POST")throw new Error("Octet type input is only supported for mutations");return v0(AU.default(AU.default({},$),{},{contentTypeHeader:"application/octet-stream",getUrl:DU,getBody:()=>I}))}}return c8($)};function m8($){let I=Y0($);return()=>{return(U)=>{let{op:D}=U;return T6((b)=>{let{path:A,input:w,type:O}=D;if(O==="subscription")throw new Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");let N=SC(AU.default(AU.default({},I),{},{type:O,path:A,input:w,signal:D.signal,headers(){if(!$.headers)return{};if(typeof $.headers==="function")return $.headers({op:D});return $.headers}})),X=void 0;return N.then((G)=>{X=G.meta;let Q=r8(G.json,I.transformer.output);if(!Q.ok){b.error(F4.from(Q.error,{meta:X}));return}b.next({context:G.meta,result:Q.result}),b.complete()}).catch((G)=>{b.error(F4.from(G,{meta:X}))}),()=>{}})}}}var Am=Y$(k$(),1);var Nm=Y$(k$(),1);var o8=($,...I)=>{return typeof $==="function"?$(...I):$},vm=Y$(R6(),1);function jC(){let $,I;return{promise:new Promise((D,b)=>{$=D,I=b}),resolve:$,reject:I}}async function PC($){let I=await o8($.url);if(!$.connectionParams)return I;let D=`${I.includes("?")?"&":"?"}connectionParams=1`;return I+D}async function RC($,I){let U={method:"connectionParams",data:await o8($)};return I.encode(U)}var Bm=Y$(R6(),1);var k4=Y$(R6(),1);function TC($){let{promise:I,resolve:U,reject:D}=jC();return $.addEventListener("open",()=>{$.removeEventListener("error",D),U()}),$.addEventListener("error",D),I}function _C($,{intervalMs:I,pongTimeoutMs:U}){let D,b;function A(){D=setTimeout(()=>{$.send("PING"),b=setTimeout(()=>{$.close()},U)},I)}function w(){clearTimeout(D),A()}function O(){clearTimeout(b),w()}$.addEventListener("open",A),$.addEventListener("message",({data:N})=>{if(clearTimeout(D),A(),N==="PONG")O()}),$.addEventListener("close",()=>{clearTimeout(D),clearTimeout(b)})}var CC=class ${constructor(I){var U;if(k4.default(this,"id",++$.connectCount),k4.default(this,"WebSocketPonyfill",void 0),k4.default(this,"urlOptions",void 0),k4.default(this,"keepAliveOpts",void 0),k4.default(this,"encoder",void 0),k4.default(this,"wsObservable",w0(null)),k4.default(this,"openPromise",null),this.WebSocketPonyfill=(U=I.WebSocketPonyfill)!==null&&U!==void 0?U:WebSocket,!this.WebSocketPonyfill)throw new Error("No WebSocket implementation found - you probably don't want to use this on the server, but if you do you need to pass a `WebSocket`-ponyfill");this.urlOptions=I.urlOptions,this.keepAliveOpts=I.keepAlive,this.encoder=I.encoder}get ws(){return this.wsObservable.get()}set ws(I){this.wsObservable.next(I)}isOpen(){return!!this.ws&&this.ws.readyState===this.WebSocketPonyfill.OPEN&&!this.openPromise}isClosed(){return!!this.ws&&(this.ws.readyState===this.WebSocketPonyfill.CLOSING||this.ws.readyState===this.WebSocketPonyfill.CLOSED)}async open(){var I=this;if(I.openPromise)return I.openPromise;I.id=++$.connectCount;let U=PC(I.urlOptions).then((D)=>new I.WebSocketPonyfill(D));I.openPromise=U.then(async(D)=>{if(I.ws=D,D.binaryType="arraybuffer",D.addEventListener("message",function({data:b}){if(b==="PING")this.send("PONG")}),I.keepAliveOpts.enabled)_C(D,I.keepAliveOpts);if(D.addEventListener("close",()=>{if(I.ws===D)I.ws=null}),await TC(D),I.urlOptions.connectionParams)D.send(await RC(I.urlOptions.connectionParams,I.encoder))});try{await I.openPromise}finally{I.openPromise=null}}async close(){var I=this;try{await I.openPromise}finally{var U;(U=I.ws)===null||U===void 0||U.close()}}};k4.default(CC,"connectCount",0);var Lm=Y$(R6(),1),Jm=Y$(k$(),1);var d8=Y$(R6(),1),N3=Y$(k$(),1),fC=class{constructor($){d8.default(this,"links",void 0),d8.default(this,"runtime",void 0),d8.default(this,"requestId",void 0),this.requestId=0,this.runtime={},this.links=$.links.map((I)=>I(this.runtime))}$request($){var I;return mM({links:this.links,op:N3.default(N3.default({},$),{},{context:(I=$.context)!==null&&I!==void 0?I:{},id:++this.requestId})}).pipe(h8())}async requestAsPromise($){var I=this;try{let U=I.$request($);return(await l8(U)).result.data}catch(U){throw F4.from(U)}}query($,I,U){return this.requestAsPromise({type:"query",path:$,input:I,context:U===null||U===void 0?void 0:U.context,signal:U===null||U===void 0?void 0:U.signal})}mutation($,I,U){return this.requestAsPromise({type:"mutation",path:$,input:I,context:U===null||U===void 0?void 0:U.context,signal:U===null||U===void 0?void 0:U.signal})}subscription($,I,U){return this.$request({type:"subscription",path:$,input:I,context:U.context,signal:U.signal}).subscribe({next(b){switch(b.result.type){case"state":{var A;(A=U.onConnectionStateChange)===null||A===void 0||A.call(U,b.result);break}case"started":{var w;(w=U.onStarted)===null||w===void 0||w.call(U,{context:b.context});break}case"stopped":{var O;(O=U.onStopped)===null||O===void 0||O.call(U);break}case"data":case void 0:{var N;(N=U.onData)===null||N===void 0||N.call(U,b.result.data);break}}},error(b){var A;(A=U.onError)===null||A===void 0||A.call(U,b)},complete(){var b;(b=U.onComplete)===null||b===void 0||b.call(U)}})}};var ZC=Symbol.for("trpc_untypedClient"),gC={query:"query",mutate:"mutation",subscribe:"subscription"},yC=($)=>{return gC[$]};function xC($){let I=N0(({path:U,args:D})=>{let b=[...U],A=yC(b.pop()),w=b.join(".");return $[A](w,...D)});return u8((U)=>{if(U===ZC)return $;return I[U]})}function X3($){let I=new fC($);return xC(I)}var mm=Y$(k$(),1);var om=Y$(k$(),1);var lC=L6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js"($,I){function U(b){var A,w,O,N=2;for(typeof Symbol!="undefined"&&(w=Symbol.asyncIterator,O=Symbol.iterator);N--;){if(w&&(A=b[w])!=null)return A.call(b);if(O&&(A=b[O])!=null)return new D(A.call(b));w="@@asyncIterator",O="@@iterator"}throw new TypeError("Object is not async iterable")}function D(b){function A(w){if(Object(w)!==w)return Promise.reject(new TypeError(w+" is not an object."));var O=w.done;return Promise.resolve(w.value).then(function(N){return{value:N,done:O}})}return D=function w(O){this.s=O,this.n=O.next},D.prototype={s:null,n:null,next:function w(){return A(this.n.apply(this.s,arguments))},return:function w(O){var N=this.s.return;return N===void 0?Promise.resolve({value:O,done:!0}):A(N.apply(this.s,arguments))},throw:function w(O){var N=this.s.return;return N===void 0?Promise.reject(O):A(N.apply(this.s,arguments))}},new D(b)}I.exports=U,I.exports.__esModule=!0,I.exports.default=I.exports}}),dm=Y$(lC(),1);var pm=Y$(k$(),1);var hC=L6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js"($,I){function U(){var D=typeof SuppressedError=="function"?SuppressedError:function(O,N){var X=Error();return X.name="SuppressedError",X.error=O,X.suppressed=N,X},b={},A=[];function w(O,N){if(N!=null){if(Object(N)!==N)throw new TypeError("using declarations can only be used with objects, functions, null, or undefined.");if(O)var X=N[Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose")];if(X===void 0&&(X=N[Symbol.dispose||Symbol.for("Symbol.dispose")],O))var G=X;if(typeof X!="function")throw new TypeError("Object is not disposable.");G&&(X=function Q(){try{G.call(N)}catch(Y){return Promise.reject(Y)}}),A.push({v:N,d:X,a:O})}else O&&A.push({d:N,a:O});return N}return{e:b,u:w.bind(null,!1),a:w.bind(null,!0),d:function O(){var N,X=this.e,G=0;function Q(){for(;N=A.pop();)try{if(!N.a&&G===1)return G=0,A.push(N),Promise.resolve().then(Q);if(N.d){var v=N.d.call(N.v);if(N.a)return G|=2,Promise.resolve(v).then(Q,Y)}else G|=1}catch(L){return Y(L)}if(G===1)return X!==b?Promise.reject(X):Promise.resolve();if(X!==b)throw X}function Y(v){return X=X!==b?new D(v,X):v,Q()}return Q()}}}I.exports=U,I.exports.__esModule=!0,I.exports.default=I.exports}}),W3=L6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/OverloadYield.js"($,I){function U(D,b){this.v=D,this.k=b}I.exports=U,I.exports.__esModule=!0,I.exports.default=I.exports}}),uC=L6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/awaitAsyncGenerator.js"($,I){var U=W3();function D(b){return new U(b,0)}I.exports=D,I.exports.__esModule=!0,I.exports.default=I.exports}}),iC=L6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/wrapAsyncGenerator.js"($,I){var U=W3();function D(A){return function(){return new b(A.apply(this,arguments))}}function b(A){var w,O;function N(G,Q){try{var Y=A[G](Q),v=Y.value,L=v instanceof U;Promise.resolve(L?v.v:v).then(function(H){if(L){var z=G==="return"?"return":"next";if(!v.k||H.done)return N(z,H);H=A[z](H).value}X(Y.done?"return":"normal",H)},function(H){N("throw",H)})}catch(H){X("throw",H)}}function X(G,Q){switch(G){case"return":w.resolve({value:Q,done:!0});break;case"throw":w.reject(Q);break;default:w.resolve({value:Q,done:!1})}(w=w.next)?N(w.key,w.arg):O=null}this._invoke=function(G,Q){return new Promise(function(Y,v){var L={key:G,arg:Q,resolve:Y,reject:v,next:null};O?O=O.next=L:(w=O=L,N(G,Q))})},typeof A.return!="function"&&(this.return=void 0)}b.prototype[typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},b.prototype.next=function(A){return this._invoke("next",A)},b.prototype.throw=function(A){return this._invoke("throw",A)},b.prototype.return=function(A){return this._invoke("return",A)},I.exports=D,I.exports.__esModule=!0,I.exports.default=I.exports}}),tm=Y$(hC(),1),am=Y$(uC(),1),em=Y$(iC(),1),sm=Y$(k$(),1);class p8{constructor(){this.keyToValue=new Map,this.valueToKey=new Map}set($,I){this.keyToValue.set($,I),this.valueToKey.set(I,$)}getByKey($){return this.keyToValue.get($)}getByValue($){return this.valueToKey.get($)}clear(){this.keyToValue.clear(),this.valueToKey.clear()}}class Bb{constructor($){this.generateIdentifier=$,this.kv=new p8}register($,I){if(this.kv.getByValue($))return;if(!I)I=this.generateIdentifier($);this.kv.set(I,$)}clear(){this.kv.clear()}getIdentifier($){return this.kv.getByValue($)}getValue($){return this.kv.getByKey($)}}class t8 extends Bb{constructor(){super(($)=>$.name);this.classToAllowedProps=new Map}register($,I){if(typeof I==="object"){if(I.allowProps)this.classToAllowedProps.set($,I.allowProps);super.register($,I.identifier)}else super.register($,I)}getAllowedProps($){return this.classToAllowedProps.get($)}}function nC($){if("values"in Object)return Object.values($);let I=[];for(let U in $)if($.hasOwnProperty(U))I.push($[U]);return I}function G3($,I){let U=nC($);if("find"in U)return U.find(I);let D=U;for(let b=0;b<D.length;b++){let A=D[b];if(I(A))return A}return}function d4($,I){Object.entries($).forEach(([U,D])=>I(D,U))}function wU($,I){return $.indexOf(I)!==-1}function a8($,I){for(let U=0;U<$.length;U++){let D=$[U];if(I(D))return D}return}class e8{constructor(){this.transfomers={}}register($){this.transfomers[$.name]=$}findApplicable($){return G3(this.transfomers,(I)=>I.isApplicable($))}findByName($){return this.transfomers[$]}}var rC=($)=>Object.prototype.toString.call($).slice(8,-1),s8=($)=>typeof $==="undefined",cC=($)=>$===null,p4=($)=>{if(typeof $!=="object"||$===null)return!1;if($===Object.prototype)return!1;if(Object.getPrototypeOf($)===null)return!0;return Object.getPrototypeOf($)===Object.prototype},B0=($)=>p4($)&&Object.keys($).length===0,J6=($)=>Array.isArray($),mC=($)=>typeof $==="string",oC=($)=>typeof $==="number"&&!isNaN($),dC=($)=>typeof $==="boolean",Q3=($)=>$ instanceof RegExp,q4=($)=>$ instanceof Map,E4=($)=>$ instanceof Set,$Q=($)=>rC($)==="Symbol",Y3=($)=>$ instanceof Date&&!isNaN($.valueOf()),L0=($)=>$ instanceof Error,IQ=($)=>typeof $==="number"&&isNaN($),v3=($)=>dC($)||cC($)||s8($)||oC($)||mC($)||$Q($),B3=($)=>typeof $==="bigint",L3=($)=>$===1/0||$===-1/0,J3=($)=>ArrayBuffer.isView($)&&!($ instanceof DataView),H3=($)=>$ instanceof URL;var J0=($)=>$.replace(/\\/g,"\\\\").replace(/\./g,"\\."),H0=($)=>$.map(String).map(J0).join("."),OU=($,I)=>{let U=[],D="";for(let A=0;A<$.length;A++){let w=$.charAt(A);if(!I&&w==="\\"){let X=$.charAt(A+1);if(X==="\\"){D+="\\",A++;continue}else if(X!==".")throw Error("invalid path")}if(w==="\\"&&$.charAt(A+1)==="."){D+=".",A++;continue}if(w==="."){U.push(D),D="";continue}D+=w}let b=D;return U.push(b),U};function _6($,I,U,D){return{isApplicable:$,annotation:I,transform:U,untransform:D}}var M3=[_6(s8,"undefined",()=>null,()=>{return}),_6(B3,"bigint",($)=>$.toString(),($)=>{if(typeof BigInt!=="undefined")return BigInt($);return console.error("Please add a BigInt polyfill."),$}),_6(Y3,"Date",($)=>$.toISOString(),($)=>new Date($)),_6(L0,"Error",($,I)=>{let U={name:$.name,message:$.message};if("cause"in $)U.cause=$.cause;return I.allowedErrorProps.forEach((D)=>{U[D]=$[D]}),U},($,I)=>{let U=new Error($.message,{cause:$.cause});return U.name=$.name,U.stack=$.stack,I.allowedErrorProps.forEach((D)=>{U[D]=$[D]}),U}),_6(Q3,"regexp",($)=>""+$,($)=>{let I=$.slice(1,$.lastIndexOf("/")),U=$.slice($.lastIndexOf("/")+1);return new RegExp(I,U)}),_6(E4,"set",($)=>[...$.values()],($)=>new Set($)),_6(q4,"map",($)=>[...$.entries()],($)=>new Map($)),_6(($)=>IQ($)||L3($),"number",($)=>{if(IQ($))return"NaN";if($>0)return"Infinity";else return"-Infinity"},Number),_6(($)=>$===0&&1/$===-1/0,"number",()=>{return"-0"},Number),_6(H3,"URL",($)=>$.toString(),($)=>new URL($))];function M0($,I,U,D){return{isApplicable:$,annotation:I,transform:U,untransform:D}}var V3=M0(($,I)=>{if($Q($))return!!I.symbolRegistry.getIdentifier($);return!1},($,I)=>{return["symbol",I.symbolRegistry.getIdentifier($)]},($)=>$.description,($,I,U)=>{let D=U.symbolRegistry.getValue(I[1]);if(!D)throw new Error("Trying to deserialize unknown symbol");return D}),pC=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce(($,I)=>{return $[I.name]=I,$},{}),K3=M0(J3,($)=>["typed-array",$.constructor.name],($)=>[...$],($,I)=>{let U=pC[I[1]];if(!U)throw new Error("Trying to deserialize unknown typed array");return new U($)});function UQ($,I){if($?.constructor)return!!I.classRegistry.getIdentifier($.constructor);return!1}var z3=M0(UQ,($,I)=>{return["class",I.classRegistry.getIdentifier($.constructor)]},($,I)=>{let U=I.classRegistry.getAllowedProps($.constructor);if(!U)return{...$};let D={};return U.forEach((b)=>{D[b]=$[b]}),D},($,I,U)=>{let D=U.classRegistry.getValue(I[1]);if(!D)throw new Error(`Trying to deserialize unknown class '${I[1]}' - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564`);return Object.assign(Object.create(D.prototype),$)}),F3=M0(($,I)=>{return!!I.customTransformerRegistry.findApplicable($)},($,I)=>{return["custom",I.customTransformerRegistry.findApplicable($).name]},($,I)=>{return I.customTransformerRegistry.findApplicable($).serialize($)},($,I,U)=>{let D=U.customTransformerRegistry.findByName(I[1]);if(!D)throw new Error("Trying to deserialize unknown custom value");return D.deserialize($)}),tC=[z3,V3,F3,K3],bQ=($,I)=>{let U=a8(tC,(b)=>b.isApplicable($,I));if(U)return{value:U.transform($,I),type:U.annotation($,I)};let D=a8(M3,(b)=>b.isApplicable($,I));if(D)return{value:D.transform($,I),type:D.annotation};return},k3={};M3.forEach(($)=>{k3[$.annotation]=$});var q3=($,I,U)=>{if(J6(I))switch(I[0]){case"symbol":return V3.untransform($,I,U);case"class":return z3.untransform($,I,U);case"custom":return F3.untransform($,I,U);case"typed-array":return K3.untransform($,I,U);default:throw new Error("Unknown transformation: "+I)}else{let D=k3[I];if(!D)throw new Error("Unknown transformation: "+I);return D.untransform($,U)}};var NU=($,I)=>{if(I>$.size)throw new Error("index out of bounds");let U=$.keys();while(I>0)U.next(),I--;return U.next().value};function E3($){if(wU($,"__proto__"))throw new Error("__proto__ is not allowed as a property");if(wU($,"prototype"))throw new Error("prototype is not allowed as a property");if(wU($,"constructor"))throw new Error("constructor is not allowed as a property")}var S3=($,I)=>{E3(I);for(let U=0;U<I.length;U++){let D=I[U];if(E4($))$=NU($,+D);else if(q4($)){let b=+D,A=+I[++U]===0?"key":"value",w=NU($,b);switch(A){case"key":$=w;break;case"value":$=$.get(w);break}}else $=$[D]}return $},V0=($,I,U)=>{if(E3(I),I.length===0)return U($);let D=$;for(let A=0;A<I.length-1;A++){let w=I[A];if(J6(D)){let O=+w;D=D[O]}else if(p4(D))D=D[w];else if(E4(D)){let O=+w;D=NU(D,O)}else if(q4(D)){if(A===I.length-2)break;let N=+w,X=+I[++A]===0?"key":"value",G=NU(D,N);switch(X){case"key":D=G;break;case"value":D=D.get(G);break}}}let b=I[I.length-1];if(J6(D))D[+b]=U(D[+b]);else if(p4(D))D[b]=U(D[b]);if(E4(D)){let A=NU(D,+b),w=U(A);if(A!==w)D.delete(A),D.add(w)}if(q4(D)){let A=+I[I.length-2],w=NU(D,A);switch(+b===0?"key":"value"){case"key":{let N=U(w);if(D.set(N,D.get(w)),N!==w)D.delete(w);break}case"value":{D.set(w,U(D.get(w)));break}}}return $};var j3=($)=>$<1;function DQ($,I,U,D=[]){if(!$)return;let b=j3(U);if(!J6($)){d4($,(O,N)=>DQ(O,I,U,[...D,...OU(N,b)]));return}let[A,w]=$;if(w)d4(w,(O,N)=>{DQ(O,I,U,[...D,...OU(N,b)])});I(A,D)}function P3($,I,U,D){return DQ(I,(b,A)=>{$=V0($,A,(w)=>q3(w,b,D))},U),$}function R3($,I,U){let D=j3(U);function b(A,w){let O=S3($,OU(w,D));A.map((N)=>OU(N,D)).forEach((N)=>{$=V0($,N,()=>O)})}if(J6(I)){let[A,w]=I;if(A.forEach((O)=>{$=V0($,OU(O,D),()=>$)}),w)d4(w,b)}else d4(I,b);return $}var aC=($,I)=>p4($)||J6($)||q4($)||E4($)||L0($)||UQ($,I);function eC($,I,U){let D=U.get($);if(D)D.push(I);else U.set($,[I])}function T3($,I){let U={},D=void 0;if($.forEach((b)=>{if(b.length<=1)return;if(!I)b=b.map((O)=>O.map(String)).sort((O,N)=>O.length-N.length);let[A,...w]=b;if(A.length===0)D=w.map(H0);else U[H0(A)]=w.map(H0)}),D)if(B0(U))return[D];else return[D,U];else return B0(U)?void 0:U}var AQ=($,I,U,D,b=[],A=[],w=new Map)=>{let O=v3($);if(!O){eC($,b,I);let v=w.get($);if(v)return D?{transformedValue:null}:v}if(!aC($,U)){let v=bQ($,U),L=v?{transformedValue:v.value,annotations:[v.type]}:{transformedValue:$};if(!O)w.set($,L);return L}if(wU(A,$))return{transformedValue:null};let N=bQ($,U),X=N?.value??$,G=J6(X)?[]:{},Q={};d4(X,(v,L)=>{if(L==="__proto__"||L==="constructor"||L==="prototype")throw new Error(`Detected property ${L}. This is a prototype pollution risk, please remove it from your object.`);let H=AQ(v,I,U,D,[...b,L],[...A,$],w);if(G[L]=H.transformedValue,J6(H.annotations))Q[J0(L)]=H.annotations;else if(p4(H.annotations))d4(H.annotations,(z,q)=>{Q[J0(L)+"."+q]=z})});let Y=B0(Q)?{transformedValue:G,annotations:N?[N.type]:void 0}:{transformedValue:G,annotations:N?[N.type,Q]:Q};if(!O)w.set($,Y);return Y};function K0($){return Object.prototype.toString.call($).slice(8,-1)}function z0($){return K0($)==="Array"}function wQ($){if(K0($)!=="Object")return!1;let I=Object.getPrototypeOf($);return!!I&&I.constructor===Object&&I===Object.prototype}function sC($,I,U,D,b){let A={}.propertyIsEnumerable.call(D,I)?"enumerable":"nonenumerable";if(A==="enumerable")$[I]=U;if(b&&A==="nonenumerable")Object.defineProperty($,I,{value:U,enumerable:!1,writable:!0,configurable:!0})}function F0($,I={}){if(z0($))return $.map((b)=>F0(b,I));if(!wQ($))return $;let U=Object.getOwnPropertyNames($),D=Object.getOwnPropertySymbols($);return[...U,...D].reduce((b,A)=>{if(A==="__proto__")return b;if(z0(I.props)&&!I.props.includes(A))return b;let w=$[A],O=F0(w,I);return sC(b,A,O,$,I.nonenumerable),b},{})}class $${constructor({dedupe:$=!1}={}){this.classRegistry=new t8,this.symbolRegistry=new Bb((I)=>I.description??""),this.customTransformerRegistry=new e8,this.allowedErrorProps=[],this.dedupe=$}serialize($){let I=new Map,U=AQ($,I,this,this.dedupe),D={json:U.transformedValue};if(U.annotations)D.meta={...D.meta,values:U.annotations};let b=T3(I,this.dedupe);if(b)D.meta={...D.meta,referentialEqualities:b};if(D.meta)D.meta.v=1;return D}deserialize($,I){let{json:U,meta:D}=$,b=I?.inPlace?U:F0(U);if(D?.values)b=P3(b,D.values,D.v??0,this);if(D?.referentialEqualities)b=R3(b,D.referentialEqualities,D.v??0);return b}stringify($){return JSON.stringify(this.serialize($))}parse($){return this.deserialize(JSON.parse($),{inPlace:!0})}registerClass($,I){this.classRegistry.register($,I)}registerSymbol($,I){this.symbolRegistry.register($,I)}registerCustom($,I){this.customTransformerRegistry.register({name:I,...$})}allowErrorProps(...$){this.allowedErrorProps.push(...$)}}$$.defaultInstance=new $$;$$.serialize=$$.defaultInstance.serialize.bind($$.defaultInstance);$$.deserialize=$$.defaultInstance.deserialize.bind($$.defaultInstance);$$.stringify=$$.defaultInstance.stringify.bind($$.defaultInstance);$$.parse=$$.defaultInstance.parse.bind($$.defaultInstance);$$.registerClass=$$.defaultInstance.registerClass.bind($$.defaultInstance);$$.registerSymbol=$$.defaultInstance.registerSymbol.bind($$.defaultInstance);$$.registerCustom=$$.defaultInstance.registerCustom.bind($$.defaultInstance);$$.allowErrorProps=$$.defaultInstance.allowErrorProps.bind($$.defaultInstance);var _3=$$;var{serialize:ho,deserialize:uo,stringify:io,parse:no,registerClass:ro,registerCustom:co,registerSymbol:mo,allowErrorProps:oo}=$$;class OQ{trpc;constructor($){this.trpc=X3({links:[m8({url:`${$.apiUrl}/trpc`,transformer:_3,headers:()=>({Authorization:`Bearer ${$.apiKey}`})})]})}async whoami(){return this.trpc.apiKeys.whoami.query()}async search($){return this.trpc.search.blocks.query($)}async getContent($){return this.trpc.mcpTools.getContent.query($)}async readImage($){return this.trpc.mcpTools.readImage.query($)}async setImage($){return this.trpc.mcpTools.setImage.mutate($)}async setFigure($){return this.trpc.mcpTools.setFigure.mutate($)}async situate($){return this.trpc.mcpTools.situate.query($)}async getWorkspaceContext(){return this.trpc.mcpTools.getWorkspaceContext.query()}async strReplaceBlock($){return this.trpc.mcpTools.strReplaceBlock.mutate($)}async insertBlock($){return this.trpc.mcpTools.insertBlock.mutate($)}async insertMatrix($){return this.trpc.mcpTools.insertMatrix.mutate($)}async createMatrixFromArtifact($){return this.trpc.mcpTools.createMatrixFromArtifact.mutate($)}async deleteBlock($){return this.trpc.mcpTools.deleteBlock.mutate($)}async createDocument($){return this.trpc.mcpTools.createDocument.mutate($)}async createLiterature($){return this.trpc.mcpTools.createLiterature.mutate($)}async searchArtifacts($){return this.trpc.mcpTools.searchArtifacts.query($)}async createRecord($){return this.trpc.mcpTools.createRecord.mutate($)}async listProcedureNodes($){return this.trpc.mcpTools.listProcedureNodes.query($)}async buildProcedureTree($){return this.trpc.mcpTools.buildProcedureTree.mutate($)}async insertProcedureNode($){return this.trpc.mcpTools.insertProcedureNode.mutate($)}async updateProcedureNode($){return this.trpc.mcpTools.updateProcedureNode.mutate($)}async updateArtifact($){return this.trpc.mcpTools.updateArtifact.mutate($)}async updateDocument($){return this.trpc.mcpTools.updateDocument.mutate($)}async updateRecord($){return this.trpc.mcpTools.updateRecord.mutate($)}async updateLiterature($){return this.trpc.mcpTools.updateLiterature.mutate($)}async placeEntity($){return this.trpc.mcpTools.placeEntity.mutate($)}async setLiteratureContent($){return this.trpc.mcpTools.setLiteratureContent.mutate($)}async updateMatrix($){return this.trpc.mcpTools.updateMatrix.mutate($)}async createArtifact($){return this.trpc.mcpTools.createArtifact.mutate($)}async reorderProcedureNodes($){return this.trpc.mcpTools.reorderProcedureNodes.mutate($)}async deleteProcedureNode($){return this.trpc.mcpTools.deleteProcedureNode.mutate($)}async appendMatrixRows($){return this.trpc.mcpTools.appendMatrixRows.mutate($)}async updateMatrixRows($){return this.trpc.mcpTools.updateMatrixRows.mutate($)}async deleteMatrixRows($){return this.trpc.mcpTools.deleteMatrixRows.mutate($)}async rebindMatrixToNode($){return this.trpc.mcpTools.rebindMatrixToNode.mutate($)}async deleteMatrix($){return this.trpc.mcpTools.deleteMatrix.mutate($)}async attachMatrix($){return this.trpc.mcpTools.attachMatrix.mutate($)}async listMatrixReferences($){let U=(await this.trpc.mcpTools.listMatrixReferences.query($)).references??[];return{success:!0,matrixId:$.matrixId,references:U,totalCount:U.length}}async linkArtifactToNode($){return this.trpc.mcpTools.linkArtifactToNode.mutate($)}async updateEdge($){return this.trpc.mcpTools.updateEdge.mutate($)}async updateArtifactLinkRelation($){return this.trpc.mcpTools.updateArtifactLinkRelation.mutate($)}async unlinkArtifactFromNode($){return this.trpc.mcpTools.unlinkArtifactFromNode.mutate($)}async listNodeArtifactLinks($){return this.trpc.mcpTools.listNodeArtifactLinks.query($)}async instantiateArtifactTemplate($){return this.trpc.mcpTools.instantiateArtifactTemplate.mutate($)}}function NQ($="SURA MCP"){return{info:(I,...U)=>{},error:(I,...U)=>{},warn:(I,...U)=>{},debug:(I,...U)=>{if(process.env.DEBUG);}}}var o6=NQ();async function C3($){let I=NQ();I.info("Initializing server context...");let U=new OQ({apiUrl:$.apiUrl,apiKey:$.apiKey});I.info("Resolving user identity from API key...");let D;try{D=(await U.whoami()).userId,I.info(`Resolved user: ${D.slice(0,8)}...`)}catch(A){I.error("Failed to resolve user identity from API key:",A),I.error("Ensure SURA_API_URL is correct and the API server is running."),process.exit(1)}I.info(`API URL: ${$.apiUrl}`);let b={userId:D,client:U,log:I};try{I.info("Loading workspace context..."),b.workspaceContext=await U.getWorkspaceContext();let A=b.workspaceContext.orgs.length,w=b.workspaceContext.orgs.reduce((O,N)=>O+N.workspaces.length,0);I.info(`Workspace context loaded: ${A} org(s), ${w} workspace(s)`)}catch(A){I.warn("Failed to load workspace context at startup (will retry on first tool call):",A)}return b}var d6=W.enum(["document","record"]),k0=["paragraph","heading","bulletListItem","numberedListItem","checkListItem","codeBlock","quote","table","divider","referenceList","annotationList","referenceItem","structure","structuredMatrix","procedureTree"],q0=["literature","document","record","annotation","artifact"],E0=["molecule","reaction"],$f=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,If=/^(lit|doc|rec|art)-[0-9a-f]{8}$/i,S0=W.string().refine(($)=>$f.test($)||If.test($),{message:"Must be a full UUID or a short entity ref (e.g., lit-a3f7e2b9, rec-1f30176d)"}),XU=50,j0=50;var XQ=W.object({blockType:W.enum(k0).default("paragraph").describe("Type of block to create. Default: paragraph"),content:W.string().describe("Text content for the block"),headingLevel:W.number().int().min(1).max(3).optional().describe("Heading level (1-3) if blockType is heading"),checked:W.boolean().optional().describe("Checked state for checkListItem"),title:W.string().optional().describe('Title for referenceList container (default: "References")'),refNumber:W.number().int().min(1).optional().describe("Reference number for referenceItem (e.g., 1, 2, 3)"),refId:W.string().optional().describe('Stable ref ID for citation linking (e.g., "lit-a3f7e2b9"). Auto-generated from linkedEntityId if omitted.'),refType:W.enum(q0).optional().describe("Type of reference: literature, document, record, or annotation"),linkedEntityId:S0.optional().describe("Linked entity handle (literature, document, record, or artifact). Accepts a full UUID OR a short ref like lit-a3f7e2b9 / rec-1f30176d — the form situate/search return; the executor resolves it to the full UUID."),entityTitle:W.string().optional().describe("Cached title of the linked entity"),doi:W.string().optional().describe("DOI for literature references"),smiles:W.string().optional().describe('SMILES string (e.g., "CCO" for ethanol, "CC(=O)C.N>>CC(N)C.O" for reactions). Required for molecule blocks.'),structureType:W.enum(E0).optional().describe('Structure type for molecule blocks: "molecule" (default) or "reaction"'),moleculeName:W.string().optional().describe('Name of the molecule or reaction (e.g., "Ethanol", "Reductive amination")'),moleculeDescription:W.string().optional().describe("Optional description or notes for the molecule block"),matrixId:W.string().optional().describe("UUID of the linked data matrix for structuredMatrix blocks"),nodeRef:W.string().optional().describe("Procedure tree node ID for structuredMatrix blocks"),matrixLabel:W.string().optional().describe("Display label for structuredMatrix blocks"),showPreview:W.boolean().optional().describe("Whether structuredMatrix should show its inline preview"),recordId:W.string().uuid().optional().describe("Record UUID for procedureTree blocks. The executor auto-fills this from the entityId of a record context — agents should omit it.")});var Uf=W.enum(["text","number","unit","select","boolean"]),bf=W.enum(["mandatory","recommended","optional"]),P0=W.object({key:W.string().min(1).describe("Stable column key"),label:W.string().min(1).describe("Human-readable column label"),type:Uf.describe("Column type"),unit:W.string().optional().describe("Optional display unit"),mandation:bf.describe("Field importance level"),description:W.string().optional().describe("Optional field description"),standardRef:W.string().optional().describe("Optional ontology reference"),options:W.array(W.string()).optional().describe("Allowed values for select columns"),hidden:W.boolean().optional().describe("UI-hidden column. Still surfaced to agents in matrix TOON (with a `hidden` marker in the cols legend) and preserved across row mutations. Use for preset-internal linkage (e.g. stoichiometry `compoundId`).")}),WU=W.record(W.string(),W.union([W.string(),W.number(),W.boolean(),W.null()])),f3=W.enum(["generic","stoichiometry"]),WQ=W.object({entityType:d6.describe('Entity type: "document" or "record"'),entityId:W.string().uuid().describe("Document or record ID"),kind:f3.optional().describe('Typed preset. Defaults to "generic". Use "stoichiometry" for reaction stoichiometry matrices (client-side calc engine derives m/V/n from M/ρ/equiv). When "stoichiometry", `columns` is ignored — the server fills in the stoichiometry preset.'),label:W.string().min(1).describe("Matrix label shown in the editor"),columns:W.array(P0).max(XU).optional().describe('Matrix column definitions. Required for `kind="generic"` (the default). Ignored for `kind="stoichiometry"` (preset columns override).'),rows:W.array(WU).optional().describe("Matrix rows"),nodeRef:W.string().optional().describe("Optional procedure tree node ID for record matrices"),afterBlockId:W.string().optional().describe("Insert AFTER this block ID (sibling insertion)"),beforeBlockId:W.string().optional().describe("Insert BEFORE this block ID (sibling insertion)"),parentBlockId:W.string().optional().describe("Insert as CHILD of this container block"),childPosition:W.string().optional().describe('Position within parent children: "first", "last" (default), or child block ID to insert after'),showPreview:W.boolean().optional().default(!0).describe("Whether the structured matrix block should show its preview")}).refine(($)=>{return[$.afterBlockId,$.beforeBlockId,$.parentBlockId].filter(Boolean).length<=1},{message:"Use only one positioning mode: afterBlockId, beforeBlockId, OR parentBlockId"}).refine(($)=>{if($.childPosition&&!$.parentBlockId)return!1;return!0},{message:"childPosition can only be used with parentBlockId"}).refine(($)=>{if($.kind==="stoichiometry")return!0;return($.columns?.length??0)>=1},{message:'`columns` is required for `kind="generic"` (omit or use `kind="stoichiometry"` for the preset).',path:["columns"]}),Lb={name:"insert_matrix",description:"Create a structured data matrix AND insert its linked `structuredMatrix` block in one call.\n\nThe tool performs two writes atomically from the agent's perspective:\n1. Insert a new `data_matrices` row (columns + rows + label). The row starts at `version: 0`; all subsequent edits go through the `*_matrix_rows` / `rebind_matrix_to_node` / `delete_matrix` tools and each bumps `version`.\n2. Insert a `structuredMatrix` block referencing the new matrix id.\n\nTwo binding modes (both valid for records and documents):\n- **Body-level (default)**: omit `nodeRef`. The matrix belongs to the entity and the block lives at the top-level of the document/record body. Use this for free-standing tabular data (reagent inventory, condition sets attached to the whole experiment, etc).\n- **Node-attached**: pass `nodeRef` = procedure node UUID (records only). The matrix is logically scoped to that node and surfaces in `list_procedure_nodes` under that node's `matrixCount`. Use this when the matrix captures data produced inside a specific procedure step (e.g. readings per screening condition).\n\n**Typed presets via `kind`:**\n- `kind=\"generic\"` (default): supply your own `columns`.\n- `kind=\"stoichiometry\"`: choose this whenever you want reaction stoichiometry semantics — mixing reactants, reagents, solvents, catalysts, products and deriving the missing quantities. `columns` is ignored; the server fills the stoichiometry preset (Compound, Role, Phase, Equiv, Limiting, M, ρ, Purity, Stock c, Stock wt%, V, m, n, c, plus three hidden columns: `compoundId` linking to a `chemical` artifact, `cBasis` controlling how `c` is computed, and `cBasisManualVolume` for manual-basis rows).\n - Row shape: `{ compound, compoundId?, role, phase?, equiv?, limiting?, molecularWeight?, density?, purity?, stockMolarity?, stockWtPercent?, volume?, mass?, moles?, concentration?, cBasis?, cBasisManualVolume? }`.\n - **Phase grouping** (`phase` column): free-form text label that groups rows for per-phase volume totals. Use for biphasic syntheses (e.g. `phase: \"aqueous\"` vs `phase: \"oil\"`) or to sum per-mixture volumes within a single-pot reaction (e.g. `phase: \"aqueous\"` for water + dissolved CTAC + TEA). Leave blank for single-phase matrices. The UI renders a totals strip below the table; agents can read back via `get_content` to verify mass/volume balance per phase.\n - **Client-side calc engine auto-derives empty cells on every render. Do NOT pre-compute values you can leave null.** The identities propagated are: `n = m / M`, `n = V · c`, `m = V · ρ · purity` (neat liquids), `n = stockMolarity · V` (aqueous stock), `n = stockWtPercent · ρ_soln · V / M` (wt%-labelled stock), `n_i = equiv_i · n_limiting` (by row), and the reverse `equiv_i = n_i / n_limiting` (so molar ratios surface even when the user only entered masses). Derivation respects user-entered values — any non-null cell is treated as locked and never overwritten.\n - Limiting reactant: set `limiting: true` on exactly one reactant row (the engine also auto-picks the first reactant with enough info if none is flagged). Other reactants should carry `equiv` (molar ratio relative to limiting).\n - Units are fixed: M in g/mol, ρ in g/mL, V in mL, m in g, n in mmol, c in mol/L, purity as a decimal fraction (0–1), stockMolarity in mol/L, stockWtPercent in 0–100.\n - **Stock solution inputs**: for aqueous reagents (e.g. \"2 M NaOH\", \"25 wt% CTAC\"), prefer `stockMolarity` or `stockWtPercent` over `purity`. `purity` describes the dissolved compound itself (a neat liquid descriptor); `stockMolarity`/`stockWtPercent` describe the solution. Use only one of stockMolarity / stockWtPercent per row.\n - **Concentration basis** (`cBasis`, `cBasisManualVolume`): the displayed `c` is `n / V_ref` where the reference volume is picked per row. Defaults — solvent rows use `\"none\"` (c blank), non-solvent rows with a `phase` tag use `\"phase\"` (c relative to V_phase), other non-solvent rows use `\"total\"` (c relative to V_total). Leave `cBasis` null to inherit the default; explicit values are `\"none\" | \"phase\" | \"total\" | \"manual\"`. `\"manual\"` requires `cBasisManualVolume` (mL) and uses that as V_ref. Don't set these unless the user has chosen a non-default basis.\n - Minimal pattern for a reaction: one reactant with `{ role: 'reactant', limiting: true, equiv: 1, molecularWeight, mass OR volume }`; additional reactants with `{ role: 'reactant', equiv, molecularWeight }` (cells left null; the engine fills them from the limiting moles).\n\nIf a procedure node is later deleted, its matrices' `nodeRef` is cleared to null (FK `ON DELETE SET NULL`) and they surface in `list_procedure_nodes` as orphans — rebind via `rebind_matrix_to_node` or drop via `delete_matrix`.\n\nPositioning for the block:\n- `afterBlockId`: insert as SIBLING after the specified block\n- `beforeBlockId`: insert as SIBLING before the specified block\n- `parentBlockId`: insert as CHILD of a container block (e.g. inside a procedure section)\n- Omit all three: append the block at the end of the document. Safe for parallel `insert_matrix` calls — each one appends after the current tail, so agents can batch inserts instead of serialising on `afterBlockId`.\n\nExamples:\n- Body-level matrix appended after an existing block:\n `insert_matrix(entityType=\"record\", entityId=\"...\", afterBlockId=\"...\", label=\"Aqueous phase composition\", columns=[...], rows=[...])`\n- Node-attached matrix nested inside a procedure section:\n `insert_matrix(entityType=\"record\", entityId=\"...\", parentBlockId=\"...\", childPosition=\"last\", label=\"Screening Matrix\", columns=[...], rows=[...], nodeRef=\"...\")`\n\n**Record draft-gate:** matrices on records require the record to be in `draft` status. `completed` / `locked` records return a structured `record_not_draft` error — stop and surface it to the user; agents cannot flip record status themselves."};var GQ=W.object({matrixId:W.string().uuid().describe("UUID of the target data_matrix."),rows:W.array(WU).min(1).describe("New rows to append at the END of the existing rows array. **Row objects must be keyed by `col.key` (the stable column id), NOT `col.label`.** Unknown keys are retained in JSONB but never rendered and cannot be selected by `rowMatch` later. Call `get_content` on the owning entity first to read the column schema (`cols: key(Label,type[,unit])`)."),version:W.number().int().min(0).describe("Current matrix version (optimistic locking). Must equal the server's stored version; otherwise returns a matrix_version_conflict error with the actual version. Get the current version from `get_content` / `list_procedure_nodes` / prior tool output.")}),Jb={name:"append_matrix_rows",description:["Append rows to the end of an existing data matrix (body-level or node-attached).","**Row objects must be keyed by `col.key`, not `col.label`.** Read the schema first via `get_content` on the owning entity; the matrix TOON shows `cols: key(Label,type[,unit])` and a `{key1,key2,...}` row header. Writing under a label-name that differs from the key persists opaque JSONB that the UI cannot render.","Bumps `version` on success; stale `version` returns a structured `matrix_version_conflict` error with the current server version so you can re-fetch and retry.","Only draft records are writable; completed/locked records return a `record_not_draft` error. Matrices on documents/literature/artifacts have no draft gate.","Prefer this over rewriting the entire matrix via the legacy path — row identity is preserved for downstream consumers.",'**Stoichiometry matrices** (`kind=stoichiometry` in the matrix header): leave cells empty (`null`) whenever the client-side calc engine should derive them from the chemistry identities (n = m/M, n = V·c, m = V·ρ·purity, n = stockMolarity·V, n = stockWtPercent·ρ_soln·V/M, n_i = equiv_i · n_limiting, equiv_i = n_i / n_limiting). Only persist values you explicitly measured or want to lock. For aqueous reagent stocks (NaOH(aq), CTAC(aq), TEA(aq)) prefer `stockMolarity` (mol/L) or `stockWtPercent` (0–100) over `purity`. Must preserve `compoundId` (hidden column) verbatim on any row you touch — it is the link to the chemical artifact that auto-fills M and ρ. Two more hidden row keys control how the displayed `c` is computed: `cBasis` (one of `null` | `"none"` | `"phase"` | `"total"` | `"manual"`; null = let the engine pick a default from role+phase, "phase" = c relative to V_phase, "total" = c relative to V_total, "manual" = c relative to `cBasisManualVolume`, "none" = blank c) and `cBasisManualVolume` (mL, only used when cBasis="manual"). Leave both null unless the user has explicitly set them.'].join(" ")};var QQ=W.object({matrixId:W.string().uuid().describe("UUID of the workspace-owned matrix to attach."),entityType:W.enum(["record","artifact","document","literature"]).describe("Owner entity type. Typical use: `record` or `artifact`. Literature attach is currently not supported server-side and will fail."),entityId:W.string().uuid().describe("Owner entity UUID. The owner MUST live in the same workspace as the matrix, or the server rejects with invalid_matrix_owner."),nodeRef:W.string().uuid().optional().describe("Optional: if provided, AND the owner is a record, also bind the matrix to this procedure node in the same call. The node must belong to `entityId`."),version:W.number().int().min(0).describe("Current matrix version (optimistic locking). Must equal the server's stored version; otherwise returns a matrix_version_conflict error.")}),Hb={name:"attach_matrix",description:["Bind a workspace-owned (orphan) matrix to a provenance owner. Matrices become workspace-owned when their original record/document is deleted — the trigger promotes them instead of cascading. This tool claims them back to a new record or artifact in the same workspace.","Workspace match is enforced server-side: the owner entity MUST live in the same workspace as the matrix. Cross-workspace attach returns an `invalid_matrix_owner` error.","If `nodeRef` is provided and `entityType` is `record`, the matrix is also bound to that procedure node in the same call (combines attach + rebind). The node must belong to the target record.","Bumps `version` on success; stale `version` returns a structured `matrix_version_conflict` error.","Only draft records are writable; attaching to a completed/locked record returns `record_not_draft`.","Use `list_matrix_references` first if you want to see which documents/records embed the matrix before attaching."].join(" ")};var GU=W.enum(["procedure","characterization","observation","step"]),QU=W.object({type:W.literal("file"),target:W.enum(["local","server","url"]),path:W.string().min(1),format:W.string().min(1),label:W.string().min(1),instrument:W.string().optional(),metadata:W.record(W.string(),W.union([W.string(),W.number(),W.boolean()])).optional()}),Z3=W.object({artifactId:W.string().uuid(),role:W.enum(["input","output","derived_from","referenced"]),context:W.record(W.string(),W.unknown()).optional()}),g3=W.object({matrixId:W.string().uuid()}),Mb=W.object({tempId:W.string().min(1).describe("Agent-chosen temporary id; remapped to a real uuid on insert. Must be unique within the input list."),parentTempId:W.string().nullable().optional().describe("tempId of the parent node, or null/omit for a root node of the tree."),label:W.string().min(1).describe("Human-readable node label."),type:GU.describe("Node type: procedure (top-level), step (intermediate), characterization (measurement), observation (note)."),order:W.number().int().min(0).optional().describe("Order within siblings. Defaults to append (one past the last existing sibling)."),copyable:W.boolean().optional().describe('Whether this node is template-copyable. MUST be false when type === "observation".'),analyticalData:W.array(QU).optional().describe("File references attached to this node (the typed `analytical_data` JSONB field). Artifact links live in `artifactLinks` below."),artifactLinks:W.array(Z3).optional().describe("Existing artifacts to link to this node at creation time. Use when the agent already has artifactIds in context (e.g., from `search` or a prior `create_artifact` call). For new artifacts, prefer `create_artifact({ linkToNode })` instead. Failures on individual links are non-fatal — the node is still created and a per-node summary is returned."),matrices:W.array(g3).optional().describe("Existing data matrices to bind to this node at creation time. Workspace orphans are attached + bound; matrices already owned by this record are rebound. Cross-record matrices are rejected (would steal them from the other tree). For new matrices, call `insert_matrix(nodeRef=…)` after the tree exists."),body:W.string().optional().describe('This node\'s prose, as markdown — the same syntax you use for document/record content (headings, bullet/numbered lists, **bold**, *italic*, `code`, [[mention:type:uuid|Label]], etc.). Seeds the node body so the text renders under the node in the procedure tree. Authored once at creation; edit the prose directly afterwards. Renders once the record body has a `procedureTree` block (insert one with `insert_block(blockType:"procedureTree")` if absent). Do NOT dump step prose as loose body paragraphs — put it here so it attaches to the node.')}).refine(($)=>!($.type==="observation"&&$.copyable===!0),{message:'copyable must be false (or omitted) when type is "observation".',path:["copyable"]});var y3=W.enum(["replace","append"]),YQ=W.object({recordId:W.string().uuid().describe("Target record UUID. Must be in draft status."),nodes:W.array(Mb).min(1).describe("Flat procedure-tree list. Each node carries a tempId (and optional parentTempId) that the server remaps to real uuids."),mode:y3.describe('"replace" deletes the existing tree first (destructive); "append" grafts the new nodes on top of the current structure.'),confirm:W.literal(!0).optional().describe('MUST be set to true when mode="replace" — model-level self-check that the caller understands the existing tree (and its orphaned matrices) will be cleared.'),rootParentId:W.string().uuid().optional().describe("Append mode only — existing node uuid under which the new roots should be grafted. Omit to graft as top-level siblings.")}).refine(($)=>!($.mode==="replace"&&$.confirm!==!0),{message:'mode="replace" requires confirm: true — destructive operation.',path:["confirm"]}).refine(($)=>!($.mode==="replace"&&$.rootParentId!==void 0),{message:"rootParentId is only valid in append mode; replace wipes the tree first.",path:["rootParentId"]}),Vb={name:"build_procedure_tree",description:["Atomically build or augment the procedure-node tree of an ELN record from a canonical JSON tree.","Input is a flat list of nodes using `tempId` / `parentTempId` references; the server remaps to real uuids and returns the mapping.","Modes:","- `append`: grafts the new subtree onto existing structure (either as new roots or under `rootParentId`).","- `replace` (destructive): deletes the entire existing tree first, then inserts the new one. **Requires `confirm: true`** and will orphan any matrices that were bound to deleted nodes — check with `list_procedure_nodes` first.","Only draft records are writable; completed/locked records return a `record_not_draft` error.",'`type === "observation"` nodes must have `copyable` omitted or `false`.',"For surgical edits to a single node prefer `insert_procedure_node` / `update_procedure_node` over a full rebuild."].join(" ")};var x3=["sample","dataset","protocol","file","equipment","chemical","model","reaction"],Df=["molecule","material","mixture","biomacromolecule"],Af=W.enum(Df),l3=["active","depleted","archived","draft"],R0=W.enum(x3),YU=W.enum(l3),wf=W.enum(["merge","replace"]).default("merge").describe('How to apply `properties`. "merge" (default): top-level keys in `properties` are merged into the existing JSONB; pass `null` for a key to delete it. "replace": the supplied object fully overwrites the existing JSONB.'),vQ=W.object({id:W.string().uuid().describe("UUID of the artifact to update."),name:W.string().min(1).optional().describe("Display name (skip to keep existing)."),description:W.string().optional().describe("Plain-text description. Pass an empty string to clear."),tags:W.array(W.string()).optional().describe("Replaces the tag set. Pass an empty array to clear all tags. Omit to leave tags untouched."),properties:W.record(W.string(),W.unknown()).optional().describe("Free-form JSONB blob. By default merged into existing properties (see `propertiesMode`). Common keys per type: sample → batch, storage_conditions, preparation_date; dataset → format, row_count, source_instrument; chemical → cas_number, molecular_formula, supplier; equipment → model, serial, last_calibration. Advisory only — any keys allowed."),propertiesMode:wf.optional(),structureClass:Af.optional().describe("Chemical structure-class discriminator (molecule | material | mixture | biomacromolecule). Only meaningful for chemical artifacts — it selects the typed property schema. Changing it RETAINS prior class-specific values as unmapped custom properties; nothing is dropped."),artifactType:R0.optional().describe("Change the artifact type. Note: existing `properties` are NOT auto-migrated to the new type's advisory schema."),status:YU.optional().describe("Lifecycle status: active | depleted | archived | draft."),storageRef:W.string().optional().describe("Free-form storage pointer (path, URL, locker code)."),location:W.string().optional().describe("Free-form physical/logical location."),parentId:W.string().uuid().nullable().optional().describe("Parent artifact UUID for hierarchies (e.g. sub-samples). Pass null to detach."),templateId:W.string().uuid().nullable().optional().describe("Template binding. Pass null to detach.")}).refine(($)=>$.name!==void 0||$.description!==void 0||$.tags!==void 0||$.properties!==void 0||$.structureClass!==void 0||$.artifactType!==void 0||$.status!==void 0||$.storageRef!==void 0||$.location!==void 0||$.parentId!==void 0||$.templateId!==void 0,{message:"Provide at least one field to update (name, description, tags, properties, structureClass, artifactType, status, storageRef, location, parentId, templateId)."}),Kb={name:"update_artifact",description:["Update non-identity fields of an artifact (name, description, tags, properties, structureClass, artifactType, status, storageRef, location, parentId, templateId).",'`properties` (JSONB) is merged into the existing blob by default — pass `propertiesMode: "replace"` for full overwrite. Use null on a key in merge mode to delete it.',"Identity fields (id, workspaceId, orgId, createdBy*, sourceRecordId, deletedAt, timestamps) are never writable through this tool.","Soft-delete and link mutations have their own paths and are out of scope.","Unrecognized property keys are accepted (custom JSONB) but trigger a warning that returns the full typed schema for the artifact type. Use the schema to self-correct on the next call."].join(" ")};var h3=W.object({cid:W.number().int().positive().optional().describe("PubChem CID. Most specific identifier — bypasses lookup."),cas:W.string().optional().describe('CAS Registry Number (e.g. "71-43-2"). Resolved via PubChem CID lookup.'),inchiKey:W.string().optional().describe('27-character InChIKey (e.g. "UHOVQNZJYSORNB-UHFFFAOYSA-N"). Most reliable for exact-compound lookup.'),name:W.string().optional().describe("Compound name (IUPAC, common, brand). Resolved via PubChem name search; uses the top match.")}).refine(($)=>$.cid||$.cas||$.inchiKey||$.name,{message:"enrichFromPubchem requires at least one of: cid, cas, inchiKey, name"}),BQ=W.object({name:W.string().min(1).max(500).describe('Display name for the artifact (e.g. "DMSN_66c", "TEOS lot 4").'),artifactType:R0.describe('sample | dataset | protocol | file | equipment | chemical | model | reaction. `chemical` is the substance (one per workspace per InChIKey/CCDC); `sample` is a physical instance of a chemical (set `parentId` to the chemical artifact). `reaction` is a sibling type — a transformation (e.g. "Suzuki coupling"), never a sub-flavor of chemical.'),workspaceId:W.string().uuid().optional().describe("Workspace ID. The workspace's orgId is used as the artifact's org (any organizationId passed alongside is ignored). When omitted, falls back to the user's first workspace."),organizationId:W.string().uuid().optional().describe("Organization ID. Ignored when workspaceId is provided — derived from the workspace. Auto-resolved to the user's first org only when nothing more specific is passed."),description:W.string().optional().describe("Plain-text description."),tags:W.array(W.string()).optional().describe("Tag names. Resolved to canonical tag IDs server-side (alias-aware)."),properties:W.record(W.string(),W.unknown()).optional().describe(["Free-form JSONB blob. Common keys per type: sample → batch, storage_conditions, preparation_date; dataset → format, row_count, source_instrument; equipment → model, serial, last_calibration; reaction → transformation_class (required: molecular | sol_gel | polymerization | crystallization | self_assembly | mechanochemistry | biological | other), transformation_summary (free-text for non-molecular), rxn_smiles (molecular only), precursor_smiles, reaction_class, description.",'For chemical artifacts, set `properties.structureClass` to one of: "molecule" (default; PubChem-shaped — iupac_name, molecular_formula, cas_number, canonical_smiles, inchi, inchi_key, molecular_weight, density, ghs_*, …), "material" (MOFs/COFs/zeolites/perovskites — topology, space_group, unit_cell, ccdc_number, framework_formula, bet_surface_area, pore_volume, pore_size, skeletal_density), "mixture" (solutions/electrolytes — components JSON-array of `{artifactId, ratio, role?}`, solvent, concentration_basis), or "biomacromolecule" (proteins/oligonucleotides — uniprot_id, pdb_id, sequence, molecular_weight, pi).',"The server validates keys against the chosen class's typed schema and returns near-match suggestions for likely typos (warn-but-accept). Unknown keys are stored either way; the warning surfaces in the response so you can self-correct on the next call.","Advisory only — any keys allowed."].join(" ")),status:YU.optional().describe('Lifecycle status (default: active). Use "draft" for partially-known artifacts the user still needs to verify.'),storageRef:W.string().optional().describe("Free-form storage pointer (path, URL, locker code)."),location:W.string().optional().describe("Free-form physical/logical location."),parentId:W.string().uuid().optional().describe("Parent artifact UUID for hierarchies (e.g. sub-samples)."),sourceRecordId:W.string().uuid().optional().describe('UUID of the record this artifact was extracted/derived from. Sets provenance for the entity-search "derived from" view.'),templateId:W.string().uuid().optional().describe("Optional template binding."),enrichFromPubchem:h3.optional().describe('When set and artifactType is "chemical" with structureClass molecule (or absent), resolve the identifier (cid > inchiKey > cas > name) and auto-fill missing properties from PubChem. Agent-supplied properties always win — enrichment never overwrites. PubChem does NOT index periodic materials, mixtures, biomacromolecules, or reactions, so this is a no-op (logged) for those classes. Failures (no match, PubChem unreachable) do NOT block creation; the artifact is still created with whatever was provided, and the enrichment status is reported in the result.'),linkToNode:W.object({nodeId:W.string().uuid(),role:W.enum(["input","output","derived_from","referenced"]),context:W.record(W.string(),W.unknown()).optional()}).optional().describe("When set, immediately link the newly-created artifact to this procedure node. Equivalent to: `create_artifact(...)` → `link_artifact_to_node({ nodeId, artifactId, role })` — provided as a convenience for the common create-and-link flow. Per-link failures are non-fatal: the artifact is still created and the link error is surfaced in the response.")}),zb={name:"create_artifact",description:["Create a new artifact (sample, dataset, protocol, file, equipment, chemical, model, or reaction).","Pass `workspaceId` to control where it lands; otherwise the user's first workspace is used. Artifacts are workspace-level — there is no space association.",'`createdBySource` is forced to "agent" — never user-controllable through this tool.',"`properties` is free-form JSONB; advisory keys per type are listed in the field description but never enforced.","For molecular chemical artifacts: prefer `enrichFromPubchem: { cas | cid | inchiKey | name }` over hand-assembling properties — the server canonicalizes via PubChem, dedups by InChIKey within the workspace, and auto-fills SMILES/InChI/formula/MW/GHS/transport/descriptors with fillIfAbsent semantics (your `properties` always win). Enrichment failures don't block creation.",'For periodic materials (MOFs/COFs/zeolites/perovskites): set `properties.structureClass = "material"` and supply the structural identity tuple (topology + space_group + unit_cell + ccdc_number) by hand — PubChem does NOT index periodic structures.','For mixtures (solutions/electrolytes): set `properties.structureClass = "mixture"` and reference component chemicals via `properties.components` (JSON array of {artifactId, ratio, role?}). Each component should already exist as a chemical artifact in the workspace.','For reactions: set `artifactType = "reaction"` and supply `properties.transformation_class` — one of: molecular, sol_gel, polymerization, crystallization, self_assembly, mechanochemistry, biological, other. For `molecular` reactions also supply `rxn_smiles`. For everything else write a short `transformation_summary` describing what is actually happening. Reactions are sibling artifacts, not chemicals.','For samples (physical instances of a chemical): set `artifactType = "sample"` and `parentId = <chemical artifact id>`; the chemical\'s typed properties flow through the UI when the sample is displayed.',"Use this when the user asks to register a new sample, dataset, instrument, chemical, material, mixture, or reaction. To attach the new artifact to a procedure node, pass `linkToNode` (artifact + node + role) — atomic create-and-link.","Unrecognized property keys are accepted (custom JSONB) but trigger a warning that returns the full typed schema for the artifact type. Use the schema to self-correct on the next call."].join(" ")};var LQ=W.object({title:W.string().min(1).max(500).describe("Title for the new document"),content:W.string().optional().describe("Optional initial content in markdown format"),organizationId:W.string().uuid().optional().describe("Organization ID (auto-resolved if omitted; ignored when spaceId is provided — derived from the space instead)"),workspaceId:W.string().uuid().optional().describe("Workspace ID (auto-resolved if omitted; ignored when spaceId is provided — derived from the space instead)"),spaceId:W.string().uuid().optional().describe("Optional space ID. When provided the document is created inside that space and workspace/organization are derived from it. Caller must be a member of the space with write access. Omit for a private (workspace-only) document."),tags:W.array(W.string()).optional().describe("Canonical tag display names to assign to the new document. Existing tags are matched case-insensitively; unknown tags are auto-created within the org. Renaming/merging tags later via the canonical tag system is rename-safe.")}),Fb={name:"create_document",description:"Create a new document. By default the document is private to the user in their current workspace. Pass `spaceId` to create it inside a specific space (shared with space members); workspace and organization are then derived from the space automatically. Use this when the user asks you to create a new document, draft, or note. You can optionally provide initial content in markdown format. "+'The document is attributed to the user as creator; `createdBySource` is forced to "agent" — never user-controllable through this tool.'};var JQ=W.object({title:W.string().min(1).max(500).describe("Paper title"),doi:W.string().optional().describe("DOI for metadata resolution and CORE full text fetch"),authors:W.array(W.string()).optional().describe('Author full names (e.g., ["John Smith", "Jane Doe"]). Omit when a DOI is available so the server can resolve authoritative metadata.'),journal:W.string().optional().describe("Journal name"),year:W.number().int().positive().optional().describe("Publication year"),sourceUrl:W.string().url().optional().describe("Publisher page URL where the paper can be found"),organizationId:W.string().uuid().optional().describe("Organization ID (auto-resolved if omitted)"),workspaceId:W.string().uuid().optional().describe("Workspace to assign the paper to"),spaceId:W.string().uuid().optional().describe("Space within workspace"),fetchFullText:W.boolean().optional().default(!1).describe("When true, fetches full text from CORE and stores as structured content blocks. Requires DOI. Default false for metadata-only creation."),tags:W.array(W.string()).optional().describe("Canonical tag display names to assign to the literature item. Merged with any tags resolved from the DOI metadata (the union is applied).")}),kb={name:"create_literature",description:"Import a research paper into the user's library. Creates a literature item with bibliographic metadata. If a DOI is provided, the server will try to resolve authoritative metadata before creating the item. Set fetchFullText=true to also fetch and parse the full text from CORE (requires DOI). If a DOI is provided and already exists in the library, returns the existing item (idempotent). Use this when the user explicitly asks to import or add a paper to their library. "+'The item is attributed to the user as creator; `createdBySource` is forced to "agent" — never user-controllable through this tool.'};var HQ=W.object({artifactId:W.string().uuid().describe("UUID of the source artifact to derive the matrix from. Reaction artifacts synthesize a stoichiometry matrix from their typed `linkSlots`; other artifact types (protocols, equipment, …) copy a column schema from one of their attached matrices."),workspaceId:W.string().uuid().describe("Workspace scope. Must match the source artifact and (if provided) the target entity."),entityType:W.enum(["record","artifact","document","literature"]).optional().describe("Owner entity type for the spawned matrix. Omit to create a workspace-orphan matrix. Typical use: `record` paired with a `nodeRef`."),entityId:W.string().uuid().optional().describe("Owner entity UUID. Required when `entityType` is set."),nodeRef:W.string().uuid().optional().describe('Procedure node UUID. When set with `entityType: "record"` AND the source is a reaction artifact, also ensures a procedure_node ↔ reaction artifact link exists (idempotent — duplicate calls are safe).'),matrixId:W.string().uuid().optional().describe("Optional: UUID of a specific matrix attached to the source artifact to copy from. REQUIRED when the source artifact has multiple attached matrices (non-reaction sources). Passing it on a reaction artifact forces the column-copy path instead of the synthesize-from-linkSlots default."),label:W.string().min(1).optional().describe('Optional matrix label. Defaults to "Stoichiometry — <reaction name>" for reaction sources, or the source matrix label for column-copy sources.')}),qb={name:"create_matrix_from_artifact",description:["Spawn a new matrix from a source artifact. Two modes, auto-selected by source artifact type (override with `matrixId`):","(1) **Reaction artifact** (default for `artifactType: \"reaction\"`): walks the artifact's typed `linkSlots` (reactant / product / reagent / catalyst / solvent), pulls each linked chemical artifact's name + MW + density, and emits one stoichiometry row per bound slot using the slot's `stoichCoefficient`. Slots without a `defaultArtifactId` are skipped — fill those by hand on the derived matrix.","(2) **Column-copy** (any artifact with attached matrices — protocols, equipment, custom artifact types, or reaction artifacts when `matrixId` is passed): copies the column schema (NOT the rows — pure template) from one of the source artifact's attached matrices to a new matrix on the target. The agent fills the rows. If the source artifact has multiple attached matrices and `matrixId` is omitted, the call returns a structured `ambiguous_matrix_selection` error listing the available matrix IDs so the agent can re-call with a selector. If the source has zero attached matrices and is not a reaction, returns `no_matrices_on_artifact`.","In both modes, `derivedFromArtifactId` is stamped on the new matrix for provenance. Frozen invariant: edits to the source artifact / matrix never propagate forward; this is a one-shot copy at instantiation time.",'When `entityType: "record"` + `nodeRef` are set AND the source is a reaction artifact, the matrix is bound to the procedure node AND a `procedure_node → reaction artifact` link is ensured (created if absent). One call replaces "link reaction to node" + "spawn matrix" + "bind to node."',"Returns the new matrix in the same shape as `insert_matrix`."].join(" ")};var MQ=W.object({title:W.string().min(1).max(500).describe("Title for the new record."),organizationId:W.string().uuid().optional().describe("Organization ID. Ignored when spaceId or workspaceId is provided — derived from the parent scope. Auto-resolved to the user's first org only when nothing more specific is passed."),workspaceId:W.string().uuid().optional().describe("Workspace ID. Ignored when spaceId is provided — derived from the space. Otherwise the workspace's organizationId is used as the record's org (any organizationId passed alongside is ignored)."),spaceId:W.string().uuid().optional().describe("Optional space to attach the record to. When omitted the record lives at workspace level only."),recordDate:W.string().regex(/^\d{4}-\d{2}-\d{2}$/,"Expected YYYY-MM-DD").optional().describe("ISO date (YYYY-MM-DD) of the research activity, used for calendar navigation. Defaults to today."),recordType:W.string().max(120).optional().describe('Freeform record category (e.g. "Experiment", "Characterization", "Protocol").'),collaborators:W.array(W.string().uuid()).optional().describe("User ids participating in this research activity."),tags:W.array(W.string()).optional().describe("Canonical tag display names to assign to the new record. Existing tags are matched case-insensitively; unknown tags are auto-created within the org. Renaming/merging tags later via the canonical tag system is rename-safe."),initialTree:W.array(Mb).optional().describe("Optional flat procedure-tree list built via parentTempId. Inserted after the record is created; on success the response carries a tempId → nodeId map.")}),Eb={name:"create_record",description:["Create a new ELN research record in the user's workspace.","Records are always created in `draft` status and begin empty — you can populate the prose body with the edit tools afterwards.","Pass `spaceId` to attach the record to a specific space; otherwise it lives at workspace level only.","Provide `initialTree` to stand up the procedure-node tree in the same call (topological insert, parentTempId → parentId).",'`type === "observation"` nodes are required to have `copyable === false` (or omitted).',"Use this when the user asks you to create a new record, experiment entry, or lab notebook page.",'The record is attributed to the user as creator; `createdBySource` is forced to "agent" — never user-controllable through this tool.'].join(" ")};var T0=W.object({entityType:d6.describe('Entity type: "document" or "record"'),entityId:W.string().uuid().describe("Document or record ID"),blockId:W.string().optional().describe("Block ID to delete (for single delete)"),blockIds:W.array(W.string()).max(j0).optional().describe(`Array of block IDs to delete (batch mode, max ${j0})`)}),Of=T0.refine(($)=>{let I=$.blockId!==void 0,U=$.blockIds!==void 0&&$.blockIds.length>0;return I!==U},{message:"Provide either blockId (single delete) or blockIds (batch delete), not both"}),Sb={name:"delete_block",description:"Delete blocks from a document. Supports single (blockId) or batch (blockIds) mode. Batch mode is more efficient for deleting multiple blocks in one operation. Be careful - this permanently removes blocks and their content. Use get_content first to verify blocks before deleting. "+"Records: only `draft` records are writable; `completed`/`locked` records return a `record_not_draft` error — do not try to flip the status yourself. "+"Do NOT attempt to delete `procedureTree`, `procedureSection`, or `nodeArtifacts` blocks on records — those are sync projections of table-backed rows and re-render on every sync; use the `*_procedure_node` tools to mutate the tree instead."};var VQ=W.object({matrixId:W.string().uuid().describe("UUID of the matrix to delete."),version:W.number().int().min(0).describe("Current matrix version (optimistic locking). Must equal the server's stored version; otherwise returns a matrix_version_conflict error."),acknowledgeDataLoss:W.literal(!0).describe("Model-level confirmation: MUST be set to true. Deleting the matrix removes all rows AND the linked structuredMatrix block from the owning document/record. Not recoverable outside of version snapshots.")}),jb={name:"delete_matrix",description:["Delete a data matrix row AND the `structuredMatrix` block that references it in the owning document/record. Both writes happen in the same tool call.","Requires `acknowledgeDataLoss: true` as a model-level self-check — prefer `delete_matrix_rows` or `rebind_matrix_to_node` for less-destructive edits.","Bumps `version` on success; stale `version` returns a structured `matrix_version_conflict` error with the current server version.","Only draft records are writable; completed/locked records return a `record_not_draft` error. Matrices on documents/literature/artifacts have no draft gate.","Undo path: `record_versions` snapshots capture matrix state together with Y.js content when a version is cut, so a prior snapshot restore can recover an accidentally deleted matrix for records under version control."].join(" ")};var Nf=W.record(W.string(),W.union([W.string(),W.number(),W.boolean(),W.null()])).describe("Row match: every provided key/value must equal the row's current value. Matches all rows where the criteria hold."),KQ=W.object({matrixId:W.string().uuid().describe("UUID of the target data_matrix."),rowIndices:W.array(W.number().int().min(0)).min(1).optional().describe("Absolute 0-based indices of rows to delete in the current rows array. Indices resolve against the pre-delete snapshot (batch-safe)."),rowMatch:Nf.optional(),version:W.number().int().min(0).describe("Current matrix version (optimistic locking). Must equal the server's stored version; otherwise returns a matrix_version_conflict error.")}).refine(($)=>{let I=$.rowIndices!==void 0,U=$.rowMatch!==void 0;return I!==U},{message:"Provide exactly one of `rowIndices` (absolute indices) or `rowMatch` (by column values).",path:["rowIndices"]}),Pb={name:"delete_matrix_rows",description:["Remove rows from an existing data matrix, either by absolute `rowIndices` or by `rowMatch` (every column/value in the match must equal the row's current cell). Match mode deletes every row that satisfies the criteria.","**`rowMatch` MUST use `col.key` as each object key, NOT `col.label`** — the schema is visible via `get_content` on the owning entity (`cols: key(Label,type[,unit])` + `{key1,key2,...}` row header).","Bumps `version` on success; stale `version` returns a structured `matrix_version_conflict` error with the current server version so you can re-fetch and retry.","To remove the matrix itself (row + structuredMatrix block) use `delete_matrix`. This tool only prunes rows.","Only draft records are writable; completed/locked records return a `record_not_draft` error."].join(" ")};var zQ=W.object({nodeId:W.string().uuid().describe("UUID of the procedure node to delete."),acknowledgeCascade:W.literal(!0).describe("Model-level confirmation: MUST be set to true. Deleting a node cascades to all descendants via FK and orphans any bound matrices (matrix.nodeRef → null).")}),Rb={name:"delete_procedure_node",description:["Delete a procedure-tree node and all of its descendants (FK cascade).","Any matrices bound to deleted nodes have their `nodeRef` cleared — the response lists the orphaned matrix ids so the agent can rebind or drop them via the matrix tools.","Requires `acknowledgeCascade: true` as a model-level self-check — check `list_procedure_nodes` before deleting to understand the subtree you are about to remove.","Only draft records are writable; completed/locked records return a `record_not_draft` error."].join(" ")};function z$($){return` ${$.map((U)=>{if(U===null||U===void 0||U==="")return"";let D=String(U);return D.includes(",")?`"${D}"`:D}).join(",")}`}function _0($){if(!$)return"";let I=[];if($.previousBlock)I.push(`After: [${$.previousBlock.type} | ${$.previousBlock.id}]`);if($.nextBlock)I.push(`Before: [${$.nextBlock.type} | ${$.nextBlock.id}]`);return I.join(", ")}function n3($,I,U=150){let D=0,b=Math.min($.length,I.length);while(D<b&&$[D]===I[D])D++;let A=0;while(A<b-D&&$.at(1+A)===I.at(1+A))A++;let w=Math.floor(U/2),O=Math.max(0,D-w),N=Math.min($.length,$.length-A+w),X=Math.min(I.length,I.length-A+w),G=O>0?"...":"",Q=N<$.length?"...":"",Y=X<I.length?"...":"",v=`${G}${$.slice(O,N)}${Q}`,L=`${G}${I.slice(O,X)}${Y}`;return`--- before
|
|
38
|
+
${v}
|
|
39
39
|
+++ after
|
|
40
|
-
${
|
|
41
|
-
`)}function
|
|
42
|
-
No results.`;let b=[I,...D?["hasMore"]:[]].join(", "),
|
|
43
|
-
`)}function
|
|
44
|
-
`)}function
|
|
45
|
-
`)}function
|
|
46
|
-
`);return
|
|
47
|
-
`)}function
|
|
48
|
-
`);return
|
|
49
|
-
`)}function
|
|
50
|
-
`);if($.overview){if($.overview.wordCount)I.push(`*~${$.overview.wordCount} words*`);if(I.push(""),$.overview.abstract)I.push("**Preview:**"),I.push($.overview.abstract),I.push("");if($.overview.toc&&$.overview.toc.length>0)I.push("**Table of Contents:**"),I.push(
|
|
51
|
-
`)}function
|
|
52
|
-
`)}function
|
|
40
|
+
${L}`}function kQ($){let I=[];I.push(`[workspace context | default org:${$.defaults.orgId}${$.defaults.workspaceId?` ws:${$.defaults.workspaceId}`:""}]`);let U=0,D=[];for(let b of $.orgs)for(let A of b.workspaces)if(A.spaces.length===0)D.push(z$([b.name,b.id,A.name,A.id,A.type,"","",""])),U++;else for(let w of A.spaces)D.push(z$([b.name,b.id,A.name,A.id,A.type,w.name,w.id,w.type])),U++;return I.push(`{org,orgId,workspace,wsId,wsType,space,spaceId,spaceType}[${U}]:`),I.push(...D),I.join(`
|
|
41
|
+
`)}function qQ($){let{mode:I,found:U,hasMore:D}=$;if(U===0)return`[results:0 found, ${I}]
|
|
42
|
+
No results.`;let b=[I,...D?["hasMore"]:[]].join(", "),A=[`[results:${U} found, ${b}]`];if(I==="library"){let w=$.results,O=w.some((Y)=>Y.literatureMetadata),N=w.some((Y)=>Y.creatorName),X=w.some((Y)=>Y.updatedAt),G=O?"{type,title,id,relevance,tags,doi,firstAuthor,year,journal":"{type,title,id,relevance,tags",Q=N?`${G},creator`:G;if(X)Q+=",updatedAt";Q+=",snippet}",A.push(`${Q}[${w.length}]:`);for(let Y of w){let v=Y.bestSnippet??Y.snippet??"",L=v.length>120?`${v.slice(0,117)}...`:v,H=Y.tags?.join(" | ")??"",z=Y.creatorName??"",q=Y.updatedAt??"";if(O){let g=Y.literatureMetadata,x=[Y.entityType,Y.entityTitle,H6(Y.entityType,Y.entityId),Y.relevance,H,g?.doi??"",g?.firstAuthor??"",g?.year??"",g?.journal??""];if(N)x.push(z);if(X)x.push(q);x.push(L),A.push(z$(x))}else{let g=[Y.entityType,Y.entityTitle,H6(Y.entityType,Y.entityId),Y.relevance,H];if(N)g.push(z);if(X)g.push(q);g.push(L),A.push(z$(g))}}}else{let w=$.results,O=w.some((X)=>X.creatorName),N=O?"{type,title,entityId,blockId,creator,snippet}":"{type,title,entityId,blockId,snippet}";A.push(`${N}[${w.length}]:`);for(let X of w){let G=X.bestSnippet??X.snippet??"",Q=G.length>120?`${G.slice(0,117)}...`:G,Y=[X.entityType,X.entityTitle,H6(X.entityType,X.entityId),X.blockId];if(O)Y.push(X.creatorName??"");Y.push(Q),A.push(z$(Y))}}return A.join(`
|
|
43
|
+
`)}function r3($){if($.length===0)return"";let I=[`[toc:${$.length} sections]`,`{title,level,tokens,ownTokens,blockId}[${$.length}]:`];for(let U of $)I.push(z$([U.title,U.level,U.estimatedTokens??0,U.ownTokens??0,U.blockId]));return I.join(`
|
|
44
|
+
`)}function Xf($){if($.length===0)return"";let I=[`[regions:${$.length}]`,`{title,kind,tokens,blocks,retrievalHint}[${$.length}]:`];for(let U of $)I.push(z$([U.title,U.kind,U.estimatedTokens??0,U.blockCount,U.retrievalHint]));return I.join(`
|
|
45
|
+
`)}function H6($,I){return`${{literature:"lit",document:"doc",record:"rec",artifact:"art"}[$]??$.slice(0,3)}-${I.slice(0,8)}`}function Wf($){let I=[],U=$.direction==="forward"?"→":"←",D=$.direction==="forward"?"↗":"↙";if($.type==="annotation")D="\uD83D\uDCDD";else if($.type==="citation")D="\uD83D\uDCD6";let b=$.dstEntityType??$.dstScope,A=$.dstTitle||$.dstId.slice(0,8),w=H6(b,$.dstId),O=[$.type,$.direction,`via ${$.provenance}`];if(typeof $.weight==="number"&&$.weight>1)O.push(`shared by ${$.weight} records`);if(I.push(` ${D} ${U} ${b}: ${A} (${w}, ${O.join(" · ")})`),$.text)I.push(` "${$.text}"`);if($.snippet)I.push(` — ${$.snippet}`);return I}function Gf($,I){let U=I.reduce((D,b)=>Math.max(D,b.hop),0);for(let D=1;D<=U;D++){let b=I.filter((A)=>A.hop===D);if(b.length===0)continue;$.push(""),$.push(`*Hop ${D}* (${b.length} edges):`);for(let A of b)for(let w of Wf(A))$.push(w)}}function u3($,I,U){if(U.length===0)return;$.push(""),$.push(`*${I}* (${U.length}):`);for(let D of U)$.push(` • ${D.type}: ${D.title} (${H6(D.type,D.id)})`)}function Qf($){let I=[],U=$.dstEntityType??$.dstScope,D=`${U}: ${$.dstTitle||$.dstId.slice(0,8)} (${H6(U,$.dstId)})`,b=typeof $.weight==="number"&&$.weight>1?` · ×${$.weight}`:"",A=$.origin?.scope==="node"&&$.origin.nodeLabel?` · via «${$.origin.nodeLabel}»`:"",w=$.direction==="inverse"?`←${$.type}— ${D}`:`—${$.type}→ ${D}`;if(I.push(` ${w}${b}${A}`),$.text)I.push(` "${$.text}"`);if($.snippet)I.push(` — ${$.snippet}`);return I}function FQ($,I){$.set(I,($.get(I)??0)+1)}function Yf($){let I=new Map,U=new Map,D=new Map;for(let b of $){for(let O of[b.srcId,b.dstId])FQ(I,O);let A=b.direction==="inverse"?b.dstId:b.srcId,w=b.direction==="inverse"?b.srcId:b.dstId;FQ(D,A),FQ(U,w)}return{total:I,in:U,out:D}}function vf($,I,U){let D=[...I.total.entries()].map(([A,w])=>({node:U.get(A),n:w})).filter((A)=>A.node!==void 0).sort((A,w)=>w.n-A.n).slice(0,5);if(D.length===0)return;let b=D.map(({node:A,n:w})=>{let O=I.in.get(A.id)??0,N=I.out.get(A.id)??0,X=O>=2*Math.max(N,1)?" (sink)":"";return`${A.title} (${H6(A.type,A.id)}) ×${w}${X}`});$.push(`*Most connected*: ${b.join(" · ")}`)}function Bf($,I,U,D){let b=new Map;for(let O of I){let N=b.get(O.srcId);if(N)N.push(O);else b.set(O.srcId,[O])}let A=(O)=>U.get(O)?.title??O,w=[...b.entries()].sort((O,N)=>{let X=(D.total.get(N[0])??0)-(D.total.get(O[0])??0);if(X!==0)return X;let G=(D.out.get(N[0])??0)-(D.out.get(O[0])??0);if(G!==0)return G;return A(O[0]).localeCompare(A(N[0]))});$.push(""),$.push(`*Edges by source* (${I.length} edges):`);for(let[O,N]of w){let X=U.get(O),G=X?`${X.type}: ${X.title} (${H6(X.type,X.id)})`:O.slice(0,8),Q=D.out.get(O)??0,Y=D.in.get(O)??0;$.push(` ▸ ${G} [out ${Q} · in ${Y}]`);for(let v of N)for(let L of Qf(v))$.push(L)}}function Lf($){let I=[],U=$.nodes??[],D=$.edges??[],b=new Map(U.map((N)=>[N.id,N])),A=Yf(D),w=$.spaceId?H6("space",$.spaceId):"space";I.push(`**Space graph** (${w})`);let O=[`${$.seedCount??0} seeds`,`${U.length} nodes`,`${D.length} edges`,`depth ${$.depth??0}`];if($.truncated)O.push("truncated (large/busy space — situate a specific node for more)");if(I.push(`*${O.join(" · ")}*`),vf(I,A,b),u3(I,"In-space",U.filter((N)=>N.inSpace)),u3(I,"Connected borders",U.filter((N)=>!N.inSpace)),D.length===0)return I.push(""),I.push("*No relationships among these entities.*"),I.join(`
|
|
46
|
+
`);return Bf(I,D,b,A),I.join(`
|
|
47
|
+
`)}function EQ($){if(!$.found)return JSON.stringify({found:!1,error:$.error??"Entity not found"});if($.mode==="space")return Lf($);let I=[],U=$.root,D=U?H6(U.type,U.id):"unknown";I.push(`**Situated:** ${U?.type??"entity"} "${U?.title??""}" (${D})`);let b=[`depth ${$.depth??0}`,`${$.nodes?.length??0} nodes`,`${$.edges?.length??0} edges`];if($.truncated)b.push("truncated (busy hop — re-situate a specific node for more)");I.push(`*${b.join(" · ")}*`);let A=$.edges??[];if(A.length===0)return I.push(""),I.push("*No connections within the traversed depth.*"),I.join(`
|
|
48
|
+
`);return Gf(I,A),I.join(`
|
|
49
|
+
`)}function SQ($){let I=[];if(I.push(`**"${$.entityTitle}"** - ${$.entityType}`),$.creatorName)I.push(`*by ${$.creatorName}*`);if($.recordStatus)I.push(`*status: ${$.recordStatus}*`);if($.bibliographic){let U=$.bibliographic,D=[];if(U.authors?.length)D.push(U.authors.length<=3?U.authors.join(", "):`${U.authors[0]} et al.`);if(U.journal)D.push(U.journal);if(U.volume){let b=U.volume;if(U.issue)b+=`(${U.issue})`;if(U.pages)b+=`, ${U.pages}`;D.push(b)}if(U.year)D.push(String(U.year));if(D.length>0)I.push(D.join(", "));if(U.doi)I.push(`DOI: ${U.doi}`);if(U.pmid)I.push(`PMID: ${U.pmid}`);if(U.arxivId)I.push(`arXiv: ${U.arxivId}`);if(U.tags&&U.tags.length>0)I.push(`Tags: ${U.tags.join(", ")}`)}if($.error)return I.push(""),I.push(`**Error:** ${$.error}`),I.join(`
|
|
50
|
+
`);if($.overview){if($.overview.wordCount)I.push(`*~${$.overview.wordCount} words*`);if(I.push(""),$.overview.abstract)I.push("**Preview:**"),I.push($.overview.abstract),I.push("");if($.overview.toc&&$.overview.toc.length>0)I.push("**Table of Contents:**"),I.push(r3($.overview.toc));if($.overview.regions&&$.overview.regions.length>0){if($.overview.toc&&$.overview.toc.length>0)I.push("");I.push("**Additional Retrievable Regions:**"),I.push(Xf($.overview.regions))}}if($.procedureTree)I.push(""),I.push("**Procedure Tree:**"),I.push($.procedureTree);if(typeof $.edgeCount==="number"&&$.edgeCount>0)I.push(""),I.push(`**Connections**: ${$.edgeCount} edge${$.edgeCount===1?"":"s"} — call \`situate(entityId, depth=1..3)\` to map the graph.`);if($.figures&&$.figures.length>0){I.push(""),I.push(`**Figures** (${$.figures.length}) — call \`read_image(entityId, blockId)\` to view an image as vision; \`set_image\` to replace bytes or edit the caption:`);for(let U of $.figures){let D=U.caption?` — "${U.caption}"`:"",b=U.hasImage?"":" (no image attached yet)";I.push(`- image | ${U.blockId}${D}${b}`)}}if($.markdown){if(I.push(""),$.format==="interleaved")I.push("**Content (with block IDs for editing):**");else I.push("**Markdown Content:**");I.push(""),I.push($.markdown)}if($.sectionInfo){if(I.push(""),I.push(`*Section: ${$.sectionInfo.blockCount} blocks, ${$.sectionInfo.wordCount} words*`),$.sectionInfo.warning)I.push(`*Warning: ${$.sectionInfo.warning}*`)}if($.refs&&$.refs.length>0)I.push(""),I.push("**References:**"),I.push("```json"),I.push(JSON.stringify($.refs,null,2)),I.push("```");return I.join(`
|
|
51
|
+
`)}function jQ($){if(!$.success)return`Failed to set image: ${$.error??"unknown error"}`;let U=[`${$.inserted?"Inserted image block":"Updated image block"} ${$.blockId??""}`.trim()];if($.applied&&$.applied.length>0)U.push(`Applied: ${$.applied.join(", ")}`);if($.caption)U.push(`Caption: "${$.caption}"`);return U.join(`
|
|
52
|
+
`)}function PQ($){if(!$.success)return`Failed to set figure: ${$.error??"unknown error"}`;let U=[`${$.inserted?"Inserted figure block":"Updated figure block"} ${$.blockId??""}`.trim()];if($.applied&&$.applied.length>0)U.push(`Applied: ${$.applied.join(", ")}`);if($.caption)U.push(`Caption: "${$.caption}"`);return U.join(`
|
|
53
|
+
`)}function RQ($){if(!$.success)return`Failed to create document: ${$.error}`;return`Document created successfully.
|
|
53
54
|
Title: ${$.title}
|
|
54
|
-
ID: ${$.documentId}`}function
|
|
55
|
+
ID: ${$.documentId}`}function TQ($){if(!$.success)return`Failed to import literature: ${$.error}`;if($.alreadyExisted){let U=`Already in library: ${$.title} (id: ${$.literatureId})`;if($.coreEnriched)return`${U}
|
|
55
56
|
Triggered CORE enrichment for missing content.`;return U}let I=`Literature imported successfully.
|
|
56
57
|
Title: ${$.title}
|
|
57
58
|
ID: ${$.literatureId}`;if($.coreEnriched){let U=[];if($.charCount)U.push(`${$.charCount.toLocaleString()} chars`);if($.sectionCount)U.push(`${$.sectionCount} sections`);if($.referenceCount)U.push(`${$.referenceCount} references`);return`${I}
|
|
58
59
|
Full text: imported from CORE (${U.join(", ")})`}if($.error?.includes("CORE enrichment in progress"))return`${I}
|
|
59
|
-
Full text: CORE enrichment in progress -- content available shortly via get_content.`;return I}function
|
|
60
|
+
Full text: CORE enrichment in progress -- content available shortly via get_content.`;return I}function _Q($){if(!$.success)return`Failed to insert matrix: ${$.error}`;return`Matrix inserted successfully.
|
|
60
61
|
Label: ${$.label}
|
|
61
62
|
Matrix ID: ${$.matrixId}
|
|
62
|
-
Block ID: ${$.blockId}`}function
|
|
63
|
+
Block ID: ${$.blockId}`}function CQ($){if(!$.success){if($.errorCode==="ambiguous_matrix_selection"&&$.availableMatrices?.length){let b=$.availableMatrices.map((A)=>` - ${A.id} — ${A.label}`).join(`
|
|
63
64
|
`);return[`Failed: ${$.error}`,"","Available matrices on this artifact:",b,"","Re-call with `matrixId` set to one of the above."].join(`
|
|
64
65
|
`)}return`Failed to create matrix from artifact: ${$.error}`}let I=$.rowsCreated??0,D=[`Matrix derived from artifact (${$.mode==="reaction"?"synthesized from linkSlots":"column-copied from source matrix"}).`,`Label: ${$.label}`,`Matrix ID: ${$.matrixId}`,`Source artifact ID: ${$.artifactId}`,`Rows created: ${I}`];if($.sourceMatrixId)D.push(`Source matrix ID: ${$.sourceMatrixId}`);if(I===0)if($.mode==="reaction")D.push("Note: the reaction artifact has no bound linkSlots — the matrix has the stoichiometry columns but no rows. Use append_matrix_rows to add components, or bind defaultArtifactId on the slots first.");else D.push("Note: rows are intentionally empty (pure template copy). Use append_matrix_rows to populate.");return D.join(`
|
|
65
|
-
`)}function
|
|
66
|
-
|
|
67
|
-
`)}function
|
|
68
|
-
`)}let I=[`Block inserted. ID: ${$.newBlockId}`];if($.insertedBlock){let{blockType:D,content:b}=$.insertedBlock,
|
|
69
|
-
`)}function
|
|
70
|
-
`)}let I=[];if($.deletedBlock){let{blockType:D,contentPreview:b}=$.deletedBlock;if(I.push(`Deleted [${D} | ${$.deletedBlock.blockId}]`),b)I.push(`Was: ${b}`)}else I.push("Block deleted");let U=
|
|
71
|
-
`)}function
|
|
72
|
-
`),U=$.nodeIdMap?Object.entries($.nodeIdMap):[];if(U.length===0)return I;let D=U.map(([b,
|
|
73
|
-
`)}function
|
|
74
|
-
`)}function
|
|
75
|
-
`)}function
|
|
76
|
-
`)}function
|
|
77
|
-
`)}function
|
|
78
|
-
`)}function
|
|
79
|
-
`)}function
|
|
80
|
-
`)}function
|
|
81
|
-
`)}function
|
|
82
|
-
`)}function
|
|
83
|
-
`)}var nC=W.object({cid:W.number().int().positive().describe("PubChem Compound ID (CID).")}),tQ={name:"get_compound_by_cid",description:["Fetch full PubChem metadata for a single compound by its CID.","Faster than `search_compound` when the CID is already known (e.g. you got it from a prior search). Skips the lookup step.","Returns the same shape as `search_compound`: molecular formula, MW, SMILES, InChIKey, CAS numbers, synonyms."].join(" ")};var cC=/^[A-Z]{14}-[A-Z]{10}-[A-Z]$/,rC=W.object({inchi_key:W.string().regex(cC,"InChIKey must be in the form AAAAAAAAAAAAAA-BBBBBBBBBB-C (27 uppercase chars with 2 dashes).").describe('Full InChIKey (e.g. "LFQSCWFLJHTTHZ-UHFFFAOYSA-N" for ethanol).')}),aQ={name:"get_compound_by_inchi_key",description:["Fetch PubChem metadata by exact InChIKey.","The InChIKey is the canonical 27-character hash for a chemical structure — perfect for cross-source dedup. Returns null when the key is unknown to PubChem (rare but possible for very new structures)."].join(" ")};var F3=W.enum(["physical","safety","handling","transport","exposure","toxicity","spectra","ecological","regulatory","classification","literature_counts"]),mC=W.object({cid:W.number().int().positive().describe("PubChem Compound ID (CID). Get one via `search_compound`, `get_compound_by_cid`, `get_compound_by_inchi_key`, or `resolve_cas`."),include:W.array(F3).optional().describe("Sections to fetch. Defaults to ['physical', 'safety'] when omitted — the most ELN-relevant subset. Pass an explicit array to add or restrict sections. All declared values are live (Phase 1-3): physical, safety, transport, handling, exposure, toxicity, spectra, ecological, regulatory, classification, literature_counts."),verbose:W.boolean().optional().describe("When true, list every source for each multi-source field (density typically has 5-7). Default false: first authoritative source only.")}),eQ={name:"get_compound_details",description:["Fetch rich PubChem data for a known compound: experimental physical properties, GHS safety classification, handling guidance, transport info (UN/DOT/IMO/EC), occupational exposure limits, toxicology (LD50/LC50, target organs, antidote), available spectra (NMR, IR, MS, UV), ecological data, regulatory classifications (TSCA/REACH/FDA), taxonomic placements, and literature/patent counts.",'Composable via the `include` parameter — pass an array of section names to compose any subset. Default `["physical", "safety"]` covers the most common ELN questions ("what\'s the boiling point", "is it flammable").',"Use `search_compound` first to resolve a name/CAS to a CID, then call this for the deep data.","Output is structured markdown with citation provenance per fact; agents can quote it directly. Tabular sections (exposure limits, toxicity LD50 values) use TOON.","When 3+ sections are requested, the implementation fetches the full PubChem record once instead of N round-trips — calling with all 11 sections is one HTTP call."].join(" ")};var oC=W.enum(["preamble","full"]),sQ=W.object({entityId:W.string().describe('Entity ID (UUID or short ref like "lit-a3f7e2b9")'),overview:W.preprocess(($)=>{if(typeof $==="string")return $==="true";return $},W.boolean()).optional().describe("Return overview with TOC and preview. Default behavior."),blockIds:W.array(W.string()).optional().describe("Array of specific block IDs to fetch from search results"),segment:oC.optional().describe('Named content region to fetch. Use "preamble" for content before the first heading, or "full" for the entire entity content.'),section:W.string().optional().describe('Section heading text, blockId, or parent-qualified path (e.g., "Methods/Key Takeaways") to fetch all blocks from'),refs:W.array(W.number().int()).optional().describe("Reference numbers to fetch (e.g., [42, 43])"),figures:W.array(W.string()).optional().describe('Figure IDs to fetch (e.g., ["fig-1", "fig-2"])'),tables:W.array(W.string()).optional().describe('Table IDs to fetch (e.g., ["table-1"])'),node:W.string().optional().describe("Procedure node label or ID. Returns node prose, matrices (TOON format), artifact links, and child summaries. Records only."),depth:W.number().int().min(0).optional().describe("Depth: 0 = only direct content (no children), 1 = include immediate children, undefined = all descendants (default). Used with section or node parameter."),from_section:W.string().optional().describe('Start section heading, blockId, or parent-qualified path (e.g., "Parent/Section") for range fetching (inclusive). Use with to_section.'),to_section:W.string().optional().describe('End section heading, blockId, or parent-qualified path (e.g., "Parent/Section") for range fetching (inclusive). Use with from_section.')}),Rb={name:"get_content",description:'Fetch content from literature, documents, or records. Returns markdown text.\nAccepts full UUIDs or short entity reference IDs (e.g., `lit-a3f7e2b9`, `doc-9bk4x1f2`, `rec-f72mn3a8`, `art-4c2e19af`).\n\n**Modes:**\n1. **Overview** (default): Preview + table of contents with section headings and estimated tokens. For records, also includes the procedure tree showing nodes, matrices, and artifact links. Surfaces a connection count for the entity — call `situate` to map the graph.\n2. **Named Regions**: Pass `segment="preamble"` to fetch content before the first heading, or `segment="full"` to fetch the full entity content.\n3. **Section**: Pass `section="Heading Name"` to get all blocks in that section as interleaved markdown.\n4. **Node** (records only): Pass `node="step label"` to get procedure node content - prose, matrices (TOON format), artifacts, and child summaries. Use `depth` to control child expansion.\n5. **Block IDs**: Pass `blockIds=["id1","id2"]` to fetch specific blocks from search results.\n6. **Refs**: Pass `refs=[42,43]` to fetch literature references by number.\n7. **Figures**: Pass `figures=["fig-1"]` to fetch figure blocks.\n8. **Tables**: Pass `tables=["table-1"]` to fetch table blocks.\n9. **Section range**: Pass `from_section` and `to_section` to fetch all content between two headings (inclusive).\n10. **Section with depth**: Pass `section` with `depth=0` for own content only, `depth=1` for immediate children.\n\nFor the graph around an entity (mentions, citations, annotation edges, artifact links, matrix provenance, typed relation predicates), call `situate(entityId, depth=1..3)` — it returns the bounded k-hop subgraph in one call. `get_content` overview only carries a count as a discovery hint.\n\n**Interleaved Format (Section mode):**\nSection mode returns content with block IDs embedded for editing:\n```\n[paragraph | dff74a60-0dd9-4cfa-9ae1-04c462d5cf46]\nThis is the paragraph content...\n\n[heading:2 | a9fe6c59-cf59-495c-b688-a6fcfb605491]\n## Methods\n```\nUse these block IDs with `str_replace_block`, `insert_block`, or `delete_block`.\n\n**Reading Strategy:** Check `ownTokens` and `children` in TOC entries:\n- If `ownTokens` is 0 and `children` exists -> container heading, fetch children individually\n- If `children` is absent -> leaf section, fetch directly with `section`\n- `estimatedTokens` = total tokens including all descendants\n- If `overview.regions` is present, use the provided `retrievalHint` to fetch non-TOC content such as opening paragraphs or heading-less documents\n\n**Best Practice:** Check `estimatedTokens` in TOC before fetching large sections.'};var $Y=W.object({forceRefresh:W.boolean().optional().describe("Force reload from server instead of returning cached context. Use after creating new organizations or workspaces.")}),Tb={name:"get_workspace_context",description:"Get the user's organizational hierarchy: organizations, workspaces, and spaces. Returns default orgId and workspaceId for use with other tools (search, create_document, etc.). Called automatically at startup; use forceRefresh=true to reload if the user creates new workspaces mid-session."};var kN=W.object({entityType:d6.describe('Entity type: "document" or "record"'),entityId:W.string().uuid().describe("Document or record ID"),afterBlockId:W.string().optional().describe("Insert AFTER this block ID (sibling insertion)"),beforeBlockId:W.string().optional().describe("Insert BEFORE this block ID (sibling insertion)"),parentBlockId:W.string().optional().describe("Insert as CHILD of this container block (e.g., add referenceItem inside referenceList)"),childPosition:W.string().optional().describe('Position within parent children: "first", "last" (default), or child block ID to insert after'),blockType:W.enum(HN).default("paragraph").optional().describe("Type of block to create. Default: paragraph"),content:W.string().optional().describe("Text content for the new block"),headingLevel:W.number().int().min(1).max(3).optional().describe("Heading level (1-3) if blockType is heading"),checked:W.boolean().optional().describe("Checked state for checkListItem"),title:W.string().optional().describe('Title for referenceList container (default: "References")'),refNumber:W.number().int().min(1).optional().describe("Reference number for referenceItem (e.g., 1, 2, 3)"),refId:W.string().optional().describe('Stable ref ID for citation linking (e.g., "lit-a3f7e2b9"). Auto-generated from linkedEntityId if omitted.'),refType:W.enum(LN).optional().describe("Type of reference: literature, document, record, or annotation"),linkedEntityId:VN.optional().describe("Linked entity handle (literature, document, record, or artifact). Accepts a full UUID OR a short ref like lit-a3f7e2b9 / rec-1f30176d — the form situate/search return; the executor resolves it to the full UUID."),entityTitle:W.string().optional().describe("Cached title of the linked entity"),doi:W.string().optional().describe("DOI for literature references"),smiles:W.string().optional().describe('SMILES string (e.g., "CCO" for ethanol). Required for structure blocks in molecule mode.'),structureType:W.enum(zN).optional().describe('Mode of the structure block: "molecule" (default) or "reaction"'),moleculeName:W.string().optional().describe("Name of the molecule or reaction"),moleculeDescription:W.string().optional().describe("Optional description or notes for the structure block"),matrixId:W.string().optional().describe("UUID of the linked data matrix for structuredMatrix blocks"),nodeRef:W.string().optional().describe("Procedure tree node ID for structuredMatrix blocks"),matrixLabel:W.string().optional().describe("Display label for structuredMatrix blocks"),showPreview:W.boolean().optional().describe("Whether structuredMatrix should show its inline preview"),recordId:W.string().uuid().optional().describe("Record UUID for procedureTree blocks. The executor auto-fills this from the entityId of a record context — agents should omit it."),blocks:W.array($Q).max(X1).optional().describe(`Array of blocks to insert in sequence. Max ${X1} blocks. Use this for inserting multiple blocks in one call.`)}),dC=kN.refine(($)=>{return[$.afterBlockId,$.beforeBlockId,$.parentBlockId].filter(Boolean).length<=1},{message:"Use only one positioning mode: afterBlockId, beforeBlockId, OR parentBlockId"}).refine(($)=>{if($.childPosition&&!$.parentBlockId)return!1;return!0},{message:"childPosition can only be used with parentBlockId"}).refine(($)=>{let I=$.content!==void 0,U=$.blocks!==void 0&&$.blocks.length>0;return I!==U},{message:"Provide either content (single block) or blocks (batch), not both"}),_b={name:"insert_block",description:`Insert block(s) in a document. Three positioning modes:
|
|
66
|
+
`)}function fQ($){if(!$.success)return`Replace failed: ${$.error}`;let I=[`Text replaced in block ${$.blockId}`];if($.originalText&&$.updatedText)I.push(n3($.originalText,$.updatedText));let U=_0($.positionContext);if(U)I.push(`Position: ${U}`);return I.join(`
|
|
67
|
+
|
|
68
|
+
`)}function ZQ($){if(!$.success)return`Insert failed: ${$.error}`;if($.newBlockIds&&$.newBlockIds.length>0){let D=[`Inserted ${$.newBlockIds.length} blocks:`];if($.results){for(let b of $.results)if(b.success&&b.newBlockId){let A=b.blockType??"paragraph",w=b.contentPreview?`: ${b.contentPreview.slice(0,60)}${b.contentPreview.length>60?"...":""}`:"";D.push(` [${A} | ${b.newBlockId}]${w}`)}}return D.join(`
|
|
69
|
+
`)}let I=[`Block inserted. ID: ${$.newBlockId}`];if($.insertedBlock){let{blockType:D,content:b}=$.insertedBlock,A=b.length>200?`${b.slice(0,200)}...`:b;if(I.push(`Type: ${D}`),A)I.push(`Content: ${A}`)}let U=_0($.positionContext);if(U)I.push(`Position: ${U}`);return I.join(`
|
|
70
|
+
`)}function gQ($){if(!$.success)return`Delete failed: ${$.error}`;if($.deletedBlockIds&&$.deletedBlockIds.length>0){let D=[`Deleted ${$.deletedBlockIds.length} blocks:`];if($.results){for(let b of $.results)if(b.success){let A=b.blockType??"?",w=b.contentPreview?`: ${b.contentPreview.slice(0,60)}${b.contentPreview.length>60?"...":""}`:"";D.push(` [${A} | ${b.blockId}]${w}`)}}return D.join(`
|
|
71
|
+
`)}let I=[];if($.deletedBlock){let{blockType:D,contentPreview:b}=$.deletedBlock;if(I.push(`Deleted [${D} | ${$.deletedBlock.blockId}]`),b)I.push(`Was: ${b}`)}else I.push("Block deleted");let U=_0($.positionContext);if(U)I.push(`New adjacency: ${U}`);return I.join(`
|
|
72
|
+
`)}function yQ($){if(!$.success)return $.error??"create_record failed";let I=[`[record created | id=${$.recordId??""}]`,$.title?`title: ${$.title}`:"",$.workspaceId?`workspace: ${$.workspaceId}`:"",$.spaceId?`space: ${$.spaceId}`:"space: —"].filter(Boolean).join(`
|
|
73
|
+
`),U=$.nodeIdMap?Object.entries($.nodeIdMap):[];if(U.length===0)return I;let D=U.map(([b,A])=>z$([b,A]));return[I,"",`{tempId,nodeId}[${U.length}]:`,...D].join(`
|
|
74
|
+
`)}function xQ($){if(!$.success)return $.error??"insert_procedure_node failed";let I=$.parentId??"(root)";return`[procedure_node inserted | id=${$.nodeId??""}, parent=${I}, order=${$.order??0}, record=${$.recordId??""}]`}function lQ($){if(!$.success)return $.error??"update_procedure_node failed";let I=$.updatedFields?.join(", ")??"no changes";return`[procedure_node updated | id=${$.nodeId??""}, record=${$.recordId??""}, fields=${I}]`}function hQ($){if(!$.success)return $.error??"create_artifact failed";let U=[`[artifact created | id=${$.artifactId??""}, type=${$.artifactType??""}, name=${$.name??""}, workspace=${$.workspaceId??""}, status=${$.status??""}]`];if($.enrichment)if($.enrichment.source==="pubchem"){let D=$.enrichment.populatedKeys,b=D.length===0?"no fields filled (all already present)":`${D.length} field${D.length===1?"":"s"} filled: ${D.join(", ")}`;U.push(`[enrichment | source=pubchem, cid=${$.enrichment.cid}, ${b}]`)}else{let D=$.enrichment.detail?`, detail=${$.enrichment.detail}`:"";U.push(`[enrichment | source=none, reason=${$.enrichment.reason}${D}]`)}if($.linkToNode)if($.linkToNode.success)U.push(`[link_to_node | linkId=${$.linkToNode.linkId}, node=${$.linkToNode.nodeId}, role=${$.linkToNode.role}]`);else U.push(`[link_to_node | failed, node=${$.linkToNode.nodeId}, role=${$.linkToNode.role}, error=${$.linkToNode.error}]`);if($.warnings&&$.warnings.length>0){let D=$.warnings.map((b)=>b.class?`${b.key}→${b.suggestion} (${b.class})`:`${b.key}→${b.suggestion}`).join(", ");U.push(`[warnings | ${$.warnings.length} property key${$.warnings.length===1?"":"s"} look like typo${$.warnings.length===1?"":"s"} of typed-schema keys: ${D}]`)}if($.schema)U.push(uQ($.schema));return U.join(`
|
|
75
|
+
`)}function uQ($){let I=$.structureClass?`${$.artifactType}/${$.structureClass}`:$.artifactType,U=$.knownKeys.map((D)=>{let b=D.unit?`[${D.unit}]`:"",A=D.options&&D.options.length>0?`=${D.options.join("|")}`:"",w=D.auto?"*":"";return`${D.key}:${D.type}${b}${A}${w}`}).join(", ");return`[schema | type=${I}, knownKeys: ${U}]`}function iQ($){if(!$.success)return $.error??"instantiate_artifact_template failed";let I=[`[artifact instantiated | id=${$.artifactId??""}, type=${$.artifactType??""}, name=${$.name??""}, template=${$.templateId??""}]`],U=$.links?.length??0;if(U>0){let b=($.links??[]).map((A)=>A.label?`${A.role}/${A.label}=${A.artifactId}`:`${A.role}=${A.artifactId}`).join(", ");I.push(`[links | ${U} slot${U===1?"":"s"} bound: ${b}]`)}let D=$.pendingSlots?.length??0;if(D>0){let b=($.pendingSlots??[]).map((A)=>{let w=A.filter?.artifactType?`:${A.filter.artifactType}${A.filter.structureClass?`/${A.filter.structureClass}`:""}`:"",O=A.label?`(${A.label})`:"";return`${A.role}${O}${w}`}).join(", ");I.push(`[pending_slots | ${D} slot${D===1?"":"s"} need binding: ${b}]`)}return I.join(`
|
|
76
|
+
`)}function nQ($){if(!$.success)return $.error??"update_artifact failed";let I=$.updatedFields?.join(", ")??"no changes",U=$.propertyKeys?.length?`, propertyKeys=${$.propertyKeys.join("|")}`:"",D=[`[artifact updated | id=${$.artifactId??""}, type=${$.artifactType??""}, fields=${I}${U}]`];if($.warnings&&$.warnings.length>0){let b=$.warnings.map((A)=>A.class?`${A.key}→${A.suggestion} (${A.class})`:`${A.key}→${A.suggestion}`).join(", ");D.push(`[warnings | ${$.warnings.length} property key${$.warnings.length===1?"":"s"} look like typo${$.warnings.length===1?"":"s"} of typed-schema keys: ${b}]`)}if($.schema)D.push(uQ($.schema));return D.join(`
|
|
77
|
+
`)}function rQ($){if(!$.success)return $.error??"update_document failed";let I=$.updatedFields?.join(", ")??"no changes";return`[document updated | id=${$.documentId??""}, fields=${I}]`}function cQ($){if(!$.success)return $.error??"update_record failed";let I=$.updatedFields?.join(", ")??"no changes";return`[record updated | id=${$.recordId??""}, fields=${I}]`}function mQ($){if(!$.success)return $.error??"update_literature failed";let I=$.updatedFields?.join(", ")??"no changes";return`[literature updated | id=${$.literatureId??""}, fields=${I}]`}function oQ($){if(!$.success)return $.error??"place_entity failed";let I=[$.workspaceId?`ws=${$.workspaceId}`:null,$.spaceId?`space=${$.spaceId}`:null].filter(Boolean).join(", ")||"private";return`[${$.action==="remove"?"unplaced":"placed"} | ${$.entityType??""} ${$.entityId??""} ${$.action??""} → ${I}]`}function dQ($){if(!$.success)return $.error??"set_literature_content failed";return`[literature content set | id=${$.literatureId??""}, blocks=${$.blockCount??0}]`}function pQ($){if(!$.success)return $.error??"update_matrix failed";let I=$.updatedFields?.join(", ")??"no changes";return`[matrix updated | id=${$.matrixId??""}, fields=${I}, version=${$.newVersion??""}]`}function tQ($){if(!$.success)return $.error??"reorder_procedure_nodes failed";return`[procedure_tree reordered | record=${$.recordId??""}, moves=${$.moveCount??0}]`}function aQ($){if(!$.success)return $.error??"delete_procedure_node failed";let I=$.orphanedMatrixIds??[],U=`[procedure_node deleted | id=${$.nodeId??""}, record=${$.recordId??""}, deletedNodes=${$.deletedNodeCount??1}, orphanedMatrices=${I.length}]`;if(I.length===0)return U;let D=I.map((b)=>z$([b]));return[U,"","[orphanedMatrixIds — rebind or delete via the matrix tools]",`{matrixId}[${I.length}]:`,...D].join(`
|
|
78
|
+
`)}function eQ($){if(!$.success)return $.error??"build_procedure_tree failed";let I=$.nodeIdMap?Object.entries($.nodeIdMap):[],U=[`[procedure_tree ${$.mode??"built"} | record=${$.recordId??""}, inserted=${I.length}`];if($.mode==="replace")U.push(`, deleted=${$.deletedNodeCount??0}`),U.push(`, orphanedMatrices=${$.orphanedMatrixIds?.length??0}`);U.push("]");let D=U.join("");if(I.length===0)return D;let b=I.map(([w,O])=>z$([w,O])),A=[D,`{tempId,nodeId}[${I.length}]:`,...b];if($.mode==="replace"&&$.orphanedMatrixIds&&$.orphanedMatrixIds.length>0){A.push(""),A.push("[orphanedMatrixIds — rebind or delete via the matrix tools]"),A.push(`{matrixId}[${$.orphanedMatrixIds.length}]:`);for(let w of $.orphanedMatrixIds)A.push(z$([w]))}return A.join(`
|
|
79
|
+
`)}function sQ($){if(!$.success)return $.error??"append_matrix_rows failed";return`[matrix rows appended | id=${$.matrixId??""}, added=${$.addedRowCount??0}, totalRows=${$.newRowCount??0}, version=${$.newVersion??0}]`}function $Y($){if(!$.success)return $.error??"update_matrix_rows failed";let I=$.updatedRowIndices??[],U=`[matrix rows updated | id=${$.matrixId??""}, rows=${$.updatedRowCount??I.length}, version=${$.newVersion??0}]`;if(I.length===0)return U;return[U,`{rowIndex}[${I.length}]:`,...I.map((D)=>z$([D]))].join(`
|
|
80
|
+
`)}function IY($){if(!$.success)return $.error??"delete_matrix_rows failed";let I=$.deletedRowIndices??[],U=`[matrix rows deleted | id=${$.matrixId??""}, removed=${$.deletedRowCount??I.length}, remainingRows=${$.newRowCount??0}, version=${$.newVersion??0}]`;if(I.length===0)return U;return[U,`{rowIndex}[${I.length}]:`,...I.map((D)=>z$([D]))].join(`
|
|
81
|
+
`)}function UY($){if(!$.success)return $.error??"rebind_matrix_to_node failed";let I=$.previousNodeRef??"(body)",U=$.nodeRef??"(body)";return`[matrix rebound | id=${$.matrixId??""}, record=${$.recordId??""}, ${I} → ${U}, version=${$.newVersion??0}]`}function bY($){if(!$.success)return $.error??"delete_matrix failed";let I=$.blockDeleted?`block=${$.blockId??"(found)"} removed`:"block: none found (already detached)";return`[matrix deleted | id=${$.matrixId??""}, owner=${$.entityType??""}:${$.entityId??""}, ${I}]`}function DY($){if(!$.success)return $.error??"attach_matrix failed";let I=`${$.entityType??""}:${$.entityId??""}`,U=$.nodeRef?`, node=${$.nodeRef}`:"";return`[matrix attached | id=${$.matrixId??""}, owner=${I}${U}, version=${$.newVersion??0}]`}function AY($){if(!$.success)return $.error??"list_matrix_references failed";let I=$.references??[];if(I.length===0)return`[matrix_references: id=${$.matrixId}, count=0] no embeds — safe to delete.`;let U=[`[matrix_references: id=${$.matrixId}, count=${I.length}]`,`{sourceType,sourceId,sourceTitle}[${I.length}]:`],D=I.map((b)=>z$([b.sourceType,b.sourceId,b.sourceTitle??""]));return[...U,...D].join(`
|
|
82
|
+
`)}function wY($){if(!$.success)return $.error??"link_artifact_to_node failed";return`[artifact linked | linkId=${$.linkId??""}, node=${$.nodeId??""}, artifact=${$.artifactId??""}, role=${$.role??""}]`}function OY($){if(!$.success)return $.error??"update_edge failed";return`[edge typed | edgeId=${$.edgeId??""}, relation=${$.relationType??""}, direction=${$.direction??""}]`}function NY($){if(!$.success)return $.error??"update_artifact_link_relation failed";return`[link relation typed | artifactLinkId=${$.artifactLinkId??""}, relation=${$.relationType??""}, role=${$.role??""} (unchanged)]`}function XY($){if(!$.success)return $.error??"unlink_artifact_from_node failed";return`[artifact unlinked | linkId=${$.linkId??""}]`}function WY($){if(!$.success)return $.error??"list_node_artifact_links failed";let I=$.links??[];if(I.length===0)return`[node_artifact_links: node=${$.nodeId??""}, count=0] no artifact links.`;let U=[`[node_artifact_links: node=${$.nodeId??""}, count=${I.length}]`,`{linkId,artifactId,artifactName,artifactType,role,context}[${I.length}]:`],D=I.map((b)=>z$([b.linkId,b.artifactId,b.artifactName??"",b.artifactType??"",b.role,b.context&&Object.keys(b.context).length>0?JSON.stringify(b.context):""]));return[...U,...D].join(`
|
|
83
|
+
`)}function i3($){return $.map((I)=>{let U=[I.label,I.type];if(I.unit)U.push(I.unit);return`${I.key}(${U.join("/")})`}).join("|")}function GY($){if(!$.success)return $.error??"list_procedure_nodes failed";let I=$.nodes??[],U=$.orphanedMatrices??[],D=[`[procedure_tree: record=${$.recordId??""}, nodeCount=${I.length}, orphanedMatrices=${U.length}]`],b=[];if(I.length>0){b.push(`{id,parentId,order,type,label,copyable,matrixCount,artifactCount,fileCount,proseBlockCount}[${I.length}]:`);for(let N of I)b.push(z$([N.id,N.parentId??"",N.order,N.type,N.label,N.copyable?"true":"false",N.matrixCount,N.artifactCount,N.fileCount,N.proseBlockCount]))}else b.push("No procedure nodes.");let A=[];for(let N of I){if(!N.matrices||N.matrices.length===0)continue;for(let X of N.matrices)A.push({nodeId:N.id,matrix:X})}let w=[];if(A.length>0){w.push(""),w.push("[attachedMatrices]"),w.push(`{nodeId,matrixId,label,version,rows,cols}[${A.length}]:`);for(let{nodeId:N,matrix:X}of A)w.push(z$([N,X.id,X.label,X.version,X.rowCount,i3(X.columns)]))}let O=[];if(U.length>0)if(O.push(""),O.push("[orphanedMatrices]"),U.some((X)=>X.version!==void 0&&X.columns!==void 0)){O.push(`{id,label,version,rows,cols,updatedAt}[${U.length}]:`);for(let X of U)O.push(z$([X.id,X.label,X.version??"",X.rowCount??"",X.columns?i3(X.columns):"",X.updatedAt]))}else{O.push(`{id,label,updatedAt}[${U.length}]:`);for(let X of U)O.push(z$([X.id,X.label,X.updatedAt]))}return[...D,...b,...w,...O].join(`
|
|
84
|
+
`)}var Jf=W.object({cid:W.number().int().positive().describe("PubChem Compound ID (CID).")}),QY={name:"get_compound_by_cid",description:["Fetch full PubChem metadata for a single compound by its CID.","Faster than `search_compound` when the CID is already known (e.g. you got it from a prior search). Skips the lookup step.","Returns the same shape as `search_compound`: molecular formula, MW, SMILES, InChIKey, CAS numbers, synonyms."].join(" ")};var Hf=/^[A-Z]{14}-[A-Z]{10}-[A-Z]$/,Mf=W.object({inchi_key:W.string().regex(Hf,"InChIKey must be in the form AAAAAAAAAAAAAA-BBBBBBBBBB-C (27 uppercase chars with 2 dashes).").describe('Full InChIKey (e.g. "LFQSCWFLJHTTHZ-UHFFFAOYSA-N" for ethanol).')}),YY={name:"get_compound_by_inchi_key",description:["Fetch PubChem metadata by exact InChIKey.","The InChIKey is the canonical 27-character hash for a chemical structure — perfect for cross-source dedup. Returns null when the key is unknown to PubChem (rare but possible for very new structures)."].join(" ")};var c3=W.enum(["physical","safety","handling","transport","exposure","toxicity","spectra","ecological","regulatory","classification","literature_counts"]),Vf=W.object({cid:W.number().int().positive().describe("PubChem Compound ID (CID). Get one via `search_compound`, `get_compound_by_cid`, `get_compound_by_inchi_key`, or `resolve_cas`."),include:W.array(c3).optional().describe("Sections to fetch. Defaults to ['physical', 'safety'] when omitted — the most ELN-relevant subset. Pass an explicit array to add or restrict sections. All declared values are live (Phase 1-3): physical, safety, transport, handling, exposure, toxicity, spectra, ecological, regulatory, classification, literature_counts."),verbose:W.boolean().optional().describe("When true, list every source for each multi-source field (density typically has 5-7). Default false: first authoritative source only.")}),vY={name:"get_compound_details",description:["Fetch rich PubChem data for a known compound: experimental physical properties, GHS safety classification, handling guidance, transport info (UN/DOT/IMO/EC), occupational exposure limits, toxicology (LD50/LC50, target organs, antidote), available spectra (NMR, IR, MS, UV), ecological data, regulatory classifications (TSCA/REACH/FDA), taxonomic placements, and literature/patent counts.",'Composable via the `include` parameter — pass an array of section names to compose any subset. Default `["physical", "safety"]` covers the most common ELN questions ("what\'s the boiling point", "is it flammable").',"Use `search_compound` first to resolve a name/CAS to a CID, then call this for the deep data.","Output is structured markdown with citation provenance per fact; agents can quote it directly. Tabular sections (exposure limits, toxicity LD50 values) use TOON.","When 3+ sections are requested, the implementation fetches the full PubChem record once instead of N round-trips — calling with all 11 sections is one HTTP call."].join(" ")};var Kf=W.enum(["preamble","full"]),BY=W.object({entityId:W.string().describe('Entity ID (UUID or short ref like "lit-a3f7e2b9")'),overview:W.preprocess(($)=>{if(typeof $==="string")return $==="true";return $},W.boolean()).optional().describe("Return overview with TOC and preview. Default behavior."),blockIds:W.array(W.string()).optional().describe("Array of specific block IDs to fetch from search results"),segment:Kf.optional().describe('Named content region to fetch. Use "preamble" for content before the first heading, or "full" for the entire entity content.'),section:W.string().optional().describe('Section heading text, blockId, or parent-qualified path (e.g., "Methods/Key Takeaways") to fetch all blocks from'),refs:W.array(W.number().int()).optional().describe("Reference numbers to fetch (e.g., [42, 43])"),figures:W.array(W.string()).optional().describe('Figure IDs to fetch (e.g., ["fig-1", "fig-2"])'),tables:W.array(W.string()).optional().describe('Table IDs to fetch (e.g., ["table-1"])'),node:W.string().optional().describe("Procedure node label or ID. Returns node prose, matrices (TOON format), artifact links, and child summaries. Records only."),depth:W.number().int().min(0).optional().describe("Depth: 0 = only direct content (no children), 1 = include immediate children, undefined = all descendants (default). Used with section or node parameter."),from_section:W.string().optional().describe('Start section heading, blockId, or parent-qualified path (e.g., "Parent/Section") for range fetching (inclusive). Use with to_section.'),to_section:W.string().optional().describe('End section heading, blockId, or parent-qualified path (e.g., "Parent/Section") for range fetching (inclusive). Use with from_section.')}),Tb={name:"get_content",description:'Fetch content from literature, documents, or records. Returns markdown text.\nAccepts full UUIDs or short entity reference IDs (e.g., `lit-a3f7e2b9`, `doc-9bk4x1f2`, `rec-f72mn3a8`, `art-4c2e19af`).\n\n**Modes:**\n1. **Overview** (default): Preview + table of contents with section headings and estimated tokens. For records, also includes the procedure tree showing nodes, matrices, and artifact links. Surfaces a connection count for the entity — call `situate` to map the graph.\n2. **Named Regions**: Pass `segment="preamble"` to fetch content before the first heading, or `segment="full"` to fetch the full entity content.\n3. **Section**: Pass `section="Heading Name"` to get all blocks in that section as interleaved markdown.\n4. **Node** (records only): Pass `node="step label"` to get procedure node content - prose, matrices (TOON format), artifacts, and child summaries. Use `depth` to control child expansion.\n5. **Block IDs**: Pass `blockIds=["id1","id2"]` to fetch specific blocks from search results.\n6. **Refs**: Pass `refs=[42,43]` to fetch literature references by number.\n7. **Figures**: Pass `figures=["fig-1"]` to fetch figure blocks.\n8. **Tables**: Pass `tables=["table-1"]` to fetch table blocks.\n9. **Section range**: Pass `from_section` and `to_section` to fetch all content between two headings (inclusive).\n10. **Section with depth**: Pass `section` with `depth=0` for own content only, `depth=1` for immediate children.\n\nFor the graph around an entity (mentions, citations, annotation edges, artifact links, matrix provenance, typed relation predicates), call `situate(entityId, depth=1..3)` — it returns the bounded k-hop subgraph in one call. `get_content` overview only carries a count as a discovery hint.\n\n**Interleaved Format (Section mode):**\nSection mode returns content with block IDs embedded for editing:\n```\n[paragraph | dff74a60-0dd9-4cfa-9ae1-04c462d5cf46]\nThis is the paragraph content...\n\n[heading:2 | a9fe6c59-cf59-495c-b688-a6fcfb605491]\n## Methods\n```\nUse these block IDs with `str_replace_block`, `insert_block`, or `delete_block`.\n\n**Reading Strategy:** Check `ownTokens` and `children` in TOC entries:\n- If `ownTokens` is 0 and `children` exists -> container heading, fetch children individually\n- If `children` is absent -> leaf section, fetch directly with `section`\n- `estimatedTokens` = total tokens including all descendants\n- If `overview.regions` is present, use the provided `retrievalHint` to fetch non-TOC content such as opening paragraphs or heading-less documents\n\n**Best Practice:** Check `estimatedTokens` in TOC before fetching large sections.'};var LY=W.object({forceRefresh:W.boolean().optional().describe("Force reload from server instead of returning cached context. Use after creating new organizations or workspaces.")}),_b={name:"get_workspace_context",description:"Get the user's organizational hierarchy: organizations, workspaces, and spaces. Returns default orgId and workspaceId for use with other tools (search, create_document, etc.). Called automatically at startup; use forceRefresh=true to reload if the user creates new workspaces mid-session."};var C0=W.object({entityType:d6.describe('Entity type: "document" or "record"'),entityId:W.string().uuid().describe("Document or record ID"),afterBlockId:W.string().optional().describe("Insert AFTER this block ID (sibling insertion)"),beforeBlockId:W.string().optional().describe("Insert BEFORE this block ID (sibling insertion)"),parentBlockId:W.string().optional().describe("Insert as CHILD of this container block (e.g., add referenceItem inside referenceList)"),childPosition:W.string().optional().describe('Position within parent children: "first", "last" (default), or child block ID to insert after'),blockType:W.enum(k0).default("paragraph").optional().describe("Type of block to create. Default: paragraph"),content:W.string().optional().describe("Text content for the new block"),headingLevel:W.number().int().min(1).max(3).optional().describe("Heading level (1-3) if blockType is heading"),checked:W.boolean().optional().describe("Checked state for checkListItem"),title:W.string().optional().describe('Title for referenceList container (default: "References")'),refNumber:W.number().int().min(1).optional().describe("Reference number for referenceItem (e.g., 1, 2, 3)"),refId:W.string().optional().describe('Stable ref ID for citation linking (e.g., "lit-a3f7e2b9"). Auto-generated from linkedEntityId if omitted.'),refType:W.enum(q0).optional().describe("Type of reference: literature, document, record, or annotation"),linkedEntityId:S0.optional().describe("Linked entity handle (literature, document, record, or artifact). Accepts a full UUID OR a short ref like lit-a3f7e2b9 / rec-1f30176d — the form situate/search return; the executor resolves it to the full UUID."),entityTitle:W.string().optional().describe("Cached title of the linked entity"),doi:W.string().optional().describe("DOI for literature references"),smiles:W.string().optional().describe('SMILES string (e.g., "CCO" for ethanol). Required for structure blocks in molecule mode.'),structureType:W.enum(E0).optional().describe('Mode of the structure block: "molecule" (default) or "reaction"'),moleculeName:W.string().optional().describe("Name of the molecule or reaction"),moleculeDescription:W.string().optional().describe("Optional description or notes for the structure block"),matrixId:W.string().optional().describe("UUID of the linked data matrix for structuredMatrix blocks"),nodeRef:W.string().optional().describe("Procedure tree node ID for structuredMatrix blocks"),matrixLabel:W.string().optional().describe("Display label for structuredMatrix blocks"),showPreview:W.boolean().optional().describe("Whether structuredMatrix should show its inline preview"),recordId:W.string().uuid().optional().describe("Record UUID for procedureTree blocks. The executor auto-fills this from the entityId of a record context — agents should omit it."),blocks:W.array(XQ).max(XU).optional().describe(`Array of blocks to insert in sequence. Max ${XU} blocks. Use this for inserting multiple blocks in one call.`)}),zf=C0.refine(($)=>{return[$.afterBlockId,$.beforeBlockId,$.parentBlockId].filter(Boolean).length<=1},{message:"Use only one positioning mode: afterBlockId, beforeBlockId, OR parentBlockId"}).refine(($)=>{if($.childPosition&&!$.parentBlockId)return!1;return!0},{message:"childPosition can only be used with parentBlockId"}).refine(($)=>{let I=$.content!==void 0,U=$.blocks!==void 0&&$.blocks.length>0;return I!==U},{message:"Provide either content (single block) or blocks (batch), not both"}),Cb={name:"insert_block",description:`Insert block(s) in a document. Three positioning modes:
|
|
84
85
|
1. afterBlockId: Insert as SIBLING after the specified block
|
|
85
86
|
2. beforeBlockId: Insert as SIBLING before the specified block
|
|
86
87
|
3. parentBlockId: Insert as CHILD of a container block (e.g., referenceItem inside referenceList)
|
|
@@ -152,7 +153,7 @@ To add prose under a procedure node, use the prose container's blockId instead:
|
|
|
152
153
|
|
|
153
154
|
The procedureTree container itself is fine as a sibling anchor (afterBlockId / beforeBlockId) but never as a parentBlockId (its children are projected sections).
|
|
154
155
|
|
|
155
|
-
**Record draft-gate:** record writes require the record to be in \`draft\` status. \`completed\` / \`locked\` records return a structured \`record_not_draft\` error — stop, surface it to the user, and let them decide whether to re-open the record.`};var IY=W.object({recordId:W.string().uuid().describe("Target record UUID. Must be in draft status."),parentId:W.string().uuid().optional().describe("Existing parent node UUID. Omit to insert as a top-level root under the record."),label:W.string().min(1).describe("Human-readable node label."),type:G1.describe("Node type."),afterNodeId:W.string().uuid().optional().describe("Insert immediately after this existing sibling. Resolves to the sibling's order + 1."),order:W.number().int().min(0).optional().describe("Explicit sibling order (0-indexed). Mutually exclusive with afterNodeId; omit both to append."),copyable:W.boolean().optional().describe('Template-copyable flag. MUST be false (or omitted) when type === "observation".'),analyticalData:W.array(Q1).optional().describe("File references attached to the new node.")}).refine(($)=>!($.type==="observation"&&$.copyable===!0),{message:'copyable must be false (or omitted) when type is "observation".',path:["copyable"]}).refine(($)=>!($.afterNodeId&&$.order!==void 0),{message:"Provide either afterNodeId (relative) OR order (absolute), not both.",path:["afterNodeId"]}),Cb={name:"insert_procedure_node",description:["Insert a single procedure-tree node under a draft record.","Positioning: `afterNodeId` (place right after an existing sibling) OR `order` (explicit 0-indexed slot) — omit both to append at the end.","`parentId` must be an existing node UUID in the same record; omit for a new root.",'`type === "observation"` must have `copyable` omitted or `false`.',"Only draft records are writable; completed/locked records return a `record_not_draft` error.","For bulk construction prefer `build_procedure_tree` instead."].join(" ")};var UY=W.object({templateId:W.string().uuid().describe("UUID of the `artifact_properties` template to instantiate. Use `search` (entity_type=template) or workspace browsing to discover templates."),workspaceId:W.string().uuid().optional().describe("Workspace ID. The workspace's orgId is used as the artifact's org. When omitted, falls back to the user's first workspace."),organizationId:W.string().uuid().optional().describe("Organization ID. Ignored when workspaceId is provided — derived from the workspace."),name:W.string().min(1).describe('Display name for the new artifact (e.g. "BB-R6 Suzuki run").'),description:W.string().optional(),tags:W.array(W.string()).optional(),properties:W.record(W.string(),W.unknown()).optional().describe("Property overrides on top of the template defaults. Caller wins on key conflicts."),status:Y1.optional(),storageRef:W.string().optional(),location:W.string().optional(),parentId:W.string().uuid().optional(),sourceRecordId:W.string().uuid().optional(),slotBindings:W.array(W.object({role:W.string().describe('Slot role from the template (e.g. "reactant").'),label:W.string().optional().describe('Slot label (e.g. "aryl halide"). Required when the template declares multiple slots of the same role.'),artifactId:W.string().uuid().describe("UUID of the artifact to bind into this slot.")})).optional().describe("Pre-bound slot values. Each binding overrides the template's `defaultArtifactId` for the matching slot. Unmatched bindings are silently ignored. Slots not matched by any binding fall back to `defaultArtifactId`, then to `pendingSlots`.")}),Zb={name:"instantiate_artifact_template",description:["Create a new artifact from an `artifact_properties` template, optionally with pre-bound link slots.","The template provides typed-property defaults + a list of `linkSlots` (e.g. a Suzuki coupling template declares slots for aryl halide / boronic acid / Pd source / base / solvent). Caller-supplied `properties` override the template defaults; caller-supplied `slotBindings` override slot `defaultArtifactId`s.","Slots that aren't bound after this call come back as `pendingSlots` so the next turn can prompt the user (or call this tool again with additional `slotBindings`). Per-slot link failures are non-fatal — the artifact is still created.",'Use this when the user asks to "create a new artifact from <template>" or when an agent flow wants to instantiate a template without going through the lower-level `create_artifact` + per-slot `link_artifact_to_node` choreography.'].join(" ")};var bY=W.object({nodeId:W.string().uuid().describe("UUID of the procedure node to link the artifact to."),artifactId:W.string().uuid().describe("UUID of the artifact to link. Use `search` first to discover existing artifacts, or call `create_artifact` and pass its `linkToNode` shortcut to skip this tool."),role:W.enum(["input","output","derived_from","referenced"]).describe("Role the artifact plays at this node. `input` = consumed/used (e.g., a starting material on a procedure step). `output` = produced/generated (e.g., a sample emerging from a step). `derived_from` = this step's design/procedure was adapted from the artifact (e.g., reaction artifact serving as the recipe template). `referenced` = the step references the artifact without consuming or producing it (e.g., a reaction artifact, equipment manual, or literature item it documents). Pick by direction of flow / nature of the relationship."),context:W.record(W.string(),W.unknown()).optional().describe('Optional structured context describing the link (e.g., `{quantity: "2.5 g", purpose: "limiting reagent"}`). Free-form JSONB; mirrors the UI surface.')}),fb={name:"link_artifact_to_node",description:['Bind an existing artifact to a procedure node by creating an `artifact_links` row with `source_type=procedure_node`. Mirrors the node inspector "Link artifact" affordance and is the agent equivalent of `attach_matrix` for matrices.',"The artifact must already exist — to create + link in one call, use `create_artifact({ linkToNode: { nodeId, role } })` instead.","Role semantics: `input` (consumed/used at this step), `output` (produced/generated), `derived_from` (this step adapts another artifact as its recipe — e.g., a reaction artifact serving as the procedure template), `referenced` (the step references the artifact without consuming/producing — e.g., equipment manuals, literature, reaction artifacts). Pick by direction of flow / nature of the relationship.","The mutation does NOT enforce same-record / same-workspace scope on the artifact — `artifact_links` is polymorphic by design (artifacts can be referenced across the workspace). The node's record drives the surface where the link appears.","Returns the new `linkId` so subsequent `unlink_artifact_from_node({ linkId })` calls don't need to re-query."].join(" ")};var DY=W.object({matrixId:W.string().uuid().describe("UUID of the matrix to inspect.")}),gb={name:"list_matrix_references",description:["List the entity_links that embed a data matrix, with each source's type, id, and display title. Matrix embeds are N:M (one matrix can be inserted in multiple records/documents via a `structuredMatrix` block).","Use before calling `delete_matrix` to understand the blast radius — deleting a matrix with embeds elsewhere leaves those blocks in an unlinked state.",'Also useful for analytical questions: "which documents reference matrix X?" or "is this matrix used outside its owner record?".',"Returns empty when the matrix has no embeds. Read-only; no version gate."].join(" ")};var wY=W.object({nodeId:W.string().uuid().describe("UUID of the procedure node whose artifact links to list.")}),yb={name:"list_node_artifact_links",description:["List all artifact ↔ procedure-node links for a given node. Returns one row per link with `linkId`, `artifactId`, `artifactName`, `artifactType`, `role`, `context`, and `createdAt`.",'Mirrors the node inspector "Artifacts" panel; use this before `unlink_artifact_from_node` when you only know the artifact id (the link id is the join-row uuid, not the artifact id).'].join(" ")};var AY=W.object({recordId:W.string().uuid().describe("Record UUID whose procedure tree you want to inspect.")}),xb={name:"list_procedure_nodes",description:["List the procedure-tree nodes of a record as a flat, token-dense table.","Returns each node's `id`, `parentId`, `order`, `type`, `label`, `copyable`, and live counts of attached matrices, artifact links, and analytical-data file references.","Also emits an `[attachedMatrices]` block with each node-bound matrix's `{matrixId, label, version, rows, cols}` — the `cols` cell uses pipe-separated `key(Label/type[/unit])` entries so you can write `append_/update_/delete_matrix_rows` without an extra `get_content` round-trip.","Orphaned matrices (nodeRef cleared by a node deletion) appear in a separate block with the same schema so they can be rebound via `rebind_matrix_to_node` or dropped via `delete_matrix`.","Use this before editing the tree; reconstruct hierarchy from `parentId` + `order` and pick keys/version for matrix row writes straight from the output."].join(" ")};var NY=W.object({entityId:W.string().describe('Entity ID (UUID or short ref like "doc-9bk4x1f2") that contains the image block.'),blockId:W.string().describe("Block ID of the image to view — the `blockId` from the Figures manifest in `get_content`."),entityType:W.enum(["literature","document","record","artifact"]).optional().describe("Optional entity-type hint; resolution falls back to a lookup.")}),B1={name:"read_image",description:"View an embedded figure/image as actual vision. The image bytes are loaded and handed to me as a visual input so I can SEE the figure — not just its caption.\n\n**When to call:** `get_content` surfaces a **Figures** manifest (caption + `blockId`) at zero token cost. Call `read_image(entityId, blockId)` only when you genuinely need to look at a figure (read a plot, inspect a micrograph, check a scheme). Viewing an image spends vision tokens for every turn it stays in context, so pull deliberately rather than by reflex.\n\n**Input:** the `entityId` you are reading plus the figure's `blockId` from the manifest.\n\n**Returns:** the image itself as vision, paired with a short caption/label line. Supported formats: JPEG, PNG, GIF, WebP (SVG is not viewable). If the block has no image bytes yet, or the file is too large to view, a clear text note is returned instead."};var OY=W.object({matrixId:W.string().uuid().describe("UUID of the target data_matrix."),nodeRef:W.union([W.string().uuid(),W.null()]).describe("Target procedure node UUID, or null to detach (body-level matrix). The node must belong to the same record that owns the matrix. Passing the same value as the current nodeRef is a no-op but still bumps version."),version:W.number().int().min(0).describe("Current matrix version (optimistic locking). Must equal the server's stored version; otherwise returns a matrix_version_conflict error.")}),lb={name:"rebind_matrix_to_node",description:["Change a matrix's procedure-node binding. Three modes via one tool: (a) promote a body-level matrix to a node-attached one (`nodeRef` = new node UUID, current was null), (b) move a node-attached matrix to a different node under the same record, (c) detach a node-attached matrix back to body level (`nodeRef: null`).","The matrix must be record-owned (documents/literature/artifacts have no procedure tree). The target `nodeRef`, when non-null, must reference a node that belongs to the SAME record as the matrix.","Bumps `version` on success; stale `version` returns a structured `matrix_version_conflict` error with the current server version.","Only draft records are writable; completed/locked records return a `record_not_draft` error."].join(" ")};var q3=W.object({nodeId:W.string().uuid().describe("UUID of the node to move/reorder."),parentId:W.string().uuid().nullable().describe("New parent UUID, or null to become a top-level root. Must belong to the same record."),order:W.number().int().min(0).describe("New 0-indexed order within the new parent's children.")}),XY=W.object({recordId:W.string().uuid().describe("Target record UUID. Must be in draft status."),moves:W.array(q3).min(1).describe("Batch of reparent/reorder operations applied together. Each entry carries the node's final parent and order — siblings you don't move keep their current values, so typically you pass moves for the whole sibling set you're rearranging.")}),hb={name:"reorder_procedure_nodes",description:["Batch reparent / reorder procedure-tree nodes in a draft record.","Each move carries the *final* `parentId` + `order` — think of it as a transaction that describes the desired post-state.","Any nodes you omit from `moves` keep their current parent/order, so you usually include the whole sibling set being rearranged.","All moves must target nodes in the same record; cross-record moves are rejected.","Only draft records are writable; completed/locked records return a `record_not_draft` error."].join(" ")};var pC=W.object({cas:W.string().min(5).describe('CAS Registry Number (e.g. "64-17-5" for ethanol). Format: NNNN-NN-N.')}),WY={name:"resolve_cas",description:["Resolve a CAS Registry Number to full PubChem compound metadata.","Convenience wrapper around `search_compound(cas=...)` that always returns the first match. Use this when the user already has a CAS number and just wants the canonical compound back."].join(" ")};var GY=W.object({query:W.string().min(1).optional().describe("Search query keywords"),mode:W.enum(["library","blocks"]).default("library").describe('Search mode: "library" returns unique entities (papers/docs), "blocks" returns block-level results'),scope:W.object({type:W.enum(["literature","document","record","artifact"]).optional().describe("Filter by entity type"),entityId:W.string().uuid().optional().describe("Search within specific entity (blocks mode only)")}).optional().describe("Optional scope to narrow search"),orgId:W.string().uuid().optional().describe("Organization ID - use the one from workspace context"),workspaceId:W.string().uuid().optional().describe("Filter by workspace ID"),spaceId:W.string().uuid().optional().describe("Filter by space ID"),limit:W.number().min(1).max(50).default(10).describe("Max results. Default: 10"),authorName:W.string().optional().describe('Filter by author name (partial match). Example: "Shen" finds papers by authors named Shen'),journalName:W.string().optional().describe('Filter by journal name (partial match). Example: "Nano Letters" finds papers from Nano Letters'),yearMin:W.number().int().min(1900).max(2100).optional().describe("Minimum publication year (inclusive)"),yearMax:W.number().int().min(1900).max(2100).optional().describe("Maximum publication year (inclusive)"),artifactType:W.string().optional().describe('Filter by artifact type: "sample", "dataset", "protocol", "file", "equipment", "chemical", "model"'),artifactStatus:W.string().optional().describe('Filter by artifact status: "active", "depleted", "archived", "draft"')}),ub={name:"search",description:`Search across literature, documents, records, and artifacts.
|
|
156
|
+
**Record draft-gate:** record writes require the record to be in \`draft\` status. \`completed\` / \`locked\` records return a structured \`record_not_draft\` error — stop, surface it to the user, and let them decide whether to re-open the record.`};var JY=W.object({recordId:W.string().uuid().describe("Target record UUID. Must be in draft status."),parentId:W.string().uuid().optional().describe("Existing parent node UUID. Omit to insert as a top-level root under the record."),label:W.string().min(1).describe("Human-readable node label."),type:GU.describe("Node type."),afterNodeId:W.string().uuid().optional().describe("Insert immediately after this existing sibling. Resolves to the sibling's order + 1."),order:W.number().int().min(0).optional().describe("Explicit sibling order (0-indexed). Mutually exclusive with afterNodeId; omit both to append."),copyable:W.boolean().optional().describe('Template-copyable flag. MUST be false (or omitted) when type === "observation".'),analyticalData:W.array(QU).optional().describe("File references attached to the new node.")}).refine(($)=>!($.type==="observation"&&$.copyable===!0),{message:'copyable must be false (or omitted) when type is "observation".',path:["copyable"]}).refine(($)=>!($.afterNodeId&&$.order!==void 0),{message:"Provide either afterNodeId (relative) OR order (absolute), not both.",path:["afterNodeId"]}),fb={name:"insert_procedure_node",description:["Insert a single procedure-tree node under a draft record.","Positioning: `afterNodeId` (place right after an existing sibling) OR `order` (explicit 0-indexed slot) — omit both to append at the end.","`parentId` must be an existing node UUID in the same record; omit for a new root.",'`type === "observation"` must have `copyable` omitted or `false`.',"Only draft records are writable; completed/locked records return a `record_not_draft` error.","For bulk construction prefer `build_procedure_tree` instead."].join(" ")};var HY=W.object({templateId:W.string().uuid().describe("UUID of the `artifact_properties` template to instantiate. Use `search` (entity_type=template) or workspace browsing to discover templates."),workspaceId:W.string().uuid().optional().describe("Workspace ID. The workspace's orgId is used as the artifact's org. When omitted, falls back to the user's first workspace."),organizationId:W.string().uuid().optional().describe("Organization ID. Ignored when workspaceId is provided — derived from the workspace."),name:W.string().min(1).describe('Display name for the new artifact (e.g. "BB-R6 Suzuki run").'),description:W.string().optional(),tags:W.array(W.string()).optional(),properties:W.record(W.string(),W.unknown()).optional().describe("Property overrides on top of the template defaults. Caller wins on key conflicts."),status:YU.optional(),storageRef:W.string().optional(),location:W.string().optional(),parentId:W.string().uuid().optional(),sourceRecordId:W.string().uuid().optional(),slotBindings:W.array(W.object({role:W.string().describe('Slot role from the template (e.g. "reactant").'),label:W.string().optional().describe('Slot label (e.g. "aryl halide"). Required when the template declares multiple slots of the same role.'),artifactId:W.string().uuid().describe("UUID of the artifact to bind into this slot.")})).optional().describe("Pre-bound slot values. Each binding overrides the template's `defaultArtifactId` for the matching slot. Unmatched bindings are silently ignored. Slots not matched by any binding fall back to `defaultArtifactId`, then to `pendingSlots`.")}),Zb={name:"instantiate_artifact_template",description:["Create a new artifact from an `artifact_properties` template, optionally with pre-bound link slots.","The template provides typed-property defaults + a list of `linkSlots` (e.g. a Suzuki coupling template declares slots for aryl halide / boronic acid / Pd source / base / solvent). Caller-supplied `properties` override the template defaults; caller-supplied `slotBindings` override slot `defaultArtifactId`s.","Slots that aren't bound after this call come back as `pendingSlots` so the next turn can prompt the user (or call this tool again with additional `slotBindings`). Per-slot link failures are non-fatal — the artifact is still created.",'Use this when the user asks to "create a new artifact from <template>" or when an agent flow wants to instantiate a template without going through the lower-level `create_artifact` + per-slot `link_artifact_to_node` choreography.'].join(" ")};var MY=W.object({nodeId:W.string().uuid().describe("UUID of the procedure node to link the artifact to."),artifactId:W.string().uuid().describe("UUID of the artifact to link. Use `search` first to discover existing artifacts, or call `create_artifact` and pass its `linkToNode` shortcut to skip this tool."),role:W.enum(["input","output","derived_from","referenced"]).describe("Role the artifact plays at this node. `input` = consumed/used (e.g., a starting material on a procedure step). `output` = produced/generated (e.g., a sample emerging from a step). `derived_from` = this step's design/procedure was adapted from the artifact (e.g., reaction artifact serving as the recipe template). `referenced` = the step references the artifact without consuming or producing it (e.g., a reaction artifact, equipment manual, or literature item it documents). Pick by direction of flow / nature of the relationship."),context:W.record(W.string(),W.unknown()).optional().describe('Optional structured context describing the link (e.g., `{quantity: "2.5 g", purpose: "limiting reagent"}`). Free-form JSONB; mirrors the UI surface.')}),gb={name:"link_artifact_to_node",description:['Bind an existing artifact to a procedure node by creating an `artifact_links` row with `source_type=procedure_node`. Mirrors the node inspector "Link artifact" affordance and is the agent equivalent of `attach_matrix` for matrices.',"The artifact must already exist — to create + link in one call, use `create_artifact({ linkToNode: { nodeId, role } })` instead.","Role semantics: `input` (consumed/used at this step), `output` (produced/generated), `derived_from` (this step adapts another artifact as its recipe — e.g., a reaction artifact serving as the procedure template), `referenced` (the step references the artifact without consuming/producing — e.g., equipment manuals, literature, reaction artifacts). Pick by direction of flow / nature of the relationship.","The mutation does NOT enforce same-record / same-workspace scope on the artifact — `artifact_links` is polymorphic by design (artifacts can be referenced across the workspace). The node's record drives the surface where the link appears.","Returns the new `linkId` so subsequent `unlink_artifact_from_node({ linkId })` calls don't need to re-query."].join(" ")};var VY=W.object({matrixId:W.string().uuid().describe("UUID of the matrix to inspect.")}),yb={name:"list_matrix_references",description:["List the entity_links that embed a data matrix, with each source's type, id, and display title. Matrix embeds are N:M (one matrix can be inserted in multiple records/documents via a `structuredMatrix` block).","Use before calling `delete_matrix` to understand the blast radius — deleting a matrix with embeds elsewhere leaves those blocks in an unlinked state.",'Also useful for analytical questions: "which documents reference matrix X?" or "is this matrix used outside its owner record?".',"Returns empty when the matrix has no embeds. Read-only; no version gate."].join(" ")};var KY=W.object({nodeId:W.string().uuid().describe("UUID of the procedure node whose artifact links to list.")}),xb={name:"list_node_artifact_links",description:["List all artifact ↔ procedure-node links for a given node. Returns one row per link with `linkId`, `artifactId`, `artifactName`, `artifactType`, `role`, `context`, and `createdAt`.",'Mirrors the node inspector "Artifacts" panel; use this before `unlink_artifact_from_node` when you only know the artifact id (the link id is the join-row uuid, not the artifact id).'].join(" ")};var zY=W.object({recordId:W.string().uuid().describe("Record UUID whose procedure tree you want to inspect.")}),lb={name:"list_procedure_nodes",description:["List the procedure-tree nodes of a record as a flat, token-dense table.","Returns each node's `id`, `parentId`, `order`, `type`, `label`, `copyable`, and live counts of attached matrices, artifact links, and analytical-data file references.","Also emits an `[attachedMatrices]` block with each node-bound matrix's `{matrixId, label, version, rows, cols}` — the `cols` cell uses pipe-separated `key(Label/type[/unit])` entries so you can write `append_/update_/delete_matrix_rows` without an extra `get_content` round-trip.","Orphaned matrices (nodeRef cleared by a node deletion) appear in a separate block with the same schema so they can be rebound via `rebind_matrix_to_node` or dropped via `delete_matrix`.","Use this before editing the tree; reconstruct hierarchy from `parentId` + `order` and pick keys/version for matrix row writes straight from the output."].join(" ")};var FY=W.object({entityType:W.enum(["literature","artifact","record","document"]).describe("Kind of entity being placed."),entityId:W.string().uuid().describe("UUID of the entity to place."),action:W.enum(["add","remove"]).describe('"add" assigns / moves the entity into the target; "remove" un-assigns it (for a document, "remove" makes it private).'),workspaceId:W.string().uuid().optional().describe("Target workspace. Literature/artifact ONLY — record & document workspaces are fixed, so omit it for those."),spaceId:W.string().uuid().optional().describe("Target space. literature/artifact/record assign via an M:N junction; a document has at most one space.")}).superRefine(($,I)=>{if(($.entityType==="record"||$.entityType==="document")&&$.workspaceId!==void 0)I.addIssue({code:W.ZodIssueCode.custom,message:`${$.entityType} workspace is fixed — omit workspaceId (only its space is assignable).`,path:["workspaceId"]});if($.entityType==="record"&&$.spaceId===void 0)I.addIssue({code:W.ZodIssueCode.custom,message:"record placement requires spaceId.",path:["spaceId"]});if(($.entityType==="literature"||$.entityType==="artifact")&&$.workspaceId===void 0&&$.spaceId===void 0)I.addIssue({code:W.ZodIssueCode.custom,message:"Provide workspaceId and/or spaceId for literature/artifact placement.",path:["spaceId"]});if($.entityType==="document"&&$.action==="add"&&$.spaceId===void 0)I.addIssue({code:W.ZodIssueCode.custom,message:'document "add" requires spaceId (omit it on "remove" to make the document private).',path:["spaceId"]})}),hb={name:"place_entity",description:["Change where an entity lives on its ASSIGNABLE axis — add or remove a workspace/space placement. This never moves an entity's fixed home (the organization for all; additionally the workspace for records and documents).",'literature & artifact are org-homed and assignable to workspaces AND spaces (M:N) — pass workspaceId and/or spaceId. record is workspace-fixed and assignable to spaces only — pass spaceId, never workspaceId. document is workspace-fixed and lives in at most ONE space — "add" with spaceId moves it there, "remove" makes it private.',"Check current placement first (via situate / get_content) to avoid redundant calls; removing a placement that does not exist is a harmless no-op."].join(" ")};var kY=W.object({entityId:W.string().describe('Entity ID (UUID or short ref like "doc-9bk4x1f2") that contains the image block.'),blockId:W.string().describe("Block ID of the image to view — the `blockId` from the Figures manifest in `get_content`."),entityType:W.enum(["literature","document","record","artifact"]).optional().describe("Optional entity-type hint; resolution falls back to a lookup.")}),vU={name:"read_image",description:"View an embedded figure/image as actual vision. The image bytes are loaded and handed to me as a visual input so I can SEE the figure — not just its caption.\n\n**When to call:** `get_content` surfaces a **Figures** manifest (caption + `blockId`) at zero token cost. Call `read_image(entityId, blockId)` only when you genuinely need to look at a figure (read a plot, inspect a micrograph, check a scheme). Viewing an image spends vision tokens for every turn it stays in context, so pull deliberately rather than by reflex.\n\n**Input:** the `entityId` you are reading plus the figure's `blockId` from the manifest.\n\n**Returns:** the image itself as vision, paired with a short caption/label line. Supported formats: JPEG, PNG, GIF, WebP (SVG is not viewable). If the block has no image bytes yet, or the file is too large to view, a clear text note is returned instead."};var qY=W.object({matrixId:W.string().uuid().describe("UUID of the target data_matrix."),nodeRef:W.union([W.string().uuid(),W.null()]).describe("Target procedure node UUID, or null to detach (body-level matrix). The node must belong to the same record that owns the matrix. Passing the same value as the current nodeRef is a no-op but still bumps version."),version:W.number().int().min(0).describe("Current matrix version (optimistic locking). Must equal the server's stored version; otherwise returns a matrix_version_conflict error.")}),ub={name:"rebind_matrix_to_node",description:["Change a matrix's procedure-node binding. Three modes via one tool: (a) promote a body-level matrix to a node-attached one (`nodeRef` = new node UUID, current was null), (b) move a node-attached matrix to a different node under the same record, (c) detach a node-attached matrix back to body level (`nodeRef: null`).","The matrix must be record-owned (documents/literature/artifacts have no procedure tree). The target `nodeRef`, when non-null, must reference a node that belongs to the SAME record as the matrix.","Bumps `version` on success; stale `version` returns a structured `matrix_version_conflict` error with the current server version.","Only draft records are writable; completed/locked records return a `record_not_draft` error."].join(" ")};var m3=W.object({nodeId:W.string().uuid().describe("UUID of the node to move/reorder."),parentId:W.string().uuid().nullable().describe("New parent UUID, or null to become a top-level root. Must belong to the same record."),order:W.number().int().min(0).describe("New 0-indexed order within the new parent's children.")}),EY=W.object({recordId:W.string().uuid().describe("Target record UUID. Must be in draft status."),moves:W.array(m3).min(1).describe("Batch of reparent/reorder operations applied together. Each entry carries the node's final parent and order — siblings you don't move keep their current values, so typically you pass moves for the whole sibling set you're rearranging.")}),ib={name:"reorder_procedure_nodes",description:["Batch reparent / reorder procedure-tree nodes in a draft record.","Each move carries the *final* `parentId` + `order` — think of it as a transaction that describes the desired post-state.","Any nodes you omit from `moves` keep their current parent/order, so you usually include the whole sibling set being rearranged.","All moves must target nodes in the same record; cross-record moves are rejected.","Only draft records are writable; completed/locked records return a `record_not_draft` error."].join(" ")};var Ff=W.object({cas:W.string().min(5).describe('CAS Registry Number (e.g. "64-17-5" for ethanol). Format: NNNN-NN-N.')}),SY={name:"resolve_cas",description:["Resolve a CAS Registry Number to full PubChem compound metadata.","Convenience wrapper around `search_compound(cas=...)` that always returns the first match. Use this when the user already has a CAS number and just wants the canonical compound back."].join(" ")};var jY=W.object({query:W.string().min(1).optional().describe("Search query keywords"),mode:W.enum(["library","blocks"]).default("library").describe('Search mode: "library" returns unique entities (papers/docs), "blocks" returns block-level results'),scope:W.object({type:W.enum(["literature","document","record","artifact"]).optional().describe("Filter by entity type"),entityId:W.string().uuid().optional().describe("Search within specific entity (blocks mode only)")}).optional().describe("Optional scope to narrow search"),orgId:W.string().uuid().optional().describe("Organization ID - use the one from workspace context"),workspaceId:W.string().uuid().optional().describe("Filter by workspace ID"),spaceId:W.string().uuid().optional().describe("Filter by space ID"),limit:W.number().min(1).max(50).default(10).describe("Max results. Default: 10"),authorName:W.string().optional().describe('Filter by author name (partial match). Example: "Shen" finds papers by authors named Shen'),journalName:W.string().optional().describe('Filter by journal name (partial match). Example: "Nano Letters" finds papers from Nano Letters'),yearMin:W.number().int().min(1900).max(2100).optional().describe("Minimum publication year (inclusive)"),yearMax:W.number().int().min(1900).max(2100).optional().describe("Maximum publication year (inclusive)"),artifactType:W.string().optional().describe('Filter by artifact type: "sample", "dataset", "protocol", "file", "equipment", "chemical", "model"'),artifactStatus:W.string().optional().describe('Filter by artifact status: "active", "depleted", "archived", "draft"')}),nb={name:"search",description:`Search across literature, documents, records, and artifacts.
|
|
156
157
|
|
|
157
158
|
**Modes:**
|
|
158
159
|
- \`library\` (default): Returns unique entities ranked by relevance. Use when browsing/discovering.
|
|
@@ -204,9 +205,9 @@ Requires \`workspaceId\`. Returns artifact names, types, and retrieval hints.
|
|
|
204
205
|
**Retrieval Hints:**
|
|
205
206
|
Library mode results include \`bestBlockId\` and smart \`retrievalHint\`:
|
|
206
207
|
- High relevance: Jump directly to the best block via \`blockIds=['bestBlockId']\`
|
|
207
|
-
- Medium/Low relevance: Start with \`overview=true\` to explore structure first`};var tC=W.object({name:W.string().optional().describe("Compound name, trade name, or systematic name."),cas:W.string().optional().describe('CAS Registry Number (e.g. "64-17-5" for ethanol).'),cid:W.number().int().positive().optional().describe("PubChem CID."),inchi_key:W.string().optional().describe('InChIKey (27-char hash, e.g. "LFQSCWFLJHTTHZ-UHFFFAOYSA-N").'),limit:W.number().int().min(1).max(10).optional().describe("Max results when searching by name (default 5). Ignored for exact-identifier lookups (cid / inchi_key / cas).")}).refine(($)=>Boolean($.name||$.cas||$.cid||$.inchi_key),"Provide at least one of: name, cas, cid, inchi_key."),QY={name:"search_compound",description:["Look up chemical compounds via PubChem. Accepts any identifier (name / CAS / CID / InChIKey).","Returns up to `limit` matches (default 5, max 10) with molecular formula, MW, SMILES, InChIKey, CAS numbers, and synonyms — enough to verify which compound the user means before acting.",`Use this when the user asks reference questions like "what's the molecular weight of aspirin", "find the CAS number for caffeine", or wants to disambiguate between isomers / common names.`,'Do NOT use this to search the workspace\'s own chemical artifacts — use the `search` tool with `entityType="artifact"` for that. PubChem is the world index; `search` is the local inventory.'].join(" ")};var k3=W.enum(["image/png","image/jpeg","image/webp","image/gif"]),YY=W.object({entityType:W.enum(["document","record"]).describe("Entity to edit. Images can only be written to documents and records."),entityId:W.string().describe("Document or record ID (UUID or short ref)."),blockId:W.string().optional().describe("Image block to mutate in place. Omit to INSERT a new image block (use afterBlockId / beforeBlockId to position it)."),dataBase64:W.string().optional().describe("Raw base64 of a new image file (no `data:` prefix). The tool uploads it to workspace storage and attaches the resulting URL. Pair with `mimeType`."),mimeType:k3.optional().describe("Media type of `dataBase64`. Required when `dataBase64` is set."),url:W.string().optional().describe("Alternative to `dataBase64`: an already-hosted workspace media URL to attach."),caption:W.string().optional().describe("Figure caption. ALWAYS set a meaningful caption — it is the only text channel by which the image reaches search and other agents."),name:W.string().optional().describe("Image file/display name."),previewWidth:W.number().int().positive().optional().describe("Inline preview width in px (default 512 on insert)."),showPreview:W.boolean().optional().describe("Whether the image renders inline (default true on insert)."),afterBlockId:W.string().optional().describe("Insert the new image block after this block (insert mode)."),beforeBlockId:W.string().optional().describe("Insert the new image block before this block (insert mode).")}),v1={name:"set_image",description:"Attach, replace, or caption an image on a document/record. Image blocks surface in `get_content` as the **Figures** manifest (caption + blockId).\n\n**Modes:**\n- **Attach a new image:** omit `blockId`; pass `dataBase64` (+ `mimeType`) for new bytes, or a workspace `url`. Position with `afterBlockId` / `beforeBlockId` (defaults to end). Always include a `caption`.\n- **Replace an image's bytes:** pass the `blockId` plus new `dataBase64` (+ `mimeType`) or `url`.\n- **Edit only the caption / name:** pass the `blockId` plus `caption` (and/or `name`) — no bytes needed.\n\nOnly documents and records are editable (literature is read-only). Records must be in `draft` status. Supported image types: PNG, JPEG, WebP, GIF."};var BY=W.object({entityId:W.string().optional().describe('ENTITY MODE: entity ID (UUID or short ref like "rec-a3f7e2b9") to situate — the root of a bounded k-hop neighborhood. Provide this OR spaceId, not both.'),spaceId:W.string().uuid().optional().describe("SPACE MODE: space UUID (from get_workspace_context) — map the WHOLE space's connectivity graph (every entity in the space + their direct relationships). Provide this OR entityId, not both."),depth:W.union([W.literal(1),W.literal(2),W.literal(3)]).optional().describe("Traversal depth. Entity mode: 1–3 (default 2). Space mode: 1–2 (clamped; default 1). Bounded BFS over the unified edge model; matrix/node endpoints are terminal leaves.")}).refine(($)=>Boolean($.entityId)!==Boolean($.spaceId),{message:"Provide exactly one of entityId or spaceId."}),ib={name:"situate",description:["Map relationships as a bounded graph in ONE call — instead of 4–6 manual get_content follow-ups. Two modes (give exactly one):","ENTITY MODE (entityId): the bounded k-hop neighborhood around ONE entity — its root, hop-annotated nodes, and canonical hop-annotated edges grouped by depth.",`SPACE MODE (spaceId, from get_workspace_context): the WHOLE space's connectivity — every entity in the space plus their direct relationships (a multi-seed depth-1 graph), with in-space entities and connected "border" entities distinguished.`,"Edges span the unified model (the same get_content surfaces): mentions, citations, annotation edges, matrix/artifact embeds, transactional artifact links (record/procedure-node → artifact, role input|output|derived_from|referenced), matrix provenance, and promoted typed relation predicates. `matrix`/`node` endpoints are terminal leaves. Per-hop ranking keeps typed/promoted + high-reuse + structural edges; `truncated:true` means a busy hop dropped low-signal edges (re-`situate` a specific node instead).","Use entity mode to map how one record/document/literature/artifact connects before deep-reading; use space mode to survey a whole space's structure. `situate` is structure-traversal; `search` is relevance-ranking — they are distinct. Follow interesting nodes with get_content."].join(" ")};var vY=W.object({entityType:d6.describe('Entity type: "document" or "record"'),entityId:W.string().uuid().describe("Document or record ID"),blockId:W.string().describe("Block ID to edit"),oldText:W.string().describe("Exact text to find and replace (must match exactly)"),newText:W.string().describe("Text to replace with")}),nb={name:"str_replace_block",description:"Replace text content in a specific block. Works like Claude Code str_replace - find exact text and replace it. oldText must match exactly (case-sensitive). Use get_content first to see exact block content. Content supports SURA markdown inline syntax: **bold**, *italic*, ~~strike~~, `code`, {u}underline{/u}, {color:red}text color{/color}, {bg:yellow}background{/bg}. Colors: default, gray, brown, red, orange, yellow, green, blue, purple, pink. "+"Records: only `draft` records are writable. On `completed`/`locked` records the call returns a structured `record_not_draft` error — stop and ask the user to re-open the record; do not try to flip the status yourself."};var JY=W.object({linkId:W.string().uuid().describe("UUID of the `artifact_links` row to delete. Returned by `link_artifact_to_node` and `list_node_artifact_links`.")}),cb={name:"unlink_artifact_from_node",description:["Remove an artifact ↔ procedure-node link by `linkId`. The artifact and the node both stay; only the join row is dropped.","Use `list_node_artifact_links({ nodeId })` first if you only know the node + artifact identifiers — the link id is the join-row uuid, not the artifact id.","Idempotent at the user level: deleting a non-existent link returns `success: true` with `id` echoed (delete-by-id is a no-op on missing rows in the underlying repo)."].join(" ")};var rb={tests:{gloss:"experiment/run → hypothesis/claim/method/prediction: the subject is an empirical test of the object.",reading:"[subject] tests [object]",example:"This run tests the biphasic-DMSN nucleation hypothesis.",symmetric:!1},supports:{gloss:"evidence/result → claim: the subject is evidence in favour of the object (positive pole).",reading:"[subject] supports [object]",example:"The DLS size distribution supports the monodispersity claim.",symmetric:!1},refutes:{gloss:"evidence/result → claim: the subject is evidence against the object (negative pole).",reading:"[subject] refutes [object]",example:"The blank control refutes the catalyst-free pathway claim.",symmetric:!1},replicates:{gloss:"run → prior run: the subject independently reproduces the object under matching conditions.",reading:"[subject] replicates [object]",example:"This batch replicates the 2026-03 reference synthesis.",symmetric:!1},supersedes:{gloss:"newer → older: the subject wholesale replaces the object (the object no longer stands).",reading:"[subject] supersedes [object]",example:"The v2 protocol supersedes the original procedure.",symmetric:!1},corrects:{gloss:"erratum/fix → flawed entity: the subject fixes a specific error in the object (object otherwise stands).",reading:"[subject] corrects [object]",example:"This erratum corrects the yield reported in the prior record.",symmetric:!1},uses:{gloss:"run/analysis → protocol/method/instrument/dataset: the subject employs the object as an input or tool.",reading:"[subject] uses [object]",example:"This characterization uses the standard DLS SOP.",symmetric:!1},characterizes:{gloss:"analysis/measurement → sample/material: the subject measures or describes properties of the object.",reading:"[subject] characterizes [object]",example:"This TEM analysis characterizes the silica nanoparticle sample.",symmetric:!1}},HY=Object.keys(rb),mb=W.enum(HY);function t4(){return HY.map(($)=>`- \`${$}\` — ${rb[$].gloss} Reading: "${rb[$].reading}". e.g. ${rb[$].example}`).join(`
|
|
208
|
-
`)}var
|
|
209
|
-
${t4()}`),note:W.string().min(1).describe("REQUIRED rationale (§5.9c): a concise free-text justification for asserting this typed relation. Domain specificity lives here; the predicate stays universal. Stored in `relation_note`; the structural `role` is left untouched.")}),
|
|
210
|
-
`)};var
|
|
211
|
-
${t4()}`),note:W.string().min(1).describe("REQUIRED rationale (§5.9c): a concise free-text justification for asserting this typed edge. Domain specificity lives here; the predicate stays universal."),direction:W.enum(["forward","inverse"]).describe("Reading orientation (§6.2). `forward` = subject → object (the source entity tests/uses/etc. the mentioned entity — the usual case). `inverse` = object → subject (e.g. the mentioned reviewer note *refutes* this document). Storage always keeps source = subject; this only flips the reading.")}),
|
|
212
|
-
`)};var sC=W.record(W.string(),W.union([W.string(),W.number(),W.boolean(),W.null()])).describe("Row match: every provided key/value must equal the row's current value. Matches all rows where the criteria hold (not just the first)."),$Z=W.object({rowIndex:W.number().int().min(0).optional().describe("Target a single row by 0-based index in the current rows array."),rowMatch:sC.optional(),values:W1.describe("Partial row patch. **Keys MUST match `col.key` (the column id), NOT `col.label`.** Keys present here overwrite the matching rows' cells. Keys not in `values` retain their existing values. Set a key to null to clear a cell.")}).refine(($)=>{let I=$.rowIndex!==void 0,U=$.rowMatch!==void 0;return I!==U},{message:"Provide exactly one of `rowIndex` (absolute) or `rowMatch` (by column values).",path:["rowIndex"]}),LY=W.object({matrixId:W.string().uuid().describe("UUID of the target data_matrix."),updates:W.array($Z).min(1).describe("List of row patches. Each entry targets rows by `rowIndex` OR `rowMatch` and supplies a partial `values` patch."),version:W.number().int().min(0).describe("Current matrix version (optimistic locking). Must equal the server's stored version; otherwise returns a matrix_version_conflict error.")}),pb={name:"update_matrix_rows",description:["Patch cells in an existing data matrix. Each update targets rows by `rowIndex` (absolute 0-based) OR `rowMatch` (every provided column/value must equal the row's current cell); partial column updates are allowed.","**All row-keyed objects (`values`, `rowMatch`) MUST use `col.key` as the object key, NOT `col.label`.** Read the schema first via `get_content` on the owning entity — its matrix TOON shows `cols: key(Label,type[,unit])` and a `{key1,key2,...}` row header. Mismatched keys persist as opaque JSONB that the UI cannot render.","Match mode updates every row that satisfies the criteria — use it when the match is unique, or when you intend to update a whole group at once.","Bumps `version` on success; stale `version` returns a structured `matrix_version_conflict` error with the current server version so you can re-fetch and retry.","Set a `values` entry to null to clear a cell. Keys not present in `values` are untouched.","Only draft records are writable; completed/locked records return a `record_not_draft` error.",'**Stoichiometry matrices** (`kind=stoichiometry` in the matrix header): clearing a numeric cell to null re-enables client-side derivation via the chemistry identities (n = m/M, n = V·c, m = V·ρ·purity, n = stockMolarity·V, n = stockWtPercent·ρ_soln·V/M, n_i = equiv_i · n_limiting, equiv_i = n_i / n_limiting). Keys not in `values` stay untouched — use this to preserve the hidden `compoundId` link to a chemical artifact while patching other cells. Do not manually recompute derived quantities; write only measured or locked-in values. For aqueous stock solutions, set `stockMolarity` (mol/L) or `stockWtPercent` (0–100) rather than approximating via `purity` × `density`. The displayed `c` is computed against a per-row reference volume controlled by two hidden keys: `cBasis` (`null` | `"none"` | `"phase"` | `"total"` | `"manual"`; null = engine picks default by role+phase, "phase" = c relative to V_phase, "total" = c relative to V_total, "manual" = c relative to `cBasisManualVolume`, "none" = blank c) and `cBasisManualVolume` (mL, only used when cBasis="manual"). Leave both null unless the user explicitly set them.'].join(" ")};var zY=W.object({nodeId:W.string().uuid().describe("UUID of the existing procedure node to update."),label:W.string().min(1).optional().describe("New label (skip to keep existing)."),type:G1.optional().describe('New type (skip to keep existing). Changing type to "observation" forces copyable=false.'),copyable:W.boolean().optional().describe('Template-copyable flag. When the resulting type is "observation" this must be false (or omitted).'),analyticalData:W.array(Q1).optional().describe("Replace the current `analyticalData` list with this one. Pass an empty array to clear it; omit to leave it untouched.")}).refine(($)=>{if($.type!=="observation")return!0;return $.copyable===void 0||$.copyable===!1},{message:'copyable must be false (or omitted) when type is "observation".',path:["copyable"]}).refine(($)=>$.label!==void 0||$.type!==void 0||$.copyable!==void 0||$.analyticalData!==void 0,{message:"Provide at least one field to update (label, type, copyable, analyticalData)."}),tb={name:"update_procedure_node",description:["Update non-structural fields of a procedure-tree node (label, type, copyable, analyticalData).","Structural changes (move / reorder) go through `reorder_procedure_nodes` — this tool never touches parentId or order.",'`type === "observation"` implies `copyable = false`; setting both to a conflicting combination is rejected.',"Passing an empty `analyticalData` array clears the file-ref list; omitting the field leaves it untouched.","Only draft records are writable; completed/locked records return a `record_not_draft` error."].join(" ")};var VY=[ub,Rb,B1,ib,nb,_b,v1,vb,qb,Eb,Kb,Fb,kb,Mb,Zb,Tb,xb,zb,Cb,tb,hb,Pb,Jb,pb,Vb,Sb,lb,Hb,gb,jb,fb,cb,yb,ob,db,QY,tQ,aQ,WY,eQ],IZ=VY.map(($)=>$.name),UZ=Object.fromEntries(VY.map(($)=>[$.name,$]));function MY($){return{content:[{type:"text",text:$}]}}function KY($){return{content:[{type:"text",text:$}],isError:!0}}function _($,I,U){let{definition:D,schema:b,createExecutor:w,formatOutput:A,formatError:N=(Q)=>Q.message,getLogMessage:O=(Q)=>JSON.stringify(Q).slice(0,100)}=U,X=w(I),G=b.shape;$.tool(D.name,D.description,G,async(Q)=>{let Y=Q,B=O(Y);I.log.info(`${D.name}: ${B}`);try{let J=await X(Y),L=A(J,Y);return I.log.info(`${D.name}: completed`),MY(L)}catch(J){let L=J instanceof Error?N(J,Y):"Unknown error";return I.log.error(`${D.name} failed:`,J),KY(`${D.name} error: ${L}`)}})}function SN($,I,U){let{definition:D,schema:b,createExecutor:w,formatSuccess:A,formatNotFound:N=(Y)=>JSON.stringify({found:!1,error:Y.error??"Not found"}),formatError:O=(Y)=>Y.message,getLogMessage:X=(Y)=>JSON.stringify(Y).slice(0,100)}=U,G=w(I),Q=b.shape;$.tool(D.name,D.description,Q,async(Y)=>{let B=Y,J=X(B);I.log.info(`${D.name}: ${J}`);try{let L=await G(B);if(!L.found)return I.log.info(`${D.name}: not found`),{content:[{type:"text",text:N(L,B)}],isError:!0};return I.log.info(`${D.name}: found`),MY(A(L,B))}catch(L){let K=L instanceof Error?O(L,B):"Unknown error";return I.log.error(`${D.name} failed:`,L),KY(`${D.name} error: ${K}`)}})}function E3($,I){_($,I,{definition:Jb,schema:UQ,createExecutor:(U)=>{return async(D)=>{return await U.client.appendMatrixRows(D)}},formatOutput:yQ,getLogMessage:(U)=>`Appending ${U.rows.length} row(s) to matrix ${U.matrixId.slice(0,8)}`})}function j3($,I){_($,I,{definition:Hb,schema:bQ,createExecutor:(U)=>{return async(D)=>{return await U.client.attachMatrix(D)}},formatOutput:iQ,getLogMessage:(U)=>{let D=U.nodeRef?` + node ${U.nodeRef.slice(0,8)}`:"";return`Attaching matrix ${U.matrixId.slice(0,8)} → ${U.entityType}:${U.entityId.slice(0,8)}${D}`}})}function S3($,I){_($,I,{definition:zb,schema:DQ,createExecutor:(U)=>{return async(D)=>{return await U.client.buildProcedureTree(D)}},formatOutput:gQ,getLogMessage:(U)=>`${U.mode==="replace"?"REPLACE":"append"} procedure tree for record ${U.recordId.slice(0,8)}: ${U.nodes.length} node(s)`})}function P3($,I){_($,I,{definition:Mb,schema:AQ,createExecutor:(U)=>{return async(D)=>{return await U.client.createArtifact(D)}},formatOutput:RQ,getLogMessage:(U)=>`Creating ${U.artifactType} "${U.name.slice(0,30)}"`})}function R3($,I){_($,I,{definition:Kb,schema:NQ,createExecutor:(U)=>{return async(D)=>{return await U.client.createDocument(D)}},formatOutput:VQ,getLogMessage:(U)=>`Creating document: "${U.title.slice(0,30)}${U.title.length>30?"...":""}"`})}function T3($,I){_($,I,{definition:Fb,schema:OQ,createExecutor:(U)=>{return async(D)=>{return U.client.createLiterature(D)}},formatOutput:MQ,getLogMessage:(U)=>`Importing literature: "${U.title.slice(0,30)}${U.title.length>30?"...":""}"${U.doi?` (DOI: ${U.doi})`:""}`})}function _3($,I){_($,I,{definition:qb,schema:XQ,createExecutor:(U)=>{return async(D)=>{return await U.client.createMatrixFromArtifact(D)}},formatOutput:FQ,getLogMessage:(U)=>`Deriving matrix from artifact ${U.artifactId.slice(0,8)}`})}function C3($,I){_($,I,{definition:kb,schema:WQ,createExecutor:(U)=>{return async(D)=>{return await U.client.createRecord(D)}},formatOutput:jQ,getLogMessage:(U)=>`Creating record: "${U.title.slice(0,30)}${U.title.length>30?"...":""}"${U.initialTree?` + ${U.initialTree.length} node(s)`:""}`})}function Z3($,I){_($,I,{definition:Eb,schema:FN,createExecutor:(U)=>{return async(D)=>{return await U.client.deleteBlock(D)}},formatOutput:EQ,getLogMessage:(U)=>{if(U.blockIds&&U.blockIds.length>0)return`${U.entityType}/${U.entityId.slice(0,8)} batch delete ${U.blockIds.length} blocks`;return`${U.entityType}/${U.entityId.slice(0,8)} block ${U.blockId?.slice(0,8)??"unknown"}`}})}function f3($,I){_($,I,{definition:jb,schema:GQ,createExecutor:(U)=>{return async(D)=>{return await U.client.deleteMatrix(D)}},formatOutput:uQ,getLogMessage:(U)=>`Deleting matrix ${U.matrixId.slice(0,8)} (+ block)`})}function g3($,I){_($,I,{definition:Sb,schema:QQ,createExecutor:(U)=>{return async(D)=>{return await U.client.deleteMatrixRows(D)}},formatOutput:lQ,getLogMessage:(U)=>{return`Deleting rows (${U.rowIndices?`${U.rowIndices.length} index(es)`:"match"}) from matrix ${U.matrixId.slice(0,8)}`}})}function y3($,I){_($,I,{definition:Pb,schema:YQ,createExecutor:(U)=>{return async(D)=>{return await U.client.deleteProcedureNode(D)}},formatOutput:fQ,getLogMessage:(U)=>`Deleting procedure node ${U.nodeId.slice(0,8)} (cascade)`})}function x3($,I){SN($,I,{definition:Rb,schema:sQ,createExecutor:(U)=>{return async(D)=>{return U.client.getContent(D)}},formatSuccess:LQ,formatNotFound:(U)=>JSON.stringify({found:!1,error:U.error??"Entity not found"}),getLogMessage:(U)=>{let D=U.blockIds?`blocks:${U.blockIds.length}`:U.segment?`segment:"${U.segment}"`:U.from_section&&U.to_section?`range:"${U.from_section}"-"${U.to_section}"`:U.node?`node:"${U.node}"${U.depth!==void 0?`,depth=${U.depth}`:""}`:U.section?`section:"${U.section}"${U.depth!==void 0?`,depth=${U.depth}`:""}`:U.refs?`refs:${U.refs.length}`:"overview";return`${U.entityId.slice(0,8)}... (${D})`}})}function l3($,I){_($,I,{definition:Tb,schema:$Y,createExecutor:(U)=>{return async(D)=>{if(U.workspaceContext&&!D.forceRefresh)return U.workspaceContext;let b=await U.client.getWorkspaceContext();return U.workspaceContext=b,b}},formatOutput:vQ,getLogMessage:(U)=>U.forceRefresh?"force refresh":"cached"})}function h3($,I){_($,I,{definition:_b,schema:kN,createExecutor:(U)=>{return async(D)=>{return await U.client.insertBlock(D)}},formatOutput:kQ,getLogMessage:(U)=>{let D;if(U.parentBlockId)D=`in:${U.parentBlockId.slice(0,8)}`;else if(U.beforeBlockId)D=`before:${U.beforeBlockId.slice(0,8)}`;else if(U.afterBlockId)D=`after:${U.afterBlockId.slice(0,8)}`;else D="start";if(U.blocks&&U.blocks.length>0)return`${U.entityType}/${U.entityId.slice(0,8)} ${D} (batch: ${U.blocks.length} blocks)`;return`${U.entityType}/${U.entityId.slice(0,8)} ${D} (${U.blockType??"paragraph"})`}})}function u3($,I){_($,I,{definition:vb,schema:IQ,createExecutor:(U)=>{return async(D)=>{return await U.client.insertMatrix(D)}},formatOutput:(U)=>KQ(U),getLogMessage:(U)=>`"${U.label.slice(0,30)}${U.label.length>30?"...":""}"`})}function i3($,I){_($,I,{definition:Cb,schema:IY,createExecutor:(U)=>{return async(D)=>{return await U.client.insertProcedureNode(D)}},formatOutput:SQ,getLogMessage:(U)=>`Inserting procedure node "${U.label.slice(0,30)}" into record ${U.recordId.slice(0,8)}`})}function n3($,I){_($,I,{definition:Zb,schema:UY,createExecutor:(U)=>{return async(D)=>{return await U.client.instantiateArtifactTemplate(D)}},formatOutput:_Q,getLogMessage:(U)=>`Instantiating template ${U.templateId.slice(0,8)} → "${U.name}"`})}function c3($,I){_($,I,{definition:fb,schema:bY,createExecutor:(U)=>{return async(D)=>{return await U.client.linkArtifactToNode(D)}},formatOutput:cQ,getLogMessage:(U)=>`Linking artifact ${U.artifactId.slice(0,8)} → node ${U.nodeId.slice(0,8)} (${U.role})`})}function r3($,I){_($,I,{definition:gb,schema:DY,createExecutor:(U)=>{return async(D)=>{return await U.client.listMatrixReferences(D)}},formatOutput:nQ,getLogMessage:(U)=>`Listing references for matrix ${U.matrixId.slice(0,8)}`})}function m3($,I){_($,I,{definition:yb,schema:wY,createExecutor:(U)=>{return async(D)=>{return await U.client.listNodeArtifactLinks(D)}},formatOutput:dQ,getLogMessage:(U)=>`Listing artifact links for node ${U.nodeId.slice(0,8)}`})}function o3($,I){_($,I,{definition:xb,schema:AY,createExecutor:(U)=>{return async(D)=>{return await U.client.listProcedureNodes(D)}},formatOutput:pQ,getLogMessage:(U)=>`Listing procedure nodes for record ${U.recordId.slice(0,8)}`})}function d3($,I){let U=NY.shape;$.tool(B1.name,B1.description,U,async(D)=>{let b=D;I.log.info(`read_image: ${b.entityId.slice(0,8)}.../${b.blockId.slice(0,8)}...`);try{let w=await I.client.readImage(b);if(!(w.found&&w.dataBase64&&w.mimeType))return{content:[{type:"text",text:JSON.stringify({found:!1,blockId:w.blockId,error:w.error??"Image not available."})}],isError:!0};let A=w.byteSize?`${Math.round(w.byteSize/1024)} KB`:"",N=A?` (${w.mimeType}, ${A})`:"",O=`Figure ${w.blockId}${w.caption?`: ${w.caption}`:""}${N}`;return{content:[{type:"image",data:w.dataBase64,mimeType:w.mimeType},{type:"text",text:O}]}}catch(w){return I.log.error("read_image failed:",w),{content:[{type:"text",text:`read_image error: ${w instanceof Error?w.message:"Unknown error"}`}],isError:!0}}})}function p3($,I){_($,I,{definition:lb,schema:OY,createExecutor:(U)=>{return async(D)=>{return await U.client.rebindMatrixToNode(D)}},formatOutput:hQ,getLogMessage:(U)=>{let D=U.nodeRef?U.nodeRef.slice(0,8):"(body)";return`Rebinding matrix ${U.matrixId.slice(0,8)} → ${D}`}})}function t3($,I){_($,I,{definition:hb,schema:XY,createExecutor:(U)=>{return async(D)=>{return await U.client.reorderProcedureNodes(D)}},formatOutput:ZQ,getLogMessage:(U)=>`Reordering ${U.moves.length} procedure node(s) in record ${U.recordId.slice(0,8)}`})}function bZ($,I){if($>0){if($<0.5)return"high";if($<1.5)return"medium";return"low"}return I>0?"medium":"low"}function a3($,I){_($,I,{definition:ub,schema:GY,createExecutor:(U)=>{return async(D)=>{let b=D.mode??"library",w=D.limit??10;if(D.scope?.type==="artifact"&&b==="library"&&D.workspaceId){let X=await U.client.searchArtifacts({workspaceId:D.workspaceId,query:D.query,artifactType:D.artifactType,artifactStatus:D.artifactStatus,limit:w}),G=X.results.map((Q)=>{let Y=Q.description?Q.description.length>100?`${Q.description.slice(0,97)}...`:Q.description:`${Q.artifactType}, ${Q.status}`;return{entityType:"artifact",entityId:Q.id,entityTitle:Q.name,matchCount:1,bestBlockId:"",snippet:Y,relevance:"high",retrievalHint:{recommended:"overview",usage:`get_content(entityId="${Q.id}")`}}});return{mode:"library",found:G.length,results:G,hasMore:X.hasMore}}let A=await U.client.search({query:D.query,mode:b,entityType:D.scope?.type,entityId:D.scope?.entityId,orgId:D.orgId,workspaceId:D.workspaceId,spaceId:D.spaceId,limit:w,offset:0,authorName:D.authorName,yearMin:D.yearMin,yearMax:D.yearMax,journalName:D.journalName}),N=A.results??[];if(b==="library"){let X=N.map((G)=>{let{bestMatch:Q}=G,Y=bZ(Q.rank,G.matchCount),B={entityType:G.entityType,entityId:G.entityId,entityTitle:G.entityTitle,matchCount:G.matchCount,bestBlockId:Q.blockId,snippet:Q.snippet,relevance:Y,tags:G.tags,retrievalHint:Q.blockId?{recommended:"blockIds",usage:`blockIds=['${Q.blockId}']`}:{recommended:"overview",usage:"overview=true"}};if(G.literatureMetadata)B.literatureMetadata=G.literatureMetadata;if(G.creatorId)B.creatorId=G.creatorId;if(G.creatorName)B.creatorName=G.creatorName;if(G.updatedAt instanceof Date)B.updatedAt=G.updatedAt.toISOString().slice(0,10);else if(typeof G.updatedAt==="string")B.updatedAt=G.updatedAt.slice(0,10);return B});return{mode:"library",found:X.length,results:X,hasMore:A.hasMore}}let O=N.map((X)=>{let G={entityType:X.entityType,entityId:X.entityId,entityTitle:X.entityTitle,blockId:"blockId"in X?X.blockId:"",snippet:"snippet"in X?X.snippet:"",relevance:"medium",retrievalHint:{recommended:"blockIds",usage:`blockIds=['${"blockId"in X?X.blockId:""}']`}},Q=X.creatorId,Y=X.creatorName;if(Q)G.creatorId=Q;if(Y)G.creatorName=Y;return G});return{mode:"blocks",found:O.length,results:O,hasMore:A.hasMore}}},formatOutput:(U)=>JQ(U),getLogMessage:(U)=>U.query?`"${U.query}"`:"metadata filters"})}import{readFile as DZ}from"node:fs/promises";import{homedir as wZ}from"node:os";import{extname as AZ,isAbsolute as NZ,join as OZ,resolve as XZ}from"node:path";var WZ=4500000,GZ=YY.extend({filePath:W.string().optional().describe("Path to an image file on THIS machine (standalone MCP only). The server reads + base64-encodes it locally and uploads it, so you never emit image bytes yourself — prefer this over `dataBase64` for local files. Accepts absolute, ~-relative, or working-directory-relative paths. `mimeType` is inferred from the extension unless you pass it.")});function QZ($){if($.filePath)return" +file";if($.dataBase64)return" +upload";return""}var YZ="\n\n**Local file shortcut (this MCP server only):** to attach an image already on disk, pass `filePath` (e.g. `./figures/result.png`) instead of `dataBase64`. The server reads and encodes the file for you — far faster and cheaper than emitting base64 yourself.";function BZ($){let I=$==="~"||$.startsWith("~/")?OZ(wZ(),$.slice(1)):$;return NZ(I)?I:XZ(process.cwd(),I)}function vZ($){switch(AZ($).toLowerCase()){case".png":return"image/png";case".jpg":case".jpeg":return"image/jpeg";case".webp":return"image/webp";case".gif":return"image/gif";default:return}}async function JZ($,I){let{filePath:U,...D}=$,b=BZ(I),w;try{w=await DZ(b)}catch{throw new Error(`Could not read filePath "${I}" (resolved: ${b}). Check the path exists and is readable.`)}if(w.byteLength===0)throw new Error(`File "${I}" is empty.`);if(w.byteLength>WZ)throw new Error(`Image is ${(w.byteLength/1e6).toFixed(1)} MB — over the ~5 MB limit. Use a smaller image.`);let A=D.mimeType??vZ(b);if(!A)throw new Error(`Could not infer image type from "${I}". Use a .png/.jpg/.jpeg/.webp/.gif file or pass an explicit mimeType.`);return{...D,dataBase64:w.toString("base64"),mimeType:A}}function e3($,I){_($,I,{definition:{...v1,description:v1.description+YZ},schema:GZ,createExecutor:(U)=>async(D)=>{if(D.filePath)return U.client.setImage(await JZ(D,D.filePath));return U.client.setImage(D)},formatOutput:zQ,getLogMessage:(U)=>`${U.entityType}/${U.entityId.slice(0,8)} ${U.blockId?`edit:${U.blockId.slice(0,8)}`:"attach"}${QZ(U)}`})}function s3($,I){SN($,I,{definition:ib,schema:BY,createExecutor:(U)=>{return async(D)=>{return U.client.situate(D)}},formatSuccess:HQ,formatNotFound:(U)=>JSON.stringify({found:!1,error:U.error??"Entity not found"}),getLogMessage:(U)=>U.spaceId?`space:${U.spaceId.slice(0,8)}... (depth ${U.depth??1})`:`${U.entityId?.slice(0,8)??"?"}... (depth ${U.depth??2})`})}function $V($,I){_($,I,{definition:nb,schema:vY,createExecutor:(U)=>{return async(D)=>{return await U.client.strReplaceBlock(D)}},formatOutput:qQ,getLogMessage:(U)=>`${U.entityType}/${U.entityId.slice(0,8)} block ${U.blockId.slice(0,8)}`})}function IV($,I){_($,I,{definition:cb,schema:JY,createExecutor:(U)=>{return async(D)=>{return await U.client.unlinkArtifactFromNode(D)}},formatOutput:oQ,getLogMessage:(U)=>`Unlinking artifact link ${U.linkId.slice(0,8)}`})}function UV($,I){_($,I,{definition:Vb,schema:wQ,createExecutor:(U)=>{return async(D)=>{return await U.client.updateArtifact(D)}},formatOutput:CQ,getLogMessage:(U)=>`Updating artifact ${U.id.slice(0,8)}`})}function bV($,I){_($,I,{definition:ob,schema:EN,createExecutor:(U)=>{return async(D)=>{return await U.client.updateArtifactLinkRelation(D)}},formatOutput:mQ,getLogMessage:(U)=>`Typing artifact link ${U.artifactLinkId.slice(0,8)} as "${U.relationType}"`})}function DV($,I){_($,I,{definition:db,schema:jN,createExecutor:(U)=>{return async(D)=>{return await U.client.updateEdge(D)}},formatOutput:rQ,getLogMessage:(U)=>U.edgeId?`Re-typing edge ${U.edgeId.slice(0,8)} as "${U.relationType}" (${U.direction})`:`Promoting @mention → "${U.relationType}" edge (${U.direction})`})}function wV($,I){_($,I,{definition:pb,schema:LY,createExecutor:(U)=>{return async(D)=>{return await U.client.updateMatrixRows(D)}},formatOutput:xQ,getLogMessage:(U)=>`Updating ${U.updates.length} row target(s) in matrix ${U.matrixId.slice(0,8)}`})}function AV($,I){_($,I,{definition:tb,schema:zY,createExecutor:(U)=>{return async(D)=>{return await U.client.updateProcedureNode(D)}},formatOutput:PQ,getLogMessage:(U)=>`Updating procedure node ${U.nodeId.slice(0,8)}`})}function NV($,I){I.log.info("Registering tools..."),a3($,I),x3($,I),d3($,I),s3($,I),$V($,I),h3($,I),e3($,I),u3($,I),_3($,I),Z3($,I),R3($,I),T3($,I),C3($,I),l3($,I),o3($,I),S3($,I),i3($,I),AV($,I),t3($,I),y3($,I),E3($,I),wV($,I),g3($,I),p3($,I),f3($,I),j3($,I),r3($,I),P3($,I),UV($,I),n3($,I),c3($,I),IV($,I),m3($,I),bV($,I),DV($,I),I.log.info("All tools registered")}function HZ(){let $=process.argv.slice(2),I={};for(let U=0;U<$.length;U++){let D=$[U],b=$[U+1];if((D==="--api-key"||D==="-k")&&b)I.apiKey=b,U++;else if((D==="--api-url"||D==="-u")&&b)I.apiUrl=b,U++;else if(D==="--help"||D==="-h")process.exit(0)}return I}o6.info("Starting SURA MCP Server...");var OV=HZ(),XV=OV.apiKey??process.env.SURA_API_KEY,LZ=OV.apiUrl??process.env.SURA_API_URL??"https://api.sura.science";if(!XV)o6.error("Missing API key. Set SURA_API_KEY environment variable or use --api-key flag."),o6.error("Get your API key at https://app.sura.science/settings/api-keys"),process.exit(1);var zZ=await W3({apiUrl:LZ,apiKey:XV}),WV=new j8({name:"sura",version:"0.1.0"});NV(WV,zZ);var GV=new P8,QV=async($)=>{o6.info(`Received ${$}, shutting down...`),await GV.close(),process.exit(0)};process.on("SIGTERM",()=>QV("SIGTERM"));process.on("SIGINT",()=>QV("SIGINT"));process.on("uncaughtException",($)=>{o6.error("Uncaught exception:",$)});process.on("unhandledRejection",($)=>{o6.error("Unhandled rejection:",$)});o6.info("Connecting stdio transport...");await WV.connect(GV);o6.info("SURA MCP Server ready");
|
|
208
|
+
- Medium/Low relevance: Start with \`overview=true\` to explore structure first`};var kf=W.object({name:W.string().optional().describe("Compound name, trade name, or systematic name."),cas:W.string().optional().describe('CAS Registry Number (e.g. "64-17-5" for ethanol).'),cid:W.number().int().positive().optional().describe("PubChem CID."),inchi_key:W.string().optional().describe('InChIKey (27-char hash, e.g. "LFQSCWFLJHTTHZ-UHFFFAOYSA-N").'),limit:W.number().int().min(1).max(10).optional().describe("Max results when searching by name (default 5). Ignored for exact-identifier lookups (cid / inchi_key / cas).")}).refine(($)=>Boolean($.name||$.cas||$.cid||$.inchi_key),"Provide at least one of: name, cas, cid, inchi_key."),PY={name:"search_compound",description:["Look up chemical compounds via PubChem. Accepts any identifier (name / CAS / CID / InChIKey).","Returns up to `limit` matches (default 5, max 10) with molecular formula, MW, SMILES, InChIKey, CAS numbers, and synonyms — enough to verify which compound the user means before acting.",`Use this when the user asks reference questions like "what's the molecular weight of aspirin", "find the CAS number for caffeine", or wants to disambiguate between isomers / common names.`,'Do NOT use this to search the workspace\'s own chemical artifacts — use the `search` tool with `entityType="artifact"` for that. PubChem is the world index; `search` is the local inventory.'].join(" ")};var f0=W.enum(["image/png","image/jpeg","image/webp","image/gif"]),RY=W.object({entityType:W.enum(["document","record"]).describe("Entity to edit. Images can only be written to documents and records."),entityId:W.string().describe("Document or record ID (UUID or short ref)."),blockId:W.string().optional().describe("Image block to mutate in place. Omit to INSERT a new image block (use afterBlockId / beforeBlockId to position it)."),dataBase64:W.string().optional().describe("Raw base64 of a new image file (no `data:` prefix). The tool uploads it to workspace storage and attaches the resulting URL. Pair with `mimeType`."),mimeType:f0.optional().describe("Media type of `dataBase64`. Required when `dataBase64` is set."),url:W.string().optional().describe("Alternative to `dataBase64`: an already-hosted workspace media URL to attach."),caption:W.string().optional().describe("Figure caption. ALWAYS set a meaningful caption — it is the only text channel by which the image reaches search and other agents."),name:W.string().optional().describe("Image file/display name."),previewWidth:W.number().int().positive().optional().describe("Inline preview width in px (default 512 on insert)."),showPreview:W.boolean().optional().describe("Whether the image renders inline (default true on insert)."),afterBlockId:W.string().optional().describe("Insert the new image block after this block (insert mode)."),beforeBlockId:W.string().optional().describe("Insert the new image block before this block (insert mode).")}),BU={name:"set_image",description:"Attach, replace, or caption an image on a document/record. Image blocks surface in `get_content` as the **Figures** manifest (caption + blockId).\n\n**Modes:**\n- **Attach a new image:** omit `blockId`; pass `dataBase64` (+ `mimeType`) for new bytes, or a workspace `url`. Position with `afterBlockId` / `beforeBlockId` (defaults to end). Always include a `caption`.\n- **Replace an image's bytes:** pass the `blockId` plus new `dataBase64` (+ `mimeType`) or `url`.\n- **Edit only the caption / name:** pass the `blockId` plus `caption` (and/or `name`) — no bytes needed.\n\nOnly documents and records are editable (literature is read-only). Records must be in `draft` status. Supported image types: PNG, JPEG, WebP, GIF."};var TY=W.object({entityType:W.enum(["document","record"]).describe("Entity to edit. Figures can only be written to documents and records."),entityId:W.string().describe("Document or record ID (UUID or short ref)."),blockId:W.string().optional().describe("Figure block to mutate in place. Omit to INSERT a new figure block (use afterBlockId / beforeBlockId to position it)."),dataBase64:W.string().optional().describe("Raw base64 of a new image file (no `data:` prefix). The tool uploads it to workspace storage and attaches the resulting URL as the figure image. Pair with `mimeType`."),mimeType:f0.optional().describe("Media type of `dataBase64`. Required when `dataBase64` is set."),url:W.string().optional().describe("Alternative to `dataBase64`: an already-hosted workspace media URL to attach as the figure image. Figures may also be image-less (captions-only) — omit all image sources."),name:W.string().optional().describe("Image file / display name (alt text)."),previewWidth:W.number().int().optional().describe("Inline preview width in px (default 512 on insert)."),showPreview:W.boolean().optional().describe("Whether the figure image renders inline (default true on insert)."),imageWidth:W.number().int().optional().describe("Intrinsic image width in px (0 when unknown)."),imageHeight:W.number().int().optional().describe("Intrinsic image height in px (0 when unknown)."),embeddedImageId:W.string().optional().describe("Opaque id of an embedded image extracted from a source PDF."),caption:W.string().optional().describe("Human caption. ALWAYS set a meaningful caption — it is a primary text channel by which the figure reaches search and other agents."),figureLabel:W.string().optional().describe("Figure label, e.g. 'Figure 2', 'Scheme 1'."),figureType:W.string().optional().describe("Figure type, e.g. 'scheme', 'TEM image', 'graph'."),page:W.number().int().optional().describe("Source PDF page number (0 when unknown)."),briefDescription:W.string().optional().describe("One-line summary of the figure."),detailedDescription:W.string().optional().describe("Long-form analysis of the figure."),dataElements:W.array(W.string()).optional().describe("Structured data points pulled from the figure."),keyFindings:W.array(W.string()).optional().describe("Key findings drawn from the figure."),analysisConfidence:W.string().optional().describe("Confidence label for the analysis (e.g. 'high')."),isTocGraphic:W.boolean().optional().describe("Whether this is the table-of-contents graphic."),extractionMetadata:W.record(W.string(),W.unknown()).optional().describe("Free-form extraction metadata object."),afterBlockId:W.string().optional().describe("Insert the new figure block after this block (insert mode)."),beforeBlockId:W.string().optional().describe("Insert the new figure block before this block (insert mode).")}),LU={name:"set_figure",description:"Attach, replace, or annotate a **figure** block on a document/record. The `figure` block is a general-purpose figure card: an OPTIONAL image plus a rich analysis payload (caption, label, type, brief/detailed description, key findings, data elements). Figure blocks surface in `get_content` as the **Figures** manifest (caption + blockId) and can be viewed with `read_image`.\n\n**Modes:**\n- **Attach a new figure:** omit `blockId`. Provide an image via `dataBase64` (+ `mimeType`) or a workspace `url` — or omit both for a captions-only figure card. Position with `afterBlockId` / `beforeBlockId` (defaults to end). Always include a `caption`.\n- **Replace a figure's image:** pass the `blockId` plus new `dataBase64` (+ `mimeType`) or `url`.\n- **Edit analysis / labelling only:** pass the `blockId` plus any of `caption`, `figureLabel`, `figureType`, `briefDescription`, `detailedDescription`, `keyFindings`, `dataElements`, `analysisConfidence`, `isTocGraphic`, `page` — no image bytes needed.\n\nPass friendly native types: `showPreview` / `isTocGraphic` as booleans, `keyFindings` / `dataElements` as string arrays, `extractionMetadata` as an object. Only documents and records are editable (literature is read-only). Records must be in `draft` status. Supported image types: PNG, JPEG, WebP, GIF."};var qf=["paragraph","heading","bulletListItem","numberedListItem","codeBlock","quote","table","image","referenceList","referenceItem"],Ef=W.object({id:W.string().optional(),type:W.enum(qf).describe("BlockNote block type (literature subset).")}).passthrough(),_Y=W.object({id:W.string().uuid().describe("UUID of the literature item."),contentBlocks:W.array(Ef).describe("FULL replacement of the literature body (BlockNote blocks). This REPLACES the entire content_blocks array — read the current body first (get_content) so a small edit does not wipe the rest. Pass an empty array to clear the body."),tableOfContents:W.array(W.record(W.string(),W.unknown())).nullable().optional().describe("Optional table of contents; pass null to clear it.")}),rb={name:"set_literature_content",description:["Replace the body / notes of a literature item (its extracted or hand-written content blocks).","WHOLE-BODY REPLACE: the supplied contentBlocks overwrite the entire body, so read the current content first (get_content) and resend the full body with your edit applied — do not send only the changed block.","Blocks are the literature BlockNote subset (paragraph, heading, list items, codeBlock, quote, table, image, referenceList/referenceItem). For bibliographic metadata or the abstract, use update_literature instead."].join(" ")};var CY=W.object({entityId:W.string().optional().describe('ENTITY MODE: entity ID (UUID or short ref like "rec-a3f7e2b9") to situate — the root of a bounded k-hop neighborhood. Provide this OR spaceId, not both.'),spaceId:W.string().uuid().optional().describe("SPACE MODE: space UUID (from get_workspace_context) — map the WHOLE space's connectivity graph (every entity in the space + their direct relationships). Provide this OR entityId, not both."),depth:W.union([W.literal(1),W.literal(2),W.literal(3)]).optional().describe("Traversal depth. Entity mode: 1–3 (default 2). Space mode: 1–2 (clamped; default 1). Bounded BFS over the unified edge model; matrix/node endpoints are terminal leaves.")}).refine(($)=>Boolean($.entityId)!==Boolean($.spaceId),{message:"Provide exactly one of entityId or spaceId."}),cb={name:"situate",description:["Map relationships as a bounded graph in ONE call — instead of 4–6 manual get_content follow-ups. Two modes (give exactly one):","ENTITY MODE (entityId): the bounded k-hop neighborhood around ONE entity — its root, hop-annotated nodes, and canonical hop-annotated edges grouped by depth.",`SPACE MODE (spaceId, from get_workspace_context): the WHOLE space's connectivity — every entity in the space plus their direct relationships (a multi-seed depth-1 graph), with in-space entities and connected "border" entities distinguished.`,"Edges span the unified model (the same get_content surfaces): mentions, citations, annotation edges, matrix/artifact embeds, transactional artifact links (record/procedure-node → artifact, role input|output|derived_from|referenced), matrix provenance, and promoted typed relation predicates. `matrix`/`node` endpoints are terminal leaves. Per-hop ranking keeps typed/promoted + high-reuse + structural edges; `truncated:true` means a busy hop dropped low-signal edges (re-`situate` a specific node instead).","Use entity mode to map how one record/document/literature/artifact connects before deep-reading; use space mode to survey a whole space's structure. `situate` is structure-traversal; `search` is relevance-ranking — they are distinct. Follow interesting nodes with get_content."].join(" ")};var fY=W.object({entityType:d6.describe('Entity type: "document" or "record"'),entityId:W.string().uuid().describe("Document or record ID"),blockId:W.string().describe("Block ID to edit"),oldText:W.string().describe("Exact text to find and replace (must match exactly)"),newText:W.string().describe("Text to replace with")}),mb={name:"str_replace_block",description:"Replace text content in a specific block. Works like Claude Code str_replace - find exact text and replace it. oldText must match exactly (case-sensitive). Use get_content first to see exact block content. Content supports SURA markdown inline syntax: **bold**, *italic*, ~~strike~~, `code`, {u}underline{/u}, {color:red}text color{/color}, {bg:yellow}background{/bg}. Colors: default, gray, brown, red, orange, yellow, green, blue, purple, pink. "+"Records: only `draft` records are writable. On `completed`/`locked` records the call returns a structured `record_not_draft` error — stop and ask the user to re-open the record; do not try to flip the status yourself."};var ZY=W.object({linkId:W.string().uuid().describe("UUID of the `artifact_links` row to delete. Returned by `link_artifact_to_node` and `list_node_artifact_links`.")}),ob={name:"unlink_artifact_from_node",description:["Remove an artifact ↔ procedure-node link by `linkId`. The artifact and the node both stay; only the join row is dropped.","Use `list_node_artifact_links({ nodeId })` first if you only know the node + artifact identifiers — the link id is the join-row uuid, not the artifact id.","Idempotent at the user level: deleting a non-existent link returns `success: true` with `id` echoed (delete-by-id is a no-op on missing rows in the underlying repo)."].join(" ")};var db={tests:{gloss:"experiment/run → hypothesis/claim/method/prediction: the subject is an empirical test of the object.",reading:"[subject] tests [object]",example:"This run tests the biphasic-DMSN nucleation hypothesis.",symmetric:!1},supports:{gloss:"evidence/result → claim: the subject is evidence in favour of the object (positive pole).",reading:"[subject] supports [object]",example:"The DLS size distribution supports the monodispersity claim.",symmetric:!1},refutes:{gloss:"evidence/result → claim: the subject is evidence against the object (negative pole).",reading:"[subject] refutes [object]",example:"The blank control refutes the catalyst-free pathway claim.",symmetric:!1},replicates:{gloss:"run → prior run: the subject independently reproduces the object under matching conditions.",reading:"[subject] replicates [object]",example:"This batch replicates the 2026-03 reference synthesis.",symmetric:!1},supersedes:{gloss:"newer → older: the subject wholesale replaces the object (the object no longer stands).",reading:"[subject] supersedes [object]",example:"The v2 protocol supersedes the original procedure.",symmetric:!1},corrects:{gloss:"erratum/fix → flawed entity: the subject fixes a specific error in the object (object otherwise stands).",reading:"[subject] corrects [object]",example:"This erratum corrects the yield reported in the prior record.",symmetric:!1},uses:{gloss:"run/analysis → protocol/method/instrument/dataset: the subject employs the object as an input or tool.",reading:"[subject] uses [object]",example:"This characterization uses the standard DLS SOP.",symmetric:!1},characterizes:{gloss:"analysis/measurement → sample/material: the subject measures or describes properties of the object.",reading:"[subject] characterizes [object]",example:"This TEM analysis characterizes the silica nanoparticle sample.",symmetric:!1}},gY=Object.keys(db),pb=W.enum(gY);function t4(){return gY.map(($)=>`- \`${$}\` — ${db[$].gloss} Reading: "${db[$].reading}". e.g. ${db[$].example}`).join(`
|
|
209
|
+
`)}var Z0=W.object({artifactLinkId:W.string().uuid().describe("The `artifact_links` row's `id` (the join-row uuid). Returned by `link_artifact_to_node` and `list_node_artifact_links`. This is the JOIN-ROW id, NOT the artifact id or node id."),relationType:pb.describe(`The relation predicate. One of the eight ratified predicates — DISJOINT from the structural roles (input/output/derived_from/referenced). NEVER pass a structural role here:
|
|
210
|
+
${t4()}`),note:W.string().min(1).describe("REQUIRED rationale (§5.9c): a concise free-text justification for asserting this typed relation. Domain specificity lives here; the predicate stays universal. Stored in `relation_note`; the structural `role` is left untouched.")}),Sf=Z0.extend({note:W.string().optional()}),tb={name:"update_artifact_link_relation",description:["Set the TYPED, queryable SEMANTIC relation on an existing artifact ↔ source link (an `artifact_links` row) — the epistemic/methodological layer the structural roles (input/output/derived_from/referenced) cannot express.","Use this to record what a node/record actually *does* relative to a linked artifact: tests a hypothesis, supports/refutes a claim, replicates a prior run, supersedes/corrects an entity, uses a protocol, or characterizes a sample.","This is SEPARATE from `link_artifact_to_node` (which creates the row + sets the structural `role`). It keys on the join-row `artifactLinkId` and writes ONLY `relation_type`/`relation_note`; the structural `role` is never changed.","The eight predicates are deliberately tight and universal — pick the one whose argument structure matches; put domain specificity in the REQUIRED `note`, never by inventing a predicate (unknown predicates are rejected).","Predicates (disjoint from structural roles — NEVER pass a structural role here):",t4(),"Re-calling with the same `artifactLinkId` re-types the relation in place."].join(`
|
|
211
|
+
`)};var yY=W.object({id:W.string().uuid().describe("UUID of the document to update."),title:W.string().min(1).optional().describe("New title (skip to keep existing)."),tags:W.array(W.string()).optional().describe("Replaces the tag set. Pass an empty array to clear all tags. Omit to leave tags untouched.")}).refine(($)=>$.title!==void 0||$.tags!==void 0,{message:"Provide at least one field to update (title, tags)."}),ab={name:"update_document",description:["Rename a document and/or replace its tag set after creation.","Title and tags only — change placement (which space the document lives in) with `place_entity`, and edit the document body with the block tools (`str_replace_block`, `insert_block`, `delete_block`).","Identity fields (id, organization, workspace, creator, timestamps) are never writable through this tool."].join(" ")};var g0=W.object({edgeId:W.string().uuid().optional().describe("OPTIONAL. Present → RE-TYPE mode: the mention already carries this `edgeId` prop (an already-promoted edge); the tool re-edits the typed metadata in place (DB-only, no document write). Absent → PROMOTION mode: the mention is currently untyped; the tool locates the mention inline in the source entity, mints a fresh `edgeId` into it (the durable anchor), then writes the typed edge. Promotion needs WebSocket config; re-type does not."),sourceEntityId:W.string().uuid().describe("UUID of the document/record the mention lives in (the edge subject)."),sourceEntityType:W.enum(["document","record"]).describe("Type of the source entity (document or record)."),targetEntityId:W.string().uuid().describe("UUID of the mentioned entity (the edge object)."),targetEntityType:W.enum(["literature","document","record","artifact","matrix"]).describe("Type of the mentioned (target) entity."),blockId:W.string().optional().describe("PROMOTION mode only. Optional block scope: when set, only that block is searched for the target mention; when omitted, the whole source entity body is searched. Pass this to disambiguate when the same entity is mentioned in multiple blocks (the tool returns an `ambiguous_mention` error telling you to.) Ignored in re-type mode."),occurrence:W.number().int().min(0).optional().describe("PROMOTION mode only. 0-based index among matching mentions within the search scope (default 0 = first match). Pass this to disambiguate when a single block contains multiple mentions of the same target entity (the tool returns an `ambiguous_mention` error telling you to). Ignored in re-type mode."),relationType:pb.describe(`The relation predicate. One of the eight ratified, disjoint-from-structural predicates:
|
|
212
|
+
${t4()}`),note:W.string().min(1).describe("REQUIRED rationale (§5.9c): a concise free-text justification for asserting this typed edge. Domain specificity lives here; the predicate stays universal."),direction:W.enum(["forward","inverse"]).describe("Reading orientation (§6.2). `forward` = subject → object (the source entity tests/uses/etc. the mentioned entity — the usual case). `inverse` = object → subject (e.g. the mentioned reviewer note *refutes* this document). Storage always keeps source = subject; this only flips the reading.")}),jf=g0.extend({edgeId:W.string().uuid(),note:W.string().optional()}),eb={name:"update_edge",description:["Promote a plain @mention into a TYPED, queryable, convergence-preserved relationship edge — the epistemic/methodological layer the structural links (input/output/derived_from/referenced) cannot express.","Use this to record what a run/analysis/result actually *does* relative to another entity: tests a hypothesis, supports/refutes a claim, replicates a prior run, supersedes/corrects an entity, uses a protocol, or characterizes a sample.","The eight predicates are deliberately tight and universal — pick the one whose argument structure matches; put domain specificity in the REQUIRED `note`, never by inventing a predicate (unknown predicates are rejected).","Predicates (disjoint from structural roles — NEVER pass a structural role here):",t4(),"Two modes: (a) PROMOTION — omit `edgeId`; the tool finds the @mention of `targetEntity` inside `sourceEntity`, writes a durable edge anchor into the document, then types the edge. Disambiguate with `blockId` and/or `occurrence` if the tool reports `ambiguous_mention`. (b) RE-TYPE — pass the existing `edgeId` (an already-promoted mention) to re-edit the typed metadata in place. Either way, the metadata survives every document convergence."].join(`
|
|
213
|
+
`)};var Pf=W.object({name:W.string().min(1).describe("Full / display name."),affiliation:W.string().optional(),orcid:W.string().optional().describe("ORCID id without URL prefix."),email:W.string().optional(),isCorresponding:W.boolean().optional()}),xY=W.object({id:W.string().uuid().describe("UUID of the literature item to update."),title:W.string().min(1).optional(),authors:W.array(Pf).optional().describe("Replaces the entire author list."),journal:W.string().optional(),volume:W.string().optional(),issue:W.string().optional(),pages:W.string().optional(),year:W.number().int().optional(),publicationDate:W.string().optional().describe("Publication date as an ISO date string."),doi:W.string().optional(),pmid:W.string().optional(),sourceUrl:W.string().optional(),abstract:W.string().optional().describe("Abstract text. Stored as literature CONTENT (not item metadata); writing it preserves the rest of the body."),tags:W.array(W.string()).optional().describe("Replaces the tag set. Pass an empty array to clear all tags. Omit to leave tags untouched.")}).refine(($)=>[$.title,$.authors,$.journal,$.volume,$.issue,$.pages,$.year,$.publicationDate,$.doi,$.pmid,$.sourceUrl,$.abstract,$.tags].some((I)=>I!==void 0),{message:"Provide at least one field to update (title, authors, journal, volume, issue, pages, year, publicationDate, doi, pmid, sourceUrl, abstract, tags)."}),sb={name:"update_literature",description:["Edit a literature item's bibliographic metadata (title, authors, journal, volume, issue, pages, year, publicationDate, doi, pmid, sourceUrl), its abstract, and/or its tags.",'Agent edits are stamped `metadataSource="agent"` so a later PDF re-extraction gap-fills around them instead of overwriting.',"The abstract is literature content; the full body/notes are replaced via `set_literature_content`. Change placement with `place_entity`."].join(" ")};var lY=W.object({id:W.string().uuid().describe("UUID of the data matrix."),version:W.number().int().describe("Current matrix version (optimistic lock). Get it from list_procedure_nodes / get_content; a stale version returns matrix_version_conflict."),label:W.string().min(1).optional().describe("New matrix label."),columns:W.array(P0).optional().describe("Full replacement of the column list. v1 edits METADATA of EXISTING columns only (label, type, unit, mandation, description, options, hidden). Every existing column key MUST be present and unchanged — adding, removing, or renaming a key is not yet supported (it would strand row data and needs migration). Not allowed on stoichiometry matrices.")}).refine(($)=>$.label!==void 0||$.columns!==void 0,{message:"Provide label and/or columns to update."}),$D={name:"update_matrix",description:["Edit a data matrix's label and/or its column METADATA (the structure, not the row data).","Version-guarded (optimistic lock): pass the current `version`; a stale value returns a structured matrix_version_conflict. Row data is edited with the matrix-row tools; the matrix `kind` is immutable.","v1 changes only the metadata of existing columns (label/type/unit/mandation/description/options/hidden) — every existing column key must stay; adding/removing/renaming a key is deferred. Stoichiometry matrices are calc-engine-managed, so their columns are locked (label rename still works)."].join(" ")};var Rf=W.record(W.string(),W.union([W.string(),W.number(),W.boolean(),W.null()])).describe("Row match: every provided key/value must equal the row's current value. Matches all rows where the criteria hold (not just the first)."),Tf=W.object({rowIndex:W.number().int().min(0).optional().describe("Target a single row by 0-based index in the current rows array."),rowMatch:Rf.optional(),values:WU.describe("Partial row patch. **Keys MUST match `col.key` (the column id), NOT `col.label`.** Keys present here overwrite the matching rows' cells. Keys not in `values` retain their existing values. Set a key to null to clear a cell.")}).refine(($)=>{let I=$.rowIndex!==void 0,U=$.rowMatch!==void 0;return I!==U},{message:"Provide exactly one of `rowIndex` (absolute) or `rowMatch` (by column values).",path:["rowIndex"]}),hY=W.object({matrixId:W.string().uuid().describe("UUID of the target data_matrix."),updates:W.array(Tf).min(1).describe("List of row patches. Each entry targets rows by `rowIndex` OR `rowMatch` and supplies a partial `values` patch."),version:W.number().int().min(0).describe("Current matrix version (optimistic locking). Must equal the server's stored version; otherwise returns a matrix_version_conflict error.")}),ID={name:"update_matrix_rows",description:["Patch cells in an existing data matrix. Each update targets rows by `rowIndex` (absolute 0-based) OR `rowMatch` (every provided column/value must equal the row's current cell); partial column updates are allowed.","**All row-keyed objects (`values`, `rowMatch`) MUST use `col.key` as the object key, NOT `col.label`.** Read the schema first via `get_content` on the owning entity — its matrix TOON shows `cols: key(Label,type[,unit])` and a `{key1,key2,...}` row header. Mismatched keys persist as opaque JSONB that the UI cannot render.","Match mode updates every row that satisfies the criteria — use it when the match is unique, or when you intend to update a whole group at once.","Bumps `version` on success; stale `version` returns a structured `matrix_version_conflict` error with the current server version so you can re-fetch and retry.","Set a `values` entry to null to clear a cell. Keys not present in `values` are untouched.","Only draft records are writable; completed/locked records return a `record_not_draft` error.",'**Stoichiometry matrices** (`kind=stoichiometry` in the matrix header): clearing a numeric cell to null re-enables client-side derivation via the chemistry identities (n = m/M, n = V·c, m = V·ρ·purity, n = stockMolarity·V, n = stockWtPercent·ρ_soln·V/M, n_i = equiv_i · n_limiting, equiv_i = n_i / n_limiting). Keys not in `values` stay untouched — use this to preserve the hidden `compoundId` link to a chemical artifact while patching other cells. Do not manually recompute derived quantities; write only measured or locked-in values. For aqueous stock solutions, set `stockMolarity` (mol/L) or `stockWtPercent` (0–100) rather than approximating via `purity` × `density`. The displayed `c` is computed against a per-row reference volume controlled by two hidden keys: `cBasis` (`null` | `"none"` | `"phase"` | `"total"` | `"manual"`; null = engine picks default by role+phase, "phase" = c relative to V_phase, "total" = c relative to V_total, "manual" = c relative to `cBasisManualVolume`, "none" = blank c) and `cBasisManualVolume` (mL, only used when cBasis="manual"). Leave both null unless the user explicitly set them.'].join(" ")};var uY=W.object({nodeId:W.string().uuid().describe("UUID of the existing procedure node to update."),label:W.string().min(1).optional().describe("New label (skip to keep existing)."),type:GU.optional().describe('New type (skip to keep existing). Changing type to "observation" forces copyable=false.'),copyable:W.boolean().optional().describe('Template-copyable flag. When the resulting type is "observation" this must be false (or omitted).'),analyticalData:W.array(QU).optional().describe("Replace the current `analyticalData` list with this one. Pass an empty array to clear it; omit to leave it untouched.")}).refine(($)=>{if($.type!=="observation")return!0;return $.copyable===void 0||$.copyable===!1},{message:'copyable must be false (or omitted) when type is "observation".',path:["copyable"]}).refine(($)=>$.label!==void 0||$.type!==void 0||$.copyable!==void 0||$.analyticalData!==void 0,{message:"Provide at least one field to update (label, type, copyable, analyticalData)."}),UD={name:"update_procedure_node",description:["Update non-structural fields of a procedure-tree node (label, type, copyable, analyticalData).","Structural changes (move / reorder) go through `reorder_procedure_nodes` — this tool never touches parentId or order.",'`type === "observation"` implies `copyable = false`; setting both to a conflicting combination is rejected.',"Passing an empty `analyticalData` array clears the file-ref list; omitting the field leaves it untouched.","Only draft records are writable; completed/locked records return a `record_not_draft` error."].join(" ")};var iY=W.object({id:W.string().uuid().describe("UUID of the record to update."),title:W.string().min(1).optional().describe("New title (skip to keep existing)."),recordType:W.string().optional().describe("Record type / category label (free text)."),recordDate:W.string().optional().describe("Record date as an ISO date string (e.g. 2026-06-30)."),tags:W.array(W.string()).optional().describe("Replaces the tag set. Pass an empty array to clear all tags. Omit to leave tags untouched.")}).refine(($)=>$.title!==void 0||$.recordType!==void 0||$.recordDate!==void 0||$.tags!==void 0,{message:"Provide at least one field to update (title, recordType, recordDate, tags)."}),bD={name:"update_record",description:["Update an ELN record's metadata after creation: title, recordType, recordDate, and/or tags.","Metadata only — the record status/lifecycle (draft → completed → locked) is human-controlled and is never changed here; edit the procedure tree and matrices with their own dedicated tools.","A locked record refuses edits: the tool returns a structured `record_locked` result instead of failing, so you can stop without retrying."].join(" ")};var nY=[nb,Tb,vU,cb,mb,Cb,BU,LU,Lb,qb,Sb,Fb,kb,Eb,zb,Zb,_b,lb,Vb,fb,UD,ib,Rb,Jb,ID,Kb,Pb,ub,Hb,yb,jb,gb,ob,xb,tb,eb,ab,bD,sb,hb,rb,$D,PY,QY,YY,SY,vY],_f=nY.map(($)=>$.name),Cf=Object.fromEntries(nY.map(($)=>[$.name,$]));function rY($){return{content:[{type:"text",text:$}]}}function cY($){return{content:[{type:"text",text:$}],isError:!0}}function j($,I,U){let{definition:D,schema:b,createExecutor:A,formatOutput:w,formatError:O=(Q)=>Q.message,getLogMessage:N=(Q)=>JSON.stringify(Q).slice(0,100)}=U,X=A(I),G=b.shape;$.tool(D.name,D.description,G,async(Q)=>{let Y=Q,v=N(Y);I.log.info(`${D.name}: ${v}`);try{let L=await X(Y),H=w(L,Y);return I.log.info(`${D.name}: completed`),rY(H)}catch(L){let H=L instanceof Error?O(L,Y):"Unknown error";return I.log.error(`${D.name} failed:`,L),cY(`${D.name} error: ${H}`)}})}function y0($,I,U){let{definition:D,schema:b,createExecutor:A,formatSuccess:w,formatNotFound:O=(Y)=>JSON.stringify({found:!1,error:Y.error??"Not found"}),formatError:N=(Y)=>Y.message,getLogMessage:X=(Y)=>JSON.stringify(Y).slice(0,100)}=U,G=A(I),Q=b.shape;$.tool(D.name,D.description,Q,async(Y)=>{let v=Y,L=X(v);I.log.info(`${D.name}: ${L}`);try{let H=await G(v);if(!H.found)return I.log.info(`${D.name}: not found`),{content:[{type:"text",text:O(H,v)}],isError:!0};return I.log.info(`${D.name}: found`),rY(w(H,v))}catch(H){let z=H instanceof Error?N(H,v):"Unknown error";return I.log.error(`${D.name} failed:`,H),cY(`${D.name} error: ${z}`)}})}function o3($,I){j($,I,{definition:Jb,schema:GQ,createExecutor:(U)=>{return async(D)=>{return await U.client.appendMatrixRows(D)}},formatOutput:sQ,getLogMessage:(U)=>`Appending ${U.rows.length} row(s) to matrix ${U.matrixId.slice(0,8)}`})}function d3($,I){j($,I,{definition:Hb,schema:QQ,createExecutor:(U)=>{return async(D)=>{return await U.client.attachMatrix(D)}},formatOutput:DY,getLogMessage:(U)=>{let D=U.nodeRef?` + node ${U.nodeRef.slice(0,8)}`:"";return`Attaching matrix ${U.matrixId.slice(0,8)} → ${U.entityType}:${U.entityId.slice(0,8)}${D}`}})}function p3($,I){j($,I,{definition:Vb,schema:YQ,createExecutor:(U)=>{return async(D)=>{return await U.client.buildProcedureTree(D)}},formatOutput:eQ,getLogMessage:(U)=>`${U.mode==="replace"?"REPLACE":"append"} procedure tree for record ${U.recordId.slice(0,8)}: ${U.nodes.length} node(s)`})}function t3($,I){j($,I,{definition:zb,schema:BQ,createExecutor:(U)=>{return async(D)=>{return await U.client.createArtifact(D)}},formatOutput:hQ,getLogMessage:(U)=>`Creating ${U.artifactType} "${U.name.slice(0,30)}"`})}function a3($,I){j($,I,{definition:Fb,schema:LQ,createExecutor:(U)=>{return async(D)=>{return await U.client.createDocument(D)}},formatOutput:RQ,getLogMessage:(U)=>`Creating document: "${U.title.slice(0,30)}${U.title.length>30?"...":""}"`})}function e3($,I){j($,I,{definition:kb,schema:JQ,createExecutor:(U)=>{return async(D)=>{return U.client.createLiterature(D)}},formatOutput:TQ,getLogMessage:(U)=>`Importing literature: "${U.title.slice(0,30)}${U.title.length>30?"...":""}"${U.doi?` (DOI: ${U.doi})`:""}`})}function s3($,I){j($,I,{definition:qb,schema:HQ,createExecutor:(U)=>{return async(D)=>{return await U.client.createMatrixFromArtifact(D)}},formatOutput:CQ,getLogMessage:(U)=>`Deriving matrix from artifact ${U.artifactId.slice(0,8)}`})}function $V($,I){j($,I,{definition:Eb,schema:MQ,createExecutor:(U)=>{return async(D)=>{return await U.client.createRecord(D)}},formatOutput:yQ,getLogMessage:(U)=>`Creating record: "${U.title.slice(0,30)}${U.title.length>30?"...":""}"${U.initialTree?` + ${U.initialTree.length} node(s)`:""}`})}function IV($,I){j($,I,{definition:Sb,schema:T0,createExecutor:(U)=>{return async(D)=>{return await U.client.deleteBlock(D)}},formatOutput:gQ,getLogMessage:(U)=>{if(U.blockIds&&U.blockIds.length>0)return`${U.entityType}/${U.entityId.slice(0,8)} batch delete ${U.blockIds.length} blocks`;return`${U.entityType}/${U.entityId.slice(0,8)} block ${U.blockId?.slice(0,8)??"unknown"}`}})}function UV($,I){j($,I,{definition:jb,schema:VQ,createExecutor:(U)=>{return async(D)=>{return await U.client.deleteMatrix(D)}},formatOutput:bY,getLogMessage:(U)=>`Deleting matrix ${U.matrixId.slice(0,8)} (+ block)`})}function bV($,I){j($,I,{definition:Pb,schema:KQ,createExecutor:(U)=>{return async(D)=>{return await U.client.deleteMatrixRows(D)}},formatOutput:IY,getLogMessage:(U)=>{return`Deleting rows (${U.rowIndices?`${U.rowIndices.length} index(es)`:"match"}) from matrix ${U.matrixId.slice(0,8)}`}})}function DV($,I){j($,I,{definition:Rb,schema:zQ,createExecutor:(U)=>{return async(D)=>{return await U.client.deleteProcedureNode(D)}},formatOutput:aQ,getLogMessage:(U)=>`Deleting procedure node ${U.nodeId.slice(0,8)} (cascade)`})}function AV($,I){y0($,I,{definition:Tb,schema:BY,createExecutor:(U)=>{return async(D)=>{return U.client.getContent(D)}},formatSuccess:SQ,formatNotFound:(U)=>JSON.stringify({found:!1,error:U.error??"Entity not found"}),getLogMessage:(U)=>{let D=U.blockIds?`blocks:${U.blockIds.length}`:U.segment?`segment:"${U.segment}"`:U.from_section&&U.to_section?`range:"${U.from_section}"-"${U.to_section}"`:U.node?`node:"${U.node}"${U.depth!==void 0?`,depth=${U.depth}`:""}`:U.section?`section:"${U.section}"${U.depth!==void 0?`,depth=${U.depth}`:""}`:U.refs?`refs:${U.refs.length}`:"overview";return`${U.entityId.slice(0,8)}... (${D})`}})}function wV($,I){j($,I,{definition:_b,schema:LY,createExecutor:(U)=>{return async(D)=>{if(U.workspaceContext&&!D.forceRefresh)return U.workspaceContext;let b=await U.client.getWorkspaceContext();return U.workspaceContext=b,b}},formatOutput:kQ,getLogMessage:(U)=>U.forceRefresh?"force refresh":"cached"})}function OV($,I){j($,I,{definition:Cb,schema:C0,createExecutor:(U)=>{return async(D)=>{return await U.client.insertBlock(D)}},formatOutput:ZQ,getLogMessage:(U)=>{let D;if(U.parentBlockId)D=`in:${U.parentBlockId.slice(0,8)}`;else if(U.beforeBlockId)D=`before:${U.beforeBlockId.slice(0,8)}`;else if(U.afterBlockId)D=`after:${U.afterBlockId.slice(0,8)}`;else D="start";if(U.blocks&&U.blocks.length>0)return`${U.entityType}/${U.entityId.slice(0,8)} ${D} (batch: ${U.blocks.length} blocks)`;return`${U.entityType}/${U.entityId.slice(0,8)} ${D} (${U.blockType??"paragraph"})`}})}function NV($,I){j($,I,{definition:Lb,schema:WQ,createExecutor:(U)=>{return async(D)=>{return await U.client.insertMatrix(D)}},formatOutput:(U)=>_Q(U),getLogMessage:(U)=>`"${U.label.slice(0,30)}${U.label.length>30?"...":""}"`})}function XV($,I){j($,I,{definition:fb,schema:JY,createExecutor:(U)=>{return async(D)=>{return await U.client.insertProcedureNode(D)}},formatOutput:xQ,getLogMessage:(U)=>`Inserting procedure node "${U.label.slice(0,30)}" into record ${U.recordId.slice(0,8)}`})}function WV($,I){j($,I,{definition:Zb,schema:HY,createExecutor:(U)=>{return async(D)=>{return await U.client.instantiateArtifactTemplate(D)}},formatOutput:iQ,getLogMessage:(U)=>`Instantiating template ${U.templateId.slice(0,8)} → "${U.name}"`})}function GV($,I){j($,I,{definition:gb,schema:MY,createExecutor:(U)=>{return async(D)=>{return await U.client.linkArtifactToNode(D)}},formatOutput:wY,getLogMessage:(U)=>`Linking artifact ${U.artifactId.slice(0,8)} → node ${U.nodeId.slice(0,8)} (${U.role})`})}function QV($,I){j($,I,{definition:yb,schema:VY,createExecutor:(U)=>{return async(D)=>{return await U.client.listMatrixReferences(D)}},formatOutput:AY,getLogMessage:(U)=>`Listing references for matrix ${U.matrixId.slice(0,8)}`})}function YV($,I){j($,I,{definition:xb,schema:KY,createExecutor:(U)=>{return async(D)=>{return await U.client.listNodeArtifactLinks(D)}},formatOutput:WY,getLogMessage:(U)=>`Listing artifact links for node ${U.nodeId.slice(0,8)}`})}function vV($,I){j($,I,{definition:lb,schema:zY,createExecutor:(U)=>{return async(D)=>{return await U.client.listProcedureNodes(D)}},formatOutput:GY,getLogMessage:(U)=>`Listing procedure nodes for record ${U.recordId.slice(0,8)}`})}function BV($,I){j($,I,{definition:hb,schema:FY,createExecutor:(U)=>{return async(D)=>{return await U.client.placeEntity(D)}},formatOutput:oQ,getLogMessage:(U)=>`${U.action==="add"?"Placing":"Unplacing"} ${U.entityType} ${U.entityId.slice(0,8)}`})}function LV($,I){let U=kY.shape;$.tool(vU.name,vU.description,U,async(D)=>{let b=D;I.log.info(`read_image: ${b.entityId.slice(0,8)}.../${b.blockId.slice(0,8)}...`);try{let A=await I.client.readImage(b);if(!(A.found&&A.dataBase64&&A.mimeType))return{content:[{type:"text",text:JSON.stringify({found:!1,blockId:A.blockId,error:A.error??"Image not available."})}],isError:!0};let w=A.byteSize?`${Math.round(A.byteSize/1024)} KB`:"",O=w?` (${A.mimeType}, ${w})`:"",N=`Figure ${A.blockId}${A.caption?`: ${A.caption}`:""}${O}`;return{content:[{type:"image",data:A.dataBase64,mimeType:A.mimeType},{type:"text",text:N}]}}catch(A){return I.log.error("read_image failed:",A),{content:[{type:"text",text:`read_image error: ${A instanceof Error?A.message:"Unknown error"}`}],isError:!0}}})}function JV($,I){j($,I,{definition:ub,schema:qY,createExecutor:(U)=>{return async(D)=>{return await U.client.rebindMatrixToNode(D)}},formatOutput:UY,getLogMessage:(U)=>{let D=U.nodeRef?U.nodeRef.slice(0,8):"(body)";return`Rebinding matrix ${U.matrixId.slice(0,8)} → ${D}`}})}function HV($,I){j($,I,{definition:ib,schema:EY,createExecutor:(U)=>{return async(D)=>{return await U.client.reorderProcedureNodes(D)}},formatOutput:tQ,getLogMessage:(U)=>`Reordering ${U.moves.length} procedure node(s) in record ${U.recordId.slice(0,8)}`})}function ff($,I){if($>0){if($<0.5)return"high";if($<1.5)return"medium";return"low"}return I>0?"medium":"low"}function MV($,I){j($,I,{definition:nb,schema:jY,createExecutor:(U)=>{return async(D)=>{let b=D.mode??"library",A=D.limit??10;if(D.scope?.type==="artifact"&&b==="library"&&D.workspaceId){let X=await U.client.searchArtifacts({workspaceId:D.workspaceId,query:D.query,artifactType:D.artifactType,artifactStatus:D.artifactStatus,limit:A}),G=X.results.map((Q)=>{let Y=Q.description?Q.description.length>100?`${Q.description.slice(0,97)}...`:Q.description:`${Q.artifactType}, ${Q.status}`;return{entityType:"artifact",entityId:Q.id,entityTitle:Q.name,matchCount:1,bestBlockId:"",snippet:Y,relevance:"high",retrievalHint:{recommended:"overview",usage:`get_content(entityId="${Q.id}")`}}});return{mode:"library",found:G.length,results:G,hasMore:X.hasMore}}let w=await U.client.search({query:D.query,mode:b,entityType:D.scope?.type,entityId:D.scope?.entityId,orgId:D.orgId,workspaceId:D.workspaceId,spaceId:D.spaceId,limit:A,offset:0,authorName:D.authorName,yearMin:D.yearMin,yearMax:D.yearMax,journalName:D.journalName}),O=w.results??[];if(b==="library"){let X=O.map((G)=>{let{bestMatch:Q}=G,Y=ff(Q.rank,G.matchCount),v={entityType:G.entityType,entityId:G.entityId,entityTitle:G.entityTitle,matchCount:G.matchCount,bestBlockId:Q.blockId,snippet:Q.snippet,relevance:Y,tags:G.tags,retrievalHint:Q.blockId?{recommended:"blockIds",usage:`blockIds=['${Q.blockId}']`}:{recommended:"overview",usage:"overview=true"}};if(G.literatureMetadata)v.literatureMetadata=G.literatureMetadata;if(G.creatorId)v.creatorId=G.creatorId;if(G.creatorName)v.creatorName=G.creatorName;if(G.updatedAt instanceof Date)v.updatedAt=G.updatedAt.toISOString().slice(0,10);else if(typeof G.updatedAt==="string")v.updatedAt=G.updatedAt.slice(0,10);return v});return{mode:"library",found:X.length,results:X,hasMore:w.hasMore}}let N=O.map((X)=>{let G={entityType:X.entityType,entityId:X.entityId,entityTitle:X.entityTitle,blockId:"blockId"in X?X.blockId:"",snippet:"snippet"in X?X.snippet:"",relevance:"medium",retrievalHint:{recommended:"blockIds",usage:`blockIds=['${"blockId"in X?X.blockId:""}']`}},Q=X.creatorId,Y=X.creatorName;if(Q)G.creatorId=Q;if(Y)G.creatorName=Y;return G});return{mode:"blocks",found:N.length,results:N,hasMore:w.hasMore}}},formatOutput:(U)=>qQ(U),getLogMessage:(U)=>U.query?`"${U.query}"`:"metadata filters"})}import{readFile as Zf}from"node:fs/promises";import{homedir as gf}from"node:os";import{extname as yf,isAbsolute as xf,join as lf,resolve as hf}from"node:path";var uf=4500000,nf=TY.extend({filePath:W.string().optional().describe("Path to an image file on THIS machine (standalone MCP only). The server reads + base64-encodes it locally and uploads it as the figure image, so you never emit image bytes yourself — prefer this over `dataBase64` for local files. Accepts absolute, ~-relative, or working-directory-relative paths. `mimeType` is inferred from the extension unless you pass it.")});function rf($){if($.filePath)return" +file";if($.dataBase64)return" +upload";return""}var cf="\n\n**Local file shortcut (this MCP server only):** to attach a figure image already on disk, pass `filePath` (e.g. `./figures/result.png`) instead of `dataBase64`. The server reads and encodes the file for you — far faster and cheaper than emitting base64 yourself.";function mf($){let I=$==="~"||$.startsWith("~/")?lf(gf(),$.slice(1)):$;return xf(I)?I:hf(process.cwd(),I)}function of($){switch(yf($).toLowerCase()){case".png":return"image/png";case".jpg":case".jpeg":return"image/jpeg";case".webp":return"image/webp";case".gif":return"image/gif";default:return}}async function df($,I){let{filePath:U,...D}=$,b=mf(I),A;try{A=await Zf(b)}catch{throw new Error(`Could not read filePath "${I}" (resolved: ${b}). Check the path exists and is readable.`)}if(A.byteLength===0)throw new Error(`File "${I}" is empty.`);if(A.byteLength>uf)throw new Error(`Image is ${(A.byteLength/1e6).toFixed(1)} MB — over the ~5 MB limit. Use a smaller image.`);let w=D.mimeType??of(b);if(!w)throw new Error(`Could not infer image type from "${I}". Use a .png/.jpg/.jpeg/.webp/.gif file or pass an explicit mimeType.`);return{...D,dataBase64:A.toString("base64"),mimeType:w}}function VV($,I){j($,I,{definition:{...LU,description:LU.description+cf},schema:nf,createExecutor:(U)=>async(D)=>{if(D.filePath)return U.client.setFigure(await df(D,D.filePath));return U.client.setFigure(D)},formatOutput:PQ,getLogMessage:(U)=>`${U.entityType}/${U.entityId.slice(0,8)} ${U.blockId?`edit:${U.blockId.slice(0,8)}`:"attach"}${rf(U)}`})}import{readFile as pf}from"node:fs/promises";import{homedir as tf}from"node:os";import{extname as af,isAbsolute as ef,join as sf,resolve as $Z}from"node:path";var IZ=4500000,UZ=RY.extend({filePath:W.string().optional().describe("Path to an image file on THIS machine (standalone MCP only). The server reads + base64-encodes it locally and uploads it, so you never emit image bytes yourself — prefer this over `dataBase64` for local files. Accepts absolute, ~-relative, or working-directory-relative paths. `mimeType` is inferred from the extension unless you pass it.")});function bZ($){if($.filePath)return" +file";if($.dataBase64)return" +upload";return""}var DZ="\n\n**Local file shortcut (this MCP server only):** to attach an image already on disk, pass `filePath` (e.g. `./figures/result.png`) instead of `dataBase64`. The server reads and encodes the file for you — far faster and cheaper than emitting base64 yourself.";function AZ($){let I=$==="~"||$.startsWith("~/")?sf(tf(),$.slice(1)):$;return ef(I)?I:$Z(process.cwd(),I)}function wZ($){switch(af($).toLowerCase()){case".png":return"image/png";case".jpg":case".jpeg":return"image/jpeg";case".webp":return"image/webp";case".gif":return"image/gif";default:return}}async function OZ($,I){let{filePath:U,...D}=$,b=AZ(I),A;try{A=await pf(b)}catch{throw new Error(`Could not read filePath "${I}" (resolved: ${b}). Check the path exists and is readable.`)}if(A.byteLength===0)throw new Error(`File "${I}" is empty.`);if(A.byteLength>IZ)throw new Error(`Image is ${(A.byteLength/1e6).toFixed(1)} MB — over the ~5 MB limit. Use a smaller image.`);let w=D.mimeType??wZ(b);if(!w)throw new Error(`Could not infer image type from "${I}". Use a .png/.jpg/.jpeg/.webp/.gif file or pass an explicit mimeType.`);return{...D,dataBase64:A.toString("base64"),mimeType:w}}function KV($,I){j($,I,{definition:{...BU,description:BU.description+DZ},schema:UZ,createExecutor:(U)=>async(D)=>{if(D.filePath)return U.client.setImage(await OZ(D,D.filePath));return U.client.setImage(D)},formatOutput:jQ,getLogMessage:(U)=>`${U.entityType}/${U.entityId.slice(0,8)} ${U.blockId?`edit:${U.blockId.slice(0,8)}`:"attach"}${bZ(U)}`})}function zV($,I){j($,I,{definition:rb,schema:_Y,createExecutor:(U)=>{return async(D)=>{return await U.client.setLiteratureContent(D)}},formatOutput:dQ,getLogMessage:(U)=>`Setting content for literature ${U.id.slice(0,8)}`})}function FV($,I){y0($,I,{definition:cb,schema:CY,createExecutor:(U)=>{return async(D)=>{return U.client.situate(D)}},formatSuccess:EQ,formatNotFound:(U)=>JSON.stringify({found:!1,error:U.error??"Entity not found"}),getLogMessage:(U)=>U.spaceId?`space:${U.spaceId.slice(0,8)}... (depth ${U.depth??1})`:`${U.entityId?.slice(0,8)??"?"}... (depth ${U.depth??2})`})}function kV($,I){j($,I,{definition:mb,schema:fY,createExecutor:(U)=>{return async(D)=>{return await U.client.strReplaceBlock(D)}},formatOutput:fQ,getLogMessage:(U)=>`${U.entityType}/${U.entityId.slice(0,8)} block ${U.blockId.slice(0,8)}`})}function qV($,I){j($,I,{definition:ob,schema:ZY,createExecutor:(U)=>{return async(D)=>{return await U.client.unlinkArtifactFromNode(D)}},formatOutput:XY,getLogMessage:(U)=>`Unlinking artifact link ${U.linkId.slice(0,8)}`})}function EV($,I){j($,I,{definition:Kb,schema:vQ,createExecutor:(U)=>{return async(D)=>{return await U.client.updateArtifact(D)}},formatOutput:nQ,getLogMessage:(U)=>`Updating artifact ${U.id.slice(0,8)}`})}function SV($,I){j($,I,{definition:tb,schema:Z0,createExecutor:(U)=>{return async(D)=>{return await U.client.updateArtifactLinkRelation(D)}},formatOutput:NY,getLogMessage:(U)=>`Typing artifact link ${U.artifactLinkId.slice(0,8)} as "${U.relationType}"`})}function jV($,I){j($,I,{definition:ab,schema:yY,createExecutor:(U)=>{return async(D)=>{return await U.client.updateDocument(D)}},formatOutput:rQ,getLogMessage:(U)=>`Updating document ${U.id.slice(0,8)}`})}function PV($,I){j($,I,{definition:eb,schema:g0,createExecutor:(U)=>{return async(D)=>{return await U.client.updateEdge(D)}},formatOutput:OY,getLogMessage:(U)=>U.edgeId?`Re-typing edge ${U.edgeId.slice(0,8)} as "${U.relationType}" (${U.direction})`:`Promoting @mention → "${U.relationType}" edge (${U.direction})`})}function RV($,I){j($,I,{definition:sb,schema:xY,createExecutor:(U)=>{return async(D)=>{return await U.client.updateLiterature(D)}},formatOutput:mQ,getLogMessage:(U)=>`Updating literature ${U.id.slice(0,8)}`})}function TV($,I){j($,I,{definition:$D,schema:lY,createExecutor:(U)=>{return async(D)=>{return await U.client.updateMatrix(D)}},formatOutput:pQ,getLogMessage:(U)=>`Updating matrix ${U.id.slice(0,8)}`})}function _V($,I){j($,I,{definition:ID,schema:hY,createExecutor:(U)=>{return async(D)=>{return await U.client.updateMatrixRows(D)}},formatOutput:$Y,getLogMessage:(U)=>`Updating ${U.updates.length} row target(s) in matrix ${U.matrixId.slice(0,8)}`})}function CV($,I){j($,I,{definition:UD,schema:uY,createExecutor:(U)=>{return async(D)=>{return await U.client.updateProcedureNode(D)}},formatOutput:lQ,getLogMessage:(U)=>`Updating procedure node ${U.nodeId.slice(0,8)}`})}function fV($,I){j($,I,{definition:bD,schema:iY,createExecutor:(U)=>{return async(D)=>{return await U.client.updateRecord(D)}},formatOutput:cQ,getLogMessage:(U)=>`Updating record ${U.id.slice(0,8)}`})}function ZV($,I){I.log.info("Registering tools..."),MV($,I),AV($,I),LV($,I),FV($,I),kV($,I),OV($,I),KV($,I),VV($,I),NV($,I),s3($,I),IV($,I),a3($,I),e3($,I),$V($,I),wV($,I),vV($,I),p3($,I),XV($,I),CV($,I),HV($,I),DV($,I),o3($,I),_V($,I),bV($,I),JV($,I),UV($,I),d3($,I),QV($,I),t3($,I),EV($,I),jV($,I),fV($,I),RV($,I),zV($,I),TV($,I),BV($,I),WV($,I),GV($,I),qV($,I),YV($,I),SV($,I),PV($,I),I.log.info("All tools registered")}function NZ(){let $=process.argv.slice(2),I={};for(let U=0;U<$.length;U++){let D=$[U],b=$[U+1];if((D==="--api-key"||D==="-k")&&b)I.apiKey=b,U++;else if((D==="--api-url"||D==="-u")&&b)I.apiUrl=b,U++;else if(D==="--help"||D==="-h")process.exit(0)}return I}o6.info("Starting SURA MCP Server...");var gV=NZ(),yV=gV.apiKey??process.env.SURA_API_KEY,XZ=gV.apiUrl??process.env.SURA_API_URL??"https://api.sura.science";if(!yV)o6.error("Missing API key. Set SURA_API_KEY environment variable or use --api-key flag."),o6.error("Get your API key at https://app.sura.science/settings/api-keys"),process.exit(1);var WZ=await C3({apiUrl:XZ,apiKey:yV}),xV=new g8({name:"sura",version:"0.1.0"});ZV(xV,WZ);var lV=new x8,hV=async($)=>{o6.info(`Received ${$}, shutting down...`),await lV.close(),process.exit(0)};process.on("SIGTERM",()=>hV("SIGTERM"));process.on("SIGINT",()=>hV("SIGINT"));process.on("uncaughtException",($)=>{o6.error("Uncaught exception:",$)});process.on("unhandledRejection",($)=>{o6.error("Unhandled rejection:",$)});o6.info("Connecting stdio transport...");await xV.connect(lV);o6.info("SURA MCP Server ready");
|