@ulm0/ableton-live-mcp 0.0.0-stage → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Ableton-Live-MCP-1.0.0.ablx +0 -0
- package/LICENSE +21 -0
- package/README.md +596 -2
- package/SECURITY.md +61 -0
- package/SHA256SUMS +1 -0
- package/dist/extension.cjs +181 -0
- package/manifest.json +7 -0
- package/package.json +62 -4
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
(() => {
|
|
2
|
+
const names = [
|
|
3
|
+
"fetch","Request","Response","Headers","FormData","Blob","File",
|
|
4
|
+
"ReadableStream","WritableStream","TransformStream","ByteLengthQueuingStrategy","CountQueuingStrategy",
|
|
5
|
+
"TextEncoder","TextDecoder","TextEncoderStream","TextDecoderStream","CompressionStream","DecompressionStream",
|
|
6
|
+
"URL","URLSearchParams","AbortController","AbortSignal",
|
|
7
|
+
"Event","EventTarget","CustomEvent","MessageEvent","MessageChannel","MessagePort",
|
|
8
|
+
"DOMException","structuredClone","crypto","performance","queueMicrotask","setImmediate","clearImmediate",
|
|
9
|
+
"atob","btoa",
|
|
10
|
+
];
|
|
11
|
+
try {
|
|
12
|
+
// Evaluate inside the main context (a core-module function's Function
|
|
13
|
+
// constructor) so Node's lazy global getters run where they are safe.
|
|
14
|
+
const src = "return {" + names.map((n) => n + ": typeof " + n + " === 'undefined' ? undefined : " + n).join(",") + "};";
|
|
15
|
+
const picked = require("node:fs").readFileSync.constructor(src)();
|
|
16
|
+
for (const k of names) {
|
|
17
|
+
if (globalThis[k] === undefined && picked[k] !== undefined) globalThis[k] = picked[k];
|
|
18
|
+
}
|
|
19
|
+
} catch {
|
|
20
|
+
// main-context escape unavailable — run with whatever globals exist
|
|
21
|
+
}
|
|
22
|
+
})();
|
|
23
|
+
"use strict";var Nj=Object.create;var vu=Object.defineProperty;var Mj=Object.getOwnPropertyDescriptor;var Lj=Object.getOwnPropertyNames;var Uj=Object.getPrototypeOf,Zj=Object.prototype.hasOwnProperty;var ne=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}},hn=(e,t)=>{for(var n in t)vu(e,n,{get:t[n],enumerable:!0})},Kk=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Lj(t))!Zj.call(e,r)&&r!==n&&vu(e,r,{get:()=>t[r],enumerable:!(i=Mj(t,r))||i.enumerable});return e};var Sr=(e,t,n)=>(n=e!=null?Nj(Uj(e)):{},Kk(t||!e||!e.__esModule?vu(n,"default",{value:e,enumerable:!0}):n,e)),Fj=e=>Kk(vu({},"__esModule",{value:!0}),e);var xl=ne(Je=>{"use strict";Object.defineProperty(Je,"__esModule",{value:!0});Je.regexpCode=Je.getEsmExportName=Je.getProperty=Je.safeStringify=Je.stringify=Je.strConcat=Je.addCodeArg=Je.str=Je._=Je.nil=Je._Code=Je.Name=Je.IDENTIFIER=Je._CodeOrName=void 0;var wl=class{};Je._CodeOrName=wl;Je.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var ho=class extends wl{constructor(t){if(super(),!Je.IDENTIFIER.test(t))throw new Error("CodeGen: name must be a valid identifier");this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};Je.Name=ho;var Vr=class extends wl{constructor(t){super(),this._items=typeof t=="string"?[t]:t}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let t=this._items[0];return t===""||t==='""'}get str(){var t;return(t=this._str)!==null&&t!==void 0?t:this._str=this._items.reduce((n,i)=>`${n}${i}`,"")}get names(){var t;return(t=this._names)!==null&&t!==void 0?t:this._names=this._items.reduce((n,i)=>(i instanceof ho&&(n[i.str]=(n[i.str]||0)+1),n),{})}};Je._Code=Vr;Je.nil=new Vr("");function mz(e,...t){let n=[e[0]],i=0;for(;i<t.length;)wb(n,t[i]),n.push(e[++i]);return new Vr(n)}Je._=mz;var $b=new Vr("+");function fz(e,...t){let n=[kl(e[0])],i=0;for(;i<t.length;)n.push($b),wb(n,t[i]),n.push($b,kl(e[++i]));return j4(n),new Vr(n)}Je.str=fz;function wb(e,t){t instanceof Vr?e.push(...t._items):t instanceof ho?e.push(t):e.push(C4(t))}Je.addCodeArg=wb;function j4(e){let t=1;for(;t<e.length-1;){if(e[t]===$b){let n=R4(e[t-1],e[t+1]);if(n!==void 0){e.splice(t-1,3,n);continue}e[t++]="+"}t++}}function R4(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string")return t instanceof ho||e[e.length-1]!=='"'?void 0:typeof t!="string"?`${e.slice(0,-1)}${t}"`:t[0]==='"'?e.slice(0,-1)+t.slice(1):void 0;if(typeof t=="string"&&t[0]==='"'&&!(e instanceof ho))return`"${e}${t.slice(1)}`}function D4(e,t){return t.emptyStr()?e:e.emptyStr()?t:fz`${e}${t}`}Je.strConcat=D4;function C4(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:kl(Array.isArray(e)?e.join(","):e)}function A4(e){return new Vr(kl(e))}Je.stringify=A4;function kl(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}Je.safeStringify=kl;function N4(e){return typeof e=="string"&&Je.IDENTIFIER.test(e)?new Vr(`.${e}`):mz`[${e}]`}Je.getProperty=N4;function M4(e){if(typeof e=="string"&&Je.IDENTIFIER.test(e))return new Vr(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}Je.getEsmExportName=M4;function L4(e){return new Vr(e.toString())}Je.regexpCode=L4});var Sb=ne(br=>{"use strict";Object.defineProperty(br,"__esModule",{value:!0});br.ValueScope=br.ValueScopeName=br.Scope=br.varKinds=br.UsedValueState=void 0;var _r=xl(),kb=class extends Error{constructor(t){super(`CodeGen: "code" for ${t} not defined`),this.value=t.value}},lf;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(lf||(br.UsedValueState=lf={}));br.varKinds={const:new _r.Name("const"),let:new _r.Name("let"),var:new _r.Name("var")};var uf=class{constructor({prefixes:t,parent:n}={}){this._names={},this._prefixes=t,this._parent=n}toName(t){return t instanceof _r.Name?t:this.name(t)}name(t){return new _r.Name(this._newName(t))}_newName(t){let n=this._names[t]||this._nameGroup(t);return`${t}${n.index++}`}_nameGroup(t){var n,i;if(!((i=(n=this._parent)===null||n===void 0?void 0:n._prefixes)===null||i===void 0)&&i.has(t)||this._prefixes&&!this._prefixes.has(t))throw new Error(`CodeGen: prefix "${t}" is not allowed in this scope`);return this._names[t]={prefix:t,index:0}}};br.Scope=uf;var df=class extends _r.Name{constructor(t,n){super(n),this.prefix=t}setValue(t,{property:n,itemIndex:i}){this.value=t,this.scopePath=(0,_r._)`.${new _r.Name(n)}[${i}]`}};br.ValueScopeName=df;var U4=(0,_r._)`\n`,xb=class extends uf{constructor(t){super(t),this._values={},this._scope=t.scope,this.opts={...t,_n:t.lines?U4:_r.nil}}get(){return this._scope}name(t){return new df(t,this._newName(t))}value(t,n){var i;if(n.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let r=this.toName(t),{prefix:o}=r,a=(i=n.key)!==null&&i!==void 0?i:n.ref,s=this._values[o];if(s){let u=s.get(a);if(u)return u}else s=this._values[o]=new Map;s.set(a,r);let c=this._scope[o]||(this._scope[o]=[]),l=c.length;return c[l]=n.ref,r.setValue(n,{property:o,itemIndex:l}),r}getValue(t,n){let i=this._values[t];if(i)return i.get(n)}scopeRefs(t,n=this._values){return this._reduceValues(n,i=>{if(i.scopePath===void 0)throw new Error(`CodeGen: name "${i}" has no value`);return(0,_r._)`${t}${i.scopePath}`})}scopeCode(t=this._values,n,i){return this._reduceValues(t,r=>{if(r.value===void 0)throw new Error(`CodeGen: name "${r}" has no value`);return r.value.code},n,i)}_reduceValues(t,n,i={},r){let o=_r.nil;for(let a in t){let s=t[a];if(!s)continue;let c=i[a]=i[a]||new Map;s.forEach(l=>{if(c.has(l))return;c.set(l,lf.Started);let u=n(l);if(u){let p=this.opts.es5?br.varKinds.var:br.varKinds.const;o=(0,_r._)`${o}${p} ${l} = ${u};${this.opts._n}`}else if(u=r?.(l))o=(0,_r._)`${o}${u}${this.opts._n}`;else throw new kb(l);c.set(l,lf.Completed)})}return o}};br.ValueScope=xb});var Oe=ne(De=>{"use strict";Object.defineProperty(De,"__esModule",{value:!0});De.or=De.and=De.not=De.CodeGen=De.operators=De.varKinds=De.ValueScopeName=De.ValueScope=De.Scope=De.Name=De.regexpCode=De.stringify=De.getProperty=De.nil=De.strConcat=De.str=De._=void 0;var Fe=xl(),sn=Sb(),Si=xl();Object.defineProperty(De,"_",{enumerable:!0,get:function(){return Si._}});Object.defineProperty(De,"str",{enumerable:!0,get:function(){return Si.str}});Object.defineProperty(De,"strConcat",{enumerable:!0,get:function(){return Si.strConcat}});Object.defineProperty(De,"nil",{enumerable:!0,get:function(){return Si.nil}});Object.defineProperty(De,"getProperty",{enumerable:!0,get:function(){return Si.getProperty}});Object.defineProperty(De,"stringify",{enumerable:!0,get:function(){return Si.stringify}});Object.defineProperty(De,"regexpCode",{enumerable:!0,get:function(){return Si.regexpCode}});Object.defineProperty(De,"Name",{enumerable:!0,get:function(){return Si.Name}});var hf=Sb();Object.defineProperty(De,"Scope",{enumerable:!0,get:function(){return hf.Scope}});Object.defineProperty(De,"ValueScope",{enumerable:!0,get:function(){return hf.ValueScope}});Object.defineProperty(De,"ValueScopeName",{enumerable:!0,get:function(){return hf.ValueScopeName}});Object.defineProperty(De,"varKinds",{enumerable:!0,get:function(){return hf.varKinds}});De.operators={GT:new Fe._Code(">"),GTE:new Fe._Code(">="),LT:new Fe._Code("<"),LTE:new Fe._Code("<="),EQ:new Fe._Code("==="),NEQ:new Fe._Code("!=="),NOT:new Fe._Code("!"),OR:new Fe._Code("||"),AND:new Fe._Code("&&"),ADD:new Fe._Code("+")};var Vn=class{optimizeNodes(){return this}optimizeNames(t,n){return this}},Ib=class extends Vn{constructor(t,n,i){super(),this.varKind=t,this.name=n,this.rhs=i}render({es5:t,_n:n}){let i=t?sn.varKinds.var:this.varKind,r=this.rhs===void 0?"":` = ${this.rhs}`;return`${i} ${this.name}${r};`+n}optimizeNames(t,n){if(t[this.name.str])return this.rhs&&(this.rhs=ns(this.rhs,t,n)),this}get names(){return this.rhs instanceof Fe._CodeOrName?this.rhs.names:{}}},pf=class extends Vn{constructor(t,n,i){super(),this.lhs=t,this.rhs=n,this.sideEffects=i}render({_n:t}){return`${this.lhs} = ${this.rhs};`+t}optimizeNames(t,n){if(!(this.lhs instanceof Fe.Name&&!t[this.lhs.str]&&!this.sideEffects))return this.rhs=ns(this.rhs,t,n),this}get names(){let t=this.lhs instanceof Fe.Name?{}:{...this.lhs.names};return ff(t,this.rhs)}},Tb=class extends pf{constructor(t,n,i,r){super(t,i,r),this.op=n}render({_n:t}){return`${this.lhs} ${this.op}= ${this.rhs};`+t}},zb=class extends Vn{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`${this.label}:`+t}},Pb=class extends Vn{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`break${this.label?` ${this.label}`:""};`+t}},Eb=class extends Vn{constructor(t){super(),this.error=t}render({_n:t}){return`throw ${this.error};`+t}get names(){return this.error.names}},Ob=class extends Vn{constructor(t){super(),this.code=t}render({_n:t}){return`${this.code};`+t}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(t,n){return this.code=ns(this.code,t,n),this}get names(){return this.code instanceof Fe._CodeOrName?this.code.names:{}}},Sl=class extends Vn{constructor(t=[]){super(),this.nodes=t}render(t){return this.nodes.reduce((n,i)=>n+i.render(t),"")}optimizeNodes(){let{nodes:t}=this,n=t.length;for(;n--;){let i=t[n].optimizeNodes();Array.isArray(i)?t.splice(n,1,...i):i?t[n]=i:t.splice(n,1)}return t.length>0?this:void 0}optimizeNames(t,n){let{nodes:i}=this,r=i.length;for(;r--;){let o=i[r];o.optimizeNames(t,n)||(Z4(t,o.names),i.splice(r,1))}return i.length>0?this:void 0}get names(){return this.nodes.reduce((t,n)=>yo(t,n.names),{})}},qn=class extends Sl{render(t){return"{"+t._n+super.render(t)+"}"+t._n}},jb=class extends Sl{},rs=class extends qn{};rs.kind="else";var go=class e extends qn{constructor(t,n){super(n),this.condition=t}render(t){let n=`if(${this.condition})`+super.render(t);return this.else&&(n+="else "+this.else.render(t)),n}optimizeNodes(){super.optimizeNodes();let t=this.condition;if(t===!0)return this.nodes;let n=this.else;if(n){let i=n.optimizeNodes();n=this.else=Array.isArray(i)?new rs(i):i}if(n)return t===!1?n instanceof e?n:n.nodes:this.nodes.length?this:new e(hz(t),n instanceof e?[n]:n.nodes);if(!(t===!1||!this.nodes.length))return this}optimizeNames(t,n){var i;if(this.else=(i=this.else)===null||i===void 0?void 0:i.optimizeNames(t,n),!!(super.optimizeNames(t,n)||this.else))return this.condition=ns(this.condition,t,n),this}get names(){let t=super.names;return ff(t,this.condition),this.else&&yo(t,this.else.names),t}};go.kind="if";var vo=class extends qn{};vo.kind="for";var Rb=class extends vo{constructor(t){super(),this.iteration=t}render(t){return`for(${this.iteration})`+super.render(t)}optimizeNames(t,n){if(super.optimizeNames(t,n))return this.iteration=ns(this.iteration,t,n),this}get names(){return yo(super.names,this.iteration.names)}},Db=class extends vo{constructor(t,n,i,r){super(),this.varKind=t,this.name=n,this.from=i,this.to=r}render(t){let n=t.es5?sn.varKinds.var:this.varKind,{name:i,from:r,to:o}=this;return`for(${n} ${i}=${r}; ${i}<${o}; ${i}++)`+super.render(t)}get names(){let t=ff(super.names,this.from);return ff(t,this.to)}},mf=class extends vo{constructor(t,n,i,r){super(),this.loop=t,this.varKind=n,this.name=i,this.iterable=r}render(t){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(t)}optimizeNames(t,n){if(super.optimizeNames(t,n))return this.iterable=ns(this.iterable,t,n),this}get names(){return yo(super.names,this.iterable.names)}},Il=class extends qn{constructor(t,n,i){super(),this.name=t,this.args=n,this.async=i}render(t){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(t)}};Il.kind="func";var Tl=class extends Sl{render(t){return"return "+super.render(t)}};Tl.kind="return";var Cb=class extends qn{render(t){let n="try"+super.render(t);return this.catch&&(n+=this.catch.render(t)),this.finally&&(n+=this.finally.render(t)),n}optimizeNodes(){var t,n;return super.optimizeNodes(),(t=this.catch)===null||t===void 0||t.optimizeNodes(),(n=this.finally)===null||n===void 0||n.optimizeNodes(),this}optimizeNames(t,n){var i,r;return super.optimizeNames(t,n),(i=this.catch)===null||i===void 0||i.optimizeNames(t,n),(r=this.finally)===null||r===void 0||r.optimizeNames(t,n),this}get names(){let t=super.names;return this.catch&&yo(t,this.catch.names),this.finally&&yo(t,this.finally.names),t}},zl=class extends qn{constructor(t){super(),this.error=t}render(t){return`catch(${this.error})`+super.render(t)}};zl.kind="catch";var Pl=class extends qn{render(t){return"finally"+super.render(t)}};Pl.kind="finally";var Ab=class{constructor(t,n={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...n,_n:n.lines?`
|
|
24
|
+
`:""},this._extScope=t,this._scope=new sn.Scope({parent:t}),this._nodes=[new jb]}toString(){return this._root.render(this.opts)}name(t){return this._scope.name(t)}scopeName(t){return this._extScope.name(t)}scopeValue(t,n){let i=this._extScope.value(t,n);return(this._values[i.prefix]||(this._values[i.prefix]=new Set)).add(i),i}getScopeValue(t,n){return this._extScope.getValue(t,n)}scopeRefs(t){return this._extScope.scopeRefs(t,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(t,n,i,r){let o=this._scope.toName(n);return i!==void 0&&r&&(this._constants[o.str]=i),this._leafNode(new Ib(t,o,i)),o}const(t,n,i){return this._def(sn.varKinds.const,t,n,i)}let(t,n,i){return this._def(sn.varKinds.let,t,n,i)}var(t,n,i){return this._def(sn.varKinds.var,t,n,i)}assign(t,n,i){return this._leafNode(new pf(t,n,i))}add(t,n){return this._leafNode(new Tb(t,De.operators.ADD,n))}code(t){return typeof t=="function"?t():t!==Fe.nil&&this._leafNode(new Ob(t)),this}object(...t){let n=["{"];for(let[i,r]of t)n.length>1&&n.push(","),n.push(i),(i!==r||this.opts.es5)&&(n.push(":"),(0,Fe.addCodeArg)(n,r));return n.push("}"),new Fe._Code(n)}if(t,n,i){if(this._blockNode(new go(t)),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(t){return this._elseNode(new go(t))}else(){return this._elseNode(new rs)}endIf(){return this._endBlockNode(go,rs)}_for(t,n){return this._blockNode(t),n&&this.code(n).endFor(),this}for(t,n){return this._for(new Rb(t),n)}forRange(t,n,i,r,o=this.opts.es5?sn.varKinds.var:sn.varKinds.let){let a=this._scope.toName(t);return this._for(new Db(o,a,n,i),()=>r(a))}forOf(t,n,i,r=sn.varKinds.const){let o=this._scope.toName(t);if(this.opts.es5){let a=n instanceof Fe.Name?n:this.var("_arr",n);return this.forRange("_i",0,(0,Fe._)`${a}.length`,s=>{this.var(o,(0,Fe._)`${a}[${s}]`),i(o)})}return this._for(new mf("of",r,o,n),()=>i(o))}forIn(t,n,i,r=this.opts.es5?sn.varKinds.var:sn.varKinds.const){if(this.opts.ownProperties)return this.forOf(t,(0,Fe._)`Object.keys(${n})`,i);let o=this._scope.toName(t);return this._for(new mf("in",r,o,n),()=>i(o))}endFor(){return this._endBlockNode(vo)}label(t){return this._leafNode(new zb(t))}break(t){return this._leafNode(new Pb(t))}return(t){let n=new Tl;if(this._blockNode(n),this.code(t),n.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Tl)}try(t,n,i){if(!n&&!i)throw new Error('CodeGen: "try" without "catch" and "finally"');let r=new Cb;if(this._blockNode(r),this.code(t),n){let o=this.name("e");this._currNode=r.catch=new zl(o),n(o)}return i&&(this._currNode=r.finally=new Pl,this.code(i)),this._endBlockNode(zl,Pl)}throw(t){return this._leafNode(new Eb(t))}block(t,n){return this._blockStarts.push(this._nodes.length),t&&this.code(t).endBlock(n),this}endBlock(t){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||t!==void 0&&i!==t)throw new Error(`CodeGen: wrong number of nodes: ${i} vs ${t} expected`);return this._nodes.length=n,this}func(t,n=Fe.nil,i,r){return this._blockNode(new Il(t,n,i)),r&&this.code(r).endFunc(),this}endFunc(){return this._endBlockNode(Il)}optimize(t=1){for(;t-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(t){return this._currNode.nodes.push(t),this}_blockNode(t){this._currNode.nodes.push(t),this._nodes.push(t)}_endBlockNode(t,n){let i=this._currNode;if(i instanceof t||n&&i instanceof n)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${n?`${t.kind}/${n.kind}`:t.kind}"`)}_elseNode(t){let n=this._currNode;if(!(n instanceof go))throw new Error('CodeGen: "else" without "if"');return this._currNode=n.else=t,this}get _root(){return this._nodes[0]}get _currNode(){let t=this._nodes;return t[t.length-1]}set _currNode(t){let n=this._nodes;n[n.length-1]=t}};De.CodeGen=Ab;function yo(e,t){for(let n in t)e[n]=(e[n]||0)+(t[n]||0);return e}function ff(e,t){return t instanceof Fe._CodeOrName?yo(e,t.names):e}function ns(e,t,n){if(e instanceof Fe.Name)return i(e);if(!r(e))return e;return new Fe._Code(e._items.reduce((o,a)=>(a instanceof Fe.Name&&(a=i(a)),a instanceof Fe._Code?o.push(...a._items):o.push(a),o),[]));function i(o){let a=n[o.str];return a===void 0||t[o.str]!==1?o:(delete t[o.str],a)}function r(o){return o instanceof Fe._Code&&o._items.some(a=>a instanceof Fe.Name&&t[a.str]===1&&n[a.str]!==void 0)}}function Z4(e,t){for(let n in t)e[n]=(e[n]||0)-(t[n]||0)}function hz(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:(0,Fe._)`!${Nb(e)}`}De.not=hz;var F4=gz(De.operators.AND);function V4(...e){return e.reduce(F4)}De.and=V4;var q4=gz(De.operators.OR);function B4(...e){return e.reduce(q4)}De.or=B4;function gz(e){return(t,n)=>t===Fe.nil?n:n===Fe.nil?t:(0,Fe._)`${Nb(t)} ${e} ${Nb(n)}`}function Nb(e){return e instanceof Fe.Name?e:(0,Fe._)`(${e})`}});var Ve=ne(Ae=>{"use strict";Object.defineProperty(Ae,"__esModule",{value:!0});Ae.checkStrictMode=Ae.getErrorPath=Ae.Type=Ae.useFunc=Ae.setEvaluated=Ae.evaluatedPropsToName=Ae.mergeEvaluated=Ae.eachItem=Ae.unescapeJsonPointer=Ae.escapeJsonPointer=Ae.escapeFragment=Ae.unescapeFragment=Ae.schemaRefOrVal=Ae.schemaHasRulesButRef=Ae.schemaHasRules=Ae.checkUnknownRules=Ae.alwaysValidSchema=Ae.toHash=void 0;var at=Oe(),H4=xl();function J4(e){let t={};for(let n of e)t[n]=!0;return t}Ae.toHash=J4;function G4(e,t){return typeof t=="boolean"?t:Object.keys(t).length===0?!0:(_z(e,t),!bz(t,e.self.RULES.all))}Ae.alwaysValidSchema=G4;function _z(e,t=e.schema){let{opts:n,self:i}=e;if(!n.strictSchema||typeof t=="boolean")return;let r=i.RULES.keywords;for(let o in t)r[o]||kz(e,`unknown keyword: "${o}"`)}Ae.checkUnknownRules=_z;function bz(e,t){if(typeof e=="boolean")return!e;for(let n in e)if(t[n])return!0;return!1}Ae.schemaHasRules=bz;function K4(e,t){if(typeof e=="boolean")return!e;for(let n in e)if(n!=="$ref"&&t.all[n])return!0;return!1}Ae.schemaHasRulesButRef=K4;function W4({topSchemaRef:e,schemaPath:t},n,i,r){if(!r){if(typeof n=="number"||typeof n=="boolean")return n;if(typeof n=="string")return(0,at._)`${n}`}return(0,at._)`${e}${t}${(0,at.getProperty)(i)}`}Ae.schemaRefOrVal=W4;function X4(e){return $z(decodeURIComponent(e))}Ae.unescapeFragment=X4;function Y4(e){return encodeURIComponent(Lb(e))}Ae.escapeFragment=Y4;function Lb(e){return typeof e=="number"?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}Ae.escapeJsonPointer=Lb;function $z(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}Ae.unescapeJsonPointer=$z;function Q4(e,t){if(Array.isArray(e))for(let n of e)t(n);else t(e)}Ae.eachItem=Q4;function vz({mergeNames:e,mergeToName:t,mergeValues:n,resultToName:i}){return(r,o,a,s)=>{let c=a===void 0?o:a instanceof at.Name?(o instanceof at.Name?e(r,o,a):t(r,o,a),a):o instanceof at.Name?(t(r,a,o),o):n(o,a);return s===at.Name&&!(c instanceof at.Name)?i(r,c):c}}Ae.mergeEvaluated={props:vz({mergeNames:(e,t,n)=>e.if((0,at._)`${n} !== true && ${t} !== undefined`,()=>{e.if((0,at._)`${t} === true`,()=>e.assign(n,!0),()=>e.assign(n,(0,at._)`${n} || {}`).code((0,at._)`Object.assign(${n}, ${t})`))}),mergeToName:(e,t,n)=>e.if((0,at._)`${n} !== true`,()=>{t===!0?e.assign(n,!0):(e.assign(n,(0,at._)`${n} || {}`),Ub(e,n,t))}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:wz}),items:vz({mergeNames:(e,t,n)=>e.if((0,at._)`${n} !== true && ${t} !== undefined`,()=>e.assign(n,(0,at._)`${t} === true ? true : ${n} > ${t} ? ${n} : ${t}`)),mergeToName:(e,t,n)=>e.if((0,at._)`${n} !== true`,()=>e.assign(n,t===!0?!0:(0,at._)`${n} > ${t} ? ${n} : ${t}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function wz(e,t){if(t===!0)return e.var("props",!0);let n=e.var("props",(0,at._)`{}`);return t!==void 0&&Ub(e,n,t),n}Ae.evaluatedPropsToName=wz;function Ub(e,t,n){Object.keys(n).forEach(i=>e.assign((0,at._)`${t}${(0,at.getProperty)(i)}`,!0))}Ae.setEvaluated=Ub;var yz={};function eL(e,t){return e.scopeValue("func",{ref:t,code:yz[t.code]||(yz[t.code]=new H4._Code(t.code))})}Ae.useFunc=eL;var Mb;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(Mb||(Ae.Type=Mb={}));function tL(e,t,n){if(e instanceof at.Name){let i=t===Mb.Num;return n?i?(0,at._)`"[" + ${e} + "]"`:(0,at._)`"['" + ${e} + "']"`:i?(0,at._)`"/" + ${e}`:(0,at._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return n?(0,at.getProperty)(e).toString():"/"+Lb(e)}Ae.getErrorPath=tL;function kz(e,t,n=e.opts.strictSchema){if(n){if(t=`strict mode: ${t}`,n===!0)throw new Error(t);e.self.logger.warn(t)}}Ae.checkStrictMode=kz});var Bn=ne(Zb=>{"use strict";Object.defineProperty(Zb,"__esModule",{value:!0});var Xt=Oe(),rL={data:new Xt.Name("data"),valCxt:new Xt.Name("valCxt"),instancePath:new Xt.Name("instancePath"),parentData:new Xt.Name("parentData"),parentDataProperty:new Xt.Name("parentDataProperty"),rootData:new Xt.Name("rootData"),dynamicAnchors:new Xt.Name("dynamicAnchors"),vErrors:new Xt.Name("vErrors"),errors:new Xt.Name("errors"),this:new Xt.Name("this"),self:new Xt.Name("self"),scope:new Xt.Name("scope"),json:new Xt.Name("json"),jsonPos:new Xt.Name("jsonPos"),jsonLen:new Xt.Name("jsonLen"),jsonPart:new Xt.Name("jsonPart")};Zb.default=rL});var El=ne(Yt=>{"use strict";Object.defineProperty(Yt,"__esModule",{value:!0});Yt.extendErrors=Yt.resetErrorsCount=Yt.reportExtraError=Yt.reportError=Yt.keyword$DataError=Yt.keywordError=void 0;var qe=Oe(),gf=Ve(),lr=Bn();Yt.keywordError={message:({keyword:e})=>(0,qe.str)`must pass "${e}" keyword validation`};Yt.keyword$DataError={message:({keyword:e,schemaType:t})=>t?(0,qe.str)`"${e}" keyword must be ${t} ($data)`:(0,qe.str)`"${e}" keyword is invalid ($data)`};function nL(e,t=Yt.keywordError,n,i){let{it:r}=e,{gen:o,compositeRule:a,allErrors:s}=r,c=Iz(e,t,n);i??(a||s)?xz(o,c):Sz(r,(0,qe._)`[${c}]`)}Yt.reportError=nL;function iL(e,t=Yt.keywordError,n){let{it:i}=e,{gen:r,compositeRule:o,allErrors:a}=i,s=Iz(e,t,n);xz(r,s),o||a||Sz(i,lr.default.vErrors)}Yt.reportExtraError=iL;function oL(e,t){e.assign(lr.default.errors,t),e.if((0,qe._)`${lr.default.vErrors} !== null`,()=>e.if(t,()=>e.assign((0,qe._)`${lr.default.vErrors}.length`,t),()=>e.assign(lr.default.vErrors,null)))}Yt.resetErrorsCount=oL;function aL({gen:e,keyword:t,schemaValue:n,data:i,errsCount:r,it:o}){if(r===void 0)throw new Error("ajv implementation error");let a=e.name("err");e.forRange("i",r,lr.default.errors,s=>{e.const(a,(0,qe._)`${lr.default.vErrors}[${s}]`),e.if((0,qe._)`${a}.instancePath === undefined`,()=>e.assign((0,qe._)`${a}.instancePath`,(0,qe.strConcat)(lr.default.instancePath,o.errorPath))),e.assign((0,qe._)`${a}.schemaPath`,(0,qe.str)`${o.errSchemaPath}/${t}`),o.opts.verbose&&(e.assign((0,qe._)`${a}.schema`,n),e.assign((0,qe._)`${a}.data`,i))})}Yt.extendErrors=aL;function xz(e,t){let n=e.const("err",t);e.if((0,qe._)`${lr.default.vErrors} === null`,()=>e.assign(lr.default.vErrors,(0,qe._)`[${n}]`),(0,qe._)`${lr.default.vErrors}.push(${n})`),e.code((0,qe._)`${lr.default.errors}++`)}function Sz(e,t){let{gen:n,validateName:i,schemaEnv:r}=e;r.$async?n.throw((0,qe._)`new ${e.ValidationError}(${t})`):(n.assign((0,qe._)`${i}.errors`,t),n.return(!1))}var _o={keyword:new qe.Name("keyword"),schemaPath:new qe.Name("schemaPath"),params:new qe.Name("params"),propertyName:new qe.Name("propertyName"),message:new qe.Name("message"),schema:new qe.Name("schema"),parentSchema:new qe.Name("parentSchema")};function Iz(e,t,n){let{createErrors:i}=e.it;return i===!1?(0,qe._)`{}`:sL(e,t,n)}function sL(e,t,n={}){let{gen:i,it:r}=e,o=[cL(r,n),lL(e,n)];return uL(e,t,o),i.object(...o)}function cL({errorPath:e},{instancePath:t}){let n=t?(0,qe.str)`${e}${(0,gf.getErrorPath)(t,gf.Type.Str)}`:e;return[lr.default.instancePath,(0,qe.strConcat)(lr.default.instancePath,n)]}function lL({keyword:e,it:{errSchemaPath:t}},{schemaPath:n,parentSchema:i}){let r=i?t:(0,qe.str)`${t}/${e}`;return n&&(r=(0,qe.str)`${r}${(0,gf.getErrorPath)(n,gf.Type.Str)}`),[_o.schemaPath,r]}function uL(e,{params:t,message:n},i){let{keyword:r,data:o,schemaValue:a,it:s}=e,{opts:c,propertyName:l,topSchemaRef:u,schemaPath:p}=s;i.push([_o.keyword,r],[_o.params,typeof t=="function"?t(e):t||(0,qe._)`{}`]),c.messages&&i.push([_o.message,typeof n=="function"?n(e):n]),c.verbose&&i.push([_o.schema,a],[_o.parentSchema,(0,qe._)`${u}${p}`],[lr.default.data,o]),l&&i.push([_o.propertyName,l])}});var zz=ne(is=>{"use strict";Object.defineProperty(is,"__esModule",{value:!0});is.boolOrEmptySchema=is.topBoolOrEmptySchema=void 0;var dL=El(),pL=Oe(),mL=Bn(),fL={message:"boolean schema is false"};function hL(e){let{gen:t,schema:n,validateName:i}=e;n===!1?Tz(e,!1):typeof n=="object"&&n.$async===!0?t.return(mL.default.data):(t.assign((0,pL._)`${i}.errors`,null),t.return(!0))}is.topBoolOrEmptySchema=hL;function gL(e,t){let{gen:n,schema:i}=e;i===!1?(n.var(t,!1),Tz(e)):n.var(t,!0)}is.boolOrEmptySchema=gL;function Tz(e,t){let{gen:n,data:i}=e,r={gen:n,keyword:"false schema",data:i,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,dL.reportError)(r,fL,void 0,t)}});var Fb=ne(os=>{"use strict";Object.defineProperty(os,"__esModule",{value:!0});os.getRules=os.isJSONType=void 0;var vL=["string","number","integer","boolean","null","object","array"],yL=new Set(vL);function _L(e){return typeof e=="string"&&yL.has(e)}os.isJSONType=_L;function bL(){let e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}os.getRules=bL});var Vb=ne(Ii=>{"use strict";Object.defineProperty(Ii,"__esModule",{value:!0});Ii.shouldUseRule=Ii.shouldUseGroup=Ii.schemaHasRulesForType=void 0;function $L({schema:e,self:t},n){let i=t.RULES.types[n];return i&&i!==!0&&Pz(e,i)}Ii.schemaHasRulesForType=$L;function Pz(e,t){return t.rules.some(n=>Ez(e,n))}Ii.shouldUseGroup=Pz;function Ez(e,t){var n;return e[t.keyword]!==void 0||((n=t.definition.implements)===null||n===void 0?void 0:n.some(i=>e[i]!==void 0))}Ii.shouldUseRule=Ez});var Ol=ne(Qt=>{"use strict";Object.defineProperty(Qt,"__esModule",{value:!0});Qt.reportTypeError=Qt.checkDataTypes=Qt.checkDataType=Qt.coerceAndCheckDataType=Qt.getJSONTypes=Qt.getSchemaTypes=Qt.DataType=void 0;var wL=Fb(),kL=Vb(),xL=El(),Ee=Oe(),Oz=Ve(),as;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(as||(Qt.DataType=as={}));function SL(e){let t=jz(e.type);if(t.includes("null")){if(e.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&e.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');e.nullable===!0&&t.push("null")}return t}Qt.getSchemaTypes=SL;function jz(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(wL.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}Qt.getJSONTypes=jz;function IL(e,t){let{gen:n,data:i,opts:r}=e,o=TL(t,r.coerceTypes),a=t.length>0&&!(o.length===0&&t.length===1&&(0,kL.schemaHasRulesForType)(e,t[0]));if(a){let s=Bb(t,i,r.strictNumbers,as.Wrong);n.if(s,()=>{o.length?zL(e,t,o):Hb(e)})}return a}Qt.coerceAndCheckDataType=IL;var Rz=new Set(["string","number","integer","boolean","null"]);function TL(e,t){return t?e.filter(n=>Rz.has(n)||t==="array"&&n==="array"):[]}function zL(e,t,n){let{gen:i,data:r,opts:o}=e,a=i.let("dataType",(0,Ee._)`typeof ${r}`),s=i.let("coerced",(0,Ee._)`undefined`);o.coerceTypes==="array"&&i.if((0,Ee._)`${a} == 'object' && Array.isArray(${r}) && ${r}.length == 1`,()=>i.assign(r,(0,Ee._)`${r}[0]`).assign(a,(0,Ee._)`typeof ${r}`).if(Bb(t,r,o.strictNumbers),()=>i.assign(s,r))),i.if((0,Ee._)`${s} !== undefined`);for(let l of n)(Rz.has(l)||l==="array"&&o.coerceTypes==="array")&&c(l);i.else(),Hb(e),i.endIf(),i.if((0,Ee._)`${s} !== undefined`,()=>{i.assign(r,s),PL(e,s)});function c(l){switch(l){case"string":i.elseIf((0,Ee._)`${a} == "number" || ${a} == "boolean"`).assign(s,(0,Ee._)`"" + ${r}`).elseIf((0,Ee._)`${r} === null`).assign(s,(0,Ee._)`""`);return;case"number":i.elseIf((0,Ee._)`${a} == "boolean" || ${r} === null
|
|
25
|
+
|| (${a} == "string" && ${r} && ${r} == +${r})`).assign(s,(0,Ee._)`+${r}`);return;case"integer":i.elseIf((0,Ee._)`${a} === "boolean" || ${r} === null
|
|
26
|
+
|| (${a} === "string" && ${r} && ${r} == +${r} && !(${r} % 1))`).assign(s,(0,Ee._)`+${r}`);return;case"boolean":i.elseIf((0,Ee._)`${r} === "false" || ${r} === 0 || ${r} === null`).assign(s,!1).elseIf((0,Ee._)`${r} === "true" || ${r} === 1`).assign(s,!0);return;case"null":i.elseIf((0,Ee._)`${r} === "" || ${r} === 0 || ${r} === false`),i.assign(s,null);return;case"array":i.elseIf((0,Ee._)`${a} === "string" || ${a} === "number"
|
|
27
|
+
|| ${a} === "boolean" || ${r} === null`).assign(s,(0,Ee._)`[${r}]`)}}}function PL({gen:e,parentData:t,parentDataProperty:n},i){e.if((0,Ee._)`${t} !== undefined`,()=>e.assign((0,Ee._)`${t}[${n}]`,i))}function qb(e,t,n,i=as.Correct){let r=i===as.Correct?Ee.operators.EQ:Ee.operators.NEQ,o;switch(e){case"null":return(0,Ee._)`${t} ${r} null`;case"array":o=(0,Ee._)`Array.isArray(${t})`;break;case"object":o=(0,Ee._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":o=a((0,Ee._)`!(${t} % 1) && !isNaN(${t})`);break;case"number":o=a();break;default:return(0,Ee._)`typeof ${t} ${r} ${e}`}return i===as.Correct?o:(0,Ee.not)(o);function a(s=Ee.nil){return(0,Ee.and)((0,Ee._)`typeof ${t} == "number"`,s,n?(0,Ee._)`isFinite(${t})`:Ee.nil)}}Qt.checkDataType=qb;function Bb(e,t,n,i){if(e.length===1)return qb(e[0],t,n,i);let r,o=(0,Oz.toHash)(e);if(o.array&&o.object){let a=(0,Ee._)`typeof ${t} != "object"`;r=o.null?a:(0,Ee._)`!${t} || ${a}`,delete o.null,delete o.array,delete o.object}else r=Ee.nil;o.number&&delete o.integer;for(let a in o)r=(0,Ee.and)(r,qb(a,t,n,i));return r}Qt.checkDataTypes=Bb;var EL={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?(0,Ee._)`{type: ${e}}`:(0,Ee._)`{type: ${t}}`};function Hb(e){let t=OL(e);(0,xL.reportError)(t,EL)}Qt.reportTypeError=Hb;function OL(e){let{gen:t,data:n,schema:i}=e,r=(0,Oz.schemaRefOrVal)(e,i,"type");return{gen:t,keyword:"type",data:n,schema:i.type,schemaCode:r,schemaValue:r,parentSchema:i,params:{},it:e}}});var Cz=ne(vf=>{"use strict";Object.defineProperty(vf,"__esModule",{value:!0});vf.assignDefaults=void 0;var ss=Oe(),jL=Ve();function RL(e,t){let{properties:n,items:i}=e.schema;if(t==="object"&&n)for(let r in n)Dz(e,r,n[r].default);else t==="array"&&Array.isArray(i)&&i.forEach((r,o)=>Dz(e,o,r.default))}vf.assignDefaults=RL;function Dz(e,t,n){let{gen:i,compositeRule:r,data:o,opts:a}=e;if(n===void 0)return;let s=(0,ss._)`${o}${(0,ss.getProperty)(t)}`;if(r){(0,jL.checkStrictMode)(e,`default is ignored for: ${s}`);return}let c=(0,ss._)`${s} === undefined`;a.useDefaults==="empty"&&(c=(0,ss._)`${c} || ${s} === null || ${s} === ""`),i.if(c,(0,ss._)`${s} = ${(0,ss.stringify)(n)}`)}});var qr=ne(ot=>{"use strict";Object.defineProperty(ot,"__esModule",{value:!0});ot.validateUnion=ot.validateArray=ot.usePattern=ot.callValidateCode=ot.schemaProperties=ot.allSchemaProperties=ot.noPropertyInData=ot.propertyInData=ot.isOwnProperty=ot.hasPropFunc=ot.reportMissingProp=ot.checkMissingProp=ot.checkReportMissingProp=void 0;var lt=Oe(),Jb=Ve(),Ti=Bn(),DL=Ve();function CL(e,t){let{gen:n,data:i,it:r}=e;n.if(Kb(n,i,t,r.opts.ownProperties),()=>{e.setParams({missingProperty:(0,lt._)`${t}`},!0),e.error()})}ot.checkReportMissingProp=CL;function AL({gen:e,data:t,it:{opts:n}},i,r){return(0,lt.or)(...i.map(o=>(0,lt.and)(Kb(e,t,o,n.ownProperties),(0,lt._)`${r} = ${o}`)))}ot.checkMissingProp=AL;function NL(e,t){e.setParams({missingProperty:t},!0),e.error()}ot.reportMissingProp=NL;function Az(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,lt._)`Object.prototype.hasOwnProperty`})}ot.hasPropFunc=Az;function Gb(e,t,n){return(0,lt._)`${Az(e)}.call(${t}, ${n})`}ot.isOwnProperty=Gb;function ML(e,t,n,i){let r=(0,lt._)`${t}${(0,lt.getProperty)(n)} !== undefined`;return i?(0,lt._)`${r} && ${Gb(e,t,n)}`:r}ot.propertyInData=ML;function Kb(e,t,n,i){let r=(0,lt._)`${t}${(0,lt.getProperty)(n)} === undefined`;return i?(0,lt.or)(r,(0,lt.not)(Gb(e,t,n))):r}ot.noPropertyInData=Kb;function Nz(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}ot.allSchemaProperties=Nz;function LL(e,t){return Nz(t).filter(n=>!(0,Jb.alwaysValidSchema)(e,t[n]))}ot.schemaProperties=LL;function UL({schemaCode:e,data:t,it:{gen:n,topSchemaRef:i,schemaPath:r,errorPath:o},it:a},s,c,l){let u=l?(0,lt._)`${e}, ${t}, ${i}${r}`:t,p=[[Ti.default.instancePath,(0,lt.strConcat)(Ti.default.instancePath,o)],[Ti.default.parentData,a.parentData],[Ti.default.parentDataProperty,a.parentDataProperty],[Ti.default.rootData,Ti.default.rootData]];a.opts.dynamicRef&&p.push([Ti.default.dynamicAnchors,Ti.default.dynamicAnchors]);let h=(0,lt._)`${u}, ${n.object(...p)}`;return c!==lt.nil?(0,lt._)`${s}.call(${c}, ${h})`:(0,lt._)`${s}(${h})`}ot.callValidateCode=UL;var ZL=(0,lt._)`new RegExp`;function FL({gen:e,it:{opts:t}},n){let i=t.unicodeRegExp?"u":"",{regExp:r}=t.code,o=r(n,i);return e.scopeValue("pattern",{key:o.toString(),ref:o,code:(0,lt._)`${r.code==="new RegExp"?ZL:(0,DL.useFunc)(e,r)}(${n}, ${i})`})}ot.usePattern=FL;function VL(e){let{gen:t,data:n,keyword:i,it:r}=e,o=t.name("valid");if(r.allErrors){let s=t.let("valid",!0);return a(()=>t.assign(s,!1)),s}return t.var(o,!0),a(()=>t.break()),o;function a(s){let c=t.const("len",(0,lt._)`${n}.length`);t.forRange("i",0,c,l=>{e.subschema({keyword:i,dataProp:l,dataPropType:Jb.Type.Num},o),t.if((0,lt.not)(o),s)})}}ot.validateArray=VL;function qL(e){let{gen:t,schema:n,keyword:i,it:r}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");if(n.some(c=>(0,Jb.alwaysValidSchema)(r,c))&&!r.opts.unevaluated)return;let a=t.let("valid",!1),s=t.name("_valid");t.block(()=>n.forEach((c,l)=>{let u=e.subschema({keyword:i,schemaProp:l,compositeRule:!0},s);t.assign(a,(0,lt._)`${a} || ${s}`),e.mergeValidEvaluated(u,s)||t.if((0,lt.not)(a))})),e.result(a,()=>e.reset(),()=>e.error(!0))}ot.validateUnion=qL});var Uz=ne(kn=>{"use strict";Object.defineProperty(kn,"__esModule",{value:!0});kn.validateKeywordUsage=kn.validSchemaType=kn.funcKeywordCode=kn.macroKeywordCode=void 0;var ur=Oe(),bo=Bn(),BL=qr(),HL=El();function JL(e,t){let{gen:n,keyword:i,schema:r,parentSchema:o,it:a}=e,s=t.macro.call(a.self,r,o,a),c=Lz(n,i,s);a.opts.validateSchema!==!1&&a.self.validateSchema(s,!0);let l=n.name("valid");e.subschema({schema:s,schemaPath:ur.nil,errSchemaPath:`${a.errSchemaPath}/${i}`,topSchemaRef:c,compositeRule:!0},l),e.pass(l,()=>e.error(!0))}kn.macroKeywordCode=JL;function GL(e,t){var n;let{gen:i,keyword:r,schema:o,parentSchema:a,$data:s,it:c}=e;WL(c,t);let l=!s&&t.compile?t.compile.call(c.self,o,a,c):t.validate,u=Lz(i,r,l),p=i.let("valid");e.block$data(p,h),e.ok((n=t.valid)!==null&&n!==void 0?n:p);function h(){if(t.errors===!1)k(),t.modifying&&Mz(e),T(()=>e.error());else{let z=t.async?g():_();t.modifying&&Mz(e),T(()=>KL(e,z))}}function g(){let z=i.let("ruleErrs",null);return i.try(()=>k((0,ur._)`await `),S=>i.assign(p,!1).if((0,ur._)`${S} instanceof ${c.ValidationError}`,()=>i.assign(z,(0,ur._)`${S}.errors`),()=>i.throw(S))),z}function _(){let z=(0,ur._)`${u}.errors`;return i.assign(z,null),k(ur.nil),z}function k(z=t.async?(0,ur._)`await `:ur.nil){let S=c.opts.passContext?bo.default.this:bo.default.self,A=!("compile"in t&&!s||t.schema===!1);i.assign(p,(0,ur._)`${z}${(0,BL.callValidateCode)(e,u,S,A)}`,t.modifying)}function T(z){var S;i.if((0,ur.not)((S=t.valid)!==null&&S!==void 0?S:p),z)}}kn.funcKeywordCode=GL;function Mz(e){let{gen:t,data:n,it:i}=e;t.if(i.parentData,()=>t.assign(n,(0,ur._)`${i.parentData}[${i.parentDataProperty}]`))}function KL(e,t){let{gen:n}=e;n.if((0,ur._)`Array.isArray(${t})`,()=>{n.assign(bo.default.vErrors,(0,ur._)`${bo.default.vErrors} === null ? ${t} : ${bo.default.vErrors}.concat(${t})`).assign(bo.default.errors,(0,ur._)`${bo.default.vErrors}.length`),(0,HL.extendErrors)(e)},()=>e.error())}function WL({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}function Lz(e,t,n){if(n===void 0)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword",typeof n=="function"?{ref:n}:{ref:n,code:(0,ur.stringify)(n)})}function XL(e,t,n=!1){return!t.length||t.some(i=>i==="array"?Array.isArray(e):i==="object"?e&&typeof e=="object"&&!Array.isArray(e):typeof e==i||n&&typeof e>"u")}kn.validSchemaType=XL;function YL({schema:e,opts:t,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 a=r.dependencies;if(a?.some(s=>!Object.prototype.hasOwnProperty.call(e,s)))throw new Error(`parent schema must have dependencies of ${o}: ${a.join(",")}`);if(r.validateSchema&&!r.validateSchema(e[o])){let c=`keyword "${o}" value is invalid at path "${i}": `+n.errorsText(r.validateSchema.errors);if(t.validateSchema==="log")n.logger.error(c);else throw new Error(c)}}kn.validateKeywordUsage=YL});var Fz=ne(zi=>{"use strict";Object.defineProperty(zi,"__esModule",{value:!0});zi.extendSubschemaMode=zi.extendSubschemaData=zi.getSubschema=void 0;var xn=Oe(),Zz=Ve();function QL(e,{keyword:t,schemaProp:n,schema:i,schemaPath:r,errSchemaPath:o,topSchemaRef:a}){if(t!==void 0&&i!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){let s=e.schema[t];return n===void 0?{schema:s,schemaPath:(0,xn._)`${e.schemaPath}${(0,xn.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:s[n],schemaPath:(0,xn._)`${e.schemaPath}${(0,xn.getProperty)(t)}${(0,xn.getProperty)(n)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,Zz.escapeFragment)(n)}`}}if(i!==void 0){if(r===void 0||o===void 0||a===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:i,schemaPath:r,topSchemaRef:a,errSchemaPath:o}}throw new Error('either "keyword" or "schema" must be passed')}zi.getSubschema=QL;function eU(e,t,{dataProp:n,dataPropType:i,data:r,dataTypes:o,propertyName:a}){if(r!==void 0&&n!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:s}=t;if(n!==void 0){let{errorPath:l,dataPathArr:u,opts:p}=t,h=s.let("data",(0,xn._)`${t.data}${(0,xn.getProperty)(n)}`,!0);c(h),e.errorPath=(0,xn.str)`${l}${(0,Zz.getErrorPath)(n,i,p.jsPropertySyntax)}`,e.parentDataProperty=(0,xn._)`${n}`,e.dataPathArr=[...u,e.parentDataProperty]}if(r!==void 0){let l=r instanceof xn.Name?r:s.let("data",r,!0);c(l),a!==void 0&&(e.propertyName=a)}o&&(e.dataTypes=o);function c(l){e.data=l,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,l]}}zi.extendSubschemaData=eU;function tU(e,{jtdDiscriminator:t,jtdMetadata:n,compositeRule:i,createErrors:r,allErrors:o}){i!==void 0&&(e.compositeRule=i),r!==void 0&&(e.createErrors=r),o!==void 0&&(e.allErrors=o),e.jtdDiscriminator=t,e.jtdMetadata=n}zi.extendSubschemaMode=tU});var Wb=ne((u8,Vz)=>{"use strict";Vz.exports=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var i,r,o;if(Array.isArray(t)){if(i=t.length,i!=n.length)return!1;for(r=i;r--!==0;)if(!e(t[r],n[r]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(o=Object.keys(t),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 a=o[r];if(!e(t[a],n[a]))return!1}return!0}return t!==t&&n!==n}});var Bz=ne((d8,qz)=>{"use strict";var Pi=qz.exports=function(e,t,n){typeof t=="function"&&(n=t,t={}),n=t.cb||n;var i=typeof n=="function"?n:n.pre||function(){},r=n.post||function(){};yf(t,i,r,e,"",e)};Pi.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Pi.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Pi.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Pi.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 yf(e,t,n,i,r,o,a,s,c,l){if(i&&typeof i=="object"&&!Array.isArray(i)){t(i,r,o,a,s,c,l);for(var u in i){var p=i[u];if(Array.isArray(p)){if(u in Pi.arrayKeywords)for(var h=0;h<p.length;h++)yf(e,t,n,p[h],r+"/"+u+"/"+h,o,r,u,i,h)}else if(u in Pi.propsKeywords){if(p&&typeof p=="object")for(var g in p)yf(e,t,n,p[g],r+"/"+u+"/"+rU(g),o,r,u,i,g)}else(u in Pi.keywords||e.allKeys&&!(u in Pi.skipKeywords))&&yf(e,t,n,p,r+"/"+u,o,r,u,i)}n(i,r,o,a,s,c,l)}}function rU(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}});var jl=ne($r=>{"use strict";Object.defineProperty($r,"__esModule",{value:!0});$r.getSchemaRefs=$r.resolveUrl=$r.normalizeId=$r._getFullPath=$r.getFullPath=$r.inlineRef=void 0;var nU=Ve(),iU=Wb(),oU=Bz(),aU=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function sU(e,t=!0){return typeof e=="boolean"?!0:t===!0?!Xb(e):t?Hz(e)<=t:!1}$r.inlineRef=sU;var cU=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Xb(e){for(let t in e){if(cU.has(t))return!0;let n=e[t];if(Array.isArray(n)&&n.some(Xb)||typeof n=="object"&&Xb(n))return!0}return!1}function Hz(e){let t=0;for(let n in e){if(n==="$ref")return 1/0;if(t++,!aU.has(n)&&(typeof e[n]=="object"&&(0,nU.eachItem)(e[n],i=>t+=Hz(i)),t===1/0))return 1/0}return t}function Jz(e,t="",n){n!==!1&&(t=cs(t));let i=e.parse(t);return Gz(e,i)}$r.getFullPath=Jz;function Gz(e,t){return e.serialize(t).split("#")[0]+"#"}$r._getFullPath=Gz;var lU=/#\/?$/;function cs(e){return e?e.replace(lU,""):""}$r.normalizeId=cs;function uU(e,t,n){return n=cs(n),e.resolve(t,n)}$r.resolveUrl=uU;var dU=/^[a-z_][-a-z0-9._]*$/i;function pU(e,t){if(typeof e=="boolean")return{};let{schemaId:n,uriResolver:i}=this.opts,r=cs(e[n]||t),o={"":r},a=Jz(i,r,!1),s={},c=new Set;return oU(e,{allKeys:!0},(p,h,g,_)=>{if(_===void 0)return;let k=a+h,T=o[_];typeof p[n]=="string"&&(T=z.call(this,p[n])),S.call(this,p.$anchor),S.call(this,p.$dynamicAnchor),o[h]=T;function z(A){let Q=this.opts.uriResolver.resolve;if(A=cs(T?Q(T,A):A),c.has(A))throw u(A);c.add(A);let X=this.refs[A];return typeof X=="string"&&(X=this.refs[X]),typeof X=="object"?l(p,X.schema,A):A!==cs(k)&&(A[0]==="#"?(l(p,s[A],A),s[A]=p):this.refs[A]=k),A}function S(A){if(typeof A=="string"){if(!dU.test(A))throw new Error(`invalid anchor "${A}"`);z.call(this,`#${A}`)}}}),s;function l(p,h,g){if(h!==void 0&&!iU(p,h))throw u(g)}function u(p){return new Error(`reference "${p}" resolves to more than one schema`)}}$r.getSchemaRefs=pU});var Cl=ne(Ei=>{"use strict";Object.defineProperty(Ei,"__esModule",{value:!0});Ei.getData=Ei.KeywordCxt=Ei.validateFunctionCode=void 0;var Qz=zz(),Kz=Ol(),Qb=Vb(),_f=Ol(),mU=Cz(),Dl=Uz(),Yb=Fz(),he=Oe(),Se=Bn(),fU=jl(),Hn=Ve(),Rl=El();function hU(e){if(rP(e)&&(nP(e),tP(e))){yU(e);return}eP(e,()=>(0,Qz.topBoolOrEmptySchema)(e))}Ei.validateFunctionCode=hU;function eP({gen:e,validateName:t,schema:n,schemaEnv:i,opts:r},o){r.code.es5?e.func(t,(0,he._)`${Se.default.data}, ${Se.default.valCxt}`,i.$async,()=>{e.code((0,he._)`"use strict"; ${Wz(n,r)}`),vU(e,r),e.code(o)}):e.func(t,(0,he._)`${Se.default.data}, ${gU(r)}`,i.$async,()=>e.code(Wz(n,r)).code(o))}function gU(e){return(0,he._)`{${Se.default.instancePath}="", ${Se.default.parentData}, ${Se.default.parentDataProperty}, ${Se.default.rootData}=${Se.default.data}${e.dynamicRef?(0,he._)`, ${Se.default.dynamicAnchors}={}`:he.nil}}={}`}function vU(e,t){e.if(Se.default.valCxt,()=>{e.var(Se.default.instancePath,(0,he._)`${Se.default.valCxt}.${Se.default.instancePath}`),e.var(Se.default.parentData,(0,he._)`${Se.default.valCxt}.${Se.default.parentData}`),e.var(Se.default.parentDataProperty,(0,he._)`${Se.default.valCxt}.${Se.default.parentDataProperty}`),e.var(Se.default.rootData,(0,he._)`${Se.default.valCxt}.${Se.default.rootData}`),t.dynamicRef&&e.var(Se.default.dynamicAnchors,(0,he._)`${Se.default.valCxt}.${Se.default.dynamicAnchors}`)},()=>{e.var(Se.default.instancePath,(0,he._)`""`),e.var(Se.default.parentData,(0,he._)`undefined`),e.var(Se.default.parentDataProperty,(0,he._)`undefined`),e.var(Se.default.rootData,Se.default.data),t.dynamicRef&&e.var(Se.default.dynamicAnchors,(0,he._)`{}`)})}function yU(e){let{schema:t,opts:n,gen:i}=e;eP(e,()=>{n.$comment&&t.$comment&&oP(e),kU(e),i.let(Se.default.vErrors,null),i.let(Se.default.errors,0),n.unevaluated&&_U(e),iP(e),IU(e)})}function _U(e){let{gen:t,validateName:n}=e;e.evaluated=t.const("evaluated",(0,he._)`${n}.evaluated`),t.if((0,he._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,he._)`${e.evaluated}.props`,(0,he._)`undefined`)),t.if((0,he._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,he._)`${e.evaluated}.items`,(0,he._)`undefined`))}function Wz(e,t){let n=typeof e=="object"&&e[t.schemaId];return n&&(t.code.source||t.code.process)?(0,he._)`/*# sourceURL=${n} */`:he.nil}function bU(e,t){if(rP(e)&&(nP(e),tP(e))){$U(e,t);return}(0,Qz.boolOrEmptySchema)(e,t)}function tP({schema:e,self:t}){if(typeof e=="boolean")return!e;for(let n in e)if(t.RULES.all[n])return!0;return!1}function rP(e){return typeof e.schema!="boolean"}function $U(e,t){let{schema:n,gen:i,opts:r}=e;r.$comment&&n.$comment&&oP(e),xU(e),SU(e);let o=i.const("_errs",Se.default.errors);iP(e,o),i.var(t,(0,he._)`${o} === ${Se.default.errors}`)}function nP(e){(0,Hn.checkUnknownRules)(e),wU(e)}function iP(e,t){if(e.opts.jtd)return Xz(e,[],!1,t);let n=(0,Kz.getSchemaTypes)(e.schema),i=(0,Kz.coerceAndCheckDataType)(e,n);Xz(e,n,!i,t)}function wU(e){let{schema:t,errSchemaPath:n,opts:i,self:r}=e;t.$ref&&i.ignoreKeywordsWithRef&&(0,Hn.schemaHasRulesButRef)(t,r.RULES)&&r.logger.warn(`$ref: keywords ignored in schema at path "${n}"`)}function kU(e){let{schema:t,opts:n}=e;t.default!==void 0&&n.useDefaults&&n.strictSchema&&(0,Hn.checkStrictMode)(e,"default is ignored in the schema root")}function xU(e){let t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,fU.resolveUrl)(e.opts.uriResolver,e.baseId,t))}function SU(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}function oP({gen:e,schemaEnv:t,schema:n,errSchemaPath:i,opts:r}){let o=n.$comment;if(r.$comment===!0)e.code((0,he._)`${Se.default.self}.logger.log(${o})`);else if(typeof r.$comment=="function"){let a=(0,he.str)`${i}/$comment`,s=e.scopeValue("root",{ref:t.root});e.code((0,he._)`${Se.default.self}.opts.$comment(${o}, ${a}, ${s}.schema)`)}}function IU(e){let{gen:t,schemaEnv:n,validateName:i,ValidationError:r,opts:o}=e;n.$async?t.if((0,he._)`${Se.default.errors} === 0`,()=>t.return(Se.default.data),()=>t.throw((0,he._)`new ${r}(${Se.default.vErrors})`)):(t.assign((0,he._)`${i}.errors`,Se.default.vErrors),o.unevaluated&&TU(e),t.return((0,he._)`${Se.default.errors} === 0`))}function TU({gen:e,evaluated:t,props:n,items:i}){n instanceof he.Name&&e.assign((0,he._)`${t}.props`,n),i instanceof he.Name&&e.assign((0,he._)`${t}.items`,i)}function Xz(e,t,n,i){let{gen:r,schema:o,data:a,allErrors:s,opts:c,self:l}=e,{RULES:u}=l;if(o.$ref&&(c.ignoreKeywordsWithRef||!(0,Hn.schemaHasRulesButRef)(o,u))){r.block(()=>sP(e,"$ref",u.all.$ref.definition));return}c.jtd||zU(e,t),r.block(()=>{for(let h of u.rules)p(h);p(u.post)});function p(h){(0,Qb.shouldUseGroup)(o,h)&&(h.type?(r.if((0,_f.checkDataType)(h.type,a,c.strictNumbers)),Yz(e,h),t.length===1&&t[0]===h.type&&n&&(r.else(),(0,_f.reportTypeError)(e)),r.endIf()):Yz(e,h),s||r.if((0,he._)`${Se.default.errors} === ${i||0}`))}}function Yz(e,t){let{gen:n,schema:i,opts:{useDefaults:r}}=e;r&&(0,mU.assignDefaults)(e,t.type),n.block(()=>{for(let o of t.rules)(0,Qb.shouldUseRule)(i,o)&&sP(e,o.keyword,o.definition,t.type)})}function zU(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(PU(e,t),e.opts.allowUnionTypes||EU(e,t),OU(e,e.dataTypes))}function PU(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(n=>{aP(e.dataTypes,n)||e$(e,`type "${n}" not allowed by context "${e.dataTypes.join(",")}"`)}),RU(e,t)}}function EU(e,t){t.length>1&&!(t.length===2&&t.includes("null"))&&e$(e,"use allowUnionTypes to allow union type keyword")}function OU(e,t){let n=e.self.RULES.all;for(let i in n){let r=n[i];if(typeof r=="object"&&(0,Qb.shouldUseRule)(e.schema,r)){let{type:o}=r.definition;o.length&&!o.some(a=>jU(t,a))&&e$(e,`missing type "${o.join(",")}" for keyword "${i}"`)}}}function jU(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function aP(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function RU(e,t){let n=[];for(let i of e.dataTypes)aP(t,i)?n.push(i):t.includes("integer")&&i==="number"&&n.push("integer");e.dataTypes=n}function e$(e,t){let n=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${n}" (strictTypes)`,(0,Hn.checkStrictMode)(e,t,e.opts.strictTypes)}var bf=class{constructor(t,n,i){if((0,Dl.validateKeywordUsage)(t,n,i),this.gen=t.gen,this.allErrors=t.allErrors,this.keyword=i,this.data=t.data,this.schema=t.schema[i],this.$data=n.$data&&t.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,Hn.schemaRefOrVal)(t,this.schema,i,this.$data),this.schemaType=n.schemaType,this.parentSchema=t.schema,this.params={},this.it=t,this.def=n,this.$data)this.schemaCode=t.gen.const("vSchema",cP(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,Dl.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=t.gen.const("_errs",Se.default.errors))}result(t,n,i){this.failResult((0,he.not)(t),n,i)}failResult(t,n,i){this.gen.if(t),i?i():this.error(),n?(this.gen.else(),n(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(t,n){this.failResult((0,he.not)(t),void 0,n)}fail(t){if(t===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(t),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(t){if(!this.$data)return this.fail(t);let{schemaCode:n}=this;this.fail((0,he._)`${n} !== undefined && (${(0,he.or)(this.invalid$data(),t)})`)}error(t,n,i){if(n){this.setParams(n),this._error(t,i),this.setParams({});return}this._error(t,i)}_error(t,n){(t?Rl.reportExtraError:Rl.reportError)(this,this.def.error,n)}$dataError(){(0,Rl.reportError)(this,this.def.$dataError||Rl.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Rl.resetErrorsCount)(this.gen,this.errsCount)}ok(t){this.allErrors||this.gen.if(t)}setParams(t,n){n?Object.assign(this.params,t):this.params=t}block$data(t,n,i=he.nil){this.gen.block(()=>{this.check$data(t,i),n()})}check$data(t=he.nil,n=he.nil){if(!this.$data)return;let{gen:i,schemaCode:r,schemaType:o,def:a}=this;i.if((0,he.or)((0,he._)`${r} === undefined`,n)),t!==he.nil&&i.assign(t,!0),(o.length||a.validateSchema)&&(i.elseIf(this.invalid$data()),this.$dataError(),t!==he.nil&&i.assign(t,!1)),i.else()}invalid$data(){let{gen:t,schemaCode:n,schemaType:i,def:r,it:o}=this;return(0,he.or)(a(),s());function a(){if(i.length){if(!(n instanceof he.Name))throw new Error("ajv implementation error");let c=Array.isArray(i)?i:[i];return(0,he._)`${(0,_f.checkDataTypes)(c,n,o.opts.strictNumbers,_f.DataType.Wrong)}`}return he.nil}function s(){if(r.validateSchema){let c=t.scopeValue("validate$data",{ref:r.validateSchema});return(0,he._)`!${c}(${n})`}return he.nil}}subschema(t,n){let i=(0,Yb.getSubschema)(this.it,t);(0,Yb.extendSubschemaData)(i,this.it,t),(0,Yb.extendSubschemaMode)(i,t);let r={...this.it,...i,items:void 0,props:void 0};return bU(r,n),r}mergeEvaluated(t,n){let{it:i,gen:r}=this;i.opts.unevaluated&&(i.props!==!0&&t.props!==void 0&&(i.props=Hn.mergeEvaluated.props(r,t.props,i.props,n)),i.items!==!0&&t.items!==void 0&&(i.items=Hn.mergeEvaluated.items(r,t.items,i.items,n)))}mergeValidEvaluated(t,n){let{it:i,gen:r}=this;if(i.opts.unevaluated&&(i.props!==!0||i.items!==!0))return r.if(n,()=>this.mergeEvaluated(t,he.Name)),!0}};Ei.KeywordCxt=bf;function sP(e,t,n,i){let r=new bf(e,n,t);"code"in n?n.code(r,i):r.$data&&n.validate?(0,Dl.funcKeywordCode)(r,n):"macro"in n?(0,Dl.macroKeywordCode)(r,n):(n.compile||n.validate)&&(0,Dl.funcKeywordCode)(r,n)}var DU=/^\/(?:[^~]|~0|~1)*$/,CU=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function cP(e,{dataLevel:t,dataNames:n,dataPathArr:i}){let r,o;if(e==="")return Se.default.rootData;if(e[0]==="/"){if(!DU.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);r=e,o=Se.default.rootData}else{let l=CU.exec(e);if(!l)throw new Error(`Invalid JSON-pointer: ${e}`);let u=+l[1];if(r=l[2],r==="#"){if(u>=t)throw new Error(c("property/index",u));return i[t-u]}if(u>t)throw new Error(c("data",u));if(o=n[t-u],!r)return o}let a=o,s=r.split("/");for(let l of s)l&&(o=(0,he._)`${o}${(0,he.getProperty)((0,Hn.unescapeJsonPointer)(l))}`,a=(0,he._)`${a} && ${o}`);return a;function c(l,u){return`Cannot access ${l} ${u} levels up, current level is ${t}`}}Ei.getData=cP});var $f=ne(r$=>{"use strict";Object.defineProperty(r$,"__esModule",{value:!0});var t$=class extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}};r$.default=t$});var Al=ne(o$=>{"use strict";Object.defineProperty(o$,"__esModule",{value:!0});var n$=jl(),i$=class extends Error{constructor(t,n,i,r){super(r||`can't resolve reference ${i} from id ${n}`),this.missingRef=(0,n$.resolveUrl)(t,n,i),this.missingSchema=(0,n$.normalizeId)((0,n$.getFullPath)(t,this.missingRef))}};o$.default=i$});var kf=ne(Br=>{"use strict";Object.defineProperty(Br,"__esModule",{value:!0});Br.resolveSchema=Br.getCompilingSchema=Br.resolveRef=Br.compileSchema=Br.SchemaEnv=void 0;var cn=Oe(),AU=$f(),$o=Bn(),ln=jl(),lP=Ve(),NU=Cl(),ls=class{constructor(t){var n;this.refs={},this.dynamicAnchors={};let i;typeof t.schema=="object"&&(i=t.schema),this.schema=t.schema,this.schemaId=t.schemaId,this.root=t.root||this,this.baseId=(n=t.baseId)!==null&&n!==void 0?n:(0,ln.normalizeId)(i?.[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=i?.$async,this.refs={}}};Br.SchemaEnv=ls;function s$(e){let t=uP.call(this,e);if(t)return t;let n=(0,ln.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:i,lines:r}=this.opts.code,{ownProperties:o}=this.opts,a=new cn.CodeGen(this.scope,{es5:i,lines:r,ownProperties:o}),s;e.$async&&(s=a.scopeValue("Error",{ref:AU.default,code:(0,cn._)`require("ajv/dist/runtime/validation_error").default`}));let c=a.scopeName("validate");e.validateName=c;let l={gen:a,allErrors:this.opts.allErrors,data:$o.default.data,parentData:$o.default.parentData,parentDataProperty:$o.default.parentDataProperty,dataNames:[$o.default.data],dataPathArr:[cn.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:a.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,cn.stringify)(e.schema)}:{ref:e.schema}),validateName:c,ValidationError:s,schema:e.schema,schemaEnv:e,rootId:n,baseId:e.baseId||n,schemaPath:cn.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,cn._)`""`,opts:this.opts,self:this},u;try{this._compilations.add(e),(0,NU.validateFunctionCode)(l),a.optimize(this.opts.code.optimize);let p=a.toString();u=`${a.scopeRefs($o.default.scope)}return ${p}`,this.opts.code.process&&(u=this.opts.code.process(u,e));let g=new Function(`${$o.default.self}`,`${$o.default.scope}`,u)(this,this.scope.get());if(this.scope.value(c,{ref:g}),g.errors=null,g.schema=e.schema,g.schemaEnv=e,e.$async&&(g.$async=!0),this.opts.code.source===!0&&(g.source={validateName:c,validateCode:p,scopeValues:a._values}),this.opts.unevaluated){let{props:_,items:k}=l;g.evaluated={props:_ instanceof cn.Name?void 0:_,items:k instanceof cn.Name?void 0:k,dynamicProps:_ instanceof cn.Name,dynamicItems:k instanceof cn.Name},g.source&&(g.source.evaluated=(0,cn.stringify)(g.evaluated))}return e.validate=g,e}catch(p){throw delete e.validate,delete e.validateName,u&&this.logger.error("Error compiling schema, function code:",u),p}finally{this._compilations.delete(e)}}Br.compileSchema=s$;function MU(e,t,n){var i;n=(0,ln.resolveUrl)(this.opts.uriResolver,t,n);let r=e.refs[n];if(r)return r;let o=ZU.call(this,e,n);if(o===void 0){let a=(i=e.localRefs)===null||i===void 0?void 0:i[n],{schemaId:s}=this.opts;a&&(o=new ls({schema:a,schemaId:s,root:e,baseId:t}))}if(o!==void 0)return e.refs[n]=LU.call(this,o)}Br.resolveRef=MU;function LU(e){return(0,ln.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:s$.call(this,e)}function uP(e){for(let t of this._compilations)if(UU(t,e))return t}Br.getCompilingSchema=uP;function UU(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function ZU(e,t){let n;for(;typeof(n=this.refs[t])=="string";)t=n;return n||this.schemas[t]||wf.call(this,e,t)}function wf(e,t){let n=this.opts.uriResolver.parse(t),i=(0,ln._getFullPath)(this.opts.uriResolver,n),r=(0,ln.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&i===r)return a$.call(this,n,e);let o=(0,ln.normalizeId)(i),a=this.refs[o]||this.schemas[o];if(typeof a=="string"){let s=wf.call(this,e,a);return typeof s?.schema!="object"?void 0:a$.call(this,n,s)}if(typeof a?.schema=="object"){if(a.validate||s$.call(this,a),o===(0,ln.normalizeId)(t)){let{schema:s}=a,{schemaId:c}=this.opts,l=s[c];return l&&(r=(0,ln.resolveUrl)(this.opts.uriResolver,r,l)),new ls({schema:s,schemaId:c,root:e,baseId:r})}return a$.call(this,n,a)}}Br.resolveSchema=wf;var FU=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function a$(e,{baseId:t,schema:n,root:i}){var r;if(((r=e.fragment)===null||r===void 0?void 0:r[0])!=="/")return;for(let s of e.fragment.slice(1).split("/")){if(typeof n=="boolean")return;let c=n[(0,lP.unescapeFragment)(s)];if(c===void 0)return;n=c;let l=typeof n=="object"&&n[this.opts.schemaId];!FU.has(s)&&l&&(t=(0,ln.resolveUrl)(this.opts.uriResolver,t,l))}let o;if(typeof n!="boolean"&&n.$ref&&!(0,lP.schemaHasRulesButRef)(n,this.RULES)){let s=(0,ln.resolveUrl)(this.opts.uriResolver,t,n.$ref);o=wf.call(this,i,s)}let{schemaId:a}=this.opts;if(o=o||new ls({schema:n,schemaId:a,root:i,baseId:t}),o.schema!==o.root.schema)return o}});var dP=ne((v8,VU)=>{VU.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 m$=ne((y8,_P)=>{"use strict";var qU=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),l$=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),BU=RegExp.prototype.test.bind(/^\d*$/u),wo=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),u$=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),mP=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/]$/u),d$=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/?]$/u),HU=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:]$/u),wr=new Array(256);{let e="0123456789ABCDEF";for(let t=0;t<256;t++)wr[t]="%"+e[t>>4]+e[t&15]}function er(e){return e<2048?wr[192|e>>6]+wr[128|e&63]:e<65536?wr[224|e>>12]+wr[128|e>>6&63]+wr[128|e&63]:wr[240|e>>18]+wr[128|e>>12&63]+wr[128|e>>6&63]+wr[128|e&63]}function JU(e){let t="",n=0,i=0;for(i=0;i<e.length;i++)if(n=e[i].charCodeAt(0),n!==48){if(!(n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102))return"";t+=e[i];break}for(i+=1;i<e.length;i++){if(n=e[i].charCodeAt(0),!(n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102))return"";t+=e[i]}return t}var GU=RegExp.prototype.test.bind(/^[\dA-Fa-f]{1,4}$/),KU=RegExp.prototype.test.bind(/^[vV][\dA-Fa-f]+\.[A-Za-z\d\-._~!$&'()*+,;=:]+$/),WU=RegExp.prototype.test.bind(/^[A-Za-z\d\-._~]$/),XU=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function YU(e){if(e.length===0)return!1;for(let t=0;t<e.length;t++)if(!WU(e[t])){if(e[t]==="%"&&t+2<e.length&&wo(e.slice(t+1,t+3))){t+=2;continue}return!1}return!0}function pP(e){let t=-1,n=0,i=-1,r=0;for(let s=0;s<e.length;s++)e[s]==="0"?(i===-1&&(i=s),r++,r>n&&(n=r,t=i)):(i=-1,r=0);if(n<2)return e.join(":");let o=e.slice(0,t).join(":"),a=e.slice(t+n).join(":");return o+"::"+a}function QU(e){let t=e.indexOf("::");if(t!==-1&&e.indexOf("::",t+1)!==-1)return;let n=t===-1?e.split(":"):e.slice(0,t).split(":"),i=t===-1?[]:e.slice(t+2).split(":");t!==-1&&(n.length===1&&n[0]===""&&(n.length=0),i.length===1&&i[0]===""&&(i.length=0));let r=n.concat(i),o=0;for(let s=0;s<r.length;s++){let c=r[s];if(c==="")return;if(c.indexOf(".")!==-1){if(s!==r.length-1||t!==-1&&i.length===0||!l$(c))return;o+=2;continue}if(!GU(c))return;r[s]=parseInt(c,16).toString(16),o++}if(t===-1)return o!==8?void 0:pP(r);if(o>=8)return;let a=r.slice(0,n.length);for(let s=o;s<8;s++)a.push("0");for(let s=n.length;s<r.length;s++)a.push(r[s]);return pP(a)}function c$(e){let t=e[0]==="["&&e[e.length-1]==="]";if((e[0]==="["||e[e.length-1]==="]")&&!t)return{host:e,isIPV6:!1,error:!0};let i=t?e.slice(1,-1):e;if(t&&KU(i))return i=i.toLowerCase(),{host:`[${i}]`,escapedHost:i,isIPV6:!1,isIPVFuture:!0};if(e6(i,":")<2)return{host:e,isIPV6:!1,error:t};let r="",o=i.indexOf("%");if(o!==-1){let s=i.slice(o,o+3).toLowerCase()==="%25"?3:1;if(r=i.slice(o+s),!YU(r))return{host:e,isIPV6:!1,error:!0};i=i.slice(0,o)}let a=QU(i);return a===void 0?{host:e,isIPV6:!1,error:!0}:{host:a+(r?"%"+r:""),escapedHost:a+(r?"%25"+r:""),isIPV6:!0}}function e6(e,t){let n=0;for(let i=0;i<e.length;i++)e[i]===t&&n++;return n}function fP(e){let t=e,n=[],i=-1,r=0;for(;r=t.length;){if(r===1){if(t===".")break;if(t==="/"){n.push("/");break}else{n.push(t);break}}else if(r===2){if(t[0]==="."){if(t[1]===".")break;if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"&&(t[1]==="."||t[1]==="/")){n.push("/");break}}else if(r===3&&t==="/.."){n.length!==0&&n.pop(),n.push("/");break}if(t[0]==="."){if(t[1]==="."){if(t[2]==="/"){t=t.slice(3);continue}}else if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"&&t[1]==="."){if(t[2]==="/"){t=t.slice(2);continue}else if(t[2]==="."&&t[3]==="/"){t=t.slice(3),n.length!==0&&n.pop();continue}}if((i=t.indexOf("/",1))===-1){n.push(t);break}else n.push(t.slice(0,i)),t=t.slice(i)}return n.join("")}function t6(e){if(e===""||e[0]==="/")return fP(e);let t=e.split("/"),n=t.length-1,i=[],r=!1;for(let o=0;o<=n;o++){let a=t[o];a==="."||a===".."?(a===".."&&(i.length!==0&&i[i.length-1]!==".."?i.pop():i.push("..")),r=o===n):i.push(a)}return r&&i[i.length-1]!==".."&&i.push(""),(i.length===0||i[0]===""||i[0].includes(":"))&&i.unshift("."),i.join("/")}var r6={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},n6=/[@/?#:]/g,i6=/[@/?#]/g;function hP(e,t){let n=t?i6:n6;return n.lastIndex=0,e.replace(n,i=>r6[i])}function gP(e,t=!1){if(e.indexOf("%")===-1)return e;let n="";for(let i=0;i<e.length;i++){if(e[i]==="%"&&i+2<e.length){let r=e.slice(i+1,i+3);if(wo(r)){let o=r.toUpperCase(),a=String.fromCharCode(parseInt(o,16));t&&u$(a)?n+=a:n+="%"+o,i+=2;continue}}n+=e[i]}return n}function o6(e){let t="";for(let n=0;n<e.length;n++){let i=e[n];if(i==="%"&&n+2<e.length){let r=e.slice(n+1,n+3);if(wo(r)){let o=r.toUpperCase(),a=String.fromCharCode(parseInt(o,16));a!=="."&&u$(a)?t+=a:t+="%"+o,n+=2;continue}}if(mP(i))t+=i;else{let r=e.charCodeAt(n);if(r<128)t+=yP(r)?i:wr[r];else if(r<55296||r>57343)t+=er(r);else if(r<=56319&&n+1<e.length){let o=e.charCodeAt(n+1);o>=56320&&o<=57343?(t+=er(65536+(r-55296<<10)+(o-56320)),n++):t+=er(65533)}else t+=er(65533)}}return t}function a6(e,t=!1){let n="",i=t&&e[0]!=="/";for(let r=0;r<e.length;r++){let o=e[r];if(o==="%"&&r+2<e.length){let a=e.slice(r+1,r+3);if(wo(a)){n+="%"+a.toUpperCase(),r+=2;continue}}if(o==="/"&&(i=!1),mP(o)&&(o!==":"||!i))n+=o;else{let a=e.charCodeAt(r);if(a<128)n+=wr[a];else if(a<55296||a>57343)n+=er(a);else if(a<=56319&&r+1<e.length){let s=e.charCodeAt(r+1);s>=56320&&s<=57343?(n+=er(65536+(a-55296<<10)+(s-56320)),r++):n+=er(65533)}else n+=er(65533)}}return n}function p$(e,t){let n="";for(let i=0;i<e.length;i++){let r=e[i];if(r==="%"&&i+2<e.length){let o=e.slice(i+1,i+3);if(wo(o)){n+="%"+o.toUpperCase(),i+=2;continue}}if(t(r))n+=r;else{let o=e.charCodeAt(i);if(o<128)n+=wr[o];else if(o<55296||o>57343)n+=er(o);else if(o<=56319&&i+1<e.length){let a=e.charCodeAt(i+1);a>=56320&&a<=57343?(n+=er(65536+(o-55296<<10)+(a-56320)),i++):n+=er(65533)}else n+=er(65533)}}return n}function vP(e){return p$(e,HU)}function s6(e){return p$(e,d$)}function c6(e){return p$(e,d$)}function yP(e){return e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||e===42||e===43||e===45||e===46||e===47||e===64||e===95}function l6(e){let t="";for(let n=0;n<e.length;n++){let i=e[n];if(i==="%"&&n+2<e.length){let r=e.slice(n+1,n+3);if(wo(r)){let o=r.toUpperCase(),a=String.fromCharCode(parseInt(o,16));u$(a)?t+=a:t+="%"+o,n+=2;continue}}if(d$(i))t+=i;else{let r=e.charCodeAt(n);if(r<128)t+=yP(r)?i:wr[r];else if(r<55296||r>57343)t+=er(r);else if(r<=56319&&n+1<e.length){let o=e.charCodeAt(n+1);o>=56320&&o<=57343?(t+=er(65536+(r-55296<<10)+(o-56320)),n++):t+=er(65533)}else t+=er(65533)}}return t}function u6(e){let t="";for(let n=0;n<e.length;n++){if(e[n]==="%"&&n+2<e.length){let i=e.slice(n+1,n+3);if(wo(i)){t+="%"+i.toUpperCase(),n+=2;continue}}t+=escape(e[n])}return t}function d6(e){let t=[];if(e.userinfo!==void 0&&(t.push(vP(e.userinfo)),t.push("@")),e.host!==void 0){let n=e.host;if(!l$(n)){let i=c$(n);i.isIPV6!==!0&&i.isIPVFuture!==!0&&(n=gP(n,!0),i=c$(n)),i.isIPV6===!0||i.isIPVFuture===!0?n=`[${i.escapedHost}]`:n=hP(n,!1)}t.push(n)}if(typeof e.port=="number"||typeof e.port=="string"){let n=String(e.port);if(!BU(n))throw new TypeError("URI port is malformed.");t.push(":"),t.push(n)}return t.length?t.join(""):void 0}_P.exports={nonSimpleDomain:XU,recomposeAuthority:d6,reescapeHostDelimiters:hP,normalizePercentEncoding:gP,normalizePathEncoding:o6,serializePathEncoding:a6,normalizeQueryFragmentEncoding:l6,encodeUserinfo:vP,encodeQuery:s6,encodeFragment:c6,escapePreservingEscapes:u6,removeDotSegments:fP,removeDotSegmentsRelative:t6,isIPv4:l$,isUUID:qU,normalizeIPv6:c$,stringArrayToHexStripped:JU}});var xP=ne((_8,kP)=>{"use strict";var{isUUID:p6}=m$(),m6=/^([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-./:;=@]|%[\da-f]{2})+)$/iu,f6=["http","https","ws","wss","urn","urn:uuid"];function h6(e){return f6.indexOf(e)!==-1}function f$(e){return e.secure===!0?!0:e.secure===!1?!1:e.scheme?e.scheme.length===3&&(e.scheme[0]==="w"||e.scheme[0]==="W")&&(e.scheme[1]==="s"||e.scheme[1]==="S")&&(e.scheme[2]==="s"||e.scheme[2]==="S"):!1}function bP(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function $P(e){let t=String(e.scheme).toLowerCase()==="https";return(e.port===(t?443:80)||e.port==="")&&(e.port=void 0),e.path||(e.path="/"),e}function g6(e){return e.secure=f$(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function v6(e){if((e.port===(f$(e)?443:80)||e.port==="")&&(e.port=void 0),typeof e.secure=="boolean"&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){let t=e.resourceName.indexOf("?"),n=t===-1?e.resourceName:e.resourceName.slice(0,t);e.path=n&&n!=="/"?n:void 0,e.query=t===-1?void 0:e.resourceName.slice(t+1),e.resourceName=void 0}return e.fragment=void 0,e}function y6(e,t){if(!e.path)return e.error="URN can not be parsed",e;let n=e.path.match(m6);if(n&&n[0]===e.path){let i=t.scheme||e.scheme||"urn";e.nid=n[1].toLowerCase(),e.nss=n[2];let r=`${i}:${t.nid||e.nid}`,o=h$(r);e.path=void 0,o&&(e=o.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e}function _6(e,t){if(e.nid===void 0)throw new Error("URN without nid cannot be serialized");let n=t.scheme||e.scheme||"urn",i=e.nid.toLowerCase(),r=`${n}:${t.nid||i}`,o=h$(r);o&&(e=o.serialize(e,t));let a=e,s=e.nss;return a.path=`${i||t.nid}:${s}`,t.skipEscape=!0,a}function b6(e,t){let n=e;return n.uuid=n.nss,n.nss=void 0,!t.tolerant&&(!n.uuid||!p6(n.uuid))&&(n.error=n.error||"UUID is not valid."),n}function $6(e){let t=e;return t.nss=(e.uuid||"").toLowerCase(),t}var wP={scheme:"http",domainHost:!0,parse:bP,serialize:$P},w6={scheme:"https",domainHost:wP.domainHost,parse:bP,serialize:$P},xf={scheme:"ws",domainHost:!0,parse:g6,serialize:v6},k6={scheme:"wss",domainHost:xf.domainHost,parse:xf.parse,serialize:xf.serialize},x6={scheme:"urn",parse:y6,serialize:_6,skipNormalize:!0},S6={scheme:"urn:uuid",parse:b6,serialize:$6,skipNormalize:!0},Sf={http:wP,https:w6,ws:xf,wss:k6,urn:x6,"urn:uuid":S6};Object.setPrototypeOf(Sf,null);function h$(e){return e&&(Sf[e]||Sf[e.toLowerCase()])||void 0}kP.exports={wsIsSecure:f$,SCHEMES:Sf,isValidSchemeName:h6,getSchemeHandler:h$}});var LP=ne((b8,Ef)=>{"use strict";var{normalizeIPv6:PP,removeDotSegments:Ml,removeDotSegmentsRelative:EP,recomposeAuthority:I6,normalizePercentEncoding:g$,normalizePathEncoding:T6,serializePathEncoding:SP,normalizeQueryFragmentEncoding:IP,encodeQuery:z6,encodeFragment:P6,reescapeHostDelimiters:E6,isIPv4:OP,nonSimpleDomain:O6}=m$(),{SCHEMES:jP,getSchemeHandler:v$}=xP(),RP=/^[A-Za-z][A-Za-z0-9+.-]*$/u,DP="URI scheme is malformed.",If="URI host is malformed.",j6=/[\0-\x20"#/:<>?@[\\\]^`{|}\x7F]/u;function TP(e){let t=String(e);if(!RP.test(t))throw new TypeError(DP);return t}function R6(e,t){return typeof e=="string"?e=F6(e,t):typeof e=="object"&&(e=zf(ko(e,t),t)),e}function D6(e,t,n){let i=n?Object.assign({scheme:"null"},n):{scheme:"null"},{parsed:r,malformedAuthorityOrPort:o,malformedPercentEncoding:a,malformedSchemeSpecific:s,malformedHost:c,malformedScheme:l}=Tf(e,i),{parsed:u,malformedAuthorityOrPort:p,malformedPercentEncoding:h,malformedSchemeSpecific:g,malformedHost:_,malformedScheme:k}=Tf(t,i);if(o||p||a||h||s||g||c||_||l||k)throw new Error(r.error||u.error||"URI is malformed.");let T=CP(r,u,i,!0),z=v$(n&&n.scheme||T.scheme),S=T.host,A=S!==void 0&&S!==""&&(OP(S)||PP(S).isIPV6);if(NP(T,n||{},z,A))throw new Error(If);AP(T,n||{},z,A);let Q=S&&S.indexOf("%")!==-1&&!/\P{ASCII}/u.test(S);if(T.error&&!Q)throw new Error(T.error);return i.skipEscape=!0,ko(T,i)}function CP(e,t,n,i){let r={};if(i||(e=zf(ko(e,n),n),t=zf(ko(t,n),n)),n=n||{},!n.tolerant&&t.scheme)r.scheme=t.scheme,r.userinfo=t.userinfo,r.host=t.host,r.port=t.port,r.path=Ml(t.path||""),r.query=t.query;else{if(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)r.userinfo=t.userinfo,r.host=t.host,r.port=t.port,r.path=Ml(t.path||""),r.query=t.query;else{if(!t.path)r.path=e.path,t.query!==void 0?r.query=t.query:r.query=e.query;else{if(t.path[0]==="/")r.path=Ml(t.path);else{let o=e.userinfo!==void 0||e.host!==void 0||e.port!==void 0;o&&!e.path?r.path="/"+t.path:e.path?r.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:r.path=t.path,r.path=e.scheme===void 0&&!o&&r.path[0]!=="/"?EP(r.path):Ml(r.path)}r.query=t.query}r.userinfo=e.userinfo,r.host=e.host,r.port=e.port}r.scheme=e.scheme}return r.fragment=t.fragment,r}function C6(e,t,n){let i=zP(e,n),r=zP(t,n);return i!==void 0&&r!==void 0&&i===r}function ko(e,t){let n={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},i=Object.assign({},t),r=[];n.scheme&&(n.scheme=TP(n.scheme));let o=v$(i.scheme||n.scheme);o&&o.serialize&&o.serialize(n,i);let a=n.userinfo!==void 0||n.host!==void 0||n.port!==void 0,s=(n.scheme===void 0||i.reference==="suffix")&&!a,c=!i.skipEscape&&s;n.path!==void 0&&(i.skipEscape?n.path=g$(n.path):n.path=SP(n.path,c)),i.reference!=="suffix"&&n.scheme&&(n.scheme=TP(n.scheme),r.push(n.scheme,":"));let l=I6(n);if(l!==void 0&&(i.reference!=="suffix"&&r.push("//"),r.push(l),n.path&&n.path[0]!=="/"&&r.push("/")),n.path!==void 0){let u=n.path;!i.absolutePath&&(!o||!o.absolutePath)&&(u=s&&u[0]!=="/"?EP(u):Ml(u)),s&&(u=SP(u,!0)),l===void 0&&u[0]==="/"&&u[1]==="/"&&(u="/%2F"+u.slice(2)),r.push(u)}return n.query!==void 0&&r.push("?",z6(n.query)),n.fragment!==void 0&&r.push("#",P6(n.fragment)),r.join("")}var A6=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u,N6=/^(?:[^#/:?]+:)?\/\/([^/?#]*)/,M6=/^(?:[^#/:?]+:)?([/\\\t\n\r]*)/;function L6(e,t){if(t[2]!==void 0&&e.path&&e.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof e.port=="number"&&(e.port<0||e.port>65535))return"URI port is malformed."}function Nl(e){if(e===void 0)return!1;let t=e.indexOf("%");for(;t!==-1;){if(t+2>=e.length||!/^[\da-f]{2}$/iu.test(e.slice(t+1,t+3)))return!0;t=e.indexOf("%",t+3)}return!1}function Pf(e){return e[0]==="["&&e[e.length-1]==="]"}function U6(e){let t=e[4];return Nl(e[3])||t!==void 0&&!Pf(t)&&Nl(t)||Nl(e[6])||Nl(e[7])||Nl(e[8])}function AP(e,t,n,i){if(NP(e,t,n,i))return e.error=e.error||If,!0;if(!t.unicodeSupport&&(!n||!n.unicodeSupport)&&e.host&&!Pf(e.host)&&(t.domainHost||n&&n.domainHost)&&i===!1&&O6(e.host)){let r;try{r=new URL("http://"+e.host)}catch(o){return e.error=e.error||"Host's domain name can not be converted to ASCII: "+o,!0}if(!Z6(r))return e.error=e.error||If,!0;e.host=r.hostname}return!1}function NP(e,t,n,i){return!!(e.host&&i===!1&&!Pf(e.host)&&(t.domainHost||n&&n.domainHost)&&j6.test(e.host))}function Z6(e){return e.username===""&&e.password===""&&e.port===""&&e.pathname==="/"&&e.search===""&&e.hash===""&&e.hostname!==""}function Tf(e,t){let n=Object.assign({},t),i={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},r=!1,o=!1,a=!1,s=!1,c=!1,l=!1,u=!1;n.reference==="suffix"&&(n.scheme?e=n.scheme+":"+e:e="//"+e);let p=e.match(N6);p!==null&&p[1].indexOf("\\")!==-1&&(i.error="URI authority must not contain a literal backslash.",r=!0);let h=e.match(M6);if(h!==null){let _=h[1],k=_.replace(/[\t\n\r]/g,"");k.length>=2&&(k.slice(0,2)!=="//"?(i.error=i.error||"URI authority must not contain a literal backslash.",r=!0):_.length!==k.length&&(i.error=i.error||"URI authority introducer must not contain whitespace.",r=!0))}let g=e.match(A6);if(g){i.scheme=g[1],i.userinfo=g[3],i.host=g[4],i.port=parseInt(g[5],10),i.path=g[6]||"",i.query=g[7],i.fragment=g[8],i.scheme!==void 0&&(RP.test(i.scheme)?i.scheme=i.scheme.toLowerCase():(i.error=i.error||DP,l=!0)),o=U6(g),o&&(i.error=i.error||"URI contains malformed percent-encoding."),isNaN(i.port)&&(i.port=g[5]);let _=L6(i,g);if(_!==void 0&&(i.error=i.error||_,r=!0),i.host)if(OP(i.host)===!1){let z=Pf(i.host),S=i.host.indexOf("[")!==-1||i.host.indexOf("]")!==-1,A=PP(i.host);u=A.isIPV6||A.isIPVFuture===!0,c=S&&(!z||A.error===!0),i.host=u?A.host:A.host.toLowerCase(),c&&(i.error=i.error||If,r=!0)}else u=!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 k=v$(n.scheme||i.scheme);if(c||(s=AP(i,n,k,u)),e.indexOf("%")!==-1&&i.host!==void 0&&!c){let T=u?i.host:g$(i.host,!0);u||(T=g$(T.toLowerCase())),i.host=u||n.scheme!=="null"?E6(T,u):T}(!k||k&&!k.skipNormalize)&&(i.path&&(i.path=T6(i.path)),i.query&&(i.query=IP(i.query)),i.fragment&&(i.fragment=IP(i.fragment))),k&&k.parse&&(k.parse(i,n),k===jP.urn&&i.nid===void 0&&(a=!0))}else i.error=i.error||"URI can not be parsed.";return{parsed:i,malformedAuthorityOrPort:r,malformedPercentEncoding:o,malformedSchemeSpecific:a,malformedHost:s,malformedScheme:l}}function zf(e,t){return Tf(e,t).parsed}function F6(e,t){return MP(e,t).normalized}function MP(e,t){let{parsed:n,malformedAuthorityOrPort:i,malformedPercentEncoding:r,malformedSchemeSpecific:o,malformedHost:a,malformedScheme:s}=Tf(e,t);return{normalized:i||r||o||a||s?e:ko(n,t),malformedAuthorityOrPort:i,malformedPercentEncoding:r,malformedSchemeSpecific:o,malformedHost:a,malformedScheme:s}}function zP(e,t){if(typeof e!="string"&&typeof e!="object")return;let n;try{n=typeof e=="string"?e:ko(e,t)}catch{return}let{normalized:i,malformedAuthorityOrPort:r,malformedPercentEncoding:o,malformedSchemeSpecific:a,malformedHost:s,malformedScheme:c}=MP(n,t);return r||o||a||s||c?void 0:i}var y$={SCHEMES:jP,normalize:R6,resolve:D6,resolveComponent:CP,equal:C6,serialize:ko,parse:zf};Ef.exports=y$;Ef.exports.default=y$;Ef.exports.fastUri=y$});var ZP=ne(_$=>{"use strict";Object.defineProperty(_$,"__esModule",{value:!0});var UP=LP();UP.code='require("ajv/dist/runtime/uri").default';_$.default=UP});var KP=ne(Ft=>{"use strict";Object.defineProperty(Ft,"__esModule",{value:!0});Ft.CodeGen=Ft.Name=Ft.nil=Ft.stringify=Ft.str=Ft._=Ft.KeywordCxt=void 0;var V6=Cl();Object.defineProperty(Ft,"KeywordCxt",{enumerable:!0,get:function(){return V6.KeywordCxt}});var us=Oe();Object.defineProperty(Ft,"_",{enumerable:!0,get:function(){return us._}});Object.defineProperty(Ft,"str",{enumerable:!0,get:function(){return us.str}});Object.defineProperty(Ft,"stringify",{enumerable:!0,get:function(){return us.stringify}});Object.defineProperty(Ft,"nil",{enumerable:!0,get:function(){return us.nil}});Object.defineProperty(Ft,"Name",{enumerable:!0,get:function(){return us.Name}});Object.defineProperty(Ft,"CodeGen",{enumerable:!0,get:function(){return us.CodeGen}});var q6=$f(),HP=Al(),B6=Fb(),Ll=kf(),H6=Oe(),Ul=jl(),Of=Ol(),$$=Ve(),FP=dP(),J6=ZP(),JP=(e,t)=>new RegExp(e,t);JP.code="new RegExp";var G6=["removeAdditional","useDefaults","coerceTypes"],K6=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),W6={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."},X6={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},VP=200;function Y6(e){var t,n,i,r,o,a,s,c,l,u,p,h,g,_,k,T,z,S,A,Q,X,ge,ye,Le,Dt;let _t=e.strict,rt=(t=e.code)===null||t===void 0?void 0:t.optimize,nt=rt===!0||rt===void 0?1:rt||0,qt=(i=(n=e.code)===null||n===void 0?void 0:n.regExp)!==null&&i!==void 0?i:JP,Dr=(r=e.uriResolver)!==null&&r!==void 0?r:J6.default;return{strictSchema:(a=(o=e.strictSchema)!==null&&o!==void 0?o:_t)!==null&&a!==void 0?a:!0,strictNumbers:(c=(s=e.strictNumbers)!==null&&s!==void 0?s:_t)!==null&&c!==void 0?c:!0,strictTypes:(u=(l=e.strictTypes)!==null&&l!==void 0?l:_t)!==null&&u!==void 0?u:"log",strictTuples:(h=(p=e.strictTuples)!==null&&p!==void 0?p:_t)!==null&&h!==void 0?h:"log",strictRequired:(_=(g=e.strictRequired)!==null&&g!==void 0?g:_t)!==null&&_!==void 0?_:!1,code:e.code?{...e.code,optimize:nt,regExp:qt}:{optimize:nt,regExp:qt},loopRequired:(k=e.loopRequired)!==null&&k!==void 0?k:VP,loopEnum:(T=e.loopEnum)!==null&&T!==void 0?T:VP,meta:(z=e.meta)!==null&&z!==void 0?z:!0,messages:(S=e.messages)!==null&&S!==void 0?S:!0,inlineRefs:(A=e.inlineRefs)!==null&&A!==void 0?A:!0,schemaId:(Q=e.schemaId)!==null&&Q!==void 0?Q:"$id",addUsedSchema:(X=e.addUsedSchema)!==null&&X!==void 0?X:!0,validateSchema:(ge=e.validateSchema)!==null&&ge!==void 0?ge:!0,validateFormats:(ye=e.validateFormats)!==null&&ye!==void 0?ye:!0,unicodeRegExp:(Le=e.unicodeRegExp)!==null&&Le!==void 0?Le:!0,int32range:(Dt=e.int32range)!==null&&Dt!==void 0?Dt:!0,uriResolver:Dr}}var Zl=class{constructor(t={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,t=this.opts={...t,...Y6(t)};let{es5:n,lines:i}=this.opts.code;this.scope=new H6.ValueScope({scope:{},prefixes:K6,es5:n,lines:i}),this.logger=iZ(t.logger);let r=t.validateFormats;t.validateFormats=!1,this.RULES=(0,B6.getRules)(),qP.call(this,W6,t,"NOT SUPPORTED"),qP.call(this,X6,t,"DEPRECATED","warn"),this._metaOpts=rZ.call(this),t.formats&&eZ.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),t.keywords&&tZ.call(this,t.keywords),typeof t.meta=="object"&&this.addMetaSchema(t.meta),Q6.call(this),t.validateFormats=r}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:t,meta:n,schemaId:i}=this.opts,r=FP;i==="id"&&(r={...FP},r.id=r.$id,delete r.$id),n&&t&&this.addMetaSchema(r,r[i],!1)}defaultMeta(){let{meta:t,schemaId:n}=this.opts;return this.opts.defaultMeta=typeof t=="object"?t[n]||t:void 0}validate(t,n){let i;if(typeof t=="string"){if(i=this.getSchema(t),!i)throw new Error(`no schema with key or ref "${t}"`)}else i=this.compile(t);let r=i(n);return"$async"in i||(this.errors=i.errors),r}compile(t,n){let i=this._addSchema(t,n);return i.validate||this._compileSchemaEnv(i)}compileAsync(t,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,t,n);async function r(u,p){await o.call(this,u.$schema);let h=this._addSchema(u,p);return h.validate||a.call(this,h)}async function o(u){u&&!this.getSchema(u)&&await r.call(this,{$ref:u},!0)}async function a(u){try{return this._compileSchemaEnv(u)}catch(p){if(!(p instanceof HP.default))throw p;return s.call(this,p),await c.call(this,p.missingSchema),a.call(this,u)}}function s({missingSchema:u,missingRef:p}){if(this.refs[u])throw new Error(`AnySchema ${u} is loaded but ${p} cannot be resolved`)}async function c(u){let p=await l.call(this,u);this.refs[u]||await o.call(this,p.$schema),this.refs[u]||this.addSchema(p,u,n)}async function l(u){let p=this._loading[u];if(p)return p;try{return await(this._loading[u]=i(u))}finally{delete this._loading[u]}}}addSchema(t,n,i,r=this.opts.validateSchema){if(Array.isArray(t)){for(let a of t)this.addSchema(a,void 0,i,r);return this}let o;if(typeof t=="object"){let{schemaId:a}=this.opts;if(o=t[a],o!==void 0&&typeof o!="string")throw new Error(`schema ${a} must be string`)}return n=(0,Ul.normalizeId)(n||o),this._checkUnique(n),this.schemas[n]=this._addSchema(t,i,n,r,!0),this}addMetaSchema(t,n,i=this.opts.validateSchema){return this.addSchema(t,n,!0,i),this}validateSchema(t,n){if(typeof t=="boolean")return!0;let i;if(i=t.$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,t);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(t){let n;for(;typeof(n=BP.call(this,t))=="string";)t=n;if(n===void 0){let{schemaId:i}=this.opts,r=new Ll.SchemaEnv({schema:{},schemaId:i});if(n=Ll.resolveSchema.call(this,r,t),!n)return;this.refs[t]=n}return n.validate||this._compileSchemaEnv(n)}removeSchema(t){if(t instanceof RegExp)return this._removeAllSchemas(this.schemas,t),this._removeAllSchemas(this.refs,t),this;switch(typeof t){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let n=BP.call(this,t);return typeof n=="object"&&this._cache.delete(n.schema),delete this.schemas[t],delete this.refs[t],this}case"object":{let n=t;this._cache.delete(n);let i=t[this.opts.schemaId];return i&&(i=(0,Ul.normalizeId)(i),delete this.schemas[i],delete this.refs[i]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(t){for(let n of t)this.addKeyword(n);return this}addKeyword(t,n){let i;if(typeof t=="string")i=t,typeof n=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),n.keyword=i);else if(typeof t=="object"&&n===void 0){if(n=t,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(aZ.call(this,i,n),!n)return(0,$$.eachItem)(i,o=>b$.call(this,o)),this;cZ.call(this,n);let r={...n,type:(0,Of.getJSONTypes)(n.type),schemaType:(0,Of.getJSONTypes)(n.schemaType)};return(0,$$.eachItem)(i,r.type.length===0?o=>b$.call(this,o,r):o=>r.type.forEach(a=>b$.call(this,o,r,a))),this}getKeyword(t){let n=this.RULES.all[t];return typeof n=="object"?n.definition:!!n}removeKeyword(t){let{RULES:n}=this;delete n.keywords[t],delete n.all[t];for(let i of n.rules){let r=i.rules.findIndex(o=>o.keyword===t);r>=0&&i.rules.splice(r,1)}return this}addFormat(t,n){return typeof n=="string"&&(n=new RegExp(n)),this.formats[t]=n,this}errorsText(t=this.errors,{separator:n=", ",dataVar:i="data"}={}){return!t||t.length===0?"No errors":t.map(r=>`${i}${r.instancePath} ${r.message}`).reduce((r,o)=>r+n+o)}$dataMetaSchema(t,n){let i=this.RULES.all;t=JSON.parse(JSON.stringify(t));for(let r of n){let o=r.split("/").slice(1),a=t;for(let s of o)a=a[s];for(let s in i){let c=i[s];if(typeof c!="object")continue;let{$data:l}=c.definition,u=a[s];l&&u&&(a[s]=GP(u))}}return t}_removeAllSchemas(t,n){for(let i in t){let r=t[i];(!n||n.test(i))&&(typeof r=="string"?delete t[i]:r&&!r.meta&&(this._cache.delete(r.schema),delete t[i]))}}_addSchema(t,n,i,r=this.opts.validateSchema,o=this.opts.addUsedSchema){let a,{schemaId:s}=this.opts;if(typeof t=="object")a=t[s];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof t!="boolean")throw new Error("schema must be object or boolean")}let c=this._cache.get(t);if(c!==void 0)return c;i=(0,Ul.normalizeId)(a||i);let l=Ul.getSchemaRefs.call(this,t,i);return c=new Ll.SchemaEnv({schema:t,schemaId:s,meta:n,baseId:i,localRefs:l}),this._cache.set(c.schema,c),o&&!i.startsWith("#")&&(i&&this._checkUnique(i),this.refs[i]=c),r&&this.validateSchema(t,!0),c}_checkUnique(t){if(this.schemas[t]||this.refs[t])throw new Error(`schema with key or id "${t}" already exists`)}_compileSchemaEnv(t){if(t.meta?this._compileMetaSchema(t):Ll.compileSchema.call(this,t),!t.validate)throw new Error("ajv implementation error");return t.validate}_compileMetaSchema(t){let n=this.opts;this.opts=this._metaOpts;try{Ll.compileSchema.call(this,t)}finally{this.opts=n}}};Zl.ValidationError=q6.default;Zl.MissingRefError=HP.default;Ft.default=Zl;function qP(e,t,n,i="error"){for(let r in e){let o=r;o in t&&this.logger[i](`${n}: option ${r}. ${e[o]}`)}}function BP(e){return e=(0,Ul.normalizeId)(e),this.schemas[e]||this.refs[e]}function Q6(){let e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(let t in e)this.addSchema(e[t],t)}function eZ(){for(let e in this.opts.formats){let t=this.opts.formats[e];t&&this.addFormat(e,t)}}function tZ(e){if(Array.isArray(e)){this.addVocabulary(e);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let t in e){let n=e[t];n.keyword||(n.keyword=t),this.addKeyword(n)}}function rZ(){let e={...this.opts};for(let t of G6)delete e[t];return e}var nZ={log(){},warn(){},error(){}};function iZ(e){if(e===!1)return nZ;if(e===void 0)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")}var oZ=/^[a-z_$][a-z0-9_$:-]*$/i;function aZ(e,t){let{RULES:n}=this;if((0,$$.eachItem)(e,i=>{if(n.keywords[i])throw new Error(`Keyword ${i} is already defined`);if(!oZ.test(i))throw new Error(`Keyword ${i} has invalid name`)}),!!t&&t.$data&&!("code"in t||"validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}function b$(e,t,n){var i;let r=t?.post;if(n&&r)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:o}=this,a=r?o.post:o.rules.find(({type:c})=>c===n);if(a||(a={type:n,rules:[]},o.rules.push(a)),o.keywords[e]=!0,!t)return;let s={keyword:e,definition:{...t,type:(0,Of.getJSONTypes)(t.type),schemaType:(0,Of.getJSONTypes)(t.schemaType)}};t.before?sZ.call(this,a,s,t.before):a.rules.push(s),o.all[e]=s,(i=t.implements)===null||i===void 0||i.forEach(c=>this.addKeyword(c))}function sZ(e,t,n){let i=e.rules.findIndex(r=>r.keyword===n);i>=0?e.rules.splice(i,0,t):(e.rules.push(t),this.logger.warn(`rule ${n} is not defined`))}function cZ(e){let{metaSchema:t}=e;t!==void 0&&(e.$data&&this.opts.$data&&(t=GP(t)),e.validateSchema=this.compile(t,!0))}var lZ={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function GP(e){return{anyOf:[e,lZ]}}});var WP=ne(w$=>{"use strict";Object.defineProperty(w$,"__esModule",{value:!0});var uZ={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};w$.default=uZ});var eE=ne(xo=>{"use strict";Object.defineProperty(xo,"__esModule",{value:!0});xo.callRef=xo.getValidate=void 0;var dZ=Al(),XP=qr(),kr=Oe(),ds=Bn(),YP=kf(),jf=Ve(),pZ={keyword:"$ref",schemaType:"string",code(e){let{gen:t,schema:n,it:i}=e,{baseId:r,schemaEnv:o,validateName:a,opts:s,self:c}=i,{root:l}=o;if((n==="#"||n==="#/")&&r===l.baseId)return p();let u=YP.resolveRef.call(c,l,r,n);if(u===void 0)throw new dZ.default(i.opts.uriResolver,r,n);if(u instanceof YP.SchemaEnv)return h(u);return g(u);function p(){if(o===l)return Rf(e,a,o,o.$async);let _=t.scopeValue("root",{ref:l});return Rf(e,(0,kr._)`${_}.validate`,l,l.$async)}function h(_){let k=QP(e,_);Rf(e,k,_,_.$async)}function g(_){let k=t.scopeValue("schema",s.code.source===!0?{ref:_,code:(0,kr.stringify)(_)}:{ref:_}),T=t.name("valid"),z=e.subschema({schema:_,dataTypes:[],schemaPath:kr.nil,topSchemaRef:k,errSchemaPath:n},T);e.mergeEvaluated(z),e.ok(T)}}};function QP(e,t){let{gen:n}=e;return t.validate?n.scopeValue("validate",{ref:t.validate}):(0,kr._)`${n.scopeValue("wrapper",{ref:t})}.validate`}xo.getValidate=QP;function Rf(e,t,n,i){let{gen:r,it:o}=e,{allErrors:a,schemaEnv:s,opts:c}=o,l=c.passContext?ds.default.this:kr.nil;i?u():p();function u(){if(!s.$async)throw new Error("async schema referenced by sync schema");let _=r.let("valid");r.try(()=>{r.code((0,kr._)`await ${(0,XP.callValidateCode)(e,t,l)}`),g(t),a||r.assign(_,!0)},k=>{r.if((0,kr._)`!(${k} instanceof ${o.ValidationError})`,()=>r.throw(k)),h(k),a||r.assign(_,!1)}),e.ok(_)}function p(){e.result((0,XP.callValidateCode)(e,t,l),()=>g(t),()=>h(t))}function h(_){let k=(0,kr._)`${_}.errors`;r.assign(ds.default.vErrors,(0,kr._)`${ds.default.vErrors} === null ? ${k} : ${ds.default.vErrors}.concat(${k})`),r.assign(ds.default.errors,(0,kr._)`${ds.default.vErrors}.length`)}function g(_){var k;if(!o.opts.unevaluated)return;let T=(k=n?.validate)===null||k===void 0?void 0:k.evaluated;if(o.props!==!0)if(T&&!T.dynamicProps)T.props!==void 0&&(o.props=jf.mergeEvaluated.props(r,T.props,o.props));else{let z=r.var("props",(0,kr._)`${_}.evaluated.props`);o.props=jf.mergeEvaluated.props(r,z,o.props,kr.Name)}if(o.items!==!0)if(T&&!T.dynamicItems)T.items!==void 0&&(o.items=jf.mergeEvaluated.items(r,T.items,o.items));else{let z=r.var("items",(0,kr._)`${_}.evaluated.items`);o.items=jf.mergeEvaluated.items(r,z,o.items,kr.Name)}}}xo.callRef=Rf;xo.default=pZ});var tE=ne(k$=>{"use strict";Object.defineProperty(k$,"__esModule",{value:!0});var mZ=WP(),fZ=eE(),hZ=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",mZ.default,fZ.default];k$.default=hZ});var rE=ne(x$=>{"use strict";Object.defineProperty(x$,"__esModule",{value:!0});var Df=Oe(),Oi=Df.operators,Cf={maximum:{okStr:"<=",ok:Oi.LTE,fail:Oi.GT},minimum:{okStr:">=",ok:Oi.GTE,fail:Oi.LT},exclusiveMaximum:{okStr:"<",ok:Oi.LT,fail:Oi.GTE},exclusiveMinimum:{okStr:">",ok:Oi.GT,fail:Oi.LTE}},gZ={message:({keyword:e,schemaCode:t})=>(0,Df.str)`must be ${Cf[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,Df._)`{comparison: ${Cf[e].okStr}, limit: ${t}}`},vZ={keyword:Object.keys(Cf),type:"number",schemaType:"number",$data:!0,error:gZ,code(e){let{keyword:t,data:n,schemaCode:i}=e;e.fail$data((0,Df._)`${n} ${Cf[t].fail} ${i} || isNaN(${n})`)}};x$.default=vZ});var nE=ne(S$=>{"use strict";Object.defineProperty(S$,"__esModule",{value:!0});var Fl=Oe(),yZ={message:({schemaCode:e})=>(0,Fl.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,Fl._)`{multipleOf: ${e}}`},_Z={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:yZ,code(e){let{gen:t,data:n,schemaCode:i,it:r}=e,o=r.opts.multipleOfPrecision,a=t.let("res"),s=o?(0,Fl._)`Math.abs(Math.round(${a}) - ${a}) > 1e-${o}`:(0,Fl._)`${a} !== parseInt(${a})`;e.fail$data((0,Fl._)`(${i} === 0 || (${a} = ${n}/${i}, ${s}))`)}};S$.default=_Z});var oE=ne(I$=>{"use strict";Object.defineProperty(I$,"__esModule",{value:!0});function iE(e){let t=e.length,n=0,i=0,r;for(;i<t;)n++,r=e.charCodeAt(i++),r>=55296&&r<=56319&&i<t&&(r=e.charCodeAt(i),(r&64512)===56320&&i++);return n}I$.default=iE;iE.code='require("ajv/dist/runtime/ucs2length").default'});var aE=ne(T$=>{"use strict";Object.defineProperty(T$,"__esModule",{value:!0});var So=Oe(),bZ=Ve(),$Z=oE(),wZ={message({keyword:e,schemaCode:t}){let n=e==="maxLength"?"more":"fewer";return(0,So.str)`must NOT have ${n} than ${t} characters`},params:({schemaCode:e})=>(0,So._)`{limit: ${e}}`},kZ={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:wZ,code(e){let{keyword:t,data:n,schemaCode:i,it:r}=e,o=t==="maxLength"?So.operators.GT:So.operators.LT,a=r.opts.unicode===!1?(0,So._)`${n}.length`:(0,So._)`${(0,bZ.useFunc)(e.gen,$Z.default)}(${n})`;e.fail$data((0,So._)`${a} ${o} ${i}`)}};T$.default=kZ});var sE=ne(z$=>{"use strict";Object.defineProperty(z$,"__esModule",{value:!0});var xZ=qr(),SZ=Ve(),ps=Oe(),IZ={message:({schemaCode:e})=>(0,ps.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,ps._)`{pattern: ${e}}`},TZ={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:IZ,code(e){let{gen:t,data:n,$data:i,schema:r,schemaCode:o,it:a}=e,s=a.opts.unicodeRegExp?"u":"";if(i){let{regExp:c}=a.opts.code,l=c.code==="new RegExp"?(0,ps._)`new RegExp`:(0,SZ.useFunc)(t,c),u=t.let("valid");t.try(()=>t.assign(u,(0,ps._)`${l}(${o}, ${s}).test(${n})`),()=>t.assign(u,!1)),e.fail$data((0,ps._)`!${u}`)}else{let c=(0,xZ.usePattern)(e,r);e.fail$data((0,ps._)`!${c}.test(${n})`)}}};z$.default=TZ});var cE=ne(P$=>{"use strict";Object.defineProperty(P$,"__esModule",{value:!0});var Vl=Oe(),zZ={message({keyword:e,schemaCode:t}){let n=e==="maxProperties"?"more":"fewer";return(0,Vl.str)`must NOT have ${n} than ${t} properties`},params:({schemaCode:e})=>(0,Vl._)`{limit: ${e}}`},PZ={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:zZ,code(e){let{keyword:t,data:n,schemaCode:i}=e,r=t==="maxProperties"?Vl.operators.GT:Vl.operators.LT;e.fail$data((0,Vl._)`Object.keys(${n}).length ${r} ${i}`)}};P$.default=PZ});var lE=ne(E$=>{"use strict";Object.defineProperty(E$,"__esModule",{value:!0});var ql=qr(),Bl=Oe(),EZ=Ve(),OZ={message:({params:{missingProperty:e}})=>(0,Bl.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,Bl._)`{missingProperty: ${e}}`},jZ={keyword:"required",type:"object",schemaType:"array",$data:!0,error:OZ,code(e){let{gen:t,schema:n,schemaCode:i,data:r,$data:o,it:a}=e,{opts:s}=a;if(!o&&n.length===0)return;let c=n.length>=s.loopRequired;if(a.allErrors?l():u(),s.strictRequired){let g=e.parentSchema.properties,{definedProperties:_}=e.it;for(let k of n)if(g?.[k]===void 0&&!_.has(k)){let T=a.schemaEnv.baseId+a.errSchemaPath,z=`required property "${k}" is not defined at "${T}" (strictRequired)`;(0,EZ.checkStrictMode)(a,z,a.opts.strictRequired)}}function l(){if(c||o)e.block$data(Bl.nil,p);else for(let g of n)(0,ql.checkReportMissingProp)(e,g)}function u(){let g=t.let("missing");if(c||o){let _=t.let("valid",!0);e.block$data(_,()=>h(g,_)),e.ok(_)}else t.if((0,ql.checkMissingProp)(e,n,g)),(0,ql.reportMissingProp)(e,g),t.else()}function p(){t.forOf("prop",i,g=>{e.setParams({missingProperty:g}),t.if((0,ql.noPropertyInData)(t,r,g,s.ownProperties),()=>e.error())})}function h(g,_){e.setParams({missingProperty:g}),t.forOf(g,i,()=>{t.assign(_,(0,ql.propertyInData)(t,r,g,s.ownProperties)),t.if((0,Bl.not)(_),()=>{e.error(),t.break()})},Bl.nil)}}};E$.default=jZ});var uE=ne(O$=>{"use strict";Object.defineProperty(O$,"__esModule",{value:!0});var Hl=Oe(),RZ={message({keyword:e,schemaCode:t}){let n=e==="maxItems"?"more":"fewer";return(0,Hl.str)`must NOT have ${n} than ${t} items`},params:({schemaCode:e})=>(0,Hl._)`{limit: ${e}}`},DZ={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:RZ,code(e){let{keyword:t,data:n,schemaCode:i}=e,r=t==="maxItems"?Hl.operators.GT:Hl.operators.LT;e.fail$data((0,Hl._)`${n}.length ${r} ${i}`)}};O$.default=DZ});var Af=ne(j$=>{"use strict";Object.defineProperty(j$,"__esModule",{value:!0});var dE=Wb();dE.code='require("ajv/dist/runtime/equal").default';j$.default=dE});var pE=ne(D$=>{"use strict";Object.defineProperty(D$,"__esModule",{value:!0});var R$=Ol(),Vt=Oe(),CZ=Ve(),AZ=Af(),NZ={message:({params:{i:e,j:t}})=>(0,Vt.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,Vt._)`{i: ${e}, j: ${t}}`},MZ={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:NZ,code(e){let{gen:t,data:n,$data:i,schema:r,parentSchema:o,schemaCode:a,it:s}=e;if(!i&&!r)return;let c=t.let("valid"),l=o.items?(0,R$.getSchemaTypes)(o.items):[];e.block$data(c,u,(0,Vt._)`${a} === false`),e.ok(c);function u(){let _=t.let("i",(0,Vt._)`${n}.length`),k=t.let("j");e.setParams({i:_,j:k}),t.assign(c,!0),t.if((0,Vt._)`${_} > 1`,()=>(p()?h:g)(_,k))}function p(){return l.length>0&&!l.some(_=>_==="object"||_==="array")}function h(_,k){let T=t.name("item"),z=(0,R$.checkDataTypes)(l,T,s.opts.strictNumbers,R$.DataType.Wrong),S=t.const("indices",(0,Vt._)`{}`);t.for((0,Vt._)`;${_}--;`,()=>{t.let(T,(0,Vt._)`${n}[${_}]`),t.if(z,(0,Vt._)`continue`),l.length>1&&t.if((0,Vt._)`typeof ${T} == "string"`,(0,Vt._)`${T} += "_"`),t.if((0,Vt._)`typeof ${S}[${T}] == "number"`,()=>{t.assign(k,(0,Vt._)`${S}[${T}]`),e.error(),t.assign(c,!1).break()}).code((0,Vt._)`${S}[${T}] = ${_}`)})}function g(_,k){let T=(0,CZ.useFunc)(t,AZ.default),z=t.name("outer");t.label(z).for((0,Vt._)`;${_}--;`,()=>t.for((0,Vt._)`${k} = ${_}; ${k}--;`,()=>t.if((0,Vt._)`${T}(${n}[${_}], ${n}[${k}])`,()=>{e.error(),t.assign(c,!1).break(z)})))}}};D$.default=MZ});var mE=ne(A$=>{"use strict";Object.defineProperty(A$,"__esModule",{value:!0});var C$=Oe(),LZ=Ve(),UZ=Af(),ZZ={message:"must be equal to constant",params:({schemaCode:e})=>(0,C$._)`{allowedValue: ${e}}`},FZ={keyword:"const",$data:!0,error:ZZ,code(e){let{gen:t,data:n,$data:i,schemaCode:r,schema:o}=e;i||o&&typeof o=="object"?e.fail$data((0,C$._)`!${(0,LZ.useFunc)(t,UZ.default)}(${n}, ${r})`):e.fail((0,C$._)`${o} !== ${n}`)}};A$.default=FZ});var fE=ne(N$=>{"use strict";Object.defineProperty(N$,"__esModule",{value:!0});var Jl=Oe(),VZ=Ve(),qZ=Af(),BZ={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,Jl._)`{allowedValues: ${e}}`},HZ={keyword:"enum",schemaType:"array",$data:!0,error:BZ,code(e){let{gen:t,data:n,$data:i,schema:r,schemaCode:o,it:a}=e;if(!i&&r.length===0)throw new Error("enum must have non-empty array");let s=r.length>=a.opts.loopEnum,c,l=()=>c??(c=(0,VZ.useFunc)(t,qZ.default)),u;if(s||i)u=t.let("valid"),e.block$data(u,p);else{if(!Array.isArray(r))throw new Error("ajv implementation error");let g=t.const("vSchema",o);u=(0,Jl.or)(...r.map((_,k)=>h(g,k)))}e.pass(u);function p(){t.assign(u,!1),t.forOf("v",o,g=>t.if((0,Jl._)`${l()}(${n}, ${g})`,()=>t.assign(u,!0).break()))}function h(g,_){let k=r[_];return typeof k=="object"&&k!==null?(0,Jl._)`${l()}(${n}, ${g}[${_}])`:(0,Jl._)`${n} === ${k}`}}};N$.default=HZ});var hE=ne(M$=>{"use strict";Object.defineProperty(M$,"__esModule",{value:!0});var JZ=rE(),GZ=nE(),KZ=aE(),WZ=sE(),XZ=cE(),YZ=lE(),QZ=uE(),e2=pE(),t2=mE(),r2=fE(),n2=[JZ.default,GZ.default,KZ.default,WZ.default,XZ.default,YZ.default,QZ.default,e2.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},t2.default,r2.default];M$.default=n2});var U$=ne(Gl=>{"use strict";Object.defineProperty(Gl,"__esModule",{value:!0});Gl.validateAdditionalItems=void 0;var Io=Oe(),L$=Ve(),i2={message:({params:{len:e}})=>(0,Io.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,Io._)`{limit: ${e}}`},o2={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:i2,code(e){let{parentSchema:t,it:n}=e,{items:i}=t;if(!Array.isArray(i)){(0,L$.checkStrictMode)(n,'"additionalItems" is ignored when "items" is not an array of schemas');return}gE(e,i)}};function gE(e,t){let{gen:n,schema:i,data:r,keyword:o,it:a}=e;a.items=!0;let s=n.const("len",(0,Io._)`${r}.length`);if(i===!1)e.setParams({len:t.length}),e.pass((0,Io._)`${s} <= ${t.length}`);else if(typeof i=="object"&&!(0,L$.alwaysValidSchema)(a,i)){let l=n.var("valid",(0,Io._)`${s} <= ${t.length}`);n.if((0,Io.not)(l),()=>c(l)),e.ok(l)}function c(l){n.forRange("i",t.length,s,u=>{e.subschema({keyword:o,dataProp:u,dataPropType:L$.Type.Num},l),a.allErrors||n.if((0,Io.not)(l),()=>n.break())})}}Gl.validateAdditionalItems=gE;Gl.default=o2});var Z$=ne(Kl=>{"use strict";Object.defineProperty(Kl,"__esModule",{value:!0});Kl.validateTuple=void 0;var vE=Oe(),Nf=Ve(),a2=qr(),s2={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:n}=e;if(Array.isArray(t))return yE(e,"additionalItems",t);n.items=!0,!(0,Nf.alwaysValidSchema)(n,t)&&e.ok((0,a2.validateArray)(e))}};function yE(e,t,n=e.schema){let{gen:i,parentSchema:r,data:o,keyword:a,it:s}=e;u(r),s.opts.unevaluated&&n.length&&s.items!==!0&&(s.items=Nf.mergeEvaluated.items(i,n.length,s.items));let c=i.name("valid"),l=i.const("len",(0,vE._)`${o}.length`);n.forEach((p,h)=>{(0,Nf.alwaysValidSchema)(s,p)||(i.if((0,vE._)`${l} > ${h}`,()=>e.subschema({keyword:a,schemaProp:h,dataProp:h},c)),e.ok(c))});function u(p){let{opts:h,errSchemaPath:g}=s,_=n.length,k=_===p.minItems&&(_===p.maxItems||p[t]===!1);if(h.strictTuples&&!k){let T=`"${a}" is ${_}-tuple, but minItems or maxItems/${t} are not specified or different at path "${g}"`;(0,Nf.checkStrictMode)(s,T,h.strictTuples)}}}Kl.validateTuple=yE;Kl.default=s2});var _E=ne(F$=>{"use strict";Object.defineProperty(F$,"__esModule",{value:!0});var c2=Z$(),l2={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,c2.validateTuple)(e,"items")};F$.default=l2});var $E=ne(V$=>{"use strict";Object.defineProperty(V$,"__esModule",{value:!0});var bE=Oe(),u2=Ve(),d2=qr(),p2=U$(),m2={message:({params:{len:e}})=>(0,bE.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,bE._)`{limit: ${e}}`},f2={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:m2,code(e){let{schema:t,parentSchema:n,it:i}=e,{prefixItems:r}=n;i.items=!0,!(0,u2.alwaysValidSchema)(i,t)&&(r?(0,p2.validateAdditionalItems)(e,r):e.ok((0,d2.validateArray)(e)))}};V$.default=f2});var wE=ne(q$=>{"use strict";Object.defineProperty(q$,"__esModule",{value:!0});var Hr=Oe(),Mf=Ve(),h2={message:({params:{min:e,max:t}})=>t===void 0?(0,Hr.str)`must contain at least ${e} valid item(s)`:(0,Hr.str)`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?(0,Hr._)`{minContains: ${e}}`:(0,Hr._)`{minContains: ${e}, maxContains: ${t}}`},g2={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:h2,code(e){let{gen:t,schema:n,parentSchema:i,data:r,it:o}=e,a,s,{minContains:c,maxContains:l}=i;o.opts.next?(a=c===void 0?1:c,s=l):a=1;let u=t.const("len",(0,Hr._)`${r}.length`);if(e.setParams({min:a,max:s}),s===void 0&&a===0){(0,Mf.checkStrictMode)(o,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(s!==void 0&&a>s){(0,Mf.checkStrictMode)(o,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,Mf.alwaysValidSchema)(o,n)){let k=(0,Hr._)`${u} >= ${a}`;s!==void 0&&(k=(0,Hr._)`${k} && ${u} <= ${s}`),e.pass(k);return}o.items=!0;let p=t.name("valid");s===void 0&&a===1?g(p,()=>t.if(p,()=>t.break())):a===0?(t.let(p,!0),s!==void 0&&t.if((0,Hr._)`${r}.length > 0`,h)):(t.let(p,!1),h()),e.result(p,()=>e.reset());function h(){let k=t.name("_valid"),T=t.let("count",0);g(k,()=>t.if(k,()=>_(T)))}function g(k,T){t.forRange("i",0,u,z=>{e.subschema({keyword:"contains",dataProp:z,dataPropType:Mf.Type.Num,compositeRule:!0},k),T()})}function _(k){t.code((0,Hr._)`${k}++`),s===void 0?t.if((0,Hr._)`${k} >= ${a}`,()=>t.assign(p,!0).break()):(t.if((0,Hr._)`${k} > ${s}`,()=>t.assign(p,!1).break()),a===1?t.assign(p,!0):t.if((0,Hr._)`${k} >= ${a}`,()=>t.assign(p,!0)))}}};q$.default=g2});var SE=ne(Sn=>{"use strict";Object.defineProperty(Sn,"__esModule",{value:!0});Sn.validateSchemaDeps=Sn.validatePropertyDeps=Sn.error=void 0;var B$=Oe(),v2=Ve(),Wl=qr();Sn.error={message:({params:{property:e,depsCount:t,deps:n}})=>{let i=t===1?"property":"properties";return(0,B$.str)`must have ${i} ${n} when property ${e} is present`},params:({params:{property:e,depsCount:t,deps:n,missingProperty:i}})=>(0,B$._)`{property: ${e},
|
|
28
|
+
missingProperty: ${i},
|
|
29
|
+
depsCount: ${t},
|
|
30
|
+
deps: ${n}}`};var y2={keyword:"dependencies",type:"object",schemaType:"object",error:Sn.error,code(e){let[t,n]=_2(e);kE(e,t),xE(e,n)}};function _2({schema:e}){let t={},n={};for(let i in e){if(i==="__proto__")continue;let r=Array.isArray(e[i])?t:n;r[i]=e[i]}return[t,n]}function kE(e,t=e.schema){let{gen:n,data:i,it:r}=e;if(Object.keys(t).length===0)return;let o=n.let("missing");for(let a in t){let s=t[a];if(s.length===0)continue;let c=(0,Wl.propertyInData)(n,i,a,r.opts.ownProperties);e.setParams({property:a,depsCount:s.length,deps:s.join(", ")}),r.allErrors?n.if(c,()=>{for(let l of s)(0,Wl.checkReportMissingProp)(e,l)}):(n.if((0,B$._)`${c} && (${(0,Wl.checkMissingProp)(e,s,o)})`),(0,Wl.reportMissingProp)(e,o),n.else())}}Sn.validatePropertyDeps=kE;function xE(e,t=e.schema){let{gen:n,data:i,keyword:r,it:o}=e,a=n.name("valid");for(let s in t)(0,v2.alwaysValidSchema)(o,t[s])||(n.if((0,Wl.propertyInData)(n,i,s,o.opts.ownProperties),()=>{let c=e.subschema({keyword:r,schemaProp:s},a);e.mergeValidEvaluated(c,a)},()=>n.var(a,!0)),e.ok(a))}Sn.validateSchemaDeps=xE;Sn.default=y2});var TE=ne(H$=>{"use strict";Object.defineProperty(H$,"__esModule",{value:!0});var IE=Oe(),b2=Ve(),$2={message:"property name must be valid",params:({params:e})=>(0,IE._)`{propertyName: ${e.propertyName}}`},w2={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:$2,code(e){let{gen:t,schema:n,data:i,it:r}=e;if((0,b2.alwaysValidSchema)(r,n))return;let o=t.name("valid");t.forIn("key",i,a=>{e.setParams({propertyName:a}),e.subschema({keyword:"propertyNames",data:a,dataTypes:["string"],propertyName:a,compositeRule:!0},o),t.if((0,IE.not)(o),()=>{e.error(!0),r.allErrors||t.break()})}),e.ok(o)}};H$.default=w2});var G$=ne(J$=>{"use strict";Object.defineProperty(J$,"__esModule",{value:!0});var Lf=qr(),un=Oe(),k2=Bn(),Uf=Ve(),x2={message:"must NOT have additional properties",params:({params:e})=>(0,un._)`{additionalProperty: ${e.additionalProperty}}`},S2={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:x2,code(e){let{gen:t,schema:n,parentSchema:i,data:r,errsCount:o,it:a}=e;if(!o)throw new Error("ajv implementation error");let{allErrors:s,opts:c}=a;if(a.props=!0,c.removeAdditional!=="all"&&(0,Uf.alwaysValidSchema)(a,n))return;let l=(0,Lf.allSchemaProperties)(i.properties),u=(0,Lf.allSchemaProperties)(i.patternProperties);p(),e.ok((0,un._)`${o} === ${k2.default.errors}`);function p(){t.forIn("key",r,T=>{!l.length&&!u.length?_(T):t.if(h(T),()=>_(T))})}function h(T){let z;if(l.length>8){let S=(0,Uf.schemaRefOrVal)(a,i.properties,"properties");z=(0,Lf.isOwnProperty)(t,S,T)}else l.length?z=(0,un.or)(...l.map(S=>(0,un._)`${T} === ${S}`)):z=un.nil;return u.length&&(z=(0,un.or)(z,...u.map(S=>(0,un._)`${(0,Lf.usePattern)(e,S)}.test(${T})`))),(0,un.not)(z)}function g(T){t.code((0,un._)`delete ${r}[${T}]`)}function _(T){if(c.removeAdditional==="all"||c.removeAdditional&&n===!1){g(T);return}if(n===!1){e.setParams({additionalProperty:T}),e.error(),s||t.break();return}if(typeof n=="object"&&!(0,Uf.alwaysValidSchema)(a,n)){let z=t.name("valid");c.removeAdditional==="failing"?(k(T,z,!1),t.if((0,un.not)(z),()=>{e.reset(),g(T)})):(k(T,z),s||t.if((0,un.not)(z),()=>t.break()))}}function k(T,z,S){let A={keyword:"additionalProperties",dataProp:T,dataPropType:Uf.Type.Str};S===!1&&Object.assign(A,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(A,z)}}};J$.default=S2});var EE=ne(W$=>{"use strict";Object.defineProperty(W$,"__esModule",{value:!0});var I2=Cl(),zE=qr(),K$=Ve(),PE=G$(),T2={keyword:"properties",type:"object",schemaType:"object",code(e){let{gen:t,schema:n,parentSchema:i,data:r,it:o}=e;o.opts.removeAdditional==="all"&&i.additionalProperties===void 0&&PE.default.code(new I2.KeywordCxt(o,PE.default,"additionalProperties"));let a=(0,zE.allSchemaProperties)(n);for(let p of a)o.definedProperties.add(p);o.opts.unevaluated&&a.length&&o.props!==!0&&(o.props=K$.mergeEvaluated.props(t,(0,K$.toHash)(a),o.props));let s=a.filter(p=>!(0,K$.alwaysValidSchema)(o,n[p]));if(s.length===0)return;let c=t.name("valid");for(let p of s)l(p)?u(p):(t.if((0,zE.propertyInData)(t,r,p,o.opts.ownProperties)),u(p),o.allErrors||t.else().var(c,!0),t.endIf()),e.it.definedProperties.add(p),e.ok(c);function l(p){return o.opts.useDefaults&&!o.compositeRule&&n[p].default!==void 0}function u(p){e.subschema({keyword:"properties",schemaProp:p,dataProp:p},c)}}};W$.default=T2});var DE=ne(X$=>{"use strict";Object.defineProperty(X$,"__esModule",{value:!0});var OE=qr(),Zf=Oe(),jE=Ve(),RE=Ve(),z2={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:t,schema:n,data:i,parentSchema:r,it:o}=e,{opts:a}=o,s=(0,OE.allSchemaProperties)(n),c=s.filter(k=>(0,jE.alwaysValidSchema)(o,n[k]));if(s.length===0||c.length===s.length&&(!o.opts.unevaluated||o.props===!0))return;let l=a.strictSchema&&!a.allowMatchingProperties&&r.properties,u=t.name("valid");o.props!==!0&&!(o.props instanceof Zf.Name)&&(o.props=(0,RE.evaluatedPropsToName)(t,o.props));let{props:p}=o;h();function h(){for(let k of s)l&&g(k),o.allErrors?_(k):(t.var(u,!0),_(k),t.if(u))}function g(k){for(let T in l)new RegExp(k).test(T)&&(0,jE.checkStrictMode)(o,`property ${T} matches pattern ${k} (use allowMatchingProperties)`)}function _(k){t.forIn("key",i,T=>{t.if((0,Zf._)`${(0,OE.usePattern)(e,k)}.test(${T})`,()=>{let z=c.includes(k);z||e.subschema({keyword:"patternProperties",schemaProp:k,dataProp:T,dataPropType:RE.Type.Str},u),o.opts.unevaluated&&p!==!0?t.assign((0,Zf._)`${p}[${T}]`,!0):!z&&!o.allErrors&&t.if((0,Zf.not)(u),()=>t.break())})})}}};X$.default=z2});var CE=ne(Y$=>{"use strict";Object.defineProperty(Y$,"__esModule",{value:!0});var P2=Ve(),E2={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:n,it:i}=e;if((0,P2.alwaysValidSchema)(i,n)){e.fail();return}let r=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},r),e.failResult(r,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};Y$.default=E2});var AE=ne(Q$=>{"use strict";Object.defineProperty(Q$,"__esModule",{value:!0});var O2=qr(),j2={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:O2.validateUnion,error:{message:"must match a schema in anyOf"}};Q$.default=j2});var NE=ne(ew=>{"use strict";Object.defineProperty(ew,"__esModule",{value:!0});var Ff=Oe(),R2=Ve(),D2={message:"must match exactly one schema in oneOf",params:({params:e})=>(0,Ff._)`{passingSchemas: ${e.passing}}`},C2={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:D2,code(e){let{gen:t,schema:n,parentSchema:i,it:r}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");if(r.opts.discriminator&&i.discriminator)return;let o=n,a=t.let("valid",!1),s=t.let("passing",null),c=t.name("_valid");e.setParams({passing:s}),t.block(l),e.result(a,()=>e.reset(),()=>e.error(!0));function l(){o.forEach((u,p)=>{let h;(0,R2.alwaysValidSchema)(r,u)?t.var(c,!0):h=e.subschema({keyword:"oneOf",schemaProp:p,compositeRule:!0},c),p>0&&t.if((0,Ff._)`${c} && ${a}`).assign(a,!1).assign(s,(0,Ff._)`[${s}, ${p}]`).else(),t.if(c,()=>{t.assign(a,!0),t.assign(s,p),h&&e.mergeEvaluated(h,Ff.Name)})})}}};ew.default=C2});var ME=ne(tw=>{"use strict";Object.defineProperty(tw,"__esModule",{value:!0});var A2=Ve(),N2={keyword:"allOf",schemaType:"array",code(e){let{gen:t,schema:n,it:i}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");let r=t.name("valid");n.forEach((o,a)=>{if((0,A2.alwaysValidSchema)(i,o))return;let s=e.subschema({keyword:"allOf",schemaProp:a},r);e.ok(r),e.mergeEvaluated(s)})}};tw.default=N2});var ZE=ne(rw=>{"use strict";Object.defineProperty(rw,"__esModule",{value:!0});var Vf=Oe(),UE=Ve(),M2={message:({params:e})=>(0,Vf.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,Vf._)`{failingKeyword: ${e.ifClause}}`},L2={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:M2,code(e){let{gen:t,parentSchema:n,it:i}=e;n.then===void 0&&n.else===void 0&&(0,UE.checkStrictMode)(i,'"if" without "then" and "else" is ignored');let r=LE(i,"then"),o=LE(i,"else");if(!r&&!o)return;let a=t.let("valid",!0),s=t.name("_valid");if(c(),e.reset(),r&&o){let u=t.let("ifClause");e.setParams({ifClause:u}),t.if(s,l("then",u),l("else",u))}else r?t.if(s,l("then")):t.if((0,Vf.not)(s),l("else"));e.pass(a,()=>e.error(!0));function c(){let u=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},s);e.mergeEvaluated(u)}function l(u,p){return()=>{let h=e.subschema({keyword:u},s);t.assign(a,s),e.mergeValidEvaluated(h,a),p?t.assign(p,(0,Vf._)`${u}`):e.setParams({ifClause:u})}}}};function LE(e,t){let n=e.schema[t];return n!==void 0&&!(0,UE.alwaysValidSchema)(e,n)}rw.default=L2});var FE=ne(nw=>{"use strict";Object.defineProperty(nw,"__esModule",{value:!0});var U2=Ve(),Z2={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:n}){t.if===void 0&&(0,U2.checkStrictMode)(n,`"${e}" without "if" is ignored`)}};nw.default=Z2});var VE=ne(iw=>{"use strict";Object.defineProperty(iw,"__esModule",{value:!0});var F2=U$(),V2=_E(),q2=Z$(),B2=$E(),H2=wE(),J2=SE(),G2=TE(),K2=G$(),W2=EE(),X2=DE(),Y2=CE(),Q2=AE(),eF=NE(),tF=ME(),rF=ZE(),nF=FE();function iF(e=!1){let t=[Y2.default,Q2.default,eF.default,tF.default,rF.default,nF.default,G2.default,K2.default,J2.default,W2.default,X2.default];return e?t.push(V2.default,B2.default):t.push(F2.default,q2.default),t.push(H2.default),t}iw.default=iF});var qE=ne(ow=>{"use strict";Object.defineProperty(ow,"__esModule",{value:!0});var wt=Oe(),oF={message:({schemaCode:e})=>(0,wt.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,wt._)`{format: ${e}}`},aF={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:oF,code(e,t){let{gen:n,data:i,$data:r,schema:o,schemaCode:a,it:s}=e,{opts:c,errSchemaPath:l,schemaEnv:u,self:p}=s;if(!c.validateFormats)return;r?h():g();function h(){let _=n.scopeValue("formats",{ref:p.formats,code:c.code.formats}),k=n.const("fDef",(0,wt._)`${_}[${a}]`),T=n.let("fType"),z=n.let("format");n.if((0,wt._)`typeof ${k} == "object" && !(${k} instanceof RegExp)`,()=>n.assign(T,(0,wt._)`${k}.type || "string"`).assign(z,(0,wt._)`${k}.validate`),()=>n.assign(T,(0,wt._)`"string"`).assign(z,k)),e.fail$data((0,wt.or)(S(),A()));function S(){return c.strictSchema===!1?wt.nil:(0,wt._)`${a} && !${z}`}function A(){let Q=u.$async?(0,wt._)`(${k}.async ? await ${z}(${i}) : ${z}(${i}))`:(0,wt._)`${z}(${i})`,X=(0,wt._)`(typeof ${z} == "function" ? ${Q} : ${z}.test(${i}))`;return(0,wt._)`${z} && ${z} !== true && ${T} === ${t} && !${X}`}}function g(){let _=p.formats[o];if(!_){S();return}if(_===!0)return;let[k,T,z]=A(_);k===t&&e.pass(Q());function S(){if(c.strictSchema===!1){p.logger.warn(X());return}throw new Error(X());function X(){return`unknown format "${o}" ignored in schema at path "${l}"`}}function A(X){let ge=X instanceof RegExp?(0,wt.regexpCode)(X):c.code.formats?(0,wt._)`${c.code.formats}${(0,wt.getProperty)(o)}`:void 0,ye=n.scopeValue("formats",{key:o,ref:X,code:ge});return typeof X=="object"&&!(X instanceof RegExp)?[X.type||"string",X.validate,(0,wt._)`${ye}.validate`]:["string",X,ye]}function Q(){if(typeof _=="object"&&!(_ instanceof RegExp)&&_.async){if(!u.$async)throw new Error("async format in sync schema");return(0,wt._)`await ${z}(${i})`}return typeof T=="function"?(0,wt._)`${z}(${i})`:(0,wt._)`${z}.test(${i})`}}}};ow.default=aF});var BE=ne(aw=>{"use strict";Object.defineProperty(aw,"__esModule",{value:!0});var sF=qE(),cF=[sF.default];aw.default=cF});var HE=ne(ms=>{"use strict";Object.defineProperty(ms,"__esModule",{value:!0});ms.contentVocabulary=ms.metadataVocabulary=void 0;ms.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];ms.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var GE=ne(sw=>{"use strict";Object.defineProperty(sw,"__esModule",{value:!0});var lF=tE(),uF=hE(),dF=VE(),pF=BE(),JE=HE(),mF=[lF.default,uF.default,(0,dF.default)(),pF.default,JE.metadataVocabulary,JE.contentVocabulary];sw.default=mF});var WE=ne(qf=>{"use strict";Object.defineProperty(qf,"__esModule",{value:!0});qf.DiscrError=void 0;var KE;(function(e){e.Tag="tag",e.Mapping="mapping"})(KE||(qf.DiscrError=KE={}))});var YE=ne(lw=>{"use strict";Object.defineProperty(lw,"__esModule",{value:!0});var fs=Oe(),cw=WE(),XE=kf(),fF=Al(),hF=Ve(),gF={message:({params:{discrError:e,tagName:t}})=>e===cw.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:n}})=>(0,fs._)`{error: ${e}, tag: ${n}, tagValue: ${t}}`},vF={keyword:"discriminator",type:"object",schemaType:"object",error:gF,code(e){let{gen:t,data:n,schema:i,parentSchema:r,it:o}=e,{oneOf:a}=r;if(!o.opts.discriminator)throw new Error("discriminator: requires discriminator option");let s=i.propertyName;if(typeof s!="string")throw new Error("discriminator: requires propertyName");if(i.mapping)throw new Error("discriminator: mapping is not supported");if(!a)throw new Error("discriminator: requires oneOf keyword");let c=t.let("valid",!1),l=t.const("tag",(0,fs._)`${n}${(0,fs.getProperty)(s)}`);t.if((0,fs._)`typeof ${l} == "string"`,()=>u(),()=>e.error(!1,{discrError:cw.DiscrError.Tag,tag:l,tagName:s})),e.ok(c);function u(){let g=h();t.if(!1);for(let _ in g)t.elseIf((0,fs._)`${l} === ${_}`),t.assign(c,p(g[_]));t.else(),e.error(!1,{discrError:cw.DiscrError.Mapping,tag:l,tagName:s}),t.endIf()}function p(g){let _=t.name("valid"),k=e.subschema({keyword:"oneOf",schemaProp:g},_);return e.mergeEvaluated(k,fs.Name),_}function h(){var g;let _={},k=z(r),T=!0;for(let Q=0;Q<a.length;Q++){let X=a[Q];if(X?.$ref&&!(0,hF.schemaHasRulesButRef)(X,o.self.RULES)){let ye=X.$ref;if(X=XE.resolveRef.call(o.self,o.schemaEnv.root,o.baseId,ye),X instanceof XE.SchemaEnv&&(X=X.schema),X===void 0)throw new fF.default(o.opts.uriResolver,o.baseId,ye)}let ge=(g=X?.properties)===null||g===void 0?void 0:g[s];if(typeof ge!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${s}"`);T=T&&(k||z(X)),S(ge,Q)}if(!T)throw new Error(`discriminator: "${s}" must be required`);return _;function z({required:Q}){return Array.isArray(Q)&&Q.includes(s)}function S(Q,X){if(Q.const)A(Q.const,X);else if(Q.enum)for(let ge of Q.enum)A(ge,X);else throw new Error(`discriminator: "properties/${s}" must have "const" or "enum"`)}function A(Q,X){if(typeof Q!="string"||Q in _)throw new Error(`discriminator: "${s}" values must be unique strings`);_[Q]=X}}}};lw.default=vF});var QE=ne((c7,yF)=>{yF.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 dw=ne((ut,uw)=>{"use strict";Object.defineProperty(ut,"__esModule",{value:!0});ut.MissingRefError=ut.ValidationError=ut.CodeGen=ut.Name=ut.nil=ut.stringify=ut.str=ut._=ut.KeywordCxt=ut.Ajv=void 0;var _F=KP(),bF=GE(),$F=YE(),eO=QE(),wF=["/properties"],Bf="http://json-schema.org/draft-07/schema",hs=class extends _F.default{_addVocabularies(){super._addVocabularies(),bF.default.forEach(t=>this.addVocabulary(t)),this.opts.discriminator&&this.addKeyword($F.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let t=this.opts.$data?this.$dataMetaSchema(eO,wF):eO;this.addMetaSchema(t,Bf,!1),this.refs["http://json-schema.org/schema"]=Bf}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Bf)?Bf:void 0)}};ut.Ajv=hs;uw.exports=ut=hs;uw.exports.Ajv=hs;Object.defineProperty(ut,"__esModule",{value:!0});ut.default=hs;var kF=Cl();Object.defineProperty(ut,"KeywordCxt",{enumerable:!0,get:function(){return kF.KeywordCxt}});var gs=Oe();Object.defineProperty(ut,"_",{enumerable:!0,get:function(){return gs._}});Object.defineProperty(ut,"str",{enumerable:!0,get:function(){return gs.str}});Object.defineProperty(ut,"stringify",{enumerable:!0,get:function(){return gs.stringify}});Object.defineProperty(ut,"nil",{enumerable:!0,get:function(){return gs.nil}});Object.defineProperty(ut,"Name",{enumerable:!0,get:function(){return gs.Name}});Object.defineProperty(ut,"CodeGen",{enumerable:!0,get:function(){return gs.CodeGen}});var xF=$f();Object.defineProperty(ut,"ValidationError",{enumerable:!0,get:function(){return xF.default}});var SF=Al();Object.defineProperty(ut,"MissingRefError",{enumerable:!0,get:function(){return SF.default}})});var cO=ne(Tn=>{"use strict";Object.defineProperty(Tn,"__esModule",{value:!0});Tn.formatNames=Tn.fastFormats=Tn.fullFormats=void 0;function In(e,t){return{validate:e,compare:t}}Tn.fullFormats={date:In(iO,hw),time:In(mw(!0),gw),"date-time":In(tO(!0),aO),"iso-time":In(mw(),oO),"iso-date-time":In(tO(),sO),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:OF,"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:MF,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:jF,int32:{type:"number",validate:CF},int64:{type:"number",validate:AF},float:{type:"number",validate:nO},double:{type:"number",validate:nO},password:!0,binary:!0};Tn.fastFormats={...Tn.fullFormats,date:In(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,hw),time:In(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,gw),"date-time":In(/^\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,aO),"iso-time":In(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,oO),"iso-date-time":In(/^\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,sO),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};Tn.formatNames=Object.keys(Tn.fullFormats);function IF(e){return e%4===0&&(e%100!==0||e%400===0)}var TF=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,zF=[0,31,28,31,30,31,30,31,31,30,31,30,31];function iO(e){let t=TF.exec(e);if(!t)return!1;let n=+t[1],i=+t[2],r=+t[3];return i>=1&&i<=12&&r>=1&&r<=(i===2&&IF(n)?29:zF[i])}function hw(e,t){if(e&&t)return e>t?1:e<t?-1:0}var pw=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function mw(e){return function(n){let i=pw.exec(n);if(!i)return!1;let r=+i[1],o=+i[2],a=+i[3],s=i[4],c=i[5]==="-"?-1:1,l=+(i[6]||0),u=+(i[7]||0);if(l>23||u>59||e&&!s)return!1;if(r<=23&&o<=59&&a<60)return!0;let p=o-u*c,h=r-l*c-(p<0?1:0);return(h===23||h===-1)&&(p===59||p===-1)&&a<61}}function gw(e,t){if(!(e&&t))return;let n=new Date("2020-01-01T"+e).valueOf(),i=new Date("2020-01-01T"+t).valueOf();if(n&&i)return n-i}function oO(e,t){if(!(e&&t))return;let n=pw.exec(e),i=pw.exec(t);if(n&&i)return e=n[1]+n[2]+n[3],t=i[1]+i[2]+i[3],e>t?1:e<t?-1:0}var fw=/t|\s/i;function tO(e){let t=mw(e);return function(i){let r=i.split(fw);return r.length===2&&iO(r[0])&&t(r[1])}}function aO(e,t){if(!(e&&t))return;let n=new Date(e).valueOf(),i=new Date(t).valueOf();if(n&&i)return n-i}function sO(e,t){if(!(e&&t))return;let[n,i]=e.split(fw),[r,o]=t.split(fw),a=hw(n,r);if(a!==void 0)return a||gw(i,o)}var PF=/\/|:/,EF=/^(?:[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 OF(e){return PF.test(e)&&EF.test(e)}var rO=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function jF(e){return rO.lastIndex=0,rO.test(e)}var RF=-(2**31),DF=2**31-1;function CF(e){return Number.isInteger(e)&&e<=DF&&e>=RF}function AF(e){return Number.isInteger(e)}function nO(){return!0}var NF=/[^\\]\\Z/;function MF(e){if(NF.test(e))return!1;try{return new RegExp(e),!0}catch{return!1}}});var lO=ne(vs=>{"use strict";Object.defineProperty(vs,"__esModule",{value:!0});vs.formatLimitDefinition=void 0;var LF=dw(),dn=Oe(),ji=dn.operators,Hf={formatMaximum:{okStr:"<=",ok:ji.LTE,fail:ji.GT},formatMinimum:{okStr:">=",ok:ji.GTE,fail:ji.LT},formatExclusiveMaximum:{okStr:"<",ok:ji.LT,fail:ji.GTE},formatExclusiveMinimum:{okStr:">",ok:ji.GT,fail:ji.LTE}},UF={message:({keyword:e,schemaCode:t})=>(0,dn.str)`should be ${Hf[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,dn._)`{comparison: ${Hf[e].okStr}, limit: ${t}}`};vs.formatLimitDefinition={keyword:Object.keys(Hf),type:"string",schemaType:"string",$data:!0,error:UF,code(e){let{gen:t,data:n,schemaCode:i,keyword:r,it:o}=e,{opts:a,self:s}=o;if(!a.validateFormats)return;let c=new LF.KeywordCxt(o,s.RULES.all.format.definition,"format");c.$data?l():u();function l(){let h=t.scopeValue("formats",{ref:s.formats,code:a.code.formats}),g=t.const("fmt",(0,dn._)`${h}[${c.schemaCode}]`);e.fail$data((0,dn.or)((0,dn._)`typeof ${g} != "object"`,(0,dn._)`${g} instanceof RegExp`,(0,dn._)`typeof ${g}.compare != "function"`,p(g)))}function u(){let h=c.schema,g=s.formats[h];if(!g||g===!0)return;if(typeof g!="object"||g instanceof RegExp||typeof g.compare!="function")throw new Error(`"${r}": format "${h}" does not define "compare" function`);let _=t.scopeValue("formats",{key:h,ref:g,code:a.code.formats?(0,dn._)`${a.code.formats}${(0,dn.getProperty)(h)}`:void 0});e.fail$data(p(_))}function p(h){return(0,dn._)`${h}.compare(${n}, ${i}) ${Hf[r].fail} 0`}},dependencies:["format"]};var ZF=e=>(e.addKeyword(vs.formatLimitDefinition),e);vs.default=ZF});var mO=ne((Xl,pO)=>{"use strict";Object.defineProperty(Xl,"__esModule",{value:!0});var ys=cO(),FF=lO(),vw=Oe(),uO=new vw.Name("fullFormats"),VF=new vw.Name("fastFormats"),yw=(e,t={keywords:!0})=>{if(Array.isArray(t))return dO(e,t,ys.fullFormats,uO),e;let[n,i]=t.mode==="fast"?[ys.fastFormats,VF]:[ys.fullFormats,uO],r=t.formats||ys.formatNames;return dO(e,r,n,i),t.keywords&&(0,FF.default)(e),e};yw.get=(e,t="full")=>{let i=(t==="fast"?ys.fastFormats:ys.fullFormats)[e];if(!i)throw new Error(`Unknown format "${e}"`);return i};function dO(e,t,n,i){var r,o;(r=(o=e.opts.code).formats)!==null&&r!==void 0||(o.formats=(0,vw._)`require("ajv-formats/dist/formats").${i}`);for(let a of t)e.addFormat(a,n[a])}pO.exports=Xl=yw;Object.defineProperty(Xl,"__esModule",{value:!0});Xl.default=yw});var WO=ne(Lw=>{"use strict";var JO=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,DV=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,GO=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,CV=/\\([\u000b\u0020-\u00ff])/g,AV=/([\\"])/g,KO=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;Lw.format=NV;Lw.parse=MV;function NV(e){if(!e||typeof e!="object")throw new TypeError("argument obj is required");var t=e.parameters,n=e.type;if(!n||!KO.test(n))throw new TypeError("invalid type");var i=n;if(t&&typeof t=="object")for(var r,o=Object.keys(t).sort(),a=0;a<o.length;a++){if(r=o[a],!GO.test(r))throw new TypeError("invalid parameter name");i+="; "+r+"="+UV(t[r])}return i}function MV(e){if(!e)throw new TypeError("argument string is required");var t=typeof e=="object"?LV(e):e;if(typeof t!="string")throw new TypeError("argument string is required to be a string");var n=t.indexOf(";"),i=n!==-1?t.slice(0,n).trim():t.trim();if(!KO.test(i))throw new TypeError("invalid media type");var r=new ZV(i.toLowerCase());if(n!==-1){var o,a,s;for(JO.lastIndex=n;a=JO.exec(t);){if(a.index!==n)throw new TypeError("invalid parameter format");n+=a[0].length,o=a[1].toLowerCase(),s=a[2],s.charCodeAt(0)===34&&(s=s.slice(1,-1),s.indexOf("\\")!==-1&&(s=s.replace(CV,"$1"))),r.parameters[o]=s}if(n!==t.length)throw new TypeError("invalid parameter format")}return r}function LV(e){var t;if(typeof e.getHeader=="function"?t=e.getHeader("content-type"):typeof e.headers=="object"&&(t=e.headers&&e.headers["content-type"]),typeof t!="string")throw new TypeError("content-type header is missing from object");return t}function UV(e){var t=String(e);if(GO.test(t))return t;if(t.length>0&&!DV.test(t))throw new TypeError("invalid parameter value");return'"'+t.replace(AV,"\\$1")+'"'}function ZV(e){this.parameters=Object.create(null),this.type=e}});var u9={};hn(u9,{activate:()=>l9});module.exports=Fj(u9);var Ot=class Xk{constructor(t,n,i){this.handle=t,this.dataModel=n,this.objectRegistry=i}get parent(){let t=this.dataModel.getObjectCanonicalParent(this.handle);return t?this.objectRegistry.getObjectFromHandle(t,Xk):null}},ti=(e,t,...n)=>new Promise((i,r)=>{e.withinTransaction(()=>t(...n,i,r))}),St=(e,t,n,i,...r)=>new Promise((o,a)=>{e.withinTransaction(()=>i(...r,s=>o(t.getObjectFromHandle(s,n)),a))}),Ir=class extends Ot{static className="Clip";get name(){return this.dataModel.clipGetName(this.handle)}set name(e){this.dataModel.withinTransaction(()=>{this.dataModel.clipSetName(this.handle,e)})}get startTime(){return this.dataModel.clipGetStartTime(this.handle)}get endTime(){return this.dataModel.clipGetEndTime(this.handle)}get duration(){return this.dataModel.clipGetEndTime(this.handle)-this.dataModel.clipGetStartTime(this.handle)}get startMarker(){return this.dataModel.clipGetStartMarker(this.handle)}get endMarker(){return this.dataModel.clipGetEndMarker(this.handle)}get looping(){return this.dataModel.clipGetLooping(this.handle)}set looping(e){this.dataModel.withinTransaction(()=>{this.dataModel.clipSetLooping(this.handle,e)})}get loopStart(){return this.dataModel.clipGetLoopStart(this.handle)}get loopEnd(){return this.dataModel.clipGetLoopEnd(this.handle)}get color(){return Number(this.dataModel.clipGetColor(this.handle))}set color(e){this.dataModel.withinTransaction(()=>{this.dataModel.clipSetColor(this.handle,BigInt(e))})}get muted(){return this.dataModel.clipGetMuted(this.handle)}set muted(e){this.dataModel.withinTransaction(()=>{this.dataModel.clipSetMuted(this.handle,e)})}},Ht=class extends Ir{static className="AudioClip";get filePath(){return this.dataModel.audioclipGetFilePath(this.handle)}get warping(){return this.dataModel.audioclipGetWarping(this.handle)}set warping(e){this.dataModel.withinTransaction(()=>{this.dataModel.audioclipSetWarping(this.handle,e)})}get warpMode(){return this.dataModel.audioclipGetWarpMode(this.handle)}set warpMode(e){this.dataModel.withinTransaction(()=>{this.dataModel.audioclipSetWarpMode(this.handle,e)})}get warpMarkers(){return this.dataModel.audioclipGetWarpMarkers(this.handle)}},Jt=class extends Ir{static className="MidiClip";get notes(){return this.dataModel.midiclipGetNotes(this.handle)}set notes(e){this.dataModel.withinTransaction(()=>{this.dataModel.midiclipSetNotes(this.handle,e)})}},It=class extends Ot{static className="ClipSlot";get clip(){let e=this.dataModel.clipslotGetClip(this.handle);return e?this.objectRegistry.getObjectFromHandle(e,Ir):null}deleteClip(){return ti(this.dataModel,this.dataModel.clipslotDeleteClip,this.handle)}createMidiClip(e){return St(this.dataModel,this.objectRegistry,Jt,this.dataModel.clipslotCreateMidiClip,this.handle,e)}createAudioClip(e){return St(this.dataModel,this.objectRegistry,Ht,this.dataModel.clipslotCreateAudioClip,this.handle,{filePath:e.filePath,isWarped:e.isWarped,loopSettings:e.loopSettings})}},Ar=class extends Ot{static className="DeviceParameter";get name(){return this.dataModel.deviceParameterGetName(this.handle)}get min(){return this.dataModel.deviceParameterGetInternalMin(this.handle)}get max(){return this.dataModel.deviceParameterGetInternalMax(this.handle)}get isQuantized(){return this.dataModel.deviceParameterGetIsQuantized(this.handle)}get defaultValue(){return this.dataModel.deviceParameterGetDefaultValue(this.handle)}get valueItems(){return this.dataModel.deviceParameterGetValueItems(this.handle)}getValue(){return new Promise(e=>{this.dataModel.deviceParameterGetInternalValue(this.handle,e)})}setValue(e){return new Promise((t,n)=>{this.dataModel.withinTransaction(()=>{this.dataModel.deviceParameterSetInternalValue(this.handle,e,t,i=>n(new Error(i)))})})}},Ct=class extends Ot{static className="Device";get name(){return this.dataModel.deviceGetName(this.handle)}get parameters(){return this.dataModel.deviceGetParameters(this.handle).map(e=>this.objectRegistry.getObjectFromHandle(e,Ar))}},mr=class extends Ot{static className="TakeLane";get clips(){return this.dataModel.takelaneGetClips(this.handle).map(e=>this.objectRegistry.getObjectFromHandle(e,Ir))}get name(){return this.dataModel.takelaneGetName(this.handle)}set name(e){this.dataModel.withinTransaction(()=>{this.dataModel.takelaneSetName(this.handle,e)})}createMidiClip(e,t){return St(this.dataModel,this.objectRegistry,Jt,this.dataModel.takelaneCreateMidiClip,this.handle,e,t)}createAudioClip(e){return St(this.dataModel,this.objectRegistry,Ht,this.dataModel.takelaneCreateAudioClip,this.handle,{duration:e.duration,filePath:e.filePath,isWarped:e.isWarped,loopSettings:e.loopSettings,startTime:e.startTime})}},Co=class extends Ot{static className="MixerDevice";get volume(){return this.objectRegistry.getObjectFromHandle(this.dataModel.mixerdeviceGetVolume(this.handle),Ar)}get panning(){return this.objectRegistry.getObjectFromHandle(this.dataModel.mixerdeviceGetPanning(this.handle),Ar)}get sends(){return this.dataModel.mixerdeviceGetSends(this.handle).map(e=>this.objectRegistry.getObjectFromHandle(e,Ar))}},Ue=class Yk extends Ot{static className="Track";get name(){return this.dataModel.trackGetName(this.handle)}set name(t){this.dataModel.withinTransaction(()=>{this.dataModel.trackSetName(this.handle,t)})}get mute(){return this.dataModel.trackGetMute(this.handle)}set mute(t){this.dataModel.withinTransaction(()=>{this.dataModel.trackSetMute(this.handle,t)})}get solo(){return this.dataModel.trackGetSolo(this.handle)}set solo(t){this.dataModel.withinTransaction(()=>{this.dataModel.trackSetSolo(this.handle,t)})}get mutedViaSolo(){return this.dataModel.trackGetMutedViaSolo(this.handle)}get arm(){return this.dataModel.trackGetArm(this.handle)}set arm(t){this.dataModel.withinTransaction(()=>{this.dataModel.trackSetArm(this.handle,t)})}get clipSlots(){return this.dataModel.trackGetClipSlots(this.handle).map(t=>this.objectRegistry.getObjectFromHandle(t,It))}get takeLanes(){return this.dataModel.trackGetTakeLanes(this.handle).map(t=>this.objectRegistry.getObjectFromHandle(t,mr))}get arrangementClips(){return this.dataModel.trackGetArrangementClips(this.handle).map(t=>this.objectRegistry.getObjectFromHandle(t,Ir))}get groupTrack(){let t=this.dataModel.trackGetGroupTrack(this.handle);return t?this.objectRegistry.getObjectFromHandle(t,Yk):null}get devices(){return this.dataModel.trackGetDevices(this.handle).map(t=>this.objectRegistry.getObjectFromHandle(t,Ct))}get mixer(){return this.objectRegistry.getObjectFromHandle(this.dataModel.trackGetMixerDevice(this.handle),Co)}createTakeLane(){return St(this.dataModel,this.objectRegistry,mr,this.dataModel.trackCreateTakeLane,this.handle)}insertDevice(t,n){return St(this.dataModel,this.objectRegistry,Ct,this.dataModel.trackInsertDevice,this.handle,t,BigInt(n))}deleteDevice(t){return ti(this.dataModel,this.dataModel.trackDeleteDevice,this.handle,t.handle)}duplicateDevice(t){return St(this.dataModel,this.objectRegistry,Ct,this.dataModel.trackDuplicateDevice,this.handle,t.handle)}deleteClip(t){return ti(this.dataModel,this.dataModel.trackDeleteClip,this.handle,t.handle)}clearClipsInRange(t,n){return ti(this.dataModel,this.dataModel.trackClearClipsInRange,this.handle,t,n)}},Wr=class extends Ue{static className="AudioTrack";createAudioClip(e){return St(this.dataModel,this.objectRegistry,Ht,this.dataModel.trackCreateAudioClip,this.handle,{duration:e.duration,filePath:e.filePath,isWarped:e.isWarped,loopSettings:e.loopSettings,startTime:e.startTime})}},Ro=class extends Ot{static className="CuePoint";get time(){return this.dataModel.cuePointGetTime(this.handle)}get name(){return this.dataModel.cuePointGetName(this.handle)}set name(e){this.dataModel.withinTransaction(()=>{this.dataModel.cuePointSetName(this.handle,e)})}},Xr=class extends Ue{static className="MidiTrack";createMidiClip(e,t){return St(this.dataModel,this.objectRegistry,Jt,this.dataModel.trackCreateMidiClip,this.handle,e,t)}},ri=class extends Ot{static className="Scene";get name(){return this.dataModel.sceneGetName(this.handle)}set name(e){this.dataModel.withinTransaction(()=>{this.dataModel.sceneSetName(this.handle,e)})}get tempo(){return this.dataModel.sceneGetTempo(this.handle)}get signatureNumerator(){return this.dataModel.sceneGetSignatureNumerator(this.handle)}get signatureDenominator(){return this.dataModel.sceneGetSignatureDenominator(this.handle)}},Qk=class extends Ot{static className="Song";get tracks(){return this.dataModel.songGetTracks(this.handle).map(e=>this.objectRegistry.getObjectFromHandle(e,Ue))}get returnTracks(){return this.dataModel.songGetReturnTracks(this.handle).map(e=>this.objectRegistry.getObjectFromHandle(e,Ue))}get mainTrack(){return this.objectRegistry.getObjectFromHandle(this.dataModel.songGetMainTrack(this.handle),Ue)}get scenes(){return this.dataModel.songGetScenes(this.handle).map(e=>this.objectRegistry.getObjectFromHandle(e,ri))}get cuePoints(){return this.dataModel.songGetCuePoints(this.handle).map(e=>this.objectRegistry.getObjectFromHandle(e,Ro))}get tempo(){return this.dataModel.songGetTempo(this.handle)}set tempo(e){this.dataModel.withinTransaction(()=>{this.dataModel.songSetTempo(this.handle,e)})}get gridQuantization(){return this.dataModel.songGetGridQuantization(this.handle)}get gridIsTriplet(){return this.dataModel.songGetGridIsTriplet(this.handle)}get rootNote(){return Number(this.dataModel.songGetRootNote(this.handle))}get scaleName(){return this.dataModel.songGetScaleName(this.handle)}get scaleMode(){return this.dataModel.songGetScaleMode(this.handle)}get scaleIntervals(){return this.dataModel.songGetScaleIntervals(this.handle).map(Number)}createAudioTrack(){return St(this.dataModel,this.objectRegistry,Wr,this.dataModel.songCreateAudioTrack,this.handle)}createMidiTrack(){return St(this.dataModel,this.objectRegistry,Xr,this.dataModel.songCreateMidiTrack,this.handle)}createScene(e){return St(this.dataModel,this.objectRegistry,ri,this.dataModel.songCreateScene,this.handle,BigInt(e))}deleteTrack(e){return ti(this.dataModel,this.dataModel.songDeleteTrack,this.handle,e.handle)}deleteScene(e){return ti(this.dataModel,this.dataModel.songDeleteScene,this.handle,e.handle)}duplicateTrack(e){return St(this.dataModel,this.objectRegistry,Ue,this.dataModel.songDuplicateTrack,this.handle,e.handle)}duplicateScene(e){return St(this.dataModel,this.objectRegistry,ri,this.dataModel.songDuplicateScene,this.handle,e.handle)}createCuePoint(e){return St(this.dataModel,this.objectRegistry,Ro,this.dataModel.songCreateCuePoint,this.handle,e)}deleteCuePoint(e){return ti(this.dataModel,this.dataModel.songDeleteCuePoint,this.handle,e.handle)}},ex=class extends Ot{static className="Application";get song(){return this.objectRegistry.getObjectFromHandle(this.dataModel.rootGetSong(this.handle),Qk)}},Vj=class{module;constructor(e){this.module=e}registerCommand(e,t){this.module.registerCommand(e,t)}executeCommand(e,...t){this.module.executeCommand(e,...t)}},yu=class extends Ot{static className="ChainMixerDevice";get volume(){return this.objectRegistry.getObjectFromHandle(this.dataModel.chainmixerdeviceGetVolume(this.handle),Ar)}get panning(){return this.objectRegistry.getObjectFromHandle(this.dataModel.chainmixerdeviceGetPanning(this.handle),Ar)}get sends(){return this.dataModel.chainmixerdeviceGetSends(this.handle).map(e=>this.objectRegistry.getObjectFromHandle(e,Ar))}},xt=class extends Ot{static className="Chain";get devices(){return this.dataModel.chainGetDevices(this.handle).map(e=>this.objectRegistry.getObjectFromHandle(e,Ct))}get mixer(){return this.objectRegistry.getObjectFromHandle(this.dataModel.chainGetMixerDevice(this.handle),yu)}insertDevice(e,t){return St(this.dataModel,this.objectRegistry,Ct,this.dataModel.chainInsertDevice,this.handle,e,BigInt(t))}deleteDevice(e){return ti(this.dataModel,this.dataModel.chainDeleteDevice,this.handle,e.handle)}duplicateDevice(e){return St(this.dataModel,this.objectRegistry,Ct,this.dataModel.chainDuplicateDevice,this.handle,e.handle)}},Yr=class extends xt{static className="DrumChain";get receivingNote(){return Number(this.dataModel.drumchainGetReceivingNote(this.handle))}set receivingNote(e){this.dataModel.withinTransaction(()=>{this.dataModel.drumchainSetReceivingNote(this.handle,BigInt(e))})}},Gt=class extends Ct{static className="RackDevice";get chains(){return this.dataModel.rackdeviceGetChains(this.handle).map(e=>this.objectRegistry.getObjectFromHandle(e,xt))}insertChain(e){return St(this.dataModel,this.objectRegistry,xt,this.dataModel.rackdeviceInsertChain,this.handle,BigInt(e))}},ni=class extends Gt{static className="DrumRackDevice";get chains(){return this.dataModel.rackdeviceGetChains(this.handle).map(e=>this.objectRegistry.getObjectFromHandle(e,Yr))}},Do=class extends Ot{static className="Sample";get filePath(){return this.dataModel.sampleGetFilePath(this.handle)}},Tr=class extends Ct{static className="Simpler";get sample(){let e=this.dataModel.simplerGetSample(this.handle);return e?this.objectRegistry.getObjectFromHandle(e,Do):null}replaceSample(e){return St(this.dataModel,this.objectRegistry,Do,this.dataModel.simplerReplaceSample,this.handle,e)}},qj=[ex,Qk,Wr,Xr,Ue,Ht,Jt,Ir,It,mr,Tr,ni,Gt,Ct,Do,Yr,xt,ri,Ro,Ar,Co,yu],Bj=class{cache=new Map;dataModel;constructor(e){this.dataModel=e}getOrCreateObjectFromHandle(e){let t=this.cache.get(e.id);if(t)return t;let n=qj.find(r=>this.dataModel.getObjectIsOfClass(e,r.className));if(!n)throw new Error("Unknown object type");let i=new n(e,this.dataModel,this);return this.cache.set(e.id,i),i}getObjectFromHandle(e,t){let n=this.getOrCreateObjectFromHandle(e);if(!(n instanceof t))throw new Error("Object of incorrect type");return n}},Hj=class{module;constructor(e){this.module=e}get storageDirectory(){return this.module.storageDirectory}get tempDirectory(){return this.module.tempDirectory}get language(){return this.module.language}},Jj=class{module;constructor(e){this.module=e}renderPreFxAudio(e,t,n){return new Promise((i,r)=>{this.module.renderPreFxAudio(e.handle,{endTime:n,startTime:t},i,r)})}importIntoProject(e){return new Promise((t,n)=>{this.module.importIntoProject(e,t,n)})}},Wk=(e,t)=>typeof t=="number"?{progress:t,text:e}:{text:e},Gj=class{module;constructor(e){this.module=e}registerContextMenuAction(e,t,n){return new Promise(i=>{this.module.registerContextMenuAction(e,t,n,r=>{i(()=>new Promise(o=>{r(o)}))})})}showModalDialog(e,t,n){return new Promise((i,r)=>{this.module.showModalDialog(e,t,n,i,r)})}withinProgressDialog(e,t,n){let i=new AbortController;return new Promise((r,o)=>{this.module.showProgressDialog(Wk(e,t.progress),({update:a,close:s})=>{let c=(u,p)=>new Promise(h=>{a(Wk(u,p),h)}),l=()=>new Promise(u=>{s(u)});n(c,i.signal).finally(l).then(r).catch(o)},()=>{i.abort()})})}},tx=(e,t)=>{let{commands:n,dataModel:i,environment:r,resources:o,ui:a}=e.initializeExtensionHost({apiVersion:t}),s=new Bj(i);return{application:s.getObjectFromHandle(i.getRoot(),ex),commands:new Vj(n),environment:new Hj(r),getObjectFromHandle:s.getObjectFromHandle.bind(s),resources:new Jj(o),ui:new Gj(a),withinTransaction:i.withinTransaction.bind(i)}},rx=(function(e){return e[e.NoGrid=0]="NoGrid",e[e.EightBars=1]="EightBars",e[e.FourBars=2]="FourBars",e[e.TwoBars=3]="TwoBars",e[e.Bar=4]="Bar",e[e.Half=5]="Half",e[e.Quarter=6]="Quarter",e[e.Eighth=7]="Eighth",e[e.Sixteenth=8]="Sixteenth",e[e.ThirtySecond=9]="ThirtySecond",e})({}),_u=(function(e){return e[e.Beats=0]="Beats",e[e.Tones=1]="Tones",e[e.Texture=2]="Texture",e[e.Repitch=3]="Repitch",e[e.Complex=4]="Complex",e[e.ComplexPro=6]="ComplexPro",e})({});var sj=Sr(require("node:http"),1),Rt=Sr(require("node:fs"),1),Kr=Sr(require("node:path"),1);var y={};hn(y,{$brand:()=>mg,$input:()=>Av,$output:()=>Cv,INVALID:()=>ir,NEVER:()=>pg,TimePrecision:()=>qv,ZodAny:()=>r_,ZodArray:()=>a_,ZodBase64:()=>bm,ZodBase64URL:()=>$m,ZodBigInt:()=>Ea,ZodBigIntFormat:()=>xm,ZodBoolean:()=>Pa,ZodCIDRv4:()=>ym,ZodCIDRv6:()=>_m,ZodCUID:()=>dm,ZodCUID2:()=>pm,ZodCatch:()=>S_,ZodCodec:()=>Kc,ZodCompileAsyncError:()=>Qr,ZodCompileUnsupportedError:()=>Ce,ZodCreditCard:()=>Xy,ZodCustom:()=>Wc,ZodCustomStringFormat:()=>so,ZodDate:()=>qc,ZodDefault:()=>__,ZodDiscriminatedUnion:()=>c_,ZodE164:()=>wm,ZodEmail:()=>sm,ZodEmoji:()=>lm,ZodEnum:()=>Ia,ZodError:()=>KA,ZodExactOptional:()=>Tm,ZodFile:()=>h_,ZodFirstPartyTypeKind:()=>L_,ZodFunction:()=>C_,ZodGUID:()=>cm,ZodIBAN:()=>Yy,ZodIPv4:()=>gm,ZodIPv6:()=>vm,ZodISODate:()=>hi,ZodISODateTime:()=>fi,ZodISODuration:()=>vi,ZodISOTime:()=>gi,ZodInstanceOf:()=>M_,ZodIntersection:()=>l_,ZodIssueCode:()=>YA,ZodJWT:()=>km,ZodKSUID:()=>hm,ZodLazy:()=>j_,ZodLiteral:()=>f_,ZodMAC:()=>Wy,ZodMap:()=>p_,ZodNaN:()=>T_,ZodNanoID:()=>um,ZodNever:()=>i_,ZodNonOptional:()=>zm,ZodNull:()=>t_,ZodNullable:()=>y_,ZodNumber:()=>za,ZodNumberFormat:()=>co,ZodObject:()=>Bc,ZodOptional:()=>lo,ZodPipe:()=>Gc,ZodPrefault:()=>$_,ZodPreprocess:()=>z_,ZodPromise:()=>D_,ZodReadonly:()=>P_,ZodRealError:()=>yr,ZodRecord:()=>Sa,ZodSet:()=>m_,ZodString:()=>Ta,ZodStringFormat:()=>et,ZodSuccess:()=>x_,ZodSymbol:()=>Qy,ZodTemplateLiteral:()=>O_,ZodTransform:()=>g_,ZodTuple:()=>u_,ZodType:()=>Te,ZodULID:()=>mm,ZodURL:()=>Fc,ZodUUID:()=>bn,ZodUndefined:()=>e_,ZodUnion:()=>Hc,ZodUnknown:()=>n_,ZodVoid:()=>o_,ZodXID:()=>fm,ZodXor:()=>s_,_ZodString:()=>am,_default:()=>b_,_function:()=>HI,any:()=>TI,array:()=>je,base64:()=>sI,base64url:()=>cI,bigint:()=>wI,boolean:()=>$t,catch:()=>I_,check:()=>JI,cidrv4:()=>oI,cidrv6:()=>aI,clone:()=>Be,codec:()=>FI,coerce:()=>Z_,compile:()=>Uv,config:()=>vt,core:()=>tn,creditCard:()=>uI,cuid:()=>X0,cuid2:()=>Y0,currencyCode:()=>gI,custom:()=>Pm,date:()=>PI,decode:()=>Vy,decodeAsync:()=>By,deepPartial:()=>oT,describe:()=>GI,discriminatedUnion:()=>Jc,e164:()=>lI,email:()=>Z0,emoji:()=>K0,encode:()=>Fy,encodeAsync:()=>qy,endsWith:()=>fa,enum:()=>Lt,exactOptional:()=>v_,file:()=>MI,flattenError:()=>Gs,float32:()=>yI,float64:()=>_I,formatError:()=>Ks,fromJSONSchema:()=>nT,function:()=>HI,getDiscriminatedOption:()=>Ov,getErrorMap:()=>eN,globalRegistry:()=>Nt,gt:()=>yn,gte:()=>Er,guid:()=>F0,hash:()=>vI,hex:()=>hI,hostname:()=>fI,httpUrl:()=>G0,iban:()=>dI,includes:()=>pa,input:()=>sT,instanceof:()=>WI,int:()=>im,int32:()=>bI,int64:()=>kI,intersection:()=>Oa,invertCodec:()=>VI,ipv4:()=>rI,ipv6:()=>iI,iso:()=>uo,json:()=>YI,jwt:()=>pI,keyof:()=>EI,ksuid:()=>tI,lazy:()=>R_,length:()=>io,literal:()=>fe,locales:()=>aa,looseObject:()=>Mt,looseRecord:()=>DI,lowercase:()=>ua,lt:()=>vn,lte:()=>Pr,mac:()=>nI,map:()=>CI,maxLength:()=>no,maxSize:()=>li,memoizer:()=>pc,meta:()=>KI,mime:()=>ga,minLength:()=>An,minSize:()=>_n,multipleOf:()=>ci,nan:()=>ZI,nanoid:()=>W0,nativeEnum:()=>NI,negative:()=>Zp,never:()=>Sm,nonnegative:()=>Vp,nonoptional:()=>k_,nonpositive:()=>Fp,normalize:()=>va,null:()=>Vc,nullable:()=>Zc,nullish:()=>LI,number:()=>He,object:()=>ie,optional:()=>Qe,output:()=>cT,overwrite:()=>en,parse:()=>My,parseAsync:()=>Ly,partialRecord:()=>RI,pipe:()=>om,positive:()=>Up,prefault:()=>w_,preprocess:()=>Xc,prettifyError:()=>yg,promise:()=>BI,properties:()=>ha,property:()=>qp,readonly:()=>E_,record:()=>tt,refine:()=>A_,regex:()=>la,regexes:()=>zr,registry:()=>mp,safeDecode:()=>Jy,safeDecodeAsync:()=>Ky,safeEncode:()=>Hy,safeEncodeAsync:()=>Gy,safeParse:()=>Uy,safeParseAsync:()=>Zy,set:()=>AI,setErrorMap:()=>QA,size:()=>ro,slugify:()=>$a,startsWith:()=>ma,strictObject:()=>OI,string:()=>C,stringFormat:()=>mI,stringbool:()=>XI,success:()=>UI,superRefine:()=>N_,symbol:()=>SI,templateLiteral:()=>qI,toJSONSchema:()=>oo,toLowerCase:()=>_a,toUpperCase:()=>ba,toZod:()=>Ls,transform:()=>Im,treeifyError:()=>vg,trim:()=>ya,tuple:()=>d_,uint32:()=>$I,uint64:()=>xI,ulid:()=>Q0,undefined:()=>II,union:()=>Xe,unknown:()=>it,uppercase:()=>da,url:()=>J0,util:()=>L,uuid:()=>V0,uuidv4:()=>q0,uuidv6:()=>B0,uuidv7:()=>H0,validate:()=>Wo,validateAsync:()=>Xo,void:()=>zI,withParser:()=>fp,xid:()=>eI,xor:()=>jI});var tn={};hn(tn,{$ZodAny:()=>Td,$ZodArray:()=>jd,$ZodAsyncError:()=>gr,$ZodBase64:()=>dd,$ZodBase64URL:()=>md,$ZodBigInt:()=>ac,$ZodBigIntFormat:()=>kd,$ZodBoolean:()=>ea,$ZodCIDRv4:()=>sd,$ZodCIDRv6:()=>ld,$ZodCUID:()=>Qu,$ZodCUID2:()=>ed,$ZodCatch:()=>Wd,$ZodCheck:()=>Ye,$ZodCheckBigIntFormat:()=>iv,$ZodCheckEndsWith:()=>gv,$ZodCheckGreaterThan:()=>Mu,$ZodCheckIncludes:()=>fv,$ZodCheckLengthEquals:()=>uv,$ZodCheckLessThan:()=>Nu,$ZodCheckLowerCase:()=>pv,$ZodCheckMaxLength:()=>cv,$ZodCheckMaxSize:()=>ov,$ZodCheckMimeType:()=>_v,$ZodCheckMinLength:()=>lv,$ZodCheckMinSize:()=>av,$ZodCheckMultipleOf:()=>rv,$ZodCheckNumberFormat:()=>nv,$ZodCheckOverwrite:()=>bv,$ZodCheckProperties:()=>yv,$ZodCheckProperty:()=>vv,$ZodCheckRegex:()=>dv,$ZodCheckSizeEquals:()=>sv,$ZodCheckStartsWith:()=>hv,$ZodCheckStringFormat:()=>Yo,$ZodCheckUpperCase:()=>mv,$ZodCodec:()=>ra,$ZodCreditCard:()=>gd,$ZodCustom:()=>rp,$ZodCustomStringFormat:()=>$d,$ZodCyclicError:()=>ap,$ZodDate:()=>Od,$ZodDefault:()=>Hd,$ZodDiscriminatedUnion:()=>Cd,$ZodE164:()=>fd,$ZodEmail:()=>Hu,$ZodEmoji:()=>Xu,$ZodEncodeError:()=>oi,$ZodEnum:()=>Ud,$ZodError:()=>gg,$ZodExactOptional:()=>qd,$ZodFile:()=>Fd,$ZodFunction:()=>ep,$ZodGUID:()=>qu,$ZodIBAN:()=>yd,$ZodIPv4:()=>id,$ZodIPv6:()=>od,$ZodISODate:()=>Iv,$ZodISODateTime:()=>Sv,$ZodISODuration:()=>zv,$ZodISOTime:()=>Tv,$ZodIntersection:()=>Ad,$ZodJWT:()=>bd,$ZodKSUID:()=>nd,$ZodLazy:()=>na,$ZodLiteral:()=>Zd,$ZodMAC:()=>ad,$ZodMap:()=>Md,$ZodNaN:()=>Xd,$ZodNanoID:()=>Yu,$ZodNever:()=>Pd,$ZodNonOptional:()=>Gd,$ZodNull:()=>Id,$ZodNullable:()=>Bd,$ZodNumber:()=>oc,$ZodNumberFormat:()=>wd,$ZodObject:()=>Rd,$ZodObjectJIT:()=>Ev,$ZodOptional:()=>cc,$ZodPipe:()=>lc,$ZodPrefault:()=>Jd,$ZodPreprocess:()=>jv,$ZodPromise:()=>tp,$ZodReadonly:()=>Yd,$ZodRealError:()=>vr,$ZodRecord:()=>Nd,$ZodRegistry:()=>pp,$ZodSet:()=>Ld,$ZodString:()=>ai,$ZodStringFormat:()=>Ge,$ZodSuccess:()=>Kd,$ZodSymbol:()=>xd,$ZodTemplateLiteral:()=>Qd,$ZodTransform:()=>Vd,$ZodTuple:()=>sc,$ZodType:()=>xe,$ZodULID:()=>td,$ZodURL:()=>Wu,$ZodUUID:()=>Bu,$ZodUndefined:()=>Sd,$ZodUnion:()=>ta,$ZodUnknown:()=>zd,$ZodVoid:()=>Ed,$ZodXID:()=>rd,$ZodXor:()=>Dd,$brand:()=>mg,$constructor:()=>E,$input:()=>Av,$output:()=>Cv,Doc:()=>Yi,INVALID:()=>ir,JSONSchema:()=>M0,JSONSchemaGenerator:()=>tm,NEVER:()=>pg,TimePrecision:()=>qv,URL_BAD_FORMAT:()=>kv,URL_UNPARSEABLE:()=>ec,ZodCompileAsyncError:()=>Qr,ZodCompileUnsupportedError:()=>Ce,_any:()=>Dp,_array:()=>Kv,_base64:()=>Oc,_base64url:()=>jc,_bigint:()=>zp,_boolean:()=>Tp,_catch:()=>NA,_check:()=>w0,_cidrv4:()=>Pc,_cidrv6:()=>Ec,_coercedBigint:()=>Jv,_coercedBoolean:()=>Hv,_coercedDate:()=>Gv,_coercedNumber:()=>Bv,_coercedString:()=>Vv,_creditCard:()=>_p,_cuid:()=>wc,_cuid2:()=>kc,_custom:()=>Hp,_date:()=>Mp,_decode:()=>Iu,_decodeAsync:()=>zu,_default:()=>DA,_discriminatedUnion:()=>wA,_e164:()=>Rc,_email:()=>fc,_emoji:()=>bc,_encode:()=>Su,_encodeAsync:()=>Tu,_endsWith:()=>fa,_enum:()=>zA,_file:()=>Bp,_float32:()=>kp,_float64:()=>xp,_gt:()=>yn,_gte:()=>Er,_guid:()=>hc,_iban:()=>bp,_includes:()=>pa,_int:()=>wp,_int32:()=>Sp,_int64:()=>Pp,_intersection:()=>kA,_ipv4:()=>Tc,_ipv6:()=>zc,_isoDate:()=>Ac,_isoDateTime:()=>Cc,_isoDuration:()=>Mc,_isoTime:()=>Nc,_jwt:()=>Dc,_ksuid:()=>Ic,_lazy:()=>ZA,_length:()=>io,_literal:()=>EA,_lowercase:()=>ua,_lt:()=>vn,_lte:()=>Pr,_mac:()=>yp,_map:()=>IA,_max:()=>Pr,_maxLength:()=>no,_maxSize:()=>li,_mime:()=>ga,_min:()=>Er,_minLength:()=>An,_minSize:()=>_n,_multipleOf:()=>ci,_nan:()=>Lp,_nanoid:()=>$c,_nativeEnum:()=>PA,_negative:()=>Zp,_never:()=>Ap,_nonnegative:()=>Vp,_nonoptional:()=>CA,_nonpositive:()=>Fp,_normalize:()=>va,_null:()=>Rp,_nullable:()=>RA,_number:()=>$p,_optional:()=>jA,_overwrite:()=>en,_parse:()=>qo,_parseAsync:()=>Bo,_pipe:()=>MA,_positive:()=>Up,_promise:()=>FA,_properties:()=>ha,_property:()=>qp,_readonly:()=>LA,_record:()=>SA,_refine:()=>Jp,_regex:()=>la,_safeDecode:()=>Eu,_safeDecodeAsync:()=>ju,_safeEncode:()=>Pu,_safeEncodeAsync:()=>Ou,_safeParse:()=>Ho,_safeParseAsync:()=>Go,_set:()=>TA,_size:()=>ro,_slugify:()=>$a,_startsWith:()=>ma,_string:()=>vp,_stringFormat:()=>ui,_stringbool:()=>Xp,_success:()=>AA,_superRefine:()=>Gp,_symbol:()=>Op,_templateLiteral:()=>UA,_toLowerCase:()=>_a,_toUpperCase:()=>ba,_transform:()=>OA,_trim:()=>ya,_tuple:()=>xA,_uint32:()=>Ip,_uint64:()=>Ep,_ulid:()=>xc,_undefined:()=>jp,_union:()=>bA,_unknown:()=>Cp,_uppercase:()=>da,_url:()=>ca,_uuid:()=>gc,_uuidv4:()=>vc,_uuidv6:()=>yc,_uuidv7:()=>_c,_void:()=>Np,_xid:()=>Sc,_xor:()=>$A,base64Charset:()=>ud,base64urlCharset:()=>ic,canParseURL:()=>xv,clone:()=>Be,compile:()=>Uv,compileFn:()=>hp,config:()=>vt,createStandardJSONSchemaMethod:()=>wa,createToJSONSchemaMethod:()=>Xv,decode:()=>kx,decodeAsync:()=>Sx,describe:()=>Kp,encode:()=>wx,encodeAsync:()=>xx,extractDefs:()=>pi,finalize:()=>mi,flattenError:()=>Gs,formatError:()=>Ks,getDiscriminatedOption:()=>Ov,globalConfig:()=>jt,globalRegistry:()=>Nt,handleUnrepresentable:()=>Tt,initializeContext:()=>di,isBackEdge:()=>cp,isRecursiveSchema:()=>sp,isValidBase64:()=>nc,isValidBase64URL:()=>pd,isValidCIDRv6:()=>cd,isValidCreditCard:()=>hd,isValidIBAN:()=>vd,isValidIPv6:()=>rc,isValidJWT:()=>_d,locales:()=>aa,memoizer:()=>pc,mergeValues:()=>Qo,meta:()=>Wp,parse:()=>Ki,parseAsync:()=>Wi,parseURLObject:()=>Kx,prettifyError:()=>yg,process:()=>We,processSchema:()=>We,regexes:()=>zr,registry:()=>mp,safeDecode:()=>Tx,safeDecodeAsync:()=>Px,safeEncode:()=>Ix,safeEncodeAsync:()=>zx,safeParse:()=>Jo,safeParseAsync:()=>Ko,standardProps:()=>Vu,stripTabAndNewline:()=>tc,toDotPath:()=>bx,toJSONSchema:()=>oo,toZod:()=>Ls,treeifyError:()=>vg,urlHostnameOk:()=>Gu,urlProtocolOk:()=>Ku,util:()=>L,validate:()=>Wo,validateAsync:()=>Xo,validateURL:()=>Ju,version:()=>$v,withParser:()=>fp});var L={};hn(L,{BIGINT_FORMAT_RANGES:()=>Vs,CONSTANT_CATCH:()=>ku,Class:()=>tg,NUMBER_FORMAT_RANGES:()=>Fs,aborted:()=>nr,allowsEval:()=>ig,assert:()=>Qj,assertEqual:()=>Kj,assertIs:()=>Xj,assertNever:()=>Yj,assertNotEqual:()=>Wj,assignProp:()=>At,attachSchema:()=>qs,base64ToUint8Array:()=>fx,base64urlToUint8Array:()=>dR,cached:()=>Lo,captureStackTrace:()=>$u,cleanEnum:()=>uR,cleanRegex:()=>Dn,clone:()=>Be,cloneDef:()=>rR,codePointLength:()=>Gi,constantCatch:()=>ug,createTransparentProxy:()=>cR,defineLazy:()=>rg,defineLazyInternal:()=>Pe,derived:()=>hR,esc:()=>rr,escapeRegex:()=>Lr,explicitlyAborted:()=>sg,extend:()=>cx,finalizeIssue:()=>hr,floatSafeRemainder:()=>Us,getElementAtPath:()=>nR,getEnumValues:()=>No,getLengthableOrigin:()=>Hs,getParsedType:()=>sR,getSizableOrigin:()=>Bs,hexToUint8Array:()=>mR,hide:()=>Js,installLazyProp:()=>lg,isObject:()=>Ji,isPlainObject:()=>Mr,issue:()=>Vo,joinValues:()=>O,jsonStringifyReplacer:()=>Mo,members:()=>cg,merge:()=>dx,mergeDefs:()=>Nr,normalizeParams:()=>J,nullish:()=>bu,numKeys:()=>aR,objectClone:()=>eR,omit:()=>sx,optionalKeys:()=>ag,own:()=>gn,parsedType:()=>Z,partial:()=>px,pick:()=>ax,prefixIssues:()=>fr,primitiveTypes:()=>og,promiseAllObject:()=>iR,propertyKeyTypes:()=>Zs,randomString:()=>oR,rawShape:()=>Uo,required:()=>mx,safeExtend:()=>ux,shallowClone:()=>Zo,sizeCaps:()=>Fo,slugify:()=>ng,stringifyPrimitive:()=>U,toZod:()=>Ls,uint8ArrayToBase64:()=>hx,uint8ArrayToBase64url:()=>pR,uint8ArrayToHex:()=>fR,unwrapMessage:()=>Ao});function Kj(e){return e}function Wj(e){return e}function Ls(){return e=>e}function Xj(e){}function Yj(e){throw new Error("Unexpected value in exhaustive check")}function Qj(e){}function No(e){let t=Object.values(e).filter(i=>typeof i=="number");return Object.entries(e).filter(([i,r])=>t.indexOf(+i)===-1).map(([i,r])=>r)}function O(e,t="|"){return e.map(n=>U(n)).join(t)}function Mo(e,t){return typeof t=="bigint"?t.toString():t}var eg=class{constructor(t){this._getter=t,this._value=void 0}get value(){let t=this._getter;return t!==void 0&&(this._value=t(),this._getter=void 0),this._value}};function Lo(e){return new eg(e)}function bu(e){return e==null}function Dn(e){let t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function Us(e,t){let n=e/t,i=Math.round(n),r=4*Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-i)<r?0:n-i}var nx=Symbol("evaluating");function rg(e,t,n){let i;Object.defineProperty(e,t,{get(){if(i!==nx)return i===void 0&&(i=nx,i=n()),i},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function eR(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function At(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Uo(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function Rn(e){return Uo(e._zod.def)??e._zod.def.shape}function ix(e,t,n){Object.defineProperty(e,t,{get(){let i=n();return At(this,t,i),i},enumerable:!0,configurable:!0})}function ox(e,t,n){t in e?At(e,t,n):e[t]=n}function Hi(e,t,n,i){let r=Rn(t);for(let o of n){let a=Object.getOwnPropertyDescriptor(r,o);a.enumerable&&(a.get?ix(e,o,()=>{let s=t._zod.def.shape[o];return i?i(s,o):s}):ox(e,o,i?i(a.value,o):a.value))}}function tR(e,t){for(let n of Reflect.ownKeys(t)){let i=Object.getOwnPropertyDescriptor(t,n);i.enumerable&&(i.get?ix(e,n,()=>t[n]):ox(e,n,i.value))}}function Nr(...e){let t={};for(let n of e){let i=Object.getOwnPropertyDescriptors(n);Object.assign(t,i)}return Object.defineProperties({},t)}function rR(e){return Nr(e._zod.def)}function nR(e,t){return t?t.reduce((n,i)=>n?.[i],e):e}function iR(e){let t=Object.keys(e),n=t.map(i=>e[i]);return Promise.all(n).then(i=>{let r={};for(let o=0;o<t.length;o++)r[t[o]]=i[o];return r})}function oR(e=10){let t="abcdefghijklmnopqrstuvwxyz",n="";for(let i=0;i<e;i++)n+=t[Math.floor(Math.random()*t.length)];return n}function rr(e){return JSON.stringify(e)}function ng(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var $u="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Ji(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var ig=Lo(()=>{if(jt.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Mr(e){if(Ji(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let n=t.prototype;return!(Ji(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function Zo(e){return Mr(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function aR(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}var sR=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},Zs=new Set(["string","number","symbol"]),og=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Lr(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Be(e,t,n){let i=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(i._zod.parent=e),i}function J(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function cR(e){let t;return new Proxy({},{get(n,i,r){return t??(t=e()),Reflect.get(t,i,r)},set(n,i,r,o){return t??(t=e()),Reflect.set(t,i,r,o)},has(n,i){return t??(t=e()),Reflect.has(t,i)},deleteProperty(n,i){return t??(t=e()),Reflect.deleteProperty(t,i)},ownKeys(n){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,i){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,i)},defineProperty(n,i,r){return t??(t=e()),Reflect.defineProperty(t,i,r)}})}function U(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function ag(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var Fs={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]},Vs={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function ax(e,t){let n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let o={};return Hi(o,e,wu(e,t)),Be(e,Nr(n,{shape:o,checks:[]}))}function wu(e,t){let n=Rn(e),i=[];for(let r of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,r)?.enumerable)throw new Error(`Unrecognized key: "${String(r)}"`);t[r]&&i.push(r)}return i}function sx(e,t){let n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let o=new Set(wu(e,t)),a={};return Hi(a,e,Reflect.ownKeys(Rn(e)).filter(s=>!o.has(s))),Be(e,Nr(n,{shape:a,checks:[]}))}function cx(e,t){if(!Mr(t))throw new Error("Invalid input to extend: expected a plain object");let n=e._zod.def.checks;if(n&&n.length>0){let r=Rn(e);for(let o of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(r,o)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return Be(e,Nr(e._zod.def,{shape:lx(e,t)}))}function lx(e,t){let n={};return Hi(n,e,Reflect.ownKeys(Rn(e))),tR(n,t),n}function ux(e,t){if(!Mr(t))throw new Error("Invalid input to safeExtend: expected a plain object");return Be(e,Nr(e._zod.def,{shape:lx(e,t)}))}function dx(e,t){if(!t?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let n={};Hi(n,e,Reflect.ownKeys(Rn(e))),Hi(n,t,Reflect.ownKeys(Rn(t)));let i=Nr(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return Be(e,i)}function px(e,t,n,i="partial"){let o=t._zod.def.checks;if(o&&o.length>0)throw new Error(`.${i}() cannot be used on object schemas containing refinements`);let s=n?new Set(wu(t,n)):void 0,c={};return Hi(c,t,Reflect.ownKeys(Rn(t)),e&&((l,u)=>s&&!s.has(u)?l:new e({type:"optional",innerType:l}))),Be(t,Nr(t._zod.def,{shape:c,checks:[]}))}function mx(e,t,n){let i=n?new Set(wu(t,n)):void 0,r={};return Hi(r,t,Reflect.ownKeys(Rn(t)),(o,a)=>i&&!i.has(a)?o:new e({type:"nonoptional",innerType:o})),Be(t,Nr(t._zod.def,{shape:r}))}function nr(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function sg(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function fr(e,t){return t.map(n=>{var i;return(i=n).path??(i.path=[]),n.path.unshift(e),n})}function Ao(e){return typeof e=="string"?e:e?.message}function Fo(e){let t=[];for(let n of e??[]){let i=n._zod.def;if(!/_(length|size)$|_equals$/.test(i.check))break;let r=i.maximum??i.length??i.size;r>=0&&t.push([r,n])}return t}function qs(e,t,n){var i;for(let r=t;r<e.length;r++)(i=e[r]).schema??(i.schema=n)}function hr(e,t,n){var i;let r=e.inst?._zod?.traits;r?.has("$ZodType")&&(r.has("$ZodCheck")?(i=e).schema??(i.schema=e.inst):e.schema=e.inst);let o=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,a=e.message?e.message:Ao(e.inst?._zod.def?.error?.(e))??Ao(o?.(e))??Ao(t?.error?.(e))??Ao(n.customError?.(e))??Ao(n.localeError?.(e))??"Invalid input",s={};for(let c of Object.keys(e))c==="inst"||c==="schema"||c==="continue"||c==="input"||c==="__proto__"||(s[c]=e[c]);return s.path??(s.path=[]),s.message=a,t?.reportInput&&(s.input=e.input),s}function Bs(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}var lR=/[\uD800-\uDBFF]/;function Gi(e){let t=e.length;if(!lR.test(e))return t;let n=t;for(let i=0;i<t-1;i++)(e.charCodeAt(i)&64512)===55296&&(e.charCodeAt(i+1)&64512)===56320&&(n--,i++);return n}function Hs(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Z(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let n=e;if(n&&Object.getPrototypeOf(n)!==Object.prototype&&"constructor"in n&&n.constructor)return n.constructor.name}}return t}function Vo(...e){let[t,n,i]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:i}:{...t}}function uR(e){return Object.entries(e).filter(([t,n])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function fx(e){let t=atob(e),n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=t.charCodeAt(i);return n}function hx(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function dR(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-t.length%4)%4);return fx(t+n)}function pR(e){return hx(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function mR(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let n=new Uint8Array(t.length/2);for(let i=0;i<t.length;i+=2)n[i/2]=Number.parseInt(t.slice(i,i+2),16);return n}function fR(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var tg=class{constructor(...t){}};function cg(e,t){for(let n in t){let i=Object.getOwnPropertyDescriptor(t,n);i.get?Object.defineProperty(e,n,{...i,enumerable:!1}):gR(e,n,i.value)}}function gn(e,t,n,i=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:i,value:n}),n}function Js(e,t,n){return gn(e,t,n,!1)}function hR(e,t){for(let n in e){let i=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return gn(this,n,i(this))},set(r){gn(this,n,r)}})}return t}function gR(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:gn(this,t,n.bind(this))},set(i){gn(this,t,i)}})}function vR(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}var Qh,ii=!1,yR={configurable:!0,get(){ii=!0}};function Pe(e,t,n){let i=Object.getPrototypeOf(e._zod);if(t in i&&Qh!==e._zod){Qh=void 0;return}Qh=e._zod,Object.defineProperty(i,t,{configurable:!0,get(){Object.defineProperty(this,t,yR);let r=ii;ii=!1;try{let o=n(this);return ii?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:o}),ii=ii||r,o}catch(o){throw delete this[t],ii=ii||r,o}},set(r){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r})}})}function lg(e,t,n,i){let r=vR(e,t);r&&Object.defineProperty(r,t,{configurable:!0,get(){let o={configurable:!0,writable:!0,enumerable:i,value:void 0};return Object.defineProperty(this,t,o),o.value=n(this),Object.defineProperty(this,t,o),o.value},set(o){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:i,value:o})}})}var ku="~constantCatch";function ug(e){let t=()=>e;return t[ku]=!0,t}var gx,pg=Object.freeze({status:"aborted"}),dg={value:void 0,enumerable:!1},vx="captureStackTrace"in Error?Error:null;function _R(e){let t=vx;if(t){let n=t.stackTraceLimit;if(typeof n=="number"){try{t.stackTraceLimit=0}catch{return vx=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function E(e,t,n,i){let r={};function o(h){this.def=h,this.constr=p,this.traits=new Set}o.prototype=r;let a=n,s=a&&new WeakSet;function c(h,g){if(h._zod){if(h._zod.traits.has(e))return}else{dg.value=new o(g);try{Object.defineProperty(h,"_zod",dg)}finally{dg.value=void 0}}if(h._zod.traits.add(e),t(h,g),s){let k=Object.getPrototypeOf(h),T=h._zod.constr.prototype,z=k;for(;z&&z!==T;)z=Object.getPrototypeOf(z);let S=z??k;s.has(S)||(s.add(S),cg(S,a))}let _=p.prototype;for(let k in _)Object.prototype.hasOwnProperty.call(_,k)&&(k in h||(h[k]=_[k].bind(h)))}let l=i?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function p(h){let g=i?.Parent?_R(u):this;c(g,h);let _=g._zod.deferred;if(_){for(let T of _)T();g._zod.deferred=void 0}let k=globalThis.__zod_globalConfig?.postProcessor;return k&&k(g),g}return Object.defineProperty(p,"init",{value:c}),Object.defineProperty(p,Symbol.hasInstance,{value:h=>i?.Parent&&h instanceof i.Parent?!0:h?._zod?.traits?.has(e)}),Object.defineProperty(p,"name",{value:e}),p}var mg=Symbol("zod_brand"),gr=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},oi=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(gx=globalThis).__zod_globalConfig??(gx.__zod_globalConfig={});var jt=globalThis.__zod_globalConfig;function vt(e){return e&&Object.assign(jt,e),jt}function bR(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,Mo,2)),e.message}function $R(e){this._zod.message=e}var wR={get:bR,set:$R,enumerable:!0,configurable:!0},hg={value:void 0,enumerable:!1},yx=new WeakSet([Object.prototype,Error.prototype]),_x=(e,t)=>{e.name="$ZodError",hg.value=t,Object.defineProperty(e,"issues",hg),hg.value=void 0,Object.defineProperty(e,"message",wR);let n=Object.getPrototypeOf(e);yx.has(n)||(yx.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let i=()=>this.message;return Object.defineProperty(this,"toString",{value:i,configurable:!0,writable:!0}),i},set(i){Object.defineProperty(this,"toString",{value:i,configurable:!0,writable:!0})}}))},gg=E("$ZodError",_x),vr=E("$ZodError",_x,void 0,{Parent:Error});function kR(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t==="__proto__"?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function Gs(e,t=n=>n.message){let n={},i=[];for(let r of e.issues)r.path.length>0?kR(n,r.path[0],()=>[]).push(t(r)):i.push(t(r));return{formErrors:i,fieldErrors:n}}function Ks(e,t=n=>n.message){let n={_errors:[]},i=(r,o=[])=>{for(let a of r.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(s=>i({issues:s},[...o,...a.path]));else if(a.code==="invalid_key")i({issues:a.issues},[...o,...a.path]);else if(a.code==="invalid_element")i({issues:a.issues},[...o,...a.path]);else{let s=[...o,...a.path];if(s.length===0)n._errors.push(t(a));else{let c=n,l=0;for(;l<s.length;){let u=s[l],p=l===s.length-1;if(u==="_errors"){p&&c._errors.push(t(a)),l++;continue}Object.prototype.hasOwnProperty.call(c,u)||Object.defineProperty(c,u,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let h=c[u];p&&h._errors.push(t(a)),c=h,l++}}}};return i(e),n}function vg(e,t=n=>n.message){let n={errors:[]},i=(r,o=[])=>{var a;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(t(s));continue}let l=n,u=0;for(;u<c.length;){let p=c[u],h=u===c.length-1;typeof p=="string"?(l.properties??(l.properties={}),Object.prototype.hasOwnProperty.call(l.properties,p)||Object.defineProperty(l.properties,p,{value:{errors:[]},enumerable:!0,writable:!0,configurable:!0}),l=l.properties[p]):(l.items??(l.items=[]),(a=l.items)[p]??(a[p]={errors:[]}),l=l.items[p]),h&&l.errors.push(t(s)),u++}}};return i(e),n}function bx(e){let t=[],n=e.map(i=>typeof i=="object"?i.key:i);for(let i of n)typeof i=="number"?t.push(`[${i}]`):typeof i=="symbol"?t.push(`[${JSON.stringify(String(i))}]`):/[^\w$]/.test(i)?t.push(`[${JSON.stringify(i)}]`):(t.length&&t.push("."),t.push(i));return t.join("")}function yg(e){let t=[],n=[...e.issues].sort((i,r)=>(i.path??[]).length-(r.path??[]).length);for(let i of n)t.push(`\u2716 ${i.message}`),i.path?.length&&t.push(` \u2192 at ${bx(i.path)}`);return t.join(`
|
|
31
|
+
`)}function xu(e,t){return{callee:t?.callee??e,Err:t?.Err}}var qo=e=>{let t=(n,i,r,o)=>{let a=r?{...r,async:!1}:{async:!1},s=n._zod.run({value:i,issues:[]},a);if(s instanceof Promise)throw new gr;if(s.issues.length){let c=new(o?.Err??e)(s.issues.map(l=>hr(l,a,vt())));throw $u(c,o?.callee??t),c}return s.value};return t},Ki=qo(vr),Bo=e=>{let t=async(n,i,r,o)=>{let a=r?{...r,async:!0}:{async:!0},s=n._zod.run({value:i,issues:[]},a);if(s instanceof Promise&&(s=await s),s.issues.length){let c=new(o?.Err??e)(s.issues.map(l=>hr(l,a,vt())));throw $u(c,o?.callee??t),c}return s.value};return t},Wi=Bo(vr),Ho=e=>(t,n,i)=>{let r=i?{...i,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},r);if(o instanceof Promise)throw new gr;return o.issues.length?$x(e,o.issues,r):{success:!0,data:o.value}},Jo=Ho(vr);function $x(e,t,n){let i;return{success:!1,get error(){return i||(i=new e(t.map(r=>hr(r,n,vt()))),t=void 0,n=void 0),i},set error(r){i=r,t=void 0,n=void 0}}}var Go=e=>async(t,n,i)=>{let r=i?{...i,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},r);return o instanceof Promise&&(o=await o),o.issues.length?$x(e,o.issues,r):{success:!0,data:o.value}},Ko=Go(vr),SR=Symbol.for("zod.compile.invalid"),IR=Symbol.for("zod.compile.fallback"),Wo=((e,t,n)=>{let i=e._zod.bag.validator;if(i!==void 0){if(i(t)!==SR)return!0;if(i.definite===!0&&n===void 0)return!1}return TR(e,t,n)});function TR(e,t,n){let i=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},r=e._zod.bag.fallbackRun,o;if(r?(i[IR]=!0,o=r({value:t,issues:[]},i)):o=e._zod.run({value:t,issues:[]},i),o instanceof Promise)throw new gr;return o.issues.length===0}var Xo=async(e,t,n)=>{let i=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},r=e._zod.run({value:t,issues:[]},i);return r instanceof Promise&&(r=await r),r.issues.length===0},Su=e=>{let t=qo(e),n=(i,r,o,a)=>{let s=o?{...o,direction:"backward"}:{direction:"backward"};return t(i,r,s,xu(n,a))};return n},wx=Su(vr),Iu=e=>{let t=qo(e),n=(i,r,o,a)=>t(i,r,o,xu(n,a));return n},kx=Iu(vr),Tu=e=>{let t=Bo(e),n=async(i,r,o,a)=>{let s=o?{...o,direction:"backward"}:{direction:"backward"};return await t(i,r,s,xu(n,a))};return n},xx=Tu(vr),zu=e=>{let t=Bo(e),n=async(i,r,o,a)=>await t(i,r,o,xu(n,a));return n},Sx=zu(vr),Pu=e=>(t,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return Ho(e)(t,n,r)},Ix=Pu(vr),Eu=e=>(t,n,i)=>Ho(e)(t,n,i),Tx=Eu(vr),Ou=e=>async(t,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return Go(e)(t,n,r)},zx=Ou(vr),ju=e=>async(t,n,i)=>Go(e)(t,n,i),Px=ju(vr);var zr={};hn(zr,{anyString:()=>Bg,base64:()=>Ag,base64url:()=>Ng,bigint:()=>Jg,boolean:()=>Gg,browserEmail:()=>CR,cidrv4:()=>Dg,cidrv6:()=>Cg,creditCard:()=>Ru,cuid:()=>bg,cuid2:()=>$g,currencyCode:()=>Zg,date:()=>Fg,datetime:()=>qg,domain:()=>Lg,duration:()=>Tg,e164:()=>Ug,email:()=>Pg,emoji:()=>Eg,extendedDuration:()=>zR,guid:()=>zg,hex:()=>Qg,hostname:()=>Mg,html5Email:()=>jR,httpProtocol:()=>Ws,iban:()=>Du,idnEmail:()=>DR,integer:()=>Xs,ipv4:()=>Og,ipv6:()=>jg,ksuid:()=>xg,lowercase:()=>Xg,mac:()=>Rg,md5_base64:()=>LR,md5_base64url:()=>UR,md5_hex:()=>MR,nanoid:()=>Sg,nanoidOfLength:()=>Ig,null:()=>Kg,number:()=>Cn,rfc5322Email:()=>RR,sha1_base64:()=>FR,sha1_base64url:()=>VR,sha1_hex:()=>ZR,sha256_base64:()=>BR,sha256_base64url:()=>HR,sha256_hex:()=>qR,sha384_base64:()=>GR,sha384_base64url:()=>KR,sha384_hex:()=>JR,sha512_base64:()=>XR,sha512_base64url:()=>YR,sha512_hex:()=>WR,string:()=>Hg,time:()=>Vg,ulid:()=>wg,undefined:()=>Wg,unicodeEmail:()=>Ex,uppercase:()=>Yg,uuid:()=>Xi,uuid4:()=>PR,uuid6:()=>ER,uuid7:()=>OR,xid:()=>kg});var bg=/^[cC][0-9a-z]{6,}$/,$g=/^[0-9a-z]+$/,wg=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,kg=/^[0-9a-vA-V]{20}$/,xg=/^[A-Za-z0-9]{27}$/,Sg=/^[a-zA-Z0-9_-]{21}$/;function Ig(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var Tg=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,zR=/^[-+]?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)?)??$/,zg=/^([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})$/,Xi=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,PR=Xi(4),ER=Xi(6),OR=Xi(7),Pg=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,jR=/^[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])?)*$/,RR=/^(([^<>()\[\]\\.,;:\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,}))$/,Ex=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,DR=Ex,CR=/^[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])?)*$/,AR="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function Eg(){return new RegExp(AR,"u")}var Og=/^(?:(?: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])$/,jg=/^(([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}|:))$/,Rg=e=>{let t=Lr(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},Dg=/^((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])$/,Cg=/^(([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}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Ag=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Ng=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,Mg=/^(?=.{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])?)*\.?$/,Lg=/^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$/,Ws=/^https?$/,Ug=/^\+[1-9]\d{6,14}$/,Ru=/^\d(?:[ -]?\d){11,18}$/,Zg=/^(?:AED|AFN|ALL|AMD|AOA|ARS|AUD|AWG|AZN|BAM|BBD|BDT|BHD|BIF|BMD|BND|BOB|BOV|BRL|BSD|BTN|BWP|BYN|BZD|CAD|CDF|CHE|CHF|CHW|CLF|CLP|CNY|COP|COU|CRC|CUP|CVE|CZK|DJF|DKK|DOP|DZD|EGP|ERN|ETB|EUR|FJD|FKP|GBP|GEL|GHS|GIP|GMD|GNF|GTQ|GYD|HKD|HNL|HTG|HUF|IDR|ILS|INR|IQD|IRR|ISK|JMD|JOD|JPY|KES|KGS|KHR|KMF|KPW|KRW|KWD|KYD|KZT|LAK|LBP|LKR|LRD|LSL|LYD|MAD|MDL|MGA|MKD|MMK|MNT|MOP|MRU|MUR|MVR|MWK|MXN|MXV|MYR|MZN|NAD|NGN|NIO|NOK|NPR|NZD|OMR|PAB|PEN|PGK|PHP|PKR|PLN|PYG|QAR|RON|RSD|RUB|RWF|SAR|SBD|SCR|SDG|SEK|SGD|SHP|SLE|SOS|SRD|SSP|STN|SVC|SYP|SZL|THB|TJS|TMT|TND|TOP|TRY|TTD|TWD|TZS|UAH|UGX|USD|USN|UYI|UYU|UYW|UZS|VED|VES|VND|VUV|WST|XAD|XAF|XAG|XAU|XBA|XBB|XBC|XBD|XCD|XCG|XDR|XOF|XPD|XPF|XPT|XSU|XTS|XUA|XXX|YER|ZAR|ZMW|ZWG)$/,Du=/^[A-Z]{2}(?!00|01|99)\d{2}[A-Z0-9]{11,30}$/,Ox="(?:(?:\\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])))";function NR(e){return new RegExp(`^${e}$`)}var Fg=NR(Ox);function _g(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Vg(e){return new RegExp(`^${_g(e)}$`)}function qg(e){let t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let n=`${_g({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,i=e.local?`${n}|${_g({precision:e.precision})}`:n;return new RegExp(`^${Ox}T(?:${i})$`)}var Bg=/^[\s\S]{0,}$/,Hg=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Jg=/^-?\d+n?$/,Xs=/^-?\d+$/,Cn=/^-?\d+(?:\.\d+)?$/,Gg=/^(?:true|false)$/i,Kg=/^null$/i;var Wg=/^undefined$/i;var Xg=/^[^A-Z]*$/,Yg=/^[^a-z]*$/,Qg=/^[0-9a-fA-F]*$/;function Ys(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function Qs(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var MR=/^[0-9a-fA-F]{32}$/,LR=Ys(22,"=="),UR=Qs(22),ZR=/^[0-9a-fA-F]{40}$/,FR=Ys(27,"="),VR=Qs(27),qR=/^[0-9a-fA-F]{64}$/,BR=Ys(43,"="),HR=Qs(43),JR=/^[0-9a-fA-F]{96}$/,GR=Ys(64,""),KR=Qs(64),WR=/^[0-9a-fA-F]{128}$/,XR=Ys(86,"=="),YR=Qs(86);var Ye=E("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),ev=e=>{let t=e.value;return!bu(t)&&t.size!==void 0},tv=e=>{let t=e.value;return!bu(t)&&t.length!==void 0},Cu={number:"number",bigint:"bigint",object:"date"},Nu=E("$ZodCheckLessThan",(e,t)=>{Ye.init(e,t);let n=Cu[typeof t.value];e._zod.check=i=>{(t.inclusive?i.value<=t.value:i.value<t.value)||i.issues.push({origin:Cu[typeof i.value]??n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Mu=E("$ZodCheckGreaterThan",(e,t)=>{Ye.init(e,t);let n=Cu[typeof t.value];e._zod.check=i=>{(t.inclusive?i.value>=t.value:i.value>t.value)||i.issues.push({origin:Cu[typeof i.value]??n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),rv=E("$ZodCheckMultipleOf",(e,t)=>{Ye.init(e,t),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):Us(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),nv=E("$ZodCheckNumberFormat",(e,t)=>{Ye.init(e,t),t.format=t.format||"float64";let n=t.format?.includes("int"),i=n?"int":"number",[r,o]=Fs[t.format];e._zod.check=a=>{let s=a.value;if(n){if(!Number.isInteger(s)){a.issues.push({expected:i,format:t.format,code:"invalid_type",continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?a.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort}):a.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort});return}}s<r&&a.issues.push({origin:"number",input:s,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),s>o&&a.issues.push({origin:"number",input:s,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),iv=E("$ZodCheckBigIntFormat",(e,t)=>{Ye.init(e,t);let[n,i]=Vs[t.format];e._zod.check=r=>{let o=r.value;o<n&&r.issues.push({origin:"bigint",input:o,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),o>i&&r.issues.push({origin:"bigint",input:o,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),ov=E("$ZodCheckMaxSize",(e,t)=>{var n;Ye.init(e,t),(n=e._zod.def).when??(n.when=ev),e._zod.check=i=>{let r=i.value;r.size<=t.maximum||i.issues.push({origin:Bs(r),code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),av=E("$ZodCheckMinSize",(e,t)=>{var n;Ye.init(e,t),(n=e._zod.def).when??(n.when=ev),e._zod.check=i=>{let r=i.value;r.size>=t.minimum||i.issues.push({origin:Bs(r),code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),sv=E("$ZodCheckSizeEquals",(e,t)=>{var n;Ye.init(e,t),(n=e._zod.def).when??(n.when=ev),e._zod.check=i=>{let r=i.value,o=r.size;if(o===t.size)return;let a=o>t.size;i.issues.push({origin:Bs(r),...a?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}}),cv=E("$ZodCheckMaxLength",(e,t)=>{var n;Ye.init(e,t),(n=e._zod.def).when??(n.when=tv),e._zod.check=i=>{let r=i.value,o=r.length;if((typeof r=="string"&&o>t.maximum?Gi(r):o)<=t.maximum)return;let s=Hs(r);i.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),lv=E("$ZodCheckMinLength",(e,t)=>{var n;Ye.init(e,t),(n=e._zod.def).when??(n.when=tv),e._zod.check=i=>{let r=i.value,o=r.length;if((typeof r=="string"&&o>=t.minimum&&o<t.minimum*2?Gi(r):o)>=t.minimum)return;let s=Hs(r);i.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),uv=E("$ZodCheckLengthEquals",(e,t)=>{var n;Ye.init(e,t),(n=e._zod.def).when??(n.when=tv),e._zod.check=i=>{let r=i.value,o=r.length,a=typeof r=="string"&&o>=t.length&&o<=t.length*2?Gi(r):o;if(a===t.length)return;let s=Hs(r),c=a>t.length;i.issues.push({origin:s,...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}}),Yo=E("$ZodCheckStringFormat",(e,t)=>{var n,i;Ye.init(e,t),t.pattern?(n=e._zod).check??(n.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(i=e._zod).check??(i.check=()=>{})}),dv=E("$ZodCheckRegex",(e,t)=>{Yo.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),pv=E("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Xg),Yo.init(e,t)}),mv=E("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Yg),Yo.init(e,t)}),fv=E("$ZodCheckIncludes",(e,t)=>{Ye.init(e,t);let n=Lr(t.includes),i=new RegExp(typeof t.position=="number"?`^.{${t.position},}${n}`:n);t.pattern=i,e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),hv=E("$ZodCheckStartsWith",(e,t)=>{Ye.init(e,t);let n=new RegExp(`^${Lr(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.check=i=>{i.value.startsWith(t.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:i.value,inst:e,continue:!t.abort})}}),gv=E("$ZodCheckEndsWith",(e,t)=>{Ye.init(e,t);let n=new RegExp(`.*${Lr(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.check=i=>{i.value.endsWith(t.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:i.value,inst:e,continue:!t.abort})}});function Au(e,t,n){e.issues.length&&t.issues.push(...fr(n,e.issues))}var vv=E("$ZodCheckProperty",(e,t)=>{Ye.init(e,t),e._zod.check=n=>{let i=t.schema._zod.run({value:n.value[t.property],issues:[]},{});if(i instanceof Promise)return i.then(r=>Au(r,n,t.property));Au(i,n,t.property)}}),yv=E("$ZodCheckProperties",(e,t)=>{Ye.init(e,t),Js(e,Symbol.iterator,function*(){yield e});let n;e._zod.check=i=>{if(i.value==null){i.issues.push({expected:"object",code:"invalid_type",input:i.value,inst:e});return}n??(n=Reflect.ownKeys(t.shape).map(a=>[a,t.shape[a]]));let r=i.value,o;for(let[a,s]of n){let c=s._zod.run({value:r[a],issues:[]},{});c instanceof Promise?(o??(o=[]),o.push(c.then(l=>Au(l,i,a)))):Au(c,i,a)}if(o)return Promise.all(o).then(()=>{})}}),_v=E("$ZodCheckMimeType",(e,t)=>{Ye.init(e,t);let n=new Set(t.mime);e._zod.check=i=>{n.has(i.value.type)||i.issues.push({code:"invalid_value",values:t.mime,input:i.value.type,inst:e,continue:!t.abort})}}),bv=E("$ZodCheckOverwrite",(e,t)=>{Ye.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});var Yi=class{constructor(t=[],n={}){this.content=[],this.indent=0,this.args=t,this.closed=n}indented(t){this.indent+=1;try{t(this)}finally{this.indent-=1}}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let i=t.split(`
|
|
32
|
+
`).filter(a=>a),r=Math.min(...i.map(a=>a.length-a.trimStart().length)),o=i.map(a=>a.slice(r)).map(a=>" ".repeat(this.indent*2)+a);for(let a of o)this.content.push(a)}compile(){let t=Function,n=this?.content??[""];return new t(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
|
|
33
|
+
${n.join(`
|
|
34
|
+
`)}
|
|
35
|
+
};`)(...Object.values(this.closed))}};var $v={major:4,minor:6,patch:7};var xe=E("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=$v;let i=e._zod.def.checks,r=e._zod.traits.has("$ZodCheck")?[e,...i??[]]:i?.length?[...i]:[];for(let o of r)for(let a of o._zod.onattach)a(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let o=(s,c,l)=>{if(s.memo)return s;let u=nr(s),p;for(let h of c){if(h._zod.def.when){if(sg(s)||!h._zod.def.when(s))continue}else if(u)continue;let g=s.issues.length,_=h._zod.check(s);if(_ instanceof Promise&&l?.async===!1)throw new gr;if(p||_ instanceof Promise)p=(p??Promise.resolve()).then(async()=>{await _,s.issues.length!==g&&(qs(s.issues,g,e),u||(u=nr(s,g)))});else{if(s.issues.length===g)continue;qs(s.issues,g,e),u||(u=nr(s,g))}}return p?p.then(()=>s):s},a=(s,c,l)=>{if(nr(s))return s.aborted=!0,s;let u=o(c,r,l);if(u instanceof Promise){if(l.async===!1)throw new gr;return u.then(p=>e._zod.parse(p,l))}return e._zod.parse(u,l)};e._zod.run=(s,c)=>{if(c.skipChecks)return e._zod.parse(s,c);if(c.direction==="backward"){let u=e._zod.parse({value:s.value,issues:[]},{...c,skipChecks:!0});return u instanceof Promise?u.then(p=>a(p,s,c)):a(u,s,c)}let l=e._zod.parse(s,c);if(l instanceof Promise){if(c.async===!1)throw new gr;return l.then(u=>o(u,r,c))}return o(l,r,c)}}},{get"~standard"(){return Js(this,"~standard",Vu(this))},set"~standard"(e){gn(this,"~standard",e)}}),Gx=(e,t)=>e.issues.length?{issues:e.issues.map(n=>hr(n,t,vt()))}:{value:e.value};async function QR(e,t){let n={async:!0};return Gx(await e._zod.run({value:t,issues:[]},n),n)}function Vu(e){return{validate:t=>{let n={async:!1};try{let i=e._zod.run({value:t,issues:[]},n);if(!(i instanceof Promise))return Gx(i,n)}catch{}return QR(e,t)},vendor:"zod",version:1}}var ai=E("$ZodString",(e,t)=>{xe.init(e,t),e._zod.pattern=t.pattern??Bg,e._zod.parse=(n,i)=>{if(t.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:e}),n}}),Ge=E("$ZodStringFormat",(e,t)=>{Yo.init(e,t),ai.init(e,t)}),qu=E("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=zg),Ge.init(e,t)}),Bu=E("$ZodUUID",(e,t)=>{if(t.version){let i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(i===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Xi(i))}else t.pattern??(t.pattern=Xi());Ge.init(e,t)}),Hu=E("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Pg),Ge.init(e,t)}),kv=1,ec=2;function xv(e){try{return typeof URL<"u"&&typeof URL.canParse=="function"?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function Ju(e,t){return!("normalize"in t)&&!("hostname"in t)&&!("protocol"in t)?xv(e)||ec:Kx(e,t)}function Kx(e,t){if(!t.normalize&&t.protocol?.source===Ws.source&&!/^https?:\/\//i.test(e))return kv;try{if(typeof URL<"u"){let n=URL;if(typeof n.parse=="function")return n.parse(e)??ec}return new URL(e)}catch{return ec}}var eD=/[\t\n\r]/g;function tc(e){return e.replace(eD,"")}function Gu(e,t){return t.lastIndex=0,t.test(e.hostname)}function Ku(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(":")?e.protocol.slice(0,-1):e.protocol)}var Wu=E("$ZodURL",(e,t)=>{Ge.init(e,t),e._zod.check=n=>{try{let i=n.value.trim(),r=Ju(i,t);if(r===kv){n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:e,continue:!t.abort});return}if(r===ec){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort});return}if(r===!0){n.value=tc(i);return}t.hostname&&!Gu(r,t.hostname)&&n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&!Ku(r,t.protocol)&&n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?r.href:tc(i);return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),Xu=E("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Eg()),Ge.init(e,t)}),Yu=E("$ZodNanoID",(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw new Error(`Invalid nanoid length: ${t.length}`);t.pattern??(t.pattern=t.length===void 0?Sg:Ig(t.length)),Ge.init(e,t)}),Qu=E("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=bg),Ge.init(e,t)}),ed=E("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=$g),Ge.init(e,t)}),td=E("$ZodULID",(e,t)=>{t.pattern??(t.pattern=wg),Ge.init(e,t)}),rd=E("$ZodXID",(e,t)=>{t.pattern??(t.pattern=kg),Ge.init(e,t)}),nd=E("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=xg),Ge.init(e,t)}),Sv=E("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=qg(t)),Ge.init(e,t)}),Iv=E("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Fg),Ge.init(e,t)}),Tv=E("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Vg(t)),Ge.init(e,t)}),zv=E("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Tg),Ge.init(e,t)}),id=E("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Og),Ge.init(e,t)}),tD=/^[0-9a-fA-F:.]+$/;function rc(e){return tD.test(e)?xv(`http://[${e}]`):!1}var od=E("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=jg),Ge.init(e,t),e._zod.check=n=>{rc(n.value)||n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}),ad=E("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=Rg(t.delimiter)),Ge.init(e,t)}),sd=E("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Dg),Ge.init(e,t)});function cd(e){let t=e.split("/");if(t.length!==2)return!1;let[n,i]=t;if(!i)return!1;let r=Number(i);return`${r}`!==i||r<0||r>128?!1:rc(n)}var ld=E("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Cg),Ge.init(e,t),e._zod.check=n=>{cd(n.value)||n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}});function nc(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var ud=/^[0-9a-zA-Z+/]*={0,2}$/,dd=E("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=ud),Ge.init(e,t),e._zod.check=n=>{nc(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}}),ic=/^[A-Za-z0-9_-]*$/;function pd(e){if(!ic.test(e))return!1;let t=e.replace(/[-_]/g,i=>i==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return nc(n)}var md=E("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=ic),Ge.init(e,t),e._zod.check=n=>{pd(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),fd=E("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Ug),Ge.init(e,t)}),rD=/[- ]/g;function nD(e){let t=e.length,n=1,i=0;for(;t;){let r=e.charCodeAt(--t)-48;n^=1,i+=n?[0,2,4,6,8,1,3,5,7,9][r]:r}return i%10===0}function hd(e){return Ru.test(e)?nD(e.replace(rD,"")):!1}var gd=E("$ZodCreditCard",(e,t)=>{t.pattern??(t.pattern=Ru),Ge.init(e,t),e._zod.check=n=>{hd(n.value)||n.issues.push({code:"invalid_format",format:"credit_card",input:n.value,inst:e,continue:!t.abort})}});function iD(e){let t=0,n=e.length;for(let i=4;i<n;i++){let r=e.charCodeAt(i);t=(r>=65?t*100+(r-55):t*10+(r-48))%97}for(let i=0;i<4;i++){let r=e.charCodeAt(i);t=(r>=65?t*100+(r-55):t*10+(r-48))%97}return t===1}function vd(e){return Du.test(e)?iD(e):!1}var yd=E("$ZodIBAN",(e,t)=>{t.pattern??(t.pattern=Du),Ge.init(e,t),e._zod.check=n=>{vd(n.value)||n.issues.push({code:"invalid_format",format:"iban",input:n.value,inst:e,continue:!t.abort})}});function _d(e,t=null){try{let n=e.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||t&&(!("alg"in r)||r.alg!==t))}catch{return!1}}var bd=E("$ZodJWT",(e,t)=>{Ge.init(e,t),e._zod.check=n=>{_d(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),$d=E("$ZodCustomStringFormat",(e,t)=>{Ge.init(e,t),e._zod.check=n=>{t.fn(n.value)||n.issues.push({code:"invalid_format",format:t.format,input:n.value,inst:e,continue:!t.abort})}}),oc=E("$ZodNumber",(e,t)=>{xe.init(e,t),e._zod.pattern=Cn,e._zod.parse=(n,i)=>{if(t.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:String(r):void 0;return n.issues.push({expected:"number",code:"invalid_type",input:r,inst:e,...o?{received:o}:{}}),n}}),wd=E("$ZodNumberFormat",(e,t)=>{nv.init(e,t),oc.init(e,t)}),ea=E("$ZodBoolean",(e,t)=>{xe.init(e,t),e._zod.pattern=Gg,e._zod.parse=(n,i)=>{if(t.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:e}),n}}),ac=E("$ZodBigInt",(e,t)=>{xe.init(e,t),e._zod.pattern=Jg,e._zod.parse=(n,i)=>{if(t.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:e}),n}}),kd=E("$ZodBigIntFormat",(e,t)=>{iv.init(e,t),ac.init(e,t)}),xd=E("$ZodSymbol",(e,t)=>{xe.init(e,t),e._zod.parse=(n,i)=>{let r=n.value;return typeof r=="symbol"||n.issues.push({expected:"symbol",code:"invalid_type",input:r,inst:e}),n}}),Sd=E("$ZodUndefined",(e,t)=>{xe.init(e,t),e._zod.pattern=Wg,e._zod.values=new Set([void 0]),e._zod.parse=(n,i)=>{let r=n.value;return typeof r>"u"||n.issues.push({expected:"undefined",code:"invalid_type",input:r,inst:e}),n}}),Id=E("$ZodNull",(e,t)=>{xe.init(e,t),e._zod.pattern=Kg,e._zod.values=new Set([null]),e._zod.parse=(n,i)=>{let r=n.value;return r===null||n.issues.push({expected:"null",code:"invalid_type",input:r,inst:e}),n}}),Td=E("$ZodAny",(e,t)=>{xe.init(e,t),e._zod.parse=n=>n}),zd=E("$ZodUnknown",(e,t)=>{xe.init(e,t),e._zod.parse=n=>n}),Pd=E("$ZodNever",(e,t)=>{xe.init(e,t),e._zod.parse=(n,i)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)}),Ed=E("$ZodVoid",(e,t)=>{xe.init(e,t),e._zod.parse=(n,i)=>{let r=n.value;return typeof r>"u"||n.issues.push({expected:"void",code:"invalid_type",input:r,inst:e}),n}}),Od=E("$ZodDate",(e,t)=>{xe.init(e,t),e._zod.parse=(n,i)=>{if(t.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:e}),n}});function Pv(e,t){let n=Fo(e._zod.def.checks);if(!n.length)return;let i=Math.min(...n.map(o=>o[0])),r=e._zod.parse;e._zod.parse=(o,a)=>{let s=t(o.value);if(s>i&&!a?.skipChecks&&a?.direction!=="backward"){for(let[c,l]of Fo(e._zod.def.checks))if(s>c&&l._zod.def.when(o)){let u=o.issues.length;return l._zod.check(o),o.issues[u].continue=!1,qs(o.issues,u,e),o}}return r(o,a)}}var oD=e=>Array.isArray(e)?e.length:-1,aD=e=>e instanceof Map?e.size:-1,sD=e=>e instanceof Set?e.size:-1;function Rx(e,t,n){e.issues.length&&t.issues.push(...fr(n,e.issues)),t.value[n]=e.value}var jd=E("$ZodArray",(e,t)=>{xe.init(e,t);let n=jt.memoizer;n?.attach(e),e._zod.parse=(i,r)=>{let o=i.value;if(!Array.isArray(o))return i.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),i;i.value=n?n.alloc(e,i,Array(o.length),r):Array(o.length);let a=[],s=r?.abortEarly;for(let c=0;c<o.length;c++){let l=o[c],u=t.element._zod.run({value:l,issues:[]},r);if(u instanceof Promise)a.push(u.then(p=>Rx(p,i,c)));else if(Rx(u,i,c),s&&u.issues.length!==0&&nr(u))break}return a.length?Promise.all(a).then(()=>i):i},Pv(e,oD)});function Fu(e,t,n,i,r,o){let a=n in i,s=o==="optional";if(!(!a&&s&&r==="optional")){if(e.issues.length){if(r!==void 0&&s&&!a)return;t.issues.push(...fr(n,e.issues))}if(!a&&r===void 0){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}e.value===void 0?(a||r==="defaulted"&&!s)&&(t.value[n]=void 0):t.value[n]=e.value}}var cD=[];function Wx(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),i=n.length?n:cD,r=i.length?[...t,...i]:t;for(let a of r)if(!e.shape?.[a]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${String(a)}": expected a Zod schema`);let o=ag(e.shape);return{...e,allKeys:r,symbolKeys:i,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(o)}}function Xx(e,t,n,i,r,o,a){let s=[],c=r.keySet,l=r.catchall._zod,u=l.def.type,p=l.optin,h=l.optout,g=0;for(let _ in t){if(a&&n.issues.length!==g){if(nr(n,g))break;g=n.issues.length}if(c.has(_))continue;if(_==="__proto__"){u==="never"&&s.push(_);continue}if(u==="never"){s.push(_);continue}let k=l.run({value:t[_],issues:[]},i);k instanceof Promise?e.push(k.then(T=>Fu(T,n,_,t,p,h))):Fu(k,n,_,t,p,h)}return s.length&&n.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:o,continue:!0}),e.length?Promise.all(e).then(()=>n):n}var Rd=E("$ZodObject",(e,t)=>{xe.init(e,t);let n=Object.getOwnPropertyDescriptor(t,"shape"),i=n?.get?n.get.raw:t.shape??{};if(i){let l=()=>{let u={...i};return Object.defineProperty(t,"shape",{value:u}),l.raw=u,u};l.raw=i,Object.defineProperty(t,"shape",{get:l})}let r=Lo(()=>Wx(t));Pe(e,"propValues",l=>{let u=l.def.shape,p={};for(let h in u){let g=u[h]._zod;if(g.values){Object.prototype.hasOwnProperty.call(p,h)||At(p,h,new Set);for(let _ of g.values)p[h].add(_);g.optin!==void 0&&p[h].add(void 0)}}return p});let o=Ji,a=t.catchall,s,c=jt.memoizer;c?.attach(e),e._zod.parse=(l,u)=>{s??(s=r.value);let p=l.value;if(!o(p))return l.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),l;l.value=c?c.alloc(e,l,{},u):{};let h=[],g=s.shape,_=u?.abortEarly,k=l.issues.length;for(let T of s.allKeys){if(_&&l.issues.length!==k){if(nr(l,k))break;k=l.issues.length}if(T==="__proto__")continue;let z=g[T],S=z._zod.optin,A=z._zod.optout,Q=z._zod.run({value:p[T],issues:[]},u);Q instanceof Promise?h.push(Q.then(X=>Fu(X,l,T,p,S,A))):Fu(Q,l,T,p,S,A)}return a?Xx(h,p,l,u,r.value,e,_===!0):h.length?Promise.all(h).then(()=>l):l}}),Ev=E("$ZodObjectJIT",(e,t)=>{Rd.init(e,t);let n=e._zod.parse,i=Lo(()=>Wx(t)),r=jt.memoizer,o=g=>{let _=i.value,k=_.symbolKeys,T=new Yi(["payload","ctx"],{shape:g,inst:e,memo:r,syms:k}),z=X=>`shape[${X}]._zod.run({ value: input[${X}], issues: [] }, ctx)`,S=(X,ge)=>`
|
|
36
|
+
let ${X}_ab = false;
|
|
37
|
+
for (let i = 0; i < ${X}.issues.length; i++) {
|
|
38
|
+
const iss = ${X}.issues[i];
|
|
39
|
+
iss.path = iss.path ? [${ge}, ...iss.path] : [${ge}];
|
|
40
|
+
payload.issues.push(iss);
|
|
41
|
+
if (iss.continue !== true) ${X}_ab = true;
|
|
42
|
+
}
|
|
43
|
+
if (${X}_ab && ctx && ctx.abortEarly) {
|
|
44
|
+
payload.value = newResult;
|
|
45
|
+
return payload;
|
|
46
|
+
}`;T.write("const input = payload.value;");let A=Object.create(null),Q=0;for(let X of _.allKeys)A[X]=`key_${Q++}`;T.write(r?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(let X of _.allKeys){if(X==="__proto__")continue;let ge=A[X],ye=typeof X=="symbol"?`syms[${k.indexOf(X)}]`:rr(X),Le=`${ye} in input`,Dt=g[X],_t=Dt?._zod?.optin,rt=_t!==void 0,nt=Dt?._zod?.optout==="optional";if(T.write(`const ${ge} = ${z(ye)};`),rt&&nt){let qt=_t==="optional"?`${ge}_present`:`${ge}.value !== undefined || ${ge}_present`;T.write(`
|
|
47
|
+
const ${ge}_present = ${Le};
|
|
48
|
+
if (!${ge}.issues.length || ${ge}_present) {
|
|
49
|
+
if (${ge}.issues.length) {${S(ge,ye)}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
if (${qt}) {
|
|
53
|
+
newResult[${ye}] = ${ge}.value;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
`)}else rt?(T.write(`
|
|
58
|
+
if (${ge}.issues.length) {${S(ge,ye)}
|
|
59
|
+
}
|
|
60
|
+
`),_t==="defaulted"?T.write(`newResult[${ye}] = ${ge}.value;`):T.write(`
|
|
61
|
+
if (${ge}.value !== undefined || ${Le}) {
|
|
62
|
+
newResult[${ye}] = ${ge}.value;
|
|
63
|
+
}
|
|
64
|
+
`)):T.write(`
|
|
65
|
+
const ${ge}_present = ${Le};
|
|
66
|
+
if (${ge}.issues.length) {${S(ge,ye)}
|
|
67
|
+
}
|
|
68
|
+
if (!${ge}_present && !${ge}.issues.length) {
|
|
69
|
+
payload.issues.push({
|
|
70
|
+
code: "invalid_type",
|
|
71
|
+
expected: "nonoptional",
|
|
72
|
+
input: undefined,
|
|
73
|
+
path: [${ye}]
|
|
74
|
+
});
|
|
75
|
+
if (ctx && ctx.abortEarly) {
|
|
76
|
+
payload.value = newResult;
|
|
77
|
+
return payload;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
if (${ge}_present) {
|
|
82
|
+
newResult[${ye}] = ${ge}.value;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
`)}return T.write("payload.value = newResult;"),T.write("return payload;"),T.compile()},a,s=Ji,c=!jt.jitless,u=c&&ig.value,p=t.catchall,h;e._zod.parse=(g,_)=>{h??(h=i.value);let k=g.value;return s(k)?c&&u&&_?.async===!1&&_.jitless!==!0?(a||(a=o(t.shape)),g=a(g,_),p?Xx([],k,g,_,h,e,_?.abortEarly===!0):g):n(g,_):(g.issues.push({expected:"object",code:"invalid_type",input:k,inst:e}),g)}});function Dx(e,t,n,i){for(let o of e)if(o.issues.length===0)return t.value=o.value,t;let r=e.filter(o=>!nr(o));return r.length===1?(t.value=r[0].value,r[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(o=>o.issues.map(a=>hr(a,i,vt())))}),t)}var ta=E("$ZodUnion",(e,t)=>{xe.init(e,t),Pe(e,"optin",i=>i.def.options.some(r=>r._zod.optin==="defaulted")?"defaulted":i.def.options.some(r=>r._zod.optin!==void 0)?"optional":void 0),Pe(e,"optout",i=>i.def.options.some(r=>r._zod.optout==="optional")?"optional":void 0),Pe(e,"values",i=>{if(i.def.options.every(r=>r._zod.values))return new Set(i.def.options.flatMap(r=>Array.from(r._zod.values)))}),Pe(e,"pattern",i=>{if(i.def.options.every(r=>r._zod.pattern)){let r=i.def.options.map(o=>o._zod.pattern);return new RegExp(`^(${r.map(o=>Dn(o.source)).join("|")})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(i,r)=>{if(n)return n(i,r);let o=!1,a=[];for(let s of t.options){let c=s._zod.run({value:i.value,issues:[]},r);if(c instanceof Promise)a.push(c),o=!0;else{if(c.issues.length===0)return c;a.push(c)}}return o?Promise.all(a).then(s=>Dx(s,i,e,r)):Dx(a,i,e,r)}});function Cx(e,t,n,i){let r=[];for(let o=0;o<e.length;o++)e[o].issues.length===0&&r.push(o);return r.length===1?(t.value=e[r[0]].value,t):(r.length===0?t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(o=>o.issues.map(a=>hr(a,i,vt())))}):t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:[],inclusive:!1,matches:r}),t)}var Dd=E("$ZodXor",(e,t)=>{ta.init(e,t),t.inclusive=!1;let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(i,r)=>{if(n)return n(i,r);let o=!1,a=[];for(let s of t.options){let c=s._zod.run({value:i.value,issues:[]},r);c instanceof Promise?(a.push(c),o=!0):a.push(c)}return o?Promise.all(a).then(s=>Cx(s,i,e,r)):Cx(a,i,e,r)}});function Ov(e,t){let n=e._zod,i=n.bag.optionsMap;i||(i=Yx(n.def),n.bag.optionsMap=i);let r=i.get(t);if(r===null)throw new Error(`Ambiguous discriminator value "${String(t)}"`);return r}function Yx(e){let t=new Map;for(let n of e.options){let i=n._zod.propValues?.[e.discriminator];if(!i||i.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(n)}"`);for(let r of i)if(t.has(r)){if(r!==void 0)throw new Error(`Duplicate discriminator value "${String(r)}"`);t.set(r,null)}else t.set(r,n)}return t}var Cd=E("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,ta.init(e,t);let n=e._zod.parse;Pe(e,"propValues",r=>{let o={},a=0;for(let s of r.def.options){let c=s._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${r.def.options.indexOf(s)}"`);c[r.def.discriminator]?.has(void 0)&&a++;for(let[l,u]of Object.entries(c)){Object.prototype.hasOwnProperty.call(o,l)||At(o,l,new Set);for(let p of u)o[l].add(p)}}return!r.def.unionFallback&&a>1&&o[r.def.discriminator]?.delete(void 0),o}),t.options.forEach((r,o)=>{let a=Uo(r._zod.def);if(a&&!Object.prototype.hasOwnProperty.call(a,t.discriminator))throw new Error(`Invalid discriminated union option at index "${o}"`)});let i=Lo(()=>Yx(t));e._zod.parse=(r,o)=>{let a=r.value;if(!Ji(a))return r.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),r;let s=a?.[t.discriminator],c=i.value.get(s);return c&&(s!==void 0||o.direction!=="backward")?c._zod.run(r,o):t.unionFallback||o.direction==="backward"?n(r,o):(r.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(i.value.keys()).filter(l=>i.value.get(l)!==null),input:a,path:[t.discriminator],inst:e}),r)}}),Ad=E("$ZodIntersection",(e,t)=>{xe.init(e,t),e._zod.parse=(n,i)=>{let r=n.value,o=t.left._zod.run({value:r,issues:[]},i),a=t.right._zod.run({value:r,issues:[]},i);return o instanceof Promise||a instanceof Promise?Promise.all([o,a]).then(([c,l])=>Ax(n,c,l)):Ax(n,o,a)}});function Qo(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Mr(e)&&Mr(t)){let n=Object.keys(t),i=Object.keys(e).filter(o=>n.indexOf(o)!==-1),r={...e,...t};Object.prototype.hasOwnProperty.call(r,"__proto__")&&delete r.__proto__;for(let o of i){if(o==="__proto__")continue;let a=Qo(e[o],t[o]);if(!a.valid)return{valid:!1,mergeErrorPath:[o,...a.mergeErrorPath]};r[o]=a.data}return{valid:!0,data:r}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let i=0;i<e.length;i++){let r=e[i],o=t[i],a=Qo(r,o);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};n.push(a.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Ax(e,t,n){let i=new Map,r,o=new Map,a=(l,u)=>{let p;if(l.code==="unrecognized_keys"&&!l.path?.length)r??(r=l),p=l.keys;else if(l.code==="invalid_key"&&l.origin==="record"&&l.path?.length===1){let h=String(l.path[0]);o.has(h)||o.set(h,l),p=[h]}else return!1;for(let h of p)i.has(h)||i.set(h,{}),i.get(h)[u]=!0;return!0};for(let l of t.issues)a(l,"l")||e.issues.push(l);for(let l of n.issues)a(l,"r")||e.issues.push(l);let s=[...i].filter(([,l])=>l.l&&l.r).map(([l])=>l);if(s.length){let l=r?s.filter(u=>r.keys.includes(u)):[];l.length&&e.issues.push({...r,keys:l});for(let u of s)!l.includes(u)&&o.has(u)&&e.issues.push(o.get(u))}let c=Qo(t.value,n.value);if(!c.valid){if(nr(e))return e;throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var sc=E("$ZodTuple",(e,t)=>{xe.init(e,t);let n=t.items,i=jt.memoizer;i?.attach(e),e._zod.parse=(r,o)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({input:a,inst:e,expected:"tuple",code:"invalid_type"}),r;r.value=i?i.alloc(e,r,[],o):[];let s=[],c=Nx(n,"optin"),l=Nx(n,"optout");if(!t.rest){if(a.length<c)return r.issues.push({code:"too_small",minimum:c,inclusive:!0,input:a,inst:e,origin:"array"}),r;a.length>n.length&&r.issues.push({code:"too_big",maximum:n.length,inclusive:!0,input:a,inst:e,origin:"array"})}let u=new Array(n.length),p=t.rest?o?.abortEarly:void 0,h=!1;for(let g=0;g<n.length;g++){let _=n[g]._zod.run({value:a[g],issues:[]},o);_ instanceof Promise?s.push(_.then(k=>{u[g]=k})):(u[g]=_,p&&!h&&_.issues.length&&(h=nr(_)))}if(t.rest&&!h){let g=n.length-1,_=a.slice(n.length),k=r.issues.length;for(let T of _){if(p&&r.issues.length!==k){if(nr(r,k))break;k=r.issues.length}g++;let z=t.rest._zod.run({value:T,issues:[]},o);z instanceof Promise?s.push(z.then(S=>Mx(S,r,g))):Mx(z,r,g)}}return s.length?Promise.all(s).then(()=>Lx(u,r,n,a,l)):Lx(u,r,n,a,l)}});function Nx(e,t){for(let n=e.length-1;n>=0;n--)if(!(t==="optin"?e[n]._zod.optin!==void 0:e[n]._zod.optout==="optional"))return n+1;return 0}function Mx(e,t,n){e.issues.length&&t.issues.push(...fr(n,e.issues)),t.value[n]=e.value}function Lx(e,t,n,i,r){for(let o=0;o<n.length;o++){let a=e[o],s=o<i.length;if(!s&&o>=r&&n[o]._zod.optin==="optional"){t.value.length=o;break}if(a.issues.length){if(!s&&o>=r){t.value.length=o;break}t.issues.push(...fr(o,a.issues))}t.value[o]=a.value}for(let o=t.value.length-1;o>=i.length&&(n[o]._zod.optout==="optional"&&t.value[o]===void 0);o--)t.value.length=o;return t}var Nd=E("$ZodRecord",(e,t)=>{xe.init(e,t);let n=jt.memoizer;n?.attach(e),e._zod.parse=(i,r)=>{let o=i.value;if(!Mr(o))return i.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),i;let a=[],s=t.keyType._zod.values;if(s&&!t.partial){i.value=n?n.alloc(e,i,{},r):{};let c=new Set;for(let u of s)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){if(c.add(typeof u=="number"?u.toString():u),u==="__proto__")continue;let p=t.keyType._zod.run({value:u,issues:[]},r);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(p.issues.length){i.issues.push({code:"invalid_key",origin:"record",issues:p.issues.map(_=>hr(_,r,vt())),input:u,path:[u],inst:e});continue}let h=p.value;if(h==="__proto__")continue;let g=t.valueType._zod.run({value:o[u],issues:[]},r);g instanceof Promise?a.push(g.then(_=>{_.issues.length&&i.issues.push(...fr(u,_.issues)),i.value[h]=_.value})):(g.issues.length&&i.issues.push(...fr(u,g.issues)),i.value[h]=g.value)}let l;for(let u in o)if(!c.has(u))if(t.mode==="loose"){if(u==="__proto__")continue;i.value[u]=o[u]}else l=l??[],l.push(u);l&&l.length>0&&i.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:l,continue:!0})}else{i.value=n?n.alloc(e,i,{},r):{};let c;for(let l of Reflect.ownKeys(o)){if(l==="__proto__"||!Object.prototype.propertyIsEnumerable.call(o,l))continue;let u=t.keyType._zod.run({value:l,issues:[]},r);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&Cn.test(l)&&u.issues.length){let _=t.keyType._zod.run({value:Number(l),issues:[]},r);if(_ instanceof Promise)throw new Error("Async schemas not supported in object keys currently");_.issues.length===0&&(u=_)}if(u.issues.length){t.mode==="loose"?i.value[l]=o[l]:s?(c=c??[],c.push(l)):i.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map(_=>hr(_,r,vt())),input:l,path:[l],inst:e});continue}let h=u.value;if(h==="__proto__")continue;let g=t.valueType._zod.run({value:o[l],issues:[]},r);g instanceof Promise?a.push(g.then(_=>{_.issues.length&&i.issues.push(...fr(l,_.issues)),i.value[h]=_.value})):(g.issues.length&&i.issues.push(...fr(l,g.issues)),i.value[h]=g.value)}c&&c.length>0&&i.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:c,continue:!0})}return a.length?Promise.all(a).then(()=>i):i}}),Md=E("$ZodMap",(e,t)=>{xe.init(e,t);let n=jt.memoizer;n?.attach(e),e._zod.parse=(i,r)=>{let o=i.value;if(!(o instanceof Map))return i.issues.push({expected:"map",code:"invalid_type",input:o,inst:e}),i;let a=[];i.value=n?n.alloc(e,i,new Map,r):new Map;let s=r?.abortEarly,c=i.issues.length;for(let[l,u]of o){if(s&&i.issues.length!==c){if(nr(i,c))break;c=i.issues.length}let p=t.keyType._zod.run({value:l,issues:[]},r),h=t.valueType._zod.run({value:u,issues:[]},r);p instanceof Promise||h instanceof Promise?a.push(Promise.all([p,h]).then(([g,_])=>{Ux(g,_,i,l,o,e,r)})):Ux(p,h,i,l,o,e,r)}return a.length?Promise.all(a).then(()=>i):i},Pv(e,aD)});function Ux(e,t,n,i,r,o,a){e.issues.length&&(Zs.has(typeof i)?n.issues.push(...fr(i,e.issues)):n.issues.push({code:"invalid_key",origin:"map",input:r,inst:o,issues:e.issues.map(s=>hr(s,a,vt()))})),t.issues.length&&(Zs.has(typeof i)?n.issues.push(...fr(i,t.issues)):n.issues.push({origin:"map",code:"invalid_element",input:r,inst:o,key:i,issues:t.issues.map(s=>hr(s,a,vt()))})),n.value.set(e.value,t.value)}var Ld=E("$ZodSet",(e,t)=>{xe.init(e,t);let n=jt.memoizer;n?.attach(e),e._zod.parse=(i,r)=>{let o=i.value;if(!(o instanceof Set))return i.issues.push({input:o,inst:e,expected:"set",code:"invalid_type"}),i;let a=[];i.value=n?n.alloc(e,i,new Set,r):new Set;let s=r?.abortEarly,c=i.issues.length;for(let l of o){if(s&&i.issues.length!==c){if(nr(i,c))break;c=i.issues.length}let u=t.valueType._zod.run({value:l,issues:[]},r);u instanceof Promise?a.push(u.then(p=>Zx(p,i))):Zx(u,i)}return a.length?Promise.all(a).then(()=>i):i},Pv(e,sD)});function Zx(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}var Ud=E("$ZodEnum",(e,t)=>{xe.init(e,t);let n=No(t.entries),i=new Set(n);e._zod.values=i,Pe(e,"pattern",r=>{let o=No(r.def.entries).filter(a=>Zs.has(typeof a));return new RegExp(o.length?`^(${o.map(a=>Lr(a.toString())).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(r,o)=>{let a=r.value;return i.has(a)||r.issues.push({code:"invalid_value",values:n,input:a,inst:e}),r}}),Zd=E("$ZodLiteral",(e,t)=>{xe.init(e,t);let n=new Set(t.values);e._zod.values=n,Pe(e,"pattern",i=>{let r=i.def.values;return new RegExp(r.length?`^(${r.map(o=>typeof o=="string"?Lr(o):o?Lr(o.toString()):String(o)).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(i,r)=>{let o=i.value;return n.has(o)||i.issues.push({code:"invalid_value",values:t.values,input:o,inst:e}),i}}),Fd=E("$ZodFile",(e,t)=>{xe.init(e,t),e._zod.parse=(n,i)=>{let r=n.value;return r instanceof File||n.issues.push({expected:"file",code:"invalid_type",input:r,inst:e}),n}}),Vd=E("$ZodTransform",(e,t)=>{xe.init(e,t),e._zod.optin="optional",jt.memoizer?.guard(e),e._zod.parse=(n,i)=>{if(i.direction==="backward")throw new oi(e.constructor.name);let r=t.transform(n.value,n);if(i.async)return(r instanceof Promise?r:Promise.resolve(r)).then(a=>(n.value=a,n));if(r instanceof Promise)throw new gr;return n.value=r,n}});function Fx(e,t){return e.value=t.issues.length?void 0:t.value,e}var cc=E("$ZodOptional",(e,t)=>{xe.init(e,t),Pe(e,"optin",n=>n.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",Pe(e,"values",n=>{let i=n.def.innerType._zod.values;return i?new Set([...i,void 0]):void 0}),Pe(e,"pattern",n=>{let i=n.def.innerType._zod.pattern;return i?new RegExp(`^(${Dn(i.source)})?$`):void 0}),e._zod.parse=(n,i)=>{if(n.value===void 0){if(t.innerType._zod.optin!=="defaulted")return n;let r=t.innerType._zod.run({value:n.value,issues:[]},i);return r instanceof Promise?r.then(o=>Fx(n,o)):Fx(n,r)}return t.innerType._zod.run(n,i)}}),qd=E("$ZodExactOptional",(e,t)=>{cc.init(e,t),Pe(e,"values",n=>n.def.innerType._zod.values),Pe(e,"pattern",n=>n.def.innerType._zod.pattern),e._zod.parse=(n,i)=>t.innerType._zod.run(n,i)}),Bd=E("$ZodNullable",(e,t)=>{xe.init(e,t),Pe(e,"optin",n=>n.def.innerType._zod.optin),Pe(e,"optout",n=>n.def.innerType._zod.optout),Pe(e,"pattern",n=>{let i=n.def.innerType._zod.pattern;return i?new RegExp(`^(${Dn(i.source)}|null)$`):void 0}),Pe(e,"values",n=>n.def.innerType._zod.values?new Set([...n.def.innerType._zod.values,null]):void 0),e._zod.parse=(n,i)=>n.value===null?n:t.innerType._zod.run(n,i)}),Hd=E("$ZodDefault",(e,t)=>{xe.init(e,t),e._zod.optin="defaulted",Pe(e,"values",n=>n.def.innerType._zod.values),e._zod.parse=(n,i)=>{if(i.direction==="backward")return t.innerType._zod.run(n,i);if(n.value===void 0)return n.value=t.defaultValue,n;let r=t.innerType._zod.run(n,i);return r instanceof Promise?r.then(o=>Vx(o,t)):Vx(r,t)}});function Vx(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Jd=E("$ZodPrefault",(e,t)=>{xe.init(e,t),e._zod.optin="defaulted",Pe(e,"values",n=>n.def.innerType._zod.values),e._zod.parse=(n,i)=>(i.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,i))}),Gd=E("$ZodNonOptional",(e,t)=>{xe.init(e,t),Pe(e,"values",n=>{let i=n.def.innerType._zod.values;return i?new Set([...i].filter(r=>r!==void 0)):void 0}),e._zod.parse=(n,i)=>{let r=t.innerType._zod.run(n,i);return r instanceof Promise?r.then(o=>qx(o,e)):qx(r,e)}});function qx(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}var Kd=E("$ZodSuccess",(e,t)=>{xe.init(e,t),e._zod.parse=(n,i)=>{if(i.direction==="backward")throw new oi("ZodSuccess");let r=t.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)}});function Bx(e,t,n,i){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(r=>hr(r,i,vt()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var Wd=E("$ZodCatch",(e,t)=>{xe.init(e,t),Pe(e,"optin",n=>n.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),Pe(e,"optout",n=>n.def.innerType._zod.optout),Pe(e,"values",n=>n.def.innerType._zod.values),e._zod.parse=(n,i)=>{if(i.direction==="backward")return t.innerType._zod.run(n,i);let r=t.innerType._zod.run({value:n.value,issues:[]},i);return r instanceof Promise?r.then(o=>Bx(n,o,t,i)):Bx(n,r,t,i)}}),Xd=E("$ZodNaN",(e,t)=>{xe.init(e,t),e._zod.parse=(n,i)=>((typeof n.value!="number"||!Number.isNaN(n.value))&&n.issues.push({input:n.value,inst:e,expected:"nan",code:"invalid_type"}),n)}),lc=E("$ZodPipe",(e,t)=>{xe.init(e,t),Pe(e,"values",n=>n.def.in._zod.values),Pe(e,"optin",n=>n.def.in._zod.optin),Pe(e,"optout",n=>n.def.out._zod.optout),Pe(e,"propValues",n=>n.def.in._zod.propValues),e._zod.parse=(n,i)=>{if(i.direction==="backward"){let o=t.out._zod.run(n,i);return o instanceof Promise?o.then(a=>Lu(a,t.in,i)):Lu(o,t.in,i)}let r=t.in._zod.run(n,i);return r instanceof Promise?r.then(o=>Lu(o,t.out,i)):Lu(r,t.out,i)}});function Lu(e,t,n){return e.issues.some(i=>i.code!=="unrecognized_keys")?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var ra=E("$ZodCodec",(e,t)=>{xe.init(e,t),Pe(e,"values",n=>n.def.in._zod.values),Pe(e,"optin",n=>n.def.in._zod.optin),Pe(e,"optout",n=>n.def.out._zod.optout),Pe(e,"propValues",n=>n.def.in._zod.propValues),e._zod.parse=(n,i)=>{if((i.direction||"forward")==="forward"){let o=t.in._zod.run(n,i);return o instanceof Promise?o.then(a=>Uu(a,t,i)):Uu(o,t,i)}else{let o=t.out._zod.run(n,i);return o instanceof Promise?o.then(a=>Uu(a,t,i)):Uu(o,t,i)}}});function Uu(e,t,n){if(e.issues.length)return e.aborted=!0,e;if((n.direction||"forward")==="forward"){let r=t.transform(e.value,e);return r instanceof Promise?r.then(o=>Zu(e,o,t.out,n)):Zu(e,r,t.out,n)}else{let r=t.reverseTransform(e.value,e);return r instanceof Promise?r.then(o=>Zu(e,o,t.in,n)):Zu(e,r,t.in,n)}}function Zu(e,t,n,i){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:t,issues:e.issues},i)}var jv=E("$ZodPreprocess",(e,t)=>{lc.init(e,t)}),Yd=E("$ZodReadonly",(e,t)=>{xe.init(e,t),Pe(e,"propValues",n=>n.def.innerType._zod.propValues),Pe(e,"values",n=>n.def.innerType._zod.values),Pe(e,"optin",n=>n.def.innerType?._zod?.optin),Pe(e,"optout",n=>n.def.innerType?._zod?.optout),e._zod.parse=(n,i)=>{if(i.direction==="backward")return t.innerType._zod.run(n,i);let r=t.innerType._zod.run(n,i);return r instanceof Promise?r.then(Hx):Hx(r)}});function Hx(e){return e.memo||(e.value=Object.freeze(e.value)),e}function lD(e){let t=e._zod.def,n=t.pattern,i=!!t.format?.includes("int"),r,o;for(let s of t.checks??[]){let c=s._zod.def;c.pattern&&(n=c.pattern),i||(i=!!c.format?.includes("int"));let l=c.minimum??c.length,u=c.maximum??c.length;l!==void 0&&(r===void 0||l>r)&&(r=l),u!==void 0&&(o===void 0||u<o)&&(o=u)}if(n)return n.source;if(r!==void 0&&o!==void 0&&r>o)return"(?!)";if(r!==void 0||o!==void 0)return Hg({minimum:r,maximum:o}).source;let a=e._zod.pattern;return(i&&a===Cn?Xs:a)?.source}function wv(e){let t=e._zod.def,n=e._zod.pattern?.source,i=t.innerType??e._zod.innerType;if(i){let r=i._zod.pattern?.source,o=wv(i);return n&&r&&o&&o!==r?n.replace(Dn(r),()=>Dn(o)):n}if(t.options){let r=t.options.map(wv);if(r.every(Boolean))return`^(${r.map(o=>Dn(o)).join("|")})$`}return lD(e)}var Qd=E("$ZodTemplateLiteral",(e,t)=>{xe.init(e,t);let n=[];for(let i of t.parts)if(typeof i=="object"&&i!==null){let r=wv(i);if(!r)throw new Error(`Invalid template literal part, no pattern found: ${[...i._zod.traits].shift()}`);n.push(Dn(r))}else if(i===null||og.has(typeof i))n.push(Lr(`${i}`));else throw new Error(`Invalid template literal part: ${i}`);e._zod.pattern=new RegExp(`^${n.join("")}$`),e._zod.parse=(i,r)=>typeof i.value!="string"?(i.issues.push({input:i.value,inst:e,expected:"string",code:"invalid_type"}),i):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(i.value)||i.issues.push({input:i.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),i)}),ep=E("$ZodFunction",(e,t)=>(xe.init(e,t),Object.defineProperty(e,"_def",{value:t}),e._zod.def=t,e.implement=n=>{if(typeof n!="function")throw new Error("implement() must be called with a function");return Object.defineProperty(function(...i){let r=e._def.input?Ki(e._def.input,i):i,o=Reflect.apply(n,this,r);return e._def.output?Ki(e._def.output,o):o},"_zod",{value:e._zod,enumerable:!1})},e.implementAsync=n=>{if(typeof n!="function")throw new Error("implementAsync() must be called with a function");return Object.defineProperty(async function(...i){let r=e._def.input?await Wi(e._def.input,i):i,o=await Reflect.apply(n,this,r);return e._def.output?await Wi(e._def.output,o):o},"_zod",{value:e._zod,enumerable:!1})},e._zod.parse=(n,i)=>typeof n.value!="function"?(n.issues.push({code:"invalid_type",expected:"function",input:n.value,inst:e}),n):(e._def.output&&e._def.output._zod.def.type==="promise"?n.value=e.implementAsync(n.value):n.value=e.implement(n.value),n),e.input=(...n)=>{let i=e.constructor;return Array.isArray(n[0])?new i({type:"function",input:new sc({type:"tuple",items:n[0],rest:n[1]}),output:e._def.output}):new i({type:"function",input:n[0],output:e._def.output})},e.output=n=>{let i=e.constructor;return new i({type:"function",input:e._def.input,output:n})},e)),tp=E("$ZodPromise",(e,t)=>{xe.init(e,t),e._zod.parse=(n,i)=>Promise.resolve(n.value).then(r=>t.innerType._zod.run({value:r,issues:[]},i))}),na=E("$ZodLazy",(e,t)=>{xe.init(e,t),rg(e._zod,"innerType",()=>{let n=t;return n._cachedInner||(n._cachedInner=t.getter()),n._cachedInner}),Pe(e,"pattern",n=>n.innerType?._zod?.pattern),Pe(e,"propValues",n=>n.innerType?._zod?.propValues),Pe(e,"optin",n=>n.innerType?._zod?.optin??void 0),Pe(e,"optout",n=>n.innerType?._zod?.optout??void 0),e._zod.parse=(n,i)=>e._zod.innerType._zod.run(n,i)}),rp=E("$ZodCustom",(e,t)=>{Ye.init(e,t),xe.init(e,t),e._zod.parse=(n,i)=>n,e._zod.check=n=>{let i=n.value,r=t.fn(i);if(r instanceof Promise)return r.then(o=>Jx(o,n,i,e));Jx(r,n,i,e)}});function Jx(e,t,n,i){if(!e){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),t.issues.push(Vo(r))}}var ap=class extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}},Dv="~memo",eS=[];function tS(e){return e!==null&&typeof e=="object"}function Rv(e){return e.map(t=>t.path?{...t,path:t.path.slice()}:{...t})}var rS=new WeakMap,ia=0,op=1,uc=2;function dc(e,t,n){let i=rS.get(e);if(i!==void 0)return i?uc:ia;if(t.has(e))return uc;t.add(e);let r=ia,o=u=>{if(r!==uc&&u?._zod){let p=dc(u,t,n);p>r&&(r=p)}},a=(u,p)=>{let h=ia;for(let g of Reflect.ownKeys(u)){let _=Object.getOwnPropertyDescriptor(u,g);if(p&&!_.enumerable)continue;let k=_.get?op:_.value?._zod?dc(_.value,t,n):ia;k>h&&(h=k)}return h},s=u=>{u>r&&(r=u)},c=e._zod.def,l=c.type;switch(l){case"object":{let u=Uo(c);s(u?a(u,!0):op),o(c.catchall);break}case"array":o(c.element);break;case"tuple":for(let u of c.items)o(u);o(c.rest);break;case"record":case"map":o(c.keyType),o(c.valueType);break;case"set":o(c.valueType);break;case"union":for(let u of c.options)o(u);break;case"intersection":o(c.left),o(c.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":o(c.innerType);break;case"pipe":o(c.in),o(c.out);break;case"function":o(c.input),o(c.output);break;case"lazy":{let u=c._cachedInner??(n?e._zod.innerType:void 0);s(u?dc(u,t,!1):op);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(let u in c){let p=Object.getOwnPropertyDescriptor(c,u);if(!p||p.get)continue;let h=p.value;if(!(!h||typeof h!="object")){if(h._zod)o(h);else if(Array.isArray(h))for(let g of h)o(g)}}}return t.delete(e),uD(e,r)}function uD(e,t){return t!==op&&rS.set(e,t===uc),t}function sp(e){return dc(e,new Set,!0)!==ia}function dD(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}var np,ip=[],pD={alloc(e,t,n){let i=np;if(!i)return n;np=void 0;let r={value:n,issues:null};return i.set(t.value,r),ip.push(r),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let n=e._zod.parse,i=(r,o)=>{if(o.direction!=="backward"&&cp(o,r.value))throw new ap;return n(r,o)};e._zod.parse=i,e._zod.run===n&&(e._zod.run=i)})},attach(e){var t;let n,i=!1,r,o;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let a=e._zod.parse,s=(c,l)=>{if(n===void 0){let z=dc(e,new Set,!1);if(z===ia)return e._zod.parse=a,e._zod.run===s&&(e._zod.run=a),a(c,l);z===uc||i?n=!0:i=!0}let u=c.value;if(!tS(u))return a(c,l);let p=l[Dv];p||(p={buckets:new WeakMap,backEdges:void 0},l[Dv]=p);let h;r===l?h=o:(h=dD(p,e),r=l,o=h);let g=h.get(u);if(g)return c.value=g.value,g.issues?g.issues.length&&c.issues.push(...Rv(g.issues)):(c.memo=!0,p.backEdges??(p.backEdges=new WeakSet),p.backEdges.add(g.value)),c;np=h;let _=ip.length,k=a(c,l);np=void 0;let T=ip.length>_?ip.pop():void 0;return k instanceof Promise?k.then(z=>(T&&(T.issues=z.issues.length?Rv(z.issues):eS),z)):(T&&(T.issues=k.issues.length?Rv(k.issues):eS),k)};e._zod.parse=s,e._zod.run===a&&(e._zod.run=s)})}};function pc(){return pD}function cp(e,t){let n=e[Dv]?.backEdges;return n!==void 0&&tS(t)&&n.has(t)}var aa={};hn(aa,{ar:()=>nS,az:()=>iS,be:()=>aS,bg:()=>sS,bn:()=>cS,ca:()=>lS,ckb:()=>uS,cs:()=>dS,da:()=>pS,de:()=>mS,el:()=>fS,en:()=>lp,eo:()=>hS,es:()=>gS,fa:()=>vS,fi:()=>yS,fr:()=>_S,frCA:()=>bS,gu:()=>$S,he:()=>wS,hi:()=>kS,hr:()=>xS,hu:()=>SS,hy:()=>TS,id:()=>zS,is:()=>PS,it:()=>ES,ja:()=>OS,ka:()=>jS,kh:()=>RS,km:()=>up,kn:()=>DS,ko:()=>CS,lt:()=>NS,mk:()=>MS,ms:()=>LS,ne:()=>US,nl:()=>ZS,nn:()=>FS,no:()=>VS,ota:()=>qS,pl:()=>HS,ps:()=>BS,pt:()=>JS,ptBR:()=>GS,ro:()=>KS,ru:()=>XS,sk:()=>YS,sl:()=>QS,sv:()=>e0,ta:()=>t0,tg:()=>r0,th:()=>n0,tk:()=>i0,tr:()=>o0,ua:()=>a0,uk:()=>dp,ur:()=>s0,uz:()=>c0,vi:()=>l0,yo:()=>p0,zhCN:()=>u0,zhTW:()=>d0});var mD=()=>{let e={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"},map:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function t(r){return e[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",mac:"\u0639\u0646\u0648\u0627\u0646 MAC",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",credit_card:"\u0631\u0642\u0645 \u0628\u0637\u0627\u0642\u0629 \u0627\u0644\u0627\u0626\u062A\u0645\u0627\u0646",currency_code:"\u0631\u0645\u0632 \u0627\u0644\u0639\u0645\u0644\u0629",iban:"IBAN",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,a=Z(r.input),s=i[a]??a;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 ${s}`:`\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 ${s}`}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 ${U(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: ${O(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);return a?` \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()} ${a.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?">=":">",a=t(r.origin);return a?`\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()} ${a.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":""}: ${O(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 nS(){return{localeError:mD()}}var fD=()=>{let e={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"},map:{unit:"element",verb:"olmal\u0131d\u0131r"}};function t(r){return e[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",credit_card:"kredit kart\u0131 n\xF6mr\u0259si",currency_code:"valyuta kodu",iban:"IBAN",jwt:"JWT",template_literal:"input"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,a=Z(r.input),s=i[a]??a;return/^[A-Z]/.test(r.expected)?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${r.expected}, daxil olan ${s}`:`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${o}, daxil olan ${s}`}case"invalid_value":return r.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${U(r.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${O(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);return a?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${r.origin??"d\u0259y\u0259r"} ${o}${r.maximum.toString()} ${a.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?">=":">",a=t(r.origin);return a?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${r.origin} ${o}${r.minimum.toString()} ${a.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":""}: ${O(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 iS(){return{localeError:fD()}}function oS(e,t,n,i){let r=Math.abs(e),o=r%10,a=r%100;return a>=11&&a<=19?i:o===1?t:o>=2&&o<=4?n:i}var hD=()=>{let e={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"},map:{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 t(r){return e[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",mac:"MAC \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",credit_card:"\u043D\u0443\u043C\u0430\u0440 \u043A\u0440\u044D\u0434\u044B\u0442\u043D\u0430\u0439 \u043A\u0430\u0440\u0442\u044B",currency_code:"\u043A\u043E\u0434 \u0432\u0430\u043B\u044E\u0442\u044B",iban:"IBAN",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,a=Z(r.input),s=i[a]??a;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 ${s}`:`\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 ${s}`}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 ${U(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 ${O(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);if(a){let s=Number(r.maximum),c=oS(s,a.unit.one,a.unit.few,a.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 ${a.verb} ${o}${r.maximum.toString()} ${c}`}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?">=":">",a=t(r.origin);if(a){let s=Number(r.minimum),c=oS(s,a.unit.one,a.unit.few,a.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 ${a.verb} ${o}${r.minimum.toString()} ${c}`}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"}: ${O(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 aS(){return{localeError:hD()}}var gD=()=>{let e={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"},map:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"}};function t(r){return e[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",mac:"MAC \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",credit_card:"\u043D\u043E\u043C\u0435\u0440 \u043D\u0430 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u0430 \u043A\u0430\u0440\u0442\u0430",currency_code:"\u043A\u043E\u0434 \u043D\u0430 \u0432\u0430\u043B\u0443\u0442\u0430",iban:"IBAN",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,a=Z(r.input),s=i[a]??a;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 ${s}`:`\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 ${s}`}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 ${U(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 ${O(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);return a?`\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()} ${a.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?">=":">",a=t(r.origin);return a?`\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()} ${a.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 a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return o.format==="emoji"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="datetime"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="date"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),o.format==="time"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="duration"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${a} ${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":""}: ${O(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 sS(){return{localeError:gD()}}var vD=()=>{let e={string:{unit:"\u0985\u0995\u09CD\u09B7\u09B0",verb:"\u09A5\u09BE\u0995\u09A4\u09C7 \u09B9\u09AC\u09C7"},file:{unit:"\u09AC\u09BE\u0987\u099F",verb:"\u09A5\u09BE\u0995\u09A4\u09C7 \u09B9\u09AC\u09C7"},array:{unit:"\u0986\u0987\u099F\u09C7\u09AE",verb:"\u09A5\u09BE\u0995\u09A4\u09C7 \u09B9\u09AC\u09C7"},set:{unit:"\u0986\u0987\u099F\u09C7\u09AE",verb:"\u09A5\u09BE\u0995\u09A4\u09C7 \u09B9\u09AC\u09C7"},map:{unit:"\u098F\u09A8\u09CD\u099F\u09CD\u09B0\u09BF",verb:"\u09A5\u09BE\u0995\u09A4\u09C7 \u09B9\u09AC\u09C7"}};function t(r){return e[r]??null}let n={regex:"\u0987\u09A8\u09AA\u09C1\u099F",email:"\u0987\u09AE\u09C7\u0987\u09B2 \u09A0\u09BF\u0995\u09BE\u09A8\u09BE",url:"URL",emoji:"\u0987\u09AE\u09CB\u099C\u09BF",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u09A4\u09BE\u09B0\u09BF\u0996 \u0993 \u09B8\u09AE\u09AF\u09BC",date:"ISO \u09A4\u09BE\u09B0\u09BF\u0996",time:"ISO \u09B8\u09AE\u09AF\u09BC",duration:"ISO \u09B8\u09AE\u09AF\u09BC\u0995\u09BE\u09B2",ipv4:"IPv4 \u09A0\u09BF\u0995\u09BE\u09A8\u09BE",ipv6:"IPv6 \u09A0\u09BF\u0995\u09BE\u09A8\u09BE",mac:"MAC \u09A0\u09BF\u0995\u09BE\u09A8\u09BE",cidrv4:"IPv4 \u09B0\u09C7\u099E\u09CD\u099C",cidrv6:"IPv6 \u09B0\u09C7\u099E\u09CD\u099C",base64:"base64-\u098F\u09A8\u0995\u09CB\u09A1\u09C7\u09A1 \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982",base64url:"base64url-\u098F\u09A8\u0995\u09CB\u09A1\u09C7\u09A1 \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982",json_string:"JSON \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982",e164:"E.164 \u09A8\u09AE\u09CD\u09AC\u09B0",credit_card:"\u0995\u09CD\u09B0\u09C7\u09A1\u09BF\u099F \u0995\u09BE\u09B0\u09CD\u09A1 \u09A8\u09AE\u09CD\u09AC\u09B0",currency_code:"\u09AE\u09C1\u09A6\u09CD\u09B0\u09BE \u0995\u09CB\u09A1",iban:"IBAN",jwt:"JWT",template_literal:"\u0987\u09A8\u09AA\u09C1\u099F"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,a=Z(r.input),s=i[a]??a;return`\u0985\u09AC\u09C8\u09A7 \u0987\u09A8\u09AA\u09C1\u099F: \u09AA\u09CD\u09B0\u09A4\u09CD\u09AF\u09BE\u09B6\u09BF\u09A4 ${o}, \u09AA\u09CD\u09B0\u09BE\u09AA\u09CD\u09A4 ${s}`}case"invalid_value":return r.values.length===1?`\u0985\u09AC\u09C8\u09A7 \u0987\u09A8\u09AA\u09C1\u099F: \u09AA\u09CD\u09B0\u09A4\u09CD\u09AF\u09BE\u09B6\u09BF\u09A4 ${U(r.values[0])}`:`\u0985\u09AC\u09C8\u09A7 \u0985\u09AA\u09B6\u09A8: ${O(r.values," | ")} \u098F\u09B0 \u09AE\u09A7\u09CD\u09AF\u09C7 \u098F\u0995\u099F\u09BF \u09AA\u09CD\u09B0\u09A4\u09CD\u09AF\u09BE\u09B6\u09BF\u09A4`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);return a?`\u0985\u09A8\u09C7\u0995 \u09AC\u09A1\u09BC: ${r.origin??"\u09AE\u09BE\u09A8"} ${o}${r.maximum.toString()} ${a.unit??"\u098F\u09B2\u09BF\u09AE\u09C7\u09A8\u09CD\u099F"} \u09B9\u09A4\u09C7 \u09B9\u09AC\u09C7`:`\u0985\u09A8\u09C7\u0995 \u09AC\u09A1\u09BC: ${r.origin??"\u09AE\u09BE\u09A8"} ${o}${r.maximum.toString()} \u09B9\u09A4\u09C7 \u09B9\u09AC\u09C7`}case"too_small":{let o=r.inclusive?">=":">",a=t(r.origin);return a?`\u0985\u09A8\u09C7\u0995 \u099B\u09CB\u099F: ${r.origin} ${o}${r.minimum.toString()} ${a.unit} \u09B9\u09A4\u09C7 \u09B9\u09AC\u09C7`:`\u0985\u09A8\u09C7\u0995 \u099B\u09CB\u099F: ${r.origin} ${o}${r.minimum.toString()} \u09B9\u09A4\u09C7 \u09B9\u09AC\u09C7`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0985\u09AC\u09C8\u09A7 \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982: "${o.prefix}" \u09A6\u09BF\u09AF\u09BC\u09C7 \u09B6\u09C1\u09B0\u09C1 \u09B9\u09A4\u09C7 \u09B9\u09AC\u09C7`:o.format==="ends_with"?`\u0985\u09AC\u09C8\u09A7 \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982: "${o.suffix}" \u09A6\u09BF\u09AF\u09BC\u09C7 \u09B6\u09C7\u09B7 \u09B9\u09A4\u09C7 \u09B9\u09AC\u09C7`:o.format==="includes"?`\u0985\u09AC\u09C8\u09A7 \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982: "${o.includes}" \u0985\u09A8\u09CD\u09A4\u09B0\u09CD\u09AD\u09C1\u0995\u09CD\u09A4 \u09A5\u09BE\u0995\u09A4\u09C7 \u09B9\u09AC\u09C7`:o.format==="regex"?`\u0985\u09AC\u09C8\u09A7 \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982: ${o.pattern} \u09AA\u09CD\u09AF\u09BE\u099F\u09BE\u09B0\u09CD\u09A8 \u09AE\u09BF\u09B2\u09A4\u09C7 \u09B9\u09AC\u09C7`:`\u0985\u09AC\u09C8\u09A7 ${n[o.format]??r.format}`}case"not_multiple_of":return`\u0985\u09AC\u09C8\u09A7 \u09A8\u09AE\u09CD\u09AC\u09B0: ${r.divisor} \u098F\u09B0 \u0997\u09C1\u09A3\u09BF\u09A4\u0995 \u09B9\u09A4\u09C7 \u09B9\u09AC\u09C7`;case"unrecognized_keys":return`\u0985\u099A\u09C7\u09A8\u09BE \u0995\u09C0${r.keys.length>1?"\u0997\u09C1\u09B2\u09CB":""}: ${O(r.keys,", ")}`;case"invalid_key":return`${r.origin} \u098F \u0985\u09AC\u09C8\u09A7 \u0995\u09C0`;case"invalid_union":return r.options&&Array.isArray(r.options)&&r.options.length>0?`\u0985\u09AC\u09C8\u09A7 \u09A1\u09BF\u09B8\u0995\u09CD\u09B0\u09BF\u09AE\u09BF\u09A8\u09C7\u099F\u09B0 \u09AE\u09BE\u09A8\u0964 \u09AA\u09CD\u09B0\u09A4\u09CD\u09AF\u09BE\u09B6\u09BF\u09A4 ${r.options.map(a=>`'${a}'`).join(" | ")}`:"\u0985\u09AC\u09C8\u09A7 \u0987\u09A8\u09AA\u09C1\u099F";case"invalid_element":return`${r.origin} \u098F \u0985\u09AC\u09C8\u09A7 \u09AE\u09BE\u09A8`;default:return"\u0985\u09AC\u09C8\u09A7 \u0987\u09A8\u09AA\u09C1\u099F"}}};function cS(){return{localeError:vD()}}var yD=()=>{let e={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"},map:{unit:"elements",verb:"contenir"}};function t(r){return e[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",mac:"adre\xE7a MAC",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",credit_card:"n\xFAmero de targeta de cr\xE8dit",currency_code:"codi de moneda",iban:"IBAN",jwt:"JWT",template_literal:"entrada"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,a=Z(r.input),s=i[a]??a;return/^[A-Z]/.test(r.expected)?`Tipus inv\xE0lid: s'esperava instanceof ${r.expected}, s'ha rebut ${s}`:`Tipus inv\xE0lid: s'esperava ${o}, s'ha rebut ${s}`}case"invalid_value":return r.values.length===1?`Valor inv\xE0lid: s'esperava ${U(r.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${O(r.values," o ")}`;case"too_big":{let o=r.inclusive?"com a m\xE0xim":"menys de",a=t(r.origin);return a?`Massa gran: s'esperava que ${r.origin??"el valor"} contingu\xE9s ${o} ${r.maximum.toString()} ${a.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",a=t(r.origin);return a?`Massa petit: s'esperava que ${r.origin} contingu\xE9s ${o} ${r.minimum.toString()} ${a.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":""}: ${O(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 lS(){return{localeError:yD()}}var _D=()=>{let e={string:{unit:"\u067E\u06CC\u062A",verb:"\u0628\u06CE\u062A"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u0628\u06CE\u062A"},array:{unit:"\u062F\u0627\u0646\u06D5",verb:"\u0628\u06CE\u062A"},set:{unit:"\u062F\u0627\u0646\u06D5",verb:"\u0628\u06CE\u062A"},map:{unit:"\u062F\u0627\u0646\u06D5",verb:"\u0628\u06CE\u062A"}};function t(r){return e[r]??null}let n={regex:"regex",email:"\u0626\u06CC\u0645\u06D5\u06CC\u06B5",url:"\u0628\u06D5\u0633\u062A\u06D5\u0631 (URL)",emoji:"\u0626\u06CC\u0645\u06C6\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0695\u06CE\u06A9\u06D5\u0648\u062A \u0648 \u06A9\u0627\u062A",date:"\u0695\u06CE\u06A9\u06D5\u0648\u062A",time:"\u06A9\u0627\u062A",duration:"\u0645\u0627\u0648\u06D5",ipv4:"\u0646\u0627\u0648\u0646\u06CC\u0634\u0627\u0646\u06CC IPv4",ipv6:"\u0646\u0627\u0648\u0646\u06CC\u0634\u0627\u0646\u06CC IPv6",mac:"\u0646\u0627\u0648\u0646\u06CC\u0634\u0627\u0646\u06CC MAC",cidrv4:"\u0645\u06D5\u0648\u062F\u0627\u06CC IPv4",cidrv6:"\u0645\u06D5\u0648\u062F\u0627\u06CC IPv6",base64:"\u062F\u06D5\u0642\u06CC base64",base64url:"\u062F\u06D5\u0642\u06CC base64url",json_string:"\u062F\u06D5\u0642\u06CC JSON",e164:"\u0698\u0645\u0627\u0631\u06D5\u06CC E.164",credit_card:"\u0698\u0645\u0627\u0631\u06D5\u06CC \u06A9\u0627\u0631\u062A\u06CC \u06A9\u0631\u06CE\u062F\u06CC\u062A",currency_code:"\u06A9\u06C6\u062F\u06CC \u062F\u0631\u0627\u0648",iban:"IBAN",jwt:"JWT",template_literal:"\u062A\u06CE\u06A9\u0631\u062F\u06D5"},i={nan:"NaN",string:"\u0646\u0648\u0648\u0633\u06CC\u0646",number:"\u0698\u0645\u0627\u0631\u06D5",boolean:"boolean",array:"array",object:"object",date:"\u0695\u06CE\u06A9\u06D5\u0648\u062A",integer:"\u0698\u0645\u0627\u0631\u06D5",float:"\u0698\u0645\u0627\u0631\u06D5",null:"null",undefined:"undefined",function:"function",symbol:"symbol",unknown:"unknown",promise:"promise",void:"void",never:"never",map:"map",set:"set"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,a=Z(r.input),s=i[a]??a,c=["\u0627","\u0648","\u06C6","\u0648\u0648","\u06D5","\u06CC","\u06CE"].some(u=>s.endsWith(u))?"\u06CC\u06D5":"\u06D5",l=/^[a-zA-Z]+$/.test(s);return a==="null"||a==="undefined"?"\u062F\u0627\u0648\u0627\u06A9\u0631\u0627\u0648\u06D5":`\u0686\u0627\u0648\u06D5\u0695\u0648\u0627\u0646\u06A9\u0631\u0627\u0648\u06D5 ${o} \u0628\u06CE\u062A\u060C \u0628\u06D5\u06B5\u0627\u0645 ${s}${l?"":c}`}case"invalid_value":return r.values.length===1?`\u0628\u06D5\u0647\u0627\u06A9\u06D5 \u0646\u0627\u062F\u0631\u0648\u0648\u0633\u062A\u06D5: \u0686\u0627\u0648\u06D5\u0695\u0648\u0627\u0646\u06A9\u0631\u0627\u0648\u06D5 ${U(r.values[0])} \u0628\u06CE\u062A`:`\u0647\u06D5\u06B5\u0628\u0698\u0627\u0631\u062F\u06D5\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A: \u0686\u0627\u0648\u06D5\u0695\u0648\u0627\u0646\u06A9\u0631\u0627\u0648\u06D5 \u06CC\u06D5\u06A9\u06CE\u06A9 \u0628\u06CE\u062A \u0644\u06D5 ${O(r.values,"|")}`;case"too_big":{let o=t(r.origin);return o?`\u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 \u0628\u06D5 \u0644\u0627\u06CC\u06D5\u0646\u06CC \u0632\u06C6\u0631\u06D5\u0648\u06D5 ${r.maximum.toString()} ${o.unit} ${o.verb}`:`\u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 \u0628\u06D5 \u0644\u0627\u06CC\u06D5\u0646\u06CC \u0632\u06C6\u0631\u06D5\u0648\u06D5 ${r.maximum.toString()} \u0628\u06CE\u062A`}case"too_small":{let o=t(r.origin);return o?`\u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 \u0628\u06D5 \u0644\u0627\u06CC\u06D5\u0646\u06CC \u06A9\u06D5\u0645\u06D5\u0648\u06D5 ${r.minimum.toString()} ${o.unit} ${o.verb}`:`\u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 \u0628\u06D5 \u0644\u0627\u06CC\u06D5\u0646\u06CC \u06A9\u06D5\u0645\u06D5\u0648\u06D5 ${r.minimum.toString()} \u0628\u06CE\u062A`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u062F\u06D5\u0642\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A: \u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 \u062F\u06D5\u0633\u062A\u067E\u06CE\u0628\u06A9\u0627\u062A \u0628\u06D5 "${o.prefix}"`:o.format==="ends_with"?`\u062F\u06D5\u0642\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A: \u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 \u06A9\u06C6\u062A\u0627\u06CC\u06CC\u0628\u06CE\u062A \u0628\u06D5 "${o.suffix}"`:o.format==="includes"?`\u062F\u06D5\u0642\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A: \u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 "${o.includes}" \u0644\u06D5\u062E\u06C6\u0628\u06AF\u0631\u06CE\u062A`:o.format==="regex"?`\u062F\u06D5\u0642\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A: \u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 \u0644\u06D5\u06AF\u06D5\u06B5 \u067E\u0627\u062A\u06CE\u0631\u0646\u06CC ${o.pattern} \u0628\u06AF\u0648\u0646\u062C\u06CE\u062A`:`\u0628\u06D5\u0647\u0627\u06CC ${n[o.format]??r.format} \u0646\u0627\u062F\u0631\u0648\u0633\u062A\u06D5`}case"not_multiple_of":return`\u0698\u0645\u0627\u0631\u06D5\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A: \u062F\u06D5\u0628\u06CE\u062A \u0686\u06D5\u0646\u062F \u0647\u06CE\u0646\u062F\u06D5 \u0628\u06CE\u062A \u0628\u06C6 ${r.divisor}`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u0644\u06CC \u0646\u06D5\u0646\u0627\u0633\u0631\u0627\u0648: ${O(r.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u0644\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A \u0644\u06D5 ${r.origin}`;case"invalid_union":return r.options&&Array.isArray(r.options)&&r.options.length>0?`\u0628\u06D5\u0647\u0627\u06CC \u0646\u06D5\u0646\u0627\u0633\u0631\u0627\u0648 \u0647\u06D5\u06CC\u06D5. \u0628\u06D5\u0647\u0627\u06CC \u0686\u0627\u0648\u06D5\u0695\u0648\u0627\u0646\u06A9\u0631\u0627\u0648: ${r.options.map(a=>`'${a}'`).join(" | ")}`:"\u06CC\u06D5\u06A9\u06AF\u0631\u062A\u0646\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A";case"invalid_element":return`${r.origin} \u0628\u06D5\u0647\u0627\u06A9\u06D5 \u0646\u0627\u062F\u0631\u0648\u0633\u062A\u06D5`;default:return"\u062A\u06CE\u06A9\u0631\u062F\u06D5\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A"}}};function uS(){return{localeError:_D()}}var bD=()=>{let e={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"},map:{unit:"prvk\u016F",verb:"m\xEDt"}};function t(r){return e[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",mac:"MAC 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",credit_card:"\u010D\xEDslo kreditn\xED karty",currency_code:"k\xF3d m\u011Bny",iban:"IBAN",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,a=Z(r.input),s=i[a]??a;return/^[A-Z]/.test(r.expected)?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${r.expected}, obdr\u017Eeno ${s}`:`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${o}, obdr\u017Eeno ${s}`}case"invalid_value":return r.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${U(r.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${O(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);return a?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${r.origin??"hodnota"} mus\xED m\xEDt ${o}${r.maximum.toString()} ${a.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?">=":">",a=t(r.origin);return a?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${r.origin??"hodnota"} mus\xED m\xEDt ${o}${r.minimum.toString()} ${a.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: ${O(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 dS(){return{localeError:bD()}}var $D=()=>{let e={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"},map:{unit:"elementer",verb:"indeholdt"}};function t(r){return e[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-adresse",ipv6:"IPv6-adresse",mac:"MAC-adresse",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",credit_card:"kreditkortnummer",currency_code:"valutakode",iban:"IBAN",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,a=Z(r.input),s=i[a]??a;return/^[A-Z]/.test(r.expected)?`Ugyldigt input: forventede instanceof ${r.expected}, fik ${s}`:`Ugyldigt input: forventede ${o}, fik ${s}`}case"invalid_value":return r.values.length===1?`Ugyldig v\xE6rdi: forventede ${U(r.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${O(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin),s=i[r.origin]??r.origin;return a?`For stor: forventede ${s??"value"} ${a.verb} ${o} ${r.maximum.toString()} ${a.unit??"elementer"}`:`For stor: forventede ${s??"value"} havde ${o} ${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",a=t(r.origin),s=i[r.origin]??r.origin;return a?`For lille: forventede ${s} ${a.verb} ${o} ${r.minimum.toString()} ${a.unit}`:`For lille: forventede ${s} 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"}: ${O(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 pS(){return{localeError:$D()}}var wD=()=>{let e={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"},map:{unit:"Elemente",verb:"zu haben"}};function t(r){return e[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",mac:"MAC-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",credit_card:"Kreditkartennummer",currency_code:"W\xE4hrungscode",iban:"IBAN",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,a=Z(r.input),s=i[a]??a;return/^[A-Z]/.test(r.expected)?`Ung\xFCltige Eingabe: erwartet instanceof ${r.expected}, erhalten ${s}`:`Ung\xFCltige Eingabe: erwartet ${o}, erhalten ${s}`}case"invalid_value":return r.values.length===1?`Ung\xFCltige Eingabe: erwartet ${U(r.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${O(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);return a?`Zu gro\xDF: erwartet, dass ${r.origin??"Wert"} ${o}${r.maximum.toString()} ${a.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${r.origin??"Wert"} ${o}${r.maximum.toString()} ist`}case"too_small":{let o=r.inclusive?">=":">",a=t(r.origin);return a?`Zu klein: erwartet, dass ${r.origin} ${o}${r.minimum.toString()} ${a.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"}: ${O(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 mS(){return{localeError:wD()}}var kD=()=>{let e={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 t(r){return e[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",credit_card:"\u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2 \u03C0\u03B9\u03C3\u03C4\u03C9\u03C4\u03B9\u03BA\u03AE\u03C2 \u03BA\u03AC\u03C1\u03C4\u03B1\u03C2",currency_code:"\u03BA\u03C9\u03B4\u03B9\u03BA\u03CC\u03C2 \u03BD\u03BF\u03BC\u03AF\u03C3\u03BC\u03B1\u03C4\u03BF\u03C2",iban:"IBAN",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,a=Z(r.input),s=i[a]??a;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 ${s}`:`\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 ${s}`}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 ${U(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 ${O(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);return a?`\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()} ${a.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?">=":">",a=t(r.origin);return a?`\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()} ${a.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"}: ${O(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 fS(){return{localeError:kD()}}var xD=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(o){return e[o]??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",currency_code:"currency code",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},i={nan:"NaN"};function r(o,a){return o==="number"&&typeof a=="number"&&!Number.isFinite(a)?String(a):i[o]??o}return o=>{switch(o.code){case"invalid_type":{let a=r(o.expected),s=Z(o.input),c=r(s,o.input);return`Invalid input: expected ${a}, received ${c}`}case"invalid_value":return o.values.length===1?`Invalid input: expected ${U(o.values[0])}`:`Invalid option: expected one of ${O(o.values,"|")}`;case"too_big":{let a=o.exact?"exactly ":o.inclusive?"<=":"<",s=t(o.origin);return s?`Too big: expected ${o.origin??"value"} to have ${a}${o.maximum.toString()} ${s.unit??"elements"}`:`Too big: expected ${o.origin??"value"} to be ${a}${o.maximum.toString()}`}case"too_small":{let a=o.exact?"exactly ":o.inclusive?">=":">",s=t(o.origin);return s?`Too small: expected ${o.origin} to have ${a}${o.minimum.toString()} ${s.unit}`:`Too small: expected ${o.origin} to be ${a}${o.minimum.toString()}`}case"invalid_format":{let a=o;return a.format==="starts_with"?`Invalid string: must start with "${a.prefix}"`:a.format==="ends_with"?`Invalid string: must end with "${a.suffix}"`:a.format==="includes"?`Invalid string: must include "${a.includes}"`:a.format==="regex"?`Invalid string: must match pattern ${a.pattern}`:`Invalid ${n[a.format]??o.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${o.divisor}`;case"unrecognized_keys":return`Unrecognized key${o.keys.length>1?"s":""}: ${O(o.keys,", ")}`;case"invalid_key":return`Invalid key in ${o.origin}`;case"invalid_union":return o.options&&Array.isArray(o.options)&&o.options.length>0?`Invalid discriminator value. Expected ${o.options.map(s=>`'${s}'`).join(" | ")}`:o.inclusive===!1?"Invalid input: more than one option matched":"Invalid input";case"invalid_element":return`Invalid value in ${o.origin}`;default:return"Invalid input"}}};function lp(){return{localeError:xD()}}var SD=()=>{let e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"},map:{unit:"elementojn",verb:"havi"}};function t(r){return e[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",mac:"MAC-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",credit_card:"kreditkarta numero",currency_code:"valuta kodo",iban:"IBAN",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,a=Z(r.input),s=i[a]??a;return/^[A-Z]/.test(r.expected)?`Nevalida enigo: atendi\u011Dis instanceof ${r.expected}, ricevi\u011Dis ${s}`:`Nevalida enigo: atendi\u011Dis ${o}, ricevi\u011Dis ${s}`}case"invalid_value":return r.values.length===1?`Nevalida enigo: atendi\u011Dis ${U(r.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${O(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);return a?`Tro granda: atendi\u011Dis ke ${r.origin??"valoro"} havu ${o}${r.maximum.toString()} ${a.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${r.origin??"valoro"} havu ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",a=t(r.origin);return a?`Tro malgranda: atendi\u011Dis ke ${r.origin} havu ${o}${r.minimum.toString()} ${a.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":""}: ${O(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 hS(){return{localeError:SD()}}var ID=()=>{let e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function t(r){return e[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",mac:"direcci\xF3n MAC",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",credit_card:"n\xFAmero de tarjeta de cr\xE9dito",currency_code:"c\xF3digo de moneda",iban:"IBAN",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,a=Z(r.input),s=i[a]??a;return/^[A-Z]/.test(r.expected)?`Entrada inv\xE1lida: se esperaba instanceof ${r.expected}, recibido ${s}`:`Entrada inv\xE1lida: se esperaba ${o}, recibido ${s}`}case"invalid_value":return r.values.length===1?`Entrada inv\xE1lida: se esperaba ${U(r.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${O(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin),s=i[r.origin]??r.origin;return a?`Demasiado grande: se esperaba que ${s??"valor"} tuviera ${o}${r.maximum.toString()} ${a.unit??"elementos"}`:`Demasiado grande: se esperaba que ${s??"valor"} fuera ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",a=t(r.origin),s=i[r.origin]??r.origin;return a?`Demasiado peque\xF1o: se esperaba que ${s} tuviera ${o}${r.minimum.toString()} ${a.unit}`:`Demasiado peque\xF1o: se esperaba que ${s} 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":""}: ${O(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 gS(){return{localeError:ID()}}var TD=()=>{let e={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"},map:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function t(r){return e[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",mac:"MAC \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",credit_card:"\u0634\u0645\u0627\u0631\u0647 \u06A9\u0627\u0631\u062A \u0627\u0639\u062A\u0628\u0627\u0631\u06CC",currency_code:"\u06A9\u062F \u0627\u0631\u0632",iban:"IBAN",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,a=Z(r.input),s=i[a]??a;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 ${s} \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 ${s} \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 ${U(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 ${O(r.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);return a?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${r.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${o}${r.maximum.toString()} ${a.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?">=":">",a=t(r.origin);return a?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${r.origin} \u0628\u0627\u06CC\u062F ${o}${r.minimum.toString()} ${a.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: ${O(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 vS(){return{localeError:TD()}}var zD=()=>{let e={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},map:{unit:"alkiota",subject:"kuvauksen"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xE4iv\xE4m\xE4\xE4r\xE4n"}};function t(r){return e[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",mac:"MAC-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",credit_card:"luottokortin numero",currency_code:"valuuttakoodi",iban:"IBAN",jwt:"JWT",template_literal:"templaattimerkkijono"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,a=Z(r.input),s=i[a]??a;return/^[A-Z]/.test(r.expected)?`Virheellinen tyyppi: odotettiin instanceof ${r.expected}, oli ${s}`:`Virheellinen tyyppi: odotettiin ${o}, oli ${s}`}case"invalid_value":return r.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${U(r.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${O(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);return a?`Liian suuri: ${a.subject} t\xE4ytyy olla ${o}${r.maximum.toString()} ${a.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",a=t(r.origin);return a?`Liian pieni: ${a.subject} t\xE4ytyy olla ${o}${r.minimum.toString()} ${a.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"}: ${O(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 yS(){return{localeError:zD()}}var PD=()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(r){return e[r]??null}let n={regex:"expression r\xE9guli\xE8re",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",mac:"adresse MAC",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne de caract\xE8res encod\xE9e en base64",base64url:"cha\xEEne de caract\xE8res encod\xE9e en base64url",json_string:"cha\xEEne de caract\xE8res JSON",e164:"num\xE9ro au format E.164",credit_card:"num\xE9ro de carte de cr\xE9dit",currency_code:"code de devise",iban:"IBAN",jwt:"JWT",template_literal:"entr\xE9e"},i={string:"cha\xEEne de caract\xE8res",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:"record",map:"map",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,a=Z(r.input),s=i[a]??a;return/^[A-Z]/.test(r.expected)?`Entr\xE9e invalide : instance de ${r.expected} attendu, ${s} re\xE7u`:`Entr\xE9e invalide : ${o} attendu, ${s} re\xE7u`}case"invalid_value":return r.values.length===1?`Entr\xE9e invalide : ${U(r.values[0])} attendu`:`Option invalide : une valeur parmi ${O(r.values,"|")} attendue`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);return a?`Trop grand : ${i[r.origin]??"valeur"} doit ${a.verb} ${o}${r.maximum.toString()} ${a.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${i[r.origin]??"valeur"} doit \xEAtre ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",a=t(r.origin);return a?`Trop petit : ${i[r.origin]??"valeur"} doit ${a.verb} ${o}${r.minimum.toString()} ${a.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 de caract\xE8res invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Cha\xEEne de caract\xE8res invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Cha\xEEne de caract\xE8res invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Cha\xEEne de caract\xE8res 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":""} : ${O(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 _S(){return{localeError:PD()}}var ED=()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"},map:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(r){return e[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",mac:"adresse MAC",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",credit_card:"num\xE9ro de carte de cr\xE9dit",currency_code:"code de devise",iban:"IBAN",jwt:"JWT",template_literal:"entr\xE9e"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,a=Z(r.input),s=i[a]??a;return/^[A-Z]/.test(r.expected)?`Entr\xE9e invalide : attendu instanceof ${r.expected}, re\xE7u ${s}`:`Entr\xE9e invalide : attendu ${o}, re\xE7u ${s}`}case"invalid_value":return r.values.length===1?`Entr\xE9e invalide : attendu ${U(r.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${O(r.values,"|")}`;case"too_big":{let o=r.inclusive?"\u2264":"<",a=t(r.origin);return a?`Trop grand : attendu que ${r.origin??"la valeur"} ait ${o}${r.maximum.toString()} ${a.unit}`:`Trop grand : attendu que ${r.origin??"la valeur"} soit ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?"\u2265":">",a=t(r.origin);return a?`Trop petit : attendu que ${r.origin} ait ${o}${r.minimum.toString()} ${a.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":""} : ${O(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 bS(){return{localeError:ED()}}var OD=()=>{let e={string:{unit:"\u0A85\u0A95\u0ACD\u0AB7\u0AB0",verb:"\u0AB9\u0ACB\u0AB5\u0ABE \u0A9C\u0ACB\u0A88\u0A8F"},file:{unit:"\u0AAC\u0ABE\u0AAF\u0A9F",verb:"\u0AB9\u0ACB\u0AB5\u0ABE \u0A9C\u0ACB\u0A88\u0A8F"},array:{unit:"\u0A86\u0A87\u0A9F\u0AAE",verb:"\u0AB9\u0ACB\u0AB5\u0ABE \u0A9C\u0ACB\u0A88\u0A8F"},set:{unit:"\u0A86\u0A87\u0A9F\u0AAE",verb:"\u0AB9\u0ACB\u0AB5\u0ABE \u0A9C\u0ACB\u0A88\u0A8F"},map:{unit:"\u0A8F\u0AA8\u0ACD\u0A9F\u0ACD\u0AB0\u0AC0",verb:"\u0AB9\u0ACB\u0AB5\u0ABE \u0A9C\u0ACB\u0A88\u0A8F"}};function t(r){return e[r]??null}let n={regex:"\u0A87\u0AA8\u0AAA\u0AC1\u0A9F",email:"\u0A88\u0AAE\u0AC7\u0A87\u0AB2 \u0A8F\u0AA1\u0ACD\u0AB0\u0AC7\u0AB8",url:"URL",emoji:"\u0A87\u0AAE\u0ACB\u0A9C\u0AC0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0AA4\u0ABE\u0AB0\u0AC0\u0A96 \u0A85\u0AA8\u0AC7 \u0AB8\u0AAE\u0AAF",date:"ISO \u0AA4\u0ABE\u0AB0\u0AC0\u0A96",time:"ISO \u0AB8\u0AAE\u0AAF",duration:"ISO \u0A85\u0AB5\u0AA7\u0ABF",ipv4:"IPv4 \u0A8F\u0AA1\u0ACD\u0AB0\u0AC7\u0AB8",ipv6:"IPv6 \u0A8F\u0AA1\u0ACD\u0AB0\u0AC7\u0AB8",mac:"MAC \u0A8F\u0AA1\u0ACD\u0AB0\u0AC7\u0AB8",cidrv4:"IPv4 \u0AB6\u0ACD\u0AB0\u0AC7\u0AA3\u0AC0",cidrv6:"IPv6 \u0AB6\u0ACD\u0AB0\u0AC7\u0AA3\u0AC0",base64:"base64-\u0A8F\u0AA8\u0ACD\u0A95\u0ACB\u0AA1\u0AC7\u0AA1 \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97",base64url:"base64url-\u0A8F\u0AA8\u0ACD\u0A95\u0ACB\u0AA1\u0AC7\u0AA1 \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97",json_string:"JSON \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97",e164:"E.164 \u0AA8\u0A82\u0AAC\u0AB0",credit_card:"\u0A95\u0ACD\u0AB0\u0AC7\u0AA1\u0ABF\u0A9F \u0A95\u0ABE\u0AB0\u0ACD\u0AA1 \u0AA8\u0A82\u0AAC\u0AB0",currency_code:"\u0A9A\u0AB2\u0AA3 \u0A95\u0ACB\u0AA1",iban:"IBAN",jwt:"JWT",template_literal:"\u0A87\u0AA8\u0AAA\u0AC1\u0A9F"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,a=Z(r.input),s=i[a]??a;return`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0A87\u0AA8\u0AAA\u0AC1\u0A9F: \u0A85\u0AAA\u0AC7\u0A95\u0ACD\u0AB7\u0ABF\u0AA4 ${o}, \u0AAA\u0ACD\u0AB0\u0ABE\u0AAA\u0ACD\u0AA4 ${s}`}case"invalid_value":return r.values.length===1?`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0A87\u0AA8\u0AAA\u0AC1\u0A9F: \u0A85\u0AAA\u0AC7\u0A95\u0ACD\u0AB7\u0ABF\u0AA4 ${U(r.values[0])}`:`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AB5\u0ABF\u0A95\u0AB2\u0ACD\u0AAA: ${O(r.values," | ")} \u0AAE\u0ABE\u0AA7\u0ACD\u0AAF\u0AAE\u0AA5\u0AC0 \u0A8F\u0A95 \u0A85\u0AAA\u0AC7\u0A95\u0ACD\u0AB7\u0ABF\u0AA4`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);return a?`\u0A96\u0AC2\u0AAC \u0AAE\u0ACB\u0A9F\u0AC1\u0A82: ${r.origin??"\u0AAE\u0AC2\u0AB2\u0ACD\u0AAF"} ${o}${r.maximum.toString()} ${a.unit??"\u0A8F\u0AB2\u0ABF\u0AAE\u0AC7\u0AA8\u0ACD\u0A9F"} \u0AB9\u0ACB\u0AB5\u0ABE \u0A9C\u0ACB\u0A88\u0A8F`:`\u0A96\u0AC2\u0AAC \u0AAE\u0ACB\u0A9F\u0AC1\u0A82: ${r.origin??"\u0AAE\u0AC2\u0AB2\u0ACD\u0AAF"} ${o}${r.maximum.toString()} \u0AB9\u0ACB\u0AB5\u0AC1\u0A82 \u0A9C\u0ACB\u0A88\u0A8F`}case"too_small":{let o=r.inclusive?">=":">",a=t(r.origin);return a?`\u0A96\u0AC2\u0AAC \u0AA8\u0ABE\u0AA8\u0AC1\u0A82: ${r.origin} ${o}${r.minimum.toString()} ${a.unit} \u0AB9\u0ACB\u0AB5\u0ABE \u0A9C\u0ACB\u0A88\u0A8F`:`\u0A96\u0AC2\u0AAC \u0AA8\u0ABE\u0AA8\u0AC1\u0A82: ${r.origin} ${o}${r.minimum.toString()} \u0AB9\u0ACB\u0AB5\u0AC1\u0A82 \u0A9C\u0ACB\u0A88\u0A8F`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97: "${o.prefix}" \u0AA5\u0AC0 \u0AB6\u0AB0\u0AC2 \u0AA5\u0AB5\u0AC1\u0A82 \u0A9C\u0ACB\u0A88\u0A8F`:o.format==="ends_with"?`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97: "${o.suffix}" \u0AAA\u0AB0 \u0AB8\u0AAE\u0ABE\u0AAA\u0ACD\u0AA4 \u0AA5\u0AB5\u0AC1\u0A82 \u0A9C\u0ACB\u0A88\u0A8F`:o.format==="includes"?`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97: "${o.includes}" \u0AB6\u0ABE\u0AAE\u0AC7\u0AB2 \u0AB9\u0ACB\u0AB5\u0AC1\u0A82 \u0A9C\u0ACB\u0A88\u0A8F`:o.format==="regex"?`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97: \u0AAA\u0AC7\u0A9F\u0AB0\u0ACD\u0AA8 ${o.pattern} \u0AB8\u0ABE\u0AA5\u0AC7 \u0AAE\u0AC7\u0AB3 \u0A96\u0ABE\u0AB5\u0AC1\u0A82 \u0A9C\u0ACB\u0A88\u0A8F`:`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF ${n[o.format]??r.format}`}case"not_multiple_of":return`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AA8\u0A82\u0AAC\u0AB0: ${r.divisor} \u0AA8\u0ACB \u0A97\u0AC1\u0AA3\u0ABE\u0A82\u0A95 \u0AB9\u0ACB\u0AB5\u0ACB \u0A9C\u0ACB\u0A88\u0A8F`;case"unrecognized_keys":return`\u0A93\u0AB3\u0A96\u0AC0 \u0AB6\u0A95\u0ABE\u0AA4\u0ABE \u0AA8\u0AB9\u0AC0\u0A82 \u0AA4\u0AC7 \u0A95\u0AC0${r.keys.length>1?"\u0A93":""}: ${O(r.keys,", ")}`;case"invalid_key":return`${r.origin} \u0AAE\u0ABE\u0A82 \u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0A95\u0AC0`;case"invalid_union":return r.options&&Array.isArray(r.options)&&r.options.length>0?`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AA1\u0ABF\u0AB8\u0ACD\u0A95\u0ACD\u0AB0\u0ABF\u0AAE\u0ABF\u0AA8\u0AC7\u0A9F\u0AB0 \u0AAE\u0AC2\u0AB2\u0ACD\u0AAF. \u0A85\u0AAA\u0AC7\u0A95\u0ACD\u0AB7\u0ABF\u0AA4 ${r.options.map(a=>`'${a}'`).join(" | ")}`:"\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0A87\u0AA8\u0AAA\u0AC1\u0A9F";case"invalid_element":return`${r.origin} \u0AAE\u0ABE\u0A82 \u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AAE\u0AC2\u0AB2\u0ACD\u0AAF`;default:return"\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0A87\u0AA8\u0AAA\u0AC1\u0A9F"}}};function $S(){return{localeError:OD()}}var jD=()=>{let e={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"}},t={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?e[l]:void 0,i=l=>{let u=n(l);return u?u.label:l??e.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",a=l=>l?t[l]??null:null,s={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"},uuidv4:{label:"UUIDv4",gender:"m"},uuidv6:{label:"UUIDv6",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"},mac:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA MAC",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"},credit_card:{label:"\u05DE\u05E1\u05E4\u05E8 \u05DB\u05E8\u05D8\u05D9\u05E1 \u05D0\u05E9\u05E8\u05D0\u05D9",gender:"m"},currency_code:{label:"\u05E7\u05D5\u05D3 \u05DE\u05D8\u05D1\u05E2",gender:"m"},iban:{label:"IBAN",gender:"m"},jwt:{label:"JWT",gender:"m"},template_literal:{label:"\u05E7\u05DC\u05D8",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"}},c={nan:"NaN"};return l=>{switch(l.code){case"invalid_type":{let u=l.expected,p=c[u??""]??i(u),h=Z(l.input),g=c[h]??e[h]?.label??h;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 ${g}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${p}, \u05D4\u05EA\u05E7\u05D1\u05DC ${g}`}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 ${U(l.values[0])}`;let u=l.values.map(g=>U(g));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 ${u[0]} \u05D0\u05D5 ${u[1]}`;let p=u[u.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 ${u.slice(0,-1).join(", ")} \u05D0\u05D5 ${p}`}case"too_big":{let u=a(l.origin),p=r(l.origin??"value");if(l.origin==="string")return`${u?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${l.maximum.toString()} ${u?.unit??""} ${l.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(l.origin==="number"){let _=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: ${p} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${_}`}if(l.origin==="array"||l.origin==="set"){let _=l.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",k=l.inclusive?`${l.maximum} ${u?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${l.maximum} ${u?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${p} ${_} \u05DC\u05D4\u05DB\u05D9\u05DC ${k}`.trim()}let h=l.inclusive?"<=":"<",g=o(l.origin??"value");return u?.unit?`${u.longLabel} \u05DE\u05D3\u05D9: ${p} ${g} ${h}${l.maximum.toString()} ${u.unit}`:`${u?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${p} ${g} ${h}${l.maximum.toString()}`}case"too_small":{let u=a(l.origin),p=r(l.origin??"value");if(l.origin==="string")return`${u?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${l.minimum.toString()} ${u?.unit??""} ${l.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(l.origin==="number"){let _=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: ${p} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${_}`}if(l.origin==="array"||l.origin==="set"){let _=l.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(l.minimum===1&&l.inclusive){let T=(l.origin==="set","\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${p} ${_} \u05DC\u05D4\u05DB\u05D9\u05DC ${T}`}let k=l.inclusive?`${l.minimum} ${u?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${l.minimum} ${u?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${p} ${_} \u05DC\u05D4\u05DB\u05D9\u05DC ${k}`.trim()}let h=l.inclusive?">=":">",g=o(l.origin??"value");return u?.unit?`${u.shortLabel} \u05DE\u05D3\u05D9: ${p} ${g} ${h}${l.minimum.toString()} ${u.unit}`:`${u?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${p} ${g} ${h}${l.minimum.toString()}`}case"invalid_format":{let u=l;if(u.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${u.prefix}"`;if(u.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${u.suffix}"`;if(u.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${u.includes}"`;if(u.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 ${u.pattern}`;let p=s[u.format],h=p?.label??u.format,_=(p?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${h} \u05DC\u05D0 ${_}`}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"}: ${O(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 wS(){return{localeError:jD()}}var RD=()=>{let e={string:{unit:"\u0905\u0915\u094D\u0937\u0930",verb:"\u0930\u0916\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F"},file:{unit:"\u092C\u093E\u0907\u091F\u094D\u0938",verb:"\u0930\u0916\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F"},array:{unit:"\u0924\u0924\u094D\u0935",verb:"\u0930\u0916\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F"},set:{unit:"\u0924\u0924\u094D\u0935",verb:"\u0930\u0916\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F"},map:{unit:"\u092A\u094D\u0930\u0935\u093F\u0937\u094D\u091F\u093F\u092F\u093E\u0901",verb:"\u0930\u0916\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F"}};function t(r){return e[r]??null}let n={regex:"\u0907\u0928\u092A\u0941\u091F",email:"\u0908\u092E\u0947\u0932 \u092A\u0924\u093E",url:"URL",emoji:"\u0907\u092E\u094B\u091C\u0940",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0924\u093F\u0925\u093F \u0914\u0930 \u0938\u092E\u092F",date:"ISO \u0924\u093F\u0925\u093F",time:"ISO \u0938\u092E\u092F",duration:"ISO \u0905\u0935\u0927\u093F",ipv4:"IPv4 \u092A\u0924\u093E",ipv6:"IPv6 \u092A\u0924\u093E",mac:"MAC \u092A\u0924\u093E",cidrv4:"IPv4 \u0936\u094D\u0930\u0947\u0923\u0940",cidrv6:"IPv6 \u0936\u094D\u0930\u0947\u0923\u0940",base64:"Base64-\u090F\u0928\u094D\u0915\u094B\u0921\u0947\u0921 \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917",base64url:"Base64URL-\u090F\u0928\u094D\u0915\u094B\u0921\u0947\u0921 \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917",json_string:"JSON \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917",e164:"E.164 \u0938\u0902\u0916\u094D\u092F\u093E",credit_card:"\u0915\u094D\u0930\u0947\u0921\u093F\u091F \u0915\u093E\u0930\u094D\u0921 \u0938\u0902\u0916\u094D\u092F\u093E",currency_code:"\u092E\u0941\u0926\u094D\u0930\u093E \u0915\u094B\u0921",iban:"IBAN",jwt:"JWT",template_literal:"\u0907\u0928\u092A\u0941\u091F"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,a=Z(r.input),s=i[a]??a;return`\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 ${o}, \u092A\u094D\u0930\u093E\u092A\u094D\u0924 ${s}`}case"invalid_value":return r.values.length===1?`\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 ${U(r.values[0])}`:`\u0905\u092E\u093E\u0928\u094D\u092F \u0935\u093F\u0915\u0932\u094D\u092A: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 \u092E\u093E\u0928\u094B\u0902 \u092E\u0947\u0902 \u0938\u0947 \u090F\u0915 ${O(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);return a?`\u092C\u0939\u0941\u0924 \u092C\u0921\u093C\u093E: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 \u0925\u093E \u0915\u093F ${r.origin??"\u092E\u093E\u0928"} \u092E\u0947\u0902 ${o}${r.maximum} ${a.unit} \u0939\u094B\u0902`:`\u092C\u0939\u0941\u0924 \u092C\u0921\u093C\u093E: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 \u0925\u093E \u0915\u093F ${r.origin??"\u092E\u093E\u0928"} ${o}${r.maximum} \u0939\u094B`}case"too_small":{let o=r.inclusive?">=":">",a=t(r.origin);return a?`\u092C\u0939\u0941\u0924 \u091B\u094B\u091F\u093E: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 \u0925\u093E \u0915\u093F ${r.origin} \u092E\u0947\u0902 ${o}${r.minimum} ${a.unit} \u0939\u094B\u0902`:`\u092C\u0939\u0941\u0924 \u091B\u094B\u091F\u093E: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 \u0925\u093E \u0915\u093F ${r.origin} ${o}${r.minimum} \u0939\u094B`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917: "${o.prefix}" \u0938\u0947 \u0936\u0941\u0930\u0942 \u0939\u094B\u0928\u093E \u091A\u093E\u0939\u093F\u090F`:o.format==="ends_with"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917: "${o.suffix}" \u092A\u0930 \u0938\u092E\u093E\u092A\u094D\u0924 \u0939\u094B\u0928\u093E \u091A\u093E\u0939\u093F\u090F`:o.format==="includes"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917: \u0907\u0938\u092E\u0947\u0902 "${o.includes}" \u0936\u093E\u092E\u093F\u0932 \u0939\u094B\u0928\u093E \u091A\u093E\u0939\u093F\u090F`:o.format==="regex"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917: \u092A\u0948\u091F\u0930\u094D\u0928 ${o.pattern} \u0938\u0947 \u092E\u0947\u0932 \u0916\u093E\u0928\u093E \u091A\u093E\u0939\u093F\u090F`:`\u0905\u092E\u093E\u0928\u094D\u092F ${n[o.format]??r.format}`}case"not_multiple_of":return`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u0902\u0916\u094D\u092F\u093E: \u092F\u0939 ${r.divisor} \u0915\u093E \u0917\u0941\u0923\u091C \u0939\u094B\u0928\u093E \u091A\u093E\u0939\u093F\u090F`;case"unrecognized_keys":return`\u0905\u092A\u0930\u093F\u091A\u093F\u0924 \u0915\u0941\u0902\u091C\u0940${r.keys.length>1?"\u092F\u093E\u0901":""}: ${O(r.keys,", ")}`;case"invalid_key":return`\u0905\u092E\u093E\u0928\u094D\u092F \u0915\u0941\u0902\u091C\u0940: ${r.origin} \u092E\u0947\u0902`;case"invalid_union":return r.options&&Array.isArray(r.options)&&r.options.length>0?`\u0905\u092E\u093E\u0928\u094D\u092F \u0921\u093F\u0938\u094D\u0915\u094D\u0930\u093F\u092E\u093F\u0928\u0947\u091F\u0930 \u092E\u093E\u0928: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 ${r.options.map(a=>`'${a}'`).join(" | ")}`:"\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F";case"invalid_element":return`\u0905\u092E\u093E\u0928\u094D\u092F \u092E\u093E\u0928: ${r.origin} \u092E\u0947\u0902`;default:return"\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F"}}};function kS(){return{localeError:RD()}}var DD=()=>{let e={string:{unit:"znakova",verb:"imati"},file:{unit:"bajtova",verb:"imati"},array:{unit:"stavki",verb:"imati"},set:{unit:"stavki",verb:"imati"}};function t(r){return e[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",mac:"MAC adresa",cidrv4:"IPv4 raspon",cidrv6:"IPv6 raspon",base64:"base64 kodirani tekst",base64url:"base64url kodirani tekst",json_string:"JSON tekst",e164:"E.164 broj",credit_card:"broj kreditne kartice",currency_code:"kod valute",iban:"IBAN",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,a=Z(r.input),s=i[a]??a;return/^[A-Z]/.test(r.expected)?`Neispravan unos: o\u010Dekuje se instanceof ${r.expected}, a primljeno je ${s}`:`Neispravan unos: o\u010Dekuje se ${o}, a primljeno je ${s}`}case"invalid_value":return r.values.length===1?`Neispravna vrijednost: o\u010Dekivano ${U(r.values[0])}`:`Neispravna opcija: o\u010Dekivano jedno od ${O(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin),s=i[r.origin]??r.origin;return a?`Preveliko: o\u010Dekivano da ${s??"vrijednost"} ima ${o}${r.maximum.toString()} ${a.unit??"elemenata"}`:`Preveliko: o\u010Dekivano da ${s??"vrijednost"} bude ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",a=t(r.origin),s=i[r.origin]??r.origin;return a?`Premalo: o\u010Dekivano da ${s} ima ${o}${r.minimum.toString()} ${a.unit}`:`Premalo: o\u010Dekivano da ${s} 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"}: ${O(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 xS(){return{localeError:DD()}}var CD=()=>{let e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"},map:{unit:"elem",verb:"legyen"}};function t(r){return e[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",mac:"MAC 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",credit_card:"hitelk\xE1rtyasz\xE1m",currency_code:"p\xE9nznemk\xF3d",iban:"IBAN",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,a=Z(r.input),s=i[a]??a;return/^[A-Z]/.test(r.expected)?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${r.expected}, a kapott \xE9rt\xE9k ${s}`:`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${o}, a kapott \xE9rt\xE9k ${s}`}case"invalid_value":return r.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${U(r.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${O(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);return a?`T\xFAl nagy: ${r.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${o}${r.maximum.toString()} ${a.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?">=":">",a=t(r.origin);return a?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${r.origin} m\xE9rete t\xFAl kicsi ${o}${r.minimum.toString()} ${a.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":""}: ${O(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 SS(){return{localeError:CD()}}function IS(e,t,n){return Math.abs(e)===1?t:n}function oa(e){if(!e)return"";let t=["\u0561","\u0565","\u0568","\u056B","\u0578","\u0578\u0582","\u0585"],n=e[e.length-1];return e+(t.includes(n)?"\u0576":"\u0568")}var AD=()=>{let e={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"},map:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"}};function t(r){return e[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",mac:"MAC \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",credit_card:"\u056F\u0580\u0565\u0564\u056B\u057F \u0584\u0561\u0580\u057F\u056B \u0570\u0561\u0574\u0561\u0580",currency_code:"\u0561\u0580\u056A\u0578\u0582\u0575\u0569\u056B \u056F\u0578\u0564",iban:"IBAN",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,a=Z(r.input),s=i[a]??a;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 ${s}`:`\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 ${s}`}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 ${U(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 ${O(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);if(a){let s=Number(r.maximum),c=IS(s,a.unit.one,a.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 ${oa(r.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${o}${r.maximum.toString()} ${c}`}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 ${oa(r.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",a=t(r.origin);if(a){let s=Number(r.minimum),c=IS(s,a.unit.one,a.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 ${oa(r.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${o}${r.minimum.toString()} ${c}`}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 ${oa(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":""}. ${O(r.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${oa(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 ${oa(r.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}};function TS(){return{localeError:AD()}}var ND=()=>{let e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"},map:{unit:"item",verb:"memiliki"}};function t(r){return e[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",mac:"alamat MAC",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",credit_card:"nomor kartu kredit",currency_code:"kode mata uang",iban:"IBAN",jwt:"JWT",template_literal:"input"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,a=Z(r.input),s=i[a]??a;return/^[A-Z]/.test(r.expected)?`Input tidak valid: diharapkan instanceof ${r.expected}, diterima ${s}`:`Input tidak valid: diharapkan ${o}, diterima ${s}`}case"invalid_value":return r.values.length===1?`Input tidak valid: diharapkan ${U(r.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${O(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);return a?`Terlalu besar: diharapkan ${r.origin??"value"} memiliki ${o}${r.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: diharapkan ${r.origin??"value"} menjadi ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",a=t(r.origin);return a?`Terlalu kecil: diharapkan ${r.origin} memiliki ${o}${r.minimum.toString()} ${a.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":""}: ${O(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 zS(){return{localeError:ND()}}var MD=()=>{let e={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"},map:{unit:"hluti",verb:"a\xF0 hafa"}};function t(r){return e[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",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 t\xF6lugildi",credit_card:"kreditkortan\xFAmer",currency_code:"gjaldmi\xF0ilsk\xF3\xF0i",iban:"IBAN",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,a=Z(r.input),s=i[a]??a;return/^[A-Z]/.test(r.expected)?`Rangt gildi: \xDE\xFA sl\xF3st inn ${s} \xFEar sem \xE1 a\xF0 vera instanceof ${r.expected}`:`Rangt gildi: \xDE\xFA sl\xF3st inn ${s} \xFEar sem \xE1 a\xF0 vera ${o}`}case"invalid_value":return r.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${U(r.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${O(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);return a?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${r.origin??"gildi"} hafi ${o}${r.maximum.toString()} ${a.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?">=":">",a=t(r.origin);return a?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${r.origin} hafi ${o}${r.minimum.toString()} ${a.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"}: ${O(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 PS(){return{localeError:MD()}}var LD=()=>{let e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"},map:{unit:"elementi",verb:"avere"}};function t(r){return e[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",mac:"indirizzo MAC",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",credit_card:"numero di carta di credito",currency_code:"codice valuta",iban:"IBAN",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,a=Z(r.input),s=i[a]??a;return/^[A-Z]/.test(r.expected)?`Input non valido: atteso instanceof ${r.expected}, ricevuto ${s}`:`Input non valido: atteso ${o}, ricevuto ${s}`}case"invalid_value":return r.values.length===1?`Input non valido: atteso ${U(r.values[0])}`:`Opzione non valida: atteso uno tra ${O(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);return a?`Troppo grande: ${r.origin??"valore"} deve avere ${o}${r.maximum.toString()} ${a.unit??"elementi"}`:`Troppo grande: ${r.origin??"valore"} deve essere ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",a=t(r.origin);return a?`Troppo piccolo: ${r.origin} deve avere ${o}${r.minimum.toString()} ${a.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"}: ${O(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 ES(){return{localeError:LD()}}var UD=()=>{let e={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"},map:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function t(r){return e[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",mac:"MAC\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",credit_card:"\u30AF\u30EC\u30B8\u30C3\u30C8\u30AB\u30FC\u30C9\u756A\u53F7",currency_code:"\u901A\u8CA8\u30B3\u30FC\u30C9",iban:"IBAN",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,a=Z(r.input),s=i[a]??a;return/^[A-Z]/.test(r.expected)?`\u7121\u52B9\u306A\u5165\u529B: instanceof ${r.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${s}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u5165\u529B: ${o}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${s}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`}case"invalid_value":return r.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${U(r.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${O(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",a=t(r.origin);return a?`\u5927\u304D\u3059\u304E\u308B\u5024: ${r.origin??"\u5024"}\u306F${r.maximum.toString()}${a.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",a=t(r.origin);return a?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${r.origin}\u306F${r.minimum.toString()}${a.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":""}: ${O(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 OS(){return{localeError:UD()}}var ZD=()=>{let e={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"},map:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"}};function t(r){return e[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",mac:"MAC \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",credit_card:"\u10E1\u10D0\u10D9\u10E0\u10D4\u10D3\u10D8\u10E2\u10DD \u10D1\u10D0\u10E0\u10D0\u10D7\u10D8\u10E1 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",currency_code:"\u10D5\u10D0\u10DA\u10E3\u10E2\u10D8\u10E1 \u10D9\u10DD\u10D3\u10D8",iban:"IBAN",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,a=Z(r.input),s=i[a]??a;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 ${s}`:`\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 ${s}`}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 ${U(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 ${O(r.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);return a?`\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"} ${a.verb} ${o}${r.maximum.toString()} ${a.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?">=":">",a=t(r.origin);return a?`\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} ${a.verb} ${o}${r.minimum.toString()} ${a.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"}: ${O(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 jS(){return{localeError:ZD()}}var FD=()=>{let e={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"},map:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function t(r){return e[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",mac:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 MAC",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",credit_card:"\u179B\u17C1\u1781\u1794\u17D0\u178E\u17D2\u178E\u17A5\u178E\u1791\u17B6\u1793",currency_code:"\u1780\u17BC\u178A\u179A\u17BC\u1794\u17B7\u1799\u1794\u17D0\u178E\u17D2\u178E",iban:"IBAN",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,a=Z(r.input),s=i[a]??a;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 ${s}`:`\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 ${s}`}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 ${U(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 ${O(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);return a?`\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()} ${a.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?">=":">",a=t(r.origin);return a?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin} ${o} ${r.minimum.toString()} ${a.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 ${O(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 up(){return{localeError:FD()}}function RS(){return up()}var VD=()=>{let e={string:{unit:"\u0C85\u0C95\u0CCD\u0CB7\u0CB0\u0C97\u0CB3\u0CC1",verb:"\u0CB9\u0CCA\u0C82\u0CA6\u0CB2\u0CC1"},file:{unit:"\u0CAC\u0CC8\u0C9F\u0CCD\u200C\u0C97\u0CB3\u0CC1",verb:"\u0CB9\u0CCA\u0C82\u0CA6\u0CB2\u0CC1"},array:{unit:"\u0CB5\u0CB8\u0CCD\u0CA4\u0CC1\u0C97\u0CB3\u0CC1",verb:"\u0CB9\u0CCA\u0C82\u0CA6\u0CB2\u0CC1"},set:{unit:"\u0CB5\u0CB8\u0CCD\u0CA4\u0CC1\u0C97\u0CB3\u0CC1",verb:"\u0CB9\u0CCA\u0C82\u0CA6\u0CB2\u0CC1"},map:{unit:"entries",verb:"\u0CB9\u0CCA\u0C82\u0CA6\u0CB2\u0CC1"}};function t(r){return e[r]??null}let n={regex:"\u0C87\u0CA8\u0CCD\u0CAA\u0CC1\u0C9F\u0CCD",email:"email \u0CB5\u0CBF\u0CB3\u0CBE\u0CB8",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 \u0CA6\u0CBF\u0CA8\u0CBE\u0C82\u0C95\u0CA6 \u0CB8\u0CAE\u0CAF",date:"ISO \u0CA6\u0CBF\u0CA8\u0CBE\u0C82\u0C95",time:"ISO \u0CB8\u0CAE\u0CAF",duration:"ISO \u0C85\u0CB5\u0CA7\u0CBF",ipv4:"IPv4 \u0CB5\u0CBF\u0CB3\u0CBE\u0CB8",ipv6:"IPv6 \u0CB5\u0CBF\u0CB3\u0CBE\u0CB8",mac:"MAC \u0CB5\u0CBF\u0CB3\u0CBE\u0CB8",cidrv4:"IPv4 \u0CB5\u0CCD\u0CAF\u0CBE\u0CAA\u0CCD\u0CA4\u0CBF\u0CAF",cidrv6:"IPv6 \u0CB5\u0CCD\u0CAF\u0CBE\u0CAA\u0CCD\u0CA4\u0CBF\u0CAF",base64:"base64-encoded\u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD",base64url:"base64url-encoded\u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD",json_string:"JSON\u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD",e164:"E.164 \u0CB8\u0C82\u0C96\u0CCD\u0CAF\u0CC6",credit_card:"\u0C95\u0CCD\u0CB0\u0CC6\u0CA1\u0CBF\u0C9F\u0CCD \u0C95\u0CBE\u0CB0\u0CCD\u0CA1\u0CCD \u0CB8\u0C82\u0C96\u0CCD\u0CAF\u0CC6",currency_code:"\u0C95\u0CB0\u0CC6\u0CA8\u0CCD\u0CB8\u0CBF \u0C95\u0CCB\u0CA1\u0CCD",iban:"IBAN",jwt:"JWT",template_literal:"\u0C87\u0CA8\u0CCD\u0CAA\u0CC1\u0C9F\u0CCD"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,a=Z(r.input),s=i[a]??a;return`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0C87\u0CA8\u0CCD\u200C\u0CAA\u0CC1\u0C9F\u0CCD: \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${o}, \u0CB8\u0CCD\u0CB5\u0CC0\u0C95\u0CB0\u0CBF\u0CB8\u0CBF\u0CA6\u0CA8\u0CC1 ${s}`}case"invalid_value":return r.values.length===1?`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0C87\u0CA8\u0CCD\u200C\u0CAA\u0CC1\u0C9F\u0CCD: \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${U(r.values[0])}`:`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0C86\u0CAF\u0CCD\u0C95\u0CC6: \u0C87\u0CB5\u0CC1\u0C97\u0CB3\u0CB2\u0CCD\u0CB2\u0CBF \u0C92\u0C82\u0CA6\u0CA8\u0CCD\u0CA8\u0CC1 \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${O(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);return a?`\u0CA4\u0CC1\u0C82\u0CAC\u0CBE \u0CA6\u0CCA\u0CA1\u0CCD\u0CA1\u0CA6\u0CC1: \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${r.origin??"value"} \u0CB9\u0CCA\u0C82\u0CA6\u0CB2\u0CC1 ${o}${r.maximum.toString()} ${a.unit??"\u0C85\u0C82\u0CB6\u0C97\u0CB3\u0CC1"}`:`\u0CA4\u0CC1\u0C82\u0CAC\u0CBE \u0CA6\u0CCA\u0CA1\u0CCD\u0CA1\u0CA6\u0CC1: \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${r.origin??"value"} \u0C8E\u0C82\u0CA6\u0CC1 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",a=t(r.origin);return a?`\u0CA4\u0CC1\u0C82\u0CAC\u0CBE \u0C9A\u0CBF\u0C95\u0CCD\u0C95\u0CA6\u0CC1: \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${r.origin} \u0CB9\u0CCA\u0C82\u0CA6\u0CB2\u0CC1 ${o}${r.minimum.toString()} ${a.unit}`:`\u0CA4\u0CC1\u0C82\u0CAC\u0CBE \u0C9A\u0CBF\u0C95\u0CCD\u0C95\u0CA6\u0CC1: \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${r.origin} \u0C8E\u0C82\u0CA6\u0CC1 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF\u0CB5\u0CBE\u0CA6 \u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD: \u0C87\u0CA6\u0CB0\u0CCA\u0C82\u0CA6\u0CBF\u0C97\u0CC6 \u0CAA\u0CCD\u0CB0\u0CBE\u0CB0\u0C82\u0CAD\u0CBF\u0CB8\u0CAC\u0CC7\u0C95\u0CC1 "${o.prefix}"`:o.format==="ends_with"?`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF\u0CB5\u0CBE\u0CA6 \u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD: \u0C87\u0CA6\u0CB0\u0CCA\u0C82\u0CA6\u0CBF\u0C97\u0CC6 \u0C95\u0CCA\u0CA8\u0CC6\u0C97\u0CCA\u0CB3\u0CCD\u0CB3\u0CAC\u0CC7\u0C95\u0CC1 "${o.suffix}"`:o.format==="includes"?`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD: \u0C92\u0CB3\u0C97\u0CCA\u0C82\u0CA1\u0CBF\u0CB0\u0CAC\u0CC7\u0C95\u0CC1 "${o.includes}"`:o.format==="regex"?`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF\u0CB5\u0CBE\u0CA6 \u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD: \u0CAE\u0CBE\u0CA6\u0CB0\u0CBF\u0C97\u0CC6 \u0CB9\u0CCA\u0C82\u0CA6\u0CBF\u0C95\u0CC6\u0CAF\u0CBE\u0C97\u0CAC\u0CC7\u0C95\u0CC1 ${o.pattern}`:`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF ${n[o.format]??r.format}`}case"not_multiple_of":return`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0CB8\u0C82\u0C96\u0CCD\u0CAF\u0CC6: \u0CAC\u0CB9\u0CC1\u0CB8\u0C82\u0C96\u0CCD\u0CAF\u0CC6\u0CAF\u0CBE\u0C97\u0CBF\u0CB0\u0CAC\u0CC7\u0C95\u0CC1 ${r.divisor}`;case"unrecognized_keys":return`\u0C97\u0CC1\u0CB0\u0CC1\u0CA4\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CA6 \u0C95\u0CC0 ${r.keys.length>1?"s":""}: ${O(r.keys,", ")}`;case"invalid_key":return`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF\u0CB5\u0CBE\u0CA6 \u0C95\u0CC0 \u0C87\u0CA8\u0CCD ${r.origin}`;case"invalid_union":return r.options&&Array.isArray(r.options)&&r.options.length>0?`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0CA4\u0CBE\u0CB0\u0CA4\u0CAE\u0CCD\u0CAF \u0CAE\u0CCC\u0CB2\u0CCD\u0CAF. \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${r.options.map(a=>`'${a}'`).join(" | ")}`:"\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0C87\u0CA8\u0CCD\u200C\u0CAA\u0CC1\u0C9F\u0CCD";case"invalid_element":return`\u0CB0\u0CB2\u0CCD\u0CB2\u0CBF \u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0CAE\u0CCC\u0CB2\u0CCD\u0CAF ${r.origin}`;default:return"\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0C87\u0CA8\u0CCD\u200C\u0CAA\u0CC1\u0C9F\u0CCD"}}};function DS(){return{localeError:VD()}}var qD=()=>{let e={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"},map:{unit:"\uAC1C",verb:"to have"}};function t(r){return e[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",mac:"MAC \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",credit_card:"\uC2E0\uC6A9\uCE74\uB4DC \uBC88\uD638",currency_code:"\uD1B5\uD654 \uCF54\uB4DC",iban:"IBAN",jwt:"JWT",template_literal:"\uC785\uB825"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,a=Z(r.input),s=i[a]??a;return/^[A-Z]/.test(r.expected)?`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${r.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${s}\uC785\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${o}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${s}\uC785\uB2C8\uB2E4`}case"invalid_value":return r.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${U(r.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${O(r.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let o=r.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",a=o==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",s=t(r.origin),c=s?.unit??"\uC694\uC18C";return s?`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${r.maximum.toString()}${c} ${o}${a}`:`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${r.maximum.toString()} ${o}${a}`}case"too_small":{let o=r.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",a=o==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",s=t(r.origin),c=s?.unit??"\uC694\uC18C";return s?`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${r.minimum.toString()}${c} ${o}${a}`:`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${r.minimum.toString()} ${o}${a}`}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: ${O(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 CS(){return{localeError:qD()}}var mc=e=>e.charAt(0).toUpperCase()+e.slice(1);function AS(e){let t=Math.abs(e),n=t%10,i=t%100;return i>=11&&i<=19||n===0?"many":n===1?"one":"few"}var BD=()=>{let e={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 t(r,o,a,s){let c=e[r]??null;return c===null?c:{unit:c.unit[o],verb:c.verb[s][a?"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",mac:"MAC 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",credit_card:"kredito kortel\u0117s numeris",currency_code:"valiutos kodas",iban:"IBAN",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,a=Z(r.input),s=i[a]??a;return/^[A-Z]/.test(r.expected)?`Gautas tipas ${s}, o tik\u0117tasi - instanceof ${r.expected}`:`Gautas tipas ${s}, o tik\u0117tasi - ${o}`}case"invalid_value":return r.values.length===1?`Privalo b\u016Bti ${U(r.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${O(r.values,"|")} pasirinkim\u0173`;case"too_big":{let o=i[r.origin]??r.origin,a=t(r.origin,AS(Number(r.maximum)),r.inclusive??!1,"smaller");if(a?.verb)return`${mc(o??r.origin??"reik\u0161m\u0117")} ${a.verb} ${r.maximum.toString()} ${a.unit??"element\u0173"}`;let s=r.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${mc(o??r.origin??"reik\u0161m\u0117")} turi b\u016Bti ${s} ${r.maximum.toString()} ${a?.unit}`}case"too_small":{let o=i[r.origin]??r.origin,a=t(r.origin,AS(Number(r.minimum)),r.inclusive??!1,"bigger");if(a?.verb)return`${mc(o??r.origin??"reik\u0161m\u0117")} ${a.verb} ${r.minimum.toString()} ${a.unit??"element\u0173"}`;let s=r.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${mc(o??r.origin??"reik\u0161m\u0117")} turi b\u016Bti ${s} ${r.minimum.toString()} ${a?.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"}: ${O(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`${mc(o??r.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}};function NS(){return{localeError:BD()}}var HD=()=>{let e={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"},map:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function t(r){return e[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",mac:"MAC \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",credit_card:"\u0431\u0440\u043E\u0458 \u043D\u0430 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u0430 \u043A\u0430\u0440\u0442\u0438\u0447\u043A\u0430",currency_code:"\u043A\u043E\u0434 \u043D\u0430 \u0432\u0430\u043B\u0443\u0442\u0430",iban:"IBAN",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,a=Z(r.input),s=i[a]??a;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 ${s}`:`\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 ${s}`}case"invalid_value":return r.values.length===1?`Invalid input: expected ${U(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 ${O(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);return a?`\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()} ${a.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?">=":">",a=t(r.origin);return a?`\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()} ${a.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"}: ${O(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 MS(){return{localeError:HD()}}var JD=()=>{let e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"},map:{unit:"elemen",verb:"mempunyai"}};function t(r){return e[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",mac:"alamat MAC",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",credit_card:"nombor kad kredit",currency_code:"kod mata wang",iban:"IBAN",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,a=Z(r.input),s=i[a]??a;return/^[A-Z]/.test(r.expected)?`Input tidak sah: dijangka instanceof ${r.expected}, diterima ${s}`:`Input tidak sah: dijangka ${o}, diterima ${s}`}case"invalid_value":return r.values.length===1?`Input tidak sah: dijangka ${U(r.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${O(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);return a?`Terlalu besar: dijangka ${r.origin??"nilai"} ${a.verb} ${o}${r.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: dijangka ${r.origin??"nilai"} adalah ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",a=t(r.origin);return a?`Terlalu kecil: dijangka ${r.origin} ${a.verb} ${o}${r.minimum.toString()} ${a.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: ${O(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 LS(){return{localeError:JD()}}var GD=()=>{let e={string:{unit:"\u0905\u0915\u094D\u0937\u0930",verb:"\u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B"},file:{unit:"\u092C\u093E\u0907\u091F",verb:"\u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B"},array:{unit:"\u0924\u0924\u094D\u0935",verb:"\u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B"},set:{unit:"\u0924\u0924\u094D\u0935",verb:"\u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B"},map:{unit:"\u092A\u094D\u0930\u0935\u093F\u0937\u094D\u091F\u093F",verb:"\u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B"}};function t(r){return e[r]??null}let n={regex:"\u0907\u0928\u092A\u0941\u091F",email:"\u0907\u092E\u0947\u0932 \u0920\u0947\u0917\u093E\u0928\u093E",url:"URL",emoji:"\u0907\u092E\u094B\u091C\u0940",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u092E\u093F\u0924\u093F \u0930 \u0938\u092E\u092F",date:"ISO \u092E\u093F\u0924\u093F",time:"ISO \u0938\u092E\u092F",duration:"ISO \u0905\u0935\u0927\u093F",ipv4:"IPv4 \u0920\u0947\u0917\u093E\u0928\u093E",ipv6:"IPv6 \u0920\u0947\u0917\u093E\u0928\u093E",mac:"MAC \u0920\u0947\u0917\u093E\u0928\u093E",cidrv4:"IPv4 \u0926\u093E\u092F\u0930\u093E",cidrv6:"IPv6 \u0926\u093E\u092F\u0930\u093E",base64:"base64-\u0907\u0928\u094D\u0915\u094B\u0921 \u0917\u0930\u093F\u090F\u0915\u094B \u0938\u094D\u091F\u094D\u0930\u093F\u0919",base64url:"base64url-\u0907\u0928\u094D\u0915\u094B\u0921 \u0917\u0930\u093F\u090F\u0915\u094B \u0938\u094D\u091F\u094D\u0930\u093F\u0919",json_string:"JSON \u0938\u094D\u091F\u094D\u0930\u093F\u0919",e164:"E.164 \u0928\u092E\u094D\u092C\u0930",credit_card:"\u0915\u094D\u0930\u0947\u0921\u093F\u091F \u0915\u093E\u0930\u094D\u0921 \u0928\u092E\u094D\u092C\u0930",currency_code:"\u092E\u0941\u0926\u094D\u0930\u093E \u0915\u094B\u0921",iban:"IBAN",jwt:"JWT",template_literal:"\u0907\u0928\u092A\u0941\u091F"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,a=Z(r.input),s=i[a]??a;return`\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 ${o}, \u092A\u094D\u0930\u093E\u092A\u094D\u0924 ${s}`}case"invalid_value":return r.values.length===1?`\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 ${U(r.values[0])}`:`\u0905\u092E\u093E\u0928\u094D\u092F \u0935\u093F\u0915\u0932\u094D\u092A: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 \u092E\u093E\u0928\u0939\u0930\u0942 \u092E\u0927\u094D\u092F\u0947 \u090F\u0915 ${O(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);return a?`\u0927\u0947\u0930\u0948 \u0920\u0942\u0932\u094B: ${r.origin??"\u092E\u093E\u0928"} \u092E\u093E ${o}${r.maximum.toString()} ${a.unit} ${a.verb}`:`\u0927\u0947\u0930\u0948 \u0920\u0942\u0932\u094B: ${r.origin??"\u092E\u093E\u0928"} ${o}${r.maximum.toString()} \u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B`}case"too_small":{let o=r.inclusive?">=":">",a=t(r.origin);return a?`\u0927\u0947\u0930\u0948 \u0938\u093E\u0928\u094B: ${r.origin} \u092E\u093E ${o}${r.minimum.toString()} ${a.unit} ${a.verb}`:`\u0927\u0947\u0930\u0948 \u0938\u093E\u0928\u094B: ${r.origin} ${o}${r.minimum.toString()} \u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0919: "${o.prefix}" \u092C\u093E\u091F \u0938\u0941\u0930\u0941 \u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B`:o.format==="ends_with"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0919: "${o.suffix}" \u092E\u093E \u0938\u092E\u093E\u092A\u094D\u0924 \u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B`:o.format==="includes"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0919: "${o.includes}" \u0938\u092E\u093E\u0935\u0947\u0936 \u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B`:o.format==="regex"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0919: \u0922\u093E\u0901\u091A\u093E ${o.pattern} \u0938\u0901\u0917 \u092E\u0947\u0932 \u0916\u093E\u0928\u0941\u092A\u0930\u094D\u091B`:`\u0905\u092E\u093E\u0928\u094D\u092F ${n[o.format]??r.format}`}case"not_multiple_of":return`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u0902\u0916\u094D\u092F\u093E: ${r.divisor} \u0915\u094B \u0917\u0941\u0923\u091C \u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B`;case"unrecognized_keys":return`\u0905\u092A\u0930\u093F\u091A\u093F\u0924 \u0915\u0941\u091E\u094D\u091C\u0940${r.keys.length>1?"\u0939\u0930\u0942":""}: ${O(r.keys,", ")}`;case"invalid_key":return`\u0905\u092E\u093E\u0928\u094D\u092F \u0915\u0941\u091E\u094D\u091C\u0940: ${r.origin} \u092E\u093E`;case"invalid_union":return r.options&&Array.isArray(r.options)&&r.options.length>0?`\u0905\u092E\u093E\u0928\u094D\u092F \u0921\u093F\u0938\u094D\u0915\u094D\u0930\u093F\u092E\u093F\u0928\u0947\u091F\u0930 \u092E\u093E\u0928: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 ${r.options.map(a=>`'${a}'`).join(" | ")}`:"\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F";case"invalid_element":return`\u0905\u092E\u093E\u0928\u094D\u092F \u092E\u093E\u0928: ${r.origin} \u092E\u093E`;default:return"\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F"}}};function US(){return{localeError:GD()}}var KD=()=>{let e={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"},map:{unit:"elementen",verb:"heeft"}};function t(r){return e[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",mac:"MAC-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",credit_card:"creditcardnummer",currency_code:"valutacode",iban:"IBAN",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,a=Z(r.input),s=i[a]??a;return/^[A-Z]/.test(r.expected)?`Ongeldige invoer: verwacht instanceof ${r.expected}, ontving ${s}`:`Ongeldige invoer: verwacht ${o}, ontving ${s}`}case"invalid_value":return r.values.length===1?`Ongeldige invoer: verwacht ${U(r.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${O(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin),s=r.origin==="date"?"laat":r.origin==="string"?"lang":"groot";return a?`Te ${s}: verwacht dat ${r.origin??"waarde"} ${o}${r.maximum.toString()} ${a.unit??"elementen"} ${a.verb}`:`Te ${s}: verwacht dat ${r.origin??"waarde"} ${o}${r.maximum.toString()} is`}case"too_small":{let o=r.inclusive?">=":">",a=t(r.origin),s=r.origin==="date"?"vroeg":r.origin==="string"?"kort":"klein";return a?`Te ${s}: verwacht dat ${r.origin} ${o}${r.minimum.toString()} ${a.unit} ${a.verb}`:`Te ${s}: 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":""}: ${O(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 ZS(){return{localeError:KD()}}var WD=()=>{let e={string:{unit:"teikn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"element",verb:"\xE5 innehalde"},set:{unit:"element",verb:"\xE5 innehalde"},map:{unit:"element",verb:"\xE5 innehalde"}};function t(r){return e[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-varigheit",ipv4:"IPv4-adresse",ipv6:"IPv6-adresse",mac:"MAC-adresse",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkoda streng",base64url:"base64url-enkoda streng",json_string:"JSON-streng",e164:"E.164-nummer",credit_card:"kredittkortnummer",currency_code:"valutakode",iban:"IBAN",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"tal",array:"liste"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,a=Z(r.input),s=i[a]??a;return/^[A-Z]/.test(r.expected)?`Ugyldig input: forventa instanceof ${r.expected}, fekk ${s}`:`Ugyldig input: forventa ${o}, fekk ${s}`}case"invalid_value":return r.values.length===1?`Ugyldig verdi: forventa ${U(r.values[0])}`:`Ugyldig val: forventa eitt av ${O(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);return a?`For stor(t): forventa ${r.origin??"value"} til \xE5 ha ${o}${r.maximum.toString()} ${a.unit??"element"}`:`For stor(t): forventa ${r.origin??"value"} til \xE5 ha ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",a=t(r.origin);return a?`For lite(n): forventa ${r.origin} til \xE5 ha ${o}${r.minimum.toString()} ${a.unit}`:`For lite(n): forventa ${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 slutte med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: m\xE5 innehalde "${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 tal: m\xE5 vere eit multiplum av ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ukjende n\xF8klar":"Ukjend n\xF8kkel"}: ${O(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 FS(){return{localeError:WD()}}var XD=()=>{let e={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"},map:{unit:"elementer",verb:"\xE5 inneholde"}};function t(r){return e[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-adresse",ipv6:"IPv6-adresse",mac:"MAC-adresse",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",credit_card:"kredittkortnummer",currency_code:"valutakode",iban:"IBAN",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,a=Z(r.input),s=i[a]??a;return/^[A-Z]/.test(r.expected)?`Ugyldig input: forventet instanceof ${r.expected}, fikk ${s}`:`Ugyldig input: forventet ${o}, fikk ${s}`}case"invalid_value":return r.values.length===1?`Ugyldig verdi: forventet ${U(r.values[0])}`:`Ugyldig valg: forventet en av ${O(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);return a?`For stor(t): forventet ${r.origin??"value"} til \xE5 ha ${o}${r.maximum.toString()} ${a.unit??"elementer"}`:`For stor(t): forventet ${r.origin??"value"} til \xE5 ha ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",a=t(r.origin);return a?`For lite(n): forventet ${r.origin} til \xE5 ha ${o}${r.minimum.toString()} ${a.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"}: ${O(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 VS(){return{localeError:XD()}}var YD=()=>{let e={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"},map:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function t(r){return e[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",mac:"MAC 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",credit_card:"i'tib\xE2r kart\u0131 numaras\u0131",currency_code:"para birimi kodu",iban:"IBAN",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,a=Z(r.input),s=i[a]??a;return/^[A-Z]/.test(r.expected)?`F\xE2sit giren: umulan instanceof ${r.expected}, al\u0131nan ${s}`:`F\xE2sit giren: umulan ${o}, al\u0131nan ${s}`}case"invalid_value":return r.values.length===1?`F\xE2sit giren: umulan ${U(r.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${O(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);return a?`Fazla b\xFCy\xFCk: ${r.origin??"value"}, ${o}${r.maximum.toString()} ${a.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?">=":">",a=t(r.origin);return a?`Fazla k\xFC\xE7\xFCk: ${r.origin}, ${o}${r.minimum.toString()} ${a.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":""}: ${O(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 qS(){return{localeError:YD()}}var QD=()=>{let e={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"},map:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function t(r){return e[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",mac:"\u062F MAC \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",credit_card:"\u062F \u06A9\u0631\u06CC\u0689\u06CC\u067C \u06A9\u0627\u0631\u062A \u0634\u0645\u06CC\u0631\u0647",currency_code:"\u062F \u0627\u0633\u0639\u0627\u0631\u0648 \u06A9\u0648\u0689",iban:"IBAN",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,a=Z(r.input),s=i[a]??a;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 ${s} \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 ${s} \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 ${U(r.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${O(r.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);return a?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${r.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${o}${r.maximum.toString()} ${a.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?">=":">",a=t(r.origin);return a?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${r.origin} \u0628\u0627\u06CC\u062F ${o}${r.minimum.toString()} ${a.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"}: ${O(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 BS(){return{localeError:QD()}}var eC=()=>{let e={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"},map:{unit:"element\xF3w",verb:"mie\u0107"}};function t(r){return e[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",mac:"adres MAC",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",credit_card:"numer karty kredytowej",currency_code:"kod waluty",iban:"IBAN",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,a=Z(r.input),s=i[a]??a;return/^[A-Z]/.test(r.expected)?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${r.expected}, otrzymano ${s}`:`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${o}, otrzymano ${s}`}case"invalid_value":return r.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${U(r.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${O(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);return a?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${r.maximum.toString()} ${a.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?">=":">",a=t(r.origin);return a?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${r.minimum.toString()} ${a.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":""}: ${O(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 HS(){return{localeError:eC()}}var tC=()=>{let e={string:{unit:"caracteres"},file:{unit:"bytes"},array:{unit:"elementos"},set:{unit:"elementos"},map:{unit:"entradas"}};function t(a){return e[a]??null}let n={regex:"a entrada",email:"o endere\xE7o de e-mail",url:"o URL",emoji:"o emoji",uuid:"o UUID",uuidv4:"o UUIDv4",uuidv6:"o UUIDv6",nanoid:"o nanoid",guid:"o GUID",cuid:"o cuid",cuid2:"o cuid2",ulid:"o ULID",xid:"o XID",ksuid:"o KSUID",datetime:"a data e hora ISO",date:"a data ISO",time:"a hora ISO",duration:"a dura\xE7\xE3o ISO",ipv4:"o endere\xE7o IPv4",ipv6:"o endere\xE7o IPv6",mac:"o endere\xE7o MAC",cidrv4:"o intervalo de endere\xE7os IPv4",cidrv6:"o intervalo de endere\xE7os IPv6",base64:"o texto codificado em base64",base64url:"o texto codificado em base64url",json_string:"o texto JSON",e164:"o n\xFAmero E.164",credit_card:"o n\xFAmero de cart\xE3o de cr\xE9dito",currency_code:"o c\xF3digo de moeda",iban:"o IBAN",jwt:"o JWT",template_literal:"a entrada"},i={masculine:{definite:"o",indefinite:"um"},feminine:{definite:"a",indefinite:"uma"}},r={string:{name:"texto",articles:i.masculine},number:{name:"n\xFAmero",articles:i.masculine},int:{name:"n\xFAmero inteiro",articles:i.masculine},boolean:{name:"valor booleano",articles:i.masculine},bigint:{name:"n\xFAmero bigint",articles:i.masculine},symbol:{name:"s\xEDmbolo",articles:i.masculine},undefined:{name:'valor "undefined"',articles:i.masculine},null:{name:'valor "nulo"',articles:i.masculine},never:{name:'valor "never"',articles:i.masculine},void:{name:'valor "void"',articles:i.masculine},date:{name:"data",articles:i.feminine},array:{name:"vetor",articles:i.masculine},object:{name:"objeto",articles:i.masculine},tuple:{name:"tuplo",articles:i.masculine},record:{name:"registo",articles:i.masculine},map:{name:"mapa",articles:i.masculine},set:{name:"conjunto",articles:i.masculine},file:{name:"ficheiro",articles:i.masculine},nonoptional:{name:"valor n\xE3o opcional",articles:i.masculine},nan:{name:'valor "NaN"',articles:i.masculine},function:{name:"fun\xE7\xE3o",articles:i.feminine}};function o(a,s){let c=r[a]??{name:`valor "${a}"`,articles:i.masculine};return`${c.articles[s]} ${c.name}`}return a=>{switch(a.code){case"invalid_type":{let s=o(a.expected,"indefinite"),c=Z(a.input),l=o(c,"indefinite");return`Entrada inv\xE1lida: esperava ${s}, recebeu ${l}`}case"invalid_value":return a.values.length===1?`Entrada inv\xE1lida: esperava ${U(a.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperava uma das seguintes op\xE7\xF5es: ${O(a.values,"|")}`;case"too_big":{let s=a.inclusive?"<=":"<",c=t(a.origin);return c?`Demasiado grande: esperava que ${o(a.origin,"definite")} tivesse ${s} ${a.maximum.toString()} ${c.unit??"elementos"}`:`Demasiado grande: esperava que ${o(a.origin,"definite")} fosse ${s} ${a.maximum.toString()}`}case"too_small":{let s=a.inclusive?">=":">",c=t(a.origin);return c?`Demasiado pequeno: esperava que ${o(a.origin,"definite")} tivesse ${s} ${a.minimum.toString()} ${c.unit??"elementos"}`:`Demasiado pequeno: esperava que ${o(a.origin,"definite")} fosse ${s} ${a.minimum.toString()}`}case"invalid_format":{let s=a;return s.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar por "${s.prefix}"`:s.format==="ends_with"?`Texto inv\xE1lido: deve terminar em "${s.suffix}"`:s.format==="includes"?`Texto inv\xE1lido: deve incluir "${s.includes}"`:s.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${s.pattern}`:`Formato d${n[s.format]??a.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${a.divisor}`;case"unrecognized_keys":{let s=a.keys.length>1?"s":"";return`Chave${s} inv\xE1lida${s}: ${O(a.keys,", ")}`}case"invalid_key":return`Entrada inv\xE1lida n${o(a.origin,"definite")}`;case"invalid_union":return a.options&&Array.isArray(a.options)&&a.options.length>0?`Valor de discrimina\xE7\xE3o inv\xE1lido. Esperava ${a.options.map(c=>`'${c}'`).join(" | ")}`:"Entrada inv\xE1lida";case"invalid_element":return`Entrada inv\xE1lida n${o(a.origin,"definite")}`;default:return"Entrada inv\xE1lida"}}};function JS(){return{localeError:tC()}}var rC=()=>{let e={string:{unit:"caracteres"},file:{unit:"bytes"},array:{unit:"elementos"},set:{unit:"elementos"},map:{unit:"entradas"}};function t(a){return e[a]??null}let n={regex:"a entrada",email:"o endere\xE7o de e-mail",url:"o URL",emoji:"o emoji",uuid:"o UUID",uuidv4:"o UUIDv4",uuidv6:"o UUIDv6",nanoid:"o nanoid",guid:"o GUID",cuid:"o cuid",cuid2:"o cuid2",ulid:"o ULID",xid:"o XID",ksuid:"o KSUID",datetime:"a data e hora ISO",date:"a data ISO",time:"a hora ISO",duration:"a dura\xE7\xE3o ISO",ipv4:"o endere\xE7o IPv4",ipv6:"o endere\xE7o IPv6",mac:"o endere\xE7o MAC",cidrv4:"a faixa de endere\xE7os IPv4",cidrv6:"a faixa de endere\xE7os IPv6",base64:"o texto codificado em base64",base64url:"o texto codificado em base64url",json_string:"o texto JSON",e164:"o n\xFAmero E.164",credit_card:"o n\xFAmero de cart\xE3o de cr\xE9dito",currency_code:"o c\xF3digo de moeda",iban:"o IBAN",jwt:"o JWT",template_literal:"a entrada"},i={masculine:{definite:"o",indefinite:"um"},feminine:{definite:"a",indefinite:"uma"}},r={string:{name:"texto",articles:i.masculine},number:{name:"n\xFAmero",articles:i.masculine},int:{name:"n\xFAmero inteiro",articles:i.masculine},boolean:{name:"valor booleano",articles:i.masculine},bigint:{name:"n\xFAmero bigint",articles:i.masculine},symbol:{name:"s\xEDmbolo",articles:i.masculine},undefined:{name:'valor "undefined"',articles:i.masculine},null:{name:'valor "nulo"',articles:i.masculine},never:{name:'valor "never"',articles:i.masculine},void:{name:'valor "void"',articles:i.masculine},date:{name:"data",articles:i.feminine},array:{name:"vetor",articles:i.masculine},object:{name:"objeto",articles:i.masculine},tuple:{name:"tupla",articles:i.feminine},record:{name:"registro",articles:i.masculine},map:{name:"mapa",articles:i.masculine},set:{name:"conjunto",articles:i.masculine},file:{name:"arquivo",articles:i.masculine},nonoptional:{name:"valor n\xE3o opcional",articles:i.masculine},nan:{name:'valor "NaN"',articles:i.masculine},function:{name:"fun\xE7\xE3o",articles:i.feminine}};function o(a,s){let c=r[a]??{name:`valor "${a}"`,articles:i.masculine};return`${c.articles[s]} ${c.name}`}return a=>{switch(a.code){case"invalid_type":{let s=o(a.expected,"indefinite"),c=Z(a.input),l=o(c,"indefinite");return`Entrada inv\xE1lida: esperava ${s}, recebeu ${l}`}case"invalid_value":return a.values.length===1?`Entrada inv\xE1lida: esperava ${U(a.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperava uma das seguintes op\xE7\xF5es: ${O(a.values,"|")}`;case"too_big":{let s=a.inclusive?"<=":"<",c=t(a.origin);return c?`Grande demais: esperava que ${o(a.origin,"definite")} tivesse ${s} ${a.maximum.toString()} ${c.unit??"elementos"}`:`Grande demais: esperava que ${o(a.origin,"definite")} fosse ${s} ${a.maximum.toString()}`}case"too_small":{let s=a.inclusive?">=":">",c=t(a.origin);return c?`Pequeno demais: esperava que ${o(a.origin,"definite")} tivesse ${s} ${a.minimum.toString()} ${c.unit??"elementos"}`:`Pequeno demais: esperava que ${o(a.origin,"definite")} fosse ${s} ${a.minimum.toString()}`}case"invalid_format":{let s=a;return s.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${s.prefix}"`:s.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${s.suffix}"`:s.format==="includes"?`Texto inv\xE1lido: deve incluir "${s.includes}"`:s.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${s.pattern}`:`Formato d${n[s.format]??a.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${a.divisor}`;case"unrecognized_keys":{let s=a.keys.length>1?"s":"";return`Chave${s} inv\xE1lida${s}: ${O(a.keys,", ")}`}case"invalid_key":return`Entrada inv\xE1lida n${o(a.origin,"definite")}`;case"invalid_union":return a.options&&Array.isArray(a.options)&&a.options.length>0?`Valor de discrimina\xE7\xE3o inv\xE1lido. Esperava ${a.options.map(c=>`'${c}'`).join(" | ")}`:"Entrada inv\xE1lida";case"invalid_element":return`Entrada inv\xE1lida n${o(a.origin,"definite")}`;default:return"Entrada inv\xE1lida"}}};function GS(){return{localeError:rC()}}var nC=()=>{let e={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 t(r){return e[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",credit_card:"num\u0103r de card de credit",currency_code:"cod valutar",iban:"IBAN",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,a=Z(r.input),s=i[a]??a;return`Intrare invalid\u0103: a\u0219teptat ${o}, primit ${s}`}case"invalid_value":return r.values.length===1?`Intrare invalid\u0103: a\u0219teptat ${U(r.values[0])}`:`Op\u021Biune invalid\u0103: a\u0219teptat una dintre ${O(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);return a?`Prea mare: a\u0219teptat ca ${r.origin??"valoarea"} ${a.verb} ${o}${r.maximum.toString()} ${a.unit??"elemente"}`:`Prea mare: a\u0219teptat ca ${r.origin??"valoarea"} s\u0103 fie ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",a=t(r.origin);return a?`Prea mic: a\u0219teptat ca ${r.origin} ${a.verb} ${o}${r.minimum.toString()} ${a.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: ${O(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 KS(){return{localeError:nC()}}function WS(e,t,n,i){let r=Math.abs(e),o=r%10,a=r%100;return a>=11&&a<=19?i:o===1?t:o>=2&&o<=4?n:i}var iC=()=>{let e={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"},map:{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 t(r){return e[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",mac:"MAC \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",credit_card:"\u043D\u043E\u043C\u0435\u0440 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u043E\u0439 \u043A\u0430\u0440\u0442\u044B",currency_code:"\u043A\u043E\u0434 \u0432\u0430\u043B\u044E\u0442\u044B",iban:"IBAN",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,a=Z(r.input),s=i[a]??a;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 ${s}`:`\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 ${s}`}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 ${U(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 ${O(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);if(a){let s=Number(r.maximum),c=WS(s,a.unit.one,a.unit.few,a.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()} ${c}`}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?">=":">",a=t(r.origin);if(a){let s=Number(r.minimum),c=WS(s,a.unit.one,a.unit.few,a.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()} ${c}`}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":""}: ${O(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 XS(){return{localeError:iC()}}var oC=()=>{let e={string:{unit:"znakov",verb:"ma\u0165"},file:{unit:"bajtov",verb:"ma\u0165"},array:{unit:"prvkov",verb:"ma\u0165"},set:{unit:"prvkov",verb:"ma\u0165"},map:{unit:"polo\u017Eiek",verb:"ma\u0165"}};function t(r){return e[r]??null}let n={regex:"regul\xE1rny 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:"d\xE1tum a \u010Das vo form\xE1te ISO",date:"d\xE1tum vo form\xE1te ISO",time:"\u010Das vo form\xE1te ISO",duration:"doba trvania ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",mac:"MAC adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"re\u0165azec zak\xF3dovan\xFD vo form\xE1te base64",base64url:"re\u0165azec zak\xF3dovan\xFD vo form\xE1te base64url",json_string:"re\u0165azec vo form\xE1te JSON",e164:"\u010D\xEDslo E.164",credit_card:"\u010D\xEDslo kreditnej karty",currency_code:"k\xF3d meny",iban:"IBAN",jwt:"JWT",template_literal:"vstup"},i={nan:"NaN",number:"\u010D\xEDslo",string:"re\u0165azec",function:"funkcia",array:"pole"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,a=Z(r.input),s=i[a]??a;return/^[A-Z]/.test(r.expected)?`Neplatn\xFD vstup: o\u010Dak\xE1van\xE9 instanceof ${r.expected}, obdr\u017Ean\xE9 ${s}`:`Neplatn\xFD vstup: o\u010Dak\xE1van\xE9 ${o}, obdr\u017Ean\xE9 ${s}`}case"invalid_value":return r.values.length===1?`Neplatn\xFD vstup: o\u010Dak\xE1van\xE9 ${U(r.values[0])}`:`Neplatn\xFD vstup: o\u010Dak\xE1van\xE1 jedna z hodn\xF4t ${O(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);return a?`Hodnota je pr\xEDli\u0161 ve\u013Ek\xE1: ${r.origin??"hodnota"} mus\xED ma\u0165 ${o}${r.maximum.toString()} ${a.unit??"prvkov"}`:`Hodnota je pr\xEDli\u0161 ve\u013Ek\xE1: ${r.origin??"hodnota"} mus\xED by\u0165 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",a=t(r.origin);return a?`Hodnota je pr\xEDli\u0161 mal\xE1: ${r.origin??"hodnota"} mus\xED ma\u0165 ${o}${r.minimum.toString()} ${a.unit??"prvkov"}`:`Hodnota je pr\xEDli\u0161 mal\xE1: ${r.origin??"hodnota"} mus\xED by\u0165 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Neplatn\xFD re\u0165azec: mus\xED za\u010D\xEDna\u0165 na "${o.prefix}"`:o.format==="ends_with"?`Neplatn\xFD re\u0165azec: mus\xED kon\u010Di\u0165 na "${o.suffix}"`:o.format==="includes"?`Neplatn\xFD re\u0165azec: mus\xED obsahova\u0165 "${o.includes}"`:o.format==="regex"?`Neplatn\xFD re\u0165azec: mus\xED zodpoveda\u0165 vzoru ${o.pattern}`:`Neplatn\xFD form\xE1t ${n[o.format]??r.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED by\u0165 n\xE1sobkom ${r.divisor}`;case"unrecognized_keys":return`Nezn\xE1me kl\xFA\u010De: ${O(r.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xFA\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 YS(){return{localeError:oC()}}var aC=()=>{let e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"},map:{unit:"elementov",verb:"imeti"}};function t(r){return e[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",mac:"MAC naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",credit_card:"\u0161tevilka kreditne kartice",currency_code:"koda valute",iban:"IBAN",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,a=Z(r.input),s=i[a]??a;return/^[A-Z]/.test(r.expected)?`Neveljaven vnos: pri\u010Dakovano instanceof ${r.expected}, prejeto ${s}`:`Neveljaven vnos: pri\u010Dakovano ${o}, prejeto ${s}`}case"invalid_value":return r.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${U(r.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${O(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);return a?`Preveliko: pri\u010Dakovano, da bo ${r.origin??"vrednost"} imelo ${o}${r.maximum.toString()} ${a.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${r.origin??"vrednost"} ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",a=t(r.origin);return a?`Premajhno: pri\u010Dakovano, da bo ${r.origin} imelo ${o}${r.minimum.toString()} ${a.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"}: ${O(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 QS(){return{localeError:aC()}}var sC=()=>{let e={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"},map:{unit:"objekt",verb:"att inneh\xE5lla"}};function t(r){return e[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-adress",ipv6:"IPv6-adress",mac:"MAC-adress",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",credit_card:"kreditkortsnummer",currency_code:"valutakod",iban:"IBAN",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,a=Z(r.input),s=i[a]??a;return/^[A-Z]/.test(r.expected)?`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${r.expected}, fick ${s}`:`Ogiltig inmatning: f\xF6rv\xE4ntat ${o}, fick ${s}`}case"invalid_value":return r.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${U(r.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${O(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);return a?`F\xF6r stor(t): f\xF6rv\xE4ntade ${r.origin??"v\xE4rdet"} att ha ${o}${r.maximum.toString()} ${a.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?">=":">",a=t(r.origin);return a?`F\xF6r lite(t): f\xF6rv\xE4ntade ${r.origin??"v\xE4rdet"} att ha ${o}${r.minimum.toString()} ${a.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"}: ${O(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 e0(){return{localeError:sC()}}var cC=()=>{let e={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"},map:{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 t(r){return e[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",mac:"MAC \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",credit_card:"\u0B95\u0B9F\u0BA9\u0BCD \u0B85\u0B9F\u0BCD\u0B9F\u0BC8 \u0B8E\u0BA3\u0BCD",currency_code:"\u0BA8\u0BBE\u0BA3\u0BAF\u0B95\u0BCD \u0B95\u0BC1\u0BB1\u0BBF\u0BAF\u0BC0\u0B9F\u0BC1",iban:"IBAN",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,a=Z(r.input),s=i[a]??a;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 ${s}`:`\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 ${s}`}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 ${U(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 ${O(r.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);return a?`\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()} ${a.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?">=":">",a=t(r.origin);return a?`\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()} ${a.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":""}: ${O(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 t0(){return{localeError:cC()}}var lC=()=>{let e={string:{unit:"\u0430\u043B\u043E\u043C\u0430\u0442",verb:"\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434"},file:{unit:"\u0431\u0430\u0439\u0442",verb:"\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434"},array:{unit:"\u0443\u043D\u0441\u0443\u0440",verb:"\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434"},set:{unit:"\u0443\u043D\u0441\u0443\u0440",verb:"\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434"},map:{unit:"\u0441\u0430\u0431\u0442",verb:"\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434"}};function t(r){return e[r]??null}let n={regex:"\u0432\u0443\u0440\u0443\u0434",email:"\u0441\u0443\u0440\u043E\u0493\u0430\u0438 email",url:"URL",emoji:"\u044D\u043C\u043E\u04B7\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0441\u0430\u043D\u0430\u0432\u0443 \u0432\u0430\u049B\u0442\u0438 ISO",date:"\u0441\u0430\u043D\u0430\u0438 ISO",time:"\u0432\u0430\u049B\u0442\u0438 ISO",duration:"\u0434\u0430\u0432\u043E\u043C\u043D\u043E\u043A\u0438\u0438 ISO",ipv4:"\u0441\u0443\u0440\u043E\u0493\u0430\u0438 IPv4",ipv6:"\u0441\u0443\u0440\u043E\u0493\u0430\u0438 IPv6",mac:"\u0441\u0443\u0440\u043E\u0493\u0430\u0438 MAC",cidrv4:"\u043C\u0430\u04B3\u0434\u0443\u0434\u0430\u0438 IPv4",cidrv6:"\u043C\u0430\u04B3\u0434\u0443\u0434\u0430\u0438 IPv6",base64:"\u0441\u0430\u0442\u0440\u0438 \u0434\u0430\u0440 \u0444\u043E\u0440\u043C\u0430\u0442\u0438 base64",base64url:"\u0441\u0430\u0442\u0440\u0438 \u0434\u0430\u0440 \u0444\u043E\u0440\u043C\u0430\u0442\u0438 base64url",json_string:"\u0441\u0430\u0442\u0440\u0438 JSON",e164:"\u0440\u0430\u049B\u0430\u043C\u0438 E.164",credit_card:"\u0440\u0430\u049B\u0430\u043C\u0438 \u043A\u043E\u0440\u0442\u0438 \u043A\u0440\u0435\u0434\u0438\u0442\u04E3",currency_code:"\u0440\u0430\u043C\u0437\u0438 \u0430\u0441\u044A\u043E\u0440",iban:"IBAN",jwt:"JWT",template_literal:"\u0432\u0443\u0440\u0443\u0434"},i={nan:"NaN",number:"\u0440\u0430\u049B\u0430\u043C",string:"\u0441\u0430\u0442\u0440",array:"\u043C\u0430\u0441\u0441\u0438\u0432",object:"\u043E\u0431\u044A\u0435\u043A\u0442",date:"\u0441\u0430\u043D\u0430"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,a=Z(r.input),s=i[a]??a;return`\u0412\u0443\u0440\u0443\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: ${o} \u0438\u043D\u0442\u0438\u0437\u043E\u0440 \u043C\u0435\u0440\u0430\u0444\u0442, ${s} \u0433\u0438\u0440\u0438\u0444\u0442\u0430 \u0448\u0443\u0434`}case"invalid_value":return r.values.length===1?`\u0412\u0443\u0440\u0443\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: ${U(r.values[0])} \u0438\u043D\u0442\u0438\u0437\u043E\u0440 \u043C\u0435\u0440\u0430\u0444\u0442`:`\u0418\u043D\u0442\u0438\u0445\u043E\u0431\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u044F\u043A\u0435 \u0430\u0437 ${O(r.values,"|")} \u0438\u043D\u0442\u0438\u0437\u043E\u0440 \u043C\u0435\u0440\u0430\u0444\u0442`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);return a?`\u0425\u0435\u043B\u0435 \u043A\u0430\u043B\u043E\u043D: ${r.origin??"\u049B\u0438\u043C\u0430\u0442"} \u0431\u043E\u044F\u0434 ${o}${r.maximum.toString()} ${a.unit} ${a.verb}`:`\u0425\u0435\u043B\u0435 \u043A\u0430\u043B\u043E\u043D: ${r.origin??"\u049B\u0438\u043C\u0430\u0442"} \u0431\u043E\u044F\u0434 ${o}${r.maximum.toString()} \u0431\u043E\u0448\u0430\u0434`}case"too_small":{let o=r.inclusive?">=":">",a=t(r.origin);return a?`\u0425\u0435\u043B\u0435 \u0445\u0443\u0440\u0434: ${r.origin} \u0431\u043E\u044F\u0434 ${o}${r.minimum.toString()} ${a.unit} ${a.verb}`:`\u0425\u0435\u043B\u0435 \u0445\u0443\u0440\u0434: ${r.origin} \u0431\u043E\u044F\u0434 ${o}${r.minimum.toString()} \u0431\u043E\u0448\u0430\u0434`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0421\u0430\u0442\u0440\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u0431\u043E\u044F\u0434 \u0431\u043E "${o.prefix}" \u043E\u0493\u043E\u0437 \u0448\u0430\u0432\u0430\u0434`:o.format==="ends_with"?`\u0421\u0430\u0442\u0440\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u0431\u043E\u044F\u0434 \u0431\u043E "${o.suffix}" \u0430\u043D\u04B7\u043E\u043C \u0451\u0431\u0430\u0434`:o.format==="includes"?`\u0421\u0430\u0442\u0440\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u0431\u043E\u044F\u0434 "${o.includes}"-\u0440\u043E \u0434\u0430\u0440 \u0431\u0430\u0440 \u0433\u0438\u0440\u0430\u0434`:o.format==="regex"?`\u0421\u0430\u0442\u0440\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u0431\u043E\u044F\u0434 \u0431\u0430 \u043D\u0430\u043C\u0443\u043D\u0430\u0438 ${o.pattern} \u043C\u0443\u0432\u043E\u0444\u0438\u049B\u0430\u0442 \u043A\u0443\u043D\u0430\u0434`:`${n[o.format]??r.format}-\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442`}case"not_multiple_of":return`\u0420\u0430\u049B\u0430\u043C\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u0431\u043E\u044F\u0434 \u0431\u0430 ${r.divisor} \u0431\u0435 \u0431\u0430\u049B\u0438\u044F \u0442\u0430\u049B\u0441\u0438\u043C \u0448\u0430\u0432\u0430\u0434`;case"unrecognized_keys":return`\u041A\u0430\u043B\u0438\u0434${r.keys.length>1?"\u04B3\u043E\u0438":"\u0438"} \u043D\u043E\u043C\u0430\u044A\u043B\u0443\u043C: ${O(r.keys,", ")}`;case"invalid_key":return`\u041A\u0430\u043B\u0438\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442 \u0434\u0430\u0440 ${r.origin}`;case"invalid_union":return r.options&&Array.isArray(r.options)&&r.options.length>0?`\u049A\u0438\u043C\u0430\u0442\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442\u0438 \u0434\u0438\u0441\u043A\u0440\u0438\u043C\u0438\u043D\u0430\u0442\u043E\u0440: ${r.options.map(a=>`'${a}'`).join(" | ")} \u0438\u043D\u0442\u0438\u0437\u043E\u0440 \u043C\u0435\u0440\u0430\u0444\u0442`:"\u0412\u0443\u0440\u0443\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442";case"invalid_element":return`\u049A\u0438\u043C\u0430\u0442\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442 \u0434\u0430\u0440 ${r.origin}`;default:return"\u0412\u0443\u0440\u0443\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442"}}};function r0(){return{localeError:lC()}}var uC=()=>{let e={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"},map:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function t(r){return e[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",mac:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 MAC",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)",credit_card:"\u0E2B\u0E21\u0E32\u0E22\u0E40\u0E25\u0E02\u0E1A\u0E31\u0E15\u0E23\u0E40\u0E04\u0E23\u0E14\u0E34\u0E15",currency_code:"\u0E23\u0E2B\u0E31\u0E2A\u0E2A\u0E01\u0E38\u0E25\u0E40\u0E07\u0E34\u0E19",iban:"IBAN",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,a=Z(r.input),s=i[a]??a;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 ${s}`:`\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 ${s}`}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 ${U(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 ${O(r.values,"|")}`;case"too_big":{let o=r.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",a=t(r.origin);return a?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${r.maximum.toString()} ${a.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",a=t(r.origin);return a?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${r.minimum.toString()} ${a.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: ${O(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 n0(){return{localeError:uC()}}var dC=()=>{let e={string:{unit:"simwol",verb:"bolmaly"},file:{unit:"ba\xFDt",verb:"bolmaly"},array:{unit:"elementler",verb:"bolmaly"},set:{unit:"elementler",verb:"bolmaly"},map:{unit:"elementler",verb:"bolmaly"}};function t(r){return e[r]??null}let n={regex:"giri\u015F",email:"e-po\xE7ta salgysy",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 sene we wagt",date:"ISO sene",time:"ISO wagt",duration:"ISO wagt aralygy",ipv4:"IPv4 salgysy",ipv6:"IPv6 salgysy",mac:"MAC salgysy",cidrv4:"IPv4 aralygy",cidrv6:"IPv6 aralygy",base64:"base64 bilen \u015Fifrlenen setir",base64url:"base64url bilen \u015Fifrlenen setir",json_string:"JSON setiri",e164:"E.164 nomeri",credit_card:"kredit kartyny\u0148 nomeri",currency_code:"wal\xFDuta kody",iban:"IBAN",jwt:"JWT",template_literal:"\u015Fablon"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,a=Z(r.input),s=i[a]??a;return`N\xE4dogry baha: gara\u015Fylan ${o} \xFDerine ${s} alyndy`}case"invalid_value":return r.values.length===1?`N\xE4dogry baha: ${U(r.values[0])} bolmaly`:`N\xE4dogry sa\xFDlaw: a\u015Fakdakylardan biri bolmaly: ${O(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);return a?`Has uly: gara\u015Fyl\xFDan ${r.origin??"baha"} ${o} ${r.maximum.toString()} ${a.unit??"element"}`:`Has uly: gara\u015Fyl\xFDan ${r.origin??"baha"} ${o} ${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",a=t(r.origin);return a?`Has ki\xE7i: gara\u015Fyl\xFDan ${r.origin} ${o} ${r.minimum.toString()} ${a.unit}`:`Has ki\xE7i: gara\u015Fyl\xFDan ${r.origin} ${o} ${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`N\xE4dogry setir: "${o.prefix}" bilen ba\u015Flamaly`:o.format==="ends_with"?`N\xE4dogry setir: "${o.suffix}" bilen gutarmaly`:o.format==="includes"?`N\xE4dogry setir: "${o.includes}" saklamaly`:o.format==="regex"?`N\xE4dogry setir: ${o.pattern} nusga la\xFDyk bolmaly`:`N\xE4dogry ${n[o.format]??r.format}`}case"not_multiple_of":return`N\xE4dogry san: ${r.divisor} bilen galyndysyz b\xF6l\xFCnmeli`;case"unrecognized_keys":return`Tanalma\xFDan a\xE7ar${r.keys.length>1?"lar":""}: ${O(r.keys,", ")}`;case"invalid_key":return`${r.origin} i\xE7inde n\xE4dogry a\xE7ar`;case"invalid_union":return"N\xE4dogry baha";case"invalid_element":return`${r.origin} i\xE7inde n\xE4dogry baha`;default:return"N\xE4dogry baha"}}};function i0(){return{localeError:dC()}}var pC=()=>{let e={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"},map:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function t(r){return e[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",mac:"MAC 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",credit_card:"kredi kart\u0131 numaras\u0131",currency_code:"para birimi kodu",iban:"IBAN",jwt:"JWT",template_literal:"\u015Eablon dizesi"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,a=Z(r.input),s=i[a]??a;return/^[A-Z]/.test(r.expected)?`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${r.expected}, al\u0131nan ${s}`:`Ge\xE7ersiz de\u011Fer: beklenen ${o}, al\u0131nan ${s}`}case"invalid_value":return r.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${U(r.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${O(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);return a?`\xC7ok b\xFCy\xFCk: beklenen ${r.origin??"de\u011Fer"} ${o}${r.maximum.toString()} ${a.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${r.origin??"de\u011Fer"} ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",a=t(r.origin);return a?`\xC7ok k\xFC\xE7\xFCk: beklenen ${r.origin} ${o}${r.minimum.toString()} ${a.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":""}: ${O(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 o0(){return{localeError:pC()}}var mC=()=>{let e={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"},map:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function t(r){return e[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",mac:"\u0430\u0434\u0440\u0435\u0441\u0430 MAC",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",credit_card:"\u043D\u043E\u043C\u0435\u0440 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u043E\u0457 \u043A\u0430\u0440\u0442\u043A\u0438",currency_code:"\u043A\u043E\u0434 \u0432\u0430\u043B\u044E\u0442\u0438",iban:"IBAN",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,a=Z(r.input),s=i[a]??a;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 ${s}`:`\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 ${s}`}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 ${U(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 ${O(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);return a?`\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"} ${a.verb} ${o}${r.maximum.toString()} ${a.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?">=":">",a=t(r.origin);return a?`\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} ${a.verb} ${o}${r.minimum.toString()} ${a.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":""}: ${O(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 dp(){return{localeError:mC()}}function a0(){return dp()}var fC=()=>{let e={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"},map:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function t(r){return e[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",mac:"\u0627\u06CC\u0645 \u0627\u06D2 \u0633\u06CC \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",credit_card:"\u06A9\u0631\u06CC\u0688\u0679 \u06A9\u0627\u0631\u0688 \u0646\u0645\u0628\u0631",currency_code:"\u06A9\u0631\u0646\u0633\u06CC \u06A9\u0648\u0688",iban:"IBAN",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,a=Z(r.input),s=i[a]??a;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 ${s} \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 ${s} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`}case"invalid_value":return r.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${U(r.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${O(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?"<=":"<",a=t(r.origin);return a?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${r.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${o}${r.maximum.toString()} ${a.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?">=":">",a=t(r.origin);return a?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${r.origin} \u06A9\u06D2 ${o}${r.minimum.toString()} ${a.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":""}: ${O(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 s0(){return{localeError:fC()}}var hC=()=>{let e={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 t(r){return e[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",credit_card:"kredit karta raqami",currency_code:"valyuta kodi",iban:"IBAN",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,a=Z(r.input),s=i[a]??a;return/^[A-Z]/.test(r.expected)?`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${r.expected}, qabul qilingan ${s}`:`Noto\u2018g\u2018ri kirish: kutilgan ${o}, qabul qilingan ${s}`}case"invalid_value":return r.values.length===1?`Noto\u2018g\u2018ri kirish: kutilgan ${U(r.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${O(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);return a?`Juda katta: kutilgan ${r.origin??"qiymat"} ${o}${r.maximum.toString()} ${a.unit} ${a.verb}`:`Juda katta: kutilgan ${r.origin??"qiymat"} ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",a=t(r.origin);return a?`Juda kichik: kutilgan ${r.origin} ${o}${r.minimum.toString()} ${a.unit} ${a.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":""}: ${O(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 c0(){return{localeError:hC()}}var gC=()=>{let e={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"},map:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function t(r){return e[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",mac:"\u0111\u1ECBa ch\u1EC9 MAC",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",credit_card:"s\u1ED1 th\u1EBB t\xEDn d\u1EE5ng",currency_code:"m\xE3 ti\u1EC1n t\u1EC7",iban:"IBAN",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,a=Z(r.input),s=i[a]??a;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 ${s}`:`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${o}, nh\u1EADn \u0111\u01B0\u1EE3c ${s}`}case"invalid_value":return r.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${U(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 ${O(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);return a?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${r.origin??"gi\xE1 tr\u1ECB"} ${a.verb} ${o}${r.maximum.toString()} ${a.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?">=":">",a=t(r.origin);return a?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${r.origin} ${a.verb} ${o}${r.minimum.toString()} ${a.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: ${O(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 l0(){return{localeError:gC()}}var vC=()=>{let e={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"},map:{unit:"\u9879",verb:"\u5305\u542B"}};function t(r){return e[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",mac:"MAC\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",credit_card:"\u4FE1\u7528\u5361\u53F7",currency_code:"\u8D27\u5E01\u4EE3\u7801",iban:"IBAN",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,a=Z(r.input),s=i[a]??a;return/^[A-Z]/.test(r.expected)?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${r.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${s}`:`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${o}\uFF0C\u5B9E\u9645\u63A5\u6536 ${s}`}case"invalid_value":return r.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${U(r.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${O(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);return a?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${r.origin??"\u503C"} ${o}${r.maximum.toString()} ${a.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?">=":">",a=t(r.origin);return a?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${r.origin} ${o}${r.minimum.toString()} ${a.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): ${O(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 u0(){return{localeError:vC()}}var yC=()=>{let e={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"},map:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function t(r){return e[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",mac:"MAC \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",credit_card:"\u4FE1\u7528\u5361\u865F",currency_code:"\u8CA8\u5E63\u4EE3\u78BC",iban:"IBAN",jwt:"JWT",template_literal:"\u8F38\u5165"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,a=Z(r.input),s=i[a]??a;return/^[A-Z]/.test(r.expected)?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${r.expected}\uFF0C\u4F46\u6536\u5230 ${s}`:`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${o}\uFF0C\u4F46\u6536\u5230 ${s}`}case"invalid_value":return r.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${U(r.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${O(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);return a?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${r.origin??"\u503C"} \u61C9\u70BA ${o}${r.maximum.toString()} ${a.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?">=":">",a=t(r.origin);return a?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${r.origin} \u61C9\u70BA ${o}${r.minimum.toString()} ${a.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${O(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 d0(){return{localeError:yC()}}var _C=()=>{let e={string:{unit:"\xE0mi",verb:"n\xED"},file:{unit:"bytes",verb:"n\xED"},array:{unit:"nkan",verb:"n\xED"},set:{unit:"nkan",verb:"n\xED"},map:{unit:"nkan",verb:"n\xED"}};function t(r){return e[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",mac:"\xE0d\xEDr\u1EB9\u0301s\xEC MAC",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",credit_card:"n\u1ECDmba kaadi gbese",currency_code:"koodu ow\xF3",iban:"IBAN",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,a=Z(r.input),s=i[a]??a;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 ${s}`:`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${o}, \xE0m\u1ECD\u0300 a r\xED ${s}`}case"invalid_value":return r.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${U(r.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${O(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);return a?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${r.origin??"iye"} ${a.verb} ${o}${r.maximum} ${a.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?">=":">",a=t(r.origin);return a?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${r.origin} ${a.verb} ${o}${r.minimum} ${a.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: ${O(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 p0(){return{localeError:_C()}}var m0,Cv=Symbol("ZodOutput"),Av=Symbol("ZodInput"),pp=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){let i=n[0];return this._map.set(t,i),i&&typeof i=="object"&&"id"in i&&this._idmap.set(i.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){let n=t._zod.parent;if(n){let i={...this.get(n)??{}};delete i.id;let r={...i,...this._map.get(t)};return Object.keys(r).length?r:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function mp(){return new pp}(m0=globalThis).__zod_globalRegistry??(m0.__zod_globalRegistry=mp());var Nt=globalThis.__zod_globalRegistry;var ir=Symbol.for("zod.compile.invalid"),f0=Symbol.for("zod.compile.fallback"),Qr=class extends Error{constructor(t="z.compile does not support async refinements, transforms, or checks"){super(t),this.name="ZodCompileAsyncError"}},Ce=class extends Error{constructor(t,n=!0){super(`z.compile does not support ${t}; this schema must use the runtime parser`),this.name="ZodCompileUnsupportedError",this.islandable=n}};function $C(e,t){try{return hp(e,{assertOnly:!0})}catch{return t}}function Uv(e,t){try{let n=hp(e),i=fp(e,n);return i._zod.bag.validator=$C(e,n),i}catch(n){if(t?.strict)throw n;return e}}function fp(e,t){if(sp(e))throw new Ce("a schema whose subtree contains a reference cycle");let n=Be(e),i=e._zod.run,r=i.__originalRun??i,o=(a,s)=>{if(s?.async||s?.direction==="backward"||s?.skipChecks||s?.[f0]||s&&cp(s,a.value))return r(a,s);let c=t(a.value);return c!==ir?(a.value=c,a):(s&&(s[f0]=!0),r(a,s))};return o.__originalRun=r,n._zod.bag.fallbackRun=r,n._zod.bag.validator=t,n._zod.run=o,i.__originalRun||wC(n,e,t),n}function wC(e,t,n){let i=e,r=t;if(typeof r.safeParse=="function"){let o=r.safeParse;i.safeParse=(a,s)=>{let c=n(a);return c!==ir?{success:!0,data:c}:o(a,s)}}if(typeof r.parse=="function"){let o=r.parse;i.parse=(a,s)=>{let c=n(a);return c!==ir?c:o(a,s)}}}function hp(e,t){let n=!0;try{n=sp(e)}catch{}if(n)throw new Ce("a schema whose subtree contains a reference cycle");let i={constants:new Map,constantCounter:0,varCounter:0,definite:!0},r=new Yi(["input"]),o=mt(r,i,e,"input",!t?.assertOnly);r.write(o===null?"return true;":`return ${o};`);let a=["INVALID",...i.constants.keys()],s=[ir,...i.constants.values()],c=r.content.join(`
|
|
86
|
+
`),l=t?.debug?a.length>0?`// Constants: ${a.join(", ")}
|
|
87
|
+
${c}`:c:"",u=Function,p=`return (input) => {
|
|
88
|
+
${c}
|
|
89
|
+
}`,h;try{h=new u(...a,p)(...s)}catch(g){throw new Ce(`this schema (generated code failed to evaluate: ${g.message})`)}return t?.debug&&(h.code=l),h.definite=i.definite,h}function $e(e,t){for(let[i,r]of e.constants)if(r===t)return i;let n=`c${e.constantCounter++}`;return e.constants.set(n,t),n}function eo(e,t){return e.definite=!1,$e(e,t)}function ve(e){return`v${e.varCounter++}`}function kC(e,t){let n=e._zod.run({value:t,issues:[]},{});if(n&&typeof n.then=="function")return ir;let i=n;return i.issues.length===0?i.value:ir}function Kt(e,t,n,i,r=!0){let o=e.content.length,a=t.constants.size,s=t.constantCounter,c=t.varCounter;try{return mt(e,t,n,i,r)}catch(l){if(!(l instanceof Ce)||!l.islandable)throw l;if(e.content.length=o,t.constants.size>a){let u=Array.from(t.constants.keys()).slice(a);for(let p of u)t.constants.delete(p)}return t.constantCounter=s,t.varCounter=c,xC(e,t,n,i)}}function xC(e,t,n,i){t.definite=!1;let r=$e(t,n),o=$e(t,kC),a=ve(t);return e.write(`const ${a} = ${o}(${r}, ${i});`),e.write(`if (${a} === INVALID) return INVALID;`),a}var SC=new Set(["max_size","min_size","size_equals","max_length","min_length","length_equals"]);function IC(e,t,n,i){let r=n._zod.def.checks;if(!r||r.length===0)return i;let o=i;for(let a of r){let s=a._zod.def;if(s.when&&!SC.has(s.check))throw new Ce('check with a custom "when" condition');switch(s.check){case"greater_than":TC(e,t,s,o);break;case"less_than":zC(e,t,s,o);break;case"multiple_of":PC(e,t,s,o);break;case"number_format":b0(e,s,o);break;case"min_length":{let c=si(s.minimum,"min_length"),l=Nv(e,t,o,`${o}.length >= ${c} && ${o}.length < ${s.minimum*2}`);e.write(`if (${l} < ${c}) return INVALID;`);break}case"max_length":{let c=si(s.maximum,"max_length"),l=Nv(e,t,o,`${o}.length > ${c}`);e.write(`if (${l} > ${c}) return INVALID;`);break}case"length_equals":{let c=si(s.length,"length_equals"),l=Nv(e,t,o,`${o}.length >= ${c} && ${o}.length <= ${s.length*2}`);e.write(`if (${l} !== ${c}) return INVALID;`);break}case"min_size":e.write(`if (${o}.size < ${si(s.minimum,"min_size")}) return INVALID;`);break;case"max_size":e.write(`if (${o}.size > ${si(s.maximum,"max_size")}) return INVALID;`);break;case"size_equals":e.write(`if (${o}.size !== ${si(s.size,"size_equals")}) return INVALID;`);break;case"string_format":o=$0(e,t,s,o);break;case"custom":o=CC(e,t,a,o);break;case"bigint_format":EC(e,s,o);break;case"mime_type":OC(e,t,s,o);break;case"property":RC(e,t,s,o);break;case"properties":jC(e,t,s,o);break;case"overwrite":{let c=ve(t);DC(e,t,a,o,c),o=c;break}default:throw new Ce(`check type ${s.check}`)}}return o}function Nv(e,t,n,i){let r=$e(t,Gi),o=ve(t);return e.write(`const ${o} = typeof ${n} === "string" && ${i} ? ${r}(${n}) : ${n}.length;`),o}function si(e,t){if(typeof e!="number"||!Number.isFinite(e))throw new Ce(`${t} bound of type ${typeof e}`);return`${e}`}function _0(e,t){if(typeof t=="bigint")return`${t}n`;if(typeof t=="number"){if(Number.isNaN(t))throw new Ce("comparison check with NaN bound");return`${t}`}if(t instanceof Date){if(Number.isNaN(t.getTime()))throw new Ce("comparison check with Invalid Date bound");return $e(e,t)}throw new Ce(`comparison check bound of type ${typeof t}`)}function TC(e,t,n,i){let r=n.inclusive?"<":"<=";e.write(`if (${i} ${r} ${_0(t,n.value)}) return INVALID;`)}function zC(e,t,n,i){let r=n.inclusive?">":">=";e.write(`if (${i} ${r} ${_0(t,n.value)}) return INVALID;`)}function PC(e,t,n,i){if(typeof n.value=="bigint"){if(n.value===BigInt(0))throw new Ce("multiple_of check with a zero divisor");e.write(`if (${i} % ${n.value}n !== 0n) return INVALID;`)}else{let r=$e(t,Us);e.write(`if (${r}(${i}, ${si(n.value,"multiple_of")}) !== 0) return INVALID;`)}}function b0(e,t,n){let i=t.format;switch(i){case"safeint":e.write(`if (!Number.isSafeInteger(${n})) return INVALID;`);break;case"int32":e.write(`if (!Number.isInteger(${n}) || ${n} < -2147483648 || ${n} > 2147483647) return INVALID;`);break;case"uint32":e.write(`if (!Number.isInteger(${n}) || ${n} < 0 || ${n} > 4294967295) return INVALID;`);break;case"float32":e.write(`if (!Number.isFinite(${n}) || ${n} < -3.4028234663852886e38 || ${n} > 3.4028234663852886e38) return INVALID;`);break;case"float64":e.write(`if (!Number.isFinite(${n})) return INVALID;`);break;default:throw new Ce(`number format ${i}`)}}function EC(e,t,n){let i=t.format;if(i)switch(i){case"int64":e.write(`if (${n} < -9223372036854775808n || ${n} > 9223372036854775807n) return INVALID;`);break;case"uint64":e.write(`if (${n} < 0n || ${n} > 18446744073709551615n) return INVALID;`);break;default:throw new Ce(`bigint format ${i}`)}}function OC(e,t,n,i){let r=n.mime;if(r&&r.length>0){let o=$e(t,new Set(r));e.write(`if (!${o}.has(${i}.type)) return INVALID;`)}}function jC(e,t,n,i){if(n.when)throw new Ce('check with a custom "when" condition');e.write(`if (${i} == null) return INVALID;`);let r=n.shape;for(let o of Reflect.ownKeys(r)){let a=typeof o=="symbol"?$e(t,o):rr(o),s=ve(t);e.write(`const ${s} = ${i}[${a}];`),Kt(e,t,r[o],s,!1)}}function RC(e,t,n,i){let r=`${i}[${JSON.stringify(n.property)}]`;mt(e,t,n.schema,r)}function DC(e,t,n,i,r){let o=n._zod.def.tx;if(!o)throw new Ce("overwrite check without a transform function");if(to(o))throw new Qr("z.compile: async overwrite transforms are not supported");let a=$e(t,o);e.write(`const ${r} = ${a}(${i});`)}function Mv(){throw new gr}function Zv(e){this.issues.push(e)}function CC(e,t,n,i){let r=n._zod.def;if(r.fn){if(to(r.fn))throw new Qr("z.compile: async .refine() predicates are not supported");let o=eo(t,r.fn),a=$e(t,Mv),s=ve(t);return e.write(`const ${s} = ${o}(${i});`),e.write(`if (${s} instanceof Promise) ${a}();`),e.write(`if (!${s}) return INVALID;`),i}if(n._zod.check){if(to(n._zod.check))throw new Qr("z.compile: async .superRefine() / check functions are not supported");let o=n._zod.check,s=eo(t,l=>{let u={value:l,issues:[],addIssue:Zv};return o(u)instanceof Promise&&Mv(),u.issues.length===0?u.value:ir}),c=ve(t);return e.write(`const ${c} = ${s}(${i});`),e.write(`if (${c} === INVALID) return INVALID;`),c}throw new Ce("custom check without a predicate or check function")}var AC=new Set(["cidrv4","cuid","cuid2","date","datetime","duration","e164","email","emoji","ends_with","guid","includes","ipv4","ksuid","lowercase","mac","nanoid","regex","starts_with","time","ulid","uppercase","uuid","xid"]);function $0(e,t,n,i,r=!0){let o=n.format;if(o==="base64"){let l=$e(t,nc);return e.write(`if (!${l}(${i})) return INVALID;`),i}if(o==="base64url"){let l=$e(t,pd);return e.write(`if (!${l}(${i})) return INVALID;`),i}if(o==="jwt"){let l=$e(t,_d),u=$e(t,n.alg??null);return e.write(`if (!${l}(${i}, ${u})) return INVALID;`),i}if(o==="ipv6"){let l=$e(t,rc);return e.write(`if (!${l}(${i})) return INVALID;`),i}if(o==="cidrv6"){let l=$e(t,cd);return e.write(`if (!${l}(${i})) return INVALID;`),i}if(o==="credit_card"){let l=$e(t,hd);return e.write(`if (!${l}(${i})) return INVALID;`),i}if(o==="iban"){let l=$e(t,vd);return e.write(`if (!${l}(${i})) return INVALID;`),i}let a=n;if(o==="url"||o==="httpurl"||a.normalize||a.hostname!==void 0||a.protocol!==void 0){let l=$e(t,Ju),u=$e(t,n),p=ve(t),h=ve(t);if(e.write(`const ${p} = ${i}.trim();`),e.write(`const ${h} = ${l}(${p}, ${u});`),e.write(`if (typeof ${h} === "number") return INVALID;`),a.hostname!==void 0){let k=$e(t,Gu);e.write(`if (!${k}(${h}, ${u}.hostname)) return INVALID;`)}if(a.protocol!==void 0){let k=$e(t,Ku);e.write(`if (!${k}(${h}, ${u}.protocol)) return INVALID;`)}if(!r)return null;let g=ve(t),_=a.normalize?`${h}.href`:`${$e(t,tc)}(${p})`;return e.write(`const ${g} = ${_};`),g}let s=n.fn;if(s){if(to(s))throw new Ce(`async string format ${o}`);let l=$e(t,s);return e.write(`if (!${l}(${i})) return INVALID;`),i}if(AC.has(o)&&n.pattern){let l=$e(t,n.pattern);return e.write(`${l}.lastIndex = 0;`),e.write(`if (!${l}.test(${i})) return INVALID;`),i}let c=n.format;switch(c){case"regex":throw new Ce("regex format without a pattern");case"lowercase":e.write(`if (${i} !== ${i}.toLowerCase()) return INVALID;`);break;case"uppercase":e.write(`if (${i} !== ${i}.toUpperCase()) return INVALID;`);break;case"includes":e.write(`if (!${i}.includes(${rr(n.includes)})) return INVALID;`);break;case"starts_with":{let l=n.prefix;e.write(`if (${i}.slice(0, ${l.length}) !== ${rr(l)}) return INVALID;`);break}case"ends_with":{let l=n.suffix;e.write(`if (${i}.slice(-${l.length}) !== ${rr(l)}) return INVALID;`);break}default:throw new Ce(`string format ${c}`)}return i}function mt(e,t,n,i,r=!0){let o=n._zod.def,a=o.type;if(o.coerce)throw new Ce(`coercion (z.coerce.${a}())`);let s=r||!!o.checks?.length,c;switch(a){case"string":c=NC(e,t,n,i,s);break;case"number":c=MC(e,n,i);break;case"boolean":c=LC(e,i);break;case"bigint":c=UC(e,n,i);break;case"symbol":c=ZC(e,i);break;case"undefined":c=FC(e,i);break;case"null":c=VC(e,i);break;case"any":case"unknown":c=i;break;case"never":e.write("return INVALID;"),c=i;break;case"void":c=qC(e,i);break;case"nan":c=BC(e,i);break;case"date":c=HC(e,i);break;case"object":c=JC(e,t,n,i,s);break;case"optional":c=GC(e,t,n,i,s);break;case"nullable":c=XC(e,t,n,i,s);break;case"array":c=YC(e,t,n,i,s);break;case"literal":c=QC(e,t,n,i);break;case"enum":c=eA(e,t,n,i);break;case"readonly":{let l=g0(e,t,n,i),u=ve(t);e.write(`const ${u} = Object.freeze(${l});`),c=u;break}case"success":g0(e,t,n,i),c="true";break;case"default":case"prefault":c=tA(e,t,n,i);break;case"nonoptional":c=rA(e,t,n,i);break;case"tuple":c=nA(e,t,n,i);break;case"union":c=iA(e,t,n,i);break;case"intersection":c=sA(e,t,n,i);break;case"record":c=cA(e,t,n,i);break;case"map":c=uA(e,t,n,i);break;case"set":c=dA(e,t,n,i);break;case"file":c=pA(e,i);break;case"template_literal":c=mA(e,t,n,i);break;case"lazy":c=fA(e,t,n,i);break;case"pipe":c=hA(e,t,n,i);break;case"custom":c=gA(e,t,n,i);break;case"transform":c=_A(e,t,n,i);break;case"catch":c=yA(e,t,n,i);break;default:throw new Ce(`schema type ${a}`)}return c===null?null:IC(e,t,n,c)}function NC(e,t,n,i,r=!0){e.write(`if (typeof ${i} !== "string") return INVALID;`);let o=n._zod.def;return o.format===void 0?i:$0(e,t,o,i,r)}function MC(e,t,n){e.write(`if (typeof ${n} !== "number" || !Number.isFinite(${n})) return INVALID;`);let i=t._zod.def;return i.check==="number_format"&&i.format&&b0(e,{format:i.format},n),n}function LC(e,t){return e.write(`if (typeof ${t} !== "boolean") return INVALID;`),t}function UC(e,t,n){e.write(`if (typeof ${n} !== "bigint") return INVALID;`);let i=t._zod.def;if(i.format)switch(i.format){case"int64":e.write(`if (${n} < -9223372036854775808n || ${n} > 9223372036854775807n) return INVALID;`);break;case"uint64":e.write(`if (${n} < 0n || ${n} > 18446744073709551615n) return INVALID;`);break}return n}function ZC(e,t){return e.write(`if (typeof ${t} !== "symbol") return INVALID;`),t}function FC(e,t){return e.write(`if (${t} !== undefined) return INVALID;`),t}function VC(e,t){return e.write(`if (${t} !== null) return INVALID;`),t}function qC(e,t){return e.write(`if (${t} !== undefined) return INVALID;`),t}function BC(e,t){return e.write(`if (typeof ${t} !== "number" || !Number.isNaN(${t})) return INVALID;`),t}function HC(e,t){return e.write(`if (!(${t} instanceof Date) || Number.isNaN(${t}.getTime())) return INVALID;`),t}function JC(e,t,n,i,r=!0){let o=n._zod.def;e.write(`if (typeof ${i} !== "object" || ${i} === null || Array.isArray(${i})) return INVALID;`);let a=o.shape,s=Object.keys(a),c=Object.getOwnPropertySymbols(a),l=c.length?[...s,...c]:s,u=S=>typeof S=="symbol"?$e(t,S):rr(S),p=S=>typeof S=="symbol"?`[${u(S)}]`:rr(S),h=a;if(s.includes("__proto__"))throw new Ce('object shape key "__proto__"');let g=new Map;for(let S of l){let A=h[S],Q=u(S),X=ve(t);if(e.write(`const ${X} = ${i}[${Q}];`),A._zod.optin!==void 0){let ge=ve(t);e.write(`let ${ge} = (() => {`),e.indented(ye=>{let Le=Kt(ye,t,A,X);ye.write(`return ${Le};`)}),e.write("})();"),A._zod.optout==="optional"?(e.write(`if (${ge} === INVALID) {`),e.indented(ye=>{ye.write(`if (${Q} in ${i}) return INVALID;`),ye.write(`${ge} = undefined;`)}),e.write("}")):e.write(`if (${ge} === INVALID) return INVALID;`),g.set(S,ge)}else{WC(A)&&e.write(`if (!(${Q} in ${i})) return INVALID;`);let ge=Kt(e,t,A,X,r);ge!==null&&g.set(S,ge)}}let _=o.catchall,k="none";if(_){let S=_._zod.def.type;if(S==="never"){let A=s.map(Q=>`k !== ${rr(Q)}`).join(" && ")||"true";e.write(`for (const k in ${i}) {`),e.indented(Q=>{Q.write(`if (${A}) return INVALID;`)}),e.write("}")}else(S==="unknown"||S==="any")&&!_._zod.def.checks?.length?k="passthrough":k="schema"}let T=ve(t),z=l.some(S=>h0(h[S])||Lv(h[S]));if(!r){if(k==="schema"){let S=s.length>0?$e(t,new Set(s)):null;e.write(`for (const k in ${i}) {`),e.indented(A=>{A.write('if (k === "__proto__") continue;'),S&&A.write(`if (${S}.has(k)) continue;`);let Q=ve(t);A.write(`const ${Q} = ${i}[k];`),Kt(A,t,_,Q,!1)}),e.write("}")}return null}if(z){e.write(`const ${T} = {};`);for(let S of l){let A=u(S),Q=g.get(S);Lv(h[S])?e.write(`if (${A} in ${i}) ${T}[${A}] = ${Q};`):h0(h[S])?e.write(`if (${Q} !== undefined || ${A} in ${i}) ${T}[${A}] = ${Q};`):e.write(`${T}[${A}] = ${Q};`)}}else{let S=l.map(A=>`${p(A)}: ${g.get(A)}`).join(", ");e.write(`const ${T} = { ${S} };`)}if(k!=="none"){let S=s.length>0?$e(t,new Set(s)):null;e.write(`for (const k in ${i}) {`),e.indented(A=>{if(A.write('if (k === "__proto__") continue;'),S&&A.write(`if (${S}.has(k)) continue;`),k==="passthrough")A.write(`${T}[k] = ${i}[k];`);else{let Q=ve(t);A.write(`const ${Q} = ${i}[k];`);let X=Kt(A,t,_,Q);A.write(`${T}[k] = ${X};`)}}),e.write("}")}return T}function GC(e,t,n,i,r=!0){let o=n._zod.def;if(KC(n))return mt(e,t,o.innerType,i,r);if(o.innerType._zod.optin==="defaulted"){let s=ve(t),c=ve(t);return e.write(`let ${s};`),e.write(`if (${i} === undefined) {`),e.indented(l=>{l.write(`const ${c} = (() => {`),l.indented(u=>{let p=mt(u,t,o.innerType,i);u.write(`return ${p};`)}),l.write("})();"),l.write(`if (${c} !== INVALID) ${s} = ${c};`)}),e.write("} else {"),e.indented(l=>{let u=mt(l,t,o.innerType,i);l.write(`${s} = ${u};`)}),e.write("}"),s}let a=r?ve(t):null;return a&&e.write(`let ${a};`),e.write(`if (${i} !== undefined) {`),e.indented(s=>{let c=mt(s,t,o.innerType,i,r);a&&c!==null&&s.write(`${a} = ${c};`)}),e.write("}"),a}function KC(e){return e._zod.traits?.has("$ZodExactOptional")===!0}function WC(e){return e._zod.optin===void 0&&Qi(e)}function Qi(e){if(e._zod.def.coerce)return!0;let t=e._zod.def;switch(t.type){case"any":case"unknown":case"undefined":case"void":case"default":case"prefault":case"transform":case"custom":case"lazy":return!0;case"string":case"number":case"boolean":case"bigint":case"symbol":case"null":case"never":case"nan":case"date":case"object":case"array":case"tuple":case"record":case"map":case"set":case"file":case"template_literal":return!1;case"nonoptional":return t.innerType?Qi(t.innerType):!1;case"literal":return!!t.values?.includes(void 0);case"enum":return!!e._zod.values?.has(void 0);case"optional":case"nullable":case"readonly":case"success":return t.innerType?Qi(t.innerType):!0;case"catch":return!0;case"union":return t.options?t.options.some(Qi):!0;case"intersection":return!t.left||!t.right?!0:Qi(t.left)&&Qi(t.right);case"pipe":return t.in?Qi(t.in):!0;default:return!0}}function Lv(e){return e._zod.optin==="optional"&&e._zod.optout==="optional"}function h0(e){return(e._zod.optin!=="defaulted"||e._zod.optout==="optional")&&sa(e)}function sa(e){let t=e._zod.def;switch(t.type){case"string":case"number":case"boolean":case"bigint":case"symbol":case"null":case"nan":case"date":case"object":case"array":case"tuple":case"record":case"map":case"set":case"file":case"template_literal":case"never":case"success":return!1;case"literal":return!!t.values?.includes(void 0);case"enum":return!!e._zod.values?.has(void 0);case"optional":return!0;case"nullable":case"readonly":case"nonoptional":return t.innerType?sa(t.innerType):!0;case"union":return t.options?t.options.some(sa):!0;case"intersection":return!t.left||!t.right||sa(t.left)||sa(t.right);case"pipe":return t.out?sa(t.out):!0;default:return!0}}function XC(e,t,n,i,r=!0){let o=n._zod.def,a=r?ve(t):null;return a&&e.write(`let ${a} = null;`),e.write(`if (${i} !== null) {`),e.indented(s=>{let c=mt(s,t,o.innerType,i,r);a&&c!==null&&s.write(`${a} = ${c};`)}),e.write("}"),a}function Fv(e,t,n){for(let[i,r]of Fo(t._zod.def.checks))e.write(`if (${n} > ${si(i,r._zod.def.check)}) return INVALID;`)}function YC(e,t,n,i,r=!0){let o=n._zod.def;e.write(`if (!Array.isArray(${i})) return INVALID;`),Fv(e,n,`${i}.length`);let a=r?ve(t):null,s=ve(t),c=ve(t);return a&&e.write(`const ${a} = new Array(${i}.length);`),e.write(`for (let ${s} = 0; ${s} < ${i}.length; ${s}++) {`),e.indented(l=>{l.write(`const ${c} = ${i}[${s}];`);let u=Kt(l,t,o.element,c,r);a&&u!==null&&l.write(`${a}[${s}] = ${u};`)}),e.write("}"),a}function QC(e,t,n,i){let o=n._zod.def.values;if(o.length!==1){let s=$e(t,new Set(o));return e.write(`if (!${s}.has(${i})) return INVALID;`),i}let a=o[0];if(typeof a=="number"&&Number.isNaN(a)){let s=$e(t,new Set(o));return e.write(`if (!${s}.has(${i})) return INVALID;`),i}if(typeof a=="string")e.write(`if (${i} !== ${rr(a)}) return INVALID;`);else if(typeof a=="number"||typeof a=="boolean")e.write(`if (${i} !== ${a}) return INVALID;`);else if(a===null)e.write(`if (${i} !== null) return INVALID;`);else if(a===void 0)e.write(`if (${i} !== undefined) return INVALID;`);else if(typeof a=="bigint")e.write(`if (${i} !== ${a}n) return INVALID;`);else throw new Ce(`literal type ${typeof a}`);return i}function eA(e,t,n,i){let r=n._zod.values;if(!r)throw new Ce("enum schema without enumerated values");let o=$e(t,r);return e.write(`if (!${o}.has(${i})) return INVALID;`),i}function g0(e,t,n,i){let r=n._zod.def;return mt(e,t,r.innerType,i)}function tA(e,t,n,i){let r=n._zod.def,a=Object.getOwnPropertyDescriptor(n._zod.def,"defaultValue")?()=>n._zod.def.defaultValue:void 0;if(n._zod.def.type==="prefault"){if(!a)return mt(e,t,r.innerType,i);let c=$e(t,a),l=ve(t);return e.write(`let ${l} = ${i};`),e.write(`if (${i} === undefined) ${l} = ${c}();`),mt(e,t,r.innerType,l)}let s=ve(t);if(a){let c=$e(t,a),l=$e(t,Zo);e.write(`let ${s};`),e.write(`if (${i} === undefined) {`),e.indented(u=>{u.write(`${s} = ${l}(${c}());`)}),e.write("} else {"),e.indented(u=>{let p=mt(u,t,r.innerType,i);u.write(`${s} = ${p} === undefined ? ${l}(${c}()) : ${p};`)}),e.write("}")}else e.write(`let ${s};`),e.write(`if (${i} !== undefined) {`),e.indented(c=>{let l=mt(c,t,r.innerType,i);c.write(`${s} = ${l};`)}),e.write("}");return s}function rA(e,t,n,i){let r=n._zod.def,o=mt(e,t,r.innerType,i),a=ve(t);return e.write(`const ${a} = ${o};`),e.write(`if (${a} === undefined) return INVALID;`),a}function nA(e,t,n,i){let r=n._zod.def,o=r.items,a=r.rest;e.write(`if (!Array.isArray(${i})) return INVALID;`);let s=v0(o,"optin"),c=v0(o,"optout");a?e.write(`if (${i}.length < ${s}) return INVALID;`):e.write(`if (${i}.length < ${s} || ${i}.length > ${o.length}) return INVALID;`);let l=ve(t);e.write(`const ${l} = [];`);for(let u=0;u<o.length;u++){let p=o[u];if(u>=c)e.write(`if (${l}.length === ${u}) {`),e.indented(h=>{h.write(`if (${u} < ${i}.length) {`),h.indented(g=>{let _=ve(t);g.write(`const ${_} = ${i}[${u}];`);let k=Kt(g,t,p,_);g.write(`${l}[${u}] = ${k};`)}),h.write("} else {"),h.indented(g=>{if(Lv(p)){g.write(`${l}.length = ${u};`);return}let _=ve(t),k=ve(t);g.write(`const ${_} = undefined;`),g.write(`const ${k} = (() => {`),g.indented(T=>{let z=Kt(T,t,p,_);T.write(`return ${z};`)}),g.write("})();"),g.write(`if (${k} === INVALID || ${k} === undefined) ${l}.length = ${u};`),g.write(`else ${l}[${u}] = ${k};`)}),h.write("}")}),e.write("}");else{let h=ve(t);e.write(`const ${h} = ${i}[${u}];`);let g=Kt(e,t,p,h);e.write(`${l}[${u}] = ${g};`)}}if(a){let u=ve(t),p=ve(t);e.write(`for (let ${u} = ${o.length}; ${u} < ${i}.length; ${u}++) {`),e.indented(h=>{h.write(`const ${p} = ${i}[${u}];`);let g=Kt(h,t,a,p);h.write(`${l}[${u}] = ${g};`)}),e.write("}")}return l}function v0(e,t){for(let n=e.length-1;n>=0;n--)if(!(t==="optin"?e[n]._zod.optin!==void 0:e[n]._zod.optout==="optional"))return n+1;return 0}function iA(e,t,n,i){let r=n._zod.def,o=r.options;if(r.discriminator)return oA(e,t,r,i);if(r.inclusive===!1)throw new Ce("exclusive unions (z.xor)");if(o.length===0)return e.write("return INVALID;"),i;if(o.length===1)return mt(e,t,o[0],i);if(o.every(c=>c._zod.def.type==="literal"&&!c._zod.def.checks?.length)){let c=new Set(o.flatMap(u=>u._zod.def.values)),l=$e(t,c);return e.write(`if (!${l}.has(${i})) return INVALID;`),i}let s=ve(t);e.write(`let ${s};`);for(let c=0;c<o.length;c++){let l=o[c];c===0?e.write(`${s} = (() => {`):e.write(`if (${s} === INVALID) ${s} = (() => {`),e.indented(u=>{let p=mt(u,t,l,i);u.write(`return ${p};`)}),e.write("})();")}return e.write(`if (${s} === INVALID) return INVALID;`),s}function oA(e,t,n,i){if(n.unionFallback)throw new Ce("discriminated union with unionFallback");if(n.options.length===0)return e.write("return INVALID;"),i;let r=ve(t),o=ve(t);e.write(`const ${r} = ${i}?.[${rr(n.discriminator)}];`),e.write(`let ${o};`);let a=!0,s=new Set;for(let c of n.options){let l=c._zod.propValues?.[n.discriminator];if(!l||l.size===0)throw new Ce("discriminated union option without static discriminator values");for(let h of l){if(s.has(h))throw new Ce(`duplicate discriminator value ${String(h)}`);s.add(h)}let u=Array.from(l,h=>aA(t,r,h)),p=a?"if":"else if";e.write(`${p} (${u.join(" || ")}) {`),e.indented(h=>{let g=mt(h,t,c,i);h.write(`${o} = ${g};`)}),e.write("}"),a=!1}return e.write("else { return INVALID; }"),o}function aA(e,t,n){if(typeof n=="string")return`${t} === ${rr(n)}`;if(typeof n=="number")return Number.isNaN(n)?`Number.isNaN(${t})`:`${t} === ${n}`;if(typeof n=="boolean")return`${t} === ${n}`;if(n===null)return`${t} === null`;if(n===void 0)return`${t} === undefined`;if(typeof n=="bigint")return`${t} === ${n}n`;if(typeof n=="symbol"){let i=$e(e,n);return`${t} === ${i}`}throw new Ce(`literal discriminator value ${String(n)}`)}function sA(e,t,n,i){let r=n._zod.def;t.definite=!1;let o=Kt(e,t,r.left,i),a=Kt(e,t,r.right,i),s=$e(t,Qo),c=ve(t);return e.write(`const ${c} = ${s}(${o}, ${a});`),e.write(`if (!${c}.valid) return INVALID;`),`${c}.data`}function cA(e,t,n,i){let r=n._zod.def,o=$e(t,Mr);e.write(`if (!${o}(${i})) return INVALID;`);let a=ve(t),s=ve(t),c=ve(t);e.write(`const ${a} = {};`);let l=r,u=l.partial?void 0:r.keyType._zod.values;if(u){let g=[];for(let k of u){if(!(typeof k=="string"||typeof k=="number"||typeof k=="symbol"))throw new Ce(`record key value ${String(k)}`);let T=typeof k=="number"?k.toString():k;if(T==="__proto__")throw new Ce('record key "__proto__"');g.push(T);let z=$e(t,k),S=mt(e,t,r.keyType,z),A=ve(t);e.write(`const ${A} = ${i}[${lA(t,T)}];`);let Q=Kt(e,t,r.valueType,A);e.write(`${a}[${S}] = ${Q};`)}let _=$e(t,new Set(g));return e.write(`for (const ${s} in ${i}) {`),e.indented(k=>{k.write(`if (${_}.has(${s})) continue;`),l.mode==="loose"?k.write(`if (${s} !== "__proto__") ${a}[${s}] = ${i}[${s}];`):k.write("return INVALID;")}),e.write("}"),a}let p=r.keyType._zod.def;if(!(p.type==="string"&&p.format===void 0&&!p.coerce&&(p.checks?.length??0)===0)){let g=r.mode==="loose",_=hp(r.keyType);_.definite===!1&&(t.definite=!1);let k=$e(t,_),T=$e(t,Cn),z=ve(t);return y0(e,t,i,s,S=>{S.write(`let ${z} = ${k}(${s});`),S.write(`if (${z} === INVALID && typeof ${s} === "string" && ${T}.test(${s})) ${z} = ${k}(Number(${s}));`),g?S.write(`if (${z} === INVALID) { ${a}[${s}] = ${i}[${s}]; continue; }`):S.write(`if (${z} === INVALID) return INVALID;`),S.write(`if (${z} === "__proto__") continue;`);let A=ve(t);S.write(`const ${A} = ${i}[${s}];`);let Q=Kt(S,t,r.valueType,A);S.write(`${a}[${z}] = ${Q};`)}),a}return y0(e,t,i,s,g=>{g.write(`const ${c} = ${i}[${s}];`);let _=Kt(g,t,r.valueType,c);g.write(`${a}[${s}] = ${_};`)},"return INVALID;"),a}function y0(e,t,n,i,r,o){let a=$e(t,Object.prototype.propertyIsEnumerable),s=ve(t),c=ve(t),l=ve(t);e.write(`const ${s} = Object.getOwnPropertySymbols(${n});`),e.write(`const ${c} = Object.getOwnPropertyNames(${n});`),e.write(`for (let ${l} = 0; ${l} < ${c}.length; ${l}++) {`),e.indented(u=>{u.write(`const ${i} = ${c}[${l}];`),u.write(`if (${i} === "__proto__" || !${a}.call(${n}, ${i})) continue;`),r(u)}),e.write("}"),e.write(`for (let ${l} = 0; ${l} < ${s}.length; ${l}++) {`),e.indented(u=>{u.write(`const ${i} = ${s}[${l}];`),u.write(`if (!${a}.call(${n}, ${i})) continue;`),o?u.write(o):r(u)}),e.write("}")}function lA(e,t){return typeof t=="string"?rr(t):$e(e,t)}function uA(e,t,n,i){let r=n._zod.def;e.write(`if (!(${i} instanceof Map)) return INVALID;`),Fv(e,n,`${i}.size`);let o=ve(t),a=ve(t),s=ve(t);return e.write(`const ${o} = new Map();`),e.write(`for (const [${a}, ${s}] of ${i}) {`),e.indented(c=>{let l=mt(c,t,r.keyType,a),u=mt(c,t,r.valueType,s);c.write(`${o}.set(${l}, ${u});`)}),e.write("}"),o}function dA(e,t,n,i){let r=n._zod.def;e.write(`if (!(${i} instanceof Set)) return INVALID;`),Fv(e,n,`${i}.size`);let o=ve(t),a=ve(t);return e.write(`const ${o} = new Set();`),e.write(`for (const ${a} of ${i}) {`),e.indented(s=>{let c=mt(s,t,r.valueType,a);s.write(`${o}.add(${c});`)}),e.write("}"),o}function pA(e,t){return e.write(`if (!(${t} instanceof File)) return INVALID;`),t}function mA(e,t,n,i){e.write(`if (typeof ${i} !== "string") return INVALID;`);let r=n._zod.pattern;if(r){let o=$e(t,r);e.write(`${o}.lastIndex = 0;`),e.write(`if (!${o}.test(${i})) return INVALID;`)}return i}function fA(e,t,n,i){let r=n._zod.def,o=eo(t,r.getter),a=$e(t,{parser:null});e.write(`if (!${a}.parser) {`),e.indented(c=>{c.write(`const inner = ${o}();`),c.write(`${a}.parser = function(input) {`),c.indented(l=>{l.write("const result = inner._zod.run({ value: input, issues: [] }, {});"),l.write("return result.issues.length === 0 ? result.value : INVALID;")}),c.write("};")}),e.write("}");let s=ve(t);return e.write(`const ${s} = ${a}.parser(${i});`),e.write(`if (${s} === INVALID) return INVALID;`),s}function hA(e,t,n,i){let r=n._zod.def,o=mt(e,t,r.in,i);if(r.transform){if(to(r.transform))throw new Qr("z.compile: async transforms in pipes are not supported");let a=r.transform,c=eo(t,u=>{let p={value:u,issues:[],addIssue:Zv},h=a(u,p);return h instanceof Promise?ir:p.issues.length===0?h:ir}),l=ve(t);return e.write(`const ${l} = ${c}(${o});`),e.write(`if (${l} === INVALID) return INVALID;`),mt(e,t,r.out,l)}else return mt(e,t,r.out,o)}function to(e){return typeof e=="function"&&(e.constructor.name==="AsyncFunction"||e[Symbol.toStringTag]==="AsyncFunction")}function gA(e,t,n,i){let r=n._zod.def;if(r.fn){if(to(r.fn))throw new Qr("z.compile: async custom predicates are not supported");let o=eo(t,r.fn),a=$e(t,Mv),s=ve(t);e.write(`const ${s} = ${o}(${i});`),e.write(`if (${s} instanceof Promise) ${a}();`),e.write(`if (!${s}) return INVALID;`)}else throw new Ce("custom schema without a predicate function");return i}function vA(e,t,n){let i=e._zod.run({value:n,issues:[]},{});if(i&&typeof i.then=="function")return ir;let r=i;return r.issues.length===0?r.value:t()}function yA(e,t,n,i){let r=n._zod.def;if(!r.catchValue[ku])throw new Ce("catch with a callback (only a constant catch value compiles)",!1);let o=ve(t);e.write(`let ${o} = (() => {`),e.indented(l=>{let u=Kt(l,t,r.innerType,i);l.write(`return ${u};`)}),e.write("})();");let a=$e(t,r.innerType),s=eo(t,r.catchValue),c=$e(t,vA);return e.write(`if (${o} === INVALID) {`),e.indented(l=>{l.write(`${o} = ${c}(${a}, ${s}, ${i});`),l.write(`if (${o} === INVALID) return INVALID;`)}),e.write("}"),o}function _A(e,t,n,i){let r=n._zod.def;if(r.transform){if(to(r.transform))throw new Qr("z.compile: async transforms are not supported");let o=r.transform,s=eo(t,l=>{let u={value:l,issues:[],addIssue:Zv},p=o(l,u);return p instanceof Promise?ir:u.issues.length===0?p:ir}),c=ve(t);return e.write(`const ${c} = ${s}(${i});`),e.write(`if (${c} === INVALID) return INVALID;`),c}return i}function gp(e){return e.checks&&(e.checks=[...e.checks]),e}function vp(e,t){return new e(gp({type:"string",...J(t)}))}function Vv(e,t){return new e(gp({type:"string",coerce:!0,...J(t)}))}function fc(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...J(t)})}function hc(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...J(t)})}function gc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...J(t)})}function vc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...J(t)})}function yc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...J(t)})}function _c(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...J(t)})}function ca(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...J(t)})}function bc(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...J(t)})}function $c(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...J(t)})}function wc(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...J(t)})}function kc(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...J(t)})}function xc(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...J(t)})}function Sc(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...J(t)})}function Ic(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...J(t)})}function Tc(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...J(t)})}function zc(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...J(t)})}function yp(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...J(t)})}function Pc(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...J(t)})}function Ec(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...J(t)})}function Oc(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...J(t)})}function jc(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...J(t)})}function Rc(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...J(t)})}function _p(e,t){return new e({type:"string",format:"credit_card",check:"string_format",abort:!1,...J(t)})}function bp(e,t){return new e({type:"string",format:"iban",check:"string_format",abort:!1,...J(t)})}function Dc(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...J(t)})}var qv={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function Cc(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...J(t)})}function Ac(e,t){return new e({type:"string",format:"date",check:"string_format",...J(t)})}function Nc(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...J(t)})}function Mc(e,t){return new e({type:"string",format:"duration",check:"string_format",...J(t)})}function $p(e,t){return new e(gp({type:"number",checks:[],...J(t)}))}function Bv(e,t){return new e(gp({type:"number",coerce:!0,checks:[],...J(t)}))}function wp(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...J(t)})}function kp(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...J(t)})}function xp(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...J(t)})}function Sp(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...J(t)})}function Ip(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...J(t)})}function Tp(e,t){return new e({type:"boolean",...J(t)})}function Hv(e,t){return new e({type:"boolean",coerce:!0,...J(t)})}function zp(e,t){return new e({type:"bigint",...J(t)})}function Jv(e,t){return new e({type:"bigint",coerce:!0,...J(t)})}function Pp(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...J(t)})}function Ep(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...J(t)})}function Op(e,t){return new e({type:"symbol",...J(t)})}function jp(e,t){return new e({type:"undefined",...J(t)})}function Rp(e,t){return new e({type:"null",...J(t)})}function Dp(e){return new e({type:"any"})}function Cp(e){return new e({type:"unknown"})}function Ap(e,t){return new e({type:"never",...J(t)})}function Np(e,t){return new e({type:"void",...J(t)})}function Mp(e,t){return new e({type:"date",...J(t)})}function Gv(e,t){return new e({type:"date",coerce:!0,...J(t)})}function Lp(e,t){return new e({type:"nan",...J(t)})}function vn(e,t){return new Nu({check:"less_than",...J(t),value:e,inclusive:!1})}function Pr(e,t){return new Nu({check:"less_than",...J(t),value:e,inclusive:!0})}function yn(e,t){return new Mu({check:"greater_than",...J(t),value:e,inclusive:!1})}function Er(e,t){return new Mu({check:"greater_than",...J(t),value:e,inclusive:!0})}function Up(e){return yn(0,e)}function Zp(e){return vn(0,e)}function Fp(e){return Pr(0,e)}function Vp(e){return Er(0,e)}function ci(e,t){return new rv({check:"multiple_of",...J(t),value:e})}function li(e,t){return new ov({check:"max_size",...J(t),maximum:e})}function _n(e,t){return new av({check:"min_size",...J(t),minimum:e})}function ro(e,t){return new sv({check:"size_equals",...J(t),size:e})}function no(e,t){return new cv({check:"max_length",...J(t),maximum:e})}function An(e,t){return new lv({check:"min_length",...J(t),minimum:e})}function io(e,t){return new uv({check:"length_equals",...J(t),length:e})}function la(e,t){return new dv({check:"string_format",format:"regex",...J(t),pattern:e})}function ua(e){return new pv({check:"string_format",format:"lowercase",...J(e)})}function da(e){return new mv({check:"string_format",format:"uppercase",...J(e)})}function pa(e,t){return new fv({check:"string_format",format:"includes",...J(t),includes:e})}function ma(e,t){return new hv({check:"string_format",format:"starts_with",...J(t),prefix:e})}function fa(e,t){return new gv({check:"string_format",format:"ends_with",...J(t),suffix:e})}function qp(e,t,n){return new vv({check:"property",property:e,schema:t,...J(n)})}function ha(e,t){return new yv({check:"properties",shape:e,...J(t)})}function ga(e,t){return new _v({check:"mime_type",mime:e,...J(t)})}function en(e){return new bv({check:"overwrite",tx:e})}function va(e){return en(t=>t.normalize(e))}function ya(){return en(e=>e.trim())}function _a(){return en(e=>e.toLowerCase())}function ba(){return en(e=>e.toUpperCase())}function $a(){return en(e=>ng(e))}function Kv(e,t,n){return new e({type:"array",element:t,...J(n)})}function bA(e,t,n){return new e({type:"union",options:t,...J(n)})}function $A(e,t,n){return new e({type:"union",options:t,inclusive:!1,...J(n)})}function wA(e,t,n,i){return new e({type:"union",options:n,discriminator:t,...J(i)})}function kA(e,t,n){return new e({type:"intersection",left:t,right:n})}function xA(e,t,n,i){let r=n instanceof xe,o=r?i:n,a=r?n:null;return new e({type:"tuple",items:t,rest:a,...J(o)})}function SA(e,t,n,i){return new e({type:"record",keyType:t,valueType:n,...J(i)})}function IA(e,t,n,i){return new e({type:"map",keyType:t,valueType:n,...J(i)})}function TA(e,t,n){return new e({type:"set",valueType:t,...J(n)})}function zA(e,t,n){let i=Array.isArray(t)?Object.fromEntries(t.map(r=>[r,r])):t;return new e({type:"enum",entries:i,...J(n)})}function PA(e,t,n){return new e({type:"enum",entries:t,...J(n)})}function EA(e,t,n){return new e({type:"literal",values:Array.isArray(t)?t:[t],...J(n)})}function Bp(e,t){return new e({type:"file",...J(t)})}function OA(e,t){return new e({type:"transform",transform:t})}function jA(e,t){return new e({type:"optional",innerType:t})}function RA(e,t){return new e({type:"nullable",innerType:t})}function DA(e,t,n){return new e({type:"default",innerType:t,get defaultValue(){return typeof n=="function"?n():Zo(n)}})}function CA(e,t,n){return new e({type:"nonoptional",innerType:t,...J(n)})}function AA(e,t){return new e({type:"success",innerType:t})}function NA(e,t,n){return new e({type:"catch",innerType:t,catchValue:typeof n=="function"?n:ug(n)})}function MA(e,t,n){return new e({type:"pipe",in:t,out:n})}function LA(e,t){return new e({type:"readonly",innerType:t})}function UA(e,t,n){return new e({type:"template_literal",parts:t,...J(n)})}function ZA(e,t){return new e({type:"lazy",getter:t})}function FA(e,t){return new e({type:"promise",innerType:t})}function Hp(e,t,n){let i=J(n);return i.abort??(i.abort=!0),new e({type:"custom",check:"custom",fn:t,...i})}function Jp(e,t,n){return new e({type:"custom",check:"custom",fn:t,...J(n)})}function Gp(e,t){let n=w0(i=>(i.addIssue=r=>{if(typeof r=="string")i.issues.push(Vo(r,i.value,n._zod.def));else{let o=r;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),"input"in o||(o.input=i.value),o.inst??(o.inst=n),o.continue??(o.continue=!n._zod.def.abort),i.issues.push(Vo(o))}},e(i.value,i)),t);return n}function w0(e,t){let n=new Ye({check:"custom",...J(t)});return n._zod.check=e,n}function Kp(e){let t=new Ye({check:"describe"});return t._zod.onattach=[n=>{let i=Nt.get(n)??{};Nt.add(n,{...i,description:e})}],t._zod.check=()=>{},t}function Wp(e){let t=new Ye({check:"meta"});return t._zod.onattach=[n=>{let i=Nt.get(n)??{};Nt.add(n,{...i,...e})}],t._zod.check=()=>{},t}function Xp(e,t){let n=J(t),i=n.truthy??["true","1","yes","on","y","enabled"],r=n.falsy??["false","0","no","off","n","disabled"];n.case!=="sensitive"&&(i=i.map(g=>typeof g=="string"?g.toLowerCase():g),r=r.map(g=>typeof g=="string"?g.toLowerCase():g));let o=new Set(i),a=new Set(r),s=e.Codec??ra,c=e.Boolean??ea,l=e.String??ai,u=new l({type:"string",error:n.error}),p=new c({type:"boolean",error:n.error}),h=new s({type:"pipe",in:u,out:p,transform:((g,_)=>{let k=g;return n.case!=="sensitive"&&(k=k.toLowerCase()),o.has(k)?!0:a.has(k)?!1:(_.issues.push({code:"invalid_value",expected:"stringbool",values:[...o,...a],input:_.value,inst:h,continue:!1}),{})}),reverseTransform:((g,_)=>g===!0?i[0]||"true":r[0]||"false"),error:n.error});return h._zod.bag.truthy=i,h._zod.bag.falsy=r,h._zod.bag.case=n.case??"insensitive",h}function ui(e,t,n,i={}){let r=J(i),o={check:"string_format",type:"string",format:t,fn:typeof n=="function"?n:s=>n.test(s),...r};return n instanceof RegExp&&(o.pattern=n),new e(o)}function Lc(e,...t){for(let n of t)for(let i of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,i)&&At(e,i,n[i]);return e}function di(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Nt,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??"ref",reused:e?.reused??"inline",intersections:[],deferred:[],external:e?.external??void 0}}function Tt(e,t,n,i,r){let o=typeof t.unrepresentable=="function"?t.unrepresentable({zodSchema:e,path:i.path,message:r}):t.unrepresentable;if(o==="any")return!1;if(o===void 0||o==="throw")throw new Error(r);return Object.assign(n,o),!0}function We(e,t,n={path:[],schemaPath:[]}){var i;let r=e._zod.def,o=t.seen.get(e);if(o)return o.count++,n.schemaPath.includes(e)&&(o.cycle=n.path),o.schema;let a={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,a),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)a.schema=s;else{let u={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,u);else{let h=a.schema,g=t.processors[r.type];if(!g)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${r.type}`);g(e,t,h,u)}let p=e._zod.parent;p&&(a.ref||(a.ref=p),We(p,t,u),t.seen.get(p).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Lc(a.schema,c),t.io==="input"&&or(e)&&(delete a.schema.examples,delete a.schema.default),t.io==="input"&&"_prefault"in a.schema&&((i=a.schema).default??(i.default=a.schema._prefault)),delete a.schema._prefault,t.seen.get(e).schema}function k0(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function pi(e,t){let n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;let i=new Map;for(let a of e.seen.entries()){let s=e.metadataRegistry.get(a[0])?.id;if(s){let c=i.get(s);if(c&&c!==a[0])throw new Error(`Duplicate schema id "${s}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);i.set(s,a[0])}}let r=a=>{let s=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let p=e.external.registry.get(a[0])?.id,h=e.external.uri??(_=>_);if(p)return{ref:h(p)};let g=a[1].defId??a[1].schema.id??`schema${e.counter++}`;return a[1].defId=g,{defId:g,ref:`${h("__shared")}#/${s}/${k0(g)}`}}let c="#",l=`${c}/${s}/`;if(a[1]===n&&!a[1].schema.id)return{ref:c};let u=a[1].schema.id??`__schema${e.counter++}`;return{defId:u,ref:l+k0(u)}},o=a=>{if(a[1].schema.$ref)return;let s=a[1],{ref:c,defId:l}=r(a);s.def={...s.schema},l&&(s.defId=l);let u=s.schema;for(let p in u)delete u[p];u.$ref=c};if(e.cycles==="throw")for(let a of e.seen.entries()){let s=a[1];if(s.cycle)throw new Error(`Cycle detected: #/${s.cycle?.join("/")}/<root>
|
|
90
|
+
|
|
91
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let a of e.seen.entries()){let s=a[1];if(t===a[0]){o(a);continue}if(e.external){let l=e.external.registry.get(a[0])?.id;if(t!==a[0]&&l){o(a);continue}}if(e.metadataRegistry.get(a[0])?.id){o(a);continue}if(s.cycle){o(a);continue}s.count>1&&e.reused==="ref"&&o(a)}e.external&&(e.sharedDefsExtractedFor=e.external)}function I0(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let i of t){if(!i||typeof i!="object")return;I0(i);let r=Object.keys(i);if(r.length!==1||r[0]!=="type")return;let o=i.type;for(let a of Array.isArray(o)?o:[o]){if(typeof a!="string")return;n.includes(a)||n.push(a)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var T0=new Set(["type","properties","required","additionalProperties"]),x0=["oneOf","anyOf"];function S0(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!="object"||t===null?null:Object.keys(t).length?t:null}function Wv(e){let t=[];for(let o of e){if(typeof o!="object"||o.type!=="object")return null;for(let a in o)if(!T0.has(a))return null;t.push(o)}let n={},i=new Set;for(let o of t){for(let a in o.properties){if(Object.prototype.hasOwnProperty.call(n,a))continue;let s=[];for(let l of t){let u=l.properties?.[a]??S0(l);u!=null&&(s.some(p=>JSON.stringify(p)===JSON.stringify(u))||s.push(u))}let c=s.length===1?s[0]:Wv(s)??{allOf:s};At(n,a,c)}for(let a of o.required??[])i.add(a)}let r={type:"object",properties:n};if(i.size&&(r.required=[...i]),t.every(o=>o.additionalProperties===!1))r.additionalProperties=!1;else{let o=[];for(let a of t){let s=S0(a);s&&!o.some(c=>JSON.stringify(c)===JSON.stringify(s))&&o.push(s)}o.length===1?r.additionalProperties=o[0]:o.length>1&&(r.additionalProperties={allOf:o})}return r}function VA(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let r of T0)if(r in e)return;let n=t.filter(r=>x0.some(o=>Array.isArray(r[o]))),i=null;if(!n.length)i=Wv(t);else{let r=n[0],o=x0.find(c=>Array.isArray(r[c]));if(Object.keys(r).length!==1)return;let a=t.filter(c=>c!==r),s=r[o].map(c=>Wv([...a,c]));if(s.some(c=>!c))return;i={[o]:s}}i&&(delete e.allOf,Lc(e,i))}function mi(e,t){let n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=s=>{let c=e.seen.get(s);if(c.ref===null)return;let l=c.def??c.schema,u={...l},p=c.ref;if(c.ref=null,p){i(p);let g=e.seen.get(p),_=g.schema;if(_.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(l.allOf=l.allOf??[],l.allOf.push(_)):Lc(l,_),Lc(l,u),s._zod.parent===p)for(let T in l)T==="$ref"||T==="allOf"||T in u||delete l[T];if(_.$ref&&g.def)for(let T in l)T==="$ref"||T==="allOf"||T in g.def&&JSON.stringify(l[T])===JSON.stringify(g.def[T])&&delete l[T]}let h=s._zod.parent;if(h&&h!==p){i(h);let g=e.seen.get(h);if(g?.schema.$ref&&(l.$ref=g.schema.$ref,g.def))for(let _ in l)_==="$ref"||_==="allOf"||_ in g.def&&JSON.stringify(l[_])===JSON.stringify(g.def[_])&&delete l[_]}e.override({zodSchema:s,jsonSchema:l,path:c.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let s of[...e.seen.entries()].reverse())i(s[0]);if(e.target!=="openapi-3.0")for(let s of e.seen.entries())I0(s[1].def??s[1].schema);for(let s of e.deferred)s();if(e.intersections.length){let s=new Map;for(let c of e.seen.values())for(let l of[c.schema,c.def]){let u=l?.allOf;if(!Array.isArray(u))continue;let p=s.get(u);p?p.push(l):s.set(u,[l])}for(let c of e.intersections)for(let l of s.get(c)??[])VA(l)}}let r={};if(e.target==="draft-2020-12"?r.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?r.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?r.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let s=e.external.registry.get(t)?.id;if(!s)throw new Error("Schema is missing an `id` property");r.$id=e.external.uri(s)}Lc(r,n.defId?n.schema:n.def??n.schema);let o=e.metadataRegistry.get(t)?.id;o!==void 0&&r.id===o&&delete r.id;let a=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let s of e.seen.entries()){let c=s[1];c.def&&c.defId&&(c.def.id===c.defId&&delete c.def.id,At(a,c.defId,c.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(a).length>0&&(e.target==="draft-2020-12"?r.$defs=a:r.definitions=a);try{let s=JSON.parse(JSON.stringify(r));return Object.defineProperty(s,"~standard",{value:{...t["~standard"],jsonSchema:{input:wa(t,"input",e.processors),output:wa(t,"output",e.processors)}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function or(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let i=e._zod.def;if(i.type==="transform")return!0;if(i.type==="array")return or(i.element,n);if(i.type==="set")return or(i.valueType,n);if(i.type==="lazy")return or(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"||i.type==="catch")return or(i.innerType,n);if(i.type==="intersection")return or(i.left,n)||or(i.right,n);if(i.type==="record"||i.type==="map")return or(i.keyType,n)||or(i.valueType,n);if(i.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:or(i.in,n)||or(i.out,n);if(i.type==="object"){for(let r in i.shape)if(or(i.shape[r],n))return!0;return!1}if(i.type==="union"){for(let r of i.options)if(or(r,n))return!0;return!1}if(i.type==="tuple"){for(let r of i.items)if(or(r,n))return!0;return!!(i.rest&&or(i.rest,n))}return!1}var Xv=(e,t={})=>n=>{let i=di({...n,processors:t});return We(e,i),pi(i,e),mi(i,e)},wa=(e,t,n={})=>i=>{let{libraryOptions:r,target:o}=i??{},a=di({...r??{},target:o,io:t,processors:n});return We(e,a),pi(a,e),mi(a,e)};var ka=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},xa=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},z0=(e,t)=>{ka(e,"minimum",t),xa(e,"maximum",t)},j0=(e,t)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(t)||e.multipleOf.push(t)},R0=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},D0=(e,t)=>{e.mime=e.mime?e.mime.filter(n=>t.includes(n)):[...t]},C0=(e,t)=>{e.format=t,t.includes("int")&&(e.isInt=!0)},P0=(e,t)=>ka(e,"minimum",t.minimum),E0=(e,t)=>xa(e,"maximum",t.maximum),O0=e=>(t,n)=>{C0(t,n.format);let[i,r]=e[n.format];ka(t,"minimum",i),xa(t,"maximum",r)},qA={greater_than:(e,t)=>ka(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>xa(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>j0(e,t.value),number_format:O0(Fs),bigint_format:O0(Vs),min_length:P0,max_length:E0,length_equals:(e,t)=>z0(e,t.length),min_size:P0,max_size:E0,size_equals:(e,t)=>z0(e,t.size),string_format:(e,t)=>{C0(e,t.format),t.pattern&&R0(e,t.pattern),(t.format==="base64"||t.format==="base64url")&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>D0(e,t.mime)};function zt(e){let t={},n=e._zod.def,i=e._zod.traits.has("$ZodCheck")?[e,...n.checks??[]]:n.checks??[];for(let o of i)qA[o._zod.def.check]?.(t,o._zod.def);let r=e._zod.bag;r.minimum!==void 0&&ka(t,"minimum",r.minimum),r.exclusiveMinimum!==void 0&&ka(t,"exclusiveMinimum",r.exclusiveMinimum),r.maximum!==void 0&&xa(t,"maximum",r.maximum),r.exclusiveMaximum!==void 0&&xa(t,"exclusiveMaximum",r.exclusiveMaximum),r.multipleOf!==void 0&&j0(t,r.multipleOf),r.format!==void 0&&(t.format??(t.format=r.format),r.format.includes("int")&&(t.isInt=!0)),r.mime&&D0(t,r.mime);for(let o of r.patterns??[])R0(t,o);return t}var BA={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},HA=new Map([[ud,Ag],[ic,Ng]]),A0=e=>HA.get(e)??e,ey=(e,t,n,i)=>{let r=n;r.type="string";let{minimum:o,maximum:a,format:s,patterns:c,contentEncoding:l,laxFormat:u}=zt(e);if(typeof o=="number"&&(r.minLength=o),typeof a=="number"&&(r.maxLength=a),s&&(r.format=BA[s]??s,r.format===""&&delete r.format,(s==="time"||u)&&delete r.format),l&&(r.contentEncoding=l),c&&c.size>0){let p=[...c].map(A0);p.length===1?r.pattern=p[0].source:p.length>1&&(r.allOf=[...p.map(h=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:h.source}))])}},ty=(e,t,n,i)=>{let r=n,{minimum:o,maximum:a,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=zt(e);r.type=u?"integer":"number";let p=typeof l=="number"&&l>=(o??Number.NEGATIVE_INFINITY),h=typeof c=="number"&&c<=(a??Number.POSITIVE_INFINITY),g=t.target==="draft-04"||t.target==="openapi-3.0";if(p?g?(r.minimum=l,r.exclusiveMinimum=!0):r.exclusiveMinimum=l:typeof o=="number"&&(r.minimum=o),h?g?(r.maximum=c,r.exclusiveMaximum=!0):r.exclusiveMaximum=c:typeof a=="number"&&(r.maximum=a),s){let _=new Set;for(let z of s)Number.isFinite(z)&&z!==0?_.add(Math.abs(z)):Tt(e,t,r,i,`A multipleOf divisor of ${z} cannot be represented in JSON Schema`);let[k,...T]=_;k!==void 0&&(r.multipleOf=k),T.length&&(r.allOf=[...r.allOf??[],...T.map(z=>({multipleOf:z}))])}},ry=(e,t,n,i)=>{n.type="boolean"},ny=(e,t,n,i)=>{Tt(e,t,n,i,"BigInt cannot be represented in JSON Schema")},iy=(e,t,n,i)=>{Tt(e,t,n,i,"Symbols cannot be represented in JSON Schema")},oy=(e,t,n,i)=>{t.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},ay=(e,t,n,i)=>{Tt(e,t,n,i,"Undefined cannot be represented in JSON Schema")},sy=(e,t,n,i)=>{Tt(e,t,n,i,"Void cannot be represented in JSON Schema")},cy=(e,t,n,i)=>{n.not={}},ly=(e,t,n,i)=>{},uy=(e,t,n,i)=>{},dy=(e,t,n,i)=>{Tt(e,t,n,i,"Date cannot be represented in JSON Schema")},py=(e,t,n,i)=>{let r=e._zod.def,o=No(r.entries);if(o.length===0){n.not={};return}o.every(a=>typeof a=="number")&&(n.type="number"),o.every(a=>typeof a=="string")&&(n.type="string"),n.enum=o},my=(e,t,n,i)=>{let r=e._zod.def;if(r.values.length===0){n.not={};return}let o=[];for(let a of r.values)if(a===void 0){if(Tt(e,t,n,i,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof a=="bigint"){if(Tt(e,t,n,i,"BigInt literals cannot be represented in JSON Schema"))return;o.push(Number(a))}else o.push(a);if(o.length!==0)if(o.length===1){let a=o[0];n.type=a===null?"null":typeof a,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[a]:n.const=a}else o.every(a=>typeof a=="number")&&(n.type="number"),o.every(a=>typeof a=="string")&&(n.type="string"),o.every(a=>typeof a=="boolean")&&(n.type="boolean"),o.every(a=>a===null)&&(n.type="null"),n.enum=o},fy=(e,t,n,i)=>{Tt(e,t,n,i,"NaN cannot be represented in JSON Schema")},hy=(e,t,n,i)=>{let r=n,o=e._zod.pattern;if(!o)throw new Error("Pattern not found in template literal");r.type="string",r.pattern=o.source},gy=(e,t,n,i)=>{let r=n;r.type="string",r.format="binary",r.contentEncoding="binary";let{minimum:o,maximum:a,mime:s}=zt(e);o!==void 0&&(r.minLength=o),a!==void 0&&(r.maxLength=a),s&&(s.length===0?r.not={}:s.length===1?r.contentMediaType=s[0]:r.anyOf=s.map(c=>({contentMediaType:c})))},vy=(e,t,n,i)=>{n.type="boolean"},yy=(e,t,n,i)=>{Tt(e,t,n,i,"Custom types cannot be represented in JSON Schema")},_y=(e,t,n,i)=>{Tt(e,t,n,i,"Function types cannot be represented in JSON Schema")},by=(e,t,n,i)=>{Tt(e,t,n,i,"Transforms cannot be represented in JSON Schema")},$y=(e,t,n,i)=>{Tt(e,t,n,i,"Map cannot be represented in JSON Schema")},wy=(e,t,n,i)=>{Tt(e,t,n,i,"Set cannot be represented in JSON Schema")},ky=(e,t,n,i)=>{let r=n,o=e._zod.def,{minimum:a,maximum:s}=zt(e);typeof a=="number"&&(r.minItems=a),typeof s=="number"&&(r.maxItems=s),r.type="array",r.items=We(o.element,t,{...i,path:[...i.path,"items"]})};function Uc(e){let t=e._zod.def;return t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform")?Uc(t.out):t.type==="catch"?Uc(t.innerType):e._zod.optin}var xy=(e,t,n,i)=>{let r=n,o=e._zod.def,a=o.shape;if(Object.getOwnPropertySymbols(a).length&&Tt(e,t,r,i,"Symbol keys cannot be represented in JSON Schema"))return;r.type="object",r.properties={};for(let l in a)At(r.properties,l,We(a[l],t,{...i,path:[...i.path,"properties",l]}));let c=[];for(let l of Object.keys(a)){let u=o.shape[l];(t.io==="input"?Uc(u)===void 0:u._zod.optout===void 0)&&c.push(l)}c.length>0&&(r.required=c),o.catchall?._zod.def.type==="never"?r.additionalProperties=!1:o.catchall?o.catchall&&(r.additionalProperties=We(o.catchall,t,{...i,path:[...i.path,"additionalProperties"]})):t.io==="output"&&(r.additionalProperties=!1)},Qp=(e,t,n,i)=>{let r=e._zod.def,o=r.inclusive===!1,a=r.options.map((s,c)=>We(s,t,{...i,path:[...i.path,o?"oneOf":"anyOf",c]}));o?n.oneOf=a:n.anyOf=a},Sy=(e,t,n,i)=>{let r=e._zod.def,o=We(r.left,t,{...i,path:[...i.path,"allOf",0]}),a=We(r.right,t,{...i,path:[...i.path,"allOf",1]}),s=l=>"allOf"in l&&Object.keys(l).length===1,c=[...s(o)?o.allOf:[o],...s(a)?a.allOf:[a]];n.allOf=c,t.intersections.push(c)},Iy=(e,t,n,i)=>{let r=n,o=e._zod.def;r.type="array";let a=t.target==="draft-2020-12"?"prefixItems":"items",s=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",c=o.items.map((k,T)=>We(k,t,{...i,path:[...i.path,a,T]})),l=o.rest?We(o.rest,t,{...i,path:[...i.path,s,...t.target==="openapi-3.0"?[o.items.length]:[]]}):null,u=o.items.length;for(;u>0;){let k=o.items[u-1];if(!(t.io==="input"?Uc(k)!==void 0:k._zod.optout==="optional"))break;u--}let p=o.items.length,h=!o.rest;t.target==="draft-2020-12"?(r.prefixItems=c,h?r.items=!1:l&&(r.items=l),u>0&&(r.minItems=u),h&&(r.maxItems=p)):t.target==="openapi-3.0"?(r.items={anyOf:c},l&&r.items.anyOf.push(l),u>0&&(r.minItems=u),h&&(r.maxItems=p)):(r.items=c,h?r.additionalItems=!1:l&&(r.additionalItems=l),u>0&&(r.minItems=u),h&&(r.maxItems=p));let{minimum:g,maximum:_}=zt(e);typeof g=="number"&&(r.minItems=g),typeof _=="number"&&(r.maxItems=_)};function Yv(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);let _=e.get(t)?.def;if(!_)return t;let k=Yv(e,_,n);return k===_?t:k}for(let _ of["anyOf","oneOf"]){let k=t[_];if(!Array.isArray(k))continue;let T=k.map(z=>Yv(e,z,n));T.some((z,S)=>z!==k[S])&&(t={...t,[_]:T})}let i=Array.isArray(t.type)?t.type:[t.type],r=!i.includes("string")&&i.some(_=>_==="number"||_==="integer"),o=t.enum??(t.const!==void 0?[t.const]:void 0);if(!r&&!o?.some(_=>typeof _=="number"))return t;let{minimum:a,maximum:s,exclusiveMinimum:c,exclusiveMaximum:l,multipleOf:u,format:p,id:h,...g}=t;return g.enum?g.enum=g.enum.map(_=>typeof _=="number"?String(_):_):typeof g.const=="number"&&(g.const=String(g.const)),r&&(g.type="string",o||(g.pattern=(i.includes("number")?Cn:Xs).source)),g}var Qv=new WeakMap;function JA(e){let t=new Map;for(let i of e.seen.values())i.def&&!t.has(i.schema)&&t.set(i.schema,i);let n=new Map;for(let i of Qv.get(e)??[]){let r=e.seen.get(i),o=(r?.def??r?.schema)?.propertyNames;if(!o||o===!0||n.has(o))continue;let a=Yv(t,o,new Set);a!==o&&n.set(o,a)}if(n.size)for(let i of e.seen.values())for(let r of[i.schema,i.def]){let o=r&&n.get(r.propertyNames);o&&(r.propertyNames=o)}}var Ty=(e,t,n,i)=>{let r=n,o=e._zod.def;r.type="object";let a=o.keyType,s=zt(a).patterns;if(o.mode==="loose"&&s&&s.size>0){let u=We(o.valueType,t,{...i,path:[...i.path,"patternProperties","*"]});r.patternProperties={};for(let p of s)At(r.patternProperties,A0(p).source,u)}else{if(t.target==="draft-07"||t.target==="draft-2020-12"){r.propertyNames=We(o.keyType,t,{...i,path:[...i.path,"propertyNames"]});let u=Qv.get(t);u||(u=[],Qv.set(t,u),t.deferred.push(()=>JA(t))),u.push(e)}r.additionalProperties=We(o.valueType,t,{...i,path:[...i.path,"additionalProperties"]})}let c=a._zod.values,l=t.io==="input"&&Uc(o.valueType)!==void 0;if(c&&!o.partial&&!l){let u=[...c].filter(p=>typeof p=="string"||typeof p=="number");u.length>0&&(r.required=u.map(String))}},zy=(e,t,n,i)=>{let r=e._zod.def,o=We(r.innerType,t,i),a=t.seen.get(e);t.target==="openapi-3.0"?(a.ref=r.innerType,n.nullable=!0):n.anyOf=[o,{type:"null"}]},Py=(e,t,n,i)=>{let r=e._zod.def;We(r.innerType,t,i);let o=t.seen.get(e);o.ref=r.innerType},Ey=Symbol();function N0(e,t,n,i,r){let o=!1,a=JSON.stringify(e,(s,c)=>typeof c!="bigint"?c:(o=!0,null));return o?(Tt(t,n,i,r,"BigInt defaults cannot be represented in JSON Schema"),Ey):JSON.parse(a)}var Oy=(e,t,n,i)=>{let r=e._zod.def;We(r.innerType,t,i);let o=t.seen.get(e);o.ref=r.innerType;let a=N0(r.defaultValue,e,t,n,i);a!==Ey&&(n.default=a)},jy=(e,t,n,i)=>{let r=e._zod.def;We(r.innerType,t,i);let o=t.seen.get(e);if(o.ref=r.innerType,t.io!=="input")return;let a=N0(r.defaultValue,e,t,n,i);a!==Ey&&(n._prefault=a)},Ry=(e,t,n,i)=>{let r=e._zod.def;We(r.innerType,t,i);let o=t.seen.get(e);o.ref=r.innerType;let a;try{a=r.catchValue(void 0)}catch{Tt(e,t,n,i,"Dynamic catch values are not supported in JSON Schema");return}n.default=a},Dy=(e,t,n,i)=>{let r=e._zod.def,o=r.in._zod.traits.has("$ZodTransform"),a=t.io==="input"?o?r.out:r.in:r.out;We(a,t,i);let s=t.seen.get(e);s.ref=a},Cy=(e,t,n,i)=>{let r=e._zod.def;We(r.innerType,t,i);let o=t.seen.get(e);o.ref=r.innerType,n.readOnly=!0},Ay=(e,t,n,i)=>{let r=e._zod.def;We(r.innerType,t,i);let o=t.seen.get(e);o.ref=r.innerType},em=(e,t,n,i)=>{let r=e._zod.def;We(r.innerType,t,i);let o=t.seen.get(e);o.ref=r.innerType},Ny=(e,t,n,i)=>{let r=e._zod.innerType;We(r,t,i);let o=t.seen.get(e);o.ref=r},Yp={string:ey,number:ty,boolean:ry,bigint:ny,symbol:iy,null:oy,undefined:ay,void:sy,never:cy,any:ly,unknown:uy,date:dy,enum:py,literal:my,nan:fy,template_literal:hy,file:gy,success:vy,custom:yy,function:_y,transform:by,map:$y,set:wy,array:ky,object:xy,union:Qp,intersection:Sy,tuple:Iy,record:Ty,nullable:zy,nonoptional:Py,default:Oy,prefault:jy,catch:Ry,pipe:Dy,readonly:Cy,promise:Ay,optional:em,lazy:Ny};function oo(e,t){if("_idmap"in e){let i=e,r=di({...t,processors:Yp}),o={};for(let c of i._idmap.entries()){let[l,u]=c;We(u,r)}let a={},s={registry:i,uri:t?.uri,defs:o};r.external=s;for(let c of i._idmap.entries()){let[l,u]=c;pi(r,u),At(a,l,mi(r,u))}if(Object.keys(o).length>0){let c=r.target==="draft-2020-12"?"$defs":"definitions";a.__shared={[c]:o}}return{schemas:a}}let n=di({...t,processors:Yp});return We(e,n),pi(n,e),mi(n,e)}var tm=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(t){this.ctx.counter=t}get seen(){return this.ctx.seen}constructor(t){let n=t?.target??"draft-2020-12";n==="draft-4"&&(n="draft-04"),n==="draft-7"&&(n="draft-07"),this.ctx=di({processors:Yp,target:n,...t?.metadata&&{metadata:t.metadata},...t?.unrepresentable&&{unrepresentable:t.unrepresentable},...t?.override&&{override:t.override},...t?.io&&{io:t.io}})}process(t,n={path:[],schemaPath:[]}){return We(t,this.ctx,n)}emit(t,n){n&&(n.cycles&&(this.ctx.cycles=n.cycles),n.reused&&(this.ctx.reused=n.reused),n.external&&(this.ctx.external=n.external)),this.ctx.sharedDefsExtractedFor=void 0,this.ctx.sharedEmitDoneFor=void 0,pi(this.ctx,t);let i=mi(this.ctx,t),{"~standard":r,...o}=i;return o}};var M0={};var ja={};hn(ja,{ZodAny:()=>r_,ZodArray:()=>a_,ZodBase64:()=>bm,ZodBase64URL:()=>$m,ZodBigInt:()=>Ea,ZodBigIntFormat:()=>xm,ZodBoolean:()=>Pa,ZodCIDRv4:()=>ym,ZodCIDRv6:()=>_m,ZodCUID:()=>dm,ZodCUID2:()=>pm,ZodCatch:()=>S_,ZodCodec:()=>Kc,ZodCreditCard:()=>Xy,ZodCustom:()=>Wc,ZodCustomStringFormat:()=>so,ZodDate:()=>qc,ZodDefault:()=>__,ZodDiscriminatedUnion:()=>c_,ZodE164:()=>wm,ZodEmail:()=>sm,ZodEmoji:()=>lm,ZodEnum:()=>Ia,ZodExactOptional:()=>Tm,ZodFile:()=>h_,ZodFunction:()=>C_,ZodGUID:()=>cm,ZodIBAN:()=>Yy,ZodIPv4:()=>gm,ZodIPv6:()=>vm,ZodISODate:()=>hi,ZodISODateTime:()=>fi,ZodISODuration:()=>vi,ZodISOTime:()=>gi,ZodInstanceOf:()=>M_,ZodIntersection:()=>l_,ZodJWT:()=>km,ZodKSUID:()=>hm,ZodLazy:()=>j_,ZodLiteral:()=>f_,ZodMAC:()=>Wy,ZodMap:()=>p_,ZodNaN:()=>T_,ZodNanoID:()=>um,ZodNever:()=>i_,ZodNonOptional:()=>zm,ZodNull:()=>t_,ZodNullable:()=>y_,ZodNumber:()=>za,ZodNumberFormat:()=>co,ZodObject:()=>Bc,ZodOptional:()=>lo,ZodPipe:()=>Gc,ZodPrefault:()=>$_,ZodPreprocess:()=>z_,ZodPromise:()=>D_,ZodReadonly:()=>P_,ZodRecord:()=>Sa,ZodSet:()=>m_,ZodString:()=>Ta,ZodStringFormat:()=>et,ZodSuccess:()=>x_,ZodSymbol:()=>Qy,ZodTemplateLiteral:()=>O_,ZodTransform:()=>g_,ZodTuple:()=>u_,ZodType:()=>Te,ZodULID:()=>mm,ZodURL:()=>Fc,ZodUUID:()=>bn,ZodUndefined:()=>e_,ZodUnion:()=>Hc,ZodUnknown:()=>n_,ZodVoid:()=>o_,ZodXID:()=>fm,ZodXor:()=>s_,_ZodString:()=>am,_default:()=>b_,_function:()=>HI,any:()=>TI,array:()=>je,base64:()=>sI,base64url:()=>cI,bigint:()=>wI,boolean:()=>$t,catch:()=>I_,check:()=>JI,cidrv4:()=>oI,cidrv6:()=>aI,codec:()=>FI,creditCard:()=>uI,cuid:()=>X0,cuid2:()=>Y0,currencyCode:()=>gI,custom:()=>Pm,date:()=>PI,describe:()=>GI,discriminatedUnion:()=>Jc,e164:()=>lI,email:()=>Z0,emoji:()=>K0,enum:()=>Lt,exactOptional:()=>v_,file:()=>MI,float32:()=>yI,float64:()=>_I,function:()=>HI,guid:()=>F0,hash:()=>vI,hex:()=>hI,hostname:()=>fI,httpUrl:()=>G0,iban:()=>dI,instanceof:()=>WI,int:()=>im,int32:()=>bI,int64:()=>kI,intersection:()=>Oa,invertCodec:()=>VI,ipv4:()=>rI,ipv6:()=>iI,json:()=>YI,jwt:()=>pI,keyof:()=>EI,ksuid:()=>tI,lazy:()=>R_,literal:()=>fe,looseObject:()=>Mt,looseRecord:()=>DI,mac:()=>nI,map:()=>CI,meta:()=>KI,nan:()=>ZI,nanoid:()=>W0,nativeEnum:()=>NI,never:()=>Sm,nonoptional:()=>k_,null:()=>Vc,nullable:()=>Zc,nullish:()=>LI,number:()=>He,object:()=>ie,optional:()=>Qe,partialRecord:()=>RI,pipe:()=>om,prefault:()=>w_,preprocess:()=>Xc,promise:()=>BI,readonly:()=>E_,record:()=>tt,refine:()=>A_,set:()=>AI,strictObject:()=>OI,string:()=>C,stringFormat:()=>mI,stringbool:()=>XI,success:()=>UI,superRefine:()=>N_,symbol:()=>SI,templateLiteral:()=>qI,transform:()=>Im,tuple:()=>d_,uint32:()=>$I,uint64:()=>xI,ulid:()=>Q0,undefined:()=>II,union:()=>Xe,unknown:()=>it,url:()=>J0,uuid:()=>V0,uuidv4:()=>q0,uuidv6:()=>B0,uuidv7:()=>H0,void:()=>zI,xid:()=>eI,xor:()=>jI});var rm={};hn(rm,{endsWith:()=>fa,gt:()=>yn,gte:()=>Er,includes:()=>pa,length:()=>io,lowercase:()=>ua,lt:()=>vn,lte:()=>Pr,maxLength:()=>no,maxSize:()=>li,mime:()=>ga,minLength:()=>An,minSize:()=>_n,multipleOf:()=>ci,negative:()=>Zp,nonnegative:()=>Vp,nonpositive:()=>Fp,normalize:()=>va,overwrite:()=>en,positive:()=>Up,properties:()=>ha,property:()=>qp,regex:()=>la,size:()=>ro,slugify:()=>$a,startsWith:()=>ma,toLowerCase:()=>_a,toUpperCase:()=>ba,trim:()=>ya,uppercase:()=>da});var L0=new WeakSet([Object.prototype,Error.prototype]);function nm(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let i=n(this);return Object.defineProperty(this,t,{value:i,configurable:!0,writable:!0}),i},set(i){Object.defineProperty(this,t,{value:i,configurable:!0,writable:!0})}})}var U0=(e,t)=>{gg.init(e,t),e.name="ZodError";let n=Object.getPrototypeOf(e);L0.has(n)||(L0.add(n),nm(n,"format",i=>r=>Ks(i,r)),nm(n,"flatten",i=>r=>Gs(i,r)),nm(n,"addIssue",i=>r=>{i.issues.push(r),i.message=JSON.stringify(i.issues,Mo,2)}),nm(n,"addIssues",i=>r=>{i.issues.push(...r),i.message=JSON.stringify(i.issues,Mo,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},KA=E("ZodError",U0),yr=E("ZodError",U0,void 0,{Parent:Error});var My=qo(yr),Ly=Bo(yr),Uy=Ho(yr),Zy=Go(yr),Fy=Su(yr),Vy=Iu(yr),qy=Tu(yr),By=zu(yr),Hy=Pu(yr),Jy=Eu(yr),Gy=Ou(yr),Ky=ju(yr);function XA(){jt.localeError||vt(lp())}function ao(){jt.memoizer||vt({memoizer:pc()})}var Te=E("ZodType",(e,t)=>(XA(),xe.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(L.mergeDefs(t,{checks:[...t.checks??[],...e.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return Be(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(A_(e,t))},superRefine(e,t){return this.check(N_(e,t))},overwrite(e){return this.check(en(e))},optional(){return Qe(this)},exactOptional(){return v_(this)},nullable(){return Zc(this)},nullish(){return Qe(Zc(this))},nonoptional(e){return k_(this,e)},array(){return je(this)},or(e){return Xe([this,e])},and(e){return Oa(this,e)},transform(e){return om(this,Im(e))},default(e){return b_(this,e)},prefault(e){return w_(this,e)},catch(e){return I_(this,e)},pipe(e){return om(this,e)},readonly(){return E_(this)},describe(e){let t=this.clone();return Nt.add(t,{description:e}),t},meta(...e){if(e.length===0)return Nt.get(this);let t=this.clone();return Nt.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return L.hide(this,"~standard",{...Vu(this),jsonSchema:{input:wa(this,"input"),output:wa(this,"output")}})},set"~standard"(e){L.own(this,"~standard",e)},parse:function e(t,n){return My(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await Ly(this,t,n,{callee:e})},safeParse(e,t){return Uy(this,e,t)},async safeParseAsync(e,t){return Zy(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){L.own(this,"spa",e)},validate(e,t){return Wo(this,e,t)},validateAsync(e,t){return Xo(this,e,t)},encode:function e(t,n){return Fy(this,t,n,{callee:e})},decode:function e(t,n){return Vy(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await qy(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await By(this,t,n,{callee:e})},safeEncode(e,t){return Hy(this,e,t)},safeDecode(e,t){return Jy(this,e,t)},async safeEncodeAsync(e,t){return Gy(this,e,t)},async safeDecodeAsync(e,t){return Ky(this,e,t)},toJSONSchema(e){return Xv(this,{})(e)},get description(){return Nt.get(this)?.description},get _def(){return this._zod.def}}),am=E("_ZodString",(e,t)=>{ai.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(n,i,r)=>ey(e,n,i,r)},L.derived({format:e=>zt(e).format??null,minLength:e=>zt(e).minimum??null,maxLength:e=>zt(e).maximum??null},{regex(...e){return this.check(la(...e))},includes(...e){return this.check(pa(...e))},startsWith(...e){return this.check(ma(...e))},endsWith(...e){return this.check(fa(...e))},min(...e){return this.check(An(...e))},max(...e){return this.check(no(...e))},length(...e){return this.check(io(...e))},nonempty(...e){return this.check(An(1,...e))},lowercase(e){return this.check(ua(e))},uppercase(e){return this.check(da(e))},trim(){return this.check(ya())},normalize(...e){return this.check(va(...e))},toLowerCase(){return this.check(_a())},toUpperCase(){return this.check(ba())},slugify(){return this.check($a())}})),Ta=E("ZodString",(e,t)=>{ai.init(e,t),am.init(e,t)},{email(e){return this.check(fc(sm,e))},url(e){return this.check(ca(Fc,e))},jwt(e){return this.check(Dc(km,e))},emoji(e){return this.check(bc(lm,e))},guid(e){return this.check(hc(cm,e))},uuid(e){return this.check(gc(bn,e))},uuidv4(e){return this.check(vc(bn,e))},uuidv6(e){return this.check(yc(bn,e))},uuidv7(e){return this.check(_c(bn,e))},nanoid(e){return this.check($c(um,e))},cuid(e){return this.check(wc(dm,e))},cuid2(e){return this.check(kc(pm,e))},ulid(e){return this.check(xc(mm,e))},base64(e){return this.check(Oc(bm,e))},base64url(e){return this.check(jc($m,e))},xid(e){return this.check(Sc(fm,e))},ksuid(e){return this.check(Ic(hm,e))},ipv4(e){return this.check(Tc(gm,e))},ipv6(e){return this.check(zc(vm,e))},cidrv4(e){return this.check(Pc(ym,e))},cidrv6(e){return this.check(Ec(_m,e))},e164(e){return this.check(Rc(wm,e))},datetime(e){return this.check(Cc(fi,e))},date(e){return this.check(Ac(hi,e))},time(e){return this.check(Nc(gi,e))},duration(e){return this.check(Mc(vi,e))}});function C(e){return vp(Ta,e)}var et=E("ZodStringFormat",(e,t)=>{Ge.init(e,t),am.init(e,t)}),fi=E("ZodISODateTime",(e,t)=>{Sv.init(e,t),et.init(e,t)}),hi=E("ZodISODate",(e,t)=>{Iv.init(e,t),et.init(e,t)}),gi=E("ZodISOTime",(e,t)=>{Tv.init(e,t),et.init(e,t)}),vi=E("ZodISODuration",(e,t)=>{zv.init(e,t),et.init(e,t)}),sm=E("ZodEmail",(e,t)=>{Hu.init(e,t),et.init(e,t)});function Z0(e){return fc(sm,e)}var cm=E("ZodGUID",(e,t)=>{qu.init(e,t),et.init(e,t)});function F0(e){return hc(cm,e)}var bn=E("ZodUUID",(e,t)=>{Bu.init(e,t),et.init(e,t)});function V0(e){return gc(bn,e)}function q0(e){return vc(bn,e)}function B0(e){return yc(bn,e)}function H0(e){return _c(bn,e)}var Fc=E("ZodURL",(e,t)=>{Wu.init(e,t),et.init(e,t)});function J0(e){return ca(Fc,e)}function G0(e){return ca(Fc,{protocol:Ws,hostname:Lg,...L.normalizeParams(e)})}var lm=E("ZodEmoji",(e,t)=>{Xu.init(e,t),et.init(e,t)});function K0(e){return bc(lm,e)}var um=E("ZodNanoID",(e,t)=>{Yu.init(e,t),et.init(e,t)});function W0(e){return $c(um,e)}var dm=E("ZodCUID",(e,t)=>{Qu.init(e,t),et.init(e,t)});function X0(e){return wc(dm,e)}var pm=E("ZodCUID2",(e,t)=>{ed.init(e,t),et.init(e,t)});function Y0(e){return kc(pm,e)}var mm=E("ZodULID",(e,t)=>{td.init(e,t),et.init(e,t)});function Q0(e){return xc(mm,e)}var fm=E("ZodXID",(e,t)=>{rd.init(e,t),et.init(e,t)});function eI(e){return Sc(fm,e)}var hm=E("ZodKSUID",(e,t)=>{nd.init(e,t),et.init(e,t)});function tI(e){return Ic(hm,e)}var gm=E("ZodIPv4",(e,t)=>{id.init(e,t),et.init(e,t)});function rI(e){return Tc(gm,e)}var Wy=E("ZodMAC",(e,t)=>{ad.init(e,t),et.init(e,t)});function nI(e){return yp(Wy,e)}var vm=E("ZodIPv6",(e,t)=>{od.init(e,t),et.init(e,t)});function iI(e){return zc(vm,e)}var ym=E("ZodCIDRv4",(e,t)=>{sd.init(e,t),et.init(e,t)});function oI(e){return Pc(ym,e)}var _m=E("ZodCIDRv6",(e,t)=>{ld.init(e,t),et.init(e,t)});function aI(e){return Ec(_m,e)}var bm=E("ZodBase64",(e,t)=>{dd.init(e,t),et.init(e,t)});function sI(e){return Oc(bm,e)}var $m=E("ZodBase64URL",(e,t)=>{md.init(e,t),et.init(e,t)});function cI(e){return jc($m,e)}var wm=E("ZodE164",(e,t)=>{fd.init(e,t),et.init(e,t)});function lI(e){return Rc(wm,e)}var Xy=E("ZodCreditCard",(e,t)=>{gd.init(e,t),et.init(e,t)});function uI(e){return _p(Xy,e)}var Yy=E("ZodIBAN",(e,t)=>{yd.init(e,t),et.init(e,t)});function dI(e){return bp(Yy,e)}var km=E("ZodJWT",(e,t)=>{bd.init(e,t),et.init(e,t)});function pI(e){return Dc(km,e)}var so=E("ZodCustomStringFormat",(e,t)=>{$d.init(e,t),et.init(e,t)});function mI(e,t,n={}){return ui(so,e,t,n)}function fI(e){return ui(so,"hostname",Mg,e)}function hI(e){return ui(so,"hex",Qg,e)}function gI(e){return ui(so,"currency_code",Zg,e)}function vI(e,t){let n=t?.enc??"hex",i=`${e}_${n}`,r=zr[i];if(!r)throw new Error(`Unrecognized hash format: ${i}`);return ui(so,i,r,t)}var za=E("ZodNumber",(e,t)=>{oc.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(n,i,r)=>ty(e,n,i,r),e.isFinite=!0},L.derived({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=zt(e);return Math.max(t??Number.NEGATIVE_INFINITY,n??Number.NEGATIVE_INFINITY)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=zt(e);return Math.min(t??Number.POSITIVE_INFINITY,n??Number.POSITIVE_INFINITY)},isInt:e=>{let{isInt:t,multipleOf:n}=zt(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>zt(e).format??null},{gt(e,t){return this.check(yn(e,t))},gte(e,t){return this.check(Er(e,t))},min(e,t){return this.check(Er(e,t))},lt(e,t){return this.check(vn(e,t))},lte(e,t){return this.check(Pr(e,t))},max(e,t){return this.check(Pr(e,t))},int(e){return this.check(im(e))},safe(e){return this.check(im(e))},positive(e){return this.check(yn(0,e))},nonnegative(e){return this.check(Er(0,e))},negative(e){return this.check(vn(0,e))},nonpositive(e){return this.check(Pr(0,e))},multipleOf(e,t){return this.check(ci(e,t))},step(e,t){return this.check(ci(e,t))},finite(){return this}}));function He(e){return $p(za,e)}var co=E("ZodNumberFormat",(e,t)=>{wd.init(e,t),za.init(e,t)});function im(e){return wp(co,e)}function yI(e){return kp(co,e)}function _I(e){return xp(co,e)}function bI(e){return Sp(co,e)}function $I(e){return Ip(co,e)}var Pa=E("ZodBoolean",(e,t)=>{ea.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(n,i,r)=>ry(e,n,i,r)});function $t(e){return Tp(Pa,e)}var Ea=E("ZodBigInt",(e,t)=>{ac.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(n,i,r)=>ny(e,n,i,r)},L.derived({minValue:e=>zt(e).minimum??null,maxValue:e=>zt(e).maximum??null,format:e=>zt(e).format??null},{gte(e,t){return this.check(Er(e,t))},min(e,t){return this.check(Er(e,t))},gt(e,t){return this.check(yn(e,t))},lt(e,t){return this.check(vn(e,t))},lte(e,t){return this.check(Pr(e,t))},max(e,t){return this.check(Pr(e,t))},positive(e){return this.check(yn(BigInt(0),e))},negative(e){return this.check(vn(BigInt(0),e))},nonpositive(e){return this.check(Pr(BigInt(0),e))},nonnegative(e){return this.check(Er(BigInt(0),e))},multipleOf(e,t){return this.check(ci(e,t))}}));function wI(e){return zp(Ea,e)}var xm=E("ZodBigIntFormat",(e,t)=>{kd.init(e,t),Ea.init(e,t)});function kI(e){return Pp(xm,e)}function xI(e){return Ep(xm,e)}var Qy=E("ZodSymbol",(e,t)=>{xd.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(n,i,r)=>iy(e,n,i,r)});function SI(e){return Op(Qy,e)}var e_=E("ZodUndefined",(e,t)=>{Sd.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(n,i,r)=>ay(e,n,i,r)});function II(e){return jp(e_,e)}var t_=E("ZodNull",(e,t)=>{Id.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(n,i,r)=>oy(e,n,i,r)});function Vc(e){return Rp(t_,e)}var r_=E("ZodAny",(e,t)=>{Td.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(n,i,r)=>ly(e,n,i,r)});function TI(){return Dp(r_)}var n_=E("ZodUnknown",(e,t)=>{zd.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(n,i,r)=>uy(e,n,i,r)});function it(){return Cp(n_)}var i_=E("ZodNever",(e,t)=>{Pd.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(n,i,r)=>cy(e,n,i,r)});function Sm(e){return Ap(i_,e)}var o_=E("ZodVoid",(e,t)=>{Ed.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(n,i,r)=>sy(e,n,i,r)});function zI(e){return Np(o_,e)}var qc=E("ZodDate",(e,t)=>{Od.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(n,i,r)=>dy(e,n,i,r),e.min=(n,i)=>e.check(Er(n,i)),e.max=(n,i)=>e.check(Pr(n,i))},L.derived({minDate:e=>{let{minimum:t}=zt(e);return t?new Date(t):null},maxDate:e=>{let{maximum:t}=zt(e);return t?new Date(t):null}},{}));function PI(e){return Mp(qc,e)}var a_=E("ZodArray",(e,t)=>{ao(),jd.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(n,i,r)=>ky(e,n,i,r),e.element=t.element},{min(e,t){return this.check(An(e,t))},nonempty(e){return this.check(An(1,e))},max(e,t){return this.check(no(e,t))},length(e,t){return this.check(io(e,t))},unwrap(){return this.element}});function je(e,t){return Kv(a_,e,t)}function EI(e){let t=e._zod.def.shape;return Lt(Object.keys(t))}var Bc=E("ZodObject",(e,t)=>{ao(),Ev.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(n,i,r)=>xy(e,n,i,r),L.installLazyProp(e,"shape",n=>n._zod.def.shape,!1)},{keyof(){return Lt(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(L.mergeDefs(this._zod.def,{catchall:e}))},passthrough(){return this.clone(L.mergeDefs(this._zod.def,{catchall:it()}))},loose(){return this.clone(L.mergeDefs(this._zod.def,{catchall:it()}))},strict(){return this.clone(L.mergeDefs(this._zod.def,{catchall:Sm()}))},strip(){return this.clone(L.mergeDefs(this._zod.def,{catchall:void 0}))},extend(e){return L.extend(this,e)},safeExtend(e){return L.safeExtend(this,e)},merge(e){return L.merge(this,e)},pick(e){return L.pick(this,e)},omit(e){return L.omit(this,e)},partial(...e){return L.partial(lo,this,e[0])},exactPartial(...e){return L.partial(Tm,this,e[0],"exactPartial")},required(...e){return L.required(zm,this,e[0])}});function ie(e,t){let n={type:"object",shape:e??{},...L.normalizeParams(t)};return new Bc(n)}function OI(e,t){return new Bc({type:"object",shape:e,catchall:Sm(),...L.normalizeParams(t)})}function Mt(e,t){return new Bc({type:"object",shape:e,catchall:it(),...L.normalizeParams(t)})}var Hc=E("ZodUnion",(e,t)=>{ta.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(n,i,r)=>Qp(e,n,i,r),e.options=t.options});function Xe(e,t){return new Hc({type:"union",options:e,...L.normalizeParams(t)})}var s_=E("ZodXor",(e,t)=>{Hc.init(e,t),Dd.init(e,t),e._zod.processJSONSchema=(n,i,r)=>Qp(e,n,i,r),e.options=t.options});function jI(e,t){return new s_({type:"union",options:e,inclusive:!1,...L.normalizeParams(t)})}var c_=E("ZodDiscriminatedUnion",(e,t)=>{Hc.init(e,t),Cd.init(e,t)});function Jc(e,t,n){return new c_({type:"union",options:t,discriminator:e,...L.normalizeParams(n)})}var l_=E("ZodIntersection",(e,t)=>{Ad.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(n,i,r)=>Sy(e,n,i,r)});function Oa(e,t){return new l_({type:"intersection",left:e,right:t})}var u_=E("ZodTuple",(e,t)=>{ao(),sc.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(n,i,r)=>Iy(e,n,i,r)},{rest(e){return this.clone({...this._zod.def,rest:e})},partial(){let e=this._zod.def;if(e.checks?.length)throw new Error(".partial() cannot be used on tuple schemas containing refinements");return this.clone({...e,items:e.items.map(t=>new lo({type:"optional",innerType:t}))})}});function d_(e,t,n){let i=t instanceof xe,r=i?n:t,o=i?t:null;return new u_({type:"tuple",items:e,rest:o,...L.normalizeParams(r)})}var Sa=E("ZodRecord",(e,t)=>{ao(),Nd.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(n,i,r)=>Ty(e,n,i,r),e.keyType=t.keyType,e.valueType=t.valueType});function tt(e,t,n){return!t||!t._zod?new Sa({type:"record",keyType:C(),valueType:e,...L.normalizeParams(t)}):new Sa({type:"record",keyType:e,valueType:t,...L.normalizeParams(n)})}function RI(e,t,n){return new Sa({type:"record",keyType:e,valueType:t,...L.normalizeParams(n),partial:!0})}function DI(e,t,n){return new Sa({type:"record",keyType:e,valueType:t,mode:"loose",...L.normalizeParams(n)})}var p_=E("ZodMap",(e,t)=>{ao(),Md.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(n,i,r)=>$y(e,n,i,r),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...n)=>e.check(_n(...n)),e.nonempty=n=>e.check(_n(1,n)),e.max=(...n)=>e.check(li(...n)),e.size=(...n)=>e.check(ro(...n))});function CI(e,t,n){return new p_({type:"map",keyType:e,valueType:t,...L.normalizeParams(n)})}var m_=E("ZodSet",(e,t)=>{ao(),Ld.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(n,i,r)=>wy(e,n,i,r),e.min=(...n)=>e.check(_n(...n)),e.nonempty=n=>e.check(_n(1,n)),e.max=(...n)=>e.check(li(...n)),e.size=(...n)=>e.check(ro(...n))});function AI(e,t){return new m_({type:"set",valueType:e,...L.normalizeParams(t)})}var Ia=E("ZodEnum",(e,t)=>{Ud.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(i,r,o)=>py(e,i,r,o),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(i,r)=>{let o={};for(let a of i)if(n.has(a))o[a]=t.entries[a];else throw new Error(`Key ${a} not found in enum`);return new Ia({...t,checks:[],...L.normalizeParams(r),entries:o})},e.exclude=(i,r)=>{let o={...t.entries};for(let a of i)if(n.has(a))delete o[a];else throw new Error(`Key ${a} not found in enum`);return new Ia({...t,checks:[],...L.normalizeParams(r),entries:o})}});function Lt(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(i=>[i,i])):e;return new Ia({type:"enum",entries:n,...L.normalizeParams(t)})}function NI(e,t){return new Ia({type:"enum",entries:e,...L.normalizeParams(t)})}var f_=E("ZodLiteral",(e,t)=>{Zd.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(n,i,r)=>my(e,n,i,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function fe(e,t){return new f_({type:"literal",values:Array.isArray(e)?e:[e],...L.normalizeParams(t)})}var h_=E("ZodFile",(e,t)=>{Fd.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(n,i,r)=>gy(e,n,i,r),e.min=(n,i)=>e.check(_n(n,i)),e.max=(n,i)=>e.check(li(n,i)),e.mime=(n,i)=>e.check(ga(Array.isArray(n)?n:[n],i))});function MI(e){return Bp(h_,e)}var g_=E("ZodTransform",(e,t)=>{ao(),Vd.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(n,i,r)=>by(e,n,i,r),e._zod.parse=(n,i)=>{if(i.direction==="backward")throw new oi(e.constructor.name);n.addIssue=o=>{if(typeof o=="string")n.issues.push(L.issue(o,n.value,t));else{let a=o;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),"input"in a||(a.input=n.value),a.inst??(a.inst=e),n.issues.push(L.issue(a))}};let r=t.transform(n.value,n);return r instanceof Promise?r.then(o=>(n.value=o,n)):(n.value=r,n)}});function Im(e){return new g_({type:"transform",transform:e})}var lo=E("ZodOptional",(e,t)=>{cc.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(n,i,r)=>em(e,n,i,r),e.unwrap=()=>e._zod.def.innerType});function Qe(e){return new lo({type:"optional",innerType:e})}var Tm=E("ZodExactOptional",(e,t)=>{qd.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(n,i,r)=>em(e,n,i,r),e.unwrap=()=>e._zod.def.innerType});function v_(e){return new Tm({type:"optional",innerType:e})}var y_=E("ZodNullable",(e,t)=>{Bd.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(n,i,r)=>zy(e,n,i,r),e.unwrap=()=>e._zod.def.innerType});function Zc(e){return new y_({type:"nullable",innerType:e})}function LI(e){return Qe(Zc(e))}var __=E("ZodDefault",(e,t)=>{Hd.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(n,i,r)=>Oy(e,n,i,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function b_(e,t){return new __({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():L.shallowClone(t)}})}var $_=E("ZodPrefault",(e,t)=>{Jd.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(n,i,r)=>jy(e,n,i,r),e.unwrap=()=>e._zod.def.innerType});function w_(e,t){return new $_({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():L.shallowClone(t)}})}var zm=E("ZodNonOptional",(e,t)=>{Gd.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(n,i,r)=>Py(e,n,i,r),e.unwrap=()=>e._zod.def.innerType});function k_(e,t){return new zm({type:"nonoptional",innerType:e,...L.normalizeParams(t)})}var x_=E("ZodSuccess",(e,t)=>{Kd.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(n,i,r)=>vy(e,n,i,r),e.unwrap=()=>e._zod.def.innerType});function UI(e){return new x_({type:"success",innerType:e})}var S_=E("ZodCatch",(e,t)=>{Wd.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(n,i,r)=>Ry(e,n,i,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function I_(e,t){return new S_({type:"catch",innerType:e,catchValue:typeof t=="function"?t:L.constantCatch(t)})}var T_=E("ZodNaN",(e,t)=>{Xd.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(n,i,r)=>fy(e,n,i,r)});function ZI(e){return Lp(T_,e)}var Gc=E("ZodPipe",(e,t)=>{lc.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(n,i,r)=>Dy(e,n,i,r),e.in=t.in,e.out=t.out});function om(e,t){return new Gc({type:"pipe",in:e,out:t})}var Kc=E("ZodCodec",(e,t)=>{Gc.init(e,t),ra.init(e,t)});function FI(e,t,n){return new Kc({type:"pipe",in:e,out:t,transform:n.decode,reverseTransform:n.encode})}function VI(e){let t=e._zod.def;return new Kc({type:"pipe",in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}var z_=E("ZodPreprocess",(e,t)=>{Gc.init(e,t),jv.init(e,t)}),P_=E("ZodReadonly",(e,t)=>{Yd.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(n,i,r)=>Cy(e,n,i,r),e.unwrap=()=>e._zod.def.innerType});function E_(e){return new P_({type:"readonly",innerType:e})}var O_=E("ZodTemplateLiteral",(e,t)=>{Qd.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(n,i,r)=>hy(e,n,i,r)});function qI(e,t){return new O_({type:"template_literal",parts:e,...L.normalizeParams(t)})}var j_=E("ZodLazy",(e,t)=>{na.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(n,i,r)=>Ny(e,n,i,r),e.unwrap=()=>e._zod.def.getter()});function R_(e){return new j_({type:"lazy",getter:e})}var D_=E("ZodPromise",(e,t)=>{tp.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(n,i,r)=>Ay(e,n,i,r),e.unwrap=()=>e._zod.def.innerType});function BI(e){return new D_({type:"promise",innerType:e})}var C_=E("ZodFunction",(e,t)=>{ep.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(n,i,r)=>_y(e,n,i,r)});function HI(e){return new C_({type:"function",input:Array.isArray(e?.input)?d_(e?.input):e?.input??je(it()),output:e?.output??it()})}var Wc=E("ZodCustom",(e,t)=>{rp.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(n,i,r)=>yy(e,n,i,r)});function JI(e){let t=new Ye({check:"custom"});return t._zod.check=e,t}function Pm(e,t){return Hp(Wc,e??(()=>!0),t)}function A_(e,t={}){return Jp(Wc,e,t)}function N_(e,t){return Gp(e,t)}var GI=Kp,KI=Wp,M_=E("ZodInstanceOf",(e,t)=>{Wc.init(e,t)},{properties(e,t){return this.check(ha(e,t))}});function WI(e,t={}){let n=new M_({type:"custom",check:"custom",fn:i=>i instanceof e,abort:!0,...L.normalizeParams(t)});return n._zod.bag.Class=e,n._zod.check=i=>{i.value instanceof e||i.issues.push({code:"invalid_type",expected:e.name,input:i.value,inst:n,path:[...n._zod.def.path??[]]})},n}var XI=(...e)=>Xp({Codec:Kc,Boolean:Pa,String:Ta},...e);function YI(e){let t=R_(()=>Xe([C(e),He(),$t(),Vc(),je(t),tt(C(),t)]));return t}function Xc(e,t){return new z_({type:"pipe",in:Im(e),out:t})}var YA={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 QA(e){vt({customError:e})}function eN(){return vt().customError}var L_;L_||(L_={});var uo={};hn(uo,{ZodISODate:()=>hi,ZodISODateTime:()=>fi,ZodISODuration:()=>vi,ZodISOTime:()=>gi,date:()=>rN,datetime:()=>tN,duration:()=>iN,time:()=>nN});function tN(e){return Cc(fi,e)}function rN(e){return Ac(hi,e)}function nN(e){return Nc(gi,e)}function iN(e){return Mc(vi,e)}var re={...ja,...rm,iso:uo},oN=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 aN(e,t){let n=e.$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":t??"draft-2020-12"}function QI(e,t){return e.map((n,i)=>i<t?n:n.optional())}function sN(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function cN(e,t){if(!e.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let n=e.slice(1).split("/").filter(Boolean);if(n.length===0)return t.rootSchema;let i=t.version==="draft-2020-12"?"$defs":"definitions";if(n[0]===i){let r=n[1]===void 0?void 0:sN(n[1]);if(!r||!t.defs[r])throw new Error(`Reference not found: ${e}`);return t.defs[r]}throw new Error(`Reference not found: ${e}`)}function lN(e,t){return re.transform(i=>i).check(i=>{let r=i.value;if(typeof r!="object"||r===null||Array.isArray(r))return;let o=Object.getOwnPropertyNames(r);if(t.minProperties!==void 0&&o.length<t.minProperties&&i.issues.push({origin:"object",code:"too_small",minimum:t.minProperties,inclusive:!0,message:`Too small: expected object to have >=${t.minProperties} properties`,input:r,inst:e,continue:!0}),t.maxProperties!==void 0&&o.length>t.maxProperties&&i.issues.push({origin:"object",code:"too_big",maximum:t.maxProperties,inclusive:!0,message:`Too big: expected object to have <=${t.maxProperties} properties`,input:r,inst:e,continue:!0}),t.keySchema)for(let a of o){let s=t.keySchema.safeParse(a);s.success||i.issues.push({code:"invalid_key",origin:"record",issues:s.error.issues,input:a,path:[a],continue:!0})}}).pipe(e)}function U_(e,t){if(e===null)return"z";let n=typeof e;if(n!=="object"){if(n==="number"&&Number.isNaN(e))return null;let i=String(e);return`${n[0]}${i.length}:${i}`}if(t.has(e))return null;t.add(e);try{if(Array.isArray(e)){let o=[];for(let a of e){let s=U_(a,t);if(s===null)return null;o.push(s)}return`a${o.length}:[${o.join(",")}]`}let i=Object.keys(e).sort(),r=[];for(let o of i){let a=U_(e[o],t);if(a===null)return null;r.push(`${o.length}:${o}=${a}`)}return`o${r.length}:{${r.join(",")}}`}finally{t.delete(e)}}var uN=new Set(["items","prefixItems","additionalItems","additionalProperties","contains","propertyNames","not","if","then","else","allOf","anyOf","oneOf","unevaluatedItems","unevaluatedProperties","contentSchema"]),dN=new Set(["properties","patternProperties","dependentSchemas","dependencies","$defs","definitions"]);function Yc(e){return typeof e!="object"||e===null?!1:Array.isArray(e)?e.some(Yc):typeof e.$ref=="string"?!0:Object.entries(e).some(([t,n])=>uN.has(t)?Yc(n):!dN.has(t)||typeof n!="object"||n===null?!1:Object.values(n).some(Yc))}function eT(e){return e===1?"element":"elements"}function pN(e,t){return re.transform(i=>i).check(i=>{let r=i.value;if(Array.isArray(r)){if(t.uniqueItems===!0){let o=new Map;for(let a=0;a<r.length;a++){let s=U_(r[a],new Set);if(s===null)continue;let c=o.get(s);if(c===void 0){o.set(s,a);continue}i.issues.push({code:"custom",message:`Array items must be unique: element at index ${a} duplicates the one at index ${c}`,input:r,path:[a],continue:!0})}}if(t.containsSchema){let o=t.minContains??1,a=t.maxContains!==void 0?t.maxContains+1:Number.POSITIVE_INFINITY,s=0;for(let c of r)if(t.containsSchema.safeParse(c).success&&++s>=a)break;s<o&&i.issues.push({code:"custom",message:`Array must contain at least ${o} matching ${eT(o)}; found ${s}`,input:r,continue:!0}),t.maxContains!==void 0&&s>t.maxContains&&i.issues.push({code:"custom",message:`Array must contain at most ${t.maxContains} matching ${eT(t.maxContains)}`,input:r,continue:!0})}}}).pipe(e)}function tT(e,t){if(e!==!1)return e===void 0||e===!0?re.any():ar(e,t)}var mN=/^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/;function rT(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return re.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let r=e.$ref;if(t.refs.has(r))return t.refs.get(r);if(t.processing.has(r))return re.lazy(()=>{if(!t.refs.has(r))throw new Error(`Circular reference not resolved: ${r}`);return t.refs.get(r)});t.processing.add(r);let o=cN(r,t),a=ar(o,t);return t.refs.set(r,a),t.processing.delete(r),a}if(e.enum!==void 0){let r=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&r.length===1&&r[0]===null)return re.null();if(r.length===0)return re.never();if(r.length===1)return re.literal(r[0]);if(r.every(a=>typeof a=="string"))return re.enum(r);let o=r.map(a=>re.literal(a));return o.length<2?o[0]:re.union([o[0],o[1],...o.slice(2)])}if(e.const!==void 0)return re.literal(e.const);let n=e.type;if(Array.isArray(n)){let r=n.map(o=>{let a={...e,type:o};return rT(a,t)});return r.length===0?re.never():r.length===1?r[0]:re.union(r)}if(!n)return re.any();let i;switch(n){case"string":{let r=re.string();if(e.format){let o=e.format;o==="email"?r=r.check(re.email()):o==="uri"||o==="uri-reference"?r=r.check(re.url()):o==="uuid"||o==="guid"?r=r.check(re.uuid()):o==="date-time"?r=r.check(re.iso.datetime({offset:!0})):o==="date"?r=r.check(re.iso.date()):o==="time"?r=r.check(re.regex(mN)):o==="duration"?r=r.check(re.iso.duration()):o==="hostname"?r=r.check(re.hostname()):o==="ipv4"?r=r.check(re.ipv4()):o==="ipv6"?r=r.check(re.ipv6()):o==="mac"?r=r.check(re.mac()):o==="cidr"?r=r.check(re.cidrv4()):o==="cidr-v6"?r=r.check(re.cidrv6()):o==="base64"?r=r.check(re.base64()):o==="base64url"?r=r.check(re.base64url()):o==="e164"?r=r.check(re.e164()):o==="credit_card"?r=r.check(re.creditCard()):o==="iban"?r=r.check(re.iban()):o==="jwt"?r=r.check(re.jwt()):o==="emoji"?r=r.check(re.emoji()):o==="nanoid"?r=r.check(re.nanoid()):o==="cuid"?r=r.check(re.cuid()):o==="cuid2"?r=r.check(re.cuid2()):o==="ulid"?r=r.check(re.ulid()):o==="xid"?r=r.check(re.xid()):o==="ksuid"&&(r=r.check(re.ksuid()))}typeof e.minLength=="number"&&(r=r.min(e.minLength)),typeof e.maxLength=="number"&&(r=r.max(e.maxLength)),e.pattern&&(r=r.regex(new RegExp(e.pattern))),i=r;break}case"number":case"integer":{let r=n==="integer"?re.number().int():re.number();typeof e.minimum=="number"&&e.exclusiveMinimum!==!0&&(r=r.min(e.minimum)),typeof e.maximum=="number"&&e.exclusiveMaximum!==!0&&(r=r.max(e.maximum)),typeof e.exclusiveMinimum=="number"?r=r.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(r=r.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?r=r.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(r=r.lt(e.maximum)),typeof e.multipleOf=="number"&&(r=r.multipleOf(e.multipleOf)),i=r;break}case"boolean":{i=re.boolean();break}case"null":{i=re.null();break}case"object":{let r={},o=e.properties||{},a=new Set(e.required||[]),s=typeof e.additionalProperties=="object"?ar(e.additionalProperties,t):void 0;for(let[p,h]of Object.entries(o)){let g=ar(h,t);At(r,p,a.has(p)?g:g.optional())}if(e.patternProperties){let p=e.patternProperties,h=Object.keys(p),g=[];for(let k of h){let T=ar(p[k],t),z=re.string().regex(new RegExp(k));g.push(re.looseRecord(z,T))}let _=[];if(Object.keys(r).length>0&&_.push(re.object(r).passthrough()),_.push(...g),_.length===0)i=re.object({}).passthrough();else if(_.length===1)i=_[0];else{let k=re.intersection(_[0],_[1]);for(let T=2;T<_.length;T++)k=re.intersection(k,_[T]);i=k}if(e.additionalProperties===!1){let k=Object.keys(r),T=h.map(S=>new RegExp(S)),z=i;i=i.check(S=>{if(!Mr(S.value))return;let A=[];for(let Q of Object.keys(S.value))k.includes(Q)||T.some(X=>X.test(Q))||A.push(Q);A.length&&S.issues.push({code:"unrecognized_keys",keys:A,input:S.value,inst:z})})}}else{let p=re.object(r);e.additionalProperties===!1?i=p.strict():s?i=p.catchall(s):i=p.passthrough()}let c=e.propertyNames!==void 0&&e.propertyNames!==!0,l=typeof e.minProperties=="number"?e.minProperties:void 0,u=typeof e.maxProperties=="number"?e.maxProperties:void 0;if(c||l!==void 0||u!==void 0){let p;if(c){let h=typeof e.propertyNames=="object"&&e.propertyNames.type===void 0?{type:"string",...e.propertyNames}:e.propertyNames;p=ar(h,t)}i=lN(i,{keySchema:p,minProperties:l,maxProperties:u})}break}case"array":{let r=e.prefixItems,o=e.items;if(r&&Array.isArray(r)){let a=typeof e.minItems=="number"?e.minItems:0,s=r.map(p=>ar(p,t)),c=QI(s,a),l=Array.isArray(o)?void 0:tT(o,t),u=re.tuple(c);i=l?u.rest(l):u,typeof e.minItems=="number"&&(i=i.check(re.minLength(e.minItems))),typeof e.maxItems=="number"&&(i=i.check(re.maxLength(e.maxItems)))}else if(Array.isArray(o)){let a=typeof e.minItems=="number"?e.minItems:0,s=o.map(p=>ar(p,t)),c=QI(s,a),l=tT(e.additionalItems,t),u=re.tuple(c);i=l?u.rest(l):u,typeof e.minItems=="number"&&(i=i.check(re.minLength(e.minItems))),typeof e.maxItems=="number"&&(i=i.check(re.maxLength(e.maxItems)))}else if(o!==void 0){let a=ar(o,t),s=re.array(a);typeof e.minItems=="number"&&(s=s.min(e.minItems)),typeof e.maxItems=="number"&&(s=s.max(e.maxItems)),i=s}else i=re.array(re.any());(e.uniqueItems===!0||e.contains!==void 0)&&(i=pN(i,{uniqueItems:e.uniqueItems===!0,containsSchema:e.contains!==void 0?ar(e.contains,t):void 0,minContains:typeof e.minContains=="number"?e.minContains:void 0,maxContains:typeof e.maxContains=="number"?e.maxContains:void 0}));break}default:throw new Error(`Unsupported type: ${n}`)}return i}function ar(e,t){if(typeof e=="boolean")return e?re.any():re.never();let n=rT(e,t),i=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let s=e.anyOf.map(l=>ar(l,t)),c=re.union(s);n=i?re.intersection(n,c):c}if(e.oneOf&&Array.isArray(e.oneOf)){let s=e.oneOf.map(l=>ar(l,t)),c=re.xor(s);n=i?re.intersection(n,c):c}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)n=i?n:re.any();else{let s=i?n:ar(e.allOf[0],t),c=i?0:1;for(let l=c;l<e.allOf.length;l++)s=re.intersection(s,ar(e.allOf[l],t));n=s}e.nullable===!0&&t.version==="openapi-3.0"&&(n=re.nullable(n)),e.readOnly===!0&&(n=re.readonly(n)),e.default!==void 0&&(n=n.default(e.default));let r={},o=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let s of o)s in e&&(r[s]=e[s]);let a=["contentEncoding","contentMediaType","contentSchema"];for(let s of a)s in e&&(r[s]=e[s]);if(e.type==="object"&&e.$ref===void 0){e.propertyNames!==void 0&&!Yc(e.propertyNames)&&(r.propertyNames=e.propertyNames);for(let s of["minProperties","maxProperties"])e[s]!==void 0&&(r[s]=e[s])}if(e.type==="array"&&e.$ref===void 0){e.contains!==void 0&&!Yc(e.contains)&&(r.contains=e.contains);for(let s of["uniqueItems","minContains","maxContains"])e[s]!==void 0&&(r[s]=e[s])}for(let s of Object.keys(e))oN.has(s)||At(r,s,e[s]);return Object.keys(r).length>0&&t.registry.add(n,r),e.description&&(n=n.describe(e.description)),n}function nT(e,t){if(typeof e=="boolean")return e?re.any():re.never();let n;try{n=JSON.parse(JSON.stringify(e))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let i=aN(n,t?.defaultTarget),r=n.$defs||n.definitions||{},o={version:i,defs:r,refs:new Map,processing:new Set,rootSchema:n,registry:t?.registry??Nt};return ar(n,o)}var iT=Symbol("z.visit/resolving");function Qc(e,t){let n=typeof t=="function"?t:(a,s)=>{let c=t[a._zod.def.type];return c?c(a,s):a},i=new Map;function r(a){let s=i.get(a);if(s===iT)return new na({type:"lazy",getter:()=>i.get(a)});if(s!==void 0)return s;i.set(a,iT);let c=o(a),l=n(c,c!==a);return i.set(a,l),l}function o(a){let s=a._zod.def,c=s.type;switch(c){case"object":{let l=s.shape,u=Object.keys(l),p=!1,h={};for(let _ of u){let k=r(l[_]);k!==l[_]&&(p=!0),h[_]=k}let g=s.catchall;return s.catchall&&(g=r(s.catchall),g!==s.catchall&&(p=!0)),p?Be(a,{...s,shape:h,catchall:g}):a}case"array":{let l=r(s.element);return l===s.element?a:Be(a,{...s,element:l})}case"tuple":{let l=s.items,u=!1,p=[];for(let g of l){let _=r(g);_!==g&&(u=!0),p.push(_)}let h=s.rest;return s.rest&&(h=r(s.rest),h!==s.rest&&(u=!0)),u?Be(a,{...s,items:p,rest:h}):a}case"record":case"map":{let l=r(s.keyType),u=r(s.valueType);return l===s.keyType&&u===s.valueType?a:Be(a,{...s,keyType:l,valueType:u})}case"set":{let l=r(s.valueType);return l===s.valueType?a:Be(a,{...s,valueType:l})}case"union":{let l=s.options,u=!1,p=[];for(let h of l){let g=r(h);g!==h&&(u=!0),p.push(g)}return u?Be(a,{...s,options:p}):a}case"intersection":{let l=r(s.left),u=r(s.right);return l===s.left&&u===s.right?a:Be(a,{...s,left:l,right:u})}case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":{let l=r(s.innerType);return l===s.innerType?a:Be(a,{...s,innerType:l})}case"pipe":{let l=r(s.in),u=r(s.out);return l===s.in&&u===s.out?a:Be(a,{...s,in:l,out:u})}case"function":{let l=r(s.input),u=r(s.output);return l===s.input&&u===s.output?a:Be(a,{...s,input:l,output:u})}case"lazy":{let l=s.getter,{_cachedInner:u,...p}=s;return Be(a,{...p,getter:()=>r(l())})}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":return a;default:return a}}return r(e)}function oT(e){return Qc(e,{object:t=>t.partial(),union:t=>{let n=t._zod.def;return n.discriminator===void 0?t:Xe(n.options)}})}function fN(e,t){if(!t?.length)return e;let n=e._zod.def;return Be(e,Nr(n,{checks:[...n.checks??[],...t]}),{parent:!0})}function aT(e){return fN(e.out,e.checks)}function hN(e){return e.in._zod.traits.has("$ZodTransform")?aT(e):e.in}function sT(e){return Qc(e,{pipe:t=>hN(t._zod.def),default:(t,n)=>n?Qe(t._zod.def.innerType):t,catch:(t,n)=>n?t._zod.def.innerType:t})}function cT(e){return Qc(e,{pipe:t=>aT(t._zod.def),prefault:(t,n)=>n?t._zod.def.innerType:t})}var Z_={};hn(Z_,{bigint:()=>_N,boolean:()=>yN,date:()=>bN,number:()=>vN,string:()=>gN});function gN(e){return Vv(Ta,e)}function vN(e){return Bv(za,e)}function yN(e){return Hv(Pa,e)}function _N(e){return Jv(Ea,e)}function bN(e){return Gv(qc,e)}var Me;(function(e){e.assertEqual=r=>{};function t(r){}e.assertIs=t;function n(r){throw new Error}e.assertNever=n,e.arrayToEnum=r=>{let o={};for(let a of r)o[a]=a;return o},e.getValidEnumValues=r=>{let o=e.objectKeys(r).filter(s=>typeof r[r[s]]!="number"),a={};for(let s of o)a[s]=r[s];return e.objectValues(a)},e.objectValues=r=>e.objectKeys(r).map(function(o){return r[o]}),e.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{let o=[];for(let a in r)Object.prototype.hasOwnProperty.call(r,a)&&o.push(a);return o},e.find=(r,o)=>{for(let a of r)if(o(a))return a},e.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(a=>typeof a=="string"?`'${a}'`:a).join(o)}e.joinValues=i,e.jsonStringifyReplacer=(r,o)=>typeof o=="bigint"?o.toString():o})(Me||(Me={}));var lT;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(lT||(lT={}));var se=Me.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Nn=e=>{switch(typeof e){case"undefined":return se.undefined;case"string":return se.string;case"number":return Number.isNaN(e)?se.nan:se.number;case"boolean":return se.boolean;case"function":return se.function;case"bigint":return se.bigint;case"symbol":return se.symbol;case"object":return Array.isArray(e)?se.array:e===null?se.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?se.promise:typeof Map<"u"&&e instanceof Map?se.map:typeof Set<"u"&&e instanceof Set?se.set:typeof Date<"u"&&e instanceof Date?se.date:se.object;default:return se.unknown}};var H=Me.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 Or=class e extends Error{get errors(){return this.issues}constructor(t){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=t}format(t){let n=t||function(o){return o.message},i={_errors:[]},r=o=>{for(let a of o.issues)if(a.code==="invalid_union")a.unionErrors.map(r);else if(a.code==="invalid_return_type")r(a.returnTypeError);else if(a.code==="invalid_arguments")r(a.argumentsError);else if(a.path.length===0)i._errors.push(n(a));else{let s=i,c=0;for(;c<a.path.length;){let l=a.path[c],u=c===a.path.length-1;if(l==="_errors"){u&&s._errors.push(n(a)),c++;continue}Object.prototype.hasOwnProperty.call(s,l)||(l==="__proto__"?Object.defineProperty(s,l,{value:{_errors:[]},writable:!0,enumerable:!0,configurable:!0}):s[l]={_errors:[]}),s=s[l],u&&s._errors.push(n(a)),c++}}};return r(this),i}static assert(t){if(!(t instanceof e))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Me.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=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(t(r))}else i.push(t(r));return{formErrors:i,fieldErrors:n}}get formErrors(){return this.flatten()}};Or.create=e=>new Or(e);var $N=(e,t)=>{let n;switch(e.code){case H.invalid_type:e.received===se.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case H.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Me.jsonStringifyReplacer)}`;break;case H.unrecognized_keys:n=`Unrecognized key(s) in object: ${Me.joinValues(e.keys,", ")}`;break;case H.invalid_union:n="Invalid input";break;case H.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Me.joinValues(e.options)}`;break;case H.invalid_enum_value:n=`Invalid enum value. Expected ${Me.joinValues(e.options)}, received '${e.received}'`;break;case H.invalid_arguments:n="Invalid function arguments";break;case H.invalid_return_type:n="Invalid function return type";break;case H.invalid_date:n="Invalid date";break;case H.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Me.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case H.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case H.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case H.custom:n="Invalid input";break;case H.invalid_intersection_types:n="Intersection results could not be merged";break;case H.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case H.not_finite:n="Number must be finite";break;default:n=t.defaultError,Me.assertNever(e)}return{message:n}},yi=$N;var wN=yi;function el(){return wN}var Em=e=>{let{data:t,path:n,errorMaps:i,issueData:r}=e,o=[...n,...r.path||[]],a={...r,path:o};if(r.message!==void 0)return{...r,path:o,message:r.message};let s="",c=i.filter(l=>!!l).slice().reverse();for(let l of c)s=l(a,{data:t,defaultError:s}).message;return{...r,path:o,message:s}};function ee(e,t){let n=el(),i=Em({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===yi?void 0:yi].filter(r=>!!r)});e.common.issues.push(i)}var Wt=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){let i=[];for(let r of n){if(r.status==="aborted")return we;r.status==="dirty"&&t.dirty(),i.push(r.value)}return{status:t.value,value:i}}static async mergeObjectAsync(t,n){let i=[];for(let r of n){let o=await r.key,a=await r.value;i.push({key:o,value:a})}return e.mergeObjectSync(t,i)}static mergeObjectSync(t,n){let i={};for(let r of n){let{key:o,value:a}=r;if(o.status==="aborted"||a.status==="aborted")return we;o.status==="dirty"&&t.dirty(),a.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof a.value<"u"||r.alwaysSet)&&(i[o.value]=a.value)}return{status:t.value,value:i}}},we=Object.freeze({status:"aborted"}),Ra=e=>({status:"dirty",value:e}),sr=e=>({status:"valid",value:e}),F_=e=>e.status==="aborted",V_=e=>e.status==="dirty",po=e=>e.status==="valid",tl=e=>typeof Promise<"u"&&e instanceof Promise;var me;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(me||(me={}));var Ur=class{constructor(t,n,i,r){this._cachedPath=[],this.parent=t,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}},uT=(e,t)=>{if(po(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let n=new Or(e.common.issues);return this._error=n,this._error}}};function ze(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:i,description:r}=e;if(t&&(n||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:r}:{errorMap:(a,s)=>{let{message:c}=e;return a.code==="invalid_enum_value"?{message:c??s.defaultError}:typeof s.data>"u"?{message:c??i??s.defaultError}:a.code!=="invalid_type"?{message:s.defaultError}:{message:c??n??s.defaultError}},description:r}}var Re=class{get description(){return this._def.description}_getType(t){return Nn(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Nn(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Wt,ctx:{common:t.parent.common,data:t.data,parsedType:Nn(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let n=this._parse(t);if(tl(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){let n=this._parse(t);return Promise.resolve(n)}parse(t,n){let i=this.safeParse(t,n);if(i.success)return i.data;throw i.error}safeParse(t,n){let i={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Nn(t)},r=this._parseSync({data:t,path:i.path,parent:i});return uT(i,r)}"~validate"(t){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Nn(t)};if(!this["~standard"].async)try{let i=this._parseSync({data:t,path:[],parent:n});return po(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:t,path:[],parent:n}).then(i=>po(i)?{value:i.value}:{issues:n.common.issues})}async parseAsync(t,n){let i=await this.safeParseAsync(t,n);if(i.success)return i.data;throw i.error}async safeParseAsync(t,n){let i={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Nn(t)},r=this._parse({data:t,path:i.path,parent:i}),o=await(tl(r)?r:Promise.resolve(r));return uT(i,o)}refine(t,n){let i=r=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(r):n;return this._refinement((r,o)=>{let a=t(r),s=()=>o.addIssue({code:H.custom,...i(r)});return typeof Promise<"u"&&a instanceof Promise?a.then(c=>c?!0:(s(),!1)):a?!0:(s(),!1)})}refinement(t,n){return this._refinement((i,r)=>t(i)?!0:(r.addIssue(typeof n=="function"?n(i,r):n),!1))}_refinement(t){return new nn({schema:this,typeName:G.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return rn.create(this,this._def)}nullable(){return Un.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return bi.create(this)}promise(){return mo.create(this,this._def)}or(t){return Ma.create([this,t],this._def)}and(t){return La.create(this,t,this._def)}transform(t){return new nn({...ze(this._def),schema:this,typeName:G.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let n=typeof t=="function"?t:()=>t;return new qa({...ze(this._def),innerType:this,defaultValue:n,typeName:G.ZodDefault})}brand(){return new Om({typeName:G.ZodBranded,type:this,...ze(this._def)})}catch(t){let n=typeof t=="function"?t:()=>t;return new Ba({...ze(this._def),innerType:this,catchValue:n,typeName:G.ZodCatch})}describe(t){let n=this.constructor;return new n({...this._def,description:t})}pipe(t){return jm.create(this,t)}readonly(){return Ha.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},kN=/^c[^\s-]{8,}$/i,xN=/^[0-9a-z]+$/,SN=/^[0-9A-HJKMNP-TV-Z]{26}$/i,IN=/^[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,TN=/^[a-z0-9_-]{21}$/i,zN=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,PN=/^[-+]?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)?)??$/,EN=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,ON="^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$",q_,jN=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,RN=/^(?:(?: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])$/,DN=/^(([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]))$/,CN=/^(([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])$/,AN=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,NN=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,dT="((\\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])))",MN=new RegExp(`^${dT}$`);function pT(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);let n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function LN(e){return new RegExp(`^${pT(e)}$`)}function UN(e){let t=`${dT}T${pT(e)}`,n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function ZN(e,t){return!!((t==="v4"||!t)&&jN.test(e)||(t==="v6"||!t)&&DN.test(e))}function FN(e,t){if(!zN.test(e))return!1;try{let[n]=e.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||t&&r.alg!==t)}catch{return!1}}function VN(e,t){return!!((t==="v4"||!t)&&RN.test(e)||(t==="v6"||!t)&&CN.test(e))}var Ca=class e extends Re{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==se.string){let o=this._getOrReturnCtx(t);return ee(o,{code:H.invalid_type,expected:se.string,received:o.parsedType}),we}let i=new Wt,r;for(let o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(r=this._getOrReturnCtx(t,r),ee(r,{code:H.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),i.dirty());else if(o.kind==="max")t.data.length>o.value&&(r=this._getOrReturnCtx(t,r),ee(r,{code:H.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),i.dirty());else if(o.kind==="length"){let a=t.data.length>o.value,s=t.data.length<o.value;(a||s)&&(r=this._getOrReturnCtx(t,r),a?ee(r,{code:H.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):s&&ee(r,{code:H.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),i.dirty())}else if(o.kind==="email")EN.test(t.data)||(r=this._getOrReturnCtx(t,r),ee(r,{validation:"email",code:H.invalid_string,message:o.message}),i.dirty());else if(o.kind==="emoji")q_||(q_=new RegExp(ON,"u")),q_.test(t.data)||(r=this._getOrReturnCtx(t,r),ee(r,{validation:"emoji",code:H.invalid_string,message:o.message}),i.dirty());else if(o.kind==="uuid")IN.test(t.data)||(r=this._getOrReturnCtx(t,r),ee(r,{validation:"uuid",code:H.invalid_string,message:o.message}),i.dirty());else if(o.kind==="nanoid")TN.test(t.data)||(r=this._getOrReturnCtx(t,r),ee(r,{validation:"nanoid",code:H.invalid_string,message:o.message}),i.dirty());else if(o.kind==="cuid")kN.test(t.data)||(r=this._getOrReturnCtx(t,r),ee(r,{validation:"cuid",code:H.invalid_string,message:o.message}),i.dirty());else if(o.kind==="cuid2")xN.test(t.data)||(r=this._getOrReturnCtx(t,r),ee(r,{validation:"cuid2",code:H.invalid_string,message:o.message}),i.dirty());else if(o.kind==="ulid")SN.test(t.data)||(r=this._getOrReturnCtx(t,r),ee(r,{validation:"ulid",code:H.invalid_string,message:o.message}),i.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{r=this._getOrReturnCtx(t,r),ee(r,{validation:"url",code:H.invalid_string,message:o.message}),i.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(t.data)||(r=this._getOrReturnCtx(t,r),ee(r,{validation:"regex",code:H.invalid_string,message:o.message}),i.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="includes"?t.data.includes(o.value,o.position)||(r=this._getOrReturnCtx(t,r),ee(r,{code:H.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),i.dirty()):o.kind==="toLowerCase"?t.data=t.data.toLowerCase():o.kind==="toUpperCase"?t.data=t.data.toUpperCase():o.kind==="startsWith"?t.data.startsWith(o.value)||(r=this._getOrReturnCtx(t,r),ee(r,{code:H.invalid_string,validation:{startsWith:o.value},message:o.message}),i.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(r=this._getOrReturnCtx(t,r),ee(r,{code:H.invalid_string,validation:{endsWith:o.value},message:o.message}),i.dirty()):o.kind==="datetime"?UN(o).test(t.data)||(r=this._getOrReturnCtx(t,r),ee(r,{code:H.invalid_string,validation:"datetime",message:o.message}),i.dirty()):o.kind==="date"?MN.test(t.data)||(r=this._getOrReturnCtx(t,r),ee(r,{code:H.invalid_string,validation:"date",message:o.message}),i.dirty()):o.kind==="time"?LN(o).test(t.data)||(r=this._getOrReturnCtx(t,r),ee(r,{code:H.invalid_string,validation:"time",message:o.message}),i.dirty()):o.kind==="duration"?PN.test(t.data)||(r=this._getOrReturnCtx(t,r),ee(r,{validation:"duration",code:H.invalid_string,message:o.message}),i.dirty()):o.kind==="ip"?ZN(t.data,o.version)||(r=this._getOrReturnCtx(t,r),ee(r,{validation:"ip",code:H.invalid_string,message:o.message}),i.dirty()):o.kind==="jwt"?FN(t.data,o.alg)||(r=this._getOrReturnCtx(t,r),ee(r,{validation:"jwt",code:H.invalid_string,message:o.message}),i.dirty()):o.kind==="cidr"?VN(t.data,o.version)||(r=this._getOrReturnCtx(t,r),ee(r,{validation:"cidr",code:H.invalid_string,message:o.message}),i.dirty()):o.kind==="base64"?AN.test(t.data)||(r=this._getOrReturnCtx(t,r),ee(r,{validation:"base64",code:H.invalid_string,message:o.message}),i.dirty()):o.kind==="base64url"?NN.test(t.data)||(r=this._getOrReturnCtx(t,r),ee(r,{validation:"base64url",code:H.invalid_string,message:o.message}),i.dirty()):Me.assertNever(o);return{status:i.value,value:t.data}}_regex(t,n,i){return this.refinement(r=>t.test(r),{validation:n,code:H.invalid_string,...me.errToObj(i)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...me.errToObj(t)})}url(t){return this._addCheck({kind:"url",...me.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...me.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...me.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...me.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...me.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...me.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...me.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...me.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...me.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...me.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...me.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...me.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...me.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...me.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...me.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...me.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n?.position,...me.errToObj(n?.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...me.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...me.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...me.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...me.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...me.errToObj(n)})}nonempty(t){return this.min(1,me.errToObj(t))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}};Ca.create=e=>new Ca({checks:[],typeName:G.ZodString,coerce:e?.coerce??!1,...ze(e)});function qN(e,t){let n=(e.toString().split(".")[1]||"").length,i=(t.toString().split(".")[1]||"").length,r=n>i?n:i,o=Number.parseInt(e.toFixed(r).replace(".","")),a=Number.parseInt(t.toFixed(r).replace(".",""));return o%a/10**r}var rl=class e extends Re{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==se.number){let o=this._getOrReturnCtx(t);return ee(o,{code:H.invalid_type,expected:se.number,received:o.parsedType}),we}let i,r=new Wt;for(let o of this._def.checks)o.kind==="int"?Me.isInteger(t.data)||(i=this._getOrReturnCtx(t,i),ee(i,{code:H.invalid_type,expected:"integer",received:"float",message:o.message}),r.dirty()):o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(i=this._getOrReturnCtx(t,i),ee(i,{code:H.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),r.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(i=this._getOrReturnCtx(t,i),ee(i,{code:H.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),r.dirty()):o.kind==="multipleOf"?qN(t.data,o.value)!==0&&(i=this._getOrReturnCtx(t,i),ee(i,{code:H.not_multiple_of,multipleOf:o.value,message:o.message}),r.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(i=this._getOrReturnCtx(t,i),ee(i,{code:H.not_finite,message:o.message}),r.dirty()):Me.assertNever(o);return{status:r.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,me.toString(n))}gt(t,n){return this.setLimit("min",t,!1,me.toString(n))}lte(t,n){return this.setLimit("max",t,!0,me.toString(n))}lt(t,n){return this.setLimit("max",t,!1,me.toString(n))}setLimit(t,n,i,r){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:i,message:me.toString(r)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:me.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:me.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:me.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:me.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:me.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:me.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:me.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:me.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:me.toString(t)})}get minValue(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Me.isInteger(t.value))}get isFinite(){let t=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"&&(t===null||i.value<t)&&(t=i.value)}return Number.isFinite(n)&&Number.isFinite(t)}};rl.create=e=>new rl({checks:[],typeName:G.ZodNumber,coerce:e?.coerce||!1,...ze(e)});var nl=class e extends Re{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==se.bigint)return this._getInvalidInput(t);let i,r=new Wt;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(i=this._getOrReturnCtx(t,i),ee(i,{code:H.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),r.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(i=this._getOrReturnCtx(t,i),ee(i,{code:H.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),r.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(i=this._getOrReturnCtx(t,i),ee(i,{code:H.not_multiple_of,multipleOf:o.value,message:o.message}),r.dirty()):Me.assertNever(o);return{status:r.value,value:t.data}}_getInvalidInput(t){let n=this._getOrReturnCtx(t);return ee(n,{code:H.invalid_type,expected:se.bigint,received:n.parsedType}),we}gte(t,n){return this.setLimit("min",t,!0,me.toString(n))}gt(t,n){return this.setLimit("min",t,!1,me.toString(n))}lte(t,n){return this.setLimit("max",t,!0,me.toString(n))}lt(t,n){return this.setLimit("max",t,!1,me.toString(n))}setLimit(t,n,i,r){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:i,message:me.toString(r)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:me.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:me.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:me.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:me.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:me.toString(n)})}get minValue(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}};nl.create=e=>new nl({checks:[],typeName:G.ZodBigInt,coerce:e?.coerce??!1,...ze(e)});var il=class extends Re{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==se.boolean){let i=this._getOrReturnCtx(t);return ee(i,{code:H.invalid_type,expected:se.boolean,received:i.parsedType}),we}return sr(t.data)}};il.create=e=>new il({typeName:G.ZodBoolean,coerce:e?.coerce||!1,...ze(e)});var ol=class e extends Re{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==se.date){let o=this._getOrReturnCtx(t);return ee(o,{code:H.invalid_type,expected:se.date,received:o.parsedType}),we}if(Number.isNaN(t.data.getTime())){let o=this._getOrReturnCtx(t);return ee(o,{code:H.invalid_date}),we}let i=new Wt,r;for(let o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(r=this._getOrReturnCtx(t,r),ee(r,{code:H.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),i.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(r=this._getOrReturnCtx(t,r),ee(r,{code:H.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),i.dirty()):Me.assertNever(o);return{status:i.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:me.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:me.toString(n)})}get minDate(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}};ol.create=e=>new ol({checks:[],coerce:e?.coerce||!1,typeName:G.ZodDate,...ze(e)});var al=class extends Re{_parse(t){if(this._getType(t)!==se.symbol){let i=this._getOrReturnCtx(t);return ee(i,{code:H.invalid_type,expected:se.symbol,received:i.parsedType}),we}return sr(t.data)}};al.create=e=>new al({typeName:G.ZodSymbol,...ze(e)});var Aa=class extends Re{_parse(t){if(this._getType(t)!==se.undefined){let i=this._getOrReturnCtx(t);return ee(i,{code:H.invalid_type,expected:se.undefined,received:i.parsedType}),we}return sr(t.data)}};Aa.create=e=>new Aa({typeName:G.ZodUndefined,...ze(e)});var Na=class extends Re{_parse(t){if(this._getType(t)!==se.null){let i=this._getOrReturnCtx(t);return ee(i,{code:H.invalid_type,expected:se.null,received:i.parsedType}),we}return sr(t.data)}};Na.create=e=>new Na({typeName:G.ZodNull,...ze(e)});var sl=class extends Re{constructor(){super(...arguments),this._any=!0}_parse(t){return sr(t.data)}};sl.create=e=>new sl({typeName:G.ZodAny,...ze(e)});var _i=class extends Re{constructor(){super(...arguments),this._unknown=!0}_parse(t){return sr(t.data)}};_i.create=e=>new _i({typeName:G.ZodUnknown,...ze(e)});var $n=class extends Re{_parse(t){let n=this._getOrReturnCtx(t);return ee(n,{code:H.invalid_type,expected:se.never,received:n.parsedType}),we}};$n.create=e=>new $n({typeName:G.ZodNever,...ze(e)});var cl=class extends Re{_parse(t){if(this._getType(t)!==se.undefined){let i=this._getOrReturnCtx(t);return ee(i,{code:H.invalid_type,expected:se.void,received:i.parsedType}),we}return sr(t.data)}};cl.create=e=>new cl({typeName:G.ZodVoid,...ze(e)});var bi=class e extends Re{_parse(t){let{ctx:n,status:i}=this._processInputParams(t),r=this._def;if(n.parsedType!==se.array)return ee(n,{code:H.invalid_type,expected:se.array,received:n.parsedType}),we;if(r.exactLength!==null){let a=n.data.length>r.exactLength.value,s=n.data.length<r.exactLength.value;(a||s)&&(ee(n,{code:a?H.too_big:H.too_small,minimum:s?r.exactLength.value:void 0,maximum:a?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&&(ee(n,{code:H.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&&(ee(n,{code:H.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((a,s)=>r.type._parseAsync(new Ur(n,a,n.path,s)))).then(a=>Wt.mergeArray(i,a));let o=[...n.data].map((a,s)=>r.type._parseSync(new Ur(n,a,n.path,s)));return Wt.mergeArray(i,o)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:me.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:me.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:me.toString(n)}})}nonempty(t){return this.min(1,t)}};bi.create=(e,t)=>new bi({type:e,minLength:null,maxLength:null,exactLength:null,typeName:G.ZodArray,...ze(t)});function Da(e){if(e instanceof jr){let t={};for(let n in e.shape){let i=e.shape[n];t[n]=rn.create(Da(i))}return new jr({...e._def,shape:()=>t})}else return e instanceof bi?new bi({...e._def,type:Da(e.element)}):e instanceof rn?rn.create(Da(e.unwrap())):e instanceof Un?Un.create(Da(e.unwrap())):e instanceof Ln?Ln.create(e.items.map(t=>Da(t))):e}var jr=class e extends Re{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),n=Me.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==se.object){let l=this._getOrReturnCtx(t);return ee(l,{code:H.invalid_type,expected:se.object,received:l.parsedType}),we}let{status:i,ctx:r}=this._processInputParams(t),{shape:o,keys:a}=this._getCached(),s=[];if(!(this._def.catchall instanceof $n&&this._def.unknownKeys==="strip"))for(let l in r.data)a.includes(l)||s.push(l);let c=[];for(let l of a){let u=o[l],p=r.data[l];c.push({key:{status:"valid",value:l},value:u._parse(new Ur(r,p,r.path,l)),alwaysSet:l in r.data})}if(this._def.catchall instanceof $n){let l=this._def.unknownKeys;if(l==="passthrough")for(let u of s)c.push({key:{status:"valid",value:u},value:{status:"valid",value:r.data[u]}});else if(l==="strict")s.length>0&&(ee(r,{code:H.unrecognized_keys,keys:s}),i.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let l=this._def.catchall;for(let u of s){let p=r.data[u];c.push({key:{status:"valid",value:u},value:l._parse(new Ur(r,p,r.path,u)),alwaysSet:u in r.data})}}return r.common.async?Promise.resolve().then(async()=>{let l=[];for(let u of c){let p=await u.key,h=await u.value;l.push({key:p,value:h,alwaysSet:u.alwaysSet})}return l}).then(l=>Wt.mergeObjectSync(i,l)):Wt.mergeObjectSync(i,c)}get shape(){return this._def.shape()}strict(t){return me.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,i)=>{let r=this._def.errorMap?.(n,i).message??i.defaultError;return n.code==="unrecognized_keys"?{message:me.errToObj(t).message??r}:{message:r}}}:{}})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:G.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};for(let i of Me.objectKeys(t))t[i]&&this.shape[i]&&(n[i]=this.shape[i]);return new e({...this._def,shape:()=>n})}omit(t){let n={};for(let i of Me.objectKeys(this.shape))t[i]||(n[i]=this.shape[i]);return new e({...this._def,shape:()=>n})}deepPartial(){return Da(this)}partial(t){let n={};for(let i of Me.objectKeys(this.shape)){let r=this.shape[i];t&&!t[i]?n[i]=r:n[i]=r.optional()}return new e({...this._def,shape:()=>n})}required(t){let n={};for(let i of Me.objectKeys(this.shape))if(t&&!t[i])n[i]=this.shape[i];else{let o=this.shape[i];for(;o instanceof rn;)o=o._def.innerType;n[i]=o}return new e({...this._def,shape:()=>n})}keyof(){return mT(Me.objectKeys(this.shape))}};jr.create=(e,t)=>new jr({shape:()=>e,unknownKeys:"strip",catchall:$n.create(),typeName:G.ZodObject,...ze(t)});jr.strictCreate=(e,t)=>new jr({shape:()=>e,unknownKeys:"strict",catchall:$n.create(),typeName:G.ZodObject,...ze(t)});jr.lazycreate=(e,t)=>new jr({shape:e,unknownKeys:"strip",catchall:$n.create(),typeName:G.ZodObject,...ze(t)});var Ma=class extends Re{_parse(t){let{ctx:n}=this._processInputParams(t),i=this._def.options;function r(o){for(let s of o)if(s.result.status==="valid")return s.result;for(let s of o)if(s.result.status==="dirty")return n.common.issues.push(...s.ctx.common.issues),s.result;let a=o.map(s=>new Or(s.ctx.common.issues));return ee(n,{code:H.invalid_union,unionErrors:a}),we}if(n.common.async)return Promise.all(i.map(async o=>{let a={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(r);{let o,a=[];for(let c of i){let l={...n,common:{...n.common,issues:[]},parent:null},u=c._parseSync({data:n.data,path:n.path,parent:l});if(u.status==="valid")return u;u.status==="dirty"&&!o&&(o={result:u,ctx:l}),l.common.issues.length&&a.push(l.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;let s=a.map(c=>new Or(c));return ee(n,{code:H.invalid_union,unionErrors:s}),we}}get options(){return this._def.options}};Ma.create=(e,t)=>new Ma({options:e,typeName:G.ZodUnion,...ze(t)});var Mn=e=>e instanceof Ua?Mn(e.schema):e instanceof nn?Mn(e.innerType()):e instanceof Za?[e.value]:e instanceof Fa?e.options:e instanceof Va?Me.objectValues(e.enum):e instanceof qa?Mn(e._def.innerType):e instanceof Aa?[void 0]:e instanceof Na?[null]:e instanceof rn?[void 0,...Mn(e.unwrap())]:e instanceof Un?[null,...Mn(e.unwrap())]:e instanceof Om||e instanceof Ha?Mn(e.unwrap()):e instanceof Ba?Mn(e._def.innerType):[],B_=class e extends Re{_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==se.object)return ee(n,{code:H.invalid_type,expected:se.object,received:n.parsedType}),we;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}):(ee(n,{code:H.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),we)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,i){let r=new Map;for(let o of n){let a=Mn(o.shape[t]);if(!a.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let s of a){if(r.has(s))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(s)}`);r.set(s,o)}}return new e({typeName:G.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:r,...ze(i)})}};function H_(e,t){let n=Nn(e),i=Nn(t);if(e===t)return{valid:!0,data:e};if(n===se.object&&i===se.object){let r=Me.objectKeys(t),o=Me.objectKeys(e).filter(s=>r.indexOf(s)!==-1),a={...e,...t};Object.prototype.hasOwnProperty.call(a,"__proto__")&&delete a.__proto__;for(let s of o){if(s==="__proto__")continue;let c=H_(e[s],t[s]);if(!c.valid)return{valid:!1};a[s]=c.data}return{valid:!0,data:a}}else if(n===se.array&&i===se.array){if(e.length!==t.length)return{valid:!1};let r=[];for(let o=0;o<e.length;o++){let a=e[o],s=t[o],c=H_(a,s);if(!c.valid)return{valid:!1};r.push(c.data)}return{valid:!0,data:r}}else return n===se.date&&i===se.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var La=class extends Re{_parse(t){let{status:n,ctx:i}=this._processInputParams(t),r=(o,a)=>{if(F_(o)||F_(a))return we;let s=H_(o.value,a.value);return s.valid?((V_(o)||V_(a))&&n.dirty(),{status:n.value,value:s.data}):(ee(i,{code:H.invalid_intersection_types}),we)};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,a])=>r(o,a)):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}))}};La.create=(e,t,n)=>new La({left:e,right:t,typeName:G.ZodIntersection,...ze(n)});var Ln=class e extends Re{_parse(t){let{status:n,ctx:i}=this._processInputParams(t);if(i.parsedType!==se.array)return ee(i,{code:H.invalid_type,expected:se.array,received:i.parsedType}),we;if(i.data.length<this._def.items.length)return ee(i,{code:H.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),we;!this._def.rest&&i.data.length>this._def.items.length&&(ee(i,{code:H.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let o=[...i.data].map((a,s)=>{let c=this._def.items[s]||this._def.rest;return c?c._parse(new Ur(i,a,i.path,s)):null}).filter(a=>!!a);return i.common.async?Promise.all(o).then(a=>Wt.mergeArray(n,a)):Wt.mergeArray(n,o)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};Ln.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ln({items:e,typeName:G.ZodTuple,rest:null,...ze(t)})};var J_=class e extends Re{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:i}=this._processInputParams(t);if(i.parsedType!==se.object)return ee(i,{code:H.invalid_type,expected:se.object,received:i.parsedType}),we;let r=[],o=this._def.keyType,a=this._def.valueType;for(let s in i.data)r.push({key:o._parse(new Ur(i,s,i.path,s)),value:a._parse(new Ur(i,i.data[s],i.path,s)),alwaysSet:s in i.data});return i.common.async?Wt.mergeObjectAsync(n,r):Wt.mergeObjectSync(n,r)}get element(){return this._def.valueType}static create(t,n,i){return n instanceof Re?new e({keyType:t,valueType:n,typeName:G.ZodRecord,...ze(i)}):new e({keyType:Ca.create(),valueType:t,typeName:G.ZodRecord,...ze(n)})}},ll=class extends Re{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:i}=this._processInputParams(t);if(i.parsedType!==se.map)return ee(i,{code:H.invalid_type,expected:se.map,received:i.parsedType}),we;let r=this._def.keyType,o=this._def.valueType,a=[...i.data.entries()].map(([s,c],l)=>({key:r._parse(new Ur(i,s,i.path,[l,"key"])),value:o._parse(new Ur(i,c,i.path,[l,"value"]))}));if(i.common.async){let s=new Map;return Promise.resolve().then(async()=>{for(let c of a){let l=await c.key,u=await c.value;if(l.status==="aborted"||u.status==="aborted")return we;(l.status==="dirty"||u.status==="dirty")&&n.dirty(),s.set(l.value,u.value)}return{status:n.value,value:s}})}else{let s=new Map;for(let c of a){let l=c.key,u=c.value;if(l.status==="aborted"||u.status==="aborted")return we;(l.status==="dirty"||u.status==="dirty")&&n.dirty(),s.set(l.value,u.value)}return{status:n.value,value:s}}}};ll.create=(e,t,n)=>new ll({valueType:t,keyType:e,typeName:G.ZodMap,...ze(n)});var ul=class e extends Re{_parse(t){let{status:n,ctx:i}=this._processInputParams(t);if(i.parsedType!==se.set)return ee(i,{code:H.invalid_type,expected:se.set,received:i.parsedType}),we;let r=this._def;r.minSize!==null&&i.data.size<r.minSize.value&&(ee(i,{code:H.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&&(ee(i,{code:H.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),n.dirty());let o=this._def.valueType;function a(c){let l=new Set;for(let u of c){if(u.status==="aborted")return we;u.status==="dirty"&&n.dirty(),l.add(u.value)}return{status:n.value,value:l}}let s=[...i.data.values()].map((c,l)=>o._parse(new Ur(i,c,i.path,l)));return i.common.async?Promise.all(s).then(c=>a(c)):a(s)}min(t,n){return new e({...this._def,minSize:{value:t,message:me.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:me.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}};ul.create=(e,t)=>new ul({valueType:e,minSize:null,maxSize:null,typeName:G.ZodSet,...ze(t)});var G_=class e extends Re{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==se.function)return ee(n,{code:H.invalid_type,expected:se.function,received:n.parsedType}),we;function i(s,c){return Em({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,el(),yi].filter(l=>!!l),issueData:{code:H.invalid_arguments,argumentsError:c}})}function r(s,c){return Em({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,el(),yi].filter(l=>!!l),issueData:{code:H.invalid_return_type,returnTypeError:c}})}let o={errorMap:n.common.contextualErrorMap},a=n.data;if(this._def.returns instanceof mo){let s=this;return sr(async function(...c){let l=new Or([]),u=await s._def.args.parseAsync(c,o).catch(g=>{throw l.addIssue(i(c,g)),l}),p=await Reflect.apply(a,this,u);return await s._def.returns._def.type.parseAsync(p,o).catch(g=>{throw l.addIssue(r(p,g)),l})})}else{let s=this;return sr(function(...c){let l=s._def.args.safeParse(c,o);if(!l.success)throw new Or([i(c,l.error)]);let u=Reflect.apply(a,this,l.data),p=s._def.returns.safeParse(u,o);if(!p.success)throw new Or([r(u,p.error)]);return p.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:Ln.create(t).rest(_i.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,i){return new e({args:t||Ln.create([]).rest(_i.create()),returns:n||_i.create(),typeName:G.ZodFunction,...ze(i)})}},Ua=class extends Re{get schema(){return this._def.getter()}_parse(t){let{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};Ua.create=(e,t)=>new Ua({getter:e,typeName:G.ZodLazy,...ze(t)});var Za=class extends Re{_parse(t){if(t.data!==this._def.value){let n=this._getOrReturnCtx(t);return ee(n,{received:n.data,code:H.invalid_literal,expected:this._def.value}),we}return{status:"valid",value:t.data}}get value(){return this._def.value}};Za.create=(e,t)=>new Za({value:e,typeName:G.ZodLiteral,...ze(t)});function mT(e,t){return new Fa({values:e,typeName:G.ZodEnum,...ze(t)})}var Fa=class e extends Re{_parse(t){if(typeof t.data!="string"){let n=this._getOrReturnCtx(t),i=this._def.values;return ee(n,{expected:Me.joinValues(i),received:n.parsedType,code:H.invalid_type}),we}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let n=this._getOrReturnCtx(t),i=this._def.values;return ee(n,{received:n.data,code:H.invalid_enum_value,options:i}),we}return sr(t.data)}get options(){return this._def.values}get enum(){let t={};for(let n of this._def.values)t[n]=n;return t}get Values(){let t={};for(let n of this._def.values)t[n]=n;return t}get Enum(){let t={};for(let n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return e.create(t,{...this._def,...n})}exclude(t,n=this._def){return e.create(this.options.filter(i=>!t.includes(i)),{...this._def,...n})}};Fa.create=mT;var Va=class extends Re{_parse(t){let n=Me.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(t);if(i.parsedType!==se.string&&i.parsedType!==se.number){let r=Me.objectValues(n);return ee(i,{expected:Me.joinValues(r),received:i.parsedType,code:H.invalid_type}),we}if(this._cache||(this._cache=new Set(Me.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let r=Me.objectValues(n);return ee(i,{received:i.data,code:H.invalid_enum_value,options:r}),we}return sr(t.data)}get enum(){return this._def.values}};Va.create=(e,t)=>new Va({values:e,typeName:G.ZodNativeEnum,...ze(t)});var mo=class extends Re{unwrap(){return this._def.type}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==se.promise&&n.common.async===!1)return ee(n,{code:H.invalid_type,expected:se.promise,received:n.parsedType}),we;let i=n.parsedType===se.promise?n.data:Promise.resolve(n.data);return sr(i.then(r=>this._def.type.parseAsync(r,{path:n.path,errorMap:n.common.contextualErrorMap})))}};mo.create=(e,t)=>new mo({type:e,typeName:G.ZodPromise,...ze(t)});var nn=class extends Re{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===G.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:n,ctx:i}=this._processInputParams(t),r=this._def.effect||null,o={addIssue:a=>{ee(i,a),a.fatal?n.abort():n.dirty()},get path(){return i.path}};if(o.addIssue=o.addIssue.bind(o),r.type==="preprocess"){let a=r.transform(i.data,o);if(i.common.async)return Promise.resolve(a).then(async s=>{if(n.value==="aborted")return we;let c=await this._def.schema._parseAsync({data:s,path:i.path,parent:i});return c.status==="aborted"?we:c.status==="dirty"?Ra(c.value):n.value==="dirty"?Ra(c.value):c});{if(n.value==="aborted")return we;let s=this._def.schema._parseSync({data:a,path:i.path,parent:i});return s.status==="aborted"?we:s.status==="dirty"?Ra(s.value):n.value==="dirty"?Ra(s.value):s}}if(r.type==="refinement"){let a=s=>{let c=r.refinement(s,o);if(i.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(i.common.async===!1){let s=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return s.status==="aborted"?we:(s.status==="dirty"&&n.dirty(),a(s.value),{status:n.value,value:s.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(s=>s.status==="aborted"?we:(s.status==="dirty"&&n.dirty(),a(s.value).then(()=>({status:n.value,value:s.value}))))}if(r.type==="transform")if(i.common.async===!1){let a=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!po(a))return we;let s=r.transform(a.value,o);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:s}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(a=>po(a)?Promise.resolve(r.transform(a.value,o)).then(s=>({status:n.value,value:s})):we);Me.assertNever(r)}};nn.create=(e,t,n)=>new nn({schema:e,typeName:G.ZodEffects,effect:t,...ze(n)});nn.createWithPreprocess=(e,t,n)=>new nn({schema:t,effect:{type:"preprocess",transform:e},typeName:G.ZodEffects,...ze(n)});var rn=class extends Re{_parse(t){return this._getType(t)===se.undefined?sr(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};rn.create=(e,t)=>new rn({innerType:e,typeName:G.ZodOptional,...ze(t)});var Un=class extends Re{_parse(t){return this._getType(t)===se.null?sr(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Un.create=(e,t)=>new Un({innerType:e,typeName:G.ZodNullable,...ze(t)});var qa=class extends Re{_parse(t){let{ctx:n}=this._processInputParams(t),i=n.data;return n.parsedType===se.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};qa.create=(e,t)=>new qa({innerType:e,typeName:G.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...ze(t)});var Ba=class extends Re{_parse(t){let{ctx:n}=this._processInputParams(t),i={...n,common:{...n.common,issues:[]}},r=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return tl(r)?r.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Or(i.common.issues)},input:i.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new Or(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}};Ba.create=(e,t)=>new Ba({innerType:e,typeName:G.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...ze(t)});var dl=class extends Re{_parse(t){if(this._getType(t)!==se.nan){let i=this._getOrReturnCtx(t);return ee(i,{code:H.invalid_type,expected:se.nan,received:i.parsedType}),we}return{status:"valid",value:t.data}}};dl.create=e=>new dl({typeName:G.ZodNaN,...ze(e)});var Om=class extends Re{_parse(t){let{ctx:n}=this._processInputParams(t),i=n.data;return this._def.type._parse({data:i,path:n.path,parent:n})}unwrap(){return this._def.type}},jm=class e extends Re{_parse(t){let{status:n,ctx:i}=this._processInputParams(t);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"?we:o.status==="dirty"?(n.dirty(),Ra(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"?we:r.status==="dirty"?(n.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:i.path,parent:i})}}static create(t,n){return new e({in:t,out:n,typeName:G.ZodPipeline})}},Ha=class extends Re{_parse(t){let n=this._def.innerType._parse(t),i=r=>(po(r)&&(r.value=Object.freeze(r.value)),r);return tl(n)?n.then(r=>i(r)):i(n)}unwrap(){return this._def.innerType}};Ha.create=(e,t)=>new Ha({innerType:e,typeName:G.ZodReadonly,...ze(t)});var BJ={object:jr.lazycreate},G;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(G||(G={}));var HJ=Ca.create,JJ=rl.create,GJ=dl.create,KJ=nl.create,WJ=il.create,XJ=ol.create,YJ=al.create,QJ=Aa.create,eG=Na.create,tG=sl.create,rG=_i.create,nG=$n.create,iG=cl.create,oG=bi.create,fT=jr.create,aG=jr.strictCreate,sG=Ma.create,cG=B_.create,lG=La.create,uG=Ln.create,dG=J_.create,pG=ll.create,mG=ul.create,fG=G_.create,hG=Ua.create,gG=Za.create,vG=Fa.create,yG=Va.create,_G=mo.create,bG=nn.create,$G=rn.create,wG=Un.create,kG=nn.createWithPreprocess,xG=jm.create;var HN=E("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");xe.init(e,t),e.def=t,e.type=t.type},{get with(){return this.check},set with(e){gn(this,"with",e)},parse(e,t){return Ki(this,e,t,{callee:this.parse})},parseAsync(e,t){return Wi(this,e,t,{callee:this.parseAsync})},safeParse(e,t){return Jo(this,e,t)},safeParseAsync(e,t){return Ko(this,e,t)},check(...e){let t=this.def;return this.clone({...t,checks:[...t.checks??[],...e.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]},{parent:!0})},clone(e,t){return Be(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},apply(e,...t){return t.length===0?e(this):e(this,...t)}});var JN=E("ZodMiniObject",(e,t)=>{Rd.init(e,t),HN.init(e,t),lg(e,"shape",n=>n._zod.def.shape,!1)});function K_(e,t){let n={type:"object",shape:e??{},...J(t)};return new JN(n)}function wn(e){return!!e._zod}function fo(e){let t=Object.values(e);if(t.length===0)return K_({});let n=t.every(wn),i=t.every(r=>!wn(r));if(n)return K_(e);if(i)return fT(e);throw new Error("Mixed Zod versions detected in object shape.")}function $i(e,t){return wn(e)?Jo(e,t):e.safeParse(t)}async function Rm(e,t){return wn(e)?await Ko(e,t):await e.safeParseAsync(t)}function wi(e){if(!e)return;let t;if(wn(e)?t=e._zod?.def?.shape:t=e.shape,!!t){if(typeof t=="function")try{return t()}catch{return}return t}}function Ja(e){if(e){if(typeof e=="object"){let t=e,n=e;if(!t._def&&!n._zod){let i=Object.values(e);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 fo(e)}}if(wn(e)){let n=e._zod?.def;if(n&&(n.type==="object"||n.shape!==void 0))return e}else if(e.shape!==void 0)return e}}function KN(e){return e.length===0?"object root":e.reduce((t,n,i)=>i===0?String(n):typeof n=="number"?`${t}[${n}]`:`${t}.${n}`,"")}function Dm(e){if(e&&typeof e=="object"){if("issues"in e&&Array.isArray(e.issues)&&e.issues.length>0)return e.issues.map(t=>t.path?.length?`${t.message} at ${KN(t.path)}`:t.message).join(`
|
|
92
|
+
`);if("message"in e&&typeof e.message=="string")return e.message;try{return JSON.stringify(e)}catch{return String(e)}}return String(e)}function hT(e){return e.description}function gT(e){if(wn(e))return e._zod?.def?.type==="optional";let t=e;return typeof e.isOptional=="function"?e.isOptional():t._def?.typeName==="ZodOptional"}function Ga(e){if(wn(e)){let o=e._zod?.def;if(o){if(o.value!==void 0)return o.value;if(Array.isArray(o.values)&&o.values.length>0)return o.values[0]}}let n=e._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=e.value;if(i!==void 0)return i}var X_="2025-11-25",vT="2025-03-26",Wa=[X_,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],ki="io.modelcontextprotocol/related-task",Am="2.0",Pt=Pm(e=>e!==null&&(typeof e=="object"||typeof e=="function")),yT=Xe([C(),He().int()]),_T=C(),MG=Mt({ttl:He().optional(),pollInterval:He().optional()}),WN=ie({ttl:He().optional()}),XN=ie({taskId:C()}),Y_=Mt({progressToken:yT.optional(),[ki]:XN.optional()}),Rr=ie({_meta:Y_.optional()}),pl=Rr.extend({task:WN.optional()}),bT=e=>pl.safeParse(e).success,Ut=ie({method:C(),params:Rr.loose().optional()}),Zr=ie({_meta:Y_.optional()}),Fr=ie({method:C(),params:Zr.loose().optional()}),Zt=Mt({_meta:Y_.optional()}),Nm=Xe([C(),He().int()]),$T=ie({jsonrpc:fe(Am),id:Nm,...Ut.shape}).strict(),Zn=e=>$T.safeParse(e).success,wT=ie({jsonrpc:fe(Am),...Fr.shape}).strict(),kT=e=>wT.safeParse(e).success,Q_=ie({jsonrpc:fe(Am),id:Nm,result:Zt}).strict(),Fn=e=>Q_.safeParse(e).success;var pe;(function(e){e[e.ConnectionClosed=-32e3]="ConnectionClosed",e[e.RequestTimeout=-32001]="RequestTimeout",e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(pe||(pe={}));var eb=ie({jsonrpc:fe(Am),id:Nm.optional(),error:ie({code:He().int(),message:C(),data:it().optional()})}).strict();var Xa=e=>eb.safeParse(e).success;var tb=Xe([$T,wT,Q_,eb]),LG=Xe([Q_,eb]),Mm=Zt.strict(),YN=Zr.extend({requestId:Nm.optional(),reason:C().optional()}),Lm=Fr.extend({method:fe("notifications/cancelled"),params:YN}),QN=ie({src:C(),mimeType:C().optional(),sizes:je(C()).optional(),theme:Lt(["light","dark"]).optional()}),ml=ie({icons:je(QN).optional()}),Ka=ie({name:C(),title:C().optional()}),xT=Ka.extend({...Ka.shape,...ml.shape,version:C(),websiteUrl:C().optional(),description:C().optional()}),eM=Oa(ie({applyDefaults:$t().optional()}),tt(C(),it())),tM=Xc(e=>e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,Oa(ie({form:eM.optional(),url:Pt.optional()}),tt(C(),it()).optional())),rM=Mt({list:Pt.optional(),cancel:Pt.optional(),requests:Mt({sampling:Mt({createMessage:Pt.optional()}).optional(),elicitation:Mt({create:Pt.optional()}).optional()}).optional()}),nM=Mt({list:Pt.optional(),cancel:Pt.optional(),requests:Mt({tools:Mt({call:Pt.optional()}).optional()}).optional()}),iM=ie({experimental:tt(C(),Pt).optional(),sampling:ie({context:Pt.optional(),tools:Pt.optional()}).optional(),elicitation:tM.optional(),roots:ie({listChanged:$t().optional()}).optional(),tasks:rM.optional(),extensions:tt(C(),Pt).optional()}),oM=Rr.extend({protocolVersion:C(),capabilities:iM,clientInfo:xT}),Um=Ut.extend({method:fe("initialize"),params:oM}),rb=e=>Um.safeParse(e).success,aM=ie({experimental:tt(C(),Pt).optional(),logging:Pt.optional(),completions:Pt.optional(),prompts:ie({listChanged:$t().optional()}).optional(),resources:ie({subscribe:$t().optional(),listChanged:$t().optional()}).optional(),tools:ie({listChanged:$t().optional()}).optional(),tasks:nM.optional(),extensions:tt(C(),Pt).optional()}),sM=Zt.extend({protocolVersion:C(),capabilities:aM,serverInfo:xT,instructions:C().optional()}),nb=Fr.extend({method:fe("notifications/initialized"),params:Zr.optional()});var Zm=Ut.extend({method:fe("ping"),params:Rr.optional()}),cM=ie({progress:He(),total:Qe(He()),message:Qe(C())}),lM=ie({...Zr.shape,...cM.shape,progressToken:yT}),Fm=Fr.extend({method:fe("notifications/progress"),params:lM}),uM=Rr.extend({cursor:_T.optional()}),fl=Ut.extend({params:uM.optional()}),hl=Zt.extend({nextCursor:_T.optional()}),dM=Lt(["working","input_required","completed","failed","cancelled"]),gl=ie({taskId:C(),status:dM,ttl:Xe([He(),Vc()]),createdAt:C(),lastUpdatedAt:C(),pollInterval:Qe(He()),statusMessage:Qe(C())}),Ya=Zt.extend({task:gl}),pM=Zr.merge(gl),vl=Fr.extend({method:fe("notifications/tasks/status"),params:pM}),Vm=Ut.extend({method:fe("tasks/get"),params:Rr.extend({taskId:C()})}),qm=Zt.merge(gl),Bm=Ut.extend({method:fe("tasks/result"),params:Rr.extend({taskId:C()})}),UG=Zt.loose(),Hm=fl.extend({method:fe("tasks/list")}),Jm=hl.extend({tasks:je(gl)}),Gm=Ut.extend({method:fe("tasks/cancel"),params:Rr.extend({taskId:C()})}),ST=Zt.merge(gl),IT=ie({uri:C(),mimeType:Qe(C()),_meta:tt(C(),it()).optional()}),TT=IT.extend({text:C()}),ib=C().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),zT=IT.extend({blob:ib}),yl=Lt(["user","assistant"]),Qa=ie({audience:je(yl).optional(),priority:He().min(0).max(1).optional(),lastModified:uo.datetime({offset:!0}).optional()}),PT=ie({...Ka.shape,...ml.shape,uri:C(),description:Qe(C()),mimeType:Qe(C()),size:Qe(He()),annotations:Qa.optional(),_meta:Qe(Mt({}))}),mM=ie({...Ka.shape,...ml.shape,uriTemplate:C(),description:Qe(C()),mimeType:Qe(C()),annotations:Qa.optional(),_meta:Qe(Mt({}))}),Km=fl.extend({method:fe("resources/list")}),fM=hl.extend({resources:je(PT)}),Wm=fl.extend({method:fe("resources/templates/list")}),hM=hl.extend({resourceTemplates:je(mM)}),ob=Rr.extend({uri:C()}),gM=ob,Xm=Ut.extend({method:fe("resources/read"),params:gM}),vM=Zt.extend({contents:je(Xe([TT,zT]))}),yM=Fr.extend({method:fe("notifications/resources/list_changed"),params:Zr.optional()}),_M=ob,bM=Ut.extend({method:fe("resources/subscribe"),params:_M}),$M=ob,wM=Ut.extend({method:fe("resources/unsubscribe"),params:$M}),kM=Zr.extend({uri:C()}),xM=Fr.extend({method:fe("notifications/resources/updated"),params:kM}),SM=ie({name:C(),description:Qe(C()),required:Qe($t())}),IM=ie({...Ka.shape,...ml.shape,description:Qe(C()),arguments:Qe(je(SM)),_meta:Qe(Mt({}))}),Ym=fl.extend({method:fe("prompts/list")}),TM=hl.extend({prompts:je(IM)}),zM=Rr.extend({name:C(),arguments:tt(C(),C()).optional()}),Qm=Ut.extend({method:fe("prompts/get"),params:zM}),ab=ie({type:fe("text"),text:C(),annotations:Qa.optional(),_meta:tt(C(),it()).optional()}),sb=ie({type:fe("image"),data:ib,mimeType:C(),annotations:Qa.optional(),_meta:tt(C(),it()).optional()}),cb=ie({type:fe("audio"),data:ib,mimeType:C(),annotations:Qa.optional(),_meta:tt(C(),it()).optional()}),PM=ie({type:fe("tool_use"),name:C(),id:C(),input:tt(C(),it()),_meta:tt(C(),it()).optional()}),EM=ie({type:fe("resource"),resource:Xe([TT,zT]),annotations:Qa.optional(),_meta:tt(C(),it()).optional()}),OM=PT.extend({type:fe("resource_link")}),lb=Xe([ab,sb,cb,OM,EM]),jM=ie({role:yl,content:lb}),RM=Zt.extend({description:C().optional(),messages:je(jM)}),DM=Fr.extend({method:fe("notifications/prompts/list_changed"),params:Zr.optional()}),CM=ie({title:C().optional(),readOnlyHint:$t().optional(),destructiveHint:$t().optional(),idempotentHint:$t().optional(),openWorldHint:$t().optional()}),AM=ie({taskSupport:Lt(["required","optional","forbidden"]).optional()}),ET=ie({...Ka.shape,...ml.shape,description:C().optional(),inputSchema:ie({type:fe("object"),properties:tt(C(),Pt).optional(),required:je(C()).optional()}).catchall(it()),outputSchema:ie({type:fe("object"),properties:tt(C(),Pt).optional(),required:je(C()).optional()}).catchall(it()).optional(),annotations:CM.optional(),execution:AM.optional(),_meta:tt(C(),it()).optional()}),ef=fl.extend({method:fe("tools/list")}),NM=hl.extend({tools:je(ET)}),tf=Zt.extend({content:je(lb).default([]),structuredContent:tt(C(),it()).optional(),isError:$t().optional()}),ZG=tf.or(Zt.extend({toolResult:it()})),MM=pl.extend({name:C(),arguments:tt(C(),it()).optional()}),es=Ut.extend({method:fe("tools/call"),params:MM}),LM=Fr.extend({method:fe("notifications/tools/list_changed"),params:Zr.optional()}),FG=ie({autoRefresh:$t().default(!0),debounceMs:He().int().nonnegative().default(300)}),_l=Lt(["debug","info","notice","warning","error","critical","alert","emergency"]),UM=Rr.extend({level:_l}),ub=Ut.extend({method:fe("logging/setLevel"),params:UM}),ZM=Zr.extend({level:_l,logger:C().optional(),data:it()}),FM=Fr.extend({method:fe("notifications/message"),params:ZM}),VM=ie({name:C().optional()}),qM=ie({hints:je(VM).optional(),costPriority:He().min(0).max(1).optional(),speedPriority:He().min(0).max(1).optional(),intelligencePriority:He().min(0).max(1).optional()}),BM=ie({mode:Lt(["auto","required","none"]).optional()}),HM=ie({type:fe("tool_result"),toolUseId:C().describe("The unique identifier for the corresponding tool call."),content:je(lb).default([]),structuredContent:ie({}).loose().optional(),isError:$t().optional(),_meta:tt(C(),it()).optional()}),JM=Jc("type",[ab,sb,cb]),Cm=Jc("type",[ab,sb,cb,PM,HM]),GM=ie({role:yl,content:Xe([Cm,je(Cm)]),_meta:tt(C(),it()).optional()}),KM=pl.extend({messages:je(GM),modelPreferences:qM.optional(),systemPrompt:C().optional(),includeContext:Lt(["none","thisServer","allServers"]).optional(),temperature:He().optional(),maxTokens:He().int(),stopSequences:je(C()).optional(),metadata:Pt.optional(),tools:je(ET).optional(),toolChoice:BM.optional()}),WM=Ut.extend({method:fe("sampling/createMessage"),params:KM}),bl=Zt.extend({model:C(),stopReason:Qe(Lt(["endTurn","stopSequence","maxTokens"]).or(C())),role:yl,content:JM}),db=Zt.extend({model:C(),stopReason:Qe(Lt(["endTurn","stopSequence","maxTokens","toolUse"]).or(C())),role:yl,content:Xe([Cm,je(Cm)])}),XM=ie({type:fe("boolean"),title:C().optional(),description:C().optional(),default:$t().optional()}),YM=ie({type:fe("string"),title:C().optional(),description:C().optional(),minLength:He().optional(),maxLength:He().optional(),format:Lt(["email","uri","date","date-time"]).optional(),default:C().optional()}),QM=ie({type:Lt(["number","integer"]),title:C().optional(),description:C().optional(),minimum:He().optional(),maximum:He().optional(),default:He().optional()}),e4=ie({type:fe("string"),title:C().optional(),description:C().optional(),enum:je(C()),default:C().optional()}),t4=ie({type:fe("string"),title:C().optional(),description:C().optional(),oneOf:je(ie({const:C(),title:C()})),default:C().optional()}),r4=ie({type:fe("string"),title:C().optional(),description:C().optional(),enum:je(C()),enumNames:je(C()).optional(),default:C().optional()}),n4=Xe([e4,t4]),i4=ie({type:fe("array"),title:C().optional(),description:C().optional(),minItems:He().optional(),maxItems:He().optional(),items:ie({type:fe("string"),enum:je(C())}),default:je(C()).optional()}),o4=ie({type:fe("array"),title:C().optional(),description:C().optional(),minItems:He().optional(),maxItems:He().optional(),items:ie({anyOf:je(ie({const:C(),title:C()}))}),default:je(C()).optional()}),a4=Xe([i4,o4]),s4=Xe([r4,n4,a4]),c4=Xe([s4,XM,YM,QM]),l4=pl.extend({mode:fe("form").optional(),message:C(),requestedSchema:ie({type:fe("object"),properties:tt(C(),c4),required:je(C()).optional()})}),u4=pl.extend({mode:fe("url"),message:C(),elicitationId:C(),url:C().url()}),d4=Xe([l4,u4]),p4=Ut.extend({method:fe("elicitation/create"),params:d4}),m4=Zr.extend({elicitationId:C()}),f4=Fr.extend({method:fe("notifications/elicitation/complete"),params:m4}),ts=Zt.extend({action:Lt(["accept","decline","cancel"]),content:Xc(e=>e===null?void 0:e,tt(C(),Xe([C(),He(),$t(),je(C())])).optional())}),h4=ie({type:fe("ref/resource"),uri:C()});var g4=ie({type:fe("ref/prompt"),name:C()}),v4=Rr.extend({ref:Xe([g4,h4]),argument:ie({name:C(),value:C()}),context:ie({arguments:tt(C(),C()).optional()}).optional()}),rf=Ut.extend({method:fe("completion/complete"),params:v4});function OT(e){if(e.params.ref.type!=="ref/prompt")throw new TypeError(`Expected CompleteRequestPrompt, but got ${e.params.ref.type}`)}function jT(e){if(e.params.ref.type!=="ref/resource")throw new TypeError(`Expected CompleteRequestResourceTemplate, but got ${e.params.ref.type}`)}var y4=Zt.extend({completion:Mt({values:je(C()).max(100),total:Qe(He().int()),hasMore:Qe($t())})}),_4=ie({uri:C().startsWith("file://"),name:C().optional(),_meta:tt(C(),it()).optional()}),b4=Ut.extend({method:fe("roots/list"),params:Rr.optional()}),pb=Zt.extend({roots:je(_4)}),$4=Fr.extend({method:fe("notifications/roots/list_changed"),params:Zr.optional()}),VG=Xe([Zm,Um,rf,ub,Qm,Ym,Km,Wm,Xm,bM,wM,es,ef,Vm,Bm,Hm,Gm]),qG=Xe([Lm,Fm,nb,$4,vl]),BG=Xe([Mm,bl,db,ts,pb,qm,Jm,Ya]),HG=Xe([Zm,WM,p4,b4,Vm,Bm,Hm,Gm]),JG=Xe([Lm,Fm,FM,xM,yM,LM,DM,vl,f4]),GG=Xe([Mm,sM,y4,RM,TM,fM,hM,vM,tf,NM,qm,Jm,Ya]),de=class e extends Error{constructor(t,n,i){super(`MCP error ${t}: ${n}`),this.code=t,this.data=i,this.name="McpError"}static fromError(t,n,i){if(t===pe.UrlElicitationRequired&&i){let r=i;if(r.elicitations)return new W_(r.elicitations,n)}return new e(t,n,i)}},W_=class extends de{constructor(t,n=`URL elicitation${t.length>1?"s":""} required`){super(pe.UrlElicitationRequired,n,{elicitations:t})}get elicitations(){return this.data?.elicitations??[]}};function xi(e){return e==="completed"||e==="failed"||e==="cancelled"}var DT=Symbol("Let zodToJsonSchema decide on which parser to use");var RT={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"},CT=e=>typeof e=="string"?{...RT,name:e}:{...RT,...e};var AT=e=>{let t=CT(e),n=t.name!==void 0?[...t.basePath,t.definitionPath,t.name]:t.basePath;return{...t,flags:{hasReferencedOpenAiAnyType:!1},currentPath:n,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([i,r])=>[r._def,{def:r._def,path:[...t.basePath,t.definitionPath,i],jsonSchema:void 0}]))}};function mb(e,t,n,i){i?.errorMessages&&n&&(e.errorMessage={...e.errorMessage,[t]:n})}function Ze(e,t,n,i,r){e[t]=n,mb(e,t,i,r)}var nf=(e,t)=>{let n=0;for(;n<e.length&&n<t.length&&e[n]===t[n];n++);return[(e.length-n).toString(),...t.slice(n)].join("/")};function ft(e){if(e.target!=="openAi")return{};let t=[...e.basePath,e.definitionPath,e.openAiAnyTypeName];return e.flags.hasReferencedOpenAiAnyType=!0,{$ref:e.$refStrategy==="relative"?nf(t,e.currentPath):t.join("/")}}function NT(e,t){let n={type:"array"};return e.type?._def&&e.type?._def?.typeName!==G.ZodAny&&(n.items=ke(e.type._def,{...t,currentPath:[...t.currentPath,"items"]})),e.minLength&&Ze(n,"minItems",e.minLength.value,e.minLength.message,t),e.maxLength&&Ze(n,"maxItems",e.maxLength.value,e.maxLength.message,t),e.exactLength&&(Ze(n,"minItems",e.exactLength.value,e.exactLength.message,t),Ze(n,"maxItems",e.exactLength.value,e.exactLength.message,t)),n}function MT(e,t){let n={type:"integer",format:"int64"};if(!e.checks)return n;for(let i of e.checks)switch(i.kind){case"min":t.target==="jsonSchema7"?i.inclusive?Ze(n,"minimum",i.value,i.message,t):Ze(n,"exclusiveMinimum",i.value,i.message,t):(i.inclusive||(n.exclusiveMinimum=!0),Ze(n,"minimum",i.value,i.message,t));break;case"max":t.target==="jsonSchema7"?i.inclusive?Ze(n,"maximum",i.value,i.message,t):Ze(n,"exclusiveMaximum",i.value,i.message,t):(i.inclusive||(n.exclusiveMaximum=!0),Ze(n,"maximum",i.value,i.message,t));break;case"multipleOf":Ze(n,"multipleOf",i.value,i.message,t);break}return n}function LT(){return{type:"boolean"}}function of(e,t){return ke(e.type._def,t)}var UT=(e,t)=>ke(e.innerType._def,t);function fb(e,t,n){let i=n??t.dateStrategy;if(Array.isArray(i))return{anyOf:i.map((r,o)=>fb(e,t,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 w4(e,t)}}var w4=(e,t)=>{let n={type:"integer",format:"unix-time"};if(t.target==="openApi3")return n;for(let i of e.checks)switch(i.kind){case"min":Ze(n,"minimum",i.value,i.message,t);break;case"max":Ze(n,"maximum",i.value,i.message,t);break}return n};function ZT(e,t){return{...ke(e.innerType._def,t),default:e.defaultValue()}}function FT(e,t){return t.effectStrategy==="input"?ke(e.schema._def,t):ft(t)}function VT(e){return{type:"string",enum:Array.from(e.values)}}var k4=e=>"type"in e&&e.type==="string"?!1:"allOf"in e;function qT(e,t){let n=[ke(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),ke(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter(o=>!!o),i=t.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,r=[];return n.forEach(o=>{if(k4(o))r.push(...o.allOf),o.unevaluatedProperties===void 0&&(i=void 0);else{let a=o;if("additionalProperties"in o&&o.additionalProperties===!1){let{additionalProperties:s,...c}=o;a=c}else i=void 0;r.push(a)}}),r.length?{allOf:r,...i}:void 0}function BT(e,t){let n=typeof e.value;return n!=="bigint"&&n!=="number"&&n!=="boolean"&&n!=="string"?{type:Array.isArray(e.value)?"array":"object"}:t.target==="openApi3"?{type:n==="bigint"?"integer":n,enum:[e.value]}:{type:n==="bigint"?"integer":n,const:e.value}}var hb,on={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:()=>(hb===void 0&&(hb=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),hb),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 af(e,t){let n={type:"string"};if(e.checks)for(let i of e.checks)switch(i.kind){case"min":Ze(n,"minLength",typeof n.minLength=="number"?Math.max(n.minLength,i.value):i.value,i.message,t);break;case"max":Ze(n,"maxLength",typeof n.maxLength=="number"?Math.min(n.maxLength,i.value):i.value,i.message,t);break;case"email":switch(t.emailStrategy){case"format:email":an(n,"email",i.message,t);break;case"format:idn-email":an(n,"idn-email",i.message,t);break;case"pattern:zod":cr(n,on.email,i.message,t);break}break;case"url":an(n,"uri",i.message,t);break;case"uuid":an(n,"uuid",i.message,t);break;case"regex":cr(n,i.regex,i.message,t);break;case"cuid":cr(n,on.cuid,i.message,t);break;case"cuid2":cr(n,on.cuid2,i.message,t);break;case"startsWith":cr(n,RegExp(`^${gb(i.value,t)}`),i.message,t);break;case"endsWith":cr(n,RegExp(`${gb(i.value,t)}$`),i.message,t);break;case"datetime":an(n,"date-time",i.message,t);break;case"date":an(n,"date",i.message,t);break;case"time":an(n,"time",i.message,t);break;case"duration":an(n,"duration",i.message,t);break;case"length":Ze(n,"minLength",typeof n.minLength=="number"?Math.max(n.minLength,i.value):i.value,i.message,t),Ze(n,"maxLength",typeof n.maxLength=="number"?Math.min(n.maxLength,i.value):i.value,i.message,t);break;case"includes":{cr(n,RegExp(gb(i.value,t)),i.message,t);break}case"ip":{i.version!=="v6"&&an(n,"ipv4",i.message,t),i.version!=="v4"&&an(n,"ipv6",i.message,t);break}case"base64url":cr(n,on.base64url,i.message,t);break;case"jwt":cr(n,on.jwt,i.message,t);break;case"cidr":{i.version!=="v6"&&cr(n,on.ipv4Cidr,i.message,t),i.version!=="v4"&&cr(n,on.ipv6Cidr,i.message,t);break}case"emoji":cr(n,on.emoji(),i.message,t);break;case"ulid":{cr(n,on.ulid,i.message,t);break}case"base64":{switch(t.base64Strategy){case"format:binary":{an(n,"binary",i.message,t);break}case"contentEncoding:base64":{Ze(n,"contentEncoding","base64",i.message,t);break}case"pattern:zod":{cr(n,on.base64,i.message,t);break}}break}case"nanoid":cr(n,on.nanoid,i.message,t);case"toLowerCase":case"toUpperCase":case"trim":break;default:}return n}function gb(e,t){return t.patternStrategy==="escape"?S4(e):e}var x4=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function S4(e){let t="";for(let n=0;n<e.length;n++)x4.has(e[n])||(t+="\\"),t+=e[n];return t}function an(e,t,n,i){e.format||e.anyOf?.some(r=>r.format)?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format,...e.errorMessage&&i.errorMessages&&{errorMessage:{format:e.errorMessage.format}}}),delete e.format,e.errorMessage&&(delete e.errorMessage.format,Object.keys(e.errorMessage).length===0&&delete e.errorMessage)),e.anyOf.push({format:t,...n&&i.errorMessages&&{errorMessage:{format:n}}})):Ze(e,"format",t,n,i)}function cr(e,t,n,i){e.pattern||e.allOf?.some(r=>r.pattern)?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern,...e.errorMessage&&i.errorMessages&&{errorMessage:{pattern:e.errorMessage.pattern}}}),delete e.pattern,e.errorMessage&&(delete e.errorMessage.pattern,Object.keys(e.errorMessage).length===0&&delete e.errorMessage)),e.allOf.push({pattern:HT(t,i),...n&&i.errorMessages&&{errorMessage:{pattern:n}}})):Ze(e,"pattern",HT(t,i),n,i)}function HT(e,t){if(!t.applyRegexFlags||!e.flags)return e.source;let n={i:e.flags.includes("i"),m:e.flags.includes("m"),s:e.flags.includes("s")},i=n.i?e.source.toLowerCase():e.source,r="",o=!1,a=!1,s=!1;for(let c=0;c<i.length;c++){if(o){r+=i[c],o=!1;continue}if(n.i){if(a){if(i[c].match(/[a-z]/)){s?(r+=i[c],r+=`${i[c-2]}-${i[c]}`.toUpperCase(),s=!1):i[c+1]==="-"&&i[c+2]?.match(/[a-z]/)?(r+=i[c],s=!0):r+=`${i[c]}${i[c].toUpperCase()}`;continue}}else if(i[c].match(/[a-z]/)){r+=`[${i[c]}${i[c].toUpperCase()}]`;continue}}if(n.m){if(i[c]==="^"){r+=`(^|(?<=[\r
|
|
93
|
+
]))`;continue}else if(i[c]==="$"){r+=`($|(?=[\r
|
|
94
|
+
]))`;continue}}if(n.s&&i[c]==="."){r+=a?`${i[c]}\r
|
|
95
|
+
`:`[${i[c]}\r
|
|
96
|
+
]`;continue}r+=i[c],i[c]==="\\"?o=!0:a&&i[c]==="]"?a=!1:!a&&i[c]==="["&&(a=!0)}try{new RegExp(r)}catch{return console.warn(`Could not convert regex pattern at ${t.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return r}function sf(e,t){if(t.target==="openAi"&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),t.target==="openApi3"&&e.keyType?._def.typeName===G.ZodEnum)return{type:"object",required:e.keyType._def.values,properties:e.keyType._def.values.reduce((i,r)=>({...i,[r]:ke(e.valueType._def,{...t,currentPath:[...t.currentPath,"properties",r]})??ft(t)}),{}),additionalProperties:t.rejectedAdditionalProperties};let n={type:"object",additionalProperties:ke(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]})??t.allowedAdditionalProperties};if(t.target==="openApi3")return n;if(e.keyType?._def.typeName===G.ZodString&&e.keyType._def.checks?.length){let{type:i,...r}=af(e.keyType._def,t);return{...n,propertyNames:r}}else{if(e.keyType?._def.typeName===G.ZodEnum)return{...n,propertyNames:{enum:e.keyType._def.values}};if(e.keyType?._def.typeName===G.ZodBranded&&e.keyType._def.type._def.typeName===G.ZodString&&e.keyType._def.type._def.checks?.length){let{type:i,...r}=of(e.keyType._def,t);return{...n,propertyNames:r}}}return n}function JT(e,t){if(t.mapStrategy==="record")return sf(e,t);let n=ke(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||ft(t),i=ke(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||ft(t);return{type:"array",maxItems:125,items:{type:"array",items:[n,i],minItems:2,maxItems:2}}}function GT(e){let t=e.values,i=Object.keys(e.values).filter(o=>typeof t[t[o]]!="number").map(o=>t[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 KT(e){return e.target==="openAi"?void 0:{not:ft({...e,currentPath:[...e.currentPath,"not"]})}}function WT(e){return e.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}var $l={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function YT(e,t){if(t.target==="openApi3")return XT(e,t);let n=e.options instanceof Map?Array.from(e.options.values()):e.options;if(n.every(i=>i._def.typeName in $l&&(!i._def.checks||!i._def.checks.length))){let i=n.reduce((r,o)=>{let a=$l[o._def.typeName];return a&&!r.includes(a)?[...r,a]: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 a=typeof o._def.value;switch(a){case"string":case"number":case"boolean":return[...r,a];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,a,s)=>s.indexOf(o)===a);return{type:r.length>1?r:r[0],enum:n.reduce((o,a)=>o.includes(a._def.value)?o:[...o,a._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 XT(e,t)}var XT=(e,t)=>{let n=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((i,r)=>ke(i._def,{...t,currentPath:[...t.currentPath,"anyOf",`${r}`]})).filter(i=>!!i&&(!t.strictUnions||typeof i=="object"&&Object.keys(i).length>0));return n.length?{anyOf:n}:void 0};function QT(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return t.target==="openApi3"?{type:$l[e.innerType._def.typeName],nullable:!0}:{type:[$l[e.innerType._def.typeName],"null"]};if(t.target==="openApi3"){let i=ke(e.innerType._def,{...t,currentPath:[...t.currentPath]});return i&&"$ref"in i?{allOf:[i],nullable:!0}:i&&{...i,nullable:!0}}let n=ke(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return n&&{anyOf:[n,{type:"null"}]}}function ez(e,t){let n={type:"number"};if(!e.checks)return n;for(let i of e.checks)switch(i.kind){case"int":n.type="integer",mb(n,"type",i.message,t);break;case"min":t.target==="jsonSchema7"?i.inclusive?Ze(n,"minimum",i.value,i.message,t):Ze(n,"exclusiveMinimum",i.value,i.message,t):(i.inclusive||(n.exclusiveMinimum=!0),Ze(n,"minimum",i.value,i.message,t));break;case"max":t.target==="jsonSchema7"?i.inclusive?Ze(n,"maximum",i.value,i.message,t):Ze(n,"exclusiveMaximum",i.value,i.message,t):(i.inclusive||(n.exclusiveMaximum=!0),Ze(n,"maximum",i.value,i.message,t));break;case"multipleOf":Ze(n,"multipleOf",i.value,i.message,t);break}return n}function tz(e,t){let n=t.target==="openAi",i={type:"object",properties:{}},r=[],o=e.shape();for(let s in o){let c=o[s];if(c===void 0||c._def===void 0)continue;let l=T4(c);l&&n&&(c._def.typeName==="ZodOptional"&&(c=c._def.innerType),c.isNullable()||(c=c.nullable()),l=!1);let u=ke(c._def,{...t,currentPath:[...t.currentPath,"properties",s],propertyPath:[...t.currentPath,"properties",s]});u!==void 0&&(i.properties[s]=u,l||r.push(s))}r.length&&(i.required=r);let a=I4(e,t);return a!==void 0&&(i.additionalProperties=a),i}function I4(e,t){if(e.catchall._def.typeName!=="ZodNever")return ke(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]});switch(e.unknownKeys){case"passthrough":return t.allowedAdditionalProperties;case"strict":return t.rejectedAdditionalProperties;case"strip":return t.removeAdditionalStrategy==="strict"?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}function T4(e){try{return e.isOptional()}catch{return!0}}var rz=(e,t)=>{if(t.currentPath.toString()===t.propertyPath?.toString())return ke(e.innerType._def,t);let n=ke(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return n?{anyOf:[{not:ft(t)},n]}:ft(t)};var nz=(e,t)=>{if(t.pipeStrategy==="input")return ke(e.in._def,t);if(t.pipeStrategy==="output")return ke(e.out._def,t);let n=ke(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),i=ke(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",n?"1":"0"]});return{allOf:[n,i].filter(r=>r!==void 0)}};function iz(e,t){return ke(e.type._def,t)}function oz(e,t){let i={type:"array",uniqueItems:!0,items:ke(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};return e.minSize&&Ze(i,"minItems",e.minSize.value,e.minSize.message,t),e.maxSize&&Ze(i,"maxItems",e.maxSize.value,e.maxSize.message,t),i}function az(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((n,i)=>ke(n._def,{...t,currentPath:[...t.currentPath,"items",`${i}`]})).reduce((n,i)=>i===void 0?n:[...n,i],[]),additionalItems:ke(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((n,i)=>ke(n._def,{...t,currentPath:[...t.currentPath,"items",`${i}`]})).reduce((n,i)=>i===void 0?n:[...n,i],[])}}function sz(e){return{not:ft(e)}}function cz(e){return ft(e)}var lz=(e,t)=>ke(e.innerType._def,t);var uz=(e,t,n)=>{switch(t){case G.ZodString:return af(e,n);case G.ZodNumber:return ez(e,n);case G.ZodObject:return tz(e,n);case G.ZodBigInt:return MT(e,n);case G.ZodBoolean:return LT();case G.ZodDate:return fb(e,n);case G.ZodUndefined:return sz(n);case G.ZodNull:return WT(n);case G.ZodArray:return NT(e,n);case G.ZodUnion:case G.ZodDiscriminatedUnion:return YT(e,n);case G.ZodIntersection:return qT(e,n);case G.ZodTuple:return az(e,n);case G.ZodRecord:return sf(e,n);case G.ZodLiteral:return BT(e,n);case G.ZodEnum:return VT(e);case G.ZodNativeEnum:return GT(e);case G.ZodNullable:return QT(e,n);case G.ZodOptional:return rz(e,n);case G.ZodMap:return JT(e,n);case G.ZodSet:return oz(e,n);case G.ZodLazy:return()=>e.getter()._def;case G.ZodPromise:return iz(e,n);case G.ZodNaN:case G.ZodNever:return KT(n);case G.ZodEffects:return FT(e,n);case G.ZodAny:return ft(n);case G.ZodUnknown:return cz(n);case G.ZodDefault:return ZT(e,n);case G.ZodBranded:return of(e,n);case G.ZodReadonly:return lz(e,n);case G.ZodCatch:return UT(e,n);case G.ZodPipeline:return nz(e,n);case G.ZodFunction:case G.ZodVoid:case G.ZodSymbol:return;default:return(i=>{})(t)}};function ke(e,t,n=!1){let i=t.seen.get(e);if(t.override){let s=t.override?.(e,t,i,n);if(s!==DT)return s}if(i&&!n){let s=z4(i,t);if(s!==void 0)return s}let r={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,r);let o=uz(e,e.typeName,t),a=typeof o=="function"?ke(o(),t):o;if(a&&P4(e,t,a),t.postProcess){let s=t.postProcess(a,e,t);return r.jsonSchema=a,s}return r.jsonSchema=a,a}var z4=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:nf(t.currentPath,e.path)};case"none":case"seen":return e.path.length<t.currentPath.length&&e.path.every((n,i)=>t.currentPath[i]===n)?(console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),ft(t)):t.$refStrategy==="seen"?ft(t):void 0}},P4=(e,t,n)=>(e.description&&(n.description=e.description,t.markdownDescription&&(n.markdownDescription=e.description)),n);var vb=(e,t)=>{let n=AT(t),i=typeof t=="object"&&t.definitions?Object.entries(t.definitions).reduce((c,[l,u])=>({...c,[l]:ke(u._def,{...n,currentPath:[...n.basePath,n.definitionPath,l]},!0)??ft(n)}),{}):void 0,r=typeof t=="string"?t:t?.nameStrategy==="title"?void 0:t?.name,o=ke(e._def,r===void 0?n:{...n,currentPath:[...n.basePath,n.definitionPath,r]},!1)??ft(n),a=typeof t=="object"&&t.name!==void 0&&t.nameStrategy==="title"?t.name:void 0;a!==void 0&&(o.title=a),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 s=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"?s.$schema="http://json-schema.org/draft-07/schema#":(n.target==="jsonSchema2019-09"||n.target==="openAi")&&(s.$schema="https://json-schema.org/draft/2019-09/schema#"),n.target==="openAi"&&("anyOf"in s||"oneOf"in s||"allOf"in s||"type"in s&&Array.isArray(s.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),s};function E4(e){return!e||e==="jsonSchema7"||e==="draft-7"?"draft-7":e==="jsonSchema2019-09"||e==="draft-2020-12"?"draft-2020-12":"draft-7"}function yb(e,t){return wn(e)?oo(e,{target:E4(t?.target),io:t?.pipeStrategy??"input"}):vb(e,{strictUnions:t?.strictUnions??!0,pipeStrategy:t?.pipeStrategy??"input"})}function _b(e){let n=wi(e)?.method;if(!n)throw new Error("Schema is missing a method literal");let i=Ga(n);if(typeof i!="string")throw new Error("Schema method literal must be a string");return i}function bb(e,t){let n=$i(e,t);if(!n.success)throw n.error;return n.data}var O4=6e4,cf=class{constructor(t){this._options=t,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(Lm,n=>{this._oncancel(n)}),this.setNotificationHandler(Fm,n=>{this._onprogress(n)}),this.setRequestHandler(Zm,n=>({})),this._taskStore=t?.taskStore,this._taskMessageQueue=t?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(Vm,async(n,i)=>{let r=await this._taskStore.getTask(n.params.taskId,i.sessionId);if(!r)throw new de(pe.InvalidParams,"Failed to retrieve task: Task not found");return{...r}}),this.setRequestHandler(Bm,async(n,i)=>{let r=async()=>{let o=n.params.taskId;if(!await this._taskStore.getTask(o,i.sessionId))throw new de(pe.InvalidParams,`Task not found: ${o}`);if(this._taskMessageQueue){let s;for(;s=await this._taskMessageQueue.dequeue(o,i.sessionId);){if(s.type==="response"||s.type==="error"){let c=s.message,l=c.id,u=this._requestResolvers.get(l);if(u)if(this._requestResolvers.delete(l),s.type==="response")u(c);else{let p=c,h=new de(p.error.code,p.error.message,p.error.data);u(h)}else{let p=s.type==="response"?"Response":"Error";this._onerror(new Error(`${p} handler missing for request ${l}`))}continue}await this._transport?.send(s.message,{relatedRequestId:i.requestId})}}let a=await this._taskStore.getTask(o,i.sessionId);if(!a)throw new de(pe.InvalidParams,`Task not found: ${o}`);if(!xi(a.status))return await this._waitForTaskUpdate(o,i.signal,i.sessionId),await r();if(xi(a.status)){let s=await this._taskStore.getTaskResult(o,i.sessionId);return this._clearTaskQueue(o,i.sessionId),{...s,_meta:{...s._meta,[ki]:{taskId:o}}}}return await r()};return await r()}),this.setRequestHandler(Hm,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 de(pe.InvalidParams,`Failed to list tasks: ${r instanceof Error?r.message:String(r)}`)}}),this.setRequestHandler(Gm,async(n,i)=>{try{let r=await this._taskStore.getTask(n.params.taskId,i.sessionId);if(!r)throw new de(pe.InvalidParams,`Task not found: ${n.params.taskId}`);if(xi(r.status))throw new de(pe.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,i.sessionId);let o=await this._taskStore.getTask(n.params.taskId,i.sessionId);if(!o)throw new de(pe.InvalidParams,`Task not found after cancellation: ${n.params.taskId}`);return{_meta:{},...o}}catch(r){throw r instanceof de?r:new de(pe.InvalidRequest,`Failed to cancel task: ${r instanceof Error?r.message:String(r)}`)}}))}async _oncancel(t){if(!t.params.requestId)return;this._requestHandlerAbortControllers.get(t.params.requestId)?.abort(t.params.reason)}_setupTimeout(t,n,i,r,o=!1){this._timeoutInfo.set(t,{timeoutId:setTimeout(r,n),startTime:Date.now(),timeout:n,maxTotalTimeout:i,resetTimeoutOnProgress:o,onTimeout:r})}_resetTimeout(t){let n=this._timeoutInfo.get(t);if(!n)return!1;let i=Date.now()-n.startTime;if(n.maxTotalTimeout&&i>=n.maxTotalTimeout)throw this._timeoutInfo.delete(t),de.fromError(pe.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:n.maxTotalTimeout,totalElapsed:i});return clearTimeout(n.timeoutId),n.timeoutId=setTimeout(n.onTimeout,n.timeout),!0}_cleanupTimeout(t){let n=this._timeoutInfo.get(t);n&&(clearTimeout(n.timeoutId),this._timeoutInfo.delete(t))}async connect(t){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=t;let 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,a)=>{r?.(o,a),Fn(o)||Xa(o)?this._onresponse(o):Zn(o)?this._onrequest(o,a):kT(o)?this._onnotification(o):this._onerror(new Error(`Unknown message type: ${JSON.stringify(o)}`))},await this._transport.start()}_onclose(){let t=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let 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=de.fromError(pe.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let i of t.values())i(n)}_onerror(t){this.onerror?.(t)}_onnotification(t){let n=this._notificationHandlers.get(t.method)??this.fallbackNotificationHandler;n!==void 0&&Promise.resolve().then(()=>n(t)).catch(i=>this._onerror(new Error(`Uncaught error in notification handler: ${i}`)))}_onrequest(t,n){let i=this._requestHandlers.get(t.method)??this.fallbackRequestHandler,r=this._transport,o=t.params?._meta?.[ki]?.taskId,a=r?.sessionId,s=this._taskStore,c=!0,l;if(o&&s&&this._taskMessageQueue&&a!==void 0&&(c=!1,l=(async()=>{if(!await s.getTask(o,a))throw new de(pe.InvalidParams,`Task not found: ${o}`);c=!0})()),i===void 0){let _={jsonrpc:"2.0",id:t.id,error:{code:pe.MethodNotFound,message:"Method not found"}};if(o&&l){let k={type:"error",message:_,timestamp:Date.now()};l.then(()=>this._enqueueTaskMessage(o,k,a),()=>r?.send(_)).catch(T=>this._onerror(new Error(`Failed to send an error response: ${T}`)))}else o&&this._taskMessageQueue?this._enqueueTaskMessage(o,{type:"error",message:_,timestamp:Date.now()},r?.sessionId).catch(k=>this._onerror(new Error(`Failed to enqueue error response: ${k}`))):r?.send(_).catch(k=>this._onerror(new Error(`Failed to send an error response: ${k}`)));return}let u=new AbortController;this._requestHandlerAbortControllers.set(t.id,u);let p=bT(t.params)?t.params.task:void 0,h=this._taskStore?this.requestTaskStore(t,r?.sessionId):void 0,g={signal:u.signal,sessionId:r?.sessionId,_meta:t.params?._meta,sendNotification:async _=>{if(u.signal.aborted)return;let k={relatedRequestId:t.id};o&&(k.relatedTask={taskId:o}),await this.notification(_,k)},sendRequest:async(_,k,T)=>{if(u.signal.aborted)throw new de(pe.ConnectionClosed,"Request was cancelled");let z={...T,relatedRequestId:t.id};o&&!z.relatedTask&&(z.relatedTask={taskId:o});let S=z.relatedTask?.taskId??o;return S&&h&&await h.updateTaskStatus(S,"input_required"),await this.request(_,k,z)},authInfo:n?.authInfo,requestId:t.id,requestInfo:n?.requestInfo,taskId:o,taskStore:h,taskRequestedTtl:p?.ttl,closeSSEStream:n?.closeSSEStream,closeStandaloneSSEStream:n?.closeStandaloneSSEStream};(l??Promise.resolve()).then(()=>{if(l&&u.signal.aborted)throw new de(pe.ConnectionClosed,"Request was cancelled");p&&this.assertTaskHandlerCapability(t.method)}).then(()=>i(t,g)).then(async _=>{if(u.signal.aborted)return;let k={result:_,jsonrpc:"2.0",id:t.id};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"response",message:k,timestamp:Date.now()},r?.sessionId):await r?.send(k)},async _=>{if(u.signal.aborted)return;let k={jsonrpc:"2.0",id:t.id,error:{code:Number.isSafeInteger(_.code)?_.code:pe.InternalError,message:_.message??"Internal error",..._.data!==void 0&&{data:_.data}}};o&&this._taskMessageQueue&&c?await this._enqueueTaskMessage(o,{type:"error",message:k,timestamp:Date.now()},r?.sessionId):await r?.send(k)}).catch(_=>this._onerror(new Error(`Failed to send response: ${_}`))).finally(()=>{this._requestHandlerAbortControllers.get(t.id)===u&&this._requestHandlerAbortControllers.delete(t.id)})}_onprogress(t){let{progressToken:n,...i}=t.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(t)}`));return}let a=this._responseHandlers.get(r),s=this._timeoutInfo.get(r);if(s&&a&&s.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(c){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),a(c);return}o(i)}_onresponse(t){let n=Number(t.id),i=this._requestResolvers.get(n);if(i){if(this._requestResolvers.delete(n),Fn(t))i(t);else{let a=new de(t.error.code,t.error.message,t.error.data);i(a)}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(t)}`));return}this._responseHandlers.delete(n),this._cleanupTimeout(n);let o=!1;if(Fn(t)&&t.result&&typeof t.result=="object"){let a=t.result;if(a.task&&typeof a.task=="object"){let s=a.task;typeof s.taskId=="string"&&(o=!0,this._taskProgressTokens.set(s.taskId,n))}}if(o||this._progressHandlers.delete(n),Fn(t))r(t);else{let a=de.fromError(t.error.code,t.error.message,t.error.data);r(a)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(t,n,i){let{task:r}=i??{};if(!r){try{yield{type:"result",result:await this.request(t,n,i)}}catch(a){yield{type:"error",error:a instanceof de?a:new de(pe.InternalError,String(a))}}return}let o;try{let a=await this.request(t,Ya,i);if(a.task)o=a.task.taskId,yield{type:"taskCreated",task:a.task};else throw new de(pe.InternalError,"Task creation did not return a task");for(;;){let s=await this.getTask({taskId:o},i);if(yield{type:"taskStatus",task:s},xi(s.status)){s.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:o},n,i)}:s.status==="failed"?yield{type:"error",error:new de(pe.InternalError,`Task ${o} failed`)}:s.status==="cancelled"&&(yield{type:"error",error:new de(pe.InternalError,`Task ${o} was cancelled`)});return}if(s.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:o},n,i)};return}let c=s.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(l=>setTimeout(l,c)),i?.signal?.throwIfAborted()}}catch(a){yield{type:"error",error:a instanceof de?a:new de(pe.InternalError,String(a))}}}request(t,n,i){let{relatedRequestId:r,resumptionToken:o,onresumptiontoken:a,task:s,relatedTask:c}=i??{};return new Promise((l,u)=>{let p=S=>{u(S)};if(!this._transport){p(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method),s&&this.assertTaskCapability(t.method)}catch(S){p(S);return}i?.signal?.throwIfAborted();let h=this._requestMessageId++,g={...t,jsonrpc:"2.0",id:h};i?.onprogress&&(this._progressHandlers.set(h,i.onprogress),g.params={...t.params,_meta:{...t.params?._meta||{},progressToken:h}}),s&&(g.params={...g.params,task:s}),c&&(g.params={...g.params,_meta:{...g.params?._meta||{},[ki]:c}});let _=S=>{this._responseHandlers.delete(h),this._progressHandlers.delete(h),this._cleanupTimeout(h),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:h,reason:String(S)}},{relatedRequestId:r,resumptionToken:o,onresumptiontoken:a}).catch(Q=>this._onerror(new Error(`Failed to send cancellation: ${Q}`)));let A=S instanceof de?S:new de(pe.RequestTimeout,String(S));u(A)};this._responseHandlers.set(h,S=>{if(!i?.signal?.aborted){if(S instanceof Error)return u(S);try{let A=$i(n,S.result);A.success?l(A.data):u(A.error)}catch(A){u(A)}}}),i?.signal?.addEventListener("abort",()=>{_(i?.signal?.reason)});let k=i?.timeout??O4,T=()=>_(de.fromError(pe.RequestTimeout,"Request timed out",{timeout:k}));this._setupTimeout(h,k,i?.maxTotalTimeout,T,i?.resetTimeoutOnProgress??!1);let z=c?.taskId;if(z){let S=A=>{let Q=this._responseHandlers.get(h);Q?Q(A):this._onerror(new Error(`Response handler missing for side-channeled request ${h}`))};this._requestResolvers.set(h,S),this._enqueueTaskMessage(z,{type:"request",message:g,timestamp:Date.now()}).catch(A=>{this._cleanupTimeout(h),u(A)})}else this._transport.send(g,{relatedRequestId:r,resumptionToken:o,onresumptiontoken:a}).catch(S=>{this._cleanupTimeout(h),u(S)})})}async getTask(t,n){return this.request({method:"tasks/get",params:t},qm,n)}async getTaskResult(t,n,i){return this.request({method:"tasks/result",params:t},n,i)}async listTasks(t,n){return this.request({method:"tasks/list",params:t},Jm,n)}async cancelTask(t,n){return this.request({method:"tasks/cancel",params:t},ST,n)}async notification(t,n){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(t.method);let i=n?.relatedTask?.taskId;if(i){let s={...t,jsonrpc:"2.0",params:{...t.params,_meta:{...t.params?._meta||{},[ki]:n.relatedTask}}};await this._enqueueTaskMessage(i,{type:"notification",message:s,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(t.method)&&!t.params&&!n?.relatedRequestId&&!n?.relatedTask){if(this._pendingDebouncedNotifications.has(t.method))return;this._pendingDebouncedNotifications.add(t.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(t.method),!this._transport)return;let s={...t,jsonrpc:"2.0"};n?.relatedTask&&(s={...s,params:{...s.params,_meta:{...s.params?._meta||{},[ki]:n.relatedTask}}}),this._transport?.send(s,n).catch(c=>this._onerror(c))});return}let a={...t,jsonrpc:"2.0"};n?.relatedTask&&(a={...a,params:{...a.params,_meta:{...a.params?._meta||{},[ki]:n.relatedTask}}}),await this._transport.send(a,n)}setRequestHandler(t,n){let i=_b(t);this.assertRequestHandlerCapability(i),this._requestHandlers.set(i,(r,o)=>{let a=bb(t,r);return Promise.resolve(n(a,o))})}removeRequestHandler(t){this._requestHandlers.delete(t)}assertCanSetRequestHandler(t){if(this._requestHandlers.has(t))throw new Error(`A request handler for ${t} already exists, which would be overridden`)}setNotificationHandler(t,n){let i=_b(t);this._notificationHandlers.set(i,r=>{let o=bb(t,r);return Promise.resolve(n(o))})}removeNotificationHandler(t){this._notificationHandlers.delete(t)}_cleanupTaskProgressHandler(t){let n=this._taskProgressTokens.get(t);n!==void 0&&(this._progressHandlers.delete(n),this._taskProgressTokens.delete(t))}async _enqueueTaskMessage(t,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(t,n,i??this._transport?.sessionId,r)}async _clearTaskQueue(t,n){if(this._taskMessageQueue){let i=await this._taskMessageQueue.dequeueAll(t,n);for(let r of i)if(r.type==="request"&&Zn(r.message)){let o=r.message.id,a=this._requestResolvers.get(o);a?(a(new de(pe.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(o)):this._onerror(new Error(`Resolver missing for request ${o} during task ${t} cleanup`))}}}async _waitForTaskUpdate(t,n,i){let r=this._options?.defaultTaskPollInterval??1e3;try{let o=await this._taskStore?.getTask(t,i);o?.pollInterval&&(r=o.pollInterval)}catch{}return new Promise((o,a)=>{if(n.aborted){a(new de(pe.InvalidRequest,"Request cancelled"));return}let s=setTimeout(o,r);n.addEventListener("abort",()=>{clearTimeout(s),a(new de(pe.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(t,n){let i=this._taskStore;if(!i)throw new Error("No task store configured");return{createTask:async r=>{if(!t)throw new Error("No request provided");return await i.createTask(r,t.id,{method:t.method,params:t.params},n)},getTask:async r=>{let o=await i.getTask(r,n);if(!o)throw new de(pe.InvalidParams,"Failed to retrieve task: Task not found");return o},storeTaskResult:async(r,o,a)=>{await i.storeTaskResult(r,o,a,n);let s=await i.getTask(r,n);if(s){let c=vl.parse({method:"notifications/tasks/status",params:s});await this.notification(c),xi(s.status)&&this._cleanupTaskProgressHandler(r)}},getTaskResult:r=>i.getTaskResult(r,n),updateTaskStatus:async(r,o,a)=>{let s=await i.getTask(r,n);if(!s)throw new de(pe.InvalidParams,`Task "${r}" not found - it may have been cleaned up`);if(xi(s.status))throw new de(pe.InvalidParams,`Cannot update task "${r}" from terminal status "${s.status}" to "${o}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await i.updateTaskStatus(r,o,a,n);let c=await i.getTask(r,n);if(c){let l=vl.parse({method:"notifications/tasks/status",params:c});await this.notification(l),xi(c.status)&&this._cleanupTaskProgressHandler(r)}},listTasks:r=>i.listTasks(r,n)}}};function dz(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function pz(e,t){let n={...e};for(let i in t){let r=i,o=t[r];if(o===void 0)continue;let a=n[r];dz(a)&&dz(o)?n[r]={...a,...o}:n[r]=o}return n}var fO=Sr(dw(),1),hO=Sr(mO(),1);function qF(){let e=new fO.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,hO.default)(e),e}var Jf=class{constructor(t){this._ajv=t??qF()}getValidator(t){let n="$id"in t&&typeof t.$id=="string"?this._ajv.getSchema(t.$id)??this._ajv.compile(t):this._ajv.compile(t);return i=>n(i)?{valid:!0,data:i,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(n.errors)}}};var Gf=class{constructor(t){this._server=t}requestStream(t,n,i){return this._server.requestStream(t,n,i)}createMessageStream(t,n){let i=this._server.getClientCapabilities();if((t.tools||t.toolChoice)&&!i?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if(t.messages.length>0){let r=t.messages[t.messages.length-1],o=Array.isArray(r.content)?r.content:[r.content],a=o.some(u=>u.type==="tool_result"),s=t.messages.length>1?t.messages[t.messages.length-2]:void 0,c=s?Array.isArray(s.content)?s.content:[s.content]:[],l=c.some(u=>u.type==="tool_use");if(a){if(o.some(u=>u.type!=="tool_result"))throw new Error("The last message must contain only tool_result content if any is present");if(!l)throw new Error("tool_result blocks are not matching any tool_use from the previous message")}if(l){let u=new Set(c.filter(h=>h.type==="tool_use").map(h=>h.id)),p=new Set(o.filter(h=>h.type==="tool_result").map(h=>h.toolUseId));if(u.size!==p.size||![...u].every(h=>p.has(h)))throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return this.requestStream({method:"sampling/createMessage",params:t},bl,n)}elicitInputStream(t,n){let i=this._server.getClientCapabilities(),r=t.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"&&t.mode===void 0?{...t,mode:"form"}:t;return this.requestStream({method:"elicitation/create",params:o},ts,n)}async getTask(t,n){return this._server.getTask({taskId:t},n)}async getTaskResult(t,n,i){return this._server.getTaskResult({taskId:t},n,i)}async listTasks(t,n){return this._server.listTasks(t?{cursor:t}:void 0,n)}async cancelTask(t,n){return this._server.cancelTask({taskId:t},n)}};function gO(e,t,n){if(!e)throw new Error(`${n} does not support task creation (required for ${t})`);switch(t){case"tools/call":if(!e.tools?.call)throw new Error(`${n} does not support task creation for tools/call (required for ${t})`);break;default:break}}function vO(e,t,n){if(!e)throw new Error(`${n} does not support task creation (required for ${t})`);switch(t){case"sampling/createMessage":if(!e.sampling?.createMessage)throw new Error(`${n} does not support task creation for sampling/createMessage (required for ${t})`);break;case"elicitation/create":if(!e.elicitation?.create)throw new Error(`${n} does not support task creation for elicitation/create (required for ${t})`);break;default:break}}var Kf=class extends cf{constructor(t,n){super(n),this._serverInfo=t,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(_l.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 Jf,this.setRequestHandler(Um,i=>this._oninitialize(i)),this.setNotificationHandler(nb,()=>this.oninitialized?.()),this._capabilities.logging&&this.setRequestHandler(ub,async(i,r)=>{let o=r.sessionId||r.requestInfo?.headers["mcp-session-id"]||void 0,{level:a}=i.params,s=_l.safeParse(a);return s.success&&this._loggingLevels.set(o,s.data),{}})}get experimental(){return this._experimental||(this._experimental={tasks:new Gf(this)}),this._experimental}registerCapabilities(t){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=pz(this._capabilities,t)}setRequestHandler(t,n){let r=wi(t)?.method;if(!r)throw new Error("Schema is missing a method literal");let o=Ga(r);if(typeof o!="string")throw new Error("Schema method literal must be a string");if(o==="tools/call"){let s=async(c,l)=>{let u=$i(es,c);if(!u.success){let _=u.error instanceof Error?u.error.message:String(u.error);throw new de(pe.InvalidParams,`Invalid tools/call request: ${_}`)}let{params:p}=u.data,h=await Promise.resolve(n(c,l));if(p.task){let _=$i(Ya,h);if(!_.success){let k=_.error instanceof Error?_.error.message:String(_.error);throw new de(pe.InvalidParams,`Invalid task creation result: ${k}`)}return _.data}let g=$i(tf,h);if(!g.success){let _=g.error instanceof Error?g.error.message:String(g.error);throw new de(pe.InvalidParams,`Invalid tools/call result: ${_}`)}return g.data};return super.setRequestHandler(t,s)}return super.setRequestHandler(t,n)}assertCapabilityForMethod(t){switch(t){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw new Error(`Client does not support sampling (required for ${t})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new Error(`Client does not support elicitation (required for ${t})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new Error(`Client does not support listing roots (required for ${t})`);break;case"ping":break}}assertNotificationCapability(t){switch(t){case"notifications/message":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${t})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new Error(`Server does not support notifying about resources (required for ${t})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new Error(`Server does not support notifying of tool list changes (required for ${t})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new Error(`Server does not support notifying of prompt list changes (required for ${t})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new Error(`Client does not support URL elicitation (required for ${t})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(t){if(this._capabilities)switch(t){case"completion/complete":if(!this._capabilities.completions)throw new Error(`Server does not support completions (required for ${t})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${t})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new Error(`Server does not support prompts (required for ${t})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new Error(`Server does not support resources (required for ${t})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new Error(`Server does not support tools (required for ${t})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Server does not support tasks capability (required for ${t})`);break;case"ping":case"initialize":break}}assertTaskCapability(t){vO(this._clientCapabilities?.tasks?.requests,t,"Client")}assertTaskHandlerCapability(t){this._capabilities&&gO(this._capabilities.tasks?.requests,t,"Server")}async _oninitialize(t){let n=t.params.protocolVersion;return this._clientCapabilities=t.params.capabilities,this._clientVersion=t.params.clientInfo,{protocolVersion:Wa.includes(n)?n:X_,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"},Mm)}async createMessage(t,n){if((t.tools||t.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if(t.messages.length>0){let i=t.messages[t.messages.length-1],r=Array.isArray(i.content)?i.content:[i.content],o=r.some(l=>l.type==="tool_result"),a=t.messages.length>1?t.messages[t.messages.length-2]:void 0,s=a?Array.isArray(a.content)?a.content:[a.content]:[],c=s.some(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(!c)throw new Error("tool_result blocks are not matching any tool_use from the previous message")}if(c){let l=new Set(s.filter(p=>p.type==="tool_use").map(p=>p.id)),u=new Set(r.filter(p=>p.type==="tool_result").map(p=>p.toolUseId));if(l.size!==u.size||![...l].every(p=>u.has(p)))throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return t.tools?this.request({method:"sampling/createMessage",params:t},db,n):this.request({method:"sampling/createMessage",params:t},bl,n)}async elicitInput(t,n){switch(t.mode??"form"){case"url":{if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support url elicitation.");let r=t;return this.request({method:"elicitation/create",params:r},ts,n)}case"form":{if(!this._clientCapabilities?.elicitation?.form)throw new Error("Client does not support form elicitation.");let r=t.mode==="form"?t:{...t,mode:"form"},o=await this.request({method:"elicitation/create",params:r},ts,n);if(o.action==="accept"&&o.content&&r.requestedSchema)try{let s=this._jsonSchemaValidator.getValidator(r.requestedSchema)(o.content);if(!s.valid)throw new de(pe.InvalidParams,`Elicitation response content does not match requested schema: ${s.errorMessage}`)}catch(a){throw a instanceof de?a:new de(pe.InternalError,`Error validating elicitation response: ${a instanceof Error?a.message:String(a)}`)}return o}}}createElicitationCompletionNotifier(t,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:t}},n)}async listRoots(t,n){return this.request({method:"roots/list",params:t},pb,n)}async sendLoggingMessage(t,n){if(this._capabilities.logging&&!this.isMessageIgnored(t.level,n))return this.notification({method:"notifications/message",params:t})}async sendResourceUpdated(t){return this.notification({method:"notifications/resources/updated",params:t})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}};var _w=Symbol.for("mcp.completable");function bw(e,t){return Object.defineProperty(e,_w,{value:{complete:t},enumerable:!1,writable:!1,configurable:!1}),e}function $w(e){return!!e&&typeof e=="object"&&_w in e}function _O(e){return e[_w]?.complete}var yO;(function(e){e.Completable="McpCompletable"})(yO||(yO={}));var Wf=class e{static isTemplate(t){return/\{[^}\s]+\}/.test(t)}static validateLength(t,n,i){if(t.length>n)throw new Error(`${i} exceeds maximum length of ${n} characters (got ${t.length})`)}get variableNames(){return this.parts.flatMap(t=>typeof t=="string"?[]:t.names)}constructor(t){e.validateLength(t,1e6,"Template"),this.template=t,this.parts=this.parse(t)}toString(){return this.template}parse(t){let n=[],i="",r=0,o=0;for(;r<t.length;)if(t[r]==="{"){i&&(n.push(i),i="");let a=t.indexOf("}",r);if(a===-1)throw new Error("Unclosed template expression");if(o++,o>1e4)throw new Error("Template contains too many expressions (max 10000)");let s=t.slice(r+1,a),c=this.getOperator(s),l=s.includes("*"),u=this.getNames(s),p=u[0];for(let h of u)e.validateLength(h,1e6,"Variable name");n.push({name:p,operator:c,names:u,exploded:l}),r=a+1}else i+=t[r],r++;return i&&n.push(i),n}getOperator(t){return["+","#",".","/","?","&"].find(i=>t.startsWith(i))||""}getNames(t){let n=this.getOperator(t);return t.slice(n.length).split(",").map(i=>i.replace("*","").trim()).filter(i=>i.length>0)}encodeValue(t,n){return e.validateLength(t,1e6,"Variable value"),n==="+"||n==="#"?encodeURI(t):encodeURIComponent(t)}expandPart(t,n){if(t.operator==="?"||t.operator==="&"){let a=t.names.map(c=>{let l=n[c];if(l===void 0)return"";let u=Array.isArray(l)?l.map(p=>this.encodeValue(p,t.operator)).join(","):this.encodeValue(l.toString(),t.operator);return`${c}=${u}`}).filter(c=>c.length>0);return a.length===0?"":(t.operator==="?"?"?":"&")+a.join("&")}if(t.names.length>1){let a=t.names.map(s=>n[s]).filter(s=>s!==void 0);return a.length===0?"":a.map(s=>Array.isArray(s)?s[0]:s).join(",")}let i=n[t.name];if(i===void 0)return"";let o=(Array.isArray(i)?i:[i]).map(a=>this.encodeValue(a,t.operator));switch(t.operator){case"":return o.join(",");case"+":return o.join(",");case"#":return"#"+o.join(",");case".":return"."+o.join(".");case"/":return"/"+o.join("/");default:return o.join(",")}}expand(t){let n="",i=!1;for(let r of this.parts){if(typeof r=="string"){n+=r;continue}let o=this.expandPart(r,t);o&&((r.operator==="?"||r.operator==="&")&&i?n+=o.replace("?","&"):n+=o,(r.operator==="?"||r.operator==="&")&&(i=!0))}return n}escapeRegExp(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}partToRegExp(t){let n=[];for(let o of t.names)e.validateLength(o,1e6,"Variable name");if(t.operator==="?"||t.operator==="&"){for(let o=0;o<t.names.length;o++){let a=t.names[o],s=o===0?"\\"+t.operator:"&";n.push({pattern:s+this.escapeRegExp(a)+"=([^&]+)",name:a})}return n}let i,r=t.name;switch(t.operator){case"":i=t.exploded?"([^/,]+(?:,[^/,]+)*)":"([^/,]+)";break;case"+":case"#":i="(.+)";break;case".":i="\\.([^/,]+)";break;case"/":i="/"+(t.exploded?"([^/,]+(?:,[^/,]+)*)":"([^/,]+)");break;default:i="([^/]+)"}return n.push({pattern:i,name:r}),n}match(t){e.validateLength(t,1e6,"URI");let n="^",i=[];for(let s of this.parts)if(typeof s=="string")n+=this.escapeRegExp(s);else{let c=this.partToRegExp(s);for(let{pattern:l,name:u}of c)n+=l,i.push({name:u,exploded:s.exploded})}n+="$",e.validateLength(n,1e6,"Generated regex pattern");let r=new RegExp(n),o=t.match(r);if(!o)return null;let a={};for(let s=0;s<i.length;s++){let{name:c,exploded:l}=i[s],u=o[s+1],p=c.replace("*","");l&&u.includes(",")?a[p]=u.split(","):a[p]=u}return a}};var BF=/^[A-Za-z0-9._-]{1,128}$/;function HF(e){let t=[];if(e.length===0)return{isValid:!1,warnings:["Tool name cannot be empty"]};if(e.length>128)return{isValid:!1,warnings:[`Tool name exceeds maximum length of 128 characters (current: ${e.length})`]};if(e.includes(" ")&&t.push("Tool name contains spaces, which may cause parsing issues"),e.includes(",")&&t.push("Tool name contains commas, which may cause parsing issues"),(e.startsWith("-")||e.endsWith("-"))&&t.push("Tool name starts or ends with a dash, which may cause parsing issues in some contexts"),(e.startsWith(".")||e.endsWith("."))&&t.push("Tool name starts or ends with a dot, which may cause parsing issues in some contexts"),!BF.test(e)){let n=e.split("").filter(i=>!/[A-Za-z0-9._-]/.test(i)).filter((i,r,o)=>o.indexOf(i)===r);return t.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:t}}return{isValid:!0,warnings:t}}function JF(e,t){if(t.length>0){console.warn(`Tool name validation warning for "${e}":`);for(let n of t)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 ww(e){let t=HF(e);return JF(e,t.warnings),t.isValid}var Xf=class{constructor(t){this._mcpServer=t}registerToolTask(t,n,i){let r={taskSupport:"required",...n.execution};if(r.taskSupport==="forbidden")throw new Error(`Cannot register task-based tool '${t}' with taskSupport 'forbidden'. Use registerTool() instead.`);return this._mcpServer._createRegisteredTool(t,n.title,n.description,n.inputSchema,n.outputSchema,n.annotations,r,n._meta,i)}};function GF(e,t){let n=0,i=[e];for(;i.length>0;){let r=i.pop();if(!(r===null||typeof r!="object"))if(Array.isArray(r))for(let o of r){if(++n>t)return n;o!==null&&typeof o=="object"&&i.push(o)}else for(let o in r){if(!Object.prototype.hasOwnProperty.call(r,o))continue;if(++n>t)return n;let a=r[o];a!==null&&typeof a=="object"&&i.push(a)}}return n}function KF(e){if(!(e===void 0||e===1/0)){if(typeof e!="number"||Number.isNaN(e)||e<1)throw new RangeError(`maxToolInputElements must be a number of at least 1, or Infinity, got ${String(e)}`);return e}}var Yf=class{constructor(t,n){this._registeredResources={},this._registeredResourceTemplates={},this._registeredTools={},this._registeredPrompts={},this._toolHandlersInitialized=!1,this._completionHandlerInitialized=!1,this._resourceHandlersInitialized=!1,this._promptHandlersInitialized=!1,this.server=new Kf(t,n),this._maxToolInputElements=KF(n?.maxToolInputElements),n?.capabilities?.tools&&this.setToolRequestHandlers(),n?.capabilities?.resources&&this.setResourceRequestHandlers(),n?.capabilities?.prompts&&this.setPromptRequestHandlers()}get experimental(){return this._experimental||(this._experimental={tasks:new Xf(this)}),this._experimental}async connect(t){return await this.server.connect(t)}async close(){await this.server.close()}setToolRequestHandlers(){this._toolHandlersInitialized||(this.server.assertCanSetRequestHandler(Ri(ef)),this.server.assertCanSetRequestHandler(Ri(es)),this.server.registerCapabilities({tools:{listChanged:!0}}),this.server.setRequestHandler(ef,()=>({tools:Object.entries(this._registeredTools).filter(([,t])=>t.enabled).map(([t,n])=>{let i={name:t,title:n.title,description:n.description,inputSchema:(()=>{let r=Ja(n.inputSchema);return r?yb(r,{strictUnions:!0,pipeStrategy:"input"}):WF})(),annotations:n.annotations,execution:n.execution,_meta:n._meta};if(n.outputSchema){let r=Ja(n.outputSchema);r&&(i.outputSchema=yb(r,{strictUnions:!0,pipeStrategy:"output"}))}return i})})),this.server.setRequestHandler(es,async(t,n)=>{try{let i=this._registeredTools[t.params.name];if(!i)throw new de(pe.InvalidParams,`Tool ${t.params.name} not found`);if(!i.enabled)throw new de(pe.InvalidParams,`Tool ${t.params.name} disabled`);let r=!!t.params.task,o=i.execution?.taskSupport,a="createTask"in i.handler;if((o==="required"||o==="optional")&&!a)throw new de(pe.InternalError,`Tool ${t.params.name} has taskSupport '${o}' but was not registered with registerToolTask`);if(o==="required"&&!r)throw new de(pe.MethodNotFound,`Tool ${t.params.name} requires task augmentation (taskSupport: 'required')`);if(o==="optional"&&!r&&a)return await this.handleAutomaticTaskPolling(i,t,n);let s=await this.validateToolInput(i,t.params.arguments,t.params.name),c=await this.executeToolHandler(i,s,n);return r||await this.validateToolOutput(i,c,t.params.name),c}catch(i){if(i instanceof de&&i.code===pe.UrlElicitationRequired)throw i;return this.createToolError(i instanceof Error?i.message:String(i))}}),this._toolHandlersInitialized=!0)}createToolError(t){return{content:[{type:"text",text:t}],isError:!0}}async validateToolInput(t,n,i){if(this._maxToolInputElements!==void 0&&GF(n,this._maxToolInputElements)>this._maxToolInputElements)throw new de(pe.InvalidParams,`Invalid arguments for tool ${i}: arguments contain more than the maximum of ${this._maxToolInputElements} elements`);if(!t.inputSchema)return;let o=Ja(t.inputSchema)??t.inputSchema,a=await Rm(o,n??{});if(!a.success){let s="error"in a?a.error:"Unknown error",c=Dm(s);throw new de(pe.InvalidParams,`Input validation error: Invalid arguments for tool ${i}: ${c}`)}return a.data}async validateToolOutput(t,n,i){if(!t.outputSchema||!("content"in n)||n.isError)return;if(!n.structuredContent)throw new de(pe.InvalidParams,`Output validation error: Tool ${i} has an output schema but no structured content was provided`);let r=Ja(t.outputSchema),o=await Rm(r,n.structuredContent);if(!o.success){let a="error"in o?o.error:"Unknown error",s=Dm(a);throw new de(pe.InvalidParams,`Output validation error: Invalid structured content for tool ${i}: ${s}`)}}async executeToolHandler(t,n,i){let r=t.handler;if("createTask"in r){if(!i.taskStore)throw new Error("No task store provided.");let a={...i,taskStore:i.taskStore};if(t.inputSchema){let s=r;return await Promise.resolve(s.createTask(n,a))}else{let s=r;return await Promise.resolve(s.createTask(a))}}if(t.inputSchema){let a=r;return await Promise.resolve(a(n,i))}else{let a=r;return await Promise.resolve(a(i))}}async handleAutomaticTaskPolling(t,n,i){if(!i.taskStore)throw new Error("No task store provided for task-capable tool.");let r=await this.validateToolInput(t,n.params.arguments,n.params.name),o=t.handler,a={...i,taskStore:i.taskStore},s=r?await Promise.resolve(o.createTask(r,a)):await Promise.resolve(o.createTask(a)),c=s.task.taskId,l=s.task,u=l.pollInterval??5e3;for(;l.status!=="completed"&&l.status!=="failed"&&l.status!=="cancelled";){await new Promise(h=>setTimeout(h,u));let p=await i.taskStore.getTask(c);if(!p)throw new de(pe.InternalError,`Task ${c} not found during polling`);l=p}return await i.taskStore.getTaskResult(c)}setCompletionRequestHandler(){this._completionHandlerInitialized||(this.server.assertCanSetRequestHandler(Ri(rf)),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler(rf,async t=>{switch(t.params.ref.type){case"ref/prompt":return OT(t),this.handlePromptCompletion(t,t.params.ref);case"ref/resource":return jT(t),this.handleResourceCompletion(t,t.params.ref);default:throw new de(pe.InvalidParams,`Invalid completion reference: ${t.params.ref}`)}}),this._completionHandlerInitialized=!0)}async handlePromptCompletion(t,n){let i=this._registeredPrompts[n.name];if(!i)throw new de(pe.InvalidParams,`Prompt ${n.name} not found`);if(!i.enabled)throw new de(pe.InvalidParams,`Prompt ${n.name} disabled`);if(!i.argsSchema)return Yl;let o=wi(i.argsSchema)?.[t.params.argument.name];if(!$w(o))return Yl;let a=_O(o);if(!a)return Yl;let s=await a(t.params.argument.value,t.params.context);return $O(s)}async handleResourceCompletion(t,n){let i=Object.values(this._registeredResourceTemplates).find(a=>a.resourceTemplate.uriTemplate.toString()===n.uri);if(!i){if(this._registeredResources[n.uri])return Yl;throw new de(pe.InvalidParams,`Resource template ${t.params.ref.uri} not found`)}let r=i.resourceTemplate.completeCallback(t.params.argument.name);if(!r)return Yl;let o=await r(t.params.argument.value,t.params.context);return $O(o)}setResourceRequestHandlers(){this._resourceHandlersInitialized||(this.server.assertCanSetRequestHandler(Ri(Km)),this.server.assertCanSetRequestHandler(Ri(Wm)),this.server.assertCanSetRequestHandler(Ri(Xm)),this.server.registerCapabilities({resources:{listChanged:!0}}),this.server.setRequestHandler(Km,async(t,n)=>{let i=Object.entries(this._registeredResources).filter(([o,a])=>a.enabled).map(([o,a])=>({uri:o,name:a.name,...a.metadata})),r=[];for(let o of Object.values(this._registeredResourceTemplates)){if(!o.resourceTemplate.listCallback)continue;let a=await o.resourceTemplate.listCallback(n);for(let s of a.resources)r.push({...o.metadata,...s})}return{resources:[...i,...r]}}),this.server.setRequestHandler(Wm,async()=>({resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([n,i])=>({name:n,uriTemplate:i.resourceTemplate.uriTemplate.toString(),...i.metadata}))})),this.server.setRequestHandler(Xm,async(t,n)=>{let i=new URL(t.params.uri),r=this._registeredResources[i.toString()];if(r){if(!r.enabled)throw new de(pe.InvalidParams,`Resource ${i} disabled`);return r.readCallback(i,n)}for(let o of Object.values(this._registeredResourceTemplates)){let a=o.resourceTemplate.uriTemplate.match(i.toString());if(a)return o.readCallback(i,a,n)}throw new de(pe.InvalidParams,`Resource ${i} not found`)}),this._resourceHandlersInitialized=!0)}setPromptRequestHandlers(){this._promptHandlersInitialized||(this.server.assertCanSetRequestHandler(Ri(Ym)),this.server.assertCanSetRequestHandler(Ri(Qm)),this.server.registerCapabilities({prompts:{listChanged:!0}}),this.server.setRequestHandler(Ym,()=>({prompts:Object.entries(this._registeredPrompts).filter(([,t])=>t.enabled).map(([t,n])=>({name:t,title:n.title,description:n.description,arguments:n.argsSchema?XF(n.argsSchema):void 0}))})),this.server.setRequestHandler(Qm,async(t,n)=>{let i=this._registeredPrompts[t.params.name];if(!i)throw new de(pe.InvalidParams,`Prompt ${t.params.name} not found`);if(!i.enabled)throw new de(pe.InvalidParams,`Prompt ${t.params.name} disabled`);if(i.argsSchema){let r=Ja(i.argsSchema),o=await Rm(r,t.params.arguments??{});if(!o.success){let c="error"in o?o.error:"Unknown error",l=Dm(c);throw new de(pe.InvalidParams,`Invalid arguments for prompt ${t.params.name}: ${l}`)}let a=o.data,s=i.callback;return await Promise.resolve(s(a,n))}else{let r=i.callback;return await Promise.resolve(r(n))}}),this._promptHandlersInitialized=!0)}resource(t,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 a=this._createRegisteredResource(t,void 0,n,r,o);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),a}else{if(this._registeredResourceTemplates[t])throw new Error(`Resource template ${t} is already registered`);let a=this._createRegisteredResourceTemplate(t,void 0,n,r,o);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),a}}registerResource(t,n,i,r){if(typeof n=="string"){if(this._registeredResources[n])throw new Error(`Resource ${n} is already registered`);let o=this._createRegisteredResource(t,i.title,n,i,r);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),o}else{if(this._registeredResourceTemplates[t])throw new Error(`Resource template ${t} is already registered`);let o=this._createRegisteredResourceTemplate(t,i.title,n,i,r);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),o}}_createRegisteredResource(t,n,i,r,o){let a={name:t,title:n,metadata:r,readCallback:o,enabled:!0,disable:()=>a.update({enabled:!1}),enable:()=>a.update({enabled:!0}),remove:()=>a.update({uri:null}),update:s=>{typeof s.uri<"u"&&s.uri!==i&&(delete this._registeredResources[i],s.uri&&(this._registeredResources[s.uri]=a)),typeof s.name<"u"&&(a.name=s.name),typeof s.title<"u"&&(a.title=s.title),typeof s.metadata<"u"&&(a.metadata=s.metadata),typeof s.callback<"u"&&(a.readCallback=s.callback),typeof s.enabled<"u"&&(a.enabled=s.enabled),this.sendResourceListChanged()}};return this._registeredResources[i]=a,a}_createRegisteredResourceTemplate(t,n,i,r,o){let a={resourceTemplate:i,title:n,metadata:r,readCallback:o,enabled:!0,disable:()=>a.update({enabled:!1}),enable:()=>a.update({enabled:!0}),remove:()=>a.update({name:null}),update:l=>{typeof l.name<"u"&&l.name!==t&&(delete this._registeredResourceTemplates[t],l.name&&(this._registeredResourceTemplates[l.name]=a)),typeof l.title<"u"&&(a.title=l.title),typeof l.template<"u"&&(a.resourceTemplate=l.template),typeof l.metadata<"u"&&(a.metadata=l.metadata),typeof l.callback<"u"&&(a.readCallback=l.callback),typeof l.enabled<"u"&&(a.enabled=l.enabled),this.sendResourceListChanged()}};this._registeredResourceTemplates[t]=a;let s=i.uriTemplate.variableNames;return Array.isArray(s)&&s.some(l=>!!i.completeCallback(l))&&this.setCompletionRequestHandler(),a}_createRegisteredPrompt(t,n,i,r,o){let a={title:n,description:i,argsSchema:r===void 0?void 0:fo(r),callback:o,enabled:!0,disable:()=>a.update({enabled:!1}),enable:()=>a.update({enabled:!0}),remove:()=>a.update({name:null}),update:s=>{typeof s.name<"u"&&s.name!==t&&(delete this._registeredPrompts[t],s.name&&(this._registeredPrompts[s.name]=a)),typeof s.title<"u"&&(a.title=s.title),typeof s.description<"u"&&(a.description=s.description),typeof s.argsSchema<"u"&&(a.argsSchema=fo(s.argsSchema)),typeof s.callback<"u"&&(a.callback=s.callback),typeof s.enabled<"u"&&(a.enabled=s.enabled),this.sendPromptListChanged()}};return this._registeredPrompts[t]=a,r&&Object.values(r).some(c=>{let l=c instanceof lo?c._def?.innerType:c;return $w(l)})&&this.setCompletionRequestHandler(),a}_createRegisteredTool(t,n,i,r,o,a,s,c,l){ww(t);let u={title:n,description:i,inputSchema:bO(r),outputSchema:bO(o),annotations:a,execution:s,_meta:c,handler:l,enabled:!0,disable:()=>u.update({enabled:!1}),enable:()=>u.update({enabled:!0}),remove:()=>u.update({name:null}),update:p=>{typeof p.name<"u"&&p.name!==t&&(typeof p.name=="string"&&ww(p.name),delete this._registeredTools[t],p.name&&(this._registeredTools[p.name]=u)),typeof p.title<"u"&&(u.title=p.title),typeof p.description<"u"&&(u.description=p.description),typeof p.paramsSchema<"u"&&(u.inputSchema=fo(p.paramsSchema)),typeof p.outputSchema<"u"&&(u.outputSchema=fo(p.outputSchema)),typeof p.callback<"u"&&(u.handler=p.callback),typeof p.annotations<"u"&&(u.annotations=p.annotations),typeof p._meta<"u"&&(u._meta=p._meta),typeof p.enabled<"u"&&(u.enabled=p.enabled),this.sendToolListChanged()}};return this._registeredTools[t]=u,this.setToolRequestHandlers(),this.sendToolListChanged(),u}tool(t,...n){if(this._registeredTools[t])throw new Error(`Tool ${t} is already registered`);let i,r,o,a;if(typeof n[0]=="string"&&(i=n.shift()),n.length>1){let c=n[0];if(kw(c))r=n.shift(),n.length>1&&typeof n[0]=="object"&&n[0]!==null&&!kw(n[0])&&(a=n.shift());else if(typeof c=="object"&&c!==null){if(Object.values(c).some(l=>typeof l=="object"&&l!==null))throw new Error(`Tool ${t} expected a Zod schema or ToolAnnotations, but received an unrecognized object`);a=n.shift()}}let s=n[0];return this._createRegisteredTool(t,void 0,i,r,o,a,{taskSupport:"forbidden"},void 0,s)}registerTool(t,n,i){if(this._registeredTools[t])throw new Error(`Tool ${t} is already registered`);let{title:r,description:o,inputSchema:a,outputSchema:s,annotations:c,_meta:l}=n;return this._createRegisteredTool(t,r,o,a,s,c,{taskSupport:"forbidden"},l,i)}prompt(t,...n){if(this._registeredPrompts[t])throw new Error(`Prompt ${t} is already registered`);let i;typeof n[0]=="string"&&(i=n.shift());let r;n.length>1&&(r=n.shift());let o=n[0],a=this._createRegisteredPrompt(t,void 0,i,r,o);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),a}registerPrompt(t,n,i){if(this._registeredPrompts[t])throw new Error(`Prompt ${t} is already registered`);let{title:r,description:o,argsSchema:a}=n,s=this._createRegisteredPrompt(t,r,o,a,i);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),s}isConnected(){return this.server.transport!==void 0}async sendLoggingMessage(t,n){return this.server.sendLoggingMessage(t,n)}sendResourceListChanged(){this.isConnected()&&this.server.sendResourceListChanged()}sendToolListChanged(){this.isConnected()&&this.server.sendToolListChanged()}sendPromptListChanged(){this.isConnected()&&this.server.sendPromptListChanged()}},Qf=class{constructor(t,n){this._callbacks=n,this._uriTemplate=typeof t=="string"?new Wf(t):t}get uriTemplate(){return this._uriTemplate}get listCallback(){return this._callbacks.list}completeCallback(t){return this._callbacks.complete?.[t]}},WF={type:"object",properties:{}};function wO(e){return e!==null&&typeof e=="object"&&"parse"in e&&typeof e.parse=="function"&&"safeParse"in e&&typeof e.safeParse=="function"}function kO(e){return"_def"in e||"_zod"in e||wO(e)}function kw(e){return typeof e!="object"||e===null||kO(e)?!1:Object.keys(e).length===0?!0:Object.values(e).some(wO)}function bO(e){if(e){if(kw(e))return fo(e);if(!kO(e))throw new Error("inputSchema must be a Zod schema or raw shape, received an unrecognized object");return e}}function XF(e){let t=wi(e);return t?Object.entries(t).map(([n,i])=>{let r=hT(i),o=gT(i);return{name:n,description:r,required:!o}}):[]}function Ri(e){let n=wi(e)?.method;if(!n)throw new Error("Schema is missing a method literal");let i=Ga(n);if(typeof i=="string")return i;throw new Error("Schema method literal must be a string")}function $O(e){return{completion:{values:e.slice(0,100),total:e.length,hasMore:e.length>100}}}var Yl={completion:{values:[],hasMore:!1}};var xO="x-hono-already-sent";var sh=require("node:http"),Jr=require("node:http2"),Iw=require("node:stream");var SO=e=>((...t)=>{if(typeof t[0]=="function"){let[n,i]=t;return async function(o,a){let s=await e(o,await n(o),i);if(s)return s;await a()}}else{let[n,i,r]=t;return(async()=>{let o=await e(n,i,r);if(!o)throw new Error("Failed to upgrade WebSocket");return o})()}});var pn=class extends Error{constructor(e,t){super(e,t),this.name="RequestError"}},YF=new Set(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","server","user-agent"]),QF=/^[!#$%&'*+\-.^_`|~\dA-Za-z]+$/,eh=e=>e===9||e===10||e===13||e===32,IO=e=>{if(!eh(e.charCodeAt(0))&&!eh(e.charCodeAt(e.length-1)))return e;let t=0,n=e.length;for(;t<n&&eh(e.charCodeAt(t));)t++;for(;n>t&&eh(e.charCodeAt(n-1));)n--;return e.slice(t,n)},TO=/[\0\r\n]/,Dw=globalThis.Headers,DO=(e,t=Dw)=>{let n=new t;for(let i=0;i<e.length;i+=2){let r=e[i];r.startsWith(":")||n.append(r,e[i+1])}return n},Cw=class{#e;#t;#n;#i;constructor(e){this.#e=e,e instanceof Jr.Http2ServerRequest&&(this.#t=e.rawHeaders.slice())}get#o(){return this.#t??=this.#e.rawHeaders.slice()}get#r(){return this.#n||(this.#n=DO(this.#o),this.#t=void 0),this.#n}#a(e){if(typeof e=="string"){if(!QF.test(e))throw new TypeError(`Invalid header name: ${e}`);return e.toLowerCase()}}#s(e){let t=this.#e instanceof Jr.Http2ServerRequest?void 0:this.#e.headers;if(!t||YF.has(e)||e==="set-cookie"||e==="__proto__")return;if(!Object.hasOwn(t,e))return null;let n=t[e];if(typeof n=="string"){let i=IO(n);return TO.test(i)?void 0:i}}#c(e,t){let n=t==="cookie"?"; ":", ",i=null;for(let r=0;r<e.length;r+=2){let o=e[r];if(o.length===t.length&&o.toLowerCase()===t){let a=IO(e[r+1]);if(TO.test(a)){this.#i=!0;return}i=i===null?a:i+n+a}}return i}append(e,t){this.#r.append(e,t)}delete(e){this.#r.delete(e)}get(e){let t=this.#a(e);if(t&&!this.#n&&!this.#i){let n=this.#s(t);if(n!==void 0)return n;let i=this.#c(this.#o,t);if(i!==void 0)return i}return this.#r.get(e)}has(e){let t=this.#a(e);if(t&&!this.#n&&!this.#i){let n=this.#s(t);if(n!==void 0)return n!==null;let i=this.#c(this.#o,t);if(i!==void 0)return i!==null}return this.#r.has(e)}set(e,t){this.#r.set(e,t)}getSetCookie(){return this.#r.getSetCookie()}keys(){return this.#r.keys()}values(){return this.#r.values()}entries(){return this.#r.entries()}forEach(e,t){this.#r.forEach((n,i)=>{e.call(t,n,i,this)})}[Symbol.iterator](){return this.entries()}};Object.defineProperty(Cw.prototype,Symbol.for("nodejs.util.inspect.custom"),{value:function(e,t,n){return`Headers (lightweight) ${n(Object.fromEntries(this),{...t,depth:e==null?null:e-1})}`}});Object.setPrototypeOf(Cw.prototype,Dw.prototype);var CO=e=>globalThis.Headers===Dw?new Cw(e):DO(e.rawHeaders,globalThis.Headers),eV=/^\/[!#$&-;=?-\[\]_a-z~]*$/,tV=/\/\.\.?(?:[/?#]|$)/,rV=/^[a-z0-9._-]+(?::(?:[1-5]\d{3,4}|[6-9]\d{3}))?$/,Tw=e=>{let t=e.indexOf("\\");if(t!==-1){let n=e.indexOf("?");if(n===-1||t<n)throw new pn("Backslash in request path")}},nV=(e,t,n)=>{let i=`${e}://${t}${n}`;if(rV.test(t)){if(n.length===0)return i+"/";if(n.charCodeAt(0)!==47)throw new pn("Invalid URL");return!eV.test(n)||tV.test(n)?(Tw(n),new URL(i).href):i}else{Tw(n);let r=new URL(i);if(r.hostname.length!==t.length&&r.hostname!==(t.includes(":")?t.replace(/:\d+$/,""):t).toLowerCase())throw new pn("Invalid host header");return r.href}},iV=e=>e instanceof pn?e:new pn(e.message,{cause:e}),oV=globalThis.Request,bs=class extends oV{constructor(e,t){if(typeof e=="object"&&Ci in e){let n=t!==void 0&&"body"in t&&t.body!=null;if(e[Kn]&&!n)throw new TypeError("Cannot construct a Request with a Request object that has already been used.");e=e[Ci]()}typeof t?.body?.getReader<"u"&&(t.duplex??="half"),super(e,t)}},AO=Symbol("wrapBodyStream"),aV=new Set(["latin1","binary","hex","base64","base64url"]),sV=e=>e===null||aV.has(e),xw=Symbol("bodyBufferedBeforeDisconnect"),zw=Symbol("bodyBufferedLengthBeforeDisconnect"),NO=(e,t)=>Buffer.isBuffer(e)?e:Buffer.from(e,t??"utf8"),Aw=e=>!(e instanceof Jr.Http2ServerRequest)&&!!e.complete&&!!e.readableAborted&&typeof e.read=="function"&&sV(e.readableEncoding),zO=e=>{if(e.readableDidRead||!Aw(e))return;let t=e;t[zw]??=e.readableLength},rh=(e,t)=>{if(e.readableDidRead&&!t||!Aw(e))return;let n=e;if(n[xw]!==void 0)return n[xw];let i,r=e.errored;if(r&&r.code!=="ECONNRESET")i=r;else if(n[zw]!==void 0&&e.readableLength!==n[zw])i=nh();else{let o=t??[],a=e.read();a!==null&&o.push(NO(a,e.readableEncoding));let s=o.length===1?o[0]:Buffer.concat(o);i=s;let c=e.headers["content-length"];if(typeof c=="string"&&/^\d+$/.test(c)){let l=Number(c);Number.isSafeInteger(l)&&s.length!==l&&(i=nh())}}return n[xw]=i,i},PO=(e,t)=>{if(t instanceof Error){e.error(t);return}t.length>0&&e.enqueue(t),e.close()},cV=(e,t,n,i,r)=>{let o={method:e,headers:n,signal:r.signal};if(e==="TRACE"){o.method="GET";let a=new bs(t,o);return Object.defineProperty(a,"method",{get(){return"TRACE"}}),a}if(!(e==="GET"||e==="HEAD"))if("rawBody"in i&&i.rawBody instanceof Buffer)o.body=new ReadableStream({start(a){a.enqueue(i.rawBody),a.close()}});else if(i[AO]){let a;o.body=new ReadableStream({async pull(s){try{if(!a){let u=rh(i);if(u!==void 0){PO(s,u);return}}a||=Iw.Readable.toWeb(i).getReader();let{done:c,value:l}=await a.read();c?s.close():s.enqueue(l)}catch(c){s.error(c)}}})}else{let a=rh(i);a!==void 0?o.body=new ReadableStream({start(s){PO(s,a)}}):o.body=Iw.Readable.toWeb(i)}return new bs(t,o)},Ci=Symbol("getRequestCache"),Jn=Symbol("requestCache"),$s=Symbol("incomingKey"),tu=Symbol("urlKey"),MO=Symbol("methodKey"),LO=Symbol("headersKey"),Ql=Symbol("abortControllerKey"),Pw=Symbol("getAbortController"),Ew=Symbol("abortRequest"),Di=Symbol("bodyBuffer"),th=Symbol("bodyReadPromise"),Kn=Symbol("bodyConsumedDirectly"),EO=Symbol("bodyLockReader"),eu=Symbol("abortReason"),nh=()=>new TypeError("Body is unusable"),ru=()=>Promise.reject(nh()),lV=new TextDecoder,uV=e=>{if(e[Kn])return ru();e[Kn]=!0},dV=e=>e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength),pV=e=>(e[LO]||=CO(e[$s])).get("content-type")||"",mV=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,fV=e=>{if(typeof e!="string"||e.length===0)return"GET";switch(e){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"PATCH":case"POST":case"PUT":case"QUERY":return e}let t=e.toUpperCase();switch(t){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"POST":case"PUT":return t;default:return e}},hV=e=>{if(!mV.test(e))return new TypeError(`'${e}' is not a valid HTTP method.`);let t=e.toUpperCase();if(t==="CONNECT"||t==="TRACK"||t==="TRACE"&&e!=="TRACE")return new TypeError(`'${e}' HTTP method is unsupported.`)},Nw=(e,t,n)=>{if(e[Kn])return ru();let i=e.method;if(i==="GET"||i==="HEAD")return e[Ci]()[t]();let r=hV(i);if(r)return Promise.reject(r);if(e[Jn]&&i!=="TRACE")return e[Jn][t]();let o=uV(e);if(o)return o;let a=gV(e);if(a){let s=Promise.resolve(n(a,e));return e[Di]=void 0,s}return vV(e).then(s=>{let c=n(s,e);return e[Di]=void 0,c})},gV=e=>{let t=e[$s];if("rawBody"in t&&t.rawBody instanceof Buffer)return t.rawBody},OO=(e,t)=>{if(t.errored)return t.errored;let n=e[eu];return n!==void 0?n instanceof Error?n:new Error(String(n)):new Error("Client connection prematurely closed.")},vV=e=>{if(e[Di])return Promise.resolve(e[Di]);if(e[th])return e[th];let t=e[$s];if(t.readableDidRead)return ru();let n=rh(t);if(n!==void 0)return n instanceof Error?Promise.reject(n):(e[Di]=n,Promise.resolve(n));let i=new Promise((r,o)=>{let a=[],s=!1,c=k=>{s||(s=!0,_(),k())},l=k=>{let T=t.errored??k;return!Aw(t)||T&&T.code!=="ECONNRESET"?!1:(c(()=>{let z=rh(t,a);z instanceof Error?o(z):z===void 0?o(k??OO(e,t)):(e[Di]=z,r(z))}),!0)},u=k=>{a.push(NO(k,t.readableEncoding))},p=()=>{c(()=>{let k=a.length===1?a[0]:Buffer.concat(a);e[Di]=k,r(k)})},h=k=>{l(k)||c(()=>{o(k)})},g=()=>{if(t.readableEnded){p();return}l()||c(()=>{o(OO(e,t))})},_=()=>{t.off("data",u),t.off("end",p),t.off("error",h),t.off("close",g),e[th]=void 0};t.on("data",u),t.on("end",p),t.on("error",h),t.on("close",g),queueMicrotask(()=>{s||(t.readableEnded?p():t.errored?h(t.errored):t.destroyed&&g())})});return e[th]=i,i},Pn={get method(){return this[MO]},get url(){return this[tu]},get headers(){return this[LO]||=CO(this[$s])},[Ew](e){this[eu]===void 0&&(this[eu]=e);let t=this[Ql];t&&!t.signal.aborted&&t.abort(e)},[Pw](){return this[Ql]||=new AbortController,this[eu]!==void 0&&!this[Ql].signal.aborted&&this[Ql].abort(this[eu]),this[Ql]},[Ci](){let e=this[Pw]();if(this[Jn])return this[Jn];let t=this.method;if(this[Kn]&&!(t==="GET"||t==="HEAD")){this[Di]=void 0;let n={method:t==="TRACE"?"GET":t,headers:this.headers,signal:e.signal};t!=="TRACE"&&(n.body=new ReadableStream({start(r){r.close()}}),n.duplex="half");let i=new bs(this[tu],n);return t==="TRACE"&&Object.defineProperty(i,"method",{get(){return"TRACE"}}),this[Jn]=i}return this[Jn]=cV(this.method,this[tu],this.headers,this[$s],e)},get body(){if(!this[Kn])return this[Ci]().body;let e=this[Ci]();return!this[EO]&&e.body&&(this[EO]=e.body.getReader()),e.body},get bodyUsed(){return this[Kn]?!0:this[Jn]?this[Jn].bodyUsed:!1}};Object.defineProperty(Pn,"signal",{get(){return this[Pw]().signal}});["cache","credentials","destination","duplex","integrity","mode","redirect","referrer","referrerPolicy","keepalive"].forEach(e=>{Object.defineProperty(Pn,e,{get(){return this[Ci]()[e]}})});["clone","formData"].forEach(e=>{Object.defineProperty(Pn,e,{value:function(){if(this[Kn]){if(e==="clone")throw nh();return ru()}return this[Ci]()[e]()}})});Object.defineProperty(Pn,"text",{value:function(){return Nw(this,"text",e=>lV.decode(e))}});Object.defineProperty(Pn,"arrayBuffer",{value:function(){return Nw(this,"arrayBuffer",e=>dV(e))}});Object.defineProperty(Pn,"blob",{value:function(){return Nw(this,"blob",(e,t)=>{let n=pV(t),i=n?{headers:{"content-type":n}}:void 0;return new Response(e,i).blob()})}});Object.defineProperty(Pn,"json",{value:function(){return this[Kn]?ru():this.text().then(JSON.parse)}});Object.defineProperty(Pn,Symbol.for("nodejs.util.inspect.custom"),{value:function(e,t,n){return`Request (lightweight) ${n({method:this.method,url:this.url,headers:this.headers,nativeRequest:this[Jn]},{...t,depth:e==null?null:e-1})}`}});Object.setPrototypeOf(Pn,bs.prototype);var yV=(e,t)=>{let n=Object.create(Pn);n[$s]=e,n[MO]=fV(e.method);let i=e.url||"";if(i[0]!=="/"&&(i.startsWith("http://")||i.startsWith("https://"))){if(e instanceof Jr.Http2ServerRequest)throw new pn("Absolute URL for :path is not allowed in HTTP/2");try{Tw(i),n[tu]=new URL(i).href}catch(a){throw new pn("Invalid absolute URL",{cause:a})}return n}let r=(e instanceof Jr.Http2ServerRequest?e.authority:e.headers.host)||t;if(!r)throw new pn("Missing host header");let o;if(e instanceof Jr.Http2ServerRequest){if(o=e.scheme,!(o==="http"||o==="https"))throw new pn("Unsupported scheme")}else o=e.socket&&e.socket.encrypted?"https":"http";try{n[tu]=nV(o,r,i)}catch(a){throw a instanceof pn?a:new pn("Invalid URL",{cause:a})}return n},To="text/plain; charset=UTF-8",Ow=Symbol("responseCache"),_s=Symbol("getResponseCache"),Gn=Symbol("cache"),ih=globalThis.Response,zn=class UO{#e;#t;[_s](){let t=this[Gn],n=t&&t[2]instanceof Headers?t[2]:void 0;return delete this[Gn],this[Ow]||=new ih(this.#e,n?{status:this.#t?.status,statusText:this.#t?.statusText,headers:n}:this.#t)}constructor(t,n){let i;if(this.#e=t,n instanceof ih){let r=n[Ow];if(r){this.#t=r,this[_s]();return}this.#t=n instanceof UO?n.#t:n,i=new Headers(n.headers)}else this.#t=n;(t==null||typeof t=="string"||typeof t?.getReader<"u"||t instanceof Blob||t instanceof Uint8Array)&&(this[Gn]=[n?.status||200,t??null,i||n?.headers])}get headers(){let t=this[Gn];return t?(t[2]instanceof Headers||(t[2]=new Headers(t[2]||(t[1]===null?void 0:{"content-type":To}))),t[2]):this[_s]().headers}get status(){return this[Gn]?.[0]??this[_s]().status}get ok(){let t=this.status;return t>=200&&t<300}};["body","bodyUsed","redirected","statusText","trailers","type","url"].forEach(e=>{Object.defineProperty(zn.prototype,e,{get(){return this[_s]()[e]}})});["arrayBuffer","blob","clone","formData","json","text"].forEach(e=>{Object.defineProperty(zn.prototype,e,{value:function(){return this[_s]()[e]()}})});Object.defineProperty(zn.prototype,Symbol.for("nodejs.util.inspect.custom"),{value:function(e,t,n){return`Response (lightweight) ${n({status:this.status,headers:this.headers,ok:this.ok,nativeResponse:this[Ow]},{...t,depth:e==null?null:e-1})}`}});Object.setPrototypeOf(zn,ih);Object.setPrototypeOf(zn.prototype,ih.prototype);var _V=/^https?:\/\/[!#-;=?-[\]_a-z~A-Z]+$/,bV=e=>e instanceof URL?e.href:_V.test(e)?e:new URL(e).href,$V=new Set([301,302,303,307,308]);Object.defineProperty(zn,"redirect",{value:function(t,n=302){if(!$V.has(n))throw new RangeError("Invalid status code");return new zn(null,{status:n,headers:{location:bV(t)}})},writable:!0,configurable:!0});Object.defineProperty(zn,"json",{value:function(t,n){let i=JSON.stringify(t);if(i===void 0)throw new TypeError("The data is not JSON serializable");let r=n?.headers,o;return r?(o=new Headers(r),o.has("content-type")||o.set("content-type","application/json")):o={"content-type":"application/json"},new zn(i,{status:n?.status??200,statusText:n?.statusText,headers:o})},writable:!0,configurable:!0});async function wV(e){return Promise.race([e,Promise.resolve().then(()=>Promise.resolve(void 0))])}function ZO(e,t,n){let i=c=>{e.cancel(c).catch(()=>{})},r=t.stream;if(t.destroyed||r?.closed||r?.destroyed)return i(),e.closed;return t.on("close",i),t.on("error",i),(n??e.read()).then(s,o),e.closed.finally(()=>{t.off("close",i),t.off("error",i)});function o(c){c&&t.destroy(c)}function a(){e.read().then(s,o)}function s({done:c,value:l}){try{c?t.end():t.write(l)?e.read().then(s,o):t.once("drain",a)}catch(u){o(u)}}}function jO(e,t){if(e.locked)throw new TypeError("ReadableStream is locked.");if(t.destroyed){e.cancel().catch(()=>{});return}return ZO(e.getReader(),t)}var jw=(e,t)=>{let n={};if(e instanceof Headers||(e=new Headers(e??void 0)),e.has("set-cookie")){let i=[];for(let[r,o]of e)r==="set-cookie"?i.push(o):n[r]=o;i.length>0&&(n["set-cookie"]=i)}else for(let[i,r]of e)n[i]=r;return t&&(n["content-type"]??=t),n},oh=Symbol("outgoingEnded"),RO=Symbol("incomingDraining"),kV=500,xV=64*1024*1024,FO=e=>{let t=e;if(e.destroyed||t[RO])return;if(t[RO]=!0,e instanceof Jr.Http2ServerRequest){try{e.stream?.close?.(Jr.constants.NGHTTP2_NO_ERROR)}catch{}return}let n=0,i=()=>{clearTimeout(o),e.off("data",a),e.off("end",i),e.off("error",i)},r=()=>{i();let s=e.socket;s&&!s.destroyed&&(typeof s.destroySoon=="function"?s.destroySoon():typeof s.destroy=="function"&&s.destroy())},o=setTimeout(r,kV);o.unref?.();let a=s=>{n+=s.length,n>xV&&r()};e.on("data",a),e.on("end",i),e.on("error",i),e.resume()},SV=(e,t,n,i)=>()=>{t.errored?(zO(t),e[Ew](t.errored.toString())):(!n.writableFinished||t instanceof Jr.Http2ServerRequest&&t.aborted)&&(zO(t),e[Ew]("Client connection prematurely closed.")),i&&!t.readableEnded&&setTimeout(()=>{t.readableEnded||setTimeout(()=>{FO(t)})})},IV=e=>{if(!(Gn in e))return!1;let t=e[Gn][1];return t===null||typeof t=="string"||t instanceof Uint8Array},TV=()=>new Response(null,{status:400}),VO=e=>new Response(null,{status:e instanceof Error&&(e.name==="TimeoutError"||e.constructor.name==="TimeoutError")?504:500}),ah=(e,t)=>{let n=e instanceof Error?e:new Error("unknown error",{cause:e});n.code==="ERR_STREAM_PREMATURE_CLOSE"?console.info("The user aborted a request."):(console.error(e),t.headersSent||(t instanceof sh.ServerResponse&&(t._contentLength=null),t.writeHead(500,{"Content-Type":"text/plain"})),t.end(`Error: ${n.message}`),t.destroy(n))},Rw=e=>{"flushHeaders"in e&&e.writable&&e.flushHeaders()},qO=(e,t,n)=>{let i=e;return i._contentLength===null&&i._hasBody&&i.useChunkedEncodingByDefault&&!i._removedContLen&&t>=200&&t!==204&&t!==304&&!e.hasHeader("content-length")&&!e.hasHeader("transfer-encoding")&&!e.hasHeader("trailer")?(i._contentLength=n,!0):!1},Sw=(e,t,n)=>{qO(e,t,n)?e.writeHead(t,{"Content-Type":To}):e.writeHead(t,{"Content-Type":To,"Content-Length":n})},BO=async(e,t)=>{let[n,i,r]=e[Gn];if(!r){i===null?(t.writeHead(n),t.end()):typeof i=="string"?(Sw(t,n,Buffer.byteLength(i)),t.end(i)):i instanceof Uint8Array?(Sw(t,n,i.byteLength),t.end(i)):i instanceof Blob?(Sw(t,n,i.size),t.end(new Uint8Array(await i.arrayBuffer()))):(t.writeHead(n,{"Content-Type":To}),Rw(t),await jO(i,t)?.catch(c=>ah(c,t))),t[oh]?.();return}let o=!1,a=!1,s=!0;if(r instanceof Headers)o=r.has("content-length"),r=jw(r,i===null?void 0:To);else if(Array.isArray(r)){let c=new Headers(r);o=c.has("content-length"),r=jw(c,i===null?void 0:To)}else{a=!0;for(let c in r){if(c.length===14&&c.toLowerCase()==="content-length"){o=!0;break}(c.length===17&&c.toLowerCase()==="transfer-encoding"||c.length===7&&c.toLowerCase()==="trailer")&&(s=!1)}}if(!o){let c;typeof i=="string"?c=Buffer.byteLength(i):i instanceof Uint8Array?c=i.byteLength:i instanceof Blob&&(c=i.size),c!==void 0&&(!a||!s||!qO(t,n,c))&&(a&&(r={...r}),r["Content-Length"]=c)}t.writeHead(n,r),i==null?t.end():typeof i=="string"||i instanceof Uint8Array?t.end(i):i instanceof Blob?t.end(new Uint8Array(await i.arrayBuffer())):(Rw(t),await jO(i,t)?.catch(c=>ah(c,t))),t[oh]?.()},HO=e=>typeof e.then=="function",zV=async(e,t,n={})=>{if(HO(e))if(n.errorHandler)try{e=await e}catch(r){let o=await n.errorHandler(r);if(!o)return;e=o}else e=await e.catch(VO);if(Gn in e)return BO(e,t);let i=jw(e.headers,e.body===null?void 0:To);if(e.body){let r=e.body.getReader(),o=[],a=!1,s;if(i["transfer-encoding"]!=="chunked"){let c=2;for(let l=0;l<c;l++){s||=r.read();let u=await wV(s);if(!u){if(l===1){await new Promise(p=>setTimeout(p)),c=3;continue}break}if(s=void 0,u.value&&o.push(u.value),u.done){a=!0;break}}a&&!("content-length"in i)&&(i["content-length"]=o.reduce((l,u)=>l+u.length,0))}t.writeHead(e.status,i),o.forEach(c=>{t.write(c)}),a?t.end():(o.length===0&&Rw(t),await ZO(r,t,s))}else i[xO]||(t.writeHead(e.status,i),t.end());t[oh]?.()},Mw=(e,t={})=>{let n=t.autoCleanupIncoming??!0;return t.overrideGlobalObjects!==!1&&globalThis.Request!==bs&&(Object.defineProperty(globalThis,"Request",{value:bs}),Object.defineProperty(globalThis,"Response",{value:zn})),async(i,r)=>{let o,a,s=!1,c=!1,l=()=>{!a||c||(c=!0,r.on("close",SV(a,i,r,s)))};try{if(a=yV(i,t.hostname),s=n&&!(i.method==="GET"||i.method==="HEAD"),s&&(i[AO]=!0,i instanceof Jr.Http2ServerRequest&&(r[oh]=()=>{i.readableEnded||setTimeout(()=>{i.readableEnded||setTimeout(()=>{i.destroy(),r.destroy()})})})),o=e(a,{incoming:i,outgoing:r}),!HO(o)&&IV(o))return s&&!i.readableEnded&&r.once("finish",()=>{i.readableEnded||FO(i)}),BO(o,r);l()}catch(u){if(o)return ah(u,r);if(t.errorHandler){if(l(),o=await t.errorHandler(a?u:iV(u)),!o)return}else a?o=VO(u):o=TV()}try{return await zV(o,r,t)}catch(u){return ah(u,r)}}},PV=globalThis.CloseEvent??class extends Event{#e;constructor(e,t={}){super(e,t),this.#e=t}get wasClean(){return this.#e.wasClean??!1}get code(){return this.#e.code??0}get reason(){return this.#e.reason??""}},EV=globalThis.ErrorEvent??class extends Event{#e;constructor(e,t={}){super(e,t),this.#e=t}get message(){return this.#e.message??""}get filename(){return this.#e.filename??""}get lineno(){return this.#e.lineno??0}get colno(){return this.#e.colno??0}get error(){return this.#e.error??null}},OV=()=>Symbol("connection"),jV=Symbol("CONNECTION_SYMBOL_KEY"),RV=Symbol("WAIT_FOR_WEBSOCKET_SYMBOL");var U7=SO(async(e,t,n)=>{if(e.req.header("upgrade")?.toLowerCase()!=="websocket")return;let i=e.env,r=i[RV];if(!r||!i.incoming)return new Response(null,{status:500});let o=OV();return i[jV]=o,(async()=>{let a;try{a=await r(i.incoming,o)}catch{return}let s=[],c=(p,h)=>{s.push([p,h])};a.on("message",c);let l={binaryType:"arraybuffer",close(p,h){a.close(p,h)},protocol:a.protocol,raw:a,get readyState(){return a.readyState},send(p,h){a.send(p,{compress:h?.compress})},url:new URL(e.req.url)};try{t?.onOpen?.(new Event("open"),l)}catch(p){(n?.onError??console.error)(p)}let u=(p,h)=>{let g=Array.isArray(p)?p:[p];for(let _ of g)try{t?.onMessage?.(new MessageEvent("message",{data:h?_ instanceof ArrayBuffer?_:_.buffer.slice(_.byteOffset,_.byteOffset+_.byteLength):typeof _=="string"?_:Buffer.from(_).toString("utf-8")}),l)}catch(k){(n?.onError??console.error)(k)}};a.off("message",c);for(let p of s)u(...p);a.on("message",(p,h)=>{u(p,h)}),a.on("close",(p,h)=>{try{t?.onClose?.(new PV("close",{code:p,reason:h.toString()}),l)}catch(g){(n?.onError??console.error)(g)}}),a.on("error",p=>{try{t?.onError?.(new EV("error",{error:p}),l)}catch(h){(n?.onError??console.error)(h)}})})(),new Response});var XO=Sr(WO(),1);function FV(e){if(e)try{return XO.default.parse(e).type}catch{let t=(e.split(";",1)[0]??"").trim().toLowerCase();return t===""||e.slice(t.length).includes(",")?void 0:t}}function YO(e){return e==="application/json"?!0:FV(e)==="application/json"}function QO(e){return`Payload Too Large: Request body must not exceed ${e} bytes`}function e1(e){if(e===void 0)return 4194304;if(typeof e!="number"||!Number.isFinite(e)||e<=0)throw new RangeError(`maxRequestBodySize must be a positive number of bytes, got ${String(e)}`);return e}async function t1(e,t=4194304){if(Number(e.headers.get("content-length"))>t)return{tooLarge:!0};if(e.body===null)return{tooLarge:!1,text:""};let n=e.body.getReader(),i=new TextDecoder,r=0,o="";try{for(;;){let{done:a,value:s}=await n.read();if(a)break;if(r+=s.byteLength,r>t)return{tooLarge:!0};o+=i.decode(s,{stream:!0})}}finally{n.releaseLock()}return{tooLarge:!1,text:o+i.decode()}}function r1(e,t){if(!Number.isFinite(e)||e<1)return;let n=setInterval(t,Math.min(e,2147483647));return n.unref?.(),n}var ch=class{constructor(t={}){this._started=!1,this._hasHandledRequest=!1,this._streamMapping=new Map,this._requestToStreamMapping=new Map,this._resumableStreams=new Set,this._requestResponseMap=new Map,this._initialized=!1,this._enableJsonResponse=!1,this._standaloneSseStreamId="_GET_stream",this._closed=!1,this.sessionIdGenerator=t.sessionIdGenerator,this._enableJsonResponse=t.enableJsonResponse??!1,this._eventStore=t.eventStore,this._onsessioninitialized=t.onsessioninitialized,this._onsessionclosed=t.onsessionclosed,this._allowedHosts=t.allowedHosts,this._allowedOrigins=t.allowedOrigins,this._enableDnsRebindingProtection=t.enableDnsRebindingProtection??!1,this._retryInterval=t.retryInterval,this._keepAliveMs=t.keepAliveMs??15e3,this._maxRequestBodySize=e1(t.maxRequestBodySize)}startKeepAlive(t,n){if(this._closed)return;let i=r1(this._keepAliveMs,()=>{try{t.enqueue(n.encode(`: keepalive
|
|
97
|
+
|
|
98
|
+
`))}catch{i!==void 0&&clearInterval(i)}});return i}async start(){if(this._started)throw new Error("Transport already started");this._started=!0}createJsonErrorResponse(t,n,i,r){let o={code:n,message:i};return r?.data!==void 0&&(o.data=r.data),new Response(JSON.stringify({jsonrpc:"2.0",error:o,id:null}),{status:t,headers:{"Content-Type":"application/json",...r?.headers}})}validateRequestHeaders(t){if(this._enableDnsRebindingProtection){if(this._allowedHosts&&this._allowedHosts.length>0){let n=t.headers.get("host");if(!n||!this._allowedHosts.includes(n)){let i=`Invalid Host header: ${n}`;return this.onerror?.(new Error(i)),this.createJsonErrorResponse(403,-32e3,i)}}if(this._allowedOrigins&&this._allowedOrigins.length>0){let n=t.headers.get("origin");if(n&&!this._allowedOrigins.includes(n)){let i=`Invalid Origin header: ${n}`;return this.onerror?.(new Error(i)),this.createJsonErrorResponse(403,-32e3,i)}}}}async handleRequest(t,n){if(this._closed)return this.createJsonErrorResponse(404,-32001,"Session not found");if(!this.sessionIdGenerator&&this._hasHandledRequest)throw new Error("Stateless transport cannot be reused across requests. Create a new transport per request.");this._hasHandledRequest=!0;let i=this.validateRequestHeaders(t);if(i)return i;switch(t.method){case"POST":return this.handlePostRequest(t,n);case"GET":return this.handleGetRequest(t);case"DELETE":return this.handleDeleteRequest(t);default:return this.handleUnsupportedRequest()}}async writePrimingEvent(t,n,i,r){if(!this._eventStore||r<"2025-11-25")return;let o=await this._eventStore.storeEvent(i,{}),a=`id: ${o}
|
|
99
|
+
data:
|
|
100
|
+
|
|
101
|
+
`;this._retryInterval!==void 0&&(a=`id: ${o}
|
|
102
|
+
retry: ${this._retryInterval}
|
|
103
|
+
data:
|
|
104
|
+
|
|
105
|
+
`),t.enqueue(n.encode(a)),this._resumableStreams.add(i)}async handleGetRequest(t){if(!t.headers.get("accept")?.includes("text/event-stream"))return this.onerror?.(new Error("Not Acceptable: Client must accept text/event-stream")),this.createJsonErrorResponse(406,-32e3,"Not Acceptable: Client must accept text/event-stream");let i=this.validateSession(t);if(i)return i;let r=this.validateProtocolVersion(t);if(r)return r;if(this._eventStore){let u=t.headers.get("last-event-id");if(u)return this.replayEvents(u)}if(this._streamMapping.get(this._standaloneSseStreamId)!==void 0)return this.onerror?.(new Error("Conflict: Only one SSE stream is allowed per session")),this.createJsonErrorResponse(409,-32e3,"Conflict: Only one SSE stream is allowed per session");let o=new TextEncoder,a,s,c=new ReadableStream({start:u=>{a=u},cancel:()=>{s!==void 0&&clearInterval(s),this._streamMapping.get(this._standaloneSseStreamId)?.controller===a&&this._streamMapping.delete(this._standaloneSseStreamId)}}),l={"Content-Type":"text/event-stream","Cache-Control":"no-cache, no-transform",Connection:"keep-alive","X-Accel-Buffering":"no"};return this.sessionId!==void 0&&(l["mcp-session-id"]=this.sessionId),this._streamMapping.set(this._standaloneSseStreamId,{controller:a,encoder:o,cleanup:()=>{s!==void 0&&clearInterval(s),this._streamMapping.delete(this._standaloneSseStreamId);try{a.close()}catch{}}}),s=this.startKeepAlive(a,o),new Response(c,{headers:l})}async replayEvents(t){if(!this._eventStore)return this.onerror?.(new Error("Event store not configured")),this.createJsonErrorResponse(400,-32e3,"Event store not configured");try{let n;if(this._eventStore.getStreamIdForEventId){if(n=await this._eventStore.getStreamIdForEventId(t),!n)return this.onerror?.(new Error("Invalid event ID format")),this.createJsonErrorResponse(400,-32e3,"Invalid event ID format");if(this._streamMapping.get(n)!==void 0)return this.onerror?.(new Error("Conflict: Stream already has an active connection")),this.createJsonErrorResponse(409,-32e3,"Conflict: Stream already has an active connection")}let i={"Content-Type":"text/event-stream","Cache-Control":"no-cache, no-transform",Connection:"keep-alive","X-Accel-Buffering":"no"};this.sessionId!==void 0&&(i["mcp-session-id"]=this.sessionId);let r=new TextEncoder,o,a,s,c=!1,l=new ReadableStream({start:p=>{o=p},cancel:()=>{c=!0,a!==void 0&&clearInterval(a),s!==void 0&&this._streamMapping.get(s)?.controller===o&&this._streamMapping.delete(s)}}),u=new Set;if(s=await this._eventStore.replayEventsAfter(t,{send:async(p,h)=>{if(this.writeSSEEvent(o,r,h,p))u.add(p);else{this.onerror?.(new Error("Failed replay events"));try{o.close()}catch{}}}}),this._closed||c){try{o.close()}catch{}return this.createJsonErrorResponse(404,-32001,"Session not found")}return this._streamMapping.get(s)?.cleanup(),this._streamMapping.set(s,{controller:o,encoder:r,replayedEventIds:u,cleanup:()=>{a!==void 0&&clearInterval(a),this._streamMapping.delete(s);try{o.close()}catch{}}}),this._resumableStreams.add(s),a=this.startKeepAlive(o,r),new Response(l,{headers:i})}catch(n){return this.onerror?.(n),this.createJsonErrorResponse(500,-32e3,"Error replaying events")}}writeSSEEvent(t,n,i,r){try{let o=`event: message
|
|
106
|
+
`;return r&&(o+=`id: ${r}
|
|
107
|
+
`),o+=`data: ${JSON.stringify(i)}
|
|
108
|
+
|
|
109
|
+
`,t.enqueue(n.encode(o)),!0}catch(o){return this.onerror?.(o),!1}}handleUnsupportedRequest(){return this.onerror?.(new Error("Method not allowed.")),new Response(JSON.stringify({jsonrpc:"2.0",error:{code:-32e3,message:"Method not allowed."},id:null}),{status:405,headers:{Allow:"GET, POST, DELETE","Content-Type":"application/json"}})}async handlePostRequest(t,n){try{let i=t.headers.get("accept");if(!i?.includes("application/json")||!i.includes("text/event-stream"))return this.onerror?.(new Error("Not Acceptable: Client must accept both application/json and text/event-stream")),this.createJsonErrorResponse(406,-32e3,"Not Acceptable: Client must accept both application/json and text/event-stream");let r=t.headers.get("content-type");if(!YO(r))return this.onerror?.(new Error("Unsupported Media Type: Content-Type must be application/json")),this.createJsonErrorResponse(415,-32e3,"Unsupported Media Type: Content-Type must be application/json");let o={headers:Object.fromEntries(t.headers.entries()),url:new URL(t.url)},a;if(n?.parsedBody!==void 0)a=n.parsedBody;else try{let S=await t1(t,this._maxRequestBodySize);if(S.tooLarge){let A=QO(this._maxRequestBodySize);return this.onerror?.(new Error(A)),this.createJsonErrorResponse(413,-32e3,A)}a=JSON.parse(S.text)}catch{return this.onerror?.(new Error("Parse error: Invalid JSON")),this.createJsonErrorResponse(400,-32700,"Parse error: Invalid JSON")}if(Array.isArray(a)&&a.length>100)return this.onerror?.(new Error(`Invalid Request: Batch must not exceed ${100} messages`)),this.createJsonErrorResponse(400,-32600,`Invalid Request: Batch must not exceed ${100} messages`);let s;try{Array.isArray(a)?s=a.map(S=>tb.parse(S)):s=[tb.parse(a)]}catch{return this.onerror?.(new Error("Parse error: Invalid JSON-RPC message")),this.createJsonErrorResponse(400,-32700,"Parse error: Invalid JSON-RPC message")}if(this._closed)return this.createJsonErrorResponse(404,-32001,"Session not found");let c=s.some(rb);if(c){if(this._initialized&&this.sessionId!==void 0)return this.onerror?.(new Error("Invalid Request: Server already initialized")),this.createJsonErrorResponse(400,-32600,"Invalid Request: Server already initialized");if(s.length>1)return this.onerror?.(new Error("Invalid Request: Only one initialization request is allowed")),this.createJsonErrorResponse(400,-32600,"Invalid Request: Only one initialization request is allowed");this.sessionId=this.sessionIdGenerator?.(),this._initialized=!0,this.sessionId&&this._onsessioninitialized&&await Promise.resolve(this._onsessioninitialized(this.sessionId))}if(!c){let S=this.validateSession(t);if(S)return S;let A=this.validateProtocolVersion(t);if(A)return A}if(this._closed)return this.createJsonErrorResponse(404,-32001,"Session not found");if(!s.some(Zn)){for(let S of s)this.onmessage?.(S,{authInfo:n?.authInfo,requestInfo:o});return new Response(null,{status:202})}let u=crypto.randomUUID(),p=s.find(S=>rb(S)),h=p?p.params.protocolVersion:t.headers.get("mcp-protocol-version")??vT;if(this._enableJsonResponse)return new Promise(S=>{this._streamMapping.set(u,{resolveJson:S,cleanup:()=>{this._streamMapping.delete(u)}});for(let A of s)Zn(A)&&this._requestToStreamMapping.set(A.id,u);for(let A of s)this.onmessage?.(A,{authInfo:n?.authInfo,requestInfo:o})});let g=new TextEncoder,_,k,T=new ReadableStream({start:S=>{_=S},cancel:()=>{k!==void 0&&clearInterval(k),this._streamMapping.get(u)?.controller===_&&this._streamMapping.delete(u)}}),z={"Content-Type":"text/event-stream","Cache-Control":"no-cache, no-transform",Connection:"keep-alive","X-Accel-Buffering":"no"};this.sessionId!==void 0&&(z["mcp-session-id"]=this.sessionId);for(let S of s)Zn(S)&&(this._streamMapping.set(u,{controller:_,encoder:g,cleanup:()=>{k!==void 0&&clearInterval(k),this._streamMapping.delete(u);try{_.close()}catch{}}}),this._requestToStreamMapping.set(S.id,u));try{await this.writePrimingEvent(_,g,u,h);for(let S of s){let A,Q;Zn(S)&&this._eventStore&&h>="2025-11-25"&&(A=()=>{this.closeSSEStream(S.id)},Q=()=>{this.closeStandaloneSSEStream()}),this.onmessage?.(S,{authInfo:n?.authInfo,requestInfo:o,closeSSEStream:A,closeStandaloneSSEStream:Q})}}catch(S){this._streamMapping.get(u)?.cleanup(),this._resumableStreams.delete(u);for(let A of s)Zn(A)&&this._requestToStreamMapping.delete(A.id);throw S}return this._streamMapping.get(u)?.controller===_&&(k=this.startKeepAlive(_,g)),new Response(T,{status:200,headers:z})}catch(i){return this.onerror?.(i),this.createJsonErrorResponse(400,-32700,"Parse error",{data:String(i)})}}async handleDeleteRequest(t){let n=this.validateSession(t);if(n)return n;let i=this.validateProtocolVersion(t);if(i)return i;try{return await Promise.resolve(this._onsessionclosed?.(this.sessionId)),new Response(null,{status:200})}finally{await this.close()}}validateSession(t){if(this.sessionIdGenerator===void 0)return;if(!this._initialized)return this.onerror?.(new Error("Bad Request: Server not initialized")),this.createJsonErrorResponse(400,-32e3,"Bad Request: Server not initialized");let n=t.headers.get("mcp-session-id");if(!n)return this.onerror?.(new Error("Bad Request: Mcp-Session-Id header is required")),this.createJsonErrorResponse(400,-32e3,"Bad Request: Mcp-Session-Id header is required");if(n!==this.sessionId)return this.onerror?.(new Error("Session not found")),this.createJsonErrorResponse(404,-32001,"Session not found")}validateProtocolVersion(t){let n=t.headers.get("mcp-protocol-version");if(n!==null&&!Wa.includes(n))return this.onerror?.(new Error(`Bad Request: Unsupported protocol version: ${n} (supported versions: ${Wa.join(", ")})`)),this.createJsonErrorResponse(400,-32e3,`Bad Request: Unsupported protocol version: ${n} (supported versions: ${Wa.join(", ")})`)}async close(){this._closed||(this._closed=!0,this._streamMapping.forEach(({cleanup:t})=>{t()}),this._streamMapping.clear(),this._requestResponseMap.clear(),this._resumableStreams.clear(),this.onclose?.())}closeSSEStream(t){let n=this._requestToStreamMapping.get(t);if(!n)return;let i=this._streamMapping.get(n);i&&i.cleanup()}closeStandaloneSSEStream(){let t=this._streamMapping.get(this._standaloneSseStreamId);t&&t.cleanup()}async send(t,n){let i=n?.relatedRequestId;if((Fn(t)||Xa(t))&&(i=t.id),i===void 0){if(Fn(t)||Xa(t))throw new Error("Cannot send a response on a standalone SSE stream unless resuming a previous client request");let a;this._eventStore&&(a=await this._eventStore.storeEvent(this._standaloneSseStreamId,t));let s=this._streamMapping.get(this._standaloneSseStreamId);if(s===void 0)return;s.controller&&s.encoder&&(a===void 0||!s.replayedEventIds?.has(a))&&this.writeSSEEvent(s.controller,s.encoder,t,a);return}let r=this._requestToStreamMapping.get(i);if(!r)throw new Error(`No connection established for request ID: ${String(i)}`);let o=this._streamMapping.get(r);if(!this._enableJsonResponse){let a;this._eventStore&&(a=await this._eventStore.storeEvent(r,t),o=this._streamMapping.get(r)),o?.controller&&o?.encoder&&(a===void 0||!o.replayedEventIds?.has(a))&&this.writeSSEEvent(o.controller,o.encoder,t,a)&&a!==void 0&&this._resumableStreams.add(r)}if(Fn(t)||Xa(t)){this._requestResponseMap.set(i,t);let a=Array.from(this._requestToStreamMapping.entries()).filter(([c,l])=>l===r).map(([c])=>c);if(a.every(c=>this._requestResponseMap.has(c))){if(!o){if(this._closed){for(let c of a)this._requestResponseMap.delete(c),this._requestToStreamMapping.delete(c);return}if(!this._enableJsonResponse&&this._eventStore&&this._resumableStreams.has(r)){for(let c of a)this._requestResponseMap.delete(c),this._requestToStreamMapping.delete(c);this._resumableStreams.delete(r);return}for(let c of a)this._requestResponseMap.delete(c),this._requestToStreamMapping.delete(c);throw new Error(`No connection established for request ID: ${String(i)}`)}if(this._enableJsonResponse&&o.resolveJson){let c={"Content-Type":"application/json"};this.sessionId!==void 0&&(c["mcp-session-id"]=this.sessionId);let l=a.map(u=>this._requestResponseMap.get(u));l.length===1?o.resolveJson(new Response(JSON.stringify(l[0]),{status:200,headers:c})):o.resolveJson(new Response(JSON.stringify(l),{status:200,headers:c}))}else o.cleanup();for(let c of a)this._requestResponseMap.delete(c),this._requestToStreamMapping.delete(c);this._resumableStreams.delete(r)}}}};var lh=class{constructor(t={}){this._requestContext=new WeakMap,this._webStandardTransport=new ch(t),this._requestListener=Mw(async n=>{let i=this._requestContext.get(n);return this._webStandardTransport.handleRequest(n,{authInfo:i?.authInfo,parsedBody:i?.parsedBody})},{overrideGlobalObjects:!1})}get sessionId(){return this._webStandardTransport.sessionId}set onclose(t){this._webStandardTransport.onclose=t}get onclose(){return this._webStandardTransport.onclose}set onerror(t){this._webStandardTransport.onerror=t}get onerror(){return this._webStandardTransport.onerror}set onmessage(t){this._webStandardTransport.onmessage=t}get onmessage(){return this._webStandardTransport.onmessage}async start(){return this._webStandardTransport.start()}async close(){return this._webStandardTransport.close()}async send(t,n){return this._webStandardTransport.send(t,n)}async handleRequest(t,n,i){let r=t.auth;await Mw(async a=>this._webStandardTransport.handleRequest(a,{authInfo:r,parsedBody:i}),{overrideGlobalObjects:!1})(t,n)}closeSSEStream(t){this._webStandardTransport.closeSSEStream(t)}closeStandaloneSSEStream(){this._webStandardTransport.closeStandaloneSSEStream()}};var j=class extends Error{constructor(t){super(t),this.name="UsageError"}};var nu=e=>e.replace(/[&<>"']/g,t=>`&#${t.charCodeAt(0)};`),Zw="(window.webkit?.messageHandlers?.live??window.chrome?.webview)",Fw=10*6e4,qV=20,uh=class{constructor(t){this.context=t}context;records=new Map;seq=0;waiters=new Set;openDialog(){return[...this.records.values()].reverse().find(t=>t.status==="open")}get(t){return this.purge(),this.records.get(t)}latest(){return this.purge(),[...this.records.values()].reverse().find(t=>t.kind!=="status")}open(t,n,i,r,o={}){let a=this.openDialog();if(a&&!o.force){let l=Math.round((Date.now()-a.openedAt)/1e3);throw new j(`A dialog is already open in Live (dialog_id ${JSON.stringify(a.id)}, opened ${l} s ago). One dialog is shown at a time. Wait for its answer with dialog_result, or ask the user to close it. If the user already closed it, pass force:true.`)}this.purge();let s={id:`dialog-${++this.seq}`,kind:r,openedAt:Date.now(),status:"open",answer:o.answer};this.records.set(s.id,s);let c=l=>{Object.assign(s,l,{closedAt:Date.now()});for(let u of[...this.waiters])u()};return this.context.ui.showModalDialog(t,n,i).then(l=>c({status:"closed",result:String(l??"")}),l=>{let u=l instanceof Error?l.message:l===void 0?"Live rejected the dialog without details":String(l);console.error(`[ableton-live-mcp] ${s.id} (${r}) could not be shown: ${u}`),c({status:"failed",error:u})}),s}wait(t,n,i){return t.status!=="open"||i?.aborted?Promise.resolve():new Promise(r=>{let o=()=>{s!==void 0&&clearTimeout(s),this.waiters.delete(a),i?.removeEventListener("abort",o),r()},a=()=>{t.status!=="open"&&o()},s=Number.isFinite(n)?setTimeout(o,n):void 0;this.waiters.add(a),i?.addEventListener("abort",o,{once:!0})})}purge(){let t=Date.now(),n=[...this.records.values()].filter(i=>i.status!=="open");n.forEach((i,r)=>{(t-(i.closedAt??t)>Fw||r<n.length-qV)&&this.records.delete(i.id)})}};function dh(e,t=Date.now()){let n={dialog_id:e.id,status:e.status};if(e.status==="open")return{...n,open_s:Math.round((t-e.openedAt)/1e3)};if(e.status==="failed")return{...n,error:e.error};let i=e.result??"";return{...n,...e.answer?e.answer(i):{result:i}}}function n1(e){let t;try{t=new URL(e)}catch{throw new j(`Invalid url ${JSON.stringify(e)}: give an absolute URL.`)}if(t.protocol==="https:"||t.protocol==="file:"||t.protocol==="http:"&&t.hostname==="localhost")return t.href;throw new j(`url must be https:, file: or http://localhost (the schemes Live's dialogs load), not ${t.protocol}//${t.host}. For a page of your own, pass it as html.`)}function i1(e){let t=e.fields??[];if(!e.title&&!e.message&&!t.length)throw new j("form needs a title, a message or fields.");let n=new Set;t.forEach((r,o)=>{let a=`form.fields[${o}] (${JSON.stringify(r.name)})`;if(n.has(r.name))throw new j(`${a}: the field name is used twice.`);if(n.add(r.name),r.type==="select"!=(r.options!==void 0))throw new j(`${a}: options go with type "select", and a select needs them.`);if(r.type!=="number"&&(r.min!==void 0||r.max!==void 0||r.step!==void 0))throw new j(`${a}: min, max and step only apply to type "number".`);if(r.min!==void 0&&r.max!==void 0&&r.min>r.max)throw new j(`${a}: min ${r.min} is above max ${r.max}.`);if(r.default===void 0)return;let s=r.type==="checkbox"?"boolean":r.type==="number"?"number":"string";if(typeof r.default!==s)throw new j(`${a}: a ${r.type} field's default is a ${s}.`);if(r.type==="select"&&!r.options?.includes(r.default))throw new j(`${a}: the default must be one of the options.`)});let i=e.choices??(t.length?["OK","Cancel"]:["OK"]);if(new Set(i).size!==i.length)throw new j("form.choices: each button label once.");return i}var BV=`(function () {
|
|
110
|
+
var host = ${Zw};
|
|
111
|
+
function values() {
|
|
112
|
+
var out = {};
|
|
113
|
+
document.querySelectorAll("[data-field]").forEach(function (el) {
|
|
114
|
+
var name = el.getAttribute("data-field");
|
|
115
|
+
var type = el.getAttribute("data-type");
|
|
116
|
+
if (type === "checkbox") out[name] = !!el.checked;
|
|
117
|
+
else if (type === "number") {
|
|
118
|
+
var v = String(el.value).trim();
|
|
119
|
+
out[name] = v === "" || !isFinite(Number(v)) ? null : Number(v);
|
|
120
|
+
} else out[name] = String(el.value);
|
|
121
|
+
});
|
|
122
|
+
return out;
|
|
123
|
+
}
|
|
124
|
+
document.querySelectorAll("button[data-choice]").forEach(function (b) {
|
|
125
|
+
b.addEventListener("click", function () {
|
|
126
|
+
var answer = { choice_index: Number(b.getAttribute("data-choice")), values: values() };
|
|
127
|
+
host.postMessage({ method: "close_and_send", params: [JSON.stringify(answer)] });
|
|
128
|
+
});
|
|
129
|
+
});
|
|
130
|
+
})();`,HV="body{font-family:sans-serif;font-size:13px;background:#363636;color:#b5b5b5;padding:16px;margin:0}h3{margin:0 0 8px;color:#fff}p{white-space:pre-wrap;margin:0 0 12px}.row{margin:0 0 10px}.row label{display:block;margin:0 0 3px}.check{display:flex;align-items:center;gap:6px}.check label{display:inline;margin:0}input:not([type=checkbox]),textarea,select{box-sizing:border-box;width:100%;background:#1e1e1e;color:#e0e0e0;border:1px solid #555;padding:4px;font:inherit}.buttons{display:flex;flex-wrap:wrap;gap:8px;justify-content:flex-end;margin-top:14px}button{background:#4b4b4b;color:#e0e0e0;border:1px solid #666;padding:5px 14px;font:inherit}button.primary{background:#ffad56;color:#1e1e1e;border-color:#ffad56}";function o1(e,t){let n=nu,i=(o,a)=>{let s=`f${a}`,c=`id="${s}" data-field="${n(o.name)}" data-type="${o.type}"`+(a===0?" autofocus":"")+(o.placeholder!==void 0?` placeholder="${n(o.placeholder)}"`:""),l=`<label for="${s}">${n(o.label??o.name)}</label>`,u=o.default===void 0?"":n(String(o.default));switch(o.type){case"checkbox":return`<div class="row check"><input type="checkbox" ${c}${o.default===!0?" checked":""}>${l}</div>`;case"textarea":return`<div class="row">${l}<textarea rows="4" ${c}>${u}</textarea></div>`;case"select":{let p=(o.options??[]).map(h=>`<option value="${n(h)}"${h===o.default?" selected":""}>${n(h)}</option>`).join("");return`<div class="row">${l}<select ${c}>${p}</select></div>`}case"number":{let p=["min","max","step"].map(h=>o[h]!==void 0?` ${h}="${o[h]}"`:"").join("");return`<div class="row">${l}<input type="number" ${c} value="${u}"${p}></div>`}default:return`<div class="row">${l}<input type="text" ${c} value="${u}"></div>`}},r=t.map((o,a)=>`<button type="button" data-choice="${a}"${a===0?' class="primary"':""}>${n(o)}</button>`).join("");return`<!doctype html><meta charset="utf-8"><style>${HV}</style><body>`+(e.title?`<h3>${n(e.title)}</h3>`:"")+(e.message?`<p>${n(e.message)}</p>`:"")+(e.fields??[]).map(i).join("")+`<div class="buttons">${r}</div><script>${BV}</script></body>`}function a1(e,t,n){let i;try{i=JSON.parse(n)}catch{i=void 0}let r=i?.choice_index;if(typeof r!="number"||!Number.isInteger(r)||r<0||r>=t.length)return{choice:null,result:n,problem:"the dialog closed without one of the form's buttons"};let o=e.fields??[],a=typeof i?.values=="object"&&i.values!==null?i.values:{},s={};for(let c of o){let l=Object.prototype.hasOwnProperty.call(a,c.name)?a[c.name]:void 0;s[c.name]=c.type==="checkbox"?l===!0:c.type==="number"?typeof l=="number"&&Number.isFinite(l)?l:null:typeof l=="string"?l:""}return{choice:t[r],choice_index:r,values:o.length?s:void 0}}var ph=Sr(require("node:crypto"),1),xs=Sr(require("node:fs"),1),c1=Sr(require("node:path"),1);var s1=8722,JV=/^[\x21-\x7e]{16,4096}$/,ws={port:{schema:y.number().int().min(1).max(65535),expected:"an integer from 1 to 65535"},progress_notifications:{schema:y.boolean(),expected:"true or false"},read_only:{schema:y.boolean(),expected:"true or false",security:!0},disabled_tools:{schema:y.array(y.string().min(1)).max(1e3),expected:"a list of tool names",security:!0},auth_token:{schema:y.string().regex(JV).nullable(),expected:"null, or a string of at least 16 visible ASCII characters without spaces",security:!0},sample_roots:{schema:y.unknown(),expected:"a list of folder paths"}},l1=e=>e.toLowerCase().replace(/[^a-z0-9]/g,""),GV=new Map(Object.keys(ws).filter(e=>"security"in ws[e]).map(e=>[l1(e),e])),qw=e=>KV(xs.readFileSync(e));function KV(e){return e[0]===255&&e[1]===254?e.subarray(2).toString("utf16le"):e[0]===254&&e[1]===255?e.subarray(2,2+(e.length-2&-2)).swap16().toString("utf16le"):e.toString("utf8").replace(/^\uFEFF/,"")}function mh(e){return e?c1.join(e,"config.json"):void 0}var u1=e=>ph.createHash("sha256").update(e,"utf8").digest();function d1(e,t){let n=/^bearer +(\S+) *$/i.exec(e??"");return n!==null&&ph.timingSafeEqual(u1(n[1]),t)}function ks(e,t){e.locked=e.locked?`${e.locked}; ${t}`:t}var Vw=e=>{let t=JSON.stringify(e)??String(e);return t.length>60?`${t.slice(0,57)}...`:t};function p1(e){let t={port:s1,progress:!0,readOnly:!1,disabledTools:[],problems:[]},n=mh(e);if(!e||!n)return t;t.file=n;let i;try{i=qw(n)}catch(l){if(l.code!=="ENOENT")return t.problems.push(`${n} could not be read (${l.message})`),ks(t,"config.json exists but could not be read"),t;try{xs.mkdirSync(e,{recursive:!0}),xs.writeFileSync(n,JSON.stringify({port:s1},null,2))}catch{}return t}if(!i.trim())return t.problems.push(`${n} is empty, using the defaults`),t;let r,o;try{r=JSON.parse(i)}catch(l){o=l.message}if(o!==void 0||typeof r!="object"||r===null||Array.isArray(r))return t.problems.push(`${n} could not be parsed (${o??"not a JSON object"})`),ks(t,"config.json could not be parsed (it may hold a security setting)"),t;let a=r,s=Object.keys(a).filter(l=>!Object.hasOwn(ws,l));s.length&&t.problems.push(`unknown setting(s) in ${n} ignored: ${s.map(Vw).join(", ")} (known: ${Object.keys(ws).join(", ")})`);for(let l of s){let u=GV.get(l1(l));u&&ks(t,`config.json has ${Vw(l)}: write it as "${u}"`)}let c={};for(let l of Object.keys(ws)){if(a[l]===void 0)continue;let u=ws[l];if(u.schema.safeParse(a[l]).success){c[l]=a[l];continue}let p=l==="auth_token"?"":` (got ${Vw(a[l])})`;u.security?(t.problems.push(`invalid "${l}" in ${n}${p}: expected ${u.expected}`),ks(t,`"${l}" in config.json must be ${u.expected}`)):t.problems.push(`invalid "${l}" in ${n}${p}: expected ${u.expected}, using the default`)}return c.port!==void 0&&(t.port=c.port),c.progress_notifications!==void 0&&(t.progress=c.progress_notifications),c.read_only!==void 0&&(t.readOnly=c.read_only),c.disabled_tools!==void 0&&(t.disabledTools=[...new Set(c.disabled_tools)]),typeof c.auth_token=="string"&&(t.tokenDigest=u1(c.auth_token)),t}var Bw=`Controls the running Ableton Live Set through Live's Extensions API.
|
|
131
|
+
- Start with song_get: it returns the ids every other tool takes (\`include\` limits the sections;
|
|
132
|
+
"devices", "mixer", "clips" add each track's device tree, levels and clips). Tools acting on a
|
|
133
|
+
track also take track_name or track_index, scene tools scene_name or scene_index. Ids go stale
|
|
134
|
+
when an object is deleted or moved, or another set is loaded: call song_get again, re-resolve.
|
|
135
|
+
- Across tracks: scene_get (a scene row), session_grid, arrangement_get (a beat range), song_audit.
|
|
136
|
+
For "this clip", "these slots" or "the selected range", ask the user to right-click it in Live and
|
|
137
|
+
choose "MCP: Use as selection", then call selection_wait (selection_get: the last one).
|
|
138
|
+
- One call and one undo step for many objects (cue_point_set moves: up to 3): the *_set tools take
|
|
139
|
+
\`items\`, clip_set a track \`select\`, mixer_set \`targets\` or \`all_tracks\`. track_create also takes
|
|
140
|
+
a name and devices. Dependent chains: batch (batch_read: reads only), {"$ref": "0.id"} = a result.
|
|
141
|
+
- Times, positions and durations are beats (quarter notes), never seconds or bars: at 4/4 a bar
|
|
142
|
+
is 4 beats; seconds to beats = seconds * tempo / 60. MIDI pitch is 0-127 or a name, C3 = 60
|
|
143
|
+
(the kick pad is usually "C1" = 36); velocity 0-127, probability 0-1, colors "#RRGGBB".
|
|
144
|
+
- Mixer volume is 0-1 (0.85 = 0 dB, 1.0 = +6 dB), panning -1..1. Device parameters are internal
|
|
145
|
+
units within min/max (no dB/Hz); quantized ones take a value_items index or a value_item name.
|
|
146
|
+
Address parameters as {track_name, device, parameter}, device a name, index or rack path like
|
|
147
|
+
["Drum Rack", {pad:36}, "Simpler"] (pad = receiving note); device_set sets several, or on/off.
|
|
148
|
+
- Create MIDI clips with their notes in one clip_create call (drum lines as step \`patterns\`,
|
|
149
|
+
\`repeat\` to fill); layer with midi_clip_set_notes "merge"; edit with midi_clip_edit_notes. Also
|
|
150
|
+
one call each: drum_kit_build (files: sample_search), clip_copy, arrangement_copy_range.
|
|
151
|
+
- Writes apply asynchronously (a read right after one may return the old value). Deletes, clearing
|
|
152
|
+
a range, replacing notes or a sample change the project: confirm bulk edits not spelled out \u2014
|
|
153
|
+
in Live: show_dialog {form, wait:false}, then dialog_result (a waiting call can time out).
|
|
154
|
+
- Not possible: transport (play/stop/record), launching clips or scenes, the browser, plug-ins and
|
|
155
|
+
Live presets, automation, track color, routing and sidechain, reordering or grouping tracks, new
|
|
156
|
+
return tracks, metering, editing clip markers or loops, the song time signature. Say so.
|
|
157
|
+
`;var m1='---\nname: ableton-live\ndescription: Control Ableton Live via the ableton-live MCP server \u2014 compose MIDI, arrange tracks, edit clips, tweak devices and mix. Use whenever the user asks to do anything in Ableton Live (create tracks/clips/notes, change tempo, add devices, mix levels, warp audio, render stems).\n---\n\n# Ableton Live via MCP\n\nThe `ableton-live` MCP server (streamable HTTP, `http://127.0.0.1:8722/mcp`) controls a running\nAbleton Live 12. If tools fail to connect: Live is not running, the extension is not installed,\nor the port was changed in the extension\'s `config.json` (default 8722). HTTP 401 means the\nuser set an `auth_token` in config.json and the client must send `Authorization: Bearer\n<token>`; 503 means config.json has an invalid or misspelled security setting (`read_only`,\n`disabled_tools`, `auth_token`, including a `disabled_tools` entry that names no tool), or exists\nbut cannot be read or parsed (the error says which, and the Status dialog in Live too). Ask the\nuser to fix their client or config; never guess a token.\n\n## Core workflow\n\n1. **Always start with `song_get`.** It returns the set with object ids. Every other tool\n takes those ids. Pass `include` to fetch only some sections. To read the whole set in one\n call, add the deep sections: `song_get {include:["tracks", "devices", "mixer", "clips"]}`\n (see [Reading the whole set](#reading-the-whole-set)).\n2. Drill down with `track_get` / `device_get` / `clip_get` \u2014 they return child ids (clips,\n parameters, chains). `track_get` takes an `include` selector to skip sections you don\'t\n need.\n3. **Address tracks and scenes by name when the user does.** Every tool that acts on one track\n (`track_get`, `track_set`, `track_delete`, `track_duplicate`, `track_clear_clips_in_range`,\n `take_lane_create`, `render_track_audio`, `audio_track_consolidate`, `mixer_get`, `mixer_set`,\n `device_insert`, `drum_kit_build`, `clip_create`, `clip_copy`) takes `track_id`, `track_index`\n (0-based, regular tracks) or `track_name` (exact first, then case-insensitive; also finds\n return and main tracks). The scene tools, `clip_create` and `clip_copy` take `scene_id`,\n `scene_index` or `scene_name`. "Mute the Drums" is one call:\n `track_set {track_name:"Drums", mute:true}`. If you give several fields they must name\n the same object. An ambiguous name fails with the matching candidates \u2014 pick one by id or\n index. `track_delete` and `scene_delete` only accept the exact name. Parameters work the same\n way: see [Devices & sound design](#devices--sound-design).\n4. Ids become stale when objects are deleted/moved or a different set is loaded. On a stale-id\n error, re-run `song_get` and re-resolve. Errors about your arguments (unknown name, index\n out of range, missing or conflicting fields) come without the stale-id hint: fix the call\n instead.\n5. Writes apply asynchronously: a read right after a write can still return the old value.\n6. The user can switch tools off in config.json: `read_only` leaves only the tools that read the\n set, `disabled_tools` drops the ones it names. A switched-off tool is not listed at all (a\n batch step naming it fails with "switched off"); the server instructions say which. Tell the\n user that the action is switched off on their server instead of looking for a workaround.\n A prompt (see below) is only offered when every tool it uses is available.\n\n## Resources and prompts\n\n- Resources, for clients that attach context: `live://song` (what `song_get` returns without\n arguments), `live://tracks/{track}` (what `track_get` returns; `{track}` is the track name\n percent-encoded with encodeURIComponent, so "Drums/Bus" is `live://tracks/Drums%2FBus`; names\n that several tracks share are not listed \u2014 use `track_get` with an index or id) and\n `live://guide` (this guide). They are snapshots: read again for fresh data, there are no\n subscriptions.\n- Prompts the user can pick in the client, each expanding into steps with exact tool calls:\n `song_skeleton {sections?, tempo?, beats_per_bar?, tracks?}` (scenes and locators per section,\n e.g. sections "Intro:8, Verse:16, Chorus:16"), `chord_progression {progression?, key?,\n bars_per_chord?, beats_per_bar?, octave?, voicing?, track?}` (Roman numerals in a key \u2014\n default Live\'s current scale \u2014 or chord names, voiced by the server) and `drum_beat {style?, bars?, track?, tempo?,\n swing?}` (house, techno, hip_hop, trap, dnb, breakbeat, rock, reggaeton). Follow their steps;\n values written as "<...>" are yours to fill in.\n\n## Reading the whole set\n\n- `song_get` tracks carry `index` (the `track_index`), `depth` in the group hierarchy and\n `group_track_id`; group tracks have `is_group: true` and `child_track_ids` ("the drum bus" is\n the group whose children are the drums) \u2014 their `type` is `"other"`. Return tracks have\n `type: "return"` and the main track `"main"` here (`track_get` and `selection_get` report both\n as `"other"`).\n Return tracks carry `send_index` (their send).\n- Deep sections, only when listed in `include` (they imply the tracks): `devices` (each track\'s\n device tree through racks \u2014 chains with `receiving_note_name` and their devices \u2014 and every\n device\'s on-state `enabled`), `mixer` (volume, panning, sends labeled with `return_track`),\n `clips` (session clips with `scene_index`, arrangement clips with start/end, in brief). They\n stop at 500 devices / 500 clips: then `truncated` names the first track left out \u2014 read the\n rest with `track_get` / `device_get`.\n- One scene across all tracks ("what\'s in the chorus?"): `scene_get {scene_name:"Chorus",\n only_clips?}`. The whole session at a glance: `session_grid` (a track \xD7 scene matrix, cells\n `null` or a brief clip; narrow with `tracks` and `scene_index_min`/`scene_index_max`).\n- A stretch of the arrangement ("what happens from bar 17 to bar 33?" = beats 64 to 128 at 4/4):\n `arrangement_get {start_time:64, end_time:128, tracks?, include_take_lanes?}` returns the cue\n points in the range and every track\'s overlapping clips, plus `song_end` (the end of the last\n arrangement clip \u2014 the API has no song length). Without a range it covers the whole song.\n- Housekeeping: `song_audit` lists missing media files (audio clips and Simpler samples whose file\n is gone), Simplers without a sample, empty drum pads and duplicate track names, each with ids\n and a location. It changes nothing; offer fixes (`simpler_replace_sample`, `track_set` names)\n and confirm before deleting anything.\n- `clip_get`, `device_get` and `chain_get` include a `location`: a clip\'s view (`session` with\n track and scene, `arrangement`, `take_lane`), a device\'s track, path through racks\n (`"Kit > Drum Rack > pad 36 > Simpler"`) and position.\n\n## The user\'s selection ("this clip", "these slots", "the selected range")\n\n- Live\'s API cannot read the selection. The extension adds **"MCP: Use as selection"** to Live\'s\n context menus (clips, clip slots, tracks, scenes, Drum Racks, Simplers, samples, a selection of\n clip slots, an arrangement time selection). When the user refers to something they selected,\n ask them to right-click it and choose that entry, then call `selection_wait` (waits up to\n `timeout_s`, at most 55 s; on `timed_out`, ask again). `selection_get` returns the last capture\n without waiting \u2014 check `age_s` before trusting an old one.\n- The result: `items` (the clicked object, or each selected clip slot) with ids, summaries and\n `location`; for an arrangement time selection, `time_selection {start_time, end_time}` in\n beats and `lanes` (the selected tracks or take lanes) with the clips overlapping it. Pass the\n ids to the other tools: "quantize this" = `midi_clip_edit_notes {clip_id:<items[0].id>,\n quantize:{grid:0.25}}`; "render the selected range" = `render_track_audio {track_id, start_time,\n end_time}` from the time selection.\n- An item with `error` was deleted or moved since, or Live passed something unexpected: ask the\n user to select again. Don\'t guess ids instead.\n\n## Batch edits (one call, one undo step)\n\n- `track_set`, `scene_set`, `cue_point_set`, `clip_set`, `take_lane_set` and `mixer_set` take\n `items: [...]` \u2014 one entry per object, each with its address and values:\n `track_set {items:[{track_name:"Bass", mute:true}, {track_name:"Keys", solo:false}]}`,\n `scene_set {items:[{scene_index:0, name:"Intro"}, {scene_index:1, name:"Verse"}]}`.\n- `clip_set {select:{track_name:"Drums", scope:"all", name_contains?}, warp_mode:"ComplexPro"}`\n changes every matching clip of one track (scope: `session`, `arrangement`, `take_lanes` or\n `all`).\n- Every entry is validated first: one bad entry (unknown name, bad color, warp settings on a\n MIDI clip) fails the whole call and changes nothing; the error names the entry\n (`items[2]: ...`). The user undoes the whole batch with one Cmd/Ctrl-Z \u2014 except\n `cue_point_set` moves, which take up to three undo steps (creates, names, deletes).\n- Prefer one batched call over a loop of single calls.\n\n## Chaining dependent calls (`batch`, `batch_read`)\n\n- When a call needs the result of the one before (create a track, then a clip on it, then its\n notes) and no compound tool does it, send the whole chain in one `batch {steps:[{tool, args,\n as?}]}` (up to 50 steps, run in order). `args` are exactly a direct call\'s arguments; a value\n `{"$ref": "<step>.<path>"}` is taken from an earlier step\'s result \u2014 `<step>` is its 0-based\n index or its `as` name, `<path>` keys and array indexes:\n `batch {steps:[{tool:"track_create", args:{type:"midi", name:"Keys"}, as:"keys"},\n {tool:"clip_create", args:{type:"midi", track_id:{"$ref":"keys.id"}, start_time:0, duration:4}},\n {tool:"midi_clip_set_notes", args:{clip_id:{"$ref":"1.id"}, notes:[...]}}]}`.\n- Unknown tools, bad `$ref`s and invalid arguments of steps without a `$ref` fail the call\n before anything runs; steps with a `$ref` are checked when they run. The batch is NOT one undo\n step and not atomic: with `on_error:"stop"` (default) it ends at the first failing step and\n the earlier ones stay applied \u2014 read `results` (per step `result` or `error`), `completed`\n and `not_run`, and tell the user what happened. `on_error:"continue"` runs the rest.\n- Prefer the compound tools and `items` batches when they fit: they validate everything first\n and are one undo step. `batch` cannot hold `show_dialog`, `execute_command` or another batch.\n- `batch_read` is the read-only form (`*_get`, `midi_clip_get_notes`, `session_grid`,\n `arrangement_get`, `parameter_find`, `sample_search`, `selection_wait`, ...): it refuses any\n step that can change the set and continues after a failed step by default. E.g. a track by\n name, then the notes of its first clip: `{steps:[{tool:"track_get", args:{track_name:"Bass",\n include:["clip_slots"]}, as:"t"}, {tool:"midi_clip_get_notes",\n args:{clip_id:{"$ref":"t.clip_slots.0.clip.id"}}}]}`.\n\n## Units and conventions\n\n- All times, positions, durations are **beats** (quarter notes), not seconds or bars.\n At 4/4, one bar = 4 beats. Seconds \u2192 beats: `seconds * tempo / 60`.\n- MIDI pitch: 0\u2013127, C3 = 60 in Live\'s naming (C-2 = 0). Kick drum pad usually C1 = 36.\n Wherever a pitch is taken (notes, patterns, `select` ranges, drum pads, `drum_chain_set`) a\n note name works too: `"C1"`, `"F#1"`, `"Bb2"` (sharps `#`, flats `b`).\n- Colors: `"#RRGGBB"` strings.\n- Velocity 0\u2013127, probability 0\u20131.\n- Device parameters use internal units within each parameter\'s `min`/`max` (no dB/Hz/ms\n display values). Quantized parameters (switches, choosers) take the `value_items` index, or\n the choice by name with `value_item`.\n\n## MIDI composition\n\n- Create track: `track_create {type:"midi", name:"Bass", devices:["Operator"]}` names it and\n inserts devices in the same call (`{name:"Auto Filter", parameters:[{name:"Frequency",\n value:80}]}` sets initial values). Live inserts the new track after the selected one, so use\n the returned `index`/`id`, not "the last track". A device that fails to insert is reported\n in `errors` (and its `devices` entry); the track and the other devices are still created.\n- Then create clip + notes in ONE call:\n - Session: `clip_create {type:"midi", track_name:"Bass", scene_name:"Verse", duration:4, notes:[...], name, color}`\n (or `target_id:<track_id>, scene_index:0`)\n - Arrangement: `clip_create {type:"midi", target_id:<midi_track_id>, start_time, duration, notes:[...]}`\n - Take lane: `clip_create {type:"midi", target_id:<take_lane_id>, start_time, duration, ...}`\n - MIDI clips ignore the audio-only `file_path`, `is_warped` and `loop_settings` (the result\'s\n `warning` says so): don\'t send them for MIDI.\n- Drum lines and other repetitive parts: step `patterns` instead of one note per hit \u2014 one\n pitch per string, `"x"` a hit, `"X"` an accent (`accent_velocity`, default 127), `"."` or `"-"`\n a rest, spaces and `|` ignored; `step` is the beats per character (default 0.25 = 1/16).\n `repeat {length}` copies the notes and patterns every `length` beats up to the clip\'s end\n (`times` for an exact count). A two-bar beat in one call:\n `clip_create {type:"midi", track_name:"Drums", scene_index:0, duration:8, repeat:{length:4},\n patterns:[{note:"C1", steps:"x...x...x...x..."}, {note:"D1", steps:"....X.......X..."},\n {note:"F#1", steps:"x.x.x.x.x.x.x.x.", velocity:80}]}`. `midi_clip_set_notes` takes the\n same `patterns` and `repeat`.\n- Layer more notes: `midi_clip_set_notes {mode:"merge", notes:[...]}` (default mode `replace`\n wipes the clip \u2014 only use it when rewriting everything).\n- Reading notes: `midi_clip_get_notes {select?, format?}`. `select` filters like the edit\'s\n (below); `format:"compact"` returns `[pitch, start_time, duration, velocity]` tuples plus an\n object of the fields that differ from the result\'s `defaults` \u2014 use it for dense clips.\n- Mechanical edits: `midi_clip_edit_notes` \u2014 server-side, no need to read and resend the note\n list. Note times are relative to the clip start.\n - `select` (all filters must match): `pitch_min`/`pitch_max` (numbers or names),\n `time_min`/`time_max` (start, beats), `in_scale` (true/false against the song\'s scale, or\n `snap_to_scale`\'s), `every_nth` (`2` = 1st, 3rd, ... in time order; `{n:2, offset:1}` = 2nd,\n 4th, ...), `only_selected` (the notes the user selected in Live\'s editor).\n - Transforms, in this order: `transpose`; `snap_to_scale` (`"song"` or `{root:"D",\n intervals:[0,2,3,5,7,9,10]}`; out-of-key notes move to the nearest scale note, ties go\n down); `set {velocity, probability, velocity_deviation, release_velocity, muted}`;\n `velocity_scale`, `velocity_offset`; `time_shift`; `quantize {grid, strength}`; `swing\n {amount, grid}` (0 = straight, ~0.67 = triplet feel, 1 = dotted); `duration_set` or\n `duration_scale`; `legato` (each note runs to the next start; notes starting together are\n a chord and end together; the last keep their length); `humanize {timing, velocity, seed}`.\n Or `delete:true`.\n - A grid of `"song"` (quantize, swing) uses Live\'s grid setting \u2014 the arrangement grid, not\n the clip editor\'s; bar grids assume the first scene\'s time signature, "No Grid" fails.\n - `humanize` is reproducible: pass `seed`, or reuse the returned `humanize_seed`.\n - `clip_ids:[...]` edits several clips alike in one undo step (one notes write per clip):\n "humanize these 8 drum clips" is one call.\n - "Fix the out-of-key notes" = `{clip_id, snap_to_scale:"song"}`; "mute every second hi-hat"\n = `{select:{pitch_min:"F#1", pitch_max:"F#1", every_nth:{n:2, offset:1}}, set:{muted:true}}`.\n- The user\'s note selection: `only_selected` (and each note\'s `selected` in reads) comes from\n `NoteDescription.selected`. Whether Live fills it in for extensions is unverified: when no\n note reports a selection, results carry a `warning` \u2014 then ask the user which notes they\n mean instead of guessing.\n- Respect the song scale from `song_get` (`scale.root_note`, `scale.intervals`) when composing.\n- Notes the user selected inside a clip\'s editor are `only_selected` (above); which clip, slot or\n range they mean is the context-menu selection (see [The user\'s selection](#the-users-selection-this-clip-these-slots-the-selected-range)).\n\n## Devices & sound design\n\n- `device_insert` takes built-in Live device names: "Operator", "Wavetable", "Drum Rack",\n "Simpler", "Reverb", "Delay", "Auto Filter", "EQ Eight", "Compressor", "Saturator", ...\n Third-party plug-ins cannot be inserted. One instrument per track \u2014 inserting a second\n instrument fails.\n- **Address parameters by name \u2014 no id lookup needed.** `parameter_get` and `parameter_set`\n entries take `{track_name, device, parameter}` (or `{device_id, parameter}`, or the old\n `{parameter_id}`):\n - `device`: a name (exact, then case-insensitive), a 0-based index on the track, or a path\n into racks: `["Drum Rack", {pad:36}, "Simpler"]` (a pad is the drum chain with that\n receiving note) or `["Instrument Rack", {chain:1}, 0]` (chains by index; chains have no\n names).\n - `parameter`: exact name first, then case-insensitive, then a unique substring (`"freq"` \u2192\n "Frequency"). Ambiguous matches fail with the candidates and their ids.\n - Each write gives exactly one of `value` (internal units), `value_item` (a quantized\n parameter\'s choice by name or short name, matched like `parameter`: `"high"` \u2192\n "Highpass"), `reset:true` (back to the default) or `delta` (relative to the current value,\n clamped).\n - "Switch the bass filter to high-pass" is one call, e.g.\n `parameter_set {values:[{track_name:"Bass", device:"Auto Filter", parameter:"Filter Type", value_item:"high"}]}`\n (when unsure of the exact names, `parameter_find` first).\n- `device_set {track_name, device, enabled?, parameters?:[{name, value|value_item|reset|delta}]}`\n bypasses or enables a device and sets several of its parameters in one undo step. `enabled`\n uses the "Device On" parameter (a Live convention, not an API field); a device without one\n falls back to a two-state first parameter, and `on_parameter.fallback` says so. Some devices\n have no switch at all \u2014 that fails with a clear error.\n- Don\'t know the parameter name? `parameter_find {track_name, query:"cutoff"}` (or the whole set,\n or one device; `value_item:"saw"` finds choosers with that choice) returns ids, device names and\n paths like "Drums > Drum Rack > pad 36 > Simpler". Big devices have 100+ params: prefer\n `parameter_find` or `device_get {parameter_filter, include_values:true}` over dumping all.\n- `device_insert` and `track_create` devices take initial `parameters:[{name, value|value_item|\u2026}]`.\n- dB, Hz and ms are not available: values are internal units only. Read `min`/`max` and the\n current value first, and say that any unit conversion is approximate.\n- Drum racks: `device_get {include_chain_devices:true}` maps the whole kit (pad \u2192 note \u2192\n sample) in one call; drum chains report `receiving_note` and `receiving_note_name` (`"C1"`).\n `drum_chain_set` maps a pad to a MIDI note (`receiving_note: 38` or `"D1"`), and pads in\n device paths take names too (`["Drum Rack", {pad:"C1"}, "Simpler"]`);\n `simpler_replace_sample` swaps samples. `rack_insert_chain {rack_device_id, index}` adds an empty\n chain to a rack (fill it with `device_insert {target_id:<chain id>, device_name}`).\n- **A kit from sample files is one call**: `drum_kit_build {track_name:"Drums", pads:[{note:"C1",\n sample_path:"/abs/kick.wav"}, {note:"D1", sample_path:"/abs/snare.wav", volume:0.7},\n {note:"F#1", sample_path:"/abs/hat.wav", panning:0.2}]}`. It uses the track\'s Drum Rack (or\n inserts one on a MIDI track; `rack_device_id` for a specific rack), reuses the pad receiving\n each note or creates a chain for it, inserts a Simpler (or keeps the pad\'s Simpler and REPLACES\n its sample), imports the sample into the project and loads it; `volume` (0-1, 0.85 = 0 dB) and\n `panning` set the pad\'s chain mixer. Every path is checked first; a pad that fails later\n carries `error` in its entry while the others are built (Live cannot delete a chain, so a\n created chain stays). Need the paths? `sample_search {query:"808 kick"}` first.\n- Samples go into the project: `device_insert {device_name:"Simpler", sample_path}` and\n `drum_kit_build` copy the file into the Live project by default and load the copy\n (`imported_path`), so the set keeps working when moved; `import_into_project:false` loads the\n original. `simpler_replace_sample` loads the file as it is unless you pass\n `import_into_project:true` \u2014 do pass it.\n\n## Copying, moving and presets (lossy)\n\n- Live\'s API cannot move, reorder or copy devices. `device_copy {device_id, track_name |\n target_id, index?}` inserts a fresh built-in device of the same name and copies its parameter\n values by name (a Simpler also gets its sample). `move:true` deletes the original afterwards:\n "move the compressor before the EQ" = `device_copy {device_id:<comp>, index:<EQ\'s index>,\n move:true}` (target omitted = the same track or chain; `index` counts the current devices).\n- It is lossy and you must say so: automation, modulation and MIDI/macro mappings, a custom\n device name and any state that is not a parameter are lost, and the device gets a new id\n (the old one is gone after a move). Racks are refused (use `device_duplicate` in place). If\n some values could not be copied (`not_copied`), a move keeps the original.\n- If the user renamed the device in Live, pass the built-in name as `device_name`.\n- Presets: `device_preset_save {name, track_name, device}` stores the parameter values (and a\n Simpler\'s sample path) as JSON in the extension\'s storage directory; `device_preset_load\n {name, track_name}` inserts the device with those values (add `device` or `device_id` to\n load onto an existing one); `device_preset_list` shows them. These are this server\'s\n snapshots, not Live presets (`.adv`): no automation, mappings or other device state.\n\n## Mixing\n\n- `mixer_set {track_name | target_id, volume?, panning?, sends?}` sets levels in one call (one\n undo step). Volume is normalized 0\u20131 (0.85 = 0 dB unity, 1.0 = +6 dB), panning -1..1.\n- Sends are addressed by `index` (aligned with the return tracks) or `return_name`:\n `sends:[{return_name:"A-Reverb", value:0.3}]`.\n- Many mixers at once, still one undo step: `targets:[{track_name:"Bass"}, {track_name:"Keys"}]`\n (same values), `items:[{track_name, volume}, ...]` (own values), or\n `all_tracks:true, exclude:[{track_name:"Vocals"}]` (every regular track but those).\n With `all_tracks`, volume is only set on the top-most tracks: a group covers its tracks\n (they keep their volume, so it is not changed twice); panning and sends are set on every\n track, grouped ones included (a grouped track\'s sends go straight to the returns), and a\n covered track then says `volume_skipped`. Tracks inside an excluded group are left alone,\n and a group holding an excluded track is skipped while its other tracks are set. The\n result\'s `skipped` says why.\n- There is no relative or dB setting: read the current values with `mixer_get` first if the\n user asks for "3 dB quieter", and say that the dB mapping is approximate.\n- `mixer_get` returns the same values with parameter ids (for `parameter_set` automation).\n\n## Audio\n\n- Audio clips: `clip_create {type:"audio", file_path:"/abs/path.wav", ...}` \u2014 the file is\n imported into the project automatically (keep `import_into_project: true`).\n- Warping: `clip_set {warping, warp_mode}` \u2014 modes: Beats, Tones, Texture, Repitch, Complex,\n ComplexPro. For all clips of a track: `clip_set {select:{track_name:"Drums"}, warping:true,\n warp_mode:"ComplexPro"}`.\n- `render_track_audio` renders the pre-FX audio of an audio track (its clip audio before the\n device chain: no effects, mixer or sends) to a WAV or AIFF file (Live\'s Record File Type\n setting decides) and returns the path \u2014 useful for\n analysis or resampling. Since Live 12.4.15 the render is not normalized. The file lives in\n the extension\'s temp directory, which may be cleaned: `persist:true` copies it into the\n project (`imported_path`; or `import_file` it, or `clip_create` with it).\n- "Is this take clipping / silent / where is it loud?": `render_track_audio {track_name, start_time,\n end_time, analyze:true}` returns `analysis` read from the render: `file_type` (`wav` or\n `aiff`), `peak_dbfs` and `rms_dbfs`\n (overall and per channel; `null` = digital silence), `clipped_samples` (at or over 0 dBFS),\n `silent` (peak below -80 dBFS) and a 32-part `envelope` of peak and RMS dBFS. Pre-FX: it\n measures the clips, not the track\'s output after its devices and fader (there is no metering).\n `tracks:[...]` renders and analyzes several audio tracks over the same range.\n- Consolidating a comp or a stretch of clips: `audio_track_consolidate {track_name, start_time,\n end_time, name?, color?}` renders the range pre-FX, imports the render, clears the range and\n puts one unwarped clip there (it then plays at the current tempo only). Destructive: confirm\n first. The device chain stays on the track.\n- Finding files: `sample_search {query:"kick 808", extensions?, roots?, limit?}` searches the\n `sample_roots` of the extension\'s config.json plus Live\'s User Library and Factory Packs\n folders (when they exist) \u2014 read-only, and nothing outside those folders. With no folder it\n returns a `hint`: tell the user to add `"sample_roots": ["/path/to/samples"]` to config.json.\n\n## Song structure\n\n- Tempo: `song_set {tempo}` (BPM; the only song-level property Live lets extensions write).\n- Scenes: `scene_create {items:[{name:"Intro"}, {name:"Verse"}, {name:"Chorus"}]}` appends\n them in order (an entry\'s `index` refers to the list after the previous entries).\n `scene_duplicate {scene_name}` duplicates a scene; the copy lands right after the original.\n- Locators: `cue_point_create {items:[{time:0, name:"Intro"}, {time:32, name:"Verse"}]}`.\n- Moving a locator: `cue_point_set {cue_point_id, time}`. Live cannot change a cue point\'s\n time, so it is re-created at the new time with its name and the old one is deleted: use the\n returned `id` from then on (`replaced_id` is the old, now invalid one). A move onto a beat\n that already has a cue point is refused.\n- Copying clips: `clip_copy {clip_id, track_name, start_time}` (arrangement), `{clip_id,\n track_name, scene_name}` (an empty session slot) or `{clip_id, target_id:<take lane>,\n start_time}`; `move:true` deletes the source afterwards; `duration` makes it longer (the loop\n repeats). Live\'s API has no clip copy: the copy is a new clip with a new id. MIDI notes are\n re-based to where the source plays them (`fidelity:"notes"`), so an arrangement copy plays the\n same. A session copy loops its whole length: when the source starts before its loop, or the\n copy is not whole loops, it repeats differently and `lost` says so \u2014 tell the user; audio\n copies keep the file, warping and markers but Live warps them itself\n (`fidelity:"approximate"`, check `warp_markers_match` and `differs`). Clip envelopes, groove\n and launch settings are never copied (`lost`) \u2014 say so.\n- "Repeat the chorus" / "copy bars 9-16 to bar 33": `arrangement_copy_range {start_time:32,\n end_time:64, to_time:128, tracks?, include_cue_points?}`. It OVERWRITES the target range on\n every selected track (cleared first, also where the source is empty); nothing after it moves\n (the API cannot insert time). MIDI clips crossing the source edges are trimmed; audio clips\n crossing them are skipped and listed in `skipped` \u2014 tell the user. Take-lane clips are not\n copied. Confirm with the user before overwriting a range that holds clips.\n\n## Interacting with the user in Live\n\n- `show_dialog` opens a modal dialog in Live; it blocks Live\'s UI until the user closes it, so\n use it sparingly: to confirm a destructive bulk edit, ask for a few values, or show a summary.\n- Prefer a `form`: the server builds the page (all text escaped) and answers as JSON.\n `show_dialog {form:{title:"Delete 12 clips?", message:"On Drums and Perc.\\nUndo restores them.",\n choices:["Delete", "Keep"]}, wait:false}` \u2192 `dialog_result {dialog_id}` \u2192 `{status:"closed",\n choice:"Delete", choice_index:0}`. Fields (`text`, `textarea`, `number`, `checkbox`, `select`\n with `options`; `name`, `label?`, `default?`) come back in `values` by name, with every button\n (number: a number or null). Default buttons: OK, or OK and Cancel with fields. Act only on the\n choice the user made; `choice: null` means the dialog closed without a button.\n- Waiting: by default `show_dialog` returns when the dialog closes, but the client\'s request\n timeout (often 60 s) can end the call first while the dialog stays open. For anything the user\n has to think about, pass `wait:false` and poll `dialog_result {dialog_id, wait_s}` (\u2264 50 s;\n `timed_out:true` = still open: call again). After a cut-off call, `dialog_result` without an id\n returns the last dialog\'s answer. Answers are kept 10 minutes.\n- One dialog at a time: while one is open, `show_dialog` is refused with its `dialog_id` \u2014 get\n its answer instead. Only when the user says it is closed already, retry with `force:true`.\n- Own pages: `html` (it must post `close_and_send` itself, see the tool description) or `url`\n (https:, file: or http://localhost) return the page\'s string as `result`. Dialogs keep no\n state between calls: each one starts from what you pass. Live cannot close a dialog from code.\n\n## What is NOT possible\n\nThe Extensions API (1.0.0) has no access to:\n\n- transport (play/stop/record), song position, clip or scene launching;\n- reading the user\'s selection or focused object directly (only the "MCP: Use as selection"\n context-menu handoff);\n- the song length (`arrangement_get` derives `song_end` from the clips);\n- the browser, third-party plug-ins, Live\'s own device presets (`.adv`/`.adg`) \u2014 the\n `device_preset_*` tools keep this server\'s JSON snapshots instead;\n- moving, reordering or renaming devices (`device_copy` emulates move/reorder, lossily);\n- automation envelopes, modulation, MIDI/macro mapping;\n- track color, routing and sidechain sources, MIDI routing;\n- reordering or grouping tracks, creating return tracks;\n- metering (no level readouts; `render_track_audio {analyze:true}` measures an audio track\'s\n clips pre-FX, not its output);\n- editing clip start/end markers or loop positions after creation (a MIDI clip\'s loop can\'t\n be set even at creation) \u2014 `clip_copy` re-bases a MIDI clip\'s notes instead;\n- copying, moving or trimming clips natively (`clip_copy` / `arrangement_copy_range` create new\n clips) and inserting time into the arrangement;\n- the song time signature (scenes report theirs, read-only).\n\nDon\'t pretend otherwise or improvise workarounds \u2014 tell the user when asked.\n\n## Destructive operations\n\n`track_delete`, `scene_delete`, `clip_delete`, `cue_point_delete`, `device_delete`,\n`midi_clip_set_notes` (mode `replace`), `midi_clip_edit_notes` (with `delete`),\n`track_clear_clips_in_range`, `simpler_replace_sample` (discards the current sample),\n`device_copy` and `clip_copy` with `move` (delete the original; lossy), `device_preset_load` onto a\nSimpler and `drum_kit_build` on existing pads (replace their samples), `arrangement_copy_range`\n(overwrites its target range) and `audio_track_consolidate` (clears its range) change the user\'s\nproject (each step is undoable in Live). `execute_command` runs arbitrary Live commands, other\nextensions\' included, so it is destructive and open-world too.\n`device_preset_save` with `overwrite` replaces a saved preset file. `track_delete` and `scene_delete`\nby name need the exact name, so a case-insensitive guess can\'t delete the wrong object. They carry the MCP\n`destructiveHint` annotation; read-only tools carry `readOnlyHint`. For bulk destructive edits\nthe user didn\'t explicitly enumerate, confirm first \u2014 in Live with a `show_dialog` form\n(see [Interacting with the user in Live](#interacting-with-the-user-in-live)) or in the chat.\n`batch` carries `destructiveHint` too (it runs whatever its steps do); `batch_read` is read-only.\n';var f1=new Map;function Y(e){let t=e.handle.id.toString();return f1.set(t,e),t}function st(e,t){let n=f1.get(e);if(!n)throw new Error(`Unknown object id "${e}". Ids are discovered via listing tools (song_get, track_get, device_get, ...) \u2014 call one of those first.`);if(!(n instanceof t))throw new j(`Object "${e}" is a ${n.constructor.className??n.constructor.name}, expected ${t.className??t.name}.`);return n}function dt(e){return e.constructor.className??e.constructor.name}function q(e){return typeof e=="bigint"?Number(e):e}function YV(e){return`#${(q(e)&16777215).toString(16).padStart(6,"0")}`}function iu(e){let t=/^#?([0-9a-fA-F]{6})$/.exec(e);if(!t)throw new j(`Invalid color "${e}", expected "#RRGGBB".`);return parseInt(t[1],16)}var QV=["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"],eq={c:0,d:2,e:4,f:5,g:7,a:9,b:11},tq=/^([a-g])([#♯b♭]{0,2})(-?\d+)?$/i;function fh(e){let t=q(e);return`${QV[(t%12+12)%12]}${Math.floor(t/12)-2}`}function h1(e){let t=tq.exec(e.trim());if(!t)return null;let n=[...t[2]].reduce((i,r)=>i+(r==="#"||r==="\u266F"?1:-1),0);return{semitone:eq[t[1].toLowerCase()]+n,octave:t[3]}}function Ai(e,t="pitch"){if(typeof e=="number")return e;let n=e.trim(),i=NaN;if(/^\d+$/.test(n))i=Number(n);else{let r=h1(n);r?.octave!==void 0&&(i=(Number(r.octave)+2)*12+r.semitone)}if(Number.isNaN(i))throw new j(`${t}: ${JSON.stringify(e)} is not a MIDI pitch: give 0-127 or a note name such as "C3" (= 60), "F#1" or "Bb2".`);if(i<0||i>127)throw new j(`${t}: ${JSON.stringify(e)} is outside the MIDI range (C-2 = 0 to G8 = 127).`);return i}function Ss(e,t="root"){if(typeof e=="number")return e;let n=h1(e);if(!n)throw new j(`${t}: ${JSON.stringify(e)} is not a note: give 0-11 (C = 0) or a name such as "D" or "F#".`);return(n.semitone%12+12)%12}function rq(e){return e instanceof Wr?"audio":e instanceof Xr?"midi":"other"}function ou(e,t){return{id:Y(e),type:t??rq(e),name:e.name,mute:e.mute,solo:e.solo,arm:e.arm,muted_via_solo:e.mutedViaSolo,group_track_id:e.groupTrack?Y(e.groupTrack):null,device_count:e.devices.length,clip_slot_count:e.clipSlots.length,arrangement_clip_count:e.arrangementClips.length}}function dr(e,t=!1){let n={id:Y(e),class:dt(e),name:e.name,color:YV(e.color),muted:e.muted,looping:e.looping,start_time:q(e.startTime),end_time:q(e.endTime),duration:q(e.duration),start_marker:q(e.startMarker),end_marker:q(e.endMarker),loop_start:q(e.loopStart),loop_end:q(e.loopEnd)};return e instanceof Jt?t&&(n.note_count=e.notes.length):e instanceof Ht&&(n.file_path=e.filePath,n.warping=e.warping,n.warp_mode=_u[q(e.warpMode)],t&&(n.warp_markers=e.warpMarkers.map(i=>({sample_time:q(i.sampleTime),beat_time:q(i.beatTime)})))),n}function hh(e,t=!1){return{id:Y(e),class:dt(e),name:e.name,duration:q(e.duration),muted:e.muted,looping:e.looping,start_time:t?q(e.startTime):void 0,end_time:t?q(e.endTime):void 0}}function g1(e,t){let n=e.clip;return{id:Y(e),scene_index:t,clip:n?dr(n):null}}function gh(e){return{id:Y(e),name:e.name,clips:e.clips.map(t=>dr(t))}}function pr(e){let t={id:Y(e),class:dt(e),name:e.name,parameter_count:e.parameters.length};if(e instanceof Gt&&(t.chain_ids=e.chains.map(n=>Y(n)),t.is_drum_rack=e instanceof ni),e instanceof Tr){let n=e.sample;t.sample=n?{id:Y(n),file_path:n.filePath}:null}return t}function vh(e,t=!0){return{id:Y(e),name:e.name,min:q(e.min),max:q(e.max),default_value:q(e.defaultValue),is_quantized:e.isQuantized,value_items:t&&e.isQuantized?e.valueItems.map((n,i)=>({index:i,name:n.name,short_name:n.shortName})):void 0}}async function Ni(e,t=!0){let n=vh(e,t),i=q(await e.getValue()),r=n.value_items??(n.is_quantized?e.valueItems:[]);return{...n,value:i,value_item:r[i]?.name}}function Mi(e){let t={id:Y(e),class:dt(e),device_count:e.devices.length};if(e instanceof Yr){let n=q(e.receivingNote);t.receiving_note=n,t.receiving_note_name=fh(n)}return t}function Li(e,t){return{id:Y(e),index:t,name:e.name,tempo:q(e.tempo),signature:`${q(e.signatureNumerator)}/${q(e.signatureDenominator)}`}}function Ui(e){return{id:Y(e),name:e.name,time:q(e.time)}}function Hw(e){return rx[q(e)]}var gt=(e,t)=>`\`${e} ${JSON.stringify(t)}\``,xr=e=>JSON.stringify(e),Yw=e=>e.map((t,n)=>`${n+1}. ${t}`).join(`
|
|
158
|
+
`);function tr(e,t){if(!t)return y.string().optional().describe(e);let n=i=>t(i??"");return bw(bw(y.string(),n).optional().describe(e),n)}var v1=8e3;function $1(e,t,n){for(let[i,r]of Object.entries(t))if(typeof r=="string"&&r.length>v1)throw new j(`${i}: at most ${v1} characters, got ${r.length}.`);return e.render(t,n)}var _h=e=>t=>e.filter(n=>n.toLowerCase().startsWith(t.trim().toLowerCase()));function Is(e,t,n,i,r){if(e===void 0||!e.trim())return r;let o=Number(e.trim());if(!Number.isInteger(o)||o<n||o>i)throw new j(`${t}: expected a whole number from ${n} to ${i}, got ${xr(e)}.`);return o}function Ww(e,t,n,i){if(e===void 0||!e.trim())return;let r=Number(e.trim());if(!Number.isFinite(r)||r<n||r>i)throw new j(`${t}: expected a number from ${n} to ${i}, got ${xr(e)}.`);return r}var Ts=(e,t)=>Object.hasOwn(e,t)?e[t]:void 0,w1=(e,t)=>e?.trim()?e.trim():t,k1=e=>e.split(/[,;\n]+/).map(t=>t.trim()).filter(Boolean);function x1(e){let t=e.lastIndexOf(":"),n=t<0?"":e.slice(t+1).trim();return t<0||/\s/.test(n)?[e.trim(),void 0]:[e.slice(0,t).trim(),n]}var S1="Live inserts a new track after the selected one, so go by the returned `index`/`id`, not by position",I1='`scene_index` 0 is the first scene: use an empty slot (`session_grid` shows them), or for the arrangement replace scene_index with "start_time": <beat>',y1="Intro:8, Verse:16, Chorus:16, Verse:16, Chorus:16, Outro:8",T1=8;function nq(e){let t=k1(e).map(n=>{let[i,r]=x1(n);if(!i||i.length>100)throw new j(`sections: ${xr(n)} needs a name of 1-100 characters, e.g. "Verse:16".`);let o=Is(r,`sections: the bars of ${xr(i)}`,1,512,T1);return{name:i,bars:o}});if(!t.length)throw new j('sections: give at least one, e.g. "Intro:8, Verse:16".');if(t.length>64)throw new j(`sections: at most 64, got ${t.length}.`);return t}function iq(e){return k1(e).map(t=>{let[n,i]=x1(t),r=(i??"midi").toLowerCase();if(!n||n.length>100)throw new j(`tracks: ${xr(t)} needs a name of 1-100 characters.`);if(r!=="midi"&&r!=="audio")throw new j(`tracks: the type of ${xr(n)} is "midi" or "audio", got ${xr(r)}.`);return{name:n,type:r}})}var oq={name:"song_skeleton",title:"Song skeleton",description:"Lay out a song's sections: one scene and one arrangement locator per section (positions computed from the bar counts), optionally the tempo and empty tracks.",tools:["song_get","song_set","scene_create","cue_point_create","track_create","session_grid","arrangement_get"],args:()=>({sections:tr(`Sections in order, comma-separated, each "name" or "name:bars" (${T1} bars without a count); default "${y1}"`),tempo:tr("Tempo in BPM (20-999); default: keep the current tempo"),beats_per_bar:tr("Beats per bar for the positions (1-32); default 4"),tracks:tr('Tracks to create, comma-separated, each "name" (MIDI) or "name:midi" / "name:audio"; default none')}),render(e){let t=nq(e.sections?.trim()?e.sections:y1),n=Ww(e.tempo,"tempo",20,999),i=Is(e.beats_per_bar,"beats_per_bar",1,32,4),r=e.tracks?.trim()?iq(e.tracks):[],o=0,a=t.map(l=>{let u={...l,time:o*i,end:(o+l.bars)*i,bar:o+1};return o+=l.bars,u}),s=o*i,c=[`Read the set: ${gt("song_get",{include:["tracks","scenes","cue_points"]})}. If it already has scenes or locators with these names, or locators at these positions, tell the user and ask whether to add the new ones anyway, rename or skip them. Never delete anything without asking.`,n!==void 0?`Set the tempo: ${gt("song_set",{tempo:n})}.`:"Keep the current tempo; if the user names one, set it with `song_set`.","Create the scenes in one call (they are appended after the existing ones, in this order): "+gt("scene_create",{items:a.map(l=>({name:l.name}))}),"Mark the sections in the arrangement in one call: "+gt("cue_point_create",{items:a.map(l=>({time:l.time,name:l.name}))})];return r.length&&c.push(`Create the tracks, one call each (${S1}):
|
|
159
|
+
`+r.map(l=>` - ${gt("track_create",{type:l.type,name:l.name})}`).join(`
|
|
160
|
+
`)),c.push(`Check the result: ${gt("session_grid",{})} and ${gt("arrangement_get",{start_time:0,end_time:s})}, then tell the user what was created, with the positions in bars.`),[`Build a song skeleton in the open Ableton Live Set with the ableton-live tools: one scene and one arrangement locator per section${r.length?", and the tracks listed below":""}.`,"",`Sections (positions in beats at ${i} beats per bar; Live's API cannot read or set the song's time signature, so check that it matches):`,...a.map((l,u)=>`${u+1}. ${l.name}: ${l.bars} bars from bar ${l.bar}, beats ${l.time}-${l.end}`),`Total: ${o} bars = ${s} beats.`,...r.length?["",`Tracks: ${r.map(l=>`${l.name} (${l.type})`).join(", ")}.`]:[],"","Steps:",Yw(c),"","Then offer to fill the sections: clips with notes or drum patterns (clip_create), copies (clip_copy, arrangement_copy_range)."].join(`
|
|
161
|
+
`)}},Jw={"":[0,4,7],maj:[0,4,7],M:[0,4,7],m:[0,3,7],min:[0,3,7],dim:[0,3,6],"\xB0":[0,3,6],o:[0,3,6],aug:[0,4,8],"+":[0,4,8],sus2:[0,2,7],sus4:[0,5,7],sus:[0,5,7],6:[0,4,7,9],m6:[0,3,7,9],7:[0,4,7,10],maj7:[0,4,7,11],M7:[0,4,7,11],m7:[0,3,7,10],min7:[0,3,7,10],mMaj7:[0,3,7,11],mM7:[0,3,7,11],dim7:[0,3,6,9],"\xB07":[0,3,6,9],o7:[0,3,6,9],m7b5:[0,3,6,10],\u00F8:[0,3,6,10],\u00F87:[0,3,6,10],aug7:[0,4,8,10],"+7":[0,4,8,10],"7sus4":[0,5,7,10],add9:[0,4,7,14],madd9:[0,3,7,14],9:[0,4,7,10,14],maj9:[0,4,7,11,14],m9:[0,3,7,10,14]},Xw={major:[0,2,4,5,7,9,11],minor:[0,2,3,5,7,8,10],dorian:[0,2,3,5,7,9,10],phrygian:[0,1,3,5,7,8,10],lydian:[0,2,4,6,7,9,11],mixolydian:[0,2,4,5,7,9,10],locrian:[0,1,3,5,6,8,10],"harmonic minor":[0,2,3,5,7,8,11],"melodic minor":[0,2,3,5,7,9,11]},aq={"":"major",maj:"major",ionian:"major",m:"minor",min:"minor",aeolian:"minor"},sq=["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"],cq=["C","Db","D","Eb","E","F","Gb","G","Ab","A","Bb","B"],au=(e,t)=>(t?cq:sq)[(e%12+12)%12],_1=(e,t)=>`${au(e,t)}${Math.floor(e/12)-2}`,lq=new Set([5,10,3,8,1]),uq=new Set([2,7,0,5,10,3]);function bh(e,t,n=""){return n==="b"||n==="\u266D"?!0:n==="#"||n==="\u266F"?!1:(t.includes(3)&&!t.includes(4)?uq:lq).has(e)}function z1(e){let t=/^([A-Ga-g])([#b♯♭]?)([^]*)$/.exec(e.trim()),n=t?t[3].trim():"",i=n==="M"?"major":Ts(aq,n.toLowerCase())??n.toLowerCase().replace(/\s+/g," "),r=Ts(Xw,i);if(!t||!r)throw new j(`key: ${xr(e)} is not a key: give a root and a mode, e.g. "C major", "A minor", "F#m" or "D dorian" (modes: ${Object.keys(Xw).join(", ")}).`);let o=Ss(t[1].toUpperCase()+t[2],"key"),a=bh(o,r,t[2]);return{root:o,intervals:r,name:`${au(o,a)} ${i}`,flats:a}}function dq(e){let t=e.scale();if(!t)return{key:z1("C major"),note:"Live's scale could not be read, so C major is assumed"};let n=[...new Set(t.intervals.map(s=>(s%12+12)%12))].sort((s,c)=>s-c),i=bh(t.root,n),r=`${au(t.root,i)} ${t.name}`;if(n.length===7)return{key:{root:t.root,intervals:n,name:r,flats:i},note:"Live's current scale"};let o=n.includes(3)&&!n.includes(4)?"minor":"major";return{key:{root:t.root,intervals:Xw[o],name:`${au(t.root,i)} ${o}`,flats:i},note:`Live's current scale is ${r}, not a 7-note scale: its ${o} scale is used`}}var pq=["i","ii","iii","iv","v","vi","vii"];function mq(e,t){return/^(°|o|dim)$/.test(t)?"dim":/^(°|o|dim)7$/.test(t)?"dim7":/^(ø7?|m7b5)$/.test(t)?"m7b5":/^(\+|aug)$/.test(t)?"aug":/^(\+|aug)7$/.test(t)?"aug7":!e||t.startsWith("sus")?t:Ts({"":"m",7:"m7",maj7:"mMaj7",M7:"mMaj7",6:"m6",9:"m9",add9:"madd9"},t)}var Gw=e=>e==="#"||e==="\u266F"?1:e==="b"||e==="\u266D"?-1:0;function fq(e,t){let n=/^([b#♭♯]?)(VII|VI|V|IV|III|II|I|vii|vi|v|iv|iii|ii|i)([^/]*)$/.exec(e);if(n){let o=n[2]===n[2].toLowerCase(),a=mq(o,n[3]),s=a===void 0?void 0:Ts(Jw,a);if(s){let c=t(),l=pq.indexOf(n[2].toLowerCase()),u=(c.root+c.intervals[l]+Gw(n[1])+12)%12,p=n[1]?bh(u,[],n[1]):c.flats;return{label:e,name:au(u,p)+a,root:u,intervals:s,flats:p}}}let i=/^([A-G])([#b♯♭]?)([^/]*)(?:\/([A-G])([#b♯♭]?))?$/.exec(e),r=i?Ts(Jw,i[3]):void 0;if(i&&r){let o=(Ss(i[1])+Gw(i[2])+12)%12,a=i[4]?(Ss(i[4])+Gw(i[5])+12)%12:void 0;return{label:e,name:e,root:o,intervals:r,bass:a,flats:bh(o,r,i[2])}}throw new j(`progression: ${xr(e)} is not a chord this prompt knows: use Roman numerals (I, ii7, V7, bVII, vii\xB0, IVmaj7) or chord names (Am, F, C7, Gmaj7, F#m7b5, Bdim, Esus4, C/E). Qualities: ${Object.keys(Jw).filter(Boolean).join(", ")}.`)}function hq(e,t,n){let i=s=>s.intervals.map(c=>12*(t+2)+s.root+c),r=s=>s.reduce((c,l)=>c+l,0)/s.length,o=s=>s.every(c=>c>=0&&c<=127),a=r(i(e[0]));return e.map(s=>{let c=i(s);if(n==="close"){let l;for(let u=0;u<c.length;u++)for(let p of[0,-12,12,-24,24]){let h=c.map((g,_)=>g+p+(_<u?12:0)).sort((g,_)=>g-_);o(h)&&(!l||Math.abs(r(h)-a)<Math.abs(r(l)-a)-1e-9)&&(l=h)}c=l??c}if(s.bass!==void 0){let l=Math.min(...c);c=[l-(((l-s.bass)%12+12)%12||12),...c]}if(!o(c))throw new j(`octave ${t} puts ${s.label} outside the MIDI range 0-127: choose another octave.`);return c})}var b1="I-V-vi-IV",yh="Drift",gq=90,vq={name:"chord_progression",title:"Chord progression",description:"Write a chord progression as one MIDI clip: Roman numerals in a key (default Live's current scale) or chord names, voiced and timed by the server, with the exact clip_create call.",tools:["song_get","track_create","device_insert","session_grid","clip_create","midi_clip_get_notes","midi_clip_edit_notes"],args:e=>({progression:tr(`Chords in order, separated by spaces, commas or dashes: Roman numerals in the key (I V vi IV, ii7 V7 Imaj7, bVII, vii\xB0) or chord names (Am F C G, Cmaj7, F#m7b5, C/E); default "${b1}"`),key:tr(`Key of the Roman numerals, e.g. "C major", "A minor", "F#m", "D dorian"; default Live's current scale`),bars_per_chord:tr("Bars each chord lasts (1-16); default 1"),beats_per_bar:tr("Beats per bar (1-32); default 4"),octave:tr("Octave of the voicing in Live's naming, C3 = 60 (-1 to 7); default 3"),voicing:tr("close (default): each chord in the inversion nearest the first one, so voices move little; root: root position",_h(["close","root"])),track:tr('MIDI track for the clip; default a new track "Chords"',t=>_h(e.trackNames())(t))}),render(e,t){let i=(e.progression?.trim()?e.progression:b1).split(/[\s,|–—-]+/).filter(Boolean);if(!i.length||i.length>64)throw new j(`progression: give 1-64 chords, got ${i.length}.`);let r=Is(e.beats_per_bar,"beats_per_bar",1,32,4),o=Is(e.bars_per_chord,"bars_per_chord",1,16,1)*r,a=Is(e.octave,"octave",-1,7,3),s=(e.voicing?.trim()||"close").toLowerCase();if(s!=="close"&&s!=="root")throw new j(`voicing: "close" or "root", got ${xr(e.voicing??"")}.`);let c,l=()=>(c??=e.key?.trim()?{key:z1(e.key),note:"as given"}:dq(t)).key,u=i.map(z=>fq(z,l));e.key?.trim()&&l();let p=hq(u,a,s),h=w1(e.track,"Chords"),g=i.join("-"),_=p.flatMap((z,S)=>z.map(A=>({pitch:_1(A,u[S].flats),start_time:S*o,duration:o,velocity:gq}))),k={type:"midi",track_name:h,scene_index:0,duration:u.length*o,name:g.length>60?`${g.slice(0,57)}...`:g,notes:_},T=e.track?.trim()?`Use the MIDI track ${xr(h)}. If there is none, create it: ${gt("track_create",{type:"midi",name:h,devices:[yh]})}. If it has no instrument, add one: ${gt("device_insert",{track_name:h,device_name:yh})}.`:`Create a track for the chords: ${gt("track_create",{type:"midi",name:h,devices:[yh]})} (${S1}). If a track named ${xr(h)} exists already, use another name here and below.`;return["Write a chord progression into the open Ableton Live Set with the ableton-live tools.","",c?`Key: ${c.key.name} (${c.note}).`:"Key: none needed (chord names).",`Chords (${o} beats each; MIDI note names with C3 = 60, ${s} voicing):`,...u.map((z,S)=>`${S+1}. ${z.label===z.name?z.name:`${z.label} = ${z.name}`}: ${p[S].map(A=>_1(A,z.flats)).join(" ")} (beat ${S*o})`),"","Steps:",Yw([`Read the tracks: ${gt("song_get",{include:["tracks","devices"]})}. ${T} ${yh} is in every Live 12 edition; if it is reported in \`errors\`, ask the user which instrument to use.`,`Find an empty clip slot: ${gt("session_grid",{tracks:[{track_name:h}]})}.`,`Create the clip with all its notes in one call (${I1}):
|
|
162
|
+
${gt("clip_create",k)}`,`Check it: ${gt("midi_clip_get_notes",{clip_id:"<id of the new clip>",format:"compact"})}, then tell the user the chords and where the clip is.`]),"","On request: a looser feel with "+gt("midi_clip_edit_notes",{clip_id:"<id of the new clip>",humanize:{timing:.01,velocity:8}})+"; another rhythm or voicing means a new notes list."].join(`
|
|
163
|
+
`)}},Zi={kick:{note:"C1",label:"Kick",query:"kick"},snare:{note:"D1",label:"Snare",query:"snare"},clap:{note:"D#1",label:"Clap",query:"clap"},closed_hat:{note:"F#1",label:"Closed hat",query:"hat closed"},open_hat:{note:"A#1",label:"Open hat",query:"hat open"}},P1={house:{tempo:124,lines:[{pad:"kick",steps:"x...|x...|x...|x..."},{pad:"clap",steps:"....|x...|....|x..."},{pad:"closed_hat",steps:"xx.x|xx.x|xx.x|xx.x",velocity:60},{pad:"open_hat",steps:"..x.|..x.|..x.|..x.",velocity:90}]},techno:{tempo:130,lines:[{pad:"kick",steps:"x...|x...|x...|x..."},{pad:"clap",steps:"....|x...|....|x..."},{pad:"closed_hat",steps:"xxxx|xxxx|xxxx|xxxx",velocity:55},{pad:"open_hat",steps:"..x.|..x.|..x.|..x.",velocity:85}]},hip_hop:{tempo:90,swing:.55,lines:[{pad:"kick",steps:"x...|...x|..x.|...."},{pad:"snare",steps:"....|x...|....|x..."},{pad:"closed_hat",steps:"x.x.|x.x.|x.x.|x.x.",velocity:80}]},trap:{tempo:140,lines:[{pad:"kick",steps:"x...|...x|.x..|...."},{pad:"clap",steps:"....|....|x...|...."},{pad:"closed_hat",steps:"x.x.|x.x.|x.x.|xxxx",velocity:75}]},dnb:{tempo:174,lines:[{pad:"kick",steps:"x...|....|..x.|...."},{pad:"snare",steps:"....|x...|....|x..."},{pad:"closed_hat",steps:"x.x.|x.x.|x.x.|x.x.",velocity:75}]},breakbeat:{tempo:136,lines:[{pad:"kick",steps:"x.x.|....|..xx|...."},{pad:"snare",steps:"....|X..x|.x..|X..x",velocity:90},{pad:"closed_hat",steps:"x.x.|x.x.|x.x.|x.x.",velocity:70}]},rock:{tempo:120,lines:[{pad:"kick",steps:"x...|....|x.x.|...."},{pad:"snare",steps:"....|x...|....|x..."},{pad:"closed_hat",steps:"x.x.|x.x.|x.x.|x.x.",velocity:80}]},reggaeton:{tempo:95,lines:[{pad:"kick",steps:"x...|x...|x...|x..."},{pad:"snare",steps:"...x|..x.|...x|..x."},{pad:"closed_hat",steps:"x.x.|x.x.|x.x.|x.x.",velocity:70}]}},Kw=Object.keys(P1),yq={name:"drum_beat",title:"Drum beat",description:"Program a drum beat in a style (house, techno, hip_hop, trap, dnb, breakbeat, rock, reggaeton): the kit from sample_search + drum_kit_build when the pads are empty, then one clip_create with step patterns.",tools:["song_get","track_create","sample_search","drum_kit_build","song_set","clip_create","midi_clip_edit_notes","midi_clip_set_notes"],args:e=>({style:tr(`One of ${Kw.join(", ")}; default house`,_h(Kw)),bars:tr("Clip length in bars (1-64), the one-bar pattern repeated; default 2"),track:tr('MIDI track for the beat; default "Drums"',t=>_h(e.trackNames())(t)),tempo:tr("Tempo to set in BPM (20-999); default: suggest the style's usual tempo"),swing:tr("Swing amount 0-1 (0 = straight, about 0.67 = triplet feel); default the style's (hip_hop 0.55)")}),render(e){let t=(e.style?.trim()||"house").toLowerCase().replace(/[\s-]+/g,"_"),n=t.replace("_"," "),i=Ts(P1,t);if(!i)throw new j(`style: one of ${Kw.join(", ")}, got ${xr(e.style??"")}.`);let r=Is(e.bars,"bars",1,64,2),o=Ww(e.tempo,"tempo",20,999),a=Ww(e.swing,"swing",0,1)??i.swing,s=w1(e.track,"Drums"),c=[...new Set(i.lines.map(p=>p.pad))],l={type:"midi",track_name:s,scene_index:0,duration:r*4,name:`${n} beat`,repeat:{length:4},patterns:i.lines.map(p=>({note:Zi[p.pad].note,steps:p.steps,...p.velocity?{velocity:p.velocity}:{}}))},u=[`Find the drum track: ${gt("song_get",{include:["tracks","devices"]})}. If there is no MIDI track named ${xr(s)}, create it: ${gt("track_create",{type:"midi",name:s})} (if a track that is not a MIDI track has that name, pick another name and use it below).`,`Make sure the pads have sounds. If the track has no Drum Rack, or the pads ${c.map(p=>Zi[p].note).join(", ")} hold no samples, find one sample per pad:
|
|
164
|
+
`+c.map(p=>` - ${Zi[p].label}: ${gt("sample_search",{query:Zi[p].query})}`).join(`
|
|
165
|
+
`)+`
|
|
166
|
+
Pick one file each (try a shorter query, or ask the user, when nothing fits), then build the kit in one call (it inserts the Drum Rack when there is none and imports the files into the project): `+gt("drum_kit_build",{track_name:s,pads:c.map(p=>({note:Zi[p].note,sample_path:`<${Zi[p].label.toLowerCase()} file>`}))}),o!==void 0?`Set the tempo: ${gt("song_set",{tempo:o})}.`:`${n[0].toUpperCase()}${n.slice(1)} usually runs at about ${i.tempo} BPM: suggest it, and set it with ${gt("song_set",{tempo:i.tempo})} only if the user agrees.`,`Create the clip with the whole beat in one call (${I1}):
|
|
167
|
+
${gt("clip_create",l)}`];return a&&u.push(`Swing it: ${gt("midi_clip_edit_notes",{clip_id:"<id of the new clip>",swing:{amount:a,grid:.25}})}.`),u.push('Tell the user what was created. On request: fills or extra hits with `midi_clip_set_notes` {"mode": "merge", patterns}, a looser feel with `midi_clip_edit_notes` {humanize}.'),[`Program a ${n} drum beat in the open Ableton Live Set with the ableton-live tools: ${r} bars, a one-bar pattern repeated (4/4: Live's API cannot read the song's time signature).`,"","Pattern, one bar of sixteenth steps (x = hit, X = accent, . = rest; pads by receiving note, C1 = 36):",...i.lines.map(p=>`- ${Zi[p.pad].label} (${Zi[p.pad].note}): ${p.steps}`),"","Steps:",Yw(u)].join(`
|
|
168
|
+
`)}},E1=[oq,vq,yq];var mn=1e-9,O1=1e5;function _q(e,t,n){let i=e.loopEnd-e.loopStart,r=e.endMarker-e.startMarker;if(e.looping?!(i>mn):!(r>mn))return[];let o=e.looping?Math.max(0,e.loopEnd-e.startMarker):0,a=e.looping?i:r,s=e.looping?e.loopStart:e.startMarker,c=[],l=t+n;for(let u=t;u<l-mn;){let p,h;if(u<o-mn)p=0,h=e.startMarker;else{let k=Math.floor((u-o)/a+mn);p=o+k*a,h=s}let g=u<o-mn?o:p+a,_=Math.min(l,g);if(c.length>=O1)throw new j(`The copy would repeat the clip's ${e.looping?"loop":"region"} more than ${O1} times: give a shorter length.`);c.push({clipFrom:h+(u-p),clipTo:h+(_-p),at:u-t}),u=_}return c}function j1(e,t){let n=e.loopEnd-e.loopStart;if(!e.looping||!(n>mn))return;let i=a=>`${a} beat${a===1?"":"s"}`,r=e.loopStart-e.startMarker;if(r>mn)return`the source's start before its loop: the copy loops its whole ${i(t)}, so the part before the source's loop start (its first ${i(r)}) comes back on every pass, while the source plays it once`;let o=t/n;if(Math.round(o)<1||Math.abs(o-Math.round(o))>1e-6)return`the loop length: the copy loops its whole ${i(t)}, not a whole number of the source's ${n}-beat loops, so its repeats differ from the source's`}function R1(e){return e.looping?Math.max(0,e.loopStart-e.startMarker)+(e.loopEnd-e.loopStart):e.endMarker-e.startMarker}function Qw(e,t,n,i,r){let o=[],a=e.map(s=>({pitch:Number(s.pitch),startTime:Number(s.startTime),duration:Number(s.duration),velocity:s.velocity===void 0?void 0:Number(s.velocity),muted:s.muted,probability:s.probability===void 0?void 0:Number(s.probability),velocityDeviation:s.velocityDeviation===void 0?void 0:Number(s.velocityDeviation),releaseVelocity:s.releaseVelocity===void 0?void 0:Number(s.releaseVelocity)})).filter(s=>Number.isFinite(s.startTime));a.sort((s,c)=>s.startTime-c.startTime);for(let s of _q(t,n,i)){let c=0,l=a.length;for(;c<l;){let u=c+l>>>1;a[u].startTime<s.clipFrom-mn?c=u+1:l=u}for(let u=c;u<a.length&&a[u].startTime<s.clipTo-mn;u++){let p=a[u],h=Math.min(p.duration,s.clipTo-p.startTime);if(!(h>mn))continue;if(o.length>=r)throw new j(`The copy would hold more than ${r} notes: give a shorter length.`);let g={...p,startTime:s.at+(p.startTime-s.clipFrom),duration:h};for(let _ of Object.keys(g))g[_]===void 0&&delete g[_];o.push(g)}}return o.sort((s,c)=>s.startTime-c.startTime||s.pitch-c.pitch)}var En=Sr(require("node:fs/promises"),1),ek=Sr(require("node:os"),1),kt=Sr(require("node:path"),1);var tk=[".wav",".aif",".aiff",".flac",".mp3",".ogg",".m4a"];function C1(e=ek.homedir()){let t=[];for(let n of["Music","Documents"])for(let i of["User Library","Factory Packs"])t.push({name:i,path:kt.join(e,n,"Ableton",i),source:"library"});return t}function A1(e){let t=[];if(!e)return{roots:[],problems:t};let n;try{n=JSON.parse(qw(e))}catch(o){return o.code!=="ENOENT"&&t.push(`${e} could not be read: ${o.message}`),{roots:[],problems:t}}let i=n?.sample_roots;if(i===void 0)return{roots:[],problems:t};if(!Array.isArray(i))return t.push(`sample_roots in ${e} is not a list of folder paths`),{roots:[],problems:t};let r=[];for(let o of i){if(typeof o!="string"||!o.trim()){t.push(`sample_roots entry ${JSON.stringify(o)} is not a folder path`);continue}let a=/^~(?=$|[\\/])/.test(o)?kt.join(ek.homedir(),o.slice(1)):o;if(!kt.isAbsolute(a)){t.push(`sample_roots entry ${JSON.stringify(o)} is not an absolute path`);continue}r.push({name:kt.basename(kt.resolve(a))||a,path:kt.resolve(a),source:"config"})}return{roots:r,problems:t}}function D1(e,t){let n=kt.relative(t,e);return n===""||n!==".."&&!n.startsWith(`..${kt.sep}`)&&!kt.isAbsolute(n)}async function N1(e,t){let n=Date.now(),i=[],r=[];for(let g of e){let _;try{_=await En.realpath(g.path),(await En.stat(_)).isDirectory()||(_=void 0)}catch{_=void 0}r.push({name:g.name,path:g.path,source:g.source,exists:_!==void 0}),_!==void 0&&i.push({root:g,real:_})}let o=g=>i.find(_=>D1(g,_.real)),a=[],s=new Set,c=new Set,l=0,u,p=0,h=[];for(let g of i)i.some(_=>_.real!==g.real&&D1(g.real,_.real))||h.push({dir:g.real,depth:0});e:for(;h.length;){let g=h.shift(),_=g.depth,k;try{k=await En.realpath(g.dir)}catch{continue}if(!o(k)||c.has(k))continue;if(c.add(k),Date.now()-n>t.timeLimitMs){u="time";break}if(l>=t.maxDirectories){u="directories";break}l++;let T;try{T=await En.readdir(k,{withFileTypes:!0})}catch{p++;continue}T.sort((z,S)=>z.name<S.name?-1:z.name>S.name?1:0);for(let z of T){if(z.name.startsWith("."))continue;let S=kt.join(k,z.name),A=z.isDirectory(),Q=z.isFile();if(z.isSymbolicLink())try{if(S=await En.realpath(S),!o(S))continue;let ye=await En.stat(S);A=ye.isDirectory(),Q=ye.isFile()}catch{continue}if(A){_<t.maxDepth&&h.push({dir:S,depth:_+1});continue}if(!Q||!t.extensions.includes(kt.extname(S).toLowerCase()))continue;let X=o(S);if(!X)continue;let ge=kt.relative(X.real,S).split(kt.sep).join("/");if(!(!t.terms.every(ye=>ge.toLowerCase().includes(ye))||s.has(S))){if(s.add(S),a.length>=t.limit){u="limit";break e}a.push({path:S,name:kt.basename(S),root:X.root.name,relative_path:ge})}}}return await Promise.all(a.map(async g=>{try{g.size_bytes=(await En.stat(g.path)).size}catch{}})),{roots:r,results:a,complete:u===void 0,stopped:u,directories_searched:l,unreadable_directories:p||void 0,elapsed_ms:Date.now()-n}}var bq=["AudioClip","AudioTrack","ClipSlot","DrumRack","MidiClip","MidiTrack","Sample","Scene","Simpler","ClipSlotSelection","AudioTrack.ArrangementSelection","MidiTrack.ArrangementSelection"],$q="MCP: Use as selection",wq=e=>`ableton-live-mcp.select.${e}`,rk=1e3,kq=e=>typeof e=="object"&&e!==null&&typeof e.id=="bigint",M1=e=>typeof e=="number"&&Number.isFinite(e)||typeof e=="bigint",$h=class{constructor(t){this.context=t}context;last;seq=0;waiters=new Set;latest(){return this.last}get latestSeq(){return this.last?.seq??0}capture(t,n){let i=t==="ClipSlotSelection"?"clip_slots":t.endsWith(".ArrangementSelection")?"arrangement":"object",r=[],o=typeof n=="object"&&n!==null?n:void 0,a=[],s;if(i==="object")a=Array.isArray(n)?n:[n];else{let l=o?.[i==="clip_slots"?"selected_clip_slots":"selected_lanes"];if(Array.isArray(l)?a=l:r.push(`the argument has no ${i==="clip_slots"?"selected_clip_slots":"selected_lanes"} list`),i==="arrangement"){let u=o?.time_selection_start,p=o?.time_selection_end;M1(u)&&M1(p)?s={start:Math.min(q(u),q(p)),end:Math.max(q(u),q(p))}:r.push("the argument has no numeric time_selection_start / time_selection_end")}}a.length>rk&&(r.push(`only the first ${rk} of ${a.length} selected objects were kept`),a=a.slice(0,rk));let c={seq:++this.seq,capturedAt:Date.now(),scope:t,kind:i,objects:a.map(l=>this.resolve(l)),time:s,problems:r.length?r:void 0};this.last=c,console.log(`[ableton-live-mcp] selection ${c.seq} captured from ${t}: ${c.objects.length} object(s)`);for(let l of[...this.waiters])l();return c}resolve(t){if(!kq(t))return{error:`Live passed ${t===void 0?"nothing":t===null?"null":typeof t=="object"?"an object without a bigint id":`a ${typeof t}`} where an object handle was expected`};try{let n=this.context.getObjectFromHandle(t,Ot);return{object:n,id:Y(n)}}catch(n){return{error:`Live could not resolve the object: ${n instanceof Error?n.message:String(n)}`}}}wait(t,n,i){let r=()=>this.last&&this.last.seq>t?this.last:void 0;return r()||i?.aborted?Promise.resolve(r()):new Promise(o=>{let a=()=>{clearTimeout(c),this.waiters.delete(s),i?.removeEventListener("abort",a),o(r())},s=()=>{r()&&a()},c=setTimeout(a,n);this.waiters.add(s),i?.addEventListener("abort",a,{once:!0})})}};function L1(e,t){for(let n of bq){let i=wq(n);try{e.commands.registerCommand(i,(...r)=>{try{t.capture(n,r[0])}catch(o){console.error(`[ableton-live-mcp] could not capture the ${n} selection:`,o)}}),e.ui.registerContextMenuAction(n,$q,i).catch(r=>console.error(`[ableton-live-mcp] could not add the ${n} menu entry:`,r))}catch(r){console.error(`[ableton-live-mcp] could not register the ${n} selection command:`,r)}}}var Z1=Sr(require("node:fs/promises"),1),Wn=32,nk=-80,xq=1<<20,wh=1,On=3,Sq=65534,zs=e=>e>0?Math.round(2e3*Math.log10(e))/100:null;async function Fi(e,t,n){let i=new Uint8Array(n),{bytesRead:r}=await e.read(i,0,n,t);return new DataView(i.buffer,0,r)}var su=(e,t)=>String.fromCharCode(e.getUint8(t),e.getUint8(t+1),e.getUint8(t+2),e.getUint8(t+3));async function Iq(e,t){let n=await Fi(e,0,12),i=n.byteLength>=12?su(n,0):"",r=n.byteLength>=12?su(n,8):"";if((i==="RIFF"||i==="RF64")&&r==="WAVE")return Tq(e,t,i==="RF64");if(i==="FORM"&&(r==="AIFF"||r==="AIFC"))return Pq(e,t,r==="AIFC");throw new Error("not a WAV or AIFF file (no RIFF/RF64 WAVE or FORM AIFF/AIFC header)")}function F1(e,t){let{code:n,bits:i,channels:r,blockAlign:o}=e;if(!(n===wh&&[8,16,24,32].includes(i)||n===On&&[32,64].includes(i)))throw new Error(`unsupported sample format (${n===On?"float":"PCM"}, ${i} bits): PCM 8/16/24/32-bit and float 32/64-bit are supported`);if(!r||o!==r*i/8)throw new Error(`inconsistent format (${r} channels, ${i} bits, block size ${o})`);return{format:e,data:t}}async function Tq(e,t,n){let i,r,o;for(let a=12;a+8<=t&&(!i||!r);){let s=await Fi(e,a,8);if(s.byteLength<8)break;let c=su(s,0),l=s.getUint32(4,!0),u=a+8;if(c==="ds64"){let p=await Fi(e,u,16);p.byteLength>=16&&(o=Number(p.getBigUint64(8,!0)))}else if(c==="fmt "){let p=await Fi(e,u,Math.min(l,40));if(p.byteLength<16)throw new Error("the fmt chunk is truncated");let h=p.getUint16(0,!0),g=p.getUint16(14,!0),_=g;if(h===Sq){if(p.byteLength<26)throw new Error("the WAVE_FORMAT_EXTENSIBLE fmt chunk is truncated");_=p.getUint16(18,!0)||g,h=p.getUint16(24,!0)}i={fileType:"wav",code:h,channels:p.getUint16(2,!0),sampleRate:p.getUint32(4,!0),blockAlign:p.getUint16(12,!0),bits:g,validBits:_,littleEndian:!0,unsigned8:!0}}else c==="data"&&(n&&l===4294967295&&o!==void 0&&(l=o),r={offset:u,size:Math.min(l,t-u)});a=u+l+l%2}if(!i)throw new Error("no fmt chunk");if(!r)throw new Error("no data chunk");return F1(i,r)}function zq(e,t){let n=e.getUint16(t)&32767,i=e.getBigUint64(t+2);return n===0&&i===0n?0:(e.getUint8(t)&128?-1:1)*Number(i)*2**(n-16383-63)}var U1={NONE:{code:wh,littleEndian:!1},twos:{code:wh,littleEndian:!1},sowt:{code:wh,littleEndian:!0},fl32:{code:On,littleEndian:!1},FL32:{code:On,littleEndian:!1},fl64:{code:On,littleEndian:!1},FL64:{code:On,littleEndian:!1}};async function Pq(e,t,n){let i,r=0,o;for(let a=12;a+8<=t&&(!i||!o);){let s=await Fi(e,a,8);if(s.byteLength<8)break;let c=su(s,0),l=s.getUint32(4),u=a+8;if(c==="COMM"){let p=await Fi(e,u,Math.min(l,22));if(p.byteLength<18||n&&p.byteLength<22)throw new Error("the COMM chunk is truncated");let h=n?su(p,18):"NONE",g=U1[h];if(!g)throw new Error(`unsupported AIFF-C compression ${JSON.stringify(h)}: ${Object.keys(U1).join(", ")} are supported`);let _=p.getInt16(0),k=p.getInt16(6),T=g.code===On?h.toLowerCase()==="fl64"?64:32:Math.ceil(k/8)*8;r=p.getUint32(2),i={fileType:"aiff",code:g.code,channels:_,sampleRate:zq(p,8),blockAlign:_*T/8,bits:T,validBits:g.code===On?T:k,littleEndian:g.littleEndian,unsigned8:!1}}else if(c==="SSND"){let p=await Fi(e,u,8);if(p.byteLength<8)throw new Error("the SSND chunk is truncated");let h=u+8+p.getUint32(0);o={offset:h,size:Math.max(0,Math.min(u+l,t)-h)}}a=u+l+l%2}if(!i)throw new Error("no COMM chunk");if(!o)throw new Error("no SSND chunk");return i.blockAlign&&(o.size=Math.min(o.size,r*i.blockAlign)),F1(i,o)}function Eq(e){let t=e.littleEndian;if(e.code===On)return{read:e.bits===32?(o,a)=>o.getFloat32(a,t):(o,a)=>o.getFloat64(a,t),isFull:o=>Math.abs(o)>=1};let n=2**(e.bits-1),i=(n-1)/n,r=o=>o>=i||o<=-1;switch(e.bits){case 8:return e.unsigned8?{read:(o,a)=>(o.getUint8(a)-128)/n,isFull:r}:{read:(o,a)=>o.getInt8(a)/n,isFull:r};case 16:return{read:(o,a)=>o.getInt16(a,t)/n,isFull:r};case 24:return{read:t?(o,a)=>(o.getUint8(a)|o.getUint8(a+1)<<8|o.getInt8(a+2)<<16)/n:(o,a)=>(o.getInt8(a)<<16|o.getUint8(a+1)<<8|o.getUint8(a+2))/n,isFull:r};default:return{read:(o,a)=>o.getInt32(a,t)/n,isFull:r}}}async function V1(e){let t=await Z1.open(e,"r");try{let n=(await t.stat()).size,{format:i,data:r}=await Iq(t,n),{channels:o,blockAlign:a}=i,s=i.bits/8,c=Math.floor(r.size/a),{read:l,isFull:u}=Eq(i),p=new Array(o).fill(0),h=new Array(o).fill(0),g=new Array(o).fill(0),_=new Array(Wn).fill(0),k=new Array(Wn).fill(0),T=new Array(Wn).fill(0),z=Math.max(a,Math.floor(xq/a)*a),S=0;for(let ye=0;S<c;){let Le=await Fi(t,r.offset+ye,Math.min(z,(c-S)*a)),Dt=Math.floor(Le.byteLength/a);if(!Dt)break;for(let _t=0;_t<Dt;_t++,S++){let rt=Math.min(Wn-1,Math.floor(S*Wn/c));T[rt]++;for(let nt=0;nt<o;nt++){let qt=l(Le,_t*a+nt*s);if((u(qt)||!Number.isFinite(qt))&&g[nt]++,!Number.isFinite(qt))continue;let Dr=Math.abs(qt);Dr>p[nt]&&(p[nt]=Dr),Dr>_[rt]&&(_[rt]=Dr),h[nt]+=qt*qt,k[rt]+=qt*qt}}ye+=Dt*a}let A=(ye,Le)=>Le?Math.sqrt(ye/Le):0,Q=Math.max(0,...p),X=zs(Q),ge=h.reduce((ye,Le)=>ye+Le,0);return{file_type:i.fileType,format:i.code===On?"float":"pcm",bits_per_sample:i.bits,valid_bits_per_sample:i.validBits!==i.bits?i.validBits:void 0,sample_rate:i.sampleRate,channels:o,frames:S,duration_s:i.sampleRate?Math.round(S/i.sampleRate*1e3)/1e3:0,peak_dbfs:X,rms_dbfs:zs(A(ge,S*o)),clipped_samples:g.reduce((ye,Le)=>ye+Le,0),silent:X===null||X<nk,channel_levels:p.map((ye,Le)=>({channel:Le,peak_dbfs:zs(ye),rms_dbfs:zs(A(h[Le],S)),clipped_samples:g[Le]})),envelope:{buckets:Wn,bucket_s:i.sampleRate?Math.round(c/Wn/i.sampleRate*1e4)/1e4:0,peak_dbfs:_.map((ye,Le)=>T[Le]?zs(ye):null),rms_dbfs:k.map((ye,Le)=>T[Le]?zs(A(ye,T[Le]*o)):null)}}}finally{await t.close()}}var ik={name:"ableton-live",version:"1.0.0"},Oq=m1.replace(/^---\r?\n[\s\S]*?\r?\n---\r?\n+/,""),jq=["Beats","Tones","Texture","Repitch","Complex","ComplexPro"],cj=e=>JSON.stringify(e,(t,n)=>typeof n=="bigint"?n.toString():n);function Rq(e){return{content:[{type:"text",text:cj(e)}]}}var q1=(e,t)=>Object.assign(new Error(t),{code:e}),B1="If this object was deleted or moved, or the Live Set changed, its id is stale \u2014 re-fetch ids via song_get / track_get.",Et={readOnlyHint:!0,openWorldHint:!1},Xn={readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},H1={...Xn,idempotentHint:!1},Gr={readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1},jn={readOnlyHint:!1,destructiveHint:!0,idempotentHint:!0,openWorldHint:!1},Vi={...jn,idempotentHint:!1},Dq={readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!0},Cq={readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1,openWorldHint:!0},Aq=new Set(["show_dialog","dialog_result","selection_wait","render_track_audio","audio_track_consolidate","batch","batch_read"]),Nq=1e4;async function Ps(e,t,n){let i=e._meta?.progressToken;if(i===void 0)return n();let r=Date.now(),o=0,a=()=>{let l=Math.round((Date.now()-r)/1e3);e.sendNotification({method:"notifications/progress",params:{progressToken:i,progress:++o,message:t(l)}}).catch(()=>{})};a();let s=setInterval(a,Nq),c=()=>clearInterval(s);e.signal.addEventListener("abort",c,{once:!0});try{return await n()}finally{c(),e.signal.removeEventListener("abort",c)}}var Po=e=>y.union([y.number().int().min(0).max(127),y.string().min(1)]).describe(`${e}: 0-127, or a note name such as "C3" (= 60), "F#1" or "Bb2"`),J1={pitch:Po("MIDI pitch"),start_time:y.number().describe("Start in beats, relative to clip start"),duration:y.number().positive().describe("Length in beats"),velocity:y.number().min(0).max(127).optional(),muted:y.boolean().optional(),probability:y.number().min(0).max(1).optional().describe("Play probability, 0-1"),velocity_deviation:y.number().optional(),release_velocity:y.number().min(0).max(127).optional()};function Mq(e,t="pitch"){return{pitch:Ai(e.pitch,t),startTime:e.start_time,duration:e.duration,velocity:e.velocity,muted:e.muted,probability:e.probability,velocityDeviation:e.velocity_deviation,releaseVelocity:e.release_velocity}}var G1=()=>y.object({note:Po("Pitch of every hit"),steps:y.string().min(1).describe('One character per step: "x" a hit, "X" an accented hit, "." or "-" a rest; spaces and "|" are ignored, e.g. "x...x...|x...x.x."'),step:y.number().positive().default(.25).describe("Length of one step in beats (0.25 = 1/16)"),start_time:y.number().min(0).default(0).describe("Where the first step starts, in beats"),velocity:y.number().min(1).max(127).default(100).describe('Velocity of "x" hits'),accent_velocity:y.number().min(1).max(127).default(127).describe('Velocity of "X" hits'),duration:y.number().positive().optional().describe("Length of each hit in beats; default one step")}),K1=()=>y.object({length:y.number().positive().describe("Beats the given notes span, e.g. 4 = one 4/4 bar: copy k starts k \xD7 length later"),times:y.number().int().min(1).optional().describe("Copies in total, counting the original (written even past the clip's end); omitted = fill the clip: copies up to its end, without the notes that would start at or after it")}).describe("Repeat the notes and patterns of this write"),js=5e4;function W1(e,t){let n=(e.notes??[]).map((l,u)=>Mq(l,`notes[${u}].pitch`));for(let[l,u]of(e.patterns??[]).entries()){let p=Ai(u.note,`patterns[${l}].note`),h=0;for(let g of u.steps)if(!(g==="|"||/\s/.test(g))){if(g==="x"||g==="X")n.push({pitch:p,startTime:u.start_time+h*u.step,duration:u.duration??u.step,velocity:g==="X"?u.accent_velocity:u.velocity});else if(g!=="."&&g!=="-")throw new j(`patterns[${l}].steps: unexpected ${JSON.stringify(g)}; use x, X, . or - (spaces and | are ignored).`);h++}}let i=l=>Math.max(1,Math.ceil(t/l.length-1e-9)),r=e.repeat?e.repeat.times??i(e.repeat):1,o=n.length*r;if(o>js&&o>(e.notes?.length??0))throw new j(`patterns and repeat would write ${o} notes; at most ${js} are allowed.`);if(!e.repeat)return{notes:n};if(!n.length)throw new j("repeat needs notes or patterns to repeat.");let{length:a,times:s}=e.repeat,c=[...n];for(let l=1;l<r;l++)for(let u of n){let p=u.startTime+l*a;s===void 0&&p>=t-1e-9||c.push({...u,startTime:p})}return{notes:c,copies:r}}var X1=()=>y.object({pitch_min:Po("Lowest pitch").optional(),pitch_max:Po("Highest pitch").optional(),time_min:y.number().optional().describe("Earliest start time, in beats"),time_max:y.number().optional().describe("Latest start time, in beats"),in_scale:y.boolean().optional().describe("true: only notes in the scale, false: only notes outside it. The scale is the song's (in midi_clip_edit_notes: snap_to_scale's, when given)"),only_selected:y.boolean().optional().describe("Only the notes selected in Live's MIDI editor. Whether Live reports the selection to extensions is unverified: a `warning` says when it reported none"),every_nth:y.union([y.number().int().min(1),y.object({n:y.number().int().min(1),offset:y.number().int().min(0).default(0)})]).optional().describe("Every n-th of the notes the other filters match, in time order (start, then pitch): 2 = the 1st, 3rd, 5th, ...; {n: 2, offset: 1} = the 2nd, 4th, ...")}),Lq=()=>y.union([y.literal("song"),y.object({root:y.union([y.number().int().min(0).max(11),y.string().min(1)]).describe('Root as 0-11 (C = 0) or a note name such as "D" or "F#"'),intervals:y.array(y.number().int()).min(1).describe("Semitone offsets from the root, e.g. [0, 2, 3, 5, 7, 8, 10] (natural minor)")})]),lj=(e,t)=>((e-t)%12+12)%12,ok=(e,t)=>t.intervals.includes(lj(e,t.root_note));function Uq(e,t){for(let n=0;n<12;n++){if(e-n>=0&&ok(e-n,t))return e-n;if(e+n<=127&&ok(e+n,t))return e+n}return e}var Y1=e=>y.union([y.number().positive(),y.literal("song")]).describe(`${e} in beats (0.25 = 1/16), or "song" for Live's grid setting (the arrangement grid, not the clip editor's; bar grids assume the first scene's time signature)`),uj=e=>e.map((t,n)=>n).sort((t,n)=>q(e[t].startTime)-q(e[n].startTime)||q(e[t].pitch)-q(e[n].pitch)||t-n);function Q1(e,t){let n=e.pitch_min===void 0?0:Ai(e.pitch_min,"select.pitch_min"),i=e.pitch_max===void 0?127:Ai(e.pitch_max,"select.pitch_max"),r=typeof e.every_nth=="number"?{n:e.every_nth,offset:0}:e.every_nth,o=a=>{let s=q(a.pitch),c=q(a.startTime);return s>=n&&s<=i&&(e.time_min===void 0||c>=e.time_min)&&(e.time_max===void 0||c<=e.time_max)&&(e.in_scale===void 0||ok(s,t)===e.in_scale)&&(!e.only_selected||a.selected===!0)};return a=>{let s=a.map(o);if(r){let c=0;for(let l of uj(a))s[l]&&(s[l]=c>=r.offset&&(c-r.offset)%r.n===0,c++)}return s}}function ej(e){if(!(!e.length||e.some(t=>t.selected===!0)))return e.some(t=>typeof t.selected=="boolean")?"No note of this clip is selected in Live.":"Live reported no selection state for this clip's notes, so none counts as selected."}function Zq(e){let t=n=>n===void 0?void 0:q(n);return{pitch:q(e.pitch),start_time:q(e.startTime),duration:q(e.duration),velocity:t(e.velocity),muted:e.muted,probability:t(e.probability),velocity_deviation:t(e.velocityDeviation),release_velocity:t(e.releaseVelocity),selected:e.selected}}var ak={muted:!1,probability:1,velocity_deviation:0,release_velocity:64,selected:!1},tj=Object.keys(ak);function Fq(e){let t=(i,r)=>i[r]??ak[r],n={...ak};for(let i of tj){let r=new Map;for(let a of e)r.set(t(a,i),(r.get(t(a,i))??0)+1);let o=0;for(let[a,s]of r)s>o&&(o=s,n[i]=a)}return{format:"compact",fields:["pitch","start_time","duration","velocity"],defaults:n,notes:e.map(i=>{let r=[i.pitch,i.start_time,i.duration,i.velocity??null],o=tj.filter(a=>t(i,a)!==n[a]);return o.length&&r.push(Object.fromEntries(o.map(a=>[a,t(i,a)]))),r})}}function Vq(e,t,n){let i=2*t,r=Math.floor(e/i)*i,o=e-r,a=t*(1+n/2);return r+(o<=t?o*a/t:a+(o-t)*(i-a)/t)}var qq=1/64,dj=1/256;function Bq(e){let t=[];for(let n of[...e].sort((i,r)=>i.startTime-r.startTime)){let i=t[t.length-1];i&&n.startTime-i[0].startTime<qq?i.push(n):t.push([n])}for(let n=0;n+1<t.length;n++)for(let i of t[n])i.duration=Math.max(dj,t[n+1][0].startTime-i.startTime)}function Hq(e){let t=e>>>0;return()=>{t=t+1831565813>>>0;let n=t;return n=Math.imul(n^n>>>15,n|1),n^=n+Math.imul(n^n>>>7,n|61),((n^n>>>14)>>>0)/4294967296}}var Jq=y.object({looping:y.boolean(),start_marker:y.number(),end_marker:y.number(),loop_start:y.number(),loop_end:y.number()}).describe("Initial clip region/loop, all positions in beats. Loop must be >= 0.25 beats. When looping is false, loop_start/loop_end must equal start_marker/end_marker. Unwarped clips require looping=false and non-negative positions.");function Ie(e){return e instanceof Error?e.message:e===void 0?"the Live host rejected the operation without details \u2014 check argument values (device name spelling, index ranges, file paths, clip overlaps).":String(e)}var ht=()=>({track_id:y.string().optional().describe("Track id"),track_index:y.number().int().min(0).optional().describe("0-based index among the regular tracks"),track_name:y.string().optional().describe("Track name, exact match first, then case-insensitive (regular, return and main tracks)")}),Es=()=>({scene_id:y.string().optional().describe("Scene id"),scene_index:y.number().int().min(0).optional().describe("0-based scene index"),scene_name:y.string().optional().describe("Scene name, exact match first, then case-insensitive")}),Gq=y.string().optional().describe("Exact track name (case-sensitive)"),Kq=y.string().optional().describe("Exact scene name (case-sensitive)"),Wq=y.union([y.object({chain:y.number().int().min(0).describe("0-based chain index in the rack")}).strict(),y.object({pad:Po("Drum Rack pad: the chain's receiving MIDI note")}).strict()]),rj=()=>y.union([y.string().min(1).describe("Device name, exact match first, then case-insensitive"),y.number().int().min(0).describe("0-based position in the device list")]),cu={device_id:y.string().optional().describe("Device id"),...ht(),device:y.union([rj(),y.array(y.union([rj(),Wq])).min(1)]).optional().describe(`With a track instead of device_id: the device's name or 0-based index on the track, or a path into racks, e.g. ["Drum Rack", {"pad": 36}, "Simpler"] or [0, {"chain": 1}, "Reverb"]`)},nj={parameter_id:y.string().optional().describe("Parameter id (from device_get, mixer_get, parameter_find, ...)"),...cu,parameter:y.string().min(1).optional().describe("Instead of parameter_id: the parameter's name on the device (device_id, or track + device); exact match first, then case-insensitive, then unique substring")},sk={value:y.number().optional().describe("Internal units within [min, max]; a quantized parameter takes its value_items index"),value_item:y.string().min(1).optional().describe('Quantized parameters: the choice by value_items name or short name (exact, then case-insensitive, then unique substring), e.g. "Saw"'),reset:y.boolean().optional().describe("true: set the parameter to its default value"),delta:y.number().optional().describe("Add this to the current value, clamped to [min, max] (whole steps for quantized parameters)")},pj=y.string().min(1).describe("Parameter name: exact match first, then case-insensitive, then unique substring"),ij=y.object({name:pj,...sk}),Yn=(e,t)=>t.some(n=>e[n]!==void 0),fn=e=>Yn(e,["track_id","track_index","track_name"]),Xq=e=>Yn(e,["scene_id","scene_index","scene_name"]);function zo(e,t,n){if(t===void 0)return{list:[e],batch:!1};let i=n.filter(r=>Yn(e,[r]));if(i.length)throw new j(`Give either items or ${i.join(", ")} at the top level, not both.`);return{list:t,batch:!0}}var qi=(e,t)=>e?`items[${t}]`:void 0;function yt(e,t){try{return t()}catch(n){throw e&&n instanceof Error&&(n.message=`${typeof e=="function"?e():e}: ${n.message}`),n}}var mj="ableton-live-mcp/device-preset",Yq=y.object({format:y.literal(mj),version:y.literal(1),name:y.string(),device_name:y.string().min(1),device_class:y.string().optional(),saved_at:y.string().optional(),parameters:y.array(y.object({name:y.string(),value:y.number()})),sample:y.object({file_path:y.string().min(1)}).nullable().optional()}),Qq=/^[\p{L}\p{N}][\p{L}\p{M}\p{N} _\-.,()'+&#]*$/u,e9=/^(con|prn|aux|nul|com[0-9\u00b9\u00b2\u00b3]|lpt[0-9\u00b9\u00b2\u00b3]) *(\..*)?$/i;function oj(e){let t=e.normalize("NFC").trim();if(!t||t.length>64)throw new j("Preset names are 1-64 characters long.");if(!Qq.test(t)||/[. ]$/.test(t)||e9.test(t))throw new j(`Invalid preset name ${JSON.stringify(e)}: use letters, digits, spaces and - _ . , ( ) ' + & #, starting with a letter or digit and not ending with a dot.`);return t}function fj(e){let t=Rt.lstatSync(e);if(!t.isFile())throw new Error(`${e} is not a regular file.`);if(t.size>4e6)throw new Error(`${e} is too large for a preset.`);let n;try{n=JSON.parse(Rt.readFileSync(e,"utf8"))}catch(r){throw new Error(`${e} is not valid JSON: ${Ie(r)}`)}let i=Yq.safeParse(n);if(!i.success){let r=i.error.issues[0],o=r.path.join(".")||"file";throw new Error(`${e} is not a device preset of this server (${o}: ${r.message}).`)}return i.data}function t9(e){if(!e)throw new Error("Live provides no storage directory for this extension, so presets cannot be stored.");let t=Kr.join(e,"presets"),n=a=>{let s=Kr.resolve(t,a);if(Kr.dirname(s)!==Kr.resolve(t))throw new Error(`Refusing a preset path outside ${t}.`);return s},i=()=>{let a;try{a=Rt.readdirSync(t)}catch(s){if(s.code==="ENOENT")return[];throw s}return a.filter(s=>{if(!s.endsWith(".json")||s.startsWith("."))return!1;try{return Rt.lstatSync(n(s)).isFile()}catch{return!1}}).sort()},r=a=>Kr.basename(a,".json").normalize("NFC"),o=a=>{let s=i(),c=s.find(l=>r(l)===a)??s.find(l=>r(l).toLowerCase()===a.toLowerCase());return c===void 0?void 0:n(c)};return{dir:t,find:o,list(){let a=[],s=[];for(let c of i())try{a.push({name:r(c),preset:fj(n(c))})}catch(l){s.push({file:c,error:Ie(l)})}return{presets:a,unreadable:s}},write(a,s,c){let l=o(a);if(l&&!c)throw new j(`A preset named ${JSON.stringify(r(l))} already exists. Pass overwrite:true to replace it.`);Rt.mkdirSync(t,{recursive:!0});let u=l?r(l):a,p=`${JSON.stringify({...s,name:u},null,2)}
|
|
169
|
+
`;if(!l)return Rt.writeFileSync(n(`${a}.json`),p,{flag:"wx"}),{name:u,replaced:!1};let h=n(`.tmp-${Date.now()}-${Math.random().toString(36).slice(2)}.json`);Rt.writeFileSync(h,p,{flag:"wx"});try{Rt.renameSync(h,l)}catch(g){throw Rt.rmSync(h,{force:!0}),g}return{name:u,replaced:!0}}}}function aj(e,t,n,i,r,o={}){let a=new Yf(ik,{instructions:o.note?`${Bw.trimEnd()}
|
|
170
|
+
${o.note}
|
|
171
|
+
`:Bw}),s=()=>e.application.song;a.server.onerror=d=>console.error("[ableton-live-mcp] MCP error:",d.message);let c=new Map,l=new Set;function u(d,m,f,v,$){if(l.add(d),o.allowed&&!o.allowed.has(d))return;c.set(d,{meta:m,shape:v,handler:$});let b={...m,description:f,inputSchema:v};a.registerTool(d,b,(async(w,x)=>{let P=Date.now();try{return Rq(await $(w??{},x))}catch(R){let I=Ie(R);return console.error(`[ableton-live-mcp] ${d} failed after ${Date.now()-P} ms: ${I}`),{content:[{type:"text",text:R instanceof j?`Error: ${I}`:`Error: ${I}
|
|
172
|
+
${B1}`}],isError:!0}}}))}let p=["tracks","scenes","cue_points","environment"],h=["devices","mixer","clips"],g=500,_=500,k=8;u("song_get",{title:"Get Live Set",annotations:Et},`Get the state of the current Live Set: tempo, scale, grid, all tracks (with ids, \`index\`, and the group hierarchy: \`depth\`, \`group_track_id\`, \`is_group\`, and \`child_track_ids\` for group tracks \u2014 whose \`type\` is 'other'), return tracks (with \`send_index\`), main track, scenes, cue points, and extension environment info. This is the entry point \u2014 object ids returned here are used by every other tool. Times are in beats throughout the API. Use \`include\` to fetch only some sections (tempo/grid/scale always included). Deep sections, only included when listed, add to every track entry (and imply the tracks): \`devices\` (each track's device tree through racks: chains with their devices; every device with its on-state \`enabled\`), \`mixer\` (volume, panning and sends with values and return track names; mixer_get has the parameter ids), \`clips\` (regular tracks: session clips with their scene_index and arrangement clips with their position, in brief \u2014 clip_get has the detail). Deep sections stop at ${g} devices and ${_} clips: from the track that does not fit on, tracks lack that section and \`truncated\` says so (use track_get / device_get for them).`,{include:y.array(y.enum([...p,...h])).optional().describe("Sections to include; omit for tracks, scenes, cue_points and environment. devices, mixer and clips are only included when listed")},async({include:d})=>{let m=s(),f=R=>d?d.includes(R):p.includes(R),v=h.filter(f),$=f("tracks")||v.length>0,b,w,x,P;if($){let R=m.tracks,I=m.returnTracks;b=T(R.map((D,N)=>({...Ds(D,R),index:N}))),w=I.map((D,N)=>({...ou(D,"return"),send_index:N})),x=ou(m.mainTrack,"main"),v.length&&(P=await z([...R,...I,m.mainTrack],[...b,...w,x],R.length,v))}return{tempo:q(m.tempo),grid:{quantization:Hw(m.gridQuantization),is_triplet:m.gridIsTriplet},scale:{root_note:q(m.rootNote),name:m.scaleName,mode_enabled:m.scaleMode,intervals:m.scaleIntervals.map(q)},tracks:b,return_tracks:w,main_track:x,scenes:f("scenes")?m.scenes.map(Li):void 0,cue_points:f("cue_points")?m.cuePoints.map(Ui):void 0,environment:f("environment")?{storage_directory:e.environment.storageDirectory,temp_directory:e.environment.tempDirectory,language:e.environment.language,host_api_version:t,server_version:ik.version,mcp_port:n}:void 0,truncated:P}});function T(d){let m=new Map(d.map(v=>[v.id,v])),f=new Map;for(let v of d)v.group_track_id!==null&&f.set(v.group_track_id,[...f.get(v.group_track_id)??[],v.id]);return d.map(v=>{let $=0;for(let b=v.group_track_id;b!==null&&$<64;b=m.get(b)?.group_track_id??null)$++;return{...v,depth:$,child_track_ids:v.is_group?f.get(v.id)??[]:void 0}})}async function z(d,m,f,v){let $={},b=(I,D,N,M)=>`Only ${D} ${I} are listed: ${rt(N)} and the tracks after it have no \`${I}\`. Use ${M} for them.`,w=[];if(v.includes("devices")){let I={left:g};for(let[D,N]of d.entries()){let M=[],V=S(N.devices,I,M);if(!V){$.devices=b("devices",g,N,"track_get or device_get {include_chain_devices}");break}m[D].devices=V,w.push(...M)}}let x=s().returnTracks.map(I=>I.name),[P,R]=await Promise.all([Promise.all(w.map(I=>I.param.getValue().then(q,()=>{}))),v.includes("mixer")?Promise.all(d.map(I=>A(I.mixer,x))):void 0]);if(w.forEach((I,D)=>{P[D]!==void 0&&(I.node.enabled=P[D]!==I.off)}),R?.forEach((I,D)=>m[D].mixer=I),v.includes("clips")){let I=_;for(let[D,N]of d.slice(0,f).entries()){let M=N.clipSlots.map(K=>({slot:K,clip:K.clip})),V=N.arrangementClips,le=M.filter(K=>K.clip).length+V.length;if(le>I){$.clips=b("clips",_,N,"track_get or session_grid / arrangement_get");break}I-=le,m[D].clips={session:M.flatMap(({slot:K,clip:oe},W)=>oe?[{scene_index:W,slot_id:Y(K),...hh(oe)}]:[]),arrangement:V.map(K=>hh(K,!0))}}}return Object.keys($).length?$:void 0}function S(d,m,f,v=0){let $=[];for(let b of d){if(m.left<=0)return null;m.left--;let w=pr(b);w.enabled=void 0;try{let x=Eh(b);f.push({node:w,param:x.param,off:x.off}),x.fallback&&(w.on_parameter=x.param.name)}catch{}if(b instanceof Gt&&v<k){let x=[];for(let P of b.chains){let R=S(P.devices,m,f,v+1);if(!R)return null;x.push({...Mi(P),devices:R})}delete w.chain_ids,w.chains=x}$.push(w)}return $}async function A(d,m){let f=d.sends,[v,$,...b]=await Promise.all([d.volume,d.panning,...f].map(w=>w.getValue()));return{id:Y(d),volume:q(v),panning:q($),sends:b.map((w,x)=>({index:x,return_track:m[x],value:q(w)}))}}u("song_set",{title:"Set song properties",annotations:Xn},"Set song-level properties of the Live Set.",{tempo:y.number().min(20).max(999).optional().describe("Tempo in BPM")},({tempo:d})=>(d!==void 0&&(s().tempo=d),{tempo:q(s().tempo)}));let Q=["missing_media","empty_simplers","empty_drum_chains","duplicate_track_names"],X=100,ge=5e3,ye=1e4;function Le(d){if(!d)return"no file path";if(!Kr.isAbsolute(d))return"not an absolute path, so it could not be checked";try{return Rt.statSync(d).isFile()?void 0:"not a file"}catch(m){let f=m.code;return f==="ENOENT"||f==="ENOTDIR"?"file not found":`cannot be read (${f??Ie(m)})`}}u("song_audit",{title:"Audit Live Set",annotations:Et},`Check the Live Set for common problems without changing anything: \`missing_media\` (audio clips \u2014 session, arrangement and take lanes \u2014 and Simpler samples whose file is not found on this computer, or that have no file path), \`empty_simplers\` (Simplers without a sample), \`empty_drum_chains\` (Drum Rack pads without devices) and \`duplicate_track_names\` (track names that are equal ignoring case, which makes track_name ambiguous). Searches regular, return and main tracks, through racks. Every entry has the ids to act on and a \`location\` (track, path through racks, or a clip's slot or lane); at most ${X} entries are listed per check, \`counts\` has the totals. \`checks\` runs only some of them.`,{checks:y.array(y.enum(Q)).min(1).optional().describe("Checks to run; omit for all four")},({checks:d})=>{let m=W=>!d||d.includes(W),f=Q.filter(m),v=s(),$=v.tracks,b=[...$,...v.returnTracks,v.mainTrack],w=Object.fromEntries(f.map(W=>[W,0])),x=Object.fromEntries(f.map(W=>[W,[]])),P=(W,ce)=>{w[W]++,x[W].length<X&&x[W].push(ce())},R=new Map,I=W=>(R.has(W.handle.id)||R.set(W.handle.id,Qn(W,$)),R.get(W.handle.id)),D=new Map,N=W=>(D.has(W)||D.set(W,Le(W)),D.get(W)),M=[],V=0,le=!1,K=0;if(m("missing_media")||m("empty_simplers")||m("empty_drum_chains")){let W=(ce,_e,F,ae)=>{for(let ue of ce){if(V>=ge){le=!0;return}V++;let B=[...F,ue.name],te=()=>({...I(_e),path:B.join(" > ")});if(ue instanceof Tr){let be=ue.sample;if(!be)m("empty_simplers")&&P("empty_simplers",()=>({device_id:Y(ue),location:te()}));else if(m("missing_media")){let ct=be.filePath,Ne=N(ct);Ne&&P("missing_media",()=>({kind:"simpler_sample",device_id:Y(ue),sample_id:Y(be),file_path:ct,problem:Ne,location:te()}))}}ue instanceof Gt&&ae<k&&ue.chains.forEach((be,ct)=>{let Ne=Cs(be,ct),pt=be.devices;be instanceof Yr&&!pt.length&&m("empty_drum_chains")&&P("empty_drum_chains",()=>({...Mi(be),rack_device_id:Y(ue),location:{...I(_e),path:[...B,Ne].join(" > ")}})),W(pt,_e,[...B,Ne],ae+1)})}};for(let ce of b)W(ce.devices,ce,[ce.name],0);le&&M.push(`Stopped after ${ge} devices: later devices were not checked.`)}if(m("missing_media"))e:for(let W of $)for(let ce of Ik(W,"all")){if(K>=ye){M.push(`Stopped after ${ye} clips: later clips were not checked.`);break e}if(K++,!(ce instanceof Ht))continue;let _e=ce.filePath,F=N(_e);F&&P("missing_media",()=>({kind:"audio_clip",clip_id:Y(ce),clip_name:ce.name,file_path:_e,problem:F,location:lk(ce)}))}if(m("duplicate_track_names")){let W=new Map;for(let ce of b){let _e=ce.name.toLowerCase();W.set(_e,[...W.get(_e)??[],ce])}for(let ce of W.values())ce.length>1&&P("duplicate_track_names",()=>({name:ce[0].name,case_differs:ce.some(_e=>_e.name!==ce[0].name)||void 0,tracks:ce.map(I)}))}return{issue_count:f.reduce((W,ce)=>W+w[ce],0),counts:w,...x,truncated:f.some(W=>w[W]>x[W].length)?`At most ${X} entries are listed per check; counts has the totals.`:void 0,searched:{tracks:b.length,devices:V,clips:K,files:D.size},incomplete:M.length?M:void 0}});let Dt=(d,m,f)=>new j(`${d} ${m} out of range (${f?`0-${f-1}`:"there are none"}).`);function _t(d,m,f,v,$,{exact:b=!1,hint:w=""}={}){let x=f.filter(M=>v(M)===m),P=f.filter(M=>v(M).toLowerCase()===m.toLowerCase()),R=x.length||b?x:P;if(R.length===1)return R[0];let I=JSON.stringify(m);if(R.length)throw new j(`Ambiguous ${d} name ${I}: it matches ${R.map($).join(", ")}.${w&&` ${w}`}`);if(b&&P.length)throw new j(`No ${d} named exactly ${I} (this tool needs the exact name). Did you mean ${P.map($).join(", ")}?`);let D=f.map(M=>JSON.stringify(v(M))),N=D.length>50?`, ... (${D.length-50} more)`:"";throw new j(`No ${d} named ${I}. Available: ${D.slice(0,50).join(", ")||"none"}${N}.`)}function rt(d){let m=s(),f=m.tracks.findIndex($=>$.handle.id===d.handle.id),v=f>=0?`track_index ${f}`:d.handle.id===m.mainTrack.handle.id?"main track":"return track";return`${JSON.stringify(d.name)} (${v}, id ${Y(d)})`}function nt(d,m={}){let f=s(),v=[];if(d.track_id!==void 0&&v.push(st(d.track_id,Ue)),d.track_index!==void 0){let $=f.tracks[d.track_index];if(!$)throw Dt("track_index",d.track_index,f.tracks.length);v.push($)}if(d.track_name!==void 0){let $=[...f.tracks,...f.returnTracks,f.mainTrack];v.push(_t("track",d.track_name,$,b=>b.name,rt,{exact:m.exactName,hint:"Use track_id or track_index."}))}if(!v.length)throw new j("Provide track_id, track_index, or track_name.");if(v.some($=>$.handle.id!==v[0].handle.id))throw new j(`track_id, track_index and track_name name different tracks: ${v.map(rt).join(" vs ")}.`);return v[0]}let qt=(d,m)=>`${JSON.stringify(d.name)} (scene_index ${m}, id ${Y(d)})`;function Dr(d,m={}){let f=s().scenes,v=[];if(d.scene_id!==void 0){let $=st(d.scene_id,ri),b=f.findIndex(w=>w.handle.id===$.handle.id);if(b<0)throw new Error(`Scene "${d.scene_id}" is no longer in the Live Set.`);v.push(b)}if(d.scene_index!==void 0){if(d.scene_index>=f.length)throw Dt("scene_index",d.scene_index,f.length);v.push(d.scene_index)}if(d.scene_name!==void 0){let $=f.map((x,P)=>({scene:x,index:P})),b=x=>qt(x.scene,x.index),w={exact:m.exactName,hint:"Use scene_id or scene_index."};v.push(_t("scene",d.scene_name,$,x=>x.scene.name,b,w).index)}if(!v.length)throw new j("Provide scene_id, scene_index, or scene_name.");if(v.some($=>$!==v[0]))throw new j(`scene_id, scene_index and scene_name name different scenes: ${v.map($=>qt(f[$],$)).join(" vs ")}.`);return{scene:f[v[0]],index:v[0]}}function Rs(d){if(d.target_id===void 0){if(!fn(d))throw new j("Provide target_id, or a track via track_id, track_index or track_name.");return nt(d)}if(fn(d))throw new j("Give target_id or track_id/track_index/track_name, not both.");return st(d.target_id,Ot)}function lu(d){let m=Rs(d),f=m instanceof Ue||m instanceof xt?m.mixer:m instanceof Co||m instanceof yu?m:null;if(!f)throw new j(`Expected a Track, Chain, or mixer id, got ${dt(m)}.`);return{mixer:f,owner:m}}let Bt=(d,m)=>d.findIndex(f=>f.handle.id===m.handle.id),gj=(d,m=s().tracks)=>!(d instanceof Wr)&&!(d instanceof Xr)&&Bt(m,d)>=0;function Eo(d,m=s().tracks){if(d instanceof Wr)return"audio";if(d instanceof Xr)return"midi";if(Bt(m,d)>=0)return"group";let f=s();return Bt(f.returnTracks,d)>=0?"return":d.handle.id===f.mainTrack.handle.id?"main":"other"}let Ds=(d,m=s().tracks)=>({...ou(d),is_group:gj(d,m)});function Qn(d,m=s().tracks){let f=Bt(m,d);return{track_id:Y(d),track_name:d.name,track_index:f>=0?f:void 0,track_type:Eo(d,m)}}function Cr(d){try{return d.parent}catch{return null}}function ck(d){let m=s().tracks,f=Cr(d),v=f instanceof Ue?Bt(f.clipSlots,d):-1;for(let b=0;v<0&&b<m.length;b++)v=Bt(m[b].clipSlots,d),v>=0&&(f=m[b]);if(!(f instanceof Ue)||v<0)return{view:"session",clip_slot_id:Y(d)};let $=s().scenes[v];return{view:"session",...Qn(f,m),scene_index:v,scene_id:$?Y($):void 0,scene_name:$?.name,clip_slot_id:Y(d)}}function xh(d){let m=Cr(d);m instanceof Ue||(m=s().tracks.find(v=>Bt(v.takeLanes,d)>=0)??null);let f={take_lane_id:Y(d),take_lane_name:d.name};return m instanceof Ue?{view:"take_lane",...Qn(m),...f,take_lane_index:Bt(m.takeLanes,d)}:{view:"take_lane",...f}}function lk(d){let m=Cr(d);return m instanceof It?ck(m):m instanceof mr?xh(m):m instanceof Ue?{view:"arrangement",...Qn(m)}:null}function Sh(d){let m=[d.name],f=Cr(d);for(let v=0;f&&v<16;v++){if(f instanceof Ue)return{track:f,labels:m};let $=f,b=$ instanceof xt?Cr($):null;if(!($ instanceof xt)||!(b instanceof Gt))break;m.unshift(b.name,Cs($,Bt(b.chains,$))),f=Cr(b)}return{labels:m}}let uk=(d,m)=>(d?[d.name,...m]:m).join(" > ");function dk(d){let m=Cr(d),f=m instanceof xt?Cr(m):null,{track:v,labels:$}=Sh(d);return{...v?Qn(v):{},path:uk(v,$),device_index:m instanceof Ue||m instanceof xt?Bt(m.devices,d):void 0,chain_id:m instanceof xt?Y(m):void 0,rack_device_id:f instanceof Gt?Y(f):void 0}}function vj(d){let m=Cr(d);if(!(m instanceof Gt))return null;let f=Bt(m.chains,d),{track:v,labels:$}=Sh(m);return{...v?Qn(v):{},path:uk(v,[...$,Cs(d,f)]),rack_device_id:Y(m),chain_index:f}}function ei(d){try{if(d instanceof Ir)return lk(d);if(d instanceof It)return ck(d);if(d instanceof mr)return xh(d);if(d instanceof Ct)return dk(d);if(d instanceof xt)return vj(d);if(d instanceof Ue)return Qn(d);if(d instanceof ri){let m=Bt(s().scenes,d);return m>=0?{scene_index:m}:null}if(d instanceof Do){let m=Cr(d);return m instanceof Tr?{simpler_device_id:Y(m),...dk(m)}:null}}catch{}return null}let pk=(d,m,f,v)=>v>f?d<v&&m>f:d<=f&&m>f;function Oo(d,m,f){return d.map(v=>({clip:v,start:q(v.startTime),end:q(v.endTime)})).filter(v=>pk(v.start,v.end,m,f)).sort((v,$)=>v.start-$.start).map(v=>v.clip)}function uu(d,m){if(!d)return m;let f=d.map((v,$)=>yt(`tracks[${$}]`,()=>nt(v)));return f.filter((v,$)=>Bt(f,v)===$)}let Ih=(d,m)=>{let f=Bt(m,d);return{id:Y(d),name:d.name,index:f>=0?f:void 0,type:Eo(d,m)}},Ke=d=>JSON.stringify(d),bt=d=>`${Ke(d.name)} (id ${Y(d)})`,Cs=(d,m)=>d instanceof Yr?`pad ${q(d.receivingNote)}`:`chain ${m}`;function yj(d,m){let f=d.chains;if("chain"in m){let x=f[m.chain];if(!x)throw new j(`chain ${m.chain} out of range in ${bt(d)} (${f.length?`0-${f.length-1}`:"it has no chains"}).`);return{chain:x,label:Cs(x,m.chain)}}if(!(d instanceof ni))throw new j(`${bt(d)} is not a Drum Rack: address its chains by {chain: index}.`);let v=Ai(m.pad,"pad"),$=f.map(x=>x instanceof Yr?q(x.receivingNote):void 0),b=$.flatMap((x,P)=>x===v?[P]:[]);if(b.length===1)return{chain:f[b[0]],label:`pad ${v}`};if(b.length)throw new j(`Ambiguous pad ${v} in ${bt(d)}: chains ${b.join(", ")} all receive note ${v}. Use {chain: index}.`);let w=[...new Set($.filter(x=>x!==void 0))].sort((x,P)=>x-P);throw new j(`No pad receives note ${v} in ${bt(d)} (pads: ${w.join(", ")||"none"}).`)}function mk(d){if(d.device_id!==void 0){if(d.device!==void 0||fn(d))throw new j("Give device_id, or a track and device, not both.");let x=st(d.device_id,Ct);return{device:x,path:[x.name]}}if(d.device===void 0)throw new j("Provide device_id, or a track (track_id, track_index or track_name) and device.");if(!fn(d))throw new j("device needs its track: give track_id, track_index or track_name (or use device_id).");let m=nt(d),f=Array.isArray(d.device)?d.device:[d.device],v=[m.name],$=m.devices,b=`track ${rt(m)}`,w=null;for(let[x,P]of f.entries()){let R=Array.isArray(d.device)?`device[${x}]`:"device";if(typeof P=="object"){if(!w)throw new j(`${R}: a {chain} or {pad} step must follow a rack device.`);let D=w;if(!(D instanceof Gt))throw new j(`${R}: ${bt(D)} is not a rack, so the path cannot go into a chain.`);let{chain:N,label:M}=yt(R,()=>yj(D,P));v.push(M),$=N.devices,b=`${M} of ${bt(D)}`,w=null;continue}if(!$){let D=w;throw new j(D instanceof Gt?`${R}: pick a chain of ${bt(D)} first, with {chain: index} or {pad: note}.`:`${R}: ${bt(D)} is not a rack, so the path cannot continue.`)}let I=$;if(typeof P=="number"){if(!I[P])throw new j(`${R}: device index ${P} out of range on ${b} (${I.length?`0-${I.length-1}`:"it has no devices"}).`);w=I[P]}else{let D=I.map((M,V)=>({device:M,index:V})),N=M=>`${Ke(M.device.name)} (index ${M.index}, id ${Y(M.device)})`;w=yt(`${R} on ${b}`,()=>_t("device",P,D,M=>M.device.name,N,{hint:"Use the device index or device_id."})).device}v.push(w.name),$=null}if(!w)throw new j("device: the path ends at a chain; add the device in it (a name or index).");return{device:w,track:m,path:v}}let du=d=>mk(d).device;function fk(d,m,f){let v=f.toLowerCase(),$=[b=>b===f,b=>b.toLowerCase()===v,b=>b.toLowerCase().includes(v)];for(let b of $){let w=d.filter(x=>m(x).some(b));if(w.length)return w}return[]}function Th(d,m){let f=d.parameters.map((w,x)=>({p:w,index:x,name:w.name})),v=fk(f,w=>[w.name],m);if(v.length===1)return v[0].p;if(!v.length)throw new j(`No parameter named ${Ke(m)} (or containing it) on ${bt(d)}. Find names with parameter_find or device_get {parameter_filter}.`);let $=v.slice(0,20).map(w=>`${Ke(w.name)} (index ${w.index}, id ${Y(w.p)})`),b=v.length>20?`, ... (${v.length-20} more)`:"";throw new j(`Ambiguous parameter ${Ke(m)} on ${bt(d)}: it matches ${$.join(", ")}${b}. Use the exact name or the parameter_id.`)}function _j(d,m){let f=d.valueItems.map((b,w)=>({index:w,label:`${Ke(b.name)} (${w})`,names:[b.name,b.shortName].filter(x=>typeof x=="string")})),v=fk(f,b=>b.names,m);if(v.length===1)return v[0].index;let $=b=>b.map(w=>w.label).join(", ");throw new j(v.length?`Ambiguous value_item ${Ke(m)} for ${Ke(d.name)}: it matches ${$(v)}.`:`No value item ${Ke(m)} for ${Ke(d.name)}. Items: ${$(f)||"none"}.`)}let bj=["value","value_item","reset","delta"];function zh(d){let m=bj.filter(f=>f==="reset"?d.reset===!0:d[f]!==void 0);if(m.length===1)return m[0];throw new j(m.length?`give only one of value, value_item, reset and delta, got ${m.join(" + ")}.`:"give one of value, value_item, reset (true) or delta.")}function Bi(d,m){let f=zh(m),v=q(d.min),$=q(d.max),b=d.isQuantized,w=Ke(d.name),x=(P,R)=>{let I=1e-9*Math.max(1,Math.abs($-v));if(!(P>=v-I&&P<=$+I))throw new j(`${R} ${P} is out of range for ${w} (${v} to ${$}).`);if(b&&!Number.isInteger(P))throw new j(`${w} is quantized: give a whole value_items index or a value_item, not ${P}.`);let D=Math.min($,Math.max(v,P));return{param:d,relative:!1,target:()=>D}};switch(f){case"value":return x(m.value,"value");case"value_item":if(!b)throw new j(`${w} is not quantized: give a value from ${v} to ${$}, not a value_item.`);return x(_j(d,m.value_item),"value_items index");case"reset":{let P=q(d.defaultValue);return{param:d,relative:!1,target:()=>P}}case"delta":{let P=m.delta;if(b&&!Number.isInteger(P))throw new j(`${w} is quantized: delta must be a whole number of steps, not ${P}.`);return{param:d,relative:!0,target:R=>Math.min($,Math.max(v,R+P))}}}}async function Ph(d,m=[]){d.forEach(($,b)=>{let w=d.findIndex(x=>x.param.handle.id===$.param.handle.id);if(w!==b)throw new j(`${m[b]?`${m[b]}: `:""}parameter ${Ke($.param.name)} (id ${Y($.param)}) is set twice${m[w]?`, also by ${m[w]}`:""}.`)});let f=await Promise.all(d.map($=>$.relative?$.param.getValue().then(q):0)),v=d.map(($,b)=>$.target(f[b]));return d.length&&await e.withinTransaction(()=>Promise.all(d.map(($,b)=>$.param.setValue(v[b]).catch(w=>{let x=m[b]?`${m[b]}: `:"";throw new Error(`${x}could not set ${Ke($.param.name)} to ${v[b]}: ${Ie(w)}`)})))),v}function hk(d){if(d.parameter_id!==void 0){if(d.parameter!==void 0||Yn(d,["device_id","device"])||fn(d))throw new j("give parameter_id, or a device and parameter, not both.");return{param:st(d.parameter_id,Ar),device:void 0}}if(d.parameter===void 0)throw new j("give parameter_id, or parameter with device_id or a track and device.");let m=du(d);return{param:Th(m,d.parameter),device:m}}let gk=async({param:d,device:m})=>({...await Ni(d),...m?{device_id:Y(m),device_name:m.name}:{}});async function vk(d,m){try{let f=m.map($=>Bi(Th(d,$.name),$)),v=await Ph(f);return{parameters:f.map(($,b)=>({id:Y($.param),name:$.param.name,value:v[b]}))}}catch(f){return{error:`parameters: ${Ie(f)}`}}}function Eh(d){let m=d.parameters,f=m.find(P=>P.name==="Device On"),v=!f;if(!f&&m[0]?.isQuantized&&m[0].valueItems.length===2&&(f=m[0]),!f)throw new j(`${bt(d)} has no "Device On" parameter (and its first parameter is not a two-state switch), so it cannot be switched on or off.`);let $=f.isQuantized?f.valueItems.map(P=>P.name.toLowerCase()):[],[b,w]=[$.indexOf("on"),$.indexOf("off")],x=b>=0&&w>=0;return{param:f,fallback:v,on:x?b:q(f.max),off:x?w:q(f.min)}}async function yk(d){let m=d.parameters,f=await Promise.all(m.map(v=>v.getValue()));return m.map((v,$)=>({name:v.name,value:q(f[$])}))}async function $j(d,m){let f=new Map;for(let I of d.parameters)f.set(I.name,[...f.get(I.name)??[],I]);let v=new Map,$=[],b=[];for(let{name:I,value:D}of m){let N=v.get(I)??0;v.set(I,N+1);let M=f.get(I)?.[N];if(!M){let V=N?`${bt(d)} has only ${N} parameter${N>1?"s":""} of that name`:`${bt(d)} has no parameter of that name`;$.push({name:I,reason:V});continue}try{b.push({param:M,value:Bi(M,{value:D}).target(D)})}catch(V){$.push({name:I,reason:Ie(V)})}}let w=await Promise.all(b.map(I=>I.param.getValue().then(q))),x=b.filter((I,D)=>w[D]!==I.value),P=x.length?await e.withinTransaction(()=>Promise.allSettled(x.map(I=>I.param.setValue(I.value)))):[],R=0;return P.forEach((I,D)=>{if(I.status==="fulfilled")return;R++;let{param:N,value:M}=x[D];$.push({name:N.name,reason:`Live refused ${M}: ${Ie(I.reason)}`})}),{applied:b.length-R,skipped:$}}function Oh(d,m){if(d instanceof Gt)throw new j(`${bt(d)} is a rack: its chains and their devices are not parameters, so it cannot be ${m}. device_duplicate copies a rack in place.`)}async function _k(d,m,f,v){try{return await d.insertDevice(m,f)}catch($){let b=v?" If the device was renamed in Live, pass its built-in name as device_name.":"";throw new Error(`Could not insert ${Ke(m)}: ${Ie($)}${b} Nothing was changed.`)}}async function jh(d,m,f){try{await d.deleteDevice(m)}catch(v){throw new Error(`${f} The new device ${Y(m)} could not be removed again: ${Ie(v)}.`)}throw new Error(`${f} The new device was removed again; nothing else was changed.`)}async function bk(d,m,f,v){let $=[],b;if(f!==void 0)if(!(d instanceof Tr))$.push({name:"sample",reason:`${bt(d)} is not a Simpler`});else try{b={file_path:(await d.replaceSample(f)).filePath}}catch(x){let P=`Could not load the sample ${f}: ${Ie(x)}.`;throw v&&await jh(v,d,P),new Error(`${P} Nothing was changed.`)}let w=await $j(d,m);return{sample:b,applied:w.applied,skipped:[...$,...w.skipped]}}let Rh=()=>t9(e.environment.storageDirectory);async function As(d){let m=d instanceof Co?s().returnTracks.map(b=>b.name):[],[f,v,$]=await Promise.all([Ni(d.volume),Ni(d.panning),Promise.all(d.sends.map(b=>Ni(b)))]);return{id:Y(d),volume:{...f,hint:"normalized 0-1 (0.85 = 0 dB unity, 1.0 = +6 dB)"},panning:{...v,hint:"-1 = full left, 0 = center, 1 = full right"},sends:$.map((b,w)=>({...b,return_track:m[w]}))}}u("track_get",{title:"Get track",annotations:Et},"Get detail for one track: properties, clip slots (session view, with clips), take lanes, arrangement clips, devices, and mixer (volume/pan/sends with current values). Works for regular, return, and main tracks; group tracks have `is_group: true` (their `type`, like return and main tracks', is 'other'). Address by track_id, track_index (0-based, regular tracks only), or track_name. Use `include` to fetch only some sections.",{...ht(),include:y.array(y.enum(["clip_slots","take_lanes","arrangement_clips","devices","mixer"])).optional().describe("Sections to include; omit for everything")},async d=>{let m=nt(d),f=v=>!d.include||d.include.includes(v);return{...Ds(m),clip_slots:f("clip_slots")?m.clipSlots.map(g1):void 0,take_lanes:f("take_lanes")?m.takeLanes.map(gh):void 0,arrangement_clips:f("arrangement_clips")?m.arrangementClips.map(v=>dr(v)):void 0,devices:f("devices")?m.devices.map(pr):void 0,mixer:f("mixer")?await As(m.mixer):void 0}});let Dh=()=>({name:y.string().optional(),mute:y.boolean().optional(),solo:y.boolean().optional(),arm:y.boolean().optional()}),Ch=Object.keys(Dh());u("track_set",{title:"Set track properties",annotations:Xn},"Set track properties (name, mute, solo, arm). Address the track by track_id, track_index or track_name, or pass `items` (one entry per track, same fields) to change many tracks at once, e.g. mute all but the vocals. All changes form one undo step; nothing is changed if any entry is invalid.",{...ht(),...Dh(),items:y.array(y.object({...ht(),...Dh()})).min(1).optional().describe("Batch form: one entry per track; returns {items}")},d=>{let{list:m,batch:f}=zo(d,d.items,[...Object.keys(ht()),...Ch]),v=m.map((w,x)=>yt(qi(f,x),()=>{let P=nt(w);if(f&&!Yn(w,Ch))throw new j("nothing to set \u2014 give name, mute, solo and/or arm.");return{track:P,it:w}}));v.some(({it:w})=>Yn(w,Ch))&&e.withinTransaction(()=>{for(let{track:w,it:x}of v)x.name!==void 0&&(w.name=x.name),x.mute!==void 0&&(w.mute=x.mute),x.solo!==void 0&&(w.solo=x.solo),x.arm!==void 0&&(w.arm=x.arm)});let $=s().tracks,b=v.map(({track:w})=>Ds(w,$));return f?{items:b}:b[0]}),u("track_create",{title:"Create track",annotations:Gr},"Create a new audio or MIDI track, optionally named and with built-in devices inserted in order (each a name, or {name, parameters:[{name, value | value_item | reset | delta}]} to set initial parameter values: internal units, or a quantized parameter's choice by name). The track is inserted after the last selected track in Live, or appended if none is selected, so the result carries its `index`. Once the track exists, a failing name or device does not fail the call: it is reported in `errors` (and on its `devices` entry) while the rest is still applied.",{type:y.enum(["audio","midi"]),name:y.string().optional(),devices:y.array(y.union([y.string().min(1).describe("Built-in device name, e.g. 'Operator', 'Reverb'"),y.object({name:y.string().min(1).describe("Built-in device name"),parameters:y.array(ij).optional()})])).optional().describe("Devices to insert, in chain order")},async({type:d,name:m,devices:f})=>{for(let[w,x]of(f??[]).entries())typeof x!="string"&&x.parameters?.forEach((P,R)=>yt(`devices[${w}].parameters[${R}]`,()=>zh(P)));let v=d==="audio"?await s().createAudioTrack():await s().createMidiTrack(),$=[];if(m!==void 0)try{v.name=m}catch(w){$.push(`name: ${Ie(w)}`)}let b=[];for(let[w,x]of(f??[]).entries()){let{name:P,parameters:R}=typeof x=="string"?{name:x,parameters:[]}:x,I;try{I=await v.insertDevice(P,v.devices.length)}catch(N){let M=Ie(N);$.push(`devices[${w}] (${P}): ${M}`),b.push({requested:P,error:M});continue}let D={requested:P,...pr(I)};if(R?.length){let N=await vk(I,R);D.parameters=N.parameters,N.error&&($.push(`devices[${w}] (${P}): ${N.error}`),D.error=N.error)}b.push(D)}return{...ou(v),index:s().tracks.findIndex(w=>w.handle.id===v.handle.id),devices:f?b:void 0,errors:$.length?$:void 0}}),u("track_delete",{title:"Delete track",annotations:jn},"Delete a track, addressed by track_id, track_index or its exact track_name.",{...ht(),track_name:Gq},async d=>{let m=nt(d,{exactName:!0}),f={deleted:Y(m),name:m.name};return await s().deleteTrack(m),f}),u("track_duplicate",{title:"Duplicate track",annotations:Gr},"Duplicate a track. The copy is inserted right after the original.",{...ht()},async d=>Ds(await s().duplicateTrack(nt(d)))),u("track_clear_clips_in_range",{title:"Clear arrangement clips in range",annotations:jn},"Delete all arrangement clips of a track within a beat range. Clips overlapping a boundary are truncated to the range edge.",{...ht(),start_time:y.number(),end_time:y.number()},async({start_time:d,end_time:m,...f})=>(await nt(f).clearClipsInRange(d,m),{cleared:[d,m]})),u("take_lane_create",{title:"Create take lane",annotations:Gr},"Create a new take lane on a track (appended after existing lanes).",{...ht()},async d=>gh(await nt(d).createTakeLane())),u("take_lane_set",{title:"Rename take lane",annotations:Xn},"Rename a take lane, or several with `items` (one undo step).",{take_lane_id:y.string().optional(),name:y.string().optional(),items:y.array(y.object({take_lane_id:y.string(),name:y.string()})).min(1).optional().describe("Batch form: one entry per take lane; returns {items}")},d=>{let{list:m,batch:f}=zo(d,d.items,["take_lane_id","name"]),v=m.map((b,w)=>yt(qi(f,w),()=>{if(b.take_lane_id===void 0||b.name===void 0)throw new j("take_lane_id and name are required.");return{lane:st(b.take_lane_id,mr),name:b.name}}));e.withinTransaction(()=>{for(let{lane:b,name:w}of v)b.name=w});let $=v.map(({lane:b})=>gh(b));return f?{items:$}:$[0]});let Ah=d=>s().scenes.findIndex(m=>m.handle.id===d.handle.id);async function Nh(d,m){let f=await e.withinTransaction(()=>Promise.allSettled(d.map(($,b)=>m(b))));if(f.every($=>$.status==="rejected"))throw new Error(`Nothing was created: ${Ie(f[0].reason)}`);let v=[];return d.some($=>$.name!==void 0)&&e.withinTransaction(()=>f.forEach(($,b)=>{let w=d[b].name;if(!($.status!=="fulfilled"||w===void 0))try{$.value.name=w}catch(x){v[b]=`name: ${Ie(x)}`}})),f.map(($,b)=>$.status==="fulfilled"?{created:$.value,error:v[b]}:{error:Ie($.reason)})}let $k=()=>({index:y.number().int().min(-1).optional().describe("0-based insert position; -1 or omitted = append at the end"),name:y.string().optional()});u("scene_create",{title:"Create scene",annotations:Gr},"Create a scene at the given index (0-based; -1 or omitted appends at the end), optionally named. `items` creates several scenes in one call, in order: each entry's index refers to the scene list after the previous entries were inserted. A batch takes two undo steps (creates, then names) and reports a failed entry as {error} instead of failing the call.",{...$k(),items:y.array(y.object($k())).min(1).optional().describe("Batch form: one entry per new scene; returns {items}")},async d=>{let{list:m,batch:f}=zo(d,d.items,["index","name"]),v=s().scenes.length;if(m.forEach((b,w)=>yt(qi(f,w),()=>{if(b.index!==void 0&&b.index>v+w)throw new j(`index ${b.index} out of range (0-${v+w}, or -1 to append).`)})),!f){let b=await s().createScene(d.index??-1);return d.name!==void 0&&(b.name=d.name),Li(b,Ah(b))}return{items:(await Nh(m,b=>s().createScene(m[b].index??-1))).map(b=>b.created?{...Li(b.created,Ah(b.created)),error:b.error}:b)}}),u("scene_set",{title:"Rename scene",annotations:Xn},"Rename a scene, addressed by scene_id, scene_index or scene_name; or rename several with `items` (one entry per scene). All renames form one undo step.",{...Es(),name:y.string().optional().describe("New name (required unless items is given)"),items:y.array(y.object({...Es(),name:y.string()})).min(1).optional().describe("Batch form: one entry per scene; returns {items}")},d=>{let{list:m,batch:f}=zo(d,d.items,[...Object.keys(Es()),"name"]),v=m.map((b,w)=>yt(qi(f,w),()=>{if(b.name===void 0)throw new j("name is required.");return{...Dr(b),name:b.name}}));e.withinTransaction(()=>{for(let{scene:b,name:w}of v)b.name=w});let $=v.map(({scene:b,index:w})=>Li(b,w));return f?{items:$}:$[0]}),u("scene_delete",{title:"Delete scene",annotations:jn},"Delete a scene, addressed by scene_id, scene_index or its exact scene_name.",{...Es(),scene_name:Kq},async d=>{let{scene:m}=Dr(d,{exactName:!0}),f={deleted:Y(m),name:m.name};return await s().deleteScene(m),f}),u("scene_duplicate",{title:"Duplicate scene",annotations:Gr},"Duplicate a scene. The copy is inserted right after the original.",{...Es()},async d=>{let m=await s().duplicateScene(Dr(d).scene);return Li(m,Ah(m))}),u("scene_get",{title:"Get scene",annotations:Et},"Get one session row: a scene (scene_id, scene_index or scene_name) and, for every regular track in order, its clip slot in that scene with the clip in it (clip summary, or null for an empty slot; group tracks' slots hold no clips). only_clips leaves out the empty slots. For the whole session at a glance use session_grid.",{...Es(),only_clips:y.boolean().default(!1).describe("Leave out the tracks whose slot in this scene is empty")},({only_clips:d,...m})=>{let{scene:f,index:v}=Dr(m),$=s().tracks,b=$.map((w,x)=>{let P=w.clipSlots[v],R=P?.clip??null;return{track_index:x,track_id:Y(w),track_name:w.name,track_type:Eo(w,$),slot_id:P?Y(P):null,clip:R?dr(R):null}});return{...Li(f,v),clip_count:b.filter(w=>w.clip).length,slots:d?b.filter(w=>w.clip):b}});let Mh=1e4;u("session_grid",{title:"Get session grid",annotations:Et},`The Session View at a glance, as a track \xD7 scene matrix: \`scenes\` are the columns (index, id, name); each entry of \`tracks\` (id, name, index, type, group_track_id) has one cell per column \u2014 null for an empty slot, or the clip in brief {id, class, name, duration, muted, looping} (clip_get has the detail). Narrow it with \`tracks\` (in that order) and scene_index_min / scene_index_max (inclusive); at most ${Mh} cells per call. For one scene with full clip summaries use scene_get.`,{tracks:y.array(y.object(ht())).min(1).optional().describe("Only these tracks (each by track_id, track_index or track_name); omit for every regular track"),scene_index_min:y.number().int().min(0).optional().describe("First scene (0-based); default 0"),scene_index_max:y.number().int().min(0).optional().describe("Last scene, inclusive; default (and at most) the last scene")},({tracks:d,scene_index_min:m,scene_index_max:f})=>{let v=s().scenes,$=m??0;if(f!==void 0&&f<$)throw new j(`scene_index_max ${f} is before scene_index_min ${$}.`);if($>0&&$>=v.length)throw Dt("scene_index_min",$,v.length);let b=Math.min(f??v.length-1,v.length-1),w=v.slice($,b+1).map((N,M)=>({index:$+M,id:Y(N),name:N.name})),x=s().tracks,P=uu(d,x),R=P.length*w.length;if(R>Mh)throw new j(`${P.length} tracks \xD7 ${w.length} scenes = ${R} cells, at most ${Mh} per call: narrow it with tracks or scene_index_min / scene_index_max.`);let I=0,D=P.map(N=>{let M=N.clipSlots,V=N.groupTrack;return{...Ih(N,x),group_track_id:V?Y(V):null,cells:w.map(({index:le})=>{let K=M[le]?.clip;return K?(I++,hh(K)):null})}});return{scenes:w,tracks:D,clip_count:I}}),u("cue_point_create",{title:"Create cue point",annotations:Gr},"Create an arrangement cue point (locator) at a beat position, optionally named. `items` creates several in one call (two undo steps: creates, then names) and reports a failed entry as {error} instead of failing the call.",{time:y.number().optional().describe("Position in the arrangement in beats (required unless items is given)"),name:y.string().optional(),items:y.array(y.object({time:y.number().describe("Position in the arrangement in beats"),name:y.string().optional()})).min(1).optional().describe("Batch form: one entry per cue point; returns {items}")},async d=>{let{list:m,batch:f}=zo(d,d.items,["time","name"]),v=m.map((b,w)=>yt(qi(f,w),()=>{if(b.time===void 0)throw new j("time is required.");if(m.findIndex(x=>x.time===b.time)!==w)throw new j(`time ${b.time} is given twice.`);return b.time}));if(!f){let b=await s().createCuePoint(v[0]);return d.name!==void 0&&(b.name=d.name),Ui(b)}return{items:(await Nh(m,b=>s().createCuePoint(v[b]))).map(b=>b.created?{...Ui(b.created),error:b.error}:b)}}),u("cue_point_set",{title:"Rename or move cue point",annotations:Xn},"Rename and/or move a cue point (locator), or several with `items`. Live cannot change a cue point's time, so a move creates a cue point at `time` with the same (or the given) name, then deletes the old one: the result carries the new id and `replaced_id` (the old id is gone). A move onto a beat where another cue point sits is refused. Renames form one undo step; moves take up to three (creates, names, deletes). If no replacement can be created, nothing is changed; if an old cue point cannot be deleted, its entry reports `error` next to the new cue point.",{cue_point_id:y.string().optional(),name:y.string().optional(),time:y.number().optional().describe("Move to this arrangement position in beats"),items:y.array(y.object({cue_point_id:y.string(),name:y.string().optional(),time:y.number().optional().describe("Move to this arrangement position in beats")})).min(1).optional().describe("Batch form: one entry per cue point; returns {items}")},async d=>{let{list:m,batch:f}=zo(d,d.items,["cue_point_id","name","time"]),v=s().cuePoints.map(I=>({id:Y(I),time:q(I.time)})),$=m.map((I,D)=>yt(qi(f,D),()=>{if(I.cue_point_id===void 0)throw new j("cue_point_id is required.");if(I.name===void 0&&I.time===void 0)throw new j("nothing to set \u2014 give name and/or time.");if(m.findIndex(V=>V.cue_point_id===I.cue_point_id)!==D)throw new j(`cue point ${I.cue_point_id} is given twice.`);let N=st(I.cue_point_id,Ro),M=I.time!==void 0&&I.time!==q(N.time)?I.time:void 0;if(M!==void 0){let V=v.find(le=>le.time===M);if(V)throw new j(`cue point ${V.id} is already at beat ${M}.`);if(m.slice(0,D).some(le=>le.time===M))throw new j(`time ${M} is given twice.`)}return{id:I.cue_point_id,cue:N,name:I.name,oldName:N.name,moveTo:M,i:D}})),b=$.filter(I=>I.moveTo!==void 0),w=new Map;if(b.length){let I=new Set(v.map(V=>V.id)),D=await e.withinTransaction(()=>Promise.allSettled(b.map(V=>s().createCuePoint(V.moveTo)))),N=D.map(V=>V.status==="fulfilled"&&!I.has(Y(V.value))?V.value:null),M=N.findIndex(V=>!V);if(M>=0){let V=N.filter(_e=>_e!==null),le=V.length?await e.withinTransaction(()=>Promise.allSettled(V.map(_e=>s().deleteCuePoint(_e)))):[],K=V.filter((_e,F)=>le[F].status==="rejected").map(_e=>Y(_e)),oe=D[M],W=oe.status==="rejected"?Ie(oe.reason):`Live returned the existing cue point ${Y(oe.value)} instead of a new one`,ce=qi(f,b[M].i);throw new Error(`${ce?`${ce}: `:""}could not create a cue point at beat ${b[M].moveTo}: ${W}. `+(K.length?`The replacement cue points ${K.join(", ")} could not be removed again; nothing else was changed.`:"Nothing was changed."))}b.forEach((V,le)=>w.set(V,N[le]))}let x=$.flatMap(I=>{let D=I.name??(I.moveTo!==void 0?I.oldName:void 0);return D===void 0?[]:[{target:w.get(I)??I.cue,name:D}]});x.length&&e.withinTransaction(()=>{for(let{target:I,name:D}of x)I.name=D});let P=b.length?await e.withinTransaction(()=>Promise.allSettled(b.map(I=>s().deleteCuePoint(I.cue)))):[],R=$.map(I=>{let D=b.indexOf(I);if(D<0)return Ui(I.cue);let N=Ui(w.get(I)),M=P[D];return M.status==="fulfilled"?{...N,replaced_id:I.id}:{...N,error:`moved, but the old cue point ${I.id} could not be deleted: ${Ie(M.reason)}`}});return f?{items:R}:R[0]}),u("cue_point_delete",{title:"Delete cue point",annotations:jn},"Delete a cue point.",{cue_point_id:y.string()},async({cue_point_id:d})=>(await s().deleteCuePoint(st(d,Ro)),{deleted:d}));let Lh=500;u("arrangement_get",{title:"Get arrangement range",annotations:Et},`What happens in the arrangement between start_time and end_time (beats; default: from 0 to the end of the song): the cue points in the range, and for every regular track (or only \`tracks\`) the arrangement clips that overlap it \u2014 clip summaries by start time, a clip overlaps when it starts before end_time and ends after start_time \u2014 plus, with include_take_lanes, each take lane's overlapping clips. \`song_end\` is derived: the latest end of any arrangement clip on a regular track (Live's API has no song length; take lanes and cue points do not count). At 4/4, bar n starts at beat (n - 1) \xD7 4. At most ${Lh} clips are listed: \`clip_count\` counts them all and \`truncated\` says when some were left out.`,{start_time:y.number().optional().describe("Range start in beats; default 0"),end_time:y.number().optional().describe("Range end in beats (exclusive); default: everything after start_time"),tracks:y.array(y.object(ht())).min(1).optional().describe("Only these tracks (each by track_id, track_index or track_name); omit for every regular track"),include_take_lanes:y.boolean().default(!1).describe("Also list each take lane's clips in the range")},({start_time:d,end_time:m,tracks:f,include_take_lanes:v})=>{let $=d??0;if(m!==void 0&&m<=$)throw new j(`end_time ${m} must be after start_time ${$}.`);let b=m??1/0,w=s().tracks,x=uu(f,w),P=0;for(let V of w)for(let le of V.arrangementClips)P=Math.max(P,q(le.endTime));let R=0,I=0,D=V=>{let le=Oo(V,$,b),K=Math.max(0,Lh-R);return I+=le.length,R+=Math.min(K,le.length),le.slice(0,K).map(oe=>dr(oe))},N=x.map(V=>({...Ih(V,w),clips:D(V.arrangementClips),take_lanes:v?V.takeLanes.map((le,K)=>({id:Y(le),name:le.name,index:K,clips:D(le.clips)})):void 0})),M=s().cuePoints.map(Ui).filter(V=>V.time>=$&&V.time<b).sort((V,le)=>V.time-le.time);return{start_time:$,end_time:m??Math.max(P,$),song_end:P,cue_points:M,tracks:N,clip_count:I,truncated:I>R?`Only the first ${Lh} of ${I} clips are listed (tracks in order): narrow the range or the tracks.`:void 0}});function wk(d){let m=Rs(d);if(!Xq(d))return m;if(!(m instanceof Ue))throw new j(`scene_index/scene_id/scene_name require a Track target, got ${dt(m)}.`);let{index:f}=Dr(d),v=m.clipSlots[f];if(!v)throw new j(`scene_index ${f} out of range (track has ${m.clipSlots.length} slots).`);return v}function kk(d){let m=Cr(d);if(m instanceof Ue)return m;let f=v=>d instanceof It?v.clipSlots:v.takeLanes;return s().tracks.find(v=>Bt(f(v),d)>=0)??null}let pu=d=>({looping:d.looping,startMarker:q(d.startMarker),endMarker:q(d.endMarker),loopStart:q(d.loopStart),loopEnd:q(d.loopEnd)});async function xk(d){let m=d.parent;if(m instanceof It)await m.deleteClip();else if(m instanceof Ue)await m.deleteClip(d);else if(m instanceof mr&&m.parent instanceof Ue)await m.parent.deleteClip(d);else throw new Error(`Cannot determine how to delete clip with parent ${m?dt(m):"null"}.`)}u("clip_create",{title:"Create clip",annotations:Gr},'Create a MIDI or audio clip. Target: a clip slot id (session view), a track (target_id, or track_id/track_index/track_name; arrangement \u2014 MidiTrack for midi, AudioTrack for audio; requires start_time \u2014 OR the session slot of a scene when scene_index/scene_id/scene_name is given), or a take lane id (requires start_time). MIDI clips require duration and can be created with their notes inline: `notes`, step `patterns` (one pitch per string, e.g. {note:"C1", steps:"x...x..."}) and `repeat` {length} to copy them along the clip (file_path, is_warped and loop_settings are ignored, with a `warning`). Audio clips require file_path; by default the file is first imported into the Live project (recommended). Optional name/color apply right after creation.',{type:y.enum(["midi","audio"]),target_id:y.string().optional().describe("ClipSlot, Track, or TakeLane id; or give the track by track_id/track_index/track_name"),...ht(),scene_index:y.number().int().min(0).optional().describe("With a track target: create in this session clip slot instead of the arrangement"),scene_id:y.string().optional().describe("With a track target: the session clip slot of this scene"),scene_name:y.string().optional().describe("With a track target: the session clip slot of the scene with this name"),start_time:y.number().optional().describe("Arrangement position in beats (track/take-lane targets)"),duration:y.number().positive().optional().describe("Clip length in beats"),notes:y.array(y.object(J1)).optional().describe("MIDI only: initial notes"),patterns:y.array(G1()).optional().describe("MIDI only: step patterns, written with the notes, e.g. a drum line per pad"),repeat:K1().optional(),name:y.string().optional(),color:y.string().optional().describe("#RRGGBB"),file_path:y.string().optional().describe("Audio file path (audio clips only)"),is_warped:y.boolean().optional().describe("Audio only. Required when loop_settings is set"),loop_settings:Jq.optional(),import_into_project:y.boolean().default(!0).describe("Audio only: copy the file into the Live project first")},async d=>{let m;if(d.type==="midi"){let R=["file_path","is_warped","loop_settings"].filter(I=>d[I]!==void 0);R.length&&(m=`${R.join(", ")} only apply to audio clips: ignored for this MIDI clip.`)}else{let R=["notes","patterns","repeat"].filter(I=>d[I]!==void 0);if(R.length)throw new j(`${R.join(", ")} only apply to MIDI clips.`)}let f=wk(d),v=(R,I)=>{if(R==null)throw new j(`${I} is required for this target/type.`)},$=d.color!==void 0?iu(d.color):void 0,b=(R,I)=>(d.name!==void 0&&(R.name=d.name),$!==void 0&&(R.color=$),{...dr(R,!0),...I});if(d.type==="midi"){v(d.duration,"duration");let{notes:R}=W1(d,d.duration),I;if(f instanceof It)I=await f.createMidiClip(d.duration);else if(f instanceof Xr||f instanceof mr)v(d.start_time,"start_time"),I=await f.createMidiClip(d.start_time,d.duration);else throw new j(`MIDI clips need a ClipSlot, MidiTrack, or TakeLane target, got ${dt(f)}.`);return R.length&&(I.notes=R),b(I,{warning:m})}if(v(d.file_path,"file_path"),!(f instanceof It)&&!(f instanceof Wr)&&!(f instanceof mr))throw new j(`Audio clips need a ClipSlot, AudioTrack, or TakeLane target, got ${dt(f)}.`);if(f instanceof It||v(d.start_time,"start_time"),d.loop_settings&&d.is_warped===void 0)throw new j("is_warped is required when loop_settings is set.");let w=d.import_into_project?await e.resources.importIntoProject(d.file_path):d.file_path,x=d.loop_settings&&{looping:d.loop_settings.looping,startMarker:d.loop_settings.start_marker,endMarker:d.loop_settings.end_marker,loopStart:d.loop_settings.loop_start,loopEnd:d.loop_settings.loop_end},P;return f instanceof It?P=await f.createAudioClip({filePath:w,isWarped:d.is_warped,loopSettings:x}):P=await f.createAudioClip({filePath:w,startTime:d.start_time,duration:d.duration,isWarped:d.is_warped,loopSettings:x}),b(P,{imported_path:d.import_into_project?w:void 0})}),u("clip_get",{title:"Get clip",annotations:Et},"Get full detail for one clip (MIDI: note count; audio: file, warp settings and warp markers) and its `location`: view 'session' (track, scene_index, scene and clip slot), 'arrangement' (track) or 'take_lane' (track and take lane). Use midi_clip_get_notes for the actual notes.",{clip_id:y.string()},({clip_id:d})=>{let m=st(d,Ir);return{...dr(m,!0),location:ei(m)}});let Uh=()=>({name:y.string().optional(),color:y.string().optional().describe("#RRGGBB"),muted:y.boolean().optional(),looping:y.boolean().optional(),warping:y.boolean().optional().describe("Audio clips only"),warp_mode:y.enum(jq).optional().describe("Audio clips only")}),Ns=Object.keys(Uh());function Sk(d,m){let f=m.color!==void 0?iu(m.color):void 0;if((m.warping!==void 0||m.warp_mode!==void 0)&&!(d instanceof Ht))throw new j("warping/warp_mode only apply to audio clips.");return()=>{m.name!==void 0&&(d.name=m.name),f!==void 0&&(d.color=f),m.muted!==void 0&&(d.muted=m.muted),m.looping!==void 0&&(d.looping=m.looping),d instanceof Ht&&(m.warping!==void 0&&(d.warping=m.warping),m.warp_mode!==void 0&&(d.warpMode=_u[m.warp_mode]))}}let wj=["all","session","arrangement","take_lanes"];function Ik(d,m,f){let v=x=>m==="all"||m===x,$=[...v("session")?d.clipSlots.flatMap(x=>x.clip??[]):[],...v("arrangement")?d.arrangementClips:[],...v("take_lanes")?d.takeLanes.flatMap(x=>x.clips):[]],b=new Set,w=f?.toLowerCase();return $.filter(x=>b.has(x.handle.id)?!1:(b.add(x.handle.id),w===void 0||x.name.toLowerCase().includes(w)))}u("clip_set",{title:"Set clip properties",annotations:Xn},"Set clip properties. color is '#RRGGBB'. warping/warp_mode apply to audio clips only. Note: enabling looping on an unwarped audio clip enables warping. Address one clip by clip_id; several by `items` (one entry per clip, each with its own values); or every clip of one track by `select` {track_id | track_index | track_name, scope, name_contains} with the values at the top level, e.g. warp all clips of the Drums track. All changes form one undo step; nothing is changed if any clip is invalid.",{clip_id:y.string().optional(),...Uh(),items:y.array(y.object({clip_id:y.string(),...Uh()})).min(1).optional().describe("Batch form: one entry per clip; returns {items}"),select:y.object({...ht(),scope:y.enum(wj).default("all").describe("session slots, arrangement, take lanes, or all of them"),name_contains:y.string().optional().describe("Only clips whose name contains this (case-insensitive)")}).optional().describe("Apply the top-level values to the matching clips of one track; returns {items}")},d=>{let m,f=!0,v;if(d.select){if(d.clip_id!==void 0||d.items)throw new j("Give one of clip_id, items, or select.");if(!Yn(d,Ns))throw new j(`Nothing to set \u2014 give ${Ns.join(", ")}.`);let{scope:b,name_contains:w,...x}=d.select;v=!0,m=Ik(nt(x),b,w).map(P=>yt(()=>`clip ${Y(P)} (${JSON.stringify(P.name)})`,()=>({clip:P,write:Sk(P,d)})))}else{let b=zo(d,d.items,["clip_id",...Ns]);v=b.batch,m=b.list.map((w,x)=>yt(qi(v,x),()=>{if(w.clip_id===void 0)throw new j("Provide clip_id, items, or select.");let P=st(w.clip_id,Ir);if(!Yn(w,Ns)){if(v)throw new j(`nothing to set \u2014 give ${Ns.join(", ")}.`);f=!1}return{clip:P,write:Sk(P,w)}}))}m.length&&f&&e.withinTransaction(()=>{for(let{write:b}of m)b()});let $=m.map(({clip:b})=>dr(b));return v?{items:$}:$[0]}),u("clip_delete",{title:"Delete clip",annotations:jn},"Delete a clip (session or arrangement). The clip's parent determines how it is removed.",{clip_id:y.string()},async({clip_id:d})=>(await xk(st(d,Ir)),{deleted:d}));let mu=["clip envelopes (automation and modulation)","groove, launch settings and follow actions"],Tk=[...mu,"clip gain, transpose and fades (not in Live's API)","warp markers: Live warps the copy itself (from the file's .asd analysis or its Auto-Warp preference), so the same beat positions can map to other audio \u2014 see warp_markers_match"],zk=.25;function Pk(d){let m=d.filePath;if(!m)throw new Error(`Audio clip ${Y(d)} has no file path, so it cannot be copied.`);let f=d.warping,v=pu(d),$=[...Tk],b=v.looping&&f;b&&v.loopEnd-v.loopStart<zk&&(b=!1,$.push("the loop: it is shorter than 0.25 beats, the shortest a new clip allows"));let w={looping:b,startMarker:v.startMarker,endMarker:v.endMarker,loopStart:b?v.loopStart:v.startMarker,loopEnd:b?v.loopEnd:v.endMarker},x=[w.startMarker,w.endMarker,w.loopStart,w.loopEnd],P=w.startMarker<=w.endMarker&&w.loopEnd-w.loopStart>=zk&&(f||x.every(R=>R>=0));return P||$.push("the start/end markers and loop (a new clip cannot have them): the copy plays the file's own region"),{filePath:m,isWarped:f,loopSettings:P?w:void 0,warpMode:q(d.warpMode),warpMarkers:f?d.warpMarkers:void 0,lost:$}}let kj=(d,m)=>d.length===m.length&&d.every((f,v)=>q(f.beatTime)===q(m[v].beatTime)&&q(f.sampleTime)===q(m[v].sampleTime));function Ek(d,m,f){let v=m.loopSettings,$=pu(d),b=v?["looping","startMarker","endMarker","loopStart","loopEnd"].filter(x=>$[x]!==v[x]).map(x=>({field:x.replace(/[A-Z]/g,P=>`_${P.toLowerCase()}`),requested:v[x],got:$[x]})):[],w=q(d.duration);return f!==void 0&&Math.abs(w-f)>1e-9&&b.push({field:"duration",requested:f,got:w}),{warp_markers_match:m.warpMarkers?kj(d.warpMarkers,m.warpMarkers):void 0,differs:b.length?b:void 0}}function Ok(d,m,f,v){f?.length&&d instanceof Jt&&(d.notes=f),d.name!==m.name&&(d.name=m.name),q(d.color)!==m.color&&(d.color=m.color),d.muted!==m.muted&&(d.muted=m.muted),d instanceof Jt&&d.looping!==m.looping&&(d.looping=m.looping),d instanceof Ht&&v!==void 0&&d.warping&&q(d.warpMode)!==v&&(d.warpMode=v)}u("clip_copy",{title:"Copy or move clip",annotations:Vi},"Copy a clip to a session slot, an arrangement position or a take lane, or move it there (move:true deletes the source once the copy exists). Live's API has no clip copy or move, so a new clip is created. Target as in clip_create: a clip slot id (target_id, or a track with scene_index/scene_id/scene_name; the slot must be empty), or a track or take lane id with start_time (beats). MIDI clips go to MIDI tracks, audio clips to audio tracks. `duration` sets the copy's length (default: the source's `duration`); a longer MIDI copy repeats the source's loop (or its region, when it does not loop), a longer audio copy only repeats a looping source (Live caps the others). MIDI: the notes are re-based to where the source plays them \u2014 the copy starts at its first played beat, since the API cannot set a MIDI clip's markers or loop \u2014 and `fidelity` is 'notes'. In the arrangement the copy plays the same. A session copy of a looping clip loops its whole length, so it only repeats like the source when the source's start marker is inside its loop and the copy holds whole loops; otherwise `lost` says what differs. A session MIDI source's default length comes from its markers (its first pass: any part before the loop, then the loop once). Audio: the copy uses the source's file, warping, warp mode and markers/loop (as Live allows them for a new clip); Live warps it itself, so `fidelity` is 'approximate', `warp_markers_match` says whether it warped like the source and `differs` lists region fields (or the length) Live set otherwise. `lost` lists what no copy carries over (envelopes, groove, launch settings, ...). name and color default to the source's. An arrangement copy over existing clips reports them in `overlaps`. Undo steps: create, notes and properties, delete (move). If the copy cannot be created, nothing is changed.",{clip_id:y.string().describe("The clip to copy or move"),target_id:y.string().optional().describe("ClipSlot, Track or TakeLane id; or give the track by track_id/track_index/track_name"),...ht(),scene_index:y.number().int().min(0).optional().describe("With a track target: copy to this session clip slot instead of the arrangement"),scene_id:y.string().optional().describe("With a track target: the session clip slot of this scene"),scene_name:y.string().optional().describe("With a track target: the session clip slot of the scene with this name"),start_time:y.number().min(0).optional().describe("Arrangement position in beats (track and take-lane targets)"),duration:y.number().positive().optional().describe("Length of the copy in beats; default the source's. Longer: the source's loop (or a MIDI region) repeats"),name:y.string().optional().describe("Name of the copy; default the source's"),color:y.string().optional().describe("#RRGGBB; default the source's"),move:y.boolean().default(!1).describe("Delete the source once the copy exists")},async d=>{let m=st(d.clip_id,Ir);if(!(m instanceof Jt)&&!(m instanceof Ht))throw new j(`Clip ${d.clip_id} is neither a MIDI nor an audio clip.`);let f=m instanceof Jt,v=d.color!==void 0?iu(d.color):void 0,$=wk(d),b;if($ instanceof It){if(d.start_time!==void 0)throw new j("start_time only applies to arrangement and take-lane targets, not a clip slot.");if(!f&&d.duration!==void 0)throw new j("An audio copy in a clip slot takes no duration: its length follows the source's markers.");let F=$.clip;if(F)throw new j(F.handle.id===m.handle.id?"The target is the clip's own slot.":`The target slot already holds clip ${Y(F)} (${Ke(F.name)}): delete it first or pick an empty slot.`);b=kk($)}else if($ instanceof Ue||$ instanceof mr){if(d.start_time===void 0)throw new j("start_time is required for arrangement and take-lane targets.");b=$ instanceof Ue?$:kk($)}else throw new j(`Clips can be copied to a ClipSlot, Track or TakeLane, got ${dt($)}.`);let w=f?"MIDI":"audio",x=F=>f?F instanceof Xr:F instanceof Wr;if(($ instanceof Ue||b)&&!x(b))throw new j(`A ${w} clip can only be copied to a ${w} track; ${rt(b)} is of type ${Eo(b)}.`);let P=Cr(m),R=pu(m),I=d.duration??(f&&P instanceof It?R1(R):q(m.duration));if(!(I>0))throw new Error(`Clip ${d.clip_id} has no length (${I} beats), so it cannot be copied.`);let D=d.start_time??0;if(d.move&&!($ instanceof It)&&P?.handle.id===$.handle.id&&q(m.startTime)===D&&I===q(m.duration))return{...dr(m,!0),location:ei(m),source_id:d.clip_id,moved:!1,unchanged:"the clip is already there"};let N={name:d.name??m.name,color:v??q(m.color),muted:m.muted,looping:R.looping},M=m instanceof Jt?Qw(m.notes,R,0,I,js):void 0,V=m instanceof Ht?Pk(m):void 0,le=f&&$ instanceof It?j1(R,I):void 0,K=$ instanceof Ue?$.arrangementClips:$ instanceof mr?$.clips:[],oe=Oo(K,D,D+I).filter(F=>!(d.move&&F.handle.id===m.handle.id)).map(F=>Y(F)),W;try{if(V){let{filePath:F,isWarped:ae,loopSettings:ue}=V;W=$ instanceof It?await $.createAudioClip({filePath:F,isWarped:ae,loopSettings:ue}):await $.createAudioClip({filePath:F,startTime:D,duration:I,isWarped:ae,loopSettings:ue})}else W=$ instanceof It?await $.createMidiClip(I):await $.createMidiClip(D,I)}catch(F){throw new Error(`Could not create the copy: ${Ie(F)} Nothing was changed.`)}let ce;try{e.withinTransaction(()=>Ok(W,N,M,V?.warpMode))}catch(F){ce=`the copy ${Y(W)} was created, but its notes or properties could not be set: ${Ie(F)}`}let _e=!1;if(d.move&&ce)ce+="; the source was kept";else if(d.move)try{await xk(m),_e=!0}catch(F){ce=`copied, but the source ${d.clip_id} could not be deleted: ${Ie(F)}`}return{...dr(W,!0),location:ei(W),source_id:d.clip_id,moved:_e,fidelity:V?"approximate":"notes",lost:V?V.lost:le?[...mu,le]:mu,...V&&W instanceof Ht?Ek(W,V,$ instanceof It?void 0:I):{},overlaps:oe.length?oe:void 0,error:ce}}),u("arrangement_copy_range",{title:"Copy arrangement range",annotations:jn},"Copy a stretch of the arrangement to another position, e.g. \"repeat the chorus\": the clips of every audio and MIDI track (or only `tracks`) between start_time and end_time (beats) are copied to to_time, OVERWRITING what is there: the target range is cleared first on every selected track (as track_clear_clips_in_range does: clips crossing its edges are shortened), even where the source range is empty. Live's API cannot insert time, so nothing moves later. MIDI clips crossing the source range's edges are trimmed to it (notes re-based, as in clip_copy; notes starting before the range are left out); audio clips crossing an edge cannot be trimmed and are skipped and listed in `skipped`. Audio copies are approximate as in clip_copy (see `lost`). Take-lane clips are not copied (counted in take_lane_clips_not_copied). include_cue_points also copies the cue points in the range, except onto a beat that already has one. The ranges must not overlap. Undo steps: clear, create, notes and properties, then cue points (create, name). Once the range is cleared, a copy that fails is reported per clip.",{start_time:y.number().min(0).describe("Start of the range to copy, in beats"),end_time:y.number().describe("End of the range to copy (exclusive), in beats"),to_time:y.number().min(0).describe("Where the copy starts, in beats"),tracks:y.array(y.object(ht())).min(1).optional().describe("Only these tracks (each by track_id, track_index or track_name); omit for every audio and MIDI track"),include_cue_points:y.boolean().default(!1).describe("Also copy the cue points in the range (not onto a beat that already has one)")},async({start_time:d,end_time:m,to_time:f,tracks:v,include_cue_points:$})=>{if(!(m>d))throw new j(`end_time ${m} must be after start_time ${d}.`);let b=m-d;if(pk(f,f+b,d,m))throw new j(`The target range ${f}-${f+b} overlaps the source range ${d}-${m}: copy it to a position at least end_time - start_time beats away.`);let w=s().tracks,x=B=>B instanceof Wr||B instanceof Xr,P=v?uu(v,w):w.filter(x);for(let B of P)if(!x(B))throw new j(`${rt(B)} is a ${Eo(B,w)} track: only audio and MIDI tracks have arrangement clips.`);let R=0,I=P.map(B=>{let te=[],be=[];for(let Ne of Oo(B.arrangementClips,d,m)){let pt=q(Ne.startTime),Kh=q(Ne.endTime),Ms=Math.max(pt,d),Wh=Math.min(Kh,m),Jk=Ms>pt+1e-9||Wh<Kh-1e-9,Gk=pu(Ne),Xh={track:B,sourceId:Y(Ne),start:f+(Ms-d),length:Wh-Ms,trimmed:Jk,props:{name:Ne.name,color:q(Ne.color),muted:Ne.muted,looping:Gk.looping}},Yh=jo=>be.push({source_id:Xh.sourceId,name:Ne.name,start_time:pt,end_time:Kh,reason:jo});if(Ne instanceof Jt){let jo=Qw(Ne.notes,Gk,Ms-pt,Wh-Ms,js);R+=jo.length,te.push({...Xh,notes:jo})}else if(!(Ne instanceof Ht))Yh(`a ${dt(Ne)} cannot be copied`);else if(Jk)Yh("the audio clip crosses the edge of the range, and an audio copy cannot be trimmed (Live's API cannot set a clip's markers after creation): copy a range that contains it whole");else try{te.push({...Xh,spec:Pk(Ne)})}catch(jo){Yh(Ie(jo))}}let ct=B.takeLanes.reduce((Ne,pt)=>Ne+Oo(pt.clips,d,m).length,0);return{track:B,plans:te,skipped:be,laneClips:ct}});if(R>js)throw new j(`The copy would write ${R} notes; at most ${js} are allowed.`);let D=s().cuePoints.map(B=>({c:B,time:q(B.time)})),N=new Set(D.map(B=>B.time)),M=$?D.filter(B=>B.time>=d&&B.time<m).sort((B,te)=>B.time-te.time):[],V=M.filter(B=>!N.has(B.time+f-d)),le=P.length?await e.withinTransaction(()=>Promise.allSettled(P.map(B=>B.clearClipsInRange(f,f+b)))):[];if(le.length&&le.every(B=>B.status==="rejected"))throw new Error(`Could not clear the target range: ${Ie(le[0].reason)} Nothing was changed.`);let K=I.flatMap((B,te)=>le[te].status==="fulfilled"?B.plans:[]),oe=K.length?await e.withinTransaction(()=>Promise.allSettled(K.map(B=>B.spec?B.track.createAudioClip({filePath:B.spec.filePath,startTime:B.start,duration:B.length,isWarped:B.spec.isWarped,loopSettings:B.spec.loopSettings}):B.track.createMidiClip(B.start,B.length)))):[],W=new Map;K.forEach((B,te)=>{let be=oe[te];W.set(B,be.status==="fulfilled"?{copy:be.value}:{error:`could not be created: ${Ie(be.reason)}`})}),[...W.values()].some(B=>B.copy)&&e.withinTransaction(()=>{for(let[B,te]of W)if(te.copy)try{Ok(te.copy,B.props,B.notes,B.spec?.warpMode)}catch(be){te.error=`was created, but its notes or properties could not be set: ${Ie(be)}`}});let ce,_e=[];if($){let B=M.filter(be=>!V.includes(be)).map(be=>({source_id:Y(be.c),name:be.c.name,time:be.time+f-d,skipped:"a cue point is already at that beat"})),te=[];if(V.length)try{te=(await Nh(V.map(ct=>({name:ct.c.name})),ct=>s().createCuePoint(V[ct].time+f-d))).map((ct,Ne)=>({source_id:Y(V[Ne].c),...ct.created?Ui(ct.created):{},error:ct.error}))}catch(be){_e.push(`cue points: ${Ie(be)}`)}ce=[...te,...B]}let F=0,ae=I.map((B,te)=>{let be=le[te].status==="rejected"?Ie(le[te].reason):void 0;be&&_e.push(`${rt(B.track)}: the target range could not be cleared: ${be}`);let ct=be?[]:B.plans.map(Ne=>{let pt=W.get(Ne);return pt.copy&&!pt.error&&F++,pt.error&&_e.push(`${rt(B.track)}: the copy of clip ${Ne.sourceId} ${pt.error}`),{source_id:Ne.sourceId,...pt.copy?{id:Y(pt.copy),name:pt.copy.name}:{},start_time:pt.copy?q(pt.copy.startTime):Ne.start,end_time:pt.copy?q(pt.copy.endTime):Ne.start+Ne.length,trimmed:Ne.trimmed||void 0,...Ne.spec&&pt.copy instanceof Ht?Ek(pt.copy,Ne.spec,Ne.length):{},error:pt.error}});return{...Ih(B.track,w),cleared:!be,copies:ct,skipped:B.skipped.length?B.skipped:void 0}}),ue=I.reduce((B,te)=>B+te.laneClips,0);return{source:{start_time:d,end_time:m},target:{start_time:f,end_time:f+b},tracks:ae,copied_count:F,skipped_count:I.reduce((B,te)=>B+te.skipped.length,0),lost:K.some(B=>B.spec)?Tk:mu,take_lane_clips_not_copied:ue||void 0,cue_points:ce,errors:_e.length?_e:void 0}});function jk(d){let m=$=>[...new Set($.map(b=>lj(b,0)))].sort((b,w)=>b-w);if(d!=="song")return{root_note:Ss(d.root,"snap_to_scale.root"),intervals:m(d.intervals)};let f=s(),v=m(f.scaleIntervals.map(q));if(!v.length)throw new Error("Live reported no intervals for the song's scale.");return{root_note:q(f.rootNote),intervals:v,name:f.scaleName}}let xj={Half:2,Quarter:1,Eighth:.5,Sixteenth:.25,ThirtySecond:.125},Sj={EightBars:8,FourBars:4,TwoBars:2,Bar:1};function Ij(){let d=s(),m=Hw(d.gridQuantization),f=d.gridIsTriplet,v=d.scenes[0],$=v?q(v.signatureNumerator)*4/q(v.signatureDenominator):4,b=Sj[m],w=xj[m]??(b===void 0?void 0:b*$);if(w===void 0)throw new j(`Live's grid is ${m==="NoGrid"?"off":Ke(String(m))}: give the grid in beats instead of "song".`);return{beats:f?w*2/3:w,quantization:m,is_triplet:f}}u("midi_clip_get_notes",{title:"Get MIDI notes",annotations:Et},'Get the MIDI notes of a clip. Times/durations in beats relative to clip start. `select` returns only the matching notes (pitch range, also as note names like "C1"; start time range; in_scale against the song\'s scale; every_nth; only_selected: the notes the user selected in Live, when Live reports them \u2014 unverified, a `warning` says when it reported no selection). Notes carry `selected` when Live reports it. format "compact" returns each note as [pitch, start_time, duration, velocity], plus an object of its other fields that differ from `defaults`: several times smaller for dense clips.',{clip_id:y.string(),select:X1().optional().describe("Only the notes matching every given filter"),only_selected:y.boolean().optional().describe("Same as select.only_selected"),format:y.enum(["full","compact"]).default("full").describe("full: one object per note; compact: one tuple per note")},({clip_id:d,select:m,only_selected:f,format:v})=>{let $={...m,only_selected:f||m?.only_selected},b=$.in_scale!==void 0?jk("song"):void 0,w=Q1($,b),x=st(d,Jt).notes,P=w(x),R=x.filter((I,D)=>P[D]).map(Zq);return{note_count:R.length,total_note_count:m!==void 0||f?x.length:void 0,scale:b,warning:$.only_selected?ej(x):void 0,...v==="compact"?Fq(R):{notes:R}}}),u("midi_clip_set_notes",{title:"Write MIDI notes",annotations:Vi},'Write notes to a MIDI clip. mode \'replace\' (default) replaces ALL notes; mode \'merge\' adds the given notes on top of the existing ones (layering without re-sending the current content). Pitches are 0-127 or note names (C3 = 60). Shortcuts: `patterns` writes one pitch per string, e.g. {note:"F#1", steps:"x.x.x.x.", step:0.25} ("X" = accent), and `repeat` {length, times?} copies the notes and patterns every `length` beats, filling the clip (to its loop end when looping) when times is omitted. For mechanical edits of existing notes (transpose, shift, quantize, ...) prefer midi_clip_edit_notes.',{clip_id:y.string(),notes:y.array(y.object(J1)).optional().describe("Notes to write; [] in mode replace clears the clip"),patterns:y.array(G1()).optional().describe("Step patterns, written with the notes"),repeat:K1().optional(),mode:y.enum(["replace","merge"]).default("replace")},d=>{if(d.notes===void 0&&d.patterns===void 0)throw new j("Give notes and/or patterns (notes: [] with mode replace clears the clip).");let m=st(d.clip_id,Jt),v=d.repeat!==void 0&&d.repeat.times===void 0?q(m.looping?m.loopEnd:m.endMarker):1/0,{notes:$,copies:b}=W1(d,v),w=d.mode==="merge";return m.notes=w?[...m.notes,...$]:$,{note_count:w?void 0:$.length,added:w?$.length:void 0,copies:b}}),u("midi_clip_edit_notes",{title:"Edit MIDI notes",annotations:Vi},'Transform the existing notes of a MIDI clip (clip_id), or of several clips alike (clip_ids), server-side \u2014 no need to read and rewrite the note list. Optional `select` restricts which notes are affected (pitch/time range, in_scale, every_nth, only_selected = the user\'s note selection in Live, when Live reports it: unverified); others pass through untouched. Transforms, applied in this order: transpose (semitones), snap_to_scale ("song" or {root, intervals}: notes outside the scale move to the nearest scale note, ties go down), set (velocity, probability, velocity_deviation, release_velocity, muted), velocity_scale, velocity_offset, time_shift (beats), quantize (start times to a grid in beats or Live\'s "song" grid, strength 0-1), swing, duration_set or duration_scale, legato (each note lasts until the next later start among the selected notes; notes starting together are a chord and end together; the last ones keep their length), humanize (random \xB1timing beats and \xB1velocity, reproducible with `seed`; the seed used is returned) \u2014 or delete=true to remove the selected notes. Results are clamped to valid MIDI ranges. Each clip gets one notes write, all clips together form one undo step, and nothing is written if an argument or a clip is invalid.',{clip_id:y.string().optional().describe("The MIDI clip (or give clip_ids)"),clip_ids:y.array(y.string()).min(1).optional().describe("Several MIDI clips, edited alike; returns {items}"),select:X1().optional().describe("Only transform the notes matching every given filter"),transpose:y.number().int().optional().describe("Semitones, negative = down"),snap_to_scale:Lq().optional().describe(`Move notes outside the scale to the nearest scale note; "song" = Live's current scale`),set:y.object({velocity:y.number().min(0).max(127).optional(),probability:y.number().min(0).max(1).optional(),velocity_deviation:y.number().optional(),release_velocity:y.number().min(0).max(127).optional(),muted:y.boolean().optional()}).optional().describe("Set these fields on every selected note"),time_shift:y.number().optional().describe("Beats, negative = earlier"),velocity_scale:y.number().min(0).optional(),velocity_offset:y.number().optional(),quantize:y.object({grid:Y1("Grid"),strength:y.number().min(0).max(1).default(1)}).optional(),swing:y.object({amount:y.number().min(0).max(1).describe("0 = straight, about 0.67 = triplet feel, 1 = dotted: the off-beat moves amount \xD7 grid/2"),grid:Y1("Swing grid").default(.25)}).optional().describe("Delay every second grid step; positions in between move proportionally"),duration_set:y.number().positive().optional().describe("New length of every selected note, in beats"),duration_scale:y.number().positive().optional().describe("Multiply lengths, e.g. 0.5 = shorter"),legato:y.boolean().optional().describe("Lengthen or cut each selected note to the next later start among the selected notes; notes starting less than 1/64 beat apart are a chord and end together; the last ones keep their length"),humanize:y.object({timing:y.number().min(0).default(0).describe("Largest random start shift, \xB1 beats (e.g. 0.02)"),velocity:y.number().min(0).default(0).describe("Largest random velocity change, \xB1 (whole steps)"),seed:y.number().int().optional().describe("Same seed, clips and notes: same result; omitted = a random seed, returned as humanize_seed")}).optional(),delete:y.boolean().optional().describe("Delete the selected notes instead of transforming")},d=>{if(d.clip_id===void 0==(d.clip_ids===void 0))throw new j("Give clip_id or clip_ids (one of them).");if(d.duration_set!==void 0&&d.duration_scale!==void 0)throw new j("Give duration_set or duration_scale, not both.");let m=d.humanize;if(m&&!m.timing&&!m.velocity)throw new j("humanize: give timing and/or velocity.");let f=d.select??{},v=d.snap_to_scale!==void 0||f.in_scale!==void 0?jk(d.snap_to_scale??"song"):void 0,$=Q1(f,v),b=d.quantize?.grid==="song"||d.swing?.grid==="song"?Ij():void 0,w=K=>K==="song"?b.beats:K,x=m?m.seed??Math.floor(Math.random()*2**31):void 0,P=x===void 0?void 0:Hq(x),R=d.clip_ids??[d.clip_id],I=R.map((K,oe)=>yt(d.clip_ids?`clip_ids[${oe}]`:void 0,()=>st(K,Jt)));I.forEach((K,oe)=>{let W=I.findIndex(ce=>ce.handle.id===K.handle.id);if(W!==oe)throw new j(`clip_ids[${oe}]: clip ${R[oe]} is listed twice, also as clip_ids[${W}].`)});let D=(K,oe,W)=>Math.min(W,Math.max(oe,K)),N=I.map(K=>{let oe=K.notes,W=$(oe),ce=W.filter(Boolean).length,_e=f.only_selected?ej(oe):void 0;if(d.delete)return{clip:K,out:oe.filter((ue,B)=>!W[B]),changed:ce,warning:_e};let F=oe.slice(),ae=[];for(let ue of uj(oe)){if(!W[ue])continue;let B=oe[ue],te={...B,pitch:q(B.pitch),startTime:q(B.startTime),duration:q(B.duration)};d.transpose&&(te.pitch=D(te.pitch+d.transpose,0,127)),d.snap_to_scale!==void 0&&(te.pitch=Uq(te.pitch,v));let be=d.set;if(be?.velocity!==void 0&&(te.velocity=be.velocity),be?.probability!==void 0&&(te.probability=be.probability),be?.velocity_deviation!==void 0&&(te.velocityDeviation=be.velocity_deviation),be?.release_velocity!==void 0&&(te.releaseVelocity=be.release_velocity),be?.muted!==void 0&&(te.muted=be.muted),d.velocity_scale!==void 0||d.velocity_offset!==void 0){let ct=q(te.velocity??100)*(d.velocity_scale??1)+(d.velocity_offset??0);te.velocity=D(ct,1,127)}if(d.time_shift&&(te.startTime=Math.max(0,te.startTime+d.time_shift)),d.quantize){let ct=w(d.quantize.grid),Ne=Math.round(te.startTime/ct)*ct;te.startTime=te.startTime+(Ne-te.startTime)*d.quantize.strength}d.swing&&(te.startTime=Vq(te.startTime,w(d.swing.grid),d.swing.amount)),d.duration_set!==void 0&&(te.duration=d.duration_set),d.duration_scale!==void 0&&(te.duration=Math.max(dj,te.duration*d.duration_scale)),F[ue]=te,ae.push(te)}if(d.legato&&Bq(ae),P&&m)for(let ue of ae){let B=P()*2-1,te=P()*2-1;m.timing&&(ue.startTime=Math.max(0,ue.startTime+B*m.timing)),m.velocity&&(ue.velocity=D(q(ue.velocity??100)+Math.round(te*m.velocity),1,127))}return{clip:K,out:F,changed:ce,warning:_e}}),M=N.filter(K=>K.changed>0);M.length&&e.withinTransaction(()=>{for(let K of M)K.clip.notes=K.out});let V=K=>({note_count:K.out.length,changed_count:K.changed,warning:K.warning}),le={humanize_seed:x,song_grid:b,scale:v};return d.clip_ids?{items:N.map(K=>({clip_id:Y(K.clip),...V(K)})),...le}:{...V(N[0]),...le}}),u("device_get",{title:"Get device",annotations:Et},'Get detail for one device: parameters (metadata + ids), rack chains, drum rack pads, or Simpler sample. Big devices have 100+ parameters \u2014 use parameter_filter (case-insensitive substring on the name) to fetch only what you need, include_values to read current values in the same call, and include_chain_devices to inline each rack chain\'s devices (e.g. map a whole drum kit pad\u2192note\u2192sample in one call). `location` says where the device sits: its track, the path through racks ("Kit > Drum Rack > pad 36 > Simpler"), its device_index, and the chain and rack it is in.',{device_id:y.string(),parameter_filter:y.string().optional(),include_value_items:y.boolean().default(!0),include_values:y.boolean().default(!1),include_chain_devices:y.boolean().default(!1)},async({device_id:d,parameter_filter:m,include_value_items:f,include_values:v,include_chain_devices:$})=>{let b=st(d,Ct),w=b.parameters;if(m!==void 0){let P=m.toLowerCase();w=w.filter(R=>R.name.toLowerCase().includes(P))}let x=v?await Promise.all(w.map(P=>Ni(P))):w.map(P=>vh(P,f));return{...pr(b),parameters:x,chains:b instanceof Gt?b.chains.map(P=>({...Mi(P),devices:$?P.devices.map(pr):void 0})):void 0,location:ei(b)}});function Rk(d,m){let f=Le(d);if(f)throw new j(`${m} ${JSON.stringify(d)}: ${f==="file not found"?"no such file":f}.`)}async function Zh(d,m){if(!m)return{load:d,imported:void 0};try{let f=await e.resources.importIntoProject(d);return{load:f,imported:f}}catch(f){throw new Error(`Could not import ${d} into the project: ${Ie(f)}`)}}let Fh=d=>y.boolean().default(d).describe(`Copy the sample into the Live project first and load the copy (recommended: the set keeps working when it is moved or the original is deleted); default ${d}`);u("device_insert",{title:"Insert device",annotations:Gr},"Insert a built-in Live device (by name, e.g. 'Reverb', 'Auto Filter', 'EQ Eight', 'Compressor', 'Simpler', 'Drum Rack', 'Operator', 'Wavetable') into a track or rack chain. Third-party plug-ins cannot be loaded. index is the 0-based position in the device chain; omitted = append at the end. The target is a Track or Chain id, or a track given by track_id/track_index/track_name. `sample_path` (Simpler only) loads an audio file into the new Simpler \u2014 by default its copy in the Live project (import_into_project); if the sample cannot be loaded, the Simpler is removed again and the call fails. `parameters` sets initial values right after the insert (and the sample), in one undo step (each {name, value | value_item | reset | delta}, as in device_set); if one cannot be set, none are, and the device is still inserted with `errors` saying why.",{target_id:y.string().optional().describe("Track or Chain id"),...ht(),device_name:y.string(),index:y.number().int().min(0).optional(),sample_path:y.string().min(1).optional().describe("Simpler only: absolute path of an audio file to load into it"),import_into_project:Fh(!0),parameters:y.array(ij).min(1).optional().describe("Initial parameter values")},async({device_name:d,index:m,sample_path:f,import_into_project:v,parameters:$,...b})=>{if($?.forEach((D,N)=>yt(`parameters[${N}]`,()=>zh(D))),f!==void 0){if(d.trim().toLowerCase()!=="simpler")throw new j(`sample_path only applies to a Simpler, not ${Ke(d)}.`);Rk(f,"sample_path")}let w=Rs(b);if(!(w instanceof Ue)&&!(w instanceof xt))throw new j(`Devices can be inserted into a Track or Chain, got ${dt(w)}.`);let x=await w.insertDevice(d,m??w.devices.length),P;if(f!==void 0)try{if(!(x instanceof Tr))throw new Error(`${bt(x)} is not a Simpler.`);let D=await Zh(f,v);P=D.imported,await x.replaceSample(D.load)}catch(D){await jh(w,x,`Could not load the sample ${f}: ${Ie(D)}`)}let R={imported_path:P};if(!$)return{...pr(x),...R};let I=await vk(x,$);return{...pr(x),...R,parameters:I.parameters,errors:I.error?[I.error]:void 0}}),u("device_set",{title:"Set device",annotations:H1},'Switch a device on or off and/or set several of its parameters, in one call and one undo step (nothing is changed if any entry is invalid). Address the device by device_id, or by its track (track_id/track_index/track_name) and `device`: a name, an index, or a path into racks such as ["Drum Rack", {"pad": 36}, "Simpler"]. `enabled` sets the device\'s "Device On" parameter \u2014 a Live naming convention, not an API field: a device without one falls back to its first parameter if that is a two-state switch, and `on_parameter` reports which parameter was used (`fallback: true`). Each `parameters` entry names the parameter (name: exact, then case-insensitive, then unique substring; or parameter_id) and gives one of value (internal units), value_item (a quantized parameter\'s choice by name, e.g. "Saw"), reset:true (the default) or delta (added to the current value, clamped).',{...cu,enabled:y.boolean().optional().describe("true = on, false = off (bypassed)"),parameters:y.array(y.object({name:pj.optional(),parameter_id:y.string().optional().describe("Instead of name: the parameter's id"),...sk})).min(1).optional()},async({enabled:d,parameters:m,...f})=>{if(d===void 0&&!m)throw new j("Nothing to set \u2014 give enabled and/or parameters.");let v=du(f),$=d!==void 0?Eh(v):void 0,b=[],w=[];$&&(b.push(Bi($.param,{value:d?$.on:$.off})),w.push("enabled"));let x=new Set(v.parameters.map(D=>D.handle.id));(m??[]).forEach((D,N)=>yt(`parameters[${N}]`,()=>{if(D.name===void 0==(D.parameter_id===void 0))throw new j("give exactly one of name and parameter_id.");let M=D.parameter_id!==void 0?st(D.parameter_id,Ar):Th(v,D.name);if(!x.has(M.handle.id))throw new j(`parameter ${D.parameter_id} is not a parameter of ${bt(v)}.`);b.push(Bi(M,D)),w.push(`parameters[${N}]`)})),await Ph(b,w);let P=$;if(!P)try{P=Eh(v)}catch{}let[R,I]=await Promise.all([Promise.all(b.filter(D=>D.param!==$?.param).map(D=>Ni(D.param))),P?P.param.getValue().then(q):void 0]);return{...pr(v),enabled:P?I!==P.off:void 0,on_parameter:P?{id:Y(P.param),name:P.param.name,fallback:P.fallback||void 0}:void 0,parameters:m?R:void 0}}),u("parameter_find",{title:"Find parameters",annotations:Et},'Find device parameters by name without walking device_get: in the whole Live Set (every regular, return and main track), on one track (track_id/track_index/track_name), or in one device (device_id, or track + device); racks are searched through all their chains. `query` is a case-insensitive substring of the parameter name (omit it to list everything in scope); `value_item` keeps only quantized parameters with a matching choice (e.g. "saw"). Each match carries its id (for parameter_set, parameter_get, device_set), its device\'s id and name, the track, and a readable path such as "Drums > Drum Rack > pad 36 > Simpler". include_values adds current values (internal units). At most `limit` matches are returned; `total` counts them all.',{query:y.string().optional().describe("Case-insensitive substring of the parameter name"),value_item:y.string().min(1).optional().describe("Only quantized parameters with a value item whose name or short name contains this"),...cu,include_values:y.boolean().default(!1),include_value_items:y.boolean().default(!0),limit:y.number().int().min(1).max(500).default(50)},async({query:d,value_item:m,include_values:f,include_value_items:v,limit:$,...b})=>{let w;if(b.device_id!==void 0||b.device!==void 0){let{device:oe,track:W,path:ce}=mk(b);w=[{devices:[oe],track:W,prefix:ce.slice(0,-1)}]}else if(fn(b)){let oe=nt(b);w=[{devices:oe.devices,track:oe,prefix:[oe.name]}]}else{let oe=s();w=[...oe.tracks,...oe.returnTracks,oe.mainTrack].map(W=>({devices:W.devices,track:W,prefix:[W.name]}))}let x=d?.toLowerCase(),P=m?.toLowerCase(),R=oe=>(x===void 0||oe.name.toLowerCase().includes(x))&&(P===void 0||oe.isQuantized&&oe.valueItems.some(W=>[W.name,W.shortName].some(ce=>ce?.toLowerCase().includes(P)))),I=1e3,D=[],N=0,M=0,V=!1,le=(oe,W,ce,_e)=>{for(let F of oe){if(M>=I){V=!0;return}M++;let ae=[...ce,F.name];for(let ue of F.parameters)R(ue)&&(N++,D.length<$&&D.push({param:ue,device:F,root:W,path:ae}));F instanceof Gt&&_e<8&&F.chains.forEach((ue,B)=>le(ue.devices,W,[...ae,Cs(ue,B)],_e+1))}};for(let oe of w)le(oe.devices,oe,oe.prefix,0);let K=await Promise.all(D.map(async({param:oe,device:W,root:ce,path:_e})=>({...f?await Ni(oe,v):vh(oe,v),device_id:Y(W),device_name:W.name,track_id:ce.track?Y(ce.track):void 0,track_name:ce.track?.name,path:_e.join(" > ")})));return{matches:K,total:N,truncated:N>K.length,devices_searched:M,device_limit_reached:V||void 0}}),u("device_delete",{title:"Delete device",annotations:jn},"Delete a device from its track or chain.",{device_id:y.string()},async({device_id:d})=>{let m=st(d,Ct),f=m.parent;if(f instanceof Ue||f instanceof xt)await f.deleteDevice(m);else throw new Error(`Cannot delete device with parent ${f?dt(f):"null"}.`);return{deleted:d}}),u("device_duplicate",{title:"Duplicate device",annotations:Gr},"Duplicate a device; the copy is inserted right after the original.",{device_id:y.string()},async({device_id:d})=>{let m=st(d,Ct),f=m.parent;if(f instanceof Ue||f instanceof xt)return pr(await f.duplicateDevice(m));throw new Error(`Cannot duplicate device with parent ${f?dt(f):"null"}.`)});let Vh="automation, modulation and MIDI/macro mappings, a custom device name, and any device state that is not a parameter";u("device_copy",{title:"Copy or move device",annotations:Vi},`Copy a device to a track or rack chain, or to another position in its own chain; with move:true the original is deleted afterwards, which is how a device is moved or reordered (Live's API has no device move, reorder or copy). LOSSY: a fresh built-in device is inserted at the target and the parameter values are copied by name (a Simpler also gets its sample); ${Vh} are lost, and the copy has a new id (after a move the old id is gone). Racks cannot be copied this way: device_duplicate copies one in place. Target: target_id (Track or Chain id) or track_id/track_index/track_name; omitted = the device's own track or chain. \`index\` counts the target's current devices, before a move removes the original (omitted = append). \`device_name\` is the built-in device to insert when the device was renamed in Live (default: its name). Live allows one instrument per track or chain, so an instrument cannot be copied next to another one. Undo steps: insert, sample, values, delete. If the copy cannot be inserted or its sample cannot be loaded, nothing is changed; values that cannot be copied are listed in \`not_copied\`, and then a move keeps the original.`,{device_id:y.string().describe("The device to copy or move"),target_id:y.string().optional().describe("Track or Chain id; or give the track by track_id/track_index/track_name"),...ht(),index:y.number().int().min(0).optional().describe("0-based position among the target's current devices; omitted = append"),device_name:y.string().min(1).optional().describe("Built-in device to insert; default: the device's name"),move:y.boolean().default(!1).describe("Delete the original once everything was copied")},async({device_id:d,index:m,device_name:f,move:v,...$})=>{let b=st(d,Ct);Oh(b,"copied by name");let w=b.parent,x=$.target_id!==void 0||fn($)?Rs($):w;if(!(x instanceof Ue)&&!(x instanceof xt))throw new j(`Devices can be copied into a Track or Chain, got ${x?dt(x):"none"}.`);if(v&&!(w instanceof Ue)&&!(w instanceof xt))throw new Error(`Cannot move a device whose parent is ${w?dt(w):"null"}.`);let P=x.devices.length;if(m!==void 0&&m>P)throw new j(`index ${m} out of range (0-${P}, or omit it to append).`);let R=m??P,I=w&&w.handle.id===x.handle.id?x.devices.findIndex(_e=>_e.handle.id===b.handle.id):-1;if(v&&I>=0&&(R===I||R===I+1))return{...pr(b),index:I,source_id:d,moved:!1,unchanged:"the device is already at that position"};let D=await yk(b),N=b instanceof Tr&&b.sample?.filePath||void 0,M=await _k(x,f??b.name,R,f===void 0),{sample:V,applied:le,skipped:K}=await bk(M,D,N,x),oe=!1,W,ce;if(v)if(K.length)ce="the copy is incomplete (see not_copied), so the original was kept";else try{await w.deleteDevice(b),oe=!0}catch(_e){W=`copied, but the original ${d} could not be deleted: ${Ie(_e)}`}return{...pr(M),index:x.devices.findIndex(_e=>_e.handle.id===M.handle.id),source_id:d,moved:oe,fidelity:"approximate",lost:Vh,copied_parameters:le,not_copied:K.length?K:void 0,sample:V,original_kept:ce,error:W}}),u("device_preset_save",{title:"Save device preset",annotations:jn},"Save a device's parameter values (and a Simpler's sample path) as a named preset of this server: a JSON file in the extension's storage directory (presets/<name>.json). It is not a Live preset (.adv): Live's API cannot read or write those. Address the device by device_id, or track + device as in device_set. Racks cannot be saved. `device_name` records the built-in device a load inserts (default: the device's name; pass it if the device was renamed in Live). The sample is referenced by its path, not copied. An existing preset of the same name (case-insensitive) is only replaced with overwrite:true. Names are 1-64 letters, digits, spaces and - _ . , ( ) ' + & #, starting with a letter or digit.",{name:y.string().describe("Preset name"),...cu,device_name:y.string().min(1).optional().describe("Built-in device a load inserts; default: the device's name"),overwrite:y.boolean().default(!1).describe("Replace an existing preset of the same name")},async({name:d,device_name:m,overwrite:f,...v})=>{let $=oj(d),b=du(v);Oh(b,"saved as a preset");let w=Rh(),x=b instanceof Tr&&b.sample?.filePath||void 0,P={format:mj,version:1,name:$,device_name:m??b.name,device_class:dt(b),saved_at:new Date().toISOString(),parameters:await yk(b),sample:x?{file_path:x}:void 0},{name:R,replaced:I}=w.write($,P,f);return{name:R,device_name:P.device_name,parameter_count:P.parameters.length,sample:P.sample,replaced:I,directory:w.dir}}),u("device_preset_list",{title:"List device presets",annotations:Et},"List the presets saved with device_preset_save: name, the built-in device they insert, parameter count, sample, and when they were saved. Files in the presets directory that are not valid presets are listed under `unreadable`.",{device_name:y.string().optional().describe("Only presets for this built-in device (case-insensitive)")},({device_name:d})=>{let m=Rh(),f=m.list(),v=d?.toLowerCase();return{directory:m.dir,presets:f.presets.filter(({preset:$})=>v===void 0||$.device_name.toLowerCase()===v).map(({name:$,preset:b})=>({name:$,device_name:b.device_name,parameter_count:b.parameters.length,sample:b.sample??void 0,saved_at:b.saved_at})),unreadable:f.unreadable.length?f.unreadable:void 0}}),u("device_preset_load",{title:"Load device preset",annotations:Vi},`Load a preset saved with device_preset_save. Onto an existing device (device_id, or track + device as in device_set): its parameters are set by name in one undo step, and a Simpler also loads the preset's sample in place of its own. Or as a new device: give the target instead (target_id: Track or Chain id, or track_id/track_index/track_name without \`device\`) and optionally \`index\`; the preset's built-in device (or \`device_name\`) is inserted there first. Values the device has no parameter for, or that Live refuses, are listed in \`not_applied\`. A preset holds parameter values only: ${Vh} are not part of it.`,{name:y.string().describe("Preset name (case-insensitive)"),...cu,target_id:y.string().optional().describe("Insert a new device into this Track or Chain instead of loading onto an existing one"),index:y.number().int().min(0).optional().describe("New device only: 0-based position; omitted = append"),device_name:y.string().min(1).optional().describe("New device only: the built-in device to insert instead of the preset's")},async({name:d,index:m,device_name:f,...v})=>{let $=oj(d),b=v.device_id!==void 0||v.device!==void 0;if(b&&v.target_id!==void 0)throw new j("Give a device to load onto, or target_id to insert a new one, not both.");if(b&&(m!==void 0||f!==void 0))throw new j("index and device_name only apply when inserting a new device.");if(!b&&v.target_id===void 0&&!fn(v))throw new j("Give the device to load onto (device_id, or a track and device), or where to insert a new one (target_id, or track_id/track_index/track_name).");let w=Rh(),x=w.find($);if(!x){let K=w.list().presets.map(oe=>Ke(oe.name));throw new j(`No preset named ${Ke($)}. Saved presets: ${K.join(", ")||"none"}.`)}let P=Kr.basename(x,".json"),R;try{R=fj(x)}catch(K){throw new j(`Preset ${Ke(P)} cannot be loaded: ${Ie(K)}`)}let I,D;if(b)I=du(v),Oh(I,"loaded from a preset");else{let K=Rs(v);if(!(K instanceof Ue)&&!(K instanceof xt))throw new j(`Devices can be inserted into a Track or Chain, got ${dt(K)}.`);let oe=K.devices.length;if(m!==void 0&&m>oe)throw new j(`index ${m} out of range (0-${oe}, or omit it to append).`);I=await _k(K,f??R.device_name,m??oe,!1),D={target:K}}let{sample:N,applied:M,skipped:V}=await bk(I,R.parameters,R.sample?.file_path,D?.target),le=I.name.toLowerCase()!==R.device_name.toLowerCase();return{...pr(I),preset:P,inserted:D!==void 0,index:D?D.target.devices.findIndex(K=>K.handle.id===I.handle.id):void 0,applied_parameters:M,not_applied:V.length?V:void 0,sample:N,warning:le?`The preset was saved from ${Ke(R.device_name)}; only parameters with the same names were set.`:void 0}}),u("chain_get",{title:"Get rack chain",annotations:Et},"Get detail for a rack chain: its devices and mixer (volume/pan/sends with values). Drum chains also report their receiving note. `location` gives the track, the path to the chain, its rack and chain_index.",{chain_id:y.string()},async({chain_id:d})=>{let m=st(d,xt);return{...Mi(m),devices:m.devices.map(pr),mixer:await As(m.mixer),location:ei(m)}}),u("rack_insert_chain",{title:"Insert rack chain",annotations:Gr},"Insert a new chain into a rack device at the given 0-based index.",{rack_device_id:y.string(),index:y.number().int().min(0)},async({rack_device_id:d,index:m})=>{let f=st(d,Gt);return Mi(await f.insertChain(m))}),u("drum_chain_set",{title:"Set drum pad note",annotations:Xn},"Set the MIDI note a drum rack chain (pad) responds to: 0-127 or a note name (C1 = 36).",{drum_chain_id:y.string(),receiving_note:Po("The MIDI note the pad plays on")},({drum_chain_id:d,receiving_note:m})=>{let f=Ai(m,"receiving_note"),v=st(d,Yr);return v.receivingNote=f,Mi(v)}),u("simpler_replace_sample",{title:"Replace Simpler sample",annotations:jn},"Replace the sample loaded in a Simpler device with another audio file (absolute path). The file is loaded as it is; with import_into_project:true (recommended) it is first copied into the Live project and the copy is loaded, so the set keeps working when it is moved or the original is deleted \u2014 the result's file_path is then the copy's and `imported_path` is set.",{simpler_device_id:y.string(),file_path:y.string(),import_into_project:Fh(!1)},async({simpler_device_id:d,file_path:m,import_into_project:f})=>{let v=st(d,Tr),{load:$,imported:b}=await Zh(m,f),w=await v.replaceSample($);return{id:Y(w),file_path:w.filePath,imported_path:b}}),u("drum_kit_build",{title:"Build drum kit",annotations:Vi},"Build or update a drum kit from sample files in one call: for each pad {note, sample_path, volume?, panning?} the Drum Rack's pad (chain) receiving that note is reused, or a new chain is created and set to receive it; a Simpler is inserted into it (a pad that already has a Simpler keeps it, and its sample is REPLACED), the sample is copied into the Live project (import_into_project, default) and loaded, and volume / panning set the pad's chain mixer (0-1, 0.85 = 0 dB; -1..1). The rack: rack_device_id, or a MIDI track (track_id/track_index/track_name) \u2014 its Drum Rack, or a new one appended when it has none. Notes are 0-127 or names (C1 = 36 is the usual kick). Every sample path, note and pad is checked before anything is changed; the samples are imported next, and an import that fails changes nothing in the set. After that a pad that fails is reported in its `pads` entry (`error`) while the others are built. Live's API cannot delete a chain, so a chain that was created stays even if its pad fails. Returns the rack and, per pad, the chain, the Simpler, the loaded sample and what was created. Undo steps: rack, chains, notes, Simplers, samples, mixer.",{...ht(),rack_device_id:y.string().optional().describe("The Drum Rack to build in; or give a MIDI track"),pads:y.array(y.object({note:Po("The pad's MIDI note (its chain's receiving note)"),sample_path:y.string().min(1).describe("Absolute path of the audio file"),volume:y.number().min(0).max(1).optional().describe("Pad volume 0-1 (0.85 = 0 dB)"),panning:y.number().min(-1).max(1).optional().describe("Pad panning, -1 = left, 1 = right")})).min(1).max(128),import_into_project:Fh(!0)},async({pads:d,rack_device_id:m,import_into_project:f,...v})=>{if(m===void 0==!fn(v))throw new j("Give rack_device_id or a track (track_id, track_index or track_name), one of them.");let $=d.map((F,ae)=>yt(`pads[${ae}]`,()=>{let ue=Ai(F.note,"note");return Rk(F.sample_path,"sample_path"),ue}));$.forEach((F,ae)=>{let ue=$.indexOf(F);if(ue!==ae)throw new j(`pads[${ae}]: note ${F} (${fh(F)}) is given twice, also by pads[${ue}].`)});let b,w;if(m!==void 0)b=st(m,ni),w=Sh(b).track;else{w=nt(v);let F=w.devices.filter(ae=>ae instanceof ni);if(F.length>1)throw new j(`${rt(w)} has ${F.length} Drum Racks (${F.map(bt).join(", ")}): give rack_device_id.`);if(b=F[0],!b&&!(w instanceof Xr))throw new j(`${rt(w)} has no Drum Rack, and only a MIDI track can get one.`)}let x=F=>{let ae=F.chains.filter(ue=>ue instanceof Yr);return $.map((ue,B)=>{let te=ae.filter(be=>q(be.receivingNote)===ue);if(te.length>1)throw new j(`pads[${B}]: ${te.length} chains of ${bt(F)} receive note ${ue} (${te.map(be=>Y(be)).join(", ")}), so the pad is ambiguous.`);return te[0]})},P=b?x(b):$.map(()=>{}),R=d.map((F,ae)=>({i:ae,note:$[ae],chain:P[ae],chainCreated:!1,simplerCreated:!1,load:F.sample_path})),I=(F,ae,ue)=>{F.error??=`${ae}: ${Ie(ue)}`},D=()=>R.filter(F=>!F.error);if(f){let F=new Map;for(let ae of R){let ue=d[ae.i].sample_path;if(!F.has(ue))try{F.set(ue,(await Zh(ue,!0)).load)}catch(B){let te=[...F.values()];throw new Error(`pads[${ae.i}]: ${Ie(B)} Nothing was changed in the Live Set`+(te.length?` (already copied into the project: ${te.join(", ")}).`:"."))}ae.load=ae.imported=F.get(ue)}}let N=!1;if(!b){let F=w,ae;try{ae=await F.insertDevice("Drum Rack",F.devices.length)}catch(ue){throw new Error(`Could not insert a Drum Rack on ${rt(F)}: ${Ie(ue)} Nothing was changed in the Live Set.`)}ae instanceof ni||await jh(F,ae,`Live inserted ${bt(ae)}, not a Drum Rack.`),b=ae,N=!0,x(b).forEach((ue,B)=>R[B].chain=ue)}let M=b,V=R.filter(F=>!F.chain);if(V.length){let F=M.chains.length,ae=[...V].reverse();(await e.withinTransaction(()=>Promise.allSettled(ae.map(()=>M.insertChain(F))))).forEach((te,be)=>{let ct=ae[be];if(te.status==="rejected")return I(ct,"creating its chain",te.reason);ct.chainCreated=!0,te.value instanceof Yr?ct.chain=te.value:I(ct,"creating its chain",`Live created ${dt(te.value)} ${Y(te.value)}, not a drum chain, so it has no receiving note`)});let B=V.filter(te=>!te.error);B.length&&e.withinTransaction(()=>{for(let te of B)try{te.chain.receivingNote=te.note}catch(be){I(te,"setting its note",be)}})}for(let F of D())F.simpler=F.chain.devices.find(ae=>ae instanceof Tr);let le=D().filter(F=>!F.simpler);le.length&&(await e.withinTransaction(()=>Promise.allSettled(le.map(ae=>ae.chain.insertDevice("Simpler",0))))).forEach((ae,ue)=>{let B=le[ue];if(ae.status==="rejected")return I(B,"inserting a Simpler",ae.reason);if(!(ae.value instanceof Tr))return I(B,"inserting a Simpler",`Live inserted ${bt(ae.value)}, not a Simpler`);B.simpler=ae.value,B.simplerCreated=!0});let K=D();K.length&&(await e.withinTransaction(()=>Promise.allSettled(K.map(ae=>ae.simpler.replaceSample(ae.load))))).forEach((ae,ue)=>ae.status==="fulfilled"?K[ue].sample=ae.value:I(K[ue],`loading ${K[ue].load}`,ae.reason));let oe=[];for(let F of D()){let{volume:ae,panning:ue}=d[F.i];try{let B=F.chain.mixer;ae!==void 0&&oe.push({pad:F,param:B.volume,value:Bi(B.volume,{value:ae}).target(ae),what:"volume"}),ue!==void 0&&oe.push({pad:F,param:B.panning,value:Bi(B.panning,{value:ue}).target(ue),what:"panning"})}catch(B){I(F,"setting its level",B)}}let W=oe.filter(F=>!F.pad.error);W.length&&(await e.withinTransaction(()=>Promise.allSettled(W.map(ae=>ae.param.setValue(ae.value))))).forEach((ae,ue)=>{ae.status==="rejected"&&I(W[ue].pad,`setting its ${W[ue].what}`,ae.reason)});let ce=R.map(F=>({note:F.note,note_name:fh(F.note),chain_id:F.chain?Y(F.chain):void 0,chain_created:F.chainCreated,simpler_device_id:F.simpler?Y(F.simpler):void 0,simpler_created:F.simplerCreated,sample:F.sample?{id:Y(F.sample),file_path:F.sample.filePath}:void 0,source_path:d[F.i].sample_path,imported_path:F.imported,volume:d[F.i].volume,panning:d[F.i].panning,error:F.error})),_e=ce.filter(F=>F.error);return{rack_device_id:Y(M),rack_created:N,track_id:w?Y(w):void 0,track_name:w?.name,pads:ce,built_count:ce.length-_e.length,errors:_e.length?_e.map(F=>`note ${F.note} (${F.note_name}): ${F.error}`):void 0}}),u("parameter_get",{title:"Get parameter values",annotations:Et},'Read current values (and metadata) of device or mixer parameters: by id (`parameter_ids`) and/or by device and name (`parameters`: entries {device_id | track_id/track_index/track_name + device, parameter}, where device is a name, an index or a path into racks such as ["Drum Rack", {"pad": 36}, "Simpler"], and parameter matches exactly first, then case-insensitively, then by unique substring; an entry may also be {parameter_id}). Results follow that order; entries found by device also carry device_id and device_name. Values are internal units; quantized parameters also report the current `value_item`.',{parameter_ids:y.array(y.string()).min(1).optional(),parameters:y.array(y.object(nj)).min(1).optional().describe("Parameters by device and name (or parameter_id)")},async({parameter_ids:d,parameters:m})=>{if(!d&&!m)throw new j("Provide parameter_ids and/or parameters.");let f=[...(d??[]).map(v=>({param:st(v,Ar),device:void 0})),...(m??[]).map((v,$)=>yt(`parameters[${$}]`,()=>hk(v)))];return Promise.all(f.map(gk))}),u("parameter_set",{title:"Set parameter values",annotations:H1},`Set one or more device or mixer parameters in one undo step; nothing is changed if any entry is invalid. Each entry addresses its parameter by parameter_id, or by device and name as in parameter_get ({device_id | track + device, parameter}), and gives exactly one of: value (internal units within [min, max]; a quantized parameter takes its value_items index), value_item (a quantized parameter's choice by name or short name, e.g. "Saw"), reset:true (the default value) or delta (added to the current value, clamped to [min, max]). Returns the parameters with their new values.`,{values:y.array(y.object({...nj,...sk})).min(1)},async({values:d})=>{let m=d.map((v,$)=>`values[${$}]`),f=d.map((v,$)=>yt(m[$],()=>{let{param:b,device:w}=hk(v);return{...Bi(b,v),device:w}}));return await Ph(f,m),Promise.all(f.map(gk))}),u("mixer_get",{title:"Get mixer",annotations:Et},"Get the mixer of a track or rack chain: volume, panning, and sends with current values and parameter ids (settable via parameter_set). Address it by target_id, or the track by track_id/track_index/track_name.",{target_id:y.string().optional().describe("Track, Chain, or mixer id"),...ht()},async d=>await As(lu(d).mixer));let qh=()=>({target_id:y.string().optional().describe("Track, Chain, or mixer id"),...ht()}),Bh=()=>({volume:y.number().min(0).max(1).optional(),panning:y.number().min(-1).max(1).optional(),sends:y.array(y.object({index:y.number().int().min(0).optional().describe("Send index; order matches the return tracks"),return_name:y.string().optional().describe("Instead of index: the return track's name (track mixers only)"),value:y.number().min(0).max(1)})).optional()});function fu(d,m){let f=[];m.volume!==void 0&&f.push(()=>d.volume.setValue(m.volume)),m.panning!==void 0&&f.push(()=>d.panning.setValue(m.panning));for(let v of m.sends??[]){if(v.index===void 0==(v.return_name===void 0))throw new j("Each send takes exactly one of index or return_name.");let $=v.index;if(v.return_name!==void 0){if(!(d instanceof Co))throw new j("return_name only applies to track mixers; address rack chain sends by index.");let w=s().returnTracks.map((R,I)=>({track:R,i:I})),x=R=>`${JSON.stringify(R.track.name)} (send ${R.i})`;$=_t("return track",v.return_name,w,R=>R.track.name,x,{hint:"Use the send index."}).i}let b=d.sends[$];if(!b)throw new j(`send index ${$} out of range (${d.sends.length} sends).`);f.push(()=>b.setValue(v.value))}if(!f.length)throw new j("Nothing to set \u2014 provide volume, panning, and/or sends.");return f}function Tj(d,m){let f=new Set(d.map((x,P)=>yt(`exclude[${P}]`,()=>nt(x)).handle.id)),v=s().tracks.map(x=>{let P=[];for(let R=x.groupTrack;R&&P.length<64;R=R.groupTrack)P.push(R);return{track:x,groups:P}}),$=new Set(v.filter(({track:x})=>f.has(x.handle.id)).flatMap(({groups:x})=>x.map(P=>P.handle.id))),b=[],w=[];for(let{track:x,groups:P}of v){let R=N=>w.push({track_id:Y(x),name:x.name,reason:N}),I=P.find(N=>f.has(N.handle.id)),D=P.filter(N=>!$.has(N.handle.id));if(f.has(x.handle.id))R("excluded");else if(I)R(`inside the excluded group ${JSON.stringify(I.name)}`);else if($.has(x.handle.id))R("group containing an excluded track; its other tracks are set instead");else if(D.length){let N=`covered by its group ${JSON.stringify(D[D.length-1].name)}`;m?b.push({track:x,coveredBy:N}):R(N)}else b.push({track:x})}return{selected:b,skipped:w}}u("mixer_set",{title:"Set mixer",annotations:Xn},"Set volume, panning, and/or sends of track or rack chain mixers in one call (single undo step; nothing is changed if any target is invalid). Volume is normalized 0-1 (0.85 = 0 dB unity, 1.0 = +6 dB); panning is -1..1; each send is addressed by index (order matches the return tracks) or return_name. Choose the mixers with ONE of: target_id (Track, Chain, or mixer id) or track_id/track_index/track_name; `targets` (the same values on several); `all_tracks` (every regular track, minus `exclude`); or `items` (one entry per mixer with its own values). all_tracks sets volume on the top-most tracks only: a group track covers the tracks inside it, which keep their volume (listed in `skipped`, or with `volume_skipped` when they get panning or sends); panning and sends are set on every track, grouped tracks included (a grouped track's sends go straight to the returns). Tracks inside an excluded group are left alone, and a group holding an excluded track is not set itself \u2014 its other tracks are. A single target returns its mixer; the other forms return {items} (plus `skipped` for all_tracks).",{...qh(),...Bh(),targets:y.array(y.object(qh())).min(1).optional().describe("Several mixers that get the top-level values"),all_tracks:y.boolean().optional().describe("Apply the top-level values to every regular track (volume: top-most only, see description)"),exclude:y.array(y.object(ht())).optional().describe("With all_tracks: tracks to leave alone, including everything inside an excluded group"),items:y.array(y.object({...qh(),...Bh()})).min(1).optional().describe("One entry per mixer, each with its own values")},async d=>{let m=d.target_id!==void 0||fn(d),f=[m&&"target_id/track_*",d.targets&&"targets",d.all_tracks&&"all_tracks",d.items&&"items"].filter(Boolean);if(f.length!==1)throw new j(f.length?`Choose one way to address mixers, got ${f.join(" + ")}.`:"Provide target_id or track_id/track_index/track_name, targets, all_tracks, or items.");if(d.exclude&&!d.all_tracks)throw new j("exclude only applies with all_tracks.");let v=Yn(d,Object.keys(Bh()));if(d.items&&v)throw new j("With items, give volume/panning/sends in each entry instead.");if(!d.items&&!v)throw new j("Nothing to set \u2014 provide volume, panning, and/or sends.");let $,b;if(d.items)$=d.items.map((x,P)=>yt(`items[${P}]`,()=>{let{mixer:R,owner:I}=lu(x);return{mixer:R,owner:I,writes:fu(R,x)}}));else if(d.targets)$=d.targets.map((x,P)=>yt(`targets[${P}]`,()=>{let{mixer:R,owner:I}=lu(x);return{mixer:R,owner:I,writes:fu(R,d)}}));else if(d.all_tracks){let x=Tj(d.exclude??[],d.panning!==void 0||d.sends!==void 0);b=x.skipped,$=x.selected.map(({track:P,coveredBy:R})=>yt(()=>`track ${rt(P)}`,()=>({mixer:P.mixer,owner:P,writes:fu(P.mixer,R?{...d,volume:void 0}:d),volumeSkipped:R&&d.volume!==void 0?R:void 0})))}else{let{mixer:x,owner:P}=lu(d);$=[{mixer:x,owner:P,writes:fu(x,d)}]}let w=$.flatMap(x=>x.writes);return w.length&&await e.withinTransaction(()=>Promise.all(w.map(x=>x()))),m?await As($[0].mixer):{items:await Promise.all($.map(async({mixer:x,owner:P,volumeSkipped:R})=>({target_id:Y(P),name:P instanceof Ue?P.name:void 0,...await As(x),volume_skipped:R}))),skipped:b}}),u("import_file",{title:"Import file into project",annotations:Gr},"Copy a file into the Live project folder so Live manages it. Returns the imported path \u2014 use that path (not the original) in subsequent calls.",{file_path:y.string()},async({file_path:d})=>({imported_path:await e.resources.importIntoProject(d)}));let Dk=(d,m="rendered")=>{if(!(d instanceof Wr))throw new j(`Only audio tracks can be ${m}; ${rt(d)} is a ${dt(d)}.`);return d};async function zj(d){try{return{analysis:await V1(d)}}catch(m){return{analysis_error:`${d} could not be analyzed: ${Ie(m)}`}}}u("render_track_audio",{title:"Render track audio",annotations:Gr},`Render the pre-FX audio of an audio track between two arrangement beat positions and return the path of the audio file: WAV or AIFF, as Live's Record File Type setting says. Pre-FX means the track's clip audio before its device chain (no effects, mixer or sends). Since Live 12.4.15 the render is not normalized, so its levels are meaningful (Live's version cannot be detected: on older versions they are not). The file is written to the extension's temp directory, which may be cleaned between sessions: persist:true copies it into the Live project (\`imported_path\`; or pass it to import_file, or clip_create, which imports by default). analyze:true reads the file and returns \`analysis\`: its \`file_type\` (wav or aiff), overall and per-channel peak and RMS in dBFS (null = digital silence), \`clipped_samples\` (at or over full scale), \`silent\` (peak below ${nk} dBFS) and a ${Wn}-part \`envelope\` (peak and RMS per part) \u2014 an agent behind a remote client cannot open the file itself. PCM 8/16/24/32-bit and float 32/64-bit WAV, AIFF and AIFF-C files are read. Audio tracks only, addressed by track_id, track_index or track_name \u2014 or \`tracks\` to render several over the same range (returns {items}).`,{...ht(),start_time:y.number(),end_time:y.number(),tracks:y.array(y.object(ht())).min(1).optional().describe("Several audio tracks (each by track_id, track_index or track_name), rendered one by one"),analyze:y.boolean().default(!1).describe("Return levels, clipping, silence and an envelope of the render"),persist:y.boolean().default(!1).describe("Copy the render into the Live project (imported_path)")},async({start_time:d,end_time:m,tracks:f,analyze:v,persist:$,...b},w)=>{if(!(m>d))throw new j(`end_time ${m} must be after start_time ${d}.`);if(f&&fn(b))throw new j("Give tracks, or one track by track_id/track_index/track_name, not both.");let x=(f?uu(f,s().tracks):[nt(b)]).map(N=>Dk(N)),P=async N=>{let M=await e.resources.renderPreFxAudio(N,d,m),V={audio_path:M};if($)try{V.imported_path=await e.resources.importIntoProject(M)}catch(le){throw new Error(`Rendered to ${M}, but it could not be copied into the project: ${Ie(le)}`)}return v&&Object.assign(V,await zj(M)),V},R=[],I=x[0],D=()=>`Rendering ${rt(I)}`;return f?Ps(w,N=>`${D()}, ${R.length+1} of ${x.length} (${N} s)`,async()=>{for(let N of x){if(w.signal.aborted)break;I=N;let M={track_id:Y(N),track_name:N.name};try{R.push({...M,...await P(N)})}catch(V){R.push({...M,error:Ie(V)})}}return{items:R}}):Ps(w,N=>`${D()} (${N} s)`,()=>P(x[0]))}),u("audio_track_consolidate",{title:"Consolidate audio track range",annotations:Vi},"Consolidate a range of an audio track into one clip, like Live's Consolidate for audio comps: the track's pre-FX audio between start_time and end_time (beats) is rendered (its clips as they play, before the device chain, which stays on the track), copied into the Live project, the range is CLEARED (clips crossing its edges are shortened), and one unwarped audio clip of the render is created at start_time, optionally named and colored (#RRGGBB). Unwarped, it plays at the current tempo only. Destructive: confirm with the user first. Audio tracks only; the range must hold a clip. If the render, the import or the clearing fails, nothing is changed; if the clip cannot be created after the range was cleared, the error says so and where the render is \u2014 undo in Live restores the clips. Undo steps: clear, create, name and color.",{...ht(),start_time:y.number().min(0).describe("Start of the range in beats"),end_time:y.number().describe("End of the range in beats"),name:y.string().optional().describe("Name of the new clip"),color:y.string().optional().describe("#RRGGBB")},async({start_time:d,end_time:m,name:f,color:v,...$},b)=>{if(!(m>d))throw new j(`end_time ${m} must be after start_time ${d}.`);let w=v!==void 0?iu(v):void 0,x=Dk(nt($),"consolidated");if(!Oo(x.arrangementClips,d,m).length)throw new j(`${rt(x)} has no arrangement clips between ${d} and ${m}.`);let P,R;try{[P,R]=await Ps(b,N=>`Rendering ${rt(x)} (${N} s)`,async()=>{let N=await e.resources.renderPreFxAudio(x,d,m);return[N,await e.resources.importIntoProject(N)]})}catch(N){throw new Error(`Could not render and import the range: ${Ie(N)} Nothing was changed.`)}try{await x.clearClipsInRange(d,m)}catch(N){throw new Error(`Could not clear the range: ${Ie(N)} Nothing was changed (the render is at ${R}).`)}let I;try{I=await x.createAudioClip({filePath:R,startTime:d,duration:m-d,isWarped:!1})}catch(N){throw new Error(`The range ${d}-${m} was cleared, but the consolidated clip could not be created: ${Ie(N)} The render is at ${R}; undo in Live restores the clips.`)}let D;if(f!==void 0||w!==void 0)try{e.withinTransaction(()=>{f!==void 0&&(I.name=f),w!==void 0&&(I.color=w)})}catch(N){D=`the clip was created, but its name or color could not be set: ${Ie(N)}`}return{...dr(I,!0),location:ei(I),rendered_path:P,imported_path:R,cleared:[d,m],error:D}}),u("sample_search",{title:"Search sample files",annotations:Et},"Find audio files (for clip_create, simpler_replace_sample, device_insert sample_path, drum_kit_build) without a shell: a read-only search of the sample folders \u2014 the `sample_roots` folders listed in the extension's config.json (read on every call) plus Live's default User Library and Factory Packs folders (~/Music/Ableton or ~/Documents/Ableton) when they exist. Live's API has no browser access, so nothing else is searched; links leading outside these folders are not followed. `query` words must all occur in the file's path below its root (case-insensitive), e.g. \"kick 808\". Shallow files come first; the search stops at `limit` results, after max_depth folder levels, after time_limit_s or 20000 folders (`complete` false, `stopped` says why). Returns absolute paths, the `roots` searched (with `exists`) and config `problems`.",{query:y.string().optional().describe("Words that must all occur in the path below the root; omit to list"),extensions:y.array(y.string().min(1)).min(1).optional().describe(`File extensions, e.g. ["wav", "aif"]; default ${tk.join(", ")}`),roots:y.array(y.string().min(1)).min(1).optional().describe("Only the roots with these names or paths (see the result's `roots`)"),limit:y.number().int().min(1).max(500).default(50),max_depth:y.number().int().min(0).max(32).default(12).describe("Folder levels below each root"),time_limit_s:y.number().min(.1).max(20).default(5).describe("Stop searching after this long")},async({query:d,extensions:m,roots:f,limit:v,max_depth:$,time_limit_s:b})=>{let w=A1(mh(e.environment.storageDirectory)),x=[...w.roots,...C1()];if(f){let D=f.filter(N=>!x.some(M=>M.name.toLowerCase()===N.toLowerCase()||M.path===N));if(D.length)throw new j(`No sample root named ${D.map(Ke).join(", ")}. Roots: ${x.map(N=>`${Ke(N.name)} (${N.path})`).join(", ")||"none"}.`);x=x.filter(N=>f.some(M=>N.name.toLowerCase()===M.toLowerCase()||N.path===M))}let P=(m??tk).map(D=>(D.startsWith(".")?D:`.${D}`).toLowerCase()),R=(d??"").toLowerCase().split(/\s+/).filter(Boolean),I=await N1(x,{terms:R,extensions:P,limit:v,maxDepth:$,timeLimitMs:b*1e3,maxDirectories:2e4});return{...I,problems:w.problems.length?w.problems:void 0,hint:I.roots.some(D=>D.exists)?void 0:`No sample folder exists: add folders to "sample_roots" in the extension's config.json (${mh(e.environment.storageDirectory)??"no storage directory"}), e.g. {"port": 8722, "sample_roots": ["/Users/me/Samples"]}.`}});let hu='In Live, the user right-clicks a clip, clip slot, track, scene, Drum Rack, Simpler or sample \u2014 or a selection of clip slots, or a time selection in the arrangement \u2014 and chooses "MCP: Use as selection".';function Pj(d){let m=ei(d);if(d instanceof Ir)return{...dr(d),location:m};if(d instanceof It){let f=d.clip;return{id:Y(d),class:"ClipSlot",clip:f?dr(f):null,location:m}}return d instanceof Ue?{class:dt(d),...Ds(d),location:m}:d instanceof ri?{class:"Scene",...Li(d,Bt(s().scenes,d))}:d instanceof Do?{id:Y(d),class:"Sample",file_path:d.filePath,location:m}:d instanceof Ct?{...pr(d),location:m}:d instanceof xt?{...Mi(d),location:m}:d instanceof mr?{id:Y(d),class:"TakeLane",name:d.name,location:m}:{id:Y(d),class:dt(d),location:m}}function Ej(d,m){let f={id:Y(d),class:dt(d)},v,$;if(d instanceof Ue)v=d.arrangementClips,$={...f,name:d.name,location:Qn(d)};else if(d instanceof mr)v=d.clips,$={...f,name:d.name,location:xh(d)};else return{...f,location:ei(d),error:"not a track or take lane, so no clips are listed"};let b=m?Oo(v,m.start,m.end):v;return{...$,clips:b.map(w=>dr(w))}}function Ck(d){let m=(v,$)=>{if("error"in v)return{error:v.error};try{return $(v.object)}catch(b){return{id:v.id,class:dt(v.object),error:`${Ie(b)} (was it deleted or moved since it was captured?)`}}},f=d.time;return{captured:!0,seq:d.seq,captured_at:new Date(d.capturedAt).toISOString(),age_s:Math.round((Date.now()-d.capturedAt)/100)/10,scope:d.scope,kind:d.kind,problems:d.problems,...d.kind==="arrangement"?{time_selection:f&&{start_time:f.start,end_time:f.end,length:f.end-f.start},lanes:d.objects.map(v=>m(v,$=>Ej($,f)))}:{items:d.objects.map(v=>m(v,Pj))}}}let Ak="`seq` (increases with every capture), `captured_at`, `age_s`, the menu `scope`, `kind` and: for a clicked object (kind 'object') or a clip-slot selection ('clip_slots'), `items` \u2014 each with its id (usable in every other tool), a summary and its `location` (track, scene index or take lane, device path); for an arrangement time selection ('arrangement'), `time_selection` {start_time, end_time, length} in beats and `lanes`, each selected track or take lane with its clips overlapping the time selection. An object Live could not resolve, or that was deleted since, carries `error`.";u("selection_get",{title:"Get the user's selection",annotations:Et},`Get what the user last handed over from Live with the context-menu entry "MCP: Use as selection": Live's API has no selection getter, so this is how "quantize this", "these slots" or "the selected range" become ids. `+hu+" Returns "+Ak+" Check age_s: an old capture may not be what the user means now. Nothing captured yet: captured false, seq 0. To wait for the user to choose, use selection_wait.",{},()=>{let d=i.latest();return d?Ck(d):{captured:!1,seq:0,hint:hu}}),u("selection_wait",{title:"Wait for the user's selection",annotations:Et},"Wait until the user hands over a selection from Live ("+hu+") and return it as selection_get does: "+Ak+' Tell the user what to select and to choose "MCP: Use as selection" first, then call this. It returns as soon as there is a capture newer than `after_seq` (default: the latest capture when the call starts), or after timeout_s seconds with timed_out: true \u2014 then ask again or call it again. Keep timeout_s under the client\'s request timeout (often 60 s).',{timeout_s:y.number().min(1).max(55).default(50).describe("Seconds to wait, 1-55"),after_seq:y.number().int().min(0).optional().describe("Return as soon as the latest capture's seq is higher than this (a seq from selection_get), also for a capture made before this call; default: the latest seq now")},async({timeout_s:d,after_seq:m},f)=>{let v=Math.min(m??1/0,i.latestSeq),$=await Ps(f,b=>`Waiting for the user's selection in Live (${b} of ${d} s)`,()=>i.wait(v,d*1e3,f.signal));return $?Ck($):{captured:i.latestSeq>0,timed_out:!0,seq:i.latestSeq,hint:`No new selection within ${d} s. ${hu}`}});let Oj=y.object({title:y.string().max(200).optional().describe("Heading"),message:y.string().max(1e4).optional().describe("Text under the heading; line breaks are kept"),fields:y.array(y.object({name:y.string().regex(/^[A-Za-z][A-Za-z0-9_]{0,63}$/).describe("Key of the field's value in `values` (letters, digits, _; starting with a letter)"),label:y.string().max(200).optional().describe("Label shown; default the name"),type:y.enum(["text","textarea","number","checkbox","select"]).default("text"),default:y.union([y.string(),y.number(),y.boolean()]).optional().describe("Initial value: a string (text, textarea, select: one of options), number or boolean (checkbox)"),options:y.array(y.string().max(200)).min(1).max(100).optional().describe("select: the choices"),placeholder:y.string().max(200).optional(),min:y.number().optional().describe("number only"),max:y.number().optional().describe("number only"),step:y.number().positive().optional().describe("number only")}).strict()).max(20).optional().describe("Inputs; their values come back in `values` with every button"),choices:y.array(y.string().min(1).max(60)).min(1).max(8).optional().describe('Button labels, the first one highlighted; default ["OK"], or ["OK", "Cancel"] with fields. Enter never presses a button')}).strict();u("show_dialog",{title:"Show dialog in Live",annotations:Dq},"Show a modal dialog inside Ableton Live; it blocks Live's UI until the user closes it. Give exactly one of: `form` {title?, message?, fields?, choices?} \u2014 the server builds the page (all text escaped) and returns the answer as JSON: `choice` (the button's label), `choice_index` and, with fields, `values` by field name (text, textarea, select: a string; number: a number or null; checkbox: a boolean). Use it to confirm a destructive edit (e.g. choices [\"Delete 12 clips\", \"Cancel\"]) or to ask for a few values. `html` \u2014 your own page, which returns a string by posting {method:'close_and_send', params:[resultString]} to window.webkit.messageHandlers.live (macOS) or window.chrome.webview (Windows); the call returns it as `result`. `url` \u2014 an https:, file: or http://localhost page that posts close_and_send itself (`result`). By default the call waits until the dialog closes, but a client's request timeout (often 60 s) can end it first while the dialog stays open: for anything the user may think about, pass wait:false to get a `dialog_id` at once and poll dialog_result. One dialog at a time: while one is open (also the Status dialog), another is refused (dialog_result tells when it closed). Live cannot close a dialog from code, and dialogs keep no state between calls: each one starts from what you pass. Results carry `dialog_id` and `status`; a dialog Live cannot show fails the call (with wait:false, dialog_result reports status failed).",{html:y.string().optional().describe("A page of your own (it must post close_and_send)"),url:y.string().optional().describe("Instead of html: load this https:, file: or http://localhost URL (the page posts close_and_send)"),form:Oj.optional().describe("Instead of html: a form the server builds and answers as JSON"),width:y.number().int().min(100).max(2e3).default(480),height:y.number().int().min(80).max(1500).default(360),wait:y.boolean().default(!0).describe("false: return a dialog_id at once (status open) and get the answer with dialog_result"),force:y.boolean().default(!1).describe("Open even though an earlier dialog is still reported open \u2014 only when the user says it is already closed (Live did not report it)")},async({html:d,url:m,form:f,width:v,height:$,wait:b,force:w},x)=>{if([d,m,f].filter(M=>M!==void 0).length!==1)throw new j("Give exactly one of html, url and form.");let R,I;if(f){let M=i1(f);R=`data:text/html,${encodeURIComponent(o1(f,M))}`,I=V=>a1(f,M,V)}else R=m!==void 0?n1(m):`data:text/html,${encodeURIComponent(d??"")}`;let D=f?"form":m!==void 0?"url":"html",N=r.open(R,v,$,D,{force:w,answer:I});if(!b)return{...dh(N),hint:`Get the answer with dialog_result {dialog_id: ${JSON.stringify(N.id)}}.`};if(await Ps(x,M=>`Waiting for the user to close the dialog in Live (${M} s)`,()=>r.wait(N,1/0,x.signal)),N.status==="failed")throw new j(`Live could not show the dialog: ${N.error}`);return dh(N)});let Hh=Fw/6e4;u("dialog_result",{title:"Get dialog result",annotations:Et},`Get the answer of a dialog opened with show_dialog {wait:false}, or of one whose show_dialog call was cut off by a client timeout: \`status\` open (with \`open_s\`), closed with the answer \u2014 \`result\` (the string the page sent) or, for a form, \`choice\`, \`choice_index\` and \`values\` \u2014 or failed with \`error\`. An open dialog is waited for up to wait_s seconds; if it is still open then, the result has timed_out: true: call again (or tell the user the dialog is waiting). dialog_id defaults to the last dialog shown. Answers are kept for ${Hh} minutes after the dialog closes.`,{dialog_id:y.string().optional().describe("From show_dialog; default the last dialog shown"),wait_s:y.number().min(0).max(50).default(30).describe("Seconds to wait for an open dialog, 0-50; keep it under the client's request timeout")},async({dialog_id:d,wait_s:m},f)=>{let v=d!==void 0?r.get(d):r.latest();if(!v)throw new j(d!==void 0?`No dialog ${JSON.stringify(d)}: answers are kept for ${Hh} minutes after the dialog closes (and are gone when Live restarts).`:`No dialog was shown in the last ${Hh} minutes.`);v.status==="open"&&m>0&&await Ps(f,b=>`Waiting for the user to close the dialog in Live (${b} of ${m} s)`,()=>r.wait(v,m*1e3,f.signal));let $=dh(v);return v.status==="open"?{...$,timed_out:m>0?!0:void 0}:$});let gu=50,jj=new Set(["batch","batch_read"]),Rj=/^[A-Za-z_][A-Za-z0-9_]*$/,Nk=d=>({steps:y.array(y.object({tool:y.string().min(1).describe(d?"A read-only tool, e.g. track_get":"Tool name, e.g. track_create"),args:y.record(y.string(),y.unknown()).optional().describe(`The tool's arguments as in a direct call; {"$ref": "<step>.<path>"} takes a value from an earlier step's result`),as:y.string().regex(Rj).optional().describe("A name for this step's result in later $refs (letters, digits, _)")}).strict()).min(1).max(gu).describe(`1-${gu} steps, run in order`),on_error:y.enum(["stop","continue"]).default(d?"continue":"stop").describe("stop: no further steps after a failing one; continue: run the others (a step whose $ref points at a failed step fails too)")}),Mk=d=>typeof d=="object"&&d!==null&&!Array.isArray(d)&&Object.prototype.hasOwnProperty.call(d,"$ref");function Lk(d,m,f,v){let $=d.$ref;if(typeof $!="string"||Object.keys(d).length!==1)throw new j(`${m}: a $ref is {"$ref": "<step>.<path>"} with a string and no other keys.`);let[b,...w]=$.split("."),x=/^\d+$/.test(b)?Number(b):f.get(b);if(x===void 0||x>=v)throw new j(`${m}: $ref ${Ke($)} names no earlier step: use the index of a step before step ${v}, or an earlier step's "as" name.`);if(w.some(P=>P===""))throw new j(`${m}: $ref ${Ke($)} has an empty path segment.`);return{step:x,path:w}}function Jh(d,m,f,v){return Mk(d)?(Lk(d,m,f,v),1):Array.isArray(d)?d.reduce(($,b,w)=>$+Jh(b,`${m}[${w}]`,f,v),0):typeof d=="object"&&d!==null?Object.entries(d).reduce(($,[b,w])=>$+Jh(w,`${m}.${b}`,f,v),0):0}function Gh(d,m,f,v,$){if(Mk(d)){let{step:b,path:w}=Lk(d,m,f,v),x=Ke(String(d.$ref)),P=$[b];if(!P||"error"in P)throw new j(`${m}: $ref ${x}: step ${b} failed, so it has no result.`);let R=P.result;for(let[I,D]of w.entries()){let N=Array.isArray(R)?/^\d+$/.test(D)?R[Number(D)]:void 0:typeof R=="object"&&R!==null&&Object.prototype.hasOwnProperty.call(R,D)?R[D]:void 0;if(N===void 0)throw new j(`${m}: $ref ${x}: step ${b}'s result has no ${Ke(w.slice(0,I+1).join("."))}.`);R=N}return R}return Array.isArray(d)?d.map((b,w)=>Gh(b,`${m}[${w}]`,f,v,$)):typeof d=="object"&&d!==null?Object.fromEntries(Object.entries(d).map(([b,w])=>[b,Gh(w,`${m}.${b}`,f,v,$)])):d}function Uk(d,m,f,v){let $=d.safeParse(m);if($.success)return $.data;let b=$.error.issues.map(w=>`${w.path.join(".")||"args"}: ${w.message}`).join("; ");throw new j(`${f}: invalid arguments for ${v}: ${b}`)}async function Zk(d,m,f,v){let $=d?"batch_read":"batch",b=new Map,w=m.map((M,V)=>{let le=`steps[${V}]`,K=c.get(M.tool);if(!K)throw new j(l.has(M.tool)?`${le}: ${M.tool} is switched off on this server (read_only / disabled_tools in config.json).`:`${le}: no tool named ${Ke(M.tool)}.`);let oe=K.meta.annotations;if(jj.has(M.tool))throw new j(`${le}: ${M.tool} cannot run inside ${$}.`);if(oe.openWorldHint)throw new j(`${le}: ${M.tool} reaches outside the Live Set, so it only runs on its own.`);if(d&&!oe.readOnlyHint)throw new j(`${le}: ${M.tool} can change the Live Set; batch_read runs read-only tools only (use batch).`);let W=y.object(K.shape),ce=M.args??{},_e=Jh(ce,`${le}.args`,b,V);if(M.as!==void 0){if(b.has(M.as))throw new j(`${le}: the name ${Ke(M.as)} is used by step ${b.get(M.as)}.`);b.set(M.as,V)}return{step:M,entry:K,schema:W,parsed:_e?void 0:Uk(W,ce,le,M.tool)}}),x={...v,_meta:void 0},P=v._meta?.progressToken,R=(M,V)=>{P!==void 0&&v.sendNotification({method:"notifications/progress",params:{progressToken:P,progress:M,total:m.length,message:V}}).catch(()=>{})};R(0,`${m.length} steps`);let I=[],D=[];for(let[M,V]of w.entries()){if(v.signal.aborted)break;let le={step:M,tool:V.step.tool,as:V.step.as},K=`steps[${M}]`,oe=Date.now();try{let W=V.parsed??Uk(V.schema,Gh(V.step.args??{},`${K}.args`,b,M,I),K,V.step.tool),ce=await V.entry.handler(W,x);I.push({result:ce}),D.push({...le,result:ce})}catch(W){let ce=Ie(W);console.error(`[ableton-live-mcp] ${$} ${K} (${V.step.tool}) failed after ${Date.now()-oe} ms: ${ce}`);let _e=W instanceof j?ce:`${ce} ${B1}`;I.push({error:_e}),D.push({...le,error:_e})}if(R(M+1,`${K} (${V.step.tool}) done`),"error"in I[M]&&f==="stop")break}let N=I.filter(M=>"error"in M).length;return{ok:N===0&&I.length===m.length,completed:I.length-N,failed:N||void 0,results:D,not_run:I.length<m.length?m.slice(I.length).map((M,V)=>I.length+V):void 0}}let Fk='A value written as {"$ref": "<step>.<path>"} is taken from an earlier step\'s result: <step> is the 0-based step index or the step\'s `as` name, <path> dot-separated keys and array indexes, e.g. {"$ref": "0.id"}, {"$ref": "bass.clip_slots.0.clip.id"}. ';u("batch",{title:"Run tools in sequence",annotations:Vi},`Run up to ${gu} tool calls in order in one request: \`steps: [{tool, args, as?}]\`, each \`args\` exactly as in a direct call of that tool. `+Fk+'For dependent chains no compound tool covers (create a track, then a clip on it, then set its notes). Prefer the compound tools and `items` batches where they fit: they check everything first and form one undo step. Before the first step runs, every tool name, every $ref and the args of every step without a $ref are checked against the tools\' schemas; steps with a $ref are checked when they run. Each step is its own undo step(s): the batch is not atomic. on_error "stop" (default) ends the batch at the first failing step, "continue" runs the rest. Returns `results` (per step `result` or `error`), `completed`, `ok`, `failed` and `not_run` (step indexes). As destructive as its steps; batch, batch_read, show_dialog and execute_command cannot be steps.',Nk(!1),({steps:d,on_error:m},f)=>Zk(!1,d,m,f)),u("batch_read",{title:"Run read-only tools in sequence",annotations:Et},`Run up to ${gu} read-only tool calls in order in one request (the *_get tools, midi_clip_get_notes, session_grid, arrangement_get, parameter_find, sample_search, selection_wait, ...): \`steps: [{tool, args, as?}]\` as in batch. `+Fk+'E.g. find a track, then read its first clip\'s notes. Any step whose tool can change the set is refused before anything runs. on_error "continue" (default) runs every step. Returns `results` (per step `result` or `error`), `completed`, `ok` and `failed`.',Nk(!0),({steps:d,on_error:m},f)=>Zk(!0,d,m,f)),u("execute_command",{title:"Execute host command",annotations:Cq},"Invoke a command registered with the Extension Host by its string id. This extension registers 'ableton-live-mcp.status' (shows a status dialog in Live). Commands registered by other extensions can also be invoked if their id is known.",{command_id:y.string(),args:y.array(y.unknown()).optional()},({command_id:d,args:m})=>(e.commands.executeCommand(d,...m??[]),{executed:d}));let Vk=async(d,m,f)=>{let v=c.get(d);return v.handler(y.object(v.shape).parse(m),f)};async function qk(d,m,f){let v=Date.now();try{return{contents:[{uri:m.href,mimeType:"application/json",text:cj(await f())}]}}catch($){let b=Ie($);throw console.error(`[ableton-live-mcp] resource ${d} failed after ${Date.now()-v} ms: ${b}`),q1($ instanceof j?pe.InvalidParams:pe.InternalError,b)}}c.has("song_get")&&a.registerResource("song","live://song",{title:"Live Set",description:"The Live Set as song_get returns it without arguments: tempo, scale, grid, tracks with ids, return and main tracks, scenes, cue points, environment. Read it again for fresh data.",mimeType:"application/json"},(d,m)=>qk("song",d,()=>Vk("song_get",{},m)));let Bk=()=>{try{let d=s();return[...new Set([...d.tracks,...d.returnTracks,d.mainTrack].map(m=>m.name))]}catch{return[]}},Dj=d=>`live://tracks/${encodeURIComponent(d)}`;function Cj(){try{let d=s(),m=[...d.tracks.map((v,$)=>({t:v,where:`${Eo(v,d.tracks)} track, track_index ${$}`})),...d.returnTracks.map((v,$)=>({t:v,where:`return track, send_index ${$}`})),{t:d.mainTrack,where:"main track"}],f=new Map;for(let{t:v}of m)f.set(v.name,(f.get(v.name)??0)+1);return m.filter(({t:v})=>f.get(v.name)===1&&!["",".",".."].includes(v.name)).map(({t:v,where:$})=>({uri:Dj(v.name),name:v.name,description:$,mimeType:"application/json"}))}catch(d){return console.error(`[ableton-live-mcp] could not list the track resources: ${Ie(d)}`),[]}}let Aj=d=>{try{return decodeURIComponent(d).toLowerCase()}catch{return d.toLowerCase()}};c.has("track_get")&&a.registerResource("track",new Qf("live://tracks/{track}",{list:()=>({resources:Cj()}),complete:{track:d=>Bk().filter(m=>m.toLowerCase().startsWith(Aj(d))).map(encodeURIComponent)}}),{title:"Track",description:`One track as track_get returns it (clip slots, take lanes, arrangement clips, devices, mixer). {track} is the track's name, percent-encoded (encodeURIComponent: a "/" in a name is %2F), matched like track_name: exactly first, then ignoring case; regular, return and main tracks.`,mimeType:"application/json"},(d,m,f)=>qk("track",d,async()=>{let v=String(m.track),$;try{$=decodeURIComponent(v)}catch{throw new j(`${Ke(v)} is not a percent-encoded track name (encode it with encodeURIComponent).`)}return Vk("track_get",{track_name:$},f)})),a.registerResource("guide","live://guide",{title:"Ableton Live MCP guide",description:"How to use this server well: workflows, units, batching, what Live's API cannot do. The full version of the server instructions (skills/ableton-live/SKILL.md).",mimeType:"text/markdown"},d=>({contents:[{uri:d.href,mimeType:"text/markdown",text:Oq}]}));let Hk={scale:()=>{try{let d=s();return{root:q(d.rootNote),intervals:d.scaleIntervals.map(q),name:d.scaleName}}catch{return}},trackNames:Bk};for(let d of E1)d.tools.every(m=>c.has(m))&&a.registerPrompt(d.name,{title:d.title,description:d.description,argsSchema:d.args(Hk)},m=>{try{let f=$1(d,m,Hk);return{description:d.title,messages:[{role:"user",content:{type:"text",text:f}}]}}catch(f){throw f instanceof j?q1(pe.InvalidParams,`${d.name}: ${f.message}`):f}});return{server:a,tools:c}}var r9=new Set(["127.0.0.1","localhost","[::1]"]);function n9(e){let t=(r,o)=>{try{let a=new URL(r);return o.includes(a.protocol)&&r9.has(a.hostname)}catch{return!1}},n=e.headers.host;if(!n)return"missing Host header";if(!t(`http://${n}`,["http:"]))return`invalid Host header: ${n}`;let i=e.headers.origin;if(i!==void 0&&!t(i,["http:","https:"]))return`invalid Origin header: ${i}`}function Os(e,t,n,i,r={}){e.writeHead(t,{...r,"content-type":"application/json"}),e.end(JSON.stringify({jsonrpc:"2.0",error:{code:n,message:i},id:null}))}var kh=4*1024*1024;function i9(e){return Number(e.headers["content-length"])>kh?Promise.resolve(void 0):new Promise((t,n)=>{let i=new TextDecoder,r="",o=0;e.on("data",a=>{o+=a.byteLength,o<=kh&&(r+=i.decode(a,{stream:!0}))}),e.on("end",()=>t(o>kh?void 0:r+i.decode())),e.on("error",n)})}function o9(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;let{method:t,params:n}=e,i=n?._meta?.progressToken;return t==="tools/call"&&typeof n?.name=="string"&&Aq.has(n.name)&&(typeof i=="string"||typeof i=="number")}function a9(e,t,n,i,r,o=()=>[]){let a=()=>{let s=i(),c=o(),l=n?`<code>${nu(n)}</code>`:"the extension's config.json (no storage directory available)",u=s.kind==="listening"?`<p>MCP endpoint: <code>http://127.0.0.1:${t}/mcp</code></p><p>Add it to an MCP client as a streamable-http server.</p><p style="font-size:smaller">Port set in ${l}</p>`:s.kind==="failed"?`<p style="color:#ff8a80">The MCP server is not running: <code>${nu(s.error)}</code></p>`+(s.code==="EADDRINUSE"?`<p>Port ${t} is already in use by another program.</p>`:"")+`<p>Set another <code>"port"</code> in ${l}, then restart Live.</p>`:`<p>The MCP server is starting on port ${t}...</p>`,p=c.length?`<ul style="font-size:smaller;padding-left:18px">${c.map(h=>`<li>${nu(h)}</li>`).join("")}</ul>`:"";return'<!doctype html><meta charset="utf-8"><body style="font-family:sans-serif;background:#363636;color:#b5b5b5;padding:16px"><h3 style="margin-top:0;color:#fff">Ableton Live MCP</h3>'+u+p+`<button onclick="${Zw}.postMessage({method:'close_and_send',params:['ok']})">Close</button></body>`};e.commands.registerCommand("ableton-live-mcp.status",()=>{try{let s=Math.min(560,280+40*o().length);r.open(`data:text/html,${encodeURIComponent(a())}`,480,s,"status",{force:!0})}catch(s){console.error("[ableton-live-mcp] status dialog:",s)}});for(let s of["AudioTrack","MidiTrack"])e.ui.registerContextMenuAction(s,"Ableton Live MCP: Status","ableton-live-mcp.status").catch(c=>console.error(`[ableton-live-mcp] could not add the ${s} status entry:`,c))}function s9(e,t,n){let i=[...t.keys()].filter(a=>!n.has(a));if(!i.length)return;let r=i.filter(a=>t.get(a).meta.annotations.readOnlyHint);return`- ${e.readOnly?`This server is read-only (read_only in config.json): every tool that changes the Live Set is switched off${r.length?`, and so are ${r.join(", ")}`:""}`:`Switched off on this server (disabled_tools in config.json): ${i.join(", ")}`}. Tell the user when a request needs them; don't look for workarounds.`}function c9(e,t,n){let i=[];e.locked&&i.push(`Every request is refused: ${e.locked}. Fix config.json, then restart Live.`),e.readOnly&&i.push(`Read-only: ${n.size} of ${t.size} tools are on (read_only).`);let r=e.disabledTools.filter(o=>t.has(o));return r.length&&i.push(`Switched off (disabled_tools): ${r.join(", ")}.`),e.tokenDigest&&i.push("Requests need the bearer token (auth_token in config.json)."),[...i,...e.problems.map(o=>`config.json: ${o}`)]}async function hj(e,t){let n=p1(e.environment.storageDirectory),{port:i,file:r,progress:o}=n;for(let z of n.problems)console.error(`[ableton-live-mcp] config: ${z}`);let a={kind:"starting"},s=n.problems.map(z=>`config.json: ${z}`),c=new uh(e);try{a9(e,i,r,()=>a,c,()=>s)}catch(z){console.error("[ableton-live-mcp] could not register the status command:",z)}let l=new $h(e);try{L1(e,l)}catch(z){console.error("[ableton-live-mcp] could not register the selection menu entries:",z)}let u;try{u=aj(e,t,i,l,c).tools}catch(z){throw a={kind:"failed",error:Ie(z)},z}let p=n.disabledTools.filter(z=>!u.has(z));p.length&&ks(n,`disabled_tools in config.json names no tool: ${p.map(z=>JSON.stringify(z)).join(", ")}`);let h=new Set(n.disabledTools),g=new Set([...u].filter(([z,S])=>!h.has(z)&&(!n.readOnly||S.meta.annotations.readOnlyHint===!0)).map(([z])=>z)),_={allowed:g.size<u.size?g:void 0,note:s9(n,u,g)};s=c9(n,u,g),n.locked&&console.error(`[ableton-live-mcp] every /mcp request is refused: ${n.locked} (${r})`);let k=Date.now(),T=sj.createServer(async(z,S)=>{try{let A=n9(z);if(A){console.error(`[ableton-live-mcp] refused request: ${A}`),Os(S,403,-32e3,`Forbidden: ${A}`);return}let Q=(z.url??"").split("?")[0],X=Q.length>1&&Q.endsWith("/")?Q.slice(0,-1):Q;if(X==="/health"){S.writeHead(n.locked?503:200,{"content-type":"application/json","cache-control":"no-store"}),S.end(JSON.stringify({ok:!n.locked,...ik,host_api_version:t,tool_count:g.size,read_only:n.readOnly,auth_required:n.tokenDigest!==void 0,uptime_s:Math.floor((Date.now()-k)/1e3),error:n.locked?"config.json has an invalid security setting, or cannot be read or parsed: every /mcp request is refused (the Status dialog in Live says why)":void 0}));return}if(X!=="/mcp"){S.writeHead(404,{"content-type":"text/plain"}),S.end("Not found. MCP endpoint: POST /mcp");return}if(n.tokenDigest&&!d1(z.headers.authorization,n.tokenDigest)){let _t=z.headers.authorization!==void 0;console.error(`[ableton-live-mcp] refused request: ${_t?"invalid":"missing"} bearer token`),Os(S,401,-32e3,"Unauthorized: this server needs the header Authorization: Bearer <token>",{"www-authenticate":`Bearer realm="ableton-live-mcp"${_t?', error="invalid_token"':""}`});return}if(n.locked){Os(S,503,-32e3,`Service unavailable: ${n.locked}. Fix config.json, then restart Live.`);return}if(z.method!=="POST"){Os(S,405,-32e3,"Method not allowed. MCP endpoint: POST /mcp",{allow:"POST"});return}let ge=await i9(z);if(ge===void 0){Os(S,413,-32e3,`Payload Too Large: Request body must not exceed ${kh} bytes`);return}let ye=ge;try{ye=JSON.parse(ge)}catch{}let Le=new lh({sessionIdGenerator:void 0,enableJsonResponse:!(o&&o9(ye))}),{server:Dt}=aj(e,t,i,l,c,_);S.on("close",()=>{Le.close(),Dt.close()}),await Dt.connect(Le),await Le.handleRequest(z,S,ye)}catch(A){console.error("[ableton-live-mcp] request error:",A),S.headersSent||Os(S,500,-32603,"Internal server error")}});try{await new Promise((z,S)=>{T.once("error",S),T.listen(i,"127.0.0.1",()=>{T.off("error",S),z()})})}catch(z){let S=z;throw a={kind:"failed",error:S?.message??String(z),code:S?.code},z}a={kind:"listening"},k=Date.now(),T.on("error",z=>console.error("[ableton-live-mcp] server error:",z)),console.log(`[ableton-live-mcp] MCP server listening on http://127.0.0.1:${i}/mcp`),o||console.log(`[ableton-live-mcp] progress notifications are off (${r})`),_.allowed&&console.log(`[ableton-live-mcp] ${g.size} of ${u.size} tools exposed (${n.readOnly?"read_only":"disabled_tools"} in ${r})`),n.tokenDigest&&console.log(`[ableton-live-mcp] requests need the bearer token (auth_token in ${r})`)}function l9(e){let t=tx(e,"1.0.0");hj(t,e.hostApiVersion).catch(n=>{console.error("[ableton-live-mcp] failed to start MCP server:",n)})}0&&(module.exports={activate});
|
|
173
|
+
/*! Bundled license information:
|
|
174
|
+
|
|
175
|
+
content-type/index.js:
|
|
176
|
+
(*!
|
|
177
|
+
* content-type
|
|
178
|
+
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
179
|
+
* MIT Licensed
|
|
180
|
+
*)
|
|
181
|
+
*/
|