@farthershore/cli 0.29.0 → 0.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +39 -136
- package/dist/index.js +72 -2098
- package/dist/mcp.js +20 -19
- package/package.json +2 -3
package/dist/mcp.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __createRequire } from "node:module";const require=__createRequire(import.meta.url);
|
|
3
|
-
var GR=Object.create;var gp=Object.defineProperty;var KR=Object.getOwnPropertyDescriptor;var WR=Object.getOwnPropertyNames;var JR=Object.getPrototypeOf,YR=Object.prototype.hasOwnProperty;var A=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(n){throw e=0,n}},en=(t,e)=>{for(var n in e)gp(t,n,{get:e[n],enumerable:!0})},XR=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of WR(e))!YR.call(t,r)&&r!==n&&gp(t,r,{get:()=>e[r],enumerable:!(i=KR(e,r))||i.enumerable});return t};var Sy=(t,e,n)=>(n=t!=null?GR(JR(t)):{},XR(e||!t||!t.__esModule?gp(n,"default",{value:t,enumerable:!0}):n,t));var Us=A(ue=>{"use strict";Object.defineProperty(ue,"__esModule",{value:!0});ue.regexpCode=ue.getEsmExportName=ue.getProperty=ue.safeStringify=ue.stringify=ue.strConcat=ue.addCodeArg=ue.str=ue._=ue.nil=ue._Code=ue.Name=ue.IDENTIFIER=ue._CodeOrName=void 0;var Ds=class{};ue._CodeOrName=Ds;ue.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var cr=class extends Ds{constructor(e){if(super(),!ue.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};ue.Name=cr;var St=class extends Ds{constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((n,i)=>`${n}${i}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((n,i)=>(i instanceof cr&&(n[i.str]=(n[i.str]||0)+1),n),{})}};ue._Code=St;ue.nil=new St("");function Dx(t,...e){let n=[t[0]],i=0;for(;i<e.length;)gg(n,e[i]),n.push(t[++i]);return new St(n)}ue._=Dx;var hg=new St("+");function jx(t,...e){let n=[js(t[0])],i=0;for(;i<e.length;)n.push(hg),gg(n,e[i]),n.push(hg,js(t[++i]));return ZN(n),new St(n)}ue.str=jx;function gg(t,e){e instanceof St?t.push(...e._items):e instanceof cr?t.push(e):t.push(qN(e))}ue.addCodeArg=gg;function ZN(t){let e=1;for(;e<t.length-1;){if(t[e]===hg){let n=BN(t[e-1],t[e+1]);if(n!==void 0){t.splice(e-1,3,n);continue}t[e++]="+"}e++}}function BN(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof cr||t[t.length-1]!=='"'?void 0:typeof e!="string"?`${t.slice(0,-1)}${e}"`:e[0]==='"'?t.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(t instanceof cr))return`"${t}${e.slice(1)}`}function FN(t,e){return e.emptyStr()?t:t.emptyStr()?e:jx`${t}${e}`}ue.strConcat=FN;function qN(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:js(Array.isArray(t)?t.join(","):t)}function VN(t){return new St(js(t))}ue.stringify=VN;function js(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}ue.safeStringify=js;function HN(t){return typeof t=="string"&&ue.IDENTIFIER.test(t)?new St(`.${t}`):Dx`[${t}]`}ue.getProperty=HN;function GN(t){if(typeof t=="string"&&ue.IDENTIFIER.test(t))return new St(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}ue.getEsmExportName=GN;function KN(t){return new St(t.toString())}ue.regexpCode=KN});var yg=A(at=>{"use strict";Object.defineProperty(at,"__esModule",{value:!0});at.ValueScope=at.ValueScopeName=at.Scope=at.varKinds=at.UsedValueState=void 0;var st=Us(),bg=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},Yl;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(Yl||(at.UsedValueState=Yl={}));at.varKinds={const:new st.Name("const"),let:new st.Name("let"),var:new st.Name("var")};var Xl=class{constructor({prefixes:e,parent:n}={}){this._names={},this._prefixes=e,this._parent=n}toName(e){return e instanceof st.Name?e:this.name(e)}name(e){return new st.Name(this._newName(e))}_newName(e){let n=this._names[e]||this._nameGroup(e);return`${e}${n.index++}`}_nameGroup(e){var n,i;if(!((i=(n=this._parent)===null||n===void 0?void 0:n._prefixes)===null||i===void 0)&&i.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};at.Scope=Xl;var Ql=class extends st.Name{constructor(e,n){super(n),this.prefix=e}setValue(e,{property:n,itemIndex:i}){this.value=e,this.scopePath=(0,st._)`.${new st.Name(n)}[${i}]`}};at.ValueScopeName=Ql;var WN=(0,st._)`\n`,_g=class extends Xl{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?WN:st.nil}}get(){return this._scope}name(e){return new Ql(e,this._newName(e))}value(e,n){var i;if(n.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let r=this.toName(e),{prefix:o}=r,s=(i=n.key)!==null&&i!==void 0?i:n.ref,c=this._values[o];if(c){let l=c.get(s);if(l)return l}else c=this._values[o]=new Map;c.set(s,r);let u=this._scope[o]||(this._scope[o]=[]),d=u.length;return u[d]=n.ref,r.setValue(n,{property:o,itemIndex:d}),r}getValue(e,n){let i=this._values[e];if(i)return i.get(n)}scopeRefs(e,n=this._values){return this._reduceValues(n,i=>{if(i.scopePath===void 0)throw new Error(`CodeGen: name "${i}" has no value`);return(0,st._)`${e}${i.scopePath}`})}scopeCode(e=this._values,n,i){return this._reduceValues(e,r=>{if(r.value===void 0)throw new Error(`CodeGen: name "${r}" has no value`);return r.value.code},n,i)}_reduceValues(e,n,i={},r){let o=st.nil;for(let s in e){let c=e[s];if(!c)continue;let u=i[s]=i[s]||new Map;c.forEach(d=>{if(u.has(d))return;u.set(d,Yl.Started);let l=n(d);if(l){let p=this.opts.es5?at.varKinds.var:at.varKinds.const;o=(0,st._)`${o}${p} ${d} = ${l};${this.opts._n}`}else if(l=r?.(d))o=(0,st._)`${o}${l}${this.opts._n}`;else throw new bg(d);u.set(d,Yl.Completed)})}return o}};at.ValueScope=_g});var X=A(te=>{"use strict";Object.defineProperty(te,"__esModule",{value:!0});te.or=te.and=te.not=te.CodeGen=te.operators=te.varKinds=te.ValueScopeName=te.ValueScope=te.Scope=te.Name=te.regexpCode=te.stringify=te.getProperty=te.nil=te.strConcat=te.str=te._=void 0;var oe=Us(),zt=yg(),Cn=Us();Object.defineProperty(te,"_",{enumerable:!0,get:function(){return Cn._}});Object.defineProperty(te,"str",{enumerable:!0,get:function(){return Cn.str}});Object.defineProperty(te,"strConcat",{enumerable:!0,get:function(){return Cn.strConcat}});Object.defineProperty(te,"nil",{enumerable:!0,get:function(){return Cn.nil}});Object.defineProperty(te,"getProperty",{enumerable:!0,get:function(){return Cn.getProperty}});Object.defineProperty(te,"stringify",{enumerable:!0,get:function(){return Cn.stringify}});Object.defineProperty(te,"regexpCode",{enumerable:!0,get:function(){return Cn.regexpCode}});Object.defineProperty(te,"Name",{enumerable:!0,get:function(){return Cn.Name}});var rd=yg();Object.defineProperty(te,"Scope",{enumerable:!0,get:function(){return rd.Scope}});Object.defineProperty(te,"ValueScope",{enumerable:!0,get:function(){return rd.ValueScope}});Object.defineProperty(te,"ValueScopeName",{enumerable:!0,get:function(){return rd.ValueScopeName}});Object.defineProperty(te,"varKinds",{enumerable:!0,get:function(){return rd.varKinds}});te.operators={GT:new oe._Code(">"),GTE:new oe._Code(">="),LT:new oe._Code("<"),LTE:new oe._Code("<="),EQ:new oe._Code("==="),NEQ:new oe._Code("!=="),NOT:new oe._Code("!"),OR:new oe._Code("||"),AND:new oe._Code("&&"),ADD:new oe._Code("+")};var cn=class{optimizeNodes(){return this}optimizeNames(e,n){return this}},vg=class extends cn{constructor(e,n,i){super(),this.varKind=e,this.name=n,this.rhs=i}render({es5:e,_n:n}){let i=e?zt.varKinds.var:this.varKind,r=this.rhs===void 0?"":` = ${this.rhs}`;return`${i} ${this.name}${r};`+n}optimizeNames(e,n){if(e[this.name.str])return this.rhs&&(this.rhs=Ti(this.rhs,e,n)),this}get names(){return this.rhs instanceof oe._CodeOrName?this.rhs.names:{}}},ed=class extends cn{constructor(e,n,i){super(),this.lhs=e,this.rhs=n,this.sideEffects=i}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,n){if(!(this.lhs instanceof oe.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=Ti(this.rhs,e,n),this}get names(){let e=this.lhs instanceof oe.Name?{}:{...this.lhs.names};return nd(e,this.rhs)}},kg=class extends ed{constructor(e,n,i,r){super(e,i,r),this.op=n}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},Sg=class extends cn{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},xg=class extends cn{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},Ig=class extends cn{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},$g=class extends cn{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,n){return this.code=Ti(this.code,e,n),this}get names(){return this.code instanceof oe._CodeOrName?this.code.names:{}}},Ms=class extends cn{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((n,i)=>n+i.render(e),"")}optimizeNodes(){let{nodes:e}=this,n=e.length;for(;n--;){let i=e[n].optimizeNodes();Array.isArray(i)?e.splice(n,1,...i):i?e[n]=i:e.splice(n,1)}return e.length>0?this:void 0}optimizeNames(e,n){let{nodes:i}=this,r=i.length;for(;r--;){let o=i[r];o.optimizeNames(e,n)||(JN(e,o.names),i.splice(r,1))}return i.length>0?this:void 0}get names(){return this.nodes.reduce((e,n)=>dr(e,n.names),{})}},un=class extends Ms{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},wg=class extends Ms{},Ei=class extends un{};Ei.kind="else";var ur=class t extends un{constructor(e,n){super(n),this.condition=e}render(e){let n=`if(${this.condition})`+super.render(e);return this.else&&(n+="else "+this.else.render(e)),n}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let n=this.else;if(n){let i=n.optimizeNodes();n=this.else=Array.isArray(i)?new Ei(i):i}if(n)return e===!1?n instanceof t?n:n.nodes:this.nodes.length?this:new t(Ux(e),n instanceof t?[n]:n.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,n){var i;if(this.else=(i=this.else)===null||i===void 0?void 0:i.optimizeNames(e,n),!!(super.optimizeNames(e,n)||this.else))return this.condition=Ti(this.condition,e,n),this}get names(){let e=super.names;return nd(e,this.condition),this.else&&dr(e,this.else.names),e}};ur.kind="if";var lr=class extends un{};lr.kind="for";var Eg=class extends lr{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,n){if(super.optimizeNames(e,n))return this.iteration=Ti(this.iteration,e,n),this}get names(){return dr(super.names,this.iteration.names)}},Tg=class extends lr{constructor(e,n,i,r){super(),this.varKind=e,this.name=n,this.from=i,this.to=r}render(e){let n=e.es5?zt.varKinds.var:this.varKind,{name:i,from:r,to:o}=this;return`for(${n} ${i}=${r}; ${i}<${o}; ${i}++)`+super.render(e)}get names(){let e=nd(super.names,this.from);return nd(e,this.to)}},td=class extends lr{constructor(e,n,i,r){super(),this.loop=e,this.varKind=n,this.name=i,this.iterable=r}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,n){if(super.optimizeNames(e,n))return this.iterable=Ti(this.iterable,e,n),this}get names(){return dr(super.names,this.iterable.names)}},Ls=class extends un{constructor(e,n,i){super(),this.name=e,this.args=n,this.async=i}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};Ls.kind="func";var Zs=class extends Ms{render(e){return"return "+super.render(e)}};Zs.kind="return";var Rg=class extends un{render(e){let n="try"+super.render(e);return this.catch&&(n+=this.catch.render(e)),this.finally&&(n+=this.finally.render(e)),n}optimizeNodes(){var e,n;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(n=this.finally)===null||n===void 0||n.optimizeNodes(),this}optimizeNames(e,n){var i,r;return super.optimizeNames(e,n),(i=this.catch)===null||i===void 0||i.optimizeNames(e,n),(r=this.finally)===null||r===void 0||r.optimizeNames(e,n),this}get names(){let e=super.names;return this.catch&&dr(e,this.catch.names),this.finally&&dr(e,this.finally.names),e}},Bs=class extends un{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};Bs.kind="catch";var Fs=class extends un{render(e){return"finally"+super.render(e)}};Fs.kind="finally";var Og=class{constructor(e,n={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...n,_n:n.lines?`
|
|
4
|
-
`:""},this._extScope=e,this._scope=new zt.Scope({parent:e}),this._nodes=[new wg]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,n){let i=this._extScope.value(e,n);return(this._values[i.prefix]||(this._values[i.prefix]=new Set)).add(i),i}getScopeValue(e,n){return this._extScope.getValue(e,n)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,n,i,r){let o=this._scope.toName(n);return i!==void 0&&r&&(this._constants[o.str]=i),this._leafNode(new vg(e,o,i)),o}const(e,n,i){return this._def(zt.varKinds.const,e,n,i)}let(e,n,i){return this._def(zt.varKinds.let,e,n,i)}var(e,n,i){return this._def(zt.varKinds.var,e,n,i)}assign(e,n,i){return this._leafNode(new ed(e,n,i))}add(e,n){return this._leafNode(new kg(e,te.operators.ADD,n))}code(e){return typeof e=="function"?e():e!==oe.nil&&this._leafNode(new $g(e)),this}object(...e){let n=["{"];for(let[i,r]of e)n.length>1&&n.push(","),n.push(i),(i!==r||this.opts.es5)&&(n.push(":"),(0,oe.addCodeArg)(n,r));return n.push("}"),new oe._Code(n)}if(e,n,i){if(this._blockNode(new ur(e)),n&&i)this.code(n).else().code(i).endIf();else if(n)this.code(n).endIf();else if(i)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new ur(e))}else(){return this._elseNode(new Ei)}endIf(){return this._endBlockNode(ur,Ei)}_for(e,n){return this._blockNode(e),n&&this.code(n).endFor(),this}for(e,n){return this._for(new Eg(e),n)}forRange(e,n,i,r,o=this.opts.es5?zt.varKinds.var:zt.varKinds.let){let s=this._scope.toName(e);return this._for(new Tg(o,s,n,i),()=>r(s))}forOf(e,n,i,r=zt.varKinds.const){let o=this._scope.toName(e);if(this.opts.es5){let s=n instanceof oe.Name?n:this.var("_arr",n);return this.forRange("_i",0,(0,oe._)`${s}.length`,c=>{this.var(o,(0,oe._)`${s}[${c}]`),i(o)})}return this._for(new td("of",r,o,n),()=>i(o))}forIn(e,n,i,r=this.opts.es5?zt.varKinds.var:zt.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,oe._)`Object.keys(${n})`,i);let o=this._scope.toName(e);return this._for(new td("in",r,o,n),()=>i(o))}endFor(){return this._endBlockNode(lr)}label(e){return this._leafNode(new Sg(e))}break(e){return this._leafNode(new xg(e))}return(e){let n=new Zs;if(this._blockNode(n),this.code(e),n.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Zs)}try(e,n,i){if(!n&&!i)throw new Error('CodeGen: "try" without "catch" and "finally"');let r=new Rg;if(this._blockNode(r),this.code(e),n){let o=this.name("e");this._currNode=r.catch=new Bs(o),n(o)}return i&&(this._currNode=r.finally=new Fs,this.code(i)),this._endBlockNode(Bs,Fs)}throw(e){return this._leafNode(new Ig(e))}block(e,n){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(n),this}endBlock(e){let n=this._blockStarts.pop();if(n===void 0)throw new Error("CodeGen: not in self-balancing block");let i=this._nodes.length-n;if(i<0||e!==void 0&&i!==e)throw new Error(`CodeGen: wrong number of nodes: ${i} vs ${e} expected`);return this._nodes.length=n,this}func(e,n=oe.nil,i,r){return this._blockNode(new Ls(e,n,i)),r&&this.code(r).endFunc(),this}endFunc(){return this._endBlockNode(Ls)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,n){let i=this._currNode;if(i instanceof e||n&&i instanceof n)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${n?`${e.kind}/${n.kind}`:e.kind}"`)}_elseNode(e){let n=this._currNode;if(!(n instanceof ur))throw new Error('CodeGen: "else" without "if"');return this._currNode=n.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let n=this._nodes;n[n.length-1]=e}};te.CodeGen=Og;function dr(t,e){for(let n in e)t[n]=(t[n]||0)+(e[n]||0);return t}function nd(t,e){return e instanceof oe._CodeOrName?dr(t,e.names):t}function Ti(t,e,n){if(t instanceof oe.Name)return i(t);if(!r(t))return t;return new oe._Code(t._items.reduce((o,s)=>(s instanceof oe.Name&&(s=i(s)),s instanceof oe._Code?o.push(...s._items):o.push(s),o),[]));function i(o){let s=n[o.str];return s===void 0||e[o.str]!==1?o:(delete e[o.str],s)}function r(o){return o instanceof oe._Code&&o._items.some(s=>s instanceof oe.Name&&e[s.str]===1&&n[s.str]!==void 0)}}function JN(t,e){for(let n in e)t[n]=(t[n]||0)-(e[n]||0)}function Ux(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,oe._)`!${Pg(t)}`}te.not=Ux;var YN=Mx(te.operators.AND);function XN(...t){return t.reduce(YN)}te.and=XN;var QN=Mx(te.operators.OR);function eC(...t){return t.reduce(QN)}te.or=eC;function Mx(t){return(e,n)=>e===oe.nil?n:n===oe.nil?e:(0,oe._)`${Pg(e)} ${t} ${Pg(n)}`}function Pg(t){return t instanceof oe.Name?t:(0,oe._)`(${t})`}});var se=A(ne=>{"use strict";Object.defineProperty(ne,"__esModule",{value:!0});ne.checkStrictMode=ne.getErrorPath=ne.Type=ne.useFunc=ne.setEvaluated=ne.evaluatedPropsToName=ne.mergeEvaluated=ne.eachItem=ne.unescapeJsonPointer=ne.escapeJsonPointer=ne.escapeFragment=ne.unescapeFragment=ne.schemaRefOrVal=ne.schemaHasRulesButRef=ne.schemaHasRules=ne.checkUnknownRules=ne.alwaysValidSchema=ne.toHash=void 0;var Se=X(),tC=Us();function nC(t){let e={};for(let n of t)e[n]=!0;return e}ne.toHash=nC;function rC(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(Bx(t,e),!Fx(e,t.self.RULES.all))}ne.alwaysValidSchema=rC;function Bx(t,e=t.schema){let{opts:n,self:i}=t;if(!n.strictSchema||typeof e=="boolean")return;let r=i.RULES.keywords;for(let o in e)r[o]||Hx(t,`unknown keyword: "${o}"`)}ne.checkUnknownRules=Bx;function Fx(t,e){if(typeof t=="boolean")return!t;for(let n in t)if(e[n])return!0;return!1}ne.schemaHasRules=Fx;function iC(t,e){if(typeof t=="boolean")return!t;for(let n in t)if(n!=="$ref"&&e.all[n])return!0;return!1}ne.schemaHasRulesButRef=iC;function oC({topSchemaRef:t,schemaPath:e},n,i,r){if(!r){if(typeof n=="number"||typeof n=="boolean")return n;if(typeof n=="string")return(0,Se._)`${n}`}return(0,Se._)`${t}${e}${(0,Se.getProperty)(i)}`}ne.schemaRefOrVal=oC;function sC(t){return qx(decodeURIComponent(t))}ne.unescapeFragment=sC;function aC(t){return encodeURIComponent(Ng(t))}ne.escapeFragment=aC;function Ng(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}ne.escapeJsonPointer=Ng;function qx(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}ne.unescapeJsonPointer=qx;function cC(t,e){if(Array.isArray(t))for(let n of t)e(n);else e(t)}ne.eachItem=cC;function Lx({mergeNames:t,mergeToName:e,mergeValues:n,resultToName:i}){return(r,o,s,c)=>{let u=s===void 0?o:s instanceof Se.Name?(o instanceof Se.Name?t(r,o,s):e(r,o,s),s):o instanceof Se.Name?(e(r,s,o),o):n(o,s);return c===Se.Name&&!(u instanceof Se.Name)?i(r,u):u}}ne.mergeEvaluated={props:Lx({mergeNames:(t,e,n)=>t.if((0,Se._)`${n} !== true && ${e} !== undefined`,()=>{t.if((0,Se._)`${e} === true`,()=>t.assign(n,!0),()=>t.assign(n,(0,Se._)`${n} || {}`).code((0,Se._)`Object.assign(${n}, ${e})`))}),mergeToName:(t,e,n)=>t.if((0,Se._)`${n} !== true`,()=>{e===!0?t.assign(n,!0):(t.assign(n,(0,Se._)`${n} || {}`),Cg(t,n,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:Vx}),items:Lx({mergeNames:(t,e,n)=>t.if((0,Se._)`${n} !== true && ${e} !== undefined`,()=>t.assign(n,(0,Se._)`${e} === true ? true : ${n} > ${e} ? ${n} : ${e}`)),mergeToName:(t,e,n)=>t.if((0,Se._)`${n} !== true`,()=>t.assign(n,e===!0?!0:(0,Se._)`${n} > ${e} ? ${n} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function Vx(t,e){if(e===!0)return t.var("props",!0);let n=t.var("props",(0,Se._)`{}`);return e!==void 0&&Cg(t,n,e),n}ne.evaluatedPropsToName=Vx;function Cg(t,e,n){Object.keys(n).forEach(i=>t.assign((0,Se._)`${e}${(0,Se.getProperty)(i)}`,!0))}ne.setEvaluated=Cg;var Zx={};function uC(t,e){return t.scopeValue("func",{ref:e,code:Zx[e.code]||(Zx[e.code]=new tC._Code(e.code))})}ne.useFunc=uC;var Ag;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(Ag||(ne.Type=Ag={}));function lC(t,e,n){if(t instanceof Se.Name){let i=e===Ag.Num;return n?i?(0,Se._)`"[" + ${t} + "]"`:(0,Se._)`"['" + ${t} + "']"`:i?(0,Se._)`"/" + ${t}`:(0,Se._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return n?(0,Se.getProperty)(t).toString():"/"+Ng(t)}ne.getErrorPath=lC;function Hx(t,e,n=t.opts.strictSchema){if(n){if(e=`strict mode: ${e}`,n===!0)throw new Error(e);t.self.logger.warn(e)}}ne.checkStrictMode=Hx});var ln=A(zg=>{"use strict";Object.defineProperty(zg,"__esModule",{value:!0});var Ve=X(),dC={data:new Ve.Name("data"),valCxt:new Ve.Name("valCxt"),instancePath:new Ve.Name("instancePath"),parentData:new Ve.Name("parentData"),parentDataProperty:new Ve.Name("parentDataProperty"),rootData:new Ve.Name("rootData"),dynamicAnchors:new Ve.Name("dynamicAnchors"),vErrors:new Ve.Name("vErrors"),errors:new Ve.Name("errors"),this:new Ve.Name("this"),self:new Ve.Name("self"),scope:new Ve.Name("scope"),json:new Ve.Name("json"),jsonPos:new Ve.Name("jsonPos"),jsonLen:new Ve.Name("jsonLen"),jsonPart:new Ve.Name("jsonPart")};zg.default=dC});var qs=A(He=>{"use strict";Object.defineProperty(He,"__esModule",{value:!0});He.extendErrors=He.resetErrorsCount=He.reportExtraError=He.reportError=He.keyword$DataError=He.keywordError=void 0;var ae=X(),id=se(),Qe=ln();He.keywordError={message:({keyword:t})=>(0,ae.str)`must pass "${t}" keyword validation`};He.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,ae.str)`"${t}" keyword must be ${e} ($data)`:(0,ae.str)`"${t}" keyword is invalid ($data)`};function pC(t,e=He.keywordError,n,i){let{it:r}=t,{gen:o,compositeRule:s,allErrors:c}=r,u=Wx(t,e,n);i??(s||c)?Gx(o,u):Kx(r,(0,ae._)`[${u}]`)}He.reportError=pC;function mC(t,e=He.keywordError,n){let{it:i}=t,{gen:r,compositeRule:o,allErrors:s}=i,c=Wx(t,e,n);Gx(r,c),o||s||Kx(i,Qe.default.vErrors)}He.reportExtraError=mC;function fC(t,e){t.assign(Qe.default.errors,e),t.if((0,ae._)`${Qe.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,ae._)`${Qe.default.vErrors}.length`,e),()=>t.assign(Qe.default.vErrors,null)))}He.resetErrorsCount=fC;function hC({gen:t,keyword:e,schemaValue:n,data:i,errsCount:r,it:o}){if(r===void 0)throw new Error("ajv implementation error");let s=t.name("err");t.forRange("i",r,Qe.default.errors,c=>{t.const(s,(0,ae._)`${Qe.default.vErrors}[${c}]`),t.if((0,ae._)`${s}.instancePath === undefined`,()=>t.assign((0,ae._)`${s}.instancePath`,(0,ae.strConcat)(Qe.default.instancePath,o.errorPath))),t.assign((0,ae._)`${s}.schemaPath`,(0,ae.str)`${o.errSchemaPath}/${e}`),o.opts.verbose&&(t.assign((0,ae._)`${s}.schema`,n),t.assign((0,ae._)`${s}.data`,i))})}He.extendErrors=hC;function Gx(t,e){let n=t.const("err",e);t.if((0,ae._)`${Qe.default.vErrors} === null`,()=>t.assign(Qe.default.vErrors,(0,ae._)`[${n}]`),(0,ae._)`${Qe.default.vErrors}.push(${n})`),t.code((0,ae._)`${Qe.default.errors}++`)}function Kx(t,e){let{gen:n,validateName:i,schemaEnv:r}=t;r.$async?n.throw((0,ae._)`new ${t.ValidationError}(${e})`):(n.assign((0,ae._)`${i}.errors`,e),n.return(!1))}var pr={keyword:new ae.Name("keyword"),schemaPath:new ae.Name("schemaPath"),params:new ae.Name("params"),propertyName:new ae.Name("propertyName"),message:new ae.Name("message"),schema:new ae.Name("schema"),parentSchema:new ae.Name("parentSchema")};function Wx(t,e,n){let{createErrors:i}=t.it;return i===!1?(0,ae._)`{}`:gC(t,e,n)}function gC(t,e,n={}){let{gen:i,it:r}=t,o=[bC(r,n),_C(t,n)];return yC(t,e,o),i.object(...o)}function bC({errorPath:t},{instancePath:e}){let n=e?(0,ae.str)`${t}${(0,id.getErrorPath)(e,id.Type.Str)}`:t;return[Qe.default.instancePath,(0,ae.strConcat)(Qe.default.instancePath,n)]}function _C({keyword:t,it:{errSchemaPath:e}},{schemaPath:n,parentSchema:i}){let r=i?e:(0,ae.str)`${e}/${t}`;return n&&(r=(0,ae.str)`${r}${(0,id.getErrorPath)(n,id.Type.Str)}`),[pr.schemaPath,r]}function yC(t,{params:e,message:n},i){let{keyword:r,data:o,schemaValue:s,it:c}=t,{opts:u,propertyName:d,topSchemaRef:l,schemaPath:p}=c;i.push([pr.keyword,r],[pr.params,typeof e=="function"?e(t):e||(0,ae._)`{}`]),u.messages&&i.push([pr.message,typeof n=="function"?n(t):n]),u.verbose&&i.push([pr.schema,s],[pr.parentSchema,(0,ae._)`${l}${p}`],[Qe.default.data,o]),d&&i.push([pr.propertyName,d])}});var Yx=A(Ri=>{"use strict";Object.defineProperty(Ri,"__esModule",{value:!0});Ri.boolOrEmptySchema=Ri.topBoolOrEmptySchema=void 0;var vC=qs(),kC=X(),SC=ln(),xC={message:"boolean schema is false"};function IC(t){let{gen:e,schema:n,validateName:i}=t;n===!1?Jx(t,!1):typeof n=="object"&&n.$async===!0?e.return(SC.default.data):(e.assign((0,kC._)`${i}.errors`,null),e.return(!0))}Ri.topBoolOrEmptySchema=IC;function $C(t,e){let{gen:n,schema:i}=t;i===!1?(n.var(e,!1),Jx(t)):n.var(e,!0)}Ri.boolOrEmptySchema=$C;function Jx(t,e){let{gen:n,data:i}=t,r={gen:n,keyword:"false schema",data:i,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,vC.reportError)(r,xC,void 0,e)}});var Dg=A(Oi=>{"use strict";Object.defineProperty(Oi,"__esModule",{value:!0});Oi.getRules=Oi.isJSONType=void 0;var wC=["string","number","integer","boolean","null","object","array"],EC=new Set(wC);function TC(t){return typeof t=="string"&&EC.has(t)}Oi.isJSONType=TC;function RC(){let t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}Oi.getRules=RC});var jg=A(zn=>{"use strict";Object.defineProperty(zn,"__esModule",{value:!0});zn.shouldUseRule=zn.shouldUseGroup=zn.schemaHasRulesForType=void 0;function OC({schema:t,self:e},n){let i=e.RULES.types[n];return i&&i!==!0&&Xx(t,i)}zn.schemaHasRulesForType=OC;function Xx(t,e){return e.rules.some(n=>Qx(t,n))}zn.shouldUseGroup=Xx;function Qx(t,e){var n;return t[e.keyword]!==void 0||((n=e.definition.implements)===null||n===void 0?void 0:n.some(i=>t[i]!==void 0))}zn.shouldUseRule=Qx});var Vs=A(Ge=>{"use strict";Object.defineProperty(Ge,"__esModule",{value:!0});Ge.reportTypeError=Ge.checkDataTypes=Ge.checkDataType=Ge.coerceAndCheckDataType=Ge.getJSONTypes=Ge.getSchemaTypes=Ge.DataType=void 0;var PC=Dg(),AC=jg(),NC=qs(),Y=X(),eI=se(),Pi;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(Pi||(Ge.DataType=Pi={}));function CC(t){let e=tI(t.type);if(e.includes("null")){if(t.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&t.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');t.nullable===!0&&e.push("null")}return e}Ge.getSchemaTypes=CC;function tI(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(PC.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}Ge.getJSONTypes=tI;function zC(t,e){let{gen:n,data:i,opts:r}=t,o=DC(e,r.coerceTypes),s=e.length>0&&!(o.length===0&&e.length===1&&(0,AC.schemaHasRulesForType)(t,e[0]));if(s){let c=Mg(e,i,r.strictNumbers,Pi.Wrong);n.if(c,()=>{o.length?jC(t,e,o):Lg(t)})}return s}Ge.coerceAndCheckDataType=zC;var nI=new Set(["string","number","integer","boolean","null"]);function DC(t,e){return e?t.filter(n=>nI.has(n)||e==="array"&&n==="array"):[]}function jC(t,e,n){let{gen:i,data:r,opts:o}=t,s=i.let("dataType",(0,Y._)`typeof ${r}`),c=i.let("coerced",(0,Y._)`undefined`);o.coerceTypes==="array"&&i.if((0,Y._)`${s} == 'object' && Array.isArray(${r}) && ${r}.length == 1`,()=>i.assign(r,(0,Y._)`${r}[0]`).assign(s,(0,Y._)`typeof ${r}`).if(Mg(e,r,o.strictNumbers),()=>i.assign(c,r))),i.if((0,Y._)`${c} !== undefined`);for(let d of n)(nI.has(d)||d==="array"&&o.coerceTypes==="array")&&u(d);i.else(),Lg(t),i.endIf(),i.if((0,Y._)`${c} !== undefined`,()=>{i.assign(r,c),UC(t,c)});function u(d){switch(d){case"string":i.elseIf((0,Y._)`${s} == "number" || ${s} == "boolean"`).assign(c,(0,Y._)`"" + ${r}`).elseIf((0,Y._)`${r} === null`).assign(c,(0,Y._)`""`);return;case"number":i.elseIf((0,Y._)`${s} == "boolean" || ${r} === null
|
|
3
|
+
var TO=Object.create;var Np=Object.defineProperty;var RO=Object.getOwnPropertyDescriptor;var OO=Object.getOwnPropertyNames;var PO=Object.getPrototypeOf,AO=Object.prototype.hasOwnProperty;var N=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(n){throw e=0,n}},nn=(t,e)=>{for(var n in e)Np(t,n,{get:e[n],enumerable:!0})},NO=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of OO(e))!AO.call(t,r)&&r!==n&&Np(t,r,{get:()=>e[r],enumerable:!(i=RO(e,r))||i.enumerable});return t};var q_=(t,e,n)=>(n=t!=null?TO(PO(t)):{},NO(e||!t||!t.__esModule?Np(n,"default",{value:t,enumerable:!0}):n,t));var qs=N(ue=>{"use strict";Object.defineProperty(ue,"__esModule",{value:!0});ue.regexpCode=ue.getEsmExportName=ue.getProperty=ue.safeStringify=ue.stringify=ue.strConcat=ue.addCodeArg=ue.str=ue._=ue.nil=ue._Code=ue.Name=ue.IDENTIFIER=ue._CodeOrName=void 0;var Fs=class{};ue._CodeOrName=Fs;ue.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var hr=class extends Fs{constructor(e){if(super(),!ue.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};ue.Name=hr;var St=class extends Fs{constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((n,i)=>`${n}${i}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((n,i)=>(i instanceof hr&&(n[i.str]=(n[i.str]||0)+1),n),{})}};ue._Code=St;ue.nil=new St("");function oI(t,...e){let n=[t[0]],i=0;for(;i<e.length;)Nh(n,e[i]),n.push(t[++i]);return new St(n)}ue._=oI;var Ah=new St("+");function sI(t,...e){let n=[Vs(t[0])],i=0;for(;i<e.length;)n.push(Ah),Nh(n,e[i]),n.push(Ah,Vs(t[++i]));return SC(n),new St(n)}ue.str=sI;function Nh(t,e){e instanceof St?t.push(...e._items):e instanceof hr?t.push(e):t.push($C(e))}ue.addCodeArg=Nh;function SC(t){let e=1;for(;e<t.length-1;){if(t[e]===Ah){let n=xC(t[e-1],t[e+1]);if(n!==void 0){t.splice(e-1,3,n);continue}t[e++]="+"}e++}}function xC(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof hr||t[t.length-1]!=='"'?void 0:typeof e!="string"?`${t.slice(0,-1)}${e}"`:e[0]==='"'?t.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(t instanceof hr))return`"${t}${e.slice(1)}`}function IC(t,e){return e.emptyStr()?t:t.emptyStr()?e:sI`${t}${e}`}ue.strConcat=IC;function $C(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:Vs(Array.isArray(t)?t.join(","):t)}function wC(t){return new St(Vs(t))}ue.stringify=wC;function Vs(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}ue.safeStringify=Vs;function EC(t){return typeof t=="string"&&ue.IDENTIFIER.test(t)?new St(`.${t}`):oI`[${t}]`}ue.getProperty=EC;function TC(t){if(typeof t=="string"&&ue.IDENTIFIER.test(t))return new St(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}ue.getEsmExportName=TC;function RC(t){return new St(t.toString())}ue.regexpCode=RC});var Dh=N(lt=>{"use strict";Object.defineProperty(lt,"__esModule",{value:!0});lt.ValueScope=lt.ValueScopeName=lt.Scope=lt.varKinds=lt.UsedValueState=void 0;var ut=qs(),Ch=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},ad;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(ad||(lt.UsedValueState=ad={}));lt.varKinds={const:new ut.Name("const"),let:new ut.Name("let"),var:new ut.Name("var")};var cd=class{constructor({prefixes:e,parent:n}={}){this._names={},this._prefixes=e,this._parent=n}toName(e){return e instanceof ut.Name?e:this.name(e)}name(e){return new ut.Name(this._newName(e))}_newName(e){let n=this._names[e]||this._nameGroup(e);return`${e}${n.index++}`}_nameGroup(e){var n,i;if(!((i=(n=this._parent)===null||n===void 0?void 0:n._prefixes)===null||i===void 0)&&i.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};lt.Scope=cd;var ud=class extends ut.Name{constructor(e,n){super(n),this.prefix=e}setValue(e,{property:n,itemIndex:i}){this.value=e,this.scopePath=(0,ut._)`.${new ut.Name(n)}[${i}]`}};lt.ValueScopeName=ud;var OC=(0,ut._)`\n`,zh=class extends cd{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?OC:ut.nil}}get(){return this._scope}name(e){return new ud(e,this._newName(e))}value(e,n){var i;if(n.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let r=this.toName(e),{prefix:o}=r,s=(i=n.key)!==null&&i!==void 0?i:n.ref,c=this._values[o];if(c){let p=c.get(s);if(p)return p}else c=this._values[o]=new Map;c.set(s,r);let u=this._scope[o]||(this._scope[o]=[]),l=u.length;return u[l]=n.ref,r.setValue(n,{property:o,itemIndex:l}),r}getValue(e,n){let i=this._values[e];if(i)return i.get(n)}scopeRefs(e,n=this._values){return this._reduceValues(n,i=>{if(i.scopePath===void 0)throw new Error(`CodeGen: name "${i}" has no value`);return(0,ut._)`${e}${i.scopePath}`})}scopeCode(e=this._values,n,i){return this._reduceValues(e,r=>{if(r.value===void 0)throw new Error(`CodeGen: name "${r}" has no value`);return r.value.code},n,i)}_reduceValues(e,n,i={},r){let o=ut.nil;for(let s in e){let c=e[s];if(!c)continue;let u=i[s]=i[s]||new Map;c.forEach(l=>{if(u.has(l))return;u.set(l,ad.Started);let p=n(l);if(p){let d=this.opts.es5?lt.varKinds.var:lt.varKinds.const;o=(0,ut._)`${o}${d} ${l} = ${p};${this.opts._n}`}else if(p=r?.(l))o=(0,ut._)`${o}${p}${this.opts._n}`;else throw new Ch(l);u.set(l,ad.Completed)})}return o}};lt.ValueScope=zh});var X=N(te=>{"use strict";Object.defineProperty(te,"__esModule",{value:!0});te.or=te.and=te.not=te.CodeGen=te.operators=te.varKinds=te.ValueScopeName=te.ValueScope=te.Scope=te.Name=te.regexpCode=te.stringify=te.getProperty=te.nil=te.strConcat=te.str=te._=void 0;var oe=qs(),zt=Dh(),jn=qs();Object.defineProperty(te,"_",{enumerable:!0,get:function(){return jn._}});Object.defineProperty(te,"str",{enumerable:!0,get:function(){return jn.str}});Object.defineProperty(te,"strConcat",{enumerable:!0,get:function(){return jn.strConcat}});Object.defineProperty(te,"nil",{enumerable:!0,get:function(){return jn.nil}});Object.defineProperty(te,"getProperty",{enumerable:!0,get:function(){return jn.getProperty}});Object.defineProperty(te,"stringify",{enumerable:!0,get:function(){return jn.stringify}});Object.defineProperty(te,"regexpCode",{enumerable:!0,get:function(){return jn.regexpCode}});Object.defineProperty(te,"Name",{enumerable:!0,get:function(){return jn.Name}});var md=Dh();Object.defineProperty(te,"Scope",{enumerable:!0,get:function(){return md.Scope}});Object.defineProperty(te,"ValueScope",{enumerable:!0,get:function(){return md.ValueScope}});Object.defineProperty(te,"ValueScopeName",{enumerable:!0,get:function(){return md.ValueScopeName}});Object.defineProperty(te,"varKinds",{enumerable:!0,get:function(){return md.varKinds}});te.operators={GT:new oe._Code(">"),GTE:new oe._Code(">="),LT:new oe._Code("<"),LTE:new oe._Code("<="),EQ:new oe._Code("==="),NEQ:new oe._Code("!=="),NOT:new oe._Code("!"),OR:new oe._Code("||"),AND:new oe._Code("&&"),ADD:new oe._Code("+")};var ln=class{optimizeNodes(){return this}optimizeNames(e,n){return this}},jh=class extends ln{constructor(e,n,i){super(),this.varKind=e,this.name=n,this.rhs=i}render({es5:e,_n:n}){let i=e?zt.varKinds.var:this.varKind,r=this.rhs===void 0?"":` = ${this.rhs}`;return`${i} ${this.name}${r};`+n}optimizeNames(e,n){if(e[this.name.str])return this.rhs&&(this.rhs=zi(this.rhs,e,n)),this}get names(){return this.rhs instanceof oe._CodeOrName?this.rhs.names:{}}},ld=class extends ln{constructor(e,n,i){super(),this.lhs=e,this.rhs=n,this.sideEffects=i}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,n){if(!(this.lhs instanceof oe.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=zi(this.rhs,e,n),this}get names(){let e=this.lhs instanceof oe.Name?{}:{...this.lhs.names};return pd(e,this.rhs)}},Uh=class extends ld{constructor(e,n,i,r){super(e,i,r),this.op=n}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},Mh=class extends ln{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},Lh=class extends ln{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},Zh=class extends ln{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},Bh=class extends ln{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,n){return this.code=zi(this.code,e,n),this}get names(){return this.code instanceof oe._CodeOrName?this.code.names:{}}},Hs=class extends ln{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((n,i)=>n+i.render(e),"")}optimizeNodes(){let{nodes:e}=this,n=e.length;for(;n--;){let i=e[n].optimizeNodes();Array.isArray(i)?e.splice(n,1,...i):i?e[n]=i:e.splice(n,1)}return e.length>0?this:void 0}optimizeNames(e,n){let{nodes:i}=this,r=i.length;for(;r--;){let o=i[r];o.optimizeNames(e,n)||(PC(e,o.names),i.splice(r,1))}return i.length>0?this:void 0}get names(){return this.nodes.reduce((e,n)=>_r(e,n.names),{})}},dn=class extends Hs{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},Fh=class extends Hs{},Ci=class extends dn{};Ci.kind="else";var br=class t extends dn{constructor(e,n){super(n),this.condition=e}render(e){let n=`if(${this.condition})`+super.render(e);return this.else&&(n+="else "+this.else.render(e)),n}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let n=this.else;if(n){let i=n.optimizeNodes();n=this.else=Array.isArray(i)?new Ci(i):i}if(n)return e===!1?n instanceof t?n:n.nodes:this.nodes.length?this:new t(aI(e),n instanceof t?[n]:n.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,n){var i;if(this.else=(i=this.else)===null||i===void 0?void 0:i.optimizeNames(e,n),!!(super.optimizeNames(e,n)||this.else))return this.condition=zi(this.condition,e,n),this}get names(){let e=super.names;return pd(e,this.condition),this.else&&_r(e,this.else.names),e}};br.kind="if";var yr=class extends dn{};yr.kind="for";var Vh=class extends yr{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,n){if(super.optimizeNames(e,n))return this.iteration=zi(this.iteration,e,n),this}get names(){return _r(super.names,this.iteration.names)}},qh=class extends yr{constructor(e,n,i,r){super(),this.varKind=e,this.name=n,this.from=i,this.to=r}render(e){let n=e.es5?zt.varKinds.var:this.varKind,{name:i,from:r,to:o}=this;return`for(${n} ${i}=${r}; ${i}<${o}; ${i}++)`+super.render(e)}get names(){let e=pd(super.names,this.from);return pd(e,this.to)}},dd=class extends yr{constructor(e,n,i,r){super(),this.loop=e,this.varKind=n,this.name=i,this.iterable=r}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,n){if(super.optimizeNames(e,n))return this.iterable=zi(this.iterable,e,n),this}get names(){return _r(super.names,this.iterable.names)}},Ks=class extends dn{constructor(e,n,i){super(),this.name=e,this.args=n,this.async=i}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};Ks.kind="func";var Gs=class extends Hs{render(e){return"return "+super.render(e)}};Gs.kind="return";var Hh=class extends dn{render(e){let n="try"+super.render(e);return this.catch&&(n+=this.catch.render(e)),this.finally&&(n+=this.finally.render(e)),n}optimizeNodes(){var e,n;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(n=this.finally)===null||n===void 0||n.optimizeNodes(),this}optimizeNames(e,n){var i,r;return super.optimizeNames(e,n),(i=this.catch)===null||i===void 0||i.optimizeNames(e,n),(r=this.finally)===null||r===void 0||r.optimizeNames(e,n),this}get names(){let e=super.names;return this.catch&&_r(e,this.catch.names),this.finally&&_r(e,this.finally.names),e}},Ws=class extends dn{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};Ws.kind="catch";var Js=class extends dn{render(e){return"finally"+super.render(e)}};Js.kind="finally";var Kh=class{constructor(e,n={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...n,_n:n.lines?`
|
|
4
|
+
`:""},this._extScope=e,this._scope=new zt.Scope({parent:e}),this._nodes=[new Fh]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,n){let i=this._extScope.value(e,n);return(this._values[i.prefix]||(this._values[i.prefix]=new Set)).add(i),i}getScopeValue(e,n){return this._extScope.getValue(e,n)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,n,i,r){let o=this._scope.toName(n);return i!==void 0&&r&&(this._constants[o.str]=i),this._leafNode(new jh(e,o,i)),o}const(e,n,i){return this._def(zt.varKinds.const,e,n,i)}let(e,n,i){return this._def(zt.varKinds.let,e,n,i)}var(e,n,i){return this._def(zt.varKinds.var,e,n,i)}assign(e,n,i){return this._leafNode(new ld(e,n,i))}add(e,n){return this._leafNode(new Uh(e,te.operators.ADD,n))}code(e){return typeof e=="function"?e():e!==oe.nil&&this._leafNode(new Bh(e)),this}object(...e){let n=["{"];for(let[i,r]of e)n.length>1&&n.push(","),n.push(i),(i!==r||this.opts.es5)&&(n.push(":"),(0,oe.addCodeArg)(n,r));return n.push("}"),new oe._Code(n)}if(e,n,i){if(this._blockNode(new br(e)),n&&i)this.code(n).else().code(i).endIf();else if(n)this.code(n).endIf();else if(i)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new br(e))}else(){return this._elseNode(new Ci)}endIf(){return this._endBlockNode(br,Ci)}_for(e,n){return this._blockNode(e),n&&this.code(n).endFor(),this}for(e,n){return this._for(new Vh(e),n)}forRange(e,n,i,r,o=this.opts.es5?zt.varKinds.var:zt.varKinds.let){let s=this._scope.toName(e);return this._for(new qh(o,s,n,i),()=>r(s))}forOf(e,n,i,r=zt.varKinds.const){let o=this._scope.toName(e);if(this.opts.es5){let s=n instanceof oe.Name?n:this.var("_arr",n);return this.forRange("_i",0,(0,oe._)`${s}.length`,c=>{this.var(o,(0,oe._)`${s}[${c}]`),i(o)})}return this._for(new dd("of",r,o,n),()=>i(o))}forIn(e,n,i,r=this.opts.es5?zt.varKinds.var:zt.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,oe._)`Object.keys(${n})`,i);let o=this._scope.toName(e);return this._for(new dd("in",r,o,n),()=>i(o))}endFor(){return this._endBlockNode(yr)}label(e){return this._leafNode(new Mh(e))}break(e){return this._leafNode(new Lh(e))}return(e){let n=new Gs;if(this._blockNode(n),this.code(e),n.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Gs)}try(e,n,i){if(!n&&!i)throw new Error('CodeGen: "try" without "catch" and "finally"');let r=new Hh;if(this._blockNode(r),this.code(e),n){let o=this.name("e");this._currNode=r.catch=new Ws(o),n(o)}return i&&(this._currNode=r.finally=new Js,this.code(i)),this._endBlockNode(Ws,Js)}throw(e){return this._leafNode(new Zh(e))}block(e,n){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(n),this}endBlock(e){let n=this._blockStarts.pop();if(n===void 0)throw new Error("CodeGen: not in self-balancing block");let i=this._nodes.length-n;if(i<0||e!==void 0&&i!==e)throw new Error(`CodeGen: wrong number of nodes: ${i} vs ${e} expected`);return this._nodes.length=n,this}func(e,n=oe.nil,i,r){return this._blockNode(new Ks(e,n,i)),r&&this.code(r).endFunc(),this}endFunc(){return this._endBlockNode(Ks)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,n){let i=this._currNode;if(i instanceof e||n&&i instanceof n)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${n?`${e.kind}/${n.kind}`:e.kind}"`)}_elseNode(e){let n=this._currNode;if(!(n instanceof br))throw new Error('CodeGen: "else" without "if"');return this._currNode=n.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let n=this._nodes;n[n.length-1]=e}};te.CodeGen=Kh;function _r(t,e){for(let n in e)t[n]=(t[n]||0)+(e[n]||0);return t}function pd(t,e){return e instanceof oe._CodeOrName?_r(t,e.names):t}function zi(t,e,n){if(t instanceof oe.Name)return i(t);if(!r(t))return t;return new oe._Code(t._items.reduce((o,s)=>(s instanceof oe.Name&&(s=i(s)),s instanceof oe._Code?o.push(...s._items):o.push(s),o),[]));function i(o){let s=n[o.str];return s===void 0||e[o.str]!==1?o:(delete e[o.str],s)}function r(o){return o instanceof oe._Code&&o._items.some(s=>s instanceof oe.Name&&e[s.str]===1&&n[s.str]!==void 0)}}function PC(t,e){for(let n in e)t[n]=(t[n]||0)-(e[n]||0)}function aI(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,oe._)`!${Gh(t)}`}te.not=aI;var AC=cI(te.operators.AND);function NC(...t){return t.reduce(AC)}te.and=NC;var CC=cI(te.operators.OR);function zC(...t){return t.reduce(CC)}te.or=zC;function cI(t){return(e,n)=>e===oe.nil?n:n===oe.nil?e:(0,oe._)`${Gh(e)} ${t} ${Gh(n)}`}function Gh(t){return t instanceof oe.Name?t:(0,oe._)`(${t})`}});var se=N(ne=>{"use strict";Object.defineProperty(ne,"__esModule",{value:!0});ne.checkStrictMode=ne.getErrorPath=ne.Type=ne.useFunc=ne.setEvaluated=ne.evaluatedPropsToName=ne.mergeEvaluated=ne.eachItem=ne.unescapeJsonPointer=ne.escapeJsonPointer=ne.escapeFragment=ne.unescapeFragment=ne.schemaRefOrVal=ne.schemaHasRulesButRef=ne.schemaHasRules=ne.checkUnknownRules=ne.alwaysValidSchema=ne.toHash=void 0;var Se=X(),DC=qs();function jC(t){let e={};for(let n of t)e[n]=!0;return e}ne.toHash=jC;function UC(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(dI(t,e),!pI(e,t.self.RULES.all))}ne.alwaysValidSchema=UC;function dI(t,e=t.schema){let{opts:n,self:i}=t;if(!n.strictSchema||typeof e=="boolean")return;let r=i.RULES.keywords;for(let o in e)r[o]||gI(t,`unknown keyword: "${o}"`)}ne.checkUnknownRules=dI;function pI(t,e){if(typeof t=="boolean")return!t;for(let n in t)if(e[n])return!0;return!1}ne.schemaHasRules=pI;function MC(t,e){if(typeof t=="boolean")return!t;for(let n in t)if(n!=="$ref"&&e.all[n])return!0;return!1}ne.schemaHasRulesButRef=MC;function LC({topSchemaRef:t,schemaPath:e},n,i,r){if(!r){if(typeof n=="number"||typeof n=="boolean")return n;if(typeof n=="string")return(0,Se._)`${n}`}return(0,Se._)`${t}${e}${(0,Se.getProperty)(i)}`}ne.schemaRefOrVal=LC;function ZC(t){return mI(decodeURIComponent(t))}ne.unescapeFragment=ZC;function BC(t){return encodeURIComponent(Jh(t))}ne.escapeFragment=BC;function Jh(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}ne.escapeJsonPointer=Jh;function mI(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}ne.unescapeJsonPointer=mI;function FC(t,e){if(Array.isArray(t))for(let n of t)e(n);else e(t)}ne.eachItem=FC;function uI({mergeNames:t,mergeToName:e,mergeValues:n,resultToName:i}){return(r,o,s,c)=>{let u=s===void 0?o:s instanceof Se.Name?(o instanceof Se.Name?t(r,o,s):e(r,o,s),s):o instanceof Se.Name?(e(r,s,o),o):n(o,s);return c===Se.Name&&!(u instanceof Se.Name)?i(r,u):u}}ne.mergeEvaluated={props:uI({mergeNames:(t,e,n)=>t.if((0,Se._)`${n} !== true && ${e} !== undefined`,()=>{t.if((0,Se._)`${e} === true`,()=>t.assign(n,!0),()=>t.assign(n,(0,Se._)`${n} || {}`).code((0,Se._)`Object.assign(${n}, ${e})`))}),mergeToName:(t,e,n)=>t.if((0,Se._)`${n} !== true`,()=>{e===!0?t.assign(n,!0):(t.assign(n,(0,Se._)`${n} || {}`),Yh(t,n,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:fI}),items:uI({mergeNames:(t,e,n)=>t.if((0,Se._)`${n} !== true && ${e} !== undefined`,()=>t.assign(n,(0,Se._)`${e} === true ? true : ${n} > ${e} ? ${n} : ${e}`)),mergeToName:(t,e,n)=>t.if((0,Se._)`${n} !== true`,()=>t.assign(n,e===!0?!0:(0,Se._)`${n} > ${e} ? ${n} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function fI(t,e){if(e===!0)return t.var("props",!0);let n=t.var("props",(0,Se._)`{}`);return e!==void 0&&Yh(t,n,e),n}ne.evaluatedPropsToName=fI;function Yh(t,e,n){Object.keys(n).forEach(i=>t.assign((0,Se._)`${e}${(0,Se.getProperty)(i)}`,!0))}ne.setEvaluated=Yh;var lI={};function VC(t,e){return t.scopeValue("func",{ref:e,code:lI[e.code]||(lI[e.code]=new DC._Code(e.code))})}ne.useFunc=VC;var Wh;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(Wh||(ne.Type=Wh={}));function qC(t,e,n){if(t instanceof Se.Name){let i=e===Wh.Num;return n?i?(0,Se._)`"[" + ${t} + "]"`:(0,Se._)`"['" + ${t} + "']"`:i?(0,Se._)`"/" + ${t}`:(0,Se._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return n?(0,Se.getProperty)(t).toString():"/"+Jh(t)}ne.getErrorPath=qC;function gI(t,e,n=t.opts.strictSchema){if(n){if(e=`strict mode: ${e}`,n===!0)throw new Error(e);t.self.logger.warn(e)}}ne.checkStrictMode=gI});var pn=N(Xh=>{"use strict";Object.defineProperty(Xh,"__esModule",{value:!0});var Ge=X(),HC={data:new Ge.Name("data"),valCxt:new Ge.Name("valCxt"),instancePath:new Ge.Name("instancePath"),parentData:new Ge.Name("parentData"),parentDataProperty:new Ge.Name("parentDataProperty"),rootData:new Ge.Name("rootData"),dynamicAnchors:new Ge.Name("dynamicAnchors"),vErrors:new Ge.Name("vErrors"),errors:new Ge.Name("errors"),this:new Ge.Name("this"),self:new Ge.Name("self"),scope:new Ge.Name("scope"),json:new Ge.Name("json"),jsonPos:new Ge.Name("jsonPos"),jsonLen:new Ge.Name("jsonLen"),jsonPart:new Ge.Name("jsonPart")};Xh.default=HC});var Ys=N(We=>{"use strict";Object.defineProperty(We,"__esModule",{value:!0});We.extendErrors=We.resetErrorsCount=We.reportExtraError=We.reportError=We.keyword$DataError=We.keywordError=void 0;var ae=X(),fd=se(),nt=pn();We.keywordError={message:({keyword:t})=>(0,ae.str)`must pass "${t}" keyword validation`};We.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,ae.str)`"${t}" keyword must be ${e} ($data)`:(0,ae.str)`"${t}" keyword is invalid ($data)`};function KC(t,e=We.keywordError,n,i){let{it:r}=t,{gen:o,compositeRule:s,allErrors:c}=r,u=yI(t,e,n);i??(s||c)?hI(o,u):bI(r,(0,ae._)`[${u}]`)}We.reportError=KC;function GC(t,e=We.keywordError,n){let{it:i}=t,{gen:r,compositeRule:o,allErrors:s}=i,c=yI(t,e,n);hI(r,c),o||s||bI(i,nt.default.vErrors)}We.reportExtraError=GC;function WC(t,e){t.assign(nt.default.errors,e),t.if((0,ae._)`${nt.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,ae._)`${nt.default.vErrors}.length`,e),()=>t.assign(nt.default.vErrors,null)))}We.resetErrorsCount=WC;function JC({gen:t,keyword:e,schemaValue:n,data:i,errsCount:r,it:o}){if(r===void 0)throw new Error("ajv implementation error");let s=t.name("err");t.forRange("i",r,nt.default.errors,c=>{t.const(s,(0,ae._)`${nt.default.vErrors}[${c}]`),t.if((0,ae._)`${s}.instancePath === undefined`,()=>t.assign((0,ae._)`${s}.instancePath`,(0,ae.strConcat)(nt.default.instancePath,o.errorPath))),t.assign((0,ae._)`${s}.schemaPath`,(0,ae.str)`${o.errSchemaPath}/${e}`),o.opts.verbose&&(t.assign((0,ae._)`${s}.schema`,n),t.assign((0,ae._)`${s}.data`,i))})}We.extendErrors=JC;function hI(t,e){let n=t.const("err",e);t.if((0,ae._)`${nt.default.vErrors} === null`,()=>t.assign(nt.default.vErrors,(0,ae._)`[${n}]`),(0,ae._)`${nt.default.vErrors}.push(${n})`),t.code((0,ae._)`${nt.default.errors}++`)}function bI(t,e){let{gen:n,validateName:i,schemaEnv:r}=t;r.$async?n.throw((0,ae._)`new ${t.ValidationError}(${e})`):(n.assign((0,ae._)`${i}.errors`,e),n.return(!1))}var vr={keyword:new ae.Name("keyword"),schemaPath:new ae.Name("schemaPath"),params:new ae.Name("params"),propertyName:new ae.Name("propertyName"),message:new ae.Name("message"),schema:new ae.Name("schema"),parentSchema:new ae.Name("parentSchema")};function yI(t,e,n){let{createErrors:i}=t.it;return i===!1?(0,ae._)`{}`:YC(t,e,n)}function YC(t,e,n={}){let{gen:i,it:r}=t,o=[XC(r,n),QC(t,n)];return ez(t,e,o),i.object(...o)}function XC({errorPath:t},{instancePath:e}){let n=e?(0,ae.str)`${t}${(0,fd.getErrorPath)(e,fd.Type.Str)}`:t;return[nt.default.instancePath,(0,ae.strConcat)(nt.default.instancePath,n)]}function QC({keyword:t,it:{errSchemaPath:e}},{schemaPath:n,parentSchema:i}){let r=i?e:(0,ae.str)`${e}/${t}`;return n&&(r=(0,ae.str)`${r}${(0,fd.getErrorPath)(n,fd.Type.Str)}`),[vr.schemaPath,r]}function ez(t,{params:e,message:n},i){let{keyword:r,data:o,schemaValue:s,it:c}=t,{opts:u,propertyName:l,topSchemaRef:p,schemaPath:d}=c;i.push([vr.keyword,r],[vr.params,typeof e=="function"?e(t):e||(0,ae._)`{}`]),u.messages&&i.push([vr.message,typeof n=="function"?n(t):n]),u.verbose&&i.push([vr.schema,s],[vr.parentSchema,(0,ae._)`${p}${d}`],[nt.default.data,o]),l&&i.push([vr.propertyName,l])}});var vI=N(Di=>{"use strict";Object.defineProperty(Di,"__esModule",{value:!0});Di.boolOrEmptySchema=Di.topBoolOrEmptySchema=void 0;var tz=Ys(),nz=X(),rz=pn(),iz={message:"boolean schema is false"};function oz(t){let{gen:e,schema:n,validateName:i}=t;n===!1?_I(t,!1):typeof n=="object"&&n.$async===!0?e.return(rz.default.data):(e.assign((0,nz._)`${i}.errors`,null),e.return(!0))}Di.topBoolOrEmptySchema=oz;function sz(t,e){let{gen:n,schema:i}=t;i===!1?(n.var(e,!1),_I(t)):n.var(e,!0)}Di.boolOrEmptySchema=sz;function _I(t,e){let{gen:n,data:i}=t,r={gen:n,keyword:"false schema",data:i,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,tz.reportError)(r,iz,void 0,e)}});var Qh=N(ji=>{"use strict";Object.defineProperty(ji,"__esModule",{value:!0});ji.getRules=ji.isJSONType=void 0;var az=["string","number","integer","boolean","null","object","array"],cz=new Set(az);function uz(t){return typeof t=="string"&&cz.has(t)}ji.isJSONType=uz;function lz(){let t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}ji.getRules=lz});var eb=N(Un=>{"use strict";Object.defineProperty(Un,"__esModule",{value:!0});Un.shouldUseRule=Un.shouldUseGroup=Un.schemaHasRulesForType=void 0;function dz({schema:t,self:e},n){let i=e.RULES.types[n];return i&&i!==!0&&kI(t,i)}Un.schemaHasRulesForType=dz;function kI(t,e){return e.rules.some(n=>SI(t,n))}Un.shouldUseGroup=kI;function SI(t,e){var n;return t[e.keyword]!==void 0||((n=e.definition.implements)===null||n===void 0?void 0:n.some(i=>t[i]!==void 0))}Un.shouldUseRule=SI});var Xs=N(Je=>{"use strict";Object.defineProperty(Je,"__esModule",{value:!0});Je.reportTypeError=Je.checkDataTypes=Je.checkDataType=Je.coerceAndCheckDataType=Je.getJSONTypes=Je.getSchemaTypes=Je.DataType=void 0;var pz=Qh(),mz=eb(),fz=Ys(),Y=X(),xI=se(),Ui;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(Ui||(Je.DataType=Ui={}));function gz(t){let e=II(t.type);if(e.includes("null")){if(t.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&t.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');t.nullable===!0&&e.push("null")}return e}Je.getSchemaTypes=gz;function II(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(pz.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}Je.getJSONTypes=II;function hz(t,e){let{gen:n,data:i,opts:r}=t,o=bz(e,r.coerceTypes),s=e.length>0&&!(o.length===0&&e.length===1&&(0,mz.schemaHasRulesForType)(t,e[0]));if(s){let c=nb(e,i,r.strictNumbers,Ui.Wrong);n.if(c,()=>{o.length?yz(t,e,o):rb(t)})}return s}Je.coerceAndCheckDataType=hz;var $I=new Set(["string","number","integer","boolean","null"]);function bz(t,e){return e?t.filter(n=>$I.has(n)||e==="array"&&n==="array"):[]}function yz(t,e,n){let{gen:i,data:r,opts:o}=t,s=i.let("dataType",(0,Y._)`typeof ${r}`),c=i.let("coerced",(0,Y._)`undefined`);o.coerceTypes==="array"&&i.if((0,Y._)`${s} == 'object' && Array.isArray(${r}) && ${r}.length == 1`,()=>i.assign(r,(0,Y._)`${r}[0]`).assign(s,(0,Y._)`typeof ${r}`).if(nb(e,r,o.strictNumbers),()=>i.assign(c,r))),i.if((0,Y._)`${c} !== undefined`);for(let l of n)($I.has(l)||l==="array"&&o.coerceTypes==="array")&&u(l);i.else(),rb(t),i.endIf(),i.if((0,Y._)`${c} !== undefined`,()=>{i.assign(r,c),_z(t,c)});function u(l){switch(l){case"string":i.elseIf((0,Y._)`${s} == "number" || ${s} == "boolean"`).assign(c,(0,Y._)`"" + ${r}`).elseIf((0,Y._)`${r} === null`).assign(c,(0,Y._)`""`);return;case"number":i.elseIf((0,Y._)`${s} == "boolean" || ${r} === null
|
|
5
5
|
|| (${s} == "string" && ${r} && ${r} == +${r})`).assign(c,(0,Y._)`+${r}`);return;case"integer":i.elseIf((0,Y._)`${s} === "boolean" || ${r} === null
|
|
6
6
|
|| (${s} === "string" && ${r} && ${r} == +${r} && !(${r} % 1))`).assign(c,(0,Y._)`+${r}`);return;case"boolean":i.elseIf((0,Y._)`${r} === "false" || ${r} === 0 || ${r} === null`).assign(c,!1).elseIf((0,Y._)`${r} === "true" || ${r} === 1`).assign(c,!0);return;case"null":i.elseIf((0,Y._)`${r} === "" || ${r} === 0 || ${r} === false`),i.assign(c,null);return;case"array":i.elseIf((0,Y._)`${s} === "string" || ${s} === "number"
|
|
7
|
-
|| ${s} === "boolean" || ${r} === null`).assign(c,(0,Y._)`[${r}]`)}}}function UC({gen:t,parentData:e,parentDataProperty:n},i){t.if((0,Y._)`${e} !== undefined`,()=>t.assign((0,Y._)`${e}[${n}]`,i))}function Ug(t,e,n,i=Pi.Correct){let r=i===Pi.Correct?Y.operators.EQ:Y.operators.NEQ,o;switch(t){case"null":return(0,Y._)`${e} ${r} null`;case"array":o=(0,Y._)`Array.isArray(${e})`;break;case"object":o=(0,Y._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":o=s((0,Y._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":o=s();break;default:return(0,Y._)`typeof ${e} ${r} ${t}`}return i===Pi.Correct?o:(0,Y.not)(o);function s(c=Y.nil){return(0,Y.and)((0,Y._)`typeof ${e} == "number"`,c,n?(0,Y._)`isFinite(${e})`:Y.nil)}}Ge.checkDataType=Ug;function Mg(t,e,n,i){if(t.length===1)return Ug(t[0],e,n,i);let r,o=(0,eI.toHash)(t);if(o.array&&o.object){let s=(0,Y._)`typeof ${e} != "object"`;r=o.null?s:(0,Y._)`!${e} || ${s}`,delete o.null,delete o.array,delete o.object}else r=Y.nil;o.number&&delete o.integer;for(let s in o)r=(0,Y.and)(r,Ug(s,e,n,i));return r}Ge.checkDataTypes=Mg;var MC={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,Y._)`{type: ${t}}`:(0,Y._)`{type: ${e}}`};function Lg(t){let e=LC(t);(0,NC.reportError)(e,MC)}Ge.reportTypeError=Lg;function LC(t){let{gen:e,data:n,schema:i}=t,r=(0,eI.schemaRefOrVal)(t,i,"type");return{gen:e,keyword:"type",data:n,schema:i.type,schemaCode:r,schemaValue:r,parentSchema:i,params:{},it:t}}});var iI=A(od=>{"use strict";Object.defineProperty(od,"__esModule",{value:!0});od.assignDefaults=void 0;var Ai=X(),ZC=se();function BC(t,e){let{properties:n,items:i}=t.schema;if(e==="object"&&n)for(let r in n)rI(t,r,n[r].default);else e==="array"&&Array.isArray(i)&&i.forEach((r,o)=>rI(t,o,r.default))}od.assignDefaults=BC;function rI(t,e,n){let{gen:i,compositeRule:r,data:o,opts:s}=t;if(n===void 0)return;let c=(0,Ai._)`${o}${(0,Ai.getProperty)(e)}`;if(r){(0,ZC.checkStrictMode)(t,`default is ignored for: ${c}`);return}let u=(0,Ai._)`${c} === undefined`;s.useDefaults==="empty"&&(u=(0,Ai._)`${u} || ${c} === null || ${c} === ""`),i.if(u,(0,Ai._)`${c} = ${(0,Ai.stringify)(n)}`)}});var xt=A(ye=>{"use strict";Object.defineProperty(ye,"__esModule",{value:!0});ye.validateUnion=ye.validateArray=ye.usePattern=ye.callValidateCode=ye.schemaProperties=ye.allSchemaProperties=ye.noPropertyInData=ye.propertyInData=ye.isOwnProperty=ye.hasPropFunc=ye.reportMissingProp=ye.checkMissingProp=ye.checkReportMissingProp=void 0;var Ie=X(),Zg=se(),Dn=ln(),FC=se();function qC(t,e){let{gen:n,data:i,it:r}=t;n.if(Fg(n,i,e,r.opts.ownProperties),()=>{t.setParams({missingProperty:(0,Ie._)`${e}`},!0),t.error()})}ye.checkReportMissingProp=qC;function VC({gen:t,data:e,it:{opts:n}},i,r){return(0,Ie.or)(...i.map(o=>(0,Ie.and)(Fg(t,e,o,n.ownProperties),(0,Ie._)`${r} = ${o}`)))}ye.checkMissingProp=VC;function HC(t,e){t.setParams({missingProperty:e},!0),t.error()}ye.reportMissingProp=HC;function oI(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,Ie._)`Object.prototype.hasOwnProperty`})}ye.hasPropFunc=oI;function Bg(t,e,n){return(0,Ie._)`${oI(t)}.call(${e}, ${n})`}ye.isOwnProperty=Bg;function GC(t,e,n,i){let r=(0,Ie._)`${e}${(0,Ie.getProperty)(n)} !== undefined`;return i?(0,Ie._)`${r} && ${Bg(t,e,n)}`:r}ye.propertyInData=GC;function Fg(t,e,n,i){let r=(0,Ie._)`${e}${(0,Ie.getProperty)(n)} === undefined`;return i?(0,Ie.or)(r,(0,Ie.not)(Bg(t,e,n))):r}ye.noPropertyInData=Fg;function sI(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}ye.allSchemaProperties=sI;function KC(t,e){return sI(e).filter(n=>!(0,Zg.alwaysValidSchema)(t,e[n]))}ye.schemaProperties=KC;function WC({schemaCode:t,data:e,it:{gen:n,topSchemaRef:i,schemaPath:r,errorPath:o},it:s},c,u,d){let l=d?(0,Ie._)`${t}, ${e}, ${i}${r}`:e,p=[[Dn.default.instancePath,(0,Ie.strConcat)(Dn.default.instancePath,o)],[Dn.default.parentData,s.parentData],[Dn.default.parentDataProperty,s.parentDataProperty],[Dn.default.rootData,Dn.default.rootData]];s.opts.dynamicRef&&p.push([Dn.default.dynamicAnchors,Dn.default.dynamicAnchors]);let m=(0,Ie._)`${l}, ${n.object(...p)}`;return u!==Ie.nil?(0,Ie._)`${c}.call(${u}, ${m})`:(0,Ie._)`${c}(${m})`}ye.callValidateCode=WC;var JC=(0,Ie._)`new RegExp`;function YC({gen:t,it:{opts:e}},n){let i=e.unicodeRegExp?"u":"",{regExp:r}=e.code,o=r(n,i);return t.scopeValue("pattern",{key:o.toString(),ref:o,code:(0,Ie._)`${r.code==="new RegExp"?JC:(0,FC.useFunc)(t,r)}(${n}, ${i})`})}ye.usePattern=YC;function XC(t){let{gen:e,data:n,keyword:i,it:r}=t,o=e.name("valid");if(r.allErrors){let c=e.let("valid",!0);return s(()=>e.assign(c,!1)),c}return e.var(o,!0),s(()=>e.break()),o;function s(c){let u=e.const("len",(0,Ie._)`${n}.length`);e.forRange("i",0,u,d=>{t.subschema({keyword:i,dataProp:d,dataPropType:Zg.Type.Num},o),e.if((0,Ie.not)(o),c)})}}ye.validateArray=XC;function QC(t){let{gen:e,schema:n,keyword:i,it:r}=t;if(!Array.isArray(n))throw new Error("ajv implementation error");if(n.some(u=>(0,Zg.alwaysValidSchema)(r,u))&&!r.opts.unevaluated)return;let s=e.let("valid",!1),c=e.name("_valid");e.block(()=>n.forEach((u,d)=>{let l=t.subschema({keyword:i,schemaProp:d,compositeRule:!0},c);e.assign(s,(0,Ie._)`${s} || ${c}`),t.mergeValidEvaluated(l,c)||e.if((0,Ie.not)(s))})),t.result(s,()=>t.reset(),()=>t.error(!0))}ye.validateUnion=QC});var uI=A(Kt=>{"use strict";Object.defineProperty(Kt,"__esModule",{value:!0});Kt.validateKeywordUsage=Kt.validSchemaType=Kt.funcKeywordCode=Kt.macroKeywordCode=void 0;var et=X(),mr=ln(),ez=xt(),tz=qs();function nz(t,e){let{gen:n,keyword:i,schema:r,parentSchema:o,it:s}=t,c=e.macro.call(s.self,r,o,s),u=cI(n,i,c);s.opts.validateSchema!==!1&&s.self.validateSchema(c,!0);let d=n.name("valid");t.subschema({schema:c,schemaPath:et.nil,errSchemaPath:`${s.errSchemaPath}/${i}`,topSchemaRef:u,compositeRule:!0},d),t.pass(d,()=>t.error(!0))}Kt.macroKeywordCode=nz;function rz(t,e){var n;let{gen:i,keyword:r,schema:o,parentSchema:s,$data:c,it:u}=t;oz(u,e);let d=!c&&e.compile?e.compile.call(u.self,o,s,u):e.validate,l=cI(i,r,d),p=i.let("valid");t.block$data(p,m),t.ok((n=e.valid)!==null&&n!==void 0?n:p);function m(){if(e.errors===!1)y(),e.modifying&&aI(t),v(()=>t.error());else{let T=e.async?f():h();e.modifying&&aI(t),v(()=>iz(t,T))}}function f(){let T=i.let("ruleErrs",null);return i.try(()=>y((0,et._)`await `),z=>i.assign(p,!1).if((0,et._)`${z} instanceof ${u.ValidationError}`,()=>i.assign(T,(0,et._)`${z}.errors`),()=>i.throw(z))),T}function h(){let T=(0,et._)`${l}.errors`;return i.assign(T,null),y(et.nil),T}function y(T=e.async?(0,et._)`await `:et.nil){let z=u.opts.passContext?mr.default.this:mr.default.self,D=!("compile"in e&&!c||e.schema===!1);i.assign(p,(0,et._)`${T}${(0,ez.callValidateCode)(t,l,z,D)}`,e.modifying)}function v(T){var z;i.if((0,et.not)((z=e.valid)!==null&&z!==void 0?z:p),T)}}Kt.funcKeywordCode=rz;function aI(t){let{gen:e,data:n,it:i}=t;e.if(i.parentData,()=>e.assign(n,(0,et._)`${i.parentData}[${i.parentDataProperty}]`))}function iz(t,e){let{gen:n}=t;n.if((0,et._)`Array.isArray(${e})`,()=>{n.assign(mr.default.vErrors,(0,et._)`${mr.default.vErrors} === null ? ${e} : ${mr.default.vErrors}.concat(${e})`).assign(mr.default.errors,(0,et._)`${mr.default.vErrors}.length`),(0,tz.extendErrors)(t)},()=>t.error())}function oz({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function cI(t,e,n){if(n===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof n=="function"?{ref:n}:{ref:n,code:(0,et.stringify)(n)})}function sz(t,e,n=!1){return!e.length||e.some(i=>i==="array"?Array.isArray(t):i==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==i||n&&typeof t>"u")}Kt.validSchemaType=sz;function az({schema:t,opts:e,self:n,errSchemaPath:i},r,o){if(Array.isArray(r.keyword)?!r.keyword.includes(o):r.keyword!==o)throw new Error("ajv implementation error");let s=r.dependencies;if(s?.some(c=>!Object.prototype.hasOwnProperty.call(t,c)))throw new Error(`parent schema must have dependencies of ${o}: ${s.join(",")}`);if(r.validateSchema&&!r.validateSchema(t[o])){let u=`keyword "${o}" value is invalid at path "${i}": `+n.errorsText(r.validateSchema.errors);if(e.validateSchema==="log")n.logger.error(u);else throw new Error(u)}}Kt.validateKeywordUsage=az});var dI=A(jn=>{"use strict";Object.defineProperty(jn,"__esModule",{value:!0});jn.extendSubschemaMode=jn.extendSubschemaData=jn.getSubschema=void 0;var Wt=X(),lI=se();function cz(t,{keyword:e,schemaProp:n,schema:i,schemaPath:r,errSchemaPath:o,topSchemaRef:s}){if(e!==void 0&&i!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let c=t.schema[e];return n===void 0?{schema:c,schemaPath:(0,Wt._)`${t.schemaPath}${(0,Wt.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:c[n],schemaPath:(0,Wt._)`${t.schemaPath}${(0,Wt.getProperty)(e)}${(0,Wt.getProperty)(n)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,lI.escapeFragment)(n)}`}}if(i!==void 0){if(r===void 0||o===void 0||s===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:i,schemaPath:r,topSchemaRef:s,errSchemaPath:o}}throw new Error('either "keyword" or "schema" must be passed')}jn.getSubschema=cz;function uz(t,e,{dataProp:n,dataPropType:i,data:r,dataTypes:o,propertyName:s}){if(r!==void 0&&n!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:c}=e;if(n!==void 0){let{errorPath:d,dataPathArr:l,opts:p}=e,m=c.let("data",(0,Wt._)`${e.data}${(0,Wt.getProperty)(n)}`,!0);u(m),t.errorPath=(0,Wt.str)`${d}${(0,lI.getErrorPath)(n,i,p.jsPropertySyntax)}`,t.parentDataProperty=(0,Wt._)`${n}`,t.dataPathArr=[...l,t.parentDataProperty]}if(r!==void 0){let d=r instanceof Wt.Name?r:c.let("data",r,!0);u(d),s!==void 0&&(t.propertyName=s)}o&&(t.dataTypes=o);function u(d){t.data=d,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,d]}}jn.extendSubschemaData=uz;function lz(t,{jtdDiscriminator:e,jtdMetadata:n,compositeRule:i,createErrors:r,allErrors:o}){i!==void 0&&(t.compositeRule=i),r!==void 0&&(t.createErrors=r),o!==void 0&&(t.allErrors=o),t.jtdDiscriminator=e,t.jtdMetadata=n}jn.extendSubschemaMode=lz});var qg=A((W9,pI)=>{"use strict";pI.exports=function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var i,r,o;if(Array.isArray(e)){if(i=e.length,i!=n.length)return!1;for(r=i;r--!==0;)if(!t(e[r],n[r]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(o=Object.keys(e),i=o.length,i!==Object.keys(n).length)return!1;for(r=i;r--!==0;)if(!Object.prototype.hasOwnProperty.call(n,o[r]))return!1;for(r=i;r--!==0;){var s=o[r];if(!t(e[s],n[s]))return!1}return!0}return e!==e&&n!==n}});var fI=A((J9,mI)=>{"use strict";var Un=mI.exports=function(t,e,n){typeof e=="function"&&(n=e,e={}),n=e.cb||n;var i=typeof n=="function"?n:n.pre||function(){},r=n.post||function(){};sd(e,i,r,t,"",t)};Un.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Un.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Un.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Un.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 sd(t,e,n,i,r,o,s,c,u,d){if(i&&typeof i=="object"&&!Array.isArray(i)){e(i,r,o,s,c,u,d);for(var l in i){var p=i[l];if(Array.isArray(p)){if(l in Un.arrayKeywords)for(var m=0;m<p.length;m++)sd(t,e,n,p[m],r+"/"+l+"/"+m,o,r,l,i,m)}else if(l in Un.propsKeywords){if(p&&typeof p=="object")for(var f in p)sd(t,e,n,p[f],r+"/"+l+"/"+dz(f),o,r,l,i,f)}else(l in Un.keywords||t.allKeys&&!(l in Un.skipKeywords))&&sd(t,e,n,p,r+"/"+l,o,r,l,i)}n(i,r,o,s,c,u,d)}}function dz(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var Hs=A(ct=>{"use strict";Object.defineProperty(ct,"__esModule",{value:!0});ct.getSchemaRefs=ct.resolveUrl=ct.normalizeId=ct._getFullPath=ct.getFullPath=ct.inlineRef=void 0;var pz=se(),mz=qg(),fz=fI(),hz=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function gz(t,e=!0){return typeof t=="boolean"?!0:e===!0?!Vg(t):e?hI(t)<=e:!1}ct.inlineRef=gz;var bz=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Vg(t){for(let e in t){if(bz.has(e))return!0;let n=t[e];if(Array.isArray(n)&&n.some(Vg)||typeof n=="object"&&Vg(n))return!0}return!1}function hI(t){let e=0;for(let n in t){if(n==="$ref")return 1/0;if(e++,!hz.has(n)&&(typeof t[n]=="object"&&(0,pz.eachItem)(t[n],i=>e+=hI(i)),e===1/0))return 1/0}return e}function gI(t,e="",n){n!==!1&&(e=Ni(e));let i=t.parse(e);return bI(t,i)}ct.getFullPath=gI;function bI(t,e){return t.serialize(e).split("#")[0]+"#"}ct._getFullPath=bI;var _z=/#\/?$/;function Ni(t){return t?t.replace(_z,""):""}ct.normalizeId=Ni;function yz(t,e,n){return n=Ni(n),t.resolve(e,n)}ct.resolveUrl=yz;var vz=/^[a-z_][-a-z0-9._]*$/i;function kz(t,e){if(typeof t=="boolean")return{};let{schemaId:n,uriResolver:i}=this.opts,r=Ni(t[n]||e),o={"":r},s=gI(i,r,!1),c={},u=new Set;return fz(t,{allKeys:!0},(p,m,f,h)=>{if(h===void 0)return;let y=s+m,v=o[h];typeof p[n]=="string"&&(v=T.call(this,p[n])),z.call(this,p.$anchor),z.call(this,p.$dynamicAnchor),o[m]=v;function T(D){let U=this.opts.uriResolver.resolve;if(D=Ni(v?U(v,D):D),u.has(D))throw l(D);u.add(D);let j=this.refs[D];return typeof j=="string"&&(j=this.refs[j]),typeof j=="object"?d(p,j.schema,D):D!==Ni(y)&&(D[0]==="#"?(d(p,c[D],D),c[D]=p):this.refs[D]=y),D}function z(D){if(typeof D=="string"){if(!vz.test(D))throw new Error(`invalid anchor "${D}"`);T.call(this,`#${D}`)}}}),c;function d(p,m,f){if(m!==void 0&&!mz(p,m))throw l(f)}function l(p){return new Error(`reference "${p}" resolves to more than one schema`)}}ct.getSchemaRefs=kz});var Ws=A(Mn=>{"use strict";Object.defineProperty(Mn,"__esModule",{value:!0});Mn.getData=Mn.KeywordCxt=Mn.validateFunctionCode=void 0;var SI=Yx(),_I=Vs(),Gg=jg(),ad=Vs(),Sz=iI(),Ks=uI(),Hg=dI(),B=X(),G=ln(),xz=Hs(),dn=se(),Gs=qs();function Iz(t){if($I(t)&&(wI(t),II(t))){Ez(t);return}xI(t,()=>(0,SI.topBoolOrEmptySchema)(t))}Mn.validateFunctionCode=Iz;function xI({gen:t,validateName:e,schema:n,schemaEnv:i,opts:r},o){r.code.es5?t.func(e,(0,B._)`${G.default.data}, ${G.default.valCxt}`,i.$async,()=>{t.code((0,B._)`"use strict"; ${yI(n,r)}`),wz(t,r),t.code(o)}):t.func(e,(0,B._)`${G.default.data}, ${$z(r)}`,i.$async,()=>t.code(yI(n,r)).code(o))}function $z(t){return(0,B._)`{${G.default.instancePath}="", ${G.default.parentData}, ${G.default.parentDataProperty}, ${G.default.rootData}=${G.default.data}${t.dynamicRef?(0,B._)`, ${G.default.dynamicAnchors}={}`:B.nil}}={}`}function wz(t,e){t.if(G.default.valCxt,()=>{t.var(G.default.instancePath,(0,B._)`${G.default.valCxt}.${G.default.instancePath}`),t.var(G.default.parentData,(0,B._)`${G.default.valCxt}.${G.default.parentData}`),t.var(G.default.parentDataProperty,(0,B._)`${G.default.valCxt}.${G.default.parentDataProperty}`),t.var(G.default.rootData,(0,B._)`${G.default.valCxt}.${G.default.rootData}`),e.dynamicRef&&t.var(G.default.dynamicAnchors,(0,B._)`${G.default.valCxt}.${G.default.dynamicAnchors}`)},()=>{t.var(G.default.instancePath,(0,B._)`""`),t.var(G.default.parentData,(0,B._)`undefined`),t.var(G.default.parentDataProperty,(0,B._)`undefined`),t.var(G.default.rootData,G.default.data),e.dynamicRef&&t.var(G.default.dynamicAnchors,(0,B._)`{}`)})}function Ez(t){let{schema:e,opts:n,gen:i}=t;xI(t,()=>{n.$comment&&e.$comment&&TI(t),Az(t),i.let(G.default.vErrors,null),i.let(G.default.errors,0),n.unevaluated&&Tz(t),EI(t),zz(t)})}function Tz(t){let{gen:e,validateName:n}=t;t.evaluated=e.const("evaluated",(0,B._)`${n}.evaluated`),e.if((0,B._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,B._)`${t.evaluated}.props`,(0,B._)`undefined`)),e.if((0,B._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,B._)`${t.evaluated}.items`,(0,B._)`undefined`))}function yI(t,e){let n=typeof t=="object"&&t[e.schemaId];return n&&(e.code.source||e.code.process)?(0,B._)`/*# sourceURL=${n} */`:B.nil}function Rz(t,e){if($I(t)&&(wI(t),II(t))){Oz(t,e);return}(0,SI.boolOrEmptySchema)(t,e)}function II({schema:t,self:e}){if(typeof t=="boolean")return!t;for(let n in t)if(e.RULES.all[n])return!0;return!1}function $I(t){return typeof t.schema!="boolean"}function Oz(t,e){let{schema:n,gen:i,opts:r}=t;r.$comment&&n.$comment&&TI(t),Nz(t),Cz(t);let o=i.const("_errs",G.default.errors);EI(t,o),i.var(e,(0,B._)`${o} === ${G.default.errors}`)}function wI(t){(0,dn.checkUnknownRules)(t),Pz(t)}function EI(t,e){if(t.opts.jtd)return vI(t,[],!1,e);let n=(0,_I.getSchemaTypes)(t.schema),i=(0,_I.coerceAndCheckDataType)(t,n);vI(t,n,!i,e)}function Pz(t){let{schema:e,errSchemaPath:n,opts:i,self:r}=t;e.$ref&&i.ignoreKeywordsWithRef&&(0,dn.schemaHasRulesButRef)(e,r.RULES)&&r.logger.warn(`$ref: keywords ignored in schema at path "${n}"`)}function Az(t){let{schema:e,opts:n}=t;e.default!==void 0&&n.useDefaults&&n.strictSchema&&(0,dn.checkStrictMode)(t,"default is ignored in the schema root")}function Nz(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,xz.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function Cz(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function TI({gen:t,schemaEnv:e,schema:n,errSchemaPath:i,opts:r}){let o=n.$comment;if(r.$comment===!0)t.code((0,B._)`${G.default.self}.logger.log(${o})`);else if(typeof r.$comment=="function"){let s=(0,B.str)`${i}/$comment`,c=t.scopeValue("root",{ref:e.root});t.code((0,B._)`${G.default.self}.opts.$comment(${o}, ${s}, ${c}.schema)`)}}function zz(t){let{gen:e,schemaEnv:n,validateName:i,ValidationError:r,opts:o}=t;n.$async?e.if((0,B._)`${G.default.errors} === 0`,()=>e.return(G.default.data),()=>e.throw((0,B._)`new ${r}(${G.default.vErrors})`)):(e.assign((0,B._)`${i}.errors`,G.default.vErrors),o.unevaluated&&Dz(t),e.return((0,B._)`${G.default.errors} === 0`))}function Dz({gen:t,evaluated:e,props:n,items:i}){n instanceof B.Name&&t.assign((0,B._)`${e}.props`,n),i instanceof B.Name&&t.assign((0,B._)`${e}.items`,i)}function vI(t,e,n,i){let{gen:r,schema:o,data:s,allErrors:c,opts:u,self:d}=t,{RULES:l}=d;if(o.$ref&&(u.ignoreKeywordsWithRef||!(0,dn.schemaHasRulesButRef)(o,l))){r.block(()=>OI(t,"$ref",l.all.$ref.definition));return}u.jtd||jz(t,e),r.block(()=>{for(let m of l.rules)p(m);p(l.post)});function p(m){(0,Gg.shouldUseGroup)(o,m)&&(m.type?(r.if((0,ad.checkDataType)(m.type,s,u.strictNumbers)),kI(t,m),e.length===1&&e[0]===m.type&&n&&(r.else(),(0,ad.reportTypeError)(t)),r.endIf()):kI(t,m),c||r.if((0,B._)`${G.default.errors} === ${i||0}`))}}function kI(t,e){let{gen:n,schema:i,opts:{useDefaults:r}}=t;r&&(0,Sz.assignDefaults)(t,e.type),n.block(()=>{for(let o of e.rules)(0,Gg.shouldUseRule)(i,o)&&OI(t,o.keyword,o.definition,e.type)})}function jz(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(Uz(t,e),t.opts.allowUnionTypes||Mz(t,e),Lz(t,t.dataTypes))}function Uz(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(n=>{RI(t.dataTypes,n)||Kg(t,`type "${n}" not allowed by context "${t.dataTypes.join(",")}"`)}),Bz(t,e)}}function Mz(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&Kg(t,"use allowUnionTypes to allow union type keyword")}function Lz(t,e){let n=t.self.RULES.all;for(let i in n){let r=n[i];if(typeof r=="object"&&(0,Gg.shouldUseRule)(t.schema,r)){let{type:o}=r.definition;o.length&&!o.some(s=>Zz(e,s))&&Kg(t,`missing type "${o.join(",")}" for keyword "${i}"`)}}}function Zz(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function RI(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function Bz(t,e){let n=[];for(let i of t.dataTypes)RI(e,i)?n.push(i):e.includes("integer")&&i==="number"&&n.push("integer");t.dataTypes=n}function Kg(t,e){let n=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${n}" (strictTypes)`,(0,dn.checkStrictMode)(t,e,t.opts.strictTypes)}var cd=class{constructor(e,n,i){if((0,Ks.validateKeywordUsage)(e,n,i),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=i,this.data=e.data,this.schema=e.schema[i],this.$data=n.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,dn.schemaRefOrVal)(e,this.schema,i,this.$data),this.schemaType=n.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=n,this.$data)this.schemaCode=e.gen.const("vSchema",PI(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,Ks.validSchemaType)(this.schema,n.schemaType,n.allowUndefined))throw new Error(`${i} value must be ${JSON.stringify(n.schemaType)}`);("code"in n?n.trackErrors:n.errors!==!1)&&(this.errsCount=e.gen.const("_errs",G.default.errors))}result(e,n,i){this.failResult((0,B.not)(e),n,i)}failResult(e,n,i){this.gen.if(e),i?i():this.error(),n?(this.gen.else(),n(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,n){this.failResult((0,B.not)(e),void 0,n)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:n}=this;this.fail((0,B._)`${n} !== undefined && (${(0,B.or)(this.invalid$data(),e)})`)}error(e,n,i){if(n){this.setParams(n),this._error(e,i),this.setParams({});return}this._error(e,i)}_error(e,n){(e?Gs.reportExtraError:Gs.reportError)(this,this.def.error,n)}$dataError(){(0,Gs.reportError)(this,this.def.$dataError||Gs.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Gs.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,n){n?Object.assign(this.params,e):this.params=e}block$data(e,n,i=B.nil){this.gen.block(()=>{this.check$data(e,i),n()})}check$data(e=B.nil,n=B.nil){if(!this.$data)return;let{gen:i,schemaCode:r,schemaType:o,def:s}=this;i.if((0,B.or)((0,B._)`${r} === undefined`,n)),e!==B.nil&&i.assign(e,!0),(o.length||s.validateSchema)&&(i.elseIf(this.invalid$data()),this.$dataError(),e!==B.nil&&i.assign(e,!1)),i.else()}invalid$data(){let{gen:e,schemaCode:n,schemaType:i,def:r,it:o}=this;return(0,B.or)(s(),c());function s(){if(i.length){if(!(n instanceof B.Name))throw new Error("ajv implementation error");let u=Array.isArray(i)?i:[i];return(0,B._)`${(0,ad.checkDataTypes)(u,n,o.opts.strictNumbers,ad.DataType.Wrong)}`}return B.nil}function c(){if(r.validateSchema){let u=e.scopeValue("validate$data",{ref:r.validateSchema});return(0,B._)`!${u}(${n})`}return B.nil}}subschema(e,n){let i=(0,Hg.getSubschema)(this.it,e);(0,Hg.extendSubschemaData)(i,this.it,e),(0,Hg.extendSubschemaMode)(i,e);let r={...this.it,...i,items:void 0,props:void 0};return Rz(r,n),r}mergeEvaluated(e,n){let{it:i,gen:r}=this;i.opts.unevaluated&&(i.props!==!0&&e.props!==void 0&&(i.props=dn.mergeEvaluated.props(r,e.props,i.props,n)),i.items!==!0&&e.items!==void 0&&(i.items=dn.mergeEvaluated.items(r,e.items,i.items,n)))}mergeValidEvaluated(e,n){let{it:i,gen:r}=this;if(i.opts.unevaluated&&(i.props!==!0||i.items!==!0))return r.if(n,()=>this.mergeEvaluated(e,B.Name)),!0}};Mn.KeywordCxt=cd;function OI(t,e,n,i){let r=new cd(t,n,e);"code"in n?n.code(r,i):r.$data&&n.validate?(0,Ks.funcKeywordCode)(r,n):"macro"in n?(0,Ks.macroKeywordCode)(r,n):(n.compile||n.validate)&&(0,Ks.funcKeywordCode)(r,n)}var Fz=/^\/(?:[^~]|~0|~1)*$/,qz=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function PI(t,{dataLevel:e,dataNames:n,dataPathArr:i}){let r,o;if(t==="")return G.default.rootData;if(t[0]==="/"){if(!Fz.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);r=t,o=G.default.rootData}else{let d=qz.exec(t);if(!d)throw new Error(`Invalid JSON-pointer: ${t}`);let l=+d[1];if(r=d[2],r==="#"){if(l>=e)throw new Error(u("property/index",l));return i[e-l]}if(l>e)throw new Error(u("data",l));if(o=n[e-l],!r)return o}let s=o,c=r.split("/");for(let d of c)d&&(o=(0,B._)`${o}${(0,B.getProperty)((0,dn.unescapeJsonPointer)(d))}`,s=(0,B._)`${s} && ${o}`);return s;function u(d,l){return`Cannot access ${d} ${l} levels up, current level is ${e}`}}Mn.getData=PI});var ud=A(Jg=>{"use strict";Object.defineProperty(Jg,"__esModule",{value:!0});var Wg=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};Jg.default=Wg});var Js=A(Qg=>{"use strict";Object.defineProperty(Qg,"__esModule",{value:!0});var Yg=Hs(),Xg=class extends Error{constructor(e,n,i,r){super(r||`can't resolve reference ${i} from id ${n}`),this.missingRef=(0,Yg.resolveUrl)(e,n,i),this.missingSchema=(0,Yg.normalizeId)((0,Yg.getFullPath)(e,this.missingRef))}};Qg.default=Xg});var dd=A(It=>{"use strict";Object.defineProperty(It,"__esModule",{value:!0});It.resolveSchema=It.getCompilingSchema=It.resolveRef=It.compileSchema=It.SchemaEnv=void 0;var Dt=X(),Vz=ud(),fr=ln(),jt=Hs(),AI=se(),Hz=Ws(),Ci=class{constructor(e){var n;this.refs={},this.dynamicAnchors={};let i;typeof e.schema=="object"&&(i=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(n=e.baseId)!==null&&n!==void 0?n:(0,jt.normalizeId)(i?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=i?.$async,this.refs={}}};It.SchemaEnv=Ci;function tb(t){let e=NI.call(this,t);if(e)return e;let n=(0,jt.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:i,lines:r}=this.opts.code,{ownProperties:o}=this.opts,s=new Dt.CodeGen(this.scope,{es5:i,lines:r,ownProperties:o}),c;t.$async&&(c=s.scopeValue("Error",{ref:Vz.default,code:(0,Dt._)`require("ajv/dist/runtime/validation_error").default`}));let u=s.scopeName("validate");t.validateName=u;let d={gen:s,allErrors:this.opts.allErrors,data:fr.default.data,parentData:fr.default.parentData,parentDataProperty:fr.default.parentDataProperty,dataNames:[fr.default.data],dataPathArr:[Dt.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:s.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,Dt.stringify)(t.schema)}:{ref:t.schema}),validateName:u,ValidationError:c,schema:t.schema,schemaEnv:t,rootId:n,baseId:t.baseId||n,schemaPath:Dt.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Dt._)`""`,opts:this.opts,self:this},l;try{this._compilations.add(t),(0,Hz.validateFunctionCode)(d),s.optimize(this.opts.code.optimize);let p=s.toString();l=`${s.scopeRefs(fr.default.scope)}return ${p}`,this.opts.code.process&&(l=this.opts.code.process(l,t));let f=new Function(`${fr.default.self}`,`${fr.default.scope}`,l)(this,this.scope.get());if(this.scope.value(u,{ref:f}),f.errors=null,f.schema=t.schema,f.schemaEnv=t,t.$async&&(f.$async=!0),this.opts.code.source===!0&&(f.source={validateName:u,validateCode:p,scopeValues:s._values}),this.opts.unevaluated){let{props:h,items:y}=d;f.evaluated={props:h instanceof Dt.Name?void 0:h,items:y instanceof Dt.Name?void 0:y,dynamicProps:h instanceof Dt.Name,dynamicItems:y instanceof Dt.Name},f.source&&(f.source.evaluated=(0,Dt.stringify)(f.evaluated))}return t.validate=f,t}catch(p){throw delete t.validate,delete t.validateName,l&&this.logger.error("Error compiling schema, function code:",l),p}finally{this._compilations.delete(t)}}It.compileSchema=tb;function Gz(t,e,n){var i;n=(0,jt.resolveUrl)(this.opts.uriResolver,e,n);let r=t.refs[n];if(r)return r;let o=Jz.call(this,t,n);if(o===void 0){let s=(i=t.localRefs)===null||i===void 0?void 0:i[n],{schemaId:c}=this.opts;s&&(o=new Ci({schema:s,schemaId:c,root:t,baseId:e}))}if(o!==void 0)return t.refs[n]=Kz.call(this,o)}It.resolveRef=Gz;function Kz(t){return(0,jt.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:tb.call(this,t)}function NI(t){for(let e of this._compilations)if(Wz(e,t))return e}It.getCompilingSchema=NI;function Wz(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function Jz(t,e){let n;for(;typeof(n=this.refs[e])=="string";)e=n;return n||this.schemas[e]||ld.call(this,t,e)}function ld(t,e){let n=this.opts.uriResolver.parse(e),i=(0,jt._getFullPath)(this.opts.uriResolver,n),r=(0,jt.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&i===r)return eb.call(this,n,t);let o=(0,jt.normalizeId)(i),s=this.refs[o]||this.schemas[o];if(typeof s=="string"){let c=ld.call(this,t,s);return typeof c?.schema!="object"?void 0:eb.call(this,n,c)}if(typeof s?.schema=="object"){if(s.validate||tb.call(this,s),o===(0,jt.normalizeId)(e)){let{schema:c}=s,{schemaId:u}=this.opts,d=c[u];return d&&(r=(0,jt.resolveUrl)(this.opts.uriResolver,r,d)),new Ci({schema:c,schemaId:u,root:t,baseId:r})}return eb.call(this,n,s)}}It.resolveSchema=ld;var Yz=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function eb(t,{baseId:e,schema:n,root:i}){var r;if(((r=t.fragment)===null||r===void 0?void 0:r[0])!=="/")return;for(let c of t.fragment.slice(1).split("/")){if(typeof n=="boolean")return;let u=n[(0,AI.unescapeFragment)(c)];if(u===void 0)return;n=u;let d=typeof n=="object"&&n[this.opts.schemaId];!Yz.has(c)&&d&&(e=(0,jt.resolveUrl)(this.opts.uriResolver,e,d))}let o;if(typeof n!="boolean"&&n.$ref&&!(0,AI.schemaHasRulesButRef)(n,this.RULES)){let c=(0,jt.resolveUrl)(this.opts.uriResolver,e,n.$ref);o=ld.call(this,i,c)}let{schemaId:s}=this.opts;if(o=o||new Ci({schema:n,schemaId:s,root:i,baseId:e}),o.schema!==o.root.schema)return o}});var CI=A((nG,Xz)=>{Xz.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 ib=A((rG,LI)=>{"use strict";var Qz=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),DI=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),nb=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),jI=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),eD=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function rb(t){let e="",n=0,i=0;for(i=0;i<t.length;i++)if(n=t[i].charCodeAt(0),n!==48){if(!(n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102))return"";e+=t[i];break}for(i+=1;i<t.length;i++){if(n=t[i].charCodeAt(0),!(n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102))return"";e+=t[i]}return e}var tD=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function zI(t){return t.length=0,!0}function nD(t,e,n){if(t.length){let i=rb(t);if(i!=="")e.push(i);else return n.error=!0,!1;t.length=0}return!0}function rD(t){let e=0,n={error:!1,address:"",zone:""},i=[],r=[],o=!1,s=!1,c=nD;for(let u=0;u<t.length;u++){let d=t[u];if(!(d==="["||d==="]"))if(d===":"){if(o===!0&&(s=!0),!c(r,i,n))break;if(++e>7){n.error=!0;break}u>0&&t[u-1]===":"&&(o=!0),i.push(":");continue}else if(d==="%"){if(!c(r,i,n))break;c=zI}else{r.push(d);continue}}return r.length&&(c===zI?n.zone=r.join(""):s?i.push(r.join("")):i.push(rb(r))),n.address=i.join(""),n}function UI(t){if(iD(t,":")<2)return{host:t,isIPV6:!1};let e=rD(t);if(e.error)return{host:t,isIPV6:!1};{let n=e.address,i=e.address;return e.zone&&(n+="%"+e.zone,i+="%25"+e.zone),{host:n,isIPV6:!0,escapedHost:i}}}function iD(t,e){let n=0;for(let i=0;i<t.length;i++)t[i]===e&&n++;return n}function oD(t){let e=t,n=[],i=-1,r=0;for(;r=e.length;){if(r===1){if(e===".")break;if(e==="/"){n.push("/");break}else{n.push(e);break}}else if(r===2){if(e[0]==="."){if(e[1]===".")break;if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&(e[1]==="."||e[1]==="/")){n.push("/");break}}else if(r===3&&e==="/.."){n.length!==0&&n.pop(),n.push("/");break}if(e[0]==="."){if(e[1]==="."){if(e[2]==="/"){e=e.slice(3);continue}}else if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&e[1]==="."){if(e[2]==="/"){e=e.slice(2);continue}else if(e[2]==="."&&e[3]==="/"){e=e.slice(3),n.length!==0&&n.pop();continue}}if((i=e.indexOf("/",1))===-1){n.push(e);break}else n.push(e.slice(0,i)),e=e.slice(i)}return n.join("")}var sD={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},aD=/[@/?#:]/g,cD=/[@/?#]/g;function MI(t,e){let n=e?cD:aD;return n.lastIndex=0,t.replace(n,i=>sD[i])}function uD(t,e=!1){if(t.indexOf("%")===-1)return t;let n="";for(let i=0;i<t.length;i++){if(t[i]==="%"&&i+2<t.length){let r=t.slice(i+1,i+3);if(nb(r)){let o=r.toUpperCase(),s=String.fromCharCode(parseInt(o,16));e&&jI(s)?n+=s:n+="%"+o,i+=2;continue}}n+=t[i]}return n}function lD(t){let e="";for(let n=0;n<t.length;n++){if(t[n]==="%"&&n+2<t.length){let i=t.slice(n+1,n+3);if(nb(i)){let r=i.toUpperCase(),o=String.fromCharCode(parseInt(r,16));o!=="."&&jI(o)?e+=o:e+="%"+r,n+=2;continue}}eD(t[n])?e+=t[n]:e+=escape(t[n])}return e}function dD(t){let e="";for(let n=0;n<t.length;n++){if(t[n]==="%"&&n+2<t.length){let i=t.slice(n+1,n+3);if(nb(i)){e+="%"+i.toUpperCase(),n+=2;continue}}e+=escape(t[n])}return e}function pD(t){let e=[];if(t.userinfo!==void 0&&(e.push(t.userinfo),e.push("@")),t.host!==void 0){let n=unescape(t.host);if(!DI(n)){let i=UI(n);i.isIPV6===!0?n=`[${i.escapedHost}]`:n=MI(n,!1)}e.push(n)}return(typeof t.port=="number"||typeof t.port=="string")&&(e.push(":"),e.push(String(t.port))),e.length?e.join(""):void 0}LI.exports={nonSimpleDomain:tD,recomposeAuthority:pD,reescapeHostDelimiters:MI,normalizePercentEncoding:uD,normalizePathEncoding:lD,escapePreservingEscapes:dD,removeDotSegments:oD,isIPv4:DI,isUUID:Qz,normalizeIPv6:UI,stringArrayToHexStripped:rb}});var VI=A((iG,qI)=>{"use strict";var{isUUID:mD}=ib(),fD=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,hD=["http","https","ws","wss","urn","urn:uuid"];function gD(t){return hD.indexOf(t)!==-1}function ob(t){return t.secure===!0?!0:t.secure===!1?!1:t.scheme?t.scheme.length===3&&(t.scheme[0]==="w"||t.scheme[0]==="W")&&(t.scheme[1]==="s"||t.scheme[1]==="S")&&(t.scheme[2]==="s"||t.scheme[2]==="S"):!1}function ZI(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function BI(t){let e=String(t.scheme).toLowerCase()==="https";return(t.port===(e?443:80)||t.port==="")&&(t.port=void 0),t.path||(t.path="/"),t}function bD(t){return t.secure=ob(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function _D(t){if((t.port===(ob(t)?443:80)||t.port==="")&&(t.port=void 0),typeof t.secure=="boolean"&&(t.scheme=t.secure?"wss":"ws",t.secure=void 0),t.resourceName){let[e,n]=t.resourceName.split("?");t.path=e&&e!=="/"?e:void 0,t.query=n,t.resourceName=void 0}return t.fragment=void 0,t}function yD(t,e){if(!t.path)return t.error="URN can not be parsed",t;let n=t.path.match(fD);if(n){let i=e.scheme||t.scheme||"urn";t.nid=n[1].toLowerCase(),t.nss=n[2];let r=`${i}:${e.nid||t.nid}`,o=sb(r);t.path=void 0,o&&(t=o.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}function vD(t,e){if(t.nid===void 0)throw new Error("URN without nid cannot be serialized");let n=e.scheme||t.scheme||"urn",i=t.nid.toLowerCase(),r=`${n}:${e.nid||i}`,o=sb(r);o&&(t=o.serialize(t,e));let s=t,c=t.nss;return s.path=`${i||e.nid}:${c}`,e.skipEscape=!0,s}function kD(t,e){let n=t;return n.uuid=n.nss,n.nss=void 0,!e.tolerant&&(!n.uuid||!mD(n.uuid))&&(n.error=n.error||"UUID is not valid."),n}function SD(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var FI={scheme:"http",domainHost:!0,parse:ZI,serialize:BI},xD={scheme:"https",domainHost:FI.domainHost,parse:ZI,serialize:BI},pd={scheme:"ws",domainHost:!0,parse:bD,serialize:_D},ID={scheme:"wss",domainHost:pd.domainHost,parse:pd.parse,serialize:pd.serialize},$D={scheme:"urn",parse:yD,serialize:vD,skipNormalize:!0},wD={scheme:"urn:uuid",parse:kD,serialize:SD,skipNormalize:!0},md={http:FI,https:xD,ws:pd,wss:ID,urn:$D,"urn:uuid":wD};Object.setPrototypeOf(md,null);function sb(t){return t&&(md[t]||md[t.toLowerCase()])||void 0}qI.exports={wsIsSecure:ob,SCHEMES:md,isValidSchemeName:gD,getSchemeHandler:sb}});var JI=A((oG,gd)=>{"use strict";var{normalizeIPv6:ED,removeDotSegments:Ys,recomposeAuthority:TD,normalizePercentEncoding:RD,normalizePathEncoding:OD,escapePreservingEscapes:PD,reescapeHostDelimiters:AD,isIPv4:ND,nonSimpleDomain:CD}=ib(),{SCHEMES:zD,getSchemeHandler:GI}=VI();function DD(t,e){return typeof t=="string"?t=FD(t,e):typeof t=="object"&&(t=hd(hr(t,e),e)),t}function jD(t,e,n){let i=n?Object.assign({scheme:"null"},n):{scheme:"null"},{parsed:r,malformedAuthorityOrPort:o}=fd(t,i),{parsed:s,malformedAuthorityOrPort:c}=fd(e,i);if(o||c)throw new Error(r.error||s.error||"URI is malformed.");let u=KI(r,s,i,!0);return i.skipEscape=!0,hr(u,i)}function KI(t,e,n,i){let r={};return i||(t=hd(hr(t,n),n),e=hd(hr(e,n),n)),n=n||{},!n.tolerant&&e.scheme?(r.scheme=e.scheme,r.userinfo=e.userinfo,r.host=e.host,r.port=e.port,r.path=Ys(e.path||""),r.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(r.userinfo=e.userinfo,r.host=e.host,r.port=e.port,r.path=Ys(e.path||""),r.query=e.query):(e.path?(e.path[0]==="/"?r.path=Ys(e.path):((t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)&&!t.path?r.path="/"+e.path:t.path?r.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+e.path:r.path=e.path,r.path=Ys(r.path)),r.query=e.query):(r.path=t.path,e.query!==void 0?r.query=e.query:r.query=t.query),r.userinfo=t.userinfo,r.host=t.host,r.port=t.port),r.scheme=t.scheme),r.fragment=e.fragment,r}function UD(t,e,n){let i=HI(t,n),r=HI(e,n);return i!==void 0&&r!==void 0&&i.toLowerCase()===r.toLowerCase()}function hr(t,e){let n={host:t.host,scheme:t.scheme,userinfo:t.userinfo,port:t.port,path:t.path,query:t.query,nid:t.nid,nss:t.nss,uuid:t.uuid,fragment:t.fragment,reference:t.reference,resourceName:t.resourceName,secure:t.secure,error:""},i=Object.assign({},e),r=[],o=GI(i.scheme||n.scheme);o&&o.serialize&&o.serialize(n,i),n.path!==void 0&&(i.skipEscape?n.path=RD(n.path):(n.path=PD(n.path),n.scheme!==void 0&&(n.path=n.path.split("%3A").join(":")))),i.reference!=="suffix"&&n.scheme&&r.push(n.scheme,":");let s=TD(n);if(s!==void 0&&(i.reference!=="suffix"&&r.push("//"),r.push(s),n.path&&n.path[0]!=="/"&&r.push("/")),n.path!==void 0){let c=n.path;!i.absolutePath&&(!o||!o.absolutePath)&&(c=Ys(c)),s===void 0&&c[0]==="/"&&c[1]==="/"&&(c="/%2F"+c.slice(2)),r.push(c)}return n.query!==void 0&&r.push("?",n.query),n.fragment!==void 0&&r.push("#",n.fragment),r.join("")}var MD=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u,LD=/^(?:[^#/:?]+:)?\/\/([^/?#]*)/,ZD=/^(?:[^#/:?]+:)?([/\\\t\n\r]*)/;function BD(t,e){if(e[2]!==void 0&&t.path&&t.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof t.port=="number"&&(t.port<0||t.port>65535))return"URI port is malformed."}function fd(t,e){let n=Object.assign({},e),i={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},r=!1,o=!1;n.reference==="suffix"&&(n.scheme?t=n.scheme+":"+t:t="//"+t);let s=t.match(LD);s!==null&&s[1].indexOf("\\")!==-1&&(i.error="URI authority must not contain a literal backslash.",r=!0);let c=t.match(ZD);if(c!==null){let d=c[1],l=d.replace(/[\t\n\r]/g,"");l.length>=2&&(l.slice(0,2)!=="//"?(i.error=i.error||"URI authority must not contain a literal backslash.",r=!0):d.length!==l.length&&(i.error=i.error||"URI authority introducer must not contain whitespace.",r=!0))}let u=t.match(MD);if(u){i.scheme=u[1],i.userinfo=u[3],i.host=u[4],i.port=parseInt(u[5],10),i.path=u[6]||"",i.query=u[7],i.fragment=u[8],isNaN(i.port)&&(i.port=u[5]);let d=BD(i,u);if(d!==void 0&&(i.error=i.error||d,r=!0),i.host)if(ND(i.host)===!1){let m=ED(i.host);i.host=m.host.toLowerCase(),o=m.isIPV6}else o=!0;i.scheme===void 0&&i.userinfo===void 0&&i.host===void 0&&i.port===void 0&&i.query===void 0&&!i.path?i.reference="same-document":i.scheme===void 0?i.reference="relative":i.fragment===void 0?i.reference="absolute":i.reference="uri",n.reference&&n.reference!=="suffix"&&n.reference!==i.reference&&(i.error=i.error||"URI is not a "+n.reference+" reference.");let l=GI(n.scheme||i.scheme);if(!n.unicodeSupport&&(!l||!l.unicodeSupport)&&i.host&&(n.domainHost||l&&l.domainHost)&&o===!1&&CD(i.host))try{i.host=new URL("http://"+i.host).hostname}catch(p){i.error=i.error||"Host's domain name can not be converted to ASCII: "+p}if((!l||l&&!l.skipNormalize)&&(t.indexOf("%")!==-1&&(i.scheme!==void 0&&(i.scheme=unescape(i.scheme)),i.host!==void 0&&(i.host=AD(unescape(i.host),o))),i.path&&(i.path=OD(i.path)),i.fragment))try{i.fragment=encodeURI(decodeURIComponent(i.fragment))}catch{i.error=i.error||"URI malformed"}l&&l.parse&&l.parse(i,n)}else i.error=i.error||"URI can not be parsed.";return{parsed:i,malformedAuthorityOrPort:r}}function hd(t,e){return fd(t,e).parsed}function FD(t,e){return WI(t,e).normalized}function WI(t,e){let{parsed:n,malformedAuthorityOrPort:i}=fd(t,e);return{normalized:i?t:hr(n,e),malformedAuthorityOrPort:i}}function HI(t,e){if(typeof t=="string"){let{normalized:n,malformedAuthorityOrPort:i}=WI(t,e);return i?void 0:n}if(typeof t=="object")return hr(t,e)}var ab={SCHEMES:zD,normalize:DD,resolve:jD,resolveComponent:KI,equal:UD,serialize:hr,parse:hd};gd.exports=ab;gd.exports.default=ab;gd.exports.fastUri=ab});var XI=A(cb=>{"use strict";Object.defineProperty(cb,"__esModule",{value:!0});var YI=JI();YI.code='require("ajv/dist/runtime/uri").default';cb.default=YI});var s$=A(Ze=>{"use strict";Object.defineProperty(Ze,"__esModule",{value:!0});Ze.CodeGen=Ze.Name=Ze.nil=Ze.stringify=Ze.str=Ze._=Ze.KeywordCxt=void 0;var qD=Ws();Object.defineProperty(Ze,"KeywordCxt",{enumerable:!0,get:function(){return qD.KeywordCxt}});var zi=X();Object.defineProperty(Ze,"_",{enumerable:!0,get:function(){return zi._}});Object.defineProperty(Ze,"str",{enumerable:!0,get:function(){return zi.str}});Object.defineProperty(Ze,"stringify",{enumerable:!0,get:function(){return zi.stringify}});Object.defineProperty(Ze,"nil",{enumerable:!0,get:function(){return zi.nil}});Object.defineProperty(Ze,"Name",{enumerable:!0,get:function(){return zi.Name}});Object.defineProperty(Ze,"CodeGen",{enumerable:!0,get:function(){return zi.CodeGen}});var VD=ud(),r$=Js(),HD=Dg(),Xs=dd(),GD=X(),Qs=Hs(),bd=Vs(),lb=se(),QI=CI(),KD=XI(),i$=(t,e)=>new RegExp(t,e);i$.code="new RegExp";var WD=["removeAdditional","useDefaults","coerceTypes"],JD=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),YD={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."},XD={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},e$=200;function QD(t){var e,n,i,r,o,s,c,u,d,l,p,m,f,h,y,v,T,z,D,U,j,pt,bt,mo,fp;let fo=t.strict,hp=(e=t.code)===null||e===void 0?void 0:e.optimize,vy=hp===!0||hp===void 0?1:hp||0,ky=(i=(n=t.code)===null||n===void 0?void 0:n.regExp)!==null&&i!==void 0?i:i$,HR=(r=t.uriResolver)!==null&&r!==void 0?r:KD.default;return{strictSchema:(s=(o=t.strictSchema)!==null&&o!==void 0?o:fo)!==null&&s!==void 0?s:!0,strictNumbers:(u=(c=t.strictNumbers)!==null&&c!==void 0?c:fo)!==null&&u!==void 0?u:!0,strictTypes:(l=(d=t.strictTypes)!==null&&d!==void 0?d:fo)!==null&&l!==void 0?l:"log",strictTuples:(m=(p=t.strictTuples)!==null&&p!==void 0?p:fo)!==null&&m!==void 0?m:"log",strictRequired:(h=(f=t.strictRequired)!==null&&f!==void 0?f:fo)!==null&&h!==void 0?h:!1,code:t.code?{...t.code,optimize:vy,regExp:ky}:{optimize:vy,regExp:ky},loopRequired:(y=t.loopRequired)!==null&&y!==void 0?y:e$,loopEnum:(v=t.loopEnum)!==null&&v!==void 0?v:e$,meta:(T=t.meta)!==null&&T!==void 0?T:!0,messages:(z=t.messages)!==null&&z!==void 0?z:!0,inlineRefs:(D=t.inlineRefs)!==null&&D!==void 0?D:!0,schemaId:(U=t.schemaId)!==null&&U!==void 0?U:"$id",addUsedSchema:(j=t.addUsedSchema)!==null&&j!==void 0?j:!0,validateSchema:(pt=t.validateSchema)!==null&&pt!==void 0?pt:!0,validateFormats:(bt=t.validateFormats)!==null&&bt!==void 0?bt:!0,unicodeRegExp:(mo=t.unicodeRegExp)!==null&&mo!==void 0?mo:!0,int32range:(fp=t.int32range)!==null&&fp!==void 0?fp:!0,uriResolver:HR}}var ea=class{constructor(e={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...QD(e)};let{es5:n,lines:i}=this.opts.code;this.scope=new GD.ValueScope({scope:{},prefixes:JD,es5:n,lines:i}),this.logger=oj(e.logger);let r=e.validateFormats;e.validateFormats=!1,this.RULES=(0,HD.getRules)(),t$.call(this,YD,e,"NOT SUPPORTED"),t$.call(this,XD,e,"DEPRECATED","warn"),this._metaOpts=rj.call(this),e.formats&&tj.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&nj.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),ej.call(this),e.validateFormats=r}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:n,schemaId:i}=this.opts,r=QI;i==="id"&&(r={...QI},r.id=r.$id,delete r.$id),n&&e&&this.addMetaSchema(r,r[i],!1)}defaultMeta(){let{meta:e,schemaId:n}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[n]||e:void 0}validate(e,n){let i;if(typeof e=="string"){if(i=this.getSchema(e),!i)throw new Error(`no schema with key or ref "${e}"`)}else i=this.compile(e);let r=i(n);return"$async"in i||(this.errors=i.errors),r}compile(e,n){let i=this._addSchema(e,n);return i.validate||this._compileSchemaEnv(i)}compileAsync(e,n){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:i}=this.opts;return r.call(this,e,n);async function r(l,p){await o.call(this,l.$schema);let m=this._addSchema(l,p);return m.validate||s.call(this,m)}async function o(l){l&&!this.getSchema(l)&&await r.call(this,{$ref:l},!0)}async function s(l){try{return this._compileSchemaEnv(l)}catch(p){if(!(p instanceof r$.default))throw p;return c.call(this,p),await u.call(this,p.missingSchema),s.call(this,l)}}function c({missingSchema:l,missingRef:p}){if(this.refs[l])throw new Error(`AnySchema ${l} is loaded but ${p} cannot be resolved`)}async function u(l){let p=await d.call(this,l);this.refs[l]||await o.call(this,p.$schema),this.refs[l]||this.addSchema(p,l,n)}async function d(l){let p=this._loading[l];if(p)return p;try{return await(this._loading[l]=i(l))}finally{delete this._loading[l]}}}addSchema(e,n,i,r=this.opts.validateSchema){if(Array.isArray(e)){for(let s of e)this.addSchema(s,void 0,i,r);return this}let o;if(typeof e=="object"){let{schemaId:s}=this.opts;if(o=e[s],o!==void 0&&typeof o!="string")throw new Error(`schema ${s} must be string`)}return n=(0,Qs.normalizeId)(n||o),this._checkUnique(n),this.schemas[n]=this._addSchema(e,i,n,r,!0),this}addMetaSchema(e,n,i=this.opts.validateSchema){return this.addSchema(e,n,!0,i),this}validateSchema(e,n){if(typeof e=="boolean")return!0;let i;if(i=e.$schema,i!==void 0&&typeof i!="string")throw new Error("$schema must be a string");if(i=i||this.opts.defaultMeta||this.defaultMeta(),!i)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let r=this.validate(i,e);if(!r&&n){let o="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(o);else throw new Error(o)}return r}getSchema(e){let n;for(;typeof(n=n$.call(this,e))=="string";)e=n;if(n===void 0){let{schemaId:i}=this.opts,r=new Xs.SchemaEnv({schema:{},schemaId:i});if(n=Xs.resolveSchema.call(this,r,e),!n)return;this.refs[e]=n}return n.validate||this._compileSchemaEnv(n)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let n=n$.call(this,e);return typeof n=="object"&&this._cache.delete(n.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let n=e;this._cache.delete(n);let i=e[this.opts.schemaId];return i&&(i=(0,Qs.normalizeId)(i),delete this.schemas[i],delete this.refs[i]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let n of e)this.addKeyword(n);return this}addKeyword(e,n){let i;if(typeof e=="string")i=e,typeof n=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),n.keyword=i);else if(typeof e=="object"&&n===void 0){if(n=e,i=n.keyword,Array.isArray(i)&&!i.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(aj.call(this,i,n),!n)return(0,lb.eachItem)(i,o=>ub.call(this,o)),this;uj.call(this,n);let r={...n,type:(0,bd.getJSONTypes)(n.type),schemaType:(0,bd.getJSONTypes)(n.schemaType)};return(0,lb.eachItem)(i,r.type.length===0?o=>ub.call(this,o,r):o=>r.type.forEach(s=>ub.call(this,o,r,s))),this}getKeyword(e){let n=this.RULES.all[e];return typeof n=="object"?n.definition:!!n}removeKeyword(e){let{RULES:n}=this;delete n.keywords[e],delete n.all[e];for(let i of n.rules){let r=i.rules.findIndex(o=>o.keyword===e);r>=0&&i.rules.splice(r,1)}return this}addFormat(e,n){return typeof n=="string"&&(n=new RegExp(n)),this.formats[e]=n,this}errorsText(e=this.errors,{separator:n=", ",dataVar:i="data"}={}){return!e||e.length===0?"No errors":e.map(r=>`${i}${r.instancePath} ${r.message}`).reduce((r,o)=>r+n+o)}$dataMetaSchema(e,n){let i=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let r of n){let o=r.split("/").slice(1),s=e;for(let c of o)s=s[c];for(let c in i){let u=i[c];if(typeof u!="object")continue;let{$data:d}=u.definition,l=s[c];d&&l&&(s[c]=o$(l))}}return e}_removeAllSchemas(e,n){for(let i in e){let r=e[i];(!n||n.test(i))&&(typeof r=="string"?delete e[i]:r&&!r.meta&&(this._cache.delete(r.schema),delete e[i]))}}_addSchema(e,n,i,r=this.opts.validateSchema,o=this.opts.addUsedSchema){let s,{schemaId:c}=this.opts;if(typeof e=="object")s=e[c];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof e!="boolean")throw new Error("schema must be object or boolean")}let u=this._cache.get(e);if(u!==void 0)return u;i=(0,Qs.normalizeId)(s||i);let d=Qs.getSchemaRefs.call(this,e,i);return u=new Xs.SchemaEnv({schema:e,schemaId:c,meta:n,baseId:i,localRefs:d}),this._cache.set(u.schema,u),o&&!i.startsWith("#")&&(i&&this._checkUnique(i),this.refs[i]=u),r&&this.validateSchema(e,!0),u}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):Xs.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let n=this.opts;this.opts=this._metaOpts;try{Xs.compileSchema.call(this,e)}finally{this.opts=n}}};ea.ValidationError=VD.default;ea.MissingRefError=r$.default;Ze.default=ea;function t$(t,e,n,i="error"){for(let r in t){let o=r;o in e&&this.logger[i](`${n}: option ${r}. ${t[o]}`)}}function n$(t){return t=(0,Qs.normalizeId)(t),this.schemas[t]||this.refs[t]}function ej(){let t=this.opts.schemas;if(t)if(Array.isArray(t))this.addSchema(t);else for(let e in t)this.addSchema(t[e],e)}function tj(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function nj(t){if(Array.isArray(t)){this.addVocabulary(t);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in t){let n=t[e];n.keyword||(n.keyword=e),this.addKeyword(n)}}function rj(){let t={...this.opts};for(let e of WD)delete t[e];return t}var ij={log(){},warn(){},error(){}};function oj(t){if(t===!1)return ij;if(t===void 0)return console;if(t.log&&t.warn&&t.error)return t;throw new Error("logger must implement log, warn and error methods")}var sj=/^[a-z_$][a-z0-9_$:-]*$/i;function aj(t,e){let{RULES:n}=this;if((0,lb.eachItem)(t,i=>{if(n.keywords[i])throw new Error(`Keyword ${i} is already defined`);if(!sj.test(i))throw new Error(`Keyword ${i} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function ub(t,e,n){var i;let r=e?.post;if(n&&r)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:o}=this,s=r?o.post:o.rules.find(({type:u})=>u===n);if(s||(s={type:n,rules:[]},o.rules.push(s)),o.keywords[t]=!0,!e)return;let c={keyword:t,definition:{...e,type:(0,bd.getJSONTypes)(e.type),schemaType:(0,bd.getJSONTypes)(e.schemaType)}};e.before?cj.call(this,s,c,e.before):s.rules.push(c),o.all[t]=c,(i=e.implements)===null||i===void 0||i.forEach(u=>this.addKeyword(u))}function cj(t,e,n){let i=t.rules.findIndex(r=>r.keyword===n);i>=0?t.rules.splice(i,0,e):(t.rules.push(e),this.logger.warn(`rule ${n} is not defined`))}function uj(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=o$(e)),t.validateSchema=this.compile(e,!0))}var lj={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function o$(t){return{anyOf:[t,lj]}}});var a$=A(db=>{"use strict";Object.defineProperty(db,"__esModule",{value:!0});var dj={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};db.default=dj});var d$=A(gr=>{"use strict";Object.defineProperty(gr,"__esModule",{value:!0});gr.callRef=gr.getValidate=void 0;var pj=Js(),c$=xt(),ut=X(),Di=ln(),u$=dd(),_d=se(),mj={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:n,it:i}=t,{baseId:r,schemaEnv:o,validateName:s,opts:c,self:u}=i,{root:d}=o;if((n==="#"||n==="#/")&&r===d.baseId)return p();let l=u$.resolveRef.call(u,d,r,n);if(l===void 0)throw new pj.default(i.opts.uriResolver,r,n);if(l instanceof u$.SchemaEnv)return m(l);return f(l);function p(){if(o===d)return yd(t,s,o,o.$async);let h=e.scopeValue("root",{ref:d});return yd(t,(0,ut._)`${h}.validate`,d,d.$async)}function m(h){let y=l$(t,h);yd(t,y,h,h.$async)}function f(h){let y=e.scopeValue("schema",c.code.source===!0?{ref:h,code:(0,ut.stringify)(h)}:{ref:h}),v=e.name("valid"),T=t.subschema({schema:h,dataTypes:[],schemaPath:ut.nil,topSchemaRef:y,errSchemaPath:n},v);t.mergeEvaluated(T),t.ok(v)}}};function l$(t,e){let{gen:n}=t;return e.validate?n.scopeValue("validate",{ref:e.validate}):(0,ut._)`${n.scopeValue("wrapper",{ref:e})}.validate`}gr.getValidate=l$;function yd(t,e,n,i){let{gen:r,it:o}=t,{allErrors:s,schemaEnv:c,opts:u}=o,d=u.passContext?Di.default.this:ut.nil;i?l():p();function l(){if(!c.$async)throw new Error("async schema referenced by sync schema");let h=r.let("valid");r.try(()=>{r.code((0,ut._)`await ${(0,c$.callValidateCode)(t,e,d)}`),f(e),s||r.assign(h,!0)},y=>{r.if((0,ut._)`!(${y} instanceof ${o.ValidationError})`,()=>r.throw(y)),m(y),s||r.assign(h,!1)}),t.ok(h)}function p(){t.result((0,c$.callValidateCode)(t,e,d),()=>f(e),()=>m(e))}function m(h){let y=(0,ut._)`${h}.errors`;r.assign(Di.default.vErrors,(0,ut._)`${Di.default.vErrors} === null ? ${y} : ${Di.default.vErrors}.concat(${y})`),r.assign(Di.default.errors,(0,ut._)`${Di.default.vErrors}.length`)}function f(h){var y;if(!o.opts.unevaluated)return;let v=(y=n?.validate)===null||y===void 0?void 0:y.evaluated;if(o.props!==!0)if(v&&!v.dynamicProps)v.props!==void 0&&(o.props=_d.mergeEvaluated.props(r,v.props,o.props));else{let T=r.var("props",(0,ut._)`${h}.evaluated.props`);o.props=_d.mergeEvaluated.props(r,T,o.props,ut.Name)}if(o.items!==!0)if(v&&!v.dynamicItems)v.items!==void 0&&(o.items=_d.mergeEvaluated.items(r,v.items,o.items));else{let T=r.var("items",(0,ut._)`${h}.evaluated.items`);o.items=_d.mergeEvaluated.items(r,T,o.items,ut.Name)}}}gr.callRef=yd;gr.default=mj});var p$=A(pb=>{"use strict";Object.defineProperty(pb,"__esModule",{value:!0});var fj=a$(),hj=d$(),gj=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",fj.default,hj.default];pb.default=gj});var m$=A(mb=>{"use strict";Object.defineProperty(mb,"__esModule",{value:!0});var vd=X(),Ln=vd.operators,kd={maximum:{okStr:"<=",ok:Ln.LTE,fail:Ln.GT},minimum:{okStr:">=",ok:Ln.GTE,fail:Ln.LT},exclusiveMaximum:{okStr:"<",ok:Ln.LT,fail:Ln.GTE},exclusiveMinimum:{okStr:">",ok:Ln.GT,fail:Ln.LTE}},bj={message:({keyword:t,schemaCode:e})=>(0,vd.str)`must be ${kd[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,vd._)`{comparison: ${kd[t].okStr}, limit: ${e}}`},_j={keyword:Object.keys(kd),type:"number",schemaType:"number",$data:!0,error:bj,code(t){let{keyword:e,data:n,schemaCode:i}=t;t.fail$data((0,vd._)`${n} ${kd[e].fail} ${i} || isNaN(${n})`)}};mb.default=_j});var f$=A(fb=>{"use strict";Object.defineProperty(fb,"__esModule",{value:!0});var ta=X(),yj={message:({schemaCode:t})=>(0,ta.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,ta._)`{multipleOf: ${t}}`},vj={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:yj,code(t){let{gen:e,data:n,schemaCode:i,it:r}=t,o=r.opts.multipleOfPrecision,s=e.let("res"),c=o?(0,ta._)`Math.abs(Math.round(${s}) - ${s}) > 1e-${o}`:(0,ta._)`${s} !== parseInt(${s})`;t.fail$data((0,ta._)`(${i} === 0 || (${s} = ${n}/${i}, ${c}))`)}};fb.default=vj});var g$=A(hb=>{"use strict";Object.defineProperty(hb,"__esModule",{value:!0});function h$(t){let e=t.length,n=0,i=0,r;for(;i<e;)n++,r=t.charCodeAt(i++),r>=55296&&r<=56319&&i<e&&(r=t.charCodeAt(i),(r&64512)===56320&&i++);return n}hb.default=h$;h$.code='require("ajv/dist/runtime/ucs2length").default'});var b$=A(gb=>{"use strict";Object.defineProperty(gb,"__esModule",{value:!0});var br=X(),kj=se(),Sj=g$(),xj={message({keyword:t,schemaCode:e}){let n=t==="maxLength"?"more":"fewer";return(0,br.str)`must NOT have ${n} than ${e} characters`},params:({schemaCode:t})=>(0,br._)`{limit: ${t}}`},Ij={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:xj,code(t){let{keyword:e,data:n,schemaCode:i,it:r}=t,o=e==="maxLength"?br.operators.GT:br.operators.LT,s=r.opts.unicode===!1?(0,br._)`${n}.length`:(0,br._)`${(0,kj.useFunc)(t.gen,Sj.default)}(${n})`;t.fail$data((0,br._)`${s} ${o} ${i}`)}};gb.default=Ij});var _$=A(bb=>{"use strict";Object.defineProperty(bb,"__esModule",{value:!0});var $j=xt(),wj=se(),ji=X(),Ej={message:({schemaCode:t})=>(0,ji.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,ji._)`{pattern: ${t}}`},Tj={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:Ej,code(t){let{gen:e,data:n,$data:i,schema:r,schemaCode:o,it:s}=t,c=s.opts.unicodeRegExp?"u":"";if(i){let{regExp:u}=s.opts.code,d=u.code==="new RegExp"?(0,ji._)`new RegExp`:(0,wj.useFunc)(e,u),l=e.let("valid");e.try(()=>e.assign(l,(0,ji._)`${d}(${o}, ${c}).test(${n})`),()=>e.assign(l,!1)),t.fail$data((0,ji._)`!${l}`)}else{let u=(0,$j.usePattern)(t,r);t.fail$data((0,ji._)`!${u}.test(${n})`)}}};bb.default=Tj});var y$=A(_b=>{"use strict";Object.defineProperty(_b,"__esModule",{value:!0});var na=X(),Rj={message({keyword:t,schemaCode:e}){let n=t==="maxProperties"?"more":"fewer";return(0,na.str)`must NOT have ${n} than ${e} properties`},params:({schemaCode:t})=>(0,na._)`{limit: ${t}}`},Oj={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:Rj,code(t){let{keyword:e,data:n,schemaCode:i}=t,r=e==="maxProperties"?na.operators.GT:na.operators.LT;t.fail$data((0,na._)`Object.keys(${n}).length ${r} ${i}`)}};_b.default=Oj});var v$=A(yb=>{"use strict";Object.defineProperty(yb,"__esModule",{value:!0});var ra=xt(),ia=X(),Pj=se(),Aj={message:({params:{missingProperty:t}})=>(0,ia.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,ia._)`{missingProperty: ${t}}`},Nj={keyword:"required",type:"object",schemaType:"array",$data:!0,error:Aj,code(t){let{gen:e,schema:n,schemaCode:i,data:r,$data:o,it:s}=t,{opts:c}=s;if(!o&&n.length===0)return;let u=n.length>=c.loopRequired;if(s.allErrors?d():l(),c.strictRequired){let f=t.parentSchema.properties,{definedProperties:h}=t.it;for(let y of n)if(f?.[y]===void 0&&!h.has(y)){let v=s.schemaEnv.baseId+s.errSchemaPath,T=`required property "${y}" is not defined at "${v}" (strictRequired)`;(0,Pj.checkStrictMode)(s,T,s.opts.strictRequired)}}function d(){if(u||o)t.block$data(ia.nil,p);else for(let f of n)(0,ra.checkReportMissingProp)(t,f)}function l(){let f=e.let("missing");if(u||o){let h=e.let("valid",!0);t.block$data(h,()=>m(f,h)),t.ok(h)}else e.if((0,ra.checkMissingProp)(t,n,f)),(0,ra.reportMissingProp)(t,f),e.else()}function p(){e.forOf("prop",i,f=>{t.setParams({missingProperty:f}),e.if((0,ra.noPropertyInData)(e,r,f,c.ownProperties),()=>t.error())})}function m(f,h){t.setParams({missingProperty:f}),e.forOf(f,i,()=>{e.assign(h,(0,ra.propertyInData)(e,r,f,c.ownProperties)),e.if((0,ia.not)(h),()=>{t.error(),e.break()})},ia.nil)}}};yb.default=Nj});var k$=A(vb=>{"use strict";Object.defineProperty(vb,"__esModule",{value:!0});var oa=X(),Cj={message({keyword:t,schemaCode:e}){let n=t==="maxItems"?"more":"fewer";return(0,oa.str)`must NOT have ${n} than ${e} items`},params:({schemaCode:t})=>(0,oa._)`{limit: ${t}}`},zj={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:Cj,code(t){let{keyword:e,data:n,schemaCode:i}=t,r=e==="maxItems"?oa.operators.GT:oa.operators.LT;t.fail$data((0,oa._)`${n}.length ${r} ${i}`)}};vb.default=zj});var Sd=A(kb=>{"use strict";Object.defineProperty(kb,"__esModule",{value:!0});var S$=qg();S$.code='require("ajv/dist/runtime/equal").default';kb.default=S$});var x$=A(xb=>{"use strict";Object.defineProperty(xb,"__esModule",{value:!0});var Sb=Vs(),Be=X(),Dj=se(),jj=Sd(),Uj={message:({params:{i:t,j:e}})=>(0,Be.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,Be._)`{i: ${t}, j: ${e}}`},Mj={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:Uj,code(t){let{gen:e,data:n,$data:i,schema:r,parentSchema:o,schemaCode:s,it:c}=t;if(!i&&!r)return;let u=e.let("valid"),d=o.items?(0,Sb.getSchemaTypes)(o.items):[];t.block$data(u,l,(0,Be._)`${s} === false`),t.ok(u);function l(){let h=e.let("i",(0,Be._)`${n}.length`),y=e.let("j");t.setParams({i:h,j:y}),e.assign(u,!0),e.if((0,Be._)`${h} > 1`,()=>(p()?m:f)(h,y))}function p(){return d.length>0&&!d.some(h=>h==="object"||h==="array")}function m(h,y){let v=e.name("item"),T=(0,Sb.checkDataTypes)(d,v,c.opts.strictNumbers,Sb.DataType.Wrong),z=e.const("indices",(0,Be._)`{}`);e.for((0,Be._)`;${h}--;`,()=>{e.let(v,(0,Be._)`${n}[${h}]`),e.if(T,(0,Be._)`continue`),d.length>1&&e.if((0,Be._)`typeof ${v} == "string"`,(0,Be._)`${v} += "_"`),e.if((0,Be._)`typeof ${z}[${v}] == "number"`,()=>{e.assign(y,(0,Be._)`${z}[${v}]`),t.error(),e.assign(u,!1).break()}).code((0,Be._)`${z}[${v}] = ${h}`)})}function f(h,y){let v=(0,Dj.useFunc)(e,jj.default),T=e.name("outer");e.label(T).for((0,Be._)`;${h}--;`,()=>e.for((0,Be._)`${y} = ${h}; ${y}--;`,()=>e.if((0,Be._)`${v}(${n}[${h}], ${n}[${y}])`,()=>{t.error(),e.assign(u,!1).break(T)})))}}};xb.default=Mj});var I$=A($b=>{"use strict";Object.defineProperty($b,"__esModule",{value:!0});var Ib=X(),Lj=se(),Zj=Sd(),Bj={message:"must be equal to constant",params:({schemaCode:t})=>(0,Ib._)`{allowedValue: ${t}}`},Fj={keyword:"const",$data:!0,error:Bj,code(t){let{gen:e,data:n,$data:i,schemaCode:r,schema:o}=t;i||o&&typeof o=="object"?t.fail$data((0,Ib._)`!${(0,Lj.useFunc)(e,Zj.default)}(${n}, ${r})`):t.fail((0,Ib._)`${o} !== ${n}`)}};$b.default=Fj});var $$=A(wb=>{"use strict";Object.defineProperty(wb,"__esModule",{value:!0});var sa=X(),qj=se(),Vj=Sd(),Hj={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,sa._)`{allowedValues: ${t}}`},Gj={keyword:"enum",schemaType:"array",$data:!0,error:Hj,code(t){let{gen:e,data:n,$data:i,schema:r,schemaCode:o,it:s}=t;if(!i&&r.length===0)throw new Error("enum must have non-empty array");let c=r.length>=s.opts.loopEnum,u,d=()=>u??(u=(0,qj.useFunc)(e,Vj.default)),l;if(c||i)l=e.let("valid"),t.block$data(l,p);else{if(!Array.isArray(r))throw new Error("ajv implementation error");let f=e.const("vSchema",o);l=(0,sa.or)(...r.map((h,y)=>m(f,y)))}t.pass(l);function p(){e.assign(l,!1),e.forOf("v",o,f=>e.if((0,sa._)`${d()}(${n}, ${f})`,()=>e.assign(l,!0).break()))}function m(f,h){let y=r[h];return typeof y=="object"&&y!==null?(0,sa._)`${d()}(${n}, ${f}[${h}])`:(0,sa._)`${n} === ${y}`}}};wb.default=Gj});var w$=A(Eb=>{"use strict";Object.defineProperty(Eb,"__esModule",{value:!0});var Kj=m$(),Wj=f$(),Jj=b$(),Yj=_$(),Xj=y$(),Qj=v$(),eU=k$(),tU=x$(),nU=I$(),rU=$$(),iU=[Kj.default,Wj.default,Jj.default,Yj.default,Xj.default,Qj.default,eU.default,tU.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},nU.default,rU.default];Eb.default=iU});var Rb=A(aa=>{"use strict";Object.defineProperty(aa,"__esModule",{value:!0});aa.validateAdditionalItems=void 0;var _r=X(),Tb=se(),oU={message:({params:{len:t}})=>(0,_r.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,_r._)`{limit: ${t}}`},sU={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:oU,code(t){let{parentSchema:e,it:n}=t,{items:i}=e;if(!Array.isArray(i)){(0,Tb.checkStrictMode)(n,'"additionalItems" is ignored when "items" is not an array of schemas');return}E$(t,i)}};function E$(t,e){let{gen:n,schema:i,data:r,keyword:o,it:s}=t;s.items=!0;let c=n.const("len",(0,_r._)`${r}.length`);if(i===!1)t.setParams({len:e.length}),t.pass((0,_r._)`${c} <= ${e.length}`);else if(typeof i=="object"&&!(0,Tb.alwaysValidSchema)(s,i)){let d=n.var("valid",(0,_r._)`${c} <= ${e.length}`);n.if((0,_r.not)(d),()=>u(d)),t.ok(d)}function u(d){n.forRange("i",e.length,c,l=>{t.subschema({keyword:o,dataProp:l,dataPropType:Tb.Type.Num},d),s.allErrors||n.if((0,_r.not)(d),()=>n.break())})}}aa.validateAdditionalItems=E$;aa.default=sU});var Ob=A(ca=>{"use strict";Object.defineProperty(ca,"__esModule",{value:!0});ca.validateTuple=void 0;var T$=X(),xd=se(),aU=xt(),cU={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:n}=t;if(Array.isArray(e))return R$(t,"additionalItems",e);n.items=!0,!(0,xd.alwaysValidSchema)(n,e)&&t.ok((0,aU.validateArray)(t))}};function R$(t,e,n=t.schema){let{gen:i,parentSchema:r,data:o,keyword:s,it:c}=t;l(r),c.opts.unevaluated&&n.length&&c.items!==!0&&(c.items=xd.mergeEvaluated.items(i,n.length,c.items));let u=i.name("valid"),d=i.const("len",(0,T$._)`${o}.length`);n.forEach((p,m)=>{(0,xd.alwaysValidSchema)(c,p)||(i.if((0,T$._)`${d} > ${m}`,()=>t.subschema({keyword:s,schemaProp:m,dataProp:m},u)),t.ok(u))});function l(p){let{opts:m,errSchemaPath:f}=c,h=n.length,y=h===p.minItems&&(h===p.maxItems||p[e]===!1);if(m.strictTuples&&!y){let v=`"${s}" is ${h}-tuple, but minItems or maxItems/${e} are not specified or different at path "${f}"`;(0,xd.checkStrictMode)(c,v,m.strictTuples)}}}ca.validateTuple=R$;ca.default=cU});var O$=A(Pb=>{"use strict";Object.defineProperty(Pb,"__esModule",{value:!0});var uU=Ob(),lU={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,uU.validateTuple)(t,"items")};Pb.default=lU});var A$=A(Ab=>{"use strict";Object.defineProperty(Ab,"__esModule",{value:!0});var P$=X(),dU=se(),pU=xt(),mU=Rb(),fU={message:({params:{len:t}})=>(0,P$.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,P$._)`{limit: ${t}}`},hU={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:fU,code(t){let{schema:e,parentSchema:n,it:i}=t,{prefixItems:r}=n;i.items=!0,!(0,dU.alwaysValidSchema)(i,e)&&(r?(0,mU.validateAdditionalItems)(t,r):t.ok((0,pU.validateArray)(t)))}};Ab.default=hU});var N$=A(Nb=>{"use strict";Object.defineProperty(Nb,"__esModule",{value:!0});var $t=X(),Id=se(),gU={message:({params:{min:t,max:e}})=>e===void 0?(0,$t.str)`must contain at least ${t} valid item(s)`:(0,$t.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,$t._)`{minContains: ${t}}`:(0,$t._)`{minContains: ${t}, maxContains: ${e}}`},bU={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:gU,code(t){let{gen:e,schema:n,parentSchema:i,data:r,it:o}=t,s,c,{minContains:u,maxContains:d}=i;o.opts.next?(s=u===void 0?1:u,c=d):s=1;let l=e.const("len",(0,$t._)`${r}.length`);if(t.setParams({min:s,max:c}),c===void 0&&s===0){(0,Id.checkStrictMode)(o,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(c!==void 0&&s>c){(0,Id.checkStrictMode)(o,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,Id.alwaysValidSchema)(o,n)){let y=(0,$t._)`${l} >= ${s}`;c!==void 0&&(y=(0,$t._)`${y} && ${l} <= ${c}`),t.pass(y);return}o.items=!0;let p=e.name("valid");c===void 0&&s===1?f(p,()=>e.if(p,()=>e.break())):s===0?(e.let(p,!0),c!==void 0&&e.if((0,$t._)`${r}.length > 0`,m)):(e.let(p,!1),m()),t.result(p,()=>t.reset());function m(){let y=e.name("_valid"),v=e.let("count",0);f(y,()=>e.if(y,()=>h(v)))}function f(y,v){e.forRange("i",0,l,T=>{t.subschema({keyword:"contains",dataProp:T,dataPropType:Id.Type.Num,compositeRule:!0},y),v()})}function h(y){e.code((0,$t._)`${y}++`),c===void 0?e.if((0,$t._)`${y} >= ${s}`,()=>e.assign(p,!0).break()):(e.if((0,$t._)`${y} > ${c}`,()=>e.assign(p,!1).break()),s===1?e.assign(p,!0):e.if((0,$t._)`${y} >= ${s}`,()=>e.assign(p,!0)))}}};Nb.default=bU});var D$=A(Jt=>{"use strict";Object.defineProperty(Jt,"__esModule",{value:!0});Jt.validateSchemaDeps=Jt.validatePropertyDeps=Jt.error=void 0;var Cb=X(),_U=se(),ua=xt();Jt.error={message:({params:{property:t,depsCount:e,deps:n}})=>{let i=e===1?"property":"properties";return(0,Cb.str)`must have ${i} ${n} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:n,missingProperty:i}})=>(0,Cb._)`{property: ${t},
|
|
7
|
+
|| ${s} === "boolean" || ${r} === null`).assign(c,(0,Y._)`[${r}]`)}}}function _z({gen:t,parentData:e,parentDataProperty:n},i){t.if((0,Y._)`${e} !== undefined`,()=>t.assign((0,Y._)`${e}[${n}]`,i))}function tb(t,e,n,i=Ui.Correct){let r=i===Ui.Correct?Y.operators.EQ:Y.operators.NEQ,o;switch(t){case"null":return(0,Y._)`${e} ${r} null`;case"array":o=(0,Y._)`Array.isArray(${e})`;break;case"object":o=(0,Y._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":o=s((0,Y._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":o=s();break;default:return(0,Y._)`typeof ${e} ${r} ${t}`}return i===Ui.Correct?o:(0,Y.not)(o);function s(c=Y.nil){return(0,Y.and)((0,Y._)`typeof ${e} == "number"`,c,n?(0,Y._)`isFinite(${e})`:Y.nil)}}Je.checkDataType=tb;function nb(t,e,n,i){if(t.length===1)return tb(t[0],e,n,i);let r,o=(0,xI.toHash)(t);if(o.array&&o.object){let s=(0,Y._)`typeof ${e} != "object"`;r=o.null?s:(0,Y._)`!${e} || ${s}`,delete o.null,delete o.array,delete o.object}else r=Y.nil;o.number&&delete o.integer;for(let s in o)r=(0,Y.and)(r,tb(s,e,n,i));return r}Je.checkDataTypes=nb;var vz={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,Y._)`{type: ${t}}`:(0,Y._)`{type: ${e}}`};function rb(t){let e=kz(t);(0,fz.reportError)(e,vz)}Je.reportTypeError=rb;function kz(t){let{gen:e,data:n,schema:i}=t,r=(0,xI.schemaRefOrVal)(t,i,"type");return{gen:e,keyword:"type",data:n,schema:i.type,schemaCode:r,schemaValue:r,parentSchema:i,params:{},it:t}}});var EI=N(gd=>{"use strict";Object.defineProperty(gd,"__esModule",{value:!0});gd.assignDefaults=void 0;var Mi=X(),Sz=se();function xz(t,e){let{properties:n,items:i}=t.schema;if(e==="object"&&n)for(let r in n)wI(t,r,n[r].default);else e==="array"&&Array.isArray(i)&&i.forEach((r,o)=>wI(t,o,r.default))}gd.assignDefaults=xz;function wI(t,e,n){let{gen:i,compositeRule:r,data:o,opts:s}=t;if(n===void 0)return;let c=(0,Mi._)`${o}${(0,Mi.getProperty)(e)}`;if(r){(0,Sz.checkStrictMode)(t,`default is ignored for: ${c}`);return}let u=(0,Mi._)`${c} === undefined`;s.useDefaults==="empty"&&(u=(0,Mi._)`${u} || ${c} === null || ${c} === ""`),i.if(u,(0,Mi._)`${c} = ${(0,Mi.stringify)(n)}`)}});var xt=N(_e=>{"use strict";Object.defineProperty(_e,"__esModule",{value:!0});_e.validateUnion=_e.validateArray=_e.usePattern=_e.callValidateCode=_e.schemaProperties=_e.allSchemaProperties=_e.noPropertyInData=_e.propertyInData=_e.isOwnProperty=_e.hasPropFunc=_e.reportMissingProp=_e.checkMissingProp=_e.checkReportMissingProp=void 0;var Ie=X(),ib=se(),Mn=pn(),Iz=se();function $z(t,e){let{gen:n,data:i,it:r}=t;n.if(sb(n,i,e,r.opts.ownProperties),()=>{t.setParams({missingProperty:(0,Ie._)`${e}`},!0),t.error()})}_e.checkReportMissingProp=$z;function wz({gen:t,data:e,it:{opts:n}},i,r){return(0,Ie.or)(...i.map(o=>(0,Ie.and)(sb(t,e,o,n.ownProperties),(0,Ie._)`${r} = ${o}`)))}_e.checkMissingProp=wz;function Ez(t,e){t.setParams({missingProperty:e},!0),t.error()}_e.reportMissingProp=Ez;function TI(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,Ie._)`Object.prototype.hasOwnProperty`})}_e.hasPropFunc=TI;function ob(t,e,n){return(0,Ie._)`${TI(t)}.call(${e}, ${n})`}_e.isOwnProperty=ob;function Tz(t,e,n,i){let r=(0,Ie._)`${e}${(0,Ie.getProperty)(n)} !== undefined`;return i?(0,Ie._)`${r} && ${ob(t,e,n)}`:r}_e.propertyInData=Tz;function sb(t,e,n,i){let r=(0,Ie._)`${e}${(0,Ie.getProperty)(n)} === undefined`;return i?(0,Ie.or)(r,(0,Ie.not)(ob(t,e,n))):r}_e.noPropertyInData=sb;function RI(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}_e.allSchemaProperties=RI;function Rz(t,e){return RI(e).filter(n=>!(0,ib.alwaysValidSchema)(t,e[n]))}_e.schemaProperties=Rz;function Oz({schemaCode:t,data:e,it:{gen:n,topSchemaRef:i,schemaPath:r,errorPath:o},it:s},c,u,l){let p=l?(0,Ie._)`${t}, ${e}, ${i}${r}`:e,d=[[Mn.default.instancePath,(0,Ie.strConcat)(Mn.default.instancePath,o)],[Mn.default.parentData,s.parentData],[Mn.default.parentDataProperty,s.parentDataProperty],[Mn.default.rootData,Mn.default.rootData]];s.opts.dynamicRef&&d.push([Mn.default.dynamicAnchors,Mn.default.dynamicAnchors]);let m=(0,Ie._)`${p}, ${n.object(...d)}`;return u!==Ie.nil?(0,Ie._)`${c}.call(${u}, ${m})`:(0,Ie._)`${c}(${m})`}_e.callValidateCode=Oz;var Pz=(0,Ie._)`new RegExp`;function Az({gen:t,it:{opts:e}},n){let i=e.unicodeRegExp?"u":"",{regExp:r}=e.code,o=r(n,i);return t.scopeValue("pattern",{key:o.toString(),ref:o,code:(0,Ie._)`${r.code==="new RegExp"?Pz:(0,Iz.useFunc)(t,r)}(${n}, ${i})`})}_e.usePattern=Az;function Nz(t){let{gen:e,data:n,keyword:i,it:r}=t,o=e.name("valid");if(r.allErrors){let c=e.let("valid",!0);return s(()=>e.assign(c,!1)),c}return e.var(o,!0),s(()=>e.break()),o;function s(c){let u=e.const("len",(0,Ie._)`${n}.length`);e.forRange("i",0,u,l=>{t.subschema({keyword:i,dataProp:l,dataPropType:ib.Type.Num},o),e.if((0,Ie.not)(o),c)})}}_e.validateArray=Nz;function Cz(t){let{gen:e,schema:n,keyword:i,it:r}=t;if(!Array.isArray(n))throw new Error("ajv implementation error");if(n.some(u=>(0,ib.alwaysValidSchema)(r,u))&&!r.opts.unevaluated)return;let s=e.let("valid",!1),c=e.name("_valid");e.block(()=>n.forEach((u,l)=>{let p=t.subschema({keyword:i,schemaProp:l,compositeRule:!0},c);e.assign(s,(0,Ie._)`${s} || ${c}`),t.mergeValidEvaluated(p,c)||e.if((0,Ie.not)(s))})),t.result(s,()=>t.reset(),()=>t.error(!0))}_e.validateUnion=Cz});var AI=N(Gt=>{"use strict";Object.defineProperty(Gt,"__esModule",{value:!0});Gt.validateKeywordUsage=Gt.validSchemaType=Gt.funcKeywordCode=Gt.macroKeywordCode=void 0;var rt=X(),kr=pn(),zz=xt(),Dz=Ys();function jz(t,e){let{gen:n,keyword:i,schema:r,parentSchema:o,it:s}=t,c=e.macro.call(s.self,r,o,s),u=PI(n,i,c);s.opts.validateSchema!==!1&&s.self.validateSchema(c,!0);let l=n.name("valid");t.subschema({schema:c,schemaPath:rt.nil,errSchemaPath:`${s.errSchemaPath}/${i}`,topSchemaRef:u,compositeRule:!0},l),t.pass(l,()=>t.error(!0))}Gt.macroKeywordCode=jz;function Uz(t,e){var n;let{gen:i,keyword:r,schema:o,parentSchema:s,$data:c,it:u}=t;Lz(u,e);let l=!c&&e.compile?e.compile.call(u.self,o,s,u):e.validate,p=PI(i,r,l),d=i.let("valid");t.block$data(d,m),t.ok((n=e.valid)!==null&&n!==void 0?n:d);function m(){if(e.errors===!1)y(),e.modifying&&OI(t),v(()=>t.error());else{let S=e.async?f():g();e.modifying&&OI(t),v(()=>Mz(t,S))}}function f(){let S=i.let("ruleErrs",null);return i.try(()=>y((0,rt._)`await `),z=>i.assign(d,!1).if((0,rt._)`${z} instanceof ${u.ValidationError}`,()=>i.assign(S,(0,rt._)`${z}.errors`),()=>i.throw(z))),S}function g(){let S=(0,rt._)`${p}.errors`;return i.assign(S,null),y(rt.nil),S}function y(S=e.async?(0,rt._)`await `:rt.nil){let z=u.opts.passContext?kr.default.this:kr.default.self,R=!("compile"in e&&!c||e.schema===!1);i.assign(d,(0,rt._)`${S}${(0,zz.callValidateCode)(t,p,z,R)}`,e.modifying)}function v(S){var z;i.if((0,rt.not)((z=e.valid)!==null&&z!==void 0?z:d),S)}}Gt.funcKeywordCode=Uz;function OI(t){let{gen:e,data:n,it:i}=t;e.if(i.parentData,()=>e.assign(n,(0,rt._)`${i.parentData}[${i.parentDataProperty}]`))}function Mz(t,e){let{gen:n}=t;n.if((0,rt._)`Array.isArray(${e})`,()=>{n.assign(kr.default.vErrors,(0,rt._)`${kr.default.vErrors} === null ? ${e} : ${kr.default.vErrors}.concat(${e})`).assign(kr.default.errors,(0,rt._)`${kr.default.vErrors}.length`),(0,Dz.extendErrors)(t)},()=>t.error())}function Lz({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function PI(t,e,n){if(n===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof n=="function"?{ref:n}:{ref:n,code:(0,rt.stringify)(n)})}function Zz(t,e,n=!1){return!e.length||e.some(i=>i==="array"?Array.isArray(t):i==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==i||n&&typeof t>"u")}Gt.validSchemaType=Zz;function Bz({schema:t,opts:e,self:n,errSchemaPath:i},r,o){if(Array.isArray(r.keyword)?!r.keyword.includes(o):r.keyword!==o)throw new Error("ajv implementation error");let s=r.dependencies;if(s?.some(c=>!Object.prototype.hasOwnProperty.call(t,c)))throw new Error(`parent schema must have dependencies of ${o}: ${s.join(",")}`);if(r.validateSchema&&!r.validateSchema(t[o])){let u=`keyword "${o}" value is invalid at path "${i}": `+n.errorsText(r.validateSchema.errors);if(e.validateSchema==="log")n.logger.error(u);else throw new Error(u)}}Gt.validateKeywordUsage=Bz});var CI=N(Ln=>{"use strict";Object.defineProperty(Ln,"__esModule",{value:!0});Ln.extendSubschemaMode=Ln.extendSubschemaData=Ln.getSubschema=void 0;var Wt=X(),NI=se();function Fz(t,{keyword:e,schemaProp:n,schema:i,schemaPath:r,errSchemaPath:o,topSchemaRef:s}){if(e!==void 0&&i!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let c=t.schema[e];return n===void 0?{schema:c,schemaPath:(0,Wt._)`${t.schemaPath}${(0,Wt.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:c[n],schemaPath:(0,Wt._)`${t.schemaPath}${(0,Wt.getProperty)(e)}${(0,Wt.getProperty)(n)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,NI.escapeFragment)(n)}`}}if(i!==void 0){if(r===void 0||o===void 0||s===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:i,schemaPath:r,topSchemaRef:s,errSchemaPath:o}}throw new Error('either "keyword" or "schema" must be passed')}Ln.getSubschema=Fz;function Vz(t,e,{dataProp:n,dataPropType:i,data:r,dataTypes:o,propertyName:s}){if(r!==void 0&&n!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:c}=e;if(n!==void 0){let{errorPath:l,dataPathArr:p,opts:d}=e,m=c.let("data",(0,Wt._)`${e.data}${(0,Wt.getProperty)(n)}`,!0);u(m),t.errorPath=(0,Wt.str)`${l}${(0,NI.getErrorPath)(n,i,d.jsPropertySyntax)}`,t.parentDataProperty=(0,Wt._)`${n}`,t.dataPathArr=[...p,t.parentDataProperty]}if(r!==void 0){let l=r instanceof Wt.Name?r:c.let("data",r,!0);u(l),s!==void 0&&(t.propertyName=s)}o&&(t.dataTypes=o);function u(l){t.data=l,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,l]}}Ln.extendSubschemaData=Vz;function qz(t,{jtdDiscriminator:e,jtdMetadata:n,compositeRule:i,createErrors:r,allErrors:o}){i!==void 0&&(t.compositeRule=i),r!==void 0&&(t.createErrors=r),o!==void 0&&(t.allErrors=o),t.jtdDiscriminator=e,t.jtdMetadata=n}Ln.extendSubschemaMode=qz});var ab=N((KK,zI)=>{"use strict";zI.exports=function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var i,r,o;if(Array.isArray(e)){if(i=e.length,i!=n.length)return!1;for(r=i;r--!==0;)if(!t(e[r],n[r]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(o=Object.keys(e),i=o.length,i!==Object.keys(n).length)return!1;for(r=i;r--!==0;)if(!Object.prototype.hasOwnProperty.call(n,o[r]))return!1;for(r=i;r--!==0;){var s=o[r];if(!t(e[s],n[s]))return!1}return!0}return e!==e&&n!==n}});var jI=N((GK,DI)=>{"use strict";var Zn=DI.exports=function(t,e,n){typeof e=="function"&&(n=e,e={}),n=e.cb||n;var i=typeof n=="function"?n:n.pre||function(){},r=n.post||function(){};hd(e,i,r,t,"",t)};Zn.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Zn.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Zn.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Zn.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 hd(t,e,n,i,r,o,s,c,u,l){if(i&&typeof i=="object"&&!Array.isArray(i)){e(i,r,o,s,c,u,l);for(var p in i){var d=i[p];if(Array.isArray(d)){if(p in Zn.arrayKeywords)for(var m=0;m<d.length;m++)hd(t,e,n,d[m],r+"/"+p+"/"+m,o,r,p,i,m)}else if(p in Zn.propsKeywords){if(d&&typeof d=="object")for(var f in d)hd(t,e,n,d[f],r+"/"+p+"/"+Hz(f),o,r,p,i,f)}else(p in Zn.keywords||t.allKeys&&!(p in Zn.skipKeywords))&&hd(t,e,n,d,r+"/"+p,o,r,p,i)}n(i,r,o,s,c,u,l)}}function Hz(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var Qs=N(dt=>{"use strict";Object.defineProperty(dt,"__esModule",{value:!0});dt.getSchemaRefs=dt.resolveUrl=dt.normalizeId=dt._getFullPath=dt.getFullPath=dt.inlineRef=void 0;var Kz=se(),Gz=ab(),Wz=jI(),Jz=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function Yz(t,e=!0){return typeof t=="boolean"?!0:e===!0?!cb(t):e?UI(t)<=e:!1}dt.inlineRef=Yz;var Xz=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function cb(t){for(let e in t){if(Xz.has(e))return!0;let n=t[e];if(Array.isArray(n)&&n.some(cb)||typeof n=="object"&&cb(n))return!0}return!1}function UI(t){let e=0;for(let n in t){if(n==="$ref")return 1/0;if(e++,!Jz.has(n)&&(typeof t[n]=="object"&&(0,Kz.eachItem)(t[n],i=>e+=UI(i)),e===1/0))return 1/0}return e}function MI(t,e="",n){n!==!1&&(e=Li(e));let i=t.parse(e);return LI(t,i)}dt.getFullPath=MI;function LI(t,e){return t.serialize(e).split("#")[0]+"#"}dt._getFullPath=LI;var Qz=/#\/?$/;function Li(t){return t?t.replace(Qz,""):""}dt.normalizeId=Li;function eD(t,e,n){return n=Li(n),t.resolve(e,n)}dt.resolveUrl=eD;var tD=/^[a-z_][-a-z0-9._]*$/i;function nD(t,e){if(typeof t=="boolean")return{};let{schemaId:n,uriResolver:i}=this.opts,r=Li(t[n]||e),o={"":r},s=MI(i,r,!1),c={},u=new Set;return Wz(t,{allKeys:!0},(d,m,f,g)=>{if(g===void 0)return;let y=s+m,v=o[g];typeof d[n]=="string"&&(v=S.call(this,d[n])),z.call(this,d.$anchor),z.call(this,d.$dynamicAnchor),o[m]=v;function S(R){let U=this.opts.uriResolver.resolve;if(R=Li(v?U(v,R):R),u.has(R))throw p(R);u.add(R);let j=this.refs[R];return typeof j=="string"&&(j=this.refs[j]),typeof j=="object"?l(d,j.schema,R):R!==Li(y)&&(R[0]==="#"?(l(d,c[R],R),c[R]=d):this.refs[R]=y),R}function z(R){if(typeof R=="string"){if(!tD.test(R))throw new Error(`invalid anchor "${R}"`);S.call(this,`#${R}`)}}}),c;function l(d,m,f){if(m!==void 0&&!Gz(d,m))throw p(f)}function p(d){return new Error(`reference "${d}" resolves to more than one schema`)}}dt.getSchemaRefs=nD});var na=N(Bn=>{"use strict";Object.defineProperty(Bn,"__esModule",{value:!0});Bn.getData=Bn.KeywordCxt=Bn.validateFunctionCode=void 0;var qI=vI(),ZI=Xs(),lb=eb(),bd=Xs(),rD=EI(),ta=AI(),ub=CI(),B=X(),K=pn(),iD=Qs(),mn=se(),ea=Ys();function oD(t){if(GI(t)&&(WI(t),KI(t))){cD(t);return}HI(t,()=>(0,qI.topBoolOrEmptySchema)(t))}Bn.validateFunctionCode=oD;function HI({gen:t,validateName:e,schema:n,schemaEnv:i,opts:r},o){r.code.es5?t.func(e,(0,B._)`${K.default.data}, ${K.default.valCxt}`,i.$async,()=>{t.code((0,B._)`"use strict"; ${BI(n,r)}`),aD(t,r),t.code(o)}):t.func(e,(0,B._)`${K.default.data}, ${sD(r)}`,i.$async,()=>t.code(BI(n,r)).code(o))}function sD(t){return(0,B._)`{${K.default.instancePath}="", ${K.default.parentData}, ${K.default.parentDataProperty}, ${K.default.rootData}=${K.default.data}${t.dynamicRef?(0,B._)`, ${K.default.dynamicAnchors}={}`:B.nil}}={}`}function aD(t,e){t.if(K.default.valCxt,()=>{t.var(K.default.instancePath,(0,B._)`${K.default.valCxt}.${K.default.instancePath}`),t.var(K.default.parentData,(0,B._)`${K.default.valCxt}.${K.default.parentData}`),t.var(K.default.parentDataProperty,(0,B._)`${K.default.valCxt}.${K.default.parentDataProperty}`),t.var(K.default.rootData,(0,B._)`${K.default.valCxt}.${K.default.rootData}`),e.dynamicRef&&t.var(K.default.dynamicAnchors,(0,B._)`${K.default.valCxt}.${K.default.dynamicAnchors}`)},()=>{t.var(K.default.instancePath,(0,B._)`""`),t.var(K.default.parentData,(0,B._)`undefined`),t.var(K.default.parentDataProperty,(0,B._)`undefined`),t.var(K.default.rootData,K.default.data),e.dynamicRef&&t.var(K.default.dynamicAnchors,(0,B._)`{}`)})}function cD(t){let{schema:e,opts:n,gen:i}=t;HI(t,()=>{n.$comment&&e.$comment&&YI(t),mD(t),i.let(K.default.vErrors,null),i.let(K.default.errors,0),n.unevaluated&&uD(t),JI(t),hD(t)})}function uD(t){let{gen:e,validateName:n}=t;t.evaluated=e.const("evaluated",(0,B._)`${n}.evaluated`),e.if((0,B._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,B._)`${t.evaluated}.props`,(0,B._)`undefined`)),e.if((0,B._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,B._)`${t.evaluated}.items`,(0,B._)`undefined`))}function BI(t,e){let n=typeof t=="object"&&t[e.schemaId];return n&&(e.code.source||e.code.process)?(0,B._)`/*# sourceURL=${n} */`:B.nil}function lD(t,e){if(GI(t)&&(WI(t),KI(t))){dD(t,e);return}(0,qI.boolOrEmptySchema)(t,e)}function KI({schema:t,self:e}){if(typeof t=="boolean")return!t;for(let n in t)if(e.RULES.all[n])return!0;return!1}function GI(t){return typeof t.schema!="boolean"}function dD(t,e){let{schema:n,gen:i,opts:r}=t;r.$comment&&n.$comment&&YI(t),fD(t),gD(t);let o=i.const("_errs",K.default.errors);JI(t,o),i.var(e,(0,B._)`${o} === ${K.default.errors}`)}function WI(t){(0,mn.checkUnknownRules)(t),pD(t)}function JI(t,e){if(t.opts.jtd)return FI(t,[],!1,e);let n=(0,ZI.getSchemaTypes)(t.schema),i=(0,ZI.coerceAndCheckDataType)(t,n);FI(t,n,!i,e)}function pD(t){let{schema:e,errSchemaPath:n,opts:i,self:r}=t;e.$ref&&i.ignoreKeywordsWithRef&&(0,mn.schemaHasRulesButRef)(e,r.RULES)&&r.logger.warn(`$ref: keywords ignored in schema at path "${n}"`)}function mD(t){let{schema:e,opts:n}=t;e.default!==void 0&&n.useDefaults&&n.strictSchema&&(0,mn.checkStrictMode)(t,"default is ignored in the schema root")}function fD(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,iD.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function gD(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function YI({gen:t,schemaEnv:e,schema:n,errSchemaPath:i,opts:r}){let o=n.$comment;if(r.$comment===!0)t.code((0,B._)`${K.default.self}.logger.log(${o})`);else if(typeof r.$comment=="function"){let s=(0,B.str)`${i}/$comment`,c=t.scopeValue("root",{ref:e.root});t.code((0,B._)`${K.default.self}.opts.$comment(${o}, ${s}, ${c}.schema)`)}}function hD(t){let{gen:e,schemaEnv:n,validateName:i,ValidationError:r,opts:o}=t;n.$async?e.if((0,B._)`${K.default.errors} === 0`,()=>e.return(K.default.data),()=>e.throw((0,B._)`new ${r}(${K.default.vErrors})`)):(e.assign((0,B._)`${i}.errors`,K.default.vErrors),o.unevaluated&&bD(t),e.return((0,B._)`${K.default.errors} === 0`))}function bD({gen:t,evaluated:e,props:n,items:i}){n instanceof B.Name&&t.assign((0,B._)`${e}.props`,n),i instanceof B.Name&&t.assign((0,B._)`${e}.items`,i)}function FI(t,e,n,i){let{gen:r,schema:o,data:s,allErrors:c,opts:u,self:l}=t,{RULES:p}=l;if(o.$ref&&(u.ignoreKeywordsWithRef||!(0,mn.schemaHasRulesButRef)(o,p))){r.block(()=>QI(t,"$ref",p.all.$ref.definition));return}u.jtd||yD(t,e),r.block(()=>{for(let m of p.rules)d(m);d(p.post)});function d(m){(0,lb.shouldUseGroup)(o,m)&&(m.type?(r.if((0,bd.checkDataType)(m.type,s,u.strictNumbers)),VI(t,m),e.length===1&&e[0]===m.type&&n&&(r.else(),(0,bd.reportTypeError)(t)),r.endIf()):VI(t,m),c||r.if((0,B._)`${K.default.errors} === ${i||0}`))}}function VI(t,e){let{gen:n,schema:i,opts:{useDefaults:r}}=t;r&&(0,rD.assignDefaults)(t,e.type),n.block(()=>{for(let o of e.rules)(0,lb.shouldUseRule)(i,o)&&QI(t,o.keyword,o.definition,e.type)})}function yD(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(_D(t,e),t.opts.allowUnionTypes||vD(t,e),kD(t,t.dataTypes))}function _D(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(n=>{XI(t.dataTypes,n)||db(t,`type "${n}" not allowed by context "${t.dataTypes.join(",")}"`)}),xD(t,e)}}function vD(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&db(t,"use allowUnionTypes to allow union type keyword")}function kD(t,e){let n=t.self.RULES.all;for(let i in n){let r=n[i];if(typeof r=="object"&&(0,lb.shouldUseRule)(t.schema,r)){let{type:o}=r.definition;o.length&&!o.some(s=>SD(e,s))&&db(t,`missing type "${o.join(",")}" for keyword "${i}"`)}}}function SD(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function XI(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function xD(t,e){let n=[];for(let i of t.dataTypes)XI(e,i)?n.push(i):e.includes("integer")&&i==="number"&&n.push("integer");t.dataTypes=n}function db(t,e){let n=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${n}" (strictTypes)`,(0,mn.checkStrictMode)(t,e,t.opts.strictTypes)}var yd=class{constructor(e,n,i){if((0,ta.validateKeywordUsage)(e,n,i),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=i,this.data=e.data,this.schema=e.schema[i],this.$data=n.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,mn.schemaRefOrVal)(e,this.schema,i,this.$data),this.schemaType=n.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=n,this.$data)this.schemaCode=e.gen.const("vSchema",e$(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,ta.validSchemaType)(this.schema,n.schemaType,n.allowUndefined))throw new Error(`${i} value must be ${JSON.stringify(n.schemaType)}`);("code"in n?n.trackErrors:n.errors!==!1)&&(this.errsCount=e.gen.const("_errs",K.default.errors))}result(e,n,i){this.failResult((0,B.not)(e),n,i)}failResult(e,n,i){this.gen.if(e),i?i():this.error(),n?(this.gen.else(),n(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,n){this.failResult((0,B.not)(e),void 0,n)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:n}=this;this.fail((0,B._)`${n} !== undefined && (${(0,B.or)(this.invalid$data(),e)})`)}error(e,n,i){if(n){this.setParams(n),this._error(e,i),this.setParams({});return}this._error(e,i)}_error(e,n){(e?ea.reportExtraError:ea.reportError)(this,this.def.error,n)}$dataError(){(0,ea.reportError)(this,this.def.$dataError||ea.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,ea.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,n){n?Object.assign(this.params,e):this.params=e}block$data(e,n,i=B.nil){this.gen.block(()=>{this.check$data(e,i),n()})}check$data(e=B.nil,n=B.nil){if(!this.$data)return;let{gen:i,schemaCode:r,schemaType:o,def:s}=this;i.if((0,B.or)((0,B._)`${r} === undefined`,n)),e!==B.nil&&i.assign(e,!0),(o.length||s.validateSchema)&&(i.elseIf(this.invalid$data()),this.$dataError(),e!==B.nil&&i.assign(e,!1)),i.else()}invalid$data(){let{gen:e,schemaCode:n,schemaType:i,def:r,it:o}=this;return(0,B.or)(s(),c());function s(){if(i.length){if(!(n instanceof B.Name))throw new Error("ajv implementation error");let u=Array.isArray(i)?i:[i];return(0,B._)`${(0,bd.checkDataTypes)(u,n,o.opts.strictNumbers,bd.DataType.Wrong)}`}return B.nil}function c(){if(r.validateSchema){let u=e.scopeValue("validate$data",{ref:r.validateSchema});return(0,B._)`!${u}(${n})`}return B.nil}}subschema(e,n){let i=(0,ub.getSubschema)(this.it,e);(0,ub.extendSubschemaData)(i,this.it,e),(0,ub.extendSubschemaMode)(i,e);let r={...this.it,...i,items:void 0,props:void 0};return lD(r,n),r}mergeEvaluated(e,n){let{it:i,gen:r}=this;i.opts.unevaluated&&(i.props!==!0&&e.props!==void 0&&(i.props=mn.mergeEvaluated.props(r,e.props,i.props,n)),i.items!==!0&&e.items!==void 0&&(i.items=mn.mergeEvaluated.items(r,e.items,i.items,n)))}mergeValidEvaluated(e,n){let{it:i,gen:r}=this;if(i.opts.unevaluated&&(i.props!==!0||i.items!==!0))return r.if(n,()=>this.mergeEvaluated(e,B.Name)),!0}};Bn.KeywordCxt=yd;function QI(t,e,n,i){let r=new yd(t,n,e);"code"in n?n.code(r,i):r.$data&&n.validate?(0,ta.funcKeywordCode)(r,n):"macro"in n?(0,ta.macroKeywordCode)(r,n):(n.compile||n.validate)&&(0,ta.funcKeywordCode)(r,n)}var ID=/^\/(?:[^~]|~0|~1)*$/,$D=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function e$(t,{dataLevel:e,dataNames:n,dataPathArr:i}){let r,o;if(t==="")return K.default.rootData;if(t[0]==="/"){if(!ID.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);r=t,o=K.default.rootData}else{let l=$D.exec(t);if(!l)throw new Error(`Invalid JSON-pointer: ${t}`);let p=+l[1];if(r=l[2],r==="#"){if(p>=e)throw new Error(u("property/index",p));return i[e-p]}if(p>e)throw new Error(u("data",p));if(o=n[e-p],!r)return o}let s=o,c=r.split("/");for(let l of c)l&&(o=(0,B._)`${o}${(0,B.getProperty)((0,mn.unescapeJsonPointer)(l))}`,s=(0,B._)`${s} && ${o}`);return s;function u(l,p){return`Cannot access ${l} ${p} levels up, current level is ${e}`}}Bn.getData=e$});var _d=N(mb=>{"use strict";Object.defineProperty(mb,"__esModule",{value:!0});var pb=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};mb.default=pb});var ra=N(hb=>{"use strict";Object.defineProperty(hb,"__esModule",{value:!0});var fb=Qs(),gb=class extends Error{constructor(e,n,i,r){super(r||`can't resolve reference ${i} from id ${n}`),this.missingRef=(0,fb.resolveUrl)(e,n,i),this.missingSchema=(0,fb.normalizeId)((0,fb.getFullPath)(e,this.missingRef))}};hb.default=gb});var kd=N(It=>{"use strict";Object.defineProperty(It,"__esModule",{value:!0});It.resolveSchema=It.getCompilingSchema=It.resolveRef=It.compileSchema=It.SchemaEnv=void 0;var Dt=X(),wD=_d(),Sr=pn(),jt=Qs(),t$=se(),ED=na(),Zi=class{constructor(e){var n;this.refs={},this.dynamicAnchors={};let i;typeof e.schema=="object"&&(i=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(n=e.baseId)!==null&&n!==void 0?n:(0,jt.normalizeId)(i?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=i?.$async,this.refs={}}};It.SchemaEnv=Zi;function yb(t){let e=n$.call(this,t);if(e)return e;let n=(0,jt.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:i,lines:r}=this.opts.code,{ownProperties:o}=this.opts,s=new Dt.CodeGen(this.scope,{es5:i,lines:r,ownProperties:o}),c;t.$async&&(c=s.scopeValue("Error",{ref:wD.default,code:(0,Dt._)`require("ajv/dist/runtime/validation_error").default`}));let u=s.scopeName("validate");t.validateName=u;let l={gen:s,allErrors:this.opts.allErrors,data:Sr.default.data,parentData:Sr.default.parentData,parentDataProperty:Sr.default.parentDataProperty,dataNames:[Sr.default.data],dataPathArr:[Dt.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:s.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,Dt.stringify)(t.schema)}:{ref:t.schema}),validateName:u,ValidationError:c,schema:t.schema,schemaEnv:t,rootId:n,baseId:t.baseId||n,schemaPath:Dt.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Dt._)`""`,opts:this.opts,self:this},p;try{this._compilations.add(t),(0,ED.validateFunctionCode)(l),s.optimize(this.opts.code.optimize);let d=s.toString();p=`${s.scopeRefs(Sr.default.scope)}return ${d}`,this.opts.code.process&&(p=this.opts.code.process(p,t));let f=new Function(`${Sr.default.self}`,`${Sr.default.scope}`,p)(this,this.scope.get());if(this.scope.value(u,{ref:f}),f.errors=null,f.schema=t.schema,f.schemaEnv=t,t.$async&&(f.$async=!0),this.opts.code.source===!0&&(f.source={validateName:u,validateCode:d,scopeValues:s._values}),this.opts.unevaluated){let{props:g,items:y}=l;f.evaluated={props:g instanceof Dt.Name?void 0:g,items:y instanceof Dt.Name?void 0:y,dynamicProps:g instanceof Dt.Name,dynamicItems:y instanceof Dt.Name},f.source&&(f.source.evaluated=(0,Dt.stringify)(f.evaluated))}return t.validate=f,t}catch(d){throw delete t.validate,delete t.validateName,p&&this.logger.error("Error compiling schema, function code:",p),d}finally{this._compilations.delete(t)}}It.compileSchema=yb;function TD(t,e,n){var i;n=(0,jt.resolveUrl)(this.opts.uriResolver,e,n);let r=t.refs[n];if(r)return r;let o=PD.call(this,t,n);if(o===void 0){let s=(i=t.localRefs)===null||i===void 0?void 0:i[n],{schemaId:c}=this.opts;s&&(o=new Zi({schema:s,schemaId:c,root:t,baseId:e}))}if(o!==void 0)return t.refs[n]=RD.call(this,o)}It.resolveRef=TD;function RD(t){return(0,jt.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:yb.call(this,t)}function n$(t){for(let e of this._compilations)if(OD(e,t))return e}It.getCompilingSchema=n$;function OD(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function PD(t,e){let n;for(;typeof(n=this.refs[e])=="string";)e=n;return n||this.schemas[e]||vd.call(this,t,e)}function vd(t,e){let n=this.opts.uriResolver.parse(e),i=(0,jt._getFullPath)(this.opts.uriResolver,n),r=(0,jt.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&i===r)return bb.call(this,n,t);let o=(0,jt.normalizeId)(i),s=this.refs[o]||this.schemas[o];if(typeof s=="string"){let c=vd.call(this,t,s);return typeof c?.schema!="object"?void 0:bb.call(this,n,c)}if(typeof s?.schema=="object"){if(s.validate||yb.call(this,s),o===(0,jt.normalizeId)(e)){let{schema:c}=s,{schemaId:u}=this.opts,l=c[u];return l&&(r=(0,jt.resolveUrl)(this.opts.uriResolver,r,l)),new Zi({schema:c,schemaId:u,root:t,baseId:r})}return bb.call(this,n,s)}}It.resolveSchema=vd;var AD=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function bb(t,{baseId:e,schema:n,root:i}){var r;if(((r=t.fragment)===null||r===void 0?void 0:r[0])!=="/")return;for(let c of t.fragment.slice(1).split("/")){if(typeof n=="boolean")return;let u=n[(0,t$.unescapeFragment)(c)];if(u===void 0)return;n=u;let l=typeof n=="object"&&n[this.opts.schemaId];!AD.has(c)&&l&&(e=(0,jt.resolveUrl)(this.opts.uriResolver,e,l))}let o;if(typeof n!="boolean"&&n.$ref&&!(0,t$.schemaHasRulesButRef)(n,this.RULES)){let c=(0,jt.resolveUrl)(this.opts.uriResolver,e,n.$ref);o=vd.call(this,i,c)}let{schemaId:s}=this.opts;if(o=o||new Zi({schema:n,schemaId:s,root:i,baseId:e}),o.schema!==o.root.schema)return o}});var r$=N((eG,ND)=>{ND.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 kb=N((tG,u$)=>{"use strict";var CD=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),o$=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),_b=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),s$=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),zD=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function vb(t){let e="",n=0,i=0;for(i=0;i<t.length;i++)if(n=t[i].charCodeAt(0),n!==48){if(!(n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102))return"";e+=t[i];break}for(i+=1;i<t.length;i++){if(n=t[i].charCodeAt(0),!(n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102))return"";e+=t[i]}return e}var DD=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function i$(t){return t.length=0,!0}function jD(t,e,n){if(t.length){let i=vb(t);if(i!=="")e.push(i);else return n.error=!0,!1;t.length=0}return!0}function UD(t){let e=0,n={error:!1,address:"",zone:""},i=[],r=[],o=!1,s=!1,c=jD;for(let u=0;u<t.length;u++){let l=t[u];if(!(l==="["||l==="]"))if(l===":"){if(o===!0&&(s=!0),!c(r,i,n))break;if(++e>7){n.error=!0;break}u>0&&t[u-1]===":"&&(o=!0),i.push(":");continue}else if(l==="%"){if(!c(r,i,n))break;c=i$}else{r.push(l);continue}}return r.length&&(c===i$?n.zone=r.join(""):s?i.push(r.join("")):i.push(vb(r))),n.address=i.join(""),n}function a$(t){if(MD(t,":")<2)return{host:t,isIPV6:!1};let e=UD(t);if(e.error)return{host:t,isIPV6:!1};{let n=e.address,i=e.address;return e.zone&&(n+="%"+e.zone,i+="%25"+e.zone),{host:n,isIPV6:!0,escapedHost:i}}}function MD(t,e){let n=0;for(let i=0;i<t.length;i++)t[i]===e&&n++;return n}function LD(t){let e=t,n=[],i=-1,r=0;for(;r=e.length;){if(r===1){if(e===".")break;if(e==="/"){n.push("/");break}else{n.push(e);break}}else if(r===2){if(e[0]==="."){if(e[1]===".")break;if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&(e[1]==="."||e[1]==="/")){n.push("/");break}}else if(r===3&&e==="/.."){n.length!==0&&n.pop(),n.push("/");break}if(e[0]==="."){if(e[1]==="."){if(e[2]==="/"){e=e.slice(3);continue}}else if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&e[1]==="."){if(e[2]==="/"){e=e.slice(2);continue}else if(e[2]==="."&&e[3]==="/"){e=e.slice(3),n.length!==0&&n.pop();continue}}if((i=e.indexOf("/",1))===-1){n.push(e);break}else n.push(e.slice(0,i)),e=e.slice(i)}return n.join("")}var ZD={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},BD=/[@/?#:]/g,FD=/[@/?#]/g;function c$(t,e){let n=e?FD:BD;return n.lastIndex=0,t.replace(n,i=>ZD[i])}function VD(t,e=!1){if(t.indexOf("%")===-1)return t;let n="";for(let i=0;i<t.length;i++){if(t[i]==="%"&&i+2<t.length){let r=t.slice(i+1,i+3);if(_b(r)){let o=r.toUpperCase(),s=String.fromCharCode(parseInt(o,16));e&&s$(s)?n+=s:n+="%"+o,i+=2;continue}}n+=t[i]}return n}function qD(t){let e="";for(let n=0;n<t.length;n++){if(t[n]==="%"&&n+2<t.length){let i=t.slice(n+1,n+3);if(_b(i)){let r=i.toUpperCase(),o=String.fromCharCode(parseInt(r,16));o!=="."&&s$(o)?e+=o:e+="%"+r,n+=2;continue}}zD(t[n])?e+=t[n]:e+=escape(t[n])}return e}function HD(t){let e="";for(let n=0;n<t.length;n++){if(t[n]==="%"&&n+2<t.length){let i=t.slice(n+1,n+3);if(_b(i)){e+="%"+i.toUpperCase(),n+=2;continue}}e+=escape(t[n])}return e}function KD(t){let e=[];if(t.userinfo!==void 0&&(e.push(t.userinfo),e.push("@")),t.host!==void 0){let n=unescape(t.host);if(!o$(n)){let i=a$(n);i.isIPV6===!0?n=`[${i.escapedHost}]`:n=c$(n,!1)}e.push(n)}return(typeof t.port=="number"||typeof t.port=="string")&&(e.push(":"),e.push(String(t.port))),e.length?e.join(""):void 0}u$.exports={nonSimpleDomain:DD,recomposeAuthority:KD,reescapeHostDelimiters:c$,normalizePercentEncoding:VD,normalizePathEncoding:qD,escapePreservingEscapes:HD,removeDotSegments:LD,isIPv4:o$,isUUID:CD,normalizeIPv6:a$,stringArrayToHexStripped:vb}});var f$=N((nG,m$)=>{"use strict";var{isUUID:GD}=kb(),WD=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,JD=["http","https","ws","wss","urn","urn:uuid"];function YD(t){return JD.indexOf(t)!==-1}function Sb(t){return t.secure===!0?!0:t.secure===!1?!1:t.scheme?t.scheme.length===3&&(t.scheme[0]==="w"||t.scheme[0]==="W")&&(t.scheme[1]==="s"||t.scheme[1]==="S")&&(t.scheme[2]==="s"||t.scheme[2]==="S"):!1}function l$(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function d$(t){let e=String(t.scheme).toLowerCase()==="https";return(t.port===(e?443:80)||t.port==="")&&(t.port=void 0),t.path||(t.path="/"),t}function XD(t){return t.secure=Sb(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function QD(t){if((t.port===(Sb(t)?443:80)||t.port==="")&&(t.port=void 0),typeof t.secure=="boolean"&&(t.scheme=t.secure?"wss":"ws",t.secure=void 0),t.resourceName){let[e,n]=t.resourceName.split("?");t.path=e&&e!=="/"?e:void 0,t.query=n,t.resourceName=void 0}return t.fragment=void 0,t}function ej(t,e){if(!t.path)return t.error="URN can not be parsed",t;let n=t.path.match(WD);if(n){let i=e.scheme||t.scheme||"urn";t.nid=n[1].toLowerCase(),t.nss=n[2];let r=`${i}:${e.nid||t.nid}`,o=xb(r);t.path=void 0,o&&(t=o.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}function tj(t,e){if(t.nid===void 0)throw new Error("URN without nid cannot be serialized");let n=e.scheme||t.scheme||"urn",i=t.nid.toLowerCase(),r=`${n}:${e.nid||i}`,o=xb(r);o&&(t=o.serialize(t,e));let s=t,c=t.nss;return s.path=`${i||e.nid}:${c}`,e.skipEscape=!0,s}function nj(t,e){let n=t;return n.uuid=n.nss,n.nss=void 0,!e.tolerant&&(!n.uuid||!GD(n.uuid))&&(n.error=n.error||"UUID is not valid."),n}function rj(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var p$={scheme:"http",domainHost:!0,parse:l$,serialize:d$},ij={scheme:"https",domainHost:p$.domainHost,parse:l$,serialize:d$},Sd={scheme:"ws",domainHost:!0,parse:XD,serialize:QD},oj={scheme:"wss",domainHost:Sd.domainHost,parse:Sd.parse,serialize:Sd.serialize},sj={scheme:"urn",parse:ej,serialize:tj,skipNormalize:!0},aj={scheme:"urn:uuid",parse:nj,serialize:rj,skipNormalize:!0},xd={http:p$,https:ij,ws:Sd,wss:oj,urn:sj,"urn:uuid":aj};Object.setPrototypeOf(xd,null);function xb(t){return t&&(xd[t]||xd[t.toLowerCase()])||void 0}m$.exports={wsIsSecure:Sb,SCHEMES:xd,isValidSchemeName:YD,getSchemeHandler:xb}});var _$=N((rG,wd)=>{"use strict";var{normalizeIPv6:cj,removeDotSegments:ia,recomposeAuthority:uj,normalizePercentEncoding:lj,normalizePathEncoding:dj,escapePreservingEscapes:pj,reescapeHostDelimiters:mj,isIPv4:fj,nonSimpleDomain:gj}=kb(),{SCHEMES:hj,getSchemeHandler:h$}=f$();function bj(t,e){return typeof t=="string"?t=Ij(t,e):typeof t=="object"&&(t=$d(xr(t,e),e)),t}function yj(t,e,n){let i=n?Object.assign({scheme:"null"},n):{scheme:"null"},{parsed:r,malformedAuthorityOrPort:o}=Id(t,i),{parsed:s,malformedAuthorityOrPort:c}=Id(e,i);if(o||c)throw new Error(r.error||s.error||"URI is malformed.");let u=b$(r,s,i,!0);return i.skipEscape=!0,xr(u,i)}function b$(t,e,n,i){let r={};return i||(t=$d(xr(t,n),n),e=$d(xr(e,n),n)),n=n||{},!n.tolerant&&e.scheme?(r.scheme=e.scheme,r.userinfo=e.userinfo,r.host=e.host,r.port=e.port,r.path=ia(e.path||""),r.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(r.userinfo=e.userinfo,r.host=e.host,r.port=e.port,r.path=ia(e.path||""),r.query=e.query):(e.path?(e.path[0]==="/"?r.path=ia(e.path):((t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)&&!t.path?r.path="/"+e.path:t.path?r.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+e.path:r.path=e.path,r.path=ia(r.path)),r.query=e.query):(r.path=t.path,e.query!==void 0?r.query=e.query:r.query=t.query),r.userinfo=t.userinfo,r.host=t.host,r.port=t.port),r.scheme=t.scheme),r.fragment=e.fragment,r}function _j(t,e,n){let i=g$(t,n),r=g$(e,n);return i!==void 0&&r!==void 0&&i.toLowerCase()===r.toLowerCase()}function xr(t,e){let n={host:t.host,scheme:t.scheme,userinfo:t.userinfo,port:t.port,path:t.path,query:t.query,nid:t.nid,nss:t.nss,uuid:t.uuid,fragment:t.fragment,reference:t.reference,resourceName:t.resourceName,secure:t.secure,error:""},i=Object.assign({},e),r=[],o=h$(i.scheme||n.scheme);o&&o.serialize&&o.serialize(n,i),n.path!==void 0&&(i.skipEscape?n.path=lj(n.path):(n.path=pj(n.path),n.scheme!==void 0&&(n.path=n.path.split("%3A").join(":")))),i.reference!=="suffix"&&n.scheme&&r.push(n.scheme,":");let s=uj(n);if(s!==void 0&&(i.reference!=="suffix"&&r.push("//"),r.push(s),n.path&&n.path[0]!=="/"&&r.push("/")),n.path!==void 0){let c=n.path;!i.absolutePath&&(!o||!o.absolutePath)&&(c=ia(c)),s===void 0&&c[0]==="/"&&c[1]==="/"&&(c="/%2F"+c.slice(2)),r.push(c)}return n.query!==void 0&&r.push("?",n.query),n.fragment!==void 0&&r.push("#",n.fragment),r.join("")}var vj=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u,kj=/^(?:[^#/:?]+:)?\/\/([^/?#]*)/,Sj=/^(?:[^#/:?]+:)?([/\\\t\n\r]*)/;function xj(t,e){if(e[2]!==void 0&&t.path&&t.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof t.port=="number"&&(t.port<0||t.port>65535))return"URI port is malformed."}function Id(t,e){let n=Object.assign({},e),i={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},r=!1,o=!1;n.reference==="suffix"&&(n.scheme?t=n.scheme+":"+t:t="//"+t);let s=t.match(kj);s!==null&&s[1].indexOf("\\")!==-1&&(i.error="URI authority must not contain a literal backslash.",r=!0);let c=t.match(Sj);if(c!==null){let l=c[1],p=l.replace(/[\t\n\r]/g,"");p.length>=2&&(p.slice(0,2)!=="//"?(i.error=i.error||"URI authority must not contain a literal backslash.",r=!0):l.length!==p.length&&(i.error=i.error||"URI authority introducer must not contain whitespace.",r=!0))}let u=t.match(vj);if(u){i.scheme=u[1],i.userinfo=u[3],i.host=u[4],i.port=parseInt(u[5],10),i.path=u[6]||"",i.query=u[7],i.fragment=u[8],isNaN(i.port)&&(i.port=u[5]);let l=xj(i,u);if(l!==void 0&&(i.error=i.error||l,r=!0),i.host)if(fj(i.host)===!1){let m=cj(i.host);i.host=m.host.toLowerCase(),o=m.isIPV6}else o=!0;i.scheme===void 0&&i.userinfo===void 0&&i.host===void 0&&i.port===void 0&&i.query===void 0&&!i.path?i.reference="same-document":i.scheme===void 0?i.reference="relative":i.fragment===void 0?i.reference="absolute":i.reference="uri",n.reference&&n.reference!=="suffix"&&n.reference!==i.reference&&(i.error=i.error||"URI is not a "+n.reference+" reference.");let p=h$(n.scheme||i.scheme);if(!n.unicodeSupport&&(!p||!p.unicodeSupport)&&i.host&&(n.domainHost||p&&p.domainHost)&&o===!1&&gj(i.host))try{i.host=new URL("http://"+i.host).hostname}catch(d){i.error=i.error||"Host's domain name can not be converted to ASCII: "+d}if((!p||p&&!p.skipNormalize)&&(t.indexOf("%")!==-1&&(i.scheme!==void 0&&(i.scheme=unescape(i.scheme)),i.host!==void 0&&(i.host=mj(unescape(i.host),o))),i.path&&(i.path=dj(i.path)),i.fragment))try{i.fragment=encodeURI(decodeURIComponent(i.fragment))}catch{i.error=i.error||"URI malformed"}p&&p.parse&&p.parse(i,n)}else i.error=i.error||"URI can not be parsed.";return{parsed:i,malformedAuthorityOrPort:r}}function $d(t,e){return Id(t,e).parsed}function Ij(t,e){return y$(t,e).normalized}function y$(t,e){let{parsed:n,malformedAuthorityOrPort:i}=Id(t,e);return{normalized:i?t:xr(n,e),malformedAuthorityOrPort:i}}function g$(t,e){if(typeof t=="string"){let{normalized:n,malformedAuthorityOrPort:i}=y$(t,e);return i?void 0:n}if(typeof t=="object")return xr(t,e)}var Ib={SCHEMES:hj,normalize:bj,resolve:yj,resolveComponent:b$,equal:_j,serialize:xr,parse:$d};wd.exports=Ib;wd.exports.default=Ib;wd.exports.fastUri=Ib});var k$=N($b=>{"use strict";Object.defineProperty($b,"__esModule",{value:!0});var v$=_$();v$.code='require("ajv/dist/runtime/uri").default';$b.default=v$});var R$=N(Ve=>{"use strict";Object.defineProperty(Ve,"__esModule",{value:!0});Ve.CodeGen=Ve.Name=Ve.nil=Ve.stringify=Ve.str=Ve._=Ve.KeywordCxt=void 0;var $j=na();Object.defineProperty(Ve,"KeywordCxt",{enumerable:!0,get:function(){return $j.KeywordCxt}});var Bi=X();Object.defineProperty(Ve,"_",{enumerable:!0,get:function(){return Bi._}});Object.defineProperty(Ve,"str",{enumerable:!0,get:function(){return Bi.str}});Object.defineProperty(Ve,"stringify",{enumerable:!0,get:function(){return Bi.stringify}});Object.defineProperty(Ve,"nil",{enumerable:!0,get:function(){return Bi.nil}});Object.defineProperty(Ve,"Name",{enumerable:!0,get:function(){return Bi.Name}});Object.defineProperty(Ve,"CodeGen",{enumerable:!0,get:function(){return Bi.CodeGen}});var wj=_d(),w$=ra(),Ej=Qh(),oa=kd(),Tj=X(),sa=Qs(),Ed=Xs(),Eb=se(),S$=r$(),Rj=k$(),E$=(t,e)=>new RegExp(t,e);E$.code="new RegExp";var Oj=["removeAdditional","useDefaults","coerceTypes"],Pj=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),Aj={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."},Nj={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},x$=200;function Cj(t){var e,n,i,r,o,s,c,u,l,p,d,m,f,g,y,v,S,z,R,U,j,je,bt,vo,Pp;let ko=t.strict,Ap=(e=t.code)===null||e===void 0?void 0:e.optimize,F_=Ap===!0||Ap===void 0?1:Ap||0,V_=(i=(n=t.code)===null||n===void 0?void 0:n.regExp)!==null&&i!==void 0?i:E$,EO=(r=t.uriResolver)!==null&&r!==void 0?r:Rj.default;return{strictSchema:(s=(o=t.strictSchema)!==null&&o!==void 0?o:ko)!==null&&s!==void 0?s:!0,strictNumbers:(u=(c=t.strictNumbers)!==null&&c!==void 0?c:ko)!==null&&u!==void 0?u:!0,strictTypes:(p=(l=t.strictTypes)!==null&&l!==void 0?l:ko)!==null&&p!==void 0?p:"log",strictTuples:(m=(d=t.strictTuples)!==null&&d!==void 0?d:ko)!==null&&m!==void 0?m:"log",strictRequired:(g=(f=t.strictRequired)!==null&&f!==void 0?f:ko)!==null&&g!==void 0?g:!1,code:t.code?{...t.code,optimize:F_,regExp:V_}:{optimize:F_,regExp:V_},loopRequired:(y=t.loopRequired)!==null&&y!==void 0?y:x$,loopEnum:(v=t.loopEnum)!==null&&v!==void 0?v:x$,meta:(S=t.meta)!==null&&S!==void 0?S:!0,messages:(z=t.messages)!==null&&z!==void 0?z:!0,inlineRefs:(R=t.inlineRefs)!==null&&R!==void 0?R:!0,schemaId:(U=t.schemaId)!==null&&U!==void 0?U:"$id",addUsedSchema:(j=t.addUsedSchema)!==null&&j!==void 0?j:!0,validateSchema:(je=t.validateSchema)!==null&&je!==void 0?je:!0,validateFormats:(bt=t.validateFormats)!==null&&bt!==void 0?bt:!0,unicodeRegExp:(vo=t.unicodeRegExp)!==null&&vo!==void 0?vo:!0,int32range:(Pp=t.int32range)!==null&&Pp!==void 0?Pp:!0,uriResolver:EO}}var aa=class{constructor(e={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...Cj(e)};let{es5:n,lines:i}=this.opts.code;this.scope=new Tj.ValueScope({scope:{},prefixes:Pj,es5:n,lines:i}),this.logger=Lj(e.logger);let r=e.validateFormats;e.validateFormats=!1,this.RULES=(0,Ej.getRules)(),I$.call(this,Aj,e,"NOT SUPPORTED"),I$.call(this,Nj,e,"DEPRECATED","warn"),this._metaOpts=Uj.call(this),e.formats&&Dj.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&jj.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),zj.call(this),e.validateFormats=r}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:n,schemaId:i}=this.opts,r=S$;i==="id"&&(r={...S$},r.id=r.$id,delete r.$id),n&&e&&this.addMetaSchema(r,r[i],!1)}defaultMeta(){let{meta:e,schemaId:n}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[n]||e:void 0}validate(e,n){let i;if(typeof e=="string"){if(i=this.getSchema(e),!i)throw new Error(`no schema with key or ref "${e}"`)}else i=this.compile(e);let r=i(n);return"$async"in i||(this.errors=i.errors),r}compile(e,n){let i=this._addSchema(e,n);return i.validate||this._compileSchemaEnv(i)}compileAsync(e,n){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:i}=this.opts;return r.call(this,e,n);async function r(p,d){await o.call(this,p.$schema);let m=this._addSchema(p,d);return m.validate||s.call(this,m)}async function o(p){p&&!this.getSchema(p)&&await r.call(this,{$ref:p},!0)}async function s(p){try{return this._compileSchemaEnv(p)}catch(d){if(!(d instanceof w$.default))throw d;return c.call(this,d),await u.call(this,d.missingSchema),s.call(this,p)}}function c({missingSchema:p,missingRef:d}){if(this.refs[p])throw new Error(`AnySchema ${p} is loaded but ${d} cannot be resolved`)}async function u(p){let d=await l.call(this,p);this.refs[p]||await o.call(this,d.$schema),this.refs[p]||this.addSchema(d,p,n)}async function l(p){let d=this._loading[p];if(d)return d;try{return await(this._loading[p]=i(p))}finally{delete this._loading[p]}}}addSchema(e,n,i,r=this.opts.validateSchema){if(Array.isArray(e)){for(let s of e)this.addSchema(s,void 0,i,r);return this}let o;if(typeof e=="object"){let{schemaId:s}=this.opts;if(o=e[s],o!==void 0&&typeof o!="string")throw new Error(`schema ${s} must be string`)}return n=(0,sa.normalizeId)(n||o),this._checkUnique(n),this.schemas[n]=this._addSchema(e,i,n,r,!0),this}addMetaSchema(e,n,i=this.opts.validateSchema){return this.addSchema(e,n,!0,i),this}validateSchema(e,n){if(typeof e=="boolean")return!0;let i;if(i=e.$schema,i!==void 0&&typeof i!="string")throw new Error("$schema must be a string");if(i=i||this.opts.defaultMeta||this.defaultMeta(),!i)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let r=this.validate(i,e);if(!r&&n){let o="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(o);else throw new Error(o)}return r}getSchema(e){let n;for(;typeof(n=$$.call(this,e))=="string";)e=n;if(n===void 0){let{schemaId:i}=this.opts,r=new oa.SchemaEnv({schema:{},schemaId:i});if(n=oa.resolveSchema.call(this,r,e),!n)return;this.refs[e]=n}return n.validate||this._compileSchemaEnv(n)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let n=$$.call(this,e);return typeof n=="object"&&this._cache.delete(n.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let n=e;this._cache.delete(n);let i=e[this.opts.schemaId];return i&&(i=(0,sa.normalizeId)(i),delete this.schemas[i],delete this.refs[i]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let n of e)this.addKeyword(n);return this}addKeyword(e,n){let i;if(typeof e=="string")i=e,typeof n=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),n.keyword=i);else if(typeof e=="object"&&n===void 0){if(n=e,i=n.keyword,Array.isArray(i)&&!i.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(Bj.call(this,i,n),!n)return(0,Eb.eachItem)(i,o=>wb.call(this,o)),this;Vj.call(this,n);let r={...n,type:(0,Ed.getJSONTypes)(n.type),schemaType:(0,Ed.getJSONTypes)(n.schemaType)};return(0,Eb.eachItem)(i,r.type.length===0?o=>wb.call(this,o,r):o=>r.type.forEach(s=>wb.call(this,o,r,s))),this}getKeyword(e){let n=this.RULES.all[e];return typeof n=="object"?n.definition:!!n}removeKeyword(e){let{RULES:n}=this;delete n.keywords[e],delete n.all[e];for(let i of n.rules){let r=i.rules.findIndex(o=>o.keyword===e);r>=0&&i.rules.splice(r,1)}return this}addFormat(e,n){return typeof n=="string"&&(n=new RegExp(n)),this.formats[e]=n,this}errorsText(e=this.errors,{separator:n=", ",dataVar:i="data"}={}){return!e||e.length===0?"No errors":e.map(r=>`${i}${r.instancePath} ${r.message}`).reduce((r,o)=>r+n+o)}$dataMetaSchema(e,n){let i=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let r of n){let o=r.split("/").slice(1),s=e;for(let c of o)s=s[c];for(let c in i){let u=i[c];if(typeof u!="object")continue;let{$data:l}=u.definition,p=s[c];l&&p&&(s[c]=T$(p))}}return e}_removeAllSchemas(e,n){for(let i in e){let r=e[i];(!n||n.test(i))&&(typeof r=="string"?delete e[i]:r&&!r.meta&&(this._cache.delete(r.schema),delete e[i]))}}_addSchema(e,n,i,r=this.opts.validateSchema,o=this.opts.addUsedSchema){let s,{schemaId:c}=this.opts;if(typeof e=="object")s=e[c];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof e!="boolean")throw new Error("schema must be object or boolean")}let u=this._cache.get(e);if(u!==void 0)return u;i=(0,sa.normalizeId)(s||i);let l=sa.getSchemaRefs.call(this,e,i);return u=new oa.SchemaEnv({schema:e,schemaId:c,meta:n,baseId:i,localRefs:l}),this._cache.set(u.schema,u),o&&!i.startsWith("#")&&(i&&this._checkUnique(i),this.refs[i]=u),r&&this.validateSchema(e,!0),u}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):oa.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let n=this.opts;this.opts=this._metaOpts;try{oa.compileSchema.call(this,e)}finally{this.opts=n}}};aa.ValidationError=wj.default;aa.MissingRefError=w$.default;Ve.default=aa;function I$(t,e,n,i="error"){for(let r in t){let o=r;o in e&&this.logger[i](`${n}: option ${r}. ${t[o]}`)}}function $$(t){return t=(0,sa.normalizeId)(t),this.schemas[t]||this.refs[t]}function zj(){let t=this.opts.schemas;if(t)if(Array.isArray(t))this.addSchema(t);else for(let e in t)this.addSchema(t[e],e)}function Dj(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function jj(t){if(Array.isArray(t)){this.addVocabulary(t);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in t){let n=t[e];n.keyword||(n.keyword=e),this.addKeyword(n)}}function Uj(){let t={...this.opts};for(let e of Oj)delete t[e];return t}var Mj={log(){},warn(){},error(){}};function Lj(t){if(t===!1)return Mj;if(t===void 0)return console;if(t.log&&t.warn&&t.error)return t;throw new Error("logger must implement log, warn and error methods")}var Zj=/^[a-z_$][a-z0-9_$:-]*$/i;function Bj(t,e){let{RULES:n}=this;if((0,Eb.eachItem)(t,i=>{if(n.keywords[i])throw new Error(`Keyword ${i} is already defined`);if(!Zj.test(i))throw new Error(`Keyword ${i} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function wb(t,e,n){var i;let r=e?.post;if(n&&r)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:o}=this,s=r?o.post:o.rules.find(({type:u})=>u===n);if(s||(s={type:n,rules:[]},o.rules.push(s)),o.keywords[t]=!0,!e)return;let c={keyword:t,definition:{...e,type:(0,Ed.getJSONTypes)(e.type),schemaType:(0,Ed.getJSONTypes)(e.schemaType)}};e.before?Fj.call(this,s,c,e.before):s.rules.push(c),o.all[t]=c,(i=e.implements)===null||i===void 0||i.forEach(u=>this.addKeyword(u))}function Fj(t,e,n){let i=t.rules.findIndex(r=>r.keyword===n);i>=0?t.rules.splice(i,0,e):(t.rules.push(e),this.logger.warn(`rule ${n} is not defined`))}function Vj(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=T$(e)),t.validateSchema=this.compile(e,!0))}var qj={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function T$(t){return{anyOf:[t,qj]}}});var O$=N(Tb=>{"use strict";Object.defineProperty(Tb,"__esModule",{value:!0});var Hj={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};Tb.default=Hj});var C$=N(Ir=>{"use strict";Object.defineProperty(Ir,"__esModule",{value:!0});Ir.callRef=Ir.getValidate=void 0;var Kj=ra(),P$=xt(),pt=X(),Fi=pn(),A$=kd(),Td=se(),Gj={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:n,it:i}=t,{baseId:r,schemaEnv:o,validateName:s,opts:c,self:u}=i,{root:l}=o;if((n==="#"||n==="#/")&&r===l.baseId)return d();let p=A$.resolveRef.call(u,l,r,n);if(p===void 0)throw new Kj.default(i.opts.uriResolver,r,n);if(p instanceof A$.SchemaEnv)return m(p);return f(p);function d(){if(o===l)return Rd(t,s,o,o.$async);let g=e.scopeValue("root",{ref:l});return Rd(t,(0,pt._)`${g}.validate`,l,l.$async)}function m(g){let y=N$(t,g);Rd(t,y,g,g.$async)}function f(g){let y=e.scopeValue("schema",c.code.source===!0?{ref:g,code:(0,pt.stringify)(g)}:{ref:g}),v=e.name("valid"),S=t.subschema({schema:g,dataTypes:[],schemaPath:pt.nil,topSchemaRef:y,errSchemaPath:n},v);t.mergeEvaluated(S),t.ok(v)}}};function N$(t,e){let{gen:n}=t;return e.validate?n.scopeValue("validate",{ref:e.validate}):(0,pt._)`${n.scopeValue("wrapper",{ref:e})}.validate`}Ir.getValidate=N$;function Rd(t,e,n,i){let{gen:r,it:o}=t,{allErrors:s,schemaEnv:c,opts:u}=o,l=u.passContext?Fi.default.this:pt.nil;i?p():d();function p(){if(!c.$async)throw new Error("async schema referenced by sync schema");let g=r.let("valid");r.try(()=>{r.code((0,pt._)`await ${(0,P$.callValidateCode)(t,e,l)}`),f(e),s||r.assign(g,!0)},y=>{r.if((0,pt._)`!(${y} instanceof ${o.ValidationError})`,()=>r.throw(y)),m(y),s||r.assign(g,!1)}),t.ok(g)}function d(){t.result((0,P$.callValidateCode)(t,e,l),()=>f(e),()=>m(e))}function m(g){let y=(0,pt._)`${g}.errors`;r.assign(Fi.default.vErrors,(0,pt._)`${Fi.default.vErrors} === null ? ${y} : ${Fi.default.vErrors}.concat(${y})`),r.assign(Fi.default.errors,(0,pt._)`${Fi.default.vErrors}.length`)}function f(g){var y;if(!o.opts.unevaluated)return;let v=(y=n?.validate)===null||y===void 0?void 0:y.evaluated;if(o.props!==!0)if(v&&!v.dynamicProps)v.props!==void 0&&(o.props=Td.mergeEvaluated.props(r,v.props,o.props));else{let S=r.var("props",(0,pt._)`${g}.evaluated.props`);o.props=Td.mergeEvaluated.props(r,S,o.props,pt.Name)}if(o.items!==!0)if(v&&!v.dynamicItems)v.items!==void 0&&(o.items=Td.mergeEvaluated.items(r,v.items,o.items));else{let S=r.var("items",(0,pt._)`${g}.evaluated.items`);o.items=Td.mergeEvaluated.items(r,S,o.items,pt.Name)}}}Ir.callRef=Rd;Ir.default=Gj});var z$=N(Rb=>{"use strict";Object.defineProperty(Rb,"__esModule",{value:!0});var Wj=O$(),Jj=C$(),Yj=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",Wj.default,Jj.default];Rb.default=Yj});var D$=N(Ob=>{"use strict";Object.defineProperty(Ob,"__esModule",{value:!0});var Od=X(),Fn=Od.operators,Pd={maximum:{okStr:"<=",ok:Fn.LTE,fail:Fn.GT},minimum:{okStr:">=",ok:Fn.GTE,fail:Fn.LT},exclusiveMaximum:{okStr:"<",ok:Fn.LT,fail:Fn.GTE},exclusiveMinimum:{okStr:">",ok:Fn.GT,fail:Fn.LTE}},Xj={message:({keyword:t,schemaCode:e})=>(0,Od.str)`must be ${Pd[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,Od._)`{comparison: ${Pd[t].okStr}, limit: ${e}}`},Qj={keyword:Object.keys(Pd),type:"number",schemaType:"number",$data:!0,error:Xj,code(t){let{keyword:e,data:n,schemaCode:i}=t;t.fail$data((0,Od._)`${n} ${Pd[e].fail} ${i} || isNaN(${n})`)}};Ob.default=Qj});var j$=N(Pb=>{"use strict";Object.defineProperty(Pb,"__esModule",{value:!0});var ca=X(),eU={message:({schemaCode:t})=>(0,ca.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,ca._)`{multipleOf: ${t}}`},tU={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:eU,code(t){let{gen:e,data:n,schemaCode:i,it:r}=t,o=r.opts.multipleOfPrecision,s=e.let("res"),c=o?(0,ca._)`Math.abs(Math.round(${s}) - ${s}) > 1e-${o}`:(0,ca._)`${s} !== parseInt(${s})`;t.fail$data((0,ca._)`(${i} === 0 || (${s} = ${n}/${i}, ${c}))`)}};Pb.default=tU});var M$=N(Ab=>{"use strict";Object.defineProperty(Ab,"__esModule",{value:!0});function U$(t){let e=t.length,n=0,i=0,r;for(;i<e;)n++,r=t.charCodeAt(i++),r>=55296&&r<=56319&&i<e&&(r=t.charCodeAt(i),(r&64512)===56320&&i++);return n}Ab.default=U$;U$.code='require("ajv/dist/runtime/ucs2length").default'});var L$=N(Nb=>{"use strict";Object.defineProperty(Nb,"__esModule",{value:!0});var $r=X(),nU=se(),rU=M$(),iU={message({keyword:t,schemaCode:e}){let n=t==="maxLength"?"more":"fewer";return(0,$r.str)`must NOT have ${n} than ${e} characters`},params:({schemaCode:t})=>(0,$r._)`{limit: ${t}}`},oU={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:iU,code(t){let{keyword:e,data:n,schemaCode:i,it:r}=t,o=e==="maxLength"?$r.operators.GT:$r.operators.LT,s=r.opts.unicode===!1?(0,$r._)`${n}.length`:(0,$r._)`${(0,nU.useFunc)(t.gen,rU.default)}(${n})`;t.fail$data((0,$r._)`${s} ${o} ${i}`)}};Nb.default=oU});var Z$=N(Cb=>{"use strict";Object.defineProperty(Cb,"__esModule",{value:!0});var sU=xt(),aU=se(),Vi=X(),cU={message:({schemaCode:t})=>(0,Vi.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,Vi._)`{pattern: ${t}}`},uU={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:cU,code(t){let{gen:e,data:n,$data:i,schema:r,schemaCode:o,it:s}=t,c=s.opts.unicodeRegExp?"u":"";if(i){let{regExp:u}=s.opts.code,l=u.code==="new RegExp"?(0,Vi._)`new RegExp`:(0,aU.useFunc)(e,u),p=e.let("valid");e.try(()=>e.assign(p,(0,Vi._)`${l}(${o}, ${c}).test(${n})`),()=>e.assign(p,!1)),t.fail$data((0,Vi._)`!${p}`)}else{let u=(0,sU.usePattern)(t,r);t.fail$data((0,Vi._)`!${u}.test(${n})`)}}};Cb.default=uU});var B$=N(zb=>{"use strict";Object.defineProperty(zb,"__esModule",{value:!0});var ua=X(),lU={message({keyword:t,schemaCode:e}){let n=t==="maxProperties"?"more":"fewer";return(0,ua.str)`must NOT have ${n} than ${e} properties`},params:({schemaCode:t})=>(0,ua._)`{limit: ${t}}`},dU={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:lU,code(t){let{keyword:e,data:n,schemaCode:i}=t,r=e==="maxProperties"?ua.operators.GT:ua.operators.LT;t.fail$data((0,ua._)`Object.keys(${n}).length ${r} ${i}`)}};zb.default=dU});var F$=N(Db=>{"use strict";Object.defineProperty(Db,"__esModule",{value:!0});var la=xt(),da=X(),pU=se(),mU={message:({params:{missingProperty:t}})=>(0,da.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,da._)`{missingProperty: ${t}}`},fU={keyword:"required",type:"object",schemaType:"array",$data:!0,error:mU,code(t){let{gen:e,schema:n,schemaCode:i,data:r,$data:o,it:s}=t,{opts:c}=s;if(!o&&n.length===0)return;let u=n.length>=c.loopRequired;if(s.allErrors?l():p(),c.strictRequired){let f=t.parentSchema.properties,{definedProperties:g}=t.it;for(let y of n)if(f?.[y]===void 0&&!g.has(y)){let v=s.schemaEnv.baseId+s.errSchemaPath,S=`required property "${y}" is not defined at "${v}" (strictRequired)`;(0,pU.checkStrictMode)(s,S,s.opts.strictRequired)}}function l(){if(u||o)t.block$data(da.nil,d);else for(let f of n)(0,la.checkReportMissingProp)(t,f)}function p(){let f=e.let("missing");if(u||o){let g=e.let("valid",!0);t.block$data(g,()=>m(f,g)),t.ok(g)}else e.if((0,la.checkMissingProp)(t,n,f)),(0,la.reportMissingProp)(t,f),e.else()}function d(){e.forOf("prop",i,f=>{t.setParams({missingProperty:f}),e.if((0,la.noPropertyInData)(e,r,f,c.ownProperties),()=>t.error())})}function m(f,g){t.setParams({missingProperty:f}),e.forOf(f,i,()=>{e.assign(g,(0,la.propertyInData)(e,r,f,c.ownProperties)),e.if((0,da.not)(g),()=>{t.error(),e.break()})},da.nil)}}};Db.default=fU});var V$=N(jb=>{"use strict";Object.defineProperty(jb,"__esModule",{value:!0});var pa=X(),gU={message({keyword:t,schemaCode:e}){let n=t==="maxItems"?"more":"fewer";return(0,pa.str)`must NOT have ${n} than ${e} items`},params:({schemaCode:t})=>(0,pa._)`{limit: ${t}}`},hU={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:gU,code(t){let{keyword:e,data:n,schemaCode:i}=t,r=e==="maxItems"?pa.operators.GT:pa.operators.LT;t.fail$data((0,pa._)`${n}.length ${r} ${i}`)}};jb.default=hU});var Ad=N(Ub=>{"use strict";Object.defineProperty(Ub,"__esModule",{value:!0});var q$=ab();q$.code='require("ajv/dist/runtime/equal").default';Ub.default=q$});var H$=N(Lb=>{"use strict";Object.defineProperty(Lb,"__esModule",{value:!0});var Mb=Xs(),qe=X(),bU=se(),yU=Ad(),_U={message:({params:{i:t,j:e}})=>(0,qe.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,qe._)`{i: ${t}, j: ${e}}`},vU={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:_U,code(t){let{gen:e,data:n,$data:i,schema:r,parentSchema:o,schemaCode:s,it:c}=t;if(!i&&!r)return;let u=e.let("valid"),l=o.items?(0,Mb.getSchemaTypes)(o.items):[];t.block$data(u,p,(0,qe._)`${s} === false`),t.ok(u);function p(){let g=e.let("i",(0,qe._)`${n}.length`),y=e.let("j");t.setParams({i:g,j:y}),e.assign(u,!0),e.if((0,qe._)`${g} > 1`,()=>(d()?m:f)(g,y))}function d(){return l.length>0&&!l.some(g=>g==="object"||g==="array")}function m(g,y){let v=e.name("item"),S=(0,Mb.checkDataTypes)(l,v,c.opts.strictNumbers,Mb.DataType.Wrong),z=e.const("indices",(0,qe._)`{}`);e.for((0,qe._)`;${g}--;`,()=>{e.let(v,(0,qe._)`${n}[${g}]`),e.if(S,(0,qe._)`continue`),l.length>1&&e.if((0,qe._)`typeof ${v} == "string"`,(0,qe._)`${v} += "_"`),e.if((0,qe._)`typeof ${z}[${v}] == "number"`,()=>{e.assign(y,(0,qe._)`${z}[${v}]`),t.error(),e.assign(u,!1).break()}).code((0,qe._)`${z}[${v}] = ${g}`)})}function f(g,y){let v=(0,bU.useFunc)(e,yU.default),S=e.name("outer");e.label(S).for((0,qe._)`;${g}--;`,()=>e.for((0,qe._)`${y} = ${g}; ${y}--;`,()=>e.if((0,qe._)`${v}(${n}[${g}], ${n}[${y}])`,()=>{t.error(),e.assign(u,!1).break(S)})))}}};Lb.default=vU});var K$=N(Bb=>{"use strict";Object.defineProperty(Bb,"__esModule",{value:!0});var Zb=X(),kU=se(),SU=Ad(),xU={message:"must be equal to constant",params:({schemaCode:t})=>(0,Zb._)`{allowedValue: ${t}}`},IU={keyword:"const",$data:!0,error:xU,code(t){let{gen:e,data:n,$data:i,schemaCode:r,schema:o}=t;i||o&&typeof o=="object"?t.fail$data((0,Zb._)`!${(0,kU.useFunc)(e,SU.default)}(${n}, ${r})`):t.fail((0,Zb._)`${o} !== ${n}`)}};Bb.default=IU});var G$=N(Fb=>{"use strict";Object.defineProperty(Fb,"__esModule",{value:!0});var ma=X(),$U=se(),wU=Ad(),EU={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,ma._)`{allowedValues: ${t}}`},TU={keyword:"enum",schemaType:"array",$data:!0,error:EU,code(t){let{gen:e,data:n,$data:i,schema:r,schemaCode:o,it:s}=t;if(!i&&r.length===0)throw new Error("enum must have non-empty array");let c=r.length>=s.opts.loopEnum,u,l=()=>u??(u=(0,$U.useFunc)(e,wU.default)),p;if(c||i)p=e.let("valid"),t.block$data(p,d);else{if(!Array.isArray(r))throw new Error("ajv implementation error");let f=e.const("vSchema",o);p=(0,ma.or)(...r.map((g,y)=>m(f,y)))}t.pass(p);function d(){e.assign(p,!1),e.forOf("v",o,f=>e.if((0,ma._)`${l()}(${n}, ${f})`,()=>e.assign(p,!0).break()))}function m(f,g){let y=r[g];return typeof y=="object"&&y!==null?(0,ma._)`${l()}(${n}, ${f}[${g}])`:(0,ma._)`${n} === ${y}`}}};Fb.default=TU});var W$=N(Vb=>{"use strict";Object.defineProperty(Vb,"__esModule",{value:!0});var RU=D$(),OU=j$(),PU=L$(),AU=Z$(),NU=B$(),CU=F$(),zU=V$(),DU=H$(),jU=K$(),UU=G$(),MU=[RU.default,OU.default,PU.default,AU.default,NU.default,CU.default,zU.default,DU.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},jU.default,UU.default];Vb.default=MU});var Hb=N(fa=>{"use strict";Object.defineProperty(fa,"__esModule",{value:!0});fa.validateAdditionalItems=void 0;var wr=X(),qb=se(),LU={message:({params:{len:t}})=>(0,wr.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,wr._)`{limit: ${t}}`},ZU={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:LU,code(t){let{parentSchema:e,it:n}=t,{items:i}=e;if(!Array.isArray(i)){(0,qb.checkStrictMode)(n,'"additionalItems" is ignored when "items" is not an array of schemas');return}J$(t,i)}};function J$(t,e){let{gen:n,schema:i,data:r,keyword:o,it:s}=t;s.items=!0;let c=n.const("len",(0,wr._)`${r}.length`);if(i===!1)t.setParams({len:e.length}),t.pass((0,wr._)`${c} <= ${e.length}`);else if(typeof i=="object"&&!(0,qb.alwaysValidSchema)(s,i)){let l=n.var("valid",(0,wr._)`${c} <= ${e.length}`);n.if((0,wr.not)(l),()=>u(l)),t.ok(l)}function u(l){n.forRange("i",e.length,c,p=>{t.subschema({keyword:o,dataProp:p,dataPropType:qb.Type.Num},l),s.allErrors||n.if((0,wr.not)(l),()=>n.break())})}}fa.validateAdditionalItems=J$;fa.default=ZU});var Kb=N(ga=>{"use strict";Object.defineProperty(ga,"__esModule",{value:!0});ga.validateTuple=void 0;var Y$=X(),Nd=se(),BU=xt(),FU={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:n}=t;if(Array.isArray(e))return X$(t,"additionalItems",e);n.items=!0,!(0,Nd.alwaysValidSchema)(n,e)&&t.ok((0,BU.validateArray)(t))}};function X$(t,e,n=t.schema){let{gen:i,parentSchema:r,data:o,keyword:s,it:c}=t;p(r),c.opts.unevaluated&&n.length&&c.items!==!0&&(c.items=Nd.mergeEvaluated.items(i,n.length,c.items));let u=i.name("valid"),l=i.const("len",(0,Y$._)`${o}.length`);n.forEach((d,m)=>{(0,Nd.alwaysValidSchema)(c,d)||(i.if((0,Y$._)`${l} > ${m}`,()=>t.subschema({keyword:s,schemaProp:m,dataProp:m},u)),t.ok(u))});function p(d){let{opts:m,errSchemaPath:f}=c,g=n.length,y=g===d.minItems&&(g===d.maxItems||d[e]===!1);if(m.strictTuples&&!y){let v=`"${s}" is ${g}-tuple, but minItems or maxItems/${e} are not specified or different at path "${f}"`;(0,Nd.checkStrictMode)(c,v,m.strictTuples)}}}ga.validateTuple=X$;ga.default=FU});var Q$=N(Gb=>{"use strict";Object.defineProperty(Gb,"__esModule",{value:!0});var VU=Kb(),qU={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,VU.validateTuple)(t,"items")};Gb.default=qU});var tw=N(Wb=>{"use strict";Object.defineProperty(Wb,"__esModule",{value:!0});var ew=X(),HU=se(),KU=xt(),GU=Hb(),WU={message:({params:{len:t}})=>(0,ew.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,ew._)`{limit: ${t}}`},JU={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:WU,code(t){let{schema:e,parentSchema:n,it:i}=t,{prefixItems:r}=n;i.items=!0,!(0,HU.alwaysValidSchema)(i,e)&&(r?(0,GU.validateAdditionalItems)(t,r):t.ok((0,KU.validateArray)(t)))}};Wb.default=JU});var nw=N(Jb=>{"use strict";Object.defineProperty(Jb,"__esModule",{value:!0});var $t=X(),Cd=se(),YU={message:({params:{min:t,max:e}})=>e===void 0?(0,$t.str)`must contain at least ${t} valid item(s)`:(0,$t.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,$t._)`{minContains: ${t}}`:(0,$t._)`{minContains: ${t}, maxContains: ${e}}`},XU={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:YU,code(t){let{gen:e,schema:n,parentSchema:i,data:r,it:o}=t,s,c,{minContains:u,maxContains:l}=i;o.opts.next?(s=u===void 0?1:u,c=l):s=1;let p=e.const("len",(0,$t._)`${r}.length`);if(t.setParams({min:s,max:c}),c===void 0&&s===0){(0,Cd.checkStrictMode)(o,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(c!==void 0&&s>c){(0,Cd.checkStrictMode)(o,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,Cd.alwaysValidSchema)(o,n)){let y=(0,$t._)`${p} >= ${s}`;c!==void 0&&(y=(0,$t._)`${y} && ${p} <= ${c}`),t.pass(y);return}o.items=!0;let d=e.name("valid");c===void 0&&s===1?f(d,()=>e.if(d,()=>e.break())):s===0?(e.let(d,!0),c!==void 0&&e.if((0,$t._)`${r}.length > 0`,m)):(e.let(d,!1),m()),t.result(d,()=>t.reset());function m(){let y=e.name("_valid"),v=e.let("count",0);f(y,()=>e.if(y,()=>g(v)))}function f(y,v){e.forRange("i",0,p,S=>{t.subschema({keyword:"contains",dataProp:S,dataPropType:Cd.Type.Num,compositeRule:!0},y),v()})}function g(y){e.code((0,$t._)`${y}++`),c===void 0?e.if((0,$t._)`${y} >= ${s}`,()=>e.assign(d,!0).break()):(e.if((0,$t._)`${y} > ${c}`,()=>e.assign(d,!1).break()),s===1?e.assign(d,!0):e.if((0,$t._)`${y} >= ${s}`,()=>e.assign(d,!0)))}}};Jb.default=XU});var ow=N(Jt=>{"use strict";Object.defineProperty(Jt,"__esModule",{value:!0});Jt.validateSchemaDeps=Jt.validatePropertyDeps=Jt.error=void 0;var Yb=X(),QU=se(),ha=xt();Jt.error={message:({params:{property:t,depsCount:e,deps:n}})=>{let i=e===1?"property":"properties";return(0,Yb.str)`must have ${i} ${n} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:n,missingProperty:i}})=>(0,Yb._)`{property: ${t},
|
|
8
8
|
missingProperty: ${i},
|
|
9
9
|
depsCount: ${e},
|
|
10
|
-
deps: ${n}}`};var yU={keyword:"dependencies",type:"object",schemaType:"object",error:Jt.error,code(t){let[e,n]=vU(t);C$(t,e),z$(t,n)}};function vU({schema:t}){let e={},n={};for(let i in t){if(i==="__proto__")continue;let r=Array.isArray(t[i])?e:n;r[i]=t[i]}return[e,n]}function C$(t,e=t.schema){let{gen:n,data:i,it:r}=t;if(Object.keys(e).length===0)return;let o=n.let("missing");for(let s in e){let c=e[s];if(c.length===0)continue;let u=(0,ua.propertyInData)(n,i,s,r.opts.ownProperties);t.setParams({property:s,depsCount:c.length,deps:c.join(", ")}),r.allErrors?n.if(u,()=>{for(let d of c)(0,ua.checkReportMissingProp)(t,d)}):(n.if((0,Cb._)`${u} && (${(0,ua.checkMissingProp)(t,c,o)})`),(0,ua.reportMissingProp)(t,o),n.else())}}Jt.validatePropertyDeps=C$;function z$(t,e=t.schema){let{gen:n,data:i,keyword:r,it:o}=t,s=n.name("valid");for(let c in e)(0,_U.alwaysValidSchema)(o,e[c])||(n.if((0,ua.propertyInData)(n,i,c,o.opts.ownProperties),()=>{let u=t.subschema({keyword:r,schemaProp:c},s);t.mergeValidEvaluated(u,s)},()=>n.var(s,!0)),t.ok(s))}Jt.validateSchemaDeps=z$;Jt.default=yU});var U$=A(zb=>{"use strict";Object.defineProperty(zb,"__esModule",{value:!0});var j$=X(),kU=se(),SU={message:"property name must be valid",params:({params:t})=>(0,j$._)`{propertyName: ${t.propertyName}}`},xU={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:SU,code(t){let{gen:e,schema:n,data:i,it:r}=t;if((0,kU.alwaysValidSchema)(r,n))return;let o=e.name("valid");e.forIn("key",i,s=>{t.setParams({propertyName:s}),t.subschema({keyword:"propertyNames",data:s,dataTypes:["string"],propertyName:s,compositeRule:!0},o),e.if((0,j$.not)(o),()=>{t.error(!0),r.allErrors||e.break()})}),t.ok(o)}};zb.default=xU});var jb=A(Db=>{"use strict";Object.defineProperty(Db,"__esModule",{value:!0});var $d=xt(),Ut=X(),IU=ln(),wd=se(),$U={message:"must NOT have additional properties",params:({params:t})=>(0,Ut._)`{additionalProperty: ${t.additionalProperty}}`},wU={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:$U,code(t){let{gen:e,schema:n,parentSchema:i,data:r,errsCount:o,it:s}=t;if(!o)throw new Error("ajv implementation error");let{allErrors:c,opts:u}=s;if(s.props=!0,u.removeAdditional!=="all"&&(0,wd.alwaysValidSchema)(s,n))return;let d=(0,$d.allSchemaProperties)(i.properties),l=(0,$d.allSchemaProperties)(i.patternProperties);p(),t.ok((0,Ut._)`${o} === ${IU.default.errors}`);function p(){e.forIn("key",r,v=>{!d.length&&!l.length?h(v):e.if(m(v),()=>h(v))})}function m(v){let T;if(d.length>8){let z=(0,wd.schemaRefOrVal)(s,i.properties,"properties");T=(0,$d.isOwnProperty)(e,z,v)}else d.length?T=(0,Ut.or)(...d.map(z=>(0,Ut._)`${v} === ${z}`)):T=Ut.nil;return l.length&&(T=(0,Ut.or)(T,...l.map(z=>(0,Ut._)`${(0,$d.usePattern)(t,z)}.test(${v})`))),(0,Ut.not)(T)}function f(v){e.code((0,Ut._)`delete ${r}[${v}]`)}function h(v){if(u.removeAdditional==="all"||u.removeAdditional&&n===!1){f(v);return}if(n===!1){t.setParams({additionalProperty:v}),t.error(),c||e.break();return}if(typeof n=="object"&&!(0,wd.alwaysValidSchema)(s,n)){let T=e.name("valid");u.removeAdditional==="failing"?(y(v,T,!1),e.if((0,Ut.not)(T),()=>{t.reset(),f(v)})):(y(v,T),c||e.if((0,Ut.not)(T),()=>e.break()))}}function y(v,T,z){let D={keyword:"additionalProperties",dataProp:v,dataPropType:wd.Type.Str};z===!1&&Object.assign(D,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(D,T)}}};Db.default=wU});var Z$=A(Mb=>{"use strict";Object.defineProperty(Mb,"__esModule",{value:!0});var EU=Ws(),M$=xt(),Ub=se(),L$=jb(),TU={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:n,parentSchema:i,data:r,it:o}=t;o.opts.removeAdditional==="all"&&i.additionalProperties===void 0&&L$.default.code(new EU.KeywordCxt(o,L$.default,"additionalProperties"));let s=(0,M$.allSchemaProperties)(n);for(let p of s)o.definedProperties.add(p);o.opts.unevaluated&&s.length&&o.props!==!0&&(o.props=Ub.mergeEvaluated.props(e,(0,Ub.toHash)(s),o.props));let c=s.filter(p=>!(0,Ub.alwaysValidSchema)(o,n[p]));if(c.length===0)return;let u=e.name("valid");for(let p of c)d(p)?l(p):(e.if((0,M$.propertyInData)(e,r,p,o.opts.ownProperties)),l(p),o.allErrors||e.else().var(u,!0),e.endIf()),t.it.definedProperties.add(p),t.ok(u);function d(p){return o.opts.useDefaults&&!o.compositeRule&&n[p].default!==void 0}function l(p){t.subschema({keyword:"properties",schemaProp:p,dataProp:p},u)}}};Mb.default=TU});var V$=A(Lb=>{"use strict";Object.defineProperty(Lb,"__esModule",{value:!0});var B$=xt(),Ed=X(),F$=se(),q$=se(),RU={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:n,data:i,parentSchema:r,it:o}=t,{opts:s}=o,c=(0,B$.allSchemaProperties)(n),u=c.filter(y=>(0,F$.alwaysValidSchema)(o,n[y]));if(c.length===0||u.length===c.length&&(!o.opts.unevaluated||o.props===!0))return;let d=s.strictSchema&&!s.allowMatchingProperties&&r.properties,l=e.name("valid");o.props!==!0&&!(o.props instanceof Ed.Name)&&(o.props=(0,q$.evaluatedPropsToName)(e,o.props));let{props:p}=o;m();function m(){for(let y of c)d&&f(y),o.allErrors?h(y):(e.var(l,!0),h(y),e.if(l))}function f(y){for(let v in d)new RegExp(y).test(v)&&(0,F$.checkStrictMode)(o,`property ${v} matches pattern ${y} (use allowMatchingProperties)`)}function h(y){e.forIn("key",i,v=>{e.if((0,Ed._)`${(0,B$.usePattern)(t,y)}.test(${v})`,()=>{let T=u.includes(y);T||t.subschema({keyword:"patternProperties",schemaProp:y,dataProp:v,dataPropType:q$.Type.Str},l),o.opts.unevaluated&&p!==!0?e.assign((0,Ed._)`${p}[${v}]`,!0):!T&&!o.allErrors&&e.if((0,Ed.not)(l),()=>e.break())})})}}};Lb.default=RU});var H$=A(Zb=>{"use strict";Object.defineProperty(Zb,"__esModule",{value:!0});var OU=se(),PU={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:n,it:i}=t;if((0,OU.alwaysValidSchema)(i,n)){t.fail();return}let r=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},r),t.failResult(r,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};Zb.default=PU});var G$=A(Bb=>{"use strict";Object.defineProperty(Bb,"__esModule",{value:!0});var AU=xt(),NU={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:AU.validateUnion,error:{message:"must match a schema in anyOf"}};Bb.default=NU});var K$=A(Fb=>{"use strict";Object.defineProperty(Fb,"__esModule",{value:!0});var Td=X(),CU=se(),zU={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,Td._)`{passingSchemas: ${t.passing}}`},DU={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:zU,code(t){let{gen:e,schema:n,parentSchema:i,it:r}=t;if(!Array.isArray(n))throw new Error("ajv implementation error");if(r.opts.discriminator&&i.discriminator)return;let o=n,s=e.let("valid",!1),c=e.let("passing",null),u=e.name("_valid");t.setParams({passing:c}),e.block(d),t.result(s,()=>t.reset(),()=>t.error(!0));function d(){o.forEach((l,p)=>{let m;(0,CU.alwaysValidSchema)(r,l)?e.var(u,!0):m=t.subschema({keyword:"oneOf",schemaProp:p,compositeRule:!0},u),p>0&&e.if((0,Td._)`${u} && ${s}`).assign(s,!1).assign(c,(0,Td._)`[${c}, ${p}]`).else(),e.if(u,()=>{e.assign(s,!0),e.assign(c,p),m&&t.mergeEvaluated(m,Td.Name)})})}}};Fb.default=DU});var W$=A(qb=>{"use strict";Object.defineProperty(qb,"__esModule",{value:!0});var jU=se(),UU={keyword:"allOf",schemaType:"array",code(t){let{gen:e,schema:n,it:i}=t;if(!Array.isArray(n))throw new Error("ajv implementation error");let r=e.name("valid");n.forEach((o,s)=>{if((0,jU.alwaysValidSchema)(i,o))return;let c=t.subschema({keyword:"allOf",schemaProp:s},r);t.ok(r),t.mergeEvaluated(c)})}};qb.default=UU});var X$=A(Vb=>{"use strict";Object.defineProperty(Vb,"__esModule",{value:!0});var Rd=X(),Y$=se(),MU={message:({params:t})=>(0,Rd.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,Rd._)`{failingKeyword: ${t.ifClause}}`},LU={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:MU,code(t){let{gen:e,parentSchema:n,it:i}=t;n.then===void 0&&n.else===void 0&&(0,Y$.checkStrictMode)(i,'"if" without "then" and "else" is ignored');let r=J$(i,"then"),o=J$(i,"else");if(!r&&!o)return;let s=e.let("valid",!0),c=e.name("_valid");if(u(),t.reset(),r&&o){let l=e.let("ifClause");t.setParams({ifClause:l}),e.if(c,d("then",l),d("else",l))}else r?e.if(c,d("then")):e.if((0,Rd.not)(c),d("else"));t.pass(s,()=>t.error(!0));function u(){let l=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},c);t.mergeEvaluated(l)}function d(l,p){return()=>{let m=t.subschema({keyword:l},c);e.assign(s,c),t.mergeValidEvaluated(m,s),p?e.assign(p,(0,Rd._)`${l}`):t.setParams({ifClause:l})}}}};function J$(t,e){let n=t.schema[e];return n!==void 0&&!(0,Y$.alwaysValidSchema)(t,n)}Vb.default=LU});var Q$=A(Hb=>{"use strict";Object.defineProperty(Hb,"__esModule",{value:!0});var ZU=se(),BU={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:n}){e.if===void 0&&(0,ZU.checkStrictMode)(n,`"${t}" without "if" is ignored`)}};Hb.default=BU});var ew=A(Gb=>{"use strict";Object.defineProperty(Gb,"__esModule",{value:!0});var FU=Rb(),qU=O$(),VU=Ob(),HU=A$(),GU=N$(),KU=D$(),WU=U$(),JU=jb(),YU=Z$(),XU=V$(),QU=H$(),e1=G$(),t1=K$(),n1=W$(),r1=X$(),i1=Q$();function o1(t=!1){let e=[QU.default,e1.default,t1.default,n1.default,r1.default,i1.default,WU.default,JU.default,KU.default,YU.default,XU.default];return t?e.push(qU.default,HU.default):e.push(FU.default,VU.default),e.push(GU.default),e}Gb.default=o1});var tw=A(Kb=>{"use strict";Object.defineProperty(Kb,"__esModule",{value:!0});var Pe=X(),s1={message:({schemaCode:t})=>(0,Pe.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,Pe._)`{format: ${t}}`},a1={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:s1,code(t,e){let{gen:n,data:i,$data:r,schema:o,schemaCode:s,it:c}=t,{opts:u,errSchemaPath:d,schemaEnv:l,self:p}=c;if(!u.validateFormats)return;r?m():f();function m(){let h=n.scopeValue("formats",{ref:p.formats,code:u.code.formats}),y=n.const("fDef",(0,Pe._)`${h}[${s}]`),v=n.let("fType"),T=n.let("format");n.if((0,Pe._)`typeof ${y} == "object" && !(${y} instanceof RegExp)`,()=>n.assign(v,(0,Pe._)`${y}.type || "string"`).assign(T,(0,Pe._)`${y}.validate`),()=>n.assign(v,(0,Pe._)`"string"`).assign(T,y)),t.fail$data((0,Pe.or)(z(),D()));function z(){return u.strictSchema===!1?Pe.nil:(0,Pe._)`${s} && !${T}`}function D(){let U=l.$async?(0,Pe._)`(${y}.async ? await ${T}(${i}) : ${T}(${i}))`:(0,Pe._)`${T}(${i})`,j=(0,Pe._)`(typeof ${T} == "function" ? ${U} : ${T}.test(${i}))`;return(0,Pe._)`${T} && ${T} !== true && ${v} === ${e} && !${j}`}}function f(){let h=p.formats[o];if(!h){z();return}if(h===!0)return;let[y,v,T]=D(h);y===e&&t.pass(U());function z(){if(u.strictSchema===!1){p.logger.warn(j());return}throw new Error(j());function j(){return`unknown format "${o}" ignored in schema at path "${d}"`}}function D(j){let pt=j instanceof RegExp?(0,Pe.regexpCode)(j):u.code.formats?(0,Pe._)`${u.code.formats}${(0,Pe.getProperty)(o)}`:void 0,bt=n.scopeValue("formats",{key:o,ref:j,code:pt});return typeof j=="object"&&!(j instanceof RegExp)?[j.type||"string",j.validate,(0,Pe._)`${bt}.validate`]:["string",j,bt]}function U(){if(typeof h=="object"&&!(h instanceof RegExp)&&h.async){if(!l.$async)throw new Error("async format in sync schema");return(0,Pe._)`await ${T}(${i})`}return typeof v=="function"?(0,Pe._)`${T}(${i})`:(0,Pe._)`${T}.test(${i})`}}}};Kb.default=a1});var nw=A(Wb=>{"use strict";Object.defineProperty(Wb,"__esModule",{value:!0});var c1=tw(),u1=[c1.default];Wb.default=u1});var rw=A(Ui=>{"use strict";Object.defineProperty(Ui,"__esModule",{value:!0});Ui.contentVocabulary=Ui.metadataVocabulary=void 0;Ui.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Ui.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var ow=A(Jb=>{"use strict";Object.defineProperty(Jb,"__esModule",{value:!0});var l1=p$(),d1=w$(),p1=ew(),m1=nw(),iw=rw(),f1=[l1.default,d1.default,(0,p1.default)(),m1.default,iw.metadataVocabulary,iw.contentVocabulary];Jb.default=f1});var aw=A(Od=>{"use strict";Object.defineProperty(Od,"__esModule",{value:!0});Od.DiscrError=void 0;var sw;(function(t){t.Tag="tag",t.Mapping="mapping"})(sw||(Od.DiscrError=sw={}))});var uw=A(Xb=>{"use strict";Object.defineProperty(Xb,"__esModule",{value:!0});var Mi=X(),Yb=aw(),cw=dd(),h1=Js(),g1=se(),b1={message:({params:{discrError:t,tagName:e}})=>t===Yb.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:n}})=>(0,Mi._)`{error: ${t}, tag: ${n}, tagValue: ${e}}`},_1={keyword:"discriminator",type:"object",schemaType:"object",error:b1,code(t){let{gen:e,data:n,schema:i,parentSchema:r,it:o}=t,{oneOf:s}=r;if(!o.opts.discriminator)throw new Error("discriminator: requires discriminator option");let c=i.propertyName;if(typeof c!="string")throw new Error("discriminator: requires propertyName");if(i.mapping)throw new Error("discriminator: mapping is not supported");if(!s)throw new Error("discriminator: requires oneOf keyword");let u=e.let("valid",!1),d=e.const("tag",(0,Mi._)`${n}${(0,Mi.getProperty)(c)}`);e.if((0,Mi._)`typeof ${d} == "string"`,()=>l(),()=>t.error(!1,{discrError:Yb.DiscrError.Tag,tag:d,tagName:c})),t.ok(u);function l(){let f=m();e.if(!1);for(let h in f)e.elseIf((0,Mi._)`${d} === ${h}`),e.assign(u,p(f[h]));e.else(),t.error(!1,{discrError:Yb.DiscrError.Mapping,tag:d,tagName:c}),e.endIf()}function p(f){let h=e.name("valid"),y=t.subschema({keyword:"oneOf",schemaProp:f},h);return t.mergeEvaluated(y,Mi.Name),h}function m(){var f;let h={},y=T(r),v=!0;for(let U=0;U<s.length;U++){let j=s[U];if(j?.$ref&&!(0,g1.schemaHasRulesButRef)(j,o.self.RULES)){let bt=j.$ref;if(j=cw.resolveRef.call(o.self,o.schemaEnv.root,o.baseId,bt),j instanceof cw.SchemaEnv&&(j=j.schema),j===void 0)throw new h1.default(o.opts.uriResolver,o.baseId,bt)}let pt=(f=j?.properties)===null||f===void 0?void 0:f[c];if(typeof pt!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${c}"`);v=v&&(y||T(j)),z(pt,U)}if(!v)throw new Error(`discriminator: "${c}" must be required`);return h;function T({required:U}){return Array.isArray(U)&&U.includes(c)}function z(U,j){if(U.const)D(U.const,j);else if(U.enum)for(let pt of U.enum)D(pt,j);else throw new Error(`discriminator: "properties/${c}" must have "const" or "enum"`)}function D(U,j){if(typeof U!="string"||U in h)throw new Error(`discriminator: "${c}" values must be unique strings`);h[U]=j}}}};Xb.default=_1});var lw=A((GG,y1)=>{y1.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 e_=A(($e,Qb)=>{"use strict";Object.defineProperty($e,"__esModule",{value:!0});$e.MissingRefError=$e.ValidationError=$e.CodeGen=$e.Name=$e.nil=$e.stringify=$e.str=$e._=$e.KeywordCxt=$e.Ajv=void 0;var v1=s$(),k1=ow(),S1=uw(),dw=lw(),x1=["/properties"],Pd="http://json-schema.org/draft-07/schema",Li=class extends v1.default{_addVocabularies(){super._addVocabularies(),k1.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(S1.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(dw,x1):dw;this.addMetaSchema(e,Pd,!1),this.refs["http://json-schema.org/schema"]=Pd}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Pd)?Pd:void 0)}};$e.Ajv=Li;Qb.exports=$e=Li;Qb.exports.Ajv=Li;Object.defineProperty($e,"__esModule",{value:!0});$e.default=Li;var I1=Ws();Object.defineProperty($e,"KeywordCxt",{enumerable:!0,get:function(){return I1.KeywordCxt}});var Zi=X();Object.defineProperty($e,"_",{enumerable:!0,get:function(){return Zi._}});Object.defineProperty($e,"str",{enumerable:!0,get:function(){return Zi.str}});Object.defineProperty($e,"stringify",{enumerable:!0,get:function(){return Zi.stringify}});Object.defineProperty($e,"nil",{enumerable:!0,get:function(){return Zi.nil}});Object.defineProperty($e,"Name",{enumerable:!0,get:function(){return Zi.Name}});Object.defineProperty($e,"CodeGen",{enumerable:!0,get:function(){return Zi.CodeGen}});var $1=ud();Object.defineProperty($e,"ValidationError",{enumerable:!0,get:function(){return $1.default}});var w1=Js();Object.defineProperty($e,"MissingRefError",{enumerable:!0,get:function(){return w1.default}})});var yw=A(Xt=>{"use strict";Object.defineProperty(Xt,"__esModule",{value:!0});Xt.formatNames=Xt.fastFormats=Xt.fullFormats=void 0;function Yt(t,e){return{validate:t,compare:e}}Xt.fullFormats={date:Yt(hw,i_),time:Yt(n_(!0),o_),"date-time":Yt(pw(!0),bw),"iso-time":Yt(n_(),gw),"iso-date-time":Yt(pw(),_w),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:A1,"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:M1,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:N1,int32:{type:"number",validate:D1},int64:{type:"number",validate:j1},float:{type:"number",validate:fw},double:{type:"number",validate:fw},password:!0,binary:!0};Xt.fastFormats={...Xt.fullFormats,date:Yt(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,i_),time:Yt(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,o_),"date-time":Yt(/^\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,bw),"iso-time":Yt(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,gw),"iso-date-time":Yt(/^\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,_w),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};Xt.formatNames=Object.keys(Xt.fullFormats);function E1(t){return t%4===0&&(t%100!==0||t%400===0)}var T1=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,R1=[0,31,28,31,30,31,30,31,31,30,31,30,31];function hw(t){let e=T1.exec(t);if(!e)return!1;let n=+e[1],i=+e[2],r=+e[3];return i>=1&&i<=12&&r>=1&&r<=(i===2&&E1(n)?29:R1[i])}function i_(t,e){if(t&&e)return t>e?1:t<e?-1:0}var t_=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function n_(t){return function(n){let i=t_.exec(n);if(!i)return!1;let r=+i[1],o=+i[2],s=+i[3],c=i[4],u=i[5]==="-"?-1:1,d=+(i[6]||0),l=+(i[7]||0);if(d>23||l>59||t&&!c)return!1;if(r<=23&&o<=59&&s<60)return!0;let p=o-l*u,m=r-d*u-(p<0?1:0);return(m===23||m===-1)&&(p===59||p===-1)&&s<61}}function o_(t,e){if(!(t&&e))return;let n=new Date("2020-01-01T"+t).valueOf(),i=new Date("2020-01-01T"+e).valueOf();if(n&&i)return n-i}function gw(t,e){if(!(t&&e))return;let n=t_.exec(t),i=t_.exec(e);if(n&&i)return t=n[1]+n[2]+n[3],e=i[1]+i[2]+i[3],t>e?1:t<e?-1:0}var r_=/t|\s/i;function pw(t){let e=n_(t);return function(i){let r=i.split(r_);return r.length===2&&hw(r[0])&&e(r[1])}}function bw(t,e){if(!(t&&e))return;let n=new Date(t).valueOf(),i=new Date(e).valueOf();if(n&&i)return n-i}function _w(t,e){if(!(t&&e))return;let[n,i]=t.split(r_),[r,o]=e.split(r_),s=i_(n,r);if(s!==void 0)return s||o_(i,o)}var O1=/\/|:/,P1=/^(?:[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 A1(t){return O1.test(t)&&P1.test(t)}var mw=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function N1(t){return mw.lastIndex=0,mw.test(t)}var C1=-(2**31),z1=2**31-1;function D1(t){return Number.isInteger(t)&&t<=z1&&t>=C1}function j1(t){return Number.isInteger(t)}function fw(){return!0}var U1=/[^\\]\\Z/;function M1(t){if(U1.test(t))return!1;try{return new RegExp(t),!0}catch{return!1}}});var vw=A(Bi=>{"use strict";Object.defineProperty(Bi,"__esModule",{value:!0});Bi.formatLimitDefinition=void 0;var L1=e_(),Mt=X(),Zn=Mt.operators,Ad={formatMaximum:{okStr:"<=",ok:Zn.LTE,fail:Zn.GT},formatMinimum:{okStr:">=",ok:Zn.GTE,fail:Zn.LT},formatExclusiveMaximum:{okStr:"<",ok:Zn.LT,fail:Zn.GTE},formatExclusiveMinimum:{okStr:">",ok:Zn.GT,fail:Zn.LTE}},Z1={message:({keyword:t,schemaCode:e})=>(0,Mt.str)`should be ${Ad[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,Mt._)`{comparison: ${Ad[t].okStr}, limit: ${e}}`};Bi.formatLimitDefinition={keyword:Object.keys(Ad),type:"string",schemaType:"string",$data:!0,error:Z1,code(t){let{gen:e,data:n,schemaCode:i,keyword:r,it:o}=t,{opts:s,self:c}=o;if(!s.validateFormats)return;let u=new L1.KeywordCxt(o,c.RULES.all.format.definition,"format");u.$data?d():l();function d(){let m=e.scopeValue("formats",{ref:c.formats,code:s.code.formats}),f=e.const("fmt",(0,Mt._)`${m}[${u.schemaCode}]`);t.fail$data((0,Mt.or)((0,Mt._)`typeof ${f} != "object"`,(0,Mt._)`${f} instanceof RegExp`,(0,Mt._)`typeof ${f}.compare != "function"`,p(f)))}function l(){let m=u.schema,f=c.formats[m];if(!f||f===!0)return;if(typeof f!="object"||f instanceof RegExp||typeof f.compare!="function")throw new Error(`"${r}": format "${m}" does not define "compare" function`);let h=e.scopeValue("formats",{key:m,ref:f,code:s.code.formats?(0,Mt._)`${s.code.formats}${(0,Mt.getProperty)(m)}`:void 0});t.fail$data(p(h))}function p(m){return(0,Mt._)`${m}.compare(${n}, ${i}) ${Ad[r].fail} 0`}},dependencies:["format"]};var B1=t=>(t.addKeyword(Bi.formatLimitDefinition),t);Bi.default=B1});var Iw=A((la,xw)=>{"use strict";Object.defineProperty(la,"__esModule",{value:!0});var Fi=yw(),F1=vw(),s_=X(),kw=new s_.Name("fullFormats"),q1=new s_.Name("fastFormats"),a_=(t,e={keywords:!0})=>{if(Array.isArray(e))return Sw(t,e,Fi.fullFormats,kw),t;let[n,i]=e.mode==="fast"?[Fi.fastFormats,q1]:[Fi.fullFormats,kw],r=e.formats||Fi.formatNames;return Sw(t,r,n,i),e.keywords&&(0,F1.default)(t),t};a_.get=(t,e="full")=>{let i=(e==="fast"?Fi.fastFormats:Fi.fullFormats)[t];if(!i)throw new Error(`Unknown format "${t}"`);return i};function Sw(t,e,n,i){var r,o;(r=(o=t.opts.code).formats)!==null&&r!==void 0||(o.formats=(0,s_._)`require("ajv-formats/dist/formats").${i}`);for(let s of e)t.addFormat(s,n[s])}xw.exports=la=a_;Object.defineProperty(la,"__esModule",{value:!0});la.default=a_});import GS from"node:process";var a={};en(a,{$brand:()=>_p,$input:()=>Cm,$output:()=>Nm,NEVER:()=>bp,TimePrecision:()=>Dm,ZodAny:()=>Yf,ZodArray:()=>th,ZodBase64:()=>ul,ZodBase64URL:()=>ll,ZodBigInt:()=>ri,ZodBigIntFormat:()=>ml,ZodBoolean:()=>ni,ZodCIDRv4:()=>al,ZodCIDRv6:()=>cl,ZodCUID:()=>el,ZodCUID2:()=>tl,ZodCatch:()=>kh,ZodCodec:()=>ls,ZodCustom:()=>ds,ZodCustomStringFormat:()=>ei,ZodDate:()=>os,ZodDefault:()=>hh,ZodDiscriminatedUnion:()=>rh,ZodE164:()=>dl,ZodEmail:()=>Yu,ZodEmoji:()=>Xu,ZodEnum:()=>Xr,ZodError:()=>hP,ZodExactOptional:()=>ph,ZodFile:()=>lh,ZodFirstPartyTypeKind:()=>Ch,ZodFunction:()=>Ph,ZodGUID:()=>es,ZodIPv4:()=>ol,ZodIPv6:()=>sl,ZodISODate:()=>Vu,ZodISODateTime:()=>qu,ZodISODuration:()=>Gu,ZodISOTime:()=>Hu,ZodIntersection:()=>ih,ZodIssueCode:()=>bP,ZodJWT:()=>pl,ZodKSUID:()=>il,ZodLazy:()=>Th,ZodLiteral:()=>uh,ZodMAC:()=>Gf,ZodMap:()=>ah,ZodNaN:()=>xh,ZodNanoID:()=>Qu,ZodNever:()=>Qf,ZodNonOptional:()=>gl,ZodNull:()=>Jf,ZodNullable:()=>fh,ZodNumber:()=>ti,ZodNumberFormat:()=>ir,ZodObject:()=>ss,ZodOptional:()=>oi,ZodPipe:()=>us,ZodPrefault:()=>bh,ZodPreprocess:()=>Ih,ZodPromise:()=>Oh,ZodReadonly:()=>$h,ZodRealError:()=>ot,ZodRecord:()=>Yr,ZodSet:()=>ch,ZodString:()=>Qr,ZodStringFormat:()=>ge,ZodSuccess:()=>vh,ZodSymbol:()=>Kf,ZodTemplateLiteral:()=>Eh,ZodTransform:()=>dh,ZodTuple:()=>oh,ZodType:()=>K,ZodULID:()=>nl,ZodURL:()=>rs,ZodUUID:()=>Vt,ZodUndefined:()=>Wf,ZodUnion:()=>as,ZodUnknown:()=>Xf,ZodVoid:()=>eh,ZodXID:()=>rl,ZodXor:()=>nh,_ZodString:()=>Ju,_default:()=>gh,_function:()=>yS,any:()=>eS,array:()=>Q,base64:()=>jk,base64url:()=>Uk,bigint:()=>Wk,boolean:()=>Oe,catch:()=>Sh,check:()=>vS,cidrv4:()=>zk,cidrv6:()=>Dk,clone:()=>ze,codec:()=>hS,coerce:()=>zh,config:()=>Re,core:()=>Ot,cuid:()=>Ek,cuid2:()=>Tk,custom:()=>bl,date:()=>nS,decode:()=>Lf,decodeAsync:()=>Bf,describe:()=>kS,discriminatedUnion:()=>cs,e164:()=>Mk,email:()=>bk,emoji:()=>$k,encode:()=>Mf,encodeAsync:()=>Zf,endsWith:()=>Fr,enum:()=>Ue,exactOptional:()=>mh,file:()=>dS,flattenError:()=>So,float32:()=>Vk,float64:()=>Hk,formatError:()=>xo,fromJSONSchema:()=>ES,function:()=>yS,getErrorMap:()=>yP,globalRegistry:()=>De,gt:()=>Ft,gte:()=>We,guid:()=>_k,hash:()=>qk,hex:()=>Fk,hostname:()=>Bk,httpUrl:()=>Ik,includes:()=>Zr,instanceof:()=>xS,int:()=>Ku,int32:()=>Gk,int64:()=>Jk,intersection:()=>ii,invertCodec:()=>gS,ipv4:()=>Ak,ipv6:()=>Ck,iso:()=>wn,json:()=>$S,jwt:()=>Lk,keyof:()=>rS,ksuid:()=>Pk,lazy:()=>Rh,length:()=>tr,literal:()=>L,locales:()=>zr,looseObject:()=>je,looseRecord:()=>aS,lowercase:()=>Mr,lt:()=>Bt,lte:()=>mt,mac:()=>Nk,map:()=>cS,maxLength:()=>er,maxSize:()=>Sn,meta:()=>SS,mime:()=>qr,minLength:()=>nn,minSize:()=>qt,multipleOf:()=>kn,nan:()=>fS,nanoid:()=>wk,nativeEnum:()=>lS,negative:()=>Tu,never:()=>fl,nonnegative:()=>Ou,nonoptional:()=>yh,nonpositive:()=>Ru,normalize:()=>Vr,null:()=>is,nullable:()=>ts,nullish:()=>pS,number:()=>ce,object:()=>N,optional:()=>ke,overwrite:()=>Rt,parse:()=>zf,parseAsync:()=>Df,partialRecord:()=>sS,pipe:()=>Wu,positive:()=>Eu,prefault:()=>_h,preprocess:()=>ps,prettifyError:()=>Op,promise:()=>_S,property:()=>Pu,readonly:()=>wh,record:()=>fe,refine:()=>Ah,regex:()=>Ur,regexes:()=>it,registry:()=>ou,safeDecode:()=>qf,safeDecodeAsync:()=>Hf,safeEncode:()=>Ff,safeEncodeAsync:()=>Vf,safeParse:()=>jf,safeParseAsync:()=>Uf,set:()=>uS,setErrorMap:()=>_P,size:()=>Qn,slugify:()=>Wr,startsWith:()=>Br,strictObject:()=>iS,string:()=>_,stringFormat:()=>Zk,stringbool:()=>IS,success:()=>mS,superRefine:()=>Nh,symbol:()=>Xk,templateLiteral:()=>bS,toJSONSchema:()=>rr,toLowerCase:()=>Gr,toUpperCase:()=>Kr,transform:()=>hl,treeifyError:()=>Rp,trim:()=>Hr,tuple:()=>sh,uint32:()=>Kk,uint64:()=>Yk,ulid:()=>Rk,undefined:()=>Qk,union:()=>_e,unknown:()=>be,uppercase:()=>Lr,url:()=>xk,util:()=>I,uuid:()=>yk,uuidv4:()=>vk,uuidv6:()=>kk,uuidv7:()=>Sk,void:()=>tS,xid:()=>Ok,xor:()=>oS});var Ot={};en(Ot,{$ZodAny:()=>Ic,$ZodArray:()=>Rc,$ZodAsyncError:()=>Tt,$ZodBase64:()=>fc,$ZodBase64URL:()=>hc,$ZodBigInt:()=>To,$ZodBigIntFormat:()=>vc,$ZodBoolean:()=>Pr,$ZodCIDRv4:()=>pc,$ZodCIDRv6:()=>mc,$ZodCUID:()=>ic,$ZodCUID2:()=>oc,$ZodCatch:()=>Gc,$ZodCheck:()=>he,$ZodCheckBigIntFormat:()=>cm,$ZodCheckEndsWith:()=>vm,$ZodCheckGreaterThan:()=>Ga,$ZodCheckIncludes:()=>_m,$ZodCheckLengthEquals:()=>fm,$ZodCheckLessThan:()=>Ha,$ZodCheckLowerCase:()=>gm,$ZodCheckMaxLength:()=>pm,$ZodCheckMaxSize:()=>um,$ZodCheckMimeType:()=>Sm,$ZodCheckMinLength:()=>mm,$ZodCheckMinSize:()=>lm,$ZodCheckMultipleOf:()=>sm,$ZodCheckNumberFormat:()=>am,$ZodCheckOverwrite:()=>xm,$ZodCheckProperty:()=>km,$ZodCheckRegex:()=>hm,$ZodCheckSizeEquals:()=>dm,$ZodCheckStartsWith:()=>ym,$ZodCheckStringFormat:()=>Or,$ZodCheckUpperCase:()=>bm,$ZodCodec:()=>Nr,$ZodCustom:()=>eu,$ZodCustomStringFormat:()=>_c,$ZodDate:()=>Tc,$ZodDefault:()=>Fc,$ZodDiscriminatedUnion:()=>Ac,$ZodE164:()=>gc,$ZodEmail:()=>ec,$ZodEmoji:()=>nc,$ZodEncodeError:()=>mn,$ZodEnum:()=>jc,$ZodError:()=>ko,$ZodExactOptional:()=>Zc,$ZodFile:()=>Mc,$ZodFunction:()=>Yc,$ZodGUID:()=>Xa,$ZodIPv4:()=>uc,$ZodIPv6:()=>lc,$ZodISODate:()=>Em,$ZodISODateTime:()=>wm,$ZodISODuration:()=>Rm,$ZodISOTime:()=>Tm,$ZodIntersection:()=>Nc,$ZodJWT:()=>bc,$ZodKSUID:()=>cc,$ZodLazy:()=>Qc,$ZodLiteral:()=>Uc,$ZodMAC:()=>dc,$ZodMap:()=>zc,$ZodNaN:()=>Kc,$ZodNanoID:()=>rc,$ZodNever:()=>wc,$ZodNonOptional:()=>Vc,$ZodNull:()=>xc,$ZodNullable:()=>Bc,$ZodNumber:()=>Eo,$ZodNumberFormat:()=>yc,$ZodObject:()=>Oc,$ZodObjectJIT:()=>Pm,$ZodOptional:()=>Oo,$ZodPipe:()=>Po,$ZodPrefault:()=>qc,$ZodPreprocess:()=>Am,$ZodPromise:()=>Xc,$ZodReadonly:()=>Wc,$ZodRealError:()=>rt,$ZodRecord:()=>Cc,$ZodRegistry:()=>iu,$ZodSet:()=>Dc,$ZodString:()=>vn,$ZodStringFormat:()=>me,$ZodSuccess:()=>Hc,$ZodSymbol:()=>kc,$ZodTemplateLiteral:()=>Jc,$ZodTransform:()=>Lc,$ZodTuple:()=>Ro,$ZodType:()=>H,$ZodULID:()=>sc,$ZodURL:()=>tc,$ZodUUID:()=>Qa,$ZodUndefined:()=>Sc,$ZodUnion:()=>Ar,$ZodUnknown:()=>$c,$ZodVoid:()=>Ec,$ZodXID:()=>ac,$ZodXor:()=>Pc,$brand:()=>_p,$constructor:()=>g,$input:()=>Cm,$output:()=>Nm,Doc:()=>wo,JSONSchema:()=>fk,JSONSchemaGenerator:()=>Bu,NEVER:()=>bp,TimePrecision:()=>Dm,_any:()=>ku,_array:()=>Vm,_base64:()=>Wo,_base64url:()=>Jo,_bigint:()=>hu,_boolean:()=>fu,_catch:()=>aP,_check:()=>mk,_cidrv4:()=>Go,_cidrv6:()=>Ko,_coercedBigint:()=>Fm,_coercedBoolean:()=>Bm,_coercedDate:()=>qm,_coercedNumber:()=>Zm,_coercedString:()=>zm,_cuid:()=>Lo,_cuid2:()=>Zo,_custom:()=>Nu,_date:()=>$u,_decode:()=>ja,_decodeAsync:()=>Ma,_default:()=>iP,_discriminatedUnion:()=>HO,_e164:()=>Yo,_email:()=>No,_emoji:()=>Uo,_encode:()=>Da,_encodeAsync:()=>Ua,_endsWith:()=>Fr,_enum:()=>XO,_file:()=>Au,_float32:()=>lu,_float64:()=>du,_gt:()=>Ft,_gte:()=>We,_guid:()=>Dr,_includes:()=>Zr,_int:()=>uu,_int32:()=>pu,_int64:()=>gu,_intersection:()=>GO,_ipv4:()=>Vo,_ipv6:()=>Ho,_isoDate:()=>Um,_isoDateTime:()=>jm,_isoDuration:()=>Lm,_isoTime:()=>Mm,_jwt:()=>Xo,_ksuid:()=>qo,_lazy:()=>dP,_length:()=>tr,_literal:()=>eP,_lowercase:()=>Mr,_lt:()=>Bt,_lte:()=>mt,_mac:()=>au,_map:()=>JO,_max:()=>mt,_maxLength:()=>er,_maxSize:()=>Sn,_mime:()=>qr,_min:()=>We,_minLength:()=>nn,_minSize:()=>qt,_multipleOf:()=>kn,_nan:()=>wu,_nanoid:()=>Mo,_nativeEnum:()=>QO,_negative:()=>Tu,_never:()=>xu,_nonnegative:()=>Ou,_nonoptional:()=>oP,_nonpositive:()=>Ru,_normalize:()=>Vr,_null:()=>vu,_nullable:()=>rP,_number:()=>cu,_optional:()=>nP,_overwrite:()=>Rt,_parse:()=>wr,_parseAsync:()=>Er,_pipe:()=>cP,_positive:()=>Eu,_promise:()=>pP,_property:()=>Pu,_readonly:()=>uP,_record:()=>WO,_refine:()=>Cu,_regex:()=>Ur,_safeDecode:()=>Za,_safeDecodeAsync:()=>Fa,_safeEncode:()=>La,_safeEncodeAsync:()=>Ba,_safeParse:()=>Tr,_safeParseAsync:()=>Rr,_set:()=>YO,_size:()=>Qn,_slugify:()=>Wr,_startsWith:()=>Br,_string:()=>su,_stringFormat:()=>nr,_stringbool:()=>Uu,_success:()=>sP,_superRefine:()=>zu,_symbol:()=>_u,_templateLiteral:()=>lP,_toLowerCase:()=>Gr,_toUpperCase:()=>Kr,_transform:()=>tP,_trim:()=>Hr,_tuple:()=>KO,_uint32:()=>mu,_uint64:()=>bu,_ulid:()=>Bo,_undefined:()=>yu,_union:()=>qO,_unknown:()=>Su,_uppercase:()=>Lr,_url:()=>jr,_uuid:()=>Co,_uuidv4:()=>zo,_uuidv6:()=>Do,_uuidv7:()=>jo,_void:()=>Iu,_xid:()=>Fo,_xor:()=>VO,clone:()=>ze,config:()=>Re,createStandardJSONSchemaMethod:()=>Jr,createToJSONSchemaMethod:()=>Hm,decode:()=>Dy,decodeAsync:()=>Uy,describe:()=>Du,encode:()=>zy,encodeAsync:()=>jy,extractDefs:()=>In,finalize:()=>$n,flattenError:()=>So,formatError:()=>xo,globalConfig:()=>Kn,globalRegistry:()=>De,initializeContext:()=>xn,isValidBase64:()=>Om,isValidBase64URL:()=>uv,isValidJWT:()=>lv,locales:()=>zr,meta:()=>ju,parse:()=>Jn,parseAsync:()=>Yn,prettifyError:()=>Op,process:()=>pe,regexes:()=>it,registry:()=>ou,safeDecode:()=>Ly,safeDecodeAsync:()=>By,safeEncode:()=>My,safeEncodeAsync:()=>Zy,safeParse:()=>_n,safeParseAsync:()=>yn,toDotPath:()=>Cy,toJSONSchema:()=>rr,treeifyError:()=>Rp,util:()=>I,version:()=>Im});var xy,bp=Object.freeze({status:"aborted"});function g(t,e,n){function i(c,u){if(c._zod||Object.defineProperty(c,"_zod",{value:{def:u,constr:s,traits:new Set},enumerable:!1}),c._zod.traits.has(t))return;c._zod.traits.add(t),e(c,u);let d=s.prototype,l=Object.keys(d);for(let p=0;p<l.length;p++){let m=l[p];m in c||(c[m]=d[m].bind(c))}}let r=n?.Parent??Object;class o extends r{}Object.defineProperty(o,"name",{value:t});function s(c){var u;let d=n?.Parent?new o:this;i(d,c),(u=d._zod).deferred??(u.deferred=[]);for(let l of d._zod.deferred)l();return d}return Object.defineProperty(s,"init",{value:i}),Object.defineProperty(s,Symbol.hasInstance,{value:c=>n?.Parent&&c instanceof n.Parent?!0:c?._zod?.traits?.has(t)}),Object.defineProperty(s,"name",{value:t}),s}var _p=Symbol("zod_brand"),Tt=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},mn=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}};(xy=globalThis).__zod_globalConfig??(xy.__zod_globalConfig={});var Kn=globalThis.__zod_globalConfig;function Re(t){return t&&Object.assign(Kn,t),Kn}var I={};en(I,{BIGINT_FORMAT_RANGES:()=>Ep,Class:()=>vp,NUMBER_FORMAT_RANGES:()=>wp,aborted:()=>bn,allowsEval:()=>xp,assert:()=>r0,assertEqual:()=>QR,assertIs:()=>t0,assertNever:()=>n0,assertNotEqual:()=>e0,assignProp:()=>hn,base64ToUint8Array:()=>Py,base64urlToUint8Array:()=>f0,cached:()=>Ir,captureStackTrace:()=>Ca,cleanEnum:()=>m0,cleanRegex:()=>bo,clone:()=>ze,cloneDef:()=>o0,createTransparentProxy:()=>d0,defineLazy:()=>J,esc:()=>Na,escapeRegex:()=>_t,explicitlyAborted:()=>Tp,extend:()=>Ey,finalizeIssue:()=>Ke,floatSafeRemainder:()=>kp,getElementAtPath:()=>s0,getEnumValues:()=>go,getLengthableOrigin:()=>vo,getParsedType:()=>l0,getSizableOrigin:()=>yo,hexToUint8Array:()=>g0,isObject:()=>Wn,isPlainObject:()=>gn,issue:()=>$r,joinValues:()=>b,jsonStringifyReplacer:()=>xr,merge:()=>p0,mergeDefs:()=>tn,normalizeParams:()=>w,nullish:()=>fn,numKeys:()=>u0,objectClone:()=>i0,omit:()=>wy,optionalKeys:()=>$p,parsedType:()=>x,partial:()=>Ry,pick:()=>$y,prefixIssues:()=>nt,primitiveTypes:()=>Ip,promiseAllObject:()=>a0,propertyKeyTypes:()=>_o,randomString:()=>c0,required:()=>Oy,safeExtend:()=>Ty,shallowClone:()=>za,slugify:()=>Sp,stringifyPrimitive:()=>k,uint8ArrayToBase64:()=>Ay,uint8ArrayToBase64url:()=>h0,uint8ArrayToHex:()=>b0,unwrapMessage:()=>ho});function QR(t){return t}function e0(t){return t}function t0(t){}function n0(t){throw new Error("Unexpected value in exhaustive check")}function r0(t){}function go(t){let e=Object.values(t).filter(i=>typeof i=="number");return Object.entries(t).filter(([i,r])=>e.indexOf(+i)===-1).map(([i,r])=>r)}function b(t,e="|"){return t.map(n=>k(n)).join(e)}function xr(t,e){return typeof e=="bigint"?e.toString():e}function Ir(t){return{get value(){{let n=t();return Object.defineProperty(this,"value",{value:n}),n}throw new Error("cached value already set")}}}function fn(t){return t==null}function bo(t){let e=t.startsWith("^")?1:0,n=t.endsWith("$")?t.length-1:t.length;return t.slice(e,n)}function kp(t,e){let n=t/e,i=Math.round(n),r=Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-i)<r?0:n-i}var Iy=Symbol("evaluating");function J(t,e,n){let i;Object.defineProperty(t,e,{get(){if(i!==Iy)return i===void 0&&(i=Iy,i=n()),i},set(r){Object.defineProperty(t,e,{value:r})},configurable:!0})}function i0(t){return Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))}function hn(t,e,n){Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0})}function tn(...t){let e={};for(let n of t){let i=Object.getOwnPropertyDescriptors(n);Object.assign(e,i)}return Object.defineProperties({},e)}function o0(t){return tn(t._zod.def)}function s0(t,e){return e?e.reduce((n,i)=>n?.[i],t):t}function a0(t){let e=Object.keys(t),n=e.map(i=>t[i]);return Promise.all(n).then(i=>{let r={};for(let o=0;o<e.length;o++)r[e[o]]=i[o];return r})}function c0(t=10){let e="abcdefghijklmnopqrstuvwxyz",n="";for(let i=0;i<t;i++)n+=e[Math.floor(Math.random()*e.length)];return n}function Na(t){return JSON.stringify(t)}function Sp(t){return t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Ca="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function Wn(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}var xp=Ir(()=>{if(Kn.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});function gn(t){if(Wn(t)===!1)return!1;let e=t.constructor;if(e===void 0||typeof e!="function")return!0;let n=e.prototype;return!(Wn(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function za(t){return gn(t)?{...t}:Array.isArray(t)?[...t]:t instanceof Map?new Map(t):t instanceof Set?new Set(t):t}function u0(t){let e=0;for(let n in t)Object.prototype.hasOwnProperty.call(t,n)&&e++;return e}var l0=t=>{let e=typeof t;switch(e){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(t)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(t)?"array":t===null?"null":t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?"promise":typeof Map<"u"&&t instanceof Map?"map":typeof Set<"u"&&t instanceof Set?"set":typeof Date<"u"&&t instanceof Date?"date":typeof File<"u"&&t instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${e}`)}},_o=new Set(["string","number","symbol"]),Ip=new Set(["string","number","bigint","boolean","symbol","undefined"]);function _t(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ze(t,e,n){let i=new t._zod.constr(e??t._zod.def);return(!e||n?.parent)&&(i._zod.parent=t),i}function w(t){let e=t;if(!e)return{};if(typeof e=="string")return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}function d0(t){let e;return new Proxy({},{get(n,i,r){return e??(e=t()),Reflect.get(e,i,r)},set(n,i,r,o){return e??(e=t()),Reflect.set(e,i,r,o)},has(n,i){return e??(e=t()),Reflect.has(e,i)},deleteProperty(n,i){return e??(e=t()),Reflect.deleteProperty(e,i)},ownKeys(n){return e??(e=t()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(n,i){return e??(e=t()),Reflect.getOwnPropertyDescriptor(e,i)},defineProperty(n,i,r){return e??(e=t()),Reflect.defineProperty(e,i,r)}})}function k(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}function $p(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}var wp={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Ep={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function $y(t,e){let n=t._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let o=tn(t._zod.def,{get shape(){let s={};for(let c in e){if(!(c in n.shape))throw new Error(`Unrecognized key: "${c}"`);e[c]&&(s[c]=n.shape[c])}return hn(this,"shape",s),s},checks:[]});return ze(t,o)}function wy(t,e){let n=t._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let o=tn(t._zod.def,{get shape(){let s={...t._zod.def.shape};for(let c in e){if(!(c in n.shape))throw new Error(`Unrecognized key: "${c}"`);e[c]&&delete s[c]}return hn(this,"shape",s),s},checks:[]});return ze(t,o)}function Ey(t,e){if(!gn(e))throw new Error("Invalid input to extend: expected a plain object");let n=t._zod.def.checks;if(n&&n.length>0){let o=t._zod.def.shape;for(let s in e)if(Object.getOwnPropertyDescriptor(o,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let r=tn(t._zod.def,{get shape(){let o={...t._zod.def.shape,...e};return hn(this,"shape",o),o}});return ze(t,r)}function Ty(t,e){if(!gn(e))throw new Error("Invalid input to safeExtend: expected a plain object");let n=tn(t._zod.def,{get shape(){let i={...t._zod.def.shape,...e};return hn(this,"shape",i),i}});return ze(t,n)}function p0(t,e){if(t._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let n=tn(t._zod.def,{get shape(){let i={...t._zod.def.shape,...e._zod.def.shape};return hn(this,"shape",i),i},get catchall(){return e._zod.def.catchall},checks:e._zod.def.checks??[]});return ze(t,n)}function Ry(t,e,n){let r=e._zod.def.checks;if(r&&r.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let s=tn(e._zod.def,{get shape(){let c=e._zod.def.shape,u={...c};if(n)for(let d in n){if(!(d in c))throw new Error(`Unrecognized key: "${d}"`);n[d]&&(u[d]=t?new t({type:"optional",innerType:c[d]}):c[d])}else for(let d in c)u[d]=t?new t({type:"optional",innerType:c[d]}):c[d];return hn(this,"shape",u),u},checks:[]});return ze(e,s)}function Oy(t,e,n){let i=tn(e._zod.def,{get shape(){let r=e._zod.def.shape,o={...r};if(n)for(let s in n){if(!(s in o))throw new Error(`Unrecognized key: "${s}"`);n[s]&&(o[s]=new t({type:"nonoptional",innerType:r[s]}))}else for(let s in r)o[s]=new t({type:"nonoptional",innerType:r[s]});return hn(this,"shape",o),o}});return ze(e,i)}function bn(t,e=0){if(t.aborted===!0)return!0;for(let n=e;n<t.issues.length;n++)if(t.issues[n]?.continue!==!0)return!0;return!1}function Tp(t,e=0){if(t.aborted===!0)return!0;for(let n=e;n<t.issues.length;n++)if(t.issues[n]?.continue===!1)return!0;return!1}function nt(t,e){return e.map(n=>{var i;return(i=n).path??(i.path=[]),n.path.unshift(t),n})}function ho(t){return typeof t=="string"?t:t?.message}function Ke(t,e,n){let i=t.message?t.message:ho(t.inst?._zod.def?.error?.(t))??ho(e?.error?.(t))??ho(n.customError?.(t))??ho(n.localeError?.(t))??"Invalid input",{inst:r,continue:o,input:s,...c}=t;return c.path??(c.path=[]),c.message=i,e?.reportInput&&(c.input=s),c}function yo(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}function vo(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function x(t){let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"nan":"number";case"object":{if(t===null)return"null";if(Array.isArray(t))return"array";let n=t;if(n&&Object.getPrototypeOf(n)!==Object.prototype&&"constructor"in n&&n.constructor)return n.constructor.name}}return e}function $r(...t){let[e,n,i]=t;return typeof e=="string"?{message:e,code:"custom",input:n,inst:i}:{...e}}function m0(t){return Object.entries(t).filter(([e,n])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function Py(t){let e=atob(t),n=new Uint8Array(e.length);for(let i=0;i<e.length;i++)n[i]=e.charCodeAt(i);return n}function Ay(t){let e="";for(let n=0;n<t.length;n++)e+=String.fromCharCode(t[n]);return btoa(e)}function f0(t){let e=t.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-e.length%4)%4);return Py(e+n)}function h0(t){return Ay(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function g0(t){let e=t.replace(/^0x/,"");if(e.length%2!==0)throw new Error("Invalid hex string length");let n=new Uint8Array(e.length/2);for(let i=0;i<e.length;i+=2)n[i/2]=Number.parseInt(e.slice(i,i+2),16);return n}function b0(t){return Array.from(t).map(e=>e.toString(16).padStart(2,"0")).join("")}var vp=class{constructor(...e){}};var Ny=(t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:e,enumerable:!1}),t.message=JSON.stringify(e,xr,2),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:!1})},ko=g("$ZodError",Ny),rt=g("$ZodError",Ny,{Parent:Error});function So(t,e=n=>n.message){let n={},i=[];for(let r of t.issues)r.path.length>0?(n[r.path[0]]=n[r.path[0]]||[],n[r.path[0]].push(e(r))):i.push(e(r));return{formErrors:i,fieldErrors:n}}function xo(t,e=n=>n.message){let n={_errors:[]},i=(r,o=[])=>{for(let s of r.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(c=>i({issues:c},[...o,...s.path]));else if(s.code==="invalid_key")i({issues:s.issues},[...o,...s.path]);else if(s.code==="invalid_element")i({issues:s.issues},[...o,...s.path]);else{let c=[...o,...s.path];if(c.length===0)n._errors.push(e(s));else{let u=n,d=0;for(;d<c.length;){let l=c[d];d===c.length-1?(u[l]=u[l]||{_errors:[]},u[l]._errors.push(e(s))):u[l]=u[l]||{_errors:[]},u=u[l],d++}}}};return i(t),n}function Rp(t,e=n=>n.message){let n={errors:[]},i=(r,o=[])=>{var s,c;for(let u of r.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map(d=>i({issues:d},[...o,...u.path]));else if(u.code==="invalid_key")i({issues:u.issues},[...o,...u.path]);else if(u.code==="invalid_element")i({issues:u.issues},[...o,...u.path]);else{let d=[...o,...u.path];if(d.length===0){n.errors.push(e(u));continue}let l=n,p=0;for(;p<d.length;){let m=d[p],f=p===d.length-1;typeof m=="string"?(l.properties??(l.properties={}),(s=l.properties)[m]??(s[m]={errors:[]}),l=l.properties[m]):(l.items??(l.items=[]),(c=l.items)[m]??(c[m]={errors:[]}),l=l.items[m]),f&&l.errors.push(e(u)),p++}}};return i(t),n}function Cy(t){let e=[],n=t.map(i=>typeof i=="object"?i.key:i);for(let i of n)typeof i=="number"?e.push(`[${i}]`):typeof i=="symbol"?e.push(`[${JSON.stringify(String(i))}]`):/[^\w$]/.test(i)?e.push(`[${JSON.stringify(i)}]`):(e.length&&e.push("."),e.push(i));return e.join("")}function Op(t){let e=[],n=[...t.issues].sort((i,r)=>(i.path??[]).length-(r.path??[]).length);for(let i of n)e.push(`\u2716 ${i.message}`),i.path?.length&&e.push(` \u2192 at ${Cy(i.path)}`);return e.join(`
|
|
11
|
-
`)}var wr=t=>(e,n,i,r)=>{let o=i?{...i,async:!1}:{async:!1},s=e._zod.run({value:n,issues:[]},o);if(s instanceof Promise)throw new Tt;if(s.issues.length){let c=new(r?.Err??t)(s.issues.map(u=>Ke(u,o,Re())));throw Ca(c,r?.callee),c}return s.value},Jn=wr(rt),Er=t=>async(e,n,i,r)=>{let o=i?{...i,async:!0}:{async:!0},s=e._zod.run({value:n,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let c=new(r?.Err??t)(s.issues.map(u=>Ke(u,o,Re())));throw Ca(c,r?.callee),c}return s.value},Yn=Er(rt),Tr=t=>(e,n,i)=>{let r=i?{...i,async:!1}:{async:!1},o=e._zod.run({value:n,issues:[]},r);if(o instanceof Promise)throw new Tt;return o.issues.length?{success:!1,error:new(t??ko)(o.issues.map(s=>Ke(s,r,Re())))}:{success:!0,data:o.value}},_n=Tr(rt),Rr=t=>async(e,n,i)=>{let r=i?{...i,async:!0}:{async:!0},o=e._zod.run({value:n,issues:[]},r);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new t(o.issues.map(s=>Ke(s,r,Re())))}:{success:!0,data:o.value}},yn=Rr(rt),Da=t=>(e,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return wr(t)(e,n,r)},zy=Da(rt),ja=t=>(e,n,i)=>wr(t)(e,n,i),Dy=ja(rt),Ua=t=>async(e,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return Er(t)(e,n,r)},jy=Ua(rt),Ma=t=>async(e,n,i)=>Er(t)(e,n,i),Uy=Ma(rt),La=t=>(e,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return Tr(t)(e,n,r)},My=La(rt),Za=t=>(e,n,i)=>Tr(t)(e,n,i),Ly=Za(rt),Ba=t=>async(e,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return Rr(t)(e,n,r)},Zy=Ba(rt),Fa=t=>async(e,n,i)=>Rr(t)(e,n,i),By=Fa(rt);var it={};en(it,{base64:()=>Hp,base64url:()=>qa,bigint:()=>Qp,boolean:()=>tm,browserEmail:()=>w0,cidrv4:()=>qp,cidrv6:()=>Vp,cuid:()=>Pp,cuid2:()=>Ap,date:()=>Wp,datetime:()=>Yp,domain:()=>R0,duration:()=>jp,e164:()=>Kp,email:()=>Mp,emoji:()=>Lp,extendedDuration:()=>y0,guid:()=>Up,hex:()=>O0,hostname:()=>T0,html5Email:()=>x0,httpProtocol:()=>Gp,idnEmail:()=>$0,integer:()=>em,ipv4:()=>Zp,ipv6:()=>Bp,ksuid:()=>zp,lowercase:()=>im,mac:()=>Fp,md5_base64:()=>A0,md5_base64url:()=>N0,md5_hex:()=>P0,nanoid:()=>Dp,null:()=>nm,number:()=>Va,rfc5322Email:()=>I0,sha1_base64:()=>z0,sha1_base64url:()=>D0,sha1_hex:()=>C0,sha256_base64:()=>U0,sha256_base64url:()=>M0,sha256_hex:()=>j0,sha384_base64:()=>Z0,sha384_base64url:()=>B0,sha384_hex:()=>L0,sha512_base64:()=>q0,sha512_base64url:()=>V0,sha512_hex:()=>F0,string:()=>Xp,time:()=>Jp,ulid:()=>Np,undefined:()=>rm,unicodeEmail:()=>Fy,uppercase:()=>om,uuid:()=>Xn,uuid4:()=>v0,uuid6:()=>k0,uuid7:()=>S0,xid:()=>Cp});var Pp=/^[cC][0-9a-z]{6,}$/,Ap=/^[0-9a-z]+$/,Np=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Cp=/^[0-9a-vA-V]{20}$/,zp=/^[A-Za-z0-9]{27}$/,Dp=/^[a-zA-Z0-9_-]{21}$/,jp=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,y0=/^[-+]?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)?)??$/,Up=/^([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})$/,Xn=t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,v0=Xn(4),k0=Xn(6),S0=Xn(7),Mp=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,x0=/^[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])?)*$/,I0=/^(([^<>()\[\]\\.,;:\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,}))$/,Fy=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,$0=Fy,w0=/^[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])?)*$/,E0="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Lp(){return new RegExp(E0,"u")}var Zp=/^(?:(?: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])$/,Bp=/^(([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}|:))$/,Fp=t=>{let e=_t(t??":");return new RegExp(`^(?:[0-9A-F]{2}${e}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${e}){5}[0-9a-f]{2}$`)},qp=/^((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])$/,Vp=/^(([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])$/,Hp=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,qa=/^[A-Za-z0-9_-]*$/,T0=/^(?=.{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])?)*\.?$/,R0=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Gp=/^https?$/,Kp=/^\+[1-9]\d{6,14}$/,qy="(?:(?:\\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])))",Wp=new RegExp(`^${qy}$`);function Vy(t){let e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof t.precision=="number"?t.precision===-1?`${e}`:t.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${t.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Jp(t){return new RegExp(`^${Vy(t)}$`)}function Yp(t){let e=Vy({precision:t.precision}),n=["Z"];t.local&&n.push(""),t.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let i=`${e}(?:${n.join("|")})`;return new RegExp(`^${qy}T(?:${i})$`)}var Xp=t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},Qp=/^-?\d+n?$/,em=/^-?\d+$/,Va=/^-?\d+(?:\.\d+)?$/,tm=/^(?:true|false)$/i,nm=/^null$/i;var rm=/^undefined$/i;var im=/^[^A-Z]*$/,om=/^[^a-z]*$/,O0=/^[0-9a-fA-F]*$/;function Io(t,e){return new RegExp(`^[A-Za-z0-9+/]{${t}}${e}$`)}function $o(t){return new RegExp(`^[A-Za-z0-9_-]{${t}}$`)}var P0=/^[0-9a-fA-F]{32}$/,A0=Io(22,"=="),N0=$o(22),C0=/^[0-9a-fA-F]{40}$/,z0=Io(27,"="),D0=$o(27),j0=/^[0-9a-fA-F]{64}$/,U0=Io(43,"="),M0=$o(43),L0=/^[0-9a-fA-F]{96}$/,Z0=Io(64,""),B0=$o(64),F0=/^[0-9a-fA-F]{128}$/,q0=Io(86,"=="),V0=$o(86);var he=g("$ZodCheck",(t,e)=>{var n;t._zod??(t._zod={}),t._zod.def=e,(n=t._zod).onattach??(n.onattach=[])}),Gy={number:"number",bigint:"bigint",object:"date"},Ha=g("$ZodCheckLessThan",(t,e)=>{he.init(t,e);let n=Gy[typeof e.value];t._zod.onattach.push(i=>{let r=i._zod.bag,o=(e.inclusive?r.maximum:r.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value<o&&(e.inclusive?r.maximum=e.value:r.exclusiveMaximum=e.value)}),t._zod.check=i=>{(e.inclusive?i.value<=e.value:i.value<e.value)||i.issues.push({origin:n,code:"too_big",maximum:typeof e.value=="object"?e.value.getTime():e.value,input:i.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),Ga=g("$ZodCheckGreaterThan",(t,e)=>{he.init(t,e);let n=Gy[typeof e.value];t._zod.onattach.push(i=>{let r=i._zod.bag,o=(e.inclusive?r.minimum:r.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>o&&(e.inclusive?r.minimum=e.value:r.exclusiveMinimum=e.value)}),t._zod.check=i=>{(e.inclusive?i.value>=e.value:i.value>e.value)||i.issues.push({origin:n,code:"too_small",minimum:typeof e.value=="object"?e.value.getTime():e.value,input:i.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),sm=g("$ZodCheckMultipleOf",(t,e)=>{he.init(t,e),t._zod.onattach.push(n=>{var i;(i=n._zod.bag).multipleOf??(i.multipleOf=e.value)}),t._zod.check=n=>{if(typeof n.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%e.value===BigInt(0):kp(n.value,e.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:e.value,input:n.value,inst:t,continue:!e.abort})}}),am=g("$ZodCheckNumberFormat",(t,e)=>{he.init(t,e),e.format=e.format||"float64";let n=e.format?.includes("int"),i=n?"int":"number",[r,o]=wp[e.format];t._zod.onattach.push(s=>{let c=s._zod.bag;c.format=e.format,c.minimum=r,c.maximum=o,n&&(c.pattern=em)}),t._zod.check=s=>{let c=s.value;if(n){if(!Number.isInteger(c)){s.issues.push({expected:i,format:e.format,code:"invalid_type",continue:!1,input:c,inst:t});return}if(!Number.isSafeInteger(c)){c>0?s.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:i,inclusive:!0,continue:!e.abort}):s.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:i,inclusive:!0,continue:!e.abort});return}}c<r&&s.issues.push({origin:"number",input:c,code:"too_small",minimum:r,inclusive:!0,inst:t,continue:!e.abort}),c>o&&s.issues.push({origin:"number",input:c,code:"too_big",maximum:o,inclusive:!0,inst:t,continue:!e.abort})}}),cm=g("$ZodCheckBigIntFormat",(t,e)=>{he.init(t,e);let[n,i]=Ep[e.format];t._zod.onattach.push(r=>{let o=r._zod.bag;o.format=e.format,o.minimum=n,o.maximum=i}),t._zod.check=r=>{let o=r.value;o<n&&r.issues.push({origin:"bigint",input:o,code:"too_small",minimum:n,inclusive:!0,inst:t,continue:!e.abort}),o>i&&r.issues.push({origin:"bigint",input:o,code:"too_big",maximum:i,inclusive:!0,inst:t,continue:!e.abort})}}),um=g("$ZodCheckMaxSize",(t,e)=>{var n;he.init(t,e),(n=t._zod.def).when??(n.when=i=>{let r=i.value;return!fn(r)&&r.size!==void 0}),t._zod.onattach.push(i=>{let r=i._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<r&&(i._zod.bag.maximum=e.maximum)}),t._zod.check=i=>{let r=i.value;r.size<=e.maximum||i.issues.push({origin:yo(r),code:"too_big",maximum:e.maximum,inclusive:!0,input:r,inst:t,continue:!e.abort})}}),lm=g("$ZodCheckMinSize",(t,e)=>{var n;he.init(t,e),(n=t._zod.def).when??(n.when=i=>{let r=i.value;return!fn(r)&&r.size!==void 0}),t._zod.onattach.push(i=>{let r=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>r&&(i._zod.bag.minimum=e.minimum)}),t._zod.check=i=>{let r=i.value;r.size>=e.minimum||i.issues.push({origin:yo(r),code:"too_small",minimum:e.minimum,inclusive:!0,input:r,inst:t,continue:!e.abort})}}),dm=g("$ZodCheckSizeEquals",(t,e)=>{var n;he.init(t,e),(n=t._zod.def).when??(n.when=i=>{let r=i.value;return!fn(r)&&r.size!==void 0}),t._zod.onattach.push(i=>{let r=i._zod.bag;r.minimum=e.size,r.maximum=e.size,r.size=e.size}),t._zod.check=i=>{let r=i.value,o=r.size;if(o===e.size)return;let s=o>e.size;i.issues.push({origin:yo(r),...s?{code:"too_big",maximum:e.size}:{code:"too_small",minimum:e.size},inclusive:!0,exact:!0,input:i.value,inst:t,continue:!e.abort})}}),pm=g("$ZodCheckMaxLength",(t,e)=>{var n;he.init(t,e),(n=t._zod.def).when??(n.when=i=>{let r=i.value;return!fn(r)&&r.length!==void 0}),t._zod.onattach.push(i=>{let r=i._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<r&&(i._zod.bag.maximum=e.maximum)}),t._zod.check=i=>{let r=i.value;if(r.length<=e.maximum)return;let s=vo(r);i.issues.push({origin:s,code:"too_big",maximum:e.maximum,inclusive:!0,input:r,inst:t,continue:!e.abort})}}),mm=g("$ZodCheckMinLength",(t,e)=>{var n;he.init(t,e),(n=t._zod.def).when??(n.when=i=>{let r=i.value;return!fn(r)&&r.length!==void 0}),t._zod.onattach.push(i=>{let r=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>r&&(i._zod.bag.minimum=e.minimum)}),t._zod.check=i=>{let r=i.value;if(r.length>=e.minimum)return;let s=vo(r);i.issues.push({origin:s,code:"too_small",minimum:e.minimum,inclusive:!0,input:r,inst:t,continue:!e.abort})}}),fm=g("$ZodCheckLengthEquals",(t,e)=>{var n;he.init(t,e),(n=t._zod.def).when??(n.when=i=>{let r=i.value;return!fn(r)&&r.length!==void 0}),t._zod.onattach.push(i=>{let r=i._zod.bag;r.minimum=e.length,r.maximum=e.length,r.length=e.length}),t._zod.check=i=>{let r=i.value,o=r.length;if(o===e.length)return;let s=vo(r),c=o>e.length;i.issues.push({origin:s,...c?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:i.value,inst:t,continue:!e.abort})}}),Or=g("$ZodCheckStringFormat",(t,e)=>{var n,i;he.init(t,e),t._zod.onattach.push(r=>{let o=r._zod.bag;o.format=e.format,e.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(e.pattern))}),e.pattern?(n=t._zod).check??(n.check=r=>{e.pattern.lastIndex=0,!e.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:e.format,input:r.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(i=t._zod).check??(i.check=()=>{})}),hm=g("$ZodCheckRegex",(t,e)=>{Or.init(t,e),t._zod.check=n=>{e.pattern.lastIndex=0,!e.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}}),gm=g("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=im),Or.init(t,e)}),bm=g("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=om),Or.init(t,e)}),_m=g("$ZodCheckIncludes",(t,e)=>{he.init(t,e);let n=_t(e.includes),i=new RegExp(typeof e.position=="number"?`^.{${e.position}}${n}`:n);e.pattern=i,t._zod.onattach.push(r=>{let o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(i)}),t._zod.check=r=>{r.value.includes(e.includes,e.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:r.value,inst:t,continue:!e.abort})}}),ym=g("$ZodCheckStartsWith",(t,e)=>{he.init(t,e);let n=new RegExp(`^${_t(e.prefix)}.*`);e.pattern??(e.pattern=n),t._zod.onattach.push(i=>{let r=i._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(n)}),t._zod.check=i=>{i.value.startsWith(e.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:i.value,inst:t,continue:!e.abort})}}),vm=g("$ZodCheckEndsWith",(t,e)=>{he.init(t,e);let n=new RegExp(`.*${_t(e.suffix)}$`);e.pattern??(e.pattern=n),t._zod.onattach.push(i=>{let r=i._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(n)}),t._zod.check=i=>{i.value.endsWith(e.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:i.value,inst:t,continue:!e.abort})}});function Hy(t,e,n){t.issues.length&&e.issues.push(...nt(n,t.issues))}var km=g("$ZodCheckProperty",(t,e)=>{he.init(t,e),t._zod.check=n=>{let i=e.schema._zod.run({value:n.value[e.property],issues:[]},{});if(i instanceof Promise)return i.then(r=>Hy(r,n,e.property));Hy(i,n,e.property)}}),Sm=g("$ZodCheckMimeType",(t,e)=>{he.init(t,e);let n=new Set(e.mime);t._zod.onattach.push(i=>{i._zod.bag.mime=e.mime}),t._zod.check=i=>{n.has(i.value.type)||i.issues.push({code:"invalid_value",values:e.mime,input:i.value.type,inst:t,continue:!e.abort})}}),xm=g("$ZodCheckOverwrite",(t,e)=>{he.init(t,e),t._zod.check=n=>{n.value=e.tx(n.value)}});var wo=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let i=e.split(`
|
|
10
|
+
deps: ${n}}`};var e1={keyword:"dependencies",type:"object",schemaType:"object",error:Jt.error,code(t){let[e,n]=t1(t);rw(t,e),iw(t,n)}};function t1({schema:t}){let e={},n={};for(let i in t){if(i==="__proto__")continue;let r=Array.isArray(t[i])?e:n;r[i]=t[i]}return[e,n]}function rw(t,e=t.schema){let{gen:n,data:i,it:r}=t;if(Object.keys(e).length===0)return;let o=n.let("missing");for(let s in e){let c=e[s];if(c.length===0)continue;let u=(0,ha.propertyInData)(n,i,s,r.opts.ownProperties);t.setParams({property:s,depsCount:c.length,deps:c.join(", ")}),r.allErrors?n.if(u,()=>{for(let l of c)(0,ha.checkReportMissingProp)(t,l)}):(n.if((0,Yb._)`${u} && (${(0,ha.checkMissingProp)(t,c,o)})`),(0,ha.reportMissingProp)(t,o),n.else())}}Jt.validatePropertyDeps=rw;function iw(t,e=t.schema){let{gen:n,data:i,keyword:r,it:o}=t,s=n.name("valid");for(let c in e)(0,QU.alwaysValidSchema)(o,e[c])||(n.if((0,ha.propertyInData)(n,i,c,o.opts.ownProperties),()=>{let u=t.subschema({keyword:r,schemaProp:c},s);t.mergeValidEvaluated(u,s)},()=>n.var(s,!0)),t.ok(s))}Jt.validateSchemaDeps=iw;Jt.default=e1});var aw=N(Xb=>{"use strict";Object.defineProperty(Xb,"__esModule",{value:!0});var sw=X(),n1=se(),r1={message:"property name must be valid",params:({params:t})=>(0,sw._)`{propertyName: ${t.propertyName}}`},i1={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:r1,code(t){let{gen:e,schema:n,data:i,it:r}=t;if((0,n1.alwaysValidSchema)(r,n))return;let o=e.name("valid");e.forIn("key",i,s=>{t.setParams({propertyName:s}),t.subschema({keyword:"propertyNames",data:s,dataTypes:["string"],propertyName:s,compositeRule:!0},o),e.if((0,sw.not)(o),()=>{t.error(!0),r.allErrors||e.break()})}),t.ok(o)}};Xb.default=i1});var ey=N(Qb=>{"use strict";Object.defineProperty(Qb,"__esModule",{value:!0});var zd=xt(),Ut=X(),o1=pn(),Dd=se(),s1={message:"must NOT have additional properties",params:({params:t})=>(0,Ut._)`{additionalProperty: ${t.additionalProperty}}`},a1={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:s1,code(t){let{gen:e,schema:n,parentSchema:i,data:r,errsCount:o,it:s}=t;if(!o)throw new Error("ajv implementation error");let{allErrors:c,opts:u}=s;if(s.props=!0,u.removeAdditional!=="all"&&(0,Dd.alwaysValidSchema)(s,n))return;let l=(0,zd.allSchemaProperties)(i.properties),p=(0,zd.allSchemaProperties)(i.patternProperties);d(),t.ok((0,Ut._)`${o} === ${o1.default.errors}`);function d(){e.forIn("key",r,v=>{!l.length&&!p.length?g(v):e.if(m(v),()=>g(v))})}function m(v){let S;if(l.length>8){let z=(0,Dd.schemaRefOrVal)(s,i.properties,"properties");S=(0,zd.isOwnProperty)(e,z,v)}else l.length?S=(0,Ut.or)(...l.map(z=>(0,Ut._)`${v} === ${z}`)):S=Ut.nil;return p.length&&(S=(0,Ut.or)(S,...p.map(z=>(0,Ut._)`${(0,zd.usePattern)(t,z)}.test(${v})`))),(0,Ut.not)(S)}function f(v){e.code((0,Ut._)`delete ${r}[${v}]`)}function g(v){if(u.removeAdditional==="all"||u.removeAdditional&&n===!1){f(v);return}if(n===!1){t.setParams({additionalProperty:v}),t.error(),c||e.break();return}if(typeof n=="object"&&!(0,Dd.alwaysValidSchema)(s,n)){let S=e.name("valid");u.removeAdditional==="failing"?(y(v,S,!1),e.if((0,Ut.not)(S),()=>{t.reset(),f(v)})):(y(v,S),c||e.if((0,Ut.not)(S),()=>e.break()))}}function y(v,S,z){let R={keyword:"additionalProperties",dataProp:v,dataPropType:Dd.Type.Str};z===!1&&Object.assign(R,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(R,S)}}};Qb.default=a1});var lw=N(ny=>{"use strict";Object.defineProperty(ny,"__esModule",{value:!0});var c1=na(),cw=xt(),ty=se(),uw=ey(),u1={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:n,parentSchema:i,data:r,it:o}=t;o.opts.removeAdditional==="all"&&i.additionalProperties===void 0&&uw.default.code(new c1.KeywordCxt(o,uw.default,"additionalProperties"));let s=(0,cw.allSchemaProperties)(n);for(let d of s)o.definedProperties.add(d);o.opts.unevaluated&&s.length&&o.props!==!0&&(o.props=ty.mergeEvaluated.props(e,(0,ty.toHash)(s),o.props));let c=s.filter(d=>!(0,ty.alwaysValidSchema)(o,n[d]));if(c.length===0)return;let u=e.name("valid");for(let d of c)l(d)?p(d):(e.if((0,cw.propertyInData)(e,r,d,o.opts.ownProperties)),p(d),o.allErrors||e.else().var(u,!0),e.endIf()),t.it.definedProperties.add(d),t.ok(u);function l(d){return o.opts.useDefaults&&!o.compositeRule&&n[d].default!==void 0}function p(d){t.subschema({keyword:"properties",schemaProp:d,dataProp:d},u)}}};ny.default=u1});var fw=N(ry=>{"use strict";Object.defineProperty(ry,"__esModule",{value:!0});var dw=xt(),jd=X(),pw=se(),mw=se(),l1={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:n,data:i,parentSchema:r,it:o}=t,{opts:s}=o,c=(0,dw.allSchemaProperties)(n),u=c.filter(y=>(0,pw.alwaysValidSchema)(o,n[y]));if(c.length===0||u.length===c.length&&(!o.opts.unevaluated||o.props===!0))return;let l=s.strictSchema&&!s.allowMatchingProperties&&r.properties,p=e.name("valid");o.props!==!0&&!(o.props instanceof jd.Name)&&(o.props=(0,mw.evaluatedPropsToName)(e,o.props));let{props:d}=o;m();function m(){for(let y of c)l&&f(y),o.allErrors?g(y):(e.var(p,!0),g(y),e.if(p))}function f(y){for(let v in l)new RegExp(y).test(v)&&(0,pw.checkStrictMode)(o,`property ${v} matches pattern ${y} (use allowMatchingProperties)`)}function g(y){e.forIn("key",i,v=>{e.if((0,jd._)`${(0,dw.usePattern)(t,y)}.test(${v})`,()=>{let S=u.includes(y);S||t.subschema({keyword:"patternProperties",schemaProp:y,dataProp:v,dataPropType:mw.Type.Str},p),o.opts.unevaluated&&d!==!0?e.assign((0,jd._)`${d}[${v}]`,!0):!S&&!o.allErrors&&e.if((0,jd.not)(p),()=>e.break())})})}}};ry.default=l1});var gw=N(iy=>{"use strict";Object.defineProperty(iy,"__esModule",{value:!0});var d1=se(),p1={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:n,it:i}=t;if((0,d1.alwaysValidSchema)(i,n)){t.fail();return}let r=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},r),t.failResult(r,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};iy.default=p1});var hw=N(oy=>{"use strict";Object.defineProperty(oy,"__esModule",{value:!0});var m1=xt(),f1={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:m1.validateUnion,error:{message:"must match a schema in anyOf"}};oy.default=f1});var bw=N(sy=>{"use strict";Object.defineProperty(sy,"__esModule",{value:!0});var Ud=X(),g1=se(),h1={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,Ud._)`{passingSchemas: ${t.passing}}`},b1={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:h1,code(t){let{gen:e,schema:n,parentSchema:i,it:r}=t;if(!Array.isArray(n))throw new Error("ajv implementation error");if(r.opts.discriminator&&i.discriminator)return;let o=n,s=e.let("valid",!1),c=e.let("passing",null),u=e.name("_valid");t.setParams({passing:c}),e.block(l),t.result(s,()=>t.reset(),()=>t.error(!0));function l(){o.forEach((p,d)=>{let m;(0,g1.alwaysValidSchema)(r,p)?e.var(u,!0):m=t.subschema({keyword:"oneOf",schemaProp:d,compositeRule:!0},u),d>0&&e.if((0,Ud._)`${u} && ${s}`).assign(s,!1).assign(c,(0,Ud._)`[${c}, ${d}]`).else(),e.if(u,()=>{e.assign(s,!0),e.assign(c,d),m&&t.mergeEvaluated(m,Ud.Name)})})}}};sy.default=b1});var yw=N(ay=>{"use strict";Object.defineProperty(ay,"__esModule",{value:!0});var y1=se(),_1={keyword:"allOf",schemaType:"array",code(t){let{gen:e,schema:n,it:i}=t;if(!Array.isArray(n))throw new Error("ajv implementation error");let r=e.name("valid");n.forEach((o,s)=>{if((0,y1.alwaysValidSchema)(i,o))return;let c=t.subschema({keyword:"allOf",schemaProp:s},r);t.ok(r),t.mergeEvaluated(c)})}};ay.default=_1});var kw=N(cy=>{"use strict";Object.defineProperty(cy,"__esModule",{value:!0});var Md=X(),vw=se(),v1={message:({params:t})=>(0,Md.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,Md._)`{failingKeyword: ${t.ifClause}}`},k1={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:v1,code(t){let{gen:e,parentSchema:n,it:i}=t;n.then===void 0&&n.else===void 0&&(0,vw.checkStrictMode)(i,'"if" without "then" and "else" is ignored');let r=_w(i,"then"),o=_w(i,"else");if(!r&&!o)return;let s=e.let("valid",!0),c=e.name("_valid");if(u(),t.reset(),r&&o){let p=e.let("ifClause");t.setParams({ifClause:p}),e.if(c,l("then",p),l("else",p))}else r?e.if(c,l("then")):e.if((0,Md.not)(c),l("else"));t.pass(s,()=>t.error(!0));function u(){let p=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},c);t.mergeEvaluated(p)}function l(p,d){return()=>{let m=t.subschema({keyword:p},c);e.assign(s,c),t.mergeValidEvaluated(m,s),d?e.assign(d,(0,Md._)`${p}`):t.setParams({ifClause:p})}}}};function _w(t,e){let n=t.schema[e];return n!==void 0&&!(0,vw.alwaysValidSchema)(t,n)}cy.default=k1});var Sw=N(uy=>{"use strict";Object.defineProperty(uy,"__esModule",{value:!0});var S1=se(),x1={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:n}){e.if===void 0&&(0,S1.checkStrictMode)(n,`"${t}" without "if" is ignored`)}};uy.default=x1});var xw=N(ly=>{"use strict";Object.defineProperty(ly,"__esModule",{value:!0});var I1=Hb(),$1=Q$(),w1=Kb(),E1=tw(),T1=nw(),R1=ow(),O1=aw(),P1=ey(),A1=lw(),N1=fw(),C1=gw(),z1=hw(),D1=bw(),j1=yw(),U1=kw(),M1=Sw();function L1(t=!1){let e=[C1.default,z1.default,D1.default,j1.default,U1.default,M1.default,O1.default,P1.default,R1.default,A1.default,N1.default];return t?e.push($1.default,E1.default):e.push(I1.default,w1.default),e.push(T1.default),e}ly.default=L1});var Iw=N(dy=>{"use strict";Object.defineProperty(dy,"__esModule",{value:!0});var Pe=X(),Z1={message:({schemaCode:t})=>(0,Pe.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,Pe._)`{format: ${t}}`},B1={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:Z1,code(t,e){let{gen:n,data:i,$data:r,schema:o,schemaCode:s,it:c}=t,{opts:u,errSchemaPath:l,schemaEnv:p,self:d}=c;if(!u.validateFormats)return;r?m():f();function m(){let g=n.scopeValue("formats",{ref:d.formats,code:u.code.formats}),y=n.const("fDef",(0,Pe._)`${g}[${s}]`),v=n.let("fType"),S=n.let("format");n.if((0,Pe._)`typeof ${y} == "object" && !(${y} instanceof RegExp)`,()=>n.assign(v,(0,Pe._)`${y}.type || "string"`).assign(S,(0,Pe._)`${y}.validate`),()=>n.assign(v,(0,Pe._)`"string"`).assign(S,y)),t.fail$data((0,Pe.or)(z(),R()));function z(){return u.strictSchema===!1?Pe.nil:(0,Pe._)`${s} && !${S}`}function R(){let U=p.$async?(0,Pe._)`(${y}.async ? await ${S}(${i}) : ${S}(${i}))`:(0,Pe._)`${S}(${i})`,j=(0,Pe._)`(typeof ${S} == "function" ? ${U} : ${S}.test(${i}))`;return(0,Pe._)`${S} && ${S} !== true && ${v} === ${e} && !${j}`}}function f(){let g=d.formats[o];if(!g){z();return}if(g===!0)return;let[y,v,S]=R(g);y===e&&t.pass(U());function z(){if(u.strictSchema===!1){d.logger.warn(j());return}throw new Error(j());function j(){return`unknown format "${o}" ignored in schema at path "${l}"`}}function R(j){let je=j instanceof RegExp?(0,Pe.regexpCode)(j):u.code.formats?(0,Pe._)`${u.code.formats}${(0,Pe.getProperty)(o)}`:void 0,bt=n.scopeValue("formats",{key:o,ref:j,code:je});return typeof j=="object"&&!(j instanceof RegExp)?[j.type||"string",j.validate,(0,Pe._)`${bt}.validate`]:["string",j,bt]}function U(){if(typeof g=="object"&&!(g instanceof RegExp)&&g.async){if(!p.$async)throw new Error("async format in sync schema");return(0,Pe._)`await ${S}(${i})`}return typeof v=="function"?(0,Pe._)`${S}(${i})`:(0,Pe._)`${S}.test(${i})`}}}};dy.default=B1});var $w=N(py=>{"use strict";Object.defineProperty(py,"__esModule",{value:!0});var F1=Iw(),V1=[F1.default];py.default=V1});var ww=N(qi=>{"use strict";Object.defineProperty(qi,"__esModule",{value:!0});qi.contentVocabulary=qi.metadataVocabulary=void 0;qi.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];qi.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var Tw=N(my=>{"use strict";Object.defineProperty(my,"__esModule",{value:!0});var q1=z$(),H1=W$(),K1=xw(),G1=$w(),Ew=ww(),W1=[q1.default,H1.default,(0,K1.default)(),G1.default,Ew.metadataVocabulary,Ew.contentVocabulary];my.default=W1});var Ow=N(Ld=>{"use strict";Object.defineProperty(Ld,"__esModule",{value:!0});Ld.DiscrError=void 0;var Rw;(function(t){t.Tag="tag",t.Mapping="mapping"})(Rw||(Ld.DiscrError=Rw={}))});var Aw=N(gy=>{"use strict";Object.defineProperty(gy,"__esModule",{value:!0});var Hi=X(),fy=Ow(),Pw=kd(),J1=ra(),Y1=se(),X1={message:({params:{discrError:t,tagName:e}})=>t===fy.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:n}})=>(0,Hi._)`{error: ${t}, tag: ${n}, tagValue: ${e}}`},Q1={keyword:"discriminator",type:"object",schemaType:"object",error:X1,code(t){let{gen:e,data:n,schema:i,parentSchema:r,it:o}=t,{oneOf:s}=r;if(!o.opts.discriminator)throw new Error("discriminator: requires discriminator option");let c=i.propertyName;if(typeof c!="string")throw new Error("discriminator: requires propertyName");if(i.mapping)throw new Error("discriminator: mapping is not supported");if(!s)throw new Error("discriminator: requires oneOf keyword");let u=e.let("valid",!1),l=e.const("tag",(0,Hi._)`${n}${(0,Hi.getProperty)(c)}`);e.if((0,Hi._)`typeof ${l} == "string"`,()=>p(),()=>t.error(!1,{discrError:fy.DiscrError.Tag,tag:l,tagName:c})),t.ok(u);function p(){let f=m();e.if(!1);for(let g in f)e.elseIf((0,Hi._)`${l} === ${g}`),e.assign(u,d(f[g]));e.else(),t.error(!1,{discrError:fy.DiscrError.Mapping,tag:l,tagName:c}),e.endIf()}function d(f){let g=e.name("valid"),y=t.subschema({keyword:"oneOf",schemaProp:f},g);return t.mergeEvaluated(y,Hi.Name),g}function m(){var f;let g={},y=S(r),v=!0;for(let U=0;U<s.length;U++){let j=s[U];if(j?.$ref&&!(0,Y1.schemaHasRulesButRef)(j,o.self.RULES)){let bt=j.$ref;if(j=Pw.resolveRef.call(o.self,o.schemaEnv.root,o.baseId,bt),j instanceof Pw.SchemaEnv&&(j=j.schema),j===void 0)throw new J1.default(o.opts.uriResolver,o.baseId,bt)}let je=(f=j?.properties)===null||f===void 0?void 0:f[c];if(typeof je!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${c}"`);v=v&&(y||S(j)),z(je,U)}if(!v)throw new Error(`discriminator: "${c}" must be required`);return g;function S({required:U}){return Array.isArray(U)&&U.includes(c)}function z(U,j){if(U.const)R(U.const,j);else if(U.enum)for(let je of U.enum)R(je,j);else throw new Error(`discriminator: "properties/${c}" must have "const" or "enum"`)}function R(U,j){if(typeof U!="string"||U in g)throw new Error(`discriminator: "${c}" values must be unique strings`);g[U]=j}}}};gy.default=Q1});var Nw=N((qG,eM)=>{eM.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 by=N(($e,hy)=>{"use strict";Object.defineProperty($e,"__esModule",{value:!0});$e.MissingRefError=$e.ValidationError=$e.CodeGen=$e.Name=$e.nil=$e.stringify=$e.str=$e._=$e.KeywordCxt=$e.Ajv=void 0;var tM=R$(),nM=Tw(),rM=Aw(),Cw=Nw(),iM=["/properties"],Zd="http://json-schema.org/draft-07/schema",Ki=class extends tM.default{_addVocabularies(){super._addVocabularies(),nM.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(rM.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(Cw,iM):Cw;this.addMetaSchema(e,Zd,!1),this.refs["http://json-schema.org/schema"]=Zd}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Zd)?Zd:void 0)}};$e.Ajv=Ki;hy.exports=$e=Ki;hy.exports.Ajv=Ki;Object.defineProperty($e,"__esModule",{value:!0});$e.default=Ki;var oM=na();Object.defineProperty($e,"KeywordCxt",{enumerable:!0,get:function(){return oM.KeywordCxt}});var Gi=X();Object.defineProperty($e,"_",{enumerable:!0,get:function(){return Gi._}});Object.defineProperty($e,"str",{enumerable:!0,get:function(){return Gi.str}});Object.defineProperty($e,"stringify",{enumerable:!0,get:function(){return Gi.stringify}});Object.defineProperty($e,"nil",{enumerable:!0,get:function(){return Gi.nil}});Object.defineProperty($e,"Name",{enumerable:!0,get:function(){return Gi.Name}});Object.defineProperty($e,"CodeGen",{enumerable:!0,get:function(){return Gi.CodeGen}});var sM=_d();Object.defineProperty($e,"ValidationError",{enumerable:!0,get:function(){return sM.default}});var aM=ra();Object.defineProperty($e,"MissingRefError",{enumerable:!0,get:function(){return aM.default}})});var Bw=N(Xt=>{"use strict";Object.defineProperty(Xt,"__esModule",{value:!0});Xt.formatNames=Xt.fastFormats=Xt.fullFormats=void 0;function Yt(t,e){return{validate:t,compare:e}}Xt.fullFormats={date:Yt(Uw,ky),time:Yt(_y(!0),Sy),"date-time":Yt(zw(!0),Lw),"iso-time":Yt(_y(),Mw),"iso-date-time":Yt(zw(),Zw),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:mM,"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:vM,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:fM,int32:{type:"number",validate:bM},int64:{type:"number",validate:yM},float:{type:"number",validate:jw},double:{type:"number",validate:jw},password:!0,binary:!0};Xt.fastFormats={...Xt.fullFormats,date:Yt(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,ky),time:Yt(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,Sy),"date-time":Yt(/^\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,Lw),"iso-time":Yt(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,Mw),"iso-date-time":Yt(/^\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,Zw),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};Xt.formatNames=Object.keys(Xt.fullFormats);function cM(t){return t%4===0&&(t%100!==0||t%400===0)}var uM=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,lM=[0,31,28,31,30,31,30,31,31,30,31,30,31];function Uw(t){let e=uM.exec(t);if(!e)return!1;let n=+e[1],i=+e[2],r=+e[3];return i>=1&&i<=12&&r>=1&&r<=(i===2&&cM(n)?29:lM[i])}function ky(t,e){if(t&&e)return t>e?1:t<e?-1:0}var yy=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function _y(t){return function(n){let i=yy.exec(n);if(!i)return!1;let r=+i[1],o=+i[2],s=+i[3],c=i[4],u=i[5]==="-"?-1:1,l=+(i[6]||0),p=+(i[7]||0);if(l>23||p>59||t&&!c)return!1;if(r<=23&&o<=59&&s<60)return!0;let d=o-p*u,m=r-l*u-(d<0?1:0);return(m===23||m===-1)&&(d===59||d===-1)&&s<61}}function Sy(t,e){if(!(t&&e))return;let n=new Date("2020-01-01T"+t).valueOf(),i=new Date("2020-01-01T"+e).valueOf();if(n&&i)return n-i}function Mw(t,e){if(!(t&&e))return;let n=yy.exec(t),i=yy.exec(e);if(n&&i)return t=n[1]+n[2]+n[3],e=i[1]+i[2]+i[3],t>e?1:t<e?-1:0}var vy=/t|\s/i;function zw(t){let e=_y(t);return function(i){let r=i.split(vy);return r.length===2&&Uw(r[0])&&e(r[1])}}function Lw(t,e){if(!(t&&e))return;let n=new Date(t).valueOf(),i=new Date(e).valueOf();if(n&&i)return n-i}function Zw(t,e){if(!(t&&e))return;let[n,i]=t.split(vy),[r,o]=e.split(vy),s=ky(n,r);if(s!==void 0)return s||Sy(i,o)}var dM=/\/|:/,pM=/^(?:[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 mM(t){return dM.test(t)&&pM.test(t)}var Dw=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function fM(t){return Dw.lastIndex=0,Dw.test(t)}var gM=-(2**31),hM=2**31-1;function bM(t){return Number.isInteger(t)&&t<=hM&&t>=gM}function yM(t){return Number.isInteger(t)}function jw(){return!0}var _M=/[^\\]\\Z/;function vM(t){if(_M.test(t))return!1;try{return new RegExp(t),!0}catch{return!1}}});var Fw=N(Wi=>{"use strict";Object.defineProperty(Wi,"__esModule",{value:!0});Wi.formatLimitDefinition=void 0;var kM=by(),Mt=X(),Vn=Mt.operators,Bd={formatMaximum:{okStr:"<=",ok:Vn.LTE,fail:Vn.GT},formatMinimum:{okStr:">=",ok:Vn.GTE,fail:Vn.LT},formatExclusiveMaximum:{okStr:"<",ok:Vn.LT,fail:Vn.GTE},formatExclusiveMinimum:{okStr:">",ok:Vn.GT,fail:Vn.LTE}},SM={message:({keyword:t,schemaCode:e})=>(0,Mt.str)`should be ${Bd[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,Mt._)`{comparison: ${Bd[t].okStr}, limit: ${e}}`};Wi.formatLimitDefinition={keyword:Object.keys(Bd),type:"string",schemaType:"string",$data:!0,error:SM,code(t){let{gen:e,data:n,schemaCode:i,keyword:r,it:o}=t,{opts:s,self:c}=o;if(!s.validateFormats)return;let u=new kM.KeywordCxt(o,c.RULES.all.format.definition,"format");u.$data?l():p();function l(){let m=e.scopeValue("formats",{ref:c.formats,code:s.code.formats}),f=e.const("fmt",(0,Mt._)`${m}[${u.schemaCode}]`);t.fail$data((0,Mt.or)((0,Mt._)`typeof ${f} != "object"`,(0,Mt._)`${f} instanceof RegExp`,(0,Mt._)`typeof ${f}.compare != "function"`,d(f)))}function p(){let m=u.schema,f=c.formats[m];if(!f||f===!0)return;if(typeof f!="object"||f instanceof RegExp||typeof f.compare!="function")throw new Error(`"${r}": format "${m}" does not define "compare" function`);let g=e.scopeValue("formats",{key:m,ref:f,code:s.code.formats?(0,Mt._)`${s.code.formats}${(0,Mt.getProperty)(m)}`:void 0});t.fail$data(d(g))}function d(m){return(0,Mt._)`${m}.compare(${n}, ${i}) ${Bd[r].fail} 0`}},dependencies:["format"]};var xM=t=>(t.addKeyword(Wi.formatLimitDefinition),t);Wi.default=xM});var Kw=N((ba,Hw)=>{"use strict";Object.defineProperty(ba,"__esModule",{value:!0});var Ji=Bw(),IM=Fw(),xy=X(),Vw=new xy.Name("fullFormats"),$M=new xy.Name("fastFormats"),Iy=(t,e={keywords:!0})=>{if(Array.isArray(e))return qw(t,e,Ji.fullFormats,Vw),t;let[n,i]=e.mode==="fast"?[Ji.fastFormats,$M]:[Ji.fullFormats,Vw],r=e.formats||Ji.formatNames;return qw(t,r,n,i),e.keywords&&(0,IM.default)(t),t};Iy.get=(t,e="full")=>{let i=(e==="fast"?Ji.fastFormats:Ji.fullFormats)[t];if(!i)throw new Error(`Unknown format "${t}"`);return i};function qw(t,e,n,i){var r,o;(r=(o=t.opts.code).formats)!==null&&r!==void 0||(o.formats=(0,xy._)`require("ajv-formats/dist/formats").${i}`);for(let s of e)t.addFormat(s,n[s])}Hw.exports=ba=Iy;Object.defineProperty(ba,"__esModule",{value:!0});ba.default=Iy});import hx from"node:process";var a={};nn(a,{$brand:()=>zp,$input:()=>Ym,$output:()=>Jm,NEVER:()=>Cp,TimePrecision:()=>Qm,ZodAny:()=>fg,ZodArray:()=>yg,ZodBase64:()=>_l,ZodBase64URL:()=>vl,ZodBigInt:()=>li,ZodBigIntFormat:()=>xl,ZodBoolean:()=>ui,ZodCIDRv4:()=>bl,ZodCIDRv6:()=>yl,ZodCUID:()=>ll,ZodCUID2:()=>dl,ZodCatch:()=>Ug,ZodCodec:()=>bs,ZodCustom:()=>ys,ZodCustomStringFormat:()=>ai,ZodDate:()=>ps,ZodDefault:()=>Ag,ZodDiscriminatedUnion:()=>vg,ZodE164:()=>kl,ZodEmail:()=>al,ZodEmoji:()=>cl,ZodEnum:()=>oi,ZodError:()=>JP,ZodExactOptional:()=>Rg,ZodFile:()=>Eg,ZodFirstPartyTypeKind:()=>Yg,ZodFunction:()=>Gg,ZodGUID:()=>as,ZodIPv4:()=>gl,ZodIPv6:()=>hl,ZodISODate:()=>tl,ZodISODateTime:()=>el,ZodISODuration:()=>rl,ZodISOTime:()=>nl,ZodIntersection:()=>kg,ZodIssueCode:()=>XP,ZodJWT:()=>Sl,ZodKSUID:()=>fl,ZodLazy:()=>qg,ZodLiteral:()=>wg,ZodMAC:()=>lg,ZodMap:()=>Ig,ZodNaN:()=>Lg,ZodNanoID:()=>ul,ZodNever:()=>hg,ZodNonOptional:()=>wl,ZodNull:()=>mg,ZodNullable:()=>Pg,ZodNumber:()=>ci,ZodNumberFormat:()=>pr,ZodObject:()=>ms,ZodOptional:()=>pi,ZodPipe:()=>hs,ZodPrefault:()=>Cg,ZodPreprocess:()=>Zg,ZodPromise:()=>Kg,ZodReadonly:()=>Bg,ZodRealError:()=>ct,ZodRecord:()=>ii,ZodSet:()=>$g,ZodString:()=>si,ZodStringFormat:()=>he,ZodSuccess:()=>jg,ZodSymbol:()=>dg,ZodTemplateLiteral:()=>Vg,ZodTransform:()=>Tg,ZodTuple:()=>Sg,ZodType:()=>G,ZodULID:()=>pl,ZodURL:()=>ls,ZodUUID:()=>qt,ZodUndefined:()=>pg,ZodUnion:()=>fs,ZodUnknown:()=>gg,ZodVoid:()=>bg,ZodXID:()=>ml,ZodXor:()=>_g,_ZodString:()=>sl,_default:()=>Ng,_function:()=>BS,any:()=>xS,array:()=>Q,base64:()=>sS,base64url:()=>aS,bigint:()=>yS,boolean:()=>Oe,catch:()=>Mg,check:()=>FS,cidrv4:()=>iS,cidrv6:()=>oS,clone:()=>Ue,codec:()=>US,coerce:()=>Xg,config:()=>Re,core:()=>Ot,cuid:()=>Jk,cuid2:()=>Yk,custom:()=>El,date:()=>$S,decode:()=>rg,decodeAsync:()=>og,describe:()=>VS,discriminatedUnion:()=>gs,e164:()=>cS,email:()=>Lk,emoji:()=>Gk,encode:()=>ng,encodeAsync:()=>ig,endsWith:()=>Jr,enum:()=>Ze,exactOptional:()=>Og,file:()=>CS,flattenError:()=>Ro,float32:()=>fS,float64:()=>gS,formatError:()=>Oo,fromJSONSchema:()=>JS,function:()=>BS,getErrorMap:()=>eA,globalRegistry:()=>Me,gt:()=>Ft,gte:()=>Xe,guid:()=>Zk,hash:()=>mS,hex:()=>pS,hostname:()=>dS,httpUrl:()=>Kk,includes:()=>Gr,instanceof:()=>HS,int:()=>il,int32:()=>hS,int64:()=>_S,intersection:()=>di,invertCodec:()=>MS,ipv4:()=>tS,ipv6:()=>rS,iso:()=>Rn,json:()=>GS,jwt:()=>uS,keyof:()=>wS,ksuid:()=>eS,lazy:()=>Hg,length:()=>ur,literal:()=>L,locales:()=>Br,looseObject:()=>Le,looseRecord:()=>OS,lowercase:()=>Hr,lt:()=>Bt,lte:()=>mt,mac:()=>nS,map:()=>PS,maxLength:()=>cr,maxSize:()=>$n,meta:()=>qS,mime:()=>Yr,minLength:()=>on,minSize:()=>Vt,multipleOf:()=>In,nan:()=>jS,nanoid:()=>Wk,nativeEnum:()=>NS,negative:()=>Uu,never:()=>Il,nonnegative:()=>Lu,nonoptional:()=>Dg,nonpositive:()=>Mu,normalize:()=>Xr,null:()=>ds,nullable:()=>cs,nullish:()=>zS,number:()=>ce,object:()=>C,optional:()=>ke,overwrite:()=>Rt,parse:()=>Xf,parseAsync:()=>Qf,partialRecord:()=>RS,pipe:()=>ol,positive:()=>ju,prefault:()=>zg,preprocess:()=>_s,prettifyError:()=>Kp,promise:()=>ZS,property:()=>Zu,readonly:()=>Fg,record:()=>fe,refine:()=>Wg,regex:()=>qr,regexes:()=>at,registry:()=>gu,safeDecode:()=>ag,safeDecodeAsync:()=>ug,safeEncode:()=>sg,safeEncodeAsync:()=>cg,safeParse:()=>eg,safeParseAsync:()=>tg,set:()=>AS,setErrorMap:()=>QP,size:()=>ar,slugify:()=>ni,startsWith:()=>Wr,strictObject:()=>ES,string:()=>_,stringFormat:()=>lS,stringbool:()=>KS,success:()=>DS,superRefine:()=>Jg,symbol:()=>kS,templateLiteral:()=>LS,toJSONSchema:()=>dr,toLowerCase:()=>ei,toUpperCase:()=>ti,transform:()=>$l,treeifyError:()=>Hp,trim:()=>Qr,tuple:()=>xg,uint32:()=>bS,uint64:()=>vS,ulid:()=>Xk,undefined:()=>SS,union:()=>ye,unknown:()=>be,uppercase:()=>Kr,url:()=>Hk,util:()=>$,uuid:()=>Bk,uuidv4:()=>Fk,uuidv6:()=>Vk,uuidv7:()=>qk,void:()=>IS,xid:()=>Qk,xor:()=>TS});var Ot={};nn(Ot,{$ZodAny:()=>Cc,$ZodArray:()=>Mc,$ZodAsyncError:()=>Tt,$ZodBase64:()=>Ic,$ZodBase64URL:()=>$c,$ZodBigInt:()=>zo,$ZodBigIntFormat:()=>Oc,$ZodBoolean:()=>Ur,$ZodCIDRv4:()=>Sc,$ZodCIDRv6:()=>xc,$ZodCUID:()=>fc,$ZodCUID2:()=>gc,$ZodCatch:()=>ru,$ZodCheck:()=>ge,$ZodCheckBigIntFormat:()=>$m,$ZodCheckEndsWith:()=>jm,$ZodCheckGreaterThan:()=>rc,$ZodCheckIncludes:()=>zm,$ZodCheckLengthEquals:()=>Pm,$ZodCheckLessThan:()=>nc,$ZodCheckLowerCase:()=>Nm,$ZodCheckMaxLength:()=>Rm,$ZodCheckMaxSize:()=>wm,$ZodCheckMimeType:()=>Mm,$ZodCheckMinLength:()=>Om,$ZodCheckMinSize:()=>Em,$ZodCheckMultipleOf:()=>xm,$ZodCheckNumberFormat:()=>Im,$ZodCheckOverwrite:()=>Lm,$ZodCheckProperty:()=>Um,$ZodCheckRegex:()=>Am,$ZodCheckSizeEquals:()=>Tm,$ZodCheckStartsWith:()=>Dm,$ZodCheckStringFormat:()=>jr,$ZodCheckUpperCase:()=>Cm,$ZodCodec:()=>Lr,$ZodCustom:()=>lu,$ZodCustomStringFormat:()=>Tc,$ZodDate:()=>Uc,$ZodDefault:()=>Qc,$ZodDiscriminatedUnion:()=>Bc,$ZodE164:()=>wc,$ZodEmail:()=>lc,$ZodEmoji:()=>pc,$ZodEncodeError:()=>hn,$ZodEnum:()=>Kc,$ZodError:()=>To,$ZodExactOptional:()=>Yc,$ZodFile:()=>Wc,$ZodFunction:()=>au,$ZodGUID:()=>cc,$ZodIPv4:()=>_c,$ZodIPv6:()=>vc,$ZodISODate:()=>Vm,$ZodISODateTime:()=>Fm,$ZodISODuration:()=>Hm,$ZodISOTime:()=>qm,$ZodIntersection:()=>Fc,$ZodJWT:()=>Ec,$ZodKSUID:()=>yc,$ZodLazy:()=>uu,$ZodLiteral:()=>Gc,$ZodMAC:()=>kc,$ZodMap:()=>qc,$ZodNaN:()=>iu,$ZodNanoID:()=>mc,$ZodNever:()=>Dc,$ZodNonOptional:()=>tu,$ZodNull:()=>Nc,$ZodNullable:()=>Xc,$ZodNumber:()=>Co,$ZodNumberFormat:()=>Rc,$ZodObject:()=>Lc,$ZodObjectJIT:()=>Gm,$ZodOptional:()=>jo,$ZodPipe:()=>Uo,$ZodPrefault:()=>eu,$ZodPreprocess:()=>Wm,$ZodPromise:()=>cu,$ZodReadonly:()=>ou,$ZodRealError:()=>st,$ZodRecord:()=>Vc,$ZodRegistry:()=>fu,$ZodSet:()=>Hc,$ZodString:()=>xn,$ZodStringFormat:()=>me,$ZodSuccess:()=>nu,$ZodSymbol:()=>Pc,$ZodTemplateLiteral:()=>su,$ZodTransform:()=>Jc,$ZodTuple:()=>Do,$ZodType:()=>H,$ZodULID:()=>hc,$ZodURL:()=>dc,$ZodUUID:()=>uc,$ZodUndefined:()=>Ac,$ZodUnion:()=>Mr,$ZodUnknown:()=>zc,$ZodVoid:()=>jc,$ZodXID:()=>bc,$ZodXor:()=>Zc,$brand:()=>zp,$constructor:()=>h,$input:()=>Ym,$output:()=>Jm,Doc:()=>No,JSONSchema:()=>jk,JSONSchemaGenerator:()=>Xu,NEVER:()=>Cp,TimePrecision:()=>Qm,_any:()=>Pu,_array:()=>uf,_base64:()=>ns,_base64url:()=>rs,_bigint:()=>$u,_boolean:()=>Iu,_catch:()=>BP,_check:()=>Dk,_cidrv4:()=>es,_cidrv6:()=>ts,_coercedBigint:()=>af,_coercedBoolean:()=>sf,_coercedDate:()=>cf,_coercedNumber:()=>of,_coercedString:()=>Xm,_cuid:()=>Ko,_cuid2:()=>Go,_custom:()=>Fu,_date:()=>zu,_decode:()=>Ka,_decodeAsync:()=>Wa,_default:()=>MP,_discriminatedUnion:()=>EP,_e164:()=>is,_email:()=>Lo,_emoji:()=>qo,_encode:()=>Ha,_encodeAsync:()=>Ga,_endsWith:()=>Jr,_enum:()=>NP,_file:()=>Bu,_float32:()=>vu,_float64:()=>ku,_gt:()=>Ft,_gte:()=>Xe,_guid:()=>Fr,_includes:()=>Gr,_int:()=>_u,_int32:()=>Su,_int64:()=>wu,_intersection:()=>TP,_ipv4:()=>Xo,_ipv6:()=>Qo,_isoDate:()=>tf,_isoDateTime:()=>ef,_isoDuration:()=>rf,_isoTime:()=>nf,_jwt:()=>os,_ksuid:()=>Yo,_lazy:()=>HP,_length:()=>ur,_literal:()=>zP,_lowercase:()=>Hr,_lt:()=>Bt,_lte:()=>mt,_mac:()=>bu,_map:()=>PP,_max:()=>mt,_maxLength:()=>cr,_maxSize:()=>$n,_mime:()=>Yr,_min:()=>Xe,_minLength:()=>on,_minSize:()=>Vt,_multipleOf:()=>In,_nan:()=>Du,_nanoid:()=>Ho,_nativeEnum:()=>CP,_negative:()=>Uu,_never:()=>Nu,_nonnegative:()=>Lu,_nonoptional:()=>LP,_nonpositive:()=>Mu,_normalize:()=>Xr,_null:()=>Ou,_nullable:()=>UP,_number:()=>yu,_optional:()=>jP,_overwrite:()=>Rt,_parse:()=>Nr,_parseAsync:()=>Cr,_pipe:()=>FP,_positive:()=>ju,_promise:()=>KP,_property:()=>Zu,_readonly:()=>VP,_record:()=>OP,_refine:()=>Vu,_regex:()=>qr,_safeDecode:()=>Ya,_safeDecodeAsync:()=>Qa,_safeEncode:()=>Ja,_safeEncodeAsync:()=>Xa,_safeParse:()=>zr,_safeParseAsync:()=>Dr,_set:()=>AP,_size:()=>ar,_slugify:()=>ni,_startsWith:()=>Wr,_string:()=>hu,_stringFormat:()=>lr,_stringbool:()=>Gu,_success:()=>ZP,_superRefine:()=>qu,_symbol:()=>Tu,_templateLiteral:()=>qP,_toLowerCase:()=>ei,_toUpperCase:()=>ti,_transform:()=>DP,_trim:()=>Qr,_tuple:()=>RP,_uint32:()=>xu,_uint64:()=>Eu,_ulid:()=>Wo,_undefined:()=>Ru,_union:()=>$P,_unknown:()=>Au,_uppercase:()=>Kr,_url:()=>Vr,_uuid:()=>Zo,_uuidv4:()=>Bo,_uuidv6:()=>Fo,_uuidv7:()=>Vo,_void:()=>Cu,_xid:()=>Jo,_xor:()=>wP,clone:()=>Ue,config:()=>Re,createStandardJSONSchemaMethod:()=>ri,createToJSONSchemaMethod:()=>lf,decode:()=>ov,decodeAsync:()=>av,describe:()=>Hu,encode:()=>iv,encodeAsync:()=>sv,extractDefs:()=>En,finalize:()=>Tn,flattenError:()=>Ro,formatError:()=>Oo,globalConfig:()=>nr,globalRegistry:()=>Me,initializeContext:()=>wn,isValidBase64:()=>Km,isValidBase64URL:()=>Av,isValidJWT:()=>Nv,locales:()=>Br,meta:()=>Ku,parse:()=>ir,parseAsync:()=>or,prettifyError:()=>Kp,process:()=>pe,regexes:()=>at,registry:()=>gu,safeDecode:()=>uv,safeDecodeAsync:()=>dv,safeEncode:()=>cv,safeEncodeAsync:()=>lv,safeParse:()=>kn,safeParseAsync:()=>Sn,toDotPath:()=>rv,toJSONSchema:()=>dr,treeifyError:()=>Hp,util:()=>$,version:()=>Zm});var H_,Cp=Object.freeze({status:"aborted"});function h(t,e,n){function i(c,u){if(c._zod||Object.defineProperty(c,"_zod",{value:{def:u,constr:s,traits:new Set},enumerable:!1}),c._zod.traits.has(t))return;c._zod.traits.add(t),e(c,u);let l=s.prototype,p=Object.keys(l);for(let d=0;d<p.length;d++){let m=p[d];m in c||(c[m]=l[m].bind(c))}}let r=n?.Parent??Object;class o extends r{}Object.defineProperty(o,"name",{value:t});function s(c){var u;let l=n?.Parent?new o:this;i(l,c),(u=l._zod).deferred??(u.deferred=[]);for(let p of l._zod.deferred)p();return l}return Object.defineProperty(s,"init",{value:i}),Object.defineProperty(s,Symbol.hasInstance,{value:c=>n?.Parent&&c instanceof n.Parent?!0:c?._zod?.traits?.has(t)}),Object.defineProperty(s,"name",{value:t}),s}var zp=Symbol("zod_brand"),Tt=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},hn=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}};(H_=globalThis).__zod_globalConfig??(H_.__zod_globalConfig={});var nr=globalThis.__zod_globalConfig;function Re(t){return t&&Object.assign(nr,t),nr}var $={};nn($,{BIGINT_FORMAT_RANGES:()=>Vp,Class:()=>jp,NUMBER_FORMAT_RANGES:()=>Fp,aborted:()=>vn,allowsEval:()=>Lp,assert:()=>UO,assertEqual:()=>CO,assertIs:()=>DO,assertNever:()=>jO,assertNotEqual:()=>zO,assignProp:()=>yn,base64ToUint8Array:()=>ev,base64urlToUint8Array:()=>WO,cached:()=>Pr,captureStackTrace:()=>Va,cleanEnum:()=>GO,cleanRegex:()=>Io,clone:()=>Ue,cloneDef:()=>LO,createTransparentProxy:()=>HO,defineLazy:()=>J,esc:()=>Fa,escapeRegex:()=>yt,explicitlyAborted:()=>qp,extend:()=>J_,finalizeIssue:()=>Ye,floatSafeRemainder:()=>Up,getElementAtPath:()=>ZO,getEnumValues:()=>xo,getLengthableOrigin:()=>Eo,getParsedType:()=>qO,getSizableOrigin:()=>wo,hexToUint8Array:()=>YO,isObject:()=>rr,isPlainObject:()=>_n,issue:()=>Ar,joinValues:()=>b,jsonStringifyReplacer:()=>Or,merge:()=>KO,mergeDefs:()=>rn,normalizeParams:()=>E,nullish:()=>bn,numKeys:()=>VO,objectClone:()=>MO,omit:()=>W_,optionalKeys:()=>Bp,parsedType:()=>I,partial:()=>X_,pick:()=>G_,prefixIssues:()=>ot,primitiveTypes:()=>Zp,promiseAllObject:()=>BO,propertyKeyTypes:()=>$o,randomString:()=>FO,required:()=>Q_,safeExtend:()=>Y_,shallowClone:()=>qa,slugify:()=>Mp,stringifyPrimitive:()=>x,uint8ArrayToBase64:()=>tv,uint8ArrayToBase64url:()=>JO,uint8ArrayToHex:()=>XO,unwrapMessage:()=>So});function CO(t){return t}function zO(t){return t}function DO(t){}function jO(t){throw new Error("Unexpected value in exhaustive check")}function UO(t){}function xo(t){let e=Object.values(t).filter(i=>typeof i=="number");return Object.entries(t).filter(([i,r])=>e.indexOf(+i)===-1).map(([i,r])=>r)}function b(t,e="|"){return t.map(n=>x(n)).join(e)}function Or(t,e){return typeof e=="bigint"?e.toString():e}function Pr(t){return{get value(){{let n=t();return Object.defineProperty(this,"value",{value:n}),n}throw new Error("cached value already set")}}}function bn(t){return t==null}function Io(t){let e=t.startsWith("^")?1:0,n=t.endsWith("$")?t.length-1:t.length;return t.slice(e,n)}function Up(t,e){let n=t/e,i=Math.round(n),r=Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-i)<r?0:n-i}var K_=Symbol("evaluating");function J(t,e,n){let i;Object.defineProperty(t,e,{get(){if(i!==K_)return i===void 0&&(i=K_,i=n()),i},set(r){Object.defineProperty(t,e,{value:r})},configurable:!0})}function MO(t){return Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))}function yn(t,e,n){Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0})}function rn(...t){let e={};for(let n of t){let i=Object.getOwnPropertyDescriptors(n);Object.assign(e,i)}return Object.defineProperties({},e)}function LO(t){return rn(t._zod.def)}function ZO(t,e){return e?e.reduce((n,i)=>n?.[i],t):t}function BO(t){let e=Object.keys(t),n=e.map(i=>t[i]);return Promise.all(n).then(i=>{let r={};for(let o=0;o<e.length;o++)r[e[o]]=i[o];return r})}function FO(t=10){let e="abcdefghijklmnopqrstuvwxyz",n="";for(let i=0;i<t;i++)n+=e[Math.floor(Math.random()*e.length)];return n}function Fa(t){return JSON.stringify(t)}function Mp(t){return t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Va="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function rr(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}var Lp=Pr(()=>{if(nr.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});function _n(t){if(rr(t)===!1)return!1;let e=t.constructor;if(e===void 0||typeof e!="function")return!0;let n=e.prototype;return!(rr(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function qa(t){return _n(t)?{...t}:Array.isArray(t)?[...t]:t instanceof Map?new Map(t):t instanceof Set?new Set(t):t}function VO(t){let e=0;for(let n in t)Object.prototype.hasOwnProperty.call(t,n)&&e++;return e}var qO=t=>{let e=typeof t;switch(e){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(t)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(t)?"array":t===null?"null":t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?"promise":typeof Map<"u"&&t instanceof Map?"map":typeof Set<"u"&&t instanceof Set?"set":typeof Date<"u"&&t instanceof Date?"date":typeof File<"u"&&t instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${e}`)}},$o=new Set(["string","number","symbol"]),Zp=new Set(["string","number","bigint","boolean","symbol","undefined"]);function yt(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ue(t,e,n){let i=new t._zod.constr(e??t._zod.def);return(!e||n?.parent)&&(i._zod.parent=t),i}function E(t){let e=t;if(!e)return{};if(typeof e=="string")return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}function HO(t){let e;return new Proxy({},{get(n,i,r){return e??(e=t()),Reflect.get(e,i,r)},set(n,i,r,o){return e??(e=t()),Reflect.set(e,i,r,o)},has(n,i){return e??(e=t()),Reflect.has(e,i)},deleteProperty(n,i){return e??(e=t()),Reflect.deleteProperty(e,i)},ownKeys(n){return e??(e=t()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(n,i){return e??(e=t()),Reflect.getOwnPropertyDescriptor(e,i)},defineProperty(n,i,r){return e??(e=t()),Reflect.defineProperty(e,i,r)}})}function x(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}function Bp(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}var Fp={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Vp={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function G_(t,e){let n=t._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let o=rn(t._zod.def,{get shape(){let s={};for(let c in e){if(!(c in n.shape))throw new Error(`Unrecognized key: "${c}"`);e[c]&&(s[c]=n.shape[c])}return yn(this,"shape",s),s},checks:[]});return Ue(t,o)}function W_(t,e){let n=t._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let o=rn(t._zod.def,{get shape(){let s={...t._zod.def.shape};for(let c in e){if(!(c in n.shape))throw new Error(`Unrecognized key: "${c}"`);e[c]&&delete s[c]}return yn(this,"shape",s),s},checks:[]});return Ue(t,o)}function J_(t,e){if(!_n(e))throw new Error("Invalid input to extend: expected a plain object");let n=t._zod.def.checks;if(n&&n.length>0){let o=t._zod.def.shape;for(let s in e)if(Object.getOwnPropertyDescriptor(o,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let r=rn(t._zod.def,{get shape(){let o={...t._zod.def.shape,...e};return yn(this,"shape",o),o}});return Ue(t,r)}function Y_(t,e){if(!_n(e))throw new Error("Invalid input to safeExtend: expected a plain object");let n=rn(t._zod.def,{get shape(){let i={...t._zod.def.shape,...e};return yn(this,"shape",i),i}});return Ue(t,n)}function KO(t,e){if(t._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let n=rn(t._zod.def,{get shape(){let i={...t._zod.def.shape,...e._zod.def.shape};return yn(this,"shape",i),i},get catchall(){return e._zod.def.catchall},checks:e._zod.def.checks??[]});return Ue(t,n)}function X_(t,e,n){let r=e._zod.def.checks;if(r&&r.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let s=rn(e._zod.def,{get shape(){let c=e._zod.def.shape,u={...c};if(n)for(let l in n){if(!(l in c))throw new Error(`Unrecognized key: "${l}"`);n[l]&&(u[l]=t?new t({type:"optional",innerType:c[l]}):c[l])}else for(let l in c)u[l]=t?new t({type:"optional",innerType:c[l]}):c[l];return yn(this,"shape",u),u},checks:[]});return Ue(e,s)}function Q_(t,e,n){let i=rn(e._zod.def,{get shape(){let r=e._zod.def.shape,o={...r};if(n)for(let s in n){if(!(s in o))throw new Error(`Unrecognized key: "${s}"`);n[s]&&(o[s]=new t({type:"nonoptional",innerType:r[s]}))}else for(let s in r)o[s]=new t({type:"nonoptional",innerType:r[s]});return yn(this,"shape",o),o}});return Ue(e,i)}function vn(t,e=0){if(t.aborted===!0)return!0;for(let n=e;n<t.issues.length;n++)if(t.issues[n]?.continue!==!0)return!0;return!1}function qp(t,e=0){if(t.aborted===!0)return!0;for(let n=e;n<t.issues.length;n++)if(t.issues[n]?.continue===!1)return!0;return!1}function ot(t,e){return e.map(n=>{var i;return(i=n).path??(i.path=[]),n.path.unshift(t),n})}function So(t){return typeof t=="string"?t:t?.message}function Ye(t,e,n){let i=t.message?t.message:So(t.inst?._zod.def?.error?.(t))??So(e?.error?.(t))??So(n.customError?.(t))??So(n.localeError?.(t))??"Invalid input",{inst:r,continue:o,input:s,...c}=t;return c.path??(c.path=[]),c.message=i,e?.reportInput&&(c.input=s),c}function wo(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}function Eo(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function I(t){let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"nan":"number";case"object":{if(t===null)return"null";if(Array.isArray(t))return"array";let n=t;if(n&&Object.getPrototypeOf(n)!==Object.prototype&&"constructor"in n&&n.constructor)return n.constructor.name}}return e}function Ar(...t){let[e,n,i]=t;return typeof e=="string"?{message:e,code:"custom",input:n,inst:i}:{...e}}function GO(t){return Object.entries(t).filter(([e,n])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function ev(t){let e=atob(t),n=new Uint8Array(e.length);for(let i=0;i<e.length;i++)n[i]=e.charCodeAt(i);return n}function tv(t){let e="";for(let n=0;n<t.length;n++)e+=String.fromCharCode(t[n]);return btoa(e)}function WO(t){let e=t.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-e.length%4)%4);return ev(e+n)}function JO(t){return tv(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function YO(t){let e=t.replace(/^0x/,"");if(e.length%2!==0)throw new Error("Invalid hex string length");let n=new Uint8Array(e.length/2);for(let i=0;i<e.length;i+=2)n[i/2]=Number.parseInt(e.slice(i,i+2),16);return n}function XO(t){return Array.from(t).map(e=>e.toString(16).padStart(2,"0")).join("")}var jp=class{constructor(...e){}};var nv=(t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:e,enumerable:!1}),t.message=JSON.stringify(e,Or,2),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:!1})},To=h("$ZodError",nv),st=h("$ZodError",nv,{Parent:Error});function Ro(t,e=n=>n.message){let n={},i=[];for(let r of t.issues)r.path.length>0?(n[r.path[0]]=n[r.path[0]]||[],n[r.path[0]].push(e(r))):i.push(e(r));return{formErrors:i,fieldErrors:n}}function Oo(t,e=n=>n.message){let n={_errors:[]},i=(r,o=[])=>{for(let s of r.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(c=>i({issues:c},[...o,...s.path]));else if(s.code==="invalid_key")i({issues:s.issues},[...o,...s.path]);else if(s.code==="invalid_element")i({issues:s.issues},[...o,...s.path]);else{let c=[...o,...s.path];if(c.length===0)n._errors.push(e(s));else{let u=n,l=0;for(;l<c.length;){let p=c[l];l===c.length-1?(u[p]=u[p]||{_errors:[]},u[p]._errors.push(e(s))):u[p]=u[p]||{_errors:[]},u=u[p],l++}}}};return i(t),n}function Hp(t,e=n=>n.message){let n={errors:[]},i=(r,o=[])=>{var s,c;for(let u of r.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map(l=>i({issues:l},[...o,...u.path]));else if(u.code==="invalid_key")i({issues:u.issues},[...o,...u.path]);else if(u.code==="invalid_element")i({issues:u.issues},[...o,...u.path]);else{let l=[...o,...u.path];if(l.length===0){n.errors.push(e(u));continue}let p=n,d=0;for(;d<l.length;){let m=l[d],f=d===l.length-1;typeof m=="string"?(p.properties??(p.properties={}),(s=p.properties)[m]??(s[m]={errors:[]}),p=p.properties[m]):(p.items??(p.items=[]),(c=p.items)[m]??(c[m]={errors:[]}),p=p.items[m]),f&&p.errors.push(e(u)),d++}}};return i(t),n}function rv(t){let e=[],n=t.map(i=>typeof i=="object"?i.key:i);for(let i of n)typeof i=="number"?e.push(`[${i}]`):typeof i=="symbol"?e.push(`[${JSON.stringify(String(i))}]`):/[^\w$]/.test(i)?e.push(`[${JSON.stringify(i)}]`):(e.length&&e.push("."),e.push(i));return e.join("")}function Kp(t){let e=[],n=[...t.issues].sort((i,r)=>(i.path??[]).length-(r.path??[]).length);for(let i of n)e.push(`\u2716 ${i.message}`),i.path?.length&&e.push(` \u2192 at ${rv(i.path)}`);return e.join(`
|
|
11
|
+
`)}var Nr=t=>(e,n,i,r)=>{let o=i?{...i,async:!1}:{async:!1},s=e._zod.run({value:n,issues:[]},o);if(s instanceof Promise)throw new Tt;if(s.issues.length){let c=new(r?.Err??t)(s.issues.map(u=>Ye(u,o,Re())));throw Va(c,r?.callee),c}return s.value},ir=Nr(st),Cr=t=>async(e,n,i,r)=>{let o=i?{...i,async:!0}:{async:!0},s=e._zod.run({value:n,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let c=new(r?.Err??t)(s.issues.map(u=>Ye(u,o,Re())));throw Va(c,r?.callee),c}return s.value},or=Cr(st),zr=t=>(e,n,i)=>{let r=i?{...i,async:!1}:{async:!1},o=e._zod.run({value:n,issues:[]},r);if(o instanceof Promise)throw new Tt;return o.issues.length?{success:!1,error:new(t??To)(o.issues.map(s=>Ye(s,r,Re())))}:{success:!0,data:o.value}},kn=zr(st),Dr=t=>async(e,n,i)=>{let r=i?{...i,async:!0}:{async:!0},o=e._zod.run({value:n,issues:[]},r);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new t(o.issues.map(s=>Ye(s,r,Re())))}:{success:!0,data:o.value}},Sn=Dr(st),Ha=t=>(e,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return Nr(t)(e,n,r)},iv=Ha(st),Ka=t=>(e,n,i)=>Nr(t)(e,n,i),ov=Ka(st),Ga=t=>async(e,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return Cr(t)(e,n,r)},sv=Ga(st),Wa=t=>async(e,n,i)=>Cr(t)(e,n,i),av=Wa(st),Ja=t=>(e,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return zr(t)(e,n,r)},cv=Ja(st),Ya=t=>(e,n,i)=>zr(t)(e,n,i),uv=Ya(st),Xa=t=>async(e,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return Dr(t)(e,n,r)},lv=Xa(st),Qa=t=>async(e,n,i)=>Dr(t)(e,n,i),dv=Qa(st);var at={};nn(at,{base64:()=>um,base64url:()=>ec,bigint:()=>hm,boolean:()=>ym,browserEmail:()=>a0,cidrv4:()=>am,cidrv6:()=>cm,cuid:()=>Gp,cuid2:()=>Wp,date:()=>pm,datetime:()=>fm,domain:()=>l0,duration:()=>em,e164:()=>dm,email:()=>nm,emoji:()=>rm,extendedDuration:()=>e0,guid:()=>tm,hex:()=>d0,hostname:()=>u0,html5Email:()=>i0,httpProtocol:()=>lm,idnEmail:()=>s0,integer:()=>bm,ipv4:()=>im,ipv6:()=>om,ksuid:()=>Xp,lowercase:()=>km,mac:()=>sm,md5_base64:()=>m0,md5_base64url:()=>f0,md5_hex:()=>p0,nanoid:()=>Qp,null:()=>_m,number:()=>tc,rfc5322Email:()=>o0,sha1_base64:()=>h0,sha1_base64url:()=>b0,sha1_hex:()=>g0,sha256_base64:()=>_0,sha256_base64url:()=>v0,sha256_hex:()=>y0,sha384_base64:()=>S0,sha384_base64url:()=>x0,sha384_hex:()=>k0,sha512_base64:()=>$0,sha512_base64url:()=>w0,sha512_hex:()=>I0,string:()=>gm,time:()=>mm,ulid:()=>Jp,undefined:()=>vm,unicodeEmail:()=>pv,uppercase:()=>Sm,uuid:()=>sr,uuid4:()=>t0,uuid6:()=>n0,uuid7:()=>r0,xid:()=>Yp});var Gp=/^[cC][0-9a-z]{6,}$/,Wp=/^[0-9a-z]+$/,Jp=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Yp=/^[0-9a-vA-V]{20}$/,Xp=/^[A-Za-z0-9]{27}$/,Qp=/^[a-zA-Z0-9_-]{21}$/,em=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,e0=/^[-+]?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)?)??$/,tm=/^([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})$/,sr=t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,t0=sr(4),n0=sr(6),r0=sr(7),nm=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,i0=/^[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])?)*$/,o0=/^(([^<>()\[\]\\.,;:\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,}))$/,pv=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,s0=pv,a0=/^[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])?)*$/,c0="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function rm(){return new RegExp(c0,"u")}var im=/^(?:(?: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])$/,om=/^(([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}|:))$/,sm=t=>{let e=yt(t??":");return new RegExp(`^(?:[0-9A-F]{2}${e}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${e}){5}[0-9a-f]{2}$`)},am=/^((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])$/,cm=/^(([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])$/,um=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ec=/^[A-Za-z0-9_-]*$/,u0=/^(?=.{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])?)*\.?$/,l0=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,lm=/^https?$/,dm=/^\+[1-9]\d{6,14}$/,mv="(?:(?:\\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])))",pm=new RegExp(`^${mv}$`);function fv(t){let e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof t.precision=="number"?t.precision===-1?`${e}`:t.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${t.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function mm(t){return new RegExp(`^${fv(t)}$`)}function fm(t){let e=fv({precision:t.precision}),n=["Z"];t.local&&n.push(""),t.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let i=`${e}(?:${n.join("|")})`;return new RegExp(`^${mv}T(?:${i})$`)}var gm=t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},hm=/^-?\d+n?$/,bm=/^-?\d+$/,tc=/^-?\d+(?:\.\d+)?$/,ym=/^(?:true|false)$/i,_m=/^null$/i;var vm=/^undefined$/i;var km=/^[^A-Z]*$/,Sm=/^[^a-z]*$/,d0=/^[0-9a-fA-F]*$/;function Po(t,e){return new RegExp(`^[A-Za-z0-9+/]{${t}}${e}$`)}function Ao(t){return new RegExp(`^[A-Za-z0-9_-]{${t}}$`)}var p0=/^[0-9a-fA-F]{32}$/,m0=Po(22,"=="),f0=Ao(22),g0=/^[0-9a-fA-F]{40}$/,h0=Po(27,"="),b0=Ao(27),y0=/^[0-9a-fA-F]{64}$/,_0=Po(43,"="),v0=Ao(43),k0=/^[0-9a-fA-F]{96}$/,S0=Po(64,""),x0=Ao(64),I0=/^[0-9a-fA-F]{128}$/,$0=Po(86,"=="),w0=Ao(86);var ge=h("$ZodCheck",(t,e)=>{var n;t._zod??(t._zod={}),t._zod.def=e,(n=t._zod).onattach??(n.onattach=[])}),hv={number:"number",bigint:"bigint",object:"date"},nc=h("$ZodCheckLessThan",(t,e)=>{ge.init(t,e);let n=hv[typeof e.value];t._zod.onattach.push(i=>{let r=i._zod.bag,o=(e.inclusive?r.maximum:r.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value<o&&(e.inclusive?r.maximum=e.value:r.exclusiveMaximum=e.value)}),t._zod.check=i=>{(e.inclusive?i.value<=e.value:i.value<e.value)||i.issues.push({origin:n,code:"too_big",maximum:typeof e.value=="object"?e.value.getTime():e.value,input:i.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),rc=h("$ZodCheckGreaterThan",(t,e)=>{ge.init(t,e);let n=hv[typeof e.value];t._zod.onattach.push(i=>{let r=i._zod.bag,o=(e.inclusive?r.minimum:r.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>o&&(e.inclusive?r.minimum=e.value:r.exclusiveMinimum=e.value)}),t._zod.check=i=>{(e.inclusive?i.value>=e.value:i.value>e.value)||i.issues.push({origin:n,code:"too_small",minimum:typeof e.value=="object"?e.value.getTime():e.value,input:i.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),xm=h("$ZodCheckMultipleOf",(t,e)=>{ge.init(t,e),t._zod.onattach.push(n=>{var i;(i=n._zod.bag).multipleOf??(i.multipleOf=e.value)}),t._zod.check=n=>{if(typeof n.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%e.value===BigInt(0):Up(n.value,e.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:e.value,input:n.value,inst:t,continue:!e.abort})}}),Im=h("$ZodCheckNumberFormat",(t,e)=>{ge.init(t,e),e.format=e.format||"float64";let n=e.format?.includes("int"),i=n?"int":"number",[r,o]=Fp[e.format];t._zod.onattach.push(s=>{let c=s._zod.bag;c.format=e.format,c.minimum=r,c.maximum=o,n&&(c.pattern=bm)}),t._zod.check=s=>{let c=s.value;if(n){if(!Number.isInteger(c)){s.issues.push({expected:i,format:e.format,code:"invalid_type",continue:!1,input:c,inst:t});return}if(!Number.isSafeInteger(c)){c>0?s.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:i,inclusive:!0,continue:!e.abort}):s.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:i,inclusive:!0,continue:!e.abort});return}}c<r&&s.issues.push({origin:"number",input:c,code:"too_small",minimum:r,inclusive:!0,inst:t,continue:!e.abort}),c>o&&s.issues.push({origin:"number",input:c,code:"too_big",maximum:o,inclusive:!0,inst:t,continue:!e.abort})}}),$m=h("$ZodCheckBigIntFormat",(t,e)=>{ge.init(t,e);let[n,i]=Vp[e.format];t._zod.onattach.push(r=>{let o=r._zod.bag;o.format=e.format,o.minimum=n,o.maximum=i}),t._zod.check=r=>{let o=r.value;o<n&&r.issues.push({origin:"bigint",input:o,code:"too_small",minimum:n,inclusive:!0,inst:t,continue:!e.abort}),o>i&&r.issues.push({origin:"bigint",input:o,code:"too_big",maximum:i,inclusive:!0,inst:t,continue:!e.abort})}}),wm=h("$ZodCheckMaxSize",(t,e)=>{var n;ge.init(t,e),(n=t._zod.def).when??(n.when=i=>{let r=i.value;return!bn(r)&&r.size!==void 0}),t._zod.onattach.push(i=>{let r=i._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<r&&(i._zod.bag.maximum=e.maximum)}),t._zod.check=i=>{let r=i.value;r.size<=e.maximum||i.issues.push({origin:wo(r),code:"too_big",maximum:e.maximum,inclusive:!0,input:r,inst:t,continue:!e.abort})}}),Em=h("$ZodCheckMinSize",(t,e)=>{var n;ge.init(t,e),(n=t._zod.def).when??(n.when=i=>{let r=i.value;return!bn(r)&&r.size!==void 0}),t._zod.onattach.push(i=>{let r=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>r&&(i._zod.bag.minimum=e.minimum)}),t._zod.check=i=>{let r=i.value;r.size>=e.minimum||i.issues.push({origin:wo(r),code:"too_small",minimum:e.minimum,inclusive:!0,input:r,inst:t,continue:!e.abort})}}),Tm=h("$ZodCheckSizeEquals",(t,e)=>{var n;ge.init(t,e),(n=t._zod.def).when??(n.when=i=>{let r=i.value;return!bn(r)&&r.size!==void 0}),t._zod.onattach.push(i=>{let r=i._zod.bag;r.minimum=e.size,r.maximum=e.size,r.size=e.size}),t._zod.check=i=>{let r=i.value,o=r.size;if(o===e.size)return;let s=o>e.size;i.issues.push({origin:wo(r),...s?{code:"too_big",maximum:e.size}:{code:"too_small",minimum:e.size},inclusive:!0,exact:!0,input:i.value,inst:t,continue:!e.abort})}}),Rm=h("$ZodCheckMaxLength",(t,e)=>{var n;ge.init(t,e),(n=t._zod.def).when??(n.when=i=>{let r=i.value;return!bn(r)&&r.length!==void 0}),t._zod.onattach.push(i=>{let r=i._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<r&&(i._zod.bag.maximum=e.maximum)}),t._zod.check=i=>{let r=i.value;if(r.length<=e.maximum)return;let s=Eo(r);i.issues.push({origin:s,code:"too_big",maximum:e.maximum,inclusive:!0,input:r,inst:t,continue:!e.abort})}}),Om=h("$ZodCheckMinLength",(t,e)=>{var n;ge.init(t,e),(n=t._zod.def).when??(n.when=i=>{let r=i.value;return!bn(r)&&r.length!==void 0}),t._zod.onattach.push(i=>{let r=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>r&&(i._zod.bag.minimum=e.minimum)}),t._zod.check=i=>{let r=i.value;if(r.length>=e.minimum)return;let s=Eo(r);i.issues.push({origin:s,code:"too_small",minimum:e.minimum,inclusive:!0,input:r,inst:t,continue:!e.abort})}}),Pm=h("$ZodCheckLengthEquals",(t,e)=>{var n;ge.init(t,e),(n=t._zod.def).when??(n.when=i=>{let r=i.value;return!bn(r)&&r.length!==void 0}),t._zod.onattach.push(i=>{let r=i._zod.bag;r.minimum=e.length,r.maximum=e.length,r.length=e.length}),t._zod.check=i=>{let r=i.value,o=r.length;if(o===e.length)return;let s=Eo(r),c=o>e.length;i.issues.push({origin:s,...c?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:i.value,inst:t,continue:!e.abort})}}),jr=h("$ZodCheckStringFormat",(t,e)=>{var n,i;ge.init(t,e),t._zod.onattach.push(r=>{let o=r._zod.bag;o.format=e.format,e.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(e.pattern))}),e.pattern?(n=t._zod).check??(n.check=r=>{e.pattern.lastIndex=0,!e.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:e.format,input:r.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(i=t._zod).check??(i.check=()=>{})}),Am=h("$ZodCheckRegex",(t,e)=>{jr.init(t,e),t._zod.check=n=>{e.pattern.lastIndex=0,!e.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}}),Nm=h("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=km),jr.init(t,e)}),Cm=h("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=Sm),jr.init(t,e)}),zm=h("$ZodCheckIncludes",(t,e)=>{ge.init(t,e);let n=yt(e.includes),i=new RegExp(typeof e.position=="number"?`^.{${e.position}}${n}`:n);e.pattern=i,t._zod.onattach.push(r=>{let o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(i)}),t._zod.check=r=>{r.value.includes(e.includes,e.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:r.value,inst:t,continue:!e.abort})}}),Dm=h("$ZodCheckStartsWith",(t,e)=>{ge.init(t,e);let n=new RegExp(`^${yt(e.prefix)}.*`);e.pattern??(e.pattern=n),t._zod.onattach.push(i=>{let r=i._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(n)}),t._zod.check=i=>{i.value.startsWith(e.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:i.value,inst:t,continue:!e.abort})}}),jm=h("$ZodCheckEndsWith",(t,e)=>{ge.init(t,e);let n=new RegExp(`.*${yt(e.suffix)}$`);e.pattern??(e.pattern=n),t._zod.onattach.push(i=>{let r=i._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(n)}),t._zod.check=i=>{i.value.endsWith(e.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:i.value,inst:t,continue:!e.abort})}});function gv(t,e,n){t.issues.length&&e.issues.push(...ot(n,t.issues))}var Um=h("$ZodCheckProperty",(t,e)=>{ge.init(t,e),t._zod.check=n=>{let i=e.schema._zod.run({value:n.value[e.property],issues:[]},{});if(i instanceof Promise)return i.then(r=>gv(r,n,e.property));gv(i,n,e.property)}}),Mm=h("$ZodCheckMimeType",(t,e)=>{ge.init(t,e);let n=new Set(e.mime);t._zod.onattach.push(i=>{i._zod.bag.mime=e.mime}),t._zod.check=i=>{n.has(i.value.type)||i.issues.push({code:"invalid_value",values:e.mime,input:i.value.type,inst:t,continue:!e.abort})}}),Lm=h("$ZodCheckOverwrite",(t,e)=>{ge.init(t,e),t._zod.check=n=>{n.value=e.tx(n.value)}});var No=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let i=e.split(`
|
|
12
12
|
`).filter(s=>s),r=Math.min(...i.map(s=>s.length-s.trimStart().length)),o=i.map(s=>s.slice(r)).map(s=>" ".repeat(this.indent*2)+s);for(let s of o)this.content.push(s)}compile(){let e=Function,n=this?.args,r=[...(this?.content??[""]).map(o=>` ${o}`)];return new e(...n,r.join(`
|
|
13
|
-
`))}};var Im={major:4,minor:4,patch:3};var H=g("$ZodType",(t,e)=>{var n;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=Im;let i=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&i.unshift(t);for(let r of i)for(let o of r._zod.onattach)o(t);if(i.length===0)(n=t._zod).deferred??(n.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{let r=(s,c,u)=>{let d=bn(s),l;for(let p of c){if(p._zod.def.when){if(Tp(s)||!p._zod.def.when(s))continue}else if(d)continue;let m=s.issues.length,f=p._zod.check(s);if(f instanceof Promise&&u?.async===!1)throw new Tt;if(l||f instanceof Promise)l=(l??Promise.resolve()).then(async()=>{await f,s.issues.length!==m&&(d||(d=bn(s,m)))});else{if(s.issues.length===m)continue;d||(d=bn(s,m))}}return l?l.then(()=>s):s},o=(s,c,u)=>{if(bn(s))return s.aborted=!0,s;let d=r(c,i,u);if(d instanceof Promise){if(u.async===!1)throw new Tt;return d.then(l=>t._zod.parse(l,u))}return t._zod.parse(d,u)};t._zod.run=(s,c)=>{if(c.skipChecks)return t._zod.parse(s,c);if(c.direction==="backward"){let d=t._zod.parse({value:s.value,issues:[]},{...c,skipChecks:!0});return d instanceof Promise?d.then(l=>o(l,s,c)):o(d,s,c)}let u=t._zod.parse(s,c);if(u instanceof Promise){if(c.async===!1)throw new Tt;return u.then(d=>r(d,i,c))}return r(u,i,c)}}J(t,"~standard",()=>({validate:r=>{try{let o=_n(t,r);return o.success?{value:o.data}:{issues:o.error?.issues}}catch{return yn(t,r).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}))}),vn=g("$ZodString",(t,e)=>{H.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??Xp(t._zod.bag),t._zod.parse=(n,i)=>{if(e.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:t}),n}}),me=g("$ZodStringFormat",(t,e)=>{Or.init(t,e),vn.init(t,e)}),Xa=g("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=Up),me.init(t,e)}),Qa=g("$ZodUUID",(t,e)=>{if(e.version){let i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(i===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=Xn(i))}else e.pattern??(e.pattern=Xn());me.init(t,e)}),ec=g("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=Mp),me.init(t,e)}),tc=g("$ZodURL",(t,e)=>{me.init(t,e),t._zod.check=n=>{try{let i=n.value.trim();if(!e.normalize&&e.protocol?.source===Gp.source&&!/^https?:\/\//i.test(i)){n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:t,continue:!e.abort});return}let r=new URL(i);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(r.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:n.value,inst:t,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(r.protocol.endsWith(":")?r.protocol.slice(0,-1):r.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:n.value,inst:t,continue:!e.abort})),e.normalize?n.value=r.href:n.value=i;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:t,continue:!e.abort})}}}),nc=g("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=Lp()),me.init(t,e)}),rc=g("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=Dp),me.init(t,e)}),ic=g("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=Pp),me.init(t,e)}),oc=g("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=Ap),me.init(t,e)}),sc=g("$ZodULID",(t,e)=>{e.pattern??(e.pattern=Np),me.init(t,e)}),ac=g("$ZodXID",(t,e)=>{e.pattern??(e.pattern=Cp),me.init(t,e)}),cc=g("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=zp),me.init(t,e)}),wm=g("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=Yp(e)),me.init(t,e)}),Em=g("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=Wp),me.init(t,e)}),Tm=g("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=Jp(e)),me.init(t,e)}),Rm=g("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=jp),me.init(t,e)}),uc=g("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=Zp),me.init(t,e),t._zod.bag.format="ipv4"}),lc=g("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=Bp),me.init(t,e),t._zod.bag.format="ipv6",t._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:t,continue:!e.abort})}}}),dc=g("$ZodMAC",(t,e)=>{e.pattern??(e.pattern=Fp(e.delimiter)),me.init(t,e),t._zod.bag.format="mac"}),pc=g("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=qp),me.init(t,e)}),mc=g("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=Vp),me.init(t,e),t._zod.check=n=>{let i=n.value.split("/");try{if(i.length!==2)throw new Error;let[r,o]=i;if(!o)throw new Error;let s=Number(o);if(`${s}`!==o)throw new Error;if(s<0||s>128)throw new Error;new URL(`http://[${r}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:t,continue:!e.abort})}}});function Om(t){if(t==="")return!0;if(/\s/.test(t)||t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}var fc=g("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=Hp),me.init(t,e),t._zod.bag.contentEncoding="base64",t._zod.check=n=>{Om(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:t,continue:!e.abort})}});function uv(t){if(!qa.test(t))return!1;let e=t.replace(/[-_]/g,i=>i==="-"?"+":"/"),n=e.padEnd(Math.ceil(e.length/4)*4,"=");return Om(n)}var hc=g("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=qa),me.init(t,e),t._zod.bag.contentEncoding="base64url",t._zod.check=n=>{uv(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:t,continue:!e.abort})}}),gc=g("$ZodE164",(t,e)=>{e.pattern??(e.pattern=Kp),me.init(t,e)});function lv(t,e=null){try{let n=t.split(".");if(n.length!==3)return!1;let[i]=n;if(!i)return!1;let r=JSON.parse(atob(i));return!("typ"in r&&r?.typ!=="JWT"||!r.alg||e&&(!("alg"in r)||r.alg!==e))}catch{return!1}}var bc=g("$ZodJWT",(t,e)=>{me.init(t,e),t._zod.check=n=>{lv(n.value,e.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:t,continue:!e.abort})}}),_c=g("$ZodCustomStringFormat",(t,e)=>{me.init(t,e),t._zod.check=n=>{e.fn(n.value)||n.issues.push({code:"invalid_format",format:e.format,input:n.value,inst:t,continue:!e.abort})}}),Eo=g("$ZodNumber",(t,e)=>{H.init(t,e),t._zod.pattern=t._zod.bag.pattern??Va,t._zod.parse=(n,i)=>{if(e.coerce)try{n.value=Number(n.value)}catch{}let r=n.value;if(typeof r=="number"&&!Number.isNaN(r)&&Number.isFinite(r))return n;let o=typeof r=="number"?Number.isNaN(r)?"NaN":Number.isFinite(r)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:r,inst:t,...o?{received:o}:{}}),n}}),yc=g("$ZodNumberFormat",(t,e)=>{am.init(t,e),Eo.init(t,e)}),Pr=g("$ZodBoolean",(t,e)=>{H.init(t,e),t._zod.pattern=tm,t._zod.parse=(n,i)=>{if(e.coerce)try{n.value=!!n.value}catch{}let r=n.value;return typeof r=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:r,inst:t}),n}}),To=g("$ZodBigInt",(t,e)=>{H.init(t,e),t._zod.pattern=Qp,t._zod.parse=(n,i)=>{if(e.coerce)try{n.value=BigInt(n.value)}catch{}return typeof n.value=="bigint"||n.issues.push({expected:"bigint",code:"invalid_type",input:n.value,inst:t}),n}}),vc=g("$ZodBigIntFormat",(t,e)=>{cm.init(t,e),To.init(t,e)}),kc=g("$ZodSymbol",(t,e)=>{H.init(t,e),t._zod.parse=(n,i)=>{let r=n.value;return typeof r=="symbol"||n.issues.push({expected:"symbol",code:"invalid_type",input:r,inst:t}),n}}),Sc=g("$ZodUndefined",(t,e)=>{H.init(t,e),t._zod.pattern=rm,t._zod.values=new Set([void 0]),t._zod.parse=(n,i)=>{let r=n.value;return typeof r>"u"||n.issues.push({expected:"undefined",code:"invalid_type",input:r,inst:t}),n}}),xc=g("$ZodNull",(t,e)=>{H.init(t,e),t._zod.pattern=nm,t._zod.values=new Set([null]),t._zod.parse=(n,i)=>{let r=n.value;return r===null||n.issues.push({expected:"null",code:"invalid_type",input:r,inst:t}),n}}),Ic=g("$ZodAny",(t,e)=>{H.init(t,e),t._zod.parse=n=>n}),$c=g("$ZodUnknown",(t,e)=>{H.init(t,e),t._zod.parse=n=>n}),wc=g("$ZodNever",(t,e)=>{H.init(t,e),t._zod.parse=(n,i)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:t}),n)}),Ec=g("$ZodVoid",(t,e)=>{H.init(t,e),t._zod.parse=(n,i)=>{let r=n.value;return typeof r>"u"||n.issues.push({expected:"void",code:"invalid_type",input:r,inst:t}),n}}),Tc=g("$ZodDate",(t,e)=>{H.init(t,e),t._zod.parse=(n,i)=>{if(e.coerce)try{n.value=new Date(n.value)}catch{}let r=n.value,o=r instanceof Date;return o&&!Number.isNaN(r.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:r,...o?{received:"Invalid Date"}:{},inst:t}),n}});function Wy(t,e,n){t.issues.length&&e.issues.push(...nt(n,t.issues)),e.value[n]=t.value}var Rc=g("$ZodArray",(t,e)=>{H.init(t,e),t._zod.parse=(n,i)=>{let r=n.value;if(!Array.isArray(r))return n.issues.push({expected:"array",code:"invalid_type",input:r,inst:t}),n;n.value=Array(r.length);let o=[];for(let s=0;s<r.length;s++){let c=r[s],u=e.element._zod.run({value:c,issues:[]},i);u instanceof Promise?o.push(u.then(d=>Wy(d,n,s))):Wy(u,n,s)}return o.length?Promise.all(o).then(()=>n):n}});function Ya(t,e,n,i,r,o){let s=n in i;if(t.issues.length){if(r&&o&&!s)return;e.issues.push(...nt(n,t.issues))}if(!s&&!r){t.issues.length||e.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}t.value===void 0?s&&(e.value[n]=void 0):e.value[n]=t.value}function dv(t){let e=Object.keys(t.shape);for(let i of e)if(!t.shape?.[i]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${i}": expected a Zod schema`);let n=$p(t.shape);return{...t,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(n)}}function pv(t,e,n,i,r,o){let s=[],c=r.keySet,u=r.catchall._zod,d=u.def.type,l=u.optin==="optional",p=u.optout==="optional";for(let m in e){if(m==="__proto__"||c.has(m))continue;if(d==="never"){s.push(m);continue}let f=u.run({value:e[m],issues:[]},i);f instanceof Promise?t.push(f.then(h=>Ya(h,n,m,e,l,p))):Ya(f,n,m,e,l,p)}return s.length&&n.issues.push({code:"unrecognized_keys",keys:s,input:e,inst:o}),t.length?Promise.all(t).then(()=>n):n}var Oc=g("$ZodObject",(t,e)=>{if(H.init(t,e),!Object.getOwnPropertyDescriptor(e,"shape")?.get){let c=e.shape;Object.defineProperty(e,"shape",{get:()=>{let u={...c};return Object.defineProperty(e,"shape",{value:u}),u}})}let i=Ir(()=>dv(e));J(t._zod,"propValues",()=>{let c=e.shape,u={};for(let d in c){let l=c[d]._zod;if(l.values){u[d]??(u[d]=new Set);for(let p of l.values)u[d].add(p)}}return u});let r=Wn,o=e.catchall,s;t._zod.parse=(c,u)=>{s??(s=i.value);let d=c.value;if(!r(d))return c.issues.push({expected:"object",code:"invalid_type",input:d,inst:t}),c;c.value={};let l=[],p=s.shape;for(let m of s.keys){let f=p[m],h=f._zod.optin==="optional",y=f._zod.optout==="optional",v=f._zod.run({value:d[m],issues:[]},u);v instanceof Promise?l.push(v.then(T=>Ya(T,c,m,d,h,y))):Ya(v,c,m,d,h,y)}return o?pv(l,d,c,u,i.value,t):l.length?Promise.all(l).then(()=>c):c}}),Pm=g("$ZodObjectJIT",(t,e)=>{Oc.init(t,e);let n=t._zod.parse,i=Ir(()=>dv(e)),r=m=>{let f=new wo(["shape","payload","ctx"]),h=i.value,y=D=>{let U=Na(D);return`shape[${U}]._zod.run({ value: input[${U}], issues: [] }, ctx)`};f.write("const input = payload.value;");let v=Object.create(null),T=0;for(let D of h.keys)v[D]=`key_${T++}`;f.write("const newResult = {};");for(let D of h.keys){let U=v[D],j=Na(D),pt=m[D],bt=pt?._zod?.optin==="optional",mo=pt?._zod?.optout==="optional";f.write(`const ${U} = ${y(D)};`),bt&&mo?f.write(`
|
|
13
|
+
`))}};var Zm={major:4,minor:4,patch:3};var H=h("$ZodType",(t,e)=>{var n;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=Zm;let i=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&i.unshift(t);for(let r of i)for(let o of r._zod.onattach)o(t);if(i.length===0)(n=t._zod).deferred??(n.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{let r=(s,c,u)=>{let l=vn(s),p;for(let d of c){if(d._zod.def.when){if(qp(s)||!d._zod.def.when(s))continue}else if(l)continue;let m=s.issues.length,f=d._zod.check(s);if(f instanceof Promise&&u?.async===!1)throw new Tt;if(p||f instanceof Promise)p=(p??Promise.resolve()).then(async()=>{await f,s.issues.length!==m&&(l||(l=vn(s,m)))});else{if(s.issues.length===m)continue;l||(l=vn(s,m))}}return p?p.then(()=>s):s},o=(s,c,u)=>{if(vn(s))return s.aborted=!0,s;let l=r(c,i,u);if(l instanceof Promise){if(u.async===!1)throw new Tt;return l.then(p=>t._zod.parse(p,u))}return t._zod.parse(l,u)};t._zod.run=(s,c)=>{if(c.skipChecks)return t._zod.parse(s,c);if(c.direction==="backward"){let l=t._zod.parse({value:s.value,issues:[]},{...c,skipChecks:!0});return l instanceof Promise?l.then(p=>o(p,s,c)):o(l,s,c)}let u=t._zod.parse(s,c);if(u instanceof Promise){if(c.async===!1)throw new Tt;return u.then(l=>r(l,i,c))}return r(u,i,c)}}J(t,"~standard",()=>({validate:r=>{try{let o=kn(t,r);return o.success?{value:o.data}:{issues:o.error?.issues}}catch{return Sn(t,r).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}))}),xn=h("$ZodString",(t,e)=>{H.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??gm(t._zod.bag),t._zod.parse=(n,i)=>{if(e.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:t}),n}}),me=h("$ZodStringFormat",(t,e)=>{jr.init(t,e),xn.init(t,e)}),cc=h("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=tm),me.init(t,e)}),uc=h("$ZodUUID",(t,e)=>{if(e.version){let i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(i===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=sr(i))}else e.pattern??(e.pattern=sr());me.init(t,e)}),lc=h("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=nm),me.init(t,e)}),dc=h("$ZodURL",(t,e)=>{me.init(t,e),t._zod.check=n=>{try{let i=n.value.trim();if(!e.normalize&&e.protocol?.source===lm.source&&!/^https?:\/\//i.test(i)){n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:t,continue:!e.abort});return}let r=new URL(i);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(r.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:n.value,inst:t,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(r.protocol.endsWith(":")?r.protocol.slice(0,-1):r.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:n.value,inst:t,continue:!e.abort})),e.normalize?n.value=r.href:n.value=i;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:t,continue:!e.abort})}}}),pc=h("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=rm()),me.init(t,e)}),mc=h("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=Qp),me.init(t,e)}),fc=h("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=Gp),me.init(t,e)}),gc=h("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=Wp),me.init(t,e)}),hc=h("$ZodULID",(t,e)=>{e.pattern??(e.pattern=Jp),me.init(t,e)}),bc=h("$ZodXID",(t,e)=>{e.pattern??(e.pattern=Yp),me.init(t,e)}),yc=h("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=Xp),me.init(t,e)}),Fm=h("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=fm(e)),me.init(t,e)}),Vm=h("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=pm),me.init(t,e)}),qm=h("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=mm(e)),me.init(t,e)}),Hm=h("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=em),me.init(t,e)}),_c=h("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=im),me.init(t,e),t._zod.bag.format="ipv4"}),vc=h("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=om),me.init(t,e),t._zod.bag.format="ipv6",t._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:t,continue:!e.abort})}}}),kc=h("$ZodMAC",(t,e)=>{e.pattern??(e.pattern=sm(e.delimiter)),me.init(t,e),t._zod.bag.format="mac"}),Sc=h("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=am),me.init(t,e)}),xc=h("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=cm),me.init(t,e),t._zod.check=n=>{let i=n.value.split("/");try{if(i.length!==2)throw new Error;let[r,o]=i;if(!o)throw new Error;let s=Number(o);if(`${s}`!==o)throw new Error;if(s<0||s>128)throw new Error;new URL(`http://[${r}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:t,continue:!e.abort})}}});function Km(t){if(t==="")return!0;if(/\s/.test(t)||t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}var Ic=h("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=um),me.init(t,e),t._zod.bag.contentEncoding="base64",t._zod.check=n=>{Km(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:t,continue:!e.abort})}});function Av(t){if(!ec.test(t))return!1;let e=t.replace(/[-_]/g,i=>i==="-"?"+":"/"),n=e.padEnd(Math.ceil(e.length/4)*4,"=");return Km(n)}var $c=h("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=ec),me.init(t,e),t._zod.bag.contentEncoding="base64url",t._zod.check=n=>{Av(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:t,continue:!e.abort})}}),wc=h("$ZodE164",(t,e)=>{e.pattern??(e.pattern=dm),me.init(t,e)});function Nv(t,e=null){try{let n=t.split(".");if(n.length!==3)return!1;let[i]=n;if(!i)return!1;let r=JSON.parse(atob(i));return!("typ"in r&&r?.typ!=="JWT"||!r.alg||e&&(!("alg"in r)||r.alg!==e))}catch{return!1}}var Ec=h("$ZodJWT",(t,e)=>{me.init(t,e),t._zod.check=n=>{Nv(n.value,e.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:t,continue:!e.abort})}}),Tc=h("$ZodCustomStringFormat",(t,e)=>{me.init(t,e),t._zod.check=n=>{e.fn(n.value)||n.issues.push({code:"invalid_format",format:e.format,input:n.value,inst:t,continue:!e.abort})}}),Co=h("$ZodNumber",(t,e)=>{H.init(t,e),t._zod.pattern=t._zod.bag.pattern??tc,t._zod.parse=(n,i)=>{if(e.coerce)try{n.value=Number(n.value)}catch{}let r=n.value;if(typeof r=="number"&&!Number.isNaN(r)&&Number.isFinite(r))return n;let o=typeof r=="number"?Number.isNaN(r)?"NaN":Number.isFinite(r)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:r,inst:t,...o?{received:o}:{}}),n}}),Rc=h("$ZodNumberFormat",(t,e)=>{Im.init(t,e),Co.init(t,e)}),Ur=h("$ZodBoolean",(t,e)=>{H.init(t,e),t._zod.pattern=ym,t._zod.parse=(n,i)=>{if(e.coerce)try{n.value=!!n.value}catch{}let r=n.value;return typeof r=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:r,inst:t}),n}}),zo=h("$ZodBigInt",(t,e)=>{H.init(t,e),t._zod.pattern=hm,t._zod.parse=(n,i)=>{if(e.coerce)try{n.value=BigInt(n.value)}catch{}return typeof n.value=="bigint"||n.issues.push({expected:"bigint",code:"invalid_type",input:n.value,inst:t}),n}}),Oc=h("$ZodBigIntFormat",(t,e)=>{$m.init(t,e),zo.init(t,e)}),Pc=h("$ZodSymbol",(t,e)=>{H.init(t,e),t._zod.parse=(n,i)=>{let r=n.value;return typeof r=="symbol"||n.issues.push({expected:"symbol",code:"invalid_type",input:r,inst:t}),n}}),Ac=h("$ZodUndefined",(t,e)=>{H.init(t,e),t._zod.pattern=vm,t._zod.values=new Set([void 0]),t._zod.parse=(n,i)=>{let r=n.value;return typeof r>"u"||n.issues.push({expected:"undefined",code:"invalid_type",input:r,inst:t}),n}}),Nc=h("$ZodNull",(t,e)=>{H.init(t,e),t._zod.pattern=_m,t._zod.values=new Set([null]),t._zod.parse=(n,i)=>{let r=n.value;return r===null||n.issues.push({expected:"null",code:"invalid_type",input:r,inst:t}),n}}),Cc=h("$ZodAny",(t,e)=>{H.init(t,e),t._zod.parse=n=>n}),zc=h("$ZodUnknown",(t,e)=>{H.init(t,e),t._zod.parse=n=>n}),Dc=h("$ZodNever",(t,e)=>{H.init(t,e),t._zod.parse=(n,i)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:t}),n)}),jc=h("$ZodVoid",(t,e)=>{H.init(t,e),t._zod.parse=(n,i)=>{let r=n.value;return typeof r>"u"||n.issues.push({expected:"void",code:"invalid_type",input:r,inst:t}),n}}),Uc=h("$ZodDate",(t,e)=>{H.init(t,e),t._zod.parse=(n,i)=>{if(e.coerce)try{n.value=new Date(n.value)}catch{}let r=n.value,o=r instanceof Date;return o&&!Number.isNaN(r.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:r,...o?{received:"Invalid Date"}:{},inst:t}),n}});function yv(t,e,n){t.issues.length&&e.issues.push(...ot(n,t.issues)),e.value[n]=t.value}var Mc=h("$ZodArray",(t,e)=>{H.init(t,e),t._zod.parse=(n,i)=>{let r=n.value;if(!Array.isArray(r))return n.issues.push({expected:"array",code:"invalid_type",input:r,inst:t}),n;n.value=Array(r.length);let o=[];for(let s=0;s<r.length;s++){let c=r[s],u=e.element._zod.run({value:c,issues:[]},i);u instanceof Promise?o.push(u.then(l=>yv(l,n,s))):yv(u,n,s)}return o.length?Promise.all(o).then(()=>n):n}});function ac(t,e,n,i,r,o){let s=n in i;if(t.issues.length){if(r&&o&&!s)return;e.issues.push(...ot(n,t.issues))}if(!s&&!r){t.issues.length||e.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}t.value===void 0?s&&(e.value[n]=void 0):e.value[n]=t.value}function Cv(t){let e=Object.keys(t.shape);for(let i of e)if(!t.shape?.[i]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${i}": expected a Zod schema`);let n=Bp(t.shape);return{...t,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(n)}}function zv(t,e,n,i,r,o){let s=[],c=r.keySet,u=r.catchall._zod,l=u.def.type,p=u.optin==="optional",d=u.optout==="optional";for(let m in e){if(m==="__proto__"||c.has(m))continue;if(l==="never"){s.push(m);continue}let f=u.run({value:e[m],issues:[]},i);f instanceof Promise?t.push(f.then(g=>ac(g,n,m,e,p,d))):ac(f,n,m,e,p,d)}return s.length&&n.issues.push({code:"unrecognized_keys",keys:s,input:e,inst:o}),t.length?Promise.all(t).then(()=>n):n}var Lc=h("$ZodObject",(t,e)=>{if(H.init(t,e),!Object.getOwnPropertyDescriptor(e,"shape")?.get){let c=e.shape;Object.defineProperty(e,"shape",{get:()=>{let u={...c};return Object.defineProperty(e,"shape",{value:u}),u}})}let i=Pr(()=>Cv(e));J(t._zod,"propValues",()=>{let c=e.shape,u={};for(let l in c){let p=c[l]._zod;if(p.values){u[l]??(u[l]=new Set);for(let d of p.values)u[l].add(d)}}return u});let r=rr,o=e.catchall,s;t._zod.parse=(c,u)=>{s??(s=i.value);let l=c.value;if(!r(l))return c.issues.push({expected:"object",code:"invalid_type",input:l,inst:t}),c;c.value={};let p=[],d=s.shape;for(let m of s.keys){let f=d[m],g=f._zod.optin==="optional",y=f._zod.optout==="optional",v=f._zod.run({value:l[m],issues:[]},u);v instanceof Promise?p.push(v.then(S=>ac(S,c,m,l,g,y))):ac(v,c,m,l,g,y)}return o?zv(p,l,c,u,i.value,t):p.length?Promise.all(p).then(()=>c):c}}),Gm=h("$ZodObjectJIT",(t,e)=>{Lc.init(t,e);let n=t._zod.parse,i=Pr(()=>Cv(e)),r=m=>{let f=new No(["shape","payload","ctx"]),g=i.value,y=R=>{let U=Fa(R);return`shape[${U}]._zod.run({ value: input[${U}], issues: [] }, ctx)`};f.write("const input = payload.value;");let v=Object.create(null),S=0;for(let R of g.keys)v[R]=`key_${S++}`;f.write("const newResult = {};");for(let R of g.keys){let U=v[R],j=Fa(R),je=m[R],bt=je?._zod?.optin==="optional",vo=je?._zod?.optout==="optional";f.write(`const ${U} = ${y(R)};`),bt&&vo?f.write(`
|
|
14
14
|
if (${U}.issues.length) {
|
|
15
15
|
if (${j} in input) {
|
|
16
16
|
payload.issues = payload.issues.concat(${U}.issues.map(iss => ({
|
|
@@ -69,31 +69,32 @@ var GR=Object.create;var gp=Object.defineProperty;var KR=Object.getOwnPropertyDe
|
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
`)}f.write("payload.value = newResult;"),f.write("return payload;");let z=f.compile();return(D,U)=>z(m,D,U)},o,s=Wn,c=!Kn.jitless,d=c&&xp.value,l=e.catchall,p;t._zod.parse=(m,f)=>{p??(p=i.value);let h=m.value;return s(h)?c&&d&&f?.async===!1&&f.jitless!==!0?(o||(o=r(e.shape)),m=o(m,f),l?pv([],h,m,f,p,t):m):n(m,f):(m.issues.push({expected:"object",code:"invalid_type",input:h,inst:t}),m)}});function Jy(t,e,n,i){for(let o of t)if(o.issues.length===0)return e.value=o.value,e;let r=t.filter(o=>!bn(o));return r.length===1?(e.value=r[0].value,r[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:n,errors:t.map(o=>o.issues.map(s=>Ke(s,i,Re())))}),e)}var Ar=g("$ZodUnion",(t,e)=>{H.init(t,e),J(t._zod,"optin",()=>e.options.some(i=>i._zod.optin==="optional")?"optional":void 0),J(t._zod,"optout",()=>e.options.some(i=>i._zod.optout==="optional")?"optional":void 0),J(t._zod,"values",()=>{if(e.options.every(i=>i._zod.values))return new Set(e.options.flatMap(i=>Array.from(i._zod.values)))}),J(t._zod,"pattern",()=>{if(e.options.every(i=>i._zod.pattern)){let i=e.options.map(r=>r._zod.pattern);return new RegExp(`^(${i.map(r=>bo(r.source)).join("|")})$`)}});let n=e.options.length===1?e.options[0]._zod.run:null;t._zod.parse=(i,r)=>{if(n)return n(i,r);let o=!1,s=[];for(let c of e.options){let u=c._zod.run({value:i.value,issues:[]},r);if(u instanceof Promise)s.push(u),o=!0;else{if(u.issues.length===0)return u;s.push(u)}}return o?Promise.all(s).then(c=>Jy(c,i,t,r)):Jy(s,i,t,r)}});function Yy(t,e,n,i){let r=t.filter(o=>o.issues.length===0);return r.length===1?(e.value=r[0].value,e):(r.length===0?e.issues.push({code:"invalid_union",input:e.value,inst:n,errors:t.map(o=>o.issues.map(s=>Ke(s,i,Re())))}):e.issues.push({code:"invalid_union",input:e.value,inst:n,errors:[],inclusive:!1}),e)}var Pc=g("$ZodXor",(t,e)=>{Ar.init(t,e),e.inclusive=!1;let n=e.options.length===1?e.options[0]._zod.run:null;t._zod.parse=(i,r)=>{if(n)return n(i,r);let o=!1,s=[];for(let c of e.options){let u=c._zod.run({value:i.value,issues:[]},r);u instanceof Promise?(s.push(u),o=!0):s.push(u)}return o?Promise.all(s).then(c=>Yy(c,i,t,r)):Yy(s,i,t,r)}}),Ac=g("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,Ar.init(t,e);let n=t._zod.parse;J(t._zod,"propValues",()=>{let r={};for(let o of e.options){let s=o._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(o)}"`);for(let[c,u]of Object.entries(s)){r[c]||(r[c]=new Set);for(let d of u)r[c].add(d)}}return r});let i=Ir(()=>{let r=e.options,o=new Map;for(let s of r){let c=s._zod.propValues?.[e.discriminator];if(!c||c.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(let u of c){if(o.has(u))throw new Error(`Duplicate discriminator value "${String(u)}"`);o.set(u,s)}}return o});t._zod.parse=(r,o)=>{let s=r.value;if(!Wn(s))return r.issues.push({code:"invalid_type",expected:"object",input:s,inst:t}),r;let c=i.value.get(s?.[e.discriminator]);return c?c._zod.run(r,o):e.unionFallback||o.direction==="backward"?n(r,o):(r.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,options:Array.from(i.value.keys()),input:s,path:[e.discriminator],inst:t}),r)}}),Nc=g("$ZodIntersection",(t,e)=>{H.init(t,e),t._zod.parse=(n,i)=>{let r=n.value,o=e.left._zod.run({value:r,issues:[]},i),s=e.right._zod.run({value:r,issues:[]},i);return o instanceof Promise||s instanceof Promise?Promise.all([o,s]).then(([u,d])=>Xy(n,u,d)):Xy(n,o,s)}});function $m(t,e){if(t===e)return{valid:!0,data:t};if(t instanceof Date&&e instanceof Date&&+t==+e)return{valid:!0,data:t};if(gn(t)&&gn(e)){let n=Object.keys(e),i=Object.keys(t).filter(o=>n.indexOf(o)!==-1),r={...t,...e};for(let o of i){let s=$m(t[o],e[o]);if(!s.valid)return{valid:!1,mergeErrorPath:[o,...s.mergeErrorPath]};r[o]=s.data}return{valid:!0,data:r}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let i=0;i<t.length;i++){let r=t[i],o=e[i],s=$m(r,o);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};n.push(s.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Xy(t,e,n){let i=new Map,r;for(let c of e.issues)if(c.code==="unrecognized_keys"){r??(r=c);for(let u of c.keys)i.has(u)||i.set(u,{}),i.get(u).l=!0}else t.issues.push(c);for(let c of n.issues)if(c.code==="unrecognized_keys")for(let u of c.keys)i.has(u)||i.set(u,{}),i.get(u).r=!0;else t.issues.push(c);let o=[...i].filter(([,c])=>c.l&&c.r).map(([c])=>c);if(o.length&&r&&t.issues.push({...r,keys:o}),bn(t))return t;let s=$m(e.value,n.value);if(!s.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return t.value=s.data,t}var Ro=g("$ZodTuple",(t,e)=>{H.init(t,e);let n=e.items;t._zod.parse=(i,r)=>{let o=i.value;if(!Array.isArray(o))return i.issues.push({input:o,inst:t,expected:"tuple",code:"invalid_type"}),i;i.value=[];let s=[],c=Qy(n,"optin"),u=Qy(n,"optout");if(!e.rest){if(o.length<c)return i.issues.push({code:"too_small",minimum:c,inclusive:!0,input:o,inst:t,origin:"array"}),i;o.length>n.length&&i.issues.push({code:"too_big",maximum:n.length,inclusive:!0,input:o,inst:t,origin:"array"})}let d=new Array(n.length);for(let l=0;l<n.length;l++){let p=n[l]._zod.run({value:o[l],issues:[]},r);p instanceof Promise?s.push(p.then(m=>{d[l]=m})):d[l]=p}if(e.rest){let l=n.length-1,p=o.slice(n.length);for(let m of p){l++;let f=e.rest._zod.run({value:m,issues:[]},r);f instanceof Promise?s.push(f.then(h=>ev(h,i,l))):ev(f,i,l)}}return s.length?Promise.all(s).then(()=>tv(d,i,n,o,u)):tv(d,i,n,o,u)}});function Qy(t,e){for(let n=t.length-1;n>=0;n--)if(t[n]._zod[e]!=="optional")return n+1;return 0}function ev(t,e,n){t.issues.length&&e.issues.push(...nt(n,t.issues)),e.value[n]=t.value}function tv(t,e,n,i,r){for(let o=0;o<n.length;o++){let s=t[o],c=o<i.length;if(s.issues.length){if(!c&&o>=r){e.value.length=o;break}e.issues.push(...nt(o,s.issues))}e.value[o]=s.value}for(let o=e.value.length-1;o>=i.length&&(n[o]._zod.optout==="optional"&&e.value[o]===void 0);o--)e.value.length=o;return e}var Cc=g("$ZodRecord",(t,e)=>{H.init(t,e),t._zod.parse=(n,i)=>{let r=n.value;if(!gn(r))return n.issues.push({expected:"record",code:"invalid_type",input:r,inst:t}),n;let o=[],s=e.keyType._zod.values;if(s){n.value={};let c=new Set;for(let d of s)if(typeof d=="string"||typeof d=="number"||typeof d=="symbol"){c.add(typeof d=="number"?d.toString():d);let l=e.keyType._zod.run({value:d,issues:[]},i);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(l.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(f=>Ke(f,i,Re())),input:d,path:[d],inst:t});continue}let p=l.value,m=e.valueType._zod.run({value:r[d],issues:[]},i);m instanceof Promise?o.push(m.then(f=>{f.issues.length&&n.issues.push(...nt(d,f.issues)),n.value[p]=f.value})):(m.issues.length&&n.issues.push(...nt(d,m.issues)),n.value[p]=m.value)}let u;for(let d in r)c.has(d)||(u=u??[],u.push(d));u&&u.length>0&&n.issues.push({code:"unrecognized_keys",input:r,inst:t,keys:u})}else{n.value={};for(let c of Reflect.ownKeys(r)){if(c==="__proto__"||!Object.prototype.propertyIsEnumerable.call(r,c))continue;let u=e.keyType._zod.run({value:c,issues:[]},i);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof c=="string"&&Va.test(c)&&u.issues.length){let p=e.keyType._zod.run({value:Number(c),issues:[]},i);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");p.issues.length===0&&(u=p)}if(u.issues.length){e.mode==="loose"?n.value[c]=r[c]:n.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map(p=>Ke(p,i,Re())),input:c,path:[c],inst:t});continue}let l=e.valueType._zod.run({value:r[c],issues:[]},i);l instanceof Promise?o.push(l.then(p=>{p.issues.length&&n.issues.push(...nt(c,p.issues)),n.value[u.value]=p.value})):(l.issues.length&&n.issues.push(...nt(c,l.issues)),n.value[u.value]=l.value)}}return o.length?Promise.all(o).then(()=>n):n}}),zc=g("$ZodMap",(t,e)=>{H.init(t,e),t._zod.parse=(n,i)=>{let r=n.value;if(!(r instanceof Map))return n.issues.push({expected:"map",code:"invalid_type",input:r,inst:t}),n;let o=[];n.value=new Map;for(let[s,c]of r){let u=e.keyType._zod.run({value:s,issues:[]},i),d=e.valueType._zod.run({value:c,issues:[]},i);u instanceof Promise||d instanceof Promise?o.push(Promise.all([u,d]).then(([l,p])=>{nv(l,p,n,s,r,t,i)})):nv(u,d,n,s,r,t,i)}return o.length?Promise.all(o).then(()=>n):n}});function nv(t,e,n,i,r,o,s){t.issues.length&&(_o.has(typeof i)?n.issues.push(...nt(i,t.issues)):n.issues.push({code:"invalid_key",origin:"map",input:r,inst:o,issues:t.issues.map(c=>Ke(c,s,Re()))})),e.issues.length&&(_o.has(typeof i)?n.issues.push(...nt(i,e.issues)):n.issues.push({origin:"map",code:"invalid_element",input:r,inst:o,key:i,issues:e.issues.map(c=>Ke(c,s,Re()))})),n.value.set(t.value,e.value)}var Dc=g("$ZodSet",(t,e)=>{H.init(t,e),t._zod.parse=(n,i)=>{let r=n.value;if(!(r instanceof Set))return n.issues.push({input:r,inst:t,expected:"set",code:"invalid_type"}),n;let o=[];n.value=new Set;for(let s of r){let c=e.valueType._zod.run({value:s,issues:[]},i);c instanceof Promise?o.push(c.then(u=>rv(u,n))):rv(c,n)}return o.length?Promise.all(o).then(()=>n):n}});function rv(t,e){t.issues.length&&e.issues.push(...t.issues),e.value.add(t.value)}var jc=g("$ZodEnum",(t,e)=>{H.init(t,e);let n=go(e.entries),i=new Set(n);t._zod.values=i,t._zod.pattern=new RegExp(`^(${n.filter(r=>_o.has(typeof r)).map(r=>typeof r=="string"?_t(r):r.toString()).join("|")})$`),t._zod.parse=(r,o)=>{let s=r.value;return i.has(s)||r.issues.push({code:"invalid_value",values:n,input:s,inst:t}),r}}),Uc=g("$ZodLiteral",(t,e)=>{if(H.init(t,e),e.values.length===0)throw new Error("Cannot create literal schema with no valid values");let n=new Set(e.values);t._zod.values=n,t._zod.pattern=new RegExp(`^(${e.values.map(i=>typeof i=="string"?_t(i):i?_t(i.toString()):String(i)).join("|")})$`),t._zod.parse=(i,r)=>{let o=i.value;return n.has(o)||i.issues.push({code:"invalid_value",values:e.values,input:o,inst:t}),i}}),Mc=g("$ZodFile",(t,e)=>{H.init(t,e),t._zod.parse=(n,i)=>{let r=n.value;return r instanceof File||n.issues.push({expected:"file",code:"invalid_type",input:r,inst:t}),n}}),Lc=g("$ZodTransform",(t,e)=>{H.init(t,e),t._zod.optin="optional",t._zod.parse=(n,i)=>{if(i.direction==="backward")throw new mn(t.constructor.name);let r=e.transform(n.value,n);if(i.async)return(r instanceof Promise?r:Promise.resolve(r)).then(s=>(n.value=s,n.fallback=!0,n));if(r instanceof Promise)throw new Tt;return n.value=r,n.fallback=!0,n}});function iv(t,e){return e===void 0&&(t.issues.length||t.fallback)?{issues:[],value:void 0}:t}var Oo=g("$ZodOptional",(t,e)=>{H.init(t,e),t._zod.optin="optional",t._zod.optout="optional",J(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),J(t._zod,"pattern",()=>{let n=e.innerType._zod.pattern;return n?new RegExp(`^(${bo(n.source)})?$`):void 0}),t._zod.parse=(n,i)=>{if(e.innerType._zod.optin==="optional"){let r=n.value,o=e.innerType._zod.run(n,i);return o instanceof Promise?o.then(s=>iv(s,r)):iv(o,r)}return n.value===void 0?n:e.innerType._zod.run(n,i)}}),Zc=g("$ZodExactOptional",(t,e)=>{Oo.init(t,e),J(t._zod,"values",()=>e.innerType._zod.values),J(t._zod,"pattern",()=>e.innerType._zod.pattern),t._zod.parse=(n,i)=>e.innerType._zod.run(n,i)}),Bc=g("$ZodNullable",(t,e)=>{H.init(t,e),J(t._zod,"optin",()=>e.innerType._zod.optin),J(t._zod,"optout",()=>e.innerType._zod.optout),J(t._zod,"pattern",()=>{let n=e.innerType._zod.pattern;return n?new RegExp(`^(${bo(n.source)}|null)$`):void 0}),J(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),t._zod.parse=(n,i)=>n.value===null?n:e.innerType._zod.run(n,i)}),Fc=g("$ZodDefault",(t,e)=>{H.init(t,e),t._zod.optin="optional",J(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(n,i)=>{if(i.direction==="backward")return e.innerType._zod.run(n,i);if(n.value===void 0)return n.value=e.defaultValue,n;let r=e.innerType._zod.run(n,i);return r instanceof Promise?r.then(o=>ov(o,e)):ov(r,e)}});function ov(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}var qc=g("$ZodPrefault",(t,e)=>{H.init(t,e),t._zod.optin="optional",J(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(n,i)=>(i.direction==="backward"||n.value===void 0&&(n.value=e.defaultValue),e.innerType._zod.run(n,i))}),Vc=g("$ZodNonOptional",(t,e)=>{H.init(t,e),J(t._zod,"values",()=>{let n=e.innerType._zod.values;return n?new Set([...n].filter(i=>i!==void 0)):void 0}),t._zod.parse=(n,i)=>{let r=e.innerType._zod.run(n,i);return r instanceof Promise?r.then(o=>sv(o,t)):sv(r,t)}});function sv(t,e){return!t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:e}),t}var Hc=g("$ZodSuccess",(t,e)=>{H.init(t,e),t._zod.parse=(n,i)=>{if(i.direction==="backward")throw new mn("ZodSuccess");let r=e.innerType._zod.run(n,i);return r instanceof Promise?r.then(o=>(n.value=o.issues.length===0,n)):(n.value=r.issues.length===0,n)}}),Gc=g("$ZodCatch",(t,e)=>{H.init(t,e),t._zod.optin="optional",J(t._zod,"optout",()=>e.innerType._zod.optout),J(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(n,i)=>{if(i.direction==="backward")return e.innerType._zod.run(n,i);let r=e.innerType._zod.run(n,i);return r instanceof Promise?r.then(o=>(n.value=o.value,o.issues.length&&(n.value=e.catchValue({...n,error:{issues:o.issues.map(s=>Ke(s,i,Re()))},input:n.value}),n.issues=[],n.fallback=!0),n)):(n.value=r.value,r.issues.length&&(n.value=e.catchValue({...n,error:{issues:r.issues.map(o=>Ke(o,i,Re()))},input:n.value}),n.issues=[],n.fallback=!0),n)}}),Kc=g("$ZodNaN",(t,e)=>{H.init(t,e),t._zod.parse=(n,i)=>((typeof n.value!="number"||!Number.isNaN(n.value))&&n.issues.push({input:n.value,inst:t,expected:"nan",code:"invalid_type"}),n)}),Po=g("$ZodPipe",(t,e)=>{H.init(t,e),J(t._zod,"values",()=>e.in._zod.values),J(t._zod,"optin",()=>e.in._zod.optin),J(t._zod,"optout",()=>e.out._zod.optout),J(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(n,i)=>{if(i.direction==="backward"){let o=e.out._zod.run(n,i);return o instanceof Promise?o.then(s=>Ka(s,e.in,i)):Ka(o,e.in,i)}let r=e.in._zod.run(n,i);return r instanceof Promise?r.then(o=>Ka(o,e.out,i)):Ka(r,e.out,i)}});function Ka(t,e,n){return t.issues.length?(t.aborted=!0,t):e._zod.run({value:t.value,issues:t.issues,fallback:t.fallback},n)}var Nr=g("$ZodCodec",(t,e)=>{H.init(t,e),J(t._zod,"values",()=>e.in._zod.values),J(t._zod,"optin",()=>e.in._zod.optin),J(t._zod,"optout",()=>e.out._zod.optout),J(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(n,i)=>{if((i.direction||"forward")==="forward"){let o=e.in._zod.run(n,i);return o instanceof Promise?o.then(s=>Wa(s,e,i)):Wa(o,e,i)}else{let o=e.out._zod.run(n,i);return o instanceof Promise?o.then(s=>Wa(s,e,i)):Wa(o,e,i)}}});function Wa(t,e,n){if(t.issues.length)return t.aborted=!0,t;if((n.direction||"forward")==="forward"){let r=e.transform(t.value,t);return r instanceof Promise?r.then(o=>Ja(t,o,e.out,n)):Ja(t,r,e.out,n)}else{let r=e.reverseTransform(t.value,t);return r instanceof Promise?r.then(o=>Ja(t,o,e.in,n)):Ja(t,r,e.in,n)}}function Ja(t,e,n,i){return t.issues.length?(t.aborted=!0,t):n._zod.run({value:e,issues:t.issues},i)}var Am=g("$ZodPreprocess",(t,e)=>{Po.init(t,e)}),Wc=g("$ZodReadonly",(t,e)=>{H.init(t,e),J(t._zod,"propValues",()=>e.innerType._zod.propValues),J(t._zod,"values",()=>e.innerType._zod.values),J(t._zod,"optin",()=>e.innerType?._zod?.optin),J(t._zod,"optout",()=>e.innerType?._zod?.optout),t._zod.parse=(n,i)=>{if(i.direction==="backward")return e.innerType._zod.run(n,i);let r=e.innerType._zod.run(n,i);return r instanceof Promise?r.then(av):av(r)}});function av(t){return t.value=Object.freeze(t.value),t}var Jc=g("$ZodTemplateLiteral",(t,e)=>{H.init(t,e);let n=[];for(let i of e.parts)if(typeof i=="object"&&i!==null){if(!i._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...i._zod.traits].shift()}`);let r=i._zod.pattern instanceof RegExp?i._zod.pattern.source:i._zod.pattern;if(!r)throw new Error(`Invalid template literal part: ${i._zod.traits}`);let o=r.startsWith("^")?1:0,s=r.endsWith("$")?r.length-1:r.length;n.push(r.slice(o,s))}else if(i===null||Ip.has(typeof i))n.push(_t(`${i}`));else throw new Error(`Invalid template literal part: ${i}`);t._zod.pattern=new RegExp(`^${n.join("")}$`),t._zod.parse=(i,r)=>typeof i.value!="string"?(i.issues.push({input:i.value,inst:t,expected:"string",code:"invalid_type"}),i):(t._zod.pattern.lastIndex=0,t._zod.pattern.test(i.value)||i.issues.push({input:i.value,inst:t,code:"invalid_format",format:e.format??"template_literal",pattern:t._zod.pattern.source}),i)}),Yc=g("$ZodFunction",(t,e)=>(H.init(t,e),t._def=e,t._zod.def=e,t.implement=n=>{if(typeof n!="function")throw new Error("implement() must be called with a function");return function(...i){let r=t._def.input?Jn(t._def.input,i):i,o=Reflect.apply(n,this,r);return t._def.output?Jn(t._def.output,o):o}},t.implementAsync=n=>{if(typeof n!="function")throw new Error("implementAsync() must be called with a function");return async function(...i){let r=t._def.input?await Yn(t._def.input,i):i,o=await Reflect.apply(n,this,r);return t._def.output?await Yn(t._def.output,o):o}},t._zod.parse=(n,i)=>typeof n.value!="function"?(n.issues.push({code:"invalid_type",expected:"function",input:n.value,inst:t}),n):(t._def.output&&t._def.output._zod.def.type==="promise"?n.value=t.implementAsync(n.value):n.value=t.implement(n.value),n),t.input=(...n)=>{let i=t.constructor;return Array.isArray(n[0])?new i({type:"function",input:new Ro({type:"tuple",items:n[0],rest:n[1]}),output:t._def.output}):new i({type:"function",input:n[0],output:t._def.output})},t.output=n=>{let i=t.constructor;return new i({type:"function",input:t._def.input,output:n})},t)),Xc=g("$ZodPromise",(t,e)=>{H.init(t,e),t._zod.parse=(n,i)=>Promise.resolve(n.value).then(r=>e.innerType._zod.run({value:r,issues:[]},i))}),Qc=g("$ZodLazy",(t,e)=>{H.init(t,e),J(t._zod,"innerType",()=>{let n=e;return n._cachedInner||(n._cachedInner=e.getter()),n._cachedInner}),J(t._zod,"pattern",()=>t._zod.innerType?._zod?.pattern),J(t._zod,"propValues",()=>t._zod.innerType?._zod?.propValues),J(t._zod,"optin",()=>t._zod.innerType?._zod?.optin??void 0),J(t._zod,"optout",()=>t._zod.innerType?._zod?.optout??void 0),t._zod.parse=(n,i)=>t._zod.innerType._zod.run(n,i)}),eu=g("$ZodCustom",(t,e)=>{he.init(t,e),H.init(t,e),t._zod.parse=(n,i)=>n,t._zod.check=n=>{let i=n.value,r=e.fn(i);if(r instanceof Promise)return r.then(o=>cv(o,n,i,t));cv(r,n,i,t)}});function cv(t,e,n,i){if(!t){let r={code:"custom",input:n,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(r.params=i._zod.def.params),e.issues.push($r(r))}}var zr={};en(zr,{ar:()=>mv,az:()=>fv,be:()=>gv,bg:()=>bv,ca:()=>_v,cs:()=>yv,da:()=>vv,de:()=>kv,el:()=>Sv,en:()=>tu,eo:()=>xv,es:()=>Iv,fa:()=>$v,fi:()=>wv,fr:()=>Ev,frCA:()=>Tv,he:()=>Rv,hr:()=>Ov,hu:()=>Pv,hy:()=>Nv,id:()=>Cv,is:()=>zv,it:()=>Dv,ja:()=>jv,ka:()=>Uv,kh:()=>Mv,km:()=>nu,ko:()=>Lv,lt:()=>Bv,mk:()=>Fv,ms:()=>qv,nl:()=>Vv,no:()=>Hv,ota:()=>Gv,pl:()=>Wv,ps:()=>Kv,pt:()=>Jv,ro:()=>Yv,ru:()=>Qv,sl:()=>ek,sv:()=>tk,ta:()=>nk,th:()=>rk,tr:()=>ik,ua:()=>ok,uk:()=>ru,ur:()=>sk,uz:()=>ak,vi:()=>ck,yo:()=>dk,zhCN:()=>uk,zhTW:()=>lk});var G0=()=>{let t={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function e(r){return t[r]??null}let n={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 instanceof ${r.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${c}`:`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${o}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${c}`}case"invalid_value":return r.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${k(r.values[0])}`:`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${r.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${o} ${r.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${r.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${o} ${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${r.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${o} ${r.minimum.toString()} ${s.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${r.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${o} ${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${r.prefix}"`:o.format==="ends_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${o.suffix}"`:o.format==="includes"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${o.includes}"`:o.format==="regex"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${o.pattern}`:`${n[o.format]??r.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${r.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${r.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${r.keys.length>1?"\u0629":""}: ${b(r.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${r.origin}`;case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return`\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${r.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}};function mv(){return{localeError:G0()}}var K0=()=>{let t={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"}};function e(r){return t[r]??null}let n={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"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${r.expected}, daxil olan ${c}`:`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${o}, daxil olan ${c}`}case"invalid_value":return r.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${k(r.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${r.origin??"d\u0259y\u0259r"} ${o}${r.maximum.toString()} ${s.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${r.origin??"d\u0259y\u0259r"} ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${r.origin} ${o}${r.minimum.toString()} ${s.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${r.origin} ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${o.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:o.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${o.suffix}" il\u0259 bitm\u0259lidir`:o.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${o.includes}" daxil olmal\u0131d\u0131r`:o.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${o.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${n[o.format]??r.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${r.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${r.keys.length>1?"lar":""}: ${b(r.keys,", ")}`;case"invalid_key":return`${r.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${r.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}};function fv(){return{localeError:K0()}}function hv(t,e,n,i){let r=Math.abs(t),o=r%10,s=r%100;return s>=11&&s<=19?i:o===1?e:o>=2&&o<=4?n:i}var W0=()=>{let t={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function e(r){return t[r]??null}let n={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"},i={nan:"NaN",number:"\u043B\u0456\u043A",array:"\u043C\u0430\u0441\u0456\u045E"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F instanceof ${r.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${c}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${o}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${c}`}case"invalid_value":return r.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${k(r.values[0])}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);if(s){let c=Number(r.maximum),u=hv(c,s.unit.one,s.unit.few,s.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${o}${r.maximum.toString()} ${u}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);if(s){let c=Number(r.minimum),u=hv(c,s.unit.one,s.unit.few,s.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${r.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${o}${r.minimum.toString()} ${u}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${r.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${o.prefix}"`:o.format==="ends_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${o.suffix}"`:o.format==="includes"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${o.includes}"`:o.format==="regex"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${o.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${n[o.format]??r.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${r.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${b(r.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${r.origin}`;case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${r.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}};function gv(){return{localeError:W0()}}var J0=()=>{let t={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},file:{unit:"\u0431\u0430\u0439\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"}};function e(r){return t[r]??null}let n={regex:"\u0432\u0445\u043E\u0434",email:"\u0438\u043C\u0435\u0439\u043B \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0436\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u043F\u0440\u043E\u0434\u044A\u043B\u0436\u0438\u0442\u0435\u043B\u043D\u043E\u0441\u0442",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"base64-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",base64url:"base64url-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",json_string:"JSON \u043D\u0438\u0437",e164:"E.164 \u043D\u043E\u043C\u0435\u0440",jwt:"JWT",template_literal:"\u0432\u0445\u043E\u0434"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D instanceof ${r.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${c}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${o}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${c}`}case"invalid_value":return r.values.length===1?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${k(r.values[0])}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u043E\u043F\u0446\u0438\u044F: \u043E\u0447\u0430\u043A\u0432\u0430\u043D\u043E \u0435\u0434\u043D\u043E \u043E\u0442 ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${r.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${o}${r.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430"}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${r.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${r.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${o}${r.minimum.toString()} ${s.unit}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${r.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;if(o.format==="starts_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u0432\u0430 \u0441 "${o.prefix}"`;if(o.format==="ends_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u0432\u044A\u0440\u0448\u0432\u0430 \u0441 "${o.suffix}"`;if(o.format==="includes")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0432\u043A\u043B\u044E\u0447\u0432\u0430 "${o.includes}"`;if(o.format==="regex")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0441\u044A\u0432\u043F\u0430\u0434\u0430 \u0441 ${o.pattern}`;let s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return o.format==="emoji"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="datetime"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="date"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),o.format==="time"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="duration"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${s} ${n[o.format]??r.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E \u0447\u0438\u0441\u043B\u043E: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0431\u044A\u0434\u0435 \u043A\u0440\u0430\u0442\u043D\u043E \u043D\u0430 ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${r.keys.length>1?"\u0438":""} \u043A\u043B\u044E\u0447${r.keys.length>1?"\u043E\u0432\u0435":""}: ${b(r.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ${r.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434";case"invalid_element":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442 \u0432 ${r.origin}`;default:return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434"}}};function bv(){return{localeError:J0()}}var Y0=()=>{let t={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function e(r){return t[r]??null}let n={regex:"entrada",email:"adre\xE7a electr\xF2nica",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\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Tipus inv\xE0lid: s'esperava instanceof ${r.expected}, s'ha rebut ${c}`:`Tipus inv\xE0lid: s'esperava ${o}, s'ha rebut ${c}`}case"invalid_value":return r.values.length===1?`Valor inv\xE0lid: s'esperava ${k(r.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${b(r.values," o ")}`;case"too_big":{let o=r.inclusive?"com a m\xE0xim":"menys de",s=e(r.origin);return s?`Massa gran: s'esperava que ${r.origin??"el valor"} contingu\xE9s ${o} ${r.maximum.toString()} ${s.unit??"elements"}`:`Massa gran: s'esperava que ${r.origin??"el valor"} fos ${o} ${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?"com a m\xEDnim":"m\xE9s de",s=e(r.origin);return s?`Massa petit: s'esperava que ${r.origin} contingu\xE9s ${o} ${r.minimum.toString()} ${s.unit}`:`Massa petit: s'esperava que ${r.origin} fos ${o} ${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${o.prefix}"`:o.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${o.suffix}"`:o.format==="includes"?`Format inv\xE0lid: ha d'incloure "${o.includes}"`:o.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${o.pattern}`:`Format inv\xE0lid per a ${n[o.format]??r.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${r.divisor}`;case"unrecognized_keys":return`Clau${r.keys.length>1?"s":""} no reconeguda${r.keys.length>1?"s":""}: ${b(r.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${r.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${r.origin}`;default:return"Entrada inv\xE0lida"}}};function _v(){return{localeError:Y0()}}var X0=()=>{let t={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"}};function e(r){return t[r]??null}let n={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 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 \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"},i={nan:"NaN",number:"\u010D\xEDslo",string:"\u0159et\u011Bzec",function:"funkce",array:"pole"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${r.expected}, obdr\u017Eeno ${c}`:`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${o}, obdr\u017Eeno ${c}`}case"invalid_value":return r.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${k(r.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${r.origin??"hodnota"} mus\xED m\xEDt ${o}${r.maximum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${r.origin??"hodnota"} mus\xED b\xFDt ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${r.origin??"hodnota"} mus\xED m\xEDt ${o}${r.minimum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${r.origin??"hodnota"} mus\xED b\xFDt ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${o.prefix}"`:o.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${o.suffix}"`:o.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${o.includes}"`:o.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${o.pattern}`:`Neplatn\xFD form\xE1t ${n[o.format]??r.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${r.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${b(r.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${r.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${r.origin}`;default:return"Neplatn\xFD vstup"}}};function yv(){return{localeError:X0()}}var Q0=()=>{let t={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function e(r){return t[r]??null}let n={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\xE6t",date:"ISO-dato",time:"ISO-klokkesl\xE6t",duration:"ISO-varighed",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",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"},i={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"s\xE6t",file:"fil"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Ugyldigt input: forventede instanceof ${r.expected}, fik ${c}`:`Ugyldigt input: forventede ${o}, fik ${c}`}case"invalid_value":return r.values.length===1?`Ugyldig v\xE6rdi: forventede ${k(r.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin),c=i[r.origin]??r.origin;return s?`For stor: forventede ${c??"value"} ${s.verb} ${o} ${r.maximum.toString()} ${s.unit??"elementer"}`:`For stor: forventede ${c??"value"} havde ${o} ${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin),c=i[r.origin]??r.origin;return s?`For lille: forventede ${c} ${s.verb} ${o} ${r.minimum.toString()} ${s.unit}`:`For lille: forventede ${c} havde ${o} ${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Ugyldig streng: skal starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: skal ende med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: skal indeholde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: skal matche m\xF8nsteret ${o.pattern}`:`Ugyldig ${n[o.format]??r.format}`}case"not_multiple_of":return`Ugyldigt tal: skal v\xE6re deleligt med ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${b(r.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8gle i ${r.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig v\xE6rdi i ${r.origin}`;default:return"Ugyldigt input"}}};function vv(){return{localeError:Q0()}}var eO=()=>{let t={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 e(r){return t[r]??null}let n={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"},i={nan:"NaN",number:"Zahl",array:"Array"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Ung\xFCltige Eingabe: erwartet instanceof ${r.expected}, erhalten ${c}`:`Ung\xFCltige Eingabe: erwartet ${o}, erhalten ${c}`}case"invalid_value":return r.values.length===1?`Ung\xFCltige Eingabe: erwartet ${k(r.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Zu gro\xDF: erwartet, dass ${r.origin??"Wert"} ${o}${r.maximum.toString()} ${s.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${r.origin??"Wert"} ${o}${r.maximum.toString()} ist`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Zu klein: erwartet, dass ${r.origin} ${o}${r.minimum.toString()} ${s.unit} hat`:`Zu klein: erwartet, dass ${r.origin} ${o}${r.minimum.toString()} ist`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Ung\xFCltiger String: muss mit "${o.prefix}" beginnen`:o.format==="ends_with"?`Ung\xFCltiger String: muss mit "${o.suffix}" enden`:o.format==="includes"?`Ung\xFCltiger String: muss "${o.includes}" enthalten`:o.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${o.pattern} entsprechen`:`Ung\xFCltig: ${n[o.format]??r.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${r.divisor} sein`;case"unrecognized_keys":return`${r.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${b(r.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${r.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${r.origin}`;default:return"Ung\xFCltige Eingabe"}}};function kv(){return{localeError:eO()}}var tO=()=>{let t={string:{unit:"\u03C7\u03B1\u03C1\u03B1\u03BA\u03C4\u03AE\u03C1\u03B5\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},file:{unit:"bytes",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},array:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},set:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},map:{unit:"\u03BA\u03B1\u03C4\u03B1\u03C7\u03C9\u03C1\u03AE\u03C3\u03B5\u03B9\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"}};function e(r){return t[r]??null}let n={regex:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2",email:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 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 \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1 \u03BA\u03B1\u03B9 \u03CE\u03C1\u03B1",date:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1",time:"ISO \u03CE\u03C1\u03B1",duration:"ISO \u03B4\u03B9\u03AC\u03C1\u03BA\u03B5\u03B9\u03B1",ipv4:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv4",ipv6:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv6",mac:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 MAC",cidrv4:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv4",cidrv6:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv6",base64:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64",base64url:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64url",json_string:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC JSON",e164:"\u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2 E.164",jwt:"JWT",template_literal:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return typeof r.expected=="string"&&/^[A-Z]/.test(r.expected)?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD instanceof ${r.expected}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${c}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${o}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${c}`}case"invalid_value":return r.values.length===1?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${k(r.values[0])}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD \u03AD\u03BD\u03B1 \u03B1\u03C0\u03CC ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${r.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${o}${r.maximum.toString()} ${s.unit??"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1"}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${r.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${r.origin} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${o}${r.minimum.toString()} ${s.unit}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${r.origin} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03BE\u03B5\u03BA\u03B9\u03BD\u03AC \u03BC\u03B5 "${o.prefix}"`:o.format==="ends_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B5\u03BB\u03B5\u03B9\u03CE\u03BD\u03B5\u03B9 \u03BC\u03B5 "${o.suffix}"`:o.format==="includes"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C0\u03B5\u03C1\u03B9\u03AD\u03C7\u03B5\u03B9 "${o.includes}"`:o.format==="regex"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B1\u03B9\u03C1\u03B9\u03AC\u03B6\u03B5\u03B9 \u03BC\u03B5 \u03C4\u03BF \u03BC\u03BF\u03C4\u03AF\u03B2\u03BF ${o.pattern}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF: ${n[o.format]??r.format}`}case"not_multiple_of":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF\u03C2 \u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 \u03C0\u03BF\u03BB\u03BB\u03B1\u03C0\u03BB\u03AC\u03C3\u03B9\u03BF \u03C4\u03BF\u03C5 ${r.divisor}`;case"unrecognized_keys":return`\u0386\u03B3\u03BD\u03C9\u03C3\u03C4${r.keys.length>1?"\u03B1":"\u03BF"} \u03BA\u03BB\u03B5\u03B9\u03B4${r.keys.length>1?"\u03B9\u03AC":"\u03AF"}: ${b(r.keys,", ")}`;case"invalid_key":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF \u03BA\u03BB\u03B5\u03B9\u03B4\u03AF \u03C3\u03C4\u03BF ${r.origin}`;case"invalid_union":return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2";case"invalid_element":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C4\u03B9\u03BC\u03AE \u03C3\u03C4\u03BF ${r.origin}`;default:return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"}}};function Sv(){return{localeError:tO()}}var nO=()=>{let t={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function e(r){return t[r]??null}let n={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"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return`Invalid input: expected ${o}, received ${c}`}case"invalid_value":return r.values.length===1?`Invalid input: expected ${k(r.values[0])}`:`Invalid option: expected one of ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Too big: expected ${r.origin??"value"} to have ${o}${r.maximum.toString()} ${s.unit??"elements"}`:`Too big: expected ${r.origin??"value"} to be ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Too small: expected ${r.origin} to have ${o}${r.minimum.toString()} ${s.unit}`:`Too small: expected ${r.origin} to be ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Invalid string: must start with "${o.prefix}"`:o.format==="ends_with"?`Invalid string: must end with "${o.suffix}"`:o.format==="includes"?`Invalid string: must include "${o.includes}"`:o.format==="regex"?`Invalid string: must match pattern ${o.pattern}`:`Invalid ${n[o.format]??r.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${r.divisor}`;case"unrecognized_keys":return`Unrecognized key${r.keys.length>1?"s":""}: ${b(r.keys,", ")}`;case"invalid_key":return`Invalid key in ${r.origin}`;case"invalid_union":return r.options&&Array.isArray(r.options)&&r.options.length>0?`Invalid discriminator value. Expected ${r.options.map(s=>`'${s}'`).join(" | ")}`:"Invalid input";case"invalid_element":return`Invalid value in ${r.origin}`;default:return"Invalid input"}}};function tu(){return{localeError:nO()}}var rO=()=>{let t={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function e(r){return t[r]??null}let n={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",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\u016Dro",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"},i={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Nevalida enigo: atendi\u011Dis instanceof ${r.expected}, ricevi\u011Dis ${c}`:`Nevalida enigo: atendi\u011Dis ${o}, ricevi\u011Dis ${c}`}case"invalid_value":return r.values.length===1?`Nevalida enigo: atendi\u011Dis ${k(r.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Tro granda: atendi\u011Dis ke ${r.origin??"valoro"} havu ${o}${r.maximum.toString()} ${s.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${r.origin??"valoro"} havu ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Tro malgranda: atendi\u011Dis ke ${r.origin} havu ${o}${r.minimum.toString()} ${s.unit}`:`Tro malgranda: atendi\u011Dis ke ${r.origin} estu ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${o.prefix}"`:o.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${o.suffix}"`:o.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${o.includes}"`:o.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${o.pattern}`:`Nevalida ${n[o.format]??r.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${r.divisor}`;case"unrecognized_keys":return`Nekonata${r.keys.length>1?"j":""} \u015Dlosilo${r.keys.length>1?"j":""}: ${b(r.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${r.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${r.origin}`;default:return"Nevalida enigo"}}};function xv(){return{localeError:rO()}}var iO=()=>{let t={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function e(r){return t[r]??null}let n={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",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\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},i={nan:"NaN",string:"texto",number:"n\xFAmero",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"n\xFAmero grande",symbol:"s\xEDmbolo",undefined:"indefinido",null:"nulo",function:"funci\xF3n",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeraci\xF3n",union:"uni\xF3n",literal:"literal",promise:"promesa",void:"vac\xEDo",never:"nunca",unknown:"desconocido",any:"cualquiera"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Entrada inv\xE1lida: se esperaba instanceof ${r.expected}, recibido ${c}`:`Entrada inv\xE1lida: se esperaba ${o}, recibido ${c}`}case"invalid_value":return r.values.length===1?`Entrada inv\xE1lida: se esperaba ${k(r.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin),c=i[r.origin]??r.origin;return s?`Demasiado grande: se esperaba que ${c??"valor"} tuviera ${o}${r.maximum.toString()} ${s.unit??"elementos"}`:`Demasiado grande: se esperaba que ${c??"valor"} fuera ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin),c=i[r.origin]??r.origin;return s?`Demasiado peque\xF1o: se esperaba que ${c} tuviera ${o}${r.minimum.toString()} ${s.unit}`:`Demasiado peque\xF1o: se esperaba que ${c} fuera ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${o.prefix}"`:o.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${o.suffix}"`:o.format==="includes"?`Cadena inv\xE1lida: debe incluir "${o.includes}"`:o.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${o.pattern}`:`Inv\xE1lido ${n[o.format]??r.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${r.divisor}`;case"unrecognized_keys":return`Llave${r.keys.length>1?"s":""} desconocida${r.keys.length>1?"s":""}: ${b(r.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${i[r.origin]??r.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${i[r.origin]??r.origin}`;default:return"Entrada inv\xE1lida"}}};function Iv(){return{localeError:iO()}}var oO=()=>{let t={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function e(r){return t[r]??null}let n={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"},i={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0622\u0631\u0627\u06CC\u0647"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A instanceof ${r.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${c} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`:`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${o} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${c} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`}case"invalid_value":return r.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${k(r.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${b(r.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${r.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${o}${r.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${r.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${o}${r.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${r.origin} \u0628\u0627\u06CC\u062F ${o}${r.minimum.toString()} ${s.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${r.origin} \u0628\u0627\u06CC\u062F ${o}${r.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${o.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:o.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${o.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:o.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${o.includes}" \u0628\u0627\u0634\u062F`:o.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${o.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${n[o.format]??r.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${r.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${r.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${b(r.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${r.origin}`;case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return`\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${r.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}};function $v(){return{localeError:oO()}}var sO=()=>{let t={string:{unit:"merkki\xE4",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\xE4iv\xE4m\xE4\xE4r\xE4n"}};function e(r){return t[r]??null}let n={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",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\xE4iv\xE4m\xE4\xE4r\xE4",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"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Virheellinen tyyppi: odotettiin instanceof ${r.expected}, oli ${c}`:`Virheellinen tyyppi: odotettiin ${o}, oli ${c}`}case"invalid_value":return r.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${k(r.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Liian suuri: ${s.subject} t\xE4ytyy olla ${o}${r.maximum.toString()} ${s.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Liian pieni: ${s.subject} t\xE4ytyy olla ${o}${r.minimum.toString()} ${s.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${o.prefix}"`:o.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${o.suffix}"`:o.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${o.includes}"`:o.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${o.pattern}`:`Virheellinen ${n[o.format]??r.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${r.divisor} monikerta`;case"unrecognized_keys":return`${r.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${b(r.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\xF6te"}}};function wv(){return{localeError:sO()}}var aO=()=>{let t={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(r){return t[r]??null}let n={regex:"entr\xE9e",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\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},i={string:"cha\xEEne",number:"nombre",int:"entier",boolean:"bool\xE9en",bigint:"grand entier",symbol:"symbole",undefined:"ind\xE9fini",null:"null",never:"jamais",void:"vide",date:"date",array:"tableau",object:"objet",tuple:"tuple",record:"enregistrement",map:"carte",set:"ensemble",file:"fichier",nonoptional:"non-optionnel",nan:"NaN",function:"fonction"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Entr\xE9e invalide : instanceof ${r.expected} attendu, ${c} re\xE7u`:`Entr\xE9e invalide : ${o} attendu, ${c} re\xE7u`}case"invalid_value":return r.values.length===1?`Entr\xE9e invalide : ${k(r.values[0])} attendu`:`Option invalide : une valeur parmi ${b(r.values,"|")} attendue`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Trop grand : ${i[r.origin]??"valeur"} doit ${s.verb} ${o}${r.maximum.toString()} ${s.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${i[r.origin]??"valeur"} doit \xEAtre ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Trop petit : ${i[r.origin]??"valeur"} doit ${s.verb} ${o}${r.minimum.toString()} ${s.unit}`:`Trop petit : ${i[r.origin]??"valeur"} doit \xEAtre ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Cha\xEEne invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${o.pattern}`:`${n[o.format]??r.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${r.divisor}`;case"unrecognized_keys":return`Cl\xE9${r.keys.length>1?"s":""} non reconnue${r.keys.length>1?"s":""} : ${b(r.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${r.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${r.origin}`;default:return"Entr\xE9e invalide"}}};function Ev(){return{localeError:aO()}}var cO=()=>{let t={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(r){return t[r]??null}let n={regex:"entr\xE9e",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\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Entr\xE9e invalide : attendu instanceof ${r.expected}, re\xE7u ${c}`:`Entr\xE9e invalide : attendu ${o}, re\xE7u ${c}`}case"invalid_value":return r.values.length===1?`Entr\xE9e invalide : attendu ${k(r.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"\u2264":"<",s=e(r.origin);return s?`Trop grand : attendu que ${r.origin??"la valeur"} ait ${o}${r.maximum.toString()} ${s.unit}`:`Trop grand : attendu que ${r.origin??"la valeur"} soit ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?"\u2265":">",s=e(r.origin);return s?`Trop petit : attendu que ${r.origin} ait ${o}${r.minimum.toString()} ${s.unit}`:`Trop petit : attendu que ${r.origin} soit ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Cha\xEEne invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${o.pattern}`:`${n[o.format]??r.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${r.divisor}`;case"unrecognized_keys":return`Cl\xE9${r.keys.length>1?"s":""} non reconnue${r.keys.length>1?"s":""} : ${b(r.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${r.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${r.origin}`;default:return"Entr\xE9e invalide"}}};function Tv(){return{localeError:cO()}}var uO=()=>{let t={string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA",gender:"f"},number:{label:"\u05DE\u05E1\u05E4\u05E8",gender:"m"},boolean:{label:"\u05E2\u05E8\u05DA \u05D1\u05D5\u05DC\u05D9\u05D0\u05E0\u05D9",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA",gender:"m"},array:{label:"\u05DE\u05E2\u05E8\u05DA",gender:"m"},object:{label:"\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8",gender:"m"},null:{label:"\u05E2\u05E8\u05DA \u05E8\u05D9\u05E7 (null)",gender:"m"},undefined:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05DE\u05D5\u05D2\u05D3\u05E8 (undefined)",gender:"m"},symbol:{label:"\u05E1\u05D9\u05DE\u05D1\u05D5\u05DC (Symbol)",gender:"m"},function:{label:"\u05E4\u05D5\u05E0\u05E7\u05E6\u05D9\u05D4",gender:"f"},map:{label:"\u05DE\u05E4\u05D4 (Map)",gender:"f"},set:{label:"\u05E7\u05D1\u05D5\u05E6\u05D4 (Set)",gender:"f"},file:{label:"\u05E7\u05D5\u05D1\u05E5",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05D9\u05D3\u05D5\u05E2",gender:"m"},value:{label:"\u05E2\u05E8\u05DA",gender:"m"}},e={string:{unit:"\u05EA\u05D5\u05D5\u05D9\u05DD",shortLabel:"\u05E7\u05E6\u05E8",longLabel:"\u05D0\u05E8\u05D5\u05DA"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},number:{unit:"",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"}},n=d=>d?t[d]:void 0,i=d=>{let l=n(d);return l?l.label:d??t.unknown.label},r=d=>`\u05D4${i(d)}`,o=d=>(n(d)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA",s=d=>d?e[d]??null:null,c={regex:{label:"\u05E7\u05DC\u05D8",gender:"m"},email:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",gender:"f"},url:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",gender:"f"},emoji:{label:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",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:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",gender:"m"},time:{label:"\u05D6\u05DE\u05DF ISO",gender:"m"},duration:{label:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",gender:"m"},ipv4:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",gender:"f"},ipv6:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",gender:"f"},cidrv4:{label:"\u05D8\u05D5\u05D5\u05D7 IPv4",gender:"m"},cidrv6:{label:"\u05D8\u05D5\u05D5\u05D7 IPv6",gender:"m"},base64:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",gender:"f"},base64url:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",gender:"f"},json_string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",gender:"f"},e164:{label:"\u05DE\u05E1\u05E4\u05E8 E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},includes:{label:"\u05E7\u05DC\u05D8",gender:"m"},lowercase:{label:"\u05E7\u05DC\u05D8",gender:"m"},starts_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},uppercase:{label:"\u05E7\u05DC\u05D8",gender:"m"}},u={nan:"NaN"};return d=>{switch(d.code){case"invalid_type":{let l=d.expected,p=u[l??""]??i(l),m=x(d.input),f=u[m]??t[m]?.label??m;return/^[A-Z]/.test(d.expected)?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${d.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${f}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${p}, \u05D4\u05EA\u05E7\u05D1\u05DC ${f}`}case"invalid_value":{if(d.values.length===1)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${k(d.values[0])}`;let l=d.values.map(f=>k(f));if(d.values.length===2)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${l[0]} \u05D0\u05D5 ${l[1]}`;let p=l[l.length-1];return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${l.slice(0,-1).join(", ")} \u05D0\u05D5 ${p}`}case"too_big":{let l=s(d.origin),p=r(d.origin??"value");if(d.origin==="string")return`${l?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${d.maximum.toString()} ${l?.unit??""} ${d.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(d.origin==="number"){let h=d.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${d.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${d.maximum}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${h}`}if(d.origin==="array"||d.origin==="set"){let h=d.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",y=d.inclusive?`${d.maximum} ${l?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${d.maximum} ${l?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${p} ${h} \u05DC\u05D4\u05DB\u05D9\u05DC ${y}`.trim()}let m=d.inclusive?"<=":"<",f=o(d.origin??"value");return l?.unit?`${l.longLabel} \u05DE\u05D3\u05D9: ${p} ${f} ${m}${d.maximum.toString()} ${l.unit}`:`${l?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${p} ${f} ${m}${d.maximum.toString()}`}case"too_small":{let l=s(d.origin),p=r(d.origin??"value");if(d.origin==="string")return`${l?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${d.minimum.toString()} ${l?.unit??""} ${d.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(d.origin==="number"){let h=d.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${d.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${d.minimum}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${h}`}if(d.origin==="array"||d.origin==="set"){let h=d.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(d.minimum===1&&d.inclusive){let v=(d.origin==="set","\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${p} ${h} \u05DC\u05D4\u05DB\u05D9\u05DC ${v}`}let y=d.inclusive?`${d.minimum} ${l?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${d.minimum} ${l?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${p} ${h} \u05DC\u05D4\u05DB\u05D9\u05DC ${y}`.trim()}let m=d.inclusive?">=":">",f=o(d.origin??"value");return l?.unit?`${l.shortLabel} \u05DE\u05D3\u05D9: ${p} ${f} ${m}${d.minimum.toString()} ${l.unit}`:`${l?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${p} ${f} ${m}${d.minimum.toString()}`}case"invalid_format":{let l=d;if(l.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${l.prefix}"`;if(l.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${l.suffix}"`;if(l.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${l.includes}"`;if(l.format==="regex")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${l.pattern}`;let p=c[l.format],m=p?.label??l.format,h=(p?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${m} \u05DC\u05D0 ${h}`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${d.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${d.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${d.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${b(d.keys,", ")}`;case"invalid_key":return"\u05E9\u05D3\u05D4 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8";case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${r(d.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}};function Rv(){return{localeError:uO()}}var lO=()=>{let t={string:{unit:"znakova",verb:"imati"},file:{unit:"bajtova",verb:"imati"},array:{unit:"stavki",verb:"imati"},set:{unit:"stavki",verb:"imati"}};function e(r){return t[r]??null}let n={regex:"unos",email:"email 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:"ISO datum i vrijeme",date:"ISO datum",time:"ISO vrijeme",duration:"ISO trajanje",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"IPv4 raspon",cidrv6:"IPv6 raspon",base64:"base64 kodirani tekst",base64url:"base64url kodirani tekst",json_string:"JSON tekst",e164:"E.164 broj",jwt:"JWT",template_literal:"unos"},i={nan:"NaN",string:"tekst",number:"broj",boolean:"boolean",array:"niz",object:"objekt",set:"skup",file:"datoteka",date:"datum",bigint:"bigint",symbol:"simbol",undefined:"undefined",null:"null",function:"funkcija",map:"mapa"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Neispravan unos: o\u010Dekuje se instanceof ${r.expected}, a primljeno je ${c}`:`Neispravan unos: o\u010Dekuje se ${o}, a primljeno je ${c}`}case"invalid_value":return r.values.length===1?`Neispravna vrijednost: o\u010Dekivano ${k(r.values[0])}`:`Neispravna opcija: o\u010Dekivano jedno od ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin),c=i[r.origin]??r.origin;return s?`Preveliko: o\u010Dekivano da ${c??"vrijednost"} ima ${o}${r.maximum.toString()} ${s.unit??"elemenata"}`:`Preveliko: o\u010Dekivano da ${c??"vrijednost"} bude ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin),c=i[r.origin]??r.origin;return s?`Premalo: o\u010Dekivano da ${c} ima ${o}${r.minimum.toString()} ${s.unit}`:`Premalo: o\u010Dekivano da ${c} bude ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Neispravan tekst: mora zapo\u010Dinjati s "${o.prefix}"`:o.format==="ends_with"?`Neispravan tekst: mora zavr\u0161avati s "${o.suffix}"`:o.format==="includes"?`Neispravan tekst: mora sadr\u017Eavati "${o.includes}"`:o.format==="regex"?`Neispravan tekst: mora odgovarati uzorku ${o.pattern}`:`Neispravna ${n[o.format]??r.format}`}case"not_multiple_of":return`Neispravan broj: mora biti vi\u0161ekratnik od ${r.divisor}`;case"unrecognized_keys":return`Neprepoznat${r.keys.length>1?"i klju\u010Devi":" klju\u010D"}: ${b(r.keys,", ")}`;case"invalid_key":return`Neispravan klju\u010D u ${i[r.origin]??r.origin}`;case"invalid_union":return"Neispravan unos";case"invalid_element":return`Neispravna vrijednost u ${i[r.origin]??r.origin}`;default:return"Neispravan unos"}}};function Ov(){return{localeError:lO()}}var dO=()=>{let t={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function e(r){return t[r]??null}let n={regex:"bemenet",email:"email c\xEDm",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\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"},i={nan:"NaN",number:"sz\xE1m",array:"t\xF6mb"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${r.expected}, a kapott \xE9rt\xE9k ${c}`:`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${o}, a kapott \xE9rt\xE9k ${c}`}case"invalid_value":return r.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${k(r.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`T\xFAl nagy: ${r.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${o}${r.maximum.toString()} ${s.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${r.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${r.origin} m\xE9rete t\xFAl kicsi ${o}${r.minimum.toString()} ${s.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${r.origin} t\xFAl kicsi ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\xC9rv\xE9nytelen string: "${o.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:o.format==="ends_with"?`\xC9rv\xE9nytelen string: "${o.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:o.format==="includes"?`\xC9rv\xE9nytelen string: "${o.includes}" \xE9rt\xE9ket kell tartalmaznia`:o.format==="regex"?`\xC9rv\xE9nytelen string: ${o.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${n[o.format]??r.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${r.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${r.keys.length>1?"s":""}: ${b(r.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${r.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${r.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}};function Pv(){return{localeError:dO()}}function Av(t,e,n){return Math.abs(t)===1?e:n}function Cr(t){if(!t)return"";let e=["\u0561","\u0565","\u0568","\u056B","\u0578","\u0578\u0582","\u0585"],n=t[t.length-1];return t+(e.includes(n)?"\u0576":"\u0568")}var pO=()=>{let t={string:{unit:{one:"\u0576\u0577\u0561\u0576",many:"\u0576\u0577\u0561\u0576\u0576\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},file:{unit:{one:"\u0562\u0561\u0575\u0569",many:"\u0562\u0561\u0575\u0569\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},array:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},set:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"}};function e(r){return t[r]??null}let n={regex:"\u0574\u0578\u0582\u057F\u0584",email:"\u0567\u056C. \u0570\u0561\u057D\u0581\u0565",url:"URL",emoji:"\u0567\u0574\u0578\u057B\u056B",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E \u0587 \u056A\u0561\u0574",date:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E",time:"ISO \u056A\u0561\u0574",duration:"ISO \u057F\u0587\u0578\u0572\u0578\u0582\u0569\u0575\u0578\u0582\u0576",ipv4:"IPv4 \u0570\u0561\u057D\u0581\u0565",ipv6:"IPv6 \u0570\u0561\u057D\u0581\u0565",cidrv4:"IPv4 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",cidrv6:"IPv6 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",base64:"base64 \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",base64url:"base64url \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",json_string:"JSON \u057F\u0578\u0572",e164:"E.164 \u0570\u0561\u0574\u0561\u0580",jwt:"JWT",template_literal:"\u0574\u0578\u0582\u057F\u0584"},i={nan:"NaN",number:"\u0569\u056B\u057E",array:"\u0566\u0561\u0576\u0563\u057E\u0561\u056E"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 instanceof ${r.expected}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${c}`:`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${o}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${c}`}case"invalid_value":return r.values.length===1?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${k(r.values[1])}`:`\u054D\u056D\u0561\u056C \u057F\u0561\u0580\u0562\u0565\u0580\u0561\u056F\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 \u0570\u0565\u057F\u0587\u0575\u0561\u056C\u0576\u0565\u0580\u056B\u0581 \u0574\u0565\u056F\u0568\u055D ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);if(s){let c=Number(r.maximum),u=Av(c,s.unit.one,s.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Cr(r.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${o}${r.maximum.toString()} ${u}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Cr(r.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);if(s){let c=Number(r.minimum),u=Av(c,s.unit.one,s.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Cr(r.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${o}${r.minimum.toString()} ${u}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Cr(r.origin)} \u056C\u056B\u0576\u056B ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057D\u056F\u057D\u057E\u056B "${o.prefix}"-\u0578\u057E`:o.format==="ends_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0561\u057E\u0561\u0580\u057F\u057E\u056B "${o.suffix}"-\u0578\u057E`:o.format==="includes"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057A\u0561\u0580\u0578\u0582\u0576\u0561\u056F\u056B "${o.includes}"`:o.format==="regex"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0570\u0561\u0574\u0561\u057A\u0561\u057F\u0561\u057D\u056D\u0561\u0576\u056B ${o.pattern} \u0571\u0587\u0561\u0579\u0561\u0583\u056B\u0576`:`\u054D\u056D\u0561\u056C ${n[o.format]??r.format}`}case"not_multiple_of":return`\u054D\u056D\u0561\u056C \u0569\u056B\u057E\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0562\u0561\u0566\u0574\u0561\u057A\u0561\u057F\u056B\u056F \u056C\u056B\u0576\u056B ${r.divisor}-\u056B`;case"unrecognized_keys":return`\u0549\u0573\u0561\u0576\u0561\u0579\u057E\u0561\u056E \u0562\u0561\u0576\u0561\u056C\u056B${r.keys.length>1?"\u0576\u0565\u0580":""}. ${b(r.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${Cr(r.origin)}-\u0578\u0582\u0574`;case"invalid_union":return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574";case"invalid_element":return`\u054D\u056D\u0561\u056C \u0561\u0580\u056A\u0565\u0584 ${Cr(r.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}};function Nv(){return{localeError:pO()}}var mO=()=>{let t={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function e(r){return t[r]??null}let n={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"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Input tidak valid: diharapkan instanceof ${r.expected}, diterima ${c}`:`Input tidak valid: diharapkan ${o}, diterima ${c}`}case"invalid_value":return r.values.length===1?`Input tidak valid: diharapkan ${k(r.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Terlalu besar: diharapkan ${r.origin??"value"} memiliki ${o}${r.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: diharapkan ${r.origin??"value"} menjadi ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Terlalu kecil: diharapkan ${r.origin} memiliki ${o}${r.minimum.toString()} ${s.unit}`:`Terlalu kecil: diharapkan ${r.origin} menjadi ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`String tidak valid: harus dimulai dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak valid: harus berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak valid: harus menyertakan "${o.includes}"`:o.format==="regex"?`String tidak valid: harus sesuai pola ${o.pattern}`:`${n[o.format]??r.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${r.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${r.keys.length>1?"s":""}: ${b(r.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${r.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${r.origin}`;default:return"Input tidak valid"}}};function Cv(){return{localeError:mO()}}var fO=()=>{let t={string:{unit:"stafi",verb:"a\xF0 hafa"},file:{unit:"b\xE6ti",verb:"a\xF0 hafa"},array:{unit:"hluti",verb:"a\xF0 hafa"},set:{unit:"hluti",verb:"a\xF0 hafa"}};function e(r){return t[r]??null}let n={regex:"gildi",email:"netfang",url:"vefsl\xF3\xF0",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\xEDmi",date:"ISO dagsetning",time:"ISO t\xEDmi",duration:"ISO t\xEDmalengd",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\xF6lugildi",jwt:"JWT",template_literal:"gildi"},i={nan:"NaN",number:"n\xFAmer",array:"fylki"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Rangt gildi: \xDE\xFA sl\xF3st inn ${c} \xFEar sem \xE1 a\xF0 vera instanceof ${r.expected}`:`Rangt gildi: \xDE\xFA sl\xF3st inn ${c} \xFEar sem \xE1 a\xF0 vera ${o}`}case"invalid_value":return r.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${k(r.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${r.origin??"gildi"} hafi ${o}${r.maximum.toString()} ${s.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${r.origin??"gildi"} s\xE9 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${r.origin} hafi ${o}${r.minimum.toString()} ${s.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${r.origin} s\xE9 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${o.prefix}"`:o.format==="ends_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${o.suffix}"`:o.format==="includes"?`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${o.includes}"`:o.format==="regex"?`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${o.pattern}`:`Rangt ${n[o.format]??r.format}`}case"not_multiple_of":return`R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${r.divisor}`;case"unrecognized_keys":return`\xD3\xFEekkt ${r.keys.length>1?"ir lyklar":"ur lykill"}: ${b(r.keys,", ")}`;case"invalid_key":return`Rangur lykill \xED ${r.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi \xED ${r.origin}`;default:return"Rangt gildi"}}};function zv(){return{localeError:fO()}}var hO=()=>{let t={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function e(r){return t[r]??null}let n={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"},i={nan:"NaN",number:"numero",array:"vettore"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Input non valido: atteso instanceof ${r.expected}, ricevuto ${c}`:`Input non valido: atteso ${o}, ricevuto ${c}`}case"invalid_value":return r.values.length===1?`Input non valido: atteso ${k(r.values[0])}`:`Opzione non valida: atteso uno tra ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Troppo grande: ${r.origin??"valore"} deve avere ${o}${r.maximum.toString()} ${s.unit??"elementi"}`:`Troppo grande: ${r.origin??"valore"} deve essere ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Troppo piccolo: ${r.origin} deve avere ${o}${r.minimum.toString()} ${s.unit}`:`Troppo piccolo: ${r.origin} deve essere ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Stringa non valida: deve iniziare con "${o.prefix}"`:o.format==="ends_with"?`Stringa non valida: deve terminare con "${o.suffix}"`:o.format==="includes"?`Stringa non valida: deve includere "${o.includes}"`:o.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${o.pattern}`:`Input non valido: ${n[o.format]??r.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${r.divisor}`;case"unrecognized_keys":return`Chiav${r.keys.length>1?"i":"e"} non riconosciut${r.keys.length>1?"e":"a"}: ${b(r.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${r.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${r.origin}`;default:return"Input non valido"}}};function Dv(){return{localeError:hO()}}var gO=()=>{let t={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function e(r){return t[r]??null}let n={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"},i={nan:"NaN",number:"\u6570\u5024",array:"\u914D\u5217"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u7121\u52B9\u306A\u5165\u529B: instanceof ${r.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${c}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u5165\u529B: ${o}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${c}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`}case"invalid_value":return r.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${k(r.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${b(r.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let o=r.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",s=e(r.origin);return s?`\u5927\u304D\u3059\u304E\u308B\u5024: ${r.origin??"\u5024"}\u306F${r.maximum.toString()}${s.unit??"\u8981\u7D20"}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${r.origin??"\u5024"}\u306F${r.maximum.toString()}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let o=r.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",s=e(r.origin);return s?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${r.origin}\u306F${r.minimum.toString()}${s.unit}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${r.origin}\u306F${r.minimum.toString()}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${o.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${n[o.format]??r.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${r.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${r.keys.length>1?"\u7FA4":""}: ${b(r.keys,"\u3001")}`;case"invalid_key":return`${r.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${r.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}};function jv(){return{localeError:gO()}}var bO=()=>{let t={string:{unit:"\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},file:{unit:"\u10D1\u10D0\u10D8\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},array:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},set:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"}};function e(r){return t[r]??null}let n={regex:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0",email:"\u10D4\u10DA-\u10E4\u10DD\u10E1\u10E2\u10D8\u10E1 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",url:"URL",emoji:"\u10D4\u10DB\u10DD\u10EF\u10D8",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8-\u10D3\u10E0\u10DD",date:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8",time:"\u10D3\u10E0\u10DD",duration:"\u10EE\u10D0\u10DC\u10D2\u10E0\u10EB\u10DA\u10D8\u10D5\u10DD\u10D1\u10D0",ipv4:"IPv4 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",ipv6:"IPv6 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",cidrv4:"IPv4 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",cidrv6:"IPv6 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",base64:"base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",base64url:"base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",json_string:"JSON \u10D5\u10D4\u10DA\u10D8",e164:"E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"},i={nan:"NaN",number:"\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8",string:"\u10D5\u10D4\u10DA\u10D8",boolean:"\u10D1\u10E3\u10DA\u10D4\u10D0\u10DC\u10D8",function:"\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0",array:"\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 instanceof ${r.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${c}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${o}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${c}`}case"invalid_value":return r.values.length===1?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${k(r.values[0])}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D0\u10E0\u10D8\u10D0\u10DC\u10E2\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8\u10D0 \u10D4\u10E0\u10D7-\u10D4\u10E0\u10D7\u10D8 ${b(r.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${r.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${s.verb} ${o}${r.maximum.toString()} ${s.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${r.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${r.origin} ${s.verb} ${o}${r.minimum.toString()} ${s.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${r.origin} \u10D8\u10E7\u10DD\u10E1 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${o.prefix}"-\u10D8\u10D7`:o.format==="ends_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${o.suffix}"-\u10D8\u10D7`:o.format==="includes"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${o.includes}"-\u10E1`:o.format==="regex"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D4\u10E1\u10D0\u10D1\u10D0\u10DB\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 \u10E8\u10D0\u10D1\u10DA\u10DD\u10DC\u10E1 ${o.pattern}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${n[o.format]??r.format}`}case"not_multiple_of":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E0\u10D8\u10EA\u10EE\u10D5\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10E7\u10DD\u10E1 ${r.divisor}-\u10D8\u10E1 \u10EF\u10D4\u10E0\u10D0\u10D3\u10D8`;case"unrecognized_keys":return`\u10E3\u10EA\u10DC\u10DD\u10D1\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1${r.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8"}: ${b(r.keys,", ")}`;case"invalid_key":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${r.origin}-\u10E8\u10D8`;case"invalid_union":return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0";case"invalid_element":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0 ${r.origin}-\u10E8\u10D8`;default:return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"}}};function Uv(){return{localeError:bO()}}var _O=()=>{let t={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function e(r){return t[r]??null}let n={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"},i={nan:"NaN",number:"\u179B\u17C1\u1781",array:"\u17A2\u17B6\u179A\u17C1 (Array)",null:"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A instanceof ${r.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${c}`:`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${c}`}case"invalid_value":return r.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${k(r.values[0])}`:`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${o} ${r.maximum.toString()} ${s.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${o} ${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin} ${o} ${r.minimum.toString()} ${s.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin} ${o} ${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${o.prefix}"`:o.format==="ends_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${o.suffix}"`:o.format==="includes"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${o.includes}"`:o.format==="regex"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${o.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${n[o.format]??r.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${r.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${b(r.keys,", ")}`;case"invalid_key":return`\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${r.origin}`;case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${r.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}};function nu(){return{localeError:_O()}}function Mv(){return nu()}var yO=()=>{let t={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"}};function e(r){return t[r]??null}let n={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${r.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${c}\uC785\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${o}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${c}\uC785\uB2C8\uB2E4`}case"invalid_value":return r.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${k(r.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${b(r.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let o=r.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",s=o==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",c=e(r.origin),u=c?.unit??"\uC694\uC18C";return c?`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${r.maximum.toString()}${u} ${o}${s}`:`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${r.maximum.toString()} ${o}${s}`}case"too_small":{let o=r.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",s=o==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",c=e(r.origin),u=c?.unit??"\uC694\uC18C";return c?`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${r.minimum.toString()}${u} ${o}${s}`:`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${r.minimum.toString()} ${o}${s}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:o.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:o.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:o.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${o.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${n[o.format]??r.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${r.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${b(r.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${r.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${r.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}};function Lv(){return{localeError:yO()}}var Ao=t=>t.charAt(0).toUpperCase()+t.slice(1);function Zv(t){let e=Math.abs(t),n=e%10,i=e%100;return i>=11&&i<=19||n===0?"many":n===1?"one":"few"}var vO=()=>{let t={string:{unit:{one:"simbolis",few:"simboliai",many:"simboli\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne ilgesn\u0117 kaip",notInclusive:"turi b\u016Bti trumpesn\u0117 kaip"},bigger:{inclusive:"turi b\u016Bti ne trumpesn\u0117 kaip",notInclusive:"turi b\u016Bti ilgesn\u0117 kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"bait\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne didesnis kaip",notInclusive:"turi b\u016Bti ma\u017Eesnis kaip"},bigger:{inclusive:"turi b\u016Bti ne ma\u017Eesnis kaip",notInclusive:"turi b\u016Bti didesnis kaip"}}},array:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}},set:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}}};function e(r,o,s,c){let u=t[r]??null;return u===null?u:{unit:u.unit[o],verb:u.verb[c][s?"inclusive":"notInclusive"]}}let n={regex:"\u012Fvestis",email:"el. pa\u0161to 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\u0117",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 u\u017Ekoduota eilut\u0117",base64url:"base64url u\u017Ekoduota eilut\u0117",json_string:"JSON eilut\u0117",e164:"E.164 numeris",jwt:"JWT",template_literal:"\u012Fvestis"},i={nan:"NaN",number:"skai\u010Dius",bigint:"sveikasis skai\u010Dius",string:"eilut\u0117",boolean:"login\u0117 reik\u0161m\u0117",undefined:"neapibr\u0117\u017Eta reik\u0161m\u0117",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulin\u0117 reik\u0161m\u0117"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Gautas tipas ${c}, o tik\u0117tasi - instanceof ${r.expected}`:`Gautas tipas ${c}, o tik\u0117tasi - ${o}`}case"invalid_value":return r.values.length===1?`Privalo b\u016Bti ${k(r.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${b(r.values,"|")} pasirinkim\u0173`;case"too_big":{let o=i[r.origin]??r.origin,s=e(r.origin,Zv(Number(r.maximum)),r.inclusive??!1,"smaller");if(s?.verb)return`${Ao(o??r.origin??"reik\u0161m\u0117")} ${s.verb} ${r.maximum.toString()} ${s.unit??"element\u0173"}`;let c=r.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${Ao(o??r.origin??"reik\u0161m\u0117")} turi b\u016Bti ${c} ${r.maximum.toString()} ${s?.unit}`}case"too_small":{let o=i[r.origin]??r.origin,s=e(r.origin,Zv(Number(r.minimum)),r.inclusive??!1,"bigger");if(s?.verb)return`${Ao(o??r.origin??"reik\u0161m\u0117")} ${s.verb} ${r.minimum.toString()} ${s.unit??"element\u0173"}`;let c=r.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${Ao(o??r.origin??"reik\u0161m\u0117")} turi b\u016Bti ${c} ${r.minimum.toString()} ${s?.unit}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Eilut\u0117 privalo prasid\u0117ti "${o.prefix}"`:o.format==="ends_with"?`Eilut\u0117 privalo pasibaigti "${o.suffix}"`:o.format==="includes"?`Eilut\u0117 privalo \u012Ftraukti "${o.includes}"`:o.format==="regex"?`Eilut\u0117 privalo atitikti ${o.pattern}`:`Neteisingas ${n[o.format]??r.format}`}case"not_multiple_of":return`Skai\u010Dius privalo b\u016Bti ${r.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpa\u017Eint${r.keys.length>1?"i":"as"} rakt${r.keys.length>1?"ai":"as"}: ${b(r.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let o=i[r.origin]??r.origin;return`${Ao(o??r.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}};function Bv(){return{localeError:vO()}}var kO=()=>{let t={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function e(r){return t[r]??null}let n={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"},i={nan:"NaN",number:"\u0431\u0440\u043E\u0458",array:"\u043D\u0438\u0437\u0430"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 instanceof ${r.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${c}`:`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${c}`}case"invalid_value":return r.values.length===1?`Invalid input: expected ${k(r.values[0])}`:`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${o}${r.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin} \u0434\u0430 \u0438\u043C\u0430 ${o}${r.minimum.toString()} ${s.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${o.prefix}"`:o.format==="ends_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${o.suffix}"`:o.format==="includes"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${o.includes}"`:o.format==="regex"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${o.pattern}`:`Invalid ${n[o.format]??r.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${b(r.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${r.origin}`;case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return`\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${r.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}};function Fv(){return{localeError:kO()}}var SO=()=>{let t={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function e(r){return t[r]??null}let n={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"},i={nan:"NaN",number:"nombor"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Input tidak sah: dijangka instanceof ${r.expected}, diterima ${c}`:`Input tidak sah: dijangka ${o}, diterima ${c}`}case"invalid_value":return r.values.length===1?`Input tidak sah: dijangka ${k(r.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Terlalu besar: dijangka ${r.origin??"nilai"} ${s.verb} ${o}${r.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: dijangka ${r.origin??"nilai"} adalah ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Terlalu kecil: dijangka ${r.origin} ${s.verb} ${o}${r.minimum.toString()} ${s.unit}`:`Terlalu kecil: dijangka ${r.origin} adalah ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`String tidak sah: mesti bermula dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak sah: mesti mengandungi "${o.includes}"`:o.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${o.pattern}`:`${n[o.format]??r.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${r.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${b(r.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${r.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${r.origin}`;default:return"Input tidak sah"}}};function qv(){return{localeError:SO()}}var xO=()=>{let t={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function e(r){return t[r]??null}let n={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"},i={nan:"NaN",number:"getal"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Ongeldige invoer: verwacht instanceof ${r.expected}, ontving ${c}`:`Ongeldige invoer: verwacht ${o}, ontving ${c}`}case"invalid_value":return r.values.length===1?`Ongeldige invoer: verwacht ${k(r.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin),c=r.origin==="date"?"laat":r.origin==="string"?"lang":"groot";return s?`Te ${c}: verwacht dat ${r.origin??"waarde"} ${o}${r.maximum.toString()} ${s.unit??"elementen"} ${s.verb}`:`Te ${c}: verwacht dat ${r.origin??"waarde"} ${o}${r.maximum.toString()} is`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin),c=r.origin==="date"?"vroeg":r.origin==="string"?"kort":"klein";return s?`Te ${c}: verwacht dat ${r.origin} ${o}${r.minimum.toString()} ${s.unit} ${s.verb}`:`Te ${c}: verwacht dat ${r.origin} ${o}${r.minimum.toString()} is`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Ongeldige tekst: moet met "${o.prefix}" beginnen`:o.format==="ends_with"?`Ongeldige tekst: moet op "${o.suffix}" eindigen`:o.format==="includes"?`Ongeldige tekst: moet "${o.includes}" bevatten`:o.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${o.pattern}`:`Ongeldig: ${n[o.format]??r.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${r.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${r.keys.length>1?"s":""}: ${b(r.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${r.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${r.origin}`;default:return"Ongeldige invoer"}}};function Vv(){return{localeError:xO()}}var IO=()=>{let t={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"}};function e(r){return t[r]??null}let n={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\xE5de",ipv6:"IPv6-omr\xE5de",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"},i={nan:"NaN",number:"tall",array:"liste"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Ugyldig input: forventet instanceof ${r.expected}, fikk ${c}`:`Ugyldig input: forventet ${o}, fikk ${c}`}case"invalid_value":return r.values.length===1?`Ugyldig verdi: forventet ${k(r.values[0])}`:`Ugyldig valg: forventet en av ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`For stor(t): forventet ${r.origin??"value"} til \xE5 ha ${o}${r.maximum.toString()} ${s.unit??"elementer"}`:`For stor(t): forventet ${r.origin??"value"} til \xE5 ha ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`For lite(n): forventet ${r.origin} til \xE5 ha ${o}${r.minimum.toString()} ${s.unit}`:`For lite(n): forventet ${r.origin} til \xE5 ha ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${o.pattern}`:`Ugyldig ${n[o.format]??r.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${b(r.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${r.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${r.origin}`;default:return"Ugyldig input"}}};function Hv(){return{localeError:IO()}}var $O=()=>{let t={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function e(r){return t[r]??null}let n={regex:"giren",email:"epostag\xE2h",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\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"},i={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`F\xE2sit giren: umulan instanceof ${r.expected}, al\u0131nan ${c}`:`F\xE2sit giren: umulan ${o}, al\u0131nan ${c}`}case"invalid_value":return r.values.length===1?`F\xE2sit giren: umulan ${k(r.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Fazla b\xFCy\xFCk: ${r.origin??"value"}, ${o}${r.maximum.toString()} ${s.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${r.origin??"value"}, ${o}${r.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Fazla k\xFC\xE7\xFCk: ${r.origin}, ${o}${r.minimum.toString()} ${s.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${r.origin}, ${o}${r.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let o=r;return o.format==="starts_with"?`F\xE2sit metin: "${o.prefix}" ile ba\u015Flamal\u0131.`:o.format==="ends_with"?`F\xE2sit metin: "${o.suffix}" ile bitmeli.`:o.format==="includes"?`F\xE2sit metin: "${o.includes}" ihtiv\xE2 etmeli.`:o.format==="regex"?`F\xE2sit metin: ${o.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${n[o.format]??r.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${r.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${r.keys.length>1?"s":""}: ${b(r.keys,", ")}`;case"invalid_key":return`${r.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${r.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}};function Gv(){return{localeError:$O()}}var wO=()=>{let t={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function e(r){return t[r]??null}let n={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"},i={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0627\u0631\u06D0"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F instanceof ${r.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${c} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`:`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${o} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${c} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`}case"invalid_value":return r.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${k(r.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${b(r.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${r.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${o}${r.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${r.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${o}${r.maximum.toString()} \u0648\u064A`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${r.origin} \u0628\u0627\u06CC\u062F ${o}${r.minimum.toString()} ${s.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${r.origin} \u0628\u0627\u06CC\u062F ${o}${r.minimum.toString()} \u0648\u064A`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${o.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:o.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${o.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:o.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${o.includes}" \u0648\u0644\u0631\u064A`:o.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${o.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${n[o.format]??r.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${r.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${r.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${b(r.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${r.origin} \u06A9\u06D0`;case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return`\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${r.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}};function Kv(){return{localeError:wO()}}var EO=()=>{let t={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"}};function e(r){return t[r]??null}let n={regex:"wyra\u017Cenie",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\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"},i={nan:"NaN",number:"liczba",array:"tablica"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${r.expected}, otrzymano ${c}`:`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${o}, otrzymano ${c}`}case"invalid_value":return r.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${k(r.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${r.maximum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${r.minimum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${o.prefix}"`:o.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${o.suffix}"`:o.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${o.includes}"`:o.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${o.pattern}`:`Nieprawid\u0142ow(y/a/e) ${n[o.format]??r.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${r.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${r.keys.length>1?"s":""}: ${b(r.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${r.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${r.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}};function Wv(){return{localeError:EO()}}var TO=()=>{let t={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function e(r){return t[r]??null}let n={regex:"padr\xE3o",email:"endere\xE7o 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\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o 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\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},i={nan:"NaN",number:"n\xFAmero",null:"nulo"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Tipo inv\xE1lido: esperado instanceof ${r.expected}, recebido ${c}`:`Tipo inv\xE1lido: esperado ${o}, recebido ${c}`}case"invalid_value":return r.values.length===1?`Entrada inv\xE1lida: esperado ${k(r.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Muito grande: esperado que ${r.origin??"valor"} tivesse ${o}${r.maximum.toString()} ${s.unit??"elementos"}`:`Muito grande: esperado que ${r.origin??"valor"} fosse ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Muito pequeno: esperado que ${r.origin} tivesse ${o}${r.minimum.toString()} ${s.unit}`:`Muito pequeno: esperado que ${r.origin} fosse ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${o.prefix}"`:o.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${o.suffix}"`:o.format==="includes"?`Texto inv\xE1lido: deve incluir "${o.includes}"`:o.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${o.pattern}`:`${n[o.format]??r.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${r.divisor}`;case"unrecognized_keys":return`Chave${r.keys.length>1?"s":""} desconhecida${r.keys.length>1?"s":""}: ${b(r.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${r.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${r.origin}`;default:return"Campo inv\xE1lido"}}};function Jv(){return{localeError:TO()}}var RO=()=>{let t={string:{unit:"caractere",verb:"s\u0103 aib\u0103"},file:{unit:"octe\u021Bi",verb:"s\u0103 aib\u0103"},array:{unit:"elemente",verb:"s\u0103 aib\u0103"},set:{unit:"elemente",verb:"s\u0103 aib\u0103"},map:{unit:"intr\u0103ri",verb:"s\u0103 aib\u0103"}};function e(r){return t[r]??null}let n={regex:"intrare",email:"adres\u0103 de 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:"dat\u0103 \u0219i or\u0103 ISO",date:"dat\u0103 ISO",time:"or\u0103 ISO",duration:"durat\u0103 ISO",ipv4:"adres\u0103 IPv4",ipv6:"adres\u0103 IPv6",mac:"adres\u0103 MAC",cidrv4:"interval IPv4",cidrv6:"interval IPv6",base64:"\u0219ir codat base64",base64url:"\u0219ir codat base64url",json_string:"\u0219ir JSON",e164:"num\u0103r E.164",jwt:"JWT",template_literal:"intrare"},i={nan:"NaN",string:"\u0219ir",number:"num\u0103r",boolean:"boolean",function:"func\u021Bie",array:"matrice",object:"obiect",undefined:"nedefinit",symbol:"simbol",bigint:"num\u0103r mare",void:"void",never:"never",map:"hart\u0103",set:"set"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return`Intrare invalid\u0103: a\u0219teptat ${o}, primit ${c}`}case"invalid_value":return r.values.length===1?`Intrare invalid\u0103: a\u0219teptat ${k(r.values[0])}`:`Op\u021Biune invalid\u0103: a\u0219teptat una dintre ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Prea mare: a\u0219teptat ca ${r.origin??"valoarea"} ${s.verb} ${o}${r.maximum.toString()} ${s.unit??"elemente"}`:`Prea mare: a\u0219teptat ca ${r.origin??"valoarea"} s\u0103 fie ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Prea mic: a\u0219teptat ca ${r.origin} ${s.verb} ${o}${r.minimum.toString()} ${s.unit}`:`Prea mic: a\u0219teptat ca ${r.origin} s\u0103 fie ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0218ir invalid: trebuie s\u0103 \xEEnceap\u0103 cu "${o.prefix}"`:o.format==="ends_with"?`\u0218ir invalid: trebuie s\u0103 se termine cu "${o.suffix}"`:o.format==="includes"?`\u0218ir invalid: trebuie s\u0103 includ\u0103 "${o.includes}"`:o.format==="regex"?`\u0218ir invalid: trebuie s\u0103 se potriveasc\u0103 cu modelul ${o.pattern}`:`Format invalid: ${n[o.format]??r.format}`}case"not_multiple_of":return`Num\u0103r invalid: trebuie s\u0103 fie multiplu de ${r.divisor}`;case"unrecognized_keys":return`Chei nerecunoscute: ${b(r.keys,", ")}`;case"invalid_key":return`Cheie invalid\u0103 \xEEn ${r.origin}`;case"invalid_union":return"Intrare invalid\u0103";case"invalid_element":return`Valoare invalid\u0103 \xEEn ${r.origin}`;default:return"Intrare invalid\u0103"}}};function Yv(){return{localeError:RO()}}function Xv(t,e,n,i){let r=Math.abs(t),o=r%10,s=r%100;return s>=11&&s<=19?i:o===1?e:o>=2&&o<=4?n:i}var OO=()=>{let t={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function e(r){return t[r]??null}let n={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0441\u0438\u0432"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C instanceof ${r.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${c}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${o}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${c}`}case"invalid_value":return r.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${k(r.values[0])}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);if(s){let c=Number(r.maximum),u=Xv(c,s.unit.one,s.unit.few,s.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${o}${r.maximum.toString()} ${u}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);if(s){let c=Number(r.minimum),u=Xv(c,s.unit.one,s.unit.few,s.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${r.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${o}${r.minimum.toString()} ${u}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${r.origin} \u0431\u0443\u0434\u0435\u0442 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${o.prefix}"`:o.format==="ends_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${o.suffix}"`:o.format==="includes"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${o.includes}"`:o.format==="regex"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${o.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${n[o.format]??r.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${r.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${r.keys.length>1?"\u0438":""}: ${b(r.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${r.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${r.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}};function Qv(){return{localeError:OO()}}var PO=()=>{let t={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function e(r){return t[r]??null}let n={regex:"vnos",email:"e-po\u0161tni 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 \u010Das",date:"ISO datum",time:"ISO \u010Das",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 \u0161tevilka",jwt:"JWT",template_literal:"vnos"},i={nan:"NaN",number:"\u0161tevilo",array:"tabela"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Neveljaven vnos: pri\u010Dakovano instanceof ${r.expected}, prejeto ${c}`:`Neveljaven vnos: pri\u010Dakovano ${o}, prejeto ${c}`}case"invalid_value":return r.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${k(r.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Preveliko: pri\u010Dakovano, da bo ${r.origin??"vrednost"} imelo ${o}${r.maximum.toString()} ${s.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${r.origin??"vrednost"} ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Premajhno: pri\u010Dakovano, da bo ${r.origin} imelo ${o}${r.minimum.toString()} ${s.unit}`:`Premajhno: pri\u010Dakovano, da bo ${r.origin} ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${o.prefix}"`:o.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${o.suffix}"`:o.format==="includes"?`Neveljaven niz: mora vsebovati "${o.includes}"`:o.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${o.pattern}`:`Neveljaven ${n[o.format]??r.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${r.divisor}`;case"unrecognized_keys":return`Neprepoznan${r.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${b(r.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${r.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${r.origin}`;default:return"Neveljaven vnos"}}};function ek(){return{localeError:PO()}}var AO=()=>{let t={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"}};function e(r){return t[r]??null}let n={regex:"regulj\xE4rt 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\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},i={nan:"NaN",number:"antal",array:"lista"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${r.expected}, fick ${c}`:`Ogiltig inmatning: f\xF6rv\xE4ntat ${o}, fick ${c}`}case"invalid_value":return r.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${k(r.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`F\xF6r stor(t): f\xF6rv\xE4ntade ${r.origin??"v\xE4rdet"} att ha ${o}${r.maximum.toString()} ${s.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${r.origin??"v\xE4rdet"} att ha ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`F\xF6r lite(t): f\xF6rv\xE4ntade ${r.origin??"v\xE4rdet"} att ha ${o}${r.minimum.toString()} ${s.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${r.origin??"v\xE4rdet"} att ha ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${o.prefix}"`:o.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${o.suffix}"`:o.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${o.includes}"`:o.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${o.pattern}"`:`Ogiltig(t) ${n[o.format]??r.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${b(r.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${r.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${r.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}};function tk(){return{localeError:AO()}}var NO=()=>{let t={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function e(r){return t[r]??null}let n={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",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 \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"\u0B8E\u0BA3\u0BCD",array:"\u0B85\u0BA3\u0BBF",null:"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 instanceof ${r.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${c}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${c}`}case"invalid_value":return r.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${k(r.values[0])}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${b(r.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${o}${r.maximum.toString()} ${s.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${o}${r.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r.origin} ${o}${r.minimum.toString()} ${s.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r.origin} ${o}${r.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${o.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${n[o.format]??r.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${r.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${r.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${b(r.keys,", ")}`;case"invalid_key":return`${r.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return`${r.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}};function nk(){return{localeError:NO()}}var CO=()=>{let t={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function e(r){return t[r]??null}let n={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"},i={nan:"NaN",number:"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02",array:"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)",null:"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 instanceof ${r.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${c}`:`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${o} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${c}`}case"invalid_value":return r.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${k(r.values[0])}`:`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",s=e(r.origin);return s?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${r.maximum.toString()} ${s.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",s=e(r.origin);return s?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${r.minimum.toString()} ${s.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${o.prefix}"`:o.format==="ends_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${o.suffix}"`:o.format==="includes"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${o.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:o.format==="regex"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${o.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${n[o.format]??r.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${r.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${b(r.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${r.origin}`;case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return`\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${r.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}};function rk(){return{localeError:CO()}}var zO=()=>{let t={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function e(r){return t[r]??null}let n={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\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"\u015Eablon dizesi"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${r.expected}, al\u0131nan ${c}`:`Ge\xE7ersiz de\u011Fer: beklenen ${o}, al\u0131nan ${c}`}case"invalid_value":return r.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${k(r.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\xC7ok b\xFCy\xFCk: beklenen ${r.origin??"de\u011Fer"} ${o}${r.maximum.toString()} ${s.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${r.origin??"de\u011Fer"} ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\xC7ok k\xFC\xE7\xFCk: beklenen ${r.origin} ${o}${r.minimum.toString()} ${s.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${r.origin} ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Ge\xE7ersiz metin: "${o.prefix}" ile ba\u015Flamal\u0131`:o.format==="ends_with"?`Ge\xE7ersiz metin: "${o.suffix}" ile bitmeli`:o.format==="includes"?`Ge\xE7ersiz metin: "${o.includes}" i\xE7ermeli`:o.format==="regex"?`Ge\xE7ersiz metin: ${o.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${n[o.format]??r.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${r.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${r.keys.length>1?"lar":""}: ${b(r.keys,", ")}`;case"invalid_key":return`${r.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${r.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}};function ik(){return{localeError:zO()}}var DO=()=>{let t={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function e(r){return t[r]??null}let n={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F instanceof ${r.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${c}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${o}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${c}`}case"invalid_value":return r.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${k(r.values[0])}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${s.verb} ${o}${r.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${r.origin} ${s.verb} ${o}${r.minimum.toString()} ${s.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${r.origin} \u0431\u0443\u0434\u0435 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${o.prefix}"`:o.format==="ends_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${o.suffix}"`:o.format==="includes"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${o.includes}"`:o.format==="regex"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${o.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${n[o.format]??r.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${r.keys.length>1?"\u0456":""}: ${b(r.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${r.origin}`;case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${r.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}};function ru(){return{localeError:DO()}}function ok(){return ru()}var jO=()=>{let t={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function e(r){return t[r]??null}let n={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"},i={nan:"NaN",number:"\u0646\u0645\u0628\u0631",array:"\u0622\u0631\u06D2",null:"\u0646\u0644"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: instanceof ${r.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${c} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`:`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${o} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${c} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`}case"invalid_value":return r.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${k(r.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${b(r.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${r.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${o}${r.maximum.toString()} ${s.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${r.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${o}${r.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${r.origin} \u06A9\u06D2 ${o}${r.minimum.toString()} ${s.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${r.origin} \u06A9\u0627 ${o}${r.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${o.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${n[o.format]??r.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${r.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${r.keys.length>1?"\u0632":""}: ${b(r.keys,"\u060C ")}`;case"invalid_key":return`${r.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${r.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}};function sk(){return{localeError:jO()}}var UO=()=>{let t={string:{unit:"belgi",verb:"bo\u2018lishi kerak"},file:{unit:"bayt",verb:"bo\u2018lishi kerak"},array:{unit:"element",verb:"bo\u2018lishi kerak"},set:{unit:"element",verb:"bo\u2018lishi kerak"},map:{unit:"yozuv",verb:"bo\u2018lishi kerak"}};function e(r){return t[r]??null}let n={regex:"kirish",email:"elektron pochta manzili",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 sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},i={nan:"NaN",number:"raqam",array:"massiv"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${r.expected}, qabul qilingan ${c}`:`Noto\u2018g\u2018ri kirish: kutilgan ${o}, qabul qilingan ${c}`}case"invalid_value":return r.values.length===1?`Noto\u2018g\u2018ri kirish: kutilgan ${k(r.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Juda katta: kutilgan ${r.origin??"qiymat"} ${o}${r.maximum.toString()} ${s.unit} ${s.verb}`:`Juda katta: kutilgan ${r.origin??"qiymat"} ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Juda kichik: kutilgan ${r.origin} ${o}${r.minimum.toString()} ${s.unit} ${s.verb}`:`Juda kichik: kutilgan ${r.origin} ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Noto\u2018g\u2018ri satr: "${o.prefix}" bilan boshlanishi kerak`:o.format==="ends_with"?`Noto\u2018g\u2018ri satr: "${o.suffix}" bilan tugashi kerak`:o.format==="includes"?`Noto\u2018g\u2018ri satr: "${o.includes}" ni o\u2018z ichiga olishi kerak`:o.format==="regex"?`Noto\u2018g\u2018ri satr: ${o.pattern} shabloniga mos kelishi kerak`:`Noto\u2018g\u2018ri ${n[o.format]??r.format}`}case"not_multiple_of":return`Noto\u2018g\u2018ri raqam: ${r.divisor} ning karralisi bo\u2018lishi kerak`;case"unrecognized_keys":return`Noma\u2019lum kalit${r.keys.length>1?"lar":""}: ${b(r.keys,", ")}`;case"invalid_key":return`${r.origin} dagi kalit noto\u2018g\u2018ri`;case"invalid_union":return"Noto\u2018g\u2018ri kirish";case"invalid_element":return`${r.origin} da noto\u2018g\u2018ri qiymat`;default:return"Noto\u2018g\u2018ri kirish"}}};function ak(){return{localeError:UO()}}var MO=()=>{let t={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function e(r){return t[r]??null}let n={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 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\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"},i={nan:"NaN",number:"s\u1ED1",array:"m\u1EA3ng"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i instanceof ${r.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${c}`:`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${o}, nh\u1EADn \u0111\u01B0\u1EE3c ${c}`}case"invalid_value":return r.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${k(r.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${r.origin??"gi\xE1 tr\u1ECB"} ${s.verb} ${o}${r.maximum.toString()} ${s.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${r.origin??"gi\xE1 tr\u1ECB"} ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${r.origin} ${s.verb} ${o}${r.minimum.toString()} ${s.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${r.origin} ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${o.prefix}"`:o.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${o.suffix}"`:o.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${o.includes}"`:o.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${o.pattern}`:`${n[o.format]??r.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${r.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${b(r.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${r.origin}`;case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return`Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${r.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}};function ck(){return{localeError:MO()}}var LO=()=>{let t={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"}};function e(r){return t[r]??null}let n={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"},i={nan:"NaN",number:"\u6570\u5B57",array:"\u6570\u7EC4",null:"\u7A7A\u503C(null)"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${r.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${c}`:`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${o}\uFF0C\u5B9E\u9645\u63A5\u6536 ${c}`}case"invalid_value":return r.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${k(r.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${r.origin??"\u503C"} ${o}${r.maximum.toString()} ${s.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${r.origin??"\u503C"} ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${r.origin} ${o}${r.minimum.toString()} ${s.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${r.origin} ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${o.prefix}" \u5F00\u5934`:o.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${o.suffix}" \u7ED3\u5C3E`:o.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${o.includes}"`:o.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${o.pattern}`:`\u65E0\u6548${n[o.format]??r.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${r.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${b(r.keys,", ")}`;case"invalid_key":return`${r.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${r.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}};function uk(){return{localeError:LO()}}var ZO=()=>{let t={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function e(r){return t[r]??null}let n={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",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 \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${r.expected}\uFF0C\u4F46\u6536\u5230 ${c}`:`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${o}\uFF0C\u4F46\u6536\u5230 ${c}`}case"invalid_value":return r.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${k(r.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${r.origin??"\u503C"} \u61C9\u70BA ${o}${r.maximum.toString()} ${s.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${r.origin??"\u503C"} \u61C9\u70BA ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${r.origin} \u61C9\u70BA ${o}${r.minimum.toString()} ${s.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${r.origin} \u61C9\u70BA ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${o.prefix}" \u958B\u982D`:o.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${o.suffix}" \u7D50\u5C3E`:o.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${o.includes}"`:o.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${o.pattern}`:`\u7121\u6548\u7684 ${n[o.format]??r.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${r.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${r.keys.length>1?"\u5011":""}\uFF1A${b(r.keys,"\u3001")}`;case"invalid_key":return`${r.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${r.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}};function lk(){return{localeError:ZO()}}var BO=()=>{let t={string:{unit:"\xE0mi",verb:"n\xED"},file:{unit:"bytes",verb:"n\xED"},array:{unit:"nkan",verb:"n\xED"},set:{unit:"nkan",verb:"n\xED"}};function e(r){return t[r]??null}let n={regex:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9",email:"\xE0d\xEDr\u1EB9\u0301s\xEC \xECm\u1EB9\u0301l\xEC",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:"\xE0k\xF3k\xF2 ISO",date:"\u1ECDj\u1ECD\u0301 ISO",time:"\xE0k\xF3k\xF2 ISO",duration:"\xE0k\xF3k\xF2 t\xF3 p\xE9 ISO",ipv4:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv4",ipv6:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv6",cidrv4:"\xE0gb\xE8gb\xE8 IPv4",cidrv6:"\xE0gb\xE8gb\xE8 IPv6",base64:"\u1ECD\u0300r\u1ECD\u0300 t\xED a k\u1ECD\u0301 n\xED base64",base64url:"\u1ECD\u0300r\u1ECD\u0300 base64url",json_string:"\u1ECD\u0300r\u1ECD\u0300 JSON",e164:"n\u1ECD\u0301mb\xE0 E.164",jwt:"JWT",template_literal:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"},i={nan:"NaN",number:"n\u1ECD\u0301mb\xE0",array:"akop\u1ECD"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi instanceof ${r.expected}, \xE0m\u1ECD\u0300 a r\xED ${c}`:`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${o}, \xE0m\u1ECD\u0300 a r\xED ${c}`}case"invalid_value":return r.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${k(r.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${r.origin??"iye"} ${s.verb} ${o}${r.maximum} ${s.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${o}${r.maximum}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${r.origin} ${s.verb} ${o}${r.minimum} ${s.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${o}${r.minimum}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\u1EB9\u0300r\u1EB9\u0300 p\u1EB9\u0300l\xFA "${o.prefix}"`:o.format==="ends_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${o.suffix}"`:o.format==="includes"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${o.includes}"`:o.format==="regex"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${o.pattern}`:`A\u1E63\xEC\u1E63e: ${n[o.format]??r.format}`}case"not_multiple_of":return`N\u1ECD\u0301mb\xE0 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 j\u1EB9\u0301 \xE8y\xE0 p\xEDp\xEDn ti ${r.divisor}`;case"unrecognized_keys":return`B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${b(r.keys,", ")}`;case"invalid_key":return`B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${r.origin}`;case"invalid_union":return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e";case"invalid_element":return`Iye a\u1E63\xEC\u1E63e n\xEDn\xFA ${r.origin}`;default:return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"}}};function dk(){return{localeError:BO()}}var pk,Nm=Symbol("ZodOutput"),Cm=Symbol("ZodInput"),iu=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...n){let i=n[0];return this._map.set(e,i),i&&typeof i=="object"&&"id"in i&&this._idmap.set(i.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let n=this._map.get(e);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(e),this}get(e){let n=e._zod.parent;if(n){let i={...this.get(n)??{}};delete i.id;let r={...i,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function ou(){return new iu}(pk=globalThis).__zod_globalRegistry??(pk.__zod_globalRegistry=ou());var De=globalThis.__zod_globalRegistry;function su(t,e){return new t({type:"string",...w(e)})}function zm(t,e){return new t({type:"string",coerce:!0,...w(e)})}function No(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...w(e)})}function Dr(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...w(e)})}function Co(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...w(e)})}function zo(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...w(e)})}function Do(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...w(e)})}function jo(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...w(e)})}function jr(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...w(e)})}function Uo(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...w(e)})}function Mo(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...w(e)})}function Lo(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...w(e)})}function Zo(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...w(e)})}function Bo(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...w(e)})}function Fo(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...w(e)})}function qo(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...w(e)})}function Vo(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...w(e)})}function Ho(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...w(e)})}function au(t,e){return new t({type:"string",format:"mac",check:"string_format",abort:!1,...w(e)})}function Go(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...w(e)})}function Ko(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...w(e)})}function Wo(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...w(e)})}function Jo(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...w(e)})}function Yo(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...w(e)})}function Xo(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...w(e)})}var Dm={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function jm(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...w(e)})}function Um(t,e){return new t({type:"string",format:"date",check:"string_format",...w(e)})}function Mm(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...w(e)})}function Lm(t,e){return new t({type:"string",format:"duration",check:"string_format",...w(e)})}function cu(t,e){return new t({type:"number",checks:[],...w(e)})}function Zm(t,e){return new t({type:"number",coerce:!0,checks:[],...w(e)})}function uu(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...w(e)})}function lu(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float32",...w(e)})}function du(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float64",...w(e)})}function pu(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"int32",...w(e)})}function mu(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"uint32",...w(e)})}function fu(t,e){return new t({type:"boolean",...w(e)})}function Bm(t,e){return new t({type:"boolean",coerce:!0,...w(e)})}function hu(t,e){return new t({type:"bigint",...w(e)})}function Fm(t,e){return new t({type:"bigint",coerce:!0,...w(e)})}function gu(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...w(e)})}function bu(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...w(e)})}function _u(t,e){return new t({type:"symbol",...w(e)})}function yu(t,e){return new t({type:"undefined",...w(e)})}function vu(t,e){return new t({type:"null",...w(e)})}function ku(t){return new t({type:"any"})}function Su(t){return new t({type:"unknown"})}function xu(t,e){return new t({type:"never",...w(e)})}function Iu(t,e){return new t({type:"void",...w(e)})}function $u(t,e){return new t({type:"date",...w(e)})}function qm(t,e){return new t({type:"date",coerce:!0,...w(e)})}function wu(t,e){return new t({type:"nan",...w(e)})}function Bt(t,e){return new Ha({check:"less_than",...w(e),value:t,inclusive:!1})}function mt(t,e){return new Ha({check:"less_than",...w(e),value:t,inclusive:!0})}function Ft(t,e){return new Ga({check:"greater_than",...w(e),value:t,inclusive:!1})}function We(t,e){return new Ga({check:"greater_than",...w(e),value:t,inclusive:!0})}function Eu(t){return Ft(0,t)}function Tu(t){return Bt(0,t)}function Ru(t){return mt(0,t)}function Ou(t){return We(0,t)}function kn(t,e){return new sm({check:"multiple_of",...w(e),value:t})}function Sn(t,e){return new um({check:"max_size",...w(e),maximum:t})}function qt(t,e){return new lm({check:"min_size",...w(e),minimum:t})}function Qn(t,e){return new dm({check:"size_equals",...w(e),size:t})}function er(t,e){return new pm({check:"max_length",...w(e),maximum:t})}function nn(t,e){return new mm({check:"min_length",...w(e),minimum:t})}function tr(t,e){return new fm({check:"length_equals",...w(e),length:t})}function Ur(t,e){return new hm({check:"string_format",format:"regex",...w(e),pattern:t})}function Mr(t){return new gm({check:"string_format",format:"lowercase",...w(t)})}function Lr(t){return new bm({check:"string_format",format:"uppercase",...w(t)})}function Zr(t,e){return new _m({check:"string_format",format:"includes",...w(e),includes:t})}function Br(t,e){return new ym({check:"string_format",format:"starts_with",...w(e),prefix:t})}function Fr(t,e){return new vm({check:"string_format",format:"ends_with",...w(e),suffix:t})}function Pu(t,e,n){return new km({check:"property",property:t,schema:e,...w(n)})}function qr(t,e){return new Sm({check:"mime_type",mime:t,...w(e)})}function Rt(t){return new xm({check:"overwrite",tx:t})}function Vr(t){return Rt(e=>e.normalize(t))}function Hr(){return Rt(t=>t.trim())}function Gr(){return Rt(t=>t.toLowerCase())}function Kr(){return Rt(t=>t.toUpperCase())}function Wr(){return Rt(t=>Sp(t))}function Vm(t,e,n){return new t({type:"array",element:e,...w(n)})}function qO(t,e,n){return new t({type:"union",options:e,...w(n)})}function VO(t,e,n){return new t({type:"union",options:e,inclusive:!1,...w(n)})}function HO(t,e,n,i){return new t({type:"union",options:n,discriminator:e,...w(i)})}function GO(t,e,n){return new t({type:"intersection",left:e,right:n})}function KO(t,e,n,i){let r=n instanceof H,o=r?i:n,s=r?n:null;return new t({type:"tuple",items:e,rest:s,...w(o)})}function WO(t,e,n,i){return new t({type:"record",keyType:e,valueType:n,...w(i)})}function JO(t,e,n,i){return new t({type:"map",keyType:e,valueType:n,...w(i)})}function YO(t,e,n){return new t({type:"set",valueType:e,...w(n)})}function XO(t,e,n){let i=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new t({type:"enum",entries:i,...w(n)})}function QO(t,e,n){return new t({type:"enum",entries:e,...w(n)})}function eP(t,e,n){return new t({type:"literal",values:Array.isArray(e)?e:[e],...w(n)})}function Au(t,e){return new t({type:"file",...w(e)})}function tP(t,e){return new t({type:"transform",transform:e})}function nP(t,e){return new t({type:"optional",innerType:e})}function rP(t,e){return new t({type:"nullable",innerType:e})}function iP(t,e,n){return new t({type:"default",innerType:e,get defaultValue(){return typeof n=="function"?n():za(n)}})}function oP(t,e,n){return new t({type:"nonoptional",innerType:e,...w(n)})}function sP(t,e){return new t({type:"success",innerType:e})}function aP(t,e,n){return new t({type:"catch",innerType:e,catchValue:typeof n=="function"?n:()=>n})}function cP(t,e,n){return new t({type:"pipe",in:e,out:n})}function uP(t,e){return new t({type:"readonly",innerType:e})}function lP(t,e,n){return new t({type:"template_literal",parts:e,...w(n)})}function dP(t,e){return new t({type:"lazy",getter:e})}function pP(t,e){return new t({type:"promise",innerType:e})}function Nu(t,e,n){let i=w(n);return i.abort??(i.abort=!0),new t({type:"custom",check:"custom",fn:e,...i})}function Cu(t,e,n){return new t({type:"custom",check:"custom",fn:e,...w(n)})}function zu(t,e){let n=mk(i=>(i.addIssue=r=>{if(typeof r=="string")i.issues.push($r(r,i.value,n._zod.def));else{let o=r;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=i.value),o.inst??(o.inst=n),o.continue??(o.continue=!n._zod.def.abort),i.issues.push($r(o))}},t(i.value,i)),e);return n}function mk(t,e){let n=new he({check:"custom",...w(e)});return n._zod.check=t,n}function Du(t){let e=new he({check:"describe"});return e._zod.onattach=[n=>{let i=De.get(n)??{};De.add(n,{...i,description:t})}],e._zod.check=()=>{},e}function ju(t){let e=new he({check:"meta"});return e._zod.onattach=[n=>{let i=De.get(n)??{};De.add(n,{...i,...t})}],e._zod.check=()=>{},e}function Uu(t,e){let n=w(e),i=n.truthy??["true","1","yes","on","y","enabled"],r=n.falsy??["false","0","no","off","n","disabled"];n.case!=="sensitive"&&(i=i.map(f=>typeof f=="string"?f.toLowerCase():f),r=r.map(f=>typeof f=="string"?f.toLowerCase():f));let o=new Set(i),s=new Set(r),c=t.Codec??Nr,u=t.Boolean??Pr,d=t.String??vn,l=new d({type:"string",error:n.error}),p=new u({type:"boolean",error:n.error}),m=new c({type:"pipe",in:l,out:p,transform:((f,h)=>{let y=f;return n.case!=="sensitive"&&(y=y.toLowerCase()),o.has(y)?!0:s.has(y)?!1:(h.issues.push({code:"invalid_value",expected:"stringbool",values:[...o,...s],input:h.value,inst:m,continue:!1}),{})}),reverseTransform:((f,h)=>f===!0?i[0]||"true":r[0]||"false"),error:n.error});return m}function nr(t,e,n,i={}){let r=w(i),o={...w(i),check:"string_format",type:"string",format:e,fn:typeof n=="function"?n:c=>n.test(c),...r};return n instanceof RegExp&&(o.pattern=n),new t(o)}function xn(t){let e=t?.target??"draft-2020-12";return e==="draft-4"&&(e="draft-04"),e==="draft-7"&&(e="draft-07"),{processors:t.processors??{},metadataRegistry:t?.metadata??De,target:e,unrepresentable:t?.unrepresentable??"throw",override:t?.override??(()=>{}),io:t?.io??"output",counter:0,seen:new Map,cycles:t?.cycles??"ref",reused:t?.reused??"inline",external:t?.external??void 0}}function pe(t,e,n={path:[],schemaPath:[]}){var i;let r=t._zod.def,o=e.seen.get(t);if(o)return o.count++,n.schemaPath.includes(t)&&(o.cycle=n.path),o.schema;let s={schema:{},count:1,cycle:void 0,path:n.path};e.seen.set(t,s);let c=t._zod.toJSONSchema?.();if(c)s.schema=c;else{let l={...n,schemaPath:[...n.schemaPath,t],path:n.path};if(t._zod.processJSONSchema)t._zod.processJSONSchema(e,s.schema,l);else{let m=s.schema,f=e.processors[r.type];if(!f)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${r.type}`);f(t,e,m,l)}let p=t._zod.parent;p&&(s.ref||(s.ref=p),pe(p,e,l),e.seen.get(p).isParent=!0)}let u=e.metadataRegistry.get(t);return u&&Object.assign(s.schema,u),e.io==="input"&&Je(t)&&(delete s.schema.examples,delete s.schema.default),e.io==="input"&&"_prefault"in s.schema&&((i=s.schema).default??(i.default=s.schema._prefault)),delete s.schema._prefault,e.seen.get(t).schema}function In(t,e){let n=t.seen.get(e);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=new Map;for(let s of t.seen.entries()){let c=t.metadataRegistry.get(s[0])?.id;if(c){let u=i.get(c);if(u&&u!==s[0])throw new Error(`Duplicate schema id "${c}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);i.set(c,s[0])}}let r=s=>{let c=t.target==="draft-2020-12"?"$defs":"definitions";if(t.external){let p=t.external.registry.get(s[0])?.id,m=t.external.uri??(h=>h);if(p)return{ref:m(p)};let f=s[1].defId??s[1].schema.id??`schema${t.counter++}`;return s[1].defId=f,{defId:f,ref:`${m("__shared")}#/${c}/${f}`}}if(s[1]===n)return{ref:"#"};let d=`#/${c}/`,l=s[1].schema.id??`__schema${t.counter++}`;return{defId:l,ref:d+l}},o=s=>{if(s[1].schema.$ref)return;let c=s[1],{ref:u,defId:d}=r(s);c.def={...c.schema},d&&(c.defId=d);let l=c.schema;for(let p in l)delete l[p];l.$ref=u};if(t.cycles==="throw")for(let s of t.seen.entries()){let c=s[1];if(c.cycle)throw new Error(`Cycle detected: #/${c.cycle?.join("/")}/<root>
|
|
72
|
+
`)}f.write("payload.value = newResult;"),f.write("return payload;");let z=f.compile();return(R,U)=>z(m,R,U)},o,s=rr,c=!nr.jitless,l=c&&Lp.value,p=e.catchall,d;t._zod.parse=(m,f)=>{d??(d=i.value);let g=m.value;return s(g)?c&&l&&f?.async===!1&&f.jitless!==!0?(o||(o=r(e.shape)),m=o(m,f),p?zv([],g,m,f,d,t):m):n(m,f):(m.issues.push({expected:"object",code:"invalid_type",input:g,inst:t}),m)}});function _v(t,e,n,i){for(let o of t)if(o.issues.length===0)return e.value=o.value,e;let r=t.filter(o=>!vn(o));return r.length===1?(e.value=r[0].value,r[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:n,errors:t.map(o=>o.issues.map(s=>Ye(s,i,Re())))}),e)}var Mr=h("$ZodUnion",(t,e)=>{H.init(t,e),J(t._zod,"optin",()=>e.options.some(i=>i._zod.optin==="optional")?"optional":void 0),J(t._zod,"optout",()=>e.options.some(i=>i._zod.optout==="optional")?"optional":void 0),J(t._zod,"values",()=>{if(e.options.every(i=>i._zod.values))return new Set(e.options.flatMap(i=>Array.from(i._zod.values)))}),J(t._zod,"pattern",()=>{if(e.options.every(i=>i._zod.pattern)){let i=e.options.map(r=>r._zod.pattern);return new RegExp(`^(${i.map(r=>Io(r.source)).join("|")})$`)}});let n=e.options.length===1?e.options[0]._zod.run:null;t._zod.parse=(i,r)=>{if(n)return n(i,r);let o=!1,s=[];for(let c of e.options){let u=c._zod.run({value:i.value,issues:[]},r);if(u instanceof Promise)s.push(u),o=!0;else{if(u.issues.length===0)return u;s.push(u)}}return o?Promise.all(s).then(c=>_v(c,i,t,r)):_v(s,i,t,r)}});function vv(t,e,n,i){let r=t.filter(o=>o.issues.length===0);return r.length===1?(e.value=r[0].value,e):(r.length===0?e.issues.push({code:"invalid_union",input:e.value,inst:n,errors:t.map(o=>o.issues.map(s=>Ye(s,i,Re())))}):e.issues.push({code:"invalid_union",input:e.value,inst:n,errors:[],inclusive:!1}),e)}var Zc=h("$ZodXor",(t,e)=>{Mr.init(t,e),e.inclusive=!1;let n=e.options.length===1?e.options[0]._zod.run:null;t._zod.parse=(i,r)=>{if(n)return n(i,r);let o=!1,s=[];for(let c of e.options){let u=c._zod.run({value:i.value,issues:[]},r);u instanceof Promise?(s.push(u),o=!0):s.push(u)}return o?Promise.all(s).then(c=>vv(c,i,t,r)):vv(s,i,t,r)}}),Bc=h("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,Mr.init(t,e);let n=t._zod.parse;J(t._zod,"propValues",()=>{let r={};for(let o of e.options){let s=o._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(o)}"`);for(let[c,u]of Object.entries(s)){r[c]||(r[c]=new Set);for(let l of u)r[c].add(l)}}return r});let i=Pr(()=>{let r=e.options,o=new Map;for(let s of r){let c=s._zod.propValues?.[e.discriminator];if(!c||c.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(let u of c){if(o.has(u))throw new Error(`Duplicate discriminator value "${String(u)}"`);o.set(u,s)}}return o});t._zod.parse=(r,o)=>{let s=r.value;if(!rr(s))return r.issues.push({code:"invalid_type",expected:"object",input:s,inst:t}),r;let c=i.value.get(s?.[e.discriminator]);return c?c._zod.run(r,o):e.unionFallback||o.direction==="backward"?n(r,o):(r.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,options:Array.from(i.value.keys()),input:s,path:[e.discriminator],inst:t}),r)}}),Fc=h("$ZodIntersection",(t,e)=>{H.init(t,e),t._zod.parse=(n,i)=>{let r=n.value,o=e.left._zod.run({value:r,issues:[]},i),s=e.right._zod.run({value:r,issues:[]},i);return o instanceof Promise||s instanceof Promise?Promise.all([o,s]).then(([u,l])=>kv(n,u,l)):kv(n,o,s)}});function Bm(t,e){if(t===e)return{valid:!0,data:t};if(t instanceof Date&&e instanceof Date&&+t==+e)return{valid:!0,data:t};if(_n(t)&&_n(e)){let n=Object.keys(e),i=Object.keys(t).filter(o=>n.indexOf(o)!==-1),r={...t,...e};for(let o of i){let s=Bm(t[o],e[o]);if(!s.valid)return{valid:!1,mergeErrorPath:[o,...s.mergeErrorPath]};r[o]=s.data}return{valid:!0,data:r}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let i=0;i<t.length;i++){let r=t[i],o=e[i],s=Bm(r,o);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};n.push(s.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function kv(t,e,n){let i=new Map,r;for(let c of e.issues)if(c.code==="unrecognized_keys"){r??(r=c);for(let u of c.keys)i.has(u)||i.set(u,{}),i.get(u).l=!0}else t.issues.push(c);for(let c of n.issues)if(c.code==="unrecognized_keys")for(let u of c.keys)i.has(u)||i.set(u,{}),i.get(u).r=!0;else t.issues.push(c);let o=[...i].filter(([,c])=>c.l&&c.r).map(([c])=>c);if(o.length&&r&&t.issues.push({...r,keys:o}),vn(t))return t;let s=Bm(e.value,n.value);if(!s.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return t.value=s.data,t}var Do=h("$ZodTuple",(t,e)=>{H.init(t,e);let n=e.items;t._zod.parse=(i,r)=>{let o=i.value;if(!Array.isArray(o))return i.issues.push({input:o,inst:t,expected:"tuple",code:"invalid_type"}),i;i.value=[];let s=[],c=Sv(n,"optin"),u=Sv(n,"optout");if(!e.rest){if(o.length<c)return i.issues.push({code:"too_small",minimum:c,inclusive:!0,input:o,inst:t,origin:"array"}),i;o.length>n.length&&i.issues.push({code:"too_big",maximum:n.length,inclusive:!0,input:o,inst:t,origin:"array"})}let l=new Array(n.length);for(let p=0;p<n.length;p++){let d=n[p]._zod.run({value:o[p],issues:[]},r);d instanceof Promise?s.push(d.then(m=>{l[p]=m})):l[p]=d}if(e.rest){let p=n.length-1,d=o.slice(n.length);for(let m of d){p++;let f=e.rest._zod.run({value:m,issues:[]},r);f instanceof Promise?s.push(f.then(g=>xv(g,i,p))):xv(f,i,p)}}return s.length?Promise.all(s).then(()=>Iv(l,i,n,o,u)):Iv(l,i,n,o,u)}});function Sv(t,e){for(let n=t.length-1;n>=0;n--)if(t[n]._zod[e]!=="optional")return n+1;return 0}function xv(t,e,n){t.issues.length&&e.issues.push(...ot(n,t.issues)),e.value[n]=t.value}function Iv(t,e,n,i,r){for(let o=0;o<n.length;o++){let s=t[o],c=o<i.length;if(s.issues.length){if(!c&&o>=r){e.value.length=o;break}e.issues.push(...ot(o,s.issues))}e.value[o]=s.value}for(let o=e.value.length-1;o>=i.length&&(n[o]._zod.optout==="optional"&&e.value[o]===void 0);o--)e.value.length=o;return e}var Vc=h("$ZodRecord",(t,e)=>{H.init(t,e),t._zod.parse=(n,i)=>{let r=n.value;if(!_n(r))return n.issues.push({expected:"record",code:"invalid_type",input:r,inst:t}),n;let o=[],s=e.keyType._zod.values;if(s){n.value={};let c=new Set;for(let l of s)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){c.add(typeof l=="number"?l.toString():l);let p=e.keyType._zod.run({value:l,issues:[]},i);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(p.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:p.issues.map(f=>Ye(f,i,Re())),input:l,path:[l],inst:t});continue}let d=p.value,m=e.valueType._zod.run({value:r[l],issues:[]},i);m instanceof Promise?o.push(m.then(f=>{f.issues.length&&n.issues.push(...ot(l,f.issues)),n.value[d]=f.value})):(m.issues.length&&n.issues.push(...ot(l,m.issues)),n.value[d]=m.value)}let u;for(let l in r)c.has(l)||(u=u??[],u.push(l));u&&u.length>0&&n.issues.push({code:"unrecognized_keys",input:r,inst:t,keys:u})}else{n.value={};for(let c of Reflect.ownKeys(r)){if(c==="__proto__"||!Object.prototype.propertyIsEnumerable.call(r,c))continue;let u=e.keyType._zod.run({value:c,issues:[]},i);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof c=="string"&&tc.test(c)&&u.issues.length){let d=e.keyType._zod.run({value:Number(c),issues:[]},i);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");d.issues.length===0&&(u=d)}if(u.issues.length){e.mode==="loose"?n.value[c]=r[c]:n.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map(d=>Ye(d,i,Re())),input:c,path:[c],inst:t});continue}let p=e.valueType._zod.run({value:r[c],issues:[]},i);p instanceof Promise?o.push(p.then(d=>{d.issues.length&&n.issues.push(...ot(c,d.issues)),n.value[u.value]=d.value})):(p.issues.length&&n.issues.push(...ot(c,p.issues)),n.value[u.value]=p.value)}}return o.length?Promise.all(o).then(()=>n):n}}),qc=h("$ZodMap",(t,e)=>{H.init(t,e),t._zod.parse=(n,i)=>{let r=n.value;if(!(r instanceof Map))return n.issues.push({expected:"map",code:"invalid_type",input:r,inst:t}),n;let o=[];n.value=new Map;for(let[s,c]of r){let u=e.keyType._zod.run({value:s,issues:[]},i),l=e.valueType._zod.run({value:c,issues:[]},i);u instanceof Promise||l instanceof Promise?o.push(Promise.all([u,l]).then(([p,d])=>{$v(p,d,n,s,r,t,i)})):$v(u,l,n,s,r,t,i)}return o.length?Promise.all(o).then(()=>n):n}});function $v(t,e,n,i,r,o,s){t.issues.length&&($o.has(typeof i)?n.issues.push(...ot(i,t.issues)):n.issues.push({code:"invalid_key",origin:"map",input:r,inst:o,issues:t.issues.map(c=>Ye(c,s,Re()))})),e.issues.length&&($o.has(typeof i)?n.issues.push(...ot(i,e.issues)):n.issues.push({origin:"map",code:"invalid_element",input:r,inst:o,key:i,issues:e.issues.map(c=>Ye(c,s,Re()))})),n.value.set(t.value,e.value)}var Hc=h("$ZodSet",(t,e)=>{H.init(t,e),t._zod.parse=(n,i)=>{let r=n.value;if(!(r instanceof Set))return n.issues.push({input:r,inst:t,expected:"set",code:"invalid_type"}),n;let o=[];n.value=new Set;for(let s of r){let c=e.valueType._zod.run({value:s,issues:[]},i);c instanceof Promise?o.push(c.then(u=>wv(u,n))):wv(c,n)}return o.length?Promise.all(o).then(()=>n):n}});function wv(t,e){t.issues.length&&e.issues.push(...t.issues),e.value.add(t.value)}var Kc=h("$ZodEnum",(t,e)=>{H.init(t,e);let n=xo(e.entries),i=new Set(n);t._zod.values=i,t._zod.pattern=new RegExp(`^(${n.filter(r=>$o.has(typeof r)).map(r=>typeof r=="string"?yt(r):r.toString()).join("|")})$`),t._zod.parse=(r,o)=>{let s=r.value;return i.has(s)||r.issues.push({code:"invalid_value",values:n,input:s,inst:t}),r}}),Gc=h("$ZodLiteral",(t,e)=>{if(H.init(t,e),e.values.length===0)throw new Error("Cannot create literal schema with no valid values");let n=new Set(e.values);t._zod.values=n,t._zod.pattern=new RegExp(`^(${e.values.map(i=>typeof i=="string"?yt(i):i?yt(i.toString()):String(i)).join("|")})$`),t._zod.parse=(i,r)=>{let o=i.value;return n.has(o)||i.issues.push({code:"invalid_value",values:e.values,input:o,inst:t}),i}}),Wc=h("$ZodFile",(t,e)=>{H.init(t,e),t._zod.parse=(n,i)=>{let r=n.value;return r instanceof File||n.issues.push({expected:"file",code:"invalid_type",input:r,inst:t}),n}}),Jc=h("$ZodTransform",(t,e)=>{H.init(t,e),t._zod.optin="optional",t._zod.parse=(n,i)=>{if(i.direction==="backward")throw new hn(t.constructor.name);let r=e.transform(n.value,n);if(i.async)return(r instanceof Promise?r:Promise.resolve(r)).then(s=>(n.value=s,n.fallback=!0,n));if(r instanceof Promise)throw new Tt;return n.value=r,n.fallback=!0,n}});function Ev(t,e){return e===void 0&&(t.issues.length||t.fallback)?{issues:[],value:void 0}:t}var jo=h("$ZodOptional",(t,e)=>{H.init(t,e),t._zod.optin="optional",t._zod.optout="optional",J(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),J(t._zod,"pattern",()=>{let n=e.innerType._zod.pattern;return n?new RegExp(`^(${Io(n.source)})?$`):void 0}),t._zod.parse=(n,i)=>{if(e.innerType._zod.optin==="optional"){let r=n.value,o=e.innerType._zod.run(n,i);return o instanceof Promise?o.then(s=>Ev(s,r)):Ev(o,r)}return n.value===void 0?n:e.innerType._zod.run(n,i)}}),Yc=h("$ZodExactOptional",(t,e)=>{jo.init(t,e),J(t._zod,"values",()=>e.innerType._zod.values),J(t._zod,"pattern",()=>e.innerType._zod.pattern),t._zod.parse=(n,i)=>e.innerType._zod.run(n,i)}),Xc=h("$ZodNullable",(t,e)=>{H.init(t,e),J(t._zod,"optin",()=>e.innerType._zod.optin),J(t._zod,"optout",()=>e.innerType._zod.optout),J(t._zod,"pattern",()=>{let n=e.innerType._zod.pattern;return n?new RegExp(`^(${Io(n.source)}|null)$`):void 0}),J(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),t._zod.parse=(n,i)=>n.value===null?n:e.innerType._zod.run(n,i)}),Qc=h("$ZodDefault",(t,e)=>{H.init(t,e),t._zod.optin="optional",J(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(n,i)=>{if(i.direction==="backward")return e.innerType._zod.run(n,i);if(n.value===void 0)return n.value=e.defaultValue,n;let r=e.innerType._zod.run(n,i);return r instanceof Promise?r.then(o=>Tv(o,e)):Tv(r,e)}});function Tv(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}var eu=h("$ZodPrefault",(t,e)=>{H.init(t,e),t._zod.optin="optional",J(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(n,i)=>(i.direction==="backward"||n.value===void 0&&(n.value=e.defaultValue),e.innerType._zod.run(n,i))}),tu=h("$ZodNonOptional",(t,e)=>{H.init(t,e),J(t._zod,"values",()=>{let n=e.innerType._zod.values;return n?new Set([...n].filter(i=>i!==void 0)):void 0}),t._zod.parse=(n,i)=>{let r=e.innerType._zod.run(n,i);return r instanceof Promise?r.then(o=>Rv(o,t)):Rv(r,t)}});function Rv(t,e){return!t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:e}),t}var nu=h("$ZodSuccess",(t,e)=>{H.init(t,e),t._zod.parse=(n,i)=>{if(i.direction==="backward")throw new hn("ZodSuccess");let r=e.innerType._zod.run(n,i);return r instanceof Promise?r.then(o=>(n.value=o.issues.length===0,n)):(n.value=r.issues.length===0,n)}}),ru=h("$ZodCatch",(t,e)=>{H.init(t,e),t._zod.optin="optional",J(t._zod,"optout",()=>e.innerType._zod.optout),J(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(n,i)=>{if(i.direction==="backward")return e.innerType._zod.run(n,i);let r=e.innerType._zod.run(n,i);return r instanceof Promise?r.then(o=>(n.value=o.value,o.issues.length&&(n.value=e.catchValue({...n,error:{issues:o.issues.map(s=>Ye(s,i,Re()))},input:n.value}),n.issues=[],n.fallback=!0),n)):(n.value=r.value,r.issues.length&&(n.value=e.catchValue({...n,error:{issues:r.issues.map(o=>Ye(o,i,Re()))},input:n.value}),n.issues=[],n.fallback=!0),n)}}),iu=h("$ZodNaN",(t,e)=>{H.init(t,e),t._zod.parse=(n,i)=>((typeof n.value!="number"||!Number.isNaN(n.value))&&n.issues.push({input:n.value,inst:t,expected:"nan",code:"invalid_type"}),n)}),Uo=h("$ZodPipe",(t,e)=>{H.init(t,e),J(t._zod,"values",()=>e.in._zod.values),J(t._zod,"optin",()=>e.in._zod.optin),J(t._zod,"optout",()=>e.out._zod.optout),J(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(n,i)=>{if(i.direction==="backward"){let o=e.out._zod.run(n,i);return o instanceof Promise?o.then(s=>ic(s,e.in,i)):ic(o,e.in,i)}let r=e.in._zod.run(n,i);return r instanceof Promise?r.then(o=>ic(o,e.out,i)):ic(r,e.out,i)}});function ic(t,e,n){return t.issues.length?(t.aborted=!0,t):e._zod.run({value:t.value,issues:t.issues,fallback:t.fallback},n)}var Lr=h("$ZodCodec",(t,e)=>{H.init(t,e),J(t._zod,"values",()=>e.in._zod.values),J(t._zod,"optin",()=>e.in._zod.optin),J(t._zod,"optout",()=>e.out._zod.optout),J(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(n,i)=>{if((i.direction||"forward")==="forward"){let o=e.in._zod.run(n,i);return o instanceof Promise?o.then(s=>oc(s,e,i)):oc(o,e,i)}else{let o=e.out._zod.run(n,i);return o instanceof Promise?o.then(s=>oc(s,e,i)):oc(o,e,i)}}});function oc(t,e,n){if(t.issues.length)return t.aborted=!0,t;if((n.direction||"forward")==="forward"){let r=e.transform(t.value,t);return r instanceof Promise?r.then(o=>sc(t,o,e.out,n)):sc(t,r,e.out,n)}else{let r=e.reverseTransform(t.value,t);return r instanceof Promise?r.then(o=>sc(t,o,e.in,n)):sc(t,r,e.in,n)}}function sc(t,e,n,i){return t.issues.length?(t.aborted=!0,t):n._zod.run({value:e,issues:t.issues},i)}var Wm=h("$ZodPreprocess",(t,e)=>{Uo.init(t,e)}),ou=h("$ZodReadonly",(t,e)=>{H.init(t,e),J(t._zod,"propValues",()=>e.innerType._zod.propValues),J(t._zod,"values",()=>e.innerType._zod.values),J(t._zod,"optin",()=>e.innerType?._zod?.optin),J(t._zod,"optout",()=>e.innerType?._zod?.optout),t._zod.parse=(n,i)=>{if(i.direction==="backward")return e.innerType._zod.run(n,i);let r=e.innerType._zod.run(n,i);return r instanceof Promise?r.then(Ov):Ov(r)}});function Ov(t){return t.value=Object.freeze(t.value),t}var su=h("$ZodTemplateLiteral",(t,e)=>{H.init(t,e);let n=[];for(let i of e.parts)if(typeof i=="object"&&i!==null){if(!i._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...i._zod.traits].shift()}`);let r=i._zod.pattern instanceof RegExp?i._zod.pattern.source:i._zod.pattern;if(!r)throw new Error(`Invalid template literal part: ${i._zod.traits}`);let o=r.startsWith("^")?1:0,s=r.endsWith("$")?r.length-1:r.length;n.push(r.slice(o,s))}else if(i===null||Zp.has(typeof i))n.push(yt(`${i}`));else throw new Error(`Invalid template literal part: ${i}`);t._zod.pattern=new RegExp(`^${n.join("")}$`),t._zod.parse=(i,r)=>typeof i.value!="string"?(i.issues.push({input:i.value,inst:t,expected:"string",code:"invalid_type"}),i):(t._zod.pattern.lastIndex=0,t._zod.pattern.test(i.value)||i.issues.push({input:i.value,inst:t,code:"invalid_format",format:e.format??"template_literal",pattern:t._zod.pattern.source}),i)}),au=h("$ZodFunction",(t,e)=>(H.init(t,e),t._def=e,t._zod.def=e,t.implement=n=>{if(typeof n!="function")throw new Error("implement() must be called with a function");return function(...i){let r=t._def.input?ir(t._def.input,i):i,o=Reflect.apply(n,this,r);return t._def.output?ir(t._def.output,o):o}},t.implementAsync=n=>{if(typeof n!="function")throw new Error("implementAsync() must be called with a function");return async function(...i){let r=t._def.input?await or(t._def.input,i):i,o=await Reflect.apply(n,this,r);return t._def.output?await or(t._def.output,o):o}},t._zod.parse=(n,i)=>typeof n.value!="function"?(n.issues.push({code:"invalid_type",expected:"function",input:n.value,inst:t}),n):(t._def.output&&t._def.output._zod.def.type==="promise"?n.value=t.implementAsync(n.value):n.value=t.implement(n.value),n),t.input=(...n)=>{let i=t.constructor;return Array.isArray(n[0])?new i({type:"function",input:new Do({type:"tuple",items:n[0],rest:n[1]}),output:t._def.output}):new i({type:"function",input:n[0],output:t._def.output})},t.output=n=>{let i=t.constructor;return new i({type:"function",input:t._def.input,output:n})},t)),cu=h("$ZodPromise",(t,e)=>{H.init(t,e),t._zod.parse=(n,i)=>Promise.resolve(n.value).then(r=>e.innerType._zod.run({value:r,issues:[]},i))}),uu=h("$ZodLazy",(t,e)=>{H.init(t,e),J(t._zod,"innerType",()=>{let n=e;return n._cachedInner||(n._cachedInner=e.getter()),n._cachedInner}),J(t._zod,"pattern",()=>t._zod.innerType?._zod?.pattern),J(t._zod,"propValues",()=>t._zod.innerType?._zod?.propValues),J(t._zod,"optin",()=>t._zod.innerType?._zod?.optin??void 0),J(t._zod,"optout",()=>t._zod.innerType?._zod?.optout??void 0),t._zod.parse=(n,i)=>t._zod.innerType._zod.run(n,i)}),lu=h("$ZodCustom",(t,e)=>{ge.init(t,e),H.init(t,e),t._zod.parse=(n,i)=>n,t._zod.check=n=>{let i=n.value,r=e.fn(i);if(r instanceof Promise)return r.then(o=>Pv(o,n,i,t));Pv(r,n,i,t)}});function Pv(t,e,n,i){if(!t){let r={code:"custom",input:n,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(r.params=i._zod.def.params),e.issues.push(Ar(r))}}var Br={};nn(Br,{ar:()=>Dv,az:()=>jv,be:()=>Mv,bg:()=>Lv,ca:()=>Zv,cs:()=>Bv,da:()=>Fv,de:()=>Vv,el:()=>qv,en:()=>du,eo:()=>Hv,es:()=>Kv,fa:()=>Gv,fi:()=>Wv,fr:()=>Jv,frCA:()=>Yv,he:()=>Xv,hr:()=>Qv,hu:()=>ek,hy:()=>nk,id:()=>rk,is:()=>ik,it:()=>ok,ja:()=>sk,ka:()=>ak,kh:()=>ck,km:()=>pu,ko:()=>uk,lt:()=>dk,mk:()=>pk,ms:()=>mk,nl:()=>fk,no:()=>gk,ota:()=>hk,pl:()=>yk,ps:()=>bk,pt:()=>_k,ro:()=>vk,ru:()=>Sk,sl:()=>xk,sv:()=>Ik,ta:()=>$k,th:()=>wk,tr:()=>Ek,ua:()=>Tk,uk:()=>mu,ur:()=>Rk,uz:()=>Ok,vi:()=>Pk,yo:()=>Ck,zhCN:()=>Ak,zhTW:()=>Nk});var T0=()=>{let t={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function e(r){return t[r]??null}let n={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=I(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 instanceof ${r.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${c}`:`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${o}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${c}`}case"invalid_value":return r.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${x(r.values[0])}`:`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${r.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${o} ${r.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${r.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${o} ${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${r.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${o} ${r.minimum.toString()} ${s.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${r.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${o} ${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${r.prefix}"`:o.format==="ends_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${o.suffix}"`:o.format==="includes"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${o.includes}"`:o.format==="regex"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${o.pattern}`:`${n[o.format]??r.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${r.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${r.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${r.keys.length>1?"\u0629":""}: ${b(r.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${r.origin}`;case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return`\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${r.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}};function Dv(){return{localeError:T0()}}var R0=()=>{let t={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"}};function e(r){return t[r]??null}let n={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"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=I(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${r.expected}, daxil olan ${c}`:`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${o}, daxil olan ${c}`}case"invalid_value":return r.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${x(r.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${r.origin??"d\u0259y\u0259r"} ${o}${r.maximum.toString()} ${s.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${r.origin??"d\u0259y\u0259r"} ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${r.origin} ${o}${r.minimum.toString()} ${s.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${r.origin} ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${o.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:o.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${o.suffix}" il\u0259 bitm\u0259lidir`:o.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${o.includes}" daxil olmal\u0131d\u0131r`:o.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${o.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${n[o.format]??r.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${r.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${r.keys.length>1?"lar":""}: ${b(r.keys,", ")}`;case"invalid_key":return`${r.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${r.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}};function jv(){return{localeError:R0()}}function Uv(t,e,n,i){let r=Math.abs(t),o=r%10,s=r%100;return s>=11&&s<=19?i:o===1?e:o>=2&&o<=4?n:i}var O0=()=>{let t={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function e(r){return t[r]??null}let n={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"},i={nan:"NaN",number:"\u043B\u0456\u043A",array:"\u043C\u0430\u0441\u0456\u045E"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=I(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F instanceof ${r.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${c}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${o}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${c}`}case"invalid_value":return r.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${x(r.values[0])}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);if(s){let c=Number(r.maximum),u=Uv(c,s.unit.one,s.unit.few,s.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${o}${r.maximum.toString()} ${u}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);if(s){let c=Number(r.minimum),u=Uv(c,s.unit.one,s.unit.few,s.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${r.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${o}${r.minimum.toString()} ${u}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${r.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${o.prefix}"`:o.format==="ends_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${o.suffix}"`:o.format==="includes"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${o.includes}"`:o.format==="regex"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${o.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${n[o.format]??r.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${r.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${b(r.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${r.origin}`;case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${r.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}};function Mv(){return{localeError:O0()}}var P0=()=>{let t={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},file:{unit:"\u0431\u0430\u0439\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"}};function e(r){return t[r]??null}let n={regex:"\u0432\u0445\u043E\u0434",email:"\u0438\u043C\u0435\u0439\u043B \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0436\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u043F\u0440\u043E\u0434\u044A\u043B\u0436\u0438\u0442\u0435\u043B\u043D\u043E\u0441\u0442",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"base64-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",base64url:"base64url-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",json_string:"JSON \u043D\u0438\u0437",e164:"E.164 \u043D\u043E\u043C\u0435\u0440",jwt:"JWT",template_literal:"\u0432\u0445\u043E\u0434"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=I(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D instanceof ${r.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${c}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${o}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${c}`}case"invalid_value":return r.values.length===1?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${x(r.values[0])}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u043E\u043F\u0446\u0438\u044F: \u043E\u0447\u0430\u043A\u0432\u0430\u043D\u043E \u0435\u0434\u043D\u043E \u043E\u0442 ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${r.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${o}${r.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430"}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${r.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${r.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${o}${r.minimum.toString()} ${s.unit}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${r.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;if(o.format==="starts_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u0432\u0430 \u0441 "${o.prefix}"`;if(o.format==="ends_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u0432\u044A\u0440\u0448\u0432\u0430 \u0441 "${o.suffix}"`;if(o.format==="includes")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0432\u043A\u043B\u044E\u0447\u0432\u0430 "${o.includes}"`;if(o.format==="regex")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0441\u044A\u0432\u043F\u0430\u0434\u0430 \u0441 ${o.pattern}`;let s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return o.format==="emoji"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="datetime"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="date"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),o.format==="time"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="duration"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${s} ${n[o.format]??r.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E \u0447\u0438\u0441\u043B\u043E: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0431\u044A\u0434\u0435 \u043A\u0440\u0430\u0442\u043D\u043E \u043D\u0430 ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${r.keys.length>1?"\u0438":""} \u043A\u043B\u044E\u0447${r.keys.length>1?"\u043E\u0432\u0435":""}: ${b(r.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ${r.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434";case"invalid_element":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442 \u0432 ${r.origin}`;default:return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434"}}};function Lv(){return{localeError:P0()}}var A0=()=>{let t={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function e(r){return t[r]??null}let n={regex:"entrada",email:"adre\xE7a electr\xF2nica",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\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=I(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Tipus inv\xE0lid: s'esperava instanceof ${r.expected}, s'ha rebut ${c}`:`Tipus inv\xE0lid: s'esperava ${o}, s'ha rebut ${c}`}case"invalid_value":return r.values.length===1?`Valor inv\xE0lid: s'esperava ${x(r.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${b(r.values," o ")}`;case"too_big":{let o=r.inclusive?"com a m\xE0xim":"menys de",s=e(r.origin);return s?`Massa gran: s'esperava que ${r.origin??"el valor"} contingu\xE9s ${o} ${r.maximum.toString()} ${s.unit??"elements"}`:`Massa gran: s'esperava que ${r.origin??"el valor"} fos ${o} ${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?"com a m\xEDnim":"m\xE9s de",s=e(r.origin);return s?`Massa petit: s'esperava que ${r.origin} contingu\xE9s ${o} ${r.minimum.toString()} ${s.unit}`:`Massa petit: s'esperava que ${r.origin} fos ${o} ${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${o.prefix}"`:o.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${o.suffix}"`:o.format==="includes"?`Format inv\xE0lid: ha d'incloure "${o.includes}"`:o.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${o.pattern}`:`Format inv\xE0lid per a ${n[o.format]??r.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${r.divisor}`;case"unrecognized_keys":return`Clau${r.keys.length>1?"s":""} no reconeguda${r.keys.length>1?"s":""}: ${b(r.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${r.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${r.origin}`;default:return"Entrada inv\xE0lida"}}};function Zv(){return{localeError:A0()}}var N0=()=>{let t={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"}};function e(r){return t[r]??null}let n={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 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 \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"},i={nan:"NaN",number:"\u010D\xEDslo",string:"\u0159et\u011Bzec",function:"funkce",array:"pole"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=I(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${r.expected}, obdr\u017Eeno ${c}`:`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${o}, obdr\u017Eeno ${c}`}case"invalid_value":return r.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${x(r.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${r.origin??"hodnota"} mus\xED m\xEDt ${o}${r.maximum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${r.origin??"hodnota"} mus\xED b\xFDt ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${r.origin??"hodnota"} mus\xED m\xEDt ${o}${r.minimum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${r.origin??"hodnota"} mus\xED b\xFDt ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${o.prefix}"`:o.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${o.suffix}"`:o.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${o.includes}"`:o.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${o.pattern}`:`Neplatn\xFD form\xE1t ${n[o.format]??r.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${r.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${b(r.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${r.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${r.origin}`;default:return"Neplatn\xFD vstup"}}};function Bv(){return{localeError:N0()}}var C0=()=>{let t={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function e(r){return t[r]??null}let n={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\xE6t",date:"ISO-dato",time:"ISO-klokkesl\xE6t",duration:"ISO-varighed",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",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"},i={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"s\xE6t",file:"fil"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=I(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Ugyldigt input: forventede instanceof ${r.expected}, fik ${c}`:`Ugyldigt input: forventede ${o}, fik ${c}`}case"invalid_value":return r.values.length===1?`Ugyldig v\xE6rdi: forventede ${x(r.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin),c=i[r.origin]??r.origin;return s?`For stor: forventede ${c??"value"} ${s.verb} ${o} ${r.maximum.toString()} ${s.unit??"elementer"}`:`For stor: forventede ${c??"value"} havde ${o} ${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin),c=i[r.origin]??r.origin;return s?`For lille: forventede ${c} ${s.verb} ${o} ${r.minimum.toString()} ${s.unit}`:`For lille: forventede ${c} havde ${o} ${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Ugyldig streng: skal starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: skal ende med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: skal indeholde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: skal matche m\xF8nsteret ${o.pattern}`:`Ugyldig ${n[o.format]??r.format}`}case"not_multiple_of":return`Ugyldigt tal: skal v\xE6re deleligt med ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${b(r.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8gle i ${r.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig v\xE6rdi i ${r.origin}`;default:return"Ugyldigt input"}}};function Fv(){return{localeError:C0()}}var z0=()=>{let t={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 e(r){return t[r]??null}let n={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"},i={nan:"NaN",number:"Zahl",array:"Array"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=I(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Ung\xFCltige Eingabe: erwartet instanceof ${r.expected}, erhalten ${c}`:`Ung\xFCltige Eingabe: erwartet ${o}, erhalten ${c}`}case"invalid_value":return r.values.length===1?`Ung\xFCltige Eingabe: erwartet ${x(r.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Zu gro\xDF: erwartet, dass ${r.origin??"Wert"} ${o}${r.maximum.toString()} ${s.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${r.origin??"Wert"} ${o}${r.maximum.toString()} ist`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Zu klein: erwartet, dass ${r.origin} ${o}${r.minimum.toString()} ${s.unit} hat`:`Zu klein: erwartet, dass ${r.origin} ${o}${r.minimum.toString()} ist`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Ung\xFCltiger String: muss mit "${o.prefix}" beginnen`:o.format==="ends_with"?`Ung\xFCltiger String: muss mit "${o.suffix}" enden`:o.format==="includes"?`Ung\xFCltiger String: muss "${o.includes}" enthalten`:o.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${o.pattern} entsprechen`:`Ung\xFCltig: ${n[o.format]??r.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${r.divisor} sein`;case"unrecognized_keys":return`${r.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${b(r.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${r.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${r.origin}`;default:return"Ung\xFCltige Eingabe"}}};function Vv(){return{localeError:z0()}}var D0=()=>{let t={string:{unit:"\u03C7\u03B1\u03C1\u03B1\u03BA\u03C4\u03AE\u03C1\u03B5\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},file:{unit:"bytes",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},array:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},set:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},map:{unit:"\u03BA\u03B1\u03C4\u03B1\u03C7\u03C9\u03C1\u03AE\u03C3\u03B5\u03B9\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"}};function e(r){return t[r]??null}let n={regex:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2",email:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 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 \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1 \u03BA\u03B1\u03B9 \u03CE\u03C1\u03B1",date:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1",time:"ISO \u03CE\u03C1\u03B1",duration:"ISO \u03B4\u03B9\u03AC\u03C1\u03BA\u03B5\u03B9\u03B1",ipv4:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv4",ipv6:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv6",mac:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 MAC",cidrv4:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv4",cidrv6:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv6",base64:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64",base64url:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64url",json_string:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC JSON",e164:"\u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2 E.164",jwt:"JWT",template_literal:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=I(r.input),c=i[s]??s;return typeof r.expected=="string"&&/^[A-Z]/.test(r.expected)?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD instanceof ${r.expected}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${c}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${o}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${c}`}case"invalid_value":return r.values.length===1?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${x(r.values[0])}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD \u03AD\u03BD\u03B1 \u03B1\u03C0\u03CC ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${r.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${o}${r.maximum.toString()} ${s.unit??"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1"}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${r.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${r.origin} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${o}${r.minimum.toString()} ${s.unit}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${r.origin} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03BE\u03B5\u03BA\u03B9\u03BD\u03AC \u03BC\u03B5 "${o.prefix}"`:o.format==="ends_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B5\u03BB\u03B5\u03B9\u03CE\u03BD\u03B5\u03B9 \u03BC\u03B5 "${o.suffix}"`:o.format==="includes"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C0\u03B5\u03C1\u03B9\u03AD\u03C7\u03B5\u03B9 "${o.includes}"`:o.format==="regex"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B1\u03B9\u03C1\u03B9\u03AC\u03B6\u03B5\u03B9 \u03BC\u03B5 \u03C4\u03BF \u03BC\u03BF\u03C4\u03AF\u03B2\u03BF ${o.pattern}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF: ${n[o.format]??r.format}`}case"not_multiple_of":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF\u03C2 \u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 \u03C0\u03BF\u03BB\u03BB\u03B1\u03C0\u03BB\u03AC\u03C3\u03B9\u03BF \u03C4\u03BF\u03C5 ${r.divisor}`;case"unrecognized_keys":return`\u0386\u03B3\u03BD\u03C9\u03C3\u03C4${r.keys.length>1?"\u03B1":"\u03BF"} \u03BA\u03BB\u03B5\u03B9\u03B4${r.keys.length>1?"\u03B9\u03AC":"\u03AF"}: ${b(r.keys,", ")}`;case"invalid_key":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF \u03BA\u03BB\u03B5\u03B9\u03B4\u03AF \u03C3\u03C4\u03BF ${r.origin}`;case"invalid_union":return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2";case"invalid_element":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C4\u03B9\u03BC\u03AE \u03C3\u03C4\u03BF ${r.origin}`;default:return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"}}};function qv(){return{localeError:D0()}}var j0=()=>{let t={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function e(r){return t[r]??null}let n={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"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=I(r.input),c=i[s]??s;return`Invalid input: expected ${o}, received ${c}`}case"invalid_value":return r.values.length===1?`Invalid input: expected ${x(r.values[0])}`:`Invalid option: expected one of ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Too big: expected ${r.origin??"value"} to have ${o}${r.maximum.toString()} ${s.unit??"elements"}`:`Too big: expected ${r.origin??"value"} to be ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Too small: expected ${r.origin} to have ${o}${r.minimum.toString()} ${s.unit}`:`Too small: expected ${r.origin} to be ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Invalid string: must start with "${o.prefix}"`:o.format==="ends_with"?`Invalid string: must end with "${o.suffix}"`:o.format==="includes"?`Invalid string: must include "${o.includes}"`:o.format==="regex"?`Invalid string: must match pattern ${o.pattern}`:`Invalid ${n[o.format]??r.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${r.divisor}`;case"unrecognized_keys":return`Unrecognized key${r.keys.length>1?"s":""}: ${b(r.keys,", ")}`;case"invalid_key":return`Invalid key in ${r.origin}`;case"invalid_union":return r.options&&Array.isArray(r.options)&&r.options.length>0?`Invalid discriminator value. Expected ${r.options.map(s=>`'${s}'`).join(" | ")}`:"Invalid input";case"invalid_element":return`Invalid value in ${r.origin}`;default:return"Invalid input"}}};function du(){return{localeError:j0()}}var U0=()=>{let t={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function e(r){return t[r]??null}let n={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",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\u016Dro",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"},i={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=I(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Nevalida enigo: atendi\u011Dis instanceof ${r.expected}, ricevi\u011Dis ${c}`:`Nevalida enigo: atendi\u011Dis ${o}, ricevi\u011Dis ${c}`}case"invalid_value":return r.values.length===1?`Nevalida enigo: atendi\u011Dis ${x(r.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Tro granda: atendi\u011Dis ke ${r.origin??"valoro"} havu ${o}${r.maximum.toString()} ${s.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${r.origin??"valoro"} havu ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Tro malgranda: atendi\u011Dis ke ${r.origin} havu ${o}${r.minimum.toString()} ${s.unit}`:`Tro malgranda: atendi\u011Dis ke ${r.origin} estu ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${o.prefix}"`:o.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${o.suffix}"`:o.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${o.includes}"`:o.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${o.pattern}`:`Nevalida ${n[o.format]??r.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${r.divisor}`;case"unrecognized_keys":return`Nekonata${r.keys.length>1?"j":""} \u015Dlosilo${r.keys.length>1?"j":""}: ${b(r.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${r.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${r.origin}`;default:return"Nevalida enigo"}}};function Hv(){return{localeError:U0()}}var M0=()=>{let t={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function e(r){return t[r]??null}let n={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",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\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},i={nan:"NaN",string:"texto",number:"n\xFAmero",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"n\xFAmero grande",symbol:"s\xEDmbolo",undefined:"indefinido",null:"nulo",function:"funci\xF3n",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeraci\xF3n",union:"uni\xF3n",literal:"literal",promise:"promesa",void:"vac\xEDo",never:"nunca",unknown:"desconocido",any:"cualquiera"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=I(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Entrada inv\xE1lida: se esperaba instanceof ${r.expected}, recibido ${c}`:`Entrada inv\xE1lida: se esperaba ${o}, recibido ${c}`}case"invalid_value":return r.values.length===1?`Entrada inv\xE1lida: se esperaba ${x(r.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin),c=i[r.origin]??r.origin;return s?`Demasiado grande: se esperaba que ${c??"valor"} tuviera ${o}${r.maximum.toString()} ${s.unit??"elementos"}`:`Demasiado grande: se esperaba que ${c??"valor"} fuera ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin),c=i[r.origin]??r.origin;return s?`Demasiado peque\xF1o: se esperaba que ${c} tuviera ${o}${r.minimum.toString()} ${s.unit}`:`Demasiado peque\xF1o: se esperaba que ${c} fuera ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${o.prefix}"`:o.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${o.suffix}"`:o.format==="includes"?`Cadena inv\xE1lida: debe incluir "${o.includes}"`:o.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${o.pattern}`:`Inv\xE1lido ${n[o.format]??r.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${r.divisor}`;case"unrecognized_keys":return`Llave${r.keys.length>1?"s":""} desconocida${r.keys.length>1?"s":""}: ${b(r.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${i[r.origin]??r.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${i[r.origin]??r.origin}`;default:return"Entrada inv\xE1lida"}}};function Kv(){return{localeError:M0()}}var L0=()=>{let t={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function e(r){return t[r]??null}let n={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"},i={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0622\u0631\u0627\u06CC\u0647"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=I(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A instanceof ${r.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${c} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`:`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${o} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${c} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`}case"invalid_value":return r.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${x(r.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${b(r.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${r.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${o}${r.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${r.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${o}${r.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${r.origin} \u0628\u0627\u06CC\u062F ${o}${r.minimum.toString()} ${s.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${r.origin} \u0628\u0627\u06CC\u062F ${o}${r.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${o.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:o.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${o.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:o.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${o.includes}" \u0628\u0627\u0634\u062F`:o.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${o.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${n[o.format]??r.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${r.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${r.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${b(r.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${r.origin}`;case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return`\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${r.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}};function Gv(){return{localeError:L0()}}var Z0=()=>{let t={string:{unit:"merkki\xE4",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\xE4iv\xE4m\xE4\xE4r\xE4n"}};function e(r){return t[r]??null}let n={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",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\xE4iv\xE4m\xE4\xE4r\xE4",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"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=I(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Virheellinen tyyppi: odotettiin instanceof ${r.expected}, oli ${c}`:`Virheellinen tyyppi: odotettiin ${o}, oli ${c}`}case"invalid_value":return r.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${x(r.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Liian suuri: ${s.subject} t\xE4ytyy olla ${o}${r.maximum.toString()} ${s.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Liian pieni: ${s.subject} t\xE4ytyy olla ${o}${r.minimum.toString()} ${s.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${o.prefix}"`:o.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${o.suffix}"`:o.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${o.includes}"`:o.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${o.pattern}`:`Virheellinen ${n[o.format]??r.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${r.divisor} monikerta`;case"unrecognized_keys":return`${r.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${b(r.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\xF6te"}}};function Wv(){return{localeError:Z0()}}var B0=()=>{let t={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(r){return t[r]??null}let n={regex:"entr\xE9e",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\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},i={string:"cha\xEEne",number:"nombre",int:"entier",boolean:"bool\xE9en",bigint:"grand entier",symbol:"symbole",undefined:"ind\xE9fini",null:"null",never:"jamais",void:"vide",date:"date",array:"tableau",object:"objet",tuple:"tuple",record:"enregistrement",map:"carte",set:"ensemble",file:"fichier",nonoptional:"non-optionnel",nan:"NaN",function:"fonction"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=I(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Entr\xE9e invalide : instanceof ${r.expected} attendu, ${c} re\xE7u`:`Entr\xE9e invalide : ${o} attendu, ${c} re\xE7u`}case"invalid_value":return r.values.length===1?`Entr\xE9e invalide : ${x(r.values[0])} attendu`:`Option invalide : une valeur parmi ${b(r.values,"|")} attendue`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Trop grand : ${i[r.origin]??"valeur"} doit ${s.verb} ${o}${r.maximum.toString()} ${s.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${i[r.origin]??"valeur"} doit \xEAtre ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Trop petit : ${i[r.origin]??"valeur"} doit ${s.verb} ${o}${r.minimum.toString()} ${s.unit}`:`Trop petit : ${i[r.origin]??"valeur"} doit \xEAtre ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Cha\xEEne invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${o.pattern}`:`${n[o.format]??r.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${r.divisor}`;case"unrecognized_keys":return`Cl\xE9${r.keys.length>1?"s":""} non reconnue${r.keys.length>1?"s":""} : ${b(r.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${r.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${r.origin}`;default:return"Entr\xE9e invalide"}}};function Jv(){return{localeError:B0()}}var F0=()=>{let t={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(r){return t[r]??null}let n={regex:"entr\xE9e",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\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=I(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Entr\xE9e invalide : attendu instanceof ${r.expected}, re\xE7u ${c}`:`Entr\xE9e invalide : attendu ${o}, re\xE7u ${c}`}case"invalid_value":return r.values.length===1?`Entr\xE9e invalide : attendu ${x(r.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"\u2264":"<",s=e(r.origin);return s?`Trop grand : attendu que ${r.origin??"la valeur"} ait ${o}${r.maximum.toString()} ${s.unit}`:`Trop grand : attendu que ${r.origin??"la valeur"} soit ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?"\u2265":">",s=e(r.origin);return s?`Trop petit : attendu que ${r.origin} ait ${o}${r.minimum.toString()} ${s.unit}`:`Trop petit : attendu que ${r.origin} soit ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Cha\xEEne invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${o.pattern}`:`${n[o.format]??r.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${r.divisor}`;case"unrecognized_keys":return`Cl\xE9${r.keys.length>1?"s":""} non reconnue${r.keys.length>1?"s":""} : ${b(r.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${r.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${r.origin}`;default:return"Entr\xE9e invalide"}}};function Yv(){return{localeError:F0()}}var V0=()=>{let t={string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA",gender:"f"},number:{label:"\u05DE\u05E1\u05E4\u05E8",gender:"m"},boolean:{label:"\u05E2\u05E8\u05DA \u05D1\u05D5\u05DC\u05D9\u05D0\u05E0\u05D9",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA",gender:"m"},array:{label:"\u05DE\u05E2\u05E8\u05DA",gender:"m"},object:{label:"\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8",gender:"m"},null:{label:"\u05E2\u05E8\u05DA \u05E8\u05D9\u05E7 (null)",gender:"m"},undefined:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05DE\u05D5\u05D2\u05D3\u05E8 (undefined)",gender:"m"},symbol:{label:"\u05E1\u05D9\u05DE\u05D1\u05D5\u05DC (Symbol)",gender:"m"},function:{label:"\u05E4\u05D5\u05E0\u05E7\u05E6\u05D9\u05D4",gender:"f"},map:{label:"\u05DE\u05E4\u05D4 (Map)",gender:"f"},set:{label:"\u05E7\u05D1\u05D5\u05E6\u05D4 (Set)",gender:"f"},file:{label:"\u05E7\u05D5\u05D1\u05E5",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05D9\u05D3\u05D5\u05E2",gender:"m"},value:{label:"\u05E2\u05E8\u05DA",gender:"m"}},e={string:{unit:"\u05EA\u05D5\u05D5\u05D9\u05DD",shortLabel:"\u05E7\u05E6\u05E8",longLabel:"\u05D0\u05E8\u05D5\u05DA"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},number:{unit:"",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"}},n=l=>l?t[l]:void 0,i=l=>{let p=n(l);return p?p.label:l??t.unknown.label},r=l=>`\u05D4${i(l)}`,o=l=>(n(l)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA",s=l=>l?e[l]??null:null,c={regex:{label:"\u05E7\u05DC\u05D8",gender:"m"},email:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",gender:"f"},url:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",gender:"f"},emoji:{label:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",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:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",gender:"m"},time:{label:"\u05D6\u05DE\u05DF ISO",gender:"m"},duration:{label:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",gender:"m"},ipv4:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",gender:"f"},ipv6:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",gender:"f"},cidrv4:{label:"\u05D8\u05D5\u05D5\u05D7 IPv4",gender:"m"},cidrv6:{label:"\u05D8\u05D5\u05D5\u05D7 IPv6",gender:"m"},base64:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",gender:"f"},base64url:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",gender:"f"},json_string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",gender:"f"},e164:{label:"\u05DE\u05E1\u05E4\u05E8 E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},includes:{label:"\u05E7\u05DC\u05D8",gender:"m"},lowercase:{label:"\u05E7\u05DC\u05D8",gender:"m"},starts_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},uppercase:{label:"\u05E7\u05DC\u05D8",gender:"m"}},u={nan:"NaN"};return l=>{switch(l.code){case"invalid_type":{let p=l.expected,d=u[p??""]??i(p),m=I(l.input),f=u[m]??t[m]?.label??m;return/^[A-Z]/.test(l.expected)?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${l.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${f}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${d}, \u05D4\u05EA\u05E7\u05D1\u05DC ${f}`}case"invalid_value":{if(l.values.length===1)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${x(l.values[0])}`;let p=l.values.map(f=>x(f));if(l.values.length===2)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${p[0]} \u05D0\u05D5 ${p[1]}`;let d=p[p.length-1];return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${p.slice(0,-1).join(", ")} \u05D0\u05D5 ${d}`}case"too_big":{let p=s(l.origin),d=r(l.origin??"value");if(l.origin==="string")return`${p?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${l.maximum.toString()} ${p?.unit??""} ${l.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(l.origin==="number"){let g=l.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${l.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${l.maximum}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${g}`}if(l.origin==="array"||l.origin==="set"){let g=l.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",y=l.inclusive?`${l.maximum} ${p?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${l.maximum} ${p?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${d} ${g} \u05DC\u05D4\u05DB\u05D9\u05DC ${y}`.trim()}let m=l.inclusive?"<=":"<",f=o(l.origin??"value");return p?.unit?`${p.longLabel} \u05DE\u05D3\u05D9: ${d} ${f} ${m}${l.maximum.toString()} ${p.unit}`:`${p?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${d} ${f} ${m}${l.maximum.toString()}`}case"too_small":{let p=s(l.origin),d=r(l.origin??"value");if(l.origin==="string")return`${p?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${l.minimum.toString()} ${p?.unit??""} ${l.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(l.origin==="number"){let g=l.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${l.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${l.minimum}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${g}`}if(l.origin==="array"||l.origin==="set"){let g=l.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(l.minimum===1&&l.inclusive){let v=(l.origin==="set","\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} ${g} \u05DC\u05D4\u05DB\u05D9\u05DC ${v}`}let y=l.inclusive?`${l.minimum} ${p?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${l.minimum} ${p?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} ${g} \u05DC\u05D4\u05DB\u05D9\u05DC ${y}`.trim()}let m=l.inclusive?">=":">",f=o(l.origin??"value");return p?.unit?`${p.shortLabel} \u05DE\u05D3\u05D9: ${d} ${f} ${m}${l.minimum.toString()} ${p.unit}`:`${p?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${d} ${f} ${m}${l.minimum.toString()}`}case"invalid_format":{let p=l;if(p.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${p.prefix}"`;if(p.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${p.suffix}"`;if(p.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${p.includes}"`;if(p.format==="regex")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${p.pattern}`;let d=c[p.format],m=d?.label??p.format,g=(d?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${m} \u05DC\u05D0 ${g}`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${l.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${l.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${l.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${b(l.keys,", ")}`;case"invalid_key":return"\u05E9\u05D3\u05D4 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8";case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${r(l.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}};function Xv(){return{localeError:V0()}}var q0=()=>{let t={string:{unit:"znakova",verb:"imati"},file:{unit:"bajtova",verb:"imati"},array:{unit:"stavki",verb:"imati"},set:{unit:"stavki",verb:"imati"}};function e(r){return t[r]??null}let n={regex:"unos",email:"email 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:"ISO datum i vrijeme",date:"ISO datum",time:"ISO vrijeme",duration:"ISO trajanje",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"IPv4 raspon",cidrv6:"IPv6 raspon",base64:"base64 kodirani tekst",base64url:"base64url kodirani tekst",json_string:"JSON tekst",e164:"E.164 broj",jwt:"JWT",template_literal:"unos"},i={nan:"NaN",string:"tekst",number:"broj",boolean:"boolean",array:"niz",object:"objekt",set:"skup",file:"datoteka",date:"datum",bigint:"bigint",symbol:"simbol",undefined:"undefined",null:"null",function:"funkcija",map:"mapa"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=I(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Neispravan unos: o\u010Dekuje se instanceof ${r.expected}, a primljeno je ${c}`:`Neispravan unos: o\u010Dekuje se ${o}, a primljeno je ${c}`}case"invalid_value":return r.values.length===1?`Neispravna vrijednost: o\u010Dekivano ${x(r.values[0])}`:`Neispravna opcija: o\u010Dekivano jedno od ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin),c=i[r.origin]??r.origin;return s?`Preveliko: o\u010Dekivano da ${c??"vrijednost"} ima ${o}${r.maximum.toString()} ${s.unit??"elemenata"}`:`Preveliko: o\u010Dekivano da ${c??"vrijednost"} bude ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin),c=i[r.origin]??r.origin;return s?`Premalo: o\u010Dekivano da ${c} ima ${o}${r.minimum.toString()} ${s.unit}`:`Premalo: o\u010Dekivano da ${c} bude ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Neispravan tekst: mora zapo\u010Dinjati s "${o.prefix}"`:o.format==="ends_with"?`Neispravan tekst: mora zavr\u0161avati s "${o.suffix}"`:o.format==="includes"?`Neispravan tekst: mora sadr\u017Eavati "${o.includes}"`:o.format==="regex"?`Neispravan tekst: mora odgovarati uzorku ${o.pattern}`:`Neispravna ${n[o.format]??r.format}`}case"not_multiple_of":return`Neispravan broj: mora biti vi\u0161ekratnik od ${r.divisor}`;case"unrecognized_keys":return`Neprepoznat${r.keys.length>1?"i klju\u010Devi":" klju\u010D"}: ${b(r.keys,", ")}`;case"invalid_key":return`Neispravan klju\u010D u ${i[r.origin]??r.origin}`;case"invalid_union":return"Neispravan unos";case"invalid_element":return`Neispravna vrijednost u ${i[r.origin]??r.origin}`;default:return"Neispravan unos"}}};function Qv(){return{localeError:q0()}}var H0=()=>{let t={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function e(r){return t[r]??null}let n={regex:"bemenet",email:"email c\xEDm",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\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"},i={nan:"NaN",number:"sz\xE1m",array:"t\xF6mb"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=I(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${r.expected}, a kapott \xE9rt\xE9k ${c}`:`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${o}, a kapott \xE9rt\xE9k ${c}`}case"invalid_value":return r.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${x(r.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`T\xFAl nagy: ${r.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${o}${r.maximum.toString()} ${s.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${r.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${r.origin} m\xE9rete t\xFAl kicsi ${o}${r.minimum.toString()} ${s.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${r.origin} t\xFAl kicsi ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\xC9rv\xE9nytelen string: "${o.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:o.format==="ends_with"?`\xC9rv\xE9nytelen string: "${o.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:o.format==="includes"?`\xC9rv\xE9nytelen string: "${o.includes}" \xE9rt\xE9ket kell tartalmaznia`:o.format==="regex"?`\xC9rv\xE9nytelen string: ${o.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${n[o.format]??r.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${r.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${r.keys.length>1?"s":""}: ${b(r.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${r.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${r.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}};function ek(){return{localeError:H0()}}function tk(t,e,n){return Math.abs(t)===1?e:n}function Zr(t){if(!t)return"";let e=["\u0561","\u0565","\u0568","\u056B","\u0578","\u0578\u0582","\u0585"],n=t[t.length-1];return t+(e.includes(n)?"\u0576":"\u0568")}var K0=()=>{let t={string:{unit:{one:"\u0576\u0577\u0561\u0576",many:"\u0576\u0577\u0561\u0576\u0576\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},file:{unit:{one:"\u0562\u0561\u0575\u0569",many:"\u0562\u0561\u0575\u0569\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},array:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},set:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"}};function e(r){return t[r]??null}let n={regex:"\u0574\u0578\u0582\u057F\u0584",email:"\u0567\u056C. \u0570\u0561\u057D\u0581\u0565",url:"URL",emoji:"\u0567\u0574\u0578\u057B\u056B",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E \u0587 \u056A\u0561\u0574",date:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E",time:"ISO \u056A\u0561\u0574",duration:"ISO \u057F\u0587\u0578\u0572\u0578\u0582\u0569\u0575\u0578\u0582\u0576",ipv4:"IPv4 \u0570\u0561\u057D\u0581\u0565",ipv6:"IPv6 \u0570\u0561\u057D\u0581\u0565",cidrv4:"IPv4 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",cidrv6:"IPv6 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",base64:"base64 \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",base64url:"base64url \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",json_string:"JSON \u057F\u0578\u0572",e164:"E.164 \u0570\u0561\u0574\u0561\u0580",jwt:"JWT",template_literal:"\u0574\u0578\u0582\u057F\u0584"},i={nan:"NaN",number:"\u0569\u056B\u057E",array:"\u0566\u0561\u0576\u0563\u057E\u0561\u056E"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=I(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 instanceof ${r.expected}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${c}`:`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${o}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${c}`}case"invalid_value":return r.values.length===1?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${x(r.values[1])}`:`\u054D\u056D\u0561\u056C \u057F\u0561\u0580\u0562\u0565\u0580\u0561\u056F\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 \u0570\u0565\u057F\u0587\u0575\u0561\u056C\u0576\u0565\u0580\u056B\u0581 \u0574\u0565\u056F\u0568\u055D ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);if(s){let c=Number(r.maximum),u=tk(c,s.unit.one,s.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Zr(r.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${o}${r.maximum.toString()} ${u}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Zr(r.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);if(s){let c=Number(r.minimum),u=tk(c,s.unit.one,s.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Zr(r.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${o}${r.minimum.toString()} ${u}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Zr(r.origin)} \u056C\u056B\u0576\u056B ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057D\u056F\u057D\u057E\u056B "${o.prefix}"-\u0578\u057E`:o.format==="ends_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0561\u057E\u0561\u0580\u057F\u057E\u056B "${o.suffix}"-\u0578\u057E`:o.format==="includes"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057A\u0561\u0580\u0578\u0582\u0576\u0561\u056F\u056B "${o.includes}"`:o.format==="regex"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0570\u0561\u0574\u0561\u057A\u0561\u057F\u0561\u057D\u056D\u0561\u0576\u056B ${o.pattern} \u0571\u0587\u0561\u0579\u0561\u0583\u056B\u0576`:`\u054D\u056D\u0561\u056C ${n[o.format]??r.format}`}case"not_multiple_of":return`\u054D\u056D\u0561\u056C \u0569\u056B\u057E\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0562\u0561\u0566\u0574\u0561\u057A\u0561\u057F\u056B\u056F \u056C\u056B\u0576\u056B ${r.divisor}-\u056B`;case"unrecognized_keys":return`\u0549\u0573\u0561\u0576\u0561\u0579\u057E\u0561\u056E \u0562\u0561\u0576\u0561\u056C\u056B${r.keys.length>1?"\u0576\u0565\u0580":""}. ${b(r.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${Zr(r.origin)}-\u0578\u0582\u0574`;case"invalid_union":return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574";case"invalid_element":return`\u054D\u056D\u0561\u056C \u0561\u0580\u056A\u0565\u0584 ${Zr(r.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}};function nk(){return{localeError:K0()}}var G0=()=>{let t={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function e(r){return t[r]??null}let n={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"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=I(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Input tidak valid: diharapkan instanceof ${r.expected}, diterima ${c}`:`Input tidak valid: diharapkan ${o}, diterima ${c}`}case"invalid_value":return r.values.length===1?`Input tidak valid: diharapkan ${x(r.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Terlalu besar: diharapkan ${r.origin??"value"} memiliki ${o}${r.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: diharapkan ${r.origin??"value"} menjadi ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Terlalu kecil: diharapkan ${r.origin} memiliki ${o}${r.minimum.toString()} ${s.unit}`:`Terlalu kecil: diharapkan ${r.origin} menjadi ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`String tidak valid: harus dimulai dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak valid: harus berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak valid: harus menyertakan "${o.includes}"`:o.format==="regex"?`String tidak valid: harus sesuai pola ${o.pattern}`:`${n[o.format]??r.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${r.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${r.keys.length>1?"s":""}: ${b(r.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${r.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${r.origin}`;default:return"Input tidak valid"}}};function rk(){return{localeError:G0()}}var W0=()=>{let t={string:{unit:"stafi",verb:"a\xF0 hafa"},file:{unit:"b\xE6ti",verb:"a\xF0 hafa"},array:{unit:"hluti",verb:"a\xF0 hafa"},set:{unit:"hluti",verb:"a\xF0 hafa"}};function e(r){return t[r]??null}let n={regex:"gildi",email:"netfang",url:"vefsl\xF3\xF0",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\xEDmi",date:"ISO dagsetning",time:"ISO t\xEDmi",duration:"ISO t\xEDmalengd",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\xF6lugildi",jwt:"JWT",template_literal:"gildi"},i={nan:"NaN",number:"n\xFAmer",array:"fylki"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=I(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Rangt gildi: \xDE\xFA sl\xF3st inn ${c} \xFEar sem \xE1 a\xF0 vera instanceof ${r.expected}`:`Rangt gildi: \xDE\xFA sl\xF3st inn ${c} \xFEar sem \xE1 a\xF0 vera ${o}`}case"invalid_value":return r.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${x(r.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${r.origin??"gildi"} hafi ${o}${r.maximum.toString()} ${s.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${r.origin??"gildi"} s\xE9 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${r.origin} hafi ${o}${r.minimum.toString()} ${s.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${r.origin} s\xE9 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${o.prefix}"`:o.format==="ends_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${o.suffix}"`:o.format==="includes"?`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${o.includes}"`:o.format==="regex"?`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${o.pattern}`:`Rangt ${n[o.format]??r.format}`}case"not_multiple_of":return`R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${r.divisor}`;case"unrecognized_keys":return`\xD3\xFEekkt ${r.keys.length>1?"ir lyklar":"ur lykill"}: ${b(r.keys,", ")}`;case"invalid_key":return`Rangur lykill \xED ${r.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi \xED ${r.origin}`;default:return"Rangt gildi"}}};function ik(){return{localeError:W0()}}var J0=()=>{let t={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function e(r){return t[r]??null}let n={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"},i={nan:"NaN",number:"numero",array:"vettore"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=I(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Input non valido: atteso instanceof ${r.expected}, ricevuto ${c}`:`Input non valido: atteso ${o}, ricevuto ${c}`}case"invalid_value":return r.values.length===1?`Input non valido: atteso ${x(r.values[0])}`:`Opzione non valida: atteso uno tra ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Troppo grande: ${r.origin??"valore"} deve avere ${o}${r.maximum.toString()} ${s.unit??"elementi"}`:`Troppo grande: ${r.origin??"valore"} deve essere ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Troppo piccolo: ${r.origin} deve avere ${o}${r.minimum.toString()} ${s.unit}`:`Troppo piccolo: ${r.origin} deve essere ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Stringa non valida: deve iniziare con "${o.prefix}"`:o.format==="ends_with"?`Stringa non valida: deve terminare con "${o.suffix}"`:o.format==="includes"?`Stringa non valida: deve includere "${o.includes}"`:o.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${o.pattern}`:`Input non valido: ${n[o.format]??r.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${r.divisor}`;case"unrecognized_keys":return`Chiav${r.keys.length>1?"i":"e"} non riconosciut${r.keys.length>1?"e":"a"}: ${b(r.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${r.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${r.origin}`;default:return"Input non valido"}}};function ok(){return{localeError:J0()}}var Y0=()=>{let t={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function e(r){return t[r]??null}let n={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"},i={nan:"NaN",number:"\u6570\u5024",array:"\u914D\u5217"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=I(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u7121\u52B9\u306A\u5165\u529B: instanceof ${r.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${c}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u5165\u529B: ${o}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${c}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`}case"invalid_value":return r.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${x(r.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${b(r.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let o=r.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",s=e(r.origin);return s?`\u5927\u304D\u3059\u304E\u308B\u5024: ${r.origin??"\u5024"}\u306F${r.maximum.toString()}${s.unit??"\u8981\u7D20"}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${r.origin??"\u5024"}\u306F${r.maximum.toString()}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let o=r.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",s=e(r.origin);return s?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${r.origin}\u306F${r.minimum.toString()}${s.unit}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${r.origin}\u306F${r.minimum.toString()}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${o.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${n[o.format]??r.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${r.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${r.keys.length>1?"\u7FA4":""}: ${b(r.keys,"\u3001")}`;case"invalid_key":return`${r.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${r.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}};function sk(){return{localeError:Y0()}}var X0=()=>{let t={string:{unit:"\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},file:{unit:"\u10D1\u10D0\u10D8\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},array:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},set:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"}};function e(r){return t[r]??null}let n={regex:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0",email:"\u10D4\u10DA-\u10E4\u10DD\u10E1\u10E2\u10D8\u10E1 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",url:"URL",emoji:"\u10D4\u10DB\u10DD\u10EF\u10D8",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8-\u10D3\u10E0\u10DD",date:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8",time:"\u10D3\u10E0\u10DD",duration:"\u10EE\u10D0\u10DC\u10D2\u10E0\u10EB\u10DA\u10D8\u10D5\u10DD\u10D1\u10D0",ipv4:"IPv4 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",ipv6:"IPv6 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",cidrv4:"IPv4 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",cidrv6:"IPv6 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",base64:"base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",base64url:"base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",json_string:"JSON \u10D5\u10D4\u10DA\u10D8",e164:"E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"},i={nan:"NaN",number:"\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8",string:"\u10D5\u10D4\u10DA\u10D8",boolean:"\u10D1\u10E3\u10DA\u10D4\u10D0\u10DC\u10D8",function:"\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0",array:"\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=I(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 instanceof ${r.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${c}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${o}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${c}`}case"invalid_value":return r.values.length===1?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${x(r.values[0])}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D0\u10E0\u10D8\u10D0\u10DC\u10E2\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8\u10D0 \u10D4\u10E0\u10D7-\u10D4\u10E0\u10D7\u10D8 ${b(r.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${r.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${s.verb} ${o}${r.maximum.toString()} ${s.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${r.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${r.origin} ${s.verb} ${o}${r.minimum.toString()} ${s.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${r.origin} \u10D8\u10E7\u10DD\u10E1 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${o.prefix}"-\u10D8\u10D7`:o.format==="ends_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${o.suffix}"-\u10D8\u10D7`:o.format==="includes"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${o.includes}"-\u10E1`:o.format==="regex"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D4\u10E1\u10D0\u10D1\u10D0\u10DB\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 \u10E8\u10D0\u10D1\u10DA\u10DD\u10DC\u10E1 ${o.pattern}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${n[o.format]??r.format}`}case"not_multiple_of":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E0\u10D8\u10EA\u10EE\u10D5\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10E7\u10DD\u10E1 ${r.divisor}-\u10D8\u10E1 \u10EF\u10D4\u10E0\u10D0\u10D3\u10D8`;case"unrecognized_keys":return`\u10E3\u10EA\u10DC\u10DD\u10D1\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1${r.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8"}: ${b(r.keys,", ")}`;case"invalid_key":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${r.origin}-\u10E8\u10D8`;case"invalid_union":return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0";case"invalid_element":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0 ${r.origin}-\u10E8\u10D8`;default:return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"}}};function ak(){return{localeError:X0()}}var Q0=()=>{let t={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function e(r){return t[r]??null}let n={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"},i={nan:"NaN",number:"\u179B\u17C1\u1781",array:"\u17A2\u17B6\u179A\u17C1 (Array)",null:"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=I(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A instanceof ${r.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${c}`:`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${c}`}case"invalid_value":return r.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${x(r.values[0])}`:`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${o} ${r.maximum.toString()} ${s.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${o} ${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin} ${o} ${r.minimum.toString()} ${s.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin} ${o} ${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${o.prefix}"`:o.format==="ends_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${o.suffix}"`:o.format==="includes"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${o.includes}"`:o.format==="regex"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${o.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${n[o.format]??r.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${r.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${b(r.keys,", ")}`;case"invalid_key":return`\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${r.origin}`;case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${r.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}};function pu(){return{localeError:Q0()}}function ck(){return pu()}var eP=()=>{let t={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"}};function e(r){return t[r]??null}let n={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=I(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${r.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${c}\uC785\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${o}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${c}\uC785\uB2C8\uB2E4`}case"invalid_value":return r.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${x(r.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${b(r.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let o=r.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",s=o==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",c=e(r.origin),u=c?.unit??"\uC694\uC18C";return c?`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${r.maximum.toString()}${u} ${o}${s}`:`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${r.maximum.toString()} ${o}${s}`}case"too_small":{let o=r.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",s=o==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",c=e(r.origin),u=c?.unit??"\uC694\uC18C";return c?`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${r.minimum.toString()}${u} ${o}${s}`:`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${r.minimum.toString()} ${o}${s}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:o.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:o.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:o.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${o.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${n[o.format]??r.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${r.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${b(r.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${r.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${r.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}};function uk(){return{localeError:eP()}}var Mo=t=>t.charAt(0).toUpperCase()+t.slice(1);function lk(t){let e=Math.abs(t),n=e%10,i=e%100;return i>=11&&i<=19||n===0?"many":n===1?"one":"few"}var tP=()=>{let t={string:{unit:{one:"simbolis",few:"simboliai",many:"simboli\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne ilgesn\u0117 kaip",notInclusive:"turi b\u016Bti trumpesn\u0117 kaip"},bigger:{inclusive:"turi b\u016Bti ne trumpesn\u0117 kaip",notInclusive:"turi b\u016Bti ilgesn\u0117 kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"bait\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne didesnis kaip",notInclusive:"turi b\u016Bti ma\u017Eesnis kaip"},bigger:{inclusive:"turi b\u016Bti ne ma\u017Eesnis kaip",notInclusive:"turi b\u016Bti didesnis kaip"}}},array:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}},set:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}}};function e(r,o,s,c){let u=t[r]??null;return u===null?u:{unit:u.unit[o],verb:u.verb[c][s?"inclusive":"notInclusive"]}}let n={regex:"\u012Fvestis",email:"el. pa\u0161to 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\u0117",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 u\u017Ekoduota eilut\u0117",base64url:"base64url u\u017Ekoduota eilut\u0117",json_string:"JSON eilut\u0117",e164:"E.164 numeris",jwt:"JWT",template_literal:"\u012Fvestis"},i={nan:"NaN",number:"skai\u010Dius",bigint:"sveikasis skai\u010Dius",string:"eilut\u0117",boolean:"login\u0117 reik\u0161m\u0117",undefined:"neapibr\u0117\u017Eta reik\u0161m\u0117",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulin\u0117 reik\u0161m\u0117"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=I(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Gautas tipas ${c}, o tik\u0117tasi - instanceof ${r.expected}`:`Gautas tipas ${c}, o tik\u0117tasi - ${o}`}case"invalid_value":return r.values.length===1?`Privalo b\u016Bti ${x(r.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${b(r.values,"|")} pasirinkim\u0173`;case"too_big":{let o=i[r.origin]??r.origin,s=e(r.origin,lk(Number(r.maximum)),r.inclusive??!1,"smaller");if(s?.verb)return`${Mo(o??r.origin??"reik\u0161m\u0117")} ${s.verb} ${r.maximum.toString()} ${s.unit??"element\u0173"}`;let c=r.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${Mo(o??r.origin??"reik\u0161m\u0117")} turi b\u016Bti ${c} ${r.maximum.toString()} ${s?.unit}`}case"too_small":{let o=i[r.origin]??r.origin,s=e(r.origin,lk(Number(r.minimum)),r.inclusive??!1,"bigger");if(s?.verb)return`${Mo(o??r.origin??"reik\u0161m\u0117")} ${s.verb} ${r.minimum.toString()} ${s.unit??"element\u0173"}`;let c=r.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${Mo(o??r.origin??"reik\u0161m\u0117")} turi b\u016Bti ${c} ${r.minimum.toString()} ${s?.unit}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Eilut\u0117 privalo prasid\u0117ti "${o.prefix}"`:o.format==="ends_with"?`Eilut\u0117 privalo pasibaigti "${o.suffix}"`:o.format==="includes"?`Eilut\u0117 privalo \u012Ftraukti "${o.includes}"`:o.format==="regex"?`Eilut\u0117 privalo atitikti ${o.pattern}`:`Neteisingas ${n[o.format]??r.format}`}case"not_multiple_of":return`Skai\u010Dius privalo b\u016Bti ${r.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpa\u017Eint${r.keys.length>1?"i":"as"} rakt${r.keys.length>1?"ai":"as"}: ${b(r.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let o=i[r.origin]??r.origin;return`${Mo(o??r.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}};function dk(){return{localeError:tP()}}var nP=()=>{let t={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function e(r){return t[r]??null}let n={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"},i={nan:"NaN",number:"\u0431\u0440\u043E\u0458",array:"\u043D\u0438\u0437\u0430"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=I(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 instanceof ${r.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${c}`:`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${c}`}case"invalid_value":return r.values.length===1?`Invalid input: expected ${x(r.values[0])}`:`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${o}${r.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin} \u0434\u0430 \u0438\u043C\u0430 ${o}${r.minimum.toString()} ${s.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${o.prefix}"`:o.format==="ends_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${o.suffix}"`:o.format==="includes"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${o.includes}"`:o.format==="regex"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${o.pattern}`:`Invalid ${n[o.format]??r.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${b(r.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${r.origin}`;case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return`\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${r.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}};function pk(){return{localeError:nP()}}var rP=()=>{let t={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function e(r){return t[r]??null}let n={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"},i={nan:"NaN",number:"nombor"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=I(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Input tidak sah: dijangka instanceof ${r.expected}, diterima ${c}`:`Input tidak sah: dijangka ${o}, diterima ${c}`}case"invalid_value":return r.values.length===1?`Input tidak sah: dijangka ${x(r.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Terlalu besar: dijangka ${r.origin??"nilai"} ${s.verb} ${o}${r.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: dijangka ${r.origin??"nilai"} adalah ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Terlalu kecil: dijangka ${r.origin} ${s.verb} ${o}${r.minimum.toString()} ${s.unit}`:`Terlalu kecil: dijangka ${r.origin} adalah ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`String tidak sah: mesti bermula dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak sah: mesti mengandungi "${o.includes}"`:o.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${o.pattern}`:`${n[o.format]??r.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${r.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${b(r.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${r.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${r.origin}`;default:return"Input tidak sah"}}};function mk(){return{localeError:rP()}}var iP=()=>{let t={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function e(r){return t[r]??null}let n={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"},i={nan:"NaN",number:"getal"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=I(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Ongeldige invoer: verwacht instanceof ${r.expected}, ontving ${c}`:`Ongeldige invoer: verwacht ${o}, ontving ${c}`}case"invalid_value":return r.values.length===1?`Ongeldige invoer: verwacht ${x(r.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin),c=r.origin==="date"?"laat":r.origin==="string"?"lang":"groot";return s?`Te ${c}: verwacht dat ${r.origin??"waarde"} ${o}${r.maximum.toString()} ${s.unit??"elementen"} ${s.verb}`:`Te ${c}: verwacht dat ${r.origin??"waarde"} ${o}${r.maximum.toString()} is`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin),c=r.origin==="date"?"vroeg":r.origin==="string"?"kort":"klein";return s?`Te ${c}: verwacht dat ${r.origin} ${o}${r.minimum.toString()} ${s.unit} ${s.verb}`:`Te ${c}: verwacht dat ${r.origin} ${o}${r.minimum.toString()} is`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Ongeldige tekst: moet met "${o.prefix}" beginnen`:o.format==="ends_with"?`Ongeldige tekst: moet op "${o.suffix}" eindigen`:o.format==="includes"?`Ongeldige tekst: moet "${o.includes}" bevatten`:o.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${o.pattern}`:`Ongeldig: ${n[o.format]??r.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${r.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${r.keys.length>1?"s":""}: ${b(r.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${r.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${r.origin}`;default:return"Ongeldige invoer"}}};function fk(){return{localeError:iP()}}var oP=()=>{let t={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"}};function e(r){return t[r]??null}let n={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\xE5de",ipv6:"IPv6-omr\xE5de",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"},i={nan:"NaN",number:"tall",array:"liste"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=I(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Ugyldig input: forventet instanceof ${r.expected}, fikk ${c}`:`Ugyldig input: forventet ${o}, fikk ${c}`}case"invalid_value":return r.values.length===1?`Ugyldig verdi: forventet ${x(r.values[0])}`:`Ugyldig valg: forventet en av ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`For stor(t): forventet ${r.origin??"value"} til \xE5 ha ${o}${r.maximum.toString()} ${s.unit??"elementer"}`:`For stor(t): forventet ${r.origin??"value"} til \xE5 ha ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`For lite(n): forventet ${r.origin} til \xE5 ha ${o}${r.minimum.toString()} ${s.unit}`:`For lite(n): forventet ${r.origin} til \xE5 ha ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${o.pattern}`:`Ugyldig ${n[o.format]??r.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${b(r.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${r.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${r.origin}`;default:return"Ugyldig input"}}};function gk(){return{localeError:oP()}}var sP=()=>{let t={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function e(r){return t[r]??null}let n={regex:"giren",email:"epostag\xE2h",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\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"},i={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=I(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`F\xE2sit giren: umulan instanceof ${r.expected}, al\u0131nan ${c}`:`F\xE2sit giren: umulan ${o}, al\u0131nan ${c}`}case"invalid_value":return r.values.length===1?`F\xE2sit giren: umulan ${x(r.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Fazla b\xFCy\xFCk: ${r.origin??"value"}, ${o}${r.maximum.toString()} ${s.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${r.origin??"value"}, ${o}${r.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Fazla k\xFC\xE7\xFCk: ${r.origin}, ${o}${r.minimum.toString()} ${s.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${r.origin}, ${o}${r.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let o=r;return o.format==="starts_with"?`F\xE2sit metin: "${o.prefix}" ile ba\u015Flamal\u0131.`:o.format==="ends_with"?`F\xE2sit metin: "${o.suffix}" ile bitmeli.`:o.format==="includes"?`F\xE2sit metin: "${o.includes}" ihtiv\xE2 etmeli.`:o.format==="regex"?`F\xE2sit metin: ${o.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${n[o.format]??r.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${r.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${r.keys.length>1?"s":""}: ${b(r.keys,", ")}`;case"invalid_key":return`${r.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${r.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}};function hk(){return{localeError:sP()}}var aP=()=>{let t={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function e(r){return t[r]??null}let n={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"},i={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0627\u0631\u06D0"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=I(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F instanceof ${r.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${c} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`:`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${o} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${c} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`}case"invalid_value":return r.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${x(r.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${b(r.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${r.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${o}${r.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${r.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${o}${r.maximum.toString()} \u0648\u064A`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${r.origin} \u0628\u0627\u06CC\u062F ${o}${r.minimum.toString()} ${s.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${r.origin} \u0628\u0627\u06CC\u062F ${o}${r.minimum.toString()} \u0648\u064A`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${o.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:o.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${o.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:o.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${o.includes}" \u0648\u0644\u0631\u064A`:o.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${o.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${n[o.format]??r.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${r.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${r.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${b(r.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${r.origin} \u06A9\u06D0`;case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return`\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${r.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}};function bk(){return{localeError:aP()}}var cP=()=>{let t={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"}};function e(r){return t[r]??null}let n={regex:"wyra\u017Cenie",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\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"},i={nan:"NaN",number:"liczba",array:"tablica"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=I(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${r.expected}, otrzymano ${c}`:`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${o}, otrzymano ${c}`}case"invalid_value":return r.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${x(r.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${r.maximum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${r.minimum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${o.prefix}"`:o.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${o.suffix}"`:o.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${o.includes}"`:o.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${o.pattern}`:`Nieprawid\u0142ow(y/a/e) ${n[o.format]??r.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${r.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${r.keys.length>1?"s":""}: ${b(r.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${r.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${r.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}};function yk(){return{localeError:cP()}}var uP=()=>{let t={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function e(r){return t[r]??null}let n={regex:"padr\xE3o",email:"endere\xE7o 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\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o 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\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},i={nan:"NaN",number:"n\xFAmero",null:"nulo"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=I(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Tipo inv\xE1lido: esperado instanceof ${r.expected}, recebido ${c}`:`Tipo inv\xE1lido: esperado ${o}, recebido ${c}`}case"invalid_value":return r.values.length===1?`Entrada inv\xE1lida: esperado ${x(r.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Muito grande: esperado que ${r.origin??"valor"} tivesse ${o}${r.maximum.toString()} ${s.unit??"elementos"}`:`Muito grande: esperado que ${r.origin??"valor"} fosse ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Muito pequeno: esperado que ${r.origin} tivesse ${o}${r.minimum.toString()} ${s.unit}`:`Muito pequeno: esperado que ${r.origin} fosse ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${o.prefix}"`:o.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${o.suffix}"`:o.format==="includes"?`Texto inv\xE1lido: deve incluir "${o.includes}"`:o.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${o.pattern}`:`${n[o.format]??r.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${r.divisor}`;case"unrecognized_keys":return`Chave${r.keys.length>1?"s":""} desconhecida${r.keys.length>1?"s":""}: ${b(r.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${r.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${r.origin}`;default:return"Campo inv\xE1lido"}}};function _k(){return{localeError:uP()}}var lP=()=>{let t={string:{unit:"caractere",verb:"s\u0103 aib\u0103"},file:{unit:"octe\u021Bi",verb:"s\u0103 aib\u0103"},array:{unit:"elemente",verb:"s\u0103 aib\u0103"},set:{unit:"elemente",verb:"s\u0103 aib\u0103"},map:{unit:"intr\u0103ri",verb:"s\u0103 aib\u0103"}};function e(r){return t[r]??null}let n={regex:"intrare",email:"adres\u0103 de 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:"dat\u0103 \u0219i or\u0103 ISO",date:"dat\u0103 ISO",time:"or\u0103 ISO",duration:"durat\u0103 ISO",ipv4:"adres\u0103 IPv4",ipv6:"adres\u0103 IPv6",mac:"adres\u0103 MAC",cidrv4:"interval IPv4",cidrv6:"interval IPv6",base64:"\u0219ir codat base64",base64url:"\u0219ir codat base64url",json_string:"\u0219ir JSON",e164:"num\u0103r E.164",jwt:"JWT",template_literal:"intrare"},i={nan:"NaN",string:"\u0219ir",number:"num\u0103r",boolean:"boolean",function:"func\u021Bie",array:"matrice",object:"obiect",undefined:"nedefinit",symbol:"simbol",bigint:"num\u0103r mare",void:"void",never:"never",map:"hart\u0103",set:"set"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=I(r.input),c=i[s]??s;return`Intrare invalid\u0103: a\u0219teptat ${o}, primit ${c}`}case"invalid_value":return r.values.length===1?`Intrare invalid\u0103: a\u0219teptat ${x(r.values[0])}`:`Op\u021Biune invalid\u0103: a\u0219teptat una dintre ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Prea mare: a\u0219teptat ca ${r.origin??"valoarea"} ${s.verb} ${o}${r.maximum.toString()} ${s.unit??"elemente"}`:`Prea mare: a\u0219teptat ca ${r.origin??"valoarea"} s\u0103 fie ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Prea mic: a\u0219teptat ca ${r.origin} ${s.verb} ${o}${r.minimum.toString()} ${s.unit}`:`Prea mic: a\u0219teptat ca ${r.origin} s\u0103 fie ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0218ir invalid: trebuie s\u0103 \xEEnceap\u0103 cu "${o.prefix}"`:o.format==="ends_with"?`\u0218ir invalid: trebuie s\u0103 se termine cu "${o.suffix}"`:o.format==="includes"?`\u0218ir invalid: trebuie s\u0103 includ\u0103 "${o.includes}"`:o.format==="regex"?`\u0218ir invalid: trebuie s\u0103 se potriveasc\u0103 cu modelul ${o.pattern}`:`Format invalid: ${n[o.format]??r.format}`}case"not_multiple_of":return`Num\u0103r invalid: trebuie s\u0103 fie multiplu de ${r.divisor}`;case"unrecognized_keys":return`Chei nerecunoscute: ${b(r.keys,", ")}`;case"invalid_key":return`Cheie invalid\u0103 \xEEn ${r.origin}`;case"invalid_union":return"Intrare invalid\u0103";case"invalid_element":return`Valoare invalid\u0103 \xEEn ${r.origin}`;default:return"Intrare invalid\u0103"}}};function vk(){return{localeError:lP()}}function kk(t,e,n,i){let r=Math.abs(t),o=r%10,s=r%100;return s>=11&&s<=19?i:o===1?e:o>=2&&o<=4?n:i}var dP=()=>{let t={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function e(r){return t[r]??null}let n={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0441\u0438\u0432"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=I(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C instanceof ${r.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${c}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${o}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${c}`}case"invalid_value":return r.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${x(r.values[0])}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);if(s){let c=Number(r.maximum),u=kk(c,s.unit.one,s.unit.few,s.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${o}${r.maximum.toString()} ${u}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);if(s){let c=Number(r.minimum),u=kk(c,s.unit.one,s.unit.few,s.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${r.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${o}${r.minimum.toString()} ${u}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${r.origin} \u0431\u0443\u0434\u0435\u0442 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${o.prefix}"`:o.format==="ends_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${o.suffix}"`:o.format==="includes"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${o.includes}"`:o.format==="regex"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${o.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${n[o.format]??r.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${r.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${r.keys.length>1?"\u0438":""}: ${b(r.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${r.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${r.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}};function Sk(){return{localeError:dP()}}var pP=()=>{let t={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function e(r){return t[r]??null}let n={regex:"vnos",email:"e-po\u0161tni 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 \u010Das",date:"ISO datum",time:"ISO \u010Das",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 \u0161tevilka",jwt:"JWT",template_literal:"vnos"},i={nan:"NaN",number:"\u0161tevilo",array:"tabela"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=I(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Neveljaven vnos: pri\u010Dakovano instanceof ${r.expected}, prejeto ${c}`:`Neveljaven vnos: pri\u010Dakovano ${o}, prejeto ${c}`}case"invalid_value":return r.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${x(r.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Preveliko: pri\u010Dakovano, da bo ${r.origin??"vrednost"} imelo ${o}${r.maximum.toString()} ${s.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${r.origin??"vrednost"} ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Premajhno: pri\u010Dakovano, da bo ${r.origin} imelo ${o}${r.minimum.toString()} ${s.unit}`:`Premajhno: pri\u010Dakovano, da bo ${r.origin} ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${o.prefix}"`:o.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${o.suffix}"`:o.format==="includes"?`Neveljaven niz: mora vsebovati "${o.includes}"`:o.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${o.pattern}`:`Neveljaven ${n[o.format]??r.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${r.divisor}`;case"unrecognized_keys":return`Neprepoznan${r.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${b(r.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${r.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${r.origin}`;default:return"Neveljaven vnos"}}};function xk(){return{localeError:pP()}}var mP=()=>{let t={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"}};function e(r){return t[r]??null}let n={regex:"regulj\xE4rt 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\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},i={nan:"NaN",number:"antal",array:"lista"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=I(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${r.expected}, fick ${c}`:`Ogiltig inmatning: f\xF6rv\xE4ntat ${o}, fick ${c}`}case"invalid_value":return r.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${x(r.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`F\xF6r stor(t): f\xF6rv\xE4ntade ${r.origin??"v\xE4rdet"} att ha ${o}${r.maximum.toString()} ${s.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${r.origin??"v\xE4rdet"} att ha ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`F\xF6r lite(t): f\xF6rv\xE4ntade ${r.origin??"v\xE4rdet"} att ha ${o}${r.minimum.toString()} ${s.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${r.origin??"v\xE4rdet"} att ha ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${o.prefix}"`:o.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${o.suffix}"`:o.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${o.includes}"`:o.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${o.pattern}"`:`Ogiltig(t) ${n[o.format]??r.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${b(r.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${r.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${r.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}};function Ik(){return{localeError:mP()}}var fP=()=>{let t={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function e(r){return t[r]??null}let n={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",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 \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"\u0B8E\u0BA3\u0BCD",array:"\u0B85\u0BA3\u0BBF",null:"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=I(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 instanceof ${r.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${c}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${c}`}case"invalid_value":return r.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${x(r.values[0])}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${b(r.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${o}${r.maximum.toString()} ${s.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${o}${r.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r.origin} ${o}${r.minimum.toString()} ${s.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r.origin} ${o}${r.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${o.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${n[o.format]??r.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${r.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${r.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${b(r.keys,", ")}`;case"invalid_key":return`${r.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return`${r.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}};function $k(){return{localeError:fP()}}var gP=()=>{let t={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function e(r){return t[r]??null}let n={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"},i={nan:"NaN",number:"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02",array:"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)",null:"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=I(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 instanceof ${r.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${c}`:`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${o} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${c}`}case"invalid_value":return r.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${x(r.values[0])}`:`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",s=e(r.origin);return s?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${r.maximum.toString()} ${s.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",s=e(r.origin);return s?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${r.minimum.toString()} ${s.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${o.prefix}"`:o.format==="ends_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${o.suffix}"`:o.format==="includes"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${o.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:o.format==="regex"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${o.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${n[o.format]??r.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${r.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${b(r.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${r.origin}`;case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return`\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${r.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}};function wk(){return{localeError:gP()}}var hP=()=>{let t={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function e(r){return t[r]??null}let n={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\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"\u015Eablon dizesi"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=I(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${r.expected}, al\u0131nan ${c}`:`Ge\xE7ersiz de\u011Fer: beklenen ${o}, al\u0131nan ${c}`}case"invalid_value":return r.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${x(r.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\xC7ok b\xFCy\xFCk: beklenen ${r.origin??"de\u011Fer"} ${o}${r.maximum.toString()} ${s.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${r.origin??"de\u011Fer"} ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\xC7ok k\xFC\xE7\xFCk: beklenen ${r.origin} ${o}${r.minimum.toString()} ${s.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${r.origin} ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Ge\xE7ersiz metin: "${o.prefix}" ile ba\u015Flamal\u0131`:o.format==="ends_with"?`Ge\xE7ersiz metin: "${o.suffix}" ile bitmeli`:o.format==="includes"?`Ge\xE7ersiz metin: "${o.includes}" i\xE7ermeli`:o.format==="regex"?`Ge\xE7ersiz metin: ${o.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${n[o.format]??r.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${r.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${r.keys.length>1?"lar":""}: ${b(r.keys,", ")}`;case"invalid_key":return`${r.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${r.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}};function Ek(){return{localeError:hP()}}var bP=()=>{let t={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function e(r){return t[r]??null}let n={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=I(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F instanceof ${r.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${c}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${o}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${c}`}case"invalid_value":return r.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${x(r.values[0])}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${s.verb} ${o}${r.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${r.origin} ${s.verb} ${o}${r.minimum.toString()} ${s.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${r.origin} \u0431\u0443\u0434\u0435 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${o.prefix}"`:o.format==="ends_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${o.suffix}"`:o.format==="includes"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${o.includes}"`:o.format==="regex"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${o.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${n[o.format]??r.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${r.keys.length>1?"\u0456":""}: ${b(r.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${r.origin}`;case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${r.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}};function mu(){return{localeError:bP()}}function Tk(){return mu()}var yP=()=>{let t={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function e(r){return t[r]??null}let n={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"},i={nan:"NaN",number:"\u0646\u0645\u0628\u0631",array:"\u0622\u0631\u06D2",null:"\u0646\u0644"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=I(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: instanceof ${r.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${c} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`:`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${o} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${c} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`}case"invalid_value":return r.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${x(r.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${b(r.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${r.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${o}${r.maximum.toString()} ${s.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${r.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${o}${r.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${r.origin} \u06A9\u06D2 ${o}${r.minimum.toString()} ${s.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${r.origin} \u06A9\u0627 ${o}${r.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${o.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${n[o.format]??r.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${r.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${r.keys.length>1?"\u0632":""}: ${b(r.keys,"\u060C ")}`;case"invalid_key":return`${r.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${r.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}};function Rk(){return{localeError:yP()}}var _P=()=>{let t={string:{unit:"belgi",verb:"bo\u2018lishi kerak"},file:{unit:"bayt",verb:"bo\u2018lishi kerak"},array:{unit:"element",verb:"bo\u2018lishi kerak"},set:{unit:"element",verb:"bo\u2018lishi kerak"},map:{unit:"yozuv",verb:"bo\u2018lishi kerak"}};function e(r){return t[r]??null}let n={regex:"kirish",email:"elektron pochta manzili",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 sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},i={nan:"NaN",number:"raqam",array:"massiv"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=I(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${r.expected}, qabul qilingan ${c}`:`Noto\u2018g\u2018ri kirish: kutilgan ${o}, qabul qilingan ${c}`}case"invalid_value":return r.values.length===1?`Noto\u2018g\u2018ri kirish: kutilgan ${x(r.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Juda katta: kutilgan ${r.origin??"qiymat"} ${o}${r.maximum.toString()} ${s.unit} ${s.verb}`:`Juda katta: kutilgan ${r.origin??"qiymat"} ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Juda kichik: kutilgan ${r.origin} ${o}${r.minimum.toString()} ${s.unit} ${s.verb}`:`Juda kichik: kutilgan ${r.origin} ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Noto\u2018g\u2018ri satr: "${o.prefix}" bilan boshlanishi kerak`:o.format==="ends_with"?`Noto\u2018g\u2018ri satr: "${o.suffix}" bilan tugashi kerak`:o.format==="includes"?`Noto\u2018g\u2018ri satr: "${o.includes}" ni o\u2018z ichiga olishi kerak`:o.format==="regex"?`Noto\u2018g\u2018ri satr: ${o.pattern} shabloniga mos kelishi kerak`:`Noto\u2018g\u2018ri ${n[o.format]??r.format}`}case"not_multiple_of":return`Noto\u2018g\u2018ri raqam: ${r.divisor} ning karralisi bo\u2018lishi kerak`;case"unrecognized_keys":return`Noma\u2019lum kalit${r.keys.length>1?"lar":""}: ${b(r.keys,", ")}`;case"invalid_key":return`${r.origin} dagi kalit noto\u2018g\u2018ri`;case"invalid_union":return"Noto\u2018g\u2018ri kirish";case"invalid_element":return`${r.origin} da noto\u2018g\u2018ri qiymat`;default:return"Noto\u2018g\u2018ri kirish"}}};function Ok(){return{localeError:_P()}}var vP=()=>{let t={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function e(r){return t[r]??null}let n={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 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\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"},i={nan:"NaN",number:"s\u1ED1",array:"m\u1EA3ng"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=I(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i instanceof ${r.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${c}`:`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${o}, nh\u1EADn \u0111\u01B0\u1EE3c ${c}`}case"invalid_value":return r.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${x(r.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${r.origin??"gi\xE1 tr\u1ECB"} ${s.verb} ${o}${r.maximum.toString()} ${s.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${r.origin??"gi\xE1 tr\u1ECB"} ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${r.origin} ${s.verb} ${o}${r.minimum.toString()} ${s.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${r.origin} ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${o.prefix}"`:o.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${o.suffix}"`:o.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${o.includes}"`:o.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${o.pattern}`:`${n[o.format]??r.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${r.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${b(r.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${r.origin}`;case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return`Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${r.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}};function Pk(){return{localeError:vP()}}var kP=()=>{let t={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"}};function e(r){return t[r]??null}let n={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"},i={nan:"NaN",number:"\u6570\u5B57",array:"\u6570\u7EC4",null:"\u7A7A\u503C(null)"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=I(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${r.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${c}`:`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${o}\uFF0C\u5B9E\u9645\u63A5\u6536 ${c}`}case"invalid_value":return r.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${x(r.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${r.origin??"\u503C"} ${o}${r.maximum.toString()} ${s.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${r.origin??"\u503C"} ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${r.origin} ${o}${r.minimum.toString()} ${s.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${r.origin} ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${o.prefix}" \u5F00\u5934`:o.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${o.suffix}" \u7ED3\u5C3E`:o.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${o.includes}"`:o.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${o.pattern}`:`\u65E0\u6548${n[o.format]??r.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${r.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${b(r.keys,", ")}`;case"invalid_key":return`${r.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${r.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}};function Ak(){return{localeError:kP()}}var SP=()=>{let t={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function e(r){return t[r]??null}let n={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",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 \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=I(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${r.expected}\uFF0C\u4F46\u6536\u5230 ${c}`:`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${o}\uFF0C\u4F46\u6536\u5230 ${c}`}case"invalid_value":return r.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${x(r.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${r.origin??"\u503C"} \u61C9\u70BA ${o}${r.maximum.toString()} ${s.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${r.origin??"\u503C"} \u61C9\u70BA ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${r.origin} \u61C9\u70BA ${o}${r.minimum.toString()} ${s.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${r.origin} \u61C9\u70BA ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${o.prefix}" \u958B\u982D`:o.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${o.suffix}" \u7D50\u5C3E`:o.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${o.includes}"`:o.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${o.pattern}`:`\u7121\u6548\u7684 ${n[o.format]??r.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${r.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${r.keys.length>1?"\u5011":""}\uFF1A${b(r.keys,"\u3001")}`;case"invalid_key":return`${r.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${r.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}};function Nk(){return{localeError:SP()}}var xP=()=>{let t={string:{unit:"\xE0mi",verb:"n\xED"},file:{unit:"bytes",verb:"n\xED"},array:{unit:"nkan",verb:"n\xED"},set:{unit:"nkan",verb:"n\xED"}};function e(r){return t[r]??null}let n={regex:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9",email:"\xE0d\xEDr\u1EB9\u0301s\xEC \xECm\u1EB9\u0301l\xEC",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:"\xE0k\xF3k\xF2 ISO",date:"\u1ECDj\u1ECD\u0301 ISO",time:"\xE0k\xF3k\xF2 ISO",duration:"\xE0k\xF3k\xF2 t\xF3 p\xE9 ISO",ipv4:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv4",ipv6:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv6",cidrv4:"\xE0gb\xE8gb\xE8 IPv4",cidrv6:"\xE0gb\xE8gb\xE8 IPv6",base64:"\u1ECD\u0300r\u1ECD\u0300 t\xED a k\u1ECD\u0301 n\xED base64",base64url:"\u1ECD\u0300r\u1ECD\u0300 base64url",json_string:"\u1ECD\u0300r\u1ECD\u0300 JSON",e164:"n\u1ECD\u0301mb\xE0 E.164",jwt:"JWT",template_literal:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"},i={nan:"NaN",number:"n\u1ECD\u0301mb\xE0",array:"akop\u1ECD"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=I(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi instanceof ${r.expected}, \xE0m\u1ECD\u0300 a r\xED ${c}`:`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${o}, \xE0m\u1ECD\u0300 a r\xED ${c}`}case"invalid_value":return r.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${x(r.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${r.origin??"iye"} ${s.verb} ${o}${r.maximum} ${s.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${o}${r.maximum}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${r.origin} ${s.verb} ${o}${r.minimum} ${s.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${o}${r.minimum}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\u1EB9\u0300r\u1EB9\u0300 p\u1EB9\u0300l\xFA "${o.prefix}"`:o.format==="ends_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${o.suffix}"`:o.format==="includes"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${o.includes}"`:o.format==="regex"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${o.pattern}`:`A\u1E63\xEC\u1E63e: ${n[o.format]??r.format}`}case"not_multiple_of":return`N\u1ECD\u0301mb\xE0 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 j\u1EB9\u0301 \xE8y\xE0 p\xEDp\xEDn ti ${r.divisor}`;case"unrecognized_keys":return`B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${b(r.keys,", ")}`;case"invalid_key":return`B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${r.origin}`;case"invalid_union":return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e";case"invalid_element":return`Iye a\u1E63\xEC\u1E63e n\xEDn\xFA ${r.origin}`;default:return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"}}};function Ck(){return{localeError:xP()}}var zk,Jm=Symbol("ZodOutput"),Ym=Symbol("ZodInput"),fu=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...n){let i=n[0];return this._map.set(e,i),i&&typeof i=="object"&&"id"in i&&this._idmap.set(i.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let n=this._map.get(e);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(e),this}get(e){let n=e._zod.parent;if(n){let i={...this.get(n)??{}};delete i.id;let r={...i,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function gu(){return new fu}(zk=globalThis).__zod_globalRegistry??(zk.__zod_globalRegistry=gu());var Me=globalThis.__zod_globalRegistry;function hu(t,e){return new t({type:"string",...E(e)})}function Xm(t,e){return new t({type:"string",coerce:!0,...E(e)})}function Lo(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...E(e)})}function Fr(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...E(e)})}function Zo(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...E(e)})}function Bo(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...E(e)})}function Fo(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...E(e)})}function Vo(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...E(e)})}function Vr(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...E(e)})}function qo(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...E(e)})}function Ho(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...E(e)})}function Ko(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...E(e)})}function Go(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...E(e)})}function Wo(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...E(e)})}function Jo(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...E(e)})}function Yo(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...E(e)})}function Xo(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...E(e)})}function Qo(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...E(e)})}function bu(t,e){return new t({type:"string",format:"mac",check:"string_format",abort:!1,...E(e)})}function es(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...E(e)})}function ts(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...E(e)})}function ns(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...E(e)})}function rs(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...E(e)})}function is(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...E(e)})}function os(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...E(e)})}var Qm={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function ef(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...E(e)})}function tf(t,e){return new t({type:"string",format:"date",check:"string_format",...E(e)})}function nf(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...E(e)})}function rf(t,e){return new t({type:"string",format:"duration",check:"string_format",...E(e)})}function yu(t,e){return new t({type:"number",checks:[],...E(e)})}function of(t,e){return new t({type:"number",coerce:!0,checks:[],...E(e)})}function _u(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...E(e)})}function vu(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float32",...E(e)})}function ku(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float64",...E(e)})}function Su(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"int32",...E(e)})}function xu(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"uint32",...E(e)})}function Iu(t,e){return new t({type:"boolean",...E(e)})}function sf(t,e){return new t({type:"boolean",coerce:!0,...E(e)})}function $u(t,e){return new t({type:"bigint",...E(e)})}function af(t,e){return new t({type:"bigint",coerce:!0,...E(e)})}function wu(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...E(e)})}function Eu(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...E(e)})}function Tu(t,e){return new t({type:"symbol",...E(e)})}function Ru(t,e){return new t({type:"undefined",...E(e)})}function Ou(t,e){return new t({type:"null",...E(e)})}function Pu(t){return new t({type:"any"})}function Au(t){return new t({type:"unknown"})}function Nu(t,e){return new t({type:"never",...E(e)})}function Cu(t,e){return new t({type:"void",...E(e)})}function zu(t,e){return new t({type:"date",...E(e)})}function cf(t,e){return new t({type:"date",coerce:!0,...E(e)})}function Du(t,e){return new t({type:"nan",...E(e)})}function Bt(t,e){return new nc({check:"less_than",...E(e),value:t,inclusive:!1})}function mt(t,e){return new nc({check:"less_than",...E(e),value:t,inclusive:!0})}function Ft(t,e){return new rc({check:"greater_than",...E(e),value:t,inclusive:!1})}function Xe(t,e){return new rc({check:"greater_than",...E(e),value:t,inclusive:!0})}function ju(t){return Ft(0,t)}function Uu(t){return Bt(0,t)}function Mu(t){return mt(0,t)}function Lu(t){return Xe(0,t)}function In(t,e){return new xm({check:"multiple_of",...E(e),value:t})}function $n(t,e){return new wm({check:"max_size",...E(e),maximum:t})}function Vt(t,e){return new Em({check:"min_size",...E(e),minimum:t})}function ar(t,e){return new Tm({check:"size_equals",...E(e),size:t})}function cr(t,e){return new Rm({check:"max_length",...E(e),maximum:t})}function on(t,e){return new Om({check:"min_length",...E(e),minimum:t})}function ur(t,e){return new Pm({check:"length_equals",...E(e),length:t})}function qr(t,e){return new Am({check:"string_format",format:"regex",...E(e),pattern:t})}function Hr(t){return new Nm({check:"string_format",format:"lowercase",...E(t)})}function Kr(t){return new Cm({check:"string_format",format:"uppercase",...E(t)})}function Gr(t,e){return new zm({check:"string_format",format:"includes",...E(e),includes:t})}function Wr(t,e){return new Dm({check:"string_format",format:"starts_with",...E(e),prefix:t})}function Jr(t,e){return new jm({check:"string_format",format:"ends_with",...E(e),suffix:t})}function Zu(t,e,n){return new Um({check:"property",property:t,schema:e,...E(n)})}function Yr(t,e){return new Mm({check:"mime_type",mime:t,...E(e)})}function Rt(t){return new Lm({check:"overwrite",tx:t})}function Xr(t){return Rt(e=>e.normalize(t))}function Qr(){return Rt(t=>t.trim())}function ei(){return Rt(t=>t.toLowerCase())}function ti(){return Rt(t=>t.toUpperCase())}function ni(){return Rt(t=>Mp(t))}function uf(t,e,n){return new t({type:"array",element:e,...E(n)})}function $P(t,e,n){return new t({type:"union",options:e,...E(n)})}function wP(t,e,n){return new t({type:"union",options:e,inclusive:!1,...E(n)})}function EP(t,e,n,i){return new t({type:"union",options:n,discriminator:e,...E(i)})}function TP(t,e,n){return new t({type:"intersection",left:e,right:n})}function RP(t,e,n,i){let r=n instanceof H,o=r?i:n,s=r?n:null;return new t({type:"tuple",items:e,rest:s,...E(o)})}function OP(t,e,n,i){return new t({type:"record",keyType:e,valueType:n,...E(i)})}function PP(t,e,n,i){return new t({type:"map",keyType:e,valueType:n,...E(i)})}function AP(t,e,n){return new t({type:"set",valueType:e,...E(n)})}function NP(t,e,n){let i=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new t({type:"enum",entries:i,...E(n)})}function CP(t,e,n){return new t({type:"enum",entries:e,...E(n)})}function zP(t,e,n){return new t({type:"literal",values:Array.isArray(e)?e:[e],...E(n)})}function Bu(t,e){return new t({type:"file",...E(e)})}function DP(t,e){return new t({type:"transform",transform:e})}function jP(t,e){return new t({type:"optional",innerType:e})}function UP(t,e){return new t({type:"nullable",innerType:e})}function MP(t,e,n){return new t({type:"default",innerType:e,get defaultValue(){return typeof n=="function"?n():qa(n)}})}function LP(t,e,n){return new t({type:"nonoptional",innerType:e,...E(n)})}function ZP(t,e){return new t({type:"success",innerType:e})}function BP(t,e,n){return new t({type:"catch",innerType:e,catchValue:typeof n=="function"?n:()=>n})}function FP(t,e,n){return new t({type:"pipe",in:e,out:n})}function VP(t,e){return new t({type:"readonly",innerType:e})}function qP(t,e,n){return new t({type:"template_literal",parts:e,...E(n)})}function HP(t,e){return new t({type:"lazy",getter:e})}function KP(t,e){return new t({type:"promise",innerType:e})}function Fu(t,e,n){let i=E(n);return i.abort??(i.abort=!0),new t({type:"custom",check:"custom",fn:e,...i})}function Vu(t,e,n){return new t({type:"custom",check:"custom",fn:e,...E(n)})}function qu(t,e){let n=Dk(i=>(i.addIssue=r=>{if(typeof r=="string")i.issues.push(Ar(r,i.value,n._zod.def));else{let o=r;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=i.value),o.inst??(o.inst=n),o.continue??(o.continue=!n._zod.def.abort),i.issues.push(Ar(o))}},t(i.value,i)),e);return n}function Dk(t,e){let n=new ge({check:"custom",...E(e)});return n._zod.check=t,n}function Hu(t){let e=new ge({check:"describe"});return e._zod.onattach=[n=>{let i=Me.get(n)??{};Me.add(n,{...i,description:t})}],e._zod.check=()=>{},e}function Ku(t){let e=new ge({check:"meta"});return e._zod.onattach=[n=>{let i=Me.get(n)??{};Me.add(n,{...i,...t})}],e._zod.check=()=>{},e}function Gu(t,e){let n=E(e),i=n.truthy??["true","1","yes","on","y","enabled"],r=n.falsy??["false","0","no","off","n","disabled"];n.case!=="sensitive"&&(i=i.map(f=>typeof f=="string"?f.toLowerCase():f),r=r.map(f=>typeof f=="string"?f.toLowerCase():f));let o=new Set(i),s=new Set(r),c=t.Codec??Lr,u=t.Boolean??Ur,l=t.String??xn,p=new l({type:"string",error:n.error}),d=new u({type:"boolean",error:n.error}),m=new c({type:"pipe",in:p,out:d,transform:((f,g)=>{let y=f;return n.case!=="sensitive"&&(y=y.toLowerCase()),o.has(y)?!0:s.has(y)?!1:(g.issues.push({code:"invalid_value",expected:"stringbool",values:[...o,...s],input:g.value,inst:m,continue:!1}),{})}),reverseTransform:((f,g)=>f===!0?i[0]||"true":r[0]||"false"),error:n.error});return m}function lr(t,e,n,i={}){let r=E(i),o={...E(i),check:"string_format",type:"string",format:e,fn:typeof n=="function"?n:c=>n.test(c),...r};return n instanceof RegExp&&(o.pattern=n),new t(o)}function wn(t){let e=t?.target??"draft-2020-12";return e==="draft-4"&&(e="draft-04"),e==="draft-7"&&(e="draft-07"),{processors:t.processors??{},metadataRegistry:t?.metadata??Me,target:e,unrepresentable:t?.unrepresentable??"throw",override:t?.override??(()=>{}),io:t?.io??"output",counter:0,seen:new Map,cycles:t?.cycles??"ref",reused:t?.reused??"inline",external:t?.external??void 0}}function pe(t,e,n={path:[],schemaPath:[]}){var i;let r=t._zod.def,o=e.seen.get(t);if(o)return o.count++,n.schemaPath.includes(t)&&(o.cycle=n.path),o.schema;let s={schema:{},count:1,cycle:void 0,path:n.path};e.seen.set(t,s);let c=t._zod.toJSONSchema?.();if(c)s.schema=c;else{let p={...n,schemaPath:[...n.schemaPath,t],path:n.path};if(t._zod.processJSONSchema)t._zod.processJSONSchema(e,s.schema,p);else{let m=s.schema,f=e.processors[r.type];if(!f)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${r.type}`);f(t,e,m,p)}let d=t._zod.parent;d&&(s.ref||(s.ref=d),pe(d,e,p),e.seen.get(d).isParent=!0)}let u=e.metadataRegistry.get(t);return u&&Object.assign(s.schema,u),e.io==="input"&&Qe(t)&&(delete s.schema.examples,delete s.schema.default),e.io==="input"&&"_prefault"in s.schema&&((i=s.schema).default??(i.default=s.schema._prefault)),delete s.schema._prefault,e.seen.get(t).schema}function En(t,e){let n=t.seen.get(e);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=new Map;for(let s of t.seen.entries()){let c=t.metadataRegistry.get(s[0])?.id;if(c){let u=i.get(c);if(u&&u!==s[0])throw new Error(`Duplicate schema id "${c}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);i.set(c,s[0])}}let r=s=>{let c=t.target==="draft-2020-12"?"$defs":"definitions";if(t.external){let d=t.external.registry.get(s[0])?.id,m=t.external.uri??(g=>g);if(d)return{ref:m(d)};let f=s[1].defId??s[1].schema.id??`schema${t.counter++}`;return s[1].defId=f,{defId:f,ref:`${m("__shared")}#/${c}/${f}`}}if(s[1]===n)return{ref:"#"};let l=`#/${c}/`,p=s[1].schema.id??`__schema${t.counter++}`;return{defId:p,ref:l+p}},o=s=>{if(s[1].schema.$ref)return;let c=s[1],{ref:u,defId:l}=r(s);c.def={...c.schema},l&&(c.defId=l);let p=c.schema;for(let d in p)delete p[d];p.$ref=u};if(t.cycles==="throw")for(let s of t.seen.entries()){let c=s[1];if(c.cycle)throw new Error(`Cycle detected: #/${c.cycle?.join("/")}/<root>
|
|
73
73
|
|
|
74
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let s of t.seen.entries()){let c=s[1];if(e===s[0]){o(s);continue}if(t.external){let d=t.external.registry.get(s[0])?.id;if(e!==s[0]&&d){o(s);continue}}if(t.metadataRegistry.get(s[0])?.id){o(s);continue}if(c.cycle){o(s);continue}if(c.count>1&&t.reused==="ref"){o(s);continue}}}function $n(t,e){let n=t.seen.get(e);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=c=>{let u=t.seen.get(c);if(u.ref===null)return;let d=u.def??u.schema,l={...d},p=u.ref;if(u.ref=null,p){i(p);let f=t.seen.get(p),h=f.schema;if(h.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0")?(d.allOf=d.allOf??[],d.allOf.push(h)):Object.assign(d,h),Object.assign(d,l),c._zod.parent===p)for(let v in d)v==="$ref"||v==="allOf"||v in l||delete d[v];if(h.$ref&&f.def)for(let v in d)v==="$ref"||v==="allOf"||v in f.def&&JSON.stringify(d[v])===JSON.stringify(f.def[v])&&delete d[v]}let m=c._zod.parent;if(m&&m!==p){i(m);let f=t.seen.get(m);if(f?.schema.$ref&&(d.$ref=f.schema.$ref,f.def))for(let h in d)h==="$ref"||h==="allOf"||h in f.def&&JSON.stringify(d[h])===JSON.stringify(f.def[h])&&delete d[h]}t.override({zodSchema:c,jsonSchema:d,path:u.path??[]})};for(let c of[...t.seen.entries()].reverse())i(c[0]);let r={};if(t.target==="draft-2020-12"?r.$schema="https://json-schema.org/draft/2020-12/schema":t.target==="draft-07"?r.$schema="http://json-schema.org/draft-07/schema#":t.target==="draft-04"?r.$schema="http://json-schema.org/draft-04/schema#":t.target,t.external?.uri){let c=t.external.registry.get(e)?.id;if(!c)throw new Error("Schema is missing an `id` property");r.$id=t.external.uri(c)}Object.assign(r,n.def??n.schema);let o=t.metadataRegistry.get(e)?.id;o!==void 0&&r.id===o&&delete r.id;let s=t.external?.defs??{};for(let c of t.seen.entries()){let u=c[1];u.def&&u.defId&&(u.def.id===u.defId&&delete u.def.id,s[u.defId]=u.def)}t.external||Object.keys(s).length>0&&(t.target==="draft-2020-12"?r.$defs=s:r.definitions=s);try{let c=JSON.parse(JSON.stringify(r));return Object.defineProperty(c,"~standard",{value:{...e["~standard"],jsonSchema:{input:Jr(e,"input",t.processors),output:Jr(e,"output",t.processors)}},enumerable:!1,writable:!1}),c}catch{throw new Error("Error converting schema to JSON.")}}function Je(t,e){let n=e??{seen:new Set};if(n.seen.has(t))return!1;n.seen.add(t);let i=t._zod.def;if(i.type==="transform")return!0;if(i.type==="array")return Je(i.element,n);if(i.type==="set")return Je(i.valueType,n);if(i.type==="lazy")return Je(i.getter(),n);if(i.type==="promise"||i.type==="optional"||i.type==="nonoptional"||i.type==="nullable"||i.type==="readonly"||i.type==="default"||i.type==="prefault")return Je(i.innerType,n);if(i.type==="intersection")return Je(i.left,n)||Je(i.right,n);if(i.type==="record"||i.type==="map")return Je(i.keyType,n)||Je(i.valueType,n);if(i.type==="pipe")return t._zod.traits.has("$ZodCodec")?!0:Je(i.in,n)||Je(i.out,n);if(i.type==="object"){for(let r in i.shape)if(Je(i.shape[r],n))return!0;return!1}if(i.type==="union"){for(let r of i.options)if(Je(r,n))return!0;return!1}if(i.type==="tuple"){for(let r of i.items)if(Je(r,n))return!0;return!!(i.rest&&Je(i.rest,n))}return!1}var Hm=(t,e={})=>n=>{let i=xn({...n,processors:e});return pe(t,i),In(i,t),$n(i,t)},Jr=(t,e,n={})=>i=>{let{libraryOptions:r,target:o}=i??{},s=xn({...r??{},target:o,io:e,processors:n});return pe(t,s),In(s,t),$n(s,t)};var mP={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Gm=(t,e,n,i)=>{let r=n;r.type="string";let{minimum:o,maximum:s,format:c,patterns:u,contentEncoding:d}=t._zod.bag;if(typeof o=="number"&&(r.minLength=o),typeof s=="number"&&(r.maxLength=s),c&&(r.format=mP[c]??c,r.format===""&&delete r.format,c==="time"&&delete r.format),d&&(r.contentEncoding=d),u&&u.size>0){let l=[...u];l.length===1?r.pattern=l[0].source:l.length>1&&(r.allOf=[...l.map(p=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:p.source}))])}},Km=(t,e,n,i)=>{let r=n,{minimum:o,maximum:s,format:c,multipleOf:u,exclusiveMaximum:d,exclusiveMinimum:l}=t._zod.bag;typeof c=="string"&&c.includes("int")?r.type="integer":r.type="number";let p=typeof l=="number"&&l>=(o??Number.NEGATIVE_INFINITY),m=typeof d=="number"&&d<=(s??Number.POSITIVE_INFINITY),f=e.target==="draft-04"||e.target==="openapi-3.0";p?f?(r.minimum=l,r.exclusiveMinimum=!0):r.exclusiveMinimum=l:typeof o=="number"&&(r.minimum=o),m?f?(r.maximum=d,r.exclusiveMaximum=!0):r.exclusiveMaximum=d:typeof s=="number"&&(r.maximum=s),typeof u=="number"&&(r.multipleOf=u)},Wm=(t,e,n,i)=>{n.type="boolean"},Jm=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},Ym=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},Xm=(t,e,n,i)=>{e.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},Qm=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},ef=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},tf=(t,e,n,i)=>{n.not={}},nf=(t,e,n,i)=>{},rf=(t,e,n,i)=>{},of=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},sf=(t,e,n,i)=>{let r=t._zod.def,o=go(r.entries);o.every(s=>typeof s=="number")&&(n.type="number"),o.every(s=>typeof s=="string")&&(n.type="string"),n.enum=o},af=(t,e,n,i)=>{let r=t._zod.def,o=[];for(let s of r.values)if(s===void 0){if(e.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof s=="bigint"){if(e.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");o.push(Number(s))}else o.push(s);if(o.length!==0)if(o.length===1){let s=o[0];n.type=s===null?"null":typeof s,e.target==="draft-04"||e.target==="openapi-3.0"?n.enum=[s]:n.const=s}else o.every(s=>typeof s=="number")&&(n.type="number"),o.every(s=>typeof s=="string")&&(n.type="string"),o.every(s=>typeof s=="boolean")&&(n.type="boolean"),o.every(s=>s===null)&&(n.type="null"),n.enum=o},cf=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},uf=(t,e,n,i)=>{let r=n,o=t._zod.pattern;if(!o)throw new Error("Pattern not found in template literal");r.type="string",r.pattern=o.source},lf=(t,e,n,i)=>{let r=n,o={type:"string",format:"binary",contentEncoding:"binary"},{minimum:s,maximum:c,mime:u}=t._zod.bag;s!==void 0&&(o.minLength=s),c!==void 0&&(o.maxLength=c),u?u.length===1?(o.contentMediaType=u[0],Object.assign(r,o)):(Object.assign(r,o),r.anyOf=u.map(d=>({contentMediaType:d}))):Object.assign(r,o)},df=(t,e,n,i)=>{n.type="boolean"},pf=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},mf=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},ff=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},hf=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},gf=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},bf=(t,e,n,i)=>{let r=n,o=t._zod.def,{minimum:s,maximum:c}=t._zod.bag;typeof s=="number"&&(r.minItems=s),typeof c=="number"&&(r.maxItems=c),r.type="array",r.items=pe(o.element,e,{...i,path:[...i.path,"items"]})},_f=(t,e,n,i)=>{let r=n,o=t._zod.def;r.type="object",r.properties={};let s=o.shape;for(let d in s)r.properties[d]=pe(s[d],e,{...i,path:[...i.path,"properties",d]});let c=new Set(Object.keys(s)),u=new Set([...c].filter(d=>{let l=o.shape[d]._zod;return e.io==="input"?l.optin===void 0:l.optout===void 0}));u.size>0&&(r.required=Array.from(u)),o.catchall?._zod.def.type==="never"?r.additionalProperties=!1:o.catchall?o.catchall&&(r.additionalProperties=pe(o.catchall,e,{...i,path:[...i.path,"additionalProperties"]})):e.io==="output"&&(r.additionalProperties=!1)},Lu=(t,e,n,i)=>{let r=t._zod.def,o=r.inclusive===!1,s=r.options.map((c,u)=>pe(c,e,{...i,path:[...i.path,o?"oneOf":"anyOf",u]}));o?n.oneOf=s:n.anyOf=s},yf=(t,e,n,i)=>{let r=t._zod.def,o=pe(r.left,e,{...i,path:[...i.path,"allOf",0]}),s=pe(r.right,e,{...i,path:[...i.path,"allOf",1]}),c=d=>"allOf"in d&&Object.keys(d).length===1,u=[...c(o)?o.allOf:[o],...c(s)?s.allOf:[s]];n.allOf=u},vf=(t,e,n,i)=>{let r=n,o=t._zod.def;r.type="array";let s=e.target==="draft-2020-12"?"prefixItems":"items",c=e.target==="draft-2020-12"||e.target==="openapi-3.0"?"items":"additionalItems",u=o.items.map((m,f)=>pe(m,e,{...i,path:[...i.path,s,f]})),d=o.rest?pe(o.rest,e,{...i,path:[...i.path,c,...e.target==="openapi-3.0"?[o.items.length]:[]]}):null;e.target==="draft-2020-12"?(r.prefixItems=u,d&&(r.items=d)):e.target==="openapi-3.0"?(r.items={anyOf:u},d&&r.items.anyOf.push(d),r.minItems=u.length,d||(r.maxItems=u.length)):(r.items=u,d&&(r.additionalItems=d));let{minimum:l,maximum:p}=t._zod.bag;typeof l=="number"&&(r.minItems=l),typeof p=="number"&&(r.maxItems=p)},kf=(t,e,n,i)=>{let r=n,o=t._zod.def;r.type="object";let s=o.keyType,u=s._zod.bag?.patterns;if(o.mode==="loose"&&u&&u.size>0){let l=pe(o.valueType,e,{...i,path:[...i.path,"patternProperties","*"]});r.patternProperties={};for(let p of u)r.patternProperties[p.source]=l}else(e.target==="draft-07"||e.target==="draft-2020-12")&&(r.propertyNames=pe(o.keyType,e,{...i,path:[...i.path,"propertyNames"]})),r.additionalProperties=pe(o.valueType,e,{...i,path:[...i.path,"additionalProperties"]});let d=s._zod.values;if(d){let l=[...d].filter(p=>typeof p=="string"||typeof p=="number");l.length>0&&(r.required=l)}},Sf=(t,e,n,i)=>{let r=t._zod.def,o=pe(r.innerType,e,i),s=e.seen.get(t);e.target==="openapi-3.0"?(s.ref=r.innerType,n.nullable=!0):n.anyOf=[o,{type:"null"}]},xf=(t,e,n,i)=>{let r=t._zod.def;pe(r.innerType,e,i);let o=e.seen.get(t);o.ref=r.innerType},If=(t,e,n,i)=>{let r=t._zod.def;pe(r.innerType,e,i);let o=e.seen.get(t);o.ref=r.innerType,n.default=JSON.parse(JSON.stringify(r.defaultValue))},$f=(t,e,n,i)=>{let r=t._zod.def;pe(r.innerType,e,i);let o=e.seen.get(t);o.ref=r.innerType,e.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(r.defaultValue)))},wf=(t,e,n,i)=>{let r=t._zod.def;pe(r.innerType,e,i);let o=e.seen.get(t);o.ref=r.innerType;let s;try{s=r.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=s},Ef=(t,e,n,i)=>{let r=t._zod.def,o=r.in._zod.traits.has("$ZodTransform"),s=e.io==="input"?o?r.out:r.in:r.out;pe(s,e,i);let c=e.seen.get(t);c.ref=s},Tf=(t,e,n,i)=>{let r=t._zod.def;pe(r.innerType,e,i);let o=e.seen.get(t);o.ref=r.innerType,n.readOnly=!0},Rf=(t,e,n,i)=>{let r=t._zod.def;pe(r.innerType,e,i);let o=e.seen.get(t);o.ref=r.innerType},Zu=(t,e,n,i)=>{let r=t._zod.def;pe(r.innerType,e,i);let o=e.seen.get(t);o.ref=r.innerType},Of=(t,e,n,i)=>{let r=t._zod.innerType;pe(r,e,i);let o=e.seen.get(t);o.ref=r},Mu={string:Gm,number:Km,boolean:Wm,bigint:Jm,symbol:Ym,null:Xm,undefined:Qm,void:ef,never:tf,any:nf,unknown:rf,date:of,enum:sf,literal:af,nan:cf,template_literal:uf,file:lf,success:df,custom:pf,function:mf,transform:ff,map:hf,set:gf,array:bf,object:_f,union:Lu,intersection:yf,tuple:vf,record:kf,nullable:Sf,nonoptional:xf,default:If,prefault:$f,catch:wf,pipe:Ef,readonly:Tf,promise:Rf,optional:Zu,lazy:Of};function rr(t,e){if("_idmap"in t){let i=t,r=xn({...e,processors:Mu}),o={};for(let u of i._idmap.entries()){let[d,l]=u;pe(l,r)}let s={},c={registry:i,uri:e?.uri,defs:o};r.external=c;for(let u of i._idmap.entries()){let[d,l]=u;In(r,l),s[d]=$n(r,l)}if(Object.keys(o).length>0){let u=r.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[u]:o}}return{schemas:s}}let n=xn({...e,processors:Mu});return pe(t,n),In(n,t),$n(n,t)}var Bu=class{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(e){this.ctx.counter=e}get seen(){return this.ctx.seen}constructor(e){let n=e?.target??"draft-2020-12";n==="draft-4"&&(n="draft-04"),n==="draft-7"&&(n="draft-07"),this.ctx=xn({processors:Mu,target:n,...e?.metadata&&{metadata:e.metadata},...e?.unrepresentable&&{unrepresentable:e.unrepresentable},...e?.override&&{override:e.override},...e?.io&&{io:e.io}})}process(e,n={path:[],schemaPath:[]}){return pe(e,this.ctx,n)}emit(e,n){n&&(n.cycles&&(this.ctx.cycles=n.cycles),n.reused&&(this.ctx.reused=n.reused),n.external&&(this.ctx.external=n.external)),In(this.ctx,e);let i=$n(this.ctx,e),{"~standard":r,...o}=i;return o}};var fk={};var Qo={};en(Qo,{ZodAny:()=>Yf,ZodArray:()=>th,ZodBase64:()=>ul,ZodBase64URL:()=>ll,ZodBigInt:()=>ri,ZodBigIntFormat:()=>ml,ZodBoolean:()=>ni,ZodCIDRv4:()=>al,ZodCIDRv6:()=>cl,ZodCUID:()=>el,ZodCUID2:()=>tl,ZodCatch:()=>kh,ZodCodec:()=>ls,ZodCustom:()=>ds,ZodCustomStringFormat:()=>ei,ZodDate:()=>os,ZodDefault:()=>hh,ZodDiscriminatedUnion:()=>rh,ZodE164:()=>dl,ZodEmail:()=>Yu,ZodEmoji:()=>Xu,ZodEnum:()=>Xr,ZodExactOptional:()=>ph,ZodFile:()=>lh,ZodFunction:()=>Ph,ZodGUID:()=>es,ZodIPv4:()=>ol,ZodIPv6:()=>sl,ZodIntersection:()=>ih,ZodJWT:()=>pl,ZodKSUID:()=>il,ZodLazy:()=>Th,ZodLiteral:()=>uh,ZodMAC:()=>Gf,ZodMap:()=>ah,ZodNaN:()=>xh,ZodNanoID:()=>Qu,ZodNever:()=>Qf,ZodNonOptional:()=>gl,ZodNull:()=>Jf,ZodNullable:()=>fh,ZodNumber:()=>ti,ZodNumberFormat:()=>ir,ZodObject:()=>ss,ZodOptional:()=>oi,ZodPipe:()=>us,ZodPrefault:()=>bh,ZodPreprocess:()=>Ih,ZodPromise:()=>Oh,ZodReadonly:()=>$h,ZodRecord:()=>Yr,ZodSet:()=>ch,ZodString:()=>Qr,ZodStringFormat:()=>ge,ZodSuccess:()=>vh,ZodSymbol:()=>Kf,ZodTemplateLiteral:()=>Eh,ZodTransform:()=>dh,ZodTuple:()=>oh,ZodType:()=>K,ZodULID:()=>nl,ZodURL:()=>rs,ZodUUID:()=>Vt,ZodUndefined:()=>Wf,ZodUnion:()=>as,ZodUnknown:()=>Xf,ZodVoid:()=>eh,ZodXID:()=>rl,ZodXor:()=>nh,_ZodString:()=>Ju,_default:()=>gh,_function:()=>yS,any:()=>eS,array:()=>Q,base64:()=>jk,base64url:()=>Uk,bigint:()=>Wk,boolean:()=>Oe,catch:()=>Sh,check:()=>vS,cidrv4:()=>zk,cidrv6:()=>Dk,codec:()=>hS,cuid:()=>Ek,cuid2:()=>Tk,custom:()=>bl,date:()=>nS,describe:()=>kS,discriminatedUnion:()=>cs,e164:()=>Mk,email:()=>bk,emoji:()=>$k,enum:()=>Ue,exactOptional:()=>mh,file:()=>dS,float32:()=>Vk,float64:()=>Hk,function:()=>yS,guid:()=>_k,hash:()=>qk,hex:()=>Fk,hostname:()=>Bk,httpUrl:()=>Ik,instanceof:()=>xS,int:()=>Ku,int32:()=>Gk,int64:()=>Jk,intersection:()=>ii,invertCodec:()=>gS,ipv4:()=>Ak,ipv6:()=>Ck,json:()=>$S,jwt:()=>Lk,keyof:()=>rS,ksuid:()=>Pk,lazy:()=>Rh,literal:()=>L,looseObject:()=>je,looseRecord:()=>aS,mac:()=>Nk,map:()=>cS,meta:()=>SS,nan:()=>fS,nanoid:()=>wk,nativeEnum:()=>lS,never:()=>fl,nonoptional:()=>yh,null:()=>is,nullable:()=>ts,nullish:()=>pS,number:()=>ce,object:()=>N,optional:()=>ke,partialRecord:()=>sS,pipe:()=>Wu,prefault:()=>_h,preprocess:()=>ps,promise:()=>_S,readonly:()=>wh,record:()=>fe,refine:()=>Ah,set:()=>uS,strictObject:()=>iS,string:()=>_,stringFormat:()=>Zk,stringbool:()=>IS,success:()=>mS,superRefine:()=>Nh,symbol:()=>Xk,templateLiteral:()=>bS,transform:()=>hl,tuple:()=>sh,uint32:()=>Kk,uint64:()=>Yk,ulid:()=>Rk,undefined:()=>Qk,union:()=>_e,unknown:()=>be,url:()=>xk,uuid:()=>yk,uuidv4:()=>vk,uuidv6:()=>kk,uuidv7:()=>Sk,void:()=>tS,xid:()=>Ok,xor:()=>oS});var Fu={};en(Fu,{endsWith:()=>Fr,gt:()=>Ft,gte:()=>We,includes:()=>Zr,length:()=>tr,lowercase:()=>Mr,lt:()=>Bt,lte:()=>mt,maxLength:()=>er,maxSize:()=>Sn,mime:()=>qr,minLength:()=>nn,minSize:()=>qt,multipleOf:()=>kn,negative:()=>Tu,nonnegative:()=>Ou,nonpositive:()=>Ru,normalize:()=>Vr,overwrite:()=>Rt,positive:()=>Eu,property:()=>Pu,regex:()=>Ur,size:()=>Qn,slugify:()=>Wr,startsWith:()=>Br,toLowerCase:()=>Gr,toUpperCase:()=>Kr,trim:()=>Hr,uppercase:()=>Lr});var wn={};en(wn,{ZodISODate:()=>Vu,ZodISODateTime:()=>qu,ZodISODuration:()=>Gu,ZodISOTime:()=>Hu,date:()=>Af,datetime:()=>Pf,duration:()=>Cf,time:()=>Nf});var qu=g("ZodISODateTime",(t,e)=>{wm.init(t,e),ge.init(t,e)});function Pf(t){return jm(qu,t)}var Vu=g("ZodISODate",(t,e)=>{Em.init(t,e),ge.init(t,e)});function Af(t){return Um(Vu,t)}var Hu=g("ZodISOTime",(t,e)=>{Tm.init(t,e),ge.init(t,e)});function Nf(t){return Mm(Hu,t)}var Gu=g("ZodISODuration",(t,e)=>{Rm.init(t,e),ge.init(t,e)});function Cf(t){return Lm(Gu,t)}var hk=(t,e)=>{ko.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:n=>xo(t,n)},flatten:{value:n=>So(t,n)},addIssue:{value:n=>{t.issues.push(n),t.message=JSON.stringify(t.issues,xr,2)}},addIssues:{value:n=>{t.issues.push(...n),t.message=JSON.stringify(t.issues,xr,2)}},isEmpty:{get(){return t.issues.length===0}}})},hP=g("ZodError",hk),ot=g("ZodError",hk,{Parent:Error});var zf=wr(ot),Df=Er(ot),jf=Tr(ot),Uf=Rr(ot),Mf=Da(ot),Lf=ja(ot),Zf=Ua(ot),Bf=Ma(ot),Ff=La(ot),qf=Za(ot),Vf=Ba(ot),Hf=Fa(ot);var gk=new WeakMap;function ns(t,e,n){let i=Object.getPrototypeOf(t),r=gk.get(i);if(r||(r=new Set,gk.set(i,r)),!r.has(e)){r.add(e);for(let o in n){let s=n[o];Object.defineProperty(i,o,{configurable:!0,enumerable:!1,get(){let c=s.bind(this);return Object.defineProperty(this,o,{configurable:!0,writable:!0,enumerable:!0,value:c}),c},set(c){Object.defineProperty(this,o,{configurable:!0,writable:!0,enumerable:!0,value:c})}})}}}var K=g("ZodType",(t,e)=>(H.init(t,e),Object.assign(t["~standard"],{jsonSchema:{input:Jr(t,"input"),output:Jr(t,"output")}}),t.toJSONSchema=Hm(t,{}),t.def=e,t.type=e.type,Object.defineProperty(t,"_def",{value:e}),t.parse=(n,i)=>zf(t,n,i,{callee:t.parse}),t.safeParse=(n,i)=>jf(t,n,i),t.parseAsync=async(n,i)=>Df(t,n,i,{callee:t.parseAsync}),t.safeParseAsync=async(n,i)=>Uf(t,n,i),t.spa=t.safeParseAsync,t.encode=(n,i)=>Mf(t,n,i),t.decode=(n,i)=>Lf(t,n,i),t.encodeAsync=async(n,i)=>Zf(t,n,i),t.decodeAsync=async(n,i)=>Bf(t,n,i),t.safeEncode=(n,i)=>Ff(t,n,i),t.safeDecode=(n,i)=>qf(t,n,i),t.safeEncodeAsync=async(n,i)=>Vf(t,n,i),t.safeDecodeAsync=async(n,i)=>Hf(t,n,i),ns(t,"ZodType",{check(...n){let i=this.def;return this.clone(I.mergeDefs(i,{checks:[...i.checks??[],...n.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0})},with(...n){return this.check(...n)},clone(n,i){return ze(this,n,i)},brand(){return this},register(n,i){return n.add(this,i),this},refine(n,i){return this.check(Ah(n,i))},superRefine(n,i){return this.check(Nh(n,i))},overwrite(n){return this.check(Rt(n))},optional(){return ke(this)},exactOptional(){return mh(this)},nullable(){return ts(this)},nullish(){return ke(ts(this))},nonoptional(n){return yh(this,n)},array(){return Q(this)},or(n){return _e([this,n])},and(n){return ii(this,n)},transform(n){return Wu(this,hl(n))},default(n){return gh(this,n)},prefault(n){return _h(this,n)},catch(n){return Sh(this,n)},pipe(n){return Wu(this,n)},readonly(){return wh(this)},describe(n){let i=this.clone();return De.add(i,{description:n}),i},meta(...n){if(n.length===0)return De.get(this);let i=this.clone();return De.add(i,n[0]),i},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(n){return n(this)}}),Object.defineProperty(t,"description",{get(){return De.get(t)?.description},configurable:!0}),t)),Ju=g("_ZodString",(t,e)=>{vn.init(t,e),K.init(t,e),t._zod.processJSONSchema=(i,r,o)=>Gm(t,i,r,o);let n=t._zod.bag;t.format=n.format??null,t.minLength=n.minimum??null,t.maxLength=n.maximum??null,ns(t,"_ZodString",{regex(...i){return this.check(Ur(...i))},includes(...i){return this.check(Zr(...i))},startsWith(...i){return this.check(Br(...i))},endsWith(...i){return this.check(Fr(...i))},min(...i){return this.check(nn(...i))},max(...i){return this.check(er(...i))},length(...i){return this.check(tr(...i))},nonempty(...i){return this.check(nn(1,...i))},lowercase(i){return this.check(Mr(i))},uppercase(i){return this.check(Lr(i))},trim(){return this.check(Hr())},normalize(...i){return this.check(Vr(...i))},toLowerCase(){return this.check(Gr())},toUpperCase(){return this.check(Kr())},slugify(){return this.check(Wr())}})}),Qr=g("ZodString",(t,e)=>{vn.init(t,e),Ju.init(t,e),t.email=n=>t.check(No(Yu,n)),t.url=n=>t.check(jr(rs,n)),t.jwt=n=>t.check(Xo(pl,n)),t.emoji=n=>t.check(Uo(Xu,n)),t.guid=n=>t.check(Dr(es,n)),t.uuid=n=>t.check(Co(Vt,n)),t.uuidv4=n=>t.check(zo(Vt,n)),t.uuidv6=n=>t.check(Do(Vt,n)),t.uuidv7=n=>t.check(jo(Vt,n)),t.nanoid=n=>t.check(Mo(Qu,n)),t.guid=n=>t.check(Dr(es,n)),t.cuid=n=>t.check(Lo(el,n)),t.cuid2=n=>t.check(Zo(tl,n)),t.ulid=n=>t.check(Bo(nl,n)),t.base64=n=>t.check(Wo(ul,n)),t.base64url=n=>t.check(Jo(ll,n)),t.xid=n=>t.check(Fo(rl,n)),t.ksuid=n=>t.check(qo(il,n)),t.ipv4=n=>t.check(Vo(ol,n)),t.ipv6=n=>t.check(Ho(sl,n)),t.cidrv4=n=>t.check(Go(al,n)),t.cidrv6=n=>t.check(Ko(cl,n)),t.e164=n=>t.check(Yo(dl,n)),t.datetime=n=>t.check(Pf(n)),t.date=n=>t.check(Af(n)),t.time=n=>t.check(Nf(n)),t.duration=n=>t.check(Cf(n))});function _(t){return su(Qr,t)}var ge=g("ZodStringFormat",(t,e)=>{me.init(t,e),Ju.init(t,e)}),Yu=g("ZodEmail",(t,e)=>{ec.init(t,e),ge.init(t,e)});function bk(t){return No(Yu,t)}var es=g("ZodGUID",(t,e)=>{Xa.init(t,e),ge.init(t,e)});function _k(t){return Dr(es,t)}var Vt=g("ZodUUID",(t,e)=>{Qa.init(t,e),ge.init(t,e)});function yk(t){return Co(Vt,t)}function vk(t){return zo(Vt,t)}function kk(t){return Do(Vt,t)}function Sk(t){return jo(Vt,t)}var rs=g("ZodURL",(t,e)=>{tc.init(t,e),ge.init(t,e)});function xk(t){return jr(rs,t)}function Ik(t){return jr(rs,{protocol:it.httpProtocol,hostname:it.domain,...I.normalizeParams(t)})}var Xu=g("ZodEmoji",(t,e)=>{nc.init(t,e),ge.init(t,e)});function $k(t){return Uo(Xu,t)}var Qu=g("ZodNanoID",(t,e)=>{rc.init(t,e),ge.init(t,e)});function wk(t){return Mo(Qu,t)}var el=g("ZodCUID",(t,e)=>{ic.init(t,e),ge.init(t,e)});function Ek(t){return Lo(el,t)}var tl=g("ZodCUID2",(t,e)=>{oc.init(t,e),ge.init(t,e)});function Tk(t){return Zo(tl,t)}var nl=g("ZodULID",(t,e)=>{sc.init(t,e),ge.init(t,e)});function Rk(t){return Bo(nl,t)}var rl=g("ZodXID",(t,e)=>{ac.init(t,e),ge.init(t,e)});function Ok(t){return Fo(rl,t)}var il=g("ZodKSUID",(t,e)=>{cc.init(t,e),ge.init(t,e)});function Pk(t){return qo(il,t)}var ol=g("ZodIPv4",(t,e)=>{uc.init(t,e),ge.init(t,e)});function Ak(t){return Vo(ol,t)}var Gf=g("ZodMAC",(t,e)=>{dc.init(t,e),ge.init(t,e)});function Nk(t){return au(Gf,t)}var sl=g("ZodIPv6",(t,e)=>{lc.init(t,e),ge.init(t,e)});function Ck(t){return Ho(sl,t)}var al=g("ZodCIDRv4",(t,e)=>{pc.init(t,e),ge.init(t,e)});function zk(t){return Go(al,t)}var cl=g("ZodCIDRv6",(t,e)=>{mc.init(t,e),ge.init(t,e)});function Dk(t){return Ko(cl,t)}var ul=g("ZodBase64",(t,e)=>{fc.init(t,e),ge.init(t,e)});function jk(t){return Wo(ul,t)}var ll=g("ZodBase64URL",(t,e)=>{hc.init(t,e),ge.init(t,e)});function Uk(t){return Jo(ll,t)}var dl=g("ZodE164",(t,e)=>{gc.init(t,e),ge.init(t,e)});function Mk(t){return Yo(dl,t)}var pl=g("ZodJWT",(t,e)=>{bc.init(t,e),ge.init(t,e)});function Lk(t){return Xo(pl,t)}var ei=g("ZodCustomStringFormat",(t,e)=>{_c.init(t,e),ge.init(t,e)});function Zk(t,e,n={}){return nr(ei,t,e,n)}function Bk(t){return nr(ei,"hostname",it.hostname,t)}function Fk(t){return nr(ei,"hex",it.hex,t)}function qk(t,e){let n=e?.enc??"hex",i=`${t}_${n}`,r=it[i];if(!r)throw new Error(`Unrecognized hash format: ${i}`);return nr(ei,i,r,e)}var ti=g("ZodNumber",(t,e)=>{Eo.init(t,e),K.init(t,e),t._zod.processJSONSchema=(i,r,o)=>Km(t,i,r,o),ns(t,"ZodNumber",{gt(i,r){return this.check(Ft(i,r))},gte(i,r){return this.check(We(i,r))},min(i,r){return this.check(We(i,r))},lt(i,r){return this.check(Bt(i,r))},lte(i,r){return this.check(mt(i,r))},max(i,r){return this.check(mt(i,r))},int(i){return this.check(Ku(i))},safe(i){return this.check(Ku(i))},positive(i){return this.check(Ft(0,i))},nonnegative(i){return this.check(We(0,i))},negative(i){return this.check(Bt(0,i))},nonpositive(i){return this.check(mt(0,i))},multipleOf(i,r){return this.check(kn(i,r))},step(i,r){return this.check(kn(i,r))},finite(){return this}});let n=t._zod.bag;t.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),t.isFinite=!0,t.format=n.format??null});function ce(t){return cu(ti,t)}var ir=g("ZodNumberFormat",(t,e)=>{yc.init(t,e),ti.init(t,e)});function Ku(t){return uu(ir,t)}function Vk(t){return lu(ir,t)}function Hk(t){return du(ir,t)}function Gk(t){return pu(ir,t)}function Kk(t){return mu(ir,t)}var ni=g("ZodBoolean",(t,e)=>{Pr.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Wm(t,n,i,r)});function Oe(t){return fu(ni,t)}var ri=g("ZodBigInt",(t,e)=>{To.init(t,e),K.init(t,e),t._zod.processJSONSchema=(i,r,o)=>Jm(t,i,r,o),t.gte=(i,r)=>t.check(We(i,r)),t.min=(i,r)=>t.check(We(i,r)),t.gt=(i,r)=>t.check(Ft(i,r)),t.gte=(i,r)=>t.check(We(i,r)),t.min=(i,r)=>t.check(We(i,r)),t.lt=(i,r)=>t.check(Bt(i,r)),t.lte=(i,r)=>t.check(mt(i,r)),t.max=(i,r)=>t.check(mt(i,r)),t.positive=i=>t.check(Ft(BigInt(0),i)),t.negative=i=>t.check(Bt(BigInt(0),i)),t.nonpositive=i=>t.check(mt(BigInt(0),i)),t.nonnegative=i=>t.check(We(BigInt(0),i)),t.multipleOf=(i,r)=>t.check(kn(i,r));let n=t._zod.bag;t.minValue=n.minimum??null,t.maxValue=n.maximum??null,t.format=n.format??null});function Wk(t){return hu(ri,t)}var ml=g("ZodBigIntFormat",(t,e)=>{vc.init(t,e),ri.init(t,e)});function Jk(t){return gu(ml,t)}function Yk(t){return bu(ml,t)}var Kf=g("ZodSymbol",(t,e)=>{kc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Ym(t,n,i,r)});function Xk(t){return _u(Kf,t)}var Wf=g("ZodUndefined",(t,e)=>{Sc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Qm(t,n,i,r)});function Qk(t){return yu(Wf,t)}var Jf=g("ZodNull",(t,e)=>{xc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Xm(t,n,i,r)});function is(t){return vu(Jf,t)}var Yf=g("ZodAny",(t,e)=>{Ic.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,i,r)=>nf(t,n,i,r)});function eS(){return ku(Yf)}var Xf=g("ZodUnknown",(t,e)=>{$c.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,i,r)=>rf(t,n,i,r)});function be(){return Su(Xf)}var Qf=g("ZodNever",(t,e)=>{wc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,i,r)=>tf(t,n,i,r)});function fl(t){return xu(Qf,t)}var eh=g("ZodVoid",(t,e)=>{Ec.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,i,r)=>ef(t,n,i,r)});function tS(t){return Iu(eh,t)}var os=g("ZodDate",(t,e)=>{Tc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(i,r,o)=>of(t,i,r,o),t.min=(i,r)=>t.check(We(i,r)),t.max=(i,r)=>t.check(mt(i,r));let n=t._zod.bag;t.minDate=n.minimum?new Date(n.minimum):null,t.maxDate=n.maximum?new Date(n.maximum):null});function nS(t){return $u(os,t)}var th=g("ZodArray",(t,e)=>{Rc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,i,r)=>bf(t,n,i,r),t.element=e.element,ns(t,"ZodArray",{min(n,i){return this.check(nn(n,i))},nonempty(n){return this.check(nn(1,n))},max(n,i){return this.check(er(n,i))},length(n,i){return this.check(tr(n,i))},unwrap(){return this.element}})});function Q(t,e){return Vm(th,t,e)}function rS(t){let e=t._zod.def.shape;return Ue(Object.keys(e))}var ss=g("ZodObject",(t,e)=>{Pm.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,i,r)=>_f(t,n,i,r),I.defineLazy(t,"shape",()=>e.shape),ns(t,"ZodObject",{keyof(){return Ue(Object.keys(this._zod.def.shape))},catchall(n){return this.clone({...this._zod.def,catchall:n})},passthrough(){return this.clone({...this._zod.def,catchall:be()})},loose(){return this.clone({...this._zod.def,catchall:be()})},strict(){return this.clone({...this._zod.def,catchall:fl()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(n){return I.extend(this,n)},safeExtend(n){return I.safeExtend(this,n)},merge(n){return I.merge(this,n)},pick(n){return I.pick(this,n)},omit(n){return I.omit(this,n)},partial(...n){return I.partial(oi,this,n[0])},required(...n){return I.required(gl,this,n[0])}})});function N(t,e){let n={type:"object",shape:t??{},...I.normalizeParams(e)};return new ss(n)}function iS(t,e){return new ss({type:"object",shape:t,catchall:fl(),...I.normalizeParams(e)})}function je(t,e){return new ss({type:"object",shape:t,catchall:be(),...I.normalizeParams(e)})}var as=g("ZodUnion",(t,e)=>{Ar.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Lu(t,n,i,r),t.options=e.options});function _e(t,e){return new as({type:"union",options:t,...I.normalizeParams(e)})}var nh=g("ZodXor",(t,e)=>{as.init(t,e),Pc.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Lu(t,n,i,r),t.options=e.options});function oS(t,e){return new nh({type:"union",options:t,inclusive:!1,...I.normalizeParams(e)})}var rh=g("ZodDiscriminatedUnion",(t,e)=>{as.init(t,e),Ac.init(t,e)});function cs(t,e,n){return new rh({type:"union",options:e,discriminator:t,...I.normalizeParams(n)})}var ih=g("ZodIntersection",(t,e)=>{Nc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,i,r)=>yf(t,n,i,r)});function ii(t,e){return new ih({type:"intersection",left:t,right:e})}var oh=g("ZodTuple",(t,e)=>{Ro.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,i,r)=>vf(t,n,i,r),t.rest=n=>t.clone({...t._zod.def,rest:n})});function sh(t,e,n){let i=e instanceof H,r=i?n:e,o=i?e:null;return new oh({type:"tuple",items:t,rest:o,...I.normalizeParams(r)})}var Yr=g("ZodRecord",(t,e)=>{Cc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,i,r)=>kf(t,n,i,r),t.keyType=e.keyType,t.valueType=e.valueType});function fe(t,e,n){return!e||!e._zod?new Yr({type:"record",keyType:_(),valueType:t,...I.normalizeParams(e)}):new Yr({type:"record",keyType:t,valueType:e,...I.normalizeParams(n)})}function sS(t,e,n){let i=ze(t);return i._zod.values=void 0,new Yr({type:"record",keyType:i,valueType:e,...I.normalizeParams(n)})}function aS(t,e,n){return new Yr({type:"record",keyType:t,valueType:e,mode:"loose",...I.normalizeParams(n)})}var ah=g("ZodMap",(t,e)=>{zc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,i,r)=>hf(t,n,i,r),t.keyType=e.keyType,t.valueType=e.valueType,t.min=(...n)=>t.check(qt(...n)),t.nonempty=n=>t.check(qt(1,n)),t.max=(...n)=>t.check(Sn(...n)),t.size=(...n)=>t.check(Qn(...n))});function cS(t,e,n){return new ah({type:"map",keyType:t,valueType:e,...I.normalizeParams(n)})}var ch=g("ZodSet",(t,e)=>{Dc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,i,r)=>gf(t,n,i,r),t.min=(...n)=>t.check(qt(...n)),t.nonempty=n=>t.check(qt(1,n)),t.max=(...n)=>t.check(Sn(...n)),t.size=(...n)=>t.check(Qn(...n))});function uS(t,e){return new ch({type:"set",valueType:t,...I.normalizeParams(e)})}var Xr=g("ZodEnum",(t,e)=>{jc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(i,r,o)=>sf(t,i,r,o),t.enum=e.entries,t.options=Object.values(e.entries);let n=new Set(Object.keys(e.entries));t.extract=(i,r)=>{let o={};for(let s of i)if(n.has(s))o[s]=e.entries[s];else throw new Error(`Key ${s} not found in enum`);return new Xr({...e,checks:[],...I.normalizeParams(r),entries:o})},t.exclude=(i,r)=>{let o={...e.entries};for(let s of i)if(n.has(s))delete o[s];else throw new Error(`Key ${s} not found in enum`);return new Xr({...e,checks:[],...I.normalizeParams(r),entries:o})}});function Ue(t,e){let n=Array.isArray(t)?Object.fromEntries(t.map(i=>[i,i])):t;return new Xr({type:"enum",entries:n,...I.normalizeParams(e)})}function lS(t,e){return new Xr({type:"enum",entries:t,...I.normalizeParams(e)})}var uh=g("ZodLiteral",(t,e)=>{Uc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,i,r)=>af(t,n,i,r),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function L(t,e){return new uh({type:"literal",values:Array.isArray(t)?t:[t],...I.normalizeParams(e)})}var lh=g("ZodFile",(t,e)=>{Mc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,i,r)=>lf(t,n,i,r),t.min=(n,i)=>t.check(qt(n,i)),t.max=(n,i)=>t.check(Sn(n,i)),t.mime=(n,i)=>t.check(qr(Array.isArray(n)?n:[n],i))});function dS(t){return Au(lh,t)}var dh=g("ZodTransform",(t,e)=>{Lc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,i,r)=>ff(t,n,i,r),t._zod.parse=(n,i)=>{if(i.direction==="backward")throw new mn(t.constructor.name);n.addIssue=o=>{if(typeof o=="string")n.issues.push(I.issue(o,n.value,e));else{let s=o;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=n.value),s.inst??(s.inst=t),n.issues.push(I.issue(s))}};let r=e.transform(n.value,n);return r instanceof Promise?r.then(o=>(n.value=o,n.fallback=!0,n)):(n.value=r,n.fallback=!0,n)}});function hl(t){return new dh({type:"transform",transform:t})}var oi=g("ZodOptional",(t,e)=>{Oo.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Zu(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});function ke(t){return new oi({type:"optional",innerType:t})}var ph=g("ZodExactOptional",(t,e)=>{Zc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Zu(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});function mh(t){return new ph({type:"optional",innerType:t})}var fh=g("ZodNullable",(t,e)=>{Bc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Sf(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});function ts(t){return new fh({type:"nullable",innerType:t})}function pS(t){return ke(ts(t))}var hh=g("ZodDefault",(t,e)=>{Fc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,i,r)=>If(t,n,i,r),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function gh(t,e){return new hh({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():I.shallowClone(e)}})}var bh=g("ZodPrefault",(t,e)=>{qc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,i,r)=>$f(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});function _h(t,e){return new bh({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():I.shallowClone(e)}})}var gl=g("ZodNonOptional",(t,e)=>{Vc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,i,r)=>xf(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});function yh(t,e){return new gl({type:"nonoptional",innerType:t,...I.normalizeParams(e)})}var vh=g("ZodSuccess",(t,e)=>{Hc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,i,r)=>df(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});function mS(t){return new vh({type:"success",innerType:t})}var kh=g("ZodCatch",(t,e)=>{Gc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,i,r)=>wf(t,n,i,r),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function Sh(t,e){return new kh({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}var xh=g("ZodNaN",(t,e)=>{Kc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,i,r)=>cf(t,n,i,r)});function fS(t){return wu(xh,t)}var us=g("ZodPipe",(t,e)=>{Po.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Ef(t,n,i,r),t.in=e.in,t.out=e.out});function Wu(t,e){return new us({type:"pipe",in:t,out:e})}var ls=g("ZodCodec",(t,e)=>{us.init(t,e),Nr.init(t,e)});function hS(t,e,n){return new ls({type:"pipe",in:t,out:e,transform:n.decode,reverseTransform:n.encode})}function gS(t){let e=t._zod.def;return new ls({type:"pipe",in:e.out,out:e.in,transform:e.reverseTransform,reverseTransform:e.transform})}var Ih=g("ZodPreprocess",(t,e)=>{us.init(t,e),Am.init(t,e)}),$h=g("ZodReadonly",(t,e)=>{Wc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Tf(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});function wh(t){return new $h({type:"readonly",innerType:t})}var Eh=g("ZodTemplateLiteral",(t,e)=>{Jc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,i,r)=>uf(t,n,i,r)});function bS(t,e){return new Eh({type:"template_literal",parts:t,...I.normalizeParams(e)})}var Th=g("ZodLazy",(t,e)=>{Qc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Of(t,n,i,r),t.unwrap=()=>t._zod.def.getter()});function Rh(t){return new Th({type:"lazy",getter:t})}var Oh=g("ZodPromise",(t,e)=>{Xc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Rf(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});function _S(t){return new Oh({type:"promise",innerType:t})}var Ph=g("ZodFunction",(t,e)=>{Yc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,i,r)=>mf(t,n,i,r)});function yS(t){return new Ph({type:"function",input:Array.isArray(t?.input)?sh(t?.input):t?.input??Q(be()),output:t?.output??be()})}var ds=g("ZodCustom",(t,e)=>{eu.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,i,r)=>pf(t,n,i,r)});function vS(t){let e=new he({check:"custom"});return e._zod.check=t,e}function bl(t,e){return Nu(ds,t??(()=>!0),e)}function Ah(t,e={}){return Cu(ds,t,e)}function Nh(t,e){return zu(t,e)}var kS=Du,SS=ju;function xS(t,e={}){let n=new ds({type:"custom",check:"custom",fn:i=>i instanceof t,abort:!0,...I.normalizeParams(e)});return n._zod.bag.Class=t,n._zod.check=i=>{i.value instanceof t||i.issues.push({code:"invalid_type",expected:t.name,input:i.value,inst:n,path:[...n._zod.def.path??[]]})},n}var IS=(...t)=>Uu({Codec:ls,Boolean:ni,String:Qr},...t);function $S(t){let e=Rh(()=>_e([_(t),ce(),Oe(),is(),Q(e),fe(_(),e)]));return e}function ps(t,e){return new Ih({type:"pipe",in:hl(t),out:e})}var bP={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 _P(t){Re({customError:t})}function yP(){return Re().customError}var Ch;Ch||(Ch={});var R={...Qo,...Fu,iso:wn},vP=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function kP(t,e){let n=t.$schema;return n==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":n==="http://json-schema.org/draft-07/schema#"?"draft-7":n==="http://json-schema.org/draft-04/schema#"?"draft-4":e??"draft-2020-12"}function SP(t,e){if(!t.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let n=t.slice(1).split("/").filter(Boolean);if(n.length===0)return e.rootSchema;let i=e.version==="draft-2020-12"?"$defs":"definitions";if(n[0]===i){let r=n[1];if(!r||!e.defs[r])throw new Error(`Reference not found: ${t}`);return e.defs[r]}throw new Error(`Reference not found: ${t}`)}function wS(t,e){if(t.not!==void 0){if(typeof t.not=="object"&&Object.keys(t.not).length===0)return R.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(t.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(t.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(t.if!==void 0||t.then!==void 0||t.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(t.dependentSchemas!==void 0||t.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(t.$ref){let r=t.$ref;if(e.refs.has(r))return e.refs.get(r);if(e.processing.has(r))return R.lazy(()=>{if(!e.refs.has(r))throw new Error(`Circular reference not resolved: ${r}`);return e.refs.get(r)});e.processing.add(r);let o=SP(r,e),s=Fe(o,e);return e.refs.set(r,s),e.processing.delete(r),s}if(t.enum!==void 0){let r=t.enum;if(e.version==="openapi-3.0"&&t.nullable===!0&&r.length===1&&r[0]===null)return R.null();if(r.length===0)return R.never();if(r.length===1)return R.literal(r[0]);if(r.every(s=>typeof s=="string"))return R.enum(r);let o=r.map(s=>R.literal(s));return o.length<2?o[0]:R.union([o[0],o[1],...o.slice(2)])}if(t.const!==void 0)return R.literal(t.const);let n=t.type;if(Array.isArray(n)){let r=n.map(o=>{let s={...t,type:o};return wS(s,e)});return r.length===0?R.never():r.length===1?r[0]:R.union(r)}if(!n)return R.any();let i;switch(n){case"string":{let r=R.string();if(t.format){let o=t.format;o==="email"?r=r.check(R.email()):o==="uri"||o==="uri-reference"?r=r.check(R.url()):o==="uuid"||o==="guid"?r=r.check(R.uuid()):o==="date-time"?r=r.check(R.iso.datetime()):o==="date"?r=r.check(R.iso.date()):o==="time"?r=r.check(R.iso.time()):o==="duration"?r=r.check(R.iso.duration()):o==="ipv4"?r=r.check(R.ipv4()):o==="ipv6"?r=r.check(R.ipv6()):o==="mac"?r=r.check(R.mac()):o==="cidr"?r=r.check(R.cidrv4()):o==="cidr-v6"?r=r.check(R.cidrv6()):o==="base64"?r=r.check(R.base64()):o==="base64url"?r=r.check(R.base64url()):o==="e164"?r=r.check(R.e164()):o==="jwt"?r=r.check(R.jwt()):o==="emoji"?r=r.check(R.emoji()):o==="nanoid"?r=r.check(R.nanoid()):o==="cuid"?r=r.check(R.cuid()):o==="cuid2"?r=r.check(R.cuid2()):o==="ulid"?r=r.check(R.ulid()):o==="xid"?r=r.check(R.xid()):o==="ksuid"&&(r=r.check(R.ksuid()))}typeof t.minLength=="number"&&(r=r.min(t.minLength)),typeof t.maxLength=="number"&&(r=r.max(t.maxLength)),t.pattern&&(r=r.regex(new RegExp(t.pattern))),i=r;break}case"number":case"integer":{let r=n==="integer"?R.number().int():R.number();typeof t.minimum=="number"&&(r=r.min(t.minimum)),typeof t.maximum=="number"&&(r=r.max(t.maximum)),typeof t.exclusiveMinimum=="number"?r=r.gt(t.exclusiveMinimum):t.exclusiveMinimum===!0&&typeof t.minimum=="number"&&(r=r.gt(t.minimum)),typeof t.exclusiveMaximum=="number"?r=r.lt(t.exclusiveMaximum):t.exclusiveMaximum===!0&&typeof t.maximum=="number"&&(r=r.lt(t.maximum)),typeof t.multipleOf=="number"&&(r=r.multipleOf(t.multipleOf)),i=r;break}case"boolean":{i=R.boolean();break}case"null":{i=R.null();break}case"object":{let r={},o=t.properties||{},s=new Set(t.required||[]);for(let[u,d]of Object.entries(o)){let l=Fe(d,e);r[u]=s.has(u)?l:l.optional()}if(t.propertyNames){let u=Fe(t.propertyNames,e),d=t.additionalProperties&&typeof t.additionalProperties=="object"?Fe(t.additionalProperties,e):R.any();if(Object.keys(r).length===0){i=R.record(u,d);break}let l=R.object(r).passthrough(),p=R.looseRecord(u,d);i=R.intersection(l,p);break}if(t.patternProperties){let u=t.patternProperties,d=Object.keys(u),l=[];for(let m of d){let f=Fe(u[m],e),h=R.string().regex(new RegExp(m));l.push(R.looseRecord(h,f))}let p=[];if(Object.keys(r).length>0&&p.push(R.object(r).passthrough()),p.push(...l),p.length===0)i=R.object({}).passthrough();else if(p.length===1)i=p[0];else{let m=R.intersection(p[0],p[1]);for(let f=2;f<p.length;f++)m=R.intersection(m,p[f]);i=m}break}let c=R.object(r);t.additionalProperties===!1?i=c.strict():typeof t.additionalProperties=="object"?i=c.catchall(Fe(t.additionalProperties,e)):i=c.passthrough();break}case"array":{let r=t.prefixItems,o=t.items;if(r&&Array.isArray(r)){let s=r.map(u=>Fe(u,e)),c=o&&typeof o=="object"&&!Array.isArray(o)?Fe(o,e):void 0;c?i=R.tuple(s).rest(c):i=R.tuple(s),typeof t.minItems=="number"&&(i=i.check(R.minLength(t.minItems))),typeof t.maxItems=="number"&&(i=i.check(R.maxLength(t.maxItems)))}else if(Array.isArray(o)){let s=o.map(u=>Fe(u,e)),c=t.additionalItems&&typeof t.additionalItems=="object"?Fe(t.additionalItems,e):void 0;c?i=R.tuple(s).rest(c):i=R.tuple(s),typeof t.minItems=="number"&&(i=i.check(R.minLength(t.minItems))),typeof t.maxItems=="number"&&(i=i.check(R.maxLength(t.maxItems)))}else if(o!==void 0){let s=Fe(o,e),c=R.array(s);typeof t.minItems=="number"&&(c=c.min(t.minItems)),typeof t.maxItems=="number"&&(c=c.max(t.maxItems)),i=c}else i=R.array(R.any());break}default:throw new Error(`Unsupported type: ${n}`)}return i}function Fe(t,e){if(typeof t=="boolean")return t?R.any():R.never();let n=wS(t,e),i=t.type||t.enum!==void 0||t.const!==void 0;if(t.anyOf&&Array.isArray(t.anyOf)){let c=t.anyOf.map(d=>Fe(d,e)),u=R.union(c);n=i?R.intersection(n,u):u}if(t.oneOf&&Array.isArray(t.oneOf)){let c=t.oneOf.map(d=>Fe(d,e)),u=R.xor(c);n=i?R.intersection(n,u):u}if(t.allOf&&Array.isArray(t.allOf))if(t.allOf.length===0)n=i?n:R.any();else{let c=i?n:Fe(t.allOf[0],e),u=i?0:1;for(let d=u;d<t.allOf.length;d++)c=R.intersection(c,Fe(t.allOf[d],e));n=c}t.nullable===!0&&e.version==="openapi-3.0"&&(n=R.nullable(n)),t.readOnly===!0&&(n=R.readonly(n)),t.default!==void 0&&(n=n.default(t.default));let r={},o=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let c of o)c in t&&(r[c]=t[c]);let s=["contentEncoding","contentMediaType","contentSchema"];for(let c of s)c in t&&(r[c]=t[c]);for(let c of Object.keys(t))vP.has(c)||(r[c]=t[c]);return Object.keys(r).length>0&&e.registry.add(n,r),t.description&&(n=n.describe(t.description)),n}function ES(t,e){if(typeof t=="boolean")return t?R.any():R.never();let n;try{n=JSON.parse(JSON.stringify(t))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let i=kP(n,e?.defaultTarget),r=n.$defs||n.definitions||{},o={version:i,defs:r,refs:new Map,processing:new Set,rootSchema:n,registry:e?.registry??De};return Fe(n,o)}var zh={};en(zh,{bigint:()=>wP,boolean:()=>$P,date:()=>EP,number:()=>IP,string:()=>xP});function xP(t){return zm(Qr,t)}function IP(t){return Zm(ti,t)}function $P(t){return Bm(ni,t)}function wP(t){return Fm(ri,t)}function EP(t){return qm(os,t)}Re(tu());var jh="2025-11-25";var TS=[jh,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],En="io.modelcontextprotocol/related-task",yl="2.0",Ne=bl(t=>t!==null&&(typeof t=="object"||typeof t=="function")),RS=_e([_(),ce().int()]),OS=_(),uq=je({ttl:ce().optional(),pollInterval:ce().optional()}),TP=N({ttl:ce().optional()}),RP=N({taskId:_()}),Uh=je({progressToken:RS.optional(),[En]:RP.optional()}),ft=N({_meta:Uh.optional()}),ms=ft.extend({task:TP.optional()}),PS=t=>ms.safeParse(t).success,Me=N({method:_(),params:ft.loose().optional()}),yt=N({_meta:Uh.optional()}),vt=N({method:_(),params:yt.loose().optional()}),Le=je({_meta:Uh.optional()}),vl=_e([_(),ce().int()]),AS=N({jsonrpc:L(yl),id:vl,...Me.shape}).strict(),Mh=t=>AS.safeParse(t).success,NS=N({jsonrpc:L(yl),...vt.shape}).strict(),CS=t=>NS.safeParse(t).success,Lh=N({jsonrpc:L(yl),id:vl,result:Le}).strict(),fs=t=>Lh.safeParse(t).success;var F;(function(t){t[t.ConnectionClosed=-32e3]="ConnectionClosed",t[t.RequestTimeout=-32001]="RequestTimeout",t[t.ParseError=-32700]="ParseError",t[t.InvalidRequest=-32600]="InvalidRequest",t[t.MethodNotFound=-32601]="MethodNotFound",t[t.InvalidParams=-32602]="InvalidParams",t[t.InternalError=-32603]="InternalError",t[t.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(F||(F={}));var Zh=N({jsonrpc:L(yl),id:vl.optional(),error:N({code:ce().int(),message:_(),data:be().optional()})}).strict();var zS=t=>Zh.safeParse(t).success;var DS=_e([AS,NS,Lh,Zh]),lq=_e([Lh,Zh]),kl=Le.strict(),OP=yt.extend({requestId:vl.optional(),reason:_().optional()}),Sl=vt.extend({method:L("notifications/cancelled"),params:OP}),PP=N({src:_(),mimeType:_().optional(),sizes:Q(_()).optional(),theme:Ue(["light","dark"]).optional()}),hs=N({icons:Q(PP).optional()}),si=N({name:_(),title:_().optional()}),jS=si.extend({...si.shape,...hs.shape,version:_(),websiteUrl:_().optional(),description:_().optional()}),AP=ii(N({applyDefaults:Oe().optional()}),fe(_(),be())),NP=ps(t=>t&&typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length===0?{form:{}}:t,ii(N({form:AP.optional(),url:Ne.optional()}),fe(_(),be()).optional())),CP=je({list:Ne.optional(),cancel:Ne.optional(),requests:je({sampling:je({createMessage:Ne.optional()}).optional(),elicitation:je({create:Ne.optional()}).optional()}).optional()}),zP=je({list:Ne.optional(),cancel:Ne.optional(),requests:je({tools:je({call:Ne.optional()}).optional()}).optional()}),DP=N({experimental:fe(_(),Ne).optional(),sampling:N({context:Ne.optional(),tools:Ne.optional()}).optional(),elicitation:NP.optional(),roots:N({listChanged:Oe().optional()}).optional(),tasks:CP.optional(),extensions:fe(_(),Ne).optional()}),jP=ft.extend({protocolVersion:_(),capabilities:DP,clientInfo:jS}),Bh=Me.extend({method:L("initialize"),params:jP});var UP=N({experimental:fe(_(),Ne).optional(),logging:Ne.optional(),completions:Ne.optional(),prompts:N({listChanged:Oe().optional()}).optional(),resources:N({subscribe:Oe().optional(),listChanged:Oe().optional()}).optional(),tools:N({listChanged:Oe().optional()}).optional(),tasks:zP.optional(),extensions:fe(_(),Ne).optional()}),MP=Le.extend({protocolVersion:_(),capabilities:UP,serverInfo:jS,instructions:_().optional()}),Fh=vt.extend({method:L("notifications/initialized"),params:yt.optional()});var xl=Me.extend({method:L("ping"),params:ft.optional()}),LP=N({progress:ce(),total:ke(ce()),message:ke(_())}),ZP=N({...yt.shape,...LP.shape,progressToken:RS}),Il=vt.extend({method:L("notifications/progress"),params:ZP}),BP=ft.extend({cursor:OS.optional()}),gs=Me.extend({params:BP.optional()}),bs=Le.extend({nextCursor:OS.optional()}),FP=Ue(["working","input_required","completed","failed","cancelled"]),_s=N({taskId:_(),status:FP,ttl:_e([ce(),is()]),createdAt:_(),lastUpdatedAt:_(),pollInterval:ke(ce()),statusMessage:ke(_())}),ai=Le.extend({task:_s}),qP=yt.merge(_s),ys=vt.extend({method:L("notifications/tasks/status"),params:qP}),$l=Me.extend({method:L("tasks/get"),params:ft.extend({taskId:_()})}),wl=Le.merge(_s),El=Me.extend({method:L("tasks/result"),params:ft.extend({taskId:_()})}),dq=Le.loose(),Tl=gs.extend({method:L("tasks/list")}),Rl=bs.extend({tasks:Q(_s)}),Ol=Me.extend({method:L("tasks/cancel"),params:ft.extend({taskId:_()})}),US=Le.merge(_s),MS=N({uri:_(),mimeType:ke(_()),_meta:fe(_(),be()).optional()}),LS=MS.extend({text:_()}),qh=_().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),ZS=MS.extend({blob:qh}),vs=Ue(["user","assistant"]),ci=N({audience:Q(vs).optional(),priority:ce().min(0).max(1).optional(),lastModified:wn.datetime({offset:!0}).optional()}),BS=N({...si.shape,...hs.shape,uri:_(),description:ke(_()),mimeType:ke(_()),size:ke(ce()),annotations:ci.optional(),_meta:ke(je({}))}),VP=N({...si.shape,...hs.shape,uriTemplate:_(),description:ke(_()),mimeType:ke(_()),annotations:ci.optional(),_meta:ke(je({}))}),Pl=gs.extend({method:L("resources/list")}),HP=bs.extend({resources:Q(BS)}),Al=gs.extend({method:L("resources/templates/list")}),GP=bs.extend({resourceTemplates:Q(VP)}),Vh=ft.extend({uri:_()}),KP=Vh,Nl=Me.extend({method:L("resources/read"),params:KP}),WP=Le.extend({contents:Q(_e([LS,ZS]))}),JP=vt.extend({method:L("notifications/resources/list_changed"),params:yt.optional()}),YP=Vh,XP=Me.extend({method:L("resources/subscribe"),params:YP}),QP=Vh,eA=Me.extend({method:L("resources/unsubscribe"),params:QP}),tA=yt.extend({uri:_()}),nA=vt.extend({method:L("notifications/resources/updated"),params:tA}),rA=N({name:_(),description:ke(_()),required:ke(Oe())}),iA=N({...si.shape,...hs.shape,description:ke(_()),arguments:ke(Q(rA)),_meta:ke(je({}))}),Cl=gs.extend({method:L("prompts/list")}),oA=bs.extend({prompts:Q(iA)}),sA=ft.extend({name:_(),arguments:fe(_(),_()).optional()}),zl=Me.extend({method:L("prompts/get"),params:sA}),Hh=N({type:L("text"),text:_(),annotations:ci.optional(),_meta:fe(_(),be()).optional()}),Gh=N({type:L("image"),data:qh,mimeType:_(),annotations:ci.optional(),_meta:fe(_(),be()).optional()}),Kh=N({type:L("audio"),data:qh,mimeType:_(),annotations:ci.optional(),_meta:fe(_(),be()).optional()}),aA=N({type:L("tool_use"),name:_(),id:_(),input:fe(_(),be()),_meta:fe(_(),be()).optional()}),cA=N({type:L("resource"),resource:_e([LS,ZS]),annotations:ci.optional(),_meta:fe(_(),be()).optional()}),uA=BS.extend({type:L("resource_link")}),Wh=_e([Hh,Gh,Kh,uA,cA]),lA=N({role:vs,content:Wh}),dA=Le.extend({description:_().optional(),messages:Q(lA)}),pA=vt.extend({method:L("notifications/prompts/list_changed"),params:yt.optional()}),mA=N({title:_().optional(),readOnlyHint:Oe().optional(),destructiveHint:Oe().optional(),idempotentHint:Oe().optional(),openWorldHint:Oe().optional()}),fA=N({taskSupport:Ue(["required","optional","forbidden"]).optional()}),FS=N({...si.shape,...hs.shape,description:_().optional(),inputSchema:N({type:L("object"),properties:fe(_(),Ne).optional(),required:Q(_()).optional()}).catchall(be()),outputSchema:N({type:L("object"),properties:fe(_(),Ne).optional(),required:Q(_()).optional()}).catchall(be()).optional(),annotations:mA.optional(),execution:fA.optional(),_meta:fe(_(),be()).optional()}),Dl=gs.extend({method:L("tools/list")}),hA=bs.extend({tools:Q(FS)}),jl=Le.extend({content:Q(Wh).default([]),structuredContent:fe(_(),be()).optional(),isError:Oe().optional()}),pq=jl.or(Le.extend({toolResult:be()})),gA=ms.extend({name:_(),arguments:fe(_(),be()).optional()}),ui=Me.extend({method:L("tools/call"),params:gA}),bA=vt.extend({method:L("notifications/tools/list_changed"),params:yt.optional()}),mq=N({autoRefresh:Oe().default(!0),debounceMs:ce().int().nonnegative().default(300)}),ks=Ue(["debug","info","notice","warning","error","critical","alert","emergency"]),_A=ft.extend({level:ks}),Jh=Me.extend({method:L("logging/setLevel"),params:_A}),yA=yt.extend({level:ks,logger:_().optional(),data:be()}),vA=vt.extend({method:L("notifications/message"),params:yA}),kA=N({name:_().optional()}),SA=N({hints:Q(kA).optional(),costPriority:ce().min(0).max(1).optional(),speedPriority:ce().min(0).max(1).optional(),intelligencePriority:ce().min(0).max(1).optional()}),xA=N({mode:Ue(["auto","required","none"]).optional()}),IA=N({type:L("tool_result"),toolUseId:_().describe("The unique identifier for the corresponding tool call."),content:Q(Wh).default([]),structuredContent:N({}).loose().optional(),isError:Oe().optional(),_meta:fe(_(),be()).optional()}),$A=cs("type",[Hh,Gh,Kh]),_l=cs("type",[Hh,Gh,Kh,aA,IA]),wA=N({role:vs,content:_e([_l,Q(_l)]),_meta:fe(_(),be()).optional()}),EA=ms.extend({messages:Q(wA),modelPreferences:SA.optional(),systemPrompt:_().optional(),includeContext:Ue(["none","thisServer","allServers"]).optional(),temperature:ce().optional(),maxTokens:ce().int(),stopSequences:Q(_()).optional(),metadata:Ne.optional(),tools:Q(FS).optional(),toolChoice:xA.optional()}),TA=Me.extend({method:L("sampling/createMessage"),params:EA}),Ss=Le.extend({model:_(),stopReason:ke(Ue(["endTurn","stopSequence","maxTokens"]).or(_())),role:vs,content:$A}),Yh=Le.extend({model:_(),stopReason:ke(Ue(["endTurn","stopSequence","maxTokens","toolUse"]).or(_())),role:vs,content:_e([_l,Q(_l)])}),RA=N({type:L("boolean"),title:_().optional(),description:_().optional(),default:Oe().optional()}),OA=N({type:L("string"),title:_().optional(),description:_().optional(),minLength:ce().optional(),maxLength:ce().optional(),format:Ue(["email","uri","date","date-time"]).optional(),default:_().optional()}),PA=N({type:Ue(["number","integer"]),title:_().optional(),description:_().optional(),minimum:ce().optional(),maximum:ce().optional(),default:ce().optional()}),AA=N({type:L("string"),title:_().optional(),description:_().optional(),enum:Q(_()),default:_().optional()}),NA=N({type:L("string"),title:_().optional(),description:_().optional(),oneOf:Q(N({const:_(),title:_()})),default:_().optional()}),CA=N({type:L("string"),title:_().optional(),description:_().optional(),enum:Q(_()),enumNames:Q(_()).optional(),default:_().optional()}),zA=_e([AA,NA]),DA=N({type:L("array"),title:_().optional(),description:_().optional(),minItems:ce().optional(),maxItems:ce().optional(),items:N({type:L("string"),enum:Q(_())}),default:Q(_()).optional()}),jA=N({type:L("array"),title:_().optional(),description:_().optional(),minItems:ce().optional(),maxItems:ce().optional(),items:N({anyOf:Q(N({const:_(),title:_()}))}),default:Q(_()).optional()}),UA=_e([DA,jA]),MA=_e([CA,zA,UA]),LA=_e([MA,RA,OA,PA]),ZA=ms.extend({mode:L("form").optional(),message:_(),requestedSchema:N({type:L("object"),properties:fe(_(),LA),required:Q(_()).optional()})}),BA=ms.extend({mode:L("url"),message:_(),elicitationId:_(),url:_().url()}),FA=_e([ZA,BA]),qA=Me.extend({method:L("elicitation/create"),params:FA}),VA=yt.extend({elicitationId:_()}),HA=vt.extend({method:L("notifications/elicitation/complete"),params:VA}),li=Le.extend({action:Ue(["accept","decline","cancel"]),content:ps(t=>t===null?void 0:t,fe(_(),_e([_(),ce(),Oe(),Q(_())])).optional())}),GA=N({type:L("ref/resource"),uri:_()});var KA=N({type:L("ref/prompt"),name:_()}),WA=ft.extend({ref:_e([KA,GA]),argument:N({name:_(),value:_()}),context:N({arguments:fe(_(),_()).optional()}).optional()}),Ul=Me.extend({method:L("completion/complete"),params:WA});function qS(t){if(t.params.ref.type!=="ref/prompt")throw new TypeError(`Expected CompleteRequestPrompt, but got ${t.params.ref.type}`)}function VS(t){if(t.params.ref.type!=="ref/resource")throw new TypeError(`Expected CompleteRequestResourceTemplate, but got ${t.params.ref.type}`)}var JA=Le.extend({completion:je({values:Q(_()).max(100),total:ke(ce().int()),hasMore:ke(Oe())})}),YA=N({uri:_().startsWith("file://"),name:_().optional(),_meta:fe(_(),be()).optional()}),XA=Me.extend({method:L("roots/list"),params:ft.optional()}),Xh=Le.extend({roots:Q(YA)}),QA=vt.extend({method:L("notifications/roots/list_changed"),params:yt.optional()}),fq=_e([xl,Bh,Ul,Jh,zl,Cl,Pl,Al,Nl,XP,eA,ui,Dl,$l,El,Tl,Ol]),hq=_e([Sl,Il,Fh,QA,ys]),gq=_e([kl,Ss,Yh,li,Xh,wl,Rl,ai]),bq=_e([xl,TA,qA,XA,$l,El,Tl,Ol]),_q=_e([Sl,Il,vA,nA,JP,bA,pA,ys,HA]),yq=_e([kl,MP,JA,dA,oA,HP,GP,WP,jl,hA,wl,Rl,ai]),Z=class t extends Error{constructor(e,n,i){super(`MCP error ${e}: ${n}`),this.code=e,this.data=i,this.name="McpError"}static fromError(e,n,i){if(e===F.UrlElicitationRequired&&i){let r=i;if(r.elicitations)return new Dh(r.elicitations,n)}return new t(e,n,i)}},Dh=class extends Z{constructor(e,n=`URL elicitation${e.length>1?"s":""} required`){super(F.UrlElicitationRequired,n,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}};var eN=10*1024*1024,Ml=class{constructor(e){this._maxBufferSize=e?.maxBufferSize??eN}append(e){if((this._buffer?.length??0)+e.length>this._maxBufferSize)throw this.clear(),new Error(`ReadBuffer exceeded maximum size of ${this._maxBufferSize} bytes`);this._buffer=this._buffer?Buffer.concat([this._buffer,e]):e}readMessage(){if(!this._buffer)return null;let e=this._buffer.indexOf(`
|
|
75
|
-
`);if(e===-1)return null;let n=this._buffer.toString("utf8",0,e).replace(/\r$/,"");return this._buffer=this._buffer.subarray(e+1),
|
|
76
|
-
`}var Ll=class{constructor(e=GS.stdin,n=GS.stdout,i){this._stdin=e,this._stdout=n,this._started=!1,this._ondata=r=>{try{this._readBuffer.append(r),this.processReadBuffer()}catch(o){this.onerror?.(o),this.close().catch(()=>{})}},this._onerror=r=>{this.onerror?.(r)},this._readBuffer=new Ml({maxBufferSize:i?.maxBufferSize})}async start(){if(this._started)throw new Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");this._started=!0,this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror)}processReadBuffer(){for(;;)try{let e=this._readBuffer.readMessage();if(e===null)break;this.onmessage?.(e)}catch(e){this.onerror?.(e)}}async close(){this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),this._stdin.listenerCount("data")===0&&this._stdin.pause(),this._readBuffer.clear(),this.onclose?.()}send(e){return new Promise(n=>{let i=HS(e);this._stdout.write(i)?n():this._stdout.once("drain",n)})}};var re;(function(t){t.assertEqual=r=>{};function e(r){}t.assertIs=e;function n(r){throw new Error}t.assertNever=n,t.arrayToEnum=r=>{let o={};for(let s of r)o[s]=s;return o},t.getValidEnumValues=r=>{let o=t.objectKeys(r).filter(c=>typeof r[r[c]]!="number"),s={};for(let c of o)s[c]=r[c];return t.objectValues(s)},t.objectValues=r=>t.objectKeys(r).map(function(o){return r[o]}),t.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{let o=[];for(let s in r)Object.prototype.hasOwnProperty.call(r,s)&&o.push(s);return o},t.find=(r,o)=>{for(let s of r)if(o(s))return s},t.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&Number.isFinite(r)&&Math.floor(r)===r;function i(r,o=" | "){return r.map(s=>typeof s=="string"?`'${s}'`:s).join(o)}t.joinValues=i,t.jsonStringifyReplacer=(r,o)=>typeof o=="bigint"?o.toString():o})(re||(re={}));var KS;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(KS||(KS={}));var C=re.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),rn=t=>{switch(typeof t){case"undefined":return C.undefined;case"string":return C.string;case"number":return Number.isNaN(t)?C.nan:C.number;case"boolean":return C.boolean;case"function":return C.function;case"bigint":return C.bigint;case"symbol":return C.symbol;case"object":return Array.isArray(t)?C.array:t===null?C.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?C.promise:typeof Map<"u"&&t instanceof Map?C.map:typeof Set<"u"&&t instanceof Set?C.set:typeof Date<"u"&&t instanceof Date?C.date:C.object;default:return C.unknown}};var $=re.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);var ht=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){let n=e||function(o){return o.message},i={_errors:[]},r=o=>{for(let s of o.issues)if(s.code==="invalid_union")s.unionErrors.map(r);else if(s.code==="invalid_return_type")r(s.returnTypeError);else if(s.code==="invalid_arguments")r(s.argumentsError);else if(s.path.length===0)i._errors.push(n(s));else{let c=i,u=0;for(;u<s.path.length;){let d=s.path[u];u===s.path.length-1?(c[d]=c[d]||{_errors:[]},c[d]._errors.push(n(s))):c[d]=c[d]||{_errors:[]},c=c[d],u++}}};return r(this),i}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,re.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){let n=Object.create(null),i=[];for(let r of this.issues)if(r.path.length>0){let o=r.path[0];n[o]=n[o]||[],n[o].push(e(r))}else i.push(e(r));return{formErrors:i,fieldErrors:n}}get formErrors(){return this.flatten()}};ht.create=t=>new ht(t);var nN=(t,e)=>{let n;switch(t.code){case $.invalid_type:t.received===C.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case $.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,re.jsonStringifyReplacer)}`;break;case $.unrecognized_keys:n=`Unrecognized key(s) in object: ${re.joinValues(t.keys,", ")}`;break;case $.invalid_union:n="Invalid input";break;case $.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${re.joinValues(t.options)}`;break;case $.invalid_enum_value:n=`Invalid enum value. Expected ${re.joinValues(t.options)}, received '${t.received}'`;break;case $.invalid_arguments:n="Invalid function arguments";break;case $.invalid_return_type:n="Invalid function return type";break;case $.invalid_date:n="Invalid date";break;case $.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:re.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case $.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case $.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case $.custom:n="Invalid input";break;case $.invalid_intersection_types:n="Intersection results could not be merged";break;case $.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case $.not_finite:n="Number must be finite";break;default:n=e.defaultError,re.assertNever(t)}return{message:n}},Tn=nN;var rN=Tn;function xs(){return rN}var Zl=t=>{let{data:e,path:n,errorMaps:i,issueData:r}=t,o=[...n,...r.path||[]],s={...r,path:o};if(r.message!==void 0)return{...r,path:o,message:r.message};let c="",u=i.filter(d=>!!d).slice().reverse();for(let d of u)c=d(s,{data:e,defaultError:c}).message;return{...r,path:o,message:c}};function O(t,e){let n=xs(),i=Zl({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===Tn?void 0:Tn].filter(r=>!!r)});t.common.issues.push(i)}var qe=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){let i=[];for(let r of n){if(r.status==="aborted")return q;r.status==="dirty"&&e.dirty(),i.push(r.value)}return{status:e.value,value:i}}static async mergeObjectAsync(e,n){let i=[];for(let r of n){let o=await r.key,s=await r.value;i.push({key:o,value:s})}return t.mergeObjectSync(e,i)}static mergeObjectSync(e,n){let i={};for(let r of n){let{key:o,value:s}=r;if(o.status==="aborted"||s.status==="aborted")return q;o.status==="dirty"&&e.dirty(),s.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof s.value<"u"||r.alwaysSet)&&(i[o.value]=s.value)}return{status:e.value,value:i}}},q=Object.freeze({status:"aborted"}),di=t=>({status:"dirty",value:t}),Ye=t=>({status:"valid",value:t}),Qh=t=>t.status==="aborted",eg=t=>t.status==="dirty",or=t=>t.status==="valid",Is=t=>typeof Promise<"u"&&t instanceof Promise;var M;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(M||(M={}));var kt=class{constructor(e,n,i,r){this._cachedPath=[],this.parent=e,this.data=n,this._path=i,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},WS=(t,e)=>{if(or(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let n=new ht(t.common.issues);return this._error=n,this._error}}};function W(t){if(!t)return{};let{errorMap:e,invalid_type_error:n,required_error:i,description:r}=t;if(e&&(n||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:r}:{errorMap:(s,c)=>{let{message:u}=t;return s.code==="invalid_enum_value"?{message:u??c.defaultError}:typeof c.data>"u"?{message:u??i??c.defaultError}:s.code!=="invalid_type"?{message:c.defaultError}:{message:u??n??c.defaultError}},description:r}}var ee=class{get description(){return this._def.description}_getType(e){return rn(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:rn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new qe,ctx:{common:e.parent.common,data:e.data,parsedType:rn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let n=this._parse(e);if(Is(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){let n=this._parse(e);return Promise.resolve(n)}parse(e,n){let i=this.safeParse(e,n);if(i.success)return i.data;throw i.error}safeParse(e,n){let i={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:rn(e)},r=this._parseSync({data:e,path:i.path,parent:i});return WS(i,r)}"~validate"(e){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:rn(e)};if(!this["~standard"].async)try{let i=this._parseSync({data:e,path:[],parent:n});return or(i)?{value:i.value}:{issues:n.common.issues}}catch(i){i?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(i=>or(i)?{value:i.value}:{issues:n.common.issues})}async parseAsync(e,n){let i=await this.safeParseAsync(e,n);if(i.success)return i.data;throw i.error}async safeParseAsync(e,n){let i={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:rn(e)},r=this._parse({data:e,path:i.path,parent:i}),o=await(Is(r)?r:Promise.resolve(r));return WS(i,o)}refine(e,n){let i=r=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(r):n;return this._refinement((r,o)=>{let s=e(r),c=()=>o.addIssue({code:$.custom,...i(r)});return typeof Promise<"u"&&s instanceof Promise?s.then(u=>u?!0:(c(),!1)):s?!0:(c(),!1)})}refinement(e,n){return this._refinement((i,r)=>e(i)?!0:(r.addIssue(typeof n=="function"?n(i,r):n),!1))}_refinement(e){return new At({schema:this,typeName:E.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return Pt.create(this,this._def)}nullable(){return an.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return On.create(this)}promise(){return sr.create(this,this._def)}or(e){return gi.create([this,e],this._def)}and(e){return bi.create(this,e,this._def)}transform(e){return new At({...W(this._def),schema:this,typeName:E.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let n=typeof e=="function"?e:()=>e;return new Si({...W(this._def),innerType:this,defaultValue:n,typeName:E.ZodDefault})}brand(){return new Bl({typeName:E.ZodBranded,type:this,...W(this._def)})}catch(e){let n=typeof e=="function"?e:()=>e;return new xi({...W(this._def),innerType:this,catchValue:n,typeName:E.ZodCatch})}describe(e){let n=this.constructor;return new n({...this._def,description:e})}pipe(e){return Fl.create(this,e)}readonly(){return Ii.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},iN=/^c[^\s-]{8,}$/i,oN=/^[0-9a-z]+$/,sN=/^[0-9A-HJKMNP-TV-Z]{26}$/i,aN=/^[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,cN=/^[a-z0-9_-]{21}$/i,uN=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,lN=/^[-+]?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=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,pN="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",tg,mN=/^(?:(?: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])$/,fN=/^(?:(?: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])$/,hN=/^(([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]))$/,gN=/^(([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])$/,bN=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,_N=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,JS="((\\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])))",yN=new RegExp(`^${JS}$`);function YS(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function vN(t){return new RegExp(`^${YS(t)}$`)}function kN(t){let e=`${JS}T${YS(t)}`,n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function SN(t,e){return!!((e==="v4"||!e)&&mN.test(t)||(e==="v6"||!e)&&hN.test(t))}function xN(t,e){if(!uN.test(t))return!1;try{let[n]=t.split(".");if(!n)return!1;let i=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),r=JSON.parse(atob(i));return!(typeof r!="object"||r===null||"typ"in r&&r?.typ!=="JWT"||!r.alg||e&&r.alg!==e)}catch{return!1}}function IN(t,e){return!!((e==="v4"||!e)&&fN.test(t)||(e==="v6"||!e)&&gN.test(t))}var mi=class t extends ee{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==C.string){let o=this._getOrReturnCtx(e);return O(o,{code:$.invalid_type,expected:C.string,received:o.parsedType}),q}let i=new qe,r;for(let o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(r=this._getOrReturnCtx(e,r),O(r,{code:$.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),i.dirty());else if(o.kind==="max")e.data.length>o.value&&(r=this._getOrReturnCtx(e,r),O(r,{code:$.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),i.dirty());else if(o.kind==="length"){let s=e.data.length>o.value,c=e.data.length<o.value;(s||c)&&(r=this._getOrReturnCtx(e,r),s?O(r,{code:$.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):c&&O(r,{code:$.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),i.dirty())}else if(o.kind==="email")dN.test(e.data)||(r=this._getOrReturnCtx(e,r),O(r,{validation:"email",code:$.invalid_string,message:o.message}),i.dirty());else if(o.kind==="emoji")tg||(tg=new RegExp(pN,"u")),tg.test(e.data)||(r=this._getOrReturnCtx(e,r),O(r,{validation:"emoji",code:$.invalid_string,message:o.message}),i.dirty());else if(o.kind==="uuid")aN.test(e.data)||(r=this._getOrReturnCtx(e,r),O(r,{validation:"uuid",code:$.invalid_string,message:o.message}),i.dirty());else if(o.kind==="nanoid")cN.test(e.data)||(r=this._getOrReturnCtx(e,r),O(r,{validation:"nanoid",code:$.invalid_string,message:o.message}),i.dirty());else if(o.kind==="cuid")iN.test(e.data)||(r=this._getOrReturnCtx(e,r),O(r,{validation:"cuid",code:$.invalid_string,message:o.message}),i.dirty());else if(o.kind==="cuid2")oN.test(e.data)||(r=this._getOrReturnCtx(e,r),O(r,{validation:"cuid2",code:$.invalid_string,message:o.message}),i.dirty());else if(o.kind==="ulid")sN.test(e.data)||(r=this._getOrReturnCtx(e,r),O(r,{validation:"ulid",code:$.invalid_string,message:o.message}),i.dirty());else if(o.kind==="url")try{new URL(e.data)}catch{r=this._getOrReturnCtx(e,r),O(r,{validation:"url",code:$.invalid_string,message:o.message}),i.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),O(r,{validation:"regex",code:$.invalid_string,message:o.message}),i.dirty())):o.kind==="trim"?e.data=e.data.trim():o.kind==="includes"?e.data.includes(o.value,o.position)||(r=this._getOrReturnCtx(e,r),O(r,{code:$.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),i.dirty()):o.kind==="toLowerCase"?e.data=e.data.toLowerCase():o.kind==="toUpperCase"?e.data=e.data.toUpperCase():o.kind==="startsWith"?e.data.startsWith(o.value)||(r=this._getOrReturnCtx(e,r),O(r,{code:$.invalid_string,validation:{startsWith:o.value},message:o.message}),i.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(r=this._getOrReturnCtx(e,r),O(r,{code:$.invalid_string,validation:{endsWith:o.value},message:o.message}),i.dirty()):o.kind==="datetime"?kN(o).test(e.data)||(r=this._getOrReturnCtx(e,r),O(r,{code:$.invalid_string,validation:"datetime",message:o.message}),i.dirty()):o.kind==="date"?yN.test(e.data)||(r=this._getOrReturnCtx(e,r),O(r,{code:$.invalid_string,validation:"date",message:o.message}),i.dirty()):o.kind==="time"?vN(o).test(e.data)||(r=this._getOrReturnCtx(e,r),O(r,{code:$.invalid_string,validation:"time",message:o.message}),i.dirty()):o.kind==="duration"?lN.test(e.data)||(r=this._getOrReturnCtx(e,r),O(r,{validation:"duration",code:$.invalid_string,message:o.message}),i.dirty()):o.kind==="ip"?SN(e.data,o.version)||(r=this._getOrReturnCtx(e,r),O(r,{validation:"ip",code:$.invalid_string,message:o.message}),i.dirty()):o.kind==="jwt"?xN(e.data,o.alg)||(r=this._getOrReturnCtx(e,r),O(r,{validation:"jwt",code:$.invalid_string,message:o.message}),i.dirty()):o.kind==="cidr"?IN(e.data,o.version)||(r=this._getOrReturnCtx(e,r),O(r,{validation:"cidr",code:$.invalid_string,message:o.message}),i.dirty()):o.kind==="base64"?bN.test(e.data)||(r=this._getOrReturnCtx(e,r),O(r,{validation:"base64",code:$.invalid_string,message:o.message}),i.dirty()):o.kind==="base64url"?_N.test(e.data)||(r=this._getOrReturnCtx(e,r),O(r,{validation:"base64url",code:$.invalid_string,message:o.message}),i.dirty()):re.assertNever(o);return{status:i.value,value:e.data}}_regex(e,n,i){return this.refinement(r=>e.test(r),{validation:n,code:$.invalid_string,...M.errToObj(i)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...M.errToObj(e)})}url(e){return this._addCheck({kind:"url",...M.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...M.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...M.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...M.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...M.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...M.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...M.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...M.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...M.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...M.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...M.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...M.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...M.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...M.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...M.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...M.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n?.position,...M.errToObj(n?.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...M.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...M.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...M.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...M.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...M.errToObj(n)})}nonempty(e){return this.min(1,M.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};mi.create=t=>new mi({checks:[],typeName:E.ZodString,coerce:t?.coerce??!1,...W(t)});function $N(t,e){let n=(t.toString().split(".")[1]||"").length,i=(e.toString().split(".")[1]||"").length,r=n>i?n:i,o=Number.parseInt(t.toFixed(r).replace(".","")),s=Number.parseInt(e.toFixed(r).replace(".",""));return o%s/10**r}var $s=class t extends ee{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==C.number){let o=this._getOrReturnCtx(e);return O(o,{code:$.invalid_type,expected:C.number,received:o.parsedType}),q}let i,r=new qe;for(let o of this._def.checks)o.kind==="int"?re.isInteger(e.data)||(i=this._getOrReturnCtx(e,i),O(i,{code:$.invalid_type,expected:"integer",received:"float",message:o.message}),r.dirty()):o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(i=this._getOrReturnCtx(e,i),O(i,{code:$.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),r.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(i=this._getOrReturnCtx(e,i),O(i,{code:$.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),r.dirty()):o.kind==="multipleOf"?$N(e.data,o.value)!==0&&(i=this._getOrReturnCtx(e,i),O(i,{code:$.not_multiple_of,multipleOf:o.value,message:o.message}),r.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(i=this._getOrReturnCtx(e,i),O(i,{code:$.not_finite,message:o.message}),r.dirty()):re.assertNever(o);return{status:r.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,M.toString(n))}gt(e,n){return this.setLimit("min",e,!1,M.toString(n))}lte(e,n){return this.setLimit("max",e,!0,M.toString(n))}lt(e,n){return this.setLimit("max",e,!1,M.toString(n))}setLimit(e,n,i,r){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:i,message:M.toString(r)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:M.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:M.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:M.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:M.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:M.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:M.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:M.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:M.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:M.toString(e)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&re.isInteger(e.value))}get isFinite(){let e=null,n=null;for(let i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(n===null||i.value>n)&&(n=i.value):i.kind==="max"&&(e===null||i.value<e)&&(e=i.value)}return Number.isFinite(n)&&Number.isFinite(e)}};$s.create=t=>new $s({checks:[],typeName:E.ZodNumber,coerce:t?.coerce||!1,...W(t)});var ws=class t extends ee{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==C.bigint)return this._getInvalidInput(e);let i,r=new qe;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(i=this._getOrReturnCtx(e,i),O(i,{code:$.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),r.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(i=this._getOrReturnCtx(e,i),O(i,{code:$.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),r.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(i=this._getOrReturnCtx(e,i),O(i,{code:$.not_multiple_of,multipleOf:o.value,message:o.message}),r.dirty()):re.assertNever(o);return{status:r.value,value:e.data}}_getInvalidInput(e){let n=this._getOrReturnCtx(e);return O(n,{code:$.invalid_type,expected:C.bigint,received:n.parsedType}),q}gte(e,n){return this.setLimit("min",e,!0,M.toString(n))}gt(e,n){return this.setLimit("min",e,!1,M.toString(n))}lte(e,n){return this.setLimit("max",e,!0,M.toString(n))}lt(e,n){return this.setLimit("max",e,!1,M.toString(n))}setLimit(e,n,i,r){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:i,message:M.toString(r)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:M.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:M.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:M.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:M.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:M.toString(n)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};ws.create=t=>new ws({checks:[],typeName:E.ZodBigInt,coerce:t?.coerce??!1,...W(t)});var Es=class extends ee{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==C.boolean){let i=this._getOrReturnCtx(e);return O(i,{code:$.invalid_type,expected:C.boolean,received:i.parsedType}),q}return Ye(e.data)}};Es.create=t=>new Es({typeName:E.ZodBoolean,coerce:t?.coerce||!1,...W(t)});var Ts=class t extends ee{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==C.date){let o=this._getOrReturnCtx(e);return O(o,{code:$.invalid_type,expected:C.date,received:o.parsedType}),q}if(Number.isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return O(o,{code:$.invalid_date}),q}let i=new qe,r;for(let o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(r=this._getOrReturnCtx(e,r),O(r,{code:$.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),i.dirty()):o.kind==="max"?e.data.getTime()>o.value&&(r=this._getOrReturnCtx(e,r),O(r,{code:$.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),i.dirty()):re.assertNever(o);return{status:i.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:M.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:M.toString(n)})}get minDate(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}};Ts.create=t=>new Ts({checks:[],coerce:t?.coerce||!1,typeName:E.ZodDate,...W(t)});var Rs=class extends ee{_parse(e){if(this._getType(e)!==C.symbol){let i=this._getOrReturnCtx(e);return O(i,{code:$.invalid_type,expected:C.symbol,received:i.parsedType}),q}return Ye(e.data)}};Rs.create=t=>new Rs({typeName:E.ZodSymbol,...W(t)});var fi=class extends ee{_parse(e){if(this._getType(e)!==C.undefined){let i=this._getOrReturnCtx(e);return O(i,{code:$.invalid_type,expected:C.undefined,received:i.parsedType}),q}return Ye(e.data)}};fi.create=t=>new fi({typeName:E.ZodUndefined,...W(t)});var hi=class extends ee{_parse(e){if(this._getType(e)!==C.null){let i=this._getOrReturnCtx(e);return O(i,{code:$.invalid_type,expected:C.null,received:i.parsedType}),q}return Ye(e.data)}};hi.create=t=>new hi({typeName:E.ZodNull,...W(t)});var Os=class extends ee{constructor(){super(...arguments),this._any=!0}_parse(e){return Ye(e.data)}};Os.create=t=>new Os({typeName:E.ZodAny,...W(t)});var Rn=class extends ee{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Ye(e.data)}};Rn.create=t=>new Rn({typeName:E.ZodUnknown,...W(t)});var Ht=class extends ee{_parse(e){let n=this._getOrReturnCtx(e);return O(n,{code:$.invalid_type,expected:C.never,received:n.parsedType}),q}};Ht.create=t=>new Ht({typeName:E.ZodNever,...W(t)});var Ps=class extends ee{_parse(e){if(this._getType(e)!==C.undefined){let i=this._getOrReturnCtx(e);return O(i,{code:$.invalid_type,expected:C.void,received:i.parsedType}),q}return Ye(e.data)}};Ps.create=t=>new Ps({typeName:E.ZodVoid,...W(t)});var On=class t extends ee{_parse(e){let{ctx:n,status:i}=this._processInputParams(e),r=this._def;if(n.parsedType!==C.array)return O(n,{code:$.invalid_type,expected:C.array,received:n.parsedType}),q;if(r.exactLength!==null){let s=n.data.length>r.exactLength.value,c=n.data.length<r.exactLength.value;(s||c)&&(O(n,{code:s?$.too_big:$.too_small,minimum:c?r.exactLength.value:void 0,maximum:s?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),i.dirty())}if(r.minLength!==null&&n.data.length<r.minLength.value&&(O(n,{code:$.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),i.dirty()),r.maxLength!==null&&n.data.length>r.maxLength.value&&(O(n,{code:$.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),i.dirty()),n.common.async)return Promise.all([...n.data].map((s,c)=>r.type._parseAsync(new kt(n,s,n.path,c)))).then(s=>qe.mergeArray(i,s));let o=[...n.data].map((s,c)=>r.type._parseSync(new kt(n,s,n.path,c)));return qe.mergeArray(i,o)}get element(){return this._def.type}min(e,n){return new t({...this._def,minLength:{value:e,message:M.toString(n)}})}max(e,n){return new t({...this._def,maxLength:{value:e,message:M.toString(n)}})}length(e,n){return new t({...this._def,exactLength:{value:e,message:M.toString(n)}})}nonempty(e){return this.min(1,e)}};On.create=(t,e)=>new On({type:t,minLength:null,maxLength:null,exactLength:null,typeName:E.ZodArray,...W(e)});function pi(t){if(t instanceof gt){let e={};for(let n in t.shape){let i=t.shape[n];e[n]=Pt.create(pi(i))}return new gt({...t._def,shape:()=>e})}else return t instanceof On?new On({...t._def,type:pi(t.element)}):t instanceof Pt?Pt.create(pi(t.unwrap())):t instanceof an?an.create(pi(t.unwrap())):t instanceof sn?sn.create(t.items.map(e=>pi(e))):t}var gt=class t extends ee{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),n=re.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==C.object){let d=this._getOrReturnCtx(e);return O(d,{code:$.invalid_type,expected:C.object,received:d.parsedType}),q}let{status:i,ctx:r}=this._processInputParams(e),{shape:o,keys:s}=this._getCached(),c=[];if(!(this._def.catchall instanceof Ht&&this._def.unknownKeys==="strip"))for(let d in r.data)s.includes(d)||c.push(d);let u=[];for(let d of s){let l=o[d],p=r.data[d];u.push({key:{status:"valid",value:d},value:l._parse(new kt(r,p,r.path,d)),alwaysSet:d in r.data})}if(this._def.catchall instanceof Ht){let d=this._def.unknownKeys;if(d==="passthrough")for(let l of c)u.push({key:{status:"valid",value:l},value:{status:"valid",value:r.data[l]}});else if(d==="strict")c.length>0&&(O(r,{code:$.unrecognized_keys,keys:c}),i.dirty());else if(d!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let d=this._def.catchall;for(let l of c){let p=r.data[l];u.push({key:{status:"valid",value:l},value:d._parse(new kt(r,p,r.path,l)),alwaysSet:l in r.data})}}return r.common.async?Promise.resolve().then(async()=>{let d=[];for(let l of u){let p=await l.key,m=await l.value;d.push({key:p,value:m,alwaysSet:l.alwaysSet})}return d}).then(d=>qe.mergeObjectSync(i,d)):qe.mergeObjectSync(i,u)}get shape(){return this._def.shape()}strict(e){return M.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,i)=>{let r=this._def.errorMap?.(n,i).message??i.defaultError;return n.code==="unrecognized_keys"?{message:M.errToObj(e).message??r}:{message:r}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:E.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let n={};for(let i of re.objectKeys(e))e[i]&&this.shape[i]&&(n[i]=this.shape[i]);return new t({...this._def,shape:()=>n})}omit(e){let n={};for(let i of re.objectKeys(this.shape))e[i]||(n[i]=this.shape[i]);return new t({...this._def,shape:()=>n})}deepPartial(){return pi(this)}partial(e){let n={};for(let i of re.objectKeys(this.shape)){let r=this.shape[i];e&&!e[i]?n[i]=r:n[i]=r.optional()}return new t({...this._def,shape:()=>n})}required(e){let n={};for(let i of re.objectKeys(this.shape))if(e&&!e[i])n[i]=this.shape[i];else{let o=this.shape[i];for(;o instanceof Pt;)o=o._def.innerType;n[i]=o}return new t({...this._def,shape:()=>n})}keyof(){return XS(re.objectKeys(this.shape))}};gt.create=(t,e)=>new gt({shape:()=>t,unknownKeys:"strip",catchall:Ht.create(),typeName:E.ZodObject,...W(e)});gt.strictCreate=(t,e)=>new gt({shape:()=>t,unknownKeys:"strict",catchall:Ht.create(),typeName:E.ZodObject,...W(e)});gt.lazycreate=(t,e)=>new gt({shape:t,unknownKeys:"strip",catchall:Ht.create(),typeName:E.ZodObject,...W(e)});var gi=class extends ee{_parse(e){let{ctx:n}=this._processInputParams(e),i=this._def.options;function r(o){for(let c of o)if(c.result.status==="valid")return c.result;for(let c of o)if(c.result.status==="dirty")return n.common.issues.push(...c.ctx.common.issues),c.result;let s=o.map(c=>new ht(c.ctx.common.issues));return O(n,{code:$.invalid_union,unionErrors:s}),q}if(n.common.async)return Promise.all(i.map(async o=>{let s={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:s}),ctx:s}})).then(r);{let o,s=[];for(let u of i){let d={...n,common:{...n.common,issues:[]},parent:null},l=u._parseSync({data:n.data,path:n.path,parent:d});if(l.status==="valid")return l;l.status==="dirty"&&!o&&(o={result:l,ctx:d}),d.common.issues.length&&s.push(d.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;let c=s.map(u=>new ht(u));return O(n,{code:$.invalid_union,unionErrors:c}),q}}get options(){return this._def.options}};gi.create=(t,e)=>new gi({options:t,typeName:E.ZodUnion,...W(e)});var on=t=>t instanceof _i?on(t.schema):t instanceof At?on(t.innerType()):t instanceof yi?[t.value]:t instanceof vi?t.options:t instanceof ki?re.objectValues(t.enum):t instanceof Si?on(t._def.innerType):t instanceof fi?[void 0]:t instanceof hi?[null]:t instanceof Pt?[void 0,...on(t.unwrap())]:t instanceof an?[null,...on(t.unwrap())]:t instanceof Bl||t instanceof Ii?on(t.unwrap()):t instanceof xi?on(t._def.innerType):[],ng=class t extends ee{_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==C.object)return O(n,{code:$.invalid_type,expected:C.object,received:n.parsedType}),q;let i=this.discriminator,r=n.data[i],o=this.optionsMap.get(r);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):(O(n,{code:$.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),q)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,i){let r=new Map;for(let o of n){let s=on(o.shape[e]);if(!s.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let c of s){if(r.has(c))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(c)}`);r.set(c,o)}}return new t({typeName:E.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:r,...W(i)})}};function rg(t,e){let n=rn(t),i=rn(e);if(t===e)return{valid:!0,data:t};if(n===C.object&&i===C.object){let r=re.objectKeys(e),o=re.objectKeys(t).filter(c=>r.indexOf(c)!==-1),s={...t,...e};for(let c of o){let u=rg(t[c],e[c]);if(!u.valid)return{valid:!1};s[c]=u.data}return{valid:!0,data:s}}else if(n===C.array&&i===C.array){if(t.length!==e.length)return{valid:!1};let r=[];for(let o=0;o<t.length;o++){let s=t[o],c=e[o],u=rg(s,c);if(!u.valid)return{valid:!1};r.push(u.data)}return{valid:!0,data:r}}else return n===C.date&&i===C.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var bi=class extends ee{_parse(e){let{status:n,ctx:i}=this._processInputParams(e),r=(o,s)=>{if(Qh(o)||Qh(s))return q;let c=rg(o.value,s.value);return c.valid?((eg(o)||eg(s))&&n.dirty(),{status:n.value,value:c.data}):(O(i,{code:$.invalid_intersection_types}),q)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([o,s])=>r(o,s)):r(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}};bi.create=(t,e,n)=>new bi({left:t,right:e,typeName:E.ZodIntersection,...W(n)});var sn=class t extends ee{_parse(e){let{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==C.array)return O(i,{code:$.invalid_type,expected:C.array,received:i.parsedType}),q;if(i.data.length<this._def.items.length)return O(i,{code:$.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),q;!this._def.rest&&i.data.length>this._def.items.length&&(O(i,{code:$.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let o=[...i.data].map((s,c)=>{let u=this._def.items[c]||this._def.rest;return u?u._parse(new kt(i,s,i.path,c)):null}).filter(s=>!!s);return i.common.async?Promise.all(o).then(s=>qe.mergeArray(n,s)):qe.mergeArray(n,o)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};sn.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new sn({items:t,typeName:E.ZodTuple,rest:null,...W(e)})};var ig=class t extends ee{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==C.object)return O(i,{code:$.invalid_type,expected:C.object,received:i.parsedType}),q;let r=[],o=this._def.keyType,s=this._def.valueType;for(let c in i.data)r.push({key:o._parse(new kt(i,c,i.path,c)),value:s._parse(new kt(i,i.data[c],i.path,c)),alwaysSet:c in i.data});return i.common.async?qe.mergeObjectAsync(n,r):qe.mergeObjectSync(n,r)}get element(){return this._def.valueType}static create(e,n,i){return n instanceof ee?new t({keyType:e,valueType:n,typeName:E.ZodRecord,...W(i)}):new t({keyType:mi.create(),valueType:e,typeName:E.ZodRecord,...W(n)})}},As=class extends ee{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==C.map)return O(i,{code:$.invalid_type,expected:C.map,received:i.parsedType}),q;let r=this._def.keyType,o=this._def.valueType,s=[...i.data.entries()].map(([c,u],d)=>({key:r._parse(new kt(i,c,i.path,[d,"key"])),value:o._parse(new kt(i,u,i.path,[d,"value"]))}));if(i.common.async){let c=new Map;return Promise.resolve().then(async()=>{for(let u of s){let d=await u.key,l=await u.value;if(d.status==="aborted"||l.status==="aborted")return q;(d.status==="dirty"||l.status==="dirty")&&n.dirty(),c.set(d.value,l.value)}return{status:n.value,value:c}})}else{let c=new Map;for(let u of s){let d=u.key,l=u.value;if(d.status==="aborted"||l.status==="aborted")return q;(d.status==="dirty"||l.status==="dirty")&&n.dirty(),c.set(d.value,l.value)}return{status:n.value,value:c}}}};As.create=(t,e,n)=>new As({valueType:e,keyType:t,typeName:E.ZodMap,...W(n)});var Ns=class t extends ee{_parse(e){let{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==C.set)return O(i,{code:$.invalid_type,expected:C.set,received:i.parsedType}),q;let r=this._def;r.minSize!==null&&i.data.size<r.minSize.value&&(O(i,{code:$.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),n.dirty()),r.maxSize!==null&&i.data.size>r.maxSize.value&&(O(i,{code:$.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),n.dirty());let o=this._def.valueType;function s(u){let d=new Set;for(let l of u){if(l.status==="aborted")return q;l.status==="dirty"&&n.dirty(),d.add(l.value)}return{status:n.value,value:d}}let c=[...i.data.values()].map((u,d)=>o._parse(new kt(i,u,i.path,d)));return i.common.async?Promise.all(c).then(u=>s(u)):s(c)}min(e,n){return new t({...this._def,minSize:{value:e,message:M.toString(n)}})}max(e,n){return new t({...this._def,maxSize:{value:e,message:M.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}};Ns.create=(t,e)=>new Ns({valueType:t,minSize:null,maxSize:null,typeName:E.ZodSet,...W(e)});var og=class t extends ee{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==C.function)return O(n,{code:$.invalid_type,expected:C.function,received:n.parsedType}),q;function i(c,u){return Zl({data:c,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,xs(),Tn].filter(d=>!!d),issueData:{code:$.invalid_arguments,argumentsError:u}})}function r(c,u){return Zl({data:c,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,xs(),Tn].filter(d=>!!d),issueData:{code:$.invalid_return_type,returnTypeError:u}})}let o={errorMap:n.common.contextualErrorMap},s=n.data;if(this._def.returns instanceof sr){let c=this;return Ye(async function(...u){let d=new ht([]),l=await c._def.args.parseAsync(u,o).catch(f=>{throw d.addIssue(i(u,f)),d}),p=await Reflect.apply(s,this,l);return await c._def.returns._def.type.parseAsync(p,o).catch(f=>{throw d.addIssue(r(p,f)),d})})}else{let c=this;return Ye(function(...u){let d=c._def.args.safeParse(u,o);if(!d.success)throw new ht([i(u,d.error)]);let l=Reflect.apply(s,this,d.data),p=c._def.returns.safeParse(l,o);if(!p.success)throw new ht([r(l,p.error)]);return p.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:sn.create(e).rest(Rn.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,i){return new t({args:e||sn.create([]).rest(Rn.create()),returns:n||Rn.create(),typeName:E.ZodFunction,...W(i)})}},_i=class extends ee{get schema(){return this._def.getter()}_parse(e){let{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};_i.create=(t,e)=>new _i({getter:t,typeName:E.ZodLazy,...W(e)});var yi=class extends ee{_parse(e){if(e.data!==this._def.value){let n=this._getOrReturnCtx(e);return O(n,{received:n.data,code:$.invalid_literal,expected:this._def.value}),q}return{status:"valid",value:e.data}}get value(){return this._def.value}};yi.create=(t,e)=>new yi({value:t,typeName:E.ZodLiteral,...W(e)});function XS(t,e){return new vi({values:t,typeName:E.ZodEnum,...W(e)})}var vi=class t extends ee{_parse(e){if(typeof e.data!="string"){let n=this._getOrReturnCtx(e),i=this._def.values;return O(n,{expected:re.joinValues(i),received:n.parsedType,code:$.invalid_type}),q}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let n=this._getOrReturnCtx(e),i=this._def.values;return O(n,{received:n.data,code:$.invalid_enum_value,options:i}),q}return Ye(e.data)}get options(){return this._def.values}get enum(){let e={};for(let n of this._def.values)e[n]=n;return e}get Values(){let e={};for(let n of this._def.values)e[n]=n;return e}get Enum(){let e={};for(let n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return t.create(e,{...this._def,...n})}exclude(e,n=this._def){return t.create(this.options.filter(i=>!e.includes(i)),{...this._def,...n})}};vi.create=XS;var ki=class extends ee{_parse(e){let n=re.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(e);if(i.parsedType!==C.string&&i.parsedType!==C.number){let r=re.objectValues(n);return O(i,{expected:re.joinValues(r),received:i.parsedType,code:$.invalid_type}),q}if(this._cache||(this._cache=new Set(re.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let r=re.objectValues(n);return O(i,{received:i.data,code:$.invalid_enum_value,options:r}),q}return Ye(e.data)}get enum(){return this._def.values}};ki.create=(t,e)=>new ki({values:t,typeName:E.ZodNativeEnum,...W(e)});var sr=class extends ee{unwrap(){return this._def.type}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==C.promise&&n.common.async===!1)return O(n,{code:$.invalid_type,expected:C.promise,received:n.parsedType}),q;let i=n.parsedType===C.promise?n.data:Promise.resolve(n.data);return Ye(i.then(r=>this._def.type.parseAsync(r,{path:n.path,errorMap:n.common.contextualErrorMap})))}};sr.create=(t,e)=>new sr({type:t,typeName:E.ZodPromise,...W(e)});var At=class extends ee{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===E.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:n,ctx:i}=this._processInputParams(e),r=this._def.effect||null,o={addIssue:s=>{O(i,s),s.fatal?n.abort():n.dirty()},get path(){return i.path}};if(o.addIssue=o.addIssue.bind(o),r.type==="preprocess"){let s=r.transform(i.data,o);if(i.common.async)return Promise.resolve(s).then(async c=>{if(n.value==="aborted")return q;let u=await this._def.schema._parseAsync({data:c,path:i.path,parent:i});return u.status==="aborted"?q:u.status==="dirty"?di(u.value):n.value==="dirty"?di(u.value):u});{if(n.value==="aborted")return q;let c=this._def.schema._parseSync({data:s,path:i.path,parent:i});return c.status==="aborted"?q:c.status==="dirty"?di(c.value):n.value==="dirty"?di(c.value):c}}if(r.type==="refinement"){let s=c=>{let u=r.refinement(c,o);if(i.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c};if(i.common.async===!1){let c=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return c.status==="aborted"?q:(c.status==="dirty"&&n.dirty(),s(c.value),{status:n.value,value:c.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(c=>c.status==="aborted"?q:(c.status==="dirty"&&n.dirty(),s(c.value).then(()=>({status:n.value,value:c.value}))))}if(r.type==="transform")if(i.common.async===!1){let s=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!or(s))return q;let c=r.transform(s.value,o);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:c}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(s=>or(s)?Promise.resolve(r.transform(s.value,o)).then(c=>({status:n.value,value:c})):q);re.assertNever(r)}};At.create=(t,e,n)=>new At({schema:t,typeName:E.ZodEffects,effect:e,...W(n)});At.createWithPreprocess=(t,e,n)=>new At({schema:e,effect:{type:"preprocess",transform:t},typeName:E.ZodEffects,...W(n)});var Pt=class extends ee{_parse(e){return this._getType(e)===C.undefined?Ye(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Pt.create=(t,e)=>new Pt({innerType:t,typeName:E.ZodOptional,...W(e)});var an=class extends ee{_parse(e){return this._getType(e)===C.null?Ye(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};an.create=(t,e)=>new an({innerType:t,typeName:E.ZodNullable,...W(e)});var Si=class extends ee{_parse(e){let{ctx:n}=this._processInputParams(e),i=n.data;return n.parsedType===C.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};Si.create=(t,e)=>new Si({innerType:t,typeName:E.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...W(e)});var xi=class extends ee{_parse(e){let{ctx:n}=this._processInputParams(e),i={...n,common:{...n.common,issues:[]}},r=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return Is(r)?r.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new ht(i.common.issues)},input:i.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new ht(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}};xi.create=(t,e)=>new xi({innerType:t,typeName:E.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...W(e)});var Cs=class extends ee{_parse(e){if(this._getType(e)!==C.nan){let i=this._getOrReturnCtx(e);return O(i,{code:$.invalid_type,expected:C.nan,received:i.parsedType}),q}return{status:"valid",value:e.data}}};Cs.create=t=>new Cs({typeName:E.ZodNaN,...W(t)});var Bl=class extends ee{_parse(e){let{ctx:n}=this._processInputParams(e),i=n.data;return this._def.type._parse({data:i,path:n.path,parent:n})}unwrap(){return this._def.type}},Fl=class t extends ee{_parse(e){let{status:n,ctx:i}=this._processInputParams(e);if(i.common.async)return(async()=>{let o=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return o.status==="aborted"?q:o.status==="dirty"?(n.dirty(),di(o.value)):this._def.out._parseAsync({data:o.value,path:i.path,parent:i})})();{let r=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return r.status==="aborted"?q:r.status==="dirty"?(n.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:i.path,parent:i})}}static create(e,n){return new t({in:e,out:n,typeName:E.ZodPipeline})}},Ii=class extends ee{_parse(e){let n=this._def.innerType._parse(e),i=r=>(or(r)&&(r.value=Object.freeze(r.value)),r);return Is(n)?n.then(r=>i(r)):i(n)}unwrap(){return this._def.innerType}};Ii.create=(t,e)=>new Ii({innerType:t,typeName:E.ZodReadonly,...W(e)});var Fq={object:gt.lazycreate},E;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(E||(E={}));var qq=mi.create,Vq=$s.create,Hq=Cs.create,Gq=ws.create,Kq=Es.create,Wq=Ts.create,Jq=Rs.create,Yq=fi.create,Xq=hi.create,Qq=Os.create,e2=Rn.create,t2=Ht.create,n2=Ps.create,r2=On.create,QS=gt.create,i2=gt.strictCreate,o2=gi.create,s2=ng.create,a2=bi.create,c2=sn.create,u2=ig.create,l2=As.create,d2=Ns.create,p2=og.create,m2=_i.create,f2=yi.create,h2=vi.create,g2=ki.create,b2=sr.create,_2=At.create,y2=Pt.create,v2=an.create,k2=At.createWithPreprocess,S2=Fl.create;var EN=g("ZodMiniType",(t,e)=>{if(!t._zod)throw new Error("Uninitialized schema in ZodMiniType.");H.init(t,e),t.def=e,t.type=e.type,t.parse=(n,i)=>Jn(t,n,i,{callee:t.parse}),t.safeParse=(n,i)=>_n(t,n,i),t.parseAsync=async(n,i)=>Yn(t,n,i,{callee:t.parseAsync}),t.safeParseAsync=async(n,i)=>yn(t,n,i),t.check=(...n)=>t.clone({...e,checks:[...e.checks??[],...n.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]},{parent:!0}),t.with=t.check,t.clone=(n,i)=>ze(t,n,i),t.brand=()=>t,t.register=((n,i)=>(n.add(t,i),t)),t.apply=n=>n(t)});var TN=g("ZodMiniObject",(t,e)=>{Oc.init(t,e),EN.init(t,e),J(t,"shape",()=>e.shape)});function sg(t,e){let n={type:"object",shape:t??{},...w(e)};return new TN(n)}function Gt(t){return!!t._zod}function ar(t){let e=Object.values(t);if(e.length===0)return sg({});let n=e.every(Gt),i=e.every(r=>!Gt(r));if(n)return sg(t);if(i)return QS(t);throw new Error("Mixed Zod versions detected in object shape.")}function Pn(t,e){return Gt(t)?_n(t,e):t.safeParse(e)}async function ql(t,e){return Gt(t)?await yn(t,e):await t.safeParseAsync(e)}function An(t){if(!t)return;let e;if(Gt(t)?e=t._zod?.def?.shape:e=t.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function $i(t){if(t){if(typeof t=="object"){let e=t,n=t;if(!e._def&&!n._zod){let i=Object.values(t);if(i.length>0&&i.every(r=>typeof r=="object"&&r!==null&&(r._def!==void 0||r._zod!==void 0||typeof r.parse=="function")))return ar(t)}}if(Gt(t)){let n=t._zod?.def;if(n&&(n.type==="object"||n.shape!==void 0))return t}else if(t.shape!==void 0)return t}}function ON(t){return t.length===0?"object root":t.reduce((e,n,i)=>i===0?String(n):typeof n=="number"?`${e}[${n}]`:`${e}.${n}`,"")}function Vl(t){if(t&&typeof t=="object"){if("issues"in t&&Array.isArray(t.issues)&&t.issues.length>0)return t.issues.map(e=>e.path?.length?`${e.message} at ${ON(e.path)}`:e.message).join(`
|
|
77
|
-
`);if("message"in t&&typeof t.message=="string")return t.message;try{return JSON.stringify(t)}catch{return String(t)}}return String(t)}function ex(t){return t.description}function tx(t){if(Gt(t))return t._zod?.def?.type==="optional";let e=t;return typeof t.isOptional=="function"?t.isOptional():e._def?.typeName==="ZodOptional"}function wi(t){if(Gt(t)){let o=t._zod?.def;if(o){if(o.value!==void 0)return o.value;if(Array.isArray(o.values)&&o.values.length>0)return o.values[0]}}let n=t._def;if(n){if(n.value!==void 0)return n.value;if(Array.isArray(n.values)&&n.values.length>0)return n.values[0]}let i=t.value;if(i!==void 0)return i}function Nn(t){return t==="completed"||t==="failed"||t==="cancelled"}var rx=Symbol("Let zodToJsonSchema decide on which parser to use");var nx={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"},ix=t=>typeof t=="string"?{...nx,name:t}:{...nx,...t};var ox=t=>{let e=ix(t),n=e.name!==void 0?[...e.basePath,e.definitionPath,e.name]:e.basePath;return{...e,flags:{hasReferencedOpenAiAnyType:!1},currentPath:n,propertyPath:void 0,seen:new Map(Object.entries(e.definitions).map(([i,r])=>[r._def,{def:r._def,path:[...e.basePath,e.definitionPath,i],jsonSchema:void 0}]))}};function ag(t,e,n,i){i?.errorMessages&&n&&(t.errorMessage={...t.errorMessage,[e]:n})}function ie(t,e,n,i,r){t[e]=n,ag(t,e,i,r)}var Hl=(t,e)=>{let n=0;for(;n<t.length&&n<e.length&&t[n]===e[n];n++);return[(t.length-n).toString(),...e.slice(n)].join("/")};function we(t){if(t.target!=="openAi")return{};let e=[...t.basePath,t.definitionPath,t.openAiAnyTypeName];return t.flags.hasReferencedOpenAiAnyType=!0,{$ref:t.$refStrategy==="relative"?Hl(e,t.currentPath):e.join("/")}}function sx(t,e){let n={type:"array"};return t.type?._def&&t.type?._def?.typeName!==E.ZodAny&&(n.items=V(t.type._def,{...e,currentPath:[...e.currentPath,"items"]})),t.minLength&&ie(n,"minItems",t.minLength.value,t.minLength.message,e),t.maxLength&&ie(n,"maxItems",t.maxLength.value,t.maxLength.message,e),t.exactLength&&(ie(n,"minItems",t.exactLength.value,t.exactLength.message,e),ie(n,"maxItems",t.exactLength.value,t.exactLength.message,e)),n}function ax(t,e){let n={type:"integer",format:"int64"};if(!t.checks)return n;for(let i of t.checks)switch(i.kind){case"min":e.target==="jsonSchema7"?i.inclusive?ie(n,"minimum",i.value,i.message,e):ie(n,"exclusiveMinimum",i.value,i.message,e):(i.inclusive||(n.exclusiveMinimum=!0),ie(n,"minimum",i.value,i.message,e));break;case"max":e.target==="jsonSchema7"?i.inclusive?ie(n,"maximum",i.value,i.message,e):ie(n,"exclusiveMaximum",i.value,i.message,e):(i.inclusive||(n.exclusiveMaximum=!0),ie(n,"maximum",i.value,i.message,e));break;case"multipleOf":ie(n,"multipleOf",i.value,i.message,e);break}return n}function cx(){return{type:"boolean"}}function Gl(t,e){return V(t.type._def,e)}var ux=(t,e)=>V(t.innerType._def,e);function cg(t,e,n){let i=n??e.dateStrategy;if(Array.isArray(i))return{anyOf:i.map((r,o)=>cg(t,e,r))};switch(i){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return PN(t,e)}}var PN=(t,e)=>{let n={type:"integer",format:"unix-time"};if(e.target==="openApi3")return n;for(let i of t.checks)switch(i.kind){case"min":ie(n,"minimum",i.value,i.message,e);break;case"max":ie(n,"maximum",i.value,i.message,e);break}return n};function lx(t,e){return{...V(t.innerType._def,e),default:t.defaultValue()}}function dx(t,e){return e.effectStrategy==="input"?V(t.schema._def,e):we(e)}function px(t){return{type:"string",enum:Array.from(t.values)}}var AN=t=>"type"in t&&t.type==="string"?!1:"allOf"in t;function mx(t,e){let n=[V(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),V(t.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(o=>!!o),i=e.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,r=[];return n.forEach(o=>{if(AN(o))r.push(...o.allOf),o.unevaluatedProperties===void 0&&(i=void 0);else{let s=o;if("additionalProperties"in o&&o.additionalProperties===!1){let{additionalProperties:c,...u}=o;s=u}else i=void 0;r.push(s)}}),r.length?{allOf:r,...i}:void 0}function fx(t,e){let n=typeof t.value;return n!=="bigint"&&n!=="number"&&n!=="boolean"&&n!=="string"?{type:Array.isArray(t.value)?"array":"object"}:e.target==="openApi3"?{type:n==="bigint"?"integer":n,enum:[t.value]}:{type:n==="bigint"?"integer":n,const:t.value}}var ug,Nt={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:()=>(ug===void 0&&(ug=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),ug),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 Kl(t,e){let n={type:"string"};if(t.checks)for(let i of t.checks)switch(i.kind){case"min":ie(n,"minLength",typeof n.minLength=="number"?Math.max(n.minLength,i.value):i.value,i.message,e);break;case"max":ie(n,"maxLength",typeof n.maxLength=="number"?Math.min(n.maxLength,i.value):i.value,i.message,e);break;case"email":switch(e.emailStrategy){case"format:email":Ct(n,"email",i.message,e);break;case"format:idn-email":Ct(n,"idn-email",i.message,e);break;case"pattern:zod":Xe(n,Nt.email,i.message,e);break}break;case"url":Ct(n,"uri",i.message,e);break;case"uuid":Ct(n,"uuid",i.message,e);break;case"regex":Xe(n,i.regex,i.message,e);break;case"cuid":Xe(n,Nt.cuid,i.message,e);break;case"cuid2":Xe(n,Nt.cuid2,i.message,e);break;case"startsWith":Xe(n,RegExp(`^${lg(i.value,e)}`),i.message,e);break;case"endsWith":Xe(n,RegExp(`${lg(i.value,e)}$`),i.message,e);break;case"datetime":Ct(n,"date-time",i.message,e);break;case"date":Ct(n,"date",i.message,e);break;case"time":Ct(n,"time",i.message,e);break;case"duration":Ct(n,"duration",i.message,e);break;case"length":ie(n,"minLength",typeof n.minLength=="number"?Math.max(n.minLength,i.value):i.value,i.message,e),ie(n,"maxLength",typeof n.maxLength=="number"?Math.min(n.maxLength,i.value):i.value,i.message,e);break;case"includes":{Xe(n,RegExp(lg(i.value,e)),i.message,e);break}case"ip":{i.version!=="v6"&&Ct(n,"ipv4",i.message,e),i.version!=="v4"&&Ct(n,"ipv6",i.message,e);break}case"base64url":Xe(n,Nt.base64url,i.message,e);break;case"jwt":Xe(n,Nt.jwt,i.message,e);break;case"cidr":{i.version!=="v6"&&Xe(n,Nt.ipv4Cidr,i.message,e),i.version!=="v4"&&Xe(n,Nt.ipv6Cidr,i.message,e);break}case"emoji":Xe(n,Nt.emoji(),i.message,e);break;case"ulid":{Xe(n,Nt.ulid,i.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{Ct(n,"binary",i.message,e);break}case"contentEncoding:base64":{ie(n,"contentEncoding","base64",i.message,e);break}case"pattern:zod":{Xe(n,Nt.base64,i.message,e);break}}break}case"nanoid":Xe(n,Nt.nanoid,i.message,e);case"toLowerCase":case"toUpperCase":case"trim":break;default:}return n}function lg(t,e){return e.patternStrategy==="escape"?CN(t):t}var NN=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function CN(t){let e="";for(let n=0;n<t.length;n++)NN.has(t[n])||(e+="\\"),e+=t[n];return e}function Ct(t,e,n,i){t.format||t.anyOf?.some(r=>r.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push({format:t.format,...t.errorMessage&&i.errorMessages&&{errorMessage:{format:t.errorMessage.format}}}),delete t.format,t.errorMessage&&(delete t.errorMessage.format,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.anyOf.push({format:e,...n&&i.errorMessages&&{errorMessage:{format:n}}})):ie(t,"format",e,n,i)}function Xe(t,e,n,i){t.pattern||t.allOf?.some(r=>r.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push({pattern:t.pattern,...t.errorMessage&&i.errorMessages&&{errorMessage:{pattern:t.errorMessage.pattern}}}),delete t.pattern,t.errorMessage&&(delete t.errorMessage.pattern,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.allOf.push({pattern:hx(e,i),...n&&i.errorMessages&&{errorMessage:{pattern:n}}})):ie(t,"pattern",hx(e,i),n,i)}function hx(t,e){if(!e.applyRegexFlags||!t.flags)return t.source;let n={i:t.flags.includes("i"),m:t.flags.includes("m"),s:t.flags.includes("s")},i=n.i?t.source.toLowerCase():t.source,r="",o=!1,s=!1,c=!1;for(let u=0;u<i.length;u++){if(o){r+=i[u],o=!1;continue}if(n.i){if(s){if(i[u].match(/[a-z]/)){c?(r+=i[u],r+=`${i[u-2]}-${i[u]}`.toUpperCase(),c=!1):i[u+1]==="-"&&i[u+2]?.match(/[a-z]/)?(r+=i[u],c=!0):r+=`${i[u]}${i[u].toUpperCase()}`;continue}}else if(i[u].match(/[a-z]/)){r+=`[${i[u]}${i[u].toUpperCase()}]`;continue}}if(n.m){if(i[u]==="^"){r+=`(^|(?<=[\r
|
|
74
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let s of t.seen.entries()){let c=s[1];if(e===s[0]){o(s);continue}if(t.external){let l=t.external.registry.get(s[0])?.id;if(e!==s[0]&&l){o(s);continue}}if(t.metadataRegistry.get(s[0])?.id){o(s);continue}if(c.cycle){o(s);continue}if(c.count>1&&t.reused==="ref"){o(s);continue}}}function Tn(t,e){let n=t.seen.get(e);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=c=>{let u=t.seen.get(c);if(u.ref===null)return;let l=u.def??u.schema,p={...l},d=u.ref;if(u.ref=null,d){i(d);let f=t.seen.get(d),g=f.schema;if(g.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0")?(l.allOf=l.allOf??[],l.allOf.push(g)):Object.assign(l,g),Object.assign(l,p),c._zod.parent===d)for(let v in l)v==="$ref"||v==="allOf"||v in p||delete l[v];if(g.$ref&&f.def)for(let v in l)v==="$ref"||v==="allOf"||v in f.def&&JSON.stringify(l[v])===JSON.stringify(f.def[v])&&delete l[v]}let m=c._zod.parent;if(m&&m!==d){i(m);let f=t.seen.get(m);if(f?.schema.$ref&&(l.$ref=f.schema.$ref,f.def))for(let g in l)g==="$ref"||g==="allOf"||g in f.def&&JSON.stringify(l[g])===JSON.stringify(f.def[g])&&delete l[g]}t.override({zodSchema:c,jsonSchema:l,path:u.path??[]})};for(let c of[...t.seen.entries()].reverse())i(c[0]);let r={};if(t.target==="draft-2020-12"?r.$schema="https://json-schema.org/draft/2020-12/schema":t.target==="draft-07"?r.$schema="http://json-schema.org/draft-07/schema#":t.target==="draft-04"?r.$schema="http://json-schema.org/draft-04/schema#":t.target,t.external?.uri){let c=t.external.registry.get(e)?.id;if(!c)throw new Error("Schema is missing an `id` property");r.$id=t.external.uri(c)}Object.assign(r,n.def??n.schema);let o=t.metadataRegistry.get(e)?.id;o!==void 0&&r.id===o&&delete r.id;let s=t.external?.defs??{};for(let c of t.seen.entries()){let u=c[1];u.def&&u.defId&&(u.def.id===u.defId&&delete u.def.id,s[u.defId]=u.def)}t.external||Object.keys(s).length>0&&(t.target==="draft-2020-12"?r.$defs=s:r.definitions=s);try{let c=JSON.parse(JSON.stringify(r));return Object.defineProperty(c,"~standard",{value:{...e["~standard"],jsonSchema:{input:ri(e,"input",t.processors),output:ri(e,"output",t.processors)}},enumerable:!1,writable:!1}),c}catch{throw new Error("Error converting schema to JSON.")}}function Qe(t,e){let n=e??{seen:new Set};if(n.seen.has(t))return!1;n.seen.add(t);let i=t._zod.def;if(i.type==="transform")return!0;if(i.type==="array")return Qe(i.element,n);if(i.type==="set")return Qe(i.valueType,n);if(i.type==="lazy")return Qe(i.getter(),n);if(i.type==="promise"||i.type==="optional"||i.type==="nonoptional"||i.type==="nullable"||i.type==="readonly"||i.type==="default"||i.type==="prefault")return Qe(i.innerType,n);if(i.type==="intersection")return Qe(i.left,n)||Qe(i.right,n);if(i.type==="record"||i.type==="map")return Qe(i.keyType,n)||Qe(i.valueType,n);if(i.type==="pipe")return t._zod.traits.has("$ZodCodec")?!0:Qe(i.in,n)||Qe(i.out,n);if(i.type==="object"){for(let r in i.shape)if(Qe(i.shape[r],n))return!0;return!1}if(i.type==="union"){for(let r of i.options)if(Qe(r,n))return!0;return!1}if(i.type==="tuple"){for(let r of i.items)if(Qe(r,n))return!0;return!!(i.rest&&Qe(i.rest,n))}return!1}var lf=(t,e={})=>n=>{let i=wn({...n,processors:e});return pe(t,i),En(i,t),Tn(i,t)},ri=(t,e,n={})=>i=>{let{libraryOptions:r,target:o}=i??{},s=wn({...r??{},target:o,io:e,processors:n});return pe(t,s),En(s,t),Tn(s,t)};var GP={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},df=(t,e,n,i)=>{let r=n;r.type="string";let{minimum:o,maximum:s,format:c,patterns:u,contentEncoding:l}=t._zod.bag;if(typeof o=="number"&&(r.minLength=o),typeof s=="number"&&(r.maxLength=s),c&&(r.format=GP[c]??c,r.format===""&&delete r.format,c==="time"&&delete r.format),l&&(r.contentEncoding=l),u&&u.size>0){let p=[...u];p.length===1?r.pattern=p[0].source:p.length>1&&(r.allOf=[...p.map(d=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},pf=(t,e,n,i)=>{let r=n,{minimum:o,maximum:s,format:c,multipleOf:u,exclusiveMaximum:l,exclusiveMinimum:p}=t._zod.bag;typeof c=="string"&&c.includes("int")?r.type="integer":r.type="number";let d=typeof p=="number"&&p>=(o??Number.NEGATIVE_INFINITY),m=typeof l=="number"&&l<=(s??Number.POSITIVE_INFINITY),f=e.target==="draft-04"||e.target==="openapi-3.0";d?f?(r.minimum=p,r.exclusiveMinimum=!0):r.exclusiveMinimum=p:typeof o=="number"&&(r.minimum=o),m?f?(r.maximum=l,r.exclusiveMaximum=!0):r.exclusiveMaximum=l:typeof s=="number"&&(r.maximum=s),typeof u=="number"&&(r.multipleOf=u)},mf=(t,e,n,i)=>{n.type="boolean"},ff=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},gf=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},hf=(t,e,n,i)=>{e.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},bf=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},yf=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},_f=(t,e,n,i)=>{n.not={}},vf=(t,e,n,i)=>{},kf=(t,e,n,i)=>{},Sf=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},xf=(t,e,n,i)=>{let r=t._zod.def,o=xo(r.entries);o.every(s=>typeof s=="number")&&(n.type="number"),o.every(s=>typeof s=="string")&&(n.type="string"),n.enum=o},If=(t,e,n,i)=>{let r=t._zod.def,o=[];for(let s of r.values)if(s===void 0){if(e.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof s=="bigint"){if(e.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");o.push(Number(s))}else o.push(s);if(o.length!==0)if(o.length===1){let s=o[0];n.type=s===null?"null":typeof s,e.target==="draft-04"||e.target==="openapi-3.0"?n.enum=[s]:n.const=s}else o.every(s=>typeof s=="number")&&(n.type="number"),o.every(s=>typeof s=="string")&&(n.type="string"),o.every(s=>typeof s=="boolean")&&(n.type="boolean"),o.every(s=>s===null)&&(n.type="null"),n.enum=o},$f=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},wf=(t,e,n,i)=>{let r=n,o=t._zod.pattern;if(!o)throw new Error("Pattern not found in template literal");r.type="string",r.pattern=o.source},Ef=(t,e,n,i)=>{let r=n,o={type:"string",format:"binary",contentEncoding:"binary"},{minimum:s,maximum:c,mime:u}=t._zod.bag;s!==void 0&&(o.minLength=s),c!==void 0&&(o.maxLength=c),u?u.length===1?(o.contentMediaType=u[0],Object.assign(r,o)):(Object.assign(r,o),r.anyOf=u.map(l=>({contentMediaType:l}))):Object.assign(r,o)},Tf=(t,e,n,i)=>{n.type="boolean"},Rf=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Of=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},Pf=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Af=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},Nf=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},Cf=(t,e,n,i)=>{let r=n,o=t._zod.def,{minimum:s,maximum:c}=t._zod.bag;typeof s=="number"&&(r.minItems=s),typeof c=="number"&&(r.maxItems=c),r.type="array",r.items=pe(o.element,e,{...i,path:[...i.path,"items"]})},zf=(t,e,n,i)=>{let r=n,o=t._zod.def;r.type="object",r.properties={};let s=o.shape;for(let l in s)r.properties[l]=pe(s[l],e,{...i,path:[...i.path,"properties",l]});let c=new Set(Object.keys(s)),u=new Set([...c].filter(l=>{let p=o.shape[l]._zod;return e.io==="input"?p.optin===void 0:p.optout===void 0}));u.size>0&&(r.required=Array.from(u)),o.catchall?._zod.def.type==="never"?r.additionalProperties=!1:o.catchall?o.catchall&&(r.additionalProperties=pe(o.catchall,e,{...i,path:[...i.path,"additionalProperties"]})):e.io==="output"&&(r.additionalProperties=!1)},Ju=(t,e,n,i)=>{let r=t._zod.def,o=r.inclusive===!1,s=r.options.map((c,u)=>pe(c,e,{...i,path:[...i.path,o?"oneOf":"anyOf",u]}));o?n.oneOf=s:n.anyOf=s},Df=(t,e,n,i)=>{let r=t._zod.def,o=pe(r.left,e,{...i,path:[...i.path,"allOf",0]}),s=pe(r.right,e,{...i,path:[...i.path,"allOf",1]}),c=l=>"allOf"in l&&Object.keys(l).length===1,u=[...c(o)?o.allOf:[o],...c(s)?s.allOf:[s]];n.allOf=u},jf=(t,e,n,i)=>{let r=n,o=t._zod.def;r.type="array";let s=e.target==="draft-2020-12"?"prefixItems":"items",c=e.target==="draft-2020-12"||e.target==="openapi-3.0"?"items":"additionalItems",u=o.items.map((m,f)=>pe(m,e,{...i,path:[...i.path,s,f]})),l=o.rest?pe(o.rest,e,{...i,path:[...i.path,c,...e.target==="openapi-3.0"?[o.items.length]:[]]}):null;e.target==="draft-2020-12"?(r.prefixItems=u,l&&(r.items=l)):e.target==="openapi-3.0"?(r.items={anyOf:u},l&&r.items.anyOf.push(l),r.minItems=u.length,l||(r.maxItems=u.length)):(r.items=u,l&&(r.additionalItems=l));let{minimum:p,maximum:d}=t._zod.bag;typeof p=="number"&&(r.minItems=p),typeof d=="number"&&(r.maxItems=d)},Uf=(t,e,n,i)=>{let r=n,o=t._zod.def;r.type="object";let s=o.keyType,u=s._zod.bag?.patterns;if(o.mode==="loose"&&u&&u.size>0){let p=pe(o.valueType,e,{...i,path:[...i.path,"patternProperties","*"]});r.patternProperties={};for(let d of u)r.patternProperties[d.source]=p}else(e.target==="draft-07"||e.target==="draft-2020-12")&&(r.propertyNames=pe(o.keyType,e,{...i,path:[...i.path,"propertyNames"]})),r.additionalProperties=pe(o.valueType,e,{...i,path:[...i.path,"additionalProperties"]});let l=s._zod.values;if(l){let p=[...l].filter(d=>typeof d=="string"||typeof d=="number");p.length>0&&(r.required=p)}},Mf=(t,e,n,i)=>{let r=t._zod.def,o=pe(r.innerType,e,i),s=e.seen.get(t);e.target==="openapi-3.0"?(s.ref=r.innerType,n.nullable=!0):n.anyOf=[o,{type:"null"}]},Lf=(t,e,n,i)=>{let r=t._zod.def;pe(r.innerType,e,i);let o=e.seen.get(t);o.ref=r.innerType},Zf=(t,e,n,i)=>{let r=t._zod.def;pe(r.innerType,e,i);let o=e.seen.get(t);o.ref=r.innerType,n.default=JSON.parse(JSON.stringify(r.defaultValue))},Bf=(t,e,n,i)=>{let r=t._zod.def;pe(r.innerType,e,i);let o=e.seen.get(t);o.ref=r.innerType,e.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(r.defaultValue)))},Ff=(t,e,n,i)=>{let r=t._zod.def;pe(r.innerType,e,i);let o=e.seen.get(t);o.ref=r.innerType;let s;try{s=r.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=s},Vf=(t,e,n,i)=>{let r=t._zod.def,o=r.in._zod.traits.has("$ZodTransform"),s=e.io==="input"?o?r.out:r.in:r.out;pe(s,e,i);let c=e.seen.get(t);c.ref=s},qf=(t,e,n,i)=>{let r=t._zod.def;pe(r.innerType,e,i);let o=e.seen.get(t);o.ref=r.innerType,n.readOnly=!0},Hf=(t,e,n,i)=>{let r=t._zod.def;pe(r.innerType,e,i);let o=e.seen.get(t);o.ref=r.innerType},Yu=(t,e,n,i)=>{let r=t._zod.def;pe(r.innerType,e,i);let o=e.seen.get(t);o.ref=r.innerType},Kf=(t,e,n,i)=>{let r=t._zod.innerType;pe(r,e,i);let o=e.seen.get(t);o.ref=r},Wu={string:df,number:pf,boolean:mf,bigint:ff,symbol:gf,null:hf,undefined:bf,void:yf,never:_f,any:vf,unknown:kf,date:Sf,enum:xf,literal:If,nan:$f,template_literal:wf,file:Ef,success:Tf,custom:Rf,function:Of,transform:Pf,map:Af,set:Nf,array:Cf,object:zf,union:Ju,intersection:Df,tuple:jf,record:Uf,nullable:Mf,nonoptional:Lf,default:Zf,prefault:Bf,catch:Ff,pipe:Vf,readonly:qf,promise:Hf,optional:Yu,lazy:Kf};function dr(t,e){if("_idmap"in t){let i=t,r=wn({...e,processors:Wu}),o={};for(let u of i._idmap.entries()){let[l,p]=u;pe(p,r)}let s={},c={registry:i,uri:e?.uri,defs:o};r.external=c;for(let u of i._idmap.entries()){let[l,p]=u;En(r,p),s[l]=Tn(r,p)}if(Object.keys(o).length>0){let u=r.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[u]:o}}return{schemas:s}}let n=wn({...e,processors:Wu});return pe(t,n),En(n,t),Tn(n,t)}var Xu=class{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(e){this.ctx.counter=e}get seen(){return this.ctx.seen}constructor(e){let n=e?.target??"draft-2020-12";n==="draft-4"&&(n="draft-04"),n==="draft-7"&&(n="draft-07"),this.ctx=wn({processors:Wu,target:n,...e?.metadata&&{metadata:e.metadata},...e?.unrepresentable&&{unrepresentable:e.unrepresentable},...e?.override&&{override:e.override},...e?.io&&{io:e.io}})}process(e,n={path:[],schemaPath:[]}){return pe(e,this.ctx,n)}emit(e,n){n&&(n.cycles&&(this.ctx.cycles=n.cycles),n.reused&&(this.ctx.reused=n.reused),n.external&&(this.ctx.external=n.external)),En(this.ctx,e);let i=Tn(this.ctx,e),{"~standard":r,...o}=i;return o}};var jk={};var ss={};nn(ss,{ZodAny:()=>fg,ZodArray:()=>yg,ZodBase64:()=>_l,ZodBase64URL:()=>vl,ZodBigInt:()=>li,ZodBigIntFormat:()=>xl,ZodBoolean:()=>ui,ZodCIDRv4:()=>bl,ZodCIDRv6:()=>yl,ZodCUID:()=>ll,ZodCUID2:()=>dl,ZodCatch:()=>Ug,ZodCodec:()=>bs,ZodCustom:()=>ys,ZodCustomStringFormat:()=>ai,ZodDate:()=>ps,ZodDefault:()=>Ag,ZodDiscriminatedUnion:()=>vg,ZodE164:()=>kl,ZodEmail:()=>al,ZodEmoji:()=>cl,ZodEnum:()=>oi,ZodExactOptional:()=>Rg,ZodFile:()=>Eg,ZodFunction:()=>Gg,ZodGUID:()=>as,ZodIPv4:()=>gl,ZodIPv6:()=>hl,ZodIntersection:()=>kg,ZodJWT:()=>Sl,ZodKSUID:()=>fl,ZodLazy:()=>qg,ZodLiteral:()=>wg,ZodMAC:()=>lg,ZodMap:()=>Ig,ZodNaN:()=>Lg,ZodNanoID:()=>ul,ZodNever:()=>hg,ZodNonOptional:()=>wl,ZodNull:()=>mg,ZodNullable:()=>Pg,ZodNumber:()=>ci,ZodNumberFormat:()=>pr,ZodObject:()=>ms,ZodOptional:()=>pi,ZodPipe:()=>hs,ZodPrefault:()=>Cg,ZodPreprocess:()=>Zg,ZodPromise:()=>Kg,ZodReadonly:()=>Bg,ZodRecord:()=>ii,ZodSet:()=>$g,ZodString:()=>si,ZodStringFormat:()=>he,ZodSuccess:()=>jg,ZodSymbol:()=>dg,ZodTemplateLiteral:()=>Vg,ZodTransform:()=>Tg,ZodTuple:()=>Sg,ZodType:()=>G,ZodULID:()=>pl,ZodURL:()=>ls,ZodUUID:()=>qt,ZodUndefined:()=>pg,ZodUnion:()=>fs,ZodUnknown:()=>gg,ZodVoid:()=>bg,ZodXID:()=>ml,ZodXor:()=>_g,_ZodString:()=>sl,_default:()=>Ng,_function:()=>BS,any:()=>xS,array:()=>Q,base64:()=>sS,base64url:()=>aS,bigint:()=>yS,boolean:()=>Oe,catch:()=>Mg,check:()=>FS,cidrv4:()=>iS,cidrv6:()=>oS,codec:()=>US,cuid:()=>Jk,cuid2:()=>Yk,custom:()=>El,date:()=>$S,describe:()=>VS,discriminatedUnion:()=>gs,e164:()=>cS,email:()=>Lk,emoji:()=>Gk,enum:()=>Ze,exactOptional:()=>Og,file:()=>CS,float32:()=>fS,float64:()=>gS,function:()=>BS,guid:()=>Zk,hash:()=>mS,hex:()=>pS,hostname:()=>dS,httpUrl:()=>Kk,instanceof:()=>HS,int:()=>il,int32:()=>hS,int64:()=>_S,intersection:()=>di,invertCodec:()=>MS,ipv4:()=>tS,ipv6:()=>rS,json:()=>GS,jwt:()=>uS,keyof:()=>wS,ksuid:()=>eS,lazy:()=>Hg,literal:()=>L,looseObject:()=>Le,looseRecord:()=>OS,mac:()=>nS,map:()=>PS,meta:()=>qS,nan:()=>jS,nanoid:()=>Wk,nativeEnum:()=>NS,never:()=>Il,nonoptional:()=>Dg,null:()=>ds,nullable:()=>cs,nullish:()=>zS,number:()=>ce,object:()=>C,optional:()=>ke,partialRecord:()=>RS,pipe:()=>ol,prefault:()=>zg,preprocess:()=>_s,promise:()=>ZS,readonly:()=>Fg,record:()=>fe,refine:()=>Wg,set:()=>AS,strictObject:()=>ES,string:()=>_,stringFormat:()=>lS,stringbool:()=>KS,success:()=>DS,superRefine:()=>Jg,symbol:()=>kS,templateLiteral:()=>LS,transform:()=>$l,tuple:()=>xg,uint32:()=>bS,uint64:()=>vS,ulid:()=>Xk,undefined:()=>SS,union:()=>ye,unknown:()=>be,url:()=>Hk,uuid:()=>Bk,uuidv4:()=>Fk,uuidv6:()=>Vk,uuidv7:()=>qk,void:()=>IS,xid:()=>Qk,xor:()=>TS});var Qu={};nn(Qu,{endsWith:()=>Jr,gt:()=>Ft,gte:()=>Xe,includes:()=>Gr,length:()=>ur,lowercase:()=>Hr,lt:()=>Bt,lte:()=>mt,maxLength:()=>cr,maxSize:()=>$n,mime:()=>Yr,minLength:()=>on,minSize:()=>Vt,multipleOf:()=>In,negative:()=>Uu,nonnegative:()=>Lu,nonpositive:()=>Mu,normalize:()=>Xr,overwrite:()=>Rt,positive:()=>ju,property:()=>Zu,regex:()=>qr,size:()=>ar,slugify:()=>ni,startsWith:()=>Wr,toLowerCase:()=>ei,toUpperCase:()=>ti,trim:()=>Qr,uppercase:()=>Kr});var Rn={};nn(Rn,{ZodISODate:()=>tl,ZodISODateTime:()=>el,ZodISODuration:()=>rl,ZodISOTime:()=>nl,date:()=>Wf,datetime:()=>Gf,duration:()=>Yf,time:()=>Jf});var el=h("ZodISODateTime",(t,e)=>{Fm.init(t,e),he.init(t,e)});function Gf(t){return ef(el,t)}var tl=h("ZodISODate",(t,e)=>{Vm.init(t,e),he.init(t,e)});function Wf(t){return tf(tl,t)}var nl=h("ZodISOTime",(t,e)=>{qm.init(t,e),he.init(t,e)});function Jf(t){return nf(nl,t)}var rl=h("ZodISODuration",(t,e)=>{Hm.init(t,e),he.init(t,e)});function Yf(t){return rf(rl,t)}var Uk=(t,e)=>{To.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:n=>Oo(t,n)},flatten:{value:n=>Ro(t,n)},addIssue:{value:n=>{t.issues.push(n),t.message=JSON.stringify(t.issues,Or,2)}},addIssues:{value:n=>{t.issues.push(...n),t.message=JSON.stringify(t.issues,Or,2)}},isEmpty:{get(){return t.issues.length===0}}})},JP=h("ZodError",Uk),ct=h("ZodError",Uk,{Parent:Error});var Xf=Nr(ct),Qf=Cr(ct),eg=zr(ct),tg=Dr(ct),ng=Ha(ct),rg=Ka(ct),ig=Ga(ct),og=Wa(ct),sg=Ja(ct),ag=Ya(ct),cg=Xa(ct),ug=Qa(ct);var Mk=new WeakMap;function us(t,e,n){let i=Object.getPrototypeOf(t),r=Mk.get(i);if(r||(r=new Set,Mk.set(i,r)),!r.has(e)){r.add(e);for(let o in n){let s=n[o];Object.defineProperty(i,o,{configurable:!0,enumerable:!1,get(){let c=s.bind(this);return Object.defineProperty(this,o,{configurable:!0,writable:!0,enumerable:!0,value:c}),c},set(c){Object.defineProperty(this,o,{configurable:!0,writable:!0,enumerable:!0,value:c})}})}}}var G=h("ZodType",(t,e)=>(H.init(t,e),Object.assign(t["~standard"],{jsonSchema:{input:ri(t,"input"),output:ri(t,"output")}}),t.toJSONSchema=lf(t,{}),t.def=e,t.type=e.type,Object.defineProperty(t,"_def",{value:e}),t.parse=(n,i)=>Xf(t,n,i,{callee:t.parse}),t.safeParse=(n,i)=>eg(t,n,i),t.parseAsync=async(n,i)=>Qf(t,n,i,{callee:t.parseAsync}),t.safeParseAsync=async(n,i)=>tg(t,n,i),t.spa=t.safeParseAsync,t.encode=(n,i)=>ng(t,n,i),t.decode=(n,i)=>rg(t,n,i),t.encodeAsync=async(n,i)=>ig(t,n,i),t.decodeAsync=async(n,i)=>og(t,n,i),t.safeEncode=(n,i)=>sg(t,n,i),t.safeDecode=(n,i)=>ag(t,n,i),t.safeEncodeAsync=async(n,i)=>cg(t,n,i),t.safeDecodeAsync=async(n,i)=>ug(t,n,i),us(t,"ZodType",{check(...n){let i=this.def;return this.clone($.mergeDefs(i,{checks:[...i.checks??[],...n.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0})},with(...n){return this.check(...n)},clone(n,i){return Ue(this,n,i)},brand(){return this},register(n,i){return n.add(this,i),this},refine(n,i){return this.check(Wg(n,i))},superRefine(n,i){return this.check(Jg(n,i))},overwrite(n){return this.check(Rt(n))},optional(){return ke(this)},exactOptional(){return Og(this)},nullable(){return cs(this)},nullish(){return ke(cs(this))},nonoptional(n){return Dg(this,n)},array(){return Q(this)},or(n){return ye([this,n])},and(n){return di(this,n)},transform(n){return ol(this,$l(n))},default(n){return Ng(this,n)},prefault(n){return zg(this,n)},catch(n){return Mg(this,n)},pipe(n){return ol(this,n)},readonly(){return Fg(this)},describe(n){let i=this.clone();return Me.add(i,{description:n}),i},meta(...n){if(n.length===0)return Me.get(this);let i=this.clone();return Me.add(i,n[0]),i},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(n){return n(this)}}),Object.defineProperty(t,"description",{get(){return Me.get(t)?.description},configurable:!0}),t)),sl=h("_ZodString",(t,e)=>{xn.init(t,e),G.init(t,e),t._zod.processJSONSchema=(i,r,o)=>df(t,i,r,o);let n=t._zod.bag;t.format=n.format??null,t.minLength=n.minimum??null,t.maxLength=n.maximum??null,us(t,"_ZodString",{regex(...i){return this.check(qr(...i))},includes(...i){return this.check(Gr(...i))},startsWith(...i){return this.check(Wr(...i))},endsWith(...i){return this.check(Jr(...i))},min(...i){return this.check(on(...i))},max(...i){return this.check(cr(...i))},length(...i){return this.check(ur(...i))},nonempty(...i){return this.check(on(1,...i))},lowercase(i){return this.check(Hr(i))},uppercase(i){return this.check(Kr(i))},trim(){return this.check(Qr())},normalize(...i){return this.check(Xr(...i))},toLowerCase(){return this.check(ei())},toUpperCase(){return this.check(ti())},slugify(){return this.check(ni())}})}),si=h("ZodString",(t,e)=>{xn.init(t,e),sl.init(t,e),t.email=n=>t.check(Lo(al,n)),t.url=n=>t.check(Vr(ls,n)),t.jwt=n=>t.check(os(Sl,n)),t.emoji=n=>t.check(qo(cl,n)),t.guid=n=>t.check(Fr(as,n)),t.uuid=n=>t.check(Zo(qt,n)),t.uuidv4=n=>t.check(Bo(qt,n)),t.uuidv6=n=>t.check(Fo(qt,n)),t.uuidv7=n=>t.check(Vo(qt,n)),t.nanoid=n=>t.check(Ho(ul,n)),t.guid=n=>t.check(Fr(as,n)),t.cuid=n=>t.check(Ko(ll,n)),t.cuid2=n=>t.check(Go(dl,n)),t.ulid=n=>t.check(Wo(pl,n)),t.base64=n=>t.check(ns(_l,n)),t.base64url=n=>t.check(rs(vl,n)),t.xid=n=>t.check(Jo(ml,n)),t.ksuid=n=>t.check(Yo(fl,n)),t.ipv4=n=>t.check(Xo(gl,n)),t.ipv6=n=>t.check(Qo(hl,n)),t.cidrv4=n=>t.check(es(bl,n)),t.cidrv6=n=>t.check(ts(yl,n)),t.e164=n=>t.check(is(kl,n)),t.datetime=n=>t.check(Gf(n)),t.date=n=>t.check(Wf(n)),t.time=n=>t.check(Jf(n)),t.duration=n=>t.check(Yf(n))});function _(t){return hu(si,t)}var he=h("ZodStringFormat",(t,e)=>{me.init(t,e),sl.init(t,e)}),al=h("ZodEmail",(t,e)=>{lc.init(t,e),he.init(t,e)});function Lk(t){return Lo(al,t)}var as=h("ZodGUID",(t,e)=>{cc.init(t,e),he.init(t,e)});function Zk(t){return Fr(as,t)}var qt=h("ZodUUID",(t,e)=>{uc.init(t,e),he.init(t,e)});function Bk(t){return Zo(qt,t)}function Fk(t){return Bo(qt,t)}function Vk(t){return Fo(qt,t)}function qk(t){return Vo(qt,t)}var ls=h("ZodURL",(t,e)=>{dc.init(t,e),he.init(t,e)});function Hk(t){return Vr(ls,t)}function Kk(t){return Vr(ls,{protocol:at.httpProtocol,hostname:at.domain,...$.normalizeParams(t)})}var cl=h("ZodEmoji",(t,e)=>{pc.init(t,e),he.init(t,e)});function Gk(t){return qo(cl,t)}var ul=h("ZodNanoID",(t,e)=>{mc.init(t,e),he.init(t,e)});function Wk(t){return Ho(ul,t)}var ll=h("ZodCUID",(t,e)=>{fc.init(t,e),he.init(t,e)});function Jk(t){return Ko(ll,t)}var dl=h("ZodCUID2",(t,e)=>{gc.init(t,e),he.init(t,e)});function Yk(t){return Go(dl,t)}var pl=h("ZodULID",(t,e)=>{hc.init(t,e),he.init(t,e)});function Xk(t){return Wo(pl,t)}var ml=h("ZodXID",(t,e)=>{bc.init(t,e),he.init(t,e)});function Qk(t){return Jo(ml,t)}var fl=h("ZodKSUID",(t,e)=>{yc.init(t,e),he.init(t,e)});function eS(t){return Yo(fl,t)}var gl=h("ZodIPv4",(t,e)=>{_c.init(t,e),he.init(t,e)});function tS(t){return Xo(gl,t)}var lg=h("ZodMAC",(t,e)=>{kc.init(t,e),he.init(t,e)});function nS(t){return bu(lg,t)}var hl=h("ZodIPv6",(t,e)=>{vc.init(t,e),he.init(t,e)});function rS(t){return Qo(hl,t)}var bl=h("ZodCIDRv4",(t,e)=>{Sc.init(t,e),he.init(t,e)});function iS(t){return es(bl,t)}var yl=h("ZodCIDRv6",(t,e)=>{xc.init(t,e),he.init(t,e)});function oS(t){return ts(yl,t)}var _l=h("ZodBase64",(t,e)=>{Ic.init(t,e),he.init(t,e)});function sS(t){return ns(_l,t)}var vl=h("ZodBase64URL",(t,e)=>{$c.init(t,e),he.init(t,e)});function aS(t){return rs(vl,t)}var kl=h("ZodE164",(t,e)=>{wc.init(t,e),he.init(t,e)});function cS(t){return is(kl,t)}var Sl=h("ZodJWT",(t,e)=>{Ec.init(t,e),he.init(t,e)});function uS(t){return os(Sl,t)}var ai=h("ZodCustomStringFormat",(t,e)=>{Tc.init(t,e),he.init(t,e)});function lS(t,e,n={}){return lr(ai,t,e,n)}function dS(t){return lr(ai,"hostname",at.hostname,t)}function pS(t){return lr(ai,"hex",at.hex,t)}function mS(t,e){let n=e?.enc??"hex",i=`${t}_${n}`,r=at[i];if(!r)throw new Error(`Unrecognized hash format: ${i}`);return lr(ai,i,r,e)}var ci=h("ZodNumber",(t,e)=>{Co.init(t,e),G.init(t,e),t._zod.processJSONSchema=(i,r,o)=>pf(t,i,r,o),us(t,"ZodNumber",{gt(i,r){return this.check(Ft(i,r))},gte(i,r){return this.check(Xe(i,r))},min(i,r){return this.check(Xe(i,r))},lt(i,r){return this.check(Bt(i,r))},lte(i,r){return this.check(mt(i,r))},max(i,r){return this.check(mt(i,r))},int(i){return this.check(il(i))},safe(i){return this.check(il(i))},positive(i){return this.check(Ft(0,i))},nonnegative(i){return this.check(Xe(0,i))},negative(i){return this.check(Bt(0,i))},nonpositive(i){return this.check(mt(0,i))},multipleOf(i,r){return this.check(In(i,r))},step(i,r){return this.check(In(i,r))},finite(){return this}});let n=t._zod.bag;t.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),t.isFinite=!0,t.format=n.format??null});function ce(t){return yu(ci,t)}var pr=h("ZodNumberFormat",(t,e)=>{Rc.init(t,e),ci.init(t,e)});function il(t){return _u(pr,t)}function fS(t){return vu(pr,t)}function gS(t){return ku(pr,t)}function hS(t){return Su(pr,t)}function bS(t){return xu(pr,t)}var ui=h("ZodBoolean",(t,e)=>{Ur.init(t,e),G.init(t,e),t._zod.processJSONSchema=(n,i,r)=>mf(t,n,i,r)});function Oe(t){return Iu(ui,t)}var li=h("ZodBigInt",(t,e)=>{zo.init(t,e),G.init(t,e),t._zod.processJSONSchema=(i,r,o)=>ff(t,i,r,o),t.gte=(i,r)=>t.check(Xe(i,r)),t.min=(i,r)=>t.check(Xe(i,r)),t.gt=(i,r)=>t.check(Ft(i,r)),t.gte=(i,r)=>t.check(Xe(i,r)),t.min=(i,r)=>t.check(Xe(i,r)),t.lt=(i,r)=>t.check(Bt(i,r)),t.lte=(i,r)=>t.check(mt(i,r)),t.max=(i,r)=>t.check(mt(i,r)),t.positive=i=>t.check(Ft(BigInt(0),i)),t.negative=i=>t.check(Bt(BigInt(0),i)),t.nonpositive=i=>t.check(mt(BigInt(0),i)),t.nonnegative=i=>t.check(Xe(BigInt(0),i)),t.multipleOf=(i,r)=>t.check(In(i,r));let n=t._zod.bag;t.minValue=n.minimum??null,t.maxValue=n.maximum??null,t.format=n.format??null});function yS(t){return $u(li,t)}var xl=h("ZodBigIntFormat",(t,e)=>{Oc.init(t,e),li.init(t,e)});function _S(t){return wu(xl,t)}function vS(t){return Eu(xl,t)}var dg=h("ZodSymbol",(t,e)=>{Pc.init(t,e),G.init(t,e),t._zod.processJSONSchema=(n,i,r)=>gf(t,n,i,r)});function kS(t){return Tu(dg,t)}var pg=h("ZodUndefined",(t,e)=>{Ac.init(t,e),G.init(t,e),t._zod.processJSONSchema=(n,i,r)=>bf(t,n,i,r)});function SS(t){return Ru(pg,t)}var mg=h("ZodNull",(t,e)=>{Nc.init(t,e),G.init(t,e),t._zod.processJSONSchema=(n,i,r)=>hf(t,n,i,r)});function ds(t){return Ou(mg,t)}var fg=h("ZodAny",(t,e)=>{Cc.init(t,e),G.init(t,e),t._zod.processJSONSchema=(n,i,r)=>vf(t,n,i,r)});function xS(){return Pu(fg)}var gg=h("ZodUnknown",(t,e)=>{zc.init(t,e),G.init(t,e),t._zod.processJSONSchema=(n,i,r)=>kf(t,n,i,r)});function be(){return Au(gg)}var hg=h("ZodNever",(t,e)=>{Dc.init(t,e),G.init(t,e),t._zod.processJSONSchema=(n,i,r)=>_f(t,n,i,r)});function Il(t){return Nu(hg,t)}var bg=h("ZodVoid",(t,e)=>{jc.init(t,e),G.init(t,e),t._zod.processJSONSchema=(n,i,r)=>yf(t,n,i,r)});function IS(t){return Cu(bg,t)}var ps=h("ZodDate",(t,e)=>{Uc.init(t,e),G.init(t,e),t._zod.processJSONSchema=(i,r,o)=>Sf(t,i,r,o),t.min=(i,r)=>t.check(Xe(i,r)),t.max=(i,r)=>t.check(mt(i,r));let n=t._zod.bag;t.minDate=n.minimum?new Date(n.minimum):null,t.maxDate=n.maximum?new Date(n.maximum):null});function $S(t){return zu(ps,t)}var yg=h("ZodArray",(t,e)=>{Mc.init(t,e),G.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Cf(t,n,i,r),t.element=e.element,us(t,"ZodArray",{min(n,i){return this.check(on(n,i))},nonempty(n){return this.check(on(1,n))},max(n,i){return this.check(cr(n,i))},length(n,i){return this.check(ur(n,i))},unwrap(){return this.element}})});function Q(t,e){return uf(yg,t,e)}function wS(t){let e=t._zod.def.shape;return Ze(Object.keys(e))}var ms=h("ZodObject",(t,e)=>{Gm.init(t,e),G.init(t,e),t._zod.processJSONSchema=(n,i,r)=>zf(t,n,i,r),$.defineLazy(t,"shape",()=>e.shape),us(t,"ZodObject",{keyof(){return Ze(Object.keys(this._zod.def.shape))},catchall(n){return this.clone({...this._zod.def,catchall:n})},passthrough(){return this.clone({...this._zod.def,catchall:be()})},loose(){return this.clone({...this._zod.def,catchall:be()})},strict(){return this.clone({...this._zod.def,catchall:Il()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(n){return $.extend(this,n)},safeExtend(n){return $.safeExtend(this,n)},merge(n){return $.merge(this,n)},pick(n){return $.pick(this,n)},omit(n){return $.omit(this,n)},partial(...n){return $.partial(pi,this,n[0])},required(...n){return $.required(wl,this,n[0])}})});function C(t,e){let n={type:"object",shape:t??{},...$.normalizeParams(e)};return new ms(n)}function ES(t,e){return new ms({type:"object",shape:t,catchall:Il(),...$.normalizeParams(e)})}function Le(t,e){return new ms({type:"object",shape:t,catchall:be(),...$.normalizeParams(e)})}var fs=h("ZodUnion",(t,e)=>{Mr.init(t,e),G.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Ju(t,n,i,r),t.options=e.options});function ye(t,e){return new fs({type:"union",options:t,...$.normalizeParams(e)})}var _g=h("ZodXor",(t,e)=>{fs.init(t,e),Zc.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Ju(t,n,i,r),t.options=e.options});function TS(t,e){return new _g({type:"union",options:t,inclusive:!1,...$.normalizeParams(e)})}var vg=h("ZodDiscriminatedUnion",(t,e)=>{fs.init(t,e),Bc.init(t,e)});function gs(t,e,n){return new vg({type:"union",options:e,discriminator:t,...$.normalizeParams(n)})}var kg=h("ZodIntersection",(t,e)=>{Fc.init(t,e),G.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Df(t,n,i,r)});function di(t,e){return new kg({type:"intersection",left:t,right:e})}var Sg=h("ZodTuple",(t,e)=>{Do.init(t,e),G.init(t,e),t._zod.processJSONSchema=(n,i,r)=>jf(t,n,i,r),t.rest=n=>t.clone({...t._zod.def,rest:n})});function xg(t,e,n){let i=e instanceof H,r=i?n:e,o=i?e:null;return new Sg({type:"tuple",items:t,rest:o,...$.normalizeParams(r)})}var ii=h("ZodRecord",(t,e)=>{Vc.init(t,e),G.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Uf(t,n,i,r),t.keyType=e.keyType,t.valueType=e.valueType});function fe(t,e,n){return!e||!e._zod?new ii({type:"record",keyType:_(),valueType:t,...$.normalizeParams(e)}):new ii({type:"record",keyType:t,valueType:e,...$.normalizeParams(n)})}function RS(t,e,n){let i=Ue(t);return i._zod.values=void 0,new ii({type:"record",keyType:i,valueType:e,...$.normalizeParams(n)})}function OS(t,e,n){return new ii({type:"record",keyType:t,valueType:e,mode:"loose",...$.normalizeParams(n)})}var Ig=h("ZodMap",(t,e)=>{qc.init(t,e),G.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Af(t,n,i,r),t.keyType=e.keyType,t.valueType=e.valueType,t.min=(...n)=>t.check(Vt(...n)),t.nonempty=n=>t.check(Vt(1,n)),t.max=(...n)=>t.check($n(...n)),t.size=(...n)=>t.check(ar(...n))});function PS(t,e,n){return new Ig({type:"map",keyType:t,valueType:e,...$.normalizeParams(n)})}var $g=h("ZodSet",(t,e)=>{Hc.init(t,e),G.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Nf(t,n,i,r),t.min=(...n)=>t.check(Vt(...n)),t.nonempty=n=>t.check(Vt(1,n)),t.max=(...n)=>t.check($n(...n)),t.size=(...n)=>t.check(ar(...n))});function AS(t,e){return new $g({type:"set",valueType:t,...$.normalizeParams(e)})}var oi=h("ZodEnum",(t,e)=>{Kc.init(t,e),G.init(t,e),t._zod.processJSONSchema=(i,r,o)=>xf(t,i,r,o),t.enum=e.entries,t.options=Object.values(e.entries);let n=new Set(Object.keys(e.entries));t.extract=(i,r)=>{let o={};for(let s of i)if(n.has(s))o[s]=e.entries[s];else throw new Error(`Key ${s} not found in enum`);return new oi({...e,checks:[],...$.normalizeParams(r),entries:o})},t.exclude=(i,r)=>{let o={...e.entries};for(let s of i)if(n.has(s))delete o[s];else throw new Error(`Key ${s} not found in enum`);return new oi({...e,checks:[],...$.normalizeParams(r),entries:o})}});function Ze(t,e){let n=Array.isArray(t)?Object.fromEntries(t.map(i=>[i,i])):t;return new oi({type:"enum",entries:n,...$.normalizeParams(e)})}function NS(t,e){return new oi({type:"enum",entries:t,...$.normalizeParams(e)})}var wg=h("ZodLiteral",(t,e)=>{Gc.init(t,e),G.init(t,e),t._zod.processJSONSchema=(n,i,r)=>If(t,n,i,r),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function L(t,e){return new wg({type:"literal",values:Array.isArray(t)?t:[t],...$.normalizeParams(e)})}var Eg=h("ZodFile",(t,e)=>{Wc.init(t,e),G.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Ef(t,n,i,r),t.min=(n,i)=>t.check(Vt(n,i)),t.max=(n,i)=>t.check($n(n,i)),t.mime=(n,i)=>t.check(Yr(Array.isArray(n)?n:[n],i))});function CS(t){return Bu(Eg,t)}var Tg=h("ZodTransform",(t,e)=>{Jc.init(t,e),G.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Pf(t,n,i,r),t._zod.parse=(n,i)=>{if(i.direction==="backward")throw new hn(t.constructor.name);n.addIssue=o=>{if(typeof o=="string")n.issues.push($.issue(o,n.value,e));else{let s=o;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=n.value),s.inst??(s.inst=t),n.issues.push($.issue(s))}};let r=e.transform(n.value,n);return r instanceof Promise?r.then(o=>(n.value=o,n.fallback=!0,n)):(n.value=r,n.fallback=!0,n)}});function $l(t){return new Tg({type:"transform",transform:t})}var pi=h("ZodOptional",(t,e)=>{jo.init(t,e),G.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Yu(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});function ke(t){return new pi({type:"optional",innerType:t})}var Rg=h("ZodExactOptional",(t,e)=>{Yc.init(t,e),G.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Yu(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});function Og(t){return new Rg({type:"optional",innerType:t})}var Pg=h("ZodNullable",(t,e)=>{Xc.init(t,e),G.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Mf(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});function cs(t){return new Pg({type:"nullable",innerType:t})}function zS(t){return ke(cs(t))}var Ag=h("ZodDefault",(t,e)=>{Qc.init(t,e),G.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Zf(t,n,i,r),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function Ng(t,e){return new Ag({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():$.shallowClone(e)}})}var Cg=h("ZodPrefault",(t,e)=>{eu.init(t,e),G.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Bf(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});function zg(t,e){return new Cg({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():$.shallowClone(e)}})}var wl=h("ZodNonOptional",(t,e)=>{tu.init(t,e),G.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Lf(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});function Dg(t,e){return new wl({type:"nonoptional",innerType:t,...$.normalizeParams(e)})}var jg=h("ZodSuccess",(t,e)=>{nu.init(t,e),G.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Tf(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});function DS(t){return new jg({type:"success",innerType:t})}var Ug=h("ZodCatch",(t,e)=>{ru.init(t,e),G.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Ff(t,n,i,r),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function Mg(t,e){return new Ug({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}var Lg=h("ZodNaN",(t,e)=>{iu.init(t,e),G.init(t,e),t._zod.processJSONSchema=(n,i,r)=>$f(t,n,i,r)});function jS(t){return Du(Lg,t)}var hs=h("ZodPipe",(t,e)=>{Uo.init(t,e),G.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Vf(t,n,i,r),t.in=e.in,t.out=e.out});function ol(t,e){return new hs({type:"pipe",in:t,out:e})}var bs=h("ZodCodec",(t,e)=>{hs.init(t,e),Lr.init(t,e)});function US(t,e,n){return new bs({type:"pipe",in:t,out:e,transform:n.decode,reverseTransform:n.encode})}function MS(t){let e=t._zod.def;return new bs({type:"pipe",in:e.out,out:e.in,transform:e.reverseTransform,reverseTransform:e.transform})}var Zg=h("ZodPreprocess",(t,e)=>{hs.init(t,e),Wm.init(t,e)}),Bg=h("ZodReadonly",(t,e)=>{ou.init(t,e),G.init(t,e),t._zod.processJSONSchema=(n,i,r)=>qf(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});function Fg(t){return new Bg({type:"readonly",innerType:t})}var Vg=h("ZodTemplateLiteral",(t,e)=>{su.init(t,e),G.init(t,e),t._zod.processJSONSchema=(n,i,r)=>wf(t,n,i,r)});function LS(t,e){return new Vg({type:"template_literal",parts:t,...$.normalizeParams(e)})}var qg=h("ZodLazy",(t,e)=>{uu.init(t,e),G.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Kf(t,n,i,r),t.unwrap=()=>t._zod.def.getter()});function Hg(t){return new qg({type:"lazy",getter:t})}var Kg=h("ZodPromise",(t,e)=>{cu.init(t,e),G.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Hf(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});function ZS(t){return new Kg({type:"promise",innerType:t})}var Gg=h("ZodFunction",(t,e)=>{au.init(t,e),G.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Of(t,n,i,r)});function BS(t){return new Gg({type:"function",input:Array.isArray(t?.input)?xg(t?.input):t?.input??Q(be()),output:t?.output??be()})}var ys=h("ZodCustom",(t,e)=>{lu.init(t,e),G.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Rf(t,n,i,r)});function FS(t){let e=new ge({check:"custom"});return e._zod.check=t,e}function El(t,e){return Fu(ys,t??(()=>!0),e)}function Wg(t,e={}){return Vu(ys,t,e)}function Jg(t,e){return qu(t,e)}var VS=Hu,qS=Ku;function HS(t,e={}){let n=new ys({type:"custom",check:"custom",fn:i=>i instanceof t,abort:!0,...$.normalizeParams(e)});return n._zod.bag.Class=t,n._zod.check=i=>{i.value instanceof t||i.issues.push({code:"invalid_type",expected:t.name,input:i.value,inst:n,path:[...n._zod.def.path??[]]})},n}var KS=(...t)=>Gu({Codec:bs,Boolean:ui,String:si},...t);function GS(t){let e=Hg(()=>ye([_(t),ce(),Oe(),ds(),Q(e),fe(_(),e)]));return e}function _s(t,e){return new Zg({type:"pipe",in:$l(t),out:e})}var XP={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 QP(t){Re({customError:t})}function eA(){return Re().customError}var Yg;Yg||(Yg={});var O={...ss,...Qu,iso:Rn},tA=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function nA(t,e){let n=t.$schema;return n==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":n==="http://json-schema.org/draft-07/schema#"?"draft-7":n==="http://json-schema.org/draft-04/schema#"?"draft-4":e??"draft-2020-12"}function rA(t,e){if(!t.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let n=t.slice(1).split("/").filter(Boolean);if(n.length===0)return e.rootSchema;let i=e.version==="draft-2020-12"?"$defs":"definitions";if(n[0]===i){let r=n[1];if(!r||!e.defs[r])throw new Error(`Reference not found: ${t}`);return e.defs[r]}throw new Error(`Reference not found: ${t}`)}function WS(t,e){if(t.not!==void 0){if(typeof t.not=="object"&&Object.keys(t.not).length===0)return O.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(t.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(t.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(t.if!==void 0||t.then!==void 0||t.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(t.dependentSchemas!==void 0||t.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(t.$ref){let r=t.$ref;if(e.refs.has(r))return e.refs.get(r);if(e.processing.has(r))return O.lazy(()=>{if(!e.refs.has(r))throw new Error(`Circular reference not resolved: ${r}`);return e.refs.get(r)});e.processing.add(r);let o=rA(r,e),s=He(o,e);return e.refs.set(r,s),e.processing.delete(r),s}if(t.enum!==void 0){let r=t.enum;if(e.version==="openapi-3.0"&&t.nullable===!0&&r.length===1&&r[0]===null)return O.null();if(r.length===0)return O.never();if(r.length===1)return O.literal(r[0]);if(r.every(s=>typeof s=="string"))return O.enum(r);let o=r.map(s=>O.literal(s));return o.length<2?o[0]:O.union([o[0],o[1],...o.slice(2)])}if(t.const!==void 0)return O.literal(t.const);let n=t.type;if(Array.isArray(n)){let r=n.map(o=>{let s={...t,type:o};return WS(s,e)});return r.length===0?O.never():r.length===1?r[0]:O.union(r)}if(!n)return O.any();let i;switch(n){case"string":{let r=O.string();if(t.format){let o=t.format;o==="email"?r=r.check(O.email()):o==="uri"||o==="uri-reference"?r=r.check(O.url()):o==="uuid"||o==="guid"?r=r.check(O.uuid()):o==="date-time"?r=r.check(O.iso.datetime()):o==="date"?r=r.check(O.iso.date()):o==="time"?r=r.check(O.iso.time()):o==="duration"?r=r.check(O.iso.duration()):o==="ipv4"?r=r.check(O.ipv4()):o==="ipv6"?r=r.check(O.ipv6()):o==="mac"?r=r.check(O.mac()):o==="cidr"?r=r.check(O.cidrv4()):o==="cidr-v6"?r=r.check(O.cidrv6()):o==="base64"?r=r.check(O.base64()):o==="base64url"?r=r.check(O.base64url()):o==="e164"?r=r.check(O.e164()):o==="jwt"?r=r.check(O.jwt()):o==="emoji"?r=r.check(O.emoji()):o==="nanoid"?r=r.check(O.nanoid()):o==="cuid"?r=r.check(O.cuid()):o==="cuid2"?r=r.check(O.cuid2()):o==="ulid"?r=r.check(O.ulid()):o==="xid"?r=r.check(O.xid()):o==="ksuid"&&(r=r.check(O.ksuid()))}typeof t.minLength=="number"&&(r=r.min(t.minLength)),typeof t.maxLength=="number"&&(r=r.max(t.maxLength)),t.pattern&&(r=r.regex(new RegExp(t.pattern))),i=r;break}case"number":case"integer":{let r=n==="integer"?O.number().int():O.number();typeof t.minimum=="number"&&(r=r.min(t.minimum)),typeof t.maximum=="number"&&(r=r.max(t.maximum)),typeof t.exclusiveMinimum=="number"?r=r.gt(t.exclusiveMinimum):t.exclusiveMinimum===!0&&typeof t.minimum=="number"&&(r=r.gt(t.minimum)),typeof t.exclusiveMaximum=="number"?r=r.lt(t.exclusiveMaximum):t.exclusiveMaximum===!0&&typeof t.maximum=="number"&&(r=r.lt(t.maximum)),typeof t.multipleOf=="number"&&(r=r.multipleOf(t.multipleOf)),i=r;break}case"boolean":{i=O.boolean();break}case"null":{i=O.null();break}case"object":{let r={},o=t.properties||{},s=new Set(t.required||[]);for(let[u,l]of Object.entries(o)){let p=He(l,e);r[u]=s.has(u)?p:p.optional()}if(t.propertyNames){let u=He(t.propertyNames,e),l=t.additionalProperties&&typeof t.additionalProperties=="object"?He(t.additionalProperties,e):O.any();if(Object.keys(r).length===0){i=O.record(u,l);break}let p=O.object(r).passthrough(),d=O.looseRecord(u,l);i=O.intersection(p,d);break}if(t.patternProperties){let u=t.patternProperties,l=Object.keys(u),p=[];for(let m of l){let f=He(u[m],e),g=O.string().regex(new RegExp(m));p.push(O.looseRecord(g,f))}let d=[];if(Object.keys(r).length>0&&d.push(O.object(r).passthrough()),d.push(...p),d.length===0)i=O.object({}).passthrough();else if(d.length===1)i=d[0];else{let m=O.intersection(d[0],d[1]);for(let f=2;f<d.length;f++)m=O.intersection(m,d[f]);i=m}break}let c=O.object(r);t.additionalProperties===!1?i=c.strict():typeof t.additionalProperties=="object"?i=c.catchall(He(t.additionalProperties,e)):i=c.passthrough();break}case"array":{let r=t.prefixItems,o=t.items;if(r&&Array.isArray(r)){let s=r.map(u=>He(u,e)),c=o&&typeof o=="object"&&!Array.isArray(o)?He(o,e):void 0;c?i=O.tuple(s).rest(c):i=O.tuple(s),typeof t.minItems=="number"&&(i=i.check(O.minLength(t.minItems))),typeof t.maxItems=="number"&&(i=i.check(O.maxLength(t.maxItems)))}else if(Array.isArray(o)){let s=o.map(u=>He(u,e)),c=t.additionalItems&&typeof t.additionalItems=="object"?He(t.additionalItems,e):void 0;c?i=O.tuple(s).rest(c):i=O.tuple(s),typeof t.minItems=="number"&&(i=i.check(O.minLength(t.minItems))),typeof t.maxItems=="number"&&(i=i.check(O.maxLength(t.maxItems)))}else if(o!==void 0){let s=He(o,e),c=O.array(s);typeof t.minItems=="number"&&(c=c.min(t.minItems)),typeof t.maxItems=="number"&&(c=c.max(t.maxItems)),i=c}else i=O.array(O.any());break}default:throw new Error(`Unsupported type: ${n}`)}return i}function He(t,e){if(typeof t=="boolean")return t?O.any():O.never();let n=WS(t,e),i=t.type||t.enum!==void 0||t.const!==void 0;if(t.anyOf&&Array.isArray(t.anyOf)){let c=t.anyOf.map(l=>He(l,e)),u=O.union(c);n=i?O.intersection(n,u):u}if(t.oneOf&&Array.isArray(t.oneOf)){let c=t.oneOf.map(l=>He(l,e)),u=O.xor(c);n=i?O.intersection(n,u):u}if(t.allOf&&Array.isArray(t.allOf))if(t.allOf.length===0)n=i?n:O.any();else{let c=i?n:He(t.allOf[0],e),u=i?0:1;for(let l=u;l<t.allOf.length;l++)c=O.intersection(c,He(t.allOf[l],e));n=c}t.nullable===!0&&e.version==="openapi-3.0"&&(n=O.nullable(n)),t.readOnly===!0&&(n=O.readonly(n)),t.default!==void 0&&(n=n.default(t.default));let r={},o=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let c of o)c in t&&(r[c]=t[c]);let s=["contentEncoding","contentMediaType","contentSchema"];for(let c of s)c in t&&(r[c]=t[c]);for(let c of Object.keys(t))tA.has(c)||(r[c]=t[c]);return Object.keys(r).length>0&&e.registry.add(n,r),t.description&&(n=n.describe(t.description)),n}function JS(t,e){if(typeof t=="boolean")return t?O.any():O.never();let n;try{n=JSON.parse(JSON.stringify(t))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let i=nA(n,e?.defaultTarget),r=n.$defs||n.definitions||{},o={version:i,defs:r,refs:new Map,processing:new Set,rootSchema:n,registry:e?.registry??Me};return He(n,o)}var Xg={};nn(Xg,{bigint:()=>aA,boolean:()=>sA,date:()=>cA,number:()=>oA,string:()=>iA});function iA(t){return Xm(si,t)}function oA(t){return of(ci,t)}function sA(t){return sf(ui,t)}function aA(t){return af(li,t)}function cA(t){return cf(ps,t)}Re(du());var eh="2025-11-25";var YS=[eh,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],On="io.modelcontextprotocol/related-task",Rl="2.0",Ne=El(t=>t!==null&&(typeof t=="object"||typeof t=="function")),XS=ye([_(),ce().int()]),QS=_(),a2=Le({ttl:ce().optional(),pollInterval:ce().optional()}),uA=C({ttl:ce().optional()}),lA=C({taskId:_()}),th=Le({progressToken:XS.optional(),[On]:lA.optional()}),ft=C({_meta:th.optional()}),vs=ft.extend({task:uA.optional()}),ex=t=>vs.safeParse(t).success,Be=C({method:_(),params:ft.loose().optional()}),_t=C({_meta:th.optional()}),vt=C({method:_(),params:_t.loose().optional()}),Fe=Le({_meta:th.optional()}),Ol=ye([_(),ce().int()]),tx=C({jsonrpc:L(Rl),id:Ol,...Be.shape}).strict(),nh=t=>tx.safeParse(t).success,nx=C({jsonrpc:L(Rl),...vt.shape}).strict(),rx=t=>nx.safeParse(t).success,rh=C({jsonrpc:L(Rl),id:Ol,result:Fe}).strict(),ks=t=>rh.safeParse(t).success;var F;(function(t){t[t.ConnectionClosed=-32e3]="ConnectionClosed",t[t.RequestTimeout=-32001]="RequestTimeout",t[t.ParseError=-32700]="ParseError",t[t.InvalidRequest=-32600]="InvalidRequest",t[t.MethodNotFound=-32601]="MethodNotFound",t[t.InvalidParams=-32602]="InvalidParams",t[t.InternalError=-32603]="InternalError",t[t.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(F||(F={}));var ih=C({jsonrpc:L(Rl),id:Ol.optional(),error:C({code:ce().int(),message:_(),data:be().optional()})}).strict();var ix=t=>ih.safeParse(t).success;var ox=ye([tx,nx,rh,ih]),c2=ye([rh,ih]),Pl=Fe.strict(),dA=_t.extend({requestId:Ol.optional(),reason:_().optional()}),Al=vt.extend({method:L("notifications/cancelled"),params:dA}),pA=C({src:_(),mimeType:_().optional(),sizes:Q(_()).optional(),theme:Ze(["light","dark"]).optional()}),Ss=C({icons:Q(pA).optional()}),mi=C({name:_(),title:_().optional()}),sx=mi.extend({...mi.shape,...Ss.shape,version:_(),websiteUrl:_().optional(),description:_().optional()}),mA=di(C({applyDefaults:Oe().optional()}),fe(_(),be())),fA=_s(t=>t&&typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length===0?{form:{}}:t,di(C({form:mA.optional(),url:Ne.optional()}),fe(_(),be()).optional())),gA=Le({list:Ne.optional(),cancel:Ne.optional(),requests:Le({sampling:Le({createMessage:Ne.optional()}).optional(),elicitation:Le({create:Ne.optional()}).optional()}).optional()}),hA=Le({list:Ne.optional(),cancel:Ne.optional(),requests:Le({tools:Le({call:Ne.optional()}).optional()}).optional()}),bA=C({experimental:fe(_(),Ne).optional(),sampling:C({context:Ne.optional(),tools:Ne.optional()}).optional(),elicitation:fA.optional(),roots:C({listChanged:Oe().optional()}).optional(),tasks:gA.optional(),extensions:fe(_(),Ne).optional()}),yA=ft.extend({protocolVersion:_(),capabilities:bA,clientInfo:sx}),oh=Be.extend({method:L("initialize"),params:yA});var _A=C({experimental:fe(_(),Ne).optional(),logging:Ne.optional(),completions:Ne.optional(),prompts:C({listChanged:Oe().optional()}).optional(),resources:C({subscribe:Oe().optional(),listChanged:Oe().optional()}).optional(),tools:C({listChanged:Oe().optional()}).optional(),tasks:hA.optional(),extensions:fe(_(),Ne).optional()}),vA=Fe.extend({protocolVersion:_(),capabilities:_A,serverInfo:sx,instructions:_().optional()}),sh=vt.extend({method:L("notifications/initialized"),params:_t.optional()});var Nl=Be.extend({method:L("ping"),params:ft.optional()}),kA=C({progress:ce(),total:ke(ce()),message:ke(_())}),SA=C({..._t.shape,...kA.shape,progressToken:XS}),Cl=vt.extend({method:L("notifications/progress"),params:SA}),xA=ft.extend({cursor:QS.optional()}),xs=Be.extend({params:xA.optional()}),Is=Fe.extend({nextCursor:QS.optional()}),IA=Ze(["working","input_required","completed","failed","cancelled"]),$s=C({taskId:_(),status:IA,ttl:ye([ce(),ds()]),createdAt:_(),lastUpdatedAt:_(),pollInterval:ke(ce()),statusMessage:ke(_())}),fi=Fe.extend({task:$s}),$A=_t.merge($s),ws=vt.extend({method:L("notifications/tasks/status"),params:$A}),zl=Be.extend({method:L("tasks/get"),params:ft.extend({taskId:_()})}),Dl=Fe.merge($s),jl=Be.extend({method:L("tasks/result"),params:ft.extend({taskId:_()})}),u2=Fe.loose(),Ul=xs.extend({method:L("tasks/list")}),Ml=Is.extend({tasks:Q($s)}),Ll=Be.extend({method:L("tasks/cancel"),params:ft.extend({taskId:_()})}),ax=Fe.merge($s),cx=C({uri:_(),mimeType:ke(_()),_meta:fe(_(),be()).optional()}),ux=cx.extend({text:_()}),ah=_().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),lx=cx.extend({blob:ah}),Es=Ze(["user","assistant"]),gi=C({audience:Q(Es).optional(),priority:ce().min(0).max(1).optional(),lastModified:Rn.datetime({offset:!0}).optional()}),dx=C({...mi.shape,...Ss.shape,uri:_(),description:ke(_()),mimeType:ke(_()),size:ke(ce()),annotations:gi.optional(),_meta:ke(Le({}))}),wA=C({...mi.shape,...Ss.shape,uriTemplate:_(),description:ke(_()),mimeType:ke(_()),annotations:gi.optional(),_meta:ke(Le({}))}),Zl=xs.extend({method:L("resources/list")}),EA=Is.extend({resources:Q(dx)}),Bl=xs.extend({method:L("resources/templates/list")}),TA=Is.extend({resourceTemplates:Q(wA)}),ch=ft.extend({uri:_()}),RA=ch,Fl=Be.extend({method:L("resources/read"),params:RA}),OA=Fe.extend({contents:Q(ye([ux,lx]))}),PA=vt.extend({method:L("notifications/resources/list_changed"),params:_t.optional()}),AA=ch,NA=Be.extend({method:L("resources/subscribe"),params:AA}),CA=ch,zA=Be.extend({method:L("resources/unsubscribe"),params:CA}),DA=_t.extend({uri:_()}),jA=vt.extend({method:L("notifications/resources/updated"),params:DA}),UA=C({name:_(),description:ke(_()),required:ke(Oe())}),MA=C({...mi.shape,...Ss.shape,description:ke(_()),arguments:ke(Q(UA)),_meta:ke(Le({}))}),Vl=xs.extend({method:L("prompts/list")}),LA=Is.extend({prompts:Q(MA)}),ZA=ft.extend({name:_(),arguments:fe(_(),_()).optional()}),ql=Be.extend({method:L("prompts/get"),params:ZA}),uh=C({type:L("text"),text:_(),annotations:gi.optional(),_meta:fe(_(),be()).optional()}),lh=C({type:L("image"),data:ah,mimeType:_(),annotations:gi.optional(),_meta:fe(_(),be()).optional()}),dh=C({type:L("audio"),data:ah,mimeType:_(),annotations:gi.optional(),_meta:fe(_(),be()).optional()}),BA=C({type:L("tool_use"),name:_(),id:_(),input:fe(_(),be()),_meta:fe(_(),be()).optional()}),FA=C({type:L("resource"),resource:ye([ux,lx]),annotations:gi.optional(),_meta:fe(_(),be()).optional()}),VA=dx.extend({type:L("resource_link")}),ph=ye([uh,lh,dh,VA,FA]),qA=C({role:Es,content:ph}),HA=Fe.extend({description:_().optional(),messages:Q(qA)}),KA=vt.extend({method:L("notifications/prompts/list_changed"),params:_t.optional()}),GA=C({title:_().optional(),readOnlyHint:Oe().optional(),destructiveHint:Oe().optional(),idempotentHint:Oe().optional(),openWorldHint:Oe().optional()}),WA=C({taskSupport:Ze(["required","optional","forbidden"]).optional()}),px=C({...mi.shape,...Ss.shape,description:_().optional(),inputSchema:C({type:L("object"),properties:fe(_(),Ne).optional(),required:Q(_()).optional()}).catchall(be()),outputSchema:C({type:L("object"),properties:fe(_(),Ne).optional(),required:Q(_()).optional()}).catchall(be()).optional(),annotations:GA.optional(),execution:WA.optional(),_meta:fe(_(),be()).optional()}),Hl=xs.extend({method:L("tools/list")}),JA=Is.extend({tools:Q(px)}),Kl=Fe.extend({content:Q(ph).default([]),structuredContent:fe(_(),be()).optional(),isError:Oe().optional()}),l2=Kl.or(Fe.extend({toolResult:be()})),YA=vs.extend({name:_(),arguments:fe(_(),be()).optional()}),hi=Be.extend({method:L("tools/call"),params:YA}),XA=vt.extend({method:L("notifications/tools/list_changed"),params:_t.optional()}),d2=C({autoRefresh:Oe().default(!0),debounceMs:ce().int().nonnegative().default(300)}),Ts=Ze(["debug","info","notice","warning","error","critical","alert","emergency"]),QA=ft.extend({level:Ts}),mh=Be.extend({method:L("logging/setLevel"),params:QA}),eN=_t.extend({level:Ts,logger:_().optional(),data:be()}),tN=vt.extend({method:L("notifications/message"),params:eN}),nN=C({name:_().optional()}),rN=C({hints:Q(nN).optional(),costPriority:ce().min(0).max(1).optional(),speedPriority:ce().min(0).max(1).optional(),intelligencePriority:ce().min(0).max(1).optional()}),iN=C({mode:Ze(["auto","required","none"]).optional()}),oN=C({type:L("tool_result"),toolUseId:_().describe("The unique identifier for the corresponding tool call."),content:Q(ph).default([]),structuredContent:C({}).loose().optional(),isError:Oe().optional(),_meta:fe(_(),be()).optional()}),sN=gs("type",[uh,lh,dh]),Tl=gs("type",[uh,lh,dh,BA,oN]),aN=C({role:Es,content:ye([Tl,Q(Tl)]),_meta:fe(_(),be()).optional()}),cN=vs.extend({messages:Q(aN),modelPreferences:rN.optional(),systemPrompt:_().optional(),includeContext:Ze(["none","thisServer","allServers"]).optional(),temperature:ce().optional(),maxTokens:ce().int(),stopSequences:Q(_()).optional(),metadata:Ne.optional(),tools:Q(px).optional(),toolChoice:iN.optional()}),uN=Be.extend({method:L("sampling/createMessage"),params:cN}),Rs=Fe.extend({model:_(),stopReason:ke(Ze(["endTurn","stopSequence","maxTokens"]).or(_())),role:Es,content:sN}),fh=Fe.extend({model:_(),stopReason:ke(Ze(["endTurn","stopSequence","maxTokens","toolUse"]).or(_())),role:Es,content:ye([Tl,Q(Tl)])}),lN=C({type:L("boolean"),title:_().optional(),description:_().optional(),default:Oe().optional()}),dN=C({type:L("string"),title:_().optional(),description:_().optional(),minLength:ce().optional(),maxLength:ce().optional(),format:Ze(["email","uri","date","date-time"]).optional(),default:_().optional()}),pN=C({type:Ze(["number","integer"]),title:_().optional(),description:_().optional(),minimum:ce().optional(),maximum:ce().optional(),default:ce().optional()}),mN=C({type:L("string"),title:_().optional(),description:_().optional(),enum:Q(_()),default:_().optional()}),fN=C({type:L("string"),title:_().optional(),description:_().optional(),oneOf:Q(C({const:_(),title:_()})),default:_().optional()}),gN=C({type:L("string"),title:_().optional(),description:_().optional(),enum:Q(_()),enumNames:Q(_()).optional(),default:_().optional()}),hN=ye([mN,fN]),bN=C({type:L("array"),title:_().optional(),description:_().optional(),minItems:ce().optional(),maxItems:ce().optional(),items:C({type:L("string"),enum:Q(_())}),default:Q(_()).optional()}),yN=C({type:L("array"),title:_().optional(),description:_().optional(),minItems:ce().optional(),maxItems:ce().optional(),items:C({anyOf:Q(C({const:_(),title:_()}))}),default:Q(_()).optional()}),_N=ye([bN,yN]),vN=ye([gN,hN,_N]),kN=ye([vN,lN,dN,pN]),SN=vs.extend({mode:L("form").optional(),message:_(),requestedSchema:C({type:L("object"),properties:fe(_(),kN),required:Q(_()).optional()})}),xN=vs.extend({mode:L("url"),message:_(),elicitationId:_(),url:_().url()}),IN=ye([SN,xN]),$N=Be.extend({method:L("elicitation/create"),params:IN}),wN=_t.extend({elicitationId:_()}),EN=vt.extend({method:L("notifications/elicitation/complete"),params:wN}),bi=Fe.extend({action:Ze(["accept","decline","cancel"]),content:_s(t=>t===null?void 0:t,fe(_(),ye([_(),ce(),Oe(),Q(_())])).optional())}),TN=C({type:L("ref/resource"),uri:_()});var RN=C({type:L("ref/prompt"),name:_()}),ON=ft.extend({ref:ye([RN,TN]),argument:C({name:_(),value:_()}),context:C({arguments:fe(_(),_()).optional()}).optional()}),Gl=Be.extend({method:L("completion/complete"),params:ON});function mx(t){if(t.params.ref.type!=="ref/prompt")throw new TypeError(`Expected CompleteRequestPrompt, but got ${t.params.ref.type}`)}function fx(t){if(t.params.ref.type!=="ref/resource")throw new TypeError(`Expected CompleteRequestResourceTemplate, but got ${t.params.ref.type}`)}var PN=Fe.extend({completion:Le({values:Q(_()).max(100),total:ke(ce().int()),hasMore:ke(Oe())})}),AN=C({uri:_().startsWith("file://"),name:_().optional(),_meta:fe(_(),be()).optional()}),NN=Be.extend({method:L("roots/list"),params:ft.optional()}),gh=Fe.extend({roots:Q(AN)}),CN=vt.extend({method:L("notifications/roots/list_changed"),params:_t.optional()}),p2=ye([Nl,oh,Gl,mh,ql,Vl,Zl,Bl,Fl,NA,zA,hi,Hl,zl,jl,Ul,Ll]),m2=ye([Al,Cl,sh,CN,ws]),f2=ye([Pl,Rs,fh,bi,gh,Dl,Ml,fi]),g2=ye([Nl,uN,$N,NN,zl,jl,Ul,Ll]),h2=ye([Al,Cl,tN,jA,PA,XA,KA,ws,EN]),b2=ye([Pl,vA,PN,HA,LA,EA,TA,OA,Kl,JA,Dl,Ml,fi]),Z=class t extends Error{constructor(e,n,i){super(`MCP error ${e}: ${n}`),this.code=e,this.data=i,this.name="McpError"}static fromError(e,n,i){if(e===F.UrlElicitationRequired&&i){let r=i;if(r.elicitations)return new Qg(r.elicitations,n)}return new t(e,n,i)}},Qg=class extends Z{constructor(e,n=`URL elicitation${e.length>1?"s":""} required`){super(F.UrlElicitationRequired,n,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}};var zN=10*1024*1024,Wl=class{constructor(e){this._maxBufferSize=e?.maxBufferSize??zN}append(e){if((this._buffer?.length??0)+e.length>this._maxBufferSize)throw this.clear(),new Error(`ReadBuffer exceeded maximum size of ${this._maxBufferSize} bytes`);this._buffer=this._buffer?Buffer.concat([this._buffer,e]):e}readMessage(){if(!this._buffer)return null;let e=this._buffer.indexOf(`
|
|
75
|
+
`);if(e===-1)return null;let n=this._buffer.toString("utf8",0,e).replace(/\r$/,"");return this._buffer=this._buffer.subarray(e+1),DN(n)}clear(){this._buffer=void 0}};function DN(t){return ox.parse(JSON.parse(t))}function gx(t){return JSON.stringify(t)+`
|
|
76
|
+
`}var Jl=class{constructor(e=hx.stdin,n=hx.stdout,i){this._stdin=e,this._stdout=n,this._started=!1,this._ondata=r=>{try{this._readBuffer.append(r),this.processReadBuffer()}catch(o){this.onerror?.(o),this.close().catch(()=>{})}},this._onerror=r=>{this.onerror?.(r)},this._readBuffer=new Wl({maxBufferSize:i?.maxBufferSize})}async start(){if(this._started)throw new Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");this._started=!0,this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror)}processReadBuffer(){for(;;)try{let e=this._readBuffer.readMessage();if(e===null)break;this.onmessage?.(e)}catch(e){this.onerror?.(e)}}async close(){this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),this._stdin.listenerCount("data")===0&&this._stdin.pause(),this._readBuffer.clear(),this.onclose?.()}send(e){return new Promise(n=>{let i=gx(e);this._stdout.write(i)?n():this._stdout.once("drain",n)})}};var re;(function(t){t.assertEqual=r=>{};function e(r){}t.assertIs=e;function n(r){throw new Error}t.assertNever=n,t.arrayToEnum=r=>{let o={};for(let s of r)o[s]=s;return o},t.getValidEnumValues=r=>{let o=t.objectKeys(r).filter(c=>typeof r[r[c]]!="number"),s={};for(let c of o)s[c]=r[c];return t.objectValues(s)},t.objectValues=r=>t.objectKeys(r).map(function(o){return r[o]}),t.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{let o=[];for(let s in r)Object.prototype.hasOwnProperty.call(r,s)&&o.push(s);return o},t.find=(r,o)=>{for(let s of r)if(o(s))return s},t.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&Number.isFinite(r)&&Math.floor(r)===r;function i(r,o=" | "){return r.map(s=>typeof s=="string"?`'${s}'`:s).join(o)}t.joinValues=i,t.jsonStringifyReplacer=(r,o)=>typeof o=="bigint"?o.toString():o})(re||(re={}));var bx;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(bx||(bx={}));var D=re.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),sn=t=>{switch(typeof t){case"undefined":return D.undefined;case"string":return D.string;case"number":return Number.isNaN(t)?D.nan:D.number;case"boolean":return D.boolean;case"function":return D.function;case"bigint":return D.bigint;case"symbol":return D.symbol;case"object":return Array.isArray(t)?D.array:t===null?D.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?D.promise:typeof Map<"u"&&t instanceof Map?D.map:typeof Set<"u"&&t instanceof Set?D.set:typeof Date<"u"&&t instanceof Date?D.date:D.object;default:return D.unknown}};var w=re.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);var gt=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){let n=e||function(o){return o.message},i={_errors:[]},r=o=>{for(let s of o.issues)if(s.code==="invalid_union")s.unionErrors.map(r);else if(s.code==="invalid_return_type")r(s.returnTypeError);else if(s.code==="invalid_arguments")r(s.argumentsError);else if(s.path.length===0)i._errors.push(n(s));else{let c=i,u=0;for(;u<s.path.length;){let l=s.path[u];u===s.path.length-1?(c[l]=c[l]||{_errors:[]},c[l]._errors.push(n(s))):c[l]=c[l]||{_errors:[]},c=c[l],u++}}};return r(this),i}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,re.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){let n=Object.create(null),i=[];for(let r of this.issues)if(r.path.length>0){let o=r.path[0];n[o]=n[o]||[],n[o].push(e(r))}else i.push(e(r));return{formErrors:i,fieldErrors:n}}get formErrors(){return this.flatten()}};gt.create=t=>new gt(t);var jN=(t,e)=>{let n;switch(t.code){case w.invalid_type:t.received===D.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case w.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,re.jsonStringifyReplacer)}`;break;case w.unrecognized_keys:n=`Unrecognized key(s) in object: ${re.joinValues(t.keys,", ")}`;break;case w.invalid_union:n="Invalid input";break;case w.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${re.joinValues(t.options)}`;break;case w.invalid_enum_value:n=`Invalid enum value. Expected ${re.joinValues(t.options)}, received '${t.received}'`;break;case w.invalid_arguments:n="Invalid function arguments";break;case w.invalid_return_type:n="Invalid function return type";break;case w.invalid_date:n="Invalid date";break;case w.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:re.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case w.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case w.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case w.custom:n="Invalid input";break;case w.invalid_intersection_types:n="Intersection results could not be merged";break;case w.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case w.not_finite:n="Number must be finite";break;default:n=e.defaultError,re.assertNever(t)}return{message:n}},Pn=jN;var UN=Pn;function Os(){return UN}var Yl=t=>{let{data:e,path:n,errorMaps:i,issueData:r}=t,o=[...n,...r.path||[]],s={...r,path:o};if(r.message!==void 0)return{...r,path:o,message:r.message};let c="",u=i.filter(l=>!!l).slice().reverse();for(let l of u)c=l(s,{data:e,defaultError:c}).message;return{...r,path:o,message:c}};function P(t,e){let n=Os(),i=Yl({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===Pn?void 0:Pn].filter(r=>!!r)});t.common.issues.push(i)}var Ke=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){let i=[];for(let r of n){if(r.status==="aborted")return V;r.status==="dirty"&&e.dirty(),i.push(r.value)}return{status:e.value,value:i}}static async mergeObjectAsync(e,n){let i=[];for(let r of n){let o=await r.key,s=await r.value;i.push({key:o,value:s})}return t.mergeObjectSync(e,i)}static mergeObjectSync(e,n){let i={};for(let r of n){let{key:o,value:s}=r;if(o.status==="aborted"||s.status==="aborted")return V;o.status==="dirty"&&e.dirty(),s.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof s.value<"u"||r.alwaysSet)&&(i[o.value]=s.value)}return{status:e.value,value:i}}},V=Object.freeze({status:"aborted"}),yi=t=>({status:"dirty",value:t}),et=t=>({status:"valid",value:t}),hh=t=>t.status==="aborted",bh=t=>t.status==="dirty",mr=t=>t.status==="valid",Ps=t=>typeof Promise<"u"&&t instanceof Promise;var M;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(M||(M={}));var kt=class{constructor(e,n,i,r){this._cachedPath=[],this.parent=e,this.data=n,this._path=i,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},yx=(t,e)=>{if(mr(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let n=new gt(t.common.issues);return this._error=n,this._error}}};function W(t){if(!t)return{};let{errorMap:e,invalid_type_error:n,required_error:i,description:r}=t;if(e&&(n||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:r}:{errorMap:(s,c)=>{let{message:u}=t;return s.code==="invalid_enum_value"?{message:u??c.defaultError}:typeof c.data>"u"?{message:u??i??c.defaultError}:s.code!=="invalid_type"?{message:c.defaultError}:{message:u??n??c.defaultError}},description:r}}var ee=class{get description(){return this._def.description}_getType(e){return sn(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:sn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Ke,ctx:{common:e.parent.common,data:e.data,parsedType:sn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let n=this._parse(e);if(Ps(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){let n=this._parse(e);return Promise.resolve(n)}parse(e,n){let i=this.safeParse(e,n);if(i.success)return i.data;throw i.error}safeParse(e,n){let i={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:sn(e)},r=this._parseSync({data:e,path:i.path,parent:i});return yx(i,r)}"~validate"(e){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:sn(e)};if(!this["~standard"].async)try{let i=this._parseSync({data:e,path:[],parent:n});return mr(i)?{value:i.value}:{issues:n.common.issues}}catch(i){i?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(i=>mr(i)?{value:i.value}:{issues:n.common.issues})}async parseAsync(e,n){let i=await this.safeParseAsync(e,n);if(i.success)return i.data;throw i.error}async safeParseAsync(e,n){let i={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:sn(e)},r=this._parse({data:e,path:i.path,parent:i}),o=await(Ps(r)?r:Promise.resolve(r));return yx(i,o)}refine(e,n){let i=r=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(r):n;return this._refinement((r,o)=>{let s=e(r),c=()=>o.addIssue({code:w.custom,...i(r)});return typeof Promise<"u"&&s instanceof Promise?s.then(u=>u?!0:(c(),!1)):s?!0:(c(),!1)})}refinement(e,n){return this._refinement((i,r)=>e(i)?!0:(r.addIssue(typeof n=="function"?n(i,r):n),!1))}_refinement(e){return new At({schema:this,typeName:T.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return Pt.create(this,this._def)}nullable(){return un.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Nn.create(this)}promise(){return fr.create(this,this._def)}or(e){return xi.create([this,e],this._def)}and(e){return Ii.create(this,e,this._def)}transform(e){return new At({...W(this._def),schema:this,typeName:T.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let n=typeof e=="function"?e:()=>e;return new Ri({...W(this._def),innerType:this,defaultValue:n,typeName:T.ZodDefault})}brand(){return new Xl({typeName:T.ZodBranded,type:this,...W(this._def)})}catch(e){let n=typeof e=="function"?e:()=>e;return new Oi({...W(this._def),innerType:this,catchValue:n,typeName:T.ZodCatch})}describe(e){let n=this.constructor;return new n({...this._def,description:e})}pipe(e){return Ql.create(this,e)}readonly(){return Pi.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},MN=/^c[^\s-]{8,}$/i,LN=/^[0-9a-z]+$/,ZN=/^[0-9A-HJKMNP-TV-Z]{26}$/i,BN=/^[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,FN=/^[a-z0-9_-]{21}$/i,VN=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,qN=/^[-+]?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)?)??$/,HN=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,KN="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",yh,GN=/^(?:(?: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])$/,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])\/(3[0-2]|[12]?[0-9])$/,JN=/^(([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]))$/,YN=/^(([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])$/,XN=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,QN=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,_x="((\\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])))",eC=new RegExp(`^${_x}$`);function vx(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function tC(t){return new RegExp(`^${vx(t)}$`)}function nC(t){let e=`${_x}T${vx(t)}`,n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function rC(t,e){return!!((e==="v4"||!e)&&GN.test(t)||(e==="v6"||!e)&&JN.test(t))}function iC(t,e){if(!VN.test(t))return!1;try{let[n]=t.split(".");if(!n)return!1;let i=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),r=JSON.parse(atob(i));return!(typeof r!="object"||r===null||"typ"in r&&r?.typ!=="JWT"||!r.alg||e&&r.alg!==e)}catch{return!1}}function oC(t,e){return!!((e==="v4"||!e)&&WN.test(t)||(e==="v6"||!e)&&YN.test(t))}var vi=class t extends ee{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==D.string){let o=this._getOrReturnCtx(e);return P(o,{code:w.invalid_type,expected:D.string,received:o.parsedType}),V}let i=new Ke,r;for(let o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(r=this._getOrReturnCtx(e,r),P(r,{code:w.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),i.dirty());else if(o.kind==="max")e.data.length>o.value&&(r=this._getOrReturnCtx(e,r),P(r,{code:w.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),i.dirty());else if(o.kind==="length"){let s=e.data.length>o.value,c=e.data.length<o.value;(s||c)&&(r=this._getOrReturnCtx(e,r),s?P(r,{code:w.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):c&&P(r,{code:w.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),i.dirty())}else if(o.kind==="email")HN.test(e.data)||(r=this._getOrReturnCtx(e,r),P(r,{validation:"email",code:w.invalid_string,message:o.message}),i.dirty());else if(o.kind==="emoji")yh||(yh=new RegExp(KN,"u")),yh.test(e.data)||(r=this._getOrReturnCtx(e,r),P(r,{validation:"emoji",code:w.invalid_string,message:o.message}),i.dirty());else if(o.kind==="uuid")BN.test(e.data)||(r=this._getOrReturnCtx(e,r),P(r,{validation:"uuid",code:w.invalid_string,message:o.message}),i.dirty());else if(o.kind==="nanoid")FN.test(e.data)||(r=this._getOrReturnCtx(e,r),P(r,{validation:"nanoid",code:w.invalid_string,message:o.message}),i.dirty());else if(o.kind==="cuid")MN.test(e.data)||(r=this._getOrReturnCtx(e,r),P(r,{validation:"cuid",code:w.invalid_string,message:o.message}),i.dirty());else if(o.kind==="cuid2")LN.test(e.data)||(r=this._getOrReturnCtx(e,r),P(r,{validation:"cuid2",code:w.invalid_string,message:o.message}),i.dirty());else if(o.kind==="ulid")ZN.test(e.data)||(r=this._getOrReturnCtx(e,r),P(r,{validation:"ulid",code:w.invalid_string,message:o.message}),i.dirty());else if(o.kind==="url")try{new URL(e.data)}catch{r=this._getOrReturnCtx(e,r),P(r,{validation:"url",code:w.invalid_string,message:o.message}),i.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),P(r,{validation:"regex",code:w.invalid_string,message:o.message}),i.dirty())):o.kind==="trim"?e.data=e.data.trim():o.kind==="includes"?e.data.includes(o.value,o.position)||(r=this._getOrReturnCtx(e,r),P(r,{code:w.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),i.dirty()):o.kind==="toLowerCase"?e.data=e.data.toLowerCase():o.kind==="toUpperCase"?e.data=e.data.toUpperCase():o.kind==="startsWith"?e.data.startsWith(o.value)||(r=this._getOrReturnCtx(e,r),P(r,{code:w.invalid_string,validation:{startsWith:o.value},message:o.message}),i.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(r=this._getOrReturnCtx(e,r),P(r,{code:w.invalid_string,validation:{endsWith:o.value},message:o.message}),i.dirty()):o.kind==="datetime"?nC(o).test(e.data)||(r=this._getOrReturnCtx(e,r),P(r,{code:w.invalid_string,validation:"datetime",message:o.message}),i.dirty()):o.kind==="date"?eC.test(e.data)||(r=this._getOrReturnCtx(e,r),P(r,{code:w.invalid_string,validation:"date",message:o.message}),i.dirty()):o.kind==="time"?tC(o).test(e.data)||(r=this._getOrReturnCtx(e,r),P(r,{code:w.invalid_string,validation:"time",message:o.message}),i.dirty()):o.kind==="duration"?qN.test(e.data)||(r=this._getOrReturnCtx(e,r),P(r,{validation:"duration",code:w.invalid_string,message:o.message}),i.dirty()):o.kind==="ip"?rC(e.data,o.version)||(r=this._getOrReturnCtx(e,r),P(r,{validation:"ip",code:w.invalid_string,message:o.message}),i.dirty()):o.kind==="jwt"?iC(e.data,o.alg)||(r=this._getOrReturnCtx(e,r),P(r,{validation:"jwt",code:w.invalid_string,message:o.message}),i.dirty()):o.kind==="cidr"?oC(e.data,o.version)||(r=this._getOrReturnCtx(e,r),P(r,{validation:"cidr",code:w.invalid_string,message:o.message}),i.dirty()):o.kind==="base64"?XN.test(e.data)||(r=this._getOrReturnCtx(e,r),P(r,{validation:"base64",code:w.invalid_string,message:o.message}),i.dirty()):o.kind==="base64url"?QN.test(e.data)||(r=this._getOrReturnCtx(e,r),P(r,{validation:"base64url",code:w.invalid_string,message:o.message}),i.dirty()):re.assertNever(o);return{status:i.value,value:e.data}}_regex(e,n,i){return this.refinement(r=>e.test(r),{validation:n,code:w.invalid_string,...M.errToObj(i)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...M.errToObj(e)})}url(e){return this._addCheck({kind:"url",...M.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...M.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...M.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...M.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...M.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...M.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...M.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...M.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...M.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...M.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...M.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...M.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...M.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...M.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...M.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...M.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n?.position,...M.errToObj(n?.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...M.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...M.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...M.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...M.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...M.errToObj(n)})}nonempty(e){return this.min(1,M.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};vi.create=t=>new vi({checks:[],typeName:T.ZodString,coerce:t?.coerce??!1,...W(t)});function sC(t,e){let n=(t.toString().split(".")[1]||"").length,i=(e.toString().split(".")[1]||"").length,r=n>i?n:i,o=Number.parseInt(t.toFixed(r).replace(".","")),s=Number.parseInt(e.toFixed(r).replace(".",""));return o%s/10**r}var As=class t extends ee{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==D.number){let o=this._getOrReturnCtx(e);return P(o,{code:w.invalid_type,expected:D.number,received:o.parsedType}),V}let i,r=new Ke;for(let o of this._def.checks)o.kind==="int"?re.isInteger(e.data)||(i=this._getOrReturnCtx(e,i),P(i,{code:w.invalid_type,expected:"integer",received:"float",message:o.message}),r.dirty()):o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(i=this._getOrReturnCtx(e,i),P(i,{code:w.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),r.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(i=this._getOrReturnCtx(e,i),P(i,{code:w.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),r.dirty()):o.kind==="multipleOf"?sC(e.data,o.value)!==0&&(i=this._getOrReturnCtx(e,i),P(i,{code:w.not_multiple_of,multipleOf:o.value,message:o.message}),r.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(i=this._getOrReturnCtx(e,i),P(i,{code:w.not_finite,message:o.message}),r.dirty()):re.assertNever(o);return{status:r.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,M.toString(n))}gt(e,n){return this.setLimit("min",e,!1,M.toString(n))}lte(e,n){return this.setLimit("max",e,!0,M.toString(n))}lt(e,n){return this.setLimit("max",e,!1,M.toString(n))}setLimit(e,n,i,r){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:i,message:M.toString(r)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:M.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:M.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:M.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:M.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:M.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:M.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:M.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:M.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:M.toString(e)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&re.isInteger(e.value))}get isFinite(){let e=null,n=null;for(let i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(n===null||i.value>n)&&(n=i.value):i.kind==="max"&&(e===null||i.value<e)&&(e=i.value)}return Number.isFinite(n)&&Number.isFinite(e)}};As.create=t=>new As({checks:[],typeName:T.ZodNumber,coerce:t?.coerce||!1,...W(t)});var Ns=class t extends ee{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==D.bigint)return this._getInvalidInput(e);let i,r=new Ke;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(i=this._getOrReturnCtx(e,i),P(i,{code:w.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),r.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(i=this._getOrReturnCtx(e,i),P(i,{code:w.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),r.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(i=this._getOrReturnCtx(e,i),P(i,{code:w.not_multiple_of,multipleOf:o.value,message:o.message}),r.dirty()):re.assertNever(o);return{status:r.value,value:e.data}}_getInvalidInput(e){let n=this._getOrReturnCtx(e);return P(n,{code:w.invalid_type,expected:D.bigint,received:n.parsedType}),V}gte(e,n){return this.setLimit("min",e,!0,M.toString(n))}gt(e,n){return this.setLimit("min",e,!1,M.toString(n))}lte(e,n){return this.setLimit("max",e,!0,M.toString(n))}lt(e,n){return this.setLimit("max",e,!1,M.toString(n))}setLimit(e,n,i,r){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:i,message:M.toString(r)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:M.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:M.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:M.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:M.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:M.toString(n)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};Ns.create=t=>new Ns({checks:[],typeName:T.ZodBigInt,coerce:t?.coerce??!1,...W(t)});var Cs=class extends ee{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==D.boolean){let i=this._getOrReturnCtx(e);return P(i,{code:w.invalid_type,expected:D.boolean,received:i.parsedType}),V}return et(e.data)}};Cs.create=t=>new Cs({typeName:T.ZodBoolean,coerce:t?.coerce||!1,...W(t)});var zs=class t extends ee{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==D.date){let o=this._getOrReturnCtx(e);return P(o,{code:w.invalid_type,expected:D.date,received:o.parsedType}),V}if(Number.isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return P(o,{code:w.invalid_date}),V}let i=new Ke,r;for(let o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(r=this._getOrReturnCtx(e,r),P(r,{code:w.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),i.dirty()):o.kind==="max"?e.data.getTime()>o.value&&(r=this._getOrReturnCtx(e,r),P(r,{code:w.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),i.dirty()):re.assertNever(o);return{status:i.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:M.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:M.toString(n)})}get minDate(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}};zs.create=t=>new zs({checks:[],coerce:t?.coerce||!1,typeName:T.ZodDate,...W(t)});var Ds=class extends ee{_parse(e){if(this._getType(e)!==D.symbol){let i=this._getOrReturnCtx(e);return P(i,{code:w.invalid_type,expected:D.symbol,received:i.parsedType}),V}return et(e.data)}};Ds.create=t=>new Ds({typeName:T.ZodSymbol,...W(t)});var ki=class extends ee{_parse(e){if(this._getType(e)!==D.undefined){let i=this._getOrReturnCtx(e);return P(i,{code:w.invalid_type,expected:D.undefined,received:i.parsedType}),V}return et(e.data)}};ki.create=t=>new ki({typeName:T.ZodUndefined,...W(t)});var Si=class extends ee{_parse(e){if(this._getType(e)!==D.null){let i=this._getOrReturnCtx(e);return P(i,{code:w.invalid_type,expected:D.null,received:i.parsedType}),V}return et(e.data)}};Si.create=t=>new Si({typeName:T.ZodNull,...W(t)});var js=class extends ee{constructor(){super(...arguments),this._any=!0}_parse(e){return et(e.data)}};js.create=t=>new js({typeName:T.ZodAny,...W(t)});var An=class extends ee{constructor(){super(...arguments),this._unknown=!0}_parse(e){return et(e.data)}};An.create=t=>new An({typeName:T.ZodUnknown,...W(t)});var Ht=class extends ee{_parse(e){let n=this._getOrReturnCtx(e);return P(n,{code:w.invalid_type,expected:D.never,received:n.parsedType}),V}};Ht.create=t=>new Ht({typeName:T.ZodNever,...W(t)});var Us=class extends ee{_parse(e){if(this._getType(e)!==D.undefined){let i=this._getOrReturnCtx(e);return P(i,{code:w.invalid_type,expected:D.void,received:i.parsedType}),V}return et(e.data)}};Us.create=t=>new Us({typeName:T.ZodVoid,...W(t)});var Nn=class t extends ee{_parse(e){let{ctx:n,status:i}=this._processInputParams(e),r=this._def;if(n.parsedType!==D.array)return P(n,{code:w.invalid_type,expected:D.array,received:n.parsedType}),V;if(r.exactLength!==null){let s=n.data.length>r.exactLength.value,c=n.data.length<r.exactLength.value;(s||c)&&(P(n,{code:s?w.too_big:w.too_small,minimum:c?r.exactLength.value:void 0,maximum:s?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),i.dirty())}if(r.minLength!==null&&n.data.length<r.minLength.value&&(P(n,{code:w.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),i.dirty()),r.maxLength!==null&&n.data.length>r.maxLength.value&&(P(n,{code:w.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),i.dirty()),n.common.async)return Promise.all([...n.data].map((s,c)=>r.type._parseAsync(new kt(n,s,n.path,c)))).then(s=>Ke.mergeArray(i,s));let o=[...n.data].map((s,c)=>r.type._parseSync(new kt(n,s,n.path,c)));return Ke.mergeArray(i,o)}get element(){return this._def.type}min(e,n){return new t({...this._def,minLength:{value:e,message:M.toString(n)}})}max(e,n){return new t({...this._def,maxLength:{value:e,message:M.toString(n)}})}length(e,n){return new t({...this._def,exactLength:{value:e,message:M.toString(n)}})}nonempty(e){return this.min(1,e)}};Nn.create=(t,e)=>new Nn({type:t,minLength:null,maxLength:null,exactLength:null,typeName:T.ZodArray,...W(e)});function _i(t){if(t instanceof ht){let e={};for(let n in t.shape){let i=t.shape[n];e[n]=Pt.create(_i(i))}return new ht({...t._def,shape:()=>e})}else return t instanceof Nn?new Nn({...t._def,type:_i(t.element)}):t instanceof Pt?Pt.create(_i(t.unwrap())):t instanceof un?un.create(_i(t.unwrap())):t instanceof cn?cn.create(t.items.map(e=>_i(e))):t}var ht=class t extends ee{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),n=re.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==D.object){let l=this._getOrReturnCtx(e);return P(l,{code:w.invalid_type,expected:D.object,received:l.parsedType}),V}let{status:i,ctx:r}=this._processInputParams(e),{shape:o,keys:s}=this._getCached(),c=[];if(!(this._def.catchall instanceof Ht&&this._def.unknownKeys==="strip"))for(let l in r.data)s.includes(l)||c.push(l);let u=[];for(let l of s){let p=o[l],d=r.data[l];u.push({key:{status:"valid",value:l},value:p._parse(new kt(r,d,r.path,l)),alwaysSet:l in r.data})}if(this._def.catchall instanceof Ht){let l=this._def.unknownKeys;if(l==="passthrough")for(let p of c)u.push({key:{status:"valid",value:p},value:{status:"valid",value:r.data[p]}});else if(l==="strict")c.length>0&&(P(r,{code:w.unrecognized_keys,keys:c}),i.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let l=this._def.catchall;for(let p of c){let d=r.data[p];u.push({key:{status:"valid",value:p},value:l._parse(new kt(r,d,r.path,p)),alwaysSet:p in r.data})}}return r.common.async?Promise.resolve().then(async()=>{let l=[];for(let p of u){let d=await p.key,m=await p.value;l.push({key:d,value:m,alwaysSet:p.alwaysSet})}return l}).then(l=>Ke.mergeObjectSync(i,l)):Ke.mergeObjectSync(i,u)}get shape(){return this._def.shape()}strict(e){return M.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,i)=>{let r=this._def.errorMap?.(n,i).message??i.defaultError;return n.code==="unrecognized_keys"?{message:M.errToObj(e).message??r}:{message:r}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:T.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let n={};for(let i of re.objectKeys(e))e[i]&&this.shape[i]&&(n[i]=this.shape[i]);return new t({...this._def,shape:()=>n})}omit(e){let n={};for(let i of re.objectKeys(this.shape))e[i]||(n[i]=this.shape[i]);return new t({...this._def,shape:()=>n})}deepPartial(){return _i(this)}partial(e){let n={};for(let i of re.objectKeys(this.shape)){let r=this.shape[i];e&&!e[i]?n[i]=r:n[i]=r.optional()}return new t({...this._def,shape:()=>n})}required(e){let n={};for(let i of re.objectKeys(this.shape))if(e&&!e[i])n[i]=this.shape[i];else{let o=this.shape[i];for(;o instanceof Pt;)o=o._def.innerType;n[i]=o}return new t({...this._def,shape:()=>n})}keyof(){return kx(re.objectKeys(this.shape))}};ht.create=(t,e)=>new ht({shape:()=>t,unknownKeys:"strip",catchall:Ht.create(),typeName:T.ZodObject,...W(e)});ht.strictCreate=(t,e)=>new ht({shape:()=>t,unknownKeys:"strict",catchall:Ht.create(),typeName:T.ZodObject,...W(e)});ht.lazycreate=(t,e)=>new ht({shape:t,unknownKeys:"strip",catchall:Ht.create(),typeName:T.ZodObject,...W(e)});var xi=class extends ee{_parse(e){let{ctx:n}=this._processInputParams(e),i=this._def.options;function r(o){for(let c of o)if(c.result.status==="valid")return c.result;for(let c of o)if(c.result.status==="dirty")return n.common.issues.push(...c.ctx.common.issues),c.result;let s=o.map(c=>new gt(c.ctx.common.issues));return P(n,{code:w.invalid_union,unionErrors:s}),V}if(n.common.async)return Promise.all(i.map(async o=>{let s={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:s}),ctx:s}})).then(r);{let o,s=[];for(let u of i){let l={...n,common:{...n.common,issues:[]},parent:null},p=u._parseSync({data:n.data,path:n.path,parent:l});if(p.status==="valid")return p;p.status==="dirty"&&!o&&(o={result:p,ctx:l}),l.common.issues.length&&s.push(l.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;let c=s.map(u=>new gt(u));return P(n,{code:w.invalid_union,unionErrors:c}),V}}get options(){return this._def.options}};xi.create=(t,e)=>new xi({options:t,typeName:T.ZodUnion,...W(e)});var an=t=>t instanceof $i?an(t.schema):t instanceof At?an(t.innerType()):t instanceof wi?[t.value]:t instanceof Ei?t.options:t instanceof Ti?re.objectValues(t.enum):t instanceof Ri?an(t._def.innerType):t instanceof ki?[void 0]:t instanceof Si?[null]:t instanceof Pt?[void 0,...an(t.unwrap())]:t instanceof un?[null,...an(t.unwrap())]:t instanceof Xl||t instanceof Pi?an(t.unwrap()):t instanceof Oi?an(t._def.innerType):[],_h=class t extends ee{_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==D.object)return P(n,{code:w.invalid_type,expected:D.object,received:n.parsedType}),V;let i=this.discriminator,r=n.data[i],o=this.optionsMap.get(r);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):(P(n,{code:w.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),V)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,i){let r=new Map;for(let o of n){let s=an(o.shape[e]);if(!s.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let c of s){if(r.has(c))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(c)}`);r.set(c,o)}}return new t({typeName:T.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:r,...W(i)})}};function vh(t,e){let n=sn(t),i=sn(e);if(t===e)return{valid:!0,data:t};if(n===D.object&&i===D.object){let r=re.objectKeys(e),o=re.objectKeys(t).filter(c=>r.indexOf(c)!==-1),s={...t,...e};for(let c of o){let u=vh(t[c],e[c]);if(!u.valid)return{valid:!1};s[c]=u.data}return{valid:!0,data:s}}else if(n===D.array&&i===D.array){if(t.length!==e.length)return{valid:!1};let r=[];for(let o=0;o<t.length;o++){let s=t[o],c=e[o],u=vh(s,c);if(!u.valid)return{valid:!1};r.push(u.data)}return{valid:!0,data:r}}else return n===D.date&&i===D.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var Ii=class extends ee{_parse(e){let{status:n,ctx:i}=this._processInputParams(e),r=(o,s)=>{if(hh(o)||hh(s))return V;let c=vh(o.value,s.value);return c.valid?((bh(o)||bh(s))&&n.dirty(),{status:n.value,value:c.data}):(P(i,{code:w.invalid_intersection_types}),V)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([o,s])=>r(o,s)):r(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}};Ii.create=(t,e,n)=>new Ii({left:t,right:e,typeName:T.ZodIntersection,...W(n)});var cn=class t extends ee{_parse(e){let{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==D.array)return P(i,{code:w.invalid_type,expected:D.array,received:i.parsedType}),V;if(i.data.length<this._def.items.length)return P(i,{code:w.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),V;!this._def.rest&&i.data.length>this._def.items.length&&(P(i,{code:w.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let o=[...i.data].map((s,c)=>{let u=this._def.items[c]||this._def.rest;return u?u._parse(new kt(i,s,i.path,c)):null}).filter(s=>!!s);return i.common.async?Promise.all(o).then(s=>Ke.mergeArray(n,s)):Ke.mergeArray(n,o)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};cn.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new cn({items:t,typeName:T.ZodTuple,rest:null,...W(e)})};var kh=class t extends ee{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==D.object)return P(i,{code:w.invalid_type,expected:D.object,received:i.parsedType}),V;let r=[],o=this._def.keyType,s=this._def.valueType;for(let c in i.data)r.push({key:o._parse(new kt(i,c,i.path,c)),value:s._parse(new kt(i,i.data[c],i.path,c)),alwaysSet:c in i.data});return i.common.async?Ke.mergeObjectAsync(n,r):Ke.mergeObjectSync(n,r)}get element(){return this._def.valueType}static create(e,n,i){return n instanceof ee?new t({keyType:e,valueType:n,typeName:T.ZodRecord,...W(i)}):new t({keyType:vi.create(),valueType:e,typeName:T.ZodRecord,...W(n)})}},Ms=class extends ee{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==D.map)return P(i,{code:w.invalid_type,expected:D.map,received:i.parsedType}),V;let r=this._def.keyType,o=this._def.valueType,s=[...i.data.entries()].map(([c,u],l)=>({key:r._parse(new kt(i,c,i.path,[l,"key"])),value:o._parse(new kt(i,u,i.path,[l,"value"]))}));if(i.common.async){let c=new Map;return Promise.resolve().then(async()=>{for(let u of s){let l=await u.key,p=await u.value;if(l.status==="aborted"||p.status==="aborted")return V;(l.status==="dirty"||p.status==="dirty")&&n.dirty(),c.set(l.value,p.value)}return{status:n.value,value:c}})}else{let c=new Map;for(let u of s){let l=u.key,p=u.value;if(l.status==="aborted"||p.status==="aborted")return V;(l.status==="dirty"||p.status==="dirty")&&n.dirty(),c.set(l.value,p.value)}return{status:n.value,value:c}}}};Ms.create=(t,e,n)=>new Ms({valueType:e,keyType:t,typeName:T.ZodMap,...W(n)});var Ls=class t extends ee{_parse(e){let{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==D.set)return P(i,{code:w.invalid_type,expected:D.set,received:i.parsedType}),V;let r=this._def;r.minSize!==null&&i.data.size<r.minSize.value&&(P(i,{code:w.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),n.dirty()),r.maxSize!==null&&i.data.size>r.maxSize.value&&(P(i,{code:w.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),n.dirty());let o=this._def.valueType;function s(u){let l=new Set;for(let p of u){if(p.status==="aborted")return V;p.status==="dirty"&&n.dirty(),l.add(p.value)}return{status:n.value,value:l}}let c=[...i.data.values()].map((u,l)=>o._parse(new kt(i,u,i.path,l)));return i.common.async?Promise.all(c).then(u=>s(u)):s(c)}min(e,n){return new t({...this._def,minSize:{value:e,message:M.toString(n)}})}max(e,n){return new t({...this._def,maxSize:{value:e,message:M.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}};Ls.create=(t,e)=>new Ls({valueType:t,minSize:null,maxSize:null,typeName:T.ZodSet,...W(e)});var Sh=class t extends ee{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==D.function)return P(n,{code:w.invalid_type,expected:D.function,received:n.parsedType}),V;function i(c,u){return Yl({data:c,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Os(),Pn].filter(l=>!!l),issueData:{code:w.invalid_arguments,argumentsError:u}})}function r(c,u){return Yl({data:c,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Os(),Pn].filter(l=>!!l),issueData:{code:w.invalid_return_type,returnTypeError:u}})}let o={errorMap:n.common.contextualErrorMap},s=n.data;if(this._def.returns instanceof fr){let c=this;return et(async function(...u){let l=new gt([]),p=await c._def.args.parseAsync(u,o).catch(f=>{throw l.addIssue(i(u,f)),l}),d=await Reflect.apply(s,this,p);return await c._def.returns._def.type.parseAsync(d,o).catch(f=>{throw l.addIssue(r(d,f)),l})})}else{let c=this;return et(function(...u){let l=c._def.args.safeParse(u,o);if(!l.success)throw new gt([i(u,l.error)]);let p=Reflect.apply(s,this,l.data),d=c._def.returns.safeParse(p,o);if(!d.success)throw new gt([r(p,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:cn.create(e).rest(An.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,i){return new t({args:e||cn.create([]).rest(An.create()),returns:n||An.create(),typeName:T.ZodFunction,...W(i)})}},$i=class extends ee{get schema(){return this._def.getter()}_parse(e){let{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};$i.create=(t,e)=>new $i({getter:t,typeName:T.ZodLazy,...W(e)});var wi=class extends ee{_parse(e){if(e.data!==this._def.value){let n=this._getOrReturnCtx(e);return P(n,{received:n.data,code:w.invalid_literal,expected:this._def.value}),V}return{status:"valid",value:e.data}}get value(){return this._def.value}};wi.create=(t,e)=>new wi({value:t,typeName:T.ZodLiteral,...W(e)});function kx(t,e){return new Ei({values:t,typeName:T.ZodEnum,...W(e)})}var Ei=class t extends ee{_parse(e){if(typeof e.data!="string"){let n=this._getOrReturnCtx(e),i=this._def.values;return P(n,{expected:re.joinValues(i),received:n.parsedType,code:w.invalid_type}),V}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let n=this._getOrReturnCtx(e),i=this._def.values;return P(n,{received:n.data,code:w.invalid_enum_value,options:i}),V}return et(e.data)}get options(){return this._def.values}get enum(){let e={};for(let n of this._def.values)e[n]=n;return e}get Values(){let e={};for(let n of this._def.values)e[n]=n;return e}get Enum(){let e={};for(let n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return t.create(e,{...this._def,...n})}exclude(e,n=this._def){return t.create(this.options.filter(i=>!e.includes(i)),{...this._def,...n})}};Ei.create=kx;var Ti=class extends ee{_parse(e){let n=re.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(e);if(i.parsedType!==D.string&&i.parsedType!==D.number){let r=re.objectValues(n);return P(i,{expected:re.joinValues(r),received:i.parsedType,code:w.invalid_type}),V}if(this._cache||(this._cache=new Set(re.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let r=re.objectValues(n);return P(i,{received:i.data,code:w.invalid_enum_value,options:r}),V}return et(e.data)}get enum(){return this._def.values}};Ti.create=(t,e)=>new Ti({values:t,typeName:T.ZodNativeEnum,...W(e)});var fr=class extends ee{unwrap(){return this._def.type}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==D.promise&&n.common.async===!1)return P(n,{code:w.invalid_type,expected:D.promise,received:n.parsedType}),V;let i=n.parsedType===D.promise?n.data:Promise.resolve(n.data);return et(i.then(r=>this._def.type.parseAsync(r,{path:n.path,errorMap:n.common.contextualErrorMap})))}};fr.create=(t,e)=>new fr({type:t,typeName:T.ZodPromise,...W(e)});var At=class extends ee{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===T.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:n,ctx:i}=this._processInputParams(e),r=this._def.effect||null,o={addIssue:s=>{P(i,s),s.fatal?n.abort():n.dirty()},get path(){return i.path}};if(o.addIssue=o.addIssue.bind(o),r.type==="preprocess"){let s=r.transform(i.data,o);if(i.common.async)return Promise.resolve(s).then(async c=>{if(n.value==="aborted")return V;let u=await this._def.schema._parseAsync({data:c,path:i.path,parent:i});return u.status==="aborted"?V:u.status==="dirty"?yi(u.value):n.value==="dirty"?yi(u.value):u});{if(n.value==="aborted")return V;let c=this._def.schema._parseSync({data:s,path:i.path,parent:i});return c.status==="aborted"?V:c.status==="dirty"?yi(c.value):n.value==="dirty"?yi(c.value):c}}if(r.type==="refinement"){let s=c=>{let u=r.refinement(c,o);if(i.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c};if(i.common.async===!1){let c=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return c.status==="aborted"?V:(c.status==="dirty"&&n.dirty(),s(c.value),{status:n.value,value:c.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(c=>c.status==="aborted"?V:(c.status==="dirty"&&n.dirty(),s(c.value).then(()=>({status:n.value,value:c.value}))))}if(r.type==="transform")if(i.common.async===!1){let s=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!mr(s))return V;let c=r.transform(s.value,o);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:c}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(s=>mr(s)?Promise.resolve(r.transform(s.value,o)).then(c=>({status:n.value,value:c})):V);re.assertNever(r)}};At.create=(t,e,n)=>new At({schema:t,typeName:T.ZodEffects,effect:e,...W(n)});At.createWithPreprocess=(t,e,n)=>new At({schema:e,effect:{type:"preprocess",transform:t},typeName:T.ZodEffects,...W(n)});var Pt=class extends ee{_parse(e){return this._getType(e)===D.undefined?et(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Pt.create=(t,e)=>new Pt({innerType:t,typeName:T.ZodOptional,...W(e)});var un=class extends ee{_parse(e){return this._getType(e)===D.null?et(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};un.create=(t,e)=>new un({innerType:t,typeName:T.ZodNullable,...W(e)});var Ri=class extends ee{_parse(e){let{ctx:n}=this._processInputParams(e),i=n.data;return n.parsedType===D.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};Ri.create=(t,e)=>new Ri({innerType:t,typeName:T.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...W(e)});var Oi=class extends ee{_parse(e){let{ctx:n}=this._processInputParams(e),i={...n,common:{...n.common,issues:[]}},r=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return Ps(r)?r.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new gt(i.common.issues)},input:i.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new gt(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}};Oi.create=(t,e)=>new Oi({innerType:t,typeName:T.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...W(e)});var Zs=class extends ee{_parse(e){if(this._getType(e)!==D.nan){let i=this._getOrReturnCtx(e);return P(i,{code:w.invalid_type,expected:D.nan,received:i.parsedType}),V}return{status:"valid",value:e.data}}};Zs.create=t=>new Zs({typeName:T.ZodNaN,...W(t)});var Xl=class extends ee{_parse(e){let{ctx:n}=this._processInputParams(e),i=n.data;return this._def.type._parse({data:i,path:n.path,parent:n})}unwrap(){return this._def.type}},Ql=class t extends ee{_parse(e){let{status:n,ctx:i}=this._processInputParams(e);if(i.common.async)return(async()=>{let o=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return o.status==="aborted"?V:o.status==="dirty"?(n.dirty(),yi(o.value)):this._def.out._parseAsync({data:o.value,path:i.path,parent:i})})();{let r=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return r.status==="aborted"?V:r.status==="dirty"?(n.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:i.path,parent:i})}}static create(e,n){return new t({in:e,out:n,typeName:T.ZodPipeline})}},Pi=class extends ee{_parse(e){let n=this._def.innerType._parse(e),i=r=>(mr(r)&&(r.value=Object.freeze(r.value)),r);return Ps(n)?n.then(r=>i(r)):i(n)}unwrap(){return this._def.innerType}};Pi.create=(t,e)=>new Pi({innerType:t,typeName:T.ZodReadonly,...W(e)});var Z2={object:ht.lazycreate},T;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(T||(T={}));var B2=vi.create,F2=As.create,V2=Zs.create,q2=Ns.create,H2=Cs.create,K2=zs.create,G2=Ds.create,W2=ki.create,J2=Si.create,Y2=js.create,X2=An.create,Q2=Ht.create,eq=Us.create,tq=Nn.create,Sx=ht.create,nq=ht.strictCreate,rq=xi.create,iq=_h.create,oq=Ii.create,sq=cn.create,aq=kh.create,cq=Ms.create,uq=Ls.create,lq=Sh.create,dq=$i.create,pq=wi.create,mq=Ei.create,fq=Ti.create,gq=fr.create,hq=At.create,bq=Pt.create,yq=un.create,_q=At.createWithPreprocess,vq=Ql.create;var cC=h("ZodMiniType",(t,e)=>{if(!t._zod)throw new Error("Uninitialized schema in ZodMiniType.");H.init(t,e),t.def=e,t.type=e.type,t.parse=(n,i)=>ir(t,n,i,{callee:t.parse}),t.safeParse=(n,i)=>kn(t,n,i),t.parseAsync=async(n,i)=>or(t,n,i,{callee:t.parseAsync}),t.safeParseAsync=async(n,i)=>Sn(t,n,i),t.check=(...n)=>t.clone({...e,checks:[...e.checks??[],...n.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]},{parent:!0}),t.with=t.check,t.clone=(n,i)=>Ue(t,n,i),t.brand=()=>t,t.register=((n,i)=>(n.add(t,i),t)),t.apply=n=>n(t)});var uC=h("ZodMiniObject",(t,e)=>{Lc.init(t,e),cC.init(t,e),J(t,"shape",()=>e.shape)});function xh(t,e){let n={type:"object",shape:t??{},...E(e)};return new uC(n)}function Kt(t){return!!t._zod}function gr(t){let e=Object.values(t);if(e.length===0)return xh({});let n=e.every(Kt),i=e.every(r=>!Kt(r));if(n)return xh(t);if(i)return Sx(t);throw new Error("Mixed Zod versions detected in object shape.")}function Cn(t,e){return Kt(t)?kn(t,e):t.safeParse(e)}async function ed(t,e){return Kt(t)?await Sn(t,e):await t.safeParseAsync(e)}function zn(t){if(!t)return;let e;if(Kt(t)?e=t._zod?.def?.shape:e=t.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function Ai(t){if(t){if(typeof t=="object"){let e=t,n=t;if(!e._def&&!n._zod){let i=Object.values(t);if(i.length>0&&i.every(r=>typeof r=="object"&&r!==null&&(r._def!==void 0||r._zod!==void 0||typeof r.parse=="function")))return gr(t)}}if(Kt(t)){let n=t._zod?.def;if(n&&(n.type==="object"||n.shape!==void 0))return t}else if(t.shape!==void 0)return t}}function dC(t){return t.length===0?"object root":t.reduce((e,n,i)=>i===0?String(n):typeof n=="number"?`${e}[${n}]`:`${e}.${n}`,"")}function td(t){if(t&&typeof t=="object"){if("issues"in t&&Array.isArray(t.issues)&&t.issues.length>0)return t.issues.map(e=>e.path?.length?`${e.message} at ${dC(e.path)}`:e.message).join(`
|
|
77
|
+
`);if("message"in t&&typeof t.message=="string")return t.message;try{return JSON.stringify(t)}catch{return String(t)}}return String(t)}function xx(t){return t.description}function Ix(t){if(Kt(t))return t._zod?.def?.type==="optional";let e=t;return typeof t.isOptional=="function"?t.isOptional():e._def?.typeName==="ZodOptional"}function Ni(t){if(Kt(t)){let o=t._zod?.def;if(o){if(o.value!==void 0)return o.value;if(Array.isArray(o.values)&&o.values.length>0)return o.values[0]}}let n=t._def;if(n){if(n.value!==void 0)return n.value;if(Array.isArray(n.values)&&n.values.length>0)return n.values[0]}let i=t.value;if(i!==void 0)return i}function Dn(t){return t==="completed"||t==="failed"||t==="cancelled"}var wx=Symbol("Let zodToJsonSchema decide on which parser to use");var $x={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"},Ex=t=>typeof t=="string"?{...$x,name:t}:{...$x,...t};var Tx=t=>{let e=Ex(t),n=e.name!==void 0?[...e.basePath,e.definitionPath,e.name]:e.basePath;return{...e,flags:{hasReferencedOpenAiAnyType:!1},currentPath:n,propertyPath:void 0,seen:new Map(Object.entries(e.definitions).map(([i,r])=>[r._def,{def:r._def,path:[...e.basePath,e.definitionPath,i],jsonSchema:void 0}]))}};function Ih(t,e,n,i){i?.errorMessages&&n&&(t.errorMessage={...t.errorMessage,[e]:n})}function ie(t,e,n,i,r){t[e]=n,Ih(t,e,i,r)}var nd=(t,e)=>{let n=0;for(;n<t.length&&n<e.length&&t[n]===e[n];n++);return[(t.length-n).toString(),...e.slice(n)].join("/")};function we(t){if(t.target!=="openAi")return{};let e=[...t.basePath,t.definitionPath,t.openAiAnyTypeName];return t.flags.hasReferencedOpenAiAnyType=!0,{$ref:t.$refStrategy==="relative"?nd(e,t.currentPath):e.join("/")}}function Rx(t,e){let n={type:"array"};return t.type?._def&&t.type?._def?.typeName!==T.ZodAny&&(n.items=q(t.type._def,{...e,currentPath:[...e.currentPath,"items"]})),t.minLength&&ie(n,"minItems",t.minLength.value,t.minLength.message,e),t.maxLength&&ie(n,"maxItems",t.maxLength.value,t.maxLength.message,e),t.exactLength&&(ie(n,"minItems",t.exactLength.value,t.exactLength.message,e),ie(n,"maxItems",t.exactLength.value,t.exactLength.message,e)),n}function Ox(t,e){let n={type:"integer",format:"int64"};if(!t.checks)return n;for(let i of t.checks)switch(i.kind){case"min":e.target==="jsonSchema7"?i.inclusive?ie(n,"minimum",i.value,i.message,e):ie(n,"exclusiveMinimum",i.value,i.message,e):(i.inclusive||(n.exclusiveMinimum=!0),ie(n,"minimum",i.value,i.message,e));break;case"max":e.target==="jsonSchema7"?i.inclusive?ie(n,"maximum",i.value,i.message,e):ie(n,"exclusiveMaximum",i.value,i.message,e):(i.inclusive||(n.exclusiveMaximum=!0),ie(n,"maximum",i.value,i.message,e));break;case"multipleOf":ie(n,"multipleOf",i.value,i.message,e);break}return n}function Px(){return{type:"boolean"}}function rd(t,e){return q(t.type._def,e)}var Ax=(t,e)=>q(t.innerType._def,e);function $h(t,e,n){let i=n??e.dateStrategy;if(Array.isArray(i))return{anyOf:i.map((r,o)=>$h(t,e,r))};switch(i){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return pC(t,e)}}var pC=(t,e)=>{let n={type:"integer",format:"unix-time"};if(e.target==="openApi3")return n;for(let i of t.checks)switch(i.kind){case"min":ie(n,"minimum",i.value,i.message,e);break;case"max":ie(n,"maximum",i.value,i.message,e);break}return n};function Nx(t,e){return{...q(t.innerType._def,e),default:t.defaultValue()}}function Cx(t,e){return e.effectStrategy==="input"?q(t.schema._def,e):we(e)}function zx(t){return{type:"string",enum:Array.from(t.values)}}var mC=t=>"type"in t&&t.type==="string"?!1:"allOf"in t;function Dx(t,e){let n=[q(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),q(t.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(o=>!!o),i=e.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,r=[];return n.forEach(o=>{if(mC(o))r.push(...o.allOf),o.unevaluatedProperties===void 0&&(i=void 0);else{let s=o;if("additionalProperties"in o&&o.additionalProperties===!1){let{additionalProperties:c,...u}=o;s=u}else i=void 0;r.push(s)}}),r.length?{allOf:r,...i}:void 0}function jx(t,e){let n=typeof t.value;return n!=="bigint"&&n!=="number"&&n!=="boolean"&&n!=="string"?{type:Array.isArray(t.value)?"array":"object"}:e.target==="openApi3"?{type:n==="bigint"?"integer":n,enum:[t.value]}:{type:n==="bigint"?"integer":n,const:t.value}}var wh,Nt={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:()=>(wh===void 0&&(wh=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),wh),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 id(t,e){let n={type:"string"};if(t.checks)for(let i of t.checks)switch(i.kind){case"min":ie(n,"minLength",typeof n.minLength=="number"?Math.max(n.minLength,i.value):i.value,i.message,e);break;case"max":ie(n,"maxLength",typeof n.maxLength=="number"?Math.min(n.maxLength,i.value):i.value,i.message,e);break;case"email":switch(e.emailStrategy){case"format:email":Ct(n,"email",i.message,e);break;case"format:idn-email":Ct(n,"idn-email",i.message,e);break;case"pattern:zod":tt(n,Nt.email,i.message,e);break}break;case"url":Ct(n,"uri",i.message,e);break;case"uuid":Ct(n,"uuid",i.message,e);break;case"regex":tt(n,i.regex,i.message,e);break;case"cuid":tt(n,Nt.cuid,i.message,e);break;case"cuid2":tt(n,Nt.cuid2,i.message,e);break;case"startsWith":tt(n,RegExp(`^${Eh(i.value,e)}`),i.message,e);break;case"endsWith":tt(n,RegExp(`${Eh(i.value,e)}$`),i.message,e);break;case"datetime":Ct(n,"date-time",i.message,e);break;case"date":Ct(n,"date",i.message,e);break;case"time":Ct(n,"time",i.message,e);break;case"duration":Ct(n,"duration",i.message,e);break;case"length":ie(n,"minLength",typeof n.minLength=="number"?Math.max(n.minLength,i.value):i.value,i.message,e),ie(n,"maxLength",typeof n.maxLength=="number"?Math.min(n.maxLength,i.value):i.value,i.message,e);break;case"includes":{tt(n,RegExp(Eh(i.value,e)),i.message,e);break}case"ip":{i.version!=="v6"&&Ct(n,"ipv4",i.message,e),i.version!=="v4"&&Ct(n,"ipv6",i.message,e);break}case"base64url":tt(n,Nt.base64url,i.message,e);break;case"jwt":tt(n,Nt.jwt,i.message,e);break;case"cidr":{i.version!=="v6"&&tt(n,Nt.ipv4Cidr,i.message,e),i.version!=="v4"&&tt(n,Nt.ipv6Cidr,i.message,e);break}case"emoji":tt(n,Nt.emoji(),i.message,e);break;case"ulid":{tt(n,Nt.ulid,i.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{Ct(n,"binary",i.message,e);break}case"contentEncoding:base64":{ie(n,"contentEncoding","base64",i.message,e);break}case"pattern:zod":{tt(n,Nt.base64,i.message,e);break}}break}case"nanoid":tt(n,Nt.nanoid,i.message,e);case"toLowerCase":case"toUpperCase":case"trim":break;default:}return n}function Eh(t,e){return e.patternStrategy==="escape"?gC(t):t}var fC=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function gC(t){let e="";for(let n=0;n<t.length;n++)fC.has(t[n])||(e+="\\"),e+=t[n];return e}function Ct(t,e,n,i){t.format||t.anyOf?.some(r=>r.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push({format:t.format,...t.errorMessage&&i.errorMessages&&{errorMessage:{format:t.errorMessage.format}}}),delete t.format,t.errorMessage&&(delete t.errorMessage.format,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.anyOf.push({format:e,...n&&i.errorMessages&&{errorMessage:{format:n}}})):ie(t,"format",e,n,i)}function tt(t,e,n,i){t.pattern||t.allOf?.some(r=>r.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push({pattern:t.pattern,...t.errorMessage&&i.errorMessages&&{errorMessage:{pattern:t.errorMessage.pattern}}}),delete t.pattern,t.errorMessage&&(delete t.errorMessage.pattern,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.allOf.push({pattern:Ux(e,i),...n&&i.errorMessages&&{errorMessage:{pattern:n}}})):ie(t,"pattern",Ux(e,i),n,i)}function Ux(t,e){if(!e.applyRegexFlags||!t.flags)return t.source;let n={i:t.flags.includes("i"),m:t.flags.includes("m"),s:t.flags.includes("s")},i=n.i?t.source.toLowerCase():t.source,r="",o=!1,s=!1,c=!1;for(let u=0;u<i.length;u++){if(o){r+=i[u],o=!1;continue}if(n.i){if(s){if(i[u].match(/[a-z]/)){c?(r+=i[u],r+=`${i[u-2]}-${i[u]}`.toUpperCase(),c=!1):i[u+1]==="-"&&i[u+2]?.match(/[a-z]/)?(r+=i[u],c=!0):r+=`${i[u]}${i[u].toUpperCase()}`;continue}}else if(i[u].match(/[a-z]/)){r+=`[${i[u]}${i[u].toUpperCase()}]`;continue}}if(n.m){if(i[u]==="^"){r+=`(^|(?<=[\r
|
|
78
78
|
]))`;continue}else if(i[u]==="$"){r+=`($|(?=[\r
|
|
79
79
|
]))`;continue}}if(n.s&&i[u]==="."){r+=s?`${i[u]}\r
|
|
80
80
|
`:`[${i[u]}\r
|
|
81
|
-
]`;continue}r+=i[u],i[u]==="\\"?o=!0:s&&i[u]==="]"?s=!1:!s&&i[u]==="["&&(s=!0)}try{new RegExp(r)}catch{return console.warn(`Could not convert regex pattern at ${e.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),t.source}return r}function Wl(t,e){if(e.target==="openAi"&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),e.target==="openApi3"&&t.keyType?._def.typeName===E.ZodEnum)return{type:"object",required:t.keyType._def.values,properties:t.keyType._def.values.reduce((i,r)=>({...i,[r]:V(t.valueType._def,{...e,currentPath:[...e.currentPath,"properties",r]})??we(e)}),{}),additionalProperties:e.rejectedAdditionalProperties};let n={type:"object",additionalProperties:V(t.valueType._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]})??e.allowedAdditionalProperties};if(e.target==="openApi3")return n;if(t.keyType?._def.typeName===E.ZodString&&t.keyType._def.checks?.length){let{type:i,...r}=Kl(t.keyType._def,e);return{...n,propertyNames:r}}else{if(t.keyType?._def.typeName===E.ZodEnum)return{...n,propertyNames:{enum:t.keyType._def.values}};if(t.keyType?._def.typeName===E.ZodBranded&&t.keyType._def.type._def.typeName===E.ZodString&&t.keyType._def.type._def.checks?.length){let{type:i,...r}=Gl(t.keyType._def,e);return{...n,propertyNames:r}}}return n}function gx(t,e){if(e.mapStrategy==="record")return Wl(t,e);let n=V(t.keyType._def,{...e,currentPath:[...e.currentPath,"items","items","0"]})||we(e),i=V(t.valueType._def,{...e,currentPath:[...e.currentPath,"items","items","1"]})||we(e);return{type:"array",maxItems:125,items:{type:"array",items:[n,i],minItems:2,maxItems:2}}}function bx(t){let e=t.values,i=Object.keys(t.values).filter(o=>typeof e[e[o]]!="number").map(o=>e[o]),r=Array.from(new Set(i.map(o=>typeof o)));return{type:r.length===1?r[0]==="string"?"string":"number":["string","number"],enum:i}}function _x(t){return t.target==="openAi"?void 0:{not:we({...t,currentPath:[...t.currentPath,"not"]})}}function yx(t){return t.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}var zs={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function kx(t,e){if(e.target==="openApi3")return vx(t,e);let n=t.options instanceof Map?Array.from(t.options.values()):t.options;if(n.every(i=>i._def.typeName in zs&&(!i._def.checks||!i._def.checks.length))){let i=n.reduce((r,o)=>{let s=zs[o._def.typeName];return s&&!r.includes(s)?[...r,s]:r},[]);return{type:i.length>1?i:i[0]}}else if(n.every(i=>i._def.typeName==="ZodLiteral"&&!i.description)){let i=n.reduce((r,o)=>{let s=typeof o._def.value;switch(s){case"string":case"number":case"boolean":return[...r,s];case"bigint":return[...r,"integer"];case"object":if(o._def.value===null)return[...r,"null"];default:return r}},[]);if(i.length===n.length){let r=i.filter((o,s,c)=>c.indexOf(o)===s);return{type:r.length>1?r:r[0],enum:n.reduce((o,s)=>o.includes(s._def.value)?o:[...o,s._def.value],[])}}}else if(n.every(i=>i._def.typeName==="ZodEnum"))return{type:"string",enum:n.reduce((i,r)=>[...i,...r._def.values.filter(o=>!i.includes(o))],[])};return vx(t,e)}var vx=(t,e)=>{let n=(t.options instanceof Map?Array.from(t.options.values()):t.options).map((i,r)=>V(i._def,{...e,currentPath:[...e.currentPath,"anyOf",`${r}`]})).filter(i=>!!i&&(!e.strictUnions||typeof i=="object"&&Object.keys(i).length>0));return n.length?{anyOf:n}:void 0};function Sx(t,e){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(t.innerType._def.typeName)&&(!t.innerType._def.checks||!t.innerType._def.checks.length))return e.target==="openApi3"?{type:zs[t.innerType._def.typeName],nullable:!0}:{type:[zs[t.innerType._def.typeName],"null"]};if(e.target==="openApi3"){let i=V(t.innerType._def,{...e,currentPath:[...e.currentPath]});return i&&"$ref"in i?{allOf:[i],nullable:!0}:i&&{...i,nullable:!0}}let n=V(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","0"]});return n&&{anyOf:[n,{type:"null"}]}}function xx(t,e){let n={type:"number"};if(!t.checks)return n;for(let i of t.checks)switch(i.kind){case"int":n.type="integer",ag(n,"type",i.message,e);break;case"min":e.target==="jsonSchema7"?i.inclusive?ie(n,"minimum",i.value,i.message,e):ie(n,"exclusiveMinimum",i.value,i.message,e):(i.inclusive||(n.exclusiveMinimum=!0),ie(n,"minimum",i.value,i.message,e));break;case"max":e.target==="jsonSchema7"?i.inclusive?ie(n,"maximum",i.value,i.message,e):ie(n,"exclusiveMaximum",i.value,i.message,e):(i.inclusive||(n.exclusiveMaximum=!0),ie(n,"maximum",i.value,i.message,e));break;case"multipleOf":ie(n,"multipleOf",i.value,i.message,e);break}return n}function Ix(t,e){let n=e.target==="openAi",i={type:"object",properties:{}},r=[],o=t.shape();for(let c in o){let u=o[c];if(u===void 0||u._def===void 0)continue;let d=DN(u);d&&n&&(u._def.typeName==="ZodOptional"&&(u=u._def.innerType),u.isNullable()||(u=u.nullable()),d=!1);let l=V(u._def,{...e,currentPath:[...e.currentPath,"properties",c],propertyPath:[...e.currentPath,"properties",c]});l!==void 0&&(i.properties[c]=l,d||r.push(c))}r.length&&(i.required=r);let s=zN(t,e);return s!==void 0&&(i.additionalProperties=s),i}function zN(t,e){if(t.catchall._def.typeName!=="ZodNever")return V(t.catchall._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]});switch(t.unknownKeys){case"passthrough":return e.allowedAdditionalProperties;case"strict":return e.rejectedAdditionalProperties;case"strip":return e.removeAdditionalStrategy==="strict"?e.allowedAdditionalProperties:e.rejectedAdditionalProperties}}function DN(t){try{return t.isOptional()}catch{return!0}}var $x=(t,e)=>{if(e.currentPath.toString()===e.propertyPath?.toString())return V(t.innerType._def,e);let n=V(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","1"]});return n?{anyOf:[{not:we(e)},n]}:we(e)};var wx=(t,e)=>{if(e.pipeStrategy==="input")return V(t.in._def,e);if(e.pipeStrategy==="output")return V(t.out._def,e);let n=V(t.in._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),i=V(t.out._def,{...e,currentPath:[...e.currentPath,"allOf",n?"1":"0"]});return{allOf:[n,i].filter(r=>r!==void 0)}};function Ex(t,e){return V(t.type._def,e)}function Tx(t,e){let i={type:"array",uniqueItems:!0,items:V(t.valueType._def,{...e,currentPath:[...e.currentPath,"items"]})};return t.minSize&&ie(i,"minItems",t.minSize.value,t.minSize.message,e),t.maxSize&&ie(i,"maxItems",t.maxSize.value,t.maxSize.message,e),i}function Rx(t,e){return t.rest?{type:"array",minItems:t.items.length,items:t.items.map((n,i)=>V(n._def,{...e,currentPath:[...e.currentPath,"items",`${i}`]})).reduce((n,i)=>i===void 0?n:[...n,i],[]),additionalItems:V(t.rest._def,{...e,currentPath:[...e.currentPath,"additionalItems"]})}:{type:"array",minItems:t.items.length,maxItems:t.items.length,items:t.items.map((n,i)=>V(n._def,{...e,currentPath:[...e.currentPath,"items",`${i}`]})).reduce((n,i)=>i===void 0?n:[...n,i],[])}}function Ox(t){return{not:we(t)}}function Px(t){return we(t)}var Ax=(t,e)=>V(t.innerType._def,e);var Nx=(t,e,n)=>{switch(e){case E.ZodString:return Kl(t,n);case E.ZodNumber:return xx(t,n);case E.ZodObject:return Ix(t,n);case E.ZodBigInt:return ax(t,n);case E.ZodBoolean:return cx();case E.ZodDate:return cg(t,n);case E.ZodUndefined:return Ox(n);case E.ZodNull:return yx(n);case E.ZodArray:return sx(t,n);case E.ZodUnion:case E.ZodDiscriminatedUnion:return kx(t,n);case E.ZodIntersection:return mx(t,n);case E.ZodTuple:return Rx(t,n);case E.ZodRecord:return Wl(t,n);case E.ZodLiteral:return fx(t,n);case E.ZodEnum:return px(t);case E.ZodNativeEnum:return bx(t);case E.ZodNullable:return Sx(t,n);case E.ZodOptional:return $x(t,n);case E.ZodMap:return gx(t,n);case E.ZodSet:return Tx(t,n);case E.ZodLazy:return()=>t.getter()._def;case E.ZodPromise:return Ex(t,n);case E.ZodNaN:case E.ZodNever:return _x(n);case E.ZodEffects:return dx(t,n);case E.ZodAny:return we(n);case E.ZodUnknown:return Px(n);case E.ZodDefault:return lx(t,n);case E.ZodBranded:return Gl(t,n);case E.ZodReadonly:return Ax(t,n);case E.ZodCatch:return ux(t,n);case E.ZodPipeline:return wx(t,n);case E.ZodFunction:case E.ZodVoid:case E.ZodSymbol:return;default:return(i=>{})(e)}};function V(t,e,n=!1){let i=e.seen.get(t);if(e.override){let c=e.override?.(t,e,i,n);if(c!==rx)return c}if(i&&!n){let c=jN(i,e);if(c!==void 0)return c}let r={def:t,path:e.currentPath,jsonSchema:void 0};e.seen.set(t,r);let o=Nx(t,t.typeName,e),s=typeof o=="function"?V(o(),e):o;if(s&&UN(t,e,s),e.postProcess){let c=e.postProcess(s,t,e);return r.jsonSchema=s,c}return r.jsonSchema=s,s}var jN=(t,e)=>{switch(e.$refStrategy){case"root":return{$ref:t.path.join("/")};case"relative":return{$ref:Hl(e.currentPath,t.path)};case"none":case"seen":return t.path.length<e.currentPath.length&&t.path.every((n,i)=>e.currentPath[i]===n)?(console.warn(`Recursive reference detected at ${e.currentPath.join("/")}! Defaulting to any`),we(e)):e.$refStrategy==="seen"?we(e):void 0}},UN=(t,e,n)=>(t.description&&(n.description=t.description,e.markdownDescription&&(n.markdownDescription=t.description)),n);var dg=(t,e)=>{let n=ox(e),i=typeof e=="object"&&e.definitions?Object.entries(e.definitions).reduce((u,[d,l])=>({...u,[d]:V(l._def,{...n,currentPath:[...n.basePath,n.definitionPath,d]},!0)??we(n)}),{}):void 0,r=typeof e=="string"?e:e?.nameStrategy==="title"?void 0:e?.name,o=V(t._def,r===void 0?n:{...n,currentPath:[...n.basePath,n.definitionPath,r]},!1)??we(n),s=typeof e=="object"&&e.name!==void 0&&e.nameStrategy==="title"?e.name:void 0;s!==void 0&&(o.title=s),n.flags.hasReferencedOpenAiAnyType&&(i||(i={}),i[n.openAiAnyTypeName]||(i[n.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:n.$refStrategy==="relative"?"1":[...n.basePath,n.definitionPath,n.openAiAnyTypeName].join("/")}}));let c=r===void 0?i?{...o,[n.definitionPath]:i}:o:{$ref:[...n.$refStrategy==="relative"?[]:n.basePath,n.definitionPath,r].join("/"),[n.definitionPath]:{...i,[r]:o}};return n.target==="jsonSchema7"?c.$schema="http://json-schema.org/draft-07/schema#":(n.target==="jsonSchema2019-09"||n.target==="openAi")&&(c.$schema="https://json-schema.org/draft/2019-09/schema#"),n.target==="openAi"&&("anyOf"in c||"oneOf"in c||"allOf"in c||"type"in c&&Array.isArray(c.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),c};function MN(t){return!t||t==="jsonSchema7"||t==="draft-7"?"draft-7":t==="jsonSchema2019-09"||t==="draft-2020-12"?"draft-2020-12":"draft-7"}function pg(t,e){return Gt(t)?rr(t,{target:MN(e?.target),io:e?.pipeStrategy??"input"}):dg(t,{strictUnions:e?.strictUnions??!0,pipeStrategy:e?.pipeStrategy??"input"})}function mg(t){let n=An(t)?.method;if(!n)throw new Error("Schema is missing a method literal");let i=wi(n);if(typeof i!="string")throw new Error("Schema method literal must be a string");return i}function fg(t,e){let n=Pn(t,e);if(!n.success)throw n.error;return n.data}var LN=6e4,Jl=class{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(Sl,n=>{this._oncancel(n)}),this.setNotificationHandler(Il,n=>{this._onprogress(n)}),this.setRequestHandler(xl,n=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler($l,async(n,i)=>{let r=await this._taskStore.getTask(n.params.taskId,i.sessionId);if(!r)throw new Z(F.InvalidParams,"Failed to retrieve task: Task not found");return{...r}}),this.setRequestHandler(El,async(n,i)=>{let r=async()=>{let o=n.params.taskId;if(this._taskMessageQueue){let c;for(;c=await this._taskMessageQueue.dequeue(o,i.sessionId);){if(c.type==="response"||c.type==="error"){let u=c.message,d=u.id,l=this._requestResolvers.get(d);if(l)if(this._requestResolvers.delete(d),c.type==="response")l(u);else{let p=u,m=new Z(p.error.code,p.error.message,p.error.data);l(m)}else{let p=c.type==="response"?"Response":"Error";this._onerror(new Error(`${p} handler missing for request ${d}`))}continue}await this._transport?.send(c.message,{relatedRequestId:i.requestId})}}let s=await this._taskStore.getTask(o,i.sessionId);if(!s)throw new Z(F.InvalidParams,`Task not found: ${o}`);if(!Nn(s.status))return await this._waitForTaskUpdate(o,i.signal),await r();if(Nn(s.status)){let c=await this._taskStore.getTaskResult(o,i.sessionId);return this._clearTaskQueue(o),{...c,_meta:{...c._meta,[En]:{taskId:o}}}}return await r()};return await r()}),this.setRequestHandler(Tl,async(n,i)=>{try{let{tasks:r,nextCursor:o}=await this._taskStore.listTasks(n.params?.cursor,i.sessionId);return{tasks:r,nextCursor:o,_meta:{}}}catch(r){throw new Z(F.InvalidParams,`Failed to list tasks: ${r instanceof Error?r.message:String(r)}`)}}),this.setRequestHandler(Ol,async(n,i)=>{try{let r=await this._taskStore.getTask(n.params.taskId,i.sessionId);if(!r)throw new Z(F.InvalidParams,`Task not found: ${n.params.taskId}`);if(Nn(r.status))throw new Z(F.InvalidParams,`Cannot cancel task in terminal status: ${r.status}`);await this._taskStore.updateTaskStatus(n.params.taskId,"cancelled","Client cancelled task execution.",i.sessionId),this._clearTaskQueue(n.params.taskId);let o=await this._taskStore.getTask(n.params.taskId,i.sessionId);if(!o)throw new Z(F.InvalidParams,`Task not found after cancellation: ${n.params.taskId}`);return{_meta:{},...o}}catch(r){throw r instanceof Z?r:new Z(F.InvalidRequest,`Failed to cancel task: ${r instanceof Error?r.message:String(r)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,n,i,r,o=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,n),startTime:Date.now(),timeout:n,maxTotalTimeout:i,resetTimeoutOnProgress:o,onTimeout:r})}_resetTimeout(e){let n=this._timeoutInfo.get(e);if(!n)return!1;let i=Date.now()-n.startTime;if(n.maxTotalTimeout&&i>=n.maxTotalTimeout)throw this._timeoutInfo.delete(e),Z.fromError(F.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:n.maxTotalTimeout,totalElapsed:i});return clearTimeout(n.timeoutId),n.timeoutId=setTimeout(n.onTimeout,n.timeout),!0}_cleanupTimeout(e){let n=this._timeoutInfo.get(e);n&&(clearTimeout(n.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=e;let n=this.transport?.onclose;this._transport.onclose=()=>{n?.(),this._onclose()};let i=this.transport?.onerror;this._transport.onerror=o=>{i?.(o),this._onerror(o)};let r=this._transport?.onmessage;this._transport.onmessage=(o,s)=>{r?.(o,s),fs(o)||zS(o)?this._onresponse(o):Mh(o)?this._onrequest(o,s):CS(o)?this._onnotification(o):this._onerror(new Error(`Unknown message type: ${JSON.stringify(o)}`))},await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let i of this._timeoutInfo.values())clearTimeout(i.timeoutId);this._timeoutInfo.clear();for(let i of this._requestHandlerAbortControllers.values())i.abort();this._requestHandlerAbortControllers.clear();let n=Z.fromError(F.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let i of e.values())i(n)}_onerror(e){this.onerror?.(e)}_onnotification(e){let n=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;n!==void 0&&Promise.resolve().then(()=>n(e)).catch(i=>this._onerror(new Error(`Uncaught error in notification handler: ${i}`)))}_onrequest(e,n){let i=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,r=this._transport,o=e.params?._meta?.[En]?.taskId;if(i===void 0){let l={jsonrpc:"2.0",id:e.id,error:{code:F.MethodNotFound,message:"Method not found"}};o&&this._taskMessageQueue?this._enqueueTaskMessage(o,{type:"error",message:l,timestamp:Date.now()},r?.sessionId).catch(p=>this._onerror(new Error(`Failed to enqueue error response: ${p}`))):r?.send(l).catch(p=>this._onerror(new Error(`Failed to send an error response: ${p}`)));return}let s=new AbortController;this._requestHandlerAbortControllers.set(e.id,s);let c=PS(e.params)?e.params.task:void 0,u=this._taskStore?this.requestTaskStore(e,r?.sessionId):void 0,d={signal:s.signal,sessionId:r?.sessionId,_meta:e.params?._meta,sendNotification:async l=>{if(s.signal.aborted)return;let p={relatedRequestId:e.id};o&&(p.relatedTask={taskId:o}),await this.notification(l,p)},sendRequest:async(l,p,m)=>{if(s.signal.aborted)throw new Z(F.ConnectionClosed,"Request was cancelled");let f={...m,relatedRequestId:e.id};o&&!f.relatedTask&&(f.relatedTask={taskId:o});let h=f.relatedTask?.taskId??o;return h&&u&&await u.updateTaskStatus(h,"input_required"),await this.request(l,p,f)},authInfo:n?.authInfo,requestId:e.id,requestInfo:n?.requestInfo,taskId:o,taskStore:u,taskRequestedTtl:c?.ttl,closeSSEStream:n?.closeSSEStream,closeStandaloneSSEStream:n?.closeStandaloneSSEStream};Promise.resolve().then(()=>{c&&this.assertTaskHandlerCapability(e.method)}).then(()=>i(e,d)).then(async l=>{if(s.signal.aborted)return;let p={result:l,jsonrpc:"2.0",id:e.id};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"response",message:p,timestamp:Date.now()},r?.sessionId):await r?.send(p)},async l=>{if(s.signal.aborted)return;let p={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(l.code)?l.code:F.InternalError,message:l.message??"Internal error",...l.data!==void 0&&{data:l.data}}};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"error",message:p,timestamp:Date.now()},r?.sessionId):await r?.send(p)}).catch(l=>this._onerror(new Error(`Failed to send response: ${l}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===s&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){let{progressToken:n,...i}=e.params,r=Number(n),o=this._progressHandlers.get(r);if(!o){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let s=this._responseHandlers.get(r),c=this._timeoutInfo.get(r);if(c&&s&&c.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(u){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),s(u);return}o(i)}_onresponse(e){let n=Number(e.id),i=this._requestResolvers.get(n);if(i){if(this._requestResolvers.delete(n),fs(e))i(e);else{let s=new Z(e.error.code,e.error.message,e.error.data);i(s)}return}let r=this._responseHandlers.get(n);if(r===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(n),this._cleanupTimeout(n);let o=!1;if(fs(e)&&e.result&&typeof e.result=="object"){let s=e.result;if(s.task&&typeof s.task=="object"){let c=s.task;typeof c.taskId=="string"&&(o=!0,this._taskProgressTokens.set(c.taskId,n))}}if(o||this._progressHandlers.delete(n),fs(e))r(e);else{let s=Z.fromError(e.error.code,e.error.message,e.error.data);r(s)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,n,i){let{task:r}=i??{};if(!r){try{yield{type:"result",result:await this.request(e,n,i)}}catch(s){yield{type:"error",error:s instanceof Z?s:new Z(F.InternalError,String(s))}}return}let o;try{let s=await this.request(e,ai,i);if(s.task)o=s.task.taskId,yield{type:"taskCreated",task:s.task};else throw new Z(F.InternalError,"Task creation did not return a task");for(;;){let c=await this.getTask({taskId:o},i);if(yield{type:"taskStatus",task:c},Nn(c.status)){c.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:o},n,i)}:c.status==="failed"?yield{type:"error",error:new Z(F.InternalError,`Task ${o} failed`)}:c.status==="cancelled"&&(yield{type:"error",error:new Z(F.InternalError,`Task ${o} was cancelled`)});return}if(c.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:o},n,i)};return}let u=c.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(d=>setTimeout(d,u)),i?.signal?.throwIfAborted()}}catch(s){yield{type:"error",error:s instanceof Z?s:new Z(F.InternalError,String(s))}}}request(e,n,i){let{relatedRequestId:r,resumptionToken:o,onresumptiontoken:s,task:c,relatedTask:u}=i??{};return new Promise((d,l)=>{let p=z=>{l(z)};if(!this._transport){p(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),c&&this.assertTaskCapability(e.method)}catch(z){p(z);return}i?.signal?.throwIfAborted();let m=this._requestMessageId++,f={...e,jsonrpc:"2.0",id:m};i?.onprogress&&(this._progressHandlers.set(m,i.onprogress),f.params={...e.params,_meta:{...e.params?._meta||{},progressToken:m}}),c&&(f.params={...f.params,task:c}),u&&(f.params={...f.params,_meta:{...f.params?._meta||{},[En]:u}});let h=z=>{this._responseHandlers.delete(m),this._progressHandlers.delete(m),this._cleanupTimeout(m),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:m,reason:String(z)}},{relatedRequestId:r,resumptionToken:o,onresumptiontoken:s}).catch(U=>this._onerror(new Error(`Failed to send cancellation: ${U}`)));let D=z instanceof Z?z:new Z(F.RequestTimeout,String(z));l(D)};this._responseHandlers.set(m,z=>{if(!i?.signal?.aborted){if(z instanceof Error)return l(z);try{let D=Pn(n,z.result);D.success?d(D.data):l(D.error)}catch(D){l(D)}}}),i?.signal?.addEventListener("abort",()=>{h(i?.signal?.reason)});let y=i?.timeout??LN,v=()=>h(Z.fromError(F.RequestTimeout,"Request timed out",{timeout:y}));this._setupTimeout(m,y,i?.maxTotalTimeout,v,i?.resetTimeoutOnProgress??!1);let T=u?.taskId;if(T){let z=D=>{let U=this._responseHandlers.get(m);U?U(D):this._onerror(new Error(`Response handler missing for side-channeled request ${m}`))};this._requestResolvers.set(m,z),this._enqueueTaskMessage(T,{type:"request",message:f,timestamp:Date.now()}).catch(D=>{this._cleanupTimeout(m),l(D)})}else this._transport.send(f,{relatedRequestId:r,resumptionToken:o,onresumptiontoken:s}).catch(z=>{this._cleanupTimeout(m),l(z)})})}async getTask(e,n){return this.request({method:"tasks/get",params:e},wl,n)}async getTaskResult(e,n,i){return this.request({method:"tasks/result",params:e},n,i)}async listTasks(e,n){return this.request({method:"tasks/list",params:e},Rl,n)}async cancelTask(e,n){return this.request({method:"tasks/cancel",params:e},US,n)}async notification(e,n){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);let i=n?.relatedTask?.taskId;if(i){let c={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[En]:n.relatedTask}}};await this._enqueueTaskMessage(i,{type:"notification",message:c,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!n?.relatedRequestId&&!n?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let c={...e,jsonrpc:"2.0"};n?.relatedTask&&(c={...c,params:{...c.params,_meta:{...c.params?._meta||{},[En]:n.relatedTask}}}),this._transport?.send(c,n).catch(u=>this._onerror(u))});return}let s={...e,jsonrpc:"2.0"};n?.relatedTask&&(s={...s,params:{...s.params,_meta:{...s.params?._meta||{},[En]:n.relatedTask}}}),await this._transport.send(s,n)}setRequestHandler(e,n){let i=mg(e);this.assertRequestHandlerCapability(i),this._requestHandlers.set(i,(r,o)=>{let s=fg(e,r);return Promise.resolve(n(s,o))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,n){let i=mg(e);this._notificationHandlers.set(i,r=>{let o=fg(e,r);return Promise.resolve(n(o))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){let n=this._taskProgressTokens.get(e);n!==void 0&&(this._progressHandlers.delete(n),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,n,i){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let r=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,n,i,r)}async _clearTaskQueue(e,n){if(this._taskMessageQueue){let i=await this._taskMessageQueue.dequeueAll(e,n);for(let r of i)if(r.type==="request"&&Mh(r.message)){let o=r.message.id,s=this._requestResolvers.get(o);s?(s(new Z(F.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(o)):this._onerror(new Error(`Resolver missing for request ${o} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,n){let i=this._options?.defaultTaskPollInterval??1e3;try{let r=await this._taskStore?.getTask(e);r?.pollInterval&&(i=r.pollInterval)}catch{}return new Promise((r,o)=>{if(n.aborted){o(new Z(F.InvalidRequest,"Request cancelled"));return}let s=setTimeout(r,i);n.addEventListener("abort",()=>{clearTimeout(s),o(new Z(F.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,n){let i=this._taskStore;if(!i)throw new Error("No task store configured");return{createTask:async r=>{if(!e)throw new Error("No request provided");return await i.createTask(r,e.id,{method:e.method,params:e.params},n)},getTask:async r=>{let o=await i.getTask(r,n);if(!o)throw new Z(F.InvalidParams,"Failed to retrieve task: Task not found");return o},storeTaskResult:async(r,o,s)=>{await i.storeTaskResult(r,o,s,n);let c=await i.getTask(r,n);if(c){let u=ys.parse({method:"notifications/tasks/status",params:c});await this.notification(u),Nn(c.status)&&this._cleanupTaskProgressHandler(r)}},getTaskResult:r=>i.getTaskResult(r,n),updateTaskStatus:async(r,o,s)=>{let c=await i.getTask(r,n);if(!c)throw new Z(F.InvalidParams,`Task "${r}" not found - it may have been cleaned up`);if(Nn(c.status))throw new Z(F.InvalidParams,`Cannot update task "${r}" from terminal status "${c.status}" to "${o}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await i.updateTaskStatus(r,o,s,n);let u=await i.getTask(r,n);if(u){let d=ys.parse({method:"notifications/tasks/status",params:u});await this.notification(d),Nn(u.status)&&this._cleanupTaskProgressHandler(r)}},listTasks:r=>i.listTasks(r,n)}}};function Cx(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function zx(t,e){let n={...t};for(let i in e){let r=i,o=e[r];if(o===void 0)continue;let s=n[r];Cx(s)&&Cx(o)?n[r]={...s,...o}:n[r]=o}return n}var $w=Sy(e_(),1),ww=Sy(Iw(),1);function V1(){let t=new $w.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,ww.default)(t),t}var Nd=class{constructor(e){this._ajv=e??V1()}getValidator(e){let n="$id"in e&&typeof e.$id=="string"?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return i=>n(i)?{valid:!0,data:i,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(n.errors)}}};var Cd=class{constructor(e){this._server=e}requestStream(e,n,i){return this._server.requestStream(e,n,i)}createMessageStream(e,n){let i=this._server.getClientCapabilities();if((e.tools||e.toolChoice)&&!i?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if(e.messages.length>0){let r=e.messages[e.messages.length-1],o=Array.isArray(r.content)?r.content:[r.content],s=o.some(l=>l.type==="tool_result"),c=e.messages.length>1?e.messages[e.messages.length-2]:void 0,u=c?Array.isArray(c.content)?c.content:[c.content]:[],d=u.some(l=>l.type==="tool_use");if(s){if(o.some(l=>l.type!=="tool_result"))throw new Error("The last message must contain only tool_result content if any is present");if(!d)throw new Error("tool_result blocks are not matching any tool_use from the previous message")}if(d){let l=new Set(u.filter(m=>m.type==="tool_use").map(m=>m.id)),p=new Set(o.filter(m=>m.type==="tool_result").map(m=>m.toolUseId));if(l.size!==p.size||![...l].every(m=>p.has(m)))throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return this.requestStream({method:"sampling/createMessage",params:e},Ss,n)}elicitInputStream(e,n){let i=this._server.getClientCapabilities(),r=e.mode??"form";switch(r){case"url":{if(!i?.elicitation?.url)throw new Error("Client does not support url elicitation.");break}case"form":{if(!i?.elicitation?.form)throw new Error("Client does not support form elicitation.");break}}let o=r==="form"&&e.mode===void 0?{...e,mode:"form"}:e;return this.requestStream({method:"elicitation/create",params:o},li,n)}async getTask(e,n){return this._server.getTask({taskId:e},n)}async getTaskResult(e,n,i){return this._server.getTaskResult({taskId:e},n,i)}async listTasks(e,n){return this._server.listTasks(e?{cursor:e}:void 0,n)}async cancelTask(e,n){return this._server.cancelTask({taskId:e},n)}};function Ew(t,e,n){if(!t)throw new Error(`${n} does not support task creation (required for ${e})`);switch(e){case"tools/call":if(!t.tools?.call)throw new Error(`${n} does not support task creation for tools/call (required for ${e})`);break;default:break}}function Tw(t,e,n){if(!t)throw new Error(`${n} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!t.sampling?.createMessage)throw new Error(`${n} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!t.elicitation?.create)throw new Error(`${n} does not support task creation for elicitation/create (required for ${e})`);break;default:break}}var zd=class extends Jl{constructor(e,n){super(n),this._serverInfo=e,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(ks.options.map((i,r)=>[i,r])),this.isMessageIgnored=(i,r)=>{let o=this._loggingLevels.get(r);return o?this.LOG_LEVEL_SEVERITY.get(i)<this.LOG_LEVEL_SEVERITY.get(o):!1},this._capabilities=n?.capabilities??{},this._instructions=n?.instructions,this._jsonSchemaValidator=n?.jsonSchemaValidator??new Nd,this.setRequestHandler(Bh,i=>this._oninitialize(i)),this.setNotificationHandler(Fh,()=>this.oninitialized?.()),this._capabilities.logging&&this.setRequestHandler(Jh,async(i,r)=>{let o=r.sessionId||r.requestInfo?.headers["mcp-session-id"]||void 0,{level:s}=i.params,c=ks.safeParse(s);return c.success&&this._loggingLevels.set(o,c.data),{}})}get experimental(){return this._experimental||(this._experimental={tasks:new Cd(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=zx(this._capabilities,e)}setRequestHandler(e,n){let r=An(e)?.method;if(!r)throw new Error("Schema is missing a method literal");let o=wi(r);if(typeof o!="string")throw new Error("Schema method literal must be a string");if(o==="tools/call"){let c=async(u,d)=>{let l=Pn(ui,u);if(!l.success){let h=l.error instanceof Error?l.error.message:String(l.error);throw new Z(F.InvalidParams,`Invalid tools/call request: ${h}`)}let{params:p}=l.data,m=await Promise.resolve(n(u,d));if(p.task){let h=Pn(ai,m);if(!h.success){let y=h.error instanceof Error?h.error.message:String(h.error);throw new Z(F.InvalidParams,`Invalid task creation result: ${y}`)}return h.data}let f=Pn(jl,m);if(!f.success){let h=f.error instanceof Error?f.error.message:String(f.error);throw new Z(F.InvalidParams,`Invalid tools/call result: ${h}`)}return f.data};return super.setRequestHandler(e,c)}return super.setRequestHandler(e,n)}assertCapabilityForMethod(e){switch(e){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw new Error(`Client does not support sampling (required for ${e})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new Error(`Client does not support elicitation (required for ${e})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new Error(`Client does not support listing roots (required for ${e})`);break;case"ping":break}}assertNotificationCapability(e){switch(e){case"notifications/message":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new Error(`Server does not support notifying about resources (required for ${e})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new Error(`Server does not support notifying of tool list changes (required for ${e})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new Error(`Server does not support notifying of prompt list changes (required for ${e})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new Error(`Client does not support URL elicitation (required for ${e})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"completion/complete":if(!this._capabilities.completions)throw new Error(`Server does not support completions (required for ${e})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new Error(`Server does not support resources (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new Error(`Server does not support tools (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Server does not support tasks capability (required for ${e})`);break;case"ping":case"initialize":break}}assertTaskCapability(e){Tw(this._clientCapabilities?.tasks?.requests,e,"Client")}assertTaskHandlerCapability(e){this._capabilities&&Ew(this._capabilities.tasks?.requests,e,"Server")}async _oninitialize(e){let n=e.params.protocolVersion;return this._clientCapabilities=e.params.capabilities,this._clientVersion=e.params.clientInfo,{protocolVersion:TS.includes(n)?n:jh,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"},kl)}async createMessage(e,n){if((e.tools||e.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if(e.messages.length>0){let i=e.messages[e.messages.length-1],r=Array.isArray(i.content)?i.content:[i.content],o=r.some(d=>d.type==="tool_result"),s=e.messages.length>1?e.messages[e.messages.length-2]:void 0,c=s?Array.isArray(s.content)?s.content:[s.content]:[],u=c.some(d=>d.type==="tool_use");if(o){if(r.some(d=>d.type!=="tool_result"))throw new Error("The last message must contain only tool_result content if any is present");if(!u)throw new Error("tool_result blocks are not matching any tool_use from the previous message")}if(u){let d=new Set(c.filter(p=>p.type==="tool_use").map(p=>p.id)),l=new Set(r.filter(p=>p.type==="tool_result").map(p=>p.toolUseId));if(d.size!==l.size||![...d].every(p=>l.has(p)))throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return e.tools?this.request({method:"sampling/createMessage",params:e},Yh,n):this.request({method:"sampling/createMessage",params:e},Ss,n)}async elicitInput(e,n){switch(e.mode??"form"){case"url":{if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support url elicitation.");let r=e;return this.request({method:"elicitation/create",params:r},li,n)}case"form":{if(!this._clientCapabilities?.elicitation?.form)throw new Error("Client does not support form elicitation.");let r=e.mode==="form"?e:{...e,mode:"form"},o=await this.request({method:"elicitation/create",params:r},li,n);if(o.action==="accept"&&o.content&&r.requestedSchema)try{let c=this._jsonSchemaValidator.getValidator(r.requestedSchema)(o.content);if(!c.valid)throw new Z(F.InvalidParams,`Elicitation response content does not match requested schema: ${c.errorMessage}`)}catch(s){throw s instanceof Z?s:new Z(F.InternalError,`Error validating elicitation response: ${s instanceof Error?s.message:String(s)}`)}return o}}}createElicitationCompletionNotifier(e,n){if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:e}},n)}async listRoots(e,n){return this.request({method:"roots/list",params:e},Xh,n)}async sendLoggingMessage(e,n){if(this._capabilities.logging&&!this.isMessageIgnored(e.level,n))return this.notification({method:"notifications/message",params:e})}async sendResourceUpdated(e){return this.notification({method:"notifications/resources/updated",params:e})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}};var Ow=Symbol.for("mcp.completable");function c_(t){return!!t&&typeof t=="object"&&Ow in t}function Pw(t){return t[Ow]?.complete}var Rw;(function(t){t.Completable="McpCompletable"})(Rw||(Rw={}));var H1=/^[A-Za-z0-9._-]{1,128}$/;function G1(t){let e=[];if(t.length===0)return{isValid:!1,warnings:["Tool name cannot be empty"]};if(t.length>128)return{isValid:!1,warnings:[`Tool name exceeds maximum length of 128 characters (current: ${t.length})`]};if(t.includes(" ")&&e.push("Tool name contains spaces, which may cause parsing issues"),t.includes(",")&&e.push("Tool name contains commas, which may cause parsing issues"),(t.startsWith("-")||t.endsWith("-"))&&e.push("Tool name starts or ends with a dash, which may cause parsing issues in some contexts"),(t.startsWith(".")||t.endsWith("."))&&e.push("Tool name starts or ends with a dot, which may cause parsing issues in some contexts"),!H1.test(t)){let n=t.split("").filter(i=>!/[A-Za-z0-9._-]/.test(i)).filter((i,r,o)=>o.indexOf(i)===r);return e.push(`Tool name contains invalid characters: ${n.map(i=>`"${i}"`).join(", ")}`,"Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)"),{isValid:!1,warnings:e}}return{isValid:!0,warnings:e}}function K1(t,e){if(e.length>0){console.warn(`Tool name validation warning for "${t}":`);for(let n of e)console.warn(` - ${n}`);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 u_(t){let e=G1(t);return K1(t,e.warnings),e.isValid}var Dd=class{constructor(e){this._mcpServer=e}registerToolTask(e,n,i){let r={taskSupport:"required",...n.execution};if(r.taskSupport==="forbidden")throw new Error(`Cannot register task-based tool '${e}' with taskSupport 'forbidden'. Use registerTool() instead.`);return this._mcpServer._createRegisteredTool(e,n.title,n.description,n.inputSchema,n.outputSchema,n.annotations,r,n._meta,i)}};var jd=class{constructor(e,n){this._registeredResources={},this._registeredResourceTemplates={},this._registeredTools={},this._registeredPrompts={},this._toolHandlersInitialized=!1,this._completionHandlerInitialized=!1,this._resourceHandlersInitialized=!1,this._promptHandlersInitialized=!1,this.server=new zd(e,n)}get experimental(){return this._experimental||(this._experimental={tasks:new Dd(this)}),this._experimental}async connect(e){return await this.server.connect(e)}async close(){await this.server.close()}setToolRequestHandlers(){this._toolHandlersInitialized||(this.server.assertCanSetRequestHandler(Bn(Dl)),this.server.assertCanSetRequestHandler(Bn(ui)),this.server.registerCapabilities({tools:{listChanged:!0}}),this.server.setRequestHandler(Dl,()=>({tools:Object.entries(this._registeredTools).filter(([,e])=>e.enabled).map(([e,n])=>{let i={name:e,title:n.title,description:n.description,inputSchema:(()=>{let r=$i(n.inputSchema);return r?pg(r,{strictUnions:!0,pipeStrategy:"input"}):W1})(),annotations:n.annotations,execution:n.execution,_meta:n._meta};if(n.outputSchema){let r=$i(n.outputSchema);r&&(i.outputSchema=pg(r,{strictUnions:!0,pipeStrategy:"output"}))}return i})})),this.server.setRequestHandler(ui,async(e,n)=>{try{let i=this._registeredTools[e.params.name];if(!i)throw new Z(F.InvalidParams,`Tool ${e.params.name} not found`);if(!i.enabled)throw new Z(F.InvalidParams,`Tool ${e.params.name} disabled`);let r=!!e.params.task,o=i.execution?.taskSupport,s="createTask"in i.handler;if((o==="required"||o==="optional")&&!s)throw new Z(F.InternalError,`Tool ${e.params.name} has taskSupport '${o}' but was not registered with registerToolTask`);if(o==="required"&&!r)throw new Z(F.MethodNotFound,`Tool ${e.params.name} requires task augmentation (taskSupport: 'required')`);if(o==="optional"&&!r&&s)return await this.handleAutomaticTaskPolling(i,e,n);let c=await this.validateToolInput(i,e.params.arguments,e.params.name),u=await this.executeToolHandler(i,c,n);return r||await this.validateToolOutput(i,u,e.params.name),u}catch(i){if(i instanceof Z&&i.code===F.UrlElicitationRequired)throw i;return this.createToolError(i instanceof Error?i.message:String(i))}}),this._toolHandlersInitialized=!0)}createToolError(e){return{content:[{type:"text",text:e}],isError:!0}}async validateToolInput(e,n,i){if(!e.inputSchema)return;let o=$i(e.inputSchema)??e.inputSchema,s=await ql(o,n);if(!s.success){let c="error"in s?s.error:"Unknown error",u=Vl(c);throw new Z(F.InvalidParams,`Input validation error: Invalid arguments for tool ${i}: ${u}`)}return s.data}async validateToolOutput(e,n,i){if(!e.outputSchema||!("content"in n)||n.isError)return;if(!n.structuredContent)throw new Z(F.InvalidParams,`Output validation error: Tool ${i} has an output schema but no structured content was provided`);let r=$i(e.outputSchema),o=await ql(r,n.structuredContent);if(!o.success){let s="error"in o?o.error:"Unknown error",c=Vl(s);throw new Z(F.InvalidParams,`Output validation error: Invalid structured content for tool ${i}: ${c}`)}}async executeToolHandler(e,n,i){let r=e.handler;if("createTask"in r){if(!i.taskStore)throw new Error("No task store provided.");let s={...i,taskStore:i.taskStore};if(e.inputSchema){let c=r;return await Promise.resolve(c.createTask(n,s))}else{let c=r;return await Promise.resolve(c.createTask(s))}}if(e.inputSchema){let s=r;return await Promise.resolve(s(n,i))}else{let s=r;return await Promise.resolve(s(i))}}async handleAutomaticTaskPolling(e,n,i){if(!i.taskStore)throw new Error("No task store provided for task-capable tool.");let r=await this.validateToolInput(e,n.params.arguments,n.params.name),o=e.handler,s={...i,taskStore:i.taskStore},c=r?await Promise.resolve(o.createTask(r,s)):await Promise.resolve(o.createTask(s)),u=c.task.taskId,d=c.task,l=d.pollInterval??5e3;for(;d.status!=="completed"&&d.status!=="failed"&&d.status!=="cancelled";){await new Promise(m=>setTimeout(m,l));let p=await i.taskStore.getTask(u);if(!p)throw new Z(F.InternalError,`Task ${u} not found during polling`);d=p}return await i.taskStore.getTaskResult(u)}setCompletionRequestHandler(){this._completionHandlerInitialized||(this.server.assertCanSetRequestHandler(Bn(Ul)),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler(Ul,async e=>{switch(e.params.ref.type){case"ref/prompt":return qS(e),this.handlePromptCompletion(e,e.params.ref);case"ref/resource":return VS(e),this.handleResourceCompletion(e,e.params.ref);default:throw new Z(F.InvalidParams,`Invalid completion reference: ${e.params.ref}`)}}),this._completionHandlerInitialized=!0)}async handlePromptCompletion(e,n){let i=this._registeredPrompts[n.name];if(!i)throw new Z(F.InvalidParams,`Prompt ${n.name} not found`);if(!i.enabled)throw new Z(F.InvalidParams,`Prompt ${n.name} disabled`);if(!i.argsSchema)return da;let o=An(i.argsSchema)?.[e.params.argument.name];if(!c_(o))return da;let s=Pw(o);if(!s)return da;let c=await s(e.params.argument.value,e.params.context);return Nw(c)}async handleResourceCompletion(e,n){let i=Object.values(this._registeredResourceTemplates).find(s=>s.resourceTemplate.uriTemplate.toString()===n.uri);if(!i){if(this._registeredResources[n.uri])return da;throw new Z(F.InvalidParams,`Resource template ${e.params.ref.uri} not found`)}let r=i.resourceTemplate.completeCallback(e.params.argument.name);if(!r)return da;let o=await r(e.params.argument.value,e.params.context);return Nw(o)}setResourceRequestHandlers(){this._resourceHandlersInitialized||(this.server.assertCanSetRequestHandler(Bn(Pl)),this.server.assertCanSetRequestHandler(Bn(Al)),this.server.assertCanSetRequestHandler(Bn(Nl)),this.server.registerCapabilities({resources:{listChanged:!0}}),this.server.setRequestHandler(Pl,async(e,n)=>{let i=Object.entries(this._registeredResources).filter(([o,s])=>s.enabled).map(([o,s])=>({uri:o,name:s.name,...s.metadata})),r=[];for(let o of Object.values(this._registeredResourceTemplates)){if(!o.resourceTemplate.listCallback)continue;let s=await o.resourceTemplate.listCallback(n);for(let c of s.resources)r.push({...o.metadata,...c})}return{resources:[...i,...r]}}),this.server.setRequestHandler(Al,async()=>({resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([n,i])=>({name:n,uriTemplate:i.resourceTemplate.uriTemplate.toString(),...i.metadata}))})),this.server.setRequestHandler(Nl,async(e,n)=>{let i=new URL(e.params.uri),r=this._registeredResources[i.toString()];if(r){if(!r.enabled)throw new Z(F.InvalidParams,`Resource ${i} disabled`);return r.readCallback(i,n)}for(let o of Object.values(this._registeredResourceTemplates)){let s=o.resourceTemplate.uriTemplate.match(i.toString());if(s)return o.readCallback(i,s,n)}throw new Z(F.InvalidParams,`Resource ${i} not found`)}),this._resourceHandlersInitialized=!0)}setPromptRequestHandlers(){this._promptHandlersInitialized||(this.server.assertCanSetRequestHandler(Bn(Cl)),this.server.assertCanSetRequestHandler(Bn(zl)),this.server.registerCapabilities({prompts:{listChanged:!0}}),this.server.setRequestHandler(Cl,()=>({prompts:Object.entries(this._registeredPrompts).filter(([,e])=>e.enabled).map(([e,n])=>({name:e,title:n.title,description:n.description,arguments:n.argsSchema?J1(n.argsSchema):void 0}))})),this.server.setRequestHandler(zl,async(e,n)=>{let i=this._registeredPrompts[e.params.name];if(!i)throw new Z(F.InvalidParams,`Prompt ${e.params.name} not found`);if(!i.enabled)throw new Z(F.InvalidParams,`Prompt ${e.params.name} disabled`);if(i.argsSchema){let r=$i(i.argsSchema),o=await ql(r,e.params.arguments);if(!o.success){let u="error"in o?o.error:"Unknown error",d=Vl(u);throw new Z(F.InvalidParams,`Invalid arguments for prompt ${e.params.name}: ${d}`)}let s=o.data,c=i.callback;return await Promise.resolve(c(s,n))}else{let r=i.callback;return await Promise.resolve(r(n))}}),this._promptHandlersInitialized=!0)}resource(e,n,...i){let r;typeof i[0]=="object"&&(r=i.shift());let o=i[0];if(typeof n=="string"){if(this._registeredResources[n])throw new Error(`Resource ${n} is already registered`);let s=this._createRegisteredResource(e,void 0,n,r,o);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),s}else{if(this._registeredResourceTemplates[e])throw new Error(`Resource template ${e} is already registered`);let s=this._createRegisteredResourceTemplate(e,void 0,n,r,o);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),s}}registerResource(e,n,i,r){if(typeof n=="string"){if(this._registeredResources[n])throw new Error(`Resource ${n} is already registered`);let o=this._createRegisteredResource(e,i.title,n,i,r);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),o}else{if(this._registeredResourceTemplates[e])throw new Error(`Resource template ${e} is already registered`);let o=this._createRegisteredResourceTemplate(e,i.title,n,i,r);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),o}}_createRegisteredResource(e,n,i,r,o){let s={name:e,title:n,metadata:r,readCallback:o,enabled:!0,disable:()=>s.update({enabled:!1}),enable:()=>s.update({enabled:!0}),remove:()=>s.update({uri:null}),update:c=>{typeof c.uri<"u"&&c.uri!==i&&(delete this._registeredResources[i],c.uri&&(this._registeredResources[c.uri]=s)),typeof c.name<"u"&&(s.name=c.name),typeof c.title<"u"&&(s.title=c.title),typeof c.metadata<"u"&&(s.metadata=c.metadata),typeof c.callback<"u"&&(s.readCallback=c.callback),typeof c.enabled<"u"&&(s.enabled=c.enabled),this.sendResourceListChanged()}};return this._registeredResources[i]=s,s}_createRegisteredResourceTemplate(e,n,i,r,o){let s={resourceTemplate:i,title:n,metadata:r,readCallback:o,enabled:!0,disable:()=>s.update({enabled:!1}),enable:()=>s.update({enabled:!0}),remove:()=>s.update({name:null}),update:d=>{typeof d.name<"u"&&d.name!==e&&(delete this._registeredResourceTemplates[e],d.name&&(this._registeredResourceTemplates[d.name]=s)),typeof d.title<"u"&&(s.title=d.title),typeof d.template<"u"&&(s.resourceTemplate=d.template),typeof d.metadata<"u"&&(s.metadata=d.metadata),typeof d.callback<"u"&&(s.readCallback=d.callback),typeof d.enabled<"u"&&(s.enabled=d.enabled),this.sendResourceListChanged()}};this._registeredResourceTemplates[e]=s;let c=i.uriTemplate.variableNames;return Array.isArray(c)&&c.some(d=>!!i.completeCallback(d))&&this.setCompletionRequestHandler(),s}_createRegisteredPrompt(e,n,i,r,o){let s={title:n,description:i,argsSchema:r===void 0?void 0:ar(r),callback:o,enabled:!0,disable:()=>s.update({enabled:!1}),enable:()=>s.update({enabled:!0}),remove:()=>s.update({name:null}),update:c=>{typeof c.name<"u"&&c.name!==e&&(delete this._registeredPrompts[e],c.name&&(this._registeredPrompts[c.name]=s)),typeof c.title<"u"&&(s.title=c.title),typeof c.description<"u"&&(s.description=c.description),typeof c.argsSchema<"u"&&(s.argsSchema=ar(c.argsSchema)),typeof c.callback<"u"&&(s.callback=c.callback),typeof c.enabled<"u"&&(s.enabled=c.enabled),this.sendPromptListChanged()}};return this._registeredPrompts[e]=s,r&&Object.values(r).some(u=>{let d=u instanceof oi?u._def?.innerType:u;return c_(d)})&&this.setCompletionRequestHandler(),s}_createRegisteredTool(e,n,i,r,o,s,c,u,d){u_(e);let l={title:n,description:i,inputSchema:Aw(r),outputSchema:Aw(o),annotations:s,execution:c,_meta:u,handler:d,enabled:!0,disable:()=>l.update({enabled:!1}),enable:()=>l.update({enabled:!0}),remove:()=>l.update({name:null}),update:p=>{typeof p.name<"u"&&p.name!==e&&(typeof p.name=="string"&&u_(p.name),delete this._registeredTools[e],p.name&&(this._registeredTools[p.name]=l)),typeof p.title<"u"&&(l.title=p.title),typeof p.description<"u"&&(l.description=p.description),typeof p.paramsSchema<"u"&&(l.inputSchema=ar(p.paramsSchema)),typeof p.outputSchema<"u"&&(l.outputSchema=ar(p.outputSchema)),typeof p.callback<"u"&&(l.handler=p.callback),typeof p.annotations<"u"&&(l.annotations=p.annotations),typeof p._meta<"u"&&(l._meta=p._meta),typeof p.enabled<"u"&&(l.enabled=p.enabled),this.sendToolListChanged()}};return this._registeredTools[e]=l,this.setToolRequestHandlers(),this.sendToolListChanged(),l}tool(e,...n){if(this._registeredTools[e])throw new Error(`Tool ${e} is already registered`);let i,r,o,s;if(typeof n[0]=="string"&&(i=n.shift()),n.length>1){let u=n[0];if(l_(u))r=n.shift(),n.length>1&&typeof n[0]=="object"&&n[0]!==null&&!l_(n[0])&&(s=n.shift());else if(typeof u=="object"&&u!==null){if(Object.values(u).some(d=>typeof d=="object"&&d!==null))throw new Error(`Tool ${e} expected a Zod schema or ToolAnnotations, but received an unrecognized object`);s=n.shift()}}let c=n[0];return this._createRegisteredTool(e,void 0,i,r,o,s,{taskSupport:"forbidden"},void 0,c)}registerTool(e,n,i){if(this._registeredTools[e])throw new Error(`Tool ${e} is already registered`);let{title:r,description:o,inputSchema:s,outputSchema:c,annotations:u,_meta:d}=n;return this._createRegisteredTool(e,r,o,s,c,u,{taskSupport:"forbidden"},d,i)}prompt(e,...n){if(this._registeredPrompts[e])throw new Error(`Prompt ${e} is already registered`);let i;typeof n[0]=="string"&&(i=n.shift());let r;n.length>1&&(r=n.shift());let o=n[0],s=this._createRegisteredPrompt(e,void 0,i,r,o);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),s}registerPrompt(e,n,i){if(this._registeredPrompts[e])throw new Error(`Prompt ${e} is already registered`);let{title:r,description:o,argsSchema:s}=n,c=this._createRegisteredPrompt(e,r,o,s,i);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),c}isConnected(){return this.server.transport!==void 0}async sendLoggingMessage(e,n){return this.server.sendLoggingMessage(e,n)}sendResourceListChanged(){this.isConnected()&&this.server.sendResourceListChanged()}sendToolListChanged(){this.isConnected()&&this.server.sendToolListChanged()}sendPromptListChanged(){this.isConnected()&&this.server.sendPromptListChanged()}};var W1={type:"object",properties:{}};function Cw(t){return t!==null&&typeof t=="object"&&"parse"in t&&typeof t.parse=="function"&&"safeParse"in t&&typeof t.safeParse=="function"}function zw(t){return"_def"in t||"_zod"in t||Cw(t)}function l_(t){return typeof t!="object"||t===null||zw(t)?!1:Object.keys(t).length===0?!0:Object.values(t).some(Cw)}function Aw(t){if(t){if(l_(t))return ar(t);if(!zw(t))throw new Error("inputSchema must be a Zod schema or raw shape, received an unrecognized object");return t}}function J1(t){let e=An(t);return e?Object.entries(e).map(([n,i])=>{let r=ex(i),o=tx(i);return{name:n,description:r,required:!o}}):[]}function Bn(t){let n=An(t)?.method;if(!n)throw new Error("Schema is missing a method literal");let i=wi(n);if(typeof i=="string")return i;throw new Error("Schema method literal must be a string")}function Nw(t){return{completion:{values:t.slice(0,100),total:t.length,hasMore:t.length>100}}}var da={completion:{values:[],hasMore:!1}};var pa=a.object({endpoint:a.string().min(1).max(256).optional(),apiKey:a.string().min(1).max(256).optional(),workspace:a.string().min(1).max(256).optional(),region:a.string().min(1).max(256).optional()}).strict(),Dw=a.enum(["SUM","COUNT","MAX","UNIQUE_COUNT","LATEST"]),d_=a.object({d:a.number().int().nonnegative(),w:a.number().int().positive(),c:a.number().nonnegative(),agg:Dw.default("COUNT").optional(),valueProperty:a.string().optional(),uniqueProperty:a.string().optional(),provenance:a.enum(["plan","manual","provider"]).optional(),warnAt:a.number().min(0).max(1).optional(),scope:pa.optional()}),Y1=a.object({kind:a.literal("credential_validity")}),X1=a.object({kind:a.literal("track_only_bypass")}),Q1=a.object({kind:a.literal("lifecycle_block"),blockOn:a.array(a.string()).default(["SUSPENDED","CANCELLED","INACTIVE"]),code:a.string().default("subscription_inactive")}),eM=a.object({kind:a.literal("scope"),requireExplicit:a.boolean().default(!0)}),tM=a.object({kind:a.literal("permission"),mode:a.enum(["grace","closed"]).optional()}),nM=a.object({kind:a.literal("geo_restriction"),allow:a.array(a.string().length(2).regex(/^[A-Z]{2}$/)).optional(),block:a.array(a.string().length(2).regex(/^[A-Z]{2}$/)).optional()}).refine(t=>t.allow!==void 0||t.block!==void 0,{message:"geo_restriction requires either `allow` or `block`"}),rM=a.enum(["fixed_window","sliding_window","token_bucket"]),iM=d_.extend({kind:a.literal("rate_limit"),m:a.enum(["e","t"]).default("e"),strategy:rM.default("fixed_window"),bucket_capacity:a.number().positive().optional(),refill_rate_per_second:a.number().positive().optional()}).superRefine((t,e)=>{t.strategy==="token_bucket"?(t.bucket_capacity===void 0&&e.addIssue({code:"custom",message:"token_bucket strategy requires `bucket_capacity` (positive number)",path:["bucket_capacity"]}),t.refill_rate_per_second===void 0&&e.addIssue({code:"custom",message:"token_bucket strategy requires `refill_rate_per_second` (positive number)",path:["refill_rate_per_second"]})):(t.bucket_capacity!==void 0&&e.addIssue({code:"custom",message:`bucket_capacity is only valid when strategy === 'token_bucket' (got '${t.strategy}')`,path:["bucket_capacity"]}),t.refill_rate_per_second!==void 0&&e.addIssue({code:"custom",message:`refill_rate_per_second is only valid when strategy === 'token_bucket' (got '${t.strategy}')`,path:["refill_rate_per_second"]}))}),oM=a.enum(["fixed_window","sliding_window"]),sM=d_.extend({kind:a.literal("quota"),ovr:a.enum(["BLOCK","ALLOW_AND_BILL"]),strategy:oM.default("fixed_window")}),aM=d_.extend({kind:a.literal("credit_balance"),ovr:a.enum(["BLOCK","ALLOW_AND_BILL"])}),cM=a.object({kind:a.literal("concurrency"),dimension:a.string().min(1).max(120),limit:a.number().int().positive(),lease_ttl_seconds:a.number().int().positive().max(3600).default(60)}),uM=a.object({kind:a.literal("resource_limit"),resource:a.string().min(1).max(120),limit:a.number().int().nonnegative()}),lM=a.object({kind:a.literal("reservation"),dimension:a.string().min(1).max(120),max_outstanding:a.number().int().positive(),hold_seconds:a.number().int().positive().max(86400)}),dM=a.enum(["plan","manual","provider"]),p_=a.object({maxInputTokens:a.number().int().positive().optional(),maxOutputTokens:a.number().int().positive().optional(),maxContextTokens:a.number().int().positive().optional(),maxPayloadBytes:a.number().int().positive().optional(),enforcement:a.enum(["enforce","track"]).default("enforce"),failMode:a.enum(["open","closed"]).default("open"),tokenCountSource:a.enum(["declared","estimated"]).optional(),scope:pa.optional()}).refine(jw,{message:"capacity requires at least one ceiling (maxInputTokens / maxOutputTokens / maxContextTokens / maxPayloadBytes)"});function jw(t){return t.maxInputTokens!==void 0||t.maxOutputTokens!==void 0||t.maxContextTokens!==void 0||t.maxPayloadBytes!==void 0}var pM=a.object({kind:a.literal("capacity"),maxInputTokens:a.number().int().positive().optional(),maxOutputTokens:a.number().int().positive().optional(),maxContextTokens:a.number().int().positive().optional(),maxPayloadBytes:a.number().int().positive().optional(),enforcement:a.enum(["enforce","track"]).default("enforce"),failMode:a.enum(["open","closed"]).default("open"),tokenCountSource:a.enum(["declared","estimated"]).optional(),scope:pa.optional(),provenance:dM.optional()}).refine(jw,{message:"capacity requires at least one ceiling (maxInputTokens / maxOutputTokens / maxContextTokens / maxPayloadBytes)"}),m_=a.discriminatedUnion("kind",[Y1,X1,Q1,eM,tM,nM,iM,sM,aM,uM,cM,lM,pM]);var ma=["customer_operation","control_plane","admin_internal","background_job","webhook","healthcheck","unclassified"],AK=new Set(ma);var Ud=a.object({trafficClass:a.enum(ma),policySource:a.enum(["declared","inherited","defaulted","inferred"]),limitParticipation:a.object({profile:a.enum(["customer_usage","business_capacity","control_plane","admin_internal","platform_abuse_only","healthcheck","none"]),pools:a.array(a.string().min(1)).optional(),scopes:a.array(a.object({endpoint:a.string().optional(),apiKey:a.string().optional(),workspace:a.string().optional(),region:a.string().optional()}).passthrough()).optional(),metrics:a.array(a.string().min(1)).optional()}).passthrough(),customerBillingPolicy:a.object({customerBillable:a.boolean(),meterKey:a.string().min(1).optional(),chargeableOutcomes:a.enum(["success_only","success_and_partial","attempted","trusted_actual_usage_only"]),invoiceBehavior:a.string().optional()}).passthrough(),providerCostPolicy:a.object({providerCostTracked:a.boolean(),declaredProviderHint:a.string().optional(),declaredModelHint:a.string().optional()}).passthrough()}).passthrough();var FK=a.object({keyId:a.string().min(1),orgId:a.string().min(1),principal:a.object({subjectKind:a.enum(["member","service"]),memberId:a.string().optional(),serviceAccountId:a.string().optional(),keyId:a.string()}),businessId:a.string().min(1),compiledPlanId:a.string().min(1),entitlementHash:a.string().optional(),subjectKey:a.string().min(1),subscriptionId:a.string().min(1),currentPeriodId:a.string().optional(),currentPeriodStartMs:a.number().optional(),subscriberId:a.string().min(1),apiKeyId:a.string().nullable(),entitlementVersion:a.number(),status:a.enum(["active","revoked"]),expiresAt:a.number().nullable().optional(),subscriberStatus:a.enum(["ONBOARDING","ACTIVE","SUSPENDED"]),subscriptionStatus:a.string().min(1),environment:a.enum(["production","sandbox"]).optional(),environmentId:a.string().optional(),scopes:a.array(a.string()).readonly().optional(),entitlement:a.record(a.string(),a.unknown()).nullable().optional()});var Uw=a.object({unit:a.enum(["requests","tokens","computeMs","dollars"]),window:a.enum(["second","minute","hour","day","week","month"]),capacity:a.number()}),mM=a.object({id:a.string().min(1),slug:a.string().optional(),transportMode:a.enum(["direct","tunnel"]),verificationRequired:a.boolean().optional(),originUrl:a.string().optional(),originHostname:a.string().optional(),accessCredentialRef:a.string().optional(),policyVersion:a.string().optional()}),qK=a.object({id:a.string().min(1),origin:a.string().min(1),sandboxOrigin:a.string().nullable().optional(),authHeader:a.string().optional(),pricing:a.object({requests:a.number().optional(),tokens:a.number().optional(),computeMs:a.number().optional(),per_request:a.number().optional()}).catchall(a.number().optional()).optional(),metering:a.object({tokens:a.object({}).optional(),computeMs:a.object({}).optional(),billOn4xx:a.boolean().optional()}).optional(),tenantLimits:a.array(Uw).readonly().optional(),userLimits:a.array(Uw).readonly().optional(),environmentId:a.string().optional(),contextTokenSecret:a.string().nullable().optional(),timeoutMs:a.number().positive().optional(),idleTimeoutMs:a.number().positive().optional(),backends:a.array(mM).optional(),defaultBackendId:a.string().optional(),verificationRequired:a.boolean().optional(),allowedOrigins:a.array(a.string()).optional(),hasPublicRoutes:a.boolean().optional(),publicRoutesCompiledPlanId:a.string().min(1).optional()});var fM=a.object({perRequestMinUnitsByDim:a.record(a.string(),a.number()).optional(),creditPoolMicros:a.number().optional(),perDimUnitCostMicros:a.record(a.string(),a.number()).optional()}),hM=a.object({source:a.enum(["fixed","provider_catalog"]),meterKey:a.string(),selector:a.string().optional(),measures:a.array(a.string()),catalog:a.string().optional(),pricePolicy:a.string().optional(),markupPercent:a.number().optional(),fixedRatesMicros:a.record(a.string(),a.record(a.string(),a.number())).optional()}),gM=a.object({key:a.string(),display:a.string(),unit:a.string().optional(),aggregation:a.enum(["SUM","COUNT","MAX","UNIQUE_COUNT","LATEST"]),window:a.enum(["minute","hour","day","month","billing_period"]),enforcementType:a.string()}),bM=a.object({routeId:a.string().min(1),method:a.string(),path:a.string(),meters:a.array(a.string()).optional(),usagePolicy:Ud.optional(),policyResolutionMode:a.literal("policy").optional()}),VK=a.object({v:a.number(),sub:a.string(),compiledPlanId:a.string().min(1),planType:a.string(),ts:a.number(),constraints:a.array(m_),cv:a.number(),policyResolutionMode:a.literal("policy").optional(),dm:a.record(a.string(),a.number()),dmv:a.number().optional(),floor:fM.nullable().optional(),displayDims:a.array(a.number()).optional(),meterSemantics:a.record(a.string(),gM).optional(),rp:a.record(a.string(),hM).optional(),fr:a.array(bM).optional(),sig:a.string().min(1),sigKid:a.string().optional(),environmentId:a.string().optional()}).passthrough();var HK=a.object({subscriptionId:a.string().min(1),activePeriodId:a.string().optional(),activeCompiledPlanId:a.string().min(1),activeEntitlementHash:a.string().optional(),enforcementMode:a.enum(["STRICT","GRACE","TRACK_ONLY"]),postStreamLockouts:a.array(a.object({code:a.literal("post_stream_overspend"),reason:a.literal("usage_exhausted"),constraintKey:a.string().min(1),cycleId:a.string().min(1),dimension:a.string().min(1),currentCapacity:a.number().nonnegative(),observedUsage:a.number().nonnegative(),lockedAt:a.string().min(1),expiresAt:a.string().min(1)})).optional(),gracePeriodEndsAt:a.string().optional(),trialEndsAt:a.string().optional(),scheduledTransition:a.object({kind:a.string(),timing:a.string(),scheduledFor:a.string(),toCompiledPlanId:a.string().nullable()}).optional(),creditPool:a.object({periodStartMs:a.number(),periodEndMs:a.number(),grantedCents:a.number(),policy:a.enum(["block","allow"]),epoch:a.number()}).optional(),dedicatedShard:a.enum(["ACTIVE","DRAINING"]).optional(),memberAuthz:a.record(a.string(),a.object({permissions:a.array(a.string()),roles:a.array(a.string())})).optional(),memberAuthzComputedAt:a.number().optional(),generation:a.number(),updatedAt:a.string()});var _M=["DRAFT","ACTIVE"],WK=a.enum(_M),yM=["ONBOARDING","ACTIVE","SUSPENDED"],Mw=a.enum(yM),vM=["ACTIVE","REVOKED"],JK=a.enum(vM),kM=["BLOCK","ALLOW_AND_BILL"],Lw=a.enum(kM),SM=["ACTIVE","ARCHIVED"],YK=a.enum(SM),xM=["ACTIVE","PHASING_OUT","SUPERSEDED","ARCHIVED"],XK=a.enum(xM);var Zw=["input","output","total","cached_read_input","cache_creation_input","context","max_output","estimated_output","actual_output","streaming_output"],Md=[{id:"requests",label:"API requests",description:"Count every call \u2014 the right default for most APIs.",meters:[{key:"requests",display:"Requests",unit:"request"}]},{id:"ai-tokens",label:"AI tokens",description:"LLM-style token metering alongside calls. The gateway can estimate tokens per request and settle actuals from @farthershore/backend reports.",meters:[{key:"requests",display:"Requests",unit:"request"},{key:"tokens_used",display:"Tokens Used",unit:"token"}]},{id:"credits",label:"Credits",description:"Price work in abstract credits (e.g. one image = 5 credits). Report each call's dynamic credit cost through @farthershore/backend.",meters:[{key:"requests",display:"Requests",unit:"request"},{key:"credits",display:"Credits",unit:"credit"}]},{id:"spend",label:"Metered spend",description:"Pass-through spend in cents (OpenRouter-style) reported through @farthershore/backend. Pairs with prepaid credit wallets.",meters:[{key:"requests",display:"Requests",unit:"request"},{key:"dollars",display:"Spend",unit:"cent"}]},{id:"compute",label:"Compute time",description:"Bill milliseconds of compute, settled from @farthershore/backend reports.",meters:[{key:"requests",display:"Requests",unit:"request"},{key:"compute_ms",display:"Compute Time",unit:"ms"}]}];function Bw(t){let e=t.trim().toLowerCase();return Md.find(n=>n.id===e)}function Fw(){return Md.map(t=>t.id)}var IM="FS_RUNTIME_TOKEN";var $M={payload:"x-fs-metering",signature:"x-fs-metering-sig",token:"x-fs-metering-token"};var iW={environmentVariable:IM,presentation:$M.token,storage:"sha256-hash-only"};var qw={missingSignature:"missing_signature",malformedSignature:"malformed_signature",unknownKeyId:"unknown_key_id",jwksUnavailable:"jwks_unavailable",badSignature:"bad_signature",bodyHashMismatch:"body_hash_mismatch",routeMismatch:"route_mismatch",clockSkew:"clock_skew",expiredSignature:"expired_signature",replayedNonce:"replayed_nonce",bodyTooLarge:"body_too_large",environmentMismatch:"environment_mismatch",missingToken:"missing_token",invalidToken:"invalid_token",contextUnverified:"context_unverified",memberSubjectRequired:"member_subject_required",serviceSubjectRequired:"service_subject_required",surfaceNotAllowed:"surface_not_allowed"};var oW=10*1024*1024;var wM=["CHECKOUT_COMPLETED","PLAN_CHANGED","CANCELLED","RESTORED","UNSCHEDULED_CANCELLATION","PRICE_ROLLOVER","PAUSED","RESUMED","PLAN_CHANGE_SCHEDULED","PLAN_CHANGE_ABORTED","SCHEDULE_CREATED","SCHEDULE_UPDATED","SCHEDULE_RELEASED","SCHEDULE_COMPLETED","SCHEDULE_ABORTED","CANCEL_SCHEDULED","PAYMENT_FAILED","PAYMENT_RECOVERED","PAYMENT_RECOVERED_FROM_SUSPENDED","PAYMENT_ACTION_REQUIRED","RECURRING_PAYMENT","REFUND_PROCESSED","DISPUTE_OPENED","DISPUTE_FUNDS_WITHDRAWN","DISPUTE_CLOSED","DISPUTE_FUNDS_REINSTATED","DISPUTE_CREDIT_REVOKED","DISPUTE_CREDIT_REINSTATED","MIN_SPEND_TRUE_UP"],cW=a.enum(wM);var f_=["BRANCH_PREFIX","PULL_REQUEST","DISABLED"];var EM=a.object({d:a.number(),w:a.number(),capacity:a.number(),remaining:a.number(),windowStart:a.number(),windowEnd:a.number()}),TM=a.record(a.string(),EM),RM=a.object({allocations:a.array(a.number()),expiresAt:a.number()}),OM=a.record(a.string(),RM),PM=a.record(a.string(),a.bigint()),gW=a.object({subscriptionId:a.string(),handoffToken:a.string(),targetShardId:a.string(),policyVersion:a.number(),entitlementVersion:a.number().nullable(),windowStates:TM,activeLeases:OM,totalsByDimension:PM.optional(),billingCycleId:a.string().nullable().optional(),billingCycleStartMs:a.number().optional()});var Vw=new Set(["read","export","download"]);var Hw={org:["read","create","update","delete","manage_settings","manage_billing"],business:["read","create","update","delete","publish","archive"],plan:["read","create","update","delete","promote_version"],makertoken:["read","create","rotate","revoke"],webhook:["read","configure","rotate_secret"],persona:["read","issue","rotate","revoke"],migration:["create"],auth_provider_connection:["read","create","update","delete"],subscription:["read","cancel","restore","change_plan"],usage:["read","export"],invoice:["read","pay","download"],billing:["read","manage_subscription","refund","change_payment_method"],team:["read","invite","remove_member","change_role","manage_rbac","assign_product_role"],apikey:["read","create","rotate","revoke"],audit_log:["read","export"]},kW=Object.keys(Hw),SW=Object.fromEntries(Object.entries(Hw).map(([t,e])=>[t,{read:e.filter(n=>Vw.has(n)),write:e.filter(n=>!Vw.has(n))}]));var AM=new Set(["GET","HEAD","OPTIONS"]);function Gw(t,e){return AM.has(e.toUpperCase())?`${t}:read`:`${t}:write`}var NM={gatewayProjectRead:"gateway:project:read",gatewayResourceWrite:"gateway:resource:write",usageWrite:"usage:write",authzDeniedWrite:"authz-denied:write",reservationAuthorize:"reservation:authorize",reservationFinalize:"reservation:finalize",internalCronRun:"internal:cron:run",personaManage:"persona:manage",proxyTrust:"proxy:trust",internalAdmin:"internal:admin",agentDispatch:"agent:dispatch",buildDispatch:"build:dispatch",internalNotify:"internal:notify",analyticsQuery:"analytics:query"},EW=Object.values(NM);var CM=["managed_frontend","custom_frontend","embedded_sdk","public_api","cli","agent","webhook","admin","internal"],Ww=a.enum(CM),Kw=a.string().min(1).max(128),zM=a.object({d:a.number().int().nonnegative(),w:a.number().int().positive(),rem:a.number(),cap:a.number()}).strict(),Jw=a.object({v:a.literal(1),entV:a.number().int().nonnegative().optional(),entHash:Kw.optional(),featureGrant:a.boolean().optional(),gates:a.array(Kw).max(16).optional(),limits:a.array(zM).max(16).optional()}).strict();var DM=["resource_lifecycle_only","platform_only_request","provider_restamped","usage_policy","legacy_tenant_metering"],jM=["credentialed_gateway_work","no_resolved_credential"],zW=a.object({requestId:a.string(),eventId:a.string(),tenantId:a.string(),slug:a.string(),subscriptionId:a.string(),subscriberId:a.string(),apiKeyId:a.string().nullable(),compiledPlanId:a.string(),subscriberStatus:Mw,subscriptionStatus:a.string(),businessId:a.string(),statusCode:a.number(),path:a.string(),latencyMs:a.number(),upstreamMs:a.number().nonnegative().finite().optional(),rawDimsUnits:a.record(a.string(),a.number()),matchedRouteMeters:a.array(a.string().min(1)).optional(),servedRouteScopes:a.array(a.string().min(1)).optional(),meterSettlements:a.array(a.object({meterId:a.string(),meterType:a.enum(["exact_pre_request","estimated_then_settled","postpaid","strict_concurrency"]),reserved:a.number(),actual:a.number(),delta:a.number(),dimension:a.number().int().nonnegative(),leaseId:a.string()})).optional(),reportingAttested:a.boolean(),customerBillable:a.boolean(),platformBillable:a.boolean().optional(),customerBillableReason:a.enum(DM).optional(),platformBillableReason:a.enum(jM).optional(),postStreamPending:a.boolean().optional(),measureContext:a.record(a.string(),a.unknown()).optional(),creditUnitsConsumed:a.record(a.string(),a.number()).optional(),timestamp:a.number(),environmentId:a.string().nullable().optional(),orgId:a.string().optional(),principal:a.object({subjectKind:a.enum(["member","service"]),memberId:a.string().trim().min(1).optional(),serviceAccountId:a.string().trim().min(1).optional(),keyId:a.string().trim().min(1).optional()}).optional(),subjectKey:a.string().optional(),overageBehavior:Lw.optional(),environment:a.enum(["production","sandbox"]).optional(),surface:Ww.optional(),actionId:a.string().min(1).max(128).optional(),resourceMutationId:a.string().min(1).max(200).optional(),subjectType:a.string().min(1).max(128).optional(),subjectId:a.string().min(1).max(256).optional(),decision:Jw.optional(),decisionId:a.string().min(1).max(256).optional(),denyClass:a.enum(["quota","rate","concurrency","capacity","spend","adaptive"]).optional(),blockingConstraintId:a.string().min(1).max(256).optional(),providerSettlements:a.array(a.object({meterId:a.string(),providerReported:a.number(),reconciled:a.number()})).optional(),usagePolicyId:a.string().min(1).max(256).optional(),policySource:a.enum(["declared","inherited","defaulted","inferred"]).optional(),trafficClass:a.enum(ma).optional(),limitProfile:a.enum(["customer_usage","business_capacity","control_plane","admin_internal","platform_abuse_only","healthcheck","none"]).optional(),leaseId:a.string(),transactionId:a.string(),gatewayMetadata:a.object({shardId:a.string(),policyVersion:a.number().int().nonnegative().optional(),artifactVersion:a.number().int().nonnegative().default(0),artifactHash:a.string().regex(/^sha256_[a-f0-9]{64}$/).optional(),leaseTelemetry:a.object({consumeRequests:a.number().int().nonnegative(),localLeaseHits:a.number().int().nonnegative(),doAllocationAttempts:a.number().int().nonnegative(),doAllocationGrants:a.number().int().nonnegative(),doAllocationDenials:a.number().int().nonnegative(),doUnavailable:a.number().int().nonnegative(),doCircuitOpen:a.number().int().nonnegative(),leaseRefreshSingleflightJoins:a.number().int().nonnegative(),leaseRefreshSingleflightJoinRate:a.number().min(0).max(1),expiredLeasesReaped:a.number().int().nonnegative(),expiredLeaseReclaimedGrant:a.array(a.number().nonnegative()),reconcileRequests:a.number().int().nonnegative(),reconcilePositiveDeltas:a.number().int().nonnegative(),reconcileNoLocalLease:a.number().int().nonnegative(),doReconcileAttempts:a.number().int().nonnegative(),doReconcileFailures:a.number().int().nonnegative(),unspentLeaseRemainderReturns:a.number().int().nonnegative(),unspentLeaseRemainderReturnFailures:a.number().int().nonnegative(),unspentLeaseRemainderReturnedGrant:a.array(a.number().nonnegative()),maxObservedPositiveReconcileDelta:a.array(a.number().nonnegative()),requestToDoRatio:a.number().nonnegative(),localLeaseHitRate:a.number().min(0).max(1),localSpendRate:a.number().min(0).max(1),maxObservedActiveLeases:a.number().int().nonnegative(),maxObservedOutstandingGrant:a.array(a.number().nonnegative()),maxObservedOutstandingGrantRatio:a.number().nonnegative(),maxObservedEmergencyReserveGrant:a.array(a.number().nonnegative()),maxObservedEmergencyReserveGrantRatio:a.number().nonnegative(),maxObservedLeaseGrant:a.array(a.number().nonnegative()),maxObservedLeaseGrantRatio:a.number().nonnegative(),maxObservedLeaseTtlMs:a.number().int().nonnegative()}).optional(),artifactCacheTelemetry:a.object({reads:a.number().int().nonnegative(),l0FreshHits:a.number().int().nonnegative(),l0Misses:a.number().int().nonnegative(),l0StaleServes:a.number().int().nonnegative(),l0StaleIfErrorServes:a.number().int().nonnegative(),l0BlockingRefreshes:a.number().int().nonnegative(),l0SingleflightJoins:a.number().int().nonnegative(),l0EarlyRefreshes:a.number().int().nonnegative(),l1Hits:a.number().int().nonnegative(),l1Misses:a.number().int().nonnegative(),l1Rejected:a.number().int().nonnegative(),l1WriteFailures:a.number().int().nonnegative(),kvHits:a.number().int().nonnegative(),kvMisses:a.number().int().nonnegative(),kvTimeouts:a.number().int().nonnegative(),kvCircuitOpenReads:a.number().int().nonnegative(),resultHits:a.number().int().nonnegative(),resultMisses:a.number().int().nonnegative(),resultDenied:a.number().int().nonnegative(),resultUnavailable:a.number().int().nonnegative(),backgroundRefreshErrors:a.number().int().nonnegative(),l0HitRate:a.number().min(0).max(1),l0SingleflightJoinRate:a.number().min(0).max(1),l0EarlyRefreshRate:a.number().min(0).max(1),l1HitRate:a.number().min(0).max(1),kvHitRate:a.number().min(0).max(1),resultHitRate:a.number().min(0).max(1),staleServeRate:a.number().min(0).max(1)}).optional(),gatewayVersion:a.string()}).passthrough()}).passthrough();var UM=a.object({path:a.string(),code:a.string(),message:a.string()}),UW=a.object({reason:a.literal("schema_validation_failed"),receivedAt:a.string(),rawPayload:a.unknown(),issues:a.array(UM),consumerVersion:a.string().optional(),originalMessageId:a.string().optional()});var Yw=[{name:"subscription.created",webhook:!0,description:"A subscriber subscription was created."},{name:"subscription.updated",webhook:!0,description:"A subscriber subscription changed (plan, status, trial)."},{name:"subscription.canceled",webhook:!0,description:"A subscriber subscription was canceled."},{name:"payment.succeeded",webhook:!0,description:"A Stripe payment succeeded for a subscription."},{name:"payment.failed",webhook:!0,description:"A Stripe payment failed for a subscription."},{name:"rate_limit.exceeded",webhook:!0,description:"The gateway denied a request for exceeding a rate limit."},{name:"entitlement.changed",webhook:!0,description:"A compiled entitlement/plan was (re)published."},{name:"usage.threshold_reached",webhook:!0,description:"A metered-usage threshold was crossed."},{name:"usage.recorded",webhook:!1,description:"The gateway recorded one usage fact; the canonical usage queue remains the coordination path and the event stream is its evidence copy."},{name:"gateway.request_denied",webhook:!1,description:"The gateway denied a request during admission or enforcement and recorded the normalized LimitDecision as evidence."},{name:"change_set.created",webhook:!1,description:"A governed Evolution ChangeSet was proposed (draft created)."},{name:"change_set.approved",webhook:!1,description:"A governed Evolution ChangeSet was approved."},{name:"change_set.applied",webhook:!1,description:"A governed Evolution ChangeSet was applied to live state."},{name:"change_set.rolled_back",webhook:!1,description:"A governed Evolution ChangeSet was rolled back."},{name:"change_set.cancelled",webhook:!1,description:"A governed Evolution ChangeSet was cancelled."},{name:"billing.event_recorded",webhook:!1,description:"A BillingEvent row was recorded; the fact references it by id (the authoritative billing row is unchanged \u2014 exact-accounting invariant)."},{name:"authz.decision",webhook:!1,description:"An authorization decision (ALLOW/DENY) mirrored from the audit log onto the spine; AuditLog stays authoritative."},{name:"repo.changed",webhook:!1,description:"A default-branch push to the business's repo touched paths at least one enabled automation rule watches (payload: branch, headSha, bounded changed-path list). Emitted pre-filtered \u2014 never on every push \u2014 so path-triggered automations (e.g. legal/** changed \u2192 notify subscribers) can fire deterministically."},{name:"automation.rule_fired",webhook:!1,description:"An enabled AutomationRule matched a spine fact (trigger + all conditions held) and its actions were scheduled."},{name:"automation.action_succeeded",webhook:!1,description:"An AutomationRule action ran to success."},{name:"automation.action_failed",webhook:!1,description:"An AutomationRule action failed (will retry per the queue)."},{name:"automation.action_denied",webhook:!1,description:"An AutomationRule action was DENIED \u2014 the automation actor lacked the action's native permission (automation is a first-class authz subject, never a bypass). Recorded + audited; the action did not run."},{name:"automation.notification",webhook:!1,description:"A notification recorded by an AutomationRule `create_notification` action \u2014 a spine fact other surfaces (portal/admin) read; no separate notification runtime."},{name:"access_request.created",webhook:!1,description:"A subscriber member requested a missing permission (AccessRequest row created). Internal \u2014 the Communication layer notifies the subscriber's admins (who can grant it)."},{name:"access_request.resolved",webhook:!1,description:"A pending AccessRequest was resolved (approved or denied) by an owner/admin. Internal \u2014 notifies the subscriber's admins."},{name:"build.failed",webhook:!1,description:"A build for the business (frontend/portal or Business-SDK) failed and did not go live. Internal \u2014 the Communication layer notifies the org's members (opt-out-able, category: deployments)."},{name:"product.published",webhook:!1,description:"A business went live for the first time (DRAFT\u2192ACTIVE first publish). Internal \u2014 notifies the org's members (category: deployments)."},{name:"workflow.failed",webhook:!1,description:"A platform workflow (config apply / Stripe sync / subscription transition) reached a terminal FAILED state. Internal \u2014 notifies the org's admins (category: deployments)."},{name:"pr.review_posted",webhook:!1,description:"The platform posted (or updated) its Business-as-Code impact report on a managed-repo pull request. Internal \u2014 emails the org's members the review synopsis + a link to the PR (category: deployments)."}],MM=Yw.map(t=>t.name),Xw=Yw.filter(t=>t.webhook).map(t=>t.name),ZW=a.enum(MM);var Qw=["subscription.created","subscription.updated","subscription.canceled","payment.succeeded","payment.failed","rate_limit.exceeded","entitlement.changed","usage.threshold_reached"],h_=Qw;{let t=new Set(Xw),e=new Set(Qw),n=[...t].filter(r=>!e.has(r)),i=[...e].filter(r=>!t.has(r));if(n.length>0||i.length>0)throw new Error(`[webhooks/events] WEBHOOK_EVENT_NAMES drifted from the events catalog. Missing from order tuple: [${n.join(", ")}]; extra in order tuple: [${i.join(", ")}]. Reconcile ../events/catalog.ts (webhook: true entries) with WEBHOOK_EVENT_ORDER in this file.`)}var qi=a.enum(h_);var Lt=a.enum(["immediate","period_end"]),Vi=a.object({default:Lt.default("period_end"),when:a.object({price_increase:Lt.optional(),price_decrease:Lt.optional(),route_grant_added:Lt.optional(),route_grant_removed:Lt.optional(),limit_increased:Lt.optional(),limit_reduced:Lt.optional(),credit_increased:Lt.optional(),credit_reduced:Lt.optional(),rating_changed:Lt.optional()}).strict().default({price_increase:"period_end",price_decrease:"immediate",route_grant_added:"immediate",route_grant_removed:"period_end",limit_increased:"immediate",limit_reduced:"period_end",credit_increased:"immediate",credit_reduced:"period_end",rating_changed:"period_end"}),allowImmediatePriceIncrease:a.boolean().default(!1),allowImmediateEntitlementReduction:a.boolean().default(!1)}).strict().superRefine((t,e)=>{(t.when.price_increase??t.default)==="immediate"&&!t.allowImmediatePriceIncrease&&e.addIssue({code:"custom",path:["when","price_increase"],message:"price_increase cannot switch immediately without allowImmediatePriceIncrease: true"});for(let n of["route_grant_removed","limit_reduced","credit_reduced"])(t.when[n]??t.default)==="immediate"&&!t.allowImmediateEntitlementReduction&&e.addIssue({code:"custom",path:["when",n],message:`${n} cannot switch immediately without allowImmediateEntitlementReduction: true`})}),LM=Vi.parse({});var ZM=a.object({kind:a.literal("credit"),amount_cents:a.number().int().nonnegative(),recurs:a.boolean().optional(),expires_after_days:a.number().int().positive().optional(),label:a.string().min(1).max(120).optional()}),BM=a.object({kind:a.literal("top_up"),sku:a.string().min(1).max(120),label:a.string().min(1).max(200),price_cents:a.number().int().positive(),credit_cents:a.number().int().positive()}),Fn=a.discriminatedUnion("kind",[ZM,BM]);function eE(t){return t.kind==="credit"&&t.recurs===!0&&t.label===void 0}function tE(t){return t.kind==="credit"&&t.recurs!==!0&&t.label===void 0}function nE(t,e,n=["grants"]){if(!t)return;let i=0,r=0;for(let o of t)eE(o)?i+=1:tE(o)&&(r+=1);i>1&&e.addIssue({code:"custom",message:"At most one recurring `credit` grant (recurs:true, no label) is allowed \u2014 recurring credit is a single canonical entry.",path:n}),r>1&&e.addIssue({code:"custom",message:"At most one one-time `credit` grant (recurs:false, no label) is allowed \u2014 one-time credit is a single canonical entry.",path:n})}function rE(t){return t.grants&&t.grants.length>0?[...t.grants]:[]}function g_(t){return rE(t).find(eE)?.amount_cents??0}function Ld(t){return rE(t).find(tE)?.amount_cents??0}var FM=a.object({percent:a.number().int().min(0).max(100)}),qM=a.object({threshold_cents:a.number().int().nonnegative(),refill_cents:a.number().int().positive()}),qn=a.object({rollover:FM.optional(),auto_recharge:qM.optional()});var iE=a.enum(["linear","active_count","event_count"]);var VM=a.object({up_to:a.number().int().positive().nullable(),price_per_unit_micros:a.number().int().nonnegative()}),HM=a.object({strategy:a.enum(["graduated","volume"]),tiers:a.array(VM).min(1).max(20)}),Vn=a.object({dimension:a.string().min(1).max(64).regex(/^[a-z0-9_]+$/,"Meter dimension must be lowercase alphanumeric with underscores"),kind:iE.default("linear"),price_per_unit_micros:a.number().int().nonnegative().default(0),tiered:HM.optional(),included_units:a.number().int().positive().optional()}).superRefine((t,e)=>{if(t.tiered&&t.price_per_unit_micros>0&&e.addIssue({code:"custom",message:"`tiered` is mutually exclusive with a non-zero `price_per_unit_micros` \u2014 drop one",path:["tiered"]}),t.included_units!==void 0&&t.tiered&&e.addIssue({code:"custom",message:"`included_units` is mutually exclusive with `tiered` \u2014 a tiered schedule already expresses the included allotment as a zero-priced first tier",path:["included_units"]}),t.tiered){let n=0,i=!1;for(let r=0;r<t.tiered.tiers.length;r++){let o=t.tiered.tiers[r];if(i){e.addIssue({code:"custom",message:"Open-ended tier (`up_to: null`) must be the final tier",path:["tiered","tiers",r,"up_to"]});break}if(o.up_to===null){i=!0;continue}o.up_to<=n&&e.addIssue({code:"custom",message:`Tier upper bounds must be strictly ascending (tier ${r} = ${o.up_to} <= previous ${n})`,path:["tiered","tiers",r,"up_to"]}),n=o.up_to}i||e.addIssue({code:"custom",message:"The final tier of a `tiered` schedule must be open-ended (`up_to: null`)",path:["tiered","tiers",t.tiered.tiers.length-1,"up_to"]})}}),Hi=a.enum(["month","year"]),GM=a.object({meters:a.array(Vn).default([]),recurring_fee_cents:a.number().int().nonnegative().default(0),billing_interval:Hi.default("month"),grants:a.array(Fn).max(40).default([]),creditPolicy:qn.optional(),trial_days:a.number().int().nonnegative().default(0),max_monthly_spend_cents:a.number().int().nonnegative().optional()});var KM=a.string().min(1),WM=a.object({type:a.literal("named"),name:a.enum(["second","minute","hour","day","week","month"])}),JM=a.object({type:a.literal("custom"),seconds:a.number().int().positive(),label:a.string().optional()}),YM=a.discriminatedUnion("type",[WM,JM]),fa=a.object({dimension:KM,window:YM,capacity:a.number().nonnegative(),enforcement:a.enum(["enforce","track"]).optional(),warnAt:a.number().min(0).max(1).optional(),scope:pa.optional(),acknowledgeUnreachable:a.boolean().optional()}),iJ=a.array(fa).max(20);function XM(t){let e=/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/.exec(t);if(!e)return!1;let n=Number(e[1]),i=Number(e[2]);return n>255||i>255||Number(e[3])>255||Number(e[4])>255?!1:n===0||n===127||n===10||n===172&&i>=16&&i<=31||n===192&&i===168||n===169&&i===254||n===100&&i>=64&&i<=127||n===192&&i===0&&Number(e[3])===0||n===198&&(i===18||i===19)||n>=224}function oE(t){let e=t.trim().toLowerCase().replace(/^\[|\]$/g,"");return e.endsWith(".")&&(e=e.slice(0,-1)),e==="localhost"||e.endsWith(".localhost")||e.startsWith("::ffff:")||e==="::"||e==="::1"||e.includes(":")&&(e.startsWith("fc")||e.startsWith("fd")||/^fe[89ab][0-9a-f]:/.test(e))||/^ff[0-9a-f]{2}:/.test(e)||e.startsWith("2002:")||/^2001:0{0,4}:/.test(e)||e.includes(":")&&e.startsWith("64:ff9b:")||/^::(?:\d+\.\d+\.\d+\.\d+|[0-9a-f]{1,4}:[0-9a-f]{1,4})$/.test(e)?!0:XM(e)}var __=["GET","HEAD","POST","PUT","PATCH","DELETE"],ha=1048576,aE=1048576;function cE(t){return new TextEncoder().encode(t).byteLength}function QM(t){try{let e=JSON.stringify(t);return typeof e=="string"?cE(e):null}catch{return null}}var y_=a.string().min(1).max(64).regex(/^[a-z][a-z0-9_-]*$/,"Integration id must be lowercase alphanumeric with hyphens/underscores"),v_=a.string().min(1).max(128).regex(/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,"Header name must be a valid HTTP token").refine(t=>t!=="*","Header wildcard is not allowed").transform(t=>t.toLowerCase()),uE=new Set(["connection","keep-alive","proxy-connection","te","trailer","transfer-encoding","upgrade","content-length","content-encoding"]),lE=v_.refine(t=>!uE.has(t)&&!["host","cookie","set-cookie","authorization","proxy-authorization"].includes(t),"Browser request header is not safe"),eL=v_.refine(t=>!uE.has(t)&&!["host","cookie","set-cookie"].includes(t),"Injection header is not safe"),tL=new Set(["cache-control","etag","last-modified","link","retry-after","x-request-id","x-ratelimit-limit","x-ratelimit-remaining","x-ratelimit-reset"]),nL=v_.refine(t=>tL.has(t),"Response header is not safe to project"),rL=a.string().max(16384).refine(t=>!/[\r\n]/.test(t),"Header values cannot contain CR/LF"),dE=a.string().min(3).max(128).regex(/^[a-z0-9!#$&^_.+-]+\/[a-z0-9!#$&^_.+-]+$/i,"Content type must be an exact media type").refine(t=>!t.includes("*"),"Content type wildcards are not allowed").transform(t=>t.toLowerCase());function pE(t){return[...new Set(t)].sort((e,n)=>e<n?-1:e>n?1:0)}function Gi(t,e,n=1,i=!1){return a.array(t).min(n).max(e).superRefine((r,o)=>{if(!i)return;let s=new Set;for(let[c,u]of r.entries())s.has(u)&&o.addIssue({code:"custom",path:[c],message:`duplicate value "${u}" is not allowed`}),s.add(u)}).transform(r=>pE(r))}var iL=Gi(lE,20,0,!0),mE=a.string().min(1).max(128).regex(/^[A-Za-z0-9_.~-]+$/,"Query parameter name is invalid"),oL=Gi(mE,30,0,!0);function sL(){return a.record(a.string(),a.string().max(16384)).superRefine((t,e)=>{let n=Object.keys(t);n.length>30&&e.addIssue({code:"custom",message:"Too many query parameters"});for(let i of n)mE.safeParse(i).success||e.addIssue({code:"custom",path:[i],message:"Browser query parameter is invalid"})})}function aL(){return a.record(a.string(),rL).superRefine((t,e)=>{Object.keys(t).length>20&&e.addIssue({code:"custom",message:"Too many request headers"});let i=new Set;for(let[r,o]of Object.entries(t)){let s=lE.safeParse(r);if(!s.success){e.addIssue({code:"custom",path:[r],message:"Browser request header is not safe"});continue}i.has(s.data)&&e.addIssue({code:"custom",path:[r],message:`duplicate request header "${r}" is not allowed`}),i.add(s.data),typeof o!="string"&&e.addIssue({code:"custom",path:[r],message:"Request header value must be a string"})}}).transform(t=>Object.fromEntries(Object.entries(t).map(([e,n])=>[e.toLowerCase(),n])))}function cL(t){return t.split("/").some(e=>{let n=e.replace(/%2e/gi,".");return n==="."||n===".."})}var k_=a.string().min(1).max(500).superRefine((t,e)=>{let n=i=>{e.addIssue({code:"custom",message:i})};if(/^[a-z][a-z0-9+.-]*:\/\//i.test(t)){n(`Pass an origin-relative path, not a full URL ("${t}"). The upstream origin comes from the integration's declared \`upstream\` \u2014 e.g. "/api/projects".`);return}if(t.startsWith("//")){n('Protocol-relative paths are not allowed \u2014 "//host/x" targets another origin. Use a single leading slash.');return}if(!t.startsWith("/")){n(`Request path must start with "/" \u2014 got "${t}".`);return}if(t.includes("?")){n("Put query parameters in the `query` option, not the path \u2014 they are allowlisted per operation.");return}if(t.includes("#")){n("Fragments are never sent to a server; remove the '#'.");return}if(t.includes("\\")){n("Backslashes are not path separators; use '/'.");return}if(t.includes("*")){n("Wildcards are not allowed \u2014 an operation names one exact path so the allowlist stays decidable.");return}cL(t)&&n("Relative segments ('.' / '..') are not allowed \u2014 they could escape the declared path.")}),fE=a.string().max(2048).superRefine((t,e)=>{let n;try{n=new URL(t)}catch{e.addIssue({code:"custom",message:"Upstream must be a valid HTTPS origin"});return}n.protocol!=="https:"&&e.addIssue({code:"custom",message:"Upstream must use HTTPS"}),(n.username||n.password)&&e.addIssue({code:"custom",message:"Upstream cannot include userinfo"}),n.port&&n.port!=="443"&&e.addIssue({code:"custom",message:"Upstream must use the default HTTPS port"}),(n.pathname!=="/"||n.search||n.hash)&&e.addIssue({code:"custom",message:"Upstream must be an origin without a path, query, or fragment"}),n.hostname.includes("*")&&e.addIssue({code:"custom",message:"Upstream wildcard hosts are not allowed"}),oE(n.hostname)&&e.addIssue({code:"custom",message:"Upstream host is private or loopback"})}).transform(t=>new URL(t).origin),uL=a.discriminatedUnion("kind",[a.object({kind:a.literal("none")}).strict(),a.object({kind:a.literal("json"),maxBytes:a.number().int().positive().max(ha)}).strict(),a.object({kind:a.literal("text"),maxBytes:a.number().int().positive().max(ha),contentTypes:Gi(dE,10)}).strict()]),lL=a.string().min(1).max(500).regex(/^(?:\/(?:[^~/]|~[01])*)+$/,"Response field must be an RFC 6901 JSON pointer"),dL=a.object({kind:a.literal("json"),contentTypes:Gi(dE,10),maxBytes:a.number().int().positive().max(aE),jsonPointers:Gi(lL,100),responseHeaders:Gi(nL,20,0,!0).default([])}).strict(),sE=a.string().min(1).max(128).regex(/^[A-Z][A-Z0-9_]*$/,"secretRef must be UPPER_SNAKE"),pL=a.discriminatedUnion("location",[a.object({secretRef:sE,location:a.literal("header"),name:eL,template:a.enum(["{value}","Bearer {value}"])}).strict(),a.object({secretRef:sE,location:a.literal("query"),name:a.string().min(1).max(128).regex(/^[A-Za-z0-9_.~-]+$/,"Query parameter name is invalid")}).strict()]),mL=a.object({method:a.enum(__),path:k_,headers:iL.default([]),query:oL.default([]),body:uL}).strict(),fL=a.array(mL).min(1).max(100).superRefine((t,e)=>{let n=new Set;for(let[i,r]of t.entries()){let o=`${r.method} ${r.path}`;n.has(o)&&e.addIssue({code:"custom",path:[i],message:`duplicate frontend integration operation "${o}"`}),n.add(o)}}).transform(t=>[...t].sort((e,n)=>{let i=`${e.method} ${e.path}`,r=`${n.method} ${n.path}`;return i<r?-1:i>r?1:0})),hE=a.object({id:y_,upstream:fE,request:a.object({operations:fL}).strict(),injection:pL,response:dL}).strict().superRefine((t,e)=>{if(t.injection.location==="header")for(let[n,i]of t.request.operations.entries())i.headers.includes(t.injection.name)&&e.addIssue({code:"custom",path:["request","operations",n,"headers"],message:`browser request header collides with injected header "${t.injection.name}"`})}),gE=hE;function bE(t){if(t&&typeof t=="object"&&!Object.isFrozen(t)){Object.freeze(t);for(let e of Object.values(t))bE(e)}return t}var hL=hE.transform(t=>bE(t)),S_=a.array(gE).max(200).superRefine((t,e)=>{let n=new Set;for(let[i,r]of t.entries())n.has(r.id)&&e.addIssue({code:"custom",path:[i,"id"],message:`duplicate frontend integration id "${r.id}"`}),n.add(r.id)}).transform(t=>[...t].sort((e,n)=>e.id<n.id?-1:e.id>n.id?1:0)),x_=a.array(y_).max(200).transform(t=>pE(t)).optional(),b_=a.lazy(()=>a.union([a.null(),a.boolean(),a.number().finite(),a.string().max(65536),a.array(b_).max(100),a.record(a.string().min(1).max(128),b_).superRefine((t,e)=>{Object.keys(t).length>100&&e.addIssue({code:"custom",message:"JSON object has too many keys"})})])),gL=a.discriminatedUnion("kind",[a.object({kind:a.literal("json"),value:b_}).strict(),a.object({kind:a.literal("text"),value:a.string().max(ha)}).strict()]).superRefine((t,e)=>{let n=t.kind==="json"?QM(t.value):cE(t.value);(n===null||n>ha)&&e.addIssue({code:"custom",message:"Request body exceeds the UTF-8 byte limit"})}),bL=a.object({integrationId:y_,path:k_,method:a.enum(__),headers:aL().optional(),query:sL().optional(),body:gL.optional()}).strict();var _L={meters:a.array(Vn).default([]),recurring_fee_cents:a.number().int().nonnegative().default(0),billing_interval:Hi.default("month"),trial_days:a.number().int().nonnegative().default(0),max_monthly_spend_cents:a.number().int().nonnegative().optional(),min_monthly_spend_cents:a.number().int().nonnegative().optional(),grants:a.array(Fn).max(40).default([]),creditPolicy:qn.optional()},_E=a.object({key:a.string().min(1).max(64).regex(/^[a-z0-9_-]+$/,"Plan key must be lowercase alphanumeric with hyphens/underscores"),name:a.string().min(1).max(100),description:a.string().max(500).optional(),details:a.array(a.string().max(200)).max(10).optional(),..._L,free:a.boolean().default(!1),limits:a.array(fa).max(20).default([]),routeGrants:a.array(a.string().min(1).max(500)).max(500).transform(t=>[...new Set(t)].sort()).optional(),frontendIntegrationGrants:x_,resource_limits:a.record(a.string().min(1).max(120),a.number().int().nonnegative()).default({}),overageBehavior:a.enum(["block","allow_and_bill"]).default("block"),selfServeEnabled:a.boolean().default(!0),capacity:p_.optional(),archive:a.object({at:a.string().datetime().optional(),transitionTo:a.string().optional(),strategy:a.enum(["auto","explicit","block"]).default("auto")}).optional()}).strict(),Zd=_E.superRefine((t,e)=>{nE(t.grants,e)});var yL=/^\$\{[A-Z][A-Z0-9_]{0,127}\}$/,I_=a.string().min(3).max(200).refine(t=>yL.test(t),{message:"secret must use ${VAR} interpolation syntax (e.g. ${WEBHOOK_SECRET}); raw secrets in YAML are rejected. Define the env var in the per-product secret store and reference it here."}),$_=a.object({maxAttempts:a.number().int().min(1).max(20).default(5),backoff:a.enum(["exponential","fixed"]).default("exponential")}),w_=a.object({id:a.string().min(1).max(64).regex(/^[a-z0-9_-]+$/,"Webhook endpoint id must be lowercase alphanumeric with hyphens/underscores"),url:a.string().url("webhooks.endpoints[].url must be a valid URL"),secret:I_,events:a.array(qi).min(1,"webhooks.endpoints[].events must subscribe to \u2265 1 event"),enabled:a.boolean().default(!0),retryPolicy:$_.default({maxAttempts:5,backoff:"exponential"})}),E_=a.object({endpoints:a.array(w_).max(50).default([])});var vL=a.object({meters:a.array(Vn).optional(),recurring_fee_cents:a.number().int().nonnegative().optional(),billing_interval:Hi.optional(),grants:a.array(Fn).max(40).optional(),creditPolicy:qn.optional(),trial_days:a.number().int().nonnegative().optional(),max_monthly_spend_cents:a.number().int().nonnegative().optional(),limits:a.array(fa).max(20).optional(),overageBehavior:a.enum(["block","allow_and_bill"]).optional(),selfServeEnabled:a.boolean().optional()}).strict(),kL=a.object({url:a.string().url().optional(),secret:I_.optional(),events:a.array(qi).optional(),enabled:a.boolean().optional(),retryPolicy:$_.partial().optional()}).strict(),SL=a.object({plans:a.record(a.string(),vL).optional(),webhooks:a.object({endpoints:a.record(a.string(),kL).optional()}).strict().optional()}).strict(),T_=a.record(a.string().min(1).max(64),SL);var R_=a.enum(["query","mutation"]),O_=a.enum(["none","metadata","full"]),P_=a.object({type:a.string().min(1).max(64).regex(/^[a-zA-Z0-9_.:-]+$/),from:a.enum(["header","path_param"]),name:a.string().min(1).max(120)}),A_=a.object({resource:a.string().min(1).max(100).regex(/^[a-z0-9_.:-]+$/),effect:a.enum(["create","delete"])}),yE=a.object({id:a.string().min(1).max(160).regex(/^[a-z0-9_.:-]+$/),title:a.string().min(1).max(160).optional(),kind:R_,actorType:a.string().min(1).max(64).regex(/^[a-zA-Z0-9_.:-]+$/).optional(),subject:P_.optional(),inputSchemaRef:a.string().min(1).max(240).optional(),audit:O_.default("metadata"),resource:A_.optional()});var vE=a.enum(["subscription","subject"]),kE=a.enum(["reported","action_inferred"]),SE=a.string().min(1).max(100).regex(/^[a-z0-9_.:-]+$/),xE=a.object({name:SE,display:a.string().min(1).max(120).optional(),scope:vE.default("subscription"),subjectType:a.string().min(1).max(64).regex(/^[a-zA-Z0-9_.:-]+$/).optional(),countSource:kE.default("reported")}).superRefine((t,e)=>{t.scope==="subject"&&!t.subjectType&&e.addIssue({code:"custom",path:["subjectType"],message:"subjectType is required when resource scope is subject"}),t.scope==="subscription"&&t.subjectType&&e.addIssue({code:"custom",path:["subjectType"],message:"subjectType is only valid for subject-scoped counted resources"})}),N_=a.array(xE).max(100).default([]);var IE=/^[a-z0-9][a-z0-9_-]*$/,C_=a.string().min(1).max(64).regex(IE,"backend id must be a lowercase slug ([a-z0-9][a-z0-9_-]*)"),$E=a.enum(["direct","tunnel"]),wE=a.enum(["embedded","sidecar"]);var EE=a.object({mode:$E.default("direct"),runner:wE.optional()}).strict(),TE=a.object({required:a.boolean().default(!0)}).strict(),RE=a.object({name:a.string().min(1).max(120).optional(),slug:C_.optional(),transport:EE.default({mode:"direct"}),verification:TE.default({required:!0}),meters:a.array(a.string().min(1).max(64)).max(100).optional(),default:a.boolean().optional()}).strict(),z_=a.record(C_,RE),Ki=C_,Wi={unknownBackendInRoute:"UNKNOWN_BACKEND_IN_ROUTE",ambiguousDefaultBackend:"AMBIGUOUS_DEFAULT_BACKEND",routeMeterNotAllowedByBackend:"ROUTE_METER_NOT_ALLOWED_BY_BACKEND",unknownMeterInBackend:"UNKNOWN_METER_IN_BACKEND"};function D_(t){let e=Object.keys(t??{});if(e.length===0)return{defaultId:null,ambiguous:!1};if(e.length===1)return{defaultId:e[0],ambiguous:!1};let n=e.filter(i=>t[i]?.default===!0);return n.length===1?{defaultId:n[0],ambiguous:!1}:{defaultId:null,ambiguous:!0}}var PE=a.enum(["long","short","blocking"]).default("long");var AE=a.object({method:a.enum(["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"]),path:a.string().min(1).max(500).regex(/^\/[a-zA-Z0-9_/:.{}-]*$/,"path must be a concrete route starting with /; wildcard segments are reserved for meterRoutes selectors").refine(t=>!t.split("/").some(e=>["{__fs_rest}",":__fs_rest","[__fs_rest]"].includes(e)),"reserved greedy path parameters are only valid in non-granting meter selectors")});function xL(t){let e=t.trim();if(!e)return!1;let[n,i,r]=e.split("-");if(r!==void 0||!/^\d{3}$/.test(n??""))return!1;let o=Number(n),s=i===void 0?o:Number(i);return i!==void 0&&!/^\d{3}$/.test(i)?!1:o>=100&&o<=599&&s>=100&&s<=599&&o<=s}function NE(t){return t.split(",").every(xL)}var Bd=a.union([a.string().min(1).max(100).refine(NE,{message:"onStatusCodes must be comma-separated HTTP status codes or numeric ranges, e.g. 200-299,304"}),a.array(a.number().int().min(100).max(599)).min(1).max(100)]),CE=a.enum(["public","required"]),zE=a.enum(["network","5xx"]),DE=a.object({maxAttempts:a.number().int().min(1).max(3),retryOn:a.array(zE).min(1).max(2),backoff:a.object({base:a.number().int().min(0).max(6e4),max:a.number().int().min(0).max(6e4),jitter:a.number().min(0).max(1)}).strict().refine(t=>t.max>=t.base,{message:"retry.backoff.max must be >= retry.backoff.base"}),budgetRatio:a.number().min(0).max(1)}).strict(),jE=a.enum(["ui","api","agent","webhook","cli"]),OE=new Map(jE.options.map((t,e)=>[t,e])),IL=a.array(jE).min(1).refine(t=>t.every((e,n)=>n===0||(OE.get(e)??-1)>(OE.get(t[n-1])??-1)),{message:"surfaces must be a canonical set: unique and sorted by surface order (ui, api, agent, webhook, cli)"}),Fd=a.object({authMode:CE.optional(),timeoutMs:a.number().int().min(1).max(6e5).optional(),idleTimeoutMs:a.number().int().min(1).max(6e5).optional(),retry:DE.optional(),subject:a.enum(["member","service"]).optional(),surfaces:IL.optional(),hidden:a.boolean().optional()}).strict(),qd=a.object({dimension:a.string().min(1).max(64).default("requests"),window:a.union([a.object({type:a.literal("named"),name:a.enum(["second","minute","hour","day","week","month"])}),a.object({type:a.literal("custom"),seconds:a.number().int().positive(),label:a.string().min(1).max(64).optional()})]),capacity:a.number().nonnegative(),enforcement:a.enum(["enforce","track"]).default("enforce")}).strict(),UE=a.object({match:AE,metering:a.object({defaults:a.record(a.string().min(1).max(64),a.number().finite().nonnegative()).optional(),reports:a.array(a.string().min(1).max(64)).max(20).optional(),onStatusCodes:Bd.optional(),postStreamBilling:a.boolean().optional()}).optional(),unmetered:a.boolean().optional(),inheritDefaultMeters:a.boolean().optional(),action:a.string().min(1).max(160).regex(/^[a-z0-9_.:-]+$/).optional(),backend:Ki.optional(),usagePolicy:Ud.optional(),policy:Fd.optional(),limits:a.array(qd).min(1).max(8).optional()}).strict(),ME=a.object({rollout_key:a.string().min(1).max(120).regex(/^[a-z0-9_-]+$/,"rollout_key must be lowercase alphanumeric with hyphens/underscores").optional(),required_flags:a.array(a.string().min(1).max(120).regex(/^[a-z0-9_-]+$/)).max(10).optional()}),j_=a.object({description:a.string().max(500).optional(),mutation_class:a.enum(["runtime","contractual"]).default("contractual"),cacheProfile:PE,routes:a.array(UE).min(1).max(50),runtime:ME.default({}),actions:a.array(yE).max(100).optional(),backend:Ki.optional()}).strict();var $L="{__fs_rest}";function wL(t){if(t.startsWith(":"))return t.slice(1);if(t.startsWith("{")&&t.endsWith("}")||t.startsWith("[")&&t.endsWith("]"))return t.slice(1,-1)}function U_(t,e){let n=e.split("/").map((i,r)=>r===0?i:i==="**"||i===$L?"**":i==="*"||wL(i)!==void 0?"*":i).join("/");return`${t.toUpperCase()} ${n}`}function yr(t){return t.actionId??U_(t.method,t.path)}function LE(t,e){t.usagePricing!==void 0&&e.addIssue({code:"custom",path:["usagePricing"],message:"usagePricing is not supported. Define usage.meters.<key>.rating instead."})}function ZE(t,e){t.filter(i=>i.free).length>1&&e.addIssue({code:"custom",path:["plans"],message:"Only one free plan is allowed per product"}),t.forEach((i,r)=>{i.free&&(EL(i,r,e),TL(i,r,e))})}function EL(t,e,n){(GE(t)??0)!==0&&n.addIssue({code:"custom",path:["plans",e,"recurring_fee_cents"],message:"Free plans must have zero price"})}function TL(t,e,n){t.limits.some(r=>!r.enforcement||r.enforcement==="enforce")||n.addIssue({code:"custom",path:["plans",e,"limits"],message:"Free plans must include at least one hard enforced limit"})}function BE(t,e){let n=new Map;t.forEach((i,r)=>{if(i.free)return;let o=GE(i);if(o===void 0||o<=0)return;let s=AL(i,o),c=n.get(s);if(c){e.addIssue({code:"custom",path:["plans",r,"recurring_fee_cents"],message:`Paid plan price duplicates plan "${c}" (${s})`});return}n.set(s,i.key)})}function FE(t,e){let n=new Set((t.metering?.meters??[]).map(r=>r.key).filter(r=>typeof r=="string"&&r.length>0)),i=new Set(Object.keys(t.usage?.meters??{}));t.plans.forEach((r,o)=>{let s=r.meters;s&&s.forEach((c,u)=>{let d=c.dimension;typeof d!="string"||d.length===0||n.has(d)||i.has(d)||e.addIssue({code:"custom",path:["plans",o,"meters",u,"dimension"],message:`Plan "${r.key}" prices meter "${d}" but no metering.meters[] entry and no usage.meters[] entry declares it.`})})})}function qE(t,e){if(!t.routeCatalog)return;let n=new Set((t.metering?.meters??[]).map(r=>r.key).filter(r=>typeof r=="string"&&r.length>0)),i=!1;for(let[r,o]of Object.entries(t.routeCatalog))(o.routes??[]).forEach((c,u)=>{let d=M_(c);d.length!==0&&(i=!0,d.forEach((l,p)=>{n.has(l)||e.addIssue({code:"custom",path:["routeCatalog",r,"routes",u,"metering",p],message:`Route references unknown meter "${l}". Declare it in metering.meters[].`})}))});i&&n.size===0&&e.addIssue({code:"custom",path:["metering","meters"],message:"One or more routes declare metering keys but `metering.meters[]` is empty. Declare meters at the product level first."})}function RL(t,e){let n=new Map;for(let r of t.plans)n.set(r.key,new Set);if(!t.routeCatalog){for(let r of n.values())for(let o of e)r.add(o);return n}let i=Object.values(t.routeCatalog).flatMap(r=>r.routes??[]);for(let r of t.plans){let o=n.get(r.key),s=new Set(r.routeGrants??[]);for(let c of i){if(c.unmetered===!0||!c.path)continue;let u=yr({actionId:c.actionId,method:c.method,path:c.path});if(s.has(u))for(let d of M_(c))o.add(d)}}return n}function M_(t){let e=new Set;for(let n of Object.keys(t.metering?.defaults??{}))e.add(n);for(let n of t.metering?.reports??[])e.add(n);return[...e]}function OL(t){if(!t||typeof t!="object")return null;let e=t;return typeof e.dimension=="string"?e.dimension:null}var PL=new Set(["credits"]);function VE(t,e){if(!t.plans||t.plans.length===0)return;let n=new Set((t.metering?.meters??[]).map(o=>o.key).filter(o=>typeof o=="string"&&o.length>0)),i=new Set(Object.keys(t.usage?.meters??{})),r=RL(t,n);t.plans.forEach((o,s)=>{let c=o.limits??[],u=r.get(o.key)??new Set;c.forEach((d,l)=>{if(d&&typeof d=="object"?d.acknowledgeUnreachable===!0:!1)return;let m=OL(d);m&&(u.has(m)||i.has(m)||PL.has(m)||e.addIssue({code:"custom",path:["plans",s,"limits",l,"meter"],message:`Plan "${o.key}" limits meter "${m}" but no directly granted route emits this meter, and the meter is not declared under usage.meters either. Either add a matching routeGrants entry for a route that emits "${m}", declare the meter under metering.meters[] or usage.meters, or set acknowledgeUnreachable: true if the limit is intentional (e.g. soft budget).`}))})})}function HE(t,e){let n=t.backend;if(!n||Object.keys(n).length===0)return;let i=new Set(Object.keys(n)),r=new Set((t.metering?.meters??[]).map(u=>u.key).filter(u=>typeof u=="string"&&u.length>0));for(let[u,d]of Object.entries(n))(d.meters??[]).forEach((l,p)=>{r.has(l)||e.addIssue({code:"custom",path:["backend",u,"meters",p],message:`${Wi.unknownMeterInBackend}: backend "${u}" allows meter "${l}" but no metering.meters[] entry declares it.`})});let{defaultId:o,ambiguous:s}=D_(n),c=!1;for(let u of Object.values(t.routeCatalog??{}))for(let d of u.routes??[])d.backend===void 0&&(c=!0);s&&c&&e.addIssue({code:"custom",path:["backend"],message:`${Wi.ambiguousDefaultBackend}: product declares ${i.size} backends but no single default \u2014 mark exactly one backend \`default: true\` or bind every route explicitly.`});for(let[u,d]of Object.entries(t.routeCatalog??{}))(d.routes??[]).forEach((l,p)=>{let m=l.backend??o;if(l.backend!==void 0&&!i.has(l.backend)){e.addIssue({code:"custom",path:["routeCatalog",u,"routes",p,"backend"],message:`${Wi.unknownBackendInRoute}: route binds backend "${l.backend}" which is not declared in the product \`backend\` block.`});return}if(!m)return;let h=n[m]?.meters;if(!h)return;let y=new Set(h);for(let v of M_(l))y.has(v)||e.addIssue({code:"custom",path:["routeCatalog",u,"routes",p,"metering"],message:`${Wi.routeMeterNotAllowedByBackend}: route meters "${v}" but backend "${m}" does not allow it (backend.meters[] = [${h.join(", ")}]).`})})}function GE(t){return t.recurring_fee_cents}function AL(t,e){return`USD:month:${e}`}var NL=a.object({subdomain:a.string().min(1).max(63).regex(/^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/,"Subdomain must be lowercase alphanumeric with optional hyphens")}),KE=a.enum(["exact_pre_request","estimated_then_settled","postpaid","strict_concurrency"]),CL=a.enum(Zw),L_=a.object({key:a.string().min(1).max(64).regex(/^[a-z0-9_]+$/,"Meter key must be lowercase alphanumeric with underscores"),display:a.string().min(1).max(100),unit:a.string().max(20).optional(),routeDefault:a.number().finite().nonnegative().optional(),enforcementType:KE.default("estimated_then_settled"),aggregation:a.enum(["SUM","COUNT","MAX","UNIQUE_COUNT","LATEST"]).default("COUNT"),window:a.enum(["minute","hour","day","month","billing_period"]).default("billing_period"),valueProperty:a.string().optional(),uniqueProperty:a.string().optional(),groupBy:a.array(a.string()).optional(),eventCode:a.string().optional(),tokenCategory:CL.optional(),reserveStrategy:a.enum(["reserve_max","estimate","count_actual"]).optional(),reserveCeiling:a.number().int().positive().optional(),pairsWith:a.string().min(1).max(64).optional()}),WE=a.string().min(1).max(64).regex(/^[a-z0-9_]+$/,"Usage measure must be lowercase alphanumeric with underscores"),zL=a.enum(["pass_through","markup"]),DL=a.object({source:a.literal("fixed"),rates:a.record(a.string().min(1),a.record(WE,a.number().int().nonnegative()))}),jL=a.object({source:a.literal("provider_catalog"),catalog:a.string().min(1).max(100),pricePolicy:zL.default("pass_through"),markupPercent:a.number().nonnegative().max(1e4).optional(),marginMicros:a.number().int().nonnegative().optional()}),JE=a.discriminatedUnion("source",[DL,jL]),YE=a.object({selector:a.string().min(1).max(100).optional(),measures:a.array(WE).min(1).max(20),rating:JE.optional()}),XE=a.object({meters:a.record(a.string().min(1).max(64).regex(/^[a-z0-9_]+$/),YE)}),UL=a.object({defaults:a.record(a.string().min(1).max(64),a.number().finite().nonnegative()).optional(),reports:a.array(a.string().min(1).max(64)).max(20).optional(),onStatusCodes:Bd.optional(),postStreamBilling:a.boolean().optional()}),ML=a.object({kind:R_,title:a.string().min(1).max(160).optional(),actorType:a.string().min(1).max(64).regex(/^[a-zA-Z0-9_.:-]+$/).optional(),subject:P_.optional(),audit:O_,resource:A_.optional()}),QE=a.object({method:a.enum(["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"]),path:a.string().min(1).max(500).regex(/^\/[a-zA-Z0-9_/:.{}-]*$/,"path must be a concrete route starting with /; wildcard segments are reserved for meterRoutes selectors").refine(t=>!t.split("/").some(e=>["{__fs_rest}",":__fs_rest","[__fs_rest]"].includes(e)),"reserved greedy path parameters are only valid in non-granting meter selectors"),actionId:a.string().min(1).max(120).optional(),actionMeta:ML.optional(),unmetered:a.boolean().optional(),metering:UL.optional(),inheritDefaultMeters:a.boolean().optional(),backend:Ki.optional(),limits:a.array(qd).min(1).max(8).optional(),policy:Fd.optional()}).strict(),Z_=a.object({description:a.string().max(500).optional(),routes:a.array(QE).min(1).max(50)}),eT=a.record(a.string().min(1).max(100).regex(/^[a-z0-9_.:-]+$/),Z_),tT=a.enum(["report","pull_request"]),nT=a.enum(["safe","non_blocking","economic_risk","blocking"]),rT=a.object({cleanup:a.object({enabled:a.boolean().default(!1),mode:tT.default("report")}).default({enabled:!1,mode:"report"}),change_approval:a.object({auto_merge_max_risk:a.enum(["none","safe","non_blocking"]).default("none"),require_human_for:a.array(nT).default(["economic_risk","blocking"])}).default({auto_merge_max_risk:"none",require_human_for:["economic_risk","blocking"]})}).default({cleanup:{enabled:!1,mode:"report"},change_approval:{auto_merge_max_risk:"none",require_human_for:["economic_risk","blocking"]}}),iT=a.enum(["clerk","test-personas"]),oT=a.object({context_tokens:a.object({enabled:a.boolean().default(!0)}).optional(),portal_auth:a.object({strategy:iT}).optional()}),vr=a.object({business:a.object({visibility:a.enum(["public","private"]).default("public"),rbac:a.boolean().optional()}),gateway:a.object({authHeader:a.string().min(1).max(100).default("x-api-key"),upstreamAuth:a.object({type:a.enum(["none","static_bearer"]),token:a.string().optional()}).default({type:"none"})}),metering:a.object({meters:a.array(L_).max(10).default([]),billOn4xx:a.boolean().default(!1)}).default({meters:[],billOn4xx:!1}),backend:z_.optional(),usage:XE.optional(),usagePricing:a.never({error:"usagePricing is not supported. Define usage.meters.<key>.rating instead."}).optional(),routeCatalog:eT.optional(),resources:N_,policies:rT,customer_context:oT.optional(),frontend:a.never({error:"frontend is not authorable in Business-as-Code. Define pages and navigation in the frontend application; use route policy surfaces for API/UI callability."}).optional(),billing:a.object({applyLimitUpgradesInstantly:a.boolean().optional(),subscriberChangePolicy:Vi.default({default:"period_end",when:{price_increase:"period_end",price_decrease:"immediate",route_grant_added:"immediate",route_grant_removed:"period_end",limit_increased:"immediate",limit_reduced:"period_end",credit_increased:"immediate",credit_reduced:"period_end",rating_changed:"period_end"},allowImmediatePriceIncrease:!1,allowImmediateEntitlementReduction:!1})}).default({subscriberChangePolicy:{default:"period_end",when:{price_increase:"period_end",price_decrease:"immediate",route_grant_added:"immediate",route_grant_removed:"period_end",limit_increased:"immediate",limit_reduced:"period_end",credit_increased:"immediate",credit_reduced:"period_end",rating_changed:"period_end"},allowImmediatePriceIncrease:!1,allowImmediateEntitlementReduction:!1}}),plans:a.array(Zd).max(4).default([]),lifecycle:a.object({breaking_changes:a.object({require_deprecation_window_days:a.number().int().nonnegative().default(0),require_successor_route:a.boolean().default(!1)}).default({require_deprecation_window_days:0,require_successor_route:!1})}).default({breaking_changes:{require_deprecation_window_days:0,require_successor_route:!1}}),webhooks:E_.optional(),environments:T_.optional(),ephemeral:a.object({defaultPlan:a.string().min(1).optional()}).optional()}).superRefine((t,e)=>{LE(t,e),ZE(t.plans,e),BE(t.plans,e),FE(t,e),qE(t,e),VE(t,e),HE(t,e)}),LL=a.object({business:vr.shape.business}),ZL=a.object({gateway:vr.shape.gateway}),BL=a.object({metering:vr.shape.metering}),FL=a.object({plans:vr.shape.plans});var sT=1,aT="business",qL=`${aT}/index.ts`,VL=a.object({irVersion:a.literal(sT),sdkVersion:a.string().min(1).max(64),business:vr,routes:a.array(j_).max(200).default([]),frontendIntegrations:S_.default([])}).strict().superRefine((t,e)=>{let n=new Map;for(let[i,r]of t.routes.entries())for(let[o,s]of r.routes.entries()){let c=yr({actionId:s.action,method:s.match.method,path:s.match.path}),u=U_(s.match.method,s.match.path),d=s.action?r.actions?.find(m=>m.id===s.action):void 0,l=cT({action:d,layer:{backend:r.backend,cacheProfile:r.cacheProfile,description:r.description,mutation_class:r.mutation_class,runtime:r.runtime},route:{backend:s.backend??r.backend,inheritDefaultMeters:s.inheritDefaultMeters,limits:s.limits,metering:s.metering,policy:s.policy,unmetered:s.unmetered,usagePolicy:s.usagePolicy}}),p=n.get(c);if(p&&p.endpoint!==u){e.addIssue({code:"custom",path:["routes",i,"routes",o,"action"],message:`route id collision for "${c}": maps to both ${p.endpoint} and ${u}`});continue}if(p&&p.behavior!==l){e.addIssue({code:"custom",path:["routes",i,"routes",o],message:`conflicting route definition for "${c}"`});continue}n.set(c,{endpoint:u,behavior:l})}for(let[i,r]of t.business.plans.entries()){for(let[o,s]of(r.routeGrants??[]).entries())n.has(s)||e.addIssue({code:"custom",path:["business","plans",i,"routeGrants",o],message:`unknown route grant "${s}" for plan "${r.key}"`});for(let[o,s]of(r.frontendIntegrationGrants??[]).entries())t.frontendIntegrations.some(c=>c.id===s)||e.addIssue({code:"custom",path:["business","plans",i,"frontendIntegrationGrants",o],message:`unknown frontend integration grant "${s}" for plan "${r.key}"`})}});function cT(t){return B_(JSON.parse(JSON.stringify(t)))}function B_(t){return Array.isArray(t)?`[${t.map(B_).join(",")}]`:t&&typeof t=="object"?`{${Object.entries(t).sort(([e],[n])=>e<n?-1:e>n?1:0).map(([e,n])=>`${JSON.stringify(e)}:${B_(n)}`).join(",")}}`:JSON.stringify(t)}var T3=a.object({subscriberChangePolicy:Vi.optional()}),R3=a.object({code:a.string(),kind:a.enum(["percent_off","amount_off","free_months"]),amount:a.number().optional(),durationMonths:a.number(),applicablePlanIds:a.array(a.string()).optional(),maxRedemptions:a.number().optional(),activeFrom:a.string().optional(),activeUntil:a.string().optional(),status:a.enum(["ACTIVE","ARCHIVED"]).optional()}),O3=a.object({id:a.string(),actorUserId:a.string().optional(),action:a.string(),decision:a.string().optional(),timestamp:a.string(),details:a.unknown().optional()}),P3=a.object({name:a.string(),branch:a.string().optional(),isProduction:a.boolean().optional()}),A3=a.object({id:a.string(),name:a.string(),apiKeyId:a.string().optional()});var uT=a.object({id:a.string(),billingCycleId:a.string(),effectiveStart:a.string(),effectiveEnd:a.string(),compiledPlanId:a.string()}),lT=a.object({currentPeriod:uT,priorPeriod:uT.optional()});var HL=a.object({subjectKey:a.string(),subscriptionId:a.string(),subscriberId:a.string(),businessId:a.string(),organizationId:a.string(),compiledPlanId:a.string(),activeEntitlementHash:a.string().optional(),generation:a.number(),enforcementMode:a.enum(["STRICT","GRACE","TRACK_ONLY"]),dedicatedShard:a.enum(["ACTIVE","DRAINING"]).optional(),memberAuthz:a.record(a.string(),a.object({permissions:a.array(a.string()),roles:a.array(a.string())})).optional(),memberAuthzComputedAt:a.number().optional(),postStreamLockouts:a.array(a.object({code:a.literal("post_stream_overspend"),reason:a.literal("usage_exhausted"),constraintKey:a.string().min(1),cycleId:a.string().min(1),dimension:a.string().min(1),currentCapacity:a.number().nonnegative(),observedUsage:a.number().nonnegative(),lockedAt:a.string().min(1),expiresAt:a.string().min(1)})).optional(),subscriptionStatus:a.string(),subscriberStatus:a.string(),scopes:a.array(a.string()),periods:lT,expiresAt:a.number().optional(),trialEndsAt:a.string().optional()}),GL=a.discriminatedUnion("kind",[a.object({kind:a.literal("found"),state:HL,expiresAt:a.number(),ttlSeconds:a.number()}),a.object({kind:a.literal("not_found"),negativeCacheTtlSeconds:a.number().default(60)}),a.object({kind:a.literal("revoked"),negativeCacheTtlSeconds:a.number().default(300),reason:a.string().optional()}),a.object({kind:a.literal("rate_limited"),retryAfterSeconds:a.number().default(10)})]),F3=a.object({environmentId:a.string().nullable(),subjectKeys:a.array(a.string()).min(1).max(500)}),q3=a.object({results:a.array(a.object({subjectKey:a.string(),result:GL}))}),KL=a.object({keyId:a.string(),orgId:a.string(),businessId:a.string(),compiledPlanId:a.string(),entitlementHash:a.string().optional(),subscriptionId:a.string(),subscriberId:a.string(),apiKeyId:a.string().nullable(),subjectKey:a.string(),entitlementVersion:a.number().int(),status:a.enum(["active","revoked"]),subscriberStatus:a.enum(["ONBOARDING","ACTIVE","SUSPENDED"]),subscriptionStatus:a.string(),environment:a.enum(["production","sandbox"]).optional(),environmentId:a.string().optional(),scopes:a.array(a.string()).default([]),permissions:a.array(a.string()).optional(),roles:a.array(a.string()).optional(),entitlement:a.unknown().optional(),principal:a.object({subjectKind:a.enum(["member","service"]),memberId:a.string().optional(),serviceAccountId:a.string().optional(),keyId:a.string()}),currentPeriodId:a.string().optional(),currentPeriodStartMs:a.number().int().nonnegative().optional(),expiresAt:a.number().nullable().optional()}),V3=a.discriminatedUnion("kind",[a.object({kind:a.literal("found"),record:KL,expiresAt:a.number(),ttlSeconds:a.number()}),a.object({kind:a.literal("not_found"),negativeCacheTtlSeconds:a.number().default(60)}),a.object({kind:a.literal("revoked"),negativeCacheTtlSeconds:a.number().default(300),reason:a.string().optional()}),a.object({kind:a.literal("rate_limited"),retryAfterSeconds:a.number().default(10)})]),H3=a.discriminatedUnion("kind",[a.object({kind:a.literal("found"),entitlement:a.unknown(),expiresAt:a.number(),ttlSeconds:a.number()}),a.object({kind:a.literal("not_found"),negativeCacheTtlSeconds:a.number().default(60)}),a.object({kind:a.literal("rate_limited"),retryAfterSeconds:a.number().default(10)})]),WL=a.object({id:a.string().min(1),slug:a.string().optional(),transportMode:a.enum(["direct","tunnel"]),verificationRequired:a.boolean().optional(),originUrl:a.string().optional(),originHostname:a.string().optional(),accessCredentialRef:a.string().optional(),policyVersion:a.string().optional()}),JL=a.object({id:a.string(),origin:a.string(),sandboxOrigin:a.string().nullable().optional(),authHeader:a.string().optional(),pricing:a.record(a.string(),a.number()).optional(),metering:a.object({billOn4xx:a.boolean().optional()}).optional(),tenantLimits:a.array(a.object({unit:a.enum(["requests","tokens","computeMs","dollars"]),window:a.enum(["second","minute","hour","day","week","month"]),capacity:a.number()})).optional(),userLimits:a.array(a.object({unit:a.enum(["requests","tokens","computeMs","dollars"]),window:a.enum(["second","minute","hour","day","week","month"]),capacity:a.number()})).optional(),environmentId:a.string().optional(),contextTokenSecret:a.string().nullable().optional(),timeoutMs:a.number().positive().optional(),idleTimeoutMs:a.number().positive().optional(),backends:a.array(WL).optional(),defaultBackendId:a.string().optional(),verificationRequired:a.boolean().optional(),allowedOrigins:a.array(a.string()).optional(),hasPublicRoutes:a.boolean().optional(),publicRoutesCompiledPlanId:a.string().min(1).optional()}),G3=a.discriminatedUnion("kind",[a.object({kind:a.literal("found"),tenant:JL,expiresAt:a.number(),ttlSeconds:a.number()}),a.object({kind:a.literal("not_found"),negativeCacheTtlSeconds:a.number().default(60)}),a.object({kind:a.literal("rate_limited"),retryAfterSeconds:a.number().default(10)})]);var Vd=["consumer_api_key","consumer_session_token","test_persona_session_token","builder_master_key","builder_session_token","maker_jwt","service_jwt","internal_service","context_token"],dT=a.enum(Vd);var YL=a.object({fromIssuer:a.string().min(1),fromTokenId:a.string().min(1),intent:a.string().min(1)}),pT=a.object({issuer:a.string().min(1),issuedAt:a.number().int().nonnegative(),expiresAt:a.number().int().nonnegative().optional(),tokenId:a.string().min(1).optional(),delegationChain:a.array(YL)});var F_=["template","embedded","provisioned","agent"],XL=a.enum(F_),QL=["builder_user","builder_org","maker","consumer_subject","internal_service","service_jwt","agent_runtime"],e4=a.enum(QL),mT=a.object({kind:e4,id:a.string().min(1),label:a.string().optional()}),t4=["subscription","organization","platform"],n4=a.enum(t4),r4=a.object({kind:n4,id:a.string().min(1)}),i4=a.object({type:dT,id:a.string().min(1),hint:a.string().max(8).optional()}),o4=a.object({compiledPlanId:a.string().min(1),fromCache:a.boolean().optional()}),r5=a.object({requestId:a.string().min(1),surface:XL,builderOrgId:a.string().min(1),businessId:a.string().min(1).optional(),runtimeId:a.string().min(1).optional(),template:a.string().optional(),caller:mT,actor:mT,billingSubject:r4,credential:i4,operation:a.string().min(1),scopes:a.array(a.string()),entitlement:o4.optional(),trust:pT});var le=["template","agent"],s4=["provisioned"],fT=[...F_],de=["builder_master_key","builder_session_token","maker_jwt"],Ji=["service_jwt","internal_service"],q_=["consumer_api_key","consumer_session_token","test_persona_session_token","context_token"],hT=[...Vd],ga="subscriptions:write",a4=[{id:"businesses.create",operation:"Create a product",requiredScopes:["businesses:write"],allowedSurfaces:le,allowedCredentialTypes:de,description:"Create a new product in the builder org"},{id:"businesses.update",operation:"Update a product",requiredScopes:["businesses:write"],allowedSurfaces:le,allowedCredentialTypes:de,description:"Update product metadata or compiled config"},{id:"businesses.delete",operation:"Delete a product",requiredScopes:["businesses:write"],allowedSurfaces:le,allowedCredentialTypes:de,description:"Delete a product (soft-archive if subscriptions exist)"},{id:"businesses.read",operation:"Read a product",requiredScopes:["businesses:read"],allowedSurfaces:le,allowedCredentialTypes:de,description:"Read product metadata + compiled config"},{id:"businesses.publish",operation:"Publish a product",requiredScopes:["businesses:write"],allowedSurfaces:le,allowedCredentialTypes:de,description:"Compile + publish the product to the gateway"},{id:"plans.create",operation:"Create a plan",requiredScopes:["plans:write"],allowedSurfaces:le,allowedCredentialTypes:de,description:"Add a new plan to a product"},{id:"plans.update",operation:"Update a plan",requiredScopes:["plans:write"],allowedSurfaces:le,allowedCredentialTypes:de,description:"Update plan pricing, limits, or features"},{id:"plans.delete",operation:"Delete a plan",requiredScopes:["plans:write"],allowedSurfaces:le,allowedCredentialTypes:de,description:"Delete a plan (denied if subscriptions are attached)"},{id:"plans.publish",operation:"Publish a plan",requiredScopes:["plans:write"],allowedSurfaces:le,allowedCredentialTypes:de,description:"Mark a plan as available for new subscriptions"},{id:"subscriptions.create",operation:"Create a subscription",requiredScopes:[ga],allowedSurfaces:le,allowedCredentialTypes:[...de,...Ji],description:"Provision a new subscription for a subscriber"},{id:"subscriptions.update",operation:"Update a subscription",requiredScopes:[ga],allowedSurfaces:le,allowedCredentialTypes:[...de,...Ji],description:"Change plan, enforcement mode, or schedule"},{id:"subscriptions.cancel",operation:"Cancel a subscription",requiredScopes:[ga],allowedSurfaces:le,allowedCredentialTypes:[...de,...Ji],description:"Cancel a subscription (immediate or end-of-period)"},{id:"subscriptions.pause",operation:"Pause a subscription",requiredScopes:[ga],allowedSurfaces:le,allowedCredentialTypes:[...de,...Ji],description:"Pause a subscription (no usage, no billing)"},{id:"subscriptions.resume",operation:"Resume a subscription",requiredScopes:[ga],allowedSurfaces:le,allowedCredentialTypes:[...de,...Ji],description:"Resume a paused subscription"},{id:"subscriptions.read",operation:"Read a subscription",requiredScopes:["subscriptions:read"],allowedSurfaces:le,allowedCredentialTypes:[...de,...Ji],description:"Read subscription state and usage"},{id:"webhooks.create",operation:"Create a webhook endpoint",requiredScopes:["webhooks:write"],allowedSurfaces:le,allowedCredentialTypes:de,description:"Register a new webhook endpoint URL"},{id:"webhooks.update",operation:"Update a webhook endpoint",requiredScopes:["webhooks:write"],allowedSurfaces:le,allowedCredentialTypes:de,description:"Update endpoint URL, secret, or subscribed events"},{id:"webhooks.delete",operation:"Delete a webhook endpoint",requiredScopes:["webhooks:write"],allowedSurfaces:le,allowedCredentialTypes:de,description:"Remove a webhook endpoint"},{id:"webhooks.test",operation:"Send a test webhook payload",requiredScopes:["webhooks:write"],allowedSurfaces:le,allowedCredentialTypes:de,description:"Trigger a synthetic payload to verify an endpoint"},{id:"api-keys.create",operation:"Create an API key",requiredScopes:["api-keys:write"],allowedSurfaces:le,allowedCredentialTypes:de,description:"Mint a new consumer or master API key"},{id:"api-keys.revoke",operation:"Revoke an API key",requiredScopes:["api-keys:write"],allowedSurfaces:le,allowedCredentialTypes:de,description:"Revoke an API key (immediate invalidation)"},{id:"api-keys.read",operation:"Read API key metadata",requiredScopes:["api-keys:read"],allowedSurfaces:le,allowedCredentialTypes:de,description:"Read key id + hint + scopes (never the secret)"},{id:"organizations.create",operation:"Create an organization",requiredScopes:["orgs:write"],allowedSurfaces:["template"],allowedCredentialTypes:["builder_session_token"],description:"Create a builder org (top-level signup)"},{id:"organizations.update",operation:"Update an organization",requiredScopes:["orgs:write"],allowedSurfaces:le,allowedCredentialTypes:de,description:"Update org metadata or billing email"},{id:"members.invite",operation:"Invite a member to an organization",requiredScopes:["members:write"],allowedSurfaces:le,allowedCredentialTypes:de,description:"Send an invitation to join the org"},{id:"members.remove",operation:"Remove a member from an organization",requiredScopes:["members:write"],allowedSurfaces:le,allowedCredentialTypes:de,description:"Revoke a member's access to the org"},{id:"projects.create",operation:"Create a project",requiredScopes:["projects:write"],allowedSurfaces:le,allowedCredentialTypes:de,description:"Create a project (groups products + environments)"},{id:"environments.create",operation:"Create an environment",requiredScopes:["environments:write"],allowedSurfaces:le,allowedCredentialTypes:de,description:"Add a deployment environment (stage / branch)"},{id:"environments.delete",operation:"Delete an environment",requiredScopes:["environments:write"],allowedSurfaces:le,allowedCredentialTypes:de,description:"Remove a deployment environment"},{id:"billing.portal-redirect",operation:"Generate Stripe customer-portal redirect",requiredScopes:["billing:portal"],allowedSurfaces:le,allowedCredentialTypes:[...de,...q_],description:"Mint a one-time Stripe portal-session redirect URL"},{id:"billing.read",operation:"Read billing state",requiredScopes:["billing:read"],allowedSurfaces:le,allowedCredentialTypes:[...de,...q_],description:"Read invoices, balances, scheduled changes"},{id:"runtime-context.read",operation:"Read the caller's runtime context",requiredScopes:[],allowedSurfaces:fT,allowedCredentialTypes:hT,description:"Introspect the resolved RuntimeContext (minus secrets)"},{id:"operations.list",operation:"List registered operations",requiredScopes:[],allowedSurfaces:fT,allowedCredentialTypes:hT,description:"List all operations the registry knows about"},{id:"explain-denial.read",operation:"Explain a denial decision",requiredScopes:["audit:read"],allowedSurfaces:le,allowedCredentialTypes:de,description:"Look up a decision id + return the full ctx + reason"},{id:"replay.execute",operation:"Replay a historical billing period",requiredScopes:["replay:execute"],allowedSurfaces:le,allowedCredentialTypes:de,description:"Re-run billing for a past period; verify deltas"},{id:"rollback.execute",operation:"Execute a GitHub-driven product rollback",requiredScopes:["rollback:execute"],allowedSurfaces:le,allowedCredentialTypes:de,description:"Revert business.ts to a previous commit (dry-run capable)"},{id:"api.invoke",operation:"Invoke a consumer-facing gateway route",requiredScopes:[],allowedSurfaces:s4,allowedCredentialTypes:q_,description:"Consumer-side traffic into a deployed product (catch-all). The EntitlementEngine + RuntimeLimitEngine handle the fine-grained gating; this operation is the umbrella entry-point."}],u5=Object.freeze(a4);var c4=["BusinessApplyWorkflow","RollbackWorkflow","StripeSyncWorkflow","WebhookDispatchWorkflow","SubscriptionTransitionWorkflow","CompiledPlanLifecycleWorkflow","ShardReshardWorkflow","MaintenanceJobWorkflow"],m5=a.enum(c4),u4=["transient","permanent","rollback-required","human-intervention"],f5=a.enum(u4);var l4=["SAFE_AUTOMATIC","REQUIRES_APPROVAL","IRREVERSIBLE","BILLING_IMPACTING","EDGE_BREAKING"],h5=a.enum(l4);var k5=a.object({workflowExecutionId:a.string().min(1),eventType:a.string().min(1),phase:a.string().min(1).optional(),stepId:a.string().min(1).optional(),cohortKey:a.string().min(1).optional(),payload:a.record(a.string(),a.unknown()),occurredAt:a.string().min(1),correlationId:a.string().min(1).optional()}).transform(t=>({...t,workflowExecutionId:t.workflowExecutionId,stepId:t.stepId===void 0?void 0:t.stepId}));var d4=["GATEWAY","HOSTED_UI_PAGE","HOSTED_UI_PROXY"],p4=["platform_requests"],m4=a.object({requestId:a.string().optional(),businessId:a.string().optional(),route:a.string().optional(),usageEventId:a.string().optional()}).strict(),f4=a.object({organizationId:a.string().min(1),source:a.enum(d4),dimension:a.enum(p4),quantity:a.number().int().positive(),idempotencyKey:a.string().min(1).max(512),occurredAt:a.string().datetime(),metadata:m4.optional()}).strict(),M5=a.object({entries:a.array(f4).min(1).max(500)});var gT={contract:{label:"Managed as code",summary:"Declarative business state, canonical in the GitHub repo; the API returns 409 MANAGED_BY_CODE once published. Author via the manifest + push.",canonicalHome:"repo",mcpMayWrite:!1},operate:{label:"Runtime operation",summary:"Imperative action on the running platform; never in the repo. Tokens, usage, readiness, builds, publish triggers, runtime knobs, brand edits.",canonicalHome:"api",mcpMayWrite:!0},dual:{label:"Repo or API",summary:"Reconciles via either the repo or the API/MCP; both converge to the same state. Preview environments are the canonical example.",canonicalHome:"both",mcpMayWrite:!0}};function h4(t){return gT[t].mcpMayWrite}function g4(t){return gT[t].canonicalHome}var kr="webhooks",ba="maker-tokens",_a="promo-codes",Yi="variables",wt="change-sets",lt=t=>({reason:"repo_authored",detail:`Declare ${t} in the business repo's business/ folder and push \u2014 the platform applies it. The API accepts this write only during the DRAFT seed window and returns 409 MANAGED_BY_CODE once the business is ACTIVE + repo-linked.`}),B5=[{key:"plan.create",class:"contract",domain:"plans",unavailable:lt("the plan with `fs.plan()`")},{key:"plan.update",class:"contract",domain:"plans",unavailable:lt("the plan's new shape with `fs.plan()`")},{key:"plan.delete",class:"contract",domain:"plans",unavailable:lt("the removal (delete the `fs.plan()` call)")},{key:"plan.read",class:"contract",domain:"plans"},{key:"plan.variant.create",class:"contract",domain:"plans",unavailable:lt("the plan variant with `fs.plan()`")},{key:"plan.promote",class:"contract",domain:"plans",unavailable:lt("the promoted plan version")},{key:"plan.rollback",class:"contract",domain:"plans",unavailable:lt("the prior plan shape (revert the commit)")},{key:"route.define",class:"contract",domain:"routes",unavailable:lt("the route with `fs.route()`")},{key:"gateway.config",class:"contract",domain:"gateway",unavailable:lt("the gateway block on `fs.business()`")},{key:"auth_strategy.update",class:"contract",domain:"gateway",unavailable:lt("the auth strategy on `fs.business()`")},{key:"rate_limit.update",class:"contract",domain:"gateway",unavailable:lt("the limits on the plan or route")},{key:"meter.define",class:"contract",domain:"metering",unavailable:lt("the meter with `fs.meter()`")},{key:"backend.define",class:"contract",domain:"backends",unavailable:{reason:"repo_authored",detail:"Declare the backend with `fs.backend()` in the business repo's business/ folder and push \u2014 the platform applies it. CAUTION: unlike other contract-class writes, core does NOT yet enforce 409 MANAGED_BY_CODE on out-of-band backend-definition writes (known enforcement gap); such writes are silently overwritten by the next repo publish, so author in the repo regardless."}},{key:"webhook.define",class:"contract",domain:kr,unavailable:lt("the webhook block on `fs.business()`")},{key:"business.contract_field.update",class:"contract",domain:"businesses",unavailable:lt("the field (name / meters / subscriberChangePolicy / rbac) on `fs.business()`")},{key:"rbac.enable",class:"contract",domain:"products",unavailable:lt("the `rbac` flag on `fs.business()`")},{key:"rbac.read",class:"contract",domain:"products"},{key:"business.list",class:"operate",domain:"businesses"},{key:"business.status",class:"operate",domain:"businesses"},{key:"change_set.portal_list",class:"operate",domain:wt,sideEffect:"read",unavailable:{reason:"subscriber_portal",detail:"GET /portal/businesses/:id/me/change-sets \u2014 the subscriber org's own view of its ChangeSets, reached in the portal. The builder-plane equivalent IS a command: `farthershore proposal list` (change_set.proposal_list)."}},{key:"change_set.portal_read",class:"operate",domain:wt,sideEffect:"read",unavailable:{reason:"subscriber_portal",detail:"GET /portal/businesses/:id/me/change-sets/:changeSetId \u2014 the subscriber's own detail view. The builder-plane equivalent IS a command: `farthershore proposal get` (change_set.proposal_read)."}},{key:"apply_timeline.list",class:"operate",domain:wt},{key:"apply_timeline.read",class:"operate",domain:wt},{key:"change_set.approve",class:"operate",domain:wt,unavailable:{reason:"human_decision",detail:"Sign-off is human/portal-session-only (ADR-0013). Propose with `farthershore proposal create`, then ask a human in the subscriber org to approve it in the portal."}},{key:"change_set.apply",class:"operate",domain:wt,unavailable:{reason:"human_decision",detail:"Execution of a governed ChangeSet is human/portal-session-only (ADR-0013). Poll `farthershore proposal get` for the status a human's apply produces."}},{key:"change_set.rollback",class:"operate",domain:wt,unavailable:{reason:"human_decision",detail:"Reverting an applied ChangeSet is human/portal-session-only (ADR-0013). Ask a human in the subscriber org to roll it back in the portal."}},{key:"change_set.cancel",class:"operate",domain:wt,unavailable:{reason:"human_decision",detail:"Cancelling a governed ChangeSet is human/portal-session-only (ADR-0013), reserved for the proposer or an approver in the portal."}},{key:"change_set.propose",class:"operate",domain:wt},{key:"change_set.preview",class:"operate",domain:wt},{key:"change_set.proposal_list",class:"operate",domain:wt},{key:"change_set.proposal_read",class:"operate",domain:wt},{key:"business.delete",class:"operate",domain:"businesses"},{key:"build.trigger",class:"operate",domain:"lifecycle",unavailable:{reason:"git_triggered",detail:"The sanctioned build triggers are git events: production on a GitHub Release, a preview environment on a push to its env branch. A builder-API trigger route exists (POST /businesses/:id/frontend/deploy) but the CLI deliberately does not expose it \u2014 a third manual trigger lets what is serving diverge from git. Push or release, then `farthershore frontend status --wait`."}},{key:"frontend.deploy",class:"operate",domain:"frontend",unavailable:{reason:"git_triggered",detail:"The CLI DELIBERATELY exposes no deploy verb: production publishes on a GitHub Release, a preview environment on a push to its env branch, and a third manual trigger is another way for what is serving to diverge from git. (The builder API does mount POST /businesses/:id/frontend/deploy; the CLI intentionally does not wrap it.) Push or release, then `farthershore frontend status --wait`."}},{key:"frontend.status",class:"operate",domain:"frontend"},{key:"frontend.rollback",class:"operate",domain:"frontend"},{key:"webhook.read",class:"operate",domain:kr},{key:"webhook.create",class:"operate",domain:kr},{key:"webhook.update",class:"operate",domain:kr},{key:"webhook.delete",class:"operate",domain:kr},{key:"webhook.test",class:"operate",domain:kr},{key:"agents.list",class:"operate",domain:"agents"},{key:"agents.status",class:"operate",domain:"agents"},{key:"agents.runs.show",class:"operate",domain:"agents"},{key:"agents.enable",class:"operate",domain:"agents"},{key:"agents.disable",class:"operate",domain:"agents"},{key:"bulletin.list",class:"operate",domain:"agents"},{key:"bulletin.read",class:"operate",domain:"agents"},{key:"bulletin.ack",class:"operate",domain:"agents"},{key:"bulletin.resolve",class:"operate",domain:"agents"},{key:"webhook.delivery.read",class:"operate",domain:kr},{key:"promo_code.read",class:"operate",domain:_a},{key:"promo_code.create",class:"operate",domain:_a},{key:"promo_code.update",class:"operate",domain:_a},{key:"promo_code.archive",class:"operate",domain:_a},{key:"promo_code.reactivate",class:"operate",domain:_a},{key:"consumer.read",class:"operate",domain:"consumers"},{key:"consumer.block",class:"operate",domain:"consumers"},{key:"consumer.remove",class:"operate",domain:"consumers"},{key:"consumer.rbac.settings",class:"operate",domain:"consumers",unavailable:{reason:"subscriber_portal",detail:"GET/PUT /portal/businesses/:id/me/rbac/settings \u2014 the subscriber org toggles RBAC and picks its default role in its own portal. The builder enables the RBAC feature by declaring `rbac` on `fs.business()` and pushing (rbac.enable, repo-authored); `farthershore business rbac` only VERIFIES the accepted state (rbac.read)."}},{key:"consumer.rbac.roles",class:"operate",domain:"consumers",unavailable:{reason:"subscriber_portal",detail:"/portal/businesses/:id/me/rbac/roles \u2014 the subscriber org authors its own roles in its portal. A builder/agent may only PROPOSE a role change, via `farthershore proposal create`."}},{key:"consumer.roles.assign",class:"operate",domain:"consumers"},{key:"business_variable.read",class:"operate",domain:Yi},{key:"business_variable.create",class:"operate",domain:Yi},{key:"business_variable.rotate",class:"operate",domain:Yi},{key:"business_variable.revoke",class:"operate",domain:Yi},{key:"business_variable.delete",class:"operate",domain:Yi},{key:"business_variable.operation.read",class:"operate",domain:Yi},{key:"runtime_token.mint",class:"operate",domain:"runtime-tokens"},{key:"runtime_token.rotate",class:"operate",domain:"runtime-tokens"},{key:"runtime_token.revoke",class:"operate",domain:"runtime-tokens"},{key:"runtime_token.read",class:"operate",domain:"runtime-tokens"},{key:"maker_token.create",class:"operate",domain:ba},{key:"maker_token.revoke",class:"operate",domain:ba},{key:"maker_token.rotate",class:"operate",domain:ba},{key:"maker_token.hard_delete",class:"operate",domain:ba},{key:"maker_token.read",class:"operate",domain:ba},{key:"metering_token.mint",class:"operate",domain:"metering",unavailable:{reason:"runtime_surface",detail:"The metering credential is DERIVED from the runtime token at backend bootstrap (/runtime/*), not minted separately. Issue the runtime token with `farthershore backend tokens create --operations metering`."}},{key:"usage.report",class:"operate",domain:"usage",unavailable:{reason:"runtime_surface",detail:"Usage is reported by the running backend at request time \u2014 `usage.report(meter, n)` from @farthershore/backend. Read what it recorded with `farthershore usage summary`."}},{key:"usage.read",class:"operate",domain:"usage"},{key:"backend.create",class:"operate",domain:"backends"},{key:"backend.bind",class:"operate",domain:"backends"},{key:"backend.delete",class:"operate",domain:"backends"},{key:"backend.read",class:"operate",domain:"backends"},{key:"backend.status.read",class:"operate",domain:"backends",unavailable:{reason:"served_by_other_command",detail:"`farthershore backend list` (backend.read) already returns each backend's derived status \u2014 there is no separate status command."}},{key:"persona.bootstrap",class:"operate",domain:"personas"},{key:"persona.read",class:"operate",domain:"personas"},{key:"persona.revoke",class:"operate",domain:"personas"},{key:"brand.update",class:"operate",domain:"branding",unavailable:{reason:"served_by_other_command",detail:"`farthershore business update --display-name/--description/--icon-url/--logo-url` (registered under business.origin.update; MCP tool `fs_brand_update`) writes the brand fields."}},{key:"business.origin.update",class:"operate",domain:"businesses"},{key:"business.docs.enable",class:"operate",domain:"businesses"},{key:"business.docs.disable",class:"operate",domain:"businesses"},{key:"business.preview_env.set",class:"operate",domain:"businesses"},{key:"plan.migration_batch.create",class:"operate",domain:"plans"},{key:"business.create",class:"dual",domain:"businesses"},{key:"business.read",class:"dual",domain:"businesses"},{key:"business.publish",class:"dual",domain:"lifecycle"},{key:"business.rollback",class:"dual",domain:"lifecycle",unavailable:{reason:"not_implemented",detail:"The API exists (POST /management/businesses/:id/rollback, scope businesses:publish) but no CLI command wraps it yet. Call the endpoint directly, or revert the commit and push."}},{key:"manifest.apply",class:"dual",domain:"lifecycle",unavailable:{reason:"git_triggered",detail:"The repo pipeline applies the compiled IR on a push/release through the same neutral apply service. `farthershore validate` runs the identical verdict locally WITHOUT applying; `farthershore apply-timeline list` shows what the platform applied."}},{key:"config.apply",class:"dual",domain:"lifecycle",unavailable:{reason:"served_by_other_command",detail:"The dashboard's draft\u2192publish path for a business that is NOT code-managed; it 409s MANAGED_BY_CODE once the business is repo-linked. An agent publishes with `farthershore business publish`, or by pushing the repo."}},{key:"environment.create",class:"dual",domain:"environments"},{key:"environment.update",class:"dual",domain:"environments",unavailable:{reason:"not_implemented",detail:"No builder/maker-callable update route exists \u2014 core has only GET/POST /businesses/:id/environments and DELETE /:envName (an internal admin slug-rename exists but is service-plane only). Delete and recreate with `farthershore env delete` + `farthershore env create`."}},{key:"environment.delete",class:"dual",domain:"environments"},{key:"environment.read",class:"dual",domain:"environments"}];function bT(t,e){return e==="write"&&!h4(t)?`An MCP tool that writes cannot have operationClass "${t}": ${t}-class state is managed as code in the business repo (canonical home: ${g4(t)}). Make the tool read-only, or author the change in the manifest and push instead.`:null}var Ce={VALIDATION_ERROR:"VALIDATION_ERROR",CONFLICT:"CONFLICT",NOT_FOUND:"NOT_FOUND",NOT_IMPLEMENTED:"NOT_IMPLEMENTED",NOT_CONFIGURED:"NOT_CONFIGURED",INTERNAL_ERROR:"INTERNAL_ERROR",SERVICE_UNAVAILABLE:"SERVICE_UNAVAILABLE",RATE_LIMIT_EXCEEDED:"RATE_LIMIT_EXCEEDED",DELETE_CONFIRMATION_REQUIRED:"DELETE_CONFIRMATION_REQUIRED",MISSING_HOST:"MISSING_HOST",MISSING_CONNECTIONS:"MISSING_CONNECTIONS",SECRET_NOT_CONFIGURED:"SECRET_NOT_CONFIGURED",UNAUTHORIZED:"UNAUTHORIZED",FORBIDDEN:"FORBIDDEN",INVALID_ACCESS_KEY:"INVALID_ACCESS_KEY",AUTO_KEY_CREATION_FAILED:"AUTO_KEY_CREATION_FAILED",PERSONA_NOT_FOUND:"PERSONA_NOT_FOUND",PERSONA_REVOKED:"PERSONA_REVOKED",PERSONA_SESSIONS_NOT_SUPPORTED:"PERSONA_SESSIONS_NOT_SUPPORTED",NOT_TEST_PERSONA_ENV:"NOT_TEST_PERSONA_ENV",PERSONA_AUTH_DISABLED_IN_PROD:"PERSONA_AUTH_DISABLED_IN_PROD",MAKER_TOKEN_NOT_FOUND:"MAKER_TOKEN_NOT_FOUND",MAKER_TOKEN_NOT_REVOKED:"MAKER_TOKEN_NOT_REVOKED",MAKER_TOKEN_NO_PRODUCT:"MAKER_TOKEN_NO_PRODUCT",MAKER_TOKEN_REVOKED:"MAKER_TOKEN_REVOKED",ORGANIZATION_NOT_FOUND:"ORGANIZATION_NOT_FOUND",ORG_HAS_ACTIVE_SUBSCRIPTIONS:"ORG_HAS_ACTIVE_SUBSCRIPTIONS",ORG_HAS_OUTSTANDING_BALANCE:"ORG_HAS_OUTSTANDING_BALANCE",PERSONAL_ORG_NOT_DELETABLE:"PERSONAL_ORG_NOT_DELETABLE",PERSONAL_OWNER_IMMUTABLE:"PERSONAL_OWNER_IMMUTABLE",PERSONAL_CO_OWNER_NOT_ALLOWED:"PERSONAL_CO_OWNER_NOT_ALLOWED",PRIMARY_OWNER_TRANSFER_REQUIRED:"PRIMARY_OWNER_TRANSFER_REQUIRED",MEMBER_NOT_FOUND:"MEMBER_NOT_FOUND",INVITATION_NOT_FOUND:"INVITATION_NOT_FOUND",RBAC_REQUIRES_TEAM_ORG:"RBAC_REQUIRES_TEAM_ORG",RBAC_NOT_ENABLED_BY_PRODUCT:"RBAC_NOT_ENABLED_BY_PRODUCT",UNKNOWN_PERMISSION:"UNKNOWN_PERMISSION",CUSTOMER_NOT_FOUND:"CUSTOMER_NOT_FOUND",PRODUCT_NOT_FOUND:"PRODUCT_NOT_FOUND",PRODUCT_DELETE_BLOCKED:"PRODUCT_DELETE_BLOCKED",PRODUCT_REPO_NOT_LINKED:"PRODUCT_REPO_NOT_LINKED",PRODUCT_SCOPE_MISMATCH:"PRODUCT_SCOPE_MISMATCH",YAML_PARSE_ERROR:"YAML_PARSE_ERROR",COMPILATION_NOT_FOUND:"COMPILATION_NOT_FOUND",PLAN_NOT_FOUND:"PLAN_NOT_FOUND",PLAN_HAS_ACTIVE_SUBSCRIPTIONS:"PLAN_HAS_ACTIVE_SUBSCRIPTIONS",PLAN_SLUG_CONFLICT:"PLAN_SLUG_CONFLICT",PLAN_REQUIRED:"PLAN_REQUIRED",PLAN_UPGRADE_REQUIRED:"PLAN_UPGRADE_REQUIRED",PLAN_OFFER_CHANGED:"PLAN_OFFER_CHANGED",SLUG_CONFLICT:"SLUG_CONFLICT",SLUG_BLOCKED:"SLUG_BLOCKED",SLUG_OFFENSIVE:"SLUG_OFFENSIVE",SLUG_RESERVED:"SLUG_RESERVED",SLUG_IMPERSONATION:"SLUG_IMPERSONATION",SLUG_INVALID_FORMAT:"SLUG_INVALID_FORMAT",SLUG_VALIDATOR_NOT_READY:"SLUG_VALIDATOR_NOT_READY",PRICING_PREVIEW_FAILED:"PRICING_PREVIEW_FAILED",PRICING_REPLAY_FAILED:"PRICING_REPLAY_FAILED",RESERVATION_NOT_FOUND:"RESERVATION_NOT_FOUND",PROMO_CODE_NOT_FOUND:"PROMO_CODE_NOT_FOUND",PROMO_CODE_INVALID:"PROMO_CODE_INVALID",BILLING_EVENT_NOT_FOUND:"BILLING_EVENT_NOT_FOUND",BILLING_NOT_CONFIGURED:"BILLING_NOT_CONFIGURED",SUBSCRIPTION_NOT_READY:"SUBSCRIPTION_NOT_READY",SUBSCRIPTION_FETCH_FAILED:"SUBSCRIPTION_FETCH_FAILED",INVALID_STATE:"INVALID_STATE",DUPLICATE_TRANSITION:"DUPLICATE_TRANSITION",ARCHIVED_TARGET:"ARCHIVED_TARGET",FREE_TO_PAID_VIA_CHECKOUT_ONLY:"FREE_TO_PAID_VIA_CHECKOUT_ONLY",RESOURCE_LIMIT_EXCEEDED:"RESOURCE_LIMIT_EXCEEDED",RESOURCE_LIMIT_CHECK_UNAVAILABLE:"RESOURCE_LIMIT_CHECK_UNAVAILABLE",STRIPE_NOT_CONFIGURED:"STRIPE_NOT_CONFIGURED",STRIPE_BALANCE_OUTSTANDING:"STRIPE_BALANCE_OUTSTANDING",STRIPE_OPERATION_FAILED:"STRIPE_OPERATION_FAILED",STRIPE_RESYNC_FAILED:"STRIPE_RESYNC_FAILED",CHECKOUT_SESSION_FAILED:"CHECKOUT_SESSION_FAILED",POLAR_PRODUCT_NOT_CONFIGURED:"POLAR_PRODUCT_NOT_CONFIGURED",BILLING_TAX_NOT_ENROLLED:"BILLING_TAX_NOT_ENROLLED",WEBHOOK_NOT_FOUND:"WEBHOOK_NOT_FOUND",WEBHOOK_DISPATCH_FAILED:"WEBHOOK_DISPATCH_FAILED",WEBHOOK_SECRET_NOT_CONFIGURED:"WEBHOOK_SECRET_NOT_CONFIGURED",INVALID_WEBHOOK_SIGNATURE:"INVALID_WEBHOOK_SIGNATURE",MISSING_RAW_BODY:"MISSING_RAW_BODY",WEBHOOK_REDIRECTED:"WEBHOOK_REDIRECTED",MANAGED_BY_CODE:"MANAGED_BY_CODE",GITHUB_CONNECTION_NOT_FOUND:"GITHUB_CONNECTION_NOT_FOUND",GITHUB_NOT_CONNECTED:"GITHUB_NOT_CONNECTED",GITHUB_SYNC_FAILED:"GITHUB_SYNC_FAILED",GITHUB_SYNC_UNAVAILABLE:"GITHUB_SYNC_UNAVAILABLE",GITHUB_TOKEN_FAILED:"GITHUB_TOKEN_FAILED",GIT_PROVIDER_NOT_CONFIGURED:"GIT_PROVIDER_NOT_CONFIGURED",ENVIRONMENT_NOT_FOUND:"ENVIRONMENT_NOT_FOUND",ENVIRONMENT_CLEANUP_FAILED:"ENVIRONMENT_CLEANUP_FAILED",DEPLOYMENT_RUN_NOT_FOUND:"DEPLOYMENT_RUN_NOT_FOUND",BRANCH_NO_MATCHING_ENV:"BRANCH_NO_MATCHING_ENV",APPLY_SPEC_FAILED:"APPLY_SPEC_FAILED",BOOTSTRAP_FAILED:"BOOTSTRAP_FAILED",JOB_ALREADY_RUNNING:"JOB_ALREADY_RUNNING",LOGO_DELETE_FAILED:"LOGO_DELETE_FAILED",LOGO_UPLOAD_FAILED:"LOGO_UPLOAD_FAILED",INVALID_LOGO_FORMAT:"INVALID_LOGO_FORMAT",CHANGE_SET_STALE:"CHANGE_SET_STALE",SIMULATION_STALE:"SIMULATION_STALE",IDEMPOTENCY_KEY_REUSED:"IDEMPOTENCY_KEY_REUSED",SELF_APPROVAL_FORBIDDEN:"SELF_APPROVAL_FORBIDDEN",HUMAN_APPROVAL_REQUIRED:"HUMAN_APPROVAL_REQUIRED",GOVERNED_BY_CHANGE_SET:"GOVERNED_BY_CHANGE_SET",COMPENSATION_REQUIRED:"COMPENSATION_REQUIRED",MIGRATION_TOO_LARGE:"MIGRATION_TOO_LARGE"};var V5={missing_token:Ce.UNAUTHORIZED,invalid_token:Ce.UNAUTHORIZED,context_unverified:Ce.UNAUTHORIZED,missing_signature:Ce.UNAUTHORIZED,malformed_signature:Ce.UNAUTHORIZED,unknown_key_id:Ce.UNAUTHORIZED,bad_signature:Ce.UNAUTHORIZED,expired_signature:Ce.UNAUTHORIZED,clock_skew:Ce.UNAUTHORIZED,replayed_nonce:Ce.UNAUTHORIZED,body_hash_mismatch:Ce.UNAUTHORIZED,route_mismatch:Ce.UNAUTHORIZED,environment_mismatch:Ce.UNAUTHORIZED,jwks_unavailable:Ce.SERVICE_UNAVAILABLE,body_too_large:Ce.VALIDATION_ERROR,member_subject_required:Ce.FORBIDDEN,service_subject_required:Ce.FORBIDDEN,surface_not_allowed:Ce.FORBIDDEN};var H5=Object.values(qw);var xe={BATCHER_ENUM:"batcher-enum",RUNTIME_INLINE:"runtime-inline",CONSTRAINT:"constraint",GATEWAY_ERROR:"gateway-error"};var _T={limit_allocator_unavailable:{statuses:[503],source:xe.BATCHER_ENUM,retryAfter:!0,verifiedAt:["engine/enforcement/runtime.ts:471"]},limit_exceeded:{statuses:[402],source:xe.BATCHER_ENUM,retryAfter:!0,verifiedAt:["engine/enforcement/batcher.ts:326","engine/enforcement/constraints/quota.ts:69"]},rate_limited:{statuses:[429],source:xe.BATCHER_ENUM,retryAfter:!0,verifiedAt:["engine/enforcement/batcher.ts:328","engine/enforcement/constraints/rate-limit.ts:74","engine/pipeline/rate-limit.ts:83"]},credit_exhausted:{statuses:[402],source:xe.BATCHER_ENUM,retryAfter:!0,verifiedAt:["engine/enforcement/batcher.ts:333"]},enforcement_denied:{statuses:[402],source:xe.BATCHER_ENUM,retryAfter:!0,verifiedAt:["engine/enforcement/batcher.ts:335"]},invalid_entitlement_shape:{statuses:[503],source:xe.RUNTIME_INLINE,retryAfter:!0,verifiedAt:["engine/enforcement/runtime.ts:144"]},unsupported_constraint_schema:{statuses:[503],source:xe.RUNTIME_INLINE,retryAfter:!1,verifiedAt:["engine/enforcement/runtime.ts:154"]},enforcement_error:{statuses:[500],source:xe.RUNTIME_INLINE,retryAfter:!1,verifiedAt:["engine/enforcement/runtime.ts:342"]},enforcement_dependency_unavailable:{statuses:[503],source:xe.RUNTIME_INLINE,retryAfter:!1,verifiedAt:["engine/enforcement/runtime.ts:427"]},concurrency_limit_exceeded:{statuses:[429],source:xe.CONSTRAINT,retryAfter:!0,verifiedAt:["engine/enforcement/constraints/concurrency.ts"]},concurrency_context_unavailable:{statuses:[503],source:xe.CONSTRAINT,retryAfter:!0,verifiedAt:["engine/enforcement/constraints/concurrency.ts:291"]},concurrency_coordinator_unavailable:{statuses:[503],source:xe.CONSTRAINT,retryAfter:!0,verifiedAt:["engine/enforcement/constraints/concurrency.ts:305"]},key_expired:{statuses:[401],source:xe.CONSTRAINT,retryAfter:!1,verifiedAt:["engine/enforcement/constraints/credential-validity.ts:33"]},permission_denied:{statuses:[403],source:xe.CONSTRAINT,retryAfter:!1,verifiedAt:["engine/enforcement/constraints/permission.ts:63"]},permission_unresolved:{statuses:[403],source:xe.CONSTRAINT,retryAfter:!1,verifiedAt:["engine/enforcement/constraints/permission.ts"]},route_not_enabled:{statuses:[403],source:xe.RUNTIME_INLINE,retryAfter:!1,verifiedAt:["engine/pipeline/pre-vec-costs.ts"]},geo_context_unavailable:{statuses:[503],source:xe.CONSTRAINT,retryAfter:!0,verifiedAt:["engine/enforcement/constraints/geo-restriction.ts:44"]},geo_blocked:{statuses:[403],source:xe.CONSTRAINT,retryAfter:!1,verifiedAt:["engine/enforcement/constraints/geo-restriction.ts:51"]},geo_not_allowed:{statuses:[403],source:xe.CONSTRAINT,retryAfter:!1,verifiedAt:["engine/enforcement/constraints/geo-restriction.ts:58"]},resource_count_limit_exceeded:{statuses:[402],source:xe.GATEWAY_ERROR,retryAfter:!1,verifiedAt:["apps/core:routes/internal/gateway-resources.ts:144"]},post_stream_overspend:{statuses:[402],source:xe.CONSTRAINT,retryAfter:!0,verifiedAt:["engine/enforcement/constraints/lifecycle-block.ts"]},request_too_large:{statuses:[413],source:xe.CONSTRAINT,retryAfter:!1,verifiedAt:["engine/enforcement/constraints/capacity.ts"]},resolver_rate_limited:{statuses:[503],source:xe.GATEWAY_ERROR,retryAfter:!0,verifiedAt:["engine/errors.ts:55"]},resolver_unavailable:{statuses:[503],source:xe.GATEWAY_ERROR,retryAfter:!0,verifiedAt:["engine/errors.ts:73"]},credential_resolver_miss_rate_limited:{statuses:[429],source:xe.GATEWAY_ERROR,retryAfter:!0,verifiedAt:["engine/errors.ts:89"]},provider_throttled:{statuses:[503],source:xe.GATEWAY_ERROR,retryAfter:!0,verifiedAt:["engine/pipeline/provider-adapter.ts"]}},b4=Object.keys(_T);var _4=new Set([429,503]),K5=new Set(b4.filter(t=>_T[t].statuses.every(e=>_4.has(e))));var y4=["quota","rate","concurrency","capacity","spend","adaptive"],J5=new Set(y4);var v4=[402,403,413,429],X5=new Set(v4);var k4=a.enum(["create","delete"]),S4=a.enum(["RESERVED","COMMITTED","RELEASED","DENIED"]),x4=a.object({mutationId:a.string().min(1).max(200),requestId:a.string().min(1).max(200),businessId:a.string().min(1).max(200),subscriptionId:a.string().min(1).max(200),compiledPlanId:a.string().min(1).max(200),actionId:a.string().min(1).max(160),environmentId:a.string().min(1).max(200).nullable(),subjectId:a.string().min(1).max(200).optional()}).strict();var pY=x4.extend({statusCode:a.number().int().min(100).max(599)}).strict(),mY=a.object({mutationId:a.string().min(1).max(200),resource:a.string().min(1).max(120),effect:k4,state:S4,count:a.number().int().nonnegative(),limit:a.number().int().nonnegative().nullable(),replayed:a.boolean()}).strict(),fY=a.object({error:a.object({code:a.literal("resource_count_limit_exceeded"),message:a.string(),limitCode:a.string(),dimension:a.string(),currentCapacity:a.number().int().nonnegative()}).strict()}).strict();var Hd=a.string().min(1).max(128).regex(/^[A-Za-z0-9._:-]+$/),yT=a.object({businessId:Hd,environmentId:Hd.nullable(),secretName:a.string().min(1).max(128).regex(/^[A-Z][A-Z0-9_]*$/)}).strict();var V_=a.object({scope:yT,mutationId:Hd,expectedGeneration:a.number().int().positive().nullable()}),I4=V_.extend({mutation:a.literal("publish"),generation:a.number().int().positive(),payloadHash:a.string().regex(/^[a-f0-9]{64}$/),sealedPayload:a.string().min(1).max(131072)}).strict(),$4=V_.extend({mutation:a.literal("rotate"),generation:a.number().int().positive(),payloadHash:a.string().regex(/^[a-f0-9]{64}$/),sealedPayload:a.string().min(1).max(131072)}).strict(),w4=V_.extend({mutation:a.enum(["revoke","delete"]),generation:a.number().int().positive(),payloadHash:a.string().regex(/^[a-f0-9]{64}$/)}).strict(),E4=a.discriminatedUnion("mutation",[I4,$4,w4]),bY=a.object({keyId:Hd,signature:a.string().regex(/^[a-f0-9]{64}$/),command:E4}).strict(),_Y=a.discriminatedUnion("available",[a.object({available:a.literal(!0),scope:yT,generation:a.number().int().positive(),payloadHash:a.string().regex(/^[a-f0-9]{64}$/),sealedPayload:a.string().min(1).max(131072),status:a.literal("ACTIVE")}).strict(),a.object({available:a.literal(!1),generation:a.number().int().positive().nullable(),payloadHash:a.string().regex(/^[a-f0-9]{64}$/).nullable(),status:a.enum(["MISSING","PENDING","REVOKING","REVOKED","DELETED"])}).strict()]);import{existsSync as G_,mkdirSync as T4,readFileSync as xT,writeFileSync as D8}from"node:fs";import{homedir as R4}from"node:os";import{join as Gd}from"node:path";var vT="https://core.farthershore.com";var K_=Gd(R4(),".farthershore"),kT=Gd(K_,"config.json"),ST=Gd(K_,"credentials.json");function O4(t){G_(t)||T4(t,{recursive:!0,mode:448})}var H_={apiUrl:vT};function W_(){if(O4(K_),!G_(kT))return H_;try{let t=JSON.parse(xT(kT,"utf-8"));return{...H_,...t}}catch{return H_}}function IT(){if(!G_(ST))return null;try{return JSON.parse(xT(ST,"utf-8"))}catch{return null}}function P4(){return W_().links??{}}function $T(t){let e=P4(),n=t;for(;;){let i=e[n];if(i)return i;let r=Gd(n,"..");if(r===n)return null;n=r}}var P=class extends Error{constructor(n,i,r){super(n);this.status=i;this.name="CliError",this.code=r?.code,this.details=r?.details,this.param=r?.param}status;code;details;param};function wT(t){if(t)return t;let e=process.env.FARTHERSHORE_TOKEN;if(e)return e;let n=IT();if(n?.token)return n.token;throw new P("Not authenticated. Run `farthershore auth login` or set FARTHERSHORE_TOKEN environment variable.")}var Xi="x-fs-surface",Qi="cli",A4="management";function S(t){return encodeURIComponent(t)}function dt(t,e){let n=new URLSearchParams;for(let[r,o]of Object.entries(e))o&&n.set(r,o);let i=n.toString();return i?`${t}?${i}`:t}function ET(t){let e=t.includes("?")?"&":"?";return`${t}${e}dry_run=true`}var N4=new Set([429,500,502,503,504]),C4=3,z4=3e4,TT=200,D4=4e3,j4=t=>new Promise(e=>setTimeout(e,t));function RT(t,e){if(e){let i=Number(e);if(Number.isFinite(i)&&i>=0)return Math.min(i*1e3,1e4)}return Math.min(TT*2**(t-1),D4)+Math.floor(Math.random()*TT)}function OT(t,e){let n=t.toUpperCase();return n==="GET"||n==="HEAD"?!0:"Idempotency-Key"in e}function PT(t){let e=t.retry?.attempts??C4,n=t.retry?.sleep??j4;async function i(l,p,m){let f=m?e:1,h;for(let y=1;y<=f;y++){let v=new AbortController,T=setTimeout(()=>v.abort(),z4);try{let z=await fetch(l,{...p,signal:v.signal});if(m&&y<f&&N4.has(z.status)){let D=z.headers?.get?.("retry-after")??null;await n(RT(y,D));continue}return z}catch(z){if(h=z,m&&y<f){await n(RT(y,null));continue}throw z}finally{clearTimeout(T)}}throw h}let r=null;async function o(){let l=await fetch(`${t.apiUrl}/auth/cli/exchange`,{method:"POST",headers:{Authorization:`Bearer ${t.token}`,"Content-Type":"application/json",[Xi]:Qi}});if(!l.ok){let p=await l.json().catch(()=>null),m=p?.error,f=typeof m=="string"?{message:m}:m;throw new P(f?.message??l.statusText,l.status,{code:f?.code,details:f?.details??U4(p)})}return r=await l.json(),r}function s(l){return l.split("/",3)[1]===A4}async function c(l){if(!t.token.startsWith("mk_")||s(l))return t.token;let p=r?Date.parse(r.expiresAt):0;return(!r||p-Date.now()<6e4)&&await o(),r.accessToken}async function u(l,p,m,f){let h=await c(p),y=f?.dryRun?ET(p):p,v={Authorization:`Bearer ${h}`,"Content-Type":"application/json",[Xi]:Qi};f?.idempotencyKey&&(v["Idempotency-Key"]=f.idempotencyKey);let T=await i(`${t.apiUrl}${y}`,{method:l,headers:v,body:m?JSON.stringify(m):void 0},f?.retryOnTransient===!1?!1:OT(l,v));if(!T.ok){let D=(await T.json().catch(()=>null))?.error,U=typeof D=="string"?{message:D}:D;throw new P(U?.message??T.statusText,T.status,{code:U?.code,details:U?.details})}if(T.status!==204)return T.json()}async function d(l,p,m,f,h){let y=await c(p),v=h?.dryRun?ET(p):p,T={Authorization:`Bearer ${y}`,"Content-Type":f,[Xi]:Qi};h?.idempotencyKey&&(T["Idempotency-Key"]=h.idempotencyKey);let z=await i(`${t.apiUrl}${v}`,{method:l,headers:T,body:m},h?.retryOnTransient===!1?!1:OT(l,T));if(!z.ok){let U=(await z.json().catch(()=>null))?.error,j=typeof U=="string"?{message:U}:U;throw new P(j?.message??z.statusText,z.status,{code:j?.code,details:j?.details})}if(z.status!==204)return z.json()}return{exchangeCliToken:o,authWhoami:async()=>{if(t.token.startsWith("mk_")){let p=await u("GET","/management/whoami");return{kind:"maker",tokenId:p.tokenId,organizationId:p.organizationId,businessId:p.businessId,scopes:p.scopes}}return{kind:"builder",...await u("POST","/builder/context/bootstrap")}},bootstrap:()=>u("POST","/builder/context/bootstrap"),listBusinesses:l=>u("GET",dt("/businesses",{limit:l?.limit!==void 0?String(l.limit):void 0,offset:l?.offset!==void 0?String(l.offset):void 0})),initBusiness:(l,p)=>u("POST","/businesses/init",l,p),updateBusiness:(l,p,m,f)=>u("PATCH",dt(`/businesses/${S(l)}`,{env:m?.env}),p,f),uploadBrandAsset:(l,p,m,f,h)=>d("PUT",`/businesses/${S(l)}/${S(p)}`,m,f,h),deleteBrandAsset:(l,p,m)=>u("DELETE",`/businesses/${S(l)}/${S(p)}`,void 0,m),publishBusiness:(l,p,m)=>u("POST",`/businesses/${S(l)}/publish`,p&&Object.keys(p).length>0?p:void 0,m),migratePlan:(l,p,m,f)=>u("POST",`/businesses/${S(l)}/plans/${S(p)}/migration-batches`,m,f),getBusiness:(l,p)=>u("GET",dt(`/businesses/${S(l)}`,{env:p?.env})),getDeployments:l=>u("GET",`/businesses/${S(l)}/deployments`),listApplyTimeline:(l,p)=>u("GET",dt(`/businesses/${S(l)}/apply-timeline`,{env:p?.env})),proposeConsumerChangeSet:(l,p,m,f,h)=>u("POST",dt(`/businesses/${S(l)}/consumers/${S(p)}/change-sets`,{env:f?.env}),m,h),listConsumerChangeSets:(l,p,m)=>u("GET",dt(`/businesses/${S(l)}/consumers/${S(p)}/change-sets`,{env:m?.env,status:m?.status,cursor:m?.cursor,limit:m?.limit!==void 0?String(m.limit):void 0})),getConsumerChangeSet:(l,p,m,f)=>u("GET",dt(`/businesses/${S(l)}/consumers/${S(p)}/change-sets/${S(m)}`,{env:f?.env})),previewConsumerChangeSet:(l,p,m,f)=>u("POST",dt(`/businesses/${S(l)}/consumers/${S(p)}/change-sets/${S(m)}/preview`,{env:f?.env})),compileManifest:(l,p,m)=>u("POST",`/businesses/${S(l)}/manifest/compile`,{ir:p,...m?.env?{env:m.env}:{}}),previewPlanRelease:(l,p,m)=>u("POST",`/businesses/${S(l)}/plans/release-preview`,{ir:p,...m?.env?{env:m.env}:{}}),listEnvironments:l=>u("GET",`/businesses/${S(l)}/environments`),createEnvironment:(l,p,m)=>u("POST",`/businesses/${S(l)}/environments`,p,m),deleteEnvironment:(l,p)=>u("DELETE",`/businesses/${S(l)}/environments/${S(p)}`),deleteBusiness:(l,p)=>u("DELETE",`/businesses/${S(l)}`,p?.deleteGitHubRepo?{deleteGitHubRepo:!0}:void 0),builderListConsumers:(l,p)=>u("GET",dt(`/businesses/${S(l)}/consumers`,{env:p?.env})),builderBlockConsumer:(l,p)=>u("POST",`/businesses/${S(l)}/consumers/${S(p)}/block`),builderRemoveConsumer:(l,p)=>u("POST",`/businesses/${S(l)}/consumers/${S(p)}/remove`),builderAssignConsumerMemberRoles:(l,p,m,f)=>u("POST",`/businesses/${S(l)}/consumers/${S(p)}/members/${S(m)}/roles`,{roles:f}),listPromoCodes:l=>u("GET",`/businesses/${S(l)}/promo-codes`),createPromoCode:(l,p)=>u("POST",`/businesses/${S(l)}/promo-codes`,p),updatePromoCode:(l,p,m)=>u("PATCH",`/businesses/${S(l)}/promo-codes/${S(p)}`,m),managementListPlans:l=>u("GET",`/management/businesses/${S(l)}/plans`),managementGetUsage:l=>u("GET",`/management/businesses/${S(l)}/usage`),analyticsQuery:(l,p)=>u("POST",`/businesses/${S(l)}/analytics/query`,p),managementListMakerTokens:()=>u("GET","/maker-tokens"),managementCreateMakerToken:(l,p)=>u("POST","/maker-tokens",l,p),managementRevokeMakerToken:l=>u("DELETE",`/maker-tokens/${S(l)}`),managementRotateMakerToken:(l,p,m)=>u("POST",`/maker-tokens/${S(l)}/rotate`,p,m),managementHardDeleteMakerToken:l=>u("DELETE",`/maker-tokens/${S(l)}/hard`),managementListWebhooks:(l,p)=>u("GET",dt(`/management/businesses/${S(l)}/webhooks`,{limit:p?.limit})),managementCreateWebhook:(l,p,m)=>u("POST",`/management/businesses/${S(l)}/webhooks`,p,m),managementUpdateWebhook:(l,p,m,f)=>u("PATCH",`/management/businesses/${S(l)}/webhooks/${S(p)}`,m,f),managementDeleteWebhook:(l,p)=>u("DELETE",`/management/businesses/${S(l)}/webhooks/${S(p)}`),managementTestWebhook:(l,p)=>u("POST",`/management/businesses/${S(l)}/webhooks/${S(p)}/test`),managementListWebhookDeliveries:(l,p,m)=>u("GET",dt(`/management/businesses/${S(l)}/webhooks/${S(p)}/deliveries`,{limit:m?.limit})),builderListBackends:l=>u("GET",`/businesses/${S(l)}/backends`),builderCreateBackend:(l,p,m)=>u("POST",`/businesses/${S(l)}/backends`,p,m),builderBindBackend:(l,p,m,f)=>u("PATCH",`/businesses/${S(l)}/backends/${S(p)}`,m,f),builderDeleteBackend:(l,p)=>u("DELETE",`/businesses/${S(l)}/backends/${S(p)}`),builderListRuntimeTokens:l=>u("GET",`/businesses/${S(l)}/runtime-tokens`),builderCreateRuntimeToken:(l,p,m)=>u("POST",`/businesses/${S(l)}/runtime-tokens`,p,m),builderRotateRuntimeToken:(l,p,m)=>u("POST",`/businesses/${S(l)}/runtime-tokens/${S(p)}/rotate`,void 0,m),builderRevokeRuntimeToken:(l,p)=>u("DELETE",`/businesses/${S(l)}/runtime-tokens/${S(p)}`),builderFrontendStatus:(l,p)=>u("GET",`/businesses/${S(l)}/frontend/status${p?`?environmentId=${encodeURIComponent(p)}`:""}`),builderFrontendReleases:(l,p)=>u("GET",`/businesses/${S(l)}/frontend/releases${p?`?environmentId=${encodeURIComponent(p)}`:""}`),builderFrontendRollback:(l,p,m)=>u("POST",`/businesses/${S(l)}/frontend/rollback`,p,m),builderListBulletin:(l,p)=>u("GET",dt(`/businesses/${S(l)}/bulletin`,{kind:p?.kind,status:p?.status,cursor:p?.cursor,limit:p?.limit})),builderGetBulletinPost:(l,p)=>u("GET",`/businesses/${S(l)}/bulletin/${S(p)}`),builderSetBulletinStatus:(l,p,m)=>u("PATCH",`/businesses/${S(l)}/bulletin/${S(p)}`,{status:m}),builderListAgents:l=>u("GET",`/businesses/${S(l)}/agents`),builderAgentStatus:(l,p)=>u("GET",`/businesses/${S(l)}/agents/${S(p)}`),builderAgentRunDetail:(l,p,m)=>u("GET",`/businesses/${S(l)}/agents/${S(p)}/runs/${S(m)}`),builderConfigureAgent:(l,p,m,f)=>u("PUT",`/businesses/${S(l)}/agents/${S(p)}`,m,f),builderBusinessVariables:async(l,p)=>(await u("GET",dt(`/businesses/${S(l)}/variables`,{environmentId:p}))).variables,builderSetBusinessVariable:async(l,p,m,f)=>(await u("PUT",`/businesses/${S(l)}/variables/${S(p)}`,m,f)).operation,builderRevokeBusinessVariable:async(l,p,m,f)=>(await u("POST",`/businesses/${S(l)}/variables/${S(p)}/revoke`,{environmentId:m,confirmation:"REVOKE"},f)).operation,builderDeleteBusinessVariable:async(l,p,m,f)=>(await u("DELETE",`/businesses/${S(l)}/variables/${S(p)}`,{environmentId:m,confirmation:"DELETE"},f)).operation,builderGetBusinessVariableOperation:async(l,p)=>(await u("GET",`/businesses/${S(l)}/variables/operations/${S(p)}`)).operation,builderGitHubStatus:()=>u("GET","/builder/git/github/status"),businessStripeStatus:l=>u("GET",`/businesses/${S(l)}/stripe/status`),issuePersonaBootstrapKey:async(l,p,m)=>{let f=await fetch(`${t.apiUrl}/portal/businesses/${S(l)}/environments/${S(p)}/test/bootstrap-key`,{method:"POST",headers:{Authorization:`Bearer ${t.token}`,"Content-Type":"application/json",[Xi]:Qi},body:JSON.stringify(m??{})});if(!f.ok){let y=(await f.json().catch(()=>null))?.error,v=typeof y=="string"?{message:y}:y;throw new P(v?.message??f.statusText,f.status,{code:v?.code,details:v?.details})}return f.json()},listPersonas:async(l,p)=>{let m=await fetch(`${t.apiUrl}/portal/businesses/${S(l)}/environments/${S(p)}/test/personas`,{method:"GET",headers:{Authorization:`Bearer ${t.token}`,[Xi]:Qi}});if(!m.ok){let h=(await m.json().catch(()=>null))?.error,y=typeof h=="string"?{message:h}:h;throw new P(y?.message??m.statusText,m.status,{code:y?.code,details:y?.details})}return m.json()},revokePersona:async(l,p,m)=>{let f=await fetch(`${t.apiUrl}/portal/businesses/${S(l)}/environments/${S(p)}/test/personas/${S(m)}`,{method:"DELETE",headers:{Authorization:`Bearer ${t.token}`,[Xi]:Qi}});if(!f.ok){let y=(await f.json().catch(()=>null))?.error,v=typeof y=="string"?{message:y}:y;throw new P(v?.message??f.statusText,f.status,{code:v?.code,details:v?.details})}return f.json()},getBusinessConfig:(l,p)=>u("GET",dt(`/businesses/${S(l)}/config`,{format:"json",env:p?.env,state:p?.state})),updateBusinessConfigDraft:(l,p,m)=>u("PATCH",`/businesses/${S(l)}/config/draft`,{spec:p,env:m?.env,branch:m?.branch,source:m?.source,baseDraftHash:m?.baseDraftHash})}}function U4(t){if(!t||typeof t!="object")return;let e=t,n=Array.isArray(e.errors)?e.errors:void 0,i=Array.isArray(e.warnings)?e.warnings:void 0;if(!(!n?.length&&!i?.length))return{...n?.length?{errors:n}:{},...i?.length?{warnings:i}:{}}}var AT=(t=0)=>e=>`\x1B[${e+t}m`,NT=(t=0)=>e=>`\x1B[${38+t};5;${e}m`,CT=(t=0)=>(e,n,i)=>`\x1B[${38+t};2;${e};${n};${i}m`,Ee={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},G8=Object.keys(Ee.modifier),M4=Object.keys(Ee.color),L4=Object.keys(Ee.bgColor),K8=[...M4,...L4];function Z4(){let t=new Map;for(let[e,n]of Object.entries(Ee)){for(let[i,r]of Object.entries(n))Ee[i]={open:`\x1B[${r[0]}m`,close:`\x1B[${r[1]}m`},n[i]=Ee[i],t.set(r[0],r[1]);Object.defineProperty(Ee,e,{value:n,enumerable:!1})}return Object.defineProperty(Ee,"codes",{value:t,enumerable:!1}),Ee.color.close="\x1B[39m",Ee.bgColor.close="\x1B[49m",Ee.color.ansi=AT(),Ee.color.ansi256=NT(),Ee.color.ansi16m=CT(),Ee.bgColor.ansi=AT(10),Ee.bgColor.ansi256=NT(10),Ee.bgColor.ansi16m=CT(10),Object.defineProperties(Ee,{rgbToAnsi256:{value(e,n,i){return e===n&&n===i?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(n/255*5)+Math.round(i/255*5)},enumerable:!1},hexToRgb:{value(e){let n=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!n)return[0,0,0];let[i]=n;i.length===3&&(i=[...i].map(o=>o+o).join(""));let r=Number.parseInt(i,16);return[r>>16&255,r>>8&255,r&255]},enumerable:!1},hexToAnsi256:{value:e=>Ee.rgbToAnsi256(...Ee.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let n,i,r;if(e>=232)n=((e-232)*10+8)/255,i=n,r=n;else{e-=16;let c=e%36;n=Math.floor(e/36)/5,i=Math.floor(c/6)/5,r=c%6/5}let o=Math.max(n,i,r)*2;if(o===0)return 30;let s=30+(Math.round(r)<<2|Math.round(i)<<1|Math.round(n));return o===2&&(s+=60),s},enumerable:!1},rgbToAnsi:{value:(e,n,i)=>Ee.ansi256ToAnsi(Ee.rgbToAnsi256(e,n,i)),enumerable:!1},hexToAnsi:{value:e=>Ee.ansi256ToAnsi(Ee.hexToAnsi256(e)),enumerable:!1}}),Ee}var B4=Z4(),Zt=B4;import J_ from"node:process";import F4 from"node:os";import zT from"node:tty";function Et(t,e=globalThis.Deno?globalThis.Deno.args:J_.argv){let n=t.startsWith("-")?"":t.length===1?"-":"--",i=e.indexOf(n+t),r=e.indexOf("--");return i!==-1&&(r===-1||i<r)}var{env:Te}=J_,Kd;Et("no-color")||Et("no-colors")||Et("color=false")||Et("color=never")?Kd=0:(Et("color")||Et("colors")||Et("color=true")||Et("color=always"))&&(Kd=1);function q4(){if("FORCE_COLOR"in Te)return Te.FORCE_COLOR==="true"?1:Te.FORCE_COLOR==="false"?0:Te.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(Te.FORCE_COLOR,10),3)}function V4(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function H4(t,{streamIsTTY:e,sniffFlags:n=!0}={}){let i=q4();i!==void 0&&(Kd=i);let r=n?Kd:i;if(r===0)return 0;if(n){if(Et("color=16m")||Et("color=full")||Et("color=truecolor"))return 3;if(Et("color=256"))return 2}if("TF_BUILD"in Te&&"AGENT_NAME"in Te)return 1;if(t&&!e&&r===void 0)return 0;let o=r||0;if(Te.TERM==="dumb")return o;if(J_.platform==="win32"){let s=F4.release().split(".");return Number(s[0])>=10&&Number(s[2])>=10586?Number(s[2])>=14931?3:2:1}if("CI"in Te)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(s=>s in Te)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(s=>s in Te)||Te.CI_NAME==="codeship"?1:o;if("TEAMCITY_VERSION"in Te)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Te.TEAMCITY_VERSION)?1:0;if(Te.COLORTERM==="truecolor"||Te.TERM==="xterm-kitty"||Te.TERM==="xterm-ghostty"||Te.TERM==="wezterm")return 3;if("TERM_PROGRAM"in Te){let s=Number.parseInt((Te.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Te.TERM_PROGRAM){case"iTerm.app":return s>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Te.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Te.TERM)||"COLORTERM"in Te?1:o}function DT(t,e={}){let n=H4(t,{streamIsTTY:t&&t.isTTY,...e});return V4(n)}var G4={stdout:DT({isTTY:zT.isatty(1)}),stderr:DT({isTTY:zT.isatty(2)})},jT=G4;function UT(t,e,n){let i=t.indexOf(e);if(i===-1)return t;let r=e.length,o=0,s="";do s+=t.slice(o,i)+e+n,o=i+r,i=t.indexOf(e,o);while(i!==-1);return s+=t.slice(o),s}function MT(t,e,n,i){let r=0,o="";do{let s=t[i-1]==="\r";o+=t.slice(r,s?i-1:i)+e+(s?`\r
|
|
81
|
+
]`;continue}r+=i[u],i[u]==="\\"?o=!0:s&&i[u]==="]"?s=!1:!s&&i[u]==="["&&(s=!0)}try{new RegExp(r)}catch{return console.warn(`Could not convert regex pattern at ${e.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),t.source}return r}function od(t,e){if(e.target==="openAi"&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),e.target==="openApi3"&&t.keyType?._def.typeName===T.ZodEnum)return{type:"object",required:t.keyType._def.values,properties:t.keyType._def.values.reduce((i,r)=>({...i,[r]:q(t.valueType._def,{...e,currentPath:[...e.currentPath,"properties",r]})??we(e)}),{}),additionalProperties:e.rejectedAdditionalProperties};let n={type:"object",additionalProperties:q(t.valueType._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]})??e.allowedAdditionalProperties};if(e.target==="openApi3")return n;if(t.keyType?._def.typeName===T.ZodString&&t.keyType._def.checks?.length){let{type:i,...r}=id(t.keyType._def,e);return{...n,propertyNames:r}}else{if(t.keyType?._def.typeName===T.ZodEnum)return{...n,propertyNames:{enum:t.keyType._def.values}};if(t.keyType?._def.typeName===T.ZodBranded&&t.keyType._def.type._def.typeName===T.ZodString&&t.keyType._def.type._def.checks?.length){let{type:i,...r}=rd(t.keyType._def,e);return{...n,propertyNames:r}}}return n}function Mx(t,e){if(e.mapStrategy==="record")return od(t,e);let n=q(t.keyType._def,{...e,currentPath:[...e.currentPath,"items","items","0"]})||we(e),i=q(t.valueType._def,{...e,currentPath:[...e.currentPath,"items","items","1"]})||we(e);return{type:"array",maxItems:125,items:{type:"array",items:[n,i],minItems:2,maxItems:2}}}function Lx(t){let e=t.values,i=Object.keys(t.values).filter(o=>typeof e[e[o]]!="number").map(o=>e[o]),r=Array.from(new Set(i.map(o=>typeof o)));return{type:r.length===1?r[0]==="string"?"string":"number":["string","number"],enum:i}}function Zx(t){return t.target==="openAi"?void 0:{not:we({...t,currentPath:[...t.currentPath,"not"]})}}function Bx(t){return t.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}var Bs={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function Vx(t,e){if(e.target==="openApi3")return Fx(t,e);let n=t.options instanceof Map?Array.from(t.options.values()):t.options;if(n.every(i=>i._def.typeName in Bs&&(!i._def.checks||!i._def.checks.length))){let i=n.reduce((r,o)=>{let s=Bs[o._def.typeName];return s&&!r.includes(s)?[...r,s]:r},[]);return{type:i.length>1?i:i[0]}}else if(n.every(i=>i._def.typeName==="ZodLiteral"&&!i.description)){let i=n.reduce((r,o)=>{let s=typeof o._def.value;switch(s){case"string":case"number":case"boolean":return[...r,s];case"bigint":return[...r,"integer"];case"object":if(o._def.value===null)return[...r,"null"];default:return r}},[]);if(i.length===n.length){let r=i.filter((o,s,c)=>c.indexOf(o)===s);return{type:r.length>1?r:r[0],enum:n.reduce((o,s)=>o.includes(s._def.value)?o:[...o,s._def.value],[])}}}else if(n.every(i=>i._def.typeName==="ZodEnum"))return{type:"string",enum:n.reduce((i,r)=>[...i,...r._def.values.filter(o=>!i.includes(o))],[])};return Fx(t,e)}var Fx=(t,e)=>{let n=(t.options instanceof Map?Array.from(t.options.values()):t.options).map((i,r)=>q(i._def,{...e,currentPath:[...e.currentPath,"anyOf",`${r}`]})).filter(i=>!!i&&(!e.strictUnions||typeof i=="object"&&Object.keys(i).length>0));return n.length?{anyOf:n}:void 0};function qx(t,e){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(t.innerType._def.typeName)&&(!t.innerType._def.checks||!t.innerType._def.checks.length))return e.target==="openApi3"?{type:Bs[t.innerType._def.typeName],nullable:!0}:{type:[Bs[t.innerType._def.typeName],"null"]};if(e.target==="openApi3"){let i=q(t.innerType._def,{...e,currentPath:[...e.currentPath]});return i&&"$ref"in i?{allOf:[i],nullable:!0}:i&&{...i,nullable:!0}}let n=q(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","0"]});return n&&{anyOf:[n,{type:"null"}]}}function Hx(t,e){let n={type:"number"};if(!t.checks)return n;for(let i of t.checks)switch(i.kind){case"int":n.type="integer",Ih(n,"type",i.message,e);break;case"min":e.target==="jsonSchema7"?i.inclusive?ie(n,"minimum",i.value,i.message,e):ie(n,"exclusiveMinimum",i.value,i.message,e):(i.inclusive||(n.exclusiveMinimum=!0),ie(n,"minimum",i.value,i.message,e));break;case"max":e.target==="jsonSchema7"?i.inclusive?ie(n,"maximum",i.value,i.message,e):ie(n,"exclusiveMaximum",i.value,i.message,e):(i.inclusive||(n.exclusiveMaximum=!0),ie(n,"maximum",i.value,i.message,e));break;case"multipleOf":ie(n,"multipleOf",i.value,i.message,e);break}return n}function Kx(t,e){let n=e.target==="openAi",i={type:"object",properties:{}},r=[],o=t.shape();for(let c in o){let u=o[c];if(u===void 0||u._def===void 0)continue;let l=bC(u);l&&n&&(u._def.typeName==="ZodOptional"&&(u=u._def.innerType),u.isNullable()||(u=u.nullable()),l=!1);let p=q(u._def,{...e,currentPath:[...e.currentPath,"properties",c],propertyPath:[...e.currentPath,"properties",c]});p!==void 0&&(i.properties[c]=p,l||r.push(c))}r.length&&(i.required=r);let s=hC(t,e);return s!==void 0&&(i.additionalProperties=s),i}function hC(t,e){if(t.catchall._def.typeName!=="ZodNever")return q(t.catchall._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]});switch(t.unknownKeys){case"passthrough":return e.allowedAdditionalProperties;case"strict":return e.rejectedAdditionalProperties;case"strip":return e.removeAdditionalStrategy==="strict"?e.allowedAdditionalProperties:e.rejectedAdditionalProperties}}function bC(t){try{return t.isOptional()}catch{return!0}}var Gx=(t,e)=>{if(e.currentPath.toString()===e.propertyPath?.toString())return q(t.innerType._def,e);let n=q(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","1"]});return n?{anyOf:[{not:we(e)},n]}:we(e)};var Wx=(t,e)=>{if(e.pipeStrategy==="input")return q(t.in._def,e);if(e.pipeStrategy==="output")return q(t.out._def,e);let n=q(t.in._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),i=q(t.out._def,{...e,currentPath:[...e.currentPath,"allOf",n?"1":"0"]});return{allOf:[n,i].filter(r=>r!==void 0)}};function Jx(t,e){return q(t.type._def,e)}function Yx(t,e){let i={type:"array",uniqueItems:!0,items:q(t.valueType._def,{...e,currentPath:[...e.currentPath,"items"]})};return t.minSize&&ie(i,"minItems",t.minSize.value,t.minSize.message,e),t.maxSize&&ie(i,"maxItems",t.maxSize.value,t.maxSize.message,e),i}function Xx(t,e){return t.rest?{type:"array",minItems:t.items.length,items:t.items.map((n,i)=>q(n._def,{...e,currentPath:[...e.currentPath,"items",`${i}`]})).reduce((n,i)=>i===void 0?n:[...n,i],[]),additionalItems:q(t.rest._def,{...e,currentPath:[...e.currentPath,"additionalItems"]})}:{type:"array",minItems:t.items.length,maxItems:t.items.length,items:t.items.map((n,i)=>q(n._def,{...e,currentPath:[...e.currentPath,"items",`${i}`]})).reduce((n,i)=>i===void 0?n:[...n,i],[])}}function Qx(t){return{not:we(t)}}function eI(t){return we(t)}var tI=(t,e)=>q(t.innerType._def,e);var nI=(t,e,n)=>{switch(e){case T.ZodString:return id(t,n);case T.ZodNumber:return Hx(t,n);case T.ZodObject:return Kx(t,n);case T.ZodBigInt:return Ox(t,n);case T.ZodBoolean:return Px();case T.ZodDate:return $h(t,n);case T.ZodUndefined:return Qx(n);case T.ZodNull:return Bx(n);case T.ZodArray:return Rx(t,n);case T.ZodUnion:case T.ZodDiscriminatedUnion:return Vx(t,n);case T.ZodIntersection:return Dx(t,n);case T.ZodTuple:return Xx(t,n);case T.ZodRecord:return od(t,n);case T.ZodLiteral:return jx(t,n);case T.ZodEnum:return zx(t);case T.ZodNativeEnum:return Lx(t);case T.ZodNullable:return qx(t,n);case T.ZodOptional:return Gx(t,n);case T.ZodMap:return Mx(t,n);case T.ZodSet:return Yx(t,n);case T.ZodLazy:return()=>t.getter()._def;case T.ZodPromise:return Jx(t,n);case T.ZodNaN:case T.ZodNever:return Zx(n);case T.ZodEffects:return Cx(t,n);case T.ZodAny:return we(n);case T.ZodUnknown:return eI(n);case T.ZodDefault:return Nx(t,n);case T.ZodBranded:return rd(t,n);case T.ZodReadonly:return tI(t,n);case T.ZodCatch:return Ax(t,n);case T.ZodPipeline:return Wx(t,n);case T.ZodFunction:case T.ZodVoid:case T.ZodSymbol:return;default:return(i=>{})(e)}};function q(t,e,n=!1){let i=e.seen.get(t);if(e.override){let c=e.override?.(t,e,i,n);if(c!==wx)return c}if(i&&!n){let c=yC(i,e);if(c!==void 0)return c}let r={def:t,path:e.currentPath,jsonSchema:void 0};e.seen.set(t,r);let o=nI(t,t.typeName,e),s=typeof o=="function"?q(o(),e):o;if(s&&_C(t,e,s),e.postProcess){let c=e.postProcess(s,t,e);return r.jsonSchema=s,c}return r.jsonSchema=s,s}var yC=(t,e)=>{switch(e.$refStrategy){case"root":return{$ref:t.path.join("/")};case"relative":return{$ref:nd(e.currentPath,t.path)};case"none":case"seen":return t.path.length<e.currentPath.length&&t.path.every((n,i)=>e.currentPath[i]===n)?(console.warn(`Recursive reference detected at ${e.currentPath.join("/")}! Defaulting to any`),we(e)):e.$refStrategy==="seen"?we(e):void 0}},_C=(t,e,n)=>(t.description&&(n.description=t.description,e.markdownDescription&&(n.markdownDescription=t.description)),n);var Th=(t,e)=>{let n=Tx(e),i=typeof e=="object"&&e.definitions?Object.entries(e.definitions).reduce((u,[l,p])=>({...u,[l]:q(p._def,{...n,currentPath:[...n.basePath,n.definitionPath,l]},!0)??we(n)}),{}):void 0,r=typeof e=="string"?e:e?.nameStrategy==="title"?void 0:e?.name,o=q(t._def,r===void 0?n:{...n,currentPath:[...n.basePath,n.definitionPath,r]},!1)??we(n),s=typeof e=="object"&&e.name!==void 0&&e.nameStrategy==="title"?e.name:void 0;s!==void 0&&(o.title=s),n.flags.hasReferencedOpenAiAnyType&&(i||(i={}),i[n.openAiAnyTypeName]||(i[n.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:n.$refStrategy==="relative"?"1":[...n.basePath,n.definitionPath,n.openAiAnyTypeName].join("/")}}));let c=r===void 0?i?{...o,[n.definitionPath]:i}:o:{$ref:[...n.$refStrategy==="relative"?[]:n.basePath,n.definitionPath,r].join("/"),[n.definitionPath]:{...i,[r]:o}};return n.target==="jsonSchema7"?c.$schema="http://json-schema.org/draft-07/schema#":(n.target==="jsonSchema2019-09"||n.target==="openAi")&&(c.$schema="https://json-schema.org/draft/2019-09/schema#"),n.target==="openAi"&&("anyOf"in c||"oneOf"in c||"allOf"in c||"type"in c&&Array.isArray(c.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),c};function vC(t){return!t||t==="jsonSchema7"||t==="draft-7"?"draft-7":t==="jsonSchema2019-09"||t==="draft-2020-12"?"draft-2020-12":"draft-7"}function Rh(t,e){return Kt(t)?dr(t,{target:vC(e?.target),io:e?.pipeStrategy??"input"}):Th(t,{strictUnions:e?.strictUnions??!0,pipeStrategy:e?.pipeStrategy??"input"})}function Oh(t){let n=zn(t)?.method;if(!n)throw new Error("Schema is missing a method literal");let i=Ni(n);if(typeof i!="string")throw new Error("Schema method literal must be a string");return i}function Ph(t,e){let n=Cn(t,e);if(!n.success)throw n.error;return n.data}var kC=6e4,sd=class{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(Al,n=>{this._oncancel(n)}),this.setNotificationHandler(Cl,n=>{this._onprogress(n)}),this.setRequestHandler(Nl,n=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(zl,async(n,i)=>{let r=await this._taskStore.getTask(n.params.taskId,i.sessionId);if(!r)throw new Z(F.InvalidParams,"Failed to retrieve task: Task not found");return{...r}}),this.setRequestHandler(jl,async(n,i)=>{let r=async()=>{let o=n.params.taskId;if(this._taskMessageQueue){let c;for(;c=await this._taskMessageQueue.dequeue(o,i.sessionId);){if(c.type==="response"||c.type==="error"){let u=c.message,l=u.id,p=this._requestResolvers.get(l);if(p)if(this._requestResolvers.delete(l),c.type==="response")p(u);else{let d=u,m=new Z(d.error.code,d.error.message,d.error.data);p(m)}else{let d=c.type==="response"?"Response":"Error";this._onerror(new Error(`${d} handler missing for request ${l}`))}continue}await this._transport?.send(c.message,{relatedRequestId:i.requestId})}}let s=await this._taskStore.getTask(o,i.sessionId);if(!s)throw new Z(F.InvalidParams,`Task not found: ${o}`);if(!Dn(s.status))return await this._waitForTaskUpdate(o,i.signal),await r();if(Dn(s.status)){let c=await this._taskStore.getTaskResult(o,i.sessionId);return this._clearTaskQueue(o),{...c,_meta:{...c._meta,[On]:{taskId:o}}}}return await r()};return await r()}),this.setRequestHandler(Ul,async(n,i)=>{try{let{tasks:r,nextCursor:o}=await this._taskStore.listTasks(n.params?.cursor,i.sessionId);return{tasks:r,nextCursor:o,_meta:{}}}catch(r){throw new Z(F.InvalidParams,`Failed to list tasks: ${r instanceof Error?r.message:String(r)}`)}}),this.setRequestHandler(Ll,async(n,i)=>{try{let r=await this._taskStore.getTask(n.params.taskId,i.sessionId);if(!r)throw new Z(F.InvalidParams,`Task not found: ${n.params.taskId}`);if(Dn(r.status))throw new Z(F.InvalidParams,`Cannot cancel task in terminal status: ${r.status}`);await this._taskStore.updateTaskStatus(n.params.taskId,"cancelled","Client cancelled task execution.",i.sessionId),this._clearTaskQueue(n.params.taskId);let o=await this._taskStore.getTask(n.params.taskId,i.sessionId);if(!o)throw new Z(F.InvalidParams,`Task not found after cancellation: ${n.params.taskId}`);return{_meta:{},...o}}catch(r){throw r instanceof Z?r:new Z(F.InvalidRequest,`Failed to cancel task: ${r instanceof Error?r.message:String(r)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,n,i,r,o=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,n),startTime:Date.now(),timeout:n,maxTotalTimeout:i,resetTimeoutOnProgress:o,onTimeout:r})}_resetTimeout(e){let n=this._timeoutInfo.get(e);if(!n)return!1;let i=Date.now()-n.startTime;if(n.maxTotalTimeout&&i>=n.maxTotalTimeout)throw this._timeoutInfo.delete(e),Z.fromError(F.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:n.maxTotalTimeout,totalElapsed:i});return clearTimeout(n.timeoutId),n.timeoutId=setTimeout(n.onTimeout,n.timeout),!0}_cleanupTimeout(e){let n=this._timeoutInfo.get(e);n&&(clearTimeout(n.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=e;let n=this.transport?.onclose;this._transport.onclose=()=>{n?.(),this._onclose()};let i=this.transport?.onerror;this._transport.onerror=o=>{i?.(o),this._onerror(o)};let r=this._transport?.onmessage;this._transport.onmessage=(o,s)=>{r?.(o,s),ks(o)||ix(o)?this._onresponse(o):nh(o)?this._onrequest(o,s):rx(o)?this._onnotification(o):this._onerror(new Error(`Unknown message type: ${JSON.stringify(o)}`))},await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let i of this._timeoutInfo.values())clearTimeout(i.timeoutId);this._timeoutInfo.clear();for(let i of this._requestHandlerAbortControllers.values())i.abort();this._requestHandlerAbortControllers.clear();let n=Z.fromError(F.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let i of e.values())i(n)}_onerror(e){this.onerror?.(e)}_onnotification(e){let n=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;n!==void 0&&Promise.resolve().then(()=>n(e)).catch(i=>this._onerror(new Error(`Uncaught error in notification handler: ${i}`)))}_onrequest(e,n){let i=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,r=this._transport,o=e.params?._meta?.[On]?.taskId;if(i===void 0){let p={jsonrpc:"2.0",id:e.id,error:{code:F.MethodNotFound,message:"Method not found"}};o&&this._taskMessageQueue?this._enqueueTaskMessage(o,{type:"error",message:p,timestamp:Date.now()},r?.sessionId).catch(d=>this._onerror(new Error(`Failed to enqueue error response: ${d}`))):r?.send(p).catch(d=>this._onerror(new Error(`Failed to send an error response: ${d}`)));return}let s=new AbortController;this._requestHandlerAbortControllers.set(e.id,s);let c=ex(e.params)?e.params.task:void 0,u=this._taskStore?this.requestTaskStore(e,r?.sessionId):void 0,l={signal:s.signal,sessionId:r?.sessionId,_meta:e.params?._meta,sendNotification:async p=>{if(s.signal.aborted)return;let d={relatedRequestId:e.id};o&&(d.relatedTask={taskId:o}),await this.notification(p,d)},sendRequest:async(p,d,m)=>{if(s.signal.aborted)throw new Z(F.ConnectionClosed,"Request was cancelled");let f={...m,relatedRequestId:e.id};o&&!f.relatedTask&&(f.relatedTask={taskId:o});let g=f.relatedTask?.taskId??o;return g&&u&&await u.updateTaskStatus(g,"input_required"),await this.request(p,d,f)},authInfo:n?.authInfo,requestId:e.id,requestInfo:n?.requestInfo,taskId:o,taskStore:u,taskRequestedTtl:c?.ttl,closeSSEStream:n?.closeSSEStream,closeStandaloneSSEStream:n?.closeStandaloneSSEStream};Promise.resolve().then(()=>{c&&this.assertTaskHandlerCapability(e.method)}).then(()=>i(e,l)).then(async p=>{if(s.signal.aborted)return;let d={result:p,jsonrpc:"2.0",id:e.id};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"response",message:d,timestamp:Date.now()},r?.sessionId):await r?.send(d)},async p=>{if(s.signal.aborted)return;let d={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(p.code)?p.code:F.InternalError,message:p.message??"Internal error",...p.data!==void 0&&{data:p.data}}};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"error",message:d,timestamp:Date.now()},r?.sessionId):await r?.send(d)}).catch(p=>this._onerror(new Error(`Failed to send response: ${p}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===s&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){let{progressToken:n,...i}=e.params,r=Number(n),o=this._progressHandlers.get(r);if(!o){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let s=this._responseHandlers.get(r),c=this._timeoutInfo.get(r);if(c&&s&&c.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(u){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),s(u);return}o(i)}_onresponse(e){let n=Number(e.id),i=this._requestResolvers.get(n);if(i){if(this._requestResolvers.delete(n),ks(e))i(e);else{let s=new Z(e.error.code,e.error.message,e.error.data);i(s)}return}let r=this._responseHandlers.get(n);if(r===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(n),this._cleanupTimeout(n);let o=!1;if(ks(e)&&e.result&&typeof e.result=="object"){let s=e.result;if(s.task&&typeof s.task=="object"){let c=s.task;typeof c.taskId=="string"&&(o=!0,this._taskProgressTokens.set(c.taskId,n))}}if(o||this._progressHandlers.delete(n),ks(e))r(e);else{let s=Z.fromError(e.error.code,e.error.message,e.error.data);r(s)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,n,i){let{task:r}=i??{};if(!r){try{yield{type:"result",result:await this.request(e,n,i)}}catch(s){yield{type:"error",error:s instanceof Z?s:new Z(F.InternalError,String(s))}}return}let o;try{let s=await this.request(e,fi,i);if(s.task)o=s.task.taskId,yield{type:"taskCreated",task:s.task};else throw new Z(F.InternalError,"Task creation did not return a task");for(;;){let c=await this.getTask({taskId:o},i);if(yield{type:"taskStatus",task:c},Dn(c.status)){c.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:o},n,i)}:c.status==="failed"?yield{type:"error",error:new Z(F.InternalError,`Task ${o} failed`)}:c.status==="cancelled"&&(yield{type:"error",error:new Z(F.InternalError,`Task ${o} was cancelled`)});return}if(c.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:o},n,i)};return}let u=c.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(l=>setTimeout(l,u)),i?.signal?.throwIfAborted()}}catch(s){yield{type:"error",error:s instanceof Z?s:new Z(F.InternalError,String(s))}}}request(e,n,i){let{relatedRequestId:r,resumptionToken:o,onresumptiontoken:s,task:c,relatedTask:u}=i??{};return new Promise((l,p)=>{let d=z=>{p(z)};if(!this._transport){d(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),c&&this.assertTaskCapability(e.method)}catch(z){d(z);return}i?.signal?.throwIfAborted();let m=this._requestMessageId++,f={...e,jsonrpc:"2.0",id:m};i?.onprogress&&(this._progressHandlers.set(m,i.onprogress),f.params={...e.params,_meta:{...e.params?._meta||{},progressToken:m}}),c&&(f.params={...f.params,task:c}),u&&(f.params={...f.params,_meta:{...f.params?._meta||{},[On]:u}});let g=z=>{this._responseHandlers.delete(m),this._progressHandlers.delete(m),this._cleanupTimeout(m),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:m,reason:String(z)}},{relatedRequestId:r,resumptionToken:o,onresumptiontoken:s}).catch(U=>this._onerror(new Error(`Failed to send cancellation: ${U}`)));let R=z instanceof Z?z:new Z(F.RequestTimeout,String(z));p(R)};this._responseHandlers.set(m,z=>{if(!i?.signal?.aborted){if(z instanceof Error)return p(z);try{let R=Cn(n,z.result);R.success?l(R.data):p(R.error)}catch(R){p(R)}}}),i?.signal?.addEventListener("abort",()=>{g(i?.signal?.reason)});let y=i?.timeout??kC,v=()=>g(Z.fromError(F.RequestTimeout,"Request timed out",{timeout:y}));this._setupTimeout(m,y,i?.maxTotalTimeout,v,i?.resetTimeoutOnProgress??!1);let S=u?.taskId;if(S){let z=R=>{let U=this._responseHandlers.get(m);U?U(R):this._onerror(new Error(`Response handler missing for side-channeled request ${m}`))};this._requestResolvers.set(m,z),this._enqueueTaskMessage(S,{type:"request",message:f,timestamp:Date.now()}).catch(R=>{this._cleanupTimeout(m),p(R)})}else this._transport.send(f,{relatedRequestId:r,resumptionToken:o,onresumptiontoken:s}).catch(z=>{this._cleanupTimeout(m),p(z)})})}async getTask(e,n){return this.request({method:"tasks/get",params:e},Dl,n)}async getTaskResult(e,n,i){return this.request({method:"tasks/result",params:e},n,i)}async listTasks(e,n){return this.request({method:"tasks/list",params:e},Ml,n)}async cancelTask(e,n){return this.request({method:"tasks/cancel",params:e},ax,n)}async notification(e,n){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);let i=n?.relatedTask?.taskId;if(i){let c={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[On]:n.relatedTask}}};await this._enqueueTaskMessage(i,{type:"notification",message:c,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!n?.relatedRequestId&&!n?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let c={...e,jsonrpc:"2.0"};n?.relatedTask&&(c={...c,params:{...c.params,_meta:{...c.params?._meta||{},[On]:n.relatedTask}}}),this._transport?.send(c,n).catch(u=>this._onerror(u))});return}let s={...e,jsonrpc:"2.0"};n?.relatedTask&&(s={...s,params:{...s.params,_meta:{...s.params?._meta||{},[On]:n.relatedTask}}}),await this._transport.send(s,n)}setRequestHandler(e,n){let i=Oh(e);this.assertRequestHandlerCapability(i),this._requestHandlers.set(i,(r,o)=>{let s=Ph(e,r);return Promise.resolve(n(s,o))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,n){let i=Oh(e);this._notificationHandlers.set(i,r=>{let o=Ph(e,r);return Promise.resolve(n(o))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){let n=this._taskProgressTokens.get(e);n!==void 0&&(this._progressHandlers.delete(n),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,n,i){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let r=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,n,i,r)}async _clearTaskQueue(e,n){if(this._taskMessageQueue){let i=await this._taskMessageQueue.dequeueAll(e,n);for(let r of i)if(r.type==="request"&&nh(r.message)){let o=r.message.id,s=this._requestResolvers.get(o);s?(s(new Z(F.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(o)):this._onerror(new Error(`Resolver missing for request ${o} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,n){let i=this._options?.defaultTaskPollInterval??1e3;try{let r=await this._taskStore?.getTask(e);r?.pollInterval&&(i=r.pollInterval)}catch{}return new Promise((r,o)=>{if(n.aborted){o(new Z(F.InvalidRequest,"Request cancelled"));return}let s=setTimeout(r,i);n.addEventListener("abort",()=>{clearTimeout(s),o(new Z(F.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,n){let i=this._taskStore;if(!i)throw new Error("No task store configured");return{createTask:async r=>{if(!e)throw new Error("No request provided");return await i.createTask(r,e.id,{method:e.method,params:e.params},n)},getTask:async r=>{let o=await i.getTask(r,n);if(!o)throw new Z(F.InvalidParams,"Failed to retrieve task: Task not found");return o},storeTaskResult:async(r,o,s)=>{await i.storeTaskResult(r,o,s,n);let c=await i.getTask(r,n);if(c){let u=ws.parse({method:"notifications/tasks/status",params:c});await this.notification(u),Dn(c.status)&&this._cleanupTaskProgressHandler(r)}},getTaskResult:r=>i.getTaskResult(r,n),updateTaskStatus:async(r,o,s)=>{let c=await i.getTask(r,n);if(!c)throw new Z(F.InvalidParams,`Task "${r}" not found - it may have been cleaned up`);if(Dn(c.status))throw new Z(F.InvalidParams,`Cannot update task "${r}" from terminal status "${c.status}" to "${o}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await i.updateTaskStatus(r,o,s,n);let u=await i.getTask(r,n);if(u){let l=ws.parse({method:"notifications/tasks/status",params:u});await this.notification(l),Dn(u.status)&&this._cleanupTaskProgressHandler(r)}},listTasks:r=>i.listTasks(r,n)}}};function rI(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function iI(t,e){let n={...t};for(let i in e){let r=i,o=e[r];if(o===void 0)continue;let s=n[r];rI(s)&&rI(o)?n[r]={...s,...o}:n[r]=o}return n}var Gw=q_(by(),1),Ww=q_(Kw(),1);function wM(){let t=new Gw.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,Ww.default)(t),t}var Fd=class{constructor(e){this._ajv=e??wM()}getValidator(e){let n="$id"in e&&typeof e.$id=="string"?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return i=>n(i)?{valid:!0,data:i,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(n.errors)}}};var Vd=class{constructor(e){this._server=e}requestStream(e,n,i){return this._server.requestStream(e,n,i)}createMessageStream(e,n){let i=this._server.getClientCapabilities();if((e.tools||e.toolChoice)&&!i?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if(e.messages.length>0){let r=e.messages[e.messages.length-1],o=Array.isArray(r.content)?r.content:[r.content],s=o.some(p=>p.type==="tool_result"),c=e.messages.length>1?e.messages[e.messages.length-2]:void 0,u=c?Array.isArray(c.content)?c.content:[c.content]:[],l=u.some(p=>p.type==="tool_use");if(s){if(o.some(p=>p.type!=="tool_result"))throw new Error("The last message must contain only tool_result content if any is present");if(!l)throw new Error("tool_result blocks are not matching any tool_use from the previous message")}if(l){let p=new Set(u.filter(m=>m.type==="tool_use").map(m=>m.id)),d=new Set(o.filter(m=>m.type==="tool_result").map(m=>m.toolUseId));if(p.size!==d.size||![...p].every(m=>d.has(m)))throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return this.requestStream({method:"sampling/createMessage",params:e},Rs,n)}elicitInputStream(e,n){let i=this._server.getClientCapabilities(),r=e.mode??"form";switch(r){case"url":{if(!i?.elicitation?.url)throw new Error("Client does not support url elicitation.");break}case"form":{if(!i?.elicitation?.form)throw new Error("Client does not support form elicitation.");break}}let o=r==="form"&&e.mode===void 0?{...e,mode:"form"}:e;return this.requestStream({method:"elicitation/create",params:o},bi,n)}async getTask(e,n){return this._server.getTask({taskId:e},n)}async getTaskResult(e,n,i){return this._server.getTaskResult({taskId:e},n,i)}async listTasks(e,n){return this._server.listTasks(e?{cursor:e}:void 0,n)}async cancelTask(e,n){return this._server.cancelTask({taskId:e},n)}};function Jw(t,e,n){if(!t)throw new Error(`${n} does not support task creation (required for ${e})`);switch(e){case"tools/call":if(!t.tools?.call)throw new Error(`${n} does not support task creation for tools/call (required for ${e})`);break;default:break}}function Yw(t,e,n){if(!t)throw new Error(`${n} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!t.sampling?.createMessage)throw new Error(`${n} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!t.elicitation?.create)throw new Error(`${n} does not support task creation for elicitation/create (required for ${e})`);break;default:break}}var qd=class extends sd{constructor(e,n){super(n),this._serverInfo=e,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(Ts.options.map((i,r)=>[i,r])),this.isMessageIgnored=(i,r)=>{let o=this._loggingLevels.get(r);return o?this.LOG_LEVEL_SEVERITY.get(i)<this.LOG_LEVEL_SEVERITY.get(o):!1},this._capabilities=n?.capabilities??{},this._instructions=n?.instructions,this._jsonSchemaValidator=n?.jsonSchemaValidator??new Fd,this.setRequestHandler(oh,i=>this._oninitialize(i)),this.setNotificationHandler(sh,()=>this.oninitialized?.()),this._capabilities.logging&&this.setRequestHandler(mh,async(i,r)=>{let o=r.sessionId||r.requestInfo?.headers["mcp-session-id"]||void 0,{level:s}=i.params,c=Ts.safeParse(s);return c.success&&this._loggingLevels.set(o,c.data),{}})}get experimental(){return this._experimental||(this._experimental={tasks:new Vd(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=iI(this._capabilities,e)}setRequestHandler(e,n){let r=zn(e)?.method;if(!r)throw new Error("Schema is missing a method literal");let o=Ni(r);if(typeof o!="string")throw new Error("Schema method literal must be a string");if(o==="tools/call"){let c=async(u,l)=>{let p=Cn(hi,u);if(!p.success){let g=p.error instanceof Error?p.error.message:String(p.error);throw new Z(F.InvalidParams,`Invalid tools/call request: ${g}`)}let{params:d}=p.data,m=await Promise.resolve(n(u,l));if(d.task){let g=Cn(fi,m);if(!g.success){let y=g.error instanceof Error?g.error.message:String(g.error);throw new Z(F.InvalidParams,`Invalid task creation result: ${y}`)}return g.data}let f=Cn(Kl,m);if(!f.success){let g=f.error instanceof Error?f.error.message:String(f.error);throw new Z(F.InvalidParams,`Invalid tools/call result: ${g}`)}return f.data};return super.setRequestHandler(e,c)}return super.setRequestHandler(e,n)}assertCapabilityForMethod(e){switch(e){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw new Error(`Client does not support sampling (required for ${e})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new Error(`Client does not support elicitation (required for ${e})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new Error(`Client does not support listing roots (required for ${e})`);break;case"ping":break}}assertNotificationCapability(e){switch(e){case"notifications/message":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new Error(`Server does not support notifying about resources (required for ${e})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new Error(`Server does not support notifying of tool list changes (required for ${e})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new Error(`Server does not support notifying of prompt list changes (required for ${e})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new Error(`Client does not support URL elicitation (required for ${e})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"completion/complete":if(!this._capabilities.completions)throw new Error(`Server does not support completions (required for ${e})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new Error(`Server does not support resources (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new Error(`Server does not support tools (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Server does not support tasks capability (required for ${e})`);break;case"ping":case"initialize":break}}assertTaskCapability(e){Yw(this._clientCapabilities?.tasks?.requests,e,"Client")}assertTaskHandlerCapability(e){this._capabilities&&Jw(this._capabilities.tasks?.requests,e,"Server")}async _oninitialize(e){let n=e.params.protocolVersion;return this._clientCapabilities=e.params.capabilities,this._clientVersion=e.params.clientInfo,{protocolVersion:YS.includes(n)?n:eh,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"},Pl)}async createMessage(e,n){if((e.tools||e.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if(e.messages.length>0){let i=e.messages[e.messages.length-1],r=Array.isArray(i.content)?i.content:[i.content],o=r.some(l=>l.type==="tool_result"),s=e.messages.length>1?e.messages[e.messages.length-2]:void 0,c=s?Array.isArray(s.content)?s.content:[s.content]:[],u=c.some(l=>l.type==="tool_use");if(o){if(r.some(l=>l.type!=="tool_result"))throw new Error("The last message must contain only tool_result content if any is present");if(!u)throw new Error("tool_result blocks are not matching any tool_use from the previous message")}if(u){let l=new Set(c.filter(d=>d.type==="tool_use").map(d=>d.id)),p=new Set(r.filter(d=>d.type==="tool_result").map(d=>d.toolUseId));if(l.size!==p.size||![...l].every(d=>p.has(d)))throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return e.tools?this.request({method:"sampling/createMessage",params:e},fh,n):this.request({method:"sampling/createMessage",params:e},Rs,n)}async elicitInput(e,n){switch(e.mode??"form"){case"url":{if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support url elicitation.");let r=e;return this.request({method:"elicitation/create",params:r},bi,n)}case"form":{if(!this._clientCapabilities?.elicitation?.form)throw new Error("Client does not support form elicitation.");let r=e.mode==="form"?e:{...e,mode:"form"},o=await this.request({method:"elicitation/create",params:r},bi,n);if(o.action==="accept"&&o.content&&r.requestedSchema)try{let c=this._jsonSchemaValidator.getValidator(r.requestedSchema)(o.content);if(!c.valid)throw new Z(F.InvalidParams,`Elicitation response content does not match requested schema: ${c.errorMessage}`)}catch(s){throw s instanceof Z?s:new Z(F.InternalError,`Error validating elicitation response: ${s instanceof Error?s.message:String(s)}`)}return o}}}createElicitationCompletionNotifier(e,n){if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:e}},n)}async listRoots(e,n){return this.request({method:"roots/list",params:e},gh,n)}async sendLoggingMessage(e,n){if(this._capabilities.logging&&!this.isMessageIgnored(e.level,n))return this.notification({method:"notifications/message",params:e})}async sendResourceUpdated(e){return this.notification({method:"notifications/resources/updated",params:e})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}};var Qw=Symbol.for("mcp.completable");function $y(t){return!!t&&typeof t=="object"&&Qw in t}function eE(t){return t[Qw]?.complete}var Xw;(function(t){t.Completable="McpCompletable"})(Xw||(Xw={}));var EM=/^[A-Za-z0-9._-]{1,128}$/;function TM(t){let e=[];if(t.length===0)return{isValid:!1,warnings:["Tool name cannot be empty"]};if(t.length>128)return{isValid:!1,warnings:[`Tool name exceeds maximum length of 128 characters (current: ${t.length})`]};if(t.includes(" ")&&e.push("Tool name contains spaces, which may cause parsing issues"),t.includes(",")&&e.push("Tool name contains commas, which may cause parsing issues"),(t.startsWith("-")||t.endsWith("-"))&&e.push("Tool name starts or ends with a dash, which may cause parsing issues in some contexts"),(t.startsWith(".")||t.endsWith("."))&&e.push("Tool name starts or ends with a dot, which may cause parsing issues in some contexts"),!EM.test(t)){let n=t.split("").filter(i=>!/[A-Za-z0-9._-]/.test(i)).filter((i,r,o)=>o.indexOf(i)===r);return e.push(`Tool name contains invalid characters: ${n.map(i=>`"${i}"`).join(", ")}`,"Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)"),{isValid:!1,warnings:e}}return{isValid:!0,warnings:e}}function RM(t,e){if(e.length>0){console.warn(`Tool name validation warning for "${t}":`);for(let n of e)console.warn(` - ${n}`);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 wy(t){let e=TM(t);return RM(t,e.warnings),e.isValid}var Hd=class{constructor(e){this._mcpServer=e}registerToolTask(e,n,i){let r={taskSupport:"required",...n.execution};if(r.taskSupport==="forbidden")throw new Error(`Cannot register task-based tool '${e}' with taskSupport 'forbidden'. Use registerTool() instead.`);return this._mcpServer._createRegisteredTool(e,n.title,n.description,n.inputSchema,n.outputSchema,n.annotations,r,n._meta,i)}};var Kd=class{constructor(e,n){this._registeredResources={},this._registeredResourceTemplates={},this._registeredTools={},this._registeredPrompts={},this._toolHandlersInitialized=!1,this._completionHandlerInitialized=!1,this._resourceHandlersInitialized=!1,this._promptHandlersInitialized=!1,this.server=new qd(e,n)}get experimental(){return this._experimental||(this._experimental={tasks:new Hd(this)}),this._experimental}async connect(e){return await this.server.connect(e)}async close(){await this.server.close()}setToolRequestHandlers(){this._toolHandlersInitialized||(this.server.assertCanSetRequestHandler(qn(Hl)),this.server.assertCanSetRequestHandler(qn(hi)),this.server.registerCapabilities({tools:{listChanged:!0}}),this.server.setRequestHandler(Hl,()=>({tools:Object.entries(this._registeredTools).filter(([,e])=>e.enabled).map(([e,n])=>{let i={name:e,title:n.title,description:n.description,inputSchema:(()=>{let r=Ai(n.inputSchema);return r?Rh(r,{strictUnions:!0,pipeStrategy:"input"}):OM})(),annotations:n.annotations,execution:n.execution,_meta:n._meta};if(n.outputSchema){let r=Ai(n.outputSchema);r&&(i.outputSchema=Rh(r,{strictUnions:!0,pipeStrategy:"output"}))}return i})})),this.server.setRequestHandler(hi,async(e,n)=>{try{let i=this._registeredTools[e.params.name];if(!i)throw new Z(F.InvalidParams,`Tool ${e.params.name} not found`);if(!i.enabled)throw new Z(F.InvalidParams,`Tool ${e.params.name} disabled`);let r=!!e.params.task,o=i.execution?.taskSupport,s="createTask"in i.handler;if((o==="required"||o==="optional")&&!s)throw new Z(F.InternalError,`Tool ${e.params.name} has taskSupport '${o}' but was not registered with registerToolTask`);if(o==="required"&&!r)throw new Z(F.MethodNotFound,`Tool ${e.params.name} requires task augmentation (taskSupport: 'required')`);if(o==="optional"&&!r&&s)return await this.handleAutomaticTaskPolling(i,e,n);let c=await this.validateToolInput(i,e.params.arguments,e.params.name),u=await this.executeToolHandler(i,c,n);return r||await this.validateToolOutput(i,u,e.params.name),u}catch(i){if(i instanceof Z&&i.code===F.UrlElicitationRequired)throw i;return this.createToolError(i instanceof Error?i.message:String(i))}}),this._toolHandlersInitialized=!0)}createToolError(e){return{content:[{type:"text",text:e}],isError:!0}}async validateToolInput(e,n,i){if(!e.inputSchema)return;let o=Ai(e.inputSchema)??e.inputSchema,s=await ed(o,n);if(!s.success){let c="error"in s?s.error:"Unknown error",u=td(c);throw new Z(F.InvalidParams,`Input validation error: Invalid arguments for tool ${i}: ${u}`)}return s.data}async validateToolOutput(e,n,i){if(!e.outputSchema||!("content"in n)||n.isError)return;if(!n.structuredContent)throw new Z(F.InvalidParams,`Output validation error: Tool ${i} has an output schema but no structured content was provided`);let r=Ai(e.outputSchema),o=await ed(r,n.structuredContent);if(!o.success){let s="error"in o?o.error:"Unknown error",c=td(s);throw new Z(F.InvalidParams,`Output validation error: Invalid structured content for tool ${i}: ${c}`)}}async executeToolHandler(e,n,i){let r=e.handler;if("createTask"in r){if(!i.taskStore)throw new Error("No task store provided.");let s={...i,taskStore:i.taskStore};if(e.inputSchema){let c=r;return await Promise.resolve(c.createTask(n,s))}else{let c=r;return await Promise.resolve(c.createTask(s))}}if(e.inputSchema){let s=r;return await Promise.resolve(s(n,i))}else{let s=r;return await Promise.resolve(s(i))}}async handleAutomaticTaskPolling(e,n,i){if(!i.taskStore)throw new Error("No task store provided for task-capable tool.");let r=await this.validateToolInput(e,n.params.arguments,n.params.name),o=e.handler,s={...i,taskStore:i.taskStore},c=r?await Promise.resolve(o.createTask(r,s)):await Promise.resolve(o.createTask(s)),u=c.task.taskId,l=c.task,p=l.pollInterval??5e3;for(;l.status!=="completed"&&l.status!=="failed"&&l.status!=="cancelled";){await new Promise(m=>setTimeout(m,p));let d=await i.taskStore.getTask(u);if(!d)throw new Z(F.InternalError,`Task ${u} not found during polling`);l=d}return await i.taskStore.getTaskResult(u)}setCompletionRequestHandler(){this._completionHandlerInitialized||(this.server.assertCanSetRequestHandler(qn(Gl)),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler(Gl,async e=>{switch(e.params.ref.type){case"ref/prompt":return mx(e),this.handlePromptCompletion(e,e.params.ref);case"ref/resource":return fx(e),this.handleResourceCompletion(e,e.params.ref);default:throw new Z(F.InvalidParams,`Invalid completion reference: ${e.params.ref}`)}}),this._completionHandlerInitialized=!0)}async handlePromptCompletion(e,n){let i=this._registeredPrompts[n.name];if(!i)throw new Z(F.InvalidParams,`Prompt ${n.name} not found`);if(!i.enabled)throw new Z(F.InvalidParams,`Prompt ${n.name} disabled`);if(!i.argsSchema)return ya;let o=zn(i.argsSchema)?.[e.params.argument.name];if(!$y(o))return ya;let s=eE(o);if(!s)return ya;let c=await s(e.params.argument.value,e.params.context);return nE(c)}async handleResourceCompletion(e,n){let i=Object.values(this._registeredResourceTemplates).find(s=>s.resourceTemplate.uriTemplate.toString()===n.uri);if(!i){if(this._registeredResources[n.uri])return ya;throw new Z(F.InvalidParams,`Resource template ${e.params.ref.uri} not found`)}let r=i.resourceTemplate.completeCallback(e.params.argument.name);if(!r)return ya;let o=await r(e.params.argument.value,e.params.context);return nE(o)}setResourceRequestHandlers(){this._resourceHandlersInitialized||(this.server.assertCanSetRequestHandler(qn(Zl)),this.server.assertCanSetRequestHandler(qn(Bl)),this.server.assertCanSetRequestHandler(qn(Fl)),this.server.registerCapabilities({resources:{listChanged:!0}}),this.server.setRequestHandler(Zl,async(e,n)=>{let i=Object.entries(this._registeredResources).filter(([o,s])=>s.enabled).map(([o,s])=>({uri:o,name:s.name,...s.metadata})),r=[];for(let o of Object.values(this._registeredResourceTemplates)){if(!o.resourceTemplate.listCallback)continue;let s=await o.resourceTemplate.listCallback(n);for(let c of s.resources)r.push({...o.metadata,...c})}return{resources:[...i,...r]}}),this.server.setRequestHandler(Bl,async()=>({resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([n,i])=>({name:n,uriTemplate:i.resourceTemplate.uriTemplate.toString(),...i.metadata}))})),this.server.setRequestHandler(Fl,async(e,n)=>{let i=new URL(e.params.uri),r=this._registeredResources[i.toString()];if(r){if(!r.enabled)throw new Z(F.InvalidParams,`Resource ${i} disabled`);return r.readCallback(i,n)}for(let o of Object.values(this._registeredResourceTemplates)){let s=o.resourceTemplate.uriTemplate.match(i.toString());if(s)return o.readCallback(i,s,n)}throw new Z(F.InvalidParams,`Resource ${i} not found`)}),this._resourceHandlersInitialized=!0)}setPromptRequestHandlers(){this._promptHandlersInitialized||(this.server.assertCanSetRequestHandler(qn(Vl)),this.server.assertCanSetRequestHandler(qn(ql)),this.server.registerCapabilities({prompts:{listChanged:!0}}),this.server.setRequestHandler(Vl,()=>({prompts:Object.entries(this._registeredPrompts).filter(([,e])=>e.enabled).map(([e,n])=>({name:e,title:n.title,description:n.description,arguments:n.argsSchema?PM(n.argsSchema):void 0}))})),this.server.setRequestHandler(ql,async(e,n)=>{let i=this._registeredPrompts[e.params.name];if(!i)throw new Z(F.InvalidParams,`Prompt ${e.params.name} not found`);if(!i.enabled)throw new Z(F.InvalidParams,`Prompt ${e.params.name} disabled`);if(i.argsSchema){let r=Ai(i.argsSchema),o=await ed(r,e.params.arguments);if(!o.success){let u="error"in o?o.error:"Unknown error",l=td(u);throw new Z(F.InvalidParams,`Invalid arguments for prompt ${e.params.name}: ${l}`)}let s=o.data,c=i.callback;return await Promise.resolve(c(s,n))}else{let r=i.callback;return await Promise.resolve(r(n))}}),this._promptHandlersInitialized=!0)}resource(e,n,...i){let r;typeof i[0]=="object"&&(r=i.shift());let o=i[0];if(typeof n=="string"){if(this._registeredResources[n])throw new Error(`Resource ${n} is already registered`);let s=this._createRegisteredResource(e,void 0,n,r,o);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),s}else{if(this._registeredResourceTemplates[e])throw new Error(`Resource template ${e} is already registered`);let s=this._createRegisteredResourceTemplate(e,void 0,n,r,o);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),s}}registerResource(e,n,i,r){if(typeof n=="string"){if(this._registeredResources[n])throw new Error(`Resource ${n} is already registered`);let o=this._createRegisteredResource(e,i.title,n,i,r);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),o}else{if(this._registeredResourceTemplates[e])throw new Error(`Resource template ${e} is already registered`);let o=this._createRegisteredResourceTemplate(e,i.title,n,i,r);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),o}}_createRegisteredResource(e,n,i,r,o){let s={name:e,title:n,metadata:r,readCallback:o,enabled:!0,disable:()=>s.update({enabled:!1}),enable:()=>s.update({enabled:!0}),remove:()=>s.update({uri:null}),update:c=>{typeof c.uri<"u"&&c.uri!==i&&(delete this._registeredResources[i],c.uri&&(this._registeredResources[c.uri]=s)),typeof c.name<"u"&&(s.name=c.name),typeof c.title<"u"&&(s.title=c.title),typeof c.metadata<"u"&&(s.metadata=c.metadata),typeof c.callback<"u"&&(s.readCallback=c.callback),typeof c.enabled<"u"&&(s.enabled=c.enabled),this.sendResourceListChanged()}};return this._registeredResources[i]=s,s}_createRegisteredResourceTemplate(e,n,i,r,o){let s={resourceTemplate:i,title:n,metadata:r,readCallback:o,enabled:!0,disable:()=>s.update({enabled:!1}),enable:()=>s.update({enabled:!0}),remove:()=>s.update({name:null}),update:l=>{typeof l.name<"u"&&l.name!==e&&(delete this._registeredResourceTemplates[e],l.name&&(this._registeredResourceTemplates[l.name]=s)),typeof l.title<"u"&&(s.title=l.title),typeof l.template<"u"&&(s.resourceTemplate=l.template),typeof l.metadata<"u"&&(s.metadata=l.metadata),typeof l.callback<"u"&&(s.readCallback=l.callback),typeof l.enabled<"u"&&(s.enabled=l.enabled),this.sendResourceListChanged()}};this._registeredResourceTemplates[e]=s;let c=i.uriTemplate.variableNames;return Array.isArray(c)&&c.some(l=>!!i.completeCallback(l))&&this.setCompletionRequestHandler(),s}_createRegisteredPrompt(e,n,i,r,o){let s={title:n,description:i,argsSchema:r===void 0?void 0:gr(r),callback:o,enabled:!0,disable:()=>s.update({enabled:!1}),enable:()=>s.update({enabled:!0}),remove:()=>s.update({name:null}),update:c=>{typeof c.name<"u"&&c.name!==e&&(delete this._registeredPrompts[e],c.name&&(this._registeredPrompts[c.name]=s)),typeof c.title<"u"&&(s.title=c.title),typeof c.description<"u"&&(s.description=c.description),typeof c.argsSchema<"u"&&(s.argsSchema=gr(c.argsSchema)),typeof c.callback<"u"&&(s.callback=c.callback),typeof c.enabled<"u"&&(s.enabled=c.enabled),this.sendPromptListChanged()}};return this._registeredPrompts[e]=s,r&&Object.values(r).some(u=>{let l=u instanceof pi?u._def?.innerType:u;return $y(l)})&&this.setCompletionRequestHandler(),s}_createRegisteredTool(e,n,i,r,o,s,c,u,l){wy(e);let p={title:n,description:i,inputSchema:tE(r),outputSchema:tE(o),annotations:s,execution:c,_meta:u,handler:l,enabled:!0,disable:()=>p.update({enabled:!1}),enable:()=>p.update({enabled:!0}),remove:()=>p.update({name:null}),update:d=>{typeof d.name<"u"&&d.name!==e&&(typeof d.name=="string"&&wy(d.name),delete this._registeredTools[e],d.name&&(this._registeredTools[d.name]=p)),typeof d.title<"u"&&(p.title=d.title),typeof d.description<"u"&&(p.description=d.description),typeof d.paramsSchema<"u"&&(p.inputSchema=gr(d.paramsSchema)),typeof d.outputSchema<"u"&&(p.outputSchema=gr(d.outputSchema)),typeof d.callback<"u"&&(p.handler=d.callback),typeof d.annotations<"u"&&(p.annotations=d.annotations),typeof d._meta<"u"&&(p._meta=d._meta),typeof d.enabled<"u"&&(p.enabled=d.enabled),this.sendToolListChanged()}};return this._registeredTools[e]=p,this.setToolRequestHandlers(),this.sendToolListChanged(),p}tool(e,...n){if(this._registeredTools[e])throw new Error(`Tool ${e} is already registered`);let i,r,o,s;if(typeof n[0]=="string"&&(i=n.shift()),n.length>1){let u=n[0];if(Ey(u))r=n.shift(),n.length>1&&typeof n[0]=="object"&&n[0]!==null&&!Ey(n[0])&&(s=n.shift());else if(typeof u=="object"&&u!==null){if(Object.values(u).some(l=>typeof l=="object"&&l!==null))throw new Error(`Tool ${e} expected a Zod schema or ToolAnnotations, but received an unrecognized object`);s=n.shift()}}let c=n[0];return this._createRegisteredTool(e,void 0,i,r,o,s,{taskSupport:"forbidden"},void 0,c)}registerTool(e,n,i){if(this._registeredTools[e])throw new Error(`Tool ${e} is already registered`);let{title:r,description:o,inputSchema:s,outputSchema:c,annotations:u,_meta:l}=n;return this._createRegisteredTool(e,r,o,s,c,u,{taskSupport:"forbidden"},l,i)}prompt(e,...n){if(this._registeredPrompts[e])throw new Error(`Prompt ${e} is already registered`);let i;typeof n[0]=="string"&&(i=n.shift());let r;n.length>1&&(r=n.shift());let o=n[0],s=this._createRegisteredPrompt(e,void 0,i,r,o);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),s}registerPrompt(e,n,i){if(this._registeredPrompts[e])throw new Error(`Prompt ${e} is already registered`);let{title:r,description:o,argsSchema:s}=n,c=this._createRegisteredPrompt(e,r,o,s,i);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),c}isConnected(){return this.server.transport!==void 0}async sendLoggingMessage(e,n){return this.server.sendLoggingMessage(e,n)}sendResourceListChanged(){this.isConnected()&&this.server.sendResourceListChanged()}sendToolListChanged(){this.isConnected()&&this.server.sendToolListChanged()}sendPromptListChanged(){this.isConnected()&&this.server.sendPromptListChanged()}};var OM={type:"object",properties:{}};function rE(t){return t!==null&&typeof t=="object"&&"parse"in t&&typeof t.parse=="function"&&"safeParse"in t&&typeof t.safeParse=="function"}function iE(t){return"_def"in t||"_zod"in t||rE(t)}function Ey(t){return typeof t!="object"||t===null||iE(t)?!1:Object.keys(t).length===0?!0:Object.values(t).some(rE)}function tE(t){if(t){if(Ey(t))return gr(t);if(!iE(t))throw new Error("inputSchema must be a Zod schema or raw shape, received an unrecognized object");return t}}function PM(t){let e=zn(t);return e?Object.entries(e).map(([n,i])=>{let r=xx(i),o=Ix(i);return{name:n,description:r,required:!o}}):[]}function qn(t){let n=zn(t)?.method;if(!n)throw new Error("Schema is missing a method literal");let i=Ni(n);if(typeof i=="string")return i;throw new Error("Schema method literal must be a string")}function nE(t){return{completion:{values:t.slice(0,100),total:t.length,hasMore:t.length>100}}}var ya={completion:{values:[],hasMore:!1}};var _a=a.object({endpoint:a.string().min(1).max(256).optional(),apiKey:a.string().min(1).max(256).optional(),workspace:a.string().min(1).max(256).optional(),region:a.string().min(1).max(256).optional()}).strict(),oE=a.enum(["SUM","COUNT","MAX","UNIQUE_COUNT","LATEST"]),Ty=a.object({d:a.number().int().nonnegative(),w:a.number().int().positive(),c:a.number().nonnegative(),agg:oE.default("COUNT").optional(),valueProperty:a.string().optional(),uniqueProperty:a.string().optional(),provenance:a.enum(["plan","manual","provider"]).optional(),warnAt:a.number().min(0).max(1).optional(),scope:_a.optional()}),AM=a.object({kind:a.literal("credential_validity")}),NM=a.object({kind:a.literal("track_only_bypass")}),CM=a.object({kind:a.literal("lifecycle_block"),blockOn:a.array(a.string()).default(["SUSPENDED","CANCELLED","INACTIVE"]),code:a.string().default("subscription_inactive")}),zM=a.object({kind:a.literal("scope"),requireExplicit:a.boolean().default(!0)}),DM=a.object({kind:a.literal("permission"),mode:a.enum(["grace","closed"]).optional()}),jM=a.object({kind:a.literal("geo_restriction"),allow:a.array(a.string().length(2).regex(/^[A-Z]{2}$/)).optional(),block:a.array(a.string().length(2).regex(/^[A-Z]{2}$/)).optional()}).refine(t=>t.allow!==void 0||t.block!==void 0,{message:"geo_restriction requires either `allow` or `block`"}),UM=a.enum(["fixed_window","sliding_window","token_bucket"]),MM=Ty.extend({kind:a.literal("rate_limit"),m:a.enum(["e","t"]).default("e"),strategy:UM.default("fixed_window"),bucket_capacity:a.number().positive().optional(),refill_rate_per_second:a.number().positive().optional()}).superRefine((t,e)=>{t.strategy==="token_bucket"?(t.bucket_capacity===void 0&&e.addIssue({code:"custom",message:"token_bucket strategy requires `bucket_capacity` (positive number)",path:["bucket_capacity"]}),t.refill_rate_per_second===void 0&&e.addIssue({code:"custom",message:"token_bucket strategy requires `refill_rate_per_second` (positive number)",path:["refill_rate_per_second"]})):(t.bucket_capacity!==void 0&&e.addIssue({code:"custom",message:`bucket_capacity is only valid when strategy === 'token_bucket' (got '${t.strategy}')`,path:["bucket_capacity"]}),t.refill_rate_per_second!==void 0&&e.addIssue({code:"custom",message:`refill_rate_per_second is only valid when strategy === 'token_bucket' (got '${t.strategy}')`,path:["refill_rate_per_second"]}))}),LM=a.enum(["fixed_window","sliding_window"]),ZM=Ty.extend({kind:a.literal("quota"),ovr:a.enum(["BLOCK","ALLOW_AND_BILL"]),strategy:LM.default("fixed_window")}),BM=Ty.extend({kind:a.literal("credit_balance"),ovr:a.enum(["BLOCK","ALLOW_AND_BILL"])}),FM=a.object({kind:a.literal("concurrency"),dimension:a.string().min(1).max(120),limit:a.number().int().positive(),lease_ttl_seconds:a.number().int().positive().max(3600).default(60)}),VM=a.object({kind:a.literal("resource_limit"),resource:a.string().min(1).max(120),limit:a.number().int().nonnegative()}),qM=a.object({kind:a.literal("reservation"),dimension:a.string().min(1).max(120),max_outstanding:a.number().int().positive(),hold_seconds:a.number().int().positive().max(86400)}),HM=a.enum(["plan","manual","provider"]),Ry=a.object({maxInputTokens:a.number().int().positive().optional(),maxOutputTokens:a.number().int().positive().optional(),maxContextTokens:a.number().int().positive().optional(),maxPayloadBytes:a.number().int().positive().optional(),enforcement:a.enum(["enforce","track"]).default("enforce"),failMode:a.enum(["open","closed"]).default("open"),tokenCountSource:a.enum(["declared","estimated"]).optional(),scope:_a.optional()}).refine(sE,{message:"capacity requires at least one ceiling (maxInputTokens / maxOutputTokens / maxContextTokens / maxPayloadBytes)"});function sE(t){return t.maxInputTokens!==void 0||t.maxOutputTokens!==void 0||t.maxContextTokens!==void 0||t.maxPayloadBytes!==void 0}var KM=a.object({kind:a.literal("capacity"),maxInputTokens:a.number().int().positive().optional(),maxOutputTokens:a.number().int().positive().optional(),maxContextTokens:a.number().int().positive().optional(),maxPayloadBytes:a.number().int().positive().optional(),enforcement:a.enum(["enforce","track"]).default("enforce"),failMode:a.enum(["open","closed"]).default("open"),tokenCountSource:a.enum(["declared","estimated"]).optional(),scope:_a.optional(),provenance:HM.optional()}).refine(sE,{message:"capacity requires at least one ceiling (maxInputTokens / maxOutputTokens / maxContextTokens / maxPayloadBytes)"}),Oy=a.discriminatedUnion("kind",[AM,NM,CM,zM,DM,jM,MM,ZM,BM,VM,FM,qM,KM]);var va=["customer_operation","control_plane","admin_internal","background_job","webhook","healthcheck","unclassified"],OW=new Set(va);var Gd=a.object({trafficClass:a.enum(va),policySource:a.enum(["declared","inherited","defaulted","inferred"]),limitParticipation:a.object({profile:a.enum(["customer_usage","business_capacity","control_plane","admin_internal","platform_abuse_only","healthcheck","none"]),pools:a.array(a.string().min(1)).optional(),scopes:a.array(a.object({endpoint:a.string().optional(),apiKey:a.string().optional(),workspace:a.string().optional(),region:a.string().optional()}).passthrough()).optional(),metrics:a.array(a.string().min(1)).optional()}).passthrough(),customerBillingPolicy:a.object({customerBillable:a.boolean(),meterKey:a.string().min(1).optional(),chargeableOutcomes:a.enum(["success_only","success_and_partial","attempted","trusted_actual_usage_only"]),invoiceBehavior:a.string().optional()}).passthrough(),providerCostPolicy:a.object({providerCostTracked:a.boolean(),declaredProviderHint:a.string().optional(),declaredModelHint:a.string().optional()}).passthrough()}).passthrough();var ZW=a.object({keyId:a.string().min(1),orgId:a.string().min(1),principal:a.object({subjectKind:a.enum(["member","service"]),memberId:a.string().optional(),serviceAccountId:a.string().optional(),keyId:a.string()}),businessId:a.string().min(1),compiledPlanId:a.string().min(1),entitlementHash:a.string().optional(),subjectKey:a.string().min(1),subscriptionId:a.string().min(1),currentPeriodId:a.string().optional(),currentPeriodStartMs:a.number().optional(),subscriberId:a.string().min(1),apiKeyId:a.string().nullable(),entitlementVersion:a.number(),status:a.enum(["active","revoked"]),expiresAt:a.number().nullable().optional(),subscriberStatus:a.enum(["ONBOARDING","ACTIVE","SUSPENDED"]),subscriptionStatus:a.string().min(1),environment:a.enum(["production","sandbox"]).optional(),environmentId:a.string().optional(),scopes:a.array(a.string()).readonly().optional(),entitlement:a.record(a.string(),a.unknown()).nullable().optional()});var aE=a.object({unit:a.enum(["requests","tokens","computeMs","dollars"]),window:a.enum(["second","minute","hour","day","week","month"]),capacity:a.number()}),GM=a.object({id:a.string().min(1),slug:a.string().optional(),transportMode:a.enum(["direct","tunnel"]),verificationRequired:a.boolean().optional(),originUrl:a.string().optional(),originHostname:a.string().optional(),accessCredentialRef:a.string().optional(),policyVersion:a.string().optional()}),BW=a.object({id:a.string().min(1),origin:a.string().min(1),sandboxOrigin:a.string().nullable().optional(),authHeader:a.string().optional(),pricing:a.object({requests:a.number().optional(),tokens:a.number().optional(),computeMs:a.number().optional(),per_request:a.number().optional()}).catchall(a.number().optional()).optional(),metering:a.object({tokens:a.object({}).optional(),computeMs:a.object({}).optional(),billOn4xx:a.boolean().optional()}).optional(),tenantLimits:a.array(aE).readonly().optional(),userLimits:a.array(aE).readonly().optional(),environmentId:a.string().optional(),contextTokenSecret:a.string().nullable().optional(),timeoutMs:a.number().positive().optional(),idleTimeoutMs:a.number().positive().optional(),backends:a.array(GM).optional(),defaultBackendId:a.string().optional(),verificationRequired:a.boolean().optional(),allowedOrigins:a.array(a.string()).optional(),hasPublicRoutes:a.boolean().optional(),publicRoutesCompiledPlanId:a.string().min(1).optional()});var WM=a.object({perRequestMinUnitsByDim:a.record(a.string(),a.number()).optional(),creditPoolMicros:a.number().optional(),perDimUnitCostMicros:a.record(a.string(),a.number()).optional()}),JM=a.object({source:a.enum(["fixed","provider_catalog"]),meterKey:a.string(),selector:a.string().optional(),measures:a.array(a.string()),catalog:a.string().optional(),pricePolicy:a.string().optional(),markupPercent:a.number().optional(),fixedRatesMicros:a.record(a.string(),a.record(a.string(),a.number())).optional()}),YM=a.object({key:a.string(),display:a.string(),unit:a.string().optional(),aggregation:a.enum(["SUM","COUNT","MAX","UNIQUE_COUNT","LATEST"]),window:a.enum(["minute","hour","day","month","billing_period"]),enforcementType:a.string()}),XM=a.object({routeId:a.string().min(1),method:a.string(),path:a.string(),meters:a.array(a.string()).optional(),usagePolicy:Gd.optional(),policyResolutionMode:a.literal("policy").optional()}),FW=a.object({v:a.number(),sub:a.string(),compiledPlanId:a.string().min(1),planType:a.string(),ts:a.number(),constraints:a.array(Oy),cv:a.number(),policyResolutionMode:a.literal("policy").optional(),dm:a.record(a.string(),a.number()),dmv:a.number().optional(),floor:WM.nullable().optional(),displayDims:a.array(a.number()).optional(),meterSemantics:a.record(a.string(),YM).optional(),rp:a.record(a.string(),JM).optional(),fr:a.array(XM).optional(),sig:a.string().min(1),sigKid:a.string().optional(),environmentId:a.string().optional()}).passthrough();var VW=a.object({subscriptionId:a.string().min(1),activePeriodId:a.string().optional(),activeCompiledPlanId:a.string().min(1),activeEntitlementHash:a.string().optional(),enforcementMode:a.enum(["STRICT","GRACE","TRACK_ONLY"]),postStreamLockouts:a.array(a.object({code:a.literal("post_stream_overspend"),reason:a.literal("usage_exhausted"),constraintKey:a.string().min(1),cycleId:a.string().min(1),dimension:a.string().min(1),currentCapacity:a.number().nonnegative(),observedUsage:a.number().nonnegative(),lockedAt:a.string().min(1),expiresAt:a.string().min(1)})).optional(),gracePeriodEndsAt:a.string().optional(),trialEndsAt:a.string().optional(),scheduledTransition:a.object({kind:a.string(),timing:a.string(),scheduledFor:a.string(),toCompiledPlanId:a.string().nullable()}).optional(),creditPool:a.object({periodStartMs:a.number(),periodEndMs:a.number(),grantedCents:a.number(),policy:a.enum(["block","allow"]),epoch:a.number()}).optional(),dedicatedShard:a.enum(["ACTIVE","DRAINING"]).optional(),memberAuthz:a.record(a.string(),a.object({permissions:a.array(a.string()),roles:a.array(a.string())})).optional(),memberAuthzComputedAt:a.number().optional(),generation:a.number(),updatedAt:a.string()});var QM=["DRAFT","ACTIVE"],KW=a.enum(QM),eL=["ONBOARDING","ACTIVE","SUSPENDED"],cE=a.enum(eL),tL=["ACTIVE","REVOKED"],GW=a.enum(tL),nL=["BLOCK","ALLOW_AND_BILL"],uE=a.enum(nL),rL=["ACTIVE","ARCHIVED"],WW=a.enum(rL),iL=["ACTIVE","PHASING_OUT","SUPERSEDED","ARCHIVED"],JW=a.enum(iL);var lE=["input","output","total","cached_read_input","cache_creation_input","context","max_output","estimated_output","actual_output","streaming_output"];var oL="FS_RUNTIME_TOKEN";var sL={payload:"x-fs-metering",signature:"x-fs-metering-sig",token:"x-fs-metering-token"};var nJ={environmentVariable:oL,presentation:sL.token,storage:"sha256-hash-only"};var dE={missingSignature:"missing_signature",malformedSignature:"malformed_signature",unknownKeyId:"unknown_key_id",jwksUnavailable:"jwks_unavailable",badSignature:"bad_signature",bodyHashMismatch:"body_hash_mismatch",routeMismatch:"route_mismatch",clockSkew:"clock_skew",expiredSignature:"expired_signature",replayedNonce:"replayed_nonce",bodyTooLarge:"body_too_large",environmentMismatch:"environment_mismatch",missingToken:"missing_token",invalidToken:"invalid_token",contextUnverified:"context_unverified",memberSubjectRequired:"member_subject_required",serviceSubjectRequired:"service_subject_required",surfaceNotAllowed:"surface_not_allowed"};var rJ=10*1024*1024;var aL=["CHECKOUT_COMPLETED","PLAN_CHANGED","CANCELLED","RESTORED","UNSCHEDULED_CANCELLATION","PRICE_ROLLOVER","PAUSED","RESUMED","PLAN_CHANGE_SCHEDULED","PLAN_CHANGE_ABORTED","SCHEDULE_CREATED","SCHEDULE_UPDATED","SCHEDULE_RELEASED","SCHEDULE_COMPLETED","SCHEDULE_ABORTED","CANCEL_SCHEDULED","PAYMENT_FAILED","PAYMENT_RECOVERED","PAYMENT_RECOVERED_FROM_SUSPENDED","PAYMENT_ACTION_REQUIRED","RECURRING_PAYMENT","REFUND_PROCESSED","DISPUTE_OPENED","DISPUTE_FUNDS_WITHDRAWN","DISPUTE_CLOSED","DISPUTE_FUNDS_REINSTATED","DISPUTE_CREDIT_REVOKED","DISPUTE_CREDIT_REINSTATED","MIN_SPEND_TRUE_UP"],sJ=a.enum(aL);var Py=["BRANCH_PREFIX","PULL_REQUEST","DISABLED"];var cL=a.object({d:a.number(),w:a.number(),capacity:a.number(),remaining:a.number(),windowStart:a.number(),windowEnd:a.number()}),uL=a.record(a.string(),cL),lL=a.object({allocations:a.array(a.number()),expiresAt:a.number()}),dL=a.record(a.string(),lL),pL=a.record(a.string(),a.bigint()),fJ=a.object({subscriptionId:a.string(),handoffToken:a.string(),targetShardId:a.string(),policyVersion:a.number(),entitlementVersion:a.number().nullable(),windowStates:uL,activeLeases:dL,totalsByDimension:pL.optional(),billingCycleId:a.string().nullable().optional(),billingCycleStartMs:a.number().optional()});var pE=new Set(["read","export","download"]);var mE={org:["read","create","update","delete","manage_settings","manage_billing"],business:["read","create","update","delete","publish","archive"],plan:["read","create","update","delete","promote_version"],makertoken:["read","create","rotate","revoke"],webhook:["read","configure","rotate_secret"],persona:["read","issue","rotate","revoke"],migration:["create"],auth_provider_connection:["read","create","update","delete"],subscription:["read","cancel","restore","change_plan"],usage:["read","export"],invoice:["read","pay","download"],billing:["read","manage_subscription","refund","change_payment_method"],team:["read","invite","remove_member","change_role","manage_rbac","assign_product_role"],apikey:["read","create","rotate","revoke"],audit_log:["read","export"]},_J=Object.keys(mE),vJ=Object.fromEntries(Object.entries(mE).map(([t,e])=>[t,{read:e.filter(n=>pE.has(n)),write:e.filter(n=>!pE.has(n))}]));var mL=new Set(["GET","HEAD","OPTIONS"]);function fE(t,e){return mL.has(e.toUpperCase())?`${t}:read`:`${t}:write`}var fL={gatewayProjectRead:"gateway:project:read",gatewayResourceWrite:"gateway:resource:write",usageWrite:"usage:write",authzDeniedWrite:"authz-denied:write",reservationAuthorize:"reservation:authorize",reservationFinalize:"reservation:finalize",internalCronRun:"internal:cron:run",personaManage:"persona:manage",proxyTrust:"proxy:trust",internalAdmin:"internal:admin",agentDispatch:"agent:dispatch",buildDispatch:"build:dispatch",internalNotify:"internal:notify",analyticsQuery:"analytics:query"},$J=Object.values(fL);var gL=["managed_frontend","custom_frontend","embedded_sdk","public_api","cli","agent","webhook","admin","internal"],hE=a.enum(gL),gE=a.string().min(1).max(128),hL=a.object({d:a.number().int().nonnegative(),w:a.number().int().positive(),rem:a.number(),cap:a.number()}).strict(),bE=a.object({v:a.literal(1),entV:a.number().int().nonnegative().optional(),entHash:gE.optional(),featureGrant:a.boolean().optional(),gates:a.array(gE).max(16).optional(),limits:a.array(hL).max(16).optional()}).strict();var bL=["resource_lifecycle_only","platform_only_request","provider_restamped","usage_policy","legacy_tenant_metering"],yL=["credentialed_gateway_work","no_resolved_credential"],NJ=a.object({requestId:a.string(),eventId:a.string(),tenantId:a.string(),slug:a.string(),subscriptionId:a.string(),subscriberId:a.string(),apiKeyId:a.string().nullable(),compiledPlanId:a.string(),subscriberStatus:cE,subscriptionStatus:a.string(),businessId:a.string(),statusCode:a.number(),path:a.string(),latencyMs:a.number(),upstreamMs:a.number().nonnegative().finite().optional(),rawDimsUnits:a.record(a.string(),a.number()),matchedRouteMeters:a.array(a.string().min(1)).optional(),servedRouteScopes:a.array(a.string().min(1)).optional(),meterSettlements:a.array(a.object({meterId:a.string(),meterType:a.enum(["exact_pre_request","estimated_then_settled","postpaid","strict_concurrency"]),reserved:a.number(),actual:a.number(),delta:a.number(),dimension:a.number().int().nonnegative(),leaseId:a.string()})).optional(),reportingAttested:a.boolean(),customerBillable:a.boolean(),platformBillable:a.boolean().optional(),customerBillableReason:a.enum(bL).optional(),platformBillableReason:a.enum(yL).optional(),postStreamPending:a.boolean().optional(),measureContext:a.record(a.string(),a.unknown()).optional(),creditUnitsConsumed:a.record(a.string(),a.number()).optional(),timestamp:a.number(),environmentId:a.string().nullable().optional(),orgId:a.string().optional(),principal:a.object({subjectKind:a.enum(["member","service"]),memberId:a.string().trim().min(1).optional(),serviceAccountId:a.string().trim().min(1).optional(),keyId:a.string().trim().min(1).optional()}).optional(),subjectKey:a.string().optional(),overageBehavior:uE.optional(),environment:a.enum(["production","sandbox"]).optional(),surface:hE.optional(),actionId:a.string().min(1).max(128).optional(),resourceMutationId:a.string().min(1).max(200).optional(),subjectType:a.string().min(1).max(128).optional(),subjectId:a.string().min(1).max(256).optional(),decision:bE.optional(),decisionId:a.string().min(1).max(256).optional(),denyClass:a.enum(["quota","rate","concurrency","capacity","spend","adaptive"]).optional(),blockingConstraintId:a.string().min(1).max(256).optional(),providerSettlements:a.array(a.object({meterId:a.string(),providerReported:a.number(),reconciled:a.number()})).optional(),usagePolicyId:a.string().min(1).max(256).optional(),policySource:a.enum(["declared","inherited","defaulted","inferred"]).optional(),trafficClass:a.enum(va).optional(),limitProfile:a.enum(["customer_usage","business_capacity","control_plane","admin_internal","platform_abuse_only","healthcheck","none"]).optional(),leaseId:a.string(),transactionId:a.string(),gatewayMetadata:a.object({shardId:a.string(),policyVersion:a.number().int().nonnegative().optional(),artifactVersion:a.number().int().nonnegative().default(0),artifactHash:a.string().regex(/^sha256_[a-f0-9]{64}$/).optional(),leaseTelemetry:a.object({consumeRequests:a.number().int().nonnegative(),localLeaseHits:a.number().int().nonnegative(),doAllocationAttempts:a.number().int().nonnegative(),doAllocationGrants:a.number().int().nonnegative(),doAllocationDenials:a.number().int().nonnegative(),doUnavailable:a.number().int().nonnegative(),doCircuitOpen:a.number().int().nonnegative(),leaseRefreshSingleflightJoins:a.number().int().nonnegative(),leaseRefreshSingleflightJoinRate:a.number().min(0).max(1),expiredLeasesReaped:a.number().int().nonnegative(),expiredLeaseReclaimedGrant:a.array(a.number().nonnegative()),reconcileRequests:a.number().int().nonnegative(),reconcilePositiveDeltas:a.number().int().nonnegative(),reconcileNoLocalLease:a.number().int().nonnegative(),doReconcileAttempts:a.number().int().nonnegative(),doReconcileFailures:a.number().int().nonnegative(),unspentLeaseRemainderReturns:a.number().int().nonnegative(),unspentLeaseRemainderReturnFailures:a.number().int().nonnegative(),unspentLeaseRemainderReturnedGrant:a.array(a.number().nonnegative()),maxObservedPositiveReconcileDelta:a.array(a.number().nonnegative()),requestToDoRatio:a.number().nonnegative(),localLeaseHitRate:a.number().min(0).max(1),localSpendRate:a.number().min(0).max(1),maxObservedActiveLeases:a.number().int().nonnegative(),maxObservedOutstandingGrant:a.array(a.number().nonnegative()),maxObservedOutstandingGrantRatio:a.number().nonnegative(),maxObservedEmergencyReserveGrant:a.array(a.number().nonnegative()),maxObservedEmergencyReserveGrantRatio:a.number().nonnegative(),maxObservedLeaseGrant:a.array(a.number().nonnegative()),maxObservedLeaseGrantRatio:a.number().nonnegative(),maxObservedLeaseTtlMs:a.number().int().nonnegative()}).optional(),artifactCacheTelemetry:a.object({reads:a.number().int().nonnegative(),l0FreshHits:a.number().int().nonnegative(),l0Misses:a.number().int().nonnegative(),l0StaleServes:a.number().int().nonnegative(),l0StaleIfErrorServes:a.number().int().nonnegative(),l0BlockingRefreshes:a.number().int().nonnegative(),l0SingleflightJoins:a.number().int().nonnegative(),l0EarlyRefreshes:a.number().int().nonnegative(),l1Hits:a.number().int().nonnegative(),l1Misses:a.number().int().nonnegative(),l1Rejected:a.number().int().nonnegative(),l1WriteFailures:a.number().int().nonnegative(),kvHits:a.number().int().nonnegative(),kvMisses:a.number().int().nonnegative(),kvTimeouts:a.number().int().nonnegative(),kvCircuitOpenReads:a.number().int().nonnegative(),resultHits:a.number().int().nonnegative(),resultMisses:a.number().int().nonnegative(),resultDenied:a.number().int().nonnegative(),resultUnavailable:a.number().int().nonnegative(),backgroundRefreshErrors:a.number().int().nonnegative(),l0HitRate:a.number().min(0).max(1),l0SingleflightJoinRate:a.number().min(0).max(1),l0EarlyRefreshRate:a.number().min(0).max(1),l1HitRate:a.number().min(0).max(1),kvHitRate:a.number().min(0).max(1),resultHitRate:a.number().min(0).max(1),staleServeRate:a.number().min(0).max(1)}).optional(),gatewayVersion:a.string()}).passthrough()}).passthrough();var _L=a.object({path:a.string(),code:a.string(),message:a.string()}),DJ=a.object({reason:a.literal("schema_validation_failed"),receivedAt:a.string(),rawPayload:a.unknown(),issues:a.array(_L),consumerVersion:a.string().optional(),originalMessageId:a.string().optional()});var yE=[{name:"subscription.created",webhook:!0,description:"A subscriber subscription was created."},{name:"subscription.updated",webhook:!0,description:"A subscriber subscription changed (plan, status, trial)."},{name:"subscription.canceled",webhook:!0,description:"A subscriber subscription was canceled."},{name:"payment.succeeded",webhook:!0,description:"A Stripe payment succeeded for a subscription."},{name:"payment.failed",webhook:!0,description:"A Stripe payment failed for a subscription."},{name:"rate_limit.exceeded",webhook:!0,description:"The gateway denied a request for exceeding a rate limit."},{name:"entitlement.changed",webhook:!0,description:"A compiled entitlement/plan was (re)published."},{name:"usage.threshold_reached",webhook:!0,description:"A metered-usage threshold was crossed."},{name:"usage.recorded",webhook:!1,description:"The gateway recorded one usage fact; the canonical usage queue remains the coordination path and the event stream is its evidence copy."},{name:"gateway.request_denied",webhook:!1,description:"The gateway denied a request during admission or enforcement and recorded the normalized LimitDecision as evidence."},{name:"change_set.created",webhook:!1,description:"A governed Evolution ChangeSet was proposed (draft created)."},{name:"change_set.approved",webhook:!1,description:"A governed Evolution ChangeSet was approved."},{name:"change_set.applied",webhook:!1,description:"A governed Evolution ChangeSet was applied to live state."},{name:"change_set.rolled_back",webhook:!1,description:"A governed Evolution ChangeSet was rolled back."},{name:"change_set.cancelled",webhook:!1,description:"A governed Evolution ChangeSet was cancelled."},{name:"billing.event_recorded",webhook:!1,description:"A BillingEvent row was recorded; the fact references it by id (the authoritative billing row is unchanged \u2014 exact-accounting invariant)."},{name:"authz.decision",webhook:!1,description:"An authorization decision (ALLOW/DENY) mirrored from the audit log onto the spine; AuditLog stays authoritative."},{name:"repo.changed",webhook:!1,description:"A default-branch push to the business's repo touched paths at least one enabled automation rule watches (payload: branch, headSha, bounded changed-path list). Emitted pre-filtered \u2014 never on every push \u2014 so path-triggered automations (e.g. legal/** changed \u2192 notify subscribers) can fire deterministically."},{name:"automation.rule_fired",webhook:!1,description:"An enabled AutomationRule matched a spine fact (trigger + all conditions held) and its actions were scheduled."},{name:"automation.action_succeeded",webhook:!1,description:"An AutomationRule action ran to success."},{name:"automation.action_failed",webhook:!1,description:"An AutomationRule action failed (will retry per the queue)."},{name:"automation.action_denied",webhook:!1,description:"An AutomationRule action was DENIED \u2014 the automation actor lacked the action's native permission (automation is a first-class authz subject, never a bypass). Recorded + audited; the action did not run."},{name:"automation.notification",webhook:!1,description:"A notification recorded by an AutomationRule `create_notification` action \u2014 a spine fact other surfaces (portal/admin) read; no separate notification runtime."},{name:"access_request.created",webhook:!1,description:"A subscriber member requested a missing permission (AccessRequest row created). Internal \u2014 the Communication layer notifies the subscriber's admins (who can grant it)."},{name:"access_request.resolved",webhook:!1,description:"A pending AccessRequest was resolved (approved or denied) by an owner/admin. Internal \u2014 notifies the subscriber's admins."},{name:"build.failed",webhook:!1,description:"A build for the business (frontend/portal or Business-SDK) failed and did not go live. Internal \u2014 the Communication layer notifies the org's members (opt-out-able, category: deployments)."},{name:"product.published",webhook:!1,description:"A business went live for the first time (DRAFT\u2192ACTIVE first publish). Internal \u2014 notifies the org's members (category: deployments)."},{name:"workflow.failed",webhook:!1,description:"A platform workflow (config apply / Stripe sync / subscription transition) reached a terminal FAILED state. Internal \u2014 notifies the org's admins (category: deployments)."},{name:"pr.review_posted",webhook:!1,description:"The platform posted (or updated) its Business-as-Code impact report on a managed-repo pull request. Internal \u2014 emails the org's members the review synopsis + a link to the PR (category: deployments)."}],vL=yE.map(t=>t.name),_E=yE.filter(t=>t.webhook).map(t=>t.name),Qt=a.enum(vL);var vE=["subscription.created","subscription.updated","subscription.canceled","payment.succeeded","payment.failed","rate_limit.exceeded","entitlement.changed","usage.threshold_reached"],Ay=vE;{let t=new Set(_E),e=new Set(vE),n=[...t].filter(r=>!e.has(r)),i=[...e].filter(r=>!t.has(r));if(n.length>0||i.length>0)throw new Error(`[webhooks/events] WEBHOOK_EVENT_NAMES drifted from the events catalog. Missing from order tuple: [${n.join(", ")}]; extra in order tuple: [${i.join(", ")}]. Reconcile ../events/catalog.ts (webhook: true entries) with WEBHOOK_EVENT_ORDER in this file.`)}var Yi=a.enum(Ay);var Lt=a.enum(["immediate","period_end"]),Xi=a.object({default:Lt.default("period_end"),when:a.object({price_increase:Lt.optional(),price_decrease:Lt.optional(),route_grant_added:Lt.optional(),route_grant_removed:Lt.optional(),limit_increased:Lt.optional(),limit_reduced:Lt.optional(),credit_increased:Lt.optional(),credit_reduced:Lt.optional(),rating_changed:Lt.optional()}).strict().default({price_increase:"period_end",price_decrease:"immediate",route_grant_added:"immediate",route_grant_removed:"period_end",limit_increased:"immediate",limit_reduced:"period_end",credit_increased:"immediate",credit_reduced:"period_end",rating_changed:"period_end"}),allowImmediatePriceIncrease:a.boolean().default(!1),allowImmediateEntitlementReduction:a.boolean().default(!1)}).strict().superRefine((t,e)=>{(t.when.price_increase??t.default)==="immediate"&&!t.allowImmediatePriceIncrease&&e.addIssue({code:"custom",path:["when","price_increase"],message:"price_increase cannot switch immediately without allowImmediatePriceIncrease: true"});for(let n of["route_grant_removed","limit_reduced","credit_reduced"])(t.when[n]??t.default)==="immediate"&&!t.allowImmediateEntitlementReduction&&e.addIssue({code:"custom",path:["when",n],message:`${n} cannot switch immediately without allowImmediateEntitlementReduction: true`})}),kL=Xi.parse({});var SL=a.object({kind:a.literal("credit"),amount_cents:a.number().int().nonnegative(),recurs:a.boolean().optional(),expires_after_days:a.number().int().positive().optional(),label:a.string().min(1).max(120).optional()}),xL=a.object({kind:a.literal("top_up"),sku:a.string().min(1).max(120),label:a.string().min(1).max(200),price_cents:a.number().int().positive(),credit_cents:a.number().int().positive()}),Hn=a.discriminatedUnion("kind",[SL,xL]);function kE(t){return t.kind==="credit"&&t.recurs===!0&&t.label===void 0}function SE(t){return t.kind==="credit"&&t.recurs!==!0&&t.label===void 0}function xE(t,e,n=["grants"]){if(!t)return;let i=0,r=0;for(let o of t)kE(o)?i+=1:SE(o)&&(r+=1);i>1&&e.addIssue({code:"custom",message:"At most one recurring `credit` grant (recurs:true, no label) is allowed \u2014 recurring credit is a single canonical entry.",path:n}),r>1&&e.addIssue({code:"custom",message:"At most one one-time `credit` grant (recurs:false, no label) is allowed \u2014 one-time credit is a single canonical entry.",path:n})}function IE(t){return t.grants&&t.grants.length>0?[...t.grants]:[]}function Ny(t){return IE(t).find(kE)?.amount_cents??0}function Wd(t){return IE(t).find(SE)?.amount_cents??0}var IL=a.object({percent:a.number().int().min(0).max(100)}),$L=a.object({threshold_cents:a.number().int().nonnegative(),refill_cents:a.number().int().positive()}),Kn=a.object({rollover:IL.optional(),auto_recharge:$L.optional()});var $E=a.enum(["linear","active_count","event_count"]);var wL=a.object({up_to:a.number().int().positive().nullable(),price_per_unit_micros:a.number().int().nonnegative()}),EL=a.object({strategy:a.enum(["graduated","volume"]),tiers:a.array(wL).min(1).max(20)}),Gn=a.object({dimension:a.string().min(1).max(64).regex(/^[a-z0-9_]+$/,"Meter dimension must be lowercase alphanumeric with underscores"),kind:$E.default("linear"),price_per_unit_micros:a.number().int().nonnegative().default(0),tiered:EL.optional(),included_units:a.number().int().positive().optional()}).superRefine((t,e)=>{if(t.tiered&&t.price_per_unit_micros>0&&e.addIssue({code:"custom",message:"`tiered` is mutually exclusive with a non-zero `price_per_unit_micros` \u2014 drop one",path:["tiered"]}),t.included_units!==void 0&&t.tiered&&e.addIssue({code:"custom",message:"`included_units` is mutually exclusive with `tiered` \u2014 a tiered schedule already expresses the included allotment as a zero-priced first tier",path:["included_units"]}),t.tiered){let n=0,i=!1;for(let r=0;r<t.tiered.tiers.length;r++){let o=t.tiered.tiers[r];if(i){e.addIssue({code:"custom",message:"Open-ended tier (`up_to: null`) must be the final tier",path:["tiered","tiers",r,"up_to"]});break}if(o.up_to===null){i=!0;continue}o.up_to<=n&&e.addIssue({code:"custom",message:`Tier upper bounds must be strictly ascending (tier ${r} = ${o.up_to} <= previous ${n})`,path:["tiered","tiers",r,"up_to"]}),n=o.up_to}i||e.addIssue({code:"custom",message:"The final tier of a `tiered` schedule must be open-ended (`up_to: null`)",path:["tiered","tiers",t.tiered.tiers.length-1,"up_to"]})}}),Qi=a.enum(["month","year"]),TL=a.object({meters:a.array(Gn).default([]),recurring_fee_cents:a.number().int().nonnegative().default(0),billing_interval:Qi.default("month"),grants:a.array(Hn).max(40).default([]),creditPolicy:Kn.optional(),trial_days:a.number().int().nonnegative().default(0),max_monthly_spend_cents:a.number().int().nonnegative().optional()});var RL=a.string().min(1),OL=a.object({type:a.literal("named"),name:a.enum(["second","minute","hour","day","week","month"])}),PL=a.object({type:a.literal("custom"),seconds:a.number().int().positive(),label:a.string().optional()}),AL=a.discriminatedUnion("type",[OL,PL]),ka=a.object({dimension:RL,window:AL,capacity:a.number().nonnegative(),enforcement:a.enum(["enforce","track"]).optional(),warnAt:a.number().min(0).max(1).optional(),scope:_a.optional(),acknowledgeUnreachable:a.boolean().optional()}),t5=a.array(ka).max(20);function NL(t){let e=/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/.exec(t);if(!e)return!1;let n=Number(e[1]),i=Number(e[2]);return n>255||i>255||Number(e[3])>255||Number(e[4])>255?!1:n===0||n===127||n===10||n===172&&i>=16&&i<=31||n===192&&i===168||n===169&&i===254||n===100&&i>=64&&i<=127||n===192&&i===0&&Number(e[3])===0||n===198&&(i===18||i===19)||n>=224}function wE(t){let e=t.trim().toLowerCase().replace(/^\[|\]$/g,"");return e.endsWith(".")&&(e=e.slice(0,-1)),e==="localhost"||e.endsWith(".localhost")||e.startsWith("::ffff:")||e==="::"||e==="::1"||e.includes(":")&&(e.startsWith("fc")||e.startsWith("fd")||/^fe[89ab][0-9a-f]:/.test(e))||/^ff[0-9a-f]{2}:/.test(e)||e.startsWith("2002:")||/^2001:0{0,4}:/.test(e)||e.includes(":")&&e.startsWith("64:ff9b:")||/^::(?:\d+\.\d+\.\d+\.\d+|[0-9a-f]{1,4}:[0-9a-f]{1,4})$/.test(e)?!0:NL(e)}var zy=["GET","HEAD","POST","PUT","PATCH","DELETE"],Sa=1048576,TE=1048576;function RE(t){return new TextEncoder().encode(t).byteLength}function CL(t){try{let e=JSON.stringify(t);return typeof e=="string"?RE(e):null}catch{return null}}var Dy=a.string().min(1).max(64).regex(/^[a-z][a-z0-9_-]*$/,"Integration id must be lowercase alphanumeric with hyphens/underscores"),jy=a.string().min(1).max(128).regex(/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,"Header name must be a valid HTTP token").refine(t=>t!=="*","Header wildcard is not allowed").transform(t=>t.toLowerCase()),OE=new Set(["connection","keep-alive","proxy-connection","te","trailer","transfer-encoding","upgrade","content-length","content-encoding"]),PE=jy.refine(t=>!OE.has(t)&&!["host","cookie","set-cookie","authorization","proxy-authorization"].includes(t),"Browser request header is not safe"),zL=jy.refine(t=>!OE.has(t)&&!["host","cookie","set-cookie"].includes(t),"Injection header is not safe"),DL=new Set(["cache-control","etag","last-modified","link","retry-after","x-request-id","x-ratelimit-limit","x-ratelimit-remaining","x-ratelimit-reset"]),jL=jy.refine(t=>DL.has(t),"Response header is not safe to project"),UL=a.string().max(16384).refine(t=>!/[\r\n]/.test(t),"Header values cannot contain CR/LF"),AE=a.string().min(3).max(128).regex(/^[a-z0-9!#$&^_.+-]+\/[a-z0-9!#$&^_.+-]+$/i,"Content type must be an exact media type").refine(t=>!t.includes("*"),"Content type wildcards are not allowed").transform(t=>t.toLowerCase());function NE(t){return[...new Set(t)].sort((e,n)=>e<n?-1:e>n?1:0)}function eo(t,e,n=1,i=!1){return a.array(t).min(n).max(e).superRefine((r,o)=>{if(!i)return;let s=new Set;for(let[c,u]of r.entries())s.has(u)&&o.addIssue({code:"custom",path:[c],message:`duplicate value "${u}" is not allowed`}),s.add(u)}).transform(r=>NE(r))}var ML=eo(PE,20,0,!0),CE=a.string().min(1).max(128).regex(/^[A-Za-z0-9_.~-]+$/,"Query parameter name is invalid"),LL=eo(CE,30,0,!0);function ZL(){return a.record(a.string(),a.string().max(16384)).superRefine((t,e)=>{let n=Object.keys(t);n.length>30&&e.addIssue({code:"custom",message:"Too many query parameters"});for(let i of n)CE.safeParse(i).success||e.addIssue({code:"custom",path:[i],message:"Browser query parameter is invalid"})})}function BL(){return a.record(a.string(),UL).superRefine((t,e)=>{Object.keys(t).length>20&&e.addIssue({code:"custom",message:"Too many request headers"});let i=new Set;for(let[r,o]of Object.entries(t)){let s=PE.safeParse(r);if(!s.success){e.addIssue({code:"custom",path:[r],message:"Browser request header is not safe"});continue}i.has(s.data)&&e.addIssue({code:"custom",path:[r],message:`duplicate request header "${r}" is not allowed`}),i.add(s.data),typeof o!="string"&&e.addIssue({code:"custom",path:[r],message:"Request header value must be a string"})}}).transform(t=>Object.fromEntries(Object.entries(t).map(([e,n])=>[e.toLowerCase(),n])))}function FL(t){return t.split("/").some(e=>{let n=e.replace(/%2e/gi,".");return n==="."||n===".."})}var Uy=a.string().min(1).max(500).superRefine((t,e)=>{let n=i=>{e.addIssue({code:"custom",message:i})};if(/^[a-z][a-z0-9+.-]*:\/\//i.test(t)){n(`Pass an origin-relative path, not a full URL ("${t}"). The upstream origin comes from the integration's declared \`upstream\` \u2014 e.g. "/api/projects".`);return}if(t.startsWith("//")){n('Protocol-relative paths are not allowed \u2014 "//host/x" targets another origin. Use a single leading slash.');return}if(!t.startsWith("/")){n(`Request path must start with "/" \u2014 got "${t}".`);return}if(t.includes("?")){n("Put query parameters in the `query` option, not the path \u2014 they are allowlisted per operation.");return}if(t.includes("#")){n("Fragments are never sent to a server; remove the '#'.");return}if(t.includes("\\")){n("Backslashes are not path separators; use '/'.");return}if(t.includes("*")){n("Wildcards are not allowed \u2014 an operation names one exact path so the allowlist stays decidable.");return}FL(t)&&n("Relative segments ('.' / '..') are not allowed \u2014 they could escape the declared path.")}),zE=a.string().max(2048).superRefine((t,e)=>{let n;try{n=new URL(t)}catch{e.addIssue({code:"custom",message:"Upstream must be a valid HTTPS origin"});return}n.protocol!=="https:"&&e.addIssue({code:"custom",message:"Upstream must use HTTPS"}),(n.username||n.password)&&e.addIssue({code:"custom",message:"Upstream cannot include userinfo"}),n.port&&n.port!=="443"&&e.addIssue({code:"custom",message:"Upstream must use the default HTTPS port"}),(n.pathname!=="/"||n.search||n.hash)&&e.addIssue({code:"custom",message:"Upstream must be an origin without a path, query, or fragment"}),n.hostname.includes("*")&&e.addIssue({code:"custom",message:"Upstream wildcard hosts are not allowed"}),wE(n.hostname)&&e.addIssue({code:"custom",message:"Upstream host is private or loopback"})}).transform(t=>new URL(t).origin),VL=a.discriminatedUnion("kind",[a.object({kind:a.literal("none")}).strict(),a.object({kind:a.literal("json"),maxBytes:a.number().int().positive().max(Sa)}).strict(),a.object({kind:a.literal("text"),maxBytes:a.number().int().positive().max(Sa),contentTypes:eo(AE,10)}).strict()]),qL=a.string().min(1).max(500).regex(/^(?:\/(?:[^~/]|~[01])*)+$/,"Response field must be an RFC 6901 JSON pointer"),HL=a.object({kind:a.literal("json"),contentTypes:eo(AE,10),maxBytes:a.number().int().positive().max(TE),jsonPointers:eo(qL,100),responseHeaders:eo(jL,20,0,!0).default([])}).strict(),EE=a.string().min(1).max(128).regex(/^[A-Z][A-Z0-9_]*$/,"secretRef must be UPPER_SNAKE"),KL=a.discriminatedUnion("location",[a.object({secretRef:EE,location:a.literal("header"),name:zL,template:a.enum(["{value}","Bearer {value}"])}).strict(),a.object({secretRef:EE,location:a.literal("query"),name:a.string().min(1).max(128).regex(/^[A-Za-z0-9_.~-]+$/,"Query parameter name is invalid")}).strict()]),GL=a.object({method:a.enum(zy),path:Uy,headers:ML.default([]),query:LL.default([]),body:VL}).strict(),WL=a.array(GL).min(1).max(100).superRefine((t,e)=>{let n=new Set;for(let[i,r]of t.entries()){let o=`${r.method} ${r.path}`;n.has(o)&&e.addIssue({code:"custom",path:[i],message:`duplicate frontend integration operation "${o}"`}),n.add(o)}}).transform(t=>[...t].sort((e,n)=>{let i=`${e.method} ${e.path}`,r=`${n.method} ${n.path}`;return i<r?-1:i>r?1:0})),DE=a.object({id:Dy,upstream:zE,request:a.object({operations:WL}).strict(),injection:KL,response:HL}).strict().superRefine((t,e)=>{if(t.injection.location==="header")for(let[n,i]of t.request.operations.entries())i.headers.includes(t.injection.name)&&e.addIssue({code:"custom",path:["request","operations",n,"headers"],message:`browser request header collides with injected header "${t.injection.name}"`})}),jE=DE;function UE(t){if(t&&typeof t=="object"&&!Object.isFrozen(t)){Object.freeze(t);for(let e of Object.values(t))UE(e)}return t}var JL=DE.transform(t=>UE(t)),My=a.array(jE).max(200).superRefine((t,e)=>{let n=new Set;for(let[i,r]of t.entries())n.has(r.id)&&e.addIssue({code:"custom",path:[i,"id"],message:`duplicate frontend integration id "${r.id}"`}),n.add(r.id)}).transform(t=>[...t].sort((e,n)=>e.id<n.id?-1:e.id>n.id?1:0)),Ly=a.array(Dy).max(200).transform(t=>NE(t)).optional(),Cy=a.lazy(()=>a.union([a.null(),a.boolean(),a.number().finite(),a.string().max(65536),a.array(Cy).max(100),a.record(a.string().min(1).max(128),Cy).superRefine((t,e)=>{Object.keys(t).length>100&&e.addIssue({code:"custom",message:"JSON object has too many keys"})})])),YL=a.discriminatedUnion("kind",[a.object({kind:a.literal("json"),value:Cy}).strict(),a.object({kind:a.literal("text"),value:a.string().max(Sa)}).strict()]).superRefine((t,e)=>{let n=t.kind==="json"?CL(t.value):RE(t.value);(n===null||n>Sa)&&e.addIssue({code:"custom",message:"Request body exceeds the UTF-8 byte limit"})}),XL=a.object({integrationId:Dy,path:Uy,method:a.enum(zy),headers:BL().optional(),query:ZL().optional(),body:YL.optional()}).strict();var QL={meters:a.array(Gn).default([]),recurring_fee_cents:a.number().int().nonnegative().default(0),billing_interval:Qi.default("month"),trial_days:a.number().int().nonnegative().default(0),max_monthly_spend_cents:a.number().int().nonnegative().optional(),min_monthly_spend_cents:a.number().int().nonnegative().optional(),grants:a.array(Hn).max(40).default([]),creditPolicy:Kn.optional()},ME=a.object({key:a.string().min(1).max(64).regex(/^[a-z0-9_-]+$/,"Plan key must be lowercase alphanumeric with hyphens/underscores"),name:a.string().min(1).max(100),description:a.string().max(500).optional(),details:a.array(a.string().max(200)).max(10).optional(),...QL,free:a.boolean().default(!1),limits:a.array(ka).max(20).default([]),routeGrants:a.array(a.string().min(1).max(500)).max(500).transform(t=>[...new Set(t)].sort()).optional(),frontendIntegrationGrants:Ly,resource_limits:a.record(a.string().min(1).max(120),a.number().int().nonnegative()).default({}),overageBehavior:a.enum(["block","allow_and_bill"]).default("block"),selfServeEnabled:a.boolean().default(!0),capacity:Ry.optional(),archive:a.object({at:a.string().datetime().optional(),transitionTo:a.string().optional(),strategy:a.enum(["auto","explicit","block"]).default("auto")}).optional()}).strict(),Jd=ME.superRefine((t,e)=>{xE(t.grants,e)});var e4=/^\$\{[A-Z][A-Z0-9_]{0,127}\}$/,Zy=a.string().min(3).max(200).refine(t=>e4.test(t),{message:"secret must use ${VAR} interpolation syntax (e.g. ${WEBHOOK_SECRET}); raw secrets in YAML are rejected. Define the env var in the per-product secret store and reference it here."}),By=a.object({maxAttempts:a.number().int().min(1).max(20).default(5),backoff:a.enum(["exponential","fixed"]).default("exponential")}),Fy=a.object({id:a.string().min(1).max(64).regex(/^[a-z0-9_-]+$/,"Webhook endpoint id must be lowercase alphanumeric with hyphens/underscores"),url:a.string().url("webhooks.endpoints[].url must be a valid URL"),secret:Zy,events:a.array(Yi).min(1,"webhooks.endpoints[].events must subscribe to \u2265 1 event"),enabled:a.boolean().default(!0),retryPolicy:By.default({maxAttempts:5,backoff:"exponential"})}),Vy=a.object({endpoints:a.array(Fy).max(50).default([])});var t4=a.object({meters:a.array(Gn).optional(),recurring_fee_cents:a.number().int().nonnegative().optional(),billing_interval:Qi.optional(),grants:a.array(Hn).max(40).optional(),creditPolicy:Kn.optional(),trial_days:a.number().int().nonnegative().optional(),max_monthly_spend_cents:a.number().int().nonnegative().optional(),limits:a.array(ka).max(20).optional(),overageBehavior:a.enum(["block","allow_and_bill"]).optional(),selfServeEnabled:a.boolean().optional()}).strict(),n4=a.object({url:a.string().url().optional(),secret:Zy.optional(),events:a.array(Yi).optional(),enabled:a.boolean().optional(),retryPolicy:By.partial().optional()}).strict(),r4=a.object({plans:a.record(a.string(),t4).optional(),webhooks:a.object({endpoints:a.record(a.string(),n4).optional()}).strict().optional()}).strict(),qy=a.record(a.string().min(1).max(64),r4);var Hy=a.enum(["query","mutation"]),Ky=a.enum(["none","metadata","full"]),Gy=a.object({type:a.string().min(1).max(64).regex(/^[a-zA-Z0-9_.:-]+$/),from:a.enum(["header","path_param"]),name:a.string().min(1).max(120)}),Wy=a.object({resource:a.string().min(1).max(100).regex(/^[a-z0-9_.:-]+$/),effect:a.enum(["create","delete"])}),LE=a.object({id:a.string().min(1).max(160).regex(/^[a-z0-9_.:-]+$/),title:a.string().min(1).max(160).optional(),kind:Hy,actorType:a.string().min(1).max(64).regex(/^[a-zA-Z0-9_.:-]+$/).optional(),subject:Gy.optional(),inputSchemaRef:a.string().min(1).max(240).optional(),audit:Ky.default("metadata"),resource:Wy.optional()});var ZE=a.enum(["subscription","subject"]),BE=a.enum(["reported","action_inferred"]),FE=a.string().min(1).max(100).regex(/^[a-z0-9_.:-]+$/),VE=a.object({name:FE,display:a.string().min(1).max(120).optional(),scope:ZE.default("subscription"),subjectType:a.string().min(1).max(64).regex(/^[a-zA-Z0-9_.:-]+$/).optional(),countSource:BE.default("reported")}).superRefine((t,e)=>{t.scope==="subject"&&!t.subjectType&&e.addIssue({code:"custom",path:["subjectType"],message:"subjectType is required when resource scope is subject"}),t.scope==="subscription"&&t.subjectType&&e.addIssue({code:"custom",path:["subjectType"],message:"subjectType is only valid for subject-scoped counted resources"})}),Jy=a.array(VE).max(100).default([]);var qE=/^[a-z0-9][a-z0-9_-]*$/,Yy=a.string().min(1).max(64).regex(qE,"backend id must be a lowercase slug ([a-z0-9][a-z0-9_-]*)"),HE=a.enum(["direct","tunnel"]),KE=a.enum(["embedded","sidecar"]);var GE=a.object({mode:HE.default("direct"),runner:KE.optional()}).strict(),WE=a.object({required:a.boolean().default(!0)}).strict(),JE=a.object({name:a.string().min(1).max(120).optional(),slug:Yy.optional(),transport:GE.default({mode:"direct"}),verification:WE.default({required:!0}),meters:a.array(a.string().min(1).max(64)).max(100).optional(),default:a.boolean().optional()}).strict(),Xy=a.record(Yy,JE),to=Yy,no={unknownBackendInRoute:"UNKNOWN_BACKEND_IN_ROUTE",ambiguousDefaultBackend:"AMBIGUOUS_DEFAULT_BACKEND",routeMeterNotAllowedByBackend:"ROUTE_METER_NOT_ALLOWED_BY_BACKEND",unknownMeterInBackend:"UNKNOWN_METER_IN_BACKEND"};function Qy(t){let e=Object.keys(t??{});if(e.length===0)return{defaultId:null,ambiguous:!1};if(e.length===1)return{defaultId:e[0],ambiguous:!1};let n=e.filter(i=>t[i]?.default===!0);return n.length===1?{defaultId:n[0],ambiguous:!1}:{defaultId:null,ambiguous:!0}}var XE=a.enum(["long","short","blocking"]).default("long");var QE=a.object({method:a.enum(["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"]),path:a.string().min(1).max(500).regex(/^\/[a-zA-Z0-9_/:.{}-]*$/,"path must be a concrete route starting with /; wildcard segments are reserved for meterRoutes selectors").refine(t=>!t.split("/").some(e=>["{__fs_rest}",":__fs_rest","[__fs_rest]"].includes(e)),"reserved greedy path parameters are only valid in non-granting meter selectors")});function i4(t){let e=t.trim();if(!e)return!1;let[n,i,r]=e.split("-");if(r!==void 0||!/^\d{3}$/.test(n??""))return!1;let o=Number(n),s=i===void 0?o:Number(i);return i!==void 0&&!/^\d{3}$/.test(i)?!1:o>=100&&o<=599&&s>=100&&s<=599&&o<=s}function eT(t){return t.split(",").every(i4)}var Yd=a.union([a.string().min(1).max(100).refine(eT,{message:"onStatusCodes must be comma-separated HTTP status codes or numeric ranges, e.g. 200-299,304"}),a.array(a.number().int().min(100).max(599)).min(1).max(100)]),tT=a.enum(["public","required"]),nT=a.enum(["network","5xx"]),rT=a.object({maxAttempts:a.number().int().min(1).max(3),retryOn:a.array(nT).min(1).max(2),backoff:a.object({base:a.number().int().min(0).max(6e4),max:a.number().int().min(0).max(6e4),jitter:a.number().min(0).max(1)}).strict().refine(t=>t.max>=t.base,{message:"retry.backoff.max must be >= retry.backoff.base"}),budgetRatio:a.number().min(0).max(1)}).strict(),iT=a.enum(["ui","api","agent","webhook","cli"]),YE=new Map(iT.options.map((t,e)=>[t,e])),o4=a.array(iT).min(1).refine(t=>t.every((e,n)=>n===0||(YE.get(e)??-1)>(YE.get(t[n-1])??-1)),{message:"surfaces must be a canonical set: unique and sorted by surface order (ui, api, agent, webhook, cli)"}),Xd=a.object({authMode:tT.optional(),timeoutMs:a.number().int().min(1).max(6e5).optional(),idleTimeoutMs:a.number().int().min(1).max(6e5).optional(),retry:rT.optional(),subject:a.enum(["member","service"]).optional(),surfaces:o4.optional(),hidden:a.boolean().optional()}).strict(),Qd=a.object({dimension:a.string().min(1).max(64).default("requests"),window:a.union([a.object({type:a.literal("named"),name:a.enum(["second","minute","hour","day","week","month"])}),a.object({type:a.literal("custom"),seconds:a.number().int().positive(),label:a.string().min(1).max(64).optional()})]),capacity:a.number().nonnegative(),enforcement:a.enum(["enforce","track"]).default("enforce")}).strict(),oT=a.object({match:QE,metering:a.object({defaults:a.record(a.string().min(1).max(64),a.number().finite().nonnegative()).optional(),reports:a.array(a.string().min(1).max(64)).max(20).optional(),onStatusCodes:Yd.optional(),postStreamBilling:a.boolean().optional()}).optional(),unmetered:a.boolean().optional(),inheritDefaultMeters:a.boolean().optional(),action:a.string().min(1).max(160).regex(/^[a-z0-9_.:-]+$/).optional(),backend:to.optional(),usagePolicy:Gd.optional(),policy:Xd.optional(),limits:a.array(Qd).min(1).max(8).optional()}).strict(),sT=a.object({rollout_key:a.string().min(1).max(120).regex(/^[a-z0-9_-]+$/,"rollout_key must be lowercase alphanumeric with hyphens/underscores").optional(),required_flags:a.array(a.string().min(1).max(120).regex(/^[a-z0-9_-]+$/)).max(10).optional()}),e_=a.object({description:a.string().max(500).optional(),mutation_class:a.enum(["runtime","contractual"]).default("contractual"),cacheProfile:XE,routes:a.array(oT).min(1).max(50),runtime:sT.default({}),actions:a.array(LE).max(100).optional(),backend:to.optional()}).strict();var s4="{__fs_rest}";function a4(t){if(t.startsWith(":"))return t.slice(1);if(t.startsWith("{")&&t.endsWith("}")||t.startsWith("[")&&t.endsWith("]"))return t.slice(1,-1)}function t_(t,e){let n=e.split("/").map((i,r)=>r===0?i:i==="**"||i===s4?"**":i==="*"||a4(i)!==void 0?"*":i).join("/");return`${t.toUpperCase()} ${n}`}function Er(t){return t.actionId??t_(t.method,t.path)}function aT(t,e){t.usagePricing!==void 0&&e.addIssue({code:"custom",path:["usagePricing"],message:"usagePricing is not supported. Define usage.meters.<key>.rating instead."})}function cT(t,e){t.filter(i=>i.free).length>1&&e.addIssue({code:"custom",path:["plans"],message:"Only one free plan is allowed per product"}),t.forEach((i,r)=>{i.free&&(c4(i,r,e),u4(i,r,e))})}function c4(t,e,n){(fT(t)??0)!==0&&n.addIssue({code:"custom",path:["plans",e,"recurring_fee_cents"],message:"Free plans must have zero price"})}function u4(t,e,n){t.limits.some(r=>!r.enforcement||r.enforcement==="enforce")||n.addIssue({code:"custom",path:["plans",e,"limits"],message:"Free plans must include at least one hard enforced limit"})}function uT(t,e){let n=new Map;t.forEach((i,r)=>{if(i.free)return;let o=fT(i);if(o===void 0||o<=0)return;let s=m4(i,o),c=n.get(s);if(c){e.addIssue({code:"custom",path:["plans",r,"recurring_fee_cents"],message:`Paid plan price duplicates plan "${c}" (${s})`});return}n.set(s,i.key)})}function lT(t,e){let n=new Set((t.metering?.meters??[]).map(r=>r.key).filter(r=>typeof r=="string"&&r.length>0)),i=new Set(Object.keys(t.usage?.meters??{}));t.plans.forEach((r,o)=>{let s=r.meters;s&&s.forEach((c,u)=>{let l=c.dimension;typeof l!="string"||l.length===0||n.has(l)||i.has(l)||e.addIssue({code:"custom",path:["plans",o,"meters",u,"dimension"],message:`Plan "${r.key}" prices meter "${l}" but no metering.meters[] entry and no usage.meters[] entry declares it.`})})})}function dT(t,e){if(!t.routeCatalog)return;let n=new Set((t.metering?.meters??[]).map(r=>r.key).filter(r=>typeof r=="string"&&r.length>0)),i=!1;for(let[r,o]of Object.entries(t.routeCatalog))(o.routes??[]).forEach((c,u)=>{let l=n_(c);l.length!==0&&(i=!0,l.forEach((p,d)=>{n.has(p)||e.addIssue({code:"custom",path:["routeCatalog",r,"routes",u,"metering",d],message:`Route references unknown meter "${p}". Declare it in metering.meters[].`})}))});i&&n.size===0&&e.addIssue({code:"custom",path:["metering","meters"],message:"One or more routes declare metering keys but `metering.meters[]` is empty. Declare meters at the product level first."})}function l4(t,e){let n=new Map;for(let r of t.plans)n.set(r.key,new Set);if(!t.routeCatalog){for(let r of n.values())for(let o of e)r.add(o);return n}let i=Object.values(t.routeCatalog).flatMap(r=>r.routes??[]);for(let r of t.plans){let o=n.get(r.key),s=new Set(r.routeGrants??[]);for(let c of i){if(c.unmetered===!0||!c.path)continue;let u=Er({actionId:c.actionId,method:c.method,path:c.path});if(s.has(u))for(let l of n_(c))o.add(l)}}return n}function n_(t){let e=new Set;for(let n of Object.keys(t.metering?.defaults??{}))e.add(n);for(let n of t.metering?.reports??[])e.add(n);return[...e]}function d4(t){if(!t||typeof t!="object")return null;let e=t;return typeof e.dimension=="string"?e.dimension:null}var p4=new Set(["credits"]);function pT(t,e){if(!t.plans||t.plans.length===0)return;let n=new Set((t.metering?.meters??[]).map(o=>o.key).filter(o=>typeof o=="string"&&o.length>0)),i=new Set(Object.keys(t.usage?.meters??{})),r=l4(t,n);t.plans.forEach((o,s)=>{let c=o.limits??[],u=r.get(o.key)??new Set;c.forEach((l,p)=>{if(l&&typeof l=="object"?l.acknowledgeUnreachable===!0:!1)return;let m=d4(l);m&&(u.has(m)||i.has(m)||p4.has(m)||e.addIssue({code:"custom",path:["plans",s,"limits",p,"meter"],message:`Plan "${o.key}" limits meter "${m}" but no directly granted route emits this meter, and the meter is not declared under usage.meters either. Either add a matching routeGrants entry for a route that emits "${m}", declare the meter under metering.meters[] or usage.meters, or set acknowledgeUnreachable: true if the limit is intentional (e.g. soft budget).`}))})})}function mT(t,e){let n=t.backend;if(!n||Object.keys(n).length===0)return;let i=new Set(Object.keys(n)),r=new Set((t.metering?.meters??[]).map(u=>u.key).filter(u=>typeof u=="string"&&u.length>0));for(let[u,l]of Object.entries(n))(l.meters??[]).forEach((p,d)=>{r.has(p)||e.addIssue({code:"custom",path:["backend",u,"meters",d],message:`${no.unknownMeterInBackend}: backend "${u}" allows meter "${p}" but no metering.meters[] entry declares it.`})});let{defaultId:o,ambiguous:s}=Qy(n),c=!1;for(let u of Object.values(t.routeCatalog??{}))for(let l of u.routes??[])l.backend===void 0&&(c=!0);s&&c&&e.addIssue({code:"custom",path:["backend"],message:`${no.ambiguousDefaultBackend}: product declares ${i.size} backends but no single default \u2014 mark exactly one backend \`default: true\` or bind every route explicitly.`});for(let[u,l]of Object.entries(t.routeCatalog??{}))(l.routes??[]).forEach((p,d)=>{let m=p.backend??o;if(p.backend!==void 0&&!i.has(p.backend)){e.addIssue({code:"custom",path:["routeCatalog",u,"routes",d,"backend"],message:`${no.unknownBackendInRoute}: route binds backend "${p.backend}" which is not declared in the product \`backend\` block.`});return}if(!m)return;let g=n[m]?.meters;if(!g)return;let y=new Set(g);for(let v of n_(p))y.has(v)||e.addIssue({code:"custom",path:["routeCatalog",u,"routes",d,"metering"],message:`${no.routeMeterNotAllowedByBackend}: route meters "${v}" but backend "${m}" does not allow it (backend.meters[] = [${g.join(", ")}]).`})})}function fT(t){return t.recurring_fee_cents}function m4(t,e){return`USD:month:${e}`}var f4=a.object({subdomain:a.string().min(1).max(63).regex(/^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/,"Subdomain must be lowercase alphanumeric with optional hyphens")}),gT=a.enum(["exact_pre_request","estimated_then_settled","postpaid","strict_concurrency"]),g4=a.enum(lE),r_=a.object({key:a.string().min(1).max(64).regex(/^[a-z0-9_]+$/,"Meter key must be lowercase alphanumeric with underscores"),display:a.string().min(1).max(100),unit:a.string().max(20).optional(),routeDefault:a.number().finite().nonnegative().optional(),enforcementType:gT.default("estimated_then_settled"),aggregation:a.enum(["SUM","COUNT","MAX","UNIQUE_COUNT","LATEST"]).default("COUNT"),window:a.enum(["minute","hour","day","month","billing_period"]).default("billing_period"),valueProperty:a.string().optional(),uniqueProperty:a.string().optional(),groupBy:a.array(a.string()).optional(),eventCode:a.string().optional(),tokenCategory:g4.optional(),reserveStrategy:a.enum(["reserve_max","estimate","count_actual"]).optional(),reserveCeiling:a.number().int().positive().optional(),pairsWith:a.string().min(1).max(64).optional()}),hT=a.string().min(1).max(64).regex(/^[a-z0-9_]+$/,"Usage measure must be lowercase alphanumeric with underscores"),h4=a.enum(["pass_through","markup"]),b4=a.object({source:a.literal("fixed"),rates:a.record(a.string().min(1),a.record(hT,a.number().int().nonnegative()))}),y4=a.object({source:a.literal("provider_catalog"),catalog:a.string().min(1).max(100),pricePolicy:h4.default("pass_through"),markupPercent:a.number().nonnegative().max(1e4).optional(),marginMicros:a.number().int().nonnegative().optional()}),bT=a.discriminatedUnion("source",[b4,y4]),yT=a.object({selector:a.string().min(1).max(100).optional(),measures:a.array(hT).min(1).max(20),rating:bT.optional()}),_T=a.object({meters:a.record(a.string().min(1).max(64).regex(/^[a-z0-9_]+$/),yT)}),_4=a.object({defaults:a.record(a.string().min(1).max(64),a.number().finite().nonnegative()).optional(),reports:a.array(a.string().min(1).max(64)).max(20).optional(),onStatusCodes:Yd.optional(),postStreamBilling:a.boolean().optional()}),v4=a.object({kind:Hy,title:a.string().min(1).max(160).optional(),actorType:a.string().min(1).max(64).regex(/^[a-zA-Z0-9_.:-]+$/).optional(),subject:Gy.optional(),audit:Ky,resource:Wy.optional()}),vT=a.object({method:a.enum(["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"]),path:a.string().min(1).max(500).regex(/^\/[a-zA-Z0-9_/:.{}-]*$/,"path must be a concrete route starting with /; wildcard segments are reserved for meterRoutes selectors").refine(t=>!t.split("/").some(e=>["{__fs_rest}",":__fs_rest","[__fs_rest]"].includes(e)),"reserved greedy path parameters are only valid in non-granting meter selectors"),actionId:a.string().min(1).max(120).optional(),actionMeta:v4.optional(),unmetered:a.boolean().optional(),metering:_4.optional(),inheritDefaultMeters:a.boolean().optional(),backend:to.optional(),limits:a.array(Qd).min(1).max(8).optional(),policy:Xd.optional()}).strict(),i_=a.object({description:a.string().max(500).optional(),routes:a.array(vT).min(1).max(50)}),kT=a.record(a.string().min(1).max(100).regex(/^[a-z0-9_.:-]+$/),i_),ST=a.enum(["report","pull_request"]),xT=a.enum(["safe","non_blocking","economic_risk","blocking"]),IT=a.object({cleanup:a.object({enabled:a.boolean().default(!1),mode:ST.default("report")}).default({enabled:!1,mode:"report"}),change_approval:a.object({auto_merge_max_risk:a.enum(["none","safe","non_blocking"]).default("none"),require_human_for:a.array(xT).default(["economic_risk","blocking"])}).default({auto_merge_max_risk:"none",require_human_for:["economic_risk","blocking"]})}).default({cleanup:{enabled:!1,mode:"report"},change_approval:{auto_merge_max_risk:"none",require_human_for:["economic_risk","blocking"]}}),$T=a.enum(["clerk","test-personas"]),wT=a.object({context_tokens:a.object({enabled:a.boolean().default(!0)}).optional(),portal_auth:a.object({strategy:$T}).optional()}),o_=a.object({business:a.object({visibility:a.enum(["public","private"]).default("public"),rbac:a.boolean().optional()}),gateway:a.object({authHeader:a.string().min(1).max(100).default("x-api-key"),upstreamAuth:a.object({type:a.enum(["none","static_bearer"]),token:a.string().optional()}).default({type:"none"})}),metering:a.object({meters:a.array(r_).max(10).default([]),billOn4xx:a.boolean().default(!1)}).default({meters:[],billOn4xx:!1}),backend:Xy.optional(),usage:_T.optional(),usagePricing:a.never({error:"usagePricing is not supported. Define usage.meters.<key>.rating instead."}).optional(),routeCatalog:kT.optional(),resources:Jy,policies:IT,customer_context:wT.optional(),frontend:a.never({error:"frontend is not authorable in Business-as-Code. Define pages and navigation in the frontend application; use route policy surfaces for API/UI callability."}).optional(),billing:a.object({applyLimitUpgradesInstantly:a.boolean().optional(),subscriberChangePolicy:Xi.default({default:"period_end",when:{price_increase:"period_end",price_decrease:"immediate",route_grant_added:"immediate",route_grant_removed:"period_end",limit_increased:"immediate",limit_reduced:"period_end",credit_increased:"immediate",credit_reduced:"period_end",rating_changed:"period_end"},allowImmediatePriceIncrease:!1,allowImmediateEntitlementReduction:!1})}).default({subscriberChangePolicy:{default:"period_end",when:{price_increase:"period_end",price_decrease:"immediate",route_grant_added:"immediate",route_grant_removed:"period_end",limit_increased:"immediate",limit_reduced:"period_end",credit_increased:"immediate",credit_reduced:"period_end",rating_changed:"period_end"},allowImmediatePriceIncrease:!1,allowImmediateEntitlementReduction:!1}}),plans:a.array(Jd).max(4).default([]),lifecycle:a.object({breaking_changes:a.object({require_deprecation_window_days:a.number().int().nonnegative().default(0),require_successor_route:a.boolean().default(!1)}).default({require_deprecation_window_days:0,require_successor_route:!1})}).default({breaking_changes:{require_deprecation_window_days:0,require_successor_route:!1}}),webhooks:Vy.optional(),environments:qy.optional(),ephemeral:a.object({defaultPlan:a.string().min(1).optional()}).optional()}).superRefine((t,e)=>{aT(t,e),cT(t.plans,e),uT(t.plans,e),lT(t,e),dT(t,e),pT(t,e),mT(t,e)});var ET=1,TT="business",k4=`${TT}/index.ts`,S4=a.object({irVersion:a.literal(ET),sdkVersion:a.string().min(1).max(64),business:o_,routes:a.array(e_).max(200).default([]),frontendIntegrations:My.default([])}).strict().superRefine((t,e)=>{let n=new Map;for(let[i,r]of t.routes.entries())for(let[o,s]of r.routes.entries()){let c=Er({actionId:s.action,method:s.match.method,path:s.match.path}),u=t_(s.match.method,s.match.path),l=s.action?r.actions?.find(m=>m.id===s.action):void 0,p=RT({action:l,layer:{backend:r.backend,cacheProfile:r.cacheProfile,description:r.description,mutation_class:r.mutation_class,runtime:r.runtime},route:{backend:s.backend??r.backend,inheritDefaultMeters:s.inheritDefaultMeters,limits:s.limits,metering:s.metering,policy:s.policy,unmetered:s.unmetered,usagePolicy:s.usagePolicy}}),d=n.get(c);if(d&&d.endpoint!==u){e.addIssue({code:"custom",path:["routes",i,"routes",o,"action"],message:`route id collision for "${c}": maps to both ${d.endpoint} and ${u}`});continue}if(d&&d.behavior!==p){e.addIssue({code:"custom",path:["routes",i,"routes",o],message:`conflicting route definition for "${c}"`});continue}n.set(c,{endpoint:u,behavior:p})}for(let[i,r]of t.business.plans.entries()){for(let[o,s]of(r.routeGrants??[]).entries())n.has(s)||e.addIssue({code:"custom",path:["business","plans",i,"routeGrants",o],message:`unknown route grant "${s}" for plan "${r.key}"`});for(let[o,s]of(r.frontendIntegrationGrants??[]).entries())t.frontendIntegrations.some(c=>c.id===s)||e.addIssue({code:"custom",path:["business","plans",i,"frontendIntegrationGrants",o],message:`unknown frontend integration grant "${s}" for plan "${r.key}"`})}});function RT(t){return s_(JSON.parse(JSON.stringify(t)))}function s_(t){return Array.isArray(t)?`[${t.map(s_).join(",")}]`:t&&typeof t=="object"?`{${Object.entries(t).sort(([e],[n])=>e<n?-1:e>n?1:0).map(([e,n])=>`${JSON.stringify(e)}:${s_(n)}`).join(",")}}`:JSON.stringify(t)}var I3=a.object({subscriberChangePolicy:Xi.optional()}),$3=a.object({code:a.string(),kind:a.enum(["percent_off","amount_off","free_months"]),amount:a.number().optional(),durationMonths:a.number(),applicablePlanIds:a.array(a.string()).optional(),maxRedemptions:a.number().optional(),activeFrom:a.string().optional(),activeUntil:a.string().optional(),status:a.enum(["ACTIVE","ARCHIVED"]).optional()}),w3=a.object({id:a.string(),actorUserId:a.string().optional(),action:a.string(),decision:a.string().optional(),timestamp:a.string(),details:a.unknown().optional()}),E3=a.object({name:a.string(),branch:a.string().optional(),isProduction:a.boolean().optional()}),T3=a.object({id:a.string(),name:a.string(),apiKeyId:a.string().optional()});var OT=a.object({id:a.string(),billingCycleId:a.string(),effectiveStart:a.string(),effectiveEnd:a.string(),compiledPlanId:a.string()}),PT=a.object({currentPeriod:OT,priorPeriod:OT.optional()});var x4=a.object({subjectKey:a.string(),subscriptionId:a.string(),subscriberId:a.string(),businessId:a.string(),organizationId:a.string(),compiledPlanId:a.string(),activeEntitlementHash:a.string().optional(),generation:a.number(),enforcementMode:a.enum(["STRICT","GRACE","TRACK_ONLY"]),dedicatedShard:a.enum(["ACTIVE","DRAINING"]).optional(),memberAuthz:a.record(a.string(),a.object({permissions:a.array(a.string()),roles:a.array(a.string())})).optional(),memberAuthzComputedAt:a.number().optional(),postStreamLockouts:a.array(a.object({code:a.literal("post_stream_overspend"),reason:a.literal("usage_exhausted"),constraintKey:a.string().min(1),cycleId:a.string().min(1),dimension:a.string().min(1),currentCapacity:a.number().nonnegative(),observedUsage:a.number().nonnegative(),lockedAt:a.string().min(1),expiresAt:a.string().min(1)})).optional(),subscriptionStatus:a.string(),subscriberStatus:a.string(),scopes:a.array(a.string()),periods:PT,expiresAt:a.number().optional(),trialEndsAt:a.string().optional()}),I4=a.discriminatedUnion("kind",[a.object({kind:a.literal("found"),state:x4,expiresAt:a.number(),ttlSeconds:a.number()}),a.object({kind:a.literal("not_found"),negativeCacheTtlSeconds:a.number().default(60)}),a.object({kind:a.literal("revoked"),negativeCacheTtlSeconds:a.number().default(300),reason:a.string().optional()}),a.object({kind:a.literal("rate_limited"),retryAfterSeconds:a.number().default(10)})]),M3=a.object({environmentId:a.string().nullable(),subjectKeys:a.array(a.string()).min(1).max(500)}),L3=a.object({results:a.array(a.object({subjectKey:a.string(),result:I4}))}),$4=a.object({keyId:a.string(),orgId:a.string(),businessId:a.string(),compiledPlanId:a.string(),entitlementHash:a.string().optional(),subscriptionId:a.string(),subscriberId:a.string(),apiKeyId:a.string().nullable(),subjectKey:a.string(),entitlementVersion:a.number().int(),status:a.enum(["active","revoked"]),subscriberStatus:a.enum(["ONBOARDING","ACTIVE","SUSPENDED"]),subscriptionStatus:a.string(),environment:a.enum(["production","sandbox"]).optional(),environmentId:a.string().optional(),scopes:a.array(a.string()).default([]),permissions:a.array(a.string()).optional(),roles:a.array(a.string()).optional(),entitlement:a.unknown().optional(),principal:a.object({subjectKind:a.enum(["member","service"]),memberId:a.string().optional(),serviceAccountId:a.string().optional(),keyId:a.string()}),currentPeriodId:a.string().optional(),currentPeriodStartMs:a.number().int().nonnegative().optional(),expiresAt:a.number().nullable().optional()}),Z3=a.discriminatedUnion("kind",[a.object({kind:a.literal("found"),record:$4,expiresAt:a.number(),ttlSeconds:a.number()}),a.object({kind:a.literal("not_found"),negativeCacheTtlSeconds:a.number().default(60)}),a.object({kind:a.literal("revoked"),negativeCacheTtlSeconds:a.number().default(300),reason:a.string().optional()}),a.object({kind:a.literal("rate_limited"),retryAfterSeconds:a.number().default(10)})]),B3=a.discriminatedUnion("kind",[a.object({kind:a.literal("found"),entitlement:a.unknown(),expiresAt:a.number(),ttlSeconds:a.number()}),a.object({kind:a.literal("not_found"),negativeCacheTtlSeconds:a.number().default(60)}),a.object({kind:a.literal("rate_limited"),retryAfterSeconds:a.number().default(10)})]),w4=a.object({id:a.string().min(1),slug:a.string().optional(),transportMode:a.enum(["direct","tunnel"]),verificationRequired:a.boolean().optional(),originUrl:a.string().optional(),originHostname:a.string().optional(),accessCredentialRef:a.string().optional(),policyVersion:a.string().optional()}),E4=a.object({id:a.string(),origin:a.string(),sandboxOrigin:a.string().nullable().optional(),authHeader:a.string().optional(),pricing:a.record(a.string(),a.number()).optional(),metering:a.object({billOn4xx:a.boolean().optional()}).optional(),tenantLimits:a.array(a.object({unit:a.enum(["requests","tokens","computeMs","dollars"]),window:a.enum(["second","minute","hour","day","week","month"]),capacity:a.number()})).optional(),userLimits:a.array(a.object({unit:a.enum(["requests","tokens","computeMs","dollars"]),window:a.enum(["second","minute","hour","day","week","month"]),capacity:a.number()})).optional(),environmentId:a.string().optional(),contextTokenSecret:a.string().nullable().optional(),timeoutMs:a.number().positive().optional(),idleTimeoutMs:a.number().positive().optional(),backends:a.array(w4).optional(),defaultBackendId:a.string().optional(),verificationRequired:a.boolean().optional(),allowedOrigins:a.array(a.string()).optional(),hasPublicRoutes:a.boolean().optional(),publicRoutesCompiledPlanId:a.string().min(1).optional()}),F3=a.discriminatedUnion("kind",[a.object({kind:a.literal("found"),tenant:E4,expiresAt:a.number(),ttlSeconds:a.number()}),a.object({kind:a.literal("not_found"),negativeCacheTtlSeconds:a.number().default(60)}),a.object({kind:a.literal("rate_limited"),retryAfterSeconds:a.number().default(10)})]);var ep=["consumer_api_key","consumer_session_token","test_persona_session_token","builder_master_key","builder_session_token","maker_jwt","service_jwt","internal_service","context_token"],AT=a.enum(ep);var T4=a.object({fromIssuer:a.string().min(1),fromTokenId:a.string().min(1),intent:a.string().min(1)}),NT=a.object({issuer:a.string().min(1),issuedAt:a.number().int().nonnegative(),expiresAt:a.number().int().nonnegative().optional(),tokenId:a.string().min(1).optional(),delegationChain:a.array(T4)});var a_=["template","embedded","provisioned","agent"],R4=a.enum(a_),O4=["builder_user","builder_org","maker","consumer_subject","internal_service","service_jwt","agent_runtime"],P4=a.enum(O4),CT=a.object({kind:P4,id:a.string().min(1),label:a.string().optional()}),A4=["subscription","organization","platform"],N4=a.enum(A4),C4=a.object({kind:N4,id:a.string().min(1)}),z4=a.object({type:AT,id:a.string().min(1),hint:a.string().max(8).optional()}),D4=a.object({compiledPlanId:a.string().min(1),fromCache:a.boolean().optional()}),Q3=a.object({requestId:a.string().min(1),surface:R4,builderOrgId:a.string().min(1),businessId:a.string().min(1).optional(),runtimeId:a.string().min(1).optional(),template:a.string().optional(),caller:CT,actor:CT,billingSubject:C4,credential:z4,operation:a.string().min(1),scopes:a.array(a.string()),entitlement:D4.optional(),trust:NT});var le=["template","agent"],j4=["provisioned"],zT=[...a_],de=["builder_master_key","builder_session_token","maker_jwt"],ro=["service_jwt","internal_service"],c_=["consumer_api_key","consumer_session_token","test_persona_session_token","context_token"],DT=[...ep],xa="subscriptions:write",U4=[{id:"businesses.create",operation:"Create a product",requiredScopes:["businesses:write"],allowedSurfaces:le,allowedCredentialTypes:de,description:"Create a new product in the builder org"},{id:"businesses.update",operation:"Update a product",requiredScopes:["businesses:write"],allowedSurfaces:le,allowedCredentialTypes:de,description:"Update product metadata or compiled config"},{id:"businesses.delete",operation:"Delete a product",requiredScopes:["businesses:write"],allowedSurfaces:le,allowedCredentialTypes:de,description:"Delete a product (soft-archive if subscriptions exist)"},{id:"businesses.read",operation:"Read a product",requiredScopes:["businesses:read"],allowedSurfaces:le,allowedCredentialTypes:de,description:"Read product metadata + compiled config"},{id:"businesses.publish",operation:"Publish a product",requiredScopes:["businesses:write"],allowedSurfaces:le,allowedCredentialTypes:de,description:"Compile + publish the product to the gateway"},{id:"plans.create",operation:"Create a plan",requiredScopes:["plans:write"],allowedSurfaces:le,allowedCredentialTypes:de,description:"Add a new plan to a product"},{id:"plans.update",operation:"Update a plan",requiredScopes:["plans:write"],allowedSurfaces:le,allowedCredentialTypes:de,description:"Update plan pricing, limits, or features"},{id:"plans.delete",operation:"Delete a plan",requiredScopes:["plans:write"],allowedSurfaces:le,allowedCredentialTypes:de,description:"Delete a plan (denied if subscriptions are attached)"},{id:"plans.publish",operation:"Publish a plan",requiredScopes:["plans:write"],allowedSurfaces:le,allowedCredentialTypes:de,description:"Mark a plan as available for new subscriptions"},{id:"subscriptions.create",operation:"Create a subscription",requiredScopes:[xa],allowedSurfaces:le,allowedCredentialTypes:[...de,...ro],description:"Provision a new subscription for a subscriber"},{id:"subscriptions.update",operation:"Update a subscription",requiredScopes:[xa],allowedSurfaces:le,allowedCredentialTypes:[...de,...ro],description:"Change plan, enforcement mode, or schedule"},{id:"subscriptions.cancel",operation:"Cancel a subscription",requiredScopes:[xa],allowedSurfaces:le,allowedCredentialTypes:[...de,...ro],description:"Cancel a subscription (immediate or end-of-period)"},{id:"subscriptions.pause",operation:"Pause a subscription",requiredScopes:[xa],allowedSurfaces:le,allowedCredentialTypes:[...de,...ro],description:"Pause a subscription (no usage, no billing)"},{id:"subscriptions.resume",operation:"Resume a subscription",requiredScopes:[xa],allowedSurfaces:le,allowedCredentialTypes:[...de,...ro],description:"Resume a paused subscription"},{id:"subscriptions.read",operation:"Read a subscription",requiredScopes:["subscriptions:read"],allowedSurfaces:le,allowedCredentialTypes:[...de,...ro],description:"Read subscription state and usage"},{id:"webhooks.create",operation:"Create a webhook endpoint",requiredScopes:["webhooks:write"],allowedSurfaces:le,allowedCredentialTypes:de,description:"Register a new webhook endpoint URL"},{id:"webhooks.update",operation:"Update a webhook endpoint",requiredScopes:["webhooks:write"],allowedSurfaces:le,allowedCredentialTypes:de,description:"Update endpoint URL, secret, or subscribed events"},{id:"webhooks.delete",operation:"Delete a webhook endpoint",requiredScopes:["webhooks:write"],allowedSurfaces:le,allowedCredentialTypes:de,description:"Remove a webhook endpoint"},{id:"webhooks.test",operation:"Send a test webhook payload",requiredScopes:["webhooks:write"],allowedSurfaces:le,allowedCredentialTypes:de,description:"Trigger a synthetic payload to verify an endpoint"},{id:"api-keys.create",operation:"Create an API key",requiredScopes:["api-keys:write"],allowedSurfaces:le,allowedCredentialTypes:de,description:"Mint a new consumer or master API key"},{id:"api-keys.revoke",operation:"Revoke an API key",requiredScopes:["api-keys:write"],allowedSurfaces:le,allowedCredentialTypes:de,description:"Revoke an API key (immediate invalidation)"},{id:"api-keys.read",operation:"Read API key metadata",requiredScopes:["api-keys:read"],allowedSurfaces:le,allowedCredentialTypes:de,description:"Read key id + hint + scopes (never the secret)"},{id:"organizations.create",operation:"Create an organization",requiredScopes:["orgs:write"],allowedSurfaces:["template"],allowedCredentialTypes:["builder_session_token"],description:"Create a builder org (top-level signup)"},{id:"organizations.update",operation:"Update an organization",requiredScopes:["orgs:write"],allowedSurfaces:le,allowedCredentialTypes:de,description:"Update org metadata or billing email"},{id:"members.invite",operation:"Invite a member to an organization",requiredScopes:["members:write"],allowedSurfaces:le,allowedCredentialTypes:de,description:"Send an invitation to join the org"},{id:"members.remove",operation:"Remove a member from an organization",requiredScopes:["members:write"],allowedSurfaces:le,allowedCredentialTypes:de,description:"Revoke a member's access to the org"},{id:"projects.create",operation:"Create a project",requiredScopes:["projects:write"],allowedSurfaces:le,allowedCredentialTypes:de,description:"Create a project (groups products + environments)"},{id:"environments.create",operation:"Create an environment",requiredScopes:["environments:write"],allowedSurfaces:le,allowedCredentialTypes:de,description:"Add a deployment environment (stage / branch)"},{id:"environments.delete",operation:"Delete an environment",requiredScopes:["environments:write"],allowedSurfaces:le,allowedCredentialTypes:de,description:"Remove a deployment environment"},{id:"billing.portal-redirect",operation:"Generate Stripe customer-portal redirect",requiredScopes:["billing:portal"],allowedSurfaces:le,allowedCredentialTypes:[...de,...c_],description:"Mint a one-time Stripe portal-session redirect URL"},{id:"billing.read",operation:"Read billing state",requiredScopes:["billing:read"],allowedSurfaces:le,allowedCredentialTypes:[...de,...c_],description:"Read invoices, balances, scheduled changes"},{id:"runtime-context.read",operation:"Read the caller's runtime context",requiredScopes:[],allowedSurfaces:zT,allowedCredentialTypes:DT,description:"Introspect the resolved RuntimeContext (minus secrets)"},{id:"operations.list",operation:"List registered operations",requiredScopes:[],allowedSurfaces:zT,allowedCredentialTypes:DT,description:"List all operations the registry knows about"},{id:"explain-denial.read",operation:"Explain a denial decision",requiredScopes:["audit:read"],allowedSurfaces:le,allowedCredentialTypes:de,description:"Look up a decision id + return the full ctx + reason"},{id:"replay.execute",operation:"Replay a historical billing period",requiredScopes:["replay:execute"],allowedSurfaces:le,allowedCredentialTypes:de,description:"Re-run billing for a past period; verify deltas"},{id:"rollback.execute",operation:"Execute a GitHub-driven product rollback",requiredScopes:["rollback:execute"],allowedSurfaces:le,allowedCredentialTypes:de,description:"Revert business.ts to a previous commit (dry-run capable)"},{id:"api.invoke",operation:"Invoke a consumer-facing gateway route",requiredScopes:[],allowedSurfaces:j4,allowedCredentialTypes:c_,description:"Consumer-side traffic into a deployed product (catch-all). The EntitlementEngine + RuntimeLimitEngine handle the fine-grained gating; this operation is the umbrella entry-point."}],oY=Object.freeze(U4);var M4=["BusinessApplyWorkflow","RollbackWorkflow","StripeSyncWorkflow","WebhookDispatchWorkflow","SubscriptionTransitionWorkflow","CompiledPlanLifecycleWorkflow","ShardReshardWorkflow","MaintenanceJobWorkflow"],uY=a.enum(M4),L4=["transient","permanent","rollback-required","human-intervention"],lY=a.enum(L4);var Z4=["SAFE_AUTOMATIC","REQUIRES_APPROVAL","IRREVERSIBLE","BILLING_IMPACTING","EDGE_BREAKING"],dY=a.enum(Z4);var bY=a.object({workflowExecutionId:a.string().min(1),eventType:a.string().min(1),phase:a.string().min(1).optional(),stepId:a.string().min(1).optional(),cohortKey:a.string().min(1).optional(),payload:a.record(a.string(),a.unknown()),occurredAt:a.string().min(1),correlationId:a.string().min(1).optional()}).transform(t=>({...t,workflowExecutionId:t.workflowExecutionId,stepId:t.stepId===void 0?void 0:t.stepId}));var B4=["GATEWAY","HOSTED_UI_PAGE","HOSTED_UI_PROXY"],F4=["platform_requests"],V4=a.object({requestId:a.string().optional(),businessId:a.string().optional(),route:a.string().optional(),usageEventId:a.string().optional()}).strict(),q4=a.object({organizationId:a.string().min(1),source:a.enum(B4),dimension:a.enum(F4),quantity:a.number().int().positive(),idempotencyKey:a.string().min(1).max(512),occurredAt:a.string().datetime(),metadata:V4.optional()}).strict(),zY=a.object({entries:a.array(q4).min(1).max(500)});var jT={contract:{label:"Managed as code",summary:"Declarative business state, canonical in the GitHub repo. Author the business program and push.",canonicalHome:"repo",mcpMayWrite:!1},operate:{label:"Runtime operation",summary:"Imperative action on the running platform; never in the repo. Tokens, usage, readiness, builds, publish triggers, runtime knobs, brand edits.",canonicalHome:"api",mcpMayWrite:!0}};function H4(t){return jT[t].mcpMayWrite}function K4(t){return jT[t].canonicalHome}var Tr="webhooks",Ia="maker-tokens",$a="promo-codes",io="variables",wt="change-sets",it=t=>({reason:"repo_authored",detail:`Declare ${t} in the business repo's business/ folder and push \u2014 the platform applies it.`}),UY=[{key:"plan.create",class:"contract",domain:"plans",unavailable:it("the plan with `fs.plan()`")},{key:"plan.update",class:"contract",domain:"plans",unavailable:it("the plan's new shape with `fs.plan()`")},{key:"plan.delete",class:"contract",domain:"plans",unavailable:it("the removal (delete the `fs.plan()` call)")},{key:"plan.read",class:"contract",domain:"plans"},{key:"plan.variant.create",class:"contract",domain:"plans",unavailable:it("the plan variant with `fs.plan()`")},{key:"plan.promote",class:"contract",domain:"plans",unavailable:it("the promoted plan version")},{key:"plan.rollback",class:"contract",domain:"plans",unavailable:it("the prior plan shape (revert the commit)")},{key:"route.define",class:"contract",domain:"routes",unavailable:it("the route with `fs.route()`")},{key:"gateway.config",class:"contract",domain:"gateway",unavailable:it("the gateway block on `fs.business()`")},{key:"auth_strategy.update",class:"contract",domain:"gateway",unavailable:it("the auth strategy on `fs.business()`")},{key:"rate_limit.update",class:"contract",domain:"gateway",unavailable:it("the limits on the plan or route")},{key:"meter.define",class:"contract",domain:"metering",unavailable:it("the meter with `fs.meter()`")},{key:"backend.define",class:"contract",domain:"backends",unavailable:it("the backend with `fs.backend()`")},{key:"webhook.define",class:"contract",domain:Tr,unavailable:it("the webhook block on `fs.business()`")},{key:"business.contract_field.update",class:"contract",domain:"businesses",unavailable:it("the field (name / meters / subscriberChangePolicy / rbac) on `fs.business()`")},{key:"rbac.enable",class:"contract",domain:"products",unavailable:it("the `rbac` flag on `fs.business()`")},{key:"rbac.read",class:"contract",domain:"products"},{key:"business.list",class:"operate",domain:"businesses"},{key:"business.status",class:"operate",domain:"businesses"},{key:"change_set.portal_list",class:"operate",domain:wt,sideEffect:"read",unavailable:{reason:"subscriber_portal",detail:"GET /portal/businesses/:id/me/change-sets \u2014 the subscriber org's own view of its ChangeSets, reached in the portal. The builder-plane equivalent IS a command: `farthershore proposal list` (change_set.proposal_list)."}},{key:"change_set.portal_read",class:"operate",domain:wt,sideEffect:"read",unavailable:{reason:"subscriber_portal",detail:"GET /portal/businesses/:id/me/change-sets/:changeSetId \u2014 the subscriber's own detail view. The builder-plane equivalent IS a command: `farthershore proposal get` (change_set.proposal_read)."}},{key:"apply_timeline.list",class:"operate",domain:wt},{key:"apply_timeline.read",class:"operate",domain:wt},{key:"change_set.approve",class:"operate",domain:wt,unavailable:{reason:"human_decision",detail:"Sign-off is human/portal-session-only (ADR-0013). Propose with `farthershore proposal create`, then ask a human in the subscriber org to approve it in the portal."}},{key:"change_set.apply",class:"operate",domain:wt,unavailable:{reason:"human_decision",detail:"Execution of a governed ChangeSet is human/portal-session-only (ADR-0013). Poll `farthershore proposal get` for the status a human's apply produces."}},{key:"change_set.rollback",class:"operate",domain:wt,unavailable:{reason:"human_decision",detail:"Reverting an applied ChangeSet is human/portal-session-only (ADR-0013). Ask a human in the subscriber org to roll it back in the portal."}},{key:"change_set.cancel",class:"operate",domain:wt,unavailable:{reason:"human_decision",detail:"Cancelling a governed ChangeSet is human/portal-session-only (ADR-0013), reserved for the proposer or an approver in the portal."}},{key:"change_set.propose",class:"operate",domain:wt},{key:"change_set.preview",class:"operate",domain:wt},{key:"change_set.proposal_list",class:"operate",domain:wt},{key:"change_set.proposal_read",class:"operate",domain:wt},{key:"business.delete",class:"operate",domain:"businesses"},{key:"build.trigger",class:"operate",domain:"lifecycle",unavailable:{reason:"git_triggered",detail:"The sanctioned build triggers are git events: production on a GitHub Release, a preview environment on a push to its env branch. A builder-API trigger route exists (POST /businesses/:id/frontend/deploy) but the CLI deliberately does not expose it \u2014 a third manual trigger lets what is serving diverge from git. Push or release, then `farthershore frontend status --wait`."}},{key:"frontend.deploy",class:"operate",domain:"frontend",unavailable:{reason:"git_triggered",detail:"The CLI DELIBERATELY exposes no deploy verb: production publishes on a GitHub Release, a preview environment on a push to its env branch, and a third manual trigger is another way for what is serving to diverge from git. (The builder API does mount POST /businesses/:id/frontend/deploy; the CLI intentionally does not wrap it.) Push or release, then `farthershore frontend status --wait`."}},{key:"frontend.status",class:"operate",domain:"frontend"},{key:"frontend.rollback",class:"operate",domain:"frontend"},{key:"webhook.read",class:"operate",domain:Tr},{key:"webhook.create",class:"operate",domain:Tr},{key:"webhook.update",class:"operate",domain:Tr},{key:"webhook.delete",class:"operate",domain:Tr},{key:"webhook.test",class:"operate",domain:Tr},{key:"agents.list",class:"operate",domain:"agents"},{key:"agents.status",class:"operate",domain:"agents"},{key:"agents.runs.show",class:"operate",domain:"agents"},{key:"agents.enable",class:"operate",domain:"agents"},{key:"agents.disable",class:"operate",domain:"agents"},{key:"bulletin.list",class:"operate",domain:"agents"},{key:"bulletin.read",class:"operate",domain:"agents"},{key:"bulletin.ack",class:"operate",domain:"agents"},{key:"bulletin.resolve",class:"operate",domain:"agents"},{key:"webhook.delivery.read",class:"operate",domain:Tr},{key:"promo_code.read",class:"operate",domain:$a},{key:"promo_code.create",class:"operate",domain:$a},{key:"promo_code.update",class:"operate",domain:$a},{key:"promo_code.archive",class:"operate",domain:$a},{key:"promo_code.reactivate",class:"operate",domain:$a},{key:"consumer.read",class:"operate",domain:"consumers"},{key:"consumer.block",class:"operate",domain:"consumers"},{key:"consumer.migrate_latest",class:"operate",domain:"consumers"},{key:"consumer.remove",class:"operate",domain:"consumers"},{key:"consumer.rbac.settings",class:"operate",domain:"consumers",unavailable:{reason:"subscriber_portal",detail:"GET/PUT /portal/businesses/:id/me/rbac/settings \u2014 the subscriber org toggles RBAC and picks its default role in its own portal. The builder enables the RBAC feature by declaring `rbac` on `fs.business()` and pushing (rbac.enable, repo-authored); `farthershore business rbac` only VERIFIES the accepted state (rbac.read)."}},{key:"consumer.rbac.roles",class:"operate",domain:"consumers",unavailable:{reason:"subscriber_portal",detail:"/portal/businesses/:id/me/rbac/roles \u2014 the subscriber org authors its own roles in its portal. A builder/agent may only PROPOSE a role change, via `farthershore proposal create`."}},{key:"consumer.roles.assign",class:"operate",domain:"consumers"},{key:"business_variable.read",class:"operate",domain:io},{key:"business_variable.create",class:"operate",domain:io},{key:"business_variable.rotate",class:"operate",domain:io},{key:"business_variable.revoke",class:"operate",domain:io},{key:"business_variable.delete",class:"operate",domain:io},{key:"business_variable.operation.read",class:"operate",domain:io},{key:"runtime_token.mint",class:"operate",domain:"runtime-tokens"},{key:"runtime_token.rotate",class:"operate",domain:"runtime-tokens"},{key:"runtime_token.revoke",class:"operate",domain:"runtime-tokens"},{key:"runtime_token.read",class:"operate",domain:"runtime-tokens"},{key:"maker_token.create",class:"operate",domain:Ia,unavailable:{reason:"browser_only",detail:"Maker-token administration is deliberately human/browser-session-only. An agent may use a token supplied through a secret store but may never mint another credential."}},{key:"maker_token.revoke",class:"operate",domain:Ia,unavailable:{reason:"browser_only",detail:"Maker-token revocation is deliberately human/browser-session-only. Ask an organization owner to revoke it in token settings."}},{key:"maker_token.rotate",class:"operate",domain:Ia,unavailable:{reason:"browser_only",detail:"Maker-token rotation is deliberately human/browser-session-only. Ask an organization owner to rotate it and update the agent secret store."}},{key:"maker_token.hard_delete",class:"operate",domain:Ia,unavailable:{reason:"browser_only",detail:"Permanent maker-token deletion is deliberately human/browser-session-only and is available only in token settings."}},{key:"maker_token.read",class:"operate",domain:Ia,unavailable:{reason:"browser_only",detail:"The maker-token inventory is deliberately hidden from agent surfaces. A human organization owner reviews it in token settings."}},{key:"metering_token.mint",class:"operate",domain:"metering",unavailable:{reason:"runtime_surface",detail:"The metering credential is DERIVED from the runtime token at backend bootstrap (/runtime/*), not minted separately. Issue the runtime token with `farthershore backend tokens create --operations metering`."}},{key:"usage.report",class:"operate",domain:"usage",unavailable:{reason:"runtime_surface",detail:"Usage is reported by the running backend at request time \u2014 `usage.report(meter, n)` from @farthershore/backend. Read what it recorded with `farthershore usage summary`."}},{key:"usage.read",class:"operate",domain:"usage"},{key:"backend.create",class:"operate",domain:"backends"},{key:"backend.bind",class:"operate",domain:"backends"},{key:"backend.delete",class:"operate",domain:"backends"},{key:"backend.read",class:"operate",domain:"backends"},{key:"backend.status.read",class:"operate",domain:"backends",unavailable:{reason:"served_by_other_command",detail:"`farthershore backend list` (backend.read) already returns each backend's derived status \u2014 there is no separate status command."}},{key:"persona.bootstrap",class:"operate",domain:"personas"},{key:"persona.read",class:"operate",domain:"personas"},{key:"persona.rotate",class:"operate",domain:"personas"},{key:"persona.revoke",class:"operate",domain:"personas"},{key:"analytics.timeseries",class:"operate",domain:"analytics"},{key:"analytics.latency",class:"operate",domain:"analytics"},{key:"analytics.top",class:"operate",domain:"analytics"},{key:"analytics.log",class:"operate",domain:"analytics"},{key:"organization.list",class:"operate",domain:"organizations"},{key:"organization.create",class:"operate",domain:"organizations"},{key:"organization.member.list",class:"operate",domain:"organizations"},{key:"organization.invitation.create",class:"operate",domain:"organizations"},{key:"organization.invitation.list",class:"operate",domain:"organizations"},{key:"organization.invitation.revoke",class:"operate",domain:"organizations"},{key:"organization.invitation.accept",class:"operate",domain:"organizations"},{key:"organization.member.update",class:"operate",domain:"organizations"},{key:"organization.member.remove",class:"operate",domain:"organizations"},{key:"organization.ownership.transfer",class:"operate",domain:"organizations"},{key:"organization.delete",class:"operate",domain:"organizations"},{key:"organization.overview.read",class:"operate",domain:"organizations"},{key:"organization.bulletin.read",class:"operate",domain:"organizations"},{key:"audit_log.read",class:"operate",domain:"audit-logs"},{key:"audit_log.export",class:"operate",domain:"audit-logs"},{key:"notification.read",class:"operate",domain:"notifications"},{key:"notification.mark_read",class:"operate",domain:"notifications"},{key:"notification.mark_all_read",class:"operate",domain:"notifications"},{key:"notification.preferences.read",class:"operate",domain:"notifications"},{key:"notification.preferences.update",class:"operate",domain:"notifications"},{key:"brand.update",class:"operate",domain:"branding",unavailable:{reason:"served_by_other_command",detail:"`farthershore business update --display-name/--description/--icon-url/--logo-url` (registered under business.origin.update; MCP tool `fs_brand_update`) writes the brand fields."}},{key:"business.origin.update",class:"operate",domain:"businesses"},{key:"business.docs.enable",class:"operate",domain:"businesses"},{key:"business.docs.disable",class:"operate",domain:"businesses"},{key:"business.preview_env.set",class:"operate",domain:"businesses"},{key:"plan.migration_batch.create",class:"operate",domain:"plans"},{key:"business.create",class:"operate",domain:"businesses"},{key:"business.read",class:"operate",domain:"businesses"},{key:"business.publish",class:"operate",domain:"lifecycle"},{key:"business.rollback",class:"operate",domain:"lifecycle",unavailable:{reason:"not_implemented",detail:"The API exists (POST /management/businesses/:id/rollback, scope businesses:publish) but no CLI command wraps it yet. Call the endpoint directly, or revert the commit and push."}},{key:"manifest.apply",class:"contract",domain:"lifecycle",unavailable:{reason:"git_triggered",detail:"The repo pipeline applies the compiled IR on a push/release through the same neutral apply service. `farthershore validate` runs the identical verdict locally WITHOUT applying; `farthershore apply-timeline list` shows what the platform applied."}},{key:"environment.create",class:"operate",domain:"environments"},{key:"environment.update",class:"operate",domain:"environments",unavailable:{reason:"not_implemented",detail:"No builder/maker-callable update route exists \u2014 core has only GET/POST /businesses/:id/environments and DELETE /:envName (an internal admin slug-rename exists but is service-plane only). Delete and recreate with `farthershore env delete` + `farthershore env create`."}},{key:"environment.delete",class:"operate",domain:"environments"},{key:"environment.read",class:"operate",domain:"environments"}];function UT(t,e){return e==="write"&&!H4(t)?`An MCP tool that writes cannot have operationClass "${t}": ${t}-class state is managed as code in the business repo (canonical home: ${K4(t)}). Make the tool read-only, or author the change in the manifest and push instead.`:null}var Ce={VALIDATION_ERROR:"VALIDATION_ERROR",CONFLICT:"CONFLICT",NOT_FOUND:"NOT_FOUND",NOT_IMPLEMENTED:"NOT_IMPLEMENTED",NOT_CONFIGURED:"NOT_CONFIGURED",INTERNAL_ERROR:"INTERNAL_ERROR",SERVICE_UNAVAILABLE:"SERVICE_UNAVAILABLE",RATE_LIMIT_EXCEEDED:"RATE_LIMIT_EXCEEDED",DELETE_CONFIRMATION_REQUIRED:"DELETE_CONFIRMATION_REQUIRED",MISSING_HOST:"MISSING_HOST",MISSING_CONNECTIONS:"MISSING_CONNECTIONS",SECRET_NOT_CONFIGURED:"SECRET_NOT_CONFIGURED",UNAUTHORIZED:"UNAUTHORIZED",FORBIDDEN:"FORBIDDEN",INVALID_ACCESS_KEY:"INVALID_ACCESS_KEY",AUTO_KEY_CREATION_FAILED:"AUTO_KEY_CREATION_FAILED",PERSONA_NOT_FOUND:"PERSONA_NOT_FOUND",PERSONA_REVOKED:"PERSONA_REVOKED",PERSONA_SESSIONS_NOT_SUPPORTED:"PERSONA_SESSIONS_NOT_SUPPORTED",NOT_TEST_PERSONA_ENV:"NOT_TEST_PERSONA_ENV",PERSONA_AUTH_DISABLED_IN_PROD:"PERSONA_AUTH_DISABLED_IN_PROD",MAKER_TOKEN_NOT_FOUND:"MAKER_TOKEN_NOT_FOUND",MAKER_TOKEN_NOT_REVOKED:"MAKER_TOKEN_NOT_REVOKED",MAKER_TOKEN_NO_PRODUCT:"MAKER_TOKEN_NO_PRODUCT",MAKER_TOKEN_REVOKED:"MAKER_TOKEN_REVOKED",ORGANIZATION_NOT_FOUND:"ORGANIZATION_NOT_FOUND",ORG_HAS_ACTIVE_SUBSCRIPTIONS:"ORG_HAS_ACTIVE_SUBSCRIPTIONS",ORG_HAS_OUTSTANDING_BALANCE:"ORG_HAS_OUTSTANDING_BALANCE",PERSONAL_ORG_NOT_DELETABLE:"PERSONAL_ORG_NOT_DELETABLE",PERSONAL_OWNER_IMMUTABLE:"PERSONAL_OWNER_IMMUTABLE",PERSONAL_CO_OWNER_NOT_ALLOWED:"PERSONAL_CO_OWNER_NOT_ALLOWED",PRIMARY_OWNER_TRANSFER_REQUIRED:"PRIMARY_OWNER_TRANSFER_REQUIRED",MEMBER_NOT_FOUND:"MEMBER_NOT_FOUND",INVITATION_NOT_FOUND:"INVITATION_NOT_FOUND",RBAC_REQUIRES_TEAM_ORG:"RBAC_REQUIRES_TEAM_ORG",RBAC_NOT_ENABLED_BY_PRODUCT:"RBAC_NOT_ENABLED_BY_PRODUCT",UNKNOWN_PERMISSION:"UNKNOWN_PERMISSION",CUSTOMER_NOT_FOUND:"CUSTOMER_NOT_FOUND",PRODUCT_NOT_FOUND:"PRODUCT_NOT_FOUND",PRODUCT_DELETE_BLOCKED:"PRODUCT_DELETE_BLOCKED",PRODUCT_REPO_NOT_LINKED:"PRODUCT_REPO_NOT_LINKED",PRODUCT_SCOPE_MISMATCH:"PRODUCT_SCOPE_MISMATCH",YAML_PARSE_ERROR:"YAML_PARSE_ERROR",COMPILATION_NOT_FOUND:"COMPILATION_NOT_FOUND",PLAN_NOT_FOUND:"PLAN_NOT_FOUND",PLAN_HAS_ACTIVE_SUBSCRIPTIONS:"PLAN_HAS_ACTIVE_SUBSCRIPTIONS",PLAN_SLUG_CONFLICT:"PLAN_SLUG_CONFLICT",PLAN_REQUIRED:"PLAN_REQUIRED",PLAN_UPGRADE_REQUIRED:"PLAN_UPGRADE_REQUIRED",PLAN_OFFER_CHANGED:"PLAN_OFFER_CHANGED",SLUG_CONFLICT:"SLUG_CONFLICT",SLUG_BLOCKED:"SLUG_BLOCKED",SLUG_OFFENSIVE:"SLUG_OFFENSIVE",SLUG_RESERVED:"SLUG_RESERVED",SLUG_IMPERSONATION:"SLUG_IMPERSONATION",SLUG_INVALID_FORMAT:"SLUG_INVALID_FORMAT",SLUG_VALIDATOR_NOT_READY:"SLUG_VALIDATOR_NOT_READY",PRICING_PREVIEW_FAILED:"PRICING_PREVIEW_FAILED",PRICING_REPLAY_FAILED:"PRICING_REPLAY_FAILED",RESERVATION_NOT_FOUND:"RESERVATION_NOT_FOUND",PROMO_CODE_NOT_FOUND:"PROMO_CODE_NOT_FOUND",PROMO_CODE_INVALID:"PROMO_CODE_INVALID",BILLING_EVENT_NOT_FOUND:"BILLING_EVENT_NOT_FOUND",BILLING_NOT_CONFIGURED:"BILLING_NOT_CONFIGURED",SUBSCRIPTION_NOT_READY:"SUBSCRIPTION_NOT_READY",SUBSCRIPTION_FETCH_FAILED:"SUBSCRIPTION_FETCH_FAILED",INVALID_STATE:"INVALID_STATE",DUPLICATE_TRANSITION:"DUPLICATE_TRANSITION",ARCHIVED_TARGET:"ARCHIVED_TARGET",FREE_TO_PAID_VIA_CHECKOUT_ONLY:"FREE_TO_PAID_VIA_CHECKOUT_ONLY",RESOURCE_LIMIT_EXCEEDED:"RESOURCE_LIMIT_EXCEEDED",RESOURCE_LIMIT_CHECK_UNAVAILABLE:"RESOURCE_LIMIT_CHECK_UNAVAILABLE",STRIPE_NOT_CONFIGURED:"STRIPE_NOT_CONFIGURED",STRIPE_BALANCE_OUTSTANDING:"STRIPE_BALANCE_OUTSTANDING",STRIPE_OPERATION_FAILED:"STRIPE_OPERATION_FAILED",STRIPE_RESYNC_FAILED:"STRIPE_RESYNC_FAILED",CHECKOUT_SESSION_FAILED:"CHECKOUT_SESSION_FAILED",POLAR_PRODUCT_NOT_CONFIGURED:"POLAR_PRODUCT_NOT_CONFIGURED",BILLING_TAX_NOT_ENROLLED:"BILLING_TAX_NOT_ENROLLED",WEBHOOK_NOT_FOUND:"WEBHOOK_NOT_FOUND",WEBHOOK_DISPATCH_FAILED:"WEBHOOK_DISPATCH_FAILED",WEBHOOK_SECRET_NOT_CONFIGURED:"WEBHOOK_SECRET_NOT_CONFIGURED",INVALID_WEBHOOK_SIGNATURE:"INVALID_WEBHOOK_SIGNATURE",MISSING_RAW_BODY:"MISSING_RAW_BODY",WEBHOOK_REDIRECTED:"WEBHOOK_REDIRECTED",MANAGED_BY_CODE:"MANAGED_BY_CODE",GITHUB_CONNECTION_NOT_FOUND:"GITHUB_CONNECTION_NOT_FOUND",GITHUB_NOT_CONNECTED:"GITHUB_NOT_CONNECTED",GITHUB_SYNC_FAILED:"GITHUB_SYNC_FAILED",GITHUB_SYNC_UNAVAILABLE:"GITHUB_SYNC_UNAVAILABLE",GITHUB_TOKEN_FAILED:"GITHUB_TOKEN_FAILED",GIT_PROVIDER_NOT_CONFIGURED:"GIT_PROVIDER_NOT_CONFIGURED",ENVIRONMENT_NOT_FOUND:"ENVIRONMENT_NOT_FOUND",ENVIRONMENT_CLEANUP_FAILED:"ENVIRONMENT_CLEANUP_FAILED",DEPLOYMENT_RUN_NOT_FOUND:"DEPLOYMENT_RUN_NOT_FOUND",BRANCH_NO_MATCHING_ENV:"BRANCH_NO_MATCHING_ENV",APPLY_SPEC_FAILED:"APPLY_SPEC_FAILED",BOOTSTRAP_FAILED:"BOOTSTRAP_FAILED",JOB_ALREADY_RUNNING:"JOB_ALREADY_RUNNING",LOGO_DELETE_FAILED:"LOGO_DELETE_FAILED",LOGO_UPLOAD_FAILED:"LOGO_UPLOAD_FAILED",INVALID_LOGO_FORMAT:"INVALID_LOGO_FORMAT",CHANGE_SET_STALE:"CHANGE_SET_STALE",SIMULATION_STALE:"SIMULATION_STALE",IDEMPOTENCY_KEY_REUSED:"IDEMPOTENCY_KEY_REUSED",SELF_APPROVAL_FORBIDDEN:"SELF_APPROVAL_FORBIDDEN",HUMAN_APPROVAL_REQUIRED:"HUMAN_APPROVAL_REQUIRED",GOVERNED_BY_CHANGE_SET:"GOVERNED_BY_CHANGE_SET",COMPENSATION_REQUIRED:"COMPENSATION_REQUIRED",MIGRATION_TOO_LARGE:"MIGRATION_TOO_LARGE"};var ZY={missing_token:Ce.UNAUTHORIZED,invalid_token:Ce.UNAUTHORIZED,context_unverified:Ce.UNAUTHORIZED,missing_signature:Ce.UNAUTHORIZED,malformed_signature:Ce.UNAUTHORIZED,unknown_key_id:Ce.UNAUTHORIZED,bad_signature:Ce.UNAUTHORIZED,expired_signature:Ce.UNAUTHORIZED,clock_skew:Ce.UNAUTHORIZED,replayed_nonce:Ce.UNAUTHORIZED,body_hash_mismatch:Ce.UNAUTHORIZED,route_mismatch:Ce.UNAUTHORIZED,environment_mismatch:Ce.UNAUTHORIZED,jwks_unavailable:Ce.SERVICE_UNAVAILABLE,body_too_large:Ce.VALIDATION_ERROR,member_subject_required:Ce.FORBIDDEN,service_subject_required:Ce.FORBIDDEN,surface_not_allowed:Ce.FORBIDDEN};var BY=Object.values(dE);var xe={BATCHER_ENUM:"batcher-enum",RUNTIME_INLINE:"runtime-inline",CONSTRAINT:"constraint",GATEWAY_ERROR:"gateway-error"};var MT={limit_allocator_unavailable:{statuses:[503],source:xe.BATCHER_ENUM,retryAfter:!0,verifiedAt:["engine/enforcement/runtime.ts:471"]},limit_exceeded:{statuses:[402],source:xe.BATCHER_ENUM,retryAfter:!0,verifiedAt:["engine/enforcement/batcher.ts:326","engine/enforcement/constraints/quota.ts:69"]},rate_limited:{statuses:[429],source:xe.BATCHER_ENUM,retryAfter:!0,verifiedAt:["engine/enforcement/batcher.ts:328","engine/enforcement/constraints/rate-limit.ts:74","engine/pipeline/rate-limit.ts:83"]},credit_exhausted:{statuses:[402],source:xe.BATCHER_ENUM,retryAfter:!0,verifiedAt:["engine/enforcement/batcher.ts:333"]},enforcement_denied:{statuses:[402],source:xe.BATCHER_ENUM,retryAfter:!0,verifiedAt:["engine/enforcement/batcher.ts:335"]},invalid_entitlement_shape:{statuses:[503],source:xe.RUNTIME_INLINE,retryAfter:!0,verifiedAt:["engine/enforcement/runtime.ts:144"]},unsupported_constraint_schema:{statuses:[503],source:xe.RUNTIME_INLINE,retryAfter:!1,verifiedAt:["engine/enforcement/runtime.ts:154"]},enforcement_error:{statuses:[500],source:xe.RUNTIME_INLINE,retryAfter:!1,verifiedAt:["engine/enforcement/runtime.ts:342"]},enforcement_dependency_unavailable:{statuses:[503],source:xe.RUNTIME_INLINE,retryAfter:!1,verifiedAt:["engine/enforcement/runtime.ts:427"]},concurrency_limit_exceeded:{statuses:[429],source:xe.CONSTRAINT,retryAfter:!0,verifiedAt:["engine/enforcement/constraints/concurrency.ts"]},concurrency_context_unavailable:{statuses:[503],source:xe.CONSTRAINT,retryAfter:!0,verifiedAt:["engine/enforcement/constraints/concurrency.ts:291"]},concurrency_coordinator_unavailable:{statuses:[503],source:xe.CONSTRAINT,retryAfter:!0,verifiedAt:["engine/enforcement/constraints/concurrency.ts:305"]},key_expired:{statuses:[401],source:xe.CONSTRAINT,retryAfter:!1,verifiedAt:["engine/enforcement/constraints/credential-validity.ts:33"]},permission_denied:{statuses:[403],source:xe.CONSTRAINT,retryAfter:!1,verifiedAt:["engine/enforcement/constraints/permission.ts:63"]},permission_unresolved:{statuses:[403],source:xe.CONSTRAINT,retryAfter:!1,verifiedAt:["engine/enforcement/constraints/permission.ts"]},route_not_enabled:{statuses:[403],source:xe.RUNTIME_INLINE,retryAfter:!1,verifiedAt:["engine/pipeline/pre-vec-costs.ts"]},geo_context_unavailable:{statuses:[503],source:xe.CONSTRAINT,retryAfter:!0,verifiedAt:["engine/enforcement/constraints/geo-restriction.ts:44"]},geo_blocked:{statuses:[403],source:xe.CONSTRAINT,retryAfter:!1,verifiedAt:["engine/enforcement/constraints/geo-restriction.ts:51"]},geo_not_allowed:{statuses:[403],source:xe.CONSTRAINT,retryAfter:!1,verifiedAt:["engine/enforcement/constraints/geo-restriction.ts:58"]},resource_count_limit_exceeded:{statuses:[402],source:xe.GATEWAY_ERROR,retryAfter:!1,verifiedAt:["apps/core:routes/internal/gateway-resources.ts:144"]},post_stream_overspend:{statuses:[402],source:xe.CONSTRAINT,retryAfter:!0,verifiedAt:["engine/enforcement/constraints/lifecycle-block.ts"]},request_too_large:{statuses:[413],source:xe.CONSTRAINT,retryAfter:!1,verifiedAt:["engine/enforcement/constraints/capacity.ts"]},resolver_rate_limited:{statuses:[503],source:xe.GATEWAY_ERROR,retryAfter:!0,verifiedAt:["engine/errors.ts:55"]},resolver_unavailable:{statuses:[503],source:xe.GATEWAY_ERROR,retryAfter:!0,verifiedAt:["engine/errors.ts:73"]},credential_resolver_miss_rate_limited:{statuses:[429],source:xe.GATEWAY_ERROR,retryAfter:!0,verifiedAt:["engine/errors.ts:89"]},provider_throttled:{statuses:[503],source:xe.GATEWAY_ERROR,retryAfter:!0,verifiedAt:["engine/pipeline/provider-adapter.ts"]}},G4=Object.keys(MT);var W4=new Set([429,503]),VY=new Set(G4.filter(t=>MT[t].statuses.every(e=>W4.has(e))));var J4=["quota","rate","concurrency","capacity","spend","adaptive"],HY=new Set(J4);var Y4=[402,403,413,429],GY=new Set(Y4);var X4=a.enum(["create","delete"]),Q4=a.enum(["RESERVED","COMMITTED","RELEASED","DENIED"]),e6=a.object({mutationId:a.string().min(1).max(200),requestId:a.string().min(1).max(200),businessId:a.string().min(1).max(200),subscriptionId:a.string().min(1).max(200),compiledPlanId:a.string().min(1).max(200),actionId:a.string().min(1).max(160),environmentId:a.string().min(1).max(200).nullable(),subjectId:a.string().min(1).max(200).optional()}).strict();var c8=e6.extend({statusCode:a.number().int().min(100).max(599)}).strict(),u8=a.object({mutationId:a.string().min(1).max(200),resource:a.string().min(1).max(120),effect:X4,state:Q4,count:a.number().int().nonnegative(),limit:a.number().int().nonnegative().nullable(),replayed:a.boolean()}).strict(),l8=a.object({error:a.object({code:a.literal("resource_count_limit_exceeded"),message:a.string(),limitCode:a.string(),dimension:a.string(),currentCapacity:a.number().int().nonnegative()}).strict()}).strict();var tp=a.string().min(1).max(128).regex(/^[A-Za-z0-9._:-]+$/),LT=a.object({businessId:tp,environmentId:tp.nullable(),secretName:a.string().min(1).max(128).regex(/^[A-Z][A-Z0-9_]*$/)}).strict();var u_=a.object({scope:LT,mutationId:tp,expectedGeneration:a.number().int().positive().nullable()}),t6=u_.extend({mutation:a.literal("publish"),generation:a.number().int().positive(),payloadHash:a.string().regex(/^[a-f0-9]{64}$/),sealedPayload:a.string().min(1).max(131072)}).strict(),n6=u_.extend({mutation:a.literal("rotate"),generation:a.number().int().positive(),payloadHash:a.string().regex(/^[a-f0-9]{64}$/),sealedPayload:a.string().min(1).max(131072)}).strict(),r6=u_.extend({mutation:a.enum(["revoke","delete"]),generation:a.number().int().positive(),payloadHash:a.string().regex(/^[a-f0-9]{64}$/)}).strict(),i6=a.discriminatedUnion("mutation",[t6,n6,r6]),m8=a.object({keyId:tp,signature:a.string().regex(/^[a-f0-9]{64}$/),command:i6}).strict(),f8=a.discriminatedUnion("available",[a.object({available:a.literal(!0),scope:LT,generation:a.number().int().positive(),payloadHash:a.string().regex(/^[a-f0-9]{64}$/),sealedPayload:a.string().min(1).max(131072),status:a.literal("ACTIVE")}).strict(),a.object({available:a.literal(!1),generation:a.number().int().positive().nullable(),payloadHash:a.string().regex(/^[a-f0-9]{64}$/).nullable(),status:a.enum(["MISSING","PENDING","REVOKING","REVOKED","DELETED"])}).strict()]);import{existsSync as d_,mkdirSync as o6,readFileSync as VT,writeFileSync as AX}from"node:fs";import{homedir as s6}from"node:os";import{join as np}from"node:path";var ZT="https://core.farthershore.com";var p_=np(s6(),".farthershore"),BT=np(p_,"config.json"),FT=np(p_,"credentials.json");function a6(t){d_(t)||o6(t,{recursive:!0,mode:448})}var l_={apiUrl:ZT};function m_(){if(a6(p_),!d_(BT))return l_;try{let t=JSON.parse(VT(BT,"utf-8"));return{...l_,...t}}catch{return l_}}function qT(){if(!d_(FT))return null;try{return JSON.parse(VT(FT,"utf-8"))}catch{return null}}function c6(){return m_().links??{}}function HT(t){let e=c6(),n=t;for(;;){let i=e[n];if(i)return i;let r=np(n,"..");if(r===n)return null;n=r}}var A=class extends Error{constructor(n,i,r){super(n);this.status=i;this.name="CliError",this.code=r?.code,this.details=r?.details,this.param=r?.param}status;code;details;param},oo=class extends Error{constructor(e,n){super(e,{cause:n}),this.name="CliTransportError"}};function KT(t){if(t)return t;let e=process.env.FARTHERSHORE_TOKEN;if(e)return e;let n=qT();if(n?.token)return n.token;throw new A("Not authenticated. Run `farthershore auth login` or set FARTHERSHORE_TOKEN environment variable.")}var Wn="x-fs-surface",Jn="cli",u6="management";function k(t){return encodeURIComponent(t)}function ze(t,e){let n=new URLSearchParams;for(let[r,o]of Object.entries(e))o&&n.set(r,o);let i=n.toString();return i?`${t}?${i}`:t}function GT(t){let e=t.includes("?")?"&":"?";return`${t}${e}dry_run=true`}var l6=new Set([429,500,502,503,504]),d6=3,p6=3e4,WT=200,m6=4e3,f6=t=>new Promise(e=>setTimeout(e,t));function JT(t,e){if(e){let i=Number(e);if(Number.isFinite(i)&&i>=0)return Math.min(i*1e3,1e4)}return Math.min(WT*2**(t-1),m6)+Math.floor(Math.random()*WT)}function f_(t,e){let n=t.toUpperCase();return n==="GET"||n==="HEAD"?!0:"Idempotency-Key"in e}function YT(t){let e=t.retry?.attempts??d6,n=t.retry?.sleep??f6;async function i(d,m,f){let g=f?e:1,y;for(let v=1;v<=g;v++){let S=new AbortController,z=setTimeout(()=>S.abort(),p6);try{let R=await fetch(d,{...m,signal:S.signal});if(f&&v<g&&l6.has(R.status)){let U=R.headers?.get?.("retry-after")??null;await n(JT(v,U));continue}return R}catch(R){if(y=R,f&&v<g){await n(JT(v,null));continue}let U=R instanceof Error?R.message:"Network request failed";throw new oo(U,R)}finally{clearTimeout(z)}}throw y}let r=null;async function o(){let d=await fetch(`${t.apiUrl}/auth/cli/exchange`,{method:"POST",headers:{Authorization:`Bearer ${t.token}`,"Content-Type":"application/json",[Wn]:Jn}});if(!d.ok){let m=await d.json().catch(()=>null),f=m?.error,g=typeof f=="string"?{message:f}:f;throw new A(g?.message??d.statusText,d.status,{code:g?.code,details:g?.details??g6(m)})}return r=await d.json(),r}function s(d){return d.split("/",3)[1]===u6}async function c(d){if(!t.token.startsWith("mk_")||s(d))return t.token;let m=r?Date.parse(r.expiresAt):0;return(!r||m-Date.now()<6e4)&&await o(),r.accessToken}async function u(d,m,f,g){let y=await c(m),v=g?.dryRun?GT(m):m,S={Authorization:`Bearer ${y}`,"Content-Type":"application/json",[Wn]:Jn};g?.idempotencyKey&&(S["Idempotency-Key"]=g.idempotencyKey);let z=await i(`${t.apiUrl}${v}`,{method:d,headers:S,body:f?JSON.stringify(f):void 0},g?.retryOnTransient===!1?!1:f_(d,S));if(!z.ok){let U=(await z.json().catch(()=>null))?.error,j=typeof U=="string"?{message:U}:U;throw new A(j?.message??z.statusText,z.status,{code:j?.code,details:j?.details})}if(z.status!==204)return z.json()}async function l(d,m,f,g,y){let v=await c(m),S=y?.dryRun?GT(m):m,z={Authorization:`Bearer ${v}`,"Content-Type":g,[Wn]:Jn};y?.idempotencyKey&&(z["Idempotency-Key"]=y.idempotencyKey);let R=await i(`${t.apiUrl}${S}`,{method:d,headers:z,body:f},y?.retryOnTransient===!1?!1:f_(d,z));if(!R.ok){let j=(await R.json().catch(()=>null))?.error,je=typeof j=="string"?{message:j}:j;throw new A(je?.message??R.statusText,R.status,{code:je?.code,details:je?.details})}if(R.status!==204)return R.json()}async function p(d,m){let g={Authorization:`Bearer ${await c(m)}`,[Wn]:Jn},y=await i(`${t.apiUrl}${m}`,{method:d,headers:g},f_(d,g));if(!y.ok){let S=(await y.json().catch(()=>null))?.error,z=typeof S=="string"?{message:S}:S;throw new A(z?.message??y.statusText,y.status,{code:z?.code,details:z?.details})}return y.text()}return{exchangeCliToken:o,authWhoami:async()=>{if(t.token.startsWith("mk_")){let m=await u("GET","/management/whoami");return{kind:"maker",tokenId:m.tokenId,organizationId:m.organizationId,businessId:m.businessId,scopes:m.scopes}}return{kind:"builder",...await u("POST","/builder/context/bootstrap")}},bootstrap:()=>u("POST","/builder/context/bootstrap"),listBuilderOrganizations:()=>u("GET","/builder/organizations"),createBuilderOrganization:(d,m)=>u("POST","/builder/organizations",d,m),listBuilderOrganizationMembers:d=>u("GET",`/builder/organizations/${k(d)}/members`),inviteBuilderOrganizationMember:(d,m,f)=>u("POST",`/builder/organizations/${k(d)}/invitations`,m,f),listBuilderInvitations:()=>u("GET","/builder/invitations"),revokeBuilderInvitation:(d,m)=>u("DELETE",`/builder/organizations/${k(d)}/invitations/${k(m)}`),acceptBuilderInvitation:(d,m)=>u("POST",`/builder/invitations/${k(d)}/accept`,m?{token:m}:void 0),updateBuilderOrganizationMember:(d,m,f)=>u("PATCH",`/builder/organizations/${k(d)}/members/${k(m)}`,{role:f}),removeBuilderOrganizationMember:(d,m)=>u("DELETE",`/builder/organizations/${k(d)}/members/${k(m)}`),transferBuilderOrganizationOwnership:(d,m)=>u("POST",`/builder/organizations/${k(d)}/ownership/transfer`,{newOwnerUserId:m}),deleteBuilderOrganization:d=>u("DELETE",`/builder/organizations/${k(d)}`),getBuilderOrganizationOverview:d=>u("GET",`/builder/organizations/${k(d)}/overview`),listBuilderOrganizationBulletin:(d,m)=>u("GET",ze(`/builder/organizations/${k(d)}/bulletin`,{kind:m?.kind,status:m?.status,cursor:m?.cursor,limit:m?.limit!==void 0?String(m.limit):void 0})),listBuilderAuditLogs:(d,m)=>{let f=m?.businessId?`/builder/organizations/${k(d)}/businesses/${k(m.businessId)}/audit-logs`:`/builder/organizations/${k(d)}/audit-logs`;return u("GET",ze(f,{action:m?.action,actorUserId:m?.actorUserId,decision:m?.decision,from:m?.from,to:m?.to,cursor:m?.cursor,limit:m?.limit!==void 0?String(m.limit):void 0}))},exportBuilderAuditLogs:(d,m)=>{let f=m?.businessId?`/builder/organizations/${k(d)}/businesses/${k(m.businessId)}/audit-logs/export.csv`:`/builder/organizations/${k(d)}/audit-logs/export.csv`;return p("GET",ze(f,{action:m?.action,actorUserId:m?.actorUserId,decision:m?.decision,from:m?.from,to:m?.to,limit:m?.limit!==void 0?String(m.limit):void 0}))},listBusinesses:d=>u("GET",ze("/businesses",{limit:d?.limit!==void 0?String(d.limit):void 0,offset:d?.offset!==void 0?String(d.offset):void 0})),createBusiness:(d,m)=>u("POST","/businesses",d,m),updateBusiness:(d,m,f,g)=>u("PATCH",ze(`/businesses/${k(d)}`,{env:f?.env}),m,g),uploadBrandAsset:(d,m,f,g,y)=>l("PUT",`/businesses/${k(d)}/${k(m)}`,f,g,y),deleteBrandAsset:(d,m,f)=>u("DELETE",`/businesses/${k(d)}/${k(m)}`,void 0,f),publishBusiness:(d,m,f)=>u("POST",`/businesses/${k(d)}/publish`,m&&Object.keys(m).length>0?m:void 0,f),migratePlan:(d,m,f,g)=>u("POST",`/businesses/${k(d)}/plans/${k(m)}/migration-batches`,f,g),getBusiness:(d,m)=>u("GET",ze(`/businesses/${k(d)}`,{env:m?.env})),getDeployments:d=>u("GET",`/businesses/${k(d)}/deployments`),listApplyTimeline:(d,m)=>u("GET",ze(`/businesses/${k(d)}/apply-timeline`,{env:m?.env})),proposeConsumerChangeSet:(d,m,f,g,y)=>u("POST",ze(`/businesses/${k(d)}/consumers/${k(m)}/change-sets`,{env:g?.env}),f,y),listConsumerChangeSets:(d,m,f)=>u("GET",ze(`/businesses/${k(d)}/consumers/${k(m)}/change-sets`,{env:f?.env,status:f?.status,cursor:f?.cursor,limit:f?.limit!==void 0?String(f.limit):void 0})),getConsumerChangeSet:(d,m,f,g)=>u("GET",ze(`/businesses/${k(d)}/consumers/${k(m)}/change-sets/${k(f)}`,{env:g?.env})),previewConsumerChangeSet:(d,m,f,g)=>u("POST",ze(`/businesses/${k(d)}/consumers/${k(m)}/change-sets/${k(f)}/preview`,{env:g?.env})),compileManifest:(d,m,f)=>u("POST",`/businesses/${k(d)}/manifest/compile`,{ir:m,...f?.env?{env:f.env}:{}}),previewPlanRelease:(d,m,f)=>u("POST",`/businesses/${k(d)}/plans/release-preview`,{ir:m,...f?.env?{env:f.env}:{}}),listEnvironments:d=>u("GET",`/businesses/${k(d)}/environments`),createEnvironment:(d,m,f)=>u("POST",`/businesses/${k(d)}/environments`,m,f),deleteEnvironment:(d,m)=>u("DELETE",`/businesses/${k(d)}/environments/${k(m)}`),deleteBusiness:d=>u("DELETE",`/businesses/${k(d)}`),builderListConsumers:(d,m)=>u("GET",ze(`/businesses/${k(d)}/consumers`,{env:m?.env})),builderBlockConsumer:(d,m)=>u("POST",`/businesses/${k(d)}/consumers/${k(m)}/block`),builderRemoveConsumer:(d,m)=>u("POST",`/businesses/${k(d)}/consumers/${k(m)}/remove`),builderMigrateConsumerToLatest:(d,m)=>u("POST",`/businesses/${k(d)}/consumers/${k(m)}/migrate-latest`),builderAssignConsumerMemberRoles:(d,m,f,g)=>u("POST",`/businesses/${k(d)}/consumers/${k(m)}/members/${k(f)}/roles`,{roles:g}),listPromoCodes:d=>u("GET",`/businesses/${k(d)}/promo-codes`),createPromoCode:(d,m)=>u("POST",`/businesses/${k(d)}/promo-codes`,m),updatePromoCode:(d,m,f)=>u("PATCH",`/businesses/${k(d)}/promo-codes/${k(m)}`,f),managementListPlans:d=>u("GET",`/management/businesses/${k(d)}/plans`),managementGetUsage:d=>u("GET",`/management/businesses/${k(d)}/usage`),analyticsQuery:(d,m)=>u("POST",`/businesses/${k(d)}/analytics/query`,m),managementListWebhooks:(d,m)=>u("GET",ze(`/management/businesses/${k(d)}/webhooks`,{limit:m?.limit})),managementCreateWebhook:(d,m,f)=>u("POST",`/management/businesses/${k(d)}/webhooks`,m,f),managementUpdateWebhook:(d,m,f,g)=>u("PATCH",`/management/businesses/${k(d)}/webhooks/${k(m)}`,f,g),managementDeleteWebhook:(d,m)=>u("DELETE",`/management/businesses/${k(d)}/webhooks/${k(m)}`),managementTestWebhook:(d,m)=>u("POST",`/management/businesses/${k(d)}/webhooks/${k(m)}/test`),managementListWebhookDeliveries:(d,m,f)=>u("GET",ze(`/management/businesses/${k(d)}/webhooks/${k(m)}/deliveries`,{limit:f?.limit})),builderListBackends:d=>u("GET",`/businesses/${k(d)}/backends`),builderCreateBackend:(d,m,f)=>u("POST",`/businesses/${k(d)}/backends`,m,f),builderBindBackend:(d,m,f,g)=>u("PATCH",`/businesses/${k(d)}/backends/${k(m)}`,f,g),builderDeleteBackend:(d,m)=>u("DELETE",`/businesses/${k(d)}/backends/${k(m)}`),builderListRuntimeTokens:d=>u("GET",`/businesses/${k(d)}/runtime-tokens`),builderCreateRuntimeToken:(d,m,f)=>u("POST",`/businesses/${k(d)}/runtime-tokens`,m,f),builderRotateRuntimeToken:(d,m,f)=>u("POST",`/businesses/${k(d)}/runtime-tokens/${k(m)}/rotate`,void 0,f),builderRevokeRuntimeToken:(d,m)=>u("DELETE",`/businesses/${k(d)}/runtime-tokens/${k(m)}`),builderFrontendStatus:(d,m)=>u("GET",`/businesses/${k(d)}/frontend/status${m?`?environmentId=${encodeURIComponent(m)}`:""}`),builderFrontendReleases:(d,m)=>u("GET",`/businesses/${k(d)}/frontend/releases${m?`?environmentId=${encodeURIComponent(m)}`:""}`),builderFrontendRollback:(d,m,f)=>u("POST",`/businesses/${k(d)}/frontend/rollback`,m,f),builderListBulletin:(d,m)=>u("GET",ze(`/businesses/${k(d)}/bulletin`,{kind:m?.kind,status:m?.status,cursor:m?.cursor,limit:m?.limit})),builderGetBulletinPost:(d,m)=>u("GET",`/businesses/${k(d)}/bulletin/${k(m)}`),builderSetBulletinStatus:(d,m,f)=>u("PATCH",`/businesses/${k(d)}/bulletin/${k(m)}`,{status:f}),builderListAgents:d=>u("GET",`/businesses/${k(d)}/agents`),builderAgentStatus:(d,m)=>u("GET",`/businesses/${k(d)}/agents/${k(m)}`),builderAgentRunDetail:(d,m,f)=>u("GET",`/businesses/${k(d)}/agents/${k(m)}/runs/${k(f)}`),builderConfigureAgent:(d,m,f,g)=>u("PUT",`/businesses/${k(d)}/agents/${k(m)}`,f,g),builderBusinessVariables:async(d,m)=>(await u("GET",ze(`/businesses/${k(d)}/variables`,{environmentId:m}))).variables,builderSetBusinessVariable:async(d,m,f,g)=>(await u("PUT",`/businesses/${k(d)}/variables/${k(m)}`,f,g)).operation,builderRevokeBusinessVariable:async(d,m,f,g)=>(await u("POST",`/businesses/${k(d)}/variables/${k(m)}/revoke`,{environmentId:f,confirmation:"REVOKE"},g)).operation,builderDeleteBusinessVariable:async(d,m,f,g)=>(await u("DELETE",`/businesses/${k(d)}/variables/${k(m)}`,{environmentId:f,confirmation:"DELETE"},g)).operation,builderGetBusinessVariableOperation:async(d,m)=>(await u("GET",`/businesses/${k(d)}/variables/operations/${k(m)}`)).operation,listBusinessNotifications:(d,m)=>u("GET",ze(`/businesses/${k(d)}/notifications`,{unreadOnly:m?.unreadOnly!==void 0?String(m.unreadOnly):void 0,cursor:m?.cursor,limit:m?.limit!==void 0?String(m.limit):void 0})),markBusinessNotificationRead:(d,m)=>u("POST",`/businesses/${k(d)}/notifications/${k(m)}/read`),markAllBusinessNotificationsRead:d=>u("POST",`/businesses/${k(d)}/notifications/read-all`),getBusinessNotificationPreferences:d=>u("GET",`/businesses/${k(d)}/notification-preferences`),updateBusinessNotificationPreferences:(d,m)=>u("PATCH",`/businesses/${k(d)}/notification-preferences`,m),issuePersonaBootstrapKey:async(d,m,f)=>{let g=await fetch(`${t.apiUrl}/portal/businesses/${k(d)}/environments/${k(m)}/test/bootstrap-key`,{method:"POST",headers:{Authorization:`Bearer ${t.token}`,"Content-Type":"application/json",[Wn]:Jn},body:JSON.stringify(f??{})});if(!g.ok){let v=(await g.json().catch(()=>null))?.error,S=typeof v=="string"?{message:v}:v;throw new A(S?.message??g.statusText,g.status,{code:S?.code,details:S?.details})}return g.json()},listPersonas:async(d,m)=>{let f=await fetch(`${t.apiUrl}/portal/businesses/${k(d)}/environments/${k(m)}/test/personas`,{method:"GET",headers:{Authorization:`Bearer ${t.token}`,[Wn]:Jn}});if(!f.ok){let y=(await f.json().catch(()=>null))?.error,v=typeof y=="string"?{message:y}:y;throw new A(v?.message??f.statusText,f.status,{code:v?.code,details:v?.details})}return f.json()},revokePersona:async(d,m,f)=>{let g=await fetch(`${t.apiUrl}/portal/businesses/${k(d)}/environments/${k(m)}/test/personas/${k(f)}`,{method:"DELETE",headers:{Authorization:`Bearer ${t.token}`,[Wn]:Jn}});if(!g.ok){let v=(await g.json().catch(()=>null))?.error,S=typeof v=="string"?{message:v}:v;throw new A(S?.message??g.statusText,g.status,{code:S?.code,details:S?.details})}return g.json()},rotatePersona:async(d,m,f)=>{let g=await fetch(`${t.apiUrl}/portal/businesses/${k(d)}/environments/${k(m)}/test/personas/${k(f)}/rotate`,{method:"POST",headers:{Authorization:`Bearer ${t.token}`,[Wn]:Jn}});if(!g.ok){let v=(await g.json().catch(()=>null))?.error,S=typeof v=="string"?{message:v}:v;throw new A(S?.message??g.statusText,g.status,{code:S?.code,details:S?.details})}return g.json()},getBusinessConfig:(d,m)=>u("GET",ze(`/businesses/${k(d)}/config`,{format:"json",env:m?.env}))}}function g6(t){if(!t||typeof t!="object")return;let e=t,n=Array.isArray(e.errors)?e.errors:void 0,i=Array.isArray(e.warnings)?e.warnings:void 0;if(!(!n?.length&&!i?.length))return{...n?.length?{errors:n}:{},...i?.length?{warnings:i}:{}}}var XT=(t=0)=>e=>`\x1B[${e+t}m`,QT=(t=0)=>e=>`\x1B[${38+t};5;${e}m`,eR=(t=0)=>(e,n,i)=>`\x1B[${38+t};2;${e};${n};${i}m`,Ee={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},FX=Object.keys(Ee.modifier),h6=Object.keys(Ee.color),b6=Object.keys(Ee.bgColor),VX=[...h6,...b6];function y6(){let t=new Map;for(let[e,n]of Object.entries(Ee)){for(let[i,r]of Object.entries(n))Ee[i]={open:`\x1B[${r[0]}m`,close:`\x1B[${r[1]}m`},n[i]=Ee[i],t.set(r[0],r[1]);Object.defineProperty(Ee,e,{value:n,enumerable:!1})}return Object.defineProperty(Ee,"codes",{value:t,enumerable:!1}),Ee.color.close="\x1B[39m",Ee.bgColor.close="\x1B[49m",Ee.color.ansi=XT(),Ee.color.ansi256=QT(),Ee.color.ansi16m=eR(),Ee.bgColor.ansi=XT(10),Ee.bgColor.ansi256=QT(10),Ee.bgColor.ansi16m=eR(10),Object.defineProperties(Ee,{rgbToAnsi256:{value(e,n,i){return e===n&&n===i?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(n/255*5)+Math.round(i/255*5)},enumerable:!1},hexToRgb:{value(e){let n=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!n)return[0,0,0];let[i]=n;i.length===3&&(i=[...i].map(o=>o+o).join(""));let r=Number.parseInt(i,16);return[r>>16&255,r>>8&255,r&255]},enumerable:!1},hexToAnsi256:{value:e=>Ee.rgbToAnsi256(...Ee.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let n,i,r;if(e>=232)n=((e-232)*10+8)/255,i=n,r=n;else{e-=16;let c=e%36;n=Math.floor(e/36)/5,i=Math.floor(c/6)/5,r=c%6/5}let o=Math.max(n,i,r)*2;if(o===0)return 30;let s=30+(Math.round(r)<<2|Math.round(i)<<1|Math.round(n));return o===2&&(s+=60),s},enumerable:!1},rgbToAnsi:{value:(e,n,i)=>Ee.ansi256ToAnsi(Ee.rgbToAnsi256(e,n,i)),enumerable:!1},hexToAnsi:{value:e=>Ee.ansi256ToAnsi(Ee.hexToAnsi256(e)),enumerable:!1}}),Ee}var _6=y6(),Zt=_6;import g_ from"node:process";import v6 from"node:os";import tR from"node:tty";function Et(t,e=globalThis.Deno?globalThis.Deno.args:g_.argv){let n=t.startsWith("-")?"":t.length===1?"-":"--",i=e.indexOf(n+t),r=e.indexOf("--");return i!==-1&&(r===-1||i<r)}var{env:Te}=g_,rp;Et("no-color")||Et("no-colors")||Et("color=false")||Et("color=never")?rp=0:(Et("color")||Et("colors")||Et("color=true")||Et("color=always"))&&(rp=1);function k6(){if("FORCE_COLOR"in Te)return Te.FORCE_COLOR==="true"?1:Te.FORCE_COLOR==="false"?0:Te.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(Te.FORCE_COLOR,10),3)}function S6(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function x6(t,{streamIsTTY:e,sniffFlags:n=!0}={}){let i=k6();i!==void 0&&(rp=i);let r=n?rp:i;if(r===0)return 0;if(n){if(Et("color=16m")||Et("color=full")||Et("color=truecolor"))return 3;if(Et("color=256"))return 2}if("TF_BUILD"in Te&&"AGENT_NAME"in Te)return 1;if(t&&!e&&r===void 0)return 0;let o=r||0;if(Te.TERM==="dumb")return o;if(g_.platform==="win32"){let s=v6.release().split(".");return Number(s[0])>=10&&Number(s[2])>=10586?Number(s[2])>=14931?3:2:1}if("CI"in Te)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(s=>s in Te)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(s=>s in Te)||Te.CI_NAME==="codeship"?1:o;if("TEAMCITY_VERSION"in Te)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Te.TEAMCITY_VERSION)?1:0;if(Te.COLORTERM==="truecolor"||Te.TERM==="xterm-kitty"||Te.TERM==="xterm-ghostty"||Te.TERM==="wezterm")return 3;if("TERM_PROGRAM"in Te){let s=Number.parseInt((Te.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Te.TERM_PROGRAM){case"iTerm.app":return s>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Te.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Te.TERM)||"COLORTERM"in Te?1:o}function nR(t,e={}){let n=x6(t,{streamIsTTY:t&&t.isTTY,...e});return S6(n)}var I6={stdout:nR({isTTY:tR.isatty(1)}),stderr:nR({isTTY:tR.isatty(2)})},rR=I6;function iR(t,e,n){let i=t.indexOf(e);if(i===-1)return t;let r=e.length,o=0,s="";do s+=t.slice(o,i)+e+n,o=i+r,i=t.indexOf(e,o);while(i!==-1);return s+=t.slice(o),s}function oR(t,e,n,i){let r=0,o="";do{let s=t[i-1]==="\r";o+=t.slice(r,s?i-1:i)+e+(s?`\r
|
|
82
82
|
`:`
|
|
83
83
|
`)+n,r=i+1,i=t.indexOf(`
|
|
84
|
-
`,r)}while(i!==-1);return o+=t.slice(r),o}var{stdout:
|
|
85
|
-
`);return o!==-1&&(e=MT(e,r,i,o)),i+e+r};Object.defineProperties(va.prototype,to);var Q4=va(),iX=va({level:ZT?ZT.level:0});var ey=Q4;var e6;function Jd(){return e6??t6(void 0)}function FT(){return Jd()==="json"}function qT(t){FT()||console.log(ey.dim(t))}function VT(t){FT()||console.log(ey.bold(t))}function ty(){return process.stdout.isTTY===!0}function t6(t){if(t==="json"||t==="table")return t;if(t!==void 0)throw new P(`Unsupported --format "${t}". Use "json" or "table".`,400,{code:"INVALID_OUTPUT_FORMAT",param:"format"});return ty()?"table":"json"}var n6={MANAGED_BY_CODE:"This business's contract is managed as code. Edit the Business SDK program in its GitHub repo (business/) and push \u2014 do NOT retry the API. (Branding stays editable via `farthershore business update`.)",UNAUTHORIZED:"Token is invalid or revoked. Run `farthershore auth login` to update it.",FORBIDDEN:"Your token doesn't have access to this resource. Check the org / business scope.",INVALID_ACCESS_KEY:"Token format is wrong. Generate a new one at https://farthershore.com/settings/tokens.",MAKER_TOKEN_REVOKED:"This maker token was revoked. Mint a new one in the business settings.",MAKER_TOKEN_NO_BUSINESS:"Maker token is not bound to a business. Re-create it from the business page.",AUTH_NO_TOKEN:"Pass --token <mk_...> or set FARTHERSHORE_TOKEN, or run interactively in a TTY.",AUTH_INVALID_TOKEN:"Token format is malformed. Maker tokens start with `mk_` and are 30+ characters.",DESTRUCTIVE_OP_REQUIRES_YES:"Destructive ops (delete) require an explicit `--yes` to proceed. This is intentional safety.",BUSINESS_UPDATE_NO_FIELDS:"Pass at least one field flag (--display-name, --origin, --description).",PLAN_UPDATE_NO_FIELDS:"Pass at least one of --name, --recurring-fee-cents, --grant, --trial-days, --max-monthly-spend-cents, or --meter.",ENV_NOT_FOUND:"Environment doesn't exist. Use `farthershore env list <business>` to see available envs, or create one with `farthershore env create`.",STRIPE_NOT_CONFIGURED:"Stripe isn't connected on this business. Connect it in the dashboard before running billing operations.",STRIPE_NOT_CONNECTED:"Publishing requires a connected Stripe account. Connect one on the dashboard Connections page, then re-run `farthershore business publish`.",STRIPE_NOT_VERIFIED:"Your Stripe account isn't fully verified yet. Finish Stripe onboarding, then re-run `farthershore business publish`.",BILLING_TAX_NOT_ENROLLED:"Stripe Tax isn't enrolled for this account. Enable it from the dashboard Connections page, then re-run `farthershore business publish`.",STRIPE_BALANCE_OUTSTANDING:"Customer has an outstanding balance. Resolve the invoice in Stripe before retrying.",CHECKOUT_SESSION_FAILED:"Stripe rejected the checkout request. Check that the plan exists and Stripe credentials are valid.",BUSINESS_NOT_FOUND:"Check the business slug. Run `farthershore` (no args) for a list of businesses you can see.",BUSINESS_REPO_NOT_LINKED:"Link a GitHub repo to this business before publishing or validating business manifests.",YAML_PARSE_ERROR:"Business manifest is not valid. Run `farthershore build` locally, fix business/ source, then push again for bot validation.",GITHUB_NOT_CONNECTED:"Connect GitHub on the org page before running `init` (it provisions the repo).",BRANCH_NO_MATCHING_ENV:"The current branch isn't mapped to an environment. Add a branch rule in business settings or pass --branch explicitly.",PLAN_NOT_FOUND:"Plan key doesn't exist on this business. Check the `plans` block in your local business manifest.",PLAN_HAS_ACTIVE_SUBSCRIPTIONS:"Plan has active subscribers and can't be deleted. Migrate them to another plan first.",PLAN_SLUG_CONFLICT:"Another plan already uses this key. Pick a unique plan key in your manifest.",SLUG_CONFLICT:"This business slug is taken. Pick a different name.",SLUG_BLOCKED:"This slug is reserved or blocked. Pick a different name.",SLUG_RESERVED:"This slug is reserved by Farther Shore. Pick a different name.",SLUG_INVALID_FORMAT:"Slug must be lowercase letters, digits, and hyphens (no leading/trailing hyphen).",DECISION_NOT_FOUND:"No DenialEvent recorded for that decisionId. Verify the id from the original deny response or audit log.",AUTH_UNAUTHORIZED:"Token is missing, expired, or lacks the audit:read scope required to read denial events.",RATE_LIMIT_EXCEEDED:"You've hit the rate limit. Wait a moment and retry.",VALIDATION_ERROR:"Request is malformed. The `details` field has the field-level errors.",CONFLICT:"The resource is in a state that conflicts with the request. Inspect `details` to learn more."};function HT(t){if(t)return n6[t]}function KT(t,e){return{schema_version:1,ok:!0,op:t,data:e}}function WT(t,e){let n=e.status??0;return{schema_version:1,ok:!1,op:t,error:{code:e.code??"INTERNAL_ERROR",message:e.message,status:n,param:e.param,retryable:i6(n,e.code),details:e.details,hint:HT(e.code)}}}var r6=new Set(["RATE_LIMIT_EXCEEDED","SERVICE_UNAVAILABLE"]);function i6(t,e){return t>=500||t===429||t===503?!0:e?r6.has(e):!1}var o6=/^(mk_[^.\s]+\.[^\s]+|fsrt_(test|live)_[^\s]+|fsk_[A-Za-z0-9_-]{8,}|sk_(test|live)_[A-Za-z0-9_-]{8,}|eyJ[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+)$/,s6=/^(secret|clientSecret|privateKey|password|plaintext|connectorToken|tunnelToken|accessToken|refreshToken|tokenHash)$/i;function JT(t){return t.length<=8?"***redacted***":`${t.slice(0,4)}\u2026${t.slice(-4)}`}function Yd(t){if(typeof t=="string")return o6.test(t)?JT(t):t;if(Array.isArray(t))return t.map(e=>Yd(e));if(t&&typeof t=="object"){let e={};for(let[n,i]of Object.entries(t))s6.test(n)&&typeof i=="string"?e[n]=JT(i):e[n]=Yd(i);return e}return t}import{createInterface as f6}from"node:readline";import{readFile as h6}from"node:fs/promises";import{setTimeout as g6}from"node:timers/promises";import{extname as b6}from"node:path";var a6=a.string().regex(/^\/[A-Za-z0-9_/:.{}*-]*$/,"non-canonical route path"),c6=a.enum(["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"]),YT=a.object({method:c6,path:a6}),u6=YT.extend({pending:a.boolean().optional()}),_X=a.object({lockVersion:a.number().int().nonnegative(),surfaceHash:a.string().startsWith("sha256:"),backends:a.record(a.string(),a.object({routes:a.array(u6).max(500)}))}),yX=a.object({backendId:a.string().min(1),lockVersion:a.number().int().nonnegative(),reflectedSurfaceHash:a.string().startsWith("sha256:"),routes:a.array(YT).max(500)}),vX=a.object({backendId:a.string().min(1),lockVersion:a.number().int().nonnegative(),servedRouteIds:a.array(a.string().min(1)).max(500)});var Ae={idempotencyKey:a.string().optional().describe("A UUID you generate; REUSE the same value when retrying so the retry replays the first result instead of double-provisioning.")};function p6(){let t=process.env.FARTHERSHORE_BUSINESS?.trim();if(t)return{ref:t,source:"FARTHERSHORE_BUSINESS"};let e=$T(process.cwd());return e?{ref:e.businessId,source:`linked directory (${e.label??e.businessId})`}:null}function XT(t){let e=t?.trim().toLowerCase();return e?e.split(".")[0]??null:null}function m6(t,e){let n=e.trim().toLowerCase();return t.find(i=>i.id===e||i.name.toLowerCase()===n||i.runtimeHostname?.toLowerCase()===n||i.portalHostname?.toLowerCase()===n||XT(i.runtimeHostname)===n||XT(i.portalHostname)===n)}var no=50,QT=8;async function ry(t){let e=[];for(let n=0;n<QT;n++){let i=await t.listBusinesses({limit:no,offset:n*no});if(e.push(...i),i.length<no)return{businesses:e,complete:!0}}return{businesses:e,complete:!1}}async function eR(t,e){for(let n=0;n<QT;n++){let i=await t.listBusinesses({limit:no,offset:n*no}),r=m6(i,e);if(r)return{outcome:"matched",business:r};if(i.length<no)return n===0?{outcome:"absent"}:{outcome:"inconclusive"}}return{outcome:"inconclusive"}}async function ve(t,e){if(e){if(e.length===36)return e;let i=await eR(t,e);if(i.outcome==="matched")return i.business.id;throw i.outcome==="inconclusive"?new P(`Could not conclusively resolve "${e}" \u2014 the business list could not be checked to the end. Pass the 36-character business id directly, or retry.`,0,{code:"BUSINESS_RESOLUTION_INCONCLUSIVE"}):new P(`Business "${e}" not found`,404,{code:"NOT_FOUND"})}let n=p6();if(n)return ve(t,n.ref);throw new P("No business selected. Pass one as an argument, run `farthershore link <business>` to target this directory at a business, or set FARTHERSHORE_BUSINESS.",0,{code:"NO_BUSINESS_SELECTED"})}function tR(t){let e={};return typeof t.bump=="string"&&(e.bump=t.bump),typeof t.version=="string"&&(e.version=t.version),t.acceptBreaking===!0&&(e.acceptBreaking=!0),e}async function _6(t){let e=f6({input:process.stdin,output:process.stderr,terminal:!0});return new Promise(n=>{e.question(`Cut release ${t}? [y/N] `,i=>{e.close(),n(/^y(es)?$/i.test(i.trim()))})})}function y6(t){return t.split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function v6(t){let[e="",n,i]=t.split(":");if(!/^[a-z0-9_]+$/.test(e))throw new P(`Invalid meter key in "--meter ${t}" \u2014 keys are lowercase letters, digits, and underscores (e.g. input_tokens).`,void 0,{code:"INVALID_METER_SPEC"});return{key:e,display:n?.trim()||y6(e),unit:i?.trim()||void 0}}function k6(t){let e=t.meter??[];if(e.length>0&&t.meters)throw new P("Pass either --meters <template> or repeated --meter entries, not both.",void 0,{code:"CONFLICTING_METER_FLAGS"});if(e.length>0){let n=e.map(v6);if(new Set(n.map(r=>r.key)).size!==n.length)throw new P("Duplicate meter keys in --meter flags.",void 0,{code:"INVALID_METER_SPEC"});return n}if(t.meters){let n=Bw(t.meters);if(!n)throw new P(`Unknown meter template "${t.meters}". Available: ${Fw().join(", ")}.`,void 0,{code:"UNKNOWN_METER_TEMPLATE"});return n.meters.map(i=>({...i}))}}var pn="<businessIdOrName>",S6={BRANCH_PREFIX:"branch-prefix",PULL_REQUEST:"pull-request",DISABLED:"disabled"},x6=Object.fromEntries(f_.map(t=>[S6[t],t])),I6=/^.{1,50}$/,$6={".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".webp":"image/webp"};function w6(t){let e=new Map;for(let n of Object.values(t??{}))for(let i of n?.routes??[]){if(typeof i.method!="string"||typeof i.path!="string")continue;let r=yr({actionId:i.actionId,method:i.method,path:i.path}),o=e.get(r)??new Set;o.add(Gw(r,i.method)),e.set(r,o)}return[...e.entries()].map(([n,i])=>({subject:n,title:n,permissions:[...i].sort()})).sort((n,i)=>n.subject.localeCompare(i.subject))}function E6(t){return{enabled:t===!0}}function T6(t){let{business:e,...n}=t;return{...n,business:e}}function R6(t){let e=$6[b6(t).toLowerCase()];if(!e)throw new P(`Cannot infer image Content-Type for "${t}". Use a .png, .jpg, .jpeg, or .webp file.`,void 0,{code:"UNSUPPORTED_BRAND_ASSET_TYPE"});return e}function O6(t){return t.filter(e=>e!==void 0&&e!==!1).length}function nR(t,e){let n=e==="icon"?"icon":"logo",i=e==="icon"?"icon":"logo",r=e==="icon"?"clearIcon":"clearLogo";if(O6([t[`${i}Url`],t[`${i}File`],t[r]])>1)throw new P(`Choose only one ${n} operation: --${i}-url, --${i}-file, or --clear-${i}.`,void 0,{code:"CONFLICTING_BRAND_ASSET_FLAGS"})}function P6(t){let e=x6[t];if(!e)throw new P(`Invalid preview environment trigger "${t}". Use branch-prefix, pull-request, or disabled.`,void 0,{code:"INVALID_PREVIEW_ENV_TRIGGER"});return e}function A6(t){let e={};if(typeof t.trigger=="string"&&(e.previewEnvTrigger=P6(t.trigger)),t.clearBranchPrefix===!0)e.envBranchPrefix=null;else if(typeof t.branchPrefix=="string"){if(!I6.test(t.branchPrefix))throw new P("--branch-prefix must be 1-50 characters.",void 0,{code:"INVALID_ENV_BRANCH_PREFIX"});e.envBranchPrefix=t.branchPrefix}if(e.previewEnvTrigger===void 0&&e.envBranchPrefix===void 0)throw new P("Pass at least one preview environment setting: --trigger, --branch-prefix, or --clear-branch-prefix.",void 0,{code:"MISSING_PREVIEW_ENV_UPDATE"});return e}async function rR(t,e,n,i){let r=await h6(i);return t.uploadBrandAsset(e,n,r,R6(i))}async function N6(t,e){return(await t.listBusinesses()).find(i=>i.name===e)??null}async function C6(t){let{client:e,body:n,reqOpts:i}=t,r=5,o=[2e3,4e3,8e3,8e3];for(let s=1;s<=r;s+=1)try{return{result:await e.initBusiness(n,{...i,retryOnTransient:!1}),recoveredFromTimeout:!1}}catch(c){if(!(c instanceof P&&c.code==="IDEMPOTENCY_KEY_IN_FLIGHT")){let d=await N6(e,n.name).catch(()=>null);if(d)return{result:{business:d,repo:null,agent:{instructions:"",agentsMdUrl:null}},recoveredFromTimeout:!0}}if(c instanceof P&&c.status===409&&c.code==="IDEMPOTENCY_KEY_IN_FLIGHT"&&s<r){await g6(o[Math.min(s-1,o.length-1)]);continue}throw c}throw new P("Timed out waiting for the idempotent business create request to finish.",409,{code:"IDEMPOTENCY_KEY_IN_FLIGHT"})}var iR=[{opKey:"business.list",operationClass:"operate",scope:["businesses:read"],sideEffect:"read",cli:{group:"business",command:"list",summary:"List businesses in the current org",args:[],handler:async({client:t,emit:e})=>{let{businesses:n,complete:i}=await ry(t);e({count:n.length,...i?{}:{truncated:!0},businesses:n.map(r=>({...r,displayName:r.displayName??null,status:r.status??null}))},`${n.length} business(es)${i?"":" (truncated)"}`)}},mcp:{tool:"fs_business_list",title:"List businesses",description:"List every business in the authenticated FartherShore workspace (id, name, status). Read-only; use this to discover business ids for the other tools.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{},handler:async t=>{let{businesses:e,complete:n}=await ry(t);return{count:e.length,...n?{}:{truncated:!0},businesses:e.map(i=>({id:i.id,name:i.name,status:i.status??null}))}}}},{opKey:"business.read",operationClass:"dual",scope:["businesses:read"],sideEffect:"read",cli:{group:"business",command:"show",summary:"Show a business",args:[{field:"businessId",kind:"positional",token:pn,resolveBusiness:!0},{field:"env",kind:"flag",token:"--env <env>",describe:"Environment scope (preview branch name)"}],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=await t.getBusiness(i,{env:e.env});n({business:r},`Business ${i}`)}},mcp:null},{opKey:"business.status",operationClass:"operate",scope:["businesses:read"],sideEffect:"read",cli:{group:"business",command:"status",summary:"Show a business's lifecycle/release/live state (status, latest release version, latest deployment, and a derived `live` boolean) \u2014 verify a business is serving after publish.",args:[{field:"businessId",kind:"positional",token:pn,resolveBusiness:!0}],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=await t.getDeployments(i),o=r.data[0]??null,s={id:r.business.id,status:r.business.status,latestReleaseVersion:r.business.latestReleaseVersion,live:r.live,latestDeployment:o?{id:o.id,status:o.status,edgePublishStatus:o.edgePublishStatus,createdAt:o.createdAt}:null};n(s,`Business ${i}: ${r.business.status}${r.business.latestReleaseVersion?` @ ${r.business.latestReleaseVersion}`:""} (${r.live?"live":"not live"})`)}},mcp:{tool:"fs_business_status",title:"Business status",description:"Verify a business's lifecycle/release state by id or slug: its status (DRAFT|ACTIVE), latest release version, latest deployment run, and a derived `live` boolean (ACTIVE + a real non-bootstrap release applied + the edge serving the snapshot). Read-only; use this to confirm a business is live after publishing.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe("The business id or slug to check.")},handler:async(t,e)=>{let n=await ve(t,e.businessId),i=await t.getDeployments(n),r=i.data[0]??null;return{id:i.business.id,status:i.business.status,latestReleaseVersion:i.business.latestReleaseVersion,live:i.live,latestDeployment:r?{id:r.id,status:r.status,edgePublishStatus:r.edgePublishStatus,createdAt:r.createdAt}:null}}}},{opKey:"rbac.read",operationClass:"contract",scope:["businesses:read"],sideEffect:"read",cli:{group:"business",command:"rbac",summary:"Show a business's Managed-RBAC contract state: the accepted spec's `rbac` flag and the derived grantable-permission catalog.",args:[{field:"businessId",kind:"positional",token:pn,resolveBusiness:!0},{field:"env",kind:"flag",token:"--env <env>",describe:"Environment scope (preview branch name)"}],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=await t.getBusinessConfig(i,{state:"accepted",env:e.env}),o=r.config??{},s=E6(o.business?.rbac),c=w6(o.routeCatalog);n({businessId:i,environment:r.environment??null,rbac:s,catalog:c},`Managed RBAC ${s.enabled?"enabled":"not enabled"} \u2014 ${c.length} catalog group(s)`)}},mcp:null},{opKey:"business.create",operationClass:"dual",scope:["businesses:create"],sideEffect:"write",cli:{group:"business",command:"create",summary:"Create a new business and provision the frontend starter repo",idempotent:!0,args:[{field:"name",kind:"flag",token:"--name <name>",describe:"Business slug (becomes the subdomain)",required:!0},{field:"displayName",kind:"flag",token:"--display-name <displayName>",describe:"Human-friendly business name"},{field:"description",kind:"flag",token:"--description <description>"},{field:"origin",kind:"flag",token:"--origin <url>",describe:"Optional business origin Farther Shore calls for customer-facing actions"},{field:"meters",kind:"flag",token:"--meters <template>",describe:`Meter template: ${Md.map(t=>`${t.id} (${t.label})`).join(", ")}. Default: requests.`},{field:"meter",kind:"flag",token:"--meter <key[:display[:unit]]>",describe:"Custom meter, repeatable (e.g. --meter input_tokens:'Input Tokens':token). Overrides --meters.",parser:(t,e)=>[...e,t],defaultValue:[]},{field:"docs",kind:"flag",token:"--docs",describe:"Enable docs for this business (default when omitted)."},{field:"docs",kind:"flag",token:"--no-docs",describe:"Opt out of docs for this business."}],handler:async({client:t,args:e,reqOpts:n,emit:i,emitDryRunPreview:r})=>{let o=k6({meters:e.meters,meter:e.meter}),s=e.docs===!0?!0:e.docs===!1?!1:void 0,c={name:e.name,...typeof e.origin=="string"?{origin:e.origin}:{},description:e.description,displayName:e.displayName,meters:o,...s!==void 0?{docsEnabled:s}:{}},{result:u,recoveredFromTimeout:d}=await C6({client:t,body:c,reqOpts:n});r(u)||i({result:T6(u),...d?{recoveredFromTimeout:!0}:{}},`Business created: ${e.name}`)}},mcp:null},{opKey:"business.origin.update",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:"business",command:"update",summary:"Update business presentation metadata and per-env origin",args:[{field:"businessId",kind:"positional",token:pn,resolveBusiness:!0},{field:"displayName",kind:"flag",token:"--display-name <displayName>"},{field:"description",kind:"flag",token:"--description <description>"},{field:"iconUrl",kind:"flag",token:"--icon-url <url>",describe:"Set the square icon/favicon URL"},{field:"iconFile",kind:"flag",token:"--icon-file <path>",describe:"Upload a local PNG, JPEG, or WEBP square icon"},{field:"clearIcon",kind:"flag",token:"--clear-icon",describe:"Remove the current icon asset"},{field:"logoUrl",kind:"flag",token:"--logo-url <url>",describe:"Set the wordmark/logo URL"},{field:"logoFile",kind:"flag",token:"--logo-file <path>",describe:"Upload a local PNG, JPEG, or WEBP wordmark/logo"},{field:"clearLogo",kind:"flag",token:"--clear-logo",describe:"Remove the current logo asset"},{field:"keyPrefix",kind:"flag",token:"--key-prefix <prefix>",describe:"White-label prefix for subscriber API keys (fsk_ \u2192 e.g. acme_). 2-12 lowercase letters/digits; fs/fsk/fsc/fsm reserved."},{field:"clearKeyPrefix",kind:"flag",token:"--clear-key-prefix",describe:"Reset the subscriber API key prefix to the default (fsk)."},{field:"docsHistory",kind:"flag",token:"--docs-history",describe:"Expose EVERY historical docs release to subscribers, not just the latest. Off by default \u2014 every release is still published and retained either way, so this only changes what the docs site SHOWS. Use --no-docs-history to go back to latest-only."},{field:"origin",kind:"flag",token:"--origin <url>",describe:"Set the business upstream origin (the URL the gateway proxies to). With --env, sets that environment's override."},{field:"sandboxOrigin",kind:"flag",token:"--sandbox-origin <url>",describe:"Set the sandbox upstream origin. With --env, env-scoped."},{field:"allowedOrigins",kind:"flag",token:"--allowed-origins <origins>",describe:"Comma-separated browser origins allowed to call the gateway cross-origin (custom frontend domains), e.g. https://app.example.com. The tenant's own portal origin is always allowed."},{field:"clearAllowedOrigins",kind:"flag",token:"--clear-allowed-origins",describe:"Remove all custom allowed origins."},{field:"env",kind:"flag",token:"--env <env>",describe:"Environment scope"}],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId;nR(e,"icon"),nR(e,"logo");let r={};e.docsHistory===!0&&(r.docsHistoryEnabled=!0),e.docsHistory===!1&&(r.docsHistoryEnabled=!1),e.displayName!==void 0&&(r.displayName=e.displayName),e.description!==void 0&&(r.description=e.description),e.iconUrl!==void 0&&(r.iconUrl=e.iconUrl),e.logoUrl!==void 0&&(r.logoUrl=e.logoUrl),e.clearKeyPrefix===!0?r.keyPrefix=null:e.keyPrefix!==void 0&&(r.keyPrefix=e.keyPrefix),e.origin!==void 0&&(r.origin=e.origin),e.sandboxOrigin!==void 0&&(r.sandboxOrigin=e.sandboxOrigin),e.clearAllowedOrigins===!0?r.allowedOrigins=[]:typeof e.allowedOrigins=="string"&&(r.allowedOrigins=e.allowedOrigins.split(",").map(u=>u.trim()).filter(Boolean));let o=[];if(typeof e.iconFile=="string"&&o.push(()=>rR(t,i,"icon",e.iconFile)),typeof e.logoFile=="string"&&o.push(()=>rR(t,i,"logo",e.logoFile)),e.clearIcon===!0&&o.push(()=>t.deleteBrandAsset(i,"icon")),e.clearLogo===!0&&o.push(()=>t.deleteBrandAsset(i,"logo")),Object.keys(r).length===0&&o.length===0)throw new P("No fields to update. Pass presentation metadata flags such as --display-name, --description, --origin, --icon-file, --logo-file, --docs-history, or a clear flag.",void 0,{code:"BUSINESS_UPDATE_NO_FIELDS"});let s=Object.keys(r).length>0?await t.updateBusiness(i,r,{env:e.env}):await t.getBusiness(i,{env:e.env}),c=await Promise.all(o.map(u=>u()));n({business:s,assets:c},`Business ${i} updated`)}},mcp:{tool:"fs_brand_update",title:"Update business brand",description:"Update a business's brand/presentation and upstream origin \u2014 display name, description, icon, logo (wordmark), origin (the URL the gateway proxies to), sandboxOrigin. Pass env to write an environment-scoped origin override instead of the business default. Plans, pricing, and routes are managed as code in the business repo and are NOT editable here. Only the fields you pass are changed.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1},inputSchema:{businessId:a.string().describe("The business id or slug to update."),displayName:a.string().optional().describe("Display name."),description:a.string().optional().describe("Short business description."),iconUrl:a.string().nullable().optional().describe("Square icon/favicon URL, or null to clear it."),logoUrl:a.string().nullable().optional().describe("Wordmark/logo URL, or null to clear it."),keyPrefix:a.string().nullable().optional().describe("White-label prefix for subscriber API keys (fsk_ \u2192 e.g. acme_). 2-12 lowercase letters/digits; fs/fsk/fsc/fsm reserved. Null clears to the default fsk."),origin:a.string().optional().describe("Business upstream origin (the URL the gateway proxies to)."),sandboxOrigin:a.string().optional().describe("Sandbox upstream origin."),env:a.string().optional().describe("Environment scope \u2014 when set, the origin override is written to that environment instead of the business default.")},handler:async(t,e)=>{let n=await ve(t,e.businessId),i={};return e.displayName!==void 0&&(i.displayName=e.displayName),e.description!==void 0&&(i.description=e.description),e.iconUrl!==void 0&&(i.iconUrl=e.iconUrl),e.logoUrl!==void 0&&(i.logoUrl=e.logoUrl),e.keyPrefix!==void 0&&(i.keyPrefix=e.keyPrefix),e.origin!==void 0&&(i.origin=e.origin),e.sandboxOrigin!==void 0&&(i.sandboxOrigin=e.sandboxOrigin),e.clearAllowedOrigins===!0?i.allowedOrigins=[]:typeof e.allowedOrigins=="string"&&(i.allowedOrigins=e.allowedOrigins.split(",").map(r=>r.trim()).filter(Boolean)),t.updateBusiness(n,i,{env:e.env})}}},{opKey:"business.publish",operationClass:"dual",scope:["businesses:publish"],sideEffect:"write",cli:{group:"business",command:"publish",summary:"Publish a draft business (make it live) and cut a versioned release with an auto-computed semver. Requires at least one plan, an origin, and a verified Stripe connection.",idempotent:!0,args:[{field:"businessId",kind:"positional",token:pn,resolveBusiness:!0},{field:"bump",kind:"flag",token:"--bump <bump>",describe:"Force the semver bump (major|minor|patch). Omit to auto-derive from the change."},{field:"version",kind:"flag",token:"--version <version>",describe:"Pin the exact next release tag (vX.Y.Z), skipping derivation."},{field:"acceptBreaking",kind:"flag",token:"--accept-breaking",describe:"Consent to publish a breaking (blocking-risk) change as a major release."}],helpTextAfter:`
|
|
84
|
+
`,r)}while(i!==-1);return o+=t.slice(r),o}var{stdout:sR,stderr:aR}=rR,h_=Symbol("GENERATOR"),so=Symbol("STYLER"),wa=Symbol("IS_EMPTY"),cR=["ansi","ansi","ansi256","ansi16m"],ao=Object.create(null),$6=(t,e={})=>{if(e.level&&!(Number.isInteger(e.level)&&e.level>=0&&e.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let n=sR?sR.level:0;t.level=e.level===void 0?n:e.level};var w6=t=>{let e=(...n)=>n.join(" ");return $6(e,t),Object.setPrototypeOf(e,Ea.prototype),e};function Ea(t){return w6(t)}Object.setPrototypeOf(Ea.prototype,Function.prototype);for(let[t,e]of Object.entries(Zt))ao[t]={get(){let n=ip(this,y_(e.open,e.close,this[so]),this[wa]);return Object.defineProperty(this,t,{value:n}),n}};ao.visible={get(){let t=ip(this,this[so],!0);return Object.defineProperty(this,"visible",{value:t}),t}};var b_=(t,e,n,...i)=>t==="rgb"?e==="ansi16m"?Zt[n].ansi16m(...i):e==="ansi256"?Zt[n].ansi256(Zt.rgbToAnsi256(...i)):Zt[n].ansi(Zt.rgbToAnsi(...i)):t==="hex"?b_("rgb",e,n,...Zt.hexToRgb(...i)):Zt[n][t](...i),E6=["rgb","hex","ansi256"];for(let t of E6){ao[t]={get(){let{level:n}=this;return function(...i){let r=y_(b_(t,cR[n],"color",...i),Zt.color.close,this[so]);return ip(this,r,this[wa])}}};let e="bg"+t[0].toUpperCase()+t.slice(1);ao[e]={get(){let{level:n}=this;return function(...i){let r=y_(b_(t,cR[n],"bgColor",...i),Zt.bgColor.close,this[so]);return ip(this,r,this[wa])}}}}var T6=Object.defineProperties(()=>{},{...ao,level:{enumerable:!0,get(){return this[h_].level},set(t){this[h_].level=t}}}),y_=(t,e,n)=>{let i,r;return n===void 0?(i=t,r=e):(i=n.openAll+t,r=e+n.closeAll),{open:t,close:e,openAll:i,closeAll:r,parent:n}},ip=(t,e,n)=>{let i=(...r)=>R6(i,r.length===1?""+r[0]:r.join(" "));return Object.setPrototypeOf(i,T6),i[h_]=t,i[so]=e,i[wa]=n,i},R6=(t,e)=>{if(t.level<=0||!e)return t[wa]?"":e;let n=t[so];if(n===void 0)return e;let{openAll:i,closeAll:r}=n;if(e.includes("\x1B"))for(;n!==void 0;)e=iR(e,n.close,n.open),n=n.parent;let o=e.indexOf(`
|
|
85
|
+
`);return o!==-1&&(e=oR(e,r,i,o)),i+e+r};Object.defineProperties(Ea.prototype,ao);var O6=Ea(),e7=Ea({level:aR?aR.level:0});var __=O6;var P6;function op(){return P6??A6(void 0)}function v_(){return op()==="json"}function uR(t){v_()||process.stdout.write(`${t}
|
|
86
|
+
`)}function lR(t){v_()||console.log(__.dim(t))}function dR(t){v_()||console.log(__.bold(t))}function k_(){return process.stdout.isTTY===!0}function A6(t){if(t==="json"||t==="table")return t;if(t!==void 0)throw new A(`Unsupported --format "${t}". Use "json" or "table".`,400,{code:"INVALID_OUTPUT_FORMAT",param:"format"});return k_()?"table":"json"}var N6={MANAGED_BY_CODE:"This business's contract is managed as code. Edit the Business SDK program in its GitHub repo (business/) and push \u2014 do NOT retry the API. (Branding stays editable via `farthershore business update`.)",UNAUTHORIZED:"Token is invalid or revoked. Run `farthershore auth login` to update it.",FORBIDDEN:"Your token doesn't have access to this resource. Check the org / business scope.",INVALID_ACCESS_KEY:"Token format is wrong. Generate a new one at https://farthershore.com/settings/tokens.",MAKER_TOKEN_REVOKED:"This maker token was revoked. Mint a new one in the business settings.",MAKER_TOKEN_NO_BUSINESS:"Maker token is not bound to a business. Re-create it from the business page.",AUTH_NO_TOKEN:"Pass --token <mk_...> or set FARTHERSHORE_TOKEN, or run interactively in a TTY.",AUTH_INVALID_TOKEN:"Token format is malformed. Maker tokens start with `mk_` and are 30+ characters.",DESTRUCTIVE_OP_REQUIRES_YES:"Destructive ops (delete) require an explicit `--yes` to proceed. This is intentional safety.",BUSINESS_UPDATE_NO_FIELDS:"Pass at least one field flag (--display-name, --origin, --description).",PLAN_UPDATE_NO_FIELDS:"Pass at least one of --name, --recurring-fee-cents, --grant, --trial-days, --max-monthly-spend-cents, or --meter.",ENV_NOT_FOUND:"Environment doesn't exist. Use `farthershore env list <business>` to see available envs, or create one with `farthershore env create`.",STRIPE_NOT_CONFIGURED:"Stripe isn't connected on this business. Connect it in the dashboard before running billing operations.",STRIPE_NOT_CONNECTED:"Publishing requires a connected Stripe account. Connect one on the dashboard Connections page, then re-run `farthershore business publish`.",STRIPE_NOT_VERIFIED:"Your Stripe account isn't fully verified yet. Finish Stripe onboarding, then re-run `farthershore business publish`.",BILLING_TAX_NOT_ENROLLED:"Stripe Tax isn't enrolled for this account. Enable it from the dashboard Connections page, then re-run `farthershore business publish`.",STRIPE_BALANCE_OUTSTANDING:"Customer has an outstanding balance. Resolve the invoice in Stripe before retrying.",CHECKOUT_SESSION_FAILED:"Stripe rejected the checkout request. Check that the plan exists and Stripe credentials are valid.",BUSINESS_NOT_FOUND:"Check the business slug. Run `farthershore` (no args) for a list of businesses you can see.",BUSINESS_REPO_NOT_LINKED:"Link a GitHub repo to this business before publishing or validating business manifests.",YAML_PARSE_ERROR:"Business manifest is not valid. Run `farthershore build` locally, fix business/ source, then push again for bot validation.",GITHUB_NOT_CONNECTED:"Connect GitHub on the org page before running `farthershore business create <slug>` (it provisions the managed repo).",BRANCH_NO_MATCHING_ENV:"The current branch isn't mapped to an environment. Add a branch rule in business settings or pass --branch explicitly.",PLAN_NOT_FOUND:"Plan key doesn't exist on this business. Check the `plans` block in your local business manifest.",PLAN_HAS_ACTIVE_SUBSCRIPTIONS:"Plan has active subscribers and can't be deleted. Migrate them to another plan first.",PLAN_SLUG_CONFLICT:"Another plan already uses this key. Pick a unique plan key in your manifest.",SLUG_CONFLICT:"This business slug is taken. Pick a different name.",SLUG_BLOCKED:"This slug is reserved or blocked. Pick a different name.",SLUG_RESERVED:"This slug is reserved by Farther Shore. Pick a different name.",SLUG_INVALID_FORMAT:"Slug must be lowercase letters, digits, and hyphens (no leading/trailing hyphen).",DECISION_NOT_FOUND:"No DenialEvent recorded for that decisionId. Verify the id from the original deny response or audit log.",AUTH_UNAUTHORIZED:"Token is missing, expired, or lacks the audit:read scope required to read denial events.",RATE_LIMIT_EXCEEDED:"You've hit the rate limit. Wait a moment and retry.",VALIDATION_ERROR:"Request is malformed. The `details` field has the field-level errors.",CONFLICT:"The resource is in a state that conflicts with the request. Inspect `details` to learn more."};function pR(t){if(t)return N6[t]}function fR(t,e){return{schema_version:1,ok:!0,op:t,data:e}}function gR(t,e){let n=e.status??0;return{schema_version:1,ok:!1,op:t,error:{code:e.code??"INTERNAL_ERROR",message:e.message,status:n,param:e.param,retryable:z6(n,e.code),details:e.details,hint:pR(e.code)}}}var C6=new Set(["RATE_LIMIT_EXCEEDED","SERVICE_UNAVAILABLE"]);function z6(t,e){return t>=500||t===429||t===503?!0:e?C6.has(e):!1}var D6=/^(mk_[^.\s]+\.[^\s]+|fsrt_(test|live)_[^\s]+|fsk_[A-Za-z0-9_-]{8,}|sk_(test|live)_[A-Za-z0-9_-]{8,}|eyJ[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+)$/,j6=/^(secret|clientSecret|privateKey|password|plaintext|connectorToken|tunnelToken|accessToken|refreshToken|tokenHash)$/i;function hR(t){return t.length<=8?"***redacted***":`${t.slice(0,4)}\u2026${t.slice(-4)}`}function sp(t){if(typeof t=="string")return D6.test(t)?hR(t):t;if(Array.isArray(t))return t.map(e=>sp(e));if(t&&typeof t=="object"){let e={};for(let[n,i]of Object.entries(t))j6.test(n)&&typeof i=="string"?e[n]=hR(i):e[n]=sp(i);return e}return t}import{createInterface as q6}from"node:readline";import{readFile as H6}from"node:fs/promises";import{setTimeout as K6}from"node:timers/promises";import{extname as G6}from"node:path";var U6=a.string().regex(/^\/[A-Za-z0-9_/:.{}*-]*$/,"non-canonical route path"),M6=a.enum(["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"]),bR=a.object({method:M6,path:U6}),L6=bR.extend({pending:a.boolean().optional()}),f7=a.object({lockVersion:a.number().int().nonnegative(),surfaceHash:a.string().startsWith("sha256:"),backends:a.record(a.string(),a.object({routes:a.array(L6).max(500)}))}),g7=a.object({backendId:a.string().min(1),lockVersion:a.number().int().nonnegative(),reflectedSurfaceHash:a.string().startsWith("sha256:"),routes:a.array(bR).max(500)}),h7=a.object({backendId:a.string().min(1),lockVersion:a.number().int().nonnegative(),servedRouteIds:a.array(a.string().min(1)).max(500)});var Ae={idempotencyKey:a.string().optional().describe("A UUID you generate; REUSE the same value when retrying so the retry replays the first result instead of double-provisioning.")};function F6(){let t=process.env.FARTHERSHORE_BUSINESS?.trim();if(t)return{ref:t,source:"FARTHERSHORE_BUSINESS"};let e=HT(process.cwd());return e?{ref:e.businessId,source:`linked directory (${e.label??e.businessId})`}:null}function yR(t){let e=t?.trim().toLowerCase();return e?e.split(".")[0]??null:null}function V6(t,e){let n=e.trim().toLowerCase();return t.find(i=>i.id===e||i.name.toLowerCase()===n||i.runtimeHostname?.toLowerCase()===n||i.portalHostname?.toLowerCase()===n||yR(i.runtimeHostname)===n||yR(i.portalHostname)===n)}var co=50,_R=8;async function x_(t){let e=[];for(let n=0;n<_R;n++){let i=await t.listBusinesses({limit:co,offset:n*co});if(e.push(...i),i.length<co)return{businesses:e,complete:!0}}return{businesses:e,complete:!1}}async function vR(t,e){for(let n=0;n<_R;n++){let i=await t.listBusinesses({limit:co,offset:n*co}),r=V6(i,e);if(r)return{outcome:"matched",business:r};if(i.length<co)return n===0?{outcome:"absent"}:{outcome:"inconclusive"}}return{outcome:"inconclusive"}}async function ve(t,e){if(e){if(e.length===36)return e;let i=await vR(t,e);if(i.outcome==="matched")return i.business.id;throw i.outcome==="inconclusive"?new A(`Could not conclusively resolve "${e}" \u2014 the business list could not be checked to the end. Pass the 36-character business id directly, or retry.`,0,{code:"BUSINESS_RESOLUTION_INCONCLUSIVE"}):new A(`Business "${e}" not found`,404,{code:"NOT_FOUND"})}let n=F6();if(n)return ve(t,n.ref);throw new A("No business selected. Pass one as an argument, run `farthershore link <business>` to target this directory at a business, or set FARTHERSHORE_BUSINESS.",0,{code:"NO_BUSINESS_SELECTED"})}function kR(t){let e={};return typeof t.bump=="string"&&(e.bump=t.bump),typeof t.version=="string"&&(e.version=t.version),t.acceptBreaking===!0&&(e.acceptBreaking=!0),e}async function W6(t){let e=q6({input:process.stdin,output:process.stderr,terminal:!0});return new Promise(n=>{e.question(`Cut release ${t}? [y/N] `,i=>{e.close(),n(/^y(es)?$/i.test(i.trim()))})})}var fn="<businessIdOrName>",J6={BRANCH_PREFIX:"branch-prefix",PULL_REQUEST:"pull-request",DISABLED:"disabled"},Y6=Object.fromEntries(Py.map(t=>[J6[t],t])),X6=/^.{1,50}$/,Q6={".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".webp":"image/webp"};function eZ(t){let e=new Map;for(let n of Object.values(t??{}))for(let i of n?.routes??[]){if(typeof i.method!="string"||typeof i.path!="string")continue;let r=Er({actionId:i.actionId,method:i.method,path:i.path}),o=e.get(r)??new Set;o.add(fE(r,i.method)),e.set(r,o)}return[...e.entries()].map(([n,i])=>({subject:n,title:n,permissions:[...i].sort()})).sort((n,i)=>n.subject.localeCompare(i.subject))}function tZ(t){return{enabled:t===!0}}function nZ(t){let{business:e,...n}=t;return{...n,business:e}}function rZ(t){let e=Q6[G6(t).toLowerCase()];if(!e)throw new A(`Cannot infer image Content-Type for "${t}". Use a .png, .jpg, .jpeg, or .webp file.`,void 0,{code:"UNSUPPORTED_BRAND_ASSET_TYPE"});return e}function iZ(t){return t.filter(e=>e!==void 0&&e!==!1).length}function SR(t,e){let n=e==="icon"?"icon":"logo",i=e==="icon"?"icon":"logo",r=e==="icon"?"clearIcon":"clearLogo";if(iZ([t[`${i}Url`],t[`${i}File`],t[r]])>1)throw new A(`Choose only one ${n} operation: --${i}-url, --${i}-file, or --clear-${i}.`,void 0,{code:"CONFLICTING_BRAND_ASSET_FLAGS"})}function oZ(t){let e=Y6[t];if(!e)throw new A(`Invalid preview environment trigger "${t}". Use branch-prefix, pull-request, or disabled.`,void 0,{code:"INVALID_PREVIEW_ENV_TRIGGER"});return e}function sZ(t){let e={};if(typeof t.trigger=="string"&&(e.previewEnvTrigger=oZ(t.trigger)),t.clearBranchPrefix===!0)e.envBranchPrefix=null;else if(typeof t.branchPrefix=="string"){if(!X6.test(t.branchPrefix))throw new A("--branch-prefix must be 1-50 characters.",void 0,{code:"INVALID_ENV_BRANCH_PREFIX"});e.envBranchPrefix=t.branchPrefix}if(e.previewEnvTrigger===void 0&&e.envBranchPrefix===void 0)throw new A("Pass at least one preview environment setting: --trigger, --branch-prefix, or --clear-branch-prefix.",void 0,{code:"MISSING_PREVIEW_ENV_UPDATE"});return e}async function xR(t,e,n,i){let r=await H6(i);return t.uploadBrandAsset(e,n,r,rZ(i))}async function aZ(t,e){return(await t.listBusinesses()).find(i=>i.name===e)??null}async function cZ(t){let{client:e,body:n,reqOpts:i}=t,r=5,o=[2e3,4e3,8e3,8e3];for(let s=1;s<=r;s+=1)try{return{result:await e.createBusiness(n,{...i,retryOnTransient:!1}),recoveredFromTimeout:!1}}catch(c){let u=c instanceof A&&c.code==="IDEMPOTENCY_KEY_IN_FLIGHT",l=c instanceof oo||c instanceof A&&typeof c.status=="number"&&c.status>=500;if(!u&&l){let p=await aZ(e,n.name).catch(()=>null);if(p?.gitRepoFullName&&p.acceptedBusinessSpecGitSyncStatus==="SYNCED"){let d=`https://github.com/${p.gitRepoFullName}`;return{result:{business:p,repo:{fullName:p.gitRepoFullName,htmlUrl:d,cloneUrl:`${d}.git`},agent:{instructions:"Clone the repo, read AGENTS.md, author the business shape from actual product requirements, and push.",agentsMdUrl:`${d}/blob/main/AGENTS.md`}},recoveredFromTimeout:!0}}}if(c instanceof A&&c.status===409&&c.code==="IDEMPOTENCY_KEY_IN_FLIGHT"&&s<r){await K6(o[Math.min(s-1,o.length-1)]);continue}throw c}throw new A("Timed out waiting for the idempotent business create request to finish.",409,{code:"IDEMPOTENCY_KEY_IN_FLIGHT"})}var IR=[{opKey:"business.list",operationClass:"operate",scope:["businesses:read"],sideEffect:"read",cli:{group:"business",command:"list",summary:"List businesses in the current org",args:[],handler:async({client:t,emit:e})=>{let{businesses:n,complete:i}=await x_(t);e({count:n.length,...i?{}:{truncated:!0},businesses:n.map(r=>({...r,displayName:r.displayName??null,status:r.status??null}))},`${n.length} business(es)${i?"":" (truncated)"}`)}},mcp:{tool:"fs_business_list",title:"List businesses",description:"List every business in the authenticated FartherShore workspace (id, name, status). Read-only; use this to discover business ids for the other tools.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{},handler:async t=>{let{businesses:e,complete:n}=await x_(t);return{count:e.length,...n?{}:{truncated:!0},businesses:e.map(i=>({id:i.id,name:i.name,status:i.status??null}))}}}},{opKey:"business.read",operationClass:"operate",scope:["businesses:read"],sideEffect:"read",cli:{group:"business",command:"show",summary:"Show a business",args:[{field:"businessId",kind:"positional",token:fn,resolveBusiness:!0},{field:"env",kind:"flag",token:"--env <env>",describe:"Environment scope (preview branch name)"}],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=await t.getBusiness(i,{env:e.env});n({business:r},`Business ${i}`)}},mcp:null},{opKey:"business.status",operationClass:"operate",scope:["businesses:read"],sideEffect:"read",cli:{group:"business",command:"status",summary:"Show a business's lifecycle/release/live state (status, latest release version, latest deployment, and a derived `live` boolean) \u2014 verify a business is serving after publish.",args:[{field:"businessId",kind:"positional",token:fn,resolveBusiness:!0}],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=await t.getDeployments(i),o=r.data[0]??null,s={id:r.business.id,status:r.business.status,latestReleaseVersion:r.business.latestReleaseVersion,live:r.live,latestDeployment:o?{id:o.id,status:o.status,edgePublishStatus:o.edgePublishStatus,createdAt:o.createdAt}:null};n(s,`Business ${i}: ${r.business.status}${r.business.latestReleaseVersion?` @ ${r.business.latestReleaseVersion}`:""} (${r.live?"live":"not live"})`)}},mcp:{tool:"fs_business_status",title:"Business status",description:"Verify a business's lifecycle/release state by id or slug: its status (DRAFT|ACTIVE), latest release version, latest deployment run, and a derived `live` boolean (ACTIVE + a real non-bootstrap release applied + the edge serving the snapshot). Read-only; use this to confirm a business is live after publishing.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe("The business id or slug to check.")},handler:async(t,e)=>{let n=await ve(t,e.businessId),i=await t.getDeployments(n),r=i.data[0]??null;return{id:i.business.id,status:i.business.status,latestReleaseVersion:i.business.latestReleaseVersion,live:i.live,latestDeployment:r?{id:r.id,status:r.status,edgePublishStatus:r.edgePublishStatus,createdAt:r.createdAt}:null}}}},{opKey:"rbac.read",operationClass:"contract",scope:["businesses:read"],sideEffect:"read",cli:{group:"business",command:"rbac",summary:"Show a business's Managed-RBAC contract state: the accepted spec's `rbac` flag and the derived grantable-permission catalog.",args:[{field:"businessId",kind:"positional",token:fn,resolveBusiness:!0},{field:"env",kind:"flag",token:"--env <env>",describe:"Environment scope (preview branch name)"}],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=await t.getBusinessConfig(i,{env:e.env}),o=r.config??{},s=tZ(o.business?.rbac),c=eZ(o.routeCatalog);n({businessId:i,environment:r.environment??null,rbac:s,catalog:c},`Managed RBAC ${s.enabled?"enabled":"not enabled"} \u2014 ${c.length} catalog group(s)`)}},mcp:null},{opKey:"business.create",operationClass:"operate",scope:["businesses:create"],sideEffect:"write",cli:{group:"business",command:"create",summary:"Create a new business and provision its managed GitHub repo",idempotent:!0,args:[{field:"name",kind:"positional",token:"<slug>",describe:"Business slug (becomes the subdomain)"},{field:"displayName",kind:"flag",token:"--display-name <displayName>",describe:"Human-friendly business name"},{field:"description",kind:"flag",token:"--description <description>"},{field:"origin",kind:"flag",token:"--origin <url>",describe:"Optional business origin Farther Shore calls for customer-facing actions"},{field:"docs",kind:"flag",token:"--docs",describe:"Enable docs for this business (default when omitted)."},{field:"docs",kind:"flag",token:"--no-docs",describe:"Opt out of docs for this business."}],handler:async({client:t,args:e,reqOpts:n,emit:i,emitDryRunPreview:r})=>{let o=e.docs===!0?!0:e.docs===!1?!1:void 0,s={name:e.name,...typeof e.origin=="string"?{origin:e.origin}:{},description:e.description,displayName:e.displayName,...o!==void 0?{docsEnabled:o}:{}},{result:c,recoveredFromTimeout:u}=await cZ({client:t,body:s,reqOpts:n});if(r(c))return;let l=nZ(c);i({business:l.business,repoUrl:c.repo.htmlUrl,agent:l.agent,recoveredFromTimeout:u}),uR(c.repo.htmlUrl)}},mcp:null},{opKey:"business.origin.update",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:"business",command:"update",summary:"Update business presentation metadata and per-env origin",args:[{field:"businessId",kind:"positional",token:fn,resolveBusiness:!0},{field:"displayName",kind:"flag",token:"--display-name <displayName>"},{field:"description",kind:"flag",token:"--description <description>"},{field:"iconUrl",kind:"flag",token:"--icon-url <url>",describe:"Set the square icon/favicon URL"},{field:"iconFile",kind:"flag",token:"--icon-file <path>",describe:"Upload a local PNG, JPEG, or WEBP square icon"},{field:"clearIcon",kind:"flag",token:"--clear-icon",describe:"Remove the current icon asset"},{field:"logoUrl",kind:"flag",token:"--logo-url <url>",describe:"Set the wordmark/logo URL"},{field:"logoFile",kind:"flag",token:"--logo-file <path>",describe:"Upload a local PNG, JPEG, or WEBP wordmark/logo"},{field:"clearLogo",kind:"flag",token:"--clear-logo",describe:"Remove the current logo asset"},{field:"keyPrefix",kind:"flag",token:"--key-prefix <prefix>",describe:"White-label prefix for subscriber API keys (fsk_ \u2192 e.g. acme_). 2-12 lowercase letters/digits; fs/fsk/fsc/fsm reserved."},{field:"clearKeyPrefix",kind:"flag",token:"--clear-key-prefix",describe:"Reset the subscriber API key prefix to the default (fsk)."},{field:"docsHistory",kind:"flag",token:"--docs-history",describe:"Expose EVERY historical docs release to subscribers, not just the latest. Off by default \u2014 every release is still published and retained either way, so this only changes what the docs site SHOWS. Use --no-docs-history to go back to latest-only."},{field:"origin",kind:"flag",token:"--origin <url>",describe:"Set the business upstream origin (the URL the gateway proxies to). With --env, sets that environment's override."},{field:"sandboxOrigin",kind:"flag",token:"--sandbox-origin <url>",describe:"Set the sandbox upstream origin. With --env, env-scoped."},{field:"allowedOrigins",kind:"flag",token:"--allowed-origins <origins>",describe:"Comma-separated browser origins allowed to call the gateway cross-origin (custom frontend domains), e.g. https://app.example.com. The tenant's own portal origin is always allowed."},{field:"clearAllowedOrigins",kind:"flag",token:"--clear-allowed-origins",describe:"Remove all custom allowed origins."},{field:"env",kind:"flag",token:"--env <env>",describe:"Environment scope"}],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId;SR(e,"icon"),SR(e,"logo");let r={};e.docsHistory===!0&&(r.docsHistoryEnabled=!0),e.docsHistory===!1&&(r.docsHistoryEnabled=!1),e.displayName!==void 0&&(r.displayName=e.displayName),e.description!==void 0&&(r.description=e.description),e.iconUrl!==void 0&&(r.iconUrl=e.iconUrl),e.logoUrl!==void 0&&(r.logoUrl=e.logoUrl),e.clearKeyPrefix===!0?r.keyPrefix=null:e.keyPrefix!==void 0&&(r.keyPrefix=e.keyPrefix),e.origin!==void 0&&(r.origin=e.origin),e.sandboxOrigin!==void 0&&(r.sandboxOrigin=e.sandboxOrigin),e.clearAllowedOrigins===!0?r.allowedOrigins=[]:typeof e.allowedOrigins=="string"&&(r.allowedOrigins=e.allowedOrigins.split(",").map(u=>u.trim()).filter(Boolean));let o=[];if(typeof e.iconFile=="string"&&o.push(()=>xR(t,i,"icon",e.iconFile)),typeof e.logoFile=="string"&&o.push(()=>xR(t,i,"logo",e.logoFile)),e.clearIcon===!0&&o.push(()=>t.deleteBrandAsset(i,"icon")),e.clearLogo===!0&&o.push(()=>t.deleteBrandAsset(i,"logo")),Object.keys(r).length===0&&o.length===0)throw new A("No fields to update. Pass presentation metadata flags such as --display-name, --description, --origin, --icon-file, --logo-file, --docs-history, or a clear flag.",void 0,{code:"BUSINESS_UPDATE_NO_FIELDS"});let s=Object.keys(r).length>0?await t.updateBusiness(i,r,{env:e.env}):await t.getBusiness(i,{env:e.env}),c=await Promise.all(o.map(u=>u()));n({business:s,assets:c},`Business ${i} updated`)}},mcp:{tool:"fs_brand_update",title:"Update business brand",description:"Update a business's brand/presentation and upstream origin \u2014 display name, description, icon, logo (wordmark), origin (the URL the gateway proxies to), sandboxOrigin. Pass env to write an environment-scoped origin override instead of the business default. Plans, pricing, and routes are managed as code in the business repo and are NOT editable here. Only the fields you pass are changed.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1},inputSchema:{businessId:a.string().describe("The business id or slug to update."),displayName:a.string().optional().describe("Display name."),description:a.string().optional().describe("Short business description."),iconUrl:a.string().nullable().optional().describe("Square icon/favicon URL, or null to clear it."),logoUrl:a.string().nullable().optional().describe("Wordmark/logo URL, or null to clear it."),keyPrefix:a.string().nullable().optional().describe("White-label prefix for subscriber API keys (fsk_ \u2192 e.g. acme_). 2-12 lowercase letters/digits; fs/fsk/fsc/fsm reserved. Null clears to the default fsk."),origin:a.string().optional().describe("Business upstream origin (the URL the gateway proxies to)."),sandboxOrigin:a.string().optional().describe("Sandbox upstream origin."),env:a.string().optional().describe("Environment scope \u2014 when set, the origin override is written to that environment instead of the business default.")},handler:async(t,e)=>{let n=await ve(t,e.businessId),i={};return e.displayName!==void 0&&(i.displayName=e.displayName),e.description!==void 0&&(i.description=e.description),e.iconUrl!==void 0&&(i.iconUrl=e.iconUrl),e.logoUrl!==void 0&&(i.logoUrl=e.logoUrl),e.keyPrefix!==void 0&&(i.keyPrefix=e.keyPrefix),e.origin!==void 0&&(i.origin=e.origin),e.sandboxOrigin!==void 0&&(i.sandboxOrigin=e.sandboxOrigin),e.clearAllowedOrigins===!0?i.allowedOrigins=[]:typeof e.allowedOrigins=="string"&&(i.allowedOrigins=e.allowedOrigins.split(",").map(r=>r.trim()).filter(Boolean)),t.updateBusiness(n,i,{env:e.env})}}},{opKey:"business.publish",operationClass:"operate",scope:["businesses:publish"],sideEffect:"write",cli:{group:"business",command:"publish",summary:"Publish a draft business (make it live) and cut a versioned release with an auto-computed semver. Requires at least one plan, an origin, and a verified Stripe connection.",idempotent:!0,args:[{field:"businessId",kind:"positional",token:fn,resolveBusiness:!0},{field:"bump",kind:"flag",token:"--bump <bump>",describe:"Force the semver bump (major|minor|patch). Omit to auto-derive from the change."},{field:"version",kind:"flag",token:"--version <version>",describe:"Pin the exact next release tag (vX.Y.Z), skipping derivation."},{field:"acceptBreaking",kind:"flag",token:"--accept-breaking",describe:"Consent to publish a breaking (blocking-risk) change as a major release."}],helpTextAfter:`
|
|
86
87
|
Publish auto-derives the semver bump from the change and cuts a vX.Y.Z release.
|
|
87
88
|
Use --dry-run to preview the computed bump + reasons without cutting a tag.
|
|
88
|
-
A blocking-risk (breaking) change is refused unless --accept-breaking is passed.`,handler:async({client:t,args:e,opts:n,reqOpts:i,emit:r,emitDryRunPreview:o})=>{let s=e.businessId,c=tR(n);if(i.dryRun){let d=await t.publishBusiness(s,c,i);if(o(d))return}if(ty()&&n.input!==!1){let l=(await t.publishBusiness(s,c,{...i,dryRun:!0,idempotencyKey:void 0})).wouldHave?._release;if(l){VT(`Publishing ${s}: ${l.computedBump} \u2192 ${l.version}`+(l.previousVersion?` (from ${l.previousVersion})`:" (first release)"));for(let m of l.reasons)qT(` \u2022 ${m}`);if(!await _6(l.version)){r({cancelled:!0},"Publish cancelled.");return}}}let u=await t.publishBusiness(s,c,i);r({business:u,_release:u._release??null},`Business ${s} published`)}},mcp:{tool:"fs_business_publish",title:"Publish a business",description:"Publish a business \u2014 deploy its current spec live and cut a versioned release with an auto-computed semver. Equivalent to a repo-driven deploy (operationClass=dual); both reconcile to the same published state.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe("The business id to publish."),bump:a.enum(["major","minor","patch"]).optional().describe("Force the semver bump. Omit to auto-derive from the change."),version:a.string().optional().describe("Pin the exact next release tag (vX.Y.Z)."),acceptBreaking:a.boolean().optional().describe("Consent to publish a breaking (blocking-risk) change as major."),dryRun:a.boolean().optional().describe("Preview the change (computed semver + reasons) without cutting a release."),...Ae},handler:async(t,e)=>{let n=tR({bump:e.bump,version:e.version,acceptBreaking:e.acceptBreaking});return t.publishBusiness(e.businessId,n,{idempotencyKey:e.idempotencyKey,dryRun:e.dryRun})}}},{opKey:"business.delete",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:"business",command:"delete",summary:"Permanently delete a business. Requires --yes.",destructive:!0,yesMessage:"Pass --yes to confirm business deletion.",args:[{field:"businessId",kind:"positional",token:pn,resolveBusiness:!0},{field:"deleteGithubRepo",kind:"flag",token:"--delete-github-repo",describe:"Also delete the connected GitHub repository. Requires the same builder-session authorization as dashboard deletion."}],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId;try{await t.deleteBusiness(i,{deleteGitHubRepo:e.deleteGithubRepo===!0})}catch(r){throw r instanceof P&&(r.status===403||r.code==="FORBIDDEN")?new P("Deleting a whole business requires a builder/browser session \u2014 open the business in the dashboard to delete it. (Preview environments CAN be deleted via the CLI: `farthershore env delete`.)",r.status,{code:r.code??"FORBIDDEN"}):r}n({deleted:i},`Business ${i} deleted`)}},mcp:null},{opKey:"business.preview_env.set",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:"business preview-env",command:"set",summary:"Configure automatic preview-environment creation for a business.",args:[{field:"businessId",kind:"positional",token:pn,resolveBusiness:!0},{field:"trigger",kind:"flag",token:"--trigger <branch-prefix|pull-request|disabled>",describe:"Auto-create previews from env branch prefixes, pull requests, or disable automatic creation."},{field:"branchPrefix",kind:"flag",token:"--branch-prefix <prefix>",describe:"Set the env branch prefix used by --trigger branch-prefix (1-50 characters)."},{field:"clearBranchPrefix",kind:"flag",token:"--clear-branch-prefix",describe:"Reset the env branch prefix to the platform default (env/)."}],handler:async({client:t,args:e,emit:n})=>{if(e.branchPrefix!==void 0&&e.clearBranchPrefix===!0)throw new P("Pass either --branch-prefix or --clear-branch-prefix, not both.",void 0,{code:"CONFLICTING_BRANCH_PREFIX_FLAGS"});let i=e.businessId,r=A6(e),o=await t.updateBusiness(i,r,{});n({business:o},`Preview environment policy updated for ${i}`)}},mcp:{tool:"fs_business_preview_env_set",title:"Set business preview environment policy",description:"Configure automatic preview environment creation for a business. Modes: BRANCH_PREFIX creates previews from matching env branches, PULL_REQUEST creates previews for PRs against the default branch, and DISABLED stops automatic creation while explicit `farthershore env create` continues to work. Pass envBranchPrefix to customize the branch-prefix mode, or null to reset to env/.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1},inputSchema:{businessId:a.string().describe("The business id or slug to update."),previewEnvTrigger:a.enum(f_).optional().describe("Automatic preview mode: BRANCH_PREFIX, PULL_REQUEST, or DISABLED."),envBranchPrefix:a.string().min(1).max(50).nullable().optional().describe("Branch prefix for BRANCH_PREFIX mode, or null for env/.")},handler:async(t,e)=>{let n=await ve(t,e.businessId),i={};if(e.previewEnvTrigger!==void 0&&(i.previewEnvTrigger=e.previewEnvTrigger),e.envBranchPrefix!==void 0&&(i.envBranchPrefix=e.envBranchPrefix),i.previewEnvTrigger===void 0&&i.envBranchPrefix===void 0)throw new P("Pass previewEnvTrigger, envBranchPrefix, or both.",void 0,{code:"MISSING_PREVIEW_ENV_UPDATE"});return t.updateBusiness(n,i,{})}}},{opKey:"business.docs.enable",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:"business docs",command:"enable",summary:"Enable docs for a business (publish/serve docs scaffold).",args:[{field:"businessId",kind:"positional",token:pn,resolveBusiness:!0}],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=await t.updateBusiness(i,{docsEnabled:!0},{});n({business:r},`Docs enabled for ${i}`)}},mcp:{tool:"fs_business_docs_enable",title:"Enable business docs",description:"Enable docs for a business \u2014 opens the publish/sync gate so docs are served from R2 and `boot.docsEnabled=true` is emitted to the portal. Idempotent if docs are already enabled.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe("The business id or slug to enable docs on.")},handler:async(t,e)=>{let n=await ve(t,e.businessId);return t.updateBusiness(n,{docsEnabled:!0},{})}}},{opKey:"business.docs.disable",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:"business docs",command:"disable",summary:"Disable docs for a business (stop publishing/serving docs; scaffold kept in the repo).",args:[{field:"businessId",kind:"positional",token:pn,resolveBusiness:!0}],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=await t.updateBusiness(i,{docsEnabled:!1},{});n({business:r},`Docs disabled for ${i}`)}},mcp:{tool:"fs_business_docs_disable",title:"Disable business docs",description:"Disable docs for a business \u2014 closes the publish/sync gate so docs are no longer served and `boot.docsEnabled=false` is emitted to the portal. The docs scaffold stays in the repo; re-enabling is a pure flag flip. Idempotent if docs are already disabled.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe("The business id or slug to disable docs on.")},handler:async(t,e)=>{let n=await ve(t,e.businessId);return t.updateBusiness(n,{docsEnabled:!1},{})}}}];var z6={kind:"free",label:"Free",description:"No recurring fee and no metered usage. Pure freemium tier.",pricing:{meters:[],recurring_fee_cents:0,billing_interval:"month",grants:[],trial_days:0}},D6={kind:"starter",label:"Starter \u2014 $20/mo + $20 included",description:"$20/month subscription with $20 of usage credit each period. Stripe-style minimum-spend; overage billed at $0.001/request by default.",pricing:{meters:[{dimension:"requests",kind:"linear",price_per_unit_micros:1e3}],recurring_fee_cents:2e3,billing_interval:"month",grants:[{kind:"credit",amount_cents:2e3,recurs:!0}],trial_days:0}},j6={kind:"pro",label:"Pro \u2014 $100/mo + $200 included",description:"$100/month subscription with $200 of usage credit each period and a 14-day trial. Overage billed at $0.0005/request by default.",pricing:{meters:[{dimension:"requests",kind:"linear",price_per_unit_micros:500}],recurring_fee_cents:1e4,billing_interval:"month",grants:[{kind:"credit",amount_cents:2e4,recurs:!0}],trial_days:14}},U6={kind:"prepaid",label:"Prepaid \u2014 $50 sign-up credit, then PAYG",description:"$50 one-time credit at signup. Once depleted the subscriber pays-as-they-go at $0.001/request by default.",pricing:{meters:[{dimension:"requests",kind:"linear",price_per_unit_micros:1e3}],recurring_fee_cents:0,billing_interval:"month",grants:[{kind:"credit",amount_cents:5e3,recurs:!1}],trial_days:0}},M6={kind:"metered",label:"Metered (pay-as-you-go)",description:"No subscription fee. Pure usage billing at $0.001/request by default.",pricing:{meters:[{dimension:"requests",kind:"linear",price_per_unit_micros:1e3}],recurring_fee_cents:0,billing_interval:"month",grants:[],trial_days:0}},p7=Object.freeze({free:z6,starter:D6,pro:j6,prepaid:U6,metered:M6});var E7=a.object({recurring_fee_cents:a.number().int().nonnegative().optional(),grants:a.array(Fn).max(40).optional(),creditPolicy:qn.optional(),min_monthly_spend_cents:a.number().int().nonnegative().optional(),max_monthly_spend_cents:a.number().int().nonnegative().optional(),meters:a.array(Vn).optional(),notes:a.string().max(2e3).optional()});var Xd=["next_renewal","immediate","by_date","opt_in"];function L6(t){if(!t||typeof t!="object")return[];let e=t;return Array.isArray(e.data)?e.data:Array.isArray(e.plans)?e.plans:Array.isArray(t)?t:[]}function Z6(t){if(t.length===0)return"(no plans)";let e=["KEY","NAME","FREE","FEE\xA2","RECURRING\xA2","ONE_TIME\xA2","TRIAL_D","MAX_SPEND\xA2","STATUS"],n=c=>c===null?"\u2014":c.toLocaleString("en-US"),i=t.map(c=>[c.key,c.name,c.free?"Y":"N",n(c.recurring_fee_cents),n(c.recurring_grant_cents),n(c.one_time_grant_cents),n(c.trial_days),n(c.max_monthly_spend_cents),c.status]),r=e.map((c,u)=>Math.max(c.length,...i.map(d=>d[u]?.length??0))),o=c=>c.map((u,d)=>u.padEnd(r[d]??u.length)).join(" "),s=r.map(c=>"-".repeat(c)).join(" ");return[o(e),s,...i.map(o)].join(`
|
|
89
|
-
`)}var
|
|
89
|
+
A blocking-risk (breaking) change is refused unless --accept-breaking is passed.`,handler:async({client:t,args:e,opts:n,reqOpts:i,emit:r,emitDryRunPreview:o})=>{let s=e.businessId,c=kR(n);if(i.dryRun){let l=await t.publishBusiness(s,c,i);if(o(l))return}if(k_()&&n.input!==!1){let p=(await t.publishBusiness(s,c,{...i,dryRun:!0,idempotencyKey:void 0})).wouldHave?._release;if(p){dR(`Publishing ${s}: ${p.computedBump} \u2192 ${p.version}`+(p.previousVersion?` (from ${p.previousVersion})`:" (first release)"));for(let m of p.reasons)lR(` \u2022 ${m}`);if(!await W6(p.version)){r({cancelled:!0},"Publish cancelled.");return}}}let u=await t.publishBusiness(s,c,i);r({business:u,_release:u._release??null},`Business ${s} published`)}},mcp:{tool:"fs_business_publish",title:"Publish a business",description:"Publish a business \u2014 deploy its current spec live and cut a versioned release with an auto-computed semver.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe("The business id to publish."),bump:a.enum(["major","minor","patch"]).optional().describe("Force the semver bump. Omit to auto-derive from the change."),version:a.string().optional().describe("Pin the exact next release tag (vX.Y.Z)."),acceptBreaking:a.boolean().optional().describe("Consent to publish a breaking (blocking-risk) change as major."),dryRun:a.boolean().optional().describe("Preview the change (computed semver + reasons) without cutting a release."),...Ae},handler:async(t,e)=>{let n=kR({bump:e.bump,version:e.version,acceptBreaking:e.acceptBreaking});return t.publishBusiness(e.businessId,n,{idempotencyKey:e.idempotencyKey,dryRun:e.dryRun})}}},{opKey:"business.delete",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:"business",command:"delete",summary:"Permanently delete a business. Requires --yes.",destructive:!0,yesMessage:"Pass --yes to confirm business deletion.",args:[{field:"businessId",kind:"positional",token:fn,resolveBusiness:!0}],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId;await t.deleteBusiness(i),n({deleted:i},`Business ${i} deleted`)}},mcp:null},{opKey:"business.preview_env.set",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:"business preview-env",command:"set",summary:"Configure automatic preview-environment creation for a business.",args:[{field:"businessId",kind:"positional",token:fn,resolveBusiness:!0},{field:"trigger",kind:"flag",token:"--trigger <branch-prefix|pull-request|disabled>",describe:"Auto-create previews from env branch prefixes, pull requests, or disable automatic creation."},{field:"branchPrefix",kind:"flag",token:"--branch-prefix <prefix>",describe:"Set the env branch prefix used by --trigger branch-prefix (1-50 characters)."},{field:"clearBranchPrefix",kind:"flag",token:"--clear-branch-prefix",describe:"Reset the env branch prefix to the platform default (env/)."}],handler:async({client:t,args:e,emit:n})=>{if(e.branchPrefix!==void 0&&e.clearBranchPrefix===!0)throw new A("Pass either --branch-prefix or --clear-branch-prefix, not both.",void 0,{code:"CONFLICTING_BRANCH_PREFIX_FLAGS"});let i=e.businessId,r=sZ(e),o=await t.updateBusiness(i,r,{});n({business:o},`Preview environment policy updated for ${i}`)}},mcp:{tool:"fs_business_preview_env_set",title:"Set business preview environment policy",description:"Configure automatic preview environment creation for a business. Modes: BRANCH_PREFIX creates previews from matching env branches, PULL_REQUEST creates previews for PRs against the default branch, and DISABLED stops automatic creation while explicit `farthershore env create` continues to work. Pass envBranchPrefix to customize the branch-prefix mode, or null to reset to env/.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1},inputSchema:{businessId:a.string().describe("The business id or slug to update."),previewEnvTrigger:a.enum(Py).optional().describe("Automatic preview mode: BRANCH_PREFIX, PULL_REQUEST, or DISABLED."),envBranchPrefix:a.string().min(1).max(50).nullable().optional().describe("Branch prefix for BRANCH_PREFIX mode, or null for env/.")},handler:async(t,e)=>{let n=await ve(t,e.businessId),i={};if(e.previewEnvTrigger!==void 0&&(i.previewEnvTrigger=e.previewEnvTrigger),e.envBranchPrefix!==void 0&&(i.envBranchPrefix=e.envBranchPrefix),i.previewEnvTrigger===void 0&&i.envBranchPrefix===void 0)throw new A("Pass previewEnvTrigger, envBranchPrefix, or both.",void 0,{code:"MISSING_PREVIEW_ENV_UPDATE"});return t.updateBusiness(n,i,{})}}},{opKey:"business.docs.enable",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:"business docs",command:"enable",summary:"Enable docs for a business (publish/serve docs scaffold).",args:[{field:"businessId",kind:"positional",token:fn,resolveBusiness:!0}],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=await t.updateBusiness(i,{docsEnabled:!0},{});n({business:r},`Docs enabled for ${i}`)}},mcp:{tool:"fs_business_docs_enable",title:"Enable business docs",description:"Enable docs for a business \u2014 opens the publish/sync gate so docs are served from R2 and `boot.docsEnabled=true` is emitted to the portal. Idempotent if docs are already enabled.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe("The business id or slug to enable docs on.")},handler:async(t,e)=>{let n=await ve(t,e.businessId);return t.updateBusiness(n,{docsEnabled:!0},{})}}},{opKey:"business.docs.disable",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:"business docs",command:"disable",summary:"Disable docs for a business (stop publishing/serving docs; scaffold kept in the repo).",args:[{field:"businessId",kind:"positional",token:fn,resolveBusiness:!0}],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=await t.updateBusiness(i,{docsEnabled:!1},{});n({business:r},`Docs disabled for ${i}`)}},mcp:{tool:"fs_business_docs_disable",title:"Disable business docs",description:"Disable docs for a business \u2014 closes the publish/sync gate so docs are no longer served and `boot.docsEnabled=false` is emitted to the portal. The docs scaffold stays in the repo; re-enabling is a pure flag flip. Idempotent if docs are already disabled.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe("The business id or slug to disable docs on.")},handler:async(t,e)=>{let n=await ve(t,e.businessId);return t.updateBusiness(n,{docsEnabled:!1},{})}}}];var vQ=a.object({recurring_fee_cents:a.number().int().nonnegative().optional(),grants:a.array(Hn).max(40).optional(),creditPolicy:Kn.optional(),min_monthly_spend_cents:a.number().int().nonnegative().optional(),max_monthly_spend_cents:a.number().int().nonnegative().optional(),meters:a.array(Gn).optional(),notes:a.string().max(2e3).optional()});var ap=["next_renewal","immediate","by_date","opt_in"];function uZ(t){if(!t||typeof t!="object")return[];let e=t;return Array.isArray(e.data)?e.data:Array.isArray(e.plans)?e.plans:Array.isArray(t)?t:[]}function lZ(t){if(t.length===0)return"(no plans)";let e=["KEY","NAME","FREE","FEE\xA2","RECURRING\xA2","ONE_TIME\xA2","TRIAL_D","MAX_SPEND\xA2","STATUS"],n=c=>c===null?"\u2014":c.toLocaleString("en-US"),i=t.map(c=>[c.key,c.name,c.free?"Y":"N",n(c.recurring_fee_cents),n(c.recurring_grant_cents),n(c.one_time_grant_cents),n(c.trial_days),n(c.max_monthly_spend_cents),c.status]),r=e.map((c,u)=>Math.max(c.length,...i.map(l=>l[u]?.length??0))),o=c=>c.map((u,l)=>u.padEnd(r[l]??u.length)).join(" "),s=r.map(c=>"-".repeat(c)).join(" ");return[o(e),s,...i.map(o)].join(`
|
|
90
|
+
`)}var dZ=[{opKey:"plan.read",operationClass:"contract",scope:["businesses:read"],sideEffect:"read",cli:{group:"plan",command:"list",summary:"List plans for a business",args:[{field:"businessId",kind:"positional",token:"<businessIdOrName>",resolveBusiness:!0}],helpTextAfter:`
|
|
90
91
|
Output:
|
|
91
92
|
--format json \u2014 stable agent-friendly JSON envelope (default for non-TTY)
|
|
92
93
|
--format table \u2014 human-readable summary table (default for TTY)
|
|
93
|
-
`,handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,o=
|
|
94
|
+
`,handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,o=uZ(await t.managementListPlans(i)).map(s=>({id:s.id,key:s.planKey??s.key??"",name:s.name??"",version:s.version??null,free:s.free??!1,recurring_fee_cents:s.recurring_fee_cents??0,grants:s.grants??[],recurring_grant_cents:Ny({grants:s.grants}),one_time_grant_cents:Wd({grants:s.grants}),trial_days:s.trial_days??0,max_monthly_spend_cents:s.max_monthly_spend_cents??null,status:s.status??(s.isActive===!1?"INACTIVE":"ACTIVE")}));n({businessId:i,count:o.length,plans:o},`${o.length} plan(s) for business ${i}`),op()!=="json"&&console.log(lZ(o))}},mcp:{tool:"fs_plan_list",title:"List plans",description:"List a business's pricing plans (read-only). Plans are managed as code in the business's GitHub repo \u2014 to add/change/remove a plan, edit business/ and push; this tool only reads the current state. Pass the business id from fs_business_list.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe("The business id whose plans to list.")},handler:async(t,{businessId:e})=>t.managementListPlans(e)}},{opKey:"plan.migration_batch.create",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:"plan",command:"migrate",summary:"Migrate subscribers between plan versions under a policy (owner-only)",idempotent:!0,args:[{field:"businessId",kind:"positional",token:"<businessIdOrName>",resolveBusiness:!0},{field:"planKey",kind:"positional",token:"<planKey>"},{field:"from",kind:"flag",token:"--from <version>",describe:"Source plan version to migrate FROM: an integer (e.g. 1) or head/latest.",required:!0},{field:"to",kind:"flag",token:"--to <version>",describe:"Target plan version to migrate TO: an integer (e.g. 2) or head/latest.",required:!0},{field:"policy",kind:"flag",token:"--policy <policy>",describe:`Migration policy: ${ap.join(" | ")}.`,required:!0},{field:"proration",kind:"flag",token:"--proration <proration>",describe:"Optional proration: none | prorate | credit."},{field:"completeBy",kind:"flag",token:"--complete-by <iso8601>",describe:"Deadline (ISO 8601) \u2014 required by the by_date policy."}],helpTextAfter:`
|
|
94
95
|
Examples:
|
|
95
96
|
farthershore plan migrate my-business pro --from 1 --to head --policy next_renewal
|
|
96
97
|
farthershore plan migrate my-business pro --from 1 --to 2 --policy immediate --proration prorate
|
|
97
|
-
`,handler:async({client:t,args:e,reqOpts:n,emit:i,emitDryRunPreview:r})=>{let o=e.businessId,s=e.planKey,c=e.policy;if(!Xd.includes(c))throw new P(`Invalid --policy "${c}". Supported: ${Xd.join(", ")}.`,void 0,{code:"INVALID_MIGRATION_POLICY"});let u=await t.migratePlan(o,s,{fromVersion:e.from,toVersion:e.to,policy:c,proration:e.proration,completeBy:e.completeBy},n);r(u)||i({businessId:o,planKey:s,migration:u},`Migration scheduled for plan ${s}`)}},mcp:{tool:"fs_plan_migrate",title:"Migrate subscribers between plan versions",description:"Schedule a subscriber migration for a plan: move subscribers from one plan version to another under a policy. Pass the plan KEY plus fromVersion/toVersion (each an integer or 'head'/'latest') \u2014 the server resolves them to the right plan versions. Policies: next_renewal (migrate at each subscriber's renewal), immediate (migrate now), by_date (migrate everyone by a deadline), or opt_in (subscribers choose). This is an OPERATE action (it changes live subscriber state, not the business's code-managed definition).",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe("The business id whose subscribers to migrate."),planKey:a.string().describe("The stable plan key (e.g. 'pro') to migrate within."),fromVersion:a.union([a.string(),a.number().int().positive()]).describe("Source plan version: an integer or 'head'/'latest'."),toVersion:a.union([a.string(),a.number().int().positive()]).describe("Target plan version: an integer or 'head'/'latest'."),policy:a.enum(Xd).describe("Migration policy: next_renewal | immediate | by_date | opt_in."),proration:a.enum(["none","prorate","credit"]).optional().describe("Optional proration behaviour."),completeBy:a.string().optional().describe("ISO 8601 deadline \u2014 required by the by_date policy."),...Ae},handler:async(t,e)=>t.migratePlan(e.businessId,e.planKey,{fromVersion:e.fromVersion,toVersion:e.toVersion,policy:e.policy,proration:e.proration,completeBy:e.completeBy},{idempotencyKey:e.idempotencyKey})}}],oR=B6;function F6(t){if(!t||typeof t!="object")return[];let e=t;return Array.isArray(e.data)?e.data:Array.isArray(e.environments)?e.environments:[]}var sR=[{opKey:"environment.read",operationClass:"dual",scope:["businesses:read"],sideEffect:"read",cli:{group:"env",command:"list",summary:"List environments for a business",args:[{field:"businessId",kind:"positional",token:"<businessIdOrName>",resolveBusiness:!0}],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=F6(await t.listEnvironments(i));n({businessId:i,count:r.length,environments:r.map(o=>({id:o.id,name:o.name,branch:o.branch??null,portalHostname:o.portalHostname??null,runtimeHostname:o.runtimeHostname??null,status:o.status??null}))},`${r.length} environment(s)`)}},mcp:{tool:"fs_env_list",title:"List environments",description:"List a business's preview environments (name, branch, hostnames). Read-only.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe("The business id whose environments to list.")},handler:async(t,{businessId:e})=>t.listEnvironments(e)}},{opKey:"environment.create",operationClass:"dual",scope:["businesses:update"],sideEffect:"write",cli:{group:"env",command:"create",summary:"Create a preview environment bound to a git branch",idempotent:!0,args:[{field:"businessId",kind:"positional",token:"<businessIdOrName>",resolveBusiness:!0},{field:"name",kind:"flag",token:"--name <name>",describe:"Environment name (e.g. preview, staging)",required:!0},{field:"branch",kind:"flag",token:"--branch <branch>",describe:"Git branch to track (e.g. env/preview)",required:!0}],handler:async({client:t,args:e,reqOpts:n,emit:i,emitDryRunPreview:r})=>{let o=e.businessId,s=await t.createEnvironment(o,{name:e.name,branch:e.branch},n);r(s)||i({businessId:o,environment:s},`Environment ${e.name} created`)}},mcp:{tool:"fs_env_create",title:"Create preview environment",description:"Create a preview environment bound to a git branch. Equivalent to pushing the branch \u2014 both reconcile to the same environment (operationClass=dual). Provide a name and the git branch it tracks.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1},inputSchema:{businessId:a.string().describe("The business id to create the environment in."),name:a.string().describe("Environment name (e.g. 'staging', 'preview-pr-42')."),branch:a.string().describe("The git branch this environment tracks."),...Ae},handler:async(t,e)=>{let n=await t.createEnvironment(e.businessId,{name:e.name,branch:e.branch},{idempotencyKey:e.idempotencyKey});return{ok:!0,businessId:e.businessId,environment:n}}}},{opKey:"environment.delete",operationClass:"dual",scope:["businesses:update"],sideEffect:"write",cli:{group:"env",command:"delete",summary:"Delete an environment by name. Requires --yes.",destructive:!0,yesMessage:"Pass --yes to confirm environment deletion.",args:[{field:"businessId",kind:"positional",token:"<businessIdOrName>",resolveBusiness:!0},{field:"envName",kind:"positional",token:"<envName>"}],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=e.envName;await t.deleteEnvironment(i,r),n({businessId:i,deleted:r},`Environment ${r} deleted`)}},mcp:null}];async function ro(t,e,n){let r=await t.listEnvironments(e),s=(Array.isArray(r.data)?r.data:Array.isArray(r.environments)?r.environments:[]).find(c=>c.name.toLowerCase()===n.toLowerCase()||c.id===n);if(!s)throw new Error(`Environment "${n}" not found on business ${e}.`);return s.id}var iy=["gateway_verification","metering","health","tunnel"],q6="<businessId>",io="businesses:update",oo="The business id.",Hn={field:"businessId",kind:"positional",token:q6};function aR(t){if(!t||typeof t!="object")return[];let e=t;return Array.isArray(e.data)?e.data:Array.isArray(e.backends)?e.backends:Array.isArray(e.tokens)?e.tokens:Array.isArray(t)?t:[]}function V6(t){let e=t.status;if(typeof e=="string"&&e.length>0)return e;let n=typeof t.readinessState=="string"?t.readinessState:null,i=typeof t.provisionStatus=="string"?t.provisionStatus:null;return n??i??"unknown"}function H6(t){return{id:t.id,environmentId:t.environmentId??null,name:t.name,slug:t.slug,transport:t.transportMode,default:t.isDefault??!1,status:V6(t),originUrl:t.originUrl??null,lastSeenAt:t.lastSeenAt??null}}async function oy(t,e,n){if(!n)return null;try{return await ro(t,e,n)}catch(i){throw new P(i instanceof Error?i.message:`Environment "${n}" not found on business ${e}.`,void 0,{code:"ENV_NOT_FOUND"})}}var sy=t=>typeof t=="string"&&t.length>0?t.split(",").map(e=>e.trim()).filter(e=>e.length>0):void 0,cR=[{opKey:"backend.read",operationClass:"operate",scope:["businesses:read"],sideEffect:"read",cli:{group:"backend",command:"list",summary:"List backends for a business (id, name, transport, status)",args:[Hn],handler:async({client:t,args:e,emit:n})=>{let r=aR(await t.builderListBackends(e.businessId)).map(H6);n({count:r.length,backends:r},`${r.length} backend(s)`)}},mcp:{tool:"fs_backend_list",title:"List backends",description:"List a business's backends (origins) \u2014 id, name, slug, transport (direct|tunnel), default flag, and derived status. Read-only.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe("The business id whose backends to list.")},handler:async(t,{businessId:e})=>t.builderListBackends(e)}},{opKey:"backend.create",operationClass:"operate",scope:[io],sideEffect:"write",cli:{group:"backend",command:"create",summary:"Create a backend (default transport: direct)",idempotent:!0,args:[Hn,{field:"name",kind:"flag",token:"--name <name>",describe:"Human-friendly backend name",required:!0},{field:"slug",kind:"flag",token:"--slug <slug>",describe:"Stable slug (defaults to a slugified name)"},{field:"env",kind:"flag",token:"--env <environment>",describe:"Scope backend to an environment name or id"},{field:"transport",kind:"flag",token:"--transport <mode>",describe:"Transport mode: direct | tunnel",defaultValue:"direct"},{field:"runner",kind:"flag",token:"--runner <runner>",describe:"embedded | sidecar"},{field:"runtime",kind:"flag",token:"--runtime <runtime>",describe:"Container/runtime descriptor"},{field:"originUrl",kind:"flag",token:"--origin-url <url>",describe:"Builder origin URL (direct)"},{field:"default",kind:"flag",token:"--default",describe:"Mark this backend the business default"}],handler:async({client:t,args:e,reqOpts:n,emit:i,emitDryRunPreview:r})=>{let o=e.businessId,s=await oy(t,o,e.env),c=e.transport==="tunnel"?"tunnel":"direct",u=await t.builderCreateBackend(o,{name:e.name,slug:e.slug,environmentId:s,transportMode:c,runner:e.runner==="embedded"||e.runner==="sidecar"?e.runner:null,runtime:e.runtime??null,originUrl:e.originUrl??null,isDefault:e.default},n);r(u)||i({result:u},"Backend created")}},mcp:{tool:"fs_backend_create",title:"Create a backend",description:"Create a backend (origin) for a business. Pick a transport mode: direct (public HTTPS URL, secured by Ed25519 request signing) or tunnel (private outbound-only cloudflared, secure bring-your-own-backend). Mark it default to route traffic to it.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1},inputSchema:{businessId:a.string().describe("The business id to create the backend in."),name:a.string().describe("Backend name (e.g. 'prod-origin')."),slug:a.string().optional().describe("URL-safe slug; derived from name if omitted."),transportMode:a.enum(["direct","tunnel"]).optional().describe("How the gateway reaches the origin; defaults to direct."),originUrl:a.string().optional().describe("The origin URL (for direct mode)."),isDefault:a.boolean().optional().describe("Route traffic to this backend by default."),...Ae},handler:async(t,e)=>t.builderCreateBackend(e.businessId,{name:e.name,slug:e.slug,transportMode:e.transportMode,originUrl:e.originUrl,isDefault:e.isDefault},{idempotencyKey:e.idempotencyKey})}},{opKey:"backend.bind",operationClass:"operate",scope:[io],sideEffect:"write",cli:{group:"backend",command:"bind",summary:"Bind a logical backend to a direct upstream in one environment",idempotent:!0,args:[Hn,{field:"backend",kind:"positional",token:"<backend>"},{field:"env",kind:"flag",token:"--env <environment>",describe:"Environment name or id (omit for production)"},{field:"originUrl",kind:"flag",token:"--origin-url <url>",describe:"Concrete direct upstream URL for this environment",required:!0}],handler:async({client:t,args:e,reqOpts:n,emit:i,emitDryRunPreview:r})=>{let o=e.businessId,s=e.backend,c=await oy(t,o,e.env),u=await t.builderBindBackend(o,s,{environmentId:c,originUrl:e.originUrl},n);r(u)||i({result:u},`Backend ${s} bound in ${c??"production"}`)}},mcp:{tool:"fs_backend_bind",title:"Bind a backend upstream",description:"Bind a logical backend id to a concrete direct upstream URL in one environment. Omit environmentId for production.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe(oo),backend:a.string().describe("Logical backend slug."),environmentId:a.string().optional().describe("Preview environment id; omit for production."),originUrl:a.string().url().describe("Concrete direct upstream URL."),...Ae},handler:async(t,e)=>t.builderBindBackend(e.businessId,e.backend,{environmentId:e.environmentId??null,originUrl:e.originUrl},{idempotencyKey:e.idempotencyKey})}},{opKey:"backend.delete",operationClass:"operate",scope:[io],sideEffect:"write",cli:{group:"backend",command:"delete",summary:"Delete a backend (revokes its runtime tokens). Requires --yes.",destructive:!0,yesMessage:"Pass --yes to confirm backend deletion.",args:[Hn,{field:"backendId",kind:"positional",token:"<backendId>"}],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=e.backendId;await t.builderDeleteBackend(i,r),n({businessId:i,deleted:r},`Backend ${r} deleted`)}},mcp:{tool:"fs_backend_delete",title:"Delete a backend",description:"Delete a backend (origin). Traffic routed to it stops; re-create to restore.",annotations:{readOnlyHint:!1,destructiveHint:!0,idempotentHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe(oo),backendId:a.string().describe("The backend id to delete.")},handler:async(t,{businessId:e,backendId:n})=>t.builderDeleteBackend(e,n)}},{opKey:"runtime_token.read",operationClass:"operate",scope:["businesses:read"],sideEffect:"read",cli:{group:"backend tokens",command:"list",summary:"List runtime tokens for a business",args:[Hn],handler:async({client:t,args:e,emit:n})=>{let i=aR(await t.builderListRuntimeTokens(e.businessId));n({count:i.length,tokens:i},`${i.length} runtime token(s)`)}},mcp:{tool:"fs_runtime_token_list",title:"List runtime tokens",description:"List a business's runtime tokens (fsrt_) \u2014 id, last-four, operations, status. Read-only; secrets are never shown.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe(oo)},handler:async(t,{businessId:e})=>t.builderListRuntimeTokens(e)}},{opKey:"runtime_token.mint",operationClass:"operate",scope:[io],sideEffect:"write",cli:{group:"backend tokens",command:"create",summary:"Create a runtime token (returns FS_RUNTIME_TOKEN once)",idempotent:!0,args:[Hn,{field:"env",kind:"flag",token:"--env <environment>",describe:"Scope token to an environment name or id"},{field:"backend",kind:"flag",token:"--backend <backendId>",describe:"Bind token to a specific backend"},{field:"kind",kind:"flag",token:"--kind <kind>",describe:"live | test (defaults from env scope)"},{field:"operations",kind:"flag",token:"--operations <list>",describe:`Comma-separated operations: ${iy.join(" | ")}. Default: core's DEFAULT_OPERATIONS. Use tunnel for tunnel backends.`},{field:"meters",kind:"flag",token:"--meters <list>",describe:"Comma-separated allowed meters (default: all business meters)"},{field:"routes",kind:"flag",token:"--routes <list>",describe:"Comma-separated allowed routes"}],handler:async({client:t,args:e,reqOpts:n,emit:i,emitDryRunPreview:r})=>{let o=e.businessId,s=await oy(t,o,e.env),c=e.kind==="test"||e.kind==="live"?e.kind:void 0,u=sy(e.operations);if(u){for(let l of u)if(!iy.includes(l))throw new P(`Unknown operation "${l}". Available: ${iy.join(", ")}.`,void 0,{code:"UNKNOWN_RUNTIME_TOKEN_OPERATION"})}let d=await t.builderCreateRuntimeToken(o,{environmentId:s,backendId:e.backend??null,kind:c,operations:u,allowedMeters:sy(e.meters),allowedRoutes:sy(e.routes)},n);r(d)||i({envVar:"FS_RUNTIME_TOKEN",result:d},"Runtime token created")}},mcp:{tool:"fs_runtime_token_mint",title:"Mint a runtime token",description:"Mint a new runtime token (fsrt_) for a backend. Returns the plaintext token ONCE \u2014 store it now (e.g. as FS_RUNTIME_TOKEN). Operations default to the backend's needs (gateway_verification, metering, health).",returnsOneTimeSecret:!0,annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1},inputSchema:{businessId:a.string().describe(oo),backendId:a.string().optional().describe("Bind the token to this backend."),environmentId:a.string().optional().describe("Scope to a preview environment (omit for production)."),kind:a.enum(["live","test"]).optional().describe("Token kind; defaults from the env scope."),operations:a.array(a.string()).optional().describe("Operations (gateway_verification, metering, health, tunnel)."),...Ae},handler:async(t,e)=>t.builderCreateRuntimeToken(e.businessId,{backendId:e.backendId??null,environmentId:e.environmentId??null,kind:e.kind,operations:e.operations},{idempotencyKey:e.idempotencyKey})}},{opKey:"runtime_token.rotate",operationClass:"operate",scope:[io],sideEffect:"write",cli:{group:"backend tokens",command:"rotate",summary:"Rotate a runtime token (returns a fresh FS_RUNTIME_TOKEN once)",args:[Hn,{field:"tokenId",kind:"positional",token:"<tokenId>"}],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=e.tokenId,o=await t.builderRotateRuntimeToken(i,r);n({envVar:"FS_RUNTIME_TOKEN",result:o},`Runtime token ${r} rotated`)}},mcp:{tool:"fs_runtime_token_rotate",title:"Rotate a runtime token",description:"Rotate a runtime token: mint a fresh secret carrying the same scope and revoke the old one. Returns the new plaintext token ONCE.",returnsOneTimeSecret:!0,annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1},inputSchema:{businessId:a.string().describe(oo),tokenId:a.string().describe("The runtime token id to rotate."),...Ae},handler:async(t,e)=>t.builderRotateRuntimeToken(e.businessId,e.tokenId,{idempotencyKey:e.idempotencyKey})}},{opKey:"runtime_token.revoke",operationClass:"operate",scope:[io],sideEffect:"write",cli:{group:"backend tokens",command:"revoke",summary:"Revoke a runtime token. Requires --yes.",destructive:!0,yesMessage:"Pass --yes to confirm runtime token revocation.",args:[Hn,{field:"tokenId",kind:"positional",token:"<tokenId>"}],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=e.tokenId;await t.builderRevokeRuntimeToken(i,r),n({businessId:i,revoked:r},`Runtime token ${r} revoked`)}},mcp:{tool:"fs_runtime_token_revoke",title:"Revoke a runtime token",description:"Revoke a runtime token. The backend using it stops verifying.",annotations:{readOnlyHint:!1,destructiveHint:!0,idempotentHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe(oo),tokenId:a.string().describe("The runtime token id to revoke.")},handler:async(t,{businessId:e,tokenId:n})=>t.builderRevokeRuntimeToken(e,n)}}];var uR=new Set(["SUCCEEDED","SUCCESS"]),lR=new Set(["FAILED","ERROR","CANCELLED","TIMED_OUT"]),dR="SUPERSEDED";function G6(t){let n=(t?.data??t)?.builds;return Array.isArray(n)?n:[]}var Qt=t=>typeof t=="string"?t:null;async function pR(t,e){let n=e.intervalMs??5e3,i=e.sleep??(l=>new Promise(p=>setTimeout(p,l))),r=e.now??(()=>Date.now()),o=r()+e.timeoutMs,s={status:"UNKNOWN",buildId:e.buildId??null,ref:null,error:null,timedOut:!1},c=e.buildId??null,u=null,d=e.buildId!=null;for(;;){let l=await t.builderFrontendStatus(e.businessId,e.environmentId),p=G6(l),m=(c?p.find(f=>Qt(f.id)===c):void 0)??p[0];if(m){let f=Qt(m.status)??"UNKNOWN",h=Qt(m.id);s={status:f,buildId:h,ref:Qt(m.ref),error:Qt(m.error),timedOut:!1};let y=uR.has(f)||lR.has(f)||f===dR;if(d||(d=!0,y&&(u=h)),u!==null&&h===u){if(r()>=o)return{...s,timedOut:!0};await i(Math.min(n,Math.max(0,o-r())));continue}if(u=null,uR.has(f)||lR.has(f))return s;if(f===dR){let v=p.find(T=>Qt(T.ref)===Qt(m.ref)&&Qt(T.id)!==Qt(m.id));c=v?Qt(v.id):null}}if(r()>=o)return{...s,timedOut:!0};await i(Math.min(n,Math.max(0,o-r())))}}var ay="The business id or slug.",mR="Scope to a preview environment (omit for production).",fR={field:"businessId",kind:"positional",token:"<businessIdOrSlug>",describe:ay,resolveBusiness:!0},hR={field:"env",kind:"flag",token:"--env <environmentId>",describe:"Scope to a preview environment id (omit for production)."};async function gR(t,e){return ve(t,e)}var bR=[{opKey:"frontend.status",operationClass:"operate",scope:["businesses:read"],sideEffect:"read",cli:{group:"frontend",command:"status",summary:"Show the current frontend release, recent releases, and recent builds (incl. failure reasons)",args:[fR,hR,{field:"wait",kind:"flag",token:"--wait",describe:"Block until the in-flight build finishes, then report it; exit non-zero if it failed. Use after a push or release instead of polling this command in a loop."},{field:"timeout",kind:"flag",token:"--timeout <seconds>",describe:"How long --wait waits before giving up (default 600)."}],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=e.env;if(!e.wait){n(await t.builderFrontendStatus(i,r),"Frontend status");return}let o=Number(e.timeout??600),s=await pR(t,{businessId:i,environmentId:r,buildId:null,timeoutMs:(Number.isFinite(o)&&o>0?o:600)*1e3});if(s.timedOut)throw new P(`Frontend build did not finish within the timeout (last status: ${s.status})`,0,{code:"BUILD_WAIT_TIMEOUT",details:{build:s}});if(s.status!=="SUCCEEDED"&&s.status!=="SUCCESS")throw new P(`Frontend build ${s.status}${s.error?`: ${s.error}`:""}`,0,{code:"BUILD_FAILED",details:{build:s}});let c=await t.builderFrontendStatus(i,r);n({status:c,build:s},"Frontend build succeeded")}},mcp:{tool:"fs_frontend_status",title:"Get frontend status",description:"Read a business's current frontend serve state (uiMode, active release hash + producing build, pin flag), the recent SUCCEEDED releases (rollback targets), and the recent builds \u2014 a FAILED build's `error` explains why a deploy didn't go live. Read-only.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe(ay),environmentId:a.string().optional().describe(mR)},handler:async(t,e)=>{let n=await gR(t,e.businessId);return t.builderFrontendStatus(n,e.environmentId)}}},{opKey:"frontend.rollback",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:"frontend",command:"rollback",summary:"Roll the business frontend back to a prior release (re-activate its releaseId)",idempotent:!0,args:[fR,{field:"releaseId",kind:"flag",token:"--release-id <releaseId>",describe:"The prior release id (manifest hash) to re-activate \u2014 see `frontend status`.",required:!0},hR],handler:async({client:t,args:e,reqOpts:n,emit:i,emitDryRunPreview:r})=>{let o=await t.builderFrontendRollback(e.businessId,{releaseId:e.releaseId,environmentId:e.env},n);r(o)||i({result:o},"Frontend rolled back")}},mcp:{tool:"fs_frontend_rollback",title:"Roll back a business frontend",description:"Roll a business's frontend back to a prior release by its releaseId (manifest hash, from fs_frontend_status). Flips the live pointer back and pins it. The releaseId must belong to this target's build history.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe(ay),releaseId:a.string().describe("The prior release id (manifest hash) to re-activate."),environmentId:a.string().optional().describe(mR),...Ae},handler:async(t,e)=>{let n=await gR(t,e.businessId);return t.builderFrontendRollback(n,{releaseId:e.releaseId,environmentId:e.environmentId},{idempotencyKey:e.idempotencyKey})}}}];var _R=[{opKey:"usage.read",operationClass:"operate",scope:["businesses:read"],sideEffect:"read",cli:{group:"usage",command:"summary",summary:"Show usage summary for the last 30 days",args:[{field:"businessId",kind:"positional",token:"<businessIdOrName>",resolveBusiness:!0}],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=await t.managementGetUsage(i);n({businessId:i,summary:r},"Usage summary")}},mcp:{tool:"fs_usage_read",title:"Read usage summary",description:"Read a business's usage summary \u2014 metered request counts and tier utilization. Read-only.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe("The business id whose usage to read.")},handler:async(t,{businessId:e})=>t.managementGetUsage(e)}}];var yR=[{opKey:"persona.bootstrap",operationClass:"operate",scope:["businesses:read"],sideEffect:"write",cli:{group:"persona",command:"bootstrap",summary:"Issue a fresh fsk_test_ API key in a test environment",args:[{field:"businessId",kind:"positional",token:"<businessIdOrName>",resolveBusiness:!0},{field:"env",kind:"flag",token:"--env <env>",describe:"Environment name (must be test-strategy)",required:!0},{field:"plan",kind:"flag",token:"--plan <planKey>",describe:"Plan key to assign (e.g. starter)"},{field:"displayName",kind:"flag",token:"--display-name <name>",describe:"Persona display name"}],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=await cy(t,i,e.env),o=await t.issuePersonaBootstrapKey(i,r,{planKey:e.plan,displayName:e.displayName});n({businessId:i,environmentId:r,result:o},"Persona bootstrapped")}},mcp:{tool:"fs_persona_bootstrap",title:"Bootstrap a test persona",description:"Issue a one-time test bootstrap key for a business environment \u2014 use it to provision a test persona. Returns the key ONCE; store it now.",returnsOneTimeSecret:!0,annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1},inputSchema:{businessId:a.string().describe("The business id."),environmentId:a.string().describe("The environment id to scope the persona to.")},handler:async(t,{businessId:e,environmentId:n})=>t.issuePersonaBootstrapKey(e,n)}},{opKey:"persona.read",operationClass:"operate",scope:["businesses:read"],sideEffect:"read",cli:{group:"persona",command:"list",summary:"List personas for a test environment",args:[{field:"businessId",kind:"positional",token:"<businessIdOrName>",resolveBusiness:!0},{field:"env",kind:"flag",token:"--env <env>",describe:"Environment name",required:!0}],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=await cy(t,i,e.env),o=await t.listPersonas(i,r);n({businessId:i,environmentId:r,result:o},"Personas")}},mcp:{tool:"fs_persona_list",title:"List personas",description:"List a business environment's test personas (id, label, status). Read-only.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe("The business id."),environmentId:a.string().describe("The environment id whose personas to list.")},handler:async(t,{businessId:e,environmentId:n})=>t.listPersonas(e,n)}},{opKey:"persona.revoke",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:"persona",command:"revoke",summary:"Revoke a persona's API key",args:[{field:"businessId",kind:"positional",token:"<businessIdOrName>",resolveBusiness:!0},{field:"personaId",kind:"positional",token:"<personaId>"},{field:"env",kind:"flag",token:"--env <env>",describe:"Environment name",required:!0}],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=e.personaId,o=await cy(t,i,e.env),s=await t.revokePersona(i,o,r);n({businessId:i,environmentId:o,result:s},`Persona ${r} revoked`)}},mcp:{tool:"fs_persona_revoke",title:"Revoke a persona",description:"Revoke a test persona. Its credentials stop working.",annotations:{readOnlyHint:!1,destructiveHint:!0,idempotentHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe("The business id."),environmentId:a.string().describe("The environment id."),personaId:a.string().describe("The persona id to revoke.")},handler:async(t,{businessId:e,environmentId:n,personaId:i})=>t.revokePersona(e,n,i)}}];async function cy(t,e,n){try{return await ro(t,e,n)}catch(i){throw new P(i instanceof Error?i.message:`Environment "${n}" not found on business ${e}.`,void 0,{code:"ENV_NOT_FOUND"})}}function K6(t){if(!t||typeof t!="object")return[];let e=t;return Array.isArray(e.data)?e.data:Array.isArray(e.tokens)?e.tokens:Array.isArray(t)?t:[]}var vR=[{opKey:"maker_token.read",operationClass:"operate",scope:[],sideEffect:"read",cli:{group:"token",command:"list",summary:"List maker tokens in the current org",args:[],handler:async({client:t,emit:e})=>{let n=K6(await t.managementListMakerTokens());e({count:n.length,tokens:n.map(i=>({id:i.id,name:i.name??null,scopes:i.scopes??[],businessId:i.businessId??null,lastFour:i.lastFour??null,createdAt:i.createdAt??null,revokedAt:i.revokedAt??null}))},`${n.length} token(s)`)}},mcp:{tool:"fs_maker_token_list",title:"List maker tokens",description:"List the workspace's maker tokens (mk_) \u2014 id, label, scopes, last-four, status. Read-only; secrets are never shown. Creating/revoking maker tokens is intentionally not exposed via MCP.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{},handler:async t=>t.managementListMakerTokens()}},{opKey:"maker_token.create",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:"token",command:"create",summary:"Create a new maker token (returns the secret once)",args:[{field:"name",kind:"flag",token:"--name <name>",describe:"Human-friendly token name",required:!0},{field:"scope",kind:"flag",token:"--scope <scope...>",describe:"Scope(s) to attach (e.g. businesses:update businesses:publish)"},{field:"business",kind:"flag",token:"--business <businessId>",describe:"Scope to a specific business"},{field:"restrict",kind:"flag",token:"--restrict <perm...>",describe:"Narrow the token's role bundle to these permissions (e.g. business:read plan:read). Must be within your own permissions."}],handler:async({client:t,args:e,emit:n})=>{let i=await t.managementCreateMakerToken({name:e.name,scopes:e.scope,businessId:e.business,restrictedPermissions:e.restrict});n({result:i},"Token created")}},mcp:null},{opKey:"maker_token.revoke",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:"token",command:"revoke",summary:"Revoke a maker token. Requires --yes.",destructive:!0,yesMessage:"Pass --yes to confirm token revocation.",args:[{field:"tokenId",kind:"positional",token:"<tokenId>"}],handler:async({client:t,args:e,emit:n})=>{let i=e.tokenId;await t.managementRevokeMakerToken(i),n({revoked:i},`Token ${i} revoked`)}},mcp:null},{opKey:"maker_token.rotate",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:"token",command:"rotate",summary:"Rotate a maker token secret (returns the new secret once)",idempotent:!0,args:[{field:"tokenId",kind:"positional",token:"<tokenId>"},{field:"syncToGithub",kind:"flag",token:"--sync-to-github",describe:"Also update the connected GitHub repo FARTHERSHORE_TOKEN secret when this is a platform token"}],handler:async({client:t,args:e,reqOpts:n,emit:i})=>{let r=e.tokenId,o=await t.managementRotateMakerToken(r,{syncToGithub:e.syncToGithub===!0},n);i({result:o},`Token ${r} rotated`)}},mcp:null},{opKey:"maker_token.hard_delete",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:"token",command:"delete",summary:"Permanently delete an already-revoked maker token. Requires --yes.",destructive:!0,yesMessage:"Pass --yes to permanently delete the revoked token row.",args:[{field:"tokenId",kind:"positional",token:"<tokenId>"}],handler:async({client:t,args:e,emit:n})=>{let i=e.tokenId;await t.managementHardDeleteMakerToken(i),n({deleted:i},`Token ${i} permanently deleted`)}},mcp:null}];var kR=[{opKey:"apply_timeline.list",operationClass:"operate",scope:["businesses:read"],sideEffect:"read",cli:{group:"apply-timeline",command:"list",summary:"List a business's Apply Timeline: repo-triggered manifest applies (PRs, pushes, releases), checks, semantic diffs, and apply phases.",args:[{field:"businessId",kind:"positional",token:"<businessIdOrName>",resolveBusiness:!0},{field:"env",kind:"flag",token:"--env <env>",describe:"Environment scope: production, all, or a preview environment name."}],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=await t.listApplyTimeline(i,{env:e.env});n({businessId:i,count:r.data.length,applyTimeline:r.data},`${r.data.length} apply timeline entr(ies)`)}},mcp:null},{opKey:"apply_timeline.read",operationClass:"operate",scope:["businesses:read"],sideEffect:"read",cli:{group:"apply-timeline",command:"inspect",summary:"Inspect one Apply Timeline entry by id, release tag, PR number, branch, or commit SHA.",args:[{field:"businessId",kind:"positional",token:"<businessIdOrName>",resolveBusiness:!0},{field:"selector",kind:"positional",token:"<id|tag|pr|branch|sha>"},{field:"env",kind:"flag",token:"--env <env>",describe:"Environment scope: production, all, or a preview environment name."}],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=String(e.selector),o=await t.listApplyTimeline(i,{env:e.env}),s=o.data.find(c=>c.id===r)??o.data.find(c=>c.releaseTag===r)??o.data.find(c=>c.prNumber!==null&&String(c.prNumber)===r)??o.data.find(c=>c.branch===r)??o.data.find(c=>c.commitSha.startsWith(r));if(!s)throw new P(`Apply timeline entry ${r} was not found.`,404,{code:"APPLY_TIMELINE_ENTRY_NOT_FOUND"});n({businessId:i,applyTimelineEntry:s},`Apply timeline entry ${s.id}: ${s.status}`)}},mcp:null}];var ka="The business id or slug.",Sa="The subscriber (client org) id \u2014 from `consumer list`.",uy="The governed ChangeSet id.",Qd={field:"businessId",kind:"positional",token:"<businessIdOrSlug>",describe:ka,resolveBusiness:!0},ep={field:"subscriberId",kind:"positional",token:"<subscriberId>",describe:Sa},SR={field:"changeSetId",kind:"positional",token:"<changeSetId>",describe:uy},tp={field:"env",kind:"flag",token:"--env <env>",describe:"Environment name/id to scope the proposal to."};function W6(t){let e;try{e=JSON.parse(t)}catch{throw new P("--operations must be a JSON array of governed operations.",0,{code:"INVALID_OPERATIONS"})}if(!Array.isArray(e))throw new P("--operations must be a JSON array.",0,{code:"INVALID_OPERATIONS"});return e}async function np(t,e){return ve(t,e)}var xR=[{opKey:"change_set.propose",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:"proposal",command:"create",summary:"Propose a governed ChangeSet against a subscriber (agent/builder proposer; a human approves + applies in the portal)",idempotent:!0,args:[Qd,ep,{field:"intent",kind:"flag",token:"--intent <intent>",describe:"Human-readable description of the proposed change.",required:!0},{field:"operations",kind:"flag",token:"--operations <json>",describe:"JSON array of governed operations (e.g. update_role_permissions).",required:!0,parser:t=>W6(t)},tp],handler:async({client:t,args:e,reqOpts:n,emit:i,emitDryRunPreview:r})=>{let o=e.businessId,s=e.subscriberId,c=await t.proposeConsumerChangeSet(o,s,{intent:e.intent,operations:e.operations,...n.idempotencyKey?{idempotencyKey:n.idempotencyKey}:{}},{env:e.env},n);r(c)||i(c,"ChangeSet proposed")}},mcp:{tool:"fs_proposal_create",title:"Propose a governed ChangeSet",description:"Propose a governed ChangeSet against a subscriber's live RBAC state (Agent Proposal Flow). Creates a DRAFT proposal that a HUMAN in the subscriber org must preview, approve, and apply in the portal \u2014 an agent can propose but never self-approve or apply. Operate-class live-state action; does not edit repo-authored business behavior.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!0},inputSchema:{businessId:a.string().describe(ka),subscriberId:a.string().describe(Sa),intent:a.string().describe("Human-readable description of the proposed change."),operations:a.array(a.record(a.string(),a.unknown())).describe("Governed operations, e.g. [{ type: 'update_role_permissions', schemaVersion: 1, target: { resourceType: 'subscriber_business_role', resourceId: '<roleKey>' }, payload: { permissions: [...] } }]."),env:a.string().optional().describe("Environment name/id to scope the proposal to."),idempotencyKey:a.string().optional().describe("Replay-safe idempotency key for the proposal.")},handler:async(t,e)=>{let n=await np(t,e.businessId);return t.proposeConsumerChangeSet(n,e.subscriberId,{intent:e.intent,operations:e.operations,...e.idempotencyKey?{idempotencyKey:e.idempotencyKey}:{}},{env:e.env})}}},{opKey:"change_set.preview",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:"proposal",command:"preview",summary:"Simulate + store a preview on a proposed ChangeSet (rides the propose authority)",args:[Qd,ep,SR,tp],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=await t.previewConsumerChangeSet(i,e.subscriberId,e.changeSetId,{env:e.env});n(r,"ChangeSet preview stored")}},mcp:{tool:"fs_proposal_preview",title:"Preview a proposed ChangeSet",description:"Simulate the impact of a proposed ChangeSet and store the preview (Agent Proposal Flow). Enforced by the same authority as propose \u2014 there is no separate preview permission. Read-shaped but writes the stored simulation; does not apply the change.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!0},inputSchema:{businessId:a.string().describe(ka),subscriberId:a.string().describe(Sa),changeSetId:a.string().describe(uy),env:a.string().optional().describe("Environment name/id.")},handler:async(t,e)=>{let n=await np(t,e.businessId);return t.previewConsumerChangeSet(n,e.subscriberId,e.changeSetId,{env:e.env})}}},{opKey:"change_set.proposal_list",operationClass:"operate",scope:["businesses:read"],sideEffect:"read",cli:{group:"proposal",command:"list",summary:"List governed ChangeSets proposed against a subscriber",args:[Qd,ep,{field:"status",kind:"flag",token:"--status <status>",describe:"Filter by status (e.g. draft, approval_required)."},tp],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=await t.listConsumerChangeSets(i,e.subscriberId,{env:e.env,status:e.status});n(r,"Proposed ChangeSets")}},mcp:{tool:"fs_proposal_list",title:"List proposed ChangeSets",description:"List governed ChangeSets proposed against a subscriber (Agent Proposal Flow). Read-only; use it to discover proposal ids + their status before previewing.",annotations:{readOnlyHint:!0,openWorldHint:!0},inputSchema:{businessId:a.string().describe(ka),subscriberId:a.string().describe(Sa),status:a.string().optional().describe("Filter by status (e.g. draft, approval_required)."),env:a.string().optional().describe("Environment name/id.")},handler:async(t,e)=>{let n=await np(t,e.businessId);return t.listConsumerChangeSets(n,e.subscriberId,{env:e.env,status:e.status})}}},{opKey:"change_set.proposal_read",operationClass:"operate",scope:["businesses:read"],sideEffect:"read",cli:{group:"proposal",command:"get",summary:"Read one governed ChangeSet proposed against a subscriber",args:[Qd,ep,SR,tp],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=await t.getConsumerChangeSet(i,e.subscriberId,e.changeSetId,{env:e.env});n(r,"ChangeSet")}},mcp:{tool:"fs_proposal_get",title:"Read a proposed ChangeSet",description:"Read one governed ChangeSet proposed against a subscriber (Agent Proposal Flow) \u2014 its operations, risk, simulation, approvals, and status. Read-only.",annotations:{readOnlyHint:!0,openWorldHint:!0},inputSchema:{businessId:a.string().describe(ka),subscriberId:a.string().describe(Sa),changeSetId:a.string().describe(uy),env:a.string().optional().describe("Environment name/id.")},handler:async(t,e)=>{let n=await np(t,e.businessId);return t.getConsumerChangeSet(n,e.subscriberId,e.changeSetId,{env:e.env})}}}];var Sr="The business id or slug.",xa="The webhook endpoint id.",so="billing:manage",ao={field:"businessId",kind:"positional",token:"<businessIdOrSlug>",describe:Sr,resolveBusiness:!0},rp={field:"webhookId",kind:"positional",token:"<webhookId>",describe:xa},IR={field:"events",kind:"flag",token:"--events <events>",describe:"Comma-separated event names, e.g. subscription.created,payment.failed"},$R={field:"limit",kind:"flag",token:"--limit <n>",describe:"Max rows to return."};function wR(t){if(typeof t!="string")return;let e=t.split(",").map(n=>n.trim()).filter(n=>n.length>0);return e.length>0?e:void 0}function ER(t){if(!t||typeof t!="object")return[];let e=t;return Array.isArray(e.data)?e.data:[]}function TR(t,e){if(!t||typeof t!="object")return e;let n=t;return typeof n.total=="number"?n.total:typeof n.pagination?.total=="number"?n.pagination.total:e}function J6(t){let e=t.enable===!0,n=t.disable===!0;if(e&&n)throw new P("Pass either --enable or --disable, not both.",400,{code:"VALIDATION_ERROR",param:"enabled"});if(e)return!0;if(n)return!1}async function co(t,e){return ve(t,e)}var RR=[{opKey:"webhook.read",operationClass:"operate",scope:[so],sideEffect:"read",cli:{group:"webhook",command:"list",summary:"List API-managed webhook endpoints",args:[ao,$R],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=await t.managementListWebhooks(i,{limit:e.limit}),o=ER(r);n({businessId:i,count:o.length,total:TR(r,o.length),webhooks:o},`${o.length} webhook(s)`)}},mcp:{tool:"fs_webhook_list",title:"List webhook endpoints",description:"List API-managed outbound webhook endpoints for a business. Read-only; signing secrets are never returned.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe(Sr),limit:a.string().optional().describe("Max rows to return.")},handler:async(t,e)=>{let n=await co(t,e.businessId);return t.managementListWebhooks(n,{limit:e.limit})}}},{opKey:"webhook.create",operationClass:"operate",scope:[so],sideEffect:"write",cli:{group:"webhook",command:"create",summary:"Create an API-managed webhook endpoint",idempotent:!0,args:[ao,{field:"url",kind:"flag",token:"--url <url>",describe:"HTTPS receiver URL.",required:!0},{...IR,required:!0}],handler:async({client:t,args:e,reqOpts:n,emit:i,emitDryRunPreview:r})=>{let o=wR(e.events);if(!o)throw new P("At least one webhook event is required.",400,{code:"VALIDATION_ERROR",param:"events"});let s=await t.managementCreateWebhook(e.businessId,{url:e.url,events:o},n);r(s)||i({businessId:e.businessId,webhook:s.data},"Webhook endpoint created")}},mcp:{tool:"fs_webhook_create",title:"Create webhook endpoint",description:"Create an API-managed outbound webhook endpoint for a business. Returns the signing secret once. If webhooks are declared in business/index.ts, Core returns 409 MANAGED_BY_CODE and the repo must be edited instead.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!0},returnsOneTimeSecret:!0,inputSchema:{businessId:a.string().describe(Sr),url:a.string().url().describe("HTTPS receiver URL."),events:a.array(a.string()).min(1).describe("Webhook event names to subscribe to."),...Ae},handler:async(t,e)=>{let n=await co(t,e.businessId);return t.managementCreateWebhook(n,{url:e.url,events:e.events},{idempotencyKey:e.idempotencyKey})}}},{opKey:"webhook.update",operationClass:"operate",scope:[so],sideEffect:"write",cli:{group:"webhook",command:"update",summary:"Update a webhook endpoint's events or enabled state",idempotent:!0,args:[ao,rp,IR,{field:"enable",kind:"flag",token:"--enable",describe:"Enable delivery for this endpoint."},{field:"disable",kind:"flag",token:"--disable",describe:"Disable delivery for this endpoint."}],handler:async({client:t,args:e,reqOpts:n,emit:i,emitDryRunPreview:r})=>{let o=wR(e.events),s=J6(e);if(!o&&s===void 0)throw new P("Pass --events, --enable, or --disable to update a webhook.",400,{code:"VALIDATION_ERROR"});let c=await t.managementUpdateWebhook(e.businessId,e.webhookId,{...o?{events:o}:{},...s!==void 0?{enabled:s}:{}},n);r(c)||i({businessId:e.businessId,webhook:c.data},"Webhook endpoint updated")}},mcp:{tool:"fs_webhook_update",title:"Update webhook endpoint",description:"Update an API-managed webhook endpoint's event list and/or enabled state. URL and secret are immutable; create a new endpoint for those changes.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe(Sr),webhookId:a.string().describe(xa),events:a.array(a.string()).min(1).optional().describe("Replacement webhook event list."),enabled:a.boolean().optional().describe("Enable or disable delivery."),...Ae},handler:async(t,e)=>{let n=await co(t,e.businessId);return t.managementUpdateWebhook(n,e.webhookId,{events:e.events,enabled:e.enabled},{idempotencyKey:e.idempotencyKey})}}},{opKey:"webhook.delete",operationClass:"operate",scope:[so],sideEffect:"write",cli:{group:"webhook",command:"delete",summary:"Delete an API-managed webhook endpoint. Requires --yes.",destructive:!0,yesMessage:"Pass --yes to confirm webhook endpoint deletion.",args:[ao,rp],handler:async({client:t,args:e,emit:n})=>{await t.managementDeleteWebhook(e.businessId,e.webhookId),n({businessId:e.businessId,deleted:e.webhookId},"Webhook endpoint deleted")}},mcp:{tool:"fs_webhook_delete",title:"Delete webhook endpoint",description:"Delete an API-managed outbound webhook endpoint. If webhooks are repo-managed, Core returns 409 MANAGED_BY_CODE.",annotations:{readOnlyHint:!1,destructiveHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe(Sr),webhookId:a.string().describe(xa)},handler:async(t,e)=>{let n=await co(t,e.businessId);return t.managementDeleteWebhook(n,e.webhookId)}}},{opKey:"webhook.test",operationClass:"operate",scope:[so],sideEffect:"write",cli:{group:"webhook",command:"test",summary:"Send a signed test event to a webhook endpoint",args:[ao,rp],handler:async({client:t,args:e,emit:n})=>{let i=await t.managementTestWebhook(e.businessId,e.webhookId);n({businessId:e.businessId,result:i},"Webhook test sent")}},mcp:{tool:"fs_webhook_test",title:"Test webhook endpoint",description:"Send a signed test event to an API-managed webhook endpoint and persist the delivery result.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!0},inputSchema:{businessId:a.string().describe(Sr),webhookId:a.string().describe(xa)},handler:async(t,e)=>{let n=await co(t,e.businessId);return t.managementTestWebhook(n,e.webhookId)}}},{opKey:"webhook.delivery.read",operationClass:"operate",scope:[so],sideEffect:"read",cli:{group:"webhook",command:"deliveries",summary:"List recent delivery attempts for a webhook endpoint",args:[ao,rp,$R],handler:async({client:t,args:e,emit:n})=>{let i=await t.managementListWebhookDeliveries(e.businessId,e.webhookId,{limit:e.limit}),r=ER(i);n({businessId:e.businessId,webhookId:e.webhookId,count:r.length,total:TR(i,r.length),deliveries:r},`${r.length} delivery attempt(s)`)}},mcp:{tool:"fs_webhook_deliveries",title:"List webhook deliveries",description:"List recent delivery attempts for a webhook endpoint. Payload and response body are intentionally omitted by Core.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe(Sr),webhookId:a.string().describe(xa),limit:a.string().optional().describe("Max rows to return.")},handler:async(t,e)=>{let n=await co(t,e.businessId);return t.managementListWebhookDeliveries(n,e.webhookId,{limit:e.limit})}}}];var uo="The business id or slug.",Gn="operator",Ia={field:"businessId",kind:"positional",token:"<businessIdOrSlug>",describe:uo,resolveBusiness:!0};async function $a(t,e){return ve(t,e)}var OR=[{opKey:"agents.list",operationClass:"operate",scope:["businesses:read"],sideEffect:"read",cli:{group:"agents",command:"list",summary:"List a business's operating agents + enableable roles",args:[Ia],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=await t.builderListAgents(i);n({businessId:i,...r},`${r.agents.length} agent(s) \u2014 enableable roles: ${r.availableRoles.join(", ")}`)}},mcp:{tool:"fs_agents_list",title:"List operating agents",description:"The agent roster for a business: the enabled/disabled Operator plus any roles that can still be enabled. Read-only.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe(uo)},handler:async(t,e)=>{let n=await $a(t,e.businessId);return t.builderListAgents(n)}}},{opKey:"agents.status",operationClass:"operate",scope:["businesses:read"],sideEffect:"read",cli:{group:"agents",command:"status",summary:"The Operator's activation state, recent runs, and usage totals",args:[Ia],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=await t.builderAgentStatus(i,Gn);n({businessId:i,...r},`operator: ${r.enabled?"ENABLED":"disabled"} \u2014 last run ${r.lastRunAt??"never"}; ${r.recentRuns.length} recent run(s); ${r.usage.tokensIn+r.usage.tokensOut} tokens, ${r.usage.actionsCount} action(s) lifetime`)}},mcp:{tool:"fs_agents_status",title:"Get the Operator's status",description:"The Operator's activation state, recent run history (newest-first), and lifetime usage totals (LLM tokens + actions). Read-only.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe(uo)},handler:async(t,e)=>{let n=await $a(t,e.businessId);return t.builderAgentStatus(n,Gn)}}},{opKey:"agents.runs.show",operationClass:"operate",scope:["businesses:read"],sideEffect:"read",cli:{group:"agents",command:"runs-show",summary:"One run's full paper trail: trace, launches, action receipts",args:[Ia,{field:"runId",kind:"positional",token:"<runId>",describe:"The agent run id (from `agents status`)."}],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=await t.builderAgentRunDetail(i,Gn,e.runId),o=r.launches?.length??0,s=r.actions?.length??0;n({businessId:i,...r},`run ${r.run?.id}: ${o} launch(es), ${s} action receipt(s)`)}},mcp:{tool:"fs_agents_run_show",title:"Get one agent run's paper trail",description:"One run's full audit view: the orchestrator's trace summary (composed launches, verify flags, catalog changes), the per-launch performance ledger, and every platform-action receipt. Read-only.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe(uo),runId:a.string().describe("The agent run id.")},handler:async(t,e)=>{let n=await $a(t,e.businessId);return t.builderAgentRunDetail(n,Gn,e.runId)}}},{opKey:"agents.enable",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:"agents",command:"enable",summary:"Turn the Operator on (creates it on first enable)",args:[Ia],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=await t.builderConfigureAgent(i,Gn,{enabled:!0});n({businessId:i,agent:r},"operator ENABLED \u2014 it runs autonomously on its cadence and posts to the bulletin; usage bills while enabled")}},mcp:{tool:"fs_agents_enable",title:"Enable the Operator",description:"Turn the business's Operator agent on (created on first enable). It runs autonomously on its cadence; agent-work billing accrues while enabled.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe(uo)},handler:async(t,e)=>{let n=await $a(t,e.businessId);return t.builderConfigureAgent(n,Gn,{enabled:!0})}}},{opKey:"agents.disable",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:"agents",command:"disable",summary:"Turn the Operator off (stops runs + billing)",args:[Ia],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=await t.builderConfigureAgent(i,Gn,{enabled:!1});n({businessId:i,agent:r},"operator disabled \u2014 no further runs; billing stops accruing")}},mcp:{tool:"fs_agents_disable",title:"Disable the Operator",description:"Turn the Operator off: the dispatcher stops scheduling runs and agent-work billing stops accruing. Re-enable at any time.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe(uo)},handler:async(t,e)=>{let n=await $a(t,e.businessId);return t.builderConfigureAgent(n,Gn,{enabled:!1})}}}];var wa="The business id or slug.",sp="The bulletin post id.",ip={field:"businessId",kind:"positional",token:"<businessIdOrSlug>",describe:wa,resolveBusiness:!0},ly={field:"postId",kind:"positional",token:"<postId>",describe:sp};async function op(t,e){return ve(t,e)}var PR=[{opKey:"bulletin.list",operationClass:"operate",scope:["businesses:read"],sideEffect:"read",cli:{group:"bulletin",command:"list",summary:"List the agents' bulletin feed (trends + change requests)",args:[ip,{field:"kind",kind:"flag",token:"--kind <kind>",describe:"Filter: trend | insight | change_request"},{field:"status",kind:"flag",token:"--status <status>",describe:"Filter: open | acknowledged | resolved"},{field:"limit",kind:"flag",token:"--limit <n>",describe:"Max rows to return."}],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=await t.builderListBulletin(i,{kind:e.kind,status:e.status,limit:e.limit});n({businessId:i,...r},`${r.items.length} post(s)${r.nextCursor?" (more available)":""}`)}},mcp:{tool:"fs_bulletin_list",title:"List bulletin posts",description:"The agents' bulletin feed for a business: trend/insight posts (aggregated data + deltas) and change_request posts (the coding agent's backlog \u2014 filter --kind change_request --status open). Read-only.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe(wa),kind:a.enum(["trend","insight","change_request"]).optional().describe("Filter by post kind."),status:a.enum(["open","acknowledged","resolved"]).optional().describe("Filter by post status."),limit:a.string().optional().describe("Max rows to return.")},handler:async(t,e)=>{let n=await op(t,e.businessId);return t.builderListBulletin(n,{kind:e.kind,status:e.status,limit:e.limit})}}},{opKey:"bulletin.read",operationClass:"operate",scope:["businesses:read"],sideEffect:"read",cli:{group:"bulletin",command:"show",summary:"Show one bulletin post (full body + data payload)",args:[ip,ly],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=await t.builderGetBulletinPost(i,e.postId);n({businessId:i,post:r},`[${r.kind}] ${r.title} \u2014 ${r.status}${r.changeSetId?` (changeSet ${r.changeSetId})`:""}`)}},mcp:{tool:"fs_bulletin_show",title:"Show a bulletin post",description:"One bulletin post in full: markdown body, the dataJson payload backing the claim, and for change requests the referenced ChangeSet id + proposal. Read-only.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe(wa),postId:a.string().describe(sp)},handler:async(t,e)=>{let n=await op(t,e.businessId);return t.builderGetBulletinPost(n,e.postId)}}},{opKey:"bulletin.ack",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:"bulletin",command:"ack",summary:"Acknowledge a post (the coding agent picked it up)",args:[ip,ly],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=await t.builderSetBulletinStatus(i,e.postId,"acknowledged");n({businessId:i,post:r},`Post acknowledged: ${r.title}`)}},mcp:{tool:"fs_bulletin_ack",title:"Acknowledge a bulletin post",description:"Mark a bulletin post acknowledged \u2014 the hand-off signal that the coding agent (or builder) has picked the item up. Forward-only; idempotent on an already-acknowledged post.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe(wa),postId:a.string().describe(sp)},handler:async(t,e)=>{let n=await op(t,e.businessId);return t.builderSetBulletinStatus(n,e.postId,"acknowledged")}}},{opKey:"bulletin.resolve",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:"bulletin",command:"resolve",summary:"Resolve a post (the work landed)",args:[ip,ly],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=await t.builderSetBulletinStatus(i,e.postId,"resolved");n({businessId:i,post:r},`Post resolved: ${r.title}`)}},mcp:{tool:"fs_bulletin_resolve",title:"Resolve a bulletin post",description:"Mark a bulletin post resolved \u2014 the referenced work landed (or the trend was addressed). Terminal state.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe(wa),postId:a.string().describe(sp)},handler:async(t,e)=>{let n=await op(t,e.businessId);return t.builderSetBulletinStatus(n,e.postId,"resolved")}}}];var lo="The business id or slug.",cp="The promo code id.",py=["percent_off","amount_off","free_months"],Ea="promo-code",Ta={field:"businessId",kind:"positional",token:"<businessIdOrSlug>",describe:lo,resolveBusiness:!0},dy={field:"promoCodeId",kind:"positional",token:"<promoCodeId>",describe:cp},AR={field:"plan",kind:"flag",token:"--plan <planId>",describe:"Limit to a plan id. Repeatable. Omit for all launch plans; use --all-plans on update to clear scoped plans.",parser:(t,e)=>[...e,t],defaultValue:[]};function NR(t){if(typeof t!="string")return;let e=t.trim().toLowerCase();if(py.includes(e))return e;throw new P(`Invalid promo code kind "${t}". Use percent_off, amount_off, or free_months.`,400,{code:"INVALID_PROMO_CODE_KIND",param:"kind"})}function po(t,e){if(e===void 0)return;let n=typeof e=="number"?e:typeof e=="string"&&/^\d+$/.test(e.trim())?Number.parseInt(e,10):Number.NaN;if(!Number.isInteger(n)||n<=0)throw new P(`${t} must be a positive integer.`,400,{code:"INVALID_PROMO_CODE_FIELD",param:t});return n}function Oa(t){return typeof t=="string"&&t.length>0?t:void 0}function CR(t,e){let n=po("percent",t.percent),i=po("amountCents",t.amountCents);if(n!==void 0&&i!==void 0)throw new P("Pass either --percent or --amount-cents, not both.",400,{code:"CONFLICTING_PROMO_AMOUNT_FLAGS",param:"amount"});if(e==="percent_off"){if(n===void 0)throw new P("percent_off promo codes require --percent.",400,{code:"INVALID_PROMO_CODE_FIELD",param:"percent"});if(n>100)throw new P("--percent must be between 1 and 100.",400,{code:"INVALID_PROMO_CODE_FIELD",param:"percent"});return n}if(e==="amount_off"){if(i===void 0)throw new P("amount_off promo codes require --amount-cents.",400,{code:"INVALID_PROMO_CODE_FIELD",param:"amountCents"});return i}if(e==="free_months"&&(n!==void 0||i!==void 0))throw new P("free_months promo codes do not accept --percent or --amount-cents.",400,{code:"INVALID_PROMO_CODE_FIELD",param:"amount"});return n??i}function zR(t){let e=t.plan??[];if(t.allPlans===!0&&e.length>0)throw new P("Pass either --plan or --all-plans, not both.",400,{code:"CONFLICTING_PROMO_PLAN_FLAGS",param:"plan"});return t.allPlans===!0?[]:e.length>0?e:void 0}function Y6(t){let e=NR(t.kind);if(!e)throw new P("Promo code kind is required.",400,{code:"INVALID_PROMO_CODE_FIELD",param:"kind"});let n=po("durationMonths",t.durationMonths);if(n===void 0)throw new P("--duration-months is required.",400,{code:"INVALID_PROMO_CODE_FIELD",param:"durationMonths"});let i=zR(t);return{code:String(t.code),kind:e,amount:CR(t,e),durationMonths:n,...i!==void 0?{applicablePlanIds:i}:{},maxRedemptions:po("maxRedemptions",t.maxRedemptions),activeFrom:Oa(t.activeFrom),activeUntil:Oa(t.activeUntil)}}function X6(t){let e=NR(t.kind),n=po("durationMonths",t.durationMonths),i=po("maxRedemptions",t.maxRedemptions),r=zR(t);if(t.code!==void 0||e!==void 0||t.percent!==void 0||t.amountCents!==void 0||n!==void 0||i!==void 0||t.clearMaxRedemptions===!0||t.activeFrom!==void 0||t.activeUntil!==void 0||t.clearActiveFrom===!0||t.clearActiveUntil===!0||r!==void 0){if(e===void 0)throw new P("Promo-code spec updates rotate the Stripe coupon, so pass the complete spec: --kind plus --duration-months and the required amount flag for that kind.",400,{code:"PROMO_CODE_UPDATE_REQUIRES_FULL_SPEC",param:"kind"});if(n===void 0)throw new P("Promo-code spec updates require --duration-months.",400,{code:"PROMO_CODE_UPDATE_REQUIRES_FULL_SPEC",param:"durationMonths"})}let s={},c=Oa(t.code);c!==void 0&&(s.code=c),e!==void 0&&(s.kind=e);let u=CR(t,e);if(u!==void 0&&(s.amount=u),n!==void 0&&(s.durationMonths=n),i!==void 0&&(s.maxRedemptions=i),t.clearMaxRedemptions===!0&&(s.maxRedemptions=null),r!==void 0&&(s.applicablePlanIds=r),t.activeFrom!==void 0&&(s.activeFrom=Oa(t.activeFrom)??null),t.activeUntil!==void 0&&(s.activeUntil=Oa(t.activeUntil)??null),t.clearActiveFrom===!0&&(s.activeFrom=null),t.clearActiveUntil===!0&&(s.activeUntil=null),Object.keys(s).length===0)throw new P("No promo-code fields to update. Pass --code, --kind, amount, duration, plan, status-window, or redemption flags.",400,{code:"PROMO_CODE_UPDATE_NO_FIELDS"});return s}async function Ra(t,e){return ve(t,e)}function ap(t){return{status:t}}var DR=[{opKey:"promo_code.read",operationClass:"operate",scope:["businesses:read"],sideEffect:"read",cli:{group:Ea,command:"list",summary:"List API-managed promo codes for checkout",args:[Ta],handler:async({client:t,args:e,emit:n})=>{let i=await t.listPromoCodes(e.businessId);n({businessId:e.businessId,count:i.length,promoCodes:i},`${i.length} promo code(s)`)}},mcp:{tool:"fs_promo_code_list",title:"List promo codes",description:"List API-managed promo codes for a business. Promo codes are checkout operational state, not repo-authored Business SDK state.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe(lo)},handler:async(t,e)=>{let n=await Ra(t,e.businessId);return t.listPromoCodes(n)}}},{opKey:"promo_code.create",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:Ea,command:"create",summary:"Create an API-managed checkout promo code",args:[Ta,{field:"code",kind:"flag",token:"--code <code>",describe:"Customer-entered promo code.",required:!0},{field:"kind",kind:"flag",token:"--kind <kind>",describe:"percent_off, amount_off, or free_months.",required:!0},{field:"percent",kind:"flag",token:"--percent <n>",describe:"Percent discount for percent_off promos."},{field:"amountCents",kind:"flag",token:"--amount-cents <cents>",describe:"Fixed discount in cents for amount_off promos."},{field:"durationMonths",kind:"flag",token:"--duration-months <n>",describe:"Discount duration in months.",required:!0},{field:"maxRedemptions",kind:"flag",token:"--max-redemptions <n>",describe:"Optional maximum redemption count."},{field:"activeFrom",kind:"flag",token:"--active-from <iso>",describe:"Optional ISO-8601 activation timestamp."},{field:"activeUntil",kind:"flag",token:"--active-until <iso>",describe:"Optional ISO-8601 expiration timestamp."},AR],handler:async({client:t,args:e,emit:n})=>{let i=await t.createPromoCode(e.businessId,Y6(e));n({businessId:e.businessId,promoCode:i},"Promo code created")}},mcp:{tool:"fs_promo_code_create",title:"Create promo code",description:"Create an API-managed checkout promo code. Use percent for percent_off, amountCents for amount_off, and no amount for free_months.",annotations:{readOnlyHint:!1,destructiveHint:!1,openWorldHint:!0},inputSchema:{businessId:a.string().describe(lo),code:a.string().min(1).max(64),kind:a.enum(py),percent:a.number().int().min(1).max(100).optional(),amountCents:a.number().int().positive().optional(),durationMonths:a.number().int().min(1).max(24),maxRedemptions:a.number().int().positive().optional(),activeFrom:a.string().datetime().optional(),activeUntil:a.string().datetime().optional(),applicablePlanIds:a.array(a.string()).optional()},handler:async(t,e)=>{let n=await Ra(t,e.businessId);return t.createPromoCode(n,{code:e.code,kind:e.kind,amount:e.kind==="percent_off"?e.percent:e.kind==="amount_off"?e.amountCents:void 0,durationMonths:e.durationMonths,maxRedemptions:e.maxRedemptions,activeFrom:e.activeFrom,activeUntil:e.activeUntil,applicablePlanIds:e.applicablePlanIds})}}},{opKey:"promo_code.update",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:Ea,command:"update",summary:"Update an API-managed checkout promo code",args:[Ta,dy,{field:"code",kind:"flag",token:"--code <code>",describe:"Replacement customer-entered promo code."},{field:"kind",kind:"flag",token:"--kind <kind>",describe:"percent_off, amount_off, or free_months."},{field:"percent",kind:"flag",token:"--percent <n>",describe:"Percent discount for percent_off promos."},{field:"amountCents",kind:"flag",token:"--amount-cents <cents>",describe:"Fixed discount in cents for amount_off promos."},{field:"durationMonths",kind:"flag",token:"--duration-months <n>",describe:"Discount duration in months."},{field:"maxRedemptions",kind:"flag",token:"--max-redemptions <n>",describe:"Set maximum redemption count."},{field:"clearMaxRedemptions",kind:"flag",token:"--clear-max-redemptions",describe:"Clear the maximum redemption count."},{field:"activeFrom",kind:"flag",token:"--active-from <iso>",describe:"Set ISO-8601 activation timestamp."},{field:"clearActiveFrom",kind:"flag",token:"--clear-active-from",describe:"Clear activation timestamp."},{field:"activeUntil",kind:"flag",token:"--active-until <iso>",describe:"Set ISO-8601 expiration timestamp."},{field:"clearActiveUntil",kind:"flag",token:"--clear-active-until",describe:"Clear expiration timestamp."},AR,{field:"allPlans",kind:"flag",token:"--all-plans",describe:"Clear plan scoping so the promo applies to all launch plans."}],handler:async({client:t,args:e,emit:n})=>{let i=await t.updatePromoCode(e.businessId,e.promoCodeId,X6(e));n({businessId:e.businessId,promoCode:i},"Promo code updated")}},mcp:{tool:"fs_promo_code_update",title:"Update promo code",description:"Update an API-managed checkout promo code. Spec changes rotate the Stripe coupon/promotion code behind the scenes.",annotations:{readOnlyHint:!1,destructiveHint:!1,openWorldHint:!0},inputSchema:{businessId:a.string().describe(lo),promoCodeId:a.string().describe(cp),code:a.string().min(1).max(64).optional(),kind:a.enum(py).optional(),percent:a.number().int().min(1).max(100).optional(),amountCents:a.number().int().positive().optional(),durationMonths:a.number().int().min(1).max(24).optional(),maxRedemptions:a.number().int().positive().nullable().optional(),activeFrom:a.string().datetime().nullable().optional(),activeUntil:a.string().datetime().nullable().optional(),applicablePlanIds:a.array(a.string()).optional()},handler:async(t,e)=>{let n=await Ra(t,e.businessId),i={code:e.code,kind:e.kind,amount:e.kind==="percent_off"?e.percent:e.kind==="amount_off"?e.amountCents:void 0,durationMonths:e.durationMonths,maxRedemptions:e.maxRedemptions,activeFrom:e.activeFrom,activeUntil:e.activeUntil,applicablePlanIds:e.applicablePlanIds};return t.updatePromoCode(n,e.promoCodeId,i)}}},{opKey:"promo_code.archive",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:Ea,command:"archive",summary:"Archive a checkout promo code",args:[Ta,dy],handler:async({client:t,args:e,emit:n})=>{let i=await t.updatePromoCode(e.businessId,e.promoCodeId,ap("ARCHIVED"));n({businessId:e.businessId,promoCode:i},"Promo code archived")}},mcp:{tool:"fs_promo_code_archive",title:"Archive promo code",description:"Archive an API-managed checkout promo code.",annotations:{readOnlyHint:!1,destructiveHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe(lo),promoCodeId:a.string().describe(cp)},handler:async(t,e)=>{let n=await Ra(t,e.businessId);return t.updatePromoCode(n,e.promoCodeId,ap("ARCHIVED"))}}},{opKey:"promo_code.reactivate",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:Ea,command:"reactivate",summary:"Reactivate an archived checkout promo code",args:[Ta,dy],handler:async({client:t,args:e,emit:n})=>{let i=await t.updatePromoCode(e.businessId,e.promoCodeId,ap("ACTIVE"));n({businessId:e.businessId,promoCode:i},"Promo code reactivated")}},mcp:{tool:"fs_promo_code_reactivate",title:"Reactivate promo code",description:"Reactivate an archived API-managed checkout promo code.",annotations:{readOnlyHint:!1,destructiveHint:!1,openWorldHint:!1},inputSchema:{businessId:a.string().describe(lo),promoCodeId:a.string().describe(cp)},handler:async(t,e)=>{let n=await Ra(t,e.businessId);return t.updatePromoCode(n,e.promoCodeId,ap("ACTIVE"))}}}];var Pa="The business id or slug.",dp="The subscriber id from `consumer list`.",up={field:"businessId",kind:"positional",token:"<businessIdOrSlug>",describe:Pa,resolveBusiness:!0},my={field:"subscriberId",kind:"positional",token:"<subscriberId>",describe:dp},Q6={field:"env",kind:"flag",token:"--env <env>",describe:"Environment name for preview-scoped consumers."},jR="The member's external identity id (Clerk userId) within the client org.",eZ="Comma-separated business-role keys to set (replaces the current assignment; pass an empty string to clear).",tZ={field:"userExternalId",kind:"positional",token:"<userExternalId>",describe:jR};function nZ(t){return t.split(",").map(e=>e.trim()).filter(Boolean)}var rZ={field:"roles",kind:"flag",token:"--roles <roles>",describe:eZ,required:!0,parser:t=>nZ(t)};async function lp(t,e){return ve(t,e)}function iZ(t){return Array.isArray(t)?t:[]}var UR=[{opKey:"consumer.read",operationClass:"operate",scope:["businesses:read"],sideEffect:"read",cli:{group:"consumer",command:"list",summary:"List users/consumers for a business",args:[up,Q6],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=iZ(await t.builderListConsumers(i,{env:e.env}));n({businessId:i,count:r.length,consumers:r},`${r.length} consumer(s)`)}},mcp:{tool:"fs_consumer_list",title:"List business consumers",description:"List users/consumers for a business. Read-only; use this to discover subscriber ids before blocking or removing a user.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe(Pa),env:a.string().optional().describe("Environment name for preview-scoped consumers.")},handler:async(t,e)=>{let n=await lp(t,e.businessId);return t.builderListConsumers(n,{env:e.env})}}},{opKey:"consumer.block",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:"consumer",command:"block",summary:"Block a user and revoke their active API keys",destructive:!0,yesMessage:"Blocking a user revokes active API keys. Pass --yes to confirm.",args:[up,my],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=e.subscriberId,o=await t.builderBlockConsumer(i,r);n({businessId:i,subscriberId:r,result:o},`Consumer blocked: ${r}`)}},mcp:{tool:"fs_consumer_block",title:"Block business consumer",description:"Block a user/consumer for a business and revoke their active API keys. Destructive live-state operation; it does not edit repo-authored business behavior.",annotations:{readOnlyHint:!1,destructiveHint:!0,idempotentHint:!0,openWorldHint:!0},inputSchema:{businessId:a.string().describe(Pa),subscriberId:a.string().describe(dp)},handler:async(t,e)=>{let n=await lp(t,e.businessId);return t.builderBlockConsumer(n,e.subscriberId)}}},{opKey:"consumer.remove",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:"consumer",command:"remove",summary:"Force-remove a user from a business",destructive:!0,yesMessage:"Removing a user tears down subscriptions, edge credentials, and related live state. Pass --yes to confirm.",args:[up,my],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=e.subscriberId,o=await t.builderRemoveConsumer(i,r);n({businessId:i,subscriberId:r,result:o},`Consumer removed: ${r}`)}},mcp:{tool:"fs_consumer_remove",title:"Remove business consumer",description:"Force-remove a user/consumer from a business, tearing down subscriptions, edge credentials, and related live state. Destructive and irreversible; it does not edit repo-authored business behavior.",annotations:{readOnlyHint:!1,destructiveHint:!0,openWorldHint:!0},inputSchema:{businessId:a.string().describe(Pa),subscriberId:a.string().describe(dp)},handler:async(t,e)=>{let n=await lp(t,e.businessId);return t.builderRemoveConsumer(n,e.subscriberId)}}},{opKey:"consumer.roles.assign",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:"consumer rbac",command:"assign",summary:"Replace a client-org member's Managed-RBAC business roles (builder support override)",args:[up,my,tZ,rZ],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=e.subscriberId,o=e.userExternalId,s=e.roles,c=await t.builderAssignConsumerMemberRoles(i,r,o,s);n({businessId:i,subscriberId:r,membership:c},`Business roles set for ${o}: ${c.businessRoleKeys.length>0?c.businessRoleKeys.join(", "):"(none)"}`)}},mcp:{tool:"fs_consumer_rbac_assign",title:"Assign consumer member business roles",description:"Support override: replace a client-org member's Managed-RBAC business-role assignment on a business (set-replace \u2014 the given list becomes the member's full assignment; an empty list clears it). Role keys must exist in the org's role set. Live-state operation; it does not edit repo-authored business behavior.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!0},inputSchema:{businessId:a.string().describe(Pa),subscriberId:a.string().describe(dp),userExternalId:a.string().describe(jR),roles:a.array(a.string()).describe("Business-role keys to set (replaces the current assignment; [] clears it).")},handler:async(t,e)=>{let n=await lp(t,e.businessId);return t.builderAssignConsumerMemberRoles(n,e.subscriberId,e.userExternalId,e.roles)}}}];var gy="The business id or slug.",by="Preview environment slug or id (omit for Main).",LR="Variable name, e.g. POSTHOG_TOKEN.",oZ=a.enum(["PUBLIC","BUILD","RUNTIME"]),sZ="Where the value goes. public = inlined into the frontend BUNDLE (publishable keys: PostHog project key, Stripe pk_, Sentry DSN); build = build environment only, leak-scanned out of the output; runtime = edge only, never reaches the browser.";async function aZ(){if(process.stdin.isTTY)throw new P("Pipe the secret value via stdin. Never pass a secret as a command-line flag.",400,{code:"VARIABLE_STDIN_REQUIRED"});let t="";for await(let e of process.stdin)t+=Buffer.isBuffer(e)?e.toString("utf8"):String(e);return t.replace(/\r?\n$/,"")}var cZ=aZ;async function pp(t,e,n){return n?ro(t,e,n):void 0}var Aa={field:"businessId",kind:"positional",token:"<businessIdOrSlug>",describe:gy,resolveBusiness:!0},fy={field:"name",kind:"positional",token:"<name>",describe:LR},mp={field:"env",kind:"flag",token:"--env <slug>",describe:by},uZ={field:"delivery",kind:"flag",token:"--delivery <phase>",describe:"Private delivery boundary: build or runtime. Build values are leak-scanned from artifacts; runtime values are injected only by Gateway.",required:!0};function hy(t,e){return{businessId:t,operation:e}}function MR(t){return{opKey:t==="set"?"business_variable.create":"business_variable.rotate",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:"variables",command:t,summary:t==="set"?"Create a write-only secret from stdin":"Rotate a write-only secret from stdin",helpTextAfter:`
|
|
98
|
+
`,handler:async({client:t,args:e,reqOpts:n,emit:i,emitDryRunPreview:r})=>{let o=e.businessId,s=e.planKey,c=e.policy;if(!ap.includes(c))throw new A(`Invalid --policy "${c}". Supported: ${ap.join(", ")}.`,void 0,{code:"INVALID_MIGRATION_POLICY"});let u=await t.migratePlan(o,s,{fromVersion:e.from,toVersion:e.to,policy:c,proration:e.proration,completeBy:e.completeBy},n);r(u)||i({businessId:o,planKey:s,migration:u},`Migration scheduled for plan ${s}`)}},mcp:{tool:"fs_plan_migrate",title:"Migrate subscribers between plan versions",description:"Schedule a subscriber migration for a plan: move subscribers from one plan version to another under a policy. Pass the plan KEY plus fromVersion/toVersion (each an integer or 'head'/'latest') \u2014 the server resolves them to the right plan versions. Policies: next_renewal (migrate at each subscriber's renewal), immediate (migrate now), by_date (migrate everyone by a deadline), or opt_in (subscribers choose). This is an OPERATE action (it changes live subscriber state, not the business's code-managed definition).",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe("The business id whose subscribers to migrate."),planKey:a.string().describe("The stable plan key (e.g. 'pro') to migrate within."),fromVersion:a.union([a.string(),a.number().int().positive()]).describe("Source plan version: an integer or 'head'/'latest'."),toVersion:a.union([a.string(),a.number().int().positive()]).describe("Target plan version: an integer or 'head'/'latest'."),policy:a.enum(ap).describe("Migration policy: next_renewal | immediate | by_date | opt_in."),proration:a.enum(["none","prorate","credit"]).optional().describe("Optional proration behaviour."),completeBy:a.string().optional().describe("ISO 8601 deadline \u2014 required by the by_date policy."),...Ae},handler:async(t,e)=>t.migratePlan(e.businessId,e.planKey,{fromVersion:e.fromVersion,toVersion:e.toVersion,policy:e.policy,proration:e.proration,completeBy:e.completeBy},{idempotencyKey:e.idempotencyKey})}}],$R=dZ;function pZ(t){if(!t||typeof t!="object")return[];let e=t;return Array.isArray(e.data)?e.data:Array.isArray(e.environments)?e.environments:[]}var wR=[{opKey:"environment.read",operationClass:"operate",scope:["businesses:read"],sideEffect:"read",cli:{group:"env",command:"list",summary:"List environments for a business",args:[{field:"businessId",kind:"positional",token:"<businessIdOrName>",resolveBusiness:!0}],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=pZ(await t.listEnvironments(i));n({businessId:i,count:r.length,environments:r.map(o=>({id:o.id,name:o.name,branch:o.branch??null,portalHostname:o.portalHostname??null,runtimeHostname:o.runtimeHostname??null,status:o.status??null}))},`${r.length} environment(s)`)}},mcp:{tool:"fs_env_list",title:"List environments",description:"List a business's preview environments (name, branch, hostnames). Read-only.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe("The business id whose environments to list.")},handler:async(t,{businessId:e})=>t.listEnvironments(e)}},{opKey:"environment.create",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:"env",command:"create",summary:"Create a preview environment bound to a git branch",idempotent:!0,args:[{field:"businessId",kind:"positional",token:"<businessIdOrName>",resolveBusiness:!0},{field:"name",kind:"flag",token:"--name <name>",describe:"Environment name (e.g. preview, staging)",required:!0},{field:"branch",kind:"flag",token:"--branch <branch>",describe:"Git branch to track (e.g. env/preview)",required:!0}],handler:async({client:t,args:e,reqOpts:n,emit:i,emitDryRunPreview:r})=>{let o=e.businessId,s=await t.createEnvironment(o,{name:e.name,branch:e.branch},n);r(s)||i({businessId:o,environment:s},`Environment ${e.name} created`)}},mcp:{tool:"fs_env_create",title:"Create preview environment",description:"Create a preview environment bound to a git branch. Provide a name and the git branch it tracks.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1},inputSchema:{businessId:a.string().describe("The business id to create the environment in."),name:a.string().describe("Environment name (e.g. 'staging', 'preview-pr-42')."),branch:a.string().describe("The git branch this environment tracks."),...Ae},handler:async(t,e)=>{let n=await t.createEnvironment(e.businessId,{name:e.name,branch:e.branch},{idempotencyKey:e.idempotencyKey});return{ok:!0,businessId:e.businessId,environment:n}}}},{opKey:"environment.delete",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:"env",command:"delete",summary:"Delete an environment by name. Requires --yes.",destructive:!0,yesMessage:"Pass --yes to confirm environment deletion.",args:[{field:"businessId",kind:"positional",token:"<businessIdOrName>",resolveBusiness:!0},{field:"envName",kind:"positional",token:"<envName>"}],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=e.envName;await t.deleteEnvironment(i,r),n({businessId:i,deleted:r},`Environment ${r} deleted`)}},mcp:null}];async function uo(t,e,n){let r=await t.listEnvironments(e),s=(Array.isArray(r.data)?r.data:Array.isArray(r.environments)?r.environments:[]).find(c=>c.name.toLowerCase()===n.toLowerCase()||c.id===n);if(!s)throw new Error(`Environment "${n}" not found on business ${e}.`);return s.id}var I_=["gateway_verification","metering","health","tunnel"],mZ="<businessId>",lo="businesses:update",po="The business id.",Yn={field:"businessId",kind:"positional",token:mZ};function ER(t){if(!t||typeof t!="object")return[];let e=t;return Array.isArray(e.data)?e.data:Array.isArray(e.backends)?e.backends:Array.isArray(e.tokens)?e.tokens:Array.isArray(t)?t:[]}function fZ(t){let e=t.status;if(typeof e=="string"&&e.length>0)return e;let n=typeof t.readinessState=="string"?t.readinessState:null,i=typeof t.provisionStatus=="string"?t.provisionStatus:null;return n??i??"unknown"}function gZ(t){return{id:t.id,environmentId:t.environmentId??null,name:t.name,slug:t.slug,transport:t.transportMode,default:t.isDefault??!1,status:fZ(t),originUrl:t.originUrl??null,lastSeenAt:t.lastSeenAt??null}}async function $_(t,e,n){if(!n)return null;try{return await uo(t,e,n)}catch(i){throw new A(i instanceof Error?i.message:`Environment "${n}" not found on business ${e}.`,void 0,{code:"ENV_NOT_FOUND"})}}var w_=t=>typeof t=="string"&&t.length>0?t.split(",").map(e=>e.trim()).filter(e=>e.length>0):void 0,TR=[{opKey:"backend.read",operationClass:"operate",scope:["businesses:read"],sideEffect:"read",cli:{group:"backend",command:"list",summary:"List backends for a business (id, name, transport, status)",args:[Yn],handler:async({client:t,args:e,emit:n})=>{let r=ER(await t.builderListBackends(e.businessId)).map(gZ);n({count:r.length,backends:r},`${r.length} backend(s)`)}},mcp:{tool:"fs_backend_list",title:"List backends",description:"List a business's backends (origins) \u2014 id, name, slug, transport (direct|tunnel), default flag, and derived status. Read-only.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe("The business id whose backends to list.")},handler:async(t,{businessId:e})=>t.builderListBackends(e)}},{opKey:"backend.create",operationClass:"operate",scope:[lo],sideEffect:"write",cli:{group:"backend",command:"create",summary:"Create a backend (default transport: direct)",idempotent:!0,args:[Yn,{field:"name",kind:"flag",token:"--name <name>",describe:"Human-friendly backend name",required:!0},{field:"slug",kind:"flag",token:"--slug <slug>",describe:"Stable slug (defaults to a slugified name)"},{field:"env",kind:"flag",token:"--env <environment>",describe:"Scope backend to an environment name or id"},{field:"transport",kind:"flag",token:"--transport <mode>",describe:"Transport mode: direct | tunnel",defaultValue:"direct"},{field:"runner",kind:"flag",token:"--runner <runner>",describe:"embedded | sidecar"},{field:"runtime",kind:"flag",token:"--runtime <runtime>",describe:"Container/runtime descriptor"},{field:"originUrl",kind:"flag",token:"--origin-url <url>",describe:"Builder origin URL (direct)"},{field:"default",kind:"flag",token:"--default",describe:"Mark this backend the business default"}],handler:async({client:t,args:e,reqOpts:n,emit:i,emitDryRunPreview:r})=>{let o=e.businessId,s=await $_(t,o,e.env),c=e.transport==="tunnel"?"tunnel":"direct",u=await t.builderCreateBackend(o,{name:e.name,slug:e.slug,environmentId:s,transportMode:c,runner:e.runner==="embedded"||e.runner==="sidecar"?e.runner:null,runtime:e.runtime??null,originUrl:e.originUrl??null,isDefault:e.default},n);r(u)||i({result:u},"Backend created")}},mcp:{tool:"fs_backend_create",title:"Create a backend",description:"Create a backend (origin) for a business. Pick a transport mode: direct (public HTTPS URL, secured by Ed25519 request signing) or tunnel (private outbound-only cloudflared, secure bring-your-own-backend). Mark it default to route traffic to it.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1},inputSchema:{businessId:a.string().describe("The business id to create the backend in."),name:a.string().describe("Backend name (e.g. 'prod-origin')."),slug:a.string().optional().describe("URL-safe slug; derived from name if omitted."),transportMode:a.enum(["direct","tunnel"]).optional().describe("How the gateway reaches the origin; defaults to direct."),originUrl:a.string().optional().describe("The origin URL (for direct mode)."),isDefault:a.boolean().optional().describe("Route traffic to this backend by default."),...Ae},handler:async(t,e)=>t.builderCreateBackend(e.businessId,{name:e.name,slug:e.slug,transportMode:e.transportMode,originUrl:e.originUrl,isDefault:e.isDefault},{idempotencyKey:e.idempotencyKey})}},{opKey:"backend.bind",operationClass:"operate",scope:[lo],sideEffect:"write",cli:{group:"backend",command:"bind",summary:"Bind a logical backend to a direct upstream in one environment",idempotent:!0,args:[Yn,{field:"backend",kind:"positional",token:"<backend>"},{field:"env",kind:"flag",token:"--env <environment>",describe:"Environment name or id (omit for production)"},{field:"originUrl",kind:"flag",token:"--origin-url <url>",describe:"Concrete direct upstream URL for this environment",required:!0}],handler:async({client:t,args:e,reqOpts:n,emit:i,emitDryRunPreview:r})=>{let o=e.businessId,s=e.backend,c=await $_(t,o,e.env),u=await t.builderBindBackend(o,s,{environmentId:c,originUrl:e.originUrl},n);r(u)||i({result:u},`Backend ${s} bound in ${c??"production"}`)}},mcp:{tool:"fs_backend_bind",title:"Bind a backend upstream",description:"Bind a logical backend id to a concrete direct upstream URL in one environment. Omit environmentId for production.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe(po),backend:a.string().describe("Logical backend slug."),environmentId:a.string().optional().describe("Preview environment id; omit for production."),originUrl:a.string().url().describe("Concrete direct upstream URL."),...Ae},handler:async(t,e)=>t.builderBindBackend(e.businessId,e.backend,{environmentId:e.environmentId??null,originUrl:e.originUrl},{idempotencyKey:e.idempotencyKey})}},{opKey:"backend.delete",operationClass:"operate",scope:[lo],sideEffect:"write",cli:{group:"backend",command:"delete",summary:"Delete a backend (revokes its runtime tokens). Requires --yes.",destructive:!0,yesMessage:"Pass --yes to confirm backend deletion.",args:[Yn,{field:"backendId",kind:"positional",token:"<backendId>"}],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=e.backendId;await t.builderDeleteBackend(i,r),n({businessId:i,deleted:r},`Backend ${r} deleted`)}},mcp:{tool:"fs_backend_delete",title:"Delete a backend",description:"Delete a backend (origin). Traffic routed to it stops; re-create to restore.",annotations:{readOnlyHint:!1,destructiveHint:!0,idempotentHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe(po),backendId:a.string().describe("The backend id to delete.")},handler:async(t,{businessId:e,backendId:n})=>t.builderDeleteBackend(e,n)}},{opKey:"runtime_token.read",operationClass:"operate",scope:["businesses:read"],sideEffect:"read",cli:{group:"backend tokens",command:"list",summary:"List runtime tokens for a business",args:[Yn],handler:async({client:t,args:e,emit:n})=>{let i=ER(await t.builderListRuntimeTokens(e.businessId));n({count:i.length,tokens:i},`${i.length} runtime token(s)`)}},mcp:{tool:"fs_runtime_token_list",title:"List runtime tokens",description:"List a business's runtime tokens (fsrt_) \u2014 id, last-four, operations, status. Read-only; secrets are never shown.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe(po)},handler:async(t,{businessId:e})=>t.builderListRuntimeTokens(e)}},{opKey:"runtime_token.mint",operationClass:"operate",scope:[lo],sideEffect:"write",cli:{group:"backend tokens",command:"create",summary:"Create a runtime token (returns FS_RUNTIME_TOKEN once)",idempotent:!0,args:[Yn,{field:"env",kind:"flag",token:"--env <environment>",describe:"Scope token to an environment name or id"},{field:"backend",kind:"flag",token:"--backend <backendId>",describe:"Bind token to a specific backend"},{field:"kind",kind:"flag",token:"--kind <kind>",describe:"live | test (defaults from env scope)"},{field:"operations",kind:"flag",token:"--operations <list>",describe:`Comma-separated operations: ${I_.join(" | ")}. Default: core's DEFAULT_OPERATIONS. Use tunnel for tunnel backends.`},{field:"meters",kind:"flag",token:"--meters <list>",describe:"Comma-separated allowed meters (default: all business meters)"},{field:"routes",kind:"flag",token:"--routes <list>",describe:"Comma-separated allowed routes"}],handler:async({client:t,args:e,reqOpts:n,emit:i,emitDryRunPreview:r})=>{let o=e.businessId,s=await $_(t,o,e.env),c=e.kind==="test"||e.kind==="live"?e.kind:void 0,u=w_(e.operations);if(u){for(let p of u)if(!I_.includes(p))throw new A(`Unknown operation "${p}". Available: ${I_.join(", ")}.`,void 0,{code:"UNKNOWN_RUNTIME_TOKEN_OPERATION"})}let l=await t.builderCreateRuntimeToken(o,{environmentId:s,backendId:e.backend??null,kind:c,operations:u,allowedMeters:w_(e.meters),allowedRoutes:w_(e.routes)},n);r(l)||i({envVar:"FS_RUNTIME_TOKEN",result:l},"Runtime token created")}},mcp:{tool:"fs_runtime_token_mint",title:"Mint a runtime token",description:"Mint a new runtime token (fsrt_) for a backend. Returns the plaintext token ONCE \u2014 store it now (e.g. as FS_RUNTIME_TOKEN). Operations default to the backend's needs (gateway_verification, metering, health).",returnsOneTimeSecret:!0,annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1},inputSchema:{businessId:a.string().describe(po),backendId:a.string().optional().describe("Bind the token to this backend."),environmentId:a.string().optional().describe("Scope to a preview environment (omit for production)."),kind:a.enum(["live","test"]).optional().describe("Token kind; defaults from the env scope."),operations:a.array(a.string()).optional().describe("Operations (gateway_verification, metering, health, tunnel)."),...Ae},handler:async(t,e)=>t.builderCreateRuntimeToken(e.businessId,{backendId:e.backendId??null,environmentId:e.environmentId??null,kind:e.kind,operations:e.operations},{idempotencyKey:e.idempotencyKey})}},{opKey:"runtime_token.rotate",operationClass:"operate",scope:[lo],sideEffect:"write",cli:{group:"backend tokens",command:"rotate",summary:"Rotate a runtime token (returns a fresh FS_RUNTIME_TOKEN once)",args:[Yn,{field:"tokenId",kind:"positional",token:"<tokenId>"}],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=e.tokenId,o=await t.builderRotateRuntimeToken(i,r);n({envVar:"FS_RUNTIME_TOKEN",result:o},`Runtime token ${r} rotated`)}},mcp:{tool:"fs_runtime_token_rotate",title:"Rotate a runtime token",description:"Rotate a runtime token: mint a fresh secret carrying the same scope and revoke the old one. Returns the new plaintext token ONCE.",returnsOneTimeSecret:!0,annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1},inputSchema:{businessId:a.string().describe(po),tokenId:a.string().describe("The runtime token id to rotate."),...Ae},handler:async(t,e)=>t.builderRotateRuntimeToken(e.businessId,e.tokenId,{idempotencyKey:e.idempotencyKey})}},{opKey:"runtime_token.revoke",operationClass:"operate",scope:[lo],sideEffect:"write",cli:{group:"backend tokens",command:"revoke",summary:"Revoke a runtime token. Requires --yes.",destructive:!0,yesMessage:"Pass --yes to confirm runtime token revocation.",args:[Yn,{field:"tokenId",kind:"positional",token:"<tokenId>"}],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=e.tokenId;await t.builderRevokeRuntimeToken(i,r),n({businessId:i,revoked:r},`Runtime token ${r} revoked`)}},mcp:{tool:"fs_runtime_token_revoke",title:"Revoke a runtime token",description:"Revoke a runtime token. The backend using it stops verifying.",annotations:{readOnlyHint:!1,destructiveHint:!0,idempotentHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe(po),tokenId:a.string().describe("The runtime token id to revoke.")},handler:async(t,{businessId:e,tokenId:n})=>t.builderRevokeRuntimeToken(e,n)}}];var RR=new Set(["SUCCEEDED","SUCCESS"]),OR=new Set(["FAILED","ERROR","CANCELLED","TIMED_OUT"]),PR="SUPERSEDED";function hZ(t){let n=(t?.data??t)?.builds;return Array.isArray(n)?n:[]}var en=t=>typeof t=="string"?t:null;async function AR(t,e){let n=e.intervalMs??5e3,i=e.sleep??(p=>new Promise(d=>setTimeout(d,p))),r=e.now??(()=>Date.now()),o=r()+e.timeoutMs,s={status:"UNKNOWN",buildId:e.buildId??null,ref:null,error:null,timedOut:!1},c=e.buildId??null,u=null,l=e.buildId!=null;for(;;){let p=await t.builderFrontendStatus(e.businessId,e.environmentId),d=hZ(p),m=(c?d.find(f=>en(f.id)===c):void 0)??d[0];if(m){let f=en(m.status)??"UNKNOWN",g=en(m.id);s={status:f,buildId:g,ref:en(m.ref),error:en(m.error),timedOut:!1};let y=RR.has(f)||OR.has(f)||f===PR;if(l||(l=!0,y&&(u=g)),u!==null&&g===u){if(r()>=o)return{...s,timedOut:!0};await i(Math.min(n,Math.max(0,o-r())));continue}if(u=null,RR.has(f)||OR.has(f))return s;if(f===PR){let v=d.find(S=>en(S.ref)===en(m.ref)&&en(S.id)!==en(m.id));c=v?en(v.id):null}}if(r()>=o)return{...s,timedOut:!0};await i(Math.min(n,Math.max(0,o-r())))}}var E_="The business id or slug.",NR="Scope to a preview environment (omit for production).",CR={field:"businessId",kind:"positional",token:"<businessIdOrSlug>",describe:E_,resolveBusiness:!0},zR={field:"env",kind:"flag",token:"--env <environmentId>",describe:"Scope to a preview environment id (omit for production)."};async function DR(t,e){return ve(t,e)}var jR=[{opKey:"frontend.status",operationClass:"operate",scope:["businesses:read"],sideEffect:"read",cli:{group:"frontend",command:"status",summary:"Show the current frontend release, recent releases, and recent builds (incl. failure reasons)",args:[CR,zR,{field:"wait",kind:"flag",token:"--wait",describe:"Block until the in-flight build finishes, then report it; exit non-zero if it failed. Use after a push or release instead of polling this command in a loop."},{field:"timeout",kind:"flag",token:"--timeout <seconds>",describe:"How long --wait waits before giving up (default 600)."}],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=e.env;if(!e.wait){n(await t.builderFrontendStatus(i,r),"Frontend status");return}let o=Number(e.timeout??600),s=await AR(t,{businessId:i,environmentId:r,buildId:null,timeoutMs:(Number.isFinite(o)&&o>0?o:600)*1e3});if(s.timedOut)throw new A(`Frontend build did not finish within the timeout (last status: ${s.status})`,0,{code:"BUILD_WAIT_TIMEOUT",details:{build:s}});if(s.status!=="SUCCEEDED"&&s.status!=="SUCCESS")throw new A(`Frontend build ${s.status}${s.error?`: ${s.error}`:""}`,0,{code:"BUILD_FAILED",details:{build:s}});let c=await t.builderFrontendStatus(i,r);n({status:c,build:s},"Frontend build succeeded")}},mcp:{tool:"fs_frontend_status",title:"Get frontend status",description:"Read a business's current frontend serve state (uiMode, active release hash + producing build, pin flag), the recent SUCCEEDED releases (rollback targets), and the recent builds \u2014 a FAILED build's `error` explains why a deploy didn't go live. Read-only.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe(E_),environmentId:a.string().optional().describe(NR)},handler:async(t,e)=>{let n=await DR(t,e.businessId);return t.builderFrontendStatus(n,e.environmentId)}}},{opKey:"frontend.rollback",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:"frontend",command:"rollback",summary:"Roll the business frontend back to a prior release (re-activate its releaseId)",idempotent:!0,args:[CR,{field:"releaseId",kind:"flag",token:"--release-id <releaseId>",describe:"The prior release id (manifest hash) to re-activate \u2014 see `frontend status`.",required:!0},zR],handler:async({client:t,args:e,reqOpts:n,emit:i,emitDryRunPreview:r})=>{let o=await t.builderFrontendRollback(e.businessId,{releaseId:e.releaseId,environmentId:e.env},n);r(o)||i({result:o},"Frontend rolled back")}},mcp:{tool:"fs_frontend_rollback",title:"Roll back a business frontend",description:"Roll a business's frontend back to a prior release by its releaseId (manifest hash, from fs_frontend_status). Flips the live pointer back and pins it. The releaseId must belong to this target's build history.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe(E_),releaseId:a.string().describe("The prior release id (manifest hash) to re-activate."),environmentId:a.string().optional().describe(NR),...Ae},handler:async(t,e)=>{let n=await DR(t,e.businessId);return t.builderFrontendRollback(n,{releaseId:e.releaseId,environmentId:e.environmentId},{idempotencyKey:e.idempotencyKey})}}}];var UR=[{opKey:"usage.read",operationClass:"operate",scope:["businesses:read"],sideEffect:"read",cli:{group:"usage",command:"summary",summary:"Show usage summary for the last 30 days",args:[{field:"businessId",kind:"positional",token:"<businessIdOrName>",resolveBusiness:!0}],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=await t.managementGetUsage(i);n({businessId:i,summary:r},"Usage summary")}},mcp:{tool:"fs_usage_read",title:"Read usage summary",description:"Read a business's usage summary \u2014 metered request counts and tier utilization. Read-only.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe("The business id whose usage to read.")},handler:async(t,{businessId:e})=>t.managementGetUsage(e)}}];var MR=[{opKey:"persona.bootstrap",operationClass:"operate",scope:["businesses:read"],sideEffect:"write",cli:{group:"persona",command:"bootstrap",summary:"Issue a fresh fsk_test_ API key in a test environment",args:[{field:"businessId",kind:"positional",token:"<businessIdOrName>",resolveBusiness:!0},{field:"env",kind:"flag",token:"--env <env>",describe:"Environment name (must be test-strategy)",required:!0},{field:"plan",kind:"flag",token:"--plan <planKey>",describe:"Plan key to assign (e.g. starter)"},{field:"displayName",kind:"flag",token:"--display-name <name>",describe:"Persona display name"}],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=await cp(t,i,e.env),o=await t.issuePersonaBootstrapKey(i,r,{planKey:e.plan,displayName:e.displayName});n({businessId:i,environmentId:r,result:o},"Persona bootstrapped")}},mcp:{tool:"fs_persona_bootstrap",title:"Bootstrap a test persona",description:"Issue a one-time test bootstrap key for a business environment \u2014 use it to provision a test persona. Returns the key ONCE; store it now.",returnsOneTimeSecret:!0,annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1},inputSchema:{businessId:a.string().describe("The business id."),environmentId:a.string().describe("The environment id to scope the persona to.")},handler:async(t,{businessId:e,environmentId:n})=>t.issuePersonaBootstrapKey(e,n)}},{opKey:"persona.read",operationClass:"operate",scope:["businesses:read"],sideEffect:"read",cli:{group:"persona",command:"list",summary:"List personas for a test environment",args:[{field:"businessId",kind:"positional",token:"<businessIdOrName>",resolveBusiness:!0},{field:"env",kind:"flag",token:"--env <env>",describe:"Environment name",required:!0}],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=await cp(t,i,e.env),o=await t.listPersonas(i,r);n({businessId:i,environmentId:r,result:o},"Personas")}},mcp:{tool:"fs_persona_list",title:"List personas",description:"List a business environment's test personas (id, label, status). Read-only.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe("The business id."),environmentId:a.string().describe("The environment id whose personas to list.")},handler:async(t,{businessId:e,environmentId:n})=>t.listPersonas(e,n)}},{opKey:"persona.rotate",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:"persona",command:"rotate",summary:"Rotate a persona's test API key and return the new key once",args:[{field:"businessId",kind:"positional",token:"<businessIdOrName>",resolveBusiness:!0},{field:"personaId",kind:"positional",token:"<personaId>"},{field:"env",kind:"flag",token:"--env <env>",describe:"Environment name",required:!0}],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=e.personaId,o=await cp(t,i,e.env),s=await t.rotatePersona(i,o,r);n({businessId:i,environmentId:o,result:s},`Persona ${r} rotated`)}},mcp:{tool:"fs_persona_rotate",title:"Rotate a test persona",description:"Rotate a test persona's API key. Returns the replacement key once.",returnsOneTimeSecret:!0,annotations:{readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1,openWorldHint:!1},inputSchema:{businessId:a.string().describe("The business id."),environmentId:a.string().describe("The environment id."),personaId:a.string().describe("The persona id to rotate.")},handler:async(t,{businessId:e,environmentId:n,personaId:i})=>t.rotatePersona(e,n,i)}},{opKey:"persona.revoke",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:"persona",command:"revoke",summary:"Revoke a persona's API key",args:[{field:"businessId",kind:"positional",token:"<businessIdOrName>",resolveBusiness:!0},{field:"personaId",kind:"positional",token:"<personaId>"},{field:"env",kind:"flag",token:"--env <env>",describe:"Environment name",required:!0}],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=e.personaId,o=await cp(t,i,e.env),s=await t.revokePersona(i,o,r);n({businessId:i,environmentId:o,result:s},`Persona ${r} revoked`)}},mcp:{tool:"fs_persona_revoke",title:"Revoke a persona",description:"Revoke a test persona. Its credentials stop working.",annotations:{readOnlyHint:!1,destructiveHint:!0,idempotentHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe("The business id."),environmentId:a.string().describe("The environment id."),personaId:a.string().describe("The persona id to revoke.")},handler:async(t,{businessId:e,environmentId:n,personaId:i})=>t.revokePersona(e,n,i)}}];async function cp(t,e,n){try{return await uo(t,e,n)}catch(i){throw new A(i instanceof Error?i.message:`Environment "${n}" not found on business ${e}.`,void 0,{code:"ENV_NOT_FOUND"})}}var bZ=a.object({provider:a.string().min(1),subject:a.string().min(1),providerOrganizationId:a.string().optional(),email:a.string().optional()}).strict(),yZ=a.object({provider:a.string().min(1),sessionId:a.string().optional(),authenticatedAt:a.string().optional(),assuranceLevel:a.string().optional()}).strict(),Xn={id:a.string().min(1),businessId:a.string().optional(),organizationId:a.string().optional(),environmentId:a.string().optional(),externalIdentities:a.array(bZ),authenticationContext:yZ.optional()},_Z=a.object({type:a.literal("user"),email:a.string().optional(),...Xn}).strict(),vZ=a.object({type:a.literal("maker_token"),tokenId:a.string().optional(),...Xn}).strict(),kZ=a.object({type:a.literal("subscriber_member"),subscriberId:a.string().optional(),membershipId:a.string().optional(),roles:a.array(a.string()).optional(),...Xn}).strict(),SZ=a.object({type:a.literal("api_key"),keyId:a.string().optional(),subscriberId:a.string().optional(),...Xn}).strict(),xZ=a.object({type:a.literal("runtime"),tokenId:a.string().optional(),...Xn}).strict(),IZ=a.object({type:a.literal("persona"),personaId:a.string().optional(),subscriberId:a.string().optional(),...Xn}).strict(),$Z=a.object({type:a.literal("system"),component:a.string().optional(),ruleId:a.string().optional(),...Xn}).strict(),wZ=a.object({type:a.literal("agent"),agentId:a.string().optional(),...Xn}).strict(),T_=a.discriminatedUnion("type",[_Z,vZ,kZ,SZ,xZ,IZ,$Z,wZ]);var EZ=1;var TZ=["core","billing","webhook","evolution","authz","gateway","usage","workflow"],LR=a.enum(TZ),ZR=a.object({type:a.string().min(1).max(128),id:a.string().min(1).max(256)}).strict(),See=a.object({id:a.string().min(1),type:Qt,occurredAt:a.string().datetime(),businessId:a.string().min(1),environmentId:a.string().min(1).nullable().optional(),actor:T_,subject:ZR,payload:a.record(a.string(),a.unknown()).default({}),source:LR,correlationId:a.string().min(1),correlationDepth:a.number().int().min(0).default(0),schemaVersion:a.number().int().min(1).default(EZ)}).strict(),xee=a.object({type:Qt,occurredAt:a.string().datetime().optional(),businessId:a.string().min(1),environmentId:a.string().min(1).nullable().optional(),actor:T_,subject:ZR,payload:a.record(a.string(),a.unknown()).optional(),source:LR,correlationId:a.string().min(1).optional(),correlationDepth:a.number().int().min(0).optional()}).strict();var RZ=50,OZ=200,Eee=a.object({businessId:a.string().min(1),environmentId:a.string().min(1).optional(),type:Qt.optional(),subjectType:a.string().min(1).optional(),subjectId:a.string().min(1).optional(),since:a.string().datetime().optional(),until:a.string().datetime().optional(),limit:a.coerce.number().int().min(1).max(OZ).default(RZ),cursor:a.string().min(1).optional()}).strict();var tn=["usage","telemetry","denials","lifecycle","consumer_activity","audit"],up=a.enum(tn);var Pee=a.object({event_id:a.string().min(1),type:Qt,occurred_at:a.string().datetime({offset:!0}),business_id:a.string().min(1).optional(),environment_id:a.string().min(1).optional(),actor_type:a.string().min(1).optional(),actor_id:a.string().min(1).optional(),latency_ms:a.number().nonnegative().finite().optional(),payload:a.string().optional(),schema_version:a.number().int().min(1),upstream_ms:a.number().nonnegative().finite().optional()}).strict(),PZ={"subscription.created":"lifecycle","subscription.updated":"lifecycle","subscription.canceled":"lifecycle","payment.succeeded":"lifecycle","payment.failed":"lifecycle","rate_limit.exceeded":"denials","entitlement.changed":"lifecycle","usage.threshold_reached":"usage","usage.recorded":"usage","gateway.request_denied":"denials","change_set.created":"lifecycle","change_set.approved":"lifecycle","change_set.applied":"lifecycle","change_set.rolled_back":"lifecycle","change_set.cancelled":"lifecycle","billing.event_recorded":"lifecycle","authz.decision":"denials","repo.changed":"consumer_activity","automation.rule_fired":"audit","automation.action_succeeded":"audit","automation.action_failed":"audit","automation.action_denied":"denials","automation.notification":"consumer_activity","access_request.created":"consumer_activity","access_request.resolved":"consumer_activity","build.failed":"lifecycle","product.published":"lifecycle","workflow.failed":"lifecycle","pr.review_posted":"consumer_activity"};function BR(t){return PZ[t]}var AZ=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,NZ=100,CZ=50,zZ=100,DZ=50;var lp=a.string().regex(AZ,"Expected a UUID"),dp=a.string().datetime({offset:!0}),R_=a.string().min(1).max(256).regex(/^[^\u0000-\u001f\u007f]+$/,"Control characters are not allowed"),pp=a.object({from:dp,to:dp}).strict().refine(({from:t,to:e})=>Date.parse(t)<Date.parse(e),"range.from must be before range.to"),O_="production",mp=a.object({type:Qt.optional(),actorId:R_.optional(),environmentId:a.union([a.literal(O_),lp]).optional()}).strict();function P_(t,e){let n=t.filters?.type;n&&BR(n)!==t.domain&&e.addIssue({code:"custom",path:["filters","type"],message:"Event type does not belong to the selected archive domain"})}var FR=a.object({domain:up,metric:a.enum(["events","unique_actors"]),interval:a.enum(["hour","day"]),range:pp,filters:mp.optional()}).strict().superRefine(P_),jZ=a.object({t:dp,value:a.number().nonnegative()}).strict(),Dee=a.array(jZ),VR=a.object({domain:up,by:a.enum(["actor_id","type","environment_id"]),k:a.number().int().min(1).max(DZ),range:pp,filters:mp.optional()}).strict().superRefine(P_),UZ=a.object({key:a.string().min(1).max(256),count:a.number().int().nonnegative()}).strict(),jee=a.array(UZ),qR=a.object({domain:up,range:pp,limit:a.number().int().min(1).max(zZ).default(CZ),filters:mp.optional()}).strict().superRefine(P_),MZ=a.object({type:a.string().min(1).max(64),id:R_}).strict(),LZ=a.object({id:R_,type:Qt,occurredAt:dp,businessId:lp,environmentId:lp.nullable(),actor:MZ.nullable(),payload:a.string().nullable()}).strict(),Uee=a.array(LZ),ZZ=a.array(a.number().gt(0).lt(1)).min(1).max(10).refine(t=>new Set(t).size===t.length,"Percentiles must be unique"),HR=a.object({domain:a.literal("usage"),metric:a.union([a.literal("latency_ms"),a.literal("upstream_ms")]),percentiles:ZZ,range:pp,filters:mp.omit({type:!0}).optional()}).strict(),BZ=a.object({percentile:a.number().gt(0).lt(1),value:a.number().nonnegative().nullable()}).strict(),Mee=a.array(BZ),FZ={timeseries:FR,topK:VR,percentiles:HR,eventFeed:qR},VZ=Object.keys(FZ),Lee=a.discriminatedUnion("verb",[a.object({verb:a.literal("timeseries"),query:FR}).strict(),a.object({verb:a.literal("topK"),query:VR}).strict(),a.object({verb:a.literal("percentiles"),query:HR}).strict(),a.object({verb:a.literal("eventFeed"),query:qR}).strict()]),Zee=a.object({verb:a.enum(VZ),query:a.unknown()}).strict(),Bee=a.object({businessIds:a.array(lp).min(1).max(NZ)}).strict().refine(({businessIds:t})=>new Set(t).size===t.length,"Analytics business scope must not contain duplicates");var KR={"1h":3600*1e3,"24h":1440*60*1e3,"7d":10080*60*1e3,"30d":720*60*60*1e3},GR=Object.keys(KR);function Qn(t){let e=KR[t];if(e===void 0)throw new Error(`Unknown --range "${t}". Expected one of: ${GR.join(", ")}`);let n=new Date;return{from:new Date(n.getTime()-e).toISOString(),to:n.toISOString()}}function er(t){return{environmentId:typeof t=="string"&&t.length>0?t:O_}}function A_(t){if(!tn.includes(t))throw new Error(`Unknown --domain "${t}". Expected one of: ${tn.join(", ")}`);return t}var fp={field:"range",kind:"flag",token:"--range <range>",describe:`Relative window: ${GR.join(" | ")}`,defaultValue:"24h"},gp={field:"env",kind:"flag",token:"--env <environmentId>",describe:"Environment id to scope to. Omit for production \u2014 never for 'all environments'."},hp={field:"businessId",kind:"positional",token:"<businessIdOrName>",resolveBusiness:!0},bp={businessId:a.string().regex(/^[^/?#\s]+$/,"businessId must not contain '/', '?', '#', or whitespace").describe("The business whose archive to query."),range:a.enum(["1h","24h","7d","30d"]).default("24h").describe("Relative window."),environmentId:a.string().optional().describe("Environment id to scope to. Omit for production. Never returns all environments summed.")},WR=[{opKey:"analytics.timeseries",operationClass:"operate",scope:["businesses:read"],sideEffect:"read",cli:{group:"analytics",command:"timeseries",summary:"Request (or denial) volume over time",args:[hp,fp,gp,{field:"domain",kind:"flag",token:"--domain <domain>",describe:`Archive domain: ${tn.join(" | ")}`,defaultValue:"usage"},{field:"interval",kind:"flag",token:"--interval <interval>",describe:"Bucket size: hour | day",defaultValue:"hour"}],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,{result:r}=await t.analyticsQuery(i,{verb:"timeseries",query:{domain:A_(e.domain),metric:"events",interval:e.interval,range:Qn(e.range),filters:er(e.env)}});n({businessId:i,buckets:r},"Timeseries")}},mcp:{tool:"fs_analytics_timeseries",title:"Analytics: volume over time",description:"Event volume bucketed over time for one business, from the event archive. Read-only. Scoped to production unless environmentId is given.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{...bp,domain:a.enum(tn).default("usage"),interval:a.enum(["hour","day"]).default("hour")},handler:async(t,e)=>t.analyticsQuery(e.businessId,{verb:"timeseries",query:{domain:e.domain??"usage",metric:"events",interval:e.interval??"hour",range:Qn(e.range??"24h"),filters:er(e.environmentId)}})}},{opKey:"analytics.latency",operationClass:"operate",scope:["businesses:read"],sideEffect:"read",cli:{group:"analytics",command:"latency",summary:"Request latency percentiles (p50 / p95 / p99)",args:[hp,fp,gp],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,{result:r}=await t.analyticsQuery(i,{verb:"percentiles",query:{domain:"usage",metric:"latency_ms",percentiles:[.5,.95,.99],range:Qn(e.range),filters:er(e.env)}});n({businessId:i,percentiles:r},"Latency percentiles")}},mcp:{tool:"fs_analytics_latency",title:"Analytics: latency percentiles",description:"Gateway request latency at p50/p95/p99 for one business. NOTE: this is the WHOLE request including the builder's own backend, so a high number is not necessarily platform overhead. Read-only.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:bp,handler:async(t,e)=>t.analyticsQuery(e.businessId,{verb:"percentiles",query:{domain:"usage",metric:"latency_ms",percentiles:[.5,.95,.99],range:Qn(e.range??"24h"),filters:er(e.environmentId)}})}},{opKey:"analytics.top",operationClass:"operate",scope:["businesses:read"],sideEffect:"read",cli:{group:"analytics",command:"top",summary:"Top callers / event types / environments by volume",args:[hp,fp,gp,{field:"by",kind:"flag",token:"--by <dimension>",describe:"Break down by: actor_id | type | environment_id",defaultValue:"actor_id"},{field:"domain",kind:"flag",token:"--domain <domain>",describe:`Archive domain: ${tn.join(" | ")}`,defaultValue:"usage"},{field:"k",kind:"flag",token:"--k <count>",describe:"How many rows (1-50)",defaultValue:"10",parser:t=>Number.parseInt(t,10)}],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,{result:r}=await t.analyticsQuery(i,{verb:"topK",query:{domain:A_(e.domain),by:e.by,k:Number(e.k),range:Qn(e.range),filters:er(e.env)}});n({businessId:i,rows:r},"Top breakdown")}},mcp:{tool:"fs_analytics_top",title:"Analytics: top-K breakdown",description:"Ranked breakdown of archive events by caller, event type, or environment. Read-only.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{...bp,by:a.enum(["actor_id","type","environment_id"]).default("actor_id"),domain:a.enum(tn).default("usage"),k:a.number().int().min(1).max(50).default(10)},handler:async(t,e)=>t.analyticsQuery(e.businessId,{verb:"topK",query:{domain:e.domain??"usage",by:e.by??"actor_id",k:e.k??10,range:Qn(e.range??"24h"),filters:er(e.environmentId)}})}},{opKey:"analytics.log",operationClass:"operate",scope:["businesses:read"],sideEffect:"read",cli:{group:"analytics",command:"log",summary:"Recent requests \u2014 the live metering signal, newest first",args:[hp,fp,gp,{field:"domain",kind:"flag",token:"--domain <domain>",describe:`Archive domain: ${tn.join(" | ")}`,defaultValue:"usage"},{field:"limit",kind:"flag",token:"--limit <count>",describe:"How many rows (1-100)",defaultValue:"25",parser:t=>Number.parseInt(t,10)}],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,{result:r}=await t.analyticsQuery(i,{verb:"eventFeed",query:{domain:A_(e.domain),range:Qn(e.range),limit:Number(e.limit),filters:er(e.env)}});n({businessId:i,events:r},"Recent events")}},mcp:{tool:"fs_analytics_log",title:"Analytics: recent request log",description:"The most recent archived events for one business, newest first. Each row's `payload` carries the request detail (path, statusCode, latencyMs, orgId). Read-only.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{...bp,domain:a.enum(tn).default("usage"),limit:a.number().int().min(1).max(100).default(25)},handler:async(t,e)=>t.analyticsQuery(e.businessId,{verb:"eventFeed",query:{domain:e.domain??"usage",range:Qn(e.range??"24h"),limit:e.limit??25,filters:er(e.environmentId)}})}}];var gn={field:"organizationId",kind:"positional",token:"<organizationId>",describe:"Builder organization id."},JR={field:"memberUserId",kind:"positional",token:"<memberUserId>"},YR=[{opKey:"organization.list",operationClass:"operate",scope:["businesses:read"],sideEffect:"read",cli:{group:"organization",command:"list",summary:"List builder organizations available to the caller",args:[],handler:async({client:t,emit:e})=>e(await t.listBuilderOrganizations(),"Organizations")},mcp:null},{opKey:"organization.create",operationClass:"operate",scope:["businesses:create"],sideEffect:"write",cli:{group:"organization",command:"create",summary:"Create a team or company organization",args:[{field:"name",kind:"positional",token:"<name>"},{field:"type",kind:"flag",token:"--type <type>",describe:"Organization type: team | company",defaultValue:"team"}],handler:async({client:t,args:e,reqOpts:n,emit:i})=>{let r=e.type==="company"?"company":"team";i(await t.createBuilderOrganization({name:e.name,type:r},n),"Organization created")}},mcp:null},{opKey:"organization.member.list",operationClass:"operate",scope:["businesses:read"],sideEffect:"read",cli:{group:"organization",command:"members",summary:"List organization members",args:[gn],handler:async({client:t,args:e,emit:n})=>n(await t.listBuilderOrganizationMembers(e.organizationId),"Organization members")},mcp:null},{opKey:"organization.invitation.create",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:"organization",command:"invite",summary:"Invite a member to an organization",args:[gn,{field:"email",kind:"positional",token:"<email>"},{field:"role",kind:"flag",token:"--role <role>",describe:"Invitation role: admin | member",defaultValue:"member"}],handler:async({client:t,args:e,reqOpts:n,emit:i})=>{let r=e.role==="admin"?"admin":"member";i(await t.inviteBuilderOrganizationMember(e.organizationId,{email:e.email,role:r},n),"Invitation created")}},mcp:null},{opKey:"organization.invitation.list",operationClass:"operate",scope:["businesses:read"],sideEffect:"read",cli:{group:"organization",command:"invitation-list",summary:"List the caller's pending organization invitations",args:[],handler:async({client:t,emit:e})=>e(await t.listBuilderInvitations(),"Pending invitations")},mcp:null},{opKey:"organization.invitation.revoke",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:"organization",command:"invitation-revoke",summary:"Revoke a pending organization invitation",destructive:!0,args:[gn,{field:"invitationId",kind:"positional",token:"<invitationId>"}],handler:async({client:t,args:e,emit:n})=>{await t.revokeBuilderInvitation(e.organizationId,e.invitationId),n({revoked:e.invitationId},"Invitation revoked")}},mcp:null},{opKey:"organization.invitation.accept",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:"organization",command:"invitation-accept",summary:"Accept an organization invitation",args:[{field:"invitationId",kind:"positional",token:"<invitationId>"},{field:"invitationToken",kind:"flag",token:"--invitation-token <token>",describe:"One-time token from the invitation email, when required."}],handler:async({client:t,args:e,emit:n})=>n(await t.acceptBuilderInvitation(e.invitationId,e.invitationToken),"Invitation accepted")},mcp:null},{opKey:"organization.member.update",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:"organization",command:"member-role",summary:"Change an organization member's role",args:[gn,JR,{field:"role",kind:"flag",token:"--role <role>",describe:"New role: owner | admin | member",required:!0}],handler:async({client:t,args:e,emit:n})=>{let i=e.role;if(i!=="owner"&&i!=="admin"&&i!=="member")throw new Error("--role must be owner, admin, or member");n(await t.updateBuilderOrganizationMember(e.organizationId,e.memberUserId,i),"Member role updated")}},mcp:null},{opKey:"organization.member.remove",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:"organization",command:"member-remove",summary:"Remove a member from an organization",destructive:!0,args:[gn,JR],handler:async({client:t,args:e,emit:n})=>{await t.removeBuilderOrganizationMember(e.organizationId,e.memberUserId),n({removed:e.memberUserId},"Member removed")}},mcp:null},{opKey:"organization.ownership.transfer",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:"organization",command:"transfer-ownership",summary:"Transfer primary organization ownership",destructive:!0,args:[gn,{field:"newOwnerUserId",kind:"positional",token:"<newOwnerUserId>"}],handler:async({client:t,args:e,emit:n})=>n(await t.transferBuilderOrganizationOwnership(e.organizationId,e.newOwnerUserId),"Ownership transferred")},mcp:null},{opKey:"organization.delete",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:"organization",command:"delete",summary:"Delete an organization and its managed state",destructive:!0,args:[gn],handler:async({client:t,args:e,emit:n})=>{await t.deleteBuilderOrganization(e.organizationId),n({deleted:e.organizationId},"Organization deleted")}},mcp:null},{opKey:"organization.overview.read",operationClass:"operate",scope:["businesses:read"],sideEffect:"read",cli:{group:"organization",command:"overview",summary:"Read the organization overview shown on the dashboard",args:[gn],handler:async({client:t,args:e,emit:n})=>n(await t.getBuilderOrganizationOverview(e.organizationId),"Organization overview")},mcp:null},{opKey:"organization.bulletin.read",operationClass:"operate",scope:["businesses:read"],sideEffect:"read",cli:{group:"organization",command:"bulletin",summary:"List the consolidated bulletin across the organization",args:[gn,{field:"kind",kind:"flag",token:"--kind <kind>"},{field:"status",kind:"flag",token:"--status <status>"},{field:"cursor",kind:"flag",token:"--cursor <cursor>"},{field:"limit",kind:"flag",token:"--limit <count>",parser:t=>Number.parseInt(t,10)}],handler:async({client:t,args:e,emit:n})=>n(await t.listBuilderOrganizationBulletin(e.organizationId,{kind:e.kind,status:e.status,cursor:e.cursor,limit:e.limit}),"Organization bulletin")},mcp:null}];import{writeFile as qZ}from"node:fs/promises";var XR=[{field:"organizationId",kind:"positional",token:"<organizationId>"},{field:"businessId",kind:"flag",token:"--business <businessId>"},{field:"action",kind:"flag",token:"--action <action>"},{field:"actorUserId",kind:"flag",token:"--actor <userId>"},{field:"decision",kind:"flag",token:"--decision <decision>"},{field:"from",kind:"flag",token:"--from <isoDate>"},{field:"to",kind:"flag",token:"--to <isoDate>"},{field:"limit",kind:"flag",token:"--limit <count>",parser:t=>Number.parseInt(t,10)}];function QR(t){return{businessId:t.businessId,action:t.action,actorUserId:t.actorUserId,decision:t.decision,from:t.from,to:t.to,limit:t.limit}}var eO=[{opKey:"audit_log.read",operationClass:"operate",scope:["businesses:read"],sideEffect:"read",cli:{group:"audit-log",command:"list",summary:"List organization or business-scoped audit-log rows",args:[...XR,{field:"cursor",kind:"flag",token:"--cursor <cursor>"}],handler:async({client:t,args:e,emit:n})=>n(await t.listBuilderAuditLogs(e.organizationId,{...QR(e),cursor:e.cursor}),"Audit log")},mcp:null},{opKey:"audit_log.export",operationClass:"operate",scope:["businesses:read"],sideEffect:"read",cli:{group:"audit-log",command:"export",summary:"Export organization or business-scoped audit logs as CSV",args:[...XR,{field:"output",kind:"flag",token:"--output <file>",describe:"Write CSV to this file; omit to return it in command output."}],handler:async({client:t,args:e,emit:n})=>{let i=await t.exportBuilderAuditLogs(e.organizationId,QR(e));if(typeof e.output=="string"){await qZ(e.output,i,"utf8"),n({output:e.output},`Audit log exported to ${e.output}`);return}n({csv:i},"Audit log CSV")}},mcp:null}];var Ta={field:"businessId",kind:"positional",token:"<businessIdOrSlug>",resolveBusiness:!0};function HZ(t){try{let e=JSON.parse(t);if(!e||typeof e!="object"||Array.isArray(e))throw new Error;return e}catch{throw new A("--patch must be a JSON object",400,{code:"INVALID_NOTIFICATION_PREFERENCES_PATCH"})}}var tO=[{opKey:"notification.read",operationClass:"operate",scope:["businesses:read"],sideEffect:"read",cli:{group:"notifications",command:"list",summary:"List the caller's notifications for a business",args:[Ta,{field:"unreadOnly",kind:"flag",token:"--unread-only"},{field:"cursor",kind:"flag",token:"--cursor <cursor>"},{field:"limit",kind:"flag",token:"--limit <count>",parser:t=>Number.parseInt(t,10)}],handler:async({client:t,args:e,emit:n})=>n(await t.listBusinessNotifications(e.businessId,{unreadOnly:e.unreadOnly===!0?!0:void 0,cursor:e.cursor,limit:e.limit}),"Notifications")},mcp:null},{opKey:"notification.mark_read",operationClass:"operate",scope:["businesses:read"],sideEffect:"write",cli:{group:"notifications",command:"read",summary:"Mark one notification read",args:[Ta,{field:"notificationId",kind:"positional",token:"<notificationId>"}],handler:async({client:t,args:e,emit:n})=>{await t.markBusinessNotificationRead(e.businessId,e.notificationId),n({read:e.notificationId},"Notification marked read")}},mcp:null},{opKey:"notification.mark_all_read",operationClass:"operate",scope:["businesses:read"],sideEffect:"write",cli:{group:"notifications",command:"read-all",summary:"Mark all notifications read for a business",args:[Ta],handler:async({client:t,args:e,emit:n})=>n(await t.markAllBusinessNotificationsRead(e.businessId),"All notifications marked read")},mcp:null},{opKey:"notification.preferences.read",operationClass:"operate",scope:["businesses:read"],sideEffect:"read",cli:{group:"notifications",command:"preferences",summary:"Get notification opt-out preferences",args:[Ta],handler:async({client:t,args:e,emit:n})=>n(await t.getBusinessNotificationPreferences(e.businessId),"Notification preferences")},mcp:null},{opKey:"notification.preferences.update",operationClass:"operate",scope:["businesses:read"],sideEffect:"write",cli:{group:"notifications",command:"preferences-update",summary:"Patch notification opt-out preferences",args:[Ta,{field:"patch",kind:"flag",token:"--patch <json>",describe:'JSON patch, e.g. {"master":{"email":true}} or {"categories":{"builds":{"in_app":true}}}',required:!0,parser:HZ}],handler:async({client:t,args:e,emit:n})=>n(await t.updateBusinessNotificationPreferences(e.businessId,e.patch),"Notification preferences updated")},mcp:null}];var nO=[{opKey:"apply_timeline.list",operationClass:"operate",scope:["businesses:read"],sideEffect:"read",cli:{group:"apply-timeline",command:"list",summary:"List a business's Apply Timeline: repo-triggered manifest applies (PRs, pushes, releases), checks, semantic diffs, and apply phases.",args:[{field:"businessId",kind:"positional",token:"<businessIdOrName>",resolveBusiness:!0},{field:"env",kind:"flag",token:"--env <env>",describe:"Environment scope: production, all, or a preview environment name."}],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=await t.listApplyTimeline(i,{env:e.env});n({businessId:i,count:r.data.length,applyTimeline:r.data},`${r.data.length} apply timeline entr(ies)`)}},mcp:null},{opKey:"apply_timeline.read",operationClass:"operate",scope:["businesses:read"],sideEffect:"read",cli:{group:"apply-timeline",command:"inspect",summary:"Inspect one Apply Timeline entry by id, release tag, PR number, branch, or commit SHA.",args:[{field:"businessId",kind:"positional",token:"<businessIdOrName>",resolveBusiness:!0},{field:"selector",kind:"positional",token:"<id|tag|pr|branch|sha>"},{field:"env",kind:"flag",token:"--env <env>",describe:"Environment scope: production, all, or a preview environment name."}],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=String(e.selector),o=await t.listApplyTimeline(i,{env:e.env}),s=o.data.find(c=>c.id===r)??o.data.find(c=>c.releaseTag===r)??o.data.find(c=>c.prNumber!==null&&String(c.prNumber)===r)??o.data.find(c=>c.branch===r)??o.data.find(c=>c.commitSha.startsWith(r));if(!s)throw new A(`Apply timeline entry ${r} was not found.`,404,{code:"APPLY_TIMELINE_ENTRY_NOT_FOUND"});n({businessId:i,applyTimelineEntry:s},`Apply timeline entry ${s.id}: ${s.status}`)}},mcp:null}];var Ra="The business id or slug.",Oa="The subscriber (client org) id \u2014 from `consumer list`.",N_="The governed ChangeSet id.",yp={field:"businessId",kind:"positional",token:"<businessIdOrSlug>",describe:Ra,resolveBusiness:!0},_p={field:"subscriberId",kind:"positional",token:"<subscriberId>",describe:Oa},rO={field:"changeSetId",kind:"positional",token:"<changeSetId>",describe:N_},vp={field:"env",kind:"flag",token:"--env <env>",describe:"Environment name/id to scope the proposal to."};function KZ(t){let e;try{e=JSON.parse(t)}catch{throw new A("--operations must be a JSON array of governed operations.",0,{code:"INVALID_OPERATIONS"})}if(!Array.isArray(e))throw new A("--operations must be a JSON array.",0,{code:"INVALID_OPERATIONS"});return e}async function kp(t,e){return ve(t,e)}var iO=[{opKey:"change_set.propose",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:"proposal",command:"create",summary:"Propose a governed ChangeSet against a subscriber (agent/builder proposer; a human approves + applies in the portal)",idempotent:!0,args:[yp,_p,{field:"intent",kind:"flag",token:"--intent <intent>",describe:"Human-readable description of the proposed change.",required:!0},{field:"operations",kind:"flag",token:"--operations <json>",describe:"JSON array of governed operations (e.g. update_role_permissions).",required:!0,parser:t=>KZ(t)},vp],handler:async({client:t,args:e,reqOpts:n,emit:i,emitDryRunPreview:r})=>{let o=e.businessId,s=e.subscriberId,c=await t.proposeConsumerChangeSet(o,s,{intent:e.intent,operations:e.operations,...n.idempotencyKey?{idempotencyKey:n.idempotencyKey}:{}},{env:e.env},n);r(c)||i(c,"ChangeSet proposed")}},mcp:{tool:"fs_proposal_create",title:"Propose a governed ChangeSet",description:"Propose a governed ChangeSet against a subscriber's live RBAC state (Agent Proposal Flow). Creates a DRAFT proposal that a HUMAN in the subscriber org must preview, approve, and apply in the portal \u2014 an agent can propose but never self-approve or apply. Operate-class live-state action; does not edit repo-authored business behavior.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!0},inputSchema:{businessId:a.string().describe(Ra),subscriberId:a.string().describe(Oa),intent:a.string().describe("Human-readable description of the proposed change."),operations:a.array(a.record(a.string(),a.unknown())).describe("Governed operations, e.g. [{ type: 'update_role_permissions', schemaVersion: 1, target: { resourceType: 'subscriber_business_role', resourceId: '<roleKey>' }, payload: { permissions: [...] } }]."),env:a.string().optional().describe("Environment name/id to scope the proposal to."),idempotencyKey:a.string().optional().describe("Replay-safe idempotency key for the proposal.")},handler:async(t,e)=>{let n=await kp(t,e.businessId);return t.proposeConsumerChangeSet(n,e.subscriberId,{intent:e.intent,operations:e.operations,...e.idempotencyKey?{idempotencyKey:e.idempotencyKey}:{}},{env:e.env})}}},{opKey:"change_set.preview",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:"proposal",command:"preview",summary:"Simulate + store a preview on a proposed ChangeSet (rides the propose authority)",args:[yp,_p,rO,vp],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=await t.previewConsumerChangeSet(i,e.subscriberId,e.changeSetId,{env:e.env});n(r,"ChangeSet preview stored")}},mcp:{tool:"fs_proposal_preview",title:"Preview a proposed ChangeSet",description:"Simulate the impact of a proposed ChangeSet and store the preview (Agent Proposal Flow). Enforced by the same authority as propose \u2014 there is no separate preview permission. Read-shaped but writes the stored simulation; does not apply the change.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!0},inputSchema:{businessId:a.string().describe(Ra),subscriberId:a.string().describe(Oa),changeSetId:a.string().describe(N_),env:a.string().optional().describe("Environment name/id.")},handler:async(t,e)=>{let n=await kp(t,e.businessId);return t.previewConsumerChangeSet(n,e.subscriberId,e.changeSetId,{env:e.env})}}},{opKey:"change_set.proposal_list",operationClass:"operate",scope:["businesses:read"],sideEffect:"read",cli:{group:"proposal",command:"list",summary:"List governed ChangeSets proposed against a subscriber",args:[yp,_p,{field:"status",kind:"flag",token:"--status <status>",describe:"Filter by status (e.g. draft, approval_required)."},vp],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=await t.listConsumerChangeSets(i,e.subscriberId,{env:e.env,status:e.status});n(r,"Proposed ChangeSets")}},mcp:{tool:"fs_proposal_list",title:"List proposed ChangeSets",description:"List governed ChangeSets proposed against a subscriber (Agent Proposal Flow). Read-only; use it to discover proposal ids + their status before previewing.",annotations:{readOnlyHint:!0,openWorldHint:!0},inputSchema:{businessId:a.string().describe(Ra),subscriberId:a.string().describe(Oa),status:a.string().optional().describe("Filter by status (e.g. draft, approval_required)."),env:a.string().optional().describe("Environment name/id.")},handler:async(t,e)=>{let n=await kp(t,e.businessId);return t.listConsumerChangeSets(n,e.subscriberId,{env:e.env,status:e.status})}}},{opKey:"change_set.proposal_read",operationClass:"operate",scope:["businesses:read"],sideEffect:"read",cli:{group:"proposal",command:"get",summary:"Read one governed ChangeSet proposed against a subscriber",args:[yp,_p,rO,vp],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=await t.getConsumerChangeSet(i,e.subscriberId,e.changeSetId,{env:e.env});n(r,"ChangeSet")}},mcp:{tool:"fs_proposal_get",title:"Read a proposed ChangeSet",description:"Read one governed ChangeSet proposed against a subscriber (Agent Proposal Flow) \u2014 its operations, risk, simulation, approvals, and status. Read-only.",annotations:{readOnlyHint:!0,openWorldHint:!0},inputSchema:{businessId:a.string().describe(Ra),subscriberId:a.string().describe(Oa),changeSetId:a.string().describe(N_),env:a.string().optional().describe("Environment name/id.")},handler:async(t,e)=>{let n=await kp(t,e.businessId);return t.getConsumerChangeSet(n,e.subscriberId,e.changeSetId,{env:e.env})}}}];var Rr="The business id or slug.",Pa="The webhook endpoint id.",mo="billing:manage",fo={field:"businessId",kind:"positional",token:"<businessIdOrSlug>",describe:Rr,resolveBusiness:!0},Sp={field:"webhookId",kind:"positional",token:"<webhookId>",describe:Pa},oO={field:"events",kind:"flag",token:"--events <events>",describe:"Comma-separated event names, e.g. subscription.created,payment.failed"},sO={field:"limit",kind:"flag",token:"--limit <n>",describe:"Max rows to return."};function aO(t){if(typeof t!="string")return;let e=t.split(",").map(n=>n.trim()).filter(n=>n.length>0);return e.length>0?e:void 0}function cO(t){if(!t||typeof t!="object")return[];let e=t;return Array.isArray(e.data)?e.data:[]}function uO(t,e){if(!t||typeof t!="object")return e;let n=t;return typeof n.total=="number"?n.total:typeof n.pagination?.total=="number"?n.pagination.total:e}function GZ(t){let e=t.enable===!0,n=t.disable===!0;if(e&&n)throw new A("Pass either --enable or --disable, not both.",400,{code:"VALIDATION_ERROR",param:"enabled"});if(e)return!0;if(n)return!1}async function go(t,e){return ve(t,e)}var lO=[{opKey:"webhook.read",operationClass:"operate",scope:[mo],sideEffect:"read",cli:{group:"webhook",command:"list",summary:"List API-managed webhook endpoints",args:[fo,sO],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=await t.managementListWebhooks(i,{limit:e.limit}),o=cO(r);n({businessId:i,count:o.length,total:uO(r,o.length),webhooks:o},`${o.length} webhook(s)`)}},mcp:{tool:"fs_webhook_list",title:"List webhook endpoints",description:"List API-managed outbound webhook endpoints for a business. Read-only; signing secrets are never returned.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe(Rr),limit:a.string().optional().describe("Max rows to return.")},handler:async(t,e)=>{let n=await go(t,e.businessId);return t.managementListWebhooks(n,{limit:e.limit})}}},{opKey:"webhook.create",operationClass:"operate",scope:[mo],sideEffect:"write",cli:{group:"webhook",command:"create",summary:"Create an API-managed webhook endpoint",idempotent:!0,args:[fo,{field:"url",kind:"flag",token:"--url <url>",describe:"HTTPS receiver URL.",required:!0},{...oO,required:!0}],handler:async({client:t,args:e,reqOpts:n,emit:i,emitDryRunPreview:r})=>{let o=aO(e.events);if(!o)throw new A("At least one webhook event is required.",400,{code:"VALIDATION_ERROR",param:"events"});let s=await t.managementCreateWebhook(e.businessId,{url:e.url,events:o},n);r(s)||i({businessId:e.businessId,webhook:s.data},"Webhook endpoint created")}},mcp:{tool:"fs_webhook_create",title:"Create webhook endpoint",description:"Create an API-managed outbound webhook endpoint for a business. Returns the signing secret once. If webhooks are declared in business/index.ts, Core returns 409 MANAGED_BY_CODE and the repo must be edited instead.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!0},returnsOneTimeSecret:!0,inputSchema:{businessId:a.string().describe(Rr),url:a.string().url().describe("HTTPS receiver URL."),events:a.array(a.string()).min(1).describe("Webhook event names to subscribe to."),...Ae},handler:async(t,e)=>{let n=await go(t,e.businessId);return t.managementCreateWebhook(n,{url:e.url,events:e.events},{idempotencyKey:e.idempotencyKey})}}},{opKey:"webhook.update",operationClass:"operate",scope:[mo],sideEffect:"write",cli:{group:"webhook",command:"update",summary:"Update a webhook endpoint's events or enabled state",idempotent:!0,args:[fo,Sp,oO,{field:"enable",kind:"flag",token:"--enable",describe:"Enable delivery for this endpoint."},{field:"disable",kind:"flag",token:"--disable",describe:"Disable delivery for this endpoint."}],handler:async({client:t,args:e,reqOpts:n,emit:i,emitDryRunPreview:r})=>{let o=aO(e.events),s=GZ(e);if(!o&&s===void 0)throw new A("Pass --events, --enable, or --disable to update a webhook.",400,{code:"VALIDATION_ERROR"});let c=await t.managementUpdateWebhook(e.businessId,e.webhookId,{...o?{events:o}:{},...s!==void 0?{enabled:s}:{}},n);r(c)||i({businessId:e.businessId,webhook:c.data},"Webhook endpoint updated")}},mcp:{tool:"fs_webhook_update",title:"Update webhook endpoint",description:"Update an API-managed webhook endpoint's event list and/or enabled state. URL and secret are immutable; create a new endpoint for those changes.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe(Rr),webhookId:a.string().describe(Pa),events:a.array(a.string()).min(1).optional().describe("Replacement webhook event list."),enabled:a.boolean().optional().describe("Enable or disable delivery."),...Ae},handler:async(t,e)=>{let n=await go(t,e.businessId);return t.managementUpdateWebhook(n,e.webhookId,{events:e.events,enabled:e.enabled},{idempotencyKey:e.idempotencyKey})}}},{opKey:"webhook.delete",operationClass:"operate",scope:[mo],sideEffect:"write",cli:{group:"webhook",command:"delete",summary:"Delete an API-managed webhook endpoint. Requires --yes.",destructive:!0,yesMessage:"Pass --yes to confirm webhook endpoint deletion.",args:[fo,Sp],handler:async({client:t,args:e,emit:n})=>{await t.managementDeleteWebhook(e.businessId,e.webhookId),n({businessId:e.businessId,deleted:e.webhookId},"Webhook endpoint deleted")}},mcp:{tool:"fs_webhook_delete",title:"Delete webhook endpoint",description:"Delete an API-managed outbound webhook endpoint. If webhooks are repo-managed, Core returns 409 MANAGED_BY_CODE.",annotations:{readOnlyHint:!1,destructiveHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe(Rr),webhookId:a.string().describe(Pa)},handler:async(t,e)=>{let n=await go(t,e.businessId);return t.managementDeleteWebhook(n,e.webhookId)}}},{opKey:"webhook.test",operationClass:"operate",scope:[mo],sideEffect:"write",cli:{group:"webhook",command:"test",summary:"Send a signed test event to a webhook endpoint",args:[fo,Sp],handler:async({client:t,args:e,emit:n})=>{let i=await t.managementTestWebhook(e.businessId,e.webhookId);n({businessId:e.businessId,result:i},"Webhook test sent")}},mcp:{tool:"fs_webhook_test",title:"Test webhook endpoint",description:"Send a signed test event to an API-managed webhook endpoint and persist the delivery result.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!0},inputSchema:{businessId:a.string().describe(Rr),webhookId:a.string().describe(Pa)},handler:async(t,e)=>{let n=await go(t,e.businessId);return t.managementTestWebhook(n,e.webhookId)}}},{opKey:"webhook.delivery.read",operationClass:"operate",scope:[mo],sideEffect:"read",cli:{group:"webhook",command:"deliveries",summary:"List recent delivery attempts for a webhook endpoint",args:[fo,Sp,sO],handler:async({client:t,args:e,emit:n})=>{let i=await t.managementListWebhookDeliveries(e.businessId,e.webhookId,{limit:e.limit}),r=cO(i);n({businessId:e.businessId,webhookId:e.webhookId,count:r.length,total:uO(i,r.length),deliveries:r},`${r.length} delivery attempt(s)`)}},mcp:{tool:"fs_webhook_deliveries",title:"List webhook deliveries",description:"List recent delivery attempts for a webhook endpoint. Payload and response body are intentionally omitted by Core.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe(Rr),webhookId:a.string().describe(Pa),limit:a.string().optional().describe("Max rows to return.")},handler:async(t,e)=>{let n=await go(t,e.businessId);return t.managementListWebhookDeliveries(n,e.webhookId,{limit:e.limit})}}}];var ho="The business id or slug.",tr="operator",Aa={field:"businessId",kind:"positional",token:"<businessIdOrSlug>",describe:ho,resolveBusiness:!0};async function Na(t,e){return ve(t,e)}var dO=[{opKey:"agents.list",operationClass:"operate",scope:["businesses:read"],sideEffect:"read",cli:{group:"agents",command:"list",summary:"List a business's operating agents + enableable roles",args:[Aa],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=await t.builderListAgents(i);n({businessId:i,...r},`${r.agents.length} agent(s) \u2014 enableable roles: ${r.availableRoles.join(", ")}`)}},mcp:{tool:"fs_agents_list",title:"List operating agents",description:"The agent roster for a business: the enabled/disabled Operator plus any roles that can still be enabled. Read-only.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe(ho)},handler:async(t,e)=>{let n=await Na(t,e.businessId);return t.builderListAgents(n)}}},{opKey:"agents.status",operationClass:"operate",scope:["businesses:read"],sideEffect:"read",cli:{group:"agents",command:"status",summary:"The Operator's activation state, recent runs, and usage totals",args:[Aa],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=await t.builderAgentStatus(i,tr);n({businessId:i,...r},`operator: ${r.enabled?"ENABLED":"disabled"} \u2014 last run ${r.lastRunAt??"never"}; ${r.recentRuns.length} recent run(s); ${r.usage.tokensIn+r.usage.tokensOut} tokens, ${r.usage.actionsCount} action(s) lifetime`)}},mcp:{tool:"fs_agents_status",title:"Get the Operator's status",description:"The Operator's activation state, recent run history (newest-first), and lifetime usage totals (LLM tokens + actions). Read-only.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe(ho)},handler:async(t,e)=>{let n=await Na(t,e.businessId);return t.builderAgentStatus(n,tr)}}},{opKey:"agents.runs.show",operationClass:"operate",scope:["businesses:read"],sideEffect:"read",cli:{group:"agents",command:"runs-show",summary:"One run's full paper trail: trace, launches, action receipts",args:[Aa,{field:"runId",kind:"positional",token:"<runId>",describe:"The agent run id (from `agents status`)."}],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=await t.builderAgentRunDetail(i,tr,e.runId),o=r.launches?.length??0,s=r.actions?.length??0;n({businessId:i,...r},`run ${r.run?.id}: ${o} launch(es), ${s} action receipt(s)`)}},mcp:{tool:"fs_agents_run_show",title:"Get one agent run's paper trail",description:"One run's full audit view: the orchestrator's trace summary (composed launches, verify flags, catalog changes), the per-launch performance ledger, and every platform-action receipt. Read-only.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe(ho),runId:a.string().describe("The agent run id.")},handler:async(t,e)=>{let n=await Na(t,e.businessId);return t.builderAgentRunDetail(n,tr,e.runId)}}},{opKey:"agents.enable",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:"agents",command:"enable",summary:"Turn the Operator on (creates it on first enable)",args:[Aa],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=await t.builderConfigureAgent(i,tr,{enabled:!0});n({businessId:i,agent:r},"operator ENABLED \u2014 it runs autonomously on its cadence and posts to the bulletin; usage bills while enabled")}},mcp:{tool:"fs_agents_enable",title:"Enable the Operator",description:"Turn the business's Operator agent on (created on first enable). It runs autonomously on its cadence; agent-work billing accrues while enabled.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe(ho)},handler:async(t,e)=>{let n=await Na(t,e.businessId);return t.builderConfigureAgent(n,tr,{enabled:!0})}}},{opKey:"agents.disable",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:"agents",command:"disable",summary:"Turn the Operator off (stops runs + billing)",args:[Aa],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=await t.builderConfigureAgent(i,tr,{enabled:!1});n({businessId:i,agent:r},"operator disabled \u2014 no further runs; billing stops accruing")}},mcp:{tool:"fs_agents_disable",title:"Disable the Operator",description:"Turn the Operator off: the dispatcher stops scheduling runs and agent-work billing stops accruing. Re-enable at any time.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe(ho)},handler:async(t,e)=>{let n=await Na(t,e.businessId);return t.builderConfigureAgent(n,tr,{enabled:!1})}}}];var Ca="The business id or slug.",$p="The bulletin post id.",xp={field:"businessId",kind:"positional",token:"<businessIdOrSlug>",describe:Ca,resolveBusiness:!0},C_={field:"postId",kind:"positional",token:"<postId>",describe:$p};async function Ip(t,e){return ve(t,e)}var pO=[{opKey:"bulletin.list",operationClass:"operate",scope:["businesses:read"],sideEffect:"read",cli:{group:"bulletin",command:"list",summary:"List the agents' bulletin feed (trends + change requests)",args:[xp,{field:"kind",kind:"flag",token:"--kind <kind>",describe:"Filter: trend | insight | change_request"},{field:"status",kind:"flag",token:"--status <status>",describe:"Filter: open | acknowledged | resolved"},{field:"limit",kind:"flag",token:"--limit <n>",describe:"Max rows to return."}],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=await t.builderListBulletin(i,{kind:e.kind,status:e.status,limit:e.limit});n({businessId:i,...r},`${r.items.length} post(s)${r.nextCursor?" (more available)":""}`)}},mcp:{tool:"fs_bulletin_list",title:"List bulletin posts",description:"The agents' bulletin feed for a business: trend/insight posts (aggregated data + deltas) and change_request posts (the coding agent's backlog \u2014 filter --kind change_request --status open). Read-only.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe(Ca),kind:a.enum(["trend","insight","change_request"]).optional().describe("Filter by post kind."),status:a.enum(["open","acknowledged","resolved"]).optional().describe("Filter by post status."),limit:a.string().optional().describe("Max rows to return.")},handler:async(t,e)=>{let n=await Ip(t,e.businessId);return t.builderListBulletin(n,{kind:e.kind,status:e.status,limit:e.limit})}}},{opKey:"bulletin.read",operationClass:"operate",scope:["businesses:read"],sideEffect:"read",cli:{group:"bulletin",command:"show",summary:"Show one bulletin post (full body + data payload)",args:[xp,C_],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=await t.builderGetBulletinPost(i,e.postId);n({businessId:i,post:r},`[${r.kind}] ${r.title} \u2014 ${r.status}${r.changeSetId?` (changeSet ${r.changeSetId})`:""}`)}},mcp:{tool:"fs_bulletin_show",title:"Show a bulletin post",description:"One bulletin post in full: markdown body, the dataJson payload backing the claim, and for change requests the referenced ChangeSet id + proposal. Read-only.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe(Ca),postId:a.string().describe($p)},handler:async(t,e)=>{let n=await Ip(t,e.businessId);return t.builderGetBulletinPost(n,e.postId)}}},{opKey:"bulletin.ack",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:"bulletin",command:"ack",summary:"Acknowledge a post (the coding agent picked it up)",args:[xp,C_],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=await t.builderSetBulletinStatus(i,e.postId,"acknowledged");n({businessId:i,post:r},`Post acknowledged: ${r.title}`)}},mcp:{tool:"fs_bulletin_ack",title:"Acknowledge a bulletin post",description:"Mark a bulletin post acknowledged \u2014 the hand-off signal that the coding agent (or builder) has picked the item up. Forward-only; idempotent on an already-acknowledged post.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe(Ca),postId:a.string().describe($p)},handler:async(t,e)=>{let n=await Ip(t,e.businessId);return t.builderSetBulletinStatus(n,e.postId,"acknowledged")}}},{opKey:"bulletin.resolve",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:"bulletin",command:"resolve",summary:"Resolve a post (the work landed)",args:[xp,C_],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=await t.builderSetBulletinStatus(i,e.postId,"resolved");n({businessId:i,post:r},`Post resolved: ${r.title}`)}},mcp:{tool:"fs_bulletin_resolve",title:"Resolve a bulletin post",description:"Mark a bulletin post resolved \u2014 the referenced work landed (or the trend was addressed). Terminal state.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe(Ca),postId:a.string().describe($p)},handler:async(t,e)=>{let n=await Ip(t,e.businessId);return t.builderSetBulletinStatus(n,e.postId,"resolved")}}}];var bo="The business id or slug.",Ep="The promo code id.",D_=["percent_off","amount_off","free_months"],za="promo-code",Da={field:"businessId",kind:"positional",token:"<businessIdOrSlug>",describe:bo,resolveBusiness:!0},z_={field:"promoCodeId",kind:"positional",token:"<promoCodeId>",describe:Ep},mO={field:"plan",kind:"flag",token:"--plan <planId>",describe:"Limit to a plan id. Repeatable. Omit for all launch plans; use --all-plans on update to clear scoped plans.",parser:(t,e)=>[...e,t],defaultValue:[]};function fO(t){if(typeof t!="string")return;let e=t.trim().toLowerCase();if(D_.includes(e))return e;throw new A(`Invalid promo code kind "${t}". Use percent_off, amount_off, or free_months.`,400,{code:"INVALID_PROMO_CODE_KIND",param:"kind"})}function yo(t,e){if(e===void 0)return;let n=typeof e=="number"?e:typeof e=="string"&&/^\d+$/.test(e.trim())?Number.parseInt(e,10):Number.NaN;if(!Number.isInteger(n)||n<=0)throw new A(`${t} must be a positive integer.`,400,{code:"INVALID_PROMO_CODE_FIELD",param:t});return n}function Ua(t){return typeof t=="string"&&t.length>0?t:void 0}function gO(t,e){let n=yo("percent",t.percent),i=yo("amountCents",t.amountCents);if(n!==void 0&&i!==void 0)throw new A("Pass either --percent or --amount-cents, not both.",400,{code:"CONFLICTING_PROMO_AMOUNT_FLAGS",param:"amount"});if(e==="percent_off"){if(n===void 0)throw new A("percent_off promo codes require --percent.",400,{code:"INVALID_PROMO_CODE_FIELD",param:"percent"});if(n>100)throw new A("--percent must be between 1 and 100.",400,{code:"INVALID_PROMO_CODE_FIELD",param:"percent"});return n}if(e==="amount_off"){if(i===void 0)throw new A("amount_off promo codes require --amount-cents.",400,{code:"INVALID_PROMO_CODE_FIELD",param:"amountCents"});return i}if(e==="free_months"&&(n!==void 0||i!==void 0))throw new A("free_months promo codes do not accept --percent or --amount-cents.",400,{code:"INVALID_PROMO_CODE_FIELD",param:"amount"});return n??i}function hO(t){let e=t.plan??[];if(t.allPlans===!0&&e.length>0)throw new A("Pass either --plan or --all-plans, not both.",400,{code:"CONFLICTING_PROMO_PLAN_FLAGS",param:"plan"});return t.allPlans===!0?[]:e.length>0?e:void 0}function WZ(t){let e=fO(t.kind);if(!e)throw new A("Promo code kind is required.",400,{code:"INVALID_PROMO_CODE_FIELD",param:"kind"});let n=yo("durationMonths",t.durationMonths);if(n===void 0)throw new A("--duration-months is required.",400,{code:"INVALID_PROMO_CODE_FIELD",param:"durationMonths"});let i=hO(t);return{code:String(t.code),kind:e,amount:gO(t,e),durationMonths:n,...i!==void 0?{applicablePlanIds:i}:{},maxRedemptions:yo("maxRedemptions",t.maxRedemptions),activeFrom:Ua(t.activeFrom),activeUntil:Ua(t.activeUntil)}}function JZ(t){let e=fO(t.kind),n=yo("durationMonths",t.durationMonths),i=yo("maxRedemptions",t.maxRedemptions),r=hO(t);if(t.code!==void 0||e!==void 0||t.percent!==void 0||t.amountCents!==void 0||n!==void 0||i!==void 0||t.clearMaxRedemptions===!0||t.activeFrom!==void 0||t.activeUntil!==void 0||t.clearActiveFrom===!0||t.clearActiveUntil===!0||r!==void 0){if(e===void 0)throw new A("Promo-code spec updates rotate the Stripe coupon, so pass the complete spec: --kind plus --duration-months and the required amount flag for that kind.",400,{code:"PROMO_CODE_UPDATE_REQUIRES_FULL_SPEC",param:"kind"});if(n===void 0)throw new A("Promo-code spec updates require --duration-months.",400,{code:"PROMO_CODE_UPDATE_REQUIRES_FULL_SPEC",param:"durationMonths"})}let s={},c=Ua(t.code);c!==void 0&&(s.code=c),e!==void 0&&(s.kind=e);let u=gO(t,e);if(u!==void 0&&(s.amount=u),n!==void 0&&(s.durationMonths=n),i!==void 0&&(s.maxRedemptions=i),t.clearMaxRedemptions===!0&&(s.maxRedemptions=null),r!==void 0&&(s.applicablePlanIds=r),t.activeFrom!==void 0&&(s.activeFrom=Ua(t.activeFrom)??null),t.activeUntil!==void 0&&(s.activeUntil=Ua(t.activeUntil)??null),t.clearActiveFrom===!0&&(s.activeFrom=null),t.clearActiveUntil===!0&&(s.activeUntil=null),Object.keys(s).length===0)throw new A("No promo-code fields to update. Pass --code, --kind, amount, duration, plan, status-window, or redemption flags.",400,{code:"PROMO_CODE_UPDATE_NO_FIELDS"});return s}async function ja(t,e){return ve(t,e)}function wp(t){return{status:t}}var bO=[{opKey:"promo_code.read",operationClass:"operate",scope:["businesses:read"],sideEffect:"read",cli:{group:za,command:"list",summary:"List API-managed promo codes for checkout",args:[Da],handler:async({client:t,args:e,emit:n})=>{let i=await t.listPromoCodes(e.businessId);n({businessId:e.businessId,count:i.length,promoCodes:i},`${i.length} promo code(s)`)}},mcp:{tool:"fs_promo_code_list",title:"List promo codes",description:"List API-managed promo codes for a business. Promo codes are checkout operational state, not repo-authored Business SDK state.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe(bo)},handler:async(t,e)=>{let n=await ja(t,e.businessId);return t.listPromoCodes(n)}}},{opKey:"promo_code.create",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:za,command:"create",summary:"Create an API-managed checkout promo code",args:[Da,{field:"code",kind:"flag",token:"--code <code>",describe:"Customer-entered promo code.",required:!0},{field:"kind",kind:"flag",token:"--kind <kind>",describe:"percent_off, amount_off, or free_months.",required:!0},{field:"percent",kind:"flag",token:"--percent <n>",describe:"Percent discount for percent_off promos."},{field:"amountCents",kind:"flag",token:"--amount-cents <cents>",describe:"Fixed discount in cents for amount_off promos."},{field:"durationMonths",kind:"flag",token:"--duration-months <n>",describe:"Discount duration in months.",required:!0},{field:"maxRedemptions",kind:"flag",token:"--max-redemptions <n>",describe:"Optional maximum redemption count."},{field:"activeFrom",kind:"flag",token:"--active-from <iso>",describe:"Optional ISO-8601 activation timestamp."},{field:"activeUntil",kind:"flag",token:"--active-until <iso>",describe:"Optional ISO-8601 expiration timestamp."},mO],handler:async({client:t,args:e,emit:n})=>{let i=await t.createPromoCode(e.businessId,WZ(e));n({businessId:e.businessId,promoCode:i},"Promo code created")}},mcp:{tool:"fs_promo_code_create",title:"Create promo code",description:"Create an API-managed checkout promo code. Use percent for percent_off, amountCents for amount_off, and no amount for free_months.",annotations:{readOnlyHint:!1,destructiveHint:!1,openWorldHint:!0},inputSchema:{businessId:a.string().describe(bo),code:a.string().min(1).max(64),kind:a.enum(D_),percent:a.number().int().min(1).max(100).optional(),amountCents:a.number().int().positive().optional(),durationMonths:a.number().int().min(1).max(24),maxRedemptions:a.number().int().positive().optional(),activeFrom:a.string().datetime().optional(),activeUntil:a.string().datetime().optional(),applicablePlanIds:a.array(a.string()).optional()},handler:async(t,e)=>{let n=await ja(t,e.businessId);return t.createPromoCode(n,{code:e.code,kind:e.kind,amount:e.kind==="percent_off"?e.percent:e.kind==="amount_off"?e.amountCents:void 0,durationMonths:e.durationMonths,maxRedemptions:e.maxRedemptions,activeFrom:e.activeFrom,activeUntil:e.activeUntil,applicablePlanIds:e.applicablePlanIds})}}},{opKey:"promo_code.update",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:za,command:"update",summary:"Update an API-managed checkout promo code",args:[Da,z_,{field:"code",kind:"flag",token:"--code <code>",describe:"Replacement customer-entered promo code."},{field:"kind",kind:"flag",token:"--kind <kind>",describe:"percent_off, amount_off, or free_months."},{field:"percent",kind:"flag",token:"--percent <n>",describe:"Percent discount for percent_off promos."},{field:"amountCents",kind:"flag",token:"--amount-cents <cents>",describe:"Fixed discount in cents for amount_off promos."},{field:"durationMonths",kind:"flag",token:"--duration-months <n>",describe:"Discount duration in months."},{field:"maxRedemptions",kind:"flag",token:"--max-redemptions <n>",describe:"Set maximum redemption count."},{field:"clearMaxRedemptions",kind:"flag",token:"--clear-max-redemptions",describe:"Clear the maximum redemption count."},{field:"activeFrom",kind:"flag",token:"--active-from <iso>",describe:"Set ISO-8601 activation timestamp."},{field:"clearActiveFrom",kind:"flag",token:"--clear-active-from",describe:"Clear activation timestamp."},{field:"activeUntil",kind:"flag",token:"--active-until <iso>",describe:"Set ISO-8601 expiration timestamp."},{field:"clearActiveUntil",kind:"flag",token:"--clear-active-until",describe:"Clear expiration timestamp."},mO,{field:"allPlans",kind:"flag",token:"--all-plans",describe:"Clear plan scoping so the promo applies to all launch plans."}],handler:async({client:t,args:e,emit:n})=>{let i=await t.updatePromoCode(e.businessId,e.promoCodeId,JZ(e));n({businessId:e.businessId,promoCode:i},"Promo code updated")}},mcp:{tool:"fs_promo_code_update",title:"Update promo code",description:"Update an API-managed checkout promo code. Spec changes rotate the Stripe coupon/promotion code behind the scenes.",annotations:{readOnlyHint:!1,destructiveHint:!1,openWorldHint:!0},inputSchema:{businessId:a.string().describe(bo),promoCodeId:a.string().describe(Ep),code:a.string().min(1).max(64).optional(),kind:a.enum(D_).optional(),percent:a.number().int().min(1).max(100).optional(),amountCents:a.number().int().positive().optional(),durationMonths:a.number().int().min(1).max(24).optional(),maxRedemptions:a.number().int().positive().nullable().optional(),activeFrom:a.string().datetime().nullable().optional(),activeUntil:a.string().datetime().nullable().optional(),applicablePlanIds:a.array(a.string()).optional()},handler:async(t,e)=>{let n=await ja(t,e.businessId),i={code:e.code,kind:e.kind,amount:e.kind==="percent_off"?e.percent:e.kind==="amount_off"?e.amountCents:void 0,durationMonths:e.durationMonths,maxRedemptions:e.maxRedemptions,activeFrom:e.activeFrom,activeUntil:e.activeUntil,applicablePlanIds:e.applicablePlanIds};return t.updatePromoCode(n,e.promoCodeId,i)}}},{opKey:"promo_code.archive",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:za,command:"archive",summary:"Archive a checkout promo code",args:[Da,z_],handler:async({client:t,args:e,emit:n})=>{let i=await t.updatePromoCode(e.businessId,e.promoCodeId,wp("ARCHIVED"));n({businessId:e.businessId,promoCode:i},"Promo code archived")}},mcp:{tool:"fs_promo_code_archive",title:"Archive promo code",description:"Archive an API-managed checkout promo code.",annotations:{readOnlyHint:!1,destructiveHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe(bo),promoCodeId:a.string().describe(Ep)},handler:async(t,e)=>{let n=await ja(t,e.businessId);return t.updatePromoCode(n,e.promoCodeId,wp("ARCHIVED"))}}},{opKey:"promo_code.reactivate",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:za,command:"reactivate",summary:"Reactivate an archived checkout promo code",args:[Da,z_],handler:async({client:t,args:e,emit:n})=>{let i=await t.updatePromoCode(e.businessId,e.promoCodeId,wp("ACTIVE"));n({businessId:e.businessId,promoCode:i},"Promo code reactivated")}},mcp:{tool:"fs_promo_code_reactivate",title:"Reactivate promo code",description:"Reactivate an archived API-managed checkout promo code.",annotations:{readOnlyHint:!1,destructiveHint:!1,openWorldHint:!1},inputSchema:{businessId:a.string().describe(bo),promoCodeId:a.string().describe(Ep)},handler:async(t,e)=>{let n=await ja(t,e.businessId);return t.updatePromoCode(n,e.promoCodeId,wp("ACTIVE"))}}}];var _o="The business id or slug.",Za="The subscriber id from `consumer list`.",Ma={field:"businessId",kind:"positional",token:"<businessIdOrSlug>",describe:_o,resolveBusiness:!0},Tp={field:"subscriberId",kind:"positional",token:"<subscriberId>",describe:Za},YZ={field:"env",kind:"flag",token:"--env <env>",describe:"Environment name for preview-scoped consumers."},yO="The member's external identity id (Clerk userId) within the client org.",XZ="Comma-separated business-role keys to set (replaces the current assignment; pass an empty string to clear).",QZ={field:"userExternalId",kind:"positional",token:"<userExternalId>",describe:yO};function eB(t){return t.split(",").map(e=>e.trim()).filter(Boolean)}var tB={field:"roles",kind:"flag",token:"--roles <roles>",describe:XZ,required:!0,parser:t=>eB(t)};async function La(t,e){return ve(t,e)}function nB(t){return Array.isArray(t)?t:[]}var _O=[{opKey:"consumer.read",operationClass:"operate",scope:["businesses:read"],sideEffect:"read",cli:{group:"consumer",command:"list",summary:"List users/consumers for a business",args:[Ma,YZ],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=nB(await t.builderListConsumers(i,{env:e.env}));n({businessId:i,count:r.length,consumers:r},`${r.length} consumer(s)`)}},mcp:{tool:"fs_consumer_list",title:"List business consumers",description:"List users/consumers for a business. Read-only; use this to discover subscriber ids before blocking or removing a user.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe(_o),env:a.string().optional().describe("Environment name for preview-scoped consumers.")},handler:async(t,e)=>{let n=await La(t,e.businessId);return t.builderListConsumers(n,{env:e.env})}}},{opKey:"consumer.block",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:"consumer",command:"block",summary:"Block a user and revoke their active API keys",destructive:!0,yesMessage:"Blocking a user revokes active API keys. Pass --yes to confirm.",args:[Ma,Tp],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=e.subscriberId,o=await t.builderBlockConsumer(i,r);n({businessId:i,subscriberId:r,result:o},`Consumer blocked: ${r}`)}},mcp:{tool:"fs_consumer_block",title:"Block business consumer",description:"Block a user/consumer for a business and revoke their active API keys. Destructive live-state operation; it does not edit repo-authored business behavior.",annotations:{readOnlyHint:!1,destructiveHint:!0,idempotentHint:!0,openWorldHint:!0},inputSchema:{businessId:a.string().describe(_o),subscriberId:a.string().describe(Za)},handler:async(t,e)=>{let n=await La(t,e.businessId);return t.builderBlockConsumer(n,e.subscriberId)}}},{opKey:"consumer.migrate_latest",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:"consumer",command:"migrate-latest",summary:"Move one consumer to the active head of their plan lineage",args:[Ma,Tp],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=e.subscriberId,o=await t.builderMigrateConsumerToLatest(i,r);n({businessId:i,subscriberId:r,result:o},`Consumer migration evaluated: ${r}`)}},mcp:{tool:"fs_consumer_migrate_latest",title:"Move consumer to latest plan",description:"Move one consumer onto the current head of their plan lineage immediately. Operates on live subscription state.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!0},inputSchema:{businessId:a.string().describe(_o),subscriberId:a.string().describe(Za)},handler:async(t,e)=>{let n=await La(t,e.businessId);return t.builderMigrateConsumerToLatest(n,e.subscriberId)}}},{opKey:"consumer.remove",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:"consumer",command:"remove",summary:"Force-remove a user from a business",destructive:!0,yesMessage:"Removing a user tears down subscriptions, edge credentials, and related live state. Pass --yes to confirm.",args:[Ma,Tp],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=e.subscriberId,o=await t.builderRemoveConsumer(i,r);n({businessId:i,subscriberId:r,result:o},`Consumer removed: ${r}`)}},mcp:{tool:"fs_consumer_remove",title:"Remove business consumer",description:"Force-remove a user/consumer from a business, tearing down subscriptions, edge credentials, and related live state. Destructive and irreversible; it does not edit repo-authored business behavior.",annotations:{readOnlyHint:!1,destructiveHint:!0,openWorldHint:!0},inputSchema:{businessId:a.string().describe(_o),subscriberId:a.string().describe(Za)},handler:async(t,e)=>{let n=await La(t,e.businessId);return t.builderRemoveConsumer(n,e.subscriberId)}}},{opKey:"consumer.roles.assign",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:"consumer rbac",command:"assign",summary:"Replace a client-org member's Managed-RBAC business roles (builder support override)",args:[Ma,Tp,QZ,tB],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=e.subscriberId,o=e.userExternalId,s=e.roles,c=await t.builderAssignConsumerMemberRoles(i,r,o,s);n({businessId:i,subscriberId:r,membership:c},`Business roles set for ${o}: ${c.businessRoleKeys.length>0?c.businessRoleKeys.join(", "):"(none)"}`)}},mcp:{tool:"fs_consumer_rbac_assign",title:"Assign consumer member business roles",description:"Support override: replace a client-org member's Managed-RBAC business-role assignment on a business (set-replace \u2014 the given list becomes the member's full assignment; an empty list clears it). Role keys must exist in the org's role set. Live-state operation; it does not edit repo-authored business behavior.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!0},inputSchema:{businessId:a.string().describe(_o),subscriberId:a.string().describe(Za),userExternalId:a.string().describe(yO),roles:a.array(a.string()).describe("Business-role keys to set (replaces the current assignment; [] clears it).")},handler:async(t,e)=>{let n=await La(t,e.businessId);return t.builderAssignConsumerMemberRoles(n,e.subscriberId,e.userExternalId,e.roles)}}}];var M_="The business id or slug.",L_="Preview environment slug or id (omit for Main).",kO="Variable name, e.g. POSTHOG_TOKEN.",rB=a.enum(["PUBLIC","BUILD","RUNTIME"]),iB="Where the value goes. public = inlined into the frontend BUNDLE (publishable keys: PostHog project key, Stripe pk_, Sentry DSN); build = build environment only, leak-scanned out of the output; runtime = edge only, never reaches the browser.";async function oB(){if(process.stdin.isTTY)throw new A("Pipe the secret value via stdin. Never pass a secret as a command-line flag.",400,{code:"VARIABLE_STDIN_REQUIRED"});let t="";for await(let e of process.stdin)t+=Buffer.isBuffer(e)?e.toString("utf8"):String(e);return t.replace(/\r?\n$/,"")}var sB=oB;async function Rp(t,e,n){return n?uo(t,e,n):void 0}var Ba={field:"businessId",kind:"positional",token:"<businessIdOrSlug>",describe:M_,resolveBusiness:!0},j_={field:"name",kind:"positional",token:"<name>",describe:kO},Op={field:"env",kind:"flag",token:"--env <slug>",describe:L_},aB={field:"delivery",kind:"flag",token:"--delivery <phase>",describe:"Private delivery boundary: build or runtime. Build values are leak-scanned from artifacts; runtime values are injected only by Gateway.",required:!0};function U_(t,e){return{businessId:t,operation:e}}function vO(t){return{opKey:t==="set"?"business_variable.create":"business_variable.rotate",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:"variables",command:t,summary:t==="set"?"Create a write-only secret from stdin":"Rotate a write-only secret from stdin",helpTextAfter:`
|
|
98
99
|
Example:
|
|
99
|
-
printf %s "$VALUE" | farthershore variables ${t} my-biz POSTHOG_TOKEN`,idempotent:!0,args:[
|
|
100
|
+
printf %s "$VALUE" | farthershore variables ${t} my-biz POSTHOG_TOKEN`,idempotent:!0,args:[Ba,j_,aB,Op],handler:async({client:e,args:n,reqOpts:i,emit:r})=>{let o=n.businessId,s=await e.builderSetBusinessVariable(o,n.name,{value:await sB(),delivery:rB.parse(String(n.delivery).toUpperCase()),environmentId:await Rp(e,o,n.env)},i);r(U_(o,s),`Secret ${n.name} ${s.pending?"publication pending":"active"}`)}},mcp:{tool:t==="set"?"fs_variable_set":"fs_variable_rotate",title:t==="set"?"Create a write-only secret":"Rotate a write-only secret",description:"Creates an immutable secret generation. Plaintext is accepted once and never returned.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe(M_),name:a.string().describe(kO),value:a.string().min(1).describe("The write-only value."),delivery:a.enum(["PUBLIC","BUILD","RUNTIME"]).describe(iB),environmentId:a.string().optional().describe(L_),...Ae},handler:async(e,n)=>e.builderSetBusinessVariable(await ve(e,n.businessId),n.name,{value:n.value,delivery:n.delivery,environmentId:n.environmentId},{idempotencyKey:n.idempotencyKey})}}}var SO=[{opKey:"business_variable.read",operationClass:"operate",scope:["businesses:read"],sideEffect:"read",cli:{group:"variables",command:"list",summary:"List secret lifecycle metadata (never values)",args:[Ba,Op],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=await Rp(t,i,e.env);n({businessId:i,environmentId:r??null,variables:await t.builderBusinessVariables(i,r)},"Write-only secrets")}},mcp:{tool:"fs_variable_list",title:"List write-only secrets",description:"Lists lifecycle and generation metadata. Plaintext is never returned.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe(M_),environmentId:a.string().optional().describe(L_)},handler:async(t,e)=>t.builderBusinessVariables(await ve(t,e.businessId),e.environmentId)}},vO("set"),vO("rotate"),{opKey:"business_variable.revoke",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:"variables",command:"revoke",summary:"Revoke runtime access to a secret. Requires --yes.",destructive:!0,yesMessage:"Revocation removes runtime availability once acknowledged. Pass --yes to confirm.",idempotent:!0,args:[Ba,j_,Op],handler:async({client:t,args:e,reqOpts:n,emit:i})=>{let r=e.businessId,o=await t.builderRevokeBusinessVariable(r,e.name,await Rp(t,r,e.env),n);i(U_(r,o),"Secret revocation submitted")}},mcp:{tool:"fs_variable_revoke",title:"Revoke a write-only secret",description:"Revokes runtime access after explicit confirmation and returns a durable operation.",annotations:{readOnlyHint:!1,destructiveHint:!0,idempotentHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string(),name:a.string(),environmentId:a.string().optional(),confirmation:a.literal("REVOKE"),...Ae},handler:async(t,e)=>t.builderRevokeBusinessVariable(await ve(t,e.businessId),e.name,e.environmentId,{idempotencyKey:e.idempotencyKey})}},{opKey:"business_variable.delete",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:"variables",command:"rm",summary:"Destroy a revoked secret in Main or preview. Requires --yes.",destructive:!0,yesMessage:"Deletion permanently destroys ciphertext and requires acknowledged revocation first. Pass --yes to confirm.",idempotent:!0,args:[Ba,j_,Op],handler:async({client:t,args:e,reqOpts:n,emit:i})=>{let r=e.businessId,o=await t.builderDeleteBusinessVariable(r,e.name,await Rp(t,r,e.env),n);i(U_(r,o),"Secret deletion submitted")}},mcp:{tool:"fs_variable_rm",title:"Destroy a revoked secret",description:"Permanently destroys ciphertext after acknowledged revocation. Main and preview use the same contract.",annotations:{readOnlyHint:!1,destructiveHint:!0,idempotentHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string(),name:a.string(),environmentId:a.string().optional(),confirmation:a.literal("DELETE"),...Ae},handler:async(t,e)=>t.builderDeleteBusinessVariable(await ve(t,e.businessId),e.name,e.environmentId,{idempotencyKey:e.idempotencyKey})}},{opKey:"business_variable.operation.read",operationClass:"operate",scope:["businesses:read"],sideEffect:"read",cli:{group:"variables",command:"status",summary:"Read a durable secret mutation operation",args:[Ba,{field:"operationId",kind:"positional",token:"<operationId>",describe:"Operation id returned by a mutation."}],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId;n({businessId:i,operation:await t.builderGetBusinessVariableOperation(i,e.operationId)},"Secret mutation status")}},mcp:{tool:"fs_variable_operation_get",title:"Get secret mutation status",description:"Reads publication status and frozen impact metadata.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string(),operationId:a.string()},handler:async(t,e)=>t.builderGetBusinessVariableOperation(await ve(t,e.businessId),e.operationId)}}];var xO=[...IR,...nO,...iO,...$R,...wR,...TR,...jR,...lO,...dO,...pO,...bO,..._O,...SO,...UR,...MR,...WR,...YR,...eO,...tO];function IO(t){if(!t.mcp)throw new Error(`toMcpTool called on CLI-only operation "${t.opKey}" (mcp === null).`);let e={name:t.mcp.tool,title:t.mcp.title,description:t.mcp.description,operationClass:t.operationClass,scope:t.scope,sideEffect:t.sideEffect,annotations:t.mcp.annotations,inputSchema:t.mcp.inputSchema,handler:t.mcp.handler};return t.mcp.returnsOneTimeSecret&&(e.returnsOneTimeSecret=!0),e}var Z_=xO.filter(t=>t.mcp).map(IO);function $O(){let t=m_(),e=KT(void 0),n=process.env.FARTHERSHORE_API_URL??t.apiUrl;return YT({apiUrl:n,token:e})}function cB(t){if(t&&typeof t=="object"){let e=t,n=typeof e.code=="string"?` [${e.code}]`:"",i=typeof e.status=="number"?` (HTTP ${e.status})`:"";if(typeof e.message=="string")return`${e.message}${n}${i}`}return String(t)}function uB(t,e,n){let i=async c=>{try{let u=await e.handler(n,c??{}),l=e.returnsOneTimeSecret?u:sp(u),p=fR(e.name,l);return{content:[{type:"text",text:JSON.stringify(p,null,2)}]}}catch(u){let l=u instanceof A?u:new A(cB(u),0),p=gR(e.name,l);return{content:[{type:"text",text:JSON.stringify(p,null,2)}],isError:!0}}},r=Object.keys(e.inputSchema).length>0,o={title:e.title,description:e.description,annotations:{title:e.title,...e.annotations},...r?{inputSchema:e.inputSchema}:{}},s=r?c=>i(c):()=>i({});t.registerTool(e.name,o,s)}function lB(t){for(let e of t){let n=UT(e.operationClass,e.sideEffect);if(n)throw new Error(`[mcp] tool "${e.name}" is misclassified: ${n}`)}}function wO(t){lB(Z_);let e=new Kd({name:"farthershore-agent-business-builder",version:"0.2.0"});for(let n of Z_)uB(e,n,t);return e}function B_(){return wO($O())}async function dB(){let t=B_(),e=new Jl;await t.connect(e)}import.meta.url===`file://${process.argv[1]}`&&dB();export{Z_ as ALL_TOOLS,wO as buildServer,B_ as createMcpServer,$O as mcpClient};
|