@sura_ai/mcp-server 0.3.2 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +69 -95
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,112 +1,86 @@
1
1
  #!/usr/bin/env node
2
- var UE=Object.create;var{getPrototypeOf:AE,defineProperty:sb,getOwnPropertyNames:DE}=Object;var wE=Object.prototype.hasOwnProperty;var g5=($,I,U)=>{U=$!=null?UE(AE($)):{};let D=I||!$||!$.__esModule?sb(U,"default",{value:$,enumerable:!0}):U;for(let A of DE($))if(!wE.call(D,A))sb(D,A,{get:()=>$[A],enumerable:!0});return D};var C=($,I)=>()=>(I||$((I={exports:{}}).exports,I),I.exports);var K6=($,I)=>{for(var U in I)sb($,U,{get:I[U],enumerable:!0,configurable:!0,set:(D)=>I[U]=()=>D})};var YU=C((kL)=>{Object.defineProperty(kL,"__esModule",{value:!0});kL.regexpCode=kL.getEsmExportName=kL.getProperty=kL.safeStringify=kL.stringify=kL.strConcat=kL.addCodeArg=kL.str=kL._=kL.nil=kL._Code=kL.Name=kL.IDENTIFIER=kL._CodeOrName=void 0;class bD{}kL._CodeOrName=bD;kL.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class PI extends bD{constructor($){super();if(!kL.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}}}kL.Name=PI;class E6 extends bD{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 PI)I[U.str]=(I[U.str]||0)+1;return I},{})}}kL._Code=E6;kL.nil=new E6("");function SL($,...I){let U=[$[0]],D=0;while(D<I.length)lX(U,I[D]),U.push($[++D]);return new E6(U)}kL._=SL;var uX=new E6("+");function jL($,...I){let U=[QU($[0])],D=0;while(D<I.length)U.push(uX),lX(U,I[D]),U.push(uX,QU($[++D]));return MP(U),new E6(U)}kL.str=jL;function lX($,I){if(I instanceof E6)$.push(...I._items);else if(I instanceof PI)$.push(I);else $.push(vP(I))}kL.addCodeArg=lX;function MP($){let I=1;while(I<$.length-1){if($[I]===uX){let U=KP($[I-1],$[I+1]);if(U!==void 0){$.splice(I-1,3,U);continue}$[I++]="+"}I++}}function KP($,I){if(I==='""')return $;if($==='""')return I;if(typeof $=="string"){if(I instanceof PI||$[$.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 PI))return`"${$}${I.slice(1)}`;return}function VP($,I){return I.emptyStr()?$:$.emptyStr()?I:jL`${$}${I}`}kL.strConcat=VP;function vP($){return typeof $=="number"||typeof $=="boolean"||$===null?$:QU(Array.isArray($)?$.join(","):$)}function qP($){return new E6(QU($))}kL.stringify=qP;function QU($){return JSON.stringify($).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}kL.safeStringify=QU;function FP($){return typeof $=="string"&&kL.IDENTIFIER.test($)?new E6(`.${$}`):SL`[${$}]`}kL.getProperty=FP;function EP($){if(typeof $=="string"&&kL.IDENTIFIER.test($))return new E6(`${$}`);throw new Error(`CodeGen: invalid export name: ${$}, use explicit $id name mapping`)}kL.getEsmExportName=EP;function SP($){return new E6($.toString())}kL.regexpCode=SP});var iX=C((_L)=>{Object.defineProperty(_L,"__esModule",{value:!0});_L.ValueScope=_L.ValueScopeName=_L.Scope=_L.varKinds=_L.UsedValueState=void 0;var e$=YU();class RL extends Error{constructor($){super(`CodeGen: "code" for ${$} not defined`);this.value=$.value}}var OD;(function($){$[$.Started=0]="Started",$[$.Completed=1]="Completed"})(OD||(_L.UsedValueState=OD={}));_L.varKinds={const:new e$.Name("const"),let:new e$.Name("let"),var:new e$.Name("var")};class mX{constructor({prefixes:$,parent:I}={}){this._names={},this._prefixes=$,this._parent=I}toName($){return $ instanceof e$.Name?$:this.name($)}name($){return new e$.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}}}_L.Scope=mX;class rX extends e$.Name{constructor($,I){super(I);this.prefix=$}setValue($,{property:I,itemIndex:U}){this.value=$,this.scopePath=e$._`.${new e$.Name(I)}[${U}]`}}_L.ValueScopeName=rX;var yP=e$._`\n`;class TL extends mX{constructor($){super($);this._values={},this._scope=$.scope,this.opts={...$,_n:$.lines?yP:e$.nil}}get(){return this._scope}name($){return new rX($,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:A}=D,w=(U=I.key)!==null&&U!==void 0?U:I.ref,b=this._values[A];if(b){let X=b.get(w);if(X)return X}else b=this._values[A]=new Map;b.set(w,D);let N=this._scope[A]||(this._scope[A]=[]),O=N.length;return N[O]=I.ref,D.setValue(I,{property:A,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 e$._`${$}${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 A=e$.nil;for(let w in $){let b=$[w];if(!b)continue;let N=U[w]=U[w]||new Map;b.forEach((O)=>{if(N.has(O))return;N.set(O,OD.Started);let X=I(O);if(X){let W=this.opts.es5?_L.varKinds.var:_L.varKinds.const;A=e$._`${A}${W} ${O} = ${X};${this.opts._n}`}else if(X=D===null||D===void 0?void 0:D(O))A=e$._`${A}${X}${this.opts._n}`;else throw new RL(O);N.set(O,OD.Completed)})}return A}}_L.ValueScope=TL});var a=C((s$)=>{Object.defineProperty(s$,"__esModule",{value:!0});s$.or=s$.and=s$.not=s$.CodeGen=s$.operators=s$.varKinds=s$.ValueScopeName=s$.ValueScope=s$.Scope=s$.Name=s$.regexpCode=s$.stringify=s$.getProperty=s$.nil=s$.strConcat=s$.str=s$._=void 0;var w$=YU(),S6=iX(),L4=YU();Object.defineProperty(s$,"_",{enumerable:!0,get:function(){return L4._}});Object.defineProperty(s$,"str",{enumerable:!0,get:function(){return L4.str}});Object.defineProperty(s$,"strConcat",{enumerable:!0,get:function(){return L4.strConcat}});Object.defineProperty(s$,"nil",{enumerable:!0,get:function(){return L4.nil}});Object.defineProperty(s$,"getProperty",{enumerable:!0,get:function(){return L4.getProperty}});Object.defineProperty(s$,"stringify",{enumerable:!0,get:function(){return L4.stringify}});Object.defineProperty(s$,"regexpCode",{enumerable:!0,get:function(){return L4.regexpCode}});Object.defineProperty(s$,"Name",{enumerable:!0,get:function(){return L4.Name}});var BD=iX();Object.defineProperty(s$,"Scope",{enumerable:!0,get:function(){return BD.Scope}});Object.defineProperty(s$,"ValueScope",{enumerable:!0,get:function(){return BD.ValueScope}});Object.defineProperty(s$,"ValueScopeName",{enumerable:!0,get:function(){return BD.ValueScopeName}});Object.defineProperty(s$,"varKinds",{enumerable:!0,get:function(){return BD.varKinds}});s$.operators={GT:new w$._Code(">"),GTE:new w$._Code(">="),LT:new w$._Code("<"),LTE:new w$._Code("<="),EQ:new w$._Code("==="),NEQ:new w$._Code("!=="),NOT:new w$._Code("!"),OR:new w$._Code("||"),AND:new w$._Code("&&"),ADD:new w$._Code("+")};class z4{optimizeNodes(){return this}optimizeNames($,I){return this}}class ZL extends z4{constructor($,I,U){super();this.varKind=$,this.name=I,this.rhs=U}render({es5:$,_n:I}){let U=$?S6.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=TI(this.rhs,$,I);return this}get names(){return this.rhs instanceof w$._CodeOrName?this.rhs.names:{}}}class dX extends z4{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 w$.Name&&!$[this.lhs.str]&&!this.sideEffects)return;return this.rhs=TI(this.rhs,$,I),this}get names(){let $=this.lhs instanceof w$.Name?{}:{...this.lhs.names};return YD($,this.rhs)}}class gL extends dX{constructor($,I,U,D){super($,U,D);this.op=I}render({_n:$}){return`${this.lhs} ${this.op}= ${this.rhs};`+$}}class xL extends z4{constructor($){super();this.label=$,this.names={}}render({_n:$}){return`${this.label}:`+$}}class hL extends z4{constructor($){super();this.label=$,this.names={}}render({_n:$}){return`break${this.label?` ${this.label}`:""};`+$}}class fL extends z4{constructor($){super();this.error=$}render({_n:$}){return`throw ${this.error};`+$}get names(){return this.error.names}}class yL extends z4{constructor($){super();this.code=$}render({_n:$}){return`${this.code};`+$}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames($,I){return this.code=TI(this.code,$,I),this}get names(){return this.code instanceof w$._CodeOrName?this.code.names:{}}}class JD extends z4{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 A=U[D];if(A.optimizeNames($,I))continue;mP($,A.names),U.splice(D,1)}return U.length>0?this:void 0}get names(){return this.nodes.reduce(($,I)=>p4($,I.names),{})}}class M4 extends JD{render($){return"{"+$._n+super.render($)+"}"+$._n}}class uL extends JD{}class BU extends M4{}BU.kind="else";class e6 extends M4{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 BU(U):U}if(I){if($===!1)return I instanceof e6?I:I.nodes;if(this.nodes.length)return this;return new e6(iL($),I instanceof e6?[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=TI(this.condition,$,I),this}get names(){let $=super.names;if(YD($,this.condition),this.else)p4($,this.else.names);return $}}e6.kind="if";class RI extends M4{}RI.kind="for";class lL extends RI{constructor($){super();this.iteration=$}render($){return`for(${this.iteration})`+super.render($)}optimizeNames($,I){if(!super.optimizeNames($,I))return;return this.iteration=TI(this.iteration,$,I),this}get names(){return p4(super.names,this.iteration.names)}}class cL extends RI{constructor($,I,U,D){super();this.varKind=$,this.name=I,this.from=U,this.to=D}render($){let I=$.es5?S6.varKinds.var:this.varKind,{name:U,from:D,to:A}=this;return`for(${I} ${U}=${D}; ${U}<${A}; ${U}++)`+super.render($)}get names(){let $=YD(super.names,this.from);return YD($,this.to)}}class nX extends RI{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=TI(this.iterable,$,I),this}get names(){return p4(super.names,this.iterable.names)}}class XD extends M4{constructor($,I,U){super();this.name=$,this.args=I,this.async=U}render($){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render($)}}XD.kind="func";class WD extends JD{render($){return"return "+super.render($)}}WD.kind="return";class mL extends M4{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)p4($,this.catch.names);if(this.finally)p4($,this.finally.names);return $}}class GD extends M4{constructor($){super();this.error=$}render($){return`catch(${this.error})`+super.render($)}}GD.kind="catch";class QD extends M4{render($){return"finally"+super.render($)}}QD.kind="finally";class rL{constructor($,I={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...I,_n:I.lines?`
3
- `:""},this._extScope=$,this._scope=new S6.Scope({parent:$}),this._nodes=[new uL]}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 A=this._scope.toName(I);if(U!==void 0&&D)this._constants[A.str]=U;return this._leafNode(new ZL($,A,U)),A}const($,I,U){return this._def(S6.varKinds.const,$,I,U)}let($,I,U){return this._def(S6.varKinds.let,$,I,U)}var($,I,U){return this._def(S6.varKinds.var,$,I,U)}assign($,I,U){return this._leafNode(new dX($,I,U))}add($,I){return this._leafNode(new gL($,s$.operators.ADD,I))}code($){if(typeof $=="function")$();else if($!==w$.nil)this._leafNode(new yL($));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(":"),w$.addCodeArg(I,D)}return I.push("}"),new w$._Code(I)}if($,I,U){if(this._blockNode(new e6($)),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 e6($))}else(){return this._elseNode(new BU)}endIf(){return this._endBlockNode(e6,BU)}_for($,I){if(this._blockNode($),I)this.code(I).endFor();return this}for($,I){return this._for(new lL($),I)}forRange($,I,U,D,A=this.opts.es5?S6.varKinds.var:S6.varKinds.let){let w=this._scope.toName($);return this._for(new cL(A,w,I,U),()=>D(w))}forOf($,I,U,D=S6.varKinds.const){let A=this._scope.toName($);if(this.opts.es5){let w=I instanceof w$.Name?I:this.var("_arr",I);return this.forRange("_i",0,w$._`${w}.length`,(b)=>{this.var(A,w$._`${w}[${b}]`),U(A)})}return this._for(new nX("of",D,A,I),()=>U(A))}forIn($,I,U,D=this.opts.es5?S6.varKinds.var:S6.varKinds.const){if(this.opts.ownProperties)return this.forOf($,w$._`Object.keys(${I})`,U);let A=this._scope.toName($);return this._for(new nX("in",D,A,I),()=>U(A))}endFor(){return this._endBlockNode(RI)}label($){return this._leafNode(new xL($))}break($){return this._leafNode(new hL($))}return($){let I=new WD;if(this._blockNode(I),this.code($),I.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(WD)}try($,I,U){if(!I&&!U)throw new Error('CodeGen: "try" without "catch" and "finally"');let D=new mL;if(this._blockNode(D),this.code($),I){let A=this.name("e");this._currNode=D.catch=new GD(A),I(A)}if(U)this._currNode=D.finally=new QD,this.code(U);return this._endBlockNode(GD,QD)}throw($){return this._leafNode(new fL($))}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=w$.nil,U,D){if(this._blockNode(new XD($,I,U)),D)this.code(D).endFunc();return this}endFunc(){return this._endBlockNode(XD)}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 e6))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]=$}}s$.CodeGen=rL;function p4($,I){for(let U in I)$[U]=($[U]||0)+(I[U]||0);return $}function YD($,I){return I instanceof w$._CodeOrName?p4($,I.names):$}function TI($,I,U){if($ instanceof w$.Name)return D($);if(!A($))return $;return new w$._Code($._items.reduce((w,b)=>{if(b instanceof w$.Name)b=D(b);if(b instanceof w$._Code)w.push(...b._items);else w.push(b);return w},[]));function D(w){let b=U[w.str];if(b===void 0||I[w.str]!==1)return w;return delete I[w.str],b}function A(w){return w instanceof w$._Code&&w._items.some((b)=>b instanceof w$.Name&&I[b.str]===1&&U[b.str]!==void 0)}}function mP($,I){for(let U in I)$[U]=($[U]||0)-(I[U]||0)}function iL($){return typeof $=="boolean"||typeof $=="number"||$===null?!$:w$._`!${oX($)}`}s$.not=iL;var rP=nL(s$.operators.AND);function iP(...$){return $.reduce(rP)}s$.and=iP;var nP=nL(s$.operators.OR);function oP(...$){return $.reduce(nP)}s$.or=oP;function nL($){return(I,U)=>I===w$.nil?U:U===w$.nil?I:w$._`${oX(I)} ${$} ${oX(U)}`}function oX($){return $ instanceof w$.Name?$:w$._`(${$})`}});var N$=C((Iz)=>{Object.defineProperty(Iz,"__esModule",{value:!0});Iz.checkStrictMode=Iz.getErrorPath=Iz.Type=Iz.useFunc=Iz.setEvaluated=Iz.evaluatedPropsToName=Iz.mergeEvaluated=Iz.eachItem=Iz.unescapeJsonPointer=Iz.escapeJsonPointer=Iz.escapeFragment=Iz.unescapeFragment=Iz.schemaRefOrVal=Iz.schemaHasRulesButRef=Iz.schemaHasRules=Iz.checkUnknownRules=Iz.alwaysValidSchema=Iz.toHash=void 0;var B$=a(),aP=YU();function eP($){let I={};for(let U of $)I[U]=!0;return I}Iz.toHash=eP;function sP($,I){if(typeof I=="boolean")return I;if(Object.keys(I).length===0)return!0;return tL($,I),!aL(I,$.self.RULES.all)}Iz.alwaysValidSchema=sP;function tL($,I=$.schema){let{opts:U,self:D}=$;if(!U.strictSchema)return;if(typeof I==="boolean")return;let A=D.RULES.keywords;for(let w in I)if(!A[w])$z($,`unknown keyword: "${w}"`)}Iz.checkUnknownRules=tL;function aL($,I){if(typeof $=="boolean")return!$;for(let U in $)if(I[U])return!0;return!1}Iz.schemaHasRules=aL;function $R($,I){if(typeof $=="boolean")return!$;for(let U in $)if(U!=="$ref"&&I.all[U])return!0;return!1}Iz.schemaHasRulesButRef=$R;function IR({topSchemaRef:$,schemaPath:I},U,D,A){if(!A){if(typeof U=="number"||typeof U=="boolean")return U;if(typeof U=="string")return B$._`${U}`}return B$._`${$}${I}${B$.getProperty(D)}`}Iz.schemaRefOrVal=IR;function UR($){return eL(decodeURIComponent($))}Iz.unescapeFragment=UR;function AR($){return encodeURIComponent(tX($))}Iz.escapeFragment=AR;function tX($){if(typeof $=="number")return`${$}`;return $.replace(/~/g,"~0").replace(/\//g,"~1")}Iz.escapeJsonPointer=tX;function eL($){return $.replace(/~1/g,"/").replace(/~0/g,"~")}Iz.unescapeJsonPointer=eL;function DR($,I){if(Array.isArray($))for(let U of $)I(U);else I($)}Iz.eachItem=DR;function dL({mergeNames:$,mergeToName:I,mergeValues:U,resultToName:D}){return(A,w,b,N)=>{let O=b===void 0?w:b instanceof B$.Name?(w instanceof B$.Name?$(A,w,b):I(A,w,b),b):w instanceof B$.Name?(I(A,b,w),w):U(w,b);return N===B$.Name&&!(O instanceof B$.Name)?D(A,O):O}}Iz.mergeEvaluated={props:dL({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} || {}`),aX($,U,I)}),mergeValues:($,I)=>$===!0?!0:{...$,...I},resultToName:sL}),items:dL({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 sL($,I){if(I===!0)return $.var("props",!0);let U=$.var("props",B$._`{}`);if(I!==void 0)aX($,U,I);return U}Iz.evaluatedPropsToName=sL;function aX($,I,U){Object.keys(U).forEach((D)=>$.assign(B$._`${I}${B$.getProperty(D)}`,!0))}Iz.setEvaluated=aX;var pL={};function wR($,I){return $.scopeValue("func",{ref:I,code:pL[I.code]||(pL[I.code]=new aP._Code(I.code))})}Iz.useFunc=wR;var pX;(function($){$[$.Num=0]="Num",$[$.Str=1]="Str"})(pX||(Iz.Type=pX={}));function bR($,I,U){if($ instanceof B$.Name){let D=I===pX.Num;return U?D?B$._`"[" + ${$} + "]"`:B$._`"['" + ${$} + "']"`:D?B$._`"/" + ${$}`:B$._`"/" + ${$}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return U?B$.getProperty($).toString():"/"+tX($)}Iz.getErrorPath=bR;function $z($,I,U=$.opts.strictSchema){if(!U)return;if(I=`strict mode: ${I}`,U===!0)throw new Error(I);$.self.logger.warn(I)}Iz.checkStrictMode=$z});var s6=C((Az)=>{Object.defineProperty(Az,"__esModule",{value:!0});var y$=a(),FR={data:new y$.Name("data"),valCxt:new y$.Name("valCxt"),instancePath:new y$.Name("instancePath"),parentData:new y$.Name("parentData"),parentDataProperty:new y$.Name("parentDataProperty"),rootData:new y$.Name("rootData"),dynamicAnchors:new y$.Name("dynamicAnchors"),vErrors:new y$.Name("vErrors"),errors:new y$.Name("errors"),this:new y$.Name("this"),self:new y$.Name("self"),scope:new y$.Name("scope"),json:new y$.Name("json"),jsonPos:new y$.Name("jsonPos"),jsonLen:new y$.Name("jsonLen"),jsonPart:new y$.Name("jsonPart")};Az.default=FR});var JU=C((Nz)=>{Object.defineProperty(Nz,"__esModule",{value:!0});Nz.extendErrors=Nz.resetErrorsCount=Nz.reportExtraError=Nz.reportError=Nz.keyword$DataError=Nz.keywordError=void 0;var b$=a(),LD=N$(),i$=s6();Nz.keywordError={message:({keyword:$})=>b$.str`must pass "${$}" keyword validation`};Nz.keyword$DataError={message:({keyword:$,schemaType:I})=>I?b$.str`"${$}" keyword must be ${I} ($data)`:b$.str`"${$}" keyword is invalid ($data)`};function SR($,I=Nz.keywordError,U,D){let{it:A}=$,{gen:w,compositeRule:b,allErrors:N}=A,O=bz($,I,U);if(D!==null&&D!==void 0?D:b||N)Dz(w,O);else wz(A,b$._`[${O}]`)}Nz.reportError=SR;function jR($,I=Nz.keywordError,U){let{it:D}=$,{gen:A,compositeRule:w,allErrors:b}=D,N=bz($,I,U);if(Dz(A,N),!(w||b))wz(D,i$.default.vErrors)}Nz.reportExtraError=jR;function kR($,I){$.assign(i$.default.errors,I),$.if(b$._`${i$.default.vErrors} !== null`,()=>$.if(I,()=>$.assign(b$._`${i$.default.vErrors}.length`,I),()=>$.assign(i$.default.vErrors,null)))}Nz.resetErrorsCount=kR;function PR({gen:$,keyword:I,schemaValue:U,data:D,errsCount:A,it:w}){if(A===void 0)throw new Error("ajv implementation error");let b=$.name("err");$.forRange("i",A,i$.default.errors,(N)=>{if($.const(b,b$._`${i$.default.vErrors}[${N}]`),$.if(b$._`${b}.instancePath === undefined`,()=>$.assign(b$._`${b}.instancePath`,b$.strConcat(i$.default.instancePath,w.errorPath))),$.assign(b$._`${b}.schemaPath`,b$.str`${w.errSchemaPath}/${I}`),w.opts.verbose)$.assign(b$._`${b}.schema`,U),$.assign(b$._`${b}.data`,D)})}Nz.extendErrors=PR;function Dz($,I){let U=$.const("err",I);$.if(b$._`${i$.default.vErrors} === null`,()=>$.assign(i$.default.vErrors,b$._`[${U}]`),b$._`${i$.default.vErrors}.push(${U})`),$.code(b$._`${i$.default.errors}++`)}function wz($,I){let{gen:U,validateName:D,schemaEnv:A}=$;if(A.$async)U.throw(b$._`new ${$.ValidationError}(${I})`);else U.assign(b$._`${D}.errors`,I),U.return(!1)}var t4={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 bz($,I,U){let{createErrors:D}=$.it;if(D===!1)return b$._`{}`;return RR($,I,U)}function RR($,I,U={}){let{gen:D,it:A}=$,w=[TR(A,U),_R($,U)];return CR($,I,w),D.object(...w)}function TR({errorPath:$},{instancePath:I}){let U=I?b$.str`${$}${LD.getErrorPath(I,LD.Type.Str)}`:$;return[i$.default.instancePath,b$.strConcat(i$.default.instancePath,U)]}function _R({keyword:$,it:{errSchemaPath:I}},{schemaPath:U,parentSchema:D}){let A=D?I:b$.str`${I}/${$}`;if(U)A=b$.str`${A}${LD.getErrorPath(U,LD.Type.Str)}`;return[t4.schemaPath,A]}function CR($,{params:I,message:U},D){let{keyword:A,data:w,schemaValue:b,it:N}=$,{opts:O,propertyName:X,topSchemaRef:W,schemaPath:Q}=N;if(D.push([t4.keyword,A],[t4.params,typeof I=="function"?I($):I||b$._`{}`]),O.messages)D.push([t4.message,typeof U=="function"?U($):U]);if(O.verbose)D.push([t4.schema,b],[t4.parentSchema,b$._`${W}${Q}`],[i$.default.data,w]);if(X)D.push([t4.propertyName,X])}});var Qz=C((Wz)=>{Object.defineProperty(Wz,"__esModule",{value:!0});Wz.boolOrEmptySchema=Wz.topBoolOrEmptySchema=void 0;var fR=JU(),yR=a(),uR=s6(),lR={message:"boolean schema is false"};function cR($){let{gen:I,schema:U,validateName:D}=$;if(U===!1)Xz($,!1);else if(typeof U=="object"&&U.$async===!0)I.return(uR.default.data);else I.assign(yR._`${D}.errors`,null),I.return(!0)}Wz.topBoolOrEmptySchema=cR;function mR($,I){let{gen:U,schema:D}=$;if(D===!1)U.var(I,!1),Xz($);else U.var(I,!0)}Wz.boolOrEmptySchema=mR;function Xz($,I){let{gen:U,data:D}=$,A={gen:U,keyword:"false schema",data:D,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:$};fR.reportError(A,lR,void 0,I)}});var sX=C((Yz)=>{Object.defineProperty(Yz,"__esModule",{value:!0});Yz.getRules=Yz.isJSONType=void 0;var iR=["string","number","integer","boolean","null","object","array"],nR=new Set(iR);function oR($){return typeof $=="string"&&nR.has($)}Yz.isJSONType=oR;function dR(){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:{}}}Yz.getRules=dR});var $W=C((Lz)=>{Object.defineProperty(Lz,"__esModule",{value:!0});Lz.shouldUseRule=Lz.shouldUseGroup=Lz.schemaHasRulesForType=void 0;function tR({schema:$,self:I},U){let D=I.RULES.types[U];return D&&D!==!0&&Jz($,D)}Lz.schemaHasRulesForType=tR;function Jz($,I){return I.rules.some((U)=>Hz($,U))}Lz.shouldUseGroup=Jz;function Hz($,I){var U;return $[I.keyword]!==void 0||((U=I.definition.implements)===null||U===void 0?void 0:U.some((D)=>$[D]!==void 0))}Lz.shouldUseRule=Hz});var HU=C((vz)=>{Object.defineProperty(vz,"__esModule",{value:!0});vz.reportTypeError=vz.checkDataTypes=vz.checkDataType=vz.coerceAndCheckDataType=vz.getJSONTypes=vz.getSchemaTypes=vz.DataType=void 0;var sR=sX(),$2=$W(),I2=JU(),p=a(),Mz=N$(),_I;(function($){$[$.Correct=0]="Correct",$[$.Wrong=1]="Wrong"})(_I||(vz.DataType=_I={}));function U2($){let I=Kz($.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}vz.getSchemaTypes=U2;function Kz($){let I=Array.isArray($)?$:$?[$]:[];if(I.every(sR.isJSONType))return I;throw new Error("type must be JSONType or JSONType[]: "+I.join(","))}vz.getJSONTypes=Kz;function A2($,I){let{gen:U,data:D,opts:A}=$,w=D2(I,A.coerceTypes),b=I.length>0&&!(w.length===0&&I.length===1&&$2.schemaHasRulesForType($,I[0]));if(b){let N=UW(I,D,A.strictNumbers,_I.Wrong);U.if(N,()=>{if(w.length)w2($,I,w);else AW($)})}return b}vz.coerceAndCheckDataType=A2;var Vz=new Set(["string","number","integer","boolean","null"]);function D2($,I){return I?$.filter((U)=>Vz.has(U)||I==="array"&&U==="array"):[]}function w2($,I,U){let{gen:D,data:A,opts:w}=$,b=D.let("dataType",p._`typeof ${A}`),N=D.let("coerced",p._`undefined`);if(w.coerceTypes==="array")D.if(p._`${b} == 'object' && Array.isArray(${A}) && ${A}.length == 1`,()=>D.assign(A,p._`${A}[0]`).assign(b,p._`typeof ${A}`).if(UW(I,A,w.strictNumbers),()=>D.assign(N,A)));D.if(p._`${N} !== undefined`);for(let X of U)if(Vz.has(X)||X==="array"&&w.coerceTypes==="array")O(X);D.else(),AW($),D.endIf(),D.if(p._`${N} !== undefined`,()=>{D.assign(A,N),b2($,N)});function O(X){switch(X){case"string":D.elseIf(p._`${b} == "number" || ${b} == "boolean"`).assign(N,p._`"" + ${A}`).elseIf(p._`${A} === null`).assign(N,p._`""`);return;case"number":D.elseIf(p._`${b} == "boolean" || ${A} === null
4
- || (${b} == "string" && ${A} && ${A} == +${A})`).assign(N,p._`+${A}`);return;case"integer":D.elseIf(p._`${b} === "boolean" || ${A} === null
5
- || (${b} === "string" && ${A} && ${A} == +${A} && !(${A} % 1))`).assign(N,p._`+${A}`);return;case"boolean":D.elseIf(p._`${A} === "false" || ${A} === 0 || ${A} === null`).assign(N,!1).elseIf(p._`${A} === "true" || ${A} === 1`).assign(N,!0);return;case"null":D.elseIf(p._`${A} === "" || ${A} === 0 || ${A} === false`),D.assign(N,null);return;case"array":D.elseIf(p._`${b} === "string" || ${b} === "number"
6
- || ${b} === "boolean" || ${A} === null`).assign(N,p._`[${A}]`)}}}function b2({gen:$,parentData:I,parentDataProperty:U},D){$.if(p._`${I} !== undefined`,()=>$.assign(p._`${I}[${U}]`,D))}function IW($,I,U,D=_I.Correct){let A=D===_I.Correct?p.operators.EQ:p.operators.NEQ,w;switch($){case"null":return p._`${I} ${A} null`;case"array":w=p._`Array.isArray(${I})`;break;case"object":w=p._`${I} && typeof ${I} == "object" && !Array.isArray(${I})`;break;case"integer":w=b(p._`!(${I} % 1) && !isNaN(${I})`);break;case"number":w=b();break;default:return p._`typeof ${I} ${A} ${$}`}return D===_I.Correct?w:p.not(w);function b(N=p.nil){return p.and(p._`typeof ${I} == "number"`,N,U?p._`isFinite(${I})`:p.nil)}}vz.checkDataType=IW;function UW($,I,U,D){if($.length===1)return IW($[0],I,U,D);let A,w=Mz.toHash($);if(w.array&&w.object){let b=p._`typeof ${I} != "object"`;A=w.null?b:p._`!${I} || ${b}`,delete w.null,delete w.array,delete w.object}else A=p.nil;if(w.number)delete w.integer;for(let b in w)A=p.and(A,IW(b,I,U,D));return A}vz.checkDataTypes=UW;var N2={message:({schema:$})=>`must be ${$}`,params:({schema:$,schemaValue:I})=>typeof $=="string"?p._`{type: ${$}}`:p._`{type: ${I}}`};function AW($){let I=O2($);I2.reportError(I,N2)}vz.reportTypeError=AW;function O2($){let{gen:I,data:U,schema:D}=$,A=Mz.schemaRefOrVal($,D,"type");return{gen:I,keyword:"type",data:U,schema:D.type,schemaCode:A,schemaValue:A,parentSchema:D,params:{},it:$}}});var jz=C((Ez)=>{Object.defineProperty(Ez,"__esModule",{value:!0});Ez.assignDefaults=void 0;var CI=a(),J2=N$();function H2($,I){let{properties:U,items:D}=$.schema;if(I==="object"&&U)for(let A in U)Fz($,A,U[A].default);else if(I==="array"&&Array.isArray(D))D.forEach((A,w)=>Fz($,w,A.default))}Ez.assignDefaults=H2;function Fz($,I,U){let{gen:D,compositeRule:A,data:w,opts:b}=$;if(U===void 0)return;let N=CI._`${w}${CI.getProperty(I)}`;if(A){J2.checkStrictMode($,`default is ignored for: ${N}`);return}let O=CI._`${N} === undefined`;if(b.useDefaults==="empty")O=CI._`${O} || ${N} === null || ${N} === ""`;D.if(O,CI._`${N} = ${CI.stringify(U)}`)}});var H6=C((Rz)=>{Object.defineProperty(Rz,"__esModule",{value:!0});Rz.validateUnion=Rz.validateArray=Rz.usePattern=Rz.callValidateCode=Rz.schemaProperties=Rz.allSchemaProperties=Rz.noPropertyInData=Rz.propertyInData=Rz.isOwnProperty=Rz.hasPropFunc=Rz.reportMissingProp=Rz.checkMissingProp=Rz.checkReportMissingProp=void 0;var M$=a(),DW=N$(),K4=s6(),L2=N$();function z2($,I){let{gen:U,data:D,it:A}=$;U.if(bW(U,D,I,A.opts.ownProperties),()=>{$.setParams({missingProperty:M$._`${I}`},!0),$.error()})}Rz.checkReportMissingProp=z2;function M2({gen:$,data:I,it:{opts:U}},D,A){return M$.or(...D.map((w)=>M$.and(bW($,I,w,U.ownProperties),M$._`${A} = ${w}`)))}Rz.checkMissingProp=M2;function K2($,I){$.setParams({missingProperty:I},!0),$.error()}Rz.reportMissingProp=K2;function kz($){return $.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:M$._`Object.prototype.hasOwnProperty`})}Rz.hasPropFunc=kz;function wW($,I,U){return M$._`${kz($)}.call(${I}, ${U})`}Rz.isOwnProperty=wW;function V2($,I,U,D){let A=M$._`${I}${M$.getProperty(U)} !== undefined`;return D?M$._`${A} && ${wW($,I,U)}`:A}Rz.propertyInData=V2;function bW($,I,U,D){let A=M$._`${I}${M$.getProperty(U)} === undefined`;return D?M$.or(A,M$.not(wW($,I,U))):A}Rz.noPropertyInData=bW;function Pz($){return $?Object.keys($).filter((I)=>I!=="__proto__"):[]}Rz.allSchemaProperties=Pz;function v2($,I){return Pz(I).filter((U)=>!DW.alwaysValidSchema($,I[U]))}Rz.schemaProperties=v2;function q2({schemaCode:$,data:I,it:{gen:U,topSchemaRef:D,schemaPath:A,errorPath:w},it:b},N,O,X){let W=X?M$._`${$}, ${I}, ${D}${A}`:I,Q=[[K4.default.instancePath,M$.strConcat(K4.default.instancePath,w)],[K4.default.parentData,b.parentData],[K4.default.parentDataProperty,b.parentDataProperty],[K4.default.rootData,K4.default.rootData]];if(b.opts.dynamicRef)Q.push([K4.default.dynamicAnchors,K4.default.dynamicAnchors]);let B=M$._`${W}, ${U.object(...Q)}`;return O!==M$.nil?M$._`${N}.call(${O}, ${B})`:M$._`${N}(${B})`}Rz.callValidateCode=q2;var F2=M$._`new RegExp`;function E2({gen:$,it:{opts:I}},U){let D=I.unicodeRegExp?"u":"",{regExp:A}=I.code,w=A(U,D);return $.scopeValue("pattern",{key:w.toString(),ref:w,code:M$._`${A.code==="new RegExp"?F2:L2.useFunc($,A)}(${U}, ${D})`})}Rz.usePattern=E2;function S2($){let{gen:I,data:U,keyword:D,it:A}=$,w=I.name("valid");if(A.allErrors){let N=I.let("valid",!0);return b(()=>I.assign(N,!1)),N}return I.var(w,!0),b(()=>I.break()),w;function b(N){let O=I.const("len",M$._`${U}.length`);I.forRange("i",0,O,(X)=>{$.subschema({keyword:D,dataProp:X,dataPropType:DW.Type.Num},w),I.if(M$.not(w),N)})}}Rz.validateArray=S2;function j2($){let{gen:I,schema:U,keyword:D,it:A}=$;if(!Array.isArray(U))throw new Error("ajv implementation error");if(U.some((O)=>DW.alwaysValidSchema(A,O))&&!A.opts.unevaluated)return;let b=I.let("valid",!1),N=I.name("_valid");I.block(()=>U.forEach((O,X)=>{let W=$.subschema({keyword:D,schemaProp:X,compositeRule:!0},N);if(I.assign(b,M$._`${b} || ${N}`),!$.mergeValidEvaluated(W,N))I.if(M$.not(b))})),$.result(b,()=>$.reset(),()=>$.error(!0))}Rz.validateUnion=j2});var xz=C((Zz)=>{Object.defineProperty(Zz,"__esModule",{value:!0});Zz.validateKeywordUsage=Zz.validSchemaType=Zz.funcKeywordCode=Zz.macroKeywordCode=void 0;var n$=a(),a4=s6(),u2=H6(),l2=JU();function c2($,I){let{gen:U,keyword:D,schema:A,parentSchema:w,it:b}=$,N=I.macro.call(b.self,A,w,b),O=Cz(U,D,N);if(b.opts.validateSchema!==!1)b.self.validateSchema(N,!0);let X=U.name("valid");$.subschema({schema:N,schemaPath:n$.nil,errSchemaPath:`${b.errSchemaPath}/${D}`,topSchemaRef:O,compositeRule:!0},X),$.pass(X,()=>$.error(!0))}Zz.macroKeywordCode=c2;function m2($,I){var U;let{gen:D,keyword:A,schema:w,parentSchema:b,$data:N,it:O}=$;i2(O,I);let X=!N&&I.compile?I.compile.call(O.self,w,b,O):I.validate,W=Cz(D,A,X),Q=D.let("valid");$.block$data(Q,B),$.ok((U=I.valid)!==null&&U!==void 0?U:Q);function B(){if(I.errors===!1){if(H(),I.modifying)_z($);v(()=>$.error())}else{let V=I.async?Y():J();if(I.modifying)_z($);v(()=>r2($,V))}}function Y(){let V=D.let("ruleErrs",null);return D.try(()=>H(n$._`await `),(F)=>D.assign(Q,!1).if(n$._`${F} instanceof ${O.ValidationError}`,()=>D.assign(V,n$._`${F}.errors`),()=>D.throw(F))),V}function J(){let V=n$._`${W}.errors`;return D.assign(V,null),H(n$.nil),V}function H(V=I.async?n$._`await `:n$.nil){let F=O.opts.passContext?a4.default.this:a4.default.self,k=!(("compile"in I)&&!N||I.schema===!1);D.assign(Q,n$._`${V}${u2.callValidateCode($,W,F,k)}`,I.modifying)}function v(V){var F;D.if(n$.not((F=I.valid)!==null&&F!==void 0?F:Q),V)}}Zz.funcKeywordCode=m2;function _z($){let{gen:I,data:U,it:D}=$;I.if(D.parentData,()=>I.assign(U,n$._`${D.parentData}[${D.parentDataProperty}]`))}function r2($,I){let{gen:U}=$;U.if(n$._`Array.isArray(${I})`,()=>{U.assign(a4.default.vErrors,n$._`${a4.default.vErrors} === null ? ${I} : ${a4.default.vErrors}.concat(${I})`).assign(a4.default.errors,n$._`${a4.default.vErrors}.length`),l2.extendErrors($)},()=>$.error())}function i2({schemaEnv:$},I){if(I.async&&!$.$async)throw new Error("async keyword in sync schema")}function Cz($,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:n$.stringify(U)})}function n2($,I,U=!1){return!I.length||I.some((D)=>D==="array"?Array.isArray($):D==="object"?$&&typeof $=="object"&&!Array.isArray($):typeof $==D||U&&typeof $=="undefined")}Zz.validSchemaType=n2;function o2({schema:$,opts:I,self:U,errSchemaPath:D},A,w){if(Array.isArray(A.keyword)?!A.keyword.includes(w):A.keyword!==w)throw new Error("ajv implementation error");let b=A.dependencies;if(b===null||b===void 0?void 0:b.some((N)=>!Object.prototype.hasOwnProperty.call($,N)))throw new Error(`parent schema must have dependencies of ${w}: ${b.join(",")}`);if(A.validateSchema){if(!A.validateSchema($[w])){let O=`keyword "${w}" value is invalid at path "${D}": `+U.errorsText(A.validateSchema.errors);if(I.validateSchema==="log")U.logger.error(O);else throw new Error(O)}}}Zz.validateKeywordUsage=o2});var uz=C((fz)=>{Object.defineProperty(fz,"__esModule",{value:!0});fz.extendSubschemaMode=fz.extendSubschemaData=fz.getSubschema=void 0;var h6=a(),hz=N$();function a2($,{keyword:I,schemaProp:U,schema:D,schemaPath:A,errSchemaPath:w,topSchemaRef:b}){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:h6._`${$.schemaPath}${h6.getProperty(I)}`,errSchemaPath:`${$.errSchemaPath}/${I}`}:{schema:N[U],schemaPath:h6._`${$.schemaPath}${h6.getProperty(I)}${h6.getProperty(U)}`,errSchemaPath:`${$.errSchemaPath}/${I}/${hz.escapeFragment(U)}`}}if(D!==void 0){if(A===void 0||w===void 0||b===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:D,schemaPath:A,topSchemaRef:b,errSchemaPath:w}}throw new Error('either "keyword" or "schema" must be passed')}fz.getSubschema=a2;function e2($,I,{dataProp:U,dataPropType:D,data:A,dataTypes:w,propertyName:b}){if(A!==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:W,opts:Q}=I,B=N.let("data",h6._`${I.data}${h6.getProperty(U)}`,!0);O(B),$.errorPath=h6.str`${X}${hz.getErrorPath(U,D,Q.jsPropertySyntax)}`,$.parentDataProperty=h6._`${U}`,$.dataPathArr=[...W,$.parentDataProperty]}if(A!==void 0){let X=A instanceof h6.Name?A:N.let("data",A,!0);if(O(X),b!==void 0)$.propertyName=b}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]}}fz.extendSubschemaData=e2;function s2($,{jtdDiscriminator:I,jtdMetadata:U,compositeRule:D,createErrors:A,allErrors:w}){if(D!==void 0)$.compositeRule=D;if(A!==void 0)$.createErrors=A;if(w!==void 0)$.allErrors=w;$.jtdDiscriminator=I,$.jtdMetadata=U}fz.extendSubschemaMode=s2});var NW=C((Oo,lz)=>{lz.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,A,w;if(Array.isArray(I)){if(D=I.length,D!=U.length)return!1;for(A=D;A--!==0;)if(!$(I[A],U[A]))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(A=D;A--!==0;)if(!Object.prototype.hasOwnProperty.call(U,w[A]))return!1;for(A=D;A--!==0;){var b=w[A];if(!$(I[b],U[b]))return!1}return!0}return I!==I&&U!==U}});var mz=C((Xo,cz)=>{var V4=cz.exports=function($,I,U){if(typeof I=="function")U=I,I={};U=I.cb||U;var D=typeof U=="function"?U:U.pre||function(){},A=U.post||function(){};zD(I,D,A,$,"",$)};V4.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};V4.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};V4.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};V4.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 zD($,I,U,D,A,w,b,N,O,X){if(D&&typeof D=="object"&&!Array.isArray(D)){I(D,A,w,b,N,O,X);for(var W in D){var Q=D[W];if(Array.isArray(Q)){if(W in V4.arrayKeywords)for(var B=0;B<Q.length;B++)zD($,I,U,Q[B],A+"/"+W+"/"+B,w,A,W,D,B)}else if(W in V4.propsKeywords){if(Q&&typeof Q=="object")for(var Y in Q)zD($,I,U,Q[Y],A+"/"+W+"/"+UT(Y),w,A,W,D,Y)}else if(W in V4.keywords||$.allKeys&&!(W in V4.skipKeywords))zD($,I,U,Q,A+"/"+W,w,A,W,D)}U(D,A,w,b,N,O,X)}}function UT($){return $.replace(/~/g,"~0").replace(/\//g,"~1")}});var LU=C((oz)=>{Object.defineProperty(oz,"__esModule",{value:!0});oz.getSchemaRefs=oz.resolveUrl=oz.normalizeId=oz._getFullPath=oz.getFullPath=oz.inlineRef=void 0;var AT=N$(),DT=NW(),wT=mz(),bT=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function NT($,I=!0){if(typeof $=="boolean")return!0;if(I===!0)return!OW($);if(!I)return!1;return rz($)<=I}oz.inlineRef=NT;var OT=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function OW($){for(let I in $){if(OT.has(I))return!0;let U=$[I];if(Array.isArray(U)&&U.some(OW))return!0;if(typeof U=="object"&&OW(U))return!0}return!1}function rz($){let I=0;for(let U in $){if(U==="$ref")return 1/0;if(I++,bT.has(U))continue;if(typeof $[U]=="object")AT.eachItem($[U],(D)=>I+=rz(D));if(I===1/0)return 1/0}return I}function iz($,I="",U){if(U!==!1)I=ZI(I);let D=$.parse(I);return nz($,D)}oz.getFullPath=iz;function nz($,I){return $.serialize(I).split("#")[0]+"#"}oz._getFullPath=nz;var XT=/#\/?$/;function ZI($){return $?$.replace(XT,""):""}oz.normalizeId=ZI;function WT($,I,U){return U=ZI(U),$.resolve(I,U)}oz.resolveUrl=WT;var GT=/^[a-z_][-a-z0-9._]*$/i;function QT($,I){if(typeof $=="boolean")return{};let{schemaId:U,uriResolver:D}=this.opts,A=ZI($[U]||I),w={"":A},b=iz(D,A,!1),N={},O=new Set;return wT($,{allKeys:!0},(Q,B,Y,J)=>{if(J===void 0)return;let H=b+B,v=w[J];if(typeof Q[U]=="string")v=V.call(this,Q[U]);F.call(this,Q.$anchor),F.call(this,Q.$dynamicAnchor),w[B]=v;function V(k){let h=this.opts.uriResolver.resolve;if(k=ZI(v?h(v,k):k),O.has(k))throw W(k);O.add(k);let l=this.refs[k];if(typeof l=="string")l=this.refs[l];if(typeof l=="object")X(Q,l.schema,k);else if(k!==ZI(H))if(k[0]==="#")X(Q,N[k],k),N[k]=Q;else this.refs[k]=H;return k}function F(k){if(typeof k=="string"){if(!GT.test(k))throw new Error(`invalid anchor "${k}"`);V.call(this,`#${k}`)}}}),N;function X(Q,B,Y){if(B!==void 0&&!DT(Q,B))throw W(Y)}function W(Q){return new Error(`reference "${Q}" resolves to more than one schema`)}}oz.getSchemaRefs=QT});var KU=C((X3)=>{Object.defineProperty(X3,"__esModule",{value:!0});X3.getData=X3.KeywordCxt=X3.validateFunctionCode=void 0;var sz=Qz(),pz=HU(),WW=$W(),MD=HU(),zT=jz(),MU=xz(),XW=uz(),u=a(),n=s6(),MT=LU(),$4=N$(),zU=JU();function KT($){if(U3($)){if(A3($),I3($)){qT($);return}}$3($,()=>sz.topBoolOrEmptySchema($))}X3.validateFunctionCode=KT;function $3({gen:$,validateName:I,schema:U,schemaEnv:D,opts:A},w){if(A.code.es5)$.func(I,u._`${n.default.data}, ${n.default.valCxt}`,D.$async,()=>{$.code(u._`"use strict"; ${tz(U,A)}`),vT($,A),$.code(w)});else $.func(I,u._`${n.default.data}, ${VT(A)}`,D.$async,()=>$.code(tz(U,A)).code(w))}function VT($){return u._`{${n.default.instancePath}="", ${n.default.parentData}, ${n.default.parentDataProperty}, ${n.default.rootData}=${n.default.data}${$.dynamicRef?u._`, ${n.default.dynamicAnchors}={}`:u.nil}}={}`}function vT($,I){$.if(n.default.valCxt,()=>{if($.var(n.default.instancePath,u._`${n.default.valCxt}.${n.default.instancePath}`),$.var(n.default.parentData,u._`${n.default.valCxt}.${n.default.parentData}`),$.var(n.default.parentDataProperty,u._`${n.default.valCxt}.${n.default.parentDataProperty}`),$.var(n.default.rootData,u._`${n.default.valCxt}.${n.default.rootData}`),I.dynamicRef)$.var(n.default.dynamicAnchors,u._`${n.default.valCxt}.${n.default.dynamicAnchors}`)},()=>{if($.var(n.default.instancePath,u._`""`),$.var(n.default.parentData,u._`undefined`),$.var(n.default.parentDataProperty,u._`undefined`),$.var(n.default.rootData,n.default.data),I.dynamicRef)$.var(n.default.dynamicAnchors,u._`{}`)})}function qT($){let{schema:I,opts:U,gen:D}=$;$3($,()=>{if(U.$comment&&I.$comment)w3($);if(kT($),D.let(n.default.vErrors,null),D.let(n.default.errors,0),U.unevaluated)FT($);D3($),TT($)});return}function FT($){let{gen:I,validateName:U}=$;$.evaluated=I.const("evaluated",u._`${U}.evaluated`),I.if(u._`${$.evaluated}.dynamicProps`,()=>I.assign(u._`${$.evaluated}.props`,u._`undefined`)),I.if(u._`${$.evaluated}.dynamicItems`,()=>I.assign(u._`${$.evaluated}.items`,u._`undefined`))}function tz($,I){let U=typeof $=="object"&&$[I.schemaId];return U&&(I.code.source||I.code.process)?u._`/*# sourceURL=${U} */`:u.nil}function ET($,I){if(U3($)){if(A3($),I3($)){ST($,I);return}}sz.boolOrEmptySchema($,I)}function I3({schema:$,self:I}){if(typeof $=="boolean")return!$;for(let U in $)if(I.RULES.all[U])return!0;return!1}function U3($){return typeof $.schema!="boolean"}function ST($,I){let{schema:U,gen:D,opts:A}=$;if(A.$comment&&U.$comment)w3($);PT($),RT($);let w=D.const("_errs",n.default.errors);D3($,w),D.var(I,u._`${w} === ${n.default.errors}`)}function A3($){$4.checkUnknownRules($),jT($)}function D3($,I){if($.opts.jtd)return az($,[],!1,I);let U=pz.getSchemaTypes($.schema),D=pz.coerceAndCheckDataType($,U);az($,U,!D,I)}function jT($){let{schema:I,errSchemaPath:U,opts:D,self:A}=$;if(I.$ref&&D.ignoreKeywordsWithRef&&$4.schemaHasRulesButRef(I,A.RULES))A.logger.warn(`$ref: keywords ignored in schema at path "${U}"`)}function kT($){let{schema:I,opts:U}=$;if(I.default!==void 0&&U.useDefaults&&U.strictSchema)$4.checkStrictMode($,"default is ignored in the schema root")}function PT($){let I=$.schema[$.opts.schemaId];if(I)$.baseId=MT.resolveUrl($.opts.uriResolver,$.baseId,I)}function RT($){if($.schema.$async&&!$.schemaEnv.$async)throw new Error("async schema in sync schema")}function w3({gen:$,schemaEnv:I,schema:U,errSchemaPath:D,opts:A}){let w=U.$comment;if(A.$comment===!0)$.code(u._`${n.default.self}.logger.log(${w})`);else if(typeof A.$comment=="function"){let b=u.str`${D}/$comment`,N=$.scopeValue("root",{ref:I.root});$.code(u._`${n.default.self}.opts.$comment(${w}, ${b}, ${N}.schema)`)}}function TT($){let{gen:I,schemaEnv:U,validateName:D,ValidationError:A,opts:w}=$;if(U.$async)I.if(u._`${n.default.errors} === 0`,()=>I.return(n.default.data),()=>I.throw(u._`new ${A}(${n.default.vErrors})`));else{if(I.assign(u._`${D}.errors`,n.default.vErrors),w.unevaluated)_T($);I.return(u._`${n.default.errors} === 0`)}}function _T({gen:$,evaluated:I,props:U,items:D}){if(U instanceof u.Name)$.assign(u._`${I}.props`,U);if(D instanceof u.Name)$.assign(u._`${I}.items`,D)}function az($,I,U,D){let{gen:A,schema:w,data:b,allErrors:N,opts:O,self:X}=$,{RULES:W}=X;if(w.$ref&&(O.ignoreKeywordsWithRef||!$4.schemaHasRulesButRef(w,W))){A.block(()=>N3($,"$ref",W.all.$ref.definition));return}if(!O.jtd)CT($,I);A.block(()=>{for(let B of W.rules)Q(B);Q(W.post)});function Q(B){if(!WW.shouldUseGroup(w,B))return;if(B.type){if(A.if(MD.checkDataType(B.type,b,O.strictNumbers)),ez($,B),I.length===1&&I[0]===B.type&&U)A.else(),MD.reportTypeError($);A.endIf()}else ez($,B);if(!N)A.if(u._`${n.default.errors} === ${D||0}`)}}function ez($,I){let{gen:U,schema:D,opts:{useDefaults:A}}=$;if(A)zT.assignDefaults($,I.type);U.block(()=>{for(let w of I.rules)if(WW.shouldUseRule(D,w))N3($,w.keyword,w.definition,I.type)})}function CT($,I){if($.schemaEnv.meta||!$.opts.strictTypes)return;if(ZT($,I),!$.opts.allowUnionTypes)gT($,I);xT($,$.dataTypes)}function ZT($,I){if(!I.length)return;if(!$.dataTypes.length){$.dataTypes=I;return}I.forEach((U)=>{if(!b3($.dataTypes,U))GW($,`type "${U}" not allowed by context "${$.dataTypes.join(",")}"`)}),fT($,I)}function gT($,I){if(I.length>1&&!(I.length===2&&I.includes("null")))GW($,"use allowUnionTypes to allow union type keyword")}function xT($,I){let U=$.self.RULES.all;for(let D in U){let A=U[D];if(typeof A=="object"&&WW.shouldUseRule($.schema,A)){let{type:w}=A.definition;if(w.length&&!w.some((b)=>hT(I,b)))GW($,`missing type "${w.join(",")}" for keyword "${D}"`)}}}function hT($,I){return $.includes(I)||I==="number"&&$.includes("integer")}function b3($,I){return $.includes(I)||I==="integer"&&$.includes("number")}function fT($,I){let U=[];for(let D of $.dataTypes)if(b3(I,D))U.push(D);else if(I.includes("integer")&&D==="number")U.push("integer");$.dataTypes=U}function GW($,I){let U=$.schemaEnv.baseId+$.errSchemaPath;I+=` at "${U}" (strictTypes)`,$4.checkStrictMode($,I,$.opts.strictTypes)}class QW{constructor($,I,U){if(MU.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=$4.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",O3(this.$data,$));else if(this.schemaCode=this.schemaValue,!MU.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",n.default.errors)}result($,I,U){this.failResult(u.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(u.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(u._`${I} !== undefined && (${u.or(this.invalid$data(),$)})`)}error($,I,U){if(I){this.setParams(I),this._error($,U),this.setParams({});return}this._error($,U)}_error($,I){($?zU.reportExtraError:zU.reportError)(this,this.def.error,I)}$dataError(){zU.reportError(this,this.def.$dataError||zU.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');zU.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=u.nil){this.gen.block(()=>{this.check$data($,U),I()})}check$data($=u.nil,I=u.nil){if(!this.$data)return;let{gen:U,schemaCode:D,schemaType:A,def:w}=this;if(U.if(u.or(u._`${D} === undefined`,I)),$!==u.nil)U.assign($,!0);if(A.length||w.validateSchema){if(U.elseIf(this.invalid$data()),this.$dataError(),$!==u.nil)U.assign($,!1)}U.else()}invalid$data(){let{gen:$,schemaCode:I,schemaType:U,def:D,it:A}=this;return u.or(w(),b());function w(){if(U.length){if(!(I instanceof u.Name))throw new Error("ajv implementation error");let N=Array.isArray(U)?U:[U];return u._`${MD.checkDataTypes(N,I,A.opts.strictNumbers,MD.DataType.Wrong)}`}return u.nil}function b(){if(D.validateSchema){let N=$.scopeValue("validate$data",{ref:D.validateSchema});return u._`!${N}(${I})`}return u.nil}}subschema($,I){let U=XW.getSubschema(this.it,$);XW.extendSubschemaData(U,this.it,$),XW.extendSubschemaMode(U,$);let D={...this.it,...U,items:void 0,props:void 0};return ET(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=$4.mergeEvaluated.props(D,$.props,U.props,I);if(U.items!==!0&&$.items!==void 0)U.items=$4.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($,u.Name)),!0}}X3.KeywordCxt=QW;function N3($,I,U,D){let A=new QW($,U,I);if("code"in U)U.code(A,D);else if(A.$data&&U.validate)MU.funcKeywordCode(A,U);else if("macro"in U)MU.macroKeywordCode(A,U);else if(U.compile||U.validate)MU.funcKeywordCode(A,U)}var yT=/^\/(?:[^~]|~0|~1)*$/,uT=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function O3($,{dataLevel:I,dataNames:U,dataPathArr:D}){let A,w;if($==="")return n.default.rootData;if($[0]==="/"){if(!yT.test($))throw new Error(`Invalid JSON-pointer: ${$}`);A=$,w=n.default.rootData}else{let X=uT.exec($);if(!X)throw new Error(`Invalid JSON-pointer: ${$}`);let W=+X[1];if(A=X[2],A==="#"){if(W>=I)throw new Error(O("property/index",W));return D[I-W]}if(W>I)throw new Error(O("data",W));if(w=U[I-W],!A)return w}let b=w,N=A.split("/");for(let X of N)if(X)w=u._`${w}${u.getProperty($4.unescapeJsonPointer(X))}`,b=u._`${b} && ${w}`;return b;function O(X,W){return`Cannot access ${X} ${W} levels up, current level is ${I}`}}X3.getData=O3});var KD=C((Q3)=>{Object.defineProperty(Q3,"__esModule",{value:!0});class G3 extends Error{constructor($){super("validation failed");this.errors=$,this.ajv=this.validation=!0}}Q3.default=G3});var VU=C((B3)=>{Object.defineProperty(B3,"__esModule",{value:!0});var YW=LU();class Y3 extends Error{constructor($,I,U,D){super(D||`can't resolve reference ${U} from id ${I}`);this.missingRef=YW.resolveUrl($,I,U),this.missingSchema=YW.normalizeId(YW.getFullPath($,this.missingRef))}}B3.default=Y3});var vD=C((L3)=>{Object.defineProperty(L3,"__esModule",{value:!0});L3.resolveSchema=L3.getCompilingSchema=L3.resolveRef=L3.compileSchema=L3.SchemaEnv=void 0;var j6=a(),iT=KD(),e4=s6(),k6=LU(),J3=N$(),nT=KU();class vU{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:k6.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={}}}L3.SchemaEnv=vU;function JW($){let I=H3.call(this,$);if(I)return I;let U=k6.getFullPath(this.opts.uriResolver,$.root.baseId),{es5:D,lines:A}=this.opts.code,{ownProperties:w}=this.opts,b=new j6.CodeGen(this.scope,{es5:D,lines:A,ownProperties:w}),N;if($.$async)N=b.scopeValue("Error",{ref:iT.default,code:j6._`require("ajv/dist/runtime/validation_error").default`});let O=b.scopeName("validate");$.validateName=O;let X={gen:b,allErrors:this.opts.allErrors,data:e4.default.data,parentData:e4.default.parentData,parentDataProperty:e4.default.parentDataProperty,dataNames:[e4.default.data],dataPathArr:[j6.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:b.scopeValue("schema",this.opts.code.source===!0?{ref:$.schema,code:j6.stringify($.schema)}:{ref:$.schema}),validateName:O,ValidationError:N,schema:$.schema,schemaEnv:$,rootId:U,baseId:$.baseId||U,schemaPath:j6.nil,errSchemaPath:$.schemaPath||(this.opts.jtd?"":"#"),errorPath:j6._`""`,opts:this.opts,self:this},W;try{this._compilations.add($),nT.validateFunctionCode(X),b.optimize(this.opts.code.optimize);let Q=b.toString();if(W=`${b.scopeRefs(e4.default.scope)}return ${Q}`,this.opts.code.process)W=this.opts.code.process(W,$);let Y=new Function(`${e4.default.self}`,`${e4.default.scope}`,W)(this,this.scope.get());if(this.scope.value(O,{ref:Y}),Y.errors=null,Y.schema=$.schema,Y.schemaEnv=$,$.$async)Y.$async=!0;if(this.opts.code.source===!0)Y.source={validateName:O,validateCode:Q,scopeValues:b._values};if(this.opts.unevaluated){let{props:J,items:H}=X;if(Y.evaluated={props:J instanceof j6.Name?void 0:J,items:H instanceof j6.Name?void 0:H,dynamicProps:J instanceof j6.Name,dynamicItems:H instanceof j6.Name},Y.source)Y.source.evaluated=j6.stringify(Y.evaluated)}return $.validate=Y,$}catch(Q){if(delete $.validate,delete $.validateName,W)this.logger.error("Error compiling schema, function code:",W);throw Q}finally{this._compilations.delete($)}}L3.compileSchema=JW;function oT($,I,U){var D;U=k6.resolveUrl(this.opts.uriResolver,I,U);let A=$.refs[U];if(A)return A;let w=tT.call(this,$,U);if(w===void 0){let b=(D=$.localRefs)===null||D===void 0?void 0:D[U],{schemaId:N}=this.opts;if(b)w=new vU({schema:b,schemaId:N,root:$,baseId:I})}if(w===void 0)return;return $.refs[U]=dT.call(this,w)}L3.resolveRef=oT;function dT($){if(k6.inlineRef($.schema,this.opts.inlineRefs))return $.schema;return $.validate?$:JW.call(this,$)}function H3($){for(let I of this._compilations)if(pT(I,$))return I}L3.getCompilingSchema=H3;function pT($,I){return $.schema===I.schema&&$.root===I.root&&$.baseId===I.baseId}function tT($,I){let U;while(typeof(U=this.refs[I])=="string")I=U;return U||this.schemas[I]||VD.call(this,$,I)}function VD($,I){let U=this.opts.uriResolver.parse(I),D=k6._getFullPath(this.opts.uriResolver,U),A=k6.getFullPath(this.opts.uriResolver,$.baseId,void 0);if(Object.keys($.schema).length>0&&D===A)return BW.call(this,U,$);let w=k6.normalizeId(D),b=this.refs[w]||this.schemas[w];if(typeof b=="string"){let N=VD.call(this,$,b);if(typeof(N===null||N===void 0?void 0:N.schema)!=="object")return;return BW.call(this,U,N)}if(typeof(b===null||b===void 0?void 0:b.schema)!=="object")return;if(!b.validate)JW.call(this,b);if(w===k6.normalizeId(I)){let{schema:N}=b,{schemaId:O}=this.opts,X=N[O];if(X)A=k6.resolveUrl(this.opts.uriResolver,A,X);return new vU({schema:N,schemaId:O,root:$,baseId:A})}return BW.call(this,U,b)}L3.resolveSchema=VD;var aT=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function BW($,{baseId:I,schema:U,root:D}){var A;if(((A=$.fragment)===null||A===void 0?void 0:A[0])!=="/")return;for(let N of $.fragment.slice(1).split("/")){if(typeof U==="boolean")return;let O=U[J3.unescapeFragment(N)];if(O===void 0)return;U=O;let X=typeof U==="object"&&U[this.opts.schemaId];if(!aT.has(N)&&X)I=k6.resolveUrl(this.opts.uriResolver,I,X)}let w;if(typeof U!="boolean"&&U.$ref&&!J3.schemaHasRulesButRef(U,this.RULES)){let N=k6.resolveUrl(this.opts.uriResolver,I,U.$ref);w=VD.call(this,D,N)}let{schemaId:b}=this.opts;if(w=w||new vU({schema:U,schemaId:b,root:D,baseId:I}),w.schema!==w.root.schema)return w;return}});var M3=C((Jo,U_)=>{U_.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 LW=C((Ho,q3)=>{var A_=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),V3=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 HW($){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 D_=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function K3($){return $.length=0,!0}function w_($,I,U){if($.length){let D=HW($);if(D!=="")I.push(D);else return U.error=!0,!1;$.length=0}return!0}function b_($){let I=0,U={error:!1,address:"",zone:""},D=[],A=[],w=!1,b=!1,N=w_;for(let O=0;O<$.length;O++){let X=$[O];if(X==="["||X==="]")continue;if(X===":"){if(w===!0)b=!0;if(!N(A,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(A,D,U))break;N=K3}else{A.push(X);continue}}if(A.length)if(N===K3)U.zone=A.join("");else if(b)D.push(A.join(""));else D.push(HW(A));return U.address=D.join(""),U}function v3($){if(N_($,":")<2)return{host:$,isIPV6:!1};let I=b_($);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 N_($,I){let U=0;for(let D=0;D<$.length;D++)if($[D]===I)U++;return U}function O_($){let I=$,U=[],D=-1,A=0;while(A=I.length){if(A===1)if(I===".")break;else if(I==="/"){U.push("/");break}else{U.push(I);break}else if(A===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(A===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 X_($,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 W_($){let I=[];if($.userinfo!==void 0)I.push($.userinfo),I.push("@");if($.host!==void 0){let U=unescape($.host);if(!V3(U)){let D=v3(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}q3.exports={nonSimpleDomain:D_,recomposeAuthority:W_,normalizeComponentEncoding:X_,removeDotSegments:O_,isIPv4:V3,isUUID:A_,normalizeIPv6:v3,stringArrayToHexStripped:HW}});var k3=C((Lo,j3)=>{var{isUUID:G_}=LW(),Q_=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,Y_=["http","https","ws","wss","urn","urn:uuid"];function B_($){return Y_.indexOf($)!==-1}function zW($){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 F3($){if(!$.host)$.error=$.error||"HTTP URIs must have a host.";return $}function E3($){let I=String($.scheme).toLowerCase()==="https";if($.port===(I?443:80)||$.port==="")$.port=void 0;if(!$.path)$.path="/";return $}function J_($){return $.secure=zW($),$.resourceName=($.path||"/")+($.query?"?"+$.query:""),$.path=void 0,$.query=void 0,$}function H_($){if($.port===(zW($)?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 L_($,I){if(!$.path)return $.error="URN can not be parsed",$;let U=$.path.match(Q_);if(U){let D=I.scheme||$.scheme||"urn";$.nid=U[1].toLowerCase(),$.nss=U[2];let A=`${D}:${I.nid||$.nid}`,w=MW(A);if($.path=void 0,w)$=w.parse($,I)}else $.error=$.error||"URN can not be parsed.";return $}function z_($,I){if($.nid===void 0)throw new Error("URN without nid cannot be serialized");let U=I.scheme||$.scheme||"urn",D=$.nid.toLowerCase(),A=`${U}:${I.nid||D}`,w=MW(A);if(w)$=w.serialize($,I);let b=$,N=$.nss;return b.path=`${D||I.nid}:${N}`,I.skipEscape=!0,b}function M_($,I){let U=$;if(U.uuid=U.nss,U.nss=void 0,!I.tolerant&&(!U.uuid||!G_(U.uuid)))U.error=U.error||"UUID is not valid.";return U}function K_($){let I=$;return I.nss=($.uuid||"").toLowerCase(),I}var S3={scheme:"http",domainHost:!0,parse:F3,serialize:E3},V_={scheme:"https",domainHost:S3.domainHost,parse:F3,serialize:E3},qD={scheme:"ws",domainHost:!0,parse:J_,serialize:H_},v_={scheme:"wss",domainHost:qD.domainHost,parse:qD.parse,serialize:qD.serialize},q_={scheme:"urn",parse:L_,serialize:z_,skipNormalize:!0},F_={scheme:"urn:uuid",parse:M_,serialize:K_,skipNormalize:!0},FD={http:S3,https:V_,ws:qD,wss:v_,urn:q_,"urn:uuid":F_};Object.setPrototypeOf(FD,null);function MW($){return $&&(FD[$]||FD[$.toLowerCase()])||void 0}j3.exports={wsIsSecure:zW,SCHEMES:FD,isValidSchemeName:B_,getSchemeHandler:MW}});var T3=C((zo,SD)=>{var{normalizeIPv6:E_,removeDotSegments:qU,recomposeAuthority:S_,normalizeComponentEncoding:ED,isIPv4:j_,nonSimpleDomain:k_}=LW(),{SCHEMES:P_,getSchemeHandler:P3}=k3();function R_($,I){if(typeof $==="string")$=f6(I4($,I),I);else if(typeof $==="object")$=I4(f6($,I),I);return $}function T_($,I,U){let D=U?Object.assign({scheme:"null"},U):{scheme:"null"},A=R3(I4($,D),I4(I,D),D,!0);return D.skipEscape=!0,f6(A,D)}function R3($,I,U,D){let A={};if(!D)$=I4(f6($,U),U),I=I4(f6(I,U),U);if(U=U||{},!U.tolerant&&I.scheme)A.scheme=I.scheme,A.userinfo=I.userinfo,A.host=I.host,A.port=I.port,A.path=qU(I.path||""),A.query=I.query;else{if(I.userinfo!==void 0||I.host!==void 0||I.port!==void 0)A.userinfo=I.userinfo,A.host=I.host,A.port=I.port,A.path=qU(I.path||""),A.query=I.query;else{if(!I.path)if(A.path=$.path,I.query!==void 0)A.query=I.query;else A.query=$.query;else{if(I.path[0]==="/")A.path=qU(I.path);else{if(($.userinfo!==void 0||$.host!==void 0||$.port!==void 0)&&!$.path)A.path="/"+I.path;else if(!$.path)A.path=I.path;else A.path=$.path.slice(0,$.path.lastIndexOf("/")+1)+I.path;A.path=qU(A.path)}A.query=I.query}A.userinfo=$.userinfo,A.host=$.host,A.port=$.port}A.scheme=$.scheme}return A.fragment=I.fragment,A}function __($,I,U){if(typeof $==="string")$=unescape($),$=f6(ED(I4($,U),!0),{...U,skipEscape:!0});else if(typeof $==="object")$=f6(ED($,!0),{...U,skipEscape:!0});if(typeof I==="string")I=unescape(I),I=f6(ED(I4(I,U),!0),{...U,skipEscape:!0});else if(typeof I==="object")I=f6(ED(I,!0),{...U,skipEscape:!0});return $.toLowerCase()===I.toLowerCase()}function f6($,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),A=[],w=P3(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)A.push(U.scheme,":");let b=S_(U);if(b!==void 0){if(D.reference!=="suffix")A.push("//");if(A.push(b),U.path&&U.path[0]!=="/")A.push("/")}if(U.path!==void 0){let N=U.path;if(!D.absolutePath&&(!w||!w.absolutePath))N=qU(N);if(b===void 0&&N[0]==="/"&&N[1]==="/")N="/%2F"+N.slice(2);A.push(N)}if(U.query!==void 0)A.push("?",U.query);if(U.fragment!==void 0)A.push("#",U.fragment);return A.join("")}var C_=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function I4($,I){let U=Object.assign({},I),D={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},A=!1;if(U.reference==="suffix")if(U.scheme)$=U.scheme+":"+$;else $="//"+$;let w=$.match(C_);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(j_(D.host)===!1){let O=E_(D.host);D.host=O.host.toLowerCase(),A=O.isIPV6}else A=!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 b=P3(U.scheme||D.scheme);if(!U.unicodeSupport&&(!b||!b.unicodeSupport)){if(D.host&&(U.domainHost||b&&b.domainHost)&&A===!1&&k_(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(!b||b&&!b.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(b&&b.parse)b.parse(D,U)}else D.error=D.error||"URI can not be parsed.";return D}var KW={SCHEMES:P_,normalize:R_,resolve:T_,resolveComponent:R3,equal:__,serialize:f6,parse:I4};SD.exports=KW;SD.exports.default=KW;SD.exports.fastUri=KW});var Z3=C((C3)=>{Object.defineProperty(C3,"__esModule",{value:!0});var _3=T3();_3.code='require("ajv/dist/runtime/uri").default';C3.default=_3});var c3=C((U4)=>{Object.defineProperty(U4,"__esModule",{value:!0});U4.CodeGen=U4.Name=U4.nil=U4.stringify=U4.str=U4._=U4.KeywordCxt=void 0;var g_=KU();Object.defineProperty(U4,"KeywordCxt",{enumerable:!0,get:function(){return g_.KeywordCxt}});var gI=a();Object.defineProperty(U4,"_",{enumerable:!0,get:function(){return gI._}});Object.defineProperty(U4,"str",{enumerable:!0,get:function(){return gI.str}});Object.defineProperty(U4,"stringify",{enumerable:!0,get:function(){return gI.stringify}});Object.defineProperty(U4,"nil",{enumerable:!0,get:function(){return gI.nil}});Object.defineProperty(U4,"Name",{enumerable:!0,get:function(){return gI.Name}});Object.defineProperty(U4,"CodeGen",{enumerable:!0,get:function(){return gI.CodeGen}});var x_=KD(),y3=VU(),h_=sX(),FU=vD(),f_=a(),EU=LU(),jD=HU(),vW=N$(),g3=M3(),y_=Z3(),u3=($,I)=>new RegExp($,I);u3.code="new RegExp";var u_=["removeAdditional","useDefaults","coerceTypes"],l_=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),c_={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."},m_={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},x3=200;function r_($){var I,U,D,A,w,b,N,O,X,W,Q,B,Y,J,H,v,V,F,k,h,l,l$,G6,BI,ab;let k1=$.strict,eb=(I=$.code)===null||I===void 0?void 0:I.optimize,C5=eb===!0||eb===void 0?1:eb||0,Z5=(D=(U=$.code)===null||U===void 0?void 0:U.regExp)!==null&&D!==void 0?D:u3,IE=(A=$.uriResolver)!==null&&A!==void 0?A:y_.default;return{strictSchema:(b=(w=$.strictSchema)!==null&&w!==void 0?w:k1)!==null&&b!==void 0?b:!0,strictNumbers:(O=(N=$.strictNumbers)!==null&&N!==void 0?N:k1)!==null&&O!==void 0?O:!0,strictTypes:(W=(X=$.strictTypes)!==null&&X!==void 0?X:k1)!==null&&W!==void 0?W:"log",strictTuples:(B=(Q=$.strictTuples)!==null&&Q!==void 0?Q:k1)!==null&&B!==void 0?B:"log",strictRequired:(J=(Y=$.strictRequired)!==null&&Y!==void 0?Y:k1)!==null&&J!==void 0?J:!1,code:$.code?{...$.code,optimize:C5,regExp:Z5}:{optimize:C5,regExp:Z5},loopRequired:(H=$.loopRequired)!==null&&H!==void 0?H:x3,loopEnum:(v=$.loopEnum)!==null&&v!==void 0?v:x3,meta:(V=$.meta)!==null&&V!==void 0?V:!0,messages:(F=$.messages)!==null&&F!==void 0?F:!0,inlineRefs:(k=$.inlineRefs)!==null&&k!==void 0?k:!0,schemaId:(h=$.schemaId)!==null&&h!==void 0?h:"$id",addUsedSchema:(l=$.addUsedSchema)!==null&&l!==void 0?l:!0,validateSchema:(l$=$.validateSchema)!==null&&l$!==void 0?l$:!0,validateFormats:(G6=$.validateFormats)!==null&&G6!==void 0?G6:!0,unicodeRegExp:(BI=$.unicodeRegExp)!==null&&BI!==void 0?BI:!0,int32range:(ab=$.int32range)!==null&&ab!==void 0?ab:!0,uriResolver:IE}}class kD{constructor($={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,$=this.opts={...$,...r_($)};let{es5:I,lines:U}=this.opts.code;this.scope=new f_.ValueScope({scope:{},prefixes:l_,es5:I,lines:U}),this.logger=t_($.logger);let D=$.validateFormats;if($.validateFormats=!1,this.RULES=h_.getRules(),h3.call(this,c_,$,"NOT SUPPORTED"),h3.call(this,m_,$,"DEPRECATED","warn"),this._metaOpts=d_.call(this),$.formats)n_.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),$.keywords)o_.call(this,$.keywords);if(typeof $.meta=="object")this.addMetaSchema($.meta);i_.call(this),$.validateFormats=D}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:$,meta:I,schemaId:U}=this.opts,D=g3;if(U==="id")D={...g3},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,W){await A.call(this,X.$schema);let Q=this._addSchema(X,W);return Q.validate||w.call(this,Q)}async function A(X){if(X&&!this.getSchema(X))await D.call(this,{$ref:X},!0)}async function w(X){try{return this._compileSchemaEnv(X)}catch(W){if(!(W instanceof y3.default))throw W;return b.call(this,W),await N.call(this,W.missingSchema),w.call(this,X)}}function b({missingSchema:X,missingRef:W}){if(this.refs[X])throw new Error(`AnySchema ${X} is loaded but ${W} cannot be resolved`)}async function N(X){let W=await O.call(this,X);if(!this.refs[X])await A.call(this,W.$schema);if(!this.refs[X])this.addSchema(W,X,I)}async function O(X){let W=this._loading[X];if(W)return W;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 A;if(typeof $==="object"){let{schemaId:w}=this.opts;if(A=$[w],A!==void 0&&typeof A!="string")throw new Error(`schema ${w} must be string`)}return I=EU.normalizeId(I||A),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 A="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(A);else throw new Error(A)}return D}getSchema($){let I;while(typeof(I=f3.call(this,$))=="string")$=I;if(I===void 0){let{schemaId:U}=this.opts,D=new FU.SchemaEnv({schema:{},schemaId:U});if(I=FU.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=f3.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=EU.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(e_.call(this,U,I),!I)return vW.eachItem(U,(A)=>VW.call(this,A)),this;$C.call(this,I);let D={...I,type:jD.getJSONTypes(I.type),schemaType:jD.getJSONTypes(I.schemaType)};return vW.eachItem(U,D.type.length===0?(A)=>VW.call(this,A,D):(A)=>D.type.forEach((w)=>VW.call(this,A,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((A)=>A.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,A)=>D+I+A)}$dataMetaSchema($,I){let U=this.RULES.all;$=JSON.parse(JSON.stringify($));for(let D of I){let A=D.split("/").slice(1),w=$;for(let b of A)w=w[b];for(let b in U){let N=U[b];if(typeof N!="object")continue;let{$data:O}=N.definition,X=w[b];if(O&&X)w[b]=l3(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,A=this.opts.addUsedSchema){let w,{schemaId:b}=this.opts;if(typeof $=="object")w=$[b];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=EU.normalizeId(w||U);let O=EU.getSchemaRefs.call(this,$,U);if(N=new FU.SchemaEnv({schema:$,schemaId:b,meta:I,baseId:U,localRefs:O}),this._cache.set(N.schema,N),A&&!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 FU.compileSchema.call(this,$);if(!$.validate)throw new Error("ajv implementation error");return $.validate}_compileMetaSchema($){let I=this.opts;this.opts=this._metaOpts;try{FU.compileSchema.call(this,$)}finally{this.opts=I}}}kD.ValidationError=x_.default;kD.MissingRefError=y3.default;U4.default=kD;function h3($,I,U,D="error"){for(let A in $){let w=A;if(w in I)this.logger[D](`${U}: option ${A}. ${$[w]}`)}}function f3($){return $=EU.normalizeId($),this.schemas[$]||this.refs[$]}function i_(){let $=this.opts.schemas;if(!$)return;if(Array.isArray($))this.addSchema($);else for(let I in $)this.addSchema($[I],I)}function n_(){for(let $ in this.opts.formats){let I=this.opts.formats[$];if(I)this.addFormat($,I)}}function o_($){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 d_(){let $={...this.opts};for(let I of u_)delete $[I];return $}var p_={log(){},warn(){},error(){}};function t_($){if($===!1)return p_;if($===void 0)return console;if($.log&&$.warn&&$.error)return $;throw new Error("logger must implement log, warn and error methods")}var a_=/^[a-z_$][a-z0-9_$:-]*$/i;function e_($,I){let{RULES:U}=this;if(vW.eachItem($,(D)=>{if(U.keywords[D])throw new Error(`Keyword ${D} is already defined`);if(!a_.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 VW($,I,U){var D;let A=I===null||I===void 0?void 0:I.post;if(U&&A)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:w}=this,b=A?w.post:w.rules.find(({type:O})=>O===U);if(!b)b={type:U,rules:[]},w.rules.push(b);if(w.keywords[$]=!0,!I)return;let N={keyword:$,definition:{...I,type:jD.getJSONTypes(I.type),schemaType:jD.getJSONTypes(I.schemaType)}};if(I.before)s_.call(this,b,N,I.before);else b.rules.push(N);w.all[$]=N,(D=I.implements)===null||D===void 0||D.forEach((O)=>this.addKeyword(O))}function s_($,I,U){let D=$.rules.findIndex((A)=>A.keyword===U);if(D>=0)$.rules.splice(D,0,I);else $.rules.push(I),this.logger.warn(`rule ${U} is not defined`)}function $C($){let{metaSchema:I}=$;if(I===void 0)return;if($.$data&&this.opts.$data)I=l3(I);$.validateSchema=this.compile(I,!0)}var IC={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function l3($){return{anyOf:[$,IC]}}});var r3=C((m3)=>{Object.defineProperty(m3,"__esModule",{value:!0});var DC={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};m3.default=DC});var t3=C((d3)=>{Object.defineProperty(d3,"__esModule",{value:!0});d3.callRef=d3.getValidate=void 0;var bC=VU(),i3=H6(),$6=a(),xI=s6(),n3=vD(),PD=N$(),NC={keyword:"$ref",schemaType:"string",code($){let{gen:I,schema:U,it:D}=$,{baseId:A,schemaEnv:w,validateName:b,opts:N,self:O}=D,{root:X}=w;if((U==="#"||U==="#/")&&A===X.baseId)return Q();let W=n3.resolveRef.call(O,X,A,U);if(W===void 0)throw new bC.default(D.opts.uriResolver,A,U);if(W instanceof n3.SchemaEnv)return B(W);return Y(W);function Q(){if(w===X)return RD($,b,w,w.$async);let J=I.scopeValue("root",{ref:X});return RD($,$6._`${J}.validate`,X,X.$async)}function B(J){let H=o3($,J);RD($,H,J,J.$async)}function Y(J){let H=I.scopeValue("schema",N.code.source===!0?{ref:J,code:$6.stringify(J)}:{ref:J}),v=I.name("valid"),V=$.subschema({schema:J,dataTypes:[],schemaPath:$6.nil,topSchemaRef:H,errSchemaPath:U},v);$.mergeEvaluated(V),$.ok(v)}}};function o3($,I){let{gen:U}=$;return I.validate?U.scopeValue("validate",{ref:I.validate}):$6._`${U.scopeValue("wrapper",{ref:I})}.validate`}d3.getValidate=o3;function RD($,I,U,D){let{gen:A,it:w}=$,{allErrors:b,schemaEnv:N,opts:O}=w,X=O.passContext?xI.default.this:$6.nil;if(D)W();else Q();function W(){if(!N.$async)throw new Error("async schema referenced by sync schema");let J=A.let("valid");A.try(()=>{if(A.code($6._`await ${i3.callValidateCode($,I,X)}`),Y(I),!b)A.assign(J,!0)},(H)=>{if(A.if($6._`!(${H} instanceof ${w.ValidationError})`,()=>A.throw(H)),B(H),!b)A.assign(J,!1)}),$.ok(J)}function Q(){$.result(i3.callValidateCode($,I,X),()=>Y(I),()=>B(I))}function B(J){let H=$6._`${J}.errors`;A.assign(xI.default.vErrors,$6._`${xI.default.vErrors} === null ? ${H} : ${xI.default.vErrors}.concat(${H})`),A.assign(xI.default.errors,$6._`${xI.default.vErrors}.length`)}function Y(J){var H;if(!w.opts.unevaluated)return;let v=(H=U===null||U===void 0?void 0:U.validate)===null||H===void 0?void 0:H.evaluated;if(w.props!==!0)if(v&&!v.dynamicProps){if(v.props!==void 0)w.props=PD.mergeEvaluated.props(A,v.props,w.props)}else{let V=A.var("props",$6._`${J}.evaluated.props`);w.props=PD.mergeEvaluated.props(A,V,w.props,$6.Name)}if(w.items!==!0)if(v&&!v.dynamicItems){if(v.items!==void 0)w.items=PD.mergeEvaluated.items(A,v.items,w.items)}else{let V=A.var("items",$6._`${J}.evaluated.items`);w.items=PD.mergeEvaluated.items(A,V,w.items,$6.Name)}}}d3.callRef=RD;d3.default=NC});var e3=C((a3)=>{Object.defineProperty(a3,"__esModule",{value:!0});var WC=r3(),GC=t3(),QC=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",WC.default,GC.default];a3.default=QC});var $M=C((s3)=>{Object.defineProperty(s3,"__esModule",{value:!0});var TD=a(),v4=TD.operators,_D={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}},BC={message:({keyword:$,schemaCode:I})=>TD.str`must be ${_D[$].okStr} ${I}`,params:({keyword:$,schemaCode:I})=>TD._`{comparison: ${_D[$].okStr}, limit: ${I}}`},JC={keyword:Object.keys(_D),type:"number",schemaType:"number",$data:!0,error:BC,code($){let{keyword:I,data:U,schemaCode:D}=$;$.fail$data(TD._`${U} ${_D[I].fail} ${D} || isNaN(${U})`)}};s3.default=JC});var UM=C((IM)=>{Object.defineProperty(IM,"__esModule",{value:!0});var SU=a(),LC={message:({schemaCode:$})=>SU.str`must be multiple of ${$}`,params:({schemaCode:$})=>SU._`{multipleOf: ${$}}`},zC={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:LC,code($){let{gen:I,data:U,schemaCode:D,it:A}=$,w=A.opts.multipleOfPrecision,b=I.let("res"),N=w?SU._`Math.abs(Math.round(${b}) - ${b}) > 1e-${w}`:SU._`${b} !== parseInt(${b})`;$.fail$data(SU._`(${D} === 0 || (${b} = ${U}/${D}, ${N}))`)}};IM.default=zC});var wM=C((DM)=>{Object.defineProperty(DM,"__esModule",{value:!0});function AM($){let I=$.length,U=0,D=0,A;while(D<I)if(U++,A=$.charCodeAt(D++),A>=55296&&A<=56319&&D<I){if(A=$.charCodeAt(D),(A&64512)===56320)D++}return U}DM.default=AM;AM.code='require("ajv/dist/runtime/ucs2length").default'});var NM=C((bM)=>{Object.defineProperty(bM,"__esModule",{value:!0});var s4=a(),VC=N$(),vC=wM(),qC={message({keyword:$,schemaCode:I}){let U=$==="maxLength"?"more":"fewer";return s4.str`must NOT have ${U} than ${I} characters`},params:({schemaCode:$})=>s4._`{limit: ${$}}`},FC={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:qC,code($){let{keyword:I,data:U,schemaCode:D,it:A}=$,w=I==="maxLength"?s4.operators.GT:s4.operators.LT,b=A.opts.unicode===!1?s4._`${U}.length`:s4._`${VC.useFunc($.gen,vC.default)}(${U})`;$.fail$data(s4._`${b} ${w} ${D}`)}};bM.default=FC});var XM=C((OM)=>{Object.defineProperty(OM,"__esModule",{value:!0});var SC=H6(),CD=a(),jC={message:({schemaCode:$})=>CD.str`must match pattern "${$}"`,params:({schemaCode:$})=>CD._`{pattern: ${$}}`},kC={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:jC,code($){let{data:I,$data:U,schema:D,schemaCode:A,it:w}=$,b=w.opts.unicodeRegExp?"u":"",N=U?CD._`(new RegExp(${A}, ${b}))`:SC.usePattern($,D);$.fail$data(CD._`!${N}.test(${I})`)}};OM.default=kC});var GM=C((WM)=>{Object.defineProperty(WM,"__esModule",{value:!0});var jU=a(),RC={message({keyword:$,schemaCode:I}){let U=$==="maxProperties"?"more":"fewer";return jU.str`must NOT have ${U} than ${I} properties`},params:({schemaCode:$})=>jU._`{limit: ${$}}`},TC={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:RC,code($){let{keyword:I,data:U,schemaCode:D}=$,A=I==="maxProperties"?jU.operators.GT:jU.operators.LT;$.fail$data(jU._`Object.keys(${U}).length ${A} ${D}`)}};WM.default=TC});var YM=C((QM)=>{Object.defineProperty(QM,"__esModule",{value:!0});var kU=H6(),PU=a(),CC=N$(),ZC={message:({params:{missingProperty:$}})=>PU.str`must have required property '${$}'`,params:({params:{missingProperty:$}})=>PU._`{missingProperty: ${$}}`},gC={keyword:"required",type:"object",schemaType:"array",$data:!0,error:ZC,code($){let{gen:I,schema:U,schemaCode:D,data:A,$data:w,it:b}=$,{opts:N}=b;if(!w&&U.length===0)return;let O=U.length>=N.loopRequired;if(b.allErrors)X();else W();if(N.strictRequired){let Y=$.parentSchema.properties,{definedProperties:J}=$.it;for(let H of U)if((Y===null||Y===void 0?void 0:Y[H])===void 0&&!J.has(H)){let v=b.schemaEnv.baseId+b.errSchemaPath,V=`required property "${H}" is not defined at "${v}" (strictRequired)`;CC.checkStrictMode(b,V,b.opts.strictRequired)}}function X(){if(O||w)$.block$data(PU.nil,Q);else for(let Y of U)kU.checkReportMissingProp($,Y)}function W(){let Y=I.let("missing");if(O||w){let J=I.let("valid",!0);$.block$data(J,()=>B(Y,J)),$.ok(J)}else I.if(kU.checkMissingProp($,U,Y)),kU.reportMissingProp($,Y),I.else()}function Q(){I.forOf("prop",D,(Y)=>{$.setParams({missingProperty:Y}),I.if(kU.noPropertyInData(I,A,Y,N.ownProperties),()=>$.error())})}function B(Y,J){$.setParams({missingProperty:Y}),I.forOf(Y,D,()=>{I.assign(J,kU.propertyInData(I,A,Y,N.ownProperties)),I.if(PU.not(J),()=>{$.error(),I.break()})},PU.nil)}}};QM.default=gC});var JM=C((BM)=>{Object.defineProperty(BM,"__esModule",{value:!0});var RU=a(),hC={message({keyword:$,schemaCode:I}){let U=$==="maxItems"?"more":"fewer";return RU.str`must NOT have ${U} than ${I} items`},params:({schemaCode:$})=>RU._`{limit: ${$}}`},fC={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:hC,code($){let{keyword:I,data:U,schemaCode:D}=$,A=I==="maxItems"?RU.operators.GT:RU.operators.LT;$.fail$data(RU._`${U}.length ${A} ${D}`)}};BM.default=fC});var ZD=C((LM)=>{Object.defineProperty(LM,"__esModule",{value:!0});var HM=NW();HM.code='require("ajv/dist/runtime/equal").default';LM.default=HM});var MM=C((zM)=>{Object.defineProperty(zM,"__esModule",{value:!0});var qW=HU(),h$=a(),lC=N$(),cC=ZD(),mC={message:({params:{i:$,j:I}})=>h$.str`must NOT have duplicate items (items ## ${I} and ${$} are identical)`,params:({params:{i:$,j:I}})=>h$._`{i: ${$}, j: ${I}}`},rC={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:mC,code($){let{gen:I,data:U,$data:D,schema:A,parentSchema:w,schemaCode:b,it:N}=$;if(!D&&!A)return;let O=I.let("valid"),X=w.items?qW.getSchemaTypes(w.items):[];$.block$data(O,W,h$._`${b} === false`),$.ok(O);function W(){let J=I.let("i",h$._`${U}.length`),H=I.let("j");$.setParams({i:J,j:H}),I.assign(O,!0),I.if(h$._`${J} > 1`,()=>(Q()?B:Y)(J,H))}function Q(){return X.length>0&&!X.some((J)=>J==="object"||J==="array")}function B(J,H){let v=I.name("item"),V=qW.checkDataTypes(X,v,N.opts.strictNumbers,qW.DataType.Wrong),F=I.const("indices",h$._`{}`);I.for(h$._`;${J}--;`,()=>{if(I.let(v,h$._`${U}[${J}]`),I.if(V,h$._`continue`),X.length>1)I.if(h$._`typeof ${v} == "string"`,h$._`${v} += "_"`);I.if(h$._`typeof ${F}[${v}] == "number"`,()=>{I.assign(H,h$._`${F}[${v}]`),$.error(),I.assign(O,!1).break()}).code(h$._`${F}[${v}] = ${J}`)})}function Y(J,H){let v=lC.useFunc(I,cC.default),V=I.name("outer");I.label(V).for(h$._`;${J}--;`,()=>I.for(h$._`${H} = ${J}; ${H}--;`,()=>I.if(h$._`${v}(${U}[${J}], ${U}[${H}])`,()=>{$.error(),I.assign(O,!1).break(V)})))}}};zM.default=rC});var VM=C((KM)=>{Object.defineProperty(KM,"__esModule",{value:!0});var FW=a(),nC=N$(),oC=ZD(),dC={message:"must be equal to constant",params:({schemaCode:$})=>FW._`{allowedValue: ${$}}`},pC={keyword:"const",$data:!0,error:dC,code($){let{gen:I,data:U,$data:D,schemaCode:A,schema:w}=$;if(D||w&&typeof w=="object")$.fail$data(FW._`!${nC.useFunc(I,oC.default)}(${U}, ${A})`);else $.fail(FW._`${w} !== ${U}`)}};KM.default=pC});var qM=C((vM)=>{Object.defineProperty(vM,"__esModule",{value:!0});var TU=a(),aC=N$(),eC=ZD(),sC={message:"must be equal to one of the allowed values",params:({schemaCode:$})=>TU._`{allowedValues: ${$}}`},$Z={keyword:"enum",schemaType:"array",$data:!0,error:sC,code($){let{gen:I,data:U,$data:D,schema:A,schemaCode:w,it:b}=$;if(!D&&A.length===0)throw new Error("enum must have non-empty array");let N=A.length>=b.opts.loopEnum,O,X=()=>O!==null&&O!==void 0?O:O=aC.useFunc(I,eC.default),W;if(N||D)W=I.let("valid"),$.block$data(W,Q);else{if(!Array.isArray(A))throw new Error("ajv implementation error");let Y=I.const("vSchema",w);W=TU.or(...A.map((J,H)=>B(Y,H)))}$.pass(W);function Q(){I.assign(W,!1),I.forOf("v",w,(Y)=>I.if(TU._`${X()}(${U}, ${Y})`,()=>I.assign(W,!0).break()))}function B(Y,J){let H=A[J];return typeof H==="object"&&H!==null?TU._`${X()}(${U}, ${Y}[${J}])`:TU._`${U} === ${H}`}}};vM.default=$Z});var EM=C((FM)=>{Object.defineProperty(FM,"__esModule",{value:!0});var UZ=$M(),AZ=UM(),DZ=NM(),wZ=XM(),bZ=GM(),NZ=YM(),OZ=JM(),XZ=MM(),WZ=VM(),GZ=qM(),QZ=[UZ.default,AZ.default,DZ.default,wZ.default,bZ.default,NZ.default,OZ.default,XZ.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},WZ.default,GZ.default];FM.default=QZ});var SW=C((jM)=>{Object.defineProperty(jM,"__esModule",{value:!0});jM.validateAdditionalItems=void 0;var $I=a(),EW=N$(),BZ={message:({params:{len:$}})=>$I.str`must NOT have more than ${$} items`,params:({params:{len:$}})=>$I._`{limit: ${$}}`},JZ={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:BZ,code($){let{parentSchema:I,it:U}=$,{items:D}=I;if(!Array.isArray(D)){EW.checkStrictMode(U,'"additionalItems" is ignored when "items" is not an array of schemas');return}SM($,D)}};function SM($,I){let{gen:U,schema:D,data:A,keyword:w,it:b}=$;b.items=!0;let N=U.const("len",$I._`${A}.length`);if(D===!1)$.setParams({len:I.length}),$.pass($I._`${N} <= ${I.length}`);else if(typeof D=="object"&&!EW.alwaysValidSchema(b,D)){let X=U.var("valid",$I._`${N} <= ${I.length}`);U.if($I.not(X),()=>O(X)),$.ok(X)}function O(X){U.forRange("i",I.length,N,(W)=>{if($.subschema({keyword:w,dataProp:W,dataPropType:EW.Type.Num},X),!b.allErrors)U.if($I.not(X),()=>U.break())})}}jM.validateAdditionalItems=SM;jM.default=JZ});var jW=C((TM)=>{Object.defineProperty(TM,"__esModule",{value:!0});TM.validateTuple=void 0;var PM=a(),gD=N$(),LZ=H6(),zZ={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code($){let{schema:I,it:U}=$;if(Array.isArray(I))return RM($,"additionalItems",I);if(U.items=!0,gD.alwaysValidSchema(U,I))return;$.ok(LZ.validateArray($))}};function RM($,I,U=$.schema){let{gen:D,parentSchema:A,data:w,keyword:b,it:N}=$;if(W(A),N.opts.unevaluated&&U.length&&N.items!==!0)N.items=gD.mergeEvaluated.items(D,U.length,N.items);let O=D.name("valid"),X=D.const("len",PM._`${w}.length`);U.forEach((Q,B)=>{if(gD.alwaysValidSchema(N,Q))return;D.if(PM._`${X} > ${B}`,()=>$.subschema({keyword:b,schemaProp:B,dataProp:B},O)),$.ok(O)});function W(Q){let{opts:B,errSchemaPath:Y}=N,J=U.length,H=J===Q.minItems&&(J===Q.maxItems||Q[I]===!1);if(B.strictTuples&&!H){let v=`"${b}" is ${J}-tuple, but minItems or maxItems/${I} are not specified or different at path "${Y}"`;gD.checkStrictMode(N,v,B.strictTuples)}}}TM.validateTuple=RM;TM.default=zZ});var ZM=C((CM)=>{Object.defineProperty(CM,"__esModule",{value:!0});var KZ=jW(),VZ={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:($)=>KZ.validateTuple($,"items")};CM.default=VZ});var hM=C((xM)=>{Object.defineProperty(xM,"__esModule",{value:!0});var gM=a(),qZ=N$(),FZ=H6(),EZ=SW(),SZ={message:({params:{len:$}})=>gM.str`must NOT have more than ${$} items`,params:({params:{len:$}})=>gM._`{limit: ${$}}`},jZ={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:SZ,code($){let{schema:I,parentSchema:U,it:D}=$,{prefixItems:A}=U;if(D.items=!0,qZ.alwaysValidSchema(D,I))return;if(A)EZ.validateAdditionalItems($,A);else $.ok(FZ.validateArray($))}};xM.default=jZ});var yM=C((fM)=>{Object.defineProperty(fM,"__esModule",{value:!0});var L6=a(),xD=N$(),PZ={message:({params:{min:$,max:I}})=>I===void 0?L6.str`must contain at least ${$} valid item(s)`:L6.str`must contain at least ${$} and no more than ${I} valid item(s)`,params:({params:{min:$,max:I}})=>I===void 0?L6._`{minContains: ${$}}`:L6._`{minContains: ${$}, maxContains: ${I}}`},RZ={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:PZ,code($){let{gen:I,schema:U,parentSchema:D,data:A,it:w}=$,b,N,{minContains:O,maxContains:X}=D;if(w.opts.next)b=O===void 0?1:O,N=X;else b=1;let W=I.const("len",L6._`${A}.length`);if($.setParams({min:b,max:N}),N===void 0&&b===0){xD.checkStrictMode(w,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(N!==void 0&&b>N){xD.checkStrictMode(w,'"minContains" > "maxContains" is always invalid'),$.fail();return}if(xD.alwaysValidSchema(w,U)){let H=L6._`${W} >= ${b}`;if(N!==void 0)H=L6._`${H} && ${W} <= ${N}`;$.pass(H);return}w.items=!0;let Q=I.name("valid");if(N===void 0&&b===1)Y(Q,()=>I.if(Q,()=>I.break()));else if(b===0){if(I.let(Q,!0),N!==void 0)I.if(L6._`${A}.length > 0`,B)}else I.let(Q,!1),B();$.result(Q,()=>$.reset());function B(){let H=I.name("_valid"),v=I.let("count",0);Y(H,()=>I.if(H,()=>J(v)))}function Y(H,v){I.forRange("i",0,W,(V)=>{$.subschema({keyword:"contains",dataProp:V,dataPropType:xD.Type.Num,compositeRule:!0},H),v()})}function J(H){if(I.code(L6._`${H}++`),N===void 0)I.if(L6._`${H} >= ${b}`,()=>I.assign(Q,!0).break());else if(I.if(L6._`${H} > ${N}`,()=>I.assign(Q,!1).break()),b===1)I.assign(Q,!0);else I.if(L6._`${H} >= ${b}`,()=>I.assign(Q,!0))}}};fM.default=RZ});var iM=C((cM)=>{Object.defineProperty(cM,"__esModule",{value:!0});cM.validateSchemaDeps=cM.validatePropertyDeps=cM.error=void 0;var kW=a(),_Z=N$(),_U=H6();cM.error={message:({params:{property:$,depsCount:I,deps:U}})=>{let D=I===1?"property":"properties";return kW.str`must have ${D} ${U} when property ${$} is present`},params:({params:{property:$,depsCount:I,deps:U,missingProperty:D}})=>kW._`{property: ${$},
2
+ var YM=Object.create;var{getPrototypeOf:BM,defineProperty:TO,getOwnPropertyNames:vM}=Object;var JM=Object.prototype.hasOwnProperty;var qY=($,I,U)=>{U=$!=null?YM(BM($)):{};let D=I||!$||!$.__esModule?TO(U,"default",{value:$,enumerable:!0}):U;for(let b of vM($))if(!JM.call(D,b))TO(D,b,{get:()=>$[b],enumerable:!0});return D};var R=($,I)=>()=>(I||$((I={exports:{}}).exports,I),I.exports);var C6=($,I)=>{for(var U in I)TO($,U,{get:I[U],enumerable:!0,configurable:!0,set:(D)=>I[U]=()=>D})};var uU=R((_v)=>{Object.defineProperty(_v,"__esModule",{value:!0});_v.regexpCode=_v.getEsmExportName=_v.getProperty=_v.safeStringify=_v.stringify=_v.strConcat=_v.addCodeArg=_v.str=_v._=_v.nil=_v._Code=_v.Name=_v.IDENTIFIER=_v._CodeOrName=void 0;class vw{}_v._CodeOrName=vw;_v.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class cI extends vw{constructor($){super();if(!_v.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}}}_v.Name=cI;class W6 extends vw{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},{})}}_v._Code=W6;_v.nil=new W6("");function Rv($,...I){let U=[$[0]],D=0;while(D<I.length)H9(U,I[D]),U.push($[++D]);return new W6(U)}_v._=Rv;var J9=new W6("+");function Tv($,...I){let U=[hU($[0])],D=0;while(D<I.length)U.push(J9),H9(U,I[D]),U.push(J9,hU($[++D]));return Xk(U),new W6(U)}_v.str=Tv;function H9($,I){if(I instanceof W6)$.push(...I._items);else if(I instanceof cI)$.push(I);else $.push(Qk(I))}_v.addCodeArg=H9;function Xk($){let I=1;while(I<$.length-1){if($[I]===J9){let U=Wk($[I-1],$[I+1]);if(U!==void 0){$.splice(I-1,3,U);continue}$[I++]="+"}I++}}function Wk($,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 Gk($,I){return I.emptyStr()?$:$.emptyStr()?I:Tv`${$}${I}`}_v.strConcat=Gk;function Qk($){return typeof $=="number"||typeof $=="boolean"||$===null?$:hU(Array.isArray($)?$.join(","):$)}function Yk($){return new W6(hU($))}_v.stringify=Yk;function hU($){return JSON.stringify($).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}_v.safeStringify=hU;function Bk($){return typeof $=="string"&&_v.IDENTIFIER.test($)?new W6(`.${$}`):Rv`[${$}]`}_v.getProperty=Bk;function vk($){if(typeof $=="string"&&_v.IDENTIFIER.test($))return new W6(`${$}`);throw new Error(`CodeGen: invalid export name: ${$}, use explicit $id name mapping`)}_v.getEsmExportName=vk;function Jk($){return new W6($.toString())}_v.regexpCode=Jk});var V9=R((gv)=>{Object.defineProperty(gv,"__esModule",{value:!0});gv.ValueScope=gv.ValueScopeName=gv.Scope=gv.varKinds=gv.UsedValueState=void 0;var r$=uU();class Zv extends Error{constructor($){super(`CodeGen: "code" for ${$} not defined`);this.value=$.value}}var Hw;(function($){$[$.Started=0]="Started",$[$.Completed=1]="Completed"})(Hw||(gv.UsedValueState=Hw={}));gv.varKinds={const:new r$.Name("const"),let:new r$.Name("let"),var:new r$.Name("var")};class z9{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}}}gv.Scope=z9;class M9 extends r$.Name{constructor($,I){super(I);this.prefix=$}setValue($,{property:I,itemIndex:U}){this.value=$,this.scopePath=r$._`.${new r$.Name(I)}[${U}]`}}gv.ValueScopeName=M9;var Pk=r$._`\n`;class fv extends z9{constructor($){super($);this._values={},this._scope=$.scope,this.opts={...$,_n:$.lines?Pk:r$.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,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,Hw.Started);let X=I(N);if(X){let G=this.opts.es5?gv.varKinds.var:gv.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 Zv(N);O.set(N,Hw.Completed)})}return b}}gv.ValueScope=fv});var d=R((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$=uU(),G6=V9(),B4=uU();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 Fw=V9();Object.defineProperty(c$,"Scope",{enumerable:!0,get:function(){return Fw.Scope}});Object.defineProperty(c$,"ValueScope",{enumerable:!0,get:function(){return Fw.ValueScope}});Object.defineProperty(c$,"ValueScopeName",{enumerable:!0,get:function(){return Fw.ValueScopeName}});Object.defineProperty(c$,"varKinds",{enumerable:!0,get:function(){return Fw.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 v4{optimizeNodes(){return this}optimizeNames($,I){return this}}class xv extends v4{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 q9 extends v4{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 Kw($,this.rhs)}}class lv extends q9{constructor($,I,U,D){super($,U,D);this.op=I}render({_n:$}){return`${this.lhs} ${this.op}= ${this.rhs};`+$}}class hv extends v4{constructor($){super();this.label=$,this.names={}}render({_n:$}){return`${this.label}:`+$}}class uv extends v4{constructor($){super();this.label=$,this.names={}}render({_n:$}){return`break${this.label?` ${this.label}`:""};`+$}}class iv extends v4{constructor($){super();this.error=$}render({_n:$}){return`throw ${this.error};`+$}get names(){return this.error.names}}class nv extends v4{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 qw extends v4{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;Ck($,b.names),U.splice(D,1)}return U.length>0?this:void 0}get names(){return this.nodes.reduce(($,I)=>u4($,I.names),{})}}class J4 extends qw{render($){return"{"+$._n+super.render($)+"}"+$._n}}class rv extends qw{}class iU extends J4{}iU.kind="else";class h6 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 iU(U):U}if(I){if($===!1)return I instanceof h6?I:I.nodes;if(this.nodes.length)return this;return new h6(pv($),I instanceof h6?[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(Kw($,this.condition),this.else)u4($,this.else.names);return $}}h6.kind="if";class mI extends J4{}mI.kind="for";class cv 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 u4(super.names,this.iteration.names)}}class mv 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 $=Kw(super.names,this.from);return Kw($,this.to)}}class K9 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 u4(super.names,this.iterable.names)}}class Lw 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($)}}Lw.kind="func";class zw extends qw{render($){return"return "+super.render($)}}zw.kind="return";class ov 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)u4($,this.catch.names);if(this.finally)u4($,this.finally.names);return $}}class Mw extends J4{constructor($){super();this.error=$}render($){return`catch(${this.error})`+super.render($)}}Mw.kind="catch";class Vw extends J4{render($){return"finally"+super.render($)}}Vw.kind="finally";class dv{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 rv]}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 xv($,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 q9($,I,U))}add($,I){return this._leafNode(new lv($,c$.operators.ADD,I))}code($){if(typeof $=="function")$();else if($!==U$.nil)this._leafNode(new nv($));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 h6($)),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 h6($))}else(){return this._elseNode(new iU)}endIf(){return this._endBlockNode(h6,iU)}_for($,I){if(this._blockNode($),I)this.code(I).endFor();return this}for($,I){return this._for(new cv($),I)}forRange($,I,U,D,b=this.opts.es5?G6.varKinds.var:G6.varKinds.let){let A=this._scope.toName($);return this._for(new mv(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 K9("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 K9("in",D,b,I),()=>U(b))}endFor(){return this._endBlockNode(mI)}label($){return this._leafNode(new hv($))}break($){return this._leafNode(new uv($))}return($){let I=new zw;if(this._blockNode(I),this.code($),I.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(zw)}try($,I,U){if(!I&&!U)throw new Error('CodeGen: "try" without "catch" and "finally"');let D=new ov;if(this._blockNode(D),this.code($),I){let b=this.name("e");this._currNode=D.catch=new Mw(b),I(b)}if(U)this._currNode=D.finally=new Vw,this.code(U);return this._endBlockNode(Mw,Vw)}throw($){return this._leafNode(new iv($))}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 Lw($,I,U)),D)this.code(D).endFunc();return this}endFunc(){return this._endBlockNode(Lw)}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 h6))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=dv;function u4($,I){for(let U in I)$[U]=($[U]||0)+(I[U]||0);return $}function Kw($,I){return I instanceof U$._CodeOrName?u4($,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 Ck($,I){for(let U in I)$[U]=($[U]||0)-(I[U]||0)}function pv($){return typeof $=="boolean"||typeof $=="number"||$===null?!$:U$._`!${F9($)}`}c$.not=pv;var Zk=tv(c$.operators.AND);function fk(...$){return $.reduce(Zk)}c$.and=fk;var gk=tv(c$.operators.OR);function yk(...$){return $.reduce(gk)}c$.or=yk;function tv($){return(I,U)=>I===U$.nil?U:U===U$.nil?I:U$._`${F9(I)} ${$} ${F9(U)}`}function F9($){return $ instanceof U$.Name?$:U$._`(${$})`}});var A$=R((A5)=>{Object.defineProperty(A5,"__esModule",{value:!0});A5.checkStrictMode=A5.getErrorPath=A5.Type=A5.useFunc=A5.setEvaluated=A5.evaluatedPropsToName=A5.mergeEvaluated=A5.eachItem=A5.unescapeJsonPointer=A5.escapeJsonPointer=A5.escapeFragment=A5.unescapeFragment=A5.schemaRefOrVal=A5.schemaHasRulesButRef=A5.schemaHasRules=A5.checkUnknownRules=A5.alwaysValidSchema=A5.toHash=void 0;var v$=d(),uk=uU();function ik($){let I={};for(let U of $)I[U]=!0;return I}A5.toHash=ik;function nk($,I){if(typeof I=="boolean")return I;if(Object.keys(I).length===0)return!0;return $5($,I),!I5(I,$.self.RULES.all)}A5.alwaysValidSchema=nk;function $5($,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])D5($,`unknown keyword: "${A}"`)}A5.checkUnknownRules=$5;function I5($,I){if(typeof $=="boolean")return!$;for(let U in $)if(I[U])return!0;return!1}A5.schemaHasRules=I5;function rk($,I){if(typeof $=="boolean")return!$;for(let U in $)if(U!=="$ref"&&I.all[U])return!0;return!1}A5.schemaHasRulesButRef=rk;function ck({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)}`}A5.schemaRefOrVal=ck;function mk($){return U5(decodeURIComponent($))}A5.unescapeFragment=mk;function ok($){return encodeURIComponent(E9($))}A5.escapeFragment=ok;function E9($){if(typeof $=="number")return`${$}`;return $.replace(/~/g,"~0").replace(/\//g,"~1")}A5.escapeJsonPointer=E9;function U5($){return $.replace(/~1/g,"/").replace(/~0/g,"~")}A5.unescapeJsonPointer=U5;function dk($,I){if(Array.isArray($))for(let U of $)I(U);else I($)}A5.eachItem=dk;function ev({mergeNames:$,mergeToName:I,mergeValues:U,resultToName:D}){return(b,A,w,O)=>{let N=w===void 0?A:w instanceof v$.Name?(A instanceof v$.Name?$(b,A,w):I(b,A,w),w):A instanceof v$.Name?(I(b,w,A),A):U(A,w);return O===v$.Name&&!(N instanceof v$.Name)?D(b,N):N}}A5.mergeEvaluated={props:ev({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:b5}),items:ev({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 b5($,I){if(I===!0)return $.var("props",!0);let U=$.var("props",v$._`{}`);if(I!==void 0)S9($,U,I);return U}A5.evaluatedPropsToName=b5;function S9($,I,U){Object.keys(U).forEach((D)=>$.assign(v$._`${I}${v$.getProperty(D)}`,!0))}A5.setEvaluated=S9;var sv={};function pk($,I){return $.scopeValue("func",{ref:I,code:sv[I.code]||(sv[I.code]=new uk._Code(I.code))})}A5.useFunc=pk;var k9;(function($){$[$.Num=0]="Num",$[$.Str=1]="Str"})(k9||(A5.Type=k9={}));function tk($,I,U){if($ instanceof v$.Name){let D=I===k9.Num;return U?D?v$._`"[" + ${$} + "]"`:v$._`"['" + ${$} + "']"`:D?v$._`"/" + ${$}`:v$._`"/" + ${$}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return U?v$.getProperty($).toString():"/"+E9($)}A5.getErrorPath=tk;function D5($,I,U=$.opts.strictSchema){if(!U)return;if(I=`strict mode: ${I}`,U===!0)throw new Error(I);$.self.logger.warn(I)}A5.checkStrictMode=D5});var u6=R((O5)=>{Object.defineProperty(O5,"__esModule",{value:!0});var C$=d(),BE={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")};O5.default=BE});var nU=R((G5)=>{Object.defineProperty(G5,"__esModule",{value:!0});G5.extendErrors=G5.resetErrorsCount=G5.reportExtraError=G5.reportError=G5.keyword$DataError=G5.keywordError=void 0;var b$=d(),Ew=A$(),l$=u6();G5.keywordError={message:({keyword:$})=>b$.str`must pass "${$}" keyword validation`};G5.keyword$DataError={message:({keyword:$,schemaType:I})=>I?b$.str`"${$}" keyword must be ${I} ($data)`:b$.str`"${$}" keyword is invalid ($data)`};function JE($,I=G5.keywordError,U,D){let{it:b}=$,{gen:A,compositeRule:w,allErrors:O}=b,N=W5($,I,U);if(D!==null&&D!==void 0?D:w||O)N5(A,N);else X5(b,b$._`[${N}]`)}G5.reportError=JE;function HE($,I=G5.keywordError,U){let{it:D}=$,{gen:b,compositeRule:A,allErrors:w}=D,O=W5($,I,U);if(N5(b,O),!(A||w))X5(D,l$.default.vErrors)}G5.reportExtraError=HE;function LE($,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)))}G5.resetErrorsCount=LE;function zE({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)})}G5.extendErrors=zE;function N5($,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 X5($,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 i4={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 W5($,I,U){let{createErrors:D}=$.it;if(D===!1)return b$._`{}`;return ME($,I,U)}function ME($,I,U={}){let{gen:D,it:b}=$,A=[VE(b,U),KE($,U)];return FE($,I,A),D.object(...A)}function VE({errorPath:$},{instancePath:I}){let U=I?b$.str`${$}${Ew.getErrorPath(I,Ew.Type.Str)}`:$;return[l$.default.instancePath,b$.strConcat(l$.default.instancePath,U)]}function KE({keyword:$,it:{errSchemaPath:I}},{schemaPath:U,parentSchema:D}){let b=D?I:b$.str`${I}/${$}`;if(U)b=b$.str`${b}${Ew.getErrorPath(U,Ew.Type.Str)}`;return[i4.schemaPath,b]}function FE($,{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([i4.keyword,b],[i4.params,typeof I=="function"?I($):I||b$._`{}`]),N.messages)D.push([i4.message,typeof U=="function"?U($):U]);if(N.verbose)D.push([i4.schema,w],[i4.parentSchema,b$._`${G}${Q}`],[l$.default.data,A]);if(X)D.push([i4.propertyName,X])}});var J5=R((B5)=>{Object.defineProperty(B5,"__esModule",{value:!0});B5.boolOrEmptySchema=B5.topBoolOrEmptySchema=void 0;var jE=nU(),PE=d(),RE=u6(),TE={message:"boolean schema is false"};function _E($){let{gen:I,schema:U,validateName:D}=$;if(U===!1)Y5($,!1);else if(typeof U=="object"&&U.$async===!0)I.return(RE.default.data);else I.assign(PE._`${D}.errors`,null),I.return(!0)}B5.topBoolOrEmptySchema=_E;function CE($,I){let{gen:U,schema:D}=$;if(D===!1)U.var(I,!1),Y5($);else U.var(I,!0)}B5.boolOrEmptySchema=CE;function Y5($,I){let{gen:U,data:D}=$,b={gen:U,keyword:"false schema",data:D,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:$};jE.reportError(b,TE,void 0,I)}});var P9=R((H5)=>{Object.defineProperty(H5,"__esModule",{value:!0});H5.getRules=H5.isJSONType=void 0;var fE=["string","number","integer","boolean","null","object","array"],gE=new Set(fE);function yE($){return typeof $=="string"&&gE.has($)}H5.isJSONType=yE;function xE(){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:{}}}H5.getRules=xE});var R9=R((V5)=>{Object.defineProperty(V5,"__esModule",{value:!0});V5.shouldUseRule=V5.shouldUseGroup=V5.schemaHasRulesForType=void 0;function hE({schema:$,self:I},U){let D=I.RULES.types[U];return D&&D!==!0&&z5($,D)}V5.schemaHasRulesForType=hE;function z5($,I){return I.rules.some((U)=>M5($,U))}V5.shouldUseGroup=z5;function M5($,I){var U;return $[I.keyword]!==void 0||((U=I.definition.implements)===null||U===void 0?void 0:U.some((D)=>$[D]!==void 0))}V5.shouldUseRule=M5});var rU=R((E5)=>{Object.defineProperty(E5,"__esModule",{value:!0});E5.reportTypeError=E5.checkDataTypes=E5.checkDataType=E5.coerceAndCheckDataType=E5.getJSONTypes=E5.getSchemaTypes=E5.DataType=void 0;var nE=P9(),rE=R9(),cE=nU(),o=d(),F5=A$(),dI;(function($){$[$.Correct=0]="Correct",$[$.Wrong=1]="Wrong"})(dI||(E5.DataType=dI={}));function mE($){let I=q5($.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}E5.getSchemaTypes=mE;function q5($){let I=Array.isArray($)?$:$?[$]:[];if(I.every(nE.isJSONType))return I;throw new Error("type must be JSONType or JSONType[]: "+I.join(","))}E5.getJSONTypes=q5;function oE($,I){let{gen:U,data:D,opts:b}=$,A=dE(I,b.coerceTypes),w=I.length>0&&!(A.length===0&&I.length===1&&rE.schemaHasRulesForType($,I[0]));if(w){let O=_9(I,D,b.strictNumbers,dI.Wrong);U.if(O,()=>{if(A.length)pE($,I,A);else C9($)})}return w}E5.coerceAndCheckDataType=oE;var k5=new Set(["string","number","integer","boolean","null"]);function dE($,I){return I?$.filter((U)=>k5.has(U)||I==="array"&&U==="array"):[]}function pE($,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(_9(I,b,A.strictNumbers),()=>D.assign(O,b)));D.if(o._`${O} !== undefined`);for(let X of U)if(k5.has(X)||X==="array"&&A.coerceTypes==="array")N(X);D.else(),C9($),D.endIf(),D.if(o._`${O} !== undefined`,()=>{D.assign(b,O),tE($,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 tE({gen:$,parentData:I,parentDataProperty:U},D){$.if(o._`${I} !== undefined`,()=>$.assign(o._`${I}[${U}]`,D))}function T9($,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)}}E5.checkDataType=T9;function _9($,I,U,D){if($.length===1)return T9($[0],I,U,D);let b,A=F5.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,T9(w,I,U,D));return b}E5.checkDataTypes=_9;var aE={message:({schema:$})=>`must be ${$}`,params:({schema:$,schemaValue:I})=>typeof $=="string"?o._`{type: ${$}}`:o._`{type: ${I}}`};function C9($){let I=eE($);cE.reportError(I,aE)}E5.reportTypeError=C9;function eE($){let{gen:I,data:U,schema:D}=$,b=F5.schemaRefOrVal($,D,"type");return{gen:I,keyword:"type",data:U,schema:D.type,schemaCode:b,schemaValue:b,parentSchema:D,params:{},it:$}}});var T5=R((P5)=>{Object.defineProperty(P5,"__esModule",{value:!0});P5.assignDefaults=void 0;var pI=d(),AS=A$();function wS($,I){let{properties:U,items:D}=$.schema;if(I==="object"&&U)for(let b in U)j5($,b,U[b].default);else if(I==="array"&&Array.isArray(D))D.forEach((b,A)=>j5($,A,b.default))}P5.assignDefaults=wS;function j5($,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){AS.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=R((Z5)=>{Object.defineProperty(Z5,"__esModule",{value:!0});Z5.validateUnion=Z5.validateArray=Z5.usePattern=Z5.callValidateCode=Z5.schemaProperties=Z5.allSchemaProperties=Z5.noPropertyInData=Z5.propertyInData=Z5.isOwnProperty=Z5.hasPropFunc=Z5.reportMissingProp=Z5.checkMissingProp=Z5.checkReportMissingProp=void 0;var J$=d(),Z9=A$(),H4=u6(),OS=A$();function NS($,I){let{gen:U,data:D,it:b}=$;U.if(g9(U,D,I,b.opts.ownProperties),()=>{$.setParams({missingProperty:J$._`${I}`},!0),$.error()})}Z5.checkReportMissingProp=NS;function XS({gen:$,data:I,it:{opts:U}},D,b){return J$.or(...D.map((A)=>J$.and(g9($,I,A,U.ownProperties),J$._`${b} = ${A}`)))}Z5.checkMissingProp=XS;function WS($,I){$.setParams({missingProperty:I},!0),$.error()}Z5.reportMissingProp=WS;function _5($){return $.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:J$._`Object.prototype.hasOwnProperty`})}Z5.hasPropFunc=_5;function f9($,I,U){return J$._`${_5($)}.call(${I}, ${U})`}Z5.isOwnProperty=f9;function GS($,I,U,D){let b=J$._`${I}${J$.getProperty(U)} !== undefined`;return D?J$._`${b} && ${f9($,I,U)}`:b}Z5.propertyInData=GS;function g9($,I,U,D){let b=J$._`${I}${J$.getProperty(U)} === undefined`;return D?J$.or(b,J$.not(f9($,I,U))):b}Z5.noPropertyInData=g9;function C5($){return $?Object.keys($).filter((I)=>I!=="__proto__"):[]}Z5.allSchemaProperties=C5;function QS($,I){return C5(I).filter((U)=>!Z9.alwaysValidSchema($,I[U]))}Z5.schemaProperties=QS;function YS({schemaCode:$,data:I,it:{gen:U,topSchemaRef:D,schemaPath:b,errorPath:A},it:w},O,N,X){let G=X?J$._`${$}, ${I}, ${D}${b}`:I,Q=[[H4.default.instancePath,J$.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=J$._`${G}, ${U.object(...Q)}`;return N!==J$.nil?J$._`${O}.call(${N}, ${Y})`:J$._`${O}(${Y})`}Z5.callValidateCode=YS;var BS=J$._`new RegExp`;function vS({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:J$._`${b.code==="new RegExp"?BS:OS.useFunc($,b)}(${U}, ${D})`})}Z5.usePattern=vS;function JS($){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",J$._`${U}.length`);I.forRange("i",0,N,(X)=>{$.subschema({keyword:D,dataProp:X,dataPropType:Z9.Type.Num},A),I.if(J$.not(A),O)})}}Z5.validateArray=JS;function HS($){let{gen:I,schema:U,keyword:D,it:b}=$;if(!Array.isArray(U))throw new Error("ajv implementation error");if(U.some((N)=>Z9.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,J$._`${w} || ${O}`),!$.mergeValidEvaluated(G,O))I.if(J$.not(w))})),$.result(w,()=>$.reset(),()=>$.error(!0))}Z5.validateUnion=HS});var h5=R((x5)=>{Object.defineProperty(x5,"__esModule",{value:!0});x5.validateKeywordUsage=x5.validSchemaType=x5.funcKeywordCode=x5.macroKeywordCode=void 0;var h$=d(),n4=u6(),RS=b6(),TS=nU();function _S($,I){let{gen:U,keyword:D,schema:b,parentSchema:A,it:w}=$,O=I.macro.call(w.self,b,A,w),N=y5(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))}x5.macroKeywordCode=_S;function CS($,I){var U;let{gen:D,keyword:b,schema:A,parentSchema:w,$data:O,it:N}=$;fS(N,I);let X=!O&&I.compile?I.compile.call(N.self,A,w,N):I.validate,G=y5(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)g5($);K(()=>$.error())}else{let k=I.async?B():J();if(I.modifying)g5($);K(()=>ZS($,k))}}function B(){let k=D.let("ruleErrs",null);return D.try(()=>L(h$._`await `),(g)=>D.assign(Q,!1).if(h$._`${g} instanceof ${N.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=N.opts.passContext?n4.default.this:n4.default.self,x=!(("compile"in I)&&!O||I.schema===!1);D.assign(Q,h$._`${k}${RS.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)}}x5.funcKeywordCode=CS;function g5($){let{gen:I,data:U,it:D}=$;I.if(D.parentData,()=>I.assign(U,h$._`${D.parentData}[${D.parentDataProperty}]`))}function ZS($,I){let{gen:U}=$;U.if(h$._`Array.isArray(${I})`,()=>{U.assign(n4.default.vErrors,h$._`${n4.default.vErrors} === null ? ${I} : ${n4.default.vErrors}.concat(${I})`).assign(n4.default.errors,h$._`${n4.default.vErrors}.length`),TS.extendErrors($)},()=>$.error())}function fS({schemaEnv:$},I){if(I.async&&!$.$async)throw new Error("async keyword in sync schema")}function y5($,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 gS($,I,U=!1){return!I.length||I.some((D)=>D==="array"?Array.isArray($):D==="object"?$&&typeof $=="object"&&!Array.isArray($):typeof $==D||U&&typeof $=="undefined")}x5.validSchemaType=gS;function yS({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)}}}x5.validateKeywordUsage=yS});var r5=R((i5)=>{Object.defineProperty(i5,"__esModule",{value:!0});i5.extendSubschemaMode=i5.extendSubschemaData=i5.getSubschema=void 0;var E6=d(),u5=A$();function uS($,{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:E6._`${$.schemaPath}${E6.getProperty(I)}`,errSchemaPath:`${$.errSchemaPath}/${I}`}:{schema:O[U],schemaPath:E6._`${$.schemaPath}${E6.getProperty(I)}${E6.getProperty(U)}`,errSchemaPath:`${$.errSchemaPath}/${I}/${u5.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')}i5.getSubschema=uS;function iS($,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",E6._`${I.data}${E6.getProperty(U)}`,!0);N(Y),$.errorPath=E6.str`${X}${u5.getErrorPath(U,D,Q.jsPropertySyntax)}`,$.parentDataProperty=E6._`${U}`,$.dataPathArr=[...G,$.parentDataProperty]}if(b!==void 0){let X=b instanceof E6.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]}}i5.extendSubschemaData=iS;function nS($,{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}i5.extendSubschemaMode=nS});var y9=R((yu,c5)=>{c5.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 o5=R((xu,m5)=>{var L4=m5.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(){};Sw(I,D,b,$,"",$)};L4.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};L4.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};L4.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};L4.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 Sw($,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 L4.arrayKeywords)for(var Y=0;Y<Q.length;Y++)Sw($,I,U,Q[Y],b+"/"+G+"/"+Y,A,b,G,D,Y)}else if(G in L4.propsKeywords){if(Q&&typeof Q=="object")for(var B in Q)Sw($,I,U,Q[B],b+"/"+G+"/"+mS(B),A,b,G,D,B)}else if(G in L4.keywords||$.allKeys&&!(G in L4.skipKeywords))Sw($,I,U,Q,b+"/"+G,A,b,G,D)}U(D,b,A,w,O,N,X)}}function mS($){return $.replace(/~/g,"~0").replace(/\//g,"~1")}});var cU=R((a5)=>{Object.defineProperty(a5,"__esModule",{value:!0});a5.getSchemaRefs=a5.resolveUrl=a5.normalizeId=a5._getFullPath=a5.getFullPath=a5.inlineRef=void 0;var oS=A$(),dS=y9(),pS=o5(),tS=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function aS($,I=!0){if(typeof $=="boolean")return!0;if(I===!0)return!x9($);if(!I)return!1;return d5($)<=I}a5.inlineRef=aS;var eS=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function x9($){for(let I in $){if(eS.has(I))return!0;let U=$[I];if(Array.isArray(U)&&U.some(x9))return!0;if(typeof U=="object"&&x9(U))return!0}return!1}function d5($){let I=0;for(let U in $){if(U==="$ref")return 1/0;if(I++,tS.has(U))continue;if(typeof $[U]=="object")oS.eachItem($[U],(D)=>I+=d5(D));if(I===1/0)return 1/0}return I}function p5($,I="",U){if(U!==!1)I=tI(I);let D=$.parse(I);return t5($,D)}a5.getFullPath=p5;function t5($,I){return $.serialize(I).split("#")[0]+"#"}a5._getFullPath=t5;var sS=/#\/?$/;function tI($){return $?$.replace(sS,""):""}a5.normalizeId=tI;function $j($,I,U){return U=tI(U),$.resolve(I,U)}a5.resolveUrl=$j;var Ij=/^[a-z_][-a-z0-9._]*$/i;function Uj($,I){if(typeof $=="boolean")return{};let{schemaId:U,uriResolver:D}=this.opts,b=tI($[U]||I),A={"":b},w=p5(D,b,!1),O={},N=new Set;return pS($,{allKeys:!0},(Q,Y,B,J)=>{if(J===void 0)return;let L=w+Y,K=A[J];if(typeof Q[U]=="string")K=k.call(this,Q[U]);g.call(this,Q.$anchor),g.call(this,Q.$dynamicAnchor),A[Y]=K;function k(x){let a=this.opts.uriResolver.resolve;if(x=tI(K?a(K,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(L))if(x[0]==="#")X(Q,O[x],x),O[x]=Q;else this.refs[x]=L;return x}function g(x){if(typeof x=="string"){if(!Ij.test(x))throw new Error(`invalid anchor "${x}"`);k.call(this,`#${x}`)}}}),O;function X(Q,Y,B){if(Y!==void 0&&!dS(Q,Y))throw G(B)}function G(Q){return new Error(`reference "${Q}" resolves to more than one schema`)}}a5.getSchemaRefs=Uj});var dU=R((YJ)=>{Object.defineProperty(YJ,"__esModule",{value:!0});YJ.getData=YJ.KeywordCxt=YJ.validateFunctionCode=void 0;var bJ=J5(),s5=rU(),h9=R9(),jw=rU(),Nj=T5(),oU=h5(),l9=r5(),y=d(),r=u6(),Xj=cU(),i6=A$(),mU=nU();function Wj($){if(wJ($)){if(OJ($),AJ($)){Yj($);return}}DJ($,()=>bJ.topBoolOrEmptySchema($))}YJ.validateFunctionCode=Wj;function DJ({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"; ${$J(U,b)}`),Qj($,b),$.code(A)});else $.func(I,y._`${r.default.data}, ${Gj(b)}`,D.$async,()=>$.code($J(U,b)).code(A))}function Gj($){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 Qj($,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 Yj($){let{schema:I,opts:U,gen:D}=$;DJ($,()=>{if(U.$comment&&I.$comment)XJ($);if(Lj($),D.let(r.default.vErrors,null),D.let(r.default.errors,0),U.unevaluated)Bj($);NJ($),Vj($)});return}function Bj($){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 $J($,I){let U=typeof $=="object"&&$[I.schemaId];return U&&(I.code.source||I.code.process)?y._`/*# sourceURL=${U} */`:y.nil}function vj($,I){if(wJ($)){if(OJ($),AJ($)){Jj($,I);return}}bJ.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 wJ($){return typeof $.schema!="boolean"}function Jj($,I){let{schema:U,gen:D,opts:b}=$;if(b.$comment&&U.$comment)XJ($);zj($),Mj($);let A=D.const("_errs",r.default.errors);NJ($,A),D.var(I,y._`${A} === ${r.default.errors}`)}function OJ($){i6.checkUnknownRules($),Hj($)}function NJ($,I){if($.opts.jtd)return IJ($,[],!1,I);let U=s5.getSchemaTypes($.schema),D=s5.coerceAndCheckDataType($,U);IJ($,U,!D,I)}function Hj($){let{schema:I,errSchemaPath:U,opts:D,self:b}=$;if(I.$ref&&D.ignoreKeywordsWithRef&&i6.schemaHasRulesButRef(I,b.RULES))b.logger.warn(`$ref: keywords ignored in schema at path "${U}"`)}function Lj($){let{schema:I,opts:U}=$;if(I.default!==void 0&&U.useDefaults&&U.strictSchema)i6.checkStrictMode($,"default is ignored in the schema root")}function zj($){let I=$.schema[$.opts.schemaId];if(I)$.baseId=Xj.resolveUrl($.opts.uriResolver,$.baseId,I)}function Mj($){if($.schema.$async&&!$.schemaEnv.$async)throw new Error("async schema in sync schema")}function XJ({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 Vj($){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)Kj($);I.return(y._`${r.default.errors} === 0`)}}function Kj({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 IJ($,I,U,D){let{gen:b,schema:A,data:w,allErrors:O,opts:N,self:X}=$,{RULES:G}=X;if(A.$ref&&(N.ignoreKeywordsWithRef||!i6.schemaHasRulesButRef(A,G))){b.block(()=>GJ($,"$ref",G.all.$ref.definition));return}if(!N.jtd)Fj($,I);b.block(()=>{for(let Y of G.rules)Q(Y);Q(G.post)});function Q(Y){if(!h9.shouldUseGroup(A,Y))return;if(Y.type){if(b.if(jw.checkDataType(Y.type,w,N.strictNumbers)),UJ($,Y),I.length===1&&I[0]===Y.type&&U)b.else(),jw.reportTypeError($);b.endIf()}else UJ($,Y);if(!O)b.if(y._`${r.default.errors} === ${D||0}`)}}function UJ($,I){let{gen:U,schema:D,opts:{useDefaults:b}}=$;if(b)Nj.assignDefaults($,I.type);U.block(()=>{for(let A of I.rules)if(h9.shouldUseRule(D,A))GJ($,A.keyword,A.definition,I.type)})}function Fj($,I){if($.schemaEnv.meta||!$.opts.strictTypes)return;if(qj($,I),!$.opts.allowUnionTypes)kj($,I);Ej($,$.dataTypes)}function qj($,I){if(!I.length)return;if(!$.dataTypes.length){$.dataTypes=I;return}I.forEach((U)=>{if(!WJ($.dataTypes,U))u9($,`type "${U}" not allowed by context "${$.dataTypes.join(",")}"`)}),jj($,I)}function kj($,I){if(I.length>1&&!(I.length===2&&I.includes("null")))u9($,"use allowUnionTypes to allow union type keyword")}function Ej($,I){let U=$.self.RULES.all;for(let D in U){let b=U[D];if(typeof b=="object"&&h9.shouldUseRule($.schema,b)){let{type:A}=b.definition;if(A.length&&!A.some((w)=>Sj(I,w)))u9($,`missing type "${A.join(",")}" for keyword "${D}"`)}}}function Sj($,I){return $.includes(I)||I==="number"&&$.includes("integer")}function WJ($,I){return $.includes(I)||I==="integer"&&$.includes("number")}function jj($,I){let U=[];for(let D of $.dataTypes)if(WJ(I,D))U.push(D);else if(I.includes("integer")&&D==="number")U.push("integer");$.dataTypes=U}function u9($,I){let U=$.schemaEnv.baseId+$.errSchemaPath;I+=` at "${U}" (strictTypes)`,i6.checkStrictMode($,I,$.opts.strictTypes)}class i9{constructor($,I,U){if(oU.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=i6.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",QJ(this.$data,$));else if(this.schemaCode=this.schemaValue,!oU.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){($?mU.reportExtraError:mU.reportError)(this,this.def.error,I)}$dataError(){mU.reportError(this,this.def.$dataError||mU.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');mU.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._`${jw.checkDataTypes(O,I,b.opts.strictNumbers,jw.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=l9.getSubschema(this.it,$);l9.extendSubschemaData(U,this.it,$),l9.extendSubschemaMode(U,$);let D={...this.it,...U,items:void 0,props:void 0};return vj(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=i6.mergeEvaluated.props(D,$.props,U.props,I);if(U.items!==!0&&$.items!==void 0)U.items=i6.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}}YJ.KeywordCxt=i9;function GJ($,I,U,D){let b=new i9($,U,I);if("code"in U)U.code(b,D);else if(b.$data&&U.validate)oU.funcKeywordCode(b,U);else if("macro"in U)oU.macroKeywordCode(b,U);else if(U.compile||U.validate)oU.funcKeywordCode(b,U)}var Pj=/^\/(?:[^~]|~0|~1)*$/,Rj=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function QJ($,{dataLevel:I,dataNames:U,dataPathArr:D}){let b,A;if($==="")return r.default.rootData;if($[0]==="/"){if(!Pj.test($))throw new Error(`Invalid JSON-pointer: ${$}`);b=$,A=r.default.rootData}else{let X=Rj.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(i6.unescapeJsonPointer(X))}`,w=y._`${w} && ${A}`;return w;function N(X,G){return`Cannot access ${X} ${G} levels up, current level is ${I}`}}YJ.getData=QJ});var Pw=R((JJ)=>{Object.defineProperty(JJ,"__esModule",{value:!0});class vJ extends Error{constructor($){super("validation failed");this.errors=$,this.ajv=this.validation=!0}}JJ.default=vJ});var pU=R((LJ)=>{Object.defineProperty(LJ,"__esModule",{value:!0});var n9=cU();class HJ extends Error{constructor($,I,U,D){super(D||`can't resolve reference ${U} from id ${I}`);this.missingRef=n9.resolveUrl($,I,U),this.missingSchema=n9.normalizeId(n9.getFullPath($,this.missingRef))}}LJ.default=HJ});var Tw=R((VJ)=>{Object.defineProperty(VJ,"__esModule",{value:!0});VJ.resolveSchema=VJ.getCompilingSchema=VJ.resolveRef=VJ.compileSchema=VJ.SchemaEnv=void 0;var Q6=d(),fj=Pw(),r4=u6(),Y6=cU(),zJ=A$(),gj=dU();class tU{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={}}}VJ.SchemaEnv=tU;function c9($){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:A}=this.opts,w=new Q6.CodeGen(this.scope,{es5:D,lines:b,ownProperties:A}),O;if($.$async)O=w.scopeValue("Error",{ref:fj.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: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: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($),gj.validateFunctionCode(X),w.optimize(this.opts.code.optimize);let Q=w.toString();if(G=`${w.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(N,{ref:B}),B.errors=null,B.schema=$.schema,B.schemaEnv=$,$.$async)B.$async=!0;if(this.opts.code.source===!0)B.source={validateName:N,validateCode:Q,scopeValues:w._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($)}}VJ.compileSchema=c9;function yj($,I,U){var D;U=Y6.resolveUrl(this.opts.uriResolver,I,U);let b=$.refs[U];if(b)return b;let A=hj.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 tU({schema:w,schemaId:O,root:$,baseId:I})}if(A===void 0)return;return $.refs[U]=xj.call(this,A)}VJ.resolveRef=yj;function xj($){if(Y6.inlineRef($.schema,this.opts.inlineRefs))return $.schema;return $.validate?$:c9.call(this,$)}function MJ($){for(let I of this._compilations)if(lj(I,$))return I}VJ.getCompilingSchema=MJ;function lj($,I){return $.schema===I.schema&&$.root===I.root&&$.baseId===I.baseId}function hj($,I){let U;while(typeof(U=this.refs[I])=="string")I=U;return U||this.schemas[I]||Rw.call(this,$,I)}function Rw($,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 A=Y6.normalizeId(D),w=this.refs[A]||this.schemas[A];if(typeof w=="string"){let O=Rw.call(this,$,w);if(typeof(O===null||O===void 0?void 0:O.schema)!=="object")return;return r9.call(this,U,O)}if(typeof(w===null||w===void 0?void 0:w.schema)!=="object")return;if(!w.validate)c9.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 tU({schema:O,schemaId:N,root:$,baseId:b})}return r9.call(this,U,w)}VJ.resolveSchema=Rw;var uj=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 O of $.fragment.slice(1).split("/")){if(typeof U==="boolean")return;let N=U[zJ.unescapeFragment(O)];if(N===void 0)return;U=N;let X=typeof U==="object"&&U[this.opts.schemaId];if(!uj.has(O)&&X)I=Y6.resolveUrl(this.opts.uriResolver,I,X)}let A;if(typeof U!="boolean"&&U.$ref&&!zJ.schemaHasRulesButRef(U,this.RULES)){let O=Y6.resolveUrl(this.opts.uriResolver,I,U.$ref);A=Rw.call(this,D,O)}let{schemaId:w}=this.opts;if(A=A||new tU({schema:U,schemaId:w,root:D,baseId:I}),A.schema!==A.root.schema)return A;return}});var FJ=R((ru,mj)=>{mj.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 o9=R((cu,SJ)=>{var oj=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),kJ=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 m9($){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 dj=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function qJ($){return $.length=0,!0}function pj($,I,U){if($.length){let D=m9($);if(D!=="")I.push(D);else return U.error=!0,!1;$.length=0}return!0}function tj($){let I=0,U={error:!1,address:"",zone:""},D=[],b=[],A=!1,w=!1,O=pj;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=qJ}else{b.push(X);continue}}if(b.length)if(O===qJ)U.zone=b.join("");else if(w)D.push(b.join(""));else D.push(m9(b));return U.address=D.join(""),U}function EJ($){if(aj($,":")<2)return{host:$,isIPV6:!1};let I=tj($);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 aj($,I){let U=0;for(let D=0;D<$.length;D++)if($[D]===I)U++;return U}function ej($){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 sj($,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 $P($){let I=[];if($.userinfo!==void 0)I.push($.userinfo),I.push("@");if($.host!==void 0){let U=unescape($.host);if(!kJ(U)){let D=EJ(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:dj,recomposeAuthority:$P,normalizeComponentEncoding:sj,removeDotSegments:ej,isIPv4:kJ,isUUID:oj,normalizeIPv6:EJ,stringArrayToHexStripped:m9}});var _J=R((mu,TJ)=>{var{isUUID:IP}=o9(),UP=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,bP=["http","https","ws","wss","urn","urn:uuid"];function DP($){return bP.indexOf($)!==-1}function d9($){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 jJ($){if(!$.host)$.error=$.error||"HTTP URIs must have a host.";return $}function PJ($){let I=String($.scheme).toLowerCase()==="https";if($.port===(I?443:80)||$.port==="")$.port=void 0;if(!$.path)$.path="/";return $}function AP($){return $.secure=d9($),$.resourceName=($.path||"/")+($.query?"?"+$.query:""),$.path=void 0,$.query=void 0,$}function wP($){if($.port===(d9($)?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(UP);if(U){let D=I.scheme||$.scheme||"urn";$.nid=U[1].toLowerCase(),$.nss=U[2];let b=`${D}:${I.nid||$.nid}`,A=p9(b);if($.path=void 0,A)$=A.parse($,I)}else $.error=$.error||"URN can not be parsed.";return $}function NP($,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=p9(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||!IP(U.uuid)))U.error=U.error||"UUID is not valid.";return U}function WP($){let I=$;return I.nss=($.uuid||"").toLowerCase(),I}var RJ={scheme:"http",domainHost:!0,parse:jJ,serialize:PJ},GP={scheme:"https",domainHost:RJ.domainHost,parse:jJ,serialize:PJ},_w={scheme:"ws",domainHost:!0,parse:AP,serialize:wP},QP={scheme:"wss",domainHost:_w.domainHost,parse:_w.parse,serialize:_w.serialize},YP={scheme:"urn",parse:OP,serialize:NP,skipNormalize:!0},BP={scheme:"urn:uuid",parse:XP,serialize:WP,skipNormalize:!0},Cw={http:RJ,https:GP,ws:_w,wss:QP,urn:YP,"urn:uuid":BP};Object.setPrototypeOf(Cw,null);function p9($){return $&&(Cw[$]||Cw[$.toLowerCase()])||void 0}TJ.exports={wsIsSecure:d9,SCHEMES:Cw,isValidSchemeName:DP,getSchemeHandler:p9}});var fJ=R((ou,fw)=>{var{normalizeIPv6:vP,removeDotSegments:aU,recomposeAuthority:JP,normalizeComponentEncoding:Zw,isIPv4:HP,nonSimpleDomain:LP}=o9(),{SCHEMES:zP,getSchemeHandler:CJ}=_J();function MP($,I){if(typeof $==="string")$=S6(n6($,I),I);else if(typeof $==="object")$=n6(S6($,I),I);return $}function VP($,I,U){let D=U?Object.assign({scheme:"null"},U):{scheme:"null"},b=ZJ(n6($,D),n6(I,D),D,!0);return D.skipEscape=!0,S6(b,D)}function ZJ($,I,U,D){let b={};if(!D)$=n6(S6($,U),U),I=n6(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=aU(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=aU(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=aU(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=aU(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 KP($,I,U){if(typeof $==="string")$=unescape($),$=S6(Zw(n6($,U),!0),{...U,skipEscape:!0});else if(typeof $==="object")$=S6(Zw($,!0),{...U,skipEscape:!0});if(typeof I==="string")I=unescape(I),I=S6(Zw(n6(I,U),!0),{...U,skipEscape:!0});else if(typeof I==="object")I=S6(Zw(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=[],A=CJ(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=JP(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=aU(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 FP=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function n6($,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(FP);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(HP(D.host)===!1){let N=vP(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=CJ(U.scheme||D.scheme);if(!U.unicodeSupport&&(!w||!w.unicodeSupport)){if(D.host&&(U.domainHost||w&&w.domainHost)&&b===!1&&LP(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 t9={SCHEMES:zP,normalize:MP,resolve:VP,resolveComponent:ZJ,equal:KP,serialize:S6,parse:n6};fw.exports=t9;fw.exports.default=t9;fw.exports.fastUri=t9});var xJ=R((yJ)=>{Object.defineProperty(yJ,"__esModule",{value:!0});var gJ=fJ();gJ.code='require("ajv/dist/runtime/uri").default';yJ.default=gJ});var mJ=R((r6)=>{Object.defineProperty(r6,"__esModule",{value:!0});r6.CodeGen=r6.Name=r6.nil=r6.stringify=r6.str=r6._=r6.KeywordCxt=void 0;var kP=dU();Object.defineProperty(r6,"KeywordCxt",{enumerable:!0,get:function(){return kP.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 EP=Pw(),nJ=pU(),SP=P9(),eU=Tw(),jP=d(),sU=cU(),gw=rU(),e9=A$(),lJ=FJ(),PP=xJ(),rJ=($,I)=>new RegExp($,I);rJ.code="new RegExp";var RP=["removeAdditional","useDefaults","coerceTypes"],TP=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),_P={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."},CP={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},hJ=200;function ZP($){var I,U,D,b,A,w,O,N,X,G,Q,Y,B,J,L,K,k,g,x,a,h,L6,_6,jO,PO;let v1=$.strict,RO=(I=$.code)===null||I===void 0?void 0:I.optimize,KY=RO===!0||RO===void 0?1:RO||0,FY=(D=(U=$.code)===null||U===void 0?void 0:U.regExp)!==null&&D!==void 0?D:rJ,QM=(b=$.uriResolver)!==null&&b!==void 0?b:PP.default;return{strictSchema:(w=(A=$.strictSchema)!==null&&A!==void 0?A:v1)!==null&&w!==void 0?w:!0,strictNumbers:(N=(O=$.strictNumbers)!==null&&O!==void 0?O:v1)!==null&&N!==void 0?N:!0,strictTypes:(G=(X=$.strictTypes)!==null&&X!==void 0?X:v1)!==null&&G!==void 0?G:"log",strictTuples:(Y=(Q=$.strictTuples)!==null&&Q!==void 0?Q:v1)!==null&&Y!==void 0?Y:"log",strictRequired:(J=(B=$.strictRequired)!==null&&B!==void 0?B:v1)!==null&&J!==void 0?J:!1,code:$.code?{...$.code,optimize:KY,regExp:FY}:{optimize:KY,regExp:FY},loopRequired:(L=$.loopRequired)!==null&&L!==void 0?L:hJ,loopEnum:(K=$.loopEnum)!==null&&K!==void 0?K:hJ,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:(L6=$.validateSchema)!==null&&L6!==void 0?L6:!0,validateFormats:(_6=$.validateFormats)!==null&&_6!==void 0?_6:!0,unicodeRegExp:(jO=$.unicodeRegExp)!==null&&jO!==void 0?jO:!0,int32range:(PO=$.int32range)!==null&&PO!==void 0?PO:!0,uriResolver:QM}}class yw{constructor($={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,$=this.opts={...$,...ZP($)};let{es5:I,lines:U}=this.opts.code;this.scope=new jP.ValueScope({scope:{},prefixes:TP,es5:I,lines:U}),this.logger=hP($.logger);let D=$.validateFormats;if($.validateFormats=!1,this.RULES=SP.getRules(),uJ.call(this,_P,$,"NOT SUPPORTED"),uJ.call(this,CP,$,"DEPRECATED","warn"),this._metaOpts=xP.call(this),$.formats)gP.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),$.keywords)yP.call(this,$.keywords);if(typeof $.meta=="object")this.addMetaSchema($.meta);fP.call(this),$.validateFormats=D}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:$,meta:I,schemaId:U}=this.opts,D=lJ;if(U==="id")D={...lJ},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 nJ.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=sU.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=iJ.call(this,$))=="string")$=I;if(I===void 0){let{schemaId:U}=this.opts,D=new eU.SchemaEnv({schema:{},schemaId:U});if(I=eU.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=iJ.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=sU.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(iP.call(this,U,I),!I)return e9.eachItem(U,(b)=>a9.call(this,b)),this;rP.call(this,I);let D={...I,type:gw.getJSONTypes(I.type),schemaType:gw.getJSONTypes(I.schemaType)};return e9.eachItem(U,D.type.length===0?(b)=>a9.call(this,b,D):(b)=>D.type.forEach((A)=>a9.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]=cJ(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=sU.normalizeId(A||U);let N=sU.getSchemaRefs.call(this,$,U);if(O=new eU.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 eU.compileSchema.call(this,$);if(!$.validate)throw new Error("ajv implementation error");return $.validate}_compileMetaSchema($){let I=this.opts;this.opts=this._metaOpts;try{eU.compileSchema.call(this,$)}finally{this.opts=I}}}yw.ValidationError=EP.default;yw.MissingRefError=nJ.default;r6.default=yw;function uJ($,I,U,D="error"){for(let b in $){let A=b;if(A in I)this.logger[D](`${U}: option ${b}. ${$[A]}`)}}function iJ($){return $=sU.normalizeId($),this.schemas[$]||this.refs[$]}function fP(){let $=this.opts.schemas;if(!$)return;if(Array.isArray($))this.addSchema($);else for(let I in $)this.addSchema($[I],I)}function gP(){for(let $ in this.opts.formats){let I=this.opts.formats[$];if(I)this.addFormat($,I)}}function yP($){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 xP(){let $={...this.opts};for(let I of RP)delete $[I];return $}var lP={log(){},warn(){},error(){}};function hP($){if($===!1)return lP;if($===void 0)return console;if($.log&&$.warn&&$.error)return $;throw new Error("logger must implement log, warn and error methods")}var uP=/^[a-z_$][a-z0-9_$:-]*$/i;function iP($,I){let{RULES:U}=this;if(e9.eachItem($,(D)=>{if(U.keywords[D])throw new Error(`Keyword ${D} is already defined`);if(!uP.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 a9($,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:gw.getJSONTypes(I.type),schemaType:gw.getJSONTypes(I.schemaType)}};if(I.before)nP.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 nP($,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=cJ(I);$.validateSchema=this.compile(I,!0)}var cP={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function cJ($){return{anyOf:[$,cP]}}});var dJ=R((oJ)=>{Object.defineProperty(oJ,"__esModule",{value:!0});var dP={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};oJ.default=dP});var $H=R((eJ)=>{Object.defineProperty(eJ,"__esModule",{value:!0});eJ.callRef=eJ.getValidate=void 0;var tP=pU(),pJ=b6(),m$=d(),eI=u6(),tJ=Tw(),xw=A$(),aP={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=tJ.resolveRef.call(N,X,b,U);if(G===void 0)throw new tP.default(D.opts.uriResolver,b,U);if(G instanceof tJ.SchemaEnv)return Y(G);return B(G);function Q(){if(A===X)return lw($,w,A,A.$async);let J=I.scopeValue("root",{ref:X});return lw($,m$._`${J}.validate`,X,X.$async)}function Y(J){let L=aJ($,J);lw($,L,J,J.$async)}function B(J){let L=I.scopeValue("schema",O.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 aJ($,I){let{gen:U}=$;return I.validate?U.scopeValue("validate",{ref:I.validate}):m$._`${U.scopeValue("wrapper",{ref:I})}.validate`}eJ.getValidate=aJ;function lw($,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 J=b.let("valid");b.try(()=>{if(b.code(m$._`await ${pJ.callValidateCode($,I,X)}`),B(I),!w)b.assign(J,!0)},(L)=>{if(b.if(m$._`!(${L} instanceof ${A.ValidationError})`,()=>b.throw(L)),Y(L),!w)b.assign(J,!1)}),$.ok(J)}function Q(){$.result(pJ.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(!A.opts.unevaluated)return;let K=(L=U===null||U===void 0?void 0:U.validate)===null||L===void 0?void 0:L.evaluated;if(A.props!==!0)if(K&&!K.dynamicProps){if(K.props!==void 0)A.props=xw.mergeEvaluated.props(b,K.props,A.props)}else{let k=b.var("props",m$._`${J}.evaluated.props`);A.props=xw.mergeEvaluated.props(b,k,A.props,m$.Name)}if(A.items!==!0)if(K&&!K.dynamicItems){if(K.items!==void 0)A.items=xw.mergeEvaluated.items(b,K.items,A.items)}else{let k=b.var("items",m$._`${J}.evaluated.items`);A.items=xw.mergeEvaluated.items(b,k,A.items,m$.Name)}}}eJ.callRef=lw;eJ.default=aP});var UH=R((IH)=>{Object.defineProperty(IH,"__esModule",{value:!0});var $R=dJ(),IR=$H(),UR=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",$R.default,IR.default];IH.default=UR});var DH=R((bH)=>{Object.defineProperty(bH,"__esModule",{value:!0});var hw=d(),z4=hw.operators,uw={maximum:{okStr:"<=",ok:z4.LTE,fail:z4.GT},minimum:{okStr:">=",ok:z4.GTE,fail:z4.LT},exclusiveMaximum:{okStr:"<",ok:z4.LT,fail:z4.GTE},exclusiveMinimum:{okStr:">",ok:z4.GT,fail:z4.LTE}},DR={message:({keyword:$,schemaCode:I})=>hw.str`must be ${uw[$].okStr} ${I}`,params:({keyword:$,schemaCode:I})=>hw._`{comparison: ${uw[$].okStr}, limit: ${I}}`},AR={keyword:Object.keys(uw),type:"number",schemaType:"number",$data:!0,error:DR,code($){let{keyword:I,data:U,schemaCode:D}=$;$.fail$data(hw._`${U} ${uw[I].fail} ${D} || isNaN(${U})`)}};bH.default=AR});var wH=R((AH)=>{Object.defineProperty(AH,"__esModule",{value:!0});var $b=d(),OR={message:({schemaCode:$})=>$b.str`must be multiple of ${$}`,params:({schemaCode:$})=>$b._`{multipleOf: ${$}}`},NR={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:OR,code($){let{gen:I,data:U,schemaCode:D,it:b}=$,A=b.opts.multipleOfPrecision,w=I.let("res"),O=A?$b._`Math.abs(Math.round(${w}) - ${w}) > 1e-${A}`:$b._`${w} !== parseInt(${w})`;$.fail$data($b._`(${D} === 0 || (${w} = ${U}/${D}, ${O}))`)}};AH.default=NR});var XH=R((NH)=>{Object.defineProperty(NH,"__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}NH.default=OH;OH.code='require("ajv/dist/runtime/ucs2length").default'});var GH=R((WH)=>{Object.defineProperty(WH,"__esModule",{value:!0});var c4=d(),GR=A$(),QR=XH(),YR={message({keyword:$,schemaCode:I}){let U=$==="maxLength"?"more":"fewer";return c4.str`must NOT have ${U} than ${I} characters`},params:({schemaCode:$})=>c4._`{limit: ${$}}`},BR={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:YR,code($){let{keyword:I,data:U,schemaCode:D,it:b}=$,A=I==="maxLength"?c4.operators.GT:c4.operators.LT,w=b.opts.unicode===!1?c4._`${U}.length`:c4._`${GR.useFunc($.gen,QR.default)}(${U})`;$.fail$data(c4._`${w} ${A} ${D}`)}};WH.default=BR});var YH=R((QH)=>{Object.defineProperty(QH,"__esModule",{value:!0});var JR=b6(),iw=d(),HR={message:({schemaCode:$})=>iw.str`must match pattern "${$}"`,params:({schemaCode:$})=>iw._`{pattern: ${$}}`},LR={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:HR,code($){let{data:I,$data:U,schema:D,schemaCode:b,it:A}=$,w=A.opts.unicodeRegExp?"u":"",O=U?iw._`(new RegExp(${b}, ${w}))`:JR.usePattern($,D);$.fail$data(iw._`!${O}.test(${I})`)}};QH.default=LR});var vH=R((BH)=>{Object.defineProperty(BH,"__esModule",{value:!0});var Ib=d(),MR={message({keyword:$,schemaCode:I}){let U=$==="maxProperties"?"more":"fewer";return Ib.str`must NOT have ${U} than ${I} properties`},params:({schemaCode:$})=>Ib._`{limit: ${$}}`},VR={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:MR,code($){let{keyword:I,data:U,schemaCode:D}=$,b=I==="maxProperties"?Ib.operators.GT:Ib.operators.LT;$.fail$data(Ib._`Object.keys(${U}).length ${b} ${D}`)}};BH.default=VR});var HH=R((JH)=>{Object.defineProperty(JH,"__esModule",{value:!0});var Ub=b6(),bb=d(),FR=A$(),qR={message:({params:{missingProperty:$}})=>bb.str`must have required property '${$}'`,params:({params:{missingProperty:$}})=>bb._`{missingProperty: ${$}}`},kR={keyword:"required",type:"object",schemaType:"array",$data:!0,error:qR,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 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=w.schemaEnv.baseId+w.errSchemaPath,k=`required property "${L}" is not defined at "${K}" (strictRequired)`;FR.checkStrictMode(w,k,w.opts.strictRequired)}}function X(){if(N||A)$.block$data(bb.nil,Q);else for(let B of U)Ub.checkReportMissingProp($,B)}function G(){let B=I.let("missing");if(N||A){let J=I.let("valid",!0);$.block$data(J,()=>Y(B,J)),$.ok(J)}else I.if(Ub.checkMissingProp($,U,B)),Ub.reportMissingProp($,B),I.else()}function Q(){I.forOf("prop",D,(B)=>{$.setParams({missingProperty:B}),I.if(Ub.noPropertyInData(I,b,B,O.ownProperties),()=>$.error())})}function Y(B,J){$.setParams({missingProperty:B}),I.forOf(B,D,()=>{I.assign(J,Ub.propertyInData(I,b,B,O.ownProperties)),I.if(bb.not(J),()=>{$.error(),I.break()})},bb.nil)}}};JH.default=kR});var zH=R((LH)=>{Object.defineProperty(LH,"__esModule",{value:!0});var Db=d(),SR={message({keyword:$,schemaCode:I}){let U=$==="maxItems"?"more":"fewer";return Db.str`must NOT have ${U} than ${I} items`},params:({schemaCode:$})=>Db._`{limit: ${$}}`},jR={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:SR,code($){let{keyword:I,data:U,schemaCode:D}=$,b=I==="maxItems"?Db.operators.GT:Db.operators.LT;$.fail$data(Db._`${U}.length ${b} ${D}`)}};LH.default=jR});var nw=R((VH)=>{Object.defineProperty(VH,"__esModule",{value:!0});var MH=y9();MH.code='require("ajv/dist/runtime/equal").default';VH.default=MH});var FH=R((KH)=>{Object.defineProperty(KH,"__esModule",{value:!0});var s9=rU(),R$=d(),TR=A$(),_R=nw(),CR={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}}`},ZR={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:CR,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?s9.getSchemaTypes(A.items):[];$.block$data(N,G,R$._`${w} === false`),$.ok(N);function G(){let J=I.let("i",R$._`${U}.length`),L=I.let("j");$.setParams({i:J,j:L}),I.assign(N,!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=s9.checkDataTypes(X,K,O.opts.strictNumbers,s9.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(N,!1).break()}).code(R$._`${g}[${K}] = ${J}`)})}function B(J,L){let K=TR.useFunc(I,_R.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(N,!1).break(k)})))}}};KH.default=ZR});var kH=R((qH)=>{Object.defineProperty(qH,"__esModule",{value:!0});var $8=d(),gR=A$(),yR=nw(),xR={message:"must be equal to constant",params:({schemaCode:$})=>$8._`{allowedValue: ${$}}`},lR={keyword:"const",$data:!0,error:xR,code($){let{gen:I,data:U,$data:D,schemaCode:b,schema:A}=$;if(D||A&&typeof A=="object")$.fail$data($8._`!${gR.useFunc(I,yR.default)}(${U}, ${b})`);else $.fail($8._`${A} !== ${U}`)}};qH.default=lR});var SH=R((EH)=>{Object.defineProperty(EH,"__esModule",{value:!0});var Ab=d(),uR=A$(),iR=nw(),nR={message:"must be equal to one of the allowed values",params:({schemaCode:$})=>Ab._`{allowedValues: ${$}}`},rR={keyword:"enum",schemaType:"array",$data:!0,error:nR,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=uR.useFunc(I,iR.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 B=I.const("vSchema",A);G=Ab.or(...b.map((J,L)=>Y(B,L)))}$.pass(G);function Q(){I.assign(G,!1),I.forOf("v",A,(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}`}}};EH.default=rR});var PH=R((jH)=>{Object.defineProperty(jH,"__esModule",{value:!0});var mR=DH(),oR=wH(),dR=GH(),pR=YH(),tR=vH(),aR=HH(),eR=zH(),sR=FH(),$T=kH(),IT=SH(),UT=[mR.default,oR.default,dR.default,pR.default,tR.default,aR.default,eR.default,sR.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},$T.default,IT.default];jH.default=UT});var U8=R((TH)=>{Object.defineProperty(TH,"__esModule",{value:!0});TH.validateAdditionalItems=void 0;var m4=d(),I8=A$(),DT={message:({params:{len:$}})=>m4.str`must NOT have more than ${$} items`,params:({params:{len:$}})=>m4._`{limit: ${$}}`},AT={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:DT,code($){let{parentSchema:I,it:U}=$,{items:D}=I;if(!Array.isArray(D)){I8.checkStrictMode(U,'"additionalItems" is ignored when "items" is not an array of schemas');return}RH($,D)}};function RH($,I){let{gen:U,schema:D,data:b,keyword:A,it:w}=$;w.items=!0;let O=U.const("len",m4._`${b}.length`);if(D===!1)$.setParams({len:I.length}),$.pass(m4._`${O} <= ${I.length}`);else if(typeof D=="object"&&!I8.alwaysValidSchema(w,D)){let X=U.var("valid",m4._`${O} <= ${I.length}`);U.if(m4.not(X),()=>N(X)),$.ok(X)}function N(X){U.forRange("i",I.length,O,(G)=>{if($.subschema({keyword:A,dataProp:G,dataPropType:I8.Type.Num},X),!w.allErrors)U.if(m4.not(X),()=>U.break())})}}TH.validateAdditionalItems=RH;TH.default=AT});var b8=R((fH)=>{Object.defineProperty(fH,"__esModule",{value:!0});fH.validateTuple=void 0;var CH=d(),rw=A$(),OT=b6(),NT={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code($){let{schema:I,it:U}=$;if(Array.isArray(I))return ZH($,"additionalItems",I);if(U.items=!0,rw.alwaysValidSchema(U,I))return;$.ok(OT.validateArray($))}};function ZH($,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=rw.mergeEvaluated.items(D,U.length,O.items);let N=D.name("valid"),X=D.const("len",CH._`${A}.length`);U.forEach((Q,Y)=>{if(rw.alwaysValidSchema(O,Q))return;D.if(CH._`${X} > ${Y}`,()=>$.subschema({keyword:w,schemaProp:Y,dataProp:Y},N)),$.ok(N)});function G(Q){let{opts:Y,errSchemaPath:B}=O,J=U.length,L=J===Q.minItems&&(J===Q.maxItems||Q[I]===!1);if(Y.strictTuples&&!L){let K=`"${w}" is ${J}-tuple, but minItems or maxItems/${I} are not specified or different at path "${B}"`;rw.checkStrictMode(O,K,Y.strictTuples)}}}fH.validateTuple=ZH;fH.default=NT});var xH=R((yH)=>{Object.defineProperty(yH,"__esModule",{value:!0});var WT=b8(),GT={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:($)=>WT.validateTuple($,"items")};yH.default=GT});var uH=R((hH)=>{Object.defineProperty(hH,"__esModule",{value:!0});var lH=d(),YT=A$(),BT=b6(),vT=U8(),JT={message:({params:{len:$}})=>lH.str`must NOT have more than ${$} items`,params:({params:{len:$}})=>lH._`{limit: ${$}}`},HT={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:JT,code($){let{schema:I,parentSchema:U,it:D}=$,{prefixItems:b}=U;if(D.items=!0,YT.alwaysValidSchema(D,I))return;if(b)vT.validateAdditionalItems($,b);else $.ok(BT.validateArray($))}};hH.default=HT});var nH=R((iH)=>{Object.defineProperty(iH,"__esModule",{value:!0});var D6=d(),cw=A$(),zT={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:zT,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){cw.checkStrictMode(A,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(O!==void 0&&w>O){cw.checkStrictMode(A,'"minContains" > "maxContains" is always invalid'),$.fail();return}if(cw.alwaysValidSchema(A,U)){let L=D6._`${G} >= ${w}`;if(O!==void 0)L=D6._`${L} && ${G} <= ${O}`;$.pass(L);return}A.items=!0;let Q=I.name("valid");if(O===void 0&&w===1)B(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 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:cw.Type.Num,compositeRule:!0},L),K()})}function J(L){if(I.code(D6._`${L}++`),O===void 0)I.if(D6._`${L} >= ${w}`,()=>I.assign(Q,!0).break());else if(I.if(D6._`${L} > ${O}`,()=>I.assign(Q,!1).break()),w===1)I.assign(Q,!0);else I.if(D6._`${L} >= ${w}`,()=>I.assign(Q,!0))}}};iH.default=MT});var pH=R((mH)=>{Object.defineProperty(mH,"__esModule",{value:!0});mH.validateSchemaDeps=mH.validatePropertyDeps=mH.error=void 0;var D8=d(),KT=A$(),wb=b6();mH.error={message:({params:{property:$,depsCount:I,deps:U}})=>{let D=I===1?"property":"properties";return D8.str`must have ${D} ${U} when property ${$} is present`},params:({params:{property:$,depsCount:I,deps:U,missingProperty:D}})=>D8._`{property: ${$},
7
7
  missingProperty: ${D},
8
8
  depsCount: ${I},
9
- deps: ${U}}`};var CZ={keyword:"dependencies",type:"object",schemaType:"object",error:cM.error,code($){let[I,U]=ZZ($);uM($,I),lM($,U)}};function ZZ({schema:$}){let I={},U={};for(let D in $){if(D==="__proto__")continue;let A=Array.isArray($[D])?I:U;A[D]=$[D]}return[I,U]}function uM($,I=$.schema){let{gen:U,data:D,it:A}=$;if(Object.keys(I).length===0)return;let w=U.let("missing");for(let b in I){let N=I[b];if(N.length===0)continue;let O=_U.propertyInData(U,D,b,A.opts.ownProperties);if($.setParams({property:b,depsCount:N.length,deps:N.join(", ")}),A.allErrors)U.if(O,()=>{for(let X of N)_U.checkReportMissingProp($,X)});else U.if(kW._`${O} && (${_U.checkMissingProp($,N,w)})`),_U.reportMissingProp($,w),U.else()}}cM.validatePropertyDeps=uM;function lM($,I=$.schema){let{gen:U,data:D,keyword:A,it:w}=$,b=U.name("valid");for(let N in I){if(_Z.alwaysValidSchema(w,I[N]))continue;U.if(_U.propertyInData(U,D,N,w.opts.ownProperties),()=>{let O=$.subschema({keyword:A,schemaProp:N},b);$.mergeValidEvaluated(O,b)},()=>U.var(b,!0)),$.ok(b)}}cM.validateSchemaDeps=lM;cM.default=CZ});var dM=C((oM)=>{Object.defineProperty(oM,"__esModule",{value:!0});var nM=a(),hZ=N$(),fZ={message:"property name must be valid",params:({params:$})=>nM._`{propertyName: ${$.propertyName}}`},yZ={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:fZ,code($){let{gen:I,schema:U,data:D,it:A}=$;if(hZ.alwaysValidSchema(A,U))return;let w=I.name("valid");I.forIn("key",D,(b)=>{$.setParams({propertyName:b}),$.subschema({keyword:"propertyNames",data:b,dataTypes:["string"],propertyName:b,compositeRule:!0},w),I.if(nM.not(w),()=>{if($.error(!0),!A.allErrors)I.break()})}),$.ok(w)}};oM.default=yZ});var PW=C((pM)=>{Object.defineProperty(pM,"__esModule",{value:!0});var hD=H6(),P6=a(),lZ=s6(),fD=N$(),cZ={message:"must NOT have additional properties",params:({params:$})=>P6._`{additionalProperty: ${$.additionalProperty}}`},mZ={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:cZ,code($){let{gen:I,schema:U,parentSchema:D,data:A,errsCount:w,it:b}=$;if(!w)throw new Error("ajv implementation error");let{allErrors:N,opts:O}=b;if(b.props=!0,O.removeAdditional!=="all"&&fD.alwaysValidSchema(b,U))return;let X=hD.allSchemaProperties(D.properties),W=hD.allSchemaProperties(D.patternProperties);Q(),$.ok(P6._`${w} === ${lZ.default.errors}`);function Q(){I.forIn("key",A,(v)=>{if(!X.length&&!W.length)J(v);else I.if(B(v),()=>J(v))})}function B(v){let V;if(X.length>8){let F=fD.schemaRefOrVal(b,D.properties,"properties");V=hD.isOwnProperty(I,F,v)}else if(X.length)V=P6.or(...X.map((F)=>P6._`${v} === ${F}`));else V=P6.nil;if(W.length)V=P6.or(V,...W.map((F)=>P6._`${hD.usePattern($,F)}.test(${v})`));return P6.not(V)}function Y(v){I.code(P6._`delete ${A}[${v}]`)}function J(v){if(O.removeAdditional==="all"||O.removeAdditional&&U===!1){Y(v);return}if(U===!1){if($.setParams({additionalProperty:v}),$.error(),!N)I.break();return}if(typeof U=="object"&&!fD.alwaysValidSchema(b,U)){let V=I.name("valid");if(O.removeAdditional==="failing")H(v,V,!1),I.if(P6.not(V),()=>{$.reset(),Y(v)});else if(H(v,V),!N)I.if(P6.not(V),()=>I.break())}}function H(v,V,F){let k={keyword:"additionalProperties",dataProp:v,dataPropType:fD.Type.Str};if(F===!1)Object.assign(k,{compositeRule:!0,createErrors:!1,allErrors:!1});$.subschema(k,V)}}};pM.default=mZ});var sM=C((eM)=>{Object.defineProperty(eM,"__esModule",{value:!0});var iZ=KU(),tM=H6(),RW=N$(),aM=PW(),nZ={keyword:"properties",type:"object",schemaType:"object",code($){let{gen:I,schema:U,parentSchema:D,data:A,it:w}=$;if(w.opts.removeAdditional==="all"&&D.additionalProperties===void 0)aM.default.code(new iZ.KeywordCxt(w,aM.default,"additionalProperties"));let b=tM.allSchemaProperties(U);for(let Q of b)w.definedProperties.add(Q);if(w.opts.unevaluated&&b.length&&w.props!==!0)w.props=RW.mergeEvaluated.props(I,RW.toHash(b),w.props);let N=b.filter((Q)=>!RW.alwaysValidSchema(w,U[Q]));if(N.length===0)return;let O=I.name("valid");for(let Q of N){if(X(Q))W(Q);else{if(I.if(tM.propertyInData(I,A,Q,w.opts.ownProperties)),W(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 W(Q){$.subschema({keyword:"properties",schemaProp:Q,dataProp:Q},O)}}};eM.default=nZ});var DK=C((AK)=>{Object.defineProperty(AK,"__esModule",{value:!0});var $K=H6(),yD=a(),IK=N$(),UK=N$(),dZ={keyword:"patternProperties",type:"object",schemaType:"object",code($){let{gen:I,schema:U,data:D,parentSchema:A,it:w}=$,{opts:b}=w,N=$K.allSchemaProperties(U),O=N.filter((H)=>IK.alwaysValidSchema(w,U[H]));if(N.length===0||O.length===N.length&&(!w.opts.unevaluated||w.props===!0))return;let X=b.strictSchema&&!b.allowMatchingProperties&&A.properties,W=I.name("valid");if(w.props!==!0&&!(w.props instanceof yD.Name))w.props=UK.evaluatedPropsToName(I,w.props);let{props:Q}=w;B();function B(){for(let H of N){if(X)Y(H);if(w.allErrors)J(H);else I.var(W,!0),J(H),I.if(W)}}function Y(H){for(let v in X)if(new RegExp(H).test(v))IK.checkStrictMode(w,`property ${v} matches pattern ${H} (use allowMatchingProperties)`)}function J(H){I.forIn("key",D,(v)=>{I.if(yD._`${$K.usePattern($,H)}.test(${v})`,()=>{let V=O.includes(H);if(!V)$.subschema({keyword:"patternProperties",schemaProp:H,dataProp:v,dataPropType:UK.Type.Str},W);if(w.opts.unevaluated&&Q!==!0)I.assign(yD._`${Q}[${v}]`,!0);else if(!V&&!w.allErrors)I.if(yD.not(W),()=>I.break())})})}}};AK.default=dZ});var bK=C((wK)=>{Object.defineProperty(wK,"__esModule",{value:!0});var tZ=N$(),aZ={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code($){let{gen:I,schema:U,it:D}=$;if(tZ.alwaysValidSchema(D,U)){$.fail();return}let A=I.name("valid");$.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},A),$.failResult(A,()=>$.reset(),()=>$.error())},error:{message:"must NOT be valid"}};wK.default=aZ});var OK=C((NK)=>{Object.defineProperty(NK,"__esModule",{value:!0});var sZ=H6(),$g={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:sZ.validateUnion,error:{message:"must match a schema in anyOf"}};NK.default=$g});var WK=C((XK)=>{Object.defineProperty(XK,"__esModule",{value:!0});var uD=a(),Ug=N$(),Ag={message:"must match exactly one schema in oneOf",params:({params:$})=>uD._`{passingSchemas: ${$.passing}}`},Dg={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:Ag,code($){let{gen:I,schema:U,parentSchema:D,it:A}=$;if(!Array.isArray(U))throw new Error("ajv implementation error");if(A.opts.discriminator&&D.discriminator)return;let w=U,b=I.let("valid",!1),N=I.let("passing",null),O=I.name("_valid");$.setParams({passing:N}),I.block(X),$.result(b,()=>$.reset(),()=>$.error(!0));function X(){w.forEach((W,Q)=>{let B;if(Ug.alwaysValidSchema(A,W))I.var(O,!0);else B=$.subschema({keyword:"oneOf",schemaProp:Q,compositeRule:!0},O);if(Q>0)I.if(uD._`${O} && ${b}`).assign(b,!1).assign(N,uD._`[${N}, ${Q}]`).else();I.if(O,()=>{if(I.assign(b,!0),I.assign(N,Q),B)$.mergeEvaluated(B,uD.Name)})})}}};XK.default=Dg});var QK=C((GK)=>{Object.defineProperty(GK,"__esModule",{value:!0});var bg=N$(),Ng={keyword:"allOf",schemaType:"array",code($){let{gen:I,schema:U,it:D}=$;if(!Array.isArray(U))throw new Error("ajv implementation error");let A=I.name("valid");U.forEach((w,b)=>{if(bg.alwaysValidSchema(D,w))return;let N=$.subschema({keyword:"allOf",schemaProp:b},A);$.ok(A),$.mergeEvaluated(N)})}};GK.default=Ng});var HK=C((JK)=>{Object.defineProperty(JK,"__esModule",{value:!0});var lD=a(),BK=N$(),Xg={message:({params:$})=>lD.str`must match "${$.ifClause}" schema`,params:({params:$})=>lD._`{failingKeyword: ${$.ifClause}}`},Wg={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:Xg,code($){let{gen:I,parentSchema:U,it:D}=$;if(U.then===void 0&&U.else===void 0)BK.checkStrictMode(D,'"if" without "then" and "else" is ignored');let A=YK(D,"then"),w=YK(D,"else");if(!A&&!w)return;let b=I.let("valid",!0),N=I.name("_valid");if(O(),$.reset(),A&&w){let W=I.let("ifClause");$.setParams({ifClause:W}),I.if(N,X("then",W),X("else",W))}else if(A)I.if(N,X("then"));else I.if(lD.not(N),X("else"));$.pass(b,()=>$.error(!0));function O(){let W=$.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},N);$.mergeEvaluated(W)}function X(W,Q){return()=>{let B=$.subschema({keyword:W},N);if(I.assign(b,N),$.mergeValidEvaluated(B,b),Q)I.assign(Q,lD._`${W}`);else $.setParams({ifClause:W})}}}};function YK($,I){let U=$.schema[I];return U!==void 0&&!BK.alwaysValidSchema($,U)}JK.default=Wg});var zK=C((LK)=>{Object.defineProperty(LK,"__esModule",{value:!0});var Qg=N$(),Yg={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:$,parentSchema:I,it:U}){if(I.if===void 0)Qg.checkStrictMode(U,`"${$}" without "if" is ignored`)}};LK.default=Yg});var KK=C((MK)=>{Object.defineProperty(MK,"__esModule",{value:!0});var Jg=SW(),Hg=ZM(),Lg=jW(),zg=hM(),Mg=yM(),Kg=iM(),Vg=dM(),vg=PW(),qg=sM(),Fg=DK(),Eg=bK(),Sg=OK(),jg=WK(),kg=QK(),Pg=HK(),Rg=zK();function Tg($=!1){let I=[Eg.default,Sg.default,jg.default,kg.default,Pg.default,Rg.default,Vg.default,vg.default,Kg.default,qg.default,Fg.default];if($)I.push(Hg.default,zg.default);else I.push(Jg.default,Lg.default);return I.push(Mg.default),I}MK.default=Tg});var vK=C((VK)=>{Object.defineProperty(VK,"__esModule",{value:!0});var j$=a(),Cg={message:({schemaCode:$})=>j$.str`must match format "${$}"`,params:({schemaCode:$})=>j$._`{format: ${$}}`},Zg={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:Cg,code($,I){let{gen:U,data:D,$data:A,schema:w,schemaCode:b,it:N}=$,{opts:O,errSchemaPath:X,schemaEnv:W,self:Q}=N;if(!O.validateFormats)return;if(A)B();else Y();function B(){let J=U.scopeValue("formats",{ref:Q.formats,code:O.code.formats}),H=U.const("fDef",j$._`${J}[${b}]`),v=U.let("fType"),V=U.let("format");U.if(j$._`typeof ${H} == "object" && !(${H} instanceof RegExp)`,()=>U.assign(v,j$._`${H}.type || "string"`).assign(V,j$._`${H}.validate`),()=>U.assign(v,j$._`"string"`).assign(V,H)),$.fail$data(j$.or(F(),k()));function F(){if(O.strictSchema===!1)return j$.nil;return j$._`${b} && !${V}`}function k(){let h=W.$async?j$._`(${H}.async ? await ${V}(${D}) : ${V}(${D}))`:j$._`${V}(${D})`,l=j$._`(typeof ${V} == "function" ? ${h} : ${V}.test(${D}))`;return j$._`${V} && ${V} !== true && ${v} === ${I} && !${l}`}}function Y(){let J=Q.formats[w];if(!J){F();return}if(J===!0)return;let[H,v,V]=k(J);if(H===I)$.pass(h());function F(){if(O.strictSchema===!1){Q.logger.warn(l());return}throw new Error(l());function l(){return`unknown format "${w}" ignored in schema at path "${X}"`}}function k(l){let l$=l instanceof RegExp?j$.regexpCode(l):O.code.formats?j$._`${O.code.formats}${j$.getProperty(w)}`:void 0,G6=U.scopeValue("formats",{key:w,ref:l,code:l$});if(typeof l=="object"&&!(l instanceof RegExp))return[l.type||"string",l.validate,j$._`${G6}.validate`];return["string",l,G6]}function h(){if(typeof J=="object"&&!(J instanceof RegExp)&&J.async){if(!W.$async)throw new Error("async format in sync schema");return j$._`await ${V}(${D})`}return typeof v=="function"?j$._`${V}(${D})`:j$._`${V}.test(${D})`}}}};VK.default=Zg});var FK=C((qK)=>{Object.defineProperty(qK,"__esModule",{value:!0});var xg=vK(),hg=[xg.default];qK.default=hg});var jK=C((EK)=>{Object.defineProperty(EK,"__esModule",{value:!0});EK.contentVocabulary=EK.metadataVocabulary=void 0;EK.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];EK.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var RK=C((PK)=>{Object.defineProperty(PK,"__esModule",{value:!0});var ug=e3(),lg=EM(),cg=KK(),mg=FK(),kK=jK(),rg=[ug.default,lg.default,cg.default(),mg.default,kK.metadataVocabulary,kK.contentVocabulary];PK.default=rg});var ZK=C((_K)=>{Object.defineProperty(_K,"__esModule",{value:!0});_K.DiscrError=void 0;var TK;(function($){$.Tag="tag",$.Mapping="mapping"})(TK||(_K.DiscrError=TK={}))});var hK=C((xK)=>{Object.defineProperty(xK,"__esModule",{value:!0});var hI=a(),TW=ZK(),gK=vD(),ng=VU(),og=N$(),dg={message:({params:{discrError:$,tagName:I}})=>$===TW.DiscrError.Tag?`tag "${I}" must be string`:`value of tag "${I}" must be in oneOf`,params:({params:{discrError:$,tag:I,tagName:U}})=>hI._`{error: ${$}, tag: ${U}, tagValue: ${I}}`},pg={keyword:"discriminator",type:"object",schemaType:"object",error:dg,code($){let{gen:I,data:U,schema:D,parentSchema:A,it:w}=$,{oneOf:b}=A;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(!b)throw new Error("discriminator: requires oneOf keyword");let O=I.let("valid",!1),X=I.const("tag",hI._`${U}${hI.getProperty(N)}`);I.if(hI._`typeof ${X} == "string"`,()=>W(),()=>$.error(!1,{discrError:TW.DiscrError.Tag,tag:X,tagName:N})),$.ok(O);function W(){let Y=B();I.if(!1);for(let J in Y)I.elseIf(hI._`${X} === ${J}`),I.assign(O,Q(Y[J]));I.else(),$.error(!1,{discrError:TW.DiscrError.Mapping,tag:X,tagName:N}),I.endIf()}function Q(Y){let J=I.name("valid"),H=$.subschema({keyword:"oneOf",schemaProp:Y},J);return $.mergeEvaluated(H,hI.Name),J}function B(){var Y;let J={},H=V(A),v=!0;for(let h=0;h<b.length;h++){let l=b[h];if((l===null||l===void 0?void 0:l.$ref)&&!og.schemaHasRulesButRef(l,w.self.RULES)){let G6=l.$ref;if(l=gK.resolveRef.call(w.self,w.schemaEnv.root,w.baseId,G6),l instanceof gK.SchemaEnv)l=l.schema;if(l===void 0)throw new ng.default(w.opts.uriResolver,w.baseId,G6)}let l$=(Y=l===null||l===void 0?void 0:l.properties)===null||Y===void 0?void 0:Y[N];if(typeof l$!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${N}"`);v=v&&(H||V(l)),F(l$,h)}if(!v)throw new Error(`discriminator: "${N}" must be required`);return J;function V({required:h}){return Array.isArray(h)&&h.includes(N)}function F(h,l){if(h.const)k(h.const,l);else if(h.enum)for(let l$ of h.enum)k(l$,l);else throw new Error(`discriminator: "properties/${N}" must have "const" or "enum"`)}function k(h,l){if(typeof h!="string"||h in J)throw new Error(`discriminator: "${N}" values must be unique strings`);J[h]=l}}}};xK.default=pg});var fK=C((Yd,ag)=>{ag.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 CW=C((I6,_W)=>{Object.defineProperty(I6,"__esModule",{value:!0});I6.MissingRefError=I6.ValidationError=I6.CodeGen=I6.Name=I6.nil=I6.stringify=I6.str=I6._=I6.KeywordCxt=I6.Ajv=void 0;var eg=c3(),sg=RK(),$x=hK(),yK=fK(),Ix=["/properties"],cD="http://json-schema.org/draft-07/schema";class CU extends eg.default{_addVocabularies(){if(super._addVocabularies(),sg.default.forEach(($)=>this.addVocabulary($)),this.opts.discriminator)this.addKeyword($x.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let $=this.opts.$data?this.$dataMetaSchema(yK,Ix):yK;this.addMetaSchema($,cD,!1),this.refs["http://json-schema.org/schema"]=cD}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(cD)?cD:void 0)}}I6.Ajv=CU;_W.exports=I6=CU;_W.exports.Ajv=CU;Object.defineProperty(I6,"__esModule",{value:!0});I6.default=CU;var Ux=KU();Object.defineProperty(I6,"KeywordCxt",{enumerable:!0,get:function(){return Ux.KeywordCxt}});var fI=a();Object.defineProperty(I6,"_",{enumerable:!0,get:function(){return fI._}});Object.defineProperty(I6,"str",{enumerable:!0,get:function(){return fI.str}});Object.defineProperty(I6,"stringify",{enumerable:!0,get:function(){return fI.stringify}});Object.defineProperty(I6,"nil",{enumerable:!0,get:function(){return fI.nil}});Object.defineProperty(I6,"Name",{enumerable:!0,get:function(){return fI.Name}});Object.defineProperty(I6,"CodeGen",{enumerable:!0,get:function(){return fI.CodeGen}});var Ax=KD();Object.defineProperty(I6,"ValidationError",{enumerable:!0,get:function(){return Ax.default}});var Dx=VU();Object.defineProperty(I6,"MissingRefError",{enumerable:!0,get:function(){return Dx.default}})});var pK=C((oK)=>{Object.defineProperty(oK,"__esModule",{value:!0});oK.formatNames=oK.fastFormats=oK.fullFormats=void 0;function y6($,I){return{validate:$,compare:I}}oK.fullFormats={date:y6(mK,hW),time:y6(gW(!0),fW),"date-time":y6(uK(!0),iK),"iso-time":y6(gW(),rK),"iso-date-time":y6(uK(),nK),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:Qx,"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:Mx,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:Yx,int32:{type:"number",validate:Hx},int64:{type:"number",validate:Lx},float:{type:"number",validate:cK},double:{type:"number",validate:cK},password:!0,binary:!0};oK.fastFormats={...oK.fullFormats,date:y6(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,hW),time:y6(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,fW),"date-time":y6(/^\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,iK),"iso-time":y6(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,rK),"iso-date-time":y6(/^\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,nK),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};oK.formatNames=Object.keys(oK.fullFormats);function Nx($){return $%4===0&&($%100!==0||$%400===0)}var Ox=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,Xx=[0,31,28,31,30,31,30,31,31,30,31,30,31];function mK($){let I=Ox.exec($);if(!I)return!1;let U=+I[1],D=+I[2],A=+I[3];return D>=1&&D<=12&&A>=1&&A<=(D===2&&Nx(U)?29:Xx[D])}function hW($,I){if(!($&&I))return;if($>I)return 1;if($<I)return-1;return 0}var ZW=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function gW($){return function I(U){let D=ZW.exec(U);if(!D)return!1;let A=+D[1],w=+D[2],b=+D[3],N=D[4],O=D[5]==="-"?-1:1,X=+(D[6]||0),W=+(D[7]||0);if(X>23||W>59||$&&!N)return!1;if(A<=23&&w<=59&&b<60)return!0;let Q=w-W*O,B=A-X*O-(Q<0?1:0);return(B===23||B===-1)&&(Q===59||Q===-1)&&b<61}}function fW($,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 rK($,I){if(!($&&I))return;let U=ZW.exec($),D=ZW.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 xW=/t|\s/i;function uK($){let I=gW($);return function U(D){let A=D.split(xW);return A.length===2&&mK(A[0])&&I(A[1])}}function iK($,I){if(!($&&I))return;let U=new Date($).valueOf(),D=new Date(I).valueOf();if(!(U&&D))return;return U-D}function nK($,I){if(!($&&I))return;let[U,D]=$.split(xW),[A,w]=I.split(xW),b=hW(U,A);if(b===void 0)return;return b||fW(D,w)}var Wx=/\/|:/,Gx=/^(?:[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 Qx($){return Wx.test($)&&Gx.test($)}var lK=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function Yx($){return lK.lastIndex=0,lK.test($)}var Bx=-2147483648,Jx=2147483647;function Hx($){return Number.isInteger($)&&$<=Jx&&$>=Bx}function Lx($){return Number.isInteger($)}function cK(){return!0}var zx=/[^\\]\\Z/;function Mx($){if(zx.test($))return!1;try{return new RegExp($),!0}catch(I){return!1}}});var aK=C((tK)=>{Object.defineProperty(tK,"__esModule",{value:!0});tK.formatLimitDefinition=void 0;var Vx=CW(),R6=a(),q4=R6.operators,mD={formatMaximum:{okStr:"<=",ok:q4.LTE,fail:q4.GT},formatMinimum:{okStr:">=",ok:q4.GTE,fail:q4.LT},formatExclusiveMaximum:{okStr:"<",ok:q4.LT,fail:q4.GTE},formatExclusiveMinimum:{okStr:">",ok:q4.GT,fail:q4.LTE}},vx={message:({keyword:$,schemaCode:I})=>R6.str`should be ${mD[$].okStr} ${I}`,params:({keyword:$,schemaCode:I})=>R6._`{comparison: ${mD[$].okStr}, limit: ${I}}`};tK.formatLimitDefinition={keyword:Object.keys(mD),type:"string",schemaType:"string",$data:!0,error:vx,code($){let{gen:I,data:U,schemaCode:D,keyword:A,it:w}=$,{opts:b,self:N}=w;if(!b.validateFormats)return;let O=new Vx.KeywordCxt(w,N.RULES.all.format.definition,"format");if(O.$data)X();else W();function X(){let B=I.scopeValue("formats",{ref:N.formats,code:b.code.formats}),Y=I.const("fmt",R6._`${B}[${O.schemaCode}]`);$.fail$data(R6.or(R6._`typeof ${Y} != "object"`,R6._`${Y} instanceof RegExp`,R6._`typeof ${Y}.compare != "function"`,Q(Y)))}function W(){let B=O.schema,Y=N.formats[B];if(!Y||Y===!0)return;if(typeof Y!="object"||Y instanceof RegExp||typeof Y.compare!="function")throw new Error(`"${A}": format "${B}" does not define "compare" function`);let J=I.scopeValue("formats",{key:B,ref:Y,code:b.code.formats?R6._`${b.code.formats}${R6.getProperty(B)}`:void 0});$.fail$data(Q(J))}function Q(B){return R6._`${B}.compare(${U}, ${D}) ${mD[A].fail} 0`}},dependencies:["format"]};var qx=($)=>{return $.addKeyword(tK.formatLimitDefinition),$};tK.default=qx});var IV=C((ZU,$V)=>{Object.defineProperty(ZU,"__esModule",{value:!0});var yI=pK(),Ex=aK(),lW=a(),eK=new lW.Name("fullFormats"),Sx=new lW.Name("fastFormats"),cW=($,I={keywords:!0})=>{if(Array.isArray(I))return sK($,I,yI.fullFormats,eK),$;let[U,D]=I.mode==="fast"?[yI.fastFormats,Sx]:[yI.fullFormats,eK],A=I.formats||yI.formatNames;if(sK($,A,U,D),I.keywords)Ex.default($);return $};cW.get=($,I="full")=>{let D=(I==="fast"?yI.fastFormats:yI.fullFormats)[$];if(!D)throw new Error(`Unknown format "${$}"`);return D};function sK($,I,U,D){var A,w;(A=(w=$.opts.code).formats)!==null&&A!==void 0||(w.formats=lW._`require("ajv-formats/dist/formats").${D}`);for(let b of I)$.addFormat(b,U[b])}$V.exports=ZU=cW;Object.defineProperty(ZU,"__esModule",{value:!0});ZU.default=cW});var $$;(function($){$.assertEqual=(A)=>{};function I(A){}$.assertIs=I;function U(A){throw new Error}$.assertNever=U,$.arrayToEnum=(A)=>{let w={};for(let b of A)w[b]=b;return w},$.getValidEnumValues=(A)=>{let w=$.objectKeys(A).filter((N)=>typeof A[A[N]]!=="number"),b={};for(let N of w)b[N]=A[N];return $.objectValues(b)},$.objectValues=(A)=>{return $.objectKeys(A).map(function(w){return A[w]})},$.objectKeys=typeof Object.keys==="function"?(A)=>Object.keys(A):(A)=>{let w=[];for(let b in A)if(Object.prototype.hasOwnProperty.call(A,b))w.push(b);return w},$.find=(A,w)=>{for(let b of A)if(w(b))return b;return},$.isInteger=typeof Number.isInteger==="function"?(A)=>Number.isInteger(A):(A)=>typeof A==="number"&&Number.isFinite(A)&&Math.floor(A)===A;function D(A,w=" | "){return A.map((b)=>typeof b==="string"?`'${b}'`:b).join(w)}$.joinValues=D,$.jsonStringifyReplacer=(A,w)=>{if(typeof w==="bigint")return w.toString();return w}})($$||($$={}));var x5;(function($){$.mergeShapes=(I,U)=>{return{...I,...U}}})(x5||(x5={}));var R=$$.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),o6=($)=>{switch(typeof $){case"undefined":return R.undefined;case"string":return R.string;case"number":return Number.isNaN($)?R.nan:R.number;case"boolean":return R.boolean;case"function":return R.function;case"bigint":return R.bigint;case"symbol":return R.symbol;case"object":if(Array.isArray($))return R.array;if($===null)return R.null;if($.then&&typeof $.then==="function"&&$.catch&&typeof $.catch==="function")return R.promise;if(typeof Map!=="undefined"&&$ instanceof Map)return R.map;if(typeof Set!=="undefined"&&$ instanceof Set)return R.set;if(typeof Date!=="undefined"&&$ instanceof Date)return R.date;return R.object;default:return R.unknown}};var q=$$.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 w6 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(A){return A.message},U={_errors:[]},D=(A)=>{for(let w of A.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 b=U,N=0;while(N<w.path.length){let O=w.path[N];if(N!==w.path.length-1)b[O]=b[O]||{_errors:[]};else b[O]=b[O]||{_errors:[]},b[O]._errors.push(I(w));b=b[O],N++}}};return D(this),U}static assert($){if(!($ instanceof w6))throw new Error(`Not a ZodError: ${$}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,$$.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten($=(I)=>I.message){let I={},U=[];for(let D of this.issues)if(D.path.length>0){let A=D.path[0];I[A]=I[A]||[],I[A].push($(D))}else U.push($(D));return{formErrors:U,fieldErrors:I}}get formErrors(){return this.flatten()}}w6.create=($)=>{return new w6($)};var bE=($,I)=>{let U;switch($.code){case q.invalid_type:if($.received===R.undefined)U="Required";else U=`Expected ${$.expected}, received ${$.received}`;break;case q.invalid_literal:U=`Invalid literal value, expected ${JSON.stringify($.expected,$$.jsonStringifyReplacer)}`;break;case q.unrecognized_keys:U=`Unrecognized key(s) in object: ${$$.joinValues($.keys,", ")}`;break;case q.invalid_union:U="Invalid input";break;case q.invalid_union_discriminator:U=`Invalid discriminator value. Expected ${$$.joinValues($.options)}`;break;case q.invalid_enum_value:U=`Invalid enum value. Expected ${$$.joinValues($.options)}, received '${$.received}'`;break;case q.invalid_arguments:U="Invalid function arguments";break;case q.invalid_return_type:U="Invalid function return type";break;case q.invalid_date:U="Invalid date";break;case q.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 $$.assertNever($.validation);else if($.validation!=="regex")U=`Invalid ${$.validation}`;else U="Invalid";break;case q.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 q.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 q.custom:U="Invalid input";break;case q.invalid_intersection_types:U="Intersection results could not be merged";break;case q.not_multiple_of:U=`Number must be a multiple of ${$.multipleOf}`;break;case q.not_finite:U="Number must be finite";break;default:U=I.defaultError,$$.assertNever($)}return{message:U}},O4=bE;var NE=O4;function P1(){return NE}var AA=($)=>{let{data:I,path:U,errorMaps:D,issueData:A}=$,w=[...U,...A.path||[]],b={...A,path:w};if(A.message!==void 0)return{...A,path:w,message:A.message};let N="",O=D.filter((X)=>!!X).slice().reverse();for(let X of O)N=X(b,{data:I,defaultError:N}).message;return{...A,path:w,message:N}};function T($,I){let U=P1(),D=AA({issueData:I,data:$.data,path:$.path,errorMaps:[$.common.contextualErrorMap,$.schemaErrorMap,U,U===O4?void 0:O4].filter((A)=>!!A)});$.common.issues.push(D)}class f${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 r;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 A=await D.key,w=await D.value;U.push({key:A,value:w})}return f$.mergeObjectSync($,U)}static mergeObjectSync($,I){let U={};for(let D of I){let{key:A,value:w}=D;if(A.status==="aborted")return r;if(w.status==="aborted")return r;if(A.status==="dirty")$.dirty();if(w.status==="dirty")$.dirty();if(A.value!=="__proto__"&&(typeof w.value!=="undefined"||D.alwaysSet))U[A.value]=w.value}return{status:$.value,value:U}}}var r=Object.freeze({status:"aborted"}),JI=($)=>({status:"dirty",value:$}),c$=($)=>({status:"valid",value:$}),$N=($)=>$.status==="aborted",IN=($)=>$.status==="dirty",y4=($)=>$.status==="valid",R1=($)=>typeof Promise!=="undefined"&&$ instanceof Promise;var x;(function($){$.errToObj=(I)=>typeof I==="string"?{message:I}:I||{},$.toString=(I)=>typeof I==="string"?I:I?.message})(x||(x={}));class V6{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 h5=($,I)=>{if(y4(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 w6($.common.issues);return this._error=U,this._error}}}};function d($){if(!$)return{};let{errorMap:I,invalid_type_error:U,required_error:D,description:A}=$;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:A};return{errorMap:(b,N)=>{let{message:O}=$;if(b.code==="invalid_enum_value")return{message:O??N.defaultError};if(typeof N.data==="undefined")return{message:O??D??N.defaultError};if(b.code!=="invalid_type")return{message:N.defaultError};return{message:O??U??N.defaultError}},description:A}}class e{get description(){return this._def.description}_getType($){return o6($.data)}_getOrReturnCtx($,I){return I||{common:$.parent.common,data:$.data,parsedType:o6($.data),schemaErrorMap:this._def.errorMap,path:$.path,parent:$.parent}}_processInputParams($){return{status:new f$,ctx:{common:$.parent.common,data:$.data,parsedType:o6($.data),schemaErrorMap:this._def.errorMap,path:$.path,parent:$.parent}}}_parseSync($){let I=this._parse($);if(R1(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:o6($)},D=this._parseSync({data:$,path:U.path,parent:U});return h5(U,D)}"~validate"($){let I={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:o6($)};if(!this["~standard"].async)try{let U=this._parseSync({data:$,path:[],parent:I});return y4(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)=>y4(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:o6($)},D=this._parse({data:$,path:U.path,parent:U}),A=await(R1(D)?D:Promise.resolve(D));return h5(U,A)}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,A)=>{let w=$(D),b=()=>A.addIssue({code:q.custom,...U(D)});if(typeof Promise!=="undefined"&&w instanceof Promise)return w.then((N)=>{if(!N)return b(),!1;else return!0});if(!w)return b(),!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 g6({schema:this,typeName:E.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 Q6.create(this,this._def)}nullable(){return X4.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Z6.create(this)}promise(){return KI.create(this,this._def)}or($){return g1.create([this,$],this._def)}and($){return x1.create(this,$,this._def)}transform($){return new g6({...d(this._def),schema:this,typeName:E.ZodEffects,effect:{type:"transform",transform:$}})}default($){let I=typeof $==="function"?$:()=>$;return new u1({...d(this._def),innerType:this,defaultValue:I,typeName:E.ZodDefault})}brand(){return new wN({typeName:E.ZodBranded,type:this,...d(this._def)})}catch($){let I=typeof $==="function"?$:()=>$;return new l1({...d(this._def),innerType:this,catchValue:I,typeName:E.ZodCatch})}describe($){return new this.constructor({...this._def,description:$})}pipe($){return GA.create(this,$)}readonly(){return c1.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}var OE=/^c[^\s-]{8,}$/i,XE=/^[0-9a-z]+$/,WE=/^[0-9A-HJKMNP-TV-Z]{26}$/i,GE=/^[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,QE=/^[a-z0-9_-]{21}$/i,YE=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,BE=/^[-+]?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)?)??$/,JE=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,HE="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",UN,LE=/^(?:(?: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])$/,zE=/^(?:(?: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])$/,ME=/^(([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]))$/,KE=/^(([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])$/,VE=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,vE=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,f5="((\\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])))",qE=new RegExp(`^${f5}$`);function y5($){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 FE($){return new RegExp(`^${y5($)}$`)}function EE($){let I=`${f5}T${y5($)}`,U=[];if(U.push($.local?"Z?":"Z"),$.offset)U.push("([+-]\\d{2}:?\\d{2})");return I=`${I}(${U.join("|")})`,new RegExp(`^${I}$`)}function SE($,I){if((I==="v4"||!I)&&LE.test($))return!0;if((I==="v6"||!I)&&ME.test($))return!0;return!1}function jE($,I){if(!YE.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,"="),A=JSON.parse(atob(D));if(typeof A!=="object"||A===null)return!1;if("typ"in A&&A?.typ!=="JWT")return!1;if(!A.alg)return!1;if(I&&A.alg!==I)return!1;return!0}catch{return!1}}function kE($,I){if((I==="v4"||!I)&&zE.test($))return!0;if((I==="v6"||!I)&&KE.test($))return!0;return!1}class p6 extends e{_parse($){if(this._def.coerce)$.data=String($.data);if(this._getType($)!==R.string){let A=this._getOrReturnCtx($);return T(A,{code:q.invalid_type,expected:R.string,received:A.parsedType}),r}let U=new f$,D=void 0;for(let A of this._def.checks)if(A.kind==="min"){if($.data.length<A.value)D=this._getOrReturnCtx($,D),T(D,{code:q.too_small,minimum:A.value,type:"string",inclusive:!0,exact:!1,message:A.message}),U.dirty()}else if(A.kind==="max"){if($.data.length>A.value)D=this._getOrReturnCtx($,D),T(D,{code:q.too_big,maximum:A.value,type:"string",inclusive:!0,exact:!1,message:A.message}),U.dirty()}else if(A.kind==="length"){let w=$.data.length>A.value,b=$.data.length<A.value;if(w||b){if(D=this._getOrReturnCtx($,D),w)T(D,{code:q.too_big,maximum:A.value,type:"string",inclusive:!0,exact:!0,message:A.message});else if(b)T(D,{code:q.too_small,minimum:A.value,type:"string",inclusive:!0,exact:!0,message:A.message});U.dirty()}}else if(A.kind==="email"){if(!JE.test($.data))D=this._getOrReturnCtx($,D),T(D,{validation:"email",code:q.invalid_string,message:A.message}),U.dirty()}else if(A.kind==="emoji"){if(!UN)UN=new RegExp(HE,"u");if(!UN.test($.data))D=this._getOrReturnCtx($,D),T(D,{validation:"emoji",code:q.invalid_string,message:A.message}),U.dirty()}else if(A.kind==="uuid"){if(!GE.test($.data))D=this._getOrReturnCtx($,D),T(D,{validation:"uuid",code:q.invalid_string,message:A.message}),U.dirty()}else if(A.kind==="nanoid"){if(!QE.test($.data))D=this._getOrReturnCtx($,D),T(D,{validation:"nanoid",code:q.invalid_string,message:A.message}),U.dirty()}else if(A.kind==="cuid"){if(!OE.test($.data))D=this._getOrReturnCtx($,D),T(D,{validation:"cuid",code:q.invalid_string,message:A.message}),U.dirty()}else if(A.kind==="cuid2"){if(!XE.test($.data))D=this._getOrReturnCtx($,D),T(D,{validation:"cuid2",code:q.invalid_string,message:A.message}),U.dirty()}else if(A.kind==="ulid"){if(!WE.test($.data))D=this._getOrReturnCtx($,D),T(D,{validation:"ulid",code:q.invalid_string,message:A.message}),U.dirty()}else if(A.kind==="url")try{new URL($.data)}catch{D=this._getOrReturnCtx($,D),T(D,{validation:"url",code:q.invalid_string,message:A.message}),U.dirty()}else if(A.kind==="regex"){if(A.regex.lastIndex=0,!A.regex.test($.data))D=this._getOrReturnCtx($,D),T(D,{validation:"regex",code:q.invalid_string,message:A.message}),U.dirty()}else if(A.kind==="trim")$.data=$.data.trim();else if(A.kind==="includes"){if(!$.data.includes(A.value,A.position))D=this._getOrReturnCtx($,D),T(D,{code:q.invalid_string,validation:{includes:A.value,position:A.position},message:A.message}),U.dirty()}else if(A.kind==="toLowerCase")$.data=$.data.toLowerCase();else if(A.kind==="toUpperCase")$.data=$.data.toUpperCase();else if(A.kind==="startsWith"){if(!$.data.startsWith(A.value))D=this._getOrReturnCtx($,D),T(D,{code:q.invalid_string,validation:{startsWith:A.value},message:A.message}),U.dirty()}else if(A.kind==="endsWith"){if(!$.data.endsWith(A.value))D=this._getOrReturnCtx($,D),T(D,{code:q.invalid_string,validation:{endsWith:A.value},message:A.message}),U.dirty()}else if(A.kind==="datetime"){if(!EE(A).test($.data))D=this._getOrReturnCtx($,D),T(D,{code:q.invalid_string,validation:"datetime",message:A.message}),U.dirty()}else if(A.kind==="date"){if(!qE.test($.data))D=this._getOrReturnCtx($,D),T(D,{code:q.invalid_string,validation:"date",message:A.message}),U.dirty()}else if(A.kind==="time"){if(!FE(A).test($.data))D=this._getOrReturnCtx($,D),T(D,{code:q.invalid_string,validation:"time",message:A.message}),U.dirty()}else if(A.kind==="duration"){if(!BE.test($.data))D=this._getOrReturnCtx($,D),T(D,{validation:"duration",code:q.invalid_string,message:A.message}),U.dirty()}else if(A.kind==="ip"){if(!SE($.data,A.version))D=this._getOrReturnCtx($,D),T(D,{validation:"ip",code:q.invalid_string,message:A.message}),U.dirty()}else if(A.kind==="jwt"){if(!jE($.data,A.alg))D=this._getOrReturnCtx($,D),T(D,{validation:"jwt",code:q.invalid_string,message:A.message}),U.dirty()}else if(A.kind==="cidr"){if(!kE($.data,A.version))D=this._getOrReturnCtx($,D),T(D,{validation:"cidr",code:q.invalid_string,message:A.message}),U.dirty()}else if(A.kind==="base64"){if(!VE.test($.data))D=this._getOrReturnCtx($,D),T(D,{validation:"base64",code:q.invalid_string,message:A.message}),U.dirty()}else if(A.kind==="base64url"){if(!vE.test($.data))D=this._getOrReturnCtx($,D),T(D,{validation:"base64url",code:q.invalid_string,message:A.message}),U.dirty()}else $$.assertNever(A);return{status:U.value,value:$.data}}_regex($,I,U){return this.refinement((D)=>$.test(D),{validation:I,code:q.invalid_string,...x.errToObj(U)})}_addCheck($){return new p6({...this._def,checks:[...this._def.checks,$]})}email($){return this._addCheck({kind:"email",...x.errToObj($)})}url($){return this._addCheck({kind:"url",...x.errToObj($)})}emoji($){return this._addCheck({kind:"emoji",...x.errToObj($)})}uuid($){return this._addCheck({kind:"uuid",...x.errToObj($)})}nanoid($){return this._addCheck({kind:"nanoid",...x.errToObj($)})}cuid($){return this._addCheck({kind:"cuid",...x.errToObj($)})}cuid2($){return this._addCheck({kind:"cuid2",...x.errToObj($)})}ulid($){return this._addCheck({kind:"ulid",...x.errToObj($)})}base64($){return this._addCheck({kind:"base64",...x.errToObj($)})}base64url($){return this._addCheck({kind:"base64url",...x.errToObj($)})}jwt($){return this._addCheck({kind:"jwt",...x.errToObj($)})}ip($){return this._addCheck({kind:"ip",...x.errToObj($)})}cidr($){return this._addCheck({kind:"cidr",...x.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,...x.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,...x.errToObj($?.message)})}duration($){return this._addCheck({kind:"duration",...x.errToObj($)})}regex($,I){return this._addCheck({kind:"regex",regex:$,...x.errToObj(I)})}includes($,I){return this._addCheck({kind:"includes",value:$,position:I?.position,...x.errToObj(I?.message)})}startsWith($,I){return this._addCheck({kind:"startsWith",value:$,...x.errToObj(I)})}endsWith($,I){return this._addCheck({kind:"endsWith",value:$,...x.errToObj(I)})}min($,I){return this._addCheck({kind:"min",value:$,...x.errToObj(I)})}max($,I){return this._addCheck({kind:"max",value:$,...x.errToObj(I)})}length($,I){return this._addCheck({kind:"length",value:$,...x.errToObj(I)})}nonempty($){return this.min(1,x.errToObj($))}trim(){return new p6({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new p6({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new p6({...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 $}}p6.create=($)=>{return new p6({checks:[],typeName:E.ZodString,coerce:$?.coerce??!1,...d($)})};function PE($,I){let U=($.toString().split(".")[1]||"").length,D=(I.toString().split(".")[1]||"").length,A=U>D?U:D,w=Number.parseInt($.toFixed(A).replace(".","")),b=Number.parseInt(I.toFixed(A).replace(".",""));return w%b/10**A}class LI extends e{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($)!==R.number){let A=this._getOrReturnCtx($);return T(A,{code:q.invalid_type,expected:R.number,received:A.parsedType}),r}let U=void 0,D=new f$;for(let A of this._def.checks)if(A.kind==="int"){if(!$$.isInteger($.data))U=this._getOrReturnCtx($,U),T(U,{code:q.invalid_type,expected:"integer",received:"float",message:A.message}),D.dirty()}else if(A.kind==="min"){if(A.inclusive?$.data<A.value:$.data<=A.value)U=this._getOrReturnCtx($,U),T(U,{code:q.too_small,minimum:A.value,type:"number",inclusive:A.inclusive,exact:!1,message:A.message}),D.dirty()}else if(A.kind==="max"){if(A.inclusive?$.data>A.value:$.data>=A.value)U=this._getOrReturnCtx($,U),T(U,{code:q.too_big,maximum:A.value,type:"number",inclusive:A.inclusive,exact:!1,message:A.message}),D.dirty()}else if(A.kind==="multipleOf"){if(PE($.data,A.value)!==0)U=this._getOrReturnCtx($,U),T(U,{code:q.not_multiple_of,multipleOf:A.value,message:A.message}),D.dirty()}else if(A.kind==="finite"){if(!Number.isFinite($.data))U=this._getOrReturnCtx($,U),T(U,{code:q.not_finite,message:A.message}),D.dirty()}else $$.assertNever(A);return{status:D.value,value:$.data}}gte($,I){return this.setLimit("min",$,!0,x.toString(I))}gt($,I){return this.setLimit("min",$,!1,x.toString(I))}lte($,I){return this.setLimit("max",$,!0,x.toString(I))}lt($,I){return this.setLimit("max",$,!1,x.toString(I))}setLimit($,I,U,D){return new LI({...this._def,checks:[...this._def.checks,{kind:$,value:I,inclusive:U,message:x.toString(D)}]})}_addCheck($){return new LI({...this._def,checks:[...this._def.checks,$]})}int($){return this._addCheck({kind:"int",message:x.toString($)})}positive($){return this._addCheck({kind:"min",value:0,inclusive:!1,message:x.toString($)})}negative($){return this._addCheck({kind:"max",value:0,inclusive:!1,message:x.toString($)})}nonpositive($){return this._addCheck({kind:"max",value:0,inclusive:!0,message:x.toString($)})}nonnegative($){return this._addCheck({kind:"min",value:0,inclusive:!0,message:x.toString($)})}multipleOf($,I){return this._addCheck({kind:"multipleOf",value:$,message:x.toString(I)})}finite($){return this._addCheck({kind:"finite",message:x.toString($)})}safe($){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:x.toString($)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:x.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"&&$$.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($)}}LI.create=($)=>{return new LI({checks:[],typeName:E.ZodNumber,coerce:$?.coerce||!1,...d($)})};class zI extends e{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($)!==R.bigint)return this._getInvalidInput($);let U=void 0,D=new f$;for(let A of this._def.checks)if(A.kind==="min"){if(A.inclusive?$.data<A.value:$.data<=A.value)U=this._getOrReturnCtx($,U),T(U,{code:q.too_small,type:"bigint",minimum:A.value,inclusive:A.inclusive,message:A.message}),D.dirty()}else if(A.kind==="max"){if(A.inclusive?$.data>A.value:$.data>=A.value)U=this._getOrReturnCtx($,U),T(U,{code:q.too_big,type:"bigint",maximum:A.value,inclusive:A.inclusive,message:A.message}),D.dirty()}else if(A.kind==="multipleOf"){if($.data%A.value!==BigInt(0))U=this._getOrReturnCtx($,U),T(U,{code:q.not_multiple_of,multipleOf:A.value,message:A.message}),D.dirty()}else $$.assertNever(A);return{status:D.value,value:$.data}}_getInvalidInput($){let I=this._getOrReturnCtx($);return T(I,{code:q.invalid_type,expected:R.bigint,received:I.parsedType}),r}gte($,I){return this.setLimit("min",$,!0,x.toString(I))}gt($,I){return this.setLimit("min",$,!1,x.toString(I))}lte($,I){return this.setLimit("max",$,!0,x.toString(I))}lt($,I){return this.setLimit("max",$,!1,x.toString(I))}setLimit($,I,U,D){return new zI({...this._def,checks:[...this._def.checks,{kind:$,value:I,inclusive:U,message:x.toString(D)}]})}_addCheck($){return new zI({...this._def,checks:[...this._def.checks,$]})}positive($){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:x.toString($)})}negative($){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:x.toString($)})}nonpositive($){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:x.toString($)})}nonnegative($){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:x.toString($)})}multipleOf($,I){return this._addCheck({kind:"multipleOf",value:$,message:x.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 $}}zI.create=($)=>{return new zI({checks:[],typeName:E.ZodBigInt,coerce:$?.coerce??!1,...d($)})};class DA extends e{_parse($){if(this._def.coerce)$.data=Boolean($.data);if(this._getType($)!==R.boolean){let U=this._getOrReturnCtx($);return T(U,{code:q.invalid_type,expected:R.boolean,received:U.parsedType}),r}return c$($.data)}}DA.create=($)=>{return new DA({typeName:E.ZodBoolean,coerce:$?.coerce||!1,...d($)})};class _1 extends e{_parse($){if(this._def.coerce)$.data=new Date($.data);if(this._getType($)!==R.date){let A=this._getOrReturnCtx($);return T(A,{code:q.invalid_type,expected:R.date,received:A.parsedType}),r}if(Number.isNaN($.data.getTime())){let A=this._getOrReturnCtx($);return T(A,{code:q.invalid_date}),r}let U=new f$,D=void 0;for(let A of this._def.checks)if(A.kind==="min"){if($.data.getTime()<A.value)D=this._getOrReturnCtx($,D),T(D,{code:q.too_small,message:A.message,inclusive:!0,exact:!1,minimum:A.value,type:"date"}),U.dirty()}else if(A.kind==="max"){if($.data.getTime()>A.value)D=this._getOrReturnCtx($,D),T(D,{code:q.too_big,message:A.message,inclusive:!0,exact:!1,maximum:A.value,type:"date"}),U.dirty()}else $$.assertNever(A);return{status:U.value,value:new Date($.data.getTime())}}_addCheck($){return new _1({...this._def,checks:[...this._def.checks,$]})}min($,I){return this._addCheck({kind:"min",value:$.getTime(),message:x.toString(I)})}max($,I){return this._addCheck({kind:"max",value:$.getTime(),message:x.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}}_1.create=($)=>{return new _1({checks:[],coerce:$?.coerce||!1,typeName:E.ZodDate,...d($)})};class wA extends e{_parse($){if(this._getType($)!==R.symbol){let U=this._getOrReturnCtx($);return T(U,{code:q.invalid_type,expected:R.symbol,received:U.parsedType}),r}return c$($.data)}}wA.create=($)=>{return new wA({typeName:E.ZodSymbol,...d($)})};class C1 extends e{_parse($){if(this._getType($)!==R.undefined){let U=this._getOrReturnCtx($);return T(U,{code:q.invalid_type,expected:R.undefined,received:U.parsedType}),r}return c$($.data)}}C1.create=($)=>{return new C1({typeName:E.ZodUndefined,...d($)})};class Z1 extends e{_parse($){if(this._getType($)!==R.null){let U=this._getOrReturnCtx($);return T(U,{code:q.invalid_type,expected:R.null,received:U.parsedType}),r}return c$($.data)}}Z1.create=($)=>{return new Z1({typeName:E.ZodNull,...d($)})};class bA extends e{constructor(){super(...arguments);this._any=!0}_parse($){return c$($.data)}}bA.create=($)=>{return new bA({typeName:E.ZodAny,...d($)})};class u4 extends e{constructor(){super(...arguments);this._unknown=!0}_parse($){return c$($.data)}}u4.create=($)=>{return new u4({typeName:E.ZodUnknown,...d($)})};class t6 extends e{_parse($){let I=this._getOrReturnCtx($);return T(I,{code:q.invalid_type,expected:R.never,received:I.parsedType}),r}}t6.create=($)=>{return new t6({typeName:E.ZodNever,...d($)})};class NA extends e{_parse($){if(this._getType($)!==R.undefined){let U=this._getOrReturnCtx($);return T(U,{code:q.invalid_type,expected:R.void,received:U.parsedType}),r}return c$($.data)}}NA.create=($)=>{return new NA({typeName:E.ZodVoid,...d($)})};class Z6 extends e{_parse($){let{ctx:I,status:U}=this._processInputParams($),D=this._def;if(I.parsedType!==R.array)return T(I,{code:q.invalid_type,expected:R.array,received:I.parsedType}),r;if(D.exactLength!==null){let w=I.data.length>D.exactLength.value,b=I.data.length<D.exactLength.value;if(w||b)T(I,{code:w?q.too_big:q.too_small,minimum:b?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)T(I,{code:q.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)T(I,{code:q.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,b)=>{return D.type._parseAsync(new V6(I,w,I.path,b))})).then((w)=>{return f$.mergeArray(U,w)});let A=[...I.data].map((w,b)=>{return D.type._parseSync(new V6(I,w,I.path,b))});return f$.mergeArray(U,A)}get element(){return this._def.type}min($,I){return new Z6({...this._def,minLength:{value:$,message:x.toString(I)}})}max($,I){return new Z6({...this._def,maxLength:{value:$,message:x.toString(I)}})}length($,I){return new Z6({...this._def,exactLength:{value:$,message:x.toString(I)}})}nonempty($){return this.min(1,$)}}Z6.create=($,I)=>{return new Z6({type:$,minLength:null,maxLength:null,exactLength:null,typeName:E.ZodArray,...d(I)})};function HI($){if($ instanceof S$){let I={};for(let U in $.shape){let D=$.shape[U];I[U]=Q6.create(HI(D))}return new S$({...$._def,shape:()=>I})}else if($ instanceof Z6)return new Z6({...$._def,type:HI($.element)});else if($ instanceof Q6)return Q6.create(HI($.unwrap()));else if($ instanceof X4)return X4.create(HI($.unwrap()));else if($ instanceof a6)return a6.create($.items.map((I)=>HI(I)));else return $}class S$ extends e{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=$$.objectKeys($);return this._cached={shape:$,keys:I},this._cached}_parse($){if(this._getType($)!==R.object){let O=this._getOrReturnCtx($);return T(O,{code:q.invalid_type,expected:R.object,received:O.parsedType}),r}let{status:U,ctx:D}=this._processInputParams($),{shape:A,keys:w}=this._getCached(),b=[];if(!(this._def.catchall instanceof t6&&this._def.unknownKeys==="strip")){for(let O in D.data)if(!w.includes(O))b.push(O)}let N=[];for(let O of w){let X=A[O],W=D.data[O];N.push({key:{status:"valid",value:O},value:X._parse(new V6(D,W,D.path,O)),alwaysSet:O in D.data})}if(this._def.catchall instanceof t6){let O=this._def.unknownKeys;if(O==="passthrough")for(let X of b)N.push({key:{status:"valid",value:X},value:{status:"valid",value:D.data[X]}});else if(O==="strict"){if(b.length>0)T(D,{code:q.unrecognized_keys,keys:b}),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 b){let W=D.data[X];N.push({key:{status:"valid",value:X},value:O._parse(new V6(D,W,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 W=await X.key,Q=await X.value;O.push({key:W,value:Q,alwaysSet:X.alwaysSet})}return O}).then((O)=>{return f$.mergeObjectSync(U,O)});else return f$.mergeObjectSync(U,N)}get shape(){return this._def.shape()}strict($){return x.errToObj,new S$({...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:x.errToObj($).message??D};return{message:D}}}:{}})}strip(){return new S$({...this._def,unknownKeys:"strip"})}passthrough(){return new S$({...this._def,unknownKeys:"passthrough"})}extend($){return new S$({...this._def,shape:()=>({...this._def.shape(),...$})})}merge($){return new S$({unknownKeys:$._def.unknownKeys,catchall:$._def.catchall,shape:()=>({...this._def.shape(),...$._def.shape()}),typeName:E.ZodObject})}setKey($,I){return this.augment({[$]:I})}catchall($){return new S$({...this._def,catchall:$})}pick($){let I={};for(let U of $$.objectKeys($))if($[U]&&this.shape[U])I[U]=this.shape[U];return new S$({...this._def,shape:()=>I})}omit($){let I={};for(let U of $$.objectKeys(this.shape))if(!$[U])I[U]=this.shape[U];return new S$({...this._def,shape:()=>I})}deepPartial(){return HI(this)}partial($){let I={};for(let U of $$.objectKeys(this.shape)){let D=this.shape[U];if($&&!$[U])I[U]=D;else I[U]=D.optional()}return new S$({...this._def,shape:()=>I})}required($){let I={};for(let U of $$.objectKeys(this.shape))if($&&!$[U])I[U]=this.shape[U];else{let A=this.shape[U];while(A instanceof Q6)A=A._def.innerType;I[U]=A}return new S$({...this._def,shape:()=>I})}keyof(){return u5($$.objectKeys(this.shape))}}S$.create=($,I)=>{return new S$({shape:()=>$,unknownKeys:"strip",catchall:t6.create(),typeName:E.ZodObject,...d(I)})};S$.strictCreate=($,I)=>{return new S$({shape:()=>$,unknownKeys:"strict",catchall:t6.create(),typeName:E.ZodObject,...d(I)})};S$.lazycreate=($,I)=>{return new S$({shape:$,unknownKeys:"strip",catchall:t6.create(),typeName:E.ZodObject,...d(I)})};class g1 extends e{_parse($){let{ctx:I}=this._processInputParams($),U=this._def.options;function D(A){for(let b of A)if(b.result.status==="valid")return b.result;for(let b of A)if(b.result.status==="dirty")return I.common.issues.push(...b.ctx.common.issues),b.result;let w=A.map((b)=>new w6(b.ctx.common.issues));return T(I,{code:q.invalid_union,unionErrors:w}),r}if(I.common.async)return Promise.all(U.map(async(A)=>{let w={...I,common:{...I.common,issues:[]},parent:null};return{result:await A._parseAsync({data:I.data,path:I.path,parent:w}),ctx:w}})).then(D);else{let A=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"&&!A)A={result:X,ctx:O};if(O.common.issues.length)w.push(O.common.issues)}if(A)return I.common.issues.push(...A.ctx.common.issues),A.result;let b=w.map((N)=>new w6(N));return T(I,{code:q.invalid_union,unionErrors:b}),r}}get options(){return this._def.options}}g1.create=($,I)=>{return new g1({options:$,typeName:E.ZodUnion,...d(I)})};var d6=($)=>{if($ instanceof h1)return d6($.schema);else if($ instanceof g6)return d6($.innerType());else if($ instanceof f1)return[$.value];else if($ instanceof l4)return $.options;else if($ instanceof y1)return $$.objectValues($.enum);else if($ instanceof u1)return d6($._def.innerType);else if($ instanceof C1)return[void 0];else if($ instanceof Z1)return[null];else if($ instanceof Q6)return[void 0,...d6($.unwrap())];else if($ instanceof X4)return[null,...d6($.unwrap())];else if($ instanceof wN)return d6($.unwrap());else if($ instanceof c1)return d6($.unwrap());else if($ instanceof l1)return d6($._def.innerType);else return[]};class DN extends e{_parse($){let{ctx:I}=this._processInputParams($);if(I.parsedType!==R.object)return T(I,{code:q.invalid_type,expected:R.object,received:I.parsedType}),r;let U=this.discriminator,D=I.data[U],A=this.optionsMap.get(D);if(!A)return T(I,{code:q.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[U]}),r;if(I.common.async)return A._parseAsync({data:I.data,path:I.path,parent:I});else return A._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 A of I){let w=d6(A.shape[$]);if(!w.length)throw new Error(`A discriminator value for key \`${$}\` could not be extracted from all schema options`);for(let b of w){if(D.has(b))throw new Error(`Discriminator property ${String($)} has duplicate value ${String(b)}`);D.set(b,A)}}return new DN({typeName:E.ZodDiscriminatedUnion,discriminator:$,options:I,optionsMap:D,...d(U)})}}function AN($,I){let U=o6($),D=o6(I);if($===I)return{valid:!0,data:$};else if(U===R.object&&D===R.object){let A=$$.objectKeys(I),w=$$.objectKeys($).filter((N)=>A.indexOf(N)!==-1),b={...$,...I};for(let N of w){let O=AN($[N],I[N]);if(!O.valid)return{valid:!1};b[N]=O.data}return{valid:!0,data:b}}else if(U===R.array&&D===R.array){if($.length!==I.length)return{valid:!1};let A=[];for(let w=0;w<$.length;w++){let b=$[w],N=I[w],O=AN(b,N);if(!O.valid)return{valid:!1};A.push(O.data)}return{valid:!0,data:A}}else if(U===R.date&&D===R.date&&+$===+I)return{valid:!0,data:$};else return{valid:!1}}class x1 extends e{_parse($){let{status:I,ctx:U}=this._processInputParams($),D=(A,w)=>{if($N(A)||$N(w))return r;let b=AN(A.value,w.value);if(!b.valid)return T(U,{code:q.invalid_intersection_types}),r;if(IN(A)||IN(w))I.dirty();return{status:I.value,value:b.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(([A,w])=>D(A,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}))}}x1.create=($,I,U)=>{return new x1({left:$,right:I,typeName:E.ZodIntersection,...d(U)})};class a6 extends e{_parse($){let{status:I,ctx:U}=this._processInputParams($);if(U.parsedType!==R.array)return T(U,{code:q.invalid_type,expected:R.array,received:U.parsedType}),r;if(U.data.length<this._def.items.length)return T(U,{code:q.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r;if(!this._def.rest&&U.data.length>this._def.items.length)T(U,{code:q.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),I.dirty();let A=[...U.data].map((w,b)=>{let N=this._def.items[b]||this._def.rest;if(!N)return null;return N._parse(new V6(U,w,U.path,b))}).filter((w)=>!!w);if(U.common.async)return Promise.all(A).then((w)=>{return f$.mergeArray(I,w)});else return f$.mergeArray(I,A)}get items(){return this._def.items}rest($){return new a6({...this._def,rest:$})}}a6.create=($,I)=>{if(!Array.isArray($))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new a6({items:$,typeName:E.ZodTuple,rest:null,...d(I)})};class OA extends e{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse($){let{status:I,ctx:U}=this._processInputParams($);if(U.parsedType!==R.object)return T(U,{code:q.invalid_type,expected:R.object,received:U.parsedType}),r;let D=[],A=this._def.keyType,w=this._def.valueType;for(let b in U.data)D.push({key:A._parse(new V6(U,b,U.path,b)),value:w._parse(new V6(U,U.data[b],U.path,b)),alwaysSet:b in U.data});if(U.common.async)return f$.mergeObjectAsync(I,D);else return f$.mergeObjectSync(I,D)}get element(){return this._def.valueType}static create($,I,U){if(I instanceof e)return new OA({keyType:$,valueType:I,typeName:E.ZodRecord,...d(U)});return new OA({keyType:p6.create(),valueType:$,typeName:E.ZodRecord,...d(I)})}}class XA extends e{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse($){let{status:I,ctx:U}=this._processInputParams($);if(U.parsedType!==R.map)return T(U,{code:q.invalid_type,expected:R.map,received:U.parsedType}),r;let D=this._def.keyType,A=this._def.valueType,w=[...U.data.entries()].map(([b,N],O)=>{return{key:D._parse(new V6(U,b,U.path,[O,"key"])),value:A._parse(new V6(U,N,U.path,[O,"value"]))}});if(U.common.async){let b=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 r;if(O.status==="dirty"||X.status==="dirty")I.dirty();b.set(O.value,X.value)}return{status:I.value,value:b}})}else{let b=new Map;for(let N of w){let{key:O,value:X}=N;if(O.status==="aborted"||X.status==="aborted")return r;if(O.status==="dirty"||X.status==="dirty")I.dirty();b.set(O.value,X.value)}return{status:I.value,value:b}}}}XA.create=($,I,U)=>{return new XA({valueType:I,keyType:$,typeName:E.ZodMap,...d(U)})};class MI extends e{_parse($){let{status:I,ctx:U}=this._processInputParams($);if(U.parsedType!==R.set)return T(U,{code:q.invalid_type,expected:R.set,received:U.parsedType}),r;let D=this._def;if(D.minSize!==null){if(U.data.size<D.minSize.value)T(U,{code:q.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)T(U,{code:q.too_big,maximum:D.maxSize.value,type:"set",inclusive:!0,exact:!1,message:D.maxSize.message}),I.dirty()}let A=this._def.valueType;function w(N){let O=new Set;for(let X of N){if(X.status==="aborted")return r;if(X.status==="dirty")I.dirty();O.add(X.value)}return{status:I.value,value:O}}let b=[...U.data.values()].map((N,O)=>A._parse(new V6(U,N,U.path,O)));if(U.common.async)return Promise.all(b).then((N)=>w(N));else return w(b)}min($,I){return new MI({...this._def,minSize:{value:$,message:x.toString(I)}})}max($,I){return new MI({...this._def,maxSize:{value:$,message:x.toString(I)}})}size($,I){return this.min($,I).max($,I)}nonempty($){return this.min(1,$)}}MI.create=($,I)=>{return new MI({valueType:$,minSize:null,maxSize:null,typeName:E.ZodSet,...d(I)})};class T1 extends e{constructor(){super(...arguments);this.validate=this.implement}_parse($){let{ctx:I}=this._processInputParams($);if(I.parsedType!==R.function)return T(I,{code:q.invalid_type,expected:R.function,received:I.parsedType}),r;function U(b,N){return AA({data:b,path:I.path,errorMaps:[I.common.contextualErrorMap,I.schemaErrorMap,P1(),O4].filter((O)=>!!O),issueData:{code:q.invalid_arguments,argumentsError:N}})}function D(b,N){return AA({data:b,path:I.path,errorMaps:[I.common.contextualErrorMap,I.schemaErrorMap,P1(),O4].filter((O)=>!!O),issueData:{code:q.invalid_return_type,returnTypeError:N}})}let A={errorMap:I.common.contextualErrorMap},w=I.data;if(this._def.returns instanceof KI){let b=this;return c$(async function(...N){let O=new w6([]),X=await b._def.args.parseAsync(N,A).catch((B)=>{throw O.addIssue(U(N,B)),O}),W=await Reflect.apply(w,this,X);return await b._def.returns._def.type.parseAsync(W,A).catch((B)=>{throw O.addIssue(D(W,B)),O})})}else{let b=this;return c$(function(...N){let O=b._def.args.safeParse(N,A);if(!O.success)throw new w6([U(N,O.error)]);let X=Reflect.apply(w,this,O.data),W=b._def.returns.safeParse(X,A);if(!W.success)throw new w6([D(X,W.error)]);return W.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...$){return new T1({...this._def,args:a6.create($).rest(u4.create())})}returns($){return new T1({...this._def,returns:$})}implement($){return this.parse($)}strictImplement($){return this.parse($)}static create($,I,U){return new T1({args:$?$:a6.create([]).rest(u4.create()),returns:I||u4.create(),typeName:E.ZodFunction,...d(U)})}}class h1 extends e{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})}}h1.create=($,I)=>{return new h1({getter:$,typeName:E.ZodLazy,...d(I)})};class f1 extends e{_parse($){if($.data!==this._def.value){let I=this._getOrReturnCtx($);return T(I,{received:I.data,code:q.invalid_literal,expected:this._def.value}),r}return{status:"valid",value:$.data}}get value(){return this._def.value}}f1.create=($,I)=>{return new f1({value:$,typeName:E.ZodLiteral,...d(I)})};function u5($,I){return new l4({values:$,typeName:E.ZodEnum,...d(I)})}class l4 extends e{_parse($){if(typeof $.data!=="string"){let I=this._getOrReturnCtx($),U=this._def.values;return T(I,{expected:$$.joinValues(U),received:I.parsedType,code:q.invalid_type}),r}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has($.data)){let I=this._getOrReturnCtx($),U=this._def.values;return T(I,{received:I.data,code:q.invalid_enum_value,options:U}),r}return c$($.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 l4.create($,{...this._def,...I})}exclude($,I=this._def){return l4.create(this.options.filter((U)=>!$.includes(U)),{...this._def,...I})}}l4.create=u5;class y1 extends e{_parse($){let I=$$.getValidEnumValues(this._def.values),U=this._getOrReturnCtx($);if(U.parsedType!==R.string&&U.parsedType!==R.number){let D=$$.objectValues(I);return T(U,{expected:$$.joinValues(D),received:U.parsedType,code:q.invalid_type}),r}if(!this._cache)this._cache=new Set($$.getValidEnumValues(this._def.values));if(!this._cache.has($.data)){let D=$$.objectValues(I);return T(U,{received:U.data,code:q.invalid_enum_value,options:D}),r}return c$($.data)}get enum(){return this._def.values}}y1.create=($,I)=>{return new y1({values:$,typeName:E.ZodNativeEnum,...d(I)})};class KI extends e{unwrap(){return this._def.type}_parse($){let{ctx:I}=this._processInputParams($);if(I.parsedType!==R.promise&&I.common.async===!1)return T(I,{code:q.invalid_type,expected:R.promise,received:I.parsedType}),r;let U=I.parsedType===R.promise?I.data:Promise.resolve(I.data);return c$(U.then((D)=>{return this._def.type.parseAsync(D,{path:I.path,errorMap:I.common.contextualErrorMap})}))}}KI.create=($,I)=>{return new KI({type:$,typeName:E.ZodPromise,...d(I)})};class g6 extends e{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===E.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse($){let{status:I,ctx:U}=this._processInputParams($),D=this._def.effect||null,A={addIssue:(w)=>{if(T(U,w),w.fatal)I.abort();else I.dirty()},get path(){return U.path}};if(A.addIssue=A.addIssue.bind(A),D.type==="preprocess"){let w=D.transform(U.data,A);if(U.common.async)return Promise.resolve(w).then(async(b)=>{if(I.value==="aborted")return r;let N=await this._def.schema._parseAsync({data:b,path:U.path,parent:U});if(N.status==="aborted")return r;if(N.status==="dirty")return JI(N.value);if(I.value==="dirty")return JI(N.value);return N});else{if(I.value==="aborted")return r;let b=this._def.schema._parseSync({data:w,path:U.path,parent:U});if(b.status==="aborted")return r;if(b.status==="dirty")return JI(b.value);if(I.value==="dirty")return JI(b.value);return b}}if(D.type==="refinement"){let w=(b)=>{let N=D.refinement(b,A);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 b};if(U.common.async===!1){let b=this._def.schema._parseSync({data:U.data,path:U.path,parent:U});if(b.status==="aborted")return r;if(b.status==="dirty")I.dirty();return w(b.value),{status:I.value,value:b.value}}else return this._def.schema._parseAsync({data:U.data,path:U.path,parent:U}).then((b)=>{if(b.status==="aborted")return r;if(b.status==="dirty")I.dirty();return w(b.value).then(()=>{return{status:I.value,value:b.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(!y4(w))return r;let b=D.transform(w.value,A);if(b instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:I.value,value:b}}else return this._def.schema._parseAsync({data:U.data,path:U.path,parent:U}).then((w)=>{if(!y4(w))return r;return Promise.resolve(D.transform(w.value,A)).then((b)=>({status:I.value,value:b}))});$$.assertNever(D)}}g6.create=($,I,U)=>{return new g6({schema:$,typeName:E.ZodEffects,effect:I,...d(U)})};g6.createWithPreprocess=($,I,U)=>{return new g6({schema:I,effect:{type:"preprocess",transform:$},typeName:E.ZodEffects,...d(U)})};class Q6 extends e{_parse($){if(this._getType($)===R.undefined)return c$(void 0);return this._def.innerType._parse($)}unwrap(){return this._def.innerType}}Q6.create=($,I)=>{return new Q6({innerType:$,typeName:E.ZodOptional,...d(I)})};class X4 extends e{_parse($){if(this._getType($)===R.null)return c$(null);return this._def.innerType._parse($)}unwrap(){return this._def.innerType}}X4.create=($,I)=>{return new X4({innerType:$,typeName:E.ZodNullable,...d(I)})};class u1 extends e{_parse($){let{ctx:I}=this._processInputParams($),U=I.data;if(I.parsedType===R.undefined)U=this._def.defaultValue();return this._def.innerType._parse({data:U,path:I.path,parent:I})}removeDefault(){return this._def.innerType}}u1.create=($,I)=>{return new u1({innerType:$,typeName:E.ZodDefault,defaultValue:typeof I.default==="function"?I.default:()=>I.default,...d(I)})};class l1 extends e{_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(R1(D))return D.then((A)=>{return{status:"valid",value:A.status==="valid"?A.value:this._def.catchValue({get error(){return new w6(U.common.issues)},input:U.data})}});else return{status:"valid",value:D.status==="valid"?D.value:this._def.catchValue({get error(){return new w6(U.common.issues)},input:U.data})}}removeCatch(){return this._def.innerType}}l1.create=($,I)=>{return new l1({innerType:$,typeName:E.ZodCatch,catchValue:typeof I.catch==="function"?I.catch:()=>I.catch,...d(I)})};class WA extends e{_parse($){if(this._getType($)!==R.nan){let U=this._getOrReturnCtx($);return T(U,{code:q.invalid_type,expected:R.nan,received:U.parsedType}),r}return{status:"valid",value:$.data}}}WA.create=($)=>{return new WA({typeName:E.ZodNaN,...d($)})};var ql=Symbol("zod_brand");class wN extends e{_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 GA extends e{_parse($){let{status:I,ctx:U}=this._processInputParams($);if(U.common.async)return(async()=>{let A=await this._def.in._parseAsync({data:U.data,path:U.path,parent:U});if(A.status==="aborted")return r;if(A.status==="dirty")return I.dirty(),JI(A.value);else return this._def.out._parseAsync({data:A.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 r;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 GA({in:$,out:I,typeName:E.ZodPipeline})}}class c1 extends e{_parse($){let I=this._def.innerType._parse($),U=(D)=>{if(y4(D))D.value=Object.freeze(D.value);return D};return R1(I)?I.then((D)=>U(D)):U(I)}unwrap(){return this._def.innerType}}c1.create=($,I)=>{return new c1({innerType:$,typeName:E.ZodReadonly,...d(I)})};var Fl={object:S$.lazycreate},E;(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"})(E||(E={}));var El=p6.create,Sl=LI.create,jl=WA.create,kl=zI.create,Pl=DA.create,Rl=_1.create,Tl=wA.create,_l=C1.create,Cl=Z1.create,Zl=bA.create,gl=u4.create,xl=t6.create,hl=NA.create,fl=Z6.create,l5=S$.create,yl=S$.strictCreate,ul=g1.create,ll=DN.create,cl=x1.create,ml=a6.create,rl=OA.create,il=XA.create,nl=MI.create,ol=T1.create,dl=h1.create,pl=f1.create,tl=l4.create,al=y1.create,el=KI.create,sl=g6.create,$c=Q6.create,Ic=X4.create,Uc=g6.createWithPreprocess,Ac=GA.create;var RE=Object.freeze({status:"aborted"});function K($,I,U){function D(N,O){var X;Object.defineProperty(N,"_zod",{value:N._zod??{},enumerable:!1}),(X=N._zod).traits??(X.traits=new Set),N._zod.traits.add($),I(N,O);for(let W in b.prototype)if(!(W in N))Object.defineProperty(N,W,{value:b.prototype[W].bind(N)});N._zod.constr=b,N._zod.def=O}let A=U?.Parent??Object;class w extends A{}Object.defineProperty(w,"name",{value:$});function b(N){var O;let X=U?.Parent?new w:this;D(X,N),(O=X._zod).deferred??(O.deferred=[]);for(let W of X._zod.deferred)W();return X}return Object.defineProperty(b,"init",{value:D}),Object.defineProperty(b,Symbol.hasInstance,{value:(N)=>{if(U?.Parent&&N instanceof U.Parent)return!0;return N?._zod?.traits?.has($)}}),Object.defineProperty(b,"name",{value:$}),b}var TE=Symbol("zod_brand");class W4 extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}var QA={};function b6($){if($)Object.assign(QA,$);return QA}var I$={};K6(I$,{unwrapMessage:()=>m1,stringifyPrimitive:()=>JA,required:()=>dE,randomString:()=>yE,propertyKeyTypes:()=>GN,promiseAllObject:()=>fE,primitiveTypes:()=>c5,prefixIssues:()=>x6,pick:()=>mE,partial:()=>oE,optionalKeys:()=>QN,omit:()=>rE,numKeys:()=>uE,nullish:()=>n1,normalizeParams:()=>m,merge:()=>nE,jsonStringifyReplacer:()=>NN,joinValues:()=>YA,issue:()=>BN,isPlainObject:()=>vI,isObject:()=>VI,getSizableOrigin:()=>r5,getParsedType:()=>lE,getLengthableOrigin:()=>d1,getEnumValues:()=>r1,getElementAtPath:()=>hE,floatSafeRemainder:()=>ON,finalizeIssue:()=>v6,extend:()=>iE,escapeRegex:()=>G4,esc:()=>c4,defineLazy:()=>H$,createTransparentProxy:()=>cE,clone:()=>N6,cleanRegex:()=>o1,cleanEnum:()=>pE,captureStackTrace:()=>BA,cached:()=>i1,assignProp:()=>XN,assertNotEqual:()=>CE,assertNever:()=>gE,assertIs:()=>ZE,assertEqual:()=>_E,assert:()=>xE,allowsEval:()=>WN,aborted:()=>m4,NUMBER_FORMAT_RANGES:()=>YN,Class:()=>i5,BIGINT_FORMAT_RANGES:()=>m5});function _E($){return $}function CE($){return $}function ZE($){}function gE($){throw new Error}function xE($){}function r1($){let I=Object.values($).filter((D)=>typeof D==="number");return Object.entries($).filter(([D,A])=>I.indexOf(+D)===-1).map(([D,A])=>A)}function YA($,I="|"){return $.map((U)=>JA(U)).join(I)}function NN($,I){if(typeof I==="bigint")return I.toString();return I}function i1($){return{get value(){{let U=$();return Object.defineProperty(this,"value",{value:U}),U}throw new Error("cached value already set")}}}function n1($){return $===null||$===void 0}function o1($){let I=$.startsWith("^")?1:0,U=$.endsWith("$")?$.length-1:$.length;return $.slice(I,U)}function ON($,I){let U=($.toString().split(".")[1]||"").length,D=(I.toString().split(".")[1]||"").length,A=U>D?U:D,w=Number.parseInt($.toFixed(A).replace(".","")),b=Number.parseInt(I.toFixed(A).replace(".",""));return w%b/10**A}function H$($,I,U){Object.defineProperty($,I,{get(){{let A=U();return $[I]=A,A}throw new Error("cached value already set")},set(A){Object.defineProperty($,I,{value:A})},configurable:!0})}function XN($,I,U){Object.defineProperty($,I,{value:U,writable:!0,enumerable:!0,configurable:!0})}function hE($,I){if(!I)return $;return I.reduce((U,D)=>U?.[D],$)}function fE($){let I=Object.keys($),U=I.map((D)=>$[D]);return Promise.all(U).then((D)=>{let A={};for(let w=0;w<I.length;w++)A[I[w]]=D[w];return A})}function yE($=10){let U="";for(let D=0;D<$;D++)U+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return U}function c4($){return JSON.stringify($)}var BA=Error.captureStackTrace?Error.captureStackTrace:(...$)=>{};function VI($){return typeof $==="object"&&$!==null&&!Array.isArray($)}var WN=i1(()=>{if(typeof navigator!=="undefined"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch($){return!1}});function vI($){if(VI($)===!1)return!1;let I=$.constructor;if(I===void 0)return!0;let U=I.prototype;if(VI(U)===!1)return!1;if(Object.prototype.hasOwnProperty.call(U,"isPrototypeOf")===!1)return!1;return!0}function uE($){let I=0;for(let U in $)if(Object.prototype.hasOwnProperty.call($,U))I++;return I}var lE=($)=>{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}`)}},GN=new Set(["string","number","symbol"]),c5=new Set(["string","number","bigint","boolean","symbol","undefined"]);function G4($){return $.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function N6($,I,U){let D=new $._zod.constr(I??$._zod.def);if(!I||U?.parent)D._zod.parent=$;return D}function m($){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 cE($){let I;return new Proxy({},{get(U,D,A){return I??(I=$()),Reflect.get(I,D,A)},set(U,D,A,w){return I??(I=$()),Reflect.set(I,D,A,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,A){return I??(I=$()),Reflect.defineProperty(I,D,A)}})}function JA($){if(typeof $==="bigint")return $.toString()+"n";if(typeof $==="string")return`"${$}"`;return`${$}`}function QN($){return Object.keys($).filter((I)=>{return $[I]._zod.optin==="optional"&&$[I]._zod.optout==="optional"})}var YN={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]},m5={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function mE($,I){let U={},D=$._zod.def;for(let A in I){if(!(A in D.shape))throw new Error(`Unrecognized key: "${A}"`);if(!I[A])continue;U[A]=D.shape[A]}return N6($,{...$._zod.def,shape:U,checks:[]})}function rE($,I){let U={...$._zod.def.shape},D=$._zod.def;for(let A in I){if(!(A in D.shape))throw new Error(`Unrecognized key: "${A}"`);if(!I[A])continue;delete U[A]}return N6($,{...$._zod.def,shape:U,checks:[]})}function iE($,I){if(!vI(I))throw new Error("Invalid input to extend: expected a plain object");let U={...$._zod.def,get shape(){let D={...$._zod.def.shape,...I};return XN(this,"shape",D),D},checks:[]};return N6($,U)}function nE($,I){return N6($,{...$._zod.def,get shape(){let U={...$._zod.def.shape,...I._zod.def.shape};return XN(this,"shape",U),U},catchall:I._zod.def.catchall,checks:[]})}function oE($,I,U){let D=I._zod.def.shape,A={...D};if(U)for(let w in U){if(!(w in D))throw new Error(`Unrecognized key: "${w}"`);if(!U[w])continue;A[w]=$?new $({type:"optional",innerType:D[w]}):D[w]}else for(let w in D)A[w]=$?new $({type:"optional",innerType:D[w]}):D[w];return N6(I,{...I._zod.def,shape:A,checks:[]})}function dE($,I,U){let D=I._zod.def.shape,A={...D};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:D[w]})}else for(let w in D)A[w]=new $({type:"nonoptional",innerType:D[w]});return N6(I,{...I._zod.def,shape:A,checks:[]})}function m4($,I=0){for(let U=I;U<$.issues.length;U++)if($.issues[U]?.continue!==!0)return!0;return!1}function x6($,I){return I.map((U)=>{var D;return(D=U).path??(D.path=[]),U.path.unshift($),U})}function m1($){return typeof $==="string"?$:$?.message}function v6($,I,U){let D={...$,path:$.path??[]};if(!$.message){let A=m1($.inst?._zod.def?.error?.($))??m1(I?.error?.($))??m1(U.customError?.($))??m1(U.localeError?.($))??"Invalid input";D.message=A}if(delete D.inst,delete D.continue,!I?.reportInput)delete D.input;return D}function r5($){if($ instanceof Set)return"set";if($ instanceof Map)return"map";if($ instanceof File)return"file";return"unknown"}function d1($){if(Array.isArray($))return"array";if(typeof $==="string")return"string";return"unknown"}function BN(...$){let[I,U,D]=$;if(typeof I==="string")return{message:I,code:"custom",input:U,inst:D};return{...I}}function pE($){return Object.entries($).filter(([I,U])=>{return Number.isNaN(Number.parseInt(I,10))}).map((I)=>I[1])}class i5{constructor(...$){}}var n5=($,I)=>{$.name="$ZodError",Object.defineProperty($,"_zod",{value:$._zod,enumerable:!1}),Object.defineProperty($,"issues",{value:I,enumerable:!1}),Object.defineProperty($,"message",{get(){return JSON.stringify(I,NN,2)},enumerable:!0}),Object.defineProperty($,"toString",{value:()=>$.message,enumerable:!1})},HA=K("$ZodError",n5),p1=K("$ZodError",n5,{Parent:Error});function JN($,I=(U)=>U.message){let U={},D=[];for(let A of $.issues)if(A.path.length>0)U[A.path[0]]=U[A.path[0]]||[],U[A.path[0]].push(I(A));else D.push(I(A));return{formErrors:D,fieldErrors:U}}function HN($,I){let U=I||function(w){return w.message},D={_errors:[]},A=(w)=>{for(let b of w.issues)if(b.code==="invalid_union"&&b.errors.length)b.errors.map((N)=>A({issues:N}));else if(b.code==="invalid_key")A({issues:b.issues});else if(b.code==="invalid_element")A({issues:b.issues});else if(b.path.length===0)D._errors.push(U(b));else{let N=D,O=0;while(O<b.path.length){let X=b.path[O];if(O!==b.path.length-1)N[X]=N[X]||{_errors:[]};else N[X]=N[X]||{_errors:[]},N[X]._errors.push(U(b));N=N[X],O++}}};return A($),D}var LN=($)=>(I,U,D,A)=>{let w=D?Object.assign(D,{async:!1}):{async:!1},b=I._zod.run({value:U,issues:[]},w);if(b instanceof Promise)throw new W4;if(b.issues.length){let N=new(A?.Err??$)(b.issues.map((O)=>v6(O,w,b6())));throw BA(N,A?.callee),N}return b.value},zN=LN(p1),MN=($)=>async(I,U,D,A)=>{let w=D?Object.assign(D,{async:!0}):{async:!0},b=I._zod.run({value:U,issues:[]},w);if(b instanceof Promise)b=await b;if(b.issues.length){let N=new(A?.Err??$)(b.issues.map((O)=>v6(O,w,b6())));throw BA(N,A?.callee),N}return b.value},KN=MN(p1),VN=($)=>(I,U,D)=>{let A=D?{...D,async:!1}:{async:!1},w=I._zod.run({value:U,issues:[]},A);if(w instanceof Promise)throw new W4;return w.issues.length?{success:!1,error:new($??HA)(w.issues.map((b)=>v6(b,A,b6())))}:{success:!0,data:w.value}},r4=VN(p1),vN=($)=>async(I,U,D)=>{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;return w.issues.length?{success:!1,error:new $(w.issues.map((b)=>v6(b,A,b6())))}:{success:!0,data:w.value}},i4=vN(p1);var o5=/^[cC][^\s-]{8,}$/,d5=/^[0-9a-z]+$/,p5=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,t5=/^[0-9a-vA-V]{20}$/,a5=/^[A-Za-z0-9]{27}$/,e5=/^[a-zA-Z0-9_-]{21}$/,s5=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var $J=/^([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})$/,qN=($)=>{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)$/;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})$`)};var IJ=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;function UJ(){return new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")}var AJ=/^(?:(?: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])$/,DJ=/^(([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})$/,wJ=/^((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])$/,bJ=/^(([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])$/,NJ=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,FN=/^[A-Za-z0-9_-]*$/,OJ=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/;var XJ=/^\+(?:[0-9]){6,14}[0-9]$/,WJ="(?:(?:\\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])))",GJ=new RegExp(`^${WJ}$`);function QJ($){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 YJ($){return new RegExp(`^${QJ($)}$`)}function BJ($){let I=QJ({precision:$.precision}),U=["Z"];if($.local)U.push("");if($.offset)U.push("([+-]\\d{2}:\\d{2})");let D=`${I}(?:${U.join("|")})`;return new RegExp(`^${WJ}T(?:${D})$`)}var JJ=($)=>{let I=$?`[\\s\\S]{${$?.minimum??0},${$?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${I}$`)};var HJ=/^\d+$/,LJ=/^-?\d+(?:\.\d+)?/i,zJ=/true|false/i,MJ=/null/i;var KJ=/^[^A-Z]*$/,VJ=/^[^a-z]*$/;var C$=K("$ZodCheck",($,I)=>{var U;$._zod??($._zod={}),$._zod.def=I,(U=$._zod).onattach??(U.onattach=[])}),vJ={number:"number",bigint:"bigint",object:"date"},EN=K("$ZodCheckLessThan",($,I)=>{C$.init($,I);let U=vJ[typeof I.value];$._zod.onattach.push((D)=>{let A=D._zod.bag,w=(I.inclusive?A.maximum:A.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(I.value<w)if(I.inclusive)A.maximum=I.value;else A.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})}}),SN=K("$ZodCheckGreaterThan",($,I)=>{C$.init($,I);let U=vJ[typeof I.value];$._zod.onattach.push((D)=>{let A=D._zod.bag,w=(I.inclusive?A.minimum:A.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(I.value>w)if(I.inclusive)A.minimum=I.value;else A.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})}}),qJ=K("$ZodCheckMultipleOf",($,I)=>{C$.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):ON(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})}}),FJ=K("$ZodCheckNumberFormat",($,I)=>{C$.init($,I),I.format=I.format||"float64";let U=I.format?.includes("int"),D=U?"int":"number",[A,w]=YN[I.format];$._zod.onattach.push((b)=>{let N=b._zod.bag;if(N.format=I.format,N.minimum=A,N.maximum=w,U)N.pattern=HJ}),$._zod.check=(b)=>{let N=b.value;if(U){if(!Number.isInteger(N)){b.issues.push({expected:D,format:I.format,code:"invalid_type",input:N,inst:$});return}if(!Number.isSafeInteger(N)){if(N>0)b.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 b.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<A)b.issues.push({origin:"number",input:N,code:"too_small",minimum:A,inclusive:!0,inst:$,continue:!I.abort});if(N>w)b.issues.push({origin:"number",input:N,code:"too_big",maximum:w,inst:$})}});var EJ=K("$ZodCheckMaxLength",($,I)=>{var U;C$.init($,I),(U=$._zod.def).when??(U.when=(D)=>{let A=D.value;return!n1(A)&&A.length!==void 0}),$._zod.onattach.push((D)=>{let A=D._zod.bag.maximum??Number.POSITIVE_INFINITY;if(I.maximum<A)D._zod.bag.maximum=I.maximum}),$._zod.check=(D)=>{let A=D.value;if(A.length<=I.maximum)return;let b=d1(A);D.issues.push({origin:b,code:"too_big",maximum:I.maximum,inclusive:!0,input:A,inst:$,continue:!I.abort})}}),SJ=K("$ZodCheckMinLength",($,I)=>{var U;C$.init($,I),(U=$._zod.def).when??(U.when=(D)=>{let A=D.value;return!n1(A)&&A.length!==void 0}),$._zod.onattach.push((D)=>{let A=D._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(I.minimum>A)D._zod.bag.minimum=I.minimum}),$._zod.check=(D)=>{let A=D.value;if(A.length>=I.minimum)return;let b=d1(A);D.issues.push({origin:b,code:"too_small",minimum:I.minimum,inclusive:!0,input:A,inst:$,continue:!I.abort})}}),jJ=K("$ZodCheckLengthEquals",($,I)=>{var U;C$.init($,I),(U=$._zod.def).when??(U.when=(D)=>{let A=D.value;return!n1(A)&&A.length!==void 0}),$._zod.onattach.push((D)=>{let A=D._zod.bag;A.minimum=I.length,A.maximum=I.length,A.length=I.length}),$._zod.check=(D)=>{let A=D.value,w=A.length;if(w===I.length)return;let b=d1(A),N=w>I.length;D.issues.push({origin:b,...N?{code:"too_big",maximum:I.length}:{code:"too_small",minimum:I.length},inclusive:!0,exact:!0,input:D.value,inst:$,continue:!I.abort})}}),t1=K("$ZodCheckStringFormat",($,I)=>{var U,D;if(C$.init($,I),$._zod.onattach.push((A)=>{let w=A._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=(A)=>{if(I.pattern.lastIndex=0,I.pattern.test(A.value))return;A.issues.push({origin:"string",code:"invalid_format",format:I.format,input:A.value,...I.pattern?{pattern:I.pattern.toString()}:{},inst:$,continue:!I.abort})});else(D=$._zod).check??(D.check=()=>{})}),kJ=K("$ZodCheckRegex",($,I)=>{t1.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})}}),PJ=K("$ZodCheckLowerCase",($,I)=>{I.pattern??(I.pattern=KJ),t1.init($,I)}),RJ=K("$ZodCheckUpperCase",($,I)=>{I.pattern??(I.pattern=VJ),t1.init($,I)}),TJ=K("$ZodCheckIncludes",($,I)=>{C$.init($,I);let U=G4(I.includes),D=new RegExp(typeof I.position==="number"?`^.{${I.position}}${U}`:U);I.pattern=D,$._zod.onattach.push((A)=>{let w=A._zod.bag;w.patterns??(w.patterns=new Set),w.patterns.add(D)}),$._zod.check=(A)=>{if(A.value.includes(I.includes,I.position))return;A.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:I.includes,input:A.value,inst:$,continue:!I.abort})}}),_J=K("$ZodCheckStartsWith",($,I)=>{C$.init($,I);let U=new RegExp(`^${G4(I.prefix)}.*`);I.pattern??(I.pattern=U),$._zod.onattach.push((D)=>{let A=D._zod.bag;A.patterns??(A.patterns=new Set),A.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})}}),CJ=K("$ZodCheckEndsWith",($,I)=>{C$.init($,I);let U=new RegExp(`.*${G4(I.suffix)}$`);I.pattern??(I.pattern=U),$._zod.onattach.push((D)=>{let A=D._zod.bag;A.patterns??(A.patterns=new Set),A.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})}});var ZJ=K("$ZodCheckOverwrite",($,I)=>{C$.init($,I),$._zod.check=(U)=>{U.value=I.tx(U.value)}});class jN{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(`
10
- `).filter((w)=>w),D=Math.min(...U.map((w)=>w.length-w.trimStart().length)),A=U.map((w)=>w.slice(D)).map((w)=>" ".repeat(this.indent*2)+w);for(let w of A)this.content.push(w)}compile(){let $=Function,I=this?.args,D=[...(this?.content??[""]).map((A)=>` ${A}`)];return new $(...I,D.join(`
11
- `))}}var xJ={major:4,minor:0,patch:0};var W$=K("$ZodType",($,I)=>{var U;$??($={}),$._zod.def=I,$._zod.bag=$._zod.bag||{},$._zod.version=xJ;let D=[...$._zod.def.checks??[]];if($._zod.traits.has("$ZodCheck"))D.unshift($);for(let A of D)for(let w of A._zod.onattach)w($);if(D.length===0)(U=$._zod).deferred??(U.deferred=[]),$._zod.deferred?.push(()=>{$._zod.run=$._zod.parse});else{let A=(w,b,N)=>{let O=m4(w),X;for(let W of b){if(W._zod.def.when){if(!W._zod.def.when(w))continue}else if(O)continue;let Q=w.issues.length,B=W._zod.check(w);if(B instanceof Promise&&N?.async===!1)throw new W4;if(X||B instanceof Promise)X=(X??Promise.resolve()).then(async()=>{if(await B,w.issues.length===Q)return;if(!O)O=m4(w,Q)});else{if(w.issues.length===Q)continue;if(!O)O=m4(w,Q)}}if(X)return X.then(()=>{return w});return w};$._zod.run=(w,b)=>{let N=$._zod.parse(w,b);if(N instanceof Promise){if(b.async===!1)throw new W4;return N.then((O)=>A(O,D,b))}return A(N,D,b)}}$["~standard"]={validate:(A)=>{try{let w=r4($,A);return w.success?{value:w.data}:{issues:w.error?.issues}}catch(w){return i4($,A).then((b)=>b.success?{value:b.data}:{issues:b.error?.issues})}},vendor:"zod",version:1}}),a1=K("$ZodString",($,I)=>{W$.init($,I),$._zod.pattern=[...$?._zod.bag?.patterns??[]].pop()??JJ($._zod.bag),$._zod.parse=(U,D)=>{if(I.coerce)try{U.value=String(U.value)}catch(A){}if(typeof U.value==="string")return U;return U.issues.push({expected:"string",code:"invalid_type",input:U.value,inst:$}),U}}),L$=K("$ZodStringFormat",($,I)=>{t1.init($,I),a1.init($,I)}),PN=K("$ZodGUID",($,I)=>{I.pattern??(I.pattern=$J),L$.init($,I)}),RN=K("$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=qN(D))}else I.pattern??(I.pattern=qN());L$.init($,I)}),TN=K("$ZodEmail",($,I)=>{I.pattern??(I.pattern=IJ),L$.init($,I)}),_N=K("$ZodURL",($,I)=>{L$.init($,I),$._zod.check=(U)=>{try{let D=U.value,A=new URL(D),w=A.href;if(I.hostname){if(I.hostname.lastIndex=0,!I.hostname.test(A.hostname))U.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:OJ.source,input:U.value,inst:$,continue:!I.abort})}if(I.protocol){if(I.protocol.lastIndex=0,!I.protocol.test(A.protocol.endsWith(":")?A.protocol.slice(0,-1):A.protocol))U.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:I.protocol.source,input:U.value,inst:$,continue:!I.abort})}if(!D.endsWith("/")&&w.endsWith("/"))U.value=w.slice(0,-1);else U.value=w;return}catch(D){U.issues.push({code:"invalid_format",format:"url",input:U.value,inst:$,continue:!I.abort})}}}),CN=K("$ZodEmoji",($,I)=>{I.pattern??(I.pattern=UJ()),L$.init($,I)}),ZN=K("$ZodNanoID",($,I)=>{I.pattern??(I.pattern=e5),L$.init($,I)}),gN=K("$ZodCUID",($,I)=>{I.pattern??(I.pattern=o5),L$.init($,I)}),xN=K("$ZodCUID2",($,I)=>{I.pattern??(I.pattern=d5),L$.init($,I)}),hN=K("$ZodULID",($,I)=>{I.pattern??(I.pattern=p5),L$.init($,I)}),fN=K("$ZodXID",($,I)=>{I.pattern??(I.pattern=t5),L$.init($,I)}),yN=K("$ZodKSUID",($,I)=>{I.pattern??(I.pattern=a5),L$.init($,I)}),nJ=K("$ZodISODateTime",($,I)=>{I.pattern??(I.pattern=BJ(I)),L$.init($,I)}),oJ=K("$ZodISODate",($,I)=>{I.pattern??(I.pattern=GJ),L$.init($,I)}),dJ=K("$ZodISOTime",($,I)=>{I.pattern??(I.pattern=YJ(I)),L$.init($,I)}),pJ=K("$ZodISODuration",($,I)=>{I.pattern??(I.pattern=s5),L$.init($,I)}),uN=K("$ZodIPv4",($,I)=>{I.pattern??(I.pattern=AJ),L$.init($,I),$._zod.onattach.push((U)=>{let D=U._zod.bag;D.format="ipv4"})}),lN=K("$ZodIPv6",($,I)=>{I.pattern??(I.pattern=DJ),L$.init($,I),$._zod.onattach.push((U)=>{let D=U._zod.bag;D.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})}}}),cN=K("$ZodCIDRv4",($,I)=>{I.pattern??(I.pattern=wJ),L$.init($,I)}),mN=K("$ZodCIDRv6",($,I)=>{I.pattern??(I.pattern=bJ),L$.init($,I),$._zod.check=(U)=>{let[D,A]=U.value.split("/");try{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://[${D}]`)}catch{U.issues.push({code:"invalid_format",format:"cidrv6",input:U.value,inst:$,continue:!I.abort})}}});function tJ($){if($==="")return!0;if($.length%4!==0)return!1;try{return atob($),!0}catch{return!1}}var rN=K("$ZodBase64",($,I)=>{I.pattern??(I.pattern=NJ),L$.init($,I),$._zod.onattach.push((U)=>{U._zod.bag.contentEncoding="base64"}),$._zod.check=(U)=>{if(tJ(U.value))return;U.issues.push({code:"invalid_format",format:"base64",input:U.value,inst:$,continue:!I.abort})}});function aE($){if(!FN.test($))return!1;let I=$.replace(/[-_]/g,(D)=>D==="-"?"+":"/"),U=I.padEnd(Math.ceil(I.length/4)*4,"=");return tJ(U)}var iN=K("$ZodBase64URL",($,I)=>{I.pattern??(I.pattern=FN),L$.init($,I),$._zod.onattach.push((U)=>{U._zod.bag.contentEncoding="base64url"}),$._zod.check=(U)=>{if(aE(U.value))return;U.issues.push({code:"invalid_format",format:"base64url",input:U.value,inst:$,continue:!I.abort})}}),nN=K("$ZodE164",($,I)=>{I.pattern??(I.pattern=XJ),L$.init($,I)});function eE($,I=null){try{let U=$.split(".");if(U.length!==3)return!1;let[D]=U;if(!D)return!1;let A=JSON.parse(atob(D));if("typ"in A&&A?.typ!=="JWT")return!1;if(!A.alg)return!1;if(I&&(!("alg"in A)||A.alg!==I))return!1;return!0}catch{return!1}}var oN=K("$ZodJWT",($,I)=>{L$.init($,I),$._zod.check=(U)=>{if(eE(U.value,I.alg))return;U.issues.push({code:"invalid_format",format:"jwt",input:U.value,inst:$,continue:!I.abort})}});var MA=K("$ZodNumber",($,I)=>{W$.init($,I),$._zod.pattern=$._zod.bag.pattern??LJ,$._zod.parse=(U,D)=>{if(I.coerce)try{U.value=Number(U.value)}catch(b){}let A=U.value;if(typeof A==="number"&&!Number.isNaN(A)&&Number.isFinite(A))return U;let w=typeof A==="number"?Number.isNaN(A)?"NaN":!Number.isFinite(A)?"Infinity":void 0:void 0;return U.issues.push({expected:"number",code:"invalid_type",input:A,inst:$,...w?{received:w}:{}}),U}}),dN=K("$ZodNumber",($,I)=>{FJ.init($,I),MA.init($,I)}),pN=K("$ZodBoolean",($,I)=>{W$.init($,I),$._zod.pattern=zJ,$._zod.parse=(U,D)=>{if(I.coerce)try{U.value=Boolean(U.value)}catch(w){}let A=U.value;if(typeof A==="boolean")return U;return U.issues.push({expected:"boolean",code:"invalid_type",input:A,inst:$}),U}});var tN=K("$ZodNull",($,I)=>{W$.init($,I),$._zod.pattern=MJ,$._zod.values=new Set([null]),$._zod.parse=(U,D)=>{let A=U.value;if(A===null)return U;return U.issues.push({expected:"null",code:"invalid_type",input:A,inst:$}),U}});var aN=K("$ZodUnknown",($,I)=>{W$.init($,I),$._zod.parse=(U)=>U}),eN=K("$ZodNever",($,I)=>{W$.init($,I),$._zod.parse=(U,D)=>{return U.issues.push({expected:"never",code:"invalid_type",input:U.value,inst:$}),U}});function hJ($,I,U){if($.issues.length)I.issues.push(...x6(U,$.issues));I.value[U]=$.value}var sN=K("$ZodArray",($,I)=>{W$.init($,I),$._zod.parse=(U,D)=>{let A=U.value;if(!Array.isArray(A))return U.issues.push({expected:"array",code:"invalid_type",input:A,inst:$}),U;U.value=Array(A.length);let w=[];for(let b=0;b<A.length;b++){let N=A[b],O=I.element._zod.run({value:N,issues:[]},D);if(O instanceof Promise)w.push(O.then((X)=>hJ(X,U,b)));else hJ(O,U,b)}if(w.length)return Promise.all(w).then(()=>U);return U}});function zA($,I,U){if($.issues.length)I.issues.push(...x6(U,$.issues));I.value[U]=$.value}function fJ($,I,U,D){if($.issues.length)if(D[U]===void 0)if(U in D)I.value[U]=void 0;else I.value[U]=$.value;else I.issues.push(...x6(U,$.issues));else if($.value===void 0){if(U in D)I.value[U]=void 0}else I.value[U]=$.value}var KA=K("$ZodObject",($,I)=>{W$.init($,I);let U=i1(()=>{let Q=Object.keys(I.shape);for(let Y of Q)if(!(I.shape[Y]instanceof W$))throw new Error(`Invalid element at key "${Y}": expected a Zod schema`);let B=QN(I.shape);return{shape:I.shape,keys:Q,keySet:new Set(Q),numKeys:Q.length,optionalKeys:new Set(B)}});H$($._zod,"propValues",()=>{let Q=I.shape,B={};for(let Y in Q){let J=Q[Y]._zod;if(J.values){B[Y]??(B[Y]=new Set);for(let H of J.values)B[Y].add(H)}}return B});let D=(Q)=>{let B=new jN(["shape","payload","ctx"]),Y=U.value,J=(F)=>{let k=c4(F);return`shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`};B.write("const input = payload.value;");let H=Object.create(null),v=0;for(let F of Y.keys)H[F]=`key_${v++}`;B.write("const newResult = {}");for(let F of Y.keys)if(Y.optionalKeys.has(F)){let k=H[F];B.write(`const ${k} = ${J(F)};`);let h=c4(F);B.write(`
12
- if (${k}.issues.length) {
13
- if (input[${h}] === undefined) {
14
- if (${h} in input) {
15
- newResult[${h}] = undefined;
16
- }
17
- } else {
18
- payload.issues = payload.issues.concat(
19
- ${k}.issues.map((iss) => ({
20
- ...iss,
21
- path: iss.path ? [${h}, ...iss.path] : [${h}],
22
- }))
23
- );
24
- }
25
- } else if (${k}.value === undefined) {
26
- if (${h} in input) newResult[${h}] = undefined;
27
- } else {
28
- newResult[${h}] = ${k}.value;
29
- }
30
- `)}else{let k=H[F];B.write(`const ${k} = ${J(F)};`),B.write(`
31
- if (${k}.issues.length) payload.issues = payload.issues.concat(${k}.issues.map(iss => ({
9
+ deps: ${U}}`};var FT={keyword:"dependencies",type:"object",schemaType:"object",error:mH.error,code($){let[I,U]=qT($);rH($,I),cH($,U)}};function qT({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 A=U.let("missing");for(let w in I){let O=I[w];if(O.length===0)continue;let N=wb.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)wb.checkReportMissingProp($,X)});else U.if(D8._`${N} && (${wb.checkMissingProp($,O,A)})`),wb.reportMissingProp($,A),U.else()}}mH.validatePropertyDeps=rH;function cH($,I=$.schema){let{gen:U,data:D,keyword:b,it:A}=$,w=U.name("valid");for(let O in I){if(KT.alwaysValidSchema(A,I[O]))continue;U.if(wb.propertyInData(U,D,O,A.opts.ownProperties),()=>{let N=$.subschema({keyword:b,schemaProp:O},w);$.mergeValidEvaluated(N,w)},()=>U.var(w,!0)),$.ok(w)}}mH.validateSchemaDeps=cH;mH.default=FT});var eH=R((aH)=>{Object.defineProperty(aH,"__esModule",{value:!0});var tH=d(),ST=A$(),jT={message:"property name must be valid",params:({params:$})=>tH._`{propertyName: ${$.propertyName}}`},PT={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:jT,code($){let{gen:I,schema:U,data:D,it:b}=$;if(ST.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(tH.not(A),()=>{if($.error(!0),!b.allErrors)I.break()})}),$.ok(A)}};aH.default=PT});var A8=R((sH)=>{Object.defineProperty(sH,"__esModule",{value:!0});var mw=b6(),B6=d(),TT=u6(),ow=A$(),_T={message:"must NOT have additional properties",params:({params:$})=>B6._`{additionalProperty: ${$.additionalProperty}}`},CT={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:_T,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"&&ow.alwaysValidSchema(w,U))return;let X=mw.allSchemaProperties(D.properties),G=mw.allSchemaProperties(D.patternProperties);Q(),$.ok(B6._`${A} === ${TT.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=ow.schemaRefOrVal(w,D.properties,"properties");k=mw.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._`${mw.usePattern($,g)}.test(${K})`));return B6.not(k)}function B(K){I.code(B6._`delete ${b}[${K}]`)}function J(K){if(N.removeAdditional==="all"||N.removeAdditional&&U===!1){B(K);return}if(U===!1){if($.setParams({additionalProperty:K}),$.error(),!O)I.break();return}if(typeof U=="object"&&!ow.alwaysValidSchema(w,U)){let k=I.name("valid");if(N.removeAdditional==="failing")L(K,k,!1),I.if(B6.not(k),()=>{$.reset(),B(K)});else if(L(K,k),!O)I.if(B6.not(k),()=>I.break())}}function L(K,k,g){let x={keyword:"additionalProperties",dataProp:K,dataPropType:ow.Type.Str};if(g===!1)Object.assign(x,{compositeRule:!0,createErrors:!1,allErrors:!1});$.subschema(x,k)}}};sH.default=CT});var bL=R((UL)=>{Object.defineProperty(UL,"__esModule",{value:!0});var fT=dU(),$L=b6(),w8=A$(),IL=A8(),gT={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)IL.default.code(new fT.KeywordCxt(A,IL.default,"additionalProperties"));let w=$L.allSchemaProperties(U);for(let Q of w)A.definedProperties.add(Q);if(A.opts.unevaluated&&w.length&&A.props!==!0)A.props=w8.mergeEvaluated.props(I,w8.toHash(w),A.props);let O=w.filter((Q)=>!w8.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($L.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)}}};UL.default=gT});var NL=R((OL)=>{Object.defineProperty(OL,"__esModule",{value:!0});var DL=b6(),dw=d(),AL=A$(),wL=A$(),xT={keyword:"patternProperties",type:"object",schemaType:"object",code($){let{gen:I,schema:U,data:D,parentSchema:b,it:A}=$,{opts:w}=A,O=DL.allSchemaProperties(U),N=O.filter((L)=>AL.alwaysValidSchema(A,U[L]));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 dw.Name))A.props=wL.evaluatedPropsToName(I,A.props);let{props:Q}=A;Y();function Y(){for(let L of O){if(X)B(L);if(A.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(A,`property ${K} matches pattern ${L} (use allowMatchingProperties)`)}function J(L){I.forIn("key",D,(K)=>{I.if(dw._`${DL.usePattern($,L)}.test(${K})`,()=>{let k=N.includes(L);if(!k)$.subschema({keyword:"patternProperties",schemaProp:L,dataProp:K,dataPropType:wL.Type.Str},G);if(A.opts.unevaluated&&Q!==!0)I.assign(dw._`${Q}[${K}]`,!0);else if(!k&&!A.allErrors)I.if(dw.not(G),()=>I.break())})})}}};OL.default=xT});var WL=R((XL)=>{Object.defineProperty(XL,"__esModule",{value:!0});var hT=A$(),uT={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code($){let{gen:I,schema:U,it:D}=$;if(hT.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"}};XL.default=uT});var QL=R((GL)=>{Object.defineProperty(GL,"__esModule",{value:!0});var nT=b6(),rT={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:nT.validateUnion,error:{message:"must match a schema in anyOf"}};GL.default=rT});var BL=R((YL)=>{Object.defineProperty(YL,"__esModule",{value:!0});var pw=d(),mT=A$(),oT={message:"must match exactly one schema in oneOf",params:({params:$})=>pw._`{passingSchemas: ${$.passing}}`},dT={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:oT,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(mT.alwaysValidSchema(b,G))I.var(N,!0);else Y=$.subschema({keyword:"oneOf",schemaProp:Q,compositeRule:!0},N);if(Q>0)I.if(pw._`${N} && ${w}`).assign(w,!1).assign(O,pw._`[${O}, ${Q}]`).else();I.if(N,()=>{if(I.assign(w,!0),I.assign(O,Q),Y)$.mergeEvaluated(Y,pw.Name)})})}}};YL.default=dT});var JL=R((vL)=>{Object.defineProperty(vL,"__esModule",{value:!0});var tT=A$(),aT={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(tT.alwaysValidSchema(D,A))return;let O=$.subschema({keyword:"allOf",schemaProp:w},b);$.ok(b),$.mergeEvaluated(O)})}};vL.default=aT});var ML=R((zL)=>{Object.defineProperty(zL,"__esModule",{value:!0});var tw=d(),LL=A$(),sT={message:({params:$})=>tw.str`must match "${$.ifClause}" schema`,params:({params:$})=>tw._`{failingKeyword: ${$.ifClause}}`},$2={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:sT,code($){let{gen:I,parentSchema:U,it:D}=$;if(U.then===void 0&&U.else===void 0)LL.checkStrictMode(D,'"if" without "then" and "else" is ignored');let b=HL(D,"then"),A=HL(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(tw.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,tw._`${G}`);else $.setParams({ifClause:G})}}}};function HL($,I){let U=$.schema[I];return U!==void 0&&!LL.alwaysValidSchema($,U)}zL.default=$2});var KL=R((VL)=>{Object.defineProperty(VL,"__esModule",{value:!0});var U2=A$(),b2={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:$,parentSchema:I,it:U}){if(I.if===void 0)U2.checkStrictMode(U,`"${$}" without "if" is ignored`)}};VL.default=b2});var qL=R((FL)=>{Object.defineProperty(FL,"__esModule",{value:!0});var A2=U8(),w2=xH(),O2=b8(),N2=uH(),X2=nH(),W2=pH(),G2=eH(),Q2=A8(),Y2=bL(),B2=NL(),v2=WL(),J2=QL(),H2=BL(),L2=JL(),z2=ML(),M2=KL();function V2($=!1){let I=[v2.default,J2.default,H2.default,L2.default,z2.default,M2.default,G2.default,Q2.default,W2.default,Y2.default,B2.default];if($)I.push(w2.default,N2.default);else I.push(A2.default,O2.default);return I.push(X2.default),I}FL.default=V2});var EL=R((kL)=>{Object.defineProperty(kL,"__esModule",{value:!0});var V$=d(),F2={message:({schemaCode:$})=>V$.str`must match format "${$}"`,params:({schemaCode:$})=>V$._`{format: ${$}}`},q2={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:F2,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 B();function Y(){let J=U.scopeValue("formats",{ref:Q.formats,code:N.code.formats}),L=U.const("fDef",V$._`${J}[${w}]`),K=U.let("fType"),k=U.let("format");U.if(V$._`typeof ${L} == "object" && !(${L} instanceof RegExp)`,()=>U.assign(K,V$._`${L}.type || "string"`).assign(k,V$._`${L}.validate`),()=>U.assign(K,V$._`"string"`).assign(k,L)),$.fail$data(V$.or(g(),x()));function g(){if(N.strictSchema===!1)return V$.nil;return V$._`${w} && !${k}`}function x(){let a=G.$async?V$._`(${L}.async ? await ${k}(${D}) : ${k}(${D}))`:V$._`${k}(${D})`,h=V$._`(typeof ${k} == "function" ? ${a} : ${k}.test(${D}))`;return V$._`${k} && ${k} !== true && ${K} === ${I} && !${h}`}}function B(){let J=Q.formats[A];if(!J){g();return}if(J===!0)return;let[L,K,k]=x(J);if(L===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 L6=h instanceof RegExp?V$.regexpCode(h):N.code.formats?V$._`${N.code.formats}${V$.getProperty(A)}`:void 0,_6=U.scopeValue("formats",{key:A,ref:h,code:L6});if(typeof h=="object"&&!(h instanceof RegExp))return[h.type||"string",h.validate,V$._`${_6}.validate`];return["string",h,_6]}function a(){if(typeof J=="object"&&!(J instanceof RegExp)&&J.async){if(!G.$async)throw new Error("async format in sync schema");return V$._`await ${k}(${D})`}return typeof K=="function"?V$._`${k}(${D})`:V$._`${k}.test(${D})`}}}};kL.default=q2});var jL=R((SL)=>{Object.defineProperty(SL,"__esModule",{value:!0});var E2=EL(),S2=[E2.default];SL.default=S2});var TL=R((PL)=>{Object.defineProperty(PL,"__esModule",{value:!0});PL.contentVocabulary=PL.metadataVocabulary=void 0;PL.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];PL.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var ZL=R((CL)=>{Object.defineProperty(CL,"__esModule",{value:!0});var R2=UH(),T2=PH(),_2=qL(),C2=jL(),_L=TL(),Z2=[R2.default,T2.default,_2.default(),C2.default,_L.metadataVocabulary,_L.contentVocabulary];CL.default=Z2});var xL=R((gL)=>{Object.defineProperty(gL,"__esModule",{value:!0});gL.DiscrError=void 0;var fL;(function($){$.Tag="tag",$.Mapping="mapping"})(fL||(gL.DiscrError=fL={}))});var uL=R((hL)=>{Object.defineProperty(hL,"__esModule",{value:!0});var sI=d(),O8=xL(),lL=Tw(),g2=pU(),y2=A$(),x2={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}}`},l2={keyword:"discriminator",type:"object",schemaType:"object",error:x2,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:O8.DiscrError.Tag,tag:X,tagName:O})),$.ok(N);function G(){let B=Y();I.if(!1);for(let J in B)I.elseIf(sI._`${X} === ${J}`),I.assign(N,Q(B[J]));I.else(),$.error(!1,{discrError:O8.DiscrError.Mapping,tag:X,tagName:O}),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<w.length;a++){let h=w[a];if((h===null||h===void 0?void 0:h.$ref)&&!y2.schemaHasRulesButRef(h,A.self.RULES)){let _6=h.$ref;if(h=lL.resolveRef.call(A.self,A.schemaEnv.root,A.baseId,_6),h instanceof lL.SchemaEnv)h=h.schema;if(h===void 0)throw new g2.default(A.opts.uriResolver,A.baseId,_6)}let L6=(B=h===null||h===void 0?void 0:h.properties)===null||B===void 0?void 0:B[O];if(typeof L6!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${O}"`);K=K&&(L||k(h)),g(L6,a)}if(!K)throw new Error(`discriminator: "${O}" must be required`);return J;function k({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 L6 of a.enum)x(L6,h);else throw new Error(`discriminator: "properties/${O}" must have "const" or "enum"`)}function x(a,h){if(typeof a!="string"||a in J)throw new Error(`discriminator: "${O}" values must be unique strings`);J[a]=h}}}};hL.default=l2});var iL=R((ui,u2)=>{u2.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 X8=R((o$,N8)=>{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 i2=mJ(),n2=ZL(),r2=uL(),nL=iL(),c2=["/properties"],aw="http://json-schema.org/draft-07/schema";class Ob extends i2.default{_addVocabularies(){if(super._addVocabularies(),n2.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(nL,c2):nL;this.addMetaSchema($,aw,!1),this.refs["http://json-schema.org/schema"]=aw}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(aw)?aw:void 0)}}o$.Ajv=Ob;N8.exports=o$=Ob;N8.exports.Ajv=Ob;Object.defineProperty(o$,"__esModule",{value:!0});o$.default=Ob;var m2=dU();Object.defineProperty(o$,"KeywordCxt",{enumerable:!0,get:function(){return m2.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 o2=Pw();Object.defineProperty(o$,"ValidationError",{enumerable:!0,get:function(){return o2.default}});var d2=pU();Object.defineProperty(o$,"MissingRefError",{enumerable:!0,get:function(){return d2.default}})});var sL=R((aL)=>{Object.defineProperty(aL,"__esModule",{value:!0});aL.formatNames=aL.fastFormats=aL.fullFormats=void 0;function j6($,I){return{validate:$,compare:I}}aL.fullFormats={date:j6(oL,Y8),time:j6(G8(!0),B8),"date-time":j6(rL(!0),pL),"iso-time":j6(G8(),dL),"iso-date-time":j6(rL(),tL),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:U_,"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:b_,int32:{type:"number",validate:w_},int64:{type:"number",validate:O_},float:{type:"number",validate:mL},double:{type:"number",validate:mL},password:!0,binary:!0};aL.fastFormats={...aL.fullFormats,date:j6(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,Y8),time:j6(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,B8),"date-time":j6(/^\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,pL),"iso-time":j6(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,dL),"iso-date-time":j6(/^\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,tL),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};aL.formatNames=Object.keys(aL.fullFormats);function a2($){return $%4===0&&($%100!==0||$%400===0)}var e2=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,s2=[0,31,28,31,30,31,30,31,31,30,31,30,31];function oL($){let I=e2.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&&a2(U)?29:s2[D])}function Y8($,I){if(!($&&I))return;if($>I)return 1;if($<I)return-1;return 0}var W8=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function G8($){return function I(U){let D=W8.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 B8($,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 dL($,I){if(!($&&I))return;let U=W8.exec($),D=W8.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 Q8=/t|\s/i;function rL($){let I=G8($);return function U(D){let b=D.split(Q8);return b.length===2&&oL(b[0])&&I(b[1])}}function pL($,I){if(!($&&I))return;let U=new Date($).valueOf(),D=new Date(I).valueOf();if(!(U&&D))return;return U-D}function tL($,I){if(!($&&I))return;let[U,D]=$.split(Q8),[b,A]=I.split(Q8),w=Y8(U,b);if(w===void 0)return;return w||B8(D,A)}var $_=/\/|:/,I_=/^(?:[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 U_($){return $_.test($)&&I_.test($)}var cL=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function b_($){return cL.lastIndex=0,cL.test($)}var D_=-2147483648,A_=2147483647;function w_($){return Number.isInteger($)&&$<=A_&&$>=D_}function O_($){return Number.isInteger($)}function mL(){return!0}var N_=/[^\\]\\Z/;function X_($){if(N_.test($))return!1;try{return new RegExp($),!0}catch(I){return!1}}});var Iz=R(($z)=>{Object.defineProperty($z,"__esModule",{value:!0});$z.formatLimitDefinition=void 0;var G_=X8(),v6=d(),M4=v6.operators,ew={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}},Q_={message:({keyword:$,schemaCode:I})=>v6.str`should be ${ew[$].okStr} ${I}`,params:({keyword:$,schemaCode:I})=>v6._`{comparison: ${ew[$].okStr}, limit: ${I}}`};$z.formatLimitDefinition={keyword:Object.keys(ew),type:"string",schemaType:"string",$data:!0,error:Q_,code($){let{gen:I,data:U,schemaCode:D,keyword:b,it:A}=$,{opts:w,self:O}=A;if(!w.validateFormats)return;let N=new G_.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}),B=I.const("fmt",v6._`${Y}[${N.schemaCode}]`);$.fail$data(v6.or(v6._`typeof ${B} != "object"`,v6._`${B} instanceof RegExp`,v6._`typeof ${B}.compare != "function"`,Q(B)))}function G(){let Y=N.schema,B=O.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:w.code.formats?v6._`${w.code.formats}${v6.getProperty(Y)}`:void 0});$.fail$data(Q(J))}function Q(Y){return v6._`${Y}.compare(${U}, ${D}) ${ew[b].fail} 0`}},dependencies:["format"]};var Y_=($)=>{return $.addKeyword($z.formatLimitDefinition),$};$z.default=Y_});var Az=R((Nb,Dz)=>{Object.defineProperty(Nb,"__esModule",{value:!0});var I1=sL(),v_=Iz(),H8=d(),Uz=new H8.Name("fullFormats"),J_=new H8.Name("fastFormats"),L8=($,I={keywords:!0})=>{if(Array.isArray(I))return bz($,I,I1.fullFormats,Uz),$;let[U,D]=I.mode==="fast"?[I1.fastFormats,J_]:[I1.fullFormats,Uz],b=I.formats||I1.formatNames;if(bz($,b,U,D),I.keywords)v_.default($);return $};L8.get=($,I="full")=>{let D=(I==="fast"?I1.fastFormats:I1.fullFormats)[$];if(!D)throw new Error(`Unknown format "${$}"`);return D};function bz($,I,U,D){var b,A;(b=(A=$.opts.code).formats)!==null&&b!==void 0||(A.formats=H8._`require("ajv-formats/dist/formats").${D}`);for(let w of I)$.addFormat(w,U[w])}Dz.exports=Nb=L8;Object.defineProperty(Nb,"__esModule",{value:!0});Nb.default=L8});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 kY;(function($){$.mergeShapes=(I,U)=>{return{...I,...U}}})(kY||(kY={}));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 M=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 HM=($,I)=>{let U;switch($.code){case M.invalid_type:if($.received===S.undefined)U="Required";else U=`Expected ${$.expected}, received ${$.received}`;break;case M.invalid_literal:U=`Invalid literal value, expected ${JSON.stringify($.expected,s.jsonStringifyReplacer)}`;break;case M.unrecognized_keys:U=`Unrecognized key(s) in object: ${s.joinValues($.keys,", ")}`;break;case M.invalid_union:U="Invalid input";break;case M.invalid_union_discriminator:U=`Invalid discriminator value. Expected ${s.joinValues($.options)}`;break;case M.invalid_enum_value:U=`Invalid enum value. Expected ${s.joinValues($.options)}, received '${$.received}'`;break;case M.invalid_arguments:U="Invalid function arguments";break;case M.invalid_return_type:U="Invalid function return type";break;case M.invalid_date:U="Invalid date";break;case M.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 M.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 M.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 M.custom:U="Invalid input";break;case M.invalid_intersection_types:U="Intersection results could not be merged";break;case M.not_multiple_of:U=`Number must be a multiple of ${$.multipleOf}`;break;case M.not_finite:U="Number must be finite";break;default:U=I.defaultError,s.assertNever($)}return{message:U}},d6=HM;var LM=d6;function J1(){return LM}var ab=($)=>{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 j($,I){let U=J1(),D=ab({issueData:I,data:$.data,path:$.path,errorMaps:[$.common.contextualErrorMap,$.schemaErrorMap,U,U===d6?void 0:d6].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:$}),Z$=($)=>({status:"valid",value:$}),_O=($)=>$.status==="aborted",CO=($)=>$.status==="dirty",E4=($)=>$.status==="valid",H1=($)=>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 EY=($,I)=>{if(E4(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(H1(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 EY(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 E4(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)=>E4(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(H1(D)?D:Promise.resolve(D));return EY(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:M.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 V6({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 p6.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return z6.create(this)}promise(){return UI.create(this,this._def)}or($){return K1.create([this,$],this._def)}and($){return F1.create(this,$,this._def)}transform($){return new V6({...c(this._def),schema:this,typeName:F.ZodEffects,effect:{type:"transform",transform:$}})}default($){let I=typeof $==="function"?$:()=>$;return new S1({...c(this._def),innerType:this,defaultValue:I,typeName:F.ZodDefault})}brand(){return new yO({typeName:F.ZodBranded,type:this,...c(this._def)})}catch($){let I=typeof $==="function"?$:()=>$;return new j1({...c(this._def),innerType:this,catchValue:I,typeName:F.ZodCatch})}describe($){return new this.constructor({...this._def,description:$})}pipe($){return AD.create(this,$)}readonly(){return P1.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}var zM=/^c[^\s-]{8,}$/i,MM=/^[0-9a-z]+$/,VM=/^[0-9A-HJKMNP-TV-Z]{26}$/i,KM=/^[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,FM=/^[a-z0-9_-]{21}$/i,qM=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,kM=/^[-+]?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)?)??$/,EM=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,SM="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",ZO,jM=/^(?:(?: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])$/,PM=/^(?:(?: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])$/,RM=/^(([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]))$/,TM=/^(([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])$/,_M=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,CM=/^([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])))",ZM=new RegExp(`^${SY}$`);function jY($){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 fM($){return new RegExp(`^${jY($)}$`)}function gM($){let I=`${SY}T${jY($)}`,U=[];if(U.push($.local?"Z?":"Z"),$.offset)U.push("([+-]\\d{2}:?\\d{2})");return I=`${I}(${U.join("|")})`,new RegExp(`^${I}$`)}function yM($,I){if((I==="v4"||!I)&&jM.test($))return!0;if((I==="v6"||!I)&&RM.test($))return!0;return!1}function xM($,I){if(!qM.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 lM($,I){if((I==="v4"||!I)&&PM.test($))return!0;if((I==="v6"||!I)&&TM.test($))return!0;return!1}class g6 extends t{_parse($){if(this._def.coerce)$.data=String($.data);if(this._getType($)!==S.string){let b=this._getOrReturnCtx($);return j(b,{code:M.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),j(D,{code:M.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),j(D,{code:M.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)j(D,{code:M.too_big,maximum:b.value,type:"string",inclusive:!0,exact:!0,message:b.message});else if(w)j(D,{code:M.too_small,minimum:b.value,type:"string",inclusive:!0,exact:!0,message:b.message});U.dirty()}}else if(b.kind==="email"){if(!EM.test($.data))D=this._getOrReturnCtx($,D),j(D,{validation:"email",code:M.invalid_string,message:b.message}),U.dirty()}else if(b.kind==="emoji"){if(!ZO)ZO=new RegExp(SM,"u");if(!ZO.test($.data))D=this._getOrReturnCtx($,D),j(D,{validation:"emoji",code:M.invalid_string,message:b.message}),U.dirty()}else if(b.kind==="uuid"){if(!KM.test($.data))D=this._getOrReturnCtx($,D),j(D,{validation:"uuid",code:M.invalid_string,message:b.message}),U.dirty()}else if(b.kind==="nanoid"){if(!FM.test($.data))D=this._getOrReturnCtx($,D),j(D,{validation:"nanoid",code:M.invalid_string,message:b.message}),U.dirty()}else if(b.kind==="cuid"){if(!zM.test($.data))D=this._getOrReturnCtx($,D),j(D,{validation:"cuid",code:M.invalid_string,message:b.message}),U.dirty()}else if(b.kind==="cuid2"){if(!MM.test($.data))D=this._getOrReturnCtx($,D),j(D,{validation:"cuid2",code:M.invalid_string,message:b.message}),U.dirty()}else if(b.kind==="ulid"){if(!VM.test($.data))D=this._getOrReturnCtx($,D),j(D,{validation:"ulid",code:M.invalid_string,message:b.message}),U.dirty()}else if(b.kind==="url")try{new URL($.data)}catch{D=this._getOrReturnCtx($,D),j(D,{validation:"url",code:M.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),j(D,{validation:"regex",code:M.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),j(D,{code:M.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),j(D,{code:M.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),j(D,{code:M.invalid_string,validation:{endsWith:b.value},message:b.message}),U.dirty()}else if(b.kind==="datetime"){if(!gM(b).test($.data))D=this._getOrReturnCtx($,D),j(D,{code:M.invalid_string,validation:"datetime",message:b.message}),U.dirty()}else if(b.kind==="date"){if(!ZM.test($.data))D=this._getOrReturnCtx($,D),j(D,{code:M.invalid_string,validation:"date",message:b.message}),U.dirty()}else if(b.kind==="time"){if(!fM(b).test($.data))D=this._getOrReturnCtx($,D),j(D,{code:M.invalid_string,validation:"time",message:b.message}),U.dirty()}else if(b.kind==="duration"){if(!kM.test($.data))D=this._getOrReturnCtx($,D),j(D,{validation:"duration",code:M.invalid_string,message:b.message}),U.dirty()}else if(b.kind==="ip"){if(!yM($.data,b.version))D=this._getOrReturnCtx($,D),j(D,{validation:"ip",code:M.invalid_string,message:b.message}),U.dirty()}else if(b.kind==="jwt"){if(!xM($.data,b.alg))D=this._getOrReturnCtx($,D),j(D,{validation:"jwt",code:M.invalid_string,message:b.message}),U.dirty()}else if(b.kind==="cidr"){if(!lM($.data,b.version))D=this._getOrReturnCtx($,D),j(D,{validation:"cidr",code:M.invalid_string,message:b.message}),U.dirty()}else if(b.kind==="base64"){if(!_M.test($.data))D=this._getOrReturnCtx($,D),j(D,{validation:"base64",code:M.invalid_string,message:b.message}),U.dirty()}else if(b.kind==="base64url"){if(!CM.test($.data))D=this._getOrReturnCtx($,D),j(D,{validation:"base64url",code:M.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:M.invalid_string,...C.errToObj(U)})}_addCheck($){return new g6({...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 g6({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new g6({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new g6({...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 $}}g6.create=($)=>{return new g6({checks:[],typeName:F.ZodString,coerce:$?.coerce??!1,...c($)})};function hM($,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 j(b,{code:M.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),j(U,{code:M.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),j(U,{code:M.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),j(U,{code:M.too_big,maximum:b.value,type:"number",inclusive:b.inclusive,exact:!1,message:b.message}),D.dirty()}else if(b.kind==="multipleOf"){if(hM($.data,b.value)!==0)U=this._getOrReturnCtx($,U),j(U,{code:M.not_multiple_of,multipleOf:b.value,message:b.message}),D.dirty()}else if(b.kind==="finite"){if(!Number.isFinite($.data))U=this._getOrReturnCtx($,U),j(U,{code:M.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),j(U,{code:M.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),j(U,{code:M.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),j(U,{code:M.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 j(I,{code:M.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 eb extends t{_parse($){if(this._def.coerce)$.data=Boolean($.data);if(this._getType($)!==S.boolean){let U=this._getOrReturnCtx($);return j(U,{code:M.invalid_type,expected:S.boolean,received:U.parsedType}),u}return Z$($.data)}}eb.create=($)=>{return new eb({typeName:F.ZodBoolean,coerce:$?.coerce||!1,...c($)})};class z1 extends t{_parse($){if(this._def.coerce)$.data=new Date($.data);if(this._getType($)!==S.date){let b=this._getOrReturnCtx($);return j(b,{code:M.invalid_type,expected:S.date,received:b.parsedType}),u}if(Number.isNaN($.data.getTime())){let b=this._getOrReturnCtx($);return j(b,{code:M.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),j(D,{code:M.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),j(D,{code:M.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 z1({...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}}z1.create=($)=>{return new z1({checks:[],coerce:$?.coerce||!1,typeName:F.ZodDate,...c($)})};class sb extends t{_parse($){if(this._getType($)!==S.symbol){let U=this._getOrReturnCtx($);return j(U,{code:M.invalid_type,expected:S.symbol,received:U.parsedType}),u}return Z$($.data)}}sb.create=($)=>{return new sb({typeName:F.ZodSymbol,...c($)})};class M1 extends t{_parse($){if(this._getType($)!==S.undefined){let U=this._getOrReturnCtx($);return j(U,{code:M.invalid_type,expected:S.undefined,received:U.parsedType}),u}return Z$($.data)}}M1.create=($)=>{return new M1({typeName:F.ZodUndefined,...c($)})};class V1 extends t{_parse($){if(this._getType($)!==S.null){let U=this._getOrReturnCtx($);return j(U,{code:M.invalid_type,expected:S.null,received:U.parsedType}),u}return Z$($.data)}}V1.create=($)=>{return new V1({typeName:F.ZodNull,...c($)})};class $D extends t{constructor(){super(...arguments);this._any=!0}_parse($){return Z$($.data)}}$D.create=($)=>{return new $D({typeName:F.ZodAny,...c($)})};class S4 extends t{constructor(){super(...arguments);this._unknown=!0}_parse($){return Z$($.data)}}S4.create=($)=>{return new S4({typeName:F.ZodUnknown,...c($)})};class y6 extends t{_parse($){let I=this._getOrReturnCtx($);return j(I,{code:M.invalid_type,expected:S.never,received:I.parsedType}),u}}y6.create=($)=>{return new y6({typeName:F.ZodNever,...c($)})};class ID extends t{_parse($){if(this._getType($)!==S.undefined){let U=this._getOrReturnCtx($);return j(U,{code:M.invalid_type,expected:S.void,received:U.parsedType}),u}return Z$($.data)}}ID.create=($)=>{return new ID({typeName:F.ZodVoid,...c($)})};class z6 extends t{_parse($){let{ctx:I,status:U}=this._processInputParams($),D=this._def;if(I.parsedType!==S.array)return j(I,{code:M.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)j(I,{code:A?M.too_big:M.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)j(I,{code:M.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)j(I,{code:M.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 z6({...this._def,minLength:{value:$,message:C.toString(I)}})}max($,I){return new z6({...this._def,maxLength:{value:$,message:C.toString(I)}})}length($,I){return new z6({...this._def,exactLength:{value:$,message:C.toString(I)}})}nonempty($){return this.min(1,$)}}z6.create=($,I)=>{return new z6({type:$,minLength:null,maxLength:null,exactLength:null,typeName:F.ZodArray,...c(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 z6)return new z6({...$._def,type:e4($.element)});else if($ instanceof M6)return M6.create(e4($.unwrap()));else if($ instanceof p6)return p6.create(e4($.unwrap()));else if($ instanceof x6)return x6.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($)!==S.object){let N=this._getOrReturnCtx($);return j(N,{code:M.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 y6&&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 y6){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)j(D,{code:M.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 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 PY(s.objectKeys(this.shape))}}L$.create=($,I)=>{return new L$({shape:()=>$,unknownKeys:"strip",catchall:y6.create(),typeName:F.ZodObject,...c(I)})};L$.strictCreate=($,I)=>{return new L$({shape:()=>$,unknownKeys:"strict",catchall:y6.create(),typeName:F.ZodObject,...c(I)})};L$.lazycreate=($,I)=>{return new L$({shape:$,unknownKeys:"strip",catchall:y6.create(),typeName:F.ZodObject,...c(I)})};class K1 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 j(I,{code:M.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 j(I,{code:M.invalid_union,unionErrors:w}),u}}get options(){return this._def.options}}K1.create=($,I)=>{return new K1({options:$,typeName:F.ZodUnion,...c(I)})};var f6=($)=>{if($ instanceof q1)return f6($.schema);else if($ instanceof V6)return f6($.innerType());else if($ instanceof k1)return[$.value];else if($ instanceof j4)return $.options;else if($ instanceof E1)return s.objectValues($.enum);else if($ instanceof S1)return f6($._def.innerType);else if($ instanceof M1)return[void 0];else if($ instanceof V1)return[null];else if($ instanceof M6)return[void 0,...f6($.unwrap())];else if($ instanceof p6)return[null,...f6($.unwrap())];else if($ instanceof yO)return f6($.unwrap());else if($ instanceof P1)return f6($.unwrap());else if($ instanceof j1)return f6($._def.innerType);else return[]};class gO extends t{_parse($){let{ctx:I}=this._processInputParams($);if(I.parsedType!==S.object)return j(I,{code:M.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 j(I,{code:M.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=f6(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 gO({typeName:F.ZodDiscriminatedUnion,discriminator:$,options:I,optionsMap:D,...c(U)})}}function fO($,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=fO($[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=fO(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 F1 extends t{_parse($){let{status:I,ctx:U}=this._processInputParams($),D=(b,A)=>{if(_O(b)||_O(A))return u;let w=fO(b.value,A.value);if(!w.valid)return j(U,{code:M.invalid_intersection_types}),u;if(CO(b)||CO(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}))}}F1.create=($,I,U)=>{return new F1({left:$,right:I,typeName:F.ZodIntersection,...c(U)})};class x6 extends t{_parse($){let{status:I,ctx:U}=this._processInputParams($);if(U.parsedType!==S.array)return j(U,{code:M.invalid_type,expected:S.array,received:U.parsedType}),u;if(U.data.length<this._def.items.length)return j(U,{code:M.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)j(U,{code:M.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 x6({...this._def,rest:$})}}x6.create=($,I)=>{if(!Array.isArray($))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new x6({items:$,typeName:F.ZodTuple,rest:null,...c(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!==S.object)return j(U,{code:M.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 UD({keyType:$,valueType:I,typeName:F.ZodRecord,...c(U)});return new UD({keyType:g6.create(),valueType:$,typeName:F.ZodRecord,...c(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!==S.map)return j(U,{code:M.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}}}}bD.create=($,I,U)=>{return new bD({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 j(U,{code:M.invalid_type,expected:S.set,received:U.parsedType}),u;let D=this._def;if(D.minSize!==null){if(U.data.size<D.minSize.value)j(U,{code:M.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)j(U,{code:M.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 L1 extends t{constructor(){super(...arguments);this.validate=this.implement}_parse($){let{ctx:I}=this._processInputParams($);if(I.parsedType!==S.function)return j(I,{code:M.invalid_type,expected:S.function,received:I.parsedType}),u;function U(w,O){return ab({data:w,path:I.path,errorMaps:[I.common.contextualErrorMap,I.schemaErrorMap,J1(),d6].filter((N)=>!!N),issueData:{code:M.invalid_arguments,argumentsError:O}})}function D(w,O){return ab({data:w,path:I.path,errorMaps:[I.common.contextualErrorMap,I.schemaErrorMap,J1(),d6].filter((N)=>!!N),issueData:{code:M.invalid_return_type,returnTypeError:O}})}let b={errorMap:I.common.contextualErrorMap},A=I.data;if(this._def.returns instanceof UI){let w=this;return Z$(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 Z$(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 L1({...this._def,args:x6.create($).rest(S4.create())})}returns($){return new L1({...this._def,returns:$})}implement($){return this.parse($)}strictImplement($){return this.parse($)}static create($,I,U){return new L1({args:$?$:x6.create([]).rest(S4.create()),returns:I||S4.create(),typeName:F.ZodFunction,...c(U)})}}class q1 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})}}q1.create=($,I)=>{return new q1({getter:$,typeName:F.ZodLazy,...c(I)})};class k1 extends t{_parse($){if($.data!==this._def.value){let I=this._getOrReturnCtx($);return j(I,{received:I.data,code:M.invalid_literal,expected:this._def.value}),u}return{status:"valid",value:$.data}}get value(){return this._def.value}}k1.create=($,I)=>{return new k1({value:$,typeName:F.ZodLiteral,...c(I)})};function PY($,I){return new j4({values:$,typeName:F.ZodEnum,...c(I)})}class j4 extends t{_parse($){if(typeof $.data!=="string"){let I=this._getOrReturnCtx($),U=this._def.values;return j(I,{expected:s.joinValues(U),received:I.parsedType,code:M.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 j(I,{received:I.data,code:M.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 j4.create($,{...this._def,...I})}exclude($,I=this._def){return j4.create(this.options.filter((U)=>!$.includes(U)),{...this._def,...I})}}j4.create=PY;class E1 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 j(U,{expected:s.joinValues(D),received:U.parsedType,code:M.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 j(U,{received:U.data,code:M.invalid_enum_value,options:D}),u}return Z$($.data)}get enum(){return this._def.values}}E1.create=($,I)=>{return new E1({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 j(I,{code:M.invalid_type,expected:S.promise,received:I.parsedType}),u;let U=I.parsedType===S.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,...c(I)})};class V6 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(j(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(!E4(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(!E4(A))return u;return Promise.resolve(D.transform(A.value,b)).then((w)=>({status:I.value,value:w}))});s.assertNever(D)}}V6.create=($,I,U)=>{return new V6({schema:$,typeName:F.ZodEffects,effect:I,...c(U)})};V6.createWithPreprocess=($,I,U)=>{return new V6({schema:I,effect:{type:"preprocess",transform:$},typeName:F.ZodEffects,...c(U)})};class M6 extends t{_parse($){if(this._getType($)===S.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,...c(I)})};class p6 extends t{_parse($){if(this._getType($)===S.null)return Z$(null);return this._def.innerType._parse($)}unwrap(){return this._def.innerType}}p6.create=($,I)=>{return new p6({innerType:$,typeName:F.ZodNullable,...c(I)})};class S1 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}}S1.create=($,I)=>{return new S1({innerType:$,typeName:F.ZodDefault,defaultValue:typeof I.default==="function"?I.default:()=>I.default,...c(I)})};class j1 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(H1(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}}j1.create=($,I)=>{return new j1({innerType:$,typeName:F.ZodCatch,catchValue:typeof I.catch==="function"?I.catch:()=>I.catch,...c(I)})};class DD extends t{_parse($){if(this._getType($)!==S.nan){let U=this._getOrReturnCtx($);return j(U,{code:M.invalid_type,expected:S.nan,received:U.parsedType}),u}return{status:"valid",value:$.data}}}DD.create=($)=>{return new DD({typeName:F.ZodNaN,...c($)})};var KZ=Symbol("zod_brand");class yO 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 AD 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 AD({in:$,out:I,typeName:F.ZodPipeline})}}class P1 extends t{_parse($){let I=this._def.innerType._parse($),U=(D)=>{if(E4(D))D.value=Object.freeze(D.value);return D};return H1(I)?I.then((D)=>U(D)):U(I)}unwrap(){return this._def.innerType}}P1.create=($,I)=>{return new P1({innerType:$,typeName:F.ZodReadonly,...c(I)})};var FZ={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 qZ=g6.create,kZ=s4.create,EZ=DD.create,SZ=$I.create,jZ=eb.create,PZ=z1.create,RZ=sb.create,TZ=M1.create,_Z=V1.create,CZ=$D.create,ZZ=S4.create,fZ=y6.create,gZ=ID.create,yZ=z6.create,RY=L$.create,xZ=L$.strictCreate,lZ=K1.create,hZ=gO.create,uZ=F1.create,iZ=x6.create,nZ=UD.create,rZ=bD.create,cZ=II.create,mZ=L1.create,oZ=q1.create,dZ=k1.create,pZ=j4.create,tZ=E1.create,aZ=UI.create,eZ=V6.create,sZ=M6.create,$f=p6.create,If=V6.createWithPreprocess,Uf=AD.create;var O6={};C6(O6,{version:()=>rN,util:()=>V,treeifyError:()=>pO,toJSONSchema:()=>x4,toDotPath:()=>gY,safeParseAsync:()=>U4,safeParse:()=>I4,safeEncodeAsync:()=>nY,safeEncode:()=>uY,safeDecodeAsync:()=>rY,safeDecode:()=>iY,registry:()=>P0,regexes:()=>t$,process:()=>O$,prettifyError:()=>tO,parseAsync:()=>_4,parse:()=>T4,meta:()=>OA,locales:()=>BI,isValidJWT:()=>XB,isValidBase64URL:()=>NB,isValidBase64:()=>tN,initializeContext:()=>w4,globalRegistry:()=>f$,globalConfig:()=>R1,formatError:()=>l1,flattenError:()=>x1,finalize:()=>N4,extractDefs:()=>O4,encodeAsync:()=>lY,encode:()=>yY,describe:()=>wA,decodeAsync:()=>hY,decode:()=>xY,createToJSONSchemaMethod:()=>UW,createStandardJSONSchemaMethod:()=>RI,config:()=>z$,clone:()=>k$,_xor:()=>uK,_xid:()=>wU,_void:()=>d0,_uuidv7:()=>$U,_uuidv6:()=>s1,_uuidv4:()=>e1,_uuid:()=>a1,_url:()=>JI,_uppercase:()=>MI,_unknown:()=>m0,_union:()=>hK,_undefined:()=>n0,_ulid:()=>AU,_uint64:()=>u0,_uint32:()=>y0,_tuple:()=>rK,_trim:()=>EI,_transform:()=>aK,_toUpperCase:()=>jI,_toLowerCase:()=>SI,_templateLiteral:()=>wF,_symbol:()=>i0,_superRefine:()=>AA,_success:()=>UF,_stringbool:()=>NA,_stringFormat:()=>y4,_string:()=>R0,_startsWith:()=>KI,_slugify:()=>PI,_size:()=>HI,_set:()=>oK,_safeParseAsync:()=>XI,_safeParse:()=>NI,_safeEncodeAsync:()=>BD,_safeEncode:()=>QD,_safeDecodeAsync:()=>vD,_safeDecode:()=>YD,_regex:()=>LI,_refine:()=>DA,_record:()=>cK,_readonly:()=>AF,_property:()=>IA,_promise:()=>NF,_positive:()=>a0,_pipe:()=>DF,_parseAsync:()=>OI,_parse:()=>wI,_overwrite:()=>w6,_optional:()=>eK,_number:()=>_0,_nullable:()=>sK,_null:()=>r0,_normalize:()=>kI,_nonpositive:()=>s0,_nonoptional:()=>IF,_nonnegative:()=>$A,_never:()=>o0,_negative:()=>e0,_nativeEnum:()=>pK,_nanoid:()=>UU,_nan:()=>t0,_multipleOf:()=>D4,_minSize:()=>A4,_minLength:()=>l6,_min:()=>g$,_mime:()=>qI,_maxSize:()=>Z4,_maxLength:()=>f4,_max:()=>a$,_map:()=>mK,_mac:()=>T0,_lte:()=>a$,_lt:()=>F6,_lowercase:()=>zI,_literal:()=>tK,_length:()=>g4,_lazy:()=>OF,_ksuid:()=>OU,_jwt:()=>vU,_isoTime:()=>pX,_isoDuration:()=>tX,_isoDateTime:()=>oX,_isoDate:()=>dX,_ipv6:()=>XU,_ipv4:()=>NU,_intersection:()=>nK,_int64:()=>h0,_int32:()=>g0,_int:()=>C0,_includes:()=>VI,_guid:()=>vI,_gte:()=>g$,_gt:()=>q6,_float64:()=>f0,_float32:()=>Z0,_file:()=>UA,_enum:()=>dK,_endsWith:()=>FI,_encodeAsync:()=>WD,_encode:()=>ND,_emoji:()=>IU,_email:()=>t1,_e164:()=>BU,_discriminatedUnion:()=>iK,_default:()=>$F,_decodeAsync:()=>GD,_decode:()=>XD,_date:()=>p0,_custom:()=>bA,_cuid2:()=>DU,_cuid:()=>bU,_coercedString:()=>cX,_coercedNumber:()=>aX,_coercedDate:()=>$W,_coercedBoolean:()=>eX,_coercedBigint:()=>sX,_cidrv6:()=>GU,_cidrv4:()=>WU,_check:()=>JB,_catch:()=>bF,_boolean:()=>x0,_bigint:()=>l0,_base64url:()=>YU,_base64:()=>QU,_array:()=>IW,_any:()=>c0,TimePrecision:()=>mX,NEVER:()=>xO,JSONSchemaGenerator:()=>uW,JSONSchema:()=>HB,Doc:()=>zD,$output:()=>iX,$input:()=>nX,$constructor:()=>v,$brand:()=>lO,$ZodXor:()=>D0,$ZodXID:()=>ZD,$ZodVoid:()=>$0,$ZodUnknown:()=>eD,$ZodUnion:()=>QI,$ZodUndefined:()=>pD,$ZodUUID:()=>ED,$ZodURL:()=>jD,$ZodULID:()=>CD,$ZodType:()=>n,$ZodTuple:()=>r1,$ZodTransform:()=>Y0,$ZodTemplateLiteral:()=>q0,$ZodSymbol:()=>dD,$ZodSuccess:()=>z0,$ZodStringFormat:()=>w$,$ZodString:()=>b4,$ZodSet:()=>X0,$ZodRegistry:()=>rX,$ZodRecord:()=>O0,$ZodRealError:()=>i$,$ZodReadonly:()=>F0,$ZodPromise:()=>E0,$ZodPrefault:()=>H0,$ZodPipe:()=>K0,$ZodOptional:()=>B0,$ZodObjectJIT:()=>aN,$ZodObject:()=>b0,$ZodNumberFormat:()=>mD,$ZodNumber:()=>i1,$ZodNullable:()=>v0,$ZodNull:()=>tD,$ZodNonOptional:()=>L0,$ZodNever:()=>sD,$ZodNanoID:()=>RD,$ZodNaN:()=>V0,$ZodMap:()=>N0,$ZodMAC:()=>xD,$ZodLiteral:()=>G0,$ZodLazy:()=>S0,$ZodKSUID:()=>fD,$ZodJWT:()=>rD,$ZodIntersection:()=>w0,$ZodISOTime:()=>dN,$ZodISODuration:()=>pN,$ZodISODateTime:()=>mN,$ZodISODate:()=>oN,$ZodIPv6:()=>yD,$ZodIPv4:()=>gD,$ZodGUID:()=>kD,$ZodFunction:()=>k0,$ZodFile:()=>Q0,$ZodError:()=>y1,$ZodEnum:()=>W0,$ZodEncodeError:()=>P4,$ZodEmoji:()=>PD,$ZodEmail:()=>SD,$ZodE164:()=>nD,$ZodDiscriminatedUnion:()=>A0,$ZodDefault:()=>J0,$ZodDate:()=>I0,$ZodCustomStringFormat:()=>cD,$ZodCustom:()=>j0,$ZodCodec:()=>YI,$ZodCheckUpperCase:()=>yN,$ZodCheckStringFormat:()=>WI,$ZodCheckStartsWith:()=>lN,$ZodCheckSizeEquals:()=>TN,$ZodCheckRegex:()=>fN,$ZodCheckProperty:()=>uN,$ZodCheckOverwrite:()=>nN,$ZodCheckNumberFormat:()=>SN,$ZodCheckMultipleOf:()=>EN,$ZodCheckMinSize:()=>RN,$ZodCheckMinLength:()=>CN,$ZodCheckMimeType:()=>iN,$ZodCheckMaxSize:()=>PN,$ZodCheckMaxLength:()=>_N,$ZodCheckLowerCase:()=>gN,$ZodCheckLessThan:()=>HD,$ZodCheckLengthEquals:()=>ZN,$ZodCheckIncludes:()=>xN,$ZodCheckGreaterThan:()=>LD,$ZodCheckEndsWith:()=>hN,$ZodCheckBigIntFormat:()=>jN,$ZodCheck:()=>X$,$ZodCatch:()=>M0,$ZodCUID2:()=>_D,$ZodCUID:()=>TD,$ZodCIDRv6:()=>hD,$ZodCIDRv4:()=>lD,$ZodBoolean:()=>GI,$ZodBigIntFormat:()=>oD,$ZodBigInt:()=>n1,$ZodBase64URL:()=>iD,$ZodBase64:()=>uD,$ZodAsyncError:()=>K6,$ZodArray:()=>U0,$ZodAny:()=>aD});var xO=Object.freeze({status:"aborted"});function v($,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 lO=Symbol("zod_brand");class K6 extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class P4 extends Error{constructor($){super(`Encountered unidirectional transform during encode: ${$}`);this.name="ZodEncodeError"}}var R1={};function z$($){if($)Object.assign(R1,$);return R1}var V={};C6(V,{unwrapMessage:()=>T1,uint8ArrayToHex:()=>GV,uint8ArrayToBase64url:()=>XV,uint8ArrayToBase64:()=>CY,stringifyPrimitive:()=>q,slugify:()=>iO,shallowClone:()=>rO,safeExtend:()=>bV,required:()=>wV,randomString:()=>tM,propertyKeyTypes:()=>Z1,promiseAllObject:()=>pM,primitiveTypes:()=>cO,prefixIssues:()=>p$,pick:()=>$V,partial:()=>AV,optionalKeys:()=>mO,omit:()=>IV,objectClone:()=>mM,numKeys:()=>aM,nullish:()=>t6,normalizeParams:()=>E,mergeDefs:()=>e6,merge:()=>DV,jsonStringifyReplacer:()=>bI,joinValues:()=>z,issue:()=>AI,isPlainObject:()=>s6,isObject:()=>R4,hexToUint8Array:()=>WV,getSizableOrigin:()=>f1,getParsedType:()=>eM,getLengthableOrigin:()=>g1,getEnumValues:()=>_1,getElementAtPath:()=>dM,floatSafeRemainder:()=>uO,finalizeIssue:()=>u$,extend:()=>UV,escapeRegex:()=>s$,esc:()=>wD,defineLazy:()=>e,createTransparentProxy:()=>sM,cloneDef:()=>oM,clone:()=>k$,cleanRegex:()=>C1,cleanEnum:()=>OV,captureStackTrace:()=>OD,cached:()=>DI,base64urlToUint8Array:()=>NV,base64ToUint8Array:()=>_Y,assignProp:()=>a6,assertNotEqual:()=>iM,assertNever:()=>rM,assertIs:()=>nM,assertEqual:()=>uM,assert:()=>cM,allowsEval:()=>nO,aborted:()=>$4,NUMBER_FORMAT_RANGES:()=>oO,Class:()=>ZY,BIGINT_FORMAT_RANGES:()=>dO});function uM($){return $}function iM($){return $}function nM($){}function rM($){throw new Error("Unexpected value in exhaustive check")}function cM($){}function _1($){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 t6($){return $===null||$===void 0}function C1($){let I=$.startsWith("^")?1:0,U=$.endsWith("$")?$.length-1:$.length;return $.slice(I,U)}function uO($,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 TY=Symbol("evaluating");function e($,I,U){let D=void 0;Object.defineProperty($,I,{get(){if(D===TY)return;if(D===void 0)D=TY,D=U();return D},set(b){Object.defineProperty($,I,{value:b})},configurable:!0})}function mM($){return Object.create(Object.getPrototypeOf($),Object.getOwnPropertyDescriptors($))}function a6($,I,U){Object.defineProperty($,I,{value:U,writable:!0,enumerable:!0,configurable:!0})}function e6(...$){let I={};for(let U of $){let D=Object.getOwnPropertyDescriptors(U);Object.assign(I,D)}return Object.defineProperties({},I)}function oM($){return e6($._zod.def)}function dM($,I){if(!I)return $;return I.reduce((U,D)=>U?.[D],$)}function pM($){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 tM($=10){let U="";for(let D=0;D<$;D++)U+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return U}function wD($){return JSON.stringify($)}function iO($){return $.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var OD="captureStackTrace"in Error?Error.captureStackTrace:(...$)=>{};function R4($){return typeof $==="object"&&$!==null&&!Array.isArray($)}var nO=DI(()=>{if(typeof navigator!=="undefined"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch($){return!1}});function s6($){if(R4($)===!1)return!1;let I=$.constructor;if(I===void 0)return!0;if(typeof I!=="function")return!0;let U=I.prototype;if(R4(U)===!1)return!1;if(Object.prototype.hasOwnProperty.call(U,"isPrototypeOf")===!1)return!1;return!0}function rO($){if(s6($))return{...$};if(Array.isArray($))return[...$];return $}function aM($){let I=0;for(let U in $)if(Object.prototype.hasOwnProperty.call($,U))I++;return I}var eM=($)=>{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}`)}},Z1=new Set(["string","number","symbol"]),cO=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 sM($){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 q($){if(typeof $==="bigint")return $.toString()+"n";if(typeof $==="string")return`"${$}"`;return`${$}`}function mO($){return Object.keys($).filter((I)=>{return $[I]._zod.optin==="optional"&&$[I]._zod.optout==="optional"})}var oO={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]},dO={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function $V($,I){let U=$._zod.def,D=e6($._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 a6(this,"shape",b),b},checks:[]});return k$($,D)}function IV($,I){let U=$._zod.def,D=e6($._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 a6(this,"shape",b),b},checks:[]});return k$($,D)}function UV($,I){if(!s6(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=e6($._zod.def,{get shape(){let A={...$._zod.def.shape,...I};return a6(this,"shape",A),A},checks:[]});return k$($,b)}function bV($,I){if(!s6(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 a6(this,"shape",D),D},checks:$._zod.def.checks};return k$($,U)}function DV($,I){let U=e6($._zod.def,{get shape(){let D={...$._zod.def.shape,...I._zod.def.shape};return a6(this,"shape",D),D},get catchall(){return I._zod.def.catchall},checks:[]});return k$($,U)}function AV($,I,U){let D=e6(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 a6(this,"shape",A),A},checks:[]});return k$(I,D)}function wV($,I,U){let D=e6(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 a6(this,"shape",A),A},checks:[]});return k$(I,D)}function $4($,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 T1($){return typeof $==="string"?$:$?.message}function u$($,I,U){let D={...$,path:$.path??[]};if(!$.message){let b=T1($.inst?._zod.def?.error?.($))??T1(I?.error?.($))??T1(U.customError?.($))??T1(U.localeError?.($))??"Invalid input";D.message=b}if(delete D.inst,delete D.continue,!I?.reportInput)delete D.input;return D}function f1($){if($ instanceof Set)return"set";if($ instanceof Map)return"map";if($ instanceof File)return"file";return"unknown"}function g1($){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 OV($){return Object.entries($).filter(([I,U])=>{return Number.isNaN(Number.parseInt(I,10))}).map((I)=>I[1])}function _Y($){let I=atob($),U=new Uint8Array(I.length);for(let D=0;D<I.length;D++)U[D]=I.charCodeAt(D);return U}function CY($){let I="";for(let U=0;U<$.length;U++)I+=String.fromCharCode($[U]);return btoa(I)}function NV($){let I=$.replace(/-/g,"+").replace(/_/g,"/"),U="=".repeat((4-I.length%4)%4);return _Y(I+U)}function XV($){return CY($).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function WV($){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 GV($){return Array.from($).map((I)=>I.toString(16).padStart(2,"0")).join("")}class ZY{constructor(...$){}}var fY=($,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})},y1=v("$ZodError",fY),i$=v("$ZodError",fY,{Parent:Error});function x1($,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 l1($,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 pO($,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],B=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(B)G.errors.push(I(N));Q++}}};return D($),U}function gY($){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 tO($){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 ${gY(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 K6;if(w.issues.length){let O=new(b?.Err??$)(w.issues.map((N)=>u$(N,A,z$())));throw OD(O,b?.callee),O}return w.value},T4=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,z$())));throw OD(O,b?.callee),O}return w.value},_4=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 K6;return A.issues.length?{success:!1,error:new($??y1)(A.issues.map((w)=>u$(w,b,z$())))}:{success:!0,data:A.value}},I4=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,z$())))}:{success:!0,data:A.value}},U4=XI(i$),ND=($)=>(I,U,D)=>{let b=D?Object.assign(D,{direction:"backward"}):{direction:"backward"};return wI($)(I,U,b)},yY=ND(i$),XD=($)=>(I,U,D)=>{return wI($)(I,U,D)},xY=XD(i$),WD=($)=>async(I,U,D)=>{let b=D?Object.assign(D,{direction:"backward"}):{direction:"backward"};return OI($)(I,U,b)},lY=WD(i$),GD=($)=>async(I,U,D)=>{return OI($)(I,U,D)},hY=GD(i$),QD=($)=>(I,U,D)=>{let b=D?Object.assign(D,{direction:"backward"}):{direction:"backward"};return NI($)(I,U,b)},uY=QD(i$),YD=($)=>(I,U,D)=>{return NI($)(I,U,D)},iY=YD(i$),BD=($)=>async(I,U,D)=>{let b=D?Object.assign(D,{direction:"backward"}):{direction:"backward"};return XI($)(I,U,b)},nY=BD(i$),vD=($)=>async(I,U,D)=>{return XI($)(I,U,D)},rY=vD(i$);var t$={};C6(t$,{xid:()=>$N,uuid7:()=>JV,uuid6:()=>vV,uuid4:()=>BV,uuid:()=>C4,uppercase:()=>kN,unicodeEmail:()=>cY,undefined:()=>FN,ulid:()=>sO,time:()=>vN,string:()=>HN,sha512_hex:()=>yV,sha512_base64url:()=>lV,sha512_base64:()=>xV,sha384_hex:()=>ZV,sha384_base64url:()=>gV,sha384_base64:()=>fV,sha256_hex:()=>TV,sha256_base64url:()=>CV,sha256_base64:()=>_V,sha1_hex:()=>jV,sha1_base64url:()=>RV,sha1_base64:()=>PV,rfc5322Email:()=>LV,number:()=>MN,null:()=>KN,nanoid:()=>UN,md5_hex:()=>kV,md5_base64url:()=>SV,md5_base64:()=>EV,mac:()=>XN,lowercase:()=>qN,ksuid:()=>IN,ipv6:()=>NN,ipv4:()=>ON,integer:()=>zN,idnEmail:()=>zV,html5Email:()=>HV,hostname:()=>KV,hex:()=>qV,guid:()=>DN,extendedDuration:()=>YV,emoji:()=>wN,email:()=>AN,e164:()=>YN,duration:()=>bN,domain:()=>FV,datetime:()=>JN,date:()=>BN,cuid2:()=>eO,cuid:()=>aO,cidrv6:()=>GN,cidrv4:()=>WN,browserEmail:()=>MV,boolean:()=>VN,bigint:()=>LN,base64url:()=>JD,base64:()=>QN});var aO=/^[cC][^\s-]{8,}$/,eO=/^[0-9a-z]+$/,sO=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,$N=/^[0-9a-vA-V]{20}$/,IN=/^[A-Za-z0-9]{27}$/,UN=/^[a-zA-Z0-9_-]{21}$/,bN=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,YV=/^[-+]?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)?)??$/,DN=/^([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})$/,C4=($)=>{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})$`)},BV=C4(4),vV=C4(6),JV=C4(7),AN=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,HV=/^[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])?)*$/,LV=/^(([^<>()\[\]\\.,;:\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,}))$/,cY=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,zV=cY,MV=/^[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])?)*$/,VV="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function wN(){return new RegExp(VV,"u")}var ON=/^(?:(?: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])$/,NN=/^(([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}|:))$/,XN=($)=>{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}$`)},WN=/^((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])$/,GN=/^(([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])$/,QN=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,JD=/^[A-Za-z0-9_-]*$/,KV=/^(?=.{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])?)*\.?$/,FV=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,YN=/^\+(?:[0-9]){6,14}[0-9]$/,mY="(?:(?:\\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])))",BN=new RegExp(`^${mY}$`);function oY($){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 vN($){return new RegExp(`^${oY($)}$`)}function JN($){let I=oY({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(`^${mY}T(?:${D})$`)}var HN=($)=>{let I=$?`[\\s\\S]{${$?.minimum??0},${$?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${I}$`)},LN=/^-?\d+n?$/,zN=/^-?\d+$/,MN=/^-?\d+(?:\.\d+)?/,VN=/^(?:true|false)$/i,KN=/^null$/i;var FN=/^undefined$/i;var qN=/^[^A-Z]*$/,kN=/^[^a-z]*$/,qV=/^[0-9a-fA-F]*$/;function h1($,I){return new RegExp(`^[A-Za-z0-9+/]{${$}}${I}$`)}function u1($){return new RegExp(`^[A-Za-z0-9_-]{${$}}$`)}var kV=/^[0-9a-fA-F]{32}$/,EV=h1(22,"=="),SV=u1(22),jV=/^[0-9a-fA-F]{40}$/,PV=h1(27,"="),RV=u1(27),TV=/^[0-9a-fA-F]{64}$/,_V=h1(43,"="),CV=u1(43),ZV=/^[0-9a-fA-F]{96}$/,fV=h1(64,""),gV=u1(64),yV=/^[0-9a-fA-F]{128}$/,xV=h1(86,"=="),lV=u1(86);var X$=v("$ZodCheck",($,I)=>{var U;$._zod??($._zod={}),$._zod.def=I,(U=$._zod).onattach??(U.onattach=[])}),pY={number:"number",bigint:"bigint",object:"date"},HD=v("$ZodCheckLessThan",($,I)=>{X$.init($,I);let U=pY[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})}}),LD=v("$ZodCheckGreaterThan",($,I)=>{X$.init($,I);let U=pY[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})}}),EN=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):uO(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})}}),SN=v("$ZodCheckNumberFormat",($,I)=>{X$.init($,I),I.format=I.format||"float64";let U=I.format?.includes("int"),D=U?"int":"number",[b,A]=oO[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=zN}),$._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:$})}}),jN=v("$ZodCheckBigIntFormat",($,I)=>{X$.init($,I);let[U,D]=dO[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:$})}}),PN=v("$ZodCheckMaxSize",($,I)=>{var U;X$.init($,I),(U=$._zod.def).when??(U.when=(D)=>{let b=D.value;return!t6(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:f1(b),code:"too_big",maximum:I.maximum,inclusive:!0,input:b,inst:$,continue:!I.abort})}}),RN=v("$ZodCheckMinSize",($,I)=>{var U;X$.init($,I),(U=$._zod.def).when??(U.when=(D)=>{let b=D.value;return!t6(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:f1(b),code:"too_small",minimum:I.minimum,inclusive:!0,input:b,inst:$,continue:!I.abort})}}),TN=v("$ZodCheckSizeEquals",($,I)=>{var U;X$.init($,I),(U=$._zod.def).when??(U.when=(D)=>{let b=D.value;return!t6(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:f1(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})}}),_N=v("$ZodCheckMaxLength",($,I)=>{var U;X$.init($,I),(U=$._zod.def).when??(U.when=(D)=>{let b=D.value;return!t6(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=g1(b);D.issues.push({origin:w,code:"too_big",maximum:I.maximum,inclusive:!0,input:b,inst:$,continue:!I.abort})}}),CN=v("$ZodCheckMinLength",($,I)=>{var U;X$.init($,I),(U=$._zod.def).when??(U.when=(D)=>{let b=D.value;return!t6(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=g1(b);D.issues.push({origin:w,code:"too_small",minimum:I.minimum,inclusive:!0,input:b,inst:$,continue:!I.abort})}}),ZN=v("$ZodCheckLengthEquals",($,I)=>{var U;X$.init($,I),(U=$._zod.def).when??(U.when=(D)=>{let b=D.value;return!t6(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=g1(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=v("$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=()=>{})}),fN=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})}}),gN=v("$ZodCheckLowerCase",($,I)=>{I.pattern??(I.pattern=qN),WI.init($,I)}),yN=v("$ZodCheckUpperCase",($,I)=>{I.pattern??(I.pattern=kN),WI.init($,I)}),xN=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 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})}}),lN=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})}}),hN=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 dY($,I,U){if($.issues.length)I.issues.push(...p$(U,$.issues))}var uN=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)=>dY(b,U,I.property));dY(D,U,I.property);return}}),iN=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})}}),nN=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((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 rN={major:4,minor:2,patch:1};var n=v("$ZodType",($,I)=>{var U;$??($={}),$._zod.def=I,$._zod.bag=$._zod.bag||{},$._zod.version=rN;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=$4(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,B=Q._zod.check(w);if(B instanceof Promise&&N?.async===!1)throw new K6;if(G||B instanceof Promise)G=(G??Promise.resolve()).then(async()=>{if(await B,w.issues.length===Y)return;if(!X)X=$4(w,Y)});else{if(w.issues.length===Y)continue;if(!X)X=$4(w,Y)}}if(G)return G.then(()=>{return w});return w},A=(w,O,N)=>{if($4(w))return w.aborted=!0,w;let X=b(O,D,N);if(X instanceof Promise){if(N.async===!1)throw new K6;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 K6;return N.then((X)=>b(X,D,O))}return b(N,D,O)}}$["~standard"]={validate:(b)=>{try{let A=I4($,b);return A.success?{value:A.data}:{issues:A.error?.issues}}catch(A){return U4($,b).then((w)=>w.success?{value:w.data}:{issues:w.error?.issues})}},vendor:"zod",version:1}}),b4=v("$ZodString",($,I)=>{n.init($,I),$._zod.pattern=[...$?._zod.bag?.patterns??[]].pop()??HN($._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$=v("$ZodStringFormat",($,I)=>{WI.init($,I),b4.init($,I)}),kD=v("$ZodGUID",($,I)=>{I.pattern??(I.pattern=DN),w$.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=C4(D))}else I.pattern??(I.pattern=C4());w$.init($,I)}),SD=v("$ZodEmail",($,I)=>{I.pattern??(I.pattern=AN),w$.init($,I)}),jD=v("$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})}}}),PD=v("$ZodEmoji",($,I)=>{I.pattern??(I.pattern=wN()),w$.init($,I)}),RD=v("$ZodNanoID",($,I)=>{I.pattern??(I.pattern=UN),w$.init($,I)}),TD=v("$ZodCUID",($,I)=>{I.pattern??(I.pattern=aO),w$.init($,I)}),_D=v("$ZodCUID2",($,I)=>{I.pattern??(I.pattern=eO),w$.init($,I)}),CD=v("$ZodULID",($,I)=>{I.pattern??(I.pattern=sO),w$.init($,I)}),ZD=v("$ZodXID",($,I)=>{I.pattern??(I.pattern=$N),w$.init($,I)}),fD=v("$ZodKSUID",($,I)=>{I.pattern??(I.pattern=IN),w$.init($,I)}),mN=v("$ZodISODateTime",($,I)=>{I.pattern??(I.pattern=JN(I)),w$.init($,I)}),oN=v("$ZodISODate",($,I)=>{I.pattern??(I.pattern=BN),w$.init($,I)}),dN=v("$ZodISOTime",($,I)=>{I.pattern??(I.pattern=vN(I)),w$.init($,I)}),pN=v("$ZodISODuration",($,I)=>{I.pattern??(I.pattern=bN),w$.init($,I)}),gD=v("$ZodIPv4",($,I)=>{I.pattern??(I.pattern=ON),w$.init($,I),$._zod.bag.format="ipv4"}),yD=v("$ZodIPv6",($,I)=>{I.pattern??(I.pattern=NN),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})}}}),xD=v("$ZodMAC",($,I)=>{I.pattern??(I.pattern=XN(I.delimiter)),w$.init($,I),$._zod.bag.format="mac"}),lD=v("$ZodCIDRv4",($,I)=>{I.pattern??(I.pattern=WN),w$.init($,I)}),hD=v("$ZodCIDRv6",($,I)=>{I.pattern??(I.pattern=GN),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 tN($){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=QN),w$.init($,I),$._zod.bag.contentEncoding="base64",$._zod.check=(U)=>{if(tN(U.value))return;U.issues.push({code:"invalid_format",format:"base64",input:U.value,inst:$,continue:!I.abort})}});function NB($){if(!JD.test($))return!1;let I=$.replace(/[-_]/g,(D)=>D==="-"?"+":"/"),U=I.padEnd(Math.ceil(I.length/4)*4,"=");return tN(U)}var iD=v("$ZodBase64URL",($,I)=>{I.pattern??(I.pattern=JD),w$.init($,I),$._zod.bag.contentEncoding="base64url",$._zod.check=(U)=>{if(NB(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=YN),w$.init($,I)});function XB($,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 rD=v("$ZodJWT",($,I)=>{w$.init($,I),$._zod.check=(U)=>{if(XB(U.value,I.alg))return;U.issues.push({code:"invalid_format",format:"jwt",input:U.value,inst:$,continue:!I.abort})}}),cD=v("$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})}}),i1=v("$ZodNumber",($,I)=>{n.init($,I),$._zod.pattern=$._zod.bag.pattern??MN,$._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}}),mD=v("$ZodNumberFormat",($,I)=>{SN.init($,I),i1.init($,I)}),GI=v("$ZodBoolean",($,I)=>{n.init($,I),$._zod.pattern=VN,$._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}}),n1=v("$ZodBigInt",($,I)=>{n.init($,I),$._zod.pattern=LN,$._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)=>{jN.init($,I),n1.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=FN,$._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=KN,$._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(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 aY($,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 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)=>aY(X,U,w)));else aY(N,U,w)}if(A.length)return Promise.all(A).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 WB($){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=mO($.shape);return{...$,keys:I,keySet:new Set(I),numKeys:I.length,optionalKeys:new Set(U)}}function GB($,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)=>qD(Y,U,G,I)));else qD(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 b0=v("$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(()=>WB(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=R4,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 J=Q[Y]._zod.run({value:X[Y],issues:[]},N);if(J instanceof Promise)G.push(J.then((L)=>qD(L,O,Y,X)));else qD(J,O,Y,X)}if(!A)return G.length?Promise.all(G).then(()=>O):O;return GB(G,X,O,N,D.value,$)}}),aN=v("$ZodObjectJIT",($,I)=>{b0.init($,I);let U=$._zod.parse,D=DI(()=>WB(I)),b=(Y)=>{let B=new zD(["shape","payload","ctx"]),J=D.value,L=(x)=>{let a=wD(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=wD(x);B.write(`const ${a} = ${L(x)};`),B.write(`
13
+ if (${a}.issues.length) {
14
+ payload.issues = payload.issues.concat(${a}.issues.map(iss => ({
32
15
  ...iss,
33
- path: iss.path ? [${c4(F)}, ...iss.path] : [${c4(F)}]
34
- })));`),B.write(`newResult[${c4(F)}] = ${k}.value`)}B.write("payload.value = newResult;"),B.write("return payload;");let V=B.compile();return(F,k)=>V(Q,F,k)},A,w=VI,b=!QA.jitless,O=b&&WN.value,X=I.catchall,W;$._zod.parse=(Q,B)=>{W??(W=U.value);let Y=Q.value;if(!w(Y))return Q.issues.push({expected:"object",code:"invalid_type",input:Y,inst:$}),Q;let J=[];if(b&&O&&B?.async===!1&&B.jitless!==!0){if(!A)A=D(I.shape);Q=A(Q,B)}else{Q.value={};let k=W.shape;for(let h of W.keys){let l=k[h],l$=l._zod.run({value:Y[h],issues:[]},B),G6=l._zod.optin==="optional"&&l._zod.optout==="optional";if(l$ instanceof Promise)J.push(l$.then((BI)=>G6?fJ(BI,Q,h,Y):zA(BI,Q,h)));else if(G6)fJ(l$,Q,h,Y);else zA(l$,Q,h)}}if(!X)return J.length?Promise.all(J).then(()=>Q):Q;let H=[],v=W.keySet,V=X._zod,F=V.def.type;for(let k of Object.keys(Y)){if(v.has(k))continue;if(F==="never"){H.push(k);continue}let h=V.run({value:Y[k],issues:[]},B);if(h instanceof Promise)J.push(h.then((l)=>zA(l,Q,k)));else zA(h,Q,k)}if(H.length)Q.issues.push({code:"unrecognized_keys",keys:H,input:Y,inst:$});if(!J.length)return Q;return Promise.all(J).then(()=>{return Q})}});function yJ($,I,U,D){for(let A of $)if(A.issues.length===0)return I.value=A.value,I;return I.issues.push({code:"invalid_union",input:I.value,inst:U,errors:$.map((A)=>A.issues.map((w)=>v6(w,D,b6())))}),I}var VA=K("$ZodUnion",($,I)=>{W$.init($,I),H$($._zod,"optin",()=>I.options.some((U)=>U._zod.optin==="optional")?"optional":void 0),H$($._zod,"optout",()=>I.options.some((U)=>U._zod.optout==="optional")?"optional":void 0),H$($._zod,"values",()=>{if(I.options.every((U)=>U._zod.values))return new Set(I.options.flatMap((U)=>Array.from(U._zod.values)));return}),H$($._zod,"pattern",()=>{if(I.options.every((U)=>U._zod.pattern)){let U=I.options.map((D)=>D._zod.pattern);return new RegExp(`^(${U.map((D)=>o1(D.source)).join("|")})$`)}return}),$._zod.parse=(U,D)=>{let A=!1,w=[];for(let b of I.options){let N=b._zod.run({value:U.value,issues:[]},D);if(N instanceof Promise)w.push(N),A=!0;else{if(N.issues.length===0)return N;w.push(N)}}if(!A)return yJ(w,U,$,D);return Promise.all(w).then((b)=>{return yJ(b,U,$,D)})}}),$O=K("$ZodDiscriminatedUnion",($,I)=>{VA.init($,I);let U=$._zod.parse;H$($._zod,"propValues",()=>{let A={};for(let w of I.options){let b=w._zod.propValues;if(!b||Object.keys(b).length===0)throw new Error(`Invalid discriminated union option at index "${I.options.indexOf(w)}"`);for(let[N,O]of Object.entries(b)){if(!A[N])A[N]=new Set;for(let X of O)A[N].add(X)}}return A});let D=i1(()=>{let A=I.options,w=new Map;for(let b of A){let N=b._zod.propValues[I.discriminator];if(!N||N.size===0)throw new Error(`Invalid discriminated union option at index "${I.options.indexOf(b)}"`);for(let O of N){if(w.has(O))throw new Error(`Duplicate discriminator value "${String(O)}"`);w.set(O,b)}}return w});$._zod.parse=(A,w)=>{let b=A.value;if(!VI(b))return A.issues.push({code:"invalid_type",expected:"object",input:b,inst:$}),A;let N=D.value.get(b?.[I.discriminator]);if(N)return N._zod.run(A,w);if(I.unionFallback)return U(A,w);return A.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:b,path:[I.discriminator],inst:$}),A}}),IO=K("$ZodIntersection",($,I)=>{W$.init($,I),$._zod.parse=(U,D)=>{let A=U.value,w=I.left._zod.run({value:A,issues:[]},D),b=I.right._zod.run({value:A,issues:[]},D);if(w instanceof Promise||b instanceof Promise)return Promise.all([w,b]).then(([O,X])=>{return uJ(U,O,X)});return uJ(U,w,b)}});function kN($,I){if($===I)return{valid:!0,data:$};if($ instanceof Date&&I instanceof Date&&+$===+I)return{valid:!0,data:$};if(vI($)&&vI(I)){let U=Object.keys(I),D=Object.keys($).filter((w)=>U.indexOf(w)!==-1),A={...$,...I};for(let w of D){let b=kN($[w],I[w]);if(!b.valid)return{valid:!1,mergeErrorPath:[w,...b.mergeErrorPath]};A[w]=b.data}return{valid:!0,data:A}}if(Array.isArray($)&&Array.isArray(I)){if($.length!==I.length)return{valid:!1,mergeErrorPath:[]};let U=[];for(let D=0;D<$.length;D++){let A=$[D],w=I[D],b=kN(A,w);if(!b.valid)return{valid:!1,mergeErrorPath:[D,...b.mergeErrorPath]};U.push(b.data)}return{valid:!0,data:U}}return{valid:!1,mergeErrorPath:[]}}function uJ($,I,U){if(I.issues.length)$.issues.push(...I.issues);if(U.issues.length)$.issues.push(...U.issues);if(m4($))return $;let D=kN(I.value,U.value);if(!D.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(D.mergeErrorPath)}`);return $.value=D.data,$}var UO=K("$ZodRecord",($,I)=>{W$.init($,I),$._zod.parse=(U,D)=>{let A=U.value;if(!vI(A))return U.issues.push({expected:"record",code:"invalid_type",input:A,inst:$}),U;let w=[];if(I.keyType._zod.values){let b=I.keyType._zod.values;U.value={};for(let O of b)if(typeof O==="string"||typeof O==="number"||typeof O==="symbol"){let X=I.valueType._zod.run({value:A[O],issues:[]},D);if(X instanceof Promise)w.push(X.then((W)=>{if(W.issues.length)U.issues.push(...x6(O,W.issues));U.value[O]=W.value}));else{if(X.issues.length)U.issues.push(...x6(O,X.issues));U.value[O]=X.value}}let N;for(let O in A)if(!b.has(O))N=N??[],N.push(O);if(N&&N.length>0)U.issues.push({code:"unrecognized_keys",input:A,inst:$,keys:N})}else{U.value={};for(let b of Reflect.ownKeys(A)){if(b==="__proto__")continue;let N=I.keyType._zod.run({value:b,issues:[]},D);if(N instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(N.issues.length){U.issues.push({origin:"record",code:"invalid_key",issues:N.issues.map((X)=>v6(X,D,b6())),input:b,path:[b],inst:$}),U.value[N.value]=N.value;continue}let O=I.valueType._zod.run({value:A[b],issues:[]},D);if(O instanceof Promise)w.push(O.then((X)=>{if(X.issues.length)U.issues.push(...x6(b,X.issues));U.value[N.value]=X.value}));else{if(O.issues.length)U.issues.push(...x6(b,O.issues));U.value[N.value]=O.value}}}if(w.length)return Promise.all(w).then(()=>U);return U}});var AO=K("$ZodEnum",($,I)=>{W$.init($,I);let U=r1(I.entries);$._zod.values=new Set(U),$._zod.pattern=new RegExp(`^(${U.filter((D)=>GN.has(typeof D)).map((D)=>typeof D==="string"?G4(D):D.toString()).join("|")})$`),$._zod.parse=(D,A)=>{let w=D.value;if($._zod.values.has(w))return D;return D.issues.push({code:"invalid_value",values:U,input:w,inst:$}),D}}),DO=K("$ZodLiteral",($,I)=>{W$.init($,I),$._zod.values=new Set(I.values),$._zod.pattern=new RegExp(`^(${I.values.map((U)=>typeof U==="string"?G4(U):U?U.toString():String(U)).join("|")})$`),$._zod.parse=(U,D)=>{let A=U.value;if($._zod.values.has(A))return U;return U.issues.push({code:"invalid_value",values:I.values,input:A,inst:$}),U}});var wO=K("$ZodTransform",($,I)=>{W$.init($,I),$._zod.parse=(U,D)=>{let A=I.transform(U.value,U);if(D.async)return(A instanceof Promise?A:Promise.resolve(A)).then((b)=>{return U.value=b,U});if(A instanceof Promise)throw new W4;return U.value=A,U}}),bO=K("$ZodOptional",($,I)=>{W$.init($,I),$._zod.optin="optional",$._zod.optout="optional",H$($._zod,"values",()=>{return I.innerType._zod.values?new Set([...I.innerType._zod.values,void 0]):void 0}),H$($._zod,"pattern",()=>{let U=I.innerType._zod.pattern;return U?new RegExp(`^(${o1(U.source)})?$`):void 0}),$._zod.parse=(U,D)=>{if(I.innerType._zod.optin==="optional")return I.innerType._zod.run(U,D);if(U.value===void 0)return U;return I.innerType._zod.run(U,D)}}),NO=K("$ZodNullable",($,I)=>{W$.init($,I),H$($._zod,"optin",()=>I.innerType._zod.optin),H$($._zod,"optout",()=>I.innerType._zod.optout),H$($._zod,"pattern",()=>{let U=I.innerType._zod.pattern;return U?new RegExp(`^(${o1(U.source)}|null)$`):void 0}),H$($._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)}}),OO=K("$ZodDefault",($,I)=>{W$.init($,I),$._zod.optin="optional",H$($._zod,"values",()=>I.innerType._zod.values),$._zod.parse=(U,D)=>{if(U.value===void 0)return U.value=I.defaultValue,U;let A=I.innerType._zod.run(U,D);if(A instanceof Promise)return A.then((w)=>lJ(w,I));return lJ(A,I)}});function lJ($,I){if($.value===void 0)$.value=I.defaultValue;return $}var XO=K("$ZodPrefault",($,I)=>{W$.init($,I),$._zod.optin="optional",H$($._zod,"values",()=>I.innerType._zod.values),$._zod.parse=(U,D)=>{if(U.value===void 0)U.value=I.defaultValue;return I.innerType._zod.run(U,D)}}),WO=K("$ZodNonOptional",($,I)=>{W$.init($,I),H$($._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 A=I.innerType._zod.run(U,D);if(A instanceof Promise)return A.then((w)=>cJ(w,$));return cJ(A,$)}});function cJ($,I){if(!$.issues.length&&$.value===void 0)$.issues.push({code:"invalid_type",expected:"nonoptional",input:$.value,inst:I});return $}var GO=K("$ZodCatch",($,I)=>{W$.init($,I),$._zod.optin="optional",H$($._zod,"optout",()=>I.innerType._zod.optout),H$($._zod,"values",()=>I.innerType._zod.values),$._zod.parse=(U,D)=>{let A=I.innerType._zod.run(U,D);if(A instanceof Promise)return A.then((w)=>{if(U.value=w.value,w.issues.length)U.value=I.catchValue({...U,error:{issues:w.issues.map((b)=>v6(b,D,b6()))},input:U.value}),U.issues=[];return U});if(U.value=A.value,A.issues.length)U.value=I.catchValue({...U,error:{issues:A.issues.map((w)=>v6(w,D,b6()))},input:U.value}),U.issues=[];return U}});var QO=K("$ZodPipe",($,I)=>{W$.init($,I),H$($._zod,"values",()=>I.in._zod.values),H$($._zod,"optin",()=>I.in._zod.optin),H$($._zod,"optout",()=>I.out._zod.optout),$._zod.parse=(U,D)=>{let A=I.in._zod.run(U,D);if(A instanceof Promise)return A.then((w)=>mJ(w,I,D));return mJ(A,I,D)}});function mJ($,I,U){if(m4($))return $;return I.out._zod.run({value:$.value,issues:$.issues},U)}var YO=K("$ZodReadonly",($,I)=>{W$.init($,I),H$($._zod,"propValues",()=>I.innerType._zod.propValues),H$($._zod,"values",()=>I.innerType._zod.values),H$($._zod,"optin",()=>I.innerType._zod.optin),H$($._zod,"optout",()=>I.innerType._zod.optout),$._zod.parse=(U,D)=>{let A=I.innerType._zod.run(U,D);if(A instanceof Promise)return A.then(rJ);return rJ(A)}});function rJ($){return $.value=Object.freeze($.value),$}var BO=K("$ZodCustom",($,I)=>{C$.init($,I),W$.init($,I),$._zod.parse=(U,D)=>{return U},$._zod.check=(U)=>{let D=U.value,A=I.fn(D);if(A instanceof Promise)return A.then((w)=>iJ(w,U,D,$));iJ(A,U,D,$);return}});function iJ($,I,U,D){if(!$){let A={code:"custom",input:U,inst:D,path:[...D._zod.def.path??[]],continue:!D._zod.def.abort};if(D._zod.def.params)A.params=D._zod.def.params;I.issues.push(BN(A))}}var sE=($)=>{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},$S=()=>{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",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 ${sE(D.input)}`;case"invalid_value":if(D.values.length===1)return`Invalid input: expected ${JA(D.values[0])}`;return`Invalid option: expected one of ${YA(D.values,"|")}`;case"too_big":{let A=D.inclusive?"<=":"<",w=I(D.origin);if(w)return`Too big: expected ${D.origin??"value"} to have ${A}${D.maximum.toString()} ${w.unit??"elements"}`;return`Too big: expected ${D.origin??"value"} to be ${A}${D.maximum.toString()}`}case"too_small":{let A=D.inclusive?">=":">",w=I(D.origin);if(w)return`Too small: expected ${D.origin} to have ${A}${D.minimum.toString()} ${w.unit}`;return`Too small: expected ${D.origin} to be ${A}${D.minimum.toString()}`}case"invalid_format":{let A=D;if(A.format==="starts_with")return`Invalid string: must start with "${A.prefix}"`;if(A.format==="ends_with")return`Invalid string: must end with "${A.suffix}"`;if(A.format==="includes")return`Invalid string: must include "${A.includes}"`;if(A.format==="regex")return`Invalid string: must match pattern ${A.pattern}`;return`Invalid ${U[A.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":""}: ${YA(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 JO(){return{localeError:$S()}}var IS=Symbol("ZodOutput"),US=Symbol("ZodInput");class vA{constructor(){this._map=new Map,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 Map,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)??{}};return delete U.id,{...U,...this._map.get($)}}return this._map.get($)}has($){return this._map.has($)}}function aJ(){return new vA}var Q4=aJ();function HO($,I){return new $({type:"string",...m(I)})}function LO($,I){return new $({type:"string",format:"email",check:"string_format",abort:!1,...m(I)})}function qA($,I){return new $({type:"string",format:"guid",check:"string_format",abort:!1,...m(I)})}function zO($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,...m(I)})}function MO($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...m(I)})}function KO($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...m(I)})}function VO($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...m(I)})}function vO($,I){return new $({type:"string",format:"url",check:"string_format",abort:!1,...m(I)})}function qO($,I){return new $({type:"string",format:"emoji",check:"string_format",abort:!1,...m(I)})}function FO($,I){return new $({type:"string",format:"nanoid",check:"string_format",abort:!1,...m(I)})}function EO($,I){return new $({type:"string",format:"cuid",check:"string_format",abort:!1,...m(I)})}function SO($,I){return new $({type:"string",format:"cuid2",check:"string_format",abort:!1,...m(I)})}function jO($,I){return new $({type:"string",format:"ulid",check:"string_format",abort:!1,...m(I)})}function kO($,I){return new $({type:"string",format:"xid",check:"string_format",abort:!1,...m(I)})}function PO($,I){return new $({type:"string",format:"ksuid",check:"string_format",abort:!1,...m(I)})}function RO($,I){return new $({type:"string",format:"ipv4",check:"string_format",abort:!1,...m(I)})}function TO($,I){return new $({type:"string",format:"ipv6",check:"string_format",abort:!1,...m(I)})}function _O($,I){return new $({type:"string",format:"cidrv4",check:"string_format",abort:!1,...m(I)})}function CO($,I){return new $({type:"string",format:"cidrv6",check:"string_format",abort:!1,...m(I)})}function ZO($,I){return new $({type:"string",format:"base64",check:"string_format",abort:!1,...m(I)})}function gO($,I){return new $({type:"string",format:"base64url",check:"string_format",abort:!1,...m(I)})}function xO($,I){return new $({type:"string",format:"e164",check:"string_format",abort:!1,...m(I)})}function hO($,I){return new $({type:"string",format:"jwt",check:"string_format",abort:!1,...m(I)})}function eJ($,I){return new $({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...m(I)})}function sJ($,I){return new $({type:"string",format:"date",check:"string_format",...m(I)})}function $H($,I){return new $({type:"string",format:"time",check:"string_format",precision:null,...m(I)})}function IH($,I){return new $({type:"string",format:"duration",check:"string_format",...m(I)})}function fO($,I){return new $({type:"number",checks:[],...m(I)})}function yO($,I){return new $({type:"number",check:"number_format",abort:!1,format:"safeint",...m(I)})}function uO($,I){return new $({type:"boolean",...m(I)})}function lO($,I){return new $({type:"null",...m(I)})}function cO($){return new $({type:"unknown"})}function mO($,I){return new $({type:"never",...m(I)})}function FA($,I){return new EN({check:"less_than",...m(I),value:$,inclusive:!1})}function e1($,I){return new EN({check:"less_than",...m(I),value:$,inclusive:!0})}function EA($,I){return new SN({check:"greater_than",...m(I),value:$,inclusive:!1})}function s1($,I){return new SN({check:"greater_than",...m(I),value:$,inclusive:!0})}function SA($,I){return new qJ({check:"multiple_of",...m(I),value:$})}function jA($,I){return new EJ({check:"max_length",...m(I),maximum:$})}function qI($,I){return new SJ({check:"min_length",...m(I),minimum:$})}function kA($,I){return new jJ({check:"length_equals",...m(I),length:$})}function rO($,I){return new kJ({check:"string_format",format:"regex",...m(I),pattern:$})}function iO($){return new PJ({check:"string_format",format:"lowercase",...m($)})}function nO($){return new RJ({check:"string_format",format:"uppercase",...m($)})}function oO($,I){return new TJ({check:"string_format",format:"includes",...m(I),includes:$})}function dO($,I){return new _J({check:"string_format",format:"starts_with",...m(I),prefix:$})}function pO($,I){return new CJ({check:"string_format",format:"ends_with",...m(I),suffix:$})}function n4($){return new ZJ({check:"overwrite",tx:$})}function tO($){return n4((I)=>I.normalize($))}function aO(){return n4(($)=>$.trim())}function eO(){return n4(($)=>$.toLowerCase())}function sO(){return n4(($)=>$.toUpperCase())}function UH($,I,U){return new $({type:"array",element:I,...m(U)})}function $X($,I,U){let D=m(U);return D.abort??(D.abort=!0),new $({type:"custom",check:"custom",fn:I,...D})}function IX($,I,U){return new $({type:"custom",check:"custom",fn:I,...m(U)})}class UX{constructor($){this.counter=0,this.metadataRegistry=$?.metadata??Q4,this.target=$?.target??"draft-2020-12",this.unrepresentable=$?.unrepresentable??"throw",this.override=$?.override??(()=>{}),this.io=$?.io??"output",this.seen=new Map}process($,I={path:[],schemaPath:[]}){var U;let D=$._zod.def,A={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},w=this.seen.get($);if(w){if(w.count++,I.schemaPath.includes($))w.cycle=I.path;return w.schema}let b={schema:{},count:1,cycle:void 0,path:I.path};this.seen.set($,b);let N=$._zod.toJSONSchema?.();if(N)b.schema=N;else{let W={...I,schemaPath:[...I.schemaPath,$],path:I.path},Q=$._zod.parent;if(Q)b.ref=Q,this.process(Q,W),this.seen.get(Q).isParent=!0;else{let B=b.schema;switch(D.type){case"string":{let Y=B;Y.type="string";let{minimum:J,maximum:H,format:v,patterns:V,contentEncoding:F}=$._zod.bag;if(typeof J==="number")Y.minLength=J;if(typeof H==="number")Y.maxLength=H;if(v){if(Y.format=A[v]??v,Y.format==="")delete Y.format}if(F)Y.contentEncoding=F;if(V&&V.size>0){let k=[...V];if(k.length===1)Y.pattern=k[0].source;else if(k.length>1)b.schema.allOf=[...k.map((h)=>({...this.target==="draft-7"?{type:"string"}:{},pattern:h.source}))]}break}case"number":{let Y=B,{minimum:J,maximum:H,format:v,multipleOf:V,exclusiveMaximum:F,exclusiveMinimum:k}=$._zod.bag;if(typeof v==="string"&&v.includes("int"))Y.type="integer";else Y.type="number";if(typeof k==="number")Y.exclusiveMinimum=k;if(typeof J==="number"){if(Y.minimum=J,typeof k==="number")if(k>=J)delete Y.minimum;else delete Y.exclusiveMinimum}if(typeof F==="number")Y.exclusiveMaximum=F;if(typeof H==="number"){if(Y.maximum=H,typeof F==="number")if(F<=H)delete Y.maximum;else delete Y.exclusiveMaximum}if(typeof V==="number")Y.multipleOf=V;break}case"boolean":{let Y=B;Y.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema");break}case"null":{B.type="null";break}case"any":break;case"unknown":break;case"undefined":{if(this.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema");break}case"void":{if(this.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema");break}case"never":{B.not={};break}case"date":{if(this.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema");break}case"array":{let Y=B,{minimum:J,maximum:H}=$._zod.bag;if(typeof J==="number")Y.minItems=J;if(typeof H==="number")Y.maxItems=H;Y.type="array",Y.items=this.process(D.element,{...W,path:[...W.path,"items"]});break}case"object":{let Y=B;Y.type="object",Y.properties={};let J=D.shape;for(let V in J)Y.properties[V]=this.process(J[V],{...W,path:[...W.path,"properties",V]});let H=new Set(Object.keys(J)),v=new Set([...H].filter((V)=>{let F=D.shape[V]._zod;if(this.io==="input")return F.optin===void 0;else return F.optout===void 0}));if(v.size>0)Y.required=Array.from(v);if(D.catchall?._zod.def.type==="never")Y.additionalProperties=!1;else if(!D.catchall){if(this.io==="output")Y.additionalProperties=!1}else if(D.catchall)Y.additionalProperties=this.process(D.catchall,{...W,path:[...W.path,"additionalProperties"]});break}case"union":{let Y=B;Y.anyOf=D.options.map((J,H)=>this.process(J,{...W,path:[...W.path,"anyOf",H]}));break}case"intersection":{let Y=B,J=this.process(D.left,{...W,path:[...W.path,"allOf",0]}),H=this.process(D.right,{...W,path:[...W.path,"allOf",1]}),v=(F)=>("allOf"in F)&&Object.keys(F).length===1,V=[...v(J)?J.allOf:[J],...v(H)?H.allOf:[H]];Y.allOf=V;break}case"tuple":{let Y=B;Y.type="array";let J=D.items.map((V,F)=>this.process(V,{...W,path:[...W.path,"prefixItems",F]}));if(this.target==="draft-2020-12")Y.prefixItems=J;else Y.items=J;if(D.rest){let V=this.process(D.rest,{...W,path:[...W.path,"items"]});if(this.target==="draft-2020-12")Y.items=V;else Y.additionalItems=V}if(D.rest)Y.items=this.process(D.rest,{...W,path:[...W.path,"items"]});let{minimum:H,maximum:v}=$._zod.bag;if(typeof H==="number")Y.minItems=H;if(typeof v==="number")Y.maxItems=v;break}case"record":{let Y=B;Y.type="object",Y.propertyNames=this.process(D.keyType,{...W,path:[...W.path,"propertyNames"]}),Y.additionalProperties=this.process(D.valueType,{...W,path:[...W.path,"additionalProperties"]});break}case"map":{if(this.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema");break}case"enum":{let Y=B,J=r1(D.entries);if(J.every((H)=>typeof H==="number"))Y.type="number";if(J.every((H)=>typeof H==="string"))Y.type="string";Y.enum=J;break}case"literal":{let Y=B,J=[];for(let H of D.values)if(H===void 0){if(this.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof H==="bigint")if(this.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");else J.push(Number(H));else J.push(H);if(J.length===0);else if(J.length===1){let H=J[0];Y.type=H===null?"null":typeof H,Y.const=H}else{if(J.every((H)=>typeof H==="number"))Y.type="number";if(J.every((H)=>typeof H==="string"))Y.type="string";if(J.every((H)=>typeof H==="boolean"))Y.type="string";if(J.every((H)=>H===null))Y.type="null";Y.enum=J}break}case"file":{let Y=B,J={type:"string",format:"binary",contentEncoding:"binary"},{minimum:H,maximum:v,mime:V}=$._zod.bag;if(H!==void 0)J.minLength=H;if(v!==void 0)J.maxLength=v;if(V)if(V.length===1)J.contentMediaType=V[0],Object.assign(Y,J);else Y.anyOf=V.map((F)=>{return{...J,contentMediaType:F}});else Object.assign(Y,J);break}case"transform":{if(this.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{let Y=this.process(D.innerType,W);B.anyOf=[Y,{type:"null"}];break}case"nonoptional":{this.process(D.innerType,W),b.ref=D.innerType;break}case"success":{let Y=B;Y.type="boolean";break}case"default":{this.process(D.innerType,W),b.ref=D.innerType,B.default=JSON.parse(JSON.stringify(D.defaultValue));break}case"prefault":{if(this.process(D.innerType,W),b.ref=D.innerType,this.io==="input")B._prefault=JSON.parse(JSON.stringify(D.defaultValue));break}case"catch":{this.process(D.innerType,W),b.ref=D.innerType;let Y;try{Y=D.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}B.default=Y;break}case"nan":{if(this.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{let Y=B,J=$._zod.pattern;if(!J)throw new Error("Pattern not found in template literal");Y.type="string",Y.pattern=J.source;break}case"pipe":{let Y=this.io==="input"?D.in._zod.def.type==="transform"?D.out:D.in:D.out;this.process(Y,W),b.ref=Y;break}case"readonly":{this.process(D.innerType,W),b.ref=D.innerType,B.readOnly=!0;break}case"promise":{this.process(D.innerType,W),b.ref=D.innerType;break}case"optional":{this.process(D.innerType,W),b.ref=D.innerType;break}case"lazy":{let Y=$._zod.innerType;this.process(Y,W),b.ref=Y;break}case"custom":{if(this.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema");break}default:}}}let O=this.metadataRegistry.get($);if(O)Object.assign(b.schema,O);if(this.io==="input"&&R$($))delete b.schema.examples,delete b.schema.default;if(this.io==="input"&&b.schema._prefault)(U=b.schema).default??(U.default=b.schema._prefault);return delete b.schema._prefault,this.seen.get($).schema}emit($,I){let U={cycles:I?.cycles??"ref",reused:I?.reused??"inline",external:I?.external??void 0},D=this.seen.get($);if(!D)throw new Error("Unprocessed schema. This is a bug in Zod.");let A=(X)=>{let W=this.target==="draft-2020-12"?"$defs":"definitions";if(U.external){let J=U.external.registry.get(X[0])?.id,H=U.external.uri??((V)=>V);if(J)return{ref:H(J)};let v=X[1].defId??X[1].schema.id??`schema${this.counter++}`;return X[1].defId=v,{defId:v,ref:`${H("__shared")}#/${W}/${v}`}}if(X[1]===D)return{ref:"#"};let B=`${"#"}/${W}/`,Y=X[1].schema.id??`__schema${this.counter++}`;return{defId:Y,ref:B+Y}},w=(X)=>{if(X[1].schema.$ref)return;let W=X[1],{ref:Q,defId:B}=A(X);if(W.def={...W.schema},B)W.defId=B;let Y=W.schema;for(let J in Y)delete Y[J];Y.$ref=Q};if(U.cycles==="throw")for(let X of this.seen.entries()){let W=X[1];if(W.cycle)throw new Error(`Cycle detected: #/${W.cycle?.join("/")}/<root>
35
-
36
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let X of this.seen.entries()){let W=X[1];if($===X[0]){w(X);continue}if(U.external){let B=U.external.registry.get(X[0])?.id;if($!==X[0]&&B){w(X);continue}}if(this.metadataRegistry.get(X[0])?.id){w(X);continue}if(W.cycle){w(X);continue}if(W.count>1){if(U.reused==="ref"){w(X);continue}}}let b=(X,W)=>{let Q=this.seen.get(X),B=Q.def??Q.schema,Y={...B};if(Q.ref===null)return;let J=Q.ref;if(Q.ref=null,J){b(J,W);let H=this.seen.get(J).schema;if(H.$ref&&W.target==="draft-7")B.allOf=B.allOf??[],B.allOf.push(H);else Object.assign(B,H),Object.assign(B,Y)}if(!Q.isParent)this.override({zodSchema:X,jsonSchema:B,path:Q.path??[]})};for(let X of[...this.seen.entries()].reverse())b(X[0],{target:this.target});let N={};if(this.target==="draft-2020-12")N.$schema="https://json-schema.org/draft/2020-12/schema";else if(this.target==="draft-7")N.$schema="http://json-schema.org/draft-07/schema#";else console.warn(`Invalid target: ${this.target}`);if(U.external?.uri){let X=U.external.registry.get($)?.id;if(!X)throw new Error("Schema is missing an `id` property");N.$id=U.external.uri(X)}Object.assign(N,D.def);let O=U.external?.defs??{};for(let X of this.seen.entries()){let W=X[1];if(W.def&&W.defId)O[W.defId]=W.def}if(U.external);else if(Object.keys(O).length>0)if(this.target==="draft-2020-12")N.$defs=O;else N.definitions=O;try{return JSON.parse(JSON.stringify(N))}catch(X){throw new Error("Error converting schema to JSON.")}}}function AX($,I){if($ instanceof vA){let D=new UX(I),A={};for(let N of $._idmap.entries()){let[O,X]=N;D.process(X)}let w={},b={registry:$,uri:I?.uri,defs:A};for(let N of $._idmap.entries()){let[O,X]=N;w[O]=D.emit(X,{...I,external:b})}if(Object.keys(A).length>0){let N=D.target==="draft-2020-12"?"$defs":"definitions";w.__shared={[N]:A}}return{schemas:w}}let U=new UX(I);return U.process($),U.emit($,I)}function R$($,I){let U=I??{seen:new Set};if(U.seen.has($))return!1;U.seen.add($);let A=$._zod.def;switch(A.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":return!1;case"array":return R$(A.element,U);case"object":{for(let w in A.shape)if(R$(A.shape[w],U))return!0;return!1}case"union":{for(let w of A.options)if(R$(w,U))return!0;return!1}case"intersection":return R$(A.left,U)||R$(A.right,U);case"tuple":{for(let w of A.items)if(R$(w,U))return!0;if(A.rest&&R$(A.rest,U))return!0;return!1}case"record":return R$(A.keyType,U)||R$(A.valueType,U);case"map":return R$(A.keyType,U)||R$(A.valueType,U);case"set":return R$(A.valueType,U);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return R$(A.innerType,U);case"lazy":return R$(A.getter(),U);case"default":return R$(A.innerType,U);case"prefault":return R$(A.innerType,U);case"custom":return!1;case"transform":return!0;case"pipe":return R$(A.in,U)||R$(A.out,U);case"success":return!1;case"catch":return!1;default:}throw new Error(`Unknown schema type: ${A.type}`)}var hS=K("ZodMiniType",($,I)=>{if(!$._zod)throw new Error("Uninitialized schema in ZodMiniType.");W$.init($,I),$.def=I,$.parse=(U,D)=>zN($,U,D,{callee:$.parse}),$.safeParse=(U,D)=>r4($,U,D),$.parseAsync=async(U,D)=>KN($,U,D,{callee:$.parseAsync}),$.safeParseAsync=async(U,D)=>i4($,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)=>N6($,U,D),$.brand=()=>$,$.register=(U,D)=>{return U.add($,D),$}});var fS=K("ZodMiniObject",($,I)=>{KA.init($,I),hS.init($,I),I$.defineLazy($,"shape",()=>I.shape)});function DX($,I){let U={type:"object",get shape(){return I$.assignProp(this,"shape",{...$}),this.shape},...I$.normalizeParams(I)};return new fS(U)}function Y6($){return!!$._zod}function d4($){let I=Object.values($);if(I.length===0)return DX({});let U=I.every(Y6),D=I.every((A)=>!Y6(A));if(U)return DX($);if(D)return l5($);throw new Error("Mixed Zod versions detected in object shape.")}function Y4($,I){if(Y6($))return r4($,I);return $.safeParse(I)}async function PA($,I){if(Y6($))return await i4($,I);return await $.safeParseAsync(I)}function B4($){if(!$)return;let I;if(Y6($))I=$._zod?.def?.shape;else I=$.shape;if(!I)return;if(typeof I==="function")try{return I()}catch{return}return I}function FI($){if(!$)return;if(typeof $==="object"){let I=$,U=$;if(!I._def&&!U._zod){let D=Object.values($);if(D.length>0&&D.every((A)=>typeof A==="object"&&A!==null&&(A._def!==void 0||A._zod!==void 0||typeof A.parse==="function")))return d4($)}}if(Y6($)){let U=$._zod?.def;if(U&&(U.type==="object"||U.shape!==void 0))return $}else if($.shape!==void 0)return $;return}function RA($){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 DH($){return $.description}function wH($){if(Y6($))return $._zod?.def?.type==="optional";let I=$;if(typeof $.isOptional==="function")return $.isOptional();return I._def?.typeName==="ZodOptional"}function TA($){if(Y6($)){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 $U={};K6($U,{time:()=>NX,duration:()=>OX,datetime:()=>wX,date:()=>bX,ZodISOTime:()=>OH,ZodISODuration:()=>XH,ZodISODateTime:()=>bH,ZodISODate:()=>NH});var bH=K("ZodISODateTime",($,I)=>{nJ.init($,I),K$.init($,I)});function wX($){return eJ(bH,$)}var NH=K("ZodISODate",($,I)=>{oJ.init($,I),K$.init($,I)});function bX($){return sJ(NH,$)}var OH=K("ZodISOTime",($,I)=>{dJ.init($,I),K$.init($,I)});function NX($){return $H(OH,$)}var XH=K("ZodISODuration",($,I)=>{pJ.init($,I),K$.init($,I)});function OX($){return IH(XH,$)}var WH=($,I)=>{HA.init($,I),$.name="ZodError",Object.defineProperties($,{format:{value:(U)=>HN($,U)},flatten:{value:(U)=>JN($,U)},addIssue:{value:(U)=>$.issues.push(U)},addIssues:{value:(U)=>$.issues.push(...U)},isEmpty:{get(){return $.issues.length===0}}})},Xm=K("ZodError",WH),IU=K("ZodError",WH,{Parent:Error});var GH=LN(IU),QH=MN(IU),YH=VN(IU),BH=vN(IU);var E$=K("ZodType",($,I)=>{return W$.init($,I),$.def=I,Object.defineProperty($,"_def",{value:I}),$.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)=>N6($,U,D),$.brand=()=>$,$.register=(U,D)=>{return U.add($,D),$},$.parse=(U,D)=>GH($,U,D,{callee:$.parse}),$.safeParse=(U,D)=>YH($,U,D),$.parseAsync=async(U,D)=>QH($,U,D,{callee:$.parseAsync}),$.safeParseAsync=async(U,D)=>BH($,U,D),$.spa=$.safeParseAsync,$.refine=(U,D)=>$.check(gj(U,D)),$.superRefine=(U)=>$.check(xj(U)),$.overwrite=(U)=>$.check(n4(U)),$.optional=()=>F$($),$.nullable=()=>LH($),$.nullish=()=>F$(LH($)),$.nonoptional=(U)=>kj($,U),$.array=()=>A$($),$.or=(U)=>z$([$,U]),$.and=(U)=>CA($,U),$.transform=(U)=>WX($,vH(U)),$.default=(U)=>Ej($,U),$.prefault=(U)=>jj($,U),$.catch=(U)=>Rj($,U),$.pipe=(U)=>WX($,U),$.readonly=()=>Cj($),$.describe=(U)=>{let D=$.clone();return Q4.add(D,{description:U}),D},Object.defineProperty($,"description",{get(){return Q4.get($)?.description},configurable:!0}),$.meta=(...U)=>{if(U.length===0)return Q4.get($);let D=$.clone();return Q4.add(D,U[0]),D},$.isOptional=()=>$.safeParse(void 0).success,$.isNullable=()=>$.safeParse(null).success,$}),zH=K("_ZodString",($,I)=>{a1.init($,I),E$.init($,I);let U=$._zod.bag;$.format=U.format??null,$.minLength=U.minimum??null,$.maxLength=U.maximum??null,$.regex=(...D)=>$.check(rO(...D)),$.includes=(...D)=>$.check(oO(...D)),$.startsWith=(...D)=>$.check(dO(...D)),$.endsWith=(...D)=>$.check(pO(...D)),$.min=(...D)=>$.check(qI(...D)),$.max=(...D)=>$.check(jA(...D)),$.length=(...D)=>$.check(kA(...D)),$.nonempty=(...D)=>$.check(qI(1,...D)),$.lowercase=(D)=>$.check(iO(D)),$.uppercase=(D)=>$.check(nO(D)),$.trim=()=>$.check(aO()),$.normalize=(...D)=>$.check(tO(...D)),$.toLowerCase=()=>$.check(eO()),$.toUpperCase=()=>$.check(sO())}),oS=K("ZodString",($,I)=>{a1.init($,I),zH.init($,I),$.email=(U)=>$.check(LO(dS,U)),$.url=(U)=>$.check(vO(pS,U)),$.jwt=(U)=>$.check(hO(Wj,U)),$.emoji=(U)=>$.check(qO(tS,U)),$.guid=(U)=>$.check(qA(JH,U)),$.uuid=(U)=>$.check(zO(_A,U)),$.uuidv4=(U)=>$.check(MO(_A,U)),$.uuidv6=(U)=>$.check(KO(_A,U)),$.uuidv7=(U)=>$.check(VO(_A,U)),$.nanoid=(U)=>$.check(FO(aS,U)),$.guid=(U)=>$.check(qA(JH,U)),$.cuid=(U)=>$.check(EO(eS,U)),$.cuid2=(U)=>$.check(SO(sS,U)),$.ulid=(U)=>$.check(jO($j,U)),$.base64=(U)=>$.check(ZO(Nj,U)),$.base64url=(U)=>$.check(gO(Oj,U)),$.xid=(U)=>$.check(kO(Ij,U)),$.ksuid=(U)=>$.check(PO(Uj,U)),$.ipv4=(U)=>$.check(RO(Aj,U)),$.ipv6=(U)=>$.check(TO(Dj,U)),$.cidrv4=(U)=>$.check(_O(wj,U)),$.cidrv6=(U)=>$.check(CO(bj,U)),$.e164=(U)=>$.check(xO(Xj,U)),$.datetime=(U)=>$.check(wX(U)),$.date=(U)=>$.check(bX(U)),$.time=(U)=>$.check(NX(U)),$.duration=(U)=>$.check(OX(U))});function M($){return HO(oS,$)}var K$=K("ZodStringFormat",($,I)=>{L$.init($,I),zH.init($,I)}),dS=K("ZodEmail",($,I)=>{TN.init($,I),K$.init($,I)});var JH=K("ZodGUID",($,I)=>{PN.init($,I),K$.init($,I)});var _A=K("ZodUUID",($,I)=>{RN.init($,I),K$.init($,I)});var pS=K("ZodURL",($,I)=>{_N.init($,I),K$.init($,I)});var tS=K("ZodEmoji",($,I)=>{CN.init($,I),K$.init($,I)});var aS=K("ZodNanoID",($,I)=>{ZN.init($,I),K$.init($,I)});var eS=K("ZodCUID",($,I)=>{gN.init($,I),K$.init($,I)});var sS=K("ZodCUID2",($,I)=>{xN.init($,I),K$.init($,I)});var $j=K("ZodULID",($,I)=>{hN.init($,I),K$.init($,I)});var Ij=K("ZodXID",($,I)=>{fN.init($,I),K$.init($,I)});var Uj=K("ZodKSUID",($,I)=>{yN.init($,I),K$.init($,I)});var Aj=K("ZodIPv4",($,I)=>{uN.init($,I),K$.init($,I)});var Dj=K("ZodIPv6",($,I)=>{lN.init($,I),K$.init($,I)});var wj=K("ZodCIDRv4",($,I)=>{cN.init($,I),K$.init($,I)});var bj=K("ZodCIDRv6",($,I)=>{mN.init($,I),K$.init($,I)});var Nj=K("ZodBase64",($,I)=>{rN.init($,I),K$.init($,I)});var Oj=K("ZodBase64URL",($,I)=>{iN.init($,I),K$.init($,I)});var Xj=K("ZodE164",($,I)=>{nN.init($,I),K$.init($,I)});var Wj=K("ZodJWT",($,I)=>{oN.init($,I),K$.init($,I)});var MH=K("ZodNumber",($,I)=>{MA.init($,I),E$.init($,I),$.gt=(D,A)=>$.check(EA(D,A)),$.gte=(D,A)=>$.check(s1(D,A)),$.min=(D,A)=>$.check(s1(D,A)),$.lt=(D,A)=>$.check(FA(D,A)),$.lte=(D,A)=>$.check(e1(D,A)),$.max=(D,A)=>$.check(e1(D,A)),$.int=(D)=>$.check(HH(D)),$.safe=(D)=>$.check(HH(D)),$.positive=(D)=>$.check(EA(0,D)),$.nonnegative=(D)=>$.check(s1(0,D)),$.negative=(D)=>$.check(FA(0,D)),$.nonpositive=(D)=>$.check(e1(0,D)),$.multipleOf=(D,A)=>$.check(SA(D,A)),$.step=(D,A)=>$.check(SA(D,A)),$.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 O$($){return fO(MH,$)}var Gj=K("ZodNumberFormat",($,I)=>{dN.init($,I),MH.init($,I)});function HH($){return yO(Gj,$)}var Qj=K("ZodBoolean",($,I)=>{pN.init($,I),E$.init($,I)});function T$($){return uO(Qj,$)}var Yj=K("ZodNull",($,I)=>{tN.init($,I),E$.init($,I)});function GX($){return lO(Yj,$)}var Bj=K("ZodUnknown",($,I)=>{aN.init($,I),E$.init($,I)});function V$(){return cO(Bj)}var Jj=K("ZodNever",($,I)=>{eN.init($,I),E$.init($,I)});function Hj($){return mO(Jj,$)}var Lj=K("ZodArray",($,I)=>{sN.init($,I),E$.init($,I),$.element=I.element,$.min=(U,D)=>$.check(qI(U,D)),$.nonempty=(U)=>$.check(qI(1,U)),$.max=(U,D)=>$.check(jA(U,D)),$.length=(U,D)=>$.check(kA(U,D)),$.unwrap=()=>$.element});function A$($,I){return UH(Lj,$,I)}var KH=K("ZodObject",($,I)=>{KA.init($,I),E$.init($,I),I$.defineLazy($,"shape",()=>I.shape),$.keyof=()=>a$(Object.keys($._zod.def.shape)),$.catchall=(U)=>$.clone({...$._zod.def,catchall:U}),$.passthrough=()=>$.clone({...$._zod.def,catchall:V$()}),$.loose=()=>$.clone({...$._zod.def,catchall:V$()}),$.strict=()=>$.clone({...$._zod.def,catchall:Hj()}),$.strip=()=>$.clone({...$._zod.def,catchall:void 0}),$.extend=(U)=>{return I$.extend($,U)},$.merge=(U)=>I$.merge($,U),$.pick=(U)=>I$.pick($,U),$.omit=(U)=>I$.omit($,U),$.partial=(...U)=>I$.partial(qH,$,U[0]),$.required=(...U)=>I$.required(FH,$,U[0])});function Z($,I){let U={type:"object",get shape(){return I$.assignProp(this,"shape",{...$}),this.shape},...I$.normalizeParams(I)};return new KH(U)}function m$($,I){return new KH({type:"object",get shape(){return I$.assignProp(this,"shape",{...$}),this.shape},catchall:V$(),...I$.normalizeParams(I)})}var VH=K("ZodUnion",($,I)=>{VA.init($,I),E$.init($,I),$.options=I.options});function z$($,I){return new VH({type:"union",options:$,...I$.normalizeParams(I)})}var zj=K("ZodDiscriminatedUnion",($,I)=>{VH.init($,I),$O.init($,I)});function QX($,I,U){return new zj({type:"union",options:I,discriminator:$,...I$.normalizeParams(U)})}var Mj=K("ZodIntersection",($,I)=>{IO.init($,I),E$.init($,I)});function CA($,I){return new Mj({type:"intersection",left:$,right:I})}var Kj=K("ZodRecord",($,I)=>{UO.init($,I),E$.init($,I),$.keyType=I.keyType,$.valueType=I.valueType});function v$($,I,U){return new Kj({type:"record",keyType:$,valueType:I,...I$.normalizeParams(U)})}var XX=K("ZodEnum",($,I)=>{AO.init($,I),E$.init($,I),$.enum=I.entries,$.options=Object.values(I.entries);let U=new Set(Object.keys(I.entries));$.extract=(D,A)=>{let w={};for(let b of D)if(U.has(b))w[b]=I.entries[b];else throw new Error(`Key ${b} not found in enum`);return new XX({...I,checks:[],...I$.normalizeParams(A),entries:w})},$.exclude=(D,A)=>{let w={...I.entries};for(let b of D)if(U.has(b))delete w[b];else throw new Error(`Key ${b} not found in enum`);return new XX({...I,checks:[],...I$.normalizeParams(A),entries:w})}});function a$($,I){let U=Array.isArray($)?Object.fromEntries($.map((D)=>[D,D])):$;return new XX({type:"enum",entries:U,...I$.normalizeParams(I)})}var Vj=K("ZodLiteral",($,I)=>{DO.init($,I),E$.init($,I),$.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 y($,I){return new Vj({type:"literal",values:Array.isArray($)?$:[$],...I$.normalizeParams(I)})}var vj=K("ZodTransform",($,I)=>{wO.init($,I),E$.init($,I),$._zod.parse=(U,D)=>{U.addIssue=(w)=>{if(typeof w==="string")U.issues.push(I$.issue(w,U.value,I));else{let b=w;if(b.fatal)b.continue=!1;b.code??(b.code="custom"),b.input??(b.input=U.value),b.inst??(b.inst=$),b.continue??(b.continue=!0),U.issues.push(I$.issue(b))}};let A=I.transform(U.value,U);if(A instanceof Promise)return A.then((w)=>{return U.value=w,U});return U.value=A,U}});function vH($){return new vj({type:"transform",transform:$})}var qH=K("ZodOptional",($,I)=>{bO.init($,I),E$.init($,I),$.unwrap=()=>$._zod.def.innerType});function F$($){return new qH({type:"optional",innerType:$})}var qj=K("ZodNullable",($,I)=>{NO.init($,I),E$.init($,I),$.unwrap=()=>$._zod.def.innerType});function LH($){return new qj({type:"nullable",innerType:$})}var Fj=K("ZodDefault",($,I)=>{OO.init($,I),E$.init($,I),$.unwrap=()=>$._zod.def.innerType,$.removeDefault=$.unwrap});function Ej($,I){return new Fj({type:"default",innerType:$,get defaultValue(){return typeof I==="function"?I():I}})}var Sj=K("ZodPrefault",($,I)=>{XO.init($,I),E$.init($,I),$.unwrap=()=>$._zod.def.innerType});function jj($,I){return new Sj({type:"prefault",innerType:$,get defaultValue(){return typeof I==="function"?I():I}})}var FH=K("ZodNonOptional",($,I)=>{WO.init($,I),E$.init($,I),$.unwrap=()=>$._zod.def.innerType});function kj($,I){return new FH({type:"nonoptional",innerType:$,...I$.normalizeParams(I)})}var Pj=K("ZodCatch",($,I)=>{GO.init($,I),E$.init($,I),$.unwrap=()=>$._zod.def.innerType,$.removeCatch=$.unwrap});function Rj($,I){return new Pj({type:"catch",innerType:$,catchValue:typeof I==="function"?I:()=>I})}var Tj=K("ZodPipe",($,I)=>{QO.init($,I),E$.init($,I),$.in=I.in,$.out=I.out});function WX($,I){return new Tj({type:"pipe",in:$,out:I})}var _j=K("ZodReadonly",($,I)=>{YO.init($,I),E$.init($,I)});function Cj($){return new _j({type:"readonly",innerType:$})}var EH=K("ZodCustom",($,I)=>{BO.init($,I),E$.init($,I)});function Zj($){let I=new C$({check:"custom"});return I._zod.check=$,I}function SH($,I){return $X(EH,$??(()=>!0),I)}function gj($,I={}){return IX(EH,$,I)}function xj($){let I=Zj((U)=>{return U.addIssue=(D)=>{if(typeof D==="string")U.issues.push(I$.issue(D,U.value,I._zod.def));else{let A=D;if(A.fatal)A.continue=!1;A.code??(A.code="custom"),A.input??(A.input=U.value),A.inst??(A.inst=I),A.continue??(A.continue=!I._zod.def.abort),U.issues.push(I$.issue(A))}},$(U.value,U)});return I}function YX($,I){return WX(vH($),I)}b6(JO());var BX="2025-11-25";var jH=[BX,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],J4="io.modelcontextprotocol/related-task",gA="2.0",Z$=SH(($)=>$!==null&&(typeof $==="object"||typeof $==="function")),kH=z$([M(),O$().int()]),PH=M(),qm=m$({ttl:z$([O$(),GX()]).optional(),pollInterval:O$().optional()}),hj=Z({ttl:O$().optional()}),fj=Z({taskId:M()}),JX=m$({progressToken:kH.optional(),[J4]:fj.optional()}),O6=Z({_meta:JX.optional()}),UU=O6.extend({task:hj.optional()}),RH=($)=>UU.safeParse($).success,g$=Z({method:M(),params:O6.loose().optional()}),B6=Z({_meta:JX.optional()}),J6=Z({method:M(),params:B6.loose().optional()}),x$=m$({_meta:JX.optional()}),xA=z$([M(),O$().int()]),TH=Z({jsonrpc:y(gA),id:xA,...g$.shape}).strict(),HX=($)=>TH.safeParse($).success,_H=Z({jsonrpc:y(gA),...J6.shape}).strict(),CH=($)=>_H.safeParse($).success,LX=Z({jsonrpc:y(gA),id:xA,result:x$}).strict(),AU=($)=>LX.safeParse($).success;var c;(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"})(c||(c={}));var zX=Z({jsonrpc:y(gA),id:xA.optional(),error:Z({code:O$().int(),message:M(),data:V$().optional()})}).strict();var ZH=($)=>zX.safeParse($).success;var gH=z$([TH,_H,LX,zX]),Fm=z$([LX,zX]),hA=x$.strict(),yj=B6.extend({requestId:xA.optional(),reason:M().optional()}),fA=J6.extend({method:y("notifications/cancelled"),params:yj}),uj=Z({src:M(),mimeType:M().optional(),sizes:A$(M()).optional(),theme:a$(["light","dark"]).optional()}),DU=Z({icons:A$(uj).optional()}),EI=Z({name:M(),title:M().optional()}),xH=EI.extend({...EI.shape,...DU.shape,version:M(),websiteUrl:M().optional(),description:M().optional()}),lj=CA(Z({applyDefaults:T$().optional()}),v$(M(),V$())),cj=YX(($)=>{if($&&typeof $==="object"&&!Array.isArray($)){if(Object.keys($).length===0)return{form:{}}}return $},CA(Z({form:lj.optional(),url:Z$.optional()}),v$(M(),V$()).optional())),mj=m$({list:Z$.optional(),cancel:Z$.optional(),requests:m$({sampling:m$({createMessage:Z$.optional()}).optional(),elicitation:m$({create:Z$.optional()}).optional()}).optional()}),rj=m$({list:Z$.optional(),cancel:Z$.optional(),requests:m$({tools:m$({call:Z$.optional()}).optional()}).optional()}),ij=Z({experimental:v$(M(),Z$).optional(),sampling:Z({context:Z$.optional(),tools:Z$.optional()}).optional(),elicitation:cj.optional(),roots:Z({listChanged:T$().optional()}).optional(),tasks:mj.optional()}),nj=O6.extend({protocolVersion:M(),capabilities:ij,clientInfo:xH}),MX=g$.extend({method:y("initialize"),params:nj});var oj=Z({experimental:v$(M(),Z$).optional(),logging:Z$.optional(),completions:Z$.optional(),prompts:Z({listChanged:T$().optional()}).optional(),resources:Z({subscribe:T$().optional(),listChanged:T$().optional()}).optional(),tools:Z({listChanged:T$().optional()}).optional(),tasks:rj.optional()}),dj=x$.extend({protocolVersion:M(),capabilities:oj,serverInfo:xH,instructions:M().optional()}),KX=J6.extend({method:y("notifications/initialized"),params:B6.optional()});var yA=g$.extend({method:y("ping"),params:O6.optional()}),pj=Z({progress:O$(),total:F$(O$()),message:F$(M())}),tj=Z({...B6.shape,...pj.shape,progressToken:kH}),uA=J6.extend({method:y("notifications/progress"),params:tj}),aj=O6.extend({cursor:PH.optional()}),wU=g$.extend({params:aj.optional()}),bU=x$.extend({nextCursor:PH.optional()}),ej=a$(["working","input_required","completed","failed","cancelled"]),NU=Z({taskId:M(),status:ej,ttl:z$([O$(),GX()]),createdAt:M(),lastUpdatedAt:M(),pollInterval:F$(O$()),statusMessage:F$(M())}),SI=x$.extend({task:NU}),sj=B6.merge(NU),OU=J6.extend({method:y("notifications/tasks/status"),params:sj}),lA=g$.extend({method:y("tasks/get"),params:O6.extend({taskId:M()})}),cA=x$.merge(NU),mA=g$.extend({method:y("tasks/result"),params:O6.extend({taskId:M()})}),Em=x$.loose(),rA=wU.extend({method:y("tasks/list")}),iA=bU.extend({tasks:A$(NU)}),nA=g$.extend({method:y("tasks/cancel"),params:O6.extend({taskId:M()})}),hH=x$.merge(NU),fH=Z({uri:M(),mimeType:F$(M()),_meta:v$(M(),V$()).optional()}),yH=fH.extend({text:M()}),VX=M().refine(($)=>{try{return atob($),!0}catch{return!1}},{message:"Invalid Base64 string"}),uH=fH.extend({blob:VX}),XU=a$(["user","assistant"]),jI=Z({audience:A$(XU).optional(),priority:O$().min(0).max(1).optional(),lastModified:$U.datetime({offset:!0}).optional()}),lH=Z({...EI.shape,...DU.shape,uri:M(),description:F$(M()),mimeType:F$(M()),annotations:jI.optional(),_meta:F$(m$({}))}),$k=Z({...EI.shape,...DU.shape,uriTemplate:M(),description:F$(M()),mimeType:F$(M()),annotations:jI.optional(),_meta:F$(m$({}))}),oA=wU.extend({method:y("resources/list")}),Ik=bU.extend({resources:A$(lH)}),dA=wU.extend({method:y("resources/templates/list")}),Uk=bU.extend({resourceTemplates:A$($k)}),vX=O6.extend({uri:M()}),Ak=vX,pA=g$.extend({method:y("resources/read"),params:Ak}),Dk=x$.extend({contents:A$(z$([yH,uH]))}),wk=J6.extend({method:y("notifications/resources/list_changed"),params:B6.optional()}),bk=vX,Nk=g$.extend({method:y("resources/subscribe"),params:bk}),Ok=vX,Xk=g$.extend({method:y("resources/unsubscribe"),params:Ok}),Wk=B6.extend({uri:M()}),Gk=J6.extend({method:y("notifications/resources/updated"),params:Wk}),Qk=Z({name:M(),description:F$(M()),required:F$(T$())}),Yk=Z({...EI.shape,...DU.shape,description:F$(M()),arguments:F$(A$(Qk)),_meta:F$(m$({}))}),tA=wU.extend({method:y("prompts/list")}),Bk=bU.extend({prompts:A$(Yk)}),Jk=O6.extend({name:M(),arguments:v$(M(),M()).optional()}),aA=g$.extend({method:y("prompts/get"),params:Jk}),qX=Z({type:y("text"),text:M(),annotations:jI.optional(),_meta:v$(M(),V$()).optional()}),FX=Z({type:y("image"),data:VX,mimeType:M(),annotations:jI.optional(),_meta:v$(M(),V$()).optional()}),EX=Z({type:y("audio"),data:VX,mimeType:M(),annotations:jI.optional(),_meta:v$(M(),V$()).optional()}),Hk=Z({type:y("tool_use"),name:M(),id:M(),input:v$(M(),V$()),_meta:v$(M(),V$()).optional()}),Lk=Z({type:y("resource"),resource:z$([yH,uH]),annotations:jI.optional(),_meta:v$(M(),V$()).optional()}),zk=lH.extend({type:y("resource_link")}),SX=z$([qX,FX,EX,zk,Lk]),Mk=Z({role:XU,content:SX}),Kk=x$.extend({description:M().optional(),messages:A$(Mk)}),Vk=J6.extend({method:y("notifications/prompts/list_changed"),params:B6.optional()}),vk=Z({title:M().optional(),readOnlyHint:T$().optional(),destructiveHint:T$().optional(),idempotentHint:T$().optional(),openWorldHint:T$().optional()}),qk=Z({taskSupport:a$(["required","optional","forbidden"]).optional()}),cH=Z({...EI.shape,...DU.shape,description:M().optional(),inputSchema:Z({type:y("object"),properties:v$(M(),Z$).optional(),required:A$(M()).optional()}).catchall(V$()),outputSchema:Z({type:y("object"),properties:v$(M(),Z$).optional(),required:A$(M()).optional()}).catchall(V$()).optional(),annotations:vk.optional(),execution:qk.optional(),_meta:v$(M(),V$()).optional()}),eA=wU.extend({method:y("tools/list")}),Fk=bU.extend({tools:A$(cH)}),sA=x$.extend({content:A$(SX).default([]),structuredContent:v$(M(),V$()).optional(),isError:T$().optional()}),Sm=sA.or(x$.extend({toolResult:V$()})),Ek=UU.extend({name:M(),arguments:v$(M(),V$()).optional()}),kI=g$.extend({method:y("tools/call"),params:Ek}),Sk=J6.extend({method:y("notifications/tools/list_changed"),params:B6.optional()}),jm=Z({autoRefresh:T$().default(!0),debounceMs:O$().int().nonnegative().default(300)}),WU=a$(["debug","info","notice","warning","error","critical","alert","emergency"]),jk=O6.extend({level:WU}),jX=g$.extend({method:y("logging/setLevel"),params:jk}),kk=B6.extend({level:WU,logger:M().optional(),data:V$()}),Pk=J6.extend({method:y("notifications/message"),params:kk}),Rk=Z({name:M().optional()}),Tk=Z({hints:A$(Rk).optional(),costPriority:O$().min(0).max(1).optional(),speedPriority:O$().min(0).max(1).optional(),intelligencePriority:O$().min(0).max(1).optional()}),_k=Z({mode:a$(["auto","required","none"]).optional()}),Ck=Z({type:y("tool_result"),toolUseId:M().describe("The unique identifier for the corresponding tool call."),content:A$(SX).default([]),structuredContent:Z({}).loose().optional(),isError:T$().optional(),_meta:v$(M(),V$()).optional()}),Zk=QX("type",[qX,FX,EX]),ZA=QX("type",[qX,FX,EX,Hk,Ck]),gk=Z({role:XU,content:z$([ZA,A$(ZA)]),_meta:v$(M(),V$()).optional()}),xk=UU.extend({messages:A$(gk),modelPreferences:Tk.optional(),systemPrompt:M().optional(),includeContext:a$(["none","thisServer","allServers"]).optional(),temperature:O$().optional(),maxTokens:O$().int(),stopSequences:A$(M()).optional(),metadata:Z$.optional(),tools:A$(cH).optional(),toolChoice:_k.optional()}),hk=g$.extend({method:y("sampling/createMessage"),params:xk}),kX=x$.extend({model:M(),stopReason:F$(a$(["endTurn","stopSequence","maxTokens"]).or(M())),role:XU,content:Zk}),PX=x$.extend({model:M(),stopReason:F$(a$(["endTurn","stopSequence","maxTokens","toolUse"]).or(M())),role:XU,content:z$([ZA,A$(ZA)])}),fk=Z({type:y("boolean"),title:M().optional(),description:M().optional(),default:T$().optional()}),yk=Z({type:y("string"),title:M().optional(),description:M().optional(),minLength:O$().optional(),maxLength:O$().optional(),format:a$(["email","uri","date","date-time"]).optional(),default:M().optional()}),uk=Z({type:a$(["number","integer"]),title:M().optional(),description:M().optional(),minimum:O$().optional(),maximum:O$().optional(),default:O$().optional()}),lk=Z({type:y("string"),title:M().optional(),description:M().optional(),enum:A$(M()),default:M().optional()}),ck=Z({type:y("string"),title:M().optional(),description:M().optional(),oneOf:A$(Z({const:M(),title:M()})),default:M().optional()}),mk=Z({type:y("string"),title:M().optional(),description:M().optional(),enum:A$(M()),enumNames:A$(M()).optional(),default:M().optional()}),rk=z$([lk,ck]),ik=Z({type:y("array"),title:M().optional(),description:M().optional(),minItems:O$().optional(),maxItems:O$().optional(),items:Z({type:y("string"),enum:A$(M())}),default:A$(M()).optional()}),nk=Z({type:y("array"),title:M().optional(),description:M().optional(),minItems:O$().optional(),maxItems:O$().optional(),items:Z({anyOf:A$(Z({const:M(),title:M()}))}),default:A$(M()).optional()}),ok=z$([ik,nk]),dk=z$([mk,rk,ok]),pk=z$([dk,fk,yk,uk]),tk=UU.extend({mode:y("form").optional(),message:M(),requestedSchema:Z({type:y("object"),properties:v$(M(),pk),required:A$(M()).optional()})}),ak=UU.extend({mode:y("url"),message:M(),elicitationId:M(),url:M().url()}),ek=z$([tk,ak]),sk=g$.extend({method:y("elicitation/create"),params:ek}),$P=B6.extend({elicitationId:M()}),IP=J6.extend({method:y("notifications/elicitation/complete"),params:$P}),$D=x$.extend({action:a$(["accept","decline","cancel"]),content:YX(($)=>$===null?void 0:$,v$(M(),z$([M(),O$(),T$(),A$(M())])).optional())}),UP=Z({type:y("ref/resource"),uri:M()});var AP=Z({type:y("ref/prompt"),name:M()}),DP=O6.extend({ref:z$([AP,UP]),argument:Z({name:M(),value:M()}),context:Z({arguments:v$(M(),M()).optional()}).optional()}),ID=g$.extend({method:y("completion/complete"),params:DP});function mH($){if($.params.ref.type!=="ref/prompt")throw new TypeError(`Expected CompleteRequestPrompt, but got ${$.params.ref.type}`)}function rH($){if($.params.ref.type!=="ref/resource")throw new TypeError(`Expected CompleteRequestResourceTemplate, but got ${$.params.ref.type}`)}var wP=x$.extend({completion:m$({values:A$(M()).max(100),total:F$(O$().int()),hasMore:F$(T$())})}),bP=Z({uri:M().startsWith("file://"),name:M().optional(),_meta:v$(M(),V$()).optional()}),NP=g$.extend({method:y("roots/list"),params:O6.optional()}),RX=x$.extend({roots:A$(bP)}),OP=J6.extend({method:y("notifications/roots/list_changed"),params:B6.optional()}),km=z$([yA,MX,ID,jX,aA,tA,oA,dA,pA,Nk,Xk,kI,eA,lA,mA,rA,nA]),Pm=z$([fA,uA,KX,OP,OU]),Rm=z$([hA,kX,PX,$D,RX,cA,iA,SI]),Tm=z$([yA,hk,sk,NP,lA,mA,rA,nA]),_m=z$([fA,uA,Pk,Gk,wk,Sk,Vk,OU,IP]),Cm=z$([hA,dj,wP,Kk,Bk,Ik,Uk,Dk,sA,Fk,cA,iA,SI]);class f extends Error{constructor($,I,U){super(`MCP error ${$}: ${I}`);this.code=$,this.data=U,this.name="McpError"}static fromError($,I,U){if($===c.UrlElicitationRequired&&U){let D=U;if(D.elicitations)return new iH(D.elicitations,I)}return new f($,I,U)}}class iH extends f{constructor($,I=`URL elicitation${$.length>1?"s":""} required`){super(c.UrlElicitationRequired,I,{elicitations:$})}get elicitations(){return this.data?.elicitations??[]}}function H4($){return $==="completed"||$==="failed"||$==="cancelled"}var oH=Symbol("Let zodToJsonSchema decide on which parser to use");var nH={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"},dH=($)=>typeof $==="string"?{...nH,name:$}:{...nH,...$};var pH=($)=>{let I=dH($),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,A])=>[A._def,{def:A._def,path:[...I.basePath,I.definitionPath,D],jsonSchema:void 0}]))}};function TX($,I,U,D){if(!D?.errorMessages)return;if(U)$.errorMessage={...$.errorMessage,[I]:U}}function D$($,I,U,D,A){$[I]=U,TX($,I,D,A)}var UD=($,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 q$($){if($.target!=="openAi")return{};let I=[...$.basePath,$.definitionPath,$.openAiAnyTypeName];return $.flags.hasReferencedOpenAiAnyType=!0,{$ref:$.$refStrategy==="relative"?UD(I,$.currentPath):I.join("/")}}function tH($,I){let U={type:"array"};if($.type?._def&&$.type?._def?.typeName!==E.ZodAny)U.items=i($.type._def,{...I,currentPath:[...I.currentPath,"items"]});if($.minLength)D$(U,"minItems",$.minLength.value,$.minLength.message,I);if($.maxLength)D$(U,"maxItems",$.maxLength.value,$.maxLength.message,I);if($.exactLength)D$(U,"minItems",$.exactLength.value,$.exactLength.message,I),D$(U,"maxItems",$.exactLength.value,$.exactLength.message,I);return U}function aH($,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)D$(U,"minimum",D.value,D.message,I);else D$(U,"exclusiveMinimum",D.value,D.message,I);else{if(!D.inclusive)U.exclusiveMinimum=!0;D$(U,"minimum",D.value,D.message,I)}break;case"max":if(I.target==="jsonSchema7")if(D.inclusive)D$(U,"maximum",D.value,D.message,I);else D$(U,"exclusiveMaximum",D.value,D.message,I);else{if(!D.inclusive)U.exclusiveMaximum=!0;D$(U,"maximum",D.value,D.message,I)}break;case"multipleOf":D$(U,"multipleOf",D.value,D.message,I);break}return U}function eH(){return{type:"boolean"}}function AD($,I){return i($.type._def,I)}var sH=($,I)=>{return i($.innerType._def,I)};function _X($,I,U){let D=U??I.dateStrategy;if(Array.isArray(D))return{anyOf:D.map((A,w)=>_X($,I,A))};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 XP($,I)}}var XP=($,I)=>{let U={type:"integer",format:"unix-time"};if(I.target==="openApi3")return U;for(let D of $.checks)switch(D.kind){case"min":D$(U,"minimum",D.value,D.message,I);break;case"max":D$(U,"maximum",D.value,D.message,I);break}return U};function $L($,I){return{...i($.innerType._def,I),default:$.defaultValue()}}function IL($,I){return I.effectStrategy==="input"?i($.schema._def,I):q$(I)}function UL($){return{type:"string",enum:Array.from($.values)}}var WP=($)=>{if("type"in $&&$.type==="string")return!1;return"allOf"in $};function AL($,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,A=[];return U.forEach((w)=>{if(WP(w)){if(A.push(...w.allOf),w.unevaluatedProperties===void 0)D=void 0}else{let b=w;if("additionalProperties"in w&&w.additionalProperties===!1){let{additionalProperties:N,...O}=w;b=O}else D=void 0;A.push(b)}}),A.length?{allOf:A,...D}:void 0}function DL($,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 CX=void 0,q6={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(CX===void 0)CX=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u");return CX},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 DD($,I){let U={type:"string"};if($.checks)for(let D of $.checks)switch(D.kind){case"min":D$(U,"minLength",typeof U.minLength==="number"?Math.max(U.minLength,D.value):D.value,D.message,I);break;case"max":D$(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":F6(U,"email",D.message,I);break;case"format:idn-email":F6(U,"idn-email",D.message,I);break;case"pattern:zod":r$(U,q6.email,D.message,I);break}break;case"url":F6(U,"uri",D.message,I);break;case"uuid":F6(U,"uuid",D.message,I);break;case"regex":r$(U,D.regex,D.message,I);break;case"cuid":r$(U,q6.cuid,D.message,I);break;case"cuid2":r$(U,q6.cuid2,D.message,I);break;case"startsWith":r$(U,RegExp(`^${ZX(D.value,I)}`),D.message,I);break;case"endsWith":r$(U,RegExp(`${ZX(D.value,I)}$`),D.message,I);break;case"datetime":F6(U,"date-time",D.message,I);break;case"date":F6(U,"date",D.message,I);break;case"time":F6(U,"time",D.message,I);break;case"duration":F6(U,"duration",D.message,I);break;case"length":D$(U,"minLength",typeof U.minLength==="number"?Math.max(U.minLength,D.value):D.value,D.message,I),D$(U,"maxLength",typeof U.maxLength==="number"?Math.min(U.maxLength,D.value):D.value,D.message,I);break;case"includes":{r$(U,RegExp(ZX(D.value,I)),D.message,I);break}case"ip":{if(D.version!=="v6")F6(U,"ipv4",D.message,I);if(D.version!=="v4")F6(U,"ipv6",D.message,I);break}case"base64url":r$(U,q6.base64url,D.message,I);break;case"jwt":r$(U,q6.jwt,D.message,I);break;case"cidr":{if(D.version!=="v6")r$(U,q6.ipv4Cidr,D.message,I);if(D.version!=="v4")r$(U,q6.ipv6Cidr,D.message,I);break}case"emoji":r$(U,q6.emoji(),D.message,I);break;case"ulid":{r$(U,q6.ulid,D.message,I);break}case"base64":{switch(I.base64Strategy){case"format:binary":{F6(U,"binary",D.message,I);break}case"contentEncoding:base64":{D$(U,"contentEncoding","base64",D.message,I);break}case"pattern:zod":{r$(U,q6.base64,D.message,I);break}}break}case"nanoid":r$(U,q6.nanoid,D.message,I);case"toLowerCase":case"toUpperCase":case"trim":break;default:((A)=>{})(D)}return U}function ZX($,I){return I.patternStrategy==="escape"?QP($):$}var GP=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function QP($){let I="";for(let U=0;U<$.length;U++){if(!GP.has($[U]))I+="\\";I+=$[U]}return I}function F6($,I,U,D){if($.format||$.anyOf?.some((A)=>A.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 D$($,"format",I,U,D)}function r$($,I,U,D){if($.pattern||$.allOf?.some((A)=>A.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:wL(I,D),...U&&D.errorMessages&&{errorMessage:{pattern:U}}})}else D$($,"pattern",wL(I,D),U,D)}function wL($,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,A="",w=!1,b=!1,N=!1;for(let O=0;O<D.length;O++){if(w){A+=D[O],w=!1;continue}if(U.i){if(b){if(D[O].match(/[a-z]/)){if(N)A+=D[O],A+=`${D[O-2]}-${D[O]}`.toUpperCase(),N=!1;else if(D[O+1]==="-"&&D[O+2]?.match(/[a-z]/))A+=D[O],N=!0;else A+=`${D[O]}${D[O].toUpperCase()}`;continue}}else if(D[O].match(/[a-z]/)){A+=`[${D[O]}${D[O].toUpperCase()}]`;continue}}if(U.m){if(D[O]==="^"){A+=`(^|(?<=[\r
37
- ]))`;continue}else if(D[O]==="$"){A+=`($|(?=[\r
38
- ]))`;continue}}if(U.s&&D[O]==="."){A+=b?`${D[O]}\r
39
- `:`[${D[O]}\r
40
- ]`;continue}if(A+=D[O],D[O]==="\\")w=!0;else if(b&&D[O]==="]")b=!1;else if(!b&&D[O]==="[")b=!0}try{new RegExp(A)}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 A}function wD($,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===E.ZodEnum)return{type:"object",required:$.keyType._def.values,properties:$.keyType._def.values.reduce((D,A)=>({...D,[A]:i($.valueType._def,{...I,currentPath:[...I.currentPath,"properties",A]})??q$(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===E.ZodString&&$.keyType._def.checks?.length){let{type:D,...A}=DD($.keyType._def,I);return{...U,propertyNames:A}}else if($.keyType?._def.typeName===E.ZodEnum)return{...U,propertyNames:{enum:$.keyType._def.values}};else if($.keyType?._def.typeName===E.ZodBranded&&$.keyType._def.type._def.typeName===E.ZodString&&$.keyType._def.type._def.checks?.length){let{type:D,...A}=AD($.keyType._def,I);return{...U,propertyNames:A}}return U}function bL($,I){if(I.mapStrategy==="record")return wD($,I);let U=i($.keyType._def,{...I,currentPath:[...I.currentPath,"items","items","0"]})||q$(I),D=i($.valueType._def,{...I,currentPath:[...I.currentPath,"items","items","1"]})||q$(I);return{type:"array",maxItems:125,items:{type:"array",items:[U,D],minItems:2,maxItems:2}}}function NL($){let I=$.values,D=Object.keys($.values).filter((w)=>{return typeof I[I[w]]!=="number"}).map((w)=>I[w]),A=Array.from(new Set(D.map((w)=>typeof w)));return{type:A.length===1?A[0]==="string"?"string":"number":["string","number"],enum:D}}function OL($){return $.target==="openAi"?void 0:{not:q$({...$,currentPath:[...$.currentPath,"not"]})}}function XL($){return $.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}var GU={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function GL($,I){if(I.target==="openApi3")return WL($,I);let U=$.options instanceof Map?Array.from($.options.values()):$.options;if(U.every((D)=>(D._def.typeName in GU)&&(!D._def.checks||!D._def.checks.length))){let D=U.reduce((A,w)=>{let b=GU[w._def.typeName];return b&&!A.includes(b)?[...A,b]:A},[]);return{type:D.length>1?D:D[0]}}else if(U.every((D)=>D._def.typeName==="ZodLiteral"&&!D.description)){let D=U.reduce((A,w)=>{let b=typeof w._def.value;switch(b){case"string":case"number":case"boolean":return[...A,b];case"bigint":return[...A,"integer"];case"object":if(w._def.value===null)return[...A,"null"];case"symbol":case"undefined":case"function":default:return A}},[]);if(D.length===U.length){let A=D.filter((w,b,N)=>N.indexOf(w)===b);return{type:A.length>1?A:A[0],enum:U.reduce((w,b)=>{return w.includes(b._def.value)?w:[...w,b._def.value]},[])}}}else if(U.every((D)=>D._def.typeName==="ZodEnum"))return{type:"string",enum:U.reduce((D,A)=>[...D,...A._def.values.filter((w)=>!D.includes(w))],[])};return WL($,I)}var WL=($,I)=>{let U=($.options instanceof Map?Array.from($.options.values()):$.options).map((D,A)=>i(D._def,{...I,currentPath:[...I.currentPath,"anyOf",`${A}`]})).filter((D)=>!!D&&(!I.strictUnions||typeof D==="object"&&Object.keys(D).length>0));return U.length?{anyOf:U}:void 0};function QL($,I){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes($.innerType._def.typeName)&&(!$.innerType._def.checks||!$.innerType._def.checks.length)){if(I.target==="openApi3")return{type:GU[$.innerType._def.typeName],nullable:!0};return{type:[GU[$.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 YL($,I){let U={type:"number"};if(!$.checks)return U;for(let D of $.checks)switch(D.kind){case"int":U.type="integer",TX(U,"type",D.message,I);break;case"min":if(I.target==="jsonSchema7")if(D.inclusive)D$(U,"minimum",D.value,D.message,I);else D$(U,"exclusiveMinimum",D.value,D.message,I);else{if(!D.inclusive)U.exclusiveMinimum=!0;D$(U,"minimum",D.value,D.message,I)}break;case"max":if(I.target==="jsonSchema7")if(D.inclusive)D$(U,"maximum",D.value,D.message,I);else D$(U,"exclusiveMaximum",D.value,D.message,I);else{if(!D.inclusive)U.exclusiveMaximum=!0;D$(U,"maximum",D.value,D.message,I)}break;case"multipleOf":D$(U,"multipleOf",D.value,D.message,I);break}return U}function BL($,I){let U=I.target==="openAi",D={type:"object",properties:{}},A=[],w=$.shape();for(let N in w){let O=w[N];if(O===void 0||O._def===void 0)continue;let X=BP(O);if(X&&U){if(O._def.typeName==="ZodOptional")O=O._def.innerType;if(!O.isNullable())O=O.nullable();X=!1}let W=i(O._def,{...I,currentPath:[...I.currentPath,"properties",N],propertyPath:[...I.currentPath,"properties",N]});if(W===void 0)continue;if(D.properties[N]=W,!X)A.push(N)}if(A.length)D.required=A;let b=YP($,I);if(b!==void 0)D.additionalProperties=b;return D}function YP($,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 BP($){try{return $.isOptional()}catch{return!0}}var JL=($,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:q$(I)},U]}:q$(I)};var HL=($,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((A)=>A!==void 0)}};function LL($,I){return i($.type._def,I)}function zL($,I){let D={type:"array",uniqueItems:!0,items:i($.valueType._def,{...I,currentPath:[...I.currentPath,"items"]})};if($.minSize)D$(D,"minItems",$.minSize.value,$.minSize.message,I);if($.maxSize)D$(D,"maxItems",$.maxSize.value,$.maxSize.message,I);return D}function ML($,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 KL($){return{not:q$($)}}function VL($){return q$($)}var vL=($,I)=>{return i($.innerType._def,I)};var qL=($,I,U)=>{switch(I){case E.ZodString:return DD($,U);case E.ZodNumber:return YL($,U);case E.ZodObject:return BL($,U);case E.ZodBigInt:return aH($,U);case E.ZodBoolean:return eH();case E.ZodDate:return _X($,U);case E.ZodUndefined:return KL(U);case E.ZodNull:return XL(U);case E.ZodArray:return tH($,U);case E.ZodUnion:case E.ZodDiscriminatedUnion:return GL($,U);case E.ZodIntersection:return AL($,U);case E.ZodTuple:return ML($,U);case E.ZodRecord:return wD($,U);case E.ZodLiteral:return DL($,U);case E.ZodEnum:return UL($);case E.ZodNativeEnum:return NL($);case E.ZodNullable:return QL($,U);case E.ZodOptional:return JL($,U);case E.ZodMap:return bL($,U);case E.ZodSet:return zL($,U);case E.ZodLazy:return()=>$.getter()._def;case E.ZodPromise:return LL($,U);case E.ZodNaN:case E.ZodNever:return OL(U);case E.ZodEffects:return IL($,U);case E.ZodAny:return q$(U);case E.ZodUnknown:return VL(U);case E.ZodDefault:return $L($,U);case E.ZodBranded:return AD($,U);case E.ZodReadonly:return vL($,U);case E.ZodCatch:return sH($,U);case E.ZodPipeline:return HL($,U);case E.ZodFunction:case E.ZodVoid:case E.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!==oH)return N}if(D&&!U){let N=JP(D,I);if(N!==void 0)return N}let A={def:$,path:I.currentPath,jsonSchema:void 0};I.seen.set($,A);let w=qL($,$.typeName,I),b=typeof w==="function"?i(w(),I):w;if(b)HP($,I,b);if(I.postProcess){let N=I.postProcess(b,$,I);return A.jsonSchema=b,N}return A.jsonSchema=b,b}var JP=($,I)=>{switch(I.$refStrategy){case"root":return{$ref:$.path.join("/")};case"relative":return{$ref:UD(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`),q$(I);return I.$refStrategy==="seen"?q$(I):void 0}}},HP=($,I,U)=>{if($.description){if(U.description=$.description,I.markdownDescription)U.markdownDescription=$.description}return U};var gX=($,I)=>{let U=pH(I),D=typeof I==="object"&&I.definitions?Object.entries(I.definitions).reduce((O,[X,W])=>({...O,[X]:i(W._def,{...U,currentPath:[...U.basePath,U.definitionPath,X]},!0)??q$(U)}),{}):void 0,A=typeof I==="string"?I:I?.nameStrategy==="title"?void 0:I?.name,w=i($._def,A===void 0?U:{...U,currentPath:[...U.basePath,U.definitionPath,A]},!1)??q$(U),b=typeof I==="object"&&I.name!==void 0&&I.nameStrategy==="title"?I.name:void 0;if(b!==void 0)w.title=b;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=A===void 0?D?{...w,[U.definitionPath]:D}:w:{$ref:[...U.$refStrategy==="relative"?[]:U.basePath,U.definitionPath,A].join("/"),[U.definitionPath]:{...D,[A]: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 LP($){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 xX($,I){if(Y6($))return AX($,{target:LP(I?.target),io:I?.pipeStrategy??"input"});return gX($,{strictUnions:I?.strictUnions??!0,pipeStrategy:I?.pipeStrategy??"input"})}function hX($){let U=B4($)?.method;if(!U)throw new Error("Schema is missing a method literal");let D=TA(U);if(typeof D!=="string")throw new Error("Schema method literal must be a string");return D}function fX($,I){let U=Y4($,I);if(!U.success)throw U.error;return U.data}var zP=60000;class yX{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(fA,(I)=>{this._oncancel(I)}),this.setNotificationHandler(uA,(I)=>{this._onprogress(I)}),this.setRequestHandler(yA,(I)=>({})),this._taskStore=$?.taskStore,this._taskMessageQueue=$?.taskMessageQueue,this._taskStore)this.setRequestHandler(lA,async(I,U)=>{let D=await this._taskStore.getTask(I.params.taskId,U.sessionId);if(!D)throw new f(c.InvalidParams,"Failed to retrieve task: Task not found");return{...D}}),this.setRequestHandler(mA,async(I,U)=>{let D=async()=>{let A=I.params.taskId;if(this._taskMessageQueue){let b;while(b=await this._taskMessageQueue.dequeue(A,U.sessionId)){if(b.type==="response"||b.type==="error"){let N=b.message,O=N.id,X=this._requestResolvers.get(O);if(X)if(this._requestResolvers.delete(O),b.type==="response")X(N);else{let W=N,Q=new f(W.error.code,W.error.message,W.error.data);X(Q)}else{let W=b.type==="response"?"Response":"Error";this._onerror(new Error(`${W} handler missing for request ${O}`))}continue}await this._transport?.send(b.message,{relatedRequestId:U.requestId})}}let w=await this._taskStore.getTask(A,U.sessionId);if(!w)throw new f(c.InvalidParams,`Task not found: ${A}`);if(!H4(w.status))return await this._waitForTaskUpdate(A,U.signal),await D();if(H4(w.status)){let b=await this._taskStore.getTaskResult(A,U.sessionId);return this._clearTaskQueue(A),{...b,_meta:{...b._meta,[J4]:{taskId:A}}}}return await D()};return await D()}),this.setRequestHandler(rA,async(I,U)=>{try{let{tasks:D,nextCursor:A}=await this._taskStore.listTasks(I.params?.cursor,U.sessionId);return{tasks:D,nextCursor:A,_meta:{}}}catch(D){throw new f(c.InvalidParams,`Failed to list tasks: ${D instanceof Error?D.message:String(D)}`)}}),this.setRequestHandler(nA,async(I,U)=>{try{let D=await this._taskStore.getTask(I.params.taskId,U.sessionId);if(!D)throw new f(c.InvalidParams,`Task not found: ${I.params.taskId}`);if(H4(D.status))throw new f(c.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 A=await this._taskStore.getTask(I.params.taskId,U.sessionId);if(!A)throw new f(c.InvalidParams,`Task not found after cancellation: ${I.params.taskId}`);return{_meta:{},...A}}catch(D){if(D instanceof f)throw D;throw new f(c.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,A=!1){this._timeoutInfo.set($,{timeoutId:setTimeout(D,I),startTime:Date.now(),timeout:I,maxTotalTimeout:U,resetTimeoutOnProgress:A,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(c.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($){this._transport=$;let I=this.transport?.onclose;this._transport.onclose=()=>{I?.(),this._onclose()};let U=this.transport?.onerror;this._transport.onerror=(A)=>{U?.(A),this._onerror(A)};let D=this._transport?.onmessage;this._transport.onmessage=(A,w)=>{if(D?.(A,w),AU(A)||ZH(A))this._onresponse(A);else if(HX(A))this._onrequest(A,w);else if(CH(A))this._onnotification(A);else this._onerror(new Error(`Unknown message type: ${JSON.stringify(A)}`))},await this._transport.start()}_onclose(){let $=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();let I=f.fromError(c.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,A=$.params?._meta?.[J4]?.taskId;if(U===void 0){let X={jsonrpc:"2.0",id:$.id,error:{code:c.MethodNotFound,message:"Method not found"}};if(A&&this._taskMessageQueue)this._enqueueTaskMessage(A,{type:"error",message:X,timestamp:Date.now()},D?.sessionId).catch((W)=>this._onerror(new Error(`Failed to enqueue error response: ${W}`)));else D?.send(X).catch((W)=>this._onerror(new Error(`Failed to send an error response: ${W}`)));return}let w=new AbortController;this._requestHandlerAbortControllers.set($.id,w);let b=RH($.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)=>{let W={relatedRequestId:$.id};if(A)W.relatedTask={taskId:A};await this.notification(X,W)},sendRequest:async(X,W,Q)=>{let B={...Q,relatedRequestId:$.id};if(A&&!B.relatedTask)B.relatedTask={taskId:A};let Y=B.relatedTask?.taskId??A;if(Y&&N)await N.updateTaskStatus(Y,"input_required");return await this.request(X,W,B)},authInfo:I?.authInfo,requestId:$.id,requestInfo:I?.requestInfo,taskId:A,taskStore:N,taskRequestedTtl:b?.ttl,closeSSEStream:I?.closeSSEStream,closeStandaloneSSEStream:I?.closeStandaloneSSEStream};Promise.resolve().then(()=>{if(b)this.assertTaskHandlerCapability($.method)}).then(()=>U($,O)).then(async(X)=>{if(w.signal.aborted)return;let W={result:X,jsonrpc:"2.0",id:$.id};if(A&&this._taskMessageQueue)await this._enqueueTaskMessage(A,{type:"response",message:W,timestamp:Date.now()},D?.sessionId);else await D?.send(W)},async(X)=>{if(w.signal.aborted)return;let W={jsonrpc:"2.0",id:$.id,error:{code:Number.isSafeInteger(X.code)?X.code:c.InternalError,message:X.message??"Internal error",...X.data!==void 0&&{data:X.data}}};if(A&&this._taskMessageQueue)await this._enqueueTaskMessage(A,{type:"error",message:W,timestamp:Date.now()},D?.sessionId);else await D?.send(W)}).catch((X)=>this._onerror(new Error(`Failed to send response: ${X}`))).finally(()=>{this._requestHandlerAbortControllers.delete($.id)})}_onprogress($){let{progressToken:I,...U}=$.params,D=Number(I),A=this._progressHandlers.get(D);if(!A){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify($)}`));return}let w=this._responseHandlers.get(D),b=this._timeoutInfo.get(D);if(b&&w&&b.resetTimeoutOnProgress)try{this._resetTimeout(D)}catch(N){this._responseHandlers.delete(D),this._progressHandlers.delete(D),this._cleanupTimeout(D),w(N);return}A(U)}_onresponse($){let I=Number($.id),U=this._requestResolvers.get(I);if(U){if(this._requestResolvers.delete(I),AU($))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 A=!1;if(AU($)&&$.result&&typeof $.result==="object"){let w=$.result;if(w.task&&typeof w.task==="object"){let b=w.task;if(typeof b.taskId==="string")A=!0,this._taskProgressTokens.set(b.taskId,I)}}if(!A)this._progressHandlers.delete(I);if(AU($))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(c.InternalError,String(w))}}return}let A;try{let w=await this.request($,SI,U);if(w.task)A=w.task.taskId,yield{type:"taskCreated",task:w.task};else throw new f(c.InternalError,"Task creation did not return a task");while(!0){let b=await this.getTask({taskId:A},U);if(yield{type:"taskStatus",task:b},H4(b.status)){if(b.status==="completed")yield{type:"result",result:await this.getTaskResult({taskId:A},I,U)};else if(b.status==="failed")yield{type:"error",error:new f(c.InternalError,`Task ${A} failed`)};else if(b.status==="cancelled")yield{type:"error",error:new f(c.InternalError,`Task ${A} was cancelled`)};return}if(b.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:A},I,U)};return}let N=b.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(c.InternalError,String(w))}}}request($,I,U){let{relatedRequestId:D,resumptionToken:A,onresumptiontoken:w,task:b,relatedTask:N}=U??{};return new Promise((O,X)=>{let W=(V)=>{X(V)};if(!this._transport){W(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{if(this.assertCapabilityForMethod($.method),b)this.assertTaskCapability($.method)}catch(V){W(V);return}U?.signal?.throwIfAborted();let Q=this._requestMessageId++,B={...$,jsonrpc:"2.0",id:Q};if(U?.onprogress)this._progressHandlers.set(Q,U.onprogress),B.params={...$.params,_meta:{...$.params?._meta||{},progressToken:Q}};if(b)B.params={...B.params,task:b};if(N)B.params={...B.params,_meta:{...B.params?._meta||{},[J4]:N}};let Y=(V)=>{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(V)}},{relatedRequestId:D,resumptionToken:A,onresumptiontoken:w}).catch((k)=>this._onerror(new Error(`Failed to send cancellation: ${k}`)));let F=V instanceof f?V:new f(c.RequestTimeout,String(V));X(F)};this._responseHandlers.set(Q,(V)=>{if(U?.signal?.aborted)return;if(V instanceof Error)return X(V);try{let F=Y4(I,V.result);if(!F.success)X(F.error);else O(F.data)}catch(F){X(F)}}),U?.signal?.addEventListener("abort",()=>{Y(U?.signal?.reason)});let J=U?.timeout??zP,H=()=>Y(f.fromError(c.RequestTimeout,"Request timed out",{timeout:J}));this._setupTimeout(Q,J,U?.maxTotalTimeout,H,U?.resetTimeoutOnProgress??!1);let v=N?.taskId;if(v){let V=(F)=>{let k=this._responseHandlers.get(Q);if(k)k(F);else this._onerror(new Error(`Response handler missing for side-channeled request ${Q}`))};this._requestResolvers.set(Q,V),this._enqueueTaskMessage(v,{type:"request",message:B,timestamp:Date.now()}).catch((F)=>{this._cleanupTimeout(Q),X(F)})}else this._transport.send(B,{relatedRequestId:D,resumptionToken:A,onresumptiontoken:w}).catch((V)=>{this._cleanupTimeout(Q),X(V)})})}async getTask($,I){return this.request({method:"tasks/get",params:$},cA,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:$},hH,I)}async notification($,I){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability($.method);let U=I?.relatedTask?.taskId;if(U){let b={...$,jsonrpc:"2.0",params:{...$.params,_meta:{...$.params?._meta||{},[J4]:I.relatedTask}}};await this._enqueueTaskMessage(U,{type:"notification",message:b,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 b={...$,jsonrpc:"2.0"};if(I?.relatedTask)b={...b,params:{...b.params,_meta:{...b.params?._meta||{},[J4]:I.relatedTask}}};this._transport?.send(b,I).catch((N)=>this._onerror(N))});return}let w={...$,jsonrpc:"2.0"};if(I?.relatedTask)w={...w,params:{...w.params,_meta:{...w.params?._meta||{},[J4]:I.relatedTask}}};await this._transport.send(w,I)}setRequestHandler($,I){let U=hX($);this.assertRequestHandlerCapability(U),this._requestHandlers.set(U,(D,A)=>{let w=fX($,D);return Promise.resolve(I(w,A))})}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=hX($);this._notificationHandlers.set(U,(D)=>{let A=fX($,D);return Promise.resolve(I(A))})}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"&&HX(D.message)){let A=D.message.id,w=this._requestResolvers.get(A);if(w)w(new f(c.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(A);else this._onerror(new Error(`Resolver missing for request ${A} 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,A)=>{if(I.aborted){A(new f(c.InvalidRequest,"Request cancelled"));return}let w=setTimeout(D,U);I.addEventListener("abort",()=>{clearTimeout(w),A(new f(c.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 A=await U.getTask(D,I);if(!A)throw new f(c.InvalidParams,"Failed to retrieve task: Task not found");return A},storeTaskResult:async(D,A,w)=>{await U.storeTaskResult(D,A,w,I);let b=await U.getTask(D,I);if(b){let N=OU.parse({method:"notifications/tasks/status",params:b});if(await this.notification(N),H4(b.status))this._cleanupTaskProgressHandler(D)}},getTaskResult:(D)=>{return U.getTaskResult(D,I)},updateTaskStatus:async(D,A,w)=>{let b=await U.getTask(D,I);if(!b)throw new f(c.InvalidParams,`Task "${D}" not found - it may have been cleaned up`);if(H4(b.status))throw new f(c.InvalidParams,`Cannot update task "${D}" from terminal status "${b.status}" to "${A}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await U.updateTaskStatus(D,A,w,I);let N=await U.getTask(D,I);if(N){let O=OU.parse({method:"notifications/tasks/status",params:N});if(await this.notification(O),H4(N.status))this._cleanupTaskProgressHandler(D)}},listTasks:(D)=>{return U.listTasks(D,I)}}}}function FL($){return $!==null&&typeof $==="object"&&!Array.isArray($)}function EL($,I){let U={...$};for(let D in I){let A=D,w=I[A];if(w===void 0)continue;let b=U[A];if(FL(b)&&FL(w))U[A]={...b,...w};else U[A]=w}return U}var UV=g5(CW(),1),AV=g5(IV(),1);function jx(){let $=new UV.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return AV.default($),$}class mW{constructor($){this._ajv=$??jx()}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 rW{constructor($){this._server=$}requestStream($,I,U){return this._server.requestStream($,I,U)}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 DV($,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 wV($,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 iW extends yX{constructor($,I){super(I);if(this._serverInfo=$,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(WU.options.map((U,D)=>[U,D])),this.isMessageIgnored=(U,D)=>{let A=this._loggingLevels.get(D);return A?this.LOG_LEVEL_SEVERITY.get(U)<this.LOG_LEVEL_SEVERITY.get(A):!1},this._capabilities=I?.capabilities??{},this._instructions=I?.instructions,this._jsonSchemaValidator=I?.jsonSchemaValidator??new mW,this.setRequestHandler(MX,(U)=>this._oninitialize(U)),this.setNotificationHandler(KX,()=>this.oninitialized?.()),this._capabilities.logging)this.setRequestHandler(jX,async(U,D)=>{let A=D.sessionId||D.requestInfo?.headers["mcp-session-id"]||void 0,{level:w}=U.params,b=WU.safeParse(w);if(b.success)this._loggingLevels.set(A,b.data);return{}})}get experimental(){if(!this._experimental)this._experimental={tasks:new rW(this)};return this._experimental}registerCapabilities($){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=EL(this._capabilities,$)}setRequestHandler($,I){let D=B4($)?.method;if(!D)throw new Error("Schema is missing a method literal");let A;if(Y6(D)){let b=D;A=b._zod?.def?.value??b.value}else{let b=D;A=b._def?.value??b.value}if(typeof A!=="string")throw new Error("Schema method literal must be a string");if(A==="tools/call"){let b=async(N,O)=>{let X=Y4(kI,N);if(!X.success){let Y=X.error instanceof Error?X.error.message:String(X.error);throw new f(c.InvalidParams,`Invalid tools/call request: ${Y}`)}let{params:W}=X.data,Q=await Promise.resolve(I(N,O));if(W.task){let Y=Y4(SI,Q);if(!Y.success){let J=Y.error instanceof Error?Y.error.message:String(Y.error);throw new f(c.InvalidParams,`Invalid task creation result: ${J}`)}return Y.data}let B=Y4(sA,Q);if(!B.success){let Y=B.error instanceof Error?B.error.message:String(B.error);throw new f(c.InvalidParams,`Invalid tools/call result: ${Y}`)}return B.data};return super.setRequestHandler($,b)}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($){wV(this._clientCapabilities?.tasks?.requests,$,"Client")}assertTaskHandlerCapability($){if(!this._capabilities)return;DV(this._capabilities.tasks?.requests,$,"Server")}async _oninitialize($){let I=$.params.protocolVersion;return this._clientCapabilities=$.params.capabilities,this._clientVersion=$.params.clientInfo,{protocolVersion:jH.includes(I)?I:BX,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"},hA)}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],A=D.some((O)=>O.type==="tool_result"),w=$.messages.length>1?$.messages[$.messages.length-2]:void 0,b=w?Array.isArray(w.content)?w.content:[w.content]:[],N=b.some((O)=>O.type==="tool_use");if(A){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(b.filter((W)=>W.type==="tool_use").map((W)=>W.id)),X=new Set(D.filter((W)=>W.type==="tool_result").map((W)=>W.toolUseId));if(O.size!==X.size||![...O].every((W)=>X.has(W)))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:$},PX,I);return this.request({method:"sampling/createMessage",params:$},kX,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},$D,I)}case"form":{if(!this._clientCapabilities?.elicitation?.form)throw new Error("Client does not support form elicitation.");let D=$.mode==="form"?$:{...$,mode:"form"},A=await this.request({method:"elicitation/create",params:D},$D,I);if(A.action==="accept"&&A.content&&D.requestedSchema)try{let b=this._jsonSchemaValidator.getValidator(D.requestedSchema)(A.content);if(!b.valid)throw new f(c.InvalidParams,`Elicitation response content does not match requested schema: ${b.errorMessage}`)}catch(w){if(w instanceof f)throw w;throw new f(c.InternalError,`Error validating elicitation response: ${w instanceof Error?w.message:String(w)}`)}return A}}}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:$},RX,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 NV=Symbol.for("mcp.completable");function nW($){return!!$&&typeof $==="object"&&NV in $}function OV($){return $[NV]?.complete}var bV;(function($){$.Completable="McpCompletable"})(bV||(bV={}));var kx=/^[A-Za-z0-9._-]{1,128}$/;function Px($){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(!kx.test($)){let U=$.split("").filter((D)=>!/[A-Za-z0-9._-]/.test(D)).filter((D,A,w)=>w.indexOf(D)===A);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 Rx($,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 oW($){let I=Px($);return Rx($,I.warnings),I.isValid}class dW{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 tW{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 iW($,I)}get experimental(){if(!this._experimental)this._experimental={tasks:new dW(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(F4(eA)),this.server.assertCanSetRequestHandler(F4(kI)),this.server.registerCapabilities({tools:{listChanged:!0}}),this.server.setRequestHandler(eA,()=>({tools:Object.entries(this._registeredTools).filter(([,$])=>$.enabled).map(([$,I])=>{let U={name:$,title:I.title,description:I.description,inputSchema:(()=>{let D=FI(I.inputSchema);return D?xX(D,{strictUnions:!0,pipeStrategy:"input"}):Tx})(),annotations:I.annotations,execution:I.execution,_meta:I._meta};if(I.outputSchema){let D=FI(I.outputSchema);if(D)U.outputSchema=xX(D,{strictUnions:!0,pipeStrategy:"output"})}return U})})),this.server.setRequestHandler(kI,async($,I)=>{try{let U=this._registeredTools[$.params.name];if(!U)throw new f(c.InvalidParams,`Tool ${$.params.name} not found`);if(!U.enabled)throw new f(c.InvalidParams,`Tool ${$.params.name} disabled`);let D=!!$.params.task,A=U.execution?.taskSupport,w="createTask"in U.handler;if((A==="required"||A==="optional")&&!w)throw new f(c.InternalError,`Tool ${$.params.name} has taskSupport '${A}' but was not registered with registerToolTask`);if(A==="required"&&!D)throw new f(c.MethodNotFound,`Tool ${$.params.name} requires task augmentation (taskSupport: 'required')`);if(A==="optional"&&!D&&w)return await this.handleAutomaticTaskPolling(U,$,I);let b=await this.validateToolInput(U,$.params.arguments,$.params.name),N=await this.executeToolHandler(U,b,I);if(D)return N;return await this.validateToolOutput(U,N,$.params.name),N}catch(U){if(U instanceof f){if(U.code===c.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 A=FI($.inputSchema)??$.inputSchema,w=await PA(A,I);if(!w.success){let b="error"in w?w.error:"Unknown error",N=RA(b);throw new f(c.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(c.InvalidParams,`Output validation error: Tool ${U} has an output schema but no structured content was provided`);let D=FI($.outputSchema),A=await PA(D,I.structuredContent);if(!A.success){let w="error"in A?A.error:"Unknown error",b=RA(w);throw new f(c.InvalidParams,`Output validation error: Invalid structured content for tool ${U}: ${b}`)}}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 b=D;return await Promise.resolve(b.createTask(I,w))}else{let b=D;return await Promise.resolve(b.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),A=$.handler,w={...U,taskStore:U.taskStore},b=D?await Promise.resolve(A.createTask(D,w)):await Promise.resolve(A.createTask(w)),N=b.task.taskId,O=b.task,X=O.pollInterval??5000;while(O.status!=="completed"&&O.status!=="failed"&&O.status!=="cancelled"){await new Promise((Q)=>setTimeout(Q,X));let W=await U.taskStore.getTask(N);if(!W)throw new f(c.InternalError,`Task ${N} not found during polling`);O=W}return await U.taskStore.getTaskResult(N)}setCompletionRequestHandler(){if(this._completionHandlerInitialized)return;this.server.assertCanSetRequestHandler(F4(ID)),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler(ID,async($)=>{switch($.params.ref.type){case"ref/prompt":return mH($),this.handlePromptCompletion($,$.params.ref);case"ref/resource":return rH($),this.handleResourceCompletion($,$.params.ref);default:throw new f(c.InvalidParams,`Invalid completion reference: ${$.params.ref}`)}}),this._completionHandlerInitialized=!0}async handlePromptCompletion($,I){let U=this._registeredPrompts[I.name];if(!U)throw new f(c.InvalidParams,`Prompt ${I.name} not found`);if(!U.enabled)throw new f(c.InvalidParams,`Prompt ${I.name} disabled`);if(!U.argsSchema)return gU;let A=B4(U.argsSchema)?.[$.params.argument.name];if(!nW(A))return gU;let w=OV(A);if(!w)return gU;let b=await w($.params.argument.value,$.params.context);return WV(b)}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 gU;throw new f(c.InvalidParams,`Resource template ${$.params.ref.uri} not found`)}let D=U.resourceTemplate.completeCallback($.params.argument.name);if(!D)return gU;let A=await D($.params.argument.value,$.params.context);return WV(A)}setResourceRequestHandlers(){if(this._resourceHandlersInitialized)return;this.server.assertCanSetRequestHandler(F4(oA)),this.server.assertCanSetRequestHandler(F4(dA)),this.server.assertCanSetRequestHandler(F4(pA)),this.server.registerCapabilities({resources:{listChanged:!0}}),this.server.setRequestHandler(oA,async($,I)=>{let U=Object.entries(this._registeredResources).filter(([A,w])=>w.enabled).map(([A,w])=>({uri:A,name:w.name,...w.metadata})),D=[];for(let A of Object.values(this._registeredResourceTemplates)){if(!A.resourceTemplate.listCallback)continue;let w=await A.resourceTemplate.listCallback(I);for(let b of w.resources)D.push({...A.metadata,...b})}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(pA,async($,I)=>{let U=new URL($.params.uri),D=this._registeredResources[U.toString()];if(D){if(!D.enabled)throw new f(c.InvalidParams,`Resource ${U} disabled`);return D.readCallback(U,I)}for(let A of Object.values(this._registeredResourceTemplates)){let w=A.resourceTemplate.uriTemplate.match(U.toString());if(w)return A.readCallback(U,w,I)}throw new f(c.InvalidParams,`Resource ${U} not found`)}),this._resourceHandlersInitialized=!0}setPromptRequestHandlers(){if(this._promptHandlersInitialized)return;this.server.assertCanSetRequestHandler(F4(tA)),this.server.assertCanSetRequestHandler(F4(aA)),this.server.registerCapabilities({prompts:{listChanged:!0}}),this.server.setRequestHandler(tA,()=>({prompts:Object.entries(this._registeredPrompts).filter(([,$])=>$.enabled).map(([$,I])=>{return{name:$,title:I.title,description:I.description,arguments:I.argsSchema?Cx(I.argsSchema):void 0}})})),this.server.setRequestHandler(aA,async($,I)=>{let U=this._registeredPrompts[$.params.name];if(!U)throw new f(c.InvalidParams,`Prompt ${$.params.name} not found`);if(!U.enabled)throw new f(c.InvalidParams,`Prompt ${$.params.name} disabled`);if(U.argsSchema){let D=FI(U.argsSchema),A=await PA(D,$.params.arguments);if(!A.success){let N="error"in A?A.error:"Unknown error",O=RA(N);throw new f(c.InvalidParams,`Invalid arguments for prompt ${$.params.name}: ${O}`)}let w=A.data,b=U.callback;return await Promise.resolve(b(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 A=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,A);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,A);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 A=this._createRegisteredResource($,U.title,I,U,D);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),A}else{if(this._registeredResourceTemplates[$])throw new Error(`Resource template ${$} is already registered`);let A=this._createRegisteredResourceTemplate($,U.title,I,U,D);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),A}}_createRegisteredResource($,I,U,D,A){let w={name:$,title:I,metadata:D,readCallback:A,enabled:!0,disable:()=>w.update({enabled:!1}),enable:()=>w.update({enabled:!0}),remove:()=>w.update({uri:null}),update:(b)=>{if(typeof b.uri!=="undefined"&&b.uri!==U){if(delete this._registeredResources[U],b.uri)this._registeredResources[b.uri]=w}if(typeof b.name!=="undefined")w.name=b.name;if(typeof b.title!=="undefined")w.title=b.title;if(typeof b.metadata!=="undefined")w.metadata=b.metadata;if(typeof b.callback!=="undefined")w.readCallback=b.callback;if(typeof b.enabled!=="undefined")w.enabled=b.enabled;this.sendResourceListChanged()}};return this._registeredResources[U]=w,w}_createRegisteredResourceTemplate($,I,U,D,A){let w={resourceTemplate:U,title:I,metadata:D,readCallback:A,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 b=U.uriTemplate.variableNames;if(Array.isArray(b)&&b.some((O)=>!!U.completeCallback(O)))this.setCompletionRequestHandler();return w}_createRegisteredPrompt($,I,U,D,A){let w={title:I,description:U,argsSchema:D===void 0?void 0:d4(D),callback:A,enabled:!0,disable:()=>w.update({enabled:!1}),enable:()=>w.update({enabled:!0}),remove:()=>w.update({name:null}),update:(b)=>{if(typeof b.name!=="undefined"&&b.name!==$){if(delete this._registeredPrompts[$],b.name)this._registeredPrompts[b.name]=w}if(typeof b.title!=="undefined")w.title=b.title;if(typeof b.description!=="undefined")w.description=b.description;if(typeof b.argsSchema!=="undefined")w.argsSchema=d4(b.argsSchema);if(typeof b.callback!=="undefined")w.callback=b.callback;if(typeof b.enabled!=="undefined")w.enabled=b.enabled;this.sendPromptListChanged()}};if(this._registeredPrompts[$]=w,D){if(Object.values(D).some((N)=>{let O=N instanceof Q6?N._def?.innerType:N;return nW(O)}))this.setCompletionRequestHandler()}return w}_createRegisteredTool($,I,U,D,A,w,b,N,O){oW($);let X={title:I,description:U,inputSchema:XV(D),outputSchema:XV(A),annotations:w,execution:b,_meta:N,handler:O,enabled:!0,disable:()=>X.update({enabled:!1}),enable:()=>X.update({enabled:!0}),remove:()=>X.update({name:null}),update:(W)=>{if(typeof W.name!=="undefined"&&W.name!==$){if(typeof W.name==="string")oW(W.name);if(delete this._registeredTools[$],W.name)this._registeredTools[W.name]=X}if(typeof W.title!=="undefined")X.title=W.title;if(typeof W.description!=="undefined")X.description=W.description;if(typeof W.paramsSchema!=="undefined")X.inputSchema=d4(W.paramsSchema);if(typeof W.outputSchema!=="undefined")X.outputSchema=d4(W.outputSchema);if(typeof W.callback!=="undefined")X.handler=W.callback;if(typeof W.annotations!=="undefined")X.annotations=W.annotations;if(typeof W._meta!=="undefined")X._meta=W._meta;if(typeof W.enabled!=="undefined")X.enabled=W.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,A,w;if(typeof I[0]==="string")U=I.shift();if(I.length>1){let N=I[0];if(pW(N)){if(D=I.shift(),I.length>1&&typeof I[0]==="object"&&I[0]!==null&&!pW(I[0]))w=I.shift()}else if(typeof N==="object"&&N!==null)w=I.shift()}let b=I[0];return this._createRegisteredTool($,void 0,U,D,A,w,{taskSupport:"forbidden"},void 0,b)}registerTool($,I,U){if(this._registeredTools[$])throw new Error(`Tool ${$} is already registered`);let{title:D,description:A,inputSchema:w,outputSchema:b,annotations:N,_meta:O}=I;return this._createRegisteredTool($,D,A,w,b,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 A=I[0],w=this._createRegisteredPrompt($,void 0,U,D,A);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),w}registerPrompt($,I,U){if(this._registeredPrompts[$])throw new Error(`Prompt ${$} is already registered`);let{title:D,description:A,argsSchema:w}=I,b=this._createRegisteredPrompt($,D,A,w,U);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),b}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 Tx={type:"object",properties:{}};function GV($){return $!==null&&typeof $==="object"&&"parse"in $&&typeof $.parse==="function"&&"safeParse"in $&&typeof $.safeParse==="function"}function _x($){return"_def"in $||"_zod"in $||GV($)}function pW($){if(typeof $!=="object"||$===null)return!1;if(_x($))return!1;if(Object.keys($).length===0)return!0;return Object.values($).some(GV)}function XV($){if(!$)return;if(pW($))return d4($);return $}function Cx($){let I=B4($);if(!I)return[];return Object.entries(I).map(([U,D])=>{let A=DH(D),w=wH(D);return{name:U,description:A,required:!w}})}function F4($){let U=B4($)?.method;if(!U)throw new Error("Schema is missing a method literal");let D=TA(U);if(typeof D==="string")return D;throw new Error("Schema method literal must be a string")}function WV($){return{completion:{values:$.slice(0,100),total:$.length,hasMore:$.length>100}}}var gU={completion:{values:[],hasMore:!1}};import YV from"node:process";class aW{append($){this._buffer=this._buffer?Buffer.concat([this._buffer,$]):$}readMessage(){if(!this._buffer)return null;let $=this._buffer.indexOf(`
41
- `);if($===-1)return null;let I=this._buffer.toString("utf8",0,$).replace(/\r$/,"");return this._buffer=this._buffer.subarray($+1),Zx(I)}clear(){this._buffer=void 0}}function Zx($){return gH.parse(JSON.parse($))}function QV($){return JSON.stringify($)+`
42
- `}class eW{constructor($=YV.stdin,I=YV.stdout){this._stdin=$,this._stdout=I,this._readBuffer=new aW,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=QV($);if(this._stdout.write(U))I();else this._stdout.once("drain",I)})}}var{create:gx,defineProperty:BV,getOwnPropertyDescriptor:xx,getOwnPropertyNames:JV,getPrototypeOf:hx}=Object,fx=Object.prototype.hasOwnProperty,T6=($,I)=>function(){return I||$[JV($)[0]]((I={exports:{}}).exports,I),I.exports},yx=($,I,U,D)=>{if(I&&typeof I==="object"||typeof I==="function"){for(var A=JV(I),w=0,b=A.length,N;w<b;w++)if(N=A[w],!fx.call($,N)&&N!==U)BV($,N,{get:((O)=>I[O]).bind(null,N),enumerable:!(D=xx(I,N))||D.enumerable})}return $},G$=($,I,U)=>(U=$!=null?gx(hx($)):{},yx(I||!$||!$.__esModule?BV(U,"default",{value:$,enumerable:!0}):U,$)),HV=T6({"../../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(A){return typeof A}:function(A){return A&&typeof Symbol=="function"&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},I.exports.__esModule=!0,I.exports.default=I.exports,U(D)}I.exports=U,I.exports.__esModule=!0,I.exports.default=I.exports}}),ux=T6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"($,I){var U=HV().default;function D(A,w){if(U(A)!="object"||!A)return A;var b=A[Symbol.toPrimitive];if(b!==void 0){var N=b.call(A,w||"default");if(U(N)!="object")return N;throw new TypeError("@@toPrimitive must return a primitive value.")}return(w==="string"?String:Number)(A)}I.exports=D,I.exports.__esModule=!0,I.exports.default=I.exports}}),lx=T6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"($,I){var U=HV().default,D=ux();function A(w){var b=D(w,"string");return U(b)=="symbol"?b:b+""}I.exports=A,I.exports.__esModule=!0,I.exports.default=I.exports}}),u6=T6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"($,I){var U=lx();function D(A,w,b){return(w=U(w))in A?Object.defineProperty(A,w,{value:b,enumerable:!0,configurable:!0,writable:!0}):A[w]=b,A}I.exports=D,I.exports.__esModule=!0,I.exports.default=I.exports}}),_$=T6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"($,I){var U=u6();function D(w,b){var N=Object.keys(w);if(Object.getOwnPropertySymbols){var O=Object.getOwnPropertySymbols(w);b&&(O=O.filter(function(X){return Object.getOwnPropertyDescriptor(w,X).enumerable})),N.push.apply(N,O)}return N}function A(w){for(var b=1;b<arguments.length;b++){var N=arguments[b]!=null?arguments[b]:{};b%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=A,I.exports.__esModule=!0,I.exports.default=I.exports}});function l6($){let I={subscribe(U){let D=null,A=!1,w=!1,b=!1;function N(){if(D===null){b=!0;return}if(w)return;if(w=!0,typeof D==="function")D();else if(D)D.unsubscribe()}if(D=$({next(O){var X;if(A)return;(X=U.next)===null||X===void 0||X.call(U,O)},error(O){var X;if(A)return;A=!0,(X=U.error)===null||X===void 0||X.call(U,O),N()},complete(){var O;if(A)return;A=!0,(O=U.complete)===null||O===void 0||O.call(U),N()}}),b)N();return{unsubscribe:N}},pipe(...U){return U.reduce(cx,I)}};return I}function cx($,I){return I($)}function sW($){let I=new AbortController;return new Promise((D,A)=>{let w=!1;function b(){if(w)return;w=!0,N.unsubscribe()}I.signal.addEventListener("abort",()=>{A(I.signal.reason)});let N=$.subscribe({next(O){w=!0,D(O),b()},error(O){A(O)},complete(){I.abort(),b()}})})}function $9($){return(I)=>{let U=0,D=null,A=[];function w(){if(D)return;D=I.subscribe({next(N){for(let X of A){var O;(O=X.next)===null||O===void 0||O.call(X,N)}},error(N){for(let X of A){var O;(O=X.error)===null||O===void 0||O.call(X,N)}},complete(){for(let O of A){var N;(N=O.complete)===null||N===void 0||N.call(O)}}})}function b(){if(U===0&&D){let N=D;D=null,N.unsubscribe()}}return l6((N)=>{return U++,A.push(N),w(),{unsubscribe(){U--,b();let O=A.findIndex((X)=>X===N);if(O>-1)A.splice(O,1)}}})}}var Ap=Symbol();function rD($){let I=$,U=[],D=(b)=>{if(I!==void 0)b.next(I);U.push(b)},A=(b)=>{U.splice(U.indexOf(b),1)},w=l6((b)=>{return D(b),()=>{A(b)}});return w.next=(b)=>{if(I===b)return;I=b;for(let N of U)N.next(b)},w.get=()=>I,w}function LV($){return l6((I)=>{function U(A=0,w=$.op){let b=$.links[A];if(!b)throw new Error("No more links to execute - did you forget to add an ending link?");return b({op:w,next(O){return U(A+1,O)}})}return U().subscribe(I)})}function A4($){return!!$&&!Array.isArray($)&&typeof $==="object"}function iD(){return Object.create(null)}var uI={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 zV=[uI.BAD_GATEWAY,uI.SERVICE_UNAVAILABLE,uI.GATEWAY_TIMEOUT,uI.INTERNAL_SERVER_ERROR];var{create:rx,defineProperty:KV,getOwnPropertyDescriptor:ix,getOwnPropertyNames:VV,getPrototypeOf:nx}=Object,ox=Object.prototype.hasOwnProperty,xU=($,I)=>function(){return I||$[VV($)[0]]((I={exports:{}}).exports,I),I.exports},dx=($,I,U,D)=>{if(I&&typeof I==="object"||typeof I==="function"){for(var A=VV(I),w=0,b=A.length,N;w<b;w++)if(N=A[w],!ox.call($,N)&&N!==U)KV($,N,{get:((O)=>I[O]).bind(null,N),enumerable:!(D=ix(I,N))||D.enumerable})}return $},hU=($,I,U)=>(U=$!=null?rx(nx($)):{},dx(I||!$||!$.__esModule?KV(U,"default",{value:$,enumerable:!0}):U,$)),vV=()=>{},MV=($)=>{if(Object.freeze)Object.freeze($)};function qV($,I,U){var D;let A=I.join(".");return(D=U[A])!==null&&D!==void 0||(U[A]=new Proxy(vV,{get(w,b){if(typeof b!=="string"||b==="then")return;return qV($,[...I,b],U)},apply(w,b,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 MV(X.args),MV(X.path),$(X)}})),U[A]}var nD=($)=>qV($,[],iD()),I9=($)=>{return new Proxy(vV,{get(I,U){if(U==="then")return;return $(U)}})};var FV=xU({"../../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(A){return typeof A}:function(A){return A&&typeof Symbol=="function"&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},I.exports.__esModule=!0,I.exports.default=I.exports,U(D)}I.exports=U,I.exports.__esModule=!0,I.exports.default=I.exports}}),px=xU({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"($,I){var U=FV().default;function D(A,w){if(U(A)!="object"||!A)return A;var b=A[Symbol.toPrimitive];if(b!==void 0){var N=b.call(A,w||"default");if(U(N)!="object")return N;throw new TypeError("@@toPrimitive must return a primitive value.")}return(w==="string"?String:Number)(A)}I.exports=D,I.exports.__esModule=!0,I.exports.default=I.exports}}),tx=xU({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"($,I){var U=FV().default,D=px();function A(w){var b=D(w,"string");return U(b)=="symbol"?b:b+""}I.exports=A,I.exports.__esModule=!0,I.exports.default=I.exports}}),U9=xU({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"($,I){var U=tx();function D(A,w,b){return(w=U(w))in A?Object.defineProperty(A,w,{value:b,enumerable:!0,configurable:!0,writable:!0}):A[w]=b,A}I.exports=D,I.exports.__esModule=!0,I.exports.default=I.exports}}),oD=xU({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"($,I){var U=U9();function D(w,b){var N=Object.keys(w);if(Object.getOwnPropertySymbols){var O=Object.getOwnPropertySymbols(w);b&&(O=O.filter(function(X){return Object.getOwnPropertyDescriptor(w,X).enumerable})),N.push.apply(N,O)}return N}function A(w){for(var b=1;b<arguments.length;b++){var N=arguments[b]!=null?arguments[b]:{};b%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=A,I.exports.__esModule=!0,I.exports.default=I.exports}}),zp=hU(oD(),1);var vp=hU(U9(),1);var dD=hU(oD(),1);function sx($,I){if("error"in $){let D=I.deserialize($.error);return{ok:!1,error:dD.default(dD.default({},$),{},{error:D})}}return{ok:!0,result:dD.default(dD.default({},$.result),(!$.result.type||$.result.type==="data")&&{type:"data",data:I.deserialize($.result.data)})}}var A9=class extends Error{constructor(){super("Unable to transform response from server")}};function D9($,I){let U;try{U=sx($,I)}catch(D){throw new A9}if(!U.ok&&(!A4(U.error.error)||typeof U.error.error.code!=="number"))throw new A9;if(U.ok&&!A4(U.result))throw new A9;return U}var qp=hU(oD(),1);var Fp=Symbol();var pD=G$(u6(),1),lI=G$(_$(),1);function EV($){return $ instanceof E4}function Ah($){return A4($)&&A4($.error)&&typeof $.error.code==="number"&&typeof $.error.message==="string"}function Dh($,I){if(typeof $==="string")return $;if(A4($)&&typeof $.message==="string")return $.message;return I}var E4=class $ extends Error{constructor(I,U){var D,A;let w=U===null||U===void 0?void 0:U.cause;super(I,{cause:w});pD.default(this,"cause",void 0),pD.default(this,"shape",void 0),pD.default(this,"data",void 0),pD.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||(A=U.result)===null||A===void 0?void 0:A.error.data,this.name="TRPCClientError",Object.setPrototypeOf(this,$.prototype)}static from(I,U={}){let D=I;if(EV(D)){if(U.meta)D.meta=lI.default(lI.default({},D.meta),U.meta);return D}if(Ah(D))return new $(D.error.message,lI.default(lI.default({},U),{},{result:D,cause:U.cause}));return new $(Dh(D,"Unknown error"),lI.default(lI.default({},U),{},{cause:D}))}};function tD($){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 SV=($)=>typeof $==="function";function jV($){if($)return $;if(typeof window!=="undefined"&&SV(window.fetch))return window.fetch;if(typeof globalThis!=="undefined"&&SV(globalThis.fetch))return globalThis.fetch;throw new Error("No fetch implementation found")}var fU=G$(_$(),1);function aD($){return{url:$.url.toString(),fetch:$.fetch,transformer:tD($.transformer),methodOverride:$.methodOverride}}function wh($){let I={};for(let U=0;U<$.length;U++){let D=$[U];I[U]=D}return I}var bh={query:"GET",mutation:"POST",subscription:"PATCH"};function kV($){return"input"in $?$.transformer.input.serialize($.input):wh($.inputs.map((I)=>$.transformer.input.serialize(I)))}var cI=($)=>{let I=$.url.split("?"),D=I[0].replace(/\/$/,"")+"/"+$.path,A=[];if(I[1])A.push(I[1]);if("inputs"in $)A.push("batch=1");if($.type==="query"||$.type==="subscription"){let w=kV($);if(w!==void 0&&$.methodOverride!=="POST")A.push(`input=${encodeURIComponent(JSON.stringify(w))}`)}if(A.length)D+="?"+A.join("&");return D},PV=($)=>{if($.type==="query"&&$.methodOverride!=="POST")return;let I=kV($);return I!==void 0?JSON.stringify(I):void 0},w9=($)=>{return eD(fU.default(fU.default({},$),{},{contentTypeHeader:"application/json",getUrl:cI,getBody:PV}))},Nh=class extends Error{constructor(){super("AbortError");this.name="AbortError",this.message="AbortError"}},Oh=($)=>{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 Nh};async function RV($){var I,U;Oh($.signal);let D=$.getUrl($),A=$.getBody($),w=(I=$.methodOverride)!==null&&I!==void 0?I:bh[$.type],b=await(async()=>{let O=await $.headers();if(Symbol.iterator in O)return Object.fromEntries(O);return O})(),N=fU.default(fU.default(fU.default({},$.contentTypeHeader&&w!=="GET"?{"content-type":$.contentTypeHeader}:{}),$.trpcAcceptHeader?{[(U=$.trpcAcceptHeaderKey)!==null&&U!==void 0?U:"trpc-accept"]:$.trpcAcceptHeader}:void 0),b);return jV($.fetch)(D,{method:w,signal:$.signal,body:A,headers:N})}async function eD($){let I={},U=await RV($);I.response=U;let D=await U.json();return I.responseJSON=D,{json:D,meta:I}}function TV($){return $ instanceof Uint8Array||$ instanceof Blob}function _V($){return $ instanceof FormData}var mI=G$(_$(),1),Xh=($)=>{if("input"in $){let{input:I}=$;if(_V(I)){if($.type!=="mutation"&&$.methodOverride!=="POST")throw new Error("FormData is only supported for mutations");return eD(mI.default(mI.default({},$),{},{contentTypeHeader:void 0,getUrl:cI,getBody:()=>I}))}if(TV(I)){if($.type!=="mutation"&&$.methodOverride!=="POST")throw new Error("Octet type input is only supported for mutations");return eD(mI.default(mI.default({},$),{},{contentTypeHeader:"application/octet-stream",getUrl:cI,getBody:()=>I}))}}return w9($)};function b9($){let I=aD($);return()=>{return(U)=>{let{op:D}=U;return l6((A)=>{let{path:w,input:b,type:N}=D;if(N==="subscription")throw new Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");let O=Xh(mI.default(mI.default({},I),{},{type:N,path:w,input:b,signal:D.signal,headers(){if(!$.headers)return{};if(typeof $.headers==="function")return $.headers({op:D});return $.headers}})),X=void 0;return O.then((W)=>{X=W.meta;let Q=D9(W.json,I.transformer.output);if(!Q.ok){A.error(E4.from(Q.error,{meta:X}));return}A.next({context:W.meta,result:Q.result}),A.complete()}).catch((W)=>{A.error(E4.from(W,{meta:X}))}),()=>{}})}}}var Vt=G$(_$(),1);var Ft=G$(_$(),1);var N9=($,...I)=>{return typeof $==="function"?$(...I):$},Rt=G$(u6(),1);function Wh(){let $,I;return{promise:new Promise((D,A)=>{$=D,I=A}),resolve:$,reject:I}}async function Gh($){let I=await N9($.url);if(!$.connectionParams)return I;let D=`${I.includes("?")?"&":"?"}connectionParams=1`;return I+D}async function Qh($,I){let U={method:"connectionParams",data:await N9($)};return I.encode(U)}var Tt=G$(u6(),1);var S4=G$(u6(),1);function Yh($){let{promise:I,resolve:U,reject:D}=Wh();return $.addEventListener("open",()=>{$.removeEventListener("error",D),U()}),$.addEventListener("error",D),I}function Bh($,{intervalMs:I,pongTimeoutMs:U}){let D,A;function w(){D=setTimeout(()=>{$.send("PING"),A=setTimeout(()=>{$.close()},U)},I)}function b(){clearTimeout(D),w()}function N(){clearTimeout(A),b()}$.addEventListener("open",w),$.addEventListener("message",({data:O})=>{if(clearTimeout(D),w(),O==="PONG")N()}),$.addEventListener("close",()=>{clearTimeout(D),clearTimeout(A)})}var Jh=class ${constructor(I){var U;if(S4.default(this,"id",++$.connectCount),S4.default(this,"WebSocketPonyfill",void 0),S4.default(this,"urlOptions",void 0),S4.default(this,"keepAliveOpts",void 0),S4.default(this,"encoder",void 0),S4.default(this,"wsObservable",rD(null)),S4.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=Gh(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:A}){if(A==="PING")this.send("PONG")}),I.keepAliveOpts.enabled)Bh(D,I.keepAliveOpts);if(D.addEventListener("close",()=>{if(I.ws===D)I.ws=null}),await Yh(D),I.urlOptions.connectionParams)D.send(await Qh(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()}}};S4.default(Jh,"connectCount",0);var _t=G$(u6(),1),Ct=G$(_$(),1);var O9=G$(u6(),1),CV=G$(_$(),1),Hh=class{constructor($){O9.default(this,"links",void 0),O9.default(this,"runtime",void 0),O9.default(this,"requestId",void 0),this.requestId=0,this.runtime={},this.links=$.links.map((I)=>I(this.runtime))}$request($){var I;return LV({links:this.links,op:CV.default(CV.default({},$),{},{context:(I=$.context)!==null&&I!==void 0?I:{},id:++this.requestId})}).pipe($9())}async requestAsPromise($){var I=this;try{let U=I.$request($);return(await sW(U)).result.data}catch(U){throw E4.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(A){switch(A.result.type){case"state":{var w;(w=U.onConnectionStateChange)===null||w===void 0||w.call(U,A.result);break}case"started":{var b;(b=U.onStarted)===null||b===void 0||b.call(U,{context:A.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,A.result.data);break}}},error(A){var w;(w=U.onError)===null||w===void 0||w.call(U,A)},complete(){var A;(A=U.onComplete)===null||A===void 0||A.call(U)}})}};var Lh=Symbol.for("trpc_untypedClient"),zh={query:"query",mutate:"mutation",subscribe:"subscription"},Mh=($)=>{return zh[$]};function Kh($){let I=nD(({path:U,args:D})=>{let A=[...U],w=Mh(A.pop()),b=A.join(".");return $[w](b,...D)});return I9((U)=>{if(U===Lh)return $;return I[U]})}function ZV($){let I=new Hh($);return Kh(I)}var Oa=G$(_$(),1);var Xa=G$(_$(),1);var Vh=T6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js"($,I){function U(A){var w,b,N,O=2;for(typeof Symbol!="undefined"&&(b=Symbol.asyncIterator,N=Symbol.iterator);O--;){if(b&&(w=A[b])!=null)return w.call(A);if(N&&(w=A[N])!=null)return new D(w.call(A));b="@@asyncIterator",N="@@iterator"}throw new TypeError("Object is not async iterable")}function D(A){function w(b){if(Object(b)!==b)return Promise.reject(new TypeError(b+" is not an object."));var N=b.done;return Promise.resolve(b.value).then(function(O){return{value:O,done:N}})}return D=function b(N){this.s=N,this.n=N.next},D.prototype={s:null,n:null,next:function b(){return w(this.n.apply(this.s,arguments))},return:function b(N){var O=this.s.return;return O===void 0?Promise.resolve({value:N,done:!0}):w(O.apply(this.s,arguments))},throw:function b(N){var O=this.s.return;return O===void 0?Promise.reject(N):w(O.apply(this.s,arguments))}},new D(A)}I.exports=U,I.exports.__esModule=!0,I.exports.default=I.exports}}),Wa=G$(Vh(),1);var Ga=G$(_$(),1);var vh=T6({"../../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},A={},w=[];function b(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 W=X;if(typeof X!="function")throw new TypeError("Object is not disposable.");W&&(X=function Q(){try{W.call(O)}catch(B){return Promise.reject(B)}}),w.push({v:O,d:X,a:N})}else N&&w.push({d:O,a:N});return O}return{e:A,u:b.bind(null,!1),a:b.bind(null,!0),d:function N(){var O,X=this.e,W=0;function Q(){for(;O=w.pop();)try{if(!O.a&&W===1)return W=0,w.push(O),Promise.resolve().then(Q);if(O.d){var Y=O.d.call(O.v);if(O.a)return W|=2,Promise.resolve(Y).then(Q,B)}else W|=1}catch(J){return B(J)}if(W===1)return X!==A?Promise.reject(X):Promise.resolve();if(X!==A)throw X}function B(Y){return X=X!==A?new D(Y,X):Y,Q()}return Q()}}}I.exports=U,I.exports.__esModule=!0,I.exports.default=I.exports}}),gV=T6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/OverloadYield.js"($,I){function U(D,A){this.v=D,this.k=A}I.exports=U,I.exports.__esModule=!0,I.exports.default=I.exports}}),qh=T6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/awaitAsyncGenerator.js"($,I){var U=gV();function D(A){return new U(A,0)}I.exports=D,I.exports.__esModule=!0,I.exports.default=I.exports}}),Fh=T6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/wrapAsyncGenerator.js"($,I){var U=gV();function D(w){return function(){return new A(w.apply(this,arguments))}}function A(w){var b,N;function O(W,Q){try{var B=w[W](Q),Y=B.value,J=Y instanceof U;Promise.resolve(J?Y.v:Y).then(function(H){if(J){var v=W==="return"?"return":"next";if(!Y.k||H.done)return O(v,H);H=w[v](H).value}X(B.done?"return":"normal",H)},function(H){O("throw",H)})}catch(H){X("throw",H)}}function X(W,Q){switch(W){case"return":b.resolve({value:Q,done:!0});break;case"throw":b.reject(Q);break;default:b.resolve({value:Q,done:!1})}(b=b.next)?O(b.key,b.arg):N=null}this._invoke=function(W,Q){return new Promise(function(B,Y){var J={key:W,arg:Q,resolve:B,reject:Y,next:null};N?N=N.next=J:(b=N=J,O(W,Q))})},typeof w.return!="function"&&(this.return=void 0)}A.prototype[typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},A.prototype.next=function(w){return this._invoke("next",w)},A.prototype.throw=function(w){return this._invoke("throw",w)},A.prototype.return=function(w){return this._invoke("return",w)},I.exports=D,I.exports.__esModule=!0,I.exports.default=I.exports}}),Qa=G$(vh(),1),Ya=G$(qh(),1),Ba=G$(Fh(),1),Ja=G$(_$(),1);class X9{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 yU{constructor($){this.generateIdentifier=$,this.kv=new X9}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 W9 extends yU{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 Eh($){if("values"in Object)return Object.values($);let I=[];for(let U in $)if($.hasOwnProperty(U))I.push($[U]);return I}function xV($,I){let U=Eh($);if("find"in U)return U.find(I);let D=U;for(let A=0;A<D.length;A++){let w=D[A];if(I(w))return w}return}function II($,I){Object.entries($).forEach(([U,D])=>I(D,U))}function rI($,I){return $.indexOf(I)!==-1}function G9($,I){for(let U=0;U<$.length;U++){let D=$[U];if(I(D))return D}return}class Q9{constructor(){this.transfomers={}}register($){this.transfomers[$.name]=$}findApplicable($){return xV(this.transfomers,(I)=>I.isApplicable($))}findByName($){return this.transfomers[$]}}var Sh=($)=>Object.prototype.toString.call($).slice(8,-1),Y9=($)=>typeof $==="undefined",jh=($)=>$===null,UI=($)=>{if(typeof $!=="object"||$===null)return!1;if($===Object.prototype)return!1;if(Object.getPrototypeOf($)===null)return!0;return Object.getPrototypeOf($)===Object.prototype},sD=($)=>UI($)&&Object.keys($).length===0,_6=($)=>Array.isArray($),kh=($)=>typeof $==="string",Ph=($)=>typeof $==="number"&&!isNaN($),Rh=($)=>typeof $==="boolean",hV=($)=>$ instanceof RegExp,j4=($)=>$ instanceof Map,k4=($)=>$ instanceof Set,B9=($)=>Sh($)==="Symbol",fV=($)=>$ instanceof Date&&!isNaN($.valueOf()),$w=($)=>$ instanceof Error,J9=($)=>typeof $==="number"&&isNaN($),yV=($)=>Rh($)||jh($)||Y9($)||Ph($)||kh($)||B9($),uV=($)=>typeof $==="bigint",lV=($)=>$===1/0||$===-1/0,cV=($)=>ArrayBuffer.isView($)&&!($ instanceof DataView),mV=($)=>$ instanceof URL;var Iw=($)=>$.replace(/\\/g,"\\\\").replace(/\./g,"\\."),Uw=($)=>$.map(String).map(Iw).join("."),iI=($,I)=>{let U=[],D="";for(let w=0;w<$.length;w++){let b=$.charAt(w);if(!I&&b==="\\"){let X=$.charAt(w+1);if(X==="\\"){D+="\\",w++;continue}else if(X!==".")throw Error("invalid path")}if(b==="\\"&&$.charAt(w+1)==="."){D+=".",w++;continue}if(b==="."){U.push(D),D="";continue}D+=b}let A=D;return U.push(A),U};function c6($,I,U,D){return{isApplicable:$,annotation:I,transform:U,untransform:D}}var rV=[c6(Y9,"undefined",()=>null,()=>{return}),c6(uV,"bigint",($)=>$.toString(),($)=>{if(typeof BigInt!=="undefined")return BigInt($);return console.error("Please add a BigInt polyfill."),$}),c6(fV,"Date",($)=>$.toISOString(),($)=>new Date($)),c6($w,"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}),c6(hV,"regexp",($)=>""+$,($)=>{let I=$.slice(1,$.lastIndexOf("/")),U=$.slice($.lastIndexOf("/")+1);return new RegExp(I,U)}),c6(k4,"set",($)=>[...$.values()],($)=>new Set($)),c6(j4,"map",($)=>[...$.entries()],($)=>new Map($)),c6(($)=>J9($)||lV($),"number",($)=>{if(J9($))return"NaN";if($>0)return"Infinity";else return"-Infinity"},Number),c6(($)=>$===0&&1/$===-1/0,"number",()=>{return"-0"},Number),c6(mV,"URL",($)=>$.toString(),($)=>new URL($))];function Aw($,I,U,D){return{isApplicable:$,annotation:I,transform:U,untransform:D}}var iV=Aw(($,I)=>{if(B9($))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}),Th=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce(($,I)=>{return $[I.name]=I,$},{}),nV=Aw(cV,($)=>["typed-array",$.constructor.name],($)=>[...$],($,I)=>{let U=Th[I[1]];if(!U)throw new Error("Trying to deserialize unknown typed array");return new U($)});function H9($,I){if($?.constructor)return!!I.classRegistry.getIdentifier($.constructor);return!1}var oV=Aw(H9,($,I)=>{return["class",I.classRegistry.getIdentifier($.constructor)]},($,I)=>{let U=I.classRegistry.getAllowedProps($.constructor);if(!U)return{...$};let D={};return U.forEach((A)=>{D[A]=$[A]}),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),$)}),dV=Aw(($,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($)}),_h=[oV,iV,dV,nV],L9=($,I)=>{let U=G9(_h,(A)=>A.isApplicable($,I));if(U)return{value:U.transform($,I),type:U.annotation($,I)};let D=G9(rV,(A)=>A.isApplicable($,I));if(D)return{value:D.transform($,I),type:D.annotation};return},pV={};rV.forEach(($)=>{pV[$.annotation]=$});var tV=($,I,U)=>{if(_6(I))switch(I[0]){case"symbol":return iV.untransform($,I,U);case"class":return oV.untransform($,I,U);case"custom":return dV.untransform($,I,U);case"typed-array":return nV.untransform($,I,U);default:throw new Error("Unknown transformation: "+I)}else{let D=pV[I];if(!D)throw new Error("Unknown transformation: "+I);return D.untransform($,U)}};var nI=($,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 aV($){if(rI($,"__proto__"))throw new Error("__proto__ is not allowed as a property");if(rI($,"prototype"))throw new Error("prototype is not allowed as a property");if(rI($,"constructor"))throw new Error("constructor is not allowed as a property")}var eV=($,I)=>{aV(I);for(let U=0;U<I.length;U++){let D=I[U];if(k4($))$=nI($,+D);else if(j4($)){let A=+D,w=+I[++U]===0?"key":"value",b=nI($,A);switch(w){case"key":$=b;break;case"value":$=$.get(b);break}}else $=$[D]}return $},Dw=($,I,U)=>{if(aV(I),I.length===0)return U($);let D=$;for(let w=0;w<I.length-1;w++){let b=I[w];if(_6(D)){let N=+b;D=D[N]}else if(UI(D))D=D[b];else if(k4(D)){let N=+b;D=nI(D,N)}else if(j4(D)){if(w===I.length-2)break;let O=+b,X=+I[++w]===0?"key":"value",W=nI(D,O);switch(X){case"key":D=W;break;case"value":D=D.get(W);break}}}let A=I[I.length-1];if(_6(D))D[+A]=U(D[+A]);else if(UI(D))D[A]=U(D[A]);if(k4(D)){let w=nI(D,+A),b=U(w);if(w!==b)D.delete(w),D.add(b)}if(j4(D)){let w=+I[I.length-2],b=nI(D,w);switch(+A===0?"key":"value"){case"key":{let O=U(b);if(D.set(O,D.get(b)),O!==b)D.delete(b);break}case"value":{D.set(b,U(D.get(b)));break}}}return $};var sV=($)=>$<1;function z9($,I,U,D=[]){if(!$)return;let A=sV(U);if(!_6($)){II($,(N,O)=>z9(N,I,U,[...D,...iI(O,A)]));return}let[w,b]=$;if(b)II(b,(N,O)=>{z9(N,I,U,[...D,...iI(O,A)])});I(w,D)}function $v($,I,U,D){return z9(I,(A,w)=>{$=Dw($,w,(b)=>tV(b,A,D))},U),$}function Iv($,I,U){let D=sV(U);function A(w,b){let N=eV($,iI(b,D));w.map((O)=>iI(O,D)).forEach((O)=>{$=Dw($,O,()=>N)})}if(_6(I)){let[w,b]=I;if(w.forEach((N)=>{$=Dw($,iI(N,D),()=>$)}),b)II(b,A)}else II(I,A);return $}var Ch=($,I)=>UI($)||_6($)||j4($)||k4($)||$w($)||H9($,I);function Zh($,I,U){let D=U.get($);if(D)D.push(I);else U.set($,[I])}function Uv($,I){let U={},D=void 0;if($.forEach((A)=>{if(A.length<=1)return;if(!I)A=A.map((N)=>N.map(String)).sort((N,O)=>N.length-O.length);let[w,...b]=A;if(w.length===0)D=b.map(Uw);else U[Uw(w)]=b.map(Uw)}),D)if(sD(U))return[D];else return[D,U];else return sD(U)?void 0:U}var M9=($,I,U,D,A=[],w=[],b=new Map)=>{let N=yV($);if(!N){Zh($,A,I);let Y=b.get($);if(Y)return D?{transformedValue:null}:Y}if(!Ch($,U)){let Y=L9($,U),J=Y?{transformedValue:Y.value,annotations:[Y.type]}:{transformedValue:$};if(!N)b.set($,J);return J}if(rI(w,$))return{transformedValue:null};let O=L9($,U),X=O?.value??$,W=_6(X)?[]:{},Q={};II(X,(Y,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 H=M9(Y,I,U,D,[...A,J],[...w,$],b);if(W[J]=H.transformedValue,_6(H.annotations))Q[Iw(J)]=H.annotations;else if(UI(H.annotations))II(H.annotations,(v,V)=>{Q[Iw(J)+"."+V]=v})});let B=sD(Q)?{transformedValue:W,annotations:O?[O.type]:void 0}:{transformedValue:W,annotations:O?[O.type,Q]:Q};if(!N)b.set($,B);return B};function ww($){return Object.prototype.toString.call($).slice(8,-1)}function bw($){return ww($)==="Array"}function K9($){if(ww($)!=="Object")return!1;let I=Object.getPrototypeOf($);return!!I&&I.constructor===Object&&I===Object.prototype}function gh($,I,U,D,A){let w={}.propertyIsEnumerable.call(D,I)?"enumerable":"nonenumerable";if(w==="enumerable")$[I]=U;if(A&&w==="nonenumerable")Object.defineProperty($,I,{value:U,enumerable:!1,writable:!0,configurable:!0})}function Nw($,I={}){if(bw($))return $.map((A)=>Nw(A,I));if(!K9($))return $;let U=Object.getOwnPropertyNames($),D=Object.getOwnPropertySymbols($);return[...U,...D].reduce((A,w)=>{if(w==="__proto__")return A;if(bw(I.props)&&!I.props.includes(w))return A;let b=$[w],N=Nw(b,I);return gh(A,w,N,$,I.nonenumerable),A},{})}class U${constructor({dedupe:$=!1}={}){this.classRegistry=new W9,this.symbolRegistry=new yU((I)=>I.description??""),this.customTransformerRegistry=new Q9,this.allowedErrorProps=[],this.dedupe=$}serialize($){let I=new Map,U=M9($,I,this,this.dedupe),D={json:U.transformedValue};if(U.annotations)D.meta={...D.meta,values:U.annotations};let A=Uv(I,this.dedupe);if(A)D.meta={...D.meta,referentialEqualities:A};if(D.meta)D.meta.v=1;return D}deserialize($,I){let{json:U,meta:D}=$,A=I?.inPlace?U:Nw(U);if(D?.values)A=$v(A,D.values,D.v??0,this);if(D?.referentialEqualities)A=Iv(A,D.referentialEqualities,D.v??0);return A}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(...$)}}U$.defaultInstance=new U$;U$.serialize=U$.defaultInstance.serialize.bind(U$.defaultInstance);U$.deserialize=U$.defaultInstance.deserialize.bind(U$.defaultInstance);U$.stringify=U$.defaultInstance.stringify.bind(U$.defaultInstance);U$.parse=U$.defaultInstance.parse.bind(U$.defaultInstance);U$.registerClass=U$.defaultInstance.registerClass.bind(U$.defaultInstance);U$.registerSymbol=U$.defaultInstance.registerSymbol.bind(U$.defaultInstance);U$.registerCustom=U$.defaultInstance.registerCustom.bind(U$.defaultInstance);U$.allowErrorProps=U$.defaultInstance.allowErrorProps.bind(U$.defaultInstance);var Av=U$;var{serialize:Ue,deserialize:Ae,stringify:De,parse:we,registerClass:be,registerCustom:Ne,registerSymbol:Oe,allowErrorProps:Xe}=U$;class V9{trpc;constructor($){this.trpc=ZV({links:[b9({url:`${$.apiUrl}/trpc`,transformer:Av,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 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 v9($="SURA MCP"){return{info:(I,...U)=>{},error:(I,...U)=>{},warn:(I,...U)=>{},debug:(I,...U)=>{if(process.env.DEBUG);}}}var D4=v9();async function Dv($){let I=v9();I.info("Initializing server context...");let U=new V9({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 A={userId:D,client:U,log:I};try{I.info("Loading workspace context..."),A.workspaceContext=await U.getWorkspaceContext();let w=A.workspaceContext.orgs.length,b=A.workspaceContext.orgs.reduce((N,O)=>N+O.workspaces.length,0);I.info(`Workspace context loaded: ${w} org(s), ${b} workspace(s)`)}catch(w){I.warn("Failed to load workspace context at startup (will retry on first tool call):",w)}return A}var G={};K6(G,{xor:()=>Rq,xid:()=>sv,void:()=>Fq,uuidv7:()=>iv,uuidv6:()=>rv,uuidv4:()=>mv,uuid:()=>cv,util:()=>j,url:()=>nv,uppercase:()=>D1,unknown:()=>WI,union:()=>Cb,undefined:()=>vq,ulid:()=>ev,uint64:()=>Kq,uint32:()=>Lq,tuple:()=>yB,trim:()=>W1,treeifyError:()=>Z9,transform:()=>gb,toUpperCase:()=>Q1,toLowerCase:()=>G1,toJSONSchema:()=>bb,templateLiteral:()=>mq,symbol:()=>Vq,superRefine:()=>W7,success:()=>uq,stringbool:()=>aq,stringFormat:()=>Wq,string:()=>Qb,strictObject:()=>kq,startsWith:()=>b1,slugify:()=>Y1,size:()=>I1,setErrorMap:()=>zu,set:()=>gq,safeParseAsync:()=>YB,safeParse:()=>QB,safeEncodeAsync:()=>KB,safeEncode:()=>zB,safeDecodeAsync:()=>VB,safeDecode:()=>MB,registry:()=>_w,regexes:()=>M6,regex:()=>U1,refine:()=>X7,record:()=>uB,readonly:()=>A7,property:()=>Ab,promise:()=>rq,prettifyError:()=>g9,preprocess:()=>sq,prefault:()=>tB,positive:()=>sw,pipe:()=>Y0,partialRecord:()=>_q,parseAsync:()=>GB,parse:()=>WB,overwrite:()=>C6,optional:()=>G0,object:()=>jq,number:()=>qB,nullish:()=>yq,nullable:()=>Q0,null:()=>kB,normalize:()=>X1,nonpositive:()=>Ib,nonoptional:()=>aB,nonnegative:()=>Ub,never:()=>_b,negative:()=>$b,nativeEnum:()=>xq,nanoid:()=>pv,nan:()=>lq,multipleOf:()=>Z4,minSize:()=>g4,minLength:()=>w4,mime:()=>O1,meta:()=>pq,maxSize:()=>NI,maxLength:()=>OI,map:()=>Zq,mac:()=>Uq,lte:()=>W6,lt:()=>r6,lowercase:()=>A1,looseRecord:()=>Cq,looseObject:()=>Pq,locales:()=>b0,literal:()=>hq,length:()=>XI,lazy:()=>b7,ksuid:()=>$q,keyof:()=>Sq,jwt:()=>Xq,json:()=>eq,iso:()=>H1,ipv6:()=>Aq,ipv4:()=>Iq,intersection:()=>hB,int64:()=>Mq,int32:()=>Hq,int:()=>Yb,instanceof:()=>tq,includes:()=>w1,httpUrl:()=>ov,hostname:()=>Gq,hex:()=>Qq,hash:()=>Yq,guid:()=>lv,gte:()=>p$,gt:()=>i6,globalRegistry:()=>d$,getErrorMap:()=>Mu,function:()=>iq,fromJSONSchema:()=>IF,formatError:()=>pU,float64:()=>Jq,float32:()=>Bq,flattenError:()=>dU,file:()=>fq,enum:()=>Zb,endsWith:()=>N1,encodeAsync:()=>HB,encode:()=>BB,emoji:()=>dv,email:()=>uv,e164:()=>Oq,discriminatedUnion:()=>Tq,describe:()=>dq,decodeAsync:()=>LB,decode:()=>JB,date:()=>Eq,custom:()=>oq,cuid2:()=>av,cuid:()=>tv,core:()=>b4,config:()=>k$,coerce:()=>Q7,codec:()=>cq,clone:()=>o$,cidrv6:()=>wq,cidrv4:()=>Dq,check:()=>nq,catch:()=>$7,boolean:()=>FB,bigint:()=>zq,base64url:()=>Nq,base64:()=>bq,array:()=>H0,any:()=>qq,_function:()=>iq,_default:()=>dB,_ZodString:()=>Bb,ZodXor:()=>ZB,ZodXID:()=>Vb,ZodVoid:()=>_B,ZodUnknown:()=>RB,ZodUnion:()=>z0,ZodUndefined:()=>SB,ZodUUID:()=>n6,ZodURL:()=>B0,ZodULID:()=>Kb,ZodType:()=>t,ZodTuple:()=>fB,ZodTransform:()=>iB,ZodTemplateLiteral:()=>D7,ZodSymbol:()=>EB,ZodSuccess:()=>eB,ZodStringFormat:()=>Y$,ZodString:()=>z1,ZodSet:()=>cB,ZodRecord:()=>M0,ZodRealError:()=>D6,ZodReadonly:()=>U7,ZodPromise:()=>N7,ZodPrefault:()=>pB,ZodPipe:()=>fb,ZodOptional:()=>xb,ZodObject:()=>L0,ZodNumberFormat:()=>GI,ZodNumber:()=>K1,ZodNullable:()=>nB,ZodNull:()=>jB,ZodNonOptional:()=>hb,ZodNever:()=>TB,ZodNanoID:()=>Lb,ZodNaN:()=>I7,ZodMap:()=>lB,ZodMAC:()=>vB,ZodLiteral:()=>mB,ZodLazy:()=>w7,ZodKSUID:()=>vb,ZodJWT:()=>Rb,ZodIssueCode:()=>Lu,ZodIntersection:()=>xB,ZodISOTime:()=>Wb,ZodISODuration:()=>Gb,ZodISODateTime:()=>Ob,ZodISODate:()=>Xb,ZodIPv6:()=>Fb,ZodIPv4:()=>qb,ZodGUID:()=>W0,ZodFunction:()=>O7,ZodFirstPartyTypeKind:()=>G7,ZodFile:()=>rB,ZodError:()=>Ju,ZodEnum:()=>L1,ZodEmoji:()=>Hb,ZodEmail:()=>Jb,ZodE164:()=>Pb,ZodDiscriminatedUnion:()=>gB,ZodDefault:()=>oB,ZodDate:()=>J0,ZodCustomStringFormat:()=>M1,ZodCustom:()=>K0,ZodCodec:()=>yb,ZodCatch:()=>sB,ZodCUID2:()=>Mb,ZodCUID:()=>zb,ZodCIDRv6:()=>Sb,ZodCIDRv4:()=>Eb,ZodBoolean:()=>V1,ZodBigIntFormat:()=>Tb,ZodBigInt:()=>v1,ZodBase64URL:()=>kb,ZodBase64:()=>jb,ZodArray:()=>CB,ZodAny:()=>PB,TimePrecision:()=>fQ,NEVER:()=>q9,$output:()=>_Q,$input:()=>CQ,$brand:()=>F9});var b4={};K6(b4,{version:()=>TG,util:()=>j,treeifyError:()=>Z9,toJSONSchema:()=>bb,toDotPath:()=>Wv,safeParseAsync:()=>h9,safeParse:()=>x9,safeEncodeAsync:()=>Bf,safeEncode:()=>Qf,safeDecodeAsync:()=>Jf,safeDecode:()=>Yf,registry:()=>_w,regexes:()=>M6,process:()=>X$,prettifyError:()=>g9,parseAsync:()=>Gw,parse:()=>Ww,meta:()=>zY,locales:()=>b0,isValidJWT:()=>Pv,isValidBase64URL:()=>kv,isValidBase64:()=>sG,initializeContext:()=>x4,globalRegistry:()=>d$,globalConfig:()=>uU,formatError:()=>pU,flattenError:()=>dU,finalize:()=>f4,extractDefs:()=>h4,encodeAsync:()=>Wf,encode:()=>Of,describe:()=>LY,decodeAsync:()=>Gf,decode:()=>Xf,createToJSONSchemaMethod:()=>KY,createStandardJSONSchemaMethod:()=>J1,config:()=>k$,clone:()=>o$,_xor:()=>iy,_xid:()=>mw,_void:()=>OY,_uuidv7:()=>hw,_uuidv6:()=>xw,_uuidv4:()=>gw,_uuid:()=>Zw,_url:()=>O0,_uppercase:()=>D1,_unknown:()=>bY,_union:()=>ry,_undefined:()=>AY,_ulid:()=>cw,_uint64:()=>IY,_uint32:()=>pQ,_tuple:()=>dy,_trim:()=>W1,_transform:()=>Iu,_toUpperCase:()=>Q1,_toLowerCase:()=>G1,_templateLiteral:()=>Wu,_symbol:()=>UY,_superRefine:()=>HY,_success:()=>bu,_stringbool:()=>MY,_stringFormat:()=>B1,_string:()=>gQ,_startsWith:()=>b1,_slugify:()=>Y1,_size:()=>I1,_set:()=>ay,_safeParseAsync:()=>sI,_safeParse:()=>eI,_safeEncodeAsync:()=>zw,_safeEncode:()=>Hw,_safeDecodeAsync:()=>Mw,_safeDecode:()=>Lw,_regex:()=>U1,_refine:()=>JY,_record:()=>py,_readonly:()=>Xu,_property:()=>Ab,_promise:()=>Qu,_positive:()=>sw,_pipe:()=>Ou,_parseAsync:()=>aI,_parse:()=>tI,_overwrite:()=>C6,_optional:()=>Uu,_number:()=>mQ,_nullable:()=>Au,_null:()=>DY,_normalize:()=>X1,_nonpositive:()=>Ib,_nonoptional:()=>wu,_nonnegative:()=>Ub,_never:()=>NY,_negative:()=>$b,_nativeEnum:()=>sy,_nanoid:()=>yw,_nan:()=>GY,_multipleOf:()=>Z4,_minSize:()=>g4,_minLength:()=>w4,_min:()=>p$,_mime:()=>O1,_maxSize:()=>NI,_maxLength:()=>OI,_max:()=>W6,_map:()=>ty,_mac:()=>hQ,_lte:()=>W6,_lt:()=>r6,_lowercase:()=>A1,_literal:()=>$u,_length:()=>XI,_lazy:()=>Gu,_ksuid:()=>rw,_jwt:()=>ew,_isoTime:()=>lQ,_isoDuration:()=>cQ,_isoDateTime:()=>yQ,_isoDate:()=>uQ,_ipv6:()=>nw,_ipv4:()=>iw,_intersection:()=>oy,_int64:()=>$Y,_int32:()=>dQ,_int:()=>iQ,_includes:()=>w1,_guid:()=>N0,_gte:()=>p$,_gt:()=>i6,_float64:()=>oQ,_float32:()=>nQ,_file:()=>YY,_enum:()=>ey,_endsWith:()=>N1,_encodeAsync:()=>Bw,_encode:()=>Qw,_emoji:()=>fw,_email:()=>Cw,_e164:()=>aw,_discriminatedUnion:()=>ny,_default:()=>Du,_decodeAsync:()=>Jw,_decode:()=>Yw,_date:()=>XY,_custom:()=>BY,_cuid2:()=>lw,_cuid:()=>uw,_coercedString:()=>xQ,_coercedNumber:()=>rQ,_coercedDate:()=>WY,_coercedBoolean:()=>aQ,_coercedBigint:()=>sQ,_cidrv6:()=>dw,_cidrv4:()=>ow,_check:()=>hv,_catch:()=>Nu,_boolean:()=>tQ,_bigint:()=>eQ,_base64url:()=>tw,_base64:()=>pw,_array:()=>QY,_any:()=>wY,TimePrecision:()=>fQ,NEVER:()=>q9,JSONSchemaGenerator:()=>wB,JSONSchema:()=>fv,Doc:()=>qw,$output:()=>_Q,$input:()=>CQ,$constructor:()=>L,$brand:()=>F9,$ZodXor:()=>L8,$ZodXID:()=>cG,$ZodVoid:()=>Y8,$ZodUnknown:()=>G8,$ZodUnion:()=>sU,$ZodUndefined:()=>O8,$ZodUUID:()=>ZG,$ZodURL:()=>xG,$ZodULID:()=>lG,$ZodType:()=>o,$ZodTuple:()=>Tw,$ZodTransform:()=>S8,$ZodTemplateLiteral:()=>h8,$ZodSymbol:()=>N8,$ZodSuccess:()=>_8,$ZodStringFormat:()=>Q$,$ZodString:()=>bI,$ZodSet:()=>v8,$ZodRegistry:()=>ZQ,$ZodRecord:()=>K8,$ZodRealError:()=>A6,$ZodReadonly:()=>x8,$ZodPromise:()=>y8,$ZodPrefault:()=>R8,$ZodPipe:()=>g8,$ZodOptional:()=>j8,$ZodObjectJIT:()=>H8,$ZodObject:()=>_v,$ZodNumberFormat:()=>w8,$ZodNumber:()=>Pw,$ZodNullable:()=>k8,$ZodNull:()=>X8,$ZodNonOptional:()=>T8,$ZodNever:()=>Q8,$ZodNanoID:()=>fG,$ZodNaN:()=>Z8,$ZodMap:()=>V8,$ZodMAC:()=>tG,$ZodLiteral:()=>F8,$ZodLazy:()=>u8,$ZodKSUID:()=>mG,$ZodJWT:()=>A8,$ZodIntersection:()=>M8,$ZodISOTime:()=>nG,$ZodISODuration:()=>oG,$ZodISODateTime:()=>rG,$ZodISODate:()=>iG,$ZodIPv6:()=>pG,$ZodIPv4:()=>dG,$ZodGUID:()=>CG,$ZodFunction:()=>f8,$ZodFile:()=>E8,$ZodError:()=>oU,$ZodEnum:()=>q8,$ZodEncodeError:()=>AI,$ZodEmoji:()=>hG,$ZodEmail:()=>gG,$ZodE164:()=>U8,$ZodDiscriminatedUnion:()=>z8,$ZodDefault:()=>P8,$ZodDate:()=>B8,$ZodCustomStringFormat:()=>D8,$ZodCustom:()=>l8,$ZodCodec:()=>$0,$ZodCheckUpperCase:()=>FG,$ZodCheckStringFormat:()=>$1,$ZodCheckStartsWith:()=>SG,$ZodCheckSizeEquals:()=>zG,$ZodCheckRegex:()=>vG,$ZodCheckProperty:()=>kG,$ZodCheckOverwrite:()=>RG,$ZodCheckNumberFormat:()=>BG,$ZodCheckMultipleOf:()=>YG,$ZodCheckMinSize:()=>LG,$ZodCheckMinLength:()=>KG,$ZodCheckMimeType:()=>PG,$ZodCheckMaxSize:()=>HG,$ZodCheckMaxLength:()=>MG,$ZodCheckLowerCase:()=>qG,$ZodCheckLessThan:()=>Vw,$ZodCheckLengthEquals:()=>VG,$ZodCheckIncludes:()=>EG,$ZodCheckGreaterThan:()=>vw,$ZodCheckEndsWith:()=>jG,$ZodCheckBigIntFormat:()=>JG,$ZodCheck:()=>J$,$ZodCatch:()=>C8,$ZodCUID2:()=>uG,$ZodCUID:()=>yG,$ZodCIDRv6:()=>eG,$ZodCIDRv4:()=>aG,$ZodBoolean:()=>eU,$ZodBigIntFormat:()=>b8,$ZodBigInt:()=>Rw,$ZodBase64URL:()=>I8,$ZodBase64:()=>$8,$ZodAsyncError:()=>m6,$ZodArray:()=>J8,$ZodAny:()=>W8});var q9=Object.freeze({status:"aborted"});function L($,I,U){function D(N,O){if(!N._zod)Object.defineProperty(N,"_zod",{value:{def:O,constr:b,traits:new Set},enumerable:!1});if(N._zod.traits.has($))return;N._zod.traits.add($),I(N,O);let X=b.prototype,W=Object.keys(X);for(let Q=0;Q<W.length;Q++){let B=W[Q];if(!(B in N))N[B]=X[B].bind(N)}}let A=U?.Parent??Object;class w extends A{}Object.defineProperty(w,"name",{value:$});function b(N){var O;let X=U?.Parent?new w:this;D(X,N),(O=X._zod).deferred??(O.deferred=[]);for(let W of X._zod.deferred)W();return X}return Object.defineProperty(b,"init",{value:D}),Object.defineProperty(b,Symbol.hasInstance,{value:(N)=>{if(U?.Parent&&N instanceof U.Parent)return!0;return N?._zod?.traits?.has($)}}),Object.defineProperty(b,"name",{value:$}),b}var F9=Symbol("zod_brand");class m6 extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class AI extends Error{constructor($){super(`Encountered unidirectional transform during encode: ${$}`);this.name="ZodEncodeError"}}var uU={};function k$($){if($)Object.assign(uU,$);return uU}var j={};K6(j,{unwrapMessage:()=>lU,uint8ArrayToHex:()=>bf,uint8ArrayToBase64url:()=>Df,uint8ArrayToBase64:()=>Nv,stringifyPrimitive:()=>S,slugify:()=>j9,shallowClone:()=>P9,safeExtend:()=>eh,required:()=>If,randomString:()=>ih,propertyKeyTypes:()=>rU,promiseAllObject:()=>rh,primitiveTypes:()=>R9,prefixIssues:()=>X6,pick:()=>ph,partial:()=>$f,optionalKeys:()=>T9,omit:()=>th,objectClone:()=>lh,numKeys:()=>nh,nullish:()=>P4,normalizeParams:()=>P,mergeDefs:()=>T4,merge:()=>sh,jsonStringifyReplacer:()=>oI,joinValues:()=>z,issue:()=>pI,isPlainObject:()=>_4,isObject:()=>DI,hexToUint8Array:()=>wf,getSizableOrigin:()=>iU,getParsedType:()=>oh,getLengthableOrigin:()=>nU,getEnumValues:()=>cU,getElementAtPath:()=>mh,floatSafeRemainder:()=>S9,finalizeIssue:()=>U6,extend:()=>ah,escapeRegex:()=>z6,esc:()=>Ow,defineLazy:()=>s,createTransparentProxy:()=>dh,cloneDef:()=>ch,clone:()=>o$,cleanRegex:()=>mU,cleanEnum:()=>Uf,captureStackTrace:()=>Xw,cached:()=>dI,base64urlToUint8Array:()=>Af,base64ToUint8Array:()=>bv,assignProp:()=>R4,assertNotEqual:()=>hh,assertNever:()=>yh,assertIs:()=>fh,assertEqual:()=>xh,assert:()=>uh,allowsEval:()=>k9,aborted:()=>C4,NUMBER_FORMAT_RANGES:()=>_9,Class:()=>Ov,BIGINT_FORMAT_RANGES:()=>C9});function xh($){return $}function hh($){return $}function fh($){}function yh($){throw new Error("Unexpected value in exhaustive check")}function uh($){}function cU($){let I=Object.values($).filter((D)=>typeof D==="number");return Object.entries($).filter(([D,A])=>I.indexOf(+D)===-1).map(([D,A])=>A)}function z($,I="|"){return $.map((U)=>S(U)).join(I)}function oI($,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 P4($){return $===null||$===void 0}function mU($){let I=$.startsWith("^")?1:0,U=$.endsWith("$")?$.length-1:$.length;return $.slice(I,U)}function S9($,I){let U=($.toString().split(".")[1]||"").length,D=I.toString(),A=(D.split(".")[1]||"").length;if(A===0&&/\d?e-\d?/.test(D)){let O=D.match(/\d?e-(\d?)/);if(O?.[1])A=Number.parseInt(O[1])}let w=U>A?U:A,b=Number.parseInt($.toFixed(w).replace(".","")),N=Number.parseInt(I.toFixed(w).replace(".",""));return b%N/10**w}var wv=Symbol("evaluating");function s($,I,U){let D=void 0;Object.defineProperty($,I,{get(){if(D===wv)return;if(D===void 0)D=wv,D=U();return D},set(A){Object.defineProperty($,I,{value:A})},configurable:!0})}function lh($){return Object.create(Object.getPrototypeOf($),Object.getOwnPropertyDescriptors($))}function R4($,I,U){Object.defineProperty($,I,{value:U,writable:!0,enumerable:!0,configurable:!0})}function T4(...$){let I={};for(let U of $){let D=Object.getOwnPropertyDescriptors(U);Object.assign(I,D)}return Object.defineProperties({},I)}function ch($){return T4($._zod.def)}function mh($,I){if(!I)return $;return I.reduce((U,D)=>U?.[D],$)}function rh($){let I=Object.keys($),U=I.map((D)=>$[D]);return Promise.all(U).then((D)=>{let A={};for(let w=0;w<I.length;w++)A[I[w]]=D[w];return A})}function ih($=10){let U="";for(let D=0;D<$;D++)U+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return U}function Ow($){return JSON.stringify($)}function j9($){return $.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Xw="captureStackTrace"in Error?Error.captureStackTrace:(...$)=>{};function DI($){return typeof $==="object"&&$!==null&&!Array.isArray($)}var k9=dI(()=>{if(typeof navigator!=="undefined"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch($){return!1}});function _4($){if(DI($)===!1)return!1;let I=$.constructor;if(I===void 0)return!0;if(typeof I!=="function")return!0;let U=I.prototype;if(DI(U)===!1)return!1;if(Object.prototype.hasOwnProperty.call(U,"isPrototypeOf")===!1)return!1;return!0}function P9($){if(_4($))return{...$};if(Array.isArray($))return[...$];return $}function nh($){let I=0;for(let U in $)if(Object.prototype.hasOwnProperty.call($,U))I++;return I}var oh=($)=>{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}`)}},rU=new Set(["string","number","symbol"]),R9=new Set(["string","number","bigint","boolean","symbol","undefined"]);function z6($){return $.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function o$($,I,U){let D=new $._zod.constr(I??$._zod.def);if(!I||U?.parent)D._zod.parent=$;return D}function P($){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 dh($){let I;return new Proxy({},{get(U,D,A){return I??(I=$()),Reflect.get(I,D,A)},set(U,D,A,w){return I??(I=$()),Reflect.set(I,D,A,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,A){return I??(I=$()),Reflect.defineProperty(I,D,A)}})}function S($){if(typeof $==="bigint")return $.toString()+"n";if(typeof $==="string")return`"${$}"`;return`${$}`}function T9($){return Object.keys($).filter((I)=>{return $[I]._zod.optin==="optional"&&$[I]._zod.optout==="optional"})}var _9={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]},C9={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function ph($,I){let U=$._zod.def,D=T4($._zod.def,{get shape(){let A={};for(let w in I){if(!(w in U.shape))throw new Error(`Unrecognized key: "${w}"`);if(!I[w])continue;A[w]=U.shape[w]}return R4(this,"shape",A),A},checks:[]});return o$($,D)}function th($,I){let U=$._zod.def,D=T4($._zod.def,{get shape(){let A={...$._zod.def.shape};for(let w in I){if(!(w in U.shape))throw new Error(`Unrecognized key: "${w}"`);if(!I[w])continue;delete A[w]}return R4(this,"shape",A),A},checks:[]});return o$($,D)}function ah($,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 A=T4($._zod.def,{get shape(){let w={...$._zod.def.shape,...I};return R4(this,"shape",w),w},checks:[]});return o$($,A)}function eh($,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 R4(this,"shape",D),D},checks:$._zod.def.checks};return o$($,U)}function sh($,I){let U=T4($._zod.def,{get shape(){let D={...$._zod.def.shape,...I._zod.def.shape};return R4(this,"shape",D),D},get catchall(){return I._zod.def.catchall},checks:[]});return o$($,U)}function $f($,I,U){let D=T4(I._zod.def,{get shape(){let A=I._zod.def.shape,w={...A};if(U)for(let b in U){if(!(b in A))throw new Error(`Unrecognized key: "${b}"`);if(!U[b])continue;w[b]=$?new $({type:"optional",innerType:A[b]}):A[b]}else for(let b in A)w[b]=$?new $({type:"optional",innerType:A[b]}):A[b];return R4(this,"shape",w),w},checks:[]});return o$(I,D)}function If($,I,U){let D=T4(I._zod.def,{get shape(){let A=I._zod.def.shape,w={...A};if(U)for(let b in U){if(!(b in w))throw new Error(`Unrecognized key: "${b}"`);if(!U[b])continue;w[b]=new $({type:"nonoptional",innerType:A[b]})}else for(let b in A)w[b]=new $({type:"nonoptional",innerType:A[b]});return R4(this,"shape",w),w},checks:[]});return o$(I,D)}function C4($,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 X6($,I){return I.map((U)=>{var D;return(D=U).path??(D.path=[]),U.path.unshift($),U})}function lU($){return typeof $==="string"?$:$?.message}function U6($,I,U){let D={...$,path:$.path??[]};if(!$.message){let A=lU($.inst?._zod.def?.error?.($))??lU(I?.error?.($))??lU(U.customError?.($))??lU(U.localeError?.($))??"Invalid input";D.message=A}if(delete D.inst,delete D.continue,!I?.reportInput)delete D.input;return D}function iU($){if($ instanceof Set)return"set";if($ instanceof Map)return"map";if($ instanceof File)return"file";return"unknown"}function nU($){if(Array.isArray($))return"array";if(typeof $==="string")return"string";return"unknown"}function pI(...$){let[I,U,D]=$;if(typeof I==="string")return{message:I,code:"custom",input:U,inst:D};return{...I}}function Uf($){return Object.entries($).filter(([I,U])=>{return Number.isNaN(Number.parseInt(I,10))}).map((I)=>I[1])}function bv($){let I=atob($),U=new Uint8Array(I.length);for(let D=0;D<I.length;D++)U[D]=I.charCodeAt(D);return U}function Nv($){let I="";for(let U=0;U<$.length;U++)I+=String.fromCharCode($[U]);return btoa(I)}function Af($){let I=$.replace(/-/g,"+").replace(/_/g,"/"),U="=".repeat((4-I.length%4)%4);return bv(I+U)}function Df($){return Nv($).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function wf($){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 bf($){return Array.from($).map((I)=>I.toString(16).padStart(2,"0")).join("")}class Ov{constructor(...$){}}var Xv=($,I)=>{$.name="$ZodError",Object.defineProperty($,"_zod",{value:$._zod,enumerable:!1}),Object.defineProperty($,"issues",{value:I,enumerable:!1}),$.message=JSON.stringify(I,oI,2),Object.defineProperty($,"toString",{value:()=>$.message,enumerable:!1})},oU=L("$ZodError",Xv),A6=L("$ZodError",Xv,{Parent:Error});function dU($,I=(U)=>U.message){let U={},D=[];for(let A of $.issues)if(A.path.length>0)U[A.path[0]]=U[A.path[0]]||[],U[A.path[0]].push(I(A));else D.push(I(A));return{formErrors:D,fieldErrors:U}}function pU($,I=(U)=>U.message){let U={_errors:[]},D=(A)=>{for(let w of A.issues)if(w.code==="invalid_union"&&w.errors.length)w.errors.map((b)=>D({issues:b}));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 b=U,N=0;while(N<w.path.length){let O=w.path[N];if(N!==w.path.length-1)b[O]=b[O]||{_errors:[]};else b[O]=b[O]||{_errors:[]},b[O]._errors.push(I(w));b=b[O],N++}}};return D($),U}function Z9($,I=(U)=>U.message){let U={errors:[]},D=(A,w=[])=>{var b,N;for(let O of A.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 W=U,Q=0;while(Q<X.length){let B=X[Q],Y=Q===X.length-1;if(typeof B==="string")W.properties??(W.properties={}),(b=W.properties)[B]??(b[B]={errors:[]}),W=W.properties[B];else W.items??(W.items=[]),(N=W.items)[B]??(N[B]={errors:[]}),W=W.items[B];if(Y)W.errors.push(I(O));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 g9($){let I=[],U=[...$.issues].sort((D,A)=>(D.path??[]).length-(A.path??[]).length);for(let D of U)if(I.push(`✖ ${D.message}`),D.path?.length)I.push(` → at ${Wv(D.path)}`);return I.join(`
43
- `)}var tI=($)=>(I,U,D,A)=>{let w=D?Object.assign(D,{async:!1}):{async:!1},b=I._zod.run({value:U,issues:[]},w);if(b instanceof Promise)throw new m6;if(b.issues.length){let N=new(A?.Err??$)(b.issues.map((O)=>U6(O,w,k$())));throw Xw(N,A?.callee),N}return b.value},Ww=tI(A6),aI=($)=>async(I,U,D,A)=>{let w=D?Object.assign(D,{async:!0}):{async:!0},b=I._zod.run({value:U,issues:[]},w);if(b instanceof Promise)b=await b;if(b.issues.length){let N=new(A?.Err??$)(b.issues.map((O)=>U6(O,w,k$())));throw Xw(N,A?.callee),N}return b.value},Gw=aI(A6),eI=($)=>(I,U,D)=>{let A=D?{...D,async:!1}:{async:!1},w=I._zod.run({value:U,issues:[]},A);if(w instanceof Promise)throw new m6;return w.issues.length?{success:!1,error:new($??oU)(w.issues.map((b)=>U6(b,A,k$())))}:{success:!0,data:w.value}},x9=eI(A6),sI=($)=>async(I,U,D)=>{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;return w.issues.length?{success:!1,error:new $(w.issues.map((b)=>U6(b,A,k$())))}:{success:!0,data:w.value}},h9=sI(A6),Qw=($)=>(I,U,D)=>{let A=D?Object.assign(D,{direction:"backward"}):{direction:"backward"};return tI($)(I,U,A)},Of=Qw(A6),Yw=($)=>(I,U,D)=>{return tI($)(I,U,D)},Xf=Yw(A6),Bw=($)=>async(I,U,D)=>{let A=D?Object.assign(D,{direction:"backward"}):{direction:"backward"};return aI($)(I,U,A)},Wf=Bw(A6),Jw=($)=>async(I,U,D)=>{return aI($)(I,U,D)},Gf=Jw(A6),Hw=($)=>(I,U,D)=>{let A=D?Object.assign(D,{direction:"backward"}):{direction:"backward"};return eI($)(I,U,A)},Qf=Hw(A6),Lw=($)=>(I,U,D)=>{return eI($)(I,U,D)},Yf=Lw(A6),zw=($)=>async(I,U,D)=>{let A=D?Object.assign(D,{direction:"backward"}):{direction:"backward"};return sI($)(I,U,A)},Bf=zw(A6),Mw=($)=>async(I,U,D)=>{return sI($)(I,U,D)},Jf=Mw(A6);var M6={};K6(M6,{xid:()=>l9,uuid7:()=>Mf,uuid6:()=>zf,uuid4:()=>Lf,uuid:()=>wI,uppercase:()=>QG,unicodeEmail:()=>Gv,undefined:()=>WG,ulid:()=>u9,time:()=>UG,string:()=>DG,sha512_hex:()=>uf,sha512_base64url:()=>cf,sha512_base64:()=>lf,sha384_hex:()=>hf,sha384_base64url:()=>yf,sha384_base64:()=>ff,sha256_hex:()=>Zf,sha256_base64url:()=>xf,sha256_base64:()=>gf,sha1_hex:()=>Tf,sha1_base64url:()=>Cf,sha1_base64:()=>_f,rfc5322Email:()=>Vf,number:()=>NG,null:()=>XG,nanoid:()=>m9,md5_hex:()=>kf,md5_base64url:()=>Rf,md5_base64:()=>Pf,mac:()=>t9,lowercase:()=>GG,ksuid:()=>c9,ipv6:()=>p9,ipv4:()=>d9,integer:()=>bG,idnEmail:()=>vf,html5Email:()=>Kf,hostname:()=>Ef,hex:()=>jf,guid:()=>i9,extendedDuration:()=>Hf,emoji:()=>o9,email:()=>n9,e164:()=>$G,duration:()=>r9,domain:()=>Sf,datetime:()=>AG,date:()=>IG,cuid2:()=>y9,cuid:()=>f9,cidrv6:()=>e9,cidrv4:()=>a9,browserEmail:()=>qf,boolean:()=>OG,bigint:()=>wG,base64url:()=>Kw,base64:()=>s9});var f9=/^[cC][^\s-]{8,}$/,y9=/^[0-9a-z]+$/,u9=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,l9=/^[0-9a-vA-V]{20}$/,c9=/^[A-Za-z0-9]{27}$/,m9=/^[a-zA-Z0-9_-]{21}$/,r9=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Hf=/^[-+]?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)?)??$/,i9=/^([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})$/,wI=($)=>{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})$`)},Lf=wI(4),zf=wI(6),Mf=wI(7),n9=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Kf=/^[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])?)*$/,Vf=/^(([^<>()\[\]\\.,;:\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,}))$/,Gv=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,vf=Gv,qf=/^[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])?)*$/,Ff="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function o9(){return new RegExp(Ff,"u")}var d9=/^(?:(?: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])$/,p9=/^(([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}|:))$/,t9=($)=>{let I=z6($??":");return new RegExp(`^(?:[0-9A-F]{2}${I}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${I}){5}[0-9a-f]{2}$`)},a9=/^((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])$/,e9=/^(([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])$/,s9=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Kw=/^[A-Za-z0-9_-]*$/,Ef=/^(?=.{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])?)*\.?$/,Sf=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,$G=/^\+(?:[0-9]){6,14}[0-9]$/,Qv="(?:(?:\\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])))",IG=new RegExp(`^${Qv}$`);function Yv($){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 UG($){return new RegExp(`^${Yv($)}$`)}function AG($){let I=Yv({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(`^${Qv}T(?:${D})$`)}var DG=($)=>{let I=$?`[\\s\\S]{${$?.minimum??0},${$?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${I}$`)},wG=/^-?\d+n?$/,bG=/^-?\d+$/,NG=/^-?\d+(?:\.\d+)?/,OG=/^(?:true|false)$/i,XG=/^null$/i;var WG=/^undefined$/i;var GG=/^[^A-Z]*$/,QG=/^[^a-z]*$/,jf=/^[0-9a-fA-F]*$/;function tU($,I){return new RegExp(`^[A-Za-z0-9+/]{${$}}${I}$`)}function aU($){return new RegExp(`^[A-Za-z0-9_-]{${$}}$`)}var kf=/^[0-9a-fA-F]{32}$/,Pf=tU(22,"=="),Rf=aU(22),Tf=/^[0-9a-fA-F]{40}$/,_f=tU(27,"="),Cf=aU(27),Zf=/^[0-9a-fA-F]{64}$/,gf=tU(43,"="),xf=aU(43),hf=/^[0-9a-fA-F]{96}$/,ff=tU(64,""),yf=aU(64),uf=/^[0-9a-fA-F]{128}$/,lf=tU(86,"=="),cf=aU(86);var J$=L("$ZodCheck",($,I)=>{var U;$._zod??($._zod={}),$._zod.def=I,(U=$._zod).onattach??(U.onattach=[])}),Jv={number:"number",bigint:"bigint",object:"date"},Vw=L("$ZodCheckLessThan",($,I)=>{J$.init($,I);let U=Jv[typeof I.value];$._zod.onattach.push((D)=>{let A=D._zod.bag,w=(I.inclusive?A.maximum:A.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(I.value<w)if(I.inclusive)A.maximum=I.value;else A.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})}}),vw=L("$ZodCheckGreaterThan",($,I)=>{J$.init($,I);let U=Jv[typeof I.value];$._zod.onattach.push((D)=>{let A=D._zod.bag,w=(I.inclusive?A.minimum:A.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(I.value>w)if(I.inclusive)A.minimum=I.value;else A.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})}}),YG=L("$ZodCheckMultipleOf",($,I)=>{J$.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):S9(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})}}),BG=L("$ZodCheckNumberFormat",($,I)=>{J$.init($,I),I.format=I.format||"float64";let U=I.format?.includes("int"),D=U?"int":"number",[A,w]=_9[I.format];$._zod.onattach.push((b)=>{let N=b._zod.bag;if(N.format=I.format,N.minimum=A,N.maximum=w,U)N.pattern=bG}),$._zod.check=(b)=>{let N=b.value;if(U){if(!Number.isInteger(N)){b.issues.push({expected:D,format:I.format,code:"invalid_type",continue:!1,input:N,inst:$});return}if(!Number.isSafeInteger(N)){if(N>0)b.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 b.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<A)b.issues.push({origin:"number",input:N,code:"too_small",minimum:A,inclusive:!0,inst:$,continue:!I.abort});if(N>w)b.issues.push({origin:"number",input:N,code:"too_big",maximum:w,inst:$})}}),JG=L("$ZodCheckBigIntFormat",($,I)=>{J$.init($,I);let[U,D]=C9[I.format];$._zod.onattach.push((A)=>{let w=A._zod.bag;w.format=I.format,w.minimum=U,w.maximum=D}),$._zod.check=(A)=>{let w=A.value;if(w<U)A.issues.push({origin:"bigint",input:w,code:"too_small",minimum:U,inclusive:!0,inst:$,continue:!I.abort});if(w>D)A.issues.push({origin:"bigint",input:w,code:"too_big",maximum:D,inst:$})}}),HG=L("$ZodCheckMaxSize",($,I)=>{var U;J$.init($,I),(U=$._zod.def).when??(U.when=(D)=>{let A=D.value;return!P4(A)&&A.size!==void 0}),$._zod.onattach.push((D)=>{let A=D._zod.bag.maximum??Number.POSITIVE_INFINITY;if(I.maximum<A)D._zod.bag.maximum=I.maximum}),$._zod.check=(D)=>{let A=D.value;if(A.size<=I.maximum)return;D.issues.push({origin:iU(A),code:"too_big",maximum:I.maximum,inclusive:!0,input:A,inst:$,continue:!I.abort})}}),LG=L("$ZodCheckMinSize",($,I)=>{var U;J$.init($,I),(U=$._zod.def).when??(U.when=(D)=>{let A=D.value;return!P4(A)&&A.size!==void 0}),$._zod.onattach.push((D)=>{let A=D._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(I.minimum>A)D._zod.bag.minimum=I.minimum}),$._zod.check=(D)=>{let A=D.value;if(A.size>=I.minimum)return;D.issues.push({origin:iU(A),code:"too_small",minimum:I.minimum,inclusive:!0,input:A,inst:$,continue:!I.abort})}}),zG=L("$ZodCheckSizeEquals",($,I)=>{var U;J$.init($,I),(U=$._zod.def).when??(U.when=(D)=>{let A=D.value;return!P4(A)&&A.size!==void 0}),$._zod.onattach.push((D)=>{let A=D._zod.bag;A.minimum=I.size,A.maximum=I.size,A.size=I.size}),$._zod.check=(D)=>{let A=D.value,w=A.size;if(w===I.size)return;let b=w>I.size;D.issues.push({origin:iU(A),...b?{code:"too_big",maximum:I.size}:{code:"too_small",minimum:I.size},inclusive:!0,exact:!0,input:D.value,inst:$,continue:!I.abort})}}),MG=L("$ZodCheckMaxLength",($,I)=>{var U;J$.init($,I),(U=$._zod.def).when??(U.when=(D)=>{let A=D.value;return!P4(A)&&A.length!==void 0}),$._zod.onattach.push((D)=>{let A=D._zod.bag.maximum??Number.POSITIVE_INFINITY;if(I.maximum<A)D._zod.bag.maximum=I.maximum}),$._zod.check=(D)=>{let A=D.value;if(A.length<=I.maximum)return;let b=nU(A);D.issues.push({origin:b,code:"too_big",maximum:I.maximum,inclusive:!0,input:A,inst:$,continue:!I.abort})}}),KG=L("$ZodCheckMinLength",($,I)=>{var U;J$.init($,I),(U=$._zod.def).when??(U.when=(D)=>{let A=D.value;return!P4(A)&&A.length!==void 0}),$._zod.onattach.push((D)=>{let A=D._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(I.minimum>A)D._zod.bag.minimum=I.minimum}),$._zod.check=(D)=>{let A=D.value;if(A.length>=I.minimum)return;let b=nU(A);D.issues.push({origin:b,code:"too_small",minimum:I.minimum,inclusive:!0,input:A,inst:$,continue:!I.abort})}}),VG=L("$ZodCheckLengthEquals",($,I)=>{var U;J$.init($,I),(U=$._zod.def).when??(U.when=(D)=>{let A=D.value;return!P4(A)&&A.length!==void 0}),$._zod.onattach.push((D)=>{let A=D._zod.bag;A.minimum=I.length,A.maximum=I.length,A.length=I.length}),$._zod.check=(D)=>{let A=D.value,w=A.length;if(w===I.length)return;let b=nU(A),N=w>I.length;D.issues.push({origin:b,...N?{code:"too_big",maximum:I.length}:{code:"too_small",minimum:I.length},inclusive:!0,exact:!0,input:D.value,inst:$,continue:!I.abort})}}),$1=L("$ZodCheckStringFormat",($,I)=>{var U,D;if(J$.init($,I),$._zod.onattach.push((A)=>{let w=A._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=(A)=>{if(I.pattern.lastIndex=0,I.pattern.test(A.value))return;A.issues.push({origin:"string",code:"invalid_format",format:I.format,input:A.value,...I.pattern?{pattern:I.pattern.toString()}:{},inst:$,continue:!I.abort})});else(D=$._zod).check??(D.check=()=>{})}),vG=L("$ZodCheckRegex",($,I)=>{$1.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})}}),qG=L("$ZodCheckLowerCase",($,I)=>{I.pattern??(I.pattern=GG),$1.init($,I)}),FG=L("$ZodCheckUpperCase",($,I)=>{I.pattern??(I.pattern=QG),$1.init($,I)}),EG=L("$ZodCheckIncludes",($,I)=>{J$.init($,I);let U=z6(I.includes),D=new RegExp(typeof I.position==="number"?`^.{${I.position}}${U}`:U);I.pattern=D,$._zod.onattach.push((A)=>{let w=A._zod.bag;w.patterns??(w.patterns=new Set),w.patterns.add(D)}),$._zod.check=(A)=>{if(A.value.includes(I.includes,I.position))return;A.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:I.includes,input:A.value,inst:$,continue:!I.abort})}}),SG=L("$ZodCheckStartsWith",($,I)=>{J$.init($,I);let U=new RegExp(`^${z6(I.prefix)}.*`);I.pattern??(I.pattern=U),$._zod.onattach.push((D)=>{let A=D._zod.bag;A.patterns??(A.patterns=new Set),A.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})}}),jG=L("$ZodCheckEndsWith",($,I)=>{J$.init($,I);let U=new RegExp(`.*${z6(I.suffix)}$`);I.pattern??(I.pattern=U),$._zod.onattach.push((D)=>{let A=D._zod.bag;A.patterns??(A.patterns=new Set),A.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 Bv($,I,U){if($.issues.length)I.issues.push(...X6(U,$.issues))}var kG=L("$ZodCheckProperty",($,I)=>{J$.init($,I),$._zod.check=(U)=>{let D=I.schema._zod.run({value:U.value[I.property],issues:[]},{});if(D instanceof Promise)return D.then((A)=>Bv(A,U,I.property));Bv(D,U,I.property);return}}),PG=L("$ZodCheckMimeType",($,I)=>{J$.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})}}),RG=L("$ZodCheckOverwrite",($,I)=>{J$.init($,I),$._zod.check=(U)=>{U.value=I.tx(U.value)}});class qw{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(`
44
- `).filter((w)=>w),D=Math.min(...U.map((w)=>w.length-w.trimStart().length)),A=U.map((w)=>w.slice(D)).map((w)=>" ".repeat(this.indent*2)+w);for(let w of A)this.content.push(w)}compile(){let $=Function,I=this?.args,D=[...(this?.content??[""]).map((A)=>` ${A}`)];return new $(...I,D.join(`
45
- `))}}var TG={major:4,minor:2,patch:1};var o=L("$ZodType",($,I)=>{var U;$??($={}),$._zod.def=I,$._zod.bag=$._zod.bag||{},$._zod.version=TG;let D=[...$._zod.def.checks??[]];if($._zod.traits.has("$ZodCheck"))D.unshift($);for(let A of D)for(let w of A._zod.onattach)w($);if(D.length===0)(U=$._zod).deferred??(U.deferred=[]),$._zod.deferred?.push(()=>{$._zod.run=$._zod.parse});else{let A=(b,N,O)=>{let X=C4(b),W;for(let Q of N){if(Q._zod.def.when){if(!Q._zod.def.when(b))continue}else if(X)continue;let B=b.issues.length,Y=Q._zod.check(b);if(Y instanceof Promise&&O?.async===!1)throw new m6;if(W||Y instanceof Promise)W=(W??Promise.resolve()).then(async()=>{if(await Y,b.issues.length===B)return;if(!X)X=C4(b,B)});else{if(b.issues.length===B)continue;if(!X)X=C4(b,B)}}if(W)return W.then(()=>{return b});return b},w=(b,N,O)=>{if(C4(b))return b.aborted=!0,b;let X=A(N,D,O);if(X instanceof Promise){if(O.async===!1)throw new m6;return X.then((W)=>$._zod.parse(W,O))}return $._zod.parse(X,O)};$._zod.run=(b,N)=>{if(N.skipChecks)return $._zod.parse(b,N);if(N.direction==="backward"){let X=$._zod.parse({value:b.value,issues:[]},{...N,skipChecks:!0});if(X instanceof Promise)return X.then((W)=>{return w(W,b,N)});return w(X,b,N)}let O=$._zod.parse(b,N);if(O instanceof Promise){if(N.async===!1)throw new m6;return O.then((X)=>A(X,D,N))}return A(O,D,N)}}$["~standard"]={validate:(A)=>{try{let w=x9($,A);return w.success?{value:w.data}:{issues:w.error?.issues}}catch(w){return h9($,A).then((b)=>b.success?{value:b.data}:{issues:b.error?.issues})}},vendor:"zod",version:1}}),bI=L("$ZodString",($,I)=>{o.init($,I),$._zod.pattern=[...$?._zod.bag?.patterns??[]].pop()??DG($._zod.bag),$._zod.parse=(U,D)=>{if(I.coerce)try{U.value=String(U.value)}catch(A){}if(typeof U.value==="string")return U;return U.issues.push({expected:"string",code:"invalid_type",input:U.value,inst:$}),U}}),Q$=L("$ZodStringFormat",($,I)=>{$1.init($,I),bI.init($,I)}),CG=L("$ZodGUID",($,I)=>{I.pattern??(I.pattern=i9),Q$.init($,I)}),ZG=L("$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=wI(D))}else I.pattern??(I.pattern=wI());Q$.init($,I)}),gG=L("$ZodEmail",($,I)=>{I.pattern??(I.pattern=n9),Q$.init($,I)}),xG=L("$ZodURL",($,I)=>{Q$.init($,I),$._zod.check=(U)=>{try{let D=U.value.trim(),A=new URL(D);if(I.hostname){if(I.hostname.lastIndex=0,!I.hostname.test(A.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(A.protocol.endsWith(":")?A.protocol.slice(0,-1):A.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=A.href;else U.value=D;return}catch(D){U.issues.push({code:"invalid_format",format:"url",input:U.value,inst:$,continue:!I.abort})}}}),hG=L("$ZodEmoji",($,I)=>{I.pattern??(I.pattern=o9()),Q$.init($,I)}),fG=L("$ZodNanoID",($,I)=>{I.pattern??(I.pattern=m9),Q$.init($,I)}),yG=L("$ZodCUID",($,I)=>{I.pattern??(I.pattern=f9),Q$.init($,I)}),uG=L("$ZodCUID2",($,I)=>{I.pattern??(I.pattern=y9),Q$.init($,I)}),lG=L("$ZodULID",($,I)=>{I.pattern??(I.pattern=u9),Q$.init($,I)}),cG=L("$ZodXID",($,I)=>{I.pattern??(I.pattern=l9),Q$.init($,I)}),mG=L("$ZodKSUID",($,I)=>{I.pattern??(I.pattern=c9),Q$.init($,I)}),rG=L("$ZodISODateTime",($,I)=>{I.pattern??(I.pattern=AG(I)),Q$.init($,I)}),iG=L("$ZodISODate",($,I)=>{I.pattern??(I.pattern=IG),Q$.init($,I)}),nG=L("$ZodISOTime",($,I)=>{I.pattern??(I.pattern=UG(I)),Q$.init($,I)}),oG=L("$ZodISODuration",($,I)=>{I.pattern??(I.pattern=r9),Q$.init($,I)}),dG=L("$ZodIPv4",($,I)=>{I.pattern??(I.pattern=d9),Q$.init($,I),$._zod.bag.format="ipv4"}),pG=L("$ZodIPv6",($,I)=>{I.pattern??(I.pattern=p9),Q$.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})}}}),tG=L("$ZodMAC",($,I)=>{I.pattern??(I.pattern=t9(I.delimiter)),Q$.init($,I),$._zod.bag.format="mac"}),aG=L("$ZodCIDRv4",($,I)=>{I.pattern??(I.pattern=a9),Q$.init($,I)}),eG=L("$ZodCIDRv6",($,I)=>{I.pattern??(I.pattern=e9),Q$.init($,I),$._zod.check=(U)=>{let D=U.value.split("/");try{if(D.length!==2)throw new Error;let[A,w]=D;if(!w)throw new Error;let b=Number(w);if(`${b}`!==w)throw new Error;if(b<0||b>128)throw new Error;new URL(`http://[${A}]`)}catch{U.issues.push({code:"invalid_format",format:"cidrv6",input:U.value,inst:$,continue:!I.abort})}}});function sG($){if($==="")return!0;if($.length%4!==0)return!1;try{return atob($),!0}catch{return!1}}var $8=L("$ZodBase64",($,I)=>{I.pattern??(I.pattern=s9),Q$.init($,I),$._zod.bag.contentEncoding="base64",$._zod.check=(U)=>{if(sG(U.value))return;U.issues.push({code:"invalid_format",format:"base64",input:U.value,inst:$,continue:!I.abort})}});function kv($){if(!Kw.test($))return!1;let I=$.replace(/[-_]/g,(D)=>D==="-"?"+":"/"),U=I.padEnd(Math.ceil(I.length/4)*4,"=");return sG(U)}var I8=L("$ZodBase64URL",($,I)=>{I.pattern??(I.pattern=Kw),Q$.init($,I),$._zod.bag.contentEncoding="base64url",$._zod.check=(U)=>{if(kv(U.value))return;U.issues.push({code:"invalid_format",format:"base64url",input:U.value,inst:$,continue:!I.abort})}}),U8=L("$ZodE164",($,I)=>{I.pattern??(I.pattern=$G),Q$.init($,I)});function Pv($,I=null){try{let U=$.split(".");if(U.length!==3)return!1;let[D]=U;if(!D)return!1;let A=JSON.parse(atob(D));if("typ"in A&&A?.typ!=="JWT")return!1;if(!A.alg)return!1;if(I&&(!("alg"in A)||A.alg!==I))return!1;return!0}catch{return!1}}var A8=L("$ZodJWT",($,I)=>{Q$.init($,I),$._zod.check=(U)=>{if(Pv(U.value,I.alg))return;U.issues.push({code:"invalid_format",format:"jwt",input:U.value,inst:$,continue:!I.abort})}}),D8=L("$ZodCustomStringFormat",($,I)=>{Q$.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})}}),Pw=L("$ZodNumber",($,I)=>{o.init($,I),$._zod.pattern=$._zod.bag.pattern??NG,$._zod.parse=(U,D)=>{if(I.coerce)try{U.value=Number(U.value)}catch(b){}let A=U.value;if(typeof A==="number"&&!Number.isNaN(A)&&Number.isFinite(A))return U;let w=typeof A==="number"?Number.isNaN(A)?"NaN":!Number.isFinite(A)?"Infinity":void 0:void 0;return U.issues.push({expected:"number",code:"invalid_type",input:A,inst:$,...w?{received:w}:{}}),U}}),w8=L("$ZodNumberFormat",($,I)=>{BG.init($,I),Pw.init($,I)}),eU=L("$ZodBoolean",($,I)=>{o.init($,I),$._zod.pattern=OG,$._zod.parse=(U,D)=>{if(I.coerce)try{U.value=Boolean(U.value)}catch(w){}let A=U.value;if(typeof A==="boolean")return U;return U.issues.push({expected:"boolean",code:"invalid_type",input:A,inst:$}),U}}),Rw=L("$ZodBigInt",($,I)=>{o.init($,I),$._zod.pattern=wG,$._zod.parse=(U,D)=>{if(I.coerce)try{U.value=BigInt(U.value)}catch(A){}if(typeof U.value==="bigint")return U;return U.issues.push({expected:"bigint",code:"invalid_type",input:U.value,inst:$}),U}}),b8=L("$ZodBigIntFormat",($,I)=>{JG.init($,I),Rw.init($,I)}),N8=L("$ZodSymbol",($,I)=>{o.init($,I),$._zod.parse=(U,D)=>{let A=U.value;if(typeof A==="symbol")return U;return U.issues.push({expected:"symbol",code:"invalid_type",input:A,inst:$}),U}}),O8=L("$ZodUndefined",($,I)=>{o.init($,I),$._zod.pattern=WG,$._zod.values=new Set([void 0]),$._zod.optin="optional",$._zod.optout="optional",$._zod.parse=(U,D)=>{let A=U.value;if(typeof A==="undefined")return U;return U.issues.push({expected:"undefined",code:"invalid_type",input:A,inst:$}),U}}),X8=L("$ZodNull",($,I)=>{o.init($,I),$._zod.pattern=XG,$._zod.values=new Set([null]),$._zod.parse=(U,D)=>{let A=U.value;if(A===null)return U;return U.issues.push({expected:"null",code:"invalid_type",input:A,inst:$}),U}}),W8=L("$ZodAny",($,I)=>{o.init($,I),$._zod.parse=(U)=>U}),G8=L("$ZodUnknown",($,I)=>{o.init($,I),$._zod.parse=(U)=>U}),Q8=L("$ZodNever",($,I)=>{o.init($,I),$._zod.parse=(U,D)=>{return U.issues.push({expected:"never",code:"invalid_type",input:U.value,inst:$}),U}}),Y8=L("$ZodVoid",($,I)=>{o.init($,I),$._zod.parse=(U,D)=>{let A=U.value;if(typeof A==="undefined")return U;return U.issues.push({expected:"void",code:"invalid_type",input:A,inst:$}),U}}),B8=L("$ZodDate",($,I)=>{o.init($,I),$._zod.parse=(U,D)=>{if(I.coerce)try{U.value=new Date(U.value)}catch(N){}let A=U.value,w=A instanceof Date;if(w&&!Number.isNaN(A.getTime()))return U;return U.issues.push({expected:"date",code:"invalid_type",input:A,...w?{received:"Invalid Date"}:{},inst:$}),U}});function Lv($,I,U){if($.issues.length)I.issues.push(...X6(U,$.issues));I.value[U]=$.value}var J8=L("$ZodArray",($,I)=>{o.init($,I),$._zod.parse=(U,D)=>{let A=U.value;if(!Array.isArray(A))return U.issues.push({expected:"array",code:"invalid_type",input:A,inst:$}),U;U.value=Array(A.length);let w=[];for(let b=0;b<A.length;b++){let N=A[b],O=I.element._zod.run({value:N,issues:[]},D);if(O instanceof Promise)w.push(O.then((X)=>Lv(X,U,b)));else Lv(O,U,b)}if(w.length)return Promise.all(w).then(()=>U);return U}});function kw($,I,U,D){if($.issues.length)I.issues.push(...X6(U,$.issues));if($.value===void 0){if(U in D)I.value[U]=void 0}else I.value[U]=$.value}function Rv($){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=T9($.shape);return{...$,keys:I,keySet:new Set(I),numKeys:I.length,optionalKeys:new Set(U)}}function Tv($,I,U,D,A,w){let b=[],N=A.keySet,O=A.catchall._zod,X=O.def.type;for(let W in I){if(N.has(W))continue;if(X==="never"){b.push(W);continue}let Q=O.run({value:I[W],issues:[]},D);if(Q instanceof Promise)$.push(Q.then((B)=>kw(B,U,W,I)));else kw(Q,U,W,I)}if(b.length)U.issues.push({code:"unrecognized_keys",keys:b,input:I,inst:w});if(!$.length)return U;return Promise.all($).then(()=>{return U})}var _v=L("$ZodObject",($,I)=>{if(o.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(()=>Rv(I));s($._zod,"propValues",()=>{let N=I.shape,O={};for(let X in N){let W=N[X]._zod;if(W.values){O[X]??(O[X]=new Set);for(let Q of W.values)O[X].add(Q)}}return O});let A=DI,w=I.catchall,b;$._zod.parse=(N,O)=>{b??(b=D.value);let X=N.value;if(!A(X))return N.issues.push({expected:"object",code:"invalid_type",input:X,inst:$}),N;N.value={};let W=[],Q=b.shape;for(let B of b.keys){let J=Q[B]._zod.run({value:X[B],issues:[]},O);if(J instanceof Promise)W.push(J.then((H)=>kw(H,N,B,X)));else kw(J,N,B,X)}if(!w)return W.length?Promise.all(W).then(()=>N):N;return Tv(W,X,N,O,D.value,$)}}),H8=L("$ZodObjectJIT",($,I)=>{_v.init($,I);let U=$._zod.parse,D=dI(()=>Rv(I)),A=(B)=>{let Y=new qw(["shape","payload","ctx"]),J=D.value,H=(k)=>{let h=Ow(k);return`shape[${h}]._zod.run({ value: input[${h}], issues: [] }, ctx)`};Y.write("const input = payload.value;");let v=Object.create(null),V=0;for(let k of J.keys)v[k]=`key_${V++}`;Y.write("const newResult = {};");for(let k of J.keys){let h=v[k],l=Ow(k);Y.write(`const ${h} = ${H(k)};`),Y.write(`
46
- if (${h}.issues.length) {
47
- payload.issues = payload.issues.concat(${h}.issues.map(iss => ({
48
- ...iss,
49
- path: iss.path ? [${l}, ...iss.path] : [${l}]
16
+ path: iss.path ? [${h}, ...iss.path] : [${h}]
50
17
  })));
51
18
  }
52
19
 
53
20
 
54
- if (${h}.value === undefined) {
55
- if (${l} in input) {
56
- newResult[${l}] = undefined;
21
+ if (${a}.value === undefined) {
22
+ if (${h} in input) {
23
+ newResult[${h}] = undefined;
57
24
  }
58
25
  } else {
59
- newResult[${l}] = ${h}.value;
26
+ newResult[${h}] = ${a}.value;
60
27
  }
61
28
 
62
- `)}Y.write("payload.value = newResult;"),Y.write("return payload;");let F=Y.compile();return(k,h)=>F(B,k,h)},w,b=DI,N=!uU.jitless,X=N&&k9.value,W=I.catchall,Q;$._zod.parse=(B,Y)=>{Q??(Q=D.value);let J=B.value;if(!b(J))return B.issues.push({expected:"object",code:"invalid_type",input:J,inst:$}),B;if(N&&X&&Y?.async===!1&&Y.jitless!==!0){if(!w)w=A(I.shape);if(B=w(B,Y),!W)return B;return Tv([],J,B,Y,Q,$)}return U(B,Y)}});function zv($,I,U,D){for(let w of $)if(w.issues.length===0)return I.value=w.value,I;let A=$.filter((w)=>!C4(w));if(A.length===1)return I.value=A[0].value,A[0];return I.issues.push({code:"invalid_union",input:I.value,inst:U,errors:$.map((w)=>w.issues.map((b)=>U6(b,D,k$())))}),I}var sU=L("$ZodUnion",($,I)=>{o.init($,I),s($._zod,"optin",()=>I.options.some((A)=>A._zod.optin==="optional")?"optional":void 0),s($._zod,"optout",()=>I.options.some((A)=>A._zod.optout==="optional")?"optional":void 0),s($._zod,"values",()=>{if(I.options.every((A)=>A._zod.values))return new Set(I.options.flatMap((A)=>Array.from(A._zod.values)));return}),s($._zod,"pattern",()=>{if(I.options.every((A)=>A._zod.pattern)){let A=I.options.map((w)=>w._zod.pattern);return new RegExp(`^(${A.map((w)=>mU(w.source)).join("|")})$`)}return});let U=I.options.length===1,D=I.options[0]._zod.run;$._zod.parse=(A,w)=>{if(U)return D(A,w);let b=!1,N=[];for(let O of I.options){let X=O._zod.run({value:A.value,issues:[]},w);if(X instanceof Promise)N.push(X),b=!0;else{if(X.issues.length===0)return X;N.push(X)}}if(!b)return zv(N,A,$,w);return Promise.all(N).then((O)=>{return zv(O,A,$,w)})}});function Mv($,I,U,D){let A=$.filter((w)=>w.issues.length===0);if(A.length===1)return I.value=A[0].value,I;if(A.length===0)I.issues.push({code:"invalid_union",input:I.value,inst:U,errors:$.map((w)=>w.issues.map((b)=>U6(b,D,k$())))});else I.issues.push({code:"invalid_union",input:I.value,inst:U,errors:[],inclusive:!1});return I}var L8=L("$ZodXor",($,I)=>{sU.init($,I),I.inclusive=!1;let U=I.options.length===1,D=I.options[0]._zod.run;$._zod.parse=(A,w)=>{if(U)return D(A,w);let b=!1,N=[];for(let O of I.options){let X=O._zod.run({value:A.value,issues:[]},w);if(X instanceof Promise)N.push(X),b=!0;else N.push(X)}if(!b)return Mv(N,A,$,w);return Promise.all(N).then((O)=>{return Mv(O,A,$,w)})}}),z8=L("$ZodDiscriminatedUnion",($,I)=>{I.inclusive=!1,sU.init($,I);let U=$._zod.parse;s($._zod,"propValues",()=>{let A={};for(let w of I.options){let b=w._zod.propValues;if(!b||Object.keys(b).length===0)throw new Error(`Invalid discriminated union option at index "${I.options.indexOf(w)}"`);for(let[N,O]of Object.entries(b)){if(!A[N])A[N]=new Set;for(let X of O)A[N].add(X)}}return A});let D=dI(()=>{let A=I.options,w=new Map;for(let b of A){let N=b._zod.propValues?.[I.discriminator];if(!N||N.size===0)throw new Error(`Invalid discriminated union option at index "${I.options.indexOf(b)}"`);for(let O of N){if(w.has(O))throw new Error(`Duplicate discriminator value "${String(O)}"`);w.set(O,b)}}return w});$._zod.parse=(A,w)=>{let b=A.value;if(!DI(b))return A.issues.push({code:"invalid_type",expected:"object",input:b,inst:$}),A;let N=D.value.get(b?.[I.discriminator]);if(N)return N._zod.run(A,w);if(I.unionFallback)return U(A,w);return A.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:I.discriminator,input:b,path:[I.discriminator],inst:$}),A}}),M8=L("$ZodIntersection",($,I)=>{o.init($,I),$._zod.parse=(U,D)=>{let A=U.value,w=I.left._zod.run({value:A,issues:[]},D),b=I.right._zod.run({value:A,issues:[]},D);if(w instanceof Promise||b instanceof Promise)return Promise.all([w,b]).then(([O,X])=>{return Kv(U,O,X)});return Kv(U,w,b)}});function _G($,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),A={...$,...I};for(let w of D){let b=_G($[w],I[w]);if(!b.valid)return{valid:!1,mergeErrorPath:[w,...b.mergeErrorPath]};A[w]=b.data}return{valid:!0,data:A}}if(Array.isArray($)&&Array.isArray(I)){if($.length!==I.length)return{valid:!1,mergeErrorPath:[]};let U=[];for(let D=0;D<$.length;D++){let A=$[D],w=I[D],b=_G(A,w);if(!b.valid)return{valid:!1,mergeErrorPath:[D,...b.mergeErrorPath]};U.push(b.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(C4($))return $;let D=_G(I.value,U.value);if(!D.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(D.mergeErrorPath)}`);return $.value=D.data,$}var Tw=L("$ZodTuple",($,I)=>{o.init($,I);let U=I.items;$._zod.parse=(D,A)=>{let w=D.value;if(!Array.isArray(w))return D.issues.push({input:w,inst:$,expected:"tuple",code:"invalid_type"}),D;D.value=[];let b=[],N=[...U].reverse().findIndex((W)=>W._zod.optin!=="optional"),O=N===-1?0:U.length-N;if(!I.rest){let W=w.length>U.length,Q=w.length<O-1;if(W||Q)return D.issues.push({...W?{code:"too_big",maximum:U.length}:{code:"too_small",minimum:U.length},input:w,inst:$,origin:"array"}),D}let X=-1;for(let W of U){if(X++,X>=w.length){if(X>=O)continue}let Q=W._zod.run({value:w[X],issues:[]},A);if(Q instanceof Promise)b.push(Q.then((B)=>Fw(B,D,X)));else Fw(Q,D,X)}if(I.rest){let W=w.slice(U.length);for(let Q of W){X++;let B=I.rest._zod.run({value:Q,issues:[]},A);if(B instanceof Promise)b.push(B.then((Y)=>Fw(Y,D,X)));else Fw(B,D,X)}}if(b.length)return Promise.all(b).then(()=>D);return D}});function Fw($,I,U){if($.issues.length)I.issues.push(...X6(U,$.issues));I.value[U]=$.value}var K8=L("$ZodRecord",($,I)=>{o.init($,I),$._zod.parse=(U,D)=>{let A=U.value;if(!_4(A))return U.issues.push({expected:"record",code:"invalid_type",input:A,inst:$}),U;let w=[],b=I.keyType._zod.values;if(b){U.value={};let N=new Set;for(let X of b)if(typeof X==="string"||typeof X==="number"||typeof X==="symbol"){N.add(typeof X==="number"?X.toString():X);let W=I.valueType._zod.run({value:A[X],issues:[]},D);if(W instanceof Promise)w.push(W.then((Q)=>{if(Q.issues.length)U.issues.push(...X6(X,Q.issues));U.value[X]=Q.value}));else{if(W.issues.length)U.issues.push(...X6(X,W.issues));U.value[X]=W.value}}let O;for(let X in A)if(!N.has(X))O=O??[],O.push(X);if(O&&O.length>0)U.issues.push({code:"unrecognized_keys",input:A,inst:$,keys:O})}else{U.value={};for(let N of Reflect.ownKeys(A)){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]=A[N];else U.issues.push({code:"invalid_key",origin:"record",issues:O.issues.map((W)=>U6(W,D,k$())),input:N,path:[N],inst:$});continue}let X=I.valueType._zod.run({value:A[N],issues:[]},D);if(X instanceof Promise)w.push(X.then((W)=>{if(W.issues.length)U.issues.push(...X6(N,W.issues));U.value[O.value]=W.value}));else{if(X.issues.length)U.issues.push(...X6(N,X.issues));U.value[O.value]=X.value}}}if(w.length)return Promise.all(w).then(()=>U);return U}}),V8=L("$ZodMap",($,I)=>{o.init($,I),$._zod.parse=(U,D)=>{let A=U.value;if(!(A instanceof Map))return U.issues.push({expected:"map",code:"invalid_type",input:A,inst:$}),U;let w=[];U.value=new Map;for(let[b,N]of A){let O=I.keyType._zod.run({value:b,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(([W,Q])=>{Vv(W,Q,U,b,A,$,D)}));else Vv(O,X,U,b,A,$,D)}if(w.length)return Promise.all(w).then(()=>U);return U}});function Vv($,I,U,D,A,w,b){if($.issues.length)if(rU.has(typeof D))U.issues.push(...X6(D,$.issues));else U.issues.push({code:"invalid_key",origin:"map",input:A,inst:w,issues:$.issues.map((N)=>U6(N,b,k$()))});if(I.issues.length)if(rU.has(typeof D))U.issues.push(...X6(D,I.issues));else U.issues.push({origin:"map",code:"invalid_element",input:A,inst:w,key:D,issues:I.issues.map((N)=>U6(N,b,k$()))});U.value.set($.value,I.value)}var v8=L("$ZodSet",($,I)=>{o.init($,I),$._zod.parse=(U,D)=>{let A=U.value;if(!(A instanceof Set))return U.issues.push({input:A,inst:$,expected:"set",code:"invalid_type"}),U;let w=[];U.value=new Set;for(let b of A){let N=I.valueType._zod.run({value:b,issues:[]},D);if(N instanceof Promise)w.push(N.then((O)=>vv(O,U)));else vv(N,U)}if(w.length)return Promise.all(w).then(()=>U);return U}});function vv($,I){if($.issues.length)I.issues.push(...$.issues);I.value.add($.value)}var q8=L("$ZodEnum",($,I)=>{o.init($,I);let U=cU(I.entries),D=new Set(U);$._zod.values=D,$._zod.pattern=new RegExp(`^(${U.filter((A)=>rU.has(typeof A)).map((A)=>typeof A==="string"?z6(A):A.toString()).join("|")})$`),$._zod.parse=(A,w)=>{let b=A.value;if(D.has(b))return A;return A.issues.push({code:"invalid_value",values:U,input:b,inst:$}),A}}),F8=L("$ZodLiteral",($,I)=>{if(o.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"?z6(D):D?z6(D.toString()):String(D)).join("|")})$`),$._zod.parse=(D,A)=>{let w=D.value;if(U.has(w))return D;return D.issues.push({code:"invalid_value",values:I.values,input:w,inst:$}),D}}),E8=L("$ZodFile",($,I)=>{o.init($,I),$._zod.parse=(U,D)=>{let A=U.value;if(A instanceof File)return U;return U.issues.push({expected:"file",code:"invalid_type",input:A,inst:$}),U}}),S8=L("$ZodTransform",($,I)=>{o.init($,I),$._zod.parse=(U,D)=>{if(D.direction==="backward")throw new AI($.constructor.name);let A=I.transform(U.value,U);if(D.async)return(A instanceof Promise?A:Promise.resolve(A)).then((b)=>{return U.value=b,U});if(A instanceof Promise)throw new m6;return U.value=A,U}});function qv($,I){if($.issues.length&&I===void 0)return{issues:[],value:void 0};return $}var j8=L("$ZodOptional",($,I)=>{o.init($,I),$._zod.optin="optional",$._zod.optout="optional",s($._zod,"values",()=>{return I.innerType._zod.values?new Set([...I.innerType._zod.values,void 0]):void 0}),s($._zod,"pattern",()=>{let U=I.innerType._zod.pattern;return U?new RegExp(`^(${mU(U.source)})?$`):void 0}),$._zod.parse=(U,D)=>{if(I.innerType._zod.optin==="optional"){let A=I.innerType._zod.run(U,D);if(A instanceof Promise)return A.then((w)=>qv(w,U.value));return qv(A,U.value)}if(U.value===void 0)return U;return I.innerType._zod.run(U,D)}}),k8=L("$ZodNullable",($,I)=>{o.init($,I),s($._zod,"optin",()=>I.innerType._zod.optin),s($._zod,"optout",()=>I.innerType._zod.optout),s($._zod,"pattern",()=>{let U=I.innerType._zod.pattern;return U?new RegExp(`^(${mU(U.source)}|null)$`):void 0}),s($._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)}}),P8=L("$ZodDefault",($,I)=>{o.init($,I),$._zod.optin="optional",s($._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 A=I.innerType._zod.run(U,D);if(A instanceof Promise)return A.then((w)=>Fv(w,I));return Fv(A,I)}});function Fv($,I){if($.value===void 0)$.value=I.defaultValue;return $}var R8=L("$ZodPrefault",($,I)=>{o.init($,I),$._zod.optin="optional",s($._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)}}),T8=L("$ZodNonOptional",($,I)=>{o.init($,I),s($._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 A=I.innerType._zod.run(U,D);if(A instanceof Promise)return A.then((w)=>Ev(w,$));return Ev(A,$)}});function Ev($,I){if(!$.issues.length&&$.value===void 0)$.issues.push({code:"invalid_type",expected:"nonoptional",input:$.value,inst:I});return $}var _8=L("$ZodSuccess",($,I)=>{o.init($,I),$._zod.parse=(U,D)=>{if(D.direction==="backward")throw new AI("ZodSuccess");let A=I.innerType._zod.run(U,D);if(A instanceof Promise)return A.then((w)=>{return U.value=w.issues.length===0,U});return U.value=A.issues.length===0,U}}),C8=L("$ZodCatch",($,I)=>{o.init($,I),s($._zod,"optin",()=>I.innerType._zod.optin),s($._zod,"optout",()=>I.innerType._zod.optout),s($._zod,"values",()=>I.innerType._zod.values),$._zod.parse=(U,D)=>{if(D.direction==="backward")return I.innerType._zod.run(U,D);let A=I.innerType._zod.run(U,D);if(A instanceof Promise)return A.then((w)=>{if(U.value=w.value,w.issues.length)U.value=I.catchValue({...U,error:{issues:w.issues.map((b)=>U6(b,D,k$()))},input:U.value}),U.issues=[];return U});if(U.value=A.value,A.issues.length)U.value=I.catchValue({...U,error:{issues:A.issues.map((w)=>U6(w,D,k$()))},input:U.value}),U.issues=[];return U}}),Z8=L("$ZodNaN",($,I)=>{o.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}}),g8=L("$ZodPipe",($,I)=>{o.init($,I),s($._zod,"values",()=>I.in._zod.values),s($._zod,"optin",()=>I.in._zod.optin),s($._zod,"optout",()=>I.out._zod.optout),s($._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((b)=>Ew(b,I.in,D));return Ew(w,I.in,D)}let A=I.in._zod.run(U,D);if(A instanceof Promise)return A.then((w)=>Ew(w,I.out,D));return Ew(A,I.out,D)}});function Ew($,I,U){if($.issues.length)return $.aborted=!0,$;return I._zod.run({value:$.value,issues:$.issues},U)}var $0=L("$ZodCodec",($,I)=>{o.init($,I),s($._zod,"values",()=>I.in._zod.values),s($._zod,"optin",()=>I.in._zod.optin),s($._zod,"optout",()=>I.out._zod.optout),s($._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((b)=>Sw(b,I,D));return Sw(w,I,D)}else{let w=I.out._zod.run(U,D);if(w instanceof Promise)return w.then((b)=>Sw(b,I,D));return Sw(w,I,D)}}});function Sw($,I,U){if($.issues.length)return $.aborted=!0,$;if((U.direction||"forward")==="forward"){let A=I.transform($.value,$);if(A instanceof Promise)return A.then((w)=>jw($,w,I.out,U));return jw($,A,I.out,U)}else{let A=I.reverseTransform($.value,$);if(A instanceof Promise)return A.then((w)=>jw($,w,I.in,U));return jw($,A,I.in,U)}}function jw($,I,U,D){if($.issues.length)return $.aborted=!0,$;return U._zod.run({value:I,issues:$.issues},D)}var x8=L("$ZodReadonly",($,I)=>{o.init($,I),s($._zod,"propValues",()=>I.innerType._zod.propValues),s($._zod,"values",()=>I.innerType._zod.values),s($._zod,"optin",()=>I.innerType?._zod?.optin),s($._zod,"optout",()=>I.innerType?._zod?.optout),$._zod.parse=(U,D)=>{if(D.direction==="backward")return I.innerType._zod.run(U,D);let A=I.innerType._zod.run(U,D);if(A instanceof Promise)return A.then(Sv);return Sv(A)}});function Sv($){return $.value=Object.freeze($.value),$}var h8=L("$ZodTemplateLiteral",($,I)=>{o.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 A=D._zod.pattern instanceof RegExp?D._zod.pattern.source:D._zod.pattern;if(!A)throw new Error(`Invalid template literal part: ${D._zod.traits}`);let w=A.startsWith("^")?1:0,b=A.endsWith("$")?A.length-1:A.length;U.push(A.slice(w,b))}else if(D===null||R9.has(typeof D))U.push(z6(`${D}`));else throw new Error(`Invalid template literal part: ${D}`);$._zod.pattern=new RegExp(`^${U.join("")}$`),$._zod.parse=(D,A)=>{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}}),f8=L("$ZodFunction",($,I)=>{return o.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 A=$._def.input?Ww($._def.input,D):D,w=Reflect.apply(U,this,A);if($._def.output)return Ww($._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 A=$._def.input?await Gw($._def.input,D):D,w=await Reflect.apply(U,this,A);if($._def.output)return await Gw($._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 Tw({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})},$}),y8=L("$ZodPromise",($,I)=>{o.init($,I),$._zod.parse=(U,D)=>{return Promise.resolve(U.value).then((A)=>I.innerType._zod.run({value:A,issues:[]},D))}}),u8=L("$ZodLazy",($,I)=>{o.init($,I),s($._zod,"innerType",()=>I.getter()),s($._zod,"pattern",()=>$._zod.innerType?._zod?.pattern),s($._zod,"propValues",()=>$._zod.innerType?._zod?.propValues),s($._zod,"optin",()=>$._zod.innerType?._zod?.optin??void 0),s($._zod,"optout",()=>$._zod.innerType?._zod?.optout??void 0),$._zod.parse=(U,D)=>{return $._zod.innerType._zod.run(U,D)}}),l8=L("$ZodCustom",($,I)=>{J$.init($,I),o.init($,I),$._zod.parse=(U,D)=>{return U},$._zod.check=(U)=>{let D=U.value,A=I.fn(D);if(A instanceof Promise)return A.then((w)=>jv(w,U,D,$));jv(A,U,D,$);return}});function jv($,I,U,D){if(!$){let A={code:"custom",input:U,inst:D,path:[...D._zod.def.path??[]],continue:!D._zod.def.abort};if(D._zod.def.params)A.params=D._zod.def.params;I.issues.push(pI(A))}}var b0={};K6(b0,{zhTW:()=>RQ,zhCN:()=>PQ,yo:()=>TQ,vi:()=>kQ,ur:()=>jQ,uk:()=>w0,ua:()=>SQ,tr:()=>EQ,th:()=>FQ,ta:()=>qQ,sv:()=>vQ,sl:()=>VQ,ru:()=>KQ,pt:()=>MQ,ps:()=>LQ,pl:()=>zQ,ota:()=>HQ,no:()=>JQ,nl:()=>BQ,ms:()=>YQ,mk:()=>QQ,lt:()=>GQ,ko:()=>WQ,km:()=>U0,kh:()=>XQ,ka:()=>OQ,ja:()=>NQ,it:()=>bQ,is:()=>wQ,id:()=>DQ,hu:()=>AQ,he:()=>UQ,frCA:()=>IQ,fr:()=>$Q,fi:()=>s8,fa:()=>e8,es:()=>a8,eo:()=>t8,en:()=>I0,de:()=>p8,da:()=>d8,cs:()=>o8,ca:()=>n8,bg:()=>i8,be:()=>r8,az:()=>m8,ar:()=>c8});var rf=()=>{let $={string:{unit:"حرف",verb:"أن يحوي"},file:{unit:"بايت",verb:"أن يحوي"},array:{unit:"عنصر",verb:"أن يحوي"},set:{unit:"عنصر",verb:"أن يحوي"}};function I(A){return $[A]??null}let U=(A)=>{let w=typeof A;switch(w){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&&A.constructor)return A.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(A)=>{switch(A.code){case"invalid_type":return`مدخلات غير مقبولة: يفترض إدخال ${A.expected}، ولكن تم إدخال ${U(A.input)}`;case"invalid_value":if(A.values.length===1)return`مدخلات غير مقبولة: يفترض إدخال ${S(A.values[0])}`;return`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${z(A.values,"|")}`;case"too_big":{let w=A.inclusive?"<=":"<",b=I(A.origin);if(b)return` أكبر من اللازم: يفترض أن تكون ${A.origin??"القيمة"} ${w} ${A.maximum.toString()} ${b.unit??"عنصر"}`;return`أكبر من اللازم: يفترض أن تكون ${A.origin??"القيمة"} ${w} ${A.maximum.toString()}`}case"too_small":{let w=A.inclusive?">=":">",b=I(A.origin);if(b)return`أصغر من اللازم: يفترض لـ ${A.origin} أن يكون ${w} ${A.minimum.toString()} ${b.unit}`;return`أصغر من اللازم: يفترض لـ ${A.origin} أن يكون ${w} ${A.minimum.toString()}`}case"invalid_format":{let w=A;if(w.format==="starts_with")return`نَص غير مقبول: يجب أن يبدأ بـ "${A.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]??A.format} غير مقبول`}case"not_multiple_of":return`رقم غير مقبول: يجب أن يكون من مضاعفات ${A.divisor}`;case"unrecognized_keys":return`معرف${A.keys.length>1?"ات":""} غريب${A.keys.length>1?"ة":""}: ${z(A.keys,"، ")}`;case"invalid_key":return`معرف غير مقبول في ${A.origin}`;case"invalid_union":return"مدخل غير مقبول";case"invalid_element":return`مدخل غير مقبول في ${A.origin}`;default:return"مدخل غير مقبول"}}};function c8(){return{localeError:rf()}}var nf=()=>{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(A){return $[A]??null}let U=(A)=>{let w=typeof A;switch(w){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&&A.constructor)return A.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(A)=>{switch(A.code){case"invalid_type":return`Yanlış dəyər: gözlənilən ${A.expected}, daxil olan ${U(A.input)}`;case"invalid_value":if(A.values.length===1)return`Yanlış dəyər: gözlənilən ${S(A.values[0])}`;return`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${z(A.values,"|")}`;case"too_big":{let w=A.inclusive?"<=":"<",b=I(A.origin);if(b)return`Çox böyük: gözlənilən ${A.origin??"dəyər"} ${w}${A.maximum.toString()} ${b.unit??"element"}`;return`Çox böyük: gözlənilən ${A.origin??"dəyər"} ${w}${A.maximum.toString()}`}case"too_small":{let w=A.inclusive?">=":">",b=I(A.origin);if(b)return`Çox kiçik: gözlənilən ${A.origin} ${w}${A.minimum.toString()} ${b.unit}`;return`Çox kiçik: gözlənilən ${A.origin} ${w}${A.minimum.toString()}`}case"invalid_format":{let w=A;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]??A.format}`}case"not_multiple_of":return`Yanlış ədəd: ${A.divisor} ilə bölünə bilən olmalıdır`;case"unrecognized_keys":return`Tanınmayan açar${A.keys.length>1?"lar":""}: ${z(A.keys,", ")}`;case"invalid_key":return`${A.origin} daxilində yanlış açar`;case"invalid_union":return"Yanlış dəyər";case"invalid_element":return`${A.origin} daxilində yanlış dəyər`;default:return"Yanlış dəyər"}}};function m8(){return{localeError:nf()}}function Cv($,I,U,D){let A=Math.abs($),w=A%10,b=A%100;if(b>=11&&b<=19)return D;if(w===1)return I;if(w>=2&&w<=4)return U;return D}var of=()=>{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(A){return $[A]??null}let U=(A)=>{let w=typeof A;switch(w){case"number":return Number.isNaN(A)?"NaN":"лік";case"object":{if(Array.isArray(A))return"масіў";if(A===null)return"null";if(Object.getPrototypeOf(A)!==Object.prototype&&A.constructor)return A.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(A)=>{switch(A.code){case"invalid_type":return`Няправільны ўвод: чакаўся ${A.expected}, атрымана ${U(A.input)}`;case"invalid_value":if(A.values.length===1)return`Няправільны ўвод: чакалася ${S(A.values[0])}`;return`Няправільны варыянт: чакаўся адзін з ${z(A.values,"|")}`;case"too_big":{let w=A.inclusive?"<=":"<",b=I(A.origin);if(b){let N=Number(A.maximum),O=Cv(N,b.unit.one,b.unit.few,b.unit.many);return`Занадта вялікі: чакалася, што ${A.origin??"значэнне"} павінна ${b.verb} ${w}${A.maximum.toString()} ${O}`}return`Занадта вялікі: чакалася, што ${A.origin??"значэнне"} павінна быць ${w}${A.maximum.toString()}`}case"too_small":{let w=A.inclusive?">=":">",b=I(A.origin);if(b){let N=Number(A.minimum),O=Cv(N,b.unit.one,b.unit.few,b.unit.many);return`Занадта малы: чакалася, што ${A.origin} павінна ${b.verb} ${w}${A.minimum.toString()} ${O}`}return`Занадта малы: чакалася, што ${A.origin} павінна быць ${w}${A.minimum.toString()}`}case"invalid_format":{let w=A;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]??A.format}`}case"not_multiple_of":return`Няправільны лік: павінен быць кратным ${A.divisor}`;case"unrecognized_keys":return`Нераспазнаны ${A.keys.length>1?"ключы":"ключ"}: ${z(A.keys,", ")}`;case"invalid_key":return`Няправільны ключ у ${A.origin}`;case"invalid_union":return"Няправільны ўвод";case"invalid_element":return`Няправільнае значэнне ў ${A.origin}`;default:return"Няправільны ўвод"}}};function r8(){return{localeError:of()}}var df=($)=>{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},pf=()=>{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}, получен ${df(D.input)}`;case"invalid_value":if(D.values.length===1)return`Невалиден вход: очакван ${S(D.values[0])}`;return`Невалидна опция: очаквано едно от ${z(D.values,"|")}`;case"too_big":{let A=D.inclusive?"<=":"<",w=I(D.origin);if(w)return`Твърде голямо: очаква се ${D.origin??"стойност"} да съдържа ${A}${D.maximum.toString()} ${w.unit??"елемента"}`;return`Твърде голямо: очаква се ${D.origin??"стойност"} да бъде ${A}${D.maximum.toString()}`}case"too_small":{let A=D.inclusive?">=":">",w=I(D.origin);if(w)return`Твърде малко: очаква се ${D.origin} да съдържа ${A}${D.minimum.toString()} ${w.unit}`;return`Твърде малко: очаква се ${D.origin} да бъде ${A}${D.minimum.toString()}`}case"invalid_format":{let A=D;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}`;let w="Невалиден";if(A.format==="emoji")w="Невалидно";if(A.format==="datetime")w="Невалидно";if(A.format==="date")w="Невалидна";if(A.format==="time")w="Невалидно";if(A.format==="duration")w="Невалидна";return`${w} ${U[A.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 i8(){return{localeError:pf()}}var tf=()=>{let $={string:{unit:"caràcters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function I(A){return $[A]??null}let U=(A)=>{let w=typeof A;switch(w){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&&A.constructor)return A.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(A)=>{switch(A.code){case"invalid_type":return`Tipus invàlid: s'esperava ${A.expected}, s'ha rebut ${U(A.input)}`;case"invalid_value":if(A.values.length===1)return`Valor invàlid: s'esperava ${S(A.values[0])}`;return`Opció invàlida: s'esperava una de ${z(A.values," o ")}`;case"too_big":{let w=A.inclusive?"com a màxim":"menys de",b=I(A.origin);if(b)return`Massa gran: s'esperava que ${A.origin??"el valor"} contingués ${w} ${A.maximum.toString()} ${b.unit??"elements"}`;return`Massa gran: s'esperava que ${A.origin??"el valor"} fos ${w} ${A.maximum.toString()}`}case"too_small":{let w=A.inclusive?"com a mínim":"més de",b=I(A.origin);if(b)return`Massa petit: s'esperava que ${A.origin} contingués ${w} ${A.minimum.toString()} ${b.unit}`;return`Massa petit: s'esperava que ${A.origin} fos ${w} ${A.minimum.toString()}`}case"invalid_format":{let w=A;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]??A.format}`}case"not_multiple_of":return`Número invàlid: ha de ser múltiple de ${A.divisor}`;case"unrecognized_keys":return`Clau${A.keys.length>1?"s":""} no reconeguda${A.keys.length>1?"s":""}: ${z(A.keys,", ")}`;case"invalid_key":return`Clau invàlida a ${A.origin}`;case"invalid_union":return"Entrada invàlida";case"invalid_element":return`Element invàlid a ${A.origin}`;default:return"Entrada invàlida"}}};function n8(){return{localeError:tf()}}var af=()=>{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(A){return $[A]??null}let U=(A)=>{let w=typeof A;switch(w){case"number":return Number.isNaN(A)?"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(A))return"pole";if(A===null)return"null";if(Object.getPrototypeOf(A)!==Object.prototype&&A.constructor)return A.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(A)=>{switch(A.code){case"invalid_type":return`Neplatný vstup: očekáváno ${A.expected}, obdrženo ${U(A.input)}`;case"invalid_value":if(A.values.length===1)return`Neplatný vstup: očekáváno ${S(A.values[0])}`;return`Neplatná možnost: očekávána jedna z hodnot ${z(A.values,"|")}`;case"too_big":{let w=A.inclusive?"<=":"<",b=I(A.origin);if(b)return`Hodnota je příliš velká: ${A.origin??"hodnota"} musí mít ${w}${A.maximum.toString()} ${b.unit??"prvků"}`;return`Hodnota je příliš velká: ${A.origin??"hodnota"} musí být ${w}${A.maximum.toString()}`}case"too_small":{let w=A.inclusive?">=":">",b=I(A.origin);if(b)return`Hodnota je příliš malá: ${A.origin??"hodnota"} musí mít ${w}${A.minimum.toString()} ${b.unit??"prvků"}`;return`Hodnota je příliš malá: ${A.origin??"hodnota"} musí být ${w}${A.minimum.toString()}`}case"invalid_format":{let w=A;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]??A.format}`}case"not_multiple_of":return`Neplatné číslo: musí být násobkem ${A.divisor}`;case"unrecognized_keys":return`Neznámé klíče: ${z(A.keys,", ")}`;case"invalid_key":return`Neplatný klíč v ${A.origin}`;case"invalid_union":return"Neplatný vstup";case"invalid_element":return`Neplatná hodnota v ${A.origin}`;default:return"Neplatný vstup"}}};function o8(){return{localeError:af()}}var ef=()=>{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(b){return $[b]??null}function D(b){return I[b]??b}let A=(b)=>{let N=typeof b;switch(N){case"number":return Number.isNaN(b)?"NaN":"tal";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"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(b)=>{switch(b.code){case"invalid_type":return`Ugyldigt input: forventede ${D(b.expected)}, fik ${D(A(b.input))}`;case"invalid_value":if(b.values.length===1)return`Ugyldig værdi: forventede ${S(b.values[0])}`;return`Ugyldigt valg: forventede en af følgende ${z(b.values,"|")}`;case"too_big":{let N=b.inclusive?"<=":"<",O=U(b.origin),X=D(b.origin);if(O)return`For stor: forventede ${X??"value"} ${O.verb} ${N} ${b.maximum.toString()} ${O.unit??"elementer"}`;return`For stor: forventede ${X??"value"} havde ${N} ${b.maximum.toString()}`}case"too_small":{let N=b.inclusive?">=":">",O=U(b.origin),X=D(b.origin);if(O)return`For lille: forventede ${X} ${O.verb} ${N} ${b.minimum.toString()} ${O.unit}`;return`For lille: forventede ${X} havde ${N} ${b.minimum.toString()}`}case"invalid_format":{let N=b;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]??b.format}`}case"not_multiple_of":return`Ugyldigt tal: skal være deleligt med ${b.divisor}`;case"unrecognized_keys":return`${b.keys.length>1?"Ukendte nøgler":"Ukendt nøgle"}: ${z(b.keys,", ")}`;case"invalid_key":return`Ugyldig nøgle i ${b.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig værdi i ${b.origin}`;default:return"Ugyldigt input"}}};function d8(){return{localeError:ef()}}var sf=()=>{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(A){return $[A]??null}let U=(A)=>{let w=typeof A;switch(w){case"number":return Number.isNaN(A)?"NaN":"Zahl";case"object":{if(Array.isArray(A))return"Array";if(A===null)return"null";if(Object.getPrototypeOf(A)!==Object.prototype&&A.constructor)return A.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(A)=>{switch(A.code){case"invalid_type":return`Ungültige Eingabe: erwartet ${A.expected}, erhalten ${U(A.input)}`;case"invalid_value":if(A.values.length===1)return`Ungültige Eingabe: erwartet ${S(A.values[0])}`;return`Ungültige Option: erwartet eine von ${z(A.values,"|")}`;case"too_big":{let w=A.inclusive?"<=":"<",b=I(A.origin);if(b)return`Zu groß: erwartet, dass ${A.origin??"Wert"} ${w}${A.maximum.toString()} ${b.unit??"Elemente"} hat`;return`Zu groß: erwartet, dass ${A.origin??"Wert"} ${w}${A.maximum.toString()} ist`}case"too_small":{let w=A.inclusive?">=":">",b=I(A.origin);if(b)return`Zu klein: erwartet, dass ${A.origin} ${w}${A.minimum.toString()} ${b.unit} hat`;return`Zu klein: erwartet, dass ${A.origin} ${w}${A.minimum.toString()} ist`}case"invalid_format":{let w=A;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]??A.format}`}case"not_multiple_of":return`Ungültige Zahl: muss ein Vielfaches von ${A.divisor} sein`;case"unrecognized_keys":return`${A.keys.length>1?"Unbekannte Schlüssel":"Unbekannter Schlüssel"}: ${z(A.keys,", ")}`;case"invalid_key":return`Ungültiger Schlüssel in ${A.origin}`;case"invalid_union":return"Ungültige Eingabe";case"invalid_element":return`Ungültiger Wert in ${A.origin}`;default:return"Ungültige Eingabe"}}};function p8(){return{localeError:sf()}}var $y=($)=>{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},Iy=()=>{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 ${$y(D.input)}`;case"invalid_value":if(D.values.length===1)return`Invalid input: expected ${S(D.values[0])}`;return`Invalid option: expected one of ${z(D.values,"|")}`;case"too_big":{let A=D.inclusive?"<=":"<",w=I(D.origin);if(w)return`Too big: expected ${D.origin??"value"} to have ${A}${D.maximum.toString()} ${w.unit??"elements"}`;return`Too big: expected ${D.origin??"value"} to be ${A}${D.maximum.toString()}`}case"too_small":{let A=D.inclusive?">=":">",w=I(D.origin);if(w)return`Too small: expected ${D.origin} to have ${A}${D.minimum.toString()} ${w.unit}`;return`Too small: expected ${D.origin} to be ${A}${D.minimum.toString()}`}case"invalid_format":{let A=D;if(A.format==="starts_with")return`Invalid string: must start with "${A.prefix}"`;if(A.format==="ends_with")return`Invalid string: must end with "${A.suffix}"`;if(A.format==="includes")return`Invalid string: must include "${A.includes}"`;if(A.format==="regex")return`Invalid string: must match pattern ${A.pattern}`;return`Invalid ${U[A.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 I0(){return{localeError:Iy()}}var Uy=($)=>{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},Ay=()=>{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 ${Uy(D.input)}`;case"invalid_value":if(D.values.length===1)return`Nevalida enigo: atendiĝis ${S(D.values[0])}`;return`Nevalida opcio: atendiĝis unu el ${z(D.values,"|")}`;case"too_big":{let A=D.inclusive?"<=":"<",w=I(D.origin);if(w)return`Tro granda: atendiĝis ke ${D.origin??"valoro"} havu ${A}${D.maximum.toString()} ${w.unit??"elementojn"}`;return`Tro granda: atendiĝis ke ${D.origin??"valoro"} havu ${A}${D.maximum.toString()}`}case"too_small":{let A=D.inclusive?">=":">",w=I(D.origin);if(w)return`Tro malgranda: atendiĝis ke ${D.origin} havu ${A}${D.minimum.toString()} ${w.unit}`;return`Tro malgranda: atendiĝis ke ${D.origin} estu ${A}${D.minimum.toString()}`}case"invalid_format":{let A=D;if(A.format==="starts_with")return`Nevalida karaktraro: devas komenciĝi per "${A.prefix}"`;if(A.format==="ends_with")return`Nevalida karaktraro: devas finiĝi per "${A.suffix}"`;if(A.format==="includes")return`Nevalida karaktraro: devas inkluzivi "${A.includes}"`;if(A.format==="regex")return`Nevalida karaktraro: devas kongrui kun la modelo ${A.pattern}`;return`Nevalida ${U[A.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 t8(){return{localeError:Ay()}}var Dy=()=>{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(b){return $[b]??null}function D(b){return I[b]??b}let A=(b)=>{let N=typeof b;switch(N){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)return b.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(b)=>{switch(b.code){case"invalid_type":return`Entrada inválida: se esperaba ${D(b.expected)}, recibido ${D(A(b.input))}`;case"invalid_value":if(b.values.length===1)return`Entrada inválida: se esperaba ${S(b.values[0])}`;return`Opción inválida: se esperaba una de ${z(b.values,"|")}`;case"too_big":{let N=b.inclusive?"<=":"<",O=U(b.origin),X=D(b.origin);if(O)return`Demasiado grande: se esperaba que ${X??"valor"} tuviera ${N}${b.maximum.toString()} ${O.unit??"elementos"}`;return`Demasiado grande: se esperaba que ${X??"valor"} fuera ${N}${b.maximum.toString()}`}case"too_small":{let N=b.inclusive?">=":">",O=U(b.origin),X=D(b.origin);if(O)return`Demasiado pequeño: se esperaba que ${X} tuviera ${N}${b.minimum.toString()} ${O.unit}`;return`Demasiado pequeño: se esperaba que ${X} fuera ${N}${b.minimum.toString()}`}case"invalid_format":{let N=b;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]??b.format}`}case"not_multiple_of":return`Número inválido: debe ser múltiplo de ${b.divisor}`;case"unrecognized_keys":return`Llave${b.keys.length>1?"s":""} desconocida${b.keys.length>1?"s":""}: ${z(b.keys,", ")}`;case"invalid_key":return`Llave inválida en ${D(b.origin)}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido en ${D(b.origin)}`;default:return"Entrada inválida"}}};function a8(){return{localeError:Dy()}}var wy=()=>{let $={string:{unit:"کاراکتر",verb:"داشته باشد"},file:{unit:"بایت",verb:"داشته باشد"},array:{unit:"آیتم",verb:"داشته باشد"},set:{unit:"آیتم",verb:"داشته باشد"}};function I(A){return $[A]??null}let U=(A)=>{let w=typeof A;switch(w){case"number":return Number.isNaN(A)?"NaN":"عدد";case"object":{if(Array.isArray(A))return"آرایه";if(A===null)return"null";if(Object.getPrototypeOf(A)!==Object.prototype&&A.constructor)return A.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(A)=>{switch(A.code){case"invalid_type":return`ورودی نامعتبر: می‌بایست ${A.expected} می‌بود، ${U(A.input)} دریافت شد`;case"invalid_value":if(A.values.length===1)return`ورودی نامعتبر: می‌بایست ${S(A.values[0])} می‌بود`;return`گزینه نامعتبر: می‌بایست یکی از ${z(A.values,"|")} می‌بود`;case"too_big":{let w=A.inclusive?"<=":"<",b=I(A.origin);if(b)return`خیلی بزرگ: ${A.origin??"مقدار"} باید ${w}${A.maximum.toString()} ${b.unit??"عنصر"} باشد`;return`خیلی بزرگ: ${A.origin??"مقدار"} باید ${w}${A.maximum.toString()} باشد`}case"too_small":{let w=A.inclusive?">=":">",b=I(A.origin);if(b)return`خیلی کوچک: ${A.origin} باید ${w}${A.minimum.toString()} ${b.unit} باشد`;return`خیلی کوچک: ${A.origin} باید ${w}${A.minimum.toString()} باشد`}case"invalid_format":{let w=A;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]??A.format} نامعتبر`}case"not_multiple_of":return`عدد نامعتبر: باید مضرب ${A.divisor} باشد`;case"unrecognized_keys":return`کلید${A.keys.length>1?"های":""} ناشناس: ${z(A.keys,", ")}`;case"invalid_key":return`کلید ناشناس در ${A.origin}`;case"invalid_union":return"ورودی نامعتبر";case"invalid_element":return`مقدار نامعتبر در ${A.origin}`;default:return"ورودی نامعتبر"}}};function e8(){return{localeError:wy()}}var by=()=>{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(A){return $[A]??null}let U=(A)=>{let w=typeof A;switch(w){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&&A.constructor)return A.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(A)=>{switch(A.code){case"invalid_type":return`Virheellinen tyyppi: odotettiin ${A.expected}, oli ${U(A.input)}`;case"invalid_value":if(A.values.length===1)return`Virheellinen syöte: täytyy olla ${S(A.values[0])}`;return`Virheellinen valinta: täytyy olla yksi seuraavista: ${z(A.values,"|")}`;case"too_big":{let w=A.inclusive?"<=":"<",b=I(A.origin);if(b)return`Liian suuri: ${b.subject} täytyy olla ${w}${A.maximum.toString()} ${b.unit}`.trim();return`Liian suuri: arvon täytyy olla ${w}${A.maximum.toString()}`}case"too_small":{let w=A.inclusive?">=":">",b=I(A.origin);if(b)return`Liian pieni: ${b.subject} täytyy olla ${w}${A.minimum.toString()} ${b.unit}`.trim();return`Liian pieni: arvon täytyy olla ${w}${A.minimum.toString()}`}case"invalid_format":{let w=A;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]??A.format}`}case"not_multiple_of":return`Virheellinen luku: täytyy olla luvun ${A.divisor} monikerta`;case"unrecognized_keys":return`${A.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${z(A.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 s8(){return{localeError:by()}}var Ny=()=>{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(A){return $[A]??null}let U=(A)=>{let w=typeof A;switch(w){case"number":return Number.isNaN(A)?"NaN":"nombre";case"object":{if(Array.isArray(A))return"tableau";if(A===null)return"null";if(Object.getPrototypeOf(A)!==Object.prototype&&A.constructor)return A.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(A)=>{switch(A.code){case"invalid_type":return`Entrée invalide : ${A.expected} attendu, ${U(A.input)} reçu`;case"invalid_value":if(A.values.length===1)return`Entrée invalide : ${S(A.values[0])} attendu`;return`Option invalide : une valeur parmi ${z(A.values,"|")} attendue`;case"too_big":{let w=A.inclusive?"<=":"<",b=I(A.origin);if(b)return`Trop grand : ${A.origin??"valeur"} doit ${b.verb} ${w}${A.maximum.toString()} ${b.unit??"élément(s)"}`;return`Trop grand : ${A.origin??"valeur"} doit être ${w}${A.maximum.toString()}`}case"too_small":{let w=A.inclusive?">=":">",b=I(A.origin);if(b)return`Trop petit : ${A.origin} doit ${b.verb} ${w}${A.minimum.toString()} ${b.unit}`;return`Trop petit : ${A.origin} doit être ${w}${A.minimum.toString()}`}case"invalid_format":{let w=A;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]??A.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${A.divisor}`;case"unrecognized_keys":return`Clé${A.keys.length>1?"s":""} non reconnue${A.keys.length>1?"s":""} : ${z(A.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${A.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${A.origin}`;default:return"Entrée invalide"}}};function $Q(){return{localeError:Ny()}}var Oy=()=>{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(A){return $[A]??null}let U=(A)=>{let w=typeof A;switch(w){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&&A.constructor)return A.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(A)=>{switch(A.code){case"invalid_type":return`Entrée invalide : attendu ${A.expected}, reçu ${U(A.input)}`;case"invalid_value":if(A.values.length===1)return`Entrée invalide : attendu ${S(A.values[0])}`;return`Option invalide : attendu l'une des valeurs suivantes ${z(A.values,"|")}`;case"too_big":{let w=A.inclusive?"≤":"<",b=I(A.origin);if(b)return`Trop grand : attendu que ${A.origin??"la valeur"} ait ${w}${A.maximum.toString()} ${b.unit}`;return`Trop grand : attendu que ${A.origin??"la valeur"} soit ${w}${A.maximum.toString()}`}case"too_small":{let w=A.inclusive?"≥":">",b=I(A.origin);if(b)return`Trop petit : attendu que ${A.origin} ait ${w}${A.minimum.toString()} ${b.unit}`;return`Trop petit : attendu que ${A.origin} soit ${w}${A.minimum.toString()}`}case"invalid_format":{let w=A;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]??A.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${A.divisor}`;case"unrecognized_keys":return`Clé${A.keys.length>1?"s":""} non reconnue${A.keys.length>1?"s":""} : ${z(A.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${A.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${A.origin}`;default:return"Entrée invalide"}}};function IQ(){return{localeError:Oy()}}var Xy=()=>{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 W=U(X);if(W)return W.label;return X??$.unknown.label},A=(X)=>`ה${D(X)}`,w=(X)=>{return(U(X)?.gender??"m")==="f"?"צריכה להיות":"צריך להיות"},b=(X)=>{if(!X)return null;return I[X]??null},N=(X)=>{let W=typeof X;switch(W){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 W}},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 W=X.expected,Q=D(W),B=N(X.input),Y=$[B]?.label??B;return`קלט לא תקין: צריך להיות ${Q}, התקבל ${Y}`}case"invalid_value":{if(X.values.length===1)return`ערך לא תקין: הערך חייב להיות ${S(X.values[0])}`;let W=X.values.map((Y)=>S(Y));if(X.values.length===2)return`ערך לא תקין: האפשרויות המתאימות הן ${W[0]} או ${W[1]}`;let Q=W[W.length-1];return`ערך לא תקין: האפשרויות המתאימות הן ${W.slice(0,-1).join(", ")} או ${Q}`}case"too_big":{let W=b(X.origin),Q=A(X.origin??"value");if(X.origin==="string")return`${W?.longLabel??"ארוך"} מדי: ${Q} צריכה להכיל ${X.maximum.toString()} ${W?.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"?"צריכה":"צריך",H=X.inclusive?`${X.maximum} ${W?.unit??""} או פחות`:`פחות מ-${X.maximum} ${W?.unit??""}`;return`גדול מדי: ${Q} ${J} להכיל ${H}`.trim()}let B=X.inclusive?"<=":"<",Y=w(X.origin??"value");if(W?.unit)return`${W.longLabel} מדי: ${Q} ${Y} ${B}${X.maximum.toString()} ${W.unit}`;return`${W?.longLabel??"גדול"} מדי: ${Q} ${Y} ${B}${X.maximum.toString()}`}case"too_small":{let W=b(X.origin),Q=A(X.origin??"value");if(X.origin==="string")return`${W?.shortLabel??"קצר"} מדי: ${Q} צריכה להכיל ${X.minimum.toString()} ${W?.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 v=X.origin==="set"?"לפחות פריט אחד":"לפחות פריט אחד";return`קטן מדי: ${Q} ${J} להכיל ${v}`}let H=X.inclusive?`${X.minimum} ${W?.unit??""} או יותר`:`יותר מ-${X.minimum} ${W?.unit??""}`;return`קטן מדי: ${Q} ${J} להכיל ${H}`.trim()}let B=X.inclusive?">=":">",Y=w(X.origin??"value");if(W?.unit)return`${W.shortLabel} מדי: ${Q} ${Y} ${B}${X.minimum.toString()} ${W.unit}`;return`${W?.shortLabel??"קטן"} מדי: ${Q} ${Y} ${B}${X.minimum.toString()}`}case"invalid_format":{let W=X;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}`;let Q=O[W.format],B=Q?.label??W.format,J=(Q?.gender??"m")==="f"?"תקינה":"תקין";return`${B} לא ${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`ערך לא תקין ב${A(X.origin??"array")}`;default:return"קלט לא תקין"}}};function UQ(){return{localeError:Xy()}}var Wy=()=>{let $={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function I(A){return $[A]??null}let U=(A)=>{let w=typeof A;switch(w){case"number":return Number.isNaN(A)?"NaN":"szám";case"object":{if(Array.isArray(A))return"tömb";if(A===null)return"null";if(Object.getPrototypeOf(A)!==Object.prototype&&A.constructor)return A.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(A)=>{switch(A.code){case"invalid_type":return`Érvénytelen bemenet: a várt érték ${A.expected}, a kapott érték ${U(A.input)}`;case"invalid_value":if(A.values.length===1)return`Érvénytelen bemenet: a várt érték ${S(A.values[0])}`;return`Érvénytelen opció: valamelyik érték várt ${z(A.values,"|")}`;case"too_big":{let w=A.inclusive?"<=":"<",b=I(A.origin);if(b)return`Túl nagy: ${A.origin??"érték"} mérete túl nagy ${w}${A.maximum.toString()} ${b.unit??"elem"}`;return`Túl nagy: a bemeneti érték ${A.origin??"érték"} túl nagy: ${w}${A.maximum.toString()}`}case"too_small":{let w=A.inclusive?">=":">",b=I(A.origin);if(b)return`Túl kicsi: a bemeneti érték ${A.origin} mérete túl kicsi ${w}${A.minimum.toString()} ${b.unit}`;return`Túl kicsi: a bemeneti érték ${A.origin} túl kicsi ${w}${A.minimum.toString()}`}case"invalid_format":{let w=A;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]??A.format}`}case"not_multiple_of":return`Érvénytelen szám: ${A.divisor} többszörösének kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${A.keys.length>1?"s":""}: ${z(A.keys,", ")}`;case"invalid_key":return`Érvénytelen kulcs ${A.origin}`;case"invalid_union":return"Érvénytelen bemenet";case"invalid_element":return`Érvénytelen érték: ${A.origin}`;default:return"Érvénytelen bemenet"}}};function AQ(){return{localeError:Wy()}}var Gy=()=>{let $={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function I(A){return $[A]??null}let U=(A)=>{let w=typeof A;switch(w){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&&A.constructor)return A.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(A)=>{switch(A.code){case"invalid_type":return`Input tidak valid: diharapkan ${A.expected}, diterima ${U(A.input)}`;case"invalid_value":if(A.values.length===1)return`Input tidak valid: diharapkan ${S(A.values[0])}`;return`Pilihan tidak valid: diharapkan salah satu dari ${z(A.values,"|")}`;case"too_big":{let w=A.inclusive?"<=":"<",b=I(A.origin);if(b)return`Terlalu besar: diharapkan ${A.origin??"value"} memiliki ${w}${A.maximum.toString()} ${b.unit??"elemen"}`;return`Terlalu besar: diharapkan ${A.origin??"value"} menjadi ${w}${A.maximum.toString()}`}case"too_small":{let w=A.inclusive?">=":">",b=I(A.origin);if(b)return`Terlalu kecil: diharapkan ${A.origin} memiliki ${w}${A.minimum.toString()} ${b.unit}`;return`Terlalu kecil: diharapkan ${A.origin} menjadi ${w}${A.minimum.toString()}`}case"invalid_format":{let w=A;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]??A.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${A.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${A.keys.length>1?"s":""}: ${z(A.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${A.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${A.origin}`;default:return"Input tidak valid"}}};function DQ(){return{localeError:Gy()}}var Qy=($)=>{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},Yy=()=>{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 ${Qy(D.input)} þar sem á að vera ${D.expected}`;case"invalid_value":if(D.values.length===1)return`Rangt gildi: gert ráð fyrir ${S(D.values[0])}`;return`Ógilt val: má vera eitt af eftirfarandi ${z(D.values,"|")}`;case"too_big":{let A=D.inclusive?"<=":"<",w=I(D.origin);if(w)return`Of stórt: gert er ráð fyrir að ${D.origin??"gildi"} hafi ${A}${D.maximum.toString()} ${w.unit??"hluti"}`;return`Of stórt: gert er ráð fyrir að ${D.origin??"gildi"} sé ${A}${D.maximum.toString()}`}case"too_small":{let A=D.inclusive?">=":">",w=I(D.origin);if(w)return`Of lítið: gert er ráð fyrir að ${D.origin} hafi ${A}${D.minimum.toString()} ${w.unit}`;return`Of lítið: gert er ráð fyrir að ${D.origin} sé ${A}${D.minimum.toString()}`}case"invalid_format":{let A=D;if(A.format==="starts_with")return`Ógildur strengur: verður að byrja á "${A.prefix}"`;if(A.format==="ends_with")return`Ógildur strengur: verður að enda á "${A.suffix}"`;if(A.format==="includes")return`Ógildur strengur: verður að innihalda "${A.includes}"`;if(A.format==="regex")return`Ógildur strengur: verður að fylgja mynstri ${A.pattern}`;return`Rangt ${U[A.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 wQ(){return{localeError:Yy()}}var By=()=>{let $={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function I(A){return $[A]??null}let U=(A)=>{let w=typeof A;switch(w){case"number":return Number.isNaN(A)?"NaN":"numero";case"object":{if(Array.isArray(A))return"vettore";if(A===null)return"null";if(Object.getPrototypeOf(A)!==Object.prototype&&A.constructor)return A.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(A)=>{switch(A.code){case"invalid_type":return`Input non valido: atteso ${A.expected}, ricevuto ${U(A.input)}`;case"invalid_value":if(A.values.length===1)return`Input non valido: atteso ${S(A.values[0])}`;return`Opzione non valida: atteso uno tra ${z(A.values,"|")}`;case"too_big":{let w=A.inclusive?"<=":"<",b=I(A.origin);if(b)return`Troppo grande: ${A.origin??"valore"} deve avere ${w}${A.maximum.toString()} ${b.unit??"elementi"}`;return`Troppo grande: ${A.origin??"valore"} deve essere ${w}${A.maximum.toString()}`}case"too_small":{let w=A.inclusive?">=":">",b=I(A.origin);if(b)return`Troppo piccolo: ${A.origin} deve avere ${w}${A.minimum.toString()} ${b.unit}`;return`Troppo piccolo: ${A.origin} deve essere ${w}${A.minimum.toString()}`}case"invalid_format":{let w=A;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]??A.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${A.divisor}`;case"unrecognized_keys":return`Chiav${A.keys.length>1?"i":"e"} non riconosciut${A.keys.length>1?"e":"a"}: ${z(A.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${A.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${A.origin}`;default:return"Input non valido"}}};function bQ(){return{localeError:By()}}var Jy=()=>{let $={string:{unit:"文字",verb:"である"},file:{unit:"バイト",verb:"である"},array:{unit:"要素",verb:"である"},set:{unit:"要素",verb:"である"}};function I(A){return $[A]??null}let U=(A)=>{let w=typeof A;switch(w){case"number":return Number.isNaN(A)?"NaN":"数値";case"object":{if(Array.isArray(A))return"配列";if(A===null)return"null";if(Object.getPrototypeOf(A)!==Object.prototype&&A.constructor)return A.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(A)=>{switch(A.code){case"invalid_type":return`無効な入力: ${A.expected}が期待されましたが、${U(A.input)}が入力されました`;case"invalid_value":if(A.values.length===1)return`無効な入力: ${S(A.values[0])}が期待されました`;return`無効な選択: ${z(A.values,"、")}のいずれかである必要があります`;case"too_big":{let w=A.inclusive?"以下である":"より小さい",b=I(A.origin);if(b)return`大きすぎる値: ${A.origin??"値"}は${A.maximum.toString()}${b.unit??"要素"}${w}必要があります`;return`大きすぎる値: ${A.origin??"値"}は${A.maximum.toString()}${w}必要があります`}case"too_small":{let w=A.inclusive?"以上である":"より大きい",b=I(A.origin);if(b)return`小さすぎる値: ${A.origin}は${A.minimum.toString()}${b.unit}${w}必要があります`;return`小さすぎる値: ${A.origin}は${A.minimum.toString()}${w}必要があります`}case"invalid_format":{let w=A;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]??A.format}`}case"not_multiple_of":return`無効な数値: ${A.divisor}の倍数である必要があります`;case"unrecognized_keys":return`認識されていないキー${A.keys.length>1?"群":""}: ${z(A.keys,"、")}`;case"invalid_key":return`${A.origin}内の無効なキー`;case"invalid_union":return"無効な入力";case"invalid_element":return`${A.origin}内の無効な値`;default:return"無効な入力"}}};function NQ(){return{localeError:Jy()}}var Hy=($)=>{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},Ly=()=>{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}, მიღებული ${Hy(D.input)}`;case"invalid_value":if(D.values.length===1)return`არასწორი შეყვანა: მოსალოდნელი ${S(D.values[0])}`;return`არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${z(D.values,"|")}-დან`;case"too_big":{let A=D.inclusive?"<=":"<",w=I(D.origin);if(w)return`ზედმეტად დიდი: მოსალოდნელი ${D.origin??"მნიშვნელობა"} ${w.verb} ${A}${D.maximum.toString()} ${w.unit}`;return`ზედმეტად დიდი: მოსალოდნელი ${D.origin??"მნიშვნელობა"} იყოს ${A}${D.maximum.toString()}`}case"too_small":{let A=D.inclusive?">=":">",w=I(D.origin);if(w)return`ზედმეტად პატარა: მოსალოდნელი ${D.origin} ${w.verb} ${A}${D.minimum.toString()} ${w.unit}`;return`ზედმეტად პატარა: მოსალოდნელი ${D.origin} იყოს ${A}${D.minimum.toString()}`}case"invalid_format":{let A=D;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`არასწორი ${U[A.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 OQ(){return{localeError:Ly()}}var zy=()=>{let $={string:{unit:"តួអក្សរ",verb:"គួរមាន"},file:{unit:"បៃ",verb:"គួរមាន"},array:{unit:"ធាតុ",verb:"គួរមាន"},set:{unit:"ធាតុ",verb:"គួរមាន"}};function I(A){return $[A]??null}let U=(A)=>{let w=typeof A;switch(w){case"number":return Number.isNaN(A)?"មិនមែនជាលេខ (NaN)":"លេខ";case"object":{if(Array.isArray(A))return"អារេ (Array)";if(A===null)return"គ្មានតម្លៃ (null)";if(Object.getPrototypeOf(A)!==Object.prototype&&A.constructor)return A.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(A)=>{switch(A.code){case"invalid_type":return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${A.expected} ប៉ុន្តែទទួលបាន ${U(A.input)}`;case"invalid_value":if(A.values.length===1)return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${S(A.values[0])}`;return`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${z(A.values,"|")}`;case"too_big":{let w=A.inclusive?"<=":"<",b=I(A.origin);if(b)return`ធំពេក៖ ត្រូវការ ${A.origin??"តម្លៃ"} ${w} ${A.maximum.toString()} ${b.unit??"ធាតុ"}`;return`ធំពេក៖ ត្រូវការ ${A.origin??"តម្លៃ"} ${w} ${A.maximum.toString()}`}case"too_small":{let w=A.inclusive?">=":">",b=I(A.origin);if(b)return`តូចពេក៖ ត្រូវការ ${A.origin} ${w} ${A.minimum.toString()} ${b.unit}`;return`តូចពេក៖ ត្រូវការ ${A.origin} ${w} ${A.minimum.toString()}`}case"invalid_format":{let w=A;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]??A.format}`}case"not_multiple_of":return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${A.divisor}`;case"unrecognized_keys":return`រកឃើញសោមិនស្គាល់៖ ${z(A.keys,", ")}`;case"invalid_key":return`សោមិនត្រឹមត្រូវនៅក្នុង ${A.origin}`;case"invalid_union":return"ទិន្នន័យមិនត្រឹមត្រូវ";case"invalid_element":return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${A.origin}`;default:return"ទិន្នន័យមិនត្រឹមត្រូវ"}}};function U0(){return{localeError:zy()}}function XQ(){return U0()}var My=()=>{let $={string:{unit:"문자",verb:"to have"},file:{unit:"바이트",verb:"to have"},array:{unit:"개",verb:"to have"},set:{unit:"개",verb:"to have"}};function I(A){return $[A]??null}let U=(A)=>{let w=typeof A;switch(w){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&&A.constructor)return A.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(A)=>{switch(A.code){case"invalid_type":return`잘못된 입력: 예상 타입은 ${A.expected}, 받은 타입은 ${U(A.input)}입니다`;case"invalid_value":if(A.values.length===1)return`잘못된 입력: 값은 ${S(A.values[0])} 이어야 합니다`;return`잘못된 옵션: ${z(A.values,"또는 ")} 중 하나여야 합니다`;case"too_big":{let w=A.inclusive?"이하":"미만",b=w==="미만"?"이어야 합니다":"여야 합니다",N=I(A.origin),O=N?.unit??"요소";if(N)return`${A.origin??"값"}이 너무 큽니다: ${A.maximum.toString()}${O} ${w}${b}`;return`${A.origin??"값"}이 너무 큽니다: ${A.maximum.toString()} ${w}${b}`}case"too_small":{let w=A.inclusive?"이상":"초과",b=w==="이상"?"이어야 합니다":"여야 합니다",N=I(A.origin),O=N?.unit??"요소";if(N)return`${A.origin??"값"}이 너무 작습니다: ${A.minimum.toString()}${O} ${w}${b}`;return`${A.origin??"값"}이 너무 작습니다: ${A.minimum.toString()} ${w}${b}`}case"invalid_format":{let w=A;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]??A.format}`}case"not_multiple_of":return`잘못된 숫자: ${A.divisor}의 배수여야 합니다`;case"unrecognized_keys":return`인식할 수 없는 키: ${z(A.keys,", ")}`;case"invalid_key":return`잘못된 키: ${A.origin}`;case"invalid_union":return"잘못된 입력";case"invalid_element":return`잘못된 값: ${A.origin}`;default:return"잘못된 입력"}}};function WQ(){return{localeError:My()}}var Ky=($)=>{return D0(typeof $,$)},D0=($,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 $},A0=($)=>{return $.charAt(0).toUpperCase()+$.slice(1)};function Zv($){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 Vy=()=>{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,A,w,b){let N=$[D]??null;if(N===null)return N;return{unit:N.unit[A],verb:N.verb[b][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 ${Ky(D.input)}, o tikėtasi - ${D0(D.expected)}`;case"invalid_value":if(D.values.length===1)return`Privalo būti ${S(D.values[0])}`;return`Privalo būti vienas iš ${z(D.values,"|")} pasirinkimų`;case"too_big":{let A=D0(D.origin),w=I(D.origin,Zv(Number(D.maximum)),D.inclusive??!1,"smaller");if(w?.verb)return`${A0(A??D.origin??"reikšmė")} ${w.verb} ${D.maximum.toString()} ${w.unit??"elementų"}`;let b=D.inclusive?"ne didesnis kaip":"mažesnis kaip";return`${A0(A??D.origin??"reikšmė")} turi būti ${b} ${D.maximum.toString()} ${w?.unit}`}case"too_small":{let A=D0(D.origin),w=I(D.origin,Zv(Number(D.minimum)),D.inclusive??!1,"bigger");if(w?.verb)return`${A0(A??D.origin??"reikšmė")} ${w.verb} ${D.minimum.toString()} ${w.unit??"elementų"}`;let b=D.inclusive?"ne mažesnis kaip":"didesnis kaip";return`${A0(A??D.origin??"reikšmė")} turi būti ${b} ${D.minimum.toString()} ${w?.unit}`}case"invalid_format":{let A=D;if(A.format==="starts_with")return`Eilutė privalo prasidėti "${A.prefix}"`;if(A.format==="ends_with")return`Eilutė privalo pasibaigti "${A.suffix}"`;if(A.format==="includes")return`Eilutė privalo įtraukti "${A.includes}"`;if(A.format==="regex")return`Eilutė privalo atitikti ${A.pattern}`;return`Neteisingas ${U[A.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 A=D0(D.origin);return`${A0(A??D.origin??"reikšmė")} turi klaidingą įvestį`}default:return"Klaidinga įvestis"}}};function GQ(){return{localeError:Vy()}}var vy=()=>{let $={string:{unit:"знаци",verb:"да имаат"},file:{unit:"бајти",verb:"да имаат"},array:{unit:"ставки",verb:"да имаат"},set:{unit:"ставки",verb:"да имаат"}};function I(A){return $[A]??null}let U=(A)=>{let w=typeof A;switch(w){case"number":return Number.isNaN(A)?"NaN":"број";case"object":{if(Array.isArray(A))return"низа";if(A===null)return"null";if(Object.getPrototypeOf(A)!==Object.prototype&&A.constructor)return A.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(A)=>{switch(A.code){case"invalid_type":return`Грешен внес: се очекува ${A.expected}, примено ${U(A.input)}`;case"invalid_value":if(A.values.length===1)return`Invalid input: expected ${S(A.values[0])}`;return`Грешана опција: се очекува една ${z(A.values,"|")}`;case"too_big":{let w=A.inclusive?"<=":"<",b=I(A.origin);if(b)return`Премногу голем: се очекува ${A.origin??"вредноста"} да има ${w}${A.maximum.toString()} ${b.unit??"елементи"}`;return`Премногу голем: се очекува ${A.origin??"вредноста"} да биде ${w}${A.maximum.toString()}`}case"too_small":{let w=A.inclusive?">=":">",b=I(A.origin);if(b)return`Премногу мал: се очекува ${A.origin} да има ${w}${A.minimum.toString()} ${b.unit}`;return`Премногу мал: се очекува ${A.origin} да биде ${w}${A.minimum.toString()}`}case"invalid_format":{let w=A;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]??A.format}`}case"not_multiple_of":return`Грешен број: мора да биде делив со ${A.divisor}`;case"unrecognized_keys":return`${A.keys.length>1?"Непрепознаени клучеви":"Непрепознаен клуч"}: ${z(A.keys,", ")}`;case"invalid_key":return`Грешен клуч во ${A.origin}`;case"invalid_union":return"Грешен внес";case"invalid_element":return`Грешна вредност во ${A.origin}`;default:return"Грешен внес"}}};function QQ(){return{localeError:vy()}}var qy=()=>{let $={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function I(A){return $[A]??null}let U=(A)=>{let w=typeof A;switch(w){case"number":return Number.isNaN(A)?"NaN":"nombor";case"object":{if(Array.isArray(A))return"array";if(A===null)return"null";if(Object.getPrototypeOf(A)!==Object.prototype&&A.constructor)return A.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(A)=>{switch(A.code){case"invalid_type":return`Input tidak sah: dijangka ${A.expected}, diterima ${U(A.input)}`;case"invalid_value":if(A.values.length===1)return`Input tidak sah: dijangka ${S(A.values[0])}`;return`Pilihan tidak sah: dijangka salah satu daripada ${z(A.values,"|")}`;case"too_big":{let w=A.inclusive?"<=":"<",b=I(A.origin);if(b)return`Terlalu besar: dijangka ${A.origin??"nilai"} ${b.verb} ${w}${A.maximum.toString()} ${b.unit??"elemen"}`;return`Terlalu besar: dijangka ${A.origin??"nilai"} adalah ${w}${A.maximum.toString()}`}case"too_small":{let w=A.inclusive?">=":">",b=I(A.origin);if(b)return`Terlalu kecil: dijangka ${A.origin} ${b.verb} ${w}${A.minimum.toString()} ${b.unit}`;return`Terlalu kecil: dijangka ${A.origin} adalah ${w}${A.minimum.toString()}`}case"invalid_format":{let w=A;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]??A.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${A.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${z(A.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${A.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${A.origin}`;default:return"Input tidak sah"}}};function YQ(){return{localeError:qy()}}var Fy=()=>{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(A){return $[A]??null}let U=(A)=>{let w=typeof A;switch(w){case"number":return Number.isNaN(A)?"NaN":"getal";case"object":{if(Array.isArray(A))return"array";if(A===null)return"null";if(Object.getPrototypeOf(A)!==Object.prototype&&A.constructor)return A.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(A)=>{switch(A.code){case"invalid_type":return`Ongeldige invoer: verwacht ${A.expected}, ontving ${U(A.input)}`;case"invalid_value":if(A.values.length===1)return`Ongeldige invoer: verwacht ${S(A.values[0])}`;return`Ongeldige optie: verwacht één van ${z(A.values,"|")}`;case"too_big":{let w=A.inclusive?"<=":"<",b=I(A.origin);if(b)return`Te groot: verwacht dat ${A.origin??"waarde"} ${b.verb} ${w}${A.maximum.toString()} ${b.unit??"elementen"}`;return`Te groot: verwacht dat ${A.origin??"waarde"} ${w}${A.maximum.toString()} is`}case"too_small":{let w=A.inclusive?">=":">",b=I(A.origin);if(b)return`Te klein: verwacht dat ${A.origin} ${b.verb} ${w}${A.minimum.toString()} ${b.unit}`;return`Te klein: verwacht dat ${A.origin} ${w}${A.minimum.toString()} is`}case"invalid_format":{let w=A;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]??A.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${A.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${A.keys.length>1?"s":""}: ${z(A.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${A.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${A.origin}`;default:return"Ongeldige invoer"}}};function BQ(){return{localeError:Fy()}}var Ey=()=>{let $={string:{unit:"tegn",verb:"å ha"},file:{unit:"bytes",verb:"å ha"},array:{unit:"elementer",verb:"å inneholde"},set:{unit:"elementer",verb:"å inneholde"}};function I(A){return $[A]??null}let U=(A)=>{let w=typeof A;switch(w){case"number":return Number.isNaN(A)?"NaN":"tall";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 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(A)=>{switch(A.code){case"invalid_type":return`Ugyldig input: forventet ${A.expected}, fikk ${U(A.input)}`;case"invalid_value":if(A.values.length===1)return`Ugyldig verdi: forventet ${S(A.values[0])}`;return`Ugyldig valg: forventet en av ${z(A.values,"|")}`;case"too_big":{let w=A.inclusive?"<=":"<",b=I(A.origin);if(b)return`For stor(t): forventet ${A.origin??"value"} til å ha ${w}${A.maximum.toString()} ${b.unit??"elementer"}`;return`For stor(t): forventet ${A.origin??"value"} til å ha ${w}${A.maximum.toString()}`}case"too_small":{let w=A.inclusive?">=":">",b=I(A.origin);if(b)return`For lite(n): forventet ${A.origin} til å ha ${w}${A.minimum.toString()} ${b.unit}`;return`For lite(n): forventet ${A.origin} til å ha ${w}${A.minimum.toString()}`}case"invalid_format":{let w=A;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]??A.format}`}case"not_multiple_of":return`Ugyldig tall: må være et multiplum av ${A.divisor}`;case"unrecognized_keys":return`${A.keys.length>1?"Ukjente nøkler":"Ukjent nøkkel"}: ${z(A.keys,", ")}`;case"invalid_key":return`Ugyldig nøkkel i ${A.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${A.origin}`;default:return"Ugyldig input"}}};function JQ(){return{localeError:Ey()}}var Sy=()=>{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(A){return $[A]??null}let U=(A)=>{let w=typeof A;switch(w){case"number":return Number.isNaN(A)?"NaN":"numara";case"object":{if(Array.isArray(A))return"saf";if(A===null)return"gayb";if(Object.getPrototypeOf(A)!==Object.prototype&&A.constructor)return A.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(A)=>{switch(A.code){case"invalid_type":return`Fâsit giren: umulan ${A.expected}, alınan ${U(A.input)}`;case"invalid_value":if(A.values.length===1)return`Fâsit giren: umulan ${S(A.values[0])}`;return`Fâsit tercih: mûteberler ${z(A.values,"|")}`;case"too_big":{let w=A.inclusive?"<=":"<",b=I(A.origin);if(b)return`Fazla büyük: ${A.origin??"value"}, ${w}${A.maximum.toString()} ${b.unit??"elements"} sahip olmalıydı.`;return`Fazla büyük: ${A.origin??"value"}, ${w}${A.maximum.toString()} olmalıydı.`}case"too_small":{let w=A.inclusive?">=":">",b=I(A.origin);if(b)return`Fazla küçük: ${A.origin}, ${w}${A.minimum.toString()} ${b.unit} sahip olmalıydı.`;return`Fazla küçük: ${A.origin}, ${w}${A.minimum.toString()} olmalıydı.`}case"invalid_format":{let w=A;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]??A.format}`}case"not_multiple_of":return`Fâsit sayı: ${A.divisor} katı olmalıydı.`;case"unrecognized_keys":return`Tanınmayan anahtar ${A.keys.length>1?"s":""}: ${z(A.keys,", ")}`;case"invalid_key":return`${A.origin} için tanınmayan anahtar var.`;case"invalid_union":return"Giren tanınamadı.";case"invalid_element":return`${A.origin} için tanınmayan kıymet var.`;default:return"Kıymet tanınamadı."}}};function HQ(){return{localeError:Sy()}}var jy=()=>{let $={string:{unit:"توکي",verb:"ولري"},file:{unit:"بایټس",verb:"ولري"},array:{unit:"توکي",verb:"ولري"},set:{unit:"توکي",verb:"ولري"}};function I(A){return $[A]??null}let U=(A)=>{let w=typeof A;switch(w){case"number":return Number.isNaN(A)?"NaN":"عدد";case"object":{if(Array.isArray(A))return"ارې";if(A===null)return"null";if(Object.getPrototypeOf(A)!==Object.prototype&&A.constructor)return A.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(A)=>{switch(A.code){case"invalid_type":return`ناسم ورودي: باید ${A.expected} وای, مګر ${U(A.input)} ترلاسه شو`;case"invalid_value":if(A.values.length===1)return`ناسم ورودي: باید ${S(A.values[0])} وای`;return`ناسم انتخاب: باید یو له ${z(A.values,"|")} څخه وای`;case"too_big":{let w=A.inclusive?"<=":"<",b=I(A.origin);if(b)return`ډیر لوی: ${A.origin??"ارزښت"} باید ${w}${A.maximum.toString()} ${b.unit??"عنصرونه"} ولري`;return`ډیر لوی: ${A.origin??"ارزښت"} باید ${w}${A.maximum.toString()} وي`}case"too_small":{let w=A.inclusive?">=":">",b=I(A.origin);if(b)return`ډیر کوچنی: ${A.origin} باید ${w}${A.minimum.toString()} ${b.unit} ولري`;return`ډیر کوچنی: ${A.origin} باید ${w}${A.minimum.toString()} وي`}case"invalid_format":{let w=A;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]??A.format} ناسم دی`}case"not_multiple_of":return`ناسم عدد: باید د ${A.divisor} مضرب وي`;case"unrecognized_keys":return`ناسم ${A.keys.length>1?"کلیډونه":"کلیډ"}: ${z(A.keys,", ")}`;case"invalid_key":return`ناسم کلیډ په ${A.origin} کې`;case"invalid_union":return"ناسمه ورودي";case"invalid_element":return`ناسم عنصر په ${A.origin} کې`;default:return"ناسمه ورودي"}}};function LQ(){return{localeError:jy()}}var ky=()=>{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(A){return $[A]??null}let U=(A)=>{let w=typeof A;switch(w){case"number":return Number.isNaN(A)?"NaN":"liczba";case"object":{if(Array.isArray(A))return"tablica";if(A===null)return"null";if(Object.getPrototypeOf(A)!==Object.prototype&&A.constructor)return A.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(A)=>{switch(A.code){case"invalid_type":return`Nieprawidłowe dane wejściowe: oczekiwano ${A.expected}, otrzymano ${U(A.input)}`;case"invalid_value":if(A.values.length===1)return`Nieprawidłowe dane wejściowe: oczekiwano ${S(A.values[0])}`;return`Nieprawidłowa opcja: oczekiwano jednej z wartości ${z(A.values,"|")}`;case"too_big":{let w=A.inclusive?"<=":"<",b=I(A.origin);if(b)return`Za duża wartość: oczekiwano, że ${A.origin??"wartość"} będzie mieć ${w}${A.maximum.toString()} ${b.unit??"elementów"}`;return`Zbyt duż(y/a/e): oczekiwano, że ${A.origin??"wartość"} będzie wynosić ${w}${A.maximum.toString()}`}case"too_small":{let w=A.inclusive?">=":">",b=I(A.origin);if(b)return`Za mała wartość: oczekiwano, że ${A.origin??"wartość"} będzie mieć ${w}${A.minimum.toString()} ${b.unit??"elementów"}`;return`Zbyt mał(y/a/e): oczekiwano, że ${A.origin??"wartość"} będzie wynosić ${w}${A.minimum.toString()}`}case"invalid_format":{let w=A;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]??A.format}`}case"not_multiple_of":return`Nieprawidłowa liczba: musi być wielokrotnością ${A.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${A.keys.length>1?"s":""}: ${z(A.keys,", ")}`;case"invalid_key":return`Nieprawidłowy klucz w ${A.origin}`;case"invalid_union":return"Nieprawidłowe dane wejściowe";case"invalid_element":return`Nieprawidłowa wartość w ${A.origin}`;default:return"Nieprawidłowe dane wejściowe"}}};function zQ(){return{localeError:ky()}}var Py=()=>{let $={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function I(A){return $[A]??null}let U=(A)=>{let w=typeof A;switch(w){case"number":return Number.isNaN(A)?"NaN":"número";case"object":{if(Array.isArray(A))return"array";if(A===null)return"nulo";if(Object.getPrototypeOf(A)!==Object.prototype&&A.constructor)return A.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(A)=>{switch(A.code){case"invalid_type":return`Tipo inválido: esperado ${A.expected}, recebido ${U(A.input)}`;case"invalid_value":if(A.values.length===1)return`Entrada inválida: esperado ${S(A.values[0])}`;return`Opção inválida: esperada uma das ${z(A.values,"|")}`;case"too_big":{let w=A.inclusive?"<=":"<",b=I(A.origin);if(b)return`Muito grande: esperado que ${A.origin??"valor"} tivesse ${w}${A.maximum.toString()} ${b.unit??"elementos"}`;return`Muito grande: esperado que ${A.origin??"valor"} fosse ${w}${A.maximum.toString()}`}case"too_small":{let w=A.inclusive?">=":">",b=I(A.origin);if(b)return`Muito pequeno: esperado que ${A.origin} tivesse ${w}${A.minimum.toString()} ${b.unit}`;return`Muito pequeno: esperado que ${A.origin} fosse ${w}${A.minimum.toString()}`}case"invalid_format":{let w=A;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]??A.format} inválido`}case"not_multiple_of":return`Número inválido: deve ser múltiplo de ${A.divisor}`;case"unrecognized_keys":return`Chave${A.keys.length>1?"s":""} desconhecida${A.keys.length>1?"s":""}: ${z(A.keys,", ")}`;case"invalid_key":return`Chave inválida em ${A.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido em ${A.origin}`;default:return"Campo inválido"}}};function MQ(){return{localeError:Py()}}function gv($,I,U,D){let A=Math.abs($),w=A%10,b=A%100;if(b>=11&&b<=19)return D;if(w===1)return I;if(w>=2&&w<=4)return U;return D}var Ry=()=>{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(A){return $[A]??null}let U=(A)=>{let w=typeof A;switch(w){case"number":return Number.isNaN(A)?"NaN":"число";case"object":{if(Array.isArray(A))return"массив";if(A===null)return"null";if(Object.getPrototypeOf(A)!==Object.prototype&&A.constructor)return A.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(A)=>{switch(A.code){case"invalid_type":return`Неверный ввод: ожидалось ${A.expected}, получено ${U(A.input)}`;case"invalid_value":if(A.values.length===1)return`Неверный ввод: ожидалось ${S(A.values[0])}`;return`Неверный вариант: ожидалось одно из ${z(A.values,"|")}`;case"too_big":{let w=A.inclusive?"<=":"<",b=I(A.origin);if(b){let N=Number(A.maximum),O=gv(N,b.unit.one,b.unit.few,b.unit.many);return`Слишком большое значение: ожидалось, что ${A.origin??"значение"} будет иметь ${w}${A.maximum.toString()} ${O}`}return`Слишком большое значение: ожидалось, что ${A.origin??"значение"} будет ${w}${A.maximum.toString()}`}case"too_small":{let w=A.inclusive?">=":">",b=I(A.origin);if(b){let N=Number(A.minimum),O=gv(N,b.unit.one,b.unit.few,b.unit.many);return`Слишком маленькое значение: ожидалось, что ${A.origin} будет иметь ${w}${A.minimum.toString()} ${O}`}return`Слишком маленькое значение: ожидалось, что ${A.origin} будет ${w}${A.minimum.toString()}`}case"invalid_format":{let w=A;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]??A.format}`}case"not_multiple_of":return`Неверное число: должно быть кратным ${A.divisor}`;case"unrecognized_keys":return`Нераспознанн${A.keys.length>1?"ые":"ый"} ключ${A.keys.length>1?"и":""}: ${z(A.keys,", ")}`;case"invalid_key":return`Неверный ключ в ${A.origin}`;case"invalid_union":return"Неверные входные данные";case"invalid_element":return`Неверное значение в ${A.origin}`;default:return"Неверные входные данные"}}};function KQ(){return{localeError:Ry()}}var Ty=()=>{let $={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function I(A){return $[A]??null}let U=(A)=>{let w=typeof A;switch(w){case"number":return Number.isNaN(A)?"NaN":"število";case"object":{if(Array.isArray(A))return"tabela";if(A===null)return"null";if(Object.getPrototypeOf(A)!==Object.prototype&&A.constructor)return A.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(A)=>{switch(A.code){case"invalid_type":return`Neveljaven vnos: pričakovano ${A.expected}, prejeto ${U(A.input)}`;case"invalid_value":if(A.values.length===1)return`Neveljaven vnos: pričakovano ${S(A.values[0])}`;return`Neveljavna možnost: pričakovano eno izmed ${z(A.values,"|")}`;case"too_big":{let w=A.inclusive?"<=":"<",b=I(A.origin);if(b)return`Preveliko: pričakovano, da bo ${A.origin??"vrednost"} imelo ${w}${A.maximum.toString()} ${b.unit??"elementov"}`;return`Preveliko: pričakovano, da bo ${A.origin??"vrednost"} ${w}${A.maximum.toString()}`}case"too_small":{let w=A.inclusive?">=":">",b=I(A.origin);if(b)return`Premajhno: pričakovano, da bo ${A.origin} imelo ${w}${A.minimum.toString()} ${b.unit}`;return`Premajhno: pričakovano, da bo ${A.origin} ${w}${A.minimum.toString()}`}case"invalid_format":{let w=A;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]??A.format}`}case"not_multiple_of":return`Neveljavno število: mora biti večkratnik ${A.divisor}`;case"unrecognized_keys":return`Neprepoznan${A.keys.length>1?"i ključi":" ključ"}: ${z(A.keys,", ")}`;case"invalid_key":return`Neveljaven ključ v ${A.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${A.origin}`;default:return"Neveljaven vnos"}}};function VQ(){return{localeError:Ty()}}var _y=()=>{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(A){return $[A]??null}let U=(A)=>{let w=typeof A;switch(w){case"number":return Number.isNaN(A)?"NaN":"antal";case"object":{if(Array.isArray(A))return"lista";if(A===null)return"null";if(Object.getPrototypeOf(A)!==Object.prototype&&A.constructor)return A.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(A)=>{switch(A.code){case"invalid_type":return`Ogiltig inmatning: förväntat ${A.expected}, fick ${U(A.input)}`;case"invalid_value":if(A.values.length===1)return`Ogiltig inmatning: förväntat ${S(A.values[0])}`;return`Ogiltigt val: förväntade en av ${z(A.values,"|")}`;case"too_big":{let w=A.inclusive?"<=":"<",b=I(A.origin);if(b)return`För stor(t): förväntade ${A.origin??"värdet"} att ha ${w}${A.maximum.toString()} ${b.unit??"element"}`;return`För stor(t): förväntat ${A.origin??"värdet"} att ha ${w}${A.maximum.toString()}`}case"too_small":{let w=A.inclusive?">=":">",b=I(A.origin);if(b)return`För lite(t): förväntade ${A.origin??"värdet"} att ha ${w}${A.minimum.toString()} ${b.unit}`;return`För lite(t): förväntade ${A.origin??"värdet"} att ha ${w}${A.minimum.toString()}`}case"invalid_format":{let w=A;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]??A.format}`}case"not_multiple_of":return`Ogiltigt tal: måste vara en multipel av ${A.divisor}`;case"unrecognized_keys":return`${A.keys.length>1?"Okända nycklar":"Okänd nyckel"}: ${z(A.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${A.origin??"värdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt värde i ${A.origin??"värdet"}`;default:return"Ogiltig input"}}};function vQ(){return{localeError:_y()}}var Cy=()=>{let $={string:{unit:"எழுத்துக்கள்",verb:"கொண்டிருக்க வேண்டும்"},file:{unit:"பைட்டுகள்",verb:"கொண்டிருக்க வேண்டும்"},array:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},set:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"}};function I(A){return $[A]??null}let U=(A)=>{let w=typeof A;switch(w){case"number":return Number.isNaN(A)?"எண் அல்லாதது":"எண்";case"object":{if(Array.isArray(A))return"அணி";if(A===null)return"வெறுமை";if(Object.getPrototypeOf(A)!==Object.prototype&&A.constructor)return A.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(A)=>{switch(A.code){case"invalid_type":return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${A.expected}, பெறப்பட்டது ${U(A.input)}`;case"invalid_value":if(A.values.length===1)return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${S(A.values[0])}`;return`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${z(A.values,"|")} இல் ஒன்று`;case"too_big":{let w=A.inclusive?"<=":"<",b=I(A.origin);if(b)return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${A.origin??"மதிப்பு"} ${w}${A.maximum.toString()} ${b.unit??"உறுப்புகள்"} ஆக இருக்க வேண்டும்`;return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${A.origin??"மதிப்பு"} ${w}${A.maximum.toString()} ஆக இருக்க வேண்டும்`}case"too_small":{let w=A.inclusive?">=":">",b=I(A.origin);if(b)return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${A.origin} ${w}${A.minimum.toString()} ${b.unit} ஆக இருக்க வேண்டும்`;return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${A.origin} ${w}${A.minimum.toString()} ஆக இருக்க வேண்டும்`}case"invalid_format":{let w=A;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]??A.format}`}case"not_multiple_of":return`தவறான எண்: ${A.divisor} இன் பலமாக இருக்க வேண்டும்`;case"unrecognized_keys":return`அடையாளம் தெரியாத விசை${A.keys.length>1?"கள்":""}: ${z(A.keys,", ")}`;case"invalid_key":return`${A.origin} இல் தவறான விசை`;case"invalid_union":return"தவறான உள்ளீடு";case"invalid_element":return`${A.origin} இல் தவறான மதிப்பு`;default:return"தவறான உள்ளீடு"}}};function qQ(){return{localeError:Cy()}}var Zy=()=>{let $={string:{unit:"ตัวอักษร",verb:"ควรมี"},file:{unit:"ไบต์",verb:"ควรมี"},array:{unit:"รายการ",verb:"ควรมี"},set:{unit:"รายการ",verb:"ควรมี"}};function I(A){return $[A]??null}let U=(A)=>{let w=typeof A;switch(w){case"number":return Number.isNaN(A)?"ไม่ใช่ตัวเลข (NaN)":"ตัวเลข";case"object":{if(Array.isArray(A))return"อาร์เรย์ (Array)";if(A===null)return"ไม่มีค่า (null)";if(Object.getPrototypeOf(A)!==Object.prototype&&A.constructor)return A.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(A)=>{switch(A.code){case"invalid_type":return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${A.expected} แต่ได้รับ ${U(A.input)}`;case"invalid_value":if(A.values.length===1)return`ค่าไม่ถูกต้อง: ควรเป็น ${S(A.values[0])}`;return`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${z(A.values,"|")}`;case"too_big":{let w=A.inclusive?"ไม่เกิน":"น้อยกว่า",b=I(A.origin);if(b)return`เกินกำหนด: ${A.origin??"ค่า"} ควรมี${w} ${A.maximum.toString()} ${b.unit??"รายการ"}`;return`เกินกำหนด: ${A.origin??"ค่า"} ควรมี${w} ${A.maximum.toString()}`}case"too_small":{let w=A.inclusive?"อย่างน้อย":"มากกว่า",b=I(A.origin);if(b)return`น้อยกว่ากำหนด: ${A.origin} ควรมี${w} ${A.minimum.toString()} ${b.unit}`;return`น้อยกว่ากำหนด: ${A.origin} ควรมี${w} ${A.minimum.toString()}`}case"invalid_format":{let w=A;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]??A.format}`}case"not_multiple_of":return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${A.divisor} ได้ลงตัว`;case"unrecognized_keys":return`พบคีย์ที่ไม่รู้จัก: ${z(A.keys,", ")}`;case"invalid_key":return`คีย์ไม่ถูกต้องใน ${A.origin}`;case"invalid_union":return"ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";case"invalid_element":return`ข้อมูลไม่ถูกต้องใน ${A.origin}`;default:return"ข้อมูลไม่ถูกต้อง"}}};function FQ(){return{localeError:Zy()}}var gy=($)=>{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},xy=()=>{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 ${gy(D.input)}`;case"invalid_value":if(D.values.length===1)return`Geçersiz değer: beklenen ${S(D.values[0])}`;return`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${z(D.values,"|")}`;case"too_big":{let A=D.inclusive?"<=":"<",w=I(D.origin);if(w)return`Çok büyük: beklenen ${D.origin??"değer"} ${A}${D.maximum.toString()} ${w.unit??"öğe"}`;return`Çok büyük: beklenen ${D.origin??"değer"} ${A}${D.maximum.toString()}`}case"too_small":{let A=D.inclusive?">=":">",w=I(D.origin);if(w)return`Çok küçük: beklenen ${D.origin} ${A}${D.minimum.toString()} ${w.unit}`;return`Çok küçük: beklenen ${D.origin} ${A}${D.minimum.toString()}`}case"invalid_format":{let A=D;if(A.format==="starts_with")return`Geçersiz metin: "${A.prefix}" ile başlamalı`;if(A.format==="ends_with")return`Geçersiz metin: "${A.suffix}" ile bitmeli`;if(A.format==="includes")return`Geçersiz metin: "${A.includes}" içermeli`;if(A.format==="regex")return`Geçersiz metin: ${A.pattern} desenine uymalı`;return`Geçersiz ${U[A.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 EQ(){return{localeError:xy()}}var hy=()=>{let $={string:{unit:"символів",verb:"матиме"},file:{unit:"байтів",verb:"матиме"},array:{unit:"елементів",verb:"матиме"},set:{unit:"елементів",verb:"матиме"}};function I(A){return $[A]??null}let U=(A)=>{let w=typeof A;switch(w){case"number":return Number.isNaN(A)?"NaN":"число";case"object":{if(Array.isArray(A))return"масив";if(A===null)return"null";if(Object.getPrototypeOf(A)!==Object.prototype&&A.constructor)return A.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(A)=>{switch(A.code){case"invalid_type":return`Неправильні вхідні дані: очікується ${A.expected}, отримано ${U(A.input)}`;case"invalid_value":if(A.values.length===1)return`Неправильні вхідні дані: очікується ${S(A.values[0])}`;return`Неправильна опція: очікується одне з ${z(A.values,"|")}`;case"too_big":{let w=A.inclusive?"<=":"<",b=I(A.origin);if(b)return`Занадто велике: очікується, що ${A.origin??"значення"} ${b.verb} ${w}${A.maximum.toString()} ${b.unit??"елементів"}`;return`Занадто велике: очікується, що ${A.origin??"значення"} буде ${w}${A.maximum.toString()}`}case"too_small":{let w=A.inclusive?">=":">",b=I(A.origin);if(b)return`Занадто мале: очікується, що ${A.origin} ${b.verb} ${w}${A.minimum.toString()} ${b.unit}`;return`Занадто мале: очікується, що ${A.origin} буде ${w}${A.minimum.toString()}`}case"invalid_format":{let w=A;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]??A.format}`}case"not_multiple_of":return`Неправильне число: повинно бути кратним ${A.divisor}`;case"unrecognized_keys":return`Нерозпізнаний ключ${A.keys.length>1?"і":""}: ${z(A.keys,", ")}`;case"invalid_key":return`Неправильний ключ у ${A.origin}`;case"invalid_union":return"Неправильні вхідні дані";case"invalid_element":return`Неправильне значення у ${A.origin}`;default:return"Неправильні вхідні дані"}}};function w0(){return{localeError:hy()}}function SQ(){return w0()}var fy=()=>{let $={string:{unit:"حروف",verb:"ہونا"},file:{unit:"بائٹس",verb:"ہونا"},array:{unit:"آئٹمز",verb:"ہونا"},set:{unit:"آئٹمز",verb:"ہونا"}};function I(A){return $[A]??null}let U=(A)=>{let w=typeof A;switch(w){case"number":return Number.isNaN(A)?"NaN":"نمبر";case"object":{if(Array.isArray(A))return"آرے";if(A===null)return"نل";if(Object.getPrototypeOf(A)!==Object.prototype&&A.constructor)return A.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(A)=>{switch(A.code){case"invalid_type":return`غلط ان پٹ: ${A.expected} متوقع تھا، ${U(A.input)} موصول ہوا`;case"invalid_value":if(A.values.length===1)return`غلط ان پٹ: ${S(A.values[0])} متوقع تھا`;return`غلط آپشن: ${z(A.values,"|")} میں سے ایک متوقع تھا`;case"too_big":{let w=A.inclusive?"<=":"<",b=I(A.origin);if(b)return`بہت بڑا: ${A.origin??"ویلیو"} کے ${w}${A.maximum.toString()} ${b.unit??"عناصر"} ہونے متوقع تھے`;return`بہت بڑا: ${A.origin??"ویلیو"} کا ${w}${A.maximum.toString()} ہونا متوقع تھا`}case"too_small":{let w=A.inclusive?">=":">",b=I(A.origin);if(b)return`بہت چھوٹا: ${A.origin} کے ${w}${A.minimum.toString()} ${b.unit} ہونے متوقع تھے`;return`بہت چھوٹا: ${A.origin} کا ${w}${A.minimum.toString()} ہونا متوقع تھا`}case"invalid_format":{let w=A;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]??A.format}`}case"not_multiple_of":return`غلط نمبر: ${A.divisor} کا مضاعف ہونا چاہیے`;case"unrecognized_keys":return`غیر تسلیم شدہ کی${A.keys.length>1?"ز":""}: ${z(A.keys,"، ")}`;case"invalid_key":return`${A.origin} میں غلط کی`;case"invalid_union":return"غلط ان پٹ";case"invalid_element":return`${A.origin} میں غلط ویلیو`;default:return"غلط ان پٹ"}}};function jQ(){return{localeError:fy()}}var yy=()=>{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(A){return $[A]??null}let U=(A)=>{let w=typeof A;switch(w){case"number":return Number.isNaN(A)?"NaN":"số";case"object":{if(Array.isArray(A))return"mảng";if(A===null)return"null";if(Object.getPrototypeOf(A)!==Object.prototype&&A.constructor)return A.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(A)=>{switch(A.code){case"invalid_type":return`Đầu vào không hợp lệ: mong đợi ${A.expected}, nhận được ${U(A.input)}`;case"invalid_value":if(A.values.length===1)return`Đầu vào không hợp lệ: mong đợi ${S(A.values[0])}`;return`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${z(A.values,"|")}`;case"too_big":{let w=A.inclusive?"<=":"<",b=I(A.origin);if(b)return`Quá lớn: mong đợi ${A.origin??"giá trị"} ${b.verb} ${w}${A.maximum.toString()} ${b.unit??"phần tử"}`;return`Quá lớn: mong đợi ${A.origin??"giá trị"} ${w}${A.maximum.toString()}`}case"too_small":{let w=A.inclusive?">=":">",b=I(A.origin);if(b)return`Quá nhỏ: mong đợi ${A.origin} ${b.verb} ${w}${A.minimum.toString()} ${b.unit}`;return`Quá nhỏ: mong đợi ${A.origin} ${w}${A.minimum.toString()}`}case"invalid_format":{let w=A;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]??A.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 ${A.divisor}`;case"unrecognized_keys":return`Khóa không được nhận dạng: ${z(A.keys,", ")}`;case"invalid_key":return`Khóa không hợp lệ trong ${A.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 ${A.origin}`;default:return"Đầu vào không hợp lệ"}}};function kQ(){return{localeError:yy()}}var uy=()=>{let $={string:{unit:"字符",verb:"包含"},file:{unit:"字节",verb:"包含"},array:{unit:"项",verb:"包含"},set:{unit:"项",verb:"包含"}};function I(A){return $[A]??null}let U=(A)=>{let w=typeof A;switch(w){case"number":return Number.isNaN(A)?"非数字(NaN)":"数字";case"object":{if(Array.isArray(A))return"数组";if(A===null)return"空值(null)";if(Object.getPrototypeOf(A)!==Object.prototype&&A.constructor)return A.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(A)=>{switch(A.code){case"invalid_type":return`无效输入:期望 ${A.expected},实际接收 ${U(A.input)}`;case"invalid_value":if(A.values.length===1)return`无效输入:期望 ${S(A.values[0])}`;return`无效选项:期望以下之一 ${z(A.values,"|")}`;case"too_big":{let w=A.inclusive?"<=":"<",b=I(A.origin);if(b)return`数值过大:期望 ${A.origin??"值"} ${w}${A.maximum.toString()} ${b.unit??"个元素"}`;return`数值过大:期望 ${A.origin??"值"} ${w}${A.maximum.toString()}`}case"too_small":{let w=A.inclusive?">=":">",b=I(A.origin);if(b)return`数值过小:期望 ${A.origin} ${w}${A.minimum.toString()} ${b.unit}`;return`数值过小:期望 ${A.origin} ${w}${A.minimum.toString()}`}case"invalid_format":{let w=A;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]??A.format}`}case"not_multiple_of":return`无效数字:必须是 ${A.divisor} 的倍数`;case"unrecognized_keys":return`出现未知的键(key): ${z(A.keys,", ")}`;case"invalid_key":return`${A.origin} 中的键(key)无效`;case"invalid_union":return"无效输入";case"invalid_element":return`${A.origin} 中包含无效值(value)`;default:return"无效输入"}}};function PQ(){return{localeError:uy()}}var ly=()=>{let $={string:{unit:"字元",verb:"擁有"},file:{unit:"位元組",verb:"擁有"},array:{unit:"項目",verb:"擁有"},set:{unit:"項目",verb:"擁有"}};function I(A){return $[A]??null}let U=(A)=>{let w=typeof A;switch(w){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&&A.constructor)return A.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(A)=>{switch(A.code){case"invalid_type":return`無效的輸入值:預期為 ${A.expected},但收到 ${U(A.input)}`;case"invalid_value":if(A.values.length===1)return`無效的輸入值:預期為 ${S(A.values[0])}`;return`無效的選項:預期為以下其中之一 ${z(A.values,"|")}`;case"too_big":{let w=A.inclusive?"<=":"<",b=I(A.origin);if(b)return`數值過大:預期 ${A.origin??"值"} 應為 ${w}${A.maximum.toString()} ${b.unit??"個元素"}`;return`數值過大:預期 ${A.origin??"值"} 應為 ${w}${A.maximum.toString()}`}case"too_small":{let w=A.inclusive?">=":">",b=I(A.origin);if(b)return`數值過小:預期 ${A.origin} 應為 ${w}${A.minimum.toString()} ${b.unit}`;return`數值過小:預期 ${A.origin} 應為 ${w}${A.minimum.toString()}`}case"invalid_format":{let w=A;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]??A.format}`}case"not_multiple_of":return`無效的數字:必須為 ${A.divisor} 的倍數`;case"unrecognized_keys":return`無法識別的鍵值${A.keys.length>1?"們":""}:${z(A.keys,"、")}`;case"invalid_key":return`${A.origin} 中有無效的鍵值`;case"invalid_union":return"無效的輸入值";case"invalid_element":return`${A.origin} 中有無效的值`;default:return"無效的輸入值"}}};function RQ(){return{localeError:ly()}}var cy=()=>{let $={string:{unit:"àmi",verb:"ní"},file:{unit:"bytes",verb:"ní"},array:{unit:"nkan",verb:"ní"},set:{unit:"nkan",verb:"ní"}};function I(A){return $[A]??null}let U=(A)=>{let w=typeof A;switch(w){case"number":return Number.isNaN(A)?"NaN":"nọ́mbà";case"object":{if(Array.isArray(A))return"akopọ";if(A===null)return"null";if(Object.getPrototypeOf(A)!==Object.prototype&&A.constructor)return A.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(A)=>{switch(A.code){case"invalid_type":return`Ìbáwọlé aṣìṣe: a ní láti fi ${A.expected}, àmọ̀ a rí ${U(A.input)}`;case"invalid_value":if(A.values.length===1)return`Ìbáwọlé aṣìṣe: a ní láti fi ${S(A.values[0])}`;return`Àṣàyàn aṣìṣe: yan ọ̀kan lára ${z(A.values,"|")}`;case"too_big":{let w=A.inclusive?"<=":"<",b=I(A.origin);if(b)return`Tó pọ̀ jù: a ní láti jẹ́ pé ${A.origin??"iye"} ${b.verb} ${w}${A.maximum} ${b.unit}`;return`Tó pọ̀ jù: a ní láti jẹ́ ${w}${A.maximum}`}case"too_small":{let w=A.inclusive?">=":">",b=I(A.origin);if(b)return`Kéré ju: a ní láti jẹ́ pé ${A.origin} ${b.verb} ${w}${A.minimum} ${b.unit}`;return`Kéré ju: a ní láti jẹ́ ${w}${A.minimum}`}case"invalid_format":{let w=A;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]??A.format}`}case"not_multiple_of":return`Nọ́mbà aṣìṣe: gbọ́dọ̀ jẹ́ èyà pípín ti ${A.divisor}`;case"unrecognized_keys":return`Bọtìnì àìmọ̀: ${z(A.keys,", ")}`;case"invalid_key":return`Bọtìnì aṣìṣe nínú ${A.origin}`;case"invalid_union":return"Ìbáwọlé aṣìṣe";case"invalid_element":return`Iye aṣìṣe nínú ${A.origin}`;default:return"Ìbáwọlé aṣìṣe"}}};function TQ(){return{localeError:cy()}}var xv,_Q=Symbol("ZodOutput"),CQ=Symbol("ZodInput");class ZQ{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 _w(){return new ZQ}(xv=globalThis).__zod_globalRegistry??(xv.__zod_globalRegistry=_w());var d$=globalThis.__zod_globalRegistry;function gQ($,I){return new $({type:"string",...P(I)})}function xQ($,I){return new $({type:"string",coerce:!0,...P(I)})}function Cw($,I){return new $({type:"string",format:"email",check:"string_format",abort:!1,...P(I)})}function N0($,I){return new $({type:"string",format:"guid",check:"string_format",abort:!1,...P(I)})}function Zw($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,...P(I)})}function gw($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...P(I)})}function xw($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...P(I)})}function hw($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...P(I)})}function O0($,I){return new $({type:"string",format:"url",check:"string_format",abort:!1,...P(I)})}function fw($,I){return new $({type:"string",format:"emoji",check:"string_format",abort:!1,...P(I)})}function yw($,I){return new $({type:"string",format:"nanoid",check:"string_format",abort:!1,...P(I)})}function uw($,I){return new $({type:"string",format:"cuid",check:"string_format",abort:!1,...P(I)})}function lw($,I){return new $({type:"string",format:"cuid2",check:"string_format",abort:!1,...P(I)})}function cw($,I){return new $({type:"string",format:"ulid",check:"string_format",abort:!1,...P(I)})}function mw($,I){return new $({type:"string",format:"xid",check:"string_format",abort:!1,...P(I)})}function rw($,I){return new $({type:"string",format:"ksuid",check:"string_format",abort:!1,...P(I)})}function iw($,I){return new $({type:"string",format:"ipv4",check:"string_format",abort:!1,...P(I)})}function nw($,I){return new $({type:"string",format:"ipv6",check:"string_format",abort:!1,...P(I)})}function hQ($,I){return new $({type:"string",format:"mac",check:"string_format",abort:!1,...P(I)})}function ow($,I){return new $({type:"string",format:"cidrv4",check:"string_format",abort:!1,...P(I)})}function dw($,I){return new $({type:"string",format:"cidrv6",check:"string_format",abort:!1,...P(I)})}function pw($,I){return new $({type:"string",format:"base64",check:"string_format",abort:!1,...P(I)})}function tw($,I){return new $({type:"string",format:"base64url",check:"string_format",abort:!1,...P(I)})}function aw($,I){return new $({type:"string",format:"e164",check:"string_format",abort:!1,...P(I)})}function ew($,I){return new $({type:"string",format:"jwt",check:"string_format",abort:!1,...P(I)})}var fQ={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function yQ($,I){return new $({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...P(I)})}function uQ($,I){return new $({type:"string",format:"date",check:"string_format",...P(I)})}function lQ($,I){return new $({type:"string",format:"time",check:"string_format",precision:null,...P(I)})}function cQ($,I){return new $({type:"string",format:"duration",check:"string_format",...P(I)})}function mQ($,I){return new $({type:"number",checks:[],...P(I)})}function rQ($,I){return new $({type:"number",coerce:!0,checks:[],...P(I)})}function iQ($,I){return new $({type:"number",check:"number_format",abort:!1,format:"safeint",...P(I)})}function nQ($,I){return new $({type:"number",check:"number_format",abort:!1,format:"float32",...P(I)})}function oQ($,I){return new $({type:"number",check:"number_format",abort:!1,format:"float64",...P(I)})}function dQ($,I){return new $({type:"number",check:"number_format",abort:!1,format:"int32",...P(I)})}function pQ($,I){return new $({type:"number",check:"number_format",abort:!1,format:"uint32",...P(I)})}function tQ($,I){return new $({type:"boolean",...P(I)})}function aQ($,I){return new $({type:"boolean",coerce:!0,...P(I)})}function eQ($,I){return new $({type:"bigint",...P(I)})}function sQ($,I){return new $({type:"bigint",coerce:!0,...P(I)})}function $Y($,I){return new $({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...P(I)})}function IY($,I){return new $({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...P(I)})}function UY($,I){return new $({type:"symbol",...P(I)})}function AY($,I){return new $({type:"undefined",...P(I)})}function DY($,I){return new $({type:"null",...P(I)})}function wY($){return new $({type:"any"})}function bY($){return new $({type:"unknown"})}function NY($,I){return new $({type:"never",...P(I)})}function OY($,I){return new $({type:"void",...P(I)})}function XY($,I){return new $({type:"date",...P(I)})}function WY($,I){return new $({type:"date",coerce:!0,...P(I)})}function GY($,I){return new $({type:"nan",...P(I)})}function r6($,I){return new Vw({check:"less_than",...P(I),value:$,inclusive:!1})}function W6($,I){return new Vw({check:"less_than",...P(I),value:$,inclusive:!0})}function i6($,I){return new vw({check:"greater_than",...P(I),value:$,inclusive:!1})}function p$($,I){return new vw({check:"greater_than",...P(I),value:$,inclusive:!0})}function sw($){return i6(0,$)}function $b($){return r6(0,$)}function Ib($){return W6(0,$)}function Ub($){return p$(0,$)}function Z4($,I){return new YG({check:"multiple_of",...P(I),value:$})}function NI($,I){return new HG({check:"max_size",...P(I),maximum:$})}function g4($,I){return new LG({check:"min_size",...P(I),minimum:$})}function I1($,I){return new zG({check:"size_equals",...P(I),size:$})}function OI($,I){return new MG({check:"max_length",...P(I),maximum:$})}function w4($,I){return new KG({check:"min_length",...P(I),minimum:$})}function XI($,I){return new VG({check:"length_equals",...P(I),length:$})}function U1($,I){return new vG({check:"string_format",format:"regex",...P(I),pattern:$})}function A1($){return new qG({check:"string_format",format:"lowercase",...P($)})}function D1($){return new FG({check:"string_format",format:"uppercase",...P($)})}function w1($,I){return new EG({check:"string_format",format:"includes",...P(I),includes:$})}function b1($,I){return new SG({check:"string_format",format:"starts_with",...P(I),prefix:$})}function N1($,I){return new jG({check:"string_format",format:"ends_with",...P(I),suffix:$})}function Ab($,I,U){return new kG({check:"property",property:$,schema:I,...P(U)})}function O1($,I){return new PG({check:"mime_type",mime:$,...P(I)})}function C6($){return new RG({check:"overwrite",tx:$})}function X1($){return C6((I)=>I.normalize($))}function W1(){return C6(($)=>$.trim())}function G1(){return C6(($)=>$.toLowerCase())}function Q1(){return C6(($)=>$.toUpperCase())}function Y1(){return C6(($)=>j9($))}function QY($,I,U){return new $({type:"array",element:I,...P(U)})}function ry($,I,U){return new $({type:"union",options:I,...P(U)})}function iy($,I,U){return new $({type:"union",options:I,inclusive:!1,...P(U)})}function ny($,I,U,D){return new $({type:"union",options:U,discriminator:I,...P(D)})}function oy($,I,U){return new $({type:"intersection",left:I,right:U})}function dy($,I,U,D){let A=U instanceof o;return new $({type:"tuple",items:I,rest:A?U:null,...P(A?D:U)})}function py($,I,U,D){return new $({type:"record",keyType:I,valueType:U,...P(D)})}function ty($,I,U,D){return new $({type:"map",keyType:I,valueType:U,...P(D)})}function ay($,I,U){return new $({type:"set",valueType:I,...P(U)})}function ey($,I,U){let D=Array.isArray(I)?Object.fromEntries(I.map((A)=>[A,A])):I;return new $({type:"enum",entries:D,...P(U)})}function sy($,I,U){return new $({type:"enum",entries:I,...P(U)})}function $u($,I,U){return new $({type:"literal",values:Array.isArray(I)?I:[I],...P(U)})}function YY($,I){return new $({type:"file",...P(I)})}function Iu($,I){return new $({type:"transform",transform:I})}function Uu($,I){return new $({type:"optional",innerType:I})}function Au($,I){return new $({type:"nullable",innerType:I})}function Du($,I,U){return new $({type:"default",innerType:I,get defaultValue(){return typeof U==="function"?U():P9(U)}})}function wu($,I,U){return new $({type:"nonoptional",innerType:I,...P(U)})}function bu($,I){return new $({type:"success",innerType:I})}function Nu($,I,U){return new $({type:"catch",innerType:I,catchValue:typeof U==="function"?U:()=>U})}function Ou($,I,U){return new $({type:"pipe",in:I,out:U})}function Xu($,I){return new $({type:"readonly",innerType:I})}function Wu($,I,U){return new $({type:"template_literal",parts:I,...P(U)})}function Gu($,I){return new $({type:"lazy",getter:I})}function Qu($,I){return new $({type:"promise",innerType:I})}function BY($,I,U){let D=P(U);return D.abort??(D.abort=!0),new $({type:"custom",check:"custom",fn:I,...D})}function JY($,I,U){return new $({type:"custom",check:"custom",fn:I,...P(U)})}function HY($){let I=hv((U)=>{return U.addIssue=(D)=>{if(typeof D==="string")U.issues.push(pI(D,U.value,I._zod.def));else{let A=D;if(A.fatal)A.continue=!1;A.code??(A.code="custom"),A.input??(A.input=U.value),A.inst??(A.inst=I),A.continue??(A.continue=!I._zod.def.abort),U.issues.push(pI(A))}},$(U.value,U)});return I}function hv($,I){let U=new J$({check:"custom",...P(I)});return U._zod.check=$,U}function LY($){let I=new J$({check:"describe"});return I._zod.onattach=[(U)=>{let D=d$.get(U)??{};d$.add(U,{...D,description:$})}],I._zod.check=()=>{},I}function zY($){let I=new J$({check:"meta"});return I._zod.onattach=[(U)=>{let D=d$.get(U)??{};d$.add(U,{...D,...$})}],I._zod.check=()=>{},I}function MY($,I){let U=P(I),D=U.truthy??["true","1","yes","on","y","enabled"],A=U.falsy??["false","0","no","off","n","disabled"];if(U.case!=="sensitive")D=D.map((Y)=>typeof Y==="string"?Y.toLowerCase():Y),A=A.map((Y)=>typeof Y==="string"?Y.toLowerCase():Y);let w=new Set(D),b=new Set(A),N=$.Codec??$0,O=$.Boolean??eU,W=new($.String??bI)({type:"string",error:U.error}),Q=new O({type:"boolean",error:U.error}),B=new N({type:"pipe",in:W,out:Q,transform:(Y,J)=>{let H=Y;if(U.case!=="sensitive")H=H.toLowerCase();if(w.has(H))return!0;else if(b.has(H))return!1;else return J.issues.push({code:"invalid_value",expected:"stringbool",values:[...w,...b],input:J.value,inst:B,continue:!1}),{}},reverseTransform:(Y,J)=>{if(Y===!0)return D[0]||"true";else return A[0]||"false"},error:U.error});return B}function B1($,I,U,D={}){let A=P(D),w={...P(D),check:"string_format",type:"string",format:I,fn:typeof U==="function"?U:(N)=>U.test(N),...A};if(U instanceof RegExp)w.pattern=U;return new $(w)}function x4($){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??d$,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 X$($,I,U={path:[],schemaPath:[]}){var D;let A=$._zod.def,w=I.seen.get($);if(w){if(w.count++,U.schemaPath.includes($))w.cycle=U.path;return w.schema}let b={schema:{},count:1,cycle:void 0,path:U.path};I.seen.set($,b);let N=$._zod.toJSONSchema?.();if(N)b.schema=N;else{let W={...U,schemaPath:[...U.schemaPath,$],path:U.path},Q=$._zod.parent;if(Q)b.ref=Q,X$(Q,I,W),I.seen.get(Q).isParent=!0;else if($._zod.processJSONSchema)$._zod.processJSONSchema(I,b.schema,W);else{let B=b.schema,Y=I.processors[A.type];if(!Y)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${A.type}`);Y($,I,B,W)}}let O=I.metadataRegistry.get($);if(O)Object.assign(b.schema,O);if(I.io==="input"&&t$($))delete b.schema.examples,delete b.schema.default;if(I.io==="input"&&b.schema._prefault)(D=b.schema).default??(D.default=b.schema._prefault);return delete b.schema._prefault,I.seen.get($).schema}function h4($,I){let U=$.seen.get(I);if(!U)throw new Error("Unprocessed schema. This is a bug in Zod.");let D=(w)=>{let b=$.target==="draft-2020-12"?"$defs":"definitions";if($.external){let W=$.external.registry.get(w[0])?.id,Q=$.external.uri??((Y)=>Y);if(W)return{ref:Q(W)};let B=w[1].defId??w[1].schema.id??`schema${$.counter++}`;return w[1].defId=B,{defId:B,ref:`${Q("__shared")}#/${b}/${B}`}}if(w[1]===U)return{ref:"#"};let O=`${"#"}/${b}/`,X=w[1].schema.id??`__schema${$.counter++}`;return{defId:X,ref:O+X}},A=(w)=>{if(w[1].schema.$ref)return;let b=w[1],{ref:N,defId:O}=D(w);if(b.def={...b.schema},O)b.defId=O;let X=b.schema;for(let W in X)delete X[W];X.$ref=N};if($.cycles==="throw")for(let w of $.seen.entries()){let b=w[1];if(b.cycle)throw new Error(`Cycle detected: #/${b.cycle?.join("/")}/<root>
63
-
64
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let w of $.seen.entries()){let b=w[1];if(I===w[0]){A(w);continue}if($.external){let O=$.external.registry.get(w[0])?.id;if(I!==w[0]&&O){A(w);continue}}if($.metadataRegistry.get(w[0])?.id){A(w);continue}if(b.cycle){A(w);continue}if(b.count>1){if($.reused==="ref"){A(w);continue}}}}function f4($,I){let U=$.seen.get(I);if(!U)throw new Error("Unprocessed schema. This is a bug in Zod.");let D=(b)=>{let N=$.seen.get(b),O=N.def??N.schema,X={...O};if(N.ref===null)return;let W=N.ref;if(N.ref=null,W){D(W);let Q=$.seen.get(W).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:b,jsonSchema:O,path:N.path??[]})};for(let b of[...$.seen.entries()].reverse())D(b[0]);let A={};if($.target==="draft-2020-12")A.$schema="https://json-schema.org/draft/2020-12/schema";else if($.target==="draft-07")A.$schema="http://json-schema.org/draft-07/schema#";else if($.target==="draft-04")A.$schema="http://json-schema.org/draft-04/schema#";else if($.target==="openapi-3.0");if($.external?.uri){let b=$.external.registry.get(I)?.id;if(!b)throw new Error("Schema is missing an `id` property");A.$id=$.external.uri(b)}Object.assign(A,U.def??U.schema);let w=$.external?.defs??{};for(let b of $.seen.entries()){let N=b[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")A.$defs=w;else A.definitions=w;try{let b=JSON.parse(JSON.stringify(A));return Object.defineProperty(b,"~standard",{value:{...I["~standard"],jsonSchema:{input:J1(I,"input"),output:J1(I,"output")}},enumerable:!1,writable:!1}),b}catch(b){throw new Error("Error converting schema to JSON.")}}function t$($,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 t$(D.element,U);if(D.type==="set")return t$(D.valueType,U);if(D.type==="lazy")return t$(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 t$(D.innerType,U);if(D.type==="intersection")return t$(D.left,U)||t$(D.right,U);if(D.type==="record"||D.type==="map")return t$(D.keyType,U)||t$(D.valueType,U);if(D.type==="pipe")return t$(D.in,U)||t$(D.out,U);if(D.type==="object"){for(let A in D.shape)if(t$(D.shape[A],U))return!0;return!1}if(D.type==="union"){for(let A of D.options)if(t$(A,U))return!0;return!1}if(D.type==="tuple"){for(let A of D.items)if(t$(A,U))return!0;if(D.rest&&t$(D.rest,U))return!0;return!1}return!1}var KY=($,I={})=>(U)=>{let D=x4({...U,processors:I});return X$($,D),h4(D,$),f4(D,$)},J1=($,I)=>(U)=>{let{libraryOptions:D,target:A}=U??{},w=x4({...D??{},target:A,io:I,processors:{}});return X$($,w),h4(w,$),f4(w,$)};var Yu={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},VY=($,I,U,D)=>{let A=U;A.type="string";let{minimum:w,maximum:b,format:N,patterns:O,contentEncoding:X}=$._zod.bag;if(typeof w==="number")A.minLength=w;if(typeof b==="number")A.maxLength=b;if(N){if(A.format=Yu[N]??N,A.format==="")delete A.format}if(X)A.contentEncoding=X;if(O&&O.size>0){let W=[...O];if(W.length===1)A.pattern=W[0].source;else if(W.length>1)A.allOf=[...W.map((Q)=>({...I.target==="draft-07"||I.target==="draft-04"||I.target==="openapi-3.0"?{type:"string"}:{},pattern:Q.source}))]}},vY=($,I,U,D)=>{let A=U,{minimum:w,maximum:b,format:N,multipleOf:O,exclusiveMaximum:X,exclusiveMinimum:W}=$._zod.bag;if(typeof N==="string"&&N.includes("int"))A.type="integer";else A.type="number";if(typeof W==="number")if(I.target==="draft-04"||I.target==="openapi-3.0")A.minimum=W,A.exclusiveMinimum=!0;else A.exclusiveMinimum=W;if(typeof w==="number"){if(A.minimum=w,typeof W==="number"&&I.target!=="draft-04")if(W>=w)delete A.minimum;else delete A.exclusiveMinimum}if(typeof X==="number")if(I.target==="draft-04"||I.target==="openapi-3.0")A.maximum=X,A.exclusiveMaximum=!0;else A.exclusiveMaximum=X;if(typeof b==="number"){if(A.maximum=b,typeof X==="number"&&I.target!=="draft-04")if(X<=b)delete A.maximum;else delete A.exclusiveMaximum}if(typeof O==="number")A.multipleOf=O},qY=($,I,U,D)=>{U.type="boolean"},FY=($,I,U,D)=>{if(I.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},EY=($,I,U,D)=>{if(I.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},SY=($,I,U,D)=>{if(I.target==="openapi-3.0")U.type="string",U.nullable=!0,U.enum=[null];else U.type="null"},jY=($,I,U,D)=>{if(I.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},kY=($,I,U,D)=>{if(I.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},PY=($,I,U,D)=>{U.not={}},RY=($,I,U,D)=>{},TY=($,I,U,D)=>{},_Y=($,I,U,D)=>{if(I.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},CY=($,I,U,D)=>{let A=$._zod.def,w=cU(A.entries);if(w.every((b)=>typeof b==="number"))U.type="number";if(w.every((b)=>typeof b==="string"))U.type="string";U.enum=w},ZY=($,I,U,D)=>{let A=$._zod.def,w=[];for(let b of A.values)if(b===void 0){if(I.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof b==="bigint")if(I.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");else w.push(Number(b));else w.push(b);if(w.length===0);else if(w.length===1){let b=w[0];if(U.type=b===null?"null":typeof b,I.target==="draft-04"||I.target==="openapi-3.0")U.enum=[b];else U.const=b}else{if(w.every((b)=>typeof b==="number"))U.type="number";if(w.every((b)=>typeof b==="string"))U.type="string";if(w.every((b)=>typeof b==="boolean"))U.type="boolean";if(w.every((b)=>b===null))U.type="null";U.enum=w}},gY=($,I,U,D)=>{if(I.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},xY=($,I,U,D)=>{let A=U,w=$._zod.pattern;if(!w)throw new Error("Pattern not found in template literal");A.type="string",A.pattern=w.source},hY=($,I,U,D)=>{let A=U,w={type:"string",format:"binary",contentEncoding:"binary"},{minimum:b,maximum:N,mime:O}=$._zod.bag;if(b!==void 0)w.minLength=b;if(N!==void 0)w.maxLength=N;if(O)if(O.length===1)w.contentMediaType=O[0],Object.assign(A,w);else A.anyOf=O.map((X)=>{return{...w,contentMediaType:X}});else Object.assign(A,w)},fY=($,I,U,D)=>{U.type="boolean"},yY=($,I,U,D)=>{if(I.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},uY=($,I,U,D)=>{if(I.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},lY=($,I,U,D)=>{if(I.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},cY=($,I,U,D)=>{if(I.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},mY=($,I,U,D)=>{if(I.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},rY=($,I,U,D)=>{let A=U,w=$._zod.def,{minimum:b,maximum:N}=$._zod.bag;if(typeof b==="number")A.minItems=b;if(typeof N==="number")A.maxItems=N;A.type="array",A.items=X$(w.element,I,{...D,path:[...D.path,"items"]})},iY=($,I,U,D)=>{let A=U,w=$._zod.def;A.type="object",A.properties={};let b=w.shape;for(let X in b)A.properties[X]=X$(b[X],I,{...D,path:[...D.path,"properties",X]});let N=new Set(Object.keys(b)),O=new Set([...N].filter((X)=>{let W=w.shape[X]._zod;if(I.io==="input")return W.optin===void 0;else return W.optout===void 0}));if(O.size>0)A.required=Array.from(O);if(w.catchall?._zod.def.type==="never")A.additionalProperties=!1;else if(!w.catchall){if(I.io==="output")A.additionalProperties=!1}else if(w.catchall)A.additionalProperties=X$(w.catchall,I,{...D,path:[...D.path,"additionalProperties"]})},wb=($,I,U,D)=>{let A=$._zod.def,w=A.inclusive===!1,b=A.options.map((N,O)=>X$(N,I,{...D,path:[...D.path,w?"oneOf":"anyOf",O]}));if(w)U.oneOf=b;else U.anyOf=b},nY=($,I,U,D)=>{let A=$._zod.def,w=X$(A.left,I,{...D,path:[...D.path,"allOf",0]}),b=X$(A.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(b)?b.allOf:[b]];U.allOf=O},oY=($,I,U,D)=>{let A=U,w=$._zod.def;A.type="array";let b=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((B,Y)=>X$(B,I,{...D,path:[...D.path,b,Y]})),X=w.rest?X$(w.rest,I,{...D,path:[...D.path,N,...I.target==="openapi-3.0"?[w.items.length]:[]]}):null;if(I.target==="draft-2020-12"){if(A.prefixItems=O,X)A.items=X}else if(I.target==="openapi-3.0"){if(A.items={anyOf:O},X)A.items.anyOf.push(X);if(A.minItems=O.length,!X)A.maxItems=O.length}else if(A.items=O,X)A.additionalItems=X;let{minimum:W,maximum:Q}=$._zod.bag;if(typeof W==="number")A.minItems=W;if(typeof Q==="number")A.maxItems=Q},dY=($,I,U,D)=>{let A=U,w=$._zod.def;if(A.type="object",I.target==="draft-07"||I.target==="draft-2020-12")A.propertyNames=X$(w.keyType,I,{...D,path:[...D.path,"propertyNames"]});A.additionalProperties=X$(w.valueType,I,{...D,path:[...D.path,"additionalProperties"]})},pY=($,I,U,D)=>{let A=$._zod.def,w=X$(A.innerType,I,D),b=I.seen.get($);if(I.target==="openapi-3.0")b.ref=A.innerType,U.nullable=!0;else U.anyOf=[w,{type:"null"}]},tY=($,I,U,D)=>{let A=$._zod.def;X$(A.innerType,I,D);let w=I.seen.get($);w.ref=A.innerType},aY=($,I,U,D)=>{let A=$._zod.def;X$(A.innerType,I,D);let w=I.seen.get($);w.ref=A.innerType,U.default=JSON.parse(JSON.stringify(A.defaultValue))},eY=($,I,U,D)=>{let A=$._zod.def;X$(A.innerType,I,D);let w=I.seen.get($);if(w.ref=A.innerType,I.io==="input")U._prefault=JSON.parse(JSON.stringify(A.defaultValue))},sY=($,I,U,D)=>{let A=$._zod.def;X$(A.innerType,I,D);let w=I.seen.get($);w.ref=A.innerType;let b;try{b=A.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}U.default=b},$B=($,I,U,D)=>{let A=$._zod.def,w=I.io==="input"?A.in._zod.def.type==="transform"?A.out:A.in:A.out;X$(w,I,D);let b=I.seen.get($);b.ref=w},IB=($,I,U,D)=>{let A=$._zod.def;X$(A.innerType,I,D);let w=I.seen.get($);w.ref=A.innerType,U.readOnly=!0},UB=($,I,U,D)=>{let A=$._zod.def;X$(A.innerType,I,D);let w=I.seen.get($);w.ref=A.innerType},AB=($,I,U,D)=>{let A=$._zod.def;X$(A.innerType,I,D);let w=I.seen.get($);w.ref=A.innerType},DB=($,I,U,D)=>{let A=$._zod.innerType;X$(A,I,D);let w=I.seen.get($);w.ref=A},Db={string:VY,number:vY,boolean:qY,bigint:FY,symbol:EY,null:SY,undefined:jY,void:kY,never:PY,any:RY,unknown:TY,date:_Y,enum:CY,literal:ZY,nan:gY,template_literal:xY,file:hY,success:fY,custom:yY,function:uY,transform:lY,map:cY,set:mY,array:rY,object:iY,union:wb,intersection:nY,tuple:oY,record:dY,nullable:pY,nonoptional:tY,default:aY,prefault:eY,catch:sY,pipe:$B,readonly:IB,promise:UB,optional:AB,lazy:DB};function bb($,I){if("_idmap"in $){let D=$,A=x4({...I,processors:Db}),w={};for(let O of D._idmap.entries()){let[X,W]=O;X$(W,A)}let b={},N={registry:D,uri:I?.uri,defs:w};A.external=N;for(let O of D._idmap.entries()){let[X,W]=O;h4(A,W),b[X]=f4(A,W)}if(Object.keys(w).length>0){let O=A.target==="draft-2020-12"?"$defs":"definitions";b.__shared={[O]:w}}return{schemas:b}}let U=x4({...I,processors:Db});return X$($,U),h4(U,$),f4(U,$)}class wB{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=x4({processors:Db,target:I,...$?.metadata&&{metadata:$.metadata},...$?.unrepresentable&&{unrepresentable:$.unrepresentable},...$?.override&&{override:$.override},...$?.io&&{io:$.io}})}process($,I={path:[],schemaPath:[]}){return X$($,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}h4(this.ctx,$);let U=f4(this.ctx,$),{"~standard":D,...A}=U;return A}}var fv={};var X0={};K6(X0,{xor:()=>Rq,xid:()=>sv,void:()=>Fq,uuidv7:()=>iv,uuidv6:()=>rv,uuidv4:()=>mv,uuid:()=>cv,url:()=>nv,unknown:()=>WI,union:()=>Cb,undefined:()=>vq,ulid:()=>ev,uint64:()=>Kq,uint32:()=>Lq,tuple:()=>yB,transform:()=>gb,templateLiteral:()=>mq,symbol:()=>Vq,superRefine:()=>W7,success:()=>uq,stringbool:()=>aq,stringFormat:()=>Wq,string:()=>Qb,strictObject:()=>kq,set:()=>gq,refine:()=>X7,record:()=>uB,readonly:()=>A7,promise:()=>rq,preprocess:()=>sq,prefault:()=>tB,pipe:()=>Y0,partialRecord:()=>_q,optional:()=>G0,object:()=>jq,number:()=>qB,nullish:()=>yq,nullable:()=>Q0,null:()=>kB,nonoptional:()=>aB,never:()=>_b,nativeEnum:()=>xq,nanoid:()=>pv,nan:()=>lq,meta:()=>pq,map:()=>Zq,mac:()=>Uq,looseRecord:()=>Cq,looseObject:()=>Pq,literal:()=>hq,lazy:()=>b7,ksuid:()=>$q,keyof:()=>Sq,jwt:()=>Xq,json:()=>eq,ipv6:()=>Aq,ipv4:()=>Iq,intersection:()=>hB,int64:()=>Mq,int32:()=>Hq,int:()=>Yb,instanceof:()=>tq,httpUrl:()=>ov,hostname:()=>Gq,hex:()=>Qq,hash:()=>Yq,guid:()=>lv,function:()=>iq,float64:()=>Jq,float32:()=>Bq,file:()=>fq,enum:()=>Zb,emoji:()=>dv,email:()=>uv,e164:()=>Oq,discriminatedUnion:()=>Tq,describe:()=>dq,date:()=>Eq,custom:()=>oq,cuid2:()=>av,cuid:()=>tv,codec:()=>cq,cidrv6:()=>wq,cidrv4:()=>Dq,check:()=>nq,catch:()=>$7,boolean:()=>FB,bigint:()=>zq,base64url:()=>Nq,base64:()=>bq,array:()=>H0,any:()=>qq,_function:()=>iq,_default:()=>dB,_ZodString:()=>Bb,ZodXor:()=>ZB,ZodXID:()=>Vb,ZodVoid:()=>_B,ZodUnknown:()=>RB,ZodUnion:()=>z0,ZodUndefined:()=>SB,ZodUUID:()=>n6,ZodURL:()=>B0,ZodULID:()=>Kb,ZodType:()=>t,ZodTuple:()=>fB,ZodTransform:()=>iB,ZodTemplateLiteral:()=>D7,ZodSymbol:()=>EB,ZodSuccess:()=>eB,ZodStringFormat:()=>Y$,ZodString:()=>z1,ZodSet:()=>cB,ZodRecord:()=>M0,ZodReadonly:()=>U7,ZodPromise:()=>N7,ZodPrefault:()=>pB,ZodPipe:()=>fb,ZodOptional:()=>xb,ZodObject:()=>L0,ZodNumberFormat:()=>GI,ZodNumber:()=>K1,ZodNullable:()=>nB,ZodNull:()=>jB,ZodNonOptional:()=>hb,ZodNever:()=>TB,ZodNanoID:()=>Lb,ZodNaN:()=>I7,ZodMap:()=>lB,ZodMAC:()=>vB,ZodLiteral:()=>mB,ZodLazy:()=>w7,ZodKSUID:()=>vb,ZodJWT:()=>Rb,ZodIntersection:()=>xB,ZodIPv6:()=>Fb,ZodIPv4:()=>qb,ZodGUID:()=>W0,ZodFunction:()=>O7,ZodFile:()=>rB,ZodEnum:()=>L1,ZodEmoji:()=>Hb,ZodEmail:()=>Jb,ZodE164:()=>Pb,ZodDiscriminatedUnion:()=>gB,ZodDefault:()=>oB,ZodDate:()=>J0,ZodCustomStringFormat:()=>M1,ZodCustom:()=>K0,ZodCodec:()=>yb,ZodCatch:()=>sB,ZodCUID2:()=>Mb,ZodCUID:()=>zb,ZodCIDRv6:()=>Sb,ZodCIDRv4:()=>Eb,ZodBoolean:()=>V1,ZodBigIntFormat:()=>Tb,ZodBigInt:()=>v1,ZodBase64URL:()=>kb,ZodBase64:()=>jb,ZodArray:()=>CB,ZodAny:()=>PB});var Nb={};K6(Nb,{uppercase:()=>D1,trim:()=>W1,toUpperCase:()=>Q1,toLowerCase:()=>G1,startsWith:()=>b1,slugify:()=>Y1,size:()=>I1,regex:()=>U1,property:()=>Ab,positive:()=>sw,overwrite:()=>C6,normalize:()=>X1,nonpositive:()=>Ib,nonnegative:()=>Ub,negative:()=>$b,multipleOf:()=>Z4,minSize:()=>g4,minLength:()=>w4,mime:()=>O1,maxSize:()=>NI,maxLength:()=>OI,lte:()=>W6,lt:()=>r6,lowercase:()=>A1,length:()=>XI,includes:()=>w1,gte:()=>p$,gt:()=>i6,endsWith:()=>N1});var H1={};K6(H1,{time:()=>OB,duration:()=>XB,datetime:()=>bB,date:()=>NB,ZodISOTime:()=>Wb,ZodISODuration:()=>Gb,ZodISODateTime:()=>Ob,ZodISODate:()=>Xb});var Ob=L("ZodISODateTime",($,I)=>{rG.init($,I),Y$.init($,I)});function bB($){return yQ(Ob,$)}var Xb=L("ZodISODate",($,I)=>{iG.init($,I),Y$.init($,I)});function NB($){return uQ(Xb,$)}var Wb=L("ZodISOTime",($,I)=>{nG.init($,I),Y$.init($,I)});function OB($){return lQ(Wb,$)}var Gb=L("ZodISODuration",($,I)=>{oG.init($,I),Y$.init($,I)});function XB($){return cQ(Gb,$)}var yv=($,I)=>{oU.init($,I),$.name="ZodError",Object.defineProperties($,{format:{value:(U)=>pU($,U)},flatten:{value:(U)=>dU($,U)},addIssue:{value:(U)=>{$.issues.push(U),$.message=JSON.stringify($.issues,oI,2)}},addIssues:{value:(U)=>{$.issues.push(...U),$.message=JSON.stringify($.issues,oI,2)}},isEmpty:{get(){return $.issues.length===0}}})},Ju=L("ZodError",yv),D6=L("ZodError",yv,{Parent:Error});var WB=tI(D6),GB=aI(D6),QB=eI(D6),YB=sI(D6),BB=Qw(D6),JB=Yw(D6),HB=Bw(D6),LB=Jw(D6),zB=Hw(D6),MB=Lw(D6),KB=zw(D6),VB=Mw(D6);var t=L("ZodType",($,I)=>{return o.init($,I),Object.assign($["~standard"],{jsonSchema:{input:J1($,"input"),output:J1($,"output")}}),$.toJSONSchema=KY($,{}),$.def=I,$.type=I.type,Object.defineProperty($,"_def",{value:I}),$.check=(...U)=>{return $.clone(j.mergeDefs(I,{checks:[...I.checks??[],...U.map((D)=>typeof D==="function"?{_zod:{check:D,def:{check:"custom"},onattach:[]}}:D)]}))},$.clone=(U,D)=>o$($,U,D),$.brand=()=>$,$.register=(U,D)=>{return U.add($,D),$},$.parse=(U,D)=>WB($,U,D,{callee:$.parse}),$.safeParse=(U,D)=>QB($,U,D),$.parseAsync=async(U,D)=>GB($,U,D,{callee:$.parseAsync}),$.safeParseAsync=async(U,D)=>YB($,U,D),$.spa=$.safeParseAsync,$.encode=(U,D)=>BB($,U,D),$.decode=(U,D)=>JB($,U,D),$.encodeAsync=async(U,D)=>HB($,U,D),$.decodeAsync=async(U,D)=>LB($,U,D),$.safeEncode=(U,D)=>zB($,U,D),$.safeDecode=(U,D)=>MB($,U,D),$.safeEncodeAsync=async(U,D)=>KB($,U,D),$.safeDecodeAsync=async(U,D)=>VB($,U,D),$.refine=(U,D)=>$.check(X7(U,D)),$.superRefine=(U)=>$.check(W7(U)),$.overwrite=(U)=>$.check(C6(U)),$.optional=()=>G0($),$.nullable=()=>Q0($),$.nullish=()=>G0(Q0($)),$.nonoptional=(U)=>aB($,U),$.array=()=>H0($),$.or=(U)=>Cb([$,U]),$.and=(U)=>hB($,U),$.transform=(U)=>Y0($,gb(U)),$.default=(U)=>dB($,U),$.prefault=(U)=>tB($,U),$.catch=(U)=>$7($,U),$.pipe=(U)=>Y0($,U),$.readonly=()=>A7($),$.describe=(U)=>{let D=$.clone();return d$.add(D,{description:U}),D},Object.defineProperty($,"description",{get(){return d$.get($)?.description},configurable:!0}),$.meta=(...U)=>{if(U.length===0)return d$.get($);let D=$.clone();return d$.add(D,U[0]),D},$.isOptional=()=>$.safeParse(void 0).success,$.isNullable=()=>$.safeParse(null).success,$}),Bb=L("_ZodString",($,I)=>{bI.init($,I),t.init($,I),$._zod.processJSONSchema=(D,A,w)=>VY($,D,A,w);let U=$._zod.bag;$.format=U.format??null,$.minLength=U.minimum??null,$.maxLength=U.maximum??null,$.regex=(...D)=>$.check(U1(...D)),$.includes=(...D)=>$.check(w1(...D)),$.startsWith=(...D)=>$.check(b1(...D)),$.endsWith=(...D)=>$.check(N1(...D)),$.min=(...D)=>$.check(w4(...D)),$.max=(...D)=>$.check(OI(...D)),$.length=(...D)=>$.check(XI(...D)),$.nonempty=(...D)=>$.check(w4(1,...D)),$.lowercase=(D)=>$.check(A1(D)),$.uppercase=(D)=>$.check(D1(D)),$.trim=()=>$.check(W1()),$.normalize=(...D)=>$.check(X1(...D)),$.toLowerCase=()=>$.check(G1()),$.toUpperCase=()=>$.check(Q1()),$.slugify=()=>$.check(Y1())}),z1=L("ZodString",($,I)=>{bI.init($,I),Bb.init($,I),$.email=(U)=>$.check(Cw(Jb,U)),$.url=(U)=>$.check(O0(B0,U)),$.jwt=(U)=>$.check(ew(Rb,U)),$.emoji=(U)=>$.check(fw(Hb,U)),$.guid=(U)=>$.check(N0(W0,U)),$.uuid=(U)=>$.check(Zw(n6,U)),$.uuidv4=(U)=>$.check(gw(n6,U)),$.uuidv6=(U)=>$.check(xw(n6,U)),$.uuidv7=(U)=>$.check(hw(n6,U)),$.nanoid=(U)=>$.check(yw(Lb,U)),$.guid=(U)=>$.check(N0(W0,U)),$.cuid=(U)=>$.check(uw(zb,U)),$.cuid2=(U)=>$.check(lw(Mb,U)),$.ulid=(U)=>$.check(cw(Kb,U)),$.base64=(U)=>$.check(pw(jb,U)),$.base64url=(U)=>$.check(tw(kb,U)),$.xid=(U)=>$.check(mw(Vb,U)),$.ksuid=(U)=>$.check(rw(vb,U)),$.ipv4=(U)=>$.check(iw(qb,U)),$.ipv6=(U)=>$.check(nw(Fb,U)),$.cidrv4=(U)=>$.check(ow(Eb,U)),$.cidrv6=(U)=>$.check(dw(Sb,U)),$.e164=(U)=>$.check(aw(Pb,U)),$.datetime=(U)=>$.check(bB(U)),$.date=(U)=>$.check(NB(U)),$.time=(U)=>$.check(OB(U)),$.duration=(U)=>$.check(XB(U))});function Qb($){return gQ(z1,$)}var Y$=L("ZodStringFormat",($,I)=>{Q$.init($,I),Bb.init($,I)}),Jb=L("ZodEmail",($,I)=>{gG.init($,I),Y$.init($,I)});function uv($){return Cw(Jb,$)}var W0=L("ZodGUID",($,I)=>{CG.init($,I),Y$.init($,I)});function lv($){return N0(W0,$)}var n6=L("ZodUUID",($,I)=>{ZG.init($,I),Y$.init($,I)});function cv($){return Zw(n6,$)}function mv($){return gw(n6,$)}function rv($){return xw(n6,$)}function iv($){return hw(n6,$)}var B0=L("ZodURL",($,I)=>{xG.init($,I),Y$.init($,I)});function nv($){return O0(B0,$)}function ov($){return O0(B0,{protocol:/^https?$/,hostname:M6.domain,...j.normalizeParams($)})}var Hb=L("ZodEmoji",($,I)=>{hG.init($,I),Y$.init($,I)});function dv($){return fw(Hb,$)}var Lb=L("ZodNanoID",($,I)=>{fG.init($,I),Y$.init($,I)});function pv($){return yw(Lb,$)}var zb=L("ZodCUID",($,I)=>{yG.init($,I),Y$.init($,I)});function tv($){return uw(zb,$)}var Mb=L("ZodCUID2",($,I)=>{uG.init($,I),Y$.init($,I)});function av($){return lw(Mb,$)}var Kb=L("ZodULID",($,I)=>{lG.init($,I),Y$.init($,I)});function ev($){return cw(Kb,$)}var Vb=L("ZodXID",($,I)=>{cG.init($,I),Y$.init($,I)});function sv($){return mw(Vb,$)}var vb=L("ZodKSUID",($,I)=>{mG.init($,I),Y$.init($,I)});function $q($){return rw(vb,$)}var qb=L("ZodIPv4",($,I)=>{dG.init($,I),Y$.init($,I)});function Iq($){return iw(qb,$)}var vB=L("ZodMAC",($,I)=>{tG.init($,I),Y$.init($,I)});function Uq($){return hQ(vB,$)}var Fb=L("ZodIPv6",($,I)=>{pG.init($,I),Y$.init($,I)});function Aq($){return nw(Fb,$)}var Eb=L("ZodCIDRv4",($,I)=>{aG.init($,I),Y$.init($,I)});function Dq($){return ow(Eb,$)}var Sb=L("ZodCIDRv6",($,I)=>{eG.init($,I),Y$.init($,I)});function wq($){return dw(Sb,$)}var jb=L("ZodBase64",($,I)=>{$8.init($,I),Y$.init($,I)});function bq($){return pw(jb,$)}var kb=L("ZodBase64URL",($,I)=>{I8.init($,I),Y$.init($,I)});function Nq($){return tw(kb,$)}var Pb=L("ZodE164",($,I)=>{U8.init($,I),Y$.init($,I)});function Oq($){return aw(Pb,$)}var Rb=L("ZodJWT",($,I)=>{A8.init($,I),Y$.init($,I)});function Xq($){return ew(Rb,$)}var M1=L("ZodCustomStringFormat",($,I)=>{D8.init($,I),Y$.init($,I)});function Wq($,I,U={}){return B1(M1,$,I,U)}function Gq($){return B1(M1,"hostname",M6.hostname,$)}function Qq($){return B1(M1,"hex",M6.hex,$)}function Yq($,I){let U=I?.enc??"hex",D=`${$}_${U}`,A=M6[D];if(!A)throw new Error(`Unrecognized hash format: ${D}`);return B1(M1,D,A,I)}var K1=L("ZodNumber",($,I)=>{Pw.init($,I),t.init($,I),$._zod.processJSONSchema=(D,A,w)=>vY($,D,A,w),$.gt=(D,A)=>$.check(i6(D,A)),$.gte=(D,A)=>$.check(p$(D,A)),$.min=(D,A)=>$.check(p$(D,A)),$.lt=(D,A)=>$.check(r6(D,A)),$.lte=(D,A)=>$.check(W6(D,A)),$.max=(D,A)=>$.check(W6(D,A)),$.int=(D)=>$.check(Yb(D)),$.safe=(D)=>$.check(Yb(D)),$.positive=(D)=>$.check(i6(0,D)),$.nonnegative=(D)=>$.check(p$(0,D)),$.negative=(D)=>$.check(r6(0,D)),$.nonpositive=(D)=>$.check(W6(0,D)),$.multipleOf=(D,A)=>$.check(Z4(D,A)),$.step=(D,A)=>$.check(Z4(D,A)),$.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 qB($){return mQ(K1,$)}var GI=L("ZodNumberFormat",($,I)=>{w8.init($,I),K1.init($,I)});function Yb($){return iQ(GI,$)}function Bq($){return nQ(GI,$)}function Jq($){return oQ(GI,$)}function Hq($){return dQ(GI,$)}function Lq($){return pQ(GI,$)}var V1=L("ZodBoolean",($,I)=>{eU.init($,I),t.init($,I),$._zod.processJSONSchema=(U,D,A)=>qY($,U,D,A)});function FB($){return tQ(V1,$)}var v1=L("ZodBigInt",($,I)=>{Rw.init($,I),t.init($,I),$._zod.processJSONSchema=(D,A,w)=>FY($,D,A,w),$.gte=(D,A)=>$.check(p$(D,A)),$.min=(D,A)=>$.check(p$(D,A)),$.gt=(D,A)=>$.check(i6(D,A)),$.gte=(D,A)=>$.check(p$(D,A)),$.min=(D,A)=>$.check(p$(D,A)),$.lt=(D,A)=>$.check(r6(D,A)),$.lte=(D,A)=>$.check(W6(D,A)),$.max=(D,A)=>$.check(W6(D,A)),$.positive=(D)=>$.check(i6(BigInt(0),D)),$.negative=(D)=>$.check(r6(BigInt(0),D)),$.nonpositive=(D)=>$.check(W6(BigInt(0),D)),$.nonnegative=(D)=>$.check(p$(BigInt(0),D)),$.multipleOf=(D,A)=>$.check(Z4(D,A));let U=$._zod.bag;$.minValue=U.minimum??null,$.maxValue=U.maximum??null,$.format=U.format??null});function zq($){return eQ(v1,$)}var Tb=L("ZodBigIntFormat",($,I)=>{b8.init($,I),v1.init($,I)});function Mq($){return $Y(Tb,$)}function Kq($){return IY(Tb,$)}var EB=L("ZodSymbol",($,I)=>{N8.init($,I),t.init($,I),$._zod.processJSONSchema=(U,D,A)=>EY($,U,D,A)});function Vq($){return UY(EB,$)}var SB=L("ZodUndefined",($,I)=>{O8.init($,I),t.init($,I),$._zod.processJSONSchema=(U,D,A)=>jY($,U,D,A)});function vq($){return AY(SB,$)}var jB=L("ZodNull",($,I)=>{X8.init($,I),t.init($,I),$._zod.processJSONSchema=(U,D,A)=>SY($,U,D,A)});function kB($){return DY(jB,$)}var PB=L("ZodAny",($,I)=>{W8.init($,I),t.init($,I),$._zod.processJSONSchema=(U,D,A)=>RY($,U,D,A)});function qq(){return wY(PB)}var RB=L("ZodUnknown",($,I)=>{G8.init($,I),t.init($,I),$._zod.processJSONSchema=(U,D,A)=>TY($,U,D,A)});function WI(){return bY(RB)}var TB=L("ZodNever",($,I)=>{Q8.init($,I),t.init($,I),$._zod.processJSONSchema=(U,D,A)=>PY($,U,D,A)});function _b($){return NY(TB,$)}var _B=L("ZodVoid",($,I)=>{Y8.init($,I),t.init($,I),$._zod.processJSONSchema=(U,D,A)=>kY($,U,D,A)});function Fq($){return OY(_B,$)}var J0=L("ZodDate",($,I)=>{B8.init($,I),t.init($,I),$._zod.processJSONSchema=(D,A,w)=>_Y($,D,A,w),$.min=(D,A)=>$.check(p$(D,A)),$.max=(D,A)=>$.check(W6(D,A));let U=$._zod.bag;$.minDate=U.minimum?new Date(U.minimum):null,$.maxDate=U.maximum?new Date(U.maximum):null});function Eq($){return XY(J0,$)}var CB=L("ZodArray",($,I)=>{J8.init($,I),t.init($,I),$._zod.processJSONSchema=(U,D,A)=>rY($,U,D,A),$.element=I.element,$.min=(U,D)=>$.check(w4(U,D)),$.nonempty=(U)=>$.check(w4(1,U)),$.max=(U,D)=>$.check(OI(U,D)),$.length=(U,D)=>$.check(XI(U,D)),$.unwrap=()=>$.element});function H0($,I){return QY(CB,$,I)}function Sq($){let I=$._zod.def.shape;return Zb(Object.keys(I))}var L0=L("ZodObject",($,I)=>{H8.init($,I),t.init($,I),$._zod.processJSONSchema=(U,D,A)=>iY($,U,D,A),j.defineLazy($,"shape",()=>{return I.shape}),$.keyof=()=>Zb(Object.keys($._zod.def.shape)),$.catchall=(U)=>$.clone({...$._zod.def,catchall:U}),$.passthrough=()=>$.clone({...$._zod.def,catchall:WI()}),$.loose=()=>$.clone({...$._zod.def,catchall:WI()}),$.strict=()=>$.clone({...$._zod.def,catchall:_b()}),$.strip=()=>$.clone({...$._zod.def,catchall:void 0}),$.extend=(U)=>{return j.extend($,U)},$.safeExtend=(U)=>{return j.safeExtend($,U)},$.merge=(U)=>j.merge($,U),$.pick=(U)=>j.pick($,U),$.omit=(U)=>j.omit($,U),$.partial=(...U)=>j.partial(xb,$,U[0]),$.required=(...U)=>j.required(hb,$,U[0])});function jq($,I){let U={type:"object",shape:$??{},...j.normalizeParams(I)};return new L0(U)}function kq($,I){return new L0({type:"object",shape:$,catchall:_b(),...j.normalizeParams(I)})}function Pq($,I){return new L0({type:"object",shape:$,catchall:WI(),...j.normalizeParams(I)})}var z0=L("ZodUnion",($,I)=>{sU.init($,I),t.init($,I),$._zod.processJSONSchema=(U,D,A)=>wb($,U,D,A),$.options=I.options});function Cb($,I){return new z0({type:"union",options:$,...j.normalizeParams(I)})}var ZB=L("ZodXor",($,I)=>{z0.init($,I),L8.init($,I),$._zod.processJSONSchema=(U,D,A)=>wb($,U,D,A),$.options=I.options});function Rq($,I){return new ZB({type:"union",options:$,inclusive:!1,...j.normalizeParams(I)})}var gB=L("ZodDiscriminatedUnion",($,I)=>{z0.init($,I),z8.init($,I)});function Tq($,I,U){return new gB({type:"union",options:I,discriminator:$,...j.normalizeParams(U)})}var xB=L("ZodIntersection",($,I)=>{M8.init($,I),t.init($,I),$._zod.processJSONSchema=(U,D,A)=>nY($,U,D,A)});function hB($,I){return new xB({type:"intersection",left:$,right:I})}var fB=L("ZodTuple",($,I)=>{Tw.init($,I),t.init($,I),$._zod.processJSONSchema=(U,D,A)=>oY($,U,D,A),$.rest=(U)=>$.clone({...$._zod.def,rest:U})});function yB($,I,U){let D=I instanceof o,A=D?U:I;return new fB({type:"tuple",items:$,rest:D?I:null,...j.normalizeParams(A)})}var M0=L("ZodRecord",($,I)=>{K8.init($,I),t.init($,I),$._zod.processJSONSchema=(U,D,A)=>dY($,U,D,A),$.keyType=I.keyType,$.valueType=I.valueType});function uB($,I,U){return new M0({type:"record",keyType:$,valueType:I,...j.normalizeParams(U)})}function _q($,I,U){let D=o$($);return D._zod.values=void 0,new M0({type:"record",keyType:D,valueType:I,...j.normalizeParams(U)})}function Cq($,I,U){return new M0({type:"record",keyType:$,valueType:I,mode:"loose",...j.normalizeParams(U)})}var lB=L("ZodMap",($,I)=>{V8.init($,I),t.init($,I),$._zod.processJSONSchema=(U,D,A)=>cY($,U,D,A),$.keyType=I.keyType,$.valueType=I.valueType});function Zq($,I,U){return new lB({type:"map",keyType:$,valueType:I,...j.normalizeParams(U)})}var cB=L("ZodSet",($,I)=>{v8.init($,I),t.init($,I),$._zod.processJSONSchema=(U,D,A)=>mY($,U,D,A),$.min=(...U)=>$.check(g4(...U)),$.nonempty=(U)=>$.check(g4(1,U)),$.max=(...U)=>$.check(NI(...U)),$.size=(...U)=>$.check(I1(...U))});function gq($,I){return new cB({type:"set",valueType:$,...j.normalizeParams(I)})}var L1=L("ZodEnum",($,I)=>{q8.init($,I),t.init($,I),$._zod.processJSONSchema=(D,A,w)=>CY($,D,A,w),$.enum=I.entries,$.options=Object.values(I.entries);let U=new Set(Object.keys(I.entries));$.extract=(D,A)=>{let w={};for(let b of D)if(U.has(b))w[b]=I.entries[b];else throw new Error(`Key ${b} not found in enum`);return new L1({...I,checks:[],...j.normalizeParams(A),entries:w})},$.exclude=(D,A)=>{let w={...I.entries};for(let b of D)if(U.has(b))delete w[b];else throw new Error(`Key ${b} not found in enum`);return new L1({...I,checks:[],...j.normalizeParams(A),entries:w})}});function Zb($,I){let U=Array.isArray($)?Object.fromEntries($.map((D)=>[D,D])):$;return new L1({type:"enum",entries:U,...j.normalizeParams(I)})}function xq($,I){return new L1({type:"enum",entries:$,...j.normalizeParams(I)})}var mB=L("ZodLiteral",($,I)=>{F8.init($,I),t.init($,I),$._zod.processJSONSchema=(U,D,A)=>ZY($,U,D,A),$.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 hq($,I){return new mB({type:"literal",values:Array.isArray($)?$:[$],...j.normalizeParams(I)})}var rB=L("ZodFile",($,I)=>{E8.init($,I),t.init($,I),$._zod.processJSONSchema=(U,D,A)=>hY($,U,D,A),$.min=(U,D)=>$.check(g4(U,D)),$.max=(U,D)=>$.check(NI(U,D)),$.mime=(U,D)=>$.check(O1(Array.isArray(U)?U:[U],D))});function fq($){return YY(rB,$)}var iB=L("ZodTransform",($,I)=>{S8.init($,I),t.init($,I),$._zod.processJSONSchema=(U,D,A)=>lY($,U,D,A),$._zod.parse=(U,D)=>{if(D.direction==="backward")throw new AI($.constructor.name);U.addIssue=(w)=>{if(typeof w==="string")U.issues.push(j.issue(w,U.value,I));else{let b=w;if(b.fatal)b.continue=!1;b.code??(b.code="custom"),b.input??(b.input=U.value),b.inst??(b.inst=$),U.issues.push(j.issue(b))}};let A=I.transform(U.value,U);if(A instanceof Promise)return A.then((w)=>{return U.value=w,U});return U.value=A,U}});function gb($){return new iB({type:"transform",transform:$})}var xb=L("ZodOptional",($,I)=>{j8.init($,I),t.init($,I),$._zod.processJSONSchema=(U,D,A)=>AB($,U,D,A),$.unwrap=()=>$._zod.def.innerType});function G0($){return new xb({type:"optional",innerType:$})}var nB=L("ZodNullable",($,I)=>{k8.init($,I),t.init($,I),$._zod.processJSONSchema=(U,D,A)=>pY($,U,D,A),$.unwrap=()=>$._zod.def.innerType});function Q0($){return new nB({type:"nullable",innerType:$})}function yq($){return G0(Q0($))}var oB=L("ZodDefault",($,I)=>{P8.init($,I),t.init($,I),$._zod.processJSONSchema=(U,D,A)=>aY($,U,D,A),$.unwrap=()=>$._zod.def.innerType,$.removeDefault=$.unwrap});function dB($,I){return new oB({type:"default",innerType:$,get defaultValue(){return typeof I==="function"?I():j.shallowClone(I)}})}var pB=L("ZodPrefault",($,I)=>{R8.init($,I),t.init($,I),$._zod.processJSONSchema=(U,D,A)=>eY($,U,D,A),$.unwrap=()=>$._zod.def.innerType});function tB($,I){return new pB({type:"prefault",innerType:$,get defaultValue(){return typeof I==="function"?I():j.shallowClone(I)}})}var hb=L("ZodNonOptional",($,I)=>{T8.init($,I),t.init($,I),$._zod.processJSONSchema=(U,D,A)=>tY($,U,D,A),$.unwrap=()=>$._zod.def.innerType});function aB($,I){return new hb({type:"nonoptional",innerType:$,...j.normalizeParams(I)})}var eB=L("ZodSuccess",($,I)=>{_8.init($,I),t.init($,I),$._zod.processJSONSchema=(U,D,A)=>fY($,U,D,A),$.unwrap=()=>$._zod.def.innerType});function uq($){return new eB({type:"success",innerType:$})}var sB=L("ZodCatch",($,I)=>{C8.init($,I),t.init($,I),$._zod.processJSONSchema=(U,D,A)=>sY($,U,D,A),$.unwrap=()=>$._zod.def.innerType,$.removeCatch=$.unwrap});function $7($,I){return new sB({type:"catch",innerType:$,catchValue:typeof I==="function"?I:()=>I})}var I7=L("ZodNaN",($,I)=>{Z8.init($,I),t.init($,I),$._zod.processJSONSchema=(U,D,A)=>gY($,U,D,A)});function lq($){return GY(I7,$)}var fb=L("ZodPipe",($,I)=>{g8.init($,I),t.init($,I),$._zod.processJSONSchema=(U,D,A)=>$B($,U,D,A),$.in=I.in,$.out=I.out});function Y0($,I){return new fb({type:"pipe",in:$,out:I})}var yb=L("ZodCodec",($,I)=>{fb.init($,I),$0.init($,I)});function cq($,I,U){return new yb({type:"pipe",in:$,out:I,transform:U.decode,reverseTransform:U.encode})}var U7=L("ZodReadonly",($,I)=>{x8.init($,I),t.init($,I),$._zod.processJSONSchema=(U,D,A)=>IB($,U,D,A),$.unwrap=()=>$._zod.def.innerType});function A7($){return new U7({type:"readonly",innerType:$})}var D7=L("ZodTemplateLiteral",($,I)=>{h8.init($,I),t.init($,I),$._zod.processJSONSchema=(U,D,A)=>xY($,U,D,A)});function mq($,I){return new D7({type:"template_literal",parts:$,...j.normalizeParams(I)})}var w7=L("ZodLazy",($,I)=>{u8.init($,I),t.init($,I),$._zod.processJSONSchema=(U,D,A)=>DB($,U,D,A),$.unwrap=()=>$._zod.def.getter()});function b7($){return new w7({type:"lazy",getter:$})}var N7=L("ZodPromise",($,I)=>{y8.init($,I),t.init($,I),$._zod.processJSONSchema=(U,D,A)=>UB($,U,D,A),$.unwrap=()=>$._zod.def.innerType});function rq($){return new N7({type:"promise",innerType:$})}var O7=L("ZodFunction",($,I)=>{f8.init($,I),t.init($,I),$._zod.processJSONSchema=(U,D,A)=>uY($,U,D,A)});function iq($){return new O7({type:"function",input:Array.isArray($?.input)?yB($?.input):$?.input??H0(WI()),output:$?.output??WI()})}var K0=L("ZodCustom",($,I)=>{l8.init($,I),t.init($,I),$._zod.processJSONSchema=(U,D,A)=>yY($,U,D,A)});function nq($){let I=new J$({check:"custom"});return I._zod.check=$,I}function oq($,I){return BY(K0,$??(()=>!0),I)}function X7($,I={}){return JY(K0,$,I)}function W7($){return HY($)}var dq=LY,pq=zY;function tq($,I={error:`Input not instance of ${$.name}`}){let U=new K0({type:"custom",check:"custom",fn:(D)=>D instanceof $,abort:!0,...j.normalizeParams(I)});return U._zod.bag.Class=$,U}var aq=(...$)=>MY({Codec:yb,Boolean:V1,String:z1},...$);function eq($){let I=b7(()=>{return Cb([Qb($),qB(),FB(),kB(),H0(I),uB(Qb(),I)])});return I}function sq($,I){return Y0(gb($),I)}var Lu={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 zu($){k$({customError:$})}function Mu(){return k$().customError}var G7;(function($){})(G7||(G7={}));var _={...X0,...Nb,iso:H1};function Ku($,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 Vu($,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 A=U[1];if(!A||!I.defs[A])throw new Error(`Reference not found: ${$}`);return I.defs[A]}throw new Error(`Reference not found: ${$}`)}function $F($,I){if($.not!==void 0){if(typeof $.not==="object"&&Object.keys($.not).length===0)return _.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 A=$.$ref;if(I.refs.has(A))return I.refs.get(A);if(I.processing.has(A))return _.lazy(()=>{if(!I.refs.has(A))throw new Error(`Circular reference not resolved: ${A}`);return I.refs.get(A)});I.processing.add(A);let w=Vu(A,I),b=u$(w,I);return I.refs.set(A,b),I.processing.delete(A),b}if($.enum!==void 0){let A=$.enum;if(I.version==="openapi-3.0"&&$.nullable===!0&&A.length===1&&A[0]===null)return _.null();if(A.length===0)return _.never();if(A.length===1)return _.literal(A[0]);if(A.every((b)=>typeof b==="string"))return _.enum(A);let w=A.map((b)=>_.literal(b));if(w.length<2)return w[0];return _.union([w[0],w[1],...w.slice(2)])}if($.const!==void 0)return _.literal($.const);let U=$.type;if(Array.isArray(U)){let A=U.map((w)=>{let b={...$,type:w};return $F(b,I)});if(A.length===0)return _.never();if(A.length===1)return A[0];return _.union(A)}if(!U)return _.any();let D;switch(U){case"string":{let A=_.string();if($.format){let w=$.format;if(w==="email")A=A.check(_.email());else if(w==="uri"||w==="uri-reference")A=A.check(_.url());else if(w==="uuid"||w==="guid")A=A.check(_.uuid());else if(w==="date-time")A=A.check(_.iso.datetime());else if(w==="date")A=A.check(_.iso.date());else if(w==="time")A=A.check(_.iso.time());else if(w==="duration")A=A.check(_.iso.duration());else if(w==="ipv4")A=A.check(_.ipv4());else if(w==="ipv6")A=A.check(_.ipv6());else if(w==="mac")A=A.check(_.mac());else if(w==="cidr")A=A.check(_.cidrv4());else if(w==="cidr-v6")A=A.check(_.cidrv6());else if(w==="base64")A=A.check(_.base64());else if(w==="base64url")A=A.check(_.base64url());else if(w==="e164")A=A.check(_.e164());else if(w==="jwt")A=A.check(_.jwt());else if(w==="emoji")A=A.check(_.emoji());else if(w==="nanoid")A=A.check(_.nanoid());else if(w==="cuid")A=A.check(_.cuid());else if(w==="cuid2")A=A.check(_.cuid2());else if(w==="ulid")A=A.check(_.ulid());else if(w==="xid")A=A.check(_.xid());else if(w==="ksuid")A=A.check(_.ksuid())}if(typeof $.minLength==="number")A=A.min($.minLength);if(typeof $.maxLength==="number")A=A.max($.maxLength);if($.pattern)A=A.regex(new RegExp($.pattern));D=A;break}case"number":case"integer":{let A=U==="integer"?_.number().int():_.number();if(typeof $.minimum==="number")A=A.min($.minimum);if(typeof $.maximum==="number")A=A.max($.maximum);if(typeof $.exclusiveMinimum==="number")A=A.gt($.exclusiveMinimum);else if($.exclusiveMinimum===!0&&typeof $.minimum==="number")A=A.gt($.minimum);if(typeof $.exclusiveMaximum==="number")A=A.lt($.exclusiveMaximum);else if($.exclusiveMaximum===!0&&typeof $.maximum==="number")A=A.lt($.maximum);if(typeof $.multipleOf==="number")A=A.multipleOf($.multipleOf);D=A;break}case"boolean":{D=_.boolean();break}case"null":{D=_.null();break}case"object":{let A={},w=$.properties||{},b=new Set($.required||[]);for(let[O,X]of Object.entries(w)){let W=u$(X,I);A[O]=b.has(O)?W:W.optional()}if($.propertyNames){let O=u$($.propertyNames,I),X=$.additionalProperties&&typeof $.additionalProperties==="object"?u$($.additionalProperties,I):_.any();if(Object.keys(A).length===0){D=_.record(O,X);break}let W=_.object(A).passthrough(),Q=_.looseRecord(O,X);D=_.intersection(W,Q);break}if($.patternProperties){let O=$.patternProperties,X=Object.keys(O),W=[];for(let B of X){let Y=u$(O[B],I),J=_.string().regex(new RegExp(B));W.push(_.looseRecord(J,Y))}let Q=[];if(Object.keys(A).length>0)Q.push(_.object(A).passthrough());if(Q.push(...W),Q.length===0)D=_.object({}).passthrough();else if(Q.length===1)D=Q[0];else{let B=_.intersection(Q[0],Q[1]);for(let Y=2;Y<Q.length;Y++)B=_.intersection(B,Q[Y]);D=B}break}let N=_.object(A);if($.additionalProperties===!1)D=N.strict();else if(typeof $.additionalProperties==="object")D=N.catchall(u$($.additionalProperties,I));else D=N.passthrough();break}case"array":{let{prefixItems:A,items:w}=$;if(A&&Array.isArray(A)){let b=A.map((O)=>u$(O,I)),N=w&&typeof w==="object"&&!Array.isArray(w)?u$(w,I):void 0;if(N)D=_.tuple(b).rest(N);else D=_.tuple(b);if(typeof $.minItems==="number")D=D.check(_.minLength($.minItems));if(typeof $.maxItems==="number")D=D.check(_.maxLength($.maxItems))}else if(Array.isArray(w)){let b=w.map((O)=>u$(O,I)),N=$.additionalItems&&typeof $.additionalItems==="object"?u$($.additionalItems,I):void 0;if(N)D=_.tuple(b).rest(N);else D=_.tuple(b);if(typeof $.minItems==="number")D=D.check(_.minLength($.minItems));if(typeof $.maxItems==="number")D=D.check(_.maxLength($.maxItems))}else if(w!==void 0){let b=u$(w,I),N=_.array(b);if(typeof $.minItems==="number")N=N.min($.minItems);if(typeof $.maxItems==="number")N=N.max($.maxItems);D=N}else D=_.array(_.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 u$($,I){if(typeof $==="boolean")return $?_.any():_.never();let U=$F($,I),D=$.type||$.enum!==void 0||$.const!==void 0;if($.anyOf&&Array.isArray($.anyOf)){let A=$.anyOf.map((b)=>u$(b,I)),w=_.union(A);U=D?_.intersection(U,w):w}if($.oneOf&&Array.isArray($.oneOf)){let A=$.oneOf.map((b)=>u$(b,I)),w=_.xor(A);U=D?_.intersection(U,w):w}if($.allOf&&Array.isArray($.allOf))if($.allOf.length===0)U=D?U:_.any();else{let A=D?U:u$($.allOf[0],I),w=D?0:1;for(let b=w;b<$.allOf.length;b++)A=_.intersection(A,u$($.allOf[b],I));U=A}if($.nullable===!0&&I.version==="openapi-3.0")U=_.nullable(U);if($.readOnly===!0)U=_.readonly(U);return U}function IF($,I){if(typeof $==="boolean")return $?_.any():_.never();let U=Ku($,I?.defaultTarget),D=$.$defs||$.definitions||{};return u$($,{version:U,defs:D,refs:new Map,processing:new Set,rootSchema:$})}var Q7={};K6(Q7,{string:()=>vu,number:()=>qu,date:()=>Su,boolean:()=>Fu,bigint:()=>Eu});function vu($){return xQ(z1,$)}function qu($){return rQ(K1,$)}function Fu($){return aQ(V1,$)}function Eu($){return sQ(v1,$)}function Su($){return WY(J0,$)}k$(I0());var N4=G.enum(["document","record"]),ub=["paragraph","heading","bulletListItem","numberedListItem","checkListItem","codeBlock","quote","table","divider","referenceList","annotationList","referenceItem","structure","structuredMatrix","procedureTree"],lb=["literature","document","record","annotation","artifact"],cb=["molecule","reaction"],q1=50,mb=50;var Y7=G.object({blockType:G.enum(ub).default("paragraph").describe("Type of block to create. Default: paragraph"),content:G.string().describe("Text content for the block"),headingLevel:G.number().int().min(1).max(3).optional().describe("Heading level (1-3) if blockType is heading"),checked:G.boolean().optional().describe("Checked state for checkListItem"),title:G.string().optional().describe('Title for referenceList container (default: "References")'),refNumber:G.number().int().min(1).optional().describe("Reference number for referenceItem (e.g., 1, 2, 3)"),refId:G.string().optional().describe('Stable ref ID for citation linking (e.g., "lit-a3f7e2b9"). Auto-generated from linkedEntityId if omitted.'),refType:G.enum(lb).optional().describe("Type of reference: literature, document, record, or annotation"),linkedEntityId:G.string().uuid().optional().describe("UUID of the linked entity (literature, document, or record)"),entityTitle:G.string().optional().describe("Cached title of the linked entity"),doi:G.string().optional().describe("DOI for literature references"),smiles:G.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:G.enum(cb).optional().describe('Structure type for molecule blocks: "molecule" (default) or "reaction"'),moleculeName:G.string().optional().describe('Name of the molecule or reaction (e.g., "Ethanol", "Reductive amination")'),moleculeDescription:G.string().optional().describe("Optional description or notes for the molecule block"),matrixId:G.string().optional().describe("UUID of the linked data matrix for structuredMatrix blocks"),nodeRef:G.string().optional().describe("Procedure tree node ID for structuredMatrix blocks"),matrixLabel:G.string().optional().describe("Display label for structuredMatrix blocks"),showPreview:G.boolean().optional().describe("Whether structuredMatrix should show its inline preview"),recordId:G.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 ju=G.enum(["text","number","unit","select","boolean"]),ku=G.enum(["mandatory","recommended","optional"]),UF=G.object({key:G.string().min(1).describe("Stable column key"),label:G.string().min(1).describe("Human-readable column label"),type:ju.describe("Column type"),unit:G.string().optional().describe("Optional display unit"),mandation:ku.describe("Field importance level"),description:G.string().optional().describe("Optional field description"),standardRef:G.string().optional().describe("Optional ontology reference"),options:G.array(G.string()).optional().describe("Allowed values for select columns"),hidden:G.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`).")}),F1=G.record(G.string(),G.union([G.string(),G.number(),G.boolean(),G.null()])),AF=G.enum(["generic","stoichiometry"]),B7=G.object({entityType:N4.describe('Entity type: "document" or "record"'),entityId:G.string().uuid().describe("Document or record ID"),kind:AF.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:G.string().min(1).describe("Matrix label shown in the editor"),columns:G.array(UF).max(q1).optional().describe('Matrix column definitions. Required for `kind="generic"` (the default). Ignored for `kind="stoichiometry"` (preset columns override).'),rows:G.array(F1).optional().describe("Matrix rows"),nodeRef:G.string().optional().describe("Optional procedure tree node ID for record matrices"),afterBlockId:G.string().optional().describe("Insert AFTER this block ID (sibling insertion)"),beforeBlockId:G.string().optional().describe("Insert BEFORE this block ID (sibling insertion)"),parentBlockId:G.string().optional().describe("Insert as CHILD of this container block"),childPosition:G.string().optional().describe('Position within parent children: "first", "last" (default), or child block ID to insert after'),showPreview:G.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"]}),V0={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 J7=G.object({matrixId:G.string().uuid().describe("UUID of the target data_matrix."),rows:G.array(F1).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:G.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.")}),v0={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 H7=G.object({matrixId:G.string().uuid().describe("UUID of the workspace-owned matrix to attach."),entityType:G.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:G.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:G.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:G.number().int().min(0).describe("Current matrix version (optimistic locking). Must equal the server's stored version; otherwise returns a matrix_version_conflict error.")}),q0={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 E1=G.enum(["procedure","characterization","observation","step"]),S1=G.object({type:G.literal("file"),target:G.enum(["local","server","url"]),path:G.string().min(1),format:G.string().min(1),label:G.string().min(1),instrument:G.string().optional(),metadata:G.record(G.string(),G.union([G.string(),G.number(),G.boolean()])).optional()}),DF=G.object({artifactId:G.string().uuid(),role:G.enum(["input","output","derived_from","referenced"]),context:G.record(G.string(),G.unknown()).optional()}),wF=G.object({matrixId:G.string().uuid()}),F0=G.object({tempId:G.string().min(1).describe("Agent-chosen temporary id; remapped to a real uuid on insert. Must be unique within the input list."),parentTempId:G.string().nullable().optional().describe("tempId of the parent node, or null/omit for a root node of the tree."),label:G.string().min(1).describe("Human-readable node label."),type:E1.describe("Node type: procedure (top-level), step (intermediate), characterization (measurement), observation (note)."),order:G.number().int().min(0).optional().describe("Order within siblings. Defaults to append (one past the last existing sibling)."),copyable:G.boolean().optional().describe('Whether this node is template-copyable. MUST be false when type === "observation".'),analyticalData:G.array(S1).optional().describe("File references attached to this node (the typed `analytical_data` JSONB field). Artifact links live in `artifactLinks` below."),artifactLinks:G.array(DF).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:G.array(wF).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:G.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 bF=G.enum(["replace","append"]),L7=G.object({recordId:G.string().uuid().describe("Target record UUID. Must be in draft status."),nodes:G.array(F0).min(1).describe("Flat procedure-tree list. Each node carries a tempId (and optional parentTempId) that the server remaps to real uuids."),mode:bF.describe('"replace" deletes the existing tree first (destructive); "append" grafts the new nodes on top of the current structure.'),confirm:G.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:G.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"]}),E0={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 NF=["sample","dataset","protocol","file","equipment","chemical","model","reaction"],Pu=["molecule","material","mixture","biomacromolecule"],L6$=G.enum(Pu),OF=["active","depleted","archived","draft"],rb=G.enum(NF),j1=G.enum(OF),Ru=G.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.'),z7=G.object({id:G.string().uuid().describe("UUID of the artifact to update."),name:G.string().min(1).optional().describe("Display name (skip to keep existing)."),description:G.string().optional().describe("Plain-text description. Pass an empty string to clear."),tags:G.array(G.string()).optional().describe("Replaces the tag set. Pass an empty array to clear all tags. Omit to leave tags untouched."),properties:G.record(G.string(),G.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:Ru.optional(),artifactType:rb.optional().describe("Change the artifact type. Note: existing `properties` are NOT auto-migrated to the new type's advisory schema."),status:j1.optional().describe("Lifecycle status: active | depleted | archived | draft."),storageRef:G.string().optional().describe("Free-form storage pointer (path, URL, locker code)."),location:G.string().optional().describe("Free-form physical/logical location."),parentId:G.string().uuid().nullable().optional().describe("Parent artifact UUID for hierarchies (e.g. sub-samples). Pass null to detach."),templateId:G.string().uuid().nullable().optional().describe("Template binding. Pass null to detach.")}).refine(($)=>$.name!==void 0||$.description!==void 0||$.tags!==void 0||$.properties!==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, artifactType, status, storageRef, location, parentId, templateId)."}),S0={name:"update_artifact",description:["Update non-identity fields of an artifact (name, description, tags, properties, 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 XF=G.object({cid:G.number().int().positive().optional().describe("PubChem CID. Most specific identifier — bypasses lookup."),cas:G.string().optional().describe('CAS Registry Number (e.g. "71-43-2"). Resolved via PubChem CID lookup.'),inchiKey:G.string().optional().describe('27-character InChIKey (e.g. "UHOVQNZJYSORNB-UHFFFAOYSA-N"). Most reliable for exact-compound lookup.'),name:G.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"}),M7=G.object({name:G.string().min(1).max(500).describe('Display name for the artifact (e.g. "DMSN_66c", "TEOS lot 4").'),artifactType:rb.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:G.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:G.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:G.string().optional().describe("Plain-text description."),tags:G.array(G.string()).optional().describe("Tag names. Resolved to canonical tag IDs server-side (alias-aware)."),properties:G.record(G.string(),G.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:j1.optional().describe('Lifecycle status (default: active). Use "draft" for partially-known artifacts the user still needs to verify.'),storageRef:G.string().optional().describe("Free-form storage pointer (path, URL, locker code)."),location:G.string().optional().describe("Free-form physical/logical location."),parentId:G.string().uuid().optional().describe("Parent artifact UUID for hierarchies (e.g. sub-samples)."),sourceRecordId:G.string().uuid().optional().describe('UUID of the record this artifact was extracted/derived from. Sets provenance for the entity-search "derived from" view.'),templateId:G.string().uuid().optional().describe("Optional template binding."),enrichFromPubchem:XF.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:G.object({nodeId:G.string().uuid(),role:G.enum(["input","output","derived_from","referenced"]),context:G.record(G.string(),G.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.")}),j0={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 K7=G.object({title:G.string().min(1).max(500).describe("Title for the new document"),content:G.string().optional().describe("Optional initial content in markdown format"),organizationId:G.string().uuid().optional().describe("Organization ID (auto-resolved if omitted; ignored when spaceId is provided — derived from the space instead)"),workspaceId:G.string().uuid().optional().describe("Workspace ID (auto-resolved if omitted; ignored when spaceId is provided — derived from the space instead)"),spaceId:G.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:G.array(G.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.")}),k0={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."};var V7=G.object({title:G.string().min(1).max(500).describe("Paper title"),doi:G.string().optional().describe("DOI for metadata resolution and CORE full text fetch"),authors:G.array(G.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:G.string().optional().describe("Journal name"),year:G.number().int().positive().optional().describe("Publication year"),sourceUrl:G.string().url().optional().describe("Publisher page URL where the paper can be found"),organizationId:G.string().uuid().optional().describe("Organization ID (auto-resolved if omitted)"),workspaceId:G.string().uuid().optional().describe("Workspace to assign the paper to"),spaceId:G.string().uuid().optional().describe("Space within workspace"),fetchFullText:G.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:G.array(G.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).")}),P0={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."};var v7=G.object({artifactId:G.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:G.string().uuid().describe("Workspace scope. Must match the source artifact and (if provided) the target entity."),entityType:G.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:G.string().uuid().optional().describe("Owner entity UUID. Required when `entityType` is set."),nodeRef:G.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:G.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:G.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.')}),R0={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 q7=G.object({title:G.string().min(1).max(500).describe("Title for the new record."),organizationId:G.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:G.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:G.string().uuid().optional().describe("Optional space to attach the record to. When omitted the record lives at workspace level only."),recordDate:G.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:G.string().max(120).optional().describe('Freeform record category (e.g. "Experiment", "Characterization", "Protocol").'),collaborators:G.array(G.string().uuid()).optional().describe("User ids participating in this research activity."),tags:G.array(G.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:G.array(F0).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.")}),T0={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."].join(" ")};var ib=G.object({entityType:N4.describe('Entity type: "document" or "record"'),entityId:G.string().uuid().describe("Document or record ID"),blockId:G.string().optional().describe("Block ID to delete (for single delete)"),blockIds:G.array(G.string()).max(mb).optional().describe(`Array of block IDs to delete (batch mode, max ${mb})`)}),Tu=ib.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"}),_0={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 F7=G.object({matrixId:G.string().uuid().describe("UUID of the matrix to delete."),version:G.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:G.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.")}),C0={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 _u=G.record(G.string(),G.union([G.string(),G.number(),G.boolean(),G.null()])).describe("Row match: every provided key/value must equal the row's current value. Matches all rows where the criteria hold."),E7=G.object({matrixId:G.string().uuid().describe("UUID of the target data_matrix."),rowIndices:G.array(G.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:_u.optional(),version:G.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"]}),Z0={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 S7=G.object({nodeId:G.string().uuid().describe("UUID of the procedure node to delete."),acknowledgeCascade:G.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).")}),g0={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 P$($){return` ${$.map((U)=>{if(U===null||U===void 0||U==="")return"";let D=String(U);return D.includes(",")?`"${D}"`:D}).join(",")}`}function nb($){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 QF($,I,U=150){let D=0,A=Math.min($.length,I.length);while(D<A&&$[D]===I[D])D++;let w=0;while(w<A-D&&$.at(1+w)===I.at(1+w))w++;let b=Math.floor(U/2),N=Math.max(0,D-b),O=Math.min($.length,$.length-w+b),X=Math.min(I.length,I.length-w+b),W=N>0?"...":"",Q=O<$.length?"...":"",B=X<I.length?"...":"",Y=`${W}${$.slice(N,O)}${Q}`,J=`${W}${I.slice(N,X)}${B}`;return`--- before
65
- ${Y}
29
+ `)}B.write("payload.value = newResult;"),B.write("return payload;");let g=B.compile();return(x,a)=>g(Y,x,a)},A,w=R4,O=!R1.jitless,X=O&&nO.value,G=I.catchall,Q;$._zod.parse=(Y,B)=>{Q??(Q=D.value);let J=Y.value;if(!w(J))return Y.issues.push({expected:"object",code:"invalid_type",input:J,inst:$}),Y;if(O&&X&&B?.async===!1&&B.jitless!==!0){if(!A)A=b(I.shape);if(Y=A(Y,B),!G)return Y;return GB([],J,Y,B,Q,$)}return U(Y,B)}});function eY($,I,U,D){for(let A of $)if(A.issues.length===0)return I.value=A.value,I;let b=$.filter((A)=>!$4(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,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((A)=>A._zod.pattern);return new RegExp(`^(${b.map((A)=>C1(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 eY(O,b,$,A);return Promise.all(O).then((N)=>{return eY(N,b,$,A)})}});function sY($,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,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,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 sY(O,b,$,A);return Promise.all(O).then((N)=>{return sY(N,b,$,A)})}}),A0=v("$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(!R4(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}}),w0=v("$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 $B(U,N,X)});return $B(U,A,w)}});function cN($,I){if($===I)return{valid:!0,data:$};if($ instanceof Date&&I instanceof Date&&+$===+I)return{valid:!0,data:$};if(s6($)&&s6(I)){let U=Object.keys(I),D=Object.keys($).filter((A)=>U.indexOf(A)!==-1),b={...$,...I};for(let A of D){let w=cN($[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=cN(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 $B($,I,U){if(I.issues.length)$.issues.push(...I.issues);if(U.issues.length)$.issues.push(...U.issues);if($4($))return $;let D=cN(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 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)=>MD(Y,D,X)));else MD(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((B)=>MD(B,D,X)));else MD(Y,D,X)}}if(w.length)return Promise.all(w).then(()=>D);return D}});function MD($,I,U){if($.issues.length)I.issues.push(...p$(U,$.issues));I.value[U]=$.value}var O0=v("$ZodRecord",($,I)=>{n.init($,I),$._zod.parse=(U,D)=>{let b=U.value;if(!s6(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,z$())),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}}),N0=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 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])=>{IB(G,Q,U,w,b,$,D)}));else IB(N,X,U,w,b,$,D)}if(A.length)return Promise.all(A).then(()=>U);return U}});function IB($,I,U,D,b,A,w){if($.issues.length)if(Z1.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,z$()))});if(I.issues.length)if(Z1.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,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 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)=>UB(N,U)));else UB(O,U)}if(A.length)return Promise.all(A).then(()=>U);return U}});function UB($,I){if($.issues.length)I.issues.push(...$.issues);I.value.add($.value)}var W0=v("$ZodEnum",($,I)=>{n.init($,I);let U=_1(I.entries),D=new Set(U);$._zod.values=D,$._zod.pattern=new RegExp(`^(${U.filter((b)=>Z1.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}}),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 A=D.value;if(U.has(A))return D;return D.issues.push({code:"invalid_value",values:I.values,input:A,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 P4($.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 K6;return U.value=b,U}});function bB($,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(`^(${C1(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)=>bB(A,U.value));return bB(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(`^(${C1(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((A)=>DB(A,I));return DB(b,I)}});function DB($,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((A)=>AB(A,$));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 P4("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}}),M0=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((A)=>{if(U.value=A.value,A.issues.length)U.value=I.catchValue({...U,error:{issues:A.issues.map((w)=>u$(w,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((A)=>u$(A,D,z$()))},input:U.value}),U.issues=[];return U}}),V0=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 A=I.out._zod.run(U,D);if(A instanceof Promise)return A.then((w)=>VD(w,I.in,D));return VD(A,I.in,D)}let b=I.in._zod.run(U,D);if(b instanceof Promise)return b.then((A)=>VD(A,I.out,D));return VD(b,I.out,D)}});function VD($,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 A=I.in._zod.run(U,D);if(A instanceof Promise)return A.then((w)=>KD(w,I,D));return KD(A,I,D)}else{let A=I.out._zod.run(U,D);if(A instanceof Promise)return A.then((w)=>KD(w,I,D));return KD(A,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((A)=>FD($,A,I.out,U));return FD($,b,I.out,U)}else{let b=I.reverseTransform($.value,$);if(b instanceof Promise)return b.then((A)=>FD($,A,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(wB);return wB(b)}});function wB($){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 A=b.startsWith("^")?1:0,w=b.endsWith("$")?b.length-1:b.length;U.push(b.slice(A,w))}else if(D===null||cO.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?T4($._def.input,D):D,A=Reflect.apply(U,this,b);if($._def.output)return T4($._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 _4($._def.input,D):D,A=await Reflect.apply(U,this,b);if($._def.output)return await _4($._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 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))}}),S0=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)}}),j0=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((A)=>OB(A,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(AI(b))}}var BI={};C6(BI,{zhTW:()=>hX,zhCN:()=>lX,yo:()=>uX,vi:()=>xX,ur:()=>yX,uk:()=>p1,ua:()=>gX,tr:()=>fX,th:()=>ZX,ta:()=>CX,sv:()=>_X,sl:()=>TX,ru:()=>RX,pt:()=>PX,ps:()=>SX,pl:()=>jX,ota:()=>EX,no:()=>kX,nl:()=>qX,ms:()=>FX,mk:()=>KX,lt:()=>VX,ko:()=>MX,km:()=>m1,kh:()=>zX,ka:()=>LX,ja:()=>HX,it:()=>JX,is:()=>vX,id:()=>BX,hu:()=>YX,he:()=>QX,frCA:()=>GX,fr:()=>WX,fi:()=>XX,fa:()=>NX,es:()=>OX,eo:()=>wX,en:()=>c1,de:()=>AX,da:()=>DX,cs:()=>bX,ca:()=>UX,bg:()=>IX,be:()=>$X,az:()=>sN,ar:()=>eN});var uV=()=>{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`مدخلات غير مقبولة: يفترض إدخال ${q(b.values[0])}`;return`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${z(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?"ة":""}: ${z(b.keys,"، ")}`;case"invalid_key":return`معرف غير مقبول في ${b.origin}`;case"invalid_union":return"مدخل غير مقبول";case"invalid_element":return`مدخل غير مقبول في ${b.origin}`;default:return"مدخل غير مقبول"}}};function eN(){return{localeError:uV()}}var iV=()=>{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 ${q(b.values[0])}`;return`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${z(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":""}: ${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 sN(){return{localeError:iV()}}function QB($,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 nV=()=>{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`Няправільны ўвод: чакалася ${q(b.values[0])}`;return`Няправільны варыянт: чакаўся адзін з ${z(b.values,"|")}`;case"too_big":{let A=b.inclusive?"<=":"<",w=I(b.origin);if(w){let O=Number(b.maximum),N=QB(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=QB(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?"ключы":"ключ"}: ${z(b.keys,", ")}`;case"invalid_key":return`Няправільны ключ у ${b.origin}`;case"invalid_union":return"Няправільны ўвод";case"invalid_element":return`Няправільнае значэнне ў ${b.origin}`;default:return"Няправільны ўвод"}}};function $X(){return{localeError:nV()}}var rV=($)=>{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},cV=()=>{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}, получен ${rV(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?"<=":"<",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?"ове":""}: ${z(D.keys,", ")}`;case"invalid_key":return`Невалиден ключ в ${D.origin}`;case"invalid_union":return"Невалиден вход";case"invalid_element":return`Невалидна стойност в ${D.origin}`;default:return"Невалиден вход"}}};function IX(){return{localeError:cV()}}var mV=()=>{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 ${q(b.values[0])}`;return`Opció invàlida: s'esperava una de ${z(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":""}: ${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 UX(){return{localeError:mV()}}var oV=()=>{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 ${q(b.values[0])}`;return`Neplatná možnost: očekávána jedna z hodnot ${z(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: ${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 bX(){return{localeError:oV()}}var dV=()=>{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 ${q(w.values[0])}`;return`Ugyldigt valg: forventede en af følgende ${z(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"}: ${z(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 DX(){return{localeError:dV()}}var pV=()=>{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 ${q(b.values[0])}`;return`Ungültige Option: erwartet eine von ${z(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"}: ${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:pV()}}var tV=($)=>{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},aV=()=>{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 ${tV(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?"<=":"<",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":""}: ${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 c1(){return{localeError:aV()}}var eV=($)=>{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},sV=()=>{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 ${eV(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?"<=":"<",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":""}: ${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 wX(){return{localeError:sV()}}var $K=()=>{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 ${q(w.values[0])}`;return`Opción inválida: se esperaba una de ${z(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":""}: ${z(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 OX(){return{localeError:$K()}}var IK=()=>{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`ورودی نامعتبر: می‌بایست ${q(b.values[0])} می‌بود`;return`گزینه نامعتبر: می‌بایست یکی از ${z(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?"های":""} ناشناس: ${z(b.keys,", ")}`;case"invalid_key":return`کلید ناشناس در ${b.origin}`;case"invalid_union":return"ورودی نامعتبر";case"invalid_element":return`مقدار نامعتبر در ${b.origin}`;default:return"ورودی نامعتبر"}}};function NX(){return{localeError:IK()}}var UK=()=>{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 ${q(b.values[0])}`;return`Virheellinen valinta: täytyy olla yksi seuraavista: ${z(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"}: ${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 XX(){return{localeError:UK()}}var bK=()=>{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 : ${q(b.values[0])} attendu`;return`Option invalide : une valeur parmi ${z(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":""} : ${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 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 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 ${q(b.values[0])}`;return`Option invalide : attendu l'une des valeurs suivantes ${z(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":""} : ${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 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)}`,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),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=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 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=A(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=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 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=A(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=N[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 QX(){return{localeError:AK()}}var wK=()=>{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 ${q(b.values[0])}`;return`Érvénytelen opció: valamelyik érték várt ${z(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":""}: ${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 YX(){return{localeError:wK()}}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 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 ${q(b.values[0])}`;return`Pilihan tidak valid: diharapkan salah satu dari ${z(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":""}: ${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 BX(){return{localeError:OK()}}var NK=($)=>{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},XK=()=>{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 ${NK(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?"<=":"<",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"}: ${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 vX(){return{localeError:XK()}}var WK=()=>{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 ${q(b.values[0])}`;return`Opzione non valida: atteso uno tra ${z(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"}: ${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 JX(){return{localeError:WK()}}var GK=()=>{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`無効な入力: ${q(b.values[0])}が期待されました`;return`無効な選択: ${z(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?"群":""}: ${z(b.keys,"、")}`;case"invalid_key":return`${b.origin}内の無効なキー`;case"invalid_union":return"無効な入力";case"invalid_element":return`${b.origin}内の無効な値`;default:return"無効な入力"}}};function HX(){return{localeError:GK()}}var QK=($)=>{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},YK=()=>{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}, მიღებული ${QK(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?"<=":"<",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?"ები":"ი"}: ${z(D.keys,", ")}`;case"invalid_key":return`არასწორი გასაღები ${D.origin}-ში`;case"invalid_union":return"არასწორი შეყვანა";case"invalid_element":return`არასწორი მნიშვნელობა ${D.origin}-ში`;default:return"არასწორი შეყვანა"}}};function LX(){return{localeError:YK()}}var BK=()=>{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`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${q(b.values[0])}`;return`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${z(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`រកឃើញសោមិនស្គាល់៖ ${z(b.keys,", ")}`;case"invalid_key":return`សោមិនត្រឹមត្រូវនៅក្នុង ${b.origin}`;case"invalid_union":return"ទិន្នន័យមិនត្រឹមត្រូវ";case"invalid_element":return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${b.origin}`;default:return"ទិន្នន័យមិនត្រឹមត្រូវ"}}};function m1(){return{localeError:BK()}}function zX(){return m1()}var vK=()=>{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`잘못된 입력: 값은 ${q(b.values[0])} 이어야 합니다`;return`잘못된 옵션: ${z(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`인식할 수 없는 키: ${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:vK()}}var JK=($)=>{return d1(typeof $,$)},d1=($,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 $},o1=($)=>{return $.charAt(0).toUpperCase()+$.slice(1)};function YB($){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 HK=()=>{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 ${JK(D.input)}, o tikėtasi - ${d1(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=d1(D.origin),A=I(D.origin,YB(Number(D.maximum)),D.inclusive??!1,"smaller");if(A?.verb)return`${o1(b??D.origin??"reikšmė")} ${A.verb} ${D.maximum.toString()} ${A.unit??"elementų"}`;let w=D.inclusive?"ne didesnis kaip":"mažesnis kaip";return`${o1(b??D.origin??"reikšmė")} turi būti ${w} ${D.maximum.toString()} ${A?.unit}`}case"too_small":{let b=d1(D.origin),A=I(D.origin,YB(Number(D.minimum)),D.inclusive??!1,"bigger");if(A?.verb)return`${o1(b??D.origin??"reikšmė")} ${A.verb} ${D.minimum.toString()} ${A.unit??"elementų"}`;let w=D.inclusive?"ne mažesnis kaip":"didesnis kaip";return`${o1(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"}: ${z(D.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga įvestis";case"invalid_element":{let b=d1(D.origin);return`${o1(b??D.origin??"reikšmė")} turi klaidingą įvestį`}default:return"Klaidinga įvestis"}}};function VX(){return{localeError:HK()}}var LK=()=>{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 ${q(b.values[0])}`;return`Грешана опција: се очекува една ${z(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?"Непрепознаени клучеви":"Непрепознаен клуч"}: ${z(b.keys,", ")}`;case"invalid_key":return`Грешен клуч во ${b.origin}`;case"invalid_union":return"Грешен внес";case"invalid_element":return`Грешна вредност во ${b.origin}`;default:return"Грешен внес"}}};function KX(){return{localeError:LK()}}var zK=()=>{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 ${q(b.values[0])}`;return`Pilihan tidak sah: dijangka salah satu daripada ${z(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: ${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 FX(){return{localeError:zK()}}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 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 ${q(b.values[0])}`;return`Ongeldige optie: verwacht één van ${z(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":""}: ${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 qX(){return{localeError:MK()}}var VK=()=>{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 ${q(b.values[0])}`;return`Ugyldig valg: forventet en av ${z(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"}: ${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 kX(){return{localeError:VK()}}var KK=()=>{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 ${q(b.values[0])}`;return`Fâsit tercih: mûteberler ${z(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":""}: ${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 EX(){return{localeError:KK()}}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 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`ناسم ورودي: باید ${q(b.values[0])} وای`;return`ناسم انتخاب: باید یو له ${z(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?"کلیډونه":"کلیډ"}: ${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:FK()}}var qK=()=>{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 ${q(b.values[0])}`;return`Nieprawidłowa opcja: oczekiwano jednej z wartości ${z(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":""}: ${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 jX(){return{localeError:qK()}}var kK=()=>{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 ${q(b.values[0])}`;return`Opção inválida: esperada uma das ${z(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":""}: ${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 PX(){return{localeError:kK()}}function BB($,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 EK=()=>{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`Неверный ввод: ожидалось ${q(b.values[0])}`;return`Неверный вариант: ожидалось одно из ${z(b.values,"|")}`;case"too_big":{let A=b.inclusive?"<=":"<",w=I(b.origin);if(w){let O=Number(b.maximum),N=BB(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=BB(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?"и":""}: ${z(b.keys,", ")}`;case"invalid_key":return`Неверный ключ в ${b.origin}`;case"invalid_union":return"Неверные входные данные";case"invalid_element":return`Неверное значение в ${b.origin}`;default:return"Неверные входные данные"}}};function RX(){return{localeError:EK()}}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 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 ${q(b.values[0])}`;return`Neveljavna možnost: pričakovano eno izmed ${z(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č"}: ${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 TX(){return{localeError:SK()}}var jK=()=>{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 ${q(b.values[0])}`;return`Ogiltigt val: förväntade en av ${z(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"}: ${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 _X(){return{localeError:jK()}}var PK=()=>{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`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${q(b.values[0])}`;return`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${z(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?"கள்":""}: ${z(b.keys,", ")}`;case"invalid_key":return`${b.origin} இல் தவறான விசை`;case"invalid_union":return"தவறான உள்ளீடு";case"invalid_element":return`${b.origin} இல் தவறான மதிப்பு`;default:return"தவறான உள்ளீடு"}}};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 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`ค่าไม่ถูกต้อง: ควรเป็น ${q(b.values[0])}`;return`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${z(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`พบคีย์ที่ไม่รู้จัก: ${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 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},_K=()=>{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 ${TK(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?"<=":"<",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":""}: ${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 fX(){return{localeError:_K()}}var CK=()=>{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`Неправильні вхідні дані: очікується ${q(b.values[0])}`;return`Неправильна опція: очікується одне з ${z(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?"і":""}: ${z(b.keys,", ")}`;case"invalid_key":return`Неправильний ключ у ${b.origin}`;case"invalid_union":return"Неправильні вхідні дані";case"invalid_element":return`Неправильне значення у ${b.origin}`;default:return"Неправильні вхідні дані"}}};function p1(){return{localeError:CK()}}function gX(){return p1()}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 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`غلط ان پٹ: ${q(b.values[0])} متوقع تھا`;return`غلط آپشن: ${z(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?"ز":""}: ${z(b.keys,"، ")}`;case"invalid_key":return`${b.origin} میں غلط کی`;case"invalid_union":return"غلط ان پٹ";case"invalid_element":return`${b.origin} میں غلط ویلیو`;default:return"غلط ان پٹ"}}};function yX(){return{localeError:ZK()}}var fK=()=>{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 ${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 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: ${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 xX(){return{localeError:fK()}}var gK=()=>{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`无效输入:期望 ${q(b.values[0])}`;return`无效选项:期望以下之一 ${z(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): ${z(b.keys,", ")}`;case"invalid_key":return`${b.origin} 中的键(key)无效`;case"invalid_union":return"无效输入";case"invalid_element":return`${b.origin} 中包含无效值(value)`;default:return"无效输入"}}};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 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`無效的輸入值:預期為 ${q(b.values[0])}`;return`無效的選項:預期為以下其中之一 ${z(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?"們":""}:${z(b.keys,"、")}`;case"invalid_key":return`${b.origin} 中有無效的鍵值`;case"invalid_union":return"無效的輸入值";case"invalid_element":return`${b.origin} 中有無效的值`;default:return"無效的輸入值"}}};function hX(){return{localeError:yK()}}var xK=()=>{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 ${q(b.values[0])}`;return`Àṣàyàn aṣìṣe: yan ọ̀kan lára ${z(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ọ̀: ${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 uX(){return{localeError:xK()}}var vB,iX=Symbol("ZodOutput"),nX=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}(vB=globalThis).__zod_globalRegistry??(vB.__zod_globalRegistry=P0());var f$=globalThis.__zod_globalRegistry;function R0($,I){return new $({type:"string",...E(I)})}function cX($,I){return new $({type:"string",coerce:!0,...E(I)})}function t1($,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 a1($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,...E(I)})}function e1($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...E(I)})}function s1($,I){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...E(I)})}function $U($,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 IU($,I){return new $({type:"string",format:"emoji",check:"string_format",abort:!1,...E(I)})}function UU($,I){return new $({type:"string",format:"nanoid",check:"string_format",abort:!1,...E(I)})}function bU($,I){return new $({type:"string",format:"cuid",check:"string_format",abort:!1,...E(I)})}function DU($,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 wU($,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 NU($,I){return new $({type:"string",format:"ipv4",check:"string_format",abort:!1,...E(I)})}function XU($,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 WU($,I){return new $({type:"string",format:"cidrv4",check:"string_format",abort:!1,...E(I)})}function GU($,I){return new $({type:"string",format:"cidrv6",check:"string_format",abort:!1,...E(I)})}function QU($,I){return new $({type:"string",format:"base64",check:"string_format",abort:!1,...E(I)})}function YU($,I){return new $({type:"string",format:"base64url",check:"string_format",abort:!1,...E(I)})}function BU($,I){return new $({type:"string",format:"e164",check:"string_format",abort:!1,...E(I)})}function vU($,I){return new $({type:"string",format:"jwt",check:"string_format",abort:!1,...E(I)})}var mX={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function oX($,I){return new $({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...E(I)})}function dX($,I){return new $({type:"string",format:"date",check:"string_format",...E(I)})}function pX($,I){return new $({type:"string",format:"time",check:"string_format",precision:null,...E(I)})}function tX($,I){return new $({type:"string",format:"duration",check:"string_format",...E(I)})}function _0($,I){return new $({type:"number",checks:[],...E(I)})}function aX($,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 eX($,I){return new $({type:"boolean",coerce:!0,...E(I)})}function l0($,I){return new $({type:"bigint",...E(I)})}function sX($,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 r0($,I){return new $({type:"null",...E(I)})}function c0($){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 $W($,I){return new $({type:"date",coerce:!0,...E(I)})}function t0($,I){return new $({type:"nan",...E(I)})}function F6($,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 q6($,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 q6(0,$)}function e0($){return F6(0,$)}function s0($){return a$(0,$)}function $A($){return g$(0,$)}function D4($,I){return new EN({check:"multiple_of",...E(I),value:$})}function Z4($,I){return new PN({check:"max_size",...E(I),maximum:$})}function A4($,I){return new RN({check:"min_size",...E(I),minimum:$})}function HI($,I){return new TN({check:"size_equals",...E(I),size:$})}function f4($,I){return new _N({check:"max_length",...E(I),maximum:$})}function l6($,I){return new CN({check:"min_length",...E(I),minimum:$})}function g4($,I){return new ZN({check:"length_equals",...E(I),length:$})}function LI($,I){return new fN({check:"string_format",format:"regex",...E(I),pattern:$})}function zI($){return new gN({check:"string_format",format:"lowercase",...E($)})}function MI($){return new yN({check:"string_format",format:"uppercase",...E($)})}function VI($,I){return new xN({check:"string_format",format:"includes",...E(I),includes:$})}function KI($,I){return new lN({check:"string_format",format:"starts_with",...E(I),prefix:$})}function FI($,I){return new hN({check:"string_format",format:"ends_with",...E(I),suffix:$})}function IA($,I,U){return new uN({check:"property",property:$,schema:I,...E(U)})}function qI($,I){return new iN({check:"mime_type",mime:$,...E(I)})}function w6($){return new nN({check:"overwrite",tx:$})}function kI($){return w6((I)=>I.normalize($))}function EI(){return w6(($)=>$.trim())}function SI(){return w6(($)=>$.toLowerCase())}function jI(){return w6(($)=>$.toUpperCase())}function PI(){return w6(($)=>iO($))}function IW($,I,U){return new $({type:"array",element:I,...E(U)})}function hK($,I,U){return new $({type:"union",options:I,...E(U)})}function uK($,I,U){return new $({type:"union",options:I,inclusive:!1,...E(U)})}function iK($,I,U,D){return new $({type:"union",options:U,discriminator:I,...E(D)})}function nK($,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 cK($,I,U,D){return new $({type:"record",keyType:I,valueType:U,...E(D)})}function mK($,I,U,D){return new $({type:"map",keyType:I,valueType:U,...E(D)})}function oK($,I,U){return new $({type:"set",valueType:I,...E(U)})}function dK($,I,U){let D=Array.isArray(I)?Object.fromEntries(I.map((b)=>[b,b])):I;return new $({type:"enum",entries:D,...E(U)})}function pK($,I,U){return new $({type:"enum",entries:I,...E(U)})}function tK($,I,U){return new $({type:"literal",values:Array.isArray(I)?I:[I],...E(U)})}function UA($,I){return new $({type:"file",...E(I)})}function aK($,I){return new $({type:"transform",transform:I})}function eK($,I){return new $({type:"optional",innerType:I})}function sK($,I){return new $({type:"nullable",innerType:I})}function $F($,I,U){return new $({type:"default",innerType:I,get defaultValue(){return typeof U==="function"?U():rO(U)}})}function IF($,I,U){return new $({type:"nonoptional",innerType:I,...E(U)})}function UF($,I){return new $({type:"success",innerType:I})}function bF($,I,U){return new $({type:"catch",innerType:I,catchValue:typeof U==="function"?U:()=>U})}function DF($,I,U){return new $({type:"pipe",in:I,out:U})}function AF($,I){return new $({type:"readonly",innerType:I})}function wF($,I,U){return new $({type:"template_literal",parts:I,...E(U)})}function OF($,I){return new $({type:"lazy",getter:I})}function NF($,I){return new $({type:"promise",innerType:I})}function bA($,I,U){let D=E(U);return D.abort??(D.abort=!0),new $({type:"custom",check:"custom",fn:I,...D})}function DA($,I,U){return new $({type:"custom",check:"custom",fn:I,...E(U)})}function AA($){let I=JB((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 JB($,I){let U=new X$({check:"custom",...E(I)});return U._zod.check=$,U}function wA($){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 OA($){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 NA($,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 A=new Set(D),w=new Set(b),O=$.Codec??YI,N=$.Boolean??GI,G=new($.String??b4)({type:"string",error:U.error}),Q=new N({type:"boolean",error:U.error}),Y=new O({type:"pipe",in:G,out:Q,transform:(B,J)=>{let L=B;if(U.case!=="sensitive")L=L.toLowerCase();if(A.has(L))return!0;else if(w.has(L))return!1;else return J.issues.push({code:"invalid_value",expected:"stringbool",values:[...A,...w],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 y4($,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 w4($){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 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,B=I.processors[b.type];if(!B)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${b.type}`);B($,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 O4($,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??((B)=>B);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 N4($,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 UW=($,I={})=>(U)=>{let D=w4({...U,processors:I});return O$($,D),O4(D,$),N4(D,$)},RI=($,I)=>(U)=>{let{libraryOptions:D,target:b}=U??{},A=w4({...D??{},target:b,io:I,processors:{}});return O$($,A),O4(A,$),N4(A,$)};var XF={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},bW=($,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}))]}},DW=($,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},AW=($,I,U,D)=>{U.type="boolean"},wW=($,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")},NW=($,I,U,D)=>{if(I.target==="openapi-3.0")U.type="string",U.nullable=!0,U.enum=[null];else U.type="null"},XW=($,I,U,D)=>{if(I.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},WW=($,I,U,D)=>{if(I.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},GW=($,I,U,D)=>{U.not={}},QW=($,I,U,D)=>{},YW=($,I,U,D)=>{},BW=($,I,U,D)=>{if(I.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},vW=($,I,U,D)=>{let b=$._zod.def,A=_1(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},JW=($,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}},HW=($,I,U,D)=>{if(I.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},LW=($,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},zW=($,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)},MW=($,I,U,D)=>{U.type="boolean"},VW=($,I,U,D)=>{if(I.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},KW=($,I,U,D)=>{if(I.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},FW=($,I,U,D)=>{if(I.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},qW=($,I,U,D)=>{if(I.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},kW=($,I,U,D)=>{if(I.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},EW=($,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"]})},SW=($,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"]})},WA=($,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},jW=($,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},PW=($,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,B)=>O$(Y,I,{...D,path:[...D.path,w,B]})),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},RW=($,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"]})},TW=($,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"}]},_W=($,I,U,D)=>{let b=$._zod.def;O$(b.innerType,I,D);let A=I.seen.get($);A.ref=b.innerType},CW=($,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))},ZW=($,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))},fW=($,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},gW=($,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},yW=($,I,U,D)=>{let b=$._zod.def;O$(b.innerType,I,D);let A=I.seen.get($);A.ref=b.innerType,U.readOnly=!0},xW=($,I,U,D)=>{let b=$._zod.def;O$(b.innerType,I,D);let A=I.seen.get($);A.ref=b.innerType},lW=($,I,U,D)=>{let b=$._zod.def;O$(b.innerType,I,D);let A=I.seen.get($);A.ref=b.innerType},hW=($,I,U,D)=>{let b=$._zod.innerType;O$(b,I,D);let A=I.seen.get($);A.ref=b},XA={string:bW,number:DW,boolean:AW,bigint:wW,symbol:OW,null:NW,undefined:XW,void:WW,never:GW,any:QW,unknown:YW,date:BW,enum:vW,literal:JW,nan:HW,template_literal:LW,file:zW,success:MW,custom:VW,function:KW,transform:FW,map:qW,set:kW,array:EW,object:SW,union:WA,intersection:jW,tuple:PW,record:RW,nullable:TW,nonoptional:_W,default:CW,prefault:ZW,catch:fW,pipe:gW,readonly:yW,promise:xW,optional:lW,lazy:hW};function x4($,I){if("_idmap"in $){let D=$,b=w4({...I,processors:XA}),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;O4(b,G),w[X]=N4(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=w4({...I,processors:XA});return O$($,U),O4(U,$),N4(U,$)}class uW{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=w4({processors:XA,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}O4(this.ctx,$);let U=N4(this.ctx,$),{"~standard":D,...b}=U;return b}}var HB={};var QF=v("ZodMiniType",($,I)=>{if(!$._zod)throw new Error("Uninitialized schema in ZodMiniType.");n.init($,I),$.def=I,$.type=I.type,$.parse=(U,D)=>T4($,U,D,{callee:$.parse}),$.safeParse=(U,D)=>I4($,U,D),$.parseAsync=async(U,D)=>_4($,U,D,{callee:$.parseAsync}),$.safeParseAsync=async(U,D)=>U4($,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 YF=v("ZodMiniObject",($,I)=>{b0.init($,I),QF.init($,I),V.defineLazy($,"shape",()=>I.shape)});function iW($,I){let U={type:"object",shape:$??{},...V.normalizeParams(I)};return new YF(U)}function $6($){return!!$._zod}function l4($){let I=Object.values($);if(I.length===0)return iW({});let U=I.every($6),D=I.every((b)=>!$6(b));if(U)return iW($);if(D)return RY($);throw new Error("Mixed Zod versions detected in object shape.")}function X4($,I){if($6($))return I4($,I);return $.safeParse(I)}async function GA($,I){if($6($))return await U4($,I);return await $.safeParseAsync(I)}function W4($){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 l4($)}}if($6($)){let U=$._zod?.def;if(U&&(U.type==="object"||U.shape!==void 0))return $}else if($.shape!==void 0)return $;return}function QA($){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 LB($){return $.description}function zB($){if($6($))return $._zod?.def?.type==="optional";let I=$;if(typeof $.isOptional==="function")return $.isOptional();return I._def?.typeName==="ZodOptional"}function YA($){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={};C6(W,{xor:()=>X7,xid:()=>ZB,void:()=>A7,uuidv7:()=>EB,uuidv6:()=>kB,uuidv4:()=>qB,uuid:()=>FB,util:()=>V,url:()=>SB,uppercase:()=>MI,unknown:()=>G$,union:()=>Q$,undefined:()=>b7,ulid:()=>CB,uint64:()=>I7,uint32:()=>eB,tuple:()=>LG,trim:()=>EI,treeifyError:()=>pO,transform:()=>lA,toUpperCase:()=>jI,toLowerCase:()=>SI,toJSONSchema:()=>x4,templateLiteral:()=>M7,symbol:()=>U7,superRefine:()=>iG,success:()=>H7,stringbool:()=>S7,stringFormat:()=>cB,string:()=>H,strictObject:()=>N7,startsWith:()=>KI,slugify:()=>PI,size:()=>HI,setErrorMap:()=>LF,set:()=>Y7,safeParseAsync:()=>tW,safeParse:()=>pW,safeEncodeAsync:()=>bG,safeEncode:()=>IG,safeDecodeAsync:()=>DG,safeDecode:()=>UG,registry:()=>P0,regexes:()=>t$,regex:()=>LI,refine:()=>uG,record:()=>N$,readonly:()=>fG,property:()=>IA,promise:()=>V7,prettifyError:()=>tO,preprocess:()=>jU,prefault:()=>jG,positive:()=>a0,pipe:()=>zU,partialRecord:()=>W7,parseAsync:()=>dW,parse:()=>oW,overwrite:()=>w6,optional:()=>B$,object:()=>T,number:()=>D$,nullish:()=>J7,nullable:()=>LU,null:()=>VU,normalize:()=>kI,nonpositive:()=>s0,nonoptional:()=>PG,nonnegative:()=>$A,never:()=>xA,negative:()=>e0,nativeEnum:()=>B7,nanoid:()=>RB,nan:()=>L7,multipleOf:()=>D4,minSize:()=>A4,minLength:()=>l6,mime:()=>qI,meta:()=>k7,maxSize:()=>Z4,maxLength:()=>f4,map:()=>Q7,mac:()=>yB,lte:()=>a$,lt:()=>F6,lowercase:()=>zI,looseRecord:()=>G7,looseObject:()=>E$,locales:()=>BI,literal:()=>Z,length:()=>g4,lazy:()=>xG,ksuid:()=>fB,keyof:()=>O7,jwt:()=>rB,json:()=>j7,iso:()=>G4,ipv6:()=>xB,ipv4:()=>gB,intersection:()=>xI,int64:()=>$7,int32:()=>aB,int:()=>zA,instanceof:()=>E7,includes:()=>VI,httpUrl:()=>jB,hostname:()=>mB,hex:()=>oB,hash:()=>dB,guid:()=>KB,gte:()=>g$,gt:()=>q6,globalRegistry:()=>f$,getErrorMap:()=>zF,function:()=>K7,fromJSONSchema:()=>R7,formatError:()=>l1,float64:()=>tB,float32:()=>pB,flattenError:()=>x1,file:()=>v7,enum:()=>S$,endsWith:()=>FI,encodeAsync:()=>sW,encode:()=>aW,emoji:()=>PB,email:()=>VB,e164:()=>nB,discriminatedUnion:()=>kU,describe:()=>q7,decodeAsync:()=>$G,decode:()=>eW,date:()=>w7,custom:()=>nA,cuid2:()=>_B,cuid:()=>TB,core:()=>O6,config:()=>z$,coerce:()=>rG,codec:()=>z7,clone:()=>k$,cidrv6:()=>hB,cidrv4:()=>lB,check:()=>F7,catch:()=>_G,boolean:()=>M$,bigint:()=>sB,base64url:()=>iB,base64:()=>uB,array:()=>p,any:()=>D7,_function:()=>K7,_default:()=>EG,_ZodString:()=>MA,ZodXor:()=>BG,ZodXID:()=>SA,ZodVoid:()=>QG,ZodUnknown:()=>WG,ZodUnion:()=>qU,ZodUndefined:()=>OG,ZodUUID:()=>k6,ZodURL:()=>MU,ZodULID:()=>EA,ZodType:()=>m,ZodTuple:()=>HG,ZodTransform:()=>FG,ZodTemplateLiteral:()=>gG,ZodSymbol:()=>wG,ZodSuccess:()=>RG,ZodStringFormat:()=>W$,ZodString:()=>CI,ZodSet:()=>MG,ZodRecord:()=>EU,ZodRealError:()=>n$,ZodReadonly:()=>ZG,ZodPromise:()=>lG,ZodPrefault:()=>SG,ZodPipe:()=>uA,ZodOptional:()=>lI,ZodObject:()=>FU,ZodNumberFormat:()=>h4,ZodNumber:()=>fI,ZodNullable:()=>qG,ZodNull:()=>NG,ZodNonOptional:()=>hA,ZodNever:()=>GG,ZodNanoID:()=>FA,ZodNaN:()=>CG,ZodMap:()=>zG,ZodMAC:()=>AG,ZodLiteral:()=>VG,ZodLazy:()=>yG,ZodKSUID:()=>jA,ZodJWT:()=>gA,ZodIssueCode:()=>HF,ZodIntersection:()=>JG,ZodISOTime:()=>HA,ZodISODuration:()=>LA,ZodISODateTime:()=>vA,ZodISODate:()=>JA,ZodIPv6:()=>RA,ZodIPv4:()=>PA,ZodGUID:()=>HU,ZodFunction:()=>hG,ZodFirstPartyTypeKind:()=>nG,ZodFile:()=>KG,ZodError:()=>vF,ZodEnum:()=>_I,ZodEmoji:()=>KA,ZodEmail:()=>VA,ZodE164:()=>fA,ZodDiscriminatedUnion:()=>vG,ZodDefault:()=>kG,ZodDate:()=>KU,ZodCustomStringFormat:()=>ZI,ZodCustom:()=>SU,ZodCodec:()=>iA,ZodCatch:()=>TG,ZodCUID2:()=>kA,ZodCUID:()=>qA,ZodCIDRv6:()=>_A,ZodCIDRv4:()=>TA,ZodBoolean:()=>gI,ZodBigIntFormat:()=>yA,ZodBigInt:()=>yI,ZodBase64URL:()=>ZA,ZodBase64:()=>CA,ZodArray:()=>YG,ZodAny:()=>XG,TimePrecision:()=>mX,NEVER:()=>xO,$output:()=>iX,$input:()=>nX,$brand:()=>lO});var JU={};C6(JU,{xor:()=>X7,xid:()=>ZB,void:()=>A7,uuidv7:()=>EB,uuidv6:()=>kB,uuidv4:()=>qB,uuid:()=>FB,url:()=>SB,unknown:()=>G$,union:()=>Q$,undefined:()=>b7,ulid:()=>CB,uint64:()=>I7,uint32:()=>eB,tuple:()=>LG,transform:()=>lA,templateLiteral:()=>M7,symbol:()=>U7,superRefine:()=>iG,success:()=>H7,stringbool:()=>S7,stringFormat:()=>cB,string:()=>H,strictObject:()=>N7,set:()=>Y7,refine:()=>uG,record:()=>N$,readonly:()=>fG,promise:()=>V7,preprocess:()=>jU,prefault:()=>jG,pipe:()=>zU,partialRecord:()=>W7,optional:()=>B$,object:()=>T,number:()=>D$,nullish:()=>J7,nullable:()=>LU,null:()=>VU,nonoptional:()=>PG,never:()=>xA,nativeEnum:()=>B7,nanoid:()=>RB,nan:()=>L7,meta:()=>k7,map:()=>Q7,mac:()=>yB,looseRecord:()=>G7,looseObject:()=>E$,literal:()=>Z,lazy:()=>xG,ksuid:()=>fB,keyof:()=>O7,jwt:()=>rB,json:()=>j7,ipv6:()=>xB,ipv4:()=>gB,intersection:()=>xI,int64:()=>$7,int32:()=>aB,int:()=>zA,instanceof:()=>E7,httpUrl:()=>jB,hostname:()=>mB,hex:()=>oB,hash:()=>dB,guid:()=>KB,function:()=>K7,float64:()=>tB,float32:()=>pB,file:()=>v7,enum:()=>S$,emoji:()=>PB,email:()=>VB,e164:()=>nB,discriminatedUnion:()=>kU,describe:()=>q7,date:()=>w7,custom:()=>nA,cuid2:()=>_B,cuid:()=>TB,codec:()=>z7,cidrv6:()=>hB,cidrv4:()=>lB,check:()=>F7,catch:()=>_G,boolean:()=>M$,bigint:()=>sB,base64url:()=>iB,base64:()=>uB,array:()=>p,any:()=>D7,_function:()=>K7,_default:()=>EG,_ZodString:()=>MA,ZodXor:()=>BG,ZodXID:()=>SA,ZodVoid:()=>QG,ZodUnknown:()=>WG,ZodUnion:()=>qU,ZodUndefined:()=>OG,ZodUUID:()=>k6,ZodURL:()=>MU,ZodULID:()=>EA,ZodType:()=>m,ZodTuple:()=>HG,ZodTransform:()=>FG,ZodTemplateLiteral:()=>gG,ZodSymbol:()=>wG,ZodSuccess:()=>RG,ZodStringFormat:()=>W$,ZodString:()=>CI,ZodSet:()=>MG,ZodRecord:()=>EU,ZodReadonly:()=>ZG,ZodPromise:()=>lG,ZodPrefault:()=>SG,ZodPipe:()=>uA,ZodOptional:()=>lI,ZodObject:()=>FU,ZodNumberFormat:()=>h4,ZodNumber:()=>fI,ZodNullable:()=>qG,ZodNull:()=>NG,ZodNonOptional:()=>hA,ZodNever:()=>GG,ZodNanoID:()=>FA,ZodNaN:()=>CG,ZodMap:()=>zG,ZodMAC:()=>AG,ZodLiteral:()=>VG,ZodLazy:()=>yG,ZodKSUID:()=>jA,ZodJWT:()=>gA,ZodIntersection:()=>JG,ZodIPv6:()=>RA,ZodIPv4:()=>PA,ZodGUID:()=>HU,ZodFunction:()=>hG,ZodFile:()=>KG,ZodEnum:()=>_I,ZodEmoji:()=>KA,ZodEmail:()=>VA,ZodE164:()=>fA,ZodDiscriminatedUnion:()=>vG,ZodDefault:()=>kG,ZodDate:()=>KU,ZodCustomStringFormat:()=>ZI,ZodCustom:()=>SU,ZodCodec:()=>iA,ZodCatch:()=>TG,ZodCUID2:()=>kA,ZodCUID:()=>qA,ZodCIDRv6:()=>_A,ZodCIDRv4:()=>TA,ZodBoolean:()=>gI,ZodBigIntFormat:()=>yA,ZodBigInt:()=>yI,ZodBase64URL:()=>ZA,ZodBase64:()=>CA,ZodArray:()=>YG,ZodAny:()=>XG});var BA={};C6(BA,{uppercase:()=>MI,trim:()=>EI,toUpperCase:()=>jI,toLowerCase:()=>SI,startsWith:()=>KI,slugify:()=>PI,size:()=>HI,regex:()=>LI,property:()=>IA,positive:()=>a0,overwrite:()=>w6,normalize:()=>kI,nonpositive:()=>s0,nonnegative:()=>$A,negative:()=>e0,multipleOf:()=>D4,minSize:()=>A4,minLength:()=>l6,mime:()=>qI,maxSize:()=>Z4,maxLength:()=>f4,lte:()=>a$,lt:()=>F6,lowercase:()=>zI,length:()=>g4,includes:()=>VI,gte:()=>g$,gt:()=>q6,endsWith:()=>FI});var G4={};C6(G4,{time:()=>cW,duration:()=>mW,datetime:()=>nW,date:()=>rW,ZodISOTime:()=>HA,ZodISODuration:()=>LA,ZodISODateTime:()=>vA,ZodISODate:()=>JA});var vA=v("ZodISODateTime",($,I)=>{mN.init($,I),W$.init($,I)});function nW($){return oX(vA,$)}var JA=v("ZodISODate",($,I)=>{oN.init($,I),W$.init($,I)});function rW($){return dX(JA,$)}var HA=v("ZodISOTime",($,I)=>{dN.init($,I),W$.init($,I)});function cW($){return pX(HA,$)}var LA=v("ZodISODuration",($,I)=>{pN.init($,I),W$.init($,I)});function mW($){return tX(LA,$)}var MB=($,I)=>{y1.init($,I),$.name="ZodError",Object.defineProperties($,{format:{value:(U)=>l1($,U)},flatten:{value:(U)=>x1($,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}}})},vF=v("ZodError",MB),n$=v("ZodError",MB,{Parent:Error});var oW=wI(n$),dW=OI(n$),pW=NI(n$),tW=XI(n$),aW=ND(n$),eW=XD(n$),sW=WD(n$),$G=GD(n$),IG=QD(n$),UG=YD(n$),bG=BD(n$),DG=vD(n$);var m=v("ZodType",($,I)=>{return n.init($,I),Object.assign($["~standard"],{jsonSchema:{input:RI($,"input"),output:RI($,"output")}}),$.toJSONSchema=UW($,{}),$.def=I,$.type=I.type,Object.defineProperty($,"_def",{value:I}),$.check=(...U)=>{return $.clone(V.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)=>oW($,U,D,{callee:$.parse}),$.safeParse=(U,D)=>pW($,U,D),$.parseAsync=async(U,D)=>dW($,U,D,{callee:$.parseAsync}),$.safeParseAsync=async(U,D)=>tW($,U,D),$.spa=$.safeParseAsync,$.encode=(U,D)=>aW($,U,D),$.decode=(U,D)=>eW($,U,D),$.encodeAsync=async(U,D)=>sW($,U,D),$.decodeAsync=async(U,D)=>$G($,U,D),$.safeEncode=(U,D)=>IG($,U,D),$.safeDecode=(U,D)=>UG($,U,D),$.safeEncodeAsync=async(U,D)=>bG($,U,D),$.safeDecodeAsync=async(U,D)=>DG($,U,D),$.refine=(U,D)=>$.check(uG(U,D)),$.superRefine=(U)=>$.check(iG(U)),$.overwrite=(U)=>$.check(w6(U)),$.optional=()=>B$($),$.nullable=()=>LU($),$.nullish=()=>B$(LU($)),$.nonoptional=(U)=>PG($,U),$.array=()=>p($),$.or=(U)=>Q$([$,U]),$.and=(U)=>xI($,U),$.transform=(U)=>zU($,lA(U)),$.default=(U)=>EG($,U),$.prefault=(U)=>jG($,U),$.catch=(U)=>_G($,U),$.pipe=(U)=>zU($,U),$.readonly=()=>fG($),$.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,$}),MA=v("_ZodString",($,I)=>{b4.init($,I),m.init($,I),$._zod.processJSONSchema=(D,b,A)=>bW($,D,b,A);let U=$._zod.bag;$.format=U.format??null,$.minLength=U.minimum??null,$.maxLength=U.maximum??null,$.regex=(...D)=>$.check(LI(...D)),$.includes=(...D)=>$.check(VI(...D)),$.startsWith=(...D)=>$.check(KI(...D)),$.endsWith=(...D)=>$.check(FI(...D)),$.min=(...D)=>$.check(l6(...D)),$.max=(...D)=>$.check(f4(...D)),$.length=(...D)=>$.check(g4(...D)),$.nonempty=(...D)=>$.check(l6(1,...D)),$.lowercase=(D)=>$.check(zI(D)),$.uppercase=(D)=>$.check(MI(D)),$.trim=()=>$.check(EI()),$.normalize=(...D)=>$.check(kI(...D)),$.toLowerCase=()=>$.check(SI()),$.toUpperCase=()=>$.check(jI()),$.slugify=()=>$.check(PI())}),CI=v("ZodString",($,I)=>{b4.init($,I),MA.init($,I),$.email=(U)=>$.check(t1(VA,U)),$.url=(U)=>$.check(JI(MU,U)),$.jwt=(U)=>$.check(vU(gA,U)),$.emoji=(U)=>$.check(IU(KA,U)),$.guid=(U)=>$.check(vI(HU,U)),$.uuid=(U)=>$.check(a1(k6,U)),$.uuidv4=(U)=>$.check(e1(k6,U)),$.uuidv6=(U)=>$.check(s1(k6,U)),$.uuidv7=(U)=>$.check($U(k6,U)),$.nanoid=(U)=>$.check(UU(FA,U)),$.guid=(U)=>$.check(vI(HU,U)),$.cuid=(U)=>$.check(bU(qA,U)),$.cuid2=(U)=>$.check(DU(kA,U)),$.ulid=(U)=>$.check(AU(EA,U)),$.base64=(U)=>$.check(QU(CA,U)),$.base64url=(U)=>$.check(YU(ZA,U)),$.xid=(U)=>$.check(wU(SA,U)),$.ksuid=(U)=>$.check(OU(jA,U)),$.ipv4=(U)=>$.check(NU(PA,U)),$.ipv6=(U)=>$.check(XU(RA,U)),$.cidrv4=(U)=>$.check(WU(TA,U)),$.cidrv6=(U)=>$.check(GU(_A,U)),$.e164=(U)=>$.check(BU(fA,U)),$.datetime=(U)=>$.check(nW(U)),$.date=(U)=>$.check(rW(U)),$.time=(U)=>$.check(cW(U)),$.duration=(U)=>$.check(mW(U))});function H($){return R0(CI,$)}var W$=v("ZodStringFormat",($,I)=>{w$.init($,I),MA.init($,I)}),VA=v("ZodEmail",($,I)=>{SD.init($,I),W$.init($,I)});function VB($){return t1(VA,$)}var HU=v("ZodGUID",($,I)=>{kD.init($,I),W$.init($,I)});function KB($){return vI(HU,$)}var k6=v("ZodUUID",($,I)=>{ED.init($,I),W$.init($,I)});function FB($){return a1(k6,$)}function qB($){return e1(k6,$)}function kB($){return s1(k6,$)}function EB($){return $U(k6,$)}var MU=v("ZodURL",($,I)=>{jD.init($,I),W$.init($,I)});function SB($){return JI(MU,$)}function jB($){return JI(MU,{protocol:/^https?$/,hostname:t$.domain,...V.normalizeParams($)})}var KA=v("ZodEmoji",($,I)=>{PD.init($,I),W$.init($,I)});function PB($){return IU(KA,$)}var FA=v("ZodNanoID",($,I)=>{RD.init($,I),W$.init($,I)});function RB($){return UU(FA,$)}var qA=v("ZodCUID",($,I)=>{TD.init($,I),W$.init($,I)});function TB($){return bU(qA,$)}var kA=v("ZodCUID2",($,I)=>{_D.init($,I),W$.init($,I)});function _B($){return DU(kA,$)}var EA=v("ZodULID",($,I)=>{CD.init($,I),W$.init($,I)});function CB($){return AU(EA,$)}var SA=v("ZodXID",($,I)=>{ZD.init($,I),W$.init($,I)});function ZB($){return wU(SA,$)}var jA=v("ZodKSUID",($,I)=>{fD.init($,I),W$.init($,I)});function fB($){return OU(jA,$)}var PA=v("ZodIPv4",($,I)=>{gD.init($,I),W$.init($,I)});function gB($){return NU(PA,$)}var AG=v("ZodMAC",($,I)=>{xD.init($,I),W$.init($,I)});function yB($){return T0(AG,$)}var RA=v("ZodIPv6",($,I)=>{yD.init($,I),W$.init($,I)});function xB($){return XU(RA,$)}var TA=v("ZodCIDRv4",($,I)=>{lD.init($,I),W$.init($,I)});function lB($){return WU(TA,$)}var _A=v("ZodCIDRv6",($,I)=>{hD.init($,I),W$.init($,I)});function hB($){return GU(_A,$)}var CA=v("ZodBase64",($,I)=>{uD.init($,I),W$.init($,I)});function uB($){return QU(CA,$)}var ZA=v("ZodBase64URL",($,I)=>{iD.init($,I),W$.init($,I)});function iB($){return YU(ZA,$)}var fA=v("ZodE164",($,I)=>{nD.init($,I),W$.init($,I)});function nB($){return BU(fA,$)}var gA=v("ZodJWT",($,I)=>{rD.init($,I),W$.init($,I)});function rB($){return vU(gA,$)}var ZI=v("ZodCustomStringFormat",($,I)=>{cD.init($,I),W$.init($,I)});function cB($,I,U={}){return y4(ZI,$,I,U)}function mB($){return y4(ZI,"hostname",t$.hostname,$)}function oB($){return y4(ZI,"hex",t$.hex,$)}function dB($,I){let U=I?.enc??"hex",D=`${$}_${U}`,b=t$[D];if(!b)throw new Error(`Unrecognized hash format: ${D}`);return y4(ZI,D,b,I)}var fI=v("ZodNumber",($,I)=>{i1.init($,I),m.init($,I),$._zod.processJSONSchema=(D,b,A)=>DW($,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(F6(D,b)),$.lte=(D,b)=>$.check(a$(D,b)),$.max=(D,b)=>$.check(a$(D,b)),$.int=(D)=>$.check(zA(D)),$.safe=(D)=>$.check(zA(D)),$.positive=(D)=>$.check(q6(0,D)),$.nonnegative=(D)=>$.check(g$(0,D)),$.negative=(D)=>$.check(F6(0,D)),$.nonpositive=(D)=>$.check(a$(0,D)),$.multipleOf=(D,b)=>$.check(D4(D,b)),$.step=(D,b)=>$.check(D4(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 h4=v("ZodNumberFormat",($,I)=>{mD.init($,I),fI.init($,I)});function zA($){return C0(h4,$)}function pB($){return Z0(h4,$)}function tB($){return f0(h4,$)}function aB($){return g0(h4,$)}function eB($){return y0(h4,$)}var gI=v("ZodBoolean",($,I)=>{GI.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>AW($,U,D,b)});function M$($){return x0(gI,$)}var yI=v("ZodBigInt",($,I)=>{n1.init($,I),m.init($,I),$._zod.processJSONSchema=(D,b,A)=>wW($,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(F6(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(F6(BigInt(0),D)),$.nonpositive=(D)=>$.check(a$(BigInt(0),D)),$.nonnegative=(D)=>$.check(g$(BigInt(0),D)),$.multipleOf=(D,b)=>$.check(D4(D,b));let U=$._zod.bag;$.minValue=U.minimum??null,$.maxValue=U.maximum??null,$.format=U.format??null});function sB($){return l0(yI,$)}var yA=v("ZodBigIntFormat",($,I)=>{oD.init($,I),yI.init($,I)});function $7($){return h0(yA,$)}function I7($){return u0(yA,$)}var wG=v("ZodSymbol",($,I)=>{dD.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>OW($,U,D,b)});function U7($){return i0(wG,$)}var OG=v("ZodUndefined",($,I)=>{pD.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>XW($,U,D,b)});function b7($){return n0(OG,$)}var NG=v("ZodNull",($,I)=>{tD.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>NW($,U,D,b)});function VU($){return r0(NG,$)}var XG=v("ZodAny",($,I)=>{aD.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>QW($,U,D,b)});function D7(){return c0(XG)}var WG=v("ZodUnknown",($,I)=>{eD.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>YW($,U,D,b)});function G$(){return m0(WG)}var GG=v("ZodNever",($,I)=>{sD.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>GW($,U,D,b)});function xA($){return o0(GG,$)}var QG=v("ZodVoid",($,I)=>{$0.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>WW($,U,D,b)});function A7($){return d0(QG,$)}var KU=v("ZodDate",($,I)=>{I0.init($,I),m.init($,I),$._zod.processJSONSchema=(D,b,A)=>BW($,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 w7($){return p0(KU,$)}var YG=v("ZodArray",($,I)=>{U0.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>EW($,U,D,b),$.element=I.element,$.min=(U,D)=>$.check(l6(U,D)),$.nonempty=(U)=>$.check(l6(1,U)),$.max=(U,D)=>$.check(f4(U,D)),$.length=(U,D)=>$.check(g4(U,D)),$.unwrap=()=>$.element});function p($,I){return IW(YG,$,I)}function O7($){let I=$._zod.def.shape;return S$(Object.keys(I))}var FU=v("ZodObject",($,I)=>{aN.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>SW($,U,D,b),V.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:xA()}),$.strip=()=>$.clone({...$._zod.def,catchall:void 0}),$.extend=(U)=>{return V.extend($,U)},$.safeExtend=(U)=>{return V.safeExtend($,U)},$.merge=(U)=>V.merge($,U),$.pick=(U)=>V.pick($,U),$.omit=(U)=>V.omit($,U),$.partial=(...U)=>V.partial(lI,$,U[0]),$.required=(...U)=>V.required(hA,$,U[0])});function T($,I){let U={type:"object",shape:$??{},...V.normalizeParams(I)};return new FU(U)}function N7($,I){return new FU({type:"object",shape:$,catchall:xA(),...V.normalizeParams(I)})}function E$($,I){return new FU({type:"object",shape:$,catchall:G$(),...V.normalizeParams(I)})}var qU=v("ZodUnion",($,I)=>{QI.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>WA($,U,D,b),$.options=I.options});function Q$($,I){return new qU({type:"union",options:$,...V.normalizeParams(I)})}var BG=v("ZodXor",($,I)=>{qU.init($,I),D0.init($,I),$._zod.processJSONSchema=(U,D,b)=>WA($,U,D,b),$.options=I.options});function X7($,I){return new BG({type:"union",options:$,inclusive:!1,...V.normalizeParams(I)})}var vG=v("ZodDiscriminatedUnion",($,I)=>{qU.init($,I),A0.init($,I)});function kU($,I,U){return new vG({type:"union",options:I,discriminator:$,...V.normalizeParams(U)})}var JG=v("ZodIntersection",($,I)=>{w0.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>jW($,U,D,b)});function xI($,I){return new JG({type:"intersection",left:$,right:I})}var HG=v("ZodTuple",($,I)=>{r1.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>PW($,U,D,b),$.rest=(U)=>$.clone({...$._zod.def,rest:U})});function LG($,I,U){let D=I instanceof n,b=D?U:I;return new HG({type:"tuple",items:$,rest:D?I:null,...V.normalizeParams(b)})}var EU=v("ZodRecord",($,I)=>{O0.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>RW($,U,D,b),$.keyType=I.keyType,$.valueType=I.valueType});function N$($,I,U){return new EU({type:"record",keyType:$,valueType:I,...V.normalizeParams(U)})}function W7($,I,U){let D=k$($);return D._zod.values=void 0,new EU({type:"record",keyType:D,valueType:I,...V.normalizeParams(U)})}function G7($,I,U){return new EU({type:"record",keyType:$,valueType:I,mode:"loose",...V.normalizeParams(U)})}var zG=v("ZodMap",($,I)=>{N0.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>qW($,U,D,b),$.keyType=I.keyType,$.valueType=I.valueType});function Q7($,I,U){return new zG({type:"map",keyType:$,valueType:I,...V.normalizeParams(U)})}var MG=v("ZodSet",($,I)=>{X0.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>kW($,U,D,b),$.min=(...U)=>$.check(A4(...U)),$.nonempty=(U)=>$.check(A4(1,U)),$.max=(...U)=>$.check(Z4(...U)),$.size=(...U)=>$.check(HI(...U))});function Y7($,I){return new MG({type:"set",valueType:$,...V.normalizeParams(I)})}var _I=v("ZodEnum",($,I)=>{W0.init($,I),m.init($,I),$._zod.processJSONSchema=(D,b,A)=>vW($,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:[],...V.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:[],...V.normalizeParams(b),entries:A})}});function S$($,I){let U=Array.isArray($)?Object.fromEntries($.map((D)=>[D,D])):$;return new _I({type:"enum",entries:U,...V.normalizeParams(I)})}function B7($,I){return new _I({type:"enum",entries:$,...V.normalizeParams(I)})}var VG=v("ZodLiteral",($,I)=>{G0.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>JW($,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 VG({type:"literal",values:Array.isArray($)?$:[$],...V.normalizeParams(I)})}var KG=v("ZodFile",($,I)=>{Q0.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>zW($,U,D,b),$.min=(U,D)=>$.check(A4(U,D)),$.max=(U,D)=>$.check(Z4(U,D)),$.mime=(U,D)=>$.check(qI(Array.isArray(U)?U:[U],D))});function v7($){return UA(KG,$)}var FG=v("ZodTransform",($,I)=>{Y0.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>FW($,U,D,b),$._zod.parse=(U,D)=>{if(D.direction==="backward")throw new P4($.constructor.name);U.addIssue=(A)=>{if(typeof A==="string")U.issues.push(V.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(V.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 lA($){return new FG({type:"transform",transform:$})}var lI=v("ZodOptional",($,I)=>{B0.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>lW($,U,D,b),$.unwrap=()=>$._zod.def.innerType});function B$($){return new lI({type:"optional",innerType:$})}var qG=v("ZodNullable",($,I)=>{v0.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>TW($,U,D,b),$.unwrap=()=>$._zod.def.innerType});function LU($){return new qG({type:"nullable",innerType:$})}function J7($){return B$(LU($))}var kG=v("ZodDefault",($,I)=>{J0.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>CW($,U,D,b),$.unwrap=()=>$._zod.def.innerType,$.removeDefault=$.unwrap});function EG($,I){return new kG({type:"default",innerType:$,get defaultValue(){return typeof I==="function"?I():V.shallowClone(I)}})}var SG=v("ZodPrefault",($,I)=>{H0.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>ZW($,U,D,b),$.unwrap=()=>$._zod.def.innerType});function jG($,I){return new SG({type:"prefault",innerType:$,get defaultValue(){return typeof I==="function"?I():V.shallowClone(I)}})}var hA=v("ZodNonOptional",($,I)=>{L0.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>_W($,U,D,b),$.unwrap=()=>$._zod.def.innerType});function PG($,I){return new hA({type:"nonoptional",innerType:$,...V.normalizeParams(I)})}var RG=v("ZodSuccess",($,I)=>{z0.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>MW($,U,D,b),$.unwrap=()=>$._zod.def.innerType});function H7($){return new RG({type:"success",innerType:$})}var TG=v("ZodCatch",($,I)=>{M0.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>fW($,U,D,b),$.unwrap=()=>$._zod.def.innerType,$.removeCatch=$.unwrap});function _G($,I){return new TG({type:"catch",innerType:$,catchValue:typeof I==="function"?I:()=>I})}var CG=v("ZodNaN",($,I)=>{V0.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>HW($,U,D,b)});function L7($){return t0(CG,$)}var uA=v("ZodPipe",($,I)=>{K0.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>gW($,U,D,b),$.in=I.in,$.out=I.out});function zU($,I){return new uA({type:"pipe",in:$,out:I})}var iA=v("ZodCodec",($,I)=>{uA.init($,I),YI.init($,I)});function z7($,I,U){return new iA({type:"pipe",in:$,out:I,transform:U.decode,reverseTransform:U.encode})}var ZG=v("ZodReadonly",($,I)=>{F0.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>yW($,U,D,b),$.unwrap=()=>$._zod.def.innerType});function fG($){return new ZG({type:"readonly",innerType:$})}var gG=v("ZodTemplateLiteral",($,I)=>{q0.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>LW($,U,D,b)});function M7($,I){return new gG({type:"template_literal",parts:$,...V.normalizeParams(I)})}var yG=v("ZodLazy",($,I)=>{S0.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>hW($,U,D,b),$.unwrap=()=>$._zod.def.getter()});function xG($){return new yG({type:"lazy",getter:$})}var lG=v("ZodPromise",($,I)=>{E0.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>xW($,U,D,b),$.unwrap=()=>$._zod.def.innerType});function V7($){return new lG({type:"promise",innerType:$})}var hG=v("ZodFunction",($,I)=>{k0.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>KW($,U,D,b)});function K7($){return new hG({type:"function",input:Array.isArray($?.input)?LG($?.input):$?.input??p(G$()),output:$?.output??G$()})}var SU=v("ZodCustom",($,I)=>{j0.init($,I),m.init($,I),$._zod.processJSONSchema=(U,D,b)=>VW($,U,D,b)});function F7($){let I=new X$({check:"custom"});return I._zod.check=$,I}function nA($,I){return bA(SU,$??(()=>!0),I)}function uG($,I={}){return DA(SU,$,I)}function iG($){return AA($)}var q7=wA,k7=OA;function E7($,I={error:`Input not instance of ${$.name}`}){let U=new SU({type:"custom",check:"custom",fn:(D)=>D instanceof $,abort:!0,...V.normalizeParams(I)});return U._zod.bag.Class=$,U}var S7=(...$)=>NA({Codec:iA,Boolean:gI,String:CI},...$);function j7($){let I=xG(()=>{return Q$([H($),D$(),M$(),VU(),p(I),N$(H(),I)])});return I}function jU($,I){return zU(lA($),I)}var HF={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 LF($){z$({customError:$})}function zF(){return z$().customError}var nG;(function($){})(nG||(nG={}));var P={...JU,...BA,iso:G4};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 VF($,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 P7($,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 A=VF(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 P.null();if(b.length===0)return P.never();if(b.length===1)return P.literal(b[0]);if(b.every((w)=>typeof w==="string"))return P.enum(b);let A=b.map((w)=>P.literal(w));if(A.length<2)return A[0];return P.union([A[0],A[1],...A.slice(2)])}if($.const!==void 0)return P.literal($.const);let U=$.type;if(Array.isArray(U)){let b=U.map((A)=>{let w={...$,type:A};return P7(w,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 A=$.format;if(A==="email")b=b.check(P.email());else if(A==="uri"||A==="uri-reference")b=b.check(P.url());else if(A==="uuid"||A==="guid")b=b.check(P.uuid());else if(A==="date-time")b=b.check(P.iso.datetime());else if(A==="date")b=b.check(P.iso.date());else if(A==="time")b=b.check(P.iso.time());else if(A==="duration")b=b.check(P.iso.duration());else if(A==="ipv4")b=b.check(P.ipv4());else if(A==="ipv6")b=b.check(P.ipv6());else if(A==="mac")b=b.check(P.mac());else if(A==="cidr")b=b.check(P.cidrv4());else if(A==="cidr-v6")b=b.check(P.cidrv6());else if(A==="base64")b=b.check(P.base64());else if(A==="base64url")b=b.check(P.base64url());else if(A==="e164")b=b.check(P.e164());else if(A==="jwt")b=b.check(P.jwt());else if(A==="emoji")b=b.check(P.emoji());else if(A==="nanoid")b=b.check(P.nanoid());else if(A==="cuid")b=b.check(P.cuid());else if(A==="cuid2")b=b.check(P.cuid2());else if(A==="ulid")b=b.check(P.ulid());else if(A==="xid")b=b.check(P.xid());else if(A==="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={},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):P.any();if(Object.keys(b).length===0){D=P.record(N,X);break}let G=P.object(b).passthrough(),Q=P.looseRecord(N,X);D=P.intersection(G,Q);break}if($.patternProperties){let N=$.patternProperties,X=Object.keys(N),G=[];for(let Y of X){let B=_$(N[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 O=P.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=P.tuple(w).rest(O);else D=P.tuple(w);if(typeof $.minItems==="number")D=D.check(P.minLength($.minItems));if(typeof $.maxItems==="number")D=D.check(P.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=P.tuple(w).rest(O);else D=P.tuple(w);if(typeof $.minItems==="number")D=D.check(P.minLength($.minItems));if(typeof $.maxItems==="number")D=D.check(P.maxLength($.maxItems))}else if(A!==void 0){let w=_$(A,I),O=P.array(w);if(typeof $.minItems==="number")O=O.min($.minItems);if(typeof $.maxItems==="number")O=O.max($.maxItems);D=O}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=P7($,I),D=$.type||$.enum!==void 0||$.const!==void 0;if($.anyOf&&Array.isArray($.anyOf)){let b=$.anyOf.map((w)=>_$(w,I)),A=P.union(b);U=D?P.intersection(U,A):A}if($.oneOf&&Array.isArray($.oneOf)){let b=$.oneOf.map((w)=>_$(w,I)),A=P.xor(b);U=D?P.intersection(U,A):A}if($.allOf&&Array.isArray($.allOf))if($.allOf.length===0)U=D?U:P.any();else{let b=D?U:_$($.allOf[0],I),A=D?0:1;for(let w=A;w<$.allOf.length;w++)b=P.intersection(b,_$($.allOf[w],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 R7($,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={};C6(rG,{string:()=>KF,number:()=>FF,date:()=>EF,boolean:()=>qF,bigint:()=>kF});function KF($){return cX(CI,$)}function FF($){return aX(fI,$)}function qF($){return eX(gI,$)}function kF($){return sX(yI,$)}function EF($){return $W(KU,$)}z$(c1());var cG="2025-11-25";var T7=[cG,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],Q4="io.modelcontextprotocol/related-task",cA="2.0",F$=nA(($)=>$!==null&&(typeof $==="object"||typeof $==="function")),_7=Q$([H(),D$().int()]),C7=H(),sy=E$({ttl:D$().optional(),pollInterval:D$().optional()}),SF=T({ttl:D$().optional()}),jF=T({taskId:H()}),mG=E$({progressToken:_7.optional(),[Q4]:jF.optional()}),e$=T({_meta:mG.optional()}),PU=e$.extend({task:SF.optional()}),Z7=($)=>PU.safeParse($).success,j$=T({method:H(),params:e$.loose().optional()}),I6=T({_meta:mG.optional()}),U6=T({method:H(),params:I6.loose().optional()}),P$=E$({_meta:mG.optional()}),mA=Q$([H(),D$().int()]),f7=T({jsonrpc:Z(cA),id:mA,...j$.shape}).strict(),oG=($)=>f7.safeParse($).success,g7=T({jsonrpc:Z(cA),...U6.shape}).strict(),y7=($)=>g7.safeParse($).success,dG=T({jsonrpc:Z(cA),id:mA,result:P$}).strict(),RU=($)=>dG.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 pG=T({jsonrpc:Z(cA),id:mA.optional(),error:T({code:D$().int(),message:H(),data:G$().optional()})}).strict();var x7=($)=>pG.safeParse($).success;var l7=Q$([f7,g7,dG,pG]),$x=Q$([dG,pG]),oA=P$.strict(),PF=I6.extend({requestId:mA.optional(),reason:H().optional()}),dA=U6.extend({method:Z("notifications/cancelled"),params:PF}),RF=T({src:H(),mimeType:H().optional(),sizes:p(H()).optional(),theme:S$(["light","dark"]).optional()}),TU=T({icons:p(RF).optional()}),hI=T({name:H(),title:H().optional()}),h7=hI.extend({...hI.shape,...TU.shape,version:H(),websiteUrl:H().optional(),description:H().optional()}),TF=xI(T({applyDefaults:M$().optional()}),N$(H(),G$())),_F=jU(($)=>{if($&&typeof $==="object"&&!Array.isArray($)){if(Object.keys($).length===0)return{form:{}}}return $},xI(T({form:TF.optional(),url:F$.optional()}),N$(H(),G$()).optional())),CF=E$({list:F$.optional(),cancel:F$.optional(),requests:E$({sampling:E$({createMessage:F$.optional()}).optional(),elicitation:E$({create:F$.optional()}).optional()}).optional()}),ZF=E$({list:F$.optional(),cancel:F$.optional(),requests:E$({tools:E$({call:F$.optional()}).optional()}).optional()}),fF=T({experimental:N$(H(),F$).optional(),sampling:T({context:F$.optional(),tools:F$.optional()}).optional(),elicitation:_F.optional(),roots:T({listChanged:M$().optional()}).optional(),tasks:CF.optional(),extensions:N$(H(),F$).optional()}),gF=e$.extend({protocolVersion:H(),capabilities:fF,clientInfo:h7}),tG=j$.extend({method:Z("initialize"),params:gF});var yF=T({experimental:N$(H(),F$).optional(),logging:F$.optional(),completions:F$.optional(),prompts:T({listChanged:M$().optional()}).optional(),resources:T({subscribe:M$().optional(),listChanged:M$().optional()}).optional(),tools:T({listChanged:M$().optional()}).optional(),tasks:ZF.optional(),extensions:N$(H(),F$).optional()}),xF=P$.extend({protocolVersion:H(),capabilities:yF,serverInfo:h7,instructions:H().optional()}),aG=U6.extend({method:Z("notifications/initialized"),params:I6.optional()});var pA=j$.extend({method:Z("ping"),params:e$.optional()}),lF=T({progress:D$(),total:B$(D$()),message:B$(H())}),hF=T({...I6.shape,...lF.shape,progressToken:_7}),tA=U6.extend({method:Z("notifications/progress"),params:hF}),uF=e$.extend({cursor:C7.optional()}),_U=j$.extend({params:uF.optional()}),CU=P$.extend({nextCursor:C7.optional()}),iF=S$(["working","input_required","completed","failed","cancelled"]),ZU=T({taskId:H(),status:iF,ttl:Q$([D$(),VU()]),createdAt:H(),lastUpdatedAt:H(),pollInterval:B$(D$()),statusMessage:B$(H())}),uI=P$.extend({task:ZU}),nF=I6.merge(ZU),fU=U6.extend({method:Z("notifications/tasks/status"),params:nF}),aA=j$.extend({method:Z("tasks/get"),params:e$.extend({taskId:H()})}),eA=P$.merge(ZU),sA=j$.extend({method:Z("tasks/result"),params:e$.extend({taskId:H()})}),Ix=P$.loose(),$w=_U.extend({method:Z("tasks/list")}),Iw=CU.extend({tasks:p(ZU)}),Uw=j$.extend({method:Z("tasks/cancel"),params:e$.extend({taskId:H()})}),u7=P$.merge(ZU),i7=T({uri:H(),mimeType:B$(H()),_meta:N$(H(),G$()).optional()}),n7=i7.extend({text:H()}),eG=H().refine(($)=>{try{return atob($),!0}catch{return!1}},{message:"Invalid Base64 string"}),r7=i7.extend({blob:eG}),gU=S$(["user","assistant"]),iI=T({audience:p(gU).optional(),priority:D$().min(0).max(1).optional(),lastModified:G4.datetime({offset:!0}).optional()}),c7=T({...hI.shape,...TU.shape,uri:H(),description:B$(H()),mimeType:B$(H()),size:B$(D$()),annotations:iI.optional(),_meta:B$(E$({}))}),rF=T({...hI.shape,...TU.shape,uriTemplate:H(),description:B$(H()),mimeType:B$(H()),annotations:iI.optional(),_meta:B$(E$({}))}),bw=_U.extend({method:Z("resources/list")}),cF=CU.extend({resources:p(c7)}),Dw=_U.extend({method:Z("resources/templates/list")}),mF=CU.extend({resourceTemplates:p(rF)}),sG=e$.extend({uri:H()}),oF=sG,Aw=j$.extend({method:Z("resources/read"),params:oF}),dF=P$.extend({contents:p(Q$([n7,r7]))}),pF=U6.extend({method:Z("notifications/resources/list_changed"),params:I6.optional()}),tF=sG,aF=j$.extend({method:Z("resources/subscribe"),params:tF}),eF=sG,sF=j$.extend({method:Z("resources/unsubscribe"),params:eF}),$q=I6.extend({uri:H()}),Iq=U6.extend({method:Z("notifications/resources/updated"),params:$q}),Uq=T({name:H(),description:B$(H()),required:B$(M$())}),bq=T({...hI.shape,...TU.shape,description:B$(H()),arguments:B$(p(Uq)),_meta:B$(E$({}))}),ww=_U.extend({method:Z("prompts/list")}),Dq=CU.extend({prompts:p(bq)}),Aq=e$.extend({name:H(),arguments:N$(H(),H()).optional()}),Ow=j$.extend({method:Z("prompts/get"),params:Aq}),$9=T({type:Z("text"),text:H(),annotations:iI.optional(),_meta:N$(H(),G$()).optional()}),I9=T({type:Z("image"),data:eG,mimeType:H(),annotations:iI.optional(),_meta:N$(H(),G$()).optional()}),U9=T({type:Z("audio"),data:eG,mimeType:H(),annotations:iI.optional(),_meta:N$(H(),G$()).optional()}),wq=T({type:Z("tool_use"),name:H(),id:H(),input:N$(H(),G$()),_meta:N$(H(),G$()).optional()}),Oq=T({type:Z("resource"),resource:Q$([n7,r7]),annotations:iI.optional(),_meta:N$(H(),G$()).optional()}),Nq=c7.extend({type:Z("resource_link")}),b9=Q$([$9,I9,U9,Nq,Oq]),Xq=T({role:gU,content:b9}),Wq=P$.extend({description:H().optional(),messages:p(Xq)}),Gq=U6.extend({method:Z("notifications/prompts/list_changed"),params:I6.optional()}),Qq=T({title:H().optional(),readOnlyHint:M$().optional(),destructiveHint:M$().optional(),idempotentHint:M$().optional(),openWorldHint:M$().optional()}),Yq=T({taskSupport:S$(["required","optional","forbidden"]).optional()}),m7=T({...hI.shape,...TU.shape,description:H().optional(),inputSchema:T({type:Z("object"),properties:N$(H(),F$).optional(),required:p(H()).optional()}).catchall(G$()),outputSchema:T({type:Z("object"),properties:N$(H(),F$).optional(),required:p(H()).optional()}).catchall(G$()).optional(),annotations:Qq.optional(),execution:Yq.optional(),_meta:N$(H(),G$()).optional()}),Nw=_U.extend({method:Z("tools/list")}),Bq=CU.extend({tools:p(m7)}),Xw=P$.extend({content:p(b9).default([]),structuredContent:N$(H(),G$()).optional(),isError:M$().optional()}),Ux=Xw.or(P$.extend({toolResult:G$()})),vq=PU.extend({name:H(),arguments:N$(H(),G$()).optional()}),nI=j$.extend({method:Z("tools/call"),params:vq}),Jq=U6.extend({method:Z("notifications/tools/list_changed"),params:I6.optional()}),bx=T({autoRefresh:M$().default(!0),debounceMs:D$().int().nonnegative().default(300)}),yU=S$(["debug","info","notice","warning","error","critical","alert","emergency"]),Hq=e$.extend({level:yU}),D9=j$.extend({method:Z("logging/setLevel"),params:Hq}),Lq=I6.extend({level:yU,logger:H().optional(),data:G$()}),zq=U6.extend({method:Z("notifications/message"),params:Lq}),Mq=T({name:H().optional()}),Vq=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()}),Kq=T({mode:S$(["auto","required","none"]).optional()}),Fq=T({type:Z("tool_result"),toolUseId:H().describe("The unique identifier for the corresponding tool call."),content:p(b9).default([]),structuredContent:T({}).loose().optional(),isError:M$().optional(),_meta:N$(H(),G$()).optional()}),qq=kU("type",[$9,I9,U9]),rA=kU("type",[$9,I9,U9,wq,Fq]),kq=T({role:gU,content:Q$([rA,p(rA)]),_meta:N$(H(),G$()).optional()}),Eq=PU.extend({messages:p(kq),modelPreferences:Vq.optional(),systemPrompt:H().optional(),includeContext:S$(["none","thisServer","allServers"]).optional(),temperature:D$().optional(),maxTokens:D$().int(),stopSequences:p(H()).optional(),metadata:F$.optional(),tools:p(m7).optional(),toolChoice:Kq.optional()}),Sq=j$.extend({method:Z("sampling/createMessage"),params:Eq}),xU=P$.extend({model:H(),stopReason:B$(S$(["endTurn","stopSequence","maxTokens"]).or(H())),role:gU,content:qq}),A9=P$.extend({model:H(),stopReason:B$(S$(["endTurn","stopSequence","maxTokens","toolUse"]).or(H())),role:gU,content:Q$([rA,p(rA)])}),jq=T({type:Z("boolean"),title:H().optional(),description:H().optional(),default:M$().optional()}),Pq=T({type:Z("string"),title:H().optional(),description:H().optional(),minLength:D$().optional(),maxLength:D$().optional(),format:S$(["email","uri","date","date-time"]).optional(),default:H().optional()}),Rq=T({type:S$(["number","integer"]),title:H().optional(),description:H().optional(),minimum:D$().optional(),maximum:D$().optional(),default:D$().optional()}),Tq=T({type:Z("string"),title:H().optional(),description:H().optional(),enum:p(H()),default:H().optional()}),_q=T({type:Z("string"),title:H().optional(),description:H().optional(),oneOf:p(T({const:H(),title:H()})),default:H().optional()}),Cq=T({type:Z("string"),title:H().optional(),description:H().optional(),enum:p(H()),enumNames:p(H()).optional(),default:H().optional()}),Zq=Q$([Tq,_q]),fq=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()}),gq=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()}),yq=Q$([fq,gq]),xq=Q$([Cq,Zq,yq]),lq=Q$([xq,jq,Pq,Rq]),hq=PU.extend({mode:Z("form").optional(),message:H(),requestedSchema:T({type:Z("object"),properties:N$(H(),lq),required:p(H()).optional()})}),uq=PU.extend({mode:Z("url"),message:H(),elicitationId:H(),url:H().url()}),iq=Q$([hq,uq]),nq=j$.extend({method:Z("elicitation/create"),params:iq}),rq=I6.extend({elicitationId:H()}),cq=U6.extend({method:Z("notifications/elicitation/complete"),params:rq}),rI=P$.extend({action:S$(["accept","decline","cancel"]),content:jU(($)=>$===null?void 0:$,N$(H(),Q$([H(),D$(),M$(),p(H())])).optional())}),mq=T({type:Z("ref/resource"),uri:H()});var oq=T({type:Z("ref/prompt"),name:H()}),dq=e$.extend({ref:Q$([oq,mq]),argument:T({name:H(),value:H()}),context:T({arguments:N$(H(),H()).optional()}).optional()}),Ww=j$.extend({method:Z("completion/complete"),params:dq});function o7($){if($.params.ref.type!=="ref/prompt")throw new TypeError(`Expected CompleteRequestPrompt, but got ${$.params.ref.type}`)}function d7($){if($.params.ref.type!=="ref/resource")throw new TypeError(`Expected CompleteRequestResourceTemplate, but got ${$.params.ref.type}`)}var pq=P$.extend({completion:E$({values:p(H()).max(100),total:B$(D$().int()),hasMore:B$(M$())})}),tq=T({uri:H().startsWith("file://"),name:H().optional(),_meta:N$(H(),G$()).optional()}),aq=j$.extend({method:Z("roots/list"),params:e$.optional()}),w9=P$.extend({roots:p(tq)}),eq=U6.extend({method:Z("notifications/roots/list_changed"),params:I6.optional()}),Dx=Q$([pA,tG,Ww,D9,Ow,ww,bw,Dw,Aw,aF,sF,nI,Nw,aA,sA,$w,Uw]),Ax=Q$([dA,tA,aG,eq,fU]),wx=Q$([oA,xU,A9,rI,w9,eA,Iw,uI]),Ox=Q$([pA,Sq,nq,aq,aA,sA,$w,Uw]),Nx=Q$([dA,tA,zq,Iq,pF,Jq,Gq,fU,cq]),Xx=Q$([oA,xF,pq,Wq,Dq,cF,mF,dF,Xw,Bq,eA,Iw,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 p7(D.elicitations,I)}return new f($,I,U)}}class p7 extends f{constructor($,I=`URL elicitation${$.length>1?"s":""} required`){super(l.UrlElicitationRequired,I,{elicitations:$})}get elicitations(){return this.data?.elicitations??[]}}function Y4($){return $==="completed"||$==="failed"||$==="cancelled"}var a7=Symbol("Let zodToJsonSchema decide on which parser to use");var t7={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"},e7=($)=>typeof $==="string"?{...t7,name:$}:{...t7,...$};var s7=($)=>{let I=e7($),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 Gw=($,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"?Gw(I,$.currentPath):I.join("/")}}function $v($,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 Iv($,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 Uv(){return{type:"boolean"}}function Qw($,I){return i($.type._def,I)}var bv=($,I)=>{return i($.innerType._def,I)};function N9($,I,U){let D=U??I.dateStrategy;if(Array.isArray(D))return{anyOf:D.map((b,A)=>N9($,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 sq($,I)}}var sq=($,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 Dv($,I){return{...i($.innerType._def,I),default:$.defaultValue()}}function Av($,I){return I.effectStrategy==="input"?i($.schema._def,I):H$(I)}function wv($){return{type:"string",enum:Array.from($.values)}}var $k=($)=>{if("type"in $&&$.type==="string")return!1;return"allOf"in $};function Ov($,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($k(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 Nv($,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 X9=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(X9===void 0)X9=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u");return X9},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 Yw($,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(`^${W9(D.value,I)}`),D.message,I);break;case"endsWith":x$(U,RegExp(`${W9(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(W9(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 W9($,I){return I.patternStrategy==="escape"?Uk($):$}var Ik=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function Uk($){let I="";for(let U=0;U<$.length;U++){if(!Ik.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:Xv(I,D),...U&&D.errorMessages&&{errorMessage:{pattern:U}}})}else I$($,"pattern",Xv(I,D),U,D)}function Xv($,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 Bw($,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}=Yw($.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}=Qw($.keyType._def,I);return{...U,propertyNames:b}}return U}function Wv($,I){if(I.mapStrategy==="record")return Bw($,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 Gv($){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 Qv($){return $.target==="openAi"?void 0:{not:H$({...$,currentPath:[...$.currentPath,"not"]})}}function Yv($){return $.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}var lU={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function vv($,I){if(I.target==="openApi3")return Bv($,I);let U=$.options instanceof Map?Array.from($.options.values()):$.options;if(U.every((D)=>(D._def.typeName in lU)&&(!D._def.checks||!D._def.checks.length))){let D=U.reduce((b,A)=>{let w=lU[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 Bv($,I)}var Bv=($,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 Jv($,I){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes($.innerType._def.typeName)&&(!$.innerType._def.checks||!$.innerType._def.checks.length)){if(I.target==="openApi3")return{type:lU[$.innerType._def.typeName],nullable:!0};return{type:[lU[$.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 Hv($,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 Lv($,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=Dk(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=bk($,I);if(w!==void 0)D.additionalProperties=w;return D}function bk($,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 Dk($){try{return $.isOptional()}catch{return!0}}var zv=($,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 Mv=($,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 Vv($,I){return i($.type._def,I)}function Kv($,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 Fv($,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 qv($){return{not:H$($)}}function kv($){return H$($)}var Ev=($,I)=>{return i($.innerType._def,I)};var Sv=($,I,U)=>{switch(I){case F.ZodString:return Yw($,U);case F.ZodNumber:return Hv($,U);case F.ZodObject:return Lv($,U);case F.ZodBigInt:return Iv($,U);case F.ZodBoolean:return Uv();case F.ZodDate:return N9($,U);case F.ZodUndefined:return qv(U);case F.ZodNull:return Yv(U);case F.ZodArray:return $v($,U);case F.ZodUnion:case F.ZodDiscriminatedUnion:return vv($,U);case F.ZodIntersection:return Ov($,U);case F.ZodTuple:return Fv($,U);case F.ZodRecord:return Bw($,U);case F.ZodLiteral:return Nv($,U);case F.ZodEnum:return wv($);case F.ZodNativeEnum:return Gv($);case F.ZodNullable:return Jv($,U);case F.ZodOptional:return zv($,U);case F.ZodMap:return Wv($,U);case F.ZodSet:return Kv($,U);case F.ZodLazy:return()=>$.getter()._def;case F.ZodPromise:return Vv($,U);case F.ZodNaN:case F.ZodNever:return Qv(U);case F.ZodEffects:return Av($,U);case F.ZodAny:return H$(U);case F.ZodUnknown:return kv(U);case F.ZodDefault:return Dv($,U);case F.ZodBranded:return Qw($,U);case F.ZodReadonly:return Ev($,U);case F.ZodCatch:return bv($,U);case F.ZodPipeline:return Mv($,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!==a7)return O}if(D&&!U){let O=Ak(D,I);if(O!==void 0)return O}let b={def:$,path:I.currentPath,jsonSchema:void 0};I.seen.set($,b);let A=Sv($,$.typeName,I),w=typeof A==="function"?i(A(),I):A;if(w)wk($,I,w);if(I.postProcess){let O=I.postProcess(w,$,I);return b.jsonSchema=w,O}return b.jsonSchema=w,w}var Ak=($,I)=>{switch(I.$refStrategy){case"root":return{$ref:$.path.join("/")};case"relative":return{$ref:Gw(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}}},wk=($,I,U)=>{if($.description){if(U.description=$.description,I.markdownDescription)U.markdownDescription=$.description}return U};var G9=($,I)=>{let U=s7(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)??H$(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)??H$(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 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 Q9($,I){if($6($))return x4($,{target:Ok(I?.target),io:I?.pipeStrategy??"input"});return G9($,{strictUnions:I?.strictUnions??!0,pipeStrategy:I?.pipeStrategy??"input"})}function Y9($){let U=W4($)?.method;if(!U)throw new Error("Schema is missing a method literal");let D=YA(U);if(typeof D!=="string")throw new Error("Schema method literal must be a string");return D}function B9($,I){let U=X4($,I);if(!U.success)throw U.error;return U.data}var Nk=60000;class v9{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(dA,(I)=>{this._oncancel(I)}),this.setNotificationHandler(tA,(I)=>{this._onprogress(I)}),this.setRequestHandler(pA,(I)=>({})),this._taskStore=$?.taskStore,this._taskMessageQueue=$?.taskMessageQueue,this._taskStore)this.setRequestHandler(aA,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(sA,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 f(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 f(l.InvalidParams,`Task not found: ${b}`);if(!Y4(A.status))return await this._waitForTaskUpdate(b,U.signal),await D();if(Y4(A.status)){let w=await this._taskStore.getTaskResult(b,U.sessionId);return this._clearTaskQueue(b),{...w,_meta:{...w._meta,[Q4]:{taskId:b}}}}return await D()};return await D()}),this.setRequestHandler($w,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(Uw,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(Y4(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,A)=>{if(D?.(b,A),RU(b)||x7(b))this._onresponse(b);else if(oG(b))this._onrequest(b,A);else if(y7(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?.[Q4]?.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=Z7($.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 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&&O)await O.updateTaskStatus(B,"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),RU($))U($);else{let A=new f($.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(RU($)&&$.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(RU($))D($);else{let A=f.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 f?A:new f(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 f(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},Y4(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 f(l.InternalError,`Task ${b} failed`)};else if(w.status==="cancelled")yield{type:"error",error:new f(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 f?A:new f(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=(k)=>{X(k)};if(!this._transport){G(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{if(this.assertCapabilityForMethod($.method),w)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(w)Y.params={...Y.params,task:w};if(O)Y.params={...Y.params,_meta:{...Y.params?._meta||{},[Q4]:O}};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:A}).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=X4(I,k.result);if(!g.success)X(g.error);else N(g.data)}catch(g){X(g)}}),U?.signal?.addEventListener("abort",()=>{B(U?.signal?.reason)});let J=U?.timeout??Nk,L=()=>B(f.fromError(l.RequestTimeout,"Request timed out",{timeout:J}));this._setupTimeout(Q,J,U?.maxTotalTimeout,L,U?.resetTimeoutOnProgress??!1);let K=O?.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:A}).catch((k)=>{this._cleanupTimeout(Q),X(k)})})}async getTask($,I){return this.request({method:"tasks/get",params:$},eA,I)}async getTaskResult($,I,U){return this.request({method:"tasks/result",params:$},I,U)}async listTasks($,I){return this.request({method:"tasks/list",params:$},Iw,I)}async cancelTask($,I){return this.request({method:"tasks/cancel",params:$},u7,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||{},[Q4]: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||{},[Q4]: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||{},[Q4]:I.relatedTask}}};await this._transport.send(A,I)}setRequestHandler($,I){let U=Y9($);this.assertRequestHandlerCapability(U),this._requestHandlers.set(U,(D,b)=>{let A=B9($,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=Y9($);this._notificationHandlers.set(U,(D)=>{let b=B9($,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"&&oG(D.message)){let b=D.message.id,A=this._requestResolvers.get(b);if(A)A(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 A=setTimeout(D,U);I.addEventListener("abort",()=>{clearTimeout(A),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,A)=>{await U.storeTaskResult(D,b,A,I);let w=await U.getTask(D,I);if(w){let O=fU.parse({method:"notifications/tasks/status",params:w});if(await this.notification(O),Y4(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 f(l.InvalidParams,`Task "${D}" not found - it may have been cleaned up`);if(Y4(w.status))throw new f(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=fU.parse({method:"notifications/tasks/status",params:O});if(await this.notification(N),Y4(O.status))this._cleanupTaskProgressHandler(D)}},listTasks:(D)=>{return U.listTasks(D,I)}}}}function jv($){return $!==null&&typeof $==="object"&&!Array.isArray($)}function Pv($,I){let U={...$};for(let D in I){let b=D,A=I[b];if(A===void 0)continue;let w=U[b];if(jv(w)&&jv(A))U[b]={...w,...A};else U[b]=A}return U}var wz=qY(X8(),1),Oz=qY(Az(),1);function H_(){let $=new wz.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return Oz.default($),$}class z8{constructor($){this._ajv=$??H_()}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],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:$},xU,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 Nz($,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 Xz($,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 V8 extends v9{constructor($,I){super(I);if(this._serverInfo=$,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(yU.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 z8,this.setRequestHandler(tG,(U)=>this._oninitialize(U)),this.setNotificationHandler(aG,()=>this.oninitialized?.()),this._capabilities.logging)this.setRequestHandler(D9,async(U,D)=>{let b=D.sessionId||D.requestInfo?.headers["mcp-session-id"]||void 0,{level:A}=U.params,w=yU.safeParse(A);if(w.success)this._loggingLevels.set(b,w.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=Pv(this._capabilities,$)}setRequestHandler($,I){let D=W4($)?.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=X4(nI,O);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(O,N));if(G.task){let B=X4(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=X4(Xw,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($,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($){Xz(this._clientCapabilities?.tasks?.requests,$,"Client")}assertTaskHandlerCapability($){if(!this._capabilities)return;Nz(this._capabilities.tasks?.requests,$,"Server")}async _oninitialize($){let I=$.params.protocolVersion;return this._clientCapabilities=$.params.capabilities,this._clientVersion=$.params.clientInfo,{protocolVersion:T7.includes(I)?I:cG,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"},oA)}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:$},A9,I);return this.request({method:"sampling/createMessage",params:$},xU,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 f(l.InvalidParams,`Elicitation response content does not match requested schema: ${w.errorMessage}`)}catch(A){if(A instanceof f)throw A;throw new f(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:$},w9,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 Gz=Symbol.for("mcp.completable");function K8($){return!!$&&typeof $==="object"&&Gz in $}function Qz($){return $[Gz]?.complete}var Wz;(function($){$.Completable="McpCompletable"})(Wz||(Wz={}));var L_=/^[A-Za-z0-9._-]{1,128}$/;function z_($){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(!L_.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 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 F8($){let I=z_($);return M_($,I.warnings),I.isValid}class q8{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 E8{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 V8($,I)}get experimental(){if(!this._experimental)this._experimental={tasks:new q8(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(V4(Nw)),this.server.assertCanSetRequestHandler(V4(nI)),this.server.registerCapabilities({tools:{listChanged:!0}}),this.server.setRequestHandler(Nw,()=>({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?Q9(D,{strictUnions:!0,pipeStrategy:"input"}):V_})(),annotations:I.annotations,execution:I.execution,_meta:I._meta};if(I.outputSchema){let D=TI(I.outputSchema);if(D)U.outputSchema=Q9(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,A="createTask"in U.handler;if((b==="required"||b==="optional")&&!A)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&&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 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,A=await GA(b,I);if(!A.success){let w="error"in A?A.error:"Unknown error",O=QA(w);throw new f(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 f(l.InvalidParams,`Output validation error: Tool ${U} has an output schema but no structured content was provided`);let D=TI($.outputSchema),b=await GA(D,I.structuredContent);if(!b.success){let A="error"in b?b.error:"Unknown error",w=QA(A);throw new f(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 f(l.InternalError,`Task ${O} not found during polling`);N=G}return await U.taskStore.getTaskResult(O)}setCompletionRequestHandler(){if(this._completionHandlerInitialized)return;this.server.assertCanSetRequestHandler(V4(Ww)),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler(Ww,async($)=>{switch($.params.ref.type){case"ref/prompt":return o7($),this.handlePromptCompletion($,$.params.ref);case"ref/resource":return d7($),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 Xb;let b=W4(U.argsSchema)?.[$.params.argument.name];if(!K8(b))return Xb;let A=Qz(b);if(!A)return Xb;let w=await A($.params.argument.value,$.params.context);return Bz(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 Xb;throw new f(l.InvalidParams,`Resource template ${$.params.ref.uri} not found`)}let D=U.resourceTemplate.completeCallback($.params.argument.name);if(!D)return Xb;let b=await D($.params.argument.value,$.params.context);return Bz(b)}setResourceRequestHandlers(){if(this._resourceHandlersInitialized)return;this.server.assertCanSetRequestHandler(V4(bw)),this.server.assertCanSetRequestHandler(V4(Dw)),this.server.assertCanSetRequestHandler(V4(Aw)),this.server.registerCapabilities({resources:{listChanged:!0}}),this.server.setRequestHandler(bw,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(Dw,async()=>{return{resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([I,U])=>({name:I,uriTemplate:U.resourceTemplate.uriTemplate.toString(),...U.metadata}))}}),this.server.setRequestHandler(Aw,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 A=b.resourceTemplate.uriTemplate.match(U.toString());if(A)return b.readCallback(U,A,I)}throw new f(l.InvalidParams,`Resource ${U} not found`)}),this._resourceHandlersInitialized=!0}setPromptRequestHandlers(){if(this._promptHandlersInitialized)return;this.server.assertCanSetRequestHandler(V4(ww)),this.server.assertCanSetRequestHandler(V4(Ow)),this.server.registerCapabilities({prompts:{listChanged:!0}}),this.server.setRequestHandler(ww,()=>({prompts:Object.entries(this._registeredPrompts).filter(([,$])=>$.enabled).map(([$,I])=>{return{name:$,title:I.title,description:I.description,arguments:I.argsSchema?K_(I.argsSchema):void 0}})})),this.server.setRequestHandler(Ow,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 GA(D,$.params.arguments);if(!b.success){let O="error"in b?b.error:"Unknown error",N=QA(O);throw new f(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:l4(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=l4(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 K8(N)}))this.setCompletionRequestHandler()}return A}_createRegisteredTool($,I,U,D,b,A,w,O,N){F8($);let X={title:I,description:U,inputSchema:Yz(D),outputSchema:Yz(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")F8(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=l4(G.paramsSchema);if(typeof G.outputSchema!=="undefined")X.outputSchema=l4(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(k8(O)){if(D=I.shift(),I.length>1&&typeof I[0]==="object"&&I[0]!==null&&!k8(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 V_={type:"object",properties:{}};function vz($){return $!==null&&typeof $==="object"&&"parse"in $&&typeof $.parse==="function"&&"safeParse"in $&&typeof $.safeParse==="function"}function Jz($){return"_def"in $||"_zod"in $||vz($)}function k8($){if(typeof $!=="object"||$===null)return!1;if(Jz($))return!1;if(Object.keys($).length===0)return!0;return Object.values($).some(vz)}function Yz($){if(!$)return;if(k8($))return l4($);if(!Jz($))throw new Error("inputSchema must be a Zod schema or raw shape, received an unrecognized object");return $}function K_($){let I=W4($);if(!I)return[];return Object.entries(I).map(([U,D])=>{let b=LB(D),A=zB(D);return{name:U,description:b,required:!A}})}function V4($){let U=W4($)?.method;if(!U)throw new Error("Schema is missing a method literal");let D=YA(U);if(typeof D==="string")return D;throw new Error("Schema method literal must be a string")}function Bz($){return{completion:{values:$.slice(0,100),total:$.length,hasMore:$.length>100}}}var Xb={completion:{values:[],hasMore:!1}};import Lz 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),F_(I)}clear(){this._buffer=void 0}}function F_($){return l7.parse(JSON.parse($))}function Hz($){return JSON.stringify($)+`
37
+ `}class j8{constructor($=Lz.stdin,I=Lz.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=Hz($);if(this._stdout.write(U))I();else this._stdout.once("drain",I)})}}var{create:q_,defineProperty:zz,getOwnPropertyDescriptor:k_,getOwnPropertyNames:Mz,getPrototypeOf:E_}=Object,S_=Object.prototype.hasOwnProperty,J6=($,I)=>function(){return I||$[Mz($)[0]]((I={exports:{}}).exports,I),I.exports},j_=($,I,U,D)=>{if(I&&typeof I==="object"||typeof I==="function"){for(var b=Mz(I),A=0,w=b.length,O;A<w;A++)if(O=b[A],!S_.call($,O)&&O!==U)zz($,O,{get:((N)=>I[N]).bind(null,O),enumerable:!(D=k_(I,O))||D.enumerable})}return $},Y$=($,I,U)=>(U=$!=null?q_(E_($)):{},j_(I||!$||!$.__esModule?zz(U,"default",{value:$,enumerable:!0}):U,$)),Vz=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}}),P_=J6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"($,I){var U=Vz().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}}),R_=J6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"($,I){var U=Vz().default,D=P_();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}}),P6=J6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"($,I){var U=R_();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}}),q$=J6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"($,I){var U=P6();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 R6($){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(T_,I)}};return I}function T_($,I){return I($)}function P8($){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 R8($){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 R6((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 Zn=Symbol();function sw($){let I=$,U=[],D=(w)=>{if(I!==void 0)w.next(I);U.push(w)},b=(w)=>{U.splice(U.indexOf(w),1)},A=R6((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 Kz($){return R6((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 c6($){return!!$&&!Array.isArray($)&&typeof $==="object"}function $O(){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 Fz=[U1.BAD_GATEWAY,U1.SERVICE_UNAVAILABLE,U1.GATEWAY_TIMEOUT,U1.INTERNAL_SERVER_ERROR];var{create:C_,defineProperty:kz,getOwnPropertyDescriptor:Z_,getOwnPropertyNames:Ez,getPrototypeOf:f_}=Object,g_=Object.prototype.hasOwnProperty,Wb=($,I)=>function(){return I||$[Ez($)[0]]((I={exports:{}}).exports,I),I.exports},y_=($,I,U,D)=>{if(I&&typeof I==="object"||typeof I==="function"){for(var b=Ez(I),A=0,w=b.length,O;A<w;A++)if(O=b[A],!g_.call($,O)&&O!==U)kz($,O,{get:((N)=>I[N]).bind(null,O),enumerable:!(D=Z_(I,O))||D.enumerable})}return $},Gb=($,I,U)=>(U=$!=null?C_(f_($)):{},y_(I||!$||!$.__esModule?kz(U,"default",{value:$,enumerable:!0}):U,$)),Sz=()=>{},qz=($)=>{if(Object.freeze)Object.freeze($)};function jz($,I,U){var D;let b=I.join(".");return(D=U[b])!==null&&D!==void 0||(U[b]=new Proxy(Sz,{get(A,w){if(typeof w!=="string"||w==="then")return;return jz($,[...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 qz(X.args),qz(X.path),$(X)}})),U[b]}var IO=($)=>jz($,[],$O()),T8=($)=>{return new Proxy(Sz,{get(I,U){if(U==="then")return;return $(U)}})};var Pz=Wb({"../../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}}),x_=Wb({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"($,I){var U=Pz().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}}),l_=Wb({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"($,I){var U=Pz().default,D=x_();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}}),_8=Wb({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"($,I){var U=l_();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}}),UO=Wb({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"($,I){var U=_8();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}}),tn=Gb(UO(),1);var $r=Gb(_8(),1);var bO=Gb(UO(),1);function i_($,I){if("error"in $){let D=I.deserialize($.error);return{ok:!1,error:bO.default(bO.default({},$),{},{error:D})}}return{ok:!0,result:bO.default(bO.default({},$.result),(!$.result.type||$.result.type==="data")&&{type:"data",data:I.deserialize($.result.data)})}}var C8=class extends Error{constructor(){super("Unable to transform response from server")}};function Z8($,I){let U;try{U=i_($,I)}catch(D){throw new C8}if(!U.ok&&(!c6(U.error.error)||typeof U.error.error.code!=="number"))throw new C8;if(U.ok&&!c6(U.result))throw new C8;return U}var Ir=Gb(UO(),1);var Ur=Symbol();var DO=Y$(P6(),1),b1=Y$(q$(),1);function Rz($){return $ instanceof K4}function m_($){return c6($)&&c6($.error)&&typeof $.error.code==="number"&&typeof $.error.message==="string"}function o_($,I){if(typeof $==="string")return $;if(c6($)&&typeof $.message==="string")return $.message;return I}var K4=class $ extends Error{constructor(I,U){var D,b;let A=U===null||U===void 0?void 0:U.cause;super(I,{cause:A});DO.default(this,"cause",void 0),DO.default(this,"shape",void 0),DO.default(this,"data",void 0),DO.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(Rz(D)){if(U.meta)D.meta=b1.default(b1.default({},D.meta),U.meta);return D}if(m_(D))return new $(D.error.message,b1.default(b1.default({},U),{},{result:D,cause:U.cause}));return new $(o_(D,"Unknown error"),b1.default(b1.default({},U),{},{cause:D}))}};function AO($){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 Tz=($)=>typeof $==="function";function _z($){if($)return $;if(typeof window!=="undefined"&&Tz(window.fetch))return window.fetch;if(typeof globalThis!=="undefined"&&Tz(globalThis.fetch))return globalThis.fetch;throw new Error("No fetch implementation found")}var Qb=Y$(q$(),1);function wO($){return{url:$.url.toString(),fetch:$.fetch,transformer:AO($.transformer),methodOverride:$.methodOverride}}function d_($){let I={};for(let U=0;U<$.length;U++){let D=$[U];I[U]=D}return I}var p_={query:"GET",mutation:"POST",subscription:"PATCH"};function Cz($){return"input"in $?$.transformer.input.serialize($.input):d_($.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 A=Cz($);if(A!==void 0&&$.methodOverride!=="POST")b.push(`input=${encodeURIComponent(JSON.stringify(A))}`)}if(b.length)D+="?"+b.join("&");return D},Zz=($)=>{if($.type==="query"&&$.methodOverride!=="POST")return;let I=Cz($);return I!==void 0?JSON.stringify(I):void 0},f8=($)=>{return OO(Qb.default(Qb.default({},$),{},{contentTypeHeader:"application/json",getUrl:D1,getBody:Zz}))},t_=class extends Error{constructor(){super("AbortError");this.name="AbortError",this.message="AbortError"}},a_=($)=>{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 t_};async function fz($){var I,U;a_($.signal);let D=$.getUrl($),b=$.getBody($),A=(I=$.methodOverride)!==null&&I!==void 0?I:p_[$.type],w=await(async()=>{let N=await $.headers();if(Symbol.iterator in N)return Object.fromEntries(N);return N})(),O=Qb.default(Qb.default(Qb.default({},$.contentTypeHeader&&A!=="GET"?{"content-type":$.contentTypeHeader}:{}),$.trpcAcceptHeader?{[(U=$.trpcAcceptHeaderKey)!==null&&U!==void 0?U:"trpc-accept"]:$.trpcAcceptHeader}:void 0),w);return _z($.fetch)(D,{method:A,signal:$.signal,body:b,headers:O})}async function OO($){let I={},U=await fz($);I.response=U;let D=await U.json();return I.responseJSON=D,{json:D,meta:I}}function gz($){return $ instanceof Uint8Array||$ instanceof Blob}function yz($){return $ instanceof FormData}var A1=Y$(q$(),1),e_=($)=>{if("input"in $){let{input:I}=$;if(yz(I)){if($.type!=="mutation"&&$.methodOverride!=="POST")throw new Error("FormData is only supported for mutations");return OO(A1.default(A1.default({},$),{},{contentTypeHeader:void 0,getUrl:D1,getBody:()=>I}))}if(gz(I)){if($.type!=="mutation"&&$.methodOverride!=="POST")throw new Error("Octet type input is only supported for mutations");return OO(A1.default(A1.default({},$),{},{contentTypeHeader:"application/octet-stream",getUrl:D1,getBody:()=>I}))}}return f8($)};function g8($){let I=wO($);return()=>{return(U)=>{let{op:D}=U;return R6((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=e_(A1.default(A1.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=Z8(G.json,I.transformer.output);if(!Q.ok){b.error(K4.from(Q.error,{meta:X}));return}b.next({context:G.meta,result:Q.result}),b.complete()}).catch((G)=>{b.error(K4.from(G,{meta:X}))}),()=>{}})}}}var sr=Y$(q$(),1);var Uc=Y$(q$(),1);var y8=($,...I)=>{return typeof $==="function"?$(...I):$},Nc=Y$(P6(),1);function s_(){let $,I;return{promise:new Promise((D,b)=>{$=D,I=b}),resolve:$,reject:I}}async function $C($){let I=await y8($.url);if(!$.connectionParams)return I;let D=`${I.includes("?")?"&":"?"}connectionParams=1`;return I+D}async function IC($,I){let U={method:"connectionParams",data:await y8($)};return I.encode(U)}var Xc=Y$(P6(),1);var F4=Y$(P6(),1);function UC($){let{promise:I,resolve:U,reject:D}=s_();return $.addEventListener("open",()=>{$.removeEventListener("error",D),U()}),$.addEventListener("error",D),I}function bC($,{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 DC=class ${constructor(I){var U;if(F4.default(this,"id",++$.connectCount),F4.default(this,"WebSocketPonyfill",void 0),F4.default(this,"urlOptions",void 0),F4.default(this,"keepAliveOpts",void 0),F4.default(this,"encoder",void 0),F4.default(this,"wsObservable",sw(null)),F4.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=$C(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)bC(D,I.keepAliveOpts);if(D.addEventListener("close",()=>{if(I.ws===D)I.ws=null}),await UC(D),I.urlOptions.connectionParams)D.send(await IC(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()}}};F4.default(DC,"connectCount",0);var Wc=Y$(P6(),1),Gc=Y$(q$(),1);var x8=Y$(P6(),1),xz=Y$(q$(),1),AC=class{constructor($){x8.default(this,"links",void 0),x8.default(this,"runtime",void 0),x8.default(this,"requestId",void 0),this.requestId=0,this.runtime={},this.links=$.links.map((I)=>I(this.runtime))}$request($){var I;return Kz({links:this.links,op:xz.default(xz.default({},$),{},{context:(I=$.context)!==null&&I!==void 0?I:{},id:++this.requestId})}).pipe(R8())}async requestAsPromise($){var I=this;try{let U=I.$request($);return(await P8(U)).result.data}catch(U){throw K4.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 wC=Symbol.for("trpc_untypedClient"),OC={query:"query",mutate:"mutation",subscribe:"subscription"},NC=($)=>{return OC[$]};function XC($){let I=IO(({path:U,args:D})=>{let b=[...U],A=NC(b.pop()),w=b.join(".");return $[A](w,...D)});return T8((U)=>{if(U===wC)return $;return I[U]})}function lz($){let I=new AC($);return XC(I)}var hc=Y$(q$(),1);var uc=Y$(q$(),1);var WC=J6({"../../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}}),ic=Y$(WC(),1);var nc=Y$(q$(),1);var GC=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(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 B=N.d.call(N.v);if(N.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}}),hz=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}}),QC=J6({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/awaitAsyncGenerator.js"($,I){var U=hz();function D(b){return new U(b,0)}I.exports=D,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/wrapAsyncGenerator.js"($,I){var U=hz();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),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 N(K,L);L=A[K](L).value}X(Y.done?"return":"normal",L)},function(L){N("throw",L)})}catch(L){X("throw",L)}}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,B){var J={key:G,arg:Q,resolve:Y,reject:B,next:null};O?O=O.next=J:(w=O=J,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}}),rc=Y$(GC(),1),cc=Y$(QC(),1),mc=Y$(YC(),1),oc=Y$(q$(),1);class l8{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 Yb{constructor($){this.generateIdentifier=$,this.kv=new l8}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 h8 extends Yb{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 BC($){if("values"in Object)return Object.values($);let I=[];for(let U in $)if($.hasOwnProperty(U))I.push($[U]);return I}function uz($,I){let U=BC($);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 o4($,I){Object.entries($).forEach(([U,D])=>I(D,U))}function w1($,I){return $.indexOf(I)!==-1}function u8($,I){for(let U=0;U<$.length;U++){let D=$[U];if(I(D))return D}return}class i8{constructor(){this.transfomers={}}register($){this.transfomers[$.name]=$}findApplicable($){return uz(this.transfomers,(I)=>I.isApplicable($))}findByName($){return this.transfomers[$]}}var vC=($)=>Object.prototype.toString.call($).slice(8,-1),n8=($)=>typeof $==="undefined",JC=($)=>$===null,d4=($)=>{if(typeof $!=="object"||$===null)return!1;if($===Object.prototype)return!1;if(Object.getPrototypeOf($)===null)return!0;return Object.getPrototypeOf($)===Object.prototype},NO=($)=>d4($)&&Object.keys($).length===0,H6=($)=>Array.isArray($),HC=($)=>typeof $==="string",LC=($)=>typeof $==="number"&&!isNaN($),zC=($)=>typeof $==="boolean",iz=($)=>$ instanceof RegExp,q4=($)=>$ instanceof Map,k4=($)=>$ instanceof Set,r8=($)=>vC($)==="Symbol",nz=($)=>$ instanceof Date&&!isNaN($.valueOf()),XO=($)=>$ instanceof Error,c8=($)=>typeof $==="number"&&isNaN($),rz=($)=>zC($)||JC($)||n8($)||LC($)||HC($)||r8($),cz=($)=>typeof $==="bigint",mz=($)=>$===1/0||$===-1/0,oz=($)=>ArrayBuffer.isView($)&&!($ instanceof DataView),dz=($)=>$ instanceof URL;var WO=($)=>$.replace(/\\/g,"\\\\").replace(/\./g,"\\."),GO=($)=>$.map(String).map(WO).join("."),O1=($,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 T6($,I,U,D){return{isApplicable:$,annotation:I,transform:U,untransform:D}}var pz=[T6(n8,"undefined",()=>null,()=>{return}),T6(cz,"bigint",($)=>$.toString(),($)=>{if(typeof BigInt!=="undefined")return BigInt($);return console.error("Please add a BigInt polyfill."),$}),T6(nz,"Date",($)=>$.toISOString(),($)=>new Date($)),T6(XO,"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}),T6(iz,"regexp",($)=>""+$,($)=>{let I=$.slice(1,$.lastIndexOf("/")),U=$.slice($.lastIndexOf("/")+1);return new RegExp(I,U)}),T6(k4,"set",($)=>[...$.values()],($)=>new Set($)),T6(q4,"map",($)=>[...$.entries()],($)=>new Map($)),T6(($)=>c8($)||mz($),"number",($)=>{if(c8($))return"NaN";if($>0)return"Infinity";else return"-Infinity"},Number),T6(($)=>$===0&&1/$===-1/0,"number",()=>{return"-0"},Number),T6(dz,"URL",($)=>$.toString(),($)=>new URL($))];function QO($,I,U,D){return{isApplicable:$,annotation:I,transform:U,untransform:D}}var tz=QO(($,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,$},{}),az=QO(oz,($)=>["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 m8($,I){if($?.constructor)return!!I.classRegistry.getIdentifier($.constructor);return!1}var ez=QO(m8,($,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),$)}),sz=QO(($,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($)}),VC=[ez,tz,sz,az],o8=($,I)=>{let U=u8(VC,(b)=>b.isApplicable($,I));if(U)return{value:U.transform($,I),type:U.annotation($,I)};let D=u8(pz,(b)=>b.isApplicable($,I));if(D)return{value:D.transform($,I),type:D.annotation};return},$3={};pz.forEach(($)=>{$3[$.annotation]=$});var I3=($,I,U)=>{if(H6(I))switch(I[0]){case"symbol":return tz.untransform($,I,U);case"class":return ez.untransform($,I,U);case"custom":return sz.untransform($,I,U);case"typed-array":return az.untransform($,I,U);default:throw new Error("Unknown transformation: "+I)}else{let D=$3[I];if(!D)throw new Error("Unknown transformation: "+I);return D.untransform($,U)}};var N1=($,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 U3($){if(w1($,"__proto__"))throw new Error("__proto__ is not allowed as a property");if(w1($,"prototype"))throw new Error("prototype is not allowed as a property");if(w1($,"constructor"))throw new Error("constructor is not allowed as a property")}var b3=($,I)=>{U3(I);for(let U=0;U<I.length;U++){let D=I[U];if(k4($))$=N1($,+D);else if(q4($)){let b=+D,A=+I[++U]===0?"key":"value",w=N1($,b);switch(A){case"key":$=w;break;case"value":$=$.get(w);break}}else $=$[D]}return $},YO=($,I,U)=>{if(U3(I),I.length===0)return U($);let D=$;for(let A=0;A<I.length-1;A++){let w=I[A];if(H6(D)){let O=+w;D=D[O]}else if(d4(D))D=D[w];else if(k4(D)){let O=+w;D=N1(D,O)}else if(q4(D)){if(A===I.length-2)break;let N=+w,X=+I[++A]===0?"key":"value",G=N1(D,N);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(d4(D))D[b]=U(D[b]);if(k4(D)){let A=N1(D,+b),w=U(A);if(A!==w)D.delete(A),D.add(w)}if(q4(D)){let A=+I[I.length-2],w=N1(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 D3=($)=>$<1;function d8($,I,U,D=[]){if(!$)return;let b=D3(U);if(!H6($)){o4($,(O,N)=>d8(O,I,U,[...D,...O1(N,b)]));return}let[A,w]=$;if(w)o4(w,(O,N)=>{d8(O,I,U,[...D,...O1(N,b)])});I(A,D)}function A3($,I,U,D){return d8(I,(b,A)=>{$=YO($,A,(w)=>I3(w,b,D))},U),$}function w3($,I,U){let D=D3(U);function b(A,w){let O=b3($,O1(w,D));A.map((N)=>O1(N,D)).forEach((N)=>{$=YO($,N,()=>O)})}if(H6(I)){let[A,w]=I;if(A.forEach((O)=>{$=YO($,O1(O,D),()=>$)}),w)o4(w,b)}else o4(I,b);return $}var KC=($,I)=>d4($)||H6($)||q4($)||k4($)||XO($)||m8($,I);function FC($,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((O)=>O.map(String)).sort((O,N)=>O.length-N.length);let[A,...w]=b;if(A.length===0)D=w.map(GO);else U[GO(A)]=w.map(GO)}),D)if(NO(U))return[D];else return[D,U];else return NO(U)?void 0:U}var p8=($,I,U,D,b=[],A=[],w=new Map)=>{let O=rz($);if(!O){FC($,b,I);let B=w.get($);if(B)return D?{transformedValue:null}:B}if(!KC($,U)){let B=o8($,U),J=B?{transformedValue:B.value,annotations:[B.type]}:{transformedValue:$};if(!O)w.set($,J);return J}if(w1(A,$))return{transformedValue:null};let N=o8($,U),X=N?.value??$,G=H6(X)?[]:{},Q={};o4(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=p8(B,I,U,D,[...b,J],[...A,$],w);if(G[J]=L.transformedValue,H6(L.annotations))Q[WO(J)]=L.annotations;else if(d4(L.annotations))o4(L.annotations,(K,k)=>{Q[WO(J)+"."+k]=K})});let Y=NO(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 BO($){return Object.prototype.toString.call($).slice(8,-1)}function vO($){return BO($)==="Array"}function t8($){if(BO($)!=="Object")return!1;let I=Object.getPrototypeOf($);return!!I&&I.constructor===Object&&I===Object.prototype}function qC($,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 JO($,I={}){if(vO($))return $.map((b)=>JO(b,I));if(!t8($))return $;let U=Object.getOwnPropertyNames($),D=Object.getOwnPropertySymbols($);return[...U,...D].reduce((b,A)=>{if(A==="__proto__")return b;if(vO(I.props)&&!I.props.includes(A))return b;let w=$[A],O=JO(w,I);return qC(b,A,O,$,I.nonenumerable),b},{})}class $${constructor({dedupe:$=!1}={}){this.classRegistry=new h8,this.symbolRegistry=new Yb((I)=>I.description??""),this.customTransformerRegistry=new i8,this.allowedErrorProps=[],this.dedupe=$}serialize($){let I=new Map,U=p8($,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:JO(U);if(D?.values)b=A3(b,D.values,D.v??0,this);if(D?.referentialEqualities)b=w3(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 N3=$$;var{serialize:Zm,deserialize:fm,stringify:gm,parse:ym,registerClass:xm,registerCustom:lm,registerSymbol:hm,allowErrorProps:um}=$$;class a8{trpc;constructor($){this.trpc=lz({links:[g8({url:`${$.apiUrl}/trpc`,transformer:N3,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 e8($="SURA MCP"){return{info:(I,...U)=>{},error:(I,...U)=>{},warn:(I,...U)=>{},debug:(I,...U)=>{if(process.env.DEBUG);}}}var m6=e8();async function X3($){let I=e8();I.info("Initializing server context...");let U=new a8({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 o6=W.enum(["document","record"]),HO=["paragraph","heading","bulletListItem","numberedListItem","checkListItem","codeBlock","quote","table","divider","referenceList","annotationList","referenceItem","structure","structuredMatrix","procedureTree"],LO=["literature","document","record","annotation","artifact"],zO=["molecule","reaction"],X1=50,MO=50;var s8=W.object({blockType:W.enum(HO).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(LO).optional().describe("Type of reference: literature, document, record, or annotation"),linkedEntityId:W.string().uuid().optional().describe("UUID of the linked entity (literature, document, or record)"),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(zO).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 kC=W.enum(["text","number","unit","select","boolean"]),EC=W.enum(["mandatory","recommended","optional"]),W3=W.object({key:W.string().min(1).describe("Stable column key"),label:W.string().min(1).describe("Human-readable column label"),type:kC.describe("Column type"),unit:W.string().optional().describe("Optional display unit"),mandation:EC.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()])),G3=W.enum(["generic","stoichiometry"]),$Q=W.object({entityType:o6.describe('Entity type: "document" or "record"'),entityId:W.string().uuid().describe("Document or record ID"),kind:G3.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(W3).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"]}),Bb={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 IQ=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.")}),vb={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 UQ=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.")}),Jb={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()}),Q3=W.object({artifactId:W.string().uuid(),role:W.enum(["input","output","derived_from","referenced"]),context:W.record(W.string(),W.unknown()).optional()}),Y3=W.object({matrixId:W.string().uuid()}),Hb=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(Q3).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(Y3).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 B3=W.enum(["replace","append"]),bQ=W.object({recordId:W.string().uuid().describe("Target record UUID. Must be in draft status."),nodes:W.array(Hb).min(1).describe("Flat procedure-tree list. Each node carries a tempId (and optional parentTempId) that the server remaps to real uuids."),mode:B3.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"]}),Lb={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 v3=["sample","dataset","protocol","file","equipment","chemical","model","reaction"],SC=["molecule","material","mixture","biomacromolecule"],jC=W.enum(SC),J3=["active","depleted","archived","draft"],VO=W.enum(v3),Y1=W.enum(J3),PC=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.'),DQ=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:PC.optional(),structureClass:jC.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:VO.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)."}),zb={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"}),AQ=W.object({name:W.string().min(1).max(500).describe('Display name for the artifact (e.g. "DMSN_66c", "TEOS lot 4").'),artifactType:VO.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: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.")}),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 wQ=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.")}),Vb={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).")}),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 NQ=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.')}),Fb={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 XQ=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(Hb).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.")}),qb={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 KO=W.object({entityType:o6.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(MO).optional().describe(`Array of block IDs to delete (batch mode, max ${MO})`)}),RC=KO.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"}),kb={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 WQ=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.")}),Eb={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 TC=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."),GQ=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:TC.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 QQ=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).")}),jb={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 FO($){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 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?"...":"",B=`${G}${$.slice(O,N)}${Q}`,J=`${G}${I.slice(O,X)}${Y}`;return`--- before
38
+ ${B}
66
39
  +++ after
67
- ${J}`}function k7($){let I=[];I.push(`[workspace context | default org:${$.defaults.orgId}${$.defaults.workspaceId?` ws:${$.defaults.workspaceId}`:""}]`);let U=0,D=[];for(let A of $.orgs)for(let w of A.workspaces)if(w.spaces.length===0)D.push(P$([A.name,A.id,w.name,w.id,w.type,"","",""])),U++;else for(let b of w.spaces)D.push(P$([A.name,A.id,w.name,w.id,w.type,b.name,b.id,b.type])),U++;return I.push(`{org,orgId,workspace,wsId,wsType,space,spaceId,spaceType}[${U}]:`),I.push(...D),I.join(`
68
- `)}function P7($){let{mode:I,found:U,hasMore:D}=$;if(U===0)return`[results:0 found, ${I}]
69
- No results.`;let A=[I,...D?["hasMore"]:[]].join(", "),w=[`[results:${U} found, ${A}]`];if(I==="library"){let b=$.results,N=b.some((B)=>B.literatureMetadata),O=b.some((B)=>B.creatorName),X=b.some((B)=>B.updatedAt),W=N?"{type,title,id,relevance,tags,doi,firstAuthor,year,journal":"{type,title,id,relevance,tags",Q=O?`${W},creator`:W;if(X)Q+=",updatedAt";Q+=",snippet}",w.push(`${Q}[${b.length}]:`);for(let B of b){let Y=B.bestSnippet??B.snippet??"",J=Y.length>120?`${Y.slice(0,117)}...`:Y,H=B.tags?.join(" | ")??"",v=B.creatorName??"",V=B.updatedAt??"";if(N){let F=B.literatureMetadata,k=[B.entityType,B.entityTitle,B.entityId,B.relevance,H,F?.doi??"",F?.firstAuthor??"",F?.year??"",F?.journal??""];if(O)k.push(v);if(X)k.push(V);k.push(J),w.push(P$(k))}else{let F=[B.entityType,B.entityTitle,B.entityId,B.relevance,H];if(O)F.push(v);if(X)F.push(V);F.push(J),w.push(P$(F))}}}else{let b=$.results,N=b.some((X)=>X.creatorName),O=N?"{type,title,entityId,blockId,creator,snippet}":"{type,title,entityId,blockId,snippet}";w.push(`${O}[${b.length}]:`);for(let X of b){let W=X.bestSnippet??X.snippet??"",Q=W.length>120?`${W.slice(0,117)}...`:W,B=[X.entityType,X.entityTitle,X.entityId,X.blockId];if(N)B.push(X.creatorName??"");B.push(Q),w.push(P$(B))}}return w.join(`
70
- `)}function YF($){if($.length===0)return"";let I=[`[toc:${$.length} sections]`,`{title,level,tokens,ownTokens,blockId}[${$.length}]:`];for(let U of $)I.push(P$([U.title,U.level,U.estimatedTokens??0,U.ownTokens??0,U.blockId]));return I.join(`
71
- `)}function Cu($){if($.length===0)return"";let I=[`[regions:${$.length}]`,`{title,kind,tokens,blocks,retrievalHint}[${$.length}]:`];for(let U of $)I.push(P$([U.title,U.kind,U.estimatedTokens??0,U.blockCount,U.retrievalHint]));return I.join(`
72
- `)}function QI($,I){return`${{literature:"lit",document:"doc",record:"rec",artifact:"art"}[$]??$.slice(0,3)}-${I.slice(0,8)}`}function Zu($){let I=[],U=$.direction==="forward"?"→":"←",D=$.direction==="forward"?"↗":"↙";if($.type==="annotation")D="\uD83D\uDCDD";else if($.type==="citation")D="\uD83D\uDCD6";let A=$.dstEntityType??$.dstScope,w=$.dstTitle||$.dstId.slice(0,8),b=QI(A,$.dstId),N=[$.type,$.direction,`via ${$.provenance}`];if(typeof $.weight==="number"&&$.weight>1)N.push(`shared by ${$.weight} records`);if(I.push(` ${D} ${U} ${A}: ${w} (${b}, ${N.join(" · ")})`),$.text)I.push(` "${$.text}"`);if($.snippet)I.push(` — ${$.snippet}`);return I}function gu($,I){let U=I.reduce((D,A)=>Math.max(D,A.hop),0);for(let D=1;D<=U;D++){let A=I.filter((w)=>w.hop===D);if(A.length===0)continue;$.push(""),$.push(`*Hop ${D}* (${A.length} edges):`);for(let w of A)for(let b of Zu(w))$.push(b)}}function WF($,I,U){if(U.length===0)return;$.push(""),$.push(`*${I}* (${U.length}):`);for(let D of U)$.push(` • ${D.type}: ${D.title} (${QI(D.type,D.id)})`)}function xu($){let I=[],U=$.dstEntityType??$.dstScope,D=`${U}: ${$.dstTitle||$.dstId.slice(0,8)} (${QI(U,$.dstId)})`,A=typeof $.weight==="number"&&$.weight>1?` · ×${$.weight}`:"",w=$.origin?.scope==="node"&&$.origin.nodeLabel?` · via «${$.origin.nodeLabel}»`:"",b=$.direction==="inverse"?`←${$.type}— ${D}`:`—${$.type}→ ${D}`;if(I.push(` ${b}${A}${w}`),$.text)I.push(` "${$.text}"`);if($.snippet)I.push(` — ${$.snippet}`);return I}function j7($,I){$.set(I,($.get(I)??0)+1)}function hu($){let I=new Map,U=new Map,D=new Map;for(let A of $){for(let N of[A.srcId,A.dstId])j7(I,N);let w=A.direction==="inverse"?A.dstId:A.srcId,b=A.direction==="inverse"?A.srcId:A.dstId;j7(D,w),j7(U,b)}return{total:I,in:U,out:D}}function fu($,I,U){let D=[...I.total.entries()].map(([w,b])=>({node:U.get(w),n:b})).filter((w)=>w.node!==void 0).sort((w,b)=>b.n-w.n).slice(0,5);if(D.length===0)return;let A=D.map(({node:w,n:b})=>{let N=I.in.get(w.id)??0,O=I.out.get(w.id)??0,X=N>=2*Math.max(O,1)?" (sink)":"";return`${w.title} (${QI(w.type,w.id)}) ×${b}${X}`});$.push(`*Most connected*: ${A.join(" · ")}`)}function yu($,I,U,D){let A=new Map;for(let N of I){let O=A.get(N.srcId);if(O)O.push(N);else A.set(N.srcId,[N])}let w=(N)=>U.get(N)?.title??N,b=[...A.entries()].sort((N,O)=>{let X=(D.total.get(O[0])??0)-(D.total.get(N[0])??0);if(X!==0)return X;let W=(D.out.get(O[0])??0)-(D.out.get(N[0])??0);if(W!==0)return W;return w(N[0]).localeCompare(w(O[0]))});$.push(""),$.push(`*Edges by source* (${I.length} edges):`);for(let[N,O]of b){let X=U.get(N),W=X?`${X.type}: ${X.title} (${QI(X.type,X.id)})`:N.slice(0,8),Q=D.out.get(N)??0,B=D.in.get(N)??0;$.push(` ▸ ${W} [out ${Q} · in ${B}]`);for(let Y of O)for(let J of xu(Y))$.push(J)}}function uu($){let I=[],U=$.nodes??[],D=$.edges??[],A=new Map(U.map((O)=>[O.id,O])),w=hu(D),b=$.spaceId?QI("space",$.spaceId):"space";I.push(`**Space graph** (${b})`);let N=[`${$.seedCount??0} seeds`,`${U.length} nodes`,`${D.length} edges`,`depth ${$.depth??0}`];if($.truncated)N.push("truncated (large/busy space — situate a specific node for more)");if(I.push(`*${N.join(" · ")}*`),fu(I,w,A),WF(I,"In-space",U.filter((O)=>O.inSpace)),WF(I,"Connected borders",U.filter((O)=>!O.inSpace)),D.length===0)return I.push(""),I.push("*No relationships among these entities.*"),I.join(`
73
- `);return yu(I,D,A,w),I.join(`
74
- `)}function R7($){if(!$.found)return JSON.stringify({found:!1,error:$.error??"Entity not found"});if($.mode==="space")return uu($);let I=[],U=$.root,D=U?QI(U.type,U.id):"unknown";I.push(`**Situated:** ${U?.type??"entity"} "${U?.title??""}" (${D})`);let A=[`depth ${$.depth??0}`,`${$.nodes?.length??0} nodes`,`${$.edges?.length??0} edges`];if($.truncated)A.push("truncated (busy hop — re-situate a specific node for more)");I.push(`*${A.join(" · ")}*`);let w=$.edges??[];if(w.length===0)return I.push(""),I.push("*No connections within the traversed depth.*"),I.join(`
75
- `);return gu(I,w),I.join(`
76
- `)}function T7($){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 A=U.volume;if(U.issue)A+=`(${U.issue})`;if(U.pages)A+=`, ${U.pages}`;D.push(A)}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(`
77
- `);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(YF($.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(Cu($.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($.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(`
78
- `)}function _7($){if(!$.success)return`Failed to create document: ${$.error}`;return`Document created successfully.
40
+ ${J}`}function BQ($){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(K$([b.name,b.id,A.name,A.id,A.type,"","",""])),U++;else for(let w of A.spaces)D.push(K$([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 vQ($){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 B=Y.bestSnippet??Y.snippet??"",J=B.length>120?`${B.slice(0,117)}...`:B,L=Y.tags?.join(" | ")??"",K=Y.creatorName??"",k=Y.updatedAt??"";if(O){let g=Y.literatureMetadata,x=[Y.entityType,Y.entityTitle,Y.entityId,Y.relevance,L,g?.doi??"",g?.firstAuthor??"",g?.year??"",g?.journal??""];if(N)x.push(K);if(X)x.push(k);x.push(J),A.push(K$(x))}else{let g=[Y.entityType,Y.entityTitle,Y.entityId,Y.relevance,L];if(N)g.push(K);if(X)g.push(k);g.push(J),A.push(K$(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,X.entityId,X.blockId];if(O)Y.push(X.creatorName??"");Y.push(Q),A.push(K$(Y))}}return A.join(`
43
+ `)}function V3($){if($.length===0)return"";let I=[`[toc:${$.length} sections]`,`{title,level,tokens,ownTokens,blockId}[${$.length}]:`];for(let U of $)I.push(K$([U.title,U.level,U.estimatedTokens??0,U.ownTokens??0,U.blockId]));return I.join(`
44
+ `)}function _C($){if($.length===0)return"";let I=[`[regions:${$.length}]`,`{title,kind,tokens,blocks,retrievalHint}[${$.length}]:`];for(let U of $)I.push(K$([U.title,U.kind,U.estimatedTokens??0,U.blockCount,U.retrievalHint]));return I.join(`
45
+ `)}function p4($,I){return`${{literature:"lit",document:"doc",record:"rec",artifact:"art"}[$]??$.slice(0,3)}-${I.slice(0,8)}`}function CC($){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=p4(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 ZC($,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 CC(A))$.push(w)}}function L3($,I,U){if(U.length===0)return;$.push(""),$.push(`*${I}* (${U.length}):`);for(let D of U)$.push(` • ${D.type}: ${D.title} (${p4(D.type,D.id)})`)}function fC($){let I=[],U=$.dstEntityType??$.dstScope,D=`${U}: ${$.dstTitle||$.dstId.slice(0,8)} (${p4(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 YQ($,I){$.set(I,($.get(I)??0)+1)}function gC($){let I=new Map,U=new Map,D=new Map;for(let b of $){for(let O of[b.srcId,b.dstId])YQ(I,O);let A=b.direction==="inverse"?b.dstId:b.srcId,w=b.direction==="inverse"?b.srcId:b.dstId;YQ(D,A),YQ(U,w)}return{total:I,in:U,out:D}}function yC($,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} (${p4(A.type,A.id)}) ×${w}${X}`});$.push(`*Most connected*: ${b.join(" · ")}`)}function xC($,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} (${p4(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 B of N)for(let J of fC(B))$.push(J)}}function lC($){let I=[],U=$.nodes??[],D=$.edges??[],b=new Map(U.map((N)=>[N.id,N])),A=gC(D),w=$.spaceId?p4("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(" · ")}*`),yC(I,A,b),L3(I,"In-space",U.filter((N)=>N.inSpace)),L3(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 xC(I,D,b,A),I.join(`
47
+ `)}function JQ($){if(!$.found)return JSON.stringify({found:!1,error:$.error??"Entity not found"});if($.mode==="space")return lC($);let I=[],U=$.root,D=U?p4(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 ZC(I,A),I.join(`
49
+ `)}function HQ($){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(V3($.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(_C($.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 LQ($){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 zQ($){if(!$.success)return`Failed to create document: ${$.error}`;return`Document created successfully.
79
53
  Title: ${$.title}
80
- ID: ${$.documentId}`}function C7($){if(!$.success)return`Failed to import literature: ${$.error}`;if($.alreadyExisted){let U=`Already in library: ${$.title} (id: ${$.literatureId})`;if($.coreEnriched)return`${U}
54
+ ID: ${$.documentId}`}function MQ($){if(!$.success)return`Failed to import literature: ${$.error}`;if($.alreadyExisted){let U=`Already in library: ${$.title} (id: ${$.literatureId})`;if($.coreEnriched)return`${U}
81
55
  Triggered CORE enrichment for missing content.`;return U}let I=`Literature imported successfully.
82
56
  Title: ${$.title}
83
57
  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}
84
58
  Full text: imported from CORE (${U.join(", ")})`}if($.error?.includes("CORE enrichment in progress"))return`${I}
85
- Full text: CORE enrichment in progress -- content available shortly via get_content.`;return I}function Z7($){if(!$.success)return`Failed to insert matrix: ${$.error}`;return`Matrix inserted successfully.
59
+ Full text: CORE enrichment in progress -- content available shortly via get_content.`;return I}function VQ($){if(!$.success)return`Failed to insert matrix: ${$.error}`;return`Matrix inserted successfully.
86
60
  Label: ${$.label}
87
61
  Matrix ID: ${$.matrixId}
88
- Block ID: ${$.blockId}`}function g7($){if(!$.success){if($.errorCode==="ambiguous_matrix_selection"&&$.availableMatrices?.length){let A=$.availableMatrices.map((w)=>` - ${w.id} — ${w.label}`).join(`
89
- `);return[`Failed: ${$.error}`,"","Available matrices on this artifact:",A,"","Re-call with `matrixId` set to one of the above."].join(`
62
+ Block ID: ${$.blockId}`}function KQ($){if(!$.success){if($.errorCode==="ambiguous_matrix_selection"&&$.availableMatrices?.length){let b=$.availableMatrices.map((A)=>` - ${A.id} — ${A.label}`).join(`
63
+ `);return[`Failed: ${$.error}`,"","Available matrices on this artifact:",b,"","Re-call with `matrixId` set to one of the above."].join(`
90
64
  `)}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(`
91
- `)}function x7($){if(!$.success)return`Replace failed: ${$.error}`;let I=[`Text replaced in block ${$.blockId}`];if($.originalText&&$.updatedText)I.push(QF($.originalText,$.updatedText));let U=nb($.positionContext);if(U)I.push(`Position: ${U}`);return I.join(`
92
-
93
- `)}function h7($){if(!$.success)return`Insert failed: ${$.error}`;if($.newBlockIds&&$.newBlockIds.length>0){let D=[`Inserted ${$.newBlockIds.length} blocks:`];if($.results){for(let A of $.results)if(A.success&&A.newBlockId){let w=A.blockType??"paragraph",b=A.contentPreview?`: ${A.contentPreview.slice(0,60)}${A.contentPreview.length>60?"...":""}`:"";D.push(` [${w} | ${A.newBlockId}]${b}`)}}return D.join(`
94
- `)}let I=[`Block inserted. ID: ${$.newBlockId}`];if($.insertedBlock){let{blockType:D,content:A}=$.insertedBlock,w=A.length>200?`${A.slice(0,200)}...`:A;if(I.push(`Type: ${D}`),w)I.push(`Content: ${w}`)}let U=nb($.positionContext);if(U)I.push(`Position: ${U}`);return I.join(`
95
- `)}function f7($){if(!$.success)return`Delete failed: ${$.error}`;if($.deletedBlockIds&&$.deletedBlockIds.length>0){let D=[`Deleted ${$.deletedBlockIds.length} blocks:`];if($.results){for(let A of $.results)if(A.success){let w=A.blockType??"?",b=A.contentPreview?`: ${A.contentPreview.slice(0,60)}${A.contentPreview.length>60?"...":""}`:"";D.push(` [${w} | ${A.blockId}]${b}`)}}return D.join(`
96
- `)}let I=[];if($.deletedBlock){let{blockType:D,contentPreview:A}=$.deletedBlock;if(I.push(`Deleted [${D} | ${$.deletedBlock.blockId}]`),A)I.push(`Was: ${A}`)}else I.push("Block deleted");let U=nb($.positionContext);if(U)I.push(`New adjacency: ${U}`);return I.join(`
97
- `)}function y7($){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(`
98
- `),U=$.nodeIdMap?Object.entries($.nodeIdMap):[];if(U.length===0)return I;let D=U.map(([A,w])=>P$([A,w]));return[I,"",`{tempId,nodeId}[${U.length}]:`,...D].join(`
99
- `)}function u7($){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 l7($){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 c7($){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,A=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}, ${A}]`)}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((A)=>A.class?`${A.key}→${A.suggestion} (${A.class})`:`${A.key}→${A.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(m7($.schema));return U.join(`
100
- `)}function m7($){let I=$.structureClass?`${$.artifactType}/${$.structureClass}`:$.artifactType,U=$.knownKeys.map((D)=>{let A=D.unit?`[${D.unit}]`:"",w=D.options&&D.options.length>0?`=${D.options.join("|")}`:"",b=D.auto?"*":"";return`${D.key}:${D.type}${A}${w}${b}`}).join(", ");return`[schema | type=${I}, knownKeys: ${U}]`}function r7($){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 A=($.links??[]).map((w)=>w.label?`${w.role}/${w.label}=${w.artifactId}`:`${w.role}=${w.artifactId}`).join(", ");I.push(`[links | ${U} slot${U===1?"":"s"} bound: ${A}]`)}let D=$.pendingSlots?.length??0;if(D>0){let A=($.pendingSlots??[]).map((w)=>{let b=w.filter?.artifactType?`:${w.filter.artifactType}${w.filter.structureClass?`/${w.filter.structureClass}`:""}`:"",N=w.label?`(${w.label})`:"";return`${w.role}${N}${b}`}).join(", ");I.push(`[pending_slots | ${D} slot${D===1?"":"s"} need binding: ${A}]`)}return I.join(`
101
- `)}function i7($){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 A=$.warnings.map((w)=>w.class?`${w.key}→${w.suggestion} (${w.class})`:`${w.key}→${w.suggestion}`).join(", ");D.push(`[warnings | ${$.warnings.length} property key${$.warnings.length===1?"":"s"} look like typo${$.warnings.length===1?"":"s"} of typed-schema keys: ${A}]`)}if($.schema)D.push(m7($.schema));return D.join(`
102
- `)}function n7($){if(!$.success)return $.error??"reorder_procedure_nodes failed";return`[procedure_tree reordered | record=${$.recordId??""}, moves=${$.moveCount??0}]`}function o7($){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((A)=>P$([A]));return[U,"","[orphanedMatrixIds — rebind or delete via the matrix tools]",`{matrixId}[${I.length}]:`,...D].join(`
103
- `)}function d7($){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 A=I.map(([b,N])=>P$([b,N])),w=[D,`{tempId,nodeId}[${I.length}]:`,...A];if($.mode==="replace"&&$.orphanedMatrixIds&&$.orphanedMatrixIds.length>0){w.push(""),w.push("[orphanedMatrixIds — rebind or delete via the matrix tools]"),w.push(`{matrixId}[${$.orphanedMatrixIds.length}]:`);for(let b of $.orphanedMatrixIds)w.push(P$([b]))}return w.join(`
104
- `)}function p7($){if(!$.success)return $.error??"append_matrix_rows failed";return`[matrix rows appended | id=${$.matrixId??""}, added=${$.addedRowCount??0}, totalRows=${$.newRowCount??0}, version=${$.newVersion??0}]`}function t7($){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)=>P$([D]))].join(`
105
- `)}function a7($){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)=>P$([D]))].join(`
106
- `)}function e7($){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 s7($){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 $5($){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 I5($){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((A)=>P$([A.sourceType,A.sourceId,A.sourceTitle??""]));return[...U,...D].join(`
107
- `)}function U5($){if(!$.success)return $.error??"link_artifact_to_node failed";return`[artifact linked | linkId=${$.linkId??""}, node=${$.nodeId??""}, artifact=${$.artifactId??""}, role=${$.role??""}]`}function A5($){if(!$.success)return $.error??"update_edge failed";return`[edge typed | edgeId=${$.edgeId??""}, relation=${$.relationType??""}, direction=${$.direction??""}]`}function D5($){if(!$.success)return $.error??"update_artifact_link_relation failed";return`[link relation typed | artifactLinkId=${$.artifactLinkId??""}, relation=${$.relationType??""}, role=${$.role??""} (unchanged)]`}function w5($){if(!$.success)return $.error??"unlink_artifact_from_node failed";return`[artifact unlinked | linkId=${$.linkId??""}]`}function b5($){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((A)=>P$([A.linkId,A.artifactId,A.artifactName??"",A.artifactType??"",A.role,A.context&&Object.keys(A.context).length>0?JSON.stringify(A.context):""]));return[...U,...D].join(`
108
- `)}function GF($){return $.map((I)=>{let U=[I.label,I.type];if(I.unit)U.push(I.unit);return`${I.key}(${U.join("/")})`}).join("|")}function N5($){if(!$.success)return $.error??"list_procedure_nodes failed";let I=$.nodes??[],U=$.orphanedMatrices??[],D=[`[procedure_tree: record=${$.recordId??""}, nodeCount=${I.length}, orphanedMatrices=${U.length}]`],A=[];if(I.length>0){A.push(`{id,parentId,order,type,label,copyable,matrixCount,artifactCount,fileCount,proseBlockCount}[${I.length}]:`);for(let O of I)A.push(P$([O.id,O.parentId??"",O.order,O.type,O.label,O.copyable?"true":"false",O.matrixCount,O.artifactCount,O.fileCount,O.proseBlockCount]))}else A.push("No procedure nodes.");let w=[];for(let O of I){if(!O.matrices||O.matrices.length===0)continue;for(let X of O.matrices)w.push({nodeId:O.id,matrix:X})}let b=[];if(w.length>0){b.push(""),b.push("[attachedMatrices]"),b.push(`{nodeId,matrixId,label,version,rows,cols}[${w.length}]:`);for(let{nodeId:O,matrix:X}of w)b.push(P$([O,X.id,X.label,X.version,X.rowCount,GF(X.columns)]))}let N=[];if(U.length>0)if(N.push(""),N.push("[orphanedMatrices]"),U.some((X)=>X.version!==void 0&&X.columns!==void 0)){N.push(`{id,label,version,rows,cols,updatedAt}[${U.length}]:`);for(let X of U)N.push(P$([X.id,X.label,X.version??"",X.rowCount??"",X.columns?GF(X.columns):"",X.updatedAt]))}else{N.push(`{id,label,updatedAt}[${U.length}]:`);for(let X of U)N.push(P$([X.id,X.label,X.updatedAt]))}return[...D,...A,...b,...N].join(`
109
- `)}var lu=G.object({cid:G.number().int().positive().describe("PubChem Compound ID (CID).")}),O5={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 cu=/^[A-Z]{14}-[A-Z]{10}-[A-Z]$/,mu=G.object({inchi_key:G.string().regex(cu,"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).')}),X5={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 BF=G.enum(["physical","safety","handling","transport","exposure","toxicity","spectra","ecological","regulatory","classification","literature_counts"]),ru=G.object({cid:G.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:G.array(BF).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:G.boolean().optional().describe("When true, list every source for each multi-source field (density typically has 5-7). Default false: first authoritative source only.")}),W5={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 iu=G.enum(["preamble","full"]),G5=G.object({entityId:G.string().describe('Entity ID (UUID or short ref like "lit-a3f7e2b9")'),overview:G.preprocess(($)=>{if(typeof $==="string")return $==="true";return $},G.boolean()).optional().describe("Return overview with TOC and preview. Default behavior."),blockIds:G.array(G.string()).optional().describe("Array of specific block IDs to fetch from search results"),segment:iu.optional().describe('Named content region to fetch. Use "preamble" for content before the first heading, or "full" for the entire entity content.'),section:G.string().optional().describe('Section heading text, blockId, or parent-qualified path (e.g., "Methods/Key Takeaways") to fetch all blocks from'),refs:G.array(G.number().int()).optional().describe("Reference numbers to fetch (e.g., [42, 43])"),figures:G.array(G.string()).optional().describe('Figure IDs to fetch (e.g., ["fig-1", "fig-2"])'),tables:G.array(G.string()).optional().describe('Table IDs to fetch (e.g., ["table-1"])'),node:G.string().optional().describe("Procedure node label or ID. Returns node prose, matrices (TOON format), artifact links, and child summaries. Records only."),depth:G.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:G.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:G.string().optional().describe('End section heading, blockId, or parent-qualified path (e.g., "Parent/Section") for range fetching (inclusive). Use with from_section.')}),x0={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 Q5=G.object({forceRefresh:G.boolean().optional().describe("Force reload from server instead of returning cached context. Use after creating new organizations or workspaces.")}),h0={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 ob=G.object({entityType:N4.describe('Entity type: "document" or "record"'),entityId:G.string().uuid().describe("Document or record ID"),afterBlockId:G.string().optional().describe("Insert AFTER this block ID (sibling insertion)"),beforeBlockId:G.string().optional().describe("Insert BEFORE this block ID (sibling insertion)"),parentBlockId:G.string().optional().describe("Insert as CHILD of this container block (e.g., add referenceItem inside referenceList)"),childPosition:G.string().optional().describe('Position within parent children: "first", "last" (default), or child block ID to insert after'),blockType:G.enum(ub).default("paragraph").optional().describe("Type of block to create. Default: paragraph"),content:G.string().optional().describe("Text content for the new block"),headingLevel:G.number().int().min(1).max(3).optional().describe("Heading level (1-3) if blockType is heading"),checked:G.boolean().optional().describe("Checked state for checkListItem"),title:G.string().optional().describe('Title for referenceList container (default: "References")'),refNumber:G.number().int().min(1).optional().describe("Reference number for referenceItem (e.g., 1, 2, 3)"),refId:G.string().optional().describe('Stable ref ID for citation linking (e.g., "lit-a3f7e2b9"). Auto-generated from linkedEntityId if omitted.'),refType:G.enum(lb).optional().describe("Type of reference: literature, document, record, or annotation"),linkedEntityId:G.string().uuid().optional().describe("UUID of the linked entity (literature, document, or record)"),entityTitle:G.string().optional().describe("Cached title of the linked entity"),doi:G.string().optional().describe("DOI for literature references"),smiles:G.string().optional().describe('SMILES string (e.g., "CCO" for ethanol). Required for structure blocks in molecule mode.'),structureType:G.enum(cb).optional().describe('Mode of the structure block: "molecule" (default) or "reaction"'),moleculeName:G.string().optional().describe("Name of the molecule or reaction"),moleculeDescription:G.string().optional().describe("Optional description or notes for the structure block"),matrixId:G.string().optional().describe("UUID of the linked data matrix for structuredMatrix blocks"),nodeRef:G.string().optional().describe("Procedure tree node ID for structuredMatrix blocks"),matrixLabel:G.string().optional().describe("Display label for structuredMatrix blocks"),showPreview:G.boolean().optional().describe("Whether structuredMatrix should show its inline preview"),recordId:G.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:G.array(Y7).max(q1).optional().describe(`Array of blocks to insert in sequence. Max ${q1} blocks. Use this for inserting multiple blocks in one call.`)}),nu=ob.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"}),f0={name:"insert_block",description:`Insert block(s) in a document. Three positioning modes:
65
+ `)}function FQ($){if(!$.success)return`Replace failed: ${$.error}`;let I=[`Text replaced in block ${$.blockId}`];if($.originalText&&$.updatedText)I.push(M3($.originalText,$.updatedText));let U=FO($.positionContext);if(U)I.push(`Position: ${U}`);return I.join(`
66
+
67
+ `)}function qQ($){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(`
68
+ `)}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=FO($.positionContext);if(U)I.push(`Position: ${U}`);return I.join(`
69
+ `)}function kQ($){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(`
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=FO($.positionContext);if(U)I.push(`New adjacency: ${U}`);return I.join(`
71
+ `)}function EQ($){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(`
72
+ `),U=$.nodeIdMap?Object.entries($.nodeIdMap):[];if(U.length===0)return I;let D=U.map(([b,A])=>K$([b,A]));return[I,"",`{tempId,nodeId}[${U.length}]:`,...D].join(`
73
+ `)}function SQ($){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 jQ($){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 PQ($){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(RQ($.schema));return U.join(`
74
+ `)}function RQ($){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 TQ($){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(`
75
+ `)}function _Q($){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(RQ($.schema));return D.join(`
76
+ `)}function CQ($){if(!$.success)return $.error??"reorder_procedure_nodes failed";return`[procedure_tree reordered | record=${$.recordId??""}, moves=${$.moveCount??0}]`}function ZQ($){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)=>K$([b]));return[U,"","[orphanedMatrixIds — rebind or delete via the matrix tools]",`{matrixId}[${I.length}]:`,...D].join(`
77
+ `)}function fQ($){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])=>K$([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(K$([w]))}return A.join(`
78
+ `)}function gQ($){if(!$.success)return $.error??"append_matrix_rows failed";return`[matrix rows appended | id=${$.matrixId??""}, added=${$.addedRowCount??0}, totalRows=${$.newRowCount??0}, version=${$.newVersion??0}]`}function yQ($){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)=>K$([D]))].join(`
79
+ `)}function xQ($){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)=>K$([D]))].join(`
80
+ `)}function lQ($){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 hQ($){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 uQ($){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 iQ($){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)=>K$([b.sourceType,b.sourceId,b.sourceTitle??""]));return[...U,...D].join(`
81
+ `)}function nQ($){if(!$.success)return $.error??"link_artifact_to_node failed";return`[artifact linked | linkId=${$.linkId??""}, node=${$.nodeId??""}, artifact=${$.artifactId??""}, role=${$.role??""}]`}function rQ($){if(!$.success)return $.error??"update_edge failed";return`[edge typed | edgeId=${$.edgeId??""}, relation=${$.relationType??""}, direction=${$.direction??""}]`}function cQ($){if(!$.success)return $.error??"update_artifact_link_relation failed";return`[link relation typed | artifactLinkId=${$.artifactLinkId??""}, relation=${$.relationType??""}, role=${$.role??""} (unchanged)]`}function mQ($){if(!$.success)return $.error??"unlink_artifact_from_node failed";return`[artifact unlinked | linkId=${$.linkId??""}]`}function oQ($){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)=>K$([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(`
82
+ `)}function z3($){return $.map((I)=>{let U=[I.label,I.type];if(I.unit)U.push(I.unit);return`${I.key}(${U.join("/")})`}).join("|")}function dQ($){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(K$([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(K$([N,X.id,X.label,X.version,X.rowCount,z3(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(K$([X.id,X.label,X.version??"",X.rowCount??"",X.columns?z3(X.columns):"",X.updatedAt]))}else{O.push(`{id,label,updatedAt}[${U.length}]:`);for(let X of U)O.push(K$([X.id,X.label,X.updatedAt]))}return[...D,...b,...w,...O].join(`
83
+ `)}var hC=W.object({cid:W.number().int().positive().describe("PubChem Compound ID (CID).")}),pQ={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 uC=/^[A-Z]{14}-[A-Z]{10}-[A-Z]$/,iC=W.object({inchi_key:W.string().regex(uC,"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).')}),tQ={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 K3=W.enum(["physical","safety","handling","transport","exposure","toxicity","spectra","ecological","regulatory","classification","literature_counts"]),nC=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(K3).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.")}),aQ={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 rC=W.enum(["preamble","full"]),eQ=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:rC.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.')}),Pb={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 sQ=W.object({forceRefresh:W.boolean().optional().describe("Force reload from server instead of returning cached context. Use after creating new organizations or workspaces.")}),Rb={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 qO=W.object({entityType:o6.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(HO).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(LO).optional().describe("Type of reference: literature, document, record, or annotation"),linkedEntityId:W.string().uuid().optional().describe("UUID of the linked entity (literature, document, or record)"),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(zO).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(s8).max(X1).optional().describe(`Array of blocks to insert in sequence. Max ${X1} blocks. Use this for inserting multiple blocks in one call.`)}),cC=qO.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"}),Tb={name:"insert_block",description:`Insert block(s) in a document. Three positioning modes:
110
84
  1. afterBlockId: Insert as SIBLING after the specified block
111
85
  2. beforeBlockId: Insert as SIBLING before the specified block
112
86
  3. parentBlockId: Insert as CHILD of a container block (e.g., referenceItem inside referenceList)
@@ -177,7 +151,7 @@ To add prose under a procedure node, use the prose container's blockId instead:
177
151
 
178
152
  The procedureTree container itself is fine as a sibling anchor (afterBlockId / beforeBlockId) but never as a parentBlockId (its children are projected sections).
179
153
 
180
- **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 Y5=G.object({recordId:G.string().uuid().describe("Target record UUID. Must be in draft status."),parentId:G.string().uuid().optional().describe("Existing parent node UUID. Omit to insert as a top-level root under the record."),label:G.string().min(1).describe("Human-readable node label."),type:E1.describe("Node type."),afterNodeId:G.string().uuid().optional().describe("Insert immediately after this existing sibling. Resolves to the sibling's order + 1."),order:G.number().int().min(0).optional().describe("Explicit sibling order (0-indexed). Mutually exclusive with afterNodeId; omit both to append."),copyable:G.boolean().optional().describe('Template-copyable flag. MUST be false (or omitted) when type === "observation".'),analyticalData:G.array(S1).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"]}),y0={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 B5=G.object({templateId:G.string().uuid().describe("UUID of the `artifact_properties` template to instantiate. Use `search` (entity_type=template) or workspace browsing to discover templates."),workspaceId:G.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:G.string().uuid().optional().describe("Organization ID. Ignored when workspaceId is provided — derived from the workspace."),name:G.string().min(1).describe('Display name for the new artifact (e.g. "BB-R6 Suzuki run").'),description:G.string().optional(),tags:G.array(G.string()).optional(),properties:G.record(G.string(),G.unknown()).optional().describe("Property overrides on top of the template defaults. Caller wins on key conflicts."),status:j1.optional(),storageRef:G.string().optional(),location:G.string().optional(),parentId:G.string().uuid().optional(),sourceRecordId:G.string().uuid().optional(),slotBindings:G.array(G.object({role:G.string().describe('Slot role from the template (e.g. "reactant").'),label:G.string().optional().describe('Slot label (e.g. "aryl halide"). Required when the template declares multiple slots of the same role.'),artifactId:G.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`.")}),u0={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 J5=G.object({nodeId:G.string().uuid().describe("UUID of the procedure node to link the artifact to."),artifactId:G.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:G.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:G.record(G.string(),G.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.')}),l0={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 H5=G.object({matrixId:G.string().uuid().describe("UUID of the matrix to inspect.")}),c0={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 L5=G.object({nodeId:G.string().uuid().describe("UUID of the procedure node whose artifact links to list.")}),m0={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 z5=G.object({recordId:G.string().uuid().describe("Record UUID whose procedure tree you want to inspect.")}),r0={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 M5=G.object({matrixId:G.string().uuid().describe("UUID of the target data_matrix."),nodeRef:G.union([G.string().uuid(),G.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:G.number().int().min(0).describe("Current matrix version (optimistic locking). Must equal the server's stored version; otherwise returns a matrix_version_conflict error.")}),i0={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 JF=G.object({nodeId:G.string().uuid().describe("UUID of the node to move/reorder."),parentId:G.string().uuid().nullable().describe("New parent UUID, or null to become a top-level root. Must belong to the same record."),order:G.number().int().min(0).describe("New 0-indexed order within the new parent's children.")}),K5=G.object({recordId:G.string().uuid().describe("Target record UUID. Must be in draft status."),moves:G.array(JF).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.")}),n0={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 ou=G.object({cas:G.string().min(5).describe('CAS Registry Number (e.g. "64-17-5" for ethanol). Format: NNNN-NN-N.')}),V5={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 v5=G.object({query:G.string().min(1).optional().describe("Search query keywords"),mode:G.enum(["library","blocks"]).default("library").describe('Search mode: "library" returns unique entities (papers/docs), "blocks" returns block-level results'),scope:G.object({type:G.enum(["literature","document","record","artifact"]).optional().describe("Filter by entity type"),entityId:G.string().uuid().optional().describe("Search within specific entity (blocks mode only)")}).optional().describe("Optional scope to narrow search"),orgId:G.string().uuid().optional().describe("Organization ID - use the one from workspace context"),workspaceId:G.string().uuid().optional().describe("Filter by workspace ID"),spaceId:G.string().uuid().optional().describe("Filter by space ID"),limit:G.number().min(1).max(50).default(10).describe("Max results. Default: 10"),authorName:G.string().optional().describe('Filter by author name (partial match). Example: "Shen" finds papers by authors named Shen'),journalName:G.string().optional().describe('Filter by journal name (partial match). Example: "Nano Letters" finds papers from Nano Letters'),yearMin:G.number().int().min(1900).max(2100).optional().describe("Minimum publication year (inclusive)"),yearMax:G.number().int().min(1900).max(2100).optional().describe("Maximum publication year (inclusive)"),artifactType:G.string().optional().describe('Filter by artifact type: "sample", "dataset", "protocol", "file", "equipment", "chemical", "model"'),artifactStatus:G.string().optional().describe('Filter by artifact status: "active", "depleted", "archived", "draft"')}),o0={name:"search",description:`Search across literature, documents, records, and artifacts.
154
+ **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 $Y=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"]}),_b={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 IY=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`.")}),Cb={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 UY=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.')}),Zb={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 bY=W.object({matrixId:W.string().uuid().describe("UUID of the matrix to inspect.")}),fb={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 DY=W.object({nodeId:W.string().uuid().describe("UUID of the procedure node whose artifact links to list.")}),gb={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.")}),yb={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 wY=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.")}),xb={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 F3=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.")}),NY=W.object({recordId:W.string().uuid().describe("Target record UUID. Must be in draft status."),moves:W.array(F3).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.")}),lb={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 mC=W.object({cas:W.string().min(5).describe('CAS Registry Number (e.g. "64-17-5" for ethanol). Format: NNNN-NN-N.')}),XY={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 WY=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"')}),hb={name:"search",description:`Search across literature, documents, records, and artifacts.
181
155
 
182
156
  **Modes:**
183
157
  - \`library\` (default): Returns unique entities ranked by relevance. Use when browsing/discovering.
@@ -229,9 +203,9 @@ Requires \`workspaceId\`. Returns artifact names, types, and retrieval hints.
229
203
  **Retrieval Hints:**
230
204
  Library mode results include \`bestBlockId\` and smart \`retrievalHint\`:
231
205
  - High relevance: Jump directly to the best block via \`blockIds=['bestBlockId']\`
232
- - Medium/Low relevance: Start with \`overview=true\` to explore structure first`};var du=G.object({name:G.string().optional().describe("Compound name, trade name, or systematic name."),cas:G.string().optional().describe('CAS Registry Number (e.g. "64-17-5" for ethanol).'),cid:G.number().int().positive().optional().describe("PubChem CID."),inchi_key:G.string().optional().describe('InChIKey (27-char hash, e.g. "LFQSCWFLJHTTHZ-UHFFFAOYSA-N").'),limit:G.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."),q5={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 F5=G.object({entityId:G.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:G.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:G.union([G.literal(1),G.literal(2),G.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."}),d0={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 E5=G.object({entityType:N4.describe('Entity type: "document" or "record"'),entityId:G.string().uuid().describe("Document or record ID"),blockId:G.string().describe("Block ID to edit"),oldText:G.string().describe("Exact text to find and replace (must match exactly)"),newText:G.string().describe("Text to replace with")}),p0={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 S5=G.object({linkId:G.string().uuid().describe("UUID of the `artifact_links` row to delete. Returned by `link_artifact_to_node` and `list_node_artifact_links`.")}),t0={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 a0={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}},j5=Object.keys(a0),e0=G.enum(j5);function YI(){return j5.map(($)=>`- \`${$}\` — ${a0[$].gloss} Reading: "${a0[$].reading}". e.g. ${a0[$].example}`).join(`
233
- `)}var db=G.object({artifactLinkId:G.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:e0.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:
234
- ${YI()}`),note:G.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.")}),pu=db.extend({note:G.string().optional()}),s0={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):",YI(),"Re-calling with the same `artifactLinkId` re-types the relation in place."].join(`
235
- `)};var pb=G.object({edgeId:G.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:G.string().uuid().describe("UUID of the document/record the mention lives in (the edge subject)."),sourceEntityType:G.enum(["document","record"]).describe("Type of the source entity (document or record)."),targetEntityId:G.string().uuid().describe("UUID of the mentioned entity (the edge object)."),targetEntityType:G.enum(["literature","document","record","artifact","matrix"]).describe("Type of the mentioned (target) entity."),blockId:G.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:G.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:e0.describe(`The relation predicate. One of the eight ratified, disjoint-from-structural predicates:
236
- ${YI()}`),note:G.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:G.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.")}),tu=pb.extend({edgeId:G.string().uuid(),note:G.string().optional()}),$A={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):",YI(),"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(`
237
- `)};var au=G.record(G.string(),G.union([G.string(),G.number(),G.boolean(),G.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)."),eu=G.object({rowIndex:G.number().int().min(0).optional().describe("Target a single row by 0-based index in the current rows array."),rowMatch:au.optional(),values:F1.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"]}),k5=G.object({matrixId:G.string().uuid().describe("UUID of the target data_matrix."),updates:G.array(eu).min(1).describe("List of row patches. Each entry targets rows by `rowIndex` OR `rowMatch` and supplies a partial `values` patch."),version:G.number().int().min(0).describe("Current matrix version (optimistic locking). Must equal the server's stored version; otherwise returns a matrix_version_conflict error.")}),IA={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 P5=G.object({nodeId:G.string().uuid().describe("UUID of the existing procedure node to update."),label:G.string().min(1).optional().describe("New label (skip to keep existing)."),type:E1.optional().describe('New type (skip to keep existing). Changing type to "observation" forces copyable=false.'),copyable:G.boolean().optional().describe('Template-copyable flag. When the resulting type is "observation" this must be false (or omitted).'),analyticalData:G.array(S1).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)."}),UA={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 R5=[o0,x0,d0,p0,f0,V0,R0,_0,k0,P0,T0,j0,u0,h0,r0,E0,y0,UA,n0,g0,v0,IA,S0,Z0,i0,q0,c0,C0,l0,t0,m0,s0,$A,q5,O5,X5,V5,W5],su=R5.map(($)=>$.name),$l=Object.fromEntries(R5.map(($)=>[$.name,$]));function T5($){return{content:[{type:"text",text:$}]}}function _5($){return{content:[{type:"text",text:$}],isError:!0}}function g($,I,U){let{definition:D,schema:A,createExecutor:w,formatOutput:b,formatError:N=(Q)=>Q.message,getLogMessage:O=(Q)=>JSON.stringify(Q).slice(0,100)}=U,X=w(I),W=A.shape;$.tool(D.name,D.description,W,async(Q)=>{let B=Q,Y=O(B);I.log.info(`${D.name}: ${Y}`);try{let J=await X(B),H=b(J,B);return I.log.info(`${D.name}: completed`),T5(H)}catch(J){let H=J instanceof Error?N(J,B):"Unknown error";return I.log.error(`${D.name} failed:`,J),_5(`${D.name} error: ${H}`)}})}function tb($,I,U){let{definition:D,schema:A,createExecutor:w,formatSuccess:b,formatNotFound:N=(B)=>JSON.stringify({found:!1,error:B.error??"Not found"}),formatError:O=(B)=>B.message,getLogMessage:X=(B)=>JSON.stringify(B).slice(0,100)}=U,W=w(I),Q=A.shape;$.tool(D.name,D.description,Q,async(B)=>{let Y=B,J=X(Y);I.log.info(`${D.name}: ${J}`);try{let H=await W(Y);if(!H.found)return I.log.info(`${D.name}: not found`),{content:[{type:"text",text:N(H,Y)}],isError:!0};return I.log.info(`${D.name}: found`),T5(b(H,Y))}catch(H){let v=H instanceof Error?O(H,Y):"Unknown error";return I.log.error(`${D.name} failed:`,H),_5(`${D.name} error: ${v}`)}})}function HF($,I){g($,I,{definition:v0,schema:J7,createExecutor:(U)=>{return async(D)=>{return await U.client.appendMatrixRows(D)}},formatOutput:p7,getLogMessage:(U)=>`Appending ${U.rows.length} row(s) to matrix ${U.matrixId.slice(0,8)}`})}function LF($,I){g($,I,{definition:q0,schema:H7,createExecutor:(U)=>{return async(D)=>{return await U.client.attachMatrix(D)}},formatOutput:$5,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 zF($,I){g($,I,{definition:E0,schema:L7,createExecutor:(U)=>{return async(D)=>{return await U.client.buildProcedureTree(D)}},formatOutput:d7,getLogMessage:(U)=>`${U.mode==="replace"?"REPLACE":"append"} procedure tree for record ${U.recordId.slice(0,8)}: ${U.nodes.length} node(s)`})}function MF($,I){g($,I,{definition:j0,schema:M7,createExecutor:(U)=>{return async(D)=>{return await U.client.createArtifact(D)}},formatOutput:c7,getLogMessage:(U)=>`Creating ${U.artifactType} "${U.name.slice(0,30)}"`})}function KF($,I){g($,I,{definition:k0,schema:K7,createExecutor:(U)=>{return async(D)=>{return await U.client.createDocument(D)}},formatOutput:_7,getLogMessage:(U)=>`Creating document: "${U.title.slice(0,30)}${U.title.length>30?"...":""}"`})}function VF($,I){g($,I,{definition:P0,schema:V7,createExecutor:(U)=>{return async(D)=>{return U.client.createLiterature(D)}},formatOutput:C7,getLogMessage:(U)=>`Importing literature: "${U.title.slice(0,30)}${U.title.length>30?"...":""}"${U.doi?` (DOI: ${U.doi})`:""}`})}function vF($,I){g($,I,{definition:R0,schema:v7,createExecutor:(U)=>{return async(D)=>{return await U.client.createMatrixFromArtifact(D)}},formatOutput:g7,getLogMessage:(U)=>`Deriving matrix from artifact ${U.artifactId.slice(0,8)}`})}function qF($,I){g($,I,{definition:T0,schema:q7,createExecutor:(U)=>{return async(D)=>{return await U.client.createRecord(D)}},formatOutput:y7,getLogMessage:(U)=>`Creating record: "${U.title.slice(0,30)}${U.title.length>30?"...":""}"${U.initialTree?` + ${U.initialTree.length} node(s)`:""}`})}function FF($,I){g($,I,{definition:_0,schema:ib,createExecutor:(U)=>{return async(D)=>{return await U.client.deleteBlock(D)}},formatOutput:f7,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 EF($,I){g($,I,{definition:C0,schema:F7,createExecutor:(U)=>{return async(D)=>{return await U.client.deleteMatrix(D)}},formatOutput:s7,getLogMessage:(U)=>`Deleting matrix ${U.matrixId.slice(0,8)} (+ block)`})}function SF($,I){g($,I,{definition:Z0,schema:E7,createExecutor:(U)=>{return async(D)=>{return await U.client.deleteMatrixRows(D)}},formatOutput:a7,getLogMessage:(U)=>{return`Deleting rows (${U.rowIndices?`${U.rowIndices.length} index(es)`:"match"}) from matrix ${U.matrixId.slice(0,8)}`}})}function jF($,I){g($,I,{definition:g0,schema:S7,createExecutor:(U)=>{return async(D)=>{return await U.client.deleteProcedureNode(D)}},formatOutput:o7,getLogMessage:(U)=>`Deleting procedure node ${U.nodeId.slice(0,8)} (cascade)`})}function kF($,I){tb($,I,{definition:x0,schema:G5,createExecutor:(U)=>{return async(D)=>{return U.client.getContent(D)}},formatSuccess:T7,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 PF($,I){g($,I,{definition:h0,schema:Q5,createExecutor:(U)=>{return async(D)=>{if(U.workspaceContext&&!D.forceRefresh)return U.workspaceContext;let A=await U.client.getWorkspaceContext();return U.workspaceContext=A,A}},formatOutput:k7,getLogMessage:(U)=>U.forceRefresh?"force refresh":"cached"})}function RF($,I){g($,I,{definition:f0,schema:ob,createExecutor:(U)=>{return async(D)=>{return await U.client.insertBlock(D)}},formatOutput:h7,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 TF($,I){g($,I,{definition:V0,schema:B7,createExecutor:(U)=>{return async(D)=>{return await U.client.insertMatrix(D)}},formatOutput:(U)=>Z7(U),getLogMessage:(U)=>`"${U.label.slice(0,30)}${U.label.length>30?"...":""}"`})}function _F($,I){g($,I,{definition:y0,schema:Y5,createExecutor:(U)=>{return async(D)=>{return await U.client.insertProcedureNode(D)}},formatOutput:u7,getLogMessage:(U)=>`Inserting procedure node "${U.label.slice(0,30)}" into record ${U.recordId.slice(0,8)}`})}function CF($,I){g($,I,{definition:u0,schema:B5,createExecutor:(U)=>{return async(D)=>{return await U.client.instantiateArtifactTemplate(D)}},formatOutput:r7,getLogMessage:(U)=>`Instantiating template ${U.templateId.slice(0,8)} → "${U.name}"`})}function ZF($,I){g($,I,{definition:l0,schema:J5,createExecutor:(U)=>{return async(D)=>{return await U.client.linkArtifactToNode(D)}},formatOutput:U5,getLogMessage:(U)=>`Linking artifact ${U.artifactId.slice(0,8)} → node ${U.nodeId.slice(0,8)} (${U.role})`})}function gF($,I){g($,I,{definition:c0,schema:H5,createExecutor:(U)=>{return async(D)=>{return await U.client.listMatrixReferences(D)}},formatOutput:I5,getLogMessage:(U)=>`Listing references for matrix ${U.matrixId.slice(0,8)}`})}function xF($,I){g($,I,{definition:m0,schema:L5,createExecutor:(U)=>{return async(D)=>{return await U.client.listNodeArtifactLinks(D)}},formatOutput:b5,getLogMessage:(U)=>`Listing artifact links for node ${U.nodeId.slice(0,8)}`})}function hF($,I){g($,I,{definition:r0,schema:z5,createExecutor:(U)=>{return async(D)=>{return await U.client.listProcedureNodes(D)}},formatOutput:N5,getLogMessage:(U)=>`Listing procedure nodes for record ${U.recordId.slice(0,8)}`})}function fF($,I){g($,I,{definition:i0,schema:M5,createExecutor:(U)=>{return async(D)=>{return await U.client.rebindMatrixToNode(D)}},formatOutput:e7,getLogMessage:(U)=>{let D=U.nodeRef?U.nodeRef.slice(0,8):"(body)";return`Rebinding matrix ${U.matrixId.slice(0,8)} → ${D}`}})}function yF($,I){g($,I,{definition:n0,schema:K5,createExecutor:(U)=>{return async(D)=>{return await U.client.reorderProcedureNodes(D)}},formatOutput:n7,getLogMessage:(U)=>`Reordering ${U.moves.length} procedure node(s) in record ${U.recordId.slice(0,8)}`})}function Il($,I){if($>0){if($<0.5)return"high";if($<1.5)return"medium";return"low"}return I>0?"medium":"low"}function uF($,I){g($,I,{definition:o0,schema:v5,createExecutor:(U)=>{return async(D)=>{let A=D.mode??"library",w=D.limit??10;if(D.scope?.type==="artifact"&&A==="library"&&D.workspaceId){let X=await U.client.searchArtifacts({workspaceId:D.workspaceId,query:D.query,artifactType:D.artifactType,artifactStatus:D.artifactStatus,limit:w}),W=X.results.map((Q)=>{let B=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:B,relevance:"high",retrievalHint:{recommended:"overview",usage:`get_content(entityId="${Q.id}")`}}});return{mode:"library",found:W.length,results:W,hasMore:X.hasMore}}let b=await U.client.search({query:D.query,mode:A,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=b.results??[];if(A==="library"){let X=N.map((W)=>{let{bestMatch:Q}=W,B=Il(Q.rank,W.matchCount),Y={entityType:W.entityType,entityId:W.entityId,entityTitle:W.entityTitle,matchCount:W.matchCount,bestBlockId:Q.blockId,snippet:Q.snippet,relevance:B,tags:W.tags,retrievalHint:Q.blockId?{recommended:"blockIds",usage:`blockIds=['${Q.blockId}']`}:{recommended:"overview",usage:"overview=true"}};if(W.literatureMetadata)Y.literatureMetadata=W.literatureMetadata;if(W.creatorId)Y.creatorId=W.creatorId;if(W.creatorName)Y.creatorName=W.creatorName;if(W.updatedAt instanceof Date)Y.updatedAt=W.updatedAt.toISOString().slice(0,10);else if(typeof W.updatedAt==="string")Y.updatedAt=W.updatedAt.slice(0,10);return Y});return{mode:"library",found:X.length,results:X,hasMore:b.hasMore}}let O=N.map((X)=>{let W={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,B=X.creatorName;if(Q)W.creatorId=Q;if(B)W.creatorName=B;return W});return{mode:"blocks",found:O.length,results:O,hasMore:b.hasMore}}},formatOutput:(U)=>P7(U),getLogMessage:(U)=>U.query?`"${U.query}"`:"metadata filters"})}function lF($,I){tb($,I,{definition:d0,schema:F5,createExecutor:(U)=>{return async(D)=>{return U.client.situate(D)}},formatSuccess:R7,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 cF($,I){g($,I,{definition:p0,schema:E5,createExecutor:(U)=>{return async(D)=>{return await U.client.strReplaceBlock(D)}},formatOutput:x7,getLogMessage:(U)=>`${U.entityType}/${U.entityId.slice(0,8)} block ${U.blockId.slice(0,8)}`})}function mF($,I){g($,I,{definition:t0,schema:S5,createExecutor:(U)=>{return async(D)=>{return await U.client.unlinkArtifactFromNode(D)}},formatOutput:w5,getLogMessage:(U)=>`Unlinking artifact link ${U.linkId.slice(0,8)}`})}function rF($,I){g($,I,{definition:S0,schema:z7,createExecutor:(U)=>{return async(D)=>{return await U.client.updateArtifact(D)}},formatOutput:i7,getLogMessage:(U)=>`Updating artifact ${U.id.slice(0,8)}`})}function iF($,I){g($,I,{definition:s0,schema:db,createExecutor:(U)=>{return async(D)=>{return await U.client.updateArtifactLinkRelation(D)}},formatOutput:D5,getLogMessage:(U)=>`Typing artifact link ${U.artifactLinkId.slice(0,8)} as "${U.relationType}"`})}function nF($,I){g($,I,{definition:$A,schema:pb,createExecutor:(U)=>{return async(D)=>{return await U.client.updateEdge(D)}},formatOutput:A5,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 oF($,I){g($,I,{definition:IA,schema:k5,createExecutor:(U)=>{return async(D)=>{return await U.client.updateMatrixRows(D)}},formatOutput:t7,getLogMessage:(U)=>`Updating ${U.updates.length} row target(s) in matrix ${U.matrixId.slice(0,8)}`})}function dF($,I){g($,I,{definition:UA,schema:P5,createExecutor:(U)=>{return async(D)=>{return await U.client.updateProcedureNode(D)}},formatOutput:l7,getLogMessage:(U)=>`Updating procedure node ${U.nodeId.slice(0,8)}`})}function pF($,I){I.log.info("Registering tools..."),uF($,I),kF($,I),lF($,I),cF($,I),RF($,I),TF($,I),vF($,I),FF($,I),KF($,I),VF($,I),qF($,I),PF($,I),hF($,I),zF($,I),_F($,I),dF($,I),yF($,I),jF($,I),HF($,I),oF($,I),SF($,I),fF($,I),EF($,I),LF($,I),gF($,I),MF($,I),rF($,I),CF($,I),ZF($,I),mF($,I),xF($,I),iF($,I),nF($,I),I.log.info("All tools registered")}function Ul(){let $=process.argv.slice(2),I={};for(let U=0;U<$.length;U++){let D=$[U],A=$[U+1];if((D==="--api-key"||D==="-k")&&A)I.apiKey=A,U++;else if((D==="--api-url"||D==="-u")&&A)I.apiUrl=A,U++;else if(D==="--help"||D==="-h")process.exit(0)}return I}D4.info("Starting SURA MCP Server...");var tF=Ul(),aF=tF.apiKey??process.env.SURA_API_KEY,Al=tF.apiUrl??process.env.SURA_API_URL??"https://api.sura.science";if(!aF)D4.error("Missing API key. Set SURA_API_KEY environment variable or use --api-key flag."),D4.error("Get your API key at https://app.sura.science/settings/api-keys"),process.exit(1);var Dl=await Dv({apiUrl:Al,apiKey:aF}),eF=new tW({name:"sura",version:"0.1.0"});pF(eF,Dl);var sF=new eW,$E=async($)=>{D4.info(`Received ${$}, shutting down...`),await sF.close(),process.exit(0)};process.on("SIGTERM",()=>$E("SIGTERM"));process.on("SIGINT",()=>$E("SIGINT"));process.on("uncaughtException",($)=>{D4.error("Uncaught exception:",$)});process.on("unhandledRejection",($)=>{D4.error("Unhandled rejection:",$)});D4.info("Connecting stdio transport...");await eF.connect(sF);D4.info("SURA MCP Server ready");
206
+ - Medium/Low relevance: Start with \`overview=true\` to explore structure first`};var oC=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."),GY={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 q3=W.enum(["image/png","image/jpeg","image/webp","image/gif"]),QY=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:q3.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).")}),ub={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 YY=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 BY=W.object({entityType:o6.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 vY=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`.")}),rb={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 cb={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}},JY=Object.keys(cb),mb=W.enum(JY);function t4(){return JY.map(($)=>`- \`${$}\` — ${cb[$].gloss} Reading: "${cb[$].reading}". e.g. ${cb[$].example}`).join(`
207
+ `)}var kO=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:mb.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:
208
+ ${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.")}),dC=kO.extend({note:W.string().optional()}),ob={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(`
209
+ `)};var EO=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:mb.describe(`The relation predicate. One of the eight ratified, disjoint-from-structural predicates:
210
+ ${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.")}),pC=EO.extend({edgeId:W.string().uuid(),note:W.string().optional()}),db={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(`
211
+ `)};var tC=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)."),aC=W.object({rowIndex:W.number().int().min(0).optional().describe("Target a single row by 0-based index in the current rows array."),rowMatch:tC.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"]}),HY=W.object({matrixId:W.string().uuid().describe("UUID of the target data_matrix."),updates:W.array(aC).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 LY=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 zY=[hb,Pb,B1,ib,nb,Tb,ub,Bb,Fb,kb,Vb,Kb,qb,Mb,Cb,Rb,yb,Lb,_b,tb,lb,jb,vb,pb,zb,Sb,xb,Jb,fb,Eb,Zb,rb,gb,ob,db,GY,pQ,tQ,XY,aQ],eC=zY.map(($)=>$.name),sC=Object.fromEntries(zY.map(($)=>[$.name,$]));function MY($){return{content:[{type:"text",text:$}]}}function VY($){return{content:[{type:"text",text:$}],isError:!0}}function _($,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,B=N(Y);I.log.info(`${D.name}: ${B}`);try{let J=await X(Y),L=w(J,Y);return I.log.info(`${D.name}: completed`),MY(L)}catch(J){let L=J instanceof Error?O(J,Y):"Unknown error";return I.log.error(`${D.name} failed:`,J),VY(`${D.name} error: ${L}`)}})}function SO($,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 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:O(L,B)}],isError:!0};return I.log.info(`${D.name}: found`),MY(w(L,B))}catch(L){let K=L instanceof Error?N(L,B):"Unknown error";return I.log.error(`${D.name} failed:`,L),VY(`${D.name} error: ${K}`)}})}function k3($,I){_($,I,{definition:vb,schema:IQ,createExecutor:(U)=>{return async(D)=>{return await U.client.appendMatrixRows(D)}},formatOutput:gQ,getLogMessage:(U)=>`Appending ${U.rows.length} row(s) to matrix ${U.matrixId.slice(0,8)}`})}function E3($,I){_($,I,{definition:Jb,schema:UQ,createExecutor:(U)=>{return async(D)=>{return await U.client.attachMatrix(D)}},formatOutput:uQ,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:Lb,schema:bQ,createExecutor:(U)=>{return async(D)=>{return await U.client.buildProcedureTree(D)}},formatOutput:fQ,getLogMessage:(U)=>`${U.mode==="replace"?"REPLACE":"append"} procedure tree for record ${U.recordId.slice(0,8)}: ${U.nodes.length} node(s)`})}function j3($,I){_($,I,{definition:Mb,schema:AQ,createExecutor:(U)=>{return async(D)=>{return await U.client.createArtifact(D)}},formatOutput:PQ,getLogMessage:(U)=>`Creating ${U.artifactType} "${U.name.slice(0,30)}"`})}function P3($,I){_($,I,{definition:Vb,schema:wQ,createExecutor:(U)=>{return async(D)=>{return await U.client.createDocument(D)}},formatOutput:zQ,getLogMessage:(U)=>`Creating document: "${U.title.slice(0,30)}${U.title.length>30?"...":""}"`})}function R3($,I){_($,I,{definition:Kb,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 T3($,I){_($,I,{definition:Fb,schema:NQ,createExecutor:(U)=>{return async(D)=>{return await U.client.createMatrixFromArtifact(D)}},formatOutput:KQ,getLogMessage:(U)=>`Deriving matrix from artifact ${U.artifactId.slice(0,8)}`})}function _3($,I){_($,I,{definition:qb,schema:XQ,createExecutor:(U)=>{return async(D)=>{return await U.client.createRecord(D)}},formatOutput:EQ,getLogMessage:(U)=>`Creating record: "${U.title.slice(0,30)}${U.title.length>30?"...":""}"${U.initialTree?` + ${U.initialTree.length} node(s)`:""}`})}function C3($,I){_($,I,{definition:kb,schema:KO,createExecutor:(U)=>{return async(D)=>{return await U.client.deleteBlock(D)}},formatOutput:kQ,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 Z3($,I){_($,I,{definition:Eb,schema:WQ,createExecutor:(U)=>{return async(D)=>{return await U.client.deleteMatrix(D)}},formatOutput:hQ,getLogMessage:(U)=>`Deleting matrix ${U.matrixId.slice(0,8)} (+ block)`})}function f3($,I){_($,I,{definition:Sb,schema:GQ,createExecutor:(U)=>{return async(D)=>{return await U.client.deleteMatrixRows(D)}},formatOutput:xQ,getLogMessage:(U)=>{return`Deleting rows (${U.rowIndices?`${U.rowIndices.length} index(es)`:"match"}) from matrix ${U.matrixId.slice(0,8)}`}})}function g3($,I){_($,I,{definition:jb,schema:QQ,createExecutor:(U)=>{return async(D)=>{return await U.client.deleteProcedureNode(D)}},formatOutput:ZQ,getLogMessage:(U)=>`Deleting procedure node ${U.nodeId.slice(0,8)} (cascade)`})}function y3($,I){SO($,I,{definition:Pb,schema:eQ,createExecutor:(U)=>{return async(D)=>{return U.client.getContent(D)}},formatSuccess:HQ,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 x3($,I){_($,I,{definition:Rb,schema:sQ,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:BQ,getLogMessage:(U)=>U.forceRefresh?"force refresh":"cached"})}function l3($,I){_($,I,{definition:Tb,schema:qO,createExecutor:(U)=>{return async(D)=>{return await U.client.insertBlock(D)}},formatOutput:qQ,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 h3($,I){_($,I,{definition:Bb,schema:$Q,createExecutor:(U)=>{return async(D)=>{return await U.client.insertMatrix(D)}},formatOutput:(U)=>VQ(U),getLogMessage:(U)=>`"${U.label.slice(0,30)}${U.label.length>30?"...":""}"`})}function u3($,I){_($,I,{definition:_b,schema:$Y,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 i3($,I){_($,I,{definition:Cb,schema:IY,createExecutor:(U)=>{return async(D)=>{return await U.client.instantiateArtifactTemplate(D)}},formatOutput:TQ,getLogMessage:(U)=>`Instantiating template ${U.templateId.slice(0,8)} → "${U.name}"`})}function n3($,I){_($,I,{definition:Zb,schema:UY,createExecutor:(U)=>{return async(D)=>{return await U.client.linkArtifactToNode(D)}},formatOutput:nQ,getLogMessage:(U)=>`Linking artifact ${U.artifactId.slice(0,8)} → node ${U.nodeId.slice(0,8)} (${U.role})`})}function r3($,I){_($,I,{definition:fb,schema:bY,createExecutor:(U)=>{return async(D)=>{return await U.client.listMatrixReferences(D)}},formatOutput:iQ,getLogMessage:(U)=>`Listing references for matrix ${U.matrixId.slice(0,8)}`})}function c3($,I){_($,I,{definition:gb,schema:DY,createExecutor:(U)=>{return async(D)=>{return await U.client.listNodeArtifactLinks(D)}},formatOutput:oQ,getLogMessage:(U)=>`Listing artifact links for node ${U.nodeId.slice(0,8)}`})}function m3($,I){_($,I,{definition:yb,schema:AY,createExecutor:(U)=>{return async(D)=>{return await U.client.listProcedureNodes(D)}},formatOutput:dQ,getLogMessage:(U)=>`Listing procedure nodes for record ${U.recordId.slice(0,8)}`})}function o3($,I){let U=wY.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 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 d3($,I){_($,I,{definition:xb,schema:OY,createExecutor:(U)=>{return async(D)=>{return await U.client.rebindMatrixToNode(D)}},formatOutput:lQ,getLogMessage:(U)=>{let D=U.nodeRef?U.nodeRef.slice(0,8):"(body)";return`Rebinding matrix ${U.matrixId.slice(0,8)} → ${D}`}})}function p3($,I){_($,I,{definition:lb,schema:NY,createExecutor:(U)=>{return async(D)=>{return await U.client.reorderProcedureNodes(D)}},formatOutput:CQ,getLogMessage:(U)=>`Reordering ${U.moves.length} procedure node(s) in record ${U.recordId.slice(0,8)}`})}function $Z($,I){if($>0){if($<0.5)return"high";if($<1.5)return"medium";return"low"}return I>0?"medium":"low"}function t3($,I){_($,I,{definition:hb,schema:WY,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=$Z(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: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)=>vQ(U),getLogMessage:(U)=>U.query?`"${U.query}"`:"metadata filters"})}function a3($,I){_($,I,{definition:ub,schema:QY,createExecutor:(U)=>(D)=>U.client.setImage(D),formatOutput:LQ,getLogMessage:(U)=>`${U.entityType}/${U.entityId.slice(0,8)} ${U.blockId?`edit:${U.blockId.slice(0,8)}`:"attach"}${U.dataBase64?" +upload":""}`})}function e3($,I){SO($,I,{definition:ib,schema:YY,createExecutor:(U)=>{return async(D)=>{return U.client.situate(D)}},formatSuccess:JQ,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 s3($,I){_($,I,{definition:nb,schema:BY,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 $M($,I){_($,I,{definition:rb,schema:vY,createExecutor:(U)=>{return async(D)=>{return await U.client.unlinkArtifactFromNode(D)}},formatOutput:mQ,getLogMessage:(U)=>`Unlinking artifact link ${U.linkId.slice(0,8)}`})}function IM($,I){_($,I,{definition:zb,schema:DQ,createExecutor:(U)=>{return async(D)=>{return await U.client.updateArtifact(D)}},formatOutput:_Q,getLogMessage:(U)=>`Updating artifact ${U.id.slice(0,8)}`})}function UM($,I){_($,I,{definition:ob,schema:kO,createExecutor:(U)=>{return async(D)=>{return await U.client.updateArtifactLinkRelation(D)}},formatOutput:cQ,getLogMessage:(U)=>`Typing artifact link ${U.artifactLinkId.slice(0,8)} as "${U.relationType}"`})}function bM($,I){_($,I,{definition:db,schema:EO,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 DM($,I){_($,I,{definition:pb,schema:HY,createExecutor:(U)=>{return async(D)=>{return await U.client.updateMatrixRows(D)}},formatOutput:yQ,getLogMessage:(U)=>`Updating ${U.updates.length} row target(s) in matrix ${U.matrixId.slice(0,8)}`})}function AM($,I){_($,I,{definition:tb,schema:LY,createExecutor:(U)=>{return async(D)=>{return await U.client.updateProcedureNode(D)}},formatOutput:jQ,getLogMessage:(U)=>`Updating procedure node ${U.nodeId.slice(0,8)}`})}function wM($,I){I.log.info("Registering tools..."),t3($,I),y3($,I),o3($,I),e3($,I),s3($,I),l3($,I),a3($,I),h3($,I),T3($,I),C3($,I),P3($,I),R3($,I),_3($,I),x3($,I),m3($,I),S3($,I),u3($,I),AM($,I),p3($,I),g3($,I),k3($,I),DM($,I),f3($,I),d3($,I),Z3($,I),E3($,I),r3($,I),j3($,I),IM($,I),i3($,I),n3($,I),$M($,I),c3($,I),UM($,I),bM($,I),I.log.info("All tools registered")}function IZ(){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}m6.info("Starting SURA MCP Server...");var OM=IZ(),NM=OM.apiKey??process.env.SURA_API_KEY,UZ=OM.apiUrl??process.env.SURA_API_URL??"https://api.sura.science";if(!NM)m6.error("Missing API key. Set SURA_API_KEY environment variable or use --api-key flag."),m6.error("Get your API key at https://app.sura.science/settings/api-keys"),process.exit(1);var bZ=await X3({apiUrl:UZ,apiKey:NM}),XM=new E8({name:"sura",version:"0.1.0"});wM(XM,bZ);var WM=new j8,GM=async($)=>{m6.info(`Received ${$}, shutting down...`),await WM.close(),process.exit(0)};process.on("SIGTERM",()=>GM("SIGTERM"));process.on("SIGINT",()=>GM("SIGINT"));process.on("uncaughtException",($)=>{m6.error("Uncaught exception:",$)});process.on("unhandledRejection",($)=>{m6.error("Unhandled rejection:",$)});m6.info("Connecting stdio transport...");await XM.connect(WM);m6.info("SURA MCP Server ready");