@heylatch/cli 0.2.1 → 0.2.2
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/LICENSE +21 -0
- package/dist/latch.js +1 -1
- package/package.json +4 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Latch
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/latch.js
CHANGED
|
@@ -7,7 +7,7 @@ var gP=Object.create;var _p=Object.defineProperty;var vP=Object.getOwnPropertyDe
|
|
|
7
7
|
|| ${a} === "boolean" || ${r} === null`).assign(s,(0,re._)`[${r}]`)}}}function sA({gen:e,parentData:t,parentDataProperty:n},i){e.if((0,re._)`${t} !== undefined`,()=>e.assign((0,re._)`${t}[${n}]`,i))}function fy(e,t,n,i=Uo.Correct){let r=i===Uo.Correct?re.operators.EQ:re.operators.NEQ,o;switch(e){case"null":return(0,re._)`${t} ${r} null`;case"array":o=(0,re._)`Array.isArray(${t})`;break;case"object":o=(0,re._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":o=a((0,re._)`!(${t} % 1) && !isNaN(${t})`);break;case"number":o=a();break;default:return(0,re._)`typeof ${t} ${r} ${e}`}return i===Uo.Correct?o:(0,re.not)(o);function a(s=re.nil){return(0,re.and)((0,re._)`typeof ${t} == "number"`,s,n?(0,re._)`isFinite(${t})`:re.nil)}}ct.checkDataType=fy;function py(e,t,n,i){if(e.length===1)return fy(e[0],t,n,i);let r,o=(0,F0.toHash)(e);if(o.array&&o.object){let a=(0,re._)`typeof ${t} != "object"`;r=o.null?a:(0,re._)`!${t} || ${a}`,delete o.null,delete o.array,delete o.object}else r=re.nil;o.number&&delete o.integer;for(let a in o)r=(0,re.and)(r,fy(a,t,n,i));return r}ct.checkDataTypes=py;var cA={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?(0,re._)`{type: ${e}}`:(0,re._)`{type: ${t}}`};function my(e){let t=uA(e);(0,rA.reportError)(t,cA)}ct.reportTypeError=my;function uA(e){let{gen:t,data:n,schema:i}=e,r=(0,F0.schemaRefOrVal)(e,i,"type");return{gen:t,keyword:"type",data:n,schema:i.type,schemaCode:r,schemaValue:r,parentSchema:i,params:{},it:e}}});var H0=N(Pf=>{"use strict";Object.defineProperty(Pf,"__esModule",{value:!0});Pf.assignDefaults=void 0;var Zo=ne(),lA=pe();function dA(e,t){let{properties:n,items:i}=e.schema;if(t==="object"&&n)for(let r in n)J0(e,r,n[r].default);else t==="array"&&Array.isArray(i)&&i.forEach((r,o)=>J0(e,o,r.default))}Pf.assignDefaults=dA;function J0(e,t,n){let{gen:i,compositeRule:r,data:o,opts:a}=e;if(n===void 0)return;let s=(0,Zo._)`${o}${(0,Zo.getProperty)(t)}`;if(r){(0,lA.checkStrictMode)(e,`default is ignored for: ${s}`);return}let c=(0,Zo._)`${s} === undefined`;a.useDefaults==="empty"&&(c=(0,Zo._)`${c} || ${s} === null || ${s} === ""`),i.if(c,(0,Zo._)`${s} = ${(0,Zo.stringify)(n)}`)}});var Qt=N(ze=>{"use strict";Object.defineProperty(ze,"__esModule",{value:!0});ze.validateUnion=ze.validateArray=ze.usePattern=ze.callValidateCode=ze.schemaProperties=ze.allSchemaProperties=ze.noPropertyInData=ze.propertyInData=ze.isOwnProperty=ze.hasPropFunc=ze.reportMissingProp=ze.checkMissingProp=ze.checkReportMissingProp=void 0;var je=ne(),hy=pe(),$n=Br(),fA=pe();function pA(e,t){let{gen:n,data:i,it:r}=e;n.if(vy(n,i,t,r.opts.ownProperties),()=>{e.setParams({missingProperty:(0,je._)`${t}`},!0),e.error()})}ze.checkReportMissingProp=pA;function mA({gen:e,data:t,it:{opts:n}},i,r){return(0,je.or)(...i.map(o=>(0,je.and)(vy(e,t,o,n.ownProperties),(0,je._)`${r} = ${o}`)))}ze.checkMissingProp=mA;function hA(e,t){e.setParams({missingProperty:t},!0),e.error()}ze.reportMissingProp=hA;function K0(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,je._)`Object.prototype.hasOwnProperty`})}ze.hasPropFunc=K0;function gy(e,t,n){return(0,je._)`${K0(e)}.call(${t}, ${n})`}ze.isOwnProperty=gy;function gA(e,t,n,i){let r=(0,je._)`${t}${(0,je.getProperty)(n)} !== undefined`;return i?(0,je._)`${r} && ${gy(e,t,n)}`:r}ze.propertyInData=gA;function vy(e,t,n,i){let r=(0,je._)`${t}${(0,je.getProperty)(n)} === undefined`;return i?(0,je.or)(r,(0,je.not)(gy(e,t,n))):r}ze.noPropertyInData=vy;function G0(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}ze.allSchemaProperties=G0;function vA(e,t){return G0(t).filter(n=>!(0,hy.alwaysValidSchema)(e,t[n]))}ze.schemaProperties=vA;function yA({schemaCode:e,data:t,it:{gen:n,topSchemaRef:i,schemaPath:r,errorPath:o},it:a},s,c,u){let l=u?(0,je._)`${e}, ${t}, ${i}${r}`:t,d=[[$n.default.instancePath,(0,je.strConcat)($n.default.instancePath,o)],[$n.default.parentData,a.parentData],[$n.default.parentDataProperty,a.parentDataProperty],[$n.default.rootData,$n.default.rootData]];a.opts.dynamicRef&&d.push([$n.default.dynamicAnchors,$n.default.dynamicAnchors]);let f=(0,je._)`${l}, ${n.object(...d)}`;return c!==je.nil?(0,je._)`${s}.call(${c}, ${f})`:(0,je._)`${s}(${f})`}ze.callValidateCode=yA;var _A=(0,je._)`new RegExp`;function $A({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,je._)`${r.code==="new RegExp"?_A:(0,fA.useFunc)(e,r)}(${n}, ${i})`})}ze.usePattern=$A;function bA(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,je._)`${n}.length`);t.forRange("i",0,c,u=>{e.subschema({keyword:i,dataProp:u,dataPropType:hy.Type.Num},o),t.if((0,je.not)(o),s)})}}ze.validateArray=bA;function wA(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,hy.alwaysValidSchema)(r,c))&&!r.opts.unevaluated)return;let a=t.let("valid",!1),s=t.name("_valid");t.block(()=>n.forEach((c,u)=>{let l=e.subschema({keyword:i,schemaProp:u,compositeRule:!0},s);t.assign(a,(0,je._)`${a} || ${s}`),e.mergeValidEvaluated(l,s)||t.if((0,je.not)(a))})),e.result(a,()=>e.reset(),()=>e.error(!0))}ze.validateUnion=wA});var Y0=N(Sr=>{"use strict";Object.defineProperty(Sr,"__esModule",{value:!0});Sr.validateKeywordUsage=Sr.validSchemaType=Sr.funcKeywordCode=Sr.macroKeywordCode=void 0;var $t=ne(),ni=Br(),xA=Qt(),kA=Xs();function SA(e,t){let{gen:n,keyword:i,schema:r,parentSchema:o,it:a}=e,s=t.macro.call(a.self,r,o,a),c=X0(n,i,s);a.opts.validateSchema!==!1&&a.self.validateSchema(s,!0);let u=n.name("valid");e.subschema({schema:s,schemaPath:$t.nil,errSchemaPath:`${a.errSchemaPath}/${i}`,topSchemaRef:c,compositeRule:!0},u),e.pass(u,()=>e.error(!0))}Sr.macroKeywordCode=SA;function IA(e,t){var n;let{gen:i,keyword:r,schema:o,parentSchema:a,$data:s,it:c}=e;PA(c,t);let u=!s&&t.compile?t.compile.call(c.self,o,a,c):t.validate,l=X0(i,r,u),d=i.let("valid");e.block$data(d,f),e.ok((n=t.valid)!==null&&n!==void 0?n:d);function f(){if(t.errors===!1)h(),t.modifying&&W0(e),g(()=>e.error());else{let _=t.async?p():m();t.modifying&&W0(e),g(()=>zA(e,_))}}function p(){let _=i.let("ruleErrs",null);return i.try(()=>h((0,$t._)`await `),$=>i.assign(d,!1).if((0,$t._)`${$} instanceof ${c.ValidationError}`,()=>i.assign(_,(0,$t._)`${$}.errors`),()=>i.throw($))),_}function m(){let _=(0,$t._)`${l}.errors`;return i.assign(_,null),h($t.nil),_}function h(_=t.async?(0,$t._)`await `:$t.nil){let $=c.opts.passContext?ni.default.this:ni.default.self,k=!("compile"in t&&!s||t.schema===!1);i.assign(d,(0,$t._)`${_}${(0,xA.callValidateCode)(e,l,$,k)}`,t.modifying)}function g(_){var $;i.if((0,$t.not)(($=t.valid)!==null&&$!==void 0?$:d),_)}}Sr.funcKeywordCode=IA;function W0(e){let{gen:t,data:n,it:i}=e;t.if(i.parentData,()=>t.assign(n,(0,$t._)`${i.parentData}[${i.parentDataProperty}]`))}function zA(e,t){let{gen:n}=e;n.if((0,$t._)`Array.isArray(${t})`,()=>{n.assign(ni.default.vErrors,(0,$t._)`${ni.default.vErrors} === null ? ${t} : ${ni.default.vErrors}.concat(${t})`).assign(ni.default.errors,(0,$t._)`${ni.default.vErrors}.length`),(0,kA.extendErrors)(e)},()=>e.error())}function PA({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}function X0(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,$t.stringify)(n)})}function TA(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")}Sr.validSchemaType=TA;function OA({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)}}Sr.validateKeywordUsage=OA});var eS=N(bn=>{"use strict";Object.defineProperty(bn,"__esModule",{value:!0});bn.extendSubschemaMode=bn.extendSubschemaData=bn.getSubschema=void 0;var Ir=ne(),Q0=pe();function jA(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,Ir._)`${e.schemaPath}${(0,Ir.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:s[n],schemaPath:(0,Ir._)`${e.schemaPath}${(0,Ir.getProperty)(t)}${(0,Ir.getProperty)(n)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,Q0.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')}bn.getSubschema=jA;function EA(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:u,dataPathArr:l,opts:d}=t,f=s.let("data",(0,Ir._)`${t.data}${(0,Ir.getProperty)(n)}`,!0);c(f),e.errorPath=(0,Ir.str)`${u}${(0,Q0.getErrorPath)(n,i,d.jsPropertySyntax)}`,e.parentDataProperty=(0,Ir._)`${n}`,e.dataPathArr=[...l,e.parentDataProperty]}if(r!==void 0){let u=r instanceof Ir.Name?r:s.let("data",r,!0);c(u),a!==void 0&&(e.propertyName=a)}o&&(e.dataTypes=o);function c(u){e.data=u,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,u]}}bn.extendSubschemaData=EA;function NA(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}bn.extendSubschemaMode=NA});var yy=N((y5,tS)=>{"use strict";tS.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 nS=N((_5,rS)=>{"use strict";var wn=rS.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(){};Tf(t,i,r,e,"",e)};wn.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};wn.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};wn.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};wn.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 Tf(e,t,n,i,r,o,a,s,c,u){if(i&&typeof i=="object"&&!Array.isArray(i)){t(i,r,o,a,s,c,u);for(var l in i){var d=i[l];if(Array.isArray(d)){if(l in wn.arrayKeywords)for(var f=0;f<d.length;f++)Tf(e,t,n,d[f],r+"/"+l+"/"+f,o,r,l,i,f)}else if(l in wn.propsKeywords){if(d&&typeof d=="object")for(var p in d)Tf(e,t,n,d[p],r+"/"+l+"/"+AA(p),o,r,l,i,p)}else(l in wn.keywords||e.allKeys&&!(l in wn.skipKeywords))&&Tf(e,t,n,d,r+"/"+l,o,r,l,i)}n(i,r,o,a,s,c,u)}}function AA(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}});var Qs=N(Ot=>{"use strict";Object.defineProperty(Ot,"__esModule",{value:!0});Ot.getSchemaRefs=Ot.resolveUrl=Ot.normalizeId=Ot._getFullPath=Ot.getFullPath=Ot.inlineRef=void 0;var DA=pe(),RA=yy(),CA=nS(),UA=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function ZA(e,t=!0){return typeof e=="boolean"?!0:t===!0?!_y(e):t?iS(e)<=t:!1}Ot.inlineRef=ZA;var MA=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function _y(e){for(let t in e){if(MA.has(t))return!0;let n=e[t];if(Array.isArray(n)&&n.some(_y)||typeof n=="object"&&_y(n))return!0}return!1}function iS(e){let t=0;for(let n in e){if(n==="$ref")return 1/0;if(t++,!UA.has(n)&&(typeof e[n]=="object"&&(0,DA.eachItem)(e[n],i=>t+=iS(i)),t===1/0))return 1/0}return t}function oS(e,t="",n){n!==!1&&(t=Mo(t));let i=e.parse(t);return aS(e,i)}Ot.getFullPath=oS;function aS(e,t){return e.serialize(t).split("#")[0]+"#"}Ot._getFullPath=aS;var LA=/#\/?$/;function Mo(e){return e?e.replace(LA,""):""}Ot.normalizeId=Mo;function VA(e,t,n){return n=Mo(n),e.resolve(t,n)}Ot.resolveUrl=VA;var FA=/^[a-z_][-a-z0-9._]*$/i;function qA(e,t){if(typeof e=="boolean")return{};let{schemaId:n,uriResolver:i}=this.opts,r=Mo(e[n]||t),o={"":r},a=oS(i,r,!1),s={},c=new Set;return CA(e,{allKeys:!0},(d,f,p,m)=>{if(m===void 0)return;let h=a+f,g=o[m];typeof d[n]=="string"&&(g=_.call(this,d[n])),$.call(this,d.$anchor),$.call(this,d.$dynamicAnchor),o[f]=g;function _(k){let O=this.opts.uriResolver.resolve;if(k=Mo(g?O(g,k):k),c.has(k))throw l(k);c.add(k);let T=this.refs[k];return typeof T=="string"&&(T=this.refs[T]),typeof T=="object"?u(d,T.schema,k):k!==Mo(h)&&(k[0]==="#"?(u(d,s[k],k),s[k]=d):this.refs[k]=h),k}function $(k){if(typeof k=="string"){if(!FA.test(k))throw new Error(`invalid anchor "${k}"`);_.call(this,`#${k}`)}}}),s;function u(d,f,p){if(f!==void 0&&!RA(d,f))throw l(p)}function l(d){return new Error(`reference "${d}" resolves to more than one schema`)}}Ot.getSchemaRefs=qA});var rc=N(xn=>{"use strict";Object.defineProperty(xn,"__esModule",{value:!0});xn.getData=xn.KeywordCxt=xn.validateFunctionCode=void 0;var dS=M0(),sS=Ys(),by=dy(),Of=Ys(),BA=H0(),tc=Y0(),$y=eS(),L=ne(),W=Br(),JA=Qs(),Jr=pe(),ec=Xs();function HA(e){if(mS(e)&&(hS(e),pS(e))){WA(e);return}fS(e,()=>(0,dS.topBoolOrEmptySchema)(e))}xn.validateFunctionCode=HA;function fS({gen:e,validateName:t,schema:n,schemaEnv:i,opts:r},o){r.code.es5?e.func(t,(0,L._)`${W.default.data}, ${W.default.valCxt}`,i.$async,()=>{e.code((0,L._)`"use strict"; ${cS(n,r)}`),GA(e,r),e.code(o)}):e.func(t,(0,L._)`${W.default.data}, ${KA(r)}`,i.$async,()=>e.code(cS(n,r)).code(o))}function KA(e){return(0,L._)`{${W.default.instancePath}="", ${W.default.parentData}, ${W.default.parentDataProperty}, ${W.default.rootData}=${W.default.data}${e.dynamicRef?(0,L._)`, ${W.default.dynamicAnchors}={}`:L.nil}}={}`}function GA(e,t){e.if(W.default.valCxt,()=>{e.var(W.default.instancePath,(0,L._)`${W.default.valCxt}.${W.default.instancePath}`),e.var(W.default.parentData,(0,L._)`${W.default.valCxt}.${W.default.parentData}`),e.var(W.default.parentDataProperty,(0,L._)`${W.default.valCxt}.${W.default.parentDataProperty}`),e.var(W.default.rootData,(0,L._)`${W.default.valCxt}.${W.default.rootData}`),t.dynamicRef&&e.var(W.default.dynamicAnchors,(0,L._)`${W.default.valCxt}.${W.default.dynamicAnchors}`)},()=>{e.var(W.default.instancePath,(0,L._)`""`),e.var(W.default.parentData,(0,L._)`undefined`),e.var(W.default.parentDataProperty,(0,L._)`undefined`),e.var(W.default.rootData,W.default.data),t.dynamicRef&&e.var(W.default.dynamicAnchors,(0,L._)`{}`)})}function WA(e){let{schema:t,opts:n,gen:i}=e;fS(e,()=>{n.$comment&&t.$comment&&vS(e),tD(e),i.let(W.default.vErrors,null),i.let(W.default.errors,0),n.unevaluated&&XA(e),gS(e),iD(e)})}function XA(e){let{gen:t,validateName:n}=e;e.evaluated=t.const("evaluated",(0,L._)`${n}.evaluated`),t.if((0,L._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,L._)`${e.evaluated}.props`,(0,L._)`undefined`)),t.if((0,L._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,L._)`${e.evaluated}.items`,(0,L._)`undefined`))}function cS(e,t){let n=typeof e=="object"&&e[t.schemaId];return n&&(t.code.source||t.code.process)?(0,L._)`/*# sourceURL=${n} */`:L.nil}function YA(e,t){if(mS(e)&&(hS(e),pS(e))){QA(e,t);return}(0,dS.boolOrEmptySchema)(e,t)}function pS({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 mS(e){return typeof e.schema!="boolean"}function QA(e,t){let{schema:n,gen:i,opts:r}=e;r.$comment&&n.$comment&&vS(e),rD(e),nD(e);let o=i.const("_errs",W.default.errors);gS(e,o),i.var(t,(0,L._)`${o} === ${W.default.errors}`)}function hS(e){(0,Jr.checkUnknownRules)(e),eD(e)}function gS(e,t){if(e.opts.jtd)return uS(e,[],!1,t);let n=(0,sS.getSchemaTypes)(e.schema),i=(0,sS.coerceAndCheckDataType)(e,n);uS(e,n,!i,t)}function eD(e){let{schema:t,errSchemaPath:n,opts:i,self:r}=e;t.$ref&&i.ignoreKeywordsWithRef&&(0,Jr.schemaHasRulesButRef)(t,r.RULES)&&r.logger.warn(`$ref: keywords ignored in schema at path "${n}"`)}function tD(e){let{schema:t,opts:n}=e;t.default!==void 0&&n.useDefaults&&n.strictSchema&&(0,Jr.checkStrictMode)(e,"default is ignored in the schema root")}function rD(e){let t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,JA.resolveUrl)(e.opts.uriResolver,e.baseId,t))}function nD(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}function vS({gen:e,schemaEnv:t,schema:n,errSchemaPath:i,opts:r}){let o=n.$comment;if(r.$comment===!0)e.code((0,L._)`${W.default.self}.logger.log(${o})`);else if(typeof r.$comment=="function"){let a=(0,L.str)`${i}/$comment`,s=e.scopeValue("root",{ref:t.root});e.code((0,L._)`${W.default.self}.opts.$comment(${o}, ${a}, ${s}.schema)`)}}function iD(e){let{gen:t,schemaEnv:n,validateName:i,ValidationError:r,opts:o}=e;n.$async?t.if((0,L._)`${W.default.errors} === 0`,()=>t.return(W.default.data),()=>t.throw((0,L._)`new ${r}(${W.default.vErrors})`)):(t.assign((0,L._)`${i}.errors`,W.default.vErrors),o.unevaluated&&oD(e),t.return((0,L._)`${W.default.errors} === 0`))}function oD({gen:e,evaluated:t,props:n,items:i}){n instanceof L.Name&&e.assign((0,L._)`${t}.props`,n),i instanceof L.Name&&e.assign((0,L._)`${t}.items`,i)}function uS(e,t,n,i){let{gen:r,schema:o,data:a,allErrors:s,opts:c,self:u}=e,{RULES:l}=u;if(o.$ref&&(c.ignoreKeywordsWithRef||!(0,Jr.schemaHasRulesButRef)(o,l))){r.block(()=>_S(e,"$ref",l.all.$ref.definition));return}c.jtd||aD(e,t),r.block(()=>{for(let f of l.rules)d(f);d(l.post)});function d(f){(0,by.shouldUseGroup)(o,f)&&(f.type?(r.if((0,Of.checkDataType)(f.type,a,c.strictNumbers)),lS(e,f),t.length===1&&t[0]===f.type&&n&&(r.else(),(0,Of.reportTypeError)(e)),r.endIf()):lS(e,f),s||r.if((0,L._)`${W.default.errors} === ${i||0}`))}}function lS(e,t){let{gen:n,schema:i,opts:{useDefaults:r}}=e;r&&(0,BA.assignDefaults)(e,t.type),n.block(()=>{for(let o of t.rules)(0,by.shouldUseRule)(i,o)&&_S(e,o.keyword,o.definition,t.type)})}function aD(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(sD(e,t),e.opts.allowUnionTypes||cD(e,t),uD(e,e.dataTypes))}function sD(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(n=>{yS(e.dataTypes,n)||wy(e,`type "${n}" not allowed by context "${e.dataTypes.join(",")}"`)}),dD(e,t)}}function cD(e,t){t.length>1&&!(t.length===2&&t.includes("null"))&&wy(e,"use allowUnionTypes to allow union type keyword")}function uD(e,t){let n=e.self.RULES.all;for(let i in n){let r=n[i];if(typeof r=="object"&&(0,by.shouldUseRule)(e.schema,r)){let{type:o}=r.definition;o.length&&!o.some(a=>lD(t,a))&&wy(e,`missing type "${o.join(",")}" for keyword "${i}"`)}}}function lD(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function yS(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function dD(e,t){let n=[];for(let i of e.dataTypes)yS(t,i)?n.push(i):t.includes("integer")&&i==="number"&&n.push("integer");e.dataTypes=n}function wy(e,t){let n=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${n}" (strictTypes)`,(0,Jr.checkStrictMode)(e,t,e.opts.strictTypes)}var jf=class{constructor(t,n,i){if((0,tc.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,Jr.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",$S(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,tc.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",W.default.errors))}result(t,n,i){this.failResult((0,L.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,L.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,L._)`${n} !== undefined && (${(0,L.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?ec.reportExtraError:ec.reportError)(this,this.def.error,n)}$dataError(){(0,ec.reportError)(this,this.def.$dataError||ec.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,ec.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=L.nil){this.gen.block(()=>{this.check$data(t,i),n()})}check$data(t=L.nil,n=L.nil){if(!this.$data)return;let{gen:i,schemaCode:r,schemaType:o,def:a}=this;i.if((0,L.or)((0,L._)`${r} === undefined`,n)),t!==L.nil&&i.assign(t,!0),(o.length||a.validateSchema)&&(i.elseIf(this.invalid$data()),this.$dataError(),t!==L.nil&&i.assign(t,!1)),i.else()}invalid$data(){let{gen:t,schemaCode:n,schemaType:i,def:r,it:o}=this;return(0,L.or)(a(),s());function a(){if(i.length){if(!(n instanceof L.Name))throw new Error("ajv implementation error");let c=Array.isArray(i)?i:[i];return(0,L._)`${(0,Of.checkDataTypes)(c,n,o.opts.strictNumbers,Of.DataType.Wrong)}`}return L.nil}function s(){if(r.validateSchema){let c=t.scopeValue("validate$data",{ref:r.validateSchema});return(0,L._)`!${c}(${n})`}return L.nil}}subschema(t,n){let i=(0,$y.getSubschema)(this.it,t);(0,$y.extendSubschemaData)(i,this.it,t),(0,$y.extendSubschemaMode)(i,t);let r={...this.it,...i,items:void 0,props:void 0};return YA(r,n),r}mergeEvaluated(t,n){let{it:i,gen:r}=this;i.opts.unevaluated&&(i.props!==!0&&t.props!==void 0&&(i.props=Jr.mergeEvaluated.props(r,t.props,i.props,n)),i.items!==!0&&t.items!==void 0&&(i.items=Jr.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,L.Name)),!0}};xn.KeywordCxt=jf;function _S(e,t,n,i){let r=new jf(e,n,t);"code"in n?n.code(r,i):r.$data&&n.validate?(0,tc.funcKeywordCode)(r,n):"macro"in n?(0,tc.macroKeywordCode)(r,n):(n.compile||n.validate)&&(0,tc.funcKeywordCode)(r,n)}var fD=/^\/(?:[^~]|~0|~1)*$/,pD=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function $S(e,{dataLevel:t,dataNames:n,dataPathArr:i}){let r,o;if(e==="")return W.default.rootData;if(e[0]==="/"){if(!fD.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);r=e,o=W.default.rootData}else{let u=pD.exec(e);if(!u)throw new Error(`Invalid JSON-pointer: ${e}`);let l=+u[1];if(r=u[2],r==="#"){if(l>=t)throw new Error(c("property/index",l));return i[t-l]}if(l>t)throw new Error(c("data",l));if(o=n[t-l],!r)return o}let a=o,s=r.split("/");for(let u of s)u&&(o=(0,L._)`${o}${(0,L.getProperty)((0,Jr.unescapeJsonPointer)(u))}`,a=(0,L._)`${a} && ${o}`);return a;function c(u,l){return`Cannot access ${u} ${l} levels up, current level is ${t}`}}xn.getData=$S});var Ef=N(ky=>{"use strict";Object.defineProperty(ky,"__esModule",{value:!0});var xy=class extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}};ky.default=xy});var nc=N(zy=>{"use strict";Object.defineProperty(zy,"__esModule",{value:!0});var Sy=Qs(),Iy=class extends Error{constructor(t,n,i,r){super(r||`can't resolve reference ${i} from id ${n}`),this.missingRef=(0,Sy.resolveUrl)(t,n,i),this.missingSchema=(0,Sy.normalizeId)((0,Sy.getFullPath)(t,this.missingRef))}};zy.default=Iy});var Af=N(er=>{"use strict";Object.defineProperty(er,"__esModule",{value:!0});er.resolveSchema=er.getCompilingSchema=er.resolveRef=er.compileSchema=er.SchemaEnv=void 0;var dr=ne(),mD=Ef(),ii=Br(),fr=Qs(),bS=pe(),hD=rc(),Lo=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,fr.normalizeId)(i?.[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=i?.$async,this.refs={}}};er.SchemaEnv=Lo;function Ty(e){let t=wS.call(this,e);if(t)return t;let n=(0,fr.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:i,lines:r}=this.opts.code,{ownProperties:o}=this.opts,a=new dr.CodeGen(this.scope,{es5:i,lines:r,ownProperties:o}),s;e.$async&&(s=a.scopeValue("Error",{ref:mD.default,code:(0,dr._)`require("ajv/dist/runtime/validation_error").default`}));let c=a.scopeName("validate");e.validateName=c;let u={gen:a,allErrors:this.opts.allErrors,data:ii.default.data,parentData:ii.default.parentData,parentDataProperty:ii.default.parentDataProperty,dataNames:[ii.default.data],dataPathArr:[dr.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:a.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,dr.stringify)(e.schema)}:{ref:e.schema}),validateName:c,ValidationError:s,schema:e.schema,schemaEnv:e,rootId:n,baseId:e.baseId||n,schemaPath:dr.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,dr._)`""`,opts:this.opts,self:this},l;try{this._compilations.add(e),(0,hD.validateFunctionCode)(u),a.optimize(this.opts.code.optimize);let d=a.toString();l=`${a.scopeRefs(ii.default.scope)}return ${d}`,this.opts.code.process&&(l=this.opts.code.process(l,e));let p=new Function(`${ii.default.self}`,`${ii.default.scope}`,l)(this,this.scope.get());if(this.scope.value(c,{ref:p}),p.errors=null,p.schema=e.schema,p.schemaEnv=e,e.$async&&(p.$async=!0),this.opts.code.source===!0&&(p.source={validateName:c,validateCode:d,scopeValues:a._values}),this.opts.unevaluated){let{props:m,items:h}=u;p.evaluated={props:m instanceof dr.Name?void 0:m,items:h instanceof dr.Name?void 0:h,dynamicProps:m instanceof dr.Name,dynamicItems:h instanceof dr.Name},p.source&&(p.source.evaluated=(0,dr.stringify)(p.evaluated))}return e.validate=p,e}catch(d){throw delete e.validate,delete e.validateName,l&&this.logger.error("Error compiling schema, function code:",l),d}finally{this._compilations.delete(e)}}er.compileSchema=Ty;function gD(e,t,n){var i;n=(0,fr.resolveUrl)(this.opts.uriResolver,t,n);let r=e.refs[n];if(r)return r;let o=_D.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 Lo({schema:a,schemaId:s,root:e,baseId:t}))}if(o!==void 0)return e.refs[n]=vD.call(this,o)}er.resolveRef=gD;function vD(e){return(0,fr.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:Ty.call(this,e)}function wS(e){for(let t of this._compilations)if(yD(t,e))return t}er.getCompilingSchema=wS;function yD(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function _D(e,t){let n;for(;typeof(n=this.refs[t])=="string";)t=n;return n||this.schemas[t]||Nf.call(this,e,t)}function Nf(e,t){let n=this.opts.uriResolver.parse(t),i=(0,fr._getFullPath)(this.opts.uriResolver,n),r=(0,fr.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&i===r)return Py.call(this,n,e);let o=(0,fr.normalizeId)(i),a=this.refs[o]||this.schemas[o];if(typeof a=="string"){let s=Nf.call(this,e,a);return typeof s?.schema!="object"?void 0:Py.call(this,n,s)}if(typeof a?.schema=="object"){if(a.validate||Ty.call(this,a),o===(0,fr.normalizeId)(t)){let{schema:s}=a,{schemaId:c}=this.opts,u=s[c];return u&&(r=(0,fr.resolveUrl)(this.opts.uriResolver,r,u)),new Lo({schema:s,schemaId:c,root:e,baseId:r})}return Py.call(this,n,a)}}er.resolveSchema=Nf;var $D=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Py(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,bS.unescapeFragment)(s)];if(c===void 0)return;n=c;let u=typeof n=="object"&&n[this.opts.schemaId];!$D.has(s)&&u&&(t=(0,fr.resolveUrl)(this.opts.uriResolver,t,u))}let o;if(typeof n!="boolean"&&n.$ref&&!(0,bS.schemaHasRulesButRef)(n,this.RULES)){let s=(0,fr.resolveUrl)(this.opts.uriResolver,t,n.$ref);o=Nf.call(this,i,s)}let{schemaId:a}=this.opts;if(o=o||new Lo({schema:n,schemaId:a,root:i,baseId:t}),o.schema!==o.root.schema)return o}});var xS=N((S5,bD)=>{bD.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 Dy=N((I5,jS)=>{"use strict";var wD=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),jy=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),xD=RegExp.prototype.test.bind(/^\d*$/u),oi=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),Ey=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),SS=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/]$/u),Ny=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/?]$/u),kD=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:]$/u),jt=new Array(256);{let e="0123456789ABCDEF";for(let t=0;t<256;t++)jt[t]="%"+e[t>>4]+e[t&15]}function ut(e){return e<2048?jt[192|e>>6]+jt[128|e&63]:e<65536?jt[224|e>>12]+jt[128|e>>6&63]+jt[128|e&63]:jt[240|e>>18]+jt[128|e>>12&63]+jt[128|e>>6&63]+jt[128|e&63]}function SD(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 ID=RegExp.prototype.test.bind(/^[\dA-Fa-f]{1,4}$/),zD=RegExp.prototype.test.bind(/^[vV][\dA-Fa-f]+\.[A-Za-z\d\-._~!$&'()*+,;=:]+$/),PD=RegExp.prototype.test.bind(/^[A-Za-z\d\-._~]$/),TD=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function OD(e){if(e.length===0)return!1;for(let t=0;t<e.length;t++)if(!PD(e[t])){if(e[t]==="%"&&t+2<e.length&&oi(e.slice(t+1,t+3))){t+=2;continue}return!1}return!0}function kS(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 jD(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||!jy(c))return;o+=2;continue}if(!ID(c))return;r[s]=parseInt(c,16).toString(16),o++}if(t===-1)return o!==8?void 0:kS(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 kS(a)}function Oy(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&&zD(i))return i=i.toLowerCase(),{host:`[${i}]`,escapedHost:i,isIPV6:!1,isIPVFuture:!0};if(ED(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),!OD(r))return{host:e,isIPV6:!1,error:!0};i=i.slice(0,o)}let a=jD(i);return a===void 0?{host:e,isIPV6:!1,error:!0}:{host:a+(r?"%"+r:""),escapedHost:a+(r?"%25"+r:""),isIPV6:!0}}function ED(e,t){let n=0;for(let i=0;i<e.length;i++)e[i]===t&&n++;return n}function IS(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 ND(e){if(e===""||e[0]==="/")return IS(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 AD={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},DD=/[@/?#:]/g,RD=/[@/?#]/g;function zS(e,t){let n=t?RD:DD;return n.lastIndex=0,e.replace(n,i=>AD[i])}function PS(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(oi(r)){let o=r.toUpperCase(),a=String.fromCharCode(parseInt(o,16));t&&Ey(a)?n+=a:n+="%"+o,i+=2;continue}}n+=e[i]}return n}function CD(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(oi(r)){let o=r.toUpperCase(),a=String.fromCharCode(parseInt(o,16));a!=="."&&Ey(a)?t+=a:t+="%"+o,n+=2;continue}}if(SS(i))t+=i;else{let r=e.charCodeAt(n);if(r<128)t+=OS(r)?i:jt[r];else if(r<55296||r>57343)t+=ut(r);else if(r<=56319&&n+1<e.length){let o=e.charCodeAt(n+1);o>=56320&&o<=57343?(t+=ut(65536+(r-55296<<10)+(o-56320)),n++):t+=ut(65533)}else t+=ut(65533)}}return t}function UD(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(oi(a)){n+="%"+a.toUpperCase(),r+=2;continue}}if(o==="/"&&(i=!1),SS(o)&&(o!==":"||!i))n+=o;else{let a=e.charCodeAt(r);if(a<128)n+=jt[a];else if(a<55296||a>57343)n+=ut(a);else if(a<=56319&&r+1<e.length){let s=e.charCodeAt(r+1);s>=56320&&s<=57343?(n+=ut(65536+(a-55296<<10)+(s-56320)),r++):n+=ut(65533)}else n+=ut(65533)}}return n}function Ay(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(oi(o)){n+="%"+o.toUpperCase(),i+=2;continue}}if(t(r))n+=r;else{let o=e.charCodeAt(i);if(o<128)n+=jt[o];else if(o<55296||o>57343)n+=ut(o);else if(o<=56319&&i+1<e.length){let a=e.charCodeAt(i+1);a>=56320&&a<=57343?(n+=ut(65536+(o-55296<<10)+(a-56320)),i++):n+=ut(65533)}else n+=ut(65533)}}return n}function TS(e){return Ay(e,kD)}function ZD(e){return Ay(e,Ny)}function MD(e){return Ay(e,Ny)}function OS(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 LD(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(oi(r)){let o=r.toUpperCase(),a=String.fromCharCode(parseInt(o,16));Ey(a)?t+=a:t+="%"+o,n+=2;continue}}if(Ny(i))t+=i;else{let r=e.charCodeAt(n);if(r<128)t+=OS(r)?i:jt[r];else if(r<55296||r>57343)t+=ut(r);else if(r<=56319&&n+1<e.length){let o=e.charCodeAt(n+1);o>=56320&&o<=57343?(t+=ut(65536+(r-55296<<10)+(o-56320)),n++):t+=ut(65533)}else t+=ut(65533)}}return t}function VD(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(oi(i)){t+="%"+i.toUpperCase(),n+=2;continue}}t+=escape(e[n])}return t}function FD(e){let t=[];if(e.userinfo!==void 0&&(t.push(TS(e.userinfo)),t.push("@")),e.host!==void 0){let n=e.host;if(!jy(n)){let i=Oy(n);i.isIPV6!==!0&&i.isIPVFuture!==!0&&(n=PS(n,!0),i=Oy(n)),i.isIPV6===!0||i.isIPVFuture===!0?n=`[${i.escapedHost}]`:n=zS(n,!1)}t.push(n)}if(typeof e.port=="number"||typeof e.port=="string"){let n=String(e.port);if(!xD(n))throw new TypeError("URI port is malformed.");t.push(":"),t.push(n)}return t.length?t.join(""):void 0}jS.exports={nonSimpleDomain:TD,recomposeAuthority:FD,reescapeHostDelimiters:zS,normalizePercentEncoding:PS,normalizePathEncoding:CD,serializePathEncoding:UD,normalizeQueryFragmentEncoding:LD,encodeUserinfo:TS,encodeQuery:ZD,encodeFragment:MD,escapePreservingEscapes:VD,removeDotSegments:IS,removeDotSegmentsRelative:ND,isIPv4:jy,isUUID:wD,normalizeIPv6:Oy,stringArrayToHexStripped:SD}});var RS=N((z5,DS)=>{"use strict";var{isUUID:qD}=Dy(),BD=/^([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-./:;=@]|%[\da-f]{2})+)$/iu,JD=["http","https","ws","wss","urn","urn:uuid"];function HD(e){return JD.indexOf(e)!==-1}function Ry(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 ES(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function NS(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 KD(e){return e.secure=Ry(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function GD(e){if((e.port===(Ry(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 WD(e,t){if(!e.path)return e.error="URN can not be parsed",e;let n=e.path.match(BD);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=Cy(r);e.path=void 0,o&&(e=o.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e}function XD(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=Cy(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 YD(e,t){let n=e;return n.uuid=n.nss,n.nss=void 0,!t.tolerant&&(!n.uuid||!qD(n.uuid))&&(n.error=n.error||"UUID is not valid."),n}function QD(e){let t=e;return t.nss=(e.uuid||"").toLowerCase(),t}var AS={scheme:"http",domainHost:!0,parse:ES,serialize:NS},eR={scheme:"https",domainHost:AS.domainHost,parse:ES,serialize:NS},Df={scheme:"ws",domainHost:!0,parse:KD,serialize:GD},tR={scheme:"wss",domainHost:Df.domainHost,parse:Df.parse,serialize:Df.serialize},rR={scheme:"urn",parse:WD,serialize:XD,skipNormalize:!0},nR={scheme:"urn:uuid",parse:YD,serialize:QD,skipNormalize:!0},Rf={http:AS,https:eR,ws:Df,wss:tR,urn:rR,"urn:uuid":nR};Object.setPrototypeOf(Rf,null);function Cy(e){return e&&(Rf[e]||Rf[e.toLowerCase()])||void 0}DS.exports={wsIsSecure:Ry,SCHEMES:Rf,isValidSchemeName:HD,getSchemeHandler:Cy}});var XS=N((P5,Lf)=>{"use strict";var{normalizeIPv6:LS,removeDotSegments:oc,removeDotSegmentsRelative:VS,recomposeAuthority:iR,normalizePercentEncoding:Uy,normalizePathEncoding:oR,serializePathEncoding:CS,normalizeQueryFragmentEncoding:US,encodeQuery:aR,encodeFragment:sR,reescapeHostDelimiters:cR,isIPv4:FS,nonSimpleDomain:uR}=Dy(),{SCHEMES:qS,getSchemeHandler:Zy}=RS(),BS=/^[A-Za-z][A-Za-z0-9+.-]*$/u,JS="URI scheme is malformed.",Cf="URI host is malformed.",lR=/[\0-\x20"#/:<>?@[\\\]^`{|}\x7F]/u;function ZS(e){let t=String(e);if(!BS.test(t))throw new TypeError(JS);return t}function dR(e,t){return typeof e=="string"?e=$R(e,t):typeof e=="object"&&(e=Zf(ai(e,t),t)),e}function fR(e,t,n){let i=n?Object.assign({scheme:"null"},n):{scheme:"null"},{parsed:r,malformedAuthorityOrPort:o,malformedPercentEncoding:a,malformedSchemeSpecific:s,malformedHost:c,malformedScheme:u}=Uf(e,i),{parsed:l,malformedAuthorityOrPort:d,malformedPercentEncoding:f,malformedSchemeSpecific:p,malformedHost:m,malformedScheme:h}=Uf(t,i);if(o||d||a||f||s||p||c||m||u||h)throw new Error(r.error||l.error||"URI is malformed.");let g=HS(r,l,i,!0),_=Zy(n&&n.scheme||g.scheme),$=g.host,k=$!==void 0&&$!==""&&(FS($)||LS($).isIPV6);if(GS(g,n||{},_,k))throw new Error(Cf);KS(g,n||{},_,k);let O=$&&$.indexOf("%")!==-1&&!new RegExp("\\P{ASCII}","u").test($);if(g.error&&!O)throw new Error(g.error);return i.skipEscape=!0,ai(g,i)}function HS(e,t,n,i){let r={};if(i||(e=Zf(ai(e,n),n),t=Zf(ai(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=oc(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=oc(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=oc(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]!=="/"?VS(r.path):oc(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 pR(e,t,n){let i=MS(e,n),r=MS(t,n);return i!==void 0&&r!==void 0&&i===r}function ai(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=ZS(n.scheme));let o=Zy(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=Uy(n.path):n.path=CS(n.path,c)),i.reference!=="suffix"&&n.scheme&&(n.scheme=ZS(n.scheme),r.push(n.scheme,":"));let u=iR(n);if(u!==void 0&&(i.reference!=="suffix"&&r.push("//"),r.push(u),n.path&&n.path[0]!=="/"&&r.push("/")),n.path!==void 0){let l=n.path;!i.absolutePath&&(!o||!o.absolutePath)&&(l=s&&l[0]!=="/"?VS(l):oc(l)),s&&(l=CS(l,!0)),u===void 0&&l[0]==="/"&&l[1]==="/"&&(l="/%2F"+l.slice(2)),r.push(l)}return n.query!==void 0&&r.push("?",aR(n.query)),n.fragment!==void 0&&r.push("#",sR(n.fragment)),r.join("")}var mR=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u,hR=/^(?:[^#/:?]+:)?\/\/([^/?#]*)/,gR=/^(?:[^#/:?]+:)?([/\\\t\n\r]*)/;function vR(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 ic(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 Mf(e){return e[0]==="["&&e[e.length-1]==="]"}function yR(e){let t=e[4];return ic(e[3])||t!==void 0&&!Mf(t)&&ic(t)||ic(e[6])||ic(e[7])||ic(e[8])}function KS(e,t,n,i){if(GS(e,t,n,i))return e.error=e.error||Cf,!0;if(!t.unicodeSupport&&(!n||!n.unicodeSupport)&&e.host&&!Mf(e.host)&&(t.domainHost||n&&n.domainHost)&&i===!1&&uR(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(!_R(r))return e.error=e.error||Cf,!0;e.host=r.hostname}return!1}function GS(e,t,n,i){return!!(e.host&&i===!1&&!Mf(e.host)&&(t.domainHost||n&&n.domainHost)&&lR.test(e.host))}function _R(e){return e.username===""&&e.password===""&&e.port===""&&e.pathname==="/"&&e.search===""&&e.hash===""&&e.hostname!==""}function Uf(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,u=!1,l=!1;n.reference==="suffix"&&(n.scheme?e=n.scheme+":"+e:e="//"+e);let d=e.match(hR);d!==null&&d[1].indexOf("\\")!==-1&&(i.error="URI authority must not contain a literal backslash.",r=!0);let f=e.match(gR);if(f!==null){let m=f[1],h=m.replace(/[\t\n\r]/g,"");h.length>=2&&(h.slice(0,2)!=="//"?(i.error=i.error||"URI authority must not contain a literal backslash.",r=!0):m.length!==h.length&&(i.error=i.error||"URI authority introducer must not contain whitespace.",r=!0))}let p=e.match(mR);if(p){i.scheme=p[1],i.userinfo=p[3],i.host=p[4],i.port=parseInt(p[5],10),i.path=p[6]||"",i.query=p[7],i.fragment=p[8],i.scheme!==void 0&&(BS.test(i.scheme)?i.scheme=i.scheme.toLowerCase():(i.error=i.error||JS,u=!0)),o=yR(p),o&&(i.error=i.error||"URI contains malformed percent-encoding."),isNaN(i.port)&&(i.port=p[5]);let m=vR(i,p);if(m!==void 0&&(i.error=i.error||m,r=!0),i.host)if(FS(i.host)===!1){let _=Mf(i.host),$=i.host.indexOf("[")!==-1||i.host.indexOf("]")!==-1,k=LS(i.host);l=k.isIPV6||k.isIPVFuture===!0,c=$&&(!_||k.error===!0),i.host=l?k.host:k.host.toLowerCase(),c&&(i.error=i.error||Cf,r=!0)}else l=!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 h=Zy(n.scheme||i.scheme);if(c||(s=KS(i,n,h,l)),e.indexOf("%")!==-1&&i.host!==void 0&&!c){let g=l?i.host:Uy(i.host,!0);l||(g=Uy(g.toLowerCase())),i.host=l||n.scheme!=="null"?cR(g,l):g}(!h||h&&!h.skipNormalize)&&(i.path&&(i.path=oR(i.path)),i.query&&(i.query=US(i.query)),i.fragment&&(i.fragment=US(i.fragment))),h&&h.parse&&(h.parse(i,n),h===qS.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:u}}function Zf(e,t){return Uf(e,t).parsed}function $R(e,t){return WS(e,t).normalized}function WS(e,t){let{parsed:n,malformedAuthorityOrPort:i,malformedPercentEncoding:r,malformedSchemeSpecific:o,malformedHost:a,malformedScheme:s}=Uf(e,t);return{normalized:i||r||o||a||s?e:ai(n,t),malformedAuthorityOrPort:i,malformedPercentEncoding:r,malformedSchemeSpecific:o,malformedHost:a,malformedScheme:s}}function MS(e,t){if(typeof e!="string"&&typeof e!="object")return;let n;try{n=typeof e=="string"?e:ai(e,t)}catch{return}let{normalized:i,malformedAuthorityOrPort:r,malformedPercentEncoding:o,malformedSchemeSpecific:a,malformedHost:s,malformedScheme:c}=WS(n,t);return r||o||a||s||c?void 0:i}var My={SCHEMES:qS,normalize:dR,resolve:fR,resolveComponent:HS,equal:pR,serialize:ai,parse:Zf};Lf.exports=My;Lf.exports.default=My;Lf.exports.fastUri=My});var QS=N(Ly=>{"use strict";Object.defineProperty(Ly,"__esModule",{value:!0});var YS=XS();YS.code='require("ajv/dist/runtime/uri").default';Ly.default=YS});var sI=N(tt=>{"use strict";Object.defineProperty(tt,"__esModule",{value:!0});tt.CodeGen=tt.Name=tt.nil=tt.stringify=tt.str=tt._=tt.KeywordCxt=void 0;var bR=rc();Object.defineProperty(tt,"KeywordCxt",{enumerable:!0,get:function(){return bR.KeywordCxt}});var Vo=ne();Object.defineProperty(tt,"_",{enumerable:!0,get:function(){return Vo._}});Object.defineProperty(tt,"str",{enumerable:!0,get:function(){return Vo.str}});Object.defineProperty(tt,"stringify",{enumerable:!0,get:function(){return Vo.stringify}});Object.defineProperty(tt,"nil",{enumerable:!0,get:function(){return Vo.nil}});Object.defineProperty(tt,"Name",{enumerable:!0,get:function(){return Vo.Name}});Object.defineProperty(tt,"CodeGen",{enumerable:!0,get:function(){return Vo.CodeGen}});var wR=Ef(),iI=nc(),xR=ly(),ac=Af(),kR=ne(),sc=Qs(),Vf=Ys(),Fy=pe(),eI=xS(),SR=QS(),oI=(e,t)=>new RegExp(e,t);oI.code="new RegExp";var IR=["removeAdditional","useDefaults","coerceTypes"],zR=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),PR={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."},TR={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},tI=200;function OR(e){var t,n,i,r,o,a,s,c,u,l,d,f,p,m,h,g,_,$,k,O,T,C,H,Y,G;let Pe=e.strict,Oe=(t=e.code)===null||t===void 0?void 0:t.optimize,Ze=Oe===!0||Oe===void 0?1:Oe||0,Dt=(i=(n=e.code)===null||n===void 0?void 0:n.regExp)!==null&&i!==void 0?i:oI,dt=(r=e.uriResolver)!==null&&r!==void 0?r:SR.default;return{strictSchema:(a=(o=e.strictSchema)!==null&&o!==void 0?o:Pe)!==null&&a!==void 0?a:!0,strictNumbers:(c=(s=e.strictNumbers)!==null&&s!==void 0?s:Pe)!==null&&c!==void 0?c:!0,strictTypes:(l=(u=e.strictTypes)!==null&&u!==void 0?u:Pe)!==null&&l!==void 0?l:"log",strictTuples:(f=(d=e.strictTuples)!==null&&d!==void 0?d:Pe)!==null&&f!==void 0?f:"log",strictRequired:(m=(p=e.strictRequired)!==null&&p!==void 0?p:Pe)!==null&&m!==void 0?m:!1,code:e.code?{...e.code,optimize:Ze,regExp:Dt}:{optimize:Ze,regExp:Dt},loopRequired:(h=e.loopRequired)!==null&&h!==void 0?h:tI,loopEnum:(g=e.loopEnum)!==null&&g!==void 0?g:tI,meta:(_=e.meta)!==null&&_!==void 0?_:!0,messages:($=e.messages)!==null&&$!==void 0?$:!0,inlineRefs:(k=e.inlineRefs)!==null&&k!==void 0?k:!0,schemaId:(O=e.schemaId)!==null&&O!==void 0?O:"$id",addUsedSchema:(T=e.addUsedSchema)!==null&&T!==void 0?T:!0,validateSchema:(C=e.validateSchema)!==null&&C!==void 0?C:!0,validateFormats:(H=e.validateFormats)!==null&&H!==void 0?H:!0,unicodeRegExp:(Y=e.unicodeRegExp)!==null&&Y!==void 0?Y:!0,int32range:(G=e.int32range)!==null&&G!==void 0?G:!0,uriResolver:dt}}var cc=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,...OR(t)};let{es5:n,lines:i}=this.opts.code;this.scope=new kR.ValueScope({scope:{},prefixes:zR,es5:n,lines:i}),this.logger=RR(t.logger);let r=t.validateFormats;t.validateFormats=!1,this.RULES=(0,xR.getRules)(),rI.call(this,PR,t,"NOT SUPPORTED"),rI.call(this,TR,t,"DEPRECATED","warn"),this._metaOpts=AR.call(this),t.formats&&ER.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),t.keywords&&NR.call(this,t.keywords),typeof t.meta=="object"&&this.addMetaSchema(t.meta),jR.call(this),t.validateFormats=r}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:t,meta:n,schemaId:i}=this.opts,r=eI;i==="id"&&(r={...eI},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(l,d){await o.call(this,l.$schema);let f=this._addSchema(l,d);return f.validate||a.call(this,f)}async function o(l){l&&!this.getSchema(l)&&await r.call(this,{$ref:l},!0)}async function a(l){try{return this._compileSchemaEnv(l)}catch(d){if(!(d instanceof iI.default))throw d;return s.call(this,d),await c.call(this,d.missingSchema),a.call(this,l)}}function s({missingSchema:l,missingRef:d}){if(this.refs[l])throw new Error(`AnySchema ${l} is loaded but ${d} cannot be resolved`)}async function c(l){let d=await u.call(this,l);this.refs[l]||await o.call(this,d.$schema),this.refs[l]||this.addSchema(d,l,n)}async function u(l){let d=this._loading[l];if(d)return d;try{return await(this._loading[l]=i(l))}finally{delete this._loading[l]}}}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,sc.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=nI.call(this,t))=="string";)t=n;if(n===void 0){let{schemaId:i}=this.opts,r=new ac.SchemaEnv({schema:{},schemaId:i});if(n=ac.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=nI.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,sc.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(UR.call(this,i,n),!n)return(0,Fy.eachItem)(i,o=>Vy.call(this,o)),this;MR.call(this,n);let r={...n,type:(0,Vf.getJSONTypes)(n.type),schemaType:(0,Vf.getJSONTypes)(n.schemaType)};return(0,Fy.eachItem)(i,r.type.length===0?o=>Vy.call(this,o,r):o=>r.type.forEach(a=>Vy.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:u}=c.definition,l=a[s];u&&l&&(a[s]=aI(l))}}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,sc.normalizeId)(a||i);let u=sc.getSchemaRefs.call(this,t,i);return c=new ac.SchemaEnv({schema:t,schemaId:s,meta:n,baseId:i,localRefs:u}),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):ac.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{ac.compileSchema.call(this,t)}finally{this.opts=n}}};cc.ValidationError=wR.default;cc.MissingRefError=iI.default;tt.default=cc;function rI(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 nI(e){return e=(0,sc.normalizeId)(e),this.schemas[e]||this.refs[e]}function jR(){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 ER(){for(let e in this.opts.formats){let t=this.opts.formats[e];t&&this.addFormat(e,t)}}function NR(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 AR(){let e={...this.opts};for(let t of IR)delete e[t];return e}var DR={log(){},warn(){},error(){}};function RR(e){if(e===!1)return DR;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 CR=/^[a-z_$][a-z0-9_$:-]*$/i;function UR(e,t){let{RULES:n}=this;if((0,Fy.eachItem)(e,i=>{if(n.keywords[i])throw new Error(`Keyword ${i} is already defined`);if(!CR.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 Vy(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,Vf.getJSONTypes)(t.type),schemaType:(0,Vf.getJSONTypes)(t.schemaType)}};t.before?ZR.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 ZR(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 MR(e){let{metaSchema:t}=e;t!==void 0&&(e.$data&&this.opts.$data&&(t=aI(t)),e.validateSchema=this.compile(t,!0))}var LR={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function aI(e){return{anyOf:[e,LR]}}});var cI=N(qy=>{"use strict";Object.defineProperty(qy,"__esModule",{value:!0});var VR={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};qy.default=VR});var fI=N(si=>{"use strict";Object.defineProperty(si,"__esModule",{value:!0});si.callRef=si.getValidate=void 0;var FR=nc(),uI=Qt(),Et=ne(),Fo=Br(),lI=Af(),Ff=pe(),qR={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:u}=o;if((n==="#"||n==="#/")&&r===u.baseId)return d();let l=lI.resolveRef.call(c,u,r,n);if(l===void 0)throw new FR.default(i.opts.uriResolver,r,n);if(l instanceof lI.SchemaEnv)return f(l);return p(l);function d(){if(o===u)return qf(e,a,o,o.$async);let m=t.scopeValue("root",{ref:u});return qf(e,(0,Et._)`${m}.validate`,u,u.$async)}function f(m){let h=dI(e,m);qf(e,h,m,m.$async)}function p(m){let h=t.scopeValue("schema",s.code.source===!0?{ref:m,code:(0,Et.stringify)(m)}:{ref:m}),g=t.name("valid"),_=e.subschema({schema:m,dataTypes:[],schemaPath:Et.nil,topSchemaRef:h,errSchemaPath:n},g);e.mergeEvaluated(_),e.ok(g)}}};function dI(e,t){let{gen:n}=e;return t.validate?n.scopeValue("validate",{ref:t.validate}):(0,Et._)`${n.scopeValue("wrapper",{ref:t})}.validate`}si.getValidate=dI;function qf(e,t,n,i){let{gen:r,it:o}=e,{allErrors:a,schemaEnv:s,opts:c}=o,u=c.passContext?Fo.default.this:Et.nil;i?l():d();function l(){if(!s.$async)throw new Error("async schema referenced by sync schema");let m=r.let("valid");r.try(()=>{r.code((0,Et._)`await ${(0,uI.callValidateCode)(e,t,u)}`),p(t),a||r.assign(m,!0)},h=>{r.if((0,Et._)`!(${h} instanceof ${o.ValidationError})`,()=>r.throw(h)),f(h),a||r.assign(m,!1)}),e.ok(m)}function d(){e.result((0,uI.callValidateCode)(e,t,u),()=>p(t),()=>f(t))}function f(m){let h=(0,Et._)`${m}.errors`;r.assign(Fo.default.vErrors,(0,Et._)`${Fo.default.vErrors} === null ? ${h} : ${Fo.default.vErrors}.concat(${h})`),r.assign(Fo.default.errors,(0,Et._)`${Fo.default.vErrors}.length`)}function p(m){var h;if(!o.opts.unevaluated)return;let g=(h=n?.validate)===null||h===void 0?void 0:h.evaluated;if(o.props!==!0)if(g&&!g.dynamicProps)g.props!==void 0&&(o.props=Ff.mergeEvaluated.props(r,g.props,o.props));else{let _=r.var("props",(0,Et._)`${m}.evaluated.props`);o.props=Ff.mergeEvaluated.props(r,_,o.props,Et.Name)}if(o.items!==!0)if(g&&!g.dynamicItems)g.items!==void 0&&(o.items=Ff.mergeEvaluated.items(r,g.items,o.items));else{let _=r.var("items",(0,Et._)`${m}.evaluated.items`);o.items=Ff.mergeEvaluated.items(r,_,o.items,Et.Name)}}}si.callRef=qf;si.default=qR});var pI=N(By=>{"use strict";Object.defineProperty(By,"__esModule",{value:!0});var BR=cI(),JR=fI(),HR=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",BR.default,JR.default];By.default=HR});var mI=N(Jy=>{"use strict";Object.defineProperty(Jy,"__esModule",{value:!0});var Bf=ne(),kn=Bf.operators,Jf={maximum:{okStr:"<=",ok:kn.LTE,fail:kn.GT},minimum:{okStr:">=",ok:kn.GTE,fail:kn.LT},exclusiveMaximum:{okStr:"<",ok:kn.LT,fail:kn.GTE},exclusiveMinimum:{okStr:">",ok:kn.GT,fail:kn.LTE}},KR={message:({keyword:e,schemaCode:t})=>(0,Bf.str)`must be ${Jf[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,Bf._)`{comparison: ${Jf[e].okStr}, limit: ${t}}`},GR={keyword:Object.keys(Jf),type:"number",schemaType:"number",$data:!0,error:KR,code(e){let{keyword:t,data:n,schemaCode:i}=e;e.fail$data((0,Bf._)`${n} ${Jf[t].fail} ${i} || isNaN(${n})`)}};Jy.default=GR});var hI=N(Hy=>{"use strict";Object.defineProperty(Hy,"__esModule",{value:!0});var uc=ne(),WR={message:({schemaCode:e})=>(0,uc.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,uc._)`{multipleOf: ${e}}`},XR={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:WR,code(e){let{gen:t,data:n,schemaCode:i,it:r}=e,o=r.opts.multipleOfPrecision,a=t.let("res"),s=o?(0,uc._)`Math.abs(Math.round(${a}) - ${a}) > 1e-${o}`:(0,uc._)`${a} !== parseInt(${a})`;e.fail$data((0,uc._)`(${i} === 0 || (${a} = ${n}/${i}, ${s}))`)}};Hy.default=XR});var vI=N(Ky=>{"use strict";Object.defineProperty(Ky,"__esModule",{value:!0});function gI(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}Ky.default=gI;gI.code='require("ajv/dist/runtime/ucs2length").default'});var yI=N(Gy=>{"use strict";Object.defineProperty(Gy,"__esModule",{value:!0});var ci=ne(),YR=pe(),QR=vI(),eC={message({keyword:e,schemaCode:t}){let n=e==="maxLength"?"more":"fewer";return(0,ci.str)`must NOT have ${n} than ${t} characters`},params:({schemaCode:e})=>(0,ci._)`{limit: ${e}}`},tC={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:eC,code(e){let{keyword:t,data:n,schemaCode:i,it:r}=e,o=t==="maxLength"?ci.operators.GT:ci.operators.LT,a=r.opts.unicode===!1?(0,ci._)`${n}.length`:(0,ci._)`${(0,YR.useFunc)(e.gen,QR.default)}(${n})`;e.fail$data((0,ci._)`${a} ${o} ${i}`)}};Gy.default=tC});var _I=N(Wy=>{"use strict";Object.defineProperty(Wy,"__esModule",{value:!0});var rC=Qt(),nC=pe(),qo=ne(),iC={message:({schemaCode:e})=>(0,qo.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,qo._)`{pattern: ${e}}`},oC={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:iC,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,u=c.code==="new RegExp"?(0,qo._)`new RegExp`:(0,nC.useFunc)(t,c),l=t.let("valid");t.try(()=>t.assign(l,(0,qo._)`${u}(${o}, ${s}).test(${n})`),()=>t.assign(l,!1)),e.fail$data((0,qo._)`!${l}`)}else{let c=(0,rC.usePattern)(e,r);e.fail$data((0,qo._)`!${c}.test(${n})`)}}};Wy.default=oC});var $I=N(Xy=>{"use strict";Object.defineProperty(Xy,"__esModule",{value:!0});var lc=ne(),aC={message({keyword:e,schemaCode:t}){let n=e==="maxProperties"?"more":"fewer";return(0,lc.str)`must NOT have ${n} than ${t} properties`},params:({schemaCode:e})=>(0,lc._)`{limit: ${e}}`},sC={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:aC,code(e){let{keyword:t,data:n,schemaCode:i}=e,r=t==="maxProperties"?lc.operators.GT:lc.operators.LT;e.fail$data((0,lc._)`Object.keys(${n}).length ${r} ${i}`)}};Xy.default=sC});var bI=N(Yy=>{"use strict";Object.defineProperty(Yy,"__esModule",{value:!0});var dc=Qt(),fc=ne(),cC=pe(),uC={message:({params:{missingProperty:e}})=>(0,fc.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,fc._)`{missingProperty: ${e}}`},lC={keyword:"required",type:"object",schemaType:"array",$data:!0,error:uC,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?u():l(),s.strictRequired){let p=e.parentSchema.properties,{definedProperties:m}=e.it;for(let h of n)if(p?.[h]===void 0&&!m.has(h)){let g=a.schemaEnv.baseId+a.errSchemaPath,_=`required property "${h}" is not defined at "${g}" (strictRequired)`;(0,cC.checkStrictMode)(a,_,a.opts.strictRequired)}}function u(){if(c||o)e.block$data(fc.nil,d);else for(let p of n)(0,dc.checkReportMissingProp)(e,p)}function l(){let p=t.let("missing");if(c||o){let m=t.let("valid",!0);e.block$data(m,()=>f(p,m)),e.ok(m)}else t.if((0,dc.checkMissingProp)(e,n,p)),(0,dc.reportMissingProp)(e,p),t.else()}function d(){t.forOf("prop",i,p=>{e.setParams({missingProperty:p}),t.if((0,dc.noPropertyInData)(t,r,p,s.ownProperties),()=>e.error())})}function f(p,m){e.setParams({missingProperty:p}),t.forOf(p,i,()=>{t.assign(m,(0,dc.propertyInData)(t,r,p,s.ownProperties)),t.if((0,fc.not)(m),()=>{e.error(),t.break()})},fc.nil)}}};Yy.default=lC});var wI=N(Qy=>{"use strict";Object.defineProperty(Qy,"__esModule",{value:!0});var pc=ne(),dC={message({keyword:e,schemaCode:t}){let n=e==="maxItems"?"more":"fewer";return(0,pc.str)`must NOT have ${n} than ${t} items`},params:({schemaCode:e})=>(0,pc._)`{limit: ${e}}`},fC={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:dC,code(e){let{keyword:t,data:n,schemaCode:i}=e,r=t==="maxItems"?pc.operators.GT:pc.operators.LT;e.fail$data((0,pc._)`${n}.length ${r} ${i}`)}};Qy.default=fC});var Hf=N(e_=>{"use strict";Object.defineProperty(e_,"__esModule",{value:!0});var xI=yy();xI.code='require("ajv/dist/runtime/equal").default';e_.default=xI});var kI=N(r_=>{"use strict";Object.defineProperty(r_,"__esModule",{value:!0});var t_=Ys(),rt=ne(),pC=pe(),mC=Hf(),hC={message:({params:{i:e,j:t}})=>(0,rt.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,rt._)`{i: ${e}, j: ${t}}`},gC={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:hC,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"),u=o.items?(0,t_.getSchemaTypes)(o.items):[];e.block$data(c,l,(0,rt._)`${a} === false`),e.ok(c);function l(){let m=t.let("i",(0,rt._)`${n}.length`),h=t.let("j");e.setParams({i:m,j:h}),t.assign(c,!0),t.if((0,rt._)`${m} > 1`,()=>(d()?f:p)(m,h))}function d(){return u.length>0&&!u.some(m=>m==="object"||m==="array")}function f(m,h){let g=t.name("item"),_=(0,t_.checkDataTypes)(u,g,s.opts.strictNumbers,t_.DataType.Wrong),$=t.const("indices",(0,rt._)`{}`);t.for((0,rt._)`;${m}--;`,()=>{t.let(g,(0,rt._)`${n}[${m}]`),t.if(_,(0,rt._)`continue`),u.length>1&&t.if((0,rt._)`typeof ${g} == "string"`,(0,rt._)`${g} += "_"`),t.if((0,rt._)`typeof ${$}[${g}] == "number"`,()=>{t.assign(h,(0,rt._)`${$}[${g}]`),e.error(),t.assign(c,!1).break()}).code((0,rt._)`${$}[${g}] = ${m}`)})}function p(m,h){let g=(0,pC.useFunc)(t,mC.default),_=t.name("outer");t.label(_).for((0,rt._)`;${m}--;`,()=>t.for((0,rt._)`${h} = ${m}; ${h}--;`,()=>t.if((0,rt._)`${g}(${n}[${m}], ${n}[${h}])`,()=>{e.error(),t.assign(c,!1).break(_)})))}}};r_.default=gC});var SI=N(i_=>{"use strict";Object.defineProperty(i_,"__esModule",{value:!0});var n_=ne(),vC=pe(),yC=Hf(),_C={message:"must be equal to constant",params:({schemaCode:e})=>(0,n_._)`{allowedValue: ${e}}`},$C={keyword:"const",$data:!0,error:_C,code(e){let{gen:t,data:n,$data:i,schemaCode:r,schema:o}=e;i||o&&typeof o=="object"?e.fail$data((0,n_._)`!${(0,vC.useFunc)(t,yC.default)}(${n}, ${r})`):e.fail((0,n_._)`${o} !== ${n}`)}};i_.default=$C});var II=N(o_=>{"use strict";Object.defineProperty(o_,"__esModule",{value:!0});var mc=ne(),bC=pe(),wC=Hf(),xC={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,mc._)`{allowedValues: ${e}}`},kC={keyword:"enum",schemaType:"array",$data:!0,error:xC,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,u=()=>c??(c=(0,bC.useFunc)(t,wC.default)),l;if(s||i)l=t.let("valid"),e.block$data(l,d);else{if(!Array.isArray(r))throw new Error("ajv implementation error");let p=t.const("vSchema",o);l=(0,mc.or)(...r.map((m,h)=>f(p,h)))}e.pass(l);function d(){t.assign(l,!1),t.forOf("v",o,p=>t.if((0,mc._)`${u()}(${n}, ${p})`,()=>t.assign(l,!0).break()))}function f(p,m){let h=r[m];return typeof h=="object"&&h!==null?(0,mc._)`${u()}(${n}, ${p}[${m}])`:(0,mc._)`${n} === ${h}`}}};o_.default=kC});var zI=N(a_=>{"use strict";Object.defineProperty(a_,"__esModule",{value:!0});var SC=mI(),IC=hI(),zC=yI(),PC=_I(),TC=$I(),OC=bI(),jC=wI(),EC=kI(),NC=SI(),AC=II(),DC=[SC.default,IC.default,zC.default,PC.default,TC.default,OC.default,jC.default,EC.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},NC.default,AC.default];a_.default=DC});var c_=N(hc=>{"use strict";Object.defineProperty(hc,"__esModule",{value:!0});hc.validateAdditionalItems=void 0;var ui=ne(),s_=pe(),RC={message:({params:{len:e}})=>(0,ui.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,ui._)`{limit: ${e}}`},CC={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:RC,code(e){let{parentSchema:t,it:n}=e,{items:i}=t;if(!Array.isArray(i)){(0,s_.checkStrictMode)(n,'"additionalItems" is ignored when "items" is not an array of schemas');return}PI(e,i)}};function PI(e,t){let{gen:n,schema:i,data:r,keyword:o,it:a}=e;a.items=!0;let s=n.const("len",(0,ui._)`${r}.length`);if(i===!1)e.setParams({len:t.length}),e.pass((0,ui._)`${s} <= ${t.length}`);else if(typeof i=="object"&&!(0,s_.alwaysValidSchema)(a,i)){let u=n.var("valid",(0,ui._)`${s} <= ${t.length}`);n.if((0,ui.not)(u),()=>c(u)),e.ok(u)}function c(u){n.forRange("i",t.length,s,l=>{e.subschema({keyword:o,dataProp:l,dataPropType:s_.Type.Num},u),a.allErrors||n.if((0,ui.not)(u),()=>n.break())})}}hc.validateAdditionalItems=PI;hc.default=CC});var u_=N(gc=>{"use strict";Object.defineProperty(gc,"__esModule",{value:!0});gc.validateTuple=void 0;var TI=ne(),Kf=pe(),UC=Qt(),ZC={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:n}=e;if(Array.isArray(t))return OI(e,"additionalItems",t);n.items=!0,!(0,Kf.alwaysValidSchema)(n,t)&&e.ok((0,UC.validateArray)(e))}};function OI(e,t,n=e.schema){let{gen:i,parentSchema:r,data:o,keyword:a,it:s}=e;l(r),s.opts.unevaluated&&n.length&&s.items!==!0&&(s.items=Kf.mergeEvaluated.items(i,n.length,s.items));let c=i.name("valid"),u=i.const("len",(0,TI._)`${o}.length`);n.forEach((d,f)=>{(0,Kf.alwaysValidSchema)(s,d)||(i.if((0,TI._)`${u} > ${f}`,()=>e.subschema({keyword:a,schemaProp:f,dataProp:f},c)),e.ok(c))});function l(d){let{opts:f,errSchemaPath:p}=s,m=n.length,h=m===d.minItems&&(m===d.maxItems||d[t]===!1);if(f.strictTuples&&!h){let g=`"${a}" is ${m}-tuple, but minItems or maxItems/${t} are not specified or different at path "${p}"`;(0,Kf.checkStrictMode)(s,g,f.strictTuples)}}}gc.validateTuple=OI;gc.default=ZC});var jI=N(l_=>{"use strict";Object.defineProperty(l_,"__esModule",{value:!0});var MC=u_(),LC={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,MC.validateTuple)(e,"items")};l_.default=LC});var NI=N(d_=>{"use strict";Object.defineProperty(d_,"__esModule",{value:!0});var EI=ne(),VC=pe(),FC=Qt(),qC=c_(),BC={message:({params:{len:e}})=>(0,EI.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,EI._)`{limit: ${e}}`},JC={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:BC,code(e){let{schema:t,parentSchema:n,it:i}=e,{prefixItems:r}=n;i.items=!0,!(0,VC.alwaysValidSchema)(i,t)&&(r?(0,qC.validateAdditionalItems)(e,r):e.ok((0,FC.validateArray)(e)))}};d_.default=JC});var AI=N(f_=>{"use strict";Object.defineProperty(f_,"__esModule",{value:!0});var tr=ne(),Gf=pe(),HC={message:({params:{min:e,max:t}})=>t===void 0?(0,tr.str)`must contain at least ${e} valid item(s)`:(0,tr.str)`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?(0,tr._)`{minContains: ${e}}`:(0,tr._)`{minContains: ${e}, maxContains: ${t}}`},KC={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:HC,code(e){let{gen:t,schema:n,parentSchema:i,data:r,it:o}=e,a,s,{minContains:c,maxContains:u}=i;o.opts.next?(a=c===void 0?1:c,s=u):a=1;let l=t.const("len",(0,tr._)`${r}.length`);if(e.setParams({min:a,max:s}),s===void 0&&a===0){(0,Gf.checkStrictMode)(o,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(s!==void 0&&a>s){(0,Gf.checkStrictMode)(o,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,Gf.alwaysValidSchema)(o,n)){let h=(0,tr._)`${l} >= ${a}`;s!==void 0&&(h=(0,tr._)`${h} && ${l} <= ${s}`),e.pass(h);return}o.items=!0;let d=t.name("valid");s===void 0&&a===1?p(d,()=>t.if(d,()=>t.break())):a===0?(t.let(d,!0),s!==void 0&&t.if((0,tr._)`${r}.length > 0`,f)):(t.let(d,!1),f()),e.result(d,()=>e.reset());function f(){let h=t.name("_valid"),g=t.let("count",0);p(h,()=>t.if(h,()=>m(g)))}function p(h,g){t.forRange("i",0,l,_=>{e.subschema({keyword:"contains",dataProp:_,dataPropType:Gf.Type.Num,compositeRule:!0},h),g()})}function m(h){t.code((0,tr._)`${h}++`),s===void 0?t.if((0,tr._)`${h} >= ${a}`,()=>t.assign(d,!0).break()):(t.if((0,tr._)`${h} > ${s}`,()=>t.assign(d,!1).break()),a===1?t.assign(d,!0):t.if((0,tr._)`${h} >= ${a}`,()=>t.assign(d,!0)))}}};f_.default=KC});var CI=N(zr=>{"use strict";Object.defineProperty(zr,"__esModule",{value:!0});zr.validateSchemaDeps=zr.validatePropertyDeps=zr.error=void 0;var p_=ne(),GC=pe(),vc=Qt();zr.error={message:({params:{property:e,depsCount:t,deps:n}})=>{let i=t===1?"property":"properties";return(0,p_.str)`must have ${i} ${n} when property ${e} is present`},params:({params:{property:e,depsCount:t,deps:n,missingProperty:i}})=>(0,p_._)`{property: ${e},
|
|
8
8
|
missingProperty: ${i},
|
|
9
9
|
depsCount: ${t},
|
|
10
|
-
deps: ${n}}`};var WC={keyword:"dependencies",type:"object",schemaType:"object",error:zr.error,code(e){let[t,n]=XC(e);DI(e,t),RI(e,n)}};function XC({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 DI(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,vc.propertyInData)(n,i,a,r.opts.ownProperties);e.setParams({property:a,depsCount:s.length,deps:s.join(", ")}),r.allErrors?n.if(c,()=>{for(let u of s)(0,vc.checkReportMissingProp)(e,u)}):(n.if((0,p_._)`${c} && (${(0,vc.checkMissingProp)(e,s,o)})`),(0,vc.reportMissingProp)(e,o),n.else())}}zr.validatePropertyDeps=DI;function RI(e,t=e.schema){let{gen:n,data:i,keyword:r,it:o}=e,a=n.name("valid");for(let s in t)(0,GC.alwaysValidSchema)(o,t[s])||(n.if((0,vc.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))}zr.validateSchemaDeps=RI;zr.default=WC});var ZI=N(m_=>{"use strict";Object.defineProperty(m_,"__esModule",{value:!0});var UI=ne(),YC=pe(),QC={message:"property name must be valid",params:({params:e})=>(0,UI._)`{propertyName: ${e.propertyName}}`},e6={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:QC,code(e){let{gen:t,schema:n,data:i,it:r}=e;if((0,YC.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,UI.not)(o),()=>{e.error(!0),r.allErrors||t.break()})}),e.ok(o)}};m_.default=e6});var g_=N(h_=>{"use strict";Object.defineProperty(h_,"__esModule",{value:!0});var Wf=Qt(),pr=ne(),t6=Br(),Xf=pe(),r6={message:"must NOT have additional properties",params:({params:e})=>(0,pr._)`{additionalProperty: ${e.additionalProperty}}`},n6={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:r6,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,Xf.alwaysValidSchema)(a,n))return;let u=(0,Wf.allSchemaProperties)(i.properties),l=(0,Wf.allSchemaProperties)(i.patternProperties);d(),e.ok((0,pr._)`${o} === ${t6.default.errors}`);function d(){t.forIn("key",r,g=>{!u.length&&!l.length?m(g):t.if(f(g),()=>m(g))})}function f(g){let _;if(u.length>8){let $=(0,Xf.schemaRefOrVal)(a,i.properties,"properties");_=(0,Wf.isOwnProperty)(t,$,g)}else u.length?_=(0,pr.or)(...u.map($=>(0,pr._)`${g} === ${$}`)):_=pr.nil;return l.length&&(_=(0,pr.or)(_,...l.map($=>(0,pr._)`${(0,Wf.usePattern)(e,$)}.test(${g})`))),(0,pr.not)(_)}function p(g){t.code((0,pr._)`delete ${r}[${g}]`)}function m(g){if(c.removeAdditional==="all"||c.removeAdditional&&n===!1){p(g);return}if(n===!1){e.setParams({additionalProperty:g}),e.error(),s||t.break();return}if(typeof n=="object"&&!(0,Xf.alwaysValidSchema)(a,n)){let _=t.name("valid");c.removeAdditional==="failing"?(h(g,_,!1),t.if((0,pr.not)(_),()=>{e.reset(),p(g)})):(h(g,_),s||t.if((0,pr.not)(_),()=>t.break()))}}function h(g,_,$){let k={keyword:"additionalProperties",dataProp:g,dataPropType:Xf.Type.Str};$===!1&&Object.assign(k,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(k,_)}}};h_.default=n6});var VI=N(y_=>{"use strict";Object.defineProperty(y_,"__esModule",{value:!0});var i6=rc(),MI=Qt(),v_=pe(),LI=g_(),o6={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&&LI.default.code(new i6.KeywordCxt(o,LI.default,"additionalProperties"));let a=(0,MI.allSchemaProperties)(n);for(let d of a)o.definedProperties.add(d);o.opts.unevaluated&&a.length&&o.props!==!0&&(o.props=v_.mergeEvaluated.props(t,(0,v_.toHash)(a),o.props));let s=a.filter(d=>!(0,v_.alwaysValidSchema)(o,n[d]));if(s.length===0)return;let c=t.name("valid");for(let d of s)u(d)?l(d):(t.if((0,MI.propertyInData)(t,r,d,o.opts.ownProperties)),l(d),o.allErrors||t.else().var(c,!0),t.endIf()),e.it.definedProperties.add(d),e.ok(c);function u(d){return o.opts.useDefaults&&!o.compositeRule&&n[d].default!==void 0}function l(d){e.subschema({keyword:"properties",schemaProp:d,dataProp:d},c)}}};y_.default=o6});var JI=N(__=>{"use strict";Object.defineProperty(__,"__esModule",{value:!0});var FI=Qt(),Yf=ne(),qI=pe(),BI=pe(),a6={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,FI.allSchemaProperties)(n),c=s.filter(h=>(0,qI.alwaysValidSchema)(o,n[h]));if(s.length===0||c.length===s.length&&(!o.opts.unevaluated||o.props===!0))return;let u=a.strictSchema&&!a.allowMatchingProperties&&r.properties,l=t.name("valid");o.props!==!0&&!(o.props instanceof Yf.Name)&&(o.props=(0,BI.evaluatedPropsToName)(t,o.props));let{props:d}=o;f();function f(){for(let h of s)u&&p(h),o.allErrors?m(h):(t.var(l,!0),m(h),t.if(l))}function p(h){for(let g in u)new RegExp(h).test(g)&&(0,qI.checkStrictMode)(o,`property ${g} matches pattern ${h} (use allowMatchingProperties)`)}function m(h){t.forIn("key",i,g=>{t.if((0,Yf._)`${(0,FI.usePattern)(e,h)}.test(${g})`,()=>{let _=c.includes(h);_||e.subschema({keyword:"patternProperties",schemaProp:h,dataProp:g,dataPropType:BI.Type.Str},l),o.opts.unevaluated&&d!==!0?t.assign((0,Yf._)`${d}[${g}]`,!0):!_&&!o.allErrors&&t.if((0,Yf.not)(l),()=>t.break())})})}}};__.default=a6});var HI=N($_=>{"use strict";Object.defineProperty($_,"__esModule",{value:!0});var s6=pe(),c6={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:n,it:i}=e;if((0,s6.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"}};$_.default=c6});var KI=N(b_=>{"use strict";Object.defineProperty(b_,"__esModule",{value:!0});var u6=Qt(),l6={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:u6.validateUnion,error:{message:"must match a schema in anyOf"}};b_.default=l6});var GI=N(w_=>{"use strict";Object.defineProperty(w_,"__esModule",{value:!0});var Qf=ne(),d6=pe(),f6={message:"must match exactly one schema in oneOf",params:({params:e})=>(0,Qf._)`{passingSchemas: ${e.passing}}`},p6={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:f6,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(u),e.result(a,()=>e.reset(),()=>e.error(!0));function u(){o.forEach((l,d)=>{let f;(0,d6.alwaysValidSchema)(r,l)?t.var(c,!0):f=e.subschema({keyword:"oneOf",schemaProp:d,compositeRule:!0},c),d>0&&t.if((0,Qf._)`${c} && ${a}`).assign(a,!1).assign(s,(0,Qf._)`[${s}, ${d}]`).else(),t.if(c,()=>{t.assign(a,!0),t.assign(s,d),f&&e.mergeEvaluated(f,Qf.Name)})})}}};w_.default=p6});var WI=N(x_=>{"use strict";Object.defineProperty(x_,"__esModule",{value:!0});var m6=pe(),h6={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,m6.alwaysValidSchema)(i,o))return;let s=e.subschema({keyword:"allOf",schemaProp:a},r);e.ok(r),e.mergeEvaluated(s)})}};x_.default=h6});var QI=N(k_=>{"use strict";Object.defineProperty(k_,"__esModule",{value:!0});var ep=ne(),YI=pe(),g6={message:({params:e})=>(0,ep.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,ep._)`{failingKeyword: ${e.ifClause}}`},v6={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:g6,code(e){let{gen:t,parentSchema:n,it:i}=e;n.then===void 0&&n.else===void 0&&(0,YI.checkStrictMode)(i,'"if" without "then" and "else" is ignored');let r=XI(i,"then"),o=XI(i,"else");if(!r&&!o)return;let a=t.let("valid",!0),s=t.name("_valid");if(c(),e.reset(),r&&o){let l=t.let("ifClause");e.setParams({ifClause:l}),t.if(s,u("then",l),u("else",l))}else r?t.if(s,u("then")):t.if((0,ep.not)(s),u("else"));e.pass(a,()=>e.error(!0));function c(){let l=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},s);e.mergeEvaluated(l)}function u(l,d){return()=>{let f=e.subschema({keyword:l},s);t.assign(a,s),e.mergeValidEvaluated(f,a),d?t.assign(d,(0,ep._)`${l}`):e.setParams({ifClause:l})}}}};function XI(e,t){let n=e.schema[t];return n!==void 0&&!(0,YI.alwaysValidSchema)(e,n)}k_.default=v6});var ez=N(S_=>{"use strict";Object.defineProperty(S_,"__esModule",{value:!0});var y6=pe(),_6={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:n}){t.if===void 0&&(0,y6.checkStrictMode)(n,`"${e}" without "if" is ignored`)}};S_.default=_6});var tz=N(I_=>{"use strict";Object.defineProperty(I_,"__esModule",{value:!0});var $6=c_(),b6=jI(),w6=u_(),x6=NI(),k6=AI(),S6=CI(),I6=ZI(),z6=g_(),P6=VI(),T6=JI(),O6=HI(),j6=KI(),E6=GI(),N6=WI(),A6=QI(),D6=ez();function R6(e=!1){let t=[O6.default,j6.default,E6.default,N6.default,A6.default,D6.default,I6.default,z6.default,S6.default,P6.default,T6.default];return e?t.push(b6.default,x6.default):t.push($6.default,w6.default),t.push(k6.default),t}I_.default=R6});var rz=N(z_=>{"use strict";Object.defineProperty(z_,"__esModule",{value:!0});var Le=ne(),C6={message:({schemaCode:e})=>(0,Le.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,Le._)`{format: ${e}}`},U6={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:C6,code(e,t){let{gen:n,data:i,$data:r,schema:o,schemaCode:a,it:s}=e,{opts:c,errSchemaPath:u,schemaEnv:l,self:d}=s;if(!c.validateFormats)return;r?f():p();function f(){let m=n.scopeValue("formats",{ref:d.formats,code:c.code.formats}),h=n.const("fDef",(0,Le._)`${m}[${a}]`),g=n.let("fType"),_=n.let("format");n.if((0,Le._)`typeof ${h} == "object" && !(${h} instanceof RegExp)`,()=>n.assign(g,(0,Le._)`${h}.type || "string"`).assign(_,(0,Le._)`${h}.validate`),()=>n.assign(g,(0,Le._)`"string"`).assign(_,h)),e.fail$data((0,Le.or)($(),k()));function $(){return c.strictSchema===!1?Le.nil:(0,Le._)`${a} && !${_}`}function k(){let O=l.$async?(0,Le._)`(${h}.async ? await ${_}(${i}) : ${_}(${i}))`:(0,Le._)`${_}(${i})`,T=(0,Le._)`(typeof ${_} == "function" ? ${O} : ${_}.test(${i}))`;return(0,Le._)`${_} && ${_} !== true && ${g} === ${t} && !${T}`}}function p(){let m=d.formats[o];if(!m){$();return}if(m===!0)return;let[h,g,_]=k(m);h===t&&e.pass(O());function $(){if(c.strictSchema===!1){d.logger.warn(T());return}throw new Error(T());function T(){return`unknown format "${o}" ignored in schema at path "${u}"`}}function k(T){let C=T instanceof RegExp?(0,Le.regexpCode)(T):c.code.formats?(0,Le._)`${c.code.formats}${(0,Le.getProperty)(o)}`:void 0,H=n.scopeValue("formats",{key:o,ref:T,code:C});return typeof T=="object"&&!(T instanceof RegExp)?[T.type||"string",T.validate,(0,Le._)`${H}.validate`]:["string",T,H]}function O(){if(typeof m=="object"&&!(m instanceof RegExp)&&m.async){if(!l.$async)throw new Error("async format in sync schema");return(0,Le._)`await ${_}(${i})`}return typeof g=="function"?(0,Le._)`${_}(${i})`:(0,Le._)`${_}.test(${i})`}}}};z_.default=U6});var nz=N(P_=>{"use strict";Object.defineProperty(P_,"__esModule",{value:!0});var Z6=rz(),M6=[Z6.default];P_.default=M6});var iz=N(Bo=>{"use strict";Object.defineProperty(Bo,"__esModule",{value:!0});Bo.contentVocabulary=Bo.metadataVocabulary=void 0;Bo.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Bo.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var az=N(T_=>{"use strict";Object.defineProperty(T_,"__esModule",{value:!0});var L6=pI(),V6=zI(),F6=tz(),q6=nz(),oz=iz(),B6=[L6.default,V6.default,(0,F6.default)(),q6.default,oz.metadataVocabulary,oz.contentVocabulary];T_.default=B6});var cz=N(tp=>{"use strict";Object.defineProperty(tp,"__esModule",{value:!0});tp.DiscrError=void 0;var sz;(function(e){e.Tag="tag",e.Mapping="mapping"})(sz||(tp.DiscrError=sz={}))});var lz=N(j_=>{"use strict";Object.defineProperty(j_,"__esModule",{value:!0});var Jo=ne(),O_=cz(),uz=Af(),J6=nc(),H6=pe(),K6={message:({params:{discrError:e,tagName:t}})=>e===O_.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:n}})=>(0,Jo._)`{error: ${e}, tag: ${n}, tagValue: ${t}}`},G6={keyword:"discriminator",type:"object",schemaType:"object",error:K6,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),u=t.const("tag",(0,Jo._)`${n}${(0,Jo.getProperty)(s)}`);t.if((0,Jo._)`typeof ${u} == "string"`,()=>l(),()=>e.error(!1,{discrError:O_.DiscrError.Tag,tag:u,tagName:s})),e.ok(c);function l(){let p=f();t.if(!1);for(let m in p)t.elseIf((0,Jo._)`${u} === ${m}`),t.assign(c,d(p[m]));t.else(),e.error(!1,{discrError:O_.DiscrError.Mapping,tag:u,tagName:s}),t.endIf()}function d(p){let m=t.name("valid"),h=e.subschema({keyword:"oneOf",schemaProp:p},m);return e.mergeEvaluated(h,Jo.Name),m}function f(){var p;let m={},h=_(r),g=!0;for(let O=0;O<a.length;O++){let T=a[O];if(T?.$ref&&!(0,H6.schemaHasRulesButRef)(T,o.self.RULES)){let H=T.$ref;if(T=uz.resolveRef.call(o.self,o.schemaEnv.root,o.baseId,H),T instanceof uz.SchemaEnv&&(T=T.schema),T===void 0)throw new J6.default(o.opts.uriResolver,o.baseId,H)}let C=(p=T?.properties)===null||p===void 0?void 0:p[s];if(typeof C!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${s}"`);g=g&&(h||_(T)),$(C,O)}if(!g)throw new Error(`discriminator: "${s}" must be required`);return m;function _({required:O}){return Array.isArray(O)&&O.includes(s)}function $(O,T){if(O.const)k(O.const,T);else if(O.enum)for(let C of O.enum)k(C,T);else throw new Error(`discriminator: "properties/${s}" must have "const" or "enum"`)}function k(O,T){if(typeof O!="string"||O in m)throw new Error(`discriminator: "${s}" values must be unique strings`);m[O]=T}}}};j_.default=G6});var dz=N((gB,W6)=>{W6.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 N_=N((Ee,E_)=>{"use strict";Object.defineProperty(Ee,"__esModule",{value:!0});Ee.MissingRefError=Ee.ValidationError=Ee.CodeGen=Ee.Name=Ee.nil=Ee.stringify=Ee.str=Ee._=Ee.KeywordCxt=Ee.Ajv=void 0;var X6=sI(),Y6=az(),Q6=lz(),fz=dz(),eU=["/properties"],rp="http://json-schema.org/draft-07/schema",Ho=class extends X6.default{_addVocabularies(){super._addVocabularies(),Y6.default.forEach(t=>this.addVocabulary(t)),this.opts.discriminator&&this.addKeyword(Q6.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let t=this.opts.$data?this.$dataMetaSchema(fz,eU):fz;this.addMetaSchema(t,rp,!1),this.refs["http://json-schema.org/schema"]=rp}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(rp)?rp:void 0)}};Ee.Ajv=Ho;E_.exports=Ee=Ho;E_.exports.Ajv=Ho;Object.defineProperty(Ee,"__esModule",{value:!0});Ee.default=Ho;var tU=rc();Object.defineProperty(Ee,"KeywordCxt",{enumerable:!0,get:function(){return tU.KeywordCxt}});var Ko=ne();Object.defineProperty(Ee,"_",{enumerable:!0,get:function(){return Ko._}});Object.defineProperty(Ee,"str",{enumerable:!0,get:function(){return Ko.str}});Object.defineProperty(Ee,"stringify",{enumerable:!0,get:function(){return Ko.stringify}});Object.defineProperty(Ee,"nil",{enumerable:!0,get:function(){return Ko.nil}});Object.defineProperty(Ee,"Name",{enumerable:!0,get:function(){return Ko.Name}});Object.defineProperty(Ee,"CodeGen",{enumerable:!0,get:function(){return Ko.CodeGen}});var rU=Ef();Object.defineProperty(Ee,"ValidationError",{enumerable:!0,get:function(){return rU.default}});var nU=nc();Object.defineProperty(Ee,"MissingRefError",{enumerable:!0,get:function(){return nU.default}})});var $z=N(Tr=>{"use strict";Object.defineProperty(Tr,"__esModule",{value:!0});Tr.formatNames=Tr.fastFormats=Tr.fullFormats=void 0;function Pr(e,t){return{validate:e,compare:t}}Tr.fullFormats={date:Pr(gz,C_),time:Pr(D_(!0),U_),"date-time":Pr(pz(!0),yz),"iso-time":Pr(D_(),vz),"iso-date-time":Pr(pz(),_z),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:uU,"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:gU,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:lU,int32:{type:"number",validate:pU},int64:{type:"number",validate:mU},float:{type:"number",validate:hz},double:{type:"number",validate:hz},password:!0,binary:!0};Tr.fastFormats={...Tr.fullFormats,date:Pr(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,C_),time:Pr(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,U_),"date-time":Pr(/^\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,yz),"iso-time":Pr(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,vz),"iso-date-time":Pr(/^\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,_z),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};Tr.formatNames=Object.keys(Tr.fullFormats);function iU(e){return e%4===0&&(e%100!==0||e%400===0)}var oU=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,aU=[0,31,28,31,30,31,30,31,31,30,31,30,31];function gz(e){let t=oU.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&&iU(n)?29:aU[i])}function C_(e,t){if(e&&t)return e>t?1:e<t?-1:0}var A_=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function D_(e){return function(n){let i=A_.exec(n);if(!i)return!1;let r=+i[1],o=+i[2],a=+i[3],s=i[4],c=i[5]==="-"?-1:1,u=+(i[6]||0),l=+(i[7]||0);if(u>23||l>59||e&&!s)return!1;if(r<=23&&o<=59&&a<60)return!0;let d=o-l*c,f=r-u*c-(d<0?1:0);return(f===23||f===-1)&&(d===59||d===-1)&&a<61}}function U_(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 vz(e,t){if(!(e&&t))return;let n=A_.exec(e),i=A_.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 R_=/t|\s/i;function pz(e){let t=D_(e);return function(i){let r=i.split(R_);return r.length===2&&gz(r[0])&&t(r[1])}}function yz(e,t){if(!(e&&t))return;let n=new Date(e).valueOf(),i=new Date(t).valueOf();if(n&&i)return n-i}function _z(e,t){if(!(e&&t))return;let[n,i]=e.split(R_),[r,o]=t.split(R_),a=C_(n,r);if(a!==void 0)return a||U_(i,o)}var sU=/\/|:/,cU=/^(?:[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 uU(e){return sU.test(e)&&cU.test(e)}var mz=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function lU(e){return mz.lastIndex=0,mz.test(e)}var dU=-(2**31),fU=2**31-1;function pU(e){return Number.isInteger(e)&&e<=fU&&e>=dU}function mU(e){return Number.isInteger(e)}function hz(){return!0}var hU=/[^\\]\\Z/;function gU(e){if(hU.test(e))return!1;try{return new RegExp(e),!0}catch{return!1}}});var bz=N(Go=>{"use strict";Object.defineProperty(Go,"__esModule",{value:!0});Go.formatLimitDefinition=void 0;var vU=N_(),mr=ne(),Sn=mr.operators,np={formatMaximum:{okStr:"<=",ok:Sn.LTE,fail:Sn.GT},formatMinimum:{okStr:">=",ok:Sn.GTE,fail:Sn.LT},formatExclusiveMaximum:{okStr:"<",ok:Sn.LT,fail:Sn.GTE},formatExclusiveMinimum:{okStr:">",ok:Sn.GT,fail:Sn.LTE}},yU={message:({keyword:e,schemaCode:t})=>(0,mr.str)`should be ${np[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,mr._)`{comparison: ${np[e].okStr}, limit: ${t}}`};Go.formatLimitDefinition={keyword:Object.keys(np),type:"string",schemaType:"string",$data:!0,error:yU,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 vU.KeywordCxt(o,s.RULES.all.format.definition,"format");c.$data?u():l();function u(){let f=t.scopeValue("formats",{ref:s.formats,code:a.code.formats}),p=t.const("fmt",(0,mr._)`${f}[${c.schemaCode}]`);e.fail$data((0,mr.or)((0,mr._)`typeof ${p} != "object"`,(0,mr._)`${p} instanceof RegExp`,(0,mr._)`typeof ${p}.compare != "function"`,d(p)))}function l(){let f=c.schema,p=s.formats[f];if(!p||p===!0)return;if(typeof p!="object"||p instanceof RegExp||typeof p.compare!="function")throw new Error(`"${r}": format "${f}" does not define "compare" function`);let m=t.scopeValue("formats",{key:f,ref:p,code:a.code.formats?(0,mr._)`${a.code.formats}${(0,mr.getProperty)(f)}`:void 0});e.fail$data(d(m))}function d(f){return(0,mr._)`${f}.compare(${n}, ${i}) ${np[r].fail} 0`}},dependencies:["format"]};var _U=e=>(e.addKeyword(Go.formatLimitDefinition),e);Go.default=_U});var Sz=N((yc,kz)=>{"use strict";Object.defineProperty(yc,"__esModule",{value:!0});var Wo=$z(),$U=bz(),Z_=ne(),wz=new Z_.Name("fullFormats"),bU=new Z_.Name("fastFormats"),M_=(e,t={keywords:!0})=>{if(Array.isArray(t))return xz(e,t,Wo.fullFormats,wz),e;let[n,i]=t.mode==="fast"?[Wo.fastFormats,bU]:[Wo.fullFormats,wz],r=t.formats||Wo.formatNames;return xz(e,r,n,i),t.keywords&&(0,$U.default)(e),e};M_.get=(e,t="full")=>{let i=(t==="fast"?Wo.fastFormats:Wo.fullFormats)[e];if(!i)throw new Error(`Unknown format "${e}"`);return i};function xz(e,t,n,i){var r,o;(r=(o=e.opts.code).formats)!==null&&r!==void 0||(o.formats=(0,Z_._)`require("ajv-formats/dist/formats").${i}`);for(let a of t)e.addFormat(a,n[a])}kz.exports=yc=M_;Object.defineProperty(yc,"__esModule",{value:!0});yc.default=M_});import{parseArgs as VZ}from"node:util";import{readFileSync as wP}from"node:fs";import{dirname as xP,join as kP}from"node:path";var mi="0.2.1",SP="https://api.heylatch.app";function IP(e=process.cwd()){let t=e;for(;;){let n="";try{n=wP(kP(t,".env"),"utf8")}catch{}let i=/^[ \t]*(?:export[ \t]+)?LATCH_API_KEY[ \t]*=[ \t]*["']?([^"'\s#]+)/m.exec(n);if(i)return i[1];let r=xP(t);if(r===t)return;t=r}}var F=class extends Error{constructor(n,i,r=0,o={}){super(i);this.code=n;this.status=r;this.params=o}code;status;params},pi=class{key;baseUrl;fetcher;constructor({key:t=process.env.LATCH_API_KEY||IP(),baseUrl:n=process.env.LATCH_API_URL??SP,fetch:i=fetch}={}){if(!t)throw new F("noApiKey","No API key. Set LATCH_API_KEY (or add it to a .env file) to a key from your workspace's API page on heylatch.app.");if(!t.startsWith("ltk_"))throw new F("noApiKey","LATCH_API_KEY doesn't look like a Latch API key (it should start with ltk_).");this.key=t,this.baseUrl=n.replace(/\/+$/,""),this.fetcher=i}async request(t,n,i){for(let r=0;;r++){let o;try{o=await this.fetcher(`${this.baseUrl}/public/v1${n}`,{method:t,headers:{authorization:`Bearer ${this.key}`,"user-agent":`latch-cli/${mi}`,...i!==void 0?{"content-type":"application/json"}:{}},body:i!==void 0?JSON.stringify(i):void 0})}catch(u){throw new F("network",`Couldn't reach ${this.baseUrl}: ${u.message}`)}let a=await o.json().catch(()=>null);if(o.ok)return a;let s=a?.error,c=Number(s?.params?.seconds);if(o.status===429&&r<3&&c>0&&c<=90){await new Promise(u=>setTimeout(u,c*1e3));continue}throw new F(s?.code??"generic",s?.message??`Request failed (${o.status}).`,o.status,s?.params??{})}}async fetchPackage(t){let n=await this.fetcher(t);if(!n.ok)throw new F("downloadFailed",`Downloading the package failed (${n.status}). Try again.`,n.status);return new Uint8Array(await n.arrayBuffer())}async upload(t,n){let i=await this.fetcher(t,{method:"PUT",headers:{"content-type":"application/zip"},body:n});if(!i.ok)throw new F("uploadFailed",`Uploading the package failed (${i.status}). The upload link may have expired; try again.`,i.status)}workspace=()=>this.request("GET","/workspace");listScripts=()=>this.request("GET","/scripts").then(t=>t.data);getScript=t=>this.request("GET",`/scripts/${Ke(t)}`);createScript=t=>this.request("POST","/scripts",t);createVersion=(t,n)=>this.request("POST",`/scripts/${Ke(t)}/versions`,n);getVersion=(t,n)=>this.request("GET",`/scripts/${Ke(t)}/versions/${Ke(n)}`);publishVersion=(t,n)=>this.request("POST",`/scripts/${Ke(t)}/versions/${Ke(n)}/publish`);withdrawVersion=(t,n)=>this.request("POST",`/scripts/${Ke(t)}/versions/${Ke(n)}/withdraw`);downloadVersion=(t,n)=>this.request("POST",`/scripts/${Ke(t)}/versions/${Ke(n)}/download`);listGrants=(t,n={})=>this.request("GET",`/scripts/${Ke(t)}/grants${$p(n)}`);grant=(t,n)=>this.request("POST",`/scripts/${Ke(t)}/grants`,{accountId:n});grantBulk=(t,n)=>this.request("POST",`/scripts/${Ke(t)}/grants/bulk`,{accountIds:n});revoke=(t,n)=>this.request("POST",`/scripts/${Ke(t)}/grants/revoke`,{accountId:n});listActivations=(t,n={})=>this.request("GET",`/scripts/${Ke(t)}/activations${$p(n)}`);listFlags=(t,n={})=>this.request("GET",`/scripts/${Ke(t)}/flags${$p(n)}`);resolveFlag=t=>this.request("POST",`/flags/${Ke(t)}/resolve`)},Ke=encodeURIComponent;function $p(e){let t=Object.entries(e).filter(([,n])=>n!=null&&n!=="");return t.length?`?${new URLSearchParams(t.map(([n,i])=>[n,String(i)]))}`:""}var jc='# Latch guide for AI agents\r\n\r\nYou are an AI coding agent, and a developer wants their game server scripts protected with Latch. This guide has everything you need to do that from start to finish. Follow it rather than guessing. When a step needs something only the developer can do, stop and ask for it, and say exactly where to get it.\r\n\r\nLatch (https://heylatch.app) protects and licenses game server scripts. The developer uploads a resource. Latch encrypts its server code and returns a package that only runs on servers with a valid license key. Supported games: HogwartsMP and Kingdoms Connected (MafiaHub resources), and Hytale (Java plugins).\r\n\r\nLatch doesn\'t change the developer\'s source. Keep working in the source as usual: it stays readable and in their repository. The protected package is a build output that goes to servers.\r\n\r\n## Rules\r\n\r\n- Never write a protected package over source code. Keep the source and the server\'s install folder separate.\r\n- Never commit, print or paste keys. API keys (`ltk_...`) and license keys (`LT-...`) go in a git-ignored `.env` file or a CI secret.\r\n- Publish the original resource, never a package you downloaded from Latch.\r\n- Don\'t edit files inside a protected package. Modified packages won\'t run. Change the source and publish a new version.\r\n- Ask before granting or revoking access, withdrawing a version, or publishing to servers real players are on. Those actions affect other people.\r\n- Show the developer the result of `preview` or `publish-all --dry-run` before the first real publish.\r\n\r\n## What you need from the developer\r\n\r\nAsk for these once, together, and explain why:\r\n\r\n1. **A Latch account and workspace.** Sign up at https://heylatch.app and create a workspace at https://heylatch.app/app/w/new. Plans are per workspace, and the plan limits how many scripts it can hold (see [Projects with many resources](#projects-with-many-resources)).\r\n2. **An API key.** Workspace > API page (`https://heylatch.app/app/w/<workspace>/api`). The **Publish** preset is enough to publish and install. Choose **Full** only if you\'ll also manage access. Ask them to put it in a git-ignored `.env` at the project root, so you never see the value:\r\n ```\r\n LATCH_API_KEY=ltk_...\r\n ```\r\n3. **A license key**, only when installing on a server. Get it at https://heylatch.app/app/keys. It goes on the server, not in the project (see [Install on a server](#install-on-a-server)).\r\n\r\nYou can\'t create these yourself: the API has no endpoint for accounts, workspaces, API keys or license keys.\r\n\r\n## Set up the tools\r\n\r\nUse the CLI (needs Node.js 20 or newer). There\'s nothing to install globally:\r\n\r\n```sh\r\nnpx -y @heylatch/cli@latest whoami\r\n```\r\n\r\nThis prints the workspace, plan, script usage and the key\'s permissions. The CLI reads `LATCH_API_KEY` from the environment, or from a `.env` file in the current folder or any folder above it. Add `--json` to any command for machine-readable output. Commands exit with code 1 on failure.\r\n\r\nIf your client supports MCP, the same package also runs an MCP server. The developer can add it with:\r\n\r\n```sh\r\nclaude mcp add latch -e LATCH_API_KEY=ltk_... -- npx -y @heylatch/cli@latest mcp\r\n```\r\n\r\nTools: `get_guide`, `whoami`, `list_scripts`, `get_script`, `preview_package`, `publish_version`, `publish_all`, `pull_version`, `get_version_status`, `withdraw_version`, `list_access`, `grant_access`, `revoke_access`, `list_activations`, `list_flags`, `resolve_flag`.\r\n\r\nThis guide uses CLI commands. Each one maps directly to an MCP tool.\r\n\r\n## Prepare the package\r\n\r\nLatch protects what the game server loads, so point it at the built resource (with its compiled JavaScript or `.class` files), not an unbuilt project. Build first if the project has a build step.\r\n\r\n### MafiaHub resources (HogwartsMP, Kingdoms Connected)\r\n\r\n`package.json` at the resource root needs a `mafiahub` block:\r\n\r\n```json\r\n{\r\n "name": "my-resource",\r\n "version": "1.0.0",\r\n "description": "What it does",\r\n "mafiahub": {\r\n "serverScripts": ["dist/server.js"],\r\n "clientScripts": ["dist/client.js"],\r\n "files": ["dist/client.js"],\r\n "resourceDependencies": ["other-resource"]\r\n },\r\n "latch": {\r\n "ecosystem": "hogwartsmp",\r\n "ignore": ["config.json"]\r\n }\r\n}\r\n```\r\n\r\nWhat happens to each file:\r\n\r\n| File | In the package |\r\n|---|---|\r\n| `serverScripts`, and other `.js`/`.cjs`/`.json` files | Encrypted. Decrypted only in memory, after the license check. |\r\n| `clientScripts`, `sharedScripts`, `files` | Sent to players by the game, so they can\'t be encrypted. Their JavaScript is obfuscated. |\r\n| Anything in `latch.ignore` | Stays readable. Use it for config the server owner edits. |\r\n| `node_modules/`, images, sounds, other assets | Stay readable. |\r\n| `.ts`, `.tsx`, `.map` | Left out. |\r\n| `.git`, `.env`, `server.env`, `latch.env` (when publishing a folder) | Left out. |\r\n\r\nThe `latch` block is removed from the published package. Its optional fields:\r\n\r\n| Field | Meaning |\r\n|---|---|\r\n| `ignore` | Server files to leave readable. Wildcards work: `data/*`, `data/**`. |\r\n| `obfuscateClient` | `false` ships client JavaScript without obfuscation. |\r\n| `script` | Script slug on Latch, if it should differ from `name`. |\r\n| `name` | Display name on Latch, if it should differ from `name`. |\r\n| `ecosystem` | `hogwartsmp` or `kcdc`. Needed the first time a script is created, unless you pass `--ecosystem`. |\r\n| `category` | `gameplay`, `economy`, `vehicles`, `ui`, `world`, `admin` or `other`. |\r\n\r\nCheck the code for these before publishing:\r\n\r\n- **ES modules.** Encrypted server code runs as CommonJS, so `import`/`export` statements won\'t run. Compile server scripts to CommonJS, for example with esbuild\'s `--format=cjs`. `import()` works. Files ending in `.mjs` aren\'t encrypted at all. `preview` warns about this, but the build won\'t fail, so don\'t ignore the warning.\r\n- **Reading its own files.** Encrypted files aren\'t on disk. `require("./data.json")` works, but `fs.readFile` on an encrypted file doesn\'t. List any file the code reads with `fs` under `latch.ignore`, or switch to `require`.\r\n- **Server scripts listed for players.** A file in `serverScripts` can\'t also be in `clientScripts`, `sharedScripts` or `files`. This blocks the publish.\r\n- **Secrets in the bundle.** `node_modules/` stays readable. If server code must stay private, bundle it into `dist/` with its dependencies.\r\n- **Programs and native files** (`.exe`, `.dll`, `.node`...) aren\'t blocked, but they\'re flagged for the Latch team to review.\r\n\r\n### Hytale plugins\r\n\r\nPublish the compiled plugin `.jar`. It needs `manifest.json` at its root with a `Main` class, and that class must be in the JAR:\r\n\r\n```json\r\n{\r\n "Group": "com.acme",\r\n "Name": "MyPlugin",\r\n "Version": "1.0.0",\r\n "Description": "What it does",\r\n "ServerVersion": "0.7.0-pre.2",\r\n "Main": "com.acme.Main"\r\n}\r\n```\r\n\r\nAll classes and resources are encrypted, and the result is a single `.jar` for the server\'s `mods/` folder. Keep asset packs streamed to players (models, textures) out of the code JAR: they can\'t be protected.\r\n\r\n## Publish\r\n\r\n```sh\r\n# 1. See what happens to each file. Uploads nothing. Fix anything it reports.\r\nnpx -y @heylatch/cli@latest preview ./my-resource\r\n\r\n# 2. Upload, publish and wait for the build\r\nnpx -y @heylatch/cli@latest publish ./my-resource --changelog "Fixed spawn bug"\r\n\r\n# 3. If you need to check again later\r\nnpx -y @heylatch/cli@latest status my-resource\r\n```\r\n\r\n`publish` takes the script\'s slug, version, name and description from the manifest. Flags override them: `--script`, `--version`, `--name`, `--description`, `--ecosystem`, `--category`, `--tags`. A script that doesn\'t exist yet is created on first publish; it only needs an ecosystem (`--ecosystem hogwartsmp|kcdc|hytale`, or `latch.ecosystem`).\r\n\r\nVersions:\r\n\r\n- Use `1.2.0` form. A new version must be higher than the last one, and a number can\'t be reused, even if its build failed. Raise it in the manifest and publish again.\r\n- Keep the version in the manifest as the single source, so dependency version checks and Latch agree.\r\n- Everyone with access is notified when a version is ready, and sees the changelog.\r\n\r\nSlugs are unique across all of Latch. If a publish fails with `slugTaken`, pass another with `--script` or `latch.script`. That only changes the name on Latch: the resource on the server keeps its `name` from `package.json`, so other resources\' dependencies and `Imports.get` calls keep working.\r\n\r\n## Projects with many resources\r\n\r\nEach resource folder is one script on Latch. Plans limit scripts per workspace:\r\n\r\n| Plan | Scripts |\r\n|---|---|\r\n| Free | 1 |\r\n| Pro | 5 |\r\n| Studio | 50 |\r\n| Enterprise | Unlimited |\r\n\r\nBefore publishing a large project, count what needs protecting and compare it with `whoami`. If the plan is too small, tell the developer what the options are; don\'t pick for them. They can upgrade, or protect only the resources that hold the valuable logic. Protected and unprotected resources work side by side.\r\n\r\nTo publish a folder of resources:\r\n\r\n```sh\r\n# See what would happen. Changes nothing.\r\nnpx -y @heylatch/cli@latest publish-all ./resources --ecosystem hogwartsmp --dry-run\r\n\r\n# Do it. Safe to rerun: published versions are skipped.\r\nnpx -y @heylatch/cli@latest publish-all ./resources --ecosystem hogwartsmp --changelog "..."\r\n```\r\n\r\n- It stops before uploading anything if the new scripts wouldn\'t fit the plan. Narrow it down with `--only a,b` or `--skip a,b` (folder names).\r\n- One resource failing doesn\'t stop the others. The summary lists each one, and the exit code is 1 if any failed. Fix those and rerun.\r\n- A changed resource whose version wasn\'t raised is reported as `unchanged`. Raise the version to publish it.\r\n- The target script comes from each manifest. Read the dry run: if a line says the manifest names the script, check it\'s the script you meant, especially for code you didn\'t write. Publishing an update notifies everyone with access to that script.\r\n- Resources with no `serverScripts` (client-only UI, for example) are `skipped`. They have nothing Latch can encrypt, so install them on the server as they are.\r\n\r\nDependencies between resources keep working: load order, `resourceDependencies`, `Exports.register`, `Exports.get` and `Imports.get` behave as they do unprotected, including calls at the top level of a dependent\'s script. If a dependency\'s license fails, its exports don\'t exist, so resources that need them fail to start and the console says why.\r\n\r\n## Install on a server\r\n\r\n```sh\r\n# One script, or several\r\nnpx -y @heylatch/cli@latest pull my-resource other-resource --to /path/to/server/resources\r\n\r\n# Every published script in the workspace\r\nnpx -y @heylatch/cli@latest pull --all --to /path/to/server/resources\r\n\r\n# Hytale plugins go in mods/\r\nnpx -y @heylatch/cli@latest pull my-plugin --to /path/to/server/mods\r\n```\r\n\r\n`pull` installs the newest ready version. It\'s meant for the developer\'s own servers, and it\'s the only safe way to install here:\r\n\r\n- It refuses to write through a symlink or junction. Development servers often link source folders into `resources/`, and writing through one would overwrite the source. If `pull` refuses, don\'t work around it: remove the link or use a separate server folder, and tell the developer.\r\n- It refuses to overwrite a folder that isn\'t a Latch package unless you pass `--force`. Don\'t pass `--force` without asking.\r\n- Files in the package replace the ones on the server, including readable config. Protect edited files with `--keep config.json,data/*`.\r\n- Run it with the server stopped, then start the server.\r\n\r\n### The license key\r\n\r\nEach server needs one key. Set it as an environment variable, or in a `.env`, `server.env` or `latch.env` file in the server folder or a folder above it:\r\n\r\n```\r\nLATCH_LICENSE=LT-XXXX-XXXX-XXXX-XXXX\r\n```\r\n\r\n- One key runs on one server at a time. The same key on a second server is refused and flagged, so a second server (for example main and test) needs an extra key from https://heylatch.app/app/keys.\r\n- A key isn\'t per script. It opens every script the account can access, so write it once.\r\n- Workspace members can run their own workspace\'s scripts with their own key, without being granted access.\r\n- The server needs outbound HTTPS (443) to `api.heylatch.app`.\r\n\r\n### Check that it works\r\n\r\nStart the server and read the console. For each protected resource, you should see:\r\n\r\n```\r\n[latch] my-resource: license verified\r\n```\r\n\r\nThen test the resource\'s actual behavior in-game or through its commands. Each protected resource adds a moment to startup for its license check.\r\n\r\n## Give others access\r\n\r\nServer owners share their account ID, which looks like `LA-7K2M-9QXD`. They\'ll find it in Settings (https://heylatch.app/app/settings).\r\n\r\n```sh\r\nnpx -y @heylatch/cli@latest grant my-resource LA-7K2M-9QXD # safe to retry\r\nnpx -y @heylatch/cli@latest access my-resource\r\nnpx -y @heylatch/cli@latest revoke my-resource LA-7K2M-9QXD\r\n```\r\n\r\nThey then download the package from their Library (https://heylatch.app/app/scripts), extract it into `resources/` (Hytale: put the `.jar` in `mods/`), and add their own key. Granting several accounts in one command needs the Studio plan.\r\n\r\n## What happens at runtime\r\n\r\n| Situation | Result |\r\n|---|---|\r\n| No key, invalid key or no access | The script doesn\'t run and the console says why. The server and other resources keep running. |\r\n| The script itself throws while starting | Handled like an unprotected resource: that resource fails to start and the server continues. |\r\n| Access revoked or key revoked while running | The script stops at its next license check, within about 5 minutes. The server keeps running. |\r\n| License server unreachable at startup | The resource retries every 30 seconds and starts when it gets through. Resources that depend on it at startup can fail, so restart the server once the connection is back. |\r\n| License server unreachable while running | The script keeps running and retries. After 30 minutes without contact, it stops. |\r\n\r\nStopping on MafiaHub: the runtime can\'t unload a resource, so Latch cuts it off instead. Its timers stop, and its handlers for `Events`, `Chat`, `Messages` and `WorldEvents` stop responding. Two things remain until the server restarts: what the script already created in the world, and exports other resources already hold. For cleanup on stop, export a hook from the last server script:\r\n\r\n```js\r\nmodule.exports.onLatchStop = (reason) => {\r\n // remove spawned entities, close connections\r\n}\r\n```\r\n\r\nOn Hytale, the plugin is shut down through its normal shutdown.\r\n\r\n## Troubleshooting\r\n\r\nConsole messages on the server:\r\n\r\n| Message | Fix |\r\n|---|---|\r\n| `license key not found` | `LATCH_LICENSE` is missing or misnamed. See [The license key](#the-license-key). |\r\n| `key already active on another server` | Stop the other server, or use an extra key. After moving to a new machine, the key frees up in about 10 minutes. |\r\n| `account has no access to this script` | The key\'s account has no grant and isn\'t in the workspace. Grant access, or use a member\'s key. |\r\n| `this package is outdated` | The script\'s encryption key was rotated. Run `pull` again. |\r\n| `this package is damaged or was modified` | Files in the package changed. Run `pull` again and don\'t edit them. |\r\n| `could not reach license server` | Allow outbound HTTPS to `api.heylatch.app`. |\r\n| `Cannot find module` or a missing file | The code reads an encrypted file. See [Prepare the package](#prepare-the-package). |\r\n\r\nAPI and CLI error codes:\r\n\r\n| Code | Fix |\r\n|---|---|\r\n| `apiKeyInvalid` | The key is wrong, revoked or expired. Ask for a new one. |\r\n| `scopeMissing` | The key lacks the permission named in the message. Ask for a key with that scope. |\r\n| `planLimit` | The workspace is at its script limit. Ask the developer how to proceed. |\r\n| `planRequired` | The feature needs a higher plan. |\r\n| `versionExists`, `versionLower` | Raise the version. |\r\n| `slugTaken` | Another script has this slug. Use `--script`. |\r\n| `packageBlocked` | `preview` lists the problems. Fix them and retry. |\r\n| `linkedTarget`, `notLatchFolder` | `pull` protected a folder that may hold source. See [Install on a server](#install-on-a-server). |\r\n| `rateLimited` | The CLI waits and retries by itself. Only seen after repeated limits. |\r\n\r\nIf a build fails with status `error`, `buildError` says why. Fix the package, raise the version and publish again.\r\n\r\n## Automate releases\r\n\r\n```yaml\r\n# .github/workflows/release.yml, on a tag like v1.2.0\r\n- run: npx -y @heylatch/cli@latest publish ./dist-resource --version "${GITHUB_REF_NAME#v}"\r\n env:\r\n LATCH_API_KEY: ${{ secrets.LATCH_API_KEY }}\r\n```\r\n\r\nOffer to add this block to the project\'s `CLAUDE.md` or `AGENTS.md`, so future sessions keep to the setup:\r\n\r\n```markdown\r\n## Latch\r\nServer code is protected with Latch. Guide: https://heylatch.app/agents.md\r\n- Publish from the built resource: `npx -y @heylatch/cli@latest publish <folder>`. Raise `version` first.\r\n- Install on servers with `npx -y @heylatch/cli@latest pull <script> --to <server>/resources`. Never over source folders.\r\n- `LATCH_API_KEY` and `LATCH_LICENSE` live in git-ignored `.env` files. Never commit or print them.\r\n```\r\n\r\n## More\r\n\r\n- CLI help: `npx -y @heylatch/cli@latest --help`\r\n- This guide offline, matching the installed version: `latch guide`, or the MCP tool `get_guide`\r\n- Human docs: https://heylatch.app/docs\r\n- REST API: https://heylatch.app/docs/api, spec at https://api.heylatch.app/public/v1/openapi.json\r\n';var le;(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})(le||(le={}));var p$;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(p$||(p$={}));var D=le.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Dr=e=>{switch(typeof e){case"undefined":return D.undefined;case"string":return D.string;case"number":return Number.isNaN(e)?D.nan:D.number;case"boolean":return D.boolean;case"function":return D.function;case"bigint":return D.bigint;case"symbol":return D.symbol;case"object":return Array.isArray(e)?D.array:e===null?D.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?D.promise:typeof Map<"u"&&e instanceof Map?D.map:typeof Set<"u"&&e instanceof Set?D.set:typeof Date<"u"&&e instanceof Date?D.date:D.object;default:return D.unknown}};var I=le.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 Ut=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 u=a.path[c],l=c===a.path.length-1;if(u==="_errors"){l&&s._errors.push(n(a)),c++;continue}Object.prototype.hasOwnProperty.call(s,u)||(u==="__proto__"?Object.defineProperty(s,u,{value:{_errors:[]},writable:!0,enumerable:!0,configurable:!0}):s[u]={_errors:[]}),s=s[u],l&&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,le.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()}};Ut.create=e=>new Ut(e);var zP=(e,t)=>{let n;switch(e.code){case I.invalid_type:e.received===D.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case I.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,le.jsonStringifyReplacer)}`;break;case I.unrecognized_keys:n=`Unrecognized key(s) in object: ${le.joinValues(e.keys,", ")}`;break;case I.invalid_union:n="Invalid input";break;case I.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${le.joinValues(e.options)}`;break;case I.invalid_enum_value:n=`Invalid enum value. Expected ${le.joinValues(e.options)}, received '${e.received}'`;break;case I.invalid_arguments:n="Invalid function arguments";break;case I.invalid_return_type:n="Invalid function return type";break;case I.invalid_date:n="Invalid date";break;case I.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}"`:le.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case I.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 I.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 I.custom:n="Invalid input";break;case I.invalid_intersection_types:n="Intersection results could not be merged";break;case I.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case I.not_finite:n="Number must be finite";break;default:n=t.defaultError,le.assertNever(e)}return{message:n}},Wr=zP;var PP=Wr;function oa(){return PP}var Ec=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(u=>!!u).slice().reverse();for(let u of c)s=u(a,{data:t,defaultError:s}).message;return{...r,path:o,message:s}};function j(e,t){let n=oa(),i=Ec({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===Wr?void 0:Wr].filter(r=>!!r)});e.common.issues.push(i)}var it=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 q;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 q;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}}},q=Object.freeze({status:"aborted"}),hi=e=>({status:"dirty",value:e}),ft=e=>({status:"valid",value:e}),bp=e=>e.status==="aborted",wp=e=>e.status==="dirty",On=e=>e.status==="valid",aa=e=>typeof Promise<"u"&&e instanceof Promise;var U;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(U||(U={}));var Jt=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}},m$=(e,t)=>{if(On(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 Ut(e.common.issues);return this._error=n,this._error}}};function Q(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 ie=class{get description(){return this._def.description}_getType(t){return Dr(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Dr(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new it,ctx:{common:t.parent.common,data:t.data,parsedType:Dr(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let n=this._parse(t);if(aa(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:Dr(t)},r=this._parseSync({data:t,path:i.path,parent:i});return m$(i,r)}"~validate"(t){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Dr(t)};if(!this["~standard"].async)try{let i=this._parseSync({data:t,path:[],parent:n});return On(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=>On(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:Dr(t)},r=this._parse({data:t,path:i.path,parent:i}),o=await(aa(r)?r:Promise.resolve(r));return m$(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:I.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 ir({schema:this,typeName:P.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 nr.create(this,this._def)}nullable(){return Ur.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Yr.create(this)}promise(){return jn.create(this,this._def)}or(t){return $i.create([this,t],this._def)}and(t){return bi.create(this,t,this._def)}transform(t){return new ir({...Q(this._def),schema:this,typeName:P.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let n=typeof t=="function"?t:()=>t;return new Ii({...Q(this._def),innerType:this,defaultValue:n,typeName:P.ZodDefault})}brand(){return new Nc({typeName:P.ZodBranded,type:this,...Q(this._def)})}catch(t){let n=typeof t=="function"?t:()=>t;return new zi({...Q(this._def),innerType:this,catchValue:n,typeName:P.ZodCatch})}describe(t){let n=this.constructor;return new n({...this._def,description:t})}pipe(t){return Ac.create(this,t)}readonly(){return Pi.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},TP=/^c[^\s-]{8,}$/i,OP=/^[0-9a-z]+$/,jP=/^[0-9A-HJKMNP-TV-Z]{26}$/i,EP=/^[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,NP=/^[a-z0-9_-]{21}$/i,AP=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,DP=/^[-+]?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)?)??$/,RP=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,CP="^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$",xp,UP=/^(?:(?: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])$/,ZP=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,MP=/^(([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]))$/,LP=/^(([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])$/,VP=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,FP=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,h$="((\\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])))",qP=new RegExp(`^${h$}$`);function g$(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 BP(e){return new RegExp(`^${g$(e)}$`)}function JP(e){let t=`${h$}T${g$(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 HP(e,t){return!!((t==="v4"||!t)&&UP.test(e)||(t==="v6"||!t)&&MP.test(e))}function KP(e,t){if(!AP.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 GP(e,t){return!!((t==="v4"||!t)&&ZP.test(e)||(t==="v6"||!t)&&LP.test(e))}var vi=class e extends ie{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==D.string){let o=this._getOrReturnCtx(t);return j(o,{code:I.invalid_type,expected:D.string,received:o.parsedType}),q}let i=new it,r;for(let o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(r=this._getOrReturnCtx(t,r),j(r,{code:I.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),j(r,{code:I.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?j(r,{code:I.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):s&&j(r,{code:I.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),i.dirty())}else if(o.kind==="email")RP.test(t.data)||(r=this._getOrReturnCtx(t,r),j(r,{validation:"email",code:I.invalid_string,message:o.message}),i.dirty());else if(o.kind==="emoji")xp||(xp=new RegExp(CP,"u")),xp.test(t.data)||(r=this._getOrReturnCtx(t,r),j(r,{validation:"emoji",code:I.invalid_string,message:o.message}),i.dirty());else if(o.kind==="uuid")EP.test(t.data)||(r=this._getOrReturnCtx(t,r),j(r,{validation:"uuid",code:I.invalid_string,message:o.message}),i.dirty());else if(o.kind==="nanoid")NP.test(t.data)||(r=this._getOrReturnCtx(t,r),j(r,{validation:"nanoid",code:I.invalid_string,message:o.message}),i.dirty());else if(o.kind==="cuid")TP.test(t.data)||(r=this._getOrReturnCtx(t,r),j(r,{validation:"cuid",code:I.invalid_string,message:o.message}),i.dirty());else if(o.kind==="cuid2")OP.test(t.data)||(r=this._getOrReturnCtx(t,r),j(r,{validation:"cuid2",code:I.invalid_string,message:o.message}),i.dirty());else if(o.kind==="ulid")jP.test(t.data)||(r=this._getOrReturnCtx(t,r),j(r,{validation:"ulid",code:I.invalid_string,message:o.message}),i.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{r=this._getOrReturnCtx(t,r),j(r,{validation:"url",code:I.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),j(r,{validation:"regex",code:I.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),j(r,{code:I.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),j(r,{code:I.invalid_string,validation:{startsWith:o.value},message:o.message}),i.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(r=this._getOrReturnCtx(t,r),j(r,{code:I.invalid_string,validation:{endsWith:o.value},message:o.message}),i.dirty()):o.kind==="datetime"?JP(o).test(t.data)||(r=this._getOrReturnCtx(t,r),j(r,{code:I.invalid_string,validation:"datetime",message:o.message}),i.dirty()):o.kind==="date"?qP.test(t.data)||(r=this._getOrReturnCtx(t,r),j(r,{code:I.invalid_string,validation:"date",message:o.message}),i.dirty()):o.kind==="time"?BP(o).test(t.data)||(r=this._getOrReturnCtx(t,r),j(r,{code:I.invalid_string,validation:"time",message:o.message}),i.dirty()):o.kind==="duration"?DP.test(t.data)||(r=this._getOrReturnCtx(t,r),j(r,{validation:"duration",code:I.invalid_string,message:o.message}),i.dirty()):o.kind==="ip"?HP(t.data,o.version)||(r=this._getOrReturnCtx(t,r),j(r,{validation:"ip",code:I.invalid_string,message:o.message}),i.dirty()):o.kind==="jwt"?KP(t.data,o.alg)||(r=this._getOrReturnCtx(t,r),j(r,{validation:"jwt",code:I.invalid_string,message:o.message}),i.dirty()):o.kind==="cidr"?GP(t.data,o.version)||(r=this._getOrReturnCtx(t,r),j(r,{validation:"cidr",code:I.invalid_string,message:o.message}),i.dirty()):o.kind==="base64"?VP.test(t.data)||(r=this._getOrReturnCtx(t,r),j(r,{validation:"base64",code:I.invalid_string,message:o.message}),i.dirty()):o.kind==="base64url"?FP.test(t.data)||(r=this._getOrReturnCtx(t,r),j(r,{validation:"base64url",code:I.invalid_string,message:o.message}),i.dirty()):le.assertNever(o);return{status:i.value,value:t.data}}_regex(t,n,i){return this.refinement(r=>t.test(r),{validation:n,code:I.invalid_string,...U.errToObj(i)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...U.errToObj(t)})}url(t){return this._addCheck({kind:"url",...U.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...U.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...U.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...U.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...U.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...U.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...U.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...U.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...U.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...U.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...U.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...U.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,...U.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,...U.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...U.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...U.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n?.position,...U.errToObj(n?.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...U.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...U.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...U.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...U.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...U.errToObj(n)})}nonempty(t){return this.min(1,U.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}};vi.create=e=>new vi({checks:[],typeName:P.ZodString,coerce:e?.coerce??!1,...Q(e)});function WP(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 sa=class e extends ie{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)!==D.number){let o=this._getOrReturnCtx(t);return j(o,{code:I.invalid_type,expected:D.number,received:o.parsedType}),q}let i,r=new it;for(let o of this._def.checks)o.kind==="int"?le.isInteger(t.data)||(i=this._getOrReturnCtx(t,i),j(i,{code:I.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),j(i,{code:I.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),j(i,{code:I.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),r.dirty()):o.kind==="multipleOf"?WP(t.data,o.value)!==0&&(i=this._getOrReturnCtx(t,i),j(i,{code:I.not_multiple_of,multipleOf:o.value,message:o.message}),r.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(i=this._getOrReturnCtx(t,i),j(i,{code:I.not_finite,message:o.message}),r.dirty()):le.assertNever(o);return{status:r.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,U.toString(n))}gt(t,n){return this.setLimit("min",t,!1,U.toString(n))}lte(t,n){return this.setLimit("max",t,!0,U.toString(n))}lt(t,n){return this.setLimit("max",t,!1,U.toString(n))}setLimit(t,n,i,r){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:i,message:U.toString(r)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:U.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:U.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:U.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:U.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:U.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:U.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:U.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:U.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:U.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"&&le.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)}};sa.create=e=>new sa({checks:[],typeName:P.ZodNumber,coerce:e?.coerce||!1,...Q(e)});var ca=class e extends ie{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)!==D.bigint)return this._getInvalidInput(t);let i,r=new it;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),j(i,{code:I.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),j(i,{code:I.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),j(i,{code:I.not_multiple_of,multipleOf:o.value,message:o.message}),r.dirty()):le.assertNever(o);return{status:r.value,value:t.data}}_getInvalidInput(t){let n=this._getOrReturnCtx(t);return j(n,{code:I.invalid_type,expected:D.bigint,received:n.parsedType}),q}gte(t,n){return this.setLimit("min",t,!0,U.toString(n))}gt(t,n){return this.setLimit("min",t,!1,U.toString(n))}lte(t,n){return this.setLimit("max",t,!0,U.toString(n))}lt(t,n){return this.setLimit("max",t,!1,U.toString(n))}setLimit(t,n,i,r){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:i,message:U.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:U.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:U.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:U.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:U.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:U.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}};ca.create=e=>new ca({checks:[],typeName:P.ZodBigInt,coerce:e?.coerce??!1,...Q(e)});var ua=class extends ie{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==D.boolean){let i=this._getOrReturnCtx(t);return j(i,{code:I.invalid_type,expected:D.boolean,received:i.parsedType}),q}return ft(t.data)}};ua.create=e=>new ua({typeName:P.ZodBoolean,coerce:e?.coerce||!1,...Q(e)});var la=class e extends ie{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==D.date){let o=this._getOrReturnCtx(t);return j(o,{code:I.invalid_type,expected:D.date,received:o.parsedType}),q}if(Number.isNaN(t.data.getTime())){let o=this._getOrReturnCtx(t);return j(o,{code:I.invalid_date}),q}let i=new it,r;for(let o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(r=this._getOrReturnCtx(t,r),j(r,{code:I.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),j(r,{code:I.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),i.dirty()):le.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:U.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:U.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}};la.create=e=>new la({checks:[],coerce:e?.coerce||!1,typeName:P.ZodDate,...Q(e)});var da=class extends ie{_parse(t){if(this._getType(t)!==D.symbol){let i=this._getOrReturnCtx(t);return j(i,{code:I.invalid_type,expected:D.symbol,received:i.parsedType}),q}return ft(t.data)}};da.create=e=>new da({typeName:P.ZodSymbol,...Q(e)});var yi=class extends ie{_parse(t){if(this._getType(t)!==D.undefined){let i=this._getOrReturnCtx(t);return j(i,{code:I.invalid_type,expected:D.undefined,received:i.parsedType}),q}return ft(t.data)}};yi.create=e=>new yi({typeName:P.ZodUndefined,...Q(e)});var _i=class extends ie{_parse(t){if(this._getType(t)!==D.null){let i=this._getOrReturnCtx(t);return j(i,{code:I.invalid_type,expected:D.null,received:i.parsedType}),q}return ft(t.data)}};_i.create=e=>new _i({typeName:P.ZodNull,...Q(e)});var fa=class extends ie{constructor(){super(...arguments),this._any=!0}_parse(t){return ft(t.data)}};fa.create=e=>new fa({typeName:P.ZodAny,...Q(e)});var Xr=class extends ie{constructor(){super(...arguments),this._unknown=!0}_parse(t){return ft(t.data)}};Xr.create=e=>new Xr({typeName:P.ZodUnknown,...Q(e)});var yr=class extends ie{_parse(t){let n=this._getOrReturnCtx(t);return j(n,{code:I.invalid_type,expected:D.never,received:n.parsedType}),q}};yr.create=e=>new yr({typeName:P.ZodNever,...Q(e)});var pa=class extends ie{_parse(t){if(this._getType(t)!==D.undefined){let i=this._getOrReturnCtx(t);return j(i,{code:I.invalid_type,expected:D.void,received:i.parsedType}),q}return ft(t.data)}};pa.create=e=>new pa({typeName:P.ZodVoid,...Q(e)});var Yr=class e extends ie{_parse(t){let{ctx:n,status:i}=this._processInputParams(t),r=this._def;if(n.parsedType!==D.array)return j(n,{code:I.invalid_type,expected:D.array,received:n.parsedType}),q;if(r.exactLength!==null){let a=n.data.length>r.exactLength.value,s=n.data.length<r.exactLength.value;(a||s)&&(j(n,{code:a?I.too_big:I.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&&(j(n,{code:I.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&&(j(n,{code:I.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 Jt(n,a,n.path,s)))).then(a=>it.mergeArray(i,a));let o=[...n.data].map((a,s)=>r.type._parseSync(new Jt(n,a,n.path,s)));return it.mergeArray(i,o)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:U.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:U.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:U.toString(n)}})}nonempty(t){return this.min(1,t)}};Yr.create=(e,t)=>new Yr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:P.ZodArray,...Q(t)});function gi(e){if(e instanceof Zt){let t={};for(let n in e.shape){let i=e.shape[n];t[n]=nr.create(gi(i))}return new Zt({...e._def,shape:()=>t})}else return e instanceof Yr?new Yr({...e._def,type:gi(e.element)}):e instanceof nr?nr.create(gi(e.unwrap())):e instanceof Ur?Ur.create(gi(e.unwrap())):e instanceof Cr?Cr.create(e.items.map(t=>gi(t))):e}var Zt=class e extends ie{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=le.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==D.object){let u=this._getOrReturnCtx(t);return j(u,{code:I.invalid_type,expected:D.object,received:u.parsedType}),q}let{status:i,ctx:r}=this._processInputParams(t),{shape:o,keys:a}=this._getCached(),s=[];if(!(this._def.catchall instanceof yr&&this._def.unknownKeys==="strip"))for(let u in r.data)a.includes(u)||s.push(u);let c=[];for(let u of a){let l=o[u],d=r.data[u];c.push({key:{status:"valid",value:u},value:l._parse(new Jt(r,d,r.path,u)),alwaysSet:u in r.data})}if(this._def.catchall instanceof yr){let u=this._def.unknownKeys;if(u==="passthrough")for(let l of s)c.push({key:{status:"valid",value:l},value:{status:"valid",value:r.data[l]}});else if(u==="strict")s.length>0&&(j(r,{code:I.unrecognized_keys,keys:s}),i.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let l of s){let d=r.data[l];c.push({key:{status:"valid",value:l},value:u._parse(new Jt(r,d,r.path,l)),alwaysSet:l in r.data})}}return r.common.async?Promise.resolve().then(async()=>{let u=[];for(let l of c){let d=await l.key,f=await l.value;u.push({key:d,value:f,alwaysSet:l.alwaysSet})}return u}).then(u=>it.mergeObjectSync(i,u)):it.mergeObjectSync(i,c)}get shape(){return this._def.shape()}strict(t){return U.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:U.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:P.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 le.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 le.objectKeys(this.shape))t[i]||(n[i]=this.shape[i]);return new e({...this._def,shape:()=>n})}deepPartial(){return gi(this)}partial(t){let n={};for(let i of le.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 le.objectKeys(this.shape))if(t&&!t[i])n[i]=this.shape[i];else{let o=this.shape[i];for(;o instanceof nr;)o=o._def.innerType;n[i]=o}return new e({...this._def,shape:()=>n})}keyof(){return v$(le.objectKeys(this.shape))}};Zt.create=(e,t)=>new Zt({shape:()=>e,unknownKeys:"strip",catchall:yr.create(),typeName:P.ZodObject,...Q(t)});Zt.strictCreate=(e,t)=>new Zt({shape:()=>e,unknownKeys:"strict",catchall:yr.create(),typeName:P.ZodObject,...Q(t)});Zt.lazycreate=(e,t)=>new Zt({shape:e,unknownKeys:"strip",catchall:yr.create(),typeName:P.ZodObject,...Q(t)});var $i=class extends ie{_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 Ut(s.ctx.common.issues));return j(n,{code:I.invalid_union,unionErrors:a}),q}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 u={...n,common:{...n.common,issues:[]},parent:null},l=c._parseSync({data:n.data,path:n.path,parent:u});if(l.status==="valid")return l;l.status==="dirty"&&!o&&(o={result:l,ctx:u}),u.common.issues.length&&a.push(u.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;let s=a.map(c=>new Ut(c));return j(n,{code:I.invalid_union,unionErrors:s}),q}}get options(){return this._def.options}};$i.create=(e,t)=>new $i({options:e,typeName:P.ZodUnion,...Q(t)});var Rr=e=>e instanceof wi?Rr(e.schema):e instanceof ir?Rr(e.innerType()):e instanceof xi?[e.value]:e instanceof ki?e.options:e instanceof Si?le.objectValues(e.enum):e instanceof Ii?Rr(e._def.innerType):e instanceof yi?[void 0]:e instanceof _i?[null]:e instanceof nr?[void 0,...Rr(e.unwrap())]:e instanceof Ur?[null,...Rr(e.unwrap())]:e instanceof Nc||e instanceof Pi?Rr(e.unwrap()):e instanceof zi?Rr(e._def.innerType):[],kp=class e extends ie{_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==D.object)return j(n,{code:I.invalid_type,expected:D.object,received:n.parsedType}),q;let i=this.discriminator,r=n.data[i],o=this.optionsMap.get(r);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):(j(n,{code:I.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),q)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,i){let r=new Map;for(let o of n){let a=Rr(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:P.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:r,...Q(i)})}};function Sp(e,t){let n=Dr(e),i=Dr(t);if(e===t)return{valid:!0,data:e};if(n===D.object&&i===D.object){let r=le.objectKeys(t),o=le.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=Sp(e[s],t[s]);if(!c.valid)return{valid:!1};a[s]=c.data}return{valid:!0,data:a}}else if(n===D.array&&i===D.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=Sp(a,s);if(!c.valid)return{valid:!1};r.push(c.data)}return{valid:!0,data:r}}else return n===D.date&&i===D.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var bi=class extends ie{_parse(t){let{status:n,ctx:i}=this._processInputParams(t),r=(o,a)=>{if(bp(o)||bp(a))return q;let s=Sp(o.value,a.value);return s.valid?((wp(o)||wp(a))&&n.dirty(),{status:n.value,value:s.data}):(j(i,{code:I.invalid_intersection_types}),q)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([o,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}))}};bi.create=(e,t,n)=>new bi({left:e,right:t,typeName:P.ZodIntersection,...Q(n)});var Cr=class e extends ie{_parse(t){let{status:n,ctx:i}=this._processInputParams(t);if(i.parsedType!==D.array)return j(i,{code:I.invalid_type,expected:D.array,received:i.parsedType}),q;if(i.data.length<this._def.items.length)return j(i,{code:I.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),q;!this._def.rest&&i.data.length>this._def.items.length&&(j(i,{code:I.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 Jt(i,a,i.path,s)):null}).filter(a=>!!a);return i.common.async?Promise.all(o).then(a=>it.mergeArray(n,a)):it.mergeArray(n,o)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};Cr.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Cr({items:e,typeName:P.ZodTuple,rest:null,...Q(t)})};var Ip=class e extends ie{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!==D.object)return j(i,{code:I.invalid_type,expected:D.object,received:i.parsedType}),q;let r=[],o=this._def.keyType,a=this._def.valueType;for(let s in i.data)r.push({key:o._parse(new Jt(i,s,i.path,s)),value:a._parse(new Jt(i,i.data[s],i.path,s)),alwaysSet:s in i.data});return i.common.async?it.mergeObjectAsync(n,r):it.mergeObjectSync(n,r)}get element(){return this._def.valueType}static create(t,n,i){return n instanceof ie?new e({keyType:t,valueType:n,typeName:P.ZodRecord,...Q(i)}):new e({keyType:vi.create(),valueType:t,typeName:P.ZodRecord,...Q(n)})}},ma=class extends ie{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!==D.map)return j(i,{code:I.invalid_type,expected:D.map,received:i.parsedType}),q;let r=this._def.keyType,o=this._def.valueType,a=[...i.data.entries()].map(([s,c],u)=>({key:r._parse(new Jt(i,s,i.path,[u,"key"])),value:o._parse(new Jt(i,c,i.path,[u,"value"]))}));if(i.common.async){let s=new Map;return Promise.resolve().then(async()=>{for(let c of a){let u=await c.key,l=await c.value;if(u.status==="aborted"||l.status==="aborted")return q;(u.status==="dirty"||l.status==="dirty")&&n.dirty(),s.set(u.value,l.value)}return{status:n.value,value:s}})}else{let s=new Map;for(let c of a){let u=c.key,l=c.value;if(u.status==="aborted"||l.status==="aborted")return q;(u.status==="dirty"||l.status==="dirty")&&n.dirty(),s.set(u.value,l.value)}return{status:n.value,value:s}}}};ma.create=(e,t,n)=>new ma({valueType:t,keyType:e,typeName:P.ZodMap,...Q(n)});var ha=class e extends ie{_parse(t){let{status:n,ctx:i}=this._processInputParams(t);if(i.parsedType!==D.set)return j(i,{code:I.invalid_type,expected:D.set,received:i.parsedType}),q;let r=this._def;r.minSize!==null&&i.data.size<r.minSize.value&&(j(i,{code:I.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&&(j(i,{code:I.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 u=new Set;for(let l of c){if(l.status==="aborted")return q;l.status==="dirty"&&n.dirty(),u.add(l.value)}return{status:n.value,value:u}}let s=[...i.data.values()].map((c,u)=>o._parse(new Jt(i,c,i.path,u)));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:U.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:U.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}};ha.create=(e,t)=>new ha({valueType:e,minSize:null,maxSize:null,typeName:P.ZodSet,...Q(t)});var zp=class e extends ie{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==D.function)return j(n,{code:I.invalid_type,expected:D.function,received:n.parsedType}),q;function i(s,c){return Ec({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,oa(),Wr].filter(u=>!!u),issueData:{code:I.invalid_arguments,argumentsError:c}})}function r(s,c){return Ec({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,oa(),Wr].filter(u=>!!u),issueData:{code:I.invalid_return_type,returnTypeError:c}})}let o={errorMap:n.common.contextualErrorMap},a=n.data;if(this._def.returns instanceof jn){let s=this;return ft(async function(...c){let u=new Ut([]),l=await s._def.args.parseAsync(c,o).catch(p=>{throw u.addIssue(i(c,p)),u}),d=await Reflect.apply(a,this,l);return await s._def.returns._def.type.parseAsync(d,o).catch(p=>{throw u.addIssue(r(d,p)),u})})}else{let s=this;return ft(function(...c){let u=s._def.args.safeParse(c,o);if(!u.success)throw new Ut([i(c,u.error)]);let l=Reflect.apply(a,this,u.data),d=s._def.returns.safeParse(l,o);if(!d.success)throw new Ut([r(l,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:Cr.create(t).rest(Xr.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||Cr.create([]).rest(Xr.create()),returns:n||Xr.create(),typeName:P.ZodFunction,...Q(i)})}},wi=class extends ie{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})}};wi.create=(e,t)=>new wi({getter:e,typeName:P.ZodLazy,...Q(t)});var xi=class extends ie{_parse(t){if(t.data!==this._def.value){let n=this._getOrReturnCtx(t);return j(n,{received:n.data,code:I.invalid_literal,expected:this._def.value}),q}return{status:"valid",value:t.data}}get value(){return this._def.value}};xi.create=(e,t)=>new xi({value:e,typeName:P.ZodLiteral,...Q(t)});function v$(e,t){return new ki({values:e,typeName:P.ZodEnum,...Q(t)})}var ki=class e extends ie{_parse(t){if(typeof t.data!="string"){let n=this._getOrReturnCtx(t),i=this._def.values;return j(n,{expected:le.joinValues(i),received:n.parsedType,code:I.invalid_type}),q}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 j(n,{received:n.data,code:I.invalid_enum_value,options:i}),q}return ft(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})}};ki.create=v$;var Si=class extends ie{_parse(t){let n=le.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(t);if(i.parsedType!==D.string&&i.parsedType!==D.number){let r=le.objectValues(n);return j(i,{expected:le.joinValues(r),received:i.parsedType,code:I.invalid_type}),q}if(this._cache||(this._cache=new Set(le.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let r=le.objectValues(n);return j(i,{received:i.data,code:I.invalid_enum_value,options:r}),q}return ft(t.data)}get enum(){return this._def.values}};Si.create=(e,t)=>new Si({values:e,typeName:P.ZodNativeEnum,...Q(t)});var jn=class extends ie{unwrap(){return this._def.type}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==D.promise&&n.common.async===!1)return j(n,{code:I.invalid_type,expected:D.promise,received:n.parsedType}),q;let i=n.parsedType===D.promise?n.data:Promise.resolve(n.data);return ft(i.then(r=>this._def.type.parseAsync(r,{path:n.path,errorMap:n.common.contextualErrorMap})))}};jn.create=(e,t)=>new jn({type:e,typeName:P.ZodPromise,...Q(t)});var ir=class extends ie{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===P.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=>{j(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 q;let c=await this._def.schema._parseAsync({data:s,path:i.path,parent:i});return c.status==="aborted"?q:c.status==="dirty"?hi(c.value):n.value==="dirty"?hi(c.value):c});{if(n.value==="aborted")return q;let s=this._def.schema._parseSync({data:a,path:i.path,parent:i});return s.status==="aborted"?q:s.status==="dirty"?hi(s.value):n.value==="dirty"?hi(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"?q:(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"?q:(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(!On(a))return q;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=>On(a)?Promise.resolve(r.transform(a.value,o)).then(s=>({status:n.value,value:s})):q);le.assertNever(r)}};ir.create=(e,t,n)=>new ir({schema:e,typeName:P.ZodEffects,effect:t,...Q(n)});ir.createWithPreprocess=(e,t,n)=>new ir({schema:t,effect:{type:"preprocess",transform:e},typeName:P.ZodEffects,...Q(n)});var nr=class extends ie{_parse(t){return this._getType(t)===D.undefined?ft(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};nr.create=(e,t)=>new nr({innerType:e,typeName:P.ZodOptional,...Q(t)});var Ur=class extends ie{_parse(t){return this._getType(t)===D.null?ft(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Ur.create=(e,t)=>new Ur({innerType:e,typeName:P.ZodNullable,...Q(t)});var Ii=class extends ie{_parse(t){let{ctx:n}=this._processInputParams(t),i=n.data;return n.parsedType===D.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};Ii.create=(e,t)=>new Ii({innerType:e,typeName:P.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Q(t)});var zi=class extends ie{_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 aa(r)?r.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Ut(i.common.issues)},input:i.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new Ut(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}};zi.create=(e,t)=>new zi({innerType:e,typeName:P.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Q(t)});var ga=class extends ie{_parse(t){if(this._getType(t)!==D.nan){let i=this._getOrReturnCtx(t);return j(i,{code:I.invalid_type,expected:D.nan,received:i.parsedType}),q}return{status:"valid",value:t.data}}};ga.create=e=>new ga({typeName:P.ZodNaN,...Q(e)});var Nc=class extends ie{_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}},Ac=class e extends ie{_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"?q:o.status==="dirty"?(n.dirty(),hi(o.value)):this._def.out._parseAsync({data:o.value,path:i.path,parent:i})})();{let r=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return r.status==="aborted"?q:r.status==="dirty"?(n.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:i.path,parent:i})}}static create(t,n){return new e({in:t,out:n,typeName:P.ZodPipeline})}},Pi=class extends ie{_parse(t){let n=this._def.innerType._parse(t),i=r=>(On(r)&&(r.value=Object.freeze(r.value)),r);return aa(n)?n.then(r=>i(r)):i(n)}unwrap(){return this._def.innerType}};Pi.create=(e,t)=>new Pi({innerType:e,typeName:P.ZodReadonly,...Q(t)});var mM={object:Zt.lazycreate},P;(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"})(P||(P={}));var hM=vi.create,gM=sa.create,vM=ga.create,yM=ca.create,_M=ua.create,$M=la.create,bM=da.create,wM=yi.create,xM=_i.create,kM=fa.create,SM=Xr.create,IM=yr.create,zM=pa.create,PM=Yr.create,y$=Zt.create,TM=Zt.strictCreate,OM=$i.create,jM=kp.create,EM=bi.create,NM=Cr.create,AM=Ip.create,DM=ma.create,RM=ha.create,CM=zp.create,UM=wi.create,ZM=xi.create,MM=ki.create,LM=Si.create,VM=jn.create,FM=ir.create,qM=nr.create,BM=Ur.create,JM=ir.createWithPreprocess,HM=Ac.create;var sr={};Ar(sr,{$ZodAny:()=>Vu,$ZodArray:()=>Hu,$ZodAsyncError:()=>St,$ZodBase64:()=>Iu,$ZodBase64URL:()=>Pu,$ZodBigInt:()=>Ua,$ZodBigIntFormat:()=>Uu,$ZodBoolean:()=>Hi,$ZodCIDRv4:()=>wu,$ZodCIDRv6:()=>ku,$ZodCUID:()=>mu,$ZodCUID2:()=>hu,$ZodCatch:()=>dl,$ZodCheck:()=>we,$ZodCheckBigIntFormat:()=>Nm,$ZodCheckEndsWith:()=>Bm,$ZodCheckGreaterThan:()=>Qc,$ZodCheckIncludes:()=>Fm,$ZodCheckLengthEquals:()=>Zm,$ZodCheckLessThan:()=>Yc,$ZodCheckLowerCase:()=>Lm,$ZodCheckMaxLength:()=>Cm,$ZodCheckMaxSize:()=>Am,$ZodCheckMimeType:()=>Km,$ZodCheckMinLength:()=>Um,$ZodCheckMinSize:()=>Dm,$ZodCheckMultipleOf:()=>jm,$ZodCheckNumberFormat:()=>Em,$ZodCheckOverwrite:()=>Gm,$ZodCheckProperties:()=>Hm,$ZodCheckProperty:()=>Jm,$ZodCheckRegex:()=>Mm,$ZodCheckSizeEquals:()=>Rm,$ZodCheckStartsWith:()=>qm,$ZodCheckStringFormat:()=>Bi,$ZodCheckUpperCase:()=>Vm,$ZodCodec:()=>Gi,$ZodCreditCard:()=>ju,$ZodCustom:()=>vl,$ZodCustomStringFormat:()=>Ru,$ZodCyclicError:()=>bl,$ZodDate:()=>Ju,$ZodDefault:()=>sl,$ZodDiscriminatedUnion:()=>Wu,$ZodE164:()=>Tu,$ZodEmail:()=>su,$ZodEmoji:()=>fu,$ZodEncodeError:()=>en,$ZodEnum:()=>tl,$ZodError:()=>Bp,$ZodExactOptional:()=>ol,$ZodFile:()=>nl,$ZodFunction:()=>hl,$ZodGUID:()=>ou,$ZodIBAN:()=>Nu,$ZodIPv4:()=>_u,$ZodIPv6:()=>$u,$ZodISODate:()=>th,$ZodISODateTime:()=>eh,$ZodISODuration:()=>nh,$ZodISOTime:()=>rh,$ZodIntersection:()=>Xu,$ZodJWT:()=>Du,$ZodKSUID:()=>yu,$ZodLazy:()=>Wi,$ZodLiteral:()=>rl,$ZodMAC:()=>bu,$ZodMap:()=>Qu,$ZodNaN:()=>fl,$ZodNanoID:()=>pu,$ZodNever:()=>qu,$ZodNonOptional:()=>ul,$ZodNull:()=>Lu,$ZodNullable:()=>al,$ZodNumber:()=>Ca,$ZodNumberFormat:()=>Cu,$ZodObject:()=>Ku,$ZodObjectJIT:()=>oh,$ZodOptional:()=>Ma,$ZodPipe:()=>La,$ZodPrefault:()=>cl,$ZodPreprocess:()=>sh,$ZodPromise:()=>gl,$ZodReadonly:()=>pl,$ZodRealError:()=>It,$ZodRecord:()=>Yu,$ZodRegistry:()=>zl,$ZodSet:()=>el,$ZodString:()=>tn,$ZodStringFormat:()=>ye,$ZodSuccess:()=>ll,$ZodSymbol:()=>Zu,$ZodTemplateLiteral:()=>ml,$ZodTransform:()=>il,$ZodTuple:()=>Za,$ZodType:()=>K,$ZodULID:()=>gu,$ZodURL:()=>du,$ZodUUID:()=>au,$ZodUndefined:()=>Mu,$ZodUnion:()=>Ki,$ZodUnknown:()=>Fu,$ZodVoid:()=>Bu,$ZodXID:()=>vu,$ZodXor:()=>Gu,$brand:()=>Vp,$constructor:()=>v,$input:()=>dh,$output:()=>lh,Doc:()=>Un,INVALID:()=>ht,JSONSchema:()=>ex,JSONSchemaGenerator:()=>gd,NEVER:()=>Lp,TimePrecision:()=>_h,URL_BAD_FORMAT:()=>Ym,URL_UNPARSEABLE:()=>Ea,ZodCompileAsyncError:()=>or,ZodCompileUnsupportedError:()=>se,_any:()=>Gl,_array:()=>kh,_base64:()=>us,_base64url:()=>ls,_bigint:()=>Fl,_boolean:()=>Vl,_catch:()=>Zj,_check:()=>Uw,_cidrv4:()=>ss,_cidrv6:()=>cs,_coercedBigint:()=>wh,_coercedBoolean:()=>bh,_coercedDate:()=>xh,_coercedNumber:()=>$h,_coercedString:()=>yh,_creditCard:()=>Al,_cuid:()=>es,_cuid2:()=>ts,_custom:()=>sd,_date:()=>Ql,_decode:()=>Lc,_decodeAsync:()=>Fc,_default:()=>Rj,_discriminatedUnion:()=>kj,_e164:()=>ds,_email:()=>Ja,_emoji:()=>Ya,_encode:()=>Mc,_encodeAsync:()=>Vc,_endsWith:()=>so,_enum:()=>Oj,_file:()=>ad,_float32:()=>Ul,_float64:()=>Zl,_gt:()=>br,_gte:()=>Vt,_guid:()=>Ha,_iban:()=>Dl,_includes:()=>oo,_int:()=>Cl,_int32:()=>Ml,_int64:()=>ql,_intersection:()=>Sj,_ipv4:()=>os,_ipv6:()=>as,_isoDate:()=>ms,_isoDateTime:()=>ps,_isoDuration:()=>gs,_isoTime:()=>hs,_jwt:()=>fs,_ksuid:()=>is,_lazy:()=>Fj,_length:()=>qn,_literal:()=>Ej,_lowercase:()=>no,_lt:()=>$r,_lte:()=>Lt,_mac:()=>Nl,_map:()=>Pj,_max:()=>Lt,_maxLength:()=>Fn,_maxSize:()=>on,_mime:()=>uo,_min:()=>Vt,_minLength:()=>Vr,_minSize:()=>wr,_multipleOf:()=>nn,_nan:()=>ed,_nanoid:()=>Qa,_nativeEnum:()=>jj,_negative:()=>rd,_never:()=>Xl,_nonnegative:()=>id,_nonoptional:()=>Cj,_nonpositive:()=>nd,_normalize:()=>lo,_null:()=>Kl,_nullable:()=>Dj,_number:()=>Rl,_optional:()=>Aj,_overwrite:()=>ar,_parse:()=>Ci,_parseAsync:()=>Ui,_pipe:()=>Mj,_positive:()=>td,_promise:()=>qj,_properties:()=>co,_property:()=>od,_readonly:()=>Lj,_record:()=>zj,_refine:()=>cd,_regex:()=>ro,_safeDecode:()=>Bc,_safeDecodeAsync:()=>Hc,_safeEncode:()=>qc,_safeEncodeAsync:()=>Jc,_safeParse:()=>Zi,_safeParseAsync:()=>Li,_set:()=>Tj,_size:()=>Vn,_slugify:()=>ho,_startsWith:()=>ao,_string:()=>El,_stringFormat:()=>an,_stringbool:()=>fd,_success:()=>Uj,_superRefine:()=>ud,_symbol:()=>Jl,_templateLiteral:()=>Vj,_toLowerCase:()=>po,_toUpperCase:()=>mo,_transform:()=>Nj,_trim:()=>fo,_tuple:()=>Ij,_uint32:()=>Ll,_uint64:()=>Bl,_ulid:()=>rs,_undefined:()=>Hl,_union:()=>wj,_unknown:()=>Wl,_uppercase:()=>io,_url:()=>to,_uuid:()=>Ka,_uuidv4:()=>Ga,_uuidv6:()=>Wa,_uuidv7:()=>Xa,_void:()=>Yl,_xid:()=>ns,_xor:()=>xj,base64Charset:()=>Su,base64urlCharset:()=>Ra,canParseURL:()=>Qm,clone:()=>he,compile:()=>hh,compileFn:()=>Ol,config:()=>Ce,createStandardJSONSchemaMethod:()=>go,createToJSONSchemaMethod:()=>Ih,decode:()=>Z$,decodeAsync:()=>L$,describe:()=>ld,encode:()=>U$,encodeAsync:()=>M$,extractDefs:()=>cn,finalize:()=>un,flattenError:()=>Ia,formatError:()=>za,getDiscriminatedOption:()=>ah,globalConfig:()=>Be,globalRegistry:()=>We,handleUnrepresentable:()=>Ve,initializeContext:()=>sn,isBackEdge:()=>xl,isRecursiveSchema:()=>wl,isValidBase64:()=>Da,isValidBase64URL:()=>zu,isValidCIDRv6:()=>xu,isValidCreditCard:()=>Ou,isValidIBAN:()=>Eu,isValidIPv6:()=>Aa,isValidJWT:()=>Au,locales:()=>Qi,memoizer:()=>qa,mergeValues:()=>Ji,meta:()=>dd,parse:()=>Dn,parseAsync:()=>Rn,parseURLObject:()=>db,prettifyError:()=>Hp,process:()=>$e,processSchema:()=>$e,regexes:()=>Mt,registry:()=>Pl,safeDecode:()=>F$,safeDecodeAsync:()=>B$,safeEncode:()=>V$,safeEncodeAsync:()=>q$,safeParse:()=>Mi,safeParseAsync:()=>Vi,standardProps:()=>iu,stripTabAndNewline:()=>Na,toDotPath:()=>R$,toJSONSchema:()=>Bn,toZod:()=>va,treeifyError:()=>Jp,urlHostnameOk:()=>uu,urlProtocolOk:()=>lu,util:()=>w,validate:()=>Fi,validateAsync:()=>qi,validateURL:()=>cu,version:()=>Wm,withParser:()=>Tl});var w={};Ar(w,{BIGINT_FORMAT_RANGES:()=>ba,CONSTANT_CATCH:()=>Uc,Class:()=>Op,NUMBER_FORMAT_RANGES:()=>$a,aborted:()=>mt,allowsEval:()=>Np,assert:()=>tT,assertEqual:()=>XP,assertIs:()=>QP,assertNever:()=>eT,assertNotEqual:()=>YP,assignProp:()=>Ge,attachSchema:()=>wa,base64ToUint8Array:()=>O$,base64urlToUint8Array:()=>pT,cached:()=>Ei,captureStackTrace:()=>Rc,cleanEnum:()=>fT,cleanRegex:()=>Mr,clone:()=>he,cloneDef:()=>iT,codePointLength:()=>An,constantCatch:()=>Zp,createTransparentProxy:()=>lT,defineLazy:()=>jp,defineLazyInternal:()=>te,derived:()=>vT,esc:()=>pt,escapeRegex:()=>Gt,explicitlyAborted:()=>Rp,extend:()=>k$,finalizeIssue:()=>kt,floatSafeRemainder:()=>ya,getElementAtPath:()=>oT,getEnumValues:()=>Oi,getLengthableOrigin:()=>ka,getParsedType:()=>uT,getSizableOrigin:()=>xa,hexToUint8Array:()=>hT,hide:()=>Sa,installLazyProp:()=>Up,isObject:()=>Nn,isPlainObject:()=>Kt,issue:()=>Ri,joinValues:()=>y,jsonStringifyReplacer:()=>ji,members:()=>Cp,merge:()=>z$,mergeDefs:()=>Ht,normalizeParams:()=>z,nullish:()=>Dc,numKeys:()=>cT,objectClone:()=>rT,omit:()=>x$,optionalKeys:()=>Dp,own:()=>_r,parsedType:()=>S,partial:()=>P$,pick:()=>w$,prefixIssues:()=>xt,primitiveTypes:()=>Ap,promiseAllObject:()=>aT,propertyKeyTypes:()=>_a,randomString:()=>sT,rawShape:()=>Ni,required:()=>T$,safeExtend:()=>I$,shallowClone:()=>Ai,sizeCaps:()=>Di,slugify:()=>Ep,stringifyPrimitive:()=>x,toZod:()=>va,uint8ArrayToBase64:()=>j$,uint8ArrayToBase64url:()=>mT,uint8ArrayToHex:()=>gT,unwrapMessage:()=>Ti});function XP(e){return e}function YP(e){return e}function va(){return e=>e}function QP(e){}function eT(e){throw new Error("Unexpected value in exhaustive check")}function tT(e){}function Oi(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 y(e,t="|"){return e.map(n=>x(n)).join(t)}function ji(e,t){return typeof t=="bigint"?t.toString():t}var Tp=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 Ei(e){return new Tp(e)}function Dc(e){return e==null}function Mr(e){let t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function ya(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 _$=Symbol("evaluating");function jp(e,t,n){let i;Object.defineProperty(e,t,{get(){if(i!==_$)return i===void 0&&(i=_$,i=n()),i},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function rT(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Ge(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Ni(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function Zr(e){return Ni(e._zod.def)??e._zod.def.shape}function $$(e,t,n){Object.defineProperty(e,t,{get(){let i=n();return Ge(this,t,i),i},enumerable:!0,configurable:!0})}function b$(e,t,n){t in e?Ge(e,t,n):e[t]=n}function En(e,t,n,i){let r=Zr(t);for(let o of n){let a=Object.getOwnPropertyDescriptor(r,o);a.enumerable&&(a.get?$$(e,o,()=>{let s=t._zod.def.shape[o];return i?i(s,o):s}):b$(e,o,i?i(a.value,o):a.value))}}function nT(e,t){for(let n of Reflect.ownKeys(t)){let i=Object.getOwnPropertyDescriptor(t,n);i.enumerable&&(i.get?$$(e,n,()=>t[n]):b$(e,n,i.value))}}function Ht(...e){let t={};for(let n of e){let i=Object.getOwnPropertyDescriptors(n);Object.assign(t,i)}return Object.defineProperties({},t)}function iT(e){return Ht(e._zod.def)}function oT(e,t){return t?t.reduce((n,i)=>n?.[i],e):e}function aT(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 sT(e=10){let t="abcdefghijklmnopqrstuvwxyz",n="";for(let i=0;i<e;i++)n+=t[Math.floor(Math.random()*t.length)];return n}function pt(e){return JSON.stringify(e)}function Ep(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Rc="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Nn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Np=Ei(()=>{if(Be.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Kt(e){if(Nn(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let n=t.prototype;return!(Nn(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function Ai(e){return Kt(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function cT(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}var uT=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}`)}},_a=new Set(["string","number","symbol"]),Ap=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Gt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function he(e,t,n){let i=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(i._zod.parent=e),i}function z(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 lT(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 x(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function Dp(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var $a={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},ba={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function w$(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 En(o,e,Cc(e,t)),he(e,Ht(n,{shape:o,checks:[]}))}function Cc(e,t){let n=Zr(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 x$(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(Cc(e,t)),a={};return En(a,e,Reflect.ownKeys(Zr(e)).filter(s=>!o.has(s))),he(e,Ht(n,{shape:a,checks:[]}))}function k$(e,t){if(!Kt(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=Zr(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 he(e,Ht(e._zod.def,{shape:S$(e,t)}))}function S$(e,t){let n={};return En(n,e,Reflect.ownKeys(Zr(e))),nT(n,t),n}function I$(e,t){if(!Kt(t))throw new Error("Invalid input to safeExtend: expected a plain object");return he(e,Ht(e._zod.def,{shape:S$(e,t)}))}function z$(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={};En(n,e,Reflect.ownKeys(Zr(e))),En(n,t,Reflect.ownKeys(Zr(t)));let i=Ht(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return he(e,i)}function P$(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(Cc(t,n)):void 0,c={};return En(c,t,Reflect.ownKeys(Zr(t)),e&&((u,l)=>s&&!s.has(l)?u:new e({type:"optional",innerType:u}))),he(t,Ht(t._zod.def,{shape:c,checks:[]}))}function T$(e,t,n){let i=n?new Set(Cc(t,n)):void 0,r={};return En(r,t,Reflect.ownKeys(Zr(t)),(o,a)=>i&&!i.has(a)?o:new e({type:"nonoptional",innerType:o})),he(t,Ht(t._zod.def,{shape:r}))}function mt(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 Rp(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 xt(e,t){return t.map(n=>{var i;return(i=n).path??(i.path=[]),n.path.unshift(e),n})}function Ti(e){return typeof e=="string"?e:e?.message}function Di(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 wa(e,t,n){var i;for(let r=t;r<e.length;r++)(i=e[r]).schema??(i.schema=n)}function kt(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:Ti(e.inst?._zod.def?.error?.(e))??Ti(o?.(e))??Ti(t?.error?.(e))??Ti(n.customError?.(e))??Ti(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 xa(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}var dT=/[\uD800-\uDBFF]/;function An(e){let t=e.length;if(!dT.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 ka(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function S(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 Ri(...e){let[t,n,i]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:i}:{...t}}function fT(e){return Object.entries(e).filter(([t,n])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function O$(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 j$(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function pT(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-t.length%4)%4);return O$(t+n)}function mT(e){return j$(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function hT(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 gT(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var Op=class{constructor(...t){}};function Cp(e,t){for(let n in t){let i=Object.getOwnPropertyDescriptor(t,n);i.get?Object.defineProperty(e,n,{...i,enumerable:!1}):yT(e,n,i.value)}}function _r(e,t,n,i=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:i,value:n}),n}function Sa(e,t,n){return _r(e,t,n,!1)}function vT(e,t){for(let n in e){let i=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return _r(this,n,i(this))},set(r){_r(this,n,r)}})}return t}function yT(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:_r(this,t,n.bind(this))},set(i){_r(this,t,i)}})}function _T(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}var Pp,Qr=!1,$T={configurable:!0,get(){Qr=!0}};function te(e,t,n){let i=Object.getPrototypeOf(e._zod);if(t in i&&Pp!==e._zod){Pp=void 0;return}Pp=e._zod,Object.defineProperty(i,t,{configurable:!0,get(){Object.defineProperty(this,t,$T);let r=Qr;Qr=!1;try{let o=n(this);return Qr?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:o}),Qr=Qr||r,o}catch(o){throw delete this[t],Qr=Qr||r,o}},set(r){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r})}})}function Up(e,t,n,i){let r=_T(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 Uc="~constantCatch";function Zp(e){let t=()=>e;return t[Uc]=!0,t}var E$,Lp=Object.freeze({status:"aborted"}),Mp={value:void 0,enumerable:!1},N$="captureStackTrace"in Error?Error:null;function bT(e){let t=N$;if(t){let n=t.stackTraceLimit;if(typeof n=="number"){try{t.stackTraceLimit=0}catch{return N$=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function v(e,t,n,i){let r={};function o(f){this.def=f,this.constr=d,this.traits=new Set}o.prototype=r;let a=n,s=a&&new WeakSet;function c(f,p){if(f._zod){if(f._zod.traits.has(e))return}else{Mp.value=new o(p);try{Object.defineProperty(f,"_zod",Mp)}finally{Mp.value=void 0}}if(f._zod.traits.add(e),t(f,p),s){let h=Object.getPrototypeOf(f),g=f._zod.constr.prototype,_=h;for(;_&&_!==g;)_=Object.getPrototypeOf(_);let $=_??h;s.has($)||(s.add($),Cp($,a))}let m=d.prototype;for(let h in m)Object.prototype.hasOwnProperty.call(m,h)&&(h in f||(f[h]=m[h].bind(f)))}let u=i?.Parent??Object;class l extends u{}Object.defineProperty(l,"name",{value:e});function d(f){let p=i?.Parent?bT(l):this;c(p,f);let m=p._zod.deferred;if(m){for(let g of m)g();p._zod.deferred=void 0}let h=globalThis.__zod_globalConfig?.postProcessor;return h&&h(p),p}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:f=>i?.Parent&&f instanceof i.Parent?!0:f?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var Vp=Symbol("zod_brand"),St=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},en=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(E$=globalThis).__zod_globalConfig??(E$.__zod_globalConfig={});var Be=globalThis.__zod_globalConfig;function Ce(e){return e&&Object.assign(Be,e),Be}function wT(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,ji,2)),e.message}function xT(e){this._zod.message=e}var kT={get:wT,set:xT,enumerable:!0,configurable:!0},qp={value:void 0,enumerable:!1},A$=new WeakSet([Object.prototype,Error.prototype]),D$=(e,t)=>{e.name="$ZodError",qp.value=t,Object.defineProperty(e,"issues",qp),qp.value=void 0,Object.defineProperty(e,"message",kT);let n=Object.getPrototypeOf(e);A$.has(n)||(A$.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})}}))},Bp=v("$ZodError",D$),It=v("$ZodError",D$,void 0,{Parent:Error});function ST(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 Ia(e,t=n=>n.message){let n={},i=[];for(let r of e.issues)r.path.length>0?ST(n,r.path[0],()=>[]).push(t(r)):i.push(t(r));return{formErrors:i,fieldErrors:n}}function za(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,u=0;for(;u<s.length;){let l=s[u],d=u===s.length-1;if(l==="_errors"){d&&c._errors.push(t(a)),u++;continue}Object.prototype.hasOwnProperty.call(c,l)||Object.defineProperty(c,l,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let f=c[l];d&&f._errors.push(t(a)),c=f,u++}}}};return i(e),n}function Jp(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 u=n,l=0;for(;l<c.length;){let d=c[l],f=l===c.length-1;typeof d=="string"?(u.properties??(u.properties={}),Object.prototype.hasOwnProperty.call(u.properties,d)||Object.defineProperty(u.properties,d,{value:{errors:[]},enumerable:!0,writable:!0,configurable:!0}),u=u.properties[d]):(u.items??(u.items=[]),(a=u.items)[d]??(a[d]={errors:[]}),u=u.items[d]),f&&u.errors.push(t(s)),l++}}};return i(e),n}function R$(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 Hp(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 ${R$(i.path)}`);return t.join(`
|
|
10
|
+
deps: ${n}}`};var WC={keyword:"dependencies",type:"object",schemaType:"object",error:zr.error,code(e){let[t,n]=XC(e);DI(e,t),RI(e,n)}};function XC({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 DI(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,vc.propertyInData)(n,i,a,r.opts.ownProperties);e.setParams({property:a,depsCount:s.length,deps:s.join(", ")}),r.allErrors?n.if(c,()=>{for(let u of s)(0,vc.checkReportMissingProp)(e,u)}):(n.if((0,p_._)`${c} && (${(0,vc.checkMissingProp)(e,s,o)})`),(0,vc.reportMissingProp)(e,o),n.else())}}zr.validatePropertyDeps=DI;function RI(e,t=e.schema){let{gen:n,data:i,keyword:r,it:o}=e,a=n.name("valid");for(let s in t)(0,GC.alwaysValidSchema)(o,t[s])||(n.if((0,vc.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))}zr.validateSchemaDeps=RI;zr.default=WC});var ZI=N(m_=>{"use strict";Object.defineProperty(m_,"__esModule",{value:!0});var UI=ne(),YC=pe(),QC={message:"property name must be valid",params:({params:e})=>(0,UI._)`{propertyName: ${e.propertyName}}`},e6={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:QC,code(e){let{gen:t,schema:n,data:i,it:r}=e;if((0,YC.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,UI.not)(o),()=>{e.error(!0),r.allErrors||t.break()})}),e.ok(o)}};m_.default=e6});var g_=N(h_=>{"use strict";Object.defineProperty(h_,"__esModule",{value:!0});var Wf=Qt(),pr=ne(),t6=Br(),Xf=pe(),r6={message:"must NOT have additional properties",params:({params:e})=>(0,pr._)`{additionalProperty: ${e.additionalProperty}}`},n6={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:r6,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,Xf.alwaysValidSchema)(a,n))return;let u=(0,Wf.allSchemaProperties)(i.properties),l=(0,Wf.allSchemaProperties)(i.patternProperties);d(),e.ok((0,pr._)`${o} === ${t6.default.errors}`);function d(){t.forIn("key",r,g=>{!u.length&&!l.length?m(g):t.if(f(g),()=>m(g))})}function f(g){let _;if(u.length>8){let $=(0,Xf.schemaRefOrVal)(a,i.properties,"properties");_=(0,Wf.isOwnProperty)(t,$,g)}else u.length?_=(0,pr.or)(...u.map($=>(0,pr._)`${g} === ${$}`)):_=pr.nil;return l.length&&(_=(0,pr.or)(_,...l.map($=>(0,pr._)`${(0,Wf.usePattern)(e,$)}.test(${g})`))),(0,pr.not)(_)}function p(g){t.code((0,pr._)`delete ${r}[${g}]`)}function m(g){if(c.removeAdditional==="all"||c.removeAdditional&&n===!1){p(g);return}if(n===!1){e.setParams({additionalProperty:g}),e.error(),s||t.break();return}if(typeof n=="object"&&!(0,Xf.alwaysValidSchema)(a,n)){let _=t.name("valid");c.removeAdditional==="failing"?(h(g,_,!1),t.if((0,pr.not)(_),()=>{e.reset(),p(g)})):(h(g,_),s||t.if((0,pr.not)(_),()=>t.break()))}}function h(g,_,$){let k={keyword:"additionalProperties",dataProp:g,dataPropType:Xf.Type.Str};$===!1&&Object.assign(k,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(k,_)}}};h_.default=n6});var VI=N(y_=>{"use strict";Object.defineProperty(y_,"__esModule",{value:!0});var i6=rc(),MI=Qt(),v_=pe(),LI=g_(),o6={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&&LI.default.code(new i6.KeywordCxt(o,LI.default,"additionalProperties"));let a=(0,MI.allSchemaProperties)(n);for(let d of a)o.definedProperties.add(d);o.opts.unevaluated&&a.length&&o.props!==!0&&(o.props=v_.mergeEvaluated.props(t,(0,v_.toHash)(a),o.props));let s=a.filter(d=>!(0,v_.alwaysValidSchema)(o,n[d]));if(s.length===0)return;let c=t.name("valid");for(let d of s)u(d)?l(d):(t.if((0,MI.propertyInData)(t,r,d,o.opts.ownProperties)),l(d),o.allErrors||t.else().var(c,!0),t.endIf()),e.it.definedProperties.add(d),e.ok(c);function u(d){return o.opts.useDefaults&&!o.compositeRule&&n[d].default!==void 0}function l(d){e.subschema({keyword:"properties",schemaProp:d,dataProp:d},c)}}};y_.default=o6});var JI=N(__=>{"use strict";Object.defineProperty(__,"__esModule",{value:!0});var FI=Qt(),Yf=ne(),qI=pe(),BI=pe(),a6={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,FI.allSchemaProperties)(n),c=s.filter(h=>(0,qI.alwaysValidSchema)(o,n[h]));if(s.length===0||c.length===s.length&&(!o.opts.unevaluated||o.props===!0))return;let u=a.strictSchema&&!a.allowMatchingProperties&&r.properties,l=t.name("valid");o.props!==!0&&!(o.props instanceof Yf.Name)&&(o.props=(0,BI.evaluatedPropsToName)(t,o.props));let{props:d}=o;f();function f(){for(let h of s)u&&p(h),o.allErrors?m(h):(t.var(l,!0),m(h),t.if(l))}function p(h){for(let g in u)new RegExp(h).test(g)&&(0,qI.checkStrictMode)(o,`property ${g} matches pattern ${h} (use allowMatchingProperties)`)}function m(h){t.forIn("key",i,g=>{t.if((0,Yf._)`${(0,FI.usePattern)(e,h)}.test(${g})`,()=>{let _=c.includes(h);_||e.subschema({keyword:"patternProperties",schemaProp:h,dataProp:g,dataPropType:BI.Type.Str},l),o.opts.unevaluated&&d!==!0?t.assign((0,Yf._)`${d}[${g}]`,!0):!_&&!o.allErrors&&t.if((0,Yf.not)(l),()=>t.break())})})}}};__.default=a6});var HI=N($_=>{"use strict";Object.defineProperty($_,"__esModule",{value:!0});var s6=pe(),c6={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:n,it:i}=e;if((0,s6.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"}};$_.default=c6});var KI=N(b_=>{"use strict";Object.defineProperty(b_,"__esModule",{value:!0});var u6=Qt(),l6={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:u6.validateUnion,error:{message:"must match a schema in anyOf"}};b_.default=l6});var GI=N(w_=>{"use strict";Object.defineProperty(w_,"__esModule",{value:!0});var Qf=ne(),d6=pe(),f6={message:"must match exactly one schema in oneOf",params:({params:e})=>(0,Qf._)`{passingSchemas: ${e.passing}}`},p6={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:f6,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(u),e.result(a,()=>e.reset(),()=>e.error(!0));function u(){o.forEach((l,d)=>{let f;(0,d6.alwaysValidSchema)(r,l)?t.var(c,!0):f=e.subschema({keyword:"oneOf",schemaProp:d,compositeRule:!0},c),d>0&&t.if((0,Qf._)`${c} && ${a}`).assign(a,!1).assign(s,(0,Qf._)`[${s}, ${d}]`).else(),t.if(c,()=>{t.assign(a,!0),t.assign(s,d),f&&e.mergeEvaluated(f,Qf.Name)})})}}};w_.default=p6});var WI=N(x_=>{"use strict";Object.defineProperty(x_,"__esModule",{value:!0});var m6=pe(),h6={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,m6.alwaysValidSchema)(i,o))return;let s=e.subschema({keyword:"allOf",schemaProp:a},r);e.ok(r),e.mergeEvaluated(s)})}};x_.default=h6});var QI=N(k_=>{"use strict";Object.defineProperty(k_,"__esModule",{value:!0});var ep=ne(),YI=pe(),g6={message:({params:e})=>(0,ep.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,ep._)`{failingKeyword: ${e.ifClause}}`},v6={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:g6,code(e){let{gen:t,parentSchema:n,it:i}=e;n.then===void 0&&n.else===void 0&&(0,YI.checkStrictMode)(i,'"if" without "then" and "else" is ignored');let r=XI(i,"then"),o=XI(i,"else");if(!r&&!o)return;let a=t.let("valid",!0),s=t.name("_valid");if(c(),e.reset(),r&&o){let l=t.let("ifClause");e.setParams({ifClause:l}),t.if(s,u("then",l),u("else",l))}else r?t.if(s,u("then")):t.if((0,ep.not)(s),u("else"));e.pass(a,()=>e.error(!0));function c(){let l=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},s);e.mergeEvaluated(l)}function u(l,d){return()=>{let f=e.subschema({keyword:l},s);t.assign(a,s),e.mergeValidEvaluated(f,a),d?t.assign(d,(0,ep._)`${l}`):e.setParams({ifClause:l})}}}};function XI(e,t){let n=e.schema[t];return n!==void 0&&!(0,YI.alwaysValidSchema)(e,n)}k_.default=v6});var ez=N(S_=>{"use strict";Object.defineProperty(S_,"__esModule",{value:!0});var y6=pe(),_6={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:n}){t.if===void 0&&(0,y6.checkStrictMode)(n,`"${e}" without "if" is ignored`)}};S_.default=_6});var tz=N(I_=>{"use strict";Object.defineProperty(I_,"__esModule",{value:!0});var $6=c_(),b6=jI(),w6=u_(),x6=NI(),k6=AI(),S6=CI(),I6=ZI(),z6=g_(),P6=VI(),T6=JI(),O6=HI(),j6=KI(),E6=GI(),N6=WI(),A6=QI(),D6=ez();function R6(e=!1){let t=[O6.default,j6.default,E6.default,N6.default,A6.default,D6.default,I6.default,z6.default,S6.default,P6.default,T6.default];return e?t.push(b6.default,x6.default):t.push($6.default,w6.default),t.push(k6.default),t}I_.default=R6});var rz=N(z_=>{"use strict";Object.defineProperty(z_,"__esModule",{value:!0});var Le=ne(),C6={message:({schemaCode:e})=>(0,Le.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,Le._)`{format: ${e}}`},U6={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:C6,code(e,t){let{gen:n,data:i,$data:r,schema:o,schemaCode:a,it:s}=e,{opts:c,errSchemaPath:u,schemaEnv:l,self:d}=s;if(!c.validateFormats)return;r?f():p();function f(){let m=n.scopeValue("formats",{ref:d.formats,code:c.code.formats}),h=n.const("fDef",(0,Le._)`${m}[${a}]`),g=n.let("fType"),_=n.let("format");n.if((0,Le._)`typeof ${h} == "object" && !(${h} instanceof RegExp)`,()=>n.assign(g,(0,Le._)`${h}.type || "string"`).assign(_,(0,Le._)`${h}.validate`),()=>n.assign(g,(0,Le._)`"string"`).assign(_,h)),e.fail$data((0,Le.or)($(),k()));function $(){return c.strictSchema===!1?Le.nil:(0,Le._)`${a} && !${_}`}function k(){let O=l.$async?(0,Le._)`(${h}.async ? await ${_}(${i}) : ${_}(${i}))`:(0,Le._)`${_}(${i})`,T=(0,Le._)`(typeof ${_} == "function" ? ${O} : ${_}.test(${i}))`;return(0,Le._)`${_} && ${_} !== true && ${g} === ${t} && !${T}`}}function p(){let m=d.formats[o];if(!m){$();return}if(m===!0)return;let[h,g,_]=k(m);h===t&&e.pass(O());function $(){if(c.strictSchema===!1){d.logger.warn(T());return}throw new Error(T());function T(){return`unknown format "${o}" ignored in schema at path "${u}"`}}function k(T){let C=T instanceof RegExp?(0,Le.regexpCode)(T):c.code.formats?(0,Le._)`${c.code.formats}${(0,Le.getProperty)(o)}`:void 0,H=n.scopeValue("formats",{key:o,ref:T,code:C});return typeof T=="object"&&!(T instanceof RegExp)?[T.type||"string",T.validate,(0,Le._)`${H}.validate`]:["string",T,H]}function O(){if(typeof m=="object"&&!(m instanceof RegExp)&&m.async){if(!l.$async)throw new Error("async format in sync schema");return(0,Le._)`await ${_}(${i})`}return typeof g=="function"?(0,Le._)`${_}(${i})`:(0,Le._)`${_}.test(${i})`}}}};z_.default=U6});var nz=N(P_=>{"use strict";Object.defineProperty(P_,"__esModule",{value:!0});var Z6=rz(),M6=[Z6.default];P_.default=M6});var iz=N(Bo=>{"use strict";Object.defineProperty(Bo,"__esModule",{value:!0});Bo.contentVocabulary=Bo.metadataVocabulary=void 0;Bo.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Bo.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var az=N(T_=>{"use strict";Object.defineProperty(T_,"__esModule",{value:!0});var L6=pI(),V6=zI(),F6=tz(),q6=nz(),oz=iz(),B6=[L6.default,V6.default,(0,F6.default)(),q6.default,oz.metadataVocabulary,oz.contentVocabulary];T_.default=B6});var cz=N(tp=>{"use strict";Object.defineProperty(tp,"__esModule",{value:!0});tp.DiscrError=void 0;var sz;(function(e){e.Tag="tag",e.Mapping="mapping"})(sz||(tp.DiscrError=sz={}))});var lz=N(j_=>{"use strict";Object.defineProperty(j_,"__esModule",{value:!0});var Jo=ne(),O_=cz(),uz=Af(),J6=nc(),H6=pe(),K6={message:({params:{discrError:e,tagName:t}})=>e===O_.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:n}})=>(0,Jo._)`{error: ${e}, tag: ${n}, tagValue: ${t}}`},G6={keyword:"discriminator",type:"object",schemaType:"object",error:K6,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),u=t.const("tag",(0,Jo._)`${n}${(0,Jo.getProperty)(s)}`);t.if((0,Jo._)`typeof ${u} == "string"`,()=>l(),()=>e.error(!1,{discrError:O_.DiscrError.Tag,tag:u,tagName:s})),e.ok(c);function l(){let p=f();t.if(!1);for(let m in p)t.elseIf((0,Jo._)`${u} === ${m}`),t.assign(c,d(p[m]));t.else(),e.error(!1,{discrError:O_.DiscrError.Mapping,tag:u,tagName:s}),t.endIf()}function d(p){let m=t.name("valid"),h=e.subschema({keyword:"oneOf",schemaProp:p},m);return e.mergeEvaluated(h,Jo.Name),m}function f(){var p;let m={},h=_(r),g=!0;for(let O=0;O<a.length;O++){let T=a[O];if(T?.$ref&&!(0,H6.schemaHasRulesButRef)(T,o.self.RULES)){let H=T.$ref;if(T=uz.resolveRef.call(o.self,o.schemaEnv.root,o.baseId,H),T instanceof uz.SchemaEnv&&(T=T.schema),T===void 0)throw new J6.default(o.opts.uriResolver,o.baseId,H)}let C=(p=T?.properties)===null||p===void 0?void 0:p[s];if(typeof C!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${s}"`);g=g&&(h||_(T)),$(C,O)}if(!g)throw new Error(`discriminator: "${s}" must be required`);return m;function _({required:O}){return Array.isArray(O)&&O.includes(s)}function $(O,T){if(O.const)k(O.const,T);else if(O.enum)for(let C of O.enum)k(C,T);else throw new Error(`discriminator: "properties/${s}" must have "const" or "enum"`)}function k(O,T){if(typeof O!="string"||O in m)throw new Error(`discriminator: "${s}" values must be unique strings`);m[O]=T}}}};j_.default=G6});var dz=N((gB,W6)=>{W6.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 N_=N((Ee,E_)=>{"use strict";Object.defineProperty(Ee,"__esModule",{value:!0});Ee.MissingRefError=Ee.ValidationError=Ee.CodeGen=Ee.Name=Ee.nil=Ee.stringify=Ee.str=Ee._=Ee.KeywordCxt=Ee.Ajv=void 0;var X6=sI(),Y6=az(),Q6=lz(),fz=dz(),eU=["/properties"],rp="http://json-schema.org/draft-07/schema",Ho=class extends X6.default{_addVocabularies(){super._addVocabularies(),Y6.default.forEach(t=>this.addVocabulary(t)),this.opts.discriminator&&this.addKeyword(Q6.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let t=this.opts.$data?this.$dataMetaSchema(fz,eU):fz;this.addMetaSchema(t,rp,!1),this.refs["http://json-schema.org/schema"]=rp}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(rp)?rp:void 0)}};Ee.Ajv=Ho;E_.exports=Ee=Ho;E_.exports.Ajv=Ho;Object.defineProperty(Ee,"__esModule",{value:!0});Ee.default=Ho;var tU=rc();Object.defineProperty(Ee,"KeywordCxt",{enumerable:!0,get:function(){return tU.KeywordCxt}});var Ko=ne();Object.defineProperty(Ee,"_",{enumerable:!0,get:function(){return Ko._}});Object.defineProperty(Ee,"str",{enumerable:!0,get:function(){return Ko.str}});Object.defineProperty(Ee,"stringify",{enumerable:!0,get:function(){return Ko.stringify}});Object.defineProperty(Ee,"nil",{enumerable:!0,get:function(){return Ko.nil}});Object.defineProperty(Ee,"Name",{enumerable:!0,get:function(){return Ko.Name}});Object.defineProperty(Ee,"CodeGen",{enumerable:!0,get:function(){return Ko.CodeGen}});var rU=Ef();Object.defineProperty(Ee,"ValidationError",{enumerable:!0,get:function(){return rU.default}});var nU=nc();Object.defineProperty(Ee,"MissingRefError",{enumerable:!0,get:function(){return nU.default}})});var $z=N(Tr=>{"use strict";Object.defineProperty(Tr,"__esModule",{value:!0});Tr.formatNames=Tr.fastFormats=Tr.fullFormats=void 0;function Pr(e,t){return{validate:e,compare:t}}Tr.fullFormats={date:Pr(gz,C_),time:Pr(D_(!0),U_),"date-time":Pr(pz(!0),yz),"iso-time":Pr(D_(),vz),"iso-date-time":Pr(pz(),_z),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:uU,"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:gU,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:lU,int32:{type:"number",validate:pU},int64:{type:"number",validate:mU},float:{type:"number",validate:hz},double:{type:"number",validate:hz},password:!0,binary:!0};Tr.fastFormats={...Tr.fullFormats,date:Pr(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,C_),time:Pr(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,U_),"date-time":Pr(/^\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,yz),"iso-time":Pr(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,vz),"iso-date-time":Pr(/^\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,_z),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};Tr.formatNames=Object.keys(Tr.fullFormats);function iU(e){return e%4===0&&(e%100!==0||e%400===0)}var oU=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,aU=[0,31,28,31,30,31,30,31,31,30,31,30,31];function gz(e){let t=oU.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&&iU(n)?29:aU[i])}function C_(e,t){if(e&&t)return e>t?1:e<t?-1:0}var A_=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function D_(e){return function(n){let i=A_.exec(n);if(!i)return!1;let r=+i[1],o=+i[2],a=+i[3],s=i[4],c=i[5]==="-"?-1:1,u=+(i[6]||0),l=+(i[7]||0);if(u>23||l>59||e&&!s)return!1;if(r<=23&&o<=59&&a<60)return!0;let d=o-l*c,f=r-u*c-(d<0?1:0);return(f===23||f===-1)&&(d===59||d===-1)&&a<61}}function U_(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 vz(e,t){if(!(e&&t))return;let n=A_.exec(e),i=A_.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 R_=/t|\s/i;function pz(e){let t=D_(e);return function(i){let r=i.split(R_);return r.length===2&&gz(r[0])&&t(r[1])}}function yz(e,t){if(!(e&&t))return;let n=new Date(e).valueOf(),i=new Date(t).valueOf();if(n&&i)return n-i}function _z(e,t){if(!(e&&t))return;let[n,i]=e.split(R_),[r,o]=t.split(R_),a=C_(n,r);if(a!==void 0)return a||U_(i,o)}var sU=/\/|:/,cU=/^(?:[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 uU(e){return sU.test(e)&&cU.test(e)}var mz=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function lU(e){return mz.lastIndex=0,mz.test(e)}var dU=-(2**31),fU=2**31-1;function pU(e){return Number.isInteger(e)&&e<=fU&&e>=dU}function mU(e){return Number.isInteger(e)}function hz(){return!0}var hU=/[^\\]\\Z/;function gU(e){if(hU.test(e))return!1;try{return new RegExp(e),!0}catch{return!1}}});var bz=N(Go=>{"use strict";Object.defineProperty(Go,"__esModule",{value:!0});Go.formatLimitDefinition=void 0;var vU=N_(),mr=ne(),Sn=mr.operators,np={formatMaximum:{okStr:"<=",ok:Sn.LTE,fail:Sn.GT},formatMinimum:{okStr:">=",ok:Sn.GTE,fail:Sn.LT},formatExclusiveMaximum:{okStr:"<",ok:Sn.LT,fail:Sn.GTE},formatExclusiveMinimum:{okStr:">",ok:Sn.GT,fail:Sn.LTE}},yU={message:({keyword:e,schemaCode:t})=>(0,mr.str)`should be ${np[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,mr._)`{comparison: ${np[e].okStr}, limit: ${t}}`};Go.formatLimitDefinition={keyword:Object.keys(np),type:"string",schemaType:"string",$data:!0,error:yU,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 vU.KeywordCxt(o,s.RULES.all.format.definition,"format");c.$data?u():l();function u(){let f=t.scopeValue("formats",{ref:s.formats,code:a.code.formats}),p=t.const("fmt",(0,mr._)`${f}[${c.schemaCode}]`);e.fail$data((0,mr.or)((0,mr._)`typeof ${p} != "object"`,(0,mr._)`${p} instanceof RegExp`,(0,mr._)`typeof ${p}.compare != "function"`,d(p)))}function l(){let f=c.schema,p=s.formats[f];if(!p||p===!0)return;if(typeof p!="object"||p instanceof RegExp||typeof p.compare!="function")throw new Error(`"${r}": format "${f}" does not define "compare" function`);let m=t.scopeValue("formats",{key:f,ref:p,code:a.code.formats?(0,mr._)`${a.code.formats}${(0,mr.getProperty)(f)}`:void 0});e.fail$data(d(m))}function d(f){return(0,mr._)`${f}.compare(${n}, ${i}) ${np[r].fail} 0`}},dependencies:["format"]};var _U=e=>(e.addKeyword(Go.formatLimitDefinition),e);Go.default=_U});var Sz=N((yc,kz)=>{"use strict";Object.defineProperty(yc,"__esModule",{value:!0});var Wo=$z(),$U=bz(),Z_=ne(),wz=new Z_.Name("fullFormats"),bU=new Z_.Name("fastFormats"),M_=(e,t={keywords:!0})=>{if(Array.isArray(t))return xz(e,t,Wo.fullFormats,wz),e;let[n,i]=t.mode==="fast"?[Wo.fastFormats,bU]:[Wo.fullFormats,wz],r=t.formats||Wo.formatNames;return xz(e,r,n,i),t.keywords&&(0,$U.default)(e),e};M_.get=(e,t="full")=>{let i=(t==="fast"?Wo.fastFormats:Wo.fullFormats)[e];if(!i)throw new Error(`Unknown format "${e}"`);return i};function xz(e,t,n,i){var r,o;(r=(o=e.opts.code).formats)!==null&&r!==void 0||(o.formats=(0,Z_._)`require("ajv-formats/dist/formats").${i}`);for(let a of t)e.addFormat(a,n[a])}kz.exports=yc=M_;Object.defineProperty(yc,"__esModule",{value:!0});yc.default=M_});import{parseArgs as VZ}from"node:util";import{readFileSync as wP}from"node:fs";import{dirname as xP,join as kP}from"node:path";var mi="0.2.2",SP="https://api.heylatch.app";function IP(e=process.cwd()){let t=e;for(;;){let n="";try{n=wP(kP(t,".env"),"utf8")}catch{}let i=/^[ \t]*(?:export[ \t]+)?LATCH_API_KEY[ \t]*=[ \t]*["']?([^"'\s#]+)/m.exec(n);if(i)return i[1];let r=xP(t);if(r===t)return;t=r}}var F=class extends Error{constructor(n,i,r=0,o={}){super(i);this.code=n;this.status=r;this.params=o}code;status;params},pi=class{key;baseUrl;fetcher;constructor({key:t=process.env.LATCH_API_KEY||IP(),baseUrl:n=process.env.LATCH_API_URL??SP,fetch:i=fetch}={}){if(!t)throw new F("noApiKey","No API key. Set LATCH_API_KEY (or add it to a .env file) to a key from your workspace's API page on heylatch.app.");if(!t.startsWith("ltk_"))throw new F("noApiKey","LATCH_API_KEY doesn't look like a Latch API key (it should start with ltk_).");this.key=t,this.baseUrl=n.replace(/\/+$/,""),this.fetcher=i}async request(t,n,i){for(let r=0;;r++){let o;try{o=await this.fetcher(`${this.baseUrl}/public/v1${n}`,{method:t,headers:{authorization:`Bearer ${this.key}`,"user-agent":`latch-cli/${mi}`,...i!==void 0?{"content-type":"application/json"}:{}},body:i!==void 0?JSON.stringify(i):void 0})}catch(u){throw new F("network",`Couldn't reach ${this.baseUrl}: ${u.message}`)}let a=await o.json().catch(()=>null);if(o.ok)return a;let s=a?.error,c=Number(s?.params?.seconds);if(o.status===429&&r<3&&c>0&&c<=90){await new Promise(u=>setTimeout(u,c*1e3));continue}throw new F(s?.code??"generic",s?.message??`Request failed (${o.status}).`,o.status,s?.params??{})}}async fetchPackage(t){let n=await this.fetcher(t);if(!n.ok)throw new F("downloadFailed",`Downloading the package failed (${n.status}). Try again.`,n.status);return new Uint8Array(await n.arrayBuffer())}async upload(t,n){let i=await this.fetcher(t,{method:"PUT",headers:{"content-type":"application/zip"},body:n});if(!i.ok)throw new F("uploadFailed",`Uploading the package failed (${i.status}). The upload link may have expired; try again.`,i.status)}workspace=()=>this.request("GET","/workspace");listScripts=()=>this.request("GET","/scripts").then(t=>t.data);getScript=t=>this.request("GET",`/scripts/${Ke(t)}`);createScript=t=>this.request("POST","/scripts",t);createVersion=(t,n)=>this.request("POST",`/scripts/${Ke(t)}/versions`,n);getVersion=(t,n)=>this.request("GET",`/scripts/${Ke(t)}/versions/${Ke(n)}`);publishVersion=(t,n)=>this.request("POST",`/scripts/${Ke(t)}/versions/${Ke(n)}/publish`);withdrawVersion=(t,n)=>this.request("POST",`/scripts/${Ke(t)}/versions/${Ke(n)}/withdraw`);downloadVersion=(t,n)=>this.request("POST",`/scripts/${Ke(t)}/versions/${Ke(n)}/download`);listGrants=(t,n={})=>this.request("GET",`/scripts/${Ke(t)}/grants${$p(n)}`);grant=(t,n)=>this.request("POST",`/scripts/${Ke(t)}/grants`,{accountId:n});grantBulk=(t,n)=>this.request("POST",`/scripts/${Ke(t)}/grants/bulk`,{accountIds:n});revoke=(t,n)=>this.request("POST",`/scripts/${Ke(t)}/grants/revoke`,{accountId:n});listActivations=(t,n={})=>this.request("GET",`/scripts/${Ke(t)}/activations${$p(n)}`);listFlags=(t,n={})=>this.request("GET",`/scripts/${Ke(t)}/flags${$p(n)}`);resolveFlag=t=>this.request("POST",`/flags/${Ke(t)}/resolve`)},Ke=encodeURIComponent;function $p(e){let t=Object.entries(e).filter(([,n])=>n!=null&&n!=="");return t.length?`?${new URLSearchParams(t.map(([n,i])=>[n,String(i)]))}`:""}var jc='# Latch guide for AI agents\r\n\r\nYou are an AI coding agent, and a developer wants their game server scripts protected with Latch. This guide has everything you need to do that from start to finish. Follow it rather than guessing. When a step needs something only the developer can do, stop and ask for it, and say exactly where to get it.\r\n\r\nLatch (https://heylatch.app) protects and licenses game server scripts. The developer uploads a resource. Latch encrypts its server code and returns a package that only runs on servers with a valid license key. Supported games: HogwartsMP and Kingdoms Connected (MafiaHub resources), and Hytale (Java plugins).\r\n\r\nLatch doesn\'t change the developer\'s source. Keep working in the source as usual: it stays readable and in their repository. The protected package is a build output that goes to servers.\r\n\r\n## Rules\r\n\r\n- Never write a protected package over source code. Keep the source and the server\'s install folder separate.\r\n- Never commit, print or paste keys. API keys (`ltk_...`) and license keys (`LT-...`) go in a git-ignored `.env` file or a CI secret.\r\n- Publish the original resource, never a package you downloaded from Latch.\r\n- Don\'t edit files inside a protected package. Modified packages won\'t run. Change the source and publish a new version.\r\n- Ask before granting or revoking access, withdrawing a version, or publishing to servers real players are on. Those actions affect other people.\r\n- Show the developer the result of `preview` or `publish-all --dry-run` before the first real publish.\r\n\r\n## What you need from the developer\r\n\r\nAsk for these once, together, and explain why:\r\n\r\n1. **A Latch account and workspace.** Sign up at https://heylatch.app and create a workspace at https://heylatch.app/app/w/new. Plans are per workspace, and the plan limits how many scripts it can hold (see [Projects with many resources](#projects-with-many-resources)).\r\n2. **An API key.** Workspace > API page (`https://heylatch.app/app/w/<workspace>/api`). The **Publish** preset is enough to publish and install. Choose **Full** only if you\'ll also manage access. Ask them to put it in a git-ignored `.env` at the project root, so you never see the value:\r\n ```\r\n LATCH_API_KEY=ltk_...\r\n ```\r\n3. **A license key**, only when installing on a server. Get it at https://heylatch.app/app/keys. It goes on the server, not in the project (see [Install on a server](#install-on-a-server)).\r\n\r\nYou can\'t create these yourself: the API has no endpoint for accounts, workspaces, API keys or license keys.\r\n\r\n## Set up the tools\r\n\r\nUse the CLI (needs Node.js 20 or newer). There\'s nothing to install globally:\r\n\r\n```sh\r\nnpx -y @heylatch/cli@latest whoami\r\n```\r\n\r\nThis prints the workspace, plan, script usage and the key\'s permissions. The CLI reads `LATCH_API_KEY` from the environment, or from a `.env` file in the current folder or any folder above it. Add `--json` to any command for machine-readable output. Commands exit with code 1 on failure.\r\n\r\nIf your client supports MCP, the same package also runs an MCP server. The developer can add it with:\r\n\r\n```sh\r\nclaude mcp add latch -e LATCH_API_KEY=ltk_... -- npx -y @heylatch/cli@latest mcp\r\n```\r\n\r\nTools: `get_guide`, `whoami`, `list_scripts`, `get_script`, `preview_package`, `publish_version`, `publish_all`, `pull_version`, `get_version_status`, `withdraw_version`, `list_access`, `grant_access`, `revoke_access`, `list_activations`, `list_flags`, `resolve_flag`.\r\n\r\nThis guide uses CLI commands. Each one maps directly to an MCP tool.\r\n\r\n## Prepare the package\r\n\r\nLatch protects what the game server loads, so point it at the built resource (with its compiled JavaScript or `.class` files), not an unbuilt project. Build first if the project has a build step.\r\n\r\n### MafiaHub resources (HogwartsMP, Kingdoms Connected)\r\n\r\n`package.json` at the resource root needs a `mafiahub` block:\r\n\r\n```json\r\n{\r\n "name": "my-resource",\r\n "version": "1.0.0",\r\n "description": "What it does",\r\n "mafiahub": {\r\n "serverScripts": ["dist/server.js"],\r\n "clientScripts": ["dist/client.js"],\r\n "files": ["dist/client.js"],\r\n "resourceDependencies": ["other-resource"]\r\n },\r\n "latch": {\r\n "ecosystem": "hogwartsmp",\r\n "ignore": ["config.json"]\r\n }\r\n}\r\n```\r\n\r\nWhat happens to each file:\r\n\r\n| File | In the package |\r\n|---|---|\r\n| `serverScripts`, and other `.js`/`.cjs`/`.json` files | Encrypted. Decrypted only in memory, after the license check. |\r\n| `clientScripts`, `sharedScripts`, `files` | Sent to players by the game, so they can\'t be encrypted. Their JavaScript is obfuscated. |\r\n| Anything in `latch.ignore` | Stays readable. Use it for config the server owner edits. |\r\n| `node_modules/`, images, sounds, other assets | Stay readable. |\r\n| `.ts`, `.tsx`, `.map` | Left out. |\r\n| `.git`, `.env`, `server.env`, `latch.env` (when publishing a folder) | Left out. |\r\n\r\nThe `latch` block is removed from the published package. Its optional fields:\r\n\r\n| Field | Meaning |\r\n|---|---|\r\n| `ignore` | Server files to leave readable. Wildcards work: `data/*`, `data/**`. |\r\n| `obfuscateClient` | `false` ships client JavaScript without obfuscation. |\r\n| `script` | Script slug on Latch, if it should differ from `name`. |\r\n| `name` | Display name on Latch, if it should differ from `name`. |\r\n| `ecosystem` | `hogwartsmp` or `kcdc`. Needed the first time a script is created, unless you pass `--ecosystem`. |\r\n| `category` | `gameplay`, `economy`, `vehicles`, `ui`, `world`, `admin` or `other`. |\r\n\r\nCheck the code for these before publishing:\r\n\r\n- **ES modules.** Encrypted server code runs as CommonJS, so `import`/`export` statements won\'t run. Compile server scripts to CommonJS, for example with esbuild\'s `--format=cjs`. `import()` works. Files ending in `.mjs` aren\'t encrypted at all. `preview` warns about this, but the build won\'t fail, so don\'t ignore the warning.\r\n- **Reading its own files.** Encrypted files aren\'t on disk. `require("./data.json")` works, but `fs.readFile` on an encrypted file doesn\'t. List any file the code reads with `fs` under `latch.ignore`, or switch to `require`.\r\n- **Server scripts listed for players.** A file in `serverScripts` can\'t also be in `clientScripts`, `sharedScripts` or `files`. This blocks the publish.\r\n- **Secrets in the bundle.** `node_modules/` stays readable. If server code must stay private, bundle it into `dist/` with its dependencies.\r\n- **Programs and native files** (`.exe`, `.dll`, `.node`...) aren\'t blocked, but they\'re flagged for the Latch team to review.\r\n\r\n### Hytale plugins\r\n\r\nPublish the compiled plugin `.jar`. It needs `manifest.json` at its root with a `Main` class, and that class must be in the JAR:\r\n\r\n```json\r\n{\r\n "Group": "com.acme",\r\n "Name": "MyPlugin",\r\n "Version": "1.0.0",\r\n "Description": "What it does",\r\n "ServerVersion": "0.7.0-pre.2",\r\n "Main": "com.acme.Main"\r\n}\r\n```\r\n\r\nAll classes and resources are encrypted, and the result is a single `.jar` for the server\'s `mods/` folder. Keep asset packs streamed to players (models, textures) out of the code JAR: they can\'t be protected.\r\n\r\n## Publish\r\n\r\n```sh\r\n# 1. See what happens to each file. Uploads nothing. Fix anything it reports.\r\nnpx -y @heylatch/cli@latest preview ./my-resource\r\n\r\n# 2. Upload, publish and wait for the build\r\nnpx -y @heylatch/cli@latest publish ./my-resource --changelog "Fixed spawn bug"\r\n\r\n# 3. If you need to check again later\r\nnpx -y @heylatch/cli@latest status my-resource\r\n```\r\n\r\n`publish` takes the script\'s slug, version, name and description from the manifest. Flags override them: `--script`, `--version`, `--name`, `--description`, `--ecosystem`, `--category`, `--tags`. A script that doesn\'t exist yet is created on first publish; it only needs an ecosystem (`--ecosystem hogwartsmp|kcdc|hytale`, or `latch.ecosystem`).\r\n\r\nVersions:\r\n\r\n- Use `1.2.0` form. A new version must be higher than the last one, and a number can\'t be reused, even if its build failed. Raise it in the manifest and publish again.\r\n- Keep the version in the manifest as the single source, so dependency version checks and Latch agree.\r\n- Everyone with access is notified when a version is ready, and sees the changelog.\r\n\r\nSlugs are unique across all of Latch. If a publish fails with `slugTaken`, pass another with `--script` or `latch.script`. That only changes the name on Latch: the resource on the server keeps its `name` from `package.json`, so other resources\' dependencies and `Imports.get` calls keep working.\r\n\r\n## Projects with many resources\r\n\r\nEach resource folder is one script on Latch. Plans limit scripts per workspace:\r\n\r\n| Plan | Scripts |\r\n|---|---|\r\n| Free | 1 |\r\n| Pro | 5 |\r\n| Studio | 50 |\r\n| Enterprise | Unlimited |\r\n\r\nBefore publishing a large project, count what needs protecting and compare it with `whoami`. If the plan is too small, tell the developer what the options are; don\'t pick for them. They can upgrade, or protect only the resources that hold the valuable logic. Protected and unprotected resources work side by side.\r\n\r\nTo publish a folder of resources:\r\n\r\n```sh\r\n# See what would happen. Changes nothing.\r\nnpx -y @heylatch/cli@latest publish-all ./resources --ecosystem hogwartsmp --dry-run\r\n\r\n# Do it. Safe to rerun: published versions are skipped.\r\nnpx -y @heylatch/cli@latest publish-all ./resources --ecosystem hogwartsmp --changelog "..."\r\n```\r\n\r\n- It stops before uploading anything if the new scripts wouldn\'t fit the plan. Narrow it down with `--only a,b` or `--skip a,b` (folder names).\r\n- One resource failing doesn\'t stop the others. The summary lists each one, and the exit code is 1 if any failed. Fix those and rerun.\r\n- A changed resource whose version wasn\'t raised is reported as `unchanged`. Raise the version to publish it.\r\n- The target script comes from each manifest. Read the dry run: if a line says the manifest names the script, check it\'s the script you meant, especially for code you didn\'t write. Publishing an update notifies everyone with access to that script.\r\n- Resources with no `serverScripts` (client-only UI, for example) are `skipped`. They have nothing Latch can encrypt, so install them on the server as they are.\r\n\r\nDependencies between resources keep working: load order, `resourceDependencies`, `Exports.register`, `Exports.get` and `Imports.get` behave as they do unprotected, including calls at the top level of a dependent\'s script. If a dependency\'s license fails, its exports don\'t exist, so resources that need them fail to start and the console says why.\r\n\r\n## Install on a server\r\n\r\n```sh\r\n# One script, or several\r\nnpx -y @heylatch/cli@latest pull my-resource other-resource --to /path/to/server/resources\r\n\r\n# Every published script in the workspace\r\nnpx -y @heylatch/cli@latest pull --all --to /path/to/server/resources\r\n\r\n# Hytale plugins go in mods/\r\nnpx -y @heylatch/cli@latest pull my-plugin --to /path/to/server/mods\r\n```\r\n\r\n`pull` installs the newest ready version. It\'s meant for the developer\'s own servers, and it\'s the only safe way to install here:\r\n\r\n- It refuses to write through a symlink or junction. Development servers often link source folders into `resources/`, and writing through one would overwrite the source. If `pull` refuses, don\'t work around it: remove the link or use a separate server folder, and tell the developer.\r\n- It refuses to overwrite a folder that isn\'t a Latch package unless you pass `--force`. Don\'t pass `--force` without asking.\r\n- Files in the package replace the ones on the server, including readable config. Protect edited files with `--keep config.json,data/*`.\r\n- Run it with the server stopped, then start the server.\r\n\r\n### The license key\r\n\r\nEach server needs one key. Set it as an environment variable, or in a `.env`, `server.env` or `latch.env` file in the server folder or a folder above it:\r\n\r\n```\r\nLATCH_LICENSE=LT-XXXX-XXXX-XXXX-XXXX\r\n```\r\n\r\n- One key runs on one server at a time. The same key on a second server is refused and flagged, so a second server (for example main and test) needs an extra key from https://heylatch.app/app/keys.\r\n- A key isn\'t per script. It opens every script the account can access, so write it once.\r\n- Workspace members can run their own workspace\'s scripts with their own key, without being granted access.\r\n- The server needs outbound HTTPS (443) to `api.heylatch.app`.\r\n\r\n### Check that it works\r\n\r\nStart the server and read the console. For each protected resource, you should see:\r\n\r\n```\r\n[latch] my-resource: license verified\r\n```\r\n\r\nThen test the resource\'s actual behavior in-game or through its commands. Each protected resource adds a moment to startup for its license check.\r\n\r\n## Give others access\r\n\r\nServer owners share their account ID, which looks like `LA-7K2M-9QXD`. They\'ll find it in Settings (https://heylatch.app/app/settings).\r\n\r\n```sh\r\nnpx -y @heylatch/cli@latest grant my-resource LA-7K2M-9QXD # safe to retry\r\nnpx -y @heylatch/cli@latest access my-resource\r\nnpx -y @heylatch/cli@latest revoke my-resource LA-7K2M-9QXD\r\n```\r\n\r\nThey then download the package from their Library (https://heylatch.app/app/scripts), extract it into `resources/` (Hytale: put the `.jar` in `mods/`), and add their own key. Granting several accounts in one command needs the Studio plan.\r\n\r\n## What happens at runtime\r\n\r\n| Situation | Result |\r\n|---|---|\r\n| No key, invalid key or no access | The script doesn\'t run and the console says why. The server and other resources keep running. |\r\n| The script itself throws while starting | Handled like an unprotected resource: that resource fails to start and the server continues. |\r\n| Access revoked or key revoked while running | The script stops at its next license check, within about 5 minutes. The server keeps running. |\r\n| License server unreachable at startup | The resource retries every 30 seconds and starts when it gets through. Resources that depend on it at startup can fail, so restart the server once the connection is back. |\r\n| License server unreachable while running | The script keeps running and retries. After 30 minutes without contact, it stops. |\r\n\r\nStopping on MafiaHub: the runtime can\'t unload a resource, so Latch cuts it off instead. Its timers stop, and its handlers for `Events`, `Chat`, `Messages` and `WorldEvents` stop responding. Two things remain until the server restarts: what the script already created in the world, and exports other resources already hold. For cleanup on stop, export a hook from the last server script:\r\n\r\n```js\r\nmodule.exports.onLatchStop = (reason) => {\r\n // remove spawned entities, close connections\r\n}\r\n```\r\n\r\nOn Hytale, the plugin is shut down through its normal shutdown.\r\n\r\n## Troubleshooting\r\n\r\nConsole messages on the server:\r\n\r\n| Message | Fix |\r\n|---|---|\r\n| `license key not found` | `LATCH_LICENSE` is missing or misnamed. See [The license key](#the-license-key). |\r\n| `key already active on another server` | Stop the other server, or use an extra key. After moving to a new machine, the key frees up in about 10 minutes. |\r\n| `account has no access to this script` | The key\'s account has no grant and isn\'t in the workspace. Grant access, or use a member\'s key. |\r\n| `this package is outdated` | The script\'s encryption key was rotated. Run `pull` again. |\r\n| `this package is damaged or was modified` | Files in the package changed. Run `pull` again and don\'t edit them. |\r\n| `could not reach license server` | Allow outbound HTTPS to `api.heylatch.app`. |\r\n| `Cannot find module` or a missing file | The code reads an encrypted file. See [Prepare the package](#prepare-the-package). |\r\n\r\nAPI and CLI error codes:\r\n\r\n| Code | Fix |\r\n|---|---|\r\n| `apiKeyInvalid` | The key is wrong, revoked or expired. Ask for a new one. |\r\n| `scopeMissing` | The key lacks the permission named in the message. Ask for a key with that scope. |\r\n| `earlyAccess`, `maintenance` | Latch is limited to invited accounts right now, and the account that created this key isn\'t one. Tell the developer. |\r\n| `planLimit` | The workspace is at its script limit. Ask the developer how to proceed. |\r\n| `planRequired` | The feature needs a higher plan. |\r\n| `versionExists`, `versionLower` | Raise the version. |\r\n| `slugTaken` | Another script has this slug. Use `--script`. |\r\n| `packageBlocked` | `preview` lists the problems. Fix them and retry. |\r\n| `linkedTarget`, `notLatchFolder` | `pull` protected a folder that may hold source. See [Install on a server](#install-on-a-server). |\r\n| `rateLimited` | The CLI waits and retries by itself. Only seen after repeated limits. |\r\n\r\nIf a build fails with status `error`, `buildError` says why. Fix the package, raise the version and publish again.\r\n\r\n## Automate releases\r\n\r\n```yaml\r\n# .github/workflows/release.yml, on a tag like v1.2.0\r\n- run: npx -y @heylatch/cli@latest publish ./dist-resource --version "${GITHUB_REF_NAME#v}"\r\n env:\r\n LATCH_API_KEY: ${{ secrets.LATCH_API_KEY }}\r\n```\r\n\r\nOffer to add this block to the project\'s `CLAUDE.md` or `AGENTS.md`, so future sessions keep to the setup:\r\n\r\n```markdown\r\n## Latch\r\nServer code is protected with Latch. Guide: https://heylatch.app/agents.md\r\n- Publish from the built resource: `npx -y @heylatch/cli@latest publish <folder>`. Raise `version` first.\r\n- Install on servers with `npx -y @heylatch/cli@latest pull <script> --to <server>/resources`. Never over source folders.\r\n- `LATCH_API_KEY` and `LATCH_LICENSE` live in git-ignored `.env` files. Never commit or print them.\r\n```\r\n\r\n## More\r\n\r\n- CLI help: `npx -y @heylatch/cli@latest --help`\r\n- This guide offline, matching the installed version: `latch guide`, or the MCP tool `get_guide`\r\n- Human docs: https://heylatch.app/docs\r\n- REST API: https://heylatch.app/docs/api, spec at https://api.heylatch.app/public/v1/openapi.json\r\n';var le;(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})(le||(le={}));var p$;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(p$||(p$={}));var D=le.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Dr=e=>{switch(typeof e){case"undefined":return D.undefined;case"string":return D.string;case"number":return Number.isNaN(e)?D.nan:D.number;case"boolean":return D.boolean;case"function":return D.function;case"bigint":return D.bigint;case"symbol":return D.symbol;case"object":return Array.isArray(e)?D.array:e===null?D.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?D.promise:typeof Map<"u"&&e instanceof Map?D.map:typeof Set<"u"&&e instanceof Set?D.set:typeof Date<"u"&&e instanceof Date?D.date:D.object;default:return D.unknown}};var I=le.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 Ut=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 u=a.path[c],l=c===a.path.length-1;if(u==="_errors"){l&&s._errors.push(n(a)),c++;continue}Object.prototype.hasOwnProperty.call(s,u)||(u==="__proto__"?Object.defineProperty(s,u,{value:{_errors:[]},writable:!0,enumerable:!0,configurable:!0}):s[u]={_errors:[]}),s=s[u],l&&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,le.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()}};Ut.create=e=>new Ut(e);var zP=(e,t)=>{let n;switch(e.code){case I.invalid_type:e.received===D.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case I.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,le.jsonStringifyReplacer)}`;break;case I.unrecognized_keys:n=`Unrecognized key(s) in object: ${le.joinValues(e.keys,", ")}`;break;case I.invalid_union:n="Invalid input";break;case I.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${le.joinValues(e.options)}`;break;case I.invalid_enum_value:n=`Invalid enum value. Expected ${le.joinValues(e.options)}, received '${e.received}'`;break;case I.invalid_arguments:n="Invalid function arguments";break;case I.invalid_return_type:n="Invalid function return type";break;case I.invalid_date:n="Invalid date";break;case I.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}"`:le.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case I.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 I.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 I.custom:n="Invalid input";break;case I.invalid_intersection_types:n="Intersection results could not be merged";break;case I.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case I.not_finite:n="Number must be finite";break;default:n=t.defaultError,le.assertNever(e)}return{message:n}},Wr=zP;var PP=Wr;function oa(){return PP}var Ec=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(u=>!!u).slice().reverse();for(let u of c)s=u(a,{data:t,defaultError:s}).message;return{...r,path:o,message:s}};function j(e,t){let n=oa(),i=Ec({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===Wr?void 0:Wr].filter(r=>!!r)});e.common.issues.push(i)}var it=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 q;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 q;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}}},q=Object.freeze({status:"aborted"}),hi=e=>({status:"dirty",value:e}),ft=e=>({status:"valid",value:e}),bp=e=>e.status==="aborted",wp=e=>e.status==="dirty",On=e=>e.status==="valid",aa=e=>typeof Promise<"u"&&e instanceof Promise;var U;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(U||(U={}));var Jt=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}},m$=(e,t)=>{if(On(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 Ut(e.common.issues);return this._error=n,this._error}}};function Q(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 ie=class{get description(){return this._def.description}_getType(t){return Dr(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Dr(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new it,ctx:{common:t.parent.common,data:t.data,parsedType:Dr(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let n=this._parse(t);if(aa(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:Dr(t)},r=this._parseSync({data:t,path:i.path,parent:i});return m$(i,r)}"~validate"(t){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Dr(t)};if(!this["~standard"].async)try{let i=this._parseSync({data:t,path:[],parent:n});return On(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=>On(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:Dr(t)},r=this._parse({data:t,path:i.path,parent:i}),o=await(aa(r)?r:Promise.resolve(r));return m$(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:I.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 ir({schema:this,typeName:P.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 nr.create(this,this._def)}nullable(){return Ur.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Yr.create(this)}promise(){return jn.create(this,this._def)}or(t){return $i.create([this,t],this._def)}and(t){return bi.create(this,t,this._def)}transform(t){return new ir({...Q(this._def),schema:this,typeName:P.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let n=typeof t=="function"?t:()=>t;return new Ii({...Q(this._def),innerType:this,defaultValue:n,typeName:P.ZodDefault})}brand(){return new Nc({typeName:P.ZodBranded,type:this,...Q(this._def)})}catch(t){let n=typeof t=="function"?t:()=>t;return new zi({...Q(this._def),innerType:this,catchValue:n,typeName:P.ZodCatch})}describe(t){let n=this.constructor;return new n({...this._def,description:t})}pipe(t){return Ac.create(this,t)}readonly(){return Pi.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},TP=/^c[^\s-]{8,}$/i,OP=/^[0-9a-z]+$/,jP=/^[0-9A-HJKMNP-TV-Z]{26}$/i,EP=/^[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,NP=/^[a-z0-9_-]{21}$/i,AP=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,DP=/^[-+]?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)?)??$/,RP=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,CP="^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$",xp,UP=/^(?:(?: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])$/,ZP=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,MP=/^(([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]))$/,LP=/^(([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])$/,VP=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,FP=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,h$="((\\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])))",qP=new RegExp(`^${h$}$`);function g$(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 BP(e){return new RegExp(`^${g$(e)}$`)}function JP(e){let t=`${h$}T${g$(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 HP(e,t){return!!((t==="v4"||!t)&&UP.test(e)||(t==="v6"||!t)&&MP.test(e))}function KP(e,t){if(!AP.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 GP(e,t){return!!((t==="v4"||!t)&&ZP.test(e)||(t==="v6"||!t)&&LP.test(e))}var vi=class e extends ie{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==D.string){let o=this._getOrReturnCtx(t);return j(o,{code:I.invalid_type,expected:D.string,received:o.parsedType}),q}let i=new it,r;for(let o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(r=this._getOrReturnCtx(t,r),j(r,{code:I.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),j(r,{code:I.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?j(r,{code:I.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):s&&j(r,{code:I.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),i.dirty())}else if(o.kind==="email")RP.test(t.data)||(r=this._getOrReturnCtx(t,r),j(r,{validation:"email",code:I.invalid_string,message:o.message}),i.dirty());else if(o.kind==="emoji")xp||(xp=new RegExp(CP,"u")),xp.test(t.data)||(r=this._getOrReturnCtx(t,r),j(r,{validation:"emoji",code:I.invalid_string,message:o.message}),i.dirty());else if(o.kind==="uuid")EP.test(t.data)||(r=this._getOrReturnCtx(t,r),j(r,{validation:"uuid",code:I.invalid_string,message:o.message}),i.dirty());else if(o.kind==="nanoid")NP.test(t.data)||(r=this._getOrReturnCtx(t,r),j(r,{validation:"nanoid",code:I.invalid_string,message:o.message}),i.dirty());else if(o.kind==="cuid")TP.test(t.data)||(r=this._getOrReturnCtx(t,r),j(r,{validation:"cuid",code:I.invalid_string,message:o.message}),i.dirty());else if(o.kind==="cuid2")OP.test(t.data)||(r=this._getOrReturnCtx(t,r),j(r,{validation:"cuid2",code:I.invalid_string,message:o.message}),i.dirty());else if(o.kind==="ulid")jP.test(t.data)||(r=this._getOrReturnCtx(t,r),j(r,{validation:"ulid",code:I.invalid_string,message:o.message}),i.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{r=this._getOrReturnCtx(t,r),j(r,{validation:"url",code:I.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),j(r,{validation:"regex",code:I.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),j(r,{code:I.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),j(r,{code:I.invalid_string,validation:{startsWith:o.value},message:o.message}),i.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(r=this._getOrReturnCtx(t,r),j(r,{code:I.invalid_string,validation:{endsWith:o.value},message:o.message}),i.dirty()):o.kind==="datetime"?JP(o).test(t.data)||(r=this._getOrReturnCtx(t,r),j(r,{code:I.invalid_string,validation:"datetime",message:o.message}),i.dirty()):o.kind==="date"?qP.test(t.data)||(r=this._getOrReturnCtx(t,r),j(r,{code:I.invalid_string,validation:"date",message:o.message}),i.dirty()):o.kind==="time"?BP(o).test(t.data)||(r=this._getOrReturnCtx(t,r),j(r,{code:I.invalid_string,validation:"time",message:o.message}),i.dirty()):o.kind==="duration"?DP.test(t.data)||(r=this._getOrReturnCtx(t,r),j(r,{validation:"duration",code:I.invalid_string,message:o.message}),i.dirty()):o.kind==="ip"?HP(t.data,o.version)||(r=this._getOrReturnCtx(t,r),j(r,{validation:"ip",code:I.invalid_string,message:o.message}),i.dirty()):o.kind==="jwt"?KP(t.data,o.alg)||(r=this._getOrReturnCtx(t,r),j(r,{validation:"jwt",code:I.invalid_string,message:o.message}),i.dirty()):o.kind==="cidr"?GP(t.data,o.version)||(r=this._getOrReturnCtx(t,r),j(r,{validation:"cidr",code:I.invalid_string,message:o.message}),i.dirty()):o.kind==="base64"?VP.test(t.data)||(r=this._getOrReturnCtx(t,r),j(r,{validation:"base64",code:I.invalid_string,message:o.message}),i.dirty()):o.kind==="base64url"?FP.test(t.data)||(r=this._getOrReturnCtx(t,r),j(r,{validation:"base64url",code:I.invalid_string,message:o.message}),i.dirty()):le.assertNever(o);return{status:i.value,value:t.data}}_regex(t,n,i){return this.refinement(r=>t.test(r),{validation:n,code:I.invalid_string,...U.errToObj(i)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...U.errToObj(t)})}url(t){return this._addCheck({kind:"url",...U.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...U.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...U.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...U.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...U.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...U.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...U.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...U.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...U.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...U.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...U.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...U.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,...U.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,...U.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...U.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...U.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n?.position,...U.errToObj(n?.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...U.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...U.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...U.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...U.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...U.errToObj(n)})}nonempty(t){return this.min(1,U.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}};vi.create=e=>new vi({checks:[],typeName:P.ZodString,coerce:e?.coerce??!1,...Q(e)});function WP(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 sa=class e extends ie{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)!==D.number){let o=this._getOrReturnCtx(t);return j(o,{code:I.invalid_type,expected:D.number,received:o.parsedType}),q}let i,r=new it;for(let o of this._def.checks)o.kind==="int"?le.isInteger(t.data)||(i=this._getOrReturnCtx(t,i),j(i,{code:I.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),j(i,{code:I.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),j(i,{code:I.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),r.dirty()):o.kind==="multipleOf"?WP(t.data,o.value)!==0&&(i=this._getOrReturnCtx(t,i),j(i,{code:I.not_multiple_of,multipleOf:o.value,message:o.message}),r.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(i=this._getOrReturnCtx(t,i),j(i,{code:I.not_finite,message:o.message}),r.dirty()):le.assertNever(o);return{status:r.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,U.toString(n))}gt(t,n){return this.setLimit("min",t,!1,U.toString(n))}lte(t,n){return this.setLimit("max",t,!0,U.toString(n))}lt(t,n){return this.setLimit("max",t,!1,U.toString(n))}setLimit(t,n,i,r){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:i,message:U.toString(r)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:U.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:U.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:U.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:U.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:U.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:U.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:U.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:U.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:U.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"&&le.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)}};sa.create=e=>new sa({checks:[],typeName:P.ZodNumber,coerce:e?.coerce||!1,...Q(e)});var ca=class e extends ie{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)!==D.bigint)return this._getInvalidInput(t);let i,r=new it;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),j(i,{code:I.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),j(i,{code:I.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),j(i,{code:I.not_multiple_of,multipleOf:o.value,message:o.message}),r.dirty()):le.assertNever(o);return{status:r.value,value:t.data}}_getInvalidInput(t){let n=this._getOrReturnCtx(t);return j(n,{code:I.invalid_type,expected:D.bigint,received:n.parsedType}),q}gte(t,n){return this.setLimit("min",t,!0,U.toString(n))}gt(t,n){return this.setLimit("min",t,!1,U.toString(n))}lte(t,n){return this.setLimit("max",t,!0,U.toString(n))}lt(t,n){return this.setLimit("max",t,!1,U.toString(n))}setLimit(t,n,i,r){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:i,message:U.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:U.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:U.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:U.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:U.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:U.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}};ca.create=e=>new ca({checks:[],typeName:P.ZodBigInt,coerce:e?.coerce??!1,...Q(e)});var ua=class extends ie{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==D.boolean){let i=this._getOrReturnCtx(t);return j(i,{code:I.invalid_type,expected:D.boolean,received:i.parsedType}),q}return ft(t.data)}};ua.create=e=>new ua({typeName:P.ZodBoolean,coerce:e?.coerce||!1,...Q(e)});var la=class e extends ie{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==D.date){let o=this._getOrReturnCtx(t);return j(o,{code:I.invalid_type,expected:D.date,received:o.parsedType}),q}if(Number.isNaN(t.data.getTime())){let o=this._getOrReturnCtx(t);return j(o,{code:I.invalid_date}),q}let i=new it,r;for(let o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(r=this._getOrReturnCtx(t,r),j(r,{code:I.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),j(r,{code:I.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),i.dirty()):le.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:U.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:U.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}};la.create=e=>new la({checks:[],coerce:e?.coerce||!1,typeName:P.ZodDate,...Q(e)});var da=class extends ie{_parse(t){if(this._getType(t)!==D.symbol){let i=this._getOrReturnCtx(t);return j(i,{code:I.invalid_type,expected:D.symbol,received:i.parsedType}),q}return ft(t.data)}};da.create=e=>new da({typeName:P.ZodSymbol,...Q(e)});var yi=class extends ie{_parse(t){if(this._getType(t)!==D.undefined){let i=this._getOrReturnCtx(t);return j(i,{code:I.invalid_type,expected:D.undefined,received:i.parsedType}),q}return ft(t.data)}};yi.create=e=>new yi({typeName:P.ZodUndefined,...Q(e)});var _i=class extends ie{_parse(t){if(this._getType(t)!==D.null){let i=this._getOrReturnCtx(t);return j(i,{code:I.invalid_type,expected:D.null,received:i.parsedType}),q}return ft(t.data)}};_i.create=e=>new _i({typeName:P.ZodNull,...Q(e)});var fa=class extends ie{constructor(){super(...arguments),this._any=!0}_parse(t){return ft(t.data)}};fa.create=e=>new fa({typeName:P.ZodAny,...Q(e)});var Xr=class extends ie{constructor(){super(...arguments),this._unknown=!0}_parse(t){return ft(t.data)}};Xr.create=e=>new Xr({typeName:P.ZodUnknown,...Q(e)});var yr=class extends ie{_parse(t){let n=this._getOrReturnCtx(t);return j(n,{code:I.invalid_type,expected:D.never,received:n.parsedType}),q}};yr.create=e=>new yr({typeName:P.ZodNever,...Q(e)});var pa=class extends ie{_parse(t){if(this._getType(t)!==D.undefined){let i=this._getOrReturnCtx(t);return j(i,{code:I.invalid_type,expected:D.void,received:i.parsedType}),q}return ft(t.data)}};pa.create=e=>new pa({typeName:P.ZodVoid,...Q(e)});var Yr=class e extends ie{_parse(t){let{ctx:n,status:i}=this._processInputParams(t),r=this._def;if(n.parsedType!==D.array)return j(n,{code:I.invalid_type,expected:D.array,received:n.parsedType}),q;if(r.exactLength!==null){let a=n.data.length>r.exactLength.value,s=n.data.length<r.exactLength.value;(a||s)&&(j(n,{code:a?I.too_big:I.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&&(j(n,{code:I.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&&(j(n,{code:I.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 Jt(n,a,n.path,s)))).then(a=>it.mergeArray(i,a));let o=[...n.data].map((a,s)=>r.type._parseSync(new Jt(n,a,n.path,s)));return it.mergeArray(i,o)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:U.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:U.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:U.toString(n)}})}nonempty(t){return this.min(1,t)}};Yr.create=(e,t)=>new Yr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:P.ZodArray,...Q(t)});function gi(e){if(e instanceof Zt){let t={};for(let n in e.shape){let i=e.shape[n];t[n]=nr.create(gi(i))}return new Zt({...e._def,shape:()=>t})}else return e instanceof Yr?new Yr({...e._def,type:gi(e.element)}):e instanceof nr?nr.create(gi(e.unwrap())):e instanceof Ur?Ur.create(gi(e.unwrap())):e instanceof Cr?Cr.create(e.items.map(t=>gi(t))):e}var Zt=class e extends ie{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=le.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==D.object){let u=this._getOrReturnCtx(t);return j(u,{code:I.invalid_type,expected:D.object,received:u.parsedType}),q}let{status:i,ctx:r}=this._processInputParams(t),{shape:o,keys:a}=this._getCached(),s=[];if(!(this._def.catchall instanceof yr&&this._def.unknownKeys==="strip"))for(let u in r.data)a.includes(u)||s.push(u);let c=[];for(let u of a){let l=o[u],d=r.data[u];c.push({key:{status:"valid",value:u},value:l._parse(new Jt(r,d,r.path,u)),alwaysSet:u in r.data})}if(this._def.catchall instanceof yr){let u=this._def.unknownKeys;if(u==="passthrough")for(let l of s)c.push({key:{status:"valid",value:l},value:{status:"valid",value:r.data[l]}});else if(u==="strict")s.length>0&&(j(r,{code:I.unrecognized_keys,keys:s}),i.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let l of s){let d=r.data[l];c.push({key:{status:"valid",value:l},value:u._parse(new Jt(r,d,r.path,l)),alwaysSet:l in r.data})}}return r.common.async?Promise.resolve().then(async()=>{let u=[];for(let l of c){let d=await l.key,f=await l.value;u.push({key:d,value:f,alwaysSet:l.alwaysSet})}return u}).then(u=>it.mergeObjectSync(i,u)):it.mergeObjectSync(i,c)}get shape(){return this._def.shape()}strict(t){return U.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:U.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:P.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 le.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 le.objectKeys(this.shape))t[i]||(n[i]=this.shape[i]);return new e({...this._def,shape:()=>n})}deepPartial(){return gi(this)}partial(t){let n={};for(let i of le.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 le.objectKeys(this.shape))if(t&&!t[i])n[i]=this.shape[i];else{let o=this.shape[i];for(;o instanceof nr;)o=o._def.innerType;n[i]=o}return new e({...this._def,shape:()=>n})}keyof(){return v$(le.objectKeys(this.shape))}};Zt.create=(e,t)=>new Zt({shape:()=>e,unknownKeys:"strip",catchall:yr.create(),typeName:P.ZodObject,...Q(t)});Zt.strictCreate=(e,t)=>new Zt({shape:()=>e,unknownKeys:"strict",catchall:yr.create(),typeName:P.ZodObject,...Q(t)});Zt.lazycreate=(e,t)=>new Zt({shape:e,unknownKeys:"strip",catchall:yr.create(),typeName:P.ZodObject,...Q(t)});var $i=class extends ie{_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 Ut(s.ctx.common.issues));return j(n,{code:I.invalid_union,unionErrors:a}),q}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 u={...n,common:{...n.common,issues:[]},parent:null},l=c._parseSync({data:n.data,path:n.path,parent:u});if(l.status==="valid")return l;l.status==="dirty"&&!o&&(o={result:l,ctx:u}),u.common.issues.length&&a.push(u.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;let s=a.map(c=>new Ut(c));return j(n,{code:I.invalid_union,unionErrors:s}),q}}get options(){return this._def.options}};$i.create=(e,t)=>new $i({options:e,typeName:P.ZodUnion,...Q(t)});var Rr=e=>e instanceof wi?Rr(e.schema):e instanceof ir?Rr(e.innerType()):e instanceof xi?[e.value]:e instanceof ki?e.options:e instanceof Si?le.objectValues(e.enum):e instanceof Ii?Rr(e._def.innerType):e instanceof yi?[void 0]:e instanceof _i?[null]:e instanceof nr?[void 0,...Rr(e.unwrap())]:e instanceof Ur?[null,...Rr(e.unwrap())]:e instanceof Nc||e instanceof Pi?Rr(e.unwrap()):e instanceof zi?Rr(e._def.innerType):[],kp=class e extends ie{_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==D.object)return j(n,{code:I.invalid_type,expected:D.object,received:n.parsedType}),q;let i=this.discriminator,r=n.data[i],o=this.optionsMap.get(r);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):(j(n,{code:I.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),q)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,i){let r=new Map;for(let o of n){let a=Rr(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:P.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:r,...Q(i)})}};function Sp(e,t){let n=Dr(e),i=Dr(t);if(e===t)return{valid:!0,data:e};if(n===D.object&&i===D.object){let r=le.objectKeys(t),o=le.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=Sp(e[s],t[s]);if(!c.valid)return{valid:!1};a[s]=c.data}return{valid:!0,data:a}}else if(n===D.array&&i===D.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=Sp(a,s);if(!c.valid)return{valid:!1};r.push(c.data)}return{valid:!0,data:r}}else return n===D.date&&i===D.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var bi=class extends ie{_parse(t){let{status:n,ctx:i}=this._processInputParams(t),r=(o,a)=>{if(bp(o)||bp(a))return q;let s=Sp(o.value,a.value);return s.valid?((wp(o)||wp(a))&&n.dirty(),{status:n.value,value:s.data}):(j(i,{code:I.invalid_intersection_types}),q)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([o,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}))}};bi.create=(e,t,n)=>new bi({left:e,right:t,typeName:P.ZodIntersection,...Q(n)});var Cr=class e extends ie{_parse(t){let{status:n,ctx:i}=this._processInputParams(t);if(i.parsedType!==D.array)return j(i,{code:I.invalid_type,expected:D.array,received:i.parsedType}),q;if(i.data.length<this._def.items.length)return j(i,{code:I.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),q;!this._def.rest&&i.data.length>this._def.items.length&&(j(i,{code:I.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 Jt(i,a,i.path,s)):null}).filter(a=>!!a);return i.common.async?Promise.all(o).then(a=>it.mergeArray(n,a)):it.mergeArray(n,o)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};Cr.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Cr({items:e,typeName:P.ZodTuple,rest:null,...Q(t)})};var Ip=class e extends ie{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!==D.object)return j(i,{code:I.invalid_type,expected:D.object,received:i.parsedType}),q;let r=[],o=this._def.keyType,a=this._def.valueType;for(let s in i.data)r.push({key:o._parse(new Jt(i,s,i.path,s)),value:a._parse(new Jt(i,i.data[s],i.path,s)),alwaysSet:s in i.data});return i.common.async?it.mergeObjectAsync(n,r):it.mergeObjectSync(n,r)}get element(){return this._def.valueType}static create(t,n,i){return n instanceof ie?new e({keyType:t,valueType:n,typeName:P.ZodRecord,...Q(i)}):new e({keyType:vi.create(),valueType:t,typeName:P.ZodRecord,...Q(n)})}},ma=class extends ie{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!==D.map)return j(i,{code:I.invalid_type,expected:D.map,received:i.parsedType}),q;let r=this._def.keyType,o=this._def.valueType,a=[...i.data.entries()].map(([s,c],u)=>({key:r._parse(new Jt(i,s,i.path,[u,"key"])),value:o._parse(new Jt(i,c,i.path,[u,"value"]))}));if(i.common.async){let s=new Map;return Promise.resolve().then(async()=>{for(let c of a){let u=await c.key,l=await c.value;if(u.status==="aborted"||l.status==="aborted")return q;(u.status==="dirty"||l.status==="dirty")&&n.dirty(),s.set(u.value,l.value)}return{status:n.value,value:s}})}else{let s=new Map;for(let c of a){let u=c.key,l=c.value;if(u.status==="aborted"||l.status==="aborted")return q;(u.status==="dirty"||l.status==="dirty")&&n.dirty(),s.set(u.value,l.value)}return{status:n.value,value:s}}}};ma.create=(e,t,n)=>new ma({valueType:t,keyType:e,typeName:P.ZodMap,...Q(n)});var ha=class e extends ie{_parse(t){let{status:n,ctx:i}=this._processInputParams(t);if(i.parsedType!==D.set)return j(i,{code:I.invalid_type,expected:D.set,received:i.parsedType}),q;let r=this._def;r.minSize!==null&&i.data.size<r.minSize.value&&(j(i,{code:I.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&&(j(i,{code:I.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 u=new Set;for(let l of c){if(l.status==="aborted")return q;l.status==="dirty"&&n.dirty(),u.add(l.value)}return{status:n.value,value:u}}let s=[...i.data.values()].map((c,u)=>o._parse(new Jt(i,c,i.path,u)));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:U.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:U.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}};ha.create=(e,t)=>new ha({valueType:e,minSize:null,maxSize:null,typeName:P.ZodSet,...Q(t)});var zp=class e extends ie{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==D.function)return j(n,{code:I.invalid_type,expected:D.function,received:n.parsedType}),q;function i(s,c){return Ec({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,oa(),Wr].filter(u=>!!u),issueData:{code:I.invalid_arguments,argumentsError:c}})}function r(s,c){return Ec({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,oa(),Wr].filter(u=>!!u),issueData:{code:I.invalid_return_type,returnTypeError:c}})}let o={errorMap:n.common.contextualErrorMap},a=n.data;if(this._def.returns instanceof jn){let s=this;return ft(async function(...c){let u=new Ut([]),l=await s._def.args.parseAsync(c,o).catch(p=>{throw u.addIssue(i(c,p)),u}),d=await Reflect.apply(a,this,l);return await s._def.returns._def.type.parseAsync(d,o).catch(p=>{throw u.addIssue(r(d,p)),u})})}else{let s=this;return ft(function(...c){let u=s._def.args.safeParse(c,o);if(!u.success)throw new Ut([i(c,u.error)]);let l=Reflect.apply(a,this,u.data),d=s._def.returns.safeParse(l,o);if(!d.success)throw new Ut([r(l,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:Cr.create(t).rest(Xr.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||Cr.create([]).rest(Xr.create()),returns:n||Xr.create(),typeName:P.ZodFunction,...Q(i)})}},wi=class extends ie{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})}};wi.create=(e,t)=>new wi({getter:e,typeName:P.ZodLazy,...Q(t)});var xi=class extends ie{_parse(t){if(t.data!==this._def.value){let n=this._getOrReturnCtx(t);return j(n,{received:n.data,code:I.invalid_literal,expected:this._def.value}),q}return{status:"valid",value:t.data}}get value(){return this._def.value}};xi.create=(e,t)=>new xi({value:e,typeName:P.ZodLiteral,...Q(t)});function v$(e,t){return new ki({values:e,typeName:P.ZodEnum,...Q(t)})}var ki=class e extends ie{_parse(t){if(typeof t.data!="string"){let n=this._getOrReturnCtx(t),i=this._def.values;return j(n,{expected:le.joinValues(i),received:n.parsedType,code:I.invalid_type}),q}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 j(n,{received:n.data,code:I.invalid_enum_value,options:i}),q}return ft(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})}};ki.create=v$;var Si=class extends ie{_parse(t){let n=le.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(t);if(i.parsedType!==D.string&&i.parsedType!==D.number){let r=le.objectValues(n);return j(i,{expected:le.joinValues(r),received:i.parsedType,code:I.invalid_type}),q}if(this._cache||(this._cache=new Set(le.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let r=le.objectValues(n);return j(i,{received:i.data,code:I.invalid_enum_value,options:r}),q}return ft(t.data)}get enum(){return this._def.values}};Si.create=(e,t)=>new Si({values:e,typeName:P.ZodNativeEnum,...Q(t)});var jn=class extends ie{unwrap(){return this._def.type}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==D.promise&&n.common.async===!1)return j(n,{code:I.invalid_type,expected:D.promise,received:n.parsedType}),q;let i=n.parsedType===D.promise?n.data:Promise.resolve(n.data);return ft(i.then(r=>this._def.type.parseAsync(r,{path:n.path,errorMap:n.common.contextualErrorMap})))}};jn.create=(e,t)=>new jn({type:e,typeName:P.ZodPromise,...Q(t)});var ir=class extends ie{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===P.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=>{j(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 q;let c=await this._def.schema._parseAsync({data:s,path:i.path,parent:i});return c.status==="aborted"?q:c.status==="dirty"?hi(c.value):n.value==="dirty"?hi(c.value):c});{if(n.value==="aborted")return q;let s=this._def.schema._parseSync({data:a,path:i.path,parent:i});return s.status==="aborted"?q:s.status==="dirty"?hi(s.value):n.value==="dirty"?hi(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"?q:(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"?q:(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(!On(a))return q;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=>On(a)?Promise.resolve(r.transform(a.value,o)).then(s=>({status:n.value,value:s})):q);le.assertNever(r)}};ir.create=(e,t,n)=>new ir({schema:e,typeName:P.ZodEffects,effect:t,...Q(n)});ir.createWithPreprocess=(e,t,n)=>new ir({schema:t,effect:{type:"preprocess",transform:e},typeName:P.ZodEffects,...Q(n)});var nr=class extends ie{_parse(t){return this._getType(t)===D.undefined?ft(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};nr.create=(e,t)=>new nr({innerType:e,typeName:P.ZodOptional,...Q(t)});var Ur=class extends ie{_parse(t){return this._getType(t)===D.null?ft(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Ur.create=(e,t)=>new Ur({innerType:e,typeName:P.ZodNullable,...Q(t)});var Ii=class extends ie{_parse(t){let{ctx:n}=this._processInputParams(t),i=n.data;return n.parsedType===D.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};Ii.create=(e,t)=>new Ii({innerType:e,typeName:P.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Q(t)});var zi=class extends ie{_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 aa(r)?r.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Ut(i.common.issues)},input:i.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new Ut(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}};zi.create=(e,t)=>new zi({innerType:e,typeName:P.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Q(t)});var ga=class extends ie{_parse(t){if(this._getType(t)!==D.nan){let i=this._getOrReturnCtx(t);return j(i,{code:I.invalid_type,expected:D.nan,received:i.parsedType}),q}return{status:"valid",value:t.data}}};ga.create=e=>new ga({typeName:P.ZodNaN,...Q(e)});var Nc=class extends ie{_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}},Ac=class e extends ie{_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"?q:o.status==="dirty"?(n.dirty(),hi(o.value)):this._def.out._parseAsync({data:o.value,path:i.path,parent:i})})();{let r=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return r.status==="aborted"?q:r.status==="dirty"?(n.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:i.path,parent:i})}}static create(t,n){return new e({in:t,out:n,typeName:P.ZodPipeline})}},Pi=class extends ie{_parse(t){let n=this._def.innerType._parse(t),i=r=>(On(r)&&(r.value=Object.freeze(r.value)),r);return aa(n)?n.then(r=>i(r)):i(n)}unwrap(){return this._def.innerType}};Pi.create=(e,t)=>new Pi({innerType:e,typeName:P.ZodReadonly,...Q(t)});var mM={object:Zt.lazycreate},P;(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"})(P||(P={}));var hM=vi.create,gM=sa.create,vM=ga.create,yM=ca.create,_M=ua.create,$M=la.create,bM=da.create,wM=yi.create,xM=_i.create,kM=fa.create,SM=Xr.create,IM=yr.create,zM=pa.create,PM=Yr.create,y$=Zt.create,TM=Zt.strictCreate,OM=$i.create,jM=kp.create,EM=bi.create,NM=Cr.create,AM=Ip.create,DM=ma.create,RM=ha.create,CM=zp.create,UM=wi.create,ZM=xi.create,MM=ki.create,LM=Si.create,VM=jn.create,FM=ir.create,qM=nr.create,BM=Ur.create,JM=ir.createWithPreprocess,HM=Ac.create;var sr={};Ar(sr,{$ZodAny:()=>Vu,$ZodArray:()=>Hu,$ZodAsyncError:()=>St,$ZodBase64:()=>Iu,$ZodBase64URL:()=>Pu,$ZodBigInt:()=>Ua,$ZodBigIntFormat:()=>Uu,$ZodBoolean:()=>Hi,$ZodCIDRv4:()=>wu,$ZodCIDRv6:()=>ku,$ZodCUID:()=>mu,$ZodCUID2:()=>hu,$ZodCatch:()=>dl,$ZodCheck:()=>we,$ZodCheckBigIntFormat:()=>Nm,$ZodCheckEndsWith:()=>Bm,$ZodCheckGreaterThan:()=>Qc,$ZodCheckIncludes:()=>Fm,$ZodCheckLengthEquals:()=>Zm,$ZodCheckLessThan:()=>Yc,$ZodCheckLowerCase:()=>Lm,$ZodCheckMaxLength:()=>Cm,$ZodCheckMaxSize:()=>Am,$ZodCheckMimeType:()=>Km,$ZodCheckMinLength:()=>Um,$ZodCheckMinSize:()=>Dm,$ZodCheckMultipleOf:()=>jm,$ZodCheckNumberFormat:()=>Em,$ZodCheckOverwrite:()=>Gm,$ZodCheckProperties:()=>Hm,$ZodCheckProperty:()=>Jm,$ZodCheckRegex:()=>Mm,$ZodCheckSizeEquals:()=>Rm,$ZodCheckStartsWith:()=>qm,$ZodCheckStringFormat:()=>Bi,$ZodCheckUpperCase:()=>Vm,$ZodCodec:()=>Gi,$ZodCreditCard:()=>ju,$ZodCustom:()=>vl,$ZodCustomStringFormat:()=>Ru,$ZodCyclicError:()=>bl,$ZodDate:()=>Ju,$ZodDefault:()=>sl,$ZodDiscriminatedUnion:()=>Wu,$ZodE164:()=>Tu,$ZodEmail:()=>su,$ZodEmoji:()=>fu,$ZodEncodeError:()=>en,$ZodEnum:()=>tl,$ZodError:()=>Bp,$ZodExactOptional:()=>ol,$ZodFile:()=>nl,$ZodFunction:()=>hl,$ZodGUID:()=>ou,$ZodIBAN:()=>Nu,$ZodIPv4:()=>_u,$ZodIPv6:()=>$u,$ZodISODate:()=>th,$ZodISODateTime:()=>eh,$ZodISODuration:()=>nh,$ZodISOTime:()=>rh,$ZodIntersection:()=>Xu,$ZodJWT:()=>Du,$ZodKSUID:()=>yu,$ZodLazy:()=>Wi,$ZodLiteral:()=>rl,$ZodMAC:()=>bu,$ZodMap:()=>Qu,$ZodNaN:()=>fl,$ZodNanoID:()=>pu,$ZodNever:()=>qu,$ZodNonOptional:()=>ul,$ZodNull:()=>Lu,$ZodNullable:()=>al,$ZodNumber:()=>Ca,$ZodNumberFormat:()=>Cu,$ZodObject:()=>Ku,$ZodObjectJIT:()=>oh,$ZodOptional:()=>Ma,$ZodPipe:()=>La,$ZodPrefault:()=>cl,$ZodPreprocess:()=>sh,$ZodPromise:()=>gl,$ZodReadonly:()=>pl,$ZodRealError:()=>It,$ZodRecord:()=>Yu,$ZodRegistry:()=>zl,$ZodSet:()=>el,$ZodString:()=>tn,$ZodStringFormat:()=>ye,$ZodSuccess:()=>ll,$ZodSymbol:()=>Zu,$ZodTemplateLiteral:()=>ml,$ZodTransform:()=>il,$ZodTuple:()=>Za,$ZodType:()=>K,$ZodULID:()=>gu,$ZodURL:()=>du,$ZodUUID:()=>au,$ZodUndefined:()=>Mu,$ZodUnion:()=>Ki,$ZodUnknown:()=>Fu,$ZodVoid:()=>Bu,$ZodXID:()=>vu,$ZodXor:()=>Gu,$brand:()=>Vp,$constructor:()=>v,$input:()=>dh,$output:()=>lh,Doc:()=>Un,INVALID:()=>ht,JSONSchema:()=>ex,JSONSchemaGenerator:()=>gd,NEVER:()=>Lp,TimePrecision:()=>_h,URL_BAD_FORMAT:()=>Ym,URL_UNPARSEABLE:()=>Ea,ZodCompileAsyncError:()=>or,ZodCompileUnsupportedError:()=>se,_any:()=>Gl,_array:()=>kh,_base64:()=>us,_base64url:()=>ls,_bigint:()=>Fl,_boolean:()=>Vl,_catch:()=>Zj,_check:()=>Uw,_cidrv4:()=>ss,_cidrv6:()=>cs,_coercedBigint:()=>wh,_coercedBoolean:()=>bh,_coercedDate:()=>xh,_coercedNumber:()=>$h,_coercedString:()=>yh,_creditCard:()=>Al,_cuid:()=>es,_cuid2:()=>ts,_custom:()=>sd,_date:()=>Ql,_decode:()=>Lc,_decodeAsync:()=>Fc,_default:()=>Rj,_discriminatedUnion:()=>kj,_e164:()=>ds,_email:()=>Ja,_emoji:()=>Ya,_encode:()=>Mc,_encodeAsync:()=>Vc,_endsWith:()=>so,_enum:()=>Oj,_file:()=>ad,_float32:()=>Ul,_float64:()=>Zl,_gt:()=>br,_gte:()=>Vt,_guid:()=>Ha,_iban:()=>Dl,_includes:()=>oo,_int:()=>Cl,_int32:()=>Ml,_int64:()=>ql,_intersection:()=>Sj,_ipv4:()=>os,_ipv6:()=>as,_isoDate:()=>ms,_isoDateTime:()=>ps,_isoDuration:()=>gs,_isoTime:()=>hs,_jwt:()=>fs,_ksuid:()=>is,_lazy:()=>Fj,_length:()=>qn,_literal:()=>Ej,_lowercase:()=>no,_lt:()=>$r,_lte:()=>Lt,_mac:()=>Nl,_map:()=>Pj,_max:()=>Lt,_maxLength:()=>Fn,_maxSize:()=>on,_mime:()=>uo,_min:()=>Vt,_minLength:()=>Vr,_minSize:()=>wr,_multipleOf:()=>nn,_nan:()=>ed,_nanoid:()=>Qa,_nativeEnum:()=>jj,_negative:()=>rd,_never:()=>Xl,_nonnegative:()=>id,_nonoptional:()=>Cj,_nonpositive:()=>nd,_normalize:()=>lo,_null:()=>Kl,_nullable:()=>Dj,_number:()=>Rl,_optional:()=>Aj,_overwrite:()=>ar,_parse:()=>Ci,_parseAsync:()=>Ui,_pipe:()=>Mj,_positive:()=>td,_promise:()=>qj,_properties:()=>co,_property:()=>od,_readonly:()=>Lj,_record:()=>zj,_refine:()=>cd,_regex:()=>ro,_safeDecode:()=>Bc,_safeDecodeAsync:()=>Hc,_safeEncode:()=>qc,_safeEncodeAsync:()=>Jc,_safeParse:()=>Zi,_safeParseAsync:()=>Li,_set:()=>Tj,_size:()=>Vn,_slugify:()=>ho,_startsWith:()=>ao,_string:()=>El,_stringFormat:()=>an,_stringbool:()=>fd,_success:()=>Uj,_superRefine:()=>ud,_symbol:()=>Jl,_templateLiteral:()=>Vj,_toLowerCase:()=>po,_toUpperCase:()=>mo,_transform:()=>Nj,_trim:()=>fo,_tuple:()=>Ij,_uint32:()=>Ll,_uint64:()=>Bl,_ulid:()=>rs,_undefined:()=>Hl,_union:()=>wj,_unknown:()=>Wl,_uppercase:()=>io,_url:()=>to,_uuid:()=>Ka,_uuidv4:()=>Ga,_uuidv6:()=>Wa,_uuidv7:()=>Xa,_void:()=>Yl,_xid:()=>ns,_xor:()=>xj,base64Charset:()=>Su,base64urlCharset:()=>Ra,canParseURL:()=>Qm,clone:()=>he,compile:()=>hh,compileFn:()=>Ol,config:()=>Ce,createStandardJSONSchemaMethod:()=>go,createToJSONSchemaMethod:()=>Ih,decode:()=>Z$,decodeAsync:()=>L$,describe:()=>ld,encode:()=>U$,encodeAsync:()=>M$,extractDefs:()=>cn,finalize:()=>un,flattenError:()=>Ia,formatError:()=>za,getDiscriminatedOption:()=>ah,globalConfig:()=>Be,globalRegistry:()=>We,handleUnrepresentable:()=>Ve,initializeContext:()=>sn,isBackEdge:()=>xl,isRecursiveSchema:()=>wl,isValidBase64:()=>Da,isValidBase64URL:()=>zu,isValidCIDRv6:()=>xu,isValidCreditCard:()=>Ou,isValidIBAN:()=>Eu,isValidIPv6:()=>Aa,isValidJWT:()=>Au,locales:()=>Qi,memoizer:()=>qa,mergeValues:()=>Ji,meta:()=>dd,parse:()=>Dn,parseAsync:()=>Rn,parseURLObject:()=>db,prettifyError:()=>Hp,process:()=>$e,processSchema:()=>$e,regexes:()=>Mt,registry:()=>Pl,safeDecode:()=>F$,safeDecodeAsync:()=>B$,safeEncode:()=>V$,safeEncodeAsync:()=>q$,safeParse:()=>Mi,safeParseAsync:()=>Vi,standardProps:()=>iu,stripTabAndNewline:()=>Na,toDotPath:()=>R$,toJSONSchema:()=>Bn,toZod:()=>va,treeifyError:()=>Jp,urlHostnameOk:()=>uu,urlProtocolOk:()=>lu,util:()=>w,validate:()=>Fi,validateAsync:()=>qi,validateURL:()=>cu,version:()=>Wm,withParser:()=>Tl});var w={};Ar(w,{BIGINT_FORMAT_RANGES:()=>ba,CONSTANT_CATCH:()=>Uc,Class:()=>Op,NUMBER_FORMAT_RANGES:()=>$a,aborted:()=>mt,allowsEval:()=>Np,assert:()=>tT,assertEqual:()=>XP,assertIs:()=>QP,assertNever:()=>eT,assertNotEqual:()=>YP,assignProp:()=>Ge,attachSchema:()=>wa,base64ToUint8Array:()=>O$,base64urlToUint8Array:()=>pT,cached:()=>Ei,captureStackTrace:()=>Rc,cleanEnum:()=>fT,cleanRegex:()=>Mr,clone:()=>he,cloneDef:()=>iT,codePointLength:()=>An,constantCatch:()=>Zp,createTransparentProxy:()=>lT,defineLazy:()=>jp,defineLazyInternal:()=>te,derived:()=>vT,esc:()=>pt,escapeRegex:()=>Gt,explicitlyAborted:()=>Rp,extend:()=>k$,finalizeIssue:()=>kt,floatSafeRemainder:()=>ya,getElementAtPath:()=>oT,getEnumValues:()=>Oi,getLengthableOrigin:()=>ka,getParsedType:()=>uT,getSizableOrigin:()=>xa,hexToUint8Array:()=>hT,hide:()=>Sa,installLazyProp:()=>Up,isObject:()=>Nn,isPlainObject:()=>Kt,issue:()=>Ri,joinValues:()=>y,jsonStringifyReplacer:()=>ji,members:()=>Cp,merge:()=>z$,mergeDefs:()=>Ht,normalizeParams:()=>z,nullish:()=>Dc,numKeys:()=>cT,objectClone:()=>rT,omit:()=>x$,optionalKeys:()=>Dp,own:()=>_r,parsedType:()=>S,partial:()=>P$,pick:()=>w$,prefixIssues:()=>xt,primitiveTypes:()=>Ap,promiseAllObject:()=>aT,propertyKeyTypes:()=>_a,randomString:()=>sT,rawShape:()=>Ni,required:()=>T$,safeExtend:()=>I$,shallowClone:()=>Ai,sizeCaps:()=>Di,slugify:()=>Ep,stringifyPrimitive:()=>x,toZod:()=>va,uint8ArrayToBase64:()=>j$,uint8ArrayToBase64url:()=>mT,uint8ArrayToHex:()=>gT,unwrapMessage:()=>Ti});function XP(e){return e}function YP(e){return e}function va(){return e=>e}function QP(e){}function eT(e){throw new Error("Unexpected value in exhaustive check")}function tT(e){}function Oi(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 y(e,t="|"){return e.map(n=>x(n)).join(t)}function ji(e,t){return typeof t=="bigint"?t.toString():t}var Tp=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 Ei(e){return new Tp(e)}function Dc(e){return e==null}function Mr(e){let t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function ya(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 _$=Symbol("evaluating");function jp(e,t,n){let i;Object.defineProperty(e,t,{get(){if(i!==_$)return i===void 0&&(i=_$,i=n()),i},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function rT(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Ge(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Ni(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function Zr(e){return Ni(e._zod.def)??e._zod.def.shape}function $$(e,t,n){Object.defineProperty(e,t,{get(){let i=n();return Ge(this,t,i),i},enumerable:!0,configurable:!0})}function b$(e,t,n){t in e?Ge(e,t,n):e[t]=n}function En(e,t,n,i){let r=Zr(t);for(let o of n){let a=Object.getOwnPropertyDescriptor(r,o);a.enumerable&&(a.get?$$(e,o,()=>{let s=t._zod.def.shape[o];return i?i(s,o):s}):b$(e,o,i?i(a.value,o):a.value))}}function nT(e,t){for(let n of Reflect.ownKeys(t)){let i=Object.getOwnPropertyDescriptor(t,n);i.enumerable&&(i.get?$$(e,n,()=>t[n]):b$(e,n,i.value))}}function Ht(...e){let t={};for(let n of e){let i=Object.getOwnPropertyDescriptors(n);Object.assign(t,i)}return Object.defineProperties({},t)}function iT(e){return Ht(e._zod.def)}function oT(e,t){return t?t.reduce((n,i)=>n?.[i],e):e}function aT(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 sT(e=10){let t="abcdefghijklmnopqrstuvwxyz",n="";for(let i=0;i<e;i++)n+=t[Math.floor(Math.random()*t.length)];return n}function pt(e){return JSON.stringify(e)}function Ep(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Rc="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Nn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Np=Ei(()=>{if(Be.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Kt(e){if(Nn(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let n=t.prototype;return!(Nn(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function Ai(e){return Kt(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function cT(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}var uT=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}`)}},_a=new Set(["string","number","symbol"]),Ap=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Gt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function he(e,t,n){let i=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(i._zod.parent=e),i}function z(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 lT(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 x(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function Dp(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var $a={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},ba={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function w$(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 En(o,e,Cc(e,t)),he(e,Ht(n,{shape:o,checks:[]}))}function Cc(e,t){let n=Zr(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 x$(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(Cc(e,t)),a={};return En(a,e,Reflect.ownKeys(Zr(e)).filter(s=>!o.has(s))),he(e,Ht(n,{shape:a,checks:[]}))}function k$(e,t){if(!Kt(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=Zr(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 he(e,Ht(e._zod.def,{shape:S$(e,t)}))}function S$(e,t){let n={};return En(n,e,Reflect.ownKeys(Zr(e))),nT(n,t),n}function I$(e,t){if(!Kt(t))throw new Error("Invalid input to safeExtend: expected a plain object");return he(e,Ht(e._zod.def,{shape:S$(e,t)}))}function z$(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={};En(n,e,Reflect.ownKeys(Zr(e))),En(n,t,Reflect.ownKeys(Zr(t)));let i=Ht(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return he(e,i)}function P$(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(Cc(t,n)):void 0,c={};return En(c,t,Reflect.ownKeys(Zr(t)),e&&((u,l)=>s&&!s.has(l)?u:new e({type:"optional",innerType:u}))),he(t,Ht(t._zod.def,{shape:c,checks:[]}))}function T$(e,t,n){let i=n?new Set(Cc(t,n)):void 0,r={};return En(r,t,Reflect.ownKeys(Zr(t)),(o,a)=>i&&!i.has(a)?o:new e({type:"nonoptional",innerType:o})),he(t,Ht(t._zod.def,{shape:r}))}function mt(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 Rp(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 xt(e,t){return t.map(n=>{var i;return(i=n).path??(i.path=[]),n.path.unshift(e),n})}function Ti(e){return typeof e=="string"?e:e?.message}function Di(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 wa(e,t,n){var i;for(let r=t;r<e.length;r++)(i=e[r]).schema??(i.schema=n)}function kt(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:Ti(e.inst?._zod.def?.error?.(e))??Ti(o?.(e))??Ti(t?.error?.(e))??Ti(n.customError?.(e))??Ti(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 xa(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}var dT=/[\uD800-\uDBFF]/;function An(e){let t=e.length;if(!dT.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 ka(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function S(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 Ri(...e){let[t,n,i]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:i}:{...t}}function fT(e){return Object.entries(e).filter(([t,n])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function O$(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 j$(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function pT(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-t.length%4)%4);return O$(t+n)}function mT(e){return j$(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function hT(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 gT(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var Op=class{constructor(...t){}};function Cp(e,t){for(let n in t){let i=Object.getOwnPropertyDescriptor(t,n);i.get?Object.defineProperty(e,n,{...i,enumerable:!1}):yT(e,n,i.value)}}function _r(e,t,n,i=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:i,value:n}),n}function Sa(e,t,n){return _r(e,t,n,!1)}function vT(e,t){for(let n in e){let i=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return _r(this,n,i(this))},set(r){_r(this,n,r)}})}return t}function yT(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:_r(this,t,n.bind(this))},set(i){_r(this,t,i)}})}function _T(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}var Pp,Qr=!1,$T={configurable:!0,get(){Qr=!0}};function te(e,t,n){let i=Object.getPrototypeOf(e._zod);if(t in i&&Pp!==e._zod){Pp=void 0;return}Pp=e._zod,Object.defineProperty(i,t,{configurable:!0,get(){Object.defineProperty(this,t,$T);let r=Qr;Qr=!1;try{let o=n(this);return Qr?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:o}),Qr=Qr||r,o}catch(o){throw delete this[t],Qr=Qr||r,o}},set(r){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r})}})}function Up(e,t,n,i){let r=_T(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 Uc="~constantCatch";function Zp(e){let t=()=>e;return t[Uc]=!0,t}var E$,Lp=Object.freeze({status:"aborted"}),Mp={value:void 0,enumerable:!1},N$="captureStackTrace"in Error?Error:null;function bT(e){let t=N$;if(t){let n=t.stackTraceLimit;if(typeof n=="number"){try{t.stackTraceLimit=0}catch{return N$=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function v(e,t,n,i){let r={};function o(f){this.def=f,this.constr=d,this.traits=new Set}o.prototype=r;let a=n,s=a&&new WeakSet;function c(f,p){if(f._zod){if(f._zod.traits.has(e))return}else{Mp.value=new o(p);try{Object.defineProperty(f,"_zod",Mp)}finally{Mp.value=void 0}}if(f._zod.traits.add(e),t(f,p),s){let h=Object.getPrototypeOf(f),g=f._zod.constr.prototype,_=h;for(;_&&_!==g;)_=Object.getPrototypeOf(_);let $=_??h;s.has($)||(s.add($),Cp($,a))}let m=d.prototype;for(let h in m)Object.prototype.hasOwnProperty.call(m,h)&&(h in f||(f[h]=m[h].bind(f)))}let u=i?.Parent??Object;class l extends u{}Object.defineProperty(l,"name",{value:e});function d(f){let p=i?.Parent?bT(l):this;c(p,f);let m=p._zod.deferred;if(m){for(let g of m)g();p._zod.deferred=void 0}let h=globalThis.__zod_globalConfig?.postProcessor;return h&&h(p),p}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:f=>i?.Parent&&f instanceof i.Parent?!0:f?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var Vp=Symbol("zod_brand"),St=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},en=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(E$=globalThis).__zod_globalConfig??(E$.__zod_globalConfig={});var Be=globalThis.__zod_globalConfig;function Ce(e){return e&&Object.assign(Be,e),Be}function wT(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,ji,2)),e.message}function xT(e){this._zod.message=e}var kT={get:wT,set:xT,enumerable:!0,configurable:!0},qp={value:void 0,enumerable:!1},A$=new WeakSet([Object.prototype,Error.prototype]),D$=(e,t)=>{e.name="$ZodError",qp.value=t,Object.defineProperty(e,"issues",qp),qp.value=void 0,Object.defineProperty(e,"message",kT);let n=Object.getPrototypeOf(e);A$.has(n)||(A$.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})}}))},Bp=v("$ZodError",D$),It=v("$ZodError",D$,void 0,{Parent:Error});function ST(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 Ia(e,t=n=>n.message){let n={},i=[];for(let r of e.issues)r.path.length>0?ST(n,r.path[0],()=>[]).push(t(r)):i.push(t(r));return{formErrors:i,fieldErrors:n}}function za(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,u=0;for(;u<s.length;){let l=s[u],d=u===s.length-1;if(l==="_errors"){d&&c._errors.push(t(a)),u++;continue}Object.prototype.hasOwnProperty.call(c,l)||Object.defineProperty(c,l,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let f=c[l];d&&f._errors.push(t(a)),c=f,u++}}}};return i(e),n}function Jp(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 u=n,l=0;for(;l<c.length;){let d=c[l],f=l===c.length-1;typeof d=="string"?(u.properties??(u.properties={}),Object.prototype.hasOwnProperty.call(u.properties,d)||Object.defineProperty(u.properties,d,{value:{errors:[]},enumerable:!0,writable:!0,configurable:!0}),u=u.properties[d]):(u.items??(u.items=[]),(a=u.items)[d]??(a[d]={errors:[]}),u=u.items[d]),f&&u.errors.push(t(s)),l++}}};return i(e),n}function R$(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 Hp(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 ${R$(i.path)}`);return t.join(`
|
|
11
11
|
`)}function Zc(e,t){return{callee:t?.callee??e,Err:t?.Err}}var Ci=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 St;if(s.issues.length){let c=new(o?.Err??e)(s.issues.map(u=>kt(u,a,Ce())));throw Rc(c,o?.callee??t),c}return s.value};return t},Dn=Ci(It),Ui=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(u=>kt(u,a,Ce())));throw Rc(c,o?.callee??t),c}return s.value};return t},Rn=Ui(It),Zi=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 St;return o.issues.length?C$(e,o.issues,r):{success:!0,data:o.value}},Mi=Zi(It);function C$(e,t,n){let i;return{success:!1,get error(){return i||(i=new e(t.map(r=>kt(r,n,Ce()))),t=void 0,n=void 0),i},set error(r){i=r,t=void 0,n=void 0}}}var Li=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?C$(e,o.issues,r):{success:!0,data:o.value}},Vi=Li(It),zT=Symbol.for("zod.compile.invalid"),PT=Symbol.for("zod.compile.fallback"),Fi=((e,t,n)=>{let i=e._zod.bag.validator;if(i!==void 0){if(i(t)!==zT)return!0;if(i.definite===!0&&n===void 0)return!1}return TT(e,t,n)});function TT(e,t,n){let i=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},r=e._zod.bag.fallbackRun,o;if(r?(i[PT]=!0,o=r({value:t,issues:[]},i)):o=e._zod.run({value:t,issues:[]},i),o instanceof Promise)throw new St;return o.issues.length===0}var qi=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},Mc=e=>{let t=Ci(e),n=(i,r,o,a)=>{let s=o?{...o,direction:"backward"}:{direction:"backward"};return t(i,r,s,Zc(n,a))};return n},U$=Mc(It),Lc=e=>{let t=Ci(e),n=(i,r,o,a)=>t(i,r,o,Zc(n,a));return n},Z$=Lc(It),Vc=e=>{let t=Ui(e),n=async(i,r,o,a)=>{let s=o?{...o,direction:"backward"}:{direction:"backward"};return await t(i,r,s,Zc(n,a))};return n},M$=Vc(It),Fc=e=>{let t=Ui(e),n=async(i,r,o,a)=>await t(i,r,o,Zc(n,a));return n},L$=Fc(It),qc=e=>(t,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return Zi(e)(t,n,r)},V$=qc(It),Bc=e=>(t,n,i)=>Zi(e)(t,n,i),F$=Bc(It),Jc=e=>async(t,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return Li(e)(t,n,r)},q$=Jc(It),Hc=e=>async(t,n,i)=>Li(e)(t,n,i),B$=Hc(It);var Mt={};Ar(Mt,{anyString:()=>$m,base64:()=>dm,base64url:()=>fm,bigint:()=>wm,boolean:()=>xm,browserEmail:()=>CT,cidrv4:()=>um,cidrv6:()=>lm,creditCard:()=>Kc,cuid:()=>Gp,cuid2:()=>Wp,currencyCode:()=>gm,date:()=>vm,datetime:()=>_m,domain:()=>mm,duration:()=>rm,e164:()=>hm,email:()=>im,emoji:()=>om,extendedDuration:()=>OT,guid:()=>nm,hex:()=>Pm,hostname:()=>pm,html5Email:()=>AT,httpProtocol:()=>Pa,iban:()=>Gc,idnEmail:()=>RT,integer:()=>Ta,ipv4:()=>am,ipv6:()=>sm,ksuid:()=>Qp,lowercase:()=>Im,mac:()=>cm,md5_base64:()=>LT,md5_base64url:()=>VT,md5_hex:()=>MT,nanoid:()=>em,nanoidOfLength:()=>tm,null:()=>km,number:()=>Lr,rfc5322Email:()=>DT,sha1_base64:()=>qT,sha1_base64url:()=>BT,sha1_hex:()=>FT,sha256_base64:()=>HT,sha256_base64url:()=>KT,sha256_hex:()=>JT,sha384_base64:()=>WT,sha384_base64url:()=>XT,sha384_hex:()=>GT,sha512_base64:()=>QT,sha512_base64url:()=>e1,sha512_hex:()=>YT,string:()=>bm,time:()=>ym,ulid:()=>Xp,undefined:()=>Sm,unicodeEmail:()=>J$,uppercase:()=>zm,uuid:()=>Cn,uuid4:()=>jT,uuid6:()=>ET,uuid7:()=>NT,xid:()=>Yp});var Gp=/^[cC][0-9a-z]{6,}$/,Wp=/^[0-9a-z]+$/,Xp=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,Yp=/^[0-9a-vA-V]{20}$/,Qp=/^[A-Za-z0-9]{27}$/,em=/^[a-zA-Z0-9_-]{21}$/;function tm(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var rm=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,OT=/^[-+]?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)?)??$/,nm=/^([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})$/,Cn=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)$/,jT=Cn(4),ET=Cn(6),NT=Cn(7),im=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,AT=/^[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])?)*$/,DT=/^(([^<>()\[\]\\.,;:\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,}))$/,J$=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,RT=J$,CT=/^[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])?)*$/,UT="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function om(){return new RegExp(UT,"u")}var am=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,sm=/^(([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}|:))$/,cm=e=>{let t=Gt(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},um=/^((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])$/,lm=/^(([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])$/,dm=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,fm=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,pm=/^(?=.{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])?)*\.?$/,mm=/^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$/,Pa=/^https?$/,hm=/^\+[1-9]\d{6,14}$/,Kc=/^\d(?:[ -]?\d){11,18}$/,gm=/^(?: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)$/,Gc=/^[A-Z]{2}(?!00|01|99)\d{2}[A-Z0-9]{11,30}$/,H$="(?:(?:\\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 ZT(e){return new RegExp(`^${e}$`)}var vm=ZT(H$);function Kp(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 ym(e){return new RegExp(`^${Kp(e)}$`)}function _m(e){let t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let n=`${Kp({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,i=e.local?`${n}|${Kp({precision:e.precision})}`:n;return new RegExp(`^${H$}T(?:${i})$`)}var $m=/^[\s\S]{0,}$/,bm=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},wm=/^-?\d+n?$/,Ta=/^-?\d+$/,Lr=/^-?\d+(?:\.\d+)?$/,xm=/^(?:true|false)$/i,km=/^null$/i;var Sm=/^undefined$/i;var Im=/^[^A-Z]*$/,zm=/^[^a-z]*$/,Pm=/^[0-9a-fA-F]*$/;function Oa(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function ja(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var MT=/^[0-9a-fA-F]{32}$/,LT=Oa(22,"=="),VT=ja(22),FT=/^[0-9a-fA-F]{40}$/,qT=Oa(27,"="),BT=ja(27),JT=/^[0-9a-fA-F]{64}$/,HT=Oa(43,"="),KT=ja(43),GT=/^[0-9a-fA-F]{96}$/,WT=Oa(64,""),XT=ja(64),YT=/^[0-9a-fA-F]{128}$/,QT=Oa(86,"=="),e1=ja(86);var we=v("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Tm=e=>{let t=e.value;return!Dc(t)&&t.size!==void 0},Om=e=>{let t=e.value;return!Dc(t)&&t.length!==void 0},Wc={number:"number",bigint:"bigint",object:"date"},Yc=v("$ZodCheckLessThan",(e,t)=>{we.init(e,t);let n=Wc[typeof t.value];e._zod.check=i=>{(t.inclusive?i.value<=t.value:i.value<t.value)||i.issues.push({origin:Wc[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})}}),Qc=v("$ZodCheckGreaterThan",(e,t)=>{we.init(e,t);let n=Wc[typeof t.value];e._zod.check=i=>{(t.inclusive?i.value>=t.value:i.value>t.value)||i.issues.push({origin:Wc[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})}}),jm=v("$ZodCheckMultipleOf",(e,t)=>{we.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):ya(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})}}),Em=v("$ZodCheckNumberFormat",(e,t)=>{we.init(e,t),t.format=t.format||"float64";let n=t.format?.includes("int"),i=n?"int":"number",[r,o]=$a[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})}}),Nm=v("$ZodCheckBigIntFormat",(e,t)=>{we.init(e,t);let[n,i]=ba[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})}}),Am=v("$ZodCheckMaxSize",(e,t)=>{var n;we.init(e,t),(n=e._zod.def).when??(n.when=Tm),e._zod.check=i=>{let r=i.value;r.size<=t.maximum||i.issues.push({origin:xa(r),code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Dm=v("$ZodCheckMinSize",(e,t)=>{var n;we.init(e,t),(n=e._zod.def).when??(n.when=Tm),e._zod.check=i=>{let r=i.value;r.size>=t.minimum||i.issues.push({origin:xa(r),code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Rm=v("$ZodCheckSizeEquals",(e,t)=>{var n;we.init(e,t),(n=e._zod.def).when??(n.when=Tm),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:xa(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})}}),Cm=v("$ZodCheckMaxLength",(e,t)=>{var n;we.init(e,t),(n=e._zod.def).when??(n.when=Om),e._zod.check=i=>{let r=i.value,o=r.length;if((typeof r=="string"&&o>t.maximum?An(r):o)<=t.maximum)return;let s=ka(r);i.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Um=v("$ZodCheckMinLength",(e,t)=>{var n;we.init(e,t),(n=e._zod.def).when??(n.when=Om),e._zod.check=i=>{let r=i.value,o=r.length;if((typeof r=="string"&&o>=t.minimum&&o<t.minimum*2?An(r):o)>=t.minimum)return;let s=ka(r);i.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Zm=v("$ZodCheckLengthEquals",(e,t)=>{var n;we.init(e,t),(n=e._zod.def).when??(n.when=Om),e._zod.check=i=>{let r=i.value,o=r.length,a=typeof r=="string"&&o>=t.length&&o<=t.length*2?An(r):o;if(a===t.length)return;let s=ka(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})}}),Bi=v("$ZodCheckStringFormat",(e,t)=>{var n,i;we.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=()=>{})}),Mm=v("$ZodCheckRegex",(e,t)=>{Bi.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})}}),Lm=v("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Im),Bi.init(e,t)}),Vm=v("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=zm),Bi.init(e,t)}),Fm=v("$ZodCheckIncludes",(e,t)=>{we.init(e,t);let n=Gt(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})}}),qm=v("$ZodCheckStartsWith",(e,t)=>{we.init(e,t);let n=new RegExp(`^${Gt(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})}}),Bm=v("$ZodCheckEndsWith",(e,t)=>{we.init(e,t);let n=new RegExp(`.*${Gt(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 Xc(e,t,n){e.issues.length&&t.issues.push(...xt(n,e.issues))}var Jm=v("$ZodCheckProperty",(e,t)=>{we.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=>Xc(r,n,t.property));Xc(i,n,t.property)}}),Hm=v("$ZodCheckProperties",(e,t)=>{we.init(e,t),Sa(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(u=>Xc(u,i,a)))):Xc(c,i,a)}if(o)return Promise.all(o).then(()=>{})}}),Km=v("$ZodCheckMimeType",(e,t)=>{we.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})}}),Gm=v("$ZodCheckOverwrite",(e,t)=>{we.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});var Un=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(`
|
|
12
12
|
`).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(", ")}) {
|
|
13
13
|
${n.join(`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@heylatch/cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "Latch CLI and MCP server: publish protected scripts, manage versions and grant access from your terminal, CI or AI agent.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
},
|
|
9
9
|
"files": [
|
|
10
10
|
"dist",
|
|
11
|
-
"README.md"
|
|
11
|
+
"README.md",
|
|
12
|
+
"LICENSE"
|
|
12
13
|
],
|
|
13
14
|
"engines": {
|
|
14
15
|
"node": ">=20"
|
|
@@ -22,7 +23,7 @@
|
|
|
22
23
|
"script-protection"
|
|
23
24
|
],
|
|
24
25
|
"homepage": "https://heylatch.app/docs/automation",
|
|
25
|
-
"license": "
|
|
26
|
+
"license": "MIT",
|
|
26
27
|
"scripts": {
|
|
27
28
|
"build": "node build.mjs",
|
|
28
29
|
"typecheck": "tsc --noEmit",
|