tacticyl 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +80 -0
- package/bin/tacticyl.js +22 -0
- package/dist/tacticyl.cjs +1012 -0
- package/package.json +41 -0
|
@@ -0,0 +1,1012 @@
|
|
|
1
|
+
const __tacticyl_import_meta_url = require("node:url").pathToFileURL(__filename).href;
|
|
2
|
+
"use strict";var FK=Object.create;var Eu=Object.defineProperty;var qK=Object.getOwnPropertyDescriptor;var ZK=Object.getOwnPropertyNames;var VK=Object.getPrototypeOf,BK=Object.prototype.hasOwnProperty;var a=(t,e)=>Eu(t,"name",{value:e,configurable:!0});var I=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Tr=(t,e)=>{for(var n in e)Eu(t,n,{get:e[n],enumerable:!0})},BP=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of ZK(e))!BK.call(t,r)&&r!==n&&Eu(t,r,{get:()=>e[r],enumerable:!(i=qK(e,r))||i.enumerable});return t};var ta=(t,e,n)=>(n=t!=null?FK(VK(t)):{},BP(e||!t||!t.__esModule?Eu(n,"default",{value:t,enumerable:!0}):n,t)),KK=t=>BP(Eu({},"__esModule",{value:!0}),t);var be=I(Et=>{"use strict";var YE=Symbol.for("yaml.alias"),OL=Symbol.for("yaml.document"),Tv=Symbol.for("yaml.map"),NL=Symbol.for("yaml.pair"),XE=Symbol.for("yaml.scalar"),Av=Symbol.for("yaml.seq"),ni=Symbol.for("yaml.node.type"),KX=a(t=>!!t&&typeof t=="object"&&t[ni]===YE,"isAlias"),HX=a(t=>!!t&&typeof t=="object"&&t[ni]===OL,"isDocument"),WX=a(t=>!!t&&typeof t=="object"&&t[ni]===Tv,"isMap"),GX=a(t=>!!t&&typeof t=="object"&&t[ni]===NL,"isPair"),CL=a(t=>!!t&&typeof t=="object"&&t[ni]===XE,"isScalar"),JX=a(t=>!!t&&typeof t=="object"&&t[ni]===Av,"isSeq");function PL(t){if(t&&typeof t=="object")switch(t[ni]){case Tv:case Av:return!0}return!1}a(PL,"isCollection");function YX(t){if(t&&typeof t=="object")switch(t[ni]){case YE:case Tv:case XE:case Av:return!0}return!1}a(YX,"isNode");var XX=a(t=>(CL(t)||PL(t))&&!!t.anchor,"hasAnchor");Et.ALIAS=YE;Et.DOC=OL;Et.MAP=Tv;Et.NODE_TYPE=ni;Et.PAIR=NL;Et.SCALAR=XE;Et.SEQ=Av;Et.hasAnchor=XX;Et.isAlias=KX;Et.isCollection=PL;Et.isDocument=HX;Et.isMap=WX;Et.isNode=YX;Et.isPair=GX;Et.isScalar=CL;Et.isSeq=JX});var mf=I(QE=>{"use strict";var ft=be(),yn=Symbol("break visit"),RL=Symbol("skip children"),Dr=Symbol("remove node");function Ov(t,e){let n=jL(e);ft.isDocument(t)?lc(null,t.contents,n,Object.freeze([t]))===Dr&&(t.contents=null):lc(null,t,n,Object.freeze([]))}a(Ov,"visit");Ov.BREAK=yn;Ov.SKIP=RL;Ov.REMOVE=Dr;function lc(t,e,n,i){let r=zL(t,e,n,i);if(ft.isNode(r)||ft.isPair(r))return DL(t,i,r),lc(t,r,n,i);if(typeof r!="symbol"){if(ft.isCollection(e)){i=Object.freeze(i.concat(e));for(let o=0;o<e.items.length;++o){let s=lc(o,e.items[o],n,i);if(typeof s=="number")o=s-1;else{if(s===yn)return yn;s===Dr&&(e.items.splice(o,1),o-=1)}}}else if(ft.isPair(e)){i=Object.freeze(i.concat(e));let o=lc("key",e.key,n,i);if(o===yn)return yn;o===Dr&&(e.key=null);let s=lc("value",e.value,n,i);if(s===yn)return yn;s===Dr&&(e.value=null)}}return r}a(lc,"visit_");async function Nv(t,e){let n=jL(e);ft.isDocument(t)?await dc(null,t.contents,n,Object.freeze([t]))===Dr&&(t.contents=null):await dc(null,t,n,Object.freeze([]))}a(Nv,"visitAsync");Nv.BREAK=yn;Nv.SKIP=RL;Nv.REMOVE=Dr;async function dc(t,e,n,i){let r=await zL(t,e,n,i);if(ft.isNode(r)||ft.isPair(r))return DL(t,i,r),dc(t,r,n,i);if(typeof r!="symbol"){if(ft.isCollection(e)){i=Object.freeze(i.concat(e));for(let o=0;o<e.items.length;++o){let s=await dc(o,e.items[o],n,i);if(typeof s=="number")o=s-1;else{if(s===yn)return yn;s===Dr&&(e.items.splice(o,1),o-=1)}}}else if(ft.isPair(e)){i=Object.freeze(i.concat(e));let o=await dc("key",e.key,n,i);if(o===yn)return yn;o===Dr&&(e.key=null);let s=await dc("value",e.value,n,i);if(s===yn)return yn;s===Dr&&(e.value=null)}}return r}a(dc,"visitAsync_");function jL(t){return typeof t=="object"&&(t.Collection||t.Node||t.Value)?Object.assign({Alias:t.Node,Map:t.Node,Scalar:t.Node,Seq:t.Node},t.Value&&{Map:t.Value,Scalar:t.Value,Seq:t.Value},t.Collection&&{Map:t.Collection,Seq:t.Collection},t):t}a(jL,"initVisitor");function zL(t,e,n,i){if(typeof n=="function")return n(t,e,i);if(ft.isMap(e))return n.Map?.(t,e,i);if(ft.isSeq(e))return n.Seq?.(t,e,i);if(ft.isPair(e))return n.Pair?.(t,e,i);if(ft.isScalar(e))return n.Scalar?.(t,e,i);if(ft.isAlias(e))return n.Alias?.(t,e,i)}a(zL,"callVisitor");function DL(t,e,n){let i=e[e.length-1];if(ft.isCollection(i))i.items[t]=n;else if(ft.isPair(i))t==="key"?i.key=n:i.value=n;else if(ft.isDocument(i))i.contents=n;else{let r=ft.isAlias(i)?"alias":"scalar";throw new Error(`Cannot replace node with ${r} parent`)}}a(DL,"replaceNode");QE.visit=Ov;QE.visitAsync=Nv});var eT=I(ML=>{"use strict";var LL=be(),QX=mf(),e7={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},t7=a(t=>t.replace(/[!,[\]{}]/g,e=>e7[e]),"escapeTagName"),hf=class t{static{a(this,"Directives")}constructor(e,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},t.defaultYaml,e),this.tags=Object.assign({},t.defaultTags,n)}clone(){let e=new t(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new t(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:t.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},t.defaultTags);break}return e}add(e,n){this.atNextDocument&&(this.yaml={explicit:t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},t.defaultTags),this.atNextDocument=!1);let i=e.trim().split(/[ \t]+/),r=i.shift();switch(r){case"%TAG":{if(i.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),i.length<2))return!1;let[o,s]=i;return this.tags[o]=s,!0}case"%YAML":{if(this.yaml.explicit=!0,i.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;let[o]=i;if(o==="1.1"||o==="1.2")return this.yaml.version=o,!0;{let s=/^\d+\.\d+$/.test(o);return n(6,`Unsupported YAML version ${o}`,s),!1}}default:return n(0,`Unknown directive ${r}`,!0),!1}}tagName(e,n){if(e==="!")return"!";if(e[0]!=="!")return n(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let s=e.slice(2,-1);return s==="!"||s==="!!"?(n(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&n("Verbatim tags must end with a >"),s)}let[,i,r]=e.match(/^(.*!)([^!]*)$/s);r||n(`The ${e} tag has no suffix`);let o=this.tags[i];if(o)try{return o+decodeURIComponent(r)}catch(s){return n(String(s)),null}return i==="!"?e:(n(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[n,i]of Object.entries(this.tags))if(e.startsWith(i))return n+t7(e.substring(i.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],i=Object.entries(this.tags),r;if(e&&i.length>0&&LL.isNode(e.contents)){let o={};QX.visit(e.contents,(s,c)=>{LL.isNode(c)&&c.tag&&(o[c.tag]=!0)}),r=Object.keys(o)}else r=[];for(let[o,s]of i)o==="!!"&&s==="tag:yaml.org,2002:"||(!e||r.some(c=>c.startsWith(s)))&&n.push(`%TAG ${o} ${s}`);return n.join(`
|
|
3
|
+
`)}};hf.defaultYaml={explicit:!1,version:"1.2"};hf.defaultTags={"!!":"tag:yaml.org,2002:"};ML.Directives=hf});var Cv=I(gf=>{"use strict";var UL=be(),n7=mf();function r7(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){let n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(n)}return!0}a(r7,"anchorIsValid");function FL(t){let e=new Set;return n7.visit(t,{Value(n,i){i.anchor&&e.add(i.anchor)}}),e}a(FL,"anchorNames");function qL(t,e){for(let n=1;;++n){let i=`${t}${n}`;if(!e.has(i))return i}}a(qL,"findNewAnchor");function i7(t,e){let n=[],i=new Map,r=null;return{onAnchor:a(o=>{n.push(o),r??(r=FL(t));let s=qL(e,r);return r.add(s),s},"onAnchor"),setAnchors:a(()=>{for(let o of n){let s=i.get(o);if(typeof s=="object"&&s.anchor&&(UL.isScalar(s.node)||UL.isCollection(s.node)))s.node.anchor=s.anchor;else{let c=new Error("Failed to resolve repeated object (this should not happen)");throw c.source=o,c}}},"setAnchors"),sourceObjects:i}}a(i7,"createNodeAnchors");gf.anchorIsValid=r7;gf.anchorNames=FL;gf.createNodeAnchors=i7;gf.findNewAnchor=qL});var tT=I(ZL=>{"use strict";function yf(t,e,n,i){if(i&&typeof i=="object")if(Array.isArray(i))for(let r=0,o=i.length;r<o;++r){let s=i[r],c=yf(t,i,String(r),s);c===void 0?delete i[r]:c!==s&&(i[r]=c)}else if(i instanceof Map)for(let r of Array.from(i.keys())){let o=i.get(r),s=yf(t,i,r,o);s===void 0?i.delete(r):s!==o&&i.set(r,s)}else if(i instanceof Set)for(let r of Array.from(i)){let o=yf(t,i,r,r);o===void 0?i.delete(r):o!==r&&(i.delete(r),i.add(o))}else for(let[r,o]of Object.entries(i)){let s=yf(t,i,r,o);s===void 0?delete i[r]:s!==o&&(i[r]=s)}return t.call(e,n,i)}a(yf,"applyReviver");ZL.applyReviver=yf});var oo=I(BL=>{"use strict";var o7=be();function VL(t,e,n){if(Array.isArray(t))return t.map((i,r)=>VL(i,String(r),n));if(t&&typeof t.toJSON=="function"){if(!n||!o7.hasAnchor(t))return t.toJSON(e,n);let i={aliasCount:0,count:1,res:void 0};n.anchors.set(t,i),n.onCreate=o=>{i.res=o,delete n.onCreate};let r=t.toJSON(e,n);return n.onCreate&&n.onCreate(r),r}return typeof t=="bigint"&&!n?.keep?Number(t):t}a(VL,"toJS");BL.toJS=VL});var Pv=I(HL=>{"use strict";var s7=tT(),KL=be(),a7=oo(),nT=class{static{a(this,"NodeBase")}constructor(e){Object.defineProperty(this,KL.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:n,maxAliasCount:i,onAnchor:r,reviver:o}={}){if(!KL.isDocument(e))throw new TypeError("A document argument is required");let s={anchors:new Map,doc:e,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},c=a7.toJS(this,"",s);if(typeof r=="function")for(let{count:u,res:l}of s.anchors.values())r(l,u);return typeof o=="function"?s7.applyReviver(o,{"":c},"",c):c}};HL.NodeBase=nT});var vf=I(WL=>{"use strict";var c7=Cv(),u7=mf(),fc=be(),l7=Pv(),d7=oo(),rT=class extends l7.NodeBase{static{a(this,"Alias")}constructor(e){super(fc.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,n){if(n?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let i;n?.aliasResolveCache?i=n.aliasResolveCache:(i=[],u7.visit(e,{Node:a((o,s)=>{(fc.isAlias(s)||fc.hasAnchor(s))&&i.push(s)},"Node")}),n&&(n.aliasResolveCache=i));let r;for(let o of i){if(o===this)break;o.anchor===this.source&&(r=o)}return r}toJSON(e,n){if(!n)return{source:this.source};let{anchors:i,doc:r,maxAliasCount:o}=n,s=this.resolve(r,n);if(!s){let u=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(u)}let c=i.get(s);if(c||(d7.toJS(s,null,n),c=i.get(s)),c?.res===void 0){let u="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(u)}if(o>=0&&(c.count+=1,c.aliasCount===0&&(c.aliasCount=Rv(r,s,i)),c.count*c.aliasCount>o)){let u="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(u)}return c.res}toString(e,n,i){let r=`*${this.source}`;if(e){if(c7.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let o=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(o)}if(e.implicitKey)return`${r} `}return r}};function Rv(t,e,n){if(fc.isAlias(e)){let i=e.resolve(t),r=n&&i&&n.get(i);return r?r.count*r.aliasCount:0}else if(fc.isCollection(e)){let i=0;for(let r of e.items){let o=Rv(t,r,n);o>i&&(i=o)}return i}else if(fc.isPair(e)){let i=Rv(t,e.key,n),r=Rv(t,e.value,n);return Math.max(i,r)}return 1}a(Rv,"getAliasCount");WL.Alias=rT});var at=I(iT=>{"use strict";var f7=be(),p7=Pv(),m7=oo(),h7=a(t=>!t||typeof t!="function"&&typeof t!="object","isScalarValue"),so=class extends p7.NodeBase{static{a(this,"Scalar")}constructor(e){super(f7.SCALAR),this.value=e}toJSON(e,n){return n?.keep?this.value:m7.toJS(this.value,e,n)}toString(){return String(this.value)}};so.BLOCK_FOLDED="BLOCK_FOLDED";so.BLOCK_LITERAL="BLOCK_LITERAL";so.PLAIN="PLAIN";so.QUOTE_DOUBLE="QUOTE_DOUBLE";so.QUOTE_SINGLE="QUOTE_SINGLE";iT.Scalar=so;iT.isScalarValue=h7});var bf=I(JL=>{"use strict";var g7=vf(),hs=be(),GL=at(),y7="tag:yaml.org,2002:";function v7(t,e,n){if(e){let i=n.filter(o=>o.tag===e),r=i.find(o=>!o.format)??i[0];if(!r)throw new Error(`Tag ${e} not found`);return r}return n.find(i=>i.identify?.(t)&&!i.format)}a(v7,"findTagObject");function b7(t,e,n){if(hs.isDocument(t)&&(t=t.contents),hs.isNode(t))return t;if(hs.isPair(t)){let f=n.schema[hs.MAP].createNode?.(n.schema,null,n);return f.items.push(t),f}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());let{aliasDuplicateObjects:i,onAnchor:r,onTagObj:o,schema:s,sourceObjects:c}=n,u;if(i&&t&&typeof t=="object"){if(u=c.get(t),u)return u.anchor??(u.anchor=r(t)),new g7.Alias(u.anchor);u={anchor:null,node:null},c.set(t,u)}e?.startsWith("!!")&&(e=y7+e.slice(2));let l=v7(t,e,s.tags);if(!l){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let f=new GL.Scalar(t);return u&&(u.node=f),f}l=t instanceof Map?s[hs.MAP]:Symbol.iterator in Object(t)?s[hs.SEQ]:s[hs.MAP]}o&&(o(l),delete n.onTagObj);let d=l?.createNode?l.createNode(n.schema,t,n):typeof l?.nodeClass?.from=="function"?l.nodeClass.from(n.schema,t,n):new GL.Scalar(t);return e?d.tag=e:l.default||(d.tag=l.tag),u&&(u.node=d),d}a(b7,"createNode");JL.createNode=b7});var zv=I(jv=>{"use strict";var w7=bf(),Lr=be(),$7=Pv();function oT(t,e,n){let i=n;for(let r=e.length-1;r>=0;--r){let o=e[r];if(typeof o=="number"&&Number.isInteger(o)&&o>=0){let s=[];s[o]=i,i=s}else i=new Map([[o,i]])}return w7.createNode(i,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:a(()=>{throw new Error("This should not happen, please report a bug.")},"onAnchor"),schema:t,sourceObjects:new Map})}a(oT,"collectionFromPath");var YL=a(t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,"isEmptyPath"),sT=class extends $7.NodeBase{static{a(this,"Collection")}constructor(e,n){super(e),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(e){let n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(n.schema=e),n.items=n.items.map(i=>Lr.isNode(i)||Lr.isPair(i)?i.clone(e):i),this.range&&(n.range=this.range.slice()),n}addIn(e,n){if(YL(e))this.add(n);else{let[i,...r]=e,o=this.get(i,!0);if(Lr.isCollection(o))o.addIn(r,n);else if(o===void 0&&this.schema)this.set(i,oT(this.schema,r,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}}deleteIn(e){let[n,...i]=e;if(i.length===0)return this.delete(n);let r=this.get(n,!0);if(Lr.isCollection(r))return r.deleteIn(i);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}getIn(e,n){let[i,...r]=e,o=this.get(i,!0);return r.length===0?!n&&Lr.isScalar(o)?o.value:o:Lr.isCollection(o)?o.getIn(r,n):void 0}hasAllNullValues(e){return this.items.every(n=>{if(!Lr.isPair(n))return!1;let i=n.value;return i==null||e&&Lr.isScalar(i)&&i.value==null&&!i.commentBefore&&!i.comment&&!i.tag})}hasIn(e){let[n,...i]=e;if(i.length===0)return this.has(n);let r=this.get(n,!0);return Lr.isCollection(r)?r.hasIn(i):!1}setIn(e,n){let[i,...r]=e;if(r.length===0)this.set(i,n);else{let o=this.get(i,!0);if(Lr.isCollection(o))o.setIn(r,n);else if(o===void 0&&this.schema)this.set(i,oT(this.schema,r,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}}};jv.Collection=sT;jv.collectionFromPath=oT;jv.isEmptyPath=YL});var wf=I(Dv=>{"use strict";var _7=a(t=>t.replace(/^(?!$)(?: $)?/gm,"#"),"stringifyComment");function aT(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}a(aT,"indentComment");var k7=a((t,e,n)=>t.endsWith(`
|
|
4
|
+
`)?aT(n,e):n.includes(`
|
|
5
|
+
`)?`
|
|
6
|
+
`+aT(n,e):(t.endsWith(" ")?"":" ")+n,"lineComment");Dv.indentComment=aT;Dv.lineComment=k7;Dv.stringifyComment=_7});var QL=I($f=>{"use strict";var x7="flow",cT="block",Lv="quoted";function S7(t,e,n="flow",{indentAtStart:i,lineWidth:r=80,minContentWidth:o=20,onFold:s,onOverflow:c}={}){if(!r||r<0)return t;r<o&&(o=0);let u=Math.max(1+o,1+r-e.length);if(t.length<=u)return t;let l=[],d={},f=r-e.length;typeof i=="number"&&(i>r-Math.max(2,o)?l.push(0):f=r-i);let p,m,g=!1,y=-1,v=-1,w=-1;n===cT&&(y=XL(t,y,e.length),y!==-1&&(f=y+u));for(let $;$=t[y+=1];){if(n===Lv&&$==="\\"){switch(v=y,t[y+1]){case"x":y+=3;break;case"u":y+=5;break;case"U":y+=9;break;default:y+=1}w=y}if($===`
|
|
7
|
+
`)n===cT&&(y=XL(t,y,e.length)),f=y+e.length+u,p=void 0;else{if($===" "&&m&&m!==" "&&m!==`
|
|
8
|
+
`&&m!==" "){let x=t[y+1];x&&x!==" "&&x!==`
|
|
9
|
+
`&&x!==" "&&(p=y)}if(y>=f)if(p)l.push(p),f=p+u,p=void 0;else if(n===Lv){for(;m===" "||m===" ";)m=$,$=t[y+=1],g=!0;let x=y>w+1?y-2:v-1;if(d[x])return t;l.push(x),d[x]=!0,f=x+u,p=void 0}else g=!0}m=$}if(g&&c&&c(),l.length===0)return t;s&&s();let b=t.slice(0,l[0]);for(let $=0;$<l.length;++$){let x=l[$],T=l[$+1]||t.length;x===0?b=`
|
|
10
|
+
${e}${t.slice(0,T)}`:(n===Lv&&d[x]&&(b+=`${t[x]}\\`),b+=`
|
|
11
|
+
${e}${t.slice(x+1,T)}`)}return b}a(S7,"foldFlowLines");function XL(t,e,n){let i=e,r=e+1,o=t[r];for(;o===" "||o===" ";)if(e<r+n)o=t[++e];else{do o=t[++e];while(o&&o!==`
|
|
12
|
+
`);i=e,r=e+1,o=t[r]}return i}a(XL,"consumeMoreIndentedLines");$f.FOLD_BLOCK=cT;$f.FOLD_FLOW=x7;$f.FOLD_QUOTED=Lv;$f.foldFlowLines=S7});var kf=I(eM=>{"use strict";var dr=at(),ao=QL(),Uv=a((t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),"getFoldOptions"),Fv=a(t=>/^(%|---|\.\.\.)/m.test(t),"containsDocumentMarker");function I7(t,e,n){if(!e||e<0)return!1;let i=e-n,r=t.length;if(r<=i)return!1;for(let o=0,s=0;o<r;++o)if(t[o]===`
|
|
13
|
+
`){if(o-s>i)return!0;if(s=o+1,r-s<=i)return!1}return!0}a(I7,"lineLengthOverLimit");function _f(t,e){let n=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return n;let{implicitKey:i}=e,r=e.options.doubleQuotedMinMultiLineLength,o=e.indent||(Fv(t)?" ":""),s="",c=0;for(let u=0,l=n[u];l;l=n[++u])if(l===" "&&n[u+1]==="\\"&&n[u+2]==="n"&&(s+=n.slice(c,u)+"\\ ",u+=1,c=u,l="\\"),l==="\\")switch(n[u+1]){case"u":{s+=n.slice(c,u);let d=n.substr(u+2,4);switch(d){case"0000":s+="\\0";break;case"0007":s+="\\a";break;case"000b":s+="\\v";break;case"001b":s+="\\e";break;case"0085":s+="\\N";break;case"00a0":s+="\\_";break;case"2028":s+="\\L";break;case"2029":s+="\\P";break;default:d.substr(0,2)==="00"?s+="\\x"+d.substr(2):s+=n.substr(u,6)}u+=5,c=u+1}break;case"n":if(i||n[u+2]==='"'||n.length<r)u+=1;else{for(s+=n.slice(c,u)+`
|
|
14
|
+
|
|
15
|
+
`;n[u+2]==="\\"&&n[u+3]==="n"&&n[u+4]!=='"';)s+=`
|
|
16
|
+
`,u+=2;s+=o,n[u+2]===" "&&(s+="\\"),u+=1,c=u+1}break;default:u+=1}return s=c?s+n.slice(c):n,i?s:ao.foldFlowLines(s,o,ao.FOLD_QUOTED,Uv(e,!1))}a(_f,"doubleQuotedString");function uT(t,e){if(e.options.singleQuote===!1||e.implicitKey&&t.includes(`
|
|
17
|
+
`)||/[ \t]\n|\n[ \t]/.test(t))return _f(t,e);let n=e.indent||(Fv(t)?" ":""),i="'"+t.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
18
|
+
${n}`)+"'";return e.implicitKey?i:ao.foldFlowLines(i,n,ao.FOLD_FLOW,Uv(e,!1))}a(uT,"singleQuotedString");function pc(t,e){let{singleQuote:n}=e.options,i;if(n===!1)i=_f;else{let r=t.includes('"'),o=t.includes("'");r&&!o?i=uT:o&&!r?i=_f:i=n?uT:_f}return i(t,e)}a(pc,"quotedString");var lT;try{lT=new RegExp(`(^|(?<!
|
|
19
|
+
))
|
|
20
|
+
+(?!
|
|
21
|
+
|$)`,"g")}catch{lT=/\n+(?!\n|$)/g}function Mv({comment:t,type:e,value:n},i,r,o){let{blockQuote:s,commentString:c,lineWidth:u}=i.options;if(!s||/\n[\t ]+$/.test(n))return pc(n,i);let l=i.indent||(i.forceBlockIndent||Fv(n)?" ":""),d=s==="literal"?!0:s==="folded"||e===dr.Scalar.BLOCK_FOLDED?!1:e===dr.Scalar.BLOCK_LITERAL?!0:!I7(n,u,l.length);if(!n)return d?`|
|
|
22
|
+
`:`>
|
|
23
|
+
`;let f,p;for(p=n.length;p>0;--p){let T=n[p-1];if(T!==`
|
|
24
|
+
`&&T!==" "&&T!==" ")break}let m=n.substring(p),g=m.indexOf(`
|
|
25
|
+
`);g===-1?f="-":n===m||g!==m.length-1?(f="+",o&&o()):f="",m&&(n=n.slice(0,-m.length),m[m.length-1]===`
|
|
26
|
+
`&&(m=m.slice(0,-1)),m=m.replace(lT,`$&${l}`));let y=!1,v,w=-1;for(v=0;v<n.length;++v){let T=n[v];if(T===" ")y=!0;else if(T===`
|
|
27
|
+
`)w=v;else break}let b=n.substring(0,w<v?w+1:v);b&&(n=n.substring(b.length),b=b.replace(/\n+/g,`$&${l}`));let x=(y?l?"2":"1":"")+f;if(t&&(x+=" "+c(t.replace(/ ?[\r\n]+/g," ")),r&&r()),!d){let T=n.replace(/\n+/g,`
|
|
28
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`),C=!1,Z=Uv(i,!0);s!=="folded"&&e!==dr.Scalar.BLOCK_FOLDED&&(Z.onOverflow=()=>{C=!0});let S=ao.foldFlowLines(`${b}${T}${m}`,l,ao.FOLD_BLOCK,Z);if(!C)return`>${x}
|
|
29
|
+
${l}${S}`}return n=n.replace(/\n+/g,`$&${l}`),`|${x}
|
|
30
|
+
${l}${b}${n}${m}`}a(Mv,"blockString");function E7(t,e,n,i){let{type:r,value:o}=t,{actualString:s,implicitKey:c,indent:u,indentStep:l,inFlow:d}=e;if(c&&o.includes(`
|
|
31
|
+
`)||d&&/[[\]{},]/.test(o))return pc(o,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(o))return c||d||!o.includes(`
|
|
32
|
+
`)?pc(o,e):Mv(t,e,n,i);if(!c&&!d&&r!==dr.Scalar.PLAIN&&o.includes(`
|
|
33
|
+
`))return Mv(t,e,n,i);if(Fv(o)){if(u==="")return e.forceBlockIndent=!0,Mv(t,e,n,i);if(c&&u===l)return pc(o,e)}let f=o.replace(/\n+/g,`$&
|
|
34
|
+
${u}`);if(s){let p=a(y=>y.default&&y.tag!=="tag:yaml.org,2002:str"&&y.test?.test(f),"test"),{compat:m,tags:g}=e.doc.schema;if(g.some(p)||m?.some(p))return pc(o,e)}return c?f:ao.foldFlowLines(f,u,ao.FOLD_FLOW,Uv(e,!1))}a(E7,"plainString");function T7(t,e,n,i){let{implicitKey:r,inFlow:o}=e,s=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)}),{type:c}=t;c!==dr.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(s.value)&&(c=dr.Scalar.QUOTE_DOUBLE);let u=a(d=>{switch(d){case dr.Scalar.BLOCK_FOLDED:case dr.Scalar.BLOCK_LITERAL:return r||o?pc(s.value,e):Mv(s,e,n,i);case dr.Scalar.QUOTE_DOUBLE:return _f(s.value,e);case dr.Scalar.QUOTE_SINGLE:return uT(s.value,e);case dr.Scalar.PLAIN:return E7(s,e,n,i);default:return null}},"_stringify"),l=u(c);if(l===null){let{defaultKeyType:d,defaultStringType:f}=e.options,p=r&&d||f;if(l=u(p),l===null)throw new Error(`Unsupported default string type ${p}`)}return l}a(T7,"stringifyString");eM.stringifyString=T7});var xf=I(dT=>{"use strict";var A7=Cv(),co=be(),O7=wf(),N7=kf();function C7(t,e){let n=Object.assign({blockQuote:!0,commentString:O7.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},t.schema.toStringOptions,e),i;switch(n.collectionStyle){case"block":i=!1;break;case"flow":i=!0;break;default:i=null}return{anchors:new Set,doc:t,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:i,options:n}}a(C7,"createStringifyContext");function P7(t,e){if(e.tag){let r=t.filter(o=>o.tag===e.tag);if(r.length>0)return r.find(o=>o.format===e.format)??r[0]}let n,i;if(co.isScalar(e)){i=e.value;let r=t.filter(o=>o.identify?.(i));if(r.length>1){let o=r.filter(s=>s.test);o.length>0&&(r=o)}n=r.find(o=>o.format===e.format)??r.find(o=>!o.format)}else i=e,n=t.find(r=>r.nodeClass&&i instanceof r.nodeClass);if(!n){let r=i?.constructor?.name??(i===null?"null":typeof i);throw new Error(`Tag not resolved for ${r} value`)}return n}a(P7,"getTagObject");function R7(t,e,{anchors:n,doc:i}){if(!i.directives)return"";let r=[],o=(co.isScalar(t)||co.isCollection(t))&&t.anchor;o&&A7.anchorIsValid(o)&&(n.add(o),r.push(`&${o}`));let s=t.tag??(e.default?null:e.tag);return s&&r.push(i.directives.tagString(s)),r.join(" ")}a(R7,"stringifyProps");function j7(t,e,n,i){if(co.isPair(t))return t.toString(e,n,i);if(co.isAlias(t)){if(e.doc.directives)return t.toString(e);if(e.resolvedAliases?.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let r,o=co.isNode(t)?t:e.doc.createNode(t,{onTagObj:a(u=>r=u,"onTagObj")});r??(r=P7(e.doc.schema.tags,o));let s=R7(o,r,e);s.length>0&&(e.indentAtStart=(e.indentAtStart??0)+s.length+1);let c=typeof r.stringify=="function"?r.stringify(o,e,n,i):co.isScalar(o)?N7.stringifyString(o,e,n,i):o.toString(e,n,i);return s?co.isScalar(o)||c[0]==="{"||c[0]==="["?`${s} ${c}`:`${s}
|
|
35
|
+
${e.indent}${c}`:c}a(j7,"stringify");dT.createStringifyContext=C7;dT.stringify=j7});var iM=I(rM=>{"use strict";var ri=be(),tM=at(),nM=xf(),Sf=wf();function z7({key:t,value:e},n,i,r){let{allNullValues:o,doc:s,indent:c,indentStep:u,options:{commentString:l,indentSeq:d,simpleKeys:f}}=n,p=ri.isNode(t)&&t.comment||null;if(f){if(p)throw new Error("With simple keys, key nodes cannot have comments");if(ri.isCollection(t)||!ri.isNode(t)&&typeof t=="object"){let Z="With simple keys, collection cannot be used as a key value";throw new Error(Z)}}let m=!f&&(!t||p&&e==null&&!n.inFlow||ri.isCollection(t)||(ri.isScalar(t)?t.type===tM.Scalar.BLOCK_FOLDED||t.type===tM.Scalar.BLOCK_LITERAL:typeof t=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!m&&(f||!o),indent:c+u});let g=!1,y=!1,v=nM.stringify(t,n,()=>g=!0,()=>y=!0);if(!m&&!n.inFlow&&v.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");m=!0}if(n.inFlow){if(o||e==null)return g&&i&&i(),v===""?"?":m?`? ${v}`:v}else if(o&&!f||e==null&&m)return v=`? ${v}`,p&&!g?v+=Sf.lineComment(v,n.indent,l(p)):y&&r&&r(),v;g&&(p=null),m?(p&&(v+=Sf.lineComment(v,n.indent,l(p))),v=`? ${v}
|
|
36
|
+
${c}:`):(v=`${v}:`,p&&(v+=Sf.lineComment(v,n.indent,l(p))));let w,b,$;ri.isNode(e)?(w=!!e.spaceBefore,b=e.commentBefore,$=e.comment):(w=!1,b=null,$=null,e&&typeof e=="object"&&(e=s.createNode(e))),n.implicitKey=!1,!m&&!p&&ri.isScalar(e)&&(n.indentAtStart=v.length+1),y=!1,!d&&u.length>=2&&!n.inFlow&&!m&&ri.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(n.indent=n.indent.substring(2));let x=!1,T=nM.stringify(e,n,()=>x=!0,()=>y=!0),C=" ";if(p||w||b){if(C=w?`
|
|
37
|
+
`:"",b){let Z=l(b);C+=`
|
|
38
|
+
${Sf.indentComment(Z,n.indent)}`}T===""&&!n.inFlow?C===`
|
|
39
|
+
`&&$&&(C=`
|
|
40
|
+
|
|
41
|
+
`):C+=`
|
|
42
|
+
${n.indent}`}else if(!m&&ri.isCollection(e)){let Z=T[0],S=T.indexOf(`
|
|
43
|
+
`),G=S!==-1,me=n.inFlow??e.flow??e.items.length===0;if(G||!me){let Zt=!1;if(G&&(Z==="&"||Z==="!")){let Fe=T.indexOf(" ");Z==="&"&&Fe!==-1&&Fe<S&&T[Fe+1]==="!"&&(Fe=T.indexOf(" ",Fe+1)),(Fe===-1||S<Fe)&&(Zt=!0)}Zt||(C=`
|
|
44
|
+
${n.indent}`)}}else(T===""||T[0]===`
|
|
45
|
+
`)&&(C="");return v+=C+T,n.inFlow?x&&i&&i():$&&!x?v+=Sf.lineComment(v,n.indent,l($)):y&&r&&r(),v}a(z7,"stringifyPair");rM.stringifyPair=z7});var pT=I(fT=>{"use strict";var oM=require("process");function D7(t,...e){t==="debug"&&console.log(...e)}a(D7,"debug");function L7(t,e){(t==="debug"||t==="warn")&&(typeof oM.emitWarning=="function"?oM.emitWarning(e):console.warn(e))}a(L7,"warn");fT.debug=D7;fT.warn=L7});var Kv=I(Bv=>{"use strict";var Vv=be(),sM=at(),qv="<<",Zv={identify:a(t=>t===qv||typeof t=="symbol"&&t.description===qv,"identify"),default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:a(()=>Object.assign(new sM.Scalar(Symbol(qv)),{addToJSMap:aM}),"resolve"),stringify:a(()=>qv,"stringify")},M7=a((t,e)=>(Zv.identify(e)||Vv.isScalar(e)&&(!e.type||e.type===sM.Scalar.PLAIN)&&Zv.identify(e.value))&&t?.doc.schema.tags.some(n=>n.tag===Zv.tag&&n.default),"isMergeKey");function aM(t,e,n){let i=cM(t,n);if(Vv.isSeq(i))for(let r of i.items)mT(t,e,r);else if(Array.isArray(i))for(let r of i)mT(t,e,r);else mT(t,e,i)}a(aM,"addMergeToJSMap");function mT(t,e,n){let i=cM(t,n);if(!Vv.isMap(i))throw new Error("Merge sources must be maps or map aliases");let r=i.toJSON(null,t,Map);for(let[o,s]of r)e instanceof Map?e.has(o)||e.set(o,s):e instanceof Set?e.add(o):Object.prototype.hasOwnProperty.call(e,o)||Object.defineProperty(e,o,{value:s,writable:!0,enumerable:!0,configurable:!0});return e}a(mT,"mergeValue");function cM(t,e){return t&&Vv.isAlias(e)?e.resolve(t.doc,t):e}a(cM,"resolveAliasValue");Bv.addMergeToJSMap=aM;Bv.isMergeKey=M7;Bv.merge=Zv});var gT=I(dM=>{"use strict";var U7=pT(),uM=Kv(),F7=xf(),lM=be(),hT=oo();function q7(t,e,{key:n,value:i}){if(lM.isNode(n)&&n.addToJSMap)n.addToJSMap(t,e,i);else if(uM.isMergeKey(t,n))uM.addMergeToJSMap(t,e,i);else{let r=hT.toJS(n,"",t);if(e instanceof Map)e.set(r,hT.toJS(i,r,t));else if(e instanceof Set)e.add(r);else{let o=Z7(n,r,t),s=hT.toJS(i,o,t);o in e?Object.defineProperty(e,o,{value:s,writable:!0,enumerable:!0,configurable:!0}):e[o]=s}}return e}a(q7,"addPairToJSMap");function Z7(t,e,n){if(e===null)return"";if(typeof e!="object")return String(e);if(lM.isNode(t)&&n?.doc){let i=F7.createStringifyContext(n.doc,{});i.anchors=new Set;for(let o of n.anchors.keys())i.anchors.add(o.anchor);i.inFlow=!0,i.inStringifyKey=!0;let r=t.toString(i);if(!n.mapKeyWarned){let o=JSON.stringify(r);o.length>40&&(o=o.substring(0,36)+'..."'),U7.warn(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${o}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(e)}a(Z7,"stringifyKey");dM.addPairToJSMap=q7});var uo=I(yT=>{"use strict";var fM=bf(),V7=iM(),B7=gT(),Hv=be();function K7(t,e,n){let i=fM.createNode(t,void 0,n),r=fM.createNode(e,void 0,n);return new Wv(i,r)}a(K7,"createPair");var Wv=class t{static{a(this,"Pair")}constructor(e,n=null){Object.defineProperty(this,Hv.NODE_TYPE,{value:Hv.PAIR}),this.key=e,this.value=n}clone(e){let{key:n,value:i}=this;return Hv.isNode(n)&&(n=n.clone(e)),Hv.isNode(i)&&(i=i.clone(e)),new t(n,i)}toJSON(e,n){let i=n?.mapAsMap?new Map:{};return B7.addPairToJSMap(n,i,this)}toString(e,n,i){return e?.doc?V7.stringifyPair(this,e,n,i):JSON.stringify(this)}};yT.Pair=Wv;yT.createPair=K7});var vT=I(mM=>{"use strict";var gs=be(),pM=xf(),Gv=wf();function H7(t,e,n){return(e.inFlow??t.flow?G7:W7)(t,e,n)}a(H7,"stringifyCollection");function W7({comment:t,items:e},n,{blockItemPrefix:i,flowChars:r,itemIndent:o,onChompKeep:s,onComment:c}){let{indent:u,options:{commentString:l}}=n,d=Object.assign({},n,{indent:o,type:null}),f=!1,p=[];for(let g=0;g<e.length;++g){let y=e[g],v=null;if(gs.isNode(y))!f&&y.spaceBefore&&p.push(""),Jv(n,p,y.commentBefore,f),y.comment&&(v=y.comment);else if(gs.isPair(y)){let b=gs.isNode(y.key)?y.key:null;b&&(!f&&b.spaceBefore&&p.push(""),Jv(n,p,b.commentBefore,f))}f=!1;let w=pM.stringify(y,d,()=>v=null,()=>f=!0);v&&(w+=Gv.lineComment(w,o,l(v))),f&&v&&(f=!1),p.push(i+w)}let m;if(p.length===0)m=r.start+r.end;else{m=p[0];for(let g=1;g<p.length;++g){let y=p[g];m+=y?`
|
|
46
|
+
${u}${y}`:`
|
|
47
|
+
`}}return t?(m+=`
|
|
48
|
+
`+Gv.indentComment(l(t),u),c&&c()):f&&s&&s(),m}a(W7,"stringifyBlockCollection");function G7({items:t},e,{flowChars:n,itemIndent:i}){let{indent:r,indentStep:o,flowCollectionPadding:s,options:{commentString:c}}=e;i+=o;let u=Object.assign({},e,{indent:i,inFlow:!0,type:null}),l=!1,d=0,f=[];for(let g=0;g<t.length;++g){let y=t[g],v=null;if(gs.isNode(y))y.spaceBefore&&f.push(""),Jv(e,f,y.commentBefore,!1),y.comment&&(v=y.comment);else if(gs.isPair(y)){let b=gs.isNode(y.key)?y.key:null;b&&(b.spaceBefore&&f.push(""),Jv(e,f,b.commentBefore,!1),b.comment&&(l=!0));let $=gs.isNode(y.value)?y.value:null;$?($.comment&&(v=$.comment),$.commentBefore&&(l=!0)):y.value==null&&b?.comment&&(v=b.comment)}v&&(l=!0);let w=pM.stringify(y,u,()=>v=null);l||(l=f.length>d||w.includes(`
|
|
49
|
+
`)),g<t.length-1?w+=",":e.options.trailingComma&&(e.options.lineWidth>0&&(l||(l=f.reduce((b,$)=>b+$.length+2,2)+(w.length+2)>e.options.lineWidth)),l&&(w+=",")),v&&(w+=Gv.lineComment(w,i,c(v))),f.push(w),d=f.length}let{start:p,end:m}=n;if(f.length===0)return p+m;if(!l){let g=f.reduce((y,v)=>y+v.length+2,2);l=e.options.lineWidth>0&&g>e.options.lineWidth}if(l){let g=p;for(let y of f)g+=y?`
|
|
50
|
+
${o}${r}${y}`:`
|
|
51
|
+
`;return`${g}
|
|
52
|
+
${r}${m}`}else return`${p}${s}${f.join(" ")}${s}${m}`}a(G7,"stringifyFlowCollection");function Jv({indent:t,options:{commentString:e}},n,i,r){if(i&&r&&(i=i.replace(/^\n+/,"")),i){let o=Gv.indentComment(e(i),t);n.push(o.trimStart())}}a(Jv,"addCommentBefore");mM.stringifyCollection=H7});var fo=I(wT=>{"use strict";var J7=vT(),Y7=gT(),X7=zv(),lo=be(),Yv=uo(),Q7=at();function If(t,e){let n=lo.isScalar(e)?e.value:e;for(let i of t)if(lo.isPair(i)&&(i.key===e||i.key===n||lo.isScalar(i.key)&&i.key.value===n))return i}a(If,"findPair");var bT=class extends X7.Collection{static{a(this,"YAMLMap")}static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(lo.MAP,e),this.items=[]}static from(e,n,i){let{keepUndefined:r,replacer:o}=i,s=new this(e),c=a((u,l)=>{if(typeof o=="function")l=o.call(n,u,l);else if(Array.isArray(o)&&!o.includes(u))return;(l!==void 0||r)&&s.items.push(Yv.createPair(u,l,i))},"add");if(n instanceof Map)for(let[u,l]of n)c(u,l);else if(n&&typeof n=="object")for(let u of Object.keys(n))c(u,n[u]);return typeof e.sortMapEntries=="function"&&s.items.sort(e.sortMapEntries),s}add(e,n){let i;lo.isPair(e)?i=e:!e||typeof e!="object"||!("key"in e)?i=new Yv.Pair(e,e?.value):i=new Yv.Pair(e.key,e.value);let r=If(this.items,i.key),o=this.schema?.sortMapEntries;if(r){if(!n)throw new Error(`Key ${i.key} already set`);lo.isScalar(r.value)&&Q7.isScalarValue(i.value)?r.value.value=i.value:r.value=i.value}else if(o){let s=this.items.findIndex(c=>o(i,c)<0);s===-1?this.items.push(i):this.items.splice(s,0,i)}else this.items.push(i)}delete(e){let n=If(this.items,e);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(e,n){let r=If(this.items,e)?.value;return(!n&&lo.isScalar(r)?r.value:r)??void 0}has(e){return!!If(this.items,e)}set(e,n){this.add(new Yv.Pair(e,n),!0)}toJSON(e,n,i){let r=i?new i:n?.mapAsMap?new Map:{};n?.onCreate&&n.onCreate(r);for(let o of this.items)Y7.addPairToJSMap(n,r,o);return r}toString(e,n,i){if(!e)return JSON.stringify(this);for(let r of this.items)if(!lo.isPair(r))throw new Error(`Map items must all be pairs; found ${JSON.stringify(r)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),J7.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:i,onComment:n})}};wT.YAMLMap=bT;wT.findPair=If});var mc=I(gM=>{"use strict";var eQ=be(),hM=fo(),tQ={collection:"map",default:!0,nodeClass:hM.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return eQ.isMap(t)||e("Expected a mapping for this tag"),t},createNode:a((t,e,n)=>hM.YAMLMap.from(t,e,n),"createNode")};gM.map=tQ});var po=I(yM=>{"use strict";var nQ=bf(),rQ=vT(),iQ=zv(),Qv=be(),oQ=at(),sQ=oo(),$T=class extends iQ.Collection{static{a(this,"YAMLSeq")}static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(Qv.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let n=Xv(e);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(e,n){let i=Xv(e);if(typeof i!="number")return;let r=this.items[i];return!n&&Qv.isScalar(r)?r.value:r}has(e){let n=Xv(e);return typeof n=="number"&&n<this.items.length}set(e,n){let i=Xv(e);if(typeof i!="number")throw new Error(`Expected a valid index, not ${e}.`);let r=this.items[i];Qv.isScalar(r)&&oQ.isScalarValue(n)?r.value=n:this.items[i]=n}toJSON(e,n){let i=[];n?.onCreate&&n.onCreate(i);let r=0;for(let o of this.items)i.push(sQ.toJS(o,String(r++),n));return i}toString(e,n,i){return e?rQ.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:i,onComment:n}):JSON.stringify(this)}static from(e,n,i){let{replacer:r}=i,o=new this(e);if(n&&Symbol.iterator in Object(n)){let s=0;for(let c of n){if(typeof r=="function"){let u=n instanceof Set?c:String(s++);c=r.call(n,u,c)}o.items.push(nQ.createNode(c,void 0,i))}}return o}};function Xv(t){let e=Qv.isScalar(t)?t.value:t;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}a(Xv,"asItemIndex");yM.YAMLSeq=$T});var hc=I(bM=>{"use strict";var aQ=be(),vM=po(),cQ={collection:"seq",default:!0,nodeClass:vM.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return aQ.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:a((t,e,n)=>vM.YAMLSeq.from(t,e,n),"createNode")};bM.seq=cQ});var Ef=I(wM=>{"use strict";var uQ=kf(),lQ={identify:a(t=>typeof t=="string","identify"),default:!0,tag:"tag:yaml.org,2002:str",resolve:a(t=>t,"resolve"),stringify(t,e,n,i){return e=Object.assign({actualString:!0},e),uQ.stringifyString(t,e,n,i)}};wM.string=lQ});var eb=I(kM=>{"use strict";var $M=at(),_M={identify:a(t=>t==null,"identify"),createNode:a(()=>new $M.Scalar(null),"createNode"),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:a(()=>new $M.Scalar(null),"resolve"),stringify:a(({source:t},e)=>typeof t=="string"&&_M.test.test(t)?t:e.options.nullStr,"stringify")};kM.nullTag=_M});var _T=I(SM=>{"use strict";var dQ=at(),xM={identify:a(t=>typeof t=="boolean","identify"),default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:a(t=>new dQ.Scalar(t[0]==="t"||t[0]==="T"),"resolve"),stringify({source:t,value:e},n){if(t&&xM.test.test(t)){let i=t[0]==="t"||t[0]==="T";if(e===i)return t}return e?n.options.trueStr:n.options.falseStr}};SM.boolTag=xM});var gc=I(IM=>{"use strict";function fQ({format:t,minFractionDigits:e,tag:n,value:i}){if(typeof i=="bigint")return String(i);let r=typeof i=="number"?i:Number(i);if(!isFinite(r))return isNaN(r)?".nan":r<0?"-.inf":".inf";let o=Object.is(i,-0)?"-0":JSON.stringify(i);if(!t&&e&&(!n||n==="tag:yaml.org,2002:float")&&/^-?\d/.test(o)&&!o.includes("e")){let s=o.indexOf(".");s<0&&(s=o.length,o+=".");let c=e-(o.length-s-1);for(;c-- >0;)o+="0"}return o}a(fQ,"stringifyNumber");IM.stringifyNumber=fQ});var xT=I(tb=>{"use strict";var pQ=at(),kT=gc(),mQ={identify:a(t=>typeof t=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:a(t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,"resolve"),stringify:kT.stringifyNumber},hQ={identify:a(t=>typeof t=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:a(t=>parseFloat(t),"resolve"),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():kT.stringifyNumber(t)}},gQ={identify:a(t=>typeof t=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){let e=new pQ.Scalar(parseFloat(t)),n=t.indexOf(".");return n!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-n-1),e},stringify:kT.stringifyNumber};tb.float=gQ;tb.floatExp=hQ;tb.floatNaN=mQ});var IT=I(rb=>{"use strict";var EM=gc(),nb=a(t=>typeof t=="bigint"||Number.isInteger(t),"intIdentify"),ST=a((t,e,n,{intAsBigInt:i})=>i?BigInt(t):parseInt(t.substring(e),n),"intResolve");function TM(t,e,n){let{value:i}=t;return nb(i)&&i>=0?n+i.toString(e):EM.stringifyNumber(t)}a(TM,"intStringify");var yQ={identify:a(t=>nb(t)&&t>=0,"identify"),default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:a((t,e,n)=>ST(t,2,8,n),"resolve"),stringify:a(t=>TM(t,8,"0o"),"stringify")},vQ={identify:nb,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:a((t,e,n)=>ST(t,0,10,n),"resolve"),stringify:EM.stringifyNumber},bQ={identify:a(t=>nb(t)&&t>=0,"identify"),default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:a((t,e,n)=>ST(t,2,16,n),"resolve"),stringify:a(t=>TM(t,16,"0x"),"stringify")};rb.int=vQ;rb.intHex=bQ;rb.intOct=yQ});var OM=I(AM=>{"use strict";var wQ=mc(),$Q=eb(),_Q=hc(),kQ=Ef(),xQ=_T(),ET=xT(),TT=IT(),SQ=[wQ.map,_Q.seq,kQ.string,$Q.nullTag,xQ.boolTag,TT.intOct,TT.int,TT.intHex,ET.floatNaN,ET.floatExp,ET.float];AM.schema=SQ});var PM=I(CM=>{"use strict";var IQ=at(),EQ=mc(),TQ=hc();function NM(t){return typeof t=="bigint"||Number.isInteger(t)}a(NM,"intIdentify");var ib=a(({value:t})=>JSON.stringify(t),"stringifyJSON"),AQ=[{identify:a(t=>typeof t=="string","identify"),default:!0,tag:"tag:yaml.org,2002:str",resolve:a(t=>t,"resolve"),stringify:ib},{identify:a(t=>t==null,"identify"),createNode:a(()=>new IQ.Scalar(null),"createNode"),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:a(()=>null,"resolve"),stringify:ib},{identify:a(t=>typeof t=="boolean","identify"),default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:a(t=>t==="true","resolve"),stringify:ib},{identify:NM,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:a((t,e,{intAsBigInt:n})=>n?BigInt(t):parseInt(t,10),"resolve"),stringify:a(({value:t})=>NM(t)?t.toString():JSON.stringify(t),"stringify")},{identify:a(t=>typeof t=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:a(t=>parseFloat(t),"resolve"),stringify:ib}],OQ={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},NQ=[EQ.map,TQ.seq].concat(AQ,OQ);CM.schema=NQ});var OT=I(RM=>{"use strict";var Tf=require("buffer"),AT=at(),CQ=kf(),PQ={identify:a(t=>t instanceof Uint8Array,"identify"),default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof Tf.Buffer=="function")return Tf.Buffer.from(t,"base64");if(typeof atob=="function"){let n=atob(t.replace(/[\n\r]/g,"")),i=new Uint8Array(n.length);for(let r=0;r<n.length;++r)i[r]=n.charCodeAt(r);return i}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),t},stringify({comment:t,type:e,value:n},i,r,o){if(!n)return"";let s=n,c;if(typeof Tf.Buffer=="function")c=s instanceof Tf.Buffer?s.toString("base64"):Tf.Buffer.from(s.buffer).toString("base64");else if(typeof btoa=="function"){let u="";for(let l=0;l<s.length;++l)u+=String.fromCharCode(s[l]);c=btoa(u)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e??(e=AT.Scalar.BLOCK_LITERAL),e!==AT.Scalar.QUOTE_DOUBLE){let u=Math.max(i.options.lineWidth-i.indent.length,i.options.minContentWidth),l=Math.ceil(c.length/u),d=new Array(l);for(let f=0,p=0;f<l;++f,p+=u)d[f]=c.substr(p,u);c=d.join(e===AT.Scalar.BLOCK_LITERAL?`
|
|
53
|
+
`:" ")}return CQ.stringifyString({comment:t,type:e,value:c},i,r,o)}};RM.binary=PQ});var ab=I(sb=>{"use strict";var ob=be(),NT=uo(),RQ=at(),jQ=po();function jM(t,e){if(ob.isSeq(t))for(let n=0;n<t.items.length;++n){let i=t.items[n];if(!ob.isPair(i)){if(ob.isMap(i)){i.items.length>1&&e("Each pair must have its own sequence indicator");let r=i.items[0]||new NT.Pair(new RQ.Scalar(null));if(i.commentBefore&&(r.key.commentBefore=r.key.commentBefore?`${i.commentBefore}
|
|
54
|
+
${r.key.commentBefore}`:i.commentBefore),i.comment){let o=r.value??r.key;o.comment=o.comment?`${i.comment}
|
|
55
|
+
${o.comment}`:i.comment}i=r}t.items[n]=ob.isPair(i)?i:new NT.Pair(i)}}else e("Expected a sequence for this tag");return t}a(jM,"resolvePairs");function zM(t,e,n){let{replacer:i}=n,r=new jQ.YAMLSeq(t);r.tag="tag:yaml.org,2002:pairs";let o=0;if(e&&Symbol.iterator in Object(e))for(let s of e){typeof i=="function"&&(s=i.call(e,String(o++),s));let c,u;if(Array.isArray(s))if(s.length===2)c=s[0],u=s[1];else throw new TypeError(`Expected [key, value] tuple: ${s}`);else if(s&&s instanceof Object){let l=Object.keys(s);if(l.length===1)c=l[0],u=s[c];else throw new TypeError(`Expected tuple with one key, not ${l.length} keys`)}else c=s;r.items.push(NT.createPair(c,u,n))}return r}a(zM,"createPairs");var zQ={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:jM,createNode:zM};sb.createPairs=zM;sb.pairs=zQ;sb.resolvePairs=jM});var RT=I(PT=>{"use strict";var DM=be(),CT=oo(),Af=fo(),DQ=po(),LM=ab(),ys=class t extends DQ.YAMLSeq{static{a(this,"YAMLOMap")}constructor(){super(),this.add=Af.YAMLMap.prototype.add.bind(this),this.delete=Af.YAMLMap.prototype.delete.bind(this),this.get=Af.YAMLMap.prototype.get.bind(this),this.has=Af.YAMLMap.prototype.has.bind(this),this.set=Af.YAMLMap.prototype.set.bind(this),this.tag=t.tag}toJSON(e,n){if(!n)return super.toJSON(e);let i=new Map;n?.onCreate&&n.onCreate(i);for(let r of this.items){let o,s;if(DM.isPair(r)?(o=CT.toJS(r.key,"",n),s=CT.toJS(r.value,o,n)):o=CT.toJS(r,"",n),i.has(o))throw new Error("Ordered maps must not include duplicate keys");i.set(o,s)}return i}static from(e,n,i){let r=LM.createPairs(e,n,i),o=new this;return o.items=r.items,o}};ys.tag="tag:yaml.org,2002:omap";var LQ={collection:"seq",identify:a(t=>t instanceof Map,"identify"),nodeClass:ys,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let n=LM.resolvePairs(t,e),i=[];for(let{key:r}of n.items)DM.isScalar(r)&&(i.includes(r.value)?e(`Ordered maps must not include duplicate keys: ${r.value}`):i.push(r.value));return Object.assign(new ys,n)},createNode:a((t,e,n)=>ys.from(t,e,n),"createNode")};PT.YAMLOMap=ys;PT.omap=LQ});var ZM=I(jT=>{"use strict";var MM=at();function UM({value:t,source:e},n){return e&&(t?FM:qM).test.test(e)?e:t?n.options.trueStr:n.options.falseStr}a(UM,"boolStringify");var FM={identify:a(t=>t===!0,"identify"),default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:a(()=>new MM.Scalar(!0),"resolve"),stringify:UM},qM={identify:a(t=>t===!1,"identify"),default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:a(()=>new MM.Scalar(!1),"resolve"),stringify:UM};jT.falseTag=qM;jT.trueTag=FM});var VM=I(cb=>{"use strict";var MQ=at(),zT=gc(),UQ={identify:a(t=>typeof t=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:a(t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,"resolve"),stringify:zT.stringifyNumber},FQ={identify:a(t=>typeof t=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:a(t=>parseFloat(t.replace(/_/g,"")),"resolve"),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():zT.stringifyNumber(t)}},qQ={identify:a(t=>typeof t=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){let e=new MQ.Scalar(parseFloat(t.replace(/_/g,""))),n=t.indexOf(".");if(n!==-1){let i=t.substring(n+1).replace(/_/g,"");i[i.length-1]==="0"&&(e.minFractionDigits=i.length)}return e},stringify:zT.stringifyNumber};cb.float=qQ;cb.floatExp=FQ;cb.floatNaN=UQ});var KM=I(Nf=>{"use strict";var BM=gc(),Of=a(t=>typeof t=="bigint"||Number.isInteger(t),"intIdentify");function ub(t,e,n,{intAsBigInt:i}){let r=t[0];if((r==="-"||r==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),i){switch(n){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}let s=BigInt(t);return r==="-"?BigInt(-1)*s:s}let o=parseInt(t,n);return r==="-"?-1*o:o}a(ub,"intResolve");function DT(t,e,n){let{value:i}=t;if(Of(i)){let r=i.toString(e);return i<0?"-"+n+r.substr(1):n+r}return BM.stringifyNumber(t)}a(DT,"intStringify");var ZQ={identify:Of,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:a((t,e,n)=>ub(t,2,2,n),"resolve"),stringify:a(t=>DT(t,2,"0b"),"stringify")},VQ={identify:Of,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:a((t,e,n)=>ub(t,1,8,n),"resolve"),stringify:a(t=>DT(t,8,"0"),"stringify")},BQ={identify:Of,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:a((t,e,n)=>ub(t,0,10,n),"resolve"),stringify:BM.stringifyNumber},KQ={identify:Of,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:a((t,e,n)=>ub(t,2,16,n),"resolve"),stringify:a(t=>DT(t,16,"0x"),"stringify")};Nf.int=BQ;Nf.intBin=ZQ;Nf.intHex=KQ;Nf.intOct=VQ});var MT=I(LT=>{"use strict";var fb=be(),lb=uo(),db=fo(),vs=class t extends db.YAMLMap{static{a(this,"YAMLSet")}constructor(e){super(e),this.tag=t.tag}add(e){let n;fb.isPair(e)?n=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?n=new lb.Pair(e.key,null):n=new lb.Pair(e,null),db.findPair(this.items,n.key)||this.items.push(n)}get(e,n){let i=db.findPair(this.items,e);return!n&&fb.isPair(i)?fb.isScalar(i.key)?i.key.value:i.key:i}set(e,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);let i=db.findPair(this.items,e);i&&!n?this.items.splice(this.items.indexOf(i),1):!i&&n&&this.items.push(new lb.Pair(e))}toJSON(e,n){return super.toJSON(e,n,Set)}toString(e,n,i){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),n,i);throw new Error("Set items must all have null values")}static from(e,n,i){let{replacer:r}=i,o=new this(e);if(n&&Symbol.iterator in Object(n))for(let s of n)typeof r=="function"&&(s=r.call(n,s,s)),o.items.push(lb.createPair(s,null,i));return o}};vs.tag="tag:yaml.org,2002:set";var HQ={collection:"map",identify:a(t=>t instanceof Set,"identify"),nodeClass:vs,default:!1,tag:"tag:yaml.org,2002:set",createNode:a((t,e,n)=>vs.from(t,e,n),"createNode"),resolve(t,e){if(fb.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new vs,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};LT.YAMLSet=vs;LT.set=HQ});var FT=I(pb=>{"use strict";var WQ=gc();function UT(t,e){let n=t[0],i=n==="-"||n==="+"?t.substring(1):t,r=a(s=>e?BigInt(s):Number(s),"num"),o=i.replace(/_/g,"").split(":").reduce((s,c)=>s*r(60)+r(c),r(0));return n==="-"?r(-1)*o:o}a(UT,"parseSexagesimal");function HM(t){let{value:e}=t,n=a(s=>s,"num");if(typeof e=="bigint")n=a(s=>BigInt(s),"num");else if(isNaN(e)||!isFinite(e))return WQ.stringifyNumber(t);let i="";e<0&&(i="-",e*=n(-1));let r=n(60),o=[e%r];return e<60?o.unshift(0):(e=(e-o[0])/r,o.unshift(e%r),e>=60&&(e=(e-o[0])/r,o.unshift(e))),i+o.map(s=>String(s).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}a(HM,"stringifySexagesimal");var GQ={identify:a(t=>typeof t=="bigint"||Number.isInteger(t),"identify"),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:a((t,e,{intAsBigInt:n})=>UT(t,n),"resolve"),stringify:HM},JQ={identify:a(t=>typeof t=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:a(t=>UT(t,!1),"resolve"),stringify:HM},WM={identify:a(t=>t instanceof Date,"identify"),default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(t){let e=t.match(WM.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,n,i,r,o,s,c]=e.map(Number),u=e[7]?Number((e[7]+"00").substr(1,3)):0,l=Date.UTC(n,i-1,r,o||0,s||0,c||0,u),d=e[8];if(d&&d!=="Z"){let f=UT(d,!1);Math.abs(f)<30&&(f*=60),l-=6e4*f}return new Date(l)},stringify:a(({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??"","stringify")};pb.floatTime=JQ;pb.intTime=GQ;pb.timestamp=WM});var YM=I(JM=>{"use strict";var YQ=mc(),XQ=eb(),QQ=hc(),eee=Ef(),tee=OT(),GM=ZM(),qT=VM(),mb=KM(),nee=Kv(),ree=RT(),iee=ab(),oee=MT(),ZT=FT(),see=[YQ.map,QQ.seq,eee.string,XQ.nullTag,GM.trueTag,GM.falseTag,mb.intBin,mb.intOct,mb.int,mb.intHex,qT.floatNaN,qT.floatExp,qT.float,tee.binary,nee.merge,ree.omap,iee.pairs,oee.set,ZT.intTime,ZT.floatTime,ZT.timestamp];JM.schema=see});var aU=I(KT=>{"use strict";var tU=mc(),aee=eb(),nU=hc(),cee=Ef(),uee=_T(),VT=xT(),BT=IT(),lee=OM(),dee=PM(),rU=OT(),Cf=Kv(),iU=RT(),oU=ab(),XM=YM(),sU=MT(),hb=FT(),QM=new Map([["core",lee.schema],["failsafe",[tU.map,nU.seq,cee.string]],["json",dee.schema],["yaml11",XM.schema],["yaml-1.1",XM.schema]]),eU={binary:rU.binary,bool:uee.boolTag,float:VT.float,floatExp:VT.floatExp,floatNaN:VT.floatNaN,floatTime:hb.floatTime,int:BT.int,intHex:BT.intHex,intOct:BT.intOct,intTime:hb.intTime,map:tU.map,merge:Cf.merge,null:aee.nullTag,omap:iU.omap,pairs:oU.pairs,seq:nU.seq,set:sU.set,timestamp:hb.timestamp},fee={"tag:yaml.org,2002:binary":rU.binary,"tag:yaml.org,2002:merge":Cf.merge,"tag:yaml.org,2002:omap":iU.omap,"tag:yaml.org,2002:pairs":oU.pairs,"tag:yaml.org,2002:set":sU.set,"tag:yaml.org,2002:timestamp":hb.timestamp};function pee(t,e,n){let i=QM.get(e);if(i&&!t)return n&&!i.includes(Cf.merge)?i.concat(Cf.merge):i.slice();let r=i;if(!r)if(Array.isArray(t))r=[];else{let o=Array.from(QM.keys()).filter(s=>s!=="yaml11").map(s=>JSON.stringify(s)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${o} or define customTags array`)}if(Array.isArray(t))for(let o of t)r=r.concat(o);else typeof t=="function"&&(r=t(r.slice()));return n&&(r=r.concat(Cf.merge)),r.reduce((o,s)=>{let c=typeof s=="string"?eU[s]:s;if(!c){let u=JSON.stringify(s),l=Object.keys(eU).map(d=>JSON.stringify(d)).join(", ");throw new Error(`Unknown custom tag ${u}; use one of ${l}`)}return o.includes(c)||o.push(c),o},[])}a(pee,"getTags");KT.coreKnownTags=fee;KT.getTags=pee});var GT=I(cU=>{"use strict";var HT=be(),mee=mc(),hee=hc(),gee=Ef(),gb=aU(),yee=a((t,e)=>t.key<e.key?-1:t.key>e.key?1:0,"sortMapEntriesByKey"),WT=class t{static{a(this,"Schema")}constructor({compat:e,customTags:n,merge:i,resolveKnownTags:r,schema:o,sortMapEntries:s,toStringDefaults:c}){this.compat=Array.isArray(e)?gb.getTags(e,"compat"):e?gb.getTags(null,e):null,this.name=typeof o=="string"&&o||"core",this.knownTags=r?gb.coreKnownTags:{},this.tags=gb.getTags(n,this.name,i),this.toStringOptions=c??null,Object.defineProperty(this,HT.MAP,{value:mee.map}),Object.defineProperty(this,HT.SCALAR,{value:gee.string}),Object.defineProperty(this,HT.SEQ,{value:hee.seq}),this.sortMapEntries=typeof s=="function"?s:s===!0?yee:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};cU.Schema=WT});var lU=I(uU=>{"use strict";var vee=be(),JT=xf(),Pf=wf();function bee(t,e){let n=[],i=e.directives===!0;if(e.directives!==!1&&t.directives){let u=t.directives.toString(t);u?(n.push(u),i=!0):t.directives.docStart&&(i=!0)}i&&n.push("---");let r=JT.createStringifyContext(t,e),{commentString:o}=r.options;if(t.commentBefore){n.length!==1&&n.unshift("");let u=o(t.commentBefore);n.unshift(Pf.indentComment(u,""))}let s=!1,c=null;if(t.contents){if(vee.isNode(t.contents)){if(t.contents.spaceBefore&&i&&n.push(""),t.contents.commentBefore){let d=o(t.contents.commentBefore);n.push(Pf.indentComment(d,""))}r.forceBlockIndent=!!t.comment,c=t.contents.comment}let u=c?void 0:()=>s=!0,l=JT.stringify(t.contents,r,()=>c=null,u);c&&(l+=Pf.lineComment(l,"",o(c))),(l[0]==="|"||l[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${l}`:n.push(l)}else n.push(JT.stringify(t.contents,r));if(t.directives?.docEnd)if(t.comment){let u=o(t.comment);u.includes(`
|
|
56
|
+
`)?(n.push("..."),n.push(Pf.indentComment(u,""))):n.push(`... ${u}`)}else n.push("...");else{let u=t.comment;u&&s&&(u=u.replace(/^\n+/,"")),u&&((!s||c)&&n[n.length-1]!==""&&n.push(""),n.push(Pf.indentComment(o(u),"")))}return n.join(`
|
|
57
|
+
`)+`
|
|
58
|
+
`}a(bee,"stringifyDocument");uU.stringifyDocument=bee});var Rf=I(dU=>{"use strict";var wee=vf(),yc=zv(),Kn=be(),$ee=uo(),_ee=oo(),kee=GT(),xee=lU(),YT=Cv(),See=tT(),Iee=bf(),XT=eT(),QT=class t{static{a(this,"Document")}constructor(e,n,i){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Kn.NODE_TYPE,{value:Kn.DOC});let r=null;typeof n=="function"||Array.isArray(n)?r=n:i===void 0&&n&&(i=n,n=void 0);let o=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},i);this.options=o;let{version:s}=o;i?._directives?(this.directives=i._directives.atDocument(),this.directives.yaml.explicit&&(s=this.directives.yaml.version)):this.directives=new XT.Directives({version:s}),this.setSchema(s,i),this.contents=e===void 0?null:this.createNode(e,r,i)}clone(){let e=Object.create(t.prototype,{[Kn.NODE_TYPE]:{value:Kn.DOC}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=Kn.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){vc(this.contents)&&this.contents.add(e)}addIn(e,n){vc(this.contents)&&this.contents.addIn(e,n)}createAlias(e,n){if(!e.anchor){let i=YT.anchorNames(this);e.anchor=!n||i.has(n)?YT.findNewAnchor(n||"a",i):n}return new wee.Alias(e.anchor)}createNode(e,n,i){let r;if(typeof n=="function")e=n.call({"":e},"",e),r=n;else if(Array.isArray(n)){let v=a(b=>typeof b=="number"||b instanceof String||b instanceof Number,"keyToStr"),w=n.filter(v).map(String);w.length>0&&(n=n.concat(w)),r=n}else i===void 0&&n&&(i=n,n=void 0);let{aliasDuplicateObjects:o,anchorPrefix:s,flow:c,keepUndefined:u,onTagObj:l,tag:d}=i??{},{onAnchor:f,setAnchors:p,sourceObjects:m}=YT.createNodeAnchors(this,s||"a"),g={aliasDuplicateObjects:o??!0,keepUndefined:u??!1,onAnchor:f,onTagObj:l,replacer:r,schema:this.schema,sourceObjects:m},y=Iee.createNode(e,d,g);return c&&Kn.isCollection(y)&&(y.flow=!0),p(),y}createPair(e,n,i={}){let r=this.createNode(e,null,i),o=this.createNode(n,null,i);return new $ee.Pair(r,o)}delete(e){return vc(this.contents)?this.contents.delete(e):!1}deleteIn(e){return yc.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):vc(this.contents)?this.contents.deleteIn(e):!1}get(e,n){return Kn.isCollection(this.contents)?this.contents.get(e,n):void 0}getIn(e,n){return yc.isEmptyPath(e)?!n&&Kn.isScalar(this.contents)?this.contents.value:this.contents:Kn.isCollection(this.contents)?this.contents.getIn(e,n):void 0}has(e){return Kn.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return yc.isEmptyPath(e)?this.contents!==void 0:Kn.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,n){this.contents==null?this.contents=yc.collectionFromPath(this.schema,[e],n):vc(this.contents)&&this.contents.set(e,n)}setIn(e,n){yc.isEmptyPath(e)?this.contents=n:this.contents==null?this.contents=yc.collectionFromPath(this.schema,Array.from(e),n):vc(this.contents)&&this.contents.setIn(e,n)}setSchema(e,n={}){typeof e=="number"&&(e=String(e));let i;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new XT.Directives({version:"1.1"}),i={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new XT.Directives({version:e}),i={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,i=null;break;default:{let r=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${r}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(i)this.schema=new kee.Schema(Object.assign(i,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:n,mapAsMap:i,maxAliasCount:r,onAnchor:o,reviver:s}={}){let c={anchors:new Map,doc:this,keep:!e,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},u=_ee.toJS(this.contents,n??"",c);if(typeof o=="function")for(let{count:l,res:d}of c.anchors.values())o(d,l);return typeof s=="function"?See.applyReviver(s,{"":u},"",u):u}toJSON(e,n){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:n})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let n=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return xee.stringifyDocument(this,e)}};function vc(t){if(Kn.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}a(vc,"assertCollection");dU.Document=QT});var Df=I(zf=>{"use strict";var jf=class extends Error{static{a(this,"YAMLError")}constructor(e,n,i,r){super(),this.name=e,this.code=i,this.message=r,this.pos=n}},eA=class extends jf{static{a(this,"YAMLParseError")}constructor(e,n,i){super("YAMLParseError",e,n,i)}},tA=class extends jf{static{a(this,"YAMLWarning")}constructor(e,n,i){super("YAMLWarning",e,n,i)}},Eee=a((t,e)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(c=>e.linePos(c));let{line:i,col:r}=n.linePos[0];n.message+=` at line ${i}, column ${r}`;let o=r-1,s=t.substring(e.lineStarts[i-1],e.lineStarts[i]).replace(/[\n\r]+$/,"");if(o>=60&&s.length>80){let c=Math.min(o-39,s.length-79);s="\u2026"+s.substring(c),o-=c-1}if(s.length>80&&(s=s.substring(0,79)+"\u2026"),i>1&&/^ *$/.test(s.substring(0,o))){let c=t.substring(e.lineStarts[i-2],e.lineStarts[i-1]);c.length>80&&(c=c.substring(0,79)+`\u2026
|
|
59
|
+
`),s=c+s}if(/[^ ]/.test(s)){let c=1,u=n.linePos[1];u?.line===i&&u.col>r&&(c=Math.max(1,Math.min(u.col-r,80-o)));let l=" ".repeat(o)+"^".repeat(c);n.message+=`:
|
|
60
|
+
|
|
61
|
+
${s}
|
|
62
|
+
${l}
|
|
63
|
+
`}},"prettifyError");zf.YAMLError=jf;zf.YAMLParseError=eA;zf.YAMLWarning=tA;zf.prettifyError=Eee});var Lf=I(fU=>{"use strict";function Tee(t,{flow:e,indicator:n,next:i,offset:r,onError:o,parentIndent:s,startOnNewline:c}){let u=!1,l=c,d=c,f="",p="",m=!1,g=!1,y=null,v=null,w=null,b=null,$=null,x=null,T=null;for(let S of t)switch(g&&(S.type!=="space"&&S.type!=="newline"&&S.type!=="comma"&&o(S.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),g=!1),y&&(l&&S.type!=="comment"&&S.type!=="newline"&&o(y,"TAB_AS_INDENT","Tabs are not allowed as indentation"),y=null),S.type){case"space":!e&&(n!=="doc-start"||i?.type!=="flow-collection")&&S.source.includes(" ")&&(y=S),d=!0;break;case"comment":{d||o(S,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let G=S.source.substring(1)||" ";f?f+=p+G:f=G,p="",l=!1;break}case"newline":l?f?f+=S.source:(!x||n!=="seq-item-ind")&&(u=!0):p+=S.source,l=!0,m=!0,(v||w)&&(b=S),d=!0;break;case"anchor":v&&o(S,"MULTIPLE_ANCHORS","A node can have at most one anchor"),S.source.endsWith(":")&&o(S.offset+S.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),v=S,T??(T=S.offset),l=!1,d=!1,g=!0;break;case"tag":{w&&o(S,"MULTIPLE_TAGS","A node can have at most one tag"),w=S,T??(T=S.offset),l=!1,d=!1,g=!0;break}case n:(v||w)&&o(S,"BAD_PROP_ORDER",`Anchors and tags must be after the ${S.source} indicator`),x&&o(S,"UNEXPECTED_TOKEN",`Unexpected ${S.source} in ${e??"collection"}`),x=S,l=n==="seq-item-ind"||n==="explicit-key-ind",d=!1;break;case"comma":if(e){$&&o(S,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),$=S,l=!1,d=!1;break}default:o(S,"UNEXPECTED_TOKEN",`Unexpected ${S.type} token`),l=!1,d=!1}let C=t[t.length-1],Z=C?C.offset+C.source.length:r;return g&&i&&i.type!=="space"&&i.type!=="newline"&&i.type!=="comma"&&(i.type!=="scalar"||i.source!=="")&&o(i.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),y&&(l&&y.indent<=s||i?.type==="block-map"||i?.type==="block-seq")&&o(y,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:$,found:x,spaceBefore:u,comment:f,hasNewline:m,anchor:v,tag:w,newlineAfterProp:b,end:Z,start:T??Z}}a(Tee,"resolveProps");fU.resolveProps=Tee});var yb=I(pU=>{"use strict";function nA(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes(`
|
|
64
|
+
`))return!0;if(t.end){for(let e of t.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of t.items){for(let n of e.start)if(n.type==="newline")return!0;if(e.sep){for(let n of e.sep)if(n.type==="newline")return!0}if(nA(e.key)||nA(e.value))return!0}return!1;default:return!0}}a(nA,"containsNewline");pU.containsNewline=nA});var rA=I(mU=>{"use strict";var Aee=yb();function Oee(t,e,n){if(e?.type==="flow-collection"){let i=e.end[0];i.indent===t&&(i.source==="]"||i.source==="}")&&Aee.containsNewline(e)&&n(i,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}a(Oee,"flowIndentCheck");mU.flowIndentCheck=Oee});var iA=I(gU=>{"use strict";var hU=be();function Nee(t,e,n){let{uniqueKeys:i}=t.options;if(i===!1)return!1;let r=typeof i=="function"?i:(o,s)=>o===s||hU.isScalar(o)&&hU.isScalar(s)&&o.value===s.value;return e.some(o=>r(o.key,n))}a(Nee,"mapIncludes");gU.mapIncludes=Nee});var _U=I($U=>{"use strict";var yU=uo(),Cee=fo(),vU=Lf(),Pee=yb(),bU=rA(),Ree=iA(),wU="All mapping items must start at the same column";function jee({composeNode:t,composeEmptyNode:e},n,i,r,o){let s=o?.nodeClass??Cee.YAMLMap,c=new s(n.schema);n.atRoot&&(n.atRoot=!1);let u=i.offset,l=null;for(let d of i.items){let{start:f,key:p,sep:m,value:g}=d,y=vU.resolveProps(f,{indicator:"explicit-key-ind",next:p??m?.[0],offset:u,onError:r,parentIndent:i.indent,startOnNewline:!0}),v=!y.found;if(v){if(p&&(p.type==="block-seq"?r(u,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in p&&p.indent!==i.indent&&r(u,"BAD_INDENT",wU)),!y.anchor&&!y.tag&&!m){l=y.end,y.comment&&(c.comment?c.comment+=`
|
|
65
|
+
`+y.comment:c.comment=y.comment);continue}(y.newlineAfterProp||Pee.containsNewline(p))&&r(p??f[f.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else y.found?.indent!==i.indent&&r(u,"BAD_INDENT",wU);n.atKey=!0;let w=y.end,b=p?t(n,p,y,r):e(n,w,f,null,y,r);n.schema.compat&&bU.flowIndentCheck(i.indent,p,r),n.atKey=!1,Ree.mapIncludes(n,c.items,b)&&r(w,"DUPLICATE_KEY","Map keys must be unique");let $=vU.resolveProps(m??[],{indicator:"map-value-ind",next:g,offset:b.range[2],onError:r,parentIndent:i.indent,startOnNewline:!p||p.type==="block-scalar"});if(u=$.end,$.found){v&&(g?.type==="block-map"&&!$.hasNewline&&r(u,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&y.start<$.found.offset-1024&&r(b.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let x=g?t(n,g,$,r):e(n,u,m,null,$,r);n.schema.compat&&bU.flowIndentCheck(i.indent,g,r),u=x.range[2];let T=new yU.Pair(b,x);n.options.keepSourceTokens&&(T.srcToken=d),c.items.push(T)}else{v&&r(b.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),$.comment&&(b.comment?b.comment+=`
|
|
66
|
+
`+$.comment:b.comment=$.comment);let x=new yU.Pair(b);n.options.keepSourceTokens&&(x.srcToken=d),c.items.push(x)}}return l&&l<u&&r(l,"IMPOSSIBLE","Map comment with trailing content"),c.range=[i.offset,u,l??u],c}a(jee,"resolveBlockMap");$U.resolveBlockMap=jee});var xU=I(kU=>{"use strict";var zee=po(),Dee=Lf(),Lee=rA();function Mee({composeNode:t,composeEmptyNode:e},n,i,r,o){let s=o?.nodeClass??zee.YAMLSeq,c=new s(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let u=i.offset,l=null;for(let{start:d,value:f}of i.items){let p=Dee.resolveProps(d,{indicator:"seq-item-ind",next:f,offset:u,onError:r,parentIndent:i.indent,startOnNewline:!0});if(!p.found)if(p.anchor||p.tag||f)f?.type==="block-seq"?r(p.end,"BAD_INDENT","All sequence items must start at the same column"):r(u,"MISSING_CHAR","Sequence item without - indicator");else{l=p.end,p.comment&&(c.comment=p.comment);continue}let m=f?t(n,f,p,r):e(n,p.end,d,null,p,r);n.schema.compat&&Lee.flowIndentCheck(i.indent,f,r),u=m.range[2],c.items.push(m)}return c.range=[i.offset,u,l??u],c}a(Mee,"resolveBlockSeq");kU.resolveBlockSeq=Mee});var bc=I(SU=>{"use strict";function Uee(t,e,n,i){let r="";if(t){let o=!1,s="";for(let c of t){let{source:u,type:l}=c;switch(l){case"space":o=!0;break;case"comment":{n&&!o&&i(c,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let d=u.substring(1)||" ";r?r+=s+d:r=d,s="";break}case"newline":r&&(s+=u),o=!0;break;default:i(c,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}e+=u.length}}return{comment:r,offset:e}}a(Uee,"resolveEnd");SU.resolveEnd=Uee});var AU=I(TU=>{"use strict";var Fee=be(),qee=uo(),IU=fo(),Zee=po(),Vee=bc(),EU=Lf(),Bee=yb(),Kee=iA(),oA="Block collections are not allowed within flow collections",sA=a(t=>t&&(t.type==="block-map"||t.type==="block-seq"),"isBlock");function Hee({composeNode:t,composeEmptyNode:e},n,i,r,o){let s=i.start.source==="{",c=s?"flow map":"flow sequence",u=o?.nodeClass??(s?IU.YAMLMap:Zee.YAMLSeq),l=new u(n.schema);l.flow=!0;let d=n.atRoot;d&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let f=i.offset+i.start.source.length;for(let v=0;v<i.items.length;++v){let w=i.items[v],{start:b,key:$,sep:x,value:T}=w,C=EU.resolveProps(b,{flow:c,indicator:"explicit-key-ind",next:$??x?.[0],offset:f,onError:r,parentIndent:i.indent,startOnNewline:!1});if(!C.found){if(!C.anchor&&!C.tag&&!x&&!T){v===0&&C.comma?r(C.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${c}`):v<i.items.length-1&&r(C.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${c}`),C.comment&&(l.comment?l.comment+=`
|
|
67
|
+
`+C.comment:l.comment=C.comment),f=C.end;continue}!s&&n.options.strict&&Bee.containsNewline($)&&r($,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(v===0)C.comma&&r(C.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${c}`);else if(C.comma||r(C.start,"MISSING_CHAR",`Missing , between ${c} items`),C.comment){let Z="";e:for(let S of b)switch(S.type){case"comma":case"space":break;case"comment":Z=S.source.substring(1);break e;default:break e}if(Z){let S=l.items[l.items.length-1];Fee.isPair(S)&&(S=S.value??S.key),S.comment?S.comment+=`
|
|
68
|
+
`+Z:S.comment=Z,C.comment=C.comment.substring(Z.length+1)}}if(!s&&!x&&!C.found){let Z=T?t(n,T,C,r):e(n,C.end,x,null,C,r);l.items.push(Z),f=Z.range[2],sA(T)&&r(Z.range,"BLOCK_IN_FLOW",oA)}else{n.atKey=!0;let Z=C.end,S=$?t(n,$,C,r):e(n,Z,b,null,C,r);sA($)&&r(S.range,"BLOCK_IN_FLOW",oA),n.atKey=!1;let G=EU.resolveProps(x??[],{flow:c,indicator:"map-value-ind",next:T,offset:S.range[2],onError:r,parentIndent:i.indent,startOnNewline:!1});if(G.found){if(!s&&!C.found&&n.options.strict){if(x)for(let Fe of x){if(Fe===G.found)break;if(Fe.type==="newline"){r(Fe,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}C.start<G.found.offset-1024&&r(G.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else T&&("source"in T&&T.source?.[0]===":"?r(T,"MISSING_CHAR",`Missing space after : in ${c}`):r(G.start,"MISSING_CHAR",`Missing , or : between ${c} items`));let me=T?t(n,T,G,r):G.found?e(n,G.end,x,null,G,r):null;me?sA(T)&&r(me.range,"BLOCK_IN_FLOW",oA):G.comment&&(S.comment?S.comment+=`
|
|
69
|
+
`+G.comment:S.comment=G.comment);let Zt=new qee.Pair(S,me);if(n.options.keepSourceTokens&&(Zt.srcToken=w),s){let Fe=l;Kee.mapIncludes(n,Fe.items,S)&&r(Z,"DUPLICATE_KEY","Map keys must be unique"),Fe.items.push(Zt)}else{let Fe=new IU.YAMLMap(n.schema);Fe.flow=!0,Fe.items.push(Zt);let Sn=(me??S).range;Fe.range=[S.range[0],Sn[1],Sn[2]],l.items.push(Fe)}f=me?me.range[2]:G.end}}let p=s?"}":"]",[m,...g]=i.end,y=f;if(m?.source===p)y=m.offset+m.source.length;else{let v=c[0].toUpperCase()+c.substring(1),w=d?`${v} must end with a ${p}`:`${v} in block collection must be sufficiently indented and end with a ${p}`;r(f,d?"MISSING_CHAR":"BAD_INDENT",w),m&&m.source.length!==1&&g.unshift(m)}if(g.length>0){let v=Vee.resolveEnd(g,y,n.options.strict,r);v.comment&&(l.comment?l.comment+=`
|
|
70
|
+
`+v.comment:l.comment=v.comment),l.range=[i.offset,y,v.offset]}else l.range=[i.offset,y,y];return l}a(Hee,"resolveFlowCollection");TU.resolveFlowCollection=Hee});var NU=I(OU=>{"use strict";var Wee=be(),Gee=at(),Jee=fo(),Yee=po(),Xee=_U(),Qee=xU(),ete=AU();function aA(t,e,n,i,r,o){let s=n.type==="block-map"?Xee.resolveBlockMap(t,e,n,i,o):n.type==="block-seq"?Qee.resolveBlockSeq(t,e,n,i,o):ete.resolveFlowCollection(t,e,n,i,o),c=s.constructor;return r==="!"||r===c.tagName?(s.tag=c.tagName,s):(r&&(s.tag=r),s)}a(aA,"resolveCollection");function tte(t,e,n,i,r){let o=i.tag,s=o?e.directives.tagName(o.source,p=>r(o,"TAG_RESOLVE_FAILED",p)):null;if(n.type==="block-seq"){let{anchor:p,newlineAfterProp:m}=i,g=p&&o?p.offset>o.offset?p:o:p??o;g&&(!m||m.offset<g.offset)&&r(g,"MISSING_CHAR","Missing newline after block sequence props")}let c=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!o||!s||s==="!"||s===Jee.YAMLMap.tagName&&c==="map"||s===Yee.YAMLSeq.tagName&&c==="seq")return aA(t,e,n,r,s);let u=e.schema.tags.find(p=>p.tag===s&&p.collection===c);if(!u){let p=e.schema.knownTags[s];if(p?.collection===c)e.schema.tags.push(Object.assign({},p,{default:!1})),u=p;else return p?r(o,"BAD_COLLECTION_TYPE",`${p.tag} used for ${c} collection, but expects ${p.collection??"scalar"}`,!0):r(o,"TAG_RESOLVE_FAILED",`Unresolved tag: ${s}`,!0),aA(t,e,n,r,s)}let l=aA(t,e,n,r,s,u),d=u.resolve?.(l,p=>r(o,"TAG_RESOLVE_FAILED",p),e.options)??l,f=Wee.isNode(d)?d:new Gee.Scalar(d);return f.range=l.range,f.tag=s,u?.format&&(f.format=u.format),f}a(tte,"composeCollection");OU.composeCollection=tte});var uA=I(CU=>{"use strict";var cA=at();function nte(t,e,n){let i=e.offset,r=rte(e,t.options.strict,n);if(!r)return{value:"",type:null,comment:"",range:[i,i,i]};let o=r.mode===">"?cA.Scalar.BLOCK_FOLDED:cA.Scalar.BLOCK_LITERAL,s=e.source?ite(e.source):[],c=s.length;for(let y=s.length-1;y>=0;--y){let v=s[y][1];if(v===""||v==="\r")c=y;else break}if(c===0){let y=r.chomp==="+"&&s.length>0?`
|
|
71
|
+
`.repeat(Math.max(1,s.length-1)):"",v=i+r.length;return e.source&&(v+=e.source.length),{value:y,type:o,comment:r.comment,range:[i,v,v]}}let u=e.indent+r.indent,l=e.offset+r.length,d=0;for(let y=0;y<c;++y){let[v,w]=s[y];if(w===""||w==="\r")r.indent===0&&v.length>u&&(u=v.length);else{v.length<u&&n(l+v.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),r.indent===0&&(u=v.length),d=y,u===0&&!t.atRoot&&n(l,"BAD_INDENT","Block scalar values in collections must be indented");break}l+=v.length+w.length+1}for(let y=s.length-1;y>=c;--y)s[y][0].length>u&&(c=y+1);let f="",p="",m=!1;for(let y=0;y<d;++y)f+=s[y][0].slice(u)+`
|
|
72
|
+
`;for(let y=d;y<c;++y){let[v,w]=s[y];l+=v.length+w.length+1;let b=w[w.length-1]==="\r";if(b&&(w=w.slice(0,-1)),w&&v.length<u){let x=`Block scalar lines must not be less indented than their ${r.indent?"explicit indentation indicator":"first line"}`;n(l-w.length-(b?2:1),"BAD_INDENT",x),v=""}o===cA.Scalar.BLOCK_LITERAL?(f+=p+v.slice(u)+w,p=`
|
|
73
|
+
`):v.length>u||w[0]===" "?(p===" "?p=`
|
|
74
|
+
`:!m&&p===`
|
|
75
|
+
`&&(p=`
|
|
76
|
+
|
|
77
|
+
`),f+=p+v.slice(u)+w,p=`
|
|
78
|
+
`,m=!0):w===""?p===`
|
|
79
|
+
`?f+=`
|
|
80
|
+
`:p=`
|
|
81
|
+
`:(f+=p+w,p=" ",m=!1)}switch(r.chomp){case"-":break;case"+":for(let y=c;y<s.length;++y)f+=`
|
|
82
|
+
`+s[y][0].slice(u);f[f.length-1]!==`
|
|
83
|
+
`&&(f+=`
|
|
84
|
+
`);break;default:f+=`
|
|
85
|
+
`}let g=i+r.length+e.source.length;return{value:f,type:o,comment:r.comment,range:[i,g,g]}}a(nte,"resolveBlockScalar");function rte({offset:t,props:e},n,i){if(e[0].type!=="block-scalar-header")return i(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:r}=e[0],o=r[0],s=0,c="",u=-1;for(let p=1;p<r.length;++p){let m=r[p];if(!c&&(m==="-"||m==="+"))c=m;else{let g=Number(m);!s&&g?s=g:u===-1&&(u=t+p)}}u!==-1&&i(u,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${r}`);let l=!1,d="",f=r.length;for(let p=1;p<e.length;++p){let m=e[p];switch(m.type){case"space":l=!0;case"newline":f+=m.source.length;break;case"comment":n&&!l&&i(m,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),f+=m.source.length,d=m.source.substring(1);break;case"error":i(m,"UNEXPECTED_TOKEN",m.message),f+=m.source.length;break;default:{let g=`Unexpected token in block scalar header: ${m.type}`;i(m,"UNEXPECTED_TOKEN",g);let y=m.source;y&&typeof y=="string"&&(f+=y.length)}}}return{mode:o,indent:s,chomp:c,comment:d,length:f}}a(rte,"parseBlockScalarHeader");function ite(t){let e=t.split(/\n( *)/),n=e[0],i=n.match(/^( *)/),o=[i?.[1]?[i[1],n.slice(i[1].length)]:["",n]];for(let s=1;s<e.length;s+=2)o.push([e[s],e[s+1]]);return o}a(ite,"splitLines");CU.resolveBlockScalar=nte});var dA=I(RU=>{"use strict";var lA=at(),ote=bc();function ste(t,e,n){let{offset:i,type:r,source:o,end:s}=t,c,u,l=a((p,m,g)=>n(i+p,m,g),"_onError");switch(r){case"scalar":c=lA.Scalar.PLAIN,u=ate(o,l);break;case"single-quoted-scalar":c=lA.Scalar.QUOTE_SINGLE,u=cte(o,l);break;case"double-quoted-scalar":c=lA.Scalar.QUOTE_DOUBLE,u=ute(o,l);break;default:return n(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${r}`),{value:"",type:null,comment:"",range:[i,i+o.length,i+o.length]}}let d=i+o.length,f=ote.resolveEnd(s,d,e,n);return{value:u,type:c,comment:f.comment,range:[i,d,f.offset]}}a(ste,"resolveFlowScalar");function ate(t,e){let n="";switch(t[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${t[0]}`;break}case"@":case"`":{n=`reserved character ${t[0]}`;break}}return n&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),PU(t)}a(ate,"plainValue");function cte(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),PU(t.slice(1,-1)).replace(/''/g,"'")}a(cte,"singleQuotedValue");function PU(t){let e,n;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
86
|
+
`,"sy"),n=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
87
|
+
`,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy}let i=e.exec(t);if(!i)return t;let r=i[1],o=" ",s=e.lastIndex;for(n.lastIndex=s;i=n.exec(t);)i[1]===""?o===`
|
|
88
|
+
`?r+=o:o=`
|
|
89
|
+
`:(r+=o+i[1],o=" "),s=n.lastIndex;let c=/[ \t]*(.*)/sy;return c.lastIndex=s,i=c.exec(t),r+o+(i?.[1]??"")}a(PU,"foldLines");function ute(t,e){let n="";for(let i=1;i<t.length-1;++i){let r=t[i];if(!(r==="\r"&&t[i+1]===`
|
|
90
|
+
`))if(r===`
|
|
91
|
+
`){let{fold:o,offset:s}=lte(t,i);n+=o,i=s}else if(r==="\\"){let o=t[++i],s=dte[o];if(s)n+=s;else if(o===`
|
|
92
|
+
`)for(o=t[i+1];o===" "||o===" ";)o=t[++i+1];else if(o==="\r"&&t[i+1]===`
|
|
93
|
+
`)for(o=t[++i+1];o===" "||o===" ";)o=t[++i+1];else if(o==="x"||o==="u"||o==="U"){let c=o==="x"?2:o==="u"?4:8;n+=fte(t,i+1,c,e),i+=c}else{let c=t.substr(i-1,2);e(i-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${c}`),n+=c}}else if(r===" "||r===" "){let o=i,s=t[i+1];for(;s===" "||s===" ";)s=t[++i+1];s!==`
|
|
94
|
+
`&&!(s==="\r"&&t[i+2]===`
|
|
95
|
+
`)&&(n+=i>o?t.slice(o,i+1):r)}else n+=r}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),n}a(ute,"doubleQuotedValue");function lte(t,e){let n="",i=t[e+1];for(;(i===" "||i===" "||i===`
|
|
96
|
+
`||i==="\r")&&!(i==="\r"&&t[e+2]!==`
|
|
97
|
+
`);)i===`
|
|
98
|
+
`&&(n+=`
|
|
99
|
+
`),e+=1,i=t[e+1];return n||(n=" "),{fold:n,offset:e}}a(lte,"foldNewline");var dte={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
100
|
+
`,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function fte(t,e,n,i){let r=t.substr(e,n),s=r.length===n&&/^[0-9a-fA-F]+$/.test(r)?parseInt(r,16):NaN;try{return String.fromCodePoint(s)}catch{let c=t.substr(e-2,n+2);return i(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${c}`),c}}a(fte,"parseCharCode");RU.resolveFlowScalar=ste});var DU=I(zU=>{"use strict";var bs=be(),jU=at(),pte=uA(),mte=dA();function hte(t,e,n,i){let{value:r,type:o,comment:s,range:c}=e.type==="block-scalar"?pte.resolveBlockScalar(t,e,i):mte.resolveFlowScalar(e,t.options.strict,i),u=n?t.directives.tagName(n.source,f=>i(n,"TAG_RESOLVE_FAILED",f)):null,l;t.options.stringKeys&&t.atKey?l=t.schema[bs.SCALAR]:u?l=gte(t.schema,r,u,n,i):e.type==="scalar"?l=yte(t,r,e,i):l=t.schema[bs.SCALAR];let d;try{let f=l.resolve(r,p=>i(n??e,"TAG_RESOLVE_FAILED",p),t.options);d=bs.isScalar(f)?f:new jU.Scalar(f)}catch(f){let p=f instanceof Error?f.message:String(f);i(n??e,"TAG_RESOLVE_FAILED",p),d=new jU.Scalar(r)}return d.range=c,d.source=r,o&&(d.type=o),u&&(d.tag=u),l.format&&(d.format=l.format),s&&(d.comment=s),d}a(hte,"composeScalar");function gte(t,e,n,i,r){if(n==="!")return t[bs.SCALAR];let o=[];for(let c of t.tags)if(!c.collection&&c.tag===n)if(c.default&&c.test)o.push(c);else return c;for(let c of o)if(c.test?.test(e))return c;let s=t.knownTags[n];return s&&!s.collection?(t.tags.push(Object.assign({},s,{default:!1,test:void 0})),s):(r(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),t[bs.SCALAR])}a(gte,"findScalarTagByName");function yte({atKey:t,directives:e,schema:n},i,r,o){let s=n.tags.find(c=>(c.default===!0||t&&c.default==="key")&&c.test?.test(i))||n[bs.SCALAR];if(n.compat){let c=n.compat.find(u=>u.default&&u.test?.test(i))??n[bs.SCALAR];if(s.tag!==c.tag){let u=e.tagString(s.tag),l=e.tagString(c.tag),d=`Value may be parsed as either ${u} or ${l}`;o(r,"TAG_RESOLVE_FAILED",d,!0)}}return s}a(yte,"findScalarTagByTest");zU.composeScalar=hte});var MU=I(LU=>{"use strict";function vte(t,e,n){if(e){n??(n=e.length);for(let i=n-1;i>=0;--i){let r=e[i];switch(r.type){case"space":case"comment":case"newline":t-=r.source.length;continue}for(r=e[++i];r?.type==="space";)t+=r.source.length,r=e[++i];break}}return t}a(vte,"emptyScalarPosition");LU.emptyScalarPosition=vte});var qU=I(pA=>{"use strict";var bte=vf(),wte=be(),$te=NU(),UU=DU(),_te=bc(),kte=MU(),xte={composeNode:FU,composeEmptyNode:fA};function FU(t,e,n,i){let r=t.atKey,{spaceBefore:o,comment:s,anchor:c,tag:u}=n,l,d=!0;switch(e.type){case"alias":l=Ste(t,e,i),(c||u)&&i(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":l=UU.composeScalar(t,e,u,i),c&&(l.anchor=c.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{l=$te.composeCollection(xte,t,e,n,i),c&&(l.anchor=c.source.substring(1))}catch(f){let p=f instanceof Error?f.message:String(f);i(e,"RESOURCE_EXHAUSTION",p)}break;default:{let f=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;i(e,"UNEXPECTED_TOKEN",f),d=!1}}return l??(l=fA(t,e.offset,void 0,null,n,i)),c&&l.anchor===""&&i(c,"BAD_ALIAS","Anchor cannot be an empty string"),r&&t.options.stringKeys&&(!wte.isScalar(l)||typeof l.value!="string"||l.tag&&l.tag!=="tag:yaml.org,2002:str")&&i(u??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),o&&(l.spaceBefore=!0),s&&(e.type==="scalar"&&e.source===""?l.comment=s:l.commentBefore=s),t.options.keepSourceTokens&&d&&(l.srcToken=e),l}a(FU,"composeNode");function fA(t,e,n,i,{spaceBefore:r,comment:o,anchor:s,tag:c,end:u},l){let d={type:"scalar",offset:kte.emptyScalarPosition(e,n,i),indent:-1,source:""},f=UU.composeScalar(t,d,c,l);return s&&(f.anchor=s.source.substring(1),f.anchor===""&&l(s,"BAD_ALIAS","Anchor cannot be an empty string")),r&&(f.spaceBefore=!0),o&&(f.comment=o,f.range[2]=u),f}a(fA,"composeEmptyNode");function Ste({options:t},{offset:e,source:n,end:i},r){let o=new bte.Alias(n.substring(1));o.source===""&&r(e,"BAD_ALIAS","Alias cannot be an empty string"),o.source.endsWith(":")&&r(e+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let s=e+n.length,c=_te.resolveEnd(i,s,t.strict,r);return o.range=[e,s,c.offset],c.comment&&(o.comment=c.comment),o}a(Ste,"composeAlias");pA.composeEmptyNode=fA;pA.composeNode=FU});var BU=I(VU=>{"use strict";var Ite=Rf(),ZU=qU(),Ete=bc(),Tte=Lf();function Ate(t,e,{offset:n,start:i,value:r,end:o},s){let c=Object.assign({_directives:e},t),u=new Ite.Document(void 0,c),l={atKey:!1,atRoot:!0,directives:u.directives,options:u.options,schema:u.schema},d=Tte.resolveProps(i,{indicator:"doc-start",next:r??o?.[0],offset:n,onError:s,parentIndent:0,startOnNewline:!0});d.found&&(u.directives.docStart=!0,r&&(r.type==="block-map"||r.type==="block-seq")&&!d.hasNewline&&s(d.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),u.contents=r?ZU.composeNode(l,r,d,s):ZU.composeEmptyNode(l,d.end,i,null,d,s);let f=u.contents.range[2],p=Ete.resolveEnd(o,f,!1,s);return p.comment&&(u.comment=p.comment),u.range=[n,f,p.offset],u}a(Ate,"composeDoc");VU.composeDoc=Ate});var hA=I(WU=>{"use strict";var Ote=require("process"),Nte=eT(),Cte=Rf(),Mf=Df(),KU=be(),Pte=BU(),Rte=bc();function Uf(t){if(typeof t=="number")return[t,t+1];if(Array.isArray(t))return t.length===2?t:[t[0],t[1]];let{offset:e,source:n}=t;return[e,e+(typeof n=="string"?n.length:1)]}a(Uf,"getErrorPos");function HU(t){let e="",n=!1,i=!1;for(let r=0;r<t.length;++r){let o=t[r];switch(o[0]){case"#":e+=(e===""?"":i?`
|
|
101
|
+
|
|
102
|
+
`:`
|
|
103
|
+
`)+(o.substring(1)||" "),n=!0,i=!1;break;case"%":t[r+1]?.[0]!=="#"&&(r+=1),n=!1;break;default:n||(i=!0),n=!1}}return{comment:e,afterEmptyLine:i}}a(HU,"parsePrelude");var mA=class{static{a(this,"Composer")}constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,i,r,o)=>{let s=Uf(n);o?this.warnings.push(new Mf.YAMLWarning(s,i,r)):this.errors.push(new Mf.YAMLParseError(s,i,r))},this.directives=new Nte.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,n){let{comment:i,afterEmptyLine:r}=HU(this.prelude);if(i){let o=e.contents;if(n)e.comment=e.comment?`${e.comment}
|
|
104
|
+
${i}`:i;else if(r||e.directives.docStart||!o)e.commentBefore=i;else if(KU.isCollection(o)&&!o.flow&&o.items.length>0){let s=o.items[0];KU.isPair(s)&&(s=s.key);let c=s.commentBefore;s.commentBefore=c?`${i}
|
|
105
|
+
${c}`:i}else{let s=o.commentBefore;o.commentBefore=s?`${i}
|
|
106
|
+
${s}`:i}}if(n){for(let o=0;o<this.errors.length;++o)e.errors.push(this.errors[o]);for(let o=0;o<this.warnings.length;++o)e.warnings.push(this.warnings[o])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:HU(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,n=!1,i=-1){for(let r of e)yield*this.next(r);yield*this.end(n,i)}*next(e){switch(Ote.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(n,i,r)=>{let o=Uf(e);o[0]+=n,this.onError(o,"BAD_DIRECTIVE",i,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let n=Pte.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let n=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,i=new Mf.YAMLParseError(Uf(e),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(i):this.doc.errors.push(i);break}case"doc-end":{if(!this.doc){let i="Unexpected doc-end without preceding document";this.errors.push(new Mf.YAMLParseError(Uf(e),"UNEXPECTED_TOKEN",i));break}this.doc.directives.docEnd=!0;let n=Rte.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){let i=this.doc.comment;this.doc.comment=i?`${i}
|
|
107
|
+
${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new Mf.YAMLParseError(Uf(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let i=Object.assign({_directives:this.directives},this.options),r=new Cte.Document(void 0,i);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),r.range=[0,n,n],this.decorate(r,!1),yield r}}};WU.Composer=mA});var YU=I(vb=>{"use strict";var jte=uA(),zte=dA(),Dte=Df(),GU=kf();function Lte(t,e=!0,n){if(t){let i=a((r,o,s)=>{let c=typeof r=="number"?r:Array.isArray(r)?r[0]:r.offset;if(n)n(c,o,s);else throw new Dte.YAMLParseError([c,c+1],o,s)},"_onError");switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return zte.resolveFlowScalar(t,e,i);case"block-scalar":return jte.resolveBlockScalar({options:{strict:e}},t,i)}}return null}a(Lte,"resolveAsScalar");function Mte(t,e){let{implicitKey:n=!1,indent:i,inFlow:r=!1,offset:o=-1,type:s="PLAIN"}=e,c=GU.stringifyString({type:s,value:t},{implicitKey:n,indent:i>0?" ".repeat(i):"",inFlow:r,options:{blockQuote:!0,lineWidth:-1}}),u=e.end??[{type:"newline",offset:-1,indent:i,source:`
|
|
108
|
+
`}];switch(c[0]){case"|":case">":{let l=c.indexOf(`
|
|
109
|
+
`),d=c.substring(0,l),f=c.substring(l+1)+`
|
|
110
|
+
`,p=[{type:"block-scalar-header",offset:o,indent:i,source:d}];return JU(p,u)||p.push({type:"newline",offset:-1,indent:i,source:`
|
|
111
|
+
`}),{type:"block-scalar",offset:o,indent:i,props:p,source:f}}case'"':return{type:"double-quoted-scalar",offset:o,indent:i,source:c,end:u};case"'":return{type:"single-quoted-scalar",offset:o,indent:i,source:c,end:u};default:return{type:"scalar",offset:o,indent:i,source:c,end:u}}}a(Mte,"createScalarToken");function Ute(t,e,n={}){let{afterKey:i=!1,implicitKey:r=!1,inFlow:o=!1,type:s}=n,c="indent"in t?t.indent:null;if(i&&typeof c=="number"&&(c+=2),!s)switch(t.type){case"single-quoted-scalar":s="QUOTE_SINGLE";break;case"double-quoted-scalar":s="QUOTE_DOUBLE";break;case"block-scalar":{let l=t.props[0];if(l.type!=="block-scalar-header")throw new Error("Invalid block scalar header");s=l.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:s="PLAIN"}let u=GU.stringifyString({type:s,value:e},{implicitKey:r||c===null,indent:c!==null&&c>0?" ".repeat(c):"",inFlow:o,options:{blockQuote:!0,lineWidth:-1}});switch(u[0]){case"|":case">":Fte(t,u);break;case'"':gA(t,u,"double-quoted-scalar");break;case"'":gA(t,u,"single-quoted-scalar");break;default:gA(t,u,"scalar")}}a(Ute,"setScalarValue");function Fte(t,e){let n=e.indexOf(`
|
|
112
|
+
`),i=e.substring(0,n),r=e.substring(n+1)+`
|
|
113
|
+
`;if(t.type==="block-scalar"){let o=t.props[0];if(o.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o.source=i,t.source=r}else{let{offset:o}=t,s="indent"in t?t.indent:-1,c=[{type:"block-scalar-header",offset:o,indent:s,source:i}];JU(c,"end"in t?t.end:void 0)||c.push({type:"newline",offset:-1,indent:s,source:`
|
|
114
|
+
`});for(let u of Object.keys(t))u!=="type"&&u!=="offset"&&delete t[u];Object.assign(t,{type:"block-scalar",indent:s,props:c,source:r})}}a(Fte,"setBlockScalarValue");function JU(t,e){if(e)for(let n of e)switch(n.type){case"space":case"comment":t.push(n);break;case"newline":return t.push(n),!0}return!1}a(JU,"addEndtoBlockProps");function gA(t,e,n){switch(t.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":t.type=n,t.source=e;break;case"block-scalar":{let i=t.props.slice(1),r=e.length;t.props[0].type==="block-scalar-header"&&(r-=t.props[0].source.length);for(let o of i)o.offset+=r;delete t.props,Object.assign(t,{type:n,source:e,end:i});break}case"block-map":case"block-seq":{let r={type:"newline",offset:t.offset+e.length,indent:t.indent,source:`
|
|
115
|
+
`};delete t.items,Object.assign(t,{type:n,source:e,end:[r]});break}default:{let i="indent"in t?t.indent:-1,r="end"in t&&Array.isArray(t.end)?t.end.filter(o=>o.type==="space"||o.type==="comment"||o.type==="newline"):[];for(let o of Object.keys(t))o!=="type"&&o!=="offset"&&delete t[o];Object.assign(t,{type:n,indent:i,source:e,end:r})}}}a(gA,"setFlowScalarValue");vb.createScalarToken=Mte;vb.resolveAsScalar=Lte;vb.setScalarValue=Ute});var QU=I(XU=>{"use strict";var qte=a(t=>"type"in t?wb(t):bb(t),"stringify");function wb(t){switch(t.type){case"block-scalar":{let e="";for(let n of t.props)e+=wb(n);return e+t.source}case"block-map":case"block-seq":{let e="";for(let n of t.items)e+=bb(n);return e}case"flow-collection":{let e=t.start.source;for(let n of t.items)e+=bb(n);for(let n of t.end)e+=n.source;return e}case"document":{let e=bb(t);if(t.end)for(let n of t.end)e+=n.source;return e}default:{let e=t.source;if("end"in t&&t.end)for(let n of t.end)e+=n.source;return e}}}a(wb,"stringifyToken");function bb({start:t,key:e,sep:n,value:i}){let r="";for(let o of t)r+=o.source;if(e&&(r+=wb(e)),n)for(let o of n)r+=o.source;return i&&(r+=wb(i)),r}a(bb,"stringifyItem");XU.stringify=qte});var rF=I(nF=>{"use strict";var yA=Symbol("break visit"),Zte=Symbol("skip children"),eF=Symbol("remove item");function ws(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),tF(Object.freeze([]),t,e)}a(ws,"visit");ws.BREAK=yA;ws.SKIP=Zte;ws.REMOVE=eF;ws.itemAtPath=(t,e)=>{let n=t;for(let[i,r]of e){let o=n?.[i];if(o&&"items"in o)n=o.items[r];else return}return n};ws.parentCollection=(t,e)=>{let n=ws.itemAtPath(t,e.slice(0,-1)),i=e[e.length-1][0],r=n?.[i];if(r&&"items"in r)return r;throw new Error("Parent collection not found")};function tF(t,e,n){let i=n(e,t);if(typeof i=="symbol")return i;for(let r of["key","value"]){let o=e[r];if(o&&"items"in o){for(let s=0;s<o.items.length;++s){let c=tF(Object.freeze(t.concat([[r,s]])),o.items[s],n);if(typeof c=="number")s=c-1;else{if(c===yA)return yA;c===eF&&(o.items.splice(s,1),s-=1)}}typeof i=="function"&&r==="key"&&(i=i(e,t))}}return typeof i=="function"?i(e,t):i}a(tF,"_visit");nF.visit=ws});var $b=I(vn=>{"use strict";var vA=YU(),Vte=QU(),Bte=rF(),bA="\uFEFF",wA="",$A="",_A="",Kte=a(t=>!!t&&"items"in t,"isCollection"),Hte=a(t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar"),"isScalar");function Wte(t){switch(t){case bA:return"<BOM>";case wA:return"<DOC>";case $A:return"<FLOW_END>";case _A:return"<SCALAR>";default:return JSON.stringify(t)}}a(Wte,"prettyToken");function Gte(t){switch(t){case bA:return"byte-order-mark";case wA:return"doc-mode";case $A:return"flow-error-end";case _A:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
116
|
+
`:case`\r
|
|
117
|
+
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(t[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}a(Gte,"tokenType");vn.createScalarToken=vA.createScalarToken;vn.resolveAsScalar=vA.resolveAsScalar;vn.setScalarValue=vA.setScalarValue;vn.stringify=Vte.stringify;vn.visit=Bte.visit;vn.BOM=bA;vn.DOCUMENT=wA;vn.FLOW_END=$A;vn.SCALAR=_A;vn.isCollection=Kte;vn.isScalar=Hte;vn.prettyToken=Wte;vn.tokenType=Gte});var SA=I(oF=>{"use strict";var Ff=$b();function fr(t){switch(t){case void 0:case" ":case`
|
|
118
|
+
`:case"\r":case" ":return!0;default:return!1}}a(fr,"isEmpty");var iF=new Set("0123456789ABCDEFabcdef"),Jte=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),_b=new Set(",[]{}"),Yte=new Set(` ,[]{}
|
|
119
|
+
\r `),kA=a(t=>!t||Yte.has(t),"isNotAnchorChar"),xA=class{static{a(this,"Lexer")}constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,n=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!n;let i=this.next??"stream";for(;i&&(n||this.hasChars(1));)i=yield*this.parseNext(i)}atLineEnd(){let e=this.pos,n=this.buffer[e];for(;n===" "||n===" ";)n=this.buffer[++e];return!n||n==="#"||n===`
|
|
120
|
+
`?!0:n==="\r"?this.buffer[e+1]===`
|
|
121
|
+
`:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let n=this.buffer[e];if(this.indentNext>0){let i=0;for(;n===" ";)n=this.buffer[++i+e];if(n==="\r"){let r=this.buffer[i+e+1];if(r===`
|
|
122
|
+
`||!r&&!this.atEnd)return e+i+1}return n===`
|
|
123
|
+
`||i>=this.indentNext||!n&&!this.atEnd?e+i:-1}if(n==="-"||n==="."){let i=this.buffer.substr(e,3);if((i==="---"||i==="...")&&fr(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
|
|
124
|
+
`,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===Ff.BOM&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let n=e.length,i=e.indexOf("#");for(;i!==-1;){let o=e[i-1];if(o===" "||o===" "){n=i-1;break}else i=e.indexOf("#",i+1)}for(;;){let o=e[n-1];if(o===" "||o===" ")n-=1;else break}let r=(yield*this.pushCount(n))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-r),this.pushNewline(),"stream"}if(this.atLineEnd()){let n=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-n),yield*this.pushNewline(),"stream"}return yield Ff.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if(e==="-"||e==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let n=this.peek(3);if((n==="---"||n==="...")&&fr(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,n==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!fr(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&fr(n)){let i=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=i,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let n=yield*this.pushIndicators();switch(e[n]){case"#":yield*this.pushCount(e.length-n);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(kA),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,n,i=-1;do e=yield*this.pushNewline(),e>0?(n=yield*this.pushSpaces(!1),this.indentValue=i=n):n=0,n+=yield*this.pushSpaces(!0);while(e+n>0);let r=this.getLine();if(r===null)return this.setNext("flow");if((i!==-1&&i<this.indentNext&&r[0]!=="#"||i===0&&(r.startsWith("---")||r.startsWith("..."))&&fr(r[3]))&&!(i===this.indentNext-1&&this.flowLevel===1&&(r[0]==="]"||r[0]==="}")))return this.flowLevel=0,yield Ff.FLOW_END,yield*this.parseLineStart();let o=0;for(;r[o]===",";)o+=yield*this.pushCount(1),o+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(o+=yield*this.pushIndicators(),r[o]){case void 0:return"flow";case"#":return yield*this.pushCount(r.length-o),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(kA),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let s=this.charAt(1);if(this.flowKey||fr(s)||s===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),n=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;n!==-1&&this.buffer[n+1]==="'";)n=this.buffer.indexOf("'",n+2);else for(;n!==-1;){let o=0;for(;this.buffer[n-1-o]==="\\";)o+=1;if(o%2===0)break;n=this.buffer.indexOf('"',n+1)}let i=this.buffer.substring(0,n),r=i.indexOf(`
|
|
125
|
+
`,this.pos);if(r!==-1){for(;r!==-1;){let o=this.continueScalar(r+1);if(o===-1)break;r=i.indexOf(`
|
|
126
|
+
`,o)}r!==-1&&(n=r-(i[r-1]==="\r"?2:1))}if(n===-1){if(!this.atEnd)return this.setNext("quoted-scalar");n=this.buffer.length}return yield*this.pushToIndex(n+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let n=this.buffer[++e];if(n==="+")this.blockScalarKeep=!0;else if(n>"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>fr(n)||n==="#")}*parseBlockScalar(){let e=this.pos-1,n=0,i;e:for(let o=this.pos;i=this.buffer[o];++o)switch(i){case" ":n+=1;break;case`
|
|
127
|
+
`:e=o,n=0;break;case"\r":{let s=this.buffer[o+1];if(!s&&!this.atEnd)return this.setNext("block-scalar");if(s===`
|
|
128
|
+
`)break}default:break e}if(!i&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=n:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let o=this.continueScalar(e+1);if(o===-1)break;e=this.buffer.indexOf(`
|
|
129
|
+
`,o)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let r=e+1;for(i=this.buffer[r];i===" ";)i=this.buffer[++r];if(i===" "){for(;i===" "||i===" "||i==="\r"||i===`
|
|
130
|
+
`;)i=this.buffer[++r];e=r-1}else if(!this.blockScalarKeep)do{let o=e-1,s=this.buffer[o];s==="\r"&&(s=this.buffer[--o]);let c=o;for(;s===" ";)s=this.buffer[--o];if(s===`
|
|
131
|
+
`&&o>=this.pos&&o+1+n>c)e=o;else break}while(!0);return yield Ff.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,n=this.pos-1,i=this.pos-1,r;for(;r=this.buffer[++i];)if(r===":"){let o=this.buffer[i+1];if(fr(o)||e&&_b.has(o))break;n=i}else if(fr(r)){let o=this.buffer[i+1];if(r==="\r"&&(o===`
|
|
132
|
+
`?(i+=1,r=`
|
|
133
|
+
`,o=this.buffer[i+1]):n=i),o==="#"||e&&_b.has(o))break;if(r===`
|
|
134
|
+
`){let s=this.continueScalar(i+1);if(s===-1)break;i=Math.max(i,s-2)}}else{if(e&&_b.has(r))break;n=i}return!r&&!this.atEnd?this.setNext("plain-scalar"):(yield Ff.SCALAR,yield*this.pushToIndex(n+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,n){let i=this.buffer.slice(this.pos,e);return i?(yield i,this.pos+=i.length,i.length):(n&&(yield""),0)}*pushIndicators(){let e=0;e:for(;;){switch(this.charAt(0)){case"!":e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue e;case"&":e+=yield*this.pushUntil(kA),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let n=this.flowLevel>0,i=this.charAt(1);if(fr(i)||n&&_b.has(i)){n?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue e}}}break e}return e}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,n=this.buffer[e];for(;!fr(n)&&n!==">";)n=this.buffer[++e];return yield*this.pushToIndex(n===">"?e+1:e,!1)}else{let e=this.pos+1,n=this.buffer[e];for(;n;)if(Jte.has(n))n=this.buffer[++e];else if(n==="%"&&iF.has(this.buffer[e+1])&&iF.has(this.buffer[e+2]))n=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
|
|
135
|
+
`?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===`
|
|
136
|
+
`?yield*this.pushCount(2):0}*pushSpaces(e){let n=this.pos-1,i;do i=this.buffer[++n];while(i===" "||e&&i===" ");let r=n-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=n),r}*pushUntil(e){let n=this.pos,i=this.buffer[n];for(;!e(i);)i=this.buffer[++n];return yield*this.pushToIndex(n,!1)}};oF.Lexer=xA});var EA=I(sF=>{"use strict";var IA=class{static{a(this,"LineCounter")}constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let n=0,i=this.lineStarts.length;for(;n<i;){let o=n+i>>1;this.lineStarts[o]<e?n=o+1:i=o}if(this.lineStarts[n]===e)return{line:n+1,col:1};if(n===0)return{line:0,col:e};let r=this.lineStarts[n-1];return{line:n,col:e-r+1}}}};sF.LineCounter=IA});var AA=I(dF=>{"use strict";var Xte=require("process"),aF=$b(),Qte=SA();function mo(t,e){for(let n=0;n<t.length;++n)if(t[n].type===e)return!0;return!1}a(mo,"includesToken");function cF(t){for(let e=0;e<t.length;++e)switch(t[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}a(cF,"findNonEmptyIndex");function lF(t){switch(t?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}a(lF,"isFlowToken");function kb(t){switch(t.type){case"document":return t.start;case"block-map":{let e=t.items[t.items.length-1];return e.sep??e.start}case"block-seq":return t.items[t.items.length-1].start;default:return[]}}a(kb,"getPrevProps");function wc(t){if(t.length===0)return[];let e=t.length;e:for(;--e>=0;)switch(t[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;t[++e]?.type==="space";);return t.splice(e,t.length)}a(wc,"getFirstKeyStartProps");function xb(t,e){if(e.length<1e5)Array.prototype.push.apply(t,e);else for(let n=0;n<e.length;++n)t.push(e[n])}a(xb,"arrayPushArray");function uF(t){if(t.start.type==="flow-seq-start")for(let e of t.items)e.sep&&!e.value&&!mo(e.start,"explicit-key-ind")&&!mo(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,lF(e.value)?e.value.end?xb(e.value.end,e.sep):e.value.end=e.sep:xb(e.start,e.sep),delete e.sep)}a(uF,"fixFlowSeqItems");var TA=class{static{a(this,"Parser")}constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new Qte.Lexer,this.onNewLine=e}*parse(e,n=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let i of this.lexer.lex(e,n))yield*this.next(i);n||(yield*this.end())}*next(e){if(this.source=e,Xte.env.LOG_TOKENS&&console.log("|",aF.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let n=aF.tokenType(e);if(n)if(n==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=n,yield*this.step(),n){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{let i=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:i,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let n=e??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{let i=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in i?i.indent:0:n.type==="flow-collection"&&i.type==="document"&&(n.indent=0),n.type==="flow-collection"&&uF(n),i.type){case"document":i.value=n;break;case"block-scalar":i.props.push(n);break;case"block-map":{let r=i.items[i.items.length-1];if(r.value){i.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(r.sep)r.value=n;else{Object.assign(r,{key:n,sep:[]}),this.onKeyLine=!r.explicitKey;return}break}case"block-seq":{let r=i.items[i.items.length-1];r.value?i.items.push({start:[],value:n}):r.value=n;break}case"flow-collection":{let r=i.items[i.items.length-1];!r||r.value?i.items.push({start:[],key:n,sep:[]}):r.sep?r.value=n:Object.assign(r,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((i.type==="document"||i.type==="block-map"||i.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){let r=n.items[n.items.length-1];r&&!r.sep&&!r.value&&r.start.length>0&&cF(r.start)===-1&&(n.indent===0||r.start.every(o=>o.type!=="comment"||o.indent<n.indent))&&(i.type==="document"?i.end=r.start:i.items.push({start:r.start}),n.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let e={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":{cF(e.start)!==-1?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type==="map-value-ind"){let n=kb(this.peek(2)),i=wc(n),r;e.end?(r=e.end,r.push(this.sourceToken),delete e.end):r=[this.sourceToken];let o={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:i,key:e,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=o}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let n=this.source.indexOf(`
|
|
137
|
+
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
|
|
138
|
+
`,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let n=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){let i="end"in n.value?n.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)e.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,e.indent)){let r=e.items[e.items.length-2]?.value?.end;if(Array.isArray(r)){xb(r,n.start),r.push(this.sourceToken),e.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let i=!this.onKeyLine&&this.indent===e.indent,r=i&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind",o=[];if(r&&n.sep&&!n.value){let s=[];for(let c=0;c<n.sep.length;++c){let u=n.sep[c];switch(u.type){case"newline":s.push(c);break;case"space":break;case"comment":u.indent>e.indent&&(s.length=0);break;default:s.length=0}}s.length>=2&&(o=n.sep.splice(s[1]))}switch(this.type){case"anchor":case"tag":r||n.value?(o.push(this.sourceToken),e.items.push({start:o}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):r||n.value?(o.push(this.sourceToken),e.items.push({start:o,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(mo(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]});else if(lF(n.key)&&!mo(n.sep,"newline")){let s=wc(n.start),c=n.key,u=n.sep;u.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:c,sep:u}]})}else o.length>0?n.sep=n.sep.concat(o,this.sourceToken):n.sep.push(this.sourceToken);else if(mo(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{let s=wc(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||r?e.items.push({start:o,key:null,sep:[this.sourceToken]}):mo(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let s=this.flowScalar(this.type);r||n.value?(e.items.push({start:o,key:s,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(s):(Object.assign(n,{key:s,sep:[]}),this.onKeyLine=!0);return}default:{let s=this.startBlockValue(e);if(s){if(s.type==="block-seq"){if(!n.explicitKey&&n.sep&&!mo(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else i&&e.items.push({start:o});this.stack.push(s);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let n=e.items[e.items.length-1];switch(this.type){case"newline":if(n.value){let i="end"in n.value?n.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,e.indent)){let r=e.items[e.items.length-2]?.value?.end;if(Array.isArray(r)){xb(r,n.start),r.push(this.sourceToken),e.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=e.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;n.value||mo(n.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>e.indent){let i=this.startBlockValue(e);if(i){this.stack.push(i);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let n=e.items[e.items.length-1];if(this.type==="flow-error-end"){let i;do yield*this.pop(),i=this.peek(1);while(i?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?e.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?e.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let r=this.flowScalar(this.type);!n||n.value?e.items.push({start:[],key:r,sep:[]}):n.sep?this.stack.push(r):Object.assign(n,{key:r,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let i=this.startBlockValue(e);i?this.stack.push(i):(yield*this.pop(),yield*this.step())}else{let i=this.peek(2);if(i.type==="block-map"&&(this.type==="map-value-ind"&&i.indent===e.indent||this.type==="newline"&&!i.items[i.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&i.type!=="flow-collection"){let r=kb(i),o=wc(r);uF(e);let s=e.end.splice(1,e.end.length);s.push(this.sourceToken);let c={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:o,key:e,sep:s}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=c}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let n=this.source.indexOf(`
|
|
139
|
+
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
|
|
140
|
+
`,n)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let n=kb(e),i=wc(n);return i.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let n=kb(e),i=wc(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,n){return this.type!=="comment"||this.indent<=n?!1:e.every(i=>i.type==="newline"||i.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};dF.Parser=TA});var gF=I(Zf=>{"use strict";var fF=hA(),ene=Rf(),qf=Df(),tne=pT(),nne=be(),rne=EA(),pF=AA();function mF(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new rne.LineCounter||null,prettyErrors:e}}a(mF,"parseOptions");function ine(t,e={}){let{lineCounter:n,prettyErrors:i}=mF(e),r=new pF.Parser(n?.addNewLine),o=new fF.Composer(e),s=Array.from(o.compose(r.parse(t)));if(i&&n)for(let c of s)c.errors.forEach(qf.prettifyError(t,n)),c.warnings.forEach(qf.prettifyError(t,n));return s.length>0?s:Object.assign([],{empty:!0},o.streamInfo())}a(ine,"parseAllDocuments");function hF(t,e={}){let{lineCounter:n,prettyErrors:i}=mF(e),r=new pF.Parser(n?.addNewLine),o=new fF.Composer(e),s=null;for(let c of o.compose(r.parse(t),!0,t.length))if(!s)s=c;else if(s.options.logLevel!=="silent"){s.errors.push(new qf.YAMLParseError(c.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return i&&n&&(s.errors.forEach(qf.prettifyError(t,n)),s.warnings.forEach(qf.prettifyError(t,n))),s}a(hF,"parseDocument");function one(t,e,n){let i;typeof e=="function"?i=e:n===void 0&&e&&typeof e=="object"&&(n=e);let r=hF(t,n);if(!r)return null;if(r.warnings.forEach(o=>tne.warn(r.options.logLevel,o)),r.errors.length>0){if(r.options.logLevel!=="silent")throw r.errors[0];r.errors=[]}return r.toJS(Object.assign({reviver:i},n))}a(one,"parse");function sne(t,e,n){let i=null;if(typeof e=="function"||Array.isArray(e)?i=e:n===void 0&&e&&(n=e),typeof n=="string"&&(n=n.length),typeof n=="number"){let r=Math.round(n);n=r<1?void 0:r>8?{indent:8}:{indent:r}}if(t===void 0){let{keepUndefined:r}=n??e??{};if(!r)return}return nne.isDocument(t)&&!i?t.toString(n):new ene.Document(t,i,n).toString(n)}a(sne,"stringify");Zf.parse=one;Zf.parseAllDocuments=ine;Zf.parseDocument=hF;Zf.stringify=sne});var vF=I(Ne=>{"use strict";var ane=hA(),cne=Rf(),une=GT(),OA=Df(),lne=vf(),ho=be(),dne=uo(),fne=at(),pne=fo(),mne=po(),hne=$b(),gne=SA(),yne=EA(),vne=AA(),Sb=gF(),yF=mf();Ne.Composer=ane.Composer;Ne.Document=cne.Document;Ne.Schema=une.Schema;Ne.YAMLError=OA.YAMLError;Ne.YAMLParseError=OA.YAMLParseError;Ne.YAMLWarning=OA.YAMLWarning;Ne.Alias=lne.Alias;Ne.isAlias=ho.isAlias;Ne.isCollection=ho.isCollection;Ne.isDocument=ho.isDocument;Ne.isMap=ho.isMap;Ne.isNode=ho.isNode;Ne.isPair=ho.isPair;Ne.isScalar=ho.isScalar;Ne.isSeq=ho.isSeq;Ne.Pair=dne.Pair;Ne.Scalar=fne.Scalar;Ne.YAMLMap=pne.YAMLMap;Ne.YAMLSeq=mne.YAMLSeq;Ne.CST=hne;Ne.Lexer=gne.Lexer;Ne.LineCounter=yne.LineCounter;Ne.Parser=vne.Parser;Ne.parse=Sb.parse;Ne.parseAllDocuments=Sb.parseAllDocuments;Ne.parseDocument=Sb.parseDocument;Ne.stringify=Sb.stringify;Ne.visit=yF.visit;Ne.visitAsync=yF.visitAsync});var xp=I(Se=>{"use strict";Object.defineProperty(Se,"__esModule",{value:!0});Se.regexpCode=Se.getEsmExportName=Se.getProperty=Se.safeStringify=Se.stringify=Se.strConcat=Se.addCodeArg=Se.str=Se._=Se.nil=Se._Code=Se.Name=Se.IDENTIFIER=Se._CodeOrName=void 0;var _p=class{static{a(this,"_CodeOrName")}};Se._CodeOrName=_p;Se.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Cs=class extends _p{static{a(this,"Name")}constructor(e){if(super(),!Se.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};Se.Name=Cs;var Jn=class extends _p{static{a(this,"_Code")}constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((n,i)=>`${n}${i}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((n,i)=>(i instanceof Cs&&(n[i.str]=(n[i.str]||0)+1),n),{})}};Se._Code=Jn;Se.nil=new Jn("");function Uq(t,...e){let n=[t[0]],i=0;for(;i<e.length;)FO(n,e[i]),n.push(t[++i]);return new Jn(n)}a(Uq,"_");Se._=Uq;var UO=new Jn("+");function Fq(t,...e){let n=[kp(t[0])],i=0;for(;i<e.length;)n.push(UO),FO(n,e[i]),n.push(UO,kp(t[++i]));return nse(n),new Jn(n)}a(Fq,"str");Se.str=Fq;function FO(t,e){e instanceof Jn?t.push(...e._items):e instanceof Cs?t.push(e):t.push(ose(e))}a(FO,"addCodeArg");Se.addCodeArg=FO;function nse(t){let e=1;for(;e<t.length-1;){if(t[e]===UO){let n=rse(t[e-1],t[e+1]);if(n!==void 0){t.splice(e-1,3,n);continue}t[e++]="+"}e++}}a(nse,"optimize");function rse(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof Cs||t[t.length-1]!=='"'?void 0:typeof e!="string"?`${t.slice(0,-1)}${e}"`:e[0]==='"'?t.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(t instanceof Cs))return`"${t}${e.slice(1)}`}a(rse,"mergeExprItems");function ise(t,e){return e.emptyStr()?t:t.emptyStr()?e:Fq`${t}${e}`}a(ise,"strConcat");Se.strConcat=ise;function ose(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:kp(Array.isArray(t)?t.join(","):t)}a(ose,"interpolate");function sse(t){return new Jn(kp(t))}a(sse,"stringify");Se.stringify=sse;function kp(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}a(kp,"safeStringify");Se.safeStringify=kp;function ase(t){return typeof t=="string"&&Se.IDENTIFIER.test(t)?new Jn(`.${t}`):Uq`[${t}]`}a(ase,"getProperty");Se.getProperty=ase;function cse(t){if(typeof t=="string"&&Se.IDENTIFIER.test(t))return new Jn(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}a(cse,"getEsmExportName");Se.getEsmExportName=cse;function use(t){return new Jn(t.toString())}a(use,"regexpCode");Se.regexpCode=use});var VO=I(wn=>{"use strict";Object.defineProperty(wn,"__esModule",{value:!0});wn.ValueScope=wn.ValueScopeName=wn.Scope=wn.varKinds=wn.UsedValueState=void 0;var bn=xp(),qO=class extends Error{static{a(this,"ValueError")}constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},$w;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})($w||(wn.UsedValueState=$w={}));wn.varKinds={const:new bn.Name("const"),let:new bn.Name("let"),var:new bn.Name("var")};var _w=class{static{a(this,"Scope")}constructor({prefixes:e,parent:n}={}){this._names={},this._prefixes=e,this._parent=n}toName(e){return e instanceof bn.Name?e:this.name(e)}name(e){return new bn.Name(this._newName(e))}_newName(e){let n=this._names[e]||this._nameGroup(e);return`${e}${n.index++}`}_nameGroup(e){var n,i;if(!((i=(n=this._parent)===null||n===void 0?void 0:n._prefixes)===null||i===void 0)&&i.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};wn.Scope=_w;var kw=class extends bn.Name{static{a(this,"ValueScopeName")}constructor(e,n){super(n),this.prefix=e}setValue(e,{property:n,itemIndex:i}){this.value=e,this.scopePath=(0,bn._)`.${new bn.Name(n)}[${i}]`}};wn.ValueScopeName=kw;var lse=(0,bn._)`\n`,ZO=class extends _w{static{a(this,"ValueScope")}constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?lse:bn.nil}}get(){return this._scope}name(e){return new kw(e,this._newName(e))}value(e,n){var i;if(n.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let r=this.toName(e),{prefix:o}=r,s=(i=n.key)!==null&&i!==void 0?i:n.ref,c=this._values[o];if(c){let d=c.get(s);if(d)return d}else c=this._values[o]=new Map;c.set(s,r);let u=this._scope[o]||(this._scope[o]=[]),l=u.length;return u[l]=n.ref,r.setValue(n,{property:o,itemIndex:l}),r}getValue(e,n){let i=this._values[e];if(i)return i.get(n)}scopeRefs(e,n=this._values){return this._reduceValues(n,i=>{if(i.scopePath===void 0)throw new Error(`CodeGen: name "${i}" has no value`);return(0,bn._)`${e}${i.scopePath}`})}scopeCode(e=this._values,n,i){return this._reduceValues(e,r=>{if(r.value===void 0)throw new Error(`CodeGen: name "${r}" has no value`);return r.value.code},n,i)}_reduceValues(e,n,i={},r){let o=bn.nil;for(let s in e){let c=e[s];if(!c)continue;let u=i[s]=i[s]||new Map;c.forEach(l=>{if(u.has(l))return;u.set(l,$w.Started);let d=n(l);if(d){let f=this.opts.es5?wn.varKinds.var:wn.varKinds.const;o=(0,bn._)`${o}${f} ${l} = ${d};${this.opts._n}`}else if(d=r?.(l))o=(0,bn._)`${o}${d}${this.opts._n}`;else throw new qO(l);u.set(l,$w.Completed)})}return o}};wn.ValueScope=ZO});var ce=I(fe=>{"use strict";Object.defineProperty(fe,"__esModule",{value:!0});fe.or=fe.and=fe.not=fe.CodeGen=fe.operators=fe.varKinds=fe.ValueScopeName=fe.ValueScope=fe.Scope=fe.Name=fe.regexpCode=fe.stringify=fe.getProperty=fe.nil=fe.strConcat=fe.str=fe._=void 0;var ve=xp(),br=VO(),So=xp();Object.defineProperty(fe,"_",{enumerable:!0,get:a(function(){return So._},"get")});Object.defineProperty(fe,"str",{enumerable:!0,get:a(function(){return So.str},"get")});Object.defineProperty(fe,"strConcat",{enumerable:!0,get:a(function(){return So.strConcat},"get")});Object.defineProperty(fe,"nil",{enumerable:!0,get:a(function(){return So.nil},"get")});Object.defineProperty(fe,"getProperty",{enumerable:!0,get:a(function(){return So.getProperty},"get")});Object.defineProperty(fe,"stringify",{enumerable:!0,get:a(function(){return So.stringify},"get")});Object.defineProperty(fe,"regexpCode",{enumerable:!0,get:a(function(){return So.regexpCode},"get")});Object.defineProperty(fe,"Name",{enumerable:!0,get:a(function(){return So.Name},"get")});var Ew=VO();Object.defineProperty(fe,"Scope",{enumerable:!0,get:a(function(){return Ew.Scope},"get")});Object.defineProperty(fe,"ValueScope",{enumerable:!0,get:a(function(){return Ew.ValueScope},"get")});Object.defineProperty(fe,"ValueScopeName",{enumerable:!0,get:a(function(){return Ew.ValueScopeName},"get")});Object.defineProperty(fe,"varKinds",{enumerable:!0,get:a(function(){return Ew.varKinds},"get")});fe.operators={GT:new ve._Code(">"),GTE:new ve._Code(">="),LT:new ve._Code("<"),LTE:new ve._Code("<="),EQ:new ve._Code("==="),NEQ:new ve._Code("!=="),NOT:new ve._Code("!"),OR:new ve._Code("||"),AND:new ve._Code("&&"),ADD:new ve._Code("+")};var mi=class{static{a(this,"Node")}optimizeNodes(){return this}optimizeNames(e,n){return this}},BO=class extends mi{static{a(this,"Def")}constructor(e,n,i){super(),this.varKind=e,this.name=n,this.rhs=i}render({es5:e,_n:n}){let i=e?br.varKinds.var:this.varKind,r=this.rhs===void 0?"":` = ${this.rhs}`;return`${i} ${this.name}${r};`+n}optimizeNames(e,n){if(e[this.name.str])return this.rhs&&(this.rhs=Xc(this.rhs,e,n)),this}get names(){return this.rhs instanceof ve._CodeOrName?this.rhs.names:{}}},xw=class extends mi{static{a(this,"Assign")}constructor(e,n,i){super(),this.lhs=e,this.rhs=n,this.sideEffects=i}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,n){if(!(this.lhs instanceof ve.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=Xc(this.rhs,e,n),this}get names(){let e=this.lhs instanceof ve.Name?{}:{...this.lhs.names};return Iw(e,this.rhs)}},KO=class extends xw{static{a(this,"AssignOp")}constructor(e,n,i,r){super(e,i,r),this.op=n}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},HO=class extends mi{static{a(this,"Label")}constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},WO=class extends mi{static{a(this,"Break")}constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},GO=class extends mi{static{a(this,"Throw")}constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},JO=class extends mi{static{a(this,"AnyCode")}constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,n){return this.code=Xc(this.code,e,n),this}get names(){return this.code instanceof ve._CodeOrName?this.code.names:{}}},Sp=class extends mi{static{a(this,"ParentNode")}constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((n,i)=>n+i.render(e),"")}optimizeNodes(){let{nodes:e}=this,n=e.length;for(;n--;){let i=e[n].optimizeNodes();Array.isArray(i)?e.splice(n,1,...i):i?e[n]=i:e.splice(n,1)}return e.length>0?this:void 0}optimizeNames(e,n){let{nodes:i}=this,r=i.length;for(;r--;){let o=i[r];o.optimizeNames(e,n)||(dse(e,o.names),i.splice(r,1))}return i.length>0?this:void 0}get names(){return this.nodes.reduce((e,n)=>js(e,n.names),{})}},hi=class extends Sp{static{a(this,"BlockNode")}render(e){return"{"+e._n+super.render(e)+"}"+e._n}},YO=class extends Sp{static{a(this,"Root")}},Yc=class extends hi{static{a(this,"Else")}};Yc.kind="else";var Ps=class t extends hi{static{a(this,"If")}constructor(e,n){super(n),this.condition=e}render(e){let n=`if(${this.condition})`+super.render(e);return this.else&&(n+="else "+this.else.render(e)),n}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let n=this.else;if(n){let i=n.optimizeNodes();n=this.else=Array.isArray(i)?new Yc(i):i}if(n)return e===!1?n instanceof t?n:n.nodes:this.nodes.length?this:new t(qq(e),n instanceof t?[n]:n.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,n){var i;if(this.else=(i=this.else)===null||i===void 0?void 0:i.optimizeNames(e,n),!!(super.optimizeNames(e,n)||this.else))return this.condition=Xc(this.condition,e,n),this}get names(){let e=super.names;return Iw(e,this.condition),this.else&&js(e,this.else.names),e}};Ps.kind="if";var Rs=class extends hi{static{a(this,"For")}};Rs.kind="for";var XO=class extends Rs{static{a(this,"ForLoop")}constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,n){if(super.optimizeNames(e,n))return this.iteration=Xc(this.iteration,e,n),this}get names(){return js(super.names,this.iteration.names)}},QO=class extends Rs{static{a(this,"ForRange")}constructor(e,n,i,r){super(),this.varKind=e,this.name=n,this.from=i,this.to=r}render(e){let n=e.es5?br.varKinds.var:this.varKind,{name:i,from:r,to:o}=this;return`for(${n} ${i}=${r}; ${i}<${o}; ${i}++)`+super.render(e)}get names(){let e=Iw(super.names,this.from);return Iw(e,this.to)}},Sw=class extends Rs{static{a(this,"ForIter")}constructor(e,n,i,r){super(),this.loop=e,this.varKind=n,this.name=i,this.iterable=r}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,n){if(super.optimizeNames(e,n))return this.iterable=Xc(this.iterable,e,n),this}get names(){return js(super.names,this.iterable.names)}},Ip=class extends hi{static{a(this,"Func")}constructor(e,n,i){super(),this.name=e,this.args=n,this.async=i}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};Ip.kind="func";var Ep=class extends Sp{static{a(this,"Return")}render(e){return"return "+super.render(e)}};Ep.kind="return";var eN=class extends hi{static{a(this,"Try")}render(e){let n="try"+super.render(e);return this.catch&&(n+=this.catch.render(e)),this.finally&&(n+=this.finally.render(e)),n}optimizeNodes(){var e,n;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(n=this.finally)===null||n===void 0||n.optimizeNodes(),this}optimizeNames(e,n){var i,r;return super.optimizeNames(e,n),(i=this.catch)===null||i===void 0||i.optimizeNames(e,n),(r=this.finally)===null||r===void 0||r.optimizeNames(e,n),this}get names(){let e=super.names;return this.catch&&js(e,this.catch.names),this.finally&&js(e,this.finally.names),e}},Tp=class extends hi{static{a(this,"Catch")}constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};Tp.kind="catch";var Ap=class extends hi{static{a(this,"Finally")}render(e){return"finally"+super.render(e)}};Ap.kind="finally";var tN=class{static{a(this,"CodeGen")}constructor(e,n={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...n,_n:n.lines?`
|
|
141
|
+
`:""},this._extScope=e,this._scope=new br.Scope({parent:e}),this._nodes=[new YO]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,n){let i=this._extScope.value(e,n);return(this._values[i.prefix]||(this._values[i.prefix]=new Set)).add(i),i}getScopeValue(e,n){return this._extScope.getValue(e,n)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,n,i,r){let o=this._scope.toName(n);return i!==void 0&&r&&(this._constants[o.str]=i),this._leafNode(new BO(e,o,i)),o}const(e,n,i){return this._def(br.varKinds.const,e,n,i)}let(e,n,i){return this._def(br.varKinds.let,e,n,i)}var(e,n,i){return this._def(br.varKinds.var,e,n,i)}assign(e,n,i){return this._leafNode(new xw(e,n,i))}add(e,n){return this._leafNode(new KO(e,fe.operators.ADD,n))}code(e){return typeof e=="function"?e():e!==ve.nil&&this._leafNode(new JO(e)),this}object(...e){let n=["{"];for(let[i,r]of e)n.length>1&&n.push(","),n.push(i),(i!==r||this.opts.es5)&&(n.push(":"),(0,ve.addCodeArg)(n,r));return n.push("}"),new ve._Code(n)}if(e,n,i){if(this._blockNode(new Ps(e)),n&&i)this.code(n).else().code(i).endIf();else if(n)this.code(n).endIf();else if(i)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new Ps(e))}else(){return this._elseNode(new Yc)}endIf(){return this._endBlockNode(Ps,Yc)}_for(e,n){return this._blockNode(e),n&&this.code(n).endFor(),this}for(e,n){return this._for(new XO(e),n)}forRange(e,n,i,r,o=this.opts.es5?br.varKinds.var:br.varKinds.let){let s=this._scope.toName(e);return this._for(new QO(o,s,n,i),()=>r(s))}forOf(e,n,i,r=br.varKinds.const){let o=this._scope.toName(e);if(this.opts.es5){let s=n instanceof ve.Name?n:this.var("_arr",n);return this.forRange("_i",0,(0,ve._)`${s}.length`,c=>{this.var(o,(0,ve._)`${s}[${c}]`),i(o)})}return this._for(new Sw("of",r,o,n),()=>i(o))}forIn(e,n,i,r=this.opts.es5?br.varKinds.var:br.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,ve._)`Object.keys(${n})`,i);let o=this._scope.toName(e);return this._for(new Sw("in",r,o,n),()=>i(o))}endFor(){return this._endBlockNode(Rs)}label(e){return this._leafNode(new HO(e))}break(e){return this._leafNode(new WO(e))}return(e){let n=new Ep;if(this._blockNode(n),this.code(e),n.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Ep)}try(e,n,i){if(!n&&!i)throw new Error('CodeGen: "try" without "catch" and "finally"');let r=new eN;if(this._blockNode(r),this.code(e),n){let o=this.name("e");this._currNode=r.catch=new Tp(o),n(o)}return i&&(this._currNode=r.finally=new Ap,this.code(i)),this._endBlockNode(Tp,Ap)}throw(e){return this._leafNode(new GO(e))}block(e,n){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(n),this}endBlock(e){let n=this._blockStarts.pop();if(n===void 0)throw new Error("CodeGen: not in self-balancing block");let i=this._nodes.length-n;if(i<0||e!==void 0&&i!==e)throw new Error(`CodeGen: wrong number of nodes: ${i} vs ${e} expected`);return this._nodes.length=n,this}func(e,n=ve.nil,i,r){return this._blockNode(new Ip(e,n,i)),r&&this.code(r).endFunc(),this}endFunc(){return this._endBlockNode(Ip)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,n){let i=this._currNode;if(i instanceof e||n&&i instanceof n)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${n?`${e.kind}/${n.kind}`:e.kind}"`)}_elseNode(e){let n=this._currNode;if(!(n instanceof Ps))throw new Error('CodeGen: "else" without "if"');return this._currNode=n.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let n=this._nodes;n[n.length-1]=e}};fe.CodeGen=tN;function js(t,e){for(let n in e)t[n]=(t[n]||0)+(e[n]||0);return t}a(js,"addNames");function Iw(t,e){return e instanceof ve._CodeOrName?js(t,e.names):t}a(Iw,"addExprNames");function Xc(t,e,n){if(t instanceof ve.Name)return i(t);if(!r(t))return t;return new ve._Code(t._items.reduce((o,s)=>(s instanceof ve.Name&&(s=i(s)),s instanceof ve._Code?o.push(...s._items):o.push(s),o),[]));function i(o){let s=n[o.str];return s===void 0||e[o.str]!==1?o:(delete e[o.str],s)}function r(o){return o instanceof ve._Code&&o._items.some(s=>s instanceof ve.Name&&e[s.str]===1&&n[s.str]!==void 0)}}a(Xc,"optimizeExpr");function dse(t,e){for(let n in e)t[n]=(t[n]||0)-(e[n]||0)}a(dse,"subtractNames");function qq(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,ve._)`!${nN(t)}`}a(qq,"not");fe.not=qq;var fse=Zq(fe.operators.AND);function pse(...t){return t.reduce(fse)}a(pse,"and");fe.and=pse;var mse=Zq(fe.operators.OR);function hse(...t){return t.reduce(mse)}a(hse,"or");fe.or=hse;function Zq(t){return(e,n)=>e===ve.nil?n:n===ve.nil?e:(0,ve._)`${nN(e)} ${t} ${nN(n)}`}a(Zq,"mappend");function nN(t){return t instanceof ve.Name?t:(0,ve._)`(${t})`}a(nN,"par")});var we=I(pe=>{"use strict";Object.defineProperty(pe,"__esModule",{value:!0});pe.checkStrictMode=pe.getErrorPath=pe.Type=pe.useFunc=pe.setEvaluated=pe.evaluatedPropsToName=pe.mergeEvaluated=pe.eachItem=pe.unescapeJsonPointer=pe.escapeJsonPointer=pe.escapeFragment=pe.unescapeFragment=pe.schemaRefOrVal=pe.schemaHasRulesButRef=pe.schemaHasRules=pe.checkUnknownRules=pe.alwaysValidSchema=pe.toHash=void 0;var Ue=ce(),gse=xp();function yse(t){let e={};for(let n of t)e[n]=!0;return e}a(yse,"toHash");pe.toHash=yse;function vse(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(Kq(t,e),!Hq(e,t.self.RULES.all))}a(vse,"alwaysValidSchema");pe.alwaysValidSchema=vse;function Kq(t,e=t.schema){let{opts:n,self:i}=t;if(!n.strictSchema||typeof e=="boolean")return;let r=i.RULES.keywords;for(let o in e)r[o]||Jq(t,`unknown keyword: "${o}"`)}a(Kq,"checkUnknownRules");pe.checkUnknownRules=Kq;function Hq(t,e){if(typeof t=="boolean")return!t;for(let n in t)if(e[n])return!0;return!1}a(Hq,"schemaHasRules");pe.schemaHasRules=Hq;function bse(t,e){if(typeof t=="boolean")return!t;for(let n in t)if(n!=="$ref"&&e.all[n])return!0;return!1}a(bse,"schemaHasRulesButRef");pe.schemaHasRulesButRef=bse;function wse({topSchemaRef:t,schemaPath:e},n,i,r){if(!r){if(typeof n=="number"||typeof n=="boolean")return n;if(typeof n=="string")return(0,Ue._)`${n}`}return(0,Ue._)`${t}${e}${(0,Ue.getProperty)(i)}`}a(wse,"schemaRefOrVal");pe.schemaRefOrVal=wse;function $se(t){return Wq(decodeURIComponent(t))}a($se,"unescapeFragment");pe.unescapeFragment=$se;function _se(t){return encodeURIComponent(iN(t))}a(_se,"escapeFragment");pe.escapeFragment=_se;function iN(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}a(iN,"escapeJsonPointer");pe.escapeJsonPointer=iN;function Wq(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}a(Wq,"unescapeJsonPointer");pe.unescapeJsonPointer=Wq;function kse(t,e){if(Array.isArray(t))for(let n of t)e(n);else e(t)}a(kse,"eachItem");pe.eachItem=kse;function Vq({mergeNames:t,mergeToName:e,mergeValues:n,resultToName:i}){return(r,o,s,c)=>{let u=s===void 0?o:s instanceof Ue.Name?(o instanceof Ue.Name?t(r,o,s):e(r,o,s),s):o instanceof Ue.Name?(e(r,s,o),o):n(o,s);return c===Ue.Name&&!(u instanceof Ue.Name)?i(r,u):u}}a(Vq,"makeMergeEvaluated");pe.mergeEvaluated={props:Vq({mergeNames:a((t,e,n)=>t.if((0,Ue._)`${n} !== true && ${e} !== undefined`,()=>{t.if((0,Ue._)`${e} === true`,()=>t.assign(n,!0),()=>t.assign(n,(0,Ue._)`${n} || {}`).code((0,Ue._)`Object.assign(${n}, ${e})`))}),"mergeNames"),mergeToName:a((t,e,n)=>t.if((0,Ue._)`${n} !== true`,()=>{e===!0?t.assign(n,!0):(t.assign(n,(0,Ue._)`${n} || {}`),oN(t,n,e))}),"mergeToName"),mergeValues:a((t,e)=>t===!0?!0:{...t,...e},"mergeValues"),resultToName:Gq}),items:Vq({mergeNames:a((t,e,n)=>t.if((0,Ue._)`${n} !== true && ${e} !== undefined`,()=>t.assign(n,(0,Ue._)`${e} === true ? true : ${n} > ${e} ? ${n} : ${e}`)),"mergeNames"),mergeToName:a((t,e,n)=>t.if((0,Ue._)`${n} !== true`,()=>t.assign(n,e===!0?!0:(0,Ue._)`${n} > ${e} ? ${n} : ${e}`)),"mergeToName"),mergeValues:a((t,e)=>t===!0?!0:Math.max(t,e),"mergeValues"),resultToName:a((t,e)=>t.var("items",e),"resultToName")})};function Gq(t,e){if(e===!0)return t.var("props",!0);let n=t.var("props",(0,Ue._)`{}`);return e!==void 0&&oN(t,n,e),n}a(Gq,"evaluatedPropsToName");pe.evaluatedPropsToName=Gq;function oN(t,e,n){Object.keys(n).forEach(i=>t.assign((0,Ue._)`${e}${(0,Ue.getProperty)(i)}`,!0))}a(oN,"setEvaluated");pe.setEvaluated=oN;var Bq={};function xse(t,e){return t.scopeValue("func",{ref:e,code:Bq[e.code]||(Bq[e.code]=new gse._Code(e.code))})}a(xse,"useFunc");pe.useFunc=xse;var rN;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(rN||(pe.Type=rN={}));function Sse(t,e,n){if(t instanceof Ue.Name){let i=e===rN.Num;return n?i?(0,Ue._)`"[" + ${t} + "]"`:(0,Ue._)`"['" + ${t} + "']"`:i?(0,Ue._)`"/" + ${t}`:(0,Ue._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return n?(0,Ue.getProperty)(t).toString():"/"+iN(t)}a(Sse,"getErrorPath");pe.getErrorPath=Sse;function Jq(t,e,n=t.opts.strictSchema){if(n){if(e=`strict mode: ${e}`,n===!0)throw new Error(e);t.self.logger.warn(e)}}a(Jq,"checkStrictMode");pe.checkStrictMode=Jq});var gi=I(sN=>{"use strict";Object.defineProperty(sN,"__esModule",{value:!0});var Lt=ce(),Ise={data:new Lt.Name("data"),valCxt:new Lt.Name("valCxt"),instancePath:new Lt.Name("instancePath"),parentData:new Lt.Name("parentData"),parentDataProperty:new Lt.Name("parentDataProperty"),rootData:new Lt.Name("rootData"),dynamicAnchors:new Lt.Name("dynamicAnchors"),vErrors:new Lt.Name("vErrors"),errors:new Lt.Name("errors"),this:new Lt.Name("this"),self:new Lt.Name("self"),scope:new Lt.Name("scope"),json:new Lt.Name("json"),jsonPos:new Lt.Name("jsonPos"),jsonLen:new Lt.Name("jsonLen"),jsonPart:new Lt.Name("jsonPart")};sN.default=Ise});var Op=I(Mt=>{"use strict";Object.defineProperty(Mt,"__esModule",{value:!0});Mt.extendErrors=Mt.resetErrorsCount=Mt.reportExtraError=Mt.reportError=Mt.keyword$DataError=Mt.keywordError=void 0;var $e=ce(),Tw=we(),Jt=gi();Mt.keywordError={message:a(({keyword:t})=>(0,$e.str)`must pass "${t}" keyword validation`,"message")};Mt.keyword$DataError={message:a(({keyword:t,schemaType:e})=>e?(0,$e.str)`"${t}" keyword must be ${e} ($data)`:(0,$e.str)`"${t}" keyword is invalid ($data)`,"message")};function Ese(t,e=Mt.keywordError,n,i){let{it:r}=t,{gen:o,compositeRule:s,allErrors:c}=r,u=Qq(t,e,n);i??(s||c)?Yq(o,u):Xq(r,(0,$e._)`[${u}]`)}a(Ese,"reportError");Mt.reportError=Ese;function Tse(t,e=Mt.keywordError,n){let{it:i}=t,{gen:r,compositeRule:o,allErrors:s}=i,c=Qq(t,e,n);Yq(r,c),o||s||Xq(i,Jt.default.vErrors)}a(Tse,"reportExtraError");Mt.reportExtraError=Tse;function Ase(t,e){t.assign(Jt.default.errors,e),t.if((0,$e._)`${Jt.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,$e._)`${Jt.default.vErrors}.length`,e),()=>t.assign(Jt.default.vErrors,null)))}a(Ase,"resetErrorsCount");Mt.resetErrorsCount=Ase;function Ose({gen:t,keyword:e,schemaValue:n,data:i,errsCount:r,it:o}){if(r===void 0)throw new Error("ajv implementation error");let s=t.name("err");t.forRange("i",r,Jt.default.errors,c=>{t.const(s,(0,$e._)`${Jt.default.vErrors}[${c}]`),t.if((0,$e._)`${s}.instancePath === undefined`,()=>t.assign((0,$e._)`${s}.instancePath`,(0,$e.strConcat)(Jt.default.instancePath,o.errorPath))),t.assign((0,$e._)`${s}.schemaPath`,(0,$e.str)`${o.errSchemaPath}/${e}`),o.opts.verbose&&(t.assign((0,$e._)`${s}.schema`,n),t.assign((0,$e._)`${s}.data`,i))})}a(Ose,"extendErrors");Mt.extendErrors=Ose;function Yq(t,e){let n=t.const("err",e);t.if((0,$e._)`${Jt.default.vErrors} === null`,()=>t.assign(Jt.default.vErrors,(0,$e._)`[${n}]`),(0,$e._)`${Jt.default.vErrors}.push(${n})`),t.code((0,$e._)`${Jt.default.errors}++`)}a(Yq,"addError");function Xq(t,e){let{gen:n,validateName:i,schemaEnv:r}=t;r.$async?n.throw((0,$e._)`new ${t.ValidationError}(${e})`):(n.assign((0,$e._)`${i}.errors`,e),n.return(!1))}a(Xq,"returnErrors");var zs={keyword:new $e.Name("keyword"),schemaPath:new $e.Name("schemaPath"),params:new $e.Name("params"),propertyName:new $e.Name("propertyName"),message:new $e.Name("message"),schema:new $e.Name("schema"),parentSchema:new $e.Name("parentSchema")};function Qq(t,e,n){let{createErrors:i}=t.it;return i===!1?(0,$e._)`{}`:Nse(t,e,n)}a(Qq,"errorObjectCode");function Nse(t,e,n={}){let{gen:i,it:r}=t,o=[Cse(r,n),Pse(t,n)];return Rse(t,e,o),i.object(...o)}a(Nse,"errorObject");function Cse({errorPath:t},{instancePath:e}){let n=e?(0,$e.str)`${t}${(0,Tw.getErrorPath)(e,Tw.Type.Str)}`:t;return[Jt.default.instancePath,(0,$e.strConcat)(Jt.default.instancePath,n)]}a(Cse,"errorInstancePath");function Pse({keyword:t,it:{errSchemaPath:e}},{schemaPath:n,parentSchema:i}){let r=i?e:(0,$e.str)`${e}/${t}`;return n&&(r=(0,$e.str)`${r}${(0,Tw.getErrorPath)(n,Tw.Type.Str)}`),[zs.schemaPath,r]}a(Pse,"errorSchemaPath");function Rse(t,{params:e,message:n},i){let{keyword:r,data:o,schemaValue:s,it:c}=t,{opts:u,propertyName:l,topSchemaRef:d,schemaPath:f}=c;i.push([zs.keyword,r],[zs.params,typeof e=="function"?e(t):e||(0,$e._)`{}`]),u.messages&&i.push([zs.message,typeof n=="function"?n(t):n]),u.verbose&&i.push([zs.schema,s],[zs.parentSchema,(0,$e._)`${d}${f}`],[Jt.default.data,o]),l&&i.push([zs.propertyName,l])}a(Rse,"extraErrorProps")});var t2=I(Qc=>{"use strict";Object.defineProperty(Qc,"__esModule",{value:!0});Qc.boolOrEmptySchema=Qc.topBoolOrEmptySchema=void 0;var jse=Op(),zse=ce(),Dse=gi(),Lse={message:"boolean schema is false"};function Mse(t){let{gen:e,schema:n,validateName:i}=t;n===!1?e2(t,!1):typeof n=="object"&&n.$async===!0?e.return(Dse.default.data):(e.assign((0,zse._)`${i}.errors`,null),e.return(!0))}a(Mse,"topBoolOrEmptySchema");Qc.topBoolOrEmptySchema=Mse;function Use(t,e){let{gen:n,schema:i}=t;i===!1?(n.var(e,!1),e2(t)):n.var(e,!0)}a(Use,"boolOrEmptySchema");Qc.boolOrEmptySchema=Use;function e2(t,e){let{gen:n,data:i}=t,r={gen:n,keyword:"false schema",data:i,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,jse.reportError)(r,Lse,void 0,e)}a(e2,"falseSchemaError")});var aN=I(eu=>{"use strict";Object.defineProperty(eu,"__esModule",{value:!0});eu.getRules=eu.isJSONType=void 0;var Fse=["string","number","integer","boolean","null","object","array"],qse=new Set(Fse);function Zse(t){return typeof t=="string"&&qse.has(t)}a(Zse,"isJSONType");eu.isJSONType=Zse;function Vse(){let t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}a(Vse,"getRules");eu.getRules=Vse});var cN=I(Io=>{"use strict";Object.defineProperty(Io,"__esModule",{value:!0});Io.shouldUseRule=Io.shouldUseGroup=Io.schemaHasRulesForType=void 0;function Bse({schema:t,self:e},n){let i=e.RULES.types[n];return i&&i!==!0&&n2(t,i)}a(Bse,"schemaHasRulesForType");Io.schemaHasRulesForType=Bse;function n2(t,e){return e.rules.some(n=>r2(t,n))}a(n2,"shouldUseGroup");Io.shouldUseGroup=n2;function r2(t,e){var n;return t[e.keyword]!==void 0||((n=e.definition.implements)===null||n===void 0?void 0:n.some(i=>t[i]!==void 0))}a(r2,"shouldUseRule");Io.shouldUseRule=r2});var Np=I(Ut=>{"use strict";Object.defineProperty(Ut,"__esModule",{value:!0});Ut.reportTypeError=Ut.checkDataTypes=Ut.checkDataType=Ut.coerceAndCheckDataType=Ut.getJSONTypes=Ut.getSchemaTypes=Ut.DataType=void 0;var Kse=aN(),Hse=cN(),Wse=Op(),ae=ce(),i2=we(),tu;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(tu||(Ut.DataType=tu={}));function Gse(t){let e=o2(t.type);if(e.includes("null")){if(t.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&t.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');t.nullable===!0&&e.push("null")}return e}a(Gse,"getSchemaTypes");Ut.getSchemaTypes=Gse;function o2(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(Kse.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}a(o2,"getJSONTypes");Ut.getJSONTypes=o2;function Jse(t,e){let{gen:n,data:i,opts:r}=t,o=Yse(e,r.coerceTypes),s=e.length>0&&!(o.length===0&&e.length===1&&(0,Hse.schemaHasRulesForType)(t,e[0]));if(s){let c=lN(e,i,r.strictNumbers,tu.Wrong);n.if(c,()=>{o.length?Xse(t,e,o):dN(t)})}return s}a(Jse,"coerceAndCheckDataType");Ut.coerceAndCheckDataType=Jse;var s2=new Set(["string","number","integer","boolean","null"]);function Yse(t,e){return e?t.filter(n=>s2.has(n)||e==="array"&&n==="array"):[]}a(Yse,"coerceToTypes");function Xse(t,e,n){let{gen:i,data:r,opts:o}=t,s=i.let("dataType",(0,ae._)`typeof ${r}`),c=i.let("coerced",(0,ae._)`undefined`);o.coerceTypes==="array"&&i.if((0,ae._)`${s} == 'object' && Array.isArray(${r}) && ${r}.length == 1`,()=>i.assign(r,(0,ae._)`${r}[0]`).assign(s,(0,ae._)`typeof ${r}`).if(lN(e,r,o.strictNumbers),()=>i.assign(c,r))),i.if((0,ae._)`${c} !== undefined`);for(let l of n)(s2.has(l)||l==="array"&&o.coerceTypes==="array")&&u(l);i.else(),dN(t),i.endIf(),i.if((0,ae._)`${c} !== undefined`,()=>{i.assign(r,c),Qse(t,c)});function u(l){switch(l){case"string":i.elseIf((0,ae._)`${s} == "number" || ${s} == "boolean"`).assign(c,(0,ae._)`"" + ${r}`).elseIf((0,ae._)`${r} === null`).assign(c,(0,ae._)`""`);return;case"number":i.elseIf((0,ae._)`${s} == "boolean" || ${r} === null
|
|
142
|
+
|| (${s} == "string" && ${r} && ${r} == +${r})`).assign(c,(0,ae._)`+${r}`);return;case"integer":i.elseIf((0,ae._)`${s} === "boolean" || ${r} === null
|
|
143
|
+
|| (${s} === "string" && ${r} && ${r} == +${r} && !(${r} % 1))`).assign(c,(0,ae._)`+${r}`);return;case"boolean":i.elseIf((0,ae._)`${r} === "false" || ${r} === 0 || ${r} === null`).assign(c,!1).elseIf((0,ae._)`${r} === "true" || ${r} === 1`).assign(c,!0);return;case"null":i.elseIf((0,ae._)`${r} === "" || ${r} === 0 || ${r} === false`),i.assign(c,null);return;case"array":i.elseIf((0,ae._)`${s} === "string" || ${s} === "number"
|
|
144
|
+
|| ${s} === "boolean" || ${r} === null`).assign(c,(0,ae._)`[${r}]`)}}a(u,"coerceSpecificType")}a(Xse,"coerceData");function Qse({gen:t,parentData:e,parentDataProperty:n},i){t.if((0,ae._)`${e} !== undefined`,()=>t.assign((0,ae._)`${e}[${n}]`,i))}a(Qse,"assignParentData");function uN(t,e,n,i=tu.Correct){let r=i===tu.Correct?ae.operators.EQ:ae.operators.NEQ,o;switch(t){case"null":return(0,ae._)`${e} ${r} null`;case"array":o=(0,ae._)`Array.isArray(${e})`;break;case"object":o=(0,ae._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":o=s((0,ae._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":o=s();break;default:return(0,ae._)`typeof ${e} ${r} ${t}`}return i===tu.Correct?o:(0,ae.not)(o);function s(c=ae.nil){return(0,ae.and)((0,ae._)`typeof ${e} == "number"`,c,n?(0,ae._)`isFinite(${e})`:ae.nil)}}a(uN,"checkDataType");Ut.checkDataType=uN;function lN(t,e,n,i){if(t.length===1)return uN(t[0],e,n,i);let r,o=(0,i2.toHash)(t);if(o.array&&o.object){let s=(0,ae._)`typeof ${e} != "object"`;r=o.null?s:(0,ae._)`!${e} || ${s}`,delete o.null,delete o.array,delete o.object}else r=ae.nil;o.number&&delete o.integer;for(let s in o)r=(0,ae.and)(r,uN(s,e,n,i));return r}a(lN,"checkDataTypes");Ut.checkDataTypes=lN;var eae={message:a(({schema:t})=>`must be ${t}`,"message"),params:a(({schema:t,schemaValue:e})=>typeof t=="string"?(0,ae._)`{type: ${t}}`:(0,ae._)`{type: ${e}}`,"params")};function dN(t){let e=tae(t);(0,Wse.reportError)(e,eae)}a(dN,"reportTypeError");Ut.reportTypeError=dN;function tae(t){let{gen:e,data:n,schema:i}=t,r=(0,i2.schemaRefOrVal)(t,i,"type");return{gen:e,keyword:"type",data:n,schema:i.type,schemaCode:r,schemaValue:r,parentSchema:i,params:{},it:t}}a(tae,"getTypeErrorContext")});var c2=I(Aw=>{"use strict";Object.defineProperty(Aw,"__esModule",{value:!0});Aw.assignDefaults=void 0;var nu=ce(),nae=we();function rae(t,e){let{properties:n,items:i}=t.schema;if(e==="object"&&n)for(let r in n)a2(t,r,n[r].default);else e==="array"&&Array.isArray(i)&&i.forEach((r,o)=>a2(t,o,r.default))}a(rae,"assignDefaults");Aw.assignDefaults=rae;function a2(t,e,n){let{gen:i,compositeRule:r,data:o,opts:s}=t;if(n===void 0)return;let c=(0,nu._)`${o}${(0,nu.getProperty)(e)}`;if(r){(0,nae.checkStrictMode)(t,`default is ignored for: ${c}`);return}let u=(0,nu._)`${c} === undefined`;s.useDefaults==="empty"&&(u=(0,nu._)`${u} || ${c} === null || ${c} === ""`),i.if(u,(0,nu._)`${c} = ${(0,nu.stringify)(n)}`)}a(a2,"assignDefault")});var Yn=I(Le=>{"use strict";Object.defineProperty(Le,"__esModule",{value:!0});Le.validateUnion=Le.validateArray=Le.usePattern=Le.callValidateCode=Le.schemaProperties=Le.allSchemaProperties=Le.noPropertyInData=Le.propertyInData=Le.isOwnProperty=Le.hasPropFunc=Le.reportMissingProp=Le.checkMissingProp=Le.checkReportMissingProp=void 0;var Ze=ce(),fN=we(),Eo=gi(),iae=we();function oae(t,e){let{gen:n,data:i,it:r}=t;n.if(mN(n,i,e,r.opts.ownProperties),()=>{t.setParams({missingProperty:(0,Ze._)`${e}`},!0),t.error()})}a(oae,"checkReportMissingProp");Le.checkReportMissingProp=oae;function sae({gen:t,data:e,it:{opts:n}},i,r){return(0,Ze.or)(...i.map(o=>(0,Ze.and)(mN(t,e,o,n.ownProperties),(0,Ze._)`${r} = ${o}`)))}a(sae,"checkMissingProp");Le.checkMissingProp=sae;function aae(t,e){t.setParams({missingProperty:e},!0),t.error()}a(aae,"reportMissingProp");Le.reportMissingProp=aae;function u2(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,Ze._)`Object.prototype.hasOwnProperty`})}a(u2,"hasPropFunc");Le.hasPropFunc=u2;function pN(t,e,n){return(0,Ze._)`${u2(t)}.call(${e}, ${n})`}a(pN,"isOwnProperty");Le.isOwnProperty=pN;function cae(t,e,n,i){let r=(0,Ze._)`${e}${(0,Ze.getProperty)(n)} !== undefined`;return i?(0,Ze._)`${r} && ${pN(t,e,n)}`:r}a(cae,"propertyInData");Le.propertyInData=cae;function mN(t,e,n,i){let r=(0,Ze._)`${e}${(0,Ze.getProperty)(n)} === undefined`;return i?(0,Ze.or)(r,(0,Ze.not)(pN(t,e,n))):r}a(mN,"noPropertyInData");Le.noPropertyInData=mN;function l2(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}a(l2,"allSchemaProperties");Le.allSchemaProperties=l2;function uae(t,e){return l2(e).filter(n=>!(0,fN.alwaysValidSchema)(t,e[n]))}a(uae,"schemaProperties");Le.schemaProperties=uae;function lae({schemaCode:t,data:e,it:{gen:n,topSchemaRef:i,schemaPath:r,errorPath:o},it:s},c,u,l){let d=l?(0,Ze._)`${t}, ${e}, ${i}${r}`:e,f=[[Eo.default.instancePath,(0,Ze.strConcat)(Eo.default.instancePath,o)],[Eo.default.parentData,s.parentData],[Eo.default.parentDataProperty,s.parentDataProperty],[Eo.default.rootData,Eo.default.rootData]];s.opts.dynamicRef&&f.push([Eo.default.dynamicAnchors,Eo.default.dynamicAnchors]);let p=(0,Ze._)`${d}, ${n.object(...f)}`;return u!==Ze.nil?(0,Ze._)`${c}.call(${u}, ${p})`:(0,Ze._)`${c}(${p})`}a(lae,"callValidateCode");Le.callValidateCode=lae;var dae=(0,Ze._)`new RegExp`;function fae({gen:t,it:{opts:e}},n){let i=e.unicodeRegExp?"u":"",{regExp:r}=e.code,o=r(n,i);return t.scopeValue("pattern",{key:o.toString(),ref:o,code:(0,Ze._)`${r.code==="new RegExp"?dae:(0,iae.useFunc)(t,r)}(${n}, ${i})`})}a(fae,"usePattern");Le.usePattern=fae;function pae(t){let{gen:e,data:n,keyword:i,it:r}=t,o=e.name("valid");if(r.allErrors){let c=e.let("valid",!0);return s(()=>e.assign(c,!1)),c}return e.var(o,!0),s(()=>e.break()),o;function s(c){let u=e.const("len",(0,Ze._)`${n}.length`);e.forRange("i",0,u,l=>{t.subschema({keyword:i,dataProp:l,dataPropType:fN.Type.Num},o),e.if((0,Ze.not)(o),c)})}a(s,"validateItems")}a(pae,"validateArray");Le.validateArray=pae;function mae(t){let{gen:e,schema:n,keyword:i,it:r}=t;if(!Array.isArray(n))throw new Error("ajv implementation error");if(n.some(u=>(0,fN.alwaysValidSchema)(r,u))&&!r.opts.unevaluated)return;let s=e.let("valid",!1),c=e.name("_valid");e.block(()=>n.forEach((u,l)=>{let d=t.subschema({keyword:i,schemaProp:l,compositeRule:!0},c);e.assign(s,(0,Ze._)`${s} || ${c}`),t.mergeValidEvaluated(d,c)||e.if((0,Ze.not)(s))})),t.result(s,()=>t.reset(),()=>t.error(!0))}a(mae,"validateUnion");Le.validateUnion=mae});var p2=I(qr=>{"use strict";Object.defineProperty(qr,"__esModule",{value:!0});qr.validateKeywordUsage=qr.validSchemaType=qr.funcKeywordCode=qr.macroKeywordCode=void 0;var Yt=ce(),Ds=gi(),hae=Yn(),gae=Op();function yae(t,e){let{gen:n,keyword:i,schema:r,parentSchema:o,it:s}=t,c=e.macro.call(s.self,r,o,s),u=f2(n,i,c);s.opts.validateSchema!==!1&&s.self.validateSchema(c,!0);let l=n.name("valid");t.subschema({schema:c,schemaPath:Yt.nil,errSchemaPath:`${s.errSchemaPath}/${i}`,topSchemaRef:u,compositeRule:!0},l),t.pass(l,()=>t.error(!0))}a(yae,"macroKeywordCode");qr.macroKeywordCode=yae;function vae(t,e){var n;let{gen:i,keyword:r,schema:o,parentSchema:s,$data:c,it:u}=t;wae(u,e);let l=!c&&e.compile?e.compile.call(u.self,o,s,u):e.validate,d=f2(i,r,l),f=i.let("valid");t.block$data(f,p),t.ok((n=e.valid)!==null&&n!==void 0?n:f);function p(){if(e.errors===!1)y(),e.modifying&&d2(t),v(()=>t.error());else{let w=e.async?m():g();e.modifying&&d2(t),v(()=>bae(t,w))}}a(p,"validateKeyword");function m(){let w=i.let("ruleErrs",null);return i.try(()=>y((0,Yt._)`await `),b=>i.assign(f,!1).if((0,Yt._)`${b} instanceof ${u.ValidationError}`,()=>i.assign(w,(0,Yt._)`${b}.errors`),()=>i.throw(b))),w}a(m,"validateAsync");function g(){let w=(0,Yt._)`${d}.errors`;return i.assign(w,null),y(Yt.nil),w}a(g,"validateSync");function y(w=e.async?(0,Yt._)`await `:Yt.nil){let b=u.opts.passContext?Ds.default.this:Ds.default.self,$=!("compile"in e&&!c||e.schema===!1);i.assign(f,(0,Yt._)`${w}${(0,hae.callValidateCode)(t,d,b,$)}`,e.modifying)}a(y,"assignValid");function v(w){var b;i.if((0,Yt.not)((b=e.valid)!==null&&b!==void 0?b:f),w)}a(v,"reportErrs")}a(vae,"funcKeywordCode");qr.funcKeywordCode=vae;function d2(t){let{gen:e,data:n,it:i}=t;e.if(i.parentData,()=>e.assign(n,(0,Yt._)`${i.parentData}[${i.parentDataProperty}]`))}a(d2,"modifyData");function bae(t,e){let{gen:n}=t;n.if((0,Yt._)`Array.isArray(${e})`,()=>{n.assign(Ds.default.vErrors,(0,Yt._)`${Ds.default.vErrors} === null ? ${e} : ${Ds.default.vErrors}.concat(${e})`).assign(Ds.default.errors,(0,Yt._)`${Ds.default.vErrors}.length`),(0,gae.extendErrors)(t)},()=>t.error())}a(bae,"addErrs");function wae({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}a(wae,"checkAsyncKeyword");function f2(t,e,n){if(n===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof n=="function"?{ref:n}:{ref:n,code:(0,Yt.stringify)(n)})}a(f2,"useKeyword");function $ae(t,e,n=!1){return!e.length||e.some(i=>i==="array"?Array.isArray(t):i==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==i||n&&typeof t>"u")}a($ae,"validSchemaType");qr.validSchemaType=$ae;function _ae({schema:t,opts:e,self:n,errSchemaPath:i},r,o){if(Array.isArray(r.keyword)?!r.keyword.includes(o):r.keyword!==o)throw new Error("ajv implementation error");let s=r.dependencies;if(s?.some(c=>!Object.prototype.hasOwnProperty.call(t,c)))throw new Error(`parent schema must have dependencies of ${o}: ${s.join(",")}`);if(r.validateSchema&&!r.validateSchema(t[o])){let u=`keyword "${o}" value is invalid at path "${i}": `+n.errorsText(r.validateSchema.errors);if(e.validateSchema==="log")n.logger.error(u);else throw new Error(u)}}a(_ae,"validateKeywordUsage");qr.validateKeywordUsage=_ae});var h2=I(To=>{"use strict";Object.defineProperty(To,"__esModule",{value:!0});To.extendSubschemaMode=To.extendSubschemaData=To.getSubschema=void 0;var Zr=ce(),m2=we();function kae(t,{keyword:e,schemaProp:n,schema:i,schemaPath:r,errSchemaPath:o,topSchemaRef:s}){if(e!==void 0&&i!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let c=t.schema[e];return n===void 0?{schema:c,schemaPath:(0,Zr._)`${t.schemaPath}${(0,Zr.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:c[n],schemaPath:(0,Zr._)`${t.schemaPath}${(0,Zr.getProperty)(e)}${(0,Zr.getProperty)(n)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,m2.escapeFragment)(n)}`}}if(i!==void 0){if(r===void 0||o===void 0||s===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:i,schemaPath:r,topSchemaRef:s,errSchemaPath:o}}throw new Error('either "keyword" or "schema" must be passed')}a(kae,"getSubschema");To.getSubschema=kae;function xae(t,e,{dataProp:n,dataPropType:i,data:r,dataTypes:o,propertyName:s}){if(r!==void 0&&n!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:c}=e;if(n!==void 0){let{errorPath:l,dataPathArr:d,opts:f}=e,p=c.let("data",(0,Zr._)`${e.data}${(0,Zr.getProperty)(n)}`,!0);u(p),t.errorPath=(0,Zr.str)`${l}${(0,m2.getErrorPath)(n,i,f.jsPropertySyntax)}`,t.parentDataProperty=(0,Zr._)`${n}`,t.dataPathArr=[...d,t.parentDataProperty]}if(r!==void 0){let l=r instanceof Zr.Name?r:c.let("data",r,!0);u(l),s!==void 0&&(t.propertyName=s)}o&&(t.dataTypes=o);function u(l){t.data=l,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,l]}a(u,"dataContextProps")}a(xae,"extendSubschemaData");To.extendSubschemaData=xae;function Sae(t,{jtdDiscriminator:e,jtdMetadata:n,compositeRule:i,createErrors:r,allErrors:o}){i!==void 0&&(t.compositeRule=i),r!==void 0&&(t.createErrors=r),o!==void 0&&(t.allErrors=o),t.jtdDiscriminator=e,t.jtdMetadata=n}a(Sae,"extendSubschemaMode");To.extendSubschemaMode=Sae});var hN=I((VWe,g2)=>{"use strict";g2.exports=a(function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var i,r,o;if(Array.isArray(e)){if(i=e.length,i!=n.length)return!1;for(r=i;r--!==0;)if(!t(e[r],n[r]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(o=Object.keys(e),i=o.length,i!==Object.keys(n).length)return!1;for(r=i;r--!==0;)if(!Object.prototype.hasOwnProperty.call(n,o[r]))return!1;for(r=i;r--!==0;){var s=o[r];if(!t(e[s],n[s]))return!1}return!0}return e!==e&&n!==n},"equal")});var v2=I((KWe,y2)=>{"use strict";var Ao=y2.exports=function(t,e,n){typeof e=="function"&&(n=e,e={}),n=e.cb||n;var i=typeof n=="function"?n:n.pre||function(){},r=n.post||function(){};Ow(e,i,r,t,"",t)};Ao.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Ao.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Ao.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Ao.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 Ow(t,e,n,i,r,o,s,c,u,l){if(i&&typeof i=="object"&&!Array.isArray(i)){e(i,r,o,s,c,u,l);for(var d in i){var f=i[d];if(Array.isArray(f)){if(d in Ao.arrayKeywords)for(var p=0;p<f.length;p++)Ow(t,e,n,f[p],r+"/"+d+"/"+p,o,r,d,i,p)}else if(d in Ao.propsKeywords){if(f&&typeof f=="object")for(var m in f)Ow(t,e,n,f[m],r+"/"+d+"/"+Iae(m),o,r,d,i,m)}else(d in Ao.keywords||t.allKeys&&!(d in Ao.skipKeywords))&&Ow(t,e,n,f,r+"/"+d,o,r,d,i)}n(i,r,o,s,c,u,l)}}a(Ow,"_traverse");function Iae(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}a(Iae,"escapeJsonPtr")});var Cp=I($n=>{"use strict";Object.defineProperty($n,"__esModule",{value:!0});$n.getSchemaRefs=$n.resolveUrl=$n.normalizeId=$n._getFullPath=$n.getFullPath=$n.inlineRef=void 0;var Eae=we(),Tae=hN(),Aae=v2(),Oae=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function Nae(t,e=!0){return typeof t=="boolean"?!0:e===!0?!gN(t):e?b2(t)<=e:!1}a(Nae,"inlineRef");$n.inlineRef=Nae;var Cae=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function gN(t){for(let e in t){if(Cae.has(e))return!0;let n=t[e];if(Array.isArray(n)&&n.some(gN)||typeof n=="object"&&gN(n))return!0}return!1}a(gN,"hasRef");function b2(t){let e=0;for(let n in t){if(n==="$ref")return 1/0;if(e++,!Oae.has(n)&&(typeof t[n]=="object"&&(0,Eae.eachItem)(t[n],i=>e+=b2(i)),e===1/0))return 1/0}return e}a(b2,"countKeys");function w2(t,e="",n){n!==!1&&(e=ru(e));let i=t.parse(e);return $2(t,i)}a(w2,"getFullPath");$n.getFullPath=w2;function $2(t,e){return t.serialize(e).split("#")[0]+"#"}a($2,"_getFullPath");$n._getFullPath=$2;var Pae=/#\/?$/;function ru(t){return t?t.replace(Pae,""):""}a(ru,"normalizeId");$n.normalizeId=ru;function Rae(t,e,n){return n=ru(n),t.resolve(e,n)}a(Rae,"resolveUrl");$n.resolveUrl=Rae;var jae=/^[a-z_][-a-z0-9._]*$/i;function zae(t,e){if(typeof t=="boolean")return{};let{schemaId:n,uriResolver:i}=this.opts,r=ru(t[n]||e),o={"":r},s=w2(i,r,!1),c={},u=new Set;return Aae(t,{allKeys:!0},(f,p,m,g)=>{if(g===void 0)return;let y=s+p,v=o[g];typeof f[n]=="string"&&(v=w.call(this,f[n])),b.call(this,f.$anchor),b.call(this,f.$dynamicAnchor),o[p]=v;function w($){let x=this.opts.uriResolver.resolve;if($=ru(v?x(v,$):$),u.has($))throw d($);u.add($);let T=this.refs[$];return typeof T=="string"&&(T=this.refs[T]),typeof T=="object"?l(f,T.schema,$):$!==ru(y)&&($[0]==="#"?(l(f,c[$],$),c[$]=f):this.refs[$]=y),$}a(w,"addRef");function b($){if(typeof $=="string"){if(!jae.test($))throw new Error(`invalid anchor "${$}"`);w.call(this,`#${$}`)}}a(b,"addAnchor")}),c;function l(f,p,m){if(p!==void 0&&!Tae(f,p))throw d(m)}a(l,"checkAmbiguosRef");function d(f){return new Error(`reference "${f}" resolves to more than one schema`)}a(d,"ambiguos")}a(zae,"getSchemaRefs");$n.getSchemaRefs=zae});var jp=I(Oo=>{"use strict";Object.defineProperty(Oo,"__esModule",{value:!0});Oo.getData=Oo.KeywordCxt=Oo.validateFunctionCode=void 0;var I2=t2(),_2=Np(),vN=cN(),Nw=Np(),Dae=c2(),Rp=p2(),yN=h2(),H=ce(),re=gi(),Lae=Cp(),yi=we(),Pp=Op();function Mae(t){if(A2(t)&&(O2(t),T2(t))){qae(t);return}E2(t,()=>(0,I2.topBoolOrEmptySchema)(t))}a(Mae,"validateFunctionCode");Oo.validateFunctionCode=Mae;function E2({gen:t,validateName:e,schema:n,schemaEnv:i,opts:r},o){r.code.es5?t.func(e,(0,H._)`${re.default.data}, ${re.default.valCxt}`,i.$async,()=>{t.code((0,H._)`"use strict"; ${k2(n,r)}`),Fae(t,r),t.code(o)}):t.func(e,(0,H._)`${re.default.data}, ${Uae(r)}`,i.$async,()=>t.code(k2(n,r)).code(o))}a(E2,"validateFunction");function Uae(t){return(0,H._)`{${re.default.instancePath}="", ${re.default.parentData}, ${re.default.parentDataProperty}, ${re.default.rootData}=${re.default.data}${t.dynamicRef?(0,H._)`, ${re.default.dynamicAnchors}={}`:H.nil}}={}`}a(Uae,"destructureValCxt");function Fae(t,e){t.if(re.default.valCxt,()=>{t.var(re.default.instancePath,(0,H._)`${re.default.valCxt}.${re.default.instancePath}`),t.var(re.default.parentData,(0,H._)`${re.default.valCxt}.${re.default.parentData}`),t.var(re.default.parentDataProperty,(0,H._)`${re.default.valCxt}.${re.default.parentDataProperty}`),t.var(re.default.rootData,(0,H._)`${re.default.valCxt}.${re.default.rootData}`),e.dynamicRef&&t.var(re.default.dynamicAnchors,(0,H._)`${re.default.valCxt}.${re.default.dynamicAnchors}`)},()=>{t.var(re.default.instancePath,(0,H._)`""`),t.var(re.default.parentData,(0,H._)`undefined`),t.var(re.default.parentDataProperty,(0,H._)`undefined`),t.var(re.default.rootData,re.default.data),e.dynamicRef&&t.var(re.default.dynamicAnchors,(0,H._)`{}`)})}a(Fae,"destructureValCxtES5");function qae(t){let{schema:e,opts:n,gen:i}=t;E2(t,()=>{n.$comment&&e.$comment&&C2(t),Hae(t),i.let(re.default.vErrors,null),i.let(re.default.errors,0),n.unevaluated&&Zae(t),N2(t),Jae(t)})}a(qae,"topSchemaObjCode");function Zae(t){let{gen:e,validateName:n}=t;t.evaluated=e.const("evaluated",(0,H._)`${n}.evaluated`),e.if((0,H._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,H._)`${t.evaluated}.props`,(0,H._)`undefined`)),e.if((0,H._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,H._)`${t.evaluated}.items`,(0,H._)`undefined`))}a(Zae,"resetEvaluated");function k2(t,e){let n=typeof t=="object"&&t[e.schemaId];return n&&(e.code.source||e.code.process)?(0,H._)`/*# sourceURL=${n} */`:H.nil}a(k2,"funcSourceUrl");function Vae(t,e){if(A2(t)&&(O2(t),T2(t))){Bae(t,e);return}(0,I2.boolOrEmptySchema)(t,e)}a(Vae,"subschemaCode");function T2({schema:t,self:e}){if(typeof t=="boolean")return!t;for(let n in t)if(e.RULES.all[n])return!0;return!1}a(T2,"schemaCxtHasRules");function A2(t){return typeof t.schema!="boolean"}a(A2,"isSchemaObj");function Bae(t,e){let{schema:n,gen:i,opts:r}=t;r.$comment&&n.$comment&&C2(t),Wae(t),Gae(t);let o=i.const("_errs",re.default.errors);N2(t,o),i.var(e,(0,H._)`${o} === ${re.default.errors}`)}a(Bae,"subSchemaObjCode");function O2(t){(0,yi.checkUnknownRules)(t),Kae(t)}a(O2,"checkKeywords");function N2(t,e){if(t.opts.jtd)return x2(t,[],!1,e);let n=(0,_2.getSchemaTypes)(t.schema),i=(0,_2.coerceAndCheckDataType)(t,n);x2(t,n,!i,e)}a(N2,"typeAndKeywords");function Kae(t){let{schema:e,errSchemaPath:n,opts:i,self:r}=t;e.$ref&&i.ignoreKeywordsWithRef&&(0,yi.schemaHasRulesButRef)(e,r.RULES)&&r.logger.warn(`$ref: keywords ignored in schema at path "${n}"`)}a(Kae,"checkRefsAndKeywords");function Hae(t){let{schema:e,opts:n}=t;e.default!==void 0&&n.useDefaults&&n.strictSchema&&(0,yi.checkStrictMode)(t,"default is ignored in the schema root")}a(Hae,"checkNoDefault");function Wae(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,Lae.resolveUrl)(t.opts.uriResolver,t.baseId,e))}a(Wae,"updateContext");function Gae(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}a(Gae,"checkAsyncSchema");function C2({gen:t,schemaEnv:e,schema:n,errSchemaPath:i,opts:r}){let o=n.$comment;if(r.$comment===!0)t.code((0,H._)`${re.default.self}.logger.log(${o})`);else if(typeof r.$comment=="function"){let s=(0,H.str)`${i}/$comment`,c=t.scopeValue("root",{ref:e.root});t.code((0,H._)`${re.default.self}.opts.$comment(${o}, ${s}, ${c}.schema)`)}}a(C2,"commentKeyword");function Jae(t){let{gen:e,schemaEnv:n,validateName:i,ValidationError:r,opts:o}=t;n.$async?e.if((0,H._)`${re.default.errors} === 0`,()=>e.return(re.default.data),()=>e.throw((0,H._)`new ${r}(${re.default.vErrors})`)):(e.assign((0,H._)`${i}.errors`,re.default.vErrors),o.unevaluated&&Yae(t),e.return((0,H._)`${re.default.errors} === 0`))}a(Jae,"returnResults");function Yae({gen:t,evaluated:e,props:n,items:i}){n instanceof H.Name&&t.assign((0,H._)`${e}.props`,n),i instanceof H.Name&&t.assign((0,H._)`${e}.items`,i)}a(Yae,"assignEvaluated");function x2(t,e,n,i){let{gen:r,schema:o,data:s,allErrors:c,opts:u,self:l}=t,{RULES:d}=l;if(o.$ref&&(u.ignoreKeywordsWithRef||!(0,yi.schemaHasRulesButRef)(o,d))){r.block(()=>R2(t,"$ref",d.all.$ref.definition));return}u.jtd||Xae(t,e),r.block(()=>{for(let p of d.rules)f(p);f(d.post)});function f(p){(0,vN.shouldUseGroup)(o,p)&&(p.type?(r.if((0,Nw.checkDataType)(p.type,s,u.strictNumbers)),S2(t,p),e.length===1&&e[0]===p.type&&n&&(r.else(),(0,Nw.reportTypeError)(t)),r.endIf()):S2(t,p),c||r.if((0,H._)`${re.default.errors} === ${i||0}`))}a(f,"groupKeywords")}a(x2,"schemaKeywords");function S2(t,e){let{gen:n,schema:i,opts:{useDefaults:r}}=t;r&&(0,Dae.assignDefaults)(t,e.type),n.block(()=>{for(let o of e.rules)(0,vN.shouldUseRule)(i,o)&&R2(t,o.keyword,o.definition,e.type)})}a(S2,"iterateKeywords");function Xae(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(Qae(t,e),t.opts.allowUnionTypes||ece(t,e),tce(t,t.dataTypes))}a(Xae,"checkStrictTypes");function Qae(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(n=>{P2(t.dataTypes,n)||bN(t,`type "${n}" not allowed by context "${t.dataTypes.join(",")}"`)}),rce(t,e)}}a(Qae,"checkContextTypes");function ece(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&bN(t,"use allowUnionTypes to allow union type keyword")}a(ece,"checkMultipleTypes");function tce(t,e){let n=t.self.RULES.all;for(let i in n){let r=n[i];if(typeof r=="object"&&(0,vN.shouldUseRule)(t.schema,r)){let{type:o}=r.definition;o.length&&!o.some(s=>nce(e,s))&&bN(t,`missing type "${o.join(",")}" for keyword "${i}"`)}}}a(tce,"checkKeywordTypes");function nce(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}a(nce,"hasApplicableType");function P2(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}a(P2,"includesType");function rce(t,e){let n=[];for(let i of t.dataTypes)P2(e,i)?n.push(i):e.includes("integer")&&i==="number"&&n.push("integer");t.dataTypes=n}a(rce,"narrowSchemaTypes");function bN(t,e){let n=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${n}" (strictTypes)`,(0,yi.checkStrictMode)(t,e,t.opts.strictTypes)}a(bN,"strictTypesError");var Cw=class{static{a(this,"KeywordCxt")}constructor(e,n,i){if((0,Rp.validateKeywordUsage)(e,n,i),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=i,this.data=e.data,this.schema=e.schema[i],this.$data=n.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,yi.schemaRefOrVal)(e,this.schema,i,this.$data),this.schemaType=n.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=n,this.$data)this.schemaCode=e.gen.const("vSchema",j2(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,Rp.validSchemaType)(this.schema,n.schemaType,n.allowUndefined))throw new Error(`${i} value must be ${JSON.stringify(n.schemaType)}`);("code"in n?n.trackErrors:n.errors!==!1)&&(this.errsCount=e.gen.const("_errs",re.default.errors))}result(e,n,i){this.failResult((0,H.not)(e),n,i)}failResult(e,n,i){this.gen.if(e),i?i():this.error(),n?(this.gen.else(),n(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,n){this.failResult((0,H.not)(e),void 0,n)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:n}=this;this.fail((0,H._)`${n} !== undefined && (${(0,H.or)(this.invalid$data(),e)})`)}error(e,n,i){if(n){this.setParams(n),this._error(e,i),this.setParams({});return}this._error(e,i)}_error(e,n){(e?Pp.reportExtraError:Pp.reportError)(this,this.def.error,n)}$dataError(){(0,Pp.reportError)(this,this.def.$dataError||Pp.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Pp.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,n){n?Object.assign(this.params,e):this.params=e}block$data(e,n,i=H.nil){this.gen.block(()=>{this.check$data(e,i),n()})}check$data(e=H.nil,n=H.nil){if(!this.$data)return;let{gen:i,schemaCode:r,schemaType:o,def:s}=this;i.if((0,H.or)((0,H._)`${r} === undefined`,n)),e!==H.nil&&i.assign(e,!0),(o.length||s.validateSchema)&&(i.elseIf(this.invalid$data()),this.$dataError(),e!==H.nil&&i.assign(e,!1)),i.else()}invalid$data(){let{gen:e,schemaCode:n,schemaType:i,def:r,it:o}=this;return(0,H.or)(s(),c());function s(){if(i.length){if(!(n instanceof H.Name))throw new Error("ajv implementation error");let u=Array.isArray(i)?i:[i];return(0,H._)`${(0,Nw.checkDataTypes)(u,n,o.opts.strictNumbers,Nw.DataType.Wrong)}`}return H.nil}function c(){if(r.validateSchema){let u=e.scopeValue("validate$data",{ref:r.validateSchema});return(0,H._)`!${u}(${n})`}return H.nil}}subschema(e,n){let i=(0,yN.getSubschema)(this.it,e);(0,yN.extendSubschemaData)(i,this.it,e),(0,yN.extendSubschemaMode)(i,e);let r={...this.it,...i,items:void 0,props:void 0};return Vae(r,n),r}mergeEvaluated(e,n){let{it:i,gen:r}=this;i.opts.unevaluated&&(i.props!==!0&&e.props!==void 0&&(i.props=yi.mergeEvaluated.props(r,e.props,i.props,n)),i.items!==!0&&e.items!==void 0&&(i.items=yi.mergeEvaluated.items(r,e.items,i.items,n)))}mergeValidEvaluated(e,n){let{it:i,gen:r}=this;if(i.opts.unevaluated&&(i.props!==!0||i.items!==!0))return r.if(n,()=>this.mergeEvaluated(e,H.Name)),!0}};Oo.KeywordCxt=Cw;function R2(t,e,n,i){let r=new Cw(t,n,e);"code"in n?n.code(r,i):r.$data&&n.validate?(0,Rp.funcKeywordCode)(r,n):"macro"in n?(0,Rp.macroKeywordCode)(r,n):(n.compile||n.validate)&&(0,Rp.funcKeywordCode)(r,n)}a(R2,"keywordCode");var ice=/^\/(?:[^~]|~0|~1)*$/,oce=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function j2(t,{dataLevel:e,dataNames:n,dataPathArr:i}){let r,o;if(t==="")return re.default.rootData;if(t[0]==="/"){if(!ice.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);r=t,o=re.default.rootData}else{let l=oce.exec(t);if(!l)throw new Error(`Invalid JSON-pointer: ${t}`);let d=+l[1];if(r=l[2],r==="#"){if(d>=e)throw new Error(u("property/index",d));return i[e-d]}if(d>e)throw new Error(u("data",d));if(o=n[e-d],!r)return o}let s=o,c=r.split("/");for(let l of c)l&&(o=(0,H._)`${o}${(0,H.getProperty)((0,yi.unescapeJsonPointer)(l))}`,s=(0,H._)`${s} && ${o}`);return s;function u(l,d){return`Cannot access ${l} ${d} levels up, current level is ${e}`}}a(j2,"getData");Oo.getData=j2});var Pw=I($N=>{"use strict";Object.defineProperty($N,"__esModule",{value:!0});var wN=class extends Error{static{a(this,"ValidationError")}constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};$N.default=wN});var zp=I(xN=>{"use strict";Object.defineProperty(xN,"__esModule",{value:!0});var _N=Cp(),kN=class extends Error{static{a(this,"MissingRefError")}constructor(e,n,i,r){super(r||`can't resolve reference ${i} from id ${n}`),this.missingRef=(0,_N.resolveUrl)(e,n,i),this.missingSchema=(0,_N.normalizeId)((0,_N.getFullPath)(e,this.missingRef))}};xN.default=kN});var jw=I(Xn=>{"use strict";Object.defineProperty(Xn,"__esModule",{value:!0});Xn.resolveSchema=Xn.getCompilingSchema=Xn.resolveRef=Xn.compileSchema=Xn.SchemaEnv=void 0;var wr=ce(),sce=Pw(),Ls=gi(),$r=Cp(),z2=we(),ace=jp(),iu=class{static{a(this,"SchemaEnv")}constructor(e){var n;this.refs={},this.dynamicAnchors={};let i;typeof e.schema=="object"&&(i=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(n=e.baseId)!==null&&n!==void 0?n:(0,$r.normalizeId)(i?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=i?.$async,this.refs={}}};Xn.SchemaEnv=iu;function IN(t){let e=D2.call(this,t);if(e)return e;let n=(0,$r.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:i,lines:r}=this.opts.code,{ownProperties:o}=this.opts,s=new wr.CodeGen(this.scope,{es5:i,lines:r,ownProperties:o}),c;t.$async&&(c=s.scopeValue("Error",{ref:sce.default,code:(0,wr._)`require("ajv/dist/runtime/validation_error").default`}));let u=s.scopeName("validate");t.validateName=u;let l={gen:s,allErrors:this.opts.allErrors,data:Ls.default.data,parentData:Ls.default.parentData,parentDataProperty:Ls.default.parentDataProperty,dataNames:[Ls.default.data],dataPathArr:[wr.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:s.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,wr.stringify)(t.schema)}:{ref:t.schema}),validateName:u,ValidationError:c,schema:t.schema,schemaEnv:t,rootId:n,baseId:t.baseId||n,schemaPath:wr.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,wr._)`""`,opts:this.opts,self:this},d;try{this._compilations.add(t),(0,ace.validateFunctionCode)(l),s.optimize(this.opts.code.optimize);let f=s.toString();d=`${s.scopeRefs(Ls.default.scope)}return ${f}`,this.opts.code.process&&(d=this.opts.code.process(d,t));let m=new Function(`${Ls.default.self}`,`${Ls.default.scope}`,d)(this,this.scope.get());if(this.scope.value(u,{ref:m}),m.errors=null,m.schema=t.schema,m.schemaEnv=t,t.$async&&(m.$async=!0),this.opts.code.source===!0&&(m.source={validateName:u,validateCode:f,scopeValues:s._values}),this.opts.unevaluated){let{props:g,items:y}=l;m.evaluated={props:g instanceof wr.Name?void 0:g,items:y instanceof wr.Name?void 0:y,dynamicProps:g instanceof wr.Name,dynamicItems:y instanceof wr.Name},m.source&&(m.source.evaluated=(0,wr.stringify)(m.evaluated))}return t.validate=m,t}catch(f){throw delete t.validate,delete t.validateName,d&&this.logger.error("Error compiling schema, function code:",d),f}finally{this._compilations.delete(t)}}a(IN,"compileSchema");Xn.compileSchema=IN;function cce(t,e,n){var i;n=(0,$r.resolveUrl)(this.opts.uriResolver,e,n);let r=t.refs[n];if(r)return r;let o=dce.call(this,t,n);if(o===void 0){let s=(i=t.localRefs)===null||i===void 0?void 0:i[n],{schemaId:c}=this.opts;s&&(o=new iu({schema:s,schemaId:c,root:t,baseId:e}))}if(o!==void 0)return t.refs[n]=uce.call(this,o)}a(cce,"resolveRef");Xn.resolveRef=cce;function uce(t){return(0,$r.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:IN.call(this,t)}a(uce,"inlineOrCompile");function D2(t){for(let e of this._compilations)if(lce(e,t))return e}a(D2,"getCompilingSchema");Xn.getCompilingSchema=D2;function lce(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}a(lce,"sameSchemaEnv");function dce(t,e){let n;for(;typeof(n=this.refs[e])=="string";)e=n;return n||this.schemas[e]||Rw.call(this,t,e)}a(dce,"resolve");function Rw(t,e){let n=this.opts.uriResolver.parse(e),i=(0,$r._getFullPath)(this.opts.uriResolver,n),r=(0,$r.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&i===r)return SN.call(this,n,t);let o=(0,$r.normalizeId)(i),s=this.refs[o]||this.schemas[o];if(typeof s=="string"){let c=Rw.call(this,t,s);return typeof c?.schema!="object"?void 0:SN.call(this,n,c)}if(typeof s?.schema=="object"){if(s.validate||IN.call(this,s),o===(0,$r.normalizeId)(e)){let{schema:c}=s,{schemaId:u}=this.opts,l=c[u];return l&&(r=(0,$r.resolveUrl)(this.opts.uriResolver,r,l)),new iu({schema:c,schemaId:u,root:t,baseId:r})}return SN.call(this,n,s)}}a(Rw,"resolveSchema");Xn.resolveSchema=Rw;var fce=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function SN(t,{baseId:e,schema:n,root:i}){var r;if(((r=t.fragment)===null||r===void 0?void 0:r[0])!=="/")return;for(let c of t.fragment.slice(1).split("/")){if(typeof n=="boolean")return;let u=n[(0,z2.unescapeFragment)(c)];if(u===void 0)return;n=u;let l=typeof n=="object"&&n[this.opts.schemaId];!fce.has(c)&&l&&(e=(0,$r.resolveUrl)(this.opts.uriResolver,e,l))}let o;if(typeof n!="boolean"&&n.$ref&&!(0,z2.schemaHasRulesButRef)(n,this.RULES)){let c=(0,$r.resolveUrl)(this.opts.uriResolver,e,n.$ref);o=Rw.call(this,i,c)}let{schemaId:s}=this.opts;if(o=o||new iu({schema:n,schemaId:s,root:i,baseId:e}),o.schema!==o.root.schema)return o}a(SN,"getJsonPointer")});var L2=I((iGe,pce)=>{pce.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 CN=I((oGe,B2)=>{"use strict";var mce=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),TN=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),hce=RegExp.prototype.test.bind(/^\d*$/u),Ms=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),AN=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),U2=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/]$/u),ON=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/?]$/u),gce=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:]$/u),_n=new Array(256);{let t="0123456789ABCDEF";for(let e=0;e<256;e++)_n[e]="%"+t[e>>4]+t[e&15]}function Ft(t){return t<2048?_n[192|t>>6]+_n[128|t&63]:t<65536?_n[224|t>>12]+_n[128|t>>6&63]+_n[128|t&63]:_n[240|t>>18]+_n[128|t>>12&63]+_n[128|t>>6&63]+_n[128|t&63]}a(Ft,"percentEncodeNonAscii");function yce(t){let e="",n=0,i=0;for(i=0;i<t.length;i++)if(n=t[i].charCodeAt(0),n!==48){if(!(n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102))return"";e+=t[i];break}for(i+=1;i<t.length;i++){if(n=t[i].charCodeAt(0),!(n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102))return"";e+=t[i]}return e}a(yce,"stringArrayToHexStripped");var vce=RegExp.prototype.test.bind(/^[\dA-Fa-f]{1,4}$/),bce=RegExp.prototype.test.bind(/^[vV][\dA-Fa-f]+\.[A-Za-z\d\-._~!$&'()*+,;=:]+$/),wce=RegExp.prototype.test.bind(/^[A-Za-z\d\-._~]$/),$ce=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function _ce(t){if(t.length===0)return!1;for(let e=0;e<t.length;e++)if(!wce(t[e])){if(t[e]==="%"&&e+2<t.length&&Ms(t.slice(e+1,e+3))){e+=2;continue}return!1}return!0}a(_ce,"isZoneIdentifier");function M2(t){let e=-1,n=0,i=-1,r=0;for(let c=0;c<t.length;c++)t[c]==="0"?(i===-1&&(i=c),r++,r>n&&(n=r,e=i)):(i=-1,r=0);if(n<2)return t.join(":");let o=t.slice(0,e).join(":"),s=t.slice(e+n).join(":");return o+"::"+s}a(M2,"compressIPv6ZeroRun");function kce(t){let e=t.indexOf("::");if(e!==-1&&t.indexOf("::",e+1)!==-1)return;let n=e===-1?t.split(":"):t.slice(0,e).split(":"),i=e===-1?[]:t.slice(e+2).split(":");e!==-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 c=0;c<r.length;c++){let u=r[c];if(u==="")return;if(u.indexOf(".")!==-1){if(c!==r.length-1||e!==-1&&i.length===0||!TN(u))return;o+=2;continue}if(!vce(u))return;r[c]=parseInt(u,16).toString(16),o++}if(e===-1)return o!==8?void 0:M2(r);if(o>=8)return;let s=r.slice(0,n.length);for(let c=o;c<8;c++)s.push("0");for(let c=n.length;c<r.length;c++)s.push(r[c]);return M2(s)}a(kce,"normalizeIPv6Address");function EN(t){let e=t[0]==="["&&t[t.length-1]==="]";if((t[0]==="["||t[t.length-1]==="]")&&!e)return{host:t,isIPV6:!1,error:!0};let i=e?t.slice(1,-1):t;if(e&&bce(i))return i=i.toLowerCase(),{host:`[${i}]`,escapedHost:i,isIPV6:!1,isIPVFuture:!0};if(xce(i,":")<2)return{host:t,isIPV6:!1,error:e};let r="",o=i.indexOf("%");if(o!==-1){let c=i.slice(o,o+3).toLowerCase()==="%25"?3:1;if(r=i.slice(o+c),!_ce(r))return{host:t,isIPV6:!1,error:!0};i=i.slice(0,o)}let s=kce(i);return s===void 0?{host:t,isIPV6:!1,error:!0}:{host:s+(r?"%"+r:""),escapedHost:s+(r?"%25"+r:""),isIPV6:!0}}a(EN,"normalizeIPv6");function xce(t,e){let n=0;for(let i=0;i<t.length;i++)t[i]===e&&n++;return n}a(xce,"findToken");function Sce(t){let e=t,n=[],i=-1,r=0;for(;r=e.length;){if(r===1){if(e===".")break;if(e==="/"){n.push("/");break}else{n.push(e);break}}else if(r===2){if(e[0]==="."){if(e[1]===".")break;if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&(e[1]==="."||e[1]==="/")){n.push("/");break}}else if(r===3&&e==="/.."){n.length!==0&&n.pop(),n.push("/");break}if(e[0]==="."){if(e[1]==="."){if(e[2]==="/"){e=e.slice(3);continue}}else if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&e[1]==="."){if(e[2]==="/"){e=e.slice(2);continue}else if(e[2]==="."&&e[3]==="/"){e=e.slice(3),n.length!==0&&n.pop();continue}}if((i=e.indexOf("/",1))===-1){n.push(e);break}else n.push(e.slice(0,i)),e=e.slice(i)}return n.join("")}a(Sce,"removeDotSegments");var Ice={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},Ece=/[@/?#:]/g,Tce=/[@/?#]/g;function F2(t,e){let n=e?Tce:Ece;return n.lastIndex=0,t.replace(n,i=>Ice[i])}a(F2,"reescapeHostDelimiters");function q2(t,e=!1){if(t.indexOf("%")===-1)return t;let n="";for(let i=0;i<t.length;i++){if(t[i]==="%"&&i+2<t.length){let r=t.slice(i+1,i+3);if(Ms(r)){let o=r.toUpperCase(),s=String.fromCharCode(parseInt(o,16));e&&AN(s)?n+=s:n+="%"+o,i+=2;continue}}n+=t[i]}return n}a(q2,"normalizePercentEncoding");function Ace(t){let e="";for(let n=0;n<t.length;n++){let i=t[n];if(i==="%"&&n+2<t.length){let r=t.slice(n+1,n+3);if(Ms(r)){let o=r.toUpperCase(),s=String.fromCharCode(parseInt(o,16));s!=="."&&AN(s)?e+=s:e+="%"+o,n+=2;continue}}if(U2(i))e+=i;else{let r=t.charCodeAt(n);if(r<128)e+=V2(r)?i:_n[r];else if(r<55296||r>57343)e+=Ft(r);else if(r<=56319&&n+1<t.length){let o=t.charCodeAt(n+1);o>=56320&&o<=57343?(e+=Ft(65536+(r-55296<<10)+(o-56320)),n++):e+=Ft(65533)}else e+=Ft(65533)}}return e}a(Ace,"normalizePathEncoding");function Oce(t,e=!1){let n="",i=e&&t[0]!=="/";for(let r=0;r<t.length;r++){let o=t[r];if(o==="%"&&r+2<t.length){let s=t.slice(r+1,r+3);if(Ms(s)){n+="%"+s.toUpperCase(),r+=2;continue}}if(o==="/"&&(i=!1),U2(o)&&(o!==":"||!i))n+=o;else{let s=t.charCodeAt(r);if(s<128)n+=_n[s];else if(s<55296||s>57343)n+=Ft(s);else if(s<=56319&&r+1<t.length){let c=t.charCodeAt(r+1);c>=56320&&c<=57343?(n+=Ft(65536+(s-55296<<10)+(c-56320)),r++):n+=Ft(65533)}else n+=Ft(65533)}}return n}a(Oce,"serializePathEncoding");function NN(t,e){let n="";for(let i=0;i<t.length;i++){let r=t[i];if(r==="%"&&i+2<t.length){let o=t.slice(i+1,i+3);if(Ms(o)){n+="%"+o.toUpperCase(),i+=2;continue}}if(e(r))n+=r;else{let o=t.charCodeAt(i);if(o<128)n+=_n[o];else if(o<55296||o>57343)n+=Ft(o);else if(o<=56319&&i+1<t.length){let s=t.charCodeAt(i+1);s>=56320&&s<=57343?(n+=Ft(65536+(o-55296<<10)+(s-56320)),i++):n+=Ft(65533)}else n+=Ft(65533)}}return n}a(NN,"encodeComponent");function Z2(t){return NN(t,gce)}a(Z2,"encodeUserinfo");function Nce(t){return NN(t,ON)}a(Nce,"encodeQuery");function Cce(t){return NN(t,ON)}a(Cce,"encodeFragment");function V2(t){return t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122||t===42||t===43||t===45||t===46||t===47||t===64||t===95}a(V2,"isEscapeSafe");function Pce(t){let e="";for(let n=0;n<t.length;n++){let i=t[n];if(i==="%"&&n+2<t.length){let r=t.slice(n+1,n+3);if(Ms(r)){let o=r.toUpperCase(),s=String.fromCharCode(parseInt(o,16));AN(s)?e+=s:e+="%"+o,n+=2;continue}}if(ON(i))e+=i;else{let r=t.charCodeAt(n);if(r<128)e+=V2(r)?i:_n[r];else if(r<55296||r>57343)e+=Ft(r);else if(r<=56319&&n+1<t.length){let o=t.charCodeAt(n+1);o>=56320&&o<=57343?(e+=Ft(65536+(r-55296<<10)+(o-56320)),n++):e+=Ft(65533)}else e+=Ft(65533)}}return e}a(Pce,"normalizeQueryFragmentEncoding");function Rce(t){let e="";for(let n=0;n<t.length;n++){if(t[n]==="%"&&n+2<t.length){let i=t.slice(n+1,n+3);if(Ms(i)){e+="%"+i.toUpperCase(),n+=2;continue}}e+=escape(t[n])}return e}a(Rce,"escapePreservingEscapes");function jce(t){let e=[];if(t.userinfo!==void 0&&(e.push(Z2(t.userinfo)),e.push("@")),t.host!==void 0){let n=t.host;if(!TN(n)){let i=EN(n);i.isIPV6!==!0&&i.isIPVFuture!==!0&&(n=q2(n,!0),i=EN(n)),i.isIPV6===!0||i.isIPVFuture===!0?n=`[${i.escapedHost}]`:n=F2(n,!1)}e.push(n)}if(typeof t.port=="number"||typeof t.port=="string"){let n=String(t.port);if(!hce(n))throw new TypeError("URI port is malformed.");e.push(":"),e.push(n)}return e.length?e.join(""):void 0}a(jce,"recomposeAuthority");B2.exports={nonSimpleDomain:$ce,recomposeAuthority:jce,reescapeHostDelimiters:F2,normalizePercentEncoding:q2,normalizePathEncoding:Ace,serializePathEncoding:Oce,normalizeQueryFragmentEncoding:Pce,encodeUserinfo:Z2,encodeQuery:Nce,encodeFragment:Cce,escapePreservingEscapes:Rce,removeDotSegments:Sce,isIPv4:TN,isUUID:mce,normalizeIPv6:EN,stringArrayToHexStripped:yce}});var J2=I((aGe,G2)=>{"use strict";var{isUUID:zce}=CN(),Dce=/^([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-./:;=@]|%[\da-f]{2})+)$/iu,Lce=["http","https","ws","wss","urn","urn:uuid"];function Mce(t){return Lce.indexOf(t)!==-1}a(Mce,"isValidSchemeName");function PN(t){return t.secure===!0?!0:t.secure===!1?!1:t.scheme?t.scheme.length===3&&(t.scheme[0]==="w"||t.scheme[0]==="W")&&(t.scheme[1]==="s"||t.scheme[1]==="S")&&(t.scheme[2]==="s"||t.scheme[2]==="S"):!1}a(PN,"wsIsSecure");function K2(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}a(K2,"httpParse");function H2(t){let e=String(t.scheme).toLowerCase()==="https";return(t.port===(e?443:80)||t.port==="")&&(t.port=void 0),t.path||(t.path="/"),t}a(H2,"httpSerialize");function Uce(t){return t.secure=PN(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}a(Uce,"wsParse");function Fce(t){if((t.port===(PN(t)?443:80)||t.port==="")&&(t.port=void 0),typeof t.secure=="boolean"&&(t.scheme=t.secure?"wss":"ws",t.secure=void 0),t.resourceName){let e=t.resourceName.indexOf("?"),n=e===-1?t.resourceName:t.resourceName.slice(0,e);t.path=n&&n!=="/"?n:void 0,t.query=e===-1?void 0:t.resourceName.slice(e+1),t.resourceName=void 0}return t.fragment=void 0,t}a(Fce,"wsSerialize");function qce(t,e){if(!t.path)return t.error="URN can not be parsed",t;let n=t.path.match(Dce);if(n&&n[0]===t.path){let i=e.scheme||t.scheme||"urn";t.nid=n[1].toLowerCase(),t.nss=n[2];let r=`${i}:${e.nid||t.nid}`,o=RN(r);t.path=void 0,o&&(t=o.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}a(qce,"urnParse");function Zce(t,e){if(t.nid===void 0)throw new Error("URN without nid cannot be serialized");let n=e.scheme||t.scheme||"urn",i=t.nid.toLowerCase(),r=`${n}:${e.nid||i}`,o=RN(r);o&&(t=o.serialize(t,e));let s=t,c=t.nss;return s.path=`${i||e.nid}:${c}`,e.skipEscape=!0,s}a(Zce,"urnSerialize");function Vce(t,e){let n=t;return n.uuid=n.nss,n.nss=void 0,!e.tolerant&&(!n.uuid||!zce(n.uuid))&&(n.error=n.error||"UUID is not valid."),n}a(Vce,"urnuuidParse");function Bce(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}a(Bce,"urnuuidSerialize");var W2={scheme:"http",domainHost:!0,parse:K2,serialize:H2},Kce={scheme:"https",domainHost:W2.domainHost,parse:K2,serialize:H2},zw={scheme:"ws",domainHost:!0,parse:Uce,serialize:Fce},Hce={scheme:"wss",domainHost:zw.domainHost,parse:zw.parse,serialize:zw.serialize},Wce={scheme:"urn",parse:qce,serialize:Zce,skipNormalize:!0},Gce={scheme:"urn:uuid",parse:Vce,serialize:Bce,skipNormalize:!0},Dw={http:W2,https:Kce,ws:zw,wss:Hce,urn:Wce,"urn:uuid":Gce};Object.setPrototypeOf(Dw,null);function RN(t){return t&&(Dw[t]||Dw[t.toLowerCase()])||void 0}a(RN,"getSchemeHandler");G2.exports={wsIsSecure:PN,SCHEMES:Dw,isValidSchemeName:Mce,getSchemeHandler:RN}});var l6=I((uGe,Uw)=>{"use strict";var{normalizeIPv6:t6,removeDotSegments:Lp,recomposeAuthority:Jce,normalizePercentEncoding:n6,normalizePathEncoding:Yce,serializePathEncoding:Y2,normalizeQueryFragmentEncoding:X2,encodeQuery:Xce,encodeFragment:Qce,reescapeHostDelimiters:eue,isIPv4:r6,nonSimpleDomain:tue}=CN(),{SCHEMES:i6,getSchemeHandler:jN}=J2(),o6=/^[A-Za-z][A-Za-z0-9+.-]*$/u,s6="URI scheme is malformed.";function Q2(t){let e=unescape(String(t));if(!o6.test(e))throw new TypeError(s6);return e}a(Q2,"decodeValidScheme");function nue(t,e){return typeof t=="string"?t=lue(t,e):typeof t=="object"&&(t=Mw(Us(t,e),e)),t}a(nue,"normalize");function rue(t,e,n){let i=n?Object.assign({scheme:"null"},n):{scheme:"null"},{parsed:r,malformedAuthorityOrPort:o,malformedPercentEncoding:s,malformedSchemeSpecific:c,malformedHost:u,malformedScheme:l}=Lw(t,i),{parsed:d,malformedAuthorityOrPort:f,malformedPercentEncoding:p,malformedSchemeSpecific:m,malformedHost:g,malformedScheme:y}=Lw(e,i);if(o||f||s||p||c||m||u||g||l||y)throw new Error(r.error||d.error||"URI is malformed.");let v=a6(r,d,i,!0),w=jN(n&&n.scheme||v.scheme),b=v.host,$=b!==void 0&&b!==""&&(r6(b)||t6(b).isIPV6);c6(v,n||{},w,$);let x=b&&b.indexOf("%")!==-1&&!new RegExp("\\P{ASCII}","u").test(b);if(v.error&&!x)throw new Error(v.error);return i.skipEscape=!0,Us(v,i)}a(rue,"resolve");function a6(t,e,n,i){let r={};return i||(t=Mw(Us(t,n),n),e=Mw(Us(e,n),n)),n=n||{},!n.tolerant&&e.scheme?(r.scheme=e.scheme,r.userinfo=e.userinfo,r.host=e.host,r.port=e.port,r.path=Lp(e.path||""),r.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(r.userinfo=e.userinfo,r.host=e.host,r.port=e.port,r.path=Lp(e.path||""),r.query=e.query):(e.path?(e.path[0]==="/"?r.path=Lp(e.path):((t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)&&!t.path?r.path="/"+e.path:t.path?r.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+e.path:r.path=e.path,r.path=Lp(r.path)),r.query=e.query):(r.path=t.path,e.query!==void 0?r.query=e.query:r.query=t.query),r.userinfo=t.userinfo,r.host=t.host,r.port=t.port),r.scheme=t.scheme),r.fragment=e.fragment,r}a(a6,"resolveComponent");function iue(t,e,n){let i=e6(t,n),r=e6(e,n);return i!==void 0&&r!==void 0&&i===r}a(iue,"equal");function Us(t,e){let n={host:t.host,scheme:t.scheme,userinfo:t.userinfo,port:t.port,path:t.path,query:t.query,nid:t.nid,nss:t.nss,uuid:t.uuid,fragment:t.fragment,reference:t.reference,resourceName:t.resourceName,secure:t.secure,error:""},i=Object.assign({},e),r=[];n.scheme&&(n.scheme=Q2(n.scheme));let o=jN(i.scheme||n.scheme);o&&o.serialize&&o.serialize(n,i);let s=n.userinfo!==void 0||n.host!==void 0||n.port!==void 0,c=!i.skipEscape&&n.scheme===void 0&&!s;n.path!==void 0&&(i.skipEscape?n.path=n6(n.path):n.path=Y2(n.path,c)),i.reference!=="suffix"&&n.scheme&&(n.scheme=Q2(n.scheme),r.push(n.scheme,":"));let u=Jce(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=Lp(l)),c&&(l=Y2(l,!0)),u===void 0&&l[0]==="/"&&l[1]==="/"&&(l="/%2F"+l.slice(2)),r.push(l)}return n.query!==void 0&&r.push("?",Xce(n.query)),n.fragment!==void 0&&r.push("#",Qce(n.fragment)),r.join("")}a(Us,"serialize");var oue=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u,sue=/^(?:[^#/:?]+:)?\/\/([^/?#]*)/,aue=/^(?:[^#/:?]+:)?([/\\\t\n\r]*)/;function cue(t,e){if(e[2]!==void 0&&t.path&&t.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof t.port=="number"&&(t.port<0||t.port>65535))return"URI port is malformed."}a(cue,"getParseError");function Dp(t){if(t===void 0)return!1;let e=t.indexOf("%");for(;e!==-1;){if(e+2>=t.length||!/^[\da-f]{2}$/iu.test(t.slice(e+1,e+3)))return!0;e=t.indexOf("%",e+3)}return!1}a(Dp,"hasMalformedPercentEncoding");function zN(t){return t[0]==="["&&t[t.length-1]==="]"}a(zN,"isIPLiteral");function uue(t){let e=t[4];return Dp(t[3])||e!==void 0&&!zN(e)&&Dp(e)||Dp(t[6])||Dp(t[7])||Dp(t[8])}a(uue,"hasMalformedComponentPercentEncoding");function c6(t,e,n,i){if(!e.unicodeSupport&&(!n||!n.unicodeSupport)&&t.host&&!zN(t.host)&&(e.domainHost||n&&n.domainHost)&&i===!1&&tue(t.host))try{t.host=new URL("http://"+t.host).hostname}catch(r){return t.error=t.error||"Host's domain name can not be converted to ASCII: "+r,!0}return!1}a(c6,"canonicalizeHost");function Lw(t,e){let n=Object.assign({},e),i={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},r=!1,o=!1,s=!1,c=!1,u=!1,l=!1,d=!1;n.reference==="suffix"&&(n.scheme?t=n.scheme+":"+t:t="//"+t);let f=t.match(sue);f!==null&&f[1].indexOf("\\")!==-1&&(i.error="URI authority must not contain a literal backslash.",r=!0);let p=t.match(aue);if(p!==null){let g=p[1],y=g.replace(/[\t\n\r]/g,"");y.length>=2&&(y.slice(0,2)!=="//"?(i.error=i.error||"URI authority must not contain a literal backslash.",r=!0):g.length!==y.length&&(i.error=i.error||"URI authority introducer must not contain whitespace.",r=!0))}let m=t.match(oue);if(m){if(i.scheme=m[1],i.userinfo=m[3],i.host=m[4],i.port=parseInt(m[5],10),i.path=m[6]||"",i.query=m[7],i.fragment=m[8],i.scheme!==void 0){let v=unescape(i.scheme);o6.test(v)?i.scheme=v.toLowerCase():(i.error=i.error||s6,l=!0)}o=uue(m),o&&(i.error=i.error||"URI contains malformed percent-encoding."),isNaN(i.port)&&(i.port=m[5]);let g=cue(i,m);if(g!==void 0&&(i.error=i.error||g,r=!0),i.host)if(r6(i.host)===!1){let w=zN(i.host),b=i.host.indexOf("[")!==-1||i.host.indexOf("]")!==-1,$=t6(i.host);d=$.isIPV6||$.isIPVFuture===!0,u=b&&(!w||$.error===!0),i.host=d?$.host:$.host.toLowerCase(),u&&(i.error=i.error||"URI host is malformed.",r=!0)}else d=!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 y=jN(n.scheme||i.scheme);if(u||(c=c6(i,n,y,d)),!y||y&&!y.skipNormalize){if(t.indexOf("%")!==-1&&i.host!==void 0&&!u){let v=d?i.host:n6(i.host,!0);i.host=eue(v,d)}i.path&&(i.path=Yce(i.path)),i.query&&(i.query=X2(i.query)),i.fragment&&(i.fragment=X2(i.fragment))}y&&y.parse&&(y.parse(i,n),y===i6.urn&&i.nid===void 0&&(s=!0))}else i.error=i.error||"URI can not be parsed.";return{parsed:i,malformedAuthorityOrPort:r,malformedPercentEncoding:o,malformedSchemeSpecific:s,malformedHost:c,malformedScheme:l}}a(Lw,"parseWithStatus");function Mw(t,e){return Lw(t,e).parsed}a(Mw,"parse");function lue(t,e){return u6(t,e).normalized}a(lue,"normalizeString");function u6(t,e){let{parsed:n,malformedAuthorityOrPort:i,malformedPercentEncoding:r,malformedSchemeSpecific:o,malformedHost:s,malformedScheme:c}=Lw(t,e);return{normalized:i||r||o||s||c?t:Us(n,e),malformedAuthorityOrPort:i,malformedPercentEncoding:r,malformedSchemeSpecific:o,malformedHost:s,malformedScheme:c}}a(u6,"normalizeStringWithStatus");function e6(t,e){if(typeof t!="string"&&typeof t!="object")return;let n;try{n=typeof t=="string"?t:Us(t,e)}catch{return}let{normalized:i,malformedAuthorityOrPort:r,malformedPercentEncoding:o,malformedSchemeSpecific:s,malformedHost:c,malformedScheme:u}=u6(n,e);return r||o||s||c||u?void 0:i}a(e6,"normalizeComparableURI");var DN={SCHEMES:i6,normalize:nue,resolve:rue,resolveComponent:a6,equal:iue,serialize:Us,parse:Mw};Uw.exports=DN;Uw.exports.default=DN;Uw.exports.fastUri=DN});var f6=I(LN=>{"use strict";Object.defineProperty(LN,"__esModule",{value:!0});var d6=l6();d6.code='require("ajv/dist/runtime/uri").default';LN.default=d6});var w6=I(Ot=>{"use strict";Object.defineProperty(Ot,"__esModule",{value:!0});Ot.CodeGen=Ot.Name=Ot.nil=Ot.stringify=Ot.str=Ot._=Ot.KeywordCxt=void 0;var due=jp();Object.defineProperty(Ot,"KeywordCxt",{enumerable:!0,get:a(function(){return due.KeywordCxt},"get")});var ou=ce();Object.defineProperty(Ot,"_",{enumerable:!0,get:a(function(){return ou._},"get")});Object.defineProperty(Ot,"str",{enumerable:!0,get:a(function(){return ou.str},"get")});Object.defineProperty(Ot,"stringify",{enumerable:!0,get:a(function(){return ou.stringify},"get")});Object.defineProperty(Ot,"nil",{enumerable:!0,get:a(function(){return ou.nil},"get")});Object.defineProperty(Ot,"Name",{enumerable:!0,get:a(function(){return ou.Name},"get")});Object.defineProperty(Ot,"CodeGen",{enumerable:!0,get:a(function(){return ou.CodeGen},"get")});var fue=Pw(),y6=zp(),pue=aN(),Mp=jw(),mue=ce(),Up=Cp(),Fw=Np(),UN=we(),p6=L2(),hue=f6(),v6=a((t,e)=>new RegExp(t,e),"defaultRegExp");v6.code="new RegExp";var gue=["removeAdditional","useDefaults","coerceTypes"],yue=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),vue={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."},bue={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},m6=200;function wue(t){var e,n,i,r,o,s,c,u,l,d,f,p,m,g,y,v,w,b,$,x,T,C,Z,S,G;let me=t.strict,Zt=(e=t.code)===null||e===void 0?void 0:e.optimize,Fe=Zt===!0||Zt===void 0?1:Zt||0,Sn=(i=(n=t.code)===null||n===void 0?void 0:n.regExp)!==null&&i!==void 0?i:v6,fm=(r=t.uriResolver)!==null&&r!==void 0?r:hue.default;return{strictSchema:(s=(o=t.strictSchema)!==null&&o!==void 0?o:me)!==null&&s!==void 0?s:!0,strictNumbers:(u=(c=t.strictNumbers)!==null&&c!==void 0?c:me)!==null&&u!==void 0?u:!0,strictTypes:(d=(l=t.strictTypes)!==null&&l!==void 0?l:me)!==null&&d!==void 0?d:"log",strictTuples:(p=(f=t.strictTuples)!==null&&f!==void 0?f:me)!==null&&p!==void 0?p:"log",strictRequired:(g=(m=t.strictRequired)!==null&&m!==void 0?m:me)!==null&&g!==void 0?g:!1,code:t.code?{...t.code,optimize:Fe,regExp:Sn}:{optimize:Fe,regExp:Sn},loopRequired:(y=t.loopRequired)!==null&&y!==void 0?y:m6,loopEnum:(v=t.loopEnum)!==null&&v!==void 0?v:m6,meta:(w=t.meta)!==null&&w!==void 0?w:!0,messages:(b=t.messages)!==null&&b!==void 0?b:!0,inlineRefs:($=t.inlineRefs)!==null&&$!==void 0?$:!0,schemaId:(x=t.schemaId)!==null&&x!==void 0?x:"$id",addUsedSchema:(T=t.addUsedSchema)!==null&&T!==void 0?T:!0,validateSchema:(C=t.validateSchema)!==null&&C!==void 0?C:!0,validateFormats:(Z=t.validateFormats)!==null&&Z!==void 0?Z:!0,unicodeRegExp:(S=t.unicodeRegExp)!==null&&S!==void 0?S:!0,int32range:(G=t.int32range)!==null&&G!==void 0?G:!0,uriResolver:fm}}a(wue,"requiredOptions");var Fp=class{static{a(this,"Ajv")}constructor(e={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...wue(e)};let{es5:n,lines:i}=this.opts.code;this.scope=new mue.ValueScope({scope:{},prefixes:yue,es5:n,lines:i}),this.logger=Iue(e.logger);let r=e.validateFormats;e.validateFormats=!1,this.RULES=(0,pue.getRules)(),h6.call(this,vue,e,"NOT SUPPORTED"),h6.call(this,bue,e,"DEPRECATED","warn"),this._metaOpts=xue.call(this),e.formats&&_ue.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&kue.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),$ue.call(this),e.validateFormats=r}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:n,schemaId:i}=this.opts,r=p6;i==="id"&&(r={...p6},r.id=r.$id,delete r.$id),n&&e&&this.addMetaSchema(r,r[i],!1)}defaultMeta(){let{meta:e,schemaId:n}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[n]||e:void 0}validate(e,n){let i;if(typeof e=="string"){if(i=this.getSchema(e),!i)throw new Error(`no schema with key or ref "${e}"`)}else i=this.compile(e);let r=i(n);return"$async"in i||(this.errors=i.errors),r}compile(e,n){let i=this._addSchema(e,n);return i.validate||this._compileSchemaEnv(i)}compileAsync(e,n){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:i}=this.opts;return r.call(this,e,n);async function r(d,f){await o.call(this,d.$schema);let p=this._addSchema(d,f);return p.validate||s.call(this,p)}async function o(d){d&&!this.getSchema(d)&&await r.call(this,{$ref:d},!0)}async function s(d){try{return this._compileSchemaEnv(d)}catch(f){if(!(f instanceof y6.default))throw f;return c.call(this,f),await u.call(this,f.missingSchema),s.call(this,d)}}function c({missingSchema:d,missingRef:f}){if(this.refs[d])throw new Error(`AnySchema ${d} is loaded but ${f} cannot be resolved`)}async function u(d){let f=await l.call(this,d);this.refs[d]||await o.call(this,f.$schema),this.refs[d]||this.addSchema(f,d,n)}async function l(d){let f=this._loading[d];if(f)return f;try{return await(this._loading[d]=i(d))}finally{delete this._loading[d]}}}addSchema(e,n,i,r=this.opts.validateSchema){if(Array.isArray(e)){for(let s of e)this.addSchema(s,void 0,i,r);return this}let o;if(typeof e=="object"){let{schemaId:s}=this.opts;if(o=e[s],o!==void 0&&typeof o!="string")throw new Error(`schema ${s} must be string`)}return n=(0,Up.normalizeId)(n||o),this._checkUnique(n),this.schemas[n]=this._addSchema(e,i,n,r,!0),this}addMetaSchema(e,n,i=this.opts.validateSchema){return this.addSchema(e,n,!0,i),this}validateSchema(e,n){if(typeof e=="boolean")return!0;let i;if(i=e.$schema,i!==void 0&&typeof i!="string")throw new Error("$schema must be a string");if(i=i||this.opts.defaultMeta||this.defaultMeta(),!i)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let r=this.validate(i,e);if(!r&&n){let o="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(o);else throw new Error(o)}return r}getSchema(e){let n;for(;typeof(n=g6.call(this,e))=="string";)e=n;if(n===void 0){let{schemaId:i}=this.opts,r=new Mp.SchemaEnv({schema:{},schemaId:i});if(n=Mp.resolveSchema.call(this,r,e),!n)return;this.refs[e]=n}return n.validate||this._compileSchemaEnv(n)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let n=g6.call(this,e);return typeof n=="object"&&this._cache.delete(n.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let n=e;this._cache.delete(n);let i=e[this.opts.schemaId];return i&&(i=(0,Up.normalizeId)(i),delete this.schemas[i],delete this.refs[i]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let n of e)this.addKeyword(n);return this}addKeyword(e,n){let i;if(typeof e=="string")i=e,typeof n=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),n.keyword=i);else if(typeof e=="object"&&n===void 0){if(n=e,i=n.keyword,Array.isArray(i)&&!i.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(Tue.call(this,i,n),!n)return(0,UN.eachItem)(i,o=>MN.call(this,o)),this;Oue.call(this,n);let r={...n,type:(0,Fw.getJSONTypes)(n.type),schemaType:(0,Fw.getJSONTypes)(n.schemaType)};return(0,UN.eachItem)(i,r.type.length===0?o=>MN.call(this,o,r):o=>r.type.forEach(s=>MN.call(this,o,r,s))),this}getKeyword(e){let n=this.RULES.all[e];return typeof n=="object"?n.definition:!!n}removeKeyword(e){let{RULES:n}=this;delete n.keywords[e],delete n.all[e];for(let i of n.rules){let r=i.rules.findIndex(o=>o.keyword===e);r>=0&&i.rules.splice(r,1)}return this}addFormat(e,n){return typeof n=="string"&&(n=new RegExp(n)),this.formats[e]=n,this}errorsText(e=this.errors,{separator:n=", ",dataVar:i="data"}={}){return!e||e.length===0?"No errors":e.map(r=>`${i}${r.instancePath} ${r.message}`).reduce((r,o)=>r+n+o)}$dataMetaSchema(e,n){let i=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let r of n){let o=r.split("/").slice(1),s=e;for(let c of o)s=s[c];for(let c in i){let u=i[c];if(typeof u!="object")continue;let{$data:l}=u.definition,d=s[c];l&&d&&(s[c]=b6(d))}}return e}_removeAllSchemas(e,n){for(let i in e){let r=e[i];(!n||n.test(i))&&(typeof r=="string"?delete e[i]:r&&!r.meta&&(this._cache.delete(r.schema),delete e[i]))}}_addSchema(e,n,i,r=this.opts.validateSchema,o=this.opts.addUsedSchema){let s,{schemaId:c}=this.opts;if(typeof e=="object")s=e[c];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof e!="boolean")throw new Error("schema must be object or boolean")}let u=this._cache.get(e);if(u!==void 0)return u;i=(0,Up.normalizeId)(s||i);let l=Up.getSchemaRefs.call(this,e,i);return u=new Mp.SchemaEnv({schema:e,schemaId:c,meta:n,baseId:i,localRefs:l}),this._cache.set(u.schema,u),o&&!i.startsWith("#")&&(i&&this._checkUnique(i),this.refs[i]=u),r&&this.validateSchema(e,!0),u}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):Mp.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let n=this.opts;this.opts=this._metaOpts;try{Mp.compileSchema.call(this,e)}finally{this.opts=n}}};Fp.ValidationError=fue.default;Fp.MissingRefError=y6.default;Ot.default=Fp;function h6(t,e,n,i="error"){for(let r in t){let o=r;o in e&&this.logger[i](`${n}: option ${r}. ${t[o]}`)}}a(h6,"checkOptions");function g6(t){return t=(0,Up.normalizeId)(t),this.schemas[t]||this.refs[t]}a(g6,"getSchEnv");function $ue(){let t=this.opts.schemas;if(t)if(Array.isArray(t))this.addSchema(t);else for(let e in t)this.addSchema(t[e],e)}a($ue,"addInitialSchemas");function _ue(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}a(_ue,"addInitialFormats");function kue(t){if(Array.isArray(t)){this.addVocabulary(t);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in t){let n=t[e];n.keyword||(n.keyword=e),this.addKeyword(n)}}a(kue,"addInitialKeywords");function xue(){let t={...this.opts};for(let e of gue)delete t[e];return t}a(xue,"getMetaSchemaOptions");var Sue={log(){},warn(){},error(){}};function Iue(t){if(t===!1)return Sue;if(t===void 0)return console;if(t.log&&t.warn&&t.error)return t;throw new Error("logger must implement log, warn and error methods")}a(Iue,"getLogger");var Eue=/^[a-z_$][a-z0-9_$:-]*$/i;function Tue(t,e){let{RULES:n}=this;if((0,UN.eachItem)(t,i=>{if(n.keywords[i])throw new Error(`Keyword ${i} is already defined`);if(!Eue.test(i))throw new Error(`Keyword ${i} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}a(Tue,"checkKeyword");function MN(t,e,n){var i;let r=e?.post;if(n&&r)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:o}=this,s=r?o.post:o.rules.find(({type:u})=>u===n);if(s||(s={type:n,rules:[]},o.rules.push(s)),o.keywords[t]=!0,!e)return;let c={keyword:t,definition:{...e,type:(0,Fw.getJSONTypes)(e.type),schemaType:(0,Fw.getJSONTypes)(e.schemaType)}};e.before?Aue.call(this,s,c,e.before):s.rules.push(c),o.all[t]=c,(i=e.implements)===null||i===void 0||i.forEach(u=>this.addKeyword(u))}a(MN,"addRule");function Aue(t,e,n){let i=t.rules.findIndex(r=>r.keyword===n);i>=0?t.rules.splice(i,0,e):(t.rules.push(e),this.logger.warn(`rule ${n} is not defined`))}a(Aue,"addBeforeRule");function Oue(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=b6(e)),t.validateSchema=this.compile(e,!0))}a(Oue,"keywordMetaschema");var Nue={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function b6(t){return{anyOf:[t,Nue]}}a(b6,"schemaOrData")});var $6=I(FN=>{"use strict";Object.defineProperty(FN,"__esModule",{value:!0});var Cue={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};FN.default=Cue});var S6=I(Fs=>{"use strict";Object.defineProperty(Fs,"__esModule",{value:!0});Fs.callRef=Fs.getValidate=void 0;var Pue=zp(),_6=Yn(),kn=ce(),su=gi(),k6=jw(),qw=we(),Rue={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:n,it:i}=t,{baseId:r,schemaEnv:o,validateName:s,opts:c,self:u}=i,{root:l}=o;if((n==="#"||n==="#/")&&r===l.baseId)return f();let d=k6.resolveRef.call(u,l,r,n);if(d===void 0)throw new Pue.default(i.opts.uriResolver,r,n);if(d instanceof k6.SchemaEnv)return p(d);return m(d);function f(){if(o===l)return Zw(t,s,o,o.$async);let g=e.scopeValue("root",{ref:l});return Zw(t,(0,kn._)`${g}.validate`,l,l.$async)}function p(g){let y=x6(t,g);Zw(t,y,g,g.$async)}function m(g){let y=e.scopeValue("schema",c.code.source===!0?{ref:g,code:(0,kn.stringify)(g)}:{ref:g}),v=e.name("valid"),w=t.subschema({schema:g,dataTypes:[],schemaPath:kn.nil,topSchemaRef:y,errSchemaPath:n},v);t.mergeEvaluated(w),t.ok(v)}}};function x6(t,e){let{gen:n}=t;return e.validate?n.scopeValue("validate",{ref:e.validate}):(0,kn._)`${n.scopeValue("wrapper",{ref:e})}.validate`}a(x6,"getValidate");Fs.getValidate=x6;function Zw(t,e,n,i){let{gen:r,it:o}=t,{allErrors:s,schemaEnv:c,opts:u}=o,l=u.passContext?su.default.this:kn.nil;i?d():f();function d(){if(!c.$async)throw new Error("async schema referenced by sync schema");let g=r.let("valid");r.try(()=>{r.code((0,kn._)`await ${(0,_6.callValidateCode)(t,e,l)}`),m(e),s||r.assign(g,!0)},y=>{r.if((0,kn._)`!(${y} instanceof ${o.ValidationError})`,()=>r.throw(y)),p(y),s||r.assign(g,!1)}),t.ok(g)}a(d,"callAsyncRef");function f(){t.result((0,_6.callValidateCode)(t,e,l),()=>m(e),()=>p(e))}a(f,"callSyncRef");function p(g){let y=(0,kn._)`${g}.errors`;r.assign(su.default.vErrors,(0,kn._)`${su.default.vErrors} === null ? ${y} : ${su.default.vErrors}.concat(${y})`),r.assign(su.default.errors,(0,kn._)`${su.default.vErrors}.length`)}a(p,"addErrorsFrom");function m(g){var y;if(!o.opts.unevaluated)return;let v=(y=n?.validate)===null||y===void 0?void 0:y.evaluated;if(o.props!==!0)if(v&&!v.dynamicProps)v.props!==void 0&&(o.props=qw.mergeEvaluated.props(r,v.props,o.props));else{let w=r.var("props",(0,kn._)`${g}.evaluated.props`);o.props=qw.mergeEvaluated.props(r,w,o.props,kn.Name)}if(o.items!==!0)if(v&&!v.dynamicItems)v.items!==void 0&&(o.items=qw.mergeEvaluated.items(r,v.items,o.items));else{let w=r.var("items",(0,kn._)`${g}.evaluated.items`);o.items=qw.mergeEvaluated.items(r,w,o.items,kn.Name)}}a(m,"addEvaluatedFrom")}a(Zw,"callRef");Fs.callRef=Zw;Fs.default=Rue});var I6=I(qN=>{"use strict";Object.defineProperty(qN,"__esModule",{value:!0});var jue=$6(),zue=S6(),Due=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",jue.default,zue.default];qN.default=Due});var E6=I(ZN=>{"use strict";Object.defineProperty(ZN,"__esModule",{value:!0});var Vw=ce(),No=Vw.operators,Bw={maximum:{okStr:"<=",ok:No.LTE,fail:No.GT},minimum:{okStr:">=",ok:No.GTE,fail:No.LT},exclusiveMaximum:{okStr:"<",ok:No.LT,fail:No.GTE},exclusiveMinimum:{okStr:">",ok:No.GT,fail:No.LTE}},Lue={message:a(({keyword:t,schemaCode:e})=>(0,Vw.str)`must be ${Bw[t].okStr} ${e}`,"message"),params:a(({keyword:t,schemaCode:e})=>(0,Vw._)`{comparison: ${Bw[t].okStr}, limit: ${e}}`,"params")},Mue={keyword:Object.keys(Bw),type:"number",schemaType:"number",$data:!0,error:Lue,code(t){let{keyword:e,data:n,schemaCode:i}=t;t.fail$data((0,Vw._)`${n} ${Bw[e].fail} ${i} || isNaN(${n})`)}};ZN.default=Mue});var T6=I(VN=>{"use strict";Object.defineProperty(VN,"__esModule",{value:!0});var qp=ce(),Uue={message:a(({schemaCode:t})=>(0,qp.str)`must be multiple of ${t}`,"message"),params:a(({schemaCode:t})=>(0,qp._)`{multipleOf: ${t}}`,"params")},Fue={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:Uue,code(t){let{gen:e,data:n,schemaCode:i,it:r}=t,o=r.opts.multipleOfPrecision,s=e.let("res"),c=o?(0,qp._)`Math.abs(Math.round(${s}) - ${s}) > 1e-${o}`:(0,qp._)`${s} !== parseInt(${s})`;t.fail$data((0,qp._)`(${i} === 0 || (${s} = ${n}/${i}, ${c}))`)}};VN.default=Fue});var O6=I(BN=>{"use strict";Object.defineProperty(BN,"__esModule",{value:!0});function A6(t){let e=t.length,n=0,i=0,r;for(;i<e;)n++,r=t.charCodeAt(i++),r>=55296&&r<=56319&&i<e&&(r=t.charCodeAt(i),(r&64512)===56320&&i++);return n}a(A6,"ucs2length");BN.default=A6;A6.code='require("ajv/dist/runtime/ucs2length").default'});var N6=I(KN=>{"use strict";Object.defineProperty(KN,"__esModule",{value:!0});var qs=ce(),que=we(),Zue=O6(),Vue={message({keyword:t,schemaCode:e}){let n=t==="maxLength"?"more":"fewer";return(0,qs.str)`must NOT have ${n} than ${e} characters`},params:a(({schemaCode:t})=>(0,qs._)`{limit: ${t}}`,"params")},Bue={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:Vue,code(t){let{keyword:e,data:n,schemaCode:i,it:r}=t,o=e==="maxLength"?qs.operators.GT:qs.operators.LT,s=r.opts.unicode===!1?(0,qs._)`${n}.length`:(0,qs._)`${(0,que.useFunc)(t.gen,Zue.default)}(${n})`;t.fail$data((0,qs._)`${s} ${o} ${i}`)}};KN.default=Bue});var C6=I(HN=>{"use strict";Object.defineProperty(HN,"__esModule",{value:!0});var Kue=Yn(),Hue=we(),au=ce(),Wue={message:a(({schemaCode:t})=>(0,au.str)`must match pattern "${t}"`,"message"),params:a(({schemaCode:t})=>(0,au._)`{pattern: ${t}}`,"params")},Gue={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:Wue,code(t){let{gen:e,data:n,$data:i,schema:r,schemaCode:o,it:s}=t,c=s.opts.unicodeRegExp?"u":"";if(i){let{regExp:u}=s.opts.code,l=u.code==="new RegExp"?(0,au._)`new RegExp`:(0,Hue.useFunc)(e,u),d=e.let("valid");e.try(()=>e.assign(d,(0,au._)`${l}(${o}, ${c}).test(${n})`),()=>e.assign(d,!1)),t.fail$data((0,au._)`!${d}`)}else{let u=(0,Kue.usePattern)(t,r);t.fail$data((0,au._)`!${u}.test(${n})`)}}};HN.default=Gue});var P6=I(WN=>{"use strict";Object.defineProperty(WN,"__esModule",{value:!0});var Zp=ce(),Jue={message({keyword:t,schemaCode:e}){let n=t==="maxProperties"?"more":"fewer";return(0,Zp.str)`must NOT have ${n} than ${e} properties`},params:a(({schemaCode:t})=>(0,Zp._)`{limit: ${t}}`,"params")},Yue={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:Jue,code(t){let{keyword:e,data:n,schemaCode:i}=t,r=e==="maxProperties"?Zp.operators.GT:Zp.operators.LT;t.fail$data((0,Zp._)`Object.keys(${n}).length ${r} ${i}`)}};WN.default=Yue});var R6=I(GN=>{"use strict";Object.defineProperty(GN,"__esModule",{value:!0});var Vp=Yn(),Bp=ce(),Xue=we(),Que={message:a(({params:{missingProperty:t}})=>(0,Bp.str)`must have required property '${t}'`,"message"),params:a(({params:{missingProperty:t}})=>(0,Bp._)`{missingProperty: ${t}}`,"params")},ele={keyword:"required",type:"object",schemaType:"array",$data:!0,error:Que,code(t){let{gen:e,schema:n,schemaCode:i,data:r,$data:o,it:s}=t,{opts:c}=s;if(!o&&n.length===0)return;let u=n.length>=c.loopRequired;if(s.allErrors?l():d(),c.strictRequired){let m=t.parentSchema.properties,{definedProperties:g}=t.it;for(let y of n)if(m?.[y]===void 0&&!g.has(y)){let v=s.schemaEnv.baseId+s.errSchemaPath,w=`required property "${y}" is not defined at "${v}" (strictRequired)`;(0,Xue.checkStrictMode)(s,w,s.opts.strictRequired)}}function l(){if(u||o)t.block$data(Bp.nil,f);else for(let m of n)(0,Vp.checkReportMissingProp)(t,m)}a(l,"allErrorsMode");function d(){let m=e.let("missing");if(u||o){let g=e.let("valid",!0);t.block$data(g,()=>p(m,g)),t.ok(g)}else e.if((0,Vp.checkMissingProp)(t,n,m)),(0,Vp.reportMissingProp)(t,m),e.else()}a(d,"exitOnErrorMode");function f(){e.forOf("prop",i,m=>{t.setParams({missingProperty:m}),e.if((0,Vp.noPropertyInData)(e,r,m,c.ownProperties),()=>t.error())})}a(f,"loopAllRequired");function p(m,g){t.setParams({missingProperty:m}),e.forOf(m,i,()=>{e.assign(g,(0,Vp.propertyInData)(e,r,m,c.ownProperties)),e.if((0,Bp.not)(g),()=>{t.error(),e.break()})},Bp.nil)}a(p,"loopUntilMissing")}};GN.default=ele});var j6=I(JN=>{"use strict";Object.defineProperty(JN,"__esModule",{value:!0});var Kp=ce(),tle={message({keyword:t,schemaCode:e}){let n=t==="maxItems"?"more":"fewer";return(0,Kp.str)`must NOT have ${n} than ${e} items`},params:a(({schemaCode:t})=>(0,Kp._)`{limit: ${t}}`,"params")},nle={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:tle,code(t){let{keyword:e,data:n,schemaCode:i}=t,r=e==="maxItems"?Kp.operators.GT:Kp.operators.LT;t.fail$data((0,Kp._)`${n}.length ${r} ${i}`)}};JN.default=nle});var Kw=I(YN=>{"use strict";Object.defineProperty(YN,"__esModule",{value:!0});var z6=hN();z6.code='require("ajv/dist/runtime/equal").default';YN.default=z6});var D6=I(QN=>{"use strict";Object.defineProperty(QN,"__esModule",{value:!0});var XN=Np(),Nt=ce(),rle=we(),ile=Kw(),ole={message:a(({params:{i:t,j:e}})=>(0,Nt.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,"message"),params:a(({params:{i:t,j:e}})=>(0,Nt._)`{i: ${t}, j: ${e}}`,"params")},sle={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:ole,code(t){let{gen:e,data:n,$data:i,schema:r,parentSchema:o,schemaCode:s,it:c}=t;if(!i&&!r)return;let u=e.let("valid"),l=o.items?(0,XN.getSchemaTypes)(o.items):[];t.block$data(u,d,(0,Nt._)`${s} === false`),t.ok(u);function d(){let g=e.let("i",(0,Nt._)`${n}.length`),y=e.let("j");t.setParams({i:g,j:y}),e.assign(u,!0),e.if((0,Nt._)`${g} > 1`,()=>(f()?p:m)(g,y))}a(d,"validateUniqueItems");function f(){return l.length>0&&!l.some(g=>g==="object"||g==="array")}a(f,"canOptimize");function p(g,y){let v=e.name("item"),w=(0,XN.checkDataTypes)(l,v,c.opts.strictNumbers,XN.DataType.Wrong),b=e.const("indices",(0,Nt._)`{}`);e.for((0,Nt._)`;${g}--;`,()=>{e.let(v,(0,Nt._)`${n}[${g}]`),e.if(w,(0,Nt._)`continue`),l.length>1&&e.if((0,Nt._)`typeof ${v} == "string"`,(0,Nt._)`${v} += "_"`),e.if((0,Nt._)`typeof ${b}[${v}] == "number"`,()=>{e.assign(y,(0,Nt._)`${b}[${v}]`),t.error(),e.assign(u,!1).break()}).code((0,Nt._)`${b}[${v}] = ${g}`)})}a(p,"loopN");function m(g,y){let v=(0,rle.useFunc)(e,ile.default),w=e.name("outer");e.label(w).for((0,Nt._)`;${g}--;`,()=>e.for((0,Nt._)`${y} = ${g}; ${y}--;`,()=>e.if((0,Nt._)`${v}(${n}[${g}], ${n}[${y}])`,()=>{t.error(),e.assign(u,!1).break(w)})))}a(m,"loopN2")}};QN.default=sle});var L6=I(tC=>{"use strict";Object.defineProperty(tC,"__esModule",{value:!0});var eC=ce(),ale=we(),cle=Kw(),ule={message:"must be equal to constant",params:a(({schemaCode:t})=>(0,eC._)`{allowedValue: ${t}}`,"params")},lle={keyword:"const",$data:!0,error:ule,code(t){let{gen:e,data:n,$data:i,schemaCode:r,schema:o}=t;i||o&&typeof o=="object"?t.fail$data((0,eC._)`!${(0,ale.useFunc)(e,cle.default)}(${n}, ${r})`):t.fail((0,eC._)`${o} !== ${n}`)}};tC.default=lle});var M6=I(nC=>{"use strict";Object.defineProperty(nC,"__esModule",{value:!0});var Hp=ce(),dle=we(),fle=Kw(),ple={message:"must be equal to one of the allowed values",params:a(({schemaCode:t})=>(0,Hp._)`{allowedValues: ${t}}`,"params")},mle={keyword:"enum",schemaType:"array",$data:!0,error:ple,code(t){let{gen:e,data:n,$data:i,schema:r,schemaCode:o,it:s}=t;if(!i&&r.length===0)throw new Error("enum must have non-empty array");let c=r.length>=s.opts.loopEnum,u,l=a(()=>u??(u=(0,dle.useFunc)(e,fle.default)),"getEql"),d;if(c||i)d=e.let("valid"),t.block$data(d,f);else{if(!Array.isArray(r))throw new Error("ajv implementation error");let m=e.const("vSchema",o);d=(0,Hp.or)(...r.map((g,y)=>p(m,y)))}t.pass(d);function f(){e.assign(d,!1),e.forOf("v",o,m=>e.if((0,Hp._)`${l()}(${n}, ${m})`,()=>e.assign(d,!0).break()))}a(f,"loopEnum");function p(m,g){let y=r[g];return typeof y=="object"&&y!==null?(0,Hp._)`${l()}(${n}, ${m}[${g}])`:(0,Hp._)`${n} === ${y}`}a(p,"equalCode")}};nC.default=mle});var U6=I(rC=>{"use strict";Object.defineProperty(rC,"__esModule",{value:!0});var hle=E6(),gle=T6(),yle=N6(),vle=C6(),ble=P6(),wle=R6(),$le=j6(),_le=D6(),kle=L6(),xle=M6(),Sle=[hle.default,gle.default,yle.default,vle.default,ble.default,wle.default,$le.default,_le.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},kle.default,xle.default];rC.default=Sle});var oC=I(Wp=>{"use strict";Object.defineProperty(Wp,"__esModule",{value:!0});Wp.validateAdditionalItems=void 0;var Zs=ce(),iC=we(),Ile={message:a(({params:{len:t}})=>(0,Zs.str)`must NOT have more than ${t} items`,"message"),params:a(({params:{len:t}})=>(0,Zs._)`{limit: ${t}}`,"params")},Ele={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:Ile,code(t){let{parentSchema:e,it:n}=t,{items:i}=e;if(!Array.isArray(i)){(0,iC.checkStrictMode)(n,'"additionalItems" is ignored when "items" is not an array of schemas');return}F6(t,i)}};function F6(t,e){let{gen:n,schema:i,data:r,keyword:o,it:s}=t;s.items=!0;let c=n.const("len",(0,Zs._)`${r}.length`);if(i===!1)t.setParams({len:e.length}),t.pass((0,Zs._)`${c} <= ${e.length}`);else if(typeof i=="object"&&!(0,iC.alwaysValidSchema)(s,i)){let l=n.var("valid",(0,Zs._)`${c} <= ${e.length}`);n.if((0,Zs.not)(l),()=>u(l)),t.ok(l)}function u(l){n.forRange("i",e.length,c,d=>{t.subschema({keyword:o,dataProp:d,dataPropType:iC.Type.Num},l),s.allErrors||n.if((0,Zs.not)(l),()=>n.break())})}a(u,"validateItems")}a(F6,"validateAdditionalItems");Wp.validateAdditionalItems=F6;Wp.default=Ele});var sC=I(Gp=>{"use strict";Object.defineProperty(Gp,"__esModule",{value:!0});Gp.validateTuple=void 0;var q6=ce(),Hw=we(),Tle=Yn(),Ale={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:n}=t;if(Array.isArray(e))return Z6(t,"additionalItems",e);n.items=!0,!(0,Hw.alwaysValidSchema)(n,e)&&t.ok((0,Tle.validateArray)(t))}};function Z6(t,e,n=t.schema){let{gen:i,parentSchema:r,data:o,keyword:s,it:c}=t;d(r),c.opts.unevaluated&&n.length&&c.items!==!0&&(c.items=Hw.mergeEvaluated.items(i,n.length,c.items));let u=i.name("valid"),l=i.const("len",(0,q6._)`${o}.length`);n.forEach((f,p)=>{(0,Hw.alwaysValidSchema)(c,f)||(i.if((0,q6._)`${l} > ${p}`,()=>t.subschema({keyword:s,schemaProp:p,dataProp:p},u)),t.ok(u))});function d(f){let{opts:p,errSchemaPath:m}=c,g=n.length,y=g===f.minItems&&(g===f.maxItems||f[e]===!1);if(p.strictTuples&&!y){let v=`"${s}" is ${g}-tuple, but minItems or maxItems/${e} are not specified or different at path "${m}"`;(0,Hw.checkStrictMode)(c,v,p.strictTuples)}}a(d,"checkStrictTuple")}a(Z6,"validateTuple");Gp.validateTuple=Z6;Gp.default=Ale});var V6=I(aC=>{"use strict";Object.defineProperty(aC,"__esModule",{value:!0});var Ole=sC(),Nle={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:a(t=>(0,Ole.validateTuple)(t,"items"),"code")};aC.default=Nle});var K6=I(cC=>{"use strict";Object.defineProperty(cC,"__esModule",{value:!0});var B6=ce(),Cle=we(),Ple=Yn(),Rle=oC(),jle={message:a(({params:{len:t}})=>(0,B6.str)`must NOT have more than ${t} items`,"message"),params:a(({params:{len:t}})=>(0,B6._)`{limit: ${t}}`,"params")},zle={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:jle,code(t){let{schema:e,parentSchema:n,it:i}=t,{prefixItems:r}=n;i.items=!0,!(0,Cle.alwaysValidSchema)(i,e)&&(r?(0,Rle.validateAdditionalItems)(t,r):t.ok((0,Ple.validateArray)(t)))}};cC.default=zle});var H6=I(uC=>{"use strict";Object.defineProperty(uC,"__esModule",{value:!0});var Qn=ce(),Ww=we(),Dle={message:a(({params:{min:t,max:e}})=>e===void 0?(0,Qn.str)`must contain at least ${t} valid item(s)`:(0,Qn.str)`must contain at least ${t} and no more than ${e} valid item(s)`,"message"),params:a(({params:{min:t,max:e}})=>e===void 0?(0,Qn._)`{minContains: ${t}}`:(0,Qn._)`{minContains: ${t}, maxContains: ${e}}`,"params")},Lle={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:Dle,code(t){let{gen:e,schema:n,parentSchema:i,data:r,it:o}=t,s,c,{minContains:u,maxContains:l}=i;o.opts.next?(s=u===void 0?1:u,c=l):s=1;let d=e.const("len",(0,Qn._)`${r}.length`);if(t.setParams({min:s,max:c}),c===void 0&&s===0){(0,Ww.checkStrictMode)(o,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(c!==void 0&&s>c){(0,Ww.checkStrictMode)(o,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,Ww.alwaysValidSchema)(o,n)){let y=(0,Qn._)`${d} >= ${s}`;c!==void 0&&(y=(0,Qn._)`${y} && ${d} <= ${c}`),t.pass(y);return}o.items=!0;let f=e.name("valid");c===void 0&&s===1?m(f,()=>e.if(f,()=>e.break())):s===0?(e.let(f,!0),c!==void 0&&e.if((0,Qn._)`${r}.length > 0`,p)):(e.let(f,!1),p()),t.result(f,()=>t.reset());function p(){let y=e.name("_valid"),v=e.let("count",0);m(y,()=>e.if(y,()=>g(v)))}a(p,"validateItemsWithCount");function m(y,v){e.forRange("i",0,d,w=>{t.subschema({keyword:"contains",dataProp:w,dataPropType:Ww.Type.Num,compositeRule:!0},y),v()})}a(m,"validateItems");function g(y){e.code((0,Qn._)`${y}++`),c===void 0?e.if((0,Qn._)`${y} >= ${s}`,()=>e.assign(f,!0).break()):(e.if((0,Qn._)`${y} > ${c}`,()=>e.assign(f,!1).break()),s===1?e.assign(f,!0):e.if((0,Qn._)`${y} >= ${s}`,()=>e.assign(f,!0)))}a(g,"checkLimits")}};uC.default=Lle});var J6=I(Vr=>{"use strict";Object.defineProperty(Vr,"__esModule",{value:!0});Vr.validateSchemaDeps=Vr.validatePropertyDeps=Vr.error=void 0;var lC=ce(),Mle=we(),Jp=Yn();Vr.error={message:a(({params:{property:t,depsCount:e,deps:n}})=>{let i=e===1?"property":"properties";return(0,lC.str)`must have ${i} ${n} when property ${t} is present`},"message"),params:a(({params:{property:t,depsCount:e,deps:n,missingProperty:i}})=>(0,lC._)`{property: ${t},
|
|
145
|
+
missingProperty: ${i},
|
|
146
|
+
depsCount: ${e},
|
|
147
|
+
deps: ${n}}`,"params")};var Ule={keyword:"dependencies",type:"object",schemaType:"object",error:Vr.error,code(t){let[e,n]=Fle(t);W6(t,e),G6(t,n)}};function Fle({schema:t}){let e={},n={};for(let i in t){if(i==="__proto__")continue;let r=Array.isArray(t[i])?e:n;r[i]=t[i]}return[e,n]}a(Fle,"splitDependencies");function W6(t,e=t.schema){let{gen:n,data:i,it:r}=t;if(Object.keys(e).length===0)return;let o=n.let("missing");for(let s in e){let c=e[s];if(c.length===0)continue;let u=(0,Jp.propertyInData)(n,i,s,r.opts.ownProperties);t.setParams({property:s,depsCount:c.length,deps:c.join(", ")}),r.allErrors?n.if(u,()=>{for(let l of c)(0,Jp.checkReportMissingProp)(t,l)}):(n.if((0,lC._)`${u} && (${(0,Jp.checkMissingProp)(t,c,o)})`),(0,Jp.reportMissingProp)(t,o),n.else())}}a(W6,"validatePropertyDeps");Vr.validatePropertyDeps=W6;function G6(t,e=t.schema){let{gen:n,data:i,keyword:r,it:o}=t,s=n.name("valid");for(let c in e)(0,Mle.alwaysValidSchema)(o,e[c])||(n.if((0,Jp.propertyInData)(n,i,c,o.opts.ownProperties),()=>{let u=t.subschema({keyword:r,schemaProp:c},s);t.mergeValidEvaluated(u,s)},()=>n.var(s,!0)),t.ok(s))}a(G6,"validateSchemaDeps");Vr.validateSchemaDeps=G6;Vr.default=Ule});var X6=I(dC=>{"use strict";Object.defineProperty(dC,"__esModule",{value:!0});var Y6=ce(),qle=we(),Zle={message:"property name must be valid",params:a(({params:t})=>(0,Y6._)`{propertyName: ${t.propertyName}}`,"params")},Vle={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:Zle,code(t){let{gen:e,schema:n,data:i,it:r}=t;if((0,qle.alwaysValidSchema)(r,n))return;let o=e.name("valid");e.forIn("key",i,s=>{t.setParams({propertyName:s}),t.subschema({keyword:"propertyNames",data:s,dataTypes:["string"],propertyName:s,compositeRule:!0},o),e.if((0,Y6.not)(o),()=>{t.error(!0),r.allErrors||e.break()})}),t.ok(o)}};dC.default=Vle});var pC=I(fC=>{"use strict";Object.defineProperty(fC,"__esModule",{value:!0});var Gw=Yn(),_r=ce(),Ble=gi(),Jw=we(),Kle={message:"must NOT have additional properties",params:a(({params:t})=>(0,_r._)`{additionalProperty: ${t.additionalProperty}}`,"params")},Hle={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:Kle,code(t){let{gen:e,schema:n,parentSchema:i,data:r,errsCount:o,it:s}=t;if(!o)throw new Error("ajv implementation error");let{allErrors:c,opts:u}=s;if(s.props=!0,u.removeAdditional!=="all"&&(0,Jw.alwaysValidSchema)(s,n))return;let l=(0,Gw.allSchemaProperties)(i.properties),d=(0,Gw.allSchemaProperties)(i.patternProperties);f(),t.ok((0,_r._)`${o} === ${Ble.default.errors}`);function f(){e.forIn("key",r,v=>{!l.length&&!d.length?g(v):e.if(p(v),()=>g(v))})}a(f,"checkAdditionalProperties");function p(v){let w;if(l.length>8){let b=(0,Jw.schemaRefOrVal)(s,i.properties,"properties");w=(0,Gw.isOwnProperty)(e,b,v)}else l.length?w=(0,_r.or)(...l.map(b=>(0,_r._)`${v} === ${b}`)):w=_r.nil;return d.length&&(w=(0,_r.or)(w,...d.map(b=>(0,_r._)`${(0,Gw.usePattern)(t,b)}.test(${v})`))),(0,_r.not)(w)}a(p,"isAdditional");function m(v){e.code((0,_r._)`delete ${r}[${v}]`)}a(m,"deleteAdditional");function g(v){if(u.removeAdditional==="all"||u.removeAdditional&&n===!1){m(v);return}if(n===!1){t.setParams({additionalProperty:v}),t.error(),c||e.break();return}if(typeof n=="object"&&!(0,Jw.alwaysValidSchema)(s,n)){let w=e.name("valid");u.removeAdditional==="failing"?(y(v,w,!1),e.if((0,_r.not)(w),()=>{t.reset(),m(v)})):(y(v,w),c||e.if((0,_r.not)(w),()=>e.break()))}}a(g,"additionalPropertyCode");function y(v,w,b){let $={keyword:"additionalProperties",dataProp:v,dataPropType:Jw.Type.Str};b===!1&&Object.assign($,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema($,w)}a(y,"applyAdditionalSchema")}};fC.default=Hle});var tZ=I(hC=>{"use strict";Object.defineProperty(hC,"__esModule",{value:!0});var Wle=jp(),Q6=Yn(),mC=we(),eZ=pC(),Gle={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:n,parentSchema:i,data:r,it:o}=t;o.opts.removeAdditional==="all"&&i.additionalProperties===void 0&&eZ.default.code(new Wle.KeywordCxt(o,eZ.default,"additionalProperties"));let s=(0,Q6.allSchemaProperties)(n);for(let f of s)o.definedProperties.add(f);o.opts.unevaluated&&s.length&&o.props!==!0&&(o.props=mC.mergeEvaluated.props(e,(0,mC.toHash)(s),o.props));let c=s.filter(f=>!(0,mC.alwaysValidSchema)(o,n[f]));if(c.length===0)return;let u=e.name("valid");for(let f of c)l(f)?d(f):(e.if((0,Q6.propertyInData)(e,r,f,o.opts.ownProperties)),d(f),o.allErrors||e.else().var(u,!0),e.endIf()),t.it.definedProperties.add(f),t.ok(u);function l(f){return o.opts.useDefaults&&!o.compositeRule&&n[f].default!==void 0}a(l,"hasDefault");function d(f){t.subschema({keyword:"properties",schemaProp:f,dataProp:f},u)}a(d,"applyPropertySchema")}};hC.default=Gle});var oZ=I(gC=>{"use strict";Object.defineProperty(gC,"__esModule",{value:!0});var nZ=Yn(),Yw=ce(),rZ=we(),iZ=we(),Jle={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:n,data:i,parentSchema:r,it:o}=t,{opts:s}=o,c=(0,nZ.allSchemaProperties)(n),u=c.filter(y=>(0,rZ.alwaysValidSchema)(o,n[y]));if(c.length===0||u.length===c.length&&(!o.opts.unevaluated||o.props===!0))return;let l=s.strictSchema&&!s.allowMatchingProperties&&r.properties,d=e.name("valid");o.props!==!0&&!(o.props instanceof Yw.Name)&&(o.props=(0,iZ.evaluatedPropsToName)(e,o.props));let{props:f}=o;p();function p(){for(let y of c)l&&m(y),o.allErrors?g(y):(e.var(d,!0),g(y),e.if(d))}a(p,"validatePatternProperties");function m(y){for(let v in l)new RegExp(y).test(v)&&(0,rZ.checkStrictMode)(o,`property ${v} matches pattern ${y} (use allowMatchingProperties)`)}a(m,"checkMatchingProperties");function g(y){e.forIn("key",i,v=>{e.if((0,Yw._)`${(0,nZ.usePattern)(t,y)}.test(${v})`,()=>{let w=u.includes(y);w||t.subschema({keyword:"patternProperties",schemaProp:y,dataProp:v,dataPropType:iZ.Type.Str},d),o.opts.unevaluated&&f!==!0?e.assign((0,Yw._)`${f}[${v}]`,!0):!w&&!o.allErrors&&e.if((0,Yw.not)(d),()=>e.break())})})}a(g,"validateProperties")}};gC.default=Jle});var sZ=I(yC=>{"use strict";Object.defineProperty(yC,"__esModule",{value:!0});var Yle=we(),Xle={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:n,it:i}=t;if((0,Yle.alwaysValidSchema)(i,n)){t.fail();return}let r=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},r),t.failResult(r,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};yC.default=Xle});var aZ=I(vC=>{"use strict";Object.defineProperty(vC,"__esModule",{value:!0});var Qle=Yn(),ede={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:Qle.validateUnion,error:{message:"must match a schema in anyOf"}};vC.default=ede});var cZ=I(bC=>{"use strict";Object.defineProperty(bC,"__esModule",{value:!0});var Xw=ce(),tde=we(),nde={message:"must match exactly one schema in oneOf",params:a(({params:t})=>(0,Xw._)`{passingSchemas: ${t.passing}}`,"params")},rde={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:nde,code(t){let{gen:e,schema:n,parentSchema:i,it:r}=t;if(!Array.isArray(n))throw new Error("ajv implementation error");if(r.opts.discriminator&&i.discriminator)return;let o=n,s=e.let("valid",!1),c=e.let("passing",null),u=e.name("_valid");t.setParams({passing:c}),e.block(l),t.result(s,()=>t.reset(),()=>t.error(!0));function l(){o.forEach((d,f)=>{let p;(0,tde.alwaysValidSchema)(r,d)?e.var(u,!0):p=t.subschema({keyword:"oneOf",schemaProp:f,compositeRule:!0},u),f>0&&e.if((0,Xw._)`${u} && ${s}`).assign(s,!1).assign(c,(0,Xw._)`[${c}, ${f}]`).else(),e.if(u,()=>{e.assign(s,!0),e.assign(c,f),p&&t.mergeEvaluated(p,Xw.Name)})})}a(l,"validateOneOf")}};bC.default=rde});var uZ=I(wC=>{"use strict";Object.defineProperty(wC,"__esModule",{value:!0});var ide=we(),ode={keyword:"allOf",schemaType:"array",code(t){let{gen:e,schema:n,it:i}=t;if(!Array.isArray(n))throw new Error("ajv implementation error");let r=e.name("valid");n.forEach((o,s)=>{if((0,ide.alwaysValidSchema)(i,o))return;let c=t.subschema({keyword:"allOf",schemaProp:s},r);t.ok(r),t.mergeEvaluated(c)})}};wC.default=ode});var fZ=I($C=>{"use strict";Object.defineProperty($C,"__esModule",{value:!0});var Qw=ce(),dZ=we(),sde={message:a(({params:t})=>(0,Qw.str)`must match "${t.ifClause}" schema`,"message"),params:a(({params:t})=>(0,Qw._)`{failingKeyword: ${t.ifClause}}`,"params")},ade={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:sde,code(t){let{gen:e,parentSchema:n,it:i}=t;n.then===void 0&&n.else===void 0&&(0,dZ.checkStrictMode)(i,'"if" without "then" and "else" is ignored');let r=lZ(i,"then"),o=lZ(i,"else");if(!r&&!o)return;let s=e.let("valid",!0),c=e.name("_valid");if(u(),t.reset(),r&&o){let d=e.let("ifClause");t.setParams({ifClause:d}),e.if(c,l("then",d),l("else",d))}else r?e.if(c,l("then")):e.if((0,Qw.not)(c),l("else"));t.pass(s,()=>t.error(!0));function u(){let d=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},c);t.mergeEvaluated(d)}a(u,"validateIf");function l(d,f){return()=>{let p=t.subschema({keyword:d},c);e.assign(s,c),t.mergeValidEvaluated(p,s),f?e.assign(f,(0,Qw._)`${d}`):t.setParams({ifClause:d})}}a(l,"validateClause")}};function lZ(t,e){let n=t.schema[e];return n!==void 0&&!(0,dZ.alwaysValidSchema)(t,n)}a(lZ,"hasSchema");$C.default=ade});var pZ=I(_C=>{"use strict";Object.defineProperty(_C,"__esModule",{value:!0});var cde=we(),ude={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:n}){e.if===void 0&&(0,cde.checkStrictMode)(n,`"${t}" without "if" is ignored`)}};_C.default=ude});var mZ=I(kC=>{"use strict";Object.defineProperty(kC,"__esModule",{value:!0});var lde=oC(),dde=V6(),fde=sC(),pde=K6(),mde=H6(),hde=J6(),gde=X6(),yde=pC(),vde=tZ(),bde=oZ(),wde=sZ(),$de=aZ(),_de=cZ(),kde=uZ(),xde=fZ(),Sde=pZ();function Ide(t=!1){let e=[wde.default,$de.default,_de.default,kde.default,xde.default,Sde.default,gde.default,yde.default,hde.default,vde.default,bde.default];return t?e.push(dde.default,pde.default):e.push(lde.default,fde.default),e.push(mde.default),e}a(Ide,"getApplicator");kC.default=Ide});var hZ=I(xC=>{"use strict";Object.defineProperty(xC,"__esModule",{value:!0});var it=ce(),Ede={message:a(({schemaCode:t})=>(0,it.str)`must match format "${t}"`,"message"),params:a(({schemaCode:t})=>(0,it._)`{format: ${t}}`,"params")},Tde={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:Ede,code(t,e){let{gen:n,data:i,$data:r,schema:o,schemaCode:s,it:c}=t,{opts:u,errSchemaPath:l,schemaEnv:d,self:f}=c;if(!u.validateFormats)return;r?p():m();function p(){let g=n.scopeValue("formats",{ref:f.formats,code:u.code.formats}),y=n.const("fDef",(0,it._)`${g}[${s}]`),v=n.let("fType"),w=n.let("format");n.if((0,it._)`typeof ${y} == "object" && !(${y} instanceof RegExp)`,()=>n.assign(v,(0,it._)`${y}.type || "string"`).assign(w,(0,it._)`${y}.validate`),()=>n.assign(v,(0,it._)`"string"`).assign(w,y)),t.fail$data((0,it.or)(b(),$()));function b(){return u.strictSchema===!1?it.nil:(0,it._)`${s} && !${w}`}a(b,"unknownFmt");function $(){let x=d.$async?(0,it._)`(${y}.async ? await ${w}(${i}) : ${w}(${i}))`:(0,it._)`${w}(${i})`,T=(0,it._)`(typeof ${w} == "function" ? ${x} : ${w}.test(${i}))`;return(0,it._)`${w} && ${w} !== true && ${v} === ${e} && !${T}`}a($,"invalidFmt")}a(p,"validate$DataFormat");function m(){let g=f.formats[o];if(!g){b();return}if(g===!0)return;let[y,v,w]=$(g);y===e&&t.pass(x());function b(){if(u.strictSchema===!1){f.logger.warn(T());return}throw new Error(T());function T(){return`unknown format "${o}" ignored in schema at path "${l}"`}}a(b,"unknownFormat");function $(T){let C=T instanceof RegExp?(0,it.regexpCode)(T):u.code.formats?(0,it._)`${u.code.formats}${(0,it.getProperty)(o)}`:void 0,Z=n.scopeValue("formats",{key:o,ref:T,code:C});return typeof T=="object"&&!(T instanceof RegExp)?[T.type||"string",T.validate,(0,it._)`${Z}.validate`]:["string",T,Z]}a($,"getFormat");function x(){if(typeof g=="object"&&!(g instanceof RegExp)&&g.async){if(!d.$async)throw new Error("async format in sync schema");return(0,it._)`await ${w}(${i})`}return typeof v=="function"?(0,it._)`${w}(${i})`:(0,it._)`${w}.test(${i})`}a(x,"validCondition")}a(m,"validateFormat")}};xC.default=Tde});var gZ=I(SC=>{"use strict";Object.defineProperty(SC,"__esModule",{value:!0});var Ade=hZ(),Ode=[Ade.default];SC.default=Ode});var yZ=I(cu=>{"use strict";Object.defineProperty(cu,"__esModule",{value:!0});cu.contentVocabulary=cu.metadataVocabulary=void 0;cu.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];cu.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var bZ=I(IC=>{"use strict";Object.defineProperty(IC,"__esModule",{value:!0});var Nde=I6(),Cde=U6(),Pde=mZ(),Rde=gZ(),vZ=yZ(),jde=[Nde.default,Cde.default,(0,Pde.default)(),Rde.default,vZ.metadataVocabulary,vZ.contentVocabulary];IC.default=jde});var $Z=I(e$=>{"use strict";Object.defineProperty(e$,"__esModule",{value:!0});e$.DiscrError=void 0;var wZ;(function(t){t.Tag="tag",t.Mapping="mapping"})(wZ||(e$.DiscrError=wZ={}))});var kZ=I(TC=>{"use strict";Object.defineProperty(TC,"__esModule",{value:!0});var uu=ce(),EC=$Z(),_Z=jw(),zde=zp(),Dde=we(),Lde={message:a(({params:{discrError:t,tagName:e}})=>t===EC.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,"message"),params:a(({params:{discrError:t,tag:e,tagName:n}})=>(0,uu._)`{error: ${t}, tag: ${n}, tagValue: ${e}}`,"params")},Mde={keyword:"discriminator",type:"object",schemaType:"object",error:Lde,code(t){let{gen:e,data:n,schema:i,parentSchema:r,it:o}=t,{oneOf:s}=r;if(!o.opts.discriminator)throw new Error("discriminator: requires discriminator option");let c=i.propertyName;if(typeof c!="string")throw new Error("discriminator: requires propertyName");if(i.mapping)throw new Error("discriminator: mapping is not supported");if(!s)throw new Error("discriminator: requires oneOf keyword");let u=e.let("valid",!1),l=e.const("tag",(0,uu._)`${n}${(0,uu.getProperty)(c)}`);e.if((0,uu._)`typeof ${l} == "string"`,()=>d(),()=>t.error(!1,{discrError:EC.DiscrError.Tag,tag:l,tagName:c})),t.ok(u);function d(){let m=p();e.if(!1);for(let g in m)e.elseIf((0,uu._)`${l} === ${g}`),e.assign(u,f(m[g]));e.else(),t.error(!1,{discrError:EC.DiscrError.Mapping,tag:l,tagName:c}),e.endIf()}a(d,"validateMapping");function f(m){let g=e.name("valid"),y=t.subschema({keyword:"oneOf",schemaProp:m},g);return t.mergeEvaluated(y,uu.Name),g}a(f,"applyTagSchema");function p(){var m;let g={},y=w(r),v=!0;for(let x=0;x<s.length;x++){let T=s[x];if(T?.$ref&&!(0,Dde.schemaHasRulesButRef)(T,o.self.RULES)){let Z=T.$ref;if(T=_Z.resolveRef.call(o.self,o.schemaEnv.root,o.baseId,Z),T instanceof _Z.SchemaEnv&&(T=T.schema),T===void 0)throw new zde.default(o.opts.uriResolver,o.baseId,Z)}let C=(m=T?.properties)===null||m===void 0?void 0:m[c];if(typeof C!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${c}"`);v=v&&(y||w(T)),b(C,x)}if(!v)throw new Error(`discriminator: "${c}" must be required`);return g;function w({required:x}){return Array.isArray(x)&&x.includes(c)}function b(x,T){if(x.const)$(x.const,T);else if(x.enum)for(let C of x.enum)$(C,T);else throw new Error(`discriminator: "properties/${c}" must have "const" or "enum"`)}function $(x,T){if(typeof x!="string"||x in g)throw new Error(`discriminator: "${c}" values must be unique strings`);g[x]=T}}a(p,"getMapping")}};TC.default=Mde});var xZ=I((IJe,Ude)=>{Ude.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 OC=I((Ve,AC)=>{"use strict";Object.defineProperty(Ve,"__esModule",{value:!0});Ve.MissingRefError=Ve.ValidationError=Ve.CodeGen=Ve.Name=Ve.nil=Ve.stringify=Ve.str=Ve._=Ve.KeywordCxt=Ve.Ajv=void 0;var Fde=w6(),qde=bZ(),Zde=kZ(),SZ=xZ(),Vde=["/properties"],t$="http://json-schema.org/draft-07/schema",lu=class extends Fde.default{static{a(this,"Ajv")}_addVocabularies(){super._addVocabularies(),qde.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(Zde.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(SZ,Vde):SZ;this.addMetaSchema(e,t$,!1),this.refs["http://json-schema.org/schema"]=t$}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(t$)?t$:void 0)}};Ve.Ajv=lu;AC.exports=Ve=lu;AC.exports.Ajv=lu;Object.defineProperty(Ve,"__esModule",{value:!0});Ve.default=lu;var Bde=jp();Object.defineProperty(Ve,"KeywordCxt",{enumerable:!0,get:a(function(){return Bde.KeywordCxt},"get")});var du=ce();Object.defineProperty(Ve,"_",{enumerable:!0,get:a(function(){return du._},"get")});Object.defineProperty(Ve,"str",{enumerable:!0,get:a(function(){return du.str},"get")});Object.defineProperty(Ve,"stringify",{enumerable:!0,get:a(function(){return du.stringify},"get")});Object.defineProperty(Ve,"nil",{enumerable:!0,get:a(function(){return du.nil},"get")});Object.defineProperty(Ve,"Name",{enumerable:!0,get:a(function(){return du.Name},"get")});Object.defineProperty(Ve,"CodeGen",{enumerable:!0,get:a(function(){return du.CodeGen},"get")});var Kde=Pw();Object.defineProperty(Ve,"ValidationError",{enumerable:!0,get:a(function(){return Kde.default},"get")});var Hde=zp();Object.defineProperty(Ve,"MissingRefError",{enumerable:!0,get:a(function(){return Hde.default},"get")})});var PZ=I(Kr=>{"use strict";Object.defineProperty(Kr,"__esModule",{value:!0});Kr.formatNames=Kr.fastFormats=Kr.fullFormats=void 0;function Br(t,e){return{validate:t,compare:e}}a(Br,"fmtDef");Kr.fullFormats={date:Br(AZ,RC),time:Br(CC(!0),jC),"date-time":Br(IZ(!0),NZ),"iso-time":Br(CC(),OZ),"iso-date-time":Br(IZ(),CZ),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:Qde,"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:sfe,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:efe,int32:{type:"number",validate:rfe},int64:{type:"number",validate:ife},float:{type:"number",validate:TZ},double:{type:"number",validate:TZ},password:!0,binary:!0};Kr.fastFormats={...Kr.fullFormats,date:Br(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,RC),time:Br(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,jC),"date-time":Br(/^\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,NZ),"iso-time":Br(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,OZ),"iso-date-time":Br(/^\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,CZ),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};Kr.formatNames=Object.keys(Kr.fullFormats);function Wde(t){return t%4===0&&(t%100!==0||t%400===0)}a(Wde,"isLeapYear");var Gde=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,Jde=[0,31,28,31,30,31,30,31,31,30,31,30,31];function AZ(t){let e=Gde.exec(t);if(!e)return!1;let n=+e[1],i=+e[2],r=+e[3];return i>=1&&i<=12&&r>=1&&r<=(i===2&&Wde(n)?29:Jde[i])}a(AZ,"date");function RC(t,e){if(t&&e)return t>e?1:t<e?-1:0}a(RC,"compareDate");var NC=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function CC(t){return a(function(n){let i=NC.exec(n);if(!i)return!1;let r=+i[1],o=+i[2],s=+i[3],c=i[4],u=i[5]==="-"?-1:1,l=+(i[6]||0),d=+(i[7]||0);if(l>23||d>59||t&&!c)return!1;if(r<=23&&o<=59&&s<60)return!0;let f=o-d*u,p=r-l*u-(f<0?1:0);return(p===23||p===-1)&&(f===59||f===-1)&&s<61},"time")}a(CC,"getTime");function jC(t,e){if(!(t&&e))return;let n=new Date("2020-01-01T"+t).valueOf(),i=new Date("2020-01-01T"+e).valueOf();if(n&&i)return n-i}a(jC,"compareTime");function OZ(t,e){if(!(t&&e))return;let n=NC.exec(t),i=NC.exec(e);if(n&&i)return t=n[1]+n[2]+n[3],e=i[1]+i[2]+i[3],t>e?1:t<e?-1:0}a(OZ,"compareIsoTime");var PC=/t|\s/i;function IZ(t){let e=CC(t);return a(function(i){let r=i.split(PC);return r.length===2&&AZ(r[0])&&e(r[1])},"date_time")}a(IZ,"getDateTime");function NZ(t,e){if(!(t&&e))return;let n=new Date(t).valueOf(),i=new Date(e).valueOf();if(n&&i)return n-i}a(NZ,"compareDateTime");function CZ(t,e){if(!(t&&e))return;let[n,i]=t.split(PC),[r,o]=e.split(PC),s=RC(n,r);if(s!==void 0)return s||jC(i,o)}a(CZ,"compareIsoDateTime");var Yde=/\/|:/,Xde=/^(?:[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 Qde(t){return Yde.test(t)&&Xde.test(t)}a(Qde,"uri");var EZ=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function efe(t){return EZ.lastIndex=0,EZ.test(t)}a(efe,"byte");var tfe=-(2**31),nfe=2**31-1;function rfe(t){return Number.isInteger(t)&&t<=nfe&&t>=tfe}a(rfe,"validateInt32");function ife(t){return Number.isInteger(t)}a(ife,"validateInt64");function TZ(){return!0}a(TZ,"validateNumber");var ofe=/[^\\]\\Z/;function sfe(t){if(ofe.test(t))return!1;try{return new RegExp(t),!0}catch{return!1}}a(sfe,"regex")});var RZ=I(fu=>{"use strict";Object.defineProperty(fu,"__esModule",{value:!0});fu.formatLimitDefinition=void 0;var afe=OC(),kr=ce(),Co=kr.operators,n$={formatMaximum:{okStr:"<=",ok:Co.LTE,fail:Co.GT},formatMinimum:{okStr:">=",ok:Co.GTE,fail:Co.LT},formatExclusiveMaximum:{okStr:"<",ok:Co.LT,fail:Co.GTE},formatExclusiveMinimum:{okStr:">",ok:Co.GT,fail:Co.LTE}},cfe={message:a(({keyword:t,schemaCode:e})=>(0,kr.str)`should be ${n$[t].okStr} ${e}`,"message"),params:a(({keyword:t,schemaCode:e})=>(0,kr._)`{comparison: ${n$[t].okStr}, limit: ${e}}`,"params")};fu.formatLimitDefinition={keyword:Object.keys(n$),type:"string",schemaType:"string",$data:!0,error:cfe,code(t){let{gen:e,data:n,schemaCode:i,keyword:r,it:o}=t,{opts:s,self:c}=o;if(!s.validateFormats)return;let u=new afe.KeywordCxt(o,c.RULES.all.format.definition,"format");u.$data?l():d();function l(){let p=e.scopeValue("formats",{ref:c.formats,code:s.code.formats}),m=e.const("fmt",(0,kr._)`${p}[${u.schemaCode}]`);t.fail$data((0,kr.or)((0,kr._)`typeof ${m} != "object"`,(0,kr._)`${m} instanceof RegExp`,(0,kr._)`typeof ${m}.compare != "function"`,f(m)))}a(l,"validate$DataFormat");function d(){let p=u.schema,m=c.formats[p];if(!m||m===!0)return;if(typeof m!="object"||m instanceof RegExp||typeof m.compare!="function")throw new Error(`"${r}": format "${p}" does not define "compare" function`);let g=e.scopeValue("formats",{key:p,ref:m,code:s.code.formats?(0,kr._)`${s.code.formats}${(0,kr.getProperty)(p)}`:void 0});t.fail$data(f(g))}a(d,"validateFormat");function f(p){return(0,kr._)`${p}.compare(${n}, ${i}) ${n$[r].fail} 0`}a(f,"compareCode")},dependencies:["format"]};var ufe=a(t=>(t.addKeyword(fu.formatLimitDefinition),t),"formatLimitPlugin");fu.default=ufe});var LZ=I((Yp,DZ)=>{"use strict";Object.defineProperty(Yp,"__esModule",{value:!0});var pu=PZ(),lfe=RZ(),zC=ce(),jZ=new zC.Name("fullFormats"),dfe=new zC.Name("fastFormats"),DC=a((t,e={keywords:!0})=>{if(Array.isArray(e))return zZ(t,e,pu.fullFormats,jZ),t;let[n,i]=e.mode==="fast"?[pu.fastFormats,dfe]:[pu.fullFormats,jZ],r=e.formats||pu.formatNames;return zZ(t,r,n,i),e.keywords&&(0,lfe.default)(t),t},"formatsPlugin");DC.get=(t,e="full")=>{let i=(e==="fast"?pu.fastFormats:pu.fullFormats)[t];if(!i)throw new Error(`Unknown format "${t}"`);return i};function zZ(t,e,n,i){var r,o;(r=(o=t.opts.code).formats)!==null&&r!==void 0||(o.formats=(0,zC._)`require("ajv-formats/dist/formats").${i}`);for(let s of e)t.addFormat(s,n[s])}a(zZ,"addFormats");DZ.exports=Yp=DC;Object.defineProperty(Yp,"__esModule",{value:!0});Yp.default=DC});var eV=I(qC=>{"use strict";var YZ=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,wfe=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,XZ=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,$fe=/\\([\u000b\u0020-\u00ff])/g,_fe=/([\\"])/g,QZ=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;qC.format=kfe;qC.parse=xfe;function kfe(t){if(!t||typeof t!="object")throw new TypeError("argument obj is required");var e=t.parameters,n=t.type;if(!n||!QZ.test(n))throw new TypeError("invalid type");var i=n;if(e&&typeof e=="object")for(var r,o=Object.keys(e).sort(),s=0;s<o.length;s++){if(r=o[s],!XZ.test(r))throw new TypeError("invalid parameter name");i+="; "+r+"="+Ife(e[r])}return i}a(kfe,"format");function xfe(t){if(!t)throw new TypeError("argument string is required");var e=typeof t=="object"?Sfe(t):t;if(typeof e!="string")throw new TypeError("argument string is required to be a string");var n=e.indexOf(";"),i=n!==-1?e.slice(0,n).trim():e.trim();if(!QZ.test(i))throw new TypeError("invalid media type");var r=new Efe(i.toLowerCase());if(n!==-1){var o,s,c;for(YZ.lastIndex=n;s=YZ.exec(e);){if(s.index!==n)throw new TypeError("invalid parameter format");n+=s[0].length,o=s[1].toLowerCase(),c=s[2],c.charCodeAt(0)===34&&(c=c.slice(1,-1),c.indexOf("\\")!==-1&&(c=c.replace($fe,"$1"))),r.parameters[o]=c}if(n!==e.length)throw new TypeError("invalid parameter format")}return r}a(xfe,"parse");function Sfe(t){var e;if(typeof t.getHeader=="function"?e=t.getHeader("content-type"):typeof t.headers=="object"&&(e=t.headers&&t.headers["content-type"]),typeof e!="string")throw new TypeError("content-type header is missing from object");return e}a(Sfe,"getcontenttype");function Ife(t){var e=String(t);if(XZ.test(e))return e;if(e.length>0&&!wfe.test(e))throw new TypeError("invalid parameter value");return'"'+e.replace(_fe,"\\$1")+'"'}a(Ife,"qstring");function Efe(t){this.parameters=Object.create(null),this.type=t}a(Efe,"ContentType")});var HV=I((S5e,y$)=>{function UV(t){return Array.isArray(t)?t:[t]}a(UV,"makeArray");var hu=void 0,er="",BC=" ",Xt="\\",Dfe=/[.*+?()[\]{}^$|\\/]/,Lfe=/^\uFEFF? *$/,Mfe=/(?:[^\\]|^)\\$/,Ufe=/^\\!/,Ffe=/^\\#/,qfe=/\r?\n/g,Zfe="//",gu=47,zV=46,Hr="/",FV="node-ignore";typeof Symbol<"u"&&(FV=Symbol.for("node-ignore"));var qV=FV,Vs=a((t,e,n)=>(Object.defineProperty(t,e,{value:n}),n),"define"),ZV=a(()=>!1,"RETURN_FALSE"),Vfe=a(t=>{let{length:e}=t;return t.slice(0,e-e%2)},"cleanRangeBackSlash"),Bfe={alnum:"0-9A-Za-z",alpha:"A-Za-z",blank:" \\t",cntrl:"\\x00-\\x1f\\x7f",digit:"0-9",graph:"!-.0-~",lower:"a-z",print:" -.0-~",punct:"!-.:-@\\[-`{-~",space:" \\t\\n\\r",upper:"A-Z",xdigit:"0-9A-Fa-f"},Kfe="\\]^-[",f$=a(t=>Kfe.indexOf(t)<0?t:Xt+t,"escapeMember"),Hfe="(?!\\/)",Wfe=a((t,e)=>{if(t)return`[^\\/${e}]`;let n=`[${e}]`;return new RegExp(n).test("/")?Hfe+n:n},"classSource"),Gfe=a((t,e)=>{let{length:n}=t,i=e+1,r=er,o=t[i];(o==="!"||o==="^")&&(r="^",i++);let s=er,c=er;for(;;){let u=t[i];if(u===hu)return null;if(u===Xt){let l=t[i+1];if(l===hu)return null;s+=f$(l),c=l,i++}else if(u==="-"&&c&&i+1<n&&t[i+1]!=="]"){i++;let l=t[i];l===Xt&&(l=t[i+=1]),c<=l&&(s+=`-${f$(l)}`),c=er}else if(u==="["&&t[i+1]===":"){let l=i+2,d=l;for(;d<n&&t[d]!=="]";)d++;if(d===n)return null;if(d>l&&t[d-1]===":"){let f=Bfe[t.slice(l,d-1)];if(f===hu)return null;s+=f,c=er,i=d}else s+=f$("["),c="[",i=l-2}else s+=f$(u),c=u;if(i++,t[i]==="]")return{end:i,source:Wfe(r,s)}}},"scanBracket"),Jfe="[]",mu="\0",Yfe=new RegExp(`${mu}(\\d+)${mu}`,"g"),DV="\uE000",Xfe=a(t=>{let e=[],n=a(s=>`${mu}${e.push(s)-1}${mu}`,"hold"),{length:i}=t,r=er,o=0;for(;o<i;){let s=t[o];if(s===Xt){let c=t[o+1];c==="*"||c==="["||c===BC||c===Xt?r+=t.slice(o,o+2):r+=n(Dfe.test(c)?Xt+c:c),o+=2}else if(s===mu)r+=n(`[${mu}]`),o++;else if(s==="["){let c=Gfe(t,o);c===null?(r+=n(Jfe),o=i):(r+=n(c.source),o=c.end+1)}else r+=s,o++}return{source:r,sources:e}},"extractBrackets"),KC=null,Qfe=/\/(?!$)/,epe=[[/^\uFEFF/,()=>er,"\uFEFF"],[/[\r\n]+$/,()=>er],[/((?:\\\\)*?)(\\? +)$/,(t,e,n)=>e+(n.indexOf("\\")===0?BC:er)],[/(\\+?) /g,(t,e)=>{let{length:n}=e;return e.slice(0,n-n%2)+BC}],[/[\\$.|*+(){^]/g,t=>`\\${t}`],[/(?!\\)\?/g,()=>"[^/]","?"],[/^\//,()=>"^",Hr],[/\//g,()=>"\\/",Hr],[/^\^*(?:\\\*\\\*\\\/)+/,()=>"^(?:.*\\/)?","*"],[KC,(t,e)=>!t||t[0]==="^"?t:(Qfe.test(e)?"^":"(?:^|\\/)")+t],[/\\\/\\\*\\\*(?=\\\/|$)/g,(t,e,n)=>e+6<n.length?n.slice(e+6)==="\\/"?"(?:\\/[^\\/]+)+":"(?:\\/[^\\/]+)*":"\\/.+","*"],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(t,e,n)=>{let i=n.replace(/\\\*/g,"[^\\/]*");return e+i},"*"],[/(^|[^\\])((?:\\\\)*)\\\*$/,(t,e,n)=>n.length/2%2===0?e+n+DV:t,"*"],[/\\\\\\(?=[$.|*+(){^])/g,()=>Xt,Xt+Xt],[/\\\\/g,()=>Xt,Xt+Xt],[/\\\[([^\]/]*?)(\\*)($|\])/g,(t,e,n,i)=>`\\[${e}${Vfe(n)}${i}`,"["],[KC,t=>{let e=t[t.length-1];return!e||e===DV?t:e===Hr?`${t}$`:`${t}(?=$|\\/$)`}]],tpe=/(^|\\\/)?\uE000$/,m$="regex",h$="checkRegex",LV="_",npe={[m$](t,e){return`${e?`${e}[^/]+`:"[^/]*"}(?=$|\\/$)`},[h$](t,e){return`${e?`${e}[^/]*`:"[^/]*"}(?=$|\\/$)`}},p$="[^\\/]*",rpe=a(t=>{if(t.indexOf(p$)<0)return t;let e=[],{length:n}=t,i=0;for(;i<n;){let c=t[i];if(t.startsWith(p$,i))e.push({wildcard:!0}),i+=p$.length;else if(c==="["){let u=i+1;for(t[u]==="^"&&u++,t[u]==="]"&&u++;u<n&&t[u]!=="]";)u+=t[u]===Xt?2:1;u++,e.push({single:t.slice(i,u)}),i=u}else if(c===Xt)e.push({single:t.slice(i,i+2)}),i+=2;else if(c==="("){let u=0,l=i;do t[l]===Xt?l++:t[l]==="("?u++:t[l]===")"&&u--,l++;while(l<n&&u>0);"*+?".indexOf(t[l])>=0&&l++,e.push({boundary:t.slice(i,l)}),i=l}else c==="^"||c==="$"?(e.push({boundary:c}),i++):(e.push({single:c}),i++)}let r=er,o=[],s=a(()=>{let c;o.forEach((u,l)=>{u.wildcard&&(c=l)}),o.forEach((u,l)=>{if(!u.wildcard){r+=u.single;return}r+=l===c?p$:`(?:(?!${o[l+1].single})[^\\/])*`}),o=[]},"flush");return e.forEach(c=>{if(c.boundary===void 0){o.push(c);return}s(),r+=c.boundary}),s(),r},"pinWildcards"),ipe=a(t=>{let{source:e,sources:n}=Xfe(t),i=epe.reduce((r,[o,s,c])=>o===KC?s(r,t):c!==hu&&r.indexOf(c)<0?r:o.test(r)?r.replace(o,s.bind(t)):r,e);return n.length?i.replace(Yfe,(r,o)=>n[o]):i},"makeRegexPrefix"),VV=a(t=>{let e=t.indexOf(Hr);return e<0||e===t.length-1},"matchesBasename"),ope=a(t=>{let e=t.length-1,n=t.lastIndexOf(Hr,t[e]===Hr?e-1:e);return n<0?t:t.slice(n+1)},"basenameOf"),MV=a(t=>{if(t.charCodeAt(0)===gu||t.indexOf(Zfe)>=0){let i=t.split(Hr).filter(Boolean);return i.pop(),i.length?i.join(Hr)+Hr:er}let e=t.length-1,n=t.lastIndexOf(Hr,t.charCodeAt(e)===gu?e-1:e);return n<0?er:t.slice(0,n+1)},"parentOf"),g$=a(t=>typeof t=="string","isString"),spe=a(t=>t&&g$(t)&&!Lfe.test(t)&&!Mfe.test(t)&&t.indexOf("#")!==0,"checkPattern"),ape=a(t=>t.split(qfe).filter(Boolean),"splitPattern"),HC=class{static{a(this,"IgnoreRule")}constructor(e,n,i,r,o,s){this.pattern=e,this.mark=n,this.negative=o,Vs(this,"body",i),Vs(this,"ignoreCase",r),Vs(this,"regexPrefix",s)}get _basenameOnly(){return Vs(this,"_basenameOnly",VV(this.body))}get regex(){let e=LV+m$;return this[e]?this[e]:this._make(m$,e)}get checkRegex(){let e=LV+h$;return this[e]?this[e]:this._make(h$,e)}_make(e,n){let i=rpe(this.regexPrefix.replace(tpe,npe[e])),r=this.ignoreCase?new RegExp(i,"i"):new RegExp(i);return Vs(this,n,r)}},cpe=a(({pattern:t,mark:e},n)=>{let i=!1,r=t;r.indexOf("!")===0&&(i=!0,r=r.substr(1)),r=r.replace(Ufe,"!").replace(Ffe,"#");let o=ipe(r);return new HC(t,e,r,n,i,o)},"createRule"),WC=class{static{a(this,"RuleManager")}constructor(e){this._ignoreCase=e,this._rules=[],this._basenameCount=0}_add(e){if(e&&e[qV]){this._rules=this._rules.concat(e._rules._rules),this._basenameCount+=e._rules._basenameCount,this._added=!0;return}if(g$(e)&&(e={pattern:e}),spe(e.pattern)){let n=cpe(e,this._ignoreCase);this._added=!0,this._rules.push(n),VV(n.body)&&this._basenameCount++}}add(e){return this._added=!1,UV(g$(e)?ape(e):e).forEach(this._add,this),this._added}test(e,n,i){let r=!1,o=!1,s,c=this._rules,{length:u}=c,l=this._basenameCount*2>=u,d=l?ope(e):e;for(let p=0;p<u;p++){let m=c[p],{negative:g}=m;!(o===g&&r!==o||g&&!r&&!o&&!n)&&m[i].test(l&&m._basenameOnly?d:e)&&(r=!g,o=g,s=g?hu:m)}let f={ignored:r,unignored:o};return s&&(f.rule=s),f}},upe=a((t,e)=>{throw new e(t)},"throwError"),vi=a((t,e,n)=>g$(t)?t?vi.isNotRelative(t)?n(`path should be a \`path.relative()\`d string, but got "${e}"`,RangeError):!0:n("path must not be empty",TypeError):n(`path must be a string, but got \`${e}\``,TypeError),"checkPath"),BV=a(t=>{let e=t.charCodeAt(0);if(e===gu)return!0;if(e!==zV)return!1;if(t.length===1)return!0;let n=t.charCodeAt(1);return n===gu?!0:n!==zV?!1:t.length===2||t.charCodeAt(2)===gu},"isNotRelative");vi.isNotRelative=BV;vi.convert=t=>t;var GC=class{static{a(this,"Ignore")}constructor({ignorecase:e=!0,ignoreCase:n=e,allowRelativePaths:i=!1}={}){Vs(this,qV,!0),this._rules=new WC(n),this._strictPathCheck=!i,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}add(e){return this._rules.add(e)&&this._initCache(),this}addPattern(e){return this.add(e)}_test(e,n,i){let r=e&&vi.convert(e);return vi(r,e,this._strictPathCheck?upe:ZV),this._t(r,n,i)}checkIgnore(e){if(e.charCodeAt(e.length-1)!==gu)return this.test(e);let n=MV(e);if(n){let i=this._t(n,this._testCache,!0);if(i.ignored)return i}return this._rules.test(e,!1,h$)}_t(e,n,i){if(e in n)return n[e];let r=MV(e),o=r?this._t(r,n,i):hu;return n[e]=o&&o.ignored?o:this._rules.test(e,i,m$)}ignores(e){return this._test(e,this._ignoreCache,!1).ignored}createFilter(){return e=>!this.ignores(e)}filter(e){return UV(e).filter(this.createFilter())}test(e){return this._test(e,this._testCache,!0)}},JC=a(t=>new GC(t),"factory"),lpe=a(t=>vi(t&&vi.convert(t),t,ZV),"isPathValid"),KV=a(()=>{let t=a(n=>/^\\\\\?\\/.test(n)||/["<>|\u0000-\u001F]+/u.test(n)?n:n.replace(/\\/g,"/"),"makePosix");vi.convert=t;let e=/^[a-z]:\//i;vi.isNotRelative=n=>e.test(n)||BV(n)},"setupWindows");typeof process<"u"&&process.platform==="win32"&&KV();y$.exports=JC;JC.default=JC;y$.exports.isPathValid=lpe;Vs(y$.exports,Symbol.for("setupWindows"),KV)});var tge={};Tr(tge,{USAGE:()=>UP,main:()=>Fhe,renderTools:()=>MK,run:()=>qP});module.exports=KK(tge);var KP=require("node:child_process"),rr=require("node:fs"),HP=require("node:os"),Tu=require("node:path");var na="tacticyl",Ei=class extends Error{static{a(this,"KeychainUnavailableError")}name="KeychainUnavailableError"},HK=a((t,e,n)=>new Promise(i=>{let r;try{r=(0,KP.spawn)(t,[...e],{stdio:["pipe","pipe","pipe"]})}catch(c){i({code:127,stdout:"",stderr:String(c)});return}let o="",s="";r.stdout.on("data",c=>o+=c.toString("utf8")),r.stderr.on("data",c=>s+=c.toString("utf8")),r.on("error",c=>i({code:127,stdout:o,stderr:c.message})),r.on("close",c=>i({code:c??0,stdout:o,stderr:s})),n!==void 0?r.stdin.end(n,"utf8"):r.stdin.end()}),"runCommand");function WK(t){let e=a(n=>["service",na,"account",n],"attributes");return{name:"secret-tool",kind:"keychain",where:"the OS keychain via secret-tool (Secret Service)",async read(n){let i=await t("secret-tool",["lookup",...e(n)]);if(i.code===0)return i.stdout.length===0?void 0:i.stdout;if(i.stderr.trim().length!==0)throw new Ei(i.stderr.trim())},async write(n,i){let r=await t("secret-tool",["store","--label",`tacticyl ${n}`,...e(n)],i);if(r.code!==0)throw new Ei(r.stderr.trim()||"secret-tool store failed.")},async erase(n){await t("secret-tool",["clear",...e(n)])}}}a(WK,"secretToolStore");var B$=44;function GK(t){let e=a(n=>["-s",na,"-a",n],"item");return{name:"security",kind:"keychain",where:"the macOS login Keychain via security",async read(n){let i=await t("security",["find-generic-password",...e(n),"-w"]);if(i.code===0)return i.stdout.replace(/\r?\n$/,"");if(!(i.code===B$||/could not be found/i.test(i.stderr)))throw new Ei(i.stderr.trim()||"security find failed.")},async write(n,i){let r=await t("security",["add-generic-password","-U",...e(n),"-D","tacticyl companion token","-w",i]);if(r.code!==0)throw new Ei(r.stderr.trim()||"security add failed.")},async erase(n){await t("security",["delete-generic-password",...e(n)])}}}a(GK,"securityStore");function Jr(t){return`'${t.replace(/'/g,"''")}'`}a(Jr,"psQuote");function JK(t){let e=a(i=>t("powershell",["-NoProfile","-NonInteractive","-Command","-"],`${i}
|
|
148
|
+
`),"shell"),n=`$ErrorActionPreference = 'Stop'
|
|
149
|
+
[void][Windows.Security.Credentials.PasswordVault,Windows.Security.Credentials,ContentType=WindowsRuntime]
|
|
150
|
+
$vault = New-Object Windows.Security.Credentials.PasswordVault
|
|
151
|
+
`;return{name:"credential-manager",kind:"keychain",where:"Windows Credential Manager via PasswordVault",async read(i){let r=await e(`${n}try { $c = $vault.Retrieve(${Jr(na)}, ${Jr(i)}); $c.RetrievePassword(); [Console]::Out.Write($c.Password) } catch { exit ${String(B$)} }`);if(r.code===0)return r.stdout.length===0?void 0:r.stdout;if(r.code!==B$)throw new Ei(r.stderr.trim()||"PasswordVault would not answer.")},async write(i,r){let o=await e(`${n}try { $vault.Remove($vault.Retrieve(${Jr(na)}, ${Jr(i)})) } catch { }
|
|
152
|
+
$vault.Add((New-Object Windows.Security.Credentials.PasswordCredential(${Jr(na)}, ${Jr(i)}, ${Jr(r)})))`);if(o.code!==0)throw new Ei(o.stderr.trim()||"PasswordVault would not store.")},async erase(i){await e(`${n}try { $vault.Remove($vault.Retrieve(${Jr(na)}, ${Jr(i)})) } catch { }`)}}}a(JK,"credentialManagerStore");function YK(t=process.env){let e=t.TACTICYL_CREDENTIALS_FILE;return e!==void 0&&e.length>0?e:(0,Tu.join)(t.HOME??t.USERPROFILE??(0,HP.homedir)(),".tacticyl","credentials.json")}a(YK,"credentialsFilePath");var XK={"no-keyring":{warning:"No keyring service is running on this machine. You can install or start gnome-keyring or KWallet and run `tacticyl login` again to move this sign-in to the keychain."},"keychain-unreachable":{warning:"The keychain could not be reached this time, and this sign-in is saved to a file instead. You can run `tacticyl login` again later to retry the keychain."},"chosen-file":{note:"This sign-in is saved to the file set by TACTICYL_CREDENTIALS_FILE. No action is needed."},"turned-off":{note:"The keychain is turned off, and this sign-in is saved to a file instead. No action is needed."},"unsupported-platform":{note:"This operating system has no supported keychain. This sign-in is saved to a file that only your account can read."}};function mm(t,e){let n=a(()=>{try{let r=JSON.parse((0,rr.readFileSync)(t,"utf8"));if(typeof r!="object"||r===null||Array.isArray(r))return{};let o={};for(let[s,c]of Object.entries(r))typeof c=="string"&&(o[s]=c);return o}catch{return{}}},"read"),i=a(r=>{(0,rr.mkdirSync)((0,Tu.dirname)(t),{recursive:!0,mode:448});try{(0,rr.chmodSync)((0,Tu.dirname)(t),448)}catch{}(0,rr.writeFileSync)(t,`${JSON.stringify(r,null,2)}
|
|
153
|
+
`,{encoding:"utf8",mode:384});try{(0,rr.chmodSync)(t,384)}catch{}},"write");return{name:"file",kind:"file",where:`${t} (0600)`,...XK[e],read(r){return Promise.resolve(n()[r])},write(r,o){return i({...n(),[r]:o}),Promise.resolve()},erase(r){let o=n();return o[r]===void 0||(delete o[r],Object.keys(o).length===0?(0,rr.rmSync)(t,{force:!0}):i(o)),Promise.resolve()}}}a(mm,"fileStore");function QK(t,e){if(t==="linux")return WK(e);if(t==="darwin")return GK(e);if(t==="win32")return JK(e)}a(QK,"backendFor");async function WP(t={}){let e=t.platform??process.platform,n=t.env??process.env,i=YK(n);if(t.forceFile===!0)return mm(i,"turned-off");if((n.TACTICYL_CREDENTIALS_FILE??"").length>0)return mm(i,"chosen-file");let r=QK(e,t.run??HK);if(r===void 0)return mm(i,"unsupported-platform");try{return await r.read("tacticyl://probe"),r}catch{return mm(i,e==="linux"?"no-keyring":"keychain-unreachable")}}a(WP,"openSecretStore");var VD=require("node:fs"),BD=require("node:url");var Au={unknownElement:"xml.unknown-element",unknownAttribute:"xml.unknown-attribute",duplicateElement:"xml.duplicate-element"};var h={};Tr(h,{$brand:()=>c_,$input:()=>Ox,$output:()=>Ax,NEVER:()=>a_,TimePrecision:()=>Dx,ZodAny:()=>WS,ZodArray:()=>XS,ZodBase64:()=>cy,ZodBase64URL:()=>uy,ZodBigInt:()=>Ua,ZodBigIntFormat:()=>fy,ZodBoolean:()=>Ma,ZodCIDRv4:()=>sy,ZodCIDRv6:()=>ay,ZodCUID:()=>Qg,ZodCUID2:()=>ey,ZodCatch:()=>y0,ZodCodec:()=>zl,ZodCompileAsyncError:()=>or,ZodCompileUnsupportedError:()=>he,ZodCreditCard:()=>VS,ZodCustom:()=>Dl,ZodCustomStringFormat:()=>Da,ZodDate:()=>Nl,ZodDefault:()=>d0,ZodDiscriminatedUnion:()=>e0,ZodE164:()=>ly,ZodEmail:()=>Gg,ZodEmoji:()=>Yg,ZodEnum:()=>ja,ZodError:()=>VJ,ZodExactOptional:()=>hy,ZodFile:()=>a0,ZodFirstPartyTypeKind:()=>O0,ZodFunction:()=>E0,ZodGUID:()=>Jg,ZodIPv4:()=>iy,ZodIPv6:()=>oy,ZodISODate:()=>qi,ZodISODateTime:()=>Fi,ZodISODuration:()=>Vi,ZodISOTime:()=>Zi,ZodIntersection:()=>t0,ZodIssueCode:()=>HJ,ZodJWT:()=>dy,ZodKSUID:()=>ry,ZodLazy:()=>x0,ZodLiteral:()=>s0,ZodMAC:()=>ZS,ZodMap:()=>i0,ZodNaN:()=>b0,ZodNanoID:()=>Xg,ZodNever:()=>JS,ZodNonOptional:()=>gy,ZodNull:()=>HS,ZodNullable:()=>l0,ZodNumber:()=>La,ZodNumberFormat:()=>ns,ZodObject:()=>Cl,ZodOptional:()=>rs,ZodPipe:()=>jl,ZodPrefault:()=>p0,ZodPreprocess:()=>w0,ZodPromise:()=>I0,ZodReadonly:()=>$0,ZodRealError:()=>an,ZodRecord:()=>Ra,ZodSet:()=>o0,ZodString:()=>za,ZodStringFormat:()=>ze,ZodSuccess:()=>g0,ZodSymbol:()=>BS,ZodTemplateLiteral:()=>k0,ZodTransform:()=>c0,ZodTuple:()=>n0,ZodType:()=>oe,ZodULID:()=>ty,ZodURL:()=>Al,ZodUUID:()=>Cr,ZodUndefined:()=>KS,ZodUnion:()=>Pl,ZodUnknown:()=>GS,ZodVoid:()=>YS,ZodXID:()=>ny,ZodXor:()=>QS,_ZodString:()=>Wg,_default:()=>f0,_function:()=>pj,any:()=>WR,array:()=>le,base64:()=>OR,base64url:()=>NR,bigint:()=>ZR,boolean:()=>et,catch:()=>v0,check:()=>mj,cidrv4:()=>TR,cidrv6:()=>AR,clone:()=>_e,codec:()=>uj,coerce:()=>N0,compile:()=>Rx,config:()=>Ye,core:()=>ar,creditCard:()=>PR,cuid:()=>wR,cuid2:()=>$R,custom:()=>yy,date:()=>JR,decode:()=>zS,decodeAsync:()=>LS,deepPartial:()=>Sj,describe:()=>hj,discriminatedUnion:()=>Rl,e164:()=>CR,email:()=>lR,emoji:()=>vR,encode:()=>jS,encodeAsync:()=>DS,endsWith:()=>Ia,enum:()=>xt,exactOptional:()=>u0,file:()=>oj,flattenError:()=>Lu,float32:()=>MR,float64:()=>UR,formatError:()=>Mu,fromJSONSchema:()=>kj,function:()=>pj,getDiscriminatedOption:()=>vk,getErrorMap:()=>GJ,globalRegistry:()=>_t,gt:()=>Or,gte:()=>Tn,guid:()=>dR,hash:()=>LR,hex:()=>DR,hostname:()=>zR,httpUrl:()=>yR,includes:()=>xa,input:()=>Ej,instanceof:()=>yj,int:()=>Kg,int32:()=>FR,int64:()=>VR,intersection:()=>Fa,invertCodec:()=>lj,ipv4:()=>SR,ipv6:()=>ER,iso:()=>is,json:()=>bj,jwt:()=>RR,keyof:()=>YR,ksuid:()=>xR,lazy:()=>S0,length:()=>Xo,literal:()=>B,locales:()=>ba,looseObject:()=>kt,looseRecord:()=>tj,lowercase:()=>_a,lt:()=>Ar,lte:()=>En,mac:()=>IR,map:()=>nj,maxLength:()=>Yo,maxSize:()=>Di,memoizer:()=>Ju,meta:()=>gj,mime:()=>Ea,minLength:()=>Yr,minSize:()=>Nr,multipleOf:()=>zi,nan:()=>cj,nanoid:()=>bR,nativeEnum:()=>ij,negative:()=>Tg,never:()=>py,nonnegative:()=>Og,nonoptional:()=>h0,nonpositive:()=>Ag,normalize:()=>Ta,null:()=>Ol,nullable:()=>Tl,nullish:()=>sj,number:()=>ke,object:()=>U,optional:()=>Ce,output:()=>Tj,overwrite:()=>sr,parse:()=>NS,parseAsync:()=>CS,partialRecord:()=>ej,pipe:()=>Hg,positive:()=>Eg,prefault:()=>m0,preprocess:()=>Ll,prettifyError:()=>p_,promise:()=>fj,properties:()=>Cg,property:()=>Ng,readonly:()=>_0,record:()=>Pe,refine:()=>T0,regex:()=>$a,regexes:()=>Rt,registry:()=>rg,safeDecode:()=>US,safeDecodeAsync:()=>qS,safeEncode:()=>MS,safeEncodeAsync:()=>FS,safeParse:()=>PS,safeParseAsync:()=>RS,set:()=>rj,setErrorMap:()=>WJ,size:()=>Jo,slugify:()=>Ca,startsWith:()=>Sa,strictObject:()=>XR,string:()=>E,stringFormat:()=>jR,stringbool:()=>vj,success:()=>aj,superRefine:()=>A0,symbol:()=>KR,templateLiteral:()=>dj,toJSONSchema:()=>es,toLowerCase:()=>Oa,toUpperCase:()=>Na,toZod:()=>Ou,transform:()=>my,treeifyError:()=>f_,trim:()=>Aa,tuple:()=>r0,uint32:()=>qR,uint64:()=>BR,ulid:()=>_R,undefined:()=>HR,union:()=>Oe,unknown:()=>je,uppercase:()=>ka,url:()=>gR,util:()=>N,uuid:()=>fR,uuidv4:()=>pR,uuidv6:()=>mR,uuidv7:()=>hR,validate:()=>wm,validateAsync:()=>$m,void:()=>GR,xid:()=>kR,xor:()=>QR});var ar={};Tr(ar,{$ZodAny:()=>_h,$ZodArray:()=>Eh,$ZodAsyncError:()=>on,$ZodBase64:()=>ch,$ZodBase64URL:()=>lh,$ZodBigInt:()=>Ku,$ZodBigIntFormat:()=>vh,$ZodBoolean:()=>ma,$ZodCIDRv4:()=>oh,$ZodCIDRv6:()=>ah,$ZodCUID:()=>Ym,$ZodCUID2:()=>Xm,$ZodCatch:()=>Bh,$ZodCheck:()=>Re,$ZodCheckBigIntFormat:()=>W_,$ZodCheckEndsWith:()=>sk,$ZodCheckGreaterThan:()=>Rm,$ZodCheckIncludes:()=>ik,$ZodCheckLengthEquals:()=>ek,$ZodCheckLessThan:()=>Pm,$ZodCheckLowerCase:()=>nk,$ZodCheckMaxLength:()=>X_,$ZodCheckMaxSize:()=>G_,$ZodCheckMimeType:()=>ak,$ZodCheckMinLength:()=>Q_,$ZodCheckMinSize:()=>J_,$ZodCheckMultipleOf:()=>K_,$ZodCheckNumberFormat:()=>H_,$ZodCheckOverwrite:()=>ck,$ZodCheckProperty:()=>jm,$ZodCheckRegex:()=>tk,$ZodCheckSizeEquals:()=>Y_,$ZodCheckStartsWith:()=>ok,$ZodCheckStringFormat:()=>fa,$ZodCheckUpperCase:()=>rk,$ZodCodec:()=>ga,$ZodCreditCard:()=>ph,$ZodCustom:()=>Yh,$ZodCustomStringFormat:()=>gh,$ZodCyclicError:()=>eg,$ZodDate:()=>Ih,$ZodDefault:()=>Fh,$ZodDiscriminatedUnion:()=>Oh,$ZodE164:()=>dh,$ZodEmail:()=>Zm,$ZodEmoji:()=>Gm,$ZodEncodeError:()=>Ni,$ZodEnum:()=>jh,$ZodError:()=>Du,$ZodExactOptional:()=>Mh,$ZodFile:()=>Dh,$ZodFunction:()=>Gh,$ZodGUID:()=>Fm,$ZodIPv4:()=>nh,$ZodIPv6:()=>rh,$ZodISODate:()=>mk,$ZodISODateTime:()=>pk,$ZodISODuration:()=>gk,$ZodISOTime:()=>hk,$ZodIntersection:()=>Nh,$ZodJWT:()=>hh,$ZodKSUID:()=>th,$ZodLazy:()=>ya,$ZodLiteral:()=>zh,$ZodMAC:()=>ih,$ZodMap:()=>Ph,$ZodNaN:()=>Kh,$ZodNanoID:()=>Jm,$ZodNever:()=>xh,$ZodNonOptional:()=>Zh,$ZodNull:()=>$h,$ZodNullable:()=>Uh,$ZodNumber:()=>Bu,$ZodNumberFormat:()=>yh,$ZodObject:()=>Th,$ZodObjectJIT:()=>yk,$ZodOptional:()=>Wu,$ZodPipe:()=>Gu,$ZodPrefault:()=>qh,$ZodPreprocess:()=>bk,$ZodPromise:()=>Jh,$ZodReadonly:()=>Hh,$ZodRealError:()=>sn,$ZodRecord:()=>Ch,$ZodRegistry:()=>ng,$ZodSet:()=>Rh,$ZodString:()=>ji,$ZodStringFormat:()=>Te,$ZodSuccess:()=>Vh,$ZodSymbol:()=>bh,$ZodTemplateLiteral:()=>Wh,$ZodTransform:()=>Lh,$ZodTuple:()=>Hu,$ZodType:()=>te,$ZodULID:()=>Qm,$ZodURL:()=>Wm,$ZodUUID:()=>qm,$ZodUndefined:()=>wh,$ZodUnion:()=>ha,$ZodUnknown:()=>kh,$ZodVoid:()=>Sh,$ZodXID:()=>eh,$ZodXor:()=>Ah,$brand:()=>c_,$constructor:()=>_,$input:()=>Ox,$output:()=>Ax,Doc:()=>Bo,INVALID:()=>In,JSONSchema:()=>aR,JSONSchemaGenerator:()=>Zg,NEVER:()=>a_,TimePrecision:()=>Dx,URL_BAD_FORMAT:()=>dk,URL_UNPARSEABLE:()=>fk,ZodCompileAsyncError:()=>or,ZodCompileUnsupportedError:()=>he,_any:()=>$g,_array:()=>qx,_base64:()=>vl,_base64url:()=>bl,_bigint:()=>hg,_boolean:()=>mg,_catch:()=>RJ,_check:()=>eR,_cidrv4:()=>gl,_cidrv6:()=>yl,_coercedBigint:()=>Ux,_coercedBoolean:()=>Mx,_coercedDate:()=>Fx,_coercedNumber:()=>Lx,_coercedString:()=>zx,_creditCard:()=>ag,_cuid:()=>ul,_cuid2:()=>ll,_custom:()=>Rg,_date:()=>Sg,_decode:()=>km,_decodeAsync:()=>Sm,_default:()=>NJ,_discriminatedUnion:()=>bJ,_e164:()=>wl,_email:()=>tl,_emoji:()=>al,_encode:()=>_m,_encodeAsync:()=>xm,_endsWith:()=>Ia,_enum:()=>SJ,_file:()=>Pg,_float32:()=>lg,_float64:()=>dg,_gt:()=>Or,_gte:()=>Tn,_guid:()=>nl,_includes:()=>xa,_int:()=>ug,_int32:()=>fg,_int64:()=>gg,_intersection:()=>wJ,_ipv4:()=>ml,_ipv6:()=>hl,_isoDate:()=>kl,_isoDateTime:()=>_l,_isoDuration:()=>Sl,_isoTime:()=>xl,_jwt:()=>$l,_ksuid:()=>pl,_lazy:()=>LJ,_length:()=>Xo,_literal:()=>EJ,_lowercase:()=>_a,_lt:()=>Ar,_lte:()=>En,_mac:()=>sg,_map:()=>kJ,_max:()=>En,_maxLength:()=>Yo,_maxSize:()=>Di,_mime:()=>Ea,_min:()=>Tn,_minLength:()=>Yr,_minSize:()=>Nr,_multipleOf:()=>zi,_nan:()=>Ig,_nanoid:()=>cl,_nativeEnum:()=>IJ,_negative:()=>Tg,_never:()=>kg,_nonnegative:()=>Og,_nonoptional:()=>CJ,_nonpositive:()=>Ag,_normalize:()=>Ta,_null:()=>wg,_nullable:()=>OJ,_number:()=>cg,_optional:()=>AJ,_overwrite:()=>sr,_parse:()=>ca,_parseAsync:()=>ua,_pipe:()=>jJ,_positive:()=>Eg,_promise:()=>MJ,_properties:()=>Cg,_property:()=>Ng,_readonly:()=>zJ,_record:()=>_J,_refine:()=>jg,_regex:()=>$a,_safeDecode:()=>Em,_safeDecodeAsync:()=>Am,_safeEncode:()=>Im,_safeEncodeAsync:()=>Tm,_safeParse:()=>la,_safeParseAsync:()=>da,_set:()=>xJ,_size:()=>Jo,_slugify:()=>Ca,_startsWith:()=>Sa,_string:()=>og,_stringFormat:()=>Qo,_stringbool:()=>Mg,_success:()=>PJ,_superRefine:()=>zg,_symbol:()=>vg,_templateLiteral:()=>DJ,_toLowerCase:()=>Oa,_toUpperCase:()=>Na,_transform:()=>TJ,_trim:()=>Aa,_tuple:()=>$J,_uint32:()=>pg,_uint64:()=>yg,_ulid:()=>dl,_undefined:()=>bg,_union:()=>yJ,_unknown:()=>_g,_uppercase:()=>ka,_url:()=>wa,_uuid:()=>rl,_uuidv4:()=>il,_uuidv6:()=>ol,_uuidv7:()=>sl,_void:()=>xg,_xid:()=>fl,_xor:()=>vJ,clone:()=>_e,compile:()=>Rx,compileFn:()=>ig,config:()=>Ye,createStandardJSONSchemaMethod:()=>Pa,createToJSONSchemaMethod:()=>Vx,decode:()=>d1,decodeAsync:()=>p1,describe:()=>Dg,encode:()=>l1,encodeAsync:()=>f1,extractDefs:()=>Mi,finalize:()=>Ui,flattenError:()=>Lu,formatError:()=>Mu,getDiscriminatedOption:()=>vk,globalConfig:()=>ht,globalRegistry:()=>_t,handleUnrepresentable:()=>lt,initializeContext:()=>Li,isBackEdge:()=>tg,isRecursiveSchema:()=>kk,isValidBase64:()=>Vu,isValidBase64URL:()=>uh,isValidCIDRv6:()=>sh,isValidCreditCard:()=>fh,isValidIPv6:()=>Zu,isValidJWT:()=>mh,locales:()=>ba,memoizer:()=>Ju,mergeValues:()=>pa,meta:()=>Lg,parse:()=>qo,parseAsync:()=>Zo,parseURLObject:()=>Vm,prettifyError:()=>p_,process:()=>Ae,regexes:()=>Rt,registry:()=>rg,safeDecode:()=>h1,safeDecodeAsync:()=>y1,safeEncode:()=>m1,safeEncodeAsync:()=>g1,safeParse:()=>Ci,safeParseAsync:()=>Pi,standardProps:()=>Um,stripTabAndNewline:()=>Bm,toDotPath:()=>u1,toJSONSchema:()=>es,toZod:()=>Ou,treeifyError:()=>f_,urlHostnameOk:()=>Km,urlProtocolOk:()=>Hm,util:()=>N,validate:()=>wm,validateAsync:()=>$m,version:()=>uk});var N={};Tr(N,{BIGINT_FORMAT_RANGES:()=>e_,CONSTANT_CATCH:()=>vm,Class:()=>H$,NUMBER_FORMAT_RANGES:()=>Q$,aborted:()=>Oi,allowsEval:()=>J$,assert:()=>iH,assertEqual:()=>eH,assertIs:()=>nH,assertNever:()=>rH,assertNotEqual:()=>tH,assignProp:()=>He,attachSchema:()=>ym,base64ToUint8Array:()=>r1,base64urlToUint8Array:()=>hH,cached:()=>oa,captureStackTrace:()=>gm,cleanEnum:()=>mH,cleanRegex:()=>Cu,clone:()=>_e,cloneDef:()=>sH,codePointLength:()=>Fo,constantCatch:()=>o_,createTransparentProxy:()=>fH,defineLazy:()=>W$,defineLazyInternal:()=>ue,esc:()=>tn,escapeRegex:()=>Un,explicitlyAborted:()=>t_,extend:()=>XP,finalizeIssue:()=>rn,floatSafeRemainder:()=>Pu,getElementAtPath:()=>aH,getEnumValues:()=>Nu,getLengthableOrigin:()=>zu,getParsedType:()=>dH,getSizableOrigin:()=>ju,hexToUint8Array:()=>yH,hide:()=>r_,installLazyProp:()=>i_,isObject:()=>Uo,isPlainObject:()=>Mn,issue:()=>aa,joinValues:()=>k,jsonStringifyReplacer:()=>ia,members:()=>n_,merge:()=>e1,mergeDefs:()=>ir,normalizeParams:()=>R,nullish:()=>hm,numKeys:()=>lH,objectClone:()=>oH,omit:()=>YP,optionalKeys:()=>X$,own:()=>Ai,parsedType:()=>O,partial:()=>t1,pick:()=>JP,prefixIssues:()=>nn,primitiveTypes:()=>Y$,promiseAllObject:()=>cH,propertyKeyTypes:()=>Ru,randomString:()=>uH,required:()=>n1,safeExtend:()=>QP,shallowClone:()=>sa,slugify:()=>G$,stringifyPrimitive:()=>A,toZod:()=>Ou,uint8ArrayToBase64:()=>i1,uint8ArrayToBase64url:()=>gH,uint8ArrayToHex:()=>vH,unwrapMessage:()=>ra});function eH(t){return t}a(eH,"assertEqual");function tH(t){return t}a(tH,"assertNotEqual");function Ou(){return t=>t}a(Ou,"toZod");function nH(t){}a(nH,"assertIs");function rH(t){throw new Error("Unexpected value in exhaustive check")}a(rH,"assertNever");function iH(t){}a(iH,"assert");function Nu(t){let e=Object.values(t).filter(i=>typeof i=="number");return Object.entries(t).filter(([i,r])=>e.indexOf(+i)===-1).map(([i,r])=>r)}a(Nu,"getEnumValues");function k(t,e="|"){return t.map(n=>A(n)).join(e)}a(k,"joinValues");function ia(t,e){return typeof e=="bigint"?e.toString():e}a(ia,"jsonStringifyReplacer");function oa(t){return{get value(){{let n=t();return Object.defineProperty(this,"value",{value:n}),n}throw new Error("cached value already set")}}}a(oa,"cached");function hm(t){return t==null}a(hm,"nullish");function Cu(t){let e=t.startsWith("^")?1:0,n=t.endsWith("$")?t.length-1:t.length;return t.slice(e,n)}a(Cu,"cleanRegex");function Pu(t,e){let n=t/e,i=Math.round(n),r=4*Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-i)<r?0:n-i}a(Pu,"floatSafeRemainder");var GP=Symbol("evaluating");function W$(t,e,n){let i;Object.defineProperty(t,e,{get(){if(i!==GP)return i===void 0&&(i=GP,i=n()),i},set(r){Object.defineProperty(t,e,{value:r})},configurable:!0})}a(W$,"defineLazy");function oH(t){return Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))}a(oH,"objectClone");function He(t,e,n){Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0})}a(He,"assignProp");function ir(...t){let e={};for(let n of t){let i=Object.getOwnPropertyDescriptors(n);Object.assign(e,i)}return Object.defineProperties({},e)}a(ir,"mergeDefs");function sH(t){return ir(t._zod.def)}a(sH,"cloneDef");function aH(t,e){return e?e.reduce((n,i)=>n?.[i],t):t}a(aH,"getElementAtPath");function cH(t){let e=Object.keys(t),n=e.map(i=>t[i]);return Promise.all(n).then(i=>{let r={};for(let o=0;o<e.length;o++)r[e[o]]=i[o];return r})}a(cH,"promiseAllObject");function uH(t=10){let e="abcdefghijklmnopqrstuvwxyz",n="";for(let i=0;i<t;i++)n+=e[Math.floor(Math.random()*e.length)];return n}a(uH,"randomString");function tn(t){return JSON.stringify(t)}a(tn,"esc");function G$(t){return t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}a(G$,"slugify");var gm="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function Uo(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}a(Uo,"isObject");var J$=oa(()=>{if(ht.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});function Mn(t){if(Uo(t)===!1)return!1;let e=t.constructor;if(e===void 0||typeof e!="function")return!0;let n=e.prototype;return!(Uo(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}a(Mn,"isPlainObject");function sa(t){return Mn(t)?{...t}:Array.isArray(t)?[...t]:t instanceof Map?new Map(t):t instanceof Set?new Set(t):t}a(sa,"shallowClone");function lH(t){let e=0;for(let n in t)Object.prototype.hasOwnProperty.call(t,n)&&e++;return e}a(lH,"numKeys");var dH=a(t=>{let e=typeof t;switch(e){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(t)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(t)?"array":t===null?"null":t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?"promise":typeof Map<"u"&&t instanceof Map?"map":typeof Set<"u"&&t instanceof Set?"set":typeof Date<"u"&&t instanceof Date?"date":typeof File<"u"&&t instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${e}`)}},"getParsedType"),Ru=new Set(["string","number","symbol"]),Y$=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Un(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(Un,"escapeRegex");function _e(t,e,n){let i=new t._zod.constr(e??t._zod.def);return(!e||n?.parent)&&(i._zod.parent=t),i}a(_e,"clone");function R(t){let e=t;if(!e)return{};if(typeof e=="string")return{error:a(()=>e,"error")};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:a(()=>e.error,"error")}:e}a(R,"normalizeParams");function fH(t){let e;return new Proxy({},{get(n,i,r){return e??(e=t()),Reflect.get(e,i,r)},set(n,i,r,o){return e??(e=t()),Reflect.set(e,i,r,o)},has(n,i){return e??(e=t()),Reflect.has(e,i)},deleteProperty(n,i){return e??(e=t()),Reflect.deleteProperty(e,i)},ownKeys(n){return e??(e=t()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(n,i){return e??(e=t()),Reflect.getOwnPropertyDescriptor(e,i)},defineProperty(n,i,r){return e??(e=t()),Reflect.defineProperty(e,i,r)}})}a(fH,"createTransparentProxy");function A(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}a(A,"stringifyPrimitive");function X$(t){return Object.keys(t).filter(e=>t[e]._zod.optin!==void 0&&t[e]._zod.optout==="optional")}a(X$,"optionalKeys");var Q$={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]},e_={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function JP(t,e){let n=t._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let o=ir(t._zod.def,{get shape(){let s={};for(let c of Reflect.ownKeys(e)){if(!Object.prototype.hasOwnProperty.call(n.shape,c))throw new Error(`Unrecognized key: "${String(c)}"`);e[c]&&He(s,c,n.shape[c])}return He(this,"shape",s),s},checks:[]});return _e(t,o)}a(JP,"pick");function YP(t,e){let n=t._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let o=ir(t._zod.def,{get shape(){let s={...t._zod.def.shape};for(let c of Reflect.ownKeys(e)){if(!Object.prototype.hasOwnProperty.call(n.shape,c))throw new Error(`Unrecognized key: "${String(c)}"`);e[c]&&delete s[c]}return He(this,"shape",s),s},checks:[]});return _e(t,o)}a(YP,"omit");function XP(t,e){if(!Mn(e))throw new Error("Invalid input to extend: expected a plain object");let n=t._zod.def.checks;if(n&&n.length>0){let o=t._zod.def.shape;for(let s of Reflect.ownKeys(e))if(Object.getOwnPropertyDescriptor(o,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let r=ir(t._zod.def,{get shape(){let o={...t._zod.def.shape,...e};return He(this,"shape",o),o}});return _e(t,r)}a(XP,"extend");function QP(t,e){if(!Mn(e))throw new Error("Invalid input to safeExtend: expected a plain object");let n=ir(t._zod.def,{get shape(){let i={...t._zod.def.shape,...e};return He(this,"shape",i),i}});return _e(t,n)}a(QP,"safeExtend");function e1(t,e){if(!e?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(t._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let n=ir(t._zod.def,{get shape(){let i={...t._zod.def.shape,...e._zod.def.shape};return He(this,"shape",i),i},get catchall(){return e._zod.def.catchall},checks:e._zod.def.checks??[]});return _e(t,n)}a(e1,"merge");function t1(t,e,n,i="partial"){let o=e._zod.def.checks;if(o&&o.length>0)throw new Error(`.${i}() cannot be used on object schemas containing refinements`);let c=ir(e._zod.def,{get shape(){let u=e._zod.def.shape,l={...u};if(n)for(let d of Reflect.ownKeys(n)){if(!Object.prototype.hasOwnProperty.call(u,d))throw new Error(`Unrecognized key: "${String(d)}"`);n[d]&&(l[d]=t?new t({type:"optional",innerType:u[d]}):u[d])}else for(let d of Reflect.ownKeys(u))l[d]=t?new t({type:"optional",innerType:u[d]}):u[d];return He(this,"shape",l),l},checks:[]});return _e(e,c)}a(t1,"partial");function n1(t,e,n){let i=ir(e._zod.def,{get shape(){let r=e._zod.def.shape,o={...r};if(n)for(let s of Reflect.ownKeys(n)){if(!Object.prototype.hasOwnProperty.call(o,s))throw new Error(`Unrecognized key: "${String(s)}"`);n[s]&&(o[s]=new t({type:"nonoptional",innerType:r[s]}))}else for(let s of Reflect.ownKeys(r))o[s]=new t({type:"nonoptional",innerType:r[s]});return He(this,"shape",o),o}});return _e(e,i)}a(n1,"required");function Oi(t,e=0){if(t.aborted===!0)return!0;for(let n=e;n<t.issues.length;n++)if(t.issues[n]?.continue!==!0)return!0;return!1}a(Oi,"aborted");function t_(t,e=0){if(t.aborted===!0)return!0;for(let n=e;n<t.issues.length;n++)if(t.issues[n]?.continue===!1)return!0;return!1}a(t_,"explicitlyAborted");function nn(t,e){return e.map(n=>{var i;return(i=n).path??(i.path=[]),n.path.unshift(t),n})}a(nn,"prefixIssues");function ra(t){return typeof t=="string"?t:t?.message}a(ra,"unwrapMessage");function ym(t,e,n){var i;for(let r=e;r<t.length;r++)(i=t[r]).schema??(i.schema=n)}a(ym,"attachSchema");function rn(t,e,n){var i;let r=t.inst?._zod?.traits;r?.has("$ZodType")&&(r.has("$ZodCheck")?(i=t).schema??(i.schema=t.inst):t.schema=t.inst);let o=t.schema!==t.inst?t.schema?._zod.def?.error:void 0,s=t.message?t.message:ra(t.inst?._zod.def?.error?.(t))??ra(o?.(t))??ra(e?.error?.(t))??ra(n.customError?.(t))??ra(n.localeError?.(t))??"Invalid input",{inst:c,schema:u,continue:l,input:d,...f}=t;return f.path??(f.path=[]),f.message=s,e?.reportInput&&(f.input=d),f}a(rn,"finalizeIssue");function ju(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}a(ju,"getSizableOrigin");var pH=/[\uD800-\uDBFF]/;function Fo(t){let e=t.length;if(!pH.test(t))return e;let n=e;for(let i=0;i<e-1;i++)(t.charCodeAt(i)&64512)===55296&&(t.charCodeAt(i+1)&64512)===56320&&(n--,i++);return n}a(Fo,"codePointLength");function zu(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}a(zu,"getLengthableOrigin");function O(t){let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"nan":"number";case"object":{if(t===null)return"null";if(Array.isArray(t))return"array";let n=t;if(n&&Object.getPrototypeOf(n)!==Object.prototype&&"constructor"in n&&n.constructor)return n.constructor.name}}return e}a(O,"parsedType");function aa(...t){let[e,n,i]=t;return typeof e=="string"?{message:e,code:"custom",input:n,inst:i}:{...e}}a(aa,"issue");function mH(t){return Object.entries(t).filter(([e,n])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}a(mH,"cleanEnum");function r1(t){let e=atob(t),n=new Uint8Array(e.length);for(let i=0;i<e.length;i++)n[i]=e.charCodeAt(i);return n}a(r1,"base64ToUint8Array");function i1(t){let e="";for(let n=0;n<t.length;n++)e+=String.fromCharCode(t[n]);return btoa(e)}a(i1,"uint8ArrayToBase64");function hH(t){let e=t.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-e.length%4)%4);return r1(e+n)}a(hH,"base64urlToUint8Array");function gH(t){return i1(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}a(gH,"uint8ArrayToBase64url");function yH(t){let e=t.replace(/^0x/,"");if(e.length%2!==0)throw new Error("Invalid hex string length");let n=new Uint8Array(e.length/2);for(let i=0;i<e.length;i+=2)n[i/2]=Number.parseInt(e.slice(i,i+2),16);return n}a(yH,"hexToUint8Array");function vH(t){return Array.from(t).map(e=>e.toString(16).padStart(2,"0")).join("")}a(vH,"uint8ArrayToHex");var H$=class{static{a(this,"Class")}constructor(...e){}};function n_(t,e){for(let n in e){let i=Object.getOwnPropertyDescriptor(e,n);i.get?Object.defineProperty(t,n,{...i,enumerable:!1}):bH(t,n,i.value)}}a(n_,"members");function Ai(t,e,n,i=!0){return Object.defineProperty(t,e,{configurable:!0,writable:!0,enumerable:i,value:n}),n}a(Ai,"own");function r_(t,e,n){return Ai(t,e,n,!1)}a(r_,"hide");function bH(t,e,n){Object.defineProperty(t,e,{configurable:!0,get(){return this==null?n:Ai(this,e,n.bind(this))},set(i){Ai(this,e,i)}})}a(bH,"defineBound");function wH(t,e){let n=Object.getPrototypeOf(t);return e in n?void 0:n}a(wH,"claim");var K$,Ti=!1,$H={configurable:!0,get(){Ti=!0}};function ue(t,e,n){let i=Object.getPrototypeOf(t._zod);if(e in i&&K$!==t._zod){K$=void 0;return}K$=t._zod,Object.defineProperty(i,e,{configurable:!0,get(){Object.defineProperty(this,e,$H);let r=Ti;Ti=!1;try{let o=n(this);return Ti?delete this[e]:Object.defineProperty(this,e,{configurable:!0,writable:!0,value:o}),Ti=Ti||r,o}catch(o){throw delete this[e],Ti=Ti||r,o}},set(r){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:r})}})}a(ue,"defineLazyInternal");function i_(t,e,n,i){let r=wH(t,e);r&&Object.defineProperty(r,e,{configurable:!0,get(){let o={configurable:!0,writable:!0,enumerable:i,value:void 0};return Object.defineProperty(this,e,o),o.value=n(this),Object.defineProperty(this,e,o),o.value},set(o){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:i,value:o})}})}a(i_,"installLazyProp");var vm="~constantCatch";function o_(t){let e=a(()=>t,"fn");return e[vm]=!0,e}a(o_,"constantCatch");var o1,a_=Object.freeze({status:"aborted"}),s_={value:void 0,enumerable:!1},s1="captureStackTrace"in Error?Error:null;function _H(t){let e=s1;if(e){let n=e.stackTraceLimit;if(typeof n=="number"){try{e.stackTraceLimit=0}catch{return s1=null,new t}try{return new t}finally{e.stackTraceLimit=n}}}return new t}a(_H,"newError");function _(t,e,n,i){let r={};function o(p){this.def=p,this.constr=f,this.traits=new Set}a(o,"Internals"),o.prototype=r;let s=n,c=s&&new WeakSet;function u(p,m){if(!p._zod){s_.value=new o(m);try{Object.defineProperty(p,"_zod",s_)}finally{s_.value=void 0}}if(p._zod.traits.has(t))return;if(p._zod.traits.add(t),e(p,m),c){let y=Object.getPrototypeOf(p),v=p._zod.constr.prototype,w=y;for(;w&&w!==v;)w=Object.getPrototypeOf(w);let b=w??y;c.has(b)||(c.add(b),n_(b,s))}let g=f.prototype;for(let y in g)Object.prototype.hasOwnProperty.call(g,y)&&(y in p||(p[y]=g[y].bind(p)))}a(u,"init");let l=i?.Parent??Object;class d extends l{static{a(this,"Definition")}}Object.defineProperty(d,"name",{value:t});function f(p){let m=i?.Parent?_H(d):this;u(m,p);let g=m._zod.deferred;if(g){for(let v of g)v();m._zod.deferred=void 0}let y=globalThis.__zod_globalConfig?.postProcessor;return y&&y(m),m}return a(f,"_"),Object.defineProperty(f,"init",{value:u}),Object.defineProperty(f,Symbol.hasInstance,{value:a(p=>i?.Parent&&p instanceof i.Parent?!0:p?._zod?.traits?.has(t),"value")}),Object.defineProperty(f,"name",{value:t}),f}a(_,"$constructor");var c_=Symbol("zod_brand"),on=class extends Error{static{a(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Ni=class extends Error{static{a(this,"$ZodEncodeError")}constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}};(o1=globalThis).__zod_globalConfig??(o1.__zod_globalConfig={});var ht=globalThis.__zod_globalConfig;function Ye(t){return t&&Object.assign(ht,t),ht}a(Ye,"config");function kH(){let t=this._zod;return t.message??(t.message=JSON.stringify(t.def,ia,2)),t.message}a(kH,"_getMessage");function xH(t){this._zod.message=t}a(xH,"_setMessage");var SH={get:kH,set:xH,enumerable:!0,configurable:!0},l_={value:void 0,enumerable:!1},d_={value:void 0,enumerable:!1},a1=new WeakSet([Object.prototype,Error.prototype]),c1=a((t,e)=>{t.name="$ZodError",l_.value=t._zod,Object.defineProperty(t,"_zod",l_),d_.value=e,Object.defineProperty(t,"issues",d_),l_.value=void 0,d_.value=void 0,Object.defineProperty(t,"message",SH);let n=Object.getPrototypeOf(t);a1.has(n)||(a1.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let i=a(()=>this.message,"value");return Object.defineProperty(this,"toString",{value:i,configurable:!0,writable:!0}),i},set(i){Object.defineProperty(this,"toString",{value:i,configurable:!0,writable:!0})}}))},"initializer"),Du=_("$ZodError",c1),sn=_("$ZodError",c1,void 0,{Parent:Error});function IH(t,e,n){return Object.prototype.hasOwnProperty.call(t,e)||(e==="__proto__"?Object.defineProperty(t,e,{value:n(),writable:!0,enumerable:!0,configurable:!0}):t[e]=n()),t[e]}a(IH,"node");function Lu(t,e=n=>n.message){let n={},i=[];for(let r of t.issues)r.path.length>0?IH(n,r.path[0],()=>[]).push(e(r)):i.push(e(r));return{formErrors:i,fieldErrors:n}}a(Lu,"flattenError");function Mu(t,e=n=>n.message){let n={_errors:[]},i=a((r,o=[])=>{for(let s of r.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(c=>i({issues:c},[...o,...s.path]));else if(s.code==="invalid_key")i({issues:s.issues},[...o,...s.path]);else if(s.code==="invalid_element")i({issues:s.issues},[...o,...s.path]);else{let c=[...o,...s.path];if(c.length===0)n._errors.push(e(s));else{let u=n,l=0;for(;l<c.length;){let d=c[l],f=l===c.length-1;if(d==="_errors"){f&&u._errors.push(e(s)),l++;continue}Object.prototype.hasOwnProperty.call(u,d)||Object.defineProperty(u,d,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let p=u[d];f&&p._errors.push(e(s)),u=p,l++}}}},"processError");return i(t),n}a(Mu,"formatError");function f_(t,e=n=>n.message){let n={errors:[]},i=a((r,o=[])=>{var s;for(let c of r.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(u=>i({issues:u},[...o,...c.path]));else if(c.code==="invalid_key")i({issues:c.issues},[...o,...c.path]);else if(c.code==="invalid_element")i({issues:c.issues},[...o,...c.path]);else{let u=[...o,...c.path];if(u.length===0){n.errors.push(e(c));continue}let l=n,d=0;for(;d<u.length;){let f=u[d],p=d===u.length-1;typeof f=="string"?(l.properties??(l.properties={}),Object.prototype.hasOwnProperty.call(l.properties,f)||Object.defineProperty(l.properties,f,{value:{errors:[]},enumerable:!0,writable:!0,configurable:!0}),l=l.properties[f]):(l.items??(l.items=[]),(s=l.items)[f]??(s[f]={errors:[]}),l=l.items[f]),p&&l.errors.push(e(c)),d++}}},"processError");return i(t),n}a(f_,"treeifyError");function u1(t){let e=[],n=t.map(i=>typeof i=="object"?i.key:i);for(let i of n)typeof i=="number"?e.push(`[${i}]`):typeof i=="symbol"?e.push(`[${JSON.stringify(String(i))}]`):/[^\w$]/.test(i)?e.push(`[${JSON.stringify(i)}]`):(e.length&&e.push("."),e.push(i));return e.join("")}a(u1,"toDotPath");function p_(t){let e=[],n=[...t.issues].sort((i,r)=>(i.path??[]).length-(r.path??[]).length);for(let i of n)e.push(`\u2716 ${i.message}`),i.path?.length&&e.push(` \u2192 at ${u1(i.path)}`);return e.join(`
|
|
154
|
+
`)}a(p_,"prettifyError");function bm(t,e){return{callee:e?.callee??t,Err:e?.Err}}a(bm,"finalizeParams");var ca=a(t=>{let e=a((n,i,r,o)=>{let s=r?{...r,async:!1}:{async:!1},c=n._zod.run({value:i,issues:[]},s);if(c instanceof Promise)throw new on;if(c.issues.length){let u=new(o?.Err??t)(c.issues.map(l=>rn(l,s,Ye())));throw gm(u,o?.callee??e),u}return c.value},"fn");return e},"_parse"),qo=ca(sn),ua=a(t=>{let e=a(async(n,i,r,o)=>{let s=r?{...r,async:!0}:{async:!0},c=n._zod.run({value:i,issues:[]},s);if(c instanceof Promise&&(c=await c),c.issues.length){let u=new(o?.Err??t)(c.issues.map(l=>rn(l,s,Ye())));throw gm(u,o?.callee??e),u}return c.value},"fn");return e},"_parseAsync"),Zo=ua(sn),la=a(t=>(e,n,i)=>{let r=i?{...i,async:!1}:{async:!1},o=e._zod.run({value:n,issues:[]},r);if(o instanceof Promise)throw new on;return o.issues.length?{success:!1,error:new(t??Du)(o.issues.map(s=>rn(s,r,Ye())))}:{success:!0,data:o.value}},"_safeParse"),Ci=la(sn),da=a(t=>async(e,n,i)=>{let r=i?{...i,async:!0}:{async:!0},o=e._zod.run({value:n,issues:[]},r);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new t(o.issues.map(s=>rn(s,r,Ye())))}:{success:!0,data:o.value}},"_safeParseAsync"),Pi=da(sn),TH=Symbol.for("zod.compile.invalid"),AH=Symbol.for("zod.compile.fallback"),wm=a(((t,e,n)=>{let i=t._zod.bag.validator;return i!==void 0&&i(e)!==TH?!0:OH(t,e,n)}),"validate");function OH(t,e,n){let i=n?{...n,async:!1}:{async:!1},r=t._zod.bag.fallbackRun,o;if(r?(i[AH]=!0,o=r({value:e,issues:[]},i)):o=t._zod.run({value:e,issues:[]},i),o instanceof Promise)throw new on;return o.issues.length===0}a(OH,"validateFallback");var $m=a(async(t,e,n)=>{let i=n?{...n,async:!0}:{async:!0},r=t._zod.run({value:e,issues:[]},i);return r instanceof Promise&&(r=await r),r.issues.length===0},"validateAsync"),_m=a(t=>{let e=ca(t),n=a((i,r,o,s)=>{let c=o?{...o,direction:"backward"}:{direction:"backward"};return e(i,r,c,bm(n,s))},"fn");return n},"_encode"),l1=_m(sn),km=a(t=>{let e=ca(t),n=a((i,r,o,s)=>e(i,r,o,bm(n,s)),"fn");return n},"_decode"),d1=km(sn),xm=a(t=>{let e=ua(t),n=a(async(i,r,o,s)=>{let c=o?{...o,direction:"backward"}:{direction:"backward"};return await e(i,r,c,bm(n,s))},"fn");return n},"_encodeAsync"),f1=xm(sn),Sm=a(t=>{let e=ua(t),n=a(async(i,r,o,s)=>await e(i,r,o,bm(n,s)),"fn");return n},"_decodeAsync"),p1=Sm(sn),Im=a(t=>(e,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return la(t)(e,n,r)},"_safeEncode"),m1=Im(sn),Em=a(t=>(e,n,i)=>la(t)(e,n,i),"_safeDecode"),h1=Em(sn),Tm=a(t=>async(e,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return da(t)(e,n,r)},"_safeEncodeAsync"),g1=Tm(sn),Am=a(t=>async(e,n,i)=>da(t)(e,n,i),"_safeDecodeAsync"),y1=Am(sn);var Rt={};Tr(Rt,{base64:()=>N_,base64url:()=>Om,bigint:()=>L_,boolean:()=>M_,browserEmail:()=>LH,cidrv4:()=>A_,cidrv6:()=>O_,creditCard:()=>Nm,cuid:()=>h_,cuid2:()=>g_,date:()=>R_,datetime:()=>z_,domain:()=>FH,duration:()=>__,e164:()=>P_,email:()=>x_,emoji:()=>S_,extendedDuration:()=>NH,guid:()=>k_,hex:()=>ZH,hostname:()=>UH,html5Email:()=>jH,httpProtocol:()=>C_,idnEmail:()=>DH,integer:()=>Uu,ipv4:()=>I_,ipv6:()=>E_,ksuid:()=>b_,lowercase:()=>q_,mac:()=>T_,md5_base64:()=>BH,md5_base64url:()=>KH,md5_hex:()=>VH,nanoid:()=>w_,nanoidOfLength:()=>$_,null:()=>U_,number:()=>Ri,rfc5322Email:()=>zH,sha1_base64:()=>WH,sha1_base64url:()=>GH,sha1_hex:()=>HH,sha256_base64:()=>YH,sha256_base64url:()=>XH,sha256_hex:()=>JH,sha384_base64:()=>eW,sha384_base64url:()=>tW,sha384_hex:()=>QH,sha512_base64:()=>rW,sha512_base64url:()=>iW,sha512_hex:()=>nW,string:()=>D_,time:()=>j_,ulid:()=>y_,undefined:()=>F_,unicodeEmail:()=>v1,uppercase:()=>Z_,uuid:()=>Vo,uuid4:()=>CH,uuid6:()=>PH,uuid7:()=>RH,xid:()=>v_});var h_=/^[cC][0-9a-z]{6,}$/,g_=/^[0-9a-z]+$/,y_=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,v_=/^[0-9a-vA-V]{20}$/,b_=/^[A-Za-z0-9]{27}$/,w_=/^[a-zA-Z0-9_-]{21}$/;function $_(t){return new RegExp(`^[a-zA-Z0-9_-]{${t}}$`)}a($_,"nanoidOfLength");var __=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,NH=/^[-+]?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)?)??$/,k_=/^([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})$/,Vo=a(t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,"uuid"),CH=Vo(4),PH=Vo(6),RH=Vo(7),x_=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,jH=/^[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])?)*$/,zH=/^(([^<>()\[\]\\.,;:\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,}))$/,v1=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,DH=v1,LH=/^[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])?)*$/,MH="^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function S_(){return new RegExp(MH,"u")}a(S_,"emoji");var I_=/^(?:(?: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])$/,E_=/^(([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}|:))$/,T_=a(t=>{let e=Un(t??":");return new RegExp(`^(?:[0-9A-F]{2}${e}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${e}){5}[0-9a-f]{2}$`)},"mac"),A_=/^((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])$/,O_=/^(([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])$/,N_=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Om=/^[A-Za-z0-9_-]*$/,UH=/^(?=.{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])?)*\.?$/,FH=/^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$/,C_=/^https?$/,P_=/^\+[1-9]\d{6,14}$/,Nm=/^\d(?:[ -]?\d){11,18}$/,b1="(?:(?:\\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 qH(t){return new RegExp(`^${t}$`)}a(qH,"anchor");var R_=qH(b1);function m_(t){let e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof t.precision=="number"?t.precision===-1?`${e}`:t.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${t.precision}}`:t.seconds?`${e}:[0-5]\\d(?:\\.\\d+)?`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}a(m_,"timeSource");function j_(t){return new RegExp(`^${m_(t)}$`)}a(j_,"time");function z_(t){let e=["Z"];t.offset&&e.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let n=`${m_({precision:t.precision,seconds:!0})}(?:${e.join("|")})`,i=t.local?`${n}|${m_({precision:t.precision})}`:n;return new RegExp(`^${b1}T(?:${i})$`)}a(z_,"datetime");var D_=a(t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},"string"),L_=/^-?\d+n?$/,Uu=/^-?\d+$/,Ri=/^-?\d+(?:\.\d+)?$/,M_=/^(?:true|false)$/i,U_=/^null$/i;var F_=/^undefined$/i;var q_=/^[^A-Z]*$/,Z_=/^[^a-z]*$/,ZH=/^[0-9a-fA-F]*$/;function Fu(t,e){return new RegExp(`^[A-Za-z0-9+/]{${t}}${e}$`)}a(Fu,"fixedBase64");function qu(t){return new RegExp(`^[A-Za-z0-9_-]{${t}}$`)}a(qu,"fixedBase64url");var VH=/^[0-9a-fA-F]{32}$/,BH=Fu(22,"=="),KH=qu(22),HH=/^[0-9a-fA-F]{40}$/,WH=Fu(27,"="),GH=qu(27),JH=/^[0-9a-fA-F]{64}$/,YH=Fu(43,"="),XH=qu(43),QH=/^[0-9a-fA-F]{96}$/,eW=Fu(64,""),tW=qu(64),nW=/^[0-9a-fA-F]{128}$/,rW=Fu(86,"=="),iW=qu(86);var Re=_("$ZodCheck",(t,e)=>{var n;t._zod??(t._zod={}),t._zod.def=e,(n=t._zod).onattach??(n.onattach=[])}),V_=a(t=>{let e=t.value;return!hm(e)&&e.size!==void 0},"_whenHasSize"),B_=a(t=>{let e=t.value;return!hm(e)&&e.length!==void 0},"_whenHasLength"),Cm={number:"number",bigint:"bigint",object:"date"},Pm=_("$ZodCheckLessThan",(t,e)=>{Re.init(t,e);let n=Cm[typeof e.value];t._zod.onattach.push(i=>{let r=i._zod.bag,o=(e.inclusive?r.maximum:r.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value<o&&(e.inclusive?r.maximum=e.value:r.exclusiveMaximum=e.value)}),t._zod.check=i=>{(e.inclusive?i.value<=e.value:i.value<e.value)||i.issues.push({origin:Cm[typeof i.value]??n,code:"too_big",maximum:typeof e.value=="object"?e.value.getTime():e.value,input:i.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),Rm=_("$ZodCheckGreaterThan",(t,e)=>{Re.init(t,e);let n=Cm[typeof e.value];t._zod.onattach.push(i=>{let r=i._zod.bag,o=(e.inclusive?r.minimum:r.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>o&&(e.inclusive?r.minimum=e.value:r.exclusiveMinimum=e.value)}),t._zod.check=i=>{(e.inclusive?i.value>=e.value:i.value>e.value)||i.issues.push({origin:Cm[typeof i.value]??n,code:"too_small",minimum:typeof e.value=="object"?e.value.getTime():e.value,input:i.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),K_=_("$ZodCheckMultipleOf",(t,e)=>{Re.init(t,e),t._zod.onattach.push(n=>{var i;(i=n._zod.bag).multipleOf??(i.multipleOf=e.value)}),t._zod.check=n=>{if(typeof n.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?e.value!==BigInt(0)&&n.value%e.value===BigInt(0):Pu(n.value,e.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:e.value,input:n.value,inst:t,continue:!e.abort})}}),H_=_("$ZodCheckNumberFormat",(t,e)=>{Re.init(t,e),e.format=e.format||"float64";let n=e.format?.includes("int"),i=n?"int":"number",[r,o]=Q$[e.format];t._zod.onattach.push(s=>{let c=s._zod.bag;c.format=e.format,c.minimum=r,c.maximum=o,n&&(c.pattern=Uu)}),t._zod.check=s=>{let c=s.value;if(n){if(!Number.isInteger(c)){s.issues.push({expected:i,format:e.format,code:"invalid_type",continue:!1,input:c,inst:t});return}if(!Number.isSafeInteger(c)){c>0?s.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:i,inclusive:!0,continue:!e.abort}):s.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:i,inclusive:!0,continue:!e.abort});return}}c<r&&s.issues.push({origin:"number",input:c,code:"too_small",minimum:r,inclusive:!0,inst:t,continue:!e.abort}),c>o&&s.issues.push({origin:"number",input:c,code:"too_big",maximum:o,inclusive:!0,inst:t,continue:!e.abort})}}),W_=_("$ZodCheckBigIntFormat",(t,e)=>{Re.init(t,e);let[n,i]=e_[e.format];t._zod.onattach.push(r=>{let o=r._zod.bag;o.format=e.format,o.minimum=n,o.maximum=i}),t._zod.check=r=>{let o=r.value;o<n&&r.issues.push({origin:"bigint",input:o,code:"too_small",minimum:n,inclusive:!0,inst:t,continue:!e.abort}),o>i&&r.issues.push({origin:"bigint",input:o,code:"too_big",maximum:i,inclusive:!0,inst:t,continue:!e.abort})}}),G_=_("$ZodCheckMaxSize",(t,e)=>{var n;Re.init(t,e),(n=t._zod.def).when??(n.when=V_),t._zod.onattach.push(i=>{let r=i._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<r&&(i._zod.bag.maximum=e.maximum)}),t._zod.check=i=>{let r=i.value;r.size<=e.maximum||i.issues.push({origin:ju(r),code:"too_big",maximum:e.maximum,inclusive:!0,input:r,inst:t,continue:!e.abort})}}),J_=_("$ZodCheckMinSize",(t,e)=>{var n;Re.init(t,e),(n=t._zod.def).when??(n.when=V_),t._zod.onattach.push(i=>{let r=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>r&&(i._zod.bag.minimum=e.minimum)}),t._zod.check=i=>{let r=i.value;r.size>=e.minimum||i.issues.push({origin:ju(r),code:"too_small",minimum:e.minimum,inclusive:!0,input:r,inst:t,continue:!e.abort})}}),Y_=_("$ZodCheckSizeEquals",(t,e)=>{var n;Re.init(t,e),(n=t._zod.def).when??(n.when=V_),t._zod.onattach.push(i=>{let r=i._zod.bag;r.minimum=e.size,r.maximum=e.size,r.size=e.size}),t._zod.check=i=>{let r=i.value,o=r.size;if(o===e.size)return;let s=o>e.size;i.issues.push({origin:ju(r),...s?{code:"too_big",maximum:e.size}:{code:"too_small",minimum:e.size},inclusive:!0,exact:!0,input:i.value,inst:t,continue:!e.abort})}}),X_=_("$ZodCheckMaxLength",(t,e)=>{var n;Re.init(t,e),(n=t._zod.def).when??(n.when=B_),t._zod.onattach.push(i=>{let r=i._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<r&&(i._zod.bag.maximum=e.maximum)}),t._zod.check=i=>{let r=i.value,o=r.length;if((typeof r=="string"&&o>e.maximum?Fo(r):o)<=e.maximum)return;let c=zu(r);i.issues.push({origin:c,code:"too_big",maximum:e.maximum,inclusive:!0,input:r,inst:t,continue:!e.abort})}}),Q_=_("$ZodCheckMinLength",(t,e)=>{var n;Re.init(t,e),(n=t._zod.def).when??(n.when=B_),t._zod.onattach.push(i=>{let r=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>r&&(i._zod.bag.minimum=e.minimum)}),t._zod.check=i=>{let r=i.value,o=r.length;if((typeof r=="string"&&o>=e.minimum&&o<e.minimum*2?Fo(r):o)>=e.minimum)return;let c=zu(r);i.issues.push({origin:c,code:"too_small",minimum:e.minimum,inclusive:!0,input:r,inst:t,continue:!e.abort})}}),ek=_("$ZodCheckLengthEquals",(t,e)=>{var n;Re.init(t,e),(n=t._zod.def).when??(n.when=B_),t._zod.onattach.push(i=>{let r=i._zod.bag;r.minimum=e.length,r.maximum=e.length,r.length=e.length}),t._zod.check=i=>{let r=i.value,o=r.length,s=typeof r=="string"&&o>=e.length&&o<=e.length*2?Fo(r):o;if(s===e.length)return;let c=zu(r),u=s>e.length;i.issues.push({origin:c,...u?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:i.value,inst:t,continue:!e.abort})}}),fa=_("$ZodCheckStringFormat",(t,e)=>{var n,i;Re.init(t,e),t._zod.onattach.push(r=>{let o=r._zod.bag;o.format=e.format,e.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(e.pattern))}),e.pattern?(n=t._zod).check??(n.check=r=>{e.pattern.lastIndex=0,!e.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:e.format,input:r.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(i=t._zod).check??(i.check=()=>{})}),tk=_("$ZodCheckRegex",(t,e)=>{fa.init(t,e),t._zod.check=n=>{e.pattern.lastIndex=0,!e.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}}),nk=_("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=q_),fa.init(t,e)}),rk=_("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=Z_),fa.init(t,e)}),ik=_("$ZodCheckIncludes",(t,e)=>{Re.init(t,e);let n=Un(e.includes),i=new RegExp(typeof e.position=="number"?`^.{${e.position},}${n}`:n);e.pattern=i,t._zod.onattach.push(r=>{let o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(i)}),t._zod.check=r=>{r.value.includes(e.includes,e.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:r.value,inst:t,continue:!e.abort})}}),ok=_("$ZodCheckStartsWith",(t,e)=>{Re.init(t,e);let n=new RegExp(`^${Un(e.prefix)}.*`);e.pattern??(e.pattern=n),t._zod.onattach.push(i=>{let r=i._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(n)}),t._zod.check=i=>{i.value.startsWith(e.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:i.value,inst:t,continue:!e.abort})}}),sk=_("$ZodCheckEndsWith",(t,e)=>{Re.init(t,e);let n=new RegExp(`.*${Un(e.suffix)}$`);e.pattern??(e.pattern=n),t._zod.onattach.push(i=>{let r=i._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(n)}),t._zod.check=i=>{i.value.endsWith(e.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:i.value,inst:t,continue:!e.abort})}});function w1(t,e,n){t.issues.length&&e.issues.push(...nn(n,t.issues))}a(w1,"handleCheckPropertyResult");var jm=_("$ZodCheckProperty",(t,e)=>{Re.init(t,e),t._zod.check=n=>{let i=e.schema._zod.run({value:n.value[e.property],issues:[]},{});if(i instanceof Promise)return i.then(r=>w1(r,n,e.property));w1(i,n,e.property)}}),ak=_("$ZodCheckMimeType",(t,e)=>{Re.init(t,e);let n=new Set(e.mime);t._zod.onattach.push(i=>{i._zod.bag.mime=e.mime}),t._zod.check=i=>{n.has(i.value.type)||i.issues.push({code:"invalid_value",values:e.mime,input:i.value.type,inst:t,continue:!e.abort})}}),ck=_("$ZodCheckOverwrite",(t,e)=>{Re.init(t,e),t._zod.check=n=>{n.value=e.tx(n.value)}});var Bo=class{static{a(this,"Doc")}constructor(e=[],n={}){this.content=[],this.indent=0,this.args=e,this.closed=n}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let i=e.split(`
|
|
155
|
+
`).filter(s=>s),r=Math.min(...i.map(s=>s.length-s.trimStart().length)),o=i.map(s=>s.slice(r)).map(s=>" ".repeat(this.indent*2)+s);for(let s of o)this.content.push(s)}compile(){let e=Function,n=this?.content??[""];return new e(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
|
|
156
|
+
${n.join(`
|
|
157
|
+
`)}
|
|
158
|
+
};`)(...Object.values(this.closed))}};var uk={major:4,minor:5,patch:4};var te=_("$ZodType",(t,e)=>{var n;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=uk;let i=t._zod.def.checks,r=t._zod.traits.has("$ZodCheck")?[t,...i??[]]:i?.length?[...i]:[];for(let o of r)for(let s of o._zod.onattach)s(t);if(r.length===0)(n=t._zod).deferred??(n.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{let o=a((c,u,l)=>{if(c.memo)return c;let d=Oi(c),f;for(let p of u){if(p._zod.def.when){if(t_(c)||!p._zod.def.when(c))continue}else if(d)continue;let m=c.issues.length,g=p._zod.check(c);if(g instanceof Promise&&l?.async===!1)throw new on;if(f||g instanceof Promise)f=(f??Promise.resolve()).then(async()=>{await g,c.issues.length!==m&&(ym(c.issues,m,t),d||(d=Oi(c,m)))});else{if(c.issues.length===m)continue;ym(c.issues,m,t),d||(d=Oi(c,m))}}return f?f.then(()=>c):c},"runChecks"),s=a((c,u,l)=>{if(Oi(c))return c.aborted=!0,c;let d=o(u,r,l);if(d instanceof Promise){if(l.async===!1)throw new on;return d.then(f=>t._zod.parse(f,l))}return t._zod.parse(d,l)},"handleCanaryResult");t._zod.run=(c,u)=>{if(u.skipChecks)return t._zod.parse(c,u);if(u.direction==="backward"){let d=t._zod.parse({value:c.value,issues:[]},{...u,skipChecks:!0});return d instanceof Promise?d.then(f=>s(f,c,u)):s(d,c,u)}let l=t._zod.parse(c,u);if(l instanceof Promise){if(u.async===!1)throw new on;return l.then(d=>o(d,r,u))}return o(l,r,u)}}},{get"~standard"(){return r_(this,"~standard",Um(this))},set"~standard"(t){Ai(this,"~standard",t)}}),_1=a(t=>t.success?{value:t.data}:{issues:t.error?.issues},"toStandardResult");function Um(t){return{validate:a(e=>{try{return _1(Ci(t,e))}catch{return Pi(t,e).then(_1)}},"validate"),vendor:"zod",version:1}}a(Um,"standardProps");var ji=_("$ZodString",(t,e)=>{te.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??D_(t._zod.bag),t._zod.parse=(n,i)=>{if(e.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:t}),n}}),Te=_("$ZodStringFormat",(t,e)=>{fa.init(t,e),ji.init(t,e)}),Fm=_("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=k_),Te.init(t,e)}),qm=_("$ZodUUID",(t,e)=>{if(e.version){let i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(i===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=Vo(i))}else e.pattern??(e.pattern=Vo());Te.init(t,e)}),Zm=_("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=x_),Te.init(t,e)}),dk=1,fk=2;function Vm(t,e){if(!e.normalize&&e.protocol?.source===C_.source&&!/^https?:\/\//i.test(t))return dk;try{return new URL(t)}catch{return fk}}a(Vm,"parseURLObject");var oW=/[\t\n\r]/g;function Bm(t){return t.replace(oW,"")}a(Bm,"stripTabAndNewline");function Km(t,e){return e.lastIndex=0,e.test(t.hostname)}a(Km,"urlHostnameOk");function Hm(t,e){return e.lastIndex=0,e.test(t.protocol.endsWith(":")?t.protocol.slice(0,-1):t.protocol)}a(Hm,"urlProtocolOk");var Wm=_("$ZodURL",(t,e)=>{Te.init(t,e),t._zod.check=n=>{try{let i=n.value.trim(),r=Vm(i,e);if(r===dk){n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:t,continue:!e.abort});return}if(r===fk){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:t,continue:!e.abort});return}e.hostname&&!Km(r,e.hostname)&&n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:n.value,inst:t,continue:!e.abort}),e.protocol&&!Hm(r,e.protocol)&&n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:n.value,inst:t,continue:!e.abort}),n.value=e.normalize?r.href:Bm(i);return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:t,continue:!e.abort})}}}),Gm=_("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=S_()),Te.init(t,e)}),Jm=_("$ZodNanoID",(t,e)=>{if(e.length!==void 0&&(!Number.isInteger(e.length)||e.length<1))throw new Error(`Invalid nanoid length: ${e.length}`);e.pattern??(e.pattern=e.length===void 0?w_:$_(e.length)),Te.init(t,e)}),Ym=_("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=h_),Te.init(t,e)}),Xm=_("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=g_),Te.init(t,e)}),Qm=_("$ZodULID",(t,e)=>{e.pattern??(e.pattern=y_),Te.init(t,e)}),eh=_("$ZodXID",(t,e)=>{e.pattern??(e.pattern=v_),Te.init(t,e)}),th=_("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=b_),Te.init(t,e)}),pk=_("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=z_(e)),Te.init(t,e),(e.local||e.precision===-1)&&(t._zod.bag.laxFormat=!0,t._zod.onattach.push(n=>{n._zod.bag.laxFormat=!0}))}),mk=_("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=R_),Te.init(t,e)}),hk=_("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=j_(e)),Te.init(t,e)}),gk=_("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=__),Te.init(t,e)}),nh=_("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=I_),Te.init(t,e),t._zod.bag.format="ipv4"}),sW=/^[0-9a-fA-F:.]+$/;function Zu(t){if(!sW.test(t))return!1;try{return new URL(`http://[${t}]`),!0}catch{return!1}}a(Zu,"isValidIPv6");var rh=_("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=E_),Te.init(t,e),t._zod.bag.format="ipv6",t._zod.check=n=>{Zu(n.value)||n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:t,continue:!e.abort})}}),ih=_("$ZodMAC",(t,e)=>{e.pattern??(e.pattern=T_(e.delimiter)),Te.init(t,e),t._zod.bag.format="mac"}),oh=_("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=A_),Te.init(t,e)});function sh(t){let e=t.split("/");if(e.length!==2)return!1;let[n,i]=e;if(!i)return!1;let r=Number(i);return`${r}`!==i||r<0||r>128?!1:Zu(n)}a(sh,"isValidCIDRv6");var ah=_("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=O_),Te.init(t,e),t._zod.check=n=>{sh(n.value)||n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:t,continue:!e.abort})}});function Vu(t){if(t==="")return!0;if(/\s/.test(t)||t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}a(Vu,"isValidBase64");var ch=_("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=N_),Te.init(t,e),t._zod.bag.contentEncoding="base64",t._zod.check=n=>{Vu(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:t,continue:!e.abort})}});function uh(t){if(!Om.test(t))return!1;let e=t.replace(/[-_]/g,i=>i==="-"?"+":"/"),n=e.padEnd(Math.ceil(e.length/4)*4,"=");return Vu(n)}a(uh,"isValidBase64URL");var lh=_("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=Om),Te.init(t,e),t._zod.bag.contentEncoding="base64url",t._zod.check=n=>{uh(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:t,continue:!e.abort})}}),dh=_("$ZodE164",(t,e)=>{e.pattern??(e.pattern=P_),Te.init(t,e)}),aW=/[- ]/g;function cW(t){let e=t.length,n=1,i=0;for(;e;){let r=+t[--e];n^=1,i+=n?[0,2,4,6,8,1,3,5,7,9][r]:r}return i%10===0}a(cW,"isLuhnAlgo");function fh(t){return Nm.test(t)?cW(t.replace(aW,"")):!1}a(fh,"isValidCreditCard");var ph=_("$ZodCreditCard",(t,e)=>{e.pattern??(e.pattern=Nm),Te.init(t,e),t._zod.check=n=>{fh(n.value)||n.issues.push({code:"invalid_format",format:"credit_card",input:n.value,inst:t,continue:!e.abort})}});function mh(t,e=null){try{let n=t.split(".");if(n.length!==3)return!1;let[i]=n;if(!i)return!1;let r=JSON.parse(atob(i));return!("typ"in r&&r?.typ!=="JWT"||!r.alg||e&&(!("alg"in r)||r.alg!==e))}catch{return!1}}a(mh,"isValidJWT");var hh=_("$ZodJWT",(t,e)=>{Te.init(t,e),t._zod.check=n=>{mh(n.value,e.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:t,continue:!e.abort})}}),gh=_("$ZodCustomStringFormat",(t,e)=>{Te.init(t,e),t._zod.check=n=>{e.fn(n.value)||n.issues.push({code:"invalid_format",format:e.format,input:n.value,inst:t,continue:!e.abort})}}),Bu=_("$ZodNumber",(t,e)=>{te.init(t,e),t._zod.pattern=t._zod.bag.pattern??Ri,t._zod.parse=(n,i)=>{if(e.coerce)try{n.value=Number(n.value)}catch{}let r=n.value;if(typeof r=="number"&&!Number.isNaN(r)&&Number.isFinite(r))return n;let o=typeof r=="number"?Number.isNaN(r)?"NaN":Number.isFinite(r)?void 0:String(r):void 0;return n.issues.push({expected:"number",code:"invalid_type",input:r,inst:t,...o?{received:o}:{}}),n}}),yh=_("$ZodNumberFormat",(t,e)=>{H_.init(t,e),Bu.init(t,e)}),ma=_("$ZodBoolean",(t,e)=>{te.init(t,e),t._zod.pattern=M_,t._zod.parse=(n,i)=>{if(e.coerce)try{n.value=!!n.value}catch{}let r=n.value;return typeof r=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:r,inst:t}),n}}),Ku=_("$ZodBigInt",(t,e)=>{te.init(t,e),t._zod.pattern=L_,t._zod.parse=(n,i)=>{if(e.coerce)try{n.value=BigInt(n.value)}catch{}return typeof n.value=="bigint"||n.issues.push({expected:"bigint",code:"invalid_type",input:n.value,inst:t}),n}}),vh=_("$ZodBigIntFormat",(t,e)=>{W_.init(t,e),Ku.init(t,e)}),bh=_("$ZodSymbol",(t,e)=>{te.init(t,e),t._zod.parse=(n,i)=>{let r=n.value;return typeof r=="symbol"||n.issues.push({expected:"symbol",code:"invalid_type",input:r,inst:t}),n}}),wh=_("$ZodUndefined",(t,e)=>{te.init(t,e),t._zod.pattern=F_,t._zod.values=new Set([void 0]),t._zod.parse=(n,i)=>{let r=n.value;return typeof r>"u"||n.issues.push({expected:"undefined",code:"invalid_type",input:r,inst:t}),n}}),$h=_("$ZodNull",(t,e)=>{te.init(t,e),t._zod.pattern=U_,t._zod.values=new Set([null]),t._zod.parse=(n,i)=>{let r=n.value;return r===null||n.issues.push({expected:"null",code:"invalid_type",input:r,inst:t}),n}}),_h=_("$ZodAny",(t,e)=>{te.init(t,e),t._zod.parse=n=>n}),kh=_("$ZodUnknown",(t,e)=>{te.init(t,e),t._zod.parse=n=>n}),xh=_("$ZodNever",(t,e)=>{te.init(t,e),t._zod.parse=(n,i)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:t}),n)}),Sh=_("$ZodVoid",(t,e)=>{te.init(t,e),t._zod.parse=(n,i)=>{let r=n.value;return typeof r>"u"||n.issues.push({expected:"void",code:"invalid_type",input:r,inst:t}),n}}),Ih=_("$ZodDate",(t,e)=>{te.init(t,e),t._zod.parse=(n,i)=>{if(e.coerce)try{n.value=new Date(n.value)}catch{}let r=n.value,o=r instanceof Date;return o&&!Number.isNaN(r.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:r,...o?{received:"Invalid Date"}:{},inst:t}),n}});function k1(t,e,n){t.issues.length&&e.issues.push(...nn(n,t.issues)),e.value[n]=t.value}a(k1,"handleArrayResult");var Eh=_("$ZodArray",(t,e)=>{te.init(t,e);let n=ht.memoizer;n?.attach(t),t._zod.parse=(i,r)=>{let o=i.value;if(!Array.isArray(o))return i.issues.push({expected:"array",code:"invalid_type",input:o,inst:t}),i;i.value=n?n.alloc(t,i,Array(o.length),r):Array(o.length);let s=[];for(let c=0;c<o.length;c++){let u=o[c],l=e.element._zod.run({value:u,issues:[]},r);l instanceof Promise?s.push(l.then(d=>k1(d,i,c))):k1(l,i,c)}return s.length?Promise.all(s).then(()=>i):i}});function Mm(t,e,n,i,r,o){let s=n in i,c=o==="optional";if(!(!s&&c&&r==="optional")){if(t.issues.length){if(r!==void 0&&c&&!s)return;e.issues.push(...nn(n,t.issues))}if(!s&&r===void 0){t.issues.length||e.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}t.value===void 0?s&&(e.value[n]=void 0):e.value[n]=t.value}}a(Mm,"handlePropertyResult");var uW=[];function L1(t){let e=Object.keys(t.shape),n=Object.getOwnPropertySymbols(t.shape),i=n.length?n:uW,r=i.length?[...e,...i]:e;for(let s of r)if(!t.shape?.[s]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${String(s)}": expected a Zod schema`);let o=X$(t.shape);return{...t,allKeys:r,symbolKeys:i,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(o)}}a(L1,"normalizeDef");function M1(t,e,n,i,r,o){let s=[],c=r.keySet,u=r.catchall._zod,l=u.def.type,d=u.optin,f=u.optout;for(let p in e){if(c.has(p))continue;if(p==="__proto__"){l==="never"&&s.push(p);continue}if(l==="never"){s.push(p);continue}let m=u.run({value:e[p],issues:[]},i);m instanceof Promise?t.push(m.then(g=>Mm(g,n,p,e,d,f))):Mm(m,n,p,e,d,f)}return s.length&&n.issues.push({code:"unrecognized_keys",keys:s,input:e,inst:o,continue:!0}),t.length?Promise.all(t).then(()=>n):n}a(M1,"handleCatchall");var lk=new WeakMap,Th=_("$ZodObject",(t,e)=>{if(te.init(t,e),!Object.getOwnPropertyDescriptor(e,"shape")?.get){let u=e.shape;lk.set(e,u),Object.defineProperty(e,"shape",{get:a(()=>{let l={...u};return Object.defineProperty(e,"shape",{value:l}),lk.set(e,l),l},"get")})}let i=oa(()=>L1(e));ue(t,"propValues",u=>{let l=u.def.shape,d={};for(let f in l){let p=l[f]._zod;if(p.values){Object.prototype.hasOwnProperty.call(d,f)||He(d,f,new Set);for(let m of p.values)d[f].add(m);p.optin!==void 0&&d[f].add(void 0)}}return d});let r=Uo,o=e.catchall,s,c=ht.memoizer;c?.attach(t),t._zod.parse=(u,l)=>{s??(s=i.value);let d=u.value;if(!r(d))return u.issues.push({expected:"object",code:"invalid_type",input:d,inst:t}),u;u.value=c?c.alloc(t,u,{},l):{};let f=[],p=s.shape;for(let m of s.allKeys){if(m==="__proto__")continue;let g=p[m],y=g._zod.optin,v=g._zod.optout,w=g._zod.run({value:d[m],issues:[]},l);w instanceof Promise?f.push(w.then(b=>Mm(b,u,m,d,y,v))):Mm(w,u,m,d,y,v)}return o?M1(f,d,u,l,i.value,t):f.length?Promise.all(f).then(()=>u):u}}),yk=_("$ZodObjectJIT",(t,e)=>{Th.init(t,e);let n=t._zod.parse,i=oa(()=>L1(e)),r=ht.memoizer,o=a(m=>{let g=i.value,y=g.symbolKeys,v=new Bo(["payload","ctx"],{shape:m,inst:t,memo:r,syms:y}),w=a(T=>`shape[${T}]._zod.run({ value: input[${T}], issues: [] }, ctx)`,"parseStr"),b=a((T,C)=>`
|
|
159
|
+
for (let i = 0; i < ${T}.issues.length; i++) {
|
|
160
|
+
const iss = ${T}.issues[i];
|
|
161
|
+
iss.path = iss.path ? [${C}, ...iss.path] : [${C}];
|
|
162
|
+
payload.issues.push(iss);
|
|
163
|
+
}`,"prefixStr");v.write("const input = payload.value;");let $=Object.create(null),x=0;for(let T of g.allKeys)$[T]=`key_${x++}`;v.write(r?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(let T of g.allKeys){if(T==="__proto__")continue;let C=$[T],Z=typeof T=="symbol"?`syms[${y.indexOf(T)}]`:tn(T),S=`${Z} in input`,G=m[T],me=G?._zod?.optin,Zt=me!==void 0,Fe=G?._zod?.optout==="optional";if(v.write(`const ${C} = ${w(Z)};`),Zt&&Fe){let Sn=me==="optional"?`${C}_present`:`${C}.value !== undefined || ${C}_present`;v.write(`
|
|
164
|
+
const ${C}_present = ${S};
|
|
165
|
+
if (!${C}.issues.length || ${C}_present) {
|
|
166
|
+
if (${C}.issues.length) {${b(C,Z)}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
if (${Sn}) {
|
|
170
|
+
newResult[${Z}] = ${C}.value;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
`)}else Zt?v.write(`
|
|
175
|
+
if (${C}.issues.length) {${b(C,Z)}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
if (${C}.value === undefined) {
|
|
179
|
+
if (${S}) {
|
|
180
|
+
newResult[${Z}] = undefined;
|
|
181
|
+
}
|
|
182
|
+
} else {
|
|
183
|
+
newResult[${Z}] = ${C}.value;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
`):v.write(`
|
|
187
|
+
const ${C}_present = ${S};
|
|
188
|
+
if (${C}.issues.length) {${b(C,Z)}
|
|
189
|
+
}
|
|
190
|
+
if (!${C}_present && !${C}.issues.length) {
|
|
191
|
+
payload.issues.push({
|
|
192
|
+
code: "invalid_type",
|
|
193
|
+
expected: "nonoptional",
|
|
194
|
+
input: undefined,
|
|
195
|
+
path: [${Z}]
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
if (${C}_present) {
|
|
200
|
+
newResult[${Z}] = ${C}.value;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
`)}return v.write("payload.value = newResult;"),v.write("return payload;"),v.compile()},"generateFastpass"),s,c=Uo,u=!ht.jitless,d=u&&J$.value,f=e.catchall,p;t._zod.parse=(m,g)=>{p??(p=i.value);let y=m.value;return c(y)?u&&d&&g?.async===!1&&g.jitless!==!0?(s||(s=o(e.shape)),m=s(m,g),f?M1([],y,m,g,p,t):m):n(m,g):(m.issues.push({expected:"object",code:"invalid_type",input:y,inst:t}),m)}});function x1(t,e,n,i){for(let o of t)if(o.issues.length===0)return e.value=o.value,e;let r=t.filter(o=>!Oi(o));return r.length===1?(e.value=r[0].value,r[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:n,errors:t.map(o=>o.issues.map(s=>rn(s,i,Ye())))}),e)}a(x1,"handleUnionResults");var ha=_("$ZodUnion",(t,e)=>{te.init(t,e),ue(t,"optin",i=>i.def.options.some(r=>r._zod.optin==="defaulted")?"defaulted":i.def.options.some(r=>r._zod.optin!==void 0)?"optional":void 0),ue(t,"optout",i=>i.def.options.some(r=>r._zod.optout==="optional")?"optional":void 0),ue(t,"values",i=>{if(i.def.options.every(r=>r._zod.values))return new Set(i.def.options.flatMap(r=>Array.from(r._zod.values)))}),ue(t,"pattern",i=>{if(i.def.options.every(r=>r._zod.pattern)){let r=i.def.options.map(o=>o._zod.pattern);return new RegExp(`^(${r.map(o=>Cu(o.source)).join("|")})$`)}});let n=e.options.length===1?e.options[0]._zod.run:null;t._zod.parse=(i,r)=>{if(n)return n(i,r);let o=!1,s=[];for(let c of e.options){let u=c._zod.run({value:i.value,issues:[]},r);if(u instanceof Promise)s.push(u),o=!0;else{if(u.issues.length===0)return u;s.push(u)}}return o?Promise.all(s).then(c=>x1(c,i,t,r)):x1(s,i,t,r)}});function S1(t,e,n,i){let r=[];for(let o=0;o<t.length;o++)t[o].issues.length===0&&r.push(o);return r.length===1?(e.value=t[r[0]].value,e):(r.length===0?e.issues.push({code:"invalid_union",input:e.value,inst:n,errors:t.map(o=>o.issues.map(s=>rn(s,i,Ye())))}):e.issues.push({code:"invalid_union",input:e.value,inst:n,errors:[],inclusive:!1,matches:r}),e)}a(S1,"handleExclusiveUnionResults");var Ah=_("$ZodXor",(t,e)=>{ha.init(t,e),e.inclusive=!1;let n=e.options.length===1?e.options[0]._zod.run:null;t._zod.parse=(i,r)=>{if(n)return n(i,r);let o=!1,s=[];for(let c of e.options){let u=c._zod.run({value:i.value,issues:[]},r);u instanceof Promise?(s.push(u),o=!0):s.push(u)}return o?Promise.all(s).then(c=>S1(c,i,t,r)):S1(s,i,t,r)}});function vk(t,e){let n=t._zod,i=n.bag.optionsMap;if(!i){i=new Map;let{options:r,discriminator:o}=n.def;for(let s of r)for(let c of s._zod.propValues?.[o]??[])i.has(c)||i.set(c,s);n.bag.optionsMap=i}return i.get(e)}a(vk,"getDiscriminatedOption");var Oh=_("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,ha.init(t,e);let n=t._zod.parse;ue(t,"propValues",r=>{let o={};for(let s of r.def.options){let c=s._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${r.def.options.indexOf(s)}"`);for(let[u,l]of Object.entries(c)){Object.prototype.hasOwnProperty.call(o,u)||He(o,u,new Set);for(let d of l)o[u].add(d)}}return o}),e.options.forEach((r,o)=>{let s=lk.get(r._zod.def);if(s&&!Object.prototype.hasOwnProperty.call(s,e.discriminator))throw new Error(`Invalid discriminated union option at index "${o}"`)});let i=oa(()=>{let r=e.options,o=new Map;for(let s of r){let c=s._zod.propValues?.[e.discriminator];if(!c||c.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(let u of c){if(o.has(u))throw new Error(`Duplicate discriminator value "${String(u)}"`);o.set(u,s)}}return o});t._zod.parse=(r,o)=>{let s=r.value;if(!Uo(s))return r.issues.push({code:"invalid_type",expected:"object",input:s,inst:t}),r;let c=i.value.get(s?.[e.discriminator]);return c?c._zod.run(r,o):e.unionFallback||o.direction==="backward"?n(r,o):(r.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,options:Array.from(i.value.keys()),input:s,path:[e.discriminator],inst:t}),r)}}),Nh=_("$ZodIntersection",(t,e)=>{te.init(t,e),t._zod.parse=(n,i)=>{let r=n.value,o=e.left._zod.run({value:r,issues:[]},i),s=e.right._zod.run({value:r,issues:[]},i);return o instanceof Promise||s instanceof Promise?Promise.all([o,s]).then(([u,l])=>I1(n,u,l)):I1(n,o,s)}});function pa(t,e){if(t===e)return{valid:!0,data:t};if(t instanceof Date&&e instanceof Date&&+t==+e)return{valid:!0,data:t};if(Mn(t)&&Mn(e)){let n=Object.keys(e),i=Object.keys(t).filter(o=>n.indexOf(o)!==-1),r={...t,...e};Object.prototype.hasOwnProperty.call(r,"__proto__")&&delete r.__proto__;for(let o of i){if(o==="__proto__")continue;let s=pa(t[o],e[o]);if(!s.valid)return{valid:!1,mergeErrorPath:[o,...s.mergeErrorPath]};r[o]=s.data}return{valid:!0,data:r}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let i=0;i<t.length;i++){let r=t[i],o=e[i],s=pa(r,o);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};n.push(s.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}a(pa,"mergeValues");function I1(t,e,n){let i=new Map,r,o=new Map,s=a((l,d)=>{let f;if(l.code==="unrecognized_keys"&&!l.path?.length)r??(r=l),f=l.keys;else if(l.code==="invalid_key"&&l.origin==="record"&&l.path?.length===1){let p=String(l.path[0]);o.has(p)||o.set(p,l),f=[p]}else return!1;for(let p of f)i.has(p)||i.set(p,{}),i.get(p)[d]=!0;return!0},"collect");for(let l of e.issues)s(l,"l")||t.issues.push(l);for(let l of n.issues)s(l,"r")||t.issues.push(l);let c=[...i].filter(([,l])=>l.l&&l.r).map(([l])=>l);if(c.length){let l=r?c.filter(d=>r.keys.includes(d)):[];l.length&&t.issues.push({...r,keys:l});for(let d of c)!l.includes(d)&&o.has(d)&&t.issues.push(o.get(d))}let u=pa(e.value,n.value);if(!u.valid){if(Oi(t))return t;throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(u.mergeErrorPath)}`)}return t.value=u.data,t}a(I1,"handleIntersectionResults");var Hu=_("$ZodTuple",(t,e)=>{te.init(t,e);let n=e.items,i=ht.memoizer;i?.attach(t),t._zod.parse=(r,o)=>{let s=r.value;if(!Array.isArray(s))return r.issues.push({input:s,inst:t,expected:"tuple",code:"invalid_type"}),r;r.value=i?i.alloc(t,r,[],o):[];let c=[],u=E1(n,"optin"),l=E1(n,"optout");if(!e.rest){if(s.length<u)return r.issues.push({code:"too_small",minimum:u,inclusive:!0,input:s,inst:t,origin:"array"}),r;s.length>n.length&&r.issues.push({code:"too_big",maximum:n.length,inclusive:!0,input:s,inst:t,origin:"array"})}let d=new Array(n.length);for(let f=0;f<n.length;f++){let p=n[f]._zod.run({value:s[f],issues:[]},o);p instanceof Promise?c.push(p.then(m=>{d[f]=m})):d[f]=p}if(e.rest){let f=n.length-1,p=s.slice(n.length);for(let m of p){f++;let g=e.rest._zod.run({value:m,issues:[]},o);g instanceof Promise?c.push(g.then(y=>T1(y,r,f))):T1(g,r,f)}}return c.length?Promise.all(c).then(()=>A1(d,r,n,s,l)):A1(d,r,n,s,l)}});function E1(t,e){for(let n=t.length-1;n>=0;n--)if(!(e==="optin"?t[n]._zod.optin!==void 0:t[n]._zod.optout==="optional"))return n+1;return 0}a(E1,"getTupleOptStart");function T1(t,e,n){t.issues.length&&e.issues.push(...nn(n,t.issues)),e.value[n]=t.value}a(T1,"handleTupleResult");function A1(t,e,n,i,r){for(let o=0;o<n.length;o++){let s=t[o],c=o<i.length;if(!c&&o>=r&&n[o]._zod.optin==="optional"){e.value.length=o;break}if(s.issues.length){if(!c&&o>=r){e.value.length=o;break}e.issues.push(...nn(o,s.issues))}e.value[o]=s.value}for(let o=e.value.length-1;o>=i.length&&(n[o]._zod.optout==="optional"&&e.value[o]===void 0);o--)e.value.length=o;return e}a(A1,"handleTupleResults");var Ch=_("$ZodRecord",(t,e)=>{te.init(t,e);let n=ht.memoizer;n?.attach(t),t._zod.parse=(i,r)=>{let o=i.value;if(!Mn(o))return i.issues.push({expected:"record",code:"invalid_type",input:o,inst:t}),i;let s=[],c=e.keyType._zod.values;if(c&&!e.partial){i.value=n?n.alloc(t,i,{},r):{};let u=new Set;for(let d of c)if(typeof d=="string"||typeof d=="number"||typeof d=="symbol"){if(u.add(typeof d=="number"?d.toString():d),d==="__proto__")continue;let f=e.keyType._zod.run({value:d,issues:[]},r);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(f.issues.length){i.issues.push({code:"invalid_key",origin:"record",issues:f.issues.map(g=>rn(g,r,Ye())),input:d,path:[d],inst:t});continue}let p=f.value;if(p==="__proto__")continue;let m=e.valueType._zod.run({value:o[d],issues:[]},r);m instanceof Promise?s.push(m.then(g=>{g.issues.length&&i.issues.push(...nn(d,g.issues)),i.value[p]=g.value})):(m.issues.length&&i.issues.push(...nn(d,m.issues)),i.value[p]=m.value)}let l;for(let d in o)if(!u.has(d))if(e.mode==="loose"){if(d==="__proto__")continue;i.value[d]=o[d]}else l=l??[],l.push(d);l&&l.length>0&&i.issues.push({code:"unrecognized_keys",input:o,inst:t,keys:l,continue:!0})}else{i.value=n?n.alloc(t,i,{},r):{};let u;for(let l of Reflect.ownKeys(o)){if(l==="__proto__"||!Object.prototype.propertyIsEnumerable.call(o,l))continue;let d=e.keyType._zod.run({value:l,issues:[]},r);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&Ri.test(l)&&d.issues.length){let g=e.keyType._zod.run({value:Number(l),issues:[]},r);if(g instanceof Promise)throw new Error("Async schemas not supported in object keys currently");g.issues.length===0&&(d=g)}if(d.issues.length){e.mode==="loose"?i.value[l]=o[l]:c?(u=u??[],u.push(l)):i.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map(g=>rn(g,r,Ye())),input:l,path:[l],inst:t});continue}let p=d.value;if(p==="__proto__")continue;let m=e.valueType._zod.run({value:o[l],issues:[]},r);m instanceof Promise?s.push(m.then(g=>{g.issues.length&&i.issues.push(...nn(l,g.issues)),i.value[p]=g.value})):(m.issues.length&&i.issues.push(...nn(l,m.issues)),i.value[p]=m.value)}u&&u.length>0&&i.issues.push({code:"unrecognized_keys",input:o,inst:t,keys:u,continue:!0})}return s.length?Promise.all(s).then(()=>i):i}}),Ph=_("$ZodMap",(t,e)=>{te.init(t,e);let n=ht.memoizer;n?.attach(t),t._zod.parse=(i,r)=>{let o=i.value;if(!(o instanceof Map))return i.issues.push({expected:"map",code:"invalid_type",input:o,inst:t}),i;let s=[];i.value=n?n.alloc(t,i,new Map,r):new Map;for(let[c,u]of o){let l=e.keyType._zod.run({value:c,issues:[]},r),d=e.valueType._zod.run({value:u,issues:[]},r);l instanceof Promise||d instanceof Promise?s.push(Promise.all([l,d]).then(([f,p])=>{O1(f,p,i,c,o,t,r)})):O1(l,d,i,c,o,t,r)}return s.length?Promise.all(s).then(()=>i):i}});function O1(t,e,n,i,r,o,s){t.issues.length&&(Ru.has(typeof i)?n.issues.push(...nn(i,t.issues)):n.issues.push({code:"invalid_key",origin:"map",input:r,inst:o,issues:t.issues.map(c=>rn(c,s,Ye()))})),e.issues.length&&(Ru.has(typeof i)?n.issues.push(...nn(i,e.issues)):n.issues.push({origin:"map",code:"invalid_element",input:r,inst:o,key:i,issues:e.issues.map(c=>rn(c,s,Ye()))})),n.value.set(t.value,e.value)}a(O1,"handleMapResult");var Rh=_("$ZodSet",(t,e)=>{te.init(t,e);let n=ht.memoizer;n?.attach(t),t._zod.parse=(i,r)=>{let o=i.value;if(!(o instanceof Set))return i.issues.push({input:o,inst:t,expected:"set",code:"invalid_type"}),i;let s=[];i.value=n?n.alloc(t,i,new Set,r):new Set;for(let c of o){let u=e.valueType._zod.run({value:c,issues:[]},r);u instanceof Promise?s.push(u.then(l=>N1(l,i))):N1(u,i)}return s.length?Promise.all(s).then(()=>i):i}});function N1(t,e){t.issues.length&&e.issues.push(...t.issues),e.value.add(t.value)}a(N1,"handleSetResult");var jh=_("$ZodEnum",(t,e)=>{te.init(t,e);let n=Nu(e.entries),i=new Set(n);t._zod.values=i;let r=n.filter(o=>Ru.has(typeof o));t._zod.pattern=new RegExp(r.length?`^(${r.map(o=>Un(o.toString())).join("|")})$`:"^[^\\s\\S]$"),t._zod.parse=(o,s)=>{let c=o.value;return i.has(c)||o.issues.push({code:"invalid_value",values:n,input:c,inst:t}),o}}),zh=_("$ZodLiteral",(t,e)=>{te.init(t,e);let n=new Set(e.values);t._zod.values=n,t._zod.pattern=new RegExp(e.values.length?`^(${e.values.map(i=>typeof i=="string"?Un(i):i?Un(i.toString()):String(i)).join("|")})$`:"^[^\\s\\S]$"),t._zod.parse=(i,r)=>{let o=i.value;return n.has(o)||i.issues.push({code:"invalid_value",values:e.values,input:o,inst:t}),i}}),Dh=_("$ZodFile",(t,e)=>{te.init(t,e),t._zod.parse=(n,i)=>{let r=n.value;return r instanceof File||n.issues.push({expected:"file",code:"invalid_type",input:r,inst:t}),n}}),Lh=_("$ZodTransform",(t,e)=>{te.init(t,e),t._zod.optin="optional",ht.memoizer?.guard(t),t._zod.parse=(n,i)=>{if(i.direction==="backward")throw new Ni(t.constructor.name);let r=e.transform(n.value,n);if(i.async)return(r instanceof Promise?r:Promise.resolve(r)).then(s=>(n.value=s,n));if(r instanceof Promise)throw new on;return n.value=r,n}});function C1(t,e){return t.value=e.issues.length?void 0:e.value,t}a(C1,"handleOptionalResult");var Wu=_("$ZodOptional",(t,e)=>{te.init(t,e),ue(t,"optin",n=>n.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),t._zod.optout="optional",ue(t,"values",n=>{let i=n.def.innerType._zod.values;return i?new Set([...i,void 0]):void 0}),ue(t,"pattern",n=>{let i=n.def.innerType._zod.pattern;return i?new RegExp(`^(${Cu(i.source)})?$`):void 0}),t._zod.parse=(n,i)=>{if(n.value===void 0){if(e.innerType._zod.optin!=="defaulted")return n;let r=e.innerType._zod.run({value:n.value,issues:[]},i);return r instanceof Promise?r.then(o=>C1(n,o)):C1(n,r)}return e.innerType._zod.run(n,i)}}),Mh=_("$ZodExactOptional",(t,e)=>{Wu.init(t,e),ue(t,"values",n=>n.def.innerType._zod.values),ue(t,"pattern",n=>n.def.innerType._zod.pattern),t._zod.parse=(n,i)=>e.innerType._zod.run(n,i)}),Uh=_("$ZodNullable",(t,e)=>{te.init(t,e),ue(t,"optin",n=>n.def.innerType._zod.optin),ue(t,"optout",n=>n.def.innerType._zod.optout),ue(t,"pattern",n=>{let i=n.def.innerType._zod.pattern;return i?new RegExp(`^(${Cu(i.source)}|null)$`):void 0}),ue(t,"values",n=>n.def.innerType._zod.values?new Set([...n.def.innerType._zod.values,null]):void 0),t._zod.parse=(n,i)=>n.value===null?n:e.innerType._zod.run(n,i)}),Fh=_("$ZodDefault",(t,e)=>{te.init(t,e),t._zod.optin="defaulted",ue(t,"values",n=>n.def.innerType._zod.values),t._zod.parse=(n,i)=>{if(i.direction==="backward")return e.innerType._zod.run(n,i);if(n.value===void 0)return n.value=e.defaultValue,n;let r=e.innerType._zod.run(n,i);return r instanceof Promise?r.then(o=>P1(o,e)):P1(r,e)}});function P1(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}a(P1,"handleDefaultResult");var qh=_("$ZodPrefault",(t,e)=>{te.init(t,e),t._zod.optin="defaulted",ue(t,"values",n=>n.def.innerType._zod.values),t._zod.parse=(n,i)=>(i.direction==="backward"||n.value===void 0&&(n.value=e.defaultValue),e.innerType._zod.run(n,i))}),Zh=_("$ZodNonOptional",(t,e)=>{te.init(t,e),ue(t,"values",n=>{let i=n.def.innerType._zod.values;return i?new Set([...i].filter(r=>r!==void 0)):void 0}),t._zod.parse=(n,i)=>{let r=e.innerType._zod.run(n,i);return r instanceof Promise?r.then(o=>R1(o,t)):R1(r,t)}});function R1(t,e){return!t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:e}),t}a(R1,"handleNonOptionalResult");var Vh=_("$ZodSuccess",(t,e)=>{te.init(t,e),t._zod.parse=(n,i)=>{if(i.direction==="backward")throw new Ni("ZodSuccess");let r=e.innerType._zod.run(n,i);return r instanceof Promise?r.then(o=>(n.value=o.issues.length===0,n)):(n.value=r.issues.length===0,n)}});function j1(t,e,n,i){return e.issues.length?(t.value=n.catchValue({...e,value:t.value,error:{issues:e.issues.map(r=>rn(r,i,Ye()))},input:t.value}),t):(t.value=e.value,e.memo&&(t.memo=!0),t)}a(j1,"handleCatchResult");var Bh=_("$ZodCatch",(t,e)=>{te.init(t,e),ue(t,"optin",n=>n.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),ue(t,"optout",n=>n.def.innerType._zod.optout),ue(t,"values",n=>n.def.innerType._zod.values),t._zod.parse=(n,i)=>{if(i.direction==="backward")return e.innerType._zod.run(n,i);let r=e.innerType._zod.run({value:n.value,issues:[]},i);return r instanceof Promise?r.then(o=>j1(n,o,e,i)):j1(n,r,e,i)}}),Kh=_("$ZodNaN",(t,e)=>{te.init(t,e),t._zod.parse=(n,i)=>((typeof n.value!="number"||!Number.isNaN(n.value))&&n.issues.push({input:n.value,inst:t,expected:"nan",code:"invalid_type"}),n)}),Gu=_("$ZodPipe",(t,e)=>{te.init(t,e),ue(t,"values",n=>n.def.in._zod.values),ue(t,"optin",n=>n.def.in._zod.optin),ue(t,"optout",n=>n.def.out._zod.optout),ue(t,"propValues",n=>n.def.in._zod.propValues),t._zod.parse=(n,i)=>{if(i.direction==="backward"){let o=e.out._zod.run(n,i);return o instanceof Promise?o.then(s=>zm(s,e.in,i)):zm(o,e.in,i)}let r=e.in._zod.run(n,i);return r instanceof Promise?r.then(o=>zm(o,e.out,i)):zm(r,e.out,i)}});function zm(t,e,n){return t.issues.some(i=>i.code!=="unrecognized_keys")?(t.aborted=!0,t):e._zod.run({value:t.value,issues:t.issues},n)}a(zm,"handlePipeResult");var ga=_("$ZodCodec",(t,e)=>{te.init(t,e),ue(t,"values",n=>n.def.in._zod.values),ue(t,"optin",n=>n.def.in._zod.optin),ue(t,"optout",n=>n.def.out._zod.optout),ue(t,"propValues",n=>n.def.in._zod.propValues),t._zod.parse=(n,i)=>{if((i.direction||"forward")==="forward"){let o=e.in._zod.run(n,i);return o instanceof Promise?o.then(s=>Dm(s,e,i)):Dm(o,e,i)}else{let o=e.out._zod.run(n,i);return o instanceof Promise?o.then(s=>Dm(s,e,i)):Dm(o,e,i)}}});function Dm(t,e,n){if(t.issues.length)return t.aborted=!0,t;if((n.direction||"forward")==="forward"){let r=e.transform(t.value,t);return r instanceof Promise?r.then(o=>Lm(t,o,e.out,n)):Lm(t,r,e.out,n)}else{let r=e.reverseTransform(t.value,t);return r instanceof Promise?r.then(o=>Lm(t,o,e.in,n)):Lm(t,r,e.in,n)}}a(Dm,"handleCodecAResult");function Lm(t,e,n,i){return t.issues.length?(t.aborted=!0,t):n._zod.run({value:e,issues:t.issues},i)}a(Lm,"handleCodecTxResult");var bk=_("$ZodPreprocess",(t,e)=>{Gu.init(t,e)}),Hh=_("$ZodReadonly",(t,e)=>{te.init(t,e),ue(t,"propValues",n=>n.def.innerType._zod.propValues),ue(t,"values",n=>n.def.innerType._zod.values),ue(t,"optin",n=>n.def.innerType?._zod?.optin),ue(t,"optout",n=>n.def.innerType?._zod?.optout),t._zod.parse=(n,i)=>{if(i.direction==="backward")return e.innerType._zod.run(n,i);let r=e.innerType._zod.run(n,i);return r instanceof Promise?r.then(z1):z1(r)}});function z1(t){return t.memo||(t.value=Object.freeze(t.value)),t}a(z1,"handleReadonlyResult");var Wh=_("$ZodTemplateLiteral",(t,e)=>{te.init(t,e);let n=[];for(let i of e.parts)if(typeof i=="object"&&i!==null){if(!i._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...i._zod.traits].shift()}`);let r=i._zod.pattern instanceof RegExp?i._zod.pattern.source:i._zod.pattern;if(!r)throw new Error(`Invalid template literal part: ${i._zod.traits}`);let o=r.startsWith("^")?1:0,s=r.endsWith("$")?r.length-1:r.length;n.push(r.slice(o,s))}else if(i===null||Y$.has(typeof i))n.push(Un(`${i}`));else throw new Error(`Invalid template literal part: ${i}`);t._zod.pattern=new RegExp(`^${n.join("")}$`),t._zod.parse=(i,r)=>typeof i.value!="string"?(i.issues.push({input:i.value,inst:t,expected:"string",code:"invalid_type"}),i):(t._zod.pattern.lastIndex=0,t._zod.pattern.test(i.value)||i.issues.push({input:i.value,inst:t,code:"invalid_format",format:e.format??"template_literal",pattern:t._zod.pattern.source}),i)}),Gh=_("$ZodFunction",(t,e)=>(te.init(t,e),Object.defineProperty(t,"_def",{value:e}),t._zod.def=e,t.implement=n=>{if(typeof n!="function")throw new Error("implement() must be called with a function");return Object.defineProperty(function(...i){let r=t._def.input?qo(t._def.input,i):i,o=Reflect.apply(n,this,r);return t._def.output?qo(t._def.output,o):o},"_zod",{value:t._zod,enumerable:!1})},t.implementAsync=n=>{if(typeof n!="function")throw new Error("implementAsync() must be called with a function");return Object.defineProperty(async function(...i){let r=t._def.input?await Zo(t._def.input,i):i,o=await Reflect.apply(n,this,r);return t._def.output?await Zo(t._def.output,o):o},"_zod",{value:t._zod,enumerable:!1})},t._zod.parse=(n,i)=>typeof n.value!="function"?(n.issues.push({code:"invalid_type",expected:"function",input:n.value,inst:t}),n):(t._def.output&&t._def.output._zod.def.type==="promise"?n.value=t.implementAsync(n.value):n.value=t.implement(n.value),n),t.input=(...n)=>{let i=t.constructor;return Array.isArray(n[0])?new i({type:"function",input:new Hu({type:"tuple",items:n[0],rest:n[1]}),output:t._def.output}):new i({type:"function",input:n[0],output:t._def.output})},t.output=n=>{let i=t.constructor;return new i({type:"function",input:t._def.input,output:n})},t)),Jh=_("$ZodPromise",(t,e)=>{te.init(t,e),t._zod.parse=(n,i)=>Promise.resolve(n.value).then(r=>e.innerType._zod.run({value:r,issues:[]},i))}),ya=_("$ZodLazy",(t,e)=>{te.init(t,e),W$(t._zod,"innerType",()=>{let n=e;return n._cachedInner||(n._cachedInner=e.getter()),n._cachedInner}),ue(t,"pattern",n=>n.innerType?._zod?.pattern),ue(t,"propValues",n=>n.innerType?._zod?.propValues),ue(t,"optin",n=>n.innerType?._zod?.optin??void 0),ue(t,"optout",n=>n.innerType?._zod?.optout??void 0),t._zod.parse=(n,i)=>t._zod.innerType._zod.run(n,i)}),Yh=_("$ZodCustom",(t,e)=>{Re.init(t,e),te.init(t,e),t._zod.parse=(n,i)=>n,t._zod.check=n=>{let i=n.value,r=e.fn(i);if(r instanceof Promise)return r.then(o=>D1(o,n,i,t));D1(r,n,i,t)}});function D1(t,e,n,i){if(!t){let r={code:"custom",input:n,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(r.params=i._zod.def.params),e.issues.push(aa(r))}}a(D1,"handleRefineResult");var eg=class extends Error{static{a(this,"$ZodCyclicError")}constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}},$k="~memo",F1=[];function wk(t){return t.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}a(wk,"cloneIssues");var q1=new WeakMap;function _k(t,e){let n=q1.get(t);if(n!==void 0)return n;if(e.has(t))return!0;e.add(t);let i=!1,r=a(c=>{!i&&c?._zod&&_k(c,e)&&(i=!0)},"check"),o=t._zod.def,s=o.type;switch(s){case"object":{for(let c of Reflect.ownKeys(o.shape))r(o.shape[c]);r(o.catchall);break}case"array":r(o.element);break;case"tuple":for(let c of o.items)r(c);r(o.rest);break;case"record":case"map":r(o.keyType),r(o.valueType);break;case"set":r(o.valueType);break;case"union":for(let c of o.options)r(c);break;case"intersection":r(o.left),r(o.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":r(o.innerType);break;case"pipe":r(o.in),r(o.out);break;case"function":r(o.input),r(o.output);break;case"lazy":r(t._zod.innerType);break;case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(let c in o){let u=Object.getOwnPropertyDescriptor(o,c);if(!u||u.get)continue;let l=u.value;if(!(!l||typeof l!="object")){if(l._zod)r(l);else if(Array.isArray(l))for(let d of l)r(d)}}}return e.delete(t),q1.set(t,i),i}a(_k,"isRecursive");function kk(t){return _k(t,new Set)}a(kk,"isRecursiveSchema");function lW(t,e){let n=t.buckets.get(e);return n||(n=new Map,t.buckets.set(e,n)),n}a(lW,"bucketFor");var Xh,Qh=[],dW={alloc(t,e,n){let i=Xh;if(!i)return n;Xh=void 0;let r={value:n,issues:null};return i.set(e.value,r),Qh.push(r),n},guard(t){var e;(e=t._zod).deferred??(e.deferred=[]),t._zod.deferred.push(()=>{let n=t._zod.parse,i=a((r,o)=>{if(o.direction!=="backward"&&tg(o,r.value))throw new eg;return n(r,o)},"wrapped");t._zod.parse=i,t._zod.run===n&&(t._zod.run=i)})},attach(t){var e;let n,i,r;(e=t._zod).deferred??(e.deferred=[]),t._zod.deferred.push(()=>{let o=t._zod.parse,s=a((c,u)=>{if(n===void 0&&(n=_k(t,new Set),!n))return t._zod.parse=o,t._zod.run===s&&(t._zod.run=o),o(c,u);let l=c.value;if(l===null||typeof l!="object")return o(c,u);let d=u[$k];d||(d={buckets:new Map,backEdges:void 0},u[$k]=d);let f;i===u?f=r:(f=lW(d,t),i=u,r=f);let p=f.get(l);if(p)return c.value=p.value,p.issues?p.issues.length&&c.issues.push(...wk(p.issues)):(c.memo=!0,d.backEdges??(d.backEdges=new Set),d.backEdges.add(p.value)),c;Xh=f;let m=Qh.length,g=o(c,u);Xh=void 0;let y=Qh.length>m?Qh.pop():void 0;return g instanceof Promise?g.then(v=>(y&&(y.issues=v.issues.length?wk(v.issues):F1),v)):(y&&(y.issues=g.issues.length?wk(g.issues):F1),g)},"wrapped");t._zod.parse=s,t._zod.run===o&&(t._zod.run=s)})}};function Ju(){return dW}a(Ju,"memoizer");function tg(t,e){let n=t[$k]?.backEdges;return n!==void 0&&e!==null&&typeof e=="object"&&n.has(e)}a(tg,"isBackEdge");var ba={};Tr(ba,{ar:()=>xk,az:()=>Sk,be:()=>Ik,bg:()=>Ek,bn:()=>Tk,ca:()=>Ak,ckb:()=>Ok,cs:()=>Nk,da:()=>Ck,de:()=>Pk,el:()=>Rk,en:()=>Yu,eo:()=>jk,es:()=>zk,fa:()=>Dk,fi:()=>Lk,fr:()=>Mk,frCA:()=>Uk,gu:()=>Fk,he:()=>qk,hi:()=>Zk,hr:()=>Vk,hu:()=>Bk,hy:()=>Kk,id:()=>Hk,is:()=>Wk,it:()=>Gk,ja:()=>Jk,ka:()=>Yk,kh:()=>Xk,km:()=>Xu,kn:()=>Qk,ko:()=>ex,lt:()=>tx,mk:()=>nx,ms:()=>rx,ne:()=>ix,nl:()=>ox,nn:()=>sx,no:()=>ax,ota:()=>cx,pl:()=>lx,ps:()=>ux,pt:()=>dx,ptBR:()=>fx,ro:()=>px,ru:()=>mx,sk:()=>hx,sl:()=>gx,sv:()=>yx,ta:()=>vx,th:()=>bx,tk:()=>wx,tr:()=>$x,ua:()=>_x,uk:()=>el,ur:()=>kx,uz:()=>xx,vi:()=>Sx,yo:()=>Tx,zhCN:()=>Ix,zhTW:()=>Ex});var fW=a(()=>{let t={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},map:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function e(r){return t[r]??null}a(e,"getSizing");let n={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",mac:"\u0639\u0646\u0648\u0627\u0646 MAC",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",credit_card:"\u0631\u0642\u0645 \u0628\u0637\u0627\u0642\u0629 \u0627\u0644\u0627\u0626\u062A\u0645\u0627\u0646",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=O(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 instanceof ${r.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${c}`:`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${o}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${c}`}case"invalid_value":return r.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${A(r.values[0])}`:`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${k(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${r.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${o} ${r.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${r.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${o} ${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${r.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${o} ${r.minimum.toString()} ${s.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${r.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${o} ${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${r.prefix}"`:o.format==="ends_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${o.suffix}"`:o.format==="includes"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${o.includes}"`:o.format==="regex"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${o.pattern}`:`${n[o.format]??r.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${r.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${r.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${r.keys.length>1?"\u0629":""}: ${k(r.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${r.origin}`;case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return`\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${r.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}},"error");function xk(){return{localeError:fW()}}a(xk,"default");var pW=a(()=>{let t={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"},map:{unit:"element",verb:"olmal\u0131d\u0131r"}};function e(r){return t[r]??null}a(e,"getSizing");let n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",credit_card:"kredit kart\u0131 n\xF6mr\u0259si",jwt:"JWT",template_literal:"input"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=O(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${r.expected}, daxil olan ${c}`:`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${o}, daxil olan ${c}`}case"invalid_value":return r.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${A(r.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${k(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${r.origin??"d\u0259y\u0259r"} ${o}${r.maximum.toString()} ${s.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${r.origin??"d\u0259y\u0259r"} ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${r.origin} ${o}${r.minimum.toString()} ${s.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${r.origin} ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${o.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:o.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${o.suffix}" il\u0259 bitm\u0259lidir`:o.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${o.includes}" daxil olmal\u0131d\u0131r`:o.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${o.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${n[o.format]??r.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${r.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${r.keys.length>1?"lar":""}: ${k(r.keys,", ")}`;case"invalid_key":return`${r.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${r.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}},"error");function Sk(){return{localeError:pW()}}a(Sk,"default");function Z1(t,e,n,i){let r=Math.abs(t),o=r%10,s=r%100;return s>=11&&s<=19?i:o===1?e:o>=2&&o<=4?n:i}a(Z1,"getBelarusianPlural");var mW=a(()=>{let t={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},map:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function e(r){return t[r]??null}a(e,"getSizing");let n={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",mac:"MAC \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",credit_card:"\u043D\u0443\u043C\u0430\u0440 \u043A\u0440\u044D\u0434\u044B\u0442\u043D\u0430\u0439 \u043A\u0430\u0440\u0442\u044B",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"},i={nan:"NaN",number:"\u043B\u0456\u043A",array:"\u043C\u0430\u0441\u0456\u045E"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=O(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F instanceof ${r.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${c}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${o}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${c}`}case"invalid_value":return r.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${A(r.values[0])}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${k(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);if(s){let c=Number(r.maximum),u=Z1(c,s.unit.one,s.unit.few,s.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${o}${r.maximum.toString()} ${u}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);if(s){let c=Number(r.minimum),u=Z1(c,s.unit.one,s.unit.few,s.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${r.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${o}${r.minimum.toString()} ${u}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${r.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${o.prefix}"`:o.format==="ends_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${o.suffix}"`:o.format==="includes"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${o.includes}"`:o.format==="regex"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${o.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${n[o.format]??r.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${r.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${k(r.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${r.origin}`;case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${r.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}},"error");function Ik(){return{localeError:mW()}}a(Ik,"default");var hW=a(()=>{let t={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},file:{unit:"\u0431\u0430\u0439\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},map:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"}};function e(r){return t[r]??null}a(e,"getSizing");let n={regex:"\u0432\u0445\u043E\u0434",email:"\u0438\u043C\u0435\u0439\u043B \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0436\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u043F\u0440\u043E\u0434\u044A\u043B\u0436\u0438\u0442\u0435\u043B\u043D\u043E\u0441\u0442",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",mac:"MAC \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"base64-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",base64url:"base64url-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",json_string:"JSON \u043D\u0438\u0437",e164:"E.164 \u043D\u043E\u043C\u0435\u0440",credit_card:"\u043D\u043E\u043C\u0435\u0440 \u043D\u0430 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u0430 \u043A\u0430\u0440\u0442\u0430",jwt:"JWT",template_literal:"\u0432\u0445\u043E\u0434"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=O(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D instanceof ${r.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${c}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${o}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${c}`}case"invalid_value":return r.values.length===1?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${A(r.values[0])}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u043E\u043F\u0446\u0438\u044F: \u043E\u0447\u0430\u043A\u0432\u0430\u043D\u043E \u0435\u0434\u043D\u043E \u043E\u0442 ${k(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${r.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${o}${r.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430"}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${r.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${r.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${o}${r.minimum.toString()} ${s.unit}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${r.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;if(o.format==="starts_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u0432\u0430 \u0441 "${o.prefix}"`;if(o.format==="ends_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u0432\u044A\u0440\u0448\u0432\u0430 \u0441 "${o.suffix}"`;if(o.format==="includes")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0432\u043A\u043B\u044E\u0447\u0432\u0430 "${o.includes}"`;if(o.format==="regex")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0441\u044A\u0432\u043F\u0430\u0434\u0430 \u0441 ${o.pattern}`;let s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return o.format==="emoji"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="datetime"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="date"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),o.format==="time"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="duration"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${s} ${n[o.format]??r.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E \u0447\u0438\u0441\u043B\u043E: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0431\u044A\u0434\u0435 \u043A\u0440\u0430\u0442\u043D\u043E \u043D\u0430 ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${r.keys.length>1?"\u0438":""} \u043A\u043B\u044E\u0447${r.keys.length>1?"\u043E\u0432\u0435":""}: ${k(r.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ${r.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434";case"invalid_element":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442 \u0432 ${r.origin}`;default:return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434"}}},"error");function Ek(){return{localeError:hW()}}a(Ek,"default");var gW=a(()=>{let t={string:{unit:"\u0985\u0995\u09CD\u09B7\u09B0",verb:"\u09A5\u09BE\u0995\u09A4\u09C7 \u09B9\u09AC\u09C7"},file:{unit:"\u09AC\u09BE\u0987\u099F",verb:"\u09A5\u09BE\u0995\u09A4\u09C7 \u09B9\u09AC\u09C7"},array:{unit:"\u0986\u0987\u099F\u09C7\u09AE",verb:"\u09A5\u09BE\u0995\u09A4\u09C7 \u09B9\u09AC\u09C7"},set:{unit:"\u0986\u0987\u099F\u09C7\u09AE",verb:"\u09A5\u09BE\u0995\u09A4\u09C7 \u09B9\u09AC\u09C7"},map:{unit:"\u098F\u09A8\u09CD\u099F\u09CD\u09B0\u09BF",verb:"\u09A5\u09BE\u0995\u09A4\u09C7 \u09B9\u09AC\u09C7"}};function e(r){return t[r]??null}a(e,"getSizing");let n={regex:"\u0987\u09A8\u09AA\u09C1\u099F",email:"\u0987\u09AE\u09C7\u0987\u09B2 \u09A0\u09BF\u0995\u09BE\u09A8\u09BE",url:"URL",emoji:"\u0987\u09AE\u09CB\u099C\u09BF",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u09A4\u09BE\u09B0\u09BF\u0996 \u0993 \u09B8\u09AE\u09AF\u09BC",date:"ISO \u09A4\u09BE\u09B0\u09BF\u0996",time:"ISO \u09B8\u09AE\u09AF\u09BC",duration:"ISO \u09B8\u09AE\u09AF\u09BC\u0995\u09BE\u09B2",ipv4:"IPv4 \u09A0\u09BF\u0995\u09BE\u09A8\u09BE",ipv6:"IPv6 \u09A0\u09BF\u0995\u09BE\u09A8\u09BE",mac:"MAC \u09A0\u09BF\u0995\u09BE\u09A8\u09BE",cidrv4:"IPv4 \u09B0\u09C7\u099E\u09CD\u099C",cidrv6:"IPv6 \u09B0\u09C7\u099E\u09CD\u099C",base64:"base64-\u098F\u09A8\u0995\u09CB\u09A1\u09C7\u09A1 \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982",base64url:"base64url-\u098F\u09A8\u0995\u09CB\u09A1\u09C7\u09A1 \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982",json_string:"JSON \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982",e164:"E.164 \u09A8\u09AE\u09CD\u09AC\u09B0",credit_card:"\u0995\u09CD\u09B0\u09C7\u09A1\u09BF\u099F \u0995\u09BE\u09B0\u09CD\u09A1 \u09A8\u09AE\u09CD\u09AC\u09B0",jwt:"JWT",template_literal:"\u0987\u09A8\u09AA\u09C1\u099F"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=O(r.input),c=i[s]??s;return`\u0985\u09AC\u09C8\u09A7 \u0987\u09A8\u09AA\u09C1\u099F: \u09AA\u09CD\u09B0\u09A4\u09CD\u09AF\u09BE\u09B6\u09BF\u09A4 ${o}, \u09AA\u09CD\u09B0\u09BE\u09AA\u09CD\u09A4 ${c}`}case"invalid_value":return r.values.length===1?`\u0985\u09AC\u09C8\u09A7 \u0987\u09A8\u09AA\u09C1\u099F: \u09AA\u09CD\u09B0\u09A4\u09CD\u09AF\u09BE\u09B6\u09BF\u09A4 ${A(r.values[0])}`:`\u0985\u09AC\u09C8\u09A7 \u0985\u09AA\u09B6\u09A8: ${k(r.values," | ")} \u098F\u09B0 \u09AE\u09A7\u09CD\u09AF\u09C7 \u098F\u0995\u099F\u09BF \u09AA\u09CD\u09B0\u09A4\u09CD\u09AF\u09BE\u09B6\u09BF\u09A4`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\u0985\u09A8\u09C7\u0995 \u09AC\u09A1\u09BC: ${r.origin??"\u09AE\u09BE\u09A8"} ${o}${r.maximum.toString()} ${s.unit??"\u098F\u09B2\u09BF\u09AE\u09C7\u09A8\u09CD\u099F"} \u09B9\u09A4\u09C7 \u09B9\u09AC\u09C7`:`\u0985\u09A8\u09C7\u0995 \u09AC\u09A1\u09BC: ${r.origin??"\u09AE\u09BE\u09A8"} ${o}${r.maximum.toString()} \u09B9\u09A4\u09C7 \u09B9\u09AC\u09C7`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\u0985\u09A8\u09C7\u0995 \u099B\u09CB\u099F: ${r.origin} ${o}${r.minimum.toString()} ${s.unit} \u09B9\u09A4\u09C7 \u09B9\u09AC\u09C7`:`\u0985\u09A8\u09C7\u0995 \u099B\u09CB\u099F: ${r.origin} ${o}${r.minimum.toString()} \u09B9\u09A4\u09C7 \u09B9\u09AC\u09C7`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0985\u09AC\u09C8\u09A7 \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982: "${o.prefix}" \u09A6\u09BF\u09AF\u09BC\u09C7 \u09B6\u09C1\u09B0\u09C1 \u09B9\u09A4\u09C7 \u09B9\u09AC\u09C7`:o.format==="ends_with"?`\u0985\u09AC\u09C8\u09A7 \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982: "${o.suffix}" \u09A6\u09BF\u09AF\u09BC\u09C7 \u09B6\u09C7\u09B7 \u09B9\u09A4\u09C7 \u09B9\u09AC\u09C7`:o.format==="includes"?`\u0985\u09AC\u09C8\u09A7 \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982: "${o.includes}" \u0985\u09A8\u09CD\u09A4\u09B0\u09CD\u09AD\u09C1\u0995\u09CD\u09A4 \u09A5\u09BE\u0995\u09A4\u09C7 \u09B9\u09AC\u09C7`:o.format==="regex"?`\u0985\u09AC\u09C8\u09A7 \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982: ${o.pattern} \u09AA\u09CD\u09AF\u09BE\u099F\u09BE\u09B0\u09CD\u09A8 \u09AE\u09BF\u09B2\u09A4\u09C7 \u09B9\u09AC\u09C7`:`\u0985\u09AC\u09C8\u09A7 ${n[o.format]??r.format}`}case"not_multiple_of":return`\u0985\u09AC\u09C8\u09A7 \u09A8\u09AE\u09CD\u09AC\u09B0: ${r.divisor} \u098F\u09B0 \u0997\u09C1\u09A3\u09BF\u09A4\u0995 \u09B9\u09A4\u09C7 \u09B9\u09AC\u09C7`;case"unrecognized_keys":return`\u0985\u099A\u09C7\u09A8\u09BE \u0995\u09C0${r.keys.length>1?"\u0997\u09C1\u09B2\u09CB":""}: ${k(r.keys,", ")}`;case"invalid_key":return`${r.origin} \u098F \u0985\u09AC\u09C8\u09A7 \u0995\u09C0`;case"invalid_union":return r.options&&Array.isArray(r.options)&&r.options.length>0?`\u0985\u09AC\u09C8\u09A7 \u09A1\u09BF\u09B8\u0995\u09CD\u09B0\u09BF\u09AE\u09BF\u09A8\u09C7\u099F\u09B0 \u09AE\u09BE\u09A8\u0964 \u09AA\u09CD\u09B0\u09A4\u09CD\u09AF\u09BE\u09B6\u09BF\u09A4 ${r.options.map(s=>`'${s}'`).join(" | ")}`:"\u0985\u09AC\u09C8\u09A7 \u0987\u09A8\u09AA\u09C1\u099F";case"invalid_element":return`${r.origin} \u098F \u0985\u09AC\u09C8\u09A7 \u09AE\u09BE\u09A8`;default:return"\u0985\u09AC\u09C8\u09A7 \u0987\u09A8\u09AA\u09C1\u099F"}}},"error");function Tk(){return{localeError:gW()}}a(Tk,"default");var yW=a(()=>{let t={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"},map:{unit:"elements",verb:"contenir"}};function e(r){return t[r]??null}a(e,"getSizing");let n={regex:"entrada",email:"adre\xE7a electr\xF2nica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adre\xE7a IPv4",ipv6:"adre\xE7a IPv6",mac:"adre\xE7a MAC",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",credit_card:"n\xFAmero de targeta de cr\xE8dit",jwt:"JWT",template_literal:"entrada"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=O(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Tipus inv\xE0lid: s'esperava instanceof ${r.expected}, s'ha rebut ${c}`:`Tipus inv\xE0lid: s'esperava ${o}, s'ha rebut ${c}`}case"invalid_value":return r.values.length===1?`Valor inv\xE0lid: s'esperava ${A(r.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${k(r.values," o ")}`;case"too_big":{let o=r.inclusive?"com a m\xE0xim":"menys de",s=e(r.origin);return s?`Massa gran: s'esperava que ${r.origin??"el valor"} contingu\xE9s ${o} ${r.maximum.toString()} ${s.unit??"elements"}`:`Massa gran: s'esperava que ${r.origin??"el valor"} fos ${o} ${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?"com a m\xEDnim":"m\xE9s de",s=e(r.origin);return s?`Massa petit: s'esperava que ${r.origin} contingu\xE9s ${o} ${r.minimum.toString()} ${s.unit}`:`Massa petit: s'esperava que ${r.origin} fos ${o} ${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${o.prefix}"`:o.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${o.suffix}"`:o.format==="includes"?`Format inv\xE0lid: ha d'incloure "${o.includes}"`:o.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${o.pattern}`:`Format inv\xE0lid per a ${n[o.format]??r.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${r.divisor}`;case"unrecognized_keys":return`Clau${r.keys.length>1?"s":""} no reconeguda${r.keys.length>1?"s":""}: ${k(r.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${r.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${r.origin}`;default:return"Entrada inv\xE0lida"}}},"error");function Ak(){return{localeError:yW()}}a(Ak,"default");var vW=a(()=>{let t={string:{unit:"\u067E\u06CC\u062A",verb:"\u0628\u06CE\u062A"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u0628\u06CE\u062A"},array:{unit:"\u062F\u0627\u0646\u06D5",verb:"\u0628\u06CE\u062A"},set:{unit:"\u062F\u0627\u0646\u06D5",verb:"\u0628\u06CE\u062A"},map:{unit:"\u062F\u0627\u0646\u06D5",verb:"\u0628\u06CE\u062A"}};function e(r){return t[r]??null}a(e,"getSizing");let n={regex:"regex",email:"\u0626\u06CC\u0645\u06D5\u06CC\u06B5",url:"\u0628\u06D5\u0633\u062A\u06D5\u0631 (URL)",emoji:"\u0626\u06CC\u0645\u06C6\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0695\u06CE\u06A9\u06D5\u0648\u062A \u0648 \u06A9\u0627\u062A",date:"\u0695\u06CE\u06A9\u06D5\u0648\u062A",time:"\u06A9\u0627\u062A",duration:"\u0645\u0627\u0648\u06D5",ipv4:"\u0646\u0627\u0648\u0646\u06CC\u0634\u0627\u0646\u06CC IPv4",ipv6:"\u0646\u0627\u0648\u0646\u06CC\u0634\u0627\u0646\u06CC IPv6",mac:"\u0646\u0627\u0648\u0646\u06CC\u0634\u0627\u0646\u06CC MAC",cidrv4:"\u0645\u06D5\u0648\u062F\u0627\u06CC IPv4",cidrv6:"\u0645\u06D5\u0648\u062F\u0627\u06CC IPv6",base64:"\u062F\u06D5\u0642\u06CC base64",base64url:"\u062F\u06D5\u0642\u06CC base64url",json_string:"\u062F\u06D5\u0642\u06CC JSON",e164:"\u0698\u0645\u0627\u0631\u06D5\u06CC E.164",credit_card:"\u0698\u0645\u0627\u0631\u06D5\u06CC \u06A9\u0627\u0631\u062A\u06CC \u06A9\u0631\u06CE\u062F\u06CC\u062A",jwt:"JWT",template_literal:"\u062A\u06CE\u06A9\u0631\u062F\u06D5"},i={nan:"NaN",string:"\u0646\u0648\u0648\u0633\u06CC\u0646",number:"\u0698\u0645\u0627\u0631\u06D5",boolean:"boolean",array:"array",object:"object",date:"\u0695\u06CE\u06A9\u06D5\u0648\u062A",integer:"\u0698\u0645\u0627\u0631\u06D5",float:"\u0698\u0645\u0627\u0631\u06D5",null:"null",undefined:"undefined",function:"function",symbol:"symbol",unknown:"unknown",promise:"promise",void:"void",never:"never",map:"map",set:"set"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=O(r.input),c=i[s]??s,u=["\u0627","\u0648","\u06C6","\u0648\u0648","\u06D5","\u06CC","\u06CE"].some(d=>c.endsWith(d))?"\u06CC\u06D5":"\u06D5",l=/^[a-zA-Z]+$/.test(c);return s==="null"||s==="undefined"?"\u062F\u0627\u0648\u0627\u06A9\u0631\u0627\u0648\u06D5":`\u0686\u0627\u0648\u06D5\u0695\u0648\u0627\u0646\u06A9\u0631\u0627\u0648\u06D5 ${o} \u0628\u06CE\u062A\u060C \u0628\u06D5\u06B5\u0627\u0645 ${c}${l?"":u}`}case"invalid_value":return r.values.length===1?`\u0628\u06D5\u0647\u0627\u06A9\u06D5 \u0646\u0627\u062F\u0631\u0648\u0648\u0633\u062A\u06D5: \u0686\u0627\u0648\u06D5\u0695\u0648\u0627\u0646\u06A9\u0631\u0627\u0648\u06D5 ${A(r.values[0])} \u0628\u06CE\u062A`:`\u0647\u06D5\u06B5\u0628\u0698\u0627\u0631\u062F\u06D5\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A: \u0686\u0627\u0648\u06D5\u0695\u0648\u0627\u0646\u06A9\u0631\u0627\u0648\u06D5 \u06CC\u06D5\u06A9\u06CE\u06A9 \u0628\u06CE\u062A \u0644\u06D5 ${k(r.values,"|")}`;case"too_big":{let o=e(r.origin);return o?`\u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 \u0628\u06D5 \u0644\u0627\u06CC\u06D5\u0646\u06CC \u0632\u06C6\u0631\u06D5\u0648\u06D5 ${r.maximum.toString()} ${o.unit} ${o.verb}`:`\u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 \u0628\u06D5 \u0644\u0627\u06CC\u06D5\u0646\u06CC \u0632\u06C6\u0631\u06D5\u0648\u06D5 ${r.maximum.toString()} \u0628\u06CE\u062A`}case"too_small":{let o=e(r.origin);return o?`\u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 \u0628\u06D5 \u0644\u0627\u06CC\u06D5\u0646\u06CC \u06A9\u06D5\u0645\u06D5\u0648\u06D5 ${r.minimum.toString()} ${o.unit} ${o.verb}`:`\u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 \u0628\u06D5 \u0644\u0627\u06CC\u06D5\u0646\u06CC \u06A9\u06D5\u0645\u06D5\u0648\u06D5 ${r.minimum.toString()} \u0628\u06CE\u062A`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u062F\u06D5\u0642\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A: \u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 \u062F\u06D5\u0633\u062A\u067E\u06CE\u0628\u06A9\u0627\u062A \u0628\u06D5 "${o.prefix}"`:o.format==="ends_with"?`\u062F\u06D5\u0642\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A: \u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 \u06A9\u06C6\u062A\u0627\u06CC\u06CC\u0628\u06CE\u062A \u0628\u06D5 "${o.suffix}"`:o.format==="includes"?`\u062F\u06D5\u0642\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A: \u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 "${o.includes}" \u0644\u06D5\u062E\u06C6\u0628\u06AF\u0631\u06CE\u062A`:o.format==="regex"?`\u062F\u06D5\u0642\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A: \u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 \u0644\u06D5\u06AF\u06D5\u06B5 \u067E\u0627\u062A\u06CE\u0631\u0646\u06CC ${o.pattern} \u0628\u06AF\u0648\u0646\u062C\u06CE\u062A`:`\u0628\u06D5\u0647\u0627\u06CC ${n[o.format]??r.format} \u0646\u0627\u062F\u0631\u0648\u0633\u062A\u06D5`}case"not_multiple_of":return`\u0698\u0645\u0627\u0631\u06D5\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A: \u062F\u06D5\u0628\u06CE\u062A \u0686\u06D5\u0646\u062F \u0647\u06CE\u0646\u062F\u06D5 \u0628\u06CE\u062A \u0628\u06C6 ${r.divisor}`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u0644\u06CC \u0646\u06D5\u0646\u0627\u0633\u0631\u0627\u0648: ${k(r.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u0644\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A \u0644\u06D5 ${r.origin}`;case"invalid_union":return r.options&&Array.isArray(r.options)&&r.options.length>0?`\u0628\u06D5\u0647\u0627\u06CC \u0646\u06D5\u0646\u0627\u0633\u0631\u0627\u0648 \u0647\u06D5\u06CC\u06D5. \u0628\u06D5\u0647\u0627\u06CC \u0686\u0627\u0648\u06D5\u0695\u0648\u0627\u0646\u06A9\u0631\u0627\u0648: ${r.options.map(s=>`'${s}'`).join(" | ")}`:"\u06CC\u06D5\u06A9\u06AF\u0631\u062A\u0646\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A";case"invalid_element":return`${r.origin} \u0628\u06D5\u0647\u0627\u06A9\u06D5 \u0646\u0627\u062F\u0631\u0648\u0633\u062A\u06D5`;default:return"\u062A\u06CE\u06A9\u0631\u062F\u06D5\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A"}}},"error");function Ok(){return{localeError:vW()}}a(Ok,"default");var bW=a(()=>{let t={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"},map:{unit:"prvk\u016F",verb:"m\xEDt"}};function e(r){return t[r]??null}a(e,"getSizing");let n={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",mac:"MAC adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",credit_card:"\u010D\xEDslo kreditn\xED karty",jwt:"JWT",template_literal:"vstup"},i={nan:"NaN",number:"\u010D\xEDslo",string:"\u0159et\u011Bzec",function:"funkce",array:"pole"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=O(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${r.expected}, obdr\u017Eeno ${c}`:`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${o}, obdr\u017Eeno ${c}`}case"invalid_value":return r.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${A(r.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${k(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${r.origin??"hodnota"} mus\xED m\xEDt ${o}${r.maximum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${r.origin??"hodnota"} mus\xED b\xFDt ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${r.origin??"hodnota"} mus\xED m\xEDt ${o}${r.minimum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${r.origin??"hodnota"} mus\xED b\xFDt ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${o.prefix}"`:o.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${o.suffix}"`:o.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${o.includes}"`:o.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${o.pattern}`:`Neplatn\xFD form\xE1t ${n[o.format]??r.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${r.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${k(r.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${r.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${r.origin}`;default:return"Neplatn\xFD vstup"}}},"error");function Nk(){return{localeError:bW()}}a(Nk,"default");var wW=a(()=>{let t={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"},map:{unit:"elementer",verb:"indeholdt"}};function e(r){return t[r]??null}a(e,"getSizing");let n={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkesl\xE6t",date:"ISO-dato",time:"ISO-klokkesl\xE6t",duration:"ISO-varighed",ipv4:"IPv4-adresse",ipv6:"IPv6-adresse",mac:"MAC-adresse",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",credit_card:"kreditkortnummer",jwt:"JWT",template_literal:"input"},i={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"s\xE6t",file:"fil"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=O(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Ugyldigt input: forventede instanceof ${r.expected}, fik ${c}`:`Ugyldigt input: forventede ${o}, fik ${c}`}case"invalid_value":return r.values.length===1?`Ugyldig v\xE6rdi: forventede ${A(r.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${k(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin),c=i[r.origin]??r.origin;return s?`For stor: forventede ${c??"value"} ${s.verb} ${o} ${r.maximum.toString()} ${s.unit??"elementer"}`:`For stor: forventede ${c??"value"} havde ${o} ${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin),c=i[r.origin]??r.origin;return s?`For lille: forventede ${c} ${s.verb} ${o} ${r.minimum.toString()} ${s.unit}`:`For lille: forventede ${c} havde ${o} ${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Ugyldig streng: skal starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: skal ende med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: skal indeholde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: skal matche m\xF8nsteret ${o.pattern}`:`Ugyldig ${n[o.format]??r.format}`}case"not_multiple_of":return`Ugyldigt tal: skal v\xE6re deleligt med ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${k(r.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8gle i ${r.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig v\xE6rdi i ${r.origin}`;default:return"Ugyldigt input"}}},"error");function Ck(){return{localeError:wW()}}a(Ck,"default");var $W=a(()=>{let t={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"},map:{unit:"Elemente",verb:"zu haben"}};function e(r){return t[r]??null}a(e,"getSizing");let n={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",mac:"MAC-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",credit_card:"Kreditkartennummer",jwt:"JWT",template_literal:"Eingabe"},i={nan:"NaN",number:"Zahl",array:"Array"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=O(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Ung\xFCltige Eingabe: erwartet instanceof ${r.expected}, erhalten ${c}`:`Ung\xFCltige Eingabe: erwartet ${o}, erhalten ${c}`}case"invalid_value":return r.values.length===1?`Ung\xFCltige Eingabe: erwartet ${A(r.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${k(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Zu gro\xDF: erwartet, dass ${r.origin??"Wert"} ${o}${r.maximum.toString()} ${s.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${r.origin??"Wert"} ${o}${r.maximum.toString()} ist`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Zu klein: erwartet, dass ${r.origin} ${o}${r.minimum.toString()} ${s.unit} hat`:`Zu klein: erwartet, dass ${r.origin} ${o}${r.minimum.toString()} ist`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Ung\xFCltiger String: muss mit "${o.prefix}" beginnen`:o.format==="ends_with"?`Ung\xFCltiger String: muss mit "${o.suffix}" enden`:o.format==="includes"?`Ung\xFCltiger String: muss "${o.includes}" enthalten`:o.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${o.pattern} entsprechen`:`Ung\xFCltig: ${n[o.format]??r.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${r.divisor} sein`;case"unrecognized_keys":return`${r.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${k(r.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${r.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${r.origin}`;default:return"Ung\xFCltige Eingabe"}}},"error");function Pk(){return{localeError:$W()}}a(Pk,"default");var _W=a(()=>{let t={string:{unit:"\u03C7\u03B1\u03C1\u03B1\u03BA\u03C4\u03AE\u03C1\u03B5\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},file:{unit:"bytes",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},array:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},set:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},map:{unit:"\u03BA\u03B1\u03C4\u03B1\u03C7\u03C9\u03C1\u03AE\u03C3\u03B5\u03B9\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"}};function e(r){return t[r]??null}a(e,"getSizing");let n={regex:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2",email:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1 \u03BA\u03B1\u03B9 \u03CE\u03C1\u03B1",date:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1",time:"ISO \u03CE\u03C1\u03B1",duration:"ISO \u03B4\u03B9\u03AC\u03C1\u03BA\u03B5\u03B9\u03B1",ipv4:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv4",ipv6:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv6",mac:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 MAC",cidrv4:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv4",cidrv6:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv6",base64:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64",base64url:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64url",json_string:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC JSON",e164:"\u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2 E.164",credit_card:"\u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2 \u03C0\u03B9\u03C3\u03C4\u03C9\u03C4\u03B9\u03BA\u03AE\u03C2 \u03BA\u03AC\u03C1\u03C4\u03B1\u03C2",jwt:"JWT",template_literal:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=O(r.input),c=i[s]??s;return typeof r.expected=="string"&&/^[A-Z]/.test(r.expected)?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD instanceof ${r.expected}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${c}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${o}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${c}`}case"invalid_value":return r.values.length===1?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${A(r.values[0])}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD \u03AD\u03BD\u03B1 \u03B1\u03C0\u03CC ${k(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${r.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${o}${r.maximum.toString()} ${s.unit??"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1"}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${r.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${r.origin} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${o}${r.minimum.toString()} ${s.unit}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${r.origin} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03BE\u03B5\u03BA\u03B9\u03BD\u03AC \u03BC\u03B5 "${o.prefix}"`:o.format==="ends_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B5\u03BB\u03B5\u03B9\u03CE\u03BD\u03B5\u03B9 \u03BC\u03B5 "${o.suffix}"`:o.format==="includes"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C0\u03B5\u03C1\u03B9\u03AD\u03C7\u03B5\u03B9 "${o.includes}"`:o.format==="regex"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B1\u03B9\u03C1\u03B9\u03AC\u03B6\u03B5\u03B9 \u03BC\u03B5 \u03C4\u03BF \u03BC\u03BF\u03C4\u03AF\u03B2\u03BF ${o.pattern}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF: ${n[o.format]??r.format}`}case"not_multiple_of":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF\u03C2 \u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 \u03C0\u03BF\u03BB\u03BB\u03B1\u03C0\u03BB\u03AC\u03C3\u03B9\u03BF \u03C4\u03BF\u03C5 ${r.divisor}`;case"unrecognized_keys":return`\u0386\u03B3\u03BD\u03C9\u03C3\u03C4${r.keys.length>1?"\u03B1":"\u03BF"} \u03BA\u03BB\u03B5\u03B9\u03B4${r.keys.length>1?"\u03B9\u03AC":"\u03AF"}: ${k(r.keys,", ")}`;case"invalid_key":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF \u03BA\u03BB\u03B5\u03B9\u03B4\u03AF \u03C3\u03C4\u03BF ${r.origin}`;case"invalid_union":return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2";case"invalid_element":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C4\u03B9\u03BC\u03AE \u03C3\u03C4\u03BF ${r.origin}`;default:return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"}}},"error");function Rk(){return{localeError:_W()}}a(Rk,"default");var kW=a(()=>{let t={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function e(o){return t[o]??null}a(e,"getSizing");let n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",credit_card:"credit card number",jwt:"JWT",template_literal:"input"},i={nan:"NaN"};function r(o,s){return o==="number"&&typeof s=="number"&&!Number.isFinite(s)?String(s):i[o]??o}return a(r,"getTypeName"),o=>{switch(o.code){case"invalid_type":{let s=r(o.expected),c=O(o.input),u=r(c,o.input);return`Invalid input: expected ${s}, received ${u}`}case"invalid_value":return o.values.length===1?`Invalid input: expected ${A(o.values[0])}`:`Invalid option: expected one of ${k(o.values,"|")}`;case"too_big":{let s=o.exact?"exactly ":o.inclusive?"<=":"<",c=e(o.origin);return c?`Too big: expected ${o.origin??"value"} to have ${s}${o.maximum.toString()} ${c.unit??"elements"}`:`Too big: expected ${o.origin??"value"} to be ${s}${o.maximum.toString()}`}case"too_small":{let s=o.exact?"exactly ":o.inclusive?">=":">",c=e(o.origin);return c?`Too small: expected ${o.origin} to have ${s}${o.minimum.toString()} ${c.unit}`:`Too small: expected ${o.origin} to be ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Invalid string: must start with "${s.prefix}"`:s.format==="ends_with"?`Invalid string: must end with "${s.suffix}"`:s.format==="includes"?`Invalid string: must include "${s.includes}"`:s.format==="regex"?`Invalid string: must match pattern ${s.pattern}`:`Invalid ${n[s.format]??o.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${o.divisor}`;case"unrecognized_keys":return`Unrecognized key${o.keys.length>1?"s":""}: ${k(o.keys,", ")}`;case"invalid_key":return`Invalid key in ${o.origin}`;case"invalid_union":return o.options&&Array.isArray(o.options)&&o.options.length>0?`Invalid discriminator value. Expected ${o.options.map(c=>`'${c}'`).join(" | ")}`:o.inclusive===!1?"Invalid input: more than one option matched":"Invalid input";case"invalid_element":return`Invalid value in ${o.origin}`;default:return"Invalid input"}}},"error");function Yu(){return{localeError:kW()}}a(Yu,"default");var xW=a(()=>{let t={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"},map:{unit:"elementojn",verb:"havi"}};function e(r){return t[r]??null}a(e,"getSizing");let n={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-da\u016Dro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",mac:"MAC-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",credit_card:"kreditkarta numero",jwt:"JWT",template_literal:"enigo"},i={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=O(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Nevalida enigo: atendi\u011Dis instanceof ${r.expected}, ricevi\u011Dis ${c}`:`Nevalida enigo: atendi\u011Dis ${o}, ricevi\u011Dis ${c}`}case"invalid_value":return r.values.length===1?`Nevalida enigo: atendi\u011Dis ${A(r.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${k(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Tro granda: atendi\u011Dis ke ${r.origin??"valoro"} havu ${o}${r.maximum.toString()} ${s.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${r.origin??"valoro"} havu ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Tro malgranda: atendi\u011Dis ke ${r.origin} havu ${o}${r.minimum.toString()} ${s.unit}`:`Tro malgranda: atendi\u011Dis ke ${r.origin} estu ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${o.prefix}"`:o.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${o.suffix}"`:o.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${o.includes}"`:o.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${o.pattern}`:`Nevalida ${n[o.format]??r.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${r.divisor}`;case"unrecognized_keys":return`Nekonata${r.keys.length>1?"j":""} \u015Dlosilo${r.keys.length>1?"j":""}: ${k(r.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${r.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${r.origin}`;default:return"Nevalida enigo"}}},"error");function jk(){return{localeError:xW()}}a(jk,"default");var SW=a(()=>{let t={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function e(r){return t[r]??null}a(e,"getSizing");let n={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duraci\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",mac:"direcci\xF3n MAC",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",credit_card:"n\xFAmero de tarjeta de cr\xE9dito",jwt:"JWT",template_literal:"entrada"},i={nan:"NaN",string:"texto",number:"n\xFAmero",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"n\xFAmero grande",symbol:"s\xEDmbolo",undefined:"indefinido",null:"nulo",function:"funci\xF3n",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeraci\xF3n",union:"uni\xF3n",literal:"literal",promise:"promesa",void:"vac\xEDo",never:"nunca",unknown:"desconocido",any:"cualquiera"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=O(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Entrada inv\xE1lida: se esperaba instanceof ${r.expected}, recibido ${c}`:`Entrada inv\xE1lida: se esperaba ${o}, recibido ${c}`}case"invalid_value":return r.values.length===1?`Entrada inv\xE1lida: se esperaba ${A(r.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${k(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin),c=i[r.origin]??r.origin;return s?`Demasiado grande: se esperaba que ${c??"valor"} tuviera ${o}${r.maximum.toString()} ${s.unit??"elementos"}`:`Demasiado grande: se esperaba que ${c??"valor"} fuera ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin),c=i[r.origin]??r.origin;return s?`Demasiado peque\xF1o: se esperaba que ${c} tuviera ${o}${r.minimum.toString()} ${s.unit}`:`Demasiado peque\xF1o: se esperaba que ${c} fuera ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${o.prefix}"`:o.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${o.suffix}"`:o.format==="includes"?`Cadena inv\xE1lida: debe incluir "${o.includes}"`:o.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${o.pattern}`:`Inv\xE1lido ${n[o.format]??r.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${r.divisor}`;case"unrecognized_keys":return`Llave${r.keys.length>1?"s":""} desconocida${r.keys.length>1?"s":""}: ${k(r.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${i[r.origin]??r.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${i[r.origin]??r.origin}`;default:return"Entrada inv\xE1lida"}}},"error");function zk(){return{localeError:SW()}}a(zk,"default");var IW=a(()=>{let t={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},map:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function e(r){return t[r]??null}a(e,"getSizing");let n={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",mac:"MAC \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",credit_card:"\u0634\u0645\u0627\u0631\u0647 \u06A9\u0627\u0631\u062A \u0627\u0639\u062A\u0628\u0627\u0631\u06CC",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"},i={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0622\u0631\u0627\u06CC\u0647"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=O(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A instanceof ${r.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${c} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`:`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${o} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${c} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`}case"invalid_value":return r.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${A(r.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${k(r.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${r.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${o}${r.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${r.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${o}${r.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${r.origin} \u0628\u0627\u06CC\u062F ${o}${r.minimum.toString()} ${s.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${r.origin} \u0628\u0627\u06CC\u062F ${o}${r.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${o.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:o.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${o.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:o.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${o.includes}" \u0628\u0627\u0634\u062F`:o.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${o.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${n[o.format]??r.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${r.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${r.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${k(r.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${r.origin}`;case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return`\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${r.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}},"error");function Dk(){return{localeError:IW()}}a(Dk,"default");var EW=a(()=>{let t={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},map:{unit:"alkiota",subject:"kuvauksen"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xE4iv\xE4m\xE4\xE4r\xE4n"}};function e(r){return t[r]??null}a(e,"getSizing");let n={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-p\xE4iv\xE4m\xE4\xE4r\xE4",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",mac:"MAC-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",credit_card:"luottokortin numero",jwt:"JWT",template_literal:"templaattimerkkijono"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=O(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Virheellinen tyyppi: odotettiin instanceof ${r.expected}, oli ${c}`:`Virheellinen tyyppi: odotettiin ${o}, oli ${c}`}case"invalid_value":return r.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${A(r.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${k(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Liian suuri: ${s.subject} t\xE4ytyy olla ${o}${r.maximum.toString()} ${s.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Liian pieni: ${s.subject} t\xE4ytyy olla ${o}${r.minimum.toString()} ${s.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${o.prefix}"`:o.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${o.suffix}"`:o.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${o.includes}"`:o.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${o.pattern}`:`Virheellinen ${n[o.format]??r.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${r.divisor} monikerta`;case"unrecognized_keys":return`${r.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${k(r.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen sy\xF6te"}}},"error");function Lk(){return{localeError:EW()}}a(Lk,"default");var TW=a(()=>{let t={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(r){return t[r]??null}a(e,"getSizing");let n={regex:"expression r\xE9guli\xE8re",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",mac:"adresse MAC",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne de caract\xE8res encod\xE9e en base64",base64url:"cha\xEEne de caract\xE8res encod\xE9e en base64url",json_string:"cha\xEEne de caract\xE8res JSON",e164:"num\xE9ro au format E.164",credit_card:"num\xE9ro de carte de cr\xE9dit",jwt:"JWT",template_literal:"entr\xE9e"},i={string:"cha\xEEne de caract\xE8res",number:"nombre",int:"entier",boolean:"bool\xE9en",bigint:"grand entier",symbol:"symbole",undefined:"ind\xE9fini",null:"null",never:"jamais",void:"vide",date:"date",array:"tableau",object:"objet",tuple:"tuple",record:"record",map:"map",set:"ensemble",file:"fichier",nonoptional:"non optionnel",nan:"NaN",function:"fonction"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=O(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Entr\xE9e invalide : instance de ${r.expected} attendu, ${c} re\xE7u`:`Entr\xE9e invalide : ${o} attendu, ${c} re\xE7u`}case"invalid_value":return r.values.length===1?`Entr\xE9e invalide : ${A(r.values[0])} attendu`:`Option invalide : une valeur parmi ${k(r.values,"|")} attendue`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Trop grand : ${i[r.origin]??"valeur"} doit ${s.verb} ${o}${r.maximum.toString()} ${s.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${i[r.origin]??"valeur"} doit \xEAtre ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Trop petit : ${i[r.origin]??"valeur"} doit ${s.verb} ${o}${r.minimum.toString()} ${s.unit}`:`Trop petit : ${i[r.origin]??"valeur"} doit \xEAtre ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Cha\xEEne de caract\xE8res invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Cha\xEEne de caract\xE8res invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Cha\xEEne de caract\xE8res invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Cha\xEEne de caract\xE8res invalide : doit correspondre au motif ${o.pattern}`:`${n[o.format]??r.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${r.divisor}`;case"unrecognized_keys":return`Cl\xE9${r.keys.length>1?"s":""} non reconnue${r.keys.length>1?"s":""} : ${k(r.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${r.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${r.origin}`;default:return"Entr\xE9e invalide"}}},"error");function Mk(){return{localeError:TW()}}a(Mk,"default");var AW=a(()=>{let t={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"},map:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(r){return t[r]??null}a(e,"getSizing");let n={regex:"entr\xE9e",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",mac:"adresse MAC",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",credit_card:"num\xE9ro de carte de cr\xE9dit",jwt:"JWT",template_literal:"entr\xE9e"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=O(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Entr\xE9e invalide : attendu instanceof ${r.expected}, re\xE7u ${c}`:`Entr\xE9e invalide : attendu ${o}, re\xE7u ${c}`}case"invalid_value":return r.values.length===1?`Entr\xE9e invalide : attendu ${A(r.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${k(r.values,"|")}`;case"too_big":{let o=r.inclusive?"\u2264":"<",s=e(r.origin);return s?`Trop grand : attendu que ${r.origin??"la valeur"} ait ${o}${r.maximum.toString()} ${s.unit}`:`Trop grand : attendu que ${r.origin??"la valeur"} soit ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?"\u2265":">",s=e(r.origin);return s?`Trop petit : attendu que ${r.origin} ait ${o}${r.minimum.toString()} ${s.unit}`:`Trop petit : attendu que ${r.origin} soit ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Cha\xEEne invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${o.pattern}`:`${n[o.format]??r.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${r.divisor}`;case"unrecognized_keys":return`Cl\xE9${r.keys.length>1?"s":""} non reconnue${r.keys.length>1?"s":""} : ${k(r.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${r.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${r.origin}`;default:return"Entr\xE9e invalide"}}},"error");function Uk(){return{localeError:AW()}}a(Uk,"default");var OW=a(()=>{let t={string:{unit:"\u0A85\u0A95\u0ACD\u0AB7\u0AB0",verb:"\u0AB9\u0ACB\u0AB5\u0ABE \u0A9C\u0ACB\u0A88\u0A8F"},file:{unit:"\u0AAC\u0ABE\u0AAF\u0A9F",verb:"\u0AB9\u0ACB\u0AB5\u0ABE \u0A9C\u0ACB\u0A88\u0A8F"},array:{unit:"\u0A86\u0A87\u0A9F\u0AAE",verb:"\u0AB9\u0ACB\u0AB5\u0ABE \u0A9C\u0ACB\u0A88\u0A8F"},set:{unit:"\u0A86\u0A87\u0A9F\u0AAE",verb:"\u0AB9\u0ACB\u0AB5\u0ABE \u0A9C\u0ACB\u0A88\u0A8F"},map:{unit:"\u0A8F\u0AA8\u0ACD\u0A9F\u0ACD\u0AB0\u0AC0",verb:"\u0AB9\u0ACB\u0AB5\u0ABE \u0A9C\u0ACB\u0A88\u0A8F"}};function e(r){return t[r]??null}a(e,"getSizing");let n={regex:"\u0A87\u0AA8\u0AAA\u0AC1\u0A9F",email:"\u0A88\u0AAE\u0AC7\u0A87\u0AB2 \u0A8F\u0AA1\u0ACD\u0AB0\u0AC7\u0AB8",url:"URL",emoji:"\u0A87\u0AAE\u0ACB\u0A9C\u0AC0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0AA4\u0ABE\u0AB0\u0AC0\u0A96 \u0A85\u0AA8\u0AC7 \u0AB8\u0AAE\u0AAF",date:"ISO \u0AA4\u0ABE\u0AB0\u0AC0\u0A96",time:"ISO \u0AB8\u0AAE\u0AAF",duration:"ISO \u0A85\u0AB5\u0AA7\u0ABF",ipv4:"IPv4 \u0A8F\u0AA1\u0ACD\u0AB0\u0AC7\u0AB8",ipv6:"IPv6 \u0A8F\u0AA1\u0ACD\u0AB0\u0AC7\u0AB8",mac:"MAC \u0A8F\u0AA1\u0ACD\u0AB0\u0AC7\u0AB8",cidrv4:"IPv4 \u0AB6\u0ACD\u0AB0\u0AC7\u0AA3\u0AC0",cidrv6:"IPv6 \u0AB6\u0ACD\u0AB0\u0AC7\u0AA3\u0AC0",base64:"base64-\u0A8F\u0AA8\u0ACD\u0A95\u0ACB\u0AA1\u0AC7\u0AA1 \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97",base64url:"base64url-\u0A8F\u0AA8\u0ACD\u0A95\u0ACB\u0AA1\u0AC7\u0AA1 \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97",json_string:"JSON \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97",e164:"E.164 \u0AA8\u0A82\u0AAC\u0AB0",credit_card:"\u0A95\u0ACD\u0AB0\u0AC7\u0AA1\u0ABF\u0A9F \u0A95\u0ABE\u0AB0\u0ACD\u0AA1 \u0AA8\u0A82\u0AAC\u0AB0",jwt:"JWT",template_literal:"\u0A87\u0AA8\u0AAA\u0AC1\u0A9F"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=O(r.input),c=i[s]??s;return`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0A87\u0AA8\u0AAA\u0AC1\u0A9F: \u0A85\u0AAA\u0AC7\u0A95\u0ACD\u0AB7\u0ABF\u0AA4 ${o}, \u0AAA\u0ACD\u0AB0\u0ABE\u0AAA\u0ACD\u0AA4 ${c}`}case"invalid_value":return r.values.length===1?`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0A87\u0AA8\u0AAA\u0AC1\u0A9F: \u0A85\u0AAA\u0AC7\u0A95\u0ACD\u0AB7\u0ABF\u0AA4 ${A(r.values[0])}`:`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AB5\u0ABF\u0A95\u0AB2\u0ACD\u0AAA: ${k(r.values," | ")} \u0AAE\u0ABE\u0AA7\u0ACD\u0AAF\u0AAE\u0AA5\u0AC0 \u0A8F\u0A95 \u0A85\u0AAA\u0AC7\u0A95\u0ACD\u0AB7\u0ABF\u0AA4`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\u0A96\u0AC2\u0AAC \u0AAE\u0ACB\u0A9F\u0AC1\u0A82: ${r.origin??"\u0AAE\u0AC2\u0AB2\u0ACD\u0AAF"} ${o}${r.maximum.toString()} ${s.unit??"\u0A8F\u0AB2\u0ABF\u0AAE\u0AC7\u0AA8\u0ACD\u0A9F"} \u0AB9\u0ACB\u0AB5\u0ABE \u0A9C\u0ACB\u0A88\u0A8F`:`\u0A96\u0AC2\u0AAC \u0AAE\u0ACB\u0A9F\u0AC1\u0A82: ${r.origin??"\u0AAE\u0AC2\u0AB2\u0ACD\u0AAF"} ${o}${r.maximum.toString()} \u0AB9\u0ACB\u0AB5\u0AC1\u0A82 \u0A9C\u0ACB\u0A88\u0A8F`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\u0A96\u0AC2\u0AAC \u0AA8\u0ABE\u0AA8\u0AC1\u0A82: ${r.origin} ${o}${r.minimum.toString()} ${s.unit} \u0AB9\u0ACB\u0AB5\u0ABE \u0A9C\u0ACB\u0A88\u0A8F`:`\u0A96\u0AC2\u0AAC \u0AA8\u0ABE\u0AA8\u0AC1\u0A82: ${r.origin} ${o}${r.minimum.toString()} \u0AB9\u0ACB\u0AB5\u0AC1\u0A82 \u0A9C\u0ACB\u0A88\u0A8F`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97: "${o.prefix}" \u0AA5\u0AC0 \u0AB6\u0AB0\u0AC2 \u0AA5\u0AB5\u0AC1\u0A82 \u0A9C\u0ACB\u0A88\u0A8F`:o.format==="ends_with"?`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97: "${o.suffix}" \u0AAA\u0AB0 \u0AB8\u0AAE\u0ABE\u0AAA\u0ACD\u0AA4 \u0AA5\u0AB5\u0AC1\u0A82 \u0A9C\u0ACB\u0A88\u0A8F`:o.format==="includes"?`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97: "${o.includes}" \u0AB6\u0ABE\u0AAE\u0AC7\u0AB2 \u0AB9\u0ACB\u0AB5\u0AC1\u0A82 \u0A9C\u0ACB\u0A88\u0A8F`:o.format==="regex"?`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97: \u0AAA\u0AC7\u0A9F\u0AB0\u0ACD\u0AA8 ${o.pattern} \u0AB8\u0ABE\u0AA5\u0AC7 \u0AAE\u0AC7\u0AB3 \u0A96\u0ABE\u0AB5\u0AC1\u0A82 \u0A9C\u0ACB\u0A88\u0A8F`:`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF ${n[o.format]??r.format}`}case"not_multiple_of":return`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AA8\u0A82\u0AAC\u0AB0: ${r.divisor} \u0AA8\u0ACB \u0A97\u0AC1\u0AA3\u0ABE\u0A82\u0A95 \u0AB9\u0ACB\u0AB5\u0ACB \u0A9C\u0ACB\u0A88\u0A8F`;case"unrecognized_keys":return`\u0A93\u0AB3\u0A96\u0AC0 \u0AB6\u0A95\u0ABE\u0AA4\u0ABE \u0AA8\u0AB9\u0AC0\u0A82 \u0AA4\u0AC7 \u0A95\u0AC0${r.keys.length>1?"\u0A93":""}: ${k(r.keys,", ")}`;case"invalid_key":return`${r.origin} \u0AAE\u0ABE\u0A82 \u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0A95\u0AC0`;case"invalid_union":return r.options&&Array.isArray(r.options)&&r.options.length>0?`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AA1\u0ABF\u0AB8\u0ACD\u0A95\u0ACD\u0AB0\u0ABF\u0AAE\u0ABF\u0AA8\u0AC7\u0A9F\u0AB0 \u0AAE\u0AC2\u0AB2\u0ACD\u0AAF. \u0A85\u0AAA\u0AC7\u0A95\u0ACD\u0AB7\u0ABF\u0AA4 ${r.options.map(s=>`'${s}'`).join(" | ")}`:"\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0A87\u0AA8\u0AAA\u0AC1\u0A9F";case"invalid_element":return`${r.origin} \u0AAE\u0ABE\u0A82 \u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AAE\u0AC2\u0AB2\u0ACD\u0AAF`;default:return"\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0A87\u0AA8\u0AAA\u0AC1\u0A9F"}}},"error");function Fk(){return{localeError:OW()}}a(Fk,"default");var NW=a(()=>{let t={string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA",gender:"f"},number:{label:"\u05DE\u05E1\u05E4\u05E8",gender:"m"},boolean:{label:"\u05E2\u05E8\u05DA \u05D1\u05D5\u05DC\u05D9\u05D0\u05E0\u05D9",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA",gender:"m"},array:{label:"\u05DE\u05E2\u05E8\u05DA",gender:"m"},object:{label:"\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8",gender:"m"},null:{label:"\u05E2\u05E8\u05DA \u05E8\u05D9\u05E7 (null)",gender:"m"},undefined:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05DE\u05D5\u05D2\u05D3\u05E8 (undefined)",gender:"m"},symbol:{label:"\u05E1\u05D9\u05DE\u05D1\u05D5\u05DC (Symbol)",gender:"m"},function:{label:"\u05E4\u05D5\u05E0\u05E7\u05E6\u05D9\u05D4",gender:"f"},map:{label:"\u05DE\u05E4\u05D4 (Map)",gender:"f"},set:{label:"\u05E7\u05D1\u05D5\u05E6\u05D4 (Set)",gender:"f"},file:{label:"\u05E7\u05D5\u05D1\u05E5",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05D9\u05D3\u05D5\u05E2",gender:"m"},value:{label:"\u05E2\u05E8\u05DA",gender:"m"}},e={string:{unit:"\u05EA\u05D5\u05D5\u05D9\u05DD",shortLabel:"\u05E7\u05E6\u05E8",longLabel:"\u05D0\u05E8\u05D5\u05DA"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},number:{unit:"",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"}},n=a(l=>l?t[l]:void 0,"typeEntry"),i=a(l=>{let d=n(l);return d?d.label:l??t.unknown.label},"typeLabel"),r=a(l=>`\u05D4${i(l)}`,"withDefinite"),o=a(l=>(n(l)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA","verbFor"),s=a(l=>l?e[l]??null:null,"getSizing"),c={regex:{label:"\u05E7\u05DC\u05D8",gender:"m"},email:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",gender:"f"},url:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",gender:"f"},emoji:{label:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",gender:"m"},uuid:{label:"UUID",gender:"m"},uuidv4:{label:"UUIDv4",gender:"m"},uuidv6:{label:"UUIDv6",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",gender:"m"},time:{label:"\u05D6\u05DE\u05DF ISO",gender:"m"},duration:{label:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",gender:"m"},ipv4:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",gender:"f"},ipv6:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",gender:"f"},mac:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA MAC",gender:"f"},cidrv4:{label:"\u05D8\u05D5\u05D5\u05D7 IPv4",gender:"m"},cidrv6:{label:"\u05D8\u05D5\u05D5\u05D7 IPv6",gender:"m"},base64:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",gender:"f"},base64url:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",gender:"f"},json_string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",gender:"f"},e164:{label:"\u05DE\u05E1\u05E4\u05E8 E.164",gender:"m"},credit_card:{label:"\u05DE\u05E1\u05E4\u05E8 \u05DB\u05E8\u05D8\u05D9\u05E1 \u05D0\u05E9\u05E8\u05D0\u05D9",gender:"m"},jwt:{label:"JWT",gender:"m"},template_literal:{label:"\u05E7\u05DC\u05D8",gender:"m"},ends_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},includes:{label:"\u05E7\u05DC\u05D8",gender:"m"},lowercase:{label:"\u05E7\u05DC\u05D8",gender:"m"},starts_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},uppercase:{label:"\u05E7\u05DC\u05D8",gender:"m"}},u={nan:"NaN"};return l=>{switch(l.code){case"invalid_type":{let d=l.expected,f=u[d??""]??i(d),p=O(l.input),m=u[p]??t[p]?.label??p;return/^[A-Z]/.test(l.expected)?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${l.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${m}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${f}, \u05D4\u05EA\u05E7\u05D1\u05DC ${m}`}case"invalid_value":{if(l.values.length===1)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${A(l.values[0])}`;let d=l.values.map(m=>A(m));if(l.values.length===2)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${d[0]} \u05D0\u05D5 ${d[1]}`;let f=d[d.length-1];return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${d.slice(0,-1).join(", ")} \u05D0\u05D5 ${f}`}case"too_big":{let d=s(l.origin),f=r(l.origin??"value");if(l.origin==="string")return`${d?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${f} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${l.maximum.toString()} ${d?.unit??""} ${l.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(l.origin==="number"){let g=l.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${l.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${l.maximum}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${f} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${g}`}if(l.origin==="array"||l.origin==="set"){let g=l.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",y=l.inclusive?`${l.maximum} ${d?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${l.maximum} ${d?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${f} ${g} \u05DC\u05D4\u05DB\u05D9\u05DC ${y}`.trim()}let p=l.inclusive?"<=":"<",m=o(l.origin??"value");return d?.unit?`${d.longLabel} \u05DE\u05D3\u05D9: ${f} ${m} ${p}${l.maximum.toString()} ${d.unit}`:`${d?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${f} ${m} ${p}${l.maximum.toString()}`}case"too_small":{let d=s(l.origin),f=r(l.origin??"value");if(l.origin==="string")return`${d?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${f} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${l.minimum.toString()} ${d?.unit??""} ${l.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(l.origin==="number"){let g=l.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${l.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${l.minimum}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${f} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${g}`}if(l.origin==="array"||l.origin==="set"){let g=l.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(l.minimum===1&&l.inclusive){let v=(l.origin==="set","\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${f} ${g} \u05DC\u05D4\u05DB\u05D9\u05DC ${v}`}let y=l.inclusive?`${l.minimum} ${d?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${l.minimum} ${d?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${f} ${g} \u05DC\u05D4\u05DB\u05D9\u05DC ${y}`.trim()}let p=l.inclusive?">=":">",m=o(l.origin??"value");return d?.unit?`${d.shortLabel} \u05DE\u05D3\u05D9: ${f} ${m} ${p}${l.minimum.toString()} ${d.unit}`:`${d?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${f} ${m} ${p}${l.minimum.toString()}`}case"invalid_format":{let d=l;if(d.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${d.prefix}"`;if(d.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${d.suffix}"`;if(d.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${d.includes}"`;if(d.format==="regex")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${d.pattern}`;let f=c[d.format],p=f?.label??d.format,g=(f?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${p} \u05DC\u05D0 ${g}`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${l.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${l.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${l.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${k(l.keys,", ")}`;case"invalid_key":return"\u05E9\u05D3\u05D4 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8";case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${r(l.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}},"error");function qk(){return{localeError:NW()}}a(qk,"default");var CW=a(()=>{let t={string:{unit:"\u0905\u0915\u094D\u0937\u0930",verb:"\u0930\u0916\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F"},file:{unit:"\u092C\u093E\u0907\u091F\u094D\u0938",verb:"\u0930\u0916\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F"},array:{unit:"\u0924\u0924\u094D\u0935",verb:"\u0930\u0916\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F"},set:{unit:"\u0924\u0924\u094D\u0935",verb:"\u0930\u0916\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F"},map:{unit:"\u092A\u094D\u0930\u0935\u093F\u0937\u094D\u091F\u093F\u092F\u093E\u0901",verb:"\u0930\u0916\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F"}};function e(r){return t[r]??null}a(e,"getSizing");let n={regex:"\u0907\u0928\u092A\u0941\u091F",email:"\u0908\u092E\u0947\u0932 \u092A\u0924\u093E",url:"URL",emoji:"\u0907\u092E\u094B\u091C\u0940",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0924\u093F\u0925\u093F \u0914\u0930 \u0938\u092E\u092F",date:"ISO \u0924\u093F\u0925\u093F",time:"ISO \u0938\u092E\u092F",duration:"ISO \u0905\u0935\u0927\u093F",ipv4:"IPv4 \u092A\u0924\u093E",ipv6:"IPv6 \u092A\u0924\u093E",mac:"MAC \u092A\u0924\u093E",cidrv4:"IPv4 \u0936\u094D\u0930\u0947\u0923\u0940",cidrv6:"IPv6 \u0936\u094D\u0930\u0947\u0923\u0940",base64:"Base64-\u090F\u0928\u094D\u0915\u094B\u0921\u0947\u0921 \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917",base64url:"Base64URL-\u090F\u0928\u094D\u0915\u094B\u0921\u0947\u0921 \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917",json_string:"JSON \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917",e164:"E.164 \u0938\u0902\u0916\u094D\u092F\u093E",credit_card:"\u0915\u094D\u0930\u0947\u0921\u093F\u091F \u0915\u093E\u0930\u094D\u0921 \u0938\u0902\u0916\u094D\u092F\u093E",jwt:"JWT",template_literal:"\u0907\u0928\u092A\u0941\u091F"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=O(r.input),c=i[s]??s;return`\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 ${o}, \u092A\u094D\u0930\u093E\u092A\u094D\u0924 ${c}`}case"invalid_value":return r.values.length===1?`\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 ${A(r.values[0])}`:`\u0905\u092E\u093E\u0928\u094D\u092F \u0935\u093F\u0915\u0932\u094D\u092A: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 \u092E\u093E\u0928\u094B\u0902 \u092E\u0947\u0902 \u0938\u0947 \u090F\u0915 ${k(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\u092C\u0939\u0941\u0924 \u092C\u0921\u093C\u093E: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 \u0925\u093E \u0915\u093F ${r.origin??"\u092E\u093E\u0928"} \u092E\u0947\u0902 ${o}${r.maximum} ${s.unit} \u0939\u094B\u0902`:`\u092C\u0939\u0941\u0924 \u092C\u0921\u093C\u093E: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 \u0925\u093E \u0915\u093F ${r.origin??"\u092E\u093E\u0928"} ${o}${r.maximum} \u0939\u094B`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\u092C\u0939\u0941\u0924 \u091B\u094B\u091F\u093E: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 \u0925\u093E \u0915\u093F ${r.origin} \u092E\u0947\u0902 ${o}${r.minimum} ${s.unit} \u0939\u094B\u0902`:`\u092C\u0939\u0941\u0924 \u091B\u094B\u091F\u093E: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 \u0925\u093E \u0915\u093F ${r.origin} ${o}${r.minimum} \u0939\u094B`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917: "${o.prefix}" \u0938\u0947 \u0936\u0941\u0930\u0942 \u0939\u094B\u0928\u093E \u091A\u093E\u0939\u093F\u090F`:o.format==="ends_with"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917: "${o.suffix}" \u092A\u0930 \u0938\u092E\u093E\u092A\u094D\u0924 \u0939\u094B\u0928\u093E \u091A\u093E\u0939\u093F\u090F`:o.format==="includes"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917: \u0907\u0938\u092E\u0947\u0902 "${o.includes}" \u0936\u093E\u092E\u093F\u0932 \u0939\u094B\u0928\u093E \u091A\u093E\u0939\u093F\u090F`:o.format==="regex"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917: \u092A\u0948\u091F\u0930\u094D\u0928 ${o.pattern} \u0938\u0947 \u092E\u0947\u0932 \u0916\u093E\u0928\u093E \u091A\u093E\u0939\u093F\u090F`:`\u0905\u092E\u093E\u0928\u094D\u092F ${n[o.format]??r.format}`}case"not_multiple_of":return`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u0902\u0916\u094D\u092F\u093E: \u092F\u0939 ${r.divisor} \u0915\u093E \u0917\u0941\u0923\u091C \u0939\u094B\u0928\u093E \u091A\u093E\u0939\u093F\u090F`;case"unrecognized_keys":return`\u0905\u092A\u0930\u093F\u091A\u093F\u0924 \u0915\u0941\u0902\u091C\u0940${r.keys.length>1?"\u092F\u093E\u0901":""}: ${k(r.keys,", ")}`;case"invalid_key":return`\u0905\u092E\u093E\u0928\u094D\u092F \u0915\u0941\u0902\u091C\u0940: ${r.origin} \u092E\u0947\u0902`;case"invalid_union":return r.options&&Array.isArray(r.options)&&r.options.length>0?`\u0905\u092E\u093E\u0928\u094D\u092F \u0921\u093F\u0938\u094D\u0915\u094D\u0930\u093F\u092E\u093F\u0928\u0947\u091F\u0930 \u092E\u093E\u0928: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 ${r.options.map(s=>`'${s}'`).join(" | ")}`:"\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F";case"invalid_element":return`\u0905\u092E\u093E\u0928\u094D\u092F \u092E\u093E\u0928: ${r.origin} \u092E\u0947\u0902`;default:return"\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F"}}},"error");function Zk(){return{localeError:CW()}}a(Zk,"default");var PW=a(()=>{let t={string:{unit:"znakova",verb:"imati"},file:{unit:"bajtova",verb:"imati"},array:{unit:"stavki",verb:"imati"},set:{unit:"stavki",verb:"imati"}};function e(r){return t[r]??null}a(e,"getSizing");let n={regex:"unos",email:"email adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum i vrijeme",date:"ISO datum",time:"ISO vrijeme",duration:"ISO trajanje",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",mac:"MAC adresa",cidrv4:"IPv4 raspon",cidrv6:"IPv6 raspon",base64:"base64 kodirani tekst",base64url:"base64url kodirani tekst",json_string:"JSON tekst",e164:"E.164 broj",credit_card:"broj kreditne kartice",jwt:"JWT",template_literal:"unos"},i={nan:"NaN",string:"tekst",number:"broj",boolean:"boolean",array:"niz",object:"objekt",set:"skup",file:"datoteka",date:"datum",bigint:"bigint",symbol:"simbol",undefined:"undefined",null:"null",function:"funkcija",map:"mapa"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=O(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Neispravan unos: o\u010Dekuje se instanceof ${r.expected}, a primljeno je ${c}`:`Neispravan unos: o\u010Dekuje se ${o}, a primljeno je ${c}`}case"invalid_value":return r.values.length===1?`Neispravna vrijednost: o\u010Dekivano ${A(r.values[0])}`:`Neispravna opcija: o\u010Dekivano jedno od ${k(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin),c=i[r.origin]??r.origin;return s?`Preveliko: o\u010Dekivano da ${c??"vrijednost"} ima ${o}${r.maximum.toString()} ${s.unit??"elemenata"}`:`Preveliko: o\u010Dekivano da ${c??"vrijednost"} bude ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin),c=i[r.origin]??r.origin;return s?`Premalo: o\u010Dekivano da ${c} ima ${o}${r.minimum.toString()} ${s.unit}`:`Premalo: o\u010Dekivano da ${c} bude ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Neispravan tekst: mora zapo\u010Dinjati s "${o.prefix}"`:o.format==="ends_with"?`Neispravan tekst: mora zavr\u0161avati s "${o.suffix}"`:o.format==="includes"?`Neispravan tekst: mora sadr\u017Eavati "${o.includes}"`:o.format==="regex"?`Neispravan tekst: mora odgovarati uzorku ${o.pattern}`:`Neispravna ${n[o.format]??r.format}`}case"not_multiple_of":return`Neispravan broj: mora biti vi\u0161ekratnik od ${r.divisor}`;case"unrecognized_keys":return`Neprepoznat${r.keys.length>1?"i klju\u010Devi":" klju\u010D"}: ${k(r.keys,", ")}`;case"invalid_key":return`Neispravan klju\u010D u ${i[r.origin]??r.origin}`;case"invalid_union":return"Neispravan unos";case"invalid_element":return`Neispravna vrijednost u ${i[r.origin]??r.origin}`;default:return"Neispravan unos"}}},"error");function Vk(){return{localeError:PW()}}a(Vk,"default");var RW=a(()=>{let t={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"},map:{unit:"elem",verb:"legyen"}};function e(r){return t[r]??null}a(e,"getSizing");let n={regex:"bemenet",email:"email c\xEDm",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO id\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",mac:"MAC c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",credit_card:"hitelk\xE1rtyasz\xE1m",jwt:"JWT",template_literal:"bemenet"},i={nan:"NaN",number:"sz\xE1m",array:"t\xF6mb"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=O(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${r.expected}, a kapott \xE9rt\xE9k ${c}`:`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${o}, a kapott \xE9rt\xE9k ${c}`}case"invalid_value":return r.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${A(r.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${k(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`T\xFAl nagy: ${r.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${o}${r.maximum.toString()} ${s.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${r.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${r.origin} m\xE9rete t\xFAl kicsi ${o}${r.minimum.toString()} ${s.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${r.origin} t\xFAl kicsi ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\xC9rv\xE9nytelen string: "${o.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:o.format==="ends_with"?`\xC9rv\xE9nytelen string: "${o.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:o.format==="includes"?`\xC9rv\xE9nytelen string: "${o.includes}" \xE9rt\xE9ket kell tartalmaznia`:o.format==="regex"?`\xC9rv\xE9nytelen string: ${o.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${n[o.format]??r.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${r.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${r.keys.length>1?"s":""}: ${k(r.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${r.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${r.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}},"error");function Bk(){return{localeError:RW()}}a(Bk,"default");function V1(t,e,n){return Math.abs(t)===1?e:n}a(V1,"getArmenianPlural");function va(t){if(!t)return"";let e=["\u0561","\u0565","\u0568","\u056B","\u0578","\u0578\u0582","\u0585"],n=t[t.length-1];return t+(e.includes(n)?"\u0576":"\u0568")}a(va,"withDefiniteArticle");var jW=a(()=>{let t={string:{unit:{one:"\u0576\u0577\u0561\u0576",many:"\u0576\u0577\u0561\u0576\u0576\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},file:{unit:{one:"\u0562\u0561\u0575\u0569",many:"\u0562\u0561\u0575\u0569\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},array:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},set:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},map:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"}};function e(r){return t[r]??null}a(e,"getSizing");let n={regex:"\u0574\u0578\u0582\u057F\u0584",email:"\u0567\u056C. \u0570\u0561\u057D\u0581\u0565",url:"URL",emoji:"\u0567\u0574\u0578\u057B\u056B",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E \u0587 \u056A\u0561\u0574",date:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E",time:"ISO \u056A\u0561\u0574",duration:"ISO \u057F\u0587\u0578\u0572\u0578\u0582\u0569\u0575\u0578\u0582\u0576",ipv4:"IPv4 \u0570\u0561\u057D\u0581\u0565",ipv6:"IPv6 \u0570\u0561\u057D\u0581\u0565",mac:"MAC \u0570\u0561\u057D\u0581\u0565",cidrv4:"IPv4 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",cidrv6:"IPv6 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",base64:"base64 \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",base64url:"base64url \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",json_string:"JSON \u057F\u0578\u0572",e164:"E.164 \u0570\u0561\u0574\u0561\u0580",credit_card:"\u056F\u0580\u0565\u0564\u056B\u057F \u0584\u0561\u0580\u057F\u056B \u0570\u0561\u0574\u0561\u0580",jwt:"JWT",template_literal:"\u0574\u0578\u0582\u057F\u0584"},i={nan:"NaN",number:"\u0569\u056B\u057E",array:"\u0566\u0561\u0576\u0563\u057E\u0561\u056E"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=O(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 instanceof ${r.expected}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${c}`:`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${o}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${c}`}case"invalid_value":return r.values.length===1?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${A(r.values[1])}`:`\u054D\u056D\u0561\u056C \u057F\u0561\u0580\u0562\u0565\u0580\u0561\u056F\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 \u0570\u0565\u057F\u0587\u0575\u0561\u056C\u0576\u0565\u0580\u056B\u0581 \u0574\u0565\u056F\u0568\u055D ${k(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);if(s){let c=Number(r.maximum),u=V1(c,s.unit.one,s.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${va(r.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${o}${r.maximum.toString()} ${u}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${va(r.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);if(s){let c=Number(r.minimum),u=V1(c,s.unit.one,s.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${va(r.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${o}${r.minimum.toString()} ${u}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${va(r.origin)} \u056C\u056B\u0576\u056B ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057D\u056F\u057D\u057E\u056B "${o.prefix}"-\u0578\u057E`:o.format==="ends_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0561\u057E\u0561\u0580\u057F\u057E\u056B "${o.suffix}"-\u0578\u057E`:o.format==="includes"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057A\u0561\u0580\u0578\u0582\u0576\u0561\u056F\u056B "${o.includes}"`:o.format==="regex"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0570\u0561\u0574\u0561\u057A\u0561\u057F\u0561\u057D\u056D\u0561\u0576\u056B ${o.pattern} \u0571\u0587\u0561\u0579\u0561\u0583\u056B\u0576`:`\u054D\u056D\u0561\u056C ${n[o.format]??r.format}`}case"not_multiple_of":return`\u054D\u056D\u0561\u056C \u0569\u056B\u057E\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0562\u0561\u0566\u0574\u0561\u057A\u0561\u057F\u056B\u056F \u056C\u056B\u0576\u056B ${r.divisor}-\u056B`;case"unrecognized_keys":return`\u0549\u0573\u0561\u0576\u0561\u0579\u057E\u0561\u056E \u0562\u0561\u0576\u0561\u056C\u056B${r.keys.length>1?"\u0576\u0565\u0580":""}. ${k(r.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${va(r.origin)}-\u0578\u0582\u0574`;case"invalid_union":return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574";case"invalid_element":return`\u054D\u056D\u0561\u056C \u0561\u0580\u056A\u0565\u0584 ${va(r.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}},"error");function Kk(){return{localeError:jW()}}a(Kk,"default");var zW=a(()=>{let t={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"},map:{unit:"item",verb:"memiliki"}};function e(r){return t[r]??null}a(e,"getSizing");let n={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",mac:"alamat MAC",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",credit_card:"nomor kartu kredit",jwt:"JWT",template_literal:"input"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=O(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Input tidak valid: diharapkan instanceof ${r.expected}, diterima ${c}`:`Input tidak valid: diharapkan ${o}, diterima ${c}`}case"invalid_value":return r.values.length===1?`Input tidak valid: diharapkan ${A(r.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${k(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Terlalu besar: diharapkan ${r.origin??"value"} memiliki ${o}${r.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: diharapkan ${r.origin??"value"} menjadi ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Terlalu kecil: diharapkan ${r.origin} memiliki ${o}${r.minimum.toString()} ${s.unit}`:`Terlalu kecil: diharapkan ${r.origin} menjadi ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`String tidak valid: harus dimulai dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak valid: harus berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak valid: harus menyertakan "${o.includes}"`:o.format==="regex"?`String tidak valid: harus sesuai pola ${o.pattern}`:`${n[o.format]??r.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${r.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${r.keys.length>1?"s":""}: ${k(r.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${r.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${r.origin}`;default:return"Input tidak valid"}}},"error");function Hk(){return{localeError:zW()}}a(Hk,"default");var DW=a(()=>{let t={string:{unit:"stafi",verb:"a\xF0 hafa"},file:{unit:"b\xE6ti",verb:"a\xF0 hafa"},array:{unit:"hluti",verb:"a\xF0 hafa"},set:{unit:"hluti",verb:"a\xF0 hafa"},map:{unit:"hluti",verb:"a\xF0 hafa"}};function e(r){return t[r]??null}a(e,"getSizing");let n={regex:"gildi",email:"netfang",url:"vefsl\xF3\xF0",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og t\xEDmi",date:"ISO dagsetning",time:"ISO t\xEDmi",duration:"ISO t\xEDmalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 t\xF6lugildi",credit_card:"kreditkortan\xFAmer",jwt:"JWT",template_literal:"gildi"},i={nan:"NaN",number:"n\xFAmer",array:"fylki"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=O(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Rangt gildi: \xDE\xFA sl\xF3st inn ${c} \xFEar sem \xE1 a\xF0 vera instanceof ${r.expected}`:`Rangt gildi: \xDE\xFA sl\xF3st inn ${c} \xFEar sem \xE1 a\xF0 vera ${o}`}case"invalid_value":return r.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${A(r.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${k(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${r.origin??"gildi"} hafi ${o}${r.maximum.toString()} ${s.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${r.origin??"gildi"} s\xE9 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${r.origin} hafi ${o}${r.minimum.toString()} ${s.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${r.origin} s\xE9 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${o.prefix}"`:o.format==="ends_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${o.suffix}"`:o.format==="includes"?`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${o.includes}"`:o.format==="regex"?`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${o.pattern}`:`Rangt ${n[o.format]??r.format}`}case"not_multiple_of":return`R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${r.divisor}`;case"unrecognized_keys":return`\xD3\xFEekkt ${r.keys.length>1?"ir lyklar":"ur lykill"}: ${k(r.keys,", ")}`;case"invalid_key":return`Rangur lykill \xED ${r.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi \xED ${r.origin}`;default:return"Rangt gildi"}}},"error");function Wk(){return{localeError:DW()}}a(Wk,"default");var LW=a(()=>{let t={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"},map:{unit:"elementi",verb:"avere"}};function e(r){return t[r]??null}a(e,"getSizing");let n={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",mac:"indirizzo MAC",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",credit_card:"numero di carta di credito",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"numero",array:"vettore"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=O(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Input non valido: atteso instanceof ${r.expected}, ricevuto ${c}`:`Input non valido: atteso ${o}, ricevuto ${c}`}case"invalid_value":return r.values.length===1?`Input non valido: atteso ${A(r.values[0])}`:`Opzione non valida: atteso uno tra ${k(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Troppo grande: ${r.origin??"valore"} deve avere ${o}${r.maximum.toString()} ${s.unit??"elementi"}`:`Troppo grande: ${r.origin??"valore"} deve essere ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Troppo piccolo: ${r.origin} deve avere ${o}${r.minimum.toString()} ${s.unit}`:`Troppo piccolo: ${r.origin} deve essere ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Stringa non valida: deve iniziare con "${o.prefix}"`:o.format==="ends_with"?`Stringa non valida: deve terminare con "${o.suffix}"`:o.format==="includes"?`Stringa non valida: deve includere "${o.includes}"`:o.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${o.pattern}`:`Input non valido: ${n[o.format]??r.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${r.divisor}`;case"unrecognized_keys":return`Chiav${r.keys.length>1?"i":"e"} non riconosciut${r.keys.length>1?"e":"a"}: ${k(r.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${r.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${r.origin}`;default:return"Input non valido"}}},"error");function Gk(){return{localeError:LW()}}a(Gk,"default");var MW=a(()=>{let t={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},map:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function e(r){return t[r]??null}a(e,"getSizing");let n={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",mac:"MAC\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",credit_card:"\u30AF\u30EC\u30B8\u30C3\u30C8\u30AB\u30FC\u30C9\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"},i={nan:"NaN",number:"\u6570\u5024",array:"\u914D\u5217"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=O(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u7121\u52B9\u306A\u5165\u529B: instanceof ${r.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${c}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u5165\u529B: ${o}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${c}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`}case"invalid_value":return r.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${A(r.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${k(r.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let o=r.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",s=e(r.origin);return s?`\u5927\u304D\u3059\u304E\u308B\u5024: ${r.origin??"\u5024"}\u306F${r.maximum.toString()}${s.unit??"\u8981\u7D20"}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${r.origin??"\u5024"}\u306F${r.maximum.toString()}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let o=r.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",s=e(r.origin);return s?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${r.origin}\u306F${r.minimum.toString()}${s.unit}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${r.origin}\u306F${r.minimum.toString()}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${o.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${n[o.format]??r.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${r.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${r.keys.length>1?"\u7FA4":""}: ${k(r.keys,"\u3001")}`;case"invalid_key":return`${r.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${r.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}},"error");function Jk(){return{localeError:MW()}}a(Jk,"default");var UW=a(()=>{let t={string:{unit:"\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},file:{unit:"\u10D1\u10D0\u10D8\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},array:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},set:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},map:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"}};function e(r){return t[r]??null}a(e,"getSizing");let n={regex:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0",email:"\u10D4\u10DA-\u10E4\u10DD\u10E1\u10E2\u10D8\u10E1 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",url:"URL",emoji:"\u10D4\u10DB\u10DD\u10EF\u10D8",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8-\u10D3\u10E0\u10DD",date:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8",time:"\u10D3\u10E0\u10DD",duration:"\u10EE\u10D0\u10DC\u10D2\u10E0\u10EB\u10DA\u10D8\u10D5\u10DD\u10D1\u10D0",ipv4:"IPv4 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",ipv6:"IPv6 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",mac:"MAC \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",cidrv4:"IPv4 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",cidrv6:"IPv6 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",base64:"base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",base64url:"base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",json_string:"JSON \u10D5\u10D4\u10DA\u10D8",e164:"E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",credit_card:"\u10E1\u10D0\u10D9\u10E0\u10D4\u10D3\u10D8\u10E2\u10DD \u10D1\u10D0\u10E0\u10D0\u10D7\u10D8\u10E1 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"},i={nan:"NaN",number:"\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8",string:"\u10D5\u10D4\u10DA\u10D8",boolean:"\u10D1\u10E3\u10DA\u10D4\u10D0\u10DC\u10D8",function:"\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0",array:"\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=O(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 instanceof ${r.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${c}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${o}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${c}`}case"invalid_value":return r.values.length===1?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${A(r.values[0])}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D0\u10E0\u10D8\u10D0\u10DC\u10E2\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8\u10D0 \u10D4\u10E0\u10D7-\u10D4\u10E0\u10D7\u10D8 ${k(r.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${r.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${s.verb} ${o}${r.maximum.toString()} ${s.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${r.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${r.origin} ${s.verb} ${o}${r.minimum.toString()} ${s.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${r.origin} \u10D8\u10E7\u10DD\u10E1 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${o.prefix}"-\u10D8\u10D7`:o.format==="ends_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${o.suffix}"-\u10D8\u10D7`:o.format==="includes"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${o.includes}"-\u10E1`:o.format==="regex"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D4\u10E1\u10D0\u10D1\u10D0\u10DB\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 \u10E8\u10D0\u10D1\u10DA\u10DD\u10DC\u10E1 ${o.pattern}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${n[o.format]??r.format}`}case"not_multiple_of":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E0\u10D8\u10EA\u10EE\u10D5\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10E7\u10DD\u10E1 ${r.divisor}-\u10D8\u10E1 \u10EF\u10D4\u10E0\u10D0\u10D3\u10D8`;case"unrecognized_keys":return`\u10E3\u10EA\u10DC\u10DD\u10D1\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1${r.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8"}: ${k(r.keys,", ")}`;case"invalid_key":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${r.origin}-\u10E8\u10D8`;case"invalid_union":return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0";case"invalid_element":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0 ${r.origin}-\u10E8\u10D8`;default:return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"}}},"error");function Yk(){return{localeError:UW()}}a(Yk,"default");var FW=a(()=>{let t={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},map:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function e(r){return t[r]??null}a(e,"getSizing");let n={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",mac:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 MAC",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",credit_card:"\u179B\u17C1\u1781\u1794\u17D0\u178E\u17D2\u178E\u17A5\u178E\u1791\u17B6\u1793",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"},i={nan:"NaN",number:"\u179B\u17C1\u1781",array:"\u17A2\u17B6\u179A\u17C1 (Array)",null:"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=O(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A instanceof ${r.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${c}`:`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${c}`}case"invalid_value":return r.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${A(r.values[0])}`:`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${k(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${o} ${r.maximum.toString()} ${s.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${o} ${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin} ${o} ${r.minimum.toString()} ${s.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin} ${o} ${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${o.prefix}"`:o.format==="ends_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${o.suffix}"`:o.format==="includes"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${o.includes}"`:o.format==="regex"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${o.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${n[o.format]??r.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${r.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${k(r.keys,", ")}`;case"invalid_key":return`\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${r.origin}`;case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${r.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}},"error");function Xu(){return{localeError:FW()}}a(Xu,"default");function Xk(){return Xu()}a(Xk,"default");var qW=a(()=>{let t={string:{unit:"\u0C85\u0C95\u0CCD\u0CB7\u0CB0\u0C97\u0CB3\u0CC1",verb:"\u0CB9\u0CCA\u0C82\u0CA6\u0CB2\u0CC1"},file:{unit:"\u0CAC\u0CC8\u0C9F\u0CCD\u200C\u0C97\u0CB3\u0CC1",verb:"\u0CB9\u0CCA\u0C82\u0CA6\u0CB2\u0CC1"},array:{unit:"\u0CB5\u0CB8\u0CCD\u0CA4\u0CC1\u0C97\u0CB3\u0CC1",verb:"\u0CB9\u0CCA\u0C82\u0CA6\u0CB2\u0CC1"},set:{unit:"\u0CB5\u0CB8\u0CCD\u0CA4\u0CC1\u0C97\u0CB3\u0CC1",verb:"\u0CB9\u0CCA\u0C82\u0CA6\u0CB2\u0CC1"},map:{unit:"entries",verb:"\u0CB9\u0CCA\u0C82\u0CA6\u0CB2\u0CC1"}};function e(r){return t[r]??null}a(e,"getSizing");let n={regex:"\u0C87\u0CA8\u0CCD\u0CAA\u0CC1\u0C9F\u0CCD",email:"email \u0CB5\u0CBF\u0CB3\u0CBE\u0CB8",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0CA6\u0CBF\u0CA8\u0CBE\u0C82\u0C95\u0CA6 \u0CB8\u0CAE\u0CAF",date:"ISO \u0CA6\u0CBF\u0CA8\u0CBE\u0C82\u0C95",time:"ISO \u0CB8\u0CAE\u0CAF",duration:"ISO \u0C85\u0CB5\u0CA7\u0CBF",ipv4:"IPv4 \u0CB5\u0CBF\u0CB3\u0CBE\u0CB8",ipv6:"IPv6 \u0CB5\u0CBF\u0CB3\u0CBE\u0CB8",mac:"MAC \u0CB5\u0CBF\u0CB3\u0CBE\u0CB8",cidrv4:"IPv4 \u0CB5\u0CCD\u0CAF\u0CBE\u0CAA\u0CCD\u0CA4\u0CBF\u0CAF",cidrv6:"IPv6 \u0CB5\u0CCD\u0CAF\u0CBE\u0CAA\u0CCD\u0CA4\u0CBF\u0CAF",base64:"base64-encoded\u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD",base64url:"base64url-encoded\u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD",json_string:"JSON\u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD",e164:"E.164 \u0CB8\u0C82\u0C96\u0CCD\u0CAF\u0CC6",credit_card:"\u0C95\u0CCD\u0CB0\u0CC6\u0CA1\u0CBF\u0C9F\u0CCD \u0C95\u0CBE\u0CB0\u0CCD\u0CA1\u0CCD \u0CB8\u0C82\u0C96\u0CCD\u0CAF\u0CC6",jwt:"JWT",template_literal:"\u0C87\u0CA8\u0CCD\u0CAA\u0CC1\u0C9F\u0CCD"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=O(r.input),c=i[s]??s;return`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0C87\u0CA8\u0CCD\u200C\u0CAA\u0CC1\u0C9F\u0CCD: \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${o}, \u0CB8\u0CCD\u0CB5\u0CC0\u0C95\u0CB0\u0CBF\u0CB8\u0CBF\u0CA6\u0CA8\u0CC1 ${c}`}case"invalid_value":return r.values.length===1?`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0C87\u0CA8\u0CCD\u200C\u0CAA\u0CC1\u0C9F\u0CCD: \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${A(r.values[0])}`:`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0C86\u0CAF\u0CCD\u0C95\u0CC6: \u0C87\u0CB5\u0CC1\u0C97\u0CB3\u0CB2\u0CCD\u0CB2\u0CBF \u0C92\u0C82\u0CA6\u0CA8\u0CCD\u0CA8\u0CC1 \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${k(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\u0CA4\u0CC1\u0C82\u0CAC\u0CBE \u0CA6\u0CCA\u0CA1\u0CCD\u0CA1\u0CA6\u0CC1: \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${r.origin??"value"} \u0CB9\u0CCA\u0C82\u0CA6\u0CB2\u0CC1 ${o}${r.maximum.toString()} ${s.unit??"\u0C85\u0C82\u0CB6\u0C97\u0CB3\u0CC1"}`:`\u0CA4\u0CC1\u0C82\u0CAC\u0CBE \u0CA6\u0CCA\u0CA1\u0CCD\u0CA1\u0CA6\u0CC1: \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${r.origin??"value"} \u0C8E\u0C82\u0CA6\u0CC1 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\u0CA4\u0CC1\u0C82\u0CAC\u0CBE \u0C9A\u0CBF\u0C95\u0CCD\u0C95\u0CA6\u0CC1: \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${r.origin} \u0CB9\u0CCA\u0C82\u0CA6\u0CB2\u0CC1 ${o}${r.minimum.toString()} ${s.unit}`:`\u0CA4\u0CC1\u0C82\u0CAC\u0CBE \u0C9A\u0CBF\u0C95\u0CCD\u0C95\u0CA6\u0CC1: \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${r.origin} \u0C8E\u0C82\u0CA6\u0CC1 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF\u0CB5\u0CBE\u0CA6 \u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD: \u0C87\u0CA6\u0CB0\u0CCA\u0C82\u0CA6\u0CBF\u0C97\u0CC6 \u0CAA\u0CCD\u0CB0\u0CBE\u0CB0\u0C82\u0CAD\u0CBF\u0CB8\u0CAC\u0CC7\u0C95\u0CC1 "${o.prefix}"`:o.format==="ends_with"?`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF\u0CB5\u0CBE\u0CA6 \u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD: \u0C87\u0CA6\u0CB0\u0CCA\u0C82\u0CA6\u0CBF\u0C97\u0CC6 \u0C95\u0CCA\u0CA8\u0CC6\u0C97\u0CCA\u0CB3\u0CCD\u0CB3\u0CAC\u0CC7\u0C95\u0CC1 "${o.suffix}"`:o.format==="includes"?`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD: \u0C92\u0CB3\u0C97\u0CCA\u0C82\u0CA1\u0CBF\u0CB0\u0CAC\u0CC7\u0C95\u0CC1 "${o.includes}"`:o.format==="regex"?`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF\u0CB5\u0CBE\u0CA6 \u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD: \u0CAE\u0CBE\u0CA6\u0CB0\u0CBF\u0C97\u0CC6 \u0CB9\u0CCA\u0C82\u0CA6\u0CBF\u0C95\u0CC6\u0CAF\u0CBE\u0C97\u0CAC\u0CC7\u0C95\u0CC1 ${o.pattern}`:`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF ${n[o.format]??r.format}`}case"not_multiple_of":return`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0CB8\u0C82\u0C96\u0CCD\u0CAF\u0CC6: \u0CAC\u0CB9\u0CC1\u0CB8\u0C82\u0C96\u0CCD\u0CAF\u0CC6\u0CAF\u0CBE\u0C97\u0CBF\u0CB0\u0CAC\u0CC7\u0C95\u0CC1 ${r.divisor}`;case"unrecognized_keys":return`\u0C97\u0CC1\u0CB0\u0CC1\u0CA4\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CA6 \u0C95\u0CC0 ${r.keys.length>1?"s":""}: ${k(r.keys,", ")}`;case"invalid_key":return`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF\u0CB5\u0CBE\u0CA6 \u0C95\u0CC0 \u0C87\u0CA8\u0CCD ${r.origin}`;case"invalid_union":return r.options&&Array.isArray(r.options)&&r.options.length>0?`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0CA4\u0CBE\u0CB0\u0CA4\u0CAE\u0CCD\u0CAF \u0CAE\u0CCC\u0CB2\u0CCD\u0CAF. \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${r.options.map(s=>`'${s}'`).join(" | ")}`:"\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0C87\u0CA8\u0CCD\u200C\u0CAA\u0CC1\u0C9F\u0CCD";case"invalid_element":return`\u0CB0\u0CB2\u0CCD\u0CB2\u0CBF \u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0CAE\u0CCC\u0CB2\u0CCD\u0CAF ${r.origin}`;default:return"\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0C87\u0CA8\u0CCD\u200C\u0CAA\u0CC1\u0C9F\u0CCD"}}},"error");function Qk(){return{localeError:qW()}}a(Qk,"default");var ZW=a(()=>{let t={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"},map:{unit:"\uAC1C",verb:"to have"}};function e(r){return t[r]??null}a(e,"getSizing");let n={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",mac:"MAC \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",credit_card:"\uC2E0\uC6A9\uCE74\uB4DC \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=O(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${r.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${c}\uC785\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${o}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${c}\uC785\uB2C8\uB2E4`}case"invalid_value":return r.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${A(r.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${k(r.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let o=r.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",s=o==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",c=e(r.origin),u=c?.unit??"\uC694\uC18C";return c?`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${r.maximum.toString()}${u} ${o}${s}`:`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${r.maximum.toString()} ${o}${s}`}case"too_small":{let o=r.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",s=o==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",c=e(r.origin),u=c?.unit??"\uC694\uC18C";return c?`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${r.minimum.toString()}${u} ${o}${s}`:`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${r.minimum.toString()} ${o}${s}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:o.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:o.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:o.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${o.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${n[o.format]??r.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${r.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${k(r.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${r.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${r.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}},"error");function ex(){return{localeError:ZW()}}a(ex,"default");var Qu=a(t=>t.charAt(0).toUpperCase()+t.slice(1),"capitalizeFirstCharacter");function B1(t){let e=Math.abs(t),n=e%10,i=e%100;return i>=11&&i<=19||n===0?"many":n===1?"one":"few"}a(B1,"getUnitTypeFromNumber");var VW=a(()=>{let t={string:{unit:{one:"simbolis",few:"simboliai",many:"simboli\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne ilgesn\u0117 kaip",notInclusive:"turi b\u016Bti trumpesn\u0117 kaip"},bigger:{inclusive:"turi b\u016Bti ne trumpesn\u0117 kaip",notInclusive:"turi b\u016Bti ilgesn\u0117 kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"bait\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne didesnis kaip",notInclusive:"turi b\u016Bti ma\u017Eesnis kaip"},bigger:{inclusive:"turi b\u016Bti ne ma\u017Eesnis kaip",notInclusive:"turi b\u016Bti didesnis kaip"}}},array:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}},set:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}}};function e(r,o,s,c){let u=t[r]??null;return u===null?u:{unit:u.unit[o],verb:u.verb[c][s?"inclusive":"notInclusive"]}}a(e,"getSizing");let n={regex:"\u012Fvestis",email:"el. pa\u0161to adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukm\u0117",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",mac:"MAC adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 u\u017Ekoduota eilut\u0117",base64url:"base64url u\u017Ekoduota eilut\u0117",json_string:"JSON eilut\u0117",e164:"E.164 numeris",credit_card:"kredito kortel\u0117s numeris",jwt:"JWT",template_literal:"\u012Fvestis"},i={nan:"NaN",number:"skai\u010Dius",bigint:"sveikasis skai\u010Dius",string:"eilut\u0117",boolean:"login\u0117 reik\u0161m\u0117",undefined:"neapibr\u0117\u017Eta reik\u0161m\u0117",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulin\u0117 reik\u0161m\u0117"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=O(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Gautas tipas ${c}, o tik\u0117tasi - instanceof ${r.expected}`:`Gautas tipas ${c}, o tik\u0117tasi - ${o}`}case"invalid_value":return r.values.length===1?`Privalo b\u016Bti ${A(r.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${k(r.values,"|")} pasirinkim\u0173`;case"too_big":{let o=i[r.origin]??r.origin,s=e(r.origin,B1(Number(r.maximum)),r.inclusive??!1,"smaller");if(s?.verb)return`${Qu(o??r.origin??"reik\u0161m\u0117")} ${s.verb} ${r.maximum.toString()} ${s.unit??"element\u0173"}`;let c=r.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${Qu(o??r.origin??"reik\u0161m\u0117")} turi b\u016Bti ${c} ${r.maximum.toString()} ${s?.unit}`}case"too_small":{let o=i[r.origin]??r.origin,s=e(r.origin,B1(Number(r.minimum)),r.inclusive??!1,"bigger");if(s?.verb)return`${Qu(o??r.origin??"reik\u0161m\u0117")} ${s.verb} ${r.minimum.toString()} ${s.unit??"element\u0173"}`;let c=r.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${Qu(o??r.origin??"reik\u0161m\u0117")} turi b\u016Bti ${c} ${r.minimum.toString()} ${s?.unit}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Eilut\u0117 privalo prasid\u0117ti "${o.prefix}"`:o.format==="ends_with"?`Eilut\u0117 privalo pasibaigti "${o.suffix}"`:o.format==="includes"?`Eilut\u0117 privalo \u012Ftraukti "${o.includes}"`:o.format==="regex"?`Eilut\u0117 privalo atitikti ${o.pattern}`:`Neteisingas ${n[o.format]??r.format}`}case"not_multiple_of":return`Skai\u010Dius privalo b\u016Bti ${r.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpa\u017Eint${r.keys.length>1?"i":"as"} rakt${r.keys.length>1?"ai":"as"}: ${k(r.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let o=i[r.origin]??r.origin;return`${Qu(o??r.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}},"error");function tx(){return{localeError:VW()}}a(tx,"default");var BW=a(()=>{let t={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},map:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function e(r){return t[r]??null}a(e,"getSizing");let n={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",mac:"MAC \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",credit_card:"\u0431\u0440\u043E\u0458 \u043D\u0430 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u0430 \u043A\u0430\u0440\u0442\u0438\u0447\u043A\u0430",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"},i={nan:"NaN",number:"\u0431\u0440\u043E\u0458",array:"\u043D\u0438\u0437\u0430"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=O(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 instanceof ${r.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${c}`:`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${c}`}case"invalid_value":return r.values.length===1?`Invalid input: expected ${A(r.values[0])}`:`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${k(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${o}${r.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin} \u0434\u0430 \u0438\u043C\u0430 ${o}${r.minimum.toString()} ${s.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${o.prefix}"`:o.format==="ends_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${o.suffix}"`:o.format==="includes"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${o.includes}"`:o.format==="regex"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${o.pattern}`:`Invalid ${n[o.format]??r.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${k(r.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${r.origin}`;case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return`\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${r.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}},"error");function nx(){return{localeError:BW()}}a(nx,"default");var KW=a(()=>{let t={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"},map:{unit:"elemen",verb:"mempunyai"}};function e(r){return t[r]??null}a(e,"getSizing");let n={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",mac:"alamat MAC",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",credit_card:"nombor kad kredit",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"nombor"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=O(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Input tidak sah: dijangka instanceof ${r.expected}, diterima ${c}`:`Input tidak sah: dijangka ${o}, diterima ${c}`}case"invalid_value":return r.values.length===1?`Input tidak sah: dijangka ${A(r.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${k(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Terlalu besar: dijangka ${r.origin??"nilai"} ${s.verb} ${o}${r.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: dijangka ${r.origin??"nilai"} adalah ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Terlalu kecil: dijangka ${r.origin} ${s.verb} ${o}${r.minimum.toString()} ${s.unit}`:`Terlalu kecil: dijangka ${r.origin} adalah ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`String tidak sah: mesti bermula dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak sah: mesti mengandungi "${o.includes}"`:o.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${o.pattern}`:`${n[o.format]??r.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${r.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${k(r.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${r.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${r.origin}`;default:return"Input tidak sah"}}},"error");function rx(){return{localeError:KW()}}a(rx,"default");var HW=a(()=>{let t={string:{unit:"\u0905\u0915\u094D\u0937\u0930",verb:"\u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B"},file:{unit:"\u092C\u093E\u0907\u091F",verb:"\u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B"},array:{unit:"\u0924\u0924\u094D\u0935",verb:"\u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B"},set:{unit:"\u0924\u0924\u094D\u0935",verb:"\u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B"},map:{unit:"\u092A\u094D\u0930\u0935\u093F\u0937\u094D\u091F\u093F",verb:"\u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B"}};function e(r){return t[r]??null}a(e,"getSizing");let n={regex:"\u0907\u0928\u092A\u0941\u091F",email:"\u0907\u092E\u0947\u0932 \u0920\u0947\u0917\u093E\u0928\u093E",url:"URL",emoji:"\u0907\u092E\u094B\u091C\u0940",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u092E\u093F\u0924\u093F \u0930 \u0938\u092E\u092F",date:"ISO \u092E\u093F\u0924\u093F",time:"ISO \u0938\u092E\u092F",duration:"ISO \u0905\u0935\u0927\u093F",ipv4:"IPv4 \u0920\u0947\u0917\u093E\u0928\u093E",ipv6:"IPv6 \u0920\u0947\u0917\u093E\u0928\u093E",mac:"MAC \u0920\u0947\u0917\u093E\u0928\u093E",cidrv4:"IPv4 \u0926\u093E\u092F\u0930\u093E",cidrv6:"IPv6 \u0926\u093E\u092F\u0930\u093E",base64:"base64-\u0907\u0928\u094D\u0915\u094B\u0921 \u0917\u0930\u093F\u090F\u0915\u094B \u0938\u094D\u091F\u094D\u0930\u093F\u0919",base64url:"base64url-\u0907\u0928\u094D\u0915\u094B\u0921 \u0917\u0930\u093F\u090F\u0915\u094B \u0938\u094D\u091F\u094D\u0930\u093F\u0919",json_string:"JSON \u0938\u094D\u091F\u094D\u0930\u093F\u0919",e164:"E.164 \u0928\u092E\u094D\u092C\u0930",credit_card:"\u0915\u094D\u0930\u0947\u0921\u093F\u091F \u0915\u093E\u0930\u094D\u0921 \u0928\u092E\u094D\u092C\u0930",jwt:"JWT",template_literal:"\u0907\u0928\u092A\u0941\u091F"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=O(r.input),c=i[s]??s;return`\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 ${o}, \u092A\u094D\u0930\u093E\u092A\u094D\u0924 ${c}`}case"invalid_value":return r.values.length===1?`\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 ${A(r.values[0])}`:`\u0905\u092E\u093E\u0928\u094D\u092F \u0935\u093F\u0915\u0932\u094D\u092A: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 \u092E\u093E\u0928\u0939\u0930\u0942 \u092E\u0927\u094D\u092F\u0947 \u090F\u0915 ${k(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\u0927\u0947\u0930\u0948 \u0920\u0942\u0932\u094B: ${r.origin??"\u092E\u093E\u0928"} \u092E\u093E ${o}${r.maximum.toString()} ${s.unit} ${s.verb}`:`\u0927\u0947\u0930\u0948 \u0920\u0942\u0932\u094B: ${r.origin??"\u092E\u093E\u0928"} ${o}${r.maximum.toString()} \u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\u0927\u0947\u0930\u0948 \u0938\u093E\u0928\u094B: ${r.origin} \u092E\u093E ${o}${r.minimum.toString()} ${s.unit} ${s.verb}`:`\u0927\u0947\u0930\u0948 \u0938\u093E\u0928\u094B: ${r.origin} ${o}${r.minimum.toString()} \u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0919: "${o.prefix}" \u092C\u093E\u091F \u0938\u0941\u0930\u0941 \u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B`:o.format==="ends_with"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0919: "${o.suffix}" \u092E\u093E \u0938\u092E\u093E\u092A\u094D\u0924 \u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B`:o.format==="includes"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0919: "${o.includes}" \u0938\u092E\u093E\u0935\u0947\u0936 \u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B`:o.format==="regex"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0919: \u0922\u093E\u0901\u091A\u093E ${o.pattern} \u0938\u0901\u0917 \u092E\u0947\u0932 \u0916\u093E\u0928\u0941\u092A\u0930\u094D\u091B`:`\u0905\u092E\u093E\u0928\u094D\u092F ${n[o.format]??r.format}`}case"not_multiple_of":return`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u0902\u0916\u094D\u092F\u093E: ${r.divisor} \u0915\u094B \u0917\u0941\u0923\u091C \u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B`;case"unrecognized_keys":return`\u0905\u092A\u0930\u093F\u091A\u093F\u0924 \u0915\u0941\u091E\u094D\u091C\u0940${r.keys.length>1?"\u0939\u0930\u0942":""}: ${k(r.keys,", ")}`;case"invalid_key":return`\u0905\u092E\u093E\u0928\u094D\u092F \u0915\u0941\u091E\u094D\u091C\u0940: ${r.origin} \u092E\u093E`;case"invalid_union":return r.options&&Array.isArray(r.options)&&r.options.length>0?`\u0905\u092E\u093E\u0928\u094D\u092F \u0921\u093F\u0938\u094D\u0915\u094D\u0930\u093F\u092E\u093F\u0928\u0947\u091F\u0930 \u092E\u093E\u0928: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 ${r.options.map(s=>`'${s}'`).join(" | ")}`:"\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F";case"invalid_element":return`\u0905\u092E\u093E\u0928\u094D\u092F \u092E\u093E\u0928: ${r.origin} \u092E\u093E`;default:return"\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F"}}},"error");function ix(){return{localeError:HW()}}a(ix,"default");var WW=a(()=>{let t={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"},map:{unit:"elementen",verb:"heeft"}};function e(r){return t[r]??null}a(e,"getSizing");let n={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",mac:"MAC-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",credit_card:"creditcardnummer",jwt:"JWT",template_literal:"invoer"},i={nan:"NaN",number:"getal"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=O(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Ongeldige invoer: verwacht instanceof ${r.expected}, ontving ${c}`:`Ongeldige invoer: verwacht ${o}, ontving ${c}`}case"invalid_value":return r.values.length===1?`Ongeldige invoer: verwacht ${A(r.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${k(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin),c=r.origin==="date"?"laat":r.origin==="string"?"lang":"groot";return s?`Te ${c}: verwacht dat ${r.origin??"waarde"} ${o}${r.maximum.toString()} ${s.unit??"elementen"} ${s.verb}`:`Te ${c}: verwacht dat ${r.origin??"waarde"} ${o}${r.maximum.toString()} is`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin),c=r.origin==="date"?"vroeg":r.origin==="string"?"kort":"klein";return s?`Te ${c}: verwacht dat ${r.origin} ${o}${r.minimum.toString()} ${s.unit} ${s.verb}`:`Te ${c}: verwacht dat ${r.origin} ${o}${r.minimum.toString()} is`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Ongeldige tekst: moet met "${o.prefix}" beginnen`:o.format==="ends_with"?`Ongeldige tekst: moet op "${o.suffix}" eindigen`:o.format==="includes"?`Ongeldige tekst: moet "${o.includes}" bevatten`:o.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${o.pattern}`:`Ongeldig: ${n[o.format]??r.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${r.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${r.keys.length>1?"s":""}: ${k(r.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${r.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${r.origin}`;default:return"Ongeldige invoer"}}},"error");function ox(){return{localeError:WW()}}a(ox,"default");var GW=a(()=>{let t={string:{unit:"teikn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"element",verb:"\xE5 innehalde"},set:{unit:"element",verb:"\xE5 innehalde"},map:{unit:"element",verb:"\xE5 innehalde"}};function e(r){return t[r]??null}a(e,"getSizing");let n={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varigheit",ipv4:"IPv4-adresse",ipv6:"IPv6-adresse",mac:"MAC-adresse",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkoda streng",base64url:"base64url-enkoda streng",json_string:"JSON-streng",e164:"E.164-nummer",credit_card:"kredittkortnummer",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"tal",array:"liste"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=O(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Ugyldig input: forventa instanceof ${r.expected}, fekk ${c}`:`Ugyldig input: forventa ${o}, fekk ${c}`}case"invalid_value":return r.values.length===1?`Ugyldig verdi: forventa ${A(r.values[0])}`:`Ugyldig val: forventa eitt av ${k(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`For stor(t): forventa ${r.origin??"value"} til \xE5 ha ${o}${r.maximum.toString()} ${s.unit??"element"}`:`For stor(t): forventa ${r.origin??"value"} til \xE5 ha ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`For lite(n): forventa ${r.origin} til \xE5 ha ${o}${r.minimum.toString()} ${s.unit}`:`For lite(n): forventa ${r.origin} til \xE5 ha ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: m\xE5 slutte med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: m\xE5 innehalde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${o.pattern}`:`Ugyldig ${n[o.format]??r.format}`}case"not_multiple_of":return`Ugyldig tal: m\xE5 vere eit multiplum av ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ukjende n\xF8klar":"Ukjend n\xF8kkel"}: ${k(r.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${r.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${r.origin}`;default:return"Ugyldig input"}}},"error");function sx(){return{localeError:GW()}}a(sx,"default");var JW=a(()=>{let t={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"},map:{unit:"elementer",verb:"\xE5 inneholde"}};function e(r){return t[r]??null}a(e,"getSizing");let n={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-adresse",ipv6:"IPv6-adresse",mac:"MAC-adresse",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",credit_card:"kredittkortnummer",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"tall",array:"liste"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=O(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Ugyldig input: forventet instanceof ${r.expected}, fikk ${c}`:`Ugyldig input: forventet ${o}, fikk ${c}`}case"invalid_value":return r.values.length===1?`Ugyldig verdi: forventet ${A(r.values[0])}`:`Ugyldig valg: forventet en av ${k(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`For stor(t): forventet ${r.origin??"value"} til \xE5 ha ${o}${r.maximum.toString()} ${s.unit??"elementer"}`:`For stor(t): forventet ${r.origin??"value"} til \xE5 ha ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`For lite(n): forventet ${r.origin} til \xE5 ha ${o}${r.minimum.toString()} ${s.unit}`:`For lite(n): forventet ${r.origin} til \xE5 ha ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${o.pattern}`:`Ugyldig ${n[o.format]??r.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${k(r.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${r.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${r.origin}`;default:return"Ugyldig input"}}},"error");function ax(){return{localeError:JW()}}a(ax,"default");var YW=a(()=>{let t={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"},map:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function e(r){return t[r]??null}a(e,"getSizing");let n={regex:"giren",email:"epostag\xE2h",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO heng\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",mac:"MAC ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",credit_card:"i'tib\xE2r kart\u0131 numaras\u0131",jwt:"JWT",template_literal:"giren"},i={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=O(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`F\xE2sit giren: umulan instanceof ${r.expected}, al\u0131nan ${c}`:`F\xE2sit giren: umulan ${o}, al\u0131nan ${c}`}case"invalid_value":return r.values.length===1?`F\xE2sit giren: umulan ${A(r.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${k(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Fazla b\xFCy\xFCk: ${r.origin??"value"}, ${o}${r.maximum.toString()} ${s.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${r.origin??"value"}, ${o}${r.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Fazla k\xFC\xE7\xFCk: ${r.origin}, ${o}${r.minimum.toString()} ${s.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${r.origin}, ${o}${r.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let o=r;return o.format==="starts_with"?`F\xE2sit metin: "${o.prefix}" ile ba\u015Flamal\u0131.`:o.format==="ends_with"?`F\xE2sit metin: "${o.suffix}" ile bitmeli.`:o.format==="includes"?`F\xE2sit metin: "${o.includes}" ihtiv\xE2 etmeli.`:o.format==="regex"?`F\xE2sit metin: ${o.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${n[o.format]??r.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${r.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${r.keys.length>1?"s":""}: ${k(r.keys,", ")}`;case"invalid_key":return`${r.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${r.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}},"error");function cx(){return{localeError:YW()}}a(cx,"default");var XW=a(()=>{let t={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},map:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function e(r){return t[r]??null}a(e,"getSizing");let n={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",mac:"\u062F MAC \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",credit_card:"\u062F \u06A9\u0631\u06CC\u0689\u06CC\u067C \u06A9\u0627\u0631\u062A \u0634\u0645\u06CC\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"},i={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0627\u0631\u06D0"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=O(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F instanceof ${r.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${c} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`:`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${o} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${c} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`}case"invalid_value":return r.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${A(r.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${k(r.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${r.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${o}${r.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${r.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${o}${r.maximum.toString()} \u0648\u064A`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${r.origin} \u0628\u0627\u06CC\u062F ${o}${r.minimum.toString()} ${s.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${r.origin} \u0628\u0627\u06CC\u062F ${o}${r.minimum.toString()} \u0648\u064A`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${o.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:o.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${o.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:o.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${o.includes}" \u0648\u0644\u0631\u064A`:o.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${o.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${n[o.format]??r.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${r.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${r.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${k(r.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${r.origin} \u06A9\u06D0`;case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return`\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${r.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}},"error");function ux(){return{localeError:XW()}}a(ux,"default");var QW=a(()=>{let t={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"},map:{unit:"element\xF3w",verb:"mie\u0107"}};function e(r){return t[r]??null}a(e,"getSizing");let n={regex:"wyra\u017Cenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",mac:"adres MAC",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ci\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",credit_card:"numer karty kredytowej",jwt:"JWT",template_literal:"wej\u015Bcie"},i={nan:"NaN",number:"liczba",array:"tablica"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=O(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${r.expected}, otrzymano ${c}`:`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${o}, otrzymano ${c}`}case"invalid_value":return r.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${A(r.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${k(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${r.maximum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${r.minimum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${o.prefix}"`:o.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${o.suffix}"`:o.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${o.includes}"`:o.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${o.pattern}`:`Nieprawid\u0142ow(y/a/e) ${n[o.format]??r.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${r.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${r.keys.length>1?"s":""}: ${k(r.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${r.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${r.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}},"error");function lx(){return{localeError:QW()}}a(lx,"default");var eG=a(()=>{let t={string:{unit:"caracteres"},file:{unit:"bytes"},array:{unit:"elementos"},set:{unit:"elementos"},map:{unit:"entradas"}};function e(s){return t[s]??null}a(e,"getSizing");let n={regex:"a entrada",email:"o endere\xE7o de e-mail",url:"o URL",emoji:"o emoji",uuid:"o UUID",uuidv4:"o UUIDv4",uuidv6:"o UUIDv6",nanoid:"o nanoid",guid:"o GUID",cuid:"o cuid",cuid2:"o cuid2",ulid:"o ULID",xid:"o XID",ksuid:"o KSUID",datetime:"a data e hora ISO",date:"a data ISO",time:"a hora ISO",duration:"a dura\xE7\xE3o ISO",ipv4:"o endere\xE7o IPv4",ipv6:"o endere\xE7o IPv6",mac:"o endere\xE7o MAC",cidrv4:"o intervalo de endere\xE7os IPv4",cidrv6:"o intervalo de endere\xE7os IPv6",base64:"o texto codificado em base64",base64url:"o texto codificado em base64url",json_string:"o texto JSON",e164:"o n\xFAmero E.164",credit_card:"o n\xFAmero de cart\xE3o de cr\xE9dito",jwt:"o JWT",template_literal:"a entrada"},i={masculine:{definite:"o",indefinite:"um"},feminine:{definite:"a",indefinite:"uma"}},r={string:{name:"texto",articles:i.masculine},number:{name:"n\xFAmero",articles:i.masculine},int:{name:"n\xFAmero inteiro",articles:i.masculine},boolean:{name:"valor booleano",articles:i.masculine},bigint:{name:"n\xFAmero bigint",articles:i.masculine},symbol:{name:"s\xEDmbolo",articles:i.masculine},undefined:{name:'valor "undefined"',articles:i.masculine},null:{name:'valor "nulo"',articles:i.masculine},never:{name:'valor "never"',articles:i.masculine},void:{name:'valor "void"',articles:i.masculine},date:{name:"data",articles:i.feminine},array:{name:"vetor",articles:i.masculine},object:{name:"objeto",articles:i.masculine},tuple:{name:"tuplo",articles:i.masculine},record:{name:"registo",articles:i.masculine},map:{name:"mapa",articles:i.masculine},set:{name:"conjunto",articles:i.masculine},file:{name:"ficheiro",articles:i.masculine},nonoptional:{name:"valor n\xE3o opcional",articles:i.masculine},nan:{name:'valor "NaN"',articles:i.masculine},function:{name:"fun\xE7\xE3o",articles:i.feminine}};function o(s,c){let u=r[s]??{name:`valor "${s}"`,articles:i.masculine};return`${u.articles[c]} ${u.name}`}return a(o,"translateOriginWithArticle"),s=>{switch(s.code){case"invalid_type":{let c=o(s.expected,"indefinite"),u=O(s.input),l=o(u,"indefinite");return`Entrada inv\xE1lida: esperava ${c}, recebeu ${l}`}case"invalid_value":return s.values.length===1?`Entrada inv\xE1lida: esperava ${A(s.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperava uma das seguintes op\xE7\xF5es: ${k(s.values,"|")}`;case"too_big":{let c=s.inclusive?"<=":"<",u=e(s.origin);return u?`Demasiado grande: esperava que ${o(s.origin,"definite")} tivesse ${c} ${s.maximum.toString()} ${u.unit??"elementos"}`:`Demasiado grande: esperava que ${o(s.origin,"definite")} fosse ${c} ${s.maximum.toString()}`}case"too_small":{let c=s.inclusive?">=":">",u=e(s.origin);return u?`Demasiado pequeno: esperava que ${o(s.origin,"definite")} tivesse ${c} ${s.minimum.toString()} ${u.unit??"elementos"}`:`Demasiado pequeno: esperava que ${o(s.origin,"definite")} fosse ${c} ${s.minimum.toString()}`}case"invalid_format":{let c=s;return c.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar por "${c.prefix}"`:c.format==="ends_with"?`Texto inv\xE1lido: deve terminar em "${c.suffix}"`:c.format==="includes"?`Texto inv\xE1lido: deve incluir "${c.includes}"`:c.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${c.pattern}`:`Formato d${n[c.format]??s.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${s.divisor}`;case"unrecognized_keys":{let c=s.keys.length>1?"s":"";return`Chave${c} inv\xE1lida${c}: ${k(s.keys,", ")}`}case"invalid_key":return`Entrada inv\xE1lida n${o(s.origin,"definite")}`;case"invalid_union":return s.options&&Array.isArray(s.options)&&s.options.length>0?`Valor de discrimina\xE7\xE3o inv\xE1lido. Esperava ${s.options.map(u=>`'${u}'`).join(" | ")}`:"Entrada inv\xE1lida";case"invalid_element":return`Entrada inv\xE1lida n${o(s.origin,"definite")}`;default:return"Entrada inv\xE1lida"}}},"error");function dx(){return{localeError:eG()}}a(dx,"default");var tG=a(()=>{let t={string:{unit:"caracteres"},file:{unit:"bytes"},array:{unit:"elementos"},set:{unit:"elementos"},map:{unit:"entradas"}};function e(s){return t[s]??null}a(e,"getSizing");let n={regex:"a entrada",email:"o endere\xE7o de e-mail",url:"o URL",emoji:"o emoji",uuid:"o UUID",uuidv4:"o UUIDv4",uuidv6:"o UUIDv6",nanoid:"o nanoid",guid:"o GUID",cuid:"o cuid",cuid2:"o cuid2",ulid:"o ULID",xid:"o XID",ksuid:"o KSUID",datetime:"a data e hora ISO",date:"a data ISO",time:"a hora ISO",duration:"a dura\xE7\xE3o ISO",ipv4:"o endere\xE7o IPv4",ipv6:"o endere\xE7o IPv6",mac:"o endere\xE7o MAC",cidrv4:"a faixa de endere\xE7os IPv4",cidrv6:"a faixa de endere\xE7os IPv6",base64:"o texto codificado em base64",base64url:"o texto codificado em base64url",json_string:"o texto JSON",e164:"o n\xFAmero E.164",credit_card:"o n\xFAmero de cart\xE3o de cr\xE9dito",jwt:"o JWT",template_literal:"a entrada"},i={masculine:{definite:"o",indefinite:"um"},feminine:{definite:"a",indefinite:"uma"}},r={string:{name:"texto",articles:i.masculine},number:{name:"n\xFAmero",articles:i.masculine},int:{name:"n\xFAmero inteiro",articles:i.masculine},boolean:{name:"valor booleano",articles:i.masculine},bigint:{name:"n\xFAmero bigint",articles:i.masculine},symbol:{name:"s\xEDmbolo",articles:i.masculine},undefined:{name:'valor "undefined"',articles:i.masculine},null:{name:'valor "nulo"',articles:i.masculine},never:{name:'valor "never"',articles:i.masculine},void:{name:'valor "void"',articles:i.masculine},date:{name:"data",articles:i.feminine},array:{name:"vetor",articles:i.masculine},object:{name:"objeto",articles:i.masculine},tuple:{name:"tupla",articles:i.feminine},record:{name:"registro",articles:i.masculine},map:{name:"mapa",articles:i.masculine},set:{name:"conjunto",articles:i.masculine},file:{name:"arquivo",articles:i.masculine},nonoptional:{name:"valor n\xE3o opcional",articles:i.masculine},nan:{name:'valor "NaN"',articles:i.masculine},function:{name:"fun\xE7\xE3o",articles:i.feminine}};function o(s,c){let u=r[s]??{name:`valor "${s}"`,articles:i.masculine};return`${u.articles[c]} ${u.name}`}return a(o,"translateOriginWithArticle"),s=>{switch(s.code){case"invalid_type":{let c=o(s.expected,"indefinite"),u=O(s.input),l=o(u,"indefinite");return`Entrada inv\xE1lida: esperava ${c}, recebeu ${l}`}case"invalid_value":return s.values.length===1?`Entrada inv\xE1lida: esperava ${A(s.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperava uma das seguintes op\xE7\xF5es: ${k(s.values,"|")}`;case"too_big":{let c=s.inclusive?"<=":"<",u=e(s.origin);return u?`Grande demais: esperava que ${o(s.origin,"definite")} tivesse ${c} ${s.maximum.toString()} ${u.unit??"elementos"}`:`Grande demais: esperava que ${o(s.origin,"definite")} fosse ${c} ${s.maximum.toString()}`}case"too_small":{let c=s.inclusive?">=":">",u=e(s.origin);return u?`Pequeno demais: esperava que ${o(s.origin,"definite")} tivesse ${c} ${s.minimum.toString()} ${u.unit??"elementos"}`:`Pequeno demais: esperava que ${o(s.origin,"definite")} fosse ${c} ${s.minimum.toString()}`}case"invalid_format":{let c=s;return c.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${c.prefix}"`:c.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${c.suffix}"`:c.format==="includes"?`Texto inv\xE1lido: deve incluir "${c.includes}"`:c.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${c.pattern}`:`Formato d${n[c.format]??s.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${s.divisor}`;case"unrecognized_keys":{let c=s.keys.length>1?"s":"";return`Chave${c} inv\xE1lida${c}: ${k(s.keys,", ")}`}case"invalid_key":return`Entrada inv\xE1lida n${o(s.origin,"definite")}`;case"invalid_union":return s.options&&Array.isArray(s.options)&&s.options.length>0?`Valor de discrimina\xE7\xE3o inv\xE1lido. Esperava ${s.options.map(u=>`'${u}'`).join(" | ")}`:"Entrada inv\xE1lida";case"invalid_element":return`Entrada inv\xE1lida n${o(s.origin,"definite")}`;default:return"Entrada inv\xE1lida"}}},"error");function fx(){return{localeError:tG()}}a(fx,"default");var nG=a(()=>{let t={string:{unit:"caractere",verb:"s\u0103 aib\u0103"},file:{unit:"octe\u021Bi",verb:"s\u0103 aib\u0103"},array:{unit:"elemente",verb:"s\u0103 aib\u0103"},set:{unit:"elemente",verb:"s\u0103 aib\u0103"},map:{unit:"intr\u0103ri",verb:"s\u0103 aib\u0103"}};function e(r){return t[r]??null}a(e,"getSizing");let n={regex:"intrare",email:"adres\u0103 de email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"dat\u0103 \u0219i or\u0103 ISO",date:"dat\u0103 ISO",time:"or\u0103 ISO",duration:"durat\u0103 ISO",ipv4:"adres\u0103 IPv4",ipv6:"adres\u0103 IPv6",mac:"adres\u0103 MAC",cidrv4:"interval IPv4",cidrv6:"interval IPv6",base64:"\u0219ir codat base64",base64url:"\u0219ir codat base64url",json_string:"\u0219ir JSON",e164:"num\u0103r E.164",credit_card:"num\u0103r de card de credit",jwt:"JWT",template_literal:"intrare"},i={nan:"NaN",string:"\u0219ir",number:"num\u0103r",boolean:"boolean",function:"func\u021Bie",array:"matrice",object:"obiect",undefined:"nedefinit",symbol:"simbol",bigint:"num\u0103r mare",void:"void",never:"never",map:"hart\u0103",set:"set"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=O(r.input),c=i[s]??s;return`Intrare invalid\u0103: a\u0219teptat ${o}, primit ${c}`}case"invalid_value":return r.values.length===1?`Intrare invalid\u0103: a\u0219teptat ${A(r.values[0])}`:`Op\u021Biune invalid\u0103: a\u0219teptat una dintre ${k(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Prea mare: a\u0219teptat ca ${r.origin??"valoarea"} ${s.verb} ${o}${r.maximum.toString()} ${s.unit??"elemente"}`:`Prea mare: a\u0219teptat ca ${r.origin??"valoarea"} s\u0103 fie ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Prea mic: a\u0219teptat ca ${r.origin} ${s.verb} ${o}${r.minimum.toString()} ${s.unit}`:`Prea mic: a\u0219teptat ca ${r.origin} s\u0103 fie ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0218ir invalid: trebuie s\u0103 \xEEnceap\u0103 cu "${o.prefix}"`:o.format==="ends_with"?`\u0218ir invalid: trebuie s\u0103 se termine cu "${o.suffix}"`:o.format==="includes"?`\u0218ir invalid: trebuie s\u0103 includ\u0103 "${o.includes}"`:o.format==="regex"?`\u0218ir invalid: trebuie s\u0103 se potriveasc\u0103 cu modelul ${o.pattern}`:`Format invalid: ${n[o.format]??r.format}`}case"not_multiple_of":return`Num\u0103r invalid: trebuie s\u0103 fie multiplu de ${r.divisor}`;case"unrecognized_keys":return`Chei nerecunoscute: ${k(r.keys,", ")}`;case"invalid_key":return`Cheie invalid\u0103 \xEEn ${r.origin}`;case"invalid_union":return"Intrare invalid\u0103";case"invalid_element":return`Valoare invalid\u0103 \xEEn ${r.origin}`;default:return"Intrare invalid\u0103"}}},"error");function px(){return{localeError:nG()}}a(px,"default");function K1(t,e,n,i){let r=Math.abs(t),o=r%10,s=r%100;return s>=11&&s<=19?i:o===1?e:o>=2&&o<=4?n:i}a(K1,"getRussianPlural");var rG=a(()=>{let t={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},map:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function e(r){return t[r]??null}a(e,"getSizing");let n={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",mac:"MAC \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",credit_card:"\u043D\u043E\u043C\u0435\u0440 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u043E\u0439 \u043A\u0430\u0440\u0442\u044B",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0441\u0438\u0432"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=O(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C instanceof ${r.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${c}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${o}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${c}`}case"invalid_value":return r.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${A(r.values[0])}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${k(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);if(s){let c=Number(r.maximum),u=K1(c,s.unit.one,s.unit.few,s.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${o}${r.maximum.toString()} ${u}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);if(s){let c=Number(r.minimum),u=K1(c,s.unit.one,s.unit.few,s.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${r.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${o}${r.minimum.toString()} ${u}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${r.origin} \u0431\u0443\u0434\u0435\u0442 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${o.prefix}"`:o.format==="ends_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${o.suffix}"`:o.format==="includes"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${o.includes}"`:o.format==="regex"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${o.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${n[o.format]??r.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${r.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${r.keys.length>1?"\u0438":""}: ${k(r.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${r.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${r.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}},"error");function mx(){return{localeError:rG()}}a(mx,"default");var iG=a(()=>{let t={string:{unit:"znakov",verb:"ma\u0165"},file:{unit:"bajtov",verb:"ma\u0165"},array:{unit:"prvkov",verb:"ma\u0165"},set:{unit:"prvkov",verb:"ma\u0165"},map:{unit:"polo\u017Eiek",verb:"ma\u0165"}};function e(r){return t[r]??null}a(e,"getSizing");let n={regex:"regul\xE1rny v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"d\xE1tum a \u010Das vo form\xE1te ISO",date:"d\xE1tum vo form\xE1te ISO",time:"\u010Das vo form\xE1te ISO",duration:"doba trvania ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",mac:"MAC adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"re\u0165azec zak\xF3dovan\xFD vo form\xE1te base64",base64url:"re\u0165azec zak\xF3dovan\xFD vo form\xE1te base64url",json_string:"re\u0165azec vo form\xE1te JSON",e164:"\u010D\xEDslo E.164",credit_card:"\u010D\xEDslo kreditnej karty",jwt:"JWT",template_literal:"vstup"},i={nan:"NaN",number:"\u010D\xEDslo",string:"re\u0165azec",function:"funkcia",array:"pole"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=O(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Neplatn\xFD vstup: o\u010Dak\xE1van\xE9 instanceof ${r.expected}, obdr\u017Ean\xE9 ${c}`:`Neplatn\xFD vstup: o\u010Dak\xE1van\xE9 ${o}, obdr\u017Ean\xE9 ${c}`}case"invalid_value":return r.values.length===1?`Neplatn\xFD vstup: o\u010Dak\xE1van\xE9 ${A(r.values[0])}`:`Neplatn\xFD vstup: o\u010Dak\xE1van\xE1 jedna z hodn\xF4t ${k(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Hodnota je pr\xEDli\u0161 ve\u013Ek\xE1: ${r.origin??"hodnota"} mus\xED ma\u0165 ${o}${r.maximum.toString()} ${s.unit??"prvkov"}`:`Hodnota je pr\xEDli\u0161 ve\u013Ek\xE1: ${r.origin??"hodnota"} mus\xED by\u0165 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Hodnota je pr\xEDli\u0161 mal\xE1: ${r.origin??"hodnota"} mus\xED ma\u0165 ${o}${r.minimum.toString()} ${s.unit??"prvkov"}`:`Hodnota je pr\xEDli\u0161 mal\xE1: ${r.origin??"hodnota"} mus\xED by\u0165 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Neplatn\xFD re\u0165azec: mus\xED za\u010D\xEDna\u0165 na "${o.prefix}"`:o.format==="ends_with"?`Neplatn\xFD re\u0165azec: mus\xED kon\u010Di\u0165 na "${o.suffix}"`:o.format==="includes"?`Neplatn\xFD re\u0165azec: mus\xED obsahova\u0165 "${o.includes}"`:o.format==="regex"?`Neplatn\xFD re\u0165azec: mus\xED zodpoveda\u0165 vzoru ${o.pattern}`:`Neplatn\xFD form\xE1t ${n[o.format]??r.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED by\u0165 n\xE1sobkom ${r.divisor}`;case"unrecognized_keys":return`Nezn\xE1me kl\xFA\u010De: ${k(r.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xFA\u010D v ${r.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${r.origin}`;default:return"Neplatn\xFD vstup"}}},"error");function hx(){return{localeError:iG()}}a(hx,"default");var oG=a(()=>{let t={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"},map:{unit:"elementov",verb:"imeti"}};function e(r){return t[r]??null}a(e,"getSizing");let n={regex:"vnos",email:"e-po\u0161tni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in \u010Das",date:"ISO datum",time:"ISO \u010Das",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",mac:"MAC naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",credit_card:"\u0161tevilka kreditne kartice",jwt:"JWT",template_literal:"vnos"},i={nan:"NaN",number:"\u0161tevilo",array:"tabela"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=O(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Neveljaven vnos: pri\u010Dakovano instanceof ${r.expected}, prejeto ${c}`:`Neveljaven vnos: pri\u010Dakovano ${o}, prejeto ${c}`}case"invalid_value":return r.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${A(r.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${k(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Preveliko: pri\u010Dakovano, da bo ${r.origin??"vrednost"} imelo ${o}${r.maximum.toString()} ${s.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${r.origin??"vrednost"} ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Premajhno: pri\u010Dakovano, da bo ${r.origin} imelo ${o}${r.minimum.toString()} ${s.unit}`:`Premajhno: pri\u010Dakovano, da bo ${r.origin} ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${o.prefix}"`:o.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${o.suffix}"`:o.format==="includes"?`Neveljaven niz: mora vsebovati "${o.includes}"`:o.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${o.pattern}`:`Neveljaven ${n[o.format]??r.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${r.divisor}`;case"unrecognized_keys":return`Neprepoznan${r.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${k(r.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${r.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${r.origin}`;default:return"Neveljaven vnos"}}},"error");function gx(){return{localeError:oG()}}a(gx,"default");var sG=a(()=>{let t={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"},map:{unit:"objekt",verb:"att inneh\xE5lla"}};function e(r){return t[r]??null}a(e,"getSizing");let n={regex:"regulj\xE4rt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-adress",ipv6:"IPv6-adress",mac:"MAC-adress",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad str\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",credit_card:"kreditkortsnummer",jwt:"JWT",template_literal:"mall-literal"},i={nan:"NaN",number:"antal",array:"lista"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=O(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${r.expected}, fick ${c}`:`Ogiltig inmatning: f\xF6rv\xE4ntat ${o}, fick ${c}`}case"invalid_value":return r.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${A(r.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${k(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`F\xF6r stor(t): f\xF6rv\xE4ntade ${r.origin??"v\xE4rdet"} att ha ${o}${r.maximum.toString()} ${s.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${r.origin??"v\xE4rdet"} att ha ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`F\xF6r lite(t): f\xF6rv\xE4ntade ${r.origin??"v\xE4rdet"} att ha ${o}${r.minimum.toString()} ${s.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${r.origin??"v\xE4rdet"} att ha ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${o.prefix}"`:o.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${o.suffix}"`:o.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${o.includes}"`:o.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${o.pattern}"`:`Ogiltig(t) ${n[o.format]??r.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${k(r.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${r.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${r.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}},"error");function yx(){return{localeError:sG()}}a(yx,"default");var aG=a(()=>{let t={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},map:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function e(r){return t[r]??null}a(e,"getSizing");let n={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",mac:"MAC \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",credit_card:"\u0B95\u0B9F\u0BA9\u0BCD \u0B85\u0B9F\u0BCD\u0B9F\u0BC8 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"\u0B8E\u0BA3\u0BCD",array:"\u0B85\u0BA3\u0BBF",null:"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=O(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 instanceof ${r.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${c}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${c}`}case"invalid_value":return r.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${A(r.values[0])}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${k(r.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${o}${r.maximum.toString()} ${s.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${o}${r.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r.origin} ${o}${r.minimum.toString()} ${s.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r.origin} ${o}${r.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${o.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${n[o.format]??r.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${r.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${r.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${k(r.keys,", ")}`;case"invalid_key":return`${r.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return`${r.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}},"error");function vx(){return{localeError:aG()}}a(vx,"default");var cG=a(()=>{let t={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},map:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function e(r){return t[r]??null}a(e,"getSizing");let n={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",mac:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 MAC",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",credit_card:"\u0E2B\u0E21\u0E32\u0E22\u0E40\u0E25\u0E02\u0E1A\u0E31\u0E15\u0E23\u0E40\u0E04\u0E23\u0E14\u0E34\u0E15",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"},i={nan:"NaN",number:"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02",array:"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)",null:"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=O(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 instanceof ${r.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${c}`:`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${o} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${c}`}case"invalid_value":return r.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${A(r.values[0])}`:`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${k(r.values,"|")}`;case"too_big":{let o=r.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",s=e(r.origin);return s?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${r.maximum.toString()} ${s.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",s=e(r.origin);return s?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${r.minimum.toString()} ${s.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${o.prefix}"`:o.format==="ends_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${o.suffix}"`:o.format==="includes"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${o.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:o.format==="regex"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${o.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${n[o.format]??r.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${r.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${k(r.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${r.origin}`;case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return`\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${r.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}},"error");function bx(){return{localeError:cG()}}a(bx,"default");var uG=a(()=>{let t={string:{unit:"simwol",verb:"bolmaly"},file:{unit:"ba\xFDt",verb:"bolmaly"},array:{unit:"elementler",verb:"bolmaly"},set:{unit:"elementler",verb:"bolmaly"},map:{unit:"elementler",verb:"bolmaly"}};function e(r){return t[r]??null}a(e,"getSizing");let n={regex:"giri\u015F",email:"e-po\xE7ta salgysy",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sene we wagt",date:"ISO sene",time:"ISO wagt",duration:"ISO wagt aralygy",ipv4:"IPv4 salgysy",ipv6:"IPv6 salgysy",mac:"MAC salgysy",cidrv4:"IPv4 aralygy",cidrv6:"IPv6 aralygy",base64:"base64 bilen \u015Fifrlenen setir",base64url:"base64url bilen \u015Fifrlenen setir",json_string:"JSON setiri",e164:"E.164 nomeri",credit_card:"kredit kartyny\u0148 nomeri",jwt:"JWT",template_literal:"\u015Fablon"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=O(r.input),c=i[s]??s;return`N\xE4dogry baha: gara\u015Fylan ${o} \xFDerine ${c} alyndy`}case"invalid_value":return r.values.length===1?`N\xE4dogry baha: ${A(r.values[0])} bolmaly`:`N\xE4dogry sa\xFDlaw: a\u015Fakdakylardan biri bolmaly: ${k(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Has uly: gara\u015Fyl\xFDan ${r.origin??"baha"} ${o} ${r.maximum.toString()} ${s.unit??"element"}`:`Has uly: gara\u015Fyl\xFDan ${r.origin??"baha"} ${o} ${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Has ki\xE7i: gara\u015Fyl\xFDan ${r.origin} ${o} ${r.minimum.toString()} ${s.unit}`:`Has ki\xE7i: gara\u015Fyl\xFDan ${r.origin} ${o} ${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`N\xE4dogry setir: "${o.prefix}" bilen ba\u015Flamaly`:o.format==="ends_with"?`N\xE4dogry setir: "${o.suffix}" bilen gutarmaly`:o.format==="includes"?`N\xE4dogry setir: "${o.includes}" saklamaly`:o.format==="regex"?`N\xE4dogry setir: ${o.pattern} nusga la\xFDyk bolmaly`:`N\xE4dogry ${n[o.format]??r.format}`}case"not_multiple_of":return`N\xE4dogry san: ${r.divisor} bilen galyndysyz b\xF6l\xFCnmeli`;case"unrecognized_keys":return`Tanalma\xFDan a\xE7ar${r.keys.length>1?"lar":""}: ${k(r.keys,", ")}`;case"invalid_key":return`${r.origin} i\xE7inde n\xE4dogry a\xE7ar`;case"invalid_union":return"N\xE4dogry baha";case"invalid_element":return`${r.origin} i\xE7inde n\xE4dogry baha`;default:return"N\xE4dogry baha"}}},"error");function wx(){return{localeError:uG()}}a(wx,"default");var lG=a(()=>{let t={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},map:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function e(r){return t[r]??null}a(e,"getSizing");let n={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO s\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",mac:"MAC adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",credit_card:"kredi kart\u0131 numaras\u0131",jwt:"JWT",template_literal:"\u015Eablon dizesi"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=O(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${r.expected}, al\u0131nan ${c}`:`Ge\xE7ersiz de\u011Fer: beklenen ${o}, al\u0131nan ${c}`}case"invalid_value":return r.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${A(r.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${k(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\xC7ok b\xFCy\xFCk: beklenen ${r.origin??"de\u011Fer"} ${o}${r.maximum.toString()} ${s.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${r.origin??"de\u011Fer"} ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\xC7ok k\xFC\xE7\xFCk: beklenen ${r.origin} ${o}${r.minimum.toString()} ${s.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${r.origin} ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Ge\xE7ersiz metin: "${o.prefix}" ile ba\u015Flamal\u0131`:o.format==="ends_with"?`Ge\xE7ersiz metin: "${o.suffix}" ile bitmeli`:o.format==="includes"?`Ge\xE7ersiz metin: "${o.includes}" i\xE7ermeli`:o.format==="regex"?`Ge\xE7ersiz metin: ${o.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${n[o.format]??r.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${r.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${r.keys.length>1?"lar":""}: ${k(r.keys,", ")}`;case"invalid_key":return`${r.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${r.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}},"error");function $x(){return{localeError:lG()}}a($x,"default");var dG=a(()=>{let t={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},map:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function e(r){return t[r]??null}a(e,"getSizing");let n={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",mac:"\u0430\u0434\u0440\u0435\u0441\u0430 MAC",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",credit_card:"\u043D\u043E\u043C\u0435\u0440 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u043E\u0457 \u043A\u0430\u0440\u0442\u043A\u0438",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=O(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F instanceof ${r.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${c}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${o}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${c}`}case"invalid_value":return r.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${A(r.values[0])}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${k(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${s.verb} ${o}${r.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${r.origin} ${s.verb} ${o}${r.minimum.toString()} ${s.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${r.origin} \u0431\u0443\u0434\u0435 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${o.prefix}"`:o.format==="ends_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${o.suffix}"`:o.format==="includes"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${o.includes}"`:o.format==="regex"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${o.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${n[o.format]??r.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${r.keys.length>1?"\u0456":""}: ${k(r.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${r.origin}`;case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${r.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}},"error");function el(){return{localeError:dG()}}a(el,"default");function _x(){return el()}a(_x,"default");var fG=a(()=>{let t={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},map:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function e(r){return t[r]??null}a(e,"getSizing");let n={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",mac:"\u0627\u06CC\u0645 \u0627\u06D2 \u0633\u06CC \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",credit_card:"\u06A9\u0631\u06CC\u0688\u0679 \u06A9\u0627\u0631\u0688 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"},i={nan:"NaN",number:"\u0646\u0645\u0628\u0631",array:"\u0622\u0631\u06D2",null:"\u0646\u0644"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=O(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: instanceof ${r.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${c} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`:`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${o} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${c} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`}case"invalid_value":return r.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${A(r.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${k(r.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${r.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${o}${r.maximum.toString()} ${s.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${r.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${o}${r.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${r.origin} \u06A9\u06D2 ${o}${r.minimum.toString()} ${s.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${r.origin} \u06A9\u0627 ${o}${r.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${o.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${n[o.format]??r.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${r.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${r.keys.length>1?"\u0632":""}: ${k(r.keys,"\u060C ")}`;case"invalid_key":return`${r.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${r.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}},"error");function kx(){return{localeError:fG()}}a(kx,"default");var pG=a(()=>{let t={string:{unit:"belgi",verb:"bo\u2018lishi kerak"},file:{unit:"bayt",verb:"bo\u2018lishi kerak"},array:{unit:"element",verb:"bo\u2018lishi kerak"},set:{unit:"element",verb:"bo\u2018lishi kerak"},map:{unit:"yozuv",verb:"bo\u2018lishi kerak"}};function e(r){return t[r]??null}a(e,"getSizing");let n={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",credit_card:"kredit karta raqami",jwt:"JWT",template_literal:"kirish"},i={nan:"NaN",number:"raqam",array:"massiv"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=O(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${r.expected}, qabul qilingan ${c}`:`Noto\u2018g\u2018ri kirish: kutilgan ${o}, qabul qilingan ${c}`}case"invalid_value":return r.values.length===1?`Noto\u2018g\u2018ri kirish: kutilgan ${A(r.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${k(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Juda katta: kutilgan ${r.origin??"qiymat"} ${o}${r.maximum.toString()} ${s.unit} ${s.verb}`:`Juda katta: kutilgan ${r.origin??"qiymat"} ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Juda kichik: kutilgan ${r.origin} ${o}${r.minimum.toString()} ${s.unit} ${s.verb}`:`Juda kichik: kutilgan ${r.origin} ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Noto\u2018g\u2018ri satr: "${o.prefix}" bilan boshlanishi kerak`:o.format==="ends_with"?`Noto\u2018g\u2018ri satr: "${o.suffix}" bilan tugashi kerak`:o.format==="includes"?`Noto\u2018g\u2018ri satr: "${o.includes}" ni o\u2018z ichiga olishi kerak`:o.format==="regex"?`Noto\u2018g\u2018ri satr: ${o.pattern} shabloniga mos kelishi kerak`:`Noto\u2018g\u2018ri ${n[o.format]??r.format}`}case"not_multiple_of":return`Noto\u2018g\u2018ri raqam: ${r.divisor} ning karralisi bo\u2018lishi kerak`;case"unrecognized_keys":return`Noma\u2019lum kalit${r.keys.length>1?"lar":""}: ${k(r.keys,", ")}`;case"invalid_key":return`${r.origin} dagi kalit noto\u2018g\u2018ri`;case"invalid_union":return"Noto\u2018g\u2018ri kirish";case"invalid_element":return`${r.origin} da noto\u2018g\u2018ri qiymat`;default:return"Noto\u2018g\u2018ri kirish"}}},"error");function xx(){return{localeError:pG()}}a(xx,"default");var mG=a(()=>{let t={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},map:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function e(r){return t[r]??null}a(e,"getSizing");let n={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ng\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",mac:"\u0111\u1ECBa ch\u1EC9 MAC",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",credit_card:"s\u1ED1 th\u1EBB t\xEDn d\u1EE5ng",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"},i={nan:"NaN",number:"s\u1ED1",array:"m\u1EA3ng"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=O(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i instanceof ${r.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${c}`:`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${o}, nh\u1EADn \u0111\u01B0\u1EE3c ${c}`}case"invalid_value":return r.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${A(r.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${k(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${r.origin??"gi\xE1 tr\u1ECB"} ${s.verb} ${o}${r.maximum.toString()} ${s.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${r.origin??"gi\xE1 tr\u1ECB"} ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${r.origin} ${s.verb} ${o}${r.minimum.toString()} ${s.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${r.origin} ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${o.prefix}"`:o.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${o.suffix}"`:o.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${o.includes}"`:o.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${o.pattern}`:`${n[o.format]??r.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${r.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${k(r.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${r.origin}`;case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return`Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${r.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}},"error");function Sx(){return{localeError:mG()}}a(Sx,"default");var hG=a(()=>{let t={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"},map:{unit:"\u9879",verb:"\u5305\u542B"}};function e(r){return t[r]??null}a(e,"getSizing");let n={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",mac:"MAC\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",credit_card:"\u4FE1\u7528\u5361\u53F7",jwt:"JWT",template_literal:"\u8F93\u5165"},i={nan:"NaN",number:"\u6570\u5B57",array:"\u6570\u7EC4",null:"\u7A7A\u503C(null)"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=O(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${r.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${c}`:`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${o}\uFF0C\u5B9E\u9645\u63A5\u6536 ${c}`}case"invalid_value":return r.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${A(r.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${k(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${r.origin??"\u503C"} ${o}${r.maximum.toString()} ${s.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${r.origin??"\u503C"} ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${r.origin} ${o}${r.minimum.toString()} ${s.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${r.origin} ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${o.prefix}" \u5F00\u5934`:o.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${o.suffix}" \u7ED3\u5C3E`:o.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${o.includes}"`:o.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${o.pattern}`:`\u65E0\u6548${n[o.format]??r.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${r.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${k(r.keys,", ")}`;case"invalid_key":return`${r.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${r.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}},"error");function Ix(){return{localeError:hG()}}a(Ix,"default");var gG=a(()=>{let t={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},map:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function e(r){return t[r]??null}a(e,"getSizing");let n={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",mac:"MAC \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",credit_card:"\u4FE1\u7528\u5361\u865F",jwt:"JWT",template_literal:"\u8F38\u5165"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=O(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${r.expected}\uFF0C\u4F46\u6536\u5230 ${c}`:`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${o}\uFF0C\u4F46\u6536\u5230 ${c}`}case"invalid_value":return r.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${A(r.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${k(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${r.origin??"\u503C"} \u61C9\u70BA ${o}${r.maximum.toString()} ${s.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${r.origin??"\u503C"} \u61C9\u70BA ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${r.origin} \u61C9\u70BA ${o}${r.minimum.toString()} ${s.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${r.origin} \u61C9\u70BA ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${o.prefix}" \u958B\u982D`:o.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${o.suffix}" \u7D50\u5C3E`:o.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${o.includes}"`:o.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${o.pattern}`:`\u7121\u6548\u7684 ${n[o.format]??r.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${r.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${r.keys.length>1?"\u5011":""}\uFF1A${k(r.keys,"\u3001")}`;case"invalid_key":return`${r.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${r.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}},"error");function Ex(){return{localeError:gG()}}a(Ex,"default");var yG=a(()=>{let t={string:{unit:"\xE0mi",verb:"n\xED"},file:{unit:"bytes",verb:"n\xED"},array:{unit:"nkan",verb:"n\xED"},set:{unit:"nkan",verb:"n\xED"},map:{unit:"nkan",verb:"n\xED"}};function e(r){return t[r]??null}a(e,"getSizing");let n={regex:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9",email:"\xE0d\xEDr\u1EB9\u0301s\xEC \xECm\u1EB9\u0301l\xEC",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\xE0k\xF3k\xF2 ISO",date:"\u1ECDj\u1ECD\u0301 ISO",time:"\xE0k\xF3k\xF2 ISO",duration:"\xE0k\xF3k\xF2 t\xF3 p\xE9 ISO",ipv4:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv4",ipv6:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv6",mac:"\xE0d\xEDr\u1EB9\u0301s\xEC MAC",cidrv4:"\xE0gb\xE8gb\xE8 IPv4",cidrv6:"\xE0gb\xE8gb\xE8 IPv6",base64:"\u1ECD\u0300r\u1ECD\u0300 t\xED a k\u1ECD\u0301 n\xED base64",base64url:"\u1ECD\u0300r\u1ECD\u0300 base64url",json_string:"\u1ECD\u0300r\u1ECD\u0300 JSON",e164:"n\u1ECD\u0301mb\xE0 E.164",credit_card:"n\u1ECDmba kaadi gbese",jwt:"JWT",template_literal:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"},i={nan:"NaN",number:"n\u1ECD\u0301mb\xE0",array:"akop\u1ECD"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=O(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi instanceof ${r.expected}, \xE0m\u1ECD\u0300 a r\xED ${c}`:`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${o}, \xE0m\u1ECD\u0300 a r\xED ${c}`}case"invalid_value":return r.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${A(r.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${k(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${r.origin??"iye"} ${s.verb} ${o}${r.maximum} ${s.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${o}${r.maximum}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${r.origin} ${s.verb} ${o}${r.minimum} ${s.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${o}${r.minimum}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\u1EB9\u0300r\u1EB9\u0300 p\u1EB9\u0300l\xFA "${o.prefix}"`:o.format==="ends_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${o.suffix}"`:o.format==="includes"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${o.includes}"`:o.format==="regex"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${o.pattern}`:`A\u1E63\xEC\u1E63e: ${n[o.format]??r.format}`}case"not_multiple_of":return`N\u1ECD\u0301mb\xE0 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 j\u1EB9\u0301 \xE8y\xE0 p\xEDp\xEDn ti ${r.divisor}`;case"unrecognized_keys":return`B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${k(r.keys,", ")}`;case"invalid_key":return`B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${r.origin}`;case"invalid_union":return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e";case"invalid_element":return`Iye a\u1E63\xEC\u1E63e n\xEDn\xFA ${r.origin}`;default:return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"}}},"error");function Tx(){return{localeError:yG()}}a(Tx,"default");var H1,Ax=Symbol("ZodOutput"),Ox=Symbol("ZodInput"),ng=class{static{a(this,"$ZodRegistry")}constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...n){let i=n[0];return this._map.set(e,i),i&&typeof i=="object"&&"id"in i&&this._idmap.set(i.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let n=this._map.get(e);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(e),this}get(e){let n=e._zod.parent;if(n){let i={...this.get(n)??{}};delete i.id;let r={...i,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function rg(){return new ng}a(rg,"registry");(H1=globalThis).__zod_globalRegistry??(H1.__zod_globalRegistry=rg());var _t=globalThis.__zod_globalRegistry;var In=Symbol.for("zod.compile.invalid"),W1=Symbol.for("zod.compile.fallback"),or=class extends Error{static{a(this,"ZodCompileAsyncError")}constructor(e="z.compile does not support async refinements, transforms, or checks"){super(e),this.name="ZodCompileAsyncError"}},he=class extends Error{static{a(this,"ZodCompileUnsupportedError")}constructor(e,n=!0){super(`z.compile does not support ${e}; this schema must use the runtime parser`),this.name="ZodCompileUnsupportedError",this.islandable=n}};function bG(t,e){try{return ig(t,{assertOnly:!0})}catch{return e}}a(bG,"compileValidator");function Rx(t,e){try{let n=ig(t),i=_e(t),r=t._zod.run,o=r.__originalRun??r,s=a((c,u)=>{if(u?.async||u?.direction==="backward"||u?.skipChecks||u?.[W1]||u&&tg(u,c.value))return o(c,u);let l=n(c.value);return l!==In?(c.value=l,c):(u&&(u[W1]=!0),o(c,u))},"wrapped");return s.__originalRun=o,i._zod.bag.fallbackRun=o,i._zod.bag.validator=bG(t,n),i._zod.run=s,r.__originalRun||wG(i,t,n),i}catch(n){if(e?.strict)throw n;return t}}a(Rx,"compile");function wG(t,e,n){let i=t,r=e;if(typeof r.safeParse=="function"){let o=r.safeParse;i.safeParse=(s,c)=>{let u=n(s);return u!==In?{success:!0,data:u}:o(s,c)}}if(typeof r.parse=="function"){let o=r.parse;i.parse=(s,c)=>{let u=n(s);return u!==In?u:o(s,c)}}}a(wG,"installCompiledUserMethods");function ig(t,e){let n=!0;try{n=kk(t)}catch{}if(n)throw new he("a schema whose subtree contains a reference cycle");let i={constants:new Map,constantCounter:0,varCounter:0},r=new Bo(["input"]),o=Be(r,i,t,"input",!e?.assertOnly);r.write(o===null?"return true;":`return ${o};`);let s=["INVALID",...i.constants.keys()],c=[In,...i.constants.values()],u=r.content.join(`
|
|
204
|
+
`),l=e?.debug?s.length>0?`// Constants: ${s.join(", ")}
|
|
205
|
+
${u}`:u:"",d=Function,f=`return (input) => {
|
|
206
|
+
${u}
|
|
207
|
+
}`,p;try{p=new d(...s,f)(...c)}catch(m){throw new he(`this schema (generated code failed to evaluate: ${m.message})`)}return e?.debug&&(p.code=l),p}a(ig,"compileFn");function J(t,e){for(let[i,r]of t.constants)if(r===e)return i;let n=`c${t.constantCounter++}`;return t.constants.set(n,e),n}a(J,"addConstant");function X(t){return`v${t.varCounter++}`}a(X,"newVar");function $G(t,e){let n=t._zod.run({value:e,issues:[]},{});if(n&&typeof n.then=="function")return In;let i=n;return i.issues.length===0?i.value:In}a($G,"runtimeRun");function Vt(t,e,n,i,r=!0){let o=t.content.length,s=e.constants.size,c=e.constantCounter,u=e.varCounter;try{return Be(t,e,n,i,r)}catch(l){if(!(l instanceof he)||!l.islandable)throw l;if(t.content.length=o,e.constants.size>s){let d=Array.from(e.constants.keys()).slice(s);for(let f of d)e.constants.delete(f)}return e.constantCounter=c,e.varCounter=u,_G(t,e,n,i)}}a(Vt,"compileChild");function _G(t,e,n,i){let r=J(e,n),o=J(e,$G),s=X(e);return t.write(`const ${s} = ${o}(${r}, ${i});`),t.write(`if (${s} === INVALID) return INVALID;`),s}a(_G,"emitRuntimeIsland");var kG=new Set(["max_size","min_size","size_equals","max_length","min_length","length_equals"]);function xG(t,e,n,i){let r=n._zod.def.checks;if(!r||r.length===0)return i;let o=i;for(let s of r){let c=s._zod.def;if(c.when&&!kG.has(c.check))throw new he('check with a custom "when" condition');switch(c.check){case"greater_than":SG(t,e,c,o);break;case"less_than":IG(t,e,c,o);break;case"multiple_of":EG(t,e,c,o);break;case"number_format":X1(t,c,o);break;case"min_length":{let u=Ko(c.minimum,"min_length"),l=Nx(t,e,o,`${o}.length >= ${u} && ${o}.length < ${c.minimum*2}`);t.write(`if (${l} < ${u}) return INVALID;`);break}case"max_length":{let u=Ko(c.maximum,"max_length"),l=Nx(t,e,o,`${o}.length > ${u}`);t.write(`if (${l} > ${u}) return INVALID;`);break}case"length_equals":{let u=Ko(c.length,"length_equals"),l=Nx(t,e,o,`${o}.length >= ${u} && ${o}.length <= ${c.length*2}`);t.write(`if (${l} !== ${u}) return INVALID;`);break}case"min_size":t.write(`if (${o}.size < ${Ko(c.minimum,"min_size")}) return INVALID;`);break;case"max_size":t.write(`if (${o}.size > ${Ko(c.maximum,"max_size")}) return INVALID;`);break;case"size_equals":t.write(`if (${o}.size !== ${Ko(c.size,"size_equals")}) return INVALID;`);break;case"string_format":o=Q1(t,e,c,o);break;case"custom":o=CG(t,e,s,o);break;case"bigint_format":TG(t,c,o);break;case"mime_type":AG(t,e,c,o);break;case"property":OG(t,e,c,o);break;case"overwrite":{let u=X(e);NG(t,e,s,o,u),o=u;break}default:throw new he(`check type ${c.check}`)}}return o}a(xG,"generateChecks");function Nx(t,e,n,i){let r=J(e,Fo),o=X(e);return t.write(`const ${o} = typeof ${n} === "string" && ${i} ? ${r}(${n}) : ${n}.length;`),o}a(Nx,"codePointLengthVar");function Ko(t,e){if(typeof t!="number"||!Number.isFinite(t))throw new he(`${e} bound of type ${typeof t}`);return`${t}`}a(Ko,"numericOperand");function Y1(t,e){if(typeof e=="bigint")return`${e}n`;if(typeof e=="number"){if(Number.isNaN(e))throw new he("comparison check with NaN bound");return`${e}`}if(e instanceof Date){if(Number.isNaN(e.getTime()))throw new he("comparison check with Invalid Date bound");return J(t,e)}throw new he(`comparison check bound of type ${typeof e}`)}a(Y1,"comparisonOperand");function SG(t,e,n,i){let r=n.inclusive?"<":"<=";t.write(`if (${i} ${r} ${Y1(e,n.value)}) return INVALID;`)}a(SG,"generateGreaterThanCheck");function IG(t,e,n,i){let r=n.inclusive?">":">=";t.write(`if (${i} ${r} ${Y1(e,n.value)}) return INVALID;`)}a(IG,"generateLessThanCheck");function EG(t,e,n,i){if(typeof n.value=="bigint"){if(n.value===BigInt(0))throw new he("multiple_of check with a zero divisor");t.write(`if (${i} % ${n.value}n !== 0n) return INVALID;`)}else{let r=J(e,Pu);t.write(`if (${r}(${i}, ${Ko(n.value,"multiple_of")}) !== 0) return INVALID;`)}}a(EG,"generateMultipleOfCheck");function X1(t,e,n){let i=e.format;switch(i){case"safeint":t.write(`if (!Number.isSafeInteger(${n})) return INVALID;`);break;case"int32":t.write(`if (!Number.isInteger(${n}) || ${n} < -2147483648 || ${n} > 2147483647) return INVALID;`);break;case"uint32":t.write(`if (!Number.isInteger(${n}) || ${n} < 0 || ${n} > 4294967295) return INVALID;`);break;case"float32":t.write(`if (!Number.isFinite(${n}) || ${n} < -3.4028234663852886e38 || ${n} > 3.4028234663852886e38) return INVALID;`);break;case"float64":t.write(`if (!Number.isFinite(${n})) return INVALID;`);break;default:throw new he(`number format ${i}`)}}a(X1,"generateNumberFormatCheck");function TG(t,e,n){let i=e.format;if(i)switch(i){case"int64":t.write(`if (${n} < -9223372036854775808n || ${n} > 9223372036854775807n) return INVALID;`);break;case"uint64":t.write(`if (${n} < 0n || ${n} > 18446744073709551615n) return INVALID;`);break;default:throw new he(`bigint format ${i}`)}}a(TG,"generateBigIntFormatCheck");function AG(t,e,n,i){let r=n.mime;if(r&&r.length>0){let o=J(e,new Set(r));t.write(`if (!${o}.has(${i}.type)) return INVALID;`)}}a(AG,"generateMimeTypeCheck");function OG(t,e,n,i){let r=`${i}[${JSON.stringify(n.property)}]`;Be(t,e,n.schema,r)}a(OG,"generatePropertyCheck");function NG(t,e,n,i,r){let o=n._zod.def.tx;if(!o)throw new he("overwrite check without a transform function");if(Go(o))throw new or("z.compile: async overwrite transforms are not supported");let s=J(e,o);t.write(`const ${r} = ${s}(${i});`)}a(NG,"generateOverwriteCheck");function Cx(){throw new on}a(Cx,"throwAsync");function jx(t){this.issues.push(t)}a(jx,"pushIssue");function CG(t,e,n,i){let r=n._zod.def;if(r.fn){if(Go(r.fn))throw new or("z.compile: async .refine() predicates are not supported");let o=J(e,r.fn),s=J(e,Cx),c=X(e);return t.write(`const ${c} = ${o}(${i});`),t.write(`if (${c} instanceof Promise) ${s}();`),t.write(`if (!${c}) return INVALID;`),i}if(n._zod.check){if(Go(n._zod.check))throw new or("z.compile: async .superRefine() / check functions are not supported");let o=n._zod.check,c=J(e,a(l=>{let d={value:l,issues:[],addIssue:jx};return o(d)instanceof Promise&&Cx(),d.issues.length===0?d.value:In},"helperFn")),u=X(e);return t.write(`const ${u} = ${c}(${i});`),t.write(`if (${u} === INVALID) return INVALID;`),u}throw new he("custom check without a predicate or check function")}a(CG,"generateCustomRefineCheck");var PG=new Set(["cidrv4","cuid","cuid2","date","datetime","duration","e164","email","emoji","ends_with","guid","includes","ipv4","ksuid","lowercase","mac","nanoid","regex","starts_with","time","ulid","uppercase","uuid","xid"]);function Q1(t,e,n,i){let r=n.format;if(r==="base64"){let u=J(e,Vu);return t.write(`if (!${u}(${i})) return INVALID;`),i}if(r==="base64url"){let u=J(e,uh);return t.write(`if (!${u}(${i})) return INVALID;`),i}if(r==="jwt"){let u=J(e,mh),l=J(e,n.alg??null);return t.write(`if (!${u}(${i}, ${l})) return INVALID;`),i}if(r==="ipv6"){let u=J(e,Zu);return t.write(`if (!${u}(${i})) return INVALID;`),i}if(r==="cidrv6"){let u=J(e,sh);return t.write(`if (!${u}(${i})) return INVALID;`),i}if(r==="credit_card"){let u=J(e,fh);return t.write(`if (!${u}(${i})) return INVALID;`),i}let o=n;if(r==="url"||r==="httpurl"||o.normalize||o.hostname!==void 0||o.protocol!==void 0){let u=J(e,Vm),l=J(e,n),d=X(e),f=X(e);if(t.write(`const ${d} = ${i}.trim();`),t.write(`const ${f} = ${u}(${d}, ${l});`),t.write(`if (typeof ${f} === "number") return INVALID;`),o.hostname!==void 0){let g=J(e,Km);t.write(`if (!${g}(${f}, ${l}.hostname)) return INVALID;`)}if(o.protocol!==void 0){let g=J(e,Hm);t.write(`if (!${g}(${f}, ${l}.protocol)) return INVALID;`)}let p=X(e),m=o.normalize?`${f}.href`:`${J(e,Bm)}(${d})`;return t.write(`const ${p} = ${m};`),p}let s=n.fn;if(s){if(Go(s))throw new he(`async string format ${r}`);let u=J(e,s);return t.write(`if (!${u}(${i})) return INVALID;`),i}if(PG.has(r)&&n.pattern){let u=J(e,n.pattern);return t.write(`${u}.lastIndex = 0;`),t.write(`if (!${u}.test(${i})) return INVALID;`),i}let c=n.format;switch(c){case"regex":throw new he("regex format without a pattern");case"lowercase":t.write(`if (${i} !== ${i}.toLowerCase()) return INVALID;`);break;case"uppercase":t.write(`if (${i} !== ${i}.toUpperCase()) return INVALID;`);break;case"includes":t.write(`if (!${i}.includes(${tn(n.includes)})) return INVALID;`);break;case"starts_with":{let u=n.prefix;t.write(`if (${i}.slice(0, ${u.length}) !== ${tn(u)}) return INVALID;`);break}case"ends_with":{let u=n.suffix;t.write(`if (${i}.slice(-${u.length}) !== ${tn(u)}) return INVALID;`);break}default:throw new he(`string format ${c}`)}return i}a(Q1,"generateStringFormatCheck");function Be(t,e,n,i,r=!0){let o=n._zod.def,s=o.type;if(o.coerce)throw new he(`coercion (z.coerce.${s}())`);let c=r||!!o.checks?.length,u;switch(s){case"string":u=RG(t,e,n,i);break;case"number":u=jG(t,n,i);break;case"boolean":u=zG(t,i);break;case"bigint":u=DG(t,n,i);break;case"symbol":u=LG(t,i);break;case"undefined":u=MG(t,i);break;case"null":u=UG(t,i);break;case"any":case"unknown":u=i;break;case"never":t.write("return INVALID;"),u=i;break;case"void":u=FG(t,i);break;case"nan":u=qG(t,i);break;case"date":u=ZG(t,i);break;case"object":u=VG(t,e,n,i,c);break;case"optional":u=BG(t,e,n,i,c);break;case"nullable":u=WG(t,e,n,i,c);break;case"array":u=GG(t,e,n,i,c);break;case"literal":u=JG(t,e,n,i);break;case"enum":u=YG(t,e,n,i);break;case"readonly":{let l=G1(t,e,n,i),d=X(e);t.write(`const ${d} = Object.freeze(${l});`),u=d;break}case"success":G1(t,e,n,i),u="true";break;case"default":case"prefault":u=XG(t,e,n,i);break;case"nonoptional":u=QG(t,e,n,i);break;case"tuple":u=eJ(t,e,n,i);break;case"union":u=tJ(t,e,n,i);break;case"intersection":u=iJ(t,e,n,i);break;case"record":u=oJ(t,e,n,i);break;case"map":u=aJ(t,e,n,i);break;case"set":u=cJ(t,e,n,i);break;case"file":u=uJ(t,i);break;case"template_literal":u=lJ(t,e,n,i);break;case"lazy":u=dJ(t,e,n,i);break;case"pipe":u=fJ(t,e,n,i);break;case"custom":u=pJ(t,e,n,i);break;case"transform":u=gJ(t,e,n,i);break;case"catch":u=hJ(t,e,n,i);break;default:throw new he(`schema type ${s}`)}return u===null?null:xG(t,e,n,u)}a(Be,"generateCheck");function RG(t,e,n,i){t.write(`if (typeof ${i} !== "string") return INVALID;`);let r=n._zod.def;return r.format===void 0?i:Q1(t,e,r,i)}a(RG,"generateStringCheck");function jG(t,e,n){t.write(`if (typeof ${n} !== "number" || !Number.isFinite(${n})) return INVALID;`);let i=e._zod.def;return i.check==="number_format"&&i.format&&X1(t,{format:i.format},n),n}a(jG,"generateNumberCheck");function zG(t,e){return t.write(`if (typeof ${e} !== "boolean") return INVALID;`),e}a(zG,"generateBooleanCheck");function DG(t,e,n){t.write(`if (typeof ${n} !== "bigint") return INVALID;`);let i=e._zod.def;if(i.format)switch(i.format){case"int64":t.write(`if (${n} < -9223372036854775808n || ${n} > 9223372036854775807n) return INVALID;`);break;case"uint64":t.write(`if (${n} < 0n || ${n} > 18446744073709551615n) return INVALID;`);break}return n}a(DG,"generateBigIntCheck");function LG(t,e){return t.write(`if (typeof ${e} !== "symbol") return INVALID;`),e}a(LG,"generateSymbolCheck");function MG(t,e){return t.write(`if (${e} !== undefined) return INVALID;`),e}a(MG,"generateUndefinedCheck");function UG(t,e){return t.write(`if (${e} !== null) return INVALID;`),e}a(UG,"generateNullCheck");function FG(t,e){return t.write(`if (${e} !== undefined) return INVALID;`),e}a(FG,"generateVoidCheck");function qG(t,e){return t.write(`if (typeof ${e} !== "number" || !Number.isNaN(${e})) return INVALID;`),e}a(qG,"generateNaNCheck");function ZG(t,e){return t.write(`if (!(${e} instanceof Date) || Number.isNaN(${e}.getTime())) return INVALID;`),e}a(ZG,"generateDateCheck");function VG(t,e,n,i,r=!0){let o=n._zod.def;t.write(`if (typeof ${i} !== "object" || ${i} === null || Array.isArray(${i})) return INVALID;`);let s=o.shape,c=Object.keys(s),u=Object.getOwnPropertySymbols(s),l=u.length?[...c,...u]:c,d=a(b=>typeof b=="symbol"?J(e,b):tn(b),"keyExpr"),f=a(b=>typeof b=="symbol"?`[${d(b)}]`:tn(b),"propKey"),p=s;if(c.includes("__proto__"))throw new he('object shape key "__proto__"');let m=new Map;for(let b of l){let $=p[b],x=d(b),T=X(e);if(t.write(`const ${T} = ${i}[${x}];`),$._zod.optin!==void 0){let C=X(e);t.write(`let ${C} = (() => {`),t.indented(Z=>{let S=Vt(Z,e,$,T);Z.write(`return ${S};`)}),t.write("})();"),$._zod.optout==="optional"?(t.write(`if (${C} === INVALID) {`),t.indented(Z=>{Z.write(`if (${x} in ${i}) return INVALID;`),Z.write(`${C} = undefined;`)}),t.write("}")):t.write(`if (${C} === INVALID) return INVALID;`),m.set(b,C)}else{HG($)&&t.write(`if (!(${x} in ${i})) return INVALID;`);let C=Vt(t,e,$,T,r);C!==null&&m.set(b,C)}}let g=o.catchall,y="none";if(g){let b=g._zod.def.type;if(b==="never"){let $=c.map(x=>`k !== ${tn(x)}`).join(" && ")||"true";t.write(`for (const k in ${i}) {`),t.indented(x=>{x.write(`if (${$}) return INVALID;`)}),t.write("}")}else(b==="unknown"||b==="any")&&!g._zod.def.checks?.length?y="passthrough":y="schema"}let v=X(e),w=l.some(b=>Wo(p[b])||Px(p[b]));if(!r){if(y==="schema"){let b=c.length>0?J(e,new Set(c)):null;t.write(`for (const k in ${i}) {`),t.indented($=>{$.write('if (k === "__proto__") continue;'),b&&$.write(`if (${b}.has(k)) continue;`);let x=X(e);$.write(`const ${x} = ${i}[k];`),Vt($,e,g,x,!1)}),t.write("}")}return null}if(w){t.write(`const ${v} = {};`);for(let b of l){let $=d(b),x=m.get(b);Px(p[b])?t.write(`if (${$} in ${i}) ${v}[${$}] = ${x};`):Wo(p[b])?t.write(`if (${x} !== undefined || ${$} in ${i}) ${v}[${$}] = ${x};`):t.write(`${v}[${$}] = ${x};`)}}else{let b=l.map($=>`${f($)}: ${m.get($)}`).join(", ");t.write(`const ${v} = { ${b} };`)}if(y!=="none"){let b=c.length>0?J(e,new Set(c)):null;t.write(`for (const k in ${i}) {`),t.indented($=>{if($.write('if (k === "__proto__") continue;'),b&&$.write(`if (${b}.has(k)) continue;`),y==="passthrough")$.write(`${v}[k] = ${i}[k];`);else{let x=X(e);$.write(`const ${x} = ${i}[k];`);let T=Vt($,e,g,x);$.write(`${v}[k] = ${T};`)}}),t.write("}")}return v}a(VG,"generateObjectCheck");function BG(t,e,n,i,r=!0){let o=n._zod.def;if(KG(n))return Be(t,e,o.innerType,i,r);if(o.innerType._zod.optin==="defaulted"){let c=X(e),u=X(e);return t.write(`let ${c};`),t.write(`if (${i} === undefined) {`),t.indented(l=>{l.write(`const ${u} = (() => {`),l.indented(d=>{let f=Be(d,e,o.innerType,i);d.write(`return ${f};`)}),l.write("})();"),l.write(`if (${u} !== INVALID) ${c} = ${u};`)}),t.write("} else {"),t.indented(l=>{let d=Be(l,e,o.innerType,i);l.write(`${c} = ${d};`)}),t.write("}"),c}let s=r?X(e):null;return s&&t.write(`let ${s};`),t.write(`if (${i} !== undefined) {`),t.indented(c=>{let u=Be(c,e,o.innerType,i,r);s&&u!==null&&c.write(`${s} = ${u};`)}),t.write("}"),s}a(BG,"generateOptionalCheck");function KG(t){return t._zod.traits?.has("$ZodExactOptional")===!0}a(KG,"isExactOptional");function HG(t){return t._zod.optin===void 0&&Ho(t)}a(HG,"requiresPresenceCheck");function Ho(t){if(t._zod.def.coerce)return!0;let e=t._zod.def;switch(e.type){case"any":case"unknown":case"undefined":case"void":case"default":case"prefault":case"transform":case"custom":case"lazy":return!0;case"string":case"number":case"boolean":case"bigint":case"symbol":case"null":case"never":case"nan":case"date":case"object":case"array":case"tuple":case"record":case"map":case"set":case"file":case"template_literal":return!1;case"nonoptional":return e.innerType?Ho(e.innerType):!1;case"literal":return!!e.values?.includes(void 0);case"enum":return!!t._zod.values?.has(void 0);case"optional":case"nullable":case"readonly":case"success":return e.innerType?Ho(e.innerType):!0;case"catch":return!0;case"union":return e.options?e.options.some(Ho):!0;case"intersection":return!e.left||!e.right?!0:Ho(e.left)&&Ho(e.right);case"pipe":return e.in?Ho(e.in):!0;default:return!0}}a(Ho,"fastPathAcceptsAbsence");function Px(t){return t._zod.optin==="optional"&&t._zod.optout==="optional"}a(Px,"dropsWhenAbsent");function Wo(t){let e=t._zod.def;switch(e.type){case"string":case"number":case"boolean":case"bigint":case"symbol":case"null":case"nan":case"date":case"object":case"array":case"tuple":case"record":case"map":case"set":case"file":case"template_literal":case"never":case"success":return!1;case"literal":return!!e.values?.includes(void 0);case"enum":return!!t._zod.values?.has(void 0);case"optional":return!0;case"nullable":case"readonly":case"nonoptional":return e.innerType?Wo(e.innerType):!0;case"union":return e.options?e.options.some(Wo):!0;case"intersection":return!e.left||!e.right||Wo(e.left)||Wo(e.right);case"pipe":return e.out?Wo(e.out):!0;default:return!0}}a(Wo,"mayOutputUndefined");function WG(t,e,n,i,r=!0){let o=n._zod.def,s=r?X(e):null;return s&&t.write(`let ${s} = null;`),t.write(`if (${i} !== null) {`),t.indented(c=>{let u=Be(c,e,o.innerType,i,r);s&&u!==null&&c.write(`${s} = ${u};`)}),t.write("}"),s}a(WG,"generateNullableCheck");function GG(t,e,n,i,r=!0){let o=n._zod.def;t.write(`if (!Array.isArray(${i})) return INVALID;`);let s=r?X(e):null,c=X(e),u=X(e);return s&&t.write(`const ${s} = new Array(${i}.length);`),t.write(`for (let ${c} = 0; ${c} < ${i}.length; ${c}++) {`),t.indented(l=>{l.write(`const ${u} = ${i}[${c}];`);let d=Vt(l,e,o.element,u,r);s&&d!==null&&l.write(`${s}[${c}] = ${d};`)}),t.write("}"),s}a(GG,"generateArrayCheck");function JG(t,e,n,i){let o=n._zod.def.values;if(o.length!==1){let c=J(e,new Set(o));return t.write(`if (!${c}.has(${i})) return INVALID;`),i}let s=o[0];if(typeof s=="number"&&Number.isNaN(s)){let c=J(e,new Set(o));return t.write(`if (!${c}.has(${i})) return INVALID;`),i}if(typeof s=="string")t.write(`if (${i} !== ${tn(s)}) return INVALID;`);else if(typeof s=="number"||typeof s=="boolean")t.write(`if (${i} !== ${s}) return INVALID;`);else if(s===null)t.write(`if (${i} !== null) return INVALID;`);else if(s===void 0)t.write(`if (${i} !== undefined) return INVALID;`);else if(typeof s=="bigint")t.write(`if (${i} !== ${s}n) return INVALID;`);else throw new he(`literal type ${typeof s}`);return i}a(JG,"generateLiteralCheck");function YG(t,e,n,i){let r=n._zod.values;if(!r)throw new he("enum schema without enumerated values");let o=J(e,r);return t.write(`if (!${o}.has(${i})) return INVALID;`),i}a(YG,"generateEnumCheck");function G1(t,e,n,i){let r=n._zod.def;return Be(t,e,r.innerType,i)}a(G1,"generateWrapperCheck");function XG(t,e,n,i){let r=n._zod.def,s=Object.getOwnPropertyDescriptor(n._zod.def,"defaultValue")?()=>n._zod.def.defaultValue:void 0;if(n._zod.def.type==="prefault"){if(!s)return Be(t,e,r.innerType,i);let u=J(e,s),l=X(e);return t.write(`let ${l} = ${i};`),t.write(`if (${i} === undefined) ${l} = ${u}();`),Be(t,e,r.innerType,l)}let c=X(e);if(s){let u=J(e,s),l=J(e,sa);t.write(`let ${c};`),t.write(`if (${i} === undefined) {`),t.indented(d=>{d.write(`${c} = ${l}(${u}());`)}),t.write("} else {"),t.indented(d=>{let f=Be(d,e,r.innerType,i);d.write(`${c} = ${f} === undefined ? ${l}(${u}()) : ${f};`)}),t.write("}")}else t.write(`let ${c};`),t.write(`if (${i} !== undefined) {`),t.indented(u=>{let l=Be(u,e,r.innerType,i);u.write(`${c} = ${l};`)}),t.write("}");return c}a(XG,"generateDefaultCheck");function QG(t,e,n,i){let r=n._zod.def,o=Be(t,e,r.innerType,i),s=X(e);return t.write(`const ${s} = ${o};`),t.write(`if (${s} === undefined) return INVALID;`),s}a(QG,"generateNonOptionalCheck");function eJ(t,e,n,i){let r=n._zod.def,o=r.items,s=r.rest;t.write(`if (!Array.isArray(${i})) return INVALID;`);let c=J1(o,"optin"),u=J1(o,"optout");s?t.write(`if (${i}.length < ${c}) return INVALID;`):t.write(`if (${i}.length < ${c} || ${i}.length > ${o.length}) return INVALID;`);let l=X(e);t.write(`const ${l} = [];`);for(let d=0;d<o.length;d++){let f=o[d];if(d>=u)t.write(`if (${l}.length === ${d}) {`),t.indented(p=>{p.write(`if (${d} < ${i}.length) {`),p.indented(m=>{let g=X(e);m.write(`const ${g} = ${i}[${d}];`);let y=Vt(m,e,f,g);m.write(`${l}[${d}] = ${y};`)}),p.write("} else {"),p.indented(m=>{if(Px(f)){m.write(`${l}.length = ${d};`);return}let g=X(e),y=X(e);m.write(`const ${g} = undefined;`),m.write(`const ${y} = (() => {`),m.indented(v=>{let w=Vt(v,e,f,g);v.write(`return ${w};`)}),m.write("})();"),m.write(`if (${y} === INVALID || ${y} === undefined) ${l}.length = ${d};`),m.write(`else ${l}[${d}] = ${y};`)}),p.write("}")}),t.write("}");else{let p=X(e);t.write(`const ${p} = ${i}[${d}];`);let m=Vt(t,e,f,p);t.write(`${l}[${d}] = ${m};`)}}if(s){let d=X(e),f=X(e);t.write(`for (let ${d} = ${o.length}; ${d} < ${i}.length; ${d}++) {`),t.indented(p=>{p.write(`const ${f} = ${i}[${d}];`);let m=Vt(p,e,s,f);p.write(`${l}[${d}] = ${m};`)}),t.write("}")}return l}a(eJ,"generateTupleCheck");function J1(t,e){for(let n=t.length-1;n>=0;n--)if(!(e==="optin"?t[n]._zod.optin!==void 0:t[n]._zod.optout==="optional"))return n+1;return 0}a(J1,"getTupleOptStart");function tJ(t,e,n,i){let r=n._zod.def,o=r.options;if(r.discriminator)return nJ(t,e,r,i);if(r.inclusive===!1)throw new he("exclusive unions (z.xor)");if(o.length===0)return t.write("return INVALID;"),i;if(o.length===1)return Be(t,e,o[0],i);if(o.every(u=>u._zod.def.type==="literal"&&!u._zod.def.checks?.length)){let u=new Set(o.flatMap(d=>d._zod.def.values)),l=J(e,u);return t.write(`if (!${l}.has(${i})) return INVALID;`),i}let c=X(e);t.write(`let ${c};`);for(let u=0;u<o.length;u++){let l=o[u];u===0?t.write(`${c} = (() => {`):t.write(`if (${c} === INVALID) ${c} = (() => {`),t.indented(d=>{let f=Be(d,e,l,i);d.write(`return ${f};`)}),t.write("})();")}return t.write(`if (${c} === INVALID) return INVALID;`),c}a(tJ,"generateUnionCheck");function nJ(t,e,n,i){if(n.unionFallback)throw new he("discriminated union with unionFallback");if(n.options.length===0)return t.write("return INVALID;"),i;let r=X(e),o=X(e);t.write(`const ${r} = ${i}?.[${tn(n.discriminator)}];`),t.write(`let ${o};`);let s=!0,c=new Set;for(let u of n.options){let l=u._zod.propValues?.[n.discriminator];if(!l||l.size===0)throw new he("discriminated union option without static discriminator values");for(let p of l){if(c.has(p))throw new he(`duplicate discriminator value ${String(p)}`);c.add(p)}let d=Array.from(l,p=>rJ(e,r,p)),f=s?"if":"else if";t.write(`${f} (${d.join(" || ")}) {`),t.indented(p=>{let m=Be(p,e,u,i);p.write(`${o} = ${m};`)}),t.write("}"),s=!1}return t.write("else { return INVALID; }"),o}a(nJ,"generateDiscriminatedUnionCheck");function rJ(t,e,n){if(typeof n=="string")return`${e} === ${tn(n)}`;if(typeof n=="number")return Number.isNaN(n)?`Number.isNaN(${e})`:`${e} === ${n}`;if(typeof n=="boolean")return`${e} === ${n}`;if(n===null)return`${e} === null`;if(n===void 0)return`${e} === undefined`;if(typeof n=="bigint")return`${e} === ${n}n`;if(typeof n=="symbol"){let i=J(t,n);return`${e} === ${i}`}throw new he(`literal discriminator value ${String(n)}`)}a(rJ,"literalEquality");function iJ(t,e,n,i){let r=n._zod.def,o=Vt(t,e,r.left,i),s=Vt(t,e,r.right,i),c=J(e,pa),u=X(e);return t.write(`const ${u} = ${c}(${o}, ${s});`),t.write(`if (!${u}.valid) return INVALID;`),`${u}.data`}a(iJ,"generateIntersectionCheck");function oJ(t,e,n,i){let r=n._zod.def,o=J(e,Mn);t.write(`if (!${o}(${i})) return INVALID;`);let s=X(e),c=X(e),u=X(e);t.write(`const ${s} = {};`);let l=r,d=l.partial?void 0:r.keyType._zod.values;if(d){let g=[];for(let v of d){if(!(typeof v=="string"||typeof v=="number"||typeof v=="symbol"))throw new he(`record key value ${String(v)}`);let w=typeof v=="number"?v.toString():v;if(w==="__proto__")throw new he('record key "__proto__"');g.push(w);let b=J(e,v),$=Be(t,e,r.keyType,b),x=X(e);t.write(`const ${x} = ${i}[${sJ(e,w)}];`);let T=Vt(t,e,r.valueType,x);t.write(`${s}[${$}] = ${T};`)}let y=J(e,new Set(g));return t.write(`for (const ${c} in ${i}) {`),t.indented(v=>{v.write(`if (${y}.has(${c})) continue;`),l.mode==="loose"?v.write(`if (${c} !== "__proto__") ${s}[${c}] = ${i}[${c}];`):v.write("return INVALID;")}),t.write("}"),s}let f=r.keyType._zod.def;if(!(f.type==="string"&&f.format===void 0&&!f.coerce&&(f.checks?.length??0)===0)){let g=r.mode==="loose",y=J(e,ig(r.keyType)),v=J(e,Ri),w=J(e,Object.prototype.propertyIsEnumerable),b=X(e);return t.write(`for (const ${c} of Reflect.ownKeys(${i})) {`),t.indented($=>{$.write(`if (${c} === "__proto__") continue;`),$.write(`if (!${w}.call(${i}, ${c})) continue;`),$.write(`let ${b} = ${y}(${c});`),$.write(`if (${b} === INVALID && typeof ${c} === "string" && ${v}.test(${c})) ${b} = ${y}(Number(${c}));`),g?$.write(`if (${b} === INVALID) { ${s}[${c}] = ${i}[${c}]; continue; }`):$.write(`if (${b} === INVALID) return INVALID;`),$.write(`if (${b} === "__proto__") continue;`);let x=X(e);$.write(`const ${x} = ${i}[${c}];`);let T=Vt($,e,r.valueType,x);$.write(`${s}[${b}] = ${T};`)}),t.write("}"),s}let m=J(e,Object.prototype.propertyIsEnumerable);return t.write(`for (const ${c} of Reflect.ownKeys(${i})) {`),t.indented(g=>{g.write(`if (${c} === "__proto__") continue;`),g.write(`if (!${m}.call(${i}, ${c})) continue;`),g.write(`if (typeof ${c} !== "string") return INVALID;`),g.write(`const ${u} = ${i}[${c}];`);let y=Vt(g,e,r.valueType,u);g.write(`${s}[${c}] = ${y};`)}),t.write("}"),s}a(oJ,"generateRecordCheck");function sJ(t,e){return typeof e=="string"?tn(e):J(t,e)}a(sJ,"literalPropertyKey");function aJ(t,e,n,i){let r=n._zod.def;t.write(`if (!(${i} instanceof Map)) return INVALID;`);let o=X(e),s=X(e),c=X(e);return t.write(`const ${o} = new Map();`),t.write(`for (const [${s}, ${c}] of ${i}) {`),t.indented(u=>{let l=Be(u,e,r.keyType,s),d=Be(u,e,r.valueType,c);u.write(`${o}.set(${l}, ${d});`)}),t.write("}"),o}a(aJ,"generateMapCheck");function cJ(t,e,n,i){let r=n._zod.def;t.write(`if (!(${i} instanceof Set)) return INVALID;`);let o=X(e),s=X(e);return t.write(`const ${o} = new Set();`),t.write(`for (const ${s} of ${i}) {`),t.indented(c=>{let u=Be(c,e,r.valueType,s);c.write(`${o}.add(${u});`)}),t.write("}"),o}a(cJ,"generateSetCheck");function uJ(t,e){return t.write(`if (!(${e} instanceof File)) return INVALID;`),e}a(uJ,"generateFileCheck");function lJ(t,e,n,i){t.write(`if (typeof ${i} !== "string") return INVALID;`);let r=n._zod.pattern;if(r){let o=J(e,r);t.write(`${o}.lastIndex = 0;`),t.write(`if (!${o}.test(${i})) return INVALID;`)}return i}a(lJ,"generateTemplateLiteralCheck");function dJ(t,e,n,i){let r=n._zod.def,o=J(e,r.getter),s=J(e,{parser:null});t.write(`if (!${s}.parser) {`),t.indented(u=>{u.write(`const inner = ${o}();`),u.write(`${s}.parser = function(input) {`),u.indented(l=>{l.write("const result = inner._zod.run({ value: input, issues: [] }, {});"),l.write("return result.issues.length === 0 ? result.value : INVALID;")}),u.write("};")}),t.write("}");let c=X(e);return t.write(`const ${c} = ${s}.parser(${i});`),t.write(`if (${c} === INVALID) return INVALID;`),c}a(dJ,"generateLazyCheck");function fJ(t,e,n,i){let r=n._zod.def,o=Be(t,e,r.in,i);if(r.transform){if(Go(r.transform))throw new or("z.compile: async transforms in pipes are not supported");let s=r.transform,u=J(e,a(d=>{let f={value:d,issues:[],addIssue:jx},p=s(d,f);return p instanceof Promise?In:f.issues.length===0?p:In},"helperFn")),l=X(e);return t.write(`const ${l} = ${u}(${o});`),t.write(`if (${l} === INVALID) return INVALID;`),Be(t,e,r.out,l)}else return Be(t,e,r.out,o)}a(fJ,"generatePipeCheck");function Go(t){return typeof t=="function"&&(t.constructor.name==="AsyncFunction"||t[Symbol.toStringTag]==="AsyncFunction")}a(Go,"isAsyncFunction");function pJ(t,e,n,i){let r=n._zod.def;if(r.fn){if(Go(r.fn))throw new or("z.compile: async custom predicates are not supported");let o=J(e,r.fn),s=J(e,Cx),c=X(e);t.write(`const ${c} = ${o}(${i});`),t.write(`if (${c} instanceof Promise) ${s}();`),t.write(`if (!${c}) return INVALID;`)}else throw new he("custom schema without a predicate function");return i}a(pJ,"generateCustomCheck");function mJ(t,e,n){let i=t._zod.run({value:n,issues:[]},{});if(i&&typeof i.then=="function")return In;let r=i;return r.issues.length===0?r.value:e()}a(mJ,"runtimeCatch");function hJ(t,e,n,i){let r=n._zod.def;if(!r.catchValue[vm])throw new he("catch with a callback (only a constant catch value compiles)",!1);let o=X(e);t.write(`let ${o} = (() => {`),t.indented(l=>{let d=Vt(l,e,r.innerType,i);l.write(`return ${d};`)}),t.write("})();");let s=J(e,r.innerType),c=J(e,r.catchValue),u=J(e,mJ);return t.write(`if (${o} === INVALID) {`),t.indented(l=>{l.write(`${o} = ${u}(${s}, ${c}, ${i});`),l.write(`if (${o} === INVALID) return INVALID;`)}),t.write("}"),o}a(hJ,"generateCatchCheck");function gJ(t,e,n,i){let r=n._zod.def;if(r.transform){if(Go(r.transform))throw new or("z.compile: async transforms are not supported");let o=r.transform,c=J(e,a(l=>{let d={value:l,issues:[],addIssue:jx},f=o(l,d);return f instanceof Promise?In:d.issues.length===0?f:In},"helperFn")),u=X(e);return t.write(`const ${u} = ${c}(${i});`),t.write(`if (${u} === INVALID) return INVALID;`),u}return i}a(gJ,"generateTransformCheck");function og(t,e){return new t({type:"string",...R(e)})}a(og,"_string");function zx(t,e){return new t({type:"string",coerce:!0,...R(e)})}a(zx,"_coercedString");function tl(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...R(e)})}a(tl,"_email");function nl(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...R(e)})}a(nl,"_guid");function rl(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...R(e)})}a(rl,"_uuid");function il(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...R(e)})}a(il,"_uuidv4");function ol(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...R(e)})}a(ol,"_uuidv6");function sl(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...R(e)})}a(sl,"_uuidv7");function wa(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...R(e)})}a(wa,"_url");function al(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...R(e)})}a(al,"_emoji");function cl(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...R(e)})}a(cl,"_nanoid");function ul(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...R(e)})}a(ul,"_cuid");function ll(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...R(e)})}a(ll,"_cuid2");function dl(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...R(e)})}a(dl,"_ulid");function fl(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...R(e)})}a(fl,"_xid");function pl(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...R(e)})}a(pl,"_ksuid");function ml(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...R(e)})}a(ml,"_ipv4");function hl(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...R(e)})}a(hl,"_ipv6");function sg(t,e){return new t({type:"string",format:"mac",check:"string_format",abort:!1,...R(e)})}a(sg,"_mac");function gl(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...R(e)})}a(gl,"_cidrv4");function yl(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...R(e)})}a(yl,"_cidrv6");function vl(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...R(e)})}a(vl,"_base64");function bl(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...R(e)})}a(bl,"_base64url");function wl(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...R(e)})}a(wl,"_e164");function ag(t,e){return new t({type:"string",format:"credit_card",check:"string_format",abort:!1,...R(e)})}a(ag,"_creditCard");function $l(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...R(e)})}a($l,"_jwt");var Dx={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function _l(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...R(e)})}a(_l,"_isoDateTime");function kl(t,e){return new t({type:"string",format:"date",check:"string_format",...R(e)})}a(kl,"_isoDate");function xl(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...R(e)})}a(xl,"_isoTime");function Sl(t,e){return new t({type:"string",format:"duration",check:"string_format",...R(e)})}a(Sl,"_isoDuration");function cg(t,e){return new t({type:"number",checks:[],...R(e)})}a(cg,"_number");function Lx(t,e){return new t({type:"number",coerce:!0,checks:[],...R(e)})}a(Lx,"_coercedNumber");function ug(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...R(e)})}a(ug,"_int");function lg(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float32",...R(e)})}a(lg,"_float32");function dg(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float64",...R(e)})}a(dg,"_float64");function fg(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"int32",...R(e)})}a(fg,"_int32");function pg(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"uint32",...R(e)})}a(pg,"_uint32");function mg(t,e){return new t({type:"boolean",...R(e)})}a(mg,"_boolean");function Mx(t,e){return new t({type:"boolean",coerce:!0,...R(e)})}a(Mx,"_coercedBoolean");function hg(t,e){return new t({type:"bigint",...R(e)})}a(hg,"_bigint");function Ux(t,e){return new t({type:"bigint",coerce:!0,...R(e)})}a(Ux,"_coercedBigint");function gg(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...R(e)})}a(gg,"_int64");function yg(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...R(e)})}a(yg,"_uint64");function vg(t,e){return new t({type:"symbol",...R(e)})}a(vg,"_symbol");function bg(t,e){return new t({type:"undefined",...R(e)})}a(bg,"_undefined");function wg(t,e){return new t({type:"null",...R(e)})}a(wg,"_null");function $g(t){return new t({type:"any"})}a($g,"_any");function _g(t){return new t({type:"unknown"})}a(_g,"_unknown");function kg(t,e){return new t({type:"never",...R(e)})}a(kg,"_never");function xg(t,e){return new t({type:"void",...R(e)})}a(xg,"_void");function Sg(t,e){return new t({type:"date",...R(e)})}a(Sg,"_date");function Fx(t,e){return new t({type:"date",coerce:!0,...R(e)})}a(Fx,"_coercedDate");function Ig(t,e){return new t({type:"nan",...R(e)})}a(Ig,"_nan");function Ar(t,e){return new Pm({check:"less_than",...R(e),value:t,inclusive:!1})}a(Ar,"_lt");function En(t,e){return new Pm({check:"less_than",...R(e),value:t,inclusive:!0})}a(En,"_lte");function Or(t,e){return new Rm({check:"greater_than",...R(e),value:t,inclusive:!1})}a(Or,"_gt");function Tn(t,e){return new Rm({check:"greater_than",...R(e),value:t,inclusive:!0})}a(Tn,"_gte");function Eg(t){return Or(0,t)}a(Eg,"_positive");function Tg(t){return Ar(0,t)}a(Tg,"_negative");function Ag(t){return En(0,t)}a(Ag,"_nonpositive");function Og(t){return Tn(0,t)}a(Og,"_nonnegative");function zi(t,e){return new K_({check:"multiple_of",...R(e),value:t})}a(zi,"_multipleOf");function Di(t,e){return new G_({check:"max_size",...R(e),maximum:t})}a(Di,"_maxSize");function Nr(t,e){return new J_({check:"min_size",...R(e),minimum:t})}a(Nr,"_minSize");function Jo(t,e){return new Y_({check:"size_equals",...R(e),size:t})}a(Jo,"_size");function Yo(t,e){return new X_({check:"max_length",...R(e),maximum:t})}a(Yo,"_maxLength");function Yr(t,e){return new Q_({check:"min_length",...R(e),minimum:t})}a(Yr,"_minLength");function Xo(t,e){return new ek({check:"length_equals",...R(e),length:t})}a(Xo,"_length");function $a(t,e){return new tk({check:"string_format",format:"regex",...R(e),pattern:t})}a($a,"_regex");function _a(t){return new nk({check:"string_format",format:"lowercase",...R(t)})}a(_a,"_lowercase");function ka(t){return new rk({check:"string_format",format:"uppercase",...R(t)})}a(ka,"_uppercase");function xa(t,e){return new ik({check:"string_format",format:"includes",...R(e),includes:t})}a(xa,"_includes");function Sa(t,e){return new ok({check:"string_format",format:"starts_with",...R(e),prefix:t})}a(Sa,"_startsWith");function Ia(t,e){return new sk({check:"string_format",format:"ends_with",...R(e),suffix:t})}a(Ia,"_endsWith");function Ng(t,e,n){return new jm({check:"property",property:t,schema:e,...R(n)})}a(Ng,"_property");function Cg(t){return Object.entries(t).map(([e,n])=>new jm({check:"property",property:e,schema:n}))}a(Cg,"_properties");function Ea(t,e){return new ak({check:"mime_type",mime:t,...R(e)})}a(Ea,"_mime");function sr(t){return new ck({check:"overwrite",tx:t})}a(sr,"_overwrite");function Ta(t){return sr(e=>e.normalize(t))}a(Ta,"_normalize");function Aa(){return sr(t=>t.trim())}a(Aa,"_trim");function Oa(){return sr(t=>t.toLowerCase())}a(Oa,"_toLowerCase");function Na(){return sr(t=>t.toUpperCase())}a(Na,"_toUpperCase");function Ca(){return sr(t=>G$(t))}a(Ca,"_slugify");function qx(t,e,n){return new t({type:"array",element:e,...R(n)})}a(qx,"_array");function yJ(t,e,n){return new t({type:"union",options:e,...R(n)})}a(yJ,"_union");function vJ(t,e,n){return new t({type:"union",options:e,inclusive:!1,...R(n)})}a(vJ,"_xor");function bJ(t,e,n,i){return new t({type:"union",options:n,discriminator:e,...R(i)})}a(bJ,"_discriminatedUnion");function wJ(t,e,n){return new t({type:"intersection",left:e,right:n})}a(wJ,"_intersection");function $J(t,e,n,i){let r=n instanceof te,o=r?i:n,s=r?n:null;return new t({type:"tuple",items:e,rest:s,...R(o)})}a($J,"_tuple");function _J(t,e,n,i){return new t({type:"record",keyType:e,valueType:n,...R(i)})}a(_J,"_record");function kJ(t,e,n,i){return new t({type:"map",keyType:e,valueType:n,...R(i)})}a(kJ,"_map");function xJ(t,e,n){return new t({type:"set",valueType:e,...R(n)})}a(xJ,"_set");function SJ(t,e,n){let i=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new t({type:"enum",entries:i,...R(n)})}a(SJ,"_enum");function IJ(t,e,n){return new t({type:"enum",entries:e,...R(n)})}a(IJ,"_nativeEnum");function EJ(t,e,n){return new t({type:"literal",values:Array.isArray(e)?e:[e],...R(n)})}a(EJ,"_literal");function Pg(t,e){return new t({type:"file",...R(e)})}a(Pg,"_file");function TJ(t,e){return new t({type:"transform",transform:e})}a(TJ,"_transform");function AJ(t,e){return new t({type:"optional",innerType:e})}a(AJ,"_optional");function OJ(t,e){return new t({type:"nullable",innerType:e})}a(OJ,"_nullable");function NJ(t,e,n){return new t({type:"default",innerType:e,get defaultValue(){return typeof n=="function"?n():sa(n)}})}a(NJ,"_default");function CJ(t,e,n){return new t({type:"nonoptional",innerType:e,...R(n)})}a(CJ,"_nonoptional");function PJ(t,e){return new t({type:"success",innerType:e})}a(PJ,"_success");function RJ(t,e,n){return new t({type:"catch",innerType:e,catchValue:typeof n=="function"?n:o_(n)})}a(RJ,"_catch");function jJ(t,e,n){return new t({type:"pipe",in:e,out:n})}a(jJ,"_pipe");function zJ(t,e){return new t({type:"readonly",innerType:e})}a(zJ,"_readonly");function DJ(t,e,n){return new t({type:"template_literal",parts:e,...R(n)})}a(DJ,"_templateLiteral");function LJ(t,e){return new t({type:"lazy",getter:e})}a(LJ,"_lazy");function MJ(t,e){return new t({type:"promise",innerType:e})}a(MJ,"_promise");function Rg(t,e,n){let i=R(n);return i.abort??(i.abort=!0),new t({type:"custom",check:"custom",fn:e,...i})}a(Rg,"_custom");function jg(t,e,n){return new t({type:"custom",check:"custom",fn:e,...R(n)})}a(jg,"_refine");function zg(t,e){let n=eR(i=>(i.addIssue=r=>{if(typeof r=="string")i.issues.push(aa(r,i.value,n._zod.def));else{let o=r;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),"input"in o||(o.input=i.value),o.inst??(o.inst=n),o.continue??(o.continue=!n._zod.def.abort),i.issues.push(aa(o))}},t(i.value,i)),e);return n}a(zg,"_superRefine");function eR(t,e){let n=new Re({check:"custom",...R(e)});return n._zod.check=t,n}a(eR,"_check");function Dg(t){let e=new Re({check:"describe"});return e._zod.onattach=[n=>{let i=_t.get(n)??{};_t.add(n,{...i,description:t})}],e._zod.check=()=>{},e}a(Dg,"describe");function Lg(t){let e=new Re({check:"meta"});return e._zod.onattach=[n=>{let i=_t.get(n)??{};_t.add(n,{...i,...t})}],e._zod.check=()=>{},e}a(Lg,"meta");function Mg(t,e){let n=R(e),i=n.truthy??["true","1","yes","on","y","enabled"],r=n.falsy??["false","0","no","off","n","disabled"];n.case!=="sensitive"&&(i=i.map(m=>typeof m=="string"?m.toLowerCase():m),r=r.map(m=>typeof m=="string"?m.toLowerCase():m));let o=new Set(i),s=new Set(r),c=t.Codec??ga,u=t.Boolean??ma,l=t.String??ji,d=new l({type:"string",error:n.error}),f=new u({type:"boolean",error:n.error}),p=new c({type:"pipe",in:d,out:f,transform:a(((m,g)=>{let y=m;return n.case!=="sensitive"&&(y=y.toLowerCase()),o.has(y)?!0:s.has(y)?!1:(g.issues.push({code:"invalid_value",expected:"stringbool",values:[...o,...s],input:g.value,inst:p,continue:!1}),{})}),"transform"),reverseTransform:a(((m,g)=>m===!0?i[0]||"true":r[0]||"false"),"reverseTransform"),error:n.error});return p._zod.bag.truthy=i,p._zod.bag.falsy=r,p._zod.bag.case=n.case??"insensitive",p}a(Mg,"_stringbool");function Qo(t,e,n,i={}){let r=R(i),o={check:"string_format",type:"string",format:e,fn:typeof n=="function"?n:c=>n.test(c),...r};return n instanceof RegExp&&(o.pattern=n),new t(o)}a(Qo,"_stringFormat");function Il(t,...e){for(let n of e)for(let i of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,i)&&He(t,i,n[i]);return t}a(Il,"assignProps");function Li(t){let e=t?.target??"draft-2020-12";return e==="draft-4"&&(e="draft-04"),e==="draft-7"&&(e="draft-07"),{processors:t.processors??{},metadataRegistry:t?.metadata??_t,target:e,unrepresentable:t?.unrepresentable??"throw",override:t?.override??(()=>{}),io:t?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:t?.cycles??"ref",reused:t?.reused??"inline",intersections:[],deferred:[],external:t?.external??void 0}}a(Li,"initializeContext");function lt(t,e,n,i,r){let o=typeof e.unrepresentable=="function"?e.unrepresentable({zodSchema:t,path:i.path,message:r}):e.unrepresentable;if(o==="any")return!1;if(o===void 0||o==="throw")throw new Error(r);return Object.assign(n,o),!0}a(lt,"handleUnrepresentable");function Ae(t,e,n={path:[],schemaPath:[]}){var i;let r=t._zod.def,o=e.seen.get(t);if(o)return o.count++,n.schemaPath.includes(t)&&(o.cycle=n.path),o.schema;let s={schema:{},count:1,cycle:void 0,path:n.path};e.seen.set(t,s),e.sharedDefsExtractedFor=void 0,e.sharedEmitDoneFor=void 0;let c=t._zod.toJSONSchema?.();if(c)s.schema=c;else{let d={...n,schemaPath:[...n.schemaPath,t],path:n.path};if(t._zod.processJSONSchema)t._zod.processJSONSchema(e,s.schema,d);else{let p=s.schema,m=e.processors[r.type];if(!m)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${r.type}`);m(t,e,p,d)}let f=t._zod.parent;f&&(s.ref||(s.ref=f),Ae(f,e,d),e.seen.get(f).isParent=!0)}let u=e.metadataRegistry.get(t);return u&&Il(s.schema,u),e.io==="input"&&Bt(t)&&(delete s.schema.examples,delete s.schema.default),e.io==="input"&&"_prefault"in s.schema&&((i=s.schema).default??(i.default=s.schema._prefault)),delete s.schema._prefault,e.seen.get(t).schema}a(Ae,"process");function tR(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}a(tR,"encodeJSONPointerSegment");function Mi(t,e){let n=t.seen.get(e);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");if(t.external&&t.sharedDefsExtractedFor===t.external)return;let i=new Map;for(let s of t.seen.entries()){let c=t.metadataRegistry.get(s[0])?.id;if(c){let u=i.get(c);if(u&&u!==s[0])throw new Error(`Duplicate schema id "${c}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);i.set(c,s[0])}}let r=a(s=>{let c=t.target==="draft-2020-12"?"$defs":"definitions";if(t.external){let f=t.external.registry.get(s[0])?.id,p=t.external.uri??(g=>g);if(f)return{ref:p(f)};let m=s[1].defId??s[1].schema.id??`schema${t.counter++}`;return s[1].defId=m,{defId:m,ref:`${p("__shared")}#/${c}/${tR(m)}`}}let u="#",l=`${u}/${c}/`;if(s[1]===n&&!s[1].schema.id)return{ref:u};let d=s[1].schema.id??`__schema${t.counter++}`;return{defId:d,ref:l+tR(d)}},"makeURI"),o=a(s=>{if(s[1].schema.$ref)return;let c=s[1],{ref:u,defId:l}=r(s);c.def={...c.schema},l&&(c.defId=l);let d=c.schema;for(let f in d)delete d[f];d.$ref=u},"extractToDef");if(t.cycles==="throw")for(let s of t.seen.entries()){let c=s[1];if(c.cycle)throw new Error(`Cycle detected: #/${c.cycle?.join("/")}/<root>
|
|
208
|
+
|
|
209
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let s of t.seen.entries()){let c=s[1];if(e===s[0]){o(s);continue}if(t.external){let l=t.external.registry.get(s[0])?.id;if(e!==s[0]&&l){o(s);continue}}if(t.metadataRegistry.get(s[0])?.id){o(s);continue}if(c.cycle){o(s);continue}if(c.count>1&&t.reused==="ref"){o(s);continue}}t.external&&(t.sharedDefsExtractedFor=t.external)}a(Mi,"extractDefs");function iR(t){let e=t.anyOf;if(!Array.isArray(e)||e.length===0||t.type!==void 0)return;let n=[];for(let i of e){if(!i||typeof i!="object")return;iR(i);let r=Object.keys(i);if(r.length!==1||r[0]!=="type")return;let o=i.type;for(let s of Array.isArray(o)?o:[o]){if(typeof s!="string")return;n.includes(s)||n.push(s)}}delete t.anyOf,t.type=n.length===1?n[0]:n}a(iR,"compactTypeUnion");var oR=new Set(["type","properties","required","additionalProperties"]),nR=["oneOf","anyOf"];function rR(t){let e=t.additionalProperties;return e===void 0||e===!1||typeof e!="object"||e===null?null:Object.keys(e).length?e:null}a(rR,"undeclaredConstraint");function Zx(t){let e=[];for(let o of t){if(typeof o!="object"||o.type!=="object")return null;for(let s in o)if(!oR.has(s))return null;e.push(o)}let n={},i=new Set;for(let o of e){for(let s in o.properties){if(Object.prototype.hasOwnProperty.call(n,s))continue;let c=[];for(let l of e){let d=l.properties?.[s]??rR(l);d!=null&&(c.some(f=>JSON.stringify(f)===JSON.stringify(d))||c.push(d))}let u=c.length===1?c[0]:Zx(c)??{allOf:c};He(n,s,u)}for(let s of o.required??[])i.add(s)}let r={type:"object",properties:n};if(i.size&&(r.required=[...i]),e.every(o=>o.additionalProperties===!1))r.additionalProperties=!1;else{let o=[];for(let s of e){let c=rR(s);c&&!o.some(u=>JSON.stringify(u)===JSON.stringify(c))&&o.push(c)}o.length===1?r.additionalProperties=o[0]:o.length>1&&(r.additionalProperties={allOf:o})}return r}a(Zx,"foldObjects");function UJ(t){let e=t.allOf;if(!Array.isArray(e)||e.length<2)return;for(let r of oR)if(r in t)return;let n=e.filter(r=>nR.some(o=>Array.isArray(r[o]))),i=null;if(!n.length)i=Zx(e);else{let r=n[0],o=nR.find(u=>Array.isArray(r[u]));if(Object.keys(r).length!==1)return;let s=e.filter(u=>u!==r),c=r[o].map(u=>Zx([...s,u]));if(c.some(u=>!u))return;i={[o]:c}}i&&(delete t.allOf,Il(t,i))}a(UJ,"foldIntersection");function Ui(t,e){let n=t.seen.get(e);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=a(c=>{let u=t.seen.get(c);if(u.ref===null)return;let l=u.def??u.schema,d={...l},f=u.ref;if(u.ref=null,f){i(f);let m=t.seen.get(f),g=m.schema;if(g.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0")?(l.allOf=l.allOf??[],l.allOf.push(g)):Il(l,g),Il(l,d),c._zod.parent===f)for(let v in l)v==="$ref"||v==="allOf"||v in d||delete l[v];if(g.$ref&&m.def)for(let v in l)v==="$ref"||v==="allOf"||v in m.def&&JSON.stringify(l[v])===JSON.stringify(m.def[v])&&delete l[v]}let p=c._zod.parent;if(p&&p!==f){i(p);let m=t.seen.get(p);if(m?.schema.$ref&&(l.$ref=m.schema.$ref,m.def))for(let g in l)g==="$ref"||g==="allOf"||g in m.def&&JSON.stringify(l[g])===JSON.stringify(m.def[g])&&delete l[g]}t.override({zodSchema:c,jsonSchema:l,path:u.path??[]})},"flattenRef");if(!t.external||t.sharedEmitDoneFor!==t.external){for(let c of[...t.seen.entries()].reverse())i(c[0]);if(t.target!=="openapi-3.0")for(let c of t.seen.entries())iR(c[1].def??c[1].schema);for(let c of t.deferred)c();if(t.intersections.length){let c=new Map;for(let u of t.seen.values())for(let l of[u.schema,u.def]){let d=l?.allOf;if(!Array.isArray(d))continue;let f=c.get(d);f?f.push(l):c.set(d,[l])}for(let u of t.intersections)for(let l of c.get(u)??[])UJ(l)}}let r={};if(t.target==="draft-2020-12"?r.$schema="https://json-schema.org/draft/2020-12/schema":t.target==="draft-07"?r.$schema="http://json-schema.org/draft-07/schema#":t.target==="draft-04"?r.$schema="http://json-schema.org/draft-04/schema#":t.target,t.external?.uri){let c=t.external.registry.get(e)?.id;if(!c)throw new Error("Schema is missing an `id` property");r.$id=t.external.uri(c)}Il(r,n.defId?n.schema:n.def??n.schema);let o=t.metadataRegistry.get(e)?.id;o!==void 0&&r.id===o&&delete r.id;let s=t.external?.defs??{};if(!t.external||t.sharedEmitDoneFor!==t.external)for(let c of t.seen.entries()){let u=c[1];u.def&&u.defId&&(u.def.id===u.defId&&delete u.def.id,He(s,u.defId,u.def))}t.external&&(t.sharedEmitDoneFor=t.external),t.external||Object.keys(s).length>0&&(t.target==="draft-2020-12"?r.$defs=s:r.definitions=s);try{let c=JSON.parse(JSON.stringify(r));return Object.defineProperty(c,"~standard",{value:{...e["~standard"],jsonSchema:{input:Pa(e,"input",t.processors),output:Pa(e,"output",t.processors)}},enumerable:!1,writable:!1}),c}catch{throw new Error("Error converting schema to JSON.")}}a(Ui,"finalize");function Bt(t,e){let n=e??{seen:new Set};if(n.seen.has(t))return!1;n.seen.add(t);let i=t._zod.def;if(i.type==="transform")return!0;if(i.type==="array")return Bt(i.element,n);if(i.type==="set")return Bt(i.valueType,n);if(i.type==="lazy")return Bt(i.getter(),n);if(i.type==="promise"||i.type==="optional"||i.type==="nonoptional"||i.type==="nullable"||i.type==="readonly"||i.type==="default"||i.type==="prefault"||i.type==="catch")return Bt(i.innerType,n);if(i.type==="intersection")return Bt(i.left,n)||Bt(i.right,n);if(i.type==="record"||i.type==="map")return Bt(i.keyType,n)||Bt(i.valueType,n);if(i.type==="pipe")return t._zod.traits.has("$ZodCodec")?!0:Bt(i.in,n)||Bt(i.out,n);if(i.type==="object"){for(let r in i.shape)if(Bt(i.shape[r],n))return!0;return!1}if(i.type==="union"){for(let r of i.options)if(Bt(r,n))return!0;return!1}if(i.type==="tuple"){for(let r of i.items)if(Bt(r,n))return!0;return!!(i.rest&&Bt(i.rest,n))}return!1}a(Bt,"isTransforming");var Vx=a((t,e={})=>n=>{let i=Li({...n,processors:e});return Ae(t,i),Mi(i,t),Ui(i,t)},"createToJSONSchemaMethod"),Pa=a((t,e,n={})=>i=>{let{libraryOptions:r,target:o}=i??{},s=Li({...r??{},target:o,io:e,processors:n});return Ae(t,s),Mi(s,t),Ui(s,t)},"createStandardJSONSchemaMethod");var FJ={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Hx=a((t,e,n,i)=>{let r=n;r.type="string";let{minimum:o,maximum:s,format:c,patterns:u,contentEncoding:l,laxFormat:d}=t._zod.bag;if(typeof o=="number"&&(r.minLength=o),typeof s=="number"&&(r.maxLength=s),c&&(r.format=FJ[c]??c,r.format===""&&delete r.format,(c==="time"||d)&&delete r.format),l&&(r.contentEncoding=l),u&&u.size>0){let f=[...u];f.length===1?r.pattern=f[0].source:f.length>1&&(r.allOf=[...f.map(p=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:p.source}))])}},"stringProcessor"),Wx=a((t,e,n,i)=>{let r=n,{minimum:o,maximum:s,format:c,multipleOf:u,exclusiveMaximum:l,exclusiveMinimum:d}=t._zod.bag;typeof c=="string"&&c.includes("int")?r.type="integer":r.type="number";let f=typeof d=="number"&&d>=(o??Number.NEGATIVE_INFINITY),p=typeof l=="number"&&l<=(s??Number.POSITIVE_INFINITY),m=e.target==="draft-04"||e.target==="openapi-3.0";f?m?(r.minimum=d,r.exclusiveMinimum=!0):r.exclusiveMinimum=d:typeof o=="number"&&(r.minimum=o),p?m?(r.maximum=l,r.exclusiveMaximum=!0):r.exclusiveMaximum=l:typeof s=="number"&&(r.maximum=s),typeof u=="number"&&(Number.isFinite(u)&&u!==0?r.multipleOf=Math.abs(u):lt(t,e,r,i,`A multipleOf divisor of ${u} cannot be represented in JSON Schema`))},"numberProcessor"),Gx=a((t,e,n,i)=>{n.type="boolean"},"booleanProcessor"),Jx=a((t,e,n,i)=>{lt(t,e,n,i,"BigInt cannot be represented in JSON Schema")},"bigintProcessor"),Yx=a((t,e,n,i)=>{lt(t,e,n,i,"Symbols cannot be represented in JSON Schema")},"symbolProcessor"),Xx=a((t,e,n,i)=>{e.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},"nullProcessor"),Qx=a((t,e,n,i)=>{lt(t,e,n,i,"Undefined cannot be represented in JSON Schema")},"undefinedProcessor"),eS=a((t,e,n,i)=>{lt(t,e,n,i,"Void cannot be represented in JSON Schema")},"voidProcessor"),tS=a((t,e,n,i)=>{n.not={}},"neverProcessor"),nS=a((t,e,n,i)=>{},"anyProcessor"),rS=a((t,e,n,i)=>{},"unknownProcessor"),iS=a((t,e,n,i)=>{lt(t,e,n,i,"Date cannot be represented in JSON Schema")},"dateProcessor"),oS=a((t,e,n,i)=>{let r=t._zod.def,o=Nu(r.entries);if(o.length===0){n.not={};return}o.every(s=>typeof s=="number")&&(n.type="number"),o.every(s=>typeof s=="string")&&(n.type="string"),n.enum=o},"enumProcessor"),sS=a((t,e,n,i)=>{let r=t._zod.def;if(r.values.length===0){n.not={};return}let o=[];for(let s of r.values)if(s===void 0){if(lt(t,e,n,i,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof s=="bigint"){if(lt(t,e,n,i,"BigInt literals cannot be represented in JSON Schema"))return;o.push(Number(s))}else o.push(s);if(o.length!==0)if(o.length===1){let s=o[0];n.type=s===null?"null":typeof s,e.target==="draft-04"||e.target==="openapi-3.0"?n.enum=[s]:n.const=s}else o.every(s=>typeof s=="number")&&(n.type="number"),o.every(s=>typeof s=="string")&&(n.type="string"),o.every(s=>typeof s=="boolean")&&(n.type="boolean"),o.every(s=>s===null)&&(n.type="null"),n.enum=o},"literalProcessor"),aS=a((t,e,n,i)=>{lt(t,e,n,i,"NaN cannot be represented in JSON Schema")},"nanProcessor"),cS=a((t,e,n,i)=>{let r=n,o=t._zod.pattern;if(!o)throw new Error("Pattern not found in template literal");r.type="string",r.pattern=o.source},"templateLiteralProcessor"),uS=a((t,e,n,i)=>{let r=n,o={type:"string",format:"binary",contentEncoding:"binary"},{minimum:s,maximum:c,mime:u}=t._zod.bag;s!==void 0&&(o.minLength=s),c!==void 0&&(o.maxLength=c),u?u.length===1?(o.contentMediaType=u[0],Object.assign(r,o)):(Object.assign(r,o),r.anyOf=u.map(l=>({contentMediaType:l}))):Object.assign(r,o)},"fileProcessor"),lS=a((t,e,n,i)=>{n.type="boolean"},"successProcessor"),dS=a((t,e,n,i)=>{lt(t,e,n,i,"Custom types cannot be represented in JSON Schema")},"customProcessor"),fS=a((t,e,n,i)=>{lt(t,e,n,i,"Function types cannot be represented in JSON Schema")},"functionProcessor"),pS=a((t,e,n,i)=>{lt(t,e,n,i,"Transforms cannot be represented in JSON Schema")},"transformProcessor"),mS=a((t,e,n,i)=>{lt(t,e,n,i,"Map cannot be represented in JSON Schema")},"mapProcessor"),hS=a((t,e,n,i)=>{lt(t,e,n,i,"Set cannot be represented in JSON Schema")},"setProcessor"),gS=a((t,e,n,i)=>{let r=n,o=t._zod.def,{minimum:s,maximum:c}=t._zod.bag;typeof s=="number"&&(r.minItems=s),typeof c=="number"&&(r.maxItems=c),r.type="array",r.items=Ae(o.element,e,{...i,path:[...i.path,"items"]})},"arrayProcessor");function El(t){let e=t._zod.def;return e.type==="pipe"&&e.in._zod.traits.has("$ZodTransform")?El(e.out):e.type==="catch"?El(e.innerType):t._zod.optin}a(El,"inputOptin");var yS=a((t,e,n,i)=>{let r=n,o=t._zod.def,s=o.shape;if(Object.getOwnPropertySymbols(s).length&<(t,e,r,i,"Symbol keys cannot be represented in JSON Schema"))return;r.type="object",r.properties={};for(let d in s)He(r.properties,d,Ae(s[d],e,{...i,path:[...i.path,"properties",d]}));let u=new Set(Object.keys(s)),l=new Set([...u].filter(d=>{let f=o.shape[d];return e.io==="input"?El(f)===void 0:f._zod.optout===void 0}));l.size>0&&(r.required=Array.from(l)),o.catchall?._zod.def.type==="never"?r.additionalProperties=!1:o.catchall?o.catchall&&(r.additionalProperties=Ae(o.catchall,e,{...i,path:[...i.path,"additionalProperties"]})):e.io==="output"&&(r.additionalProperties=!1)},"objectProcessor"),Fg=a((t,e,n,i)=>{let r=t._zod.def,o=r.inclusive===!1,s=r.options.map((c,u)=>Ae(c,e,{...i,path:[...i.path,o?"oneOf":"anyOf",u]}));o?n.oneOf=s:n.anyOf=s},"unionProcessor"),vS=a((t,e,n,i)=>{let r=t._zod.def,o=Ae(r.left,e,{...i,path:[...i.path,"allOf",0]}),s=Ae(r.right,e,{...i,path:[...i.path,"allOf",1]}),c=a(l=>"allOf"in l&&Object.keys(l).length===1,"isSimpleIntersection"),u=[...c(o)?o.allOf:[o],...c(s)?s.allOf:[s]];n.allOf=u,e.intersections.push(u)},"intersectionProcessor"),bS=a((t,e,n,i)=>{let r=n,o=t._zod.def;r.type="array";let s=e.target==="draft-2020-12"?"prefixItems":"items",c=e.target==="draft-2020-12"||e.target==="openapi-3.0"?"items":"additionalItems",u=o.items.map((y,v)=>Ae(y,e,{...i,path:[...i.path,s,v]})),l=o.rest?Ae(o.rest,e,{...i,path:[...i.path,c,...e.target==="openapi-3.0"?[o.items.length]:[]]}):null,d=o.items.length;for(;d>0;){let y=o.items[d-1];if(!(e.io==="input"?El(y)!==void 0:y._zod.optout==="optional"))break;d--}let f=o.items.length,p=!o.rest;e.target==="draft-2020-12"?(r.prefixItems=u,p?r.items=!1:l&&(r.items=l),d>0&&(r.minItems=d),p&&(r.maxItems=f)):e.target==="openapi-3.0"?(r.items={anyOf:u},l&&r.items.anyOf.push(l),d>0&&(r.minItems=d),p&&(r.maxItems=f)):(r.items=u,p?r.additionalItems=!1:l&&(r.additionalItems=l),d>0&&(r.minItems=d),p&&(r.maxItems=f));let{minimum:m,maximum:g}=t._zod.bag;typeof m=="number"&&(r.minItems=m),typeof g=="number"&&(r.maxItems=g)},"tupleProcessor");function Bx(t,e,n){if(e.$ref){if(n.has(e))return e;n.add(e);let g=t.get(e)?.def;if(!g)return e;let y=Bx(t,g,n);return y===g?e:y}for(let g of["anyOf","oneOf"]){let y=e[g];if(!Array.isArray(y))continue;let v=y.map(w=>Bx(t,w,n));v.some((w,b)=>w!==y[b])&&(e={...e,[g]:v})}let i=Array.isArray(e.type)?e.type:[e.type],r=!i.includes("string")&&i.some(g=>g==="number"||g==="integer"),o=e.enum??(e.const!==void 0?[e.const]:void 0);if(!r&&!o?.some(g=>typeof g=="number"))return e;let{minimum:s,maximum:c,exclusiveMinimum:u,exclusiveMaximum:l,multipleOf:d,format:f,id:p,...m}=e;return m.enum?m.enum=m.enum.map(g=>typeof g=="number"?String(g):g):typeof m.const=="number"&&(m.const=String(m.const)),r&&(m.type="string",o||(m.pattern=(i.includes("number")?Ri:Uu).source)),m}a(Bx,"stringifyKeyNames");var Kx=new WeakMap;function qJ(t){let e=new Map;for(let i of t.seen.values())i.def&&!e.has(i.schema)&&e.set(i.schema,i);let n=new Map;for(let i of Kx.get(t)??[]){let r=t.seen.get(i),o=(r?.def??r?.schema)?.propertyNames;if(!o||o===!0||n.has(o))continue;let s=Bx(e,o,new Set);s!==o&&n.set(o,s)}if(n.size)for(let i of t.seen.values())for(let r of[i.schema,i.def]){let o=r&&n.get(r.propertyNames);o&&(r.propertyNames=o)}}a(qJ,"rewriteKeyNames");var wS=a((t,e,n,i)=>{let r=n,o=t._zod.def;r.type="object";let s=o.keyType,u=s._zod.bag?.patterns;if(o.mode==="loose"&&u&&u.size>0){let f=Ae(o.valueType,e,{...i,path:[...i.path,"patternProperties","*"]});r.patternProperties={};for(let p of u)He(r.patternProperties,p.source,f)}else{if(e.target==="draft-07"||e.target==="draft-2020-12"){r.propertyNames=Ae(o.keyType,e,{...i,path:[...i.path,"propertyNames"]});let f=Kx.get(e);f||(f=[],Kx.set(e,f),e.deferred.push(()=>qJ(e))),f.push(t)}r.additionalProperties=Ae(o.valueType,e,{...i,path:[...i.path,"additionalProperties"]})}let l=s._zod.values,d=e.io==="input"&&El(o.valueType)!==void 0;if(l&&!o.partial&&!d){let f=[...l].filter(p=>typeof p=="string"||typeof p=="number");f.length>0&&(r.required=f.map(String))}},"recordProcessor"),$S=a((t,e,n,i)=>{let r=t._zod.def,o=Ae(r.innerType,e,i),s=e.seen.get(t);e.target==="openapi-3.0"?(s.ref=r.innerType,n.nullable=!0):n.anyOf=[o,{type:"null"}]},"nullableProcessor"),_S=a((t,e,n,i)=>{let r=t._zod.def;Ae(r.innerType,e,i);let o=e.seen.get(t);o.ref=r.innerType},"nonoptionalProcessor"),kS=Symbol();function sR(t,e,n,i,r){let o=!1,s=JSON.stringify(t,(c,u)=>typeof u!="bigint"?u:(o=!0,null));return o?(lt(e,n,i,r,"BigInt defaults cannot be represented in JSON Schema"),kS):JSON.parse(s)}a(sR,"serializeDefaultValue");var xS=a((t,e,n,i)=>{let r=t._zod.def;Ae(r.innerType,e,i);let o=e.seen.get(t);o.ref=r.innerType;let s=sR(r.defaultValue,t,e,n,i);s!==kS&&(n.default=s)},"defaultProcessor"),SS=a((t,e,n,i)=>{let r=t._zod.def;Ae(r.innerType,e,i);let o=e.seen.get(t);if(o.ref=r.innerType,e.io!=="input")return;let s=sR(r.defaultValue,t,e,n,i);s!==kS&&(n._prefault=s)},"prefaultProcessor"),IS=a((t,e,n,i)=>{let r=t._zod.def;Ae(r.innerType,e,i);let o=e.seen.get(t);o.ref=r.innerType;let s;try{s=r.catchValue(void 0)}catch{lt(t,e,n,i,"Dynamic catch values are not supported in JSON Schema");return}n.default=s},"catchProcessor"),ES=a((t,e,n,i)=>{let r=t._zod.def,o=r.in._zod.traits.has("$ZodTransform"),s=e.io==="input"?o?r.out:r.in:r.out;Ae(s,e,i);let c=e.seen.get(t);c.ref=s},"pipeProcessor"),TS=a((t,e,n,i)=>{let r=t._zod.def;Ae(r.innerType,e,i);let o=e.seen.get(t);o.ref=r.innerType,n.readOnly=!0},"readonlyProcessor"),AS=a((t,e,n,i)=>{let r=t._zod.def;Ae(r.innerType,e,i);let o=e.seen.get(t);o.ref=r.innerType},"promiseProcessor"),qg=a((t,e,n,i)=>{let r=t._zod.def;Ae(r.innerType,e,i);let o=e.seen.get(t);o.ref=r.innerType},"optionalProcessor"),OS=a((t,e,n,i)=>{let r=t._zod.innerType;Ae(r,e,i);let o=e.seen.get(t);o.ref=r},"lazyProcessor"),Ug={string:Hx,number:Wx,boolean:Gx,bigint:Jx,symbol:Yx,null:Xx,undefined:Qx,void:eS,never:tS,any:nS,unknown:rS,date:iS,enum:oS,literal:sS,nan:aS,template_literal:cS,file:uS,success:lS,custom:dS,function:fS,transform:pS,map:mS,set:hS,array:gS,object:yS,union:Fg,intersection:vS,tuple:bS,record:wS,nullable:$S,nonoptional:_S,default:xS,prefault:SS,catch:IS,pipe:ES,readonly:TS,promise:AS,optional:qg,lazy:OS};function es(t,e){if("_idmap"in t){let i=t,r=Li({...e,processors:Ug}),o={};for(let u of i._idmap.entries()){let[l,d]=u;Ae(d,r)}let s={},c={registry:i,uri:e?.uri,defs:o};r.external=c;for(let u of i._idmap.entries()){let[l,d]=u;Mi(r,d),He(s,l,Ui(r,d))}if(Object.keys(o).length>0){let u=r.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[u]:o}}return{schemas:s}}let n=Li({...e,processors:Ug});return Ae(t,n),Mi(n,t),Ui(n,t)}a(es,"toJSONSchema");var Zg=class{static{a(this,"JSONSchemaGenerator")}get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(e){this.ctx.counter=e}get seen(){return this.ctx.seen}constructor(e){let n=e?.target??"draft-2020-12";n==="draft-4"&&(n="draft-04"),n==="draft-7"&&(n="draft-07"),this.ctx=Li({processors:Ug,target:n,...e?.metadata&&{metadata:e.metadata},...e?.unrepresentable&&{unrepresentable:e.unrepresentable},...e?.override&&{override:e.override},...e?.io&&{io:e.io}})}process(e,n={path:[],schemaPath:[]}){return Ae(e,this.ctx,n)}emit(e,n){n&&(n.cycles&&(this.ctx.cycles=n.cycles),n.reused&&(this.ctx.reused=n.reused),n.external&&(this.ctx.external=n.external)),this.ctx.sharedDefsExtractedFor=void 0,this.ctx.sharedEmitDoneFor=void 0,Mi(this.ctx,e);let i=Ui(this.ctx,e),{"~standard":r,...o}=i;return o}};var aR={};var qa={};Tr(qa,{ZodAny:()=>WS,ZodArray:()=>XS,ZodBase64:()=>cy,ZodBase64URL:()=>uy,ZodBigInt:()=>Ua,ZodBigIntFormat:()=>fy,ZodBoolean:()=>Ma,ZodCIDRv4:()=>sy,ZodCIDRv6:()=>ay,ZodCUID:()=>Qg,ZodCUID2:()=>ey,ZodCatch:()=>y0,ZodCodec:()=>zl,ZodCreditCard:()=>VS,ZodCustom:()=>Dl,ZodCustomStringFormat:()=>Da,ZodDate:()=>Nl,ZodDefault:()=>d0,ZodDiscriminatedUnion:()=>e0,ZodE164:()=>ly,ZodEmail:()=>Gg,ZodEmoji:()=>Yg,ZodEnum:()=>ja,ZodExactOptional:()=>hy,ZodFile:()=>a0,ZodFunction:()=>E0,ZodGUID:()=>Jg,ZodIPv4:()=>iy,ZodIPv6:()=>oy,ZodISODate:()=>qi,ZodISODateTime:()=>Fi,ZodISODuration:()=>Vi,ZodISOTime:()=>Zi,ZodIntersection:()=>t0,ZodJWT:()=>dy,ZodKSUID:()=>ry,ZodLazy:()=>x0,ZodLiteral:()=>s0,ZodMAC:()=>ZS,ZodMap:()=>i0,ZodNaN:()=>b0,ZodNanoID:()=>Xg,ZodNever:()=>JS,ZodNonOptional:()=>gy,ZodNull:()=>HS,ZodNullable:()=>l0,ZodNumber:()=>La,ZodNumberFormat:()=>ns,ZodObject:()=>Cl,ZodOptional:()=>rs,ZodPipe:()=>jl,ZodPrefault:()=>p0,ZodPreprocess:()=>w0,ZodPromise:()=>I0,ZodReadonly:()=>$0,ZodRecord:()=>Ra,ZodSet:()=>o0,ZodString:()=>za,ZodStringFormat:()=>ze,ZodSuccess:()=>g0,ZodSymbol:()=>BS,ZodTemplateLiteral:()=>k0,ZodTransform:()=>c0,ZodTuple:()=>n0,ZodType:()=>oe,ZodULID:()=>ty,ZodURL:()=>Al,ZodUUID:()=>Cr,ZodUndefined:()=>KS,ZodUnion:()=>Pl,ZodUnknown:()=>GS,ZodVoid:()=>YS,ZodXID:()=>ny,ZodXor:()=>QS,_ZodString:()=>Wg,_default:()=>f0,_function:()=>pj,any:()=>WR,array:()=>le,base64:()=>OR,base64url:()=>NR,bigint:()=>ZR,boolean:()=>et,catch:()=>v0,check:()=>mj,cidrv4:()=>TR,cidrv6:()=>AR,codec:()=>uj,creditCard:()=>PR,cuid:()=>wR,cuid2:()=>$R,custom:()=>yy,date:()=>JR,describe:()=>hj,discriminatedUnion:()=>Rl,e164:()=>CR,email:()=>lR,emoji:()=>vR,enum:()=>xt,exactOptional:()=>u0,file:()=>oj,float32:()=>MR,float64:()=>UR,function:()=>pj,guid:()=>dR,hash:()=>LR,hex:()=>DR,hostname:()=>zR,httpUrl:()=>yR,instanceof:()=>yj,int:()=>Kg,int32:()=>FR,int64:()=>VR,intersection:()=>Fa,invertCodec:()=>lj,ipv4:()=>SR,ipv6:()=>ER,json:()=>bj,jwt:()=>RR,keyof:()=>YR,ksuid:()=>xR,lazy:()=>S0,literal:()=>B,looseObject:()=>kt,looseRecord:()=>tj,mac:()=>IR,map:()=>nj,meta:()=>gj,nan:()=>cj,nanoid:()=>bR,nativeEnum:()=>ij,never:()=>py,nonoptional:()=>h0,null:()=>Ol,nullable:()=>Tl,nullish:()=>sj,number:()=>ke,object:()=>U,optional:()=>Ce,partialRecord:()=>ej,pipe:()=>Hg,prefault:()=>m0,preprocess:()=>Ll,promise:()=>fj,readonly:()=>_0,record:()=>Pe,refine:()=>T0,set:()=>rj,strictObject:()=>XR,string:()=>E,stringFormat:()=>jR,stringbool:()=>vj,success:()=>aj,superRefine:()=>A0,symbol:()=>KR,templateLiteral:()=>dj,transform:()=>my,tuple:()=>r0,uint32:()=>qR,uint64:()=>BR,ulid:()=>_R,undefined:()=>HR,union:()=>Oe,unknown:()=>je,url:()=>gR,uuid:()=>fR,uuidv4:()=>pR,uuidv6:()=>mR,uuidv7:()=>hR,void:()=>GR,xid:()=>kR,xor:()=>QR});var Vg={};Tr(Vg,{endsWith:()=>Ia,gt:()=>Or,gte:()=>Tn,includes:()=>xa,length:()=>Xo,lowercase:()=>_a,lt:()=>Ar,lte:()=>En,maxLength:()=>Yo,maxSize:()=>Di,mime:()=>Ea,minLength:()=>Yr,minSize:()=>Nr,multipleOf:()=>zi,negative:()=>Tg,nonnegative:()=>Og,nonpositive:()=>Ag,normalize:()=>Ta,overwrite:()=>sr,positive:()=>Eg,properties:()=>Cg,property:()=>Ng,regex:()=>$a,size:()=>Jo,slugify:()=>Ca,startsWith:()=>Sa,toLowerCase:()=>Oa,toUpperCase:()=>Na,trim:()=>Aa,uppercase:()=>ka});var cR=new WeakSet([Object.prototype,Error.prototype]);function Bg(t,e,n){Object.defineProperty(t,e,{configurable:!0,enumerable:!1,get(){let i=n(this);return Object.defineProperty(this,e,{value:i,configurable:!0,writable:!0}),i},set(i){Object.defineProperty(this,e,{value:i,configurable:!0,writable:!0})}})}a(Bg,"_lazyMethod");var uR=a((t,e)=>{Du.init(t,e),t.name="ZodError";let n=Object.getPrototypeOf(t);cR.has(n)||(cR.add(n),Bg(n,"format",i=>r=>Mu(i,r)),Bg(n,"flatten",i=>r=>Lu(i,r)),Bg(n,"addIssue",i=>r=>{i.issues.push(r),i.message=JSON.stringify(i.issues,ia,2)}),Bg(n,"addIssues",i=>r=>{i.issues.push(...r),i.message=JSON.stringify(i.issues,ia,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},"initializer"),VJ=_("ZodError",uR),an=_("ZodError",uR,void 0,{Parent:Error});var NS=ca(an),CS=ua(an),PS=la(an),RS=da(an),jS=_m(an),zS=km(an),DS=xm(an),LS=Sm(an),MS=Im(an),US=Em(an),FS=Tm(an),qS=Am(an);function KJ(){ht.localeError||Ye(Yu())}a(KJ,"_ensureDefaultLocale");function ts(){ht.memoizer||Ye({memoizer:Ju()})}a(ts,"_ensureDefaultMemoizer");var oe=_("ZodType",(t,e)=>(KJ(),te.init(t,e),t.def=e,t.type=e.type,t),{check(...t){let e=this.def;return this.clone(N.mergeDefs(e,{checks:[...e.checks??[],...t.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},with(...t){return this.check(...t)},clone(t,e){return _e(this,t,e)},brand(){return this},register(t,e){return t.add(this,e),this},refine(t,e){return this.check(T0(t,e))},superRefine(t,e){return this.check(A0(t,e))},overwrite(t){return this.check(sr(t))},optional(){return Ce(this)},exactOptional(){return u0(this)},nullable(){return Tl(this)},nullish(){return Ce(Tl(this))},nonoptional(t){return h0(this,t)},array(){return le(this)},or(t){return Oe([this,t])},and(t){return Fa(this,t)},transform(t){return Hg(this,my(t))},default(t){return f0(this,t)},prefault(t){return m0(this,t)},catch(t){return v0(this,t)},pipe(t){return Hg(this,t)},readonly(){return _0(this)},describe(t){let e=this.clone();return _t.add(e,{description:t}),e},meta(...t){if(t.length===0)return _t.get(this);let e=this.clone();return _t.add(e,t[0]),e},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(t,...e){return e.length===0?t(this):t(this,...e)},get"~standard"(){return N.hide(this,"~standard",{...Um(this),jsonSchema:{input:Pa(this,"input"),output:Pa(this,"output")}})},set"~standard"(t){N.own(this,"~standard",t)},parse:a(function t(e,n){return NS(this,e,n,{callee:t})},"_parse"),parseAsync:a(async function t(e,n){return await CS(this,e,n,{callee:t})},"_parseAsync"),safeParse(t,e){return PS(this,t,e)},async safeParseAsync(t,e){return RS(this,t,e)},get spa(){return this?.safeParseAsync},set spa(t){N.own(this,"spa",t)},encode:a(function t(e,n){return jS(this,e,n,{callee:t})},"_encode"),decode:a(function t(e,n){return zS(this,e,n,{callee:t})},"_decode"),encodeAsync:a(async function t(e,n){return await DS(this,e,n,{callee:t})},"_encodeAsync"),decodeAsync:a(async function t(e,n){return await LS(this,e,n,{callee:t})},"_decodeAsync"),safeEncode(t,e){return MS(this,t,e)},safeDecode(t,e){return US(this,t,e)},async safeEncodeAsync(t,e){return FS(this,t,e)},async safeDecodeAsync(t,e){return qS(this,t,e)},toJSONSchema(t){return Vx(this,{})(t)},get description(){return _t.get(this)?.description},get _def(){return this._zod.def}}),Wg=_("_ZodString",(t,e)=>{ji.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(i,r,o)=>Hx(t,i,r,o);let n=t._zod.bag;t.format=n.format??null,t.minLength=n.minimum??null,t.maxLength=n.maximum??null},{regex(...t){return this.check($a(...t))},includes(...t){return this.check(xa(...t))},startsWith(...t){return this.check(Sa(...t))},endsWith(...t){return this.check(Ia(...t))},min(...t){return this.check(Yr(...t))},max(...t){return this.check(Yo(...t))},length(...t){return this.check(Xo(...t))},nonempty(...t){return this.check(Yr(1,...t))},lowercase(t){return this.check(_a(t))},uppercase(t){return this.check(ka(t))},trim(){return this.check(Aa())},normalize(...t){return this.check(Ta(...t))},toLowerCase(){return this.check(Oa())},toUpperCase(){return this.check(Na())},slugify(){return this.check(Ca())}}),za=_("ZodString",(t,e)=>{ji.init(t,e),Wg.init(t,e)},{email(t){return this.check(tl(Gg,t))},url(t){return this.check(wa(Al,t))},jwt(t){return this.check($l(dy,t))},emoji(t){return this.check(al(Yg,t))},guid(t){return this.check(nl(Jg,t))},uuid(t){return this.check(rl(Cr,t))},uuidv4(t){return this.check(il(Cr,t))},uuidv6(t){return this.check(ol(Cr,t))},uuidv7(t){return this.check(sl(Cr,t))},nanoid(t){return this.check(cl(Xg,t))},cuid(t){return this.check(ul(Qg,t))},cuid2(t){return this.check(ll(ey,t))},ulid(t){return this.check(dl(ty,t))},base64(t){return this.check(vl(cy,t))},base64url(t){return this.check(bl(uy,t))},xid(t){return this.check(fl(ny,t))},ksuid(t){return this.check(pl(ry,t))},ipv4(t){return this.check(ml(iy,t))},ipv6(t){return this.check(hl(oy,t))},cidrv4(t){return this.check(gl(sy,t))},cidrv6(t){return this.check(yl(ay,t))},e164(t){return this.check(wl(ly,t))},datetime(t){return this.check(_l(Fi,t))},date(t){return this.check(kl(qi,t))},time(t){return this.check(xl(Zi,t))},duration(t){return this.check(Sl(Vi,t))}});function E(t){return og(za,t)}a(E,"string");var ze=_("ZodStringFormat",(t,e)=>{Te.init(t,e),Wg.init(t,e)}),Fi=_("ZodISODateTime",(t,e)=>{pk.init(t,e),ze.init(t,e)}),qi=_("ZodISODate",(t,e)=>{mk.init(t,e),ze.init(t,e)}),Zi=_("ZodISOTime",(t,e)=>{hk.init(t,e),ze.init(t,e)}),Vi=_("ZodISODuration",(t,e)=>{gk.init(t,e),ze.init(t,e)}),Gg=_("ZodEmail",(t,e)=>{Zm.init(t,e),ze.init(t,e)});function lR(t){return tl(Gg,t)}a(lR,"email");var Jg=_("ZodGUID",(t,e)=>{Fm.init(t,e),ze.init(t,e)});function dR(t){return nl(Jg,t)}a(dR,"guid");var Cr=_("ZodUUID",(t,e)=>{qm.init(t,e),ze.init(t,e)});function fR(t){return rl(Cr,t)}a(fR,"uuid");function pR(t){return il(Cr,t)}a(pR,"uuidv4");function mR(t){return ol(Cr,t)}a(mR,"uuidv6");function hR(t){return sl(Cr,t)}a(hR,"uuidv7");var Al=_("ZodURL",(t,e)=>{Wm.init(t,e),ze.init(t,e)});function gR(t){return wa(Al,t)}a(gR,"url");function yR(t){return wa(Al,{protocol:Rt.httpProtocol,hostname:Rt.domain,...N.normalizeParams(t)})}a(yR,"httpUrl");var Yg=_("ZodEmoji",(t,e)=>{Gm.init(t,e),ze.init(t,e)});function vR(t){return al(Yg,t)}a(vR,"emoji");var Xg=_("ZodNanoID",(t,e)=>{Jm.init(t,e),ze.init(t,e)});function bR(t){return cl(Xg,t)}a(bR,"nanoid");var Qg=_("ZodCUID",(t,e)=>{Ym.init(t,e),ze.init(t,e)});function wR(t){return ul(Qg,t)}a(wR,"cuid");var ey=_("ZodCUID2",(t,e)=>{Xm.init(t,e),ze.init(t,e)});function $R(t){return ll(ey,t)}a($R,"cuid2");var ty=_("ZodULID",(t,e)=>{Qm.init(t,e),ze.init(t,e)});function _R(t){return dl(ty,t)}a(_R,"ulid");var ny=_("ZodXID",(t,e)=>{eh.init(t,e),ze.init(t,e)});function kR(t){return fl(ny,t)}a(kR,"xid");var ry=_("ZodKSUID",(t,e)=>{th.init(t,e),ze.init(t,e)});function xR(t){return pl(ry,t)}a(xR,"ksuid");var iy=_("ZodIPv4",(t,e)=>{nh.init(t,e),ze.init(t,e)});function SR(t){return ml(iy,t)}a(SR,"ipv4");var ZS=_("ZodMAC",(t,e)=>{ih.init(t,e),ze.init(t,e)});function IR(t){return sg(ZS,t)}a(IR,"mac");var oy=_("ZodIPv6",(t,e)=>{rh.init(t,e),ze.init(t,e)});function ER(t){return hl(oy,t)}a(ER,"ipv6");var sy=_("ZodCIDRv4",(t,e)=>{oh.init(t,e),ze.init(t,e)});function TR(t){return gl(sy,t)}a(TR,"cidrv4");var ay=_("ZodCIDRv6",(t,e)=>{ah.init(t,e),ze.init(t,e)});function AR(t){return yl(ay,t)}a(AR,"cidrv6");var cy=_("ZodBase64",(t,e)=>{ch.init(t,e),ze.init(t,e)});function OR(t){return vl(cy,t)}a(OR,"base64");var uy=_("ZodBase64URL",(t,e)=>{lh.init(t,e),ze.init(t,e)});function NR(t){return bl(uy,t)}a(NR,"base64url");var ly=_("ZodE164",(t,e)=>{dh.init(t,e),ze.init(t,e)});function CR(t){return wl(ly,t)}a(CR,"e164");var VS=_("ZodCreditCard",(t,e)=>{ph.init(t,e),ze.init(t,e)});function PR(t){return ag(VS,t)}a(PR,"creditCard");var dy=_("ZodJWT",(t,e)=>{hh.init(t,e),ze.init(t,e)});function RR(t){return $l(dy,t)}a(RR,"jwt");var Da=_("ZodCustomStringFormat",(t,e)=>{gh.init(t,e),ze.init(t,e)});function jR(t,e,n={}){return Qo(Da,t,e,n)}a(jR,"stringFormat");function zR(t){return Qo(Da,"hostname",Rt.hostname,t)}a(zR,"hostname");function DR(t){return Qo(Da,"hex",Rt.hex,t)}a(DR,"hex");function LR(t,e){let n=e?.enc??"hex",i=`${t}_${n}`,r=Rt[i];if(!r)throw new Error(`Unrecognized hash format: ${i}`);return Qo(Da,i,r,e)}a(LR,"hash");var La=_("ZodNumber",(t,e)=>{Bu.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(i,r,o)=>Wx(t,i,r,o);let n=t._zod.bag;t.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),t.isFinite=!0,t.format=n.format??null},{gt(t,e){return this.check(Or(t,e))},gte(t,e){return this.check(Tn(t,e))},min(t,e){return this.check(Tn(t,e))},lt(t,e){return this.check(Ar(t,e))},lte(t,e){return this.check(En(t,e))},max(t,e){return this.check(En(t,e))},int(t){return this.check(Kg(t))},safe(t){return this.check(Kg(t))},positive(t){return this.check(Or(0,t))},nonnegative(t){return this.check(Tn(0,t))},negative(t){return this.check(Ar(0,t))},nonpositive(t){return this.check(En(0,t))},multipleOf(t,e){return this.check(zi(t,e))},step(t,e){return this.check(zi(t,e))},finite(){return this}});function ke(t){return cg(La,t)}a(ke,"number");var ns=_("ZodNumberFormat",(t,e)=>{yh.init(t,e),La.init(t,e)});function Kg(t){return ug(ns,t)}a(Kg,"int");function MR(t){return lg(ns,t)}a(MR,"float32");function UR(t){return dg(ns,t)}a(UR,"float64");function FR(t){return fg(ns,t)}a(FR,"int32");function qR(t){return pg(ns,t)}a(qR,"uint32");var Ma=_("ZodBoolean",(t,e)=>{ma.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Gx(t,n,i,r)});function et(t){return mg(Ma,t)}a(et,"boolean");var Ua=_("ZodBigInt",(t,e)=>{Ku.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(i,r,o)=>Jx(t,i,r,o);let n=t._zod.bag;t.minValue=n.minimum??null,t.maxValue=n.maximum??null,t.format=n.format??null},{gte(t,e){return this.check(Tn(t,e))},min(t,e){return this.check(Tn(t,e))},gt(t,e){return this.check(Or(t,e))},lt(t,e){return this.check(Ar(t,e))},lte(t,e){return this.check(En(t,e))},max(t,e){return this.check(En(t,e))},positive(t){return this.check(Or(BigInt(0),t))},negative(t){return this.check(Ar(BigInt(0),t))},nonpositive(t){return this.check(En(BigInt(0),t))},nonnegative(t){return this.check(Tn(BigInt(0),t))},multipleOf(t,e){return this.check(zi(t,e))}});function ZR(t){return hg(Ua,t)}a(ZR,"bigint");var fy=_("ZodBigIntFormat",(t,e)=>{vh.init(t,e),Ua.init(t,e)});function VR(t){return gg(fy,t)}a(VR,"int64");function BR(t){return yg(fy,t)}a(BR,"uint64");var BS=_("ZodSymbol",(t,e)=>{bh.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Yx(t,n,i,r)});function KR(t){return vg(BS,t)}a(KR,"symbol");var KS=_("ZodUndefined",(t,e)=>{wh.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Qx(t,n,i,r)});function HR(t){return bg(KS,t)}a(HR,"_undefined");var HS=_("ZodNull",(t,e)=>{$h.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Xx(t,n,i,r)});function Ol(t){return wg(HS,t)}a(Ol,"_null");var WS=_("ZodAny",(t,e)=>{_h.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(n,i,r)=>nS(t,n,i,r)});function WR(){return $g(WS)}a(WR,"any");var GS=_("ZodUnknown",(t,e)=>{kh.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(n,i,r)=>rS(t,n,i,r)});function je(){return _g(GS)}a(je,"unknown");var JS=_("ZodNever",(t,e)=>{xh.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(n,i,r)=>tS(t,n,i,r)});function py(t){return kg(JS,t)}a(py,"never");var YS=_("ZodVoid",(t,e)=>{Sh.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(n,i,r)=>eS(t,n,i,r)});function GR(t){return xg(YS,t)}a(GR,"_void");var Nl=_("ZodDate",(t,e)=>{Ih.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(i,r,o)=>iS(t,i,r,o),t.min=(i,r)=>t.check(Tn(i,r)),t.max=(i,r)=>t.check(En(i,r));let n=t._zod.bag;t.minDate=n.minimum?new Date(n.minimum):null,t.maxDate=n.maximum?new Date(n.maximum):null});function JR(t){return Sg(Nl,t)}a(JR,"date");var XS=_("ZodArray",(t,e)=>{ts(),Eh.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(n,i,r)=>gS(t,n,i,r),t.element=e.element},{min(t,e){return this.check(Yr(t,e))},nonempty(t){return this.check(Yr(1,t))},max(t,e){return this.check(Yo(t,e))},length(t,e){return this.check(Xo(t,e))},unwrap(){return this.element}});function le(t,e){return qx(XS,t,e)}a(le,"array");function YR(t){let e=t._zod.def.shape;return xt(Object.keys(e))}a(YR,"keyof");var Cl=_("ZodObject",(t,e)=>{ts(),yk.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(n,i,r)=>yS(t,n,i,r),N.installLazyProp(t,"shape",n=>n._zod.def.shape,!1)},{keyof(){return xt(Object.keys(this._zod.def.shape))},catchall(t){return this.clone({...this._zod.def,catchall:t})},passthrough(){return this.clone({...this._zod.def,catchall:je()})},loose(){return this.clone({...this._zod.def,catchall:je()})},strict(){return this.clone({...this._zod.def,catchall:py()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(t){return N.extend(this,t)},safeExtend(t){return N.safeExtend(this,t)},merge(t){return N.merge(this,t)},pick(t){return N.pick(this,t)},omit(t){return N.omit(this,t)},partial(...t){return N.partial(rs,this,t[0])},exactPartial(...t){return N.partial(hy,this,t[0],"exactPartial")},required(...t){return N.required(gy,this,t[0])}});function U(t,e){let n={type:"object",shape:t??{},...N.normalizeParams(e)};return new Cl(n)}a(U,"object");function XR(t,e){return new Cl({type:"object",shape:t,catchall:py(),...N.normalizeParams(e)})}a(XR,"strictObject");function kt(t,e){return new Cl({type:"object",shape:t,catchall:je(),...N.normalizeParams(e)})}a(kt,"looseObject");var Pl=_("ZodUnion",(t,e)=>{ha.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Fg(t,n,i,r),t.options=e.options});function Oe(t,e){return new Pl({type:"union",options:t,...N.normalizeParams(e)})}a(Oe,"union");var QS=_("ZodXor",(t,e)=>{Pl.init(t,e),Ah.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Fg(t,n,i,r),t.options=e.options});function QR(t,e){return new QS({type:"union",options:t,inclusive:!1,...N.normalizeParams(e)})}a(QR,"xor");var e0=_("ZodDiscriminatedUnion",(t,e)=>{Pl.init(t,e),Oh.init(t,e)});function Rl(t,e,n){return new e0({type:"union",options:e,discriminator:t,...N.normalizeParams(n)})}a(Rl,"discriminatedUnion");var t0=_("ZodIntersection",(t,e)=>{Nh.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(n,i,r)=>vS(t,n,i,r)});function Fa(t,e){return new t0({type:"intersection",left:t,right:e})}a(Fa,"intersection");var n0=_("ZodTuple",(t,e)=>{ts(),Hu.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(n,i,r)=>bS(t,n,i,r)},{rest(t){return this.clone({...this._zod.def,rest:t})},partial(){let t=this._zod.def;if(t.checks?.length)throw new Error(".partial() cannot be used on tuple schemas containing refinements");return this.clone({...t,items:t.items.map(e=>new rs({type:"optional",innerType:e}))})}});function r0(t,e,n){let i=e instanceof te,r=i?n:e,o=i?e:null;return new n0({type:"tuple",items:t,rest:o,...N.normalizeParams(r)})}a(r0,"tuple");var Ra=_("ZodRecord",(t,e)=>{ts(),Ch.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(n,i,r)=>wS(t,n,i,r),t.keyType=e.keyType,t.valueType=e.valueType});function Pe(t,e,n){return!e||!e._zod?new Ra({type:"record",keyType:E(),valueType:t,...N.normalizeParams(e)}):new Ra({type:"record",keyType:t,valueType:e,...N.normalizeParams(n)})}a(Pe,"record");function ej(t,e,n){return new Ra({type:"record",keyType:t,valueType:e,...N.normalizeParams(n),partial:!0})}a(ej,"partialRecord");function tj(t,e,n){return new Ra({type:"record",keyType:t,valueType:e,mode:"loose",...N.normalizeParams(n)})}a(tj,"looseRecord");var i0=_("ZodMap",(t,e)=>{ts(),Ph.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(n,i,r)=>mS(t,n,i,r),t.keyType=e.keyType,t.valueType=e.valueType,t.min=(...n)=>t.check(Nr(...n)),t.nonempty=n=>t.check(Nr(1,n)),t.max=(...n)=>t.check(Di(...n)),t.size=(...n)=>t.check(Jo(...n))});function nj(t,e,n){return new i0({type:"map",keyType:t,valueType:e,...N.normalizeParams(n)})}a(nj,"map");var o0=_("ZodSet",(t,e)=>{ts(),Rh.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(n,i,r)=>hS(t,n,i,r),t.min=(...n)=>t.check(Nr(...n)),t.nonempty=n=>t.check(Nr(1,n)),t.max=(...n)=>t.check(Di(...n)),t.size=(...n)=>t.check(Jo(...n))});function rj(t,e){return new o0({type:"set",valueType:t,...N.normalizeParams(e)})}a(rj,"set");var ja=_("ZodEnum",(t,e)=>{jh.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(i,r,o)=>oS(t,i,r,o),t.enum=e.entries,t.options=Object.values(e.entries);let n=new Set(Object.keys(e.entries));t.extract=(i,r)=>{let o={};for(let s of i)if(n.has(s))o[s]=e.entries[s];else throw new Error(`Key ${s} not found in enum`);return new ja({...e,checks:[],...N.normalizeParams(r),entries:o})},t.exclude=(i,r)=>{let o={...e.entries};for(let s of i)if(n.has(s))delete o[s];else throw new Error(`Key ${s} not found in enum`);return new ja({...e,checks:[],...N.normalizeParams(r),entries:o})}});function xt(t,e){let n=Array.isArray(t)?Object.fromEntries(t.map(i=>[i,i])):t;return new ja({type:"enum",entries:n,...N.normalizeParams(e)})}a(xt,"_enum");function ij(t,e){return new ja({type:"enum",entries:t,...N.normalizeParams(e)})}a(ij,"nativeEnum");var s0=_("ZodLiteral",(t,e)=>{zh.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(n,i,r)=>sS(t,n,i,r),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function B(t,e){return new s0({type:"literal",values:Array.isArray(t)?t:[t],...N.normalizeParams(e)})}a(B,"literal");var a0=_("ZodFile",(t,e)=>{Dh.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(n,i,r)=>uS(t,n,i,r),t.min=(n,i)=>t.check(Nr(n,i)),t.max=(n,i)=>t.check(Di(n,i)),t.mime=(n,i)=>t.check(Ea(Array.isArray(n)?n:[n],i))});function oj(t){return Pg(a0,t)}a(oj,"file");var c0=_("ZodTransform",(t,e)=>{ts(),Lh.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(n,i,r)=>pS(t,n,i,r),t._zod.parse=(n,i)=>{if(i.direction==="backward")throw new Ni(t.constructor.name);n.addIssue=o=>{if(typeof o=="string")n.issues.push(N.issue(o,n.value,e));else{let s=o;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),"input"in s||(s.input=n.value),s.inst??(s.inst=t),n.issues.push(N.issue(s))}};let r=e.transform(n.value,n);return r instanceof Promise?r.then(o=>(n.value=o,n)):(n.value=r,n)}});function my(t){return new c0({type:"transform",transform:t})}a(my,"transform");var rs=_("ZodOptional",(t,e)=>{Wu.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(n,i,r)=>qg(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});function Ce(t){return new rs({type:"optional",innerType:t})}a(Ce,"optional");var hy=_("ZodExactOptional",(t,e)=>{Mh.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(n,i,r)=>qg(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});function u0(t){return new hy({type:"optional",innerType:t})}a(u0,"exactOptional");var l0=_("ZodNullable",(t,e)=>{Uh.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(n,i,r)=>$S(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});function Tl(t){return new l0({type:"nullable",innerType:t})}a(Tl,"nullable");function sj(t){return Ce(Tl(t))}a(sj,"nullish");var d0=_("ZodDefault",(t,e)=>{Fh.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(n,i,r)=>xS(t,n,i,r),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function f0(t,e){return new d0({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():N.shallowClone(e)}})}a(f0,"_default");var p0=_("ZodPrefault",(t,e)=>{qh.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(n,i,r)=>SS(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});function m0(t,e){return new p0({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():N.shallowClone(e)}})}a(m0,"prefault");var gy=_("ZodNonOptional",(t,e)=>{Zh.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(n,i,r)=>_S(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});function h0(t,e){return new gy({type:"nonoptional",innerType:t,...N.normalizeParams(e)})}a(h0,"nonoptional");var g0=_("ZodSuccess",(t,e)=>{Vh.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(n,i,r)=>lS(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});function aj(t){return new g0({type:"success",innerType:t})}a(aj,"success");var y0=_("ZodCatch",(t,e)=>{Bh.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(n,i,r)=>IS(t,n,i,r),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function v0(t,e){return new y0({type:"catch",innerType:t,catchValue:typeof e=="function"?e:N.constantCatch(e)})}a(v0,"_catch");var b0=_("ZodNaN",(t,e)=>{Kh.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(n,i,r)=>aS(t,n,i,r)});function cj(t){return Ig(b0,t)}a(cj,"nan");var jl=_("ZodPipe",(t,e)=>{Gu.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(n,i,r)=>ES(t,n,i,r),t.in=e.in,t.out=e.out});function Hg(t,e){return new jl({type:"pipe",in:t,out:e})}a(Hg,"pipe");var zl=_("ZodCodec",(t,e)=>{jl.init(t,e),ga.init(t,e)});function uj(t,e,n){return new zl({type:"pipe",in:t,out:e,transform:n.decode,reverseTransform:n.encode})}a(uj,"codec");function lj(t){let e=t._zod.def;return new zl({type:"pipe",in:e.out,out:e.in,transform:e.reverseTransform,reverseTransform:e.transform})}a(lj,"invertCodec");var w0=_("ZodPreprocess",(t,e)=>{jl.init(t,e),bk.init(t,e)}),$0=_("ZodReadonly",(t,e)=>{Hh.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(n,i,r)=>TS(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});function _0(t){return new $0({type:"readonly",innerType:t})}a(_0,"readonly");var k0=_("ZodTemplateLiteral",(t,e)=>{Wh.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(n,i,r)=>cS(t,n,i,r)});function dj(t,e){return new k0({type:"template_literal",parts:t,...N.normalizeParams(e)})}a(dj,"templateLiteral");var x0=_("ZodLazy",(t,e)=>{ya.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(n,i,r)=>OS(t,n,i,r),t.unwrap=()=>t._zod.def.getter()});function S0(t){return new x0({type:"lazy",getter:t})}a(S0,"lazy");var I0=_("ZodPromise",(t,e)=>{Jh.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(n,i,r)=>AS(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});function fj(t){return new I0({type:"promise",innerType:t})}a(fj,"promise");var E0=_("ZodFunction",(t,e)=>{Gh.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(n,i,r)=>fS(t,n,i,r)});function pj(t){return new E0({type:"function",input:Array.isArray(t?.input)?r0(t?.input):t?.input??le(je()),output:t?.output??je()})}a(pj,"_function");var Dl=_("ZodCustom",(t,e)=>{Yh.init(t,e),oe.init(t,e),t._zod.processJSONSchema=(n,i,r)=>dS(t,n,i,r)});function mj(t){let e=new Re({check:"custom"});return e._zod.check=t,e}a(mj,"check");function yy(t,e){return Rg(Dl,t??(()=>!0),e)}a(yy,"custom");function T0(t,e={}){return jg(Dl,t,e)}a(T0,"refine");function A0(t,e){return zg(t,e)}a(A0,"superRefine");var hj=Dg,gj=Lg;function yj(t,e={}){let n=new Dl({type:"custom",check:"custom",fn:a(i=>i instanceof t,"fn"),abort:!0,...N.normalizeParams(e)});return n._zod.bag.Class=t,n._zod.check=i=>{i.value instanceof t||i.issues.push({code:"invalid_type",expected:t.name,input:i.value,inst:n,path:[...n._zod.def.path??[]]})},n}a(yj,"_instanceof");var vj=a((...t)=>Mg({Codec:zl,Boolean:Ma,String:za},...t),"stringbool");function bj(t){let e=S0(()=>Oe([E(t),ke(),et(),Ol(),le(e),Pe(E(),e)]));return e}a(bj,"json");function Ll(t,e){return new w0({type:"pipe",in:my(t),out:e})}a(Ll,"preprocess");var HJ={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function WJ(t){Ye({customError:t})}a(WJ,"setErrorMap");function GJ(){return Ye().customError}a(GJ,"getErrorMap");var O0;O0||(O0={});var is={};Tr(is,{ZodISODate:()=>qi,ZodISODateTime:()=>Fi,ZodISODuration:()=>Vi,ZodISOTime:()=>Zi,date:()=>YJ,datetime:()=>JJ,duration:()=>QJ,time:()=>XJ});function JJ(t){return _l(Fi,t)}a(JJ,"datetime");function YJ(t){return kl(qi,t)}a(YJ,"date");function XJ(t){return xl(Zi,t)}a(XJ,"time");function QJ(t){return Sl(Vi,t)}a(QJ,"duration");var M={...qa,...Vg,iso:is},e3=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function t3(t,e){let n=t.$schema;return n==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":n==="http://json-schema.org/draft-07/schema#"?"draft-7":n==="http://json-schema.org/draft-04/schema#"?"draft-4":e??"draft-2020-12"}a(t3,"detectVersion");function wj(t,e){return t.map((n,i)=>i<e?n:n.optional())}a(wj,"applyMinItems");function n3(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}a(n3,"decodeJSONPointerSegment");function r3(t,e){if(!t.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let n=t.slice(1).split("/").filter(Boolean);if(n.length===0)return e.rootSchema;let i=e.version==="draft-2020-12"?"$defs":"definitions";if(n[0]===i){let r=n[1]===void 0?void 0:n3(n[1]);if(!r||!e.defs[r])throw new Error(`Reference not found: ${t}`);return e.defs[r]}throw new Error(`Reference not found: ${t}`)}a(r3,"resolveRef");function i3(t,e){return M.transform(i=>i).check(i=>{let r=i.value;if(!(typeof r!="object"||r===null||Array.isArray(r)))for(let o of Object.getOwnPropertyNames(r)){let s=e.safeParse(o);s.success||i.issues.push({code:"invalid_key",origin:"record",issues:s.error.issues,input:o,path:[o],continue:!0})}}).pipe(t)}a(i3,"checkPropertyNames");function $j(t,e){if(t!==!1)return t===void 0||t===!0?M.any():cn(t,e)}a($j,"getTupleRest");var o3=/^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/;function _j(t,e){if(t.not!==void 0){if(typeof t.not=="object"&&Object.keys(t.not).length===0)return M.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(t.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(t.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(t.if!==void 0||t.then!==void 0||t.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(t.dependentSchemas!==void 0||t.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(t.$ref){let r=t.$ref;if(e.refs.has(r))return e.refs.get(r);if(e.processing.has(r))return M.lazy(()=>{if(!e.refs.has(r))throw new Error(`Circular reference not resolved: ${r}`);return e.refs.get(r)});e.processing.add(r);let o=r3(r,e),s=cn(o,e);return e.refs.set(r,s),e.processing.delete(r),s}if(t.enum!==void 0){let r=t.enum;if(e.version==="openapi-3.0"&&t.nullable===!0&&r.length===1&&r[0]===null)return M.null();if(r.length===0)return M.never();if(r.length===1)return M.literal(r[0]);if(r.every(s=>typeof s=="string"))return M.enum(r);let o=r.map(s=>M.literal(s));return o.length<2?o[0]:M.union([o[0],o[1],...o.slice(2)])}if(t.const!==void 0)return M.literal(t.const);let n=t.type;if(Array.isArray(n)){let r=n.map(o=>{let s={...t,type:o};return _j(s,e)});return r.length===0?M.never():r.length===1?r[0]:M.union(r)}if(!n)return M.any();let i;switch(n){case"string":{let r=M.string();if(t.format){let o=t.format;o==="email"?r=r.check(M.email()):o==="uri"||o==="uri-reference"?r=r.check(M.url()):o==="uuid"||o==="guid"?r=r.check(M.uuid()):o==="date-time"?r=r.check(M.iso.datetime({offset:!0})):o==="date"?r=r.check(M.iso.date()):o==="time"?r=r.check(M.regex(o3)):o==="duration"?r=r.check(M.iso.duration()):o==="hostname"?r=r.check(M.hostname()):o==="ipv4"?r=r.check(M.ipv4()):o==="ipv6"?r=r.check(M.ipv6()):o==="mac"?r=r.check(M.mac()):o==="cidr"?r=r.check(M.cidrv4()):o==="cidr-v6"?r=r.check(M.cidrv6()):o==="base64"?r=r.check(M.base64()):o==="base64url"?r=r.check(M.base64url()):o==="e164"?r=r.check(M.e164()):o==="credit_card"?r=r.check(M.creditCard()):o==="jwt"?r=r.check(M.jwt()):o==="emoji"?r=r.check(M.emoji()):o==="nanoid"?r=r.check(M.nanoid()):o==="cuid"?r=r.check(M.cuid()):o==="cuid2"?r=r.check(M.cuid2()):o==="ulid"?r=r.check(M.ulid()):o==="xid"?r=r.check(M.xid()):o==="ksuid"&&(r=r.check(M.ksuid()))}typeof t.minLength=="number"&&(r=r.min(t.minLength)),typeof t.maxLength=="number"&&(r=r.max(t.maxLength)),t.pattern&&(r=r.regex(new RegExp(t.pattern))),i=r;break}case"number":case"integer":{let r=n==="integer"?M.number().int():M.number();typeof t.minimum=="number"&&t.exclusiveMinimum!==!0&&(r=r.min(t.minimum)),typeof t.maximum=="number"&&t.exclusiveMaximum!==!0&&(r=r.max(t.maximum)),typeof t.exclusiveMinimum=="number"?r=r.gt(t.exclusiveMinimum):t.exclusiveMinimum===!0&&typeof t.minimum=="number"&&(r=r.gt(t.minimum)),typeof t.exclusiveMaximum=="number"?r=r.lt(t.exclusiveMaximum):t.exclusiveMaximum===!0&&typeof t.maximum=="number"&&(r=r.lt(t.maximum)),typeof t.multipleOf=="number"&&(r=r.multipleOf(t.multipleOf)),i=r;break}case"boolean":{i=M.boolean();break}case"null":{i=M.null();break}case"object":{let r={},o=t.properties||{},s=new Set(t.required||[]),c=typeof t.additionalProperties=="object"?cn(t.additionalProperties,e):void 0;for(let[u,l]of Object.entries(o)){let d=cn(l,e);He(r,u,s.has(u)?d:d.optional())}if(t.patternProperties){let u=t.patternProperties,l=Object.keys(u),d=[];for(let p of l){let m=cn(u[p],e),g=M.string().regex(new RegExp(p));d.push(M.looseRecord(g,m))}let f=[];if(Object.keys(r).length>0&&f.push(M.object(r).passthrough()),f.push(...d),f.length===0)i=M.object({}).passthrough();else if(f.length===1)i=f[0];else{let p=M.intersection(f[0],f[1]);for(let m=2;m<f.length;m++)p=M.intersection(p,f[m]);i=p}if(t.additionalProperties===!1){let p=Object.keys(r),m=l.map(y=>new RegExp(y)),g=i;i=i.check(y=>{if(!Mn(y.value))return;let v=[];for(let w of Object.keys(y.value))p.includes(w)||m.some(b=>b.test(w))||v.push(w);v.length&&y.issues.push({code:"unrecognized_keys",keys:v,input:y.value,inst:g})})}}else{let u=M.object(r);t.additionalProperties===!1?i=u.strict():c?i=u.catchall(c):i=u.passthrough()}if(t.propertyNames!==void 0&&t.propertyNames!==!0){let u=typeof t.propertyNames=="object"&&t.propertyNames.type===void 0?{type:"string",...t.propertyNames}:t.propertyNames;i=i3(i,cn(u,e))}break}case"array":{let r=t.prefixItems,o=t.items;if(r&&Array.isArray(r)){let s=typeof t.minItems=="number"?t.minItems:0,c=r.map(f=>cn(f,e)),u=wj(c,s),l=Array.isArray(o)?void 0:$j(o,e),d=M.tuple(u);i=l?d.rest(l):d,typeof t.minItems=="number"&&(i=i.check(M.minLength(t.minItems))),typeof t.maxItems=="number"&&(i=i.check(M.maxLength(t.maxItems)))}else if(Array.isArray(o)){let s=typeof t.minItems=="number"?t.minItems:0,c=o.map(f=>cn(f,e)),u=wj(c,s),l=$j(t.additionalItems,e),d=M.tuple(u);i=l?d.rest(l):d,typeof t.minItems=="number"&&(i=i.check(M.minLength(t.minItems))),typeof t.maxItems=="number"&&(i=i.check(M.maxLength(t.maxItems)))}else if(o!==void 0){let s=cn(o,e),c=M.array(s);typeof t.minItems=="number"&&(c=c.min(t.minItems)),typeof t.maxItems=="number"&&(c=c.max(t.maxItems)),i=c}else i=M.array(M.any());break}default:throw new Error(`Unsupported type: ${n}`)}return i}a(_j,"convertBaseSchema");function cn(t,e){if(typeof t=="boolean")return t?M.any():M.never();let n=_j(t,e),i=t.type||t.enum!==void 0||t.const!==void 0;if(t.anyOf&&Array.isArray(t.anyOf)){let c=t.anyOf.map(l=>cn(l,e)),u=M.union(c);n=i?M.intersection(n,u):u}if(t.oneOf&&Array.isArray(t.oneOf)){let c=t.oneOf.map(l=>cn(l,e)),u=M.xor(c);n=i?M.intersection(n,u):u}if(t.allOf&&Array.isArray(t.allOf))if(t.allOf.length===0)n=i?n:M.any();else{let c=i?n:cn(t.allOf[0],e),u=i?0:1;for(let l=u;l<t.allOf.length;l++)c=M.intersection(c,cn(t.allOf[l],e));n=c}t.nullable===!0&&e.version==="openapi-3.0"&&(n=M.nullable(n)),t.readOnly===!0&&(n=M.readonly(n)),t.default!==void 0&&(n=n.default(t.default));let r={},o=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let c of o)c in t&&(r[c]=t[c]);let s=["contentEncoding","contentMediaType","contentSchema"];for(let c of s)c in t&&(r[c]=t[c]);t.propertyNames!==void 0&&t.type==="object"&&t.$ref===void 0&&(r.propertyNames=t.propertyNames);for(let c of Object.keys(t))e3.has(c)||He(r,c,t[c]);return Object.keys(r).length>0&&e.registry.add(n,r),t.description&&(n=n.describe(t.description)),n}a(cn,"convertSchema");function kj(t,e){if(typeof t=="boolean")return t?M.any():M.never();let n;try{n=JSON.parse(JSON.stringify(t))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let i=t3(n,e?.defaultTarget),r=n.$defs||n.definitions||{},o={version:i,defs:r,refs:new Map,processing:new Set,rootSchema:n,registry:e?.registry??_t};return cn(n,o)}a(kj,"fromJSONSchema");var xj=Symbol("z.visit/resolving");function Ml(t,e){let n=typeof e=="function"?e:(s,c)=>{let u=e[s._zod.def.type];return u?u(s,c):s},i=new Map;function r(s){let c=i.get(s);if(c===xj)return new ya({type:"lazy",getter:a(()=>i.get(s),"getter")});if(c!==void 0)return c;i.set(s,xj);let u=o(s),l=n(u,u!==s);return i.set(s,l),l}a(r,"run");function o(s){let c=s._zod.def,u=c.type;switch(u){case"object":{let l=c.shape,d=Object.keys(l),f=!1,p={};for(let g of d){let y=r(l[g]);y!==l[g]&&(f=!0),p[g]=y}let m=c.catchall;return c.catchall&&(m=r(c.catchall),m!==c.catchall&&(f=!0)),f?_e(s,{...c,shape:p,catchall:m}):s}case"array":{let l=r(c.element);return l===c.element?s:_e(s,{...c,element:l})}case"tuple":{let l=c.items,d=!1,f=[];for(let m of l){let g=r(m);g!==m&&(d=!0),f.push(g)}let p=c.rest;return c.rest&&(p=r(c.rest),p!==c.rest&&(d=!0)),d?_e(s,{...c,items:f,rest:p}):s}case"record":case"map":{let l=r(c.keyType),d=r(c.valueType);return l===c.keyType&&d===c.valueType?s:_e(s,{...c,keyType:l,valueType:d})}case"set":{let l=r(c.valueType);return l===c.valueType?s:_e(s,{...c,valueType:l})}case"union":{let l=c.options,d=!1,f=[];for(let p of l){let m=r(p);m!==p&&(d=!0),f.push(m)}return d?_e(s,{...c,options:f}):s}case"intersection":{let l=r(c.left),d=r(c.right);return l===c.left&&d===c.right?s:_e(s,{...c,left:l,right:d})}case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":{let l=r(c.innerType);return l===c.innerType?s:_e(s,{...c,innerType:l})}case"pipe":{let l=r(c.in),d=r(c.out);return l===c.in&&d===c.out?s:_e(s,{...c,in:l,out:d})}case"function":{let l=r(c.input),d=r(c.output);return l===c.input&&d===c.output?s:_e(s,{...c,input:l,output:d})}case"lazy":{let l=c.getter,{_cachedInner:d,...f}=c;return _e(s,{...f,getter:a(()=>r(l()),"getter")})}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":return s;default:return s}}return a(o,"mapInner"),r(t)}a(Ml,"visit");function Sj(t){return Ml(t,{object:a(e=>e.partial(),"object"),union:a(e=>{let n=e._zod.def;return n.discriminator===void 0?e:Oe(n.options)},"union")})}a(Sj,"deepPartial");function s3(t,e){if(!e?.length)return t;let n=t._zod.def;return _e(t,ir(n,{checks:[...n.checks??[],...e]}),{parent:!0})}a(s3,"withChecks");function Ij(t){return s3(t.out,t.checks)}a(Ij,"outSide");function a3(t){return t.in._zod.traits.has("$ZodTransform")?Ij(t):t.in}a(a3,"inSide");function Ej(t){return Ml(t,{pipe:a(e=>a3(e._zod.def),"pipe"),default:a((e,n)=>n?Ce(e._zod.def.innerType):e,"default"),catch:a((e,n)=>n?e._zod.def.innerType:e,"catch")})}a(Ej,"input");function Tj(t){return Ml(t,{pipe:a(e=>Ij(e._zod.def),"pipe"),prefault:a((e,n)=>n?e._zod.def.innerType:e,"prefault")})}a(Tj,"output");var N0={};Tr(N0,{bigint:()=>d3,boolean:()=>l3,date:()=>f3,number:()=>u3,string:()=>c3});function c3(t){return zx(za,t)}a(c3,"string");function u3(t){return Lx(La,t)}a(u3,"number");function l3(t){return Mx(Ma,t)}a(l3,"boolean");function d3(t){return Ux(Ua,t)}a(d3,"bigint");function f3(t){return Fx(Nl,t)}a(f3,"date");var Aj=["repo","store","account","vault"];function Oj(t){return Aj.includes(t)}a(Oj,"isRootKind");var vy=h.object({kind:h.string(),root:h.string(),path:h.string().optional(),commit:h.string().optional(),separator:h.literal("://").optional()}),Ul=class extends Error{static{a(this,"LocatorError")}name="LocatorError"};function Bi(t){let e=t.indexOf(":");return e>0&&Oj(t.slice(0,e))}a(Bi,"isLocatorText");function Ki(t){let e=t.indexOf(":");if(e<=0)throw new Ul(`"${t}" is not a locator: it has no "<kind>:" prefix`);let n=t.slice(0,e),i=t.slice(e+1);if(i.length===0)throw new Ul(`"${t}" is not a locator: it names no root`);let r;if(n==="repo"){let l=i.lastIndexOf("@");l>0&&(r=i.slice(l+1),i=i.slice(0,l))}let o=i.indexOf("://");if(o>0&&!i.slice(0,o).includes("/"))return{kind:n,root:i.slice(0,o),path:i.slice(o+3),separator:"://",...r===void 0?{}:{commit:r}};let s=i.indexOf("/"),c=s===-1?i:i.slice(0,s),u=s===-1?void 0:i.slice(s+1);return{kind:n,root:c,...u===void 0?{}:{path:u},...r===void 0?{}:{commit:r}}}a(Ki,"parseLocator");function An(t){let e=t.path===void 0?"":`${t.separator==="://"?"://":"/"}${t.path}`,n=t.commit===void 0?"":`@${t.commit}`;return`${t.kind}:${t.root}${e}${n}`}a(An,"formatLocator");function C0(t){return t.split(/\s+/).filter(e=>e.length>0).map(Ki)}a(C0,"parseLocatorList");function p3(t){return t.split(/\s+/).filter(e=>e.length>0)}a(p3,"splitTokens");var On=h.string(),ie=h.union([h.array(h.string()),h.string().transform(p3)]),Xr=ie,Pr=h.union([h.boolean(),h.enum(["true","false"]).transform(t=>t==="true")]),P0=h.union([vy,h.string().transform(Ki)]),Nj=h.union([h.array(vy),h.string().transform(C0)]),R0=h.lazy(()=>h.object({name:h.string(),attributes:h.record(h.string(),h.string()),children:h.array(R0),text:h.string()})),j0=["sketch","decided","provisioned","verified"];var by=["never","test-mode","local","fake","sandbox"];var z0=["element","body","extraAttributes","unknownChildren"];function L(t){return{element:h.literal(t),body:h.string().optional(),extraAttributes:h.record(h.string(),h.string()).default({}),unknownChildren:h.array(R0).default([])}}a(L,"elementBase");var Cj={home:Nj.optional()},Pj={status:h.string().optional()},Rj={assumed:Pr.optional(),basis:h.string().optional(),confidence:h.string().optional(),revisit:h.string().optional(),deferred:h.string().optional(),until:h.string().optional()},jj={decidedBy:ie.optional(),neededBy:ie.optional(),fixesAt:h.string().optional(),verifiedBy:h.string().optional()},zj={note:h.string().optional()},Y={...Cj,...Pj,...Rj,...jj,...zj};function Hi(t){return h.object({...L(t),id:On,...Y})}a(Hi,"pointerSchema");function Nn(t){return t.replace(/-([a-z0-9])/g,(e,n)=>n.toUpperCase())}a(Nn,"toCamelCase");function Rr(t){return t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}a(Rr,"toKebabCase");var m3=new Set(z0);function z(t){let e=t.children??[],n=new Set(e.map(r=>r.field)),i=Object.keys(t.schema.shape).filter(r=>!m3.has(r)&&!n.has(r));return{tag:t.tag,schema:t.schema,attributes:i,children:e,keyAttribute:t.key??"id"}}a(z,"element");function q(t,e){return{tag:t.tag,field:e,binding:t,cardinality:"many"}}a(q,"many");function ot(t,e){return{tag:t.tag,field:e,binding:t,cardinality:"one"}}a(ot,"one");function Za(t,e,n){let i=n===void 0||n.length===0?e:`${e}[${n}]`;return t.length===0?i:`${t}/${i}`}a(Za,"elementPath");function Fl(t,e,n,i=""){let r=Za(i,e.tag,t.attributes[e.keyAttribute]),o=new Set(e.attributes),s={element:e.tag},c={};for(let[d,f]of Object.entries(t.attributes)){let p=Nn(d);if(o.has(p)){s[p]=f;continue}c[d]=f,n.diagnostics.push({code:Au.unknownAttribute,severity:"info",message:`<${e.tag}> has an attribute "${d}" this schema does not know; it is preserved.`,path:r})}let u=[],l=new Map(e.children.map(d=>[d.tag,d]));for(let d of e.children)d.cardinality==="many"&&(s[d.field]=[]);for(let d of t.children){let f=l.get(d.name);if(f===void 0){u.push(d),n.diagnostics.push({code:Au.unknownElement,severity:"info",message:`<${e.tag}> has a child <${d.name}> this schema does not know; it is preserved.`,path:r});continue}let p=Fl(d,f.binding,n,r);if(f.cardinality==="many"){s[f.field].push(p);continue}if(s[f.field]===void 0){s[f.field]=p;continue}u.push(d),n.diagnostics.push({code:Au.duplicateElement,severity:"info",message:`<${e.tag}> has more than one <${d.name}>, which the schema allows once; the extra one is preserved.`,path:r})}return t.text.length>0&&(s.body=t.text),s.extraAttributes=c,s.unknownChildren=u,s}a(Fl,"readElement");function h3(t){return"kind"in t&&"root"in t}a(h3,"isLocatorLike");function gt(t){return typeof t=="string"?t:typeof t=="boolean"?t?"true":"false":typeof t=="number"?String(t):Array.isArray(t)?t.map(e=>typeof e=="string"?e:gt(e)).join(" "):typeof t=="object"&&t!==null&&h3(t)?An(t):String(t)}a(gt,"formatAttributeValue");function Wi(t,e){let n={};for(let o of e.attributes){let s=t[o];s!=null&&(n[Rr(o)]=gt(s))}let i=t.extraAttributes??{};for(let o of Object.keys(i).sort())n[o]=i[o]??"";let r=[];for(let o of e.children){let s=t[o.field];if(s!=null){if(o.cardinality==="many"){for(let c of s)r.push(Wi(c,o.binding));continue}r.push(Wi(s,o.binding))}}return r.push(...t.unknownChildren??[]),{name:e.tag,attributes:n,children:r,text:typeof t.body=="string"?t.body:""}}a(Wi,"writeElement");var L0="never",g3=/^[a-z][a-z0-9-]*$/;function Dj(t,e=()=>!1){if(t===void 0)return[];let n=[];for(let i of t.split(/\s+/).filter(r=>r.length>0)){let r=i.indexOf(":"),o=r<=0?"":i.slice(0,r);if(r>0&&g3.test(o)&&e(o)){n.push({text:i,attribute:o,event:i.slice(r+1)});continue}n.push({text:i,attribute:null,event:i})}return n}a(Dj,"parseFixesAt");function D0(t,e){if(typeof t!="object"||t===null)return;let n=t,i=n.extraAttributes,r=n[Nn(e)]??(typeof i=="object"&&i!==null?i[e]:void 0);if(r==null)return;let o=gt(r);return o.length===0?void 0:o}a(D0,"attributeTextOf");function M0(t){return Dj(D0(t,"fixes-at"),e=>D0(t,e)!==void 0)}a(M0,"fixesAtOf");function ql(t){return M0(t).map(e=>e.event).filter(e=>e!==L0)}a(ql,"fixesAtEvents");var Zl=h.object({...L("decision"),id:h.string(),what:h.string(),why:h.string().optional(),pins:ie.optional(),consequence:h.string().optional(),advisor:h.string().optional(),resolves:ie.optional(),supersedes:ie.optional(),supersededBy:On.optional(),...Y}),Lj=z({tag:"decision",schema:Zl}),Vl=h.object({...L("decisions"),decisions:h.array(Zl).default([])}),U0=z({tag:"decisions",schema:Vl,children:[q(Lj,"decisions")]});var Bl=h.object({...L("doc"),kind:h.string().optional(),about:ie.optional(),tags:Xr.optional(),by:h.string().optional(),at:h.string().optional(),...Y}),Mj=z({tag:"doc",schema:Bl,key:"home"}),Kl=h.object({...L("docs"),docs:h.array(Bl).default([])}),F0=z({tag:"docs",schema:Kl,children:[q(Mj,"docs")]});var q0=["none","testers","real"],Z0=["none","synthetic","real"],Hl=h.object({...L("mode"),id:h.string(),where:h.string().optional(),region:h.string().optional(),url:h.string().optional(),ios:h.string().optional(),hosts:ie.optional(),users:h.string().optional(),data:h.string().optional(),storeAvailability:h.string().optional(),targetDate:h.string().optional(),...Y}),Uj=z({tag:"mode",schema:Hl}),Wl=h.object({...L("promotion"),from:On,to:On,gate:On.optional(),...Y}),Fj=z({tag:"promotion",schema:Wl,key:"to"}),Gl=h.object({...L("environments"),modes:h.array(Hl).default([]),promotions:h.array(Wl).default([])}),V0=z({tag:"environments",schema:Gl,children:[q(Uj,"modes"),q(Fj,"promotions")]});var B0=h.object({...L("expects"),capability:h.string(),...Y}),qj=z({tag:"expects",schema:B0,key:"capability"}),wy=h.object({...L("expectations"),expects:h.array(B0).default([])}),K0=z({tag:"expectations",schema:wy,children:[q(qj,"expects")]});var Jl=h.object({...L("finding"),id:h.string(),class:h.string().optional(),raisedBy:h.string().optional(),at:h.string().optional(),state:h.string().optional(),resolvesVia:ie.optional(),descriptorSide:h.string().optional(),codeSide:h.string().optional(),about:ie.optional(),asks:h.string().optional(),shape:h.string().optional(),hint:h.string().optional(),text:h.string().optional(),...Y}),Zj=z({tag:"finding",schema:Jl}),Yl=h.object({...L("findings"),findings:h.array(Jl).default([])}),H0=z({tag:"findings",schema:Yl,children:[q(Zj,"findings")]});var Xl=h.object({...L("domain"),name:h.string(),registrar:h.string().optional(),working:Pr.optional(),...Y}),Vj=z({tag:"domain",schema:Xl,key:"name"}),Ql=h.object({...L("handle"),platform:h.string(),name:h.string(),...Y}),Bj=z({tag:"handle",schema:Ql,key:"platform"}),ed=h.object({...L("entity"),kind:h.string().optional(),name:h.string().optional(),dba:h.string().optional(),jurisdiction:h.string().optional(),why:h.string().optional(),...Y}),Kj=z({tag:"entity",schema:ed,key:"name"}),td=h.object({...L("trademark"),mark:h.string(),class:h.string().optional(),...Y}),Hj=z({tag:"trademark",schema:td,key:"mark"}),nd=h.object({...L("identity"),domains:h.array(Xl).default([]),handles:h.array(Ql).default([]),entities:h.array(ed).default([]),trademarks:h.array(td).default([])}),W0=z({tag:"identity",schema:nd,children:[q(Vj,"domains"),q(Bj,"handles"),q(Kj,"entities"),q(Hj,"trademarks")]});var rd=h.object({...L("artifact"),id:h.string(),about:ie.optional(),requiredBy:ie.optional(),versions:h.string().optional(),...Y}),Wj=z({tag:"artifact",schema:rd}),id=h.object({...L("inventory"),artifacts:h.array(rd).default([])}),G0=z({tag:"inventory",schema:id,children:[q(Wj,"artifacts")]});var od=Hi("entity-ref"),Gj=z({tag:"entity-ref",schema:od}),sd=h.object({...L("document"),id:h.string(),executor:h.string().optional(),url:h.string().optional(),requiredBy:ie.optional(),...Y}),Jj=z({tag:"document",schema:sd}),ad=h.object({...L("obligation"),id:h.string(),executor:h.string().optional(),text:h.string().optional(),...Y}),Yj=z({tag:"obligation",schema:ad}),cd=h.object({...L("option"),do:h.string(),cost:h.string().optional(),...Y}),Xj=z({tag:"option",schema:cd,key:"do"}),ud=h.object({...L("risk"),id:h.string(),appliesIf:h.string().optional(),exposure:h.string().optional(),enforcer:h.string().optional(),likelihood:h.string().optional(),resolvedBy:ie.optional(),options:h.array(cd).default([]),...Y}),Qj=z({tag:"risk",schema:ud,children:[q(Xj,"options")]}),ld=h.object({...L("legal"),entityRefs:h.array(od).default([]),documents:h.array(sd).default([]),obligations:h.array(ad).default([]),risks:h.array(ud).default([])}),J0=z({tag:"legal",schema:ld,children:[q(Gj,"entityRefs"),q(Jj,"documents"),q(Yj,"obligations"),q(Qj,"risks")]});var dd=Hi("site-ref"),ez=z({tag:"site-ref",schema:dd}),fd=Hi("analytics-ref"),tz=z({tag:"analytics-ref",schema:fd}),pd=h.object({...L("posting"),cadence:h.string().optional(),platforms:Xr.optional(),...Y}),nz=z({tag:"posting",schema:pd,key:"cadence"}),md=h.object({...L("launch-list"),provider:h.string().optional(),requires:ie.optional(),...Y}),rz=z({tag:"launch-list",schema:md,key:"provider"}),hd=h.object({...L("marketing"),siteRefs:h.array(dd).default([]),postings:h.array(pd).default([]),launchLists:h.array(md).default([]),analyticsRefs:h.array(fd).default([])}),Y0=z({tag:"marketing",schema:hd,children:[q(ez,"siteRefs"),q(nz,"postings"),q(rz,"launchLists"),q(tz,"analyticsRefs")]});var gd=h.object({...L("channel"),surface:h.string(),via:h.string().optional(),service:h.string().optional(),price:h.string().optional(),...Y}),iz=z({tag:"channel",schema:gd,key:"surface"}),yd=h.object({...L("includes"),...Y}),oz=z({tag:"includes",schema:yd}),vd=h.object({...L("pricing"),tier:h.string().optional(),channels:h.array(gd).default([]),includes:yd.optional(),...Y}),sz=z({tag:"pricing",schema:vd,children:[q(iz,"channels"),ot(oz,"includes")],key:"tier"}),bd=h.object({...L("go-to-market"),...Y}),az=z({tag:"go-to-market",schema:bd}),wd=h.object({...L("offering"),audience:h.string().optional(),model:h.string().optional(),pricing:h.array(vd).default([]),goToMarket:bd.optional()}),X0=z({tag:"offering",schema:wd,children:[q(sz,"pricing"),ot(az,"goToMarket")]});var Cn=h.object({...L("caveat"),id:h.string(),text:h.string(),cites:h.string().optional(),since:h.string().optional(),by:h.string().optional()}),Fn=z({tag:"caveat",schema:Cn});var $d=h.object({...L("item"),id:h.string(),do:h.string(),executor:h.string().optional(),cost:h.string().optional(),lead:h.string().optional(),effort:h.string().optional(),scarce:Pr.optional(),reversible:Pr.optional(),state:h.string().optional(),requires:ie.optional(),sets:ie.optional(),produced:ie.optional(),resolves:ie.optional(),derivedFrom:h.string().optional(),orderAfter:ie.optional(),orderBefore:ie.optional(),claimedBy:h.string().optional(),claimedAt:h.string().optional(),verifiedAt:h.string().optional(),verifiedIn:h.string().optional(),evidence:h.string().optional(),evidenceUrl:h.string().optional(),startedAt:h.string().optional(),waitingSince:h.string().optional(),expectedBy:h.string().optional(),blockedBecause:h.string().optional(),caveats:h.array(Cn).default([]),...Y}),Q0=z({tag:"item",schema:$d,children:[q(Fn,"caveats")]}),_d=h.object({...L("milestone"),id:h.string(),requires:ie.optional(),verify:Xr.optional(),verifiedIn:h.string().optional(),...Y}),eI=z({tag:"milestone",schema:_d}),kd=h.object({...L("plan"),items:h.array($d).default([]),milestones:h.array(_d).default([])}),tI=z({tag:"plan",schema:kd,children:[q(Q0,"items"),q(eI,"milestones")]});var Qr=h.object({...L("realization"),mode:h.string(),via:h.string().optional(),ref:h.string().optional(),region:h.string().optional(),replicas:h.string().optional(),ha:Pr.optional(),cdn:h.string().optional(),requires:ie.optional(),bound:Pr.optional(),verifiedIn:h.string().optional(),providerId:h.string().optional(),endpoint:h.string().optional(),url:h.string().optional(),hostname:h.string().optional(),env:h.string().optional(),sentryProject:h.string().optional(),posthogProject:h.string().optional(),resendDomain:h.string().optional(),...Y}),Va=z({tag:"realization",schema:Qr,key:"mode"});var xd=h.object({...L("root"),id:h.string(),kind:h.string(),provider:h.string().optional(),remote:h.string().optional(),share:h.string().optional(),via:h.string().optional(),vault:h.string().optional(),adapter:h.string().optional(),caveats:h.array(Cn).default([]),...Y}),cz=z({tag:"root",schema:xd,children:[q(Fn,"caveats")]}),Sd=h.object({...L("roots"),roots:h.array(xd).default([])}),nI=z({tag:"roots",schema:Sd,children:[q(cz,"roots")]});var Id=h.object({...L("requirement"),from:h.string().optional(),text:h.string().optional(),state:h.string().optional(),...Y}),uz=z({tag:"requirement",schema:Id,key:"from"}),os=h.object({...L("secret"),name:h.string(),mode:h.string().optional(),fp:h.string().optional(),...Y}),$y=z({tag:"secret",schema:os,key:"name"}),Ed=h.object({...L("service"),id:h.string(),provider:h.string(),mock:h.string().optional(),purpose:h.string().optional(),fulfils:ie.optional(),roles:Xr.optional(),sendingDomain:h.string().optional(),webhookPath:h.string().optional(),requires:ie.optional(),realizations:h.array(Qr).default([]),requirements:h.array(Id).default([]),secrets:h.array(os).default([]),caveats:h.array(Cn).default([]),...Y}),lz=z({tag:"service",schema:Ed,children:[q(Fn,"caveats"),q(Va,"realizations"),q(uz,"requirements"),q($y,"secrets")]}),Td=h.object({...L("services"),services:h.array(Ed).default([])}),rI=z({tag:"services",schema:Td,children:[q(lz,"services")]});var Ad=h.object({...L("listing"),store:h.string().optional(),requires:ie.optional(),...Y}),dz=z({tag:"listing",schema:Ad,key:"store"}),Od=h.object({...L("surface"),id:h.string(),kind:h.string(),stack:h.string().optional(),path:h.string().optional(),bundle:h.string().optional(),package:h.string().optional(),host:h.string().optional(),url:h.string().optional(),purpose:h.string().optional(),consumes:ie.optional(),fulfils:ie.optional(),listings:h.array(Ad).default([]),caveats:h.array(Cn).default([]),...Y}),fz=z({tag:"surface",schema:Od,children:[q(Fn,"caveats"),q(dz,"listings")]}),Nd=h.object({...L("surfaces"),surfaces:h.array(Od).default([])}),iI=z({tag:"surfaces",schema:Nd,children:[q(fz,"surfaces")]});var Cd=h.object({...L("client"),surface:On,generator:h.string().optional(),audited:h.string().optional(),...Y}),pz=z({tag:"client",schema:Cd,key:"surface"}),Pd=h.object({...L("contract"),kind:h.string().optional(),authoritative:h.string().optional(),audited:h.string().optional(),summary:h.string().optional(),clients:h.array(Cd).default([]),...Y}),mz=z({tag:"contract",schema:Pd,children:[q(pz,"clients")],key:"kind"}),Rd=h.object({...L("schema"),authoritative:h.string().optional(),audited:h.string().optional(),summary:h.string().optional(),...Y}),hz=z({tag:"schema",schema:Rd,key:"authoritative"}),jd=h.object({...L("consumer"),system:On.optional(),surface:On.optional(),via:h.string().optional(),path:h.string().optional(),...Y}),gz=z({tag:"consumer",schema:jd,key:"system"}),zd=h.object({...L("system"),id:h.string(),kind:h.string().optional(),stack:h.string().optional(),path:h.string().optional(),purpose:h.string().optional(),consumes:ie.optional(),fulfils:ie.optional(),contracts:h.array(Pd).default([]),realizations:h.array(Qr).default([]),caveats:h.array(Cn).default([]),...Y}),yz=z({tag:"system",schema:zd,children:[q(Fn,"caveats"),q(mz,"contracts"),q(Va,"realizations")]}),Dd=h.object({...L("resource"),id:h.string(),kind:h.string(),extensions:h.string().optional(),owner:On.optional(),purpose:h.string().optional(),stack:h.string().optional(),fulfils:ie.optional(),realizations:h.array(Qr).default([]),schemas:h.array(Rd).default([]),consumers:h.array(jd).default([]),secrets:h.array(os).default([]),caveats:h.array(Cn).default([]),...Y}),vz=z({tag:"resource",schema:Dd,children:[q(Fn,"caveats"),q(Va,"realizations"),q(hz,"schemas"),q(gz,"consumers"),q($y,"secrets")]}),Ld=Hi("decision-ref"),bz=z({tag:"decision-ref",schema:Ld}),Md=h.object({...L("systems"),systems:h.array(zd).default([]),resources:h.array(Dd).default([]),decisionRefs:h.array(Ld).default([])}),oI=z({tag:"systems",schema:Md,children:[q(yz,"systems"),q(vz,"resources"),q(bz,"decisionRefs")]});var wz=["roots","identity","offering","surfaces","systems","services","expectations","environments","legal","marketing","plan","inventory","docs","decisions","findings"];function Ud(t){return wz.includes(t)}a(Ud,"isFacetName");var Fd=h.object({...L("business"),name:h.string(),stage:h.string().optional(),namespace:h.string().optional(),hub:P0.optional(),roots:Sd.optional(),identity:nd.optional(),offering:wd.optional(),surfaces:Nd.optional(),systems:Md.optional(),services:Td.optional(),expectations:wy.optional(),environments:Gl.optional(),legal:ld.optional(),marketing:hd.optional(),plan:kd.optional(),inventory:id.optional(),docs:Kl.optional(),decisions:Vl.optional(),findings:Yl.optional()}),cr=z({tag:"business",schema:Fd,children:[ot(nI,"roots"),ot(W0,"identity"),ot(X0,"offering"),ot(iI,"surfaces"),ot(oI,"systems"),ot(rI,"services"),ot(K0,"expectations"),ot(V0,"environments"),ot(J0,"legal"),ot(Y0,"marketing"),ot(tI,"plan"),ot(G0,"inventory"),ot(F0,"docs"),ot(U0,"decisions"),ot(H0,"findings")]}),y3=h.discriminatedUnion("element",[Fd,Sd,xd,nd,Xl,Ql,ed,td,wd,vd,gd,yd,bd,Nd,Od,Ad,Md,zd,Pd,Cd,Dd,Rd,jd,Ld,Qr,Td,Ed,Id,os,Gl,Hl,Wl,ld,od,sd,ad,ud,cd,hd,dd,pd,md,fd,kd,$d,_d,id,rd,Kl,Bl,Vl,Zl,Yl,Jl]);var v3=new Set(["milestone","finding","decision","item","mode","root","doc"]),b3=/^[A-Za-z][A-Za-z0-9-]*$/,w3=/^([A-Za-z][A-Za-z0-9-]*)\[(.+)\]$/;function Gi(t){let e=t.trim();if(Bi(e))return{text:e,target:{form:"locator",locator:Ki(e)}};let n=e,i,r=n.lastIndexOf("@");r>0&&b3.test(n.slice(r+1))&&(i=n.slice(r+1),n=n.slice(0,r));let o=i===void 0?{}:{member:i},s=n.indexOf(":"),c=n.indexOf("/");if(s>0&&(c===-1||s<c)){let u=n.slice(0,s);return v3.has(u)?{text:e,target:{form:"kinded",kind:u,id:n.slice(s+1)},...o}:{text:e,target:{form:"bare",id:n},...o}}if(c>0){let u=n.slice(0,c),l=n.slice(c+1),d=w3.exec(l);return d!==null?{text:e,target:{form:"faceted",facet:u,segment:l,wildcard:!1,tag:d[1]??"",key:d[2]??""},...o}:{text:e,target:{form:"faceted",facet:u,segment:l,wildcard:l==="*"},...o}}return{text:e,target:{form:"bare",id:n},...o}}a(Gi,"parseRef");function $z(t,e){let n=t[e];if(n==null)return null;let i=gt(n);return i.length===0?null:i}a($z,"attributeText");function _z(t,e,n,i,r,o){let s=$z(t,e.keyAttribute),c=Za(n,e.tag,s??void 0);o.push({path:c,parentPath:n,facet:i,tag:e.tag,id:$z(t,"id"),key:s,node:t,binding:e,depth:r});for(let u of e.children){let l=t[u.field];if(l==null)continue;let d=u.cardinality==="many"?l:[l];for(let f of d){let p=r===0&&Ud(u.binding.tag)?u.binding.tag:i;_z(f,u.binding,c,p,r+1,o)}}}a(_z,"walk");function jr(t){let e=[];return _z(t,cr,"",null,0,e),e}a(jr,"indexVenture");function $3(t,e){return t.children.find(n=>n.tag===e)}a($3,"findChildBinding");function _3(t,e,n){let i={ref:e,path:t.path,facet:t.facet,tag:t.tag,id:t.id,node:t.node};if(n===void 0)return{...i,member:null,memberKind:null,memberValue:void 0};let r=Nn(n),o=t.node;if(t.binding.attributes.includes(r))return{...i,member:n,memberKind:"attribute",memberValue:o[r]};let s=$3(t.binding,n);return s!==void 0?{...i,member:n,memberKind:"child",memberValue:o[s.field]}:{...i,member:n,memberKind:null,memberValue:void 0}}a(_3,"withMember");function k3(t,e){return t.filter(n=>n.parentPath===e.path)}a(k3,"childrenOf");function x3(t,e){return t.find(n=>n.depth===1&&n.tag===e)}a(x3,"facetContainer");function S3(t,e){let n=x3(t,e.facet);if(n===void 0)return[];let i=k3(t,n);if(e.wildcard)return i;if(e.tag!==void 0)return i.filter(c=>c.tag===e.tag&&(c.id===e.key||c.key===e.key));let r=i.filter(c=>c.id===e.segment||c.key===e.segment);if(r.length>0)return r;let o=i.filter(c=>c.tag===e.segment);if(o.length>0)return o;let s=e.segment.indexOf(".");if(s>0){let c=e.segment.slice(0,s),u=e.segment.slice(s+1);return i.filter(l=>l.tag===c&&(l.id===u||l.key===u))}return[]}a(S3,"matchFaceted");function I3(t,e){let n=t.filter(o=>o.id===e).sort((o,s)=>+(o.facet==="roots")-+(s.facet==="roots"));if(n.length>0)return n;let i=t.find(o=>o.depth===1&&o.tag===e);if(i!==void 0)return[i];let r=t[0];return r!==void 0&&r.binding.attributes.includes(Nn(e))?[r]:[]}a(I3,"matchBare");function E3(t,e){let n=t.filter(r=>r.facet==="roots"&&r.tag==="root"),i=n.filter(r=>r.id===e.root);return i.length>0?i:n.filter(r=>r.node.provider===e.root)}a(E3,"matchLocator");function qn(t,e,n){let i=n??jr(t),r=Gi(e),o=r.target,s;switch(o.form){case"locator":s=E3(i,o.locator);break;case"kinded":s=i.filter(u=>u.tag===o.kind&&(u.id===o.id||u.key===o.id));break;case"faceted":s=S3(i,o);break;case"bare":s=I3(i,o.id);break}let c=r.member??(o.form==="bare"&&s[0]?.depth===0?o.id:void 0);return s.map(u=>_3(u,r.text,c))}a(qn,"resolveRefAll");function sI(t,e,n){let i=[],r=qn(t,n,e),o=Gi(n).target.form==="bare"?r.slice(0,1):r;for(let s of o){if(s.member===null){i.push({path:s.path});continue}if(s.memberKind==="child"){let c=e.filter(u=>u.parentPath===s.path&&u.tag===s.member);if(c.length>0){i.push(...c.map(u=>({path:u.path})));continue}}i.push({path:s.path,attribute:s.member})}return i}a(sI,"landings");function Ba(t,e){return sI(t.venture,t.index,e)}a(Ba,"landingsOf");function qd(t,e){let n=new Map;for(let i of e){if(n.set(i.path,i.path),i.depth===0){n.set(i.path,"business");continue}if(i.depth>2||i.facet===null)continue;let r=i.depth===1?[i.tag]:[...i.id===null?[]:[`${i.facet}/${i.id}`],`${i.facet}/${i.tag}`,...i.key===null?[]:[`${i.facet}/${i.tag}[${i.key}]`]];for(let o of r){let s=qn(t,o,e);if(s.length===1&&s[0]?.path===i.path){n.set(i.path,o);break}}}return n}a(qd,"canonicalRefs");function un(t,e,n){let i=t.refs.get(e)??e;return n===void 0?i:i==="business"?n:`${i}@${n}`}a(un,"refOf");function De(t,e){let i=t.node[Nn(e)];if(i==null)return;let r=gt(i);return r.length===0?void 0:r}a(De,"attributeText");function aI(t,e){return e===void 0||t.toAttribute===e?!0:t.toAttribute===void 0&&(t.kind==="sets"||t.kind==="produced")}a(aI,"touchesAttribute");var xz=["consumes","consumer","client","owner","hosts","channel","requires","needed-by","required-by","home"];function C3(t){return t.include==="all"?null:new Set(xz)}a(C3,"kindsFor");function Sz(t,e,n,i){let r=C3(i),o=new Set(e.map(u=>u.path)),s=[],c=[...e];for(;c.length>0;){let u=[];for(let l of c)for(let d of t[n].get(l.path)??[]){if(r!==null&&!r.has(d.kind)||n==="incoming"&&!aI(d,l.attribute))continue;let f=n==="incoming"?d.from:d.to;if(o.has(f))continue;o.add(f);let p=n==="outgoing"?d.toAttribute:void 0;s.push({ref:un(t,f,p),node:f,kind:d.kind,attribute:d.attribute,...d.via===void 0?{}:{via:d.via},...d.path===void 0?{}:{path:d.path},at:d.at,distance:l.distance+1}),u.push({path:f,distance:l.distance+1})}if(i.transitive!==!0)break;c=u}return s}a(Sz,"walk");function Iz(t,e){return Ba(t,e).map(n=>({path:n.path,...n.attribute===void 0?{}:{attribute:n.attribute},distance:0}))}a(Iz,"seedsOf");function cI(t,e,n={}){let i=We(t);return Sz(i,Iz(i,e),"incoming",n)}a(cI,"consumersOf");function Ez(t,e,n={}){let i=We(t);return Sz(i,Iz(i,e),"outgoing",n)}a(Ez,"dependenciesOf");function qe(t,e,n,i="*"){return{attribute:t,kind:e,direction:"written",list:n,tags:i}}a(qe,"on");function Zd(t,e,n,i,r){return{attribute:t,kind:e,direction:"inverse",list:n,tags:i,...r?{owner:r}:{}}}a(Zd,"fromFarEnd");var P3=[qe("consumes","consumes",!0),Zd("system","consumer",!1,["consumer"],"parent"),Zd("surface","consumer",!1,["consumer"],"parent"),Zd("surface","client",!1,["client"],"parent"),qe("surface","channel",!1,["channel"]),qe("service","channel",!1,["channel"]),qe("owner","owner",!1,["resource"]),qe("hosts","hosts",!0,["mode"]),qe("requires","requires",!0),Zd("needed-by","needed-by",!0,"*"),Zd("required-by","required-by",!0,"*"),qe("sets","sets",!0,["item"]),qe("produced","produced",!0,["item"]),qe("resolves","resolves",!0,["item","decision"]),qe("resolves-via","resolves-via",!0,["finding"]),qe("resolved-by","resolved-by",!0,["risk"]),qe("decided-by","decided-by",!0),qe("pins","pins",!0,["decision"]),qe("about","about",!0,["doc","artifact"]),qe("id","pointer",!1,["entity-ref","site-ref","analytics-ref","decision-ref"]),qe("fixes-at","fixes-at",!0),qe("gate","gate",!1,["promotion"]),qe("from","promotes",!1,["promotion"]),qe("to","promotes",!1,["promotion"]),qe("mode","mode",!1,["realization","secret"]),qe("home","home",!0),qe("hub","home",!1,["business"]),qe("ref","home",!1,["realization"]),qe("authoritative","home",!1,["contract","schema"]),qe("path","home",!1,["consumer"])],R3=new Set(["never"]);function j3(t,e){if(e.attribute==="fixes-at")return ql(t.node);let i=t.node[Nn(e.attribute)];if(i==null)return[];let r=Array.isArray(i)?i.map(gt):[gt(i)];return(e.list?r.flatMap(s=>s.split(/\s+/)):r).filter(s=>s.length>0&&!R3.has(s))}a(j3,"references");function z3(t){let e=t.node,n=e.via??e.generator;return typeof n=="string"&&n.length>0?n:void 0}a(z3,"mechanismOf");function D3(t){let e=t.node;if(t.tag==="consumer"&&typeof e.path=="string")return e.path;let n=e.home;return Array.isArray(n)?n.length>0?gt(n[0]):void 0:n==null?void 0:gt(n)}a(D3,"locationOf");function L3(t,e){let n=new Map(e.map(o=>[o.path,o.parentPath])),i=[],r=[];for(let o of e){let s=z3(o),c=D3(o);for(let u of P3)if(!(u.tags!=="*"&&!u.tags.includes(o.tag)))for(let l of j3(o,u)){let d=sI(t,e,l);if(d.length===0){r.push({kind:u.kind,attribute:u.attribute,ref:l,at:o.path});continue}let f=u.direction==="written",p=u.owner==="parent"?n.get(o.path)??o.path:o.path;for(let m of d)i.push({kind:u.kind,from:f?o.path:m.path,to:f?m.path:p,...f&&m.attribute!==void 0?{toAttribute:m.attribute}:{},attribute:u.attribute,ref:l,at:o.path,...s===void 0?{}:{via:s},...c===void 0?{}:{path:c}})}}return{edges:i,unresolved:r}}a(L3,"edgesOf");function _y(t){let e=jr(t),n=new Map(e.map(u=>[u.path,u])),i=qd(t,e),{edges:r,unresolved:o}=L3(t,e),s=new Map,c=new Map;for(let u of r){let l=s.get(u.from);l===void 0?s.set(u.from,[u]):l.push(u);let d=c.get(u.to);d===void 0?c.set(u.to,[u]):d.push(u)}return{venture:t,index:e,nodes:n,refs:i,edges:r,outgoing:s,incoming:c,unresolved:o}}a(_y,"buildGraph");function M3(t){return"edges"in t&&"incoming"in t}a(M3,"isVentureGraph");function We(t){return M3(t)?t:_y(t)}a(We,"toGraph");var Tz=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",U3=Tz+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",F3="["+Tz+"]["+U3+"]*",q3=new RegExp("^"+F3+"$");function Az(t,e){let n=[],i=e.exec(t);for(;i;){let r=[];r.startIndex=e.lastIndex-i[0].length;let o=i.length;for(let s=0;s<o;s++)r.push(i[s]);n.push(r),i=e.exec(t)}return n}a(Az,"getAllMatches");var uI=a(function(t){let e=q3.exec(t);return!(e===null||typeof e>"u")},"isName");function Oz(t){return typeof t<"u"}a(Oz,"isExist");var Vd=["hasOwnProperty","toString","valueOf","__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__"],ky=["__proto__","constructor","prototype"];var Z3={allowBooleanAttributes:!1,unpairedTags:[]};function xy(t,e){e=Object.assign({},Z3,e);let n=[],i=!1,r=!1;t[0]==="\uFEFF"&&(t=t.substr(1));for(let o=0;o<t.length;o++)if(t[o]==="<"&&t[o+1]==="?"){if(o+=2,o=Nz(t,o),o.err)return o}else if(t[o]==="<"){let s=o;if(o++,t[o]==="!"){o=Cz(t,o);continue}else{let c=!1;t[o]==="/"&&(c=!0,o++);let u="";for(;o<t.length&&t[o]!==">"&&t[o]!==" "&&t[o]!==" "&&t[o]!==`
|
|
210
|
+
`&&t[o]!=="\r";o++)u+=t[o];if(u=u.trim(),u[u.length-1]==="/"&&(u=u.substring(0,u.length-1),o--),!Y3(u)){let f;return u.trim().length===0?f="Invalid space after '<'.":f="Tag '"+u+"' is an invalid name.",tt("InvalidTag",f,Kt(t,o))}let l=K3(t,o);if(l===!1)return tt("InvalidAttr","Attributes for '"+u+"' have open quote.",Kt(t,o));let d=l.value;if(o=l.index,d[d.length-1]==="/"){let f=o-d.length;d=d.substring(0,d.length-1);let p=Pz(d,e);if(p===!0)i=!0;else return tt(p.err.code,p.err.msg,Kt(t,f+p.err.line))}else if(c)if(l.tagClosed){if(d.trim().length>0)return tt("InvalidTag","Closing tag '"+u+"' can't have attributes or invalid starting.",Kt(t,s));if(n.length===0)return tt("InvalidTag","Closing tag '"+u+"' has not been opened.",Kt(t,s));{let f=n.pop();if(u!==f.tagName){let p=Kt(t,f.tagStartPos);return tt("InvalidTag","Expected closing tag '"+f.tagName+"' (opened in line "+p.line+", col "+p.col+") instead of closing tag '"+u+"'.",Kt(t,s))}n.length==0&&(r=!0)}}else return tt("InvalidTag","Closing tag '"+u+"' doesn't have proper closing.",Kt(t,o));else{let f=Pz(d,e);if(f!==!0)return tt(f.err.code,f.err.msg,Kt(t,o-d.length+f.err.line));if(r===!0)return tt("InvalidXml","Multiple possible root nodes found.",Kt(t,o));e.unpairedTags.indexOf(u)!==-1||n.push({tagName:u,tagStartPos:s}),i=!0}for(o++;o<t.length;o++)if(t[o]==="<")if(t[o+1]==="!"){o++,o=Cz(t,o);continue}else if(t[o+1]==="?"){if(o=Nz(t,++o),o.err)return o}else break;else if(t[o]==="&"){let f=G3(t,o);if(f==-1)return tt("InvalidChar","char '&' is not expected.",Kt(t,o));o=f}else if(r===!0&&!Ka(t[o]))return tt("InvalidXml","Extra text at the end",Kt(t,o));t[o]==="<"&&o--}}else{if(Ka(t[o]))continue;return tt("InvalidChar","char '"+t[o]+"' is not expected.",Kt(t,o))}if(i){if(n.length==1)return tt("InvalidTag","Unclosed tag '"+n[0].tagName+"'.",Kt(t,n[0].tagStartPos));if(n.length>0)return tt("InvalidXml","Invalid '"+JSON.stringify(n.map(o=>o.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return tt("InvalidXml","Start tag expected.",1);return!0}a(xy,"validate");function Ka(t){return t===" "||t===" "||t===`
|
|
211
|
+
`||t==="\r"}a(Ka,"isWhiteSpace");function Nz(t,e){let n=e;for(;e<t.length;e++)if(t[e]=="?"||t[e]==" "){let i=t.substr(n,e-n);if(e>5&&i==="xml")return tt("InvalidXml","XML declaration allowed only at the start of the document.",Kt(t,e));if(t[e]=="?"&&t[e+1]==">"){e++;break}else continue}return e}a(Nz,"readPI");function Cz(t,e){if(t.length>e+5&&t[e+1]==="-"&&t[e+2]==="-"){for(e+=3;e<t.length;e++)if(t[e]==="-"&&t[e+1]==="-"&&t[e+2]===">"){e+=2;break}}else if(t.length>e+8&&t[e+1]==="D"&&t[e+2]==="O"&&t[e+3]==="C"&&t[e+4]==="T"&&t[e+5]==="Y"&&t[e+6]==="P"&&t[e+7]==="E"){let n=1;for(e+=8;e<t.length;e++)if(t[e]==="<")n++;else if(t[e]===">"&&(n--,n===0))break}else if(t.length>e+9&&t[e+1]==="["&&t[e+2]==="C"&&t[e+3]==="D"&&t[e+4]==="A"&&t[e+5]==="T"&&t[e+6]==="A"&&t[e+7]==="["){for(e+=8;e<t.length;e++)if(t[e]==="]"&&t[e+1]==="]"&&t[e+2]===">"){e+=2;break}}return e}a(Cz,"readCommentAndCDATA");var V3='"',B3="'";function K3(t,e){let n="",i="",r=!1;for(;e<t.length;e++){if(t[e]===V3||t[e]===B3)i===""?i=t[e]:i!==t[e]||(i="");else if(t[e]===">"&&i===""){r=!0;break}n+=t[e]}return i!==""?!1:{value:n,index:e,tagClosed:r}}a(K3,"readAttributeStr");function H3(t){let e=[],n=t.length,i=0;for(;i<n;){let r=i;for(;i<n&&Ka(t[i]);)i++;if(i>=n)break;if(t[i]==="="){i=r+1;continue}let o=t.slice(r,i),s=i;for(;i<n&&!Ka(t[i])&&t[i]!=="=";)i++;let c=t.slice(s,i),u,l=i;for(;l<n&&Ka(t[l]);)l++;l<n&&t[l]==="="&&(u=t.slice(i,l+1),i=l+1);let d,f,p=i;for(;p<n&&Ka(t[p]);)p++;if(p<n&&(t[p]==='"'||t[p]==="'")){let g=p+1,y=t.indexOf(t[p],g);y!==-1&&(d=t[p],f=t.slice(g,y),i=y+1)}let m={startIndex:r};m[1]=o,m[2]=c,m[3]=u,m[4]=d!==void 0?!0:void 0,m[5]=d,m[6]=f,e.push(m)}return e}a(H3,"scanAttributeTokens");function Pz(t,e){let n=H3(t),i={};for(let r=0;r<n.length;r++){if(n[r][1].length===0)return tt("InvalidAttr","Attribute '"+n[r][2]+"' has no space in starting.",Bd(n[r]));if(n[r][3]!==void 0&&n[r][4]===void 0)return tt("InvalidAttr","Attribute '"+n[r][2]+"' is without value.",Bd(n[r]));if(n[r][3]===void 0&&!e.allowBooleanAttributes)return tt("InvalidAttr","boolean attribute '"+n[r][2]+"' is not allowed.",Bd(n[r]));let o=n[r][2];if(!J3(o))return tt("InvalidAttr","Attribute '"+o+"' is an invalid name.",Bd(n[r]));if(!Object.prototype.hasOwnProperty.call(i,o))i[o]=1;else return tt("InvalidAttr","Attribute '"+o+"' is repeated.",Bd(n[r]))}return!0}a(Pz,"validateAttributeString");function W3(t,e){let n=/\d/;for(t[e]==="x"&&(e++,n=/[\da-fA-F]/);e<t.length;e++){if(t[e]===";")return e;if(!t[e].match(n))break}return-1}a(W3,"validateNumberAmpersand");function G3(t,e){if(e++,t[e]===";")return-1;if(t[e]==="#")return e++,W3(t,e);let n=0;for(;e<t.length;e++,n++)if(!(t[e].match(/\w/)&&n<20)){if(t[e]===";")break;return-1}return e}a(G3,"validateAmpersand");function tt(t,e,n){return{err:{code:t,msg:e,line:n.line||n,col:n.col}}}a(tt,"getErrorObject");function J3(t){return uI(t)}a(J3,"validateAttrName");function Y3(t){return uI(t)}a(Y3,"validateTagName");function Kt(t,e){let n=t.substring(0,e).split(/\r?\n/);return{line:n.length,col:n[n.length-1].length+1}}a(Kt,"getLineNumberForPosition");function Bd(t){return t.startIndex+t[1].length}a(Bd,"getPositionFromMatch");var lI={cent:"\xA2",pound:"\xA3",curren:"\xA4",yen:"\xA5",euro:"\u20AC",dollar:"$",fnof:"\u0192",inr:"\u20B9",af:"\u060B",birr:"\u1265\u122D",peso:"\u20B1",rub:"\u20BD",won:"\u20A9",yuan:"\xA5",cedil:"\xB8"};var Kd={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'},dI={nbsp:"\xA0",copy:"\xA9",reg:"\xAE",trade:"\u2122",mdash:"\u2014",ndash:"\u2013",hellip:"\u2026",laquo:"\xAB",raquo:"\xBB",lsquo:"\u2018",rsquo:"\u2019",ldquo:"\u201C",rdquo:"\u201D",bull:"\u2022",para:"\xB6",sect:"\xA7",deg:"\xB0",frac12:"\xBD",frac14:"\xBC",frac34:"\xBE"};var Ha=Object.freeze({ALLOW:"allow",BLOCK:"block",THROW:"throw"}),X3=new Set("!?\\\\/[]$%{}^&*()<>|+");function Rz(t){if(t[0]==="#")throw new Error(`[EntityReplacer] Invalid character '#' in entity name: "${t}"`);for(let e of t)if(X3.has(e))throw new Error(`[EntityReplacer] Invalid character '${e}' in entity name: "${t}"`);return t}a(Rz,"validateEntityName");function Hd(...t){let e=Object.create(null);for(let n of t)if(n)for(let i of Object.keys(n)){let r=n[i];if(typeof r=="string")e[i]=r;else if(r&&typeof r=="object"&&r.val!==void 0){let o=r.val;typeof o=="string"&&(e[i]=o)}}return e}a(Hd,"mergeEntityMaps");var ss="external",Sy="base",fI="all";function Q3(t){return!t||t===ss?new Set([ss]):t===fI?new Set([fI]):t===Sy?new Set([Sy]):Array.isArray(t)?new Set(t):new Set([ss])}a(Q3,"parseLimitTiers");var ln=Object.freeze({allow:0,leave:1,remove:2,throw:3}),e5=new Set([9,10,13]);function t5(t){if(!t)return{xmlVersion:1,onLevel:ln.allow,nullLevel:ln.remove};let e=t.xmlVersion===1.1?1.1:1,n=ln[t.onNCR]??ln.allow,i=ln[t.nullNCR]??ln.remove,r=Math.max(i,ln.remove);return{xmlVersion:e,onLevel:n,nullLevel:r}}a(t5,"parseNCRConfig");var Wa=class{static{a(this,"EntityDecoder")}constructor(e={}){this._limit=e.limit||{},this._maxTotalExpansions=this._limit.maxTotalExpansions||0,this._maxExpandedLength=this._limit.maxExpandedLength||0,this._postCheck=typeof e.postCheck=="function"?e.postCheck:i=>i,this._limitTiers=Q3(this._limit.applyLimitsTo??ss),this._numericAllowed=e.numericAllowed??!0,this._baseMap=Hd(Kd,e.namedEntities||null),this._externalMap=Object.create(null),this._inputMap=Object.create(null),this._totalExpansions=0,this._expandedLength=0,this._removeSet=new Set(e.remove&&Array.isArray(e.remove)?e.remove:[]),this._leaveSet=new Set(e.leave&&Array.isArray(e.leave)?e.leave:[]);let n=t5(e.ncr);this._ncrXmlVersion=n.xmlVersion,this._ncrOnLevel=n.onLevel,this._ncrNullLevel=n.nullLevel,this._onExternalEntity=typeof e.onExternalEntity=="function"?e.onExternalEntity:null,this._onInputEntity=typeof e.onInputEntity=="function"?e.onInputEntity:null}_applyRegistrationHook(e,n,i,r){if(!e)return!0;let o=e(n,i);if(o===Ha.BLOCK)return!1;if(o===Ha.THROW)throw new Error(`[EntityDecoder] Registration of ${r} entity "&${n};" was rejected by hook`);return!0}setExternalEntities(e){if(e)for(let r of Object.keys(e))Rz(r);if(!this._onExternalEntity){this._externalMap=Hd(e);return}let n=Hd(e),i=Object.create(null);for(let[r,o]of Object.entries(n))this._applyRegistrationHook(this._onExternalEntity,r,o,"external")&&(i[r]=o);this._externalMap=i}addExternalEntity(e,n){Rz(e),typeof n=="string"&&n.indexOf("&")===-1&&this._applyRegistrationHook(this._onExternalEntity,e,n,"external")&&(this._externalMap[e]=n)}addInputEntities(e){if(this._totalExpansions=0,this._expandedLength=0,!this._onInputEntity){this._inputMap=Hd(e);return}let n=Hd(e),i=Object.create(null);for(let[r,o]of Object.entries(n))this._applyRegistrationHook(this._onInputEntity,r,o,"input")&&(i[r]=o);this._inputMap=i}reset(){return this._inputMap=Object.create(null),this._totalExpansions=0,this._expandedLength=0,this}setXmlVersion(e){this._ncrXmlVersion=e===1.1?1.1:1}decode(e){if(typeof e!="string"||e.length===0||e.indexOf("&")===-1)return e;let n=e,i=[],r=e.length,o=0,s=0,c=this._maxTotalExpansions>0,u=this._maxExpandedLength>0,l=c||u;for(;s<r;){if(e.charCodeAt(s)!==38){s++;continue}let f=s+1;for(;f<r&&e.charCodeAt(f)!==59&&f-s<=32;)f++;if(f>=r||e.charCodeAt(f)!==59){s++;continue}let p=e.slice(s+1,f);if(p.length===0){s++;continue}let m,g;if(this._removeSet.has(p))m="",g===void 0&&(g=ss);else if(this._leaveSet.has(p)){s++;continue}else if(p.charCodeAt(0)===35){let y=this._resolveNCR(p);if(y===void 0){s++;continue}m=y,g=Sy}else{let y=this._resolveName(p);m=y?.value,g=y?.tier}if(m===void 0){s++;continue}if(s>o&&i.push(e.slice(o,s)),i.push(m),o=f+1,s=o,l&&this._tierCounts(g)){if(c&&(this._totalExpansions++,this._totalExpansions>this._maxTotalExpansions))throw new Error(`[EntityReplacer] Entity expansion count limit exceeded: ${this._totalExpansions} > ${this._maxTotalExpansions}`);if(u){let y=m.length-(p.length+2);if(y>0&&(this._expandedLength+=y,this._expandedLength>this._maxExpandedLength))throw new Error(`[EntityReplacer] Expanded content length limit exceeded: ${this._expandedLength} > ${this._maxExpandedLength}`)}}}o<r&&i.push(e.slice(o));let d=i.length===0?e:i.join("");return this._postCheck(d,n)}_tierCounts(e){return this._limitTiers.has(fI)?!0:this._limitTiers.has(e)}_resolveName(e){if(e in this._inputMap)return{value:this._inputMap[e],tier:ss};if(e in this._externalMap)return{value:this._externalMap[e],tier:ss};if(e in this._baseMap)return{value:this._baseMap[e],tier:Sy}}_classifyNCR(e){return e===0?this._ncrNullLevel:e>=55296&&e<=57343||this._ncrXmlVersion===1&&e>=1&&e<=31&&!e5.has(e)?ln.remove:-1}_applyNCRAction(e,n,i){switch(e){case ln.allow:return String.fromCodePoint(i);case ln.remove:return"";case ln.leave:return;case ln.throw:throw new Error(`[EntityDecoder] Prohibited numeric character reference &${n}; (U+${i.toString(16).toUpperCase().padStart(4,"0")})`);default:return String.fromCodePoint(i)}}_resolveNCR(e){let n=e.charCodeAt(1),i;if(n===120||n===88?i=parseInt(e.slice(2),16):i=parseInt(e.slice(1),10),Number.isNaN(i)||i<0||i>1114111)return;let r=this._classifyNCR(i);if(!this._numericAllowed&&r<ln.remove)return;let o=r===-1?this._ncrOnLevel:Math.max(this._ncrOnLevel,r);return this._applyNCRAction(o,e,i)}};var jz=a(t=>Vd.includes(t)?"__"+t:t,"defaultOnDangerousProperty"),n5={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0,unicode:!1},tagValueProcessor:a(function(t,e){return e},"tagValueProcessor"),attributeValueProcessor:a(function(t,e){return e},"attributeValueProcessor"),stopNodes:[],alwaysCreateTextNode:!1,isArray:a(()=>!1,"isArray"),commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,entityDecoder:null,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:a(function(t,e,n){return t},"updateTag"),captureMetaData:!1,maxNestedTags:100,strictReservedNames:!0,jPath:!0,onDangerousProperty:jz};function r5(t,e){if(typeof t!="string")return;let n=t.toLowerCase();if(Vd.some(i=>n===i.toLowerCase()))throw new Error(`[SECURITY] Invalid ${e}: "${t}" is a reserved JavaScript keyword that could cause prototype pollution`);if(ky.some(i=>n===i.toLowerCase()))throw new Error(`[SECURITY] Invalid ${e}: "${t}" is a reserved JavaScript keyword that could cause prototype pollution`)}a(r5,"validatePropertyName");function zz(t,e){return typeof t=="boolean"?{enabled:t,maxEntitySize:1e4,maxExpansionDepth:1e4,maxTotalExpansions:1/0,maxExpandedLength:1e5,maxEntityCount:1e3,allowedTags:null,tagFilter:null,appliesTo:"all"}:typeof t=="object"&&t!==null?{enabled:t.enabled!==!1,maxEntitySize:Math.max(1,t.maxEntitySize??1e4),maxExpansionDepth:Math.max(1,t.maxExpansionDepth??1e4),maxTotalExpansions:Math.max(1,t.maxTotalExpansions??1/0),maxExpandedLength:Math.max(1,t.maxExpandedLength??1e5),maxEntityCount:Math.max(1,t.maxEntityCount??1e3),allowedTags:t.allowedTags??null,tagFilter:t.tagFilter??null,appliesTo:t.appliesTo??"all"}:zz(!0)}a(zz,"normalizeProcessEntities");var Dz=a(function(t){let e=Object.assign({},n5,t),n=[{value:e.attributeNamePrefix,name:"attributeNamePrefix"},{value:e.attributesGroupName,name:"attributesGroupName"},{value:e.textNodeName,name:"textNodeName"},{value:e.cdataPropName,name:"cdataPropName"},{value:e.commentPropName,name:"commentPropName"}];for(let{value:i,name:r}of n)i&&r5(i,r);return e.onDangerousProperty===null&&(e.onDangerousProperty=jz),e.processEntities=zz(e.processEntities,e.htmlEntities),e.unpairedTagsSet=new Set(e.unpairedTags),e.stopNodes&&Array.isArray(e.stopNodes)&&(e.stopNodes=e.stopNodes.map(i=>typeof i=="string"&&i.startsWith("*.")?".."+i.substring(2):i)),e},"buildOptions");var as;typeof Symbol!="function"?as="@@xmlMetadata":as=Symbol("XML Node Metadata");var dn=class{static{a(this,"XmlNode")}constructor(e){this.tagname=e,this.child=[],this[":@"]=Object.create(null)}add(e,n){e==="__proto__"&&(e="#__proto__"),this.child.push({[e]:n})}addChild(e,n){e.tagname==="__proto__"&&(e.tagname="#__proto__"),e[":@"]&&Object.keys(e[":@"]).length>0?this.child.push({[e.tagname]:e.child,":@":e[":@"]}):this.child.push({[e.tagname]:e.child}),this.addStartIndex(n)}addStartIndex(e){e!==void 0&&(this.child[this.child.length-1][as]={startIndex:e})}addEndIndex(e){let n=this.child[this.child.length-1];n!==void 0&&n[as]!==void 0&&n[as].endIndex===void 0&&(n[as].endIndex=e)}static getMetaDataSymbol(){return as}};var Lz=":A-Za-z_\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u0486\u0488-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD",i5=Lz+"\\-\\.\\d\xB7\u0300-\u036F\u203F-\u2040",Mz=":A-Za-z_\xC0-\u02FF\u0370-\u037D\u037F-\u0486\u0488-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u{10000}-\u{EFFFF}",o5=Mz+"\\-\\.\\d\xB7\u0300-\u036F\u0487\u203F-\u2040",pI=a((t,e,n="")=>{let i=t.replace(":",""),r=e.replace(":",""),o=`[${i}][${r}]*`;return{name:new RegExp(`^[${t}][${e}]*$`,n),ncName:new RegExp(`^${o}$`,n),qName:new RegExp(`^${o}(?::${o})?$`,n),nmToken:new RegExp(`^[${e}]+$`,n),nmTokens:new RegExp(`^[${e}]+(?:\\s+[${e}]+)*$`,n)}},"buildRegexes"),s5=pI(Lz,i5),a5=pI(Mz,o5,"u"),Uz=":A-Za-z_",c5=Uz+"\\-\\.\\d",u5=pI(Uz,c5),l5=a((t="1.0",e=!1)=>e?u5:t==="1.1"?a5:s5,"getRegexes");var mI=a((t,{xmlVersion:e="1.0",asciiOnly:n=!1}={})=>l5(e,n).qName.test(t),"qName");var Gd=class{static{a(this,"DocTypeReader")}constructor(e,n){this.suppressValidationErr=!e,this.options=e,this.xmlVersion=n||1}setXmlVersion(e=1){this.xmlVersion=e}readDocType(e,n){let i=Object.create(null),r=0;if(e[n+3]==="O"&&e[n+4]==="C"&&e[n+5]==="T"&&e[n+6]==="Y"&&e[n+7]==="P"&&e[n+8]==="E"){n=n+9;let o=1,s=!1,c=!1,u=null,l="";for(;n<e.length;n++){if(u!==null){e[n]===u&&(u=null),l+=e[n];continue}if(!s&&!c&&(e[n]==='"'||e[n]==="'")){u=e[n],l+=e[n];continue}if(e[n]==="<"&&!c){if(s&&cs(e,"!ENTITY",n)){n+=7;let d,f;if([d,f,n]=this.readEntityExp(e,n+1,this.suppressValidationErr),f.indexOf("&")===-1){if(this.options.enabled!==!1&&this.options.maxEntityCount!=null&&r>=this.options.maxEntityCount)throw new Error(`Entity count (${r+1}) exceeds maximum allowed (${this.options.maxEntityCount})`);i[d]=f,r++}}else if(s&&cs(e,"!ELEMENT",n)){n+=8;let{index:d}=this.readElementExp(e,n+1);n=d}else if(s&&cs(e,"!ATTLIST",n))n+=8;else if(s&&cs(e,"!NOTATION",n)){n+=9;let{index:d}=this.readNotationExp(e,n+1,this.suppressValidationErr);n=d}else if(cs(e,"!--",n))c=!0;else throw new Error("Invalid DOCTYPE");o++,l=""}else if(e[n]===">"){if(c?e[n-1]==="-"&&e[n-2]==="-"&&(c=!1,o--):o--,o===0)break}else e[n]==="["?s=!0:l+=e[n]}if(u!==null||o!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:i,i:n}}readEntityExp(e,n){n=fn(e,n);let i=n;for(;n<e.length&&!/\s/.test(e[n])&&e[n]!=='"'&&e[n]!=="'";)n++;let r=e.substring(i,n);if(Wd(r,{xmlVersion:this.xmlVersion}),n=fn(e,n),!this.suppressValidationErr){if(e.substring(n,n+6).toUpperCase()==="SYSTEM")throw new Error("External entities are not supported");if(e[n]==="%")throw new Error("Parameter entities are not supported")}let o="";if([n,o]=this.readIdentifierVal(e,n,"entity"),this.options.enabled!==!1&&this.options.maxEntitySize!=null&&o.length>this.options.maxEntitySize)throw new Error(`Entity "${r}" size (${o.length}) exceeds maximum allowed size (${this.options.maxEntitySize})`);return n--,[r,o,n]}readNotationExp(e,n){n=fn(e,n);let i=n;for(;n<e.length&&!/\s/.test(e[n]);)n++;let r=e.substring(i,n);!this.suppressValidationErr&&Wd(r,{xmlVersion:this.xmlVersion}),n=fn(e,n);let o=e.substring(n,n+6).toUpperCase();if(!this.suppressValidationErr&&o!=="SYSTEM"&&o!=="PUBLIC")throw new Error(`Expected SYSTEM or PUBLIC, found "${o}"`);n+=o.length,n=fn(e,n);let s=null,c=null;if(o==="PUBLIC")[n,s]=this.readIdentifierVal(e,n,"publicIdentifier"),n=fn(e,n),(e[n]==='"'||e[n]==="'")&&([n,c]=this.readIdentifierVal(e,n,"systemIdentifier"));else if(o==="SYSTEM"&&([n,c]=this.readIdentifierVal(e,n,"systemIdentifier"),!this.suppressValidationErr&&!c))throw new Error("Missing mandatory system identifier for SYSTEM notation");return{notationName:r,publicIdentifier:s,systemIdentifier:c,index:--n}}readIdentifierVal(e,n,i){let r="",o=e[n];if(o!=='"'&&o!=="'")throw new Error(`Expected quoted string, found "${o}"`);n++;let s=n;for(;n<e.length&&e[n]!==o;)n++;if(r=e.substring(s,n),e[n]!==o)throw new Error(`Unterminated ${i} value`);return n++,[n,r]}readElementExp(e,n){n=fn(e,n);let i=n;for(;n<e.length&&!/\s/.test(e[n]);)n++;let r=e.substring(i,n);if(!this.suppressValidationErr&&!mI(r,{xmlVersion:this.xmlVersion}))throw new Error(`Invalid element name: "${r}"`);n=fn(e,n);let o="";if(e[n]==="E"&&cs(e,"MPTY",n))n+=4;else if(e[n]==="A"&&cs(e,"NY",n))n+=2;else if(e[n]==="("){n++;let s=n;for(;n<e.length&&e[n]!==")";)n++;if(o=e.substring(s,n),e[n]!==")")throw new Error("Unterminated content model")}else if(!this.suppressValidationErr)throw new Error(`Invalid Element Expression, found "${e[n]}"`);return{elementName:r,contentModel:o.trim(),index:n}}readAttlistExp(e,n){n=fn(e,n);let i=n;for(;n<e.length&&!/\s/.test(e[n]);)n++;let r=e.substring(i,n);for(Wd(r,{xmlVersion:this.xmlVersion}),n=fn(e,n),i=n;n<e.length&&!/\s/.test(e[n]);)n++;let o=e.substring(i,n);if(!Wd(o,{xmlVersion:this.xmlVersion}))throw new Error(`Invalid attribute name: "${o}"`);n=fn(e,n);let s="";if(e.substring(n,n+8).toUpperCase()==="NOTATION"){if(s="NOTATION",n+=8,n=fn(e,n),e[n]!=="(")throw new Error(`Expected '(', found "${e[n]}"`);n++;let u=[];for(;n<e.length&&e[n]!==")";){let l=n;for(;n<e.length&&e[n]!=="|"&&e[n]!==")";)n++;let d=e.substring(l,n);if(d=d.trim(),!Wd(d,{xmlVersion:this.xmlVersion}))throw new Error(`Invalid notation name: "${d}"`);u.push(d),e[n]==="|"&&(n++,n=fn(e,n))}if(e[n]!==")")throw new Error("Unterminated list of notations");n++,s+=" ("+u.join("|")+")"}else{let u=n;for(;n<e.length&&!/\s/.test(e[n]);)n++;s+=e.substring(u,n);let l=["CDATA","ID","IDREF","IDREFS","ENTITY","ENTITIES","NMTOKEN","NMTOKENS"];if(!this.suppressValidationErr&&!l.includes(s.toUpperCase()))throw new Error(`Invalid attribute type: "${s}"`)}n=fn(e,n);let c="";return e.substring(n,n+8).toUpperCase()==="#REQUIRED"?(c="#REQUIRED",n+=8):e.substring(n,n+7).toUpperCase()==="#IMPLIED"?(c="#IMPLIED",n+=7):[n,c]=this.readIdentifierVal(e,n,"ATTLIST"),{elementName:r,attributeName:o,attributeType:s,defaultValue:c,index:n}}},fn=a((t,e)=>{for(;e<t.length&&/\s/.test(t[e]);)e++;return e},"skipWhitespace");function cs(t,e,n){for(let i=0;i<e.length;i++)if(e[i]!==t[n+i+1])return!1;return!0}a(cs,"hasSeq");function Wd(t,e){if(mI(t,{xmlVersion:e}))return t;throw new Error(`Invalid entity name ${t}`)}a(Wd,"validateEntityName");var d5=[48,1632,1776,2406,2534,2662,2790,2918,3046,3174,3302,3430,3558,3664,3792,3872,4160,4240,6112,6160,6470,6608,6784,6800,6992,7088,7232,7248,65296,120782,120792,120802,120812,120822,66720,68912,69734,69872,69942,70096,70384,70736,70864,71248,71360,71472,71904,72016,72688,72784,73040,73120,73552,92768,92864,93008,123200,123632,124144,125264,130032],Iy=255,Ey=new Map,Fz=65535,qz=1632,Ga=qz,f5=Fz-qz+1,Ty=new Uint8Array(f5).fill(Iy);for(let t of d5)for(let e=0;e<10;e++){let n=t+e;n<=Fz?Ty[n-Ga]=e:Ey.set(n,e)}var Zz=48,Vz=57,Bz=45,Ay=new Set([8722,65293,65123]);function p5(t){if(typeof t!="string")return t;let e=t.length;if(e===0)return t;let n=-1;for(let r=0;r<e;r++){let o=t.charCodeAt(r);if(!(o>=Zz&&o<=Vz||o===Bz)){if(o<Ga){if(Ay.has(o)){n=r;break}continue}if(o>=55296&&o<=56319){if(r+1<e){let s=t.charCodeAt(r+1);if(s>=56320&&s<=57343){let c=65536+(o-55296<<10)+(s-56320);if(Ey.has(c)){n=r;break}}}continue}if(Ty[o-Ga]!==Iy||Ay.has(o)){n=r;break}}}if(n===-1)return t;let i=[];n>0&&i.push(t.slice(0,n));for(let r=n;r<e;r++){let o=t.charCodeAt(r);if(o>=Zz&&o<=Vz||o===Bz){i.push(t[r]);continue}if(o<Ga){i.push(Ay.has(o)?"-":t[r]);continue}if(o>=55296&&o<=56319){if(r+1<e){let c=t.charCodeAt(r+1);if(c>=56320&&c<=57343){let u=65536+(o-55296<<10)+(c-56320),l=Ey.get(u);if(l!==void 0){i.push(String.fromCharCode(l+48)),r++;continue}}}i.push(t[r]);continue}if(Ay.has(o)){i.push("-");continue}let s=Ty[o-Ga];i.push(s!==Iy?String.fromCharCode(s+48):t[r])}return i.join("")}a(p5,"anynum");var Kz=p5;var m5=/^[-+]?0x[a-fA-F0-9]+$/,h5=/^0b[01]+$/,g5=/^0o[0-7]+$/,y5=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,v5={hex:!0,binary:!1,octal:!1,leadingZeros:!0,decimalPoint:".",eNotation:!0,infinity:"original",unicode:!1};function gI(t,e={}){if(e=Object.assign({},v5,e),!t||typeof t!="string")return t;let n=t.trim();if(n.length===0)return t;if(e.skipLike!==void 0&&e.skipLike.test(n))return t;if(n==="0"||e.unicode&&(n=Kz(n),n==="0"))return 0;if(e.hex&&m5.test(n))return hI(n,16);if(e.binary&&h5.test(n))return hI(n,2);if(e.octal&&g5.test(n))return hI(n,8);if(isFinite(n)){if(n.includes("e")||n.includes("E"))return w5(t,n,e);{let i=y5.exec(n);if(i){let r=i[1]||"",o=i[2],s=$5(i[3]),c=r?t[o.length+1]===".":t[o.length]===".";if(!e.leadingZeros&&(o.length>1||o.length===1&&!c))return t;{let u=Number(n),l=String(u);if(u===0)return u;if(l.search(/[eE]/)!==-1)return e.eNotation?u:t;if(n.indexOf(".")!==-1)return l==="0"||l===s||l===`${r}${s}`?u:t;let d=o?s:n;return o?d===l||r+d===l?u:t:d===l||d===r+l?u:t}}else return t}}else return _5(t,Number(n),e)}a(gI,"toNumber");var b5=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;function w5(t,e,n){if(!n.eNotation)return t;let i=e.match(b5);if(i){let r=i[1]||"",o=i[3].indexOf("e")===-1?"E":"e",s=i[2],c=r?t[s.length+1]===o:t[s.length]===o;return s.length>1&&c?t:s.length===1&&(i[3].startsWith(`.${o}`)||i[3][0]===o)?Number(e):s.length>0?n.leadingZeros&&!c?(e=(i[1]||"")+i[3],Number(e)):t:Number(e)}else return t}a(w5,"resolveEnotation");function $5(t){if(t&&t.indexOf(".")!==-1){let e=t.length;for(;e>0&&t.charCodeAt(e-1)===48;)e--;return t=t.slice(0,e),t==="."?t="0":t[0]==="."?t="0"+t:t[t.length-1]==="."&&(t=t.substring(0,t.length-1)),t}return t}a($5,"trimZeros");function hI(t,e){let n=t.trim();if((e===2||e===8)&&(t=n.substring(2)),parseInt)return parseInt(t,e);if(Number.parseInt)return Number.parseInt(t,e);if(window&&window.parseInt)return window.parseInt(t,e);throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")}a(hI,"parse_int");function _5(t,e,n){let i=e===1/0;switch(n.infinity.toLowerCase()){case"null":return null;case"infinity":return e;case"string":return i?"Infinity":"-Infinity";case"original":default:return t}}a(_5,"handleInfinity");function yI(t){return typeof t=="function"?t:Array.isArray(t)?e=>{for(let n of t)if(typeof n=="string"&&e===n||n instanceof RegExp&&n.test(e))return!0}:()=>!1}a(yI,"getIgnoreAttributesFn");var us=class{static{a(this,"Expression")}constructor(e,n={},i){this.pattern=e,this.separator=n.separator||".",this.segments=this._parse(e),this.data=i,this._hasDeepWildcard=this.segments.some(r=>r.type==="deep-wildcard"),this._hasAttributeCondition=this.segments.some(r=>r.attrName!==void 0),this._hasPositionSelector=this.segments.some(r=>r.position!==void 0)}_parse(e){let n=[],i=0,r="";for(;i<e.length;)e[i]===this.separator?i+1<e.length&&e[i+1]===this.separator?(r.trim()&&(n.push(this._parseSegment(r.trim())),r=""),n.push({type:"deep-wildcard"}),i+=2):(r.trim()&&n.push(this._parseSegment(r.trim())),r="",i++):(r+=e[i],i++);return r.trim()&&n.push(this._parseSegment(r.trim())),n}_parseSegment(e){let n={type:"tag"},i=null,r=e,o=e.match(/^([^\[]+)(\[[^\]]*\])(.*)$/);if(o&&(r=o[1]+o[3],o[2])){let d=o[2].slice(1,-1);d&&(i=d)}let s,c=r;if(r.includes("::")){let d=r.indexOf("::");if(s=r.substring(0,d).trim(),c=r.substring(d+2).trim(),!s)throw new Error(`Invalid namespace in pattern: ${e}`)}let u,l=null;if(c.includes(":")){let d=c.lastIndexOf(":"),f=c.substring(0,d).trim(),p=c.substring(d+1).trim();["first","last","odd","even"].includes(p)||/^nth\(\d+\)$/.test(p)?(u=f,l=p):u=c}else u=c;if(!u)throw new Error(`Invalid segment pattern: ${e}`);if(n.tag=u,s&&(n.namespace=s),i)if(i.includes("=")){let d=i.indexOf("=");n.attrName=i.substring(0,d).trim(),n.attrValue=i.substring(d+1).trim()}else n.attrName=i.trim();if(l){let d=l.match(/^nth\((\d+)\)$/);d?(n.position="nth",n.positionValue=parseInt(d[1],10)):n.position=l}return n}get length(){return this.segments.length}hasDeepWildcard(){return this._hasDeepWildcard}hasAttributeCondition(){return this._hasAttributeCondition}hasPositionSelector(){return this._hasPositionSelector}toString(){return this.pattern}};var Ja=class{static{a(this,"ExpressionSet")}constructor(){this._byDepthAndTag=new Map,this._wildcardByDepth=new Map,this._deepWildcards=[],this._deepByTerminalTag=new Map,this._patterns=new Set,this._sealed=!1}add(e){if(this._sealed)throw new TypeError("ExpressionSet is sealed. Create a new ExpressionSet to add more expressions.");if(this._patterns.has(e.pattern))return this;if(this._patterns.add(e.pattern),e.hasDeepWildcard()){let o=e.segments[e.segments.length-1];if(o&&o.type!=="deep-wildcard"&&o.tag!=="*"){let s=o.tag;this._deepByTerminalTag.has(s)||this._deepByTerminalTag.set(s,[]),this._deepByTerminalTag.get(s).push(e)}else this._deepWildcards.push(e);return this}let n=e.length,r=e.segments[e.segments.length-1]?.tag;if(!r||r==="*")this._wildcardByDepth.has(n)||this._wildcardByDepth.set(n,[]),this._wildcardByDepth.get(n).push(e);else{let o=`${n}:${r}`;this._byDepthAndTag.has(o)||this._byDepthAndTag.set(o,[]),this._byDepthAndTag.get(o).push(e)}return this}addAll(e){for(let n of e)this.add(n);return this}has(e){return this._patterns.has(e.pattern)}get size(){return this._patterns.size}seal(){return this._sealed=!0,this}get isSealed(){return this._sealed}matchesAny(e){return this.findMatch(e)!==null}findMatch(e){let n=e.getDepth(),i=e.getCurrentTag(),r=`${n}:${i}`,o=this._byDepthAndTag.get(r);if(o){for(let u=0;u<o.length;u++)if(e.matches(o[u]))return o[u]}let s=this._wildcardByDepth.get(n);if(s){for(let u=0;u<s.length;u++)if(e.matches(s[u]))return s[u]}let c=this._deepByTerminalTag.get(i);if(c){for(let u=0;u<c.length;u++)if(e.matches(c[u]))return c[u]}for(let u=0;u<this._deepWildcards.length;u++)if(e.matches(this._deepWildcards[u]))return this._deepWildcards[u];return null}};var vI=class{static{a(this,"MatcherView")}constructor(e){this._matcher=e}get separator(){return this._matcher.separator}getCurrentTag(){let e=this._matcher.path;return e.length>0?e[e.length-1].tag:void 0}getCurrentNamespace(){let e=this._matcher.path;return e.length>0?e[e.length-1].namespace:void 0}getAttrValue(e){let n=this._matcher.path;if(n.length!==0)return n[n.length-1].values?.[e]}hasAttr(e){let n=this._matcher.path;if(n.length===0)return!1;let i=n[n.length-1];return i.values!==void 0&&e in i.values}getAnyParentAttr(e){return this._matcher.getAnyParentAttr(e)}hasAnyParentAttr(e){return this._matcher.hasAnyParentAttr(e)}getPosition(){let e=this._matcher.path;return e.length===0?-1:e[e.length-1].position??0}getCounter(){let e=this._matcher.path;return e.length===0?-1:e[e.length-1].counter??0}getIndex(){return this.getPosition()}getDepth(){return this._matcher.path.length}toString(e,n=!0){return this._matcher.toString(e,n)}toArray(){return this._matcher.path.map(e=>e.tag)}matches(e){return this._matcher.matches(e)}matchesAny(e){return e.matchesAny(this._matcher)}},Ya=class{static{a(this,"Matcher")}constructor(e={}){this.separator=e.separator||".",this.path=[],this.siblingStacks=[],this._pathStringCache=null,this._view=new vI(this),this._keptAttrs=[]}push(e,n=null,i=null,r=null){this._pathStringCache=null,this.path.length>0&&(this.path[this.path.length-1].values=void 0);let o=this.path.length,s=this.siblingStacks[o];s||(s={counts:new Map,total:0},this.siblingStacks[o]=s);let c=i?`${i}:${e}`:e,u=s.counts.get(c)||0,l=s.total;s.counts.set(c,u+1),s.total++;let d={tag:e,position:l,counter:u};i!=null&&(d.namespace=i),n!=null&&(d.values=n),this.path.push(d);let f=this.path.length,p=r!==null?r.keep:null;if(p!=null&&p.length>0&&n)for(let m=0;m<p.length;m++){let g=p[m];n[g]!==void 0&&this._keptAttrs.push({depth:f,name:g,value:n[g]})}}pop(){if(this.path.length===0)return;this._pathStringCache=null;let e=this.path.pop();this.siblingStacks.length>this.path.length+1&&(this.siblingStacks.length=this.path.length+1);let n=this.path.length+1;for(;this._keptAttrs.length>0&&this._keptAttrs[this._keptAttrs.length-1].depth>=n;)this._keptAttrs.pop();return e}updateCurrent(e){if(this.path.length>0){let n=this.path[this.path.length-1];e!=null&&(n.values=e)}}getCurrentTag(){return this.path.length>0?this.path[this.path.length-1].tag:void 0}getCurrentNamespace(){return this.path.length>0?this.path[this.path.length-1].namespace:void 0}getAttrValue(e){if(this.path.length!==0)return this.path[this.path.length-1].values?.[e]}hasAttr(e){if(this.path.length===0)return!1;let n=this.path[this.path.length-1];return n.values!==void 0&&e in n.values}getAnyParentAttr(e){let n=this._keptAttrs;for(let i=n.length-1;i>=0;i--)if(n[i].name===e)return n[i].value}hasAnyParentAttr(e){let n=this._keptAttrs;for(let i=n.length-1;i>=0;i--)if(n[i].name===e)return!0;return!1}getPosition(){return this.path.length===0?-1:this.path[this.path.length-1].position??0}getCounter(){return this.path.length===0?-1:this.path[this.path.length-1].counter??0}getIndex(){return this.getPosition()}getDepth(){return this.path.length}toString(e,n=!0){let i=e||this.separator;if(i===this.separator&&n===!0){if(this._pathStringCache!==null)return this._pathStringCache;let o=this.path.map(s=>s.namespace?`${s.namespace}:${s.tag}`:s.tag).join(i);return this._pathStringCache=o,o}return this.path.map(o=>n&&o.namespace?`${o.namespace}:${o.tag}`:o.tag).join(i)}toArray(){return this.path.map(e=>e.tag)}reset(){this._pathStringCache=null,this.path=[],this.siblingStacks=[],this._keptAttrs=[]}matches(e){let n=e.segments;return n.length===0?!1:e.hasDeepWildcard()?this._matchWithDeepWildcard(n):this._matchSimple(n)}_matchSimple(e){if(this.path.length!==e.length)return!1;for(let n=0;n<e.length;n++)if(!this._matchSegment(e[n],this.path[n],n===this.path.length-1))return!1;return!0}_matchWithDeepWildcard(e){let n=this.path.length-1,i=e.length-1;for(;i>=0&&n>=0;){let r=e[i];if(r.type==="deep-wildcard"){if(i--,i<0)return!0;let o=e[i],s=!1;for(let c=n;c>=0;c--)if(this._matchSegment(o,this.path[c],c===this.path.length-1)){n=c-1,i--,s=!0;break}if(!s)return!1}else{if(!this._matchSegment(r,this.path[n],n===this.path.length-1))return!1;n--,i--}}return i<0}_matchSegment(e,n,i){if(e.tag!=="*"&&e.tag!==n.tag||e.namespace!==void 0&&e.namespace!=="*"&&e.namespace!==n.namespace||e.attrName!==void 0&&(!i||!n.values||!(e.attrName in n.values)||e.attrValue!==void 0&&String(n.values[e.attrName])!==String(e.attrValue)))return!1;if(e.position!==void 0){if(!i)return!1;let r=n.counter??0;if(e.position==="first"&&r!==0)return!1;if(e.position==="odd"&&r%2!==1)return!1;if(e.position==="even"&&r%2!==0)return!1;if(e.position==="nth"&&r!==e.positionValue)return!1}return!0}matchesAny(e){return e.matchesAny(this)}snapshot(){return{path:this.path.map(e=>({...e})),siblingStacks:this.siblingStacks.map(e=>e&&{counts:new Map(e.counts),total:e.total}),keptAttrs:this._keptAttrs.map(e=>({...e}))}}restore(e){this._pathStringCache=null,this.path=e.path.map(n=>({...n})),this.siblingStacks=e.siblingStacks.map(n=>n&&{counts:new Map(n.counts),total:n.total}),this._keptAttrs=(e.keptAttrs||[]).map(n=>({...n}))}readOnly(){return this._view}};var k5=[{id:"html-script-open",description:"<script opening tag",pattern:/<script[\s>/]/i},{id:"html-script-close",description:"</script closing tag",pattern:/<\/script[\s>]/i},{id:"html-javascript-protocol",description:"javascript: URI scheme (with optional whitespace/encoding)",pattern:/j[\t\n\r ]*a[\t\n\r ]*v[\t\n\r ]*a[\t\n\r ]*s[\t\n\r ]*c[\t\n\r ]*r[\t\n\r ]*i[\t\n\r ]*p[\t\n\r ]*t[\t\n\r ]*:/i},{id:"html-vbscript-protocol",description:"vbscript: URI scheme",pattern:/vbscript[\t\n\r ]*:/i},{id:"html-data-html",description:"data:text/html URI \u2014 can execute scripts in browsers",pattern:/data[\t\n\r ]*:[\t\n\r ]*text\/html/i},{id:"html-data-xhtml",description:"data:application/xhtml+xml URI",pattern:/data[\t\n\r ]*:[\t\n\r ]*application\/xhtml/i},{id:"html-data-svg",description:"data:image/svg+xml URI \u2014 can execute scripts",pattern:/data[\t\n\r ]*:[\t\n\r ]*image\/svg\+xml/i},{id:"html-inline-event-handler",description:"Inline event handler attributes: onclick=, onerror=, onload=, etc.",pattern:/\bon\w{1,30}\s*=/i},{id:"html-entity-obfuscated-script",description:"HTML-entity-encoded <script (e.g. <script or <script)",pattern:/(?:�*3[Cc];?|�*60;?|<)\s*script/i},{id:"html-entity-obfuscated-javascript",description:'HTML-entity-encoded javascript: (partial \u2014 catches common j or j for "j")',pattern:/(?:�*6[Aa];?|�*106;?)\s*(?:�*61;?|a)[\s\S]{0,80}script\s*:/i},{id:"html-style-expression",description:"CSS expression() \u2014 IE-era code execution in style attributes",pattern:/style[\s\S]{0,20}expression\s*\(/i},{id:"html-object-embed",description:"<object or <embed tags that can load active content",pattern:/<(?:object|embed)[\s>/]/i},{id:"html-base-tag",description:"<base href= \u2014 can hijack all relative URLs on a page",pattern:/<base[\s>]/i},{id:"html-meta-refresh",description:'<meta http-equiv="refresh" \u2014 can redirect users',pattern:/<meta[\s\S]{0,40}http-equiv[\s\S]{0,20}refresh/i},{id:"html-srcdoc",description:"srcdoc= attribute on iframes \u2014 embeds HTML that can run scripts",pattern:/srcdoc\s*=/i},{id:"html-iframe",description:"<iframe tag",pattern:/<iframe[\s>/]/i},{id:"html-form",description:"<form tag \u2014 can be used for phishing / credential harvesting injection",pattern:/<form[\s>/]/i}],Xa=k5;var x5=[{id:"xml-cdata-injection",description:"CDATA section injection: <![CDATA[ breaks out of text node context",pattern:/<!\[CDATA\[/i},{id:"xml-cdata-close",description:"CDATA close sequence: ]]> can terminate an enclosing CDATA section",pattern:/\]\]>/},{id:"xml-processing-instruction",description:"XML processing instruction: <?xml-stylesheet or <?php etc.",pattern:/<\?(?:xml[\- ]|php|asp)/i},{id:"xml-doctype-injection",description:"DOCTYPE declaration embedded in content \u2014 can define entities",pattern:/<!DOCTYPE(?:[\s[]|$)/i},{id:"xml-entity-system",description:"SYSTEM keyword \u2014 used in external entity declarations (XXE)",pattern:/\bSYSTEM\s+["']/i},{id:"xml-entity-public",description:"PUBLIC keyword \u2014 used in external entity declarations (XXE)",pattern:/\bPUBLIC\s+["']/i},{id:"xml-entity-declaration",description:"<!ENTITY declaration \u2014 defines entities, potential XXE or entity expansion",pattern:/<!ENTITY[\s%]/i},{id:"xml-billion-laughs",description:"Entity reference chaining / billion laughs: repeated &eX; style references",pattern:/(?:&\w{1,20};){3,}/},{id:"xml-namespace-confusion",description:"xmlns: attribute injection \u2014 can redefine namespaces to confuse parsers",pattern:/\bxmlns(?::\w{1,40})?\s*=/i},{id:"xml-comment-injection",description:"<!-- comment injection \u2014 can hide content from some parsers",pattern:/<!--/},{id:"xml-comment-close",description:"--> closes an enclosing XML comment",pattern:/-->/},{id:"xml-pi-close",description:"?> closes an enclosing processing instruction",pattern:/\?>/}],Qa=x5;var S5=[{id:"svg-script-element",description:"<script element inside SVG executes JavaScript",pattern:/<script[\s>/]/i},{id:"svg-xlink-href-javascript",description:"xlink:href with javascript: \u2014 classic SVG XSS via <a> or <use>",pattern:/xlink\s*:\s*href\s*=\s*["']?\s*javascript\s*:/i},{id:"svg-href-javascript",description:"href= with javascript: in SVG context (<a>, <animate>, etc.)",pattern:/href\s*=\s*["']?\s*javascript\s*:/i},{id:"svg-foreignobject",description:"<foreignObject embeds HTML inside SVG \u2014 can execute scripts",pattern:/<foreignObject[\s>/]/i},{id:"svg-use-external",description:"<use xlink:href or href pointing to external resource (non-fragment URL)",pattern:/<use[\s\S]{0,60}(?:xlink\s*:\s*)?href\s*=\s*(?:["'][^#]|[^"'#\s>])/i},{id:"svg-animate-href",description:'<animate attributeName="href" \u2014 can dynamically change href to javascript:',pattern:/<animate[\s\S]{0,80}attributeName\s*=\s*["'][\s]*href["']/i},{id:"svg-animate-xlinkhref",description:'<animate attributeName="xlink:href"',pattern:/<animate[\s\S]{0,80}attributeName\s*=\s*["'][\s]*xlink\s*:\s*href["']/i},{id:"svg-set-javascript",description:'<set to="javascript:..." \u2014 sets an attribute to a javascript: URI',pattern:/<set[\s\S]{0,80}to\s*=\s*["']?\s*javascript\s*:/i},{id:"svg-event-handler",description:"SVG-specific event handler attributes: onload=, onerror=, onactivate=, etc.",pattern:/\bon(?:load|error|activate|begin|end|repeat|focus|blur|click|mouse\w{1,20}|key\w{1,20})\s*=/i},{id:"svg-handler-generic",description:"Generic on* handler catch-all for SVG attributes",pattern:/\bon\w{1,30}\s*=/i},{id:"svg-filter-feimage",description:"<feImage href= \u2014 filter primitive that can load external resources",pattern:/<feImage[\s\S]{0,80}(?:xlink\s*:\s*)?href\s*=/i},{id:"svg-image-external",description:"<image xlink:href with http/https or javascript protocol",pattern:/<image[\s\S]{0,80}(?:xlink\s*:\s*)?href\s*=\s*["']?\s*(?:https?|javascript)\s*:/i},{id:"svg-style-javascript",description:"style= attribute containing javascript: (e.g. background:url(javascript:...))",pattern:/style\s*=[\s\S]{0,60}javascript\s*:/i}],bI=S5;var I5=[{id:"sql-block-comment-open",description:"SQL block comment open: /* ... */ \u2014 unusual in legitimate user text",pattern:/\/\*/},{id:"sql-union-select",description:"UNION SELECT \u2014 most common SQL injection aggregation attack",pattern:/\bUNION\s{1,20}(?:ALL\s{1,20})?SELECT\b/i},{id:"sql-drop-table",description:"DROP TABLE \u2014 destructive DDL injection",pattern:/\bDROP\s{1,20}TABLE\b/i},{id:"sql-drop-database",description:"DROP DATABASE \u2014 destructive DDL injection",pattern:/\bDROP\s{1,20}DATABASE\b/i},{id:"sql-insert-into",description:"INSERT INTO \u2014 data injection",pattern:/\bINSERT\s{1,20}INTO\b/i},{id:"sql-delete-from",description:"DELETE FROM \u2014 data deletion injection",pattern:/\bDELETE\s{1,20}FROM\b/i},{id:"sql-update-set",description:"UPDATE ... SET \u2014 data modification injection",pattern:/\bUPDATE\b[\s\S]{1,60}\bSET\b/i},{id:"sql-exec-xp",description:"EXEC xp_ \u2014 MSSQL extended stored procedure execution",pattern:/\bEXEC(?:UTE)?\s{1,20}xp_/i},{id:"sql-tautology-string",description:`Classic string tautology: ' OR '1'='1 or " OR "1"="1"`,pattern:/'\s{0,10}OR\s{0,10}'[^']{0,20}'\s*=\s*'[^']{0,20}/i},{id:"sql-tautology-numeric",description:"Numeric tautology: OR 1=1",pattern:/\bOR\s{1,10}1\s*=\s*1\b/i},{id:"sql-always-true-zero",description:"Numeric tautology: OR 0=0",pattern:/\bOR\s{1,10}0\s*=\s*0\b/i},{id:"sql-sleep-benchmark",description:"Time-based blind injection: SLEEP() or BENCHMARK()",pattern:/\b(?:SLEEP|BENCHMARK)\s*\(/i},{id:"sql-waitfor-delay",description:"MSSQL time-based blind injection: WAITFOR DELAY",pattern:/\bWAITFOR\s{1,20}DELAY\b/i},{id:"sql-char-function",description:"CHAR() function \u2014 used to obfuscate injected strings",pattern:/\bCHAR\s*\(\s*\d{1,3}/i},{id:"sql-information-schema",description:"INFORMATION_SCHEMA \u2014 reconnaissance query for table/column enumeration",pattern:/\bINFORMATION_SCHEMA\b/i}],Jd=I5;var E5=[{id:"shell-path-traversal-unix",description:"Unix path traversal: ../ \u2014 climbing the directory tree",pattern:/\.\.\//},{id:"shell-path-traversal-windows",description:"Windows path traversal: ..\\ \u2014 climbing the directory tree",pattern:/\.\.\\/},{id:"shell-path-traversal-encoded",description:"URL-encoded path traversal: %2e%2e or %2f variants",pattern:/%2e%2e|%2f\.\.|\.\.%2f/i},{id:"shell-null-byte",description:"Null byte injection: \\x00 or %00 \u2014 truncates strings in C-backed functions",pattern:/\x00|%00/},{id:"shell-semicolon",description:"Semicolon command separator: cmd1; cmd2",pattern:/;/},{id:"shell-pipe",description:"Pipe operator: cmd1 | cmd2",pattern:/\|/},{id:"shell-and-operator",description:"AND operator: cmd1 && cmd2",pattern:/&&/},{id:"shell-or-operator",description:"OR operator: cmd1 || cmd2",pattern:/\|\|/},{id:"shell-backtick",description:"Backtick command substitution: `cmd`",pattern:/`/},{id:"shell-dollar-paren",description:"Dollar-paren command substitution: $(cmd)",pattern:/\$\(/},{id:"shell-dollar-brace",description:"Dollar-brace variable expansion: ${var} \u2014 can be abused for injection",pattern:/\$\{/},{id:"shell-redirect-out",description:"Output redirection: cmd > file or cmd >> file",pattern:/>{1,2}/},{id:"shell-redirect-in",description:"Input redirection: cmd < file",pattern:/</},{id:"shell-newline-injection",description:"Newline injection: \\n or \\r \u2014 can inject new shell commands",pattern:/[\n\r]/},{id:"shell-glob-star",description:"Glob expansion: * or ? \u2014 can expand to unintended files",pattern:/[/\\][*?]/},{id:"shell-absolute-root",description:"Absolute root path injection: string starting with / or \\ (Windows UNC)",pattern:/^(?:\/|\\\\)/},{id:"shell-windows-drive",description:"Windows drive letter path injection: C:\\ or D:/",pattern:/^[a-zA-Z]:[/\\]/},{id:"shell-curl-wget",description:"curl/wget with URL or flags \u2014 can exfiltrate data or download payloads",pattern:/\b(?:curl|wget)\s+(?:https?:\/\/|ftp:\/\/|-)/i}],wI=E5;var T5=[{id:"redos-nested-quantifier-plus",description:"Nested + quantifier inside a group with outer quantifier: (a+)+, (.+b)*, etc.",pattern:/\([^)]*\+[^)]*\)[+*]/},{id:"redos-nested-quantifier-star",description:"Nested * quantifier: (a*)* or (a*)+ \u2014 catastrophic backtracking",pattern:/\([^)]*\*[^)]*\)[*+]/},{id:"redos-nested-groups",description:"Doubly nested quantified groups: ((a+)+) \u2014 guaranteed catastrophic",pattern:/\(\([^)]{0,40}\)[+*]\)[+*]/},{id:"redos-alternation-overlap",description:"Overlapping alternation under quantifier: (a|a)+ \u2014 ambiguous NFA paths",pattern:/\(([^|()]{1,20})\|(?:\1)(?:\|[^|()]{1,20}){0,5}\)[+*?]{1,2}/},{id:"redos-star-plus-concat",description:"(x*x)+ pattern \u2014 triggers super-linear backtracking",pattern:/\([^)]{0,10}\*[^)]{0,10}\)[+*]/},{id:"redos-dot-star-greedy",description:"(.*){n,} or (.+){n,} \u2014 repeated greedy dot quantifiers",pattern:/\(\.[*+]\)\{?\d/},{id:"redos-large-repetition",description:"Very large fixed or range repetition count {1000,} or {1000,n} \u2014 denial of service via backtracking",pattern:/\{\d{4,}(?:,\d*)?\}/},{id:"redos-catastrophic-alternation",description:"Long alternation with many similar branches \u2014 polynomial backtracking risk",pattern:/\([^)]{0,200}(?:\|[^|)]{0,50}){9,}\)/}],$I=T5;var Pn=`["'\\s]*:`,A5=[{id:"nosql-where-operator",description:"$where \u2014 executes arbitrary JavaScript server-side in MongoDB",pattern:new RegExp(`\\$where${Pn}`,"i")},{id:"nosql-ne-operator",description:'$ne \u2014 "not equal" operator used to bypass equality checks',pattern:new RegExp(`\\$ne${Pn}`,"i")},{id:"nosql-gt-operator",description:'$gt \u2014 "greater than" used to bypass password/value checks',pattern:new RegExp(`\\$gte?${Pn}`,"i")},{id:"nosql-lt-operator",description:'$lt / $lte \u2014 "less than" bypass variants',pattern:new RegExp(`\\$lte?${Pn}`,"i")},{id:"nosql-regex-operator",description:"$regex \u2014 can be used to extract data character by character (blind injection)",pattern:new RegExp(`\\$regex${Pn}`,"i")},{id:"nosql-or-operator",description:"$or \u2014 logical OR; used to create always-true conditions",pattern:new RegExp(`\\$or${Pn}\\s*\\[`,"i")},{id:"nosql-and-operator",description:"$and \u2014 logical AND operator injection",pattern:new RegExp(`\\$and${Pn}\\s*\\[`,"i")},{id:"nosql-nor-operator",description:"$nor \u2014 logical NOR operator injection",pattern:new RegExp(`\\$nor${Pn}\\s*\\[`,"i")},{id:"nosql-exists-operator",description:"$exists \u2014 can enumerate fields to determine schema",pattern:new RegExp(`\\$exists${Pn}`,"i")},{id:"nosql-in-operator",description:"$in \u2014 matches any value in a list; can enumerate values",pattern:new RegExp(`\\$in${Pn}\\s*\\[`,"i")},{id:"nosql-expr-operator",description:"$expr \u2014 allows aggregation expressions in queries (MongoDB 3.6+)",pattern:new RegExp(`\\$expr${Pn}`,"i")},{id:"nosql-function-operator",description:"$function \u2014 executes arbitrary JavaScript in MongoDB 4.4+",pattern:new RegExp(`\\$function${Pn}`,"i")},{id:"nosql-accumulator-operator",description:"$accumulator \u2014 custom aggregation with arbitrary JS execution",pattern:new RegExp(`\\$accumulator${Pn}`,"i")},{id:"nosql-proto-pollution",description:"__proto__ \u2014 prototype pollution via object key injection",pattern:/__proto__/},{id:"nosql-constructor-prototype",description:"constructor.prototype \u2014 alternative prototype pollution vector (dot notation or JSON key)",pattern:/constructor[\s"':.,{\[]*prototype/i},{id:"nosql-proto-bracket",description:'["__proto__"] \u2014 bracket-notation prototype pollution',pattern:/\[["']__proto__["']\]/}],_I=A5;var O5=[{id:"log-crlf-injection",description:"CRLF injection: literal \\r or \\n embeds fake log lines",pattern:/[\r\n]/},{id:"log-url-encoded-crlf",description:"URL-encoded CRLF: %0d, %0a, %0D, %0A \u2014 decoded by some log parsers",pattern:/%0[dDaA]/},{id:"log-unicode-newline",description:"Unicode newline variants: U+2028 (line separator), U+2029 (paragraph separator)",pattern:/[\u2028\u2029]/},{id:"log-log4shell-jndi",description:"Log4Shell: ${jndi:...} triggers remote code execution in Apache Log4j",pattern:/\$\{jndi\s*:/i},{id:"log-log4shell-obfuscated",description:"Obfuscated Log4Shell: ${::-j}... lookup-bypass prefix used to evade WAF detection",pattern:/\$\{::-/},{id:"log-log4j-lookup",description:"Log4j lookup syntax: ${env:...}, ${sys:...}, ${ctx:...} \u2014 data exfiltration",pattern:/\$\{(?:env|sys|ctx|main|map|sd|web|docker|k8s|spring)\s*:/i},{id:"log-ssti-double-brace",description:"SSTI double-brace: {{expression}} \u2014 Jinja2, Twig, Handlebars, etc.",pattern:/\{\{[\s\S]{0,80}\}\}/},{id:"log-ssti-hash-brace",description:"SSTI hash-brace: #{expression} \u2014 Thymeleaf, Velocity, Ruby ERB",pattern:/#\{[\s\S]{0,80}\}/},{id:"log-ssti-dollar-brace",description:"SSTI/EL injection: ${expression with operators or method calls} \u2014 JSP EL, Freemarker, SpEL",pattern:/\$\{[^}]*(?:\.|\(|\*|\+|\bclass\b|\bruntime\b|\bprocess\b|\bexec\b)[^}]{0,80}\}/i},{id:"log-ssti-percent-tag",description:"SSTI ERB/ASP tag: <%= expression %> \u2014 Ruby ERB, ASP",pattern:/<%=[\s\S]{0,80}%>/},{id:"log-null-byte",description:"Null byte: \\x00 or %00 \u2014 can truncate log entries in C-backed loggers",pattern:/\x00|%00/},{id:"log-ansi-escape",description:"ANSI escape sequence: ESC[ \u2014 can manipulate terminal output when logs are tailed",pattern:/\x1b\[/}],kI=O5;var N5=[{id:"sql-line-comment",description:"SQL line comment: -- followed by whitespace or end of string",pattern:/--(?:\s|$)/},{id:"sql-stacked-query",description:"Stacked queries: semicolon immediately followed by a SQL keyword",pattern:/;\s{0,10}(?:SELECT|INSERT|UPDATE|DELETE|DROP|CREATE|ALTER|EXEC)\b/i},{id:"sql-hex-encoding",description:"Hex-encoded string injection: 0x41414141 style (MySQL)",pattern:/\b0x[0-9a-f]{4,}/i}],C5=[...Jd,...N5],xI=C5;Xa.label="HTML";Qa.label="XML";bI.label="SVG";Jd.label="SQL";xI.label="SQL-STRICT";wI.label="SHELL";$I.label="REDOS";_I.label="NOSQL";kI.label="LOG";var qSe=Object.freeze({HTML:Xa,XML:Qa,SVG:bI,SQL:Jd,"SQL-STRICT":xI,SHELL:wI,REDOS:$I,NOSQL:_I,LOG:kI});function P5(t){if(typeof t!="string")throw new TypeError(`is-unsafe: first argument must be a string, got ${typeof t}`)}a(P5,"assertString");function R5(t){if(!(t instanceof RegExp)){if(Array.isArray(t)){if(t.length===0)throw new TypeError("is-unsafe: context must not be an empty array");if(Array.isArray(t[0])){for(let e of t)if(!Array.isArray(e)||e.length===0)throw new TypeError("is-unsafe: each context in the array must be a non-empty pattern array (PatternList)")}return}throw new TypeError(`is-unsafe: second argument must be a PatternList (e.g. HTML), an array of PatternLists (e.g. [HTML, XML]), or a RegExp. Got: ${typeof t}`)}}a(R5,"assertContext");function j5(t){return t instanceof RegExp?{lists:null,regex:t}:Array.isArray(t[0])?{lists:t,regex:null}:{lists:[t],regex:null}}a(j5,"normalise");function z5(t,e){let n=e.label??"CUSTOM";for(let i of e)if(i.pattern.test(t))return{context:n,id:i.id,description:i.description,pattern:i.pattern};return null}a(z5,"matchList");function Hz(t,e){P5(t),R5(e);let{lists:n,regex:i}=j5(e);if(i)return i.test(t);for(let r of n)if(z5(t,r)!==null)return!0;return!1}a(Hz,"isUnsafe");function D5(t,e){if(!t)return{};let n=e.attributesGroupName?t[e.attributesGroupName]:t;if(!n)return{};let i={};for(let r in n)if(r.startsWith(e.attributeNamePrefix)){let o=r.substring(e.attributeNamePrefix.length);i[o]=n[r]}else i[r]=n[r];return i}a(D5,"extractRawAttributes");function L5(t){if(!t||typeof t!="string")return;let e=t.indexOf(":");if(e!==-1&&e>0){let n=t.substring(0,e);if(n!=="xmlns")return n}}a(L5,"extractNamespace");var Yd=class{static{a(this,"OrderedObjParser")}constructor(e,n){this.options=e,this.currentNode=null,this.tagsNodeStack=[],this.parseXml=Z5,this.parseTextData=M5,this.resolveNameSpace=U5,this.buildAttributesMap=q5,this.isItStopNode=H5,this.replaceEntitiesValue=B5,this.readStopNodeData=J5,this.saveTextToParentTag=K5,this.addChild=V5,this.ignoreAttributesFn=yI(this.options.ignoreAttributes),this.entityExpansionCount=0,this.currentExpandedLength=0,this.doctypefound=!1;let i={...Kd};this.options.entityDecoder?this.entityDecoder=this.options.entityDecoder:(typeof this.options.htmlEntities=="object"?i=this.options.htmlEntities:this.options.htmlEntities===!0&&(i={...dI,...lI}),this.entityDecoder=new Wa({namedEntities:{...i,...n},numericAllowed:this.options.htmlEntities,limit:{maxTotalExpansions:this.options.processEntities.maxTotalExpansions,maxExpandedLength:this.options.processEntities.maxExpandedLength,applyLimitsTo:this.options.processEntities.appliesTo},onInputEntity:a((o,s)=>Hz(s,[Xa,Qa])?Ha.BLOCK:Ha.ALLOW,"onInputEntity")})),this.matcher=new Ya,this.readonlyMatcher=this.matcher.readOnly(),this.isCurrentNodeStopNode=!1,this.stopNodeExpressionsSet=new Ja;let r=this.options.stopNodes;if(r&&r.length>0){for(let o=0;o<r.length;o++){let s=r[o];typeof s=="string"?this.stopNodeExpressionsSet.add(new us(s)):s instanceof us&&this.stopNodeExpressionsSet.add(s)}this.stopNodeExpressionsSet.seal()}}};function M5(t,e,n,i,r,o,s){let c=this.options;if(t!==void 0&&(c.trimValues&&!i&&(t=t.trim()),t.length>0)){s||(t=this.replaceEntitiesValue(t,e,n));let u=c.jPath?n.toString():n,l=c.tagValueProcessor(e,t,u,r,o);return l==null?t:typeof l!=typeof t||l!==t?l:c.trimValues||t.trim()===t?EI(t,c.parseTagValue,c.numberParseOptions):t}}a(M5,"parseTextData");function U5(t){if(this.options.removeNSPrefix){let e=t.split(":"),n=t.charAt(0)==="/"?"/":"";if(e[0]==="xmlns")return"";e.length===2&&(t=n+e[1])}return t}a(U5,"resolveNameSpace");var F5=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function q5(t,e,n,i=!1){let r=this.options;if(i===!0||r.ignoreAttributes!==!0&&typeof t=="string"){let o=Az(t,F5),s=o.length,c={},u=new Array(s),l=!1,d={};for(let m=0;m<s;m++){let g=this.resolveNameSpace(o[m][1]),y=o[m][4];if(g.length&&y!==void 0){let v=y;r.trimValues&&(v=v.trim()),v=this.replaceEntitiesValue(v,n,this.readonlyMatcher),u[m]=v,d[g]=v,l=!0}}l&&typeof e=="object"&&e.updateCurrent&&e.updateCurrent(d);let f=r.jPath?e.toString():this.readonlyMatcher,p=!1;for(let m=0;m<s;m++){let g=this.resolveNameSpace(o[m][1]);if(this.ignoreAttributesFn(g,f))continue;let y=r.attributeNamePrefix+g;if(g.length)if(r.transformAttributeName&&(y=r.transformAttributeName(y)),y=Wz(y,r),o[m][4]!==void 0){let v=u[m],w=r.attributeValueProcessor(g,v,f);w==null?c[y]=v:typeof w!=typeof v||w!==v?c[y]=w:c[y]=EI(v,r.parseAttributeValue,r.numberParseOptions),p=!0}else r.allowBooleanAttributes&&(c[y]=!0,p=!0)}if(!p)return;if(r.attributesGroupName&&!r.preserveOrder){let m={};return m[r.attributesGroupName]=c,m}return c}}a(q5,"buildAttributesMap");var Z5=a(function(t){t=t.replace(/\r\n?/g,`
|
|
212
|
+
`);let e=new dn("!xml"),n=e,i="";this.matcher.reset(),this.entityDecoder.reset(),this.entityExpansionCount=0,this.currentExpandedLength=0,this.doctypefound=!1;let r=this.options,o=new Gd(r.processEntities),s=t.length;for(let c=0;c<s;c++)if(t[c]==="<"){let l=t.charCodeAt(c+1);if(l===47){let d=ec(t,">",c,"Closing Tag is not closed."),f=t.substring(c+2,d).trim();if(r.removeNSPrefix){let m=f.indexOf(":");m!==-1&&(f=f.substr(m+1))}f=SI(r.transformTagName,f,"",r).tagName,n&&(i=this.saveTextToParentTag(i,n,this.readonlyMatcher));let p=this.matcher.getCurrentTag();if(f&&r.unpairedTagsSet.has(f))throw new Error(`Unpaired tag can not be used as closing tag: </${f}>`);p&&r.unpairedTagsSet.has(p)&&(this.matcher.pop(),this.tagsNodeStack.pop()),this.matcher.pop(),this.isCurrentNodeStopNode=!1,n=this.tagsNodeStack.pop()||e,r.captureMetaData&&n&&n.addEndIndex(d+1),i="",c=d}else if(l===63){let d=II(t,c,!1,"?>");if(!d)throw new Error("Pi Tag is not closed.");i=this.saveTextToParentTag(i,n,this.readonlyMatcher);let f=this.buildAttributesMap(d.tagExp,this.matcher,d.tagName,!0);if(f){let p=f[this.options.attributeNamePrefix+"version"];this.entityDecoder.setXmlVersion(Number(p)||1),o.setXmlVersion(Number(p)||1)}if(!(r.ignoreDeclaration&&d.tagName==="?xml"||r.ignorePiTags)){let p=new dn(d.tagName);p.add(r.textNodeName,""),d.tagName!==d.tagExp&&d.attrExpPresent&&r.ignoreAttributes!==!0&&(p[":@"]=f),this.addChild(n,p,this.readonlyMatcher,c),r.captureMetaData&&n.addEndIndex(d.closeIndex+2)}c=d.closeIndex+1}else if(l===33&&t.charCodeAt(c+2)===45&&t.charCodeAt(c+3)===45){let d=ec(t,"-->",c+4,"Comment is not closed.");if(r.commentPropName){let f=t.substring(c+4,d-2);i=this.saveTextToParentTag(i,n,this.readonlyMatcher),n.add(r.commentPropName,[{[r.textNodeName]:f}])}c=d}else if(l===33&&t.charCodeAt(c+2)===68){if(this.doctypefound)throw new Error("Multiple DOCTYPE declarations found.");this.doctypefound=!0;let d=o.readDocType(t,c);this.entityDecoder.addInputEntities(d.entities),c=d.i}else if(l===33&&t.charCodeAt(c+2)===91){let d=ec(t,"]]>",c,"CDATA is not closed.")-2,f=t.substring(c+9,d);i=this.saveTextToParentTag(i,n,this.readonlyMatcher);let p=this.parseTextData(f,n.tagname,this.readonlyMatcher,!0,!1,!0,!0);p==null&&(p=""),r.cdataPropName?n.add(r.cdataPropName,[{[r.textNodeName]:f}]):n.add(r.textNodeName,p),c=d+2}else{let d=II(t,c,r.removeNSPrefix);if(!d){let C=t.substring(Math.max(0,c-50),Math.min(s,c+50));throw new Error(`readTagExp returned undefined at position ${c}. Context: "${C}"`)}let f=d.tagName,p=d.rawTagName,m=d.tagExp,g=d.attrExpPresent,y=d.closeIndex;if({tagName:f,tagExp:m}=SI(r.transformTagName,f,m,r),r.strictReservedNames&&(f===r.commentPropName||f===r.cdataPropName||f===r.textNodeName||f===r.attributesGroupName))throw new Error(`Invalid tag name: ${f}`);n&&i&&n.tagname!=="!xml"&&(i=this.saveTextToParentTag(i,n,this.readonlyMatcher,!1));let v=n;v&&r.unpairedTagsSet.has(v.tagname)&&(n=this.tagsNodeStack.pop(),this.matcher.pop());let w=!1;m.length>0&&m.lastIndexOf("/")===m.length-1&&(w=!0,f[f.length-1]==="/"?(f=f.substr(0,f.length-1),m=f):m=m.substr(0,m.length-1),g=f!==m);let b=null,$={},x;x=L5(p),f!==e.tagname&&this.matcher.push(f,{},x),f!==m&&g&&(b=this.buildAttributesMap(m,this.matcher,f),b&&($=D5(b,r))),f!==e.tagname&&(this.isCurrentNodeStopNode=this.isItStopNode());let T=c;if(this.isCurrentNodeStopNode){let C="";if(w)c=d.closeIndex;else if(r.unpairedTagsSet.has(f))c=d.closeIndex;else{let S=this.readStopNodeData(t,p,y+1);if(!S)throw new Error(`Unexpected end of ${p}`);c=S.i,C=S.tagContent}let Z=new dn(f);b&&(Z[":@"]=b),Z.add(r.textNodeName,C),this.matcher.pop(),this.isCurrentNodeStopNode=!1,this.addChild(n,Z,this.readonlyMatcher,T),r.captureMetaData&&n.addEndIndex(c+1)}else{if(w){({tagName:f,tagExp:m}=SI(r.transformTagName,f,m,r));let C=new dn(f);b&&(C[":@"]=b),this.addChild(n,C,this.readonlyMatcher,T),r.captureMetaData&&n.addEndIndex(y+1),this.matcher.pop(),this.isCurrentNodeStopNode=!1}else if(r.unpairedTagsSet.has(f)){let C=new dn(f);b&&(C[":@"]=b),this.addChild(n,C,this.readonlyMatcher,T),r.captureMetaData&&n.addEndIndex(d.closeIndex+1),this.matcher.pop(),this.isCurrentNodeStopNode=!1,c=d.closeIndex;continue}else{let C=new dn(f);if(this.tagsNodeStack.length>r.maxNestedTags)throw new Error("Maximum nested tags exceeded");this.tagsNodeStack.push(n),b&&(C[":@"]=b),this.addChild(n,C,this.readonlyMatcher,T),n=C}i="",c=y}}}else i+=t[c];return e.child},"parseXml");function V5(t,e,n,i){this.options.captureMetaData||(i=void 0);let r=this.options.jPath?n.toString():n,o=this.options.updateTag(e.tagname,r,e[":@"]);o===!1||(typeof o=="string"&&(e.tagname=o),t.addChild(e,i))}a(V5,"addChild");function B5(t,e,n){let i=this.options.processEntities;if(!i||!i.enabled)return t;if(i.allowedTags){let r=this.options.jPath?n.toString():n;if(!(Array.isArray(i.allowedTags)?i.allowedTags.includes(e):i.allowedTags(e,r)))return t}if(i.tagFilter){let r=this.options.jPath?n.toString():n;if(!i.tagFilter(e,r))return t}return this.entityDecoder.decode(t)}a(B5,"replaceEntitiesValue");function K5(t,e,n,i){return t&&(i===void 0&&(i=e.child.length===0),t=this.parseTextData(t,e.tagname,n,!1,e[":@"]?Object.keys(e[":@"]).length!==0:!1,i),t!==void 0&&t!==""&&e.add(this.options.textNodeName,t),t=""),t}a(K5,"saveTextToParentTag");function H5(){return this.stopNodeExpressionsSet.size===0?!1:this.matcher.matchesAny(this.stopNodeExpressionsSet)}a(H5,"isItStopNode");function W5(t,e,n=">"){let i=0,r=t.length,o=n.charCodeAt(0),s=n.length>1?n.charCodeAt(1):-1,c="",u=e;for(let l=e;l<r;l++){let d=t.charCodeAt(l);if(i)d===i&&(i=0);else if(d===34||d===39)i=d;else if(d===o)if(s!==-1){if(t.charCodeAt(l+1)===s)return c+=t.substring(u,l),{data:c,index:l}}else return c+=t.substring(u,l),{data:c,index:l};else d===9&&!i&&(c+=t.substring(u,l)+" ",u=l+1)}}a(W5,"tagExpWithClosingIndex");function ec(t,e,n,i){let r=t.indexOf(e,n);if(r===-1)throw new Error(i);return r+e.length-1}a(ec,"findClosingIndex");function G5(t,e,n,i){let r=t.indexOf(e,n);if(r===-1)throw new Error(i);return r}a(G5,"findClosingChar");function II(t,e,n,i=">"){let r=W5(t,e+1,i);if(!r)return;let o=r.data,s=r.index,c=o.search(/\s/),u=o,l=!0;c!==-1&&(u=o.substring(0,c),o=o.substring(c+1).trimStart());let d=u;if(n){let f=u.indexOf(":");f!==-1&&(u=u.substr(f+1),l=u!==r.data.substr(f+1))}return{tagName:u,tagExp:o,closeIndex:s,attrExpPresent:l,rawTagName:d}}a(II,"readTagExp");function J5(t,e,n){let i=n,r=1,o=t.length;for(;n<o;n++)if(t[n]==="<"){let s=t.charCodeAt(n+1);if(s===47){let c=G5(t,">",n,`${e} is not closed`);if(t.substring(n+2,c).trim()===e&&(r--,r===0))return{tagContent:t.substring(i,n),i:c};n=c}else if(s===63)n=ec(t,"?>",n+1,"StopNode is not closed.");else if(s===33&&t.charCodeAt(n+2)===45&&t.charCodeAt(n+3)===45)n=ec(t,"-->",n+3,"StopNode is not closed.");else if(s===33&&t.charCodeAt(n+2)===91)n=ec(t,"]]>",n,"StopNode is not closed.")-2;else{let c=II(t,n,!1);c&&((c&&c.tagName)===e&&c.tagExp[c.tagExp.length-1]!=="/"&&r++,n=c.closeIndex)}}}a(J5,"readStopNodeData");function EI(t,e,n){if(e&&typeof t=="string"){let i=t.trim();return i==="true"?!0:i==="false"?!1:gI(t,n)}else return Oz(t)?t:""}a(EI,"parseValue");function SI(t,e,n,i){if(t){let r=t(e);n===e&&(n=r),e=r}return e=Wz(e,i),{tagName:e,tagExp:n}}a(SI,"transformTagName");function Wz(t,e){if(ky.includes(t))throw new Error(`[SECURITY] Invalid name: "${t}" is a reserved JavaScript keyword that could cause prototype pollution`);return Vd.includes(t)?e.onDangerousProperty(t):t}a(Wz,"sanitizeName");var TI=dn.getMetaDataSymbol();function Y5(t,e){if(!t||typeof t!="object")return{};if(!e)return t;let n={};for(let i in t)if(i.startsWith(e)){let r=i.substring(e.length);n[r]=t[i]}else n[i]=t[i];return n}a(Y5,"stripAttributePrefix");function AI(t,e,n,i){return Gz(t,e,n,i)}a(AI,"prettify");function Gz(t,e,n,i){let r,o={};for(let s=0;s<t.length;s++){let c=t[s],u=X5(c);if(u!==void 0&&u!==e.textNodeName){let l=Y5(c[":@"]||{},e.attributeNamePrefix);n.push(u,l)}if(u===e.textNodeName)r===void 0?r=c[u]:r+=""+c[u];else{if(u===void 0)continue;if(c[u]){let l=Gz(c[u],e,n,i),d=eY(l,e);if(Object.keys(l).length===0&&e.alwaysCreateTextNode&&(l[e.textNodeName]=""),c[":@"]?Q5(l,c[":@"],i,e):Object.keys(l).length===1&&l[e.textNodeName]!==void 0&&!e.alwaysCreateTextNode?l=l[e.textNodeName]:Object.keys(l).length===0&&(e.alwaysCreateTextNode?l[e.textNodeName]="":l=""),c[TI]!==void 0&&typeof l=="object"&&l!==null&&(l[TI]=c[TI]),o[u]!==void 0&&Object.prototype.hasOwnProperty.call(o,u))Array.isArray(o[u])||(o[u]=[o[u]]),o[u].push(l);else{let f=e.jPath?i.toString():i;e.isArray(u,f,d)?o[u]=[l]:o[u]=l}u!==void 0&&u!==e.textNodeName&&n.pop()}}}return typeof r=="string"?r.length>0&&(o[e.textNodeName]=r):r!==void 0&&(o[e.textNodeName]=r),o}a(Gz,"compress");function X5(t){let e=Object.keys(t);for(let n=0;n<e.length;n++){let i=e[n];if(i!==":@")return i}}a(X5,"propName");function Q5(t,e,n,i){if(e){let r=Object.keys(e),o=r.length;for(let s=0;s<o;s++){let c=r[s],u=c.startsWith(i.attributeNamePrefix)?c.substring(i.attributeNamePrefix.length):c,l=i.jPath?n.toString()+"."+u:n;i.isArray(c,l,!0,!0)?t[c]=[e[c]]:t[c]=e[c]}}}a(Q5,"assignAttributes");function eY(t,e){let{textNodeName:n}=e,i=Object.keys(t).length;return!!(i===0||i===1&&(t[n]||typeof t[n]=="boolean"||t[n]===0))}a(eY,"isLeafTag");var tc=class{static{a(this,"XMLParser")}constructor(e){this.externalEntities={},this.options=Dz(e)}parse(e,n){if(typeof e!="string"&&e.toString)e=e.toString();else if(typeof e!="string")throw new Error("XML data is accepted in String or Bytes[] form.");if(n){n===!0&&(n={});let o=xy(e,n);if(o!==!0)throw Error(`${o.err.msg}:${o.err.line}:${o.err.col}`)}let i=new Yd(this.options,this.externalEntities),r=i.parseXml(e);return this.options.preserveOrder||r===void 0?r:AI(r,this.options,i.matcher,i.readonlyMatcher)}addEntity(e,n){if(n.indexOf("&")!==-1)throw new Error("Entity value can't have '&'");if(e.indexOf("&")!==-1||e.indexOf(";")!==-1)throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '
'");if(n==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[e]=n}static getMetaDataSymbol(){return dn.getMetaDataSymbol()}};var Jz={validate:xy};var Ji=class extends Error{static{a(this,"XmlError")}name="XmlError"},Xz="#text",Oy=":@",OI=4*1024*1024,tY=/<!DOCTYPE/i,nY=new tc({preserveOrder:!0,ignoreAttributes:!1,attributeNamePrefix:"",attributesGroupName:Oy,parseAttributeValue:!1,parseTagValue:!1,trimValues:!0,processEntities:{enabled:!0,maxEntityCount:100,maxTotalExpansions:1e3,maxExpandedLength:1e4,appliesTo:"external"},htmlEntities:!0});function Qz(t){return t.replace(/\s+/g," ").trim()}a(Qz,"collapseWhitespace");function CI(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}a(CI,"isFxpNode");function rY(t){let e=t[Oy];if(!CI(e))return{};let n={};for(let[i,r]of Object.entries(e))n[i]=String(r);return n}a(rY,"attributesOf");function eD(t,e){let n=t[e],i=Array.isArray(n)?n:[],r=[],o=[];for(let s of i){if(!CI(s))continue;let c=Object.keys(s).find(u=>u!==Oy);if(c!==void 0){if(c===Xz){o.push(String(s[c]));continue}c.startsWith("?")||c.startsWith("!")||r.push(eD(s,c))}}return{name:e,attributes:rY(t),children:r,text:Qz(o.join(" "))}}a(eD,"toElement");function PI(t){if(t.length>OI)throw new Ji(`the document is ${String(t.length)} characters long; the most a descriptor can be is ${String(OI)}`);if(tY.test(t))throw new Ji("the document has a <!DOCTYPE>, and a descriptor never does");let e=Jz.validate(t,{allowBooleanAttributes:!1});if(e!==!0){let{line:r,col:o,msg:s}=e.err;throw new Ji(`not well-formed XML at line ${r}, column ${o}: ${s}`)}let n=nY.parse(t),i=Array.isArray(n)?n:[];for(let r of i){if(!CI(r))continue;let o=Object.keys(r).find(s=>s!==Oy);if(!(o===void 0||o===Xz||o.startsWith("?")||o.startsWith("!")))return eD(r,o)}throw new Ji("the document has no root element")}a(PI,"parseXml");var iY={"&":"&","<":"<",">":">",'"':""","\n":" ","\r":" "," ":"	"};function tD(t){return t.replace(/[&<>"\n\r\t]/g,e=>iY[e]??e)}a(tD,"escapeAttribute");function NI(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}a(NI,"escapeText");var Yz=" ";function nD(t,e,n){let i=Yz.repeat(e),r=Object.entries(t.attributes).map(([s,c])=>` ${s}="${tD(c)}"`).join(""),o=t.text.length>0;if(!o&&t.children.length===0){n.push(`${i}<${t.name}${r}/>`);return}if(o&&t.children.length===0){n.push(`${i}<${t.name}${r}>${NI(t.text)}</${t.name}>`);return}n.push(`${i}<${t.name}${r}>`),o&&n.push(`${i}${Yz}${NI(t.text)}`);for(let s of t.children)nD(s,e+1,n);n.push(`${i}</${t.name}>`)}a(nD,"writeElement");function RI(t){let e=['<?xml version="1.0" encoding="UTF-8"?>'];return nD(t,0,e),`${e.join(`
|
|
213
|
+
`)}
|
|
214
|
+
`}a(RI,"writeXml");var Yi=class extends Error{static{a(this,"VentureParseError")}name="VentureParseError"};function nc(t){let e=PI(t);if(e.name!==cr.tag)throw new Yi(`expected a <${cr.tag}> root element, found <${e.name}>`);let n={diagnostics:[]},i=Fl(e,cr,n),r=Fd.safeParse(i);if(!r.success){let o=r.error.issues[0],s=o===void 0?"":` at ${o.path.join(".")}: ${o.message}`;throw new Yi(`the document is not a valid venture${s}`)}return{venture:r.data,diagnostics:n.diagnostics}}a(nc,"parseVentureDocument");function Ny(t){return nc(t).venture}a(Ny,"parseVenture");function Xd(t){return RI(Wi(t,cr))}a(Xd,"serializeVenture");function Cy(t){return Array.isArray(t)?t.map(String):typeof t=="string"?t.split(/\s+/).filter(e=>e.length>0):[]}a(Cy,"tokens");function rD(t){let e=new Map,n=a((i,r)=>{let o=e.get(i)??[];o.includes(r)||e.set(i,[...o,r])},"claim");for(let i of t.surfaces?.surfaces??[])for(let r of Cy(i.fulfils))n(r,`surfaces/${i.id}`);for(let i of t.systems?.systems??[])for(let r of Cy(i.fulfils))n(r,`systems/${i.id}`);for(let i of t.systems?.resources??[])for(let r of Cy(i.fulfils))n(r,`systems/${i.id}`);for(let i of t.services?.services??[])for(let r of Cy(i.fulfils))n(r,`services/${i.id}`);for(let i of t.roots?.roots??[])i.kind==="vault"&&n("secrets.vault",`roots/${i.id}`),i.kind==="repo"&&i.id!=="hub"&&n("source.repos",`roots/${i.id}`);return e}a(rD,"claimsOf");function Qd(t){let e=rD(t);return(t.expectations?.expects??[]).map(n=>{let i=e.get(n.capability)??[],r=i.length>0?"met":n.status==="not-needed"?"not-needed":"open";return{capability:n.capability,status:r,basis:n.basis,by:i,note:n.note}})}a(Qd,"expectationsOf");function Py(t){return Qd(t).filter(e=>e.status==="open")}a(Py,"openExpectations");var oY="founder";function jI(t){return`${oY}:${t.slice(0,10)}`}a(jI,"founderBasis");function DI(t){return`expectations/expects[${t}]`}a(DI,"expectsRef");function zI(t){return Array.isArray(t)?t.map(String):typeof t=="string"?t.split(/\s+/).filter(e=>e.length>0):[]}a(zI,"tokens");function sY(t,e){let[n,i]=e.split("/",2);if(n==="surfaces"){let r=(t.surfaces?.surfaces??[]).find(o=>o.id===i);return r===void 0?void 0:{fulfils:zI(r.fulfils)}}if(n==="systems"){let r=(t.systems?.systems??[]).find(s=>s.id===i);if(r!==void 0)return{fulfils:zI(r.fulfils)};let o=(t.systems?.resources??[]).find(s=>s.id===i);return o===void 0?void 0:{fulfils:zI(o.fulfils)}}}a(sY,"partOf");function aY(t,e,n){let i=new Set((t.services?.services??[]).map(s=>s.id)),r=e.split(".")[0]??n,o=i.has(r)?n.replace(/[^a-z0-9.-]+/g,"-"):r;if(!i.has(o))return o;for(let s=2;s<50;s+=1)if(!i.has(`${o}-${String(s)}`))return`${o}-${String(s)}`;return`${o}-${n}`}a(aY,"serviceIdFor");function LI(t,e,n){let i=(t.expectations?.expects??[]).find(c=>c.capability===e.capability),r=jI(n);if(e.kind==="add")return i!==void 0?{ok:!1,error:`${e.capability} is already one of this business's expectations.`}:{ok:!0,changeSet:{summary:`Expect ${e.capability}`,operations:[{op:"add-node",parent:"expectations",element:"expects",attributes:{capability:e.capability,basis:r}}]}};if(i===void 0)return{ok:!1,error:`${e.capability} is not one of this business's expectations.`};if(e.kind==="remove")return(i.basis??"").startsWith("founder:")?{ok:!0,changeSet:{summary:`No longer expect ${e.capability}`,operations:[{op:"remove-node",ref:DI(e.capability)}]}}:{ok:!1,error:`${e.capability} came with the business's kind. It can be marked not needed, not removed.`};if(e.kind==="not-needed"){let c=DI(e.capability),u=e.note?.trim()??"";return{ok:!0,changeSet:{summary:`${e.capability} is not needed`,operations:[{op:"set-attr",ref:c,name:"status",value:"not-needed"},{op:"set-attr",ref:c,name:"basis",value:r},...u.length===0?[]:[{op:"set-attr",ref:c,name:"note",value:u}]]}}}if(e.kind==="ours"){let c=sY(t,e.node);if(c===void 0)return{ok:!1,error:`No part of this business is called ${e.node}.`};let u=[...new Set([...c.fulfils,e.capability])].join(" ");return{ok:!0,changeSet:{summary:`${e.node} does ${e.capability}`,operations:[{op:"set-attr",ref:e.node,name:"fulfils",value:u}]}}}let o=e.provider.trim();if(o.length===0)return{ok:!1,error:"A provider takes a name."};let s=aY(t,e.capability,o);return{ok:!0,changeSet:{summary:`${o} does ${e.capability}`,operations:[{op:"add-node",parent:"services",element:"service",attributes:{id:s,provider:o,status:"sketch",fulfils:e.capability,basis:r}}]}}}a(LI,"expectationChangeSet");var Ry="agent-note";function ei(t){return t.state===void 0||t.state==="open"}a(ei,"isOpenFinding");function Xi(t){return(t.findings?.findings??[]).filter(ei)}a(Xi,"openFindings");var iD=["add-node","remove-node","set-attr","move-node"];var UI=["assumption","expectation","finding"];var rc=h.string().min(1).describe("A reference to a node: `systems/condor`, `identity/domain`, `environments/mode[prod]`, a bare id like `db.main` or `p-13`, or a locator like `repo:condor/src/db/`. overview prints the full grammar."),lY=h.object({op:h.enum(iD).describe("add-node, remove-node, set-attr or move-node \u2014 there are no others."),ref:h.string().optional().describe("The node, for remove-node, set-attr and move-node."),parent:h.string().optional().describe("The new parent, for add-node and move-node."),element:h.string().optional().describe("The XML tag, for add-node: realization, item, doc."),attributes:h.record(h.string(),h.string()).optional().describe("Attributes in their XML spelling: sending-domain, fixes-at, not sendingDomain."),name:h.string().optional().describe("The attribute, for set-attr."),value:h.string().nullable().optional().describe("The new value as XML holds it, or null to clear it."),index:h.number().int().optional().describe("Position among the parent\u2019s children of this tag."),body:h.string().optional().describe("Text content, for an element that carries any.")}).describe("One operation."),jy={name:"orient",title:"Start here",description:"What you need to start a session, in one call: what this business is made of (the ids every other tool takes), what is next in its plan, what is open, what a business of its kind is expected to have and nothing on the map provides yet, and what was decided last \u2014 about a fifth of `overview`. **Call this first.** It carries the snapshot it was made from; call it again with `since` set to that snapshot and one line comes back when nothing moved. Then `overview` for the whole map and the reference grammar.",readOnly:!0,model:!1,args:{since:h.string().optional().describe("The snapshot your last `orient` answer carried. Set it to be told only whether anything moved.")}},zy={name:"overview",title:"The business map",description:"The whole venture at sketch altitude: identity, offering, surfaces, systems, resources, services, environments, legal, marketing, milestones, decisions and open findings, one line each \u2014 plus the reference grammar every other tool takes. This product manages the **externalities** a business depends on and does not run, and knows its software only as **modules**, the pieces that are not split further at deploy time; what is inside a module is not here and is not meant to be. **Call this first.** It tells you how things in this venture are addressed, which you cannot guess, and it is what the other tools\u2019 `ref` arguments mean.",readOnly:!0,model:!1,args:{}},Dy={name:"locate",title:"Locate one node",description:'One node in full: its attributes, its realizations in each mode, who consumes it and through what mechanism, what it depends on, the contracts and schemas it publishes, the registered documents about it, the decisions that pin it, and the findings against it \u2014 each with the locator of the code or file behind it. **This is the "where do I look" call**: it ends with the paths to read, and reading them is your job, not the map\u2019s.',readOnly:!0,model:!1,args:{ref:rc}},Ly={name:"query",title:"Query the map",description:'A filtered list of nodes. Every filter is optional and they combine: `facet` (systems, services, surfaces, legal, plan, decisions, \u2026), `kind` (an element \u2014 resource, item, service \u2014 or a kind attribute \u2014 postgres, backend, ios), `status` (sketch, decided, provisioned, verified, or a plan item\u2019s state: todo, blocked, done), `tag` (a document tag, or a word in a node\u2019s id, purpose, note or text), `mode` (keeps what is realized in dev, beta or prod). Use it for "every sketch service", "what is still blocked", "anything about media" \u2014 the questions the overview deliberately does not pre-answer.',readOnly:!0,model:!1,args:{facet:h.string().optional().describe("systems, services, surfaces, legal, plan, decisions, \u2026"),kind:h.string().optional().describe("an element tag or a kind attribute"),status:h.string().optional().describe("a maturity status, or a plan item state"),tag:h.string().optional().describe("a tag, or a word in the node\u2019s own text"),mode:h.string().optional().describe("dev, beta, prod"),limit:h.number().int().positive().max(400).optional().describe("default 60")}},My={name:"consumers",title:"Who depends on this",description:"Everything that would stop working if this node changed, with the mechanism each one depends through (`prisma`, `openapi-generator swift5`) and the locator of the code that does it. `transitive` follows the whole closure and groups the answer by distance. Call this before proposing any change to a node, and before touching the code behind one.",readOnly:!0,model:!1,args:{ref:rc,transitive:h.boolean().optional().describe("Follow the closure instead of stopping at the direct dependents.")}},Uy={name:"mode",title:"How it is realized in a mode",description:"The realization of a resource, system or service in one mode \u2014 the provider, the region, the manifest that realizes it, what it requires first \u2014 and **the names of the secrets it needs, with the vault references that hold them**. Values are never in the map and are never returned; read them from the vault. Omit `ref` to get the whole mode, which is what you want when standing an environment up.",readOnly:!0,model:!1,args:{mode:h.string().min(1).describe("dev, beta, prod \u2014 whichever modes this venture declares."),ref:rc.optional().describe("One node. Omit for the whole mode.")}},Fy={name:"docs",title:"Documents about a node",description:"The registered documents about a node, or carrying a set of tags. The registry holds where a document is, never its text, so the answer is locators for you to read. Ask before writing a design note: another agent\u2019s note from last week is usually already there, and this is how you find it. Give `ref`, `tags`, or both.",readOnly:!0,model:!1,args:{ref:rc.optional().describe("The node the documents are about."),tags:h.array(h.string()).optional().describe('Tags a document must carry all of: ["design", "upload"].')}},qy={name:"register_doc",title:"Register a document",description:"Add a document you have written to the venture\u2019s registry, so the next agent finds it instead of writing it again. `path` is where you wrote it \u2014 a path in this repository, or a locator like `repo:heron/docs/offline-maps.md` for another one. `about` is the nodes it is about, which is how it is found later; without it the document is registered and effectively invisible. Returns a change set the founder accepts \u2014 nothing is written to the venture until they do.",readOnly:!1,model:!1,args:{path:h.string().min(1).describe("Where the document is: `docs/media-upload-flow.md`, or a full locator."),about:h.array(h.string()).min(1).describe('The nodes it is about: ["systems/marmot", "db.main"]. This is how it is found.'),tags:h.array(h.string()).optional().describe('Free tags: ["design", "upload"].'),summary:h.string().optional().describe("One line for the ledger, saying what you wrote.")}},Zy={name:"propose",title:"Propose a change",description:'Propose a change to the venture as a diff. Four operations and no others: `add-node` (parent, element, attributes), `remove-node` (ref), `set-attr` (ref, name, value \u2014 null clears it), `move-node` (ref, parent, index). Refs use the grammar overview prints; attribute names are the XML spelling (`sending-domain`, not `sendingDomain`). A system or resource the business built itself may claim a capability with `fulfils` (`set-attr systems/api fulfils "auth.identity auth.sessions"`): the matrix then lists it as the business\'s own and suggests nothing about it. **This never changes anything by itself** \u2014 it returns a change set the founder accepts or rejects, and one that touches an attribute a decision pins comes back refused with the decision named. Call consumers first: it says who your change would break.',readOnly:!1,model:!1,args:{operations:h.array(lY).min(1).describe("The diff, in order."),summary:h.string().describe("One line saying what it does, for the ledger.")}},Vy={name:"validate",title:"Validate the business",description:"Run the validators over the venture and report what they say: dangling references, an overview over its altitude budget, a mode axis with a hole in it, a credential-shaped attribute. Diagnostics are not findings \u2014 a finding is a contradiction waiting for a decision, a diagnostic is a rule the document breaks. Call this after a change of yours is accepted, to see what it cost.",readOnly:!0,model:!1,args:{}},By={name:"scan",title:"Scan the store roots",description:"Check that the venture\u2019s non-repo artifacts \u2014 the logo master, the signed articles, the App Store screenshots \u2014 are still where the map says they are, by hashing them on this machine. Call it before you rely on an artifact existing, or when a plan item says it produced one. Returns each artifact as verified or missing, with the hash and size of what was found; a missing one raises a finding naming the plan items it blocks. Only declared store roots are read, and only the paths the inventory names plus the folders the root declares as watched.",readOnly:!1,model:!1,args:{root:h.string().optional().describe('Scan only this root, by id: "brand". Every mounted store root when absent.'),adopt:h.boolean().optional().describe("Propose an artifact for each file found in a watched folder that matches none. Left for the founder to accept, with its `about` unwritten. Off by default: reporting a new file is cheap, and claiming it is part of the venture is not yours to claim.")}},Ky={name:"audit",title:"Refresh the map from the code",description:"Read this repository and report what the code actually says \u2014 its **modules** (the pieces that are not split further at deploy time) and the **externalities** they use (a service, or an external item such as a domain or a registration). The manifests, the layout, the contract, the schema, the consumers, the compose services, the deploy shape and where the secrets come from. **Call it after you change something structural**: an externality added or swapped, a module added or removed, a route renamed, a migration written. What agrees with the map is stamped `audited`; what the code has and the map does not becomes a proposal for the founder; what disagrees becomes a finding with **both** sides in it and changes nothing; and an externality this product cannot map becomes a **question** for the founder rather than a silent tally \u2014 the descriptor is never silently overwritten, and no code is ever generated from it. It does not look inside a module and has no opinion about an internal library. Where it looks is this repository, not a path you choose.",readOnly:!1,model:!0,args:{only:h.string().optional().describe('Run one auditor by id: "layout". All of them when absent.')}},Hy={name:"scaffold",title:"The mode scaffold for a system",description:"What the three modes look like in one system\u2019s code: the files that make dev, beta and prod real (a Mode enum, a per-mode config with every secret **name** and no value, one interface per resource and service with a binding per mode), which of them are already there, and \u2014 the part you cannot work out from the repository \u2014 **each service\u2019s mock policy and what it means in each mode**: `never` is real everywhere, `fake` captures in dev, `test-mode` stays off the live account until prod. Call it before writing configuration or a provider client by hand. It writes nothing: `tacticyl scaffold <system> --write` in the repository does, and so does the founder in the app. Files a person has taken over are reported as kept and are never overwritten.",readOnly:!0,model:!1,args:{system:h.string().min(1).describe('The system, by id: "condor". overview lists them under systems.')}},Wy={name:"brief",title:"The brief for one plan item",description:"The work order for one item of the plan, as text: what to do, where it stands, what the map says about the thing it is about, who does it here (Tacticyl, the founder, or you), the credential to mint with its minimum scopes, how completion is checked, where the code lives, and what the estimate rests on. Call this tool before acting on an item, and follow the brief it returns. Omit `item` to get the brief for the next item in the plan.",readOnly:!0,model:!1,args:{item:h.string().min(1).optional().describe("The item id, `p-10`. Omit for the first item the schedule puts next.")}},Gy={name:"questions",title:"What Tacticyl is unsure about",description:"What is still unsure about this business, as one list with an id per line: the values a playbook supplied that nobody has confirmed (each with the attribute it holds, where that came from and the repository it lives in), the capabilities a business of this kind customarily has that nothing on the map provides, and the findings that ask you something. Call it when the founder asks you to settle what the map is unsure about, or before you build on a value that is still a guess. `root` keeps the values that live in one repository; `kind` keeps one of the three lists. Answer one with `settle`.",readOnly:!0,model:!1,args:{root:h.string().optional().describe("A repository, by root id: `condor`. Keeps what lives there and what is about the business as a whole."),kind:h.enum(UI).optional().describe("assumption, expectation or finding. Every kind when absent."),limit:h.number().int().positive().max(400).optional().describe("default 100 per kind")}},FI=["read","propose","apply"];var oD="These values are confirmed by the founder on the Plan page in Tacticyl and cannot be confirmed by an agent.";function qI(t){return`${t}
|
|
215
|
+
|
|
216
|
+
${oD}
|
|
217
|
+
`}a(qI,"fixesAnswer");var MI=["take-code","keep-descriptor","defer","confirm-note","dismiss-note"],sD={"claude-code":"Claude Code",codex:"Codex",cursor:"Cursor"};function ZI(t){return sD[t]??t}a(ZI,"harnessName");function VI(t){if(t.state!=="done"){let e=t.failed===void 0?"":`
|
|
218
|
+
${t.failed}`;return`${t.item} is still in progress. A finding on this item shows what the check found, and the founder can see it on the Plan.${e}`}return t.method==="human-attest"?`${t.item} is done on ${t.agent}'s word and shows as attested by ${t.agent}.`:`${t.item} is done and verified.`}a(VI,"completeLine");var Jy={name:"complete_item",title:"Mark a plan item done",description:"Call this after you have done what the item's brief says, and use `evidence` for one line describing what you did, which is kept with the claim. This is accepted only when the business lets its agents apply changes; under `propose` or `read` it is refused, and the founder marks the item done on the Plan. If the item has a check, such as a DNS lookup, a page that must exist, a health check or a provider's own records, Tacticyl will run it: if the check passes, the item is done and verified, and if not, the item stays in progress and a finding names what the check found. If the item has no check Tacticyl can run, the item is done on your word and shows as attested by you. An item that makes a value permanent, such as a bundle id or a domain, is refused until the founder confirms those values in the app, and you cannot confirm them.",readOnly:!1,model:!1,args:{item:h.string().min(1).describe("The item id, `p-10`. brief with no item names the next one."),evidence:h.string().optional().describe('One line on what you did: "added the DNS records; dig answers".')}},Yy={name:"raise_finding",title:"Raise a finding",description:"Tell the founder about something the map gets wrong or leaves out, as a finding on the node or plan item it is about: a dependency the map does not list, an item that cannot be done as written, a value that is no longer true. It is your note, raised with your name; the founder confirms or dismisses it. Prefer propose when you know the fix; raise a finding when the founder has to decide. Under propose it waits in the ledger for the founder to accept.",readOnly:!1,model:!1,args:{about:rc.describe("The node or item it is about: `services/payments`, `p-10`."),text:h.string().min(1).describe("What is wrong, in one or two sentences, with the evidence.")}},Xy={name:"answer_finding",title:"Answer a question finding",description:"Answer a finding that asks something (an externality the audit could not map, a repository the map does not declare). `answer` is one of: `is-provider` (with `provider`, a catalogue id), `is-new` (with `name` and `capability`), `ours` (with `node`, a system or resource of the business such as `systems/api`, and optionally `capability`: the business built this, the node covers it, and the service assumed for it goes), `integration` (with `name`: a platform the product offers its users, which is its own capability and is never consolidated), `not-an-externality`, `later`, `research`; or for a repository, `add-root` or `not-a-root`. locate the finding first: it lists the answers it takes. Under propose the answer waits in the ledger for the founder to accept.",readOnly:!1,model:!1,args:{finding:h.string().min(1).describe("The finding id, `f-012`."),answer:h.string().min(1).describe("is-provider, is-new, ours, integration, not-an-externality, later, research, add-root, not-a-root."),provider:h.string().optional().describe("For is-provider: the catalogue id, `stripe`."),name:h.string().optional().describe("For is-new and integration: what the founder calls it."),capability:h.string().optional().describe("For is-new, and optionally for ours: a capability id, `auth.sessions`."),node:h.string().optional().describe("For ours: the system or resource that does it, `systems/api`."),hint:h.string().optional().describe("A line of context, kept on the finding.")}},Qy={name:"resolve_finding",title:"Resolve a finding",description:"Resolve a finding by choosing a side. `how` is one of: `take-code` (the code is right; the map changes to match), `keep-descriptor` (the map is right; needs `reason`, and records a decision), `defer` (not now; needs `revisit`, the trigger that brings it back), and for a note an agent left, `confirm-note` or `dismiss-note`. A finding offers only some of these; locate it first. Under propose the resolution waits in the ledger for the founder to accept.",readOnly:!1,model:!1,args:{finding:h.string().min(1).describe("The finding id, `f-004`."),how:h.enum(MI).describe(MI.join(", ")),reason:h.string().optional().describe("Why, for keep-descriptor (required) and defer."),revisit:h.string().optional().describe("What brings it back, for defer (required).")}},ev={name:"decide",title:"Record a decision",description:"Record a decision: what was chosen and why, and optionally the attributes it holds in place (`pins`). A pinned attribute cannot be changed by any later proposal until the decision is superseded, so pin only what was really decided. Call it when the founder told you something was settled, or after you chose between two options the map should remember. Under propose it waits in the ledger for the founder to accept.",readOnly:!1,model:!1,args:{what:h.string().min(1).describe('What was decided, in one line: "Postgres on Neon for beta".'),why:h.string().min(1).describe("Why, in one line, including what was rejected."),pins:h.array(h.string()).optional().describe('Attributes held in place: ["db.main@provider"]. Omit to pin nothing.')}},tv={name:"expect",title:"What this business is expected to have",description:"The capabilities a business of this kind customarily has, and where this one stands on each: met by a part or a service on the map, open, or marked not needed. `list` reads them. The other actions settle an open one and are proposals like every other write: `ours` names the part of the business that already does it (its `fulfils` gains the capability), `provider` names the vendor that does it (a service is added), `not-needed` records that it is not, with an optional note; `add` watches for a capability of your own (`ai.text`), and `remove` takes one of those back. Call `list` after you have built something that answers one, and claim it with `ours`.",readOnly:!1,model:!1,args:{action:h.enum(["list","ours","provider","not-needed","add","remove"]).describe("What to do: list, ours, provider, not-needed, add or remove."),capability:h.string().optional().describe("The capability id, `family.member`: `mail.transactional`. Every action but list."),node:h.string().optional().describe("For ours: the part that does it, as a reference: `systems/api`, `surfaces/web`."),provider:h.string().optional().describe("For provider: the catalogue id, or your own name for the vendor."),note:h.string().optional().describe("For not-needed: one line on why, if there is one.")}},dY=h.discriminatedUnion("kind",[h.object({kind:h.literal("dependency").describe("A package added to or removed from a manifest."),action:h.enum(["added","removed"]).describe("added or removed."),package:h.string().min(1).describe("The package as the manifest spells it: `stripe`, `io.sentry:sentry`."),ecosystem:h.string().min(1).describe("npm, pypi, gradle, maven, sbt, swift."),path:h.string().optional().describe("The manifest, relative to the repository: `sportal-server/build.gradle.kts`. Omit for the root manifest.")}),h.object({kind:h.literal("module").describe("A module added to or removed from the repository."),action:h.enum(["added","removed"]).describe("added or removed."),path:h.string().min(1).describe("Its directory, relative to the repository: `worker`."),runs:h.enum(["system","surface"]).optional().describe("Whether it runs on its own (system) or a person opens it (surface). Default system."),stack:h.string().optional().describe("Language and framework: `typescript/node (hono)`.")}),h.object({kind:h.literal("migration").describe("A migration written: the tables the directory now creates."),directory:h.string().min(1).describe("The migration directory, relative to the repository: `db/galaxy`."),tables:h.array(h.string().min(1)).min(1).describe("Every table the directory creates, after this change."),destructive:h.boolean().optional().describe("True if this change drops a table or a column.")}),h.object({kind:h.literal("fulfils").describe("A part of the business now does a capability itself."),node:h.string().min(1).describe("The part, as a reference: `systems/api`."),capability:h.string().min(1).describe("The capability id: `auth.sessions`.")}),h.object({kind:h.literal("note").describe("Anything else worth the founder reading, in one sentence."),text:h.string().min(1).max(400).describe("One sentence."),about:h.string().optional().describe("The part it is about, as a reference, if one.")}),h.object({kind:h.literal("caveat").describe("Something that went wrong when touching a part, and will again."),node:h.string().min(1).describe("The part, as a reference: `systems/api`, `roots/condor`, `p-12`."),text:h.string().min(1).max(200).describe("One sentence, up to 200 characters: what to do or not do, and why."),cites:h.string().optional().describe("The file that enforces or explains it, relative to this repository.")})]),nv={name:"report",title:"Say what you changed",description:"Tell the business what you just did to its repository, as events, and each becomes the ledger change or the finding an audit would have made \u2014 under your name, waiting for the founder unless they let you apply. Call it after a task, once, with every event in one call: a dependency added or removed, a module added or removed, a migration written, a capability a part now does itself, a caveat (something that bit you touching a part, so the next session is told before it touches it), or a note. Nothing you report is dropped: what no rule can place is raised as a note for the founder. This replaces the inbox line when you have this tool.",readOnly:!1,model:!1,args:{events:h.array(dY).min(1).describe("What you did, one event each.")}},fY=h.object({path:h.string().min(1).describe("A file, relative to this repository: `docs/ARCHITECTURE.md`."),line:h.number().int().positive().optional().describe("The line the answer is on, 1-based."),excerpt:h.string().max(200).optional().describe("The words on that line, exactly as the file has them, up to 200 characters.")}).describe("One file, with the line and the words that show the answer."),aD=["confirm","correct","ours","provider","not-needed","is-provider","is-new","integration","not-an-externality","later","research","add-root","not-a-root"],rv={name:"settle",title:"Answer what Tacticyl is unsure about",description:"Answer one of the questions `questions` lists, with the file in this repository that shows it. `question` is the id on the line; `how` is one of the answers the line offers: for an assumed value, `confirm` (the value is right) or `correct` (with `value`, what it should be); for an expectation, `ours` (with `node`), `provider` (with `provider`) or `not-needed`; for a finding, the answer `answer_finding` takes, with `provider`, `name`, `capability` or `node` as that answer needs. `evidence` is required: one to five files, each with the line and an exact excerpt, checked here before anything is sent, and an answer no file shows is refused. It is a proposal like every other write: the founder accepts or rejects it on the Assumptions page, and the file stays with the value as where it came from. Two files that disagree are a finding (`raise_finding`), not an answer.",readOnly:!1,model:!1,args:{question:h.string().min(1).describe("The id `questions` printed: `a:services/payments`."),how:h.enum(aD).describe("One of the answers the question\u2019s line offers."),value:h.string().optional().describe("For correct: the value the file shows."),node:h.string().optional().describe("For ours: the part of the business that does it, `systems/api`."),provider:h.string().optional().describe("For provider and is-provider: the catalogue id, or your own name for the vendor."),name:h.string().optional().describe("For is-new and integration: what the founder calls it."),capability:h.string().optional().describe("For is-new, and optionally ours on a finding: a capability id, `auth.sessions`."),evidence:h.array(fY).max(5).optional().describe("The files that show the answer. Required; one to five."),note:h.string().max(400).optional().describe("One line of context, kept with the answer.")}},cD="It can take a few seconds.";function BI(t){return t.model?`${t.description} ${cD}`:t.description}a(BI,"toolDescription");var uD=[jy,zy,Dy,Ly,My,Uy,Fy,qy,Zy,Vy,By,Ky,Hy,Wy,Gy,Jy,Yy,Xy,Qy,ev,tv,nv,rv],KI=uD.map(t=>t.name);function ti(t,e){switch(e){case"unknown-root":return`points into the root "${Bi(t)?Ki(t).root:t}", which <roots> does not declare`;case"unknown-node":return`names "${t}", which is not a node in this venture`;case"unknown-member":return`names "${t}", and that node has no "${Gi(t).member??""}"`}}a(ti,"describeRefProblem");var nt={danglingRef:"validate.dangling-ref",unknownRoot:"validate.unknown-root",unknownMode:"validate.unknown-mode",realizationUnknownMode:"validate.realization-unknown-mode",secretValue:"validate.secret-value",altitudeEntityFields:"validate.altitude-entity-fields",altitudeRouteList:"validate.altitude-route-list",overviewSize:"validate.overview-size",planCycle:"validate.plan-cycle",requiresUnknown:"validate.requires-unknown",fixesAtUnknown:"validate.fixes-at-unknown",pinsUnknown:"validate.pins-unknown",requiredByUnknown:"validate.required-by-unknown",assumedWithoutBasis:"validate.assumed-without-basis",badId:"validate.bad-id",urlScheme:"validate.url-scheme",caveats:"validate.caveats"};var hY=new Set(["field","attr","attribute","column","property"]),gY=new Set(["route","endpoint","operation"]),CIe=[{names:hY,code:nt.altitudeEntityFields,why:"A stored thing's shape is audited from the file its <schema authoritative=\u2026> names, never authored here"},{names:gY,code:nt.altitudeRouteList,why:"Routes live in the file the contract's authoritative= names, are audited, and are never authored here"}];var lD=["app-icon","icon-128","feature-graphic","logo","brand-sheet","screenshots-ios","screenshots-android","store-screenshots","articles-of-organization","ein-letter","duns-confirmation","w9","privacy-policy","terms","community-guidelines"],HI=["dns-resolves","https-health","url-contains","artifact-present","page-exists","human-attest","provider-state"],dD=/^(assisted|human|agent|adapter:[a-z0-9][a-z0-9-]*(\.[a-z0-9-]+)+)$/,WI=/^P(?!$)(\d+Y)?(\d+M)?(\d+W)?(\d+D)?(T(?!$)(\d+H)?(\d+M)?(\d+S)?)?$/,fD=/^[a-z0-9]+(-[a-z0-9]+)*(\.[a-z0-9]+(-[a-z0-9]+)*)+$/;function Qi(t){return e=>{let n=[];for(let i of e.index){let r=t.refs===void 0?e.tokens(i,t.field):t.refs(i);for(let o of r){if(t.accept?.(o)===!0)continue;let s=e.checkRef(o);s!==null&&n.push({code:t.code,severity:"error",message:t.message(i,o,s),path:i.path,ref:o})}}return n}}a(Qi,"attributeRule");var wY=Qi({field:"fixesAt",code:nt.fixesAtUnknown,refs:a(t=>ql(t.node),"refs"),accept:a(t=>t==="never","accept"),message:a((t,e,n)=>`<${t.tag}> fixes-at ${ti(e,n)}.`,"message")});var $Y=48;function GI(t,e="repo"){let n=t.toLowerCase().replace(/[^a-z0-9.]+/g,"-").replace(/^[^a-z0-9]+/,"").slice(0,$Y).replace(/[.-]+$/,"");return n.length===0?e:n}a(GI,"slugIdOf");var _Y=Qi({field:"pins",code:nt.pinsUnknown,message:a((t,e,n)=>`<${t.tag}> pins ${ti(e,n)}.`,"message")});var kY=Qi({field:"requiredBy",code:nt.requiredByUnknown,message:a((t,e,n)=>`<${t.tag}> required-by ${ti(e,n)}.`,"message")});var xY=Qi({field:"requires",code:nt.requiresUnknown,message:a((t,e,n)=>`<${t.tag}> requires ${ti(e,n)}.`,"message")});var IY=h.enum(by),iv=h.object({title:h.string().min(1),url:h.string().regex(/^https?:\/\/\S+$/,"a source url is http(s)").optional(),customary:h.boolean().default(!1),at:h.string().optional()}),ic=h.string().regex(fD,"a template id is dotted: `<playbook>.<name>`"),pD=h.union([h.string().min(1),h.array(h.string().min(1)).min(1)]),EY=h.string().regex(dD,"an executor is assisted, human, agent, or adapter:<provider>.<capability>"),mD=h.string().regex(WI,"a lead is an ISO 8601 duration"),TY=h.string().regex(WI,"an effort is an ISO 8601 duration"),AY=h.enum(HI),OY=h.enum(lD),NY=["low","medium","high"],ov=h.enum(NY),CY=["node","venture"],GTe=h.object({id:ic,do:h.string().min(1),when:pD,per:h.enum(CY).default("node"),alias:ic.optional(),requires:h.array(h.string().min(1)).default([]),unlocks:h.array(h.string().min(1)).default([]),lead:mD.optional(),effort:TY.optional(),cost:h.string().min(1).optional(),scarce:h.boolean().default(!1),reversible:h.boolean().default(!0),executor:EY,sets:h.array(h.string().min(1)).default([]),produces:h.array(OY).default([]),fixes:h.array(h.string().min(1)).default([]),verify:AY,"needed-by":h.string().min(1).optional(),"owed-when":h.enum(["users"]).optional(),mock:h.record(h.string(),IY).optional(),"basis-note":h.string().min(1),sources:h.array(iv).default([]),confidence:ov.optional(),note:h.string().min(1).optional(),destination:h.string().regex(/^https?:\/\/\S+$/,"a destination is one http(s) url").optional(),prepare:h.array(h.string().min(1)).optional(),"done-when":h.string().min(1).optional(),"review-at":h.string().min(1).optional()}).strict();var PY=h.object({do:h.string().min(1),cost:h.string().min(1),sets:h.string().min(1).optional(),value:h.string().min(1).optional(),note:h.string().min(1).optional()}).strict(),JTe=h.object({id:ic,"applies-if":h.string().min(1),exposure:h.string().min(1),enforcer:h.string().min(1),likelihood:h.string().min(1),options:h.array(PY).default([]),revisit:h.string().min(1),"basis-note":h.string().min(1).optional(),sources:h.array(iv).default([]),confidence:ov.optional()}).strict(),YTe=h.object({id:ic,"applies-to":h.string().min(1),"only-if":pD.optional(),text:h.string().min(1),finding:h.string().min(1).optional(),remedy:ic.optional(),"owed-when":h.enum(["users"]).optional(),"basis-note":h.string().min(1),sources:h.array(iv).default([]),confidence:ov.optional()}).strict(),RY=h.object({choose:h.string().regex(/^[a-z0-9]+(-[a-z0-9]+)*$/,"a choice is a lowercase hyphenated word"),do:h.string().min(1),cost:h.string().min(1).optional(),lead:mD.optional(),consequence:h.string().min(1).optional(),match:h.array(h.string().min(1)).default([])}).strict(),XTe=h.object({id:ic,ask:h.string().min(1),default:h.string().min(1),options:h.array(RY).default([]),"basis-note":h.string().min(1),sources:h.array(iv).default([]),confidence:ov.optional()}).strict();var aAe=new Map(j0.map((t,e)=>[t,e]));function JI(t){let e=(t.users??"").trim().toLowerCase();return q0.includes(e)?e:"none"}a(JI,"modeUsers");function YI(t){let e=(t.data??"").trim().toLowerCase();return Z0.includes(e)?e:"none"}a(YI,"modeData");var UY=1/24;function QI(t,e=[]){let n=0,i=a(r=>{let o=/^f-(\d+)$/.exec(r);o!==null&&(n=Math.max(n,Number(o[1])))},"take");for(let r of t.findings?.findings??[])i(r.id);for(let r of e)i(r);return r=>`f-${String(n+1+r).padStart(3,"0")}`}a(QI,"nextFindingId");function eE(t){let e=0;for(let n of t.decisions?.decisions??[]){let i=/^d-(\d+)$/.exec(n.id);i!==null&&(e=Math.max(e,Number(i[1])))}return n=>`d-${String(e+1+n).padStart(3,"0")}`}a(eE,"nextDecisionId");var Ie=class{static{a(this,"Lines")}out=[];add(e){return e!==void 0&&e.length>0&&this.out.push(e),this}addAll(e){for(let n of e)this.add(n);return this}blank(){return this.out.length>0&&this.out[this.out.length-1]!==""&&this.out.push(""),this}heading(e){return this.blank().add(`## ${e}`)}get length(){return this.out.length}toString(){let e=[...this.out];for(;e.length>0&&e[e.length-1]==="";)e.pop();return e.length===0?"":`${e.join(`
|
|
219
|
+
`)}
|
|
220
|
+
`}};function ur(...t){let e=t.filter(n=>n!==void 0&&n.length>0);return e.length===0?void 0:e.join(" ")}a(ur,"facts");function Ge(t,e){if(t===void 0)return;let n=t.replace(/\s+/g," ").trim();if(n.length<=e)return n.length===0?void 0:n;let i=n.slice(0,e),r=i.lastIndexOf(" ");return`${(r>e*.6?i.slice(0,r):i).trimEnd()}\u2026`}a(Ge,"clip");function Me(t,e,n=`${e}s`){return`${String(t)} ${t===1?e:n}`}a(Me,"count");function eo(t,e){let n=new Map;for(let i of t){let r=e(i),o=n.get(r);o===void 0?n.set(r,[i]):o.push(i)}return n}a(eo,"groupBy");var ef="Before you touch this:";function av(t){let e=t.caveats;return Array.isArray(e)?e:[]}a(av,"caveatsOf");function cv(t){let e=[Ge(t.text,200)??""];t.cites!==void 0&&t.cites.length>0&&e.push(`cites ${t.cites}`);let n=[t.by,t.since].filter(i=>i!==void 0&&i.length>0);return n.length>0&&e.push(n.join(", ")),`- ${e.join(" \xB7 ")}`}a(cv,"caveatLine");function tf(t,e=""){let n=av(t);return n.length===0?[]:[`${e}${ef}`,...n.map(i=>`${e}${cv(i)}`)]}a(tf,"caveatLines");var wD=require("node:crypto");function to(t){return(0,wD.createHash)("sha256").update(t,"utf8").digest("hex")}a(to,"hashXml");function uv(t){return to(Xd(t))}a(uv,"canonicalHash");var $D="[withheld: credential-shaped value; the map stores names, not values]",VY=/^(sha256|sha1|sha512|md5|fp):/i,BY=/^(vault:)?op:\/\//i,KY=[/-----BEGIN [A-Z ]*PRIVATE KEY-----/,/\bsk-[A-Za-z0-9_-]{16,}/,/\b(sk|pk|rk)_(live|test)_[A-Za-z0-9]{12,}/,/\bgh[pousr]_[A-Za-z0-9]{20,}/,/\bxox[abposr]-[A-Za-z0-9-]{10,}/,/\bAKIA[0-9A-Z]{16}\b/,/\bAIza[0-9A-Za-z_-]{20,}/,/\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}/,/\b[a-z][a-z0-9+.-]*:\/\/[^\s:@/]+:[^\s:@/]{6,}@/],HY=/(^|[^A-Za-z0-9+/_=-])[A-Za-z0-9+/_-]{32,}={0,2}([^A-Za-z0-9+/_=-]|$)/;function WY(t){let e=HY.exec(t)?.[0]?.replace(/^[^A-Za-z0-9]|[^A-Za-z0-9=]$/g,"")??"";return e.length<32?!1:Number(/[a-z]/.test(e))+Number(/[A-Z]/.test(e))+Number(/[0-9]/.test(e))>=3}a(WY,"highEntropy");function _D(t){let e=t.trim();return e.length===0||VY.test(e)||BY.test(e)?!1:KY.some(n=>n.test(e))?!0:WY(e)}a(_D,"looksLikeSecret");function no(t){if(t!==void 0)return _D(t)?$D:t}a(no,"safeValue");var tE=["name","mode","fp","home","status"];var nE="Addressing: every tool takes a ref. A ref is `facet/id` (`systems/condor`, `surfaces/ios`), `facet/tag` (`identity/domain`), `facet/tag.id` (`legal/risk.gdpr`), `facet/tag[key]` (`environments/mode[prod]`, `identity/handle[instagram]`, `offering/pricing[pro]`), a bare id where it is unique (`db.main`, `p-13`, `d-002`, `f-003`, `art:brand/app-icon`), `kind:id` (`milestone:beta`, `finding:f-003`), a facet name alone (`roots`, `plan`), a venture attribute (`namespace`), or a locator naming a root and a path within it (`repo:condor/src/db/`, `store:legal/Cairn/Legal/`, `account:apple/enrollment`, `vault:op://aerie/clerk-dev/credential`). Append `@member` to name one attribute or child rather than the whole node (`surfaces/ios@bundle`, `surfaces/ios@listing`, `p-13@requires`); `facet/*` names every node in a facet. Paths in this map are locators, not filesystem paths: `repo:<root>/<path>` is `<path>` inside the repository that root names.";var GY=new Map([["purpose",100],["text",200],["summary",140],["do",120],["what",140],["why",140],["note",140],["applies-if",80],["exposure",80],["likelihood",80],["consequence",100],["enforcer",60],["advisor",100]]),JY=new Set(["note","why","audited","verified-by","basis","advisor"]),YY=new Set(["audited"]);function XY(t){let e=t.node.body;return typeof e=="string"&&e.trim().length>0?e:void 0}a(XY,"bodyOf");function QY(t){let e=t.node.extraAttributes;return typeof e=="object"&&e!==null?e:{}}a(QY,"extraAttributes");function rE(t){let e=no(t)??"";return/[\s"]/.test(e)?JSON.stringify(e):e}a(rE,"value");function kD(t,e){let n=GY.get(t),i=n===void 0?e:Ge(e,n);return i===void 0?void 0:`${t}=${rE(i)}`}a(kD,"part");function ls(t,e){let n=e==="overview"?JY:YY,i=t.tag==="secret"?new Set(tE):void 0,r=[],o=0;for(let c of t.binding.attributes){let u=Rr(c),l=De(t,u);if(l===void 0)continue;if(i!==void 0&&!i.has(u)){o+=1;continue}if(n.has(u))continue;let d=kD(u,l);d!==void 0&&r.push(d)}for(let[c,u]of Object.entries(QY(t))){if(i!==void 0&&!i.has(c)){o+=1;continue}if(e==="overview"||n.has(c))continue;let l=kD(c,u);l!==void 0&&r.push(l)}let s=XY(t);if(s!==void 0&&i===void 0){let c=Ge(s,e==="overview"?120:400);c!==void 0&&r.push(`: ${no(c)??""}`)}else s!==void 0&&(o+=1);return o>0&&r.push(`(+${String(o)} withheld)`),r}a(ls,"attributeParts");function yt(t,e,n={}){let i=ls(e,n.altitude??"overview"),r=n.bare===!0?e.tag:`${un(t,e.path)} (${e.tag})`;return`${n.indent??""}${[r,...i].join(" ")}`}a(yt,"nodeLine");function pn(t,e,n){let i=t.index.find(r=>r.depth===1&&r.tag===e);return i===void 0?[]:t.index.filter(r=>r.parentPath===i.path&&(n===void 0||r.tag===n))}a(pn,"facetNodes");function St(t,e,n){return t.index.filter(i=>i.parentPath===e.path&&(n===void 0||i.tag===n))}a(St,"childNodes");function nf(t,e){return un(t,e.path)}a(nf,"refFor");var e8=["identity","offering","surfaces","systems","services","environments","legal","marketing"],xD=new Set(["realization","consumer","client","secret","caveat"]);function vt(t,e){return no(De(t,e))}a(vt,"text");function t8(t,e){let n=St(t,e,"realization").map(i=>{let r=vt(i,"via")??vt(i,"ref")??"unstated",o=vt(i,"status");return`${vt(i,"mode")??"?"}=${r}${o===void 0?"":` (${o})`}`});return n.length===0?void 0:`modes: ${n.join(", ")}`}a(t8,"realizations");function n8(t,e){let n=St(t,e,"consumer").map(i=>{let r=vt(i,"system")??vt(i,"surface")??"unstated",o=vt(i,"via"),s=vt(i,"path");return ur(r,o===void 0?void 0:`via ${o}`,s===void 0?void 0:`at ${s}`)});return n.length===0?void 0:`consumers: ${n.join(", ")}`}a(n8,"consumers");function r8(t,e){let n=St(t,e,"secret").map(i=>{let r=vt(i,"mode");return`${vt(i,"name")??"?"}${r===void 0?"":`(${r})`}`});return n.length===0?void 0:`secrets: ${n.join(", ")}`}a(r8,"secrets");function i8(t,e){let n=St(t,e,"client").map(i=>{let r=vt(i,"generator"),o=vt(i,"home");return ur(vt(i,"surface")??"?",r===void 0?void 0:`via ${r}`,o===void 0?void 0:`at ${o}`)});return n.length===0?void 0:`clients: ${n.join(", ")}`}a(i8,"clients");function o8(t,e,n=""){let i=[yt(t,e,{indent:n})];for(let r of[t8(t,e),n8(t,e),r8(t,e)])r!==void 0&&i.push(`${n} ${r}`);for(let r of St(t,e)){if(xD.has(r.tag))continue;i.push(yt(t,r,{indent:`${n} `,bare:!0}));let o=i8(t,r);o!==void 0&&i.push(`${n} ${o}`);for(let s of St(t,r))xD.has(s.tag)||s.tag==="client"||i.push(yt(t,s,{indent:`${n} `,bare:!0}))}return i}a(o8,"nodeWithChildren");function s8(t){return[...eo(pn(t,"roots","root"),n=>vt(n,"kind")??"unstated")].map(([n,i])=>{let r=i.map(o=>{let s=o.id??"?",c=vt(o,"provider")??vt(o,"share"),u=vt(o,"status");return`${s}${c===void 0?"":` (${c})`}${u===void 0?"":` [${u}]`}`});return`${n}: ${r.join(", ")}`})}a(s8,"rootLines");function a8(t){let e=pn(t,"plan","milestone"),n=pn(t,"plan","item");if(e.length===0&&n.length===0)return[];let r=[...eo(n,o=>vt(o,"state")??"todo")].map(([o,s])=>`${String(s.length)} ${o}`).join(", ");return[...e.map(o=>yt(t,o)),n.length===0?"":`${Me(n.length,"plan item")} (${r}) \xB7 call query kind=item`].filter(o=>o.length>0)}a(a8,"planLines");function rf(t,e={}){let n=We(t),i=n.venture,r=new Ie;r.add([`# ${i.name}`,ur(i.stage===void 0?void 0:`stage=${i.stage}`,i.namespace===void 0?void 0:`namespace=${i.namespace}`,i.hub===void 0?void 0:`hub=${rE(An(i.hub))}`)].filter(l=>l!==void 0&&l.length>0).join(" \xB7 ")),e.grammar!==!1&&r.blank().add(nE);let o=s8(n);o.length>0&&r.heading("Roots").addAll(o);for(let l of e8){let d=pn(n,l);if(d.length!==0){r.heading(l);for(let f of d)r.addAll(o8(n,f))}}let s=a8(n);s.length>0&&r.heading("plan").addAll(s);let c=pn(n,"decisions","decision");c.length>0&&r.heading("decisions").addAll(c.map(l=>yt(n,l)));let u=Xi(i);return u.length>0&&r.heading("open findings").addAll(u.map(l=>{let d=n.index.find(p=>p.tag==="finding"&&p.id===l.id);return`${d===void 0?l.id??"?":nf(n,d)} ${Ge(l.text,140)??"(no text)"}`})),e.nextSteps!==!1&&r.blank().add("Next: locate <ref> for one node in full (realizations, consumers, contracts, docs, decisions, findings, and the paths to read); consumers <ref> for who breaks if it changes; query for a filtered list; mode <mode> <ref> for how it is realized; docs for what has been written about it. Change it with propose or register_doc. Both create a proposal that takes effect when a person accepts it."),r.toString()}a(rf,"renderOverview");var ds={items:5,findings:8,expectations:8,decisions:5};function iE(t,e,n){let i=t-e;return i>0?[`\u2026 and ${Me(i,n)} more.`]:[]}a(iE,"more");function lv(t,e,n){let i=pn(t,e,n);if(i.length===0)return;let r=i.map(o=>{let s=De(o,"kind")??De(o,"provider");return s===void 0?o.id:`${o.id} (${s})`});return`${n==="resource"?"resources":e}: ${r.join(", ")}`}a(lv,"partsLine");function oE(t,e={}){let n=We(t),i=n.venture,r=new Ie;if(e.since!==void 0&&e.since===e.snapshot)return`Unchanged since \`${e.snapshot}\`. Nothing on the map moved; what you read last still holds.`;r.add([`# ${i.name}`,i.stage===void 0?void 0:`stage=${i.stage}`].filter(l=>l!==void 0).join(" \xB7 ")),e.snapshot!==void 0&&r.add(`Snapshot \`${e.snapshot}\`.`),r.blank().add("## What it is");for(let l of[lv(n,"surfaces","surface"),lv(n,"systems","system"),lv(n,"systems","resource"),lv(n,"services","service")])l!==void 0&&r.add(`- ${l}`);let o=(i.plan?.items??[]).filter(l=>l.state!=="done");if(o.length>0){r.blank().add("## Next");for(let l of o.slice(0,ds.items))r.add(`- ${l.id} ${Ge(l.do,100)??""}${l.state===void 0?"":` \xB7 ${l.state}`}`);r.addAll(iE(o.length,ds.items,"item"))}let s=Xi(i);if(s.length>0){r.blank().add("## Open findings");for(let l of s.slice(0,ds.findings)){let d=n.index.find(p=>p.tag==="finding"&&p.id===l.id),f=d===void 0?l.id??"?":nf(n,d);r.add(`- ${f} ${Ge(l.text,120)??"(no text)"}`)}r.addAll(iE(s.length,ds.findings,"finding"))}let c=Py(i);if(c.length>0){r.blank().add("## Expected and not yet on the map");for(let l of c.slice(0,ds.expectations)){let d=e.titles?.get(l.capability);r.add(`- ${l.capability}${d===void 0?"":` \xB7 ${d}`}`)}r.addAll(iE(c.length,ds.expectations,"expectation")),r.add("Settle one with `expect`, or leave it: a part that does it takes it off this list.")}let u=i.decisions?.decisions??[];if(u.length>0){r.blank().add("## Decided last");for(let l of u.slice(-ds.decisions).reverse())r.add(`- ${l.id} ${Ge(l.what,100)??""}`)}return r.blank().add("## Working here").add("- `overview` is the whole map and the reference grammar; `locate <ref>` one part in full. Change the map only through the tools that write; every change is a change set a person accepts.").add("- Call `orient` again with `since` set to the snapshot above: one line comes back when nothing moved."),r.toString()}a(oE,"renderOrient");function sE(t){return t.status==="met"?`- ${t.capability} \xB7 met by ${t.by.join(", ")}`:t.status==="not-needed"?`- ${t.capability} \xB7 not needed${t.note===void 0?"":` (${t.note})`}`:`- ${t.capability} \xB7 open`}a(sE,"line");function aE(t){let e=Qd(t);if(e.length===0)return"This business carries no expectations. Add one with `expect` and `action: add`.";let n=new Ie,i=e.filter(s=>s.status==="open"),r=e.filter(s=>s.status==="met"),o=e.filter(s=>s.status==="not-needed");if(n.add(`# Expectations \xB7 ${Me(i.length,"open")} \xB7 ${Me(r.length,"met")} \xB7 ${Me(o.length,"not needed")}`),i.length>0){n.blank().add("## Open: expected, and nothing on the map provides it yet");for(let s of i)n.add(sE(s));n.add("Settle one with `expect`: `ours` names the part that does it, `provider` the vendor, `not-needed` records that it is not.")}if(r.length>0){n.blank().add("## Met");for(let s of r)n.add(sE(s))}if(o.length>0){n.blank().add("## Not needed");for(let s of o)n.add(sE(s))}return n.toString()}a(aE,"renderExpectations");function cE(t){let e=Qd(t).filter(n=>n.status==="open");return e.length===0?[]:["### Expected and not yet on the map","",...e.map(n=>`- ${n.capability}`),"","A business of this kind customarily has these and nothing on the map provides them yet. A part that does one takes it off this list; `expect` settles the rest."]}a(cE,"openExpectationLines");var c8=100,u8={assumption:"Assumed values, not confirmed",expectation:"Expected, and nothing on the map provides it",finding:"Findings that ask"};function l8(t){let e=[t.id];return t.kind==="assumption"?(e.push(t.title===t.what?t.what:`${t.title} (${t.what})`),t.field!==void 0&&e.push(`${t.field}=${t.value??""}`),t.basis!==void 0&&e.push(t.basis),t.values!==void 0&&t.values.length>0&&e.push(`one of ${t.values.slice(0,8).join(", ")}${t.values.length>8?", \u2026":""}`),t.roots.length>0&&e.push(`in ${t.roots.join(", ")}`)):t.kind==="finding"&&e.push(Ge(t.what,160)??"(no text)"),e.push(t.answered===void 0?`answers: ${t.answers.join(", ")}`:`answered by ${t.answered.by} (${t.answered.change}), waiting for the founder`),`- ${e.join(" \xB7 ")}`}a(l8,"line");function uE(t,e={}){if(t.length===0)return`There are no open questions: every assumed value is confirmed, every expectation is met or not needed, and no finding asks anything.
|
|
221
|
+
`;let n=e.limit??c8,i=new Ie;i.add(`# Questions \xB7 ${Me(t.length,"open")}`+(e.root===void 0?"":` \xB7 about \`${e.root}\` and the business as a whole`));for(let r of["assumption","expectation","finding"]){let o=t.filter(s=>s.kind===r);if(o.length!==0){i.blank().add(`## ${u8[r]} (${String(o.length)})`);for(let s of o.slice(0,n))i.add(l8(s));o.length>n&&i.add(`\u2026 and ${Me(o.length-n,"more")}.`)}}return i.blank().add("## Answering").add("- Settle one with `settle`: `question` is the id above, `how` one of the answers on its line, `value` for correct, `node` or `provider` for an expectation, and `evidence`: one to five files in this repository, each with the line and an exact excerpt. The answer is a proposal the founder accepts or rejects in Tacticyl, and the file stays with the value as where it came from.").add("- Settle only what a file shows. Two files that disagree are a finding, not an answer: `raise_finding` on the node, quoting both. What no file says, leave open."),i.toString()}a(uE,"renderQuestions");function ro(t){return ur(t.ref,`[${t.kind}]`,t.via===void 0?void 0:`via ${t.via}`,t.path===void 0?void 0:`at ${t.path}`,t.distance>1?`(${String(t.distance)} hops)`:void 0)??t.ref}a(ro,"edgeLine");function fs(t){let e=(t.home??[]).map(An);return ur(e.join(" "),t.about===void 0||t.about.length===0?void 0:`about=${t.about.join(" ")}`,t.tags===void 0||t.tags.length===0?void 0:`tags=${t.tags.join(" ")}`,t.by===void 0?void 0:`by=${t.by}`,t.at===void 0?void 0:`at=${t.at}`)??"(a document with no home)"}a(fs,"docLine");function d8(t,e){let n=t.nodes.get(e);if(n===void 0)return[];let i=[];for(let r of St(t,n))if(r.tag!=="caveat"){i.push(yt(t,r,{indent:" ",bare:!0,altitude:"detail"}));for(let o of St(t,r))i.push(yt(t,o,{indent:" ",bare:!0,altitude:"detail"}))}return i}a(d8,"childLines");function lE(t,e){let n=We(t),i=n.nodes.get(e.node.path),r=new Ie;if(r.add(`# ${e.node.ref}`),r.add(ur(`${e.node.tag}`,e.node.id===null?void 0:`id=${e.node.id}`,e.node.facet===null?void 0:`facet=${e.node.facet}`,`path=${e.node.path}`)),e.node.member!==null){let s=e.node.memberValue===void 0||e.node.memberValue===null?"(unset)":no(String(e.node.memberValue))??"";r.add(`@${e.node.member} (${e.node.memberKind??"unknown"}) = ${s}`)}if(i!==void 0){let s=tf(i.node);s.length>0&&r.blank().addAll(s),r.blank().addAll(ls(i,"detail"));let c=d8(n,e.node.path);c.length>0&&r.blank().addAll(c)}e.consumers.length>0&&(r.heading("consumers, which break if it changes"),r.addAll(e.consumers.map(ro))),e.dependencies.length>0&&(r.heading("depends on"),r.addAll(e.dependencies.map(ro))),e.pinnedBy.length>0&&r.heading("pinned by").add(e.pinnedBy.join(" ")),e.decisions.length>0&&(r.heading("decisions"),r.addAll(e.decisions.map(s=>ur(s.id,Ge(s.what,140),s.why===void 0?void 0:`\xB7 why: ${Ge(s.why,140)??""}`,s.pins===void 0||s.pins.length===0?void 0:`pins=${s.pins.join(" ")}`)))),e.docs.length>0&&r.heading("docs").addAll(e.docs.map(fs)),e.findings.length>0&&(r.heading("findings"),r.addAll(e.findings.map(s=>ur(s.id,`[${s.state??"open"}]`,Ge(s.text,240),s.resolvesVia===void 0||s.resolvesVia.length===0?void 0:`resolves-via=${s.resolvesVia.join(" ")}`))));let o=i===void 0?void 0:De(i,"home");return o!==void 0&&r.blank().add(`Read next: ${o}`),r.toString()}a(lE,"renderNode");function dE(t,e,n={}){let i=n.direction??"consumers",r=new Ie,o=i==="consumers"?"depend on":"are depended on by";if(e.length===0)return`Nothing in this business ${i==="consumers"?"depends on":"is depended on by"} ${t}.
|
|
222
|
+
`;r.add(`${Me(e.length,i==="consumers"?"node":"dependency",i==="consumers"?"nodes":"dependencies")} ${o} ${t}${n.transitive===!0?", transitively":""}:`);let s=eo(e,d=>String(d.distance)),c=[...s.keys()].sort((d,f)=>Number(d)-Number(f)),u=c.length<=1;for(let d of c)u||r.blank().add(`${d} hop${d==="1"?"":"s"} away:`),r.addAll((s.get(d)??[]).map(ro));let l=[...new Set(e.map(d=>d.path).filter(d=>d!==void 0))];return l.length>0&&r.blank().add(`Read next: ${l.join(" ")}`),r.toString()}a(dE,"renderConsumers");function f8(t){let e=t.node,n=[t.tag,t.id??"",t.key??""];for(let i of["tags","purpose","note","text","summary","do","what","why"]){let r=e[i];typeof r=="string"?n.push(r):Array.isArray(r)&&n.push(r.map(o=>String(o)).join(" "))}return n.join(" ").toLowerCase()}a(f8,"searchText");function p8(t,e,n){return De(e,"mode")===n?!0:t.index.some(i=>i.parentPath===e.path&&i.tag==="realization"&&De(i,"mode")===n)}a(p8,"inMode");function m8(t,e){let n=e.toLowerCase();return t.tag.toLowerCase()===n?!0:(De(t,"kind")??"").toLowerCase()===n}a(m8,"matchesKind");function h8(t,e){let n=e.toLowerCase();for(let i of["status","state"])if((De(t,i)??"").toLowerCase()===n)return!0;return n==="sketch"&&De(t,"status")===void 0&&De(t,"state")===void 0}a(h8,"matchesStatus");function g8(t,e){let n=e.toLowerCase();return(De(t,"tags")??"").toLowerCase().split(/\s+/).includes(n)?!0:new RegExp(`(^|[^a-z0-9])${n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}`,"i").test(f8(t))}a(g8,"matchesTag");function ID(t,e){let n=We(t);return n.index.filter(i=>!((e.kind===void 0?i.depth!==2:i.depth<2)||e.facet!==void 0&&i.facet!==Rr(e.facet)||e.kind!==void 0&&!m8(i,e.kind)||e.status!==void 0&&!h8(i,e.status)||e.tag!==void 0&&!g8(i,e.tag)||e.mode!==void 0&&!p8(n,i,e.mode)))}a(ID,"queryVenture");function SD(t){let e=[t.facet===void 0?void 0:`facet=${t.facet}`,t.kind===void 0?void 0:`kind=${t.kind}`,t.status===void 0?void 0:`status=${t.status}`,t.tag===void 0?void 0:`tag=${t.tag}`,t.mode===void 0?void 0:`mode=${t.mode}`].filter(n=>n!==void 0);return e.length===0?"every node":e.join(" ")}a(SD,"describe");function fE(t,e){let n=We(t),i=ID(n,e),r=e.limit??60,o=i.slice(0,r),s=new Ie;return i.length===0?`No node matches ${SD(e)}. Call overview for what this business holds.
|
|
223
|
+
`:(s.add(`${Me(i.length,"node")} match ${SD(e)}:`),s.addAll(o.map(c=>yt(n,c))),i.length>o.length&&s.blank().add(`${String(i.length-o.length)} more not shown; narrow the filter or raise limit.`),s.toString())}a(fE,"renderQuery");function pE(t){let e=JI(t);return e==="real"||YI(t)==="real"?"real":e==="none"?"none":"some"}a(pE,"careLevel");function of(t){let e=JI(t);return e==="real"?"real users":e==="testers"?"testers":"no users"}a(of,"usersPhrase");function sf(t){let e=YI(t);return e==="real"?"real data":e==="synthetic"?"synthetic data":"no data"}a(sf,"dataPhrase");function ED(t){return`${t.id} has ${of(t)} and ${sf(t)}.`}a(ED,"careSubject");function TD(t){let e=pE(t);return e==="real"?`A migration that runs in ${t.id} is additive and reversible; nothing destructive happens there without a decision in the ledger; and a promotion into ${t.id} produces a migration plan instead of a deploy.`:e==="some"?`A migration that runs in ${t.id} is additive and reversible where it can be. A destructive change here will affect a test run only.`:`Nothing in ${t.id} is anybody's, so a migration there is free to drop and rewrite.`}a(TD,"careRule");function af(t){return`${ED(t)} ${TD(t)}`}a(af,"careParagraph");function cf(t,e){let n=t.gate===void 0?"":`, gated by ${t.gate}`,i=`${t.from} to ${t.to}${n}.`;if(e===void 0)return`${i} The environments facet declares no mode "${t.to}", so what is on the far side of this is unsaid.`;let r=pE(e);return r==="real"?`${i} ${t.to} has ${of(e)} and ${sf(e)}, so this promotion is a migration plan: what the schema does on the way across is written additively, is reversible, and is decided in the ledger where it is not.`:r==="some"?`${i} ${t.to} has ${of(e)} and ${sf(e)}, so this promotion carries a schema change that is reversible where it can be.`:`${i} ${t.to} has ${of(e)} and ${sf(e)}, so this promotion carries nothing but the code.`}a(cf,"promotionLine");function y8(t,e){return e!==void 0?qn(t.venture,e,t.index).map(n=>t.nodes.get(n.path)).filter(n=>n!==void 0):t.index.filter(n=>t.index.some(i=>i.parentPath===n.path&&i.tag==="realization"))}a(y8,"subjects");function v8(t,e){return pn(t,"environments","mode").find(n=>(n.id??n.key)===e)}a(v8,"modeNode");function mE(t,e,n){let i=We(t),r=new Ie,o=v8(i,e);r.add(`# mode ${e}${n===void 0?"":` \xB7 ${n}`}`),o!==void 0?r.add(yt(i,o,{altitude:"detail"})):r.add(`The environments facet declares no mode "${e}"; realizations below name it.`);let s=o?.node;if(s!==void 0){r.blank().add(af(s));let l=(i.venture.environments?.promotions??[]).filter(d=>d.to===e);for(let d of l)r.add(cf(d,s))}let c=y8(i,n);if(c.length===0)return r.blank().add(`"${n??e}" names no node of this business.`),r.toString();let u=0;for(let l of c){let d=St(i,l,"realization").find(p=>De(p,"mode")===e),f=St(i,l,"secret").filter(p=>{let m=De(p,"mode");return m===void 0||m===e});if(!(d===void 0&&f.length===0)){u+=1,r.blank().add(`${un(i,l.path)} (${l.tag})`),d!==void 0?r.add(` realization ${ls(d,"detail").join(" ")}`):r.add(` realization: none declared for ${e}`);for(let p of f)r.add(` secret ${ls(p,"detail").join(" ")}`)}}return u===0&&r.blank().add(`Nothing under "${n??e}" declares a realization in ${e}.`),r.blank().add("This map shows the name and fingerprint of each secret. Secret values are not included. vault reference that holds the value. Read the value from the vault, not from here."),r.toString()}a(mE,"renderMode");function AD(t){return t.index.filter(e=>e.tag==="doc"&&e.facet==="docs")}a(AD,"docEntries");function OD(t){return AD(t).map(e=>e.node)}a(OD,"registry");function b8(t,e){let n=new Set(Ba(t,e).map(i=>i.path));return n.size===0?[]:AD(t).filter(i=>(t.outgoing.get(i.path)??[]).some(r=>r.kind==="about"&&n.has(r.to))).map(i=>i.node)}a(b8,"about");function w8(t,e){let n=e.map(i=>i.toLowerCase());return OD(t).filter(i=>{let r=(i.tags??[]).map(o=>o.toLowerCase());return n.every(o=>r.includes(o))})}a(w8,"tagged");function dv(t,e){let n=We(t);if(e.ref===void 0&&(e.tags===void 0||e.tags.length===0))return OD(n);let i=e.ref===void 0?void 0:b8(n,e.ref),r=e.tags===void 0||e.tags.length===0?void 0:w8(n,e.tags);if(i===void 0)return r??[];if(r===void 0)return i;let o=new Set(r.map(s=>(s.home??[]).map(An).join(" ")));return i.filter(s=>o.has((s.home??[]).map(An).join(" ")))}a(dv,"findDocs");function hE(t,e){let n=We(t),i=dv(n,e),r=[e.ref===void 0?void 0:`about ${e.ref}`,e.tags===void 0||e.tags.length===0?void 0:`tagged ${e.tags.join(" ")}`].filter(c=>c!==void 0).join(" and "),o=r.length===0?"in the registry":r;if(i.length===0)return`No registered document is ${o}. The registry holds what has been registered, not every file in the repositories; register one with register_doc.
|
|
224
|
+
`;let s=new Ie;return s.add(`${Me(i.length,"document")} ${o}:`),s.addAll(i.map(fs)),s.blank().add("The locators above show where each document is stored. The document contents are not stored."),s.toString()}a(hE,"renderDocs");var ND=["error","warning","info"];function fv(t){let e=t.ref??t.path;return`${t.severity} ${t.code} at ${e} \xB7 ${t.message}`}a(fv,"diagnosticLine");function gE(t,e,n="This business"){if(t.length===0)return`${n} validates: no diagnostic at all.
|
|
225
|
+
`;let i=new Ie,r=eo(t,s=>s.severity),o=ND.filter(s=>r.has(s)).map(s=>Me(r.get(s)?.length??0,s)).join(", ");i.add(`${n}: ${o}. ${e?"Valid: nothing here stops you trusting the map.":"Not valid: the errors below have to be answered."}`);for(let s of ND){let c=r.get(s);c!==void 0&&i.blank().addAll(c.map(fv))}return i.toString()}a(gE,"renderDiagnostics");var $8={proposed:"This proposal is pending until the founder accepts or rejects it in the app. No changes have been made yet.",held:"Another proposal changes the same node. The founder will choose between them in the app. No changes have been made yet.",accepted:"Accepted and applied; the business now says this.",rejected:"Refused. Nothing changed. The findings below say why."};function st(t,e=[],n=[]){let i=new Ie;i.add(`# change ${t.id} \xB7 ${t.state}`),i.add($8[t.state]??"An unknown state; read the ledger in the app."),i.add(`${Me(t.changeSet.operations.length,"operation")}${t.changeSet.summary===void 0?"":`: ${t.changeSet.summary}`}`),t.anchors.length>0&&i.add(`touches ${t.anchors.join(" ")}`);for(let r of t.changeSet.evidence??[])i.add(`cites ${r.path}${r.line===void 0?"":`:${String(r.line)}`}`+(r.excerpt===void 0?"":` "${Ge(r.excerpt,120)??""}"`));return i.add(`by ${t.provenance.kind}${t.provenance.name===void 0?"":`:${t.provenance.name}`} at ${t.at}`),t.reason!==void 0&&i.add(`reason: ${t.reason}`),e.length>0&&(i.heading("findings raised instead of a change"),i.addAll(e.map(r=>`${r.id??"(new)"} ${Ge(r.text,240)??"(no text)"}`))),n.length>0&&(i.heading("what the validator said about the result"),i.addAll(n.map(fv))),i.blank().add(t.state==="accepted"&&t.decidedBy!==void 0?"This change set has taken effect, and the ledger records it under the name of the agent that made it.":"Change sets are proposals. They take effect when the founder accepts them in the app, and the ledger records both the proposal and the answer."),i.toString()}a(st,"renderChange");var Ht="<!-- tacticyl:generated -->",jt="<!-- /tacticyl:generated -->";var yE="## Settling what the map is unsure about",pv=["An assumed value is a playbook\u2019s guess until somebody says otherwise, and the files in this repository often say. When the founder asks you to settle what Tacticyl is unsure about, or before you build on a guessed value:","","1. Call `questions`. Each line is one thing the map is unsure about, with its id and the answers it takes.","2. For each one, look for the file here that shows the answer: a README, a design note, a configuration file, a manifest, a comment in the code. Read it.","3. Settle only what a file shows, with `settle`: the id, the answer, and the file with the line and an exact excerpt. The companion checks all three against this repository before anything is sent.","4. Two files that disagree are a finding, not an answer: `raise_finding` on the node, quoting both. What no file says, leave open.","5. Go through the whole list in one sitting, then call `questions` again. Each answer waits for the founder on the Assumptions page, and it takes effect when they accept it."];function vE(t){return["---","name: tacticyl","description: Settle what Tacticyl is unsure about in this repository. Use when the founder asks to settle, answer or confirm Tacticyl\u2019s open questions or assumptions, or to check the business map against the files here.","---","",Ht,"<!-- Written by Tacticyl's `tacticyl project`. Everything between these markers is generated: edit the business, not this file. -->","","# Settle what Tacticyl is unsure about","",`This repository is the root \`${t.rootId}\` of the business \`${t.businessId}\`. The tools are live over MCP once the companion serves them; \`TACTICYL.md\` at the root of this repository is the map as it stood when it was last projected.`,"",...pv,"",jt,""].join(`
|
|
226
|
+
`)}a(vE,"renderSkill");var bE={read:"This business is set to Read: you can read it through the tools, and any tool that would change it will be refused.",propose:"This business is set to Propose: you can submit changes with `propose` for the founder to accept or reject, but you cannot mark items done with `complete_item`.",apply:"This business is set to Apply: your changes will take effect at once unless a recorded decision holds them or a check fails, and you can mark items done with `complete_item`."};function wE(t){return FI.find(e=>t.includes(bE[e]))}a(wE,"accessNamedIn");function CD(t,e){let n=t.node.home;return Array.isArray(n)?n.some(i=>i.root===e):!1}a(CD,"livesIn");function $E(t,e){return t.index.filter(n=>n.depth===2&&n.facet!=="docs"&&CD(n,e))}a($E,"sliceOf");function _8(t,e){return t.index.filter(n=>n.tag==="doc"&&n.facet==="docs"&&CD(n,e))}a(_8,"documentsIn");function k8(t,e){let n=[`### ${un(t,e.path)}`,"",...tf(e.node),yt(t,e,{altitude:"detail"})];for(let c of St(t,e))if(c.tag!=="caveat"){n.push(yt(t,c,{indent:" ",bare:!0,altitude:"detail"}));for(let u of St(t,c))n.push(yt(t,u,{indent:" ",bare:!0,altitude:"detail"}))}let i=un(t,e.path),r=cI(t,i);r.length>0&&n.push("",`consumers (${String(r.length)}):`,...r.map(ro));let o=Ez(t,i).filter(c=>c.kind!=="home");o.length>0&&n.push("",`depends on (${String(o.length)}):`,...o.map(ro));let s=dv(t,{ref:i});return s.length>0&&n.push("",`docs (${String(s.length)}):`,...s.map(fs)),n}a(k8,"sliceEntry");function x8(t,e){let n=new Set(e.map(r=>r.path)),i=new Set(e.map(r=>un(t,r.path)));return Xi(t.venture).filter(r=>{let o=t.index.find(u=>u.tag==="finding"&&u.id===r.id);if(o===void 0)return!1;if([...t.outgoing.get(o.path)??[],...t.incoming.get(o.path)??[]].some(u=>n.has(u.to)||n.has(u.from)))return!0;let c=r.text??"";return[...i].some(u=>c.includes(u))}).map(r=>`${r.id} ${Ge(r.text,240)??"(no text)"}`)}a(x8,"sliceFindings");function _E(t,e){let n=We(t),i=new Ie,r=pn(n,"roots","root").find(d=>d.id===e.rootId),o=$E(n,e.rootId);i.add(Ht),i.add(`<!-- Written by ${e.hosted?"Tacticyl, from the Agent view":"Tacticyl's `tacticyl project`"}. Everything between these markers is generated: edit the business, not this file. -->`),i.blank(),i.add(`# The business map \xB7 ${n.venture.name}`),i.blank();let s=e.hosted?" (which the business does not declare)":" (which the business does not declare; run `tacticyl link` again)";if(i.add(`This repository is the root \`${e.rootId}\`${r===void 0?s:` (${De(r,"kind")??"repo"})`} of the business \`${e.businessId}\`. `+(e.service===void 0?"It is not linked to a service; run `tacticyl link <service-url>`.":`Its canonical state lives at ${e.service}; this file is a projection of it.`)+(e.hosted?" This file is what an agent reads first.":" The same facts are live over MCP, through the tools below. This file is what an agent gets before it calls anything.")),e.snapshot!==void 0&&i.blank().add(`Projected from snapshot \`${e.snapshot}\`.`),i.blank().add("---").blank(),i.add(rf(n,{nextSteps:!1}).trimEnd()),i.blank().add("---").blank(),i.addAll(I8(n,e.rootId)),i.blank().add("---").blank(),i.add(`## This repository (\`${e.rootId}\`)`),o.length===0)i.blank().add(`No node of the business declares a home in \`${e.rootId}\`. Either this repository `+(e.hosted?"is new to the map, or the root id does not match the one the descriptor uses.":"is new to the map, or the root id in `.tacticyl/link` does not match the one the descriptor uses; `tacticyl status` says which."));else{i.blank().add(`${Me(o.length,"node")} of the map ${o.length===1?"lives":"live"} here.`);for(let d of o)i.blank().addAll(k8(n,d))}let c=_8(n,e.rootId);c.length>0&&i.blank().add("### Registered documents in this repository").blank().addAll(c.map(d=>fs(d.node)));let u=x8(n,o);u.length>0&&i.blank().add("### Open findings against this repository").blank().addAll(u);let l=cE(n.venture);return l.length>0&&i.blank().addAll(l),i.blank().addAll(S8(n)),i.blank().add("---").blank().add("## Working in this repository").blank().add("- The map is not documentation you may edit here. Every change to it is a change set a human accepts: propose one with `propose`, or register a document you wrote with `register_doc`.").add("- Paths above are locators, not filesystem paths: `repo:<root>/<path>` means `<path>` in the repository that root names. This repository is `"+e.rootId+"`.").add((e.hosted?"- Live tools, once the companion serves them to your agents: ":"- Live tools, if your harness has MCP: ")+KI.map(d=>`\`${d}\``).join(", ")+". They answer from the service, so they are current even when this file is not.").addAll(e.access===void 0?[]:[`- ${bE[e.access]}`]).add(e.hosted?"- A fresh copy of this file is on the Agent view, and the companion keeps one current in the repository. It is safe to commit.":"- Regenerate this file with `tacticyl project`. It is safe to commit."),i.blank().add(yE).blank().addAll(pv),i.blank().add("## When you change what this business runs on").blank().add("Make a major reorganisation, add or remove a module, or swap an externality (a service, a provider, a domain, a deploy target), and append one line to `.tacticyl/inbox.md` saying what changed and why. An ISO date, a dash, one sentence:").blank().add("```").add("2026-09-14 - Replaced Keycloak with Clerk across the API and the web surface.").add("```").blank().add("Those three, and nothing else. A dependency bump, a refactor inside one module, a rename, a test, a fix: no line. The file is short because it is a short list, and a short file is one a founder reads.").blank().add("The next audit reads that line and shows it to the founder beside whatever the readers found in the same tree. It is how to be heard when no tool is connected. With the tools connected, say it with `report` instead: each event becomes the change or the note an audit would have made, under your name. Do not edit `tacticyl.xml`: the map is changed by a change set a person accepts, through `propose`."),i.blank().add(jt),i.toString()}a(_E,"renderProjection");function S8(t){let e=t.venture.environments?.modes??[];if(e.length===0)return[];let n=["---","","## The modes, and what is in each of them",""];for(let r of e)n.push(`- ${af(r)}`);let i=t.venture.environments?.promotions??[];if(i.length>0){n.push("","Promotions:","");for(let r of i){let o=e.find(s=>s.id===r.to);n.push(`- ${cf(r,o)}`)}}return n.push("","The two words on each mode are the founder\u2019s answer where they gave one and the kind\u2019s customary value where they did not; the app shows which rung each one stands on. A destructive migration against a mode that holds real data is a change set a person accepts, like every other change to the map."),n}a(S8,"modesSection");function I8(t,e){let n=pn(t,"roots","root").filter(r=>(De(r,"kind")??"repo")==="repo");if(n.length===0)return[];let i=[`## The repositories (${Me(n.length,"root")})`,"",n.length===1?"One repository, and this is it. A business may have several, and the map is their union.":"The map is the union of these. A node lives in exactly the one its `home` names.",""];for(let r of n){let o=r.id??"",s=De(r,"remote"),c=o===e?" (this one)":"",u=$E(t,o);i.push(`- \`${o}\`${c}${s===void 0?"":` \xB7 ${s}`} \xB7 `+(u.length===0?"no module of the map lives here":u.map(l=>un(t,l.path)).join(", ")))}return i}a(I8,"repositoriesSection");function E8(t){return t.modes.map(e=>`${e.mode} ${e.binding}`).join(", ")}a(E8,"modeColumn");function uf(t,e=!1){let n=new Ie;n.add(`# scaffold ${t.system} \xB7 ${t.stack}`),n.add(`modes ${t.modes.join(", ")} \xB7 into ${t.dir} \xB7 ${t.summary}`+(t.mount==null?"":` \xB7 ${t.mount.machine}:${t.mount.path}`)),n.heading(e?"Files":"Files that would be written");for(let i of t.files){let r=i.bytes===void 0?"":` ${String(i.bytes)}b`;n.add(` ${i.status.padEnd(9)} ${i.path}${r}`),i.why!==void 0&&n.add(` ${i.why}`)}n.heading("Bindings, and what each mode gets");for(let i of t.bindings){let r=i.provider===void 0?"":` (${i.provider})`;n.add(` ${i.ref}${r} \u2192 ${i.interfaceName}, mock="${i.policy}"`),n.add(` ${E8(i)}`);let o=i.modes.filter(c=>c.via!==void 0);for(let c of o)n.add(` ${c.mode}: ${c.via??""}`);i.policyFrom==="catalog"&&n.add(" the node carries no mock policy; this is the provider's customary one");let s=i.secrets;s.length>0&&n.add(` secrets ${s.map(c=>`${c.name}${c.required?"":"?"}`).join(" ")}`)}if(t.skipped.length>0){n.heading(`Not bound (${Me(t.skipped.length,"node")})`);for(let i of t.skipped)n.add(` ${i.ref} \xB7 ${i.why}`)}if(e&&t.written!==void 0){n.heading("Written"),t.written.length===0&&n.add(" every file was already what it should be");for(let i of t.written)n.add(` ${i.outcome.padEnd(9)} ${i.path}`)}return t.why!=null&&t.why.length>0&&n.blank().add(t.why),n.blank().add("Secret names only: no value is in this answer, in the generated config, or in the descriptor. Every generated file carries a `tacticyl:generated` header. Delete it and the file is yours, and the next scaffold reports it as kept and writes nothing to it."),n.toString()}a(uf,"renderScaffold");function kE(t,e,n=0,i=[]){let r=QI(t,i)(n);return{summary:`${r}: ${e.text.trim().slice(0,120)}`,operations:[{op:"add-node",parent:"findings",element:"finding",attributes:{id:r,class:Ry,"raised-by":e.raisedBy,at:e.at,state:"open",about:e.about.trim(),text:e.text.trim()}}]}}a(kE,"raiseFindingChangeSet");function xE(t,e){let n=eE(t)(0),i=(e.pins??[]).map(r=>r.trim()).filter(r=>r.length>0);return{summary:`${n}: ${e.what.trim()}`,operations:[{op:"add-node",parent:"decisions",element:"decision",attributes:{id:n,what:e.what.trim(),why:e.why.trim(),...i.length===0?{}:{pins:i.join(" ")}}}]}}a(xE,"decisionChangeSet");var SE="tacticyl:generated";function RD(t){return t.split(`
|
|
227
|
+
`,40).some(e=>e.includes(SE))}a(RD,"hasGeneratedHeader");function jD(t,e){return e===void 0?"new":RD(e)?e===t.content?"unchanged":"replaced":"kept"}a(jD,"statusOf");function zD(t){return`${t} no longer carries its \`${SE}\` header, so somebody owns it now. Nothing was written to it.`}a(zD,"keptReason");function lf(t,e){return t.map(n=>{let i=e(n.path),r=jD(n,i);return{...n,status:r,...i===void 0?{}:{existing:i},...r==="kept"?{why:zD(n.path)}:{}}})}a(lf,"diffScaffold");function oc(t){let e=new Map;for(let r of t)e.set(r.status,(e.get(r.status)??0)+1);let i=["new","replaced","unchanged","kept"].filter(r=>(e.get(r)??0)>0).map(r=>`${String(e.get(r)??0)} ${r}`);return i.length===0?"no files":i.join(", ")}a(oc,"summarizeScaffold");var FD="x-tacticyl-companion";function UD(t){let e=/^v?(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?(?:\+[0-9A-Za-z.-]+)?$/.exec((t??"").trim());return e===null?null:{parts:[Number(e[1]),Number(e[2]),Number(e[3])],prerelease:e[4]??null}}a(UD,"parseVersion");function qD(t,e){let n=UD(t)??{parts:[0,0,0],prerelease:null},i=UD(e)??{parts:[0,0,0],prerelease:null};for(let r=0;r<3;r+=1){let o=(n.parts[r]??0)-(i.parts[r]??0);if(o!==0)return o}return n.prerelease===null&&i.prerelease===null?0:n.prerelease===null?1:i.prerelease===null||n.prerelease<i.prerelease?-1:n.prerelease>i.prerelease?1:0}a(qD,"compareVersions");function U8(t,e){return e==null||e.length===0?!0:qD(t,e)>=0}a(U8,"isAtLeast");function ZD(t,e){if(!U8(t,e.minimum))return"upgrade-required";let n=qD(t,e.current);return n<0?"upgrade-recommended":n>0?"ahead":"current"}a(ZD,"versionStanding");function io(){return"0.1.4"}a(io,"companionVersion");function mn(t=io()){return{[FD]:t}}a(mn,"companionHeaders");function F8(t,e,n){return t==="upgrade-required"?`This companion is ${e} and Tacticyl needs ${n.minimum} or newer. Run \`npm i -g tacticyl\` to update it, then run the command again.`:t==="upgrade-recommended"?`A newer companion is available: ${n.current} (this one is ${e}). Run \`npm i -g tacticyl\` when convenient.`:t==="ahead"?`This companion (version ${e}) is newer than the version your Tacticyl cloud workspace expects (${n.current}). Some tools will not be available until your workspace is updated, and this requires no action on your machine.`:""}a(F8,"versionLine");function KD(){return"This tool is not available from this workspace yet. This companion is newer than the version the workspace expects, and this will resolve when the workspace is updated, with no action required on your side."}a(KD,"toolAheadLine");function mv(t,e=io()){let n=ZD(e,t);return{standing:n,version:e,service:t,line:F8(n,e,t)}}a(mv,"checkVersion");var df=class extends Error{static{a(this,"CompanionOutdatedError")}name="CompanionOutdatedError"};var hv=class extends Error{static{a(this,"SignInUnavailableError")}name="SignInUnavailableError"},q8="Run `tacticyl login` to sign in: it opens your browser, you approve this machine, and the companion keeps a refreshable token in the OS keychain. TACTICYL_TOKEN still works for CI.",Z8=6e4;function V8(t="TACTICYL_TOKEN"){let e=a(()=>Promise.reject(new hv(`${t} is set in the environment; the companion does not write to it. Unset it and run \`tacticyl login\` to keep a refreshable token in the keychain instead.`)),"refuse");return{name:"env",explain:`the ${t} environment variable`,get(){let n=process.env[t];return Promise.resolve(n===void 0||n.length===0?void 0:{token:n,account:`$${t}`})},stored(){return Promise.resolve(void 0)},set:e,clear(){return Promise.resolve()},renew(){return Promise.resolve(void 0)}}}a(V8,"envCredentials");function B8(t=process.platform){if(t==="darwin")return"security";if(t==="win32")return"cmdkey";if(t==="linux")return"secret-tool"}a(B8,"keychainCommand");function Rn(t){return t.replace(/\/+$/,"")}a(Rn,"credentialKey");function K8(t,e,n,i){return{token:e.token,refresh:e.refresh,expiresAt:new Date(n+e.expiresIn*1e3).toISOString(),service:Rn(t),machineId:e.machine.id,machine:e.machine.name,...i===void 0?{}:{account:i},at:new Date(n).toISOString()}}a(K8,"storedFrom");function IE(t){return{token:t.token,expiresAt:t.expiresAt,...t.account===void 0?{}:{account:t.account},...t.machine===void 0?{}:{machine:t.machine},machineId:t.machineId}}a(IE,"credentialOf");function HD(t={}){let e=t.now??(()=>Date.now()),n=t.marginMs??Z8,i=t.fetch??((m,g)=>fetch(m,g)),r=t.store,o,s,c,u=a(async()=>r!==void 0?r:(o??=WP(t).then(m=>r=m),o),"store"),l=a(async m=>{let g=await(await u()).read(Rn(m));if(g!==void 0)try{let y=JSON.parse(g);if(typeof y!="object"||y===null)return;let v=y;return typeof v.token!="string"||typeof v.refresh!="string"?void 0:{...v,token:v.token,refresh:v.refresh,expiresAt:v.expiresAt??new Date(0).toISOString(),service:v.service??Rn(m),machineId:v.machineId??""}}catch{return}},"readStored"),d=a(async(m,g)=>{await(await u()).write(Rn(m),JSON.stringify(g))},"writeStored"),f=a(async m=>{let g=await l(m);if(g===void 0)return;let y;try{y=await i(`${Rn(m)}/api/auth/token/refresh`,{method:"POST",headers:{"content-type":"application/json",...mn()},body:JSON.stringify({refresh:g.refresh})})}catch($){c=`The service at ${m} did not answer the refresh (${String($)}).`;return}let v=await y.text();if(!y.ok){c=G8(v)?.error??`The service refused to refresh this machine's token (${String(y.status)}). Run \`tacticyl login\` again.`;return}let w=JSON.parse(v),b=K8(m,w,e(),g.account);return await d(m,b),c=void 0,IE(b)},"refresh"),p=a(async m=>(s??=f(m).finally(()=>s=void 0),s),"refreshOnce");return{name:"keychain",get explain(){return`${r?.where??B8()??"no keychain on this platform"}. ${q8}`},get lastError(){return c},async storage(){return u()},async get(m){let g=await l(m);if(g===void 0)return;let y=Date.parse(g.expiresAt);return Number.isFinite(y)&&y-e()>n?IE(g):await p(m)??IE(g)},stored:l,async set(m,g){await d(m,g),c=void 0},async clear(m){await(await u()).erase(Rn(m)),c=void 0},renew:p}}a(HD,"keychainCredentials");function EE(){return{name:"none",explain:"a service on this machine, which needs none",get(){return Promise.resolve(void 0)},stored(){return Promise.resolve(void 0)},set(){return Promise.reject(new hv("This service is on this machine and needs no account, so there is nothing to store."))},clear(){return Promise.resolve()},renew(){return Promise.resolve(void 0)}}}a(EE,"noCredentials");function H8(t){try{let e=new URL(t).hostname;return e==="localhost"||e==="127.0.0.1"||e==="::1"||e==="local"}catch{return!1}}a(H8,"isLocalService");function W8(t={}){let e=HD(t),n=EE(),i=a(async r=>await e.stored(r)===void 0?n:e,"chosen");return{name:"local",explain:"a service on this machine, which needs no account. `tacticyl login` against it anyway if it runs with accounts (DEV_LOGIN=1 or GitHub).",get lastError(){return e.lastError},storage:a(()=>e.storage?.()??Promise.resolve(void 0),"storage"),async get(r){return(await i(r)).get(r)},stored:a(r=>e.stored(r),"stored"),set:a((r,o)=>e.set(r,o),"set"),clear:a(r=>e.clear(r),"clear"),async renew(r){return(await i(r)).renew(r)}}}a(W8,"localCredentials");function Zn(t,e={}){return process.env.TACTICYL_TOKEN!==void 0&&process.env.TACTICYL_TOKEN.length>0?V8():H8(t)?W8(e):HD(e)}a(Zn,"chooseCredentials");function G8(t){try{return JSON.parse(t)}catch{return}}a(G8,"safeParse");var hn=require("node:fs"),sc=require("node:os"),gv=require("node:path");var J8=50,Y8=10080*60*1e3,X8=20;function yv(t=process.env){let e=t.TACTICYL_STATE_DIR;return e!==void 0&&e.length>0?e:(0,gv.join)(t.HOME??t.USERPROFILE??(0,sc.homedir)(),".tacticyl")}a(yv,"stateDir");function JD(t=process.env){return(0,gv.join)(yv(t),"errors.json")}a(JD,"errorsFilePath");function TE(t=process.env){return(0,gv.join)(yv(t),"reporting.json")}a(TE,"reportingFilePath");var Q8=/(?:[A-Za-z]:)?[^\s():]*[\\/](?:tacticyl|companion)[\\/]dist[\\/]([\w.-]+(?:[\\/][\w.-]+)*)/g;function WD(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(WD,"escape");function GD(t,e={}){let n=t.replace(Q8,(o,s)=>`app:///dist/${s.replace(/\\/g,"/")}`),i=e.repo;i!==void 0&&i.length>1&&(n=n.replace(new RegExp(WD(i),"g"),"<repository>"));let r=e.home??(0,sc.homedir)();return r.length>1&&(n=n.replace(new RegExp(WD(r),"g"),"~")),n}a(GD,"scrub");function eX(t){return t.HOME??t.USERPROFILE??(0,sc.homedir)()}a(eX,"homeOf");function YD(t){if(!(0,hn.existsSync)(t))return[];try{let e=JSON.parse((0,hn.readFileSync)(t,"utf8"));return Array.isArray(e)?e:[]}catch{return[]}}a(YD,"readErrors");function XD(t,e){let n=e.getTime()-Y8;return t.filter(i=>Date.parse(i.at)>=n)}a(XD,"fresh");function vv(t,e,n={}){let i=n.env??process.env,r=(n.now??(()=>new Date))(),s={home:eX(i),...n.repo===void 0?{}:{repo:n.repo}},c=t instanceof Error?t:void 0,u={at:r.toISOString(),command:e.command,where:e.where??e.command,name:c?.name??"Error",message:GD(c?.message??String(t),s),...c?.stack===void 0?{}:{stack:GD(c.stack,s)},version:io(),node:process.versions.node,os:`${process.platform} ${(0,sc.release)()} ${process.arch}`};try{let l=JD(i);(0,hn.mkdirSync)(yv(i),{recursive:!0});let d=[...XD(YD(l),r),u].slice(-J8);return(0,hn.writeFileSync)(l,`${JSON.stringify(d,null,2)}
|
|
228
|
+
`),u}catch{return}}a(vv,"recordError");function QD(t={}){let e=t.env??process.env,n=(t.now??(()=>new Date))();return XD(YD(JD(e)),n).reverse()}a(QD,"recentErrors");function ff(t={}){let e=t.env??process.env,n=(t.now??(()=>new Date))(),i=TE(e);if(!(0,hn.existsSync)(i))return null;try{let r=JSON.parse((0,hn.readFileSync)(i,"utf8"));if(typeof r.until!="string")return null;let o=new Date(r.until);return Number.isNaN(o.getTime())||o.getTime()<=n.getTime()?null:o}catch{return null}}a(ff,"reportingUntil");function eL(t={}){let e=t.env??process.env,n=(t.now??(()=>new Date))(),i=ff(t);if(i!==null)return{until:i,already:!0};let r=new Date(n.getTime()+X8*60*1e3);return(0,hn.mkdirSync)(yv(e),{recursive:!0}),(0,hn.writeFileSync)(TE(e),`${JSON.stringify({until:r.toISOString()})}
|
|
229
|
+
`),{until:r,already:!1}}a(eL,"turnReportingOn");function tL(t={}){let e=t.env??process.env,n=ff(t)!==null,i=TE(e);if((0,hn.existsSync)(i))try{(0,hn.writeFileSync)(i,`${JSON.stringify({until:null})}
|
|
230
|
+
`)}catch{}return n}a(tL,"turnReportingOff");function bv(t){return`${String(t.getHours()).padStart(2,"0")}:${String(t.getMinutes()).padStart(2,"0")}`}a(bv,"clockTime");var tX=900,wv;function nL(){return wv}a(nL,"hookDeadline");async function ac(t,e={}){let n=new AbortController,i=wv;wv=n.signal;let r;try{await Promise.race([Promise.resolve().then(t).catch(o=>{e.command!==void 0&&(o instanceof Error&&o.name==="AbortError"||vv(o,{command:e.command,where:"hook"}))}),new Promise(o=>{r=setTimeout(o,e.ms??tX)})])}finally{r!==void 0&&clearTimeout(r),n.abort(),wv=i}return 0}a(ac,"quietly");var nX="x-tacticyl-agent";function ps(t){return t===void 0?{}:{[nX]:t}}a(ps,"asAgent");var rX=new Set([502,504,520,521,522,523,524]),dt=class extends Error{static{a(this,"ServiceError")}status;code;path;name="ServiceError";constructor(e,n,i,r){super(i),this.status=e,this.code=n,this.path=r}};function iX(t){return`This repository is linked to business ${t}, which is no longer in your Tacticyl cloud workspace. You can run \`tacticyl link\` to link this repository to another business.`}a(iX,"linkedBusinessGone");function oX(t){let e=/^\/api\/businesses\/([^/?]+)/.exec(t);if(e?.[1]===void 0)return null;let n=decodeURIComponent(e[1]);return n==="intake"?null:n}a(oX,"businessOfPath");var OE=class extends Error{static{a(this,"ServiceUnreachableError")}service;name="ServiceUnreachableError";constructor(e,n){super(`The service at ${e} did not answer. Is it running? \`tacticyl status\` says what the companion thinks it is talking to.`,{cause:n}),this.service=e}};function sX(){let t=Number(process.env.TACTICYL_CACHE_TTL_MS??"2000");return Number.isFinite(t)&&t>=0?t:2e3}a(sX,"defaultTtl");var lr=class{static{a(this,"ServiceClient")}service;credentials;transport;ttlMs;pollMs;cache=new Map;hits=0;misses=0;renewals=0;exchanges=0;lastFailure;constructor(e){this.service=e.service.replace(/\/+$/,""),this.transport=e.fetch??((n,i)=>fetch(n,i)),this.credentials=e.credentials??Zn(e.service,{fetch:this.transport}),this.ttlMs=e.ttlMs??sX(),this.pollMs=e.pollMs??2e3}credential(){return this.credentials.get(this.service)}async request(e,n,i=!1){let r=await this.credentials.get(this.service),o=new Headers(n?.headers);r!==void 0&&o.set("authorization",`Bearer ${r.token}`);for(let[u,l]of Object.entries(mn()))o.set(u,l);n?.body!==void 0&&o.set("content-type","application/json");let s,c=nL();try{s=await this.transport(`${this.service}${e}`,{...n,headers:o,...c===void 0?{}:{signal:c}})}catch(u){let l=new OE(this.service,u);throw this.lastFailure=l.message,l}return s.status===401&&!i&&r!==void 0?(await s.text().catch(()=>""),await this.credentials.renew(this.service)!==void 0?(this.renewals+=1,this.request(e,n,!0)):(this.lastFailure=this.credentials.lastError??"Your Tacticyl cloud workspace refused this machine's token. This machine was signed out, or the token expired and could not be renewed. Run `tacticyl login` to sign in again.",new Response(JSON.stringify({error:this.lastFailure,code:"unauthenticated"}),{status:401,headers:{"content-type":"application/json"}}))):(s.ok&&(this.lastFailure=void 0),s)}get fetcher(){return this.transport}get failure(){return this.lastFailure}get refreshes(){return this.renewals}async json(e,n){return this.read(await this.request(e,n),e)}async read(e,n){let i=await e.text();if(!e.ok){let r=AE(i),o=r?.code??"unknown",s=o==="venture-not-found"?oX(n):null;throw new dt(e.status,o,s!==null?iX(s):r?.error??`${String(e.status)} from ${n}: ${i.slice(0,200)}`,n)}return this.exchanges+=1,JSON.parse(i)}get roundTrips(){return this.exchanges}async heartbeat(e={}){let n;try{n=await this.request("/api/auth/machines/heartbeat",{method:"POST",body:JSON.stringify(e)})}catch(r){return{ok:!1,error:r instanceof Error?r.message:String(r),signedOut:!1}}let i=await n.text().catch(()=>"");return n.ok?{ok:!0,answer:JSON.parse(i)}:{ok:!1,error:AE(i)?.error??`${this.service} answered ${String(n.status)} to a heartbeat.`,signedOut:n.status===401}}async reportProjections(e){try{let n=await this.request("/api/auth/machines/heartbeat",{method:"POST",body:JSON.stringify({...e,beat:!1})});return await n.text().catch(()=>""),n.ok}catch{return!1}}async healthy(){return(await this.probe()).ok}async probe(){let e;try{e=await this.request("/api/health")}catch(i){return{ok:!1,error:i instanceof Error?i.message:String(i),fix:"Run `tacticyl status` to see which address this repository uses, `tacticyl login` to sign in, or `tacticyl link <url>` to link this repository to a workspace."}}if(e.ok)return{ok:!0,status:e.status};let n=AE(await e.text().catch(()=>""));return{ok:!1,status:e.status,error:n?.error??`Your Tacticyl cloud workspace at ${this.service} answered ${String(e.status)} to the health check.`,fix:e.status===401?"Run `tacticyl login` to sign this machine in again; it may have been signed out from the Machines page.":"This repository can be linked to a different address than it expects, or the workspace version does not match this companion. Run `tacticyl status` to see the address and the version."}}ventures(){return this.json("/api/businesses")}async venture(e,n={}){let i=this.cache.get(e);if(i!==void 0&&n.fresh!==!0&&Date.now()-i.at<this.ttlMs)return this.hits+=1,i;let r=await this.json(`/api/businesses/${encodeURIComponent(e)}`),o=to(r.xml);if(i!==void 0&&i.bytes===o){this.hits+=1;let u={...i,at:Date.now()};return this.cache.set(e,u),u}this.misses+=1;let s=nc(r.xml),c={id:e,xml:r.xml,bytes:o,snapshot:uv(s.venture),venture:s.venture,graph:_y(s.venture),at:Date.now()};return this.cache.set(e,c),c}node(e,n){return this.json(`/api/businesses/${encodeURIComponent(e)}/node?ref=${encodeURIComponent(n)}`)}consumers(e,n,i=!1){let r=`ref=${encodeURIComponent(n)}${i?"&transitive=1":""}`;return this.json(`/api/businesses/${encodeURIComponent(e)}/consumers?${r}`)}validate(e){return this.json(`/api/businesses/${encodeURIComponent(e)}/validate`)}changes(e){return this.json(`/api/businesses/${encodeURIComponent(e)}/changes`)}async snapshot(e,n){try{return(await this.json(`/api/businesses/${encodeURIComponent(e)}/snapshots/${encodeURIComponent(n)}`)).snapshot}catch(i){if(i instanceof dt&&i.status===404)return;throw i}}propose(e,n,i){return this.json(`/api/businesses/${encodeURIComponent(e)}/changes`,{method:"POST",body:JSON.stringify({changeSet:n,provenance:i})})}change(e){return this.json(`/api/changes/${encodeURIComponent(e)}`)}scanInventory(e,n,i){return this.json(`/api/businesses/${encodeURIComponent(e)}/inventory/scan`,{method:"POST",body:JSON.stringify(n),headers:ps(i)})}inventory(e){return this.json(`/api/businesses/${encodeURIComponent(e)}/inventory`)}report(e,n,i){return this.json(`/api/businesses/${encodeURIComponent(e)}/report`,{method:"POST",body:JSON.stringify(n),headers:ps(i)})}audit(e,n,i){return this.json(`/api/businesses/${encodeURIComponent(e)}/audit`,{method:"POST",body:JSON.stringify(n),headers:ps(i)})}agentAccess(e){return this.json(`/api/businesses/${encodeURIComponent(e)}/agent-access`)}setItemState(e,n,i,r){return this.json(`/api/businesses/${encodeURIComponent(e)}/plan/items/${encodeURIComponent(n)}/state`,{method:"POST",body:JSON.stringify(i),headers:ps(r)})}answerFinding(e,n,i,r){return this.json(`/api/businesses/${encodeURIComponent(e)}/findings/${encodeURIComponent(n)}/answer`,{method:"POST",body:JSON.stringify(i),headers:ps(r)})}resolveFinding(e,n,i,r){return this.json(`/api/businesses/${encodeURIComponent(e)}/findings/${encodeURIComponent(n)}/resolve`,{method:"POST",body:JSON.stringify(i),headers:ps(r)})}async companionVersions(){let e=await this.transport(`${this.service}/api/companion`,{headers:mn(io())});if(!e.ok)throw new dt(e.status,"not-found",`${this.service}/api/companion answered ${String(e.status)}.`,"/api/companion");return await e.json()}questions(e,n={}){let i=new URLSearchParams;n.root!==void 0&&i.set("root",n.root),n.kind!==void 0&&i.set("kind",n.kind);let r=i.size===0?"":`?${i.toString()}`;return this.json(`/api/businesses/${encodeURIComponent(e)}/questions${r}`)}settle(e,n,i,r){return this.json(`/api/businesses/${encodeURIComponent(e)}/questions/${encodeURIComponent(n)}/settle`,{method:"POST",body:JSON.stringify(i),headers:ps(r)})}brief(e,n){return this.json(`/api/businesses/${encodeURIComponent(e)}/plan/items/${encodeURIComponent(n)}/brief`)}plan(e){return this.json(`/api/businesses/${encodeURIComponent(e)}/plan`)}auditStatus(e){return this.json(`/api/businesses/${encodeURIComponent(e)}/audit`)}draftFromAudit(e){return this.eventually("/api/businesses/intake/from-audit",{method:"POST",body:JSON.stringify(e)})}async eventually(e,n){let i=await this.request(e,{...n,headers:{...n.headers,prefer:"respond-async"}});if(i.status!==202)return this.read(i,e);let r=JSON.parse(await i.text()),o=`/api/businesses/intake/${encodeURIComponent(r.draftId)}/job`,s=0;for(;;){await new Promise(u=>setTimeout(u,this.pollMs));let c;try{c=await this.request(o)}catch(u){if(s<5){s+=1;continue}throw u}if(c.status===202){await c.text().catch(()=>""),s=0;continue}if(rX.has(c.status)&&s<5){await c.text().catch(()=>""),s+=1;continue}return this.read(c,o)}}scaffold(e,n){return this.json(`/api/businesses/${encodeURIComponent(e)}/systems/${encodeURIComponent(n)}/scaffold/preview`)}applyScaffold(e,n,i){return this.json(`/api/businesses/${encodeURIComponent(e)}/systems/${encodeURIComponent(n)}/scaffold/apply`,{method:"POST",body:JSON.stringify(i)})}logToolCall(e){return this.json("/api/agent-log",{method:"POST",body:JSON.stringify(e)}).catch(()=>{})}agentLog(e,n=50){return this.json(`/api/businesses/${encodeURIComponent(e)}/agent-log?limit=${String(n)}`)}cacheState(){let e=Date.now();return{ventures:[...this.cache.values()].map(n=>({id:n.id,snapshot:n.snapshot,ageMs:e-n.at,bytes:Buffer.byteLength(n.xml,"utf8")})),hits:this.hits,misses:this.misses,ttlMs:this.ttlMs}}forget(){this.cache.clear()}hubExport(e){return this.json(`/api/businesses/${encodeURIComponent(e)}/export`)}hubImport(e,n={}){return this.json(`/api/businesses/import${n.replace===!0?"?replace=true":""}`,{method:"POST",body:JSON.stringify(e)})}};function AE(t){try{return JSON.parse(t)}catch{return}}a(AE,"safeParse");var aX=new Set(["service","business","root","http","port","dir","path","name","gui-port","ref","into","prompts","token"]);function rL(t){let e=[],n={},i=!1;for(let s=0;s<t.length;s+=1){let c=t[s]??"";if(i||!c.startsWith("-")){e.push(c);continue}if(c==="--"){i=!0;continue}if(c==="-h"){n.help=!0;continue}if(c==="-v"){n.version=!0;continue}let u=c.replace(/^--?/,""),l=u.indexOf("=");if(l>0){n[u.slice(0,l)]=u.slice(l+1);continue}let d=t[s+1];if(aX.has(u)&&d!==void 0&&!d.startsWith("-")){n[u]=d,s+=1;continue}n[u]=!0}let[r,...o]=e;return{...r===void 0?{}:{command:r},positional:o,flags:n}}a(rL,"parseArgs");function It(t,e){let n=t.flags[e];return typeof n=="string"?n:void 0}a(It,"flagValue");function xe(t,e){return t.flags[e]!==void 0&&t.flags[e]!=="false"}a(xe,"flagSet");function cc(t,e){let n=t.flags[e];if(n===void 0)return;if(n===!0)return 0;let i=Number(n);if(!Number.isFinite(i))throw new Error(`--${e} takes a number, not "${n}".`);return i}a(cc,"flagNumber");var iO=require("node:path");var ii=require("node:fs"),pr=require("node:path");function NE(t,e=""){let n=e.replaceAll("\\","/").replace(/^\/+/,"");return n.length===0?`repo:${t}/`:`repo:${t}/${n}`}a(NE,"locatorFor");function CE(t,e){return{businessId:e.businessId,rootId:e.rootId,machine:e.machine,...e.commit===void 0?{}:{commit:e.commit},at:e.at,facts:t.flatMap(n=>[...n.facts]),auditors:t.map(n=>n.run)}}a(CE,"buildReport");var xs=require("node:fs"),xc=require("node:path");var $v=require("node:fs"),oL=require("node:path");var sL=["package.json","pnpm-lock.yaml","package-lock.json","yarn.lock","Package.swift","Package.resolved","build.gradle","build.gradle.kts","settings.gradle.kts","pom.xml","build.sbt","requirements.txt","pyproject.toml","Cargo.toml","go.mod","Gemfile"],cX=new Set([".git",".tacticyl"]),_v=".git/config";function kv(t){if(t===void 0)return;let e=new Map,n=null;for(let i of t.split(/\r?\n/)){let r=i.trim();if(r.length===0||r.startsWith("#")||r.startsWith(";"))continue;let o=/^\[remote\s+"([^"]+)"\]$/.exec(r);if(o!==null){n=o[1]??null;continue}if(r.startsWith("[")){n=null;continue}if(n===null)continue;let s=/^url\s*=\s*(.+)$/.exec(r);if(s===null)continue;let c=(s[1]??"").trim();c.length===0||e.has(n)||/^[a-z][a-z0-9+.-]*:\/\/[^/@]*:[^/@]*@/i.test(c)||e.set(n,c)}return e.get("origin")??[...e.values()][0]}a(kv,"remoteOf");function pf(t){let e;try{e=(0,$v.readdirSync)(t)}catch{return[]}let n=[];for(let i of e.sort()){if(cX.has(i))continue;let r;try{r=(0,$v.statSync)((0,oL.join)(t,i)).isDirectory()}catch{continue}n.push(r?`${i}/`:i)}return n}a(pf,"topLevel");function PE(t){let e=new Set(t);return sL.filter(n=>e.has(n))}a(PE,"manifestsIn");var uX=/^\s*(?:ThisBuild\s*\/\s*)?name\s*:=\s*"([^"]+)"/m,iL=/^\s*rootProject\.name\s*=\s*['"]([^'"]+)['"]/m,lX=/<artifactId>\s*([^<\s]+)\s*<\/artifactId>/;function aL(t,e){for(let i of PE(t)){let r=e(i);if(r===void 0)continue;let o;if(i==="build.sbt")o=uX.exec(r)?.[1];else if(i==="settings.gradle.kts")o=iL.exec(r)?.[1];else if(i==="pom.xml")o=lX.exec(r.replace(/<parent>[\s\S]*?<\/parent>/,""))?.[1];else if(i==="package.json")try{let c=JSON.parse(r);typeof c.name=="string"&&(o=c.name)}catch{}let s=o?.trim();if(s!==void 0&&s.length>0)return s}if(!t.includes("settings.gradle"))return;let n=iL.exec(e("settings.gradle")??"")?.[1]?.trim();return n!==void 0&&n.length>0?n:void 0}a(aL,"declaredName");var RE={id:"layout",title:"What is at the top of the repository: manifests, docs/, the directories and the remote",applies:a(()=>!0,"applies"),run:a(t=>{let e=t.top.length>0?t.top:pf(t.path),n=t.remote??kv(t.read(_v)),i=aL(e,o=>t.read(o)),r={kind:"layout",at:t.locator(),paths:e,manifests:PE(e),docs:e.includes("docs/"),...n===void 0?{}:{remote:n},...i===void 0?{}:{name:i}};return Promise.resolve([r])},"run")};var zr=require("node:fs"),gn=require("node:path");var cL=new Set([".git",".tacticyl",".idea",".vscode",".gradle",".build",".next",".svelte-kit",".turbo",".terraform",".venv","venv","__pycache__","node_modules",".pnpm-store","dist","build","out","target","coverage","vendor","Pods","Carthage","DerivedData","keys","certs","secrets","infisical","credentials"]),uL=12,lL=2e4,dX=4,fX=4e3;function dL(t,e,n,i){let r=e.wanted??(()=>!0),o=e.enter,s=[],c=!1,u=a((l,d)=>{if(!(c||d>=n))for(let f of t(l)){if(c)return;let p=f.endsWith("/"),m=p?f.slice(0,-1):f,g=l===""?m:`${l}/${m}`;if(p){if(cL.has(m)||m==="worktrees"&&l===".claude"||o!==void 0&&!o(g))continue;u(g,d+1);continue}if(r(g,m)){if(s.length>=i){c=!0;return}s.push({path:g,directory:l,name:m})}}},"visit");return u("",0),{files:s,truncated:c}}a(dL,"traverse");function pX(t){let e=(0,gn.resolve)(t);try{e=(0,zr.realpathSync)(e)}catch{}let n=e.endsWith(gn.sep)?e:e+gn.sep,i=new Set;return r=>{let o=r===""?e:(0,gn.join)(e,r),s;try{s=(0,zr.realpathSync)(o)}catch{return[]}if(s!==e&&!s.startsWith(n))return[];if(i.has(s))return[];i.add(s);let c;try{c=(0,zr.readdirSync)(o).sort()}catch{return[]}let u=[];for(let l of c){let d;try{d=(0,zr.statSync)((0,gn.join)(o,l)).isDirectory()}catch{continue}u.push(d?`${l}/`:l)}return u}}a(pX,"listingOf");function bt(t,e={}){return dL(pX(t),e,e.maxDepth??uL,e.maxFiles??lL)}a(bt,"walkFiles");function zt(t,e={}){let n=dL(i=>t.list(i),e,e.maxDepth??dX,e.maxFiles??fX);return{files:n.files.map(i=>i.path),truncated:n.truncated}}a(zt,"walk");function jE(t,e,n={}){return zt(t,{...n,wanted:a((i,r)=>e.has(r),"wanted")}).files}a(jE,"filesNamed");function fL(t){return t.split(gn.sep).join("/").replace(/^\/+/,"")}a(fL,"normalize");function ms(t,e){let n=(0,gn.resolve)(t,e),i=(0,gn.resolve)(t);if(!(n!==i&&!n.startsWith(i.endsWith(gn.sep)?i:i+gn.sep)))try{return(0,zr.statSync)(n).isFile()?(0,zr.readFileSync)(n,"utf8"):void 0}catch{return}}a(ms,"readText");function uc(t,e,n=4e3){let i=ms(t,e);return i===void 0?void 0:i.slice(0,n)}a(uc,"readHead");function Vn(t){let e=fL(t).replace(/\/+$/,"");return e.length===0?"":`${e}/`}a(Vn,"asDirectory");function mX(t){return t.replaceAll(/[-_.]/g,".")}a(mX,"accessorOf");function zE(t){let e=new Map,n=new Map,i="";for(let r of t.split(`
|
|
231
|
+
`)){let o=r.replace(/#.*$/,"").trim();if(o.length===0)continue;let s=/^\[([A-Za-z-]+)\]$/.exec(o);if(s!==null){i=s[1]??"";continue}let c=o.indexOf("=");if(c<=0)continue;let u=o.slice(0,c).trim(),l=o.slice(c+1).trim();if(i==="versions"){let w=/^"([^"]*)"$/.exec(l);w!==null&&e.set(u,w[1]??"");continue}if(i!=="libraries")continue;let d=/module\s*=\s*"([^"]+)"/.exec(l)?.[1],f=/\bgroup\s*=\s*"([^"]+)"/.exec(l)?.[1],p=/\bname\s*=\s*"([^"]+)"/.exec(l)?.[1],m=d??(f===void 0||p===void 0?void 0:`${f}:${p}`);if(m===void 0||!m.includes(":"))continue;let g=/version\.ref\s*=\s*"([^"]+)"/.exec(l)?.[1]??/version\s*=\s*\{[^}]*\bref\s*=\s*"([^"]+)"/.exec(l)?.[1],v=/\bversion\s*=\s*"([^"]+)"/.exec(l)?.[1]??(g===void 0?"":e.get(g)??g);n.set(mX(u),{name:m,version:v})}return n}a(zE,"readCatalog");function pL(t,e){let n=new RegExp(`\\b(${e.join("|")})\\s*\\(\\s*(?:platform\\s*\\(\\s*)?libs\\.([A-Za-z0-9_.]+)`,"g"),i=[];for(let r of t.matchAll(n)){let o=r[2];o!==void 0&&i.push({accessor:o,scope:r[1]??""})}return i}a(pL,"catalogReferences");function xv(t){let e=t.lastIndexOf("/");return e===-1?"":t.slice(0,e)}a(xv,"dirOf");function Bn(t,e,n,i,r){let o=t.locator(e),s=new Set,c=[];for(let u of i){if(u.name.length===0||s.has(u.name))continue;s.add(u.name);let l=r?.(u.name);c.push({kind:"dependency",at:o,package:u.name,version:u.version,ecosystem:n,source:"manifest",manifest:o,...u.scope===void 0?{}:{scope:u.scope},...l===void 0||l===u.version?{}:{resolved:l}})}return c}a(Bn,"factsFrom");function Sv(t,e,n){return{kind:"dependency",at:t.locator(e),package:n.package,version:"",ecosystem:"signal",source:n.source,...n.evidence===void 0?{}:{evidence:hX(n.evidence)}}}a(Sv,"signalFact");function hX(t){let e=t.replaceAll(/\s+/g," ").trim();return e.length>160?`${e.slice(0,159)}\u2026`:e}a(hX,"trim");var mL=["implementation","api","compileOnly","runtimeOnly","annotationProcessor","kapt","ksp","testImplementation","testRuntimeOnly","androidTestImplementation","jooqGenerator"];function gX(t){return t.replaceAll(/\/\*[\s\S]*?\*\//g,"").split(`
|
|
232
|
+
`).map(e=>{let n=e.indexOf("//");return n===-1||n>0&&e[n-1]===":"?e:e.slice(0,n)}).join(`
|
|
233
|
+
`)}a(gX,"withoutComments");function yX(t){let e=t.split(":");if(e.length<2)return null;let n=e[0]??"",i=e[1]??"";return n.length===0||i.length===0||n.includes(" ")||i.includes(" ")?null:{name:`${n}:${i}`,version:e.slice(2).join(":")}}a(yX,"splitCoordinate");function vX(t,e){let n=e.includes("/")?e.slice(0,e.lastIndexOf("/")):"";for(;;){let i=n===""?"gradle/libs.versions.toml":`${n}/gradle/libs.versions.toml`,r=t.read(i);if(r!==void 0)return zE(r);if(n==="")return new Map;n=n.includes("/")?n.slice(0,n.lastIndexOf("/")):""}}a(vX,"catalogFor");function DE(t,e){let n=t.read(e);if(n===void 0)return[];let i=gX(n),r=mL.join("|"),o=new RegExp(`\\b(${r})\\s*[( ]\\s*["']([^"']+)["']`,"g"),s=[];for(let u of i.matchAll(o)){let l=yX(u[2]??"");l!==null&&s.push({name:l.name,version:l.version,scope:u[1]??""})}let c=vX(t,e);if(c.size>0)for(let u of pL(i,mL)){let l=c.get(u.accessor);l!==void 0&&s.push({name:l.name,version:l.version,scope:u.scope})}return Bn(t,e,"gradle",s)}a(DE,"gradleDependencies");function hL(t,e){let n=t.read(e);if(n===void 0)return[];let i=n.replaceAll(/<!--[\s\S]*?-->/g,""),r=[];for(let o of i.matchAll(/<dependency>([\s\S]*?)<\/dependency>/g)){let s=o[1]??"",c=/<groupId>\s*([^<\s][^<]*?)\s*<\/groupId>/.exec(s)?.[1],u=/<artifactId>\s*([^<\s][^<]*?)\s*<\/artifactId>/.exec(s)?.[1];c===void 0||u===void 0||r.push({name:`${c}:${u}`,version:/<version>\s*([^<\s][^<]*?)\s*<\/version>/.exec(s)?.[1]??"",scope:/<scope>\s*([^<\s][^<]*?)\s*<\/scope>/.exec(s)?.[1]??"compile"})}return Bn(t,e,"maven",r)}a(hL,"mavenDependencies");var bX=["pnpm-lock.yaml","package-lock.json","yarn.lock"],wX=[["dependencies","dependencies"],["devDependencies","devDependencies"]];function gL(t){if(t!==void 0)try{let e=JSON.parse(t);return typeof e=="object"&&e!==null?e:void 0}catch{return}}a(gL,"parse");function Iv(t){return t.replaceAll(/[\\^$.*+?()[\]{}|]/g,String.raw`\$&`)}a(Iv,"quoted");function $X(t,e){let n=gL(t);if(n===void 0)return;let i=n.packages?.[`node_modules/${e}`]?.version;if(typeof i=="string")return i;let r=n.dependencies?.[e]?.version;return typeof r=="string"?r:void 0}a($X,"versionInPackageLock");function _X(t,e){let i=new RegExp(`^\\s{2,}(?:'${Iv(e)}'|"${Iv(e)}"|${Iv(e)}):\\s*$\\n(?:^\\s+specifier:.*$\\n)?^\\s+version:\\s*(\\S+)\\s*$`,"m").exec(t)?.[1];if(i!==void 0)return i.split("(")[0]?.replaceAll(/^['"]|['"]$/g,"")}a(_X,"versionInPnpmLock");function kX(t,e){let n=Iv(e);return new RegExp(`^"?${n}@(?:npm:)?[^"\\n]*"?(?:,[^\\n]*)?:\\s*$\\n(?:^\\s+.*$\\n)*?^\\s+version:?\\s*"?([^"\\s]+)"?\\s*$`,"m").exec(t)?.[1]}a(kX,"versionInYarnLock");function xX(t,e,n){let i=xv(e);for(let r of bX){let o=t.read(i===""?r:`${i}/${r}`);if(o===void 0)continue;let s=r==="package-lock.json"?$X(o,n):r==="pnpm-lock.yaml"?_X(o,n):kX(o,n);if(s!==void 0)return s}}a(xX,"resolvedVersion");function yL(t,e){let n=gL(t.read(e));if(n===void 0)return[];let i=[];for(let[r,o]of wX)for(let[s,c]of Object.entries(n[r]??{}))typeof c!="string"||s.length===0||i.push({name:s,version:c,scope:o});return Bn(t,e,"npm",i,r=>xX(t,e,r))}a(yL,"npmDependencies");var SX=/^\s*(?:lazy\s+)?val\s+([A-Za-z_][\w]*)\s*(?::\s*String\s*)?=\s*"([^"]*)"/gm,IX=/"([A-Za-z0-9_.-]+)"\s*%{1,3}\s*"([A-Za-z0-9_.-]+)"\s*%\s*(?:"([^"]*)"|([A-Za-z_][\w]*))\s*(?:%\s*(Test|Provided|Runtime|IntegrationTest|Compile|Optional))?/g;function EX(t){return t.replaceAll(/\/\*[\s\S]*?\*\//g,"").split(`
|
|
234
|
+
`).map(e=>{let n=e.indexOf("//");return n===-1||n>0&&e[n-1]===":"?e:e.slice(0,n)}).join(`
|
|
235
|
+
`)}a(EX,"withoutComments");function vL(t){let e=new Map;for(let n of t.matchAll(SX)){let i=n[1];i!==void 0&&!e.has(i)&&e.set(i,n[2]??"")}return e}a(vL,"sbtVals");function bL(t,e){let n=t.read(e);if(n===void 0)return[];let i=EX(n),r=vL(i),o=[];for(let s of i.matchAll(IX)){let c=s[1]??"",u=s[2]??"";if(c.length===0||u.length===0)continue;let l=s[3],d=s[4],f=l??(d===void 0?"":r.get(d)??d);o.push({name:`${c}:${u}`,version:f,scope:(s[5]??"Compile").toLowerCase()})}return Bn(t,e,"sbt",o)}a(bL,"sbtDependencies");function LE(t){return t.trim().toLowerCase().replaceAll(/[-_.]+/g,"-")}a(LE,"normalizePythonName");function $L(t){let e=t.split("#")[0]?.trim()??"";if(e.length===0||e.startsWith("-")||/^[a-z+]+:\/\//i.test(e))return null;let n=/^([A-Za-z0-9][A-Za-z0-9._-]*)\s*(?:\[[^\]]*\])?\s*(.*)$/.exec(e);if(n===null)return null;let i=n[1];if(i===void 0)return null;let r=(n[2]??"").trim();return r.startsWith("@")?null:{name:LE(i),version:r}}a($L,"readRequirement");function _L(t,e){let n=t.read(e);if(n===void 0)return[];let i=[];for(let r of n.split(`
|
|
236
|
+
`)){let o=$L(r);o!==null&&i.push({...o,scope:"requirements"})}return Bn(t,e,"pip",i)}a(_L,"requirementsDependencies");function wL(t,e){let n=e.replaceAll(".",String.raw`\.`);return new RegExp(`^\\[${n}\\]\\s*$([\\s\\S]*?)(?=^\\[|(?![\\s\\S]))`,"m").exec(t)?.[1]}a(wL,"tableBody");function TX(t,e){return new RegExp(`^\\s*${e}\\s*=\\s*\\[([\\s\\S]*?)\\]`,"m").exec(t)?.[1]}a(TX,"arrayValue");function kL(t,e){let n=t.read(e);if(n===void 0)return[];let i=[],r=wL(n,"project")??"";for(let[o,s]of[["dependencies","dependencies"],["optional-dependencies","optional-dependencies"]]){let c=TX(r,o);if(c!==void 0)for(let u of c.matchAll(/["']([^"']+)["']/g)){let l=$L(u[1]??"");l!==null&&i.push({...l,scope:s})}}for(let[o,s]of[["tool.poetry.dependencies","dependencies"],["tool.poetry.group.dev.dependencies","dev-dependencies"]]){let c=wL(n,o);if(c!==void 0)for(let u of c.split(`
|
|
237
|
+
`)){let l=/^\s*([A-Za-z0-9][A-Za-z0-9._-]*)\s*=\s*(.+)$/.exec(u.split("#")[0]??""),d=l?.[1];if(l===null||d===void 0||LE(d)==="python")continue;let f=(l[2]??"").trim(),p=/^["']([^"']*)["']$/.exec(f)?.[1]??f;i.push({name:LE(d),version:p,scope:s})}}return Bn(t,e,"pip",i)}a(kL,"pyprojectDependencies");var AX=[".yaml",".yml",".toml",".env",".ini",".properties",".json"],OX=new Set(["Dockerfile","dockerfile","Procfile","fly.toml"]),NX=[{host:/(?:^|\.)datadoghq\.(?:com|eu)/i,package:"datadog-agent"},{host:/(?:^|\.)grafana\.net|grafana\.com/i,package:"grafana-agent"},{host:/(?:^|\.)nr-data\.net|newrelic\.com/i,package:"newrelic-agent"},{host:/(?:^|\.)honeycomb\.io/i,package:"honeycomb-otlp"}],CX=[{pattern:/\b(?:datadog\/agent|gcr\.io\/datadoghq|dd-agent|install_agent|datadoghq\.com)/i,package:"datadog-agent"},{pattern:/\b(?:grafana\/agent|grafana\/alloy|grafana\.com\/oss\/agent)/i,package:"grafana-agent"},{pattern:/\b(?:newrelic\/|newrelic-infra|download\.newrelic\.com)/i,package:"newrelic-agent"},{pattern:/\botel\/opentelemetry-collector/i,package:"opentelemetry-collector"},{pattern:/\b(?:elastic\/apm|artifacts\.elastic\.co)/i,package:"elastic-apm-agent"}],PX=/^\s*(?:FROM|RUN|COPY|ADD|ENTRYPOINT|CMD)\b/i;function RX(t){return OX.has(t)||t.startsWith("Dockerfile")?!0:AX.some(e=>t.endsWith(e))}a(RX,"isConfigFile");function jX(t){let e=[],n=new Set,i=[/OTEL_EXPORTER_OTLP(?:_TRACES|_METRICS|_LOGS)?_ENDPOINT\s*[:=]\s*["']?([^\s"'#,]+)/gi,/\botlp(?:_?http|_?grpc)?\s*:\s*[\s\S]{0,120}?endpoint\s*:\s*["']?([^\s"'#,]+)/gi];for(let r of i)for(let o of t.matchAll(r)){let s=(o[1]??"").trim();if(s.length===0||n.has(s))continue;n.add(s);let c=NX.find(u=>u.host.test(s));e.push({url:s,package:c?.package??"opentelemetry-exporter"})}return e}a(jX,"otlpEndpointsIn");function zX(t){if(t.length>2e6||!t.includes('"panels"'))return!1;try{let e=JSON.parse(t);if(typeof e!="object"||e===null)return!1;let n=e,i=n.panels??n.dashboard?.panels;return Array.isArray(i)?n.schemaVersion!==void 0||n.__inputs!==void 0||n.uid!==void 0||n.templating!==void 0:!1}catch{return!1}}a(zX,"isGrafanaDashboard");function DX(t){let e=[],n=new Set;for(let i of t.split(`
|
|
238
|
+
`)){let r=i.split("#")[0]??"";if(PX.test(r))for(let o of CX)!o.pattern.test(r)||n.has(o.package)||(n.add(o.package),e.push({package:o.package,line:r}))}return e}a(DX,"agentsInDockerfile");function xL(t){let e=[],n=zt(t,{maxDepth:5,wanted:a((i,r)=>RX(r),"wanted")});for(let i of n.files){let r=t.read(i);if(r===void 0||r.length>1e6)continue;if(i.endsWith(".json")){zX(r)&&e.push(Sv(t,i,{package:"grafana-dashboard",source:"dashboard"}));continue}let o=i.slice(i.lastIndexOf("/")+1);if(o.startsWith("Dockerfile")||o.startsWith("dockerfile"))for(let s of DX(r))e.push(Sv(t,i,{package:s.package,source:"dockerfile",evidence:s.line}));for(let s of jX(r))e.push(Sv(t,i,{package:s.package,source:"otel-exporter",evidence:s.url}))}return e}a(xL,"signalFacts");function LX(t){let e=t.replace(/\/+$/,""),n=e.slice(e.lastIndexOf("/")+1);return n.endsWith(".git")?n.slice(0,-4):n}a(LX,"packageNameFromUrl");function MX(t,e){let n=e.replaceAll(/[\\^$.*+?()[\]{}|]/g,String.raw`\$&`);return new RegExp(`"(?:package|identity|location)"\\s*:\\s*"[^"]*${n}[^"]*"[\\s\\S]{0,400}?"(version|revision)"\\s*:\\s*"([^"]+)"`,"i").exec(t)?.[2]}a(MX,"resolvedSwiftVersion");function SL(t,e){let n=t.read(e);if(n===void 0)return[];let i=xv(e),r=t.read(i===""?"Package.resolved":`${i}/Package.resolved`),o=[];for(let s of n.matchAll(/\.package\s*\(([\s\S]{0,300}?)\)/g)){let c=s[1]??"",u=/\burl\s*:\s*"([^"]+)"/.exec(c)?.[1];if(u===void 0)continue;let l=LX(u);if(l.length===0)continue;let d=/\b(?:exact|from|branch|revision)\s*:\s*"([^"]+)"/.exec(c)?.[1]??/"([\d.]+)"\s*(?:\.\.[.<]|…)/.exec(c)?.[1]??"";o.push({name:l,version:d,scope:".package(url:)"})}return Bn(t,e,"swift",o,s=>r===void 0?void 0:MX(r,s))}a(SL,"swiftDependencies");var IL=[{name:"package.json",read:yL},{name:"build.gradle.kts",read:DE},{name:"build.gradle",read:DE},{name:"pom.xml",read:hL},{name:"build.sbt",read:bL},{name:"Package.swift",read:SL},{name:"requirements.txt",read:_L},{name:"pyproject.toml",read:kL}],EL=new Set(IL.map(t=>t.name));function ME(t){return[...jE(t,EL,{maxDepth:5})].sort()}a(ME,"manifestPaths");var UE={id:"deps",title:"The packages the code depends on, and the vendors they imply",applies:a(t=>ME(t).length>0||t.top.some(e=>e.startsWith("Dockerfile")),"applies"),run:a(t=>{let e=[];for(let n of ME(t)){let i=n.slice(n.lastIndexOf("/")+1),r=IL.find(o=>o.name===i);r!==void 0&&e.push(...r.read(t,n))}return e.push(...xL(t)),Promise.resolve(e)},"run")};var UX=/^[A-Z_][A-Z0-9_]{1,}$/;function Ev(t){return UX.test(t)}a(Ev,"isEnvName");function FE(t){let e=[],n=new Set;for(let i of t.split(`
|
|
239
|
+
`)){let r=i.trim();if(r.length===0||r.startsWith("#"))continue;let o=r.indexOf("=");if(o<=0)continue;let s=r.slice(0,o).trim().replace(/^export\s+/,"");!Ev(s)||n.has(s)||(n.add(s),e.push(s))}return e}a(FE,"namesInDotEnv");var FX=[/process\s*\.\s*env\s*(?:\.\s*([A-Z_][A-Z0-9_]+)|\[\s*["'`]([A-Z_][A-Z0-9_]+)["'`]\s*\])/g,/(?:Deno\s*\.\s*env\s*\.\s*get\s*\(\s*["'`]([A-Z_][A-Z0-9_]+)["'`]|Bun\s*\.\s*env\s*\.\s*([A-Z_][A-Z0-9_]+))/g,/System\s*\.\s*getenv\s*\(\s*"([A-Z_][A-Z0-9_]+)"/g,/sys\s*\.\s*env\s*(?:\.\s*(?:get|getOrElse)\s*)?\(\s*"([A-Z_][A-Z0-9_]+)"/g,/os\s*\.\s*(?:environ\s*(?:\[\s*["']([A-Z_][A-Z0-9_]+)["']\s*\]|\.\s*get\s*\(\s*["']([A-Z_][A-Z0-9_]+)["'])|getenv\s*\(\s*["']([A-Z_][A-Z0-9_]+)["'])/g,/ProcessInfo\s*\.\s*processInfo\s*\.\s*environment\s*\[\s*"([A-Z_][A-Z0-9_]+)"/g];function qE(t){let e=[],n=new Set;for(let i of FX)for(let r of t.matchAll(i))for(let o of r.slice(1))o===void 0||!Ev(o)||n.has(o)||(n.add(o),e.push(o));return e}a(qE,"namesInCode");function ZE(t){return/\.conf$/i.test(t)||/^(application|bootstrap)[\w.-]*\.(properties|ya?ml)$/i.test(t)}a(ZE,"isConfigFile");var qX=/\$\{\??\s*([A-Z_][A-Z0-9_]+)\s*(?::[^}]*)?\}/g;function VE(t){let e=[],n=new Set;for(let i of t.split(`
|
|
240
|
+
`)){let r=i.trim();if(!(r.startsWith("#")||r.startsWith("//")))for(let o of r.matchAll(qX)){let s=o[1];s===void 0||!Ev(s)||n.has(s)||(n.add(s),e.push(s))}}return e}a(VE,"namesInConfig");var ZX={local:"dev",development:"dev",dev:"dev",staging:"beta",stage:"beta",beta:"beta",test:"beta",production:"prod",prod:"prod",live:"prod"};function BE(t){for(let e of t.split(".")){let n=ZX[e.toLowerCase()];if(n!==void 0)return n}}a(BE,"modeOfFile");function KE(t){return t===".env"||t==="env"||!/^\.?env(\.|$)/i.test(t)?!1:/\.(example|sample|template|dist|defaults)$/i.test(t)}a(KE,"isExampleEnvFile");var VX=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".kt",".kts",".java",".scala",".py",".swift"],TL=512e3,AL=9;function BX(t){return t.slice(t.lastIndexOf("/")+1)}a(BX,"fileName");function HE(t){return[...zt(t,{maxDepth:5,wanted:a((e,n)=>KE(n),"wanted")}).files].sort()}a(HE,"exampleFiles");function WE(t){return[...zt(t,{maxDepth:AL,wanted:a((e,n)=>VX.some(i=>n.endsWith(i)),"wanted")}).files].sort()}a(WE,"sourceFiles");function GE(t){return[...zt(t,{maxDepth:AL,wanted:a((e,n)=>ZE(n),"wanted")}).files].sort()}a(GE,"configFiles");var JE={id:"env",title:"The names of the environment variables the code reads. Values are not included.",applies:a(t=>HE(t).length>0||WE(t).length>0||GE(t).length>0,"applies"),run:a(t=>{let e=[],n=new Set,i=a((r,o,s)=>{let c=`${r}\0${o}`;if(n.has(c))return;n.add(c);let u=s==="example"?BE(BX(r)):void 0;e.push({kind:"env",at:t.locator(r),name:o,file:r,via:s,...u===void 0?{}:{mode:u}})},"add");for(let r of HE(t)){let o=t.read(r);if(o!==void 0)for(let s of FE(o))i(r,s,"example")}for(let r of WE(t)){let o=t.read(r);if(!(o===void 0||o.length>TL))for(let s of qE(o))i(r,s,"code")}for(let r of GE(t)){let o=t.read(r);if(!(o===void 0||o.length>TL))for(let s of VE(o))i(r,s,"code")}return Promise.resolve(e)},"run")};var wF=ta(vF(),1);var bne=["get","put","post","delete","options","head","patch","trace"],wne=3,$ne=/^(openapi|swagger|api)\.(ya?ml|json)$/i;function $c(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}a($c,"isRecord");function _c(t){return typeof t=="string"?t:""}a(_c,"text");function $F(t){let e;try{e=(0,wF.parse)(t)}catch{return}if(!$c(e))return;let n=_c(e.openapi)||_c(e.swagger);if(n==="")return;let i=$c(e.info)?e.info:{},r=$c(e.paths)?e.paths:{},o=[],s=[];for(let[l,d]of Object.entries(r))if($c(d))for(let f of bne){let p=d[f];if(p!=null&&(o.push(`${f.toUpperCase()} ${l}`),!!$c(p)&&Array.isArray(p.tags)))for(let m of p.tags)typeof m=="string"&&s.push(m)}let c=Array.isArray(e.tags)?e.tags.map(l=>$c(l)?_c(l.name):_c(l)).filter(l=>l!==""):[],u=[...new Set([...c,...s])];return{specVersion:n,version:_c(i.version),title:_c(i.title),operations:o,tags:u}}a($F,"parseOpenapi");function bF(t){return bt(t,{enter:a(n=>n.split("/").length<=wne,"enter")}).files.filter(n=>$ne.test(n.name)).map(n=>n.path).sort((n,i)=>n.split("/").length-i.split("/").length)}a(bF,"contractFiles");var NA={id:"openapi",title:"The OpenAPI or Swagger document: its operations, its tags, and its version",applies:a(t=>bF(t.path).length>0,"applies"),run:a(t=>{let e=[];for(let n of bF(t.path)){let i=t.read(n);if(i===void 0)continue;let r=$F(i);r!==void 0&&e.push({kind:"contract",at:t.locator(n),format:r.specVersion.startsWith("2.")?"swagger":"openapi",routes:r.operations.length,operations:r.operations,...r.tags.length===0?{}:{tags:r.tags},...r.version===""?{}:{version:r.version}})}return Promise.resolve(e)},"run")};var _ne=/\.(graphql|gql|graphqls)$/i,kne=4,_F=/^\s*(?:extend\s+)?(type|interface|input|enum|union|scalar)\s+([A-Za-z_][\w]*)/gm,kF=/^\s{2,}([A-Za-z_][\w]*)\s*(?:\([^)]*\))?\s*:/gm;function xne(t,e){let n=t.indexOf("{",e);if(n<0)return"";let i=0;for(let r=n;r<t.length;r+=1){let o=t[r];if(o==="{")i+=1;else if(o==="}"&&(i-=1,i===0))return t.slice(n+1,r)}return""}a(xne,"blockAfter");function Sne(t){let e={Query:"query",Mutation:"mutation",Subscription:"subscription"},n=/schema\s*\{([^}]*)\}/.exec(t);if(n===null)return e;let i={};for(let r of(n[1]??"").split(`
|
|
241
|
+
`)){let o=/^\s*(query|mutation|subscription)\s*:\s*([A-Za-z_][\w]*)/.exec(r);o!==null&&o[1]!==void 0&&o[2]!==void 0&&(i[o[2]]=o[1])}return Object.keys(i).length===0?e:i}a(Sne,"rootTypes");function SF(t){let e=Sne(t),n=[],i=[],r=0;_F.lastIndex=0;let o;for(;(o=_F.exec(t))!==null;){let s=o[1]??"",c=o[2]??"";if(c===""||(n.includes(c)||n.push(c),s==="scalar"||s==="union"))continue;let u=xne(t,o.index+o[0].length),l=e[c];kF.lastIndex=0;let d;for(;(d=kF.exec(u))!==null;){r+=1;let f=d[1]??"";l!==void 0&&f!==""&&i.push(`${l} ${f}`)}}return n.length===0?void 0:{types:n,fields:r,operations:i}}a(SF,"parseGraphql");function xF(t){return bt(t,{enter:a(n=>n.split("/").length<=kne,"enter")}).files.filter(n=>_ne.test(n.name)).map(n=>n.path).sort((n,i)=>n.split("/").length-i.split("/").length)}a(xF,"schemaFiles");var CA={id:"graphql",title:"A GraphQL schema: its types, its fields, and its root operations",applies:a(t=>xF(t.path).length>0,"applies"),run:a(t=>{let e=[];for(let n of xF(t.path)){let i=t.read(n);if(i===void 0)continue;let r=SF(i);r!==void 0&&e.push({kind:"contract",at:t.locator(n),format:"graphql",routes:r.operations.length,operations:r.operations,tags:[`${String(r.types.length)} types`,`${String(r.fields)} fields`,...r.types.slice(0,12)]})}return Promise.resolve(e)},"run")};var Ib=require("node:fs"),PA=require("node:path");var Ine=["prisma/schema.prisma","schema.prisma","db/schema.prisma"],IF=/^\s*model\s+([A-Za-z_][\w]*)\s*\{/gm,Ene=/@@map\(\s*"([^"]+)"\s*\)/,Tne=/Unsupported\(\s*"\s*geometry/i;function Ane(t,e){let n=0;for(let i=e-1;i<t.length;i+=1){let r=t[i];if(r==="{")n+=1;else if(r==="}"&&(n-=1,n===0))return t.slice(e,i)}return""}a(Ane,"blockAfter");function TF(t){let e=[],n=!1;IF.lastIndex=0;let i;for(;(i=IF.exec(t))!==null;){let r=i[1]??"";if(r==="")continue;let o=Ane(t,i.index+i[0].length),s=Ene.exec(o);e.push(s?.[1]??r),Tne.test(o)&&(n=!0)}if(e.length!==0)return{tables:e,features:n?["postgis"]:[]}}a(TF,"parsePrisma");function One(t,e){let n=(0,PA.join)(t,e.replace(/[^/]+$/,""),"migrations"),i;try{i=(0,Ib.readdirSync)(n)}catch{return 0}let r=0;for(let o of i)if(!(o.startsWith(".")||o==="migration_lock.toml"))try{(0,Ib.statSync)((0,PA.join)(n,o)).isDirectory()&&(r+=1)}catch{continue}return r}a(One,"countMigrations");function EF(t){return Ine.find(e=>t.exists(e))}a(EF,"schemaPathIn");var RA={id:"prisma",title:"A Prisma schema: the mapped table names, PostGIS columns, and how many migrations",applies:a(t=>EF(t)!==void 0,"applies"),run:a(t=>{let e=EF(t);if(e===void 0)return Promise.resolve([]);let n=t.read(e);if(n===void 0)return Promise.resolve([]);let i=TF(n);if(i===void 0)return Promise.resolve([]);let r=One(t.path,e),o={kind:"schema",at:t.locator(e),format:"prisma",tables:i.tables,...i.features.length===0?{}:{features:i.features},...r===0?{}:{migrations:r}};return Promise.resolve([o])},"run")};var AF=new Set(["flyway_schema_history","schema_version","schema_migrations","_prisma_migrations","alembic_version","goose_db_version","__diesel_schema_migrations"]);function OF(t){return t.replace(/--[^\n]*/g," ").replace(/\/\*[\s\S]*?\*\//g," ").replace(/'(?:[^']|'')*'/g," '' ").replace(/\$\$[\s\S]*?\$\$/g," ")}a(OF,"stripNoise");function Eb(t){return(t.split(".").pop()??t).replace(/["`[\]]/g,"").trim()}a(Eb,"bareName");var Nne=/\bCREATE\s+(?:UNLOGGED\s+|TEMP(?:ORARY)?\s+|GLOBAL\s+|LOCAL\s+)*TABLE\s+(?:IF\s+NOT\s+EXISTS\s+)?([\w".`[\]]+)/gi,Cne=/\bDROP\s+TABLE\s+(?:IF\s+EXISTS\s+)?((?:[\w".`[\]]+\s*,\s*)*[\w".`[\]]+)/gi,Pne=/\bALTER\s+TABLE\s+(?:IF\s+EXISTS\s+)?([\w".`[\]]+)\s+RENAME\s+TO\s+([\w".`[\]]+)/gi;function NF(t){let e=[],n=a((i,r,o)=>{i.lastIndex=0;let s;for(;(s=i.exec(t))!==null;)e.push({at:s.index,kind:r,names:o(s)})},"scan");return n(Nne,"create",i=>[Eb(i[1]??"")]),n(Cne,"drop",i=>(i[1]??"").split(",").map(r=>Eb(r))),n(Pne,"rename",i=>[Eb(i[1]??""),Eb(i[2]??"")]),e.sort((i,r)=>i.at-r.at)}a(NF,"changesIn");function Vf(t){let e=[];for(let n of t)for(let i of NF(OF(n))){if(i.kind==="create"){let c=i.names[0]??"";if(c===""||AF.has(c.toLowerCase()))continue;e.includes(c)||e.push(c);continue}if(i.kind==="drop"){for(let c of i.names){let u=e.indexOf(c);u>=0&&e.splice(u,1)}continue}let[r,o]=i.names;if(r===void 0||o===void 0)continue;let s=e.indexOf(r);s>=0?e[s]=o:e.includes(o)||e.push(o)}return e}a(Vf,"tablesAfter");function Bf(t){let e=[],n=[];for(let i of t)for(let r of NF(OF(i))){if(r.kind==="create"){let c=r.names[0]??"";c!==""&&!AF.has(c.toLowerCase())&&e.push(c);continue}if(r.kind==="drop"){for(let c of r.names)e.includes(c)&&n.push({kind:"drop",name:c});continue}let[o,s]=r.names;o===void 0||s===void 0||e.includes(o)&&(e.push(s),n.push({kind:"rename",name:o,to:s}))}return n}a(Bf,"destructionsIn");var Rne=/^([VUR])((?:\d+)(?:[._]\d+)*)?__(.+)\.sql$/,jne=["db/migration","db/migrations"],zne=/(^|\/)prisma\/migrations$/,Dne=2;function PF(t){let e=Rne.exec(t);if(e===null)return;let n=(e[2]??"").split(/[._]/).filter(i=>i!=="").map(i=>Number(i));return{prefix:e[1]??"V",version:n}}a(PF,"readMigrationName");function Lne(t,e){for(let n=0;n<Math.max(t.length,e.length);n+=1){let i=(t[n]??-1)-(e[n]??-1);if(i!==0)return i}return 0}a(Lne,"compareVersions");function CF(t){let e=bt(t),n=new Map,i=new Map;for(let r of e.files){if(!r.name.toLowerCase().endsWith(".sql")||zne.test(r.directory))continue;i.set(r.directory,(i.get(r.directory)??0)+1);let o=PF(r.name);if(o===void 0)continue;let s=n.get(r.directory)??[];s.push({path:r.path,name:r.name,...o}),n.set(r.directory,s)}for(let[r,o]of n){if(jne.some(c=>r.endsWith(c)))continue;let s=i.get(r)??0;o.length>=Dne&&o.length===s||n.delete(r)}return[...n.entries()].map(([r,o])=>({directory:r,migrations:o.slice().sort((s,c)=>{let u=s.prefix==="R",l=c.prefix==="R";return u!==l?u?1:-1:u?s.name.localeCompare(c.name):Lne(s.version,c.version)||s.name.localeCompare(c.name)})})).sort((r,o)=>r.directory.localeCompare(o.directory))}a(CF,"flywayDirectories");var jA={id:"flyway",title:"A Flyway migration directory: the tables the versioned migrations leave behind",applies:a(t=>CF(t.path).length>0,"applies"),run:a(t=>{let e=[];for(let n of CF(t.path)){let i=n.migrations.filter(c=>c.prefix!=="U"),r=i.map(c=>t.read(c.path)).filter(c=>c!==void 0),o=Vf(r);if(o.length===0)continue;let s=Bf(r);e.push({kind:"schema",at:t.locator(Vn(n.directory)),format:"flyway",tables:o,migrations:i.length,...s.length===0?{}:{destructive:s}})}return Promise.resolve(e)},"run")};var Mne=/(^|\/)(migrations|migrate|sql\/migrations)$/,Une=/(^|\/)(prisma\/migrations|db\/migration|db\/migrations)$/,Fne=/^[\w.+-]+\.sql$/i,qne=/(^|[._-])(seed|seeds|fixture|fixtures|down|undo|rollback)([._-]|\.sql$)/i;function RF(t){let e=bt(t),n=new Map;for(let i of e.files){if(!Fne.test(i.name)||!Mne.test(i.directory)||Une.test(i.directory)||qne.test(i.name))continue;let r=n.get(i.directory)??[];r.push(i.path),n.set(i.directory,r)}return[...n.entries()].map(([i,r])=>({directory:i,files:r.slice().sort()})).sort((i,r)=>i.directory.localeCompare(r.directory))}a(RF,"migrationDirectories");var zA={id:"migrations",title:"A plain migrations directory: the tables its .sql files leave behind",applies:a(t=>RF(t.path).length>0,"applies"),run:a(t=>{let e=[];for(let n of RF(t.path)){let i=n.files.map(s=>t.read(s)).filter(s=>s!==void 0),r=Vf(i);if(r.length===0)continue;let o=Bf(i);e.push({kind:"schema",at:t.locator(Vn(n.directory)),format:"sql",tables:r,migrations:n.files.length,...o.length===0?{}:{destructive:o}})}return Promise.resolve(e)},"run")};var DF=/generated\s+by\s+j\s*OOQ/i,Zne=/Generator:\s*([^\n]+)/i,jF=/\bthe\s+table\s+([\w"`]+(?:\.[\w"`]+)*)/gi,LF=/\.(kt|java|scala)$/i;function Vne(t){return(t.split(".").pop()??t).replace(/["`]/g,"").trim().toLowerCase()}a(Vne,"bare");function Tb(t){let e=bt(t),n=[];for(let i of e.files){if(!LF.test(i.name))continue;let r=uc(t,i.path,2e3);if(r===void 0||!DF.test(r))continue;let o=n.find(l=>i.directory===l.directory||i.directory.startsWith(`${l.directory}/`)),s=o??{directory:i.directory,generator:"",tables:[],files:0};if(o===void 0){for(let l=n.length-1;l>=0;l-=1){let d=n[l];d===void 0||!d.directory.startsWith(`${s.directory}/`)||(s.tables.push(...d.tables),s.files+=d.files,s.generator===""&&(s.generator=d.generator),n.splice(l,1))}n.push(s)}s.files+=1,s.generator===""&&(s.generator=(Zne.exec(r)?.[1]??"").trim());let c=uc(t,i.path,8e3)??r;jF.lastIndex=0;let u;for(;(u=jF.exec(c))!==null;){let l=Vne(u[1]??"");l!==""&&!s.tables.includes(l)&&s.tables.push(l)}}return n.map(i=>({directory:Vn(i.directory),generator:i.generator,tables:i.tables.slice().sort(),files:i.files})).sort((i,r)=>i.directory.localeCompare(r.directory))}a(Tb,"jooqPackages");var Bne=new Set(["build.gradle","build.gradle.kts","pom.xml","build.sbt"]),Kne=/(?:^|\n)\s*import\s+(?:static\s+)?org\.jooq\b/;function Hne(t){return t.split("/").some(e=>/^(test|tests|testFixtures|[a-z]+Test)$/.test(e))}a(Hne,"isTestDirectory");function Wne(t){let e=t.map(r=>r===""?[]:r.split("/")),n=e[0]??[],i=0;for(;i<n.length&&e.every(r=>r[i]===n[i]);)i+=1;return n.slice(0,i).join("/")}a(Wne,"sharedDirectory");function zF(t,e){let n=t===""?[]:t.split("/");for(let i=n.length;i>0;i-=1){let r=n.slice(0,i).join("/");if(e.has(r))return r}return""}a(zF,"moduleOf");function DA(t,e=Tb(t)){let n=bt(t),i=new Set;for(let s of n.files)Bne.has(s.name)&&i.add(s.directory);let r=new Set(e.map(s=>zF(s.directory.replace(/\/$/,""),i))),o=new Map;for(let s of n.files){if(!LF.test(s.name)||Hne(s.directory))continue;let c=ms(t,s.path);if(c===void 0||!Kne.test(c.slice(0,8e3))||DF.test(c.slice(0,2e3)))continue;let u=zF(s.directory,i);if(r.has(u))continue;let l=o.get(u)??{directories:new Set,files:0};l.directories.add(s.directory),l.files+=1,o.set(u,l)}return[...o.entries()].map(([s,c])=>({module:s,directory:Vn(Wne([...c.directories].sort())),files:c.files})).sort((s,c)=>s.directory.localeCompare(c.directory))}a(DA,"jooqImporters");var LA={id:"jooq",title:"jOOQ: the directory that is the data layer, from generated code or from its imports",applies:a(t=>Tb(t.path).length>0||DA(t.path).length>0,"applies"),run:a(t=>{let e=Tb(t.path),n=DA(t.path,e).map(r=>({kind:"consumer",at:t.locator(r.directory),resource:"postgres",via:"jooq"})),i=e.map(r=>({kind:"consumer",at:t.locator(r.directory),resource:"postgres",via:"jooq",...r.tables.length===0?{}:{tables:r.tables}}));return Promise.resolve([...i,...n])},"run")};var Gne=/\.(swift|ts|tsx|kt|java|py|rb|go|cs|dart|js)$/i,Jne=[{pattern:/generated\s+by\s+openapi-generator[^\n(]*(?:\(generator:\s*([\w.-]+)\))?/i,name:a(t=>t[1]===void 0?"openapi-generator":`openapi-generator ${t[1]}`,"name")},{pattern:/generated\s+by\s+(openapi-typescript)\b/i,name:a(()=>"openapi-typescript","name")},{pattern:/generated\s+by\s+(swagger-codegen)\b/i,name:a(()=>"swagger-codegen","name")},{pattern:/\b(orval)\s+generated\b/i,name:a(()=>"orval","name")},{pattern:/generated\s+by\s+(@?hey-api\/openapi-ts)\b/i,name:a(()=>"hey-api/openapi-ts","name")}],Yne=/(?:source\s+spec|inputSpec|input\s+spec)\s*:?\s*([^\s)]+)/i,Xne=[".openapi-generator","openapi-generator-config.yaml",".swagger-codegen"];function Qne(t){for(let e of Jne){let n=e.pattern.exec(t);if(n===null)continue;let i=Yne.exec(t)?.[1];return{generator:e.name(n),spec:i}}}a(Qne,"generatorIn");function MF(t){let e=t.path,n=[];for(let i of bt(e).files){if(!Gne.test(i.name))continue;let r=uc(e,i.path,2e3);if(r===void 0)continue;let o=Qne(r);if(o===void 0)continue;let s=i.directory,c=i.directory.split("/");for(let l=c.length;l>0;l-=1){let d=c.slice(0,l).join("/");if(Xne.some(f=>t.exists(`${d}/${f}`))){s=d;break}}let u=n.find(l=>s===l.directory||s.startsWith(`${l.directory}/`));if(u===void 0){n.push({directory:s,generator:o.generator,spec:o.spec,files:1});continue}u.files+=1,u.spec??=o.spec}return n.map(i=>({...i,directory:Vn(i.directory)})).sort((i,r)=>i.directory.localeCompare(r.directory))}a(MF,"generatedClients");function UF(t){return MF(t).map(e=>({kind:"client",at:t.locator(e.directory),surface:t.rootId,generator:e.generator,...e.spec===void 0?{}:{spec:e.spec}}))}a(UF,"clientFacts");var Hf=require("node:path");var Kf={prisma:"postgres",jooq:"postgres",sqlc:"postgres","s3 sdk":"object-store","presigned upload urls":"object-store"},ZF=[{module:"@prisma/client",via:"prisma"},{module:".prisma/client",via:"prisma"},{module:"@aws-sdk/s3-request-presigner",via:"presigned upload urls"},{module:"@aws-sdk/client-s3",via:"s3 sdk"},{module:"aws-sdk/clients/s3",via:"s3 sdk"},{module:"minio",via:"s3 sdk"},{module:"software.amazon.awssdk.services.s3",via:"s3 sdk"},{module:"AWSS3",via:"s3 sdk"},{module:"boto3",via:"s3 sdk"}],ere=["presigned upload urls","prisma","jooq","sqlc","s3 sdk"],tre=/\.(ts|tsx|mts|cts|js|jsx|mjs|cjs|kt|kts|java|scala|swift|py|go|rb)$/i,nre=[/^index\.(ts|tsx|mts|js|jsx|mjs|cjs)$/i,/^main\.(ts|js|mjs|py|swift|go|kt)$/i,/^(server|worker|app|cli|daemon)\.(ts|js|mjs)$/i,/^(Application|Main|App)\.(kt|kts|java|scala|swift)$/i,/^__main__\.py$/i],rre=/(?:^|\n)\s*(?:import|export)[\s\S]{0,300}?from\s*['"]([^'"]+)['"]|require\(\s*['"]([^'"]+)['"]\s*\)|import\(\s*['"]([^'"]+)['"]\s*\)|(?:^|\n)\s*import\s*['"]([^'"]+)['"]/g,ire=/(?:^|\n)\s*import\s+(?:static\s+)?([\w.]+(?:\.\*)?)/g,ore=/(?:^|\n)\s*package\s+([\w.]+)/;function sre(t,e){let n=[],r=/\.(kt|kts|java|scala|swift)$/i.test(t)?ire:rre;r.lastIndex=0;let o;for(;(o=r.exec(e))!==null;){let s=o[1]??o[2]??o[3]??o[4];s!==void 0&&s.length>0&&n.push(s)}return n}a(sre,"importsOf");function VF(t){let e;for(let n of ZF)(t===n.module||t.startsWith(`${n.module}/`)||t.startsWith(`${n.module}.`))&&(e===void 0||n.module.length>e.module.length)&&(e=n);return e?.via}a(VF,"mechanismOf");function are(t,e){let n=t===""?[]:t.split("/");for(let i of e.split("/"))i===""||i==="."||(i===".."?n.pop():n.push(i));return n.join("/")}a(are,"joinRelative");function BF(t,e){let n=are(t,e),i=(0,Hf.basename)(n);return/\.[a-z]+$/i.test(i)?(0,Hf.dirname)(n).replace(/^\.$/,""):n}a(BF,"resolveRelative");function KF(t){let e=new Map,n=new Map,i=new Map;for(let r of bt(t).files){if(!tre.test(r.name))continue;let o=e.get(r.directory)??[];if(o.push(r),e.set(r.directory,o),/\.(kt|kts|java|scala)$/i.test(r.name)){let c=ore.exec(ms(t,r.path)?.slice(0,2e3)??"")?.[1];c!==void 0&&!n.has(c)&&n.set(c,r.directory)}}for(let r of[...e.keys()].sort((o,s)=>o.split("/").length-s.split("/").length)){let o=(0,Hf.basename)(r);i.has(o)||i.set(o,r)}return{directories:e,packages:n,modules:i}}a(KF,"readSourceTree");function cre(t,e,n){if(n.startsWith(".")){let r=BF(e,n);return t.directories.has(r)?r:void 0}let i=n.replace(/\.\*$/,"").split(".");for(let r=i.length;r>0;r-=1){let o=t.packages.get(i.slice(0,r).join("."));if(o!==void 0)return o}return n.includes(".")?void 0:t.modules.get(n)}a(cre,"resolveSpecifier");function FF(t,e){return t===e||t.startsWith(`${e}/`)}a(FF,"within");function ure(t,e=KF(t)){let n=[];for(let[i,r]of e.directories){let o=[],s=[],c=!1;for(let u of r){nre.some(d=>d.test(u.name))&&(c=!0);let l=ms(t,u.path);if(l!==void 0)for(let d of sre(u.name,l)){let f=VF(d);f!==void 0&&!o.includes(f)&&o.push(f);let p=cre(e,u.directory,d);p!==void 0&&p!==i&&!s.includes(p)&&s.push(p)}}n.push({directory:i,direct:o,imports:s,unit:c})}return n.sort((i,r)=>i.directory.localeCompare(r.directory))}a(ure,"buildGraph");function qF(t){let e=new Map;for(let n of ere){if(!t.includes(n))continue;let i=Kf[n];e.has(i)||e.set(i,n)}return[...e.values()]}a(qF,"byKind");function MA(t,e){let n=ure(t,e??KF(t)),i=new Map(n.map(o=>[o.directory,o])),r=[];for(let o of n)for(let s of qF(o.direct))r.push({directory:o.directory,via:s,direct:!0});for(let o of n){if(!o.unit)continue;let s=[],c=new Set([o.directory]),u=[...o.imports];for(;u.length>0;){let l=u.shift();if(l===void 0||c.has(l))continue;c.add(l);let d=i.get(l);if(d!==void 0){if(!FF(l,o.directory)&&!FF(o.directory,l))for(let f of d.direct)s.includes(f)||s.push(f);u.push(...d.imports)}}for(let l of qF(s))r.some(f=>f.directory===o.directory&&Kf[f.via]===Kf[l])||r.push({directory:o.directory,via:l,direct:!1})}return r.map(o=>({...o,directory:Vn(o.directory)})).sort((o,s)=>o.directory.localeCompare(s.directory)||o.via.localeCompare(s.via))}a(MA,"consumerEdges");var UA={id:"imports",title:"The import graph: which directories reach a database or an object store, and how",applies:a(()=>!0,"applies"),run:a(t=>{let e=MA(t.path).map(n=>({kind:"consumer",at:t.locator(n.directory),resource:Kf[n.via],via:n.via}));return Promise.resolve([...e,...UF(t)])},"run")};var lre=/^(docker-)?compose(\.[\w.-]+)?\.ya?ml$/i,dre=[{match:/(^|\/)(postgres|postgis\/postgis|pgvector\/pgvector)(:|$)/,resource:"postgres"},{match:/(^|\/)(mysql|mariadb)(:|$)/,resource:"mysql"},{match:/(^|\/)(minio\/minio|localstack\/localstack)(:|$)/,resource:"object-store"},{match:/(^|\/)(redis|valkey\/valkey)(:|$)/,resource:"cache"},{match:/(^|\/)(rabbitmq|nats)(:|$)/,resource:"queue"},{match:/(^|\/)(elasticsearch|opensearchproject\/opensearch|typesense\/typesense)(:|$)/,resource:"search"},{match:/(^|\/)(nginx|caddy|traefik)(:|$)/,resource:"proxy"},{match:/(^|\/)(axllent\/mailpit|mailhog\/mailhog)(:|$)/,resource:"mail-catcher"}];function WF(t){let e=t.replace(/^docker\.io\//,"");return dre.find(n=>n.match.test(e))?.resource}a(WF,"resourceOf");function fre(t){return t.startsWith("localhost/")||t.startsWith("${")}a(fre,"isBuilt");function HF(t){return[...zt(t,{maxDepth:4,wanted:a((e,n)=>lre.test(n),"wanted")}).files].filter(e=>!e.includes("node_modules/")).sort()}a(HF,"composeFiles");function GF(t){let e=[],n=!1,i=-1,r=null,o=!1,s=a(()=>{r!==null&&(e.push({name:r.name,...r.image===void 0?{}:{image:r.image},ports:r.ports,built:r.built}),r=null)},"close");for(let c of t.split(`
|
|
242
|
+
`)){let u=c.replace(/\t/g," ");if(u.trim().length===0||u.trim().startsWith("#"))continue;let l=u.length-u.trimStart().length,d=u.trim();if(l===0){s(),n=/^services:\s*$/.test(d),i=-1;continue}if(!n)continue;if(i===-1||l===i){let p=/^([A-Za-z0-9][\w.-]*):\s*$/.exec(d);if(p!==null){s(),i=l,r={name:p[1]??"",ports:[],built:!1},o=!1;continue}}if(r===null||l<=i)continue;if(o&&d.startsWith("- ")){let p=d.slice(2).trim().replace(/^['"]|['"]$/g,"");/^[\w.:${}/-]+$/.test(p)&&r.ports.push(p);continue}o=!1;let f=/^image:\s*(.+)$/.exec(d);if(f!==null){let p=(f[1]??"").trim().replace(/^['"]|['"]$/g,"");r.image=p,r.built||=fre(p);continue}if(/^build:/.test(d)){r.built=!0;continue}if(/^ports:\s*$/.test(d)){o=!0;continue}}return s(),e}a(GF,"composeServices");var FA={id:"compose",title:"The services a compose file runs, with their names, images and ports. Values are not included.",applies:a(t=>HF(t).length>0,"applies"),run:a(t=>{let e=[];for(let n of HF(t)){let i=t.read(n);if(i!==void 0)for(let r of GF(i)){let o=r.image===void 0?void 0:WF(r.image);e.push({kind:"compose",at:t.locator(n),service:r.name,...r.image===void 0?{}:{image:r.image},...r.ports.length===0?{}:{ports:r.ports},...o===void 0||r.built?{}:{resource:o},...r.built?{built:!0}:{},file:n})}}return Promise.resolve(e)},"run")};var qA=/^(deploy|deployment|ops|infra|infrastructure|scripts)(\/|$)/,JF=/^(deploy|release|provision|up|install)[\w.-]*\.(py|sh|bash|mjs|ts|js)$/i,YF=/^(Containerfile|Dockerfile)([.\w-]*)$/,XF=/^(supervisord?|supervisor)[\w.-]*\.conf$/i,pre=/^\[program:([\w.-]+)\]/gm,mre=["podman","docker","nerdctl"];function QF(t){let e=zt(t,{maxDepth:4,wanted:a((n,i)=>qA.test(n)&&(JF.test(i)||XF.test(i))||YF.test(i),"wanted")}).files;return{scripts:e.filter(n=>JF.test(Ab(n))&&qA.test(n)).sort(),containerFiles:e.filter(n=>YF.test(Ab(n))).sort(),supervisors:e.filter(n=>XF.test(Ab(n))&&qA.test(n)).sort()}}a(QF,"deployFiles");function Ab(t){return t.slice(t.lastIndexOf("/")+1)}a(Ab,"base");function e4(t){return mre.find(e=>new RegExp(`\\b${e}\\b`).test(t))}a(e4,"runnerIn");function t4(t){return[...t.matchAll(pre)].map(e=>e[1]??"").filter(e=>e!=="")}a(t4,"programsIn");function hre(t){let e=Ab(t);return/^(?:Containerfile|Dockerfile)[.-]([\w-]+)$/.exec(e)?.[1]??e}a(hre,"imageOf");var ZA={id:"deploy",title:"How this repository gets onto a machine: the runner, the images and the processes",applies:a(t=>{let e=QF(t);return e.scripts.length>0||e.supervisors.length>0},"applies"),run:a(t=>{let e=QF(t),n=[],i=e.containerFiles.map(r=>hre(r)).sort();for(let r of e.scripts){let o=t.read(r);if(o===void 0)continue;let s=e4(o);n.push({kind:"deploy",at:t.locator(r),target:s??"script",via:r,...i.length===0?{}:{images:i}})}for(let r of e.supervisors){let o=t.read(r);if(o===void 0)continue;let s=t4(o);s.length!==0&&n.push({kind:"deploy",at:t.locator(r),target:"supervisord",via:r,processes:s})}return Promise.resolve(n)},"run")};var n4=[{file:/^\.infisical\.json$/,provider:"infisical"},{file:/^\.op\.env$/,provider:"1password"},{file:/^doppler\.yaml$/,provider:"doppler"},{file:/^\.sops\.yaml$/,provider:"sops"},{file:/^vault-agent\.hcl$/,provider:"hashicorp-vault"}],gre=[{name:"infisical",provider:"infisical"},{name:"sops",provider:"sops"}],yre=[{pattern:/\binfisical\s+(run|export)\b/,provider:"infisical"},{pattern:/\bop\s+(run|inject|read|item)\b/,provider:"1password"},{pattern:/\bdoppler\s+run\b/,provider:"doppler"},{pattern:/\bvault\s+kv\b/,provider:"hashicorp-vault"}],r4=/^(deploy|release|provision|up|(op[-_])?secrets?)[\w.-]*\.(py|sh|bash|mjs|ts|js)$/i;function vre(t){return t.replace(/["'`,[\]()]+/g," ")}a(vre,"words");function i4(t){let e=[];for(let n of zt(t,{maxDepth:3,wanted:a((i,r)=>n4.some(o=>o.file.test(r)),"wanted")}).files){let i=n.slice(n.lastIndexOf("/")+1),r=n4.find(o=>o.file.test(i))?.provider;r!==void 0&&e.push({provider:r,file:n})}return e.sort((n,i)=>n.file.localeCompare(i.file))}a(i4,"markers");function o4(t){let e=[];for(let n of["","deploy","ops","infra"])for(let i of t.list(n)){if(!i.endsWith("/"))continue;let r=i.slice(0,-1),o=gre.find(s=>s.name===r)?.provider;o!==void 0&&e.push({provider:o,file:n===""?`${r}/`:`${n}/${r}/`})}return e.sort((n,i)=>n.file.localeCompare(i.file))}a(o4,"markerDirectories");var VA={id:"secrets",title:"Where the secret values come from. Established without reading one",applies:a(t=>i4(t).length>0||o4(t).length>0||zt(t,{maxDepth:3,wanted:a((e,n)=>r4.test(n),"wanted")}).files.length>0,"applies"),run:a(t=>{let e=[],n=new Set,i=a((r,o,s)=>{let c=`${r} ${s}`;n.has(c)||(n.add(c),e.push({kind:"secrets",at:t.locator(s),provider:r,via:o,file:s}))},"add");for(let r of i4(t))i(r.provider,"marker",r.file);for(let r of o4(t))i(r.provider,"directory",r.file);for(let r of zt(t,{maxDepth:3,wanted:a((o,s)=>r4.test(s),"wanted")}).files){let o=t.read(r);if(o!==void 0)for(let s of yre)s.pattern.test(vre(o))&&i(s.provider,"command",r)}return Promise.resolve(e)},"run")};var c4=/(^|\/)src\/main\/(kotlin|java)\//,bre=/\.(kt|java)$/,wre={GetMapping:"GET",PostMapping:"POST",PutMapping:"PUT",DeleteMapping:"DELETE",PatchMapping:"PATCH"},$re=/@(RestController|Controller)\b/;function BA(t){return/"([^"]*)"/.exec(t)?.[1]}a(BA,"literalIn");function s4(t,e){let n=t.replace(/\/+$/,""),i=e.replace(/^\/+/,"");return i===""?n===""?"/":n:`${n}/${i}`}a(s4,"joinPath");function _re(t){if(!$re.test(t))return[];let e=/@(RequestMapping|GetMapping|PostMapping|PutMapping|DeleteMapping|PatchMapping)\s*(\(([^)]*)\))?/g,n=[],i="",r=!1;for(let o of t.matchAll(e)){let s=o[1]??"",c=o[3]??"";if(s==="RequestMapping"&&!r&&!/RequestMethod\./.test(c)){r=!0,i=BA(c)??"";continue}if(s==="RequestMapping"){let l=/RequestMethod\.(GET|POST|PUT|DELETE|PATCH)/.exec(c)?.[1]??"ANY";n.push({method:l,path:s4(i,BA(c)??"\u2026")});continue}let u=wre[s];u!==void 0&&n.push({method:u,path:s4(i,BA(c)??"\u2026")})}return n}a(_re,"springRoutes");function kre(t){let e=t.search(c4);return e<=0?"":t.slice(0,e).replace(/\/+$/,"")}a(kre,"moduleOf");function a4(t){let e=new Map;for(let n of bt(t.path,{wanted:a((i,r)=>bre.test(r)&&c4.test(i),"wanted")}).files){let i=kre(n.path);e.set(i,[...e.get(i)??[],n.path])}return e}a(a4,"byModule");var KA={id:"routes",title:"The HTTP routes declared as Spring annotations.",applies:a(t=>a4(t).size>0,"applies"),run:a(t=>{let e=[];for(let[n,i]of[...a4(t).entries()].sort((r,o)=>r[0].localeCompare(o[0]))){let r=[];for(let o of[...i].sort()){let s=t.read(o);if(s!==void 0)for(let c of _re(s))r.push(`${c.method} ${c.path}`)}r.length!==0&&e.push({kind:"contract",at:t.locator(n===""?"":`${n}/`),format:"spring-annotations",routes:r.length,operations:r,summary:"matched from Spring mapping annotations, not parsed from a document: a route built at run time or behind a custom annotation is not in this count"})}return Promise.resolve(e)},"run")};var $s=require("node:fs"),kc=require("node:path");var rt=".tacticyl";var HA="inbox.md",Wf=`${rt}/${HA}`,Ob=`# Tacticyl inbox
|
|
243
|
+
|
|
244
|
+
Append one line per change: an ISO date, a dash, and one sentence saying what changed and why.
|
|
245
|
+
The next \`tacticyl audit\` reads the lines below, and each new one lands on the Findings page.
|
|
246
|
+
`,xre=/^(\d{4}-\d{2}-\d{2})[\s-]+([^\s-].*)$/;function WA(t){let e=[],n=t.split(/\r?\n/);for(let i=0;i<n.length;i+=1){let r=xre.exec((n[i]??"").trim());if(r===null)continue;let o=r[1],s=(r[2]??"").trim();o===void 0||s.length===0||e.push({date:o,text:s,line:i+1})}return e}a(WA,"parseInbox");function u4(t){return(0,kc.join)((0,kc.resolve)(t),rt,HA)}a(u4,"inboxPath");function GA(t){let e=u4(t);return(0,$s.existsSync)(e)?{path:e,outcome:"kept"}:((0,$s.mkdirSync)((0,kc.dirname)(e),{recursive:!0}),(0,$s.writeFileSync)(e,Ob,"utf8"),{path:e,outcome:"written"})}a(GA,"ensureInbox");var JA={id:"inbox",title:"The lines your coding agents left in .tacticyl/inbox.md",applies:a(t=>t.exists(Wf),"applies"),run:a(t=>{let e=t.read(Wf);if(e===void 0)return Promise.resolve([]);let n=t.locator(Wf),i=WA(e).map(r=>({kind:"inbox",at:n,date:r.date,text:r.text,line:r.line}));return Promise.resolve(i)},"run")};var go="@TACTICYL.md",_s="## The business map\n\n<!-- Added by `tacticyl project`. TACTICYL.md is generated; delete this line to stop importing it. -->";var Sre=/\b(drop|drops|dropped|dropping|delete|deletes|deleted|deleting|destroy|destroys|destructive|truncate|truncates|truncated|reset|resets|resetting|recreate|recreates|wipe|wipes|wiped|rewrite|rewrites|rewriting)\b/i,Ire=/\b(migration|migrations|migrate|schema|schemas|database|databases|db|table|tables|column|columns|prisma|flyway|sql)\b/i,Ere=/\b(never|do not|don't|must not|avoid|no destructive|additive only|forward.only)\b/i;function Tre(t){let e=[],n=1;for(let i of t.split(`
|
|
247
|
+
`)){let r=n;for(let o of i.split(/(?<=[.!?])\s+/)){let s=o.trim();s.length>0&&e.push({line:r,text:s}),r=n}n+=1}return e}a(Tre,"sentences");function YA(t){let e=[];for(let n of Tre(t))Sre.test(n.text)&&Ire.test(n.text)&&e.push({line:n.line,text:n.text.length>240?`${n.text.slice(0,240)}\u2026`:n.text,says:Ere.test(n.text)?"forbids":"permits"});return e}a(YA,"statementsIn");var Are=[{harness:"claude-code",file:"CLAUDE.md"},{harness:"agents.md",file:"AGENTS.md"},{harness:"cursor",directory:".cursor/rules"},{harness:"claude-code",directory:".claude/skills",nested:"SKILL.md"},{harness:"copilot",file:".github/copilot-instructions.md"}],Ore=new Set(["tacticyl.mdc","tacticyl"]),Nre=/\.(md|mdc)$/i,l4=4e4;function d4(t){let e=[];for(let n of Are){if(n.file!==void 0){t.exists(n.file)&&e.push({path:n.file,harness:n.harness});continue}let i=n.directory;if(i!==void 0)for(let r of t.list(i)){let o=r.replace(/\/$/,"");if(Ore.has(o))continue;let s=`${i}/${o}`;if(r.endsWith("/")){let c=n.nested===void 0?void 0:`${s}/${n.nested}`;c!==void 0&&t.exists(c)&&e.push({path:c,harness:n.harness});continue}Nre.test(o)&&e.push({path:s,harness:n.harness})}}return e}a(d4,"agentFilesIn");function XA(t){let e=t.indexOf(Ht);if(e<0)return t;let n=t.indexOf(jt,e);return n<0?t.slice(0,e):`${t.slice(0,e)}${t.slice(n+jt.length)}`}a(XA,"withoutGenerated");function Cre(t){return XA(t).split(`
|
|
248
|
+
`).filter(e=>{let n=e.trim();return n.length>0&&n!==go&&!_s.includes(n)}).join(`
|
|
249
|
+
`)}a(Cre,"founderHalf");function Gf(t){return d4(t).filter(e=>{let n=t.read(e.path);return n!==void 0&&Cre(n.slice(0,l4)).length>0})}a(Gf,"founderAgentFilesIn");var QA={id:"agents",title:"The files that tell your coding agents how to work here",applies:a(t=>Gf(t).length>0,"applies"),run:a(t=>{let e=[];for(let n of Gf(t)){let i=t.read(n.path);if(i===void 0)continue;let r=XA(i.slice(0,l4)),o=YA(r);e.push({kind:"agent-file",at:t.locator(n.path),file:n.path,harness:n.harness,lines:r.split(`
|
|
250
|
+
`).length,...o.length===0?{}:{statements:o}})}return Promise.resolve(e)},"run")};var ks=[RE,UE,JE,NA,CA,RA,jA,zA,LA,UA,FA,ZA,VA,KA,JA,QA];function Nb(t){return ks.find(e=>e.id===t)}a(Nb,"auditorNamed");function eO(){return ks.map(t=>t.id)}a(eO,"auditorIds");function Jf(t){let e=(0,xc.resolve)(t.path),n=a(i=>{let r=(0,xc.resolve)(e,i.replaceAll("\\","/").replace(/^\/+/,""));if(!(r!==e&&!r.startsWith(e.endsWith(xc.sep)?e:e+xc.sep)))return r},"inside");return{path:e,rootId:t.rootId,...t.commit===void 0?{}:{commit:t.commit},...t.remote===void 0?{}:{remote:t.remote},top:pf(e),list:a(i=>{let r=n(i??"");return r===void 0?[]:pf(r)},"list"),exists:a(i=>{let r=n(i);return r!==void 0&&(0,xs.existsSync)(r)},"exists"),read:a(i=>{let r=n(i);if(!(r===void 0||!(0,xs.existsSync)(r)))try{return(0,xs.statSync)(r).isFile()?(0,xs.readFileSync)(r,"utf8"):void 0}catch{return}},"read"),locator:a(i=>NE(t.rootId,i??""),"locator")}}a(Jf,"repoContext");async function tO(t,e=ks){let n=[],i=[];for(let r of e){let o;try{o=r.applies(t)}catch{o=!1}if(!o){i.push(r.id),n.push({run:{id:r.id,ms:0,ok:!0,facts:0,applied:!1},facts:[]});continue}let s=Date.now();try{let c=await r.run(t);n.push({run:{id:r.id,ms:Date.now()-s,ok:!0,facts:c.length,applied:!0},facts:c})}catch(c){n.push({run:{id:r.id,ms:Date.now()-s,ok:!1,error:c instanceof Error?c.message:String(c),facts:0,applied:!0},facts:[]})}}return{ran:n,skipped:i}}a(tO,"runAuditors");var Cb=require("node:fs"),f4=require("node:path");var p4=["README.md","ARCHITECTURE.md","docs/README.md","readme.md","docs/architecture.md"],m4=2e3;function Pb(t,e=3){let n=[],i=new Set;for(let r of p4){if(n.length>=e)break;let o=r.toLowerCase();if(i.has(o))continue;let s=(0,f4.join)(t,r);try{if(!(0,Cb.statSync)(s).isFile())continue}catch{continue}let c=(0,Cb.readFileSync)(s,"utf8").slice(0,m4).trim();c.length!==0&&(i.add(o),o.endsWith("readme.md")&&!o.includes("docs/")&&i.add("readme.md"),o.includes("architecture")&&i.add("docs/architecture.md"),n.push({path:r,text:c}))}return n}a(Pb,"documentsOf");function nO(t,e){return t===null?"unwritten":t===e?"current":"stale"}a(nO,"projectionStateOf");function rO(t){return/^Projected from snapshot `([0-9a-f]{64})`\.$/m.exec(t)?.[1]??null}a(rO,"projectedSnapshotOf");function Ss(t){if(t===void 0)return;let e=t.trim();if(e.length===0)return;let n=/^(?:ssh:\/\/)?git@github\.com[:/]([^/\s]+)\/([^/\s]+?)(?:\.git)?\/?$/i.exec(e);if(n!==null)return h4(n[1],n[2]);let i;try{i=new URL(e)}catch{return}if(i.protocol!=="https:"&&i.protocol!=="http:"||i.hostname.toLowerCase()!=="github.com"&&i.hostname.toLowerCase()!=="www.github.com"||i.username.length>0||i.password.length>0)return;let r=i.pathname.split("/").filter(c=>c.length>0),[o,s]=r;if(!(o===void 0||s===void 0))return h4(o,s.replace(/\.git$/i,""))}a(Ss,"normalizeRemote");function h4(t,e){if(!(t===void 0||e===void 0)&&/^[A-Za-z0-9](?:[A-Za-z0-9-]{0,38})$/.test(t)&&!(!/^[A-Za-z0-9._-]{1,100}$/.test(e)||e==="."||e===".."))return`${t}/${e}`}a(h4,"pair");var Sc="This repository is not linked to a business yet. You can run `tacticyl audit` to draft one from the code.",y4="Next: `tacticyl audit` here. This business does not declare this repository, so the audit proposes it, and you add it on the Findings page.",oi="link";function mr(t){let e=t.trim().replace(/\/+$/,""),n=new URL(e.includes("://")?e:`http://${e}`);return n.origin+(n.pathname==="/"?"":n.pathname.replace(/\/+$/,""))}a(mr,"normalizeService");function Rb(t){return GI((0,pr.basename)((0,pr.resolve)(t)))}a(Rb,"defaultRootId");function v4(t){return(0,pr.join)(t,rt,oi)}a(v4,"linkPathIn");function Xe(t=process.cwd()){let e=(0,pr.resolve)(t);for(;;){let n=v4(e);if((0,ii.existsSync)(n))return{link:jb(n),path:n,repo:e};let i=(0,pr.dirname)(e);if(i===e)return;e=i}}a(Xe,"findLink");function jb(t){let e;try{e=JSON.parse((0,ii.readFileSync)(t,"utf8"))}catch(o){throw new Error(`${t} is not readable as JSON; re-run \`tacticyl link\`.`,{cause:o})}if(typeof e!="object"||e===null)throw new Error(`${t} is not a link: it should be a JSON object.`);let n=e,i=["service","rootId"].filter(o=>typeof n[o]!="string"||n[o].length===0);if(i.length>0)throw new Error(`${t} is missing ${i.join(", ")}; re-run \`tacticyl link\`.`);let r=typeof n.businessId=="string"&&n.businessId.length>0?n.businessId:void 0;return{service:mr(n.service),...r===void 0?{}:{businessId:r},rootId:n.rootId}}a(jb,"readLinkFile");function zb(t,e){let n=v4((0,pr.resolve)(t));(0,ii.mkdirSync)((0,pr.dirname)(n),{recursive:!0});let i=`${JSON.stringify({service:mr(e.service),...e.businessId===void 0||e.businessId.length===0?{}:{businessId:e.businessId},rootId:e.rootId},null,2)}
|
|
251
|
+
`;return(0,ii.writeFileSync)(n,i,"utf8"),n}a(zb,"writeLink");var Pre=1e3;function Rre(t,e={}){if(t===void 0)return{state:a(()=>"same","state")};let n=e.everyMs??Pre,i=e.now??(()=>Date.now()),r=t.link,o="same",s;return{state(){if(o!=="same")return o;let c=i();if(s!==void 0&&c-s<n)return o;if(s=c,!(0,ii.existsSync)(t.path))return o="gone",o;let u;try{u=jb(t.path)}catch{return o}return(u.service!==r.service||u.businessId!==r.businessId||u.rootId!==r.rootId)&&(o="changed"),o}}}a(Rre,"linkWatch");function Db(t){return t.origins.venture==="link"?Rre(t.link):void 0}a(Db,"linkWatchOf");function Is(t){return t!==void 0&&t.state()!=="same"}a(Is,"linkMoved");function b4(t){return t==="changed"?"Tacticyl was set up again in this repository after this connection started. You can reconnect Tacticyl to continue, using `/mcp` in Claude Code or by starting a new session.":"Tacticyl was removed from this repository after this connection started, and its tools are unavailable here. You can set up Tacticyl again and reconnect to use them."}a(b4,"linkRefusal");var w4={title:"This connection is out of date",body:"Tacticyl was set up again or removed in this repository after this connection started. You should restart your agent's connection to Tacticyl."};var _4="https://app.tacticyl.com",k4="published",$4="tacticyl.com";function x4(t,e=k4){if(e==="workspace")return mr(t);let n;try{let r=t.trim();n=new URL(r.includes("://")?r:`https://${r}`)}catch{throw new Error(`${t} is not a valid address. The companion can only connect to https addresses under tacticyl.com.`)}if(n.protocol!=="https:")throw new Error(`The address ${t} was refused because it does not start with https://, and the companion can only connect to https addresses.`);let i=n.hostname.toLowerCase();if(i!==$4&&!i.endsWith(`.${$4}`))throw new Error(`The companion cannot connect to ${i}, and can only connect to tacticyl.com or an address under it, such as app.tacticyl.com.`);return mr(n.href)}a(x4,"allowedService");function S4(t=process.env,e=k4){if(e==="workspace")return;let n=t.NODE_TLS_REJECT_UNAUTHORIZED;if(n!==void 0&&["0","false","no","off"].includes(n.trim().toLowerCase()))throw new Error(`The companion cannot run while NODE_TLS_REJECT_UNAUTHORIZED is set to ${n}, which turns off certificate checks. You should unset it and run the command again.`)}a(S4,"assertVerifiedTls");function Mr(t){return t.hasBusiness??t.businessId.length>0}a(Mr,"hasBusiness");function Lb(t,e,n){return t!==void 0&&t.length>0?{value:t,origin:"flag"}:e!==void 0&&e.length>0?{value:e,origin:"env"}:n!==void 0&&n.length>0?{value:n,origin:"link"}:{value:void 0,origin:"default"}}a(Lb,"pick");function si(t={}){let e=(0,iO.resolve)(t.dir??process.cwd()),n=Xe(e),i=Lb(t.service,process.env.TACTICYL_SERVICE,n?.link.service);return{service:x4(i.value??_4),origin:i.origin}}a(si,"resolveService");async function ct(t={}){let e=(0,iO.resolve)(t.dir??process.cwd()),n=Xe(e),i=Lb(t.service,process.env.TACTICYL_SERVICE,n?.link.service),r=x4(i.value??_4),o=Lb(t.rootId,process.env.TACTICYL_ROOT_ID,n?.link.rootId),s=n?.repo??e,c=new lr({service:r,...t.fetch===void 0?{}:{fetch:t.fetch},...t.credentials===void 0?{}:{credentials:t.credentials}}),u=Lb(t.venture,process.env.TACTICYL_ID,n?.link.businessId),l=u.value,d=u.origin,f=n!==void 0&&n.link.businessId===void 0;if(l===void 0&&t.offline!==!0&&!f){let{ventures:p}=await c.ventures();if(p.length===1)l=p[0]?.id,d="only-business";else if(p.length===0){if(t.businessOptional!==!0)throw new Error(`There are no businesses at ${r}. You can create one in the app, or run \`tacticyl audit\` here to draft one from this repository's code.`)}else if(t.businessOptional!==!0)throw new Error(`${r} has ${String(p.length)} businesses (${p.map(m=>m.id).join(", ")}). Say which with --business, or run \`tacticyl link\` in this repository.`)}if(l===void 0&&t.businessOptional!==!0)throw new Error("No business: name one with --business, or run `tacticyl link` here.");return{dir:e,repo:s,service:r,businessId:l??"",hasBusiness:l!==void 0,rootId:o.value??Rb(s),...n===void 0?{}:{link:n},client:c,origins:{service:i.origin,venture:d,root:o.origin}}}a(ct,"resolveContext");function jre(t){return Object.entries(t).map(([n,i])=>{let r=typeof i=="string"?i:Array.isArray(i)?`[${String(i.length)}]`:typeof i=="object"&&i!==null?"{\u2026}":String(i);return`${n}=${r.length>40?`${r.slice(0,39)}\u2026`:r}`}).join(" ")}a(jre,"summarizeArgs");var zre=200,Dre=50,Es=class{static{a(this,"Journal")}maxLines;maxCalls;lineRing=[];callRing=[];startedAt=new Date().toISOString();constructor(e=zre,n=Dre){this.maxLines=e,this.maxCalls=n}note(e,n="info"){let i={at:new Date().toISOString(),level:n,line:e};for(this.lineRing.push(i);this.lineRing.length>this.maxLines;)this.lineRing.shift();return i}served(e){let n={at:new Date().toISOString(),tool:e.tool,harness:e.harness,args:jre(e.args),ms:e.ms,ok:e.ok,...e.error===void 0?{}:{error:e.error}};for(this.callRing.push(n);this.callRing.length>this.maxCalls;)this.callRing.shift();this.note(`${e.tool}(${n.args}) for ${e.harness} \xB7 ${String(e.ms)}ms${e.ok?"":`, failed: ${e.error??"no reason given"}`}`,e.ok?"info":"warn")}lines(e=this.maxLines){return this.lineRing.slice(-e)}calls(e=this.maxCalls){return this.callRing.slice(-e).reverse()}get uptimeMs(){return Date.now()-Date.parse(this.startedAt)}};var E4=require("node:child_process"),T4=require("node:http"),A4=require("node:os");function Ic(){let t=(0,A4.hostname)().trim().replace(/\s+/g," ").slice(0,80);return t.length===0?"this machine":t}a(Ic,"machineName");function I4(t,e){return`<!doctype html>
|
|
252
|
+
<html lang="en"><head><meta charset="utf-8"><title>${t}</title>
|
|
253
|
+
<style>
|
|
254
|
+
:root { color-scheme: light dark; }
|
|
255
|
+
body { font: 15px/1.6 ui-sans-serif, system-ui, sans-serif; margin: 0; min-height: 100vh;
|
|
256
|
+
display: grid; place-items: center; background: #fbfbfa; color: #1c1b19; }
|
|
257
|
+
@media (prefers-color-scheme: dark) { body { background: #17181a; color: #eceae5; } }
|
|
258
|
+
main { max-width: 28rem; padding: 2rem; }
|
|
259
|
+
h1 { font-size: 1.15rem; margin: 0 0 .5rem; }
|
|
260
|
+
p { margin: 0; color: #55524c; }
|
|
261
|
+
@media (prefers-color-scheme: dark) { p { color: #a9a49c; } }
|
|
262
|
+
</style></head><body><main><h1>${t}</h1><p>${e}</p></main></body></html>`}a(I4,"landingPage");function Lre(t=process.platform){if(t==="darwin")return{command:"open",args:[]};if(t==="win32")return{command:"cmd",args:["/c","start",""]};if(t==="linux")return{command:"xdg-open",args:[]}}a(Lre,"browserCommand");function Yf(t,e=process.platform){let n=Lre(e);if(n===void 0)return!1;try{let i=(0,E4.spawn)(n.command,[...n.args,t],{stdio:"ignore",detached:!0});return i.on("error",()=>{}),i.unref(),!0}catch{return!1}}a(Yf,"openBrowser");async function Mre(t,e){let n=a(()=>{},"settle"),i=a(()=>{},"fail"),r=new Promise((c,u)=>{n=c,i=u}),o=(0,T4.createServer)((c,u)=>{let l=new URL(c.url??"/",`http://${t}`);if(l.pathname!=="/callback"){u.writeHead(404,{"content-type":"text/plain; charset=utf-8"}),u.end("This is `tacticyl login` waiting for its callback. There is nothing else here.\n");return}let d=l.searchParams.get("code");if(d===null||d.length===0){u.writeHead(400,{"content-type":"text/html; charset=utf-8"}),u.end(I4("That callback carried no code","Run <code>tacticyl login</code> again. The approval did not reach this machine.")),i(new Error("Your Tacticyl cloud workspace redirected here without a code. Run `tacticyl login` again."));return}u.writeHead(200,{"content-type":"text/html; charset=utf-8"}),u.end(I4("This machine is connected","Close this tab and go back to the terminal."));let f=l.searchParams.get("machine");n({code:d,...f===null?{}:{machine:f}})});await new Promise((c,u)=>{o.once("error",u),o.listen(e,t,()=>{o.removeListener("error",u),c()})});let s=o.address();return{port:typeof s=="object"&&s!==null?s.port:e,caught:r,close:a(()=>new Promise(c=>o.close(()=>c())),"close")}}a(Mre,"listen");async function Mb(t,e){let n=await t.text();if(!t.ok){let i=P4(n)?.error;throw new Error(i??`${e} failed (${String(t.status)}): ${n.slice(0,200)}`)}return JSON.parse(n)}a(Mb,"jsonOrThrow");async function O4(t){let e=Rn(t.service),n=t.out??(c=>console.log(c)),i=t.fetch??((c,u)=>fetch(c,u)),r=t.credentials??Zn(e,{fetch:i}),o=t.machine??Ic(),s=await Mre(t.host??"127.0.0.1",t.port??0);try{let c=await Mb(await i(`${e}/api/auth/device/start`,{method:"POST",headers:{"content-type":"application/json",...mn()},body:JSON.stringify({machine:o,port:s.port})}),"Starting sign-in");n(`Approve "${o}" in your browser:
|
|
263
|
+
${c.verifyUrl}`);let u=t.open===!1?!1:(t.open??Yf)(c.verifyUrl);u||n(" (no browser here; open that URL on this machine to finish.)");let l=t.timeoutMs??Math.max(c.expiresIn,1)*1e3,d=await Promise.race([s.caught,new Promise((m,g)=>setTimeout(()=>g(new Error(`Nobody approved "${o}" within ${String(Math.round(l/1e3))}s. Run \`tacticyl login\` again.`)),l).unref())]),f=await Mb(await i(`${e}/api/auth/device/exchange`,{method:"POST",headers:{"content-type":"application/json",...mn()},body:JSON.stringify({code:d.code})}),"Exchanging the sign-in code");return{...await N4(i,r,e,f),opened:u,verifyUrl:c.verifyUrl}}finally{await s.close()}}a(O4,"login");async function N4(t,e,n,i){let r=await Ure(t,n,i.token),o={token:i.token,refresh:i.refresh,expiresAt:new Date(Date.now()+i.expiresIn*1e3).toISOString(),service:n,machineId:i.machine.id,machine:i.machine.name,...r===void 0?{}:{account:r},at:new Date().toISOString()};await e.set(n,o);let s=await e.storage?.();return{account:r,machine:i.machine.name,machineId:i.machine.id,expiresAt:o.expiresAt,service:n,storedIn:s?.where??"the credential store",...s?.warning===void 0?{}:{warning:s.warning},...s?.note===void 0?{}:{note:s.note}}}a(N4,"keep");async function C4(t){let e=Rn(t.service),n=t.fetch??((s,c)=>fetch(s,c)),i=t.credentials??Zn(e,{fetch:n}),r=await Mb(await n(`${e}/api/auth/device/exchange`,{method:"POST",headers:{"content-type":"application/json",...mn()},body:JSON.stringify({code:t.code,machine:t.machine??Ic()})}),"Exchanging the code");return{...await N4(n,i,e,r),...r.businessId===void 0?{}:{businessId:r.businessId}}}a(C4,"loginWithCode");async function oO(t){let e=Rn(t.service),n=t.fetch??((i,r)=>fetch(i,r));return Mb(await n(`${e}/api/auth/enroll/describe`,{method:"POST",headers:{"content-type":"application/json",...mn()},body:JSON.stringify({code:t.code})}),"Reading the code")}a(oO,"describeCode");async function Ure(t,e,n){try{let i=await t(`${e}/api/auth/me`,{headers:{authorization:`Bearer ${n}`,...mn()}});if(!i.ok)return;let r=await i.json();return r.user?.name??r.user?.login??void 0}catch{return}}a(Ure,"whoAmI");async function yo(t){let e=Rn(t.service),n=t.fetch??((c,u)=>fetch(c,u)),i=t.credentials??Zn(e,{fetch:n}),r=await i.stored(e);if(r===void 0)return{wasSignedIn:!1,revoked:!1};let o=!1,s;try{let c=await n(`${e}/api/auth/machines/${encodeURIComponent(r.machineId)}/revoke`,{method:"POST",headers:{authorization:`Bearer ${r.token}`,...mn()}});c.ok?o=!0:s=P4(await c.text())?.error??`The token was removed from this machine, but your Tacticyl cloud workspace answered ${String(c.status)} to the sign-out. You can sign this machine out from Account in your workspace to finish.`}catch(c){s=`Your Tacticyl cloud workspace at ${e} did not answer, so it still lists this machine. The token was removed from this machine, and you can sign it out from Account in your workspace when you are back online. (${c instanceof Error?c.message:String(c)})`}finally{await i.clear(e)}return{wasSignedIn:!0,revoked:o,...r.machine===void 0?{}:{machine:r.machine},machineId:r.machineId,...s===void 0?{}:{error:s}}}a(yo,"logout");function P4(t){try{return JSON.parse(t)}catch{return}}a(P4,"safeParse");var Ub=require("node:fs"),sO=require("node:path");async function Fb(t){let e=mr(t.service),n=t.client??new lr({service:e,credentials:Zn(e)}),i=[],r=[],o=!0;try{r=(await n.ventures()).ventures}catch(w){o=!1,i.push(`${e} did not answer (${w instanceof Error?w.message:String(w)}). The link is written anyway; \`tacticyl status\` will tell you when it comes back.`)}let s=t.venture;if(t.noBusiness===!0)s=void 0;else if(s===void 0){if(!o)throw new Error(`${e} did not answer, so the business cannot be guessed. Name it: \`tacticyl link ${e} --business <id>\`, or link without one: \`tacticyl link ${e} --no-business\`.`);if(r.length===1)s=r[0]?.id;else if(r.length>1)throw new Error(`${e} has ${String(r.length)} businesses (${r.map(w=>w.id).join(", ")}). Say which with --business, or link without one with --no-business.`)}s!==void 0&&o&&!r.some(w=>w.id===s)&&i.push(`${e} has no business called "${s}" (it has ${r.map(w=>w.id).join(", ")||"none"}). The link is written; check the id.`);let c=s!==void 0&&o&&r.some(w=>w.id===s)?(await n.venture(s)).venture.roots?.roots??[]:void 0,u=Ss(qb(t.dir)),l=t.rootId===void 0&&u!==void 0?c?.find(w=>w.kind==="repo"&&Ss(w.remote)===u):void 0,d=t.rootId??l?.id??Rb(t.dir),f=t.rootId!==void 0?"flag":l!==void 0?"remote":"directory",p=!1;c!==void 0&&(c.some(w=>w.id===d)||(p=!0,i.push(`The business "${s}" declares no root "${d}" (it has ${c.map(w=>w.id).join(", ")||"none"}). Re-link with --root if that is the wrong id.`)));let m=Fre(t.dir),g=s!==void 0&&m!==void 0&&m!==s?m:void 0,y=r.find(w=>w.id===s)?.name,v={service:e,...s===void 0?{}:{businessId:s},rootId:d};return{...g===void 0?{}:{replaced:g},...y===void 0?{}:{businessName:y},path:zb(t.dir,v),link:v,warnings:i,inbox:GA(t.dir),rootFrom:f,...s===void 0?{next:Sc}:p?{next:y4}:{}}}a(Fb,"link");function Fre(t){let e=(0,sO.join)(t,rt,oi);if((0,Ub.existsSync)(e))try{return jb(e).businessId}catch{return}}a(Fre,"previousBusiness");function R4(t){if(t.replaced===void 0)return;let e=t.businessName??t.link.businessId??"";return`This repository was linked to ${t.replaced} and is now linked to ${e}.`}a(R4,"replacedLine");function qb(t){try{return kv((0,Ub.readFileSync)((0,sO.join)(t,_v),"utf8"))}catch{return}}a(qb,"localRemote");var Ec=require("node:fs"),aO=require("node:child_process"),Ts=require("node:path");var Xf="roots.local.json";function ai(t){let e=(0,Ts.join)(t,Xf);if(!(0,Ec.existsSync)(e))return{};try{let n=JSON.parse((0,Ec.readFileSync)(e,"utf8"));if(typeof n!="object"||n===null)return{};let i={};for(let[r,o]of Object.entries(n))typeof o=="string"&&o.length>0&&(i[r]=o);return i}catch{return{}}}a(ai,"readLocalRoots");function qre(t){return t.kind==="repo"||t.kind==="store"}a(qre,"isFolderRoot");function Zre(t,e,n){let i=[],r=[],o=[];for(let s of t){let c=s.id;if(!qre(s)){o.push(c);continue}let u=e[c]??(c===n.rootId?n.path:void 0);if(u===void 0){r.push(c);continue}i.push({name:c,path:(0,Ts.isAbsolute)(u)?u:(0,Ts.resolve)(n.path,u)})}return{workspace:{folders:i,settings:{"search.followSymlinks":!1,"files.exclude":{"**/.tacticyl":!1}}},unmounted:r,notFolders:o}}a(Zre,"buildWorkspace");function Vre(){return(0,aO.spawnSync)(process.platform==="win32"?"where":"which",["code"],{stdio:"ignore"}).status===0}a(Vre,"hasCode");async function j4(t,e={}){let n=e.dir??t.repo,i=await t.client.venture(t.businessId,{fresh:!0}),r=Zre(i.venture.roots?.roots??[],ai(n),{rootId:t.rootId,path:t.repo}),o=(0,Ts.join)(n,`${t.businessId}.code-workspace`);(0,Ec.writeFileSync)(o,`${JSON.stringify(r.workspace,null,2)}
|
|
264
|
+
`,"utf8");let s=e.noOpen!==!0&&Vre();return s&&(0,aO.spawnSync)("code",[o],{stdio:"ignore"}),{path:o,workspace:r.workspace,unmounted:r.unmounted,notFolders:r.notFolders,opened:s}}a(j4,"openWorkspace");var ge;(function(t){t.assertEqual=r=>{};function e(r){}a(e,"assertIs"),t.assertIs=e;function n(r){throw new Error}a(n,"assertNever"),t.assertNever=n,t.arrayToEnum=r=>{let o={};for(let s of r)o[s]=s;return o},t.getValidEnumValues=r=>{let o=t.objectKeys(r).filter(c=>typeof r[r[c]]!="number"),s={};for(let c of o)s[c]=r[c];return t.objectValues(s)},t.objectValues=r=>t.objectKeys(r).map(function(o){return r[o]}),t.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{let o=[];for(let s in r)Object.prototype.hasOwnProperty.call(r,s)&&o.push(s);return o},t.find=(r,o)=>{for(let s of r)if(o(s))return s},t.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&Number.isFinite(r)&&Math.floor(r)===r;function i(r,o=" | "){return r.map(s=>typeof s=="string"?`'${s}'`:s).join(o)}a(i,"joinValues"),t.joinValues=i,t.jsonStringifyReplacer=(r,o)=>typeof o=="bigint"?o.toString():o})(ge||(ge={}));var z4;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(z4||(z4={}));var F=ge.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ci=a(t=>{switch(typeof t){case"undefined":return F.undefined;case"string":return F.string;case"number":return Number.isNaN(t)?F.nan:F.number;case"boolean":return F.boolean;case"function":return F.function;case"bigint":return F.bigint;case"symbol":return F.symbol;case"object":return Array.isArray(t)?F.array:t===null?F.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?F.promise:typeof Map<"u"&&t instanceof Map?F.map:typeof Set<"u"&&t instanceof Set?F.set:typeof Date<"u"&&t instanceof Date?F.date:F.object;default:return F.unknown}},"getParsedType");var P=ge.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 jn=class t extends Error{static{a(this,"ZodError")}get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){let n=e||function(o){return o.message},i={_errors:[]},r=a(o=>{for(let s of o.issues)if(s.code==="invalid_union")s.unionErrors.map(r);else if(s.code==="invalid_return_type")r(s.returnTypeError);else if(s.code==="invalid_arguments")r(s.argumentsError);else if(s.path.length===0)i._errors.push(n(s));else{let c=i,u=0;for(;u<s.path.length;){let l=s.path[u],d=u===s.path.length-1;if(l==="_errors"){d&&c._errors.push(n(s)),u++;continue}Object.prototype.hasOwnProperty.call(c,l)||(l==="__proto__"?Object.defineProperty(c,l,{value:{_errors:[]},writable:!0,enumerable:!0,configurable:!0}):c[l]={_errors:[]}),c=c[l],d&&c._errors.push(n(s)),u++}}},"processError");return r(this),i}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ge.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){let n=Object.create(null),i=[];for(let r of this.issues)if(r.path.length>0){let o=r.path[0];n[o]=n[o]||[],n[o].push(e(r))}else i.push(e(r));return{formErrors:i,fieldErrors:n}}get formErrors(){return this.flatten()}};jn.create=t=>new jn(t);var Bre=a((t,e)=>{let n;switch(t.code){case P.invalid_type:t.received===F.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case P.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,ge.jsonStringifyReplacer)}`;break;case P.unrecognized_keys:n=`Unrecognized key(s) in object: ${ge.joinValues(t.keys,", ")}`;break;case P.invalid_union:n="Invalid input";break;case P.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${ge.joinValues(t.options)}`;break;case P.invalid_enum_value:n=`Invalid enum value. Expected ${ge.joinValues(t.options)}, received '${t.received}'`;break;case P.invalid_arguments:n="Invalid function arguments";break;case P.invalid_return_type:n="Invalid function return type";break;case P.invalid_date:n="Invalid date";break;case P.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:ge.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case P.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case P.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case P.custom:n="Invalid input";break;case P.invalid_intersection_types:n="Intersection results could not be merged";break;case P.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case P.not_finite:n="Number must be finite";break;default:n=e.defaultError,ge.assertNever(t)}return{message:n}},"errorMap"),vo=Bre;var Kre=vo;function Qf(){return Kre}a(Qf,"getErrorMap");var Zb=a(t=>{let{data:e,path:n,errorMaps:i,issueData:r}=t,o=[...n,...r.path||[]],s={...r,path:o};if(r.message!==void 0)return{...r,path:o,message:r.message};let c="",u=i.filter(l=>!!l).slice().reverse();for(let l of u)c=l(s,{data:e,defaultError:c}).message;return{...r,path:o,message:c}},"makeIssue");function D(t,e){let n=Qf(),i=Zb({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===vo?void 0:vo].filter(r=>!!r)});t.common.issues.push(i)}a(D,"addIssueToContext");var Dt=class t{static{a(this,"ParseStatus")}constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){let i=[];for(let r of n){if(r.status==="aborted")return Q;r.status==="dirty"&&e.dirty(),i.push(r.value)}return{status:e.value,value:i}}static async mergeObjectAsync(e,n){let i=[];for(let r of n){let o=await r.key,s=await r.value;i.push({key:o,value:s})}return t.mergeObjectSync(e,i)}static mergeObjectSync(e,n){let i={};for(let r of n){let{key:o,value:s}=r;if(o.status==="aborted"||s.status==="aborted")return Q;o.status==="dirty"&&e.dirty(),s.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof s.value<"u"||r.alwaysSet)&&(i[o.value]=s.value)}return{status:e.value,value:i}}},Q=Object.freeze({status:"aborted"}),Tc=a(t=>({status:"dirty",value:t}),"DIRTY"),Wt=a(t=>({status:"valid",value:t}),"OK"),cO=a(t=>t.status==="aborted","isAborted"),uO=a(t=>t.status==="dirty","isDirty"),As=a(t=>t.status==="valid","isValid"),ep=a(t=>typeof Promise<"u"&&t instanceof Promise,"isAsync");var V;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(V||(V={}));var Hn=class{static{a(this,"ParseInputLazyPath")}constructor(e,n,i,r){this._cachedPath=[],this.parent=e,this.data=n,this._path=i,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},D4=a((t,e)=>{if(As(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let n=new jn(t.common.issues);return this._error=n,this._error}}},"handleResult");function se(t){if(!t)return{};let{errorMap:e,invalid_type_error:n,required_error:i,description:r}=t;if(e&&(n||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:r}:{errorMap:a((s,c)=>{let{message:u}=t;return s.code==="invalid_enum_value"?{message:u??c.defaultError}:typeof c.data>"u"?{message:u??i??c.defaultError}:s.code!=="invalid_type"?{message:c.defaultError}:{message:u??n??c.defaultError}},"customMap"),description:r}}a(se,"processCreateParams");var de=class{static{a(this,"ZodType")}get description(){return this._def.description}_getType(e){return ci(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:ci(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Dt,ctx:{common:e.parent.common,data:e.data,parsedType:ci(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let n=this._parse(e);if(ep(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){let n=this._parse(e);return Promise.resolve(n)}parse(e,n){let i=this.safeParse(e,n);if(i.success)return i.data;throw i.error}safeParse(e,n){let i={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ci(e)},r=this._parseSync({data:e,path:i.path,parent:i});return D4(i,r)}"~validate"(e){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ci(e)};if(!this["~standard"].async)try{let i=this._parseSync({data:e,path:[],parent:n});return As(i)?{value:i.value}:{issues:n.common.issues}}catch(i){i?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(i=>As(i)?{value:i.value}:{issues:n.common.issues})}async parseAsync(e,n){let i=await this.safeParseAsync(e,n);if(i.success)return i.data;throw i.error}async safeParseAsync(e,n){let i={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ci(e)},r=this._parse({data:e,path:i.path,parent:i}),o=await(ep(r)?r:Promise.resolve(r));return D4(i,o)}refine(e,n){let i=a(r=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(r):n,"getIssueProperties");return this._refinement((r,o)=>{let s=e(r),c=a(()=>o.addIssue({code:P.custom,...i(r)}),"setError");return typeof Promise<"u"&&s instanceof Promise?s.then(u=>u?!0:(c(),!1)):s?!0:(c(),!1)})}refinement(e,n){return this._refinement((i,r)=>e(i)?!0:(r.addIssue(typeof n=="function"?n(i,r):n),!1))}_refinement(e){return new gr({schema:this,typeName:j.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:a(n=>this["~validate"](n),"validate")}}optional(){return hr.create(this,this._def)}nullable(){return di.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return wo.create(this)}promise(){return Os.create(this,this._def)}or(e){return Pc.create([this,e],this._def)}and(e){return Rc.create(this,e,this._def)}transform(e){return new gr({...se(this._def),schema:this,typeName:j.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let n=typeof e=="function"?e:()=>e;return new Mc({...se(this._def),innerType:this,defaultValue:n,typeName:j.ZodDefault})}brand(){return new Vb({typeName:j.ZodBranded,type:this,...se(this._def)})}catch(e){let n=typeof e=="function"?e:()=>e;return new Uc({...se(this._def),innerType:this,catchValue:n,typeName:j.ZodCatch})}describe(e){let n=this.constructor;return new n({...this._def,description:e})}pipe(e){return Bb.create(this,e)}readonly(){return Fc.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Hre=/^c[^\s-]{8,}$/i,Wre=/^[0-9a-z]+$/,Gre=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Jre=/^[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,Yre=/^[a-z0-9_-]{21}$/i,Xre=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Qre=/^[-+]?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)?)??$/,eie=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,tie="^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$",lO,nie=/^(?:(?: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])$/,rie=/^(?:(?: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])$/,iie=/^(([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]))$/,oie=/^(([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])$/,sie=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,aie=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,L4="((\\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])))",cie=new RegExp(`^${L4}$`);function M4(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}a(M4,"timeRegexSource");function uie(t){return new RegExp(`^${M4(t)}$`)}a(uie,"timeRegex");function lie(t){let e=`${L4}T${M4(t)}`,n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}a(lie,"datetimeRegex");function die(t,e){return!!((e==="v4"||!e)&&nie.test(t)||(e==="v6"||!e)&&iie.test(t))}a(die,"isValidIP");function fie(t,e){if(!Xre.test(t))return!1;try{let[n]=t.split(".");if(!n)return!1;let i=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),r=JSON.parse(atob(i));return!(typeof r!="object"||r===null||"typ"in r&&r?.typ!=="JWT"||!r.alg||e&&r.alg!==e)}catch{return!1}}a(fie,"isValidJWT");function pie(t,e){return!!((e==="v4"||!e)&&rie.test(t)||(e==="v6"||!e)&&oie.test(t))}a(pie,"isValidCidr");var Oc=class t extends de{static{a(this,"ZodString")}_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==F.string){let o=this._getOrReturnCtx(e);return D(o,{code:P.invalid_type,expected:F.string,received:o.parsedType}),Q}let i=new Dt,r;for(let o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(r=this._getOrReturnCtx(e,r),D(r,{code:P.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),i.dirty());else if(o.kind==="max")e.data.length>o.value&&(r=this._getOrReturnCtx(e,r),D(r,{code:P.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),i.dirty());else if(o.kind==="length"){let s=e.data.length>o.value,c=e.data.length<o.value;(s||c)&&(r=this._getOrReturnCtx(e,r),s?D(r,{code:P.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):c&&D(r,{code:P.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),i.dirty())}else if(o.kind==="email")eie.test(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{validation:"email",code:P.invalid_string,message:o.message}),i.dirty());else if(o.kind==="emoji")lO||(lO=new RegExp(tie,"u")),lO.test(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{validation:"emoji",code:P.invalid_string,message:o.message}),i.dirty());else if(o.kind==="uuid")Jre.test(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{validation:"uuid",code:P.invalid_string,message:o.message}),i.dirty());else if(o.kind==="nanoid")Yre.test(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{validation:"nanoid",code:P.invalid_string,message:o.message}),i.dirty());else if(o.kind==="cuid")Hre.test(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{validation:"cuid",code:P.invalid_string,message:o.message}),i.dirty());else if(o.kind==="cuid2")Wre.test(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{validation:"cuid2",code:P.invalid_string,message:o.message}),i.dirty());else if(o.kind==="ulid")Gre.test(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{validation:"ulid",code:P.invalid_string,message:o.message}),i.dirty());else if(o.kind==="url")try{new URL(e.data)}catch{r=this._getOrReturnCtx(e,r),D(r,{validation:"url",code:P.invalid_string,message:o.message}),i.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{validation:"regex",code:P.invalid_string,message:o.message}),i.dirty())):o.kind==="trim"?e.data=e.data.trim():o.kind==="includes"?e.data.includes(o.value,o.position)||(r=this._getOrReturnCtx(e,r),D(r,{code:P.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),i.dirty()):o.kind==="toLowerCase"?e.data=e.data.toLowerCase():o.kind==="toUpperCase"?e.data=e.data.toUpperCase():o.kind==="startsWith"?e.data.startsWith(o.value)||(r=this._getOrReturnCtx(e,r),D(r,{code:P.invalid_string,validation:{startsWith:o.value},message:o.message}),i.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(r=this._getOrReturnCtx(e,r),D(r,{code:P.invalid_string,validation:{endsWith:o.value},message:o.message}),i.dirty()):o.kind==="datetime"?lie(o).test(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{code:P.invalid_string,validation:"datetime",message:o.message}),i.dirty()):o.kind==="date"?cie.test(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{code:P.invalid_string,validation:"date",message:o.message}),i.dirty()):o.kind==="time"?uie(o).test(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{code:P.invalid_string,validation:"time",message:o.message}),i.dirty()):o.kind==="duration"?Qre.test(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{validation:"duration",code:P.invalid_string,message:o.message}),i.dirty()):o.kind==="ip"?die(e.data,o.version)||(r=this._getOrReturnCtx(e,r),D(r,{validation:"ip",code:P.invalid_string,message:o.message}),i.dirty()):o.kind==="jwt"?fie(e.data,o.alg)||(r=this._getOrReturnCtx(e,r),D(r,{validation:"jwt",code:P.invalid_string,message:o.message}),i.dirty()):o.kind==="cidr"?pie(e.data,o.version)||(r=this._getOrReturnCtx(e,r),D(r,{validation:"cidr",code:P.invalid_string,message:o.message}),i.dirty()):o.kind==="base64"?sie.test(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{validation:"base64",code:P.invalid_string,message:o.message}),i.dirty()):o.kind==="base64url"?aie.test(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{validation:"base64url",code:P.invalid_string,message:o.message}),i.dirty()):ge.assertNever(o);return{status:i.value,value:e.data}}_regex(e,n,i){return this.refinement(r=>e.test(r),{validation:n,code:P.invalid_string,...V.errToObj(i)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...V.errToObj(e)})}url(e){return this._addCheck({kind:"url",...V.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...V.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...V.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...V.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...V.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...V.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...V.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...V.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...V.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...V.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...V.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...V.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...V.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...V.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...V.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...V.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n?.position,...V.errToObj(n?.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...V.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...V.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...V.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...V.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...V.errToObj(n)})}nonempty(e){return this.min(1,V.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};Oc.create=t=>new Oc({checks:[],typeName:j.ZodString,coerce:t?.coerce??!1,...se(t)});function mie(t,e){let n=(t.toString().split(".")[1]||"").length,i=(e.toString().split(".")[1]||"").length,r=n>i?n:i,o=Number.parseInt(t.toFixed(r).replace(".","")),s=Number.parseInt(e.toFixed(r).replace(".",""));return o%s/10**r}a(mie,"floatSafeRemainder");var tp=class t extends de{static{a(this,"ZodNumber")}constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==F.number){let o=this._getOrReturnCtx(e);return D(o,{code:P.invalid_type,expected:F.number,received:o.parsedType}),Q}let i,r=new Dt;for(let o of this._def.checks)o.kind==="int"?ge.isInteger(e.data)||(i=this._getOrReturnCtx(e,i),D(i,{code:P.invalid_type,expected:"integer",received:"float",message:o.message}),r.dirty()):o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(i=this._getOrReturnCtx(e,i),D(i,{code:P.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),r.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(i=this._getOrReturnCtx(e,i),D(i,{code:P.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),r.dirty()):o.kind==="multipleOf"?mie(e.data,o.value)!==0&&(i=this._getOrReturnCtx(e,i),D(i,{code:P.not_multiple_of,multipleOf:o.value,message:o.message}),r.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(i=this._getOrReturnCtx(e,i),D(i,{code:P.not_finite,message:o.message}),r.dirty()):ge.assertNever(o);return{status:r.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,V.toString(n))}gt(e,n){return this.setLimit("min",e,!1,V.toString(n))}lte(e,n){return this.setLimit("max",e,!0,V.toString(n))}lt(e,n){return this.setLimit("max",e,!1,V.toString(n))}setLimit(e,n,i,r){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:i,message:V.toString(r)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:V.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:V.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:V.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:V.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:V.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:V.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:V.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:V.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:V.toString(e)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&ge.isInteger(e.value))}get isFinite(){let e=null,n=null;for(let i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(n===null||i.value>n)&&(n=i.value):i.kind==="max"&&(e===null||i.value<e)&&(e=i.value)}return Number.isFinite(n)&&Number.isFinite(e)}};tp.create=t=>new tp({checks:[],typeName:j.ZodNumber,coerce:t?.coerce||!1,...se(t)});var np=class t extends de{static{a(this,"ZodBigInt")}constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==F.bigint)return this._getInvalidInput(e);let i,r=new Dt;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(i=this._getOrReturnCtx(e,i),D(i,{code:P.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),r.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(i=this._getOrReturnCtx(e,i),D(i,{code:P.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),r.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(i=this._getOrReturnCtx(e,i),D(i,{code:P.not_multiple_of,multipleOf:o.value,message:o.message}),r.dirty()):ge.assertNever(o);return{status:r.value,value:e.data}}_getInvalidInput(e){let n=this._getOrReturnCtx(e);return D(n,{code:P.invalid_type,expected:F.bigint,received:n.parsedType}),Q}gte(e,n){return this.setLimit("min",e,!0,V.toString(n))}gt(e,n){return this.setLimit("min",e,!1,V.toString(n))}lte(e,n){return this.setLimit("max",e,!0,V.toString(n))}lt(e,n){return this.setLimit("max",e,!1,V.toString(n))}setLimit(e,n,i,r){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:i,message:V.toString(r)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:V.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:V.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:V.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:V.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:V.toString(n)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};np.create=t=>new np({checks:[],typeName:j.ZodBigInt,coerce:t?.coerce??!1,...se(t)});var rp=class extends de{static{a(this,"ZodBoolean")}_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==F.boolean){let i=this._getOrReturnCtx(e);return D(i,{code:P.invalid_type,expected:F.boolean,received:i.parsedType}),Q}return Wt(e.data)}};rp.create=t=>new rp({typeName:j.ZodBoolean,coerce:t?.coerce||!1,...se(t)});var ip=class t extends de{static{a(this,"ZodDate")}_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==F.date){let o=this._getOrReturnCtx(e);return D(o,{code:P.invalid_type,expected:F.date,received:o.parsedType}),Q}if(Number.isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return D(o,{code:P.invalid_date}),Q}let i=new Dt,r;for(let o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(r=this._getOrReturnCtx(e,r),D(r,{code:P.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),i.dirty()):o.kind==="max"?e.data.getTime()>o.value&&(r=this._getOrReturnCtx(e,r),D(r,{code:P.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),i.dirty()):ge.assertNever(o);return{status:i.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:V.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:V.toString(n)})}get minDate(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}};ip.create=t=>new ip({checks:[],coerce:t?.coerce||!1,typeName:j.ZodDate,...se(t)});var op=class extends de{static{a(this,"ZodSymbol")}_parse(e){if(this._getType(e)!==F.symbol){let i=this._getOrReturnCtx(e);return D(i,{code:P.invalid_type,expected:F.symbol,received:i.parsedType}),Q}return Wt(e.data)}};op.create=t=>new op({typeName:j.ZodSymbol,...se(t)});var Nc=class extends de{static{a(this,"ZodUndefined")}_parse(e){if(this._getType(e)!==F.undefined){let i=this._getOrReturnCtx(e);return D(i,{code:P.invalid_type,expected:F.undefined,received:i.parsedType}),Q}return Wt(e.data)}};Nc.create=t=>new Nc({typeName:j.ZodUndefined,...se(t)});var Cc=class extends de{static{a(this,"ZodNull")}_parse(e){if(this._getType(e)!==F.null){let i=this._getOrReturnCtx(e);return D(i,{code:P.invalid_type,expected:F.null,received:i.parsedType}),Q}return Wt(e.data)}};Cc.create=t=>new Cc({typeName:j.ZodNull,...se(t)});var sp=class extends de{static{a(this,"ZodAny")}constructor(){super(...arguments),this._any=!0}_parse(e){return Wt(e.data)}};sp.create=t=>new sp({typeName:j.ZodAny,...se(t)});var bo=class extends de{static{a(this,"ZodUnknown")}constructor(){super(...arguments),this._unknown=!0}_parse(e){return Wt(e.data)}};bo.create=t=>new bo({typeName:j.ZodUnknown,...se(t)});var Ur=class extends de{static{a(this,"ZodNever")}_parse(e){let n=this._getOrReturnCtx(e);return D(n,{code:P.invalid_type,expected:F.never,received:n.parsedType}),Q}};Ur.create=t=>new Ur({typeName:j.ZodNever,...se(t)});var ap=class extends de{static{a(this,"ZodVoid")}_parse(e){if(this._getType(e)!==F.undefined){let i=this._getOrReturnCtx(e);return D(i,{code:P.invalid_type,expected:F.void,received:i.parsedType}),Q}return Wt(e.data)}};ap.create=t=>new ap({typeName:j.ZodVoid,...se(t)});var wo=class t extends de{static{a(this,"ZodArray")}_parse(e){let{ctx:n,status:i}=this._processInputParams(e),r=this._def;if(n.parsedType!==F.array)return D(n,{code:P.invalid_type,expected:F.array,received:n.parsedType}),Q;if(r.exactLength!==null){let s=n.data.length>r.exactLength.value,c=n.data.length<r.exactLength.value;(s||c)&&(D(n,{code:s?P.too_big:P.too_small,minimum:c?r.exactLength.value:void 0,maximum:s?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),i.dirty())}if(r.minLength!==null&&n.data.length<r.minLength.value&&(D(n,{code:P.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&&(D(n,{code:P.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),i.dirty()),n.common.async)return Promise.all([...n.data].map((s,c)=>r.type._parseAsync(new Hn(n,s,n.path,c)))).then(s=>Dt.mergeArray(i,s));let o=[...n.data].map((s,c)=>r.type._parseSync(new Hn(n,s,n.path,c)));return Dt.mergeArray(i,o)}get element(){return this._def.type}min(e,n){return new t({...this._def,minLength:{value:e,message:V.toString(n)}})}max(e,n){return new t({...this._def,maxLength:{value:e,message:V.toString(n)}})}length(e,n){return new t({...this._def,exactLength:{value:e,message:V.toString(n)}})}nonempty(e){return this.min(1,e)}};wo.create=(t,e)=>new wo({type:t,minLength:null,maxLength:null,exactLength:null,typeName:j.ZodArray,...se(e)});function Ac(t){if(t instanceof zn){let e={};for(let n in t.shape){let i=t.shape[n];e[n]=hr.create(Ac(i))}return new zn({...t._def,shape:a(()=>e,"shape")})}else return t instanceof wo?new wo({...t._def,type:Ac(t.element)}):t instanceof hr?hr.create(Ac(t.unwrap())):t instanceof di?di.create(Ac(t.unwrap())):t instanceof li?li.create(t.items.map(e=>Ac(e))):t}a(Ac,"deepPartialify");var zn=class t extends de{static{a(this,"ZodObject")}constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),n=ge.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==F.object){let l=this._getOrReturnCtx(e);return D(l,{code:P.invalid_type,expected:F.object,received:l.parsedType}),Q}let{status:i,ctx:r}=this._processInputParams(e),{shape:o,keys:s}=this._getCached(),c=[];if(!(this._def.catchall instanceof Ur&&this._def.unknownKeys==="strip"))for(let l in r.data)s.includes(l)||c.push(l);let u=[];for(let l of s){let d=o[l],f=r.data[l];u.push({key:{status:"valid",value:l},value:d._parse(new Hn(r,f,r.path,l)),alwaysSet:l in r.data})}if(this._def.catchall instanceof Ur){let l=this._def.unknownKeys;if(l==="passthrough")for(let d of c)u.push({key:{status:"valid",value:d},value:{status:"valid",value:r.data[d]}});else if(l==="strict")c.length>0&&(D(r,{code:P.unrecognized_keys,keys:c}),i.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let l=this._def.catchall;for(let d of c){let f=r.data[d];u.push({key:{status:"valid",value:d},value:l._parse(new Hn(r,f,r.path,d)),alwaysSet:d in r.data})}}return r.common.async?Promise.resolve().then(async()=>{let l=[];for(let d of u){let f=await d.key,p=await d.value;l.push({key:f,value:p,alwaysSet:d.alwaysSet})}return l}).then(l=>Dt.mergeObjectSync(i,l)):Dt.mergeObjectSync(i,u)}get shape(){return this._def.shape()}strict(e){return V.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:a((n,i)=>{let r=this._def.errorMap?.(n,i).message??i.defaultError;return n.code==="unrecognized_keys"?{message:V.errToObj(e).message??r}:{message:r}},"errorMap")}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:a(()=>({...this._def.shape(),...e}),"shape")})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:a(()=>({...this._def.shape(),...e._def.shape()}),"shape"),typeName:j.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let n={};for(let i of ge.objectKeys(e))e[i]&&this.shape[i]&&(n[i]=this.shape[i]);return new t({...this._def,shape:a(()=>n,"shape")})}omit(e){let n={};for(let i of ge.objectKeys(this.shape))e[i]||(n[i]=this.shape[i]);return new t({...this._def,shape:a(()=>n,"shape")})}deepPartial(){return Ac(this)}partial(e){let n={};for(let i of ge.objectKeys(this.shape)){let r=this.shape[i];e&&!e[i]?n[i]=r:n[i]=r.optional()}return new t({...this._def,shape:a(()=>n,"shape")})}required(e){let n={};for(let i of ge.objectKeys(this.shape))if(e&&!e[i])n[i]=this.shape[i];else{let o=this.shape[i];for(;o instanceof hr;)o=o._def.innerType;n[i]=o}return new t({...this._def,shape:a(()=>n,"shape")})}keyof(){return U4(ge.objectKeys(this.shape))}};zn.create=(t,e)=>new zn({shape:a(()=>t,"shape"),unknownKeys:"strip",catchall:Ur.create(),typeName:j.ZodObject,...se(e)});zn.strictCreate=(t,e)=>new zn({shape:a(()=>t,"shape"),unknownKeys:"strict",catchall:Ur.create(),typeName:j.ZodObject,...se(e)});zn.lazycreate=(t,e)=>new zn({shape:t,unknownKeys:"strip",catchall:Ur.create(),typeName:j.ZodObject,...se(e)});var Pc=class extends de{static{a(this,"ZodUnion")}_parse(e){let{ctx:n}=this._processInputParams(e),i=this._def.options;function r(o){for(let c of o)if(c.result.status==="valid")return c.result;for(let c of o)if(c.result.status==="dirty")return n.common.issues.push(...c.ctx.common.issues),c.result;let s=o.map(c=>new jn(c.ctx.common.issues));return D(n,{code:P.invalid_union,unionErrors:s}),Q}if(a(r,"handleResults"),n.common.async)return Promise.all(i.map(async o=>{let s={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:s}),ctx:s}})).then(r);{let o,s=[];for(let u of i){let l={...n,common:{...n.common,issues:[]},parent:null},d=u._parseSync({data:n.data,path:n.path,parent:l});if(d.status==="valid")return d;d.status==="dirty"&&!o&&(o={result:d,ctx:l}),l.common.issues.length&&s.push(l.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;let c=s.map(u=>new jn(u));return D(n,{code:P.invalid_union,unionErrors:c}),Q}}get options(){return this._def.options}};Pc.create=(t,e)=>new Pc({options:t,typeName:j.ZodUnion,...se(e)});var ui=a(t=>t instanceof jc?ui(t.schema):t instanceof gr?ui(t.innerType()):t instanceof zc?[t.value]:t instanceof Dc?t.options:t instanceof Lc?ge.objectValues(t.enum):t instanceof Mc?ui(t._def.innerType):t instanceof Nc?[void 0]:t instanceof Cc?[null]:t instanceof hr?[void 0,...ui(t.unwrap())]:t instanceof di?[null,...ui(t.unwrap())]:t instanceof Vb||t instanceof Fc?ui(t.unwrap()):t instanceof Uc?ui(t._def.innerType):[],"getDiscriminator"),dO=class t extends de{static{a(this,"ZodDiscriminatedUnion")}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==F.object)return D(n,{code:P.invalid_type,expected:F.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}):(D(n,{code:P.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),Q)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,i){let r=new Map;for(let o of n){let s=ui(o.shape[e]);if(!s.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let c of s){if(r.has(c))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(c)}`);r.set(c,o)}}return new t({typeName:j.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:r,...se(i)})}};function fO(t,e){let n=ci(t),i=ci(e);if(t===e)return{valid:!0,data:t};if(n===F.object&&i===F.object){let r=ge.objectKeys(e),o=ge.objectKeys(t).filter(c=>r.indexOf(c)!==-1),s={...t,...e};Object.prototype.hasOwnProperty.call(s,"__proto__")&&delete s.__proto__;for(let c of o){if(c==="__proto__")continue;let u=fO(t[c],e[c]);if(!u.valid)return{valid:!1};s[c]=u.data}return{valid:!0,data:s}}else if(n===F.array&&i===F.array){if(t.length!==e.length)return{valid:!1};let r=[];for(let o=0;o<t.length;o++){let s=t[o],c=e[o],u=fO(s,c);if(!u.valid)return{valid:!1};r.push(u.data)}return{valid:!0,data:r}}else return n===F.date&&i===F.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}a(fO,"mergeValues");var Rc=class extends de{static{a(this,"ZodIntersection")}_parse(e){let{status:n,ctx:i}=this._processInputParams(e),r=a((o,s)=>{if(cO(o)||cO(s))return Q;let c=fO(o.value,s.value);return c.valid?((uO(o)||uO(s))&&n.dirty(),{status:n.value,value:c.data}):(D(i,{code:P.invalid_intersection_types}),Q)},"handleParsed");return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([o,s])=>r(o,s)):r(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}};Rc.create=(t,e,n)=>new Rc({left:t,right:e,typeName:j.ZodIntersection,...se(n)});var li=class t extends de{static{a(this,"ZodTuple")}_parse(e){let{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==F.array)return D(i,{code:P.invalid_type,expected:F.array,received:i.parsedType}),Q;if(i.data.length<this._def.items.length)return D(i,{code:P.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Q;!this._def.rest&&i.data.length>this._def.items.length&&(D(i,{code:P.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let o=[...i.data].map((s,c)=>{let u=this._def.items[c]||this._def.rest;return u?u._parse(new Hn(i,s,i.path,c)):null}).filter(s=>!!s);return i.common.async?Promise.all(o).then(s=>Dt.mergeArray(n,s)):Dt.mergeArray(n,o)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};li.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new li({items:t,typeName:j.ZodTuple,rest:null,...se(e)})};var pO=class t extends de{static{a(this,"ZodRecord")}get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==F.object)return D(i,{code:P.invalid_type,expected:F.object,received:i.parsedType}),Q;let r=[],o=this._def.keyType,s=this._def.valueType;for(let c in i.data)r.push({key:o._parse(new Hn(i,c,i.path,c)),value:s._parse(new Hn(i,i.data[c],i.path,c)),alwaysSet:c in i.data});return i.common.async?Dt.mergeObjectAsync(n,r):Dt.mergeObjectSync(n,r)}get element(){return this._def.valueType}static create(e,n,i){return n instanceof de?new t({keyType:e,valueType:n,typeName:j.ZodRecord,...se(i)}):new t({keyType:Oc.create(),valueType:e,typeName:j.ZodRecord,...se(n)})}},cp=class extends de{static{a(this,"ZodMap")}get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==F.map)return D(i,{code:P.invalid_type,expected:F.map,received:i.parsedType}),Q;let r=this._def.keyType,o=this._def.valueType,s=[...i.data.entries()].map(([c,u],l)=>({key:r._parse(new Hn(i,c,i.path,[l,"key"])),value:o._parse(new Hn(i,u,i.path,[l,"value"]))}));if(i.common.async){let c=new Map;return Promise.resolve().then(async()=>{for(let u of s){let l=await u.key,d=await u.value;if(l.status==="aborted"||d.status==="aborted")return Q;(l.status==="dirty"||d.status==="dirty")&&n.dirty(),c.set(l.value,d.value)}return{status:n.value,value:c}})}else{let c=new Map;for(let u of s){let l=u.key,d=u.value;if(l.status==="aborted"||d.status==="aborted")return Q;(l.status==="dirty"||d.status==="dirty")&&n.dirty(),c.set(l.value,d.value)}return{status:n.value,value:c}}}};cp.create=(t,e,n)=>new cp({valueType:e,keyType:t,typeName:j.ZodMap,...se(n)});var up=class t extends de{static{a(this,"ZodSet")}_parse(e){let{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==F.set)return D(i,{code:P.invalid_type,expected:F.set,received:i.parsedType}),Q;let r=this._def;r.minSize!==null&&i.data.size<r.minSize.value&&(D(i,{code:P.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&&(D(i,{code:P.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),n.dirty());let o=this._def.valueType;function s(u){let l=new Set;for(let d of u){if(d.status==="aborted")return Q;d.status==="dirty"&&n.dirty(),l.add(d.value)}return{status:n.value,value:l}}a(s,"finalizeSet");let c=[...i.data.values()].map((u,l)=>o._parse(new Hn(i,u,i.path,l)));return i.common.async?Promise.all(c).then(u=>s(u)):s(c)}min(e,n){return new t({...this._def,minSize:{value:e,message:V.toString(n)}})}max(e,n){return new t({...this._def,maxSize:{value:e,message:V.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}};up.create=(t,e)=>new up({valueType:t,minSize:null,maxSize:null,typeName:j.ZodSet,...se(e)});var mO=class t extends de{static{a(this,"ZodFunction")}constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==F.function)return D(n,{code:P.invalid_type,expected:F.function,received:n.parsedType}),Q;function i(c,u){return Zb({data:c,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Qf(),vo].filter(l=>!!l),issueData:{code:P.invalid_arguments,argumentsError:u}})}a(i,"makeArgsIssue");function r(c,u){return Zb({data:c,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Qf(),vo].filter(l=>!!l),issueData:{code:P.invalid_return_type,returnTypeError:u}})}a(r,"makeReturnsIssue");let o={errorMap:n.common.contextualErrorMap},s=n.data;if(this._def.returns instanceof Os){let c=this;return Wt(async function(...u){let l=new jn([]),d=await c._def.args.parseAsync(u,o).catch(m=>{throw l.addIssue(i(u,m)),l}),f=await Reflect.apply(s,this,d);return await c._def.returns._def.type.parseAsync(f,o).catch(m=>{throw l.addIssue(r(f,m)),l})})}else{let c=this;return Wt(function(...u){let l=c._def.args.safeParse(u,o);if(!l.success)throw new jn([i(u,l.error)]);let d=Reflect.apply(s,this,l.data),f=c._def.returns.safeParse(d,o);if(!f.success)throw new jn([r(d,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:li.create(e).rest(bo.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,i){return new t({args:e||li.create([]).rest(bo.create()),returns:n||bo.create(),typeName:j.ZodFunction,...se(i)})}},jc=class extends de{static{a(this,"ZodLazy")}get schema(){return this._def.getter()}_parse(e){let{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};jc.create=(t,e)=>new jc({getter:t,typeName:j.ZodLazy,...se(e)});var zc=class extends de{static{a(this,"ZodLiteral")}_parse(e){if(e.data!==this._def.value){let n=this._getOrReturnCtx(e);return D(n,{received:n.data,code:P.invalid_literal,expected:this._def.value}),Q}return{status:"valid",value:e.data}}get value(){return this._def.value}};zc.create=(t,e)=>new zc({value:t,typeName:j.ZodLiteral,...se(e)});function U4(t,e){return new Dc({values:t,typeName:j.ZodEnum,...se(e)})}a(U4,"createZodEnum");var Dc=class t extends de{static{a(this,"ZodEnum")}_parse(e){if(typeof e.data!="string"){let n=this._getOrReturnCtx(e),i=this._def.values;return D(n,{expected:ge.joinValues(i),received:n.parsedType,code:P.invalid_type}),Q}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let n=this._getOrReturnCtx(e),i=this._def.values;return D(n,{received:n.data,code:P.invalid_enum_value,options:i}),Q}return Wt(e.data)}get options(){return this._def.values}get enum(){let e={};for(let n of this._def.values)e[n]=n;return e}get Values(){let e={};for(let n of this._def.values)e[n]=n;return e}get Enum(){let e={};for(let n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return t.create(e,{...this._def,...n})}exclude(e,n=this._def){return t.create(this.options.filter(i=>!e.includes(i)),{...this._def,...n})}};Dc.create=U4;var Lc=class extends de{static{a(this,"ZodNativeEnum")}_parse(e){let n=ge.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(e);if(i.parsedType!==F.string&&i.parsedType!==F.number){let r=ge.objectValues(n);return D(i,{expected:ge.joinValues(r),received:i.parsedType,code:P.invalid_type}),Q}if(this._cache||(this._cache=new Set(ge.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let r=ge.objectValues(n);return D(i,{received:i.data,code:P.invalid_enum_value,options:r}),Q}return Wt(e.data)}get enum(){return this._def.values}};Lc.create=(t,e)=>new Lc({values:t,typeName:j.ZodNativeEnum,...se(e)});var Os=class extends de{static{a(this,"ZodPromise")}unwrap(){return this._def.type}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==F.promise&&n.common.async===!1)return D(n,{code:P.invalid_type,expected:F.promise,received:n.parsedType}),Q;let i=n.parsedType===F.promise?n.data:Promise.resolve(n.data);return Wt(i.then(r=>this._def.type.parseAsync(r,{path:n.path,errorMap:n.common.contextualErrorMap})))}};Os.create=(t,e)=>new Os({type:t,typeName:j.ZodPromise,...se(e)});var gr=class extends de{static{a(this,"ZodEffects")}innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===j.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:n,ctx:i}=this._processInputParams(e),r=this._def.effect||null,o={addIssue:a(s=>{D(i,s),s.fatal?n.abort():n.dirty()},"addIssue"),get path(){return i.path}};if(o.addIssue=o.addIssue.bind(o),r.type==="preprocess"){let s=r.transform(i.data,o);if(i.common.async)return Promise.resolve(s).then(async c=>{if(n.value==="aborted")return Q;let u=await this._def.schema._parseAsync({data:c,path:i.path,parent:i});return u.status==="aborted"?Q:u.status==="dirty"?Tc(u.value):n.value==="dirty"?Tc(u.value):u});{if(n.value==="aborted")return Q;let c=this._def.schema._parseSync({data:s,path:i.path,parent:i});return c.status==="aborted"?Q:c.status==="dirty"?Tc(c.value):n.value==="dirty"?Tc(c.value):c}}if(r.type==="refinement"){let s=a(c=>{let u=r.refinement(c,o);if(i.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c},"executeRefinement");if(i.common.async===!1){let c=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return c.status==="aborted"?Q:(c.status==="dirty"&&n.dirty(),s(c.value),{status:n.value,value:c.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(c=>c.status==="aborted"?Q:(c.status==="dirty"&&n.dirty(),s(c.value).then(()=>({status:n.value,value:c.value}))))}if(r.type==="transform")if(i.common.async===!1){let s=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!As(s))return Q;let c=r.transform(s.value,o);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:c}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(s=>As(s)?Promise.resolve(r.transform(s.value,o)).then(c=>({status:n.value,value:c})):Q);ge.assertNever(r)}};gr.create=(t,e,n)=>new gr({schema:t,typeName:j.ZodEffects,effect:e,...se(n)});gr.createWithPreprocess=(t,e,n)=>new gr({schema:e,effect:{type:"preprocess",transform:t},typeName:j.ZodEffects,...se(n)});var hr=class extends de{static{a(this,"ZodOptional")}_parse(e){return this._getType(e)===F.undefined?Wt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};hr.create=(t,e)=>new hr({innerType:t,typeName:j.ZodOptional,...se(e)});var di=class extends de{static{a(this,"ZodNullable")}_parse(e){return this._getType(e)===F.null?Wt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};di.create=(t,e)=>new di({innerType:t,typeName:j.ZodNullable,...se(e)});var Mc=class extends de{static{a(this,"ZodDefault")}_parse(e){let{ctx:n}=this._processInputParams(e),i=n.data;return n.parsedType===F.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};Mc.create=(t,e)=>new Mc({innerType:t,typeName:j.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...se(e)});var Uc=class extends de{static{a(this,"ZodCatch")}_parse(e){let{ctx:n}=this._processInputParams(e),i={...n,common:{...n.common,issues:[]}},r=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return ep(r)?r.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new jn(i.common.issues)},input:i.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new jn(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}};Uc.create=(t,e)=>new Uc({innerType:t,typeName:j.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...se(e)});var lp=class extends de{static{a(this,"ZodNaN")}_parse(e){if(this._getType(e)!==F.nan){let i=this._getOrReturnCtx(e);return D(i,{code:P.invalid_type,expected:F.nan,received:i.parsedType}),Q}return{status:"valid",value:e.data}}};lp.create=t=>new lp({typeName:j.ZodNaN,...se(t)});var $Ve=Symbol("zod_brand"),Vb=class extends de{static{a(this,"ZodBranded")}_parse(e){let{ctx:n}=this._processInputParams(e),i=n.data;return this._def.type._parse({data:i,path:n.path,parent:n})}unwrap(){return this._def.type}},Bb=class t extends de{static{a(this,"ZodPipeline")}_parse(e){let{status:n,ctx:i}=this._processInputParams(e);if(i.common.async)return a(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(),Tc(o.value)):this._def.out._parseAsync({data:o.value,path:i.path,parent:i})},"handleAsync")();{let r=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return r.status==="aborted"?Q:r.status==="dirty"?(n.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:i.path,parent:i})}}static create(e,n){return new t({in:e,out:n,typeName:j.ZodPipeline})}},Fc=class extends de{static{a(this,"ZodReadonly")}_parse(e){let n=this._def.innerType._parse(e),i=a(r=>(As(r)&&(r.value=Object.freeze(r.value)),r),"freeze");return ep(n)?n.then(r=>i(r)):i(n)}unwrap(){return this._def.innerType}};Fc.create=(t,e)=>new Fc({innerType:t,typeName:j.ZodReadonly,...se(e)});var _Ve={object:zn.lazycreate},j;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(j||(j={}));var kVe=Oc.create,xVe=tp.create,SVe=lp.create,IVe=np.create,EVe=rp.create,TVe=ip.create,AVe=op.create,OVe=Nc.create,NVe=Cc.create,CVe=sp.create,PVe=bo.create,RVe=Ur.create,jVe=ap.create,zVe=wo.create,F4=zn.create,DVe=zn.strictCreate,LVe=Pc.create,MVe=dO.create,UVe=Rc.create,FVe=li.create,qVe=pO.create,ZVe=cp.create,VVe=up.create,BVe=mO.create,KVe=jc.create,HVe=zc.create,WVe=Dc.create,GVe=Lc.create,JVe=Os.create,YVe=gr.create,XVe=hr.create,QVe=di.create,eBe=gr.createWithPreprocess,tBe=Bb.create;var gie=_("ZodMiniType",(t,e)=>{if(!t._zod)throw new Error("Uninitialized schema in ZodMiniType.");te.init(t,e),t.def=e,t.type=e.type},{get with(){return this.check},set with(t){Ai(this,"with",t)},parse(t,e){return qo(this,t,e,{callee:this.parse})},parseAsync(t,e){return Zo(this,t,e,{callee:this.parseAsync})},safeParse(t,e){return Ci(this,t,e)},safeParseAsync(t,e){return Pi(this,t,e)},check(...t){let e=this.def;return this.clone({...e,checks:[...e.checks??[],...t.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]},{parent:!0})},clone(t,e){return _e(this,t,e)},brand(){return this},register(t,e){return t.add(this,e),this},apply(t,...e){return e.length===0?t(this):t(this,...e)}});var yie=_("ZodMiniObject",(t,e)=>{Th.init(t,e),gie.init(t,e),i_(t,"shape",n=>n._zod.def.shape,!1)});function hO(t,e){let n={type:"object",shape:t??{},...R(e)};return new yie(n)}a(hO,"object");function Fr(t){return!!t._zod}a(Fr,"isZ4Schema");function Ns(t){let e=Object.values(t);if(e.length===0)return hO({});let n=e.every(Fr),i=e.every(r=>!Fr(r));if(n)return hO(t);if(i)return F4(t);throw new Error("Mixed Zod versions detected in object shape.")}a(Ns,"objectFromShape");function $o(t,e){return Fr(t)?Ci(t,e):t.safeParse(e)}a($o,"safeParse");async function Kb(t,e){return Fr(t)?await Pi(t,e):await t.safeParseAsync(e)}a(Kb,"safeParseAsync");function _o(t){if(!t)return;let e;if(Fr(t)?e=t._zod?.def?.shape:e=t.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}a(_o,"getObjectShape");function qc(t){if(t){if(typeof t=="object"){let e=t,n=t;if(!e._def&&!n._zod){let i=Object.values(t);if(i.length>0&&i.every(r=>typeof r=="object"&&r!==null&&(r._def!==void 0||r._zod!==void 0||typeof r.parse=="function")))return Ns(t)}}if(Fr(t)){let n=t._zod?.def;if(n&&(n.type==="object"||n.shape!==void 0))return t}else if(t.shape!==void 0)return t}}a(qc,"normalizeObjectSchema");function bie(t){return t.length===0?"object root":t.reduce((e,n,i)=>i===0?String(n):typeof n=="number"?`${e}[${n}]`:`${e}.${n}`,"")}a(bie,"getDotPath");function Hb(t){if(t&&typeof t=="object"){if("issues"in t&&Array.isArray(t.issues)&&t.issues.length>0)return t.issues.map(e=>e.path?.length?`${e.message} at ${bie(e.path)}`:e.message).join(`
|
|
265
|
+
`);if("message"in t&&typeof t.message=="string")return t.message;try{return JSON.stringify(t)}catch{return String(t)}}return String(t)}a(Hb,"getParseErrorMessage");function q4(t){return t.description}a(q4,"getSchemaDescription");function Z4(t){if(Fr(t))return t._zod?.def?.type==="optional";let e=t;return typeof t.isOptional=="function"?t.isOptional():e._def?.typeName==="ZodOptional"}a(Z4,"isSchemaOptional");function Zc(t){if(Fr(t)){let o=t._zod?.def;if(o){if(o.value!==void 0)return o.value;if(Array.isArray(o.values)&&o.values.length>0)return o.values[0]}}let n=t._def;if(n){if(n.value!==void 0)return n.value;if(Array.isArray(n.values)&&n.values.length>0)return n.values[0]}let i=t.value;if(i!==void 0)return i}a(Zc,"getLiteralValue");var yO="2025-11-25",V4="2025-03-26",Bc=[yO,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],ko="io.modelcontextprotocol/related-task",Gb="2.0",pt=yy(t=>t!==null&&(typeof t=="object"||typeof t=="function")),B4=Oe([E(),ke().int()]),K4=E(),vBe=kt({ttl:ke().optional(),pollInterval:ke().optional()}),wie=U({ttl:ke().optional()}),$ie=U({taskId:E()}),vO=kt({progressToken:B4.optional(),[ko]:$ie.optional()}),Dn=U({_meta:vO.optional()}),dp=Dn.extend({task:wie.optional()}),H4=a(t=>dp.safeParse(t).success,"isTaskAugmentedRequestParams"),Tt=U({method:E(),params:Dn.loose().optional()}),Wn=U({_meta:vO.optional()}),Gn=U({method:E(),params:Wn.loose().optional()}),At=kt({_meta:vO.optional()}),Jb=Oe([E(),ke().int()]),W4=U({jsonrpc:B(Gb),id:Jb,...Tt.shape}).strict(),fi=a(t=>W4.safeParse(t).success,"isJSONRPCRequest"),G4=U({jsonrpc:B(Gb),...Gn.shape}).strict(),J4=a(t=>G4.safeParse(t).success,"isJSONRPCNotification"),bO=U({jsonrpc:B(Gb),id:Jb,result:At}).strict(),pi=a(t=>bO.safeParse(t).success,"isJSONRPCResultResponse");var W;(function(t){t[t.ConnectionClosed=-32e3]="ConnectionClosed",t[t.RequestTimeout=-32001]="RequestTimeout",t[t.ParseError=-32700]="ParseError",t[t.InvalidRequest=-32600]="InvalidRequest",t[t.MethodNotFound=-32601]="MethodNotFound",t[t.InvalidParams=-32602]="InvalidParams",t[t.InternalError=-32603]="InternalError",t[t.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(W||(W={}));var wO=U({jsonrpc:B(Gb),id:Jb.optional(),error:U({code:ke().int(),message:E(),data:je().optional()})}).strict();var Kc=a(t=>wO.safeParse(t).success,"isJSONRPCErrorResponse");var fp=Oe([W4,G4,bO,wO]),bBe=Oe([bO,wO]),Yb=At.strict(),_ie=Wn.extend({requestId:Jb.optional(),reason:E().optional()}),Xb=Gn.extend({method:B("notifications/cancelled"),params:_ie}),kie=U({src:E(),mimeType:E().optional(),sizes:le(E()).optional(),theme:xt(["light","dark"]).optional()}),pp=U({icons:le(kie).optional()}),Vc=U({name:E(),title:E().optional()}),Y4=Vc.extend({...Vc.shape,...pp.shape,version:E(),websiteUrl:E().optional(),description:E().optional()}),xie=Fa(U({applyDefaults:et().optional()}),Pe(E(),je())),Sie=Ll(t=>t&&typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length===0?{form:{}}:t,Fa(U({form:xie.optional(),url:pt.optional()}),Pe(E(),je()).optional())),Iie=kt({list:pt.optional(),cancel:pt.optional(),requests:kt({sampling:kt({createMessage:pt.optional()}).optional(),elicitation:kt({create:pt.optional()}).optional()}).optional()}),Eie=kt({list:pt.optional(),cancel:pt.optional(),requests:kt({tools:kt({call:pt.optional()}).optional()}).optional()}),Tie=U({experimental:Pe(E(),pt).optional(),sampling:U({context:pt.optional(),tools:pt.optional()}).optional(),elicitation:Sie.optional(),roots:U({listChanged:et().optional()}).optional(),tasks:Iie.optional(),extensions:Pe(E(),pt).optional()}),Aie=Dn.extend({protocolVersion:E(),capabilities:Tie,clientInfo:Y4}),Qb=Tt.extend({method:B("initialize"),params:Aie}),$O=a(t=>Qb.safeParse(t).success,"isInitializeRequest"),Oie=U({experimental:Pe(E(),pt).optional(),logging:pt.optional(),completions:pt.optional(),prompts:U({listChanged:et().optional()}).optional(),resources:U({subscribe:et().optional(),listChanged:et().optional()}).optional(),tools:U({listChanged:et().optional()}).optional(),tasks:Eie.optional(),extensions:Pe(E(),pt).optional()}),Nie=At.extend({protocolVersion:E(),capabilities:Oie,serverInfo:Y4,instructions:E().optional()}),_O=Gn.extend({method:B("notifications/initialized"),params:Wn.optional()});var ew=Tt.extend({method:B("ping"),params:Dn.optional()}),Cie=U({progress:ke(),total:Ce(ke()),message:Ce(E())}),Pie=U({...Wn.shape,...Cie.shape,progressToken:B4}),tw=Gn.extend({method:B("notifications/progress"),params:Pie}),Rie=Dn.extend({cursor:K4.optional()}),mp=Tt.extend({params:Rie.optional()}),hp=At.extend({nextCursor:K4.optional()}),jie=xt(["working","input_required","completed","failed","cancelled"]),gp=U({taskId:E(),status:jie,ttl:Oe([ke(),Ol()]),createdAt:E(),lastUpdatedAt:E(),pollInterval:Ce(ke()),statusMessage:Ce(E())}),Hc=At.extend({task:gp}),zie=Wn.merge(gp),yp=Gn.extend({method:B("notifications/tasks/status"),params:zie}),nw=Tt.extend({method:B("tasks/get"),params:Dn.extend({taskId:E()})}),rw=At.merge(gp),iw=Tt.extend({method:B("tasks/result"),params:Dn.extend({taskId:E()})}),wBe=At.loose(),ow=mp.extend({method:B("tasks/list")}),sw=hp.extend({tasks:le(gp)}),aw=Tt.extend({method:B("tasks/cancel"),params:Dn.extend({taskId:E()})}),X4=At.merge(gp),Q4=U({uri:E(),mimeType:Ce(E()),_meta:Pe(E(),je()).optional()}),eq=Q4.extend({text:E()}),kO=E().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),tq=Q4.extend({blob:kO}),vp=xt(["user","assistant"]),Wc=U({audience:le(vp).optional(),priority:ke().min(0).max(1).optional(),lastModified:is.datetime({offset:!0}).optional()}),nq=U({...Vc.shape,...pp.shape,uri:E(),description:Ce(E()),mimeType:Ce(E()),size:Ce(ke()),annotations:Wc.optional(),_meta:Ce(kt({}))}),Die=U({...Vc.shape,...pp.shape,uriTemplate:E(),description:Ce(E()),mimeType:Ce(E()),annotations:Wc.optional(),_meta:Ce(kt({}))}),cw=mp.extend({method:B("resources/list")}),Lie=hp.extend({resources:le(nq)}),uw=mp.extend({method:B("resources/templates/list")}),Mie=hp.extend({resourceTemplates:le(Die)}),xO=Dn.extend({uri:E()}),Uie=xO,lw=Tt.extend({method:B("resources/read"),params:Uie}),Fie=At.extend({contents:le(Oe([eq,tq]))}),qie=Gn.extend({method:B("notifications/resources/list_changed"),params:Wn.optional()}),Zie=xO,Vie=Tt.extend({method:B("resources/subscribe"),params:Zie}),Bie=xO,Kie=Tt.extend({method:B("resources/unsubscribe"),params:Bie}),Hie=Wn.extend({uri:E()}),Wie=Gn.extend({method:B("notifications/resources/updated"),params:Hie}),Gie=U({name:E(),description:Ce(E()),required:Ce(et())}),Jie=U({...Vc.shape,...pp.shape,description:Ce(E()),arguments:Ce(le(Gie)),_meta:Ce(kt({}))}),dw=mp.extend({method:B("prompts/list")}),Yie=hp.extend({prompts:le(Jie)}),Xie=Dn.extend({name:E(),arguments:Pe(E(),E()).optional()}),fw=Tt.extend({method:B("prompts/get"),params:Xie}),SO=U({type:B("text"),text:E(),annotations:Wc.optional(),_meta:Pe(E(),je()).optional()}),IO=U({type:B("image"),data:kO,mimeType:E(),annotations:Wc.optional(),_meta:Pe(E(),je()).optional()}),EO=U({type:B("audio"),data:kO,mimeType:E(),annotations:Wc.optional(),_meta:Pe(E(),je()).optional()}),Qie=U({type:B("tool_use"),name:E(),id:E(),input:Pe(E(),je()),_meta:Pe(E(),je()).optional()}),eoe=U({type:B("resource"),resource:Oe([eq,tq]),annotations:Wc.optional(),_meta:Pe(E(),je()).optional()}),toe=nq.extend({type:B("resource_link")}),TO=Oe([SO,IO,EO,toe,eoe]),noe=U({role:vp,content:TO}),roe=At.extend({description:E().optional(),messages:le(noe)}),ioe=Gn.extend({method:B("notifications/prompts/list_changed"),params:Wn.optional()}),ooe=U({title:E().optional(),readOnlyHint:et().optional(),destructiveHint:et().optional(),idempotentHint:et().optional(),openWorldHint:et().optional()}),soe=U({taskSupport:xt(["required","optional","forbidden"]).optional()}),rq=U({...Vc.shape,...pp.shape,description:E().optional(),inputSchema:U({type:B("object"),properties:Pe(E(),pt).optional(),required:le(E()).optional()}).catchall(je()),outputSchema:U({type:B("object"),properties:Pe(E(),pt).optional(),required:le(E()).optional()}).catchall(je()).optional(),annotations:ooe.optional(),execution:soe.optional(),_meta:Pe(E(),je()).optional()}),pw=mp.extend({method:B("tools/list")}),aoe=hp.extend({tools:le(rq)}),mw=At.extend({content:le(TO).default([]),structuredContent:Pe(E(),je()).optional(),isError:et().optional()}),$Be=mw.or(At.extend({toolResult:je()})),coe=dp.extend({name:E(),arguments:Pe(E(),je()).optional()}),Gc=Tt.extend({method:B("tools/call"),params:coe}),uoe=Gn.extend({method:B("notifications/tools/list_changed"),params:Wn.optional()}),_Be=U({autoRefresh:et().default(!0),debounceMs:ke().int().nonnegative().default(300)}),bp=xt(["debug","info","notice","warning","error","critical","alert","emergency"]),loe=Dn.extend({level:bp}),AO=Tt.extend({method:B("logging/setLevel"),params:loe}),doe=Wn.extend({level:bp,logger:E().optional(),data:je()}),foe=Gn.extend({method:B("notifications/message"),params:doe}),poe=U({name:E().optional()}),moe=U({hints:le(poe).optional(),costPriority:ke().min(0).max(1).optional(),speedPriority:ke().min(0).max(1).optional(),intelligencePriority:ke().min(0).max(1).optional()}),hoe=U({mode:xt(["auto","required","none"]).optional()}),goe=U({type:B("tool_result"),toolUseId:E().describe("The unique identifier for the corresponding tool call."),content:le(TO).default([]),structuredContent:U({}).loose().optional(),isError:et().optional(),_meta:Pe(E(),je()).optional()}),yoe=Rl("type",[SO,IO,EO]),Wb=Rl("type",[SO,IO,EO,Qie,goe]),voe=U({role:vp,content:Oe([Wb,le(Wb)]),_meta:Pe(E(),je()).optional()}),boe=dp.extend({messages:le(voe),modelPreferences:moe.optional(),systemPrompt:E().optional(),includeContext:xt(["none","thisServer","allServers"]).optional(),temperature:ke().optional(),maxTokens:ke().int(),stopSequences:le(E()).optional(),metadata:pt.optional(),tools:le(rq).optional(),toolChoice:hoe.optional()}),woe=Tt.extend({method:B("sampling/createMessage"),params:boe}),wp=At.extend({model:E(),stopReason:Ce(xt(["endTurn","stopSequence","maxTokens"]).or(E())),role:vp,content:yoe}),OO=At.extend({model:E(),stopReason:Ce(xt(["endTurn","stopSequence","maxTokens","toolUse"]).or(E())),role:vp,content:Oe([Wb,le(Wb)])}),$oe=U({type:B("boolean"),title:E().optional(),description:E().optional(),default:et().optional()}),_oe=U({type:B("string"),title:E().optional(),description:E().optional(),minLength:ke().optional(),maxLength:ke().optional(),format:xt(["email","uri","date","date-time"]).optional(),default:E().optional()}),koe=U({type:xt(["number","integer"]),title:E().optional(),description:E().optional(),minimum:ke().optional(),maximum:ke().optional(),default:ke().optional()}),xoe=U({type:B("string"),title:E().optional(),description:E().optional(),enum:le(E()),default:E().optional()}),Soe=U({type:B("string"),title:E().optional(),description:E().optional(),oneOf:le(U({const:E(),title:E()})),default:E().optional()}),Ioe=U({type:B("string"),title:E().optional(),description:E().optional(),enum:le(E()),enumNames:le(E()).optional(),default:E().optional()}),Eoe=Oe([xoe,Soe]),Toe=U({type:B("array"),title:E().optional(),description:E().optional(),minItems:ke().optional(),maxItems:ke().optional(),items:U({type:B("string"),enum:le(E())}),default:le(E()).optional()}),Aoe=U({type:B("array"),title:E().optional(),description:E().optional(),minItems:ke().optional(),maxItems:ke().optional(),items:U({anyOf:le(U({const:E(),title:E()}))}),default:le(E()).optional()}),Ooe=Oe([Toe,Aoe]),Noe=Oe([Ioe,Eoe,Ooe]),Coe=Oe([Noe,$oe,_oe,koe]),Poe=dp.extend({mode:B("form").optional(),message:E(),requestedSchema:U({type:B("object"),properties:Pe(E(),Coe),required:le(E()).optional()})}),Roe=dp.extend({mode:B("url"),message:E(),elicitationId:E(),url:E().url()}),joe=Oe([Poe,Roe]),zoe=Tt.extend({method:B("elicitation/create"),params:joe}),Doe=Wn.extend({elicitationId:E()}),Loe=Gn.extend({method:B("notifications/elicitation/complete"),params:Doe}),Jc=At.extend({action:xt(["accept","decline","cancel"]),content:Ll(t=>t===null?void 0:t,Pe(E(),Oe([E(),ke(),et(),le(E())])).optional())}),Moe=U({type:B("ref/resource"),uri:E()});var Uoe=U({type:B("ref/prompt"),name:E()}),Foe=Dn.extend({ref:Oe([Uoe,Moe]),argument:U({name:E(),value:E()}),context:U({arguments:Pe(E(),E()).optional()}).optional()}),hw=Tt.extend({method:B("completion/complete"),params:Foe});function iq(t){if(t.params.ref.type!=="ref/prompt")throw new TypeError(`Expected CompleteRequestPrompt, but got ${t.params.ref.type}`)}a(iq,"assertCompleteRequestPrompt");function oq(t){if(t.params.ref.type!=="ref/resource")throw new TypeError(`Expected CompleteRequestResourceTemplate, but got ${t.params.ref.type}`)}a(oq,"assertCompleteRequestResourceTemplate");var qoe=At.extend({completion:kt({values:le(E()).max(100),total:Ce(ke().int()),hasMore:Ce(et())})}),Zoe=U({uri:E().startsWith("file://"),name:E().optional(),_meta:Pe(E(),je()).optional()}),Voe=Tt.extend({method:B("roots/list"),params:Dn.optional()}),NO=At.extend({roots:le(Zoe)}),Boe=Gn.extend({method:B("notifications/roots/list_changed"),params:Wn.optional()}),kBe=Oe([ew,Qb,hw,AO,fw,dw,cw,uw,lw,Vie,Kie,Gc,pw,nw,iw,ow,aw]),xBe=Oe([Xb,tw,_O,Boe,yp]),SBe=Oe([Yb,wp,OO,Jc,NO,rw,sw,Hc]),IBe=Oe([ew,woe,zoe,Voe,nw,iw,ow,aw]),EBe=Oe([Xb,tw,foe,Wie,qie,uoe,ioe,yp,Loe]),TBe=Oe([Yb,Nie,qoe,roe,Yie,Lie,Mie,Fie,mw,aoe,rw,sw,Hc]),K=class t extends Error{static{a(this,"McpError")}constructor(e,n,i){super(`MCP error ${e}: ${n}`),this.code=e,this.data=i,this.name="McpError"}static fromError(e,n,i){if(e===W.UrlElicitationRequired&&i){let r=i;if(r.elicitations)return new gO(r.elicitations,n)}return new t(e,n,i)}},gO=class extends K{static{a(this,"UrlElicitationRequiredError")}constructor(e,n=`URL elicitation${e.length>1?"s":""} required`){super(W.UrlElicitationRequired,n,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}};function xo(t){return t==="completed"||t==="failed"||t==="cancelled"}a(xo,"isTerminal");var aq=Symbol("Let zodToJsonSchema decide on which parser to use");var sq={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref",openAiAnyTypeName:"OpenAiAnyType"},cq=a(t=>typeof t=="string"?{...sq,name:t}:{...sq,...t},"getDefaultOptions");var uq=a(t=>{let e=cq(t),n=e.name!==void 0?[...e.basePath,e.definitionPath,e.name]:e.basePath;return{...e,flags:{hasReferencedOpenAiAnyType:!1},currentPath:n,propertyPath:void 0,seen:new Map(Object.entries(e.definitions).map(([i,r])=>[r._def,{def:r._def,path:[...e.basePath,e.definitionPath,i],jsonSchema:void 0}]))}},"getRefs");function CO(t,e,n,i){i?.errorMessages&&n&&(t.errorMessage={...t.errorMessage,[e]:n})}a(CO,"addErrorMessage");function ye(t,e,n,i,r){t[e]=n,CO(t,e,i,r)}a(ye,"setResponseValueAndErrors");var gw=a((t,e)=>{let n=0;for(;n<t.length&&n<e.length&&t[n]===e[n];n++);return[(t.length-n).toString(),...e.slice(n)].join("/")},"getRelativePath");function Ke(t){if(t.target!=="openAi")return{};let e=[...t.basePath,t.definitionPath,t.openAiAnyTypeName];return t.flags.hasReferencedOpenAiAnyType=!0,{$ref:t.$refStrategy==="relative"?gw(e,t.currentPath):e.join("/")}}a(Ke,"parseAnyDef");function lq(t,e){let n={type:"array"};return t.type?._def&&t.type?._def?.typeName!==j.ZodAny&&(n.items=ee(t.type._def,{...e,currentPath:[...e.currentPath,"items"]})),t.minLength&&ye(n,"minItems",t.minLength.value,t.minLength.message,e),t.maxLength&&ye(n,"maxItems",t.maxLength.value,t.maxLength.message,e),t.exactLength&&(ye(n,"minItems",t.exactLength.value,t.exactLength.message,e),ye(n,"maxItems",t.exactLength.value,t.exactLength.message,e)),n}a(lq,"parseArrayDef");function dq(t,e){let n={type:"integer",format:"int64"};if(!t.checks)return n;for(let i of t.checks)switch(i.kind){case"min":e.target==="jsonSchema7"?i.inclusive?ye(n,"minimum",i.value,i.message,e):ye(n,"exclusiveMinimum",i.value,i.message,e):(i.inclusive||(n.exclusiveMinimum=!0),ye(n,"minimum",i.value,i.message,e));break;case"max":e.target==="jsonSchema7"?i.inclusive?ye(n,"maximum",i.value,i.message,e):ye(n,"exclusiveMaximum",i.value,i.message,e):(i.inclusive||(n.exclusiveMaximum=!0),ye(n,"maximum",i.value,i.message,e));break;case"multipleOf":ye(n,"multipleOf",i.value,i.message,e);break}return n}a(dq,"parseBigintDef");function fq(){return{type:"boolean"}}a(fq,"parseBooleanDef");function yw(t,e){return ee(t.type._def,e)}a(yw,"parseBrandedDef");var pq=a((t,e)=>ee(t.innerType._def,e),"parseCatchDef");function PO(t,e,n){let i=n??e.dateStrategy;if(Array.isArray(i))return{anyOf:i.map((r,o)=>PO(t,e,r))};switch(i){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return Koe(t,e)}}a(PO,"parseDateDef");var Koe=a((t,e)=>{let n={type:"integer",format:"unix-time"};if(e.target==="openApi3")return n;for(let i of t.checks)switch(i.kind){case"min":ye(n,"minimum",i.value,i.message,e);break;case"max":ye(n,"maximum",i.value,i.message,e);break}return n},"integerDateParser");function mq(t,e){return{...ee(t.innerType._def,e),default:t.defaultValue()}}a(mq,"parseDefaultDef");function hq(t,e){return e.effectStrategy==="input"?ee(t.schema._def,e):Ke(e)}a(hq,"parseEffectsDef");function gq(t){return{type:"string",enum:Array.from(t.values)}}a(gq,"parseEnumDef");var Hoe=a(t=>"type"in t&&t.type==="string"?!1:"allOf"in t,"isJsonSchema7AllOfType");function yq(t,e){let n=[ee(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),ee(t.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(o=>!!o),i=e.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,r=[];return n.forEach(o=>{if(Hoe(o))r.push(...o.allOf),o.unevaluatedProperties===void 0&&(i=void 0);else{let s=o;if("additionalProperties"in o&&o.additionalProperties===!1){let{additionalProperties:c,...u}=o;s=u}else i=void 0;r.push(s)}}),r.length?{allOf:r,...i}:void 0}a(yq,"parseIntersectionDef");function vq(t,e){let n=typeof t.value;return n!=="bigint"&&n!=="number"&&n!=="boolean"&&n!=="string"?{type:Array.isArray(t.value)?"array":"object"}:e.target==="openApi3"?{type:n==="bigint"?"integer":n,enum:[t.value]}:{type:n==="bigint"?"integer":n,const:t.value}}a(vq,"parseLiteralDef");var RO,yr={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:a(()=>(RO===void 0&&(RO=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),RO),"emoji"),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function vw(t,e){let n={type:"string"};if(t.checks)for(let i of t.checks)switch(i.kind){case"min":ye(n,"minLength",typeof n.minLength=="number"?Math.max(n.minLength,i.value):i.value,i.message,e);break;case"max":ye(n,"maxLength",typeof n.maxLength=="number"?Math.min(n.maxLength,i.value):i.value,i.message,e);break;case"email":switch(e.emailStrategy){case"format:email":vr(n,"email",i.message,e);break;case"format:idn-email":vr(n,"idn-email",i.message,e);break;case"pattern:zod":Gt(n,yr.email,i.message,e);break}break;case"url":vr(n,"uri",i.message,e);break;case"uuid":vr(n,"uuid",i.message,e);break;case"regex":Gt(n,i.regex,i.message,e);break;case"cuid":Gt(n,yr.cuid,i.message,e);break;case"cuid2":Gt(n,yr.cuid2,i.message,e);break;case"startsWith":Gt(n,RegExp(`^${jO(i.value,e)}`),i.message,e);break;case"endsWith":Gt(n,RegExp(`${jO(i.value,e)}$`),i.message,e);break;case"datetime":vr(n,"date-time",i.message,e);break;case"date":vr(n,"date",i.message,e);break;case"time":vr(n,"time",i.message,e);break;case"duration":vr(n,"duration",i.message,e);break;case"length":ye(n,"minLength",typeof n.minLength=="number"?Math.max(n.minLength,i.value):i.value,i.message,e),ye(n,"maxLength",typeof n.maxLength=="number"?Math.min(n.maxLength,i.value):i.value,i.message,e);break;case"includes":{Gt(n,RegExp(jO(i.value,e)),i.message,e);break}case"ip":{i.version!=="v6"&&vr(n,"ipv4",i.message,e),i.version!=="v4"&&vr(n,"ipv6",i.message,e);break}case"base64url":Gt(n,yr.base64url,i.message,e);break;case"jwt":Gt(n,yr.jwt,i.message,e);break;case"cidr":{i.version!=="v6"&&Gt(n,yr.ipv4Cidr,i.message,e),i.version!=="v4"&&Gt(n,yr.ipv6Cidr,i.message,e);break}case"emoji":Gt(n,yr.emoji(),i.message,e);break;case"ulid":{Gt(n,yr.ulid,i.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{vr(n,"binary",i.message,e);break}case"contentEncoding:base64":{ye(n,"contentEncoding","base64",i.message,e);break}case"pattern:zod":{Gt(n,yr.base64,i.message,e);break}}break}case"nanoid":Gt(n,yr.nanoid,i.message,e);case"toLowerCase":case"toUpperCase":case"trim":break;default:}return n}a(vw,"parseStringDef");function jO(t,e){return e.patternStrategy==="escape"?Goe(t):t}a(jO,"escapeLiteralCheckValue");var Woe=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function Goe(t){let e="";for(let n=0;n<t.length;n++)Woe.has(t[n])||(e+="\\"),e+=t[n];return e}a(Goe,"escapeNonAlphaNumeric");function vr(t,e,n,i){t.format||t.anyOf?.some(r=>r.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push({format:t.format,...t.errorMessage&&i.errorMessages&&{errorMessage:{format:t.errorMessage.format}}}),delete t.format,t.errorMessage&&(delete t.errorMessage.format,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.anyOf.push({format:e,...n&&i.errorMessages&&{errorMessage:{format:n}}})):ye(t,"format",e,n,i)}a(vr,"addFormat");function Gt(t,e,n,i){t.pattern||t.allOf?.some(r=>r.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push({pattern:t.pattern,...t.errorMessage&&i.errorMessages&&{errorMessage:{pattern:t.errorMessage.pattern}}}),delete t.pattern,t.errorMessage&&(delete t.errorMessage.pattern,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.allOf.push({pattern:bq(e,i),...n&&i.errorMessages&&{errorMessage:{pattern:n}}})):ye(t,"pattern",bq(e,i),n,i)}a(Gt,"addPattern");function bq(t,e){if(!e.applyRegexFlags||!t.flags)return t.source;let n={i:t.flags.includes("i"),m:t.flags.includes("m"),s:t.flags.includes("s")},i=n.i?t.source.toLowerCase():t.source,r="",o=!1,s=!1,c=!1;for(let u=0;u<i.length;u++){if(o){r+=i[u],o=!1;continue}if(n.i){if(s){if(i[u].match(/[a-z]/)){c?(r+=i[u],r+=`${i[u-2]}-${i[u]}`.toUpperCase(),c=!1):i[u+1]==="-"&&i[u+2]?.match(/[a-z]/)?(r+=i[u],c=!0):r+=`${i[u]}${i[u].toUpperCase()}`;continue}}else if(i[u].match(/[a-z]/)){r+=`[${i[u]}${i[u].toUpperCase()}]`;continue}}if(n.m){if(i[u]==="^"){r+=`(^|(?<=[\r
|
|
266
|
+
]))`;continue}else if(i[u]==="$"){r+=`($|(?=[\r
|
|
267
|
+
]))`;continue}}if(n.s&&i[u]==="."){r+=s?`${i[u]}\r
|
|
268
|
+
`:`[${i[u]}\r
|
|
269
|
+
]`;continue}r+=i[u],i[u]==="\\"?o=!0:s&&i[u]==="]"?s=!1:!s&&i[u]==="["&&(s=!0)}try{new RegExp(r)}catch{return console.warn(`Could not convert regex pattern at ${e.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),t.source}return r}a(bq,"stringifyRegExpWithFlags");function bw(t,e){if(e.target==="openAi"&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),e.target==="openApi3"&&t.keyType?._def.typeName===j.ZodEnum)return{type:"object",required:t.keyType._def.values,properties:t.keyType._def.values.reduce((i,r)=>({...i,[r]:ee(t.valueType._def,{...e,currentPath:[...e.currentPath,"properties",r]})??Ke(e)}),{}),additionalProperties:e.rejectedAdditionalProperties};let n={type:"object",additionalProperties:ee(t.valueType._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]})??e.allowedAdditionalProperties};if(e.target==="openApi3")return n;if(t.keyType?._def.typeName===j.ZodString&&t.keyType._def.checks?.length){let{type:i,...r}=vw(t.keyType._def,e);return{...n,propertyNames:r}}else{if(t.keyType?._def.typeName===j.ZodEnum)return{...n,propertyNames:{enum:t.keyType._def.values}};if(t.keyType?._def.typeName===j.ZodBranded&&t.keyType._def.type._def.typeName===j.ZodString&&t.keyType._def.type._def.checks?.length){let{type:i,...r}=yw(t.keyType._def,e);return{...n,propertyNames:r}}}return n}a(bw,"parseRecordDef");function wq(t,e){if(e.mapStrategy==="record")return bw(t,e);let n=ee(t.keyType._def,{...e,currentPath:[...e.currentPath,"items","items","0"]})||Ke(e),i=ee(t.valueType._def,{...e,currentPath:[...e.currentPath,"items","items","1"]})||Ke(e);return{type:"array",maxItems:125,items:{type:"array",items:[n,i],minItems:2,maxItems:2}}}a(wq,"parseMapDef");function $q(t){let e=t.values,i=Object.keys(t.values).filter(o=>typeof e[e[o]]!="number").map(o=>e[o]),r=Array.from(new Set(i.map(o=>typeof o)));return{type:r.length===1?r[0]==="string"?"string":"number":["string","number"],enum:i}}a($q,"parseNativeEnumDef");function _q(t){return t.target==="openAi"?void 0:{not:Ke({...t,currentPath:[...t.currentPath,"not"]})}}a(_q,"parseNeverDef");function kq(t){return t.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}a(kq,"parseNullDef");var $p={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function Sq(t,e){if(e.target==="openApi3")return xq(t,e);let n=t.options instanceof Map?Array.from(t.options.values()):t.options;if(n.every(i=>i._def.typeName in $p&&(!i._def.checks||!i._def.checks.length))){let i=n.reduce((r,o)=>{let s=$p[o._def.typeName];return s&&!r.includes(s)?[...r,s]:r},[]);return{type:i.length>1?i:i[0]}}else if(n.every(i=>i._def.typeName==="ZodLiteral"&&!i.description)){let i=n.reduce((r,o)=>{let s=typeof o._def.value;switch(s){case"string":case"number":case"boolean":return[...r,s];case"bigint":return[...r,"integer"];case"object":if(o._def.value===null)return[...r,"null"];case"symbol":case"undefined":case"function":default:return r}},[]);if(i.length===n.length){let r=i.filter((o,s,c)=>c.indexOf(o)===s);return{type:r.length>1?r:r[0],enum:n.reduce((o,s)=>o.includes(s._def.value)?o:[...o,s._def.value],[])}}}else if(n.every(i=>i._def.typeName==="ZodEnum"))return{type:"string",enum:n.reduce((i,r)=>[...i,...r._def.values.filter(o=>!i.includes(o))],[])};return xq(t,e)}a(Sq,"parseUnionDef");var xq=a((t,e)=>{let n=(t.options instanceof Map?Array.from(t.options.values()):t.options).map((i,r)=>ee(i._def,{...e,currentPath:[...e.currentPath,"anyOf",`${r}`]})).filter(i=>!!i&&(!e.strictUnions||typeof i=="object"&&Object.keys(i).length>0));return n.length?{anyOf:n}:void 0},"asAnyOf");function Iq(t,e){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(t.innerType._def.typeName)&&(!t.innerType._def.checks||!t.innerType._def.checks.length))return e.target==="openApi3"?{type:$p[t.innerType._def.typeName],nullable:!0}:{type:[$p[t.innerType._def.typeName],"null"]};if(e.target==="openApi3"){let i=ee(t.innerType._def,{...e,currentPath:[...e.currentPath]});return i&&"$ref"in i?{allOf:[i],nullable:!0}:i&&{...i,nullable:!0}}let n=ee(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","0"]});return n&&{anyOf:[n,{type:"null"}]}}a(Iq,"parseNullableDef");function Eq(t,e){let n={type:"number"};if(!t.checks)return n;for(let i of t.checks)switch(i.kind){case"int":n.type="integer",CO(n,"type",i.message,e);break;case"min":e.target==="jsonSchema7"?i.inclusive?ye(n,"minimum",i.value,i.message,e):ye(n,"exclusiveMinimum",i.value,i.message,e):(i.inclusive||(n.exclusiveMinimum=!0),ye(n,"minimum",i.value,i.message,e));break;case"max":e.target==="jsonSchema7"?i.inclusive?ye(n,"maximum",i.value,i.message,e):ye(n,"exclusiveMaximum",i.value,i.message,e):(i.inclusive||(n.exclusiveMaximum=!0),ye(n,"maximum",i.value,i.message,e));break;case"multipleOf":ye(n,"multipleOf",i.value,i.message,e);break}return n}a(Eq,"parseNumberDef");function Tq(t,e){let n=e.target==="openAi",i={type:"object",properties:{}},r=[],o=t.shape();for(let c in o){let u=o[c];if(u===void 0||u._def===void 0)continue;let l=Yoe(u);l&&n&&(u._def.typeName==="ZodOptional"&&(u=u._def.innerType),u.isNullable()||(u=u.nullable()),l=!1);let d=ee(u._def,{...e,currentPath:[...e.currentPath,"properties",c],propertyPath:[...e.currentPath,"properties",c]});d!==void 0&&(i.properties[c]=d,l||r.push(c))}r.length&&(i.required=r);let s=Joe(t,e);return s!==void 0&&(i.additionalProperties=s),i}a(Tq,"parseObjectDef");function Joe(t,e){if(t.catchall._def.typeName!=="ZodNever")return ee(t.catchall._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]});switch(t.unknownKeys){case"passthrough":return e.allowedAdditionalProperties;case"strict":return e.rejectedAdditionalProperties;case"strip":return e.removeAdditionalStrategy==="strict"?e.allowedAdditionalProperties:e.rejectedAdditionalProperties}}a(Joe,"decideAdditionalProperties");function Yoe(t){try{return t.isOptional()}catch{return!0}}a(Yoe,"safeIsOptional");var Aq=a((t,e)=>{if(e.currentPath.toString()===e.propertyPath?.toString())return ee(t.innerType._def,e);let n=ee(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","1"]});return n?{anyOf:[{not:Ke(e)},n]}:Ke(e)},"parseOptionalDef");var Oq=a((t,e)=>{if(e.pipeStrategy==="input")return ee(t.in._def,e);if(e.pipeStrategy==="output")return ee(t.out._def,e);let n=ee(t.in._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),i=ee(t.out._def,{...e,currentPath:[...e.currentPath,"allOf",n?"1":"0"]});return{allOf:[n,i].filter(r=>r!==void 0)}},"parsePipelineDef");function Nq(t,e){return ee(t.type._def,e)}a(Nq,"parsePromiseDef");function Cq(t,e){let i={type:"array",uniqueItems:!0,items:ee(t.valueType._def,{...e,currentPath:[...e.currentPath,"items"]})};return t.minSize&&ye(i,"minItems",t.minSize.value,t.minSize.message,e),t.maxSize&&ye(i,"maxItems",t.maxSize.value,t.maxSize.message,e),i}a(Cq,"parseSetDef");function Pq(t,e){return t.rest?{type:"array",minItems:t.items.length,items:t.items.map((n,i)=>ee(n._def,{...e,currentPath:[...e.currentPath,"items",`${i}`]})).reduce((n,i)=>i===void 0?n:[...n,i],[]),additionalItems:ee(t.rest._def,{...e,currentPath:[...e.currentPath,"additionalItems"]})}:{type:"array",minItems:t.items.length,maxItems:t.items.length,items:t.items.map((n,i)=>ee(n._def,{...e,currentPath:[...e.currentPath,"items",`${i}`]})).reduce((n,i)=>i===void 0?n:[...n,i],[])}}a(Pq,"parseTupleDef");function Rq(t){return{not:Ke(t)}}a(Rq,"parseUndefinedDef");function jq(t){return Ke(t)}a(jq,"parseUnknownDef");var zq=a((t,e)=>ee(t.innerType._def,e),"parseReadonlyDef");var Dq=a((t,e,n)=>{switch(e){case j.ZodString:return vw(t,n);case j.ZodNumber:return Eq(t,n);case j.ZodObject:return Tq(t,n);case j.ZodBigInt:return dq(t,n);case j.ZodBoolean:return fq();case j.ZodDate:return PO(t,n);case j.ZodUndefined:return Rq(n);case j.ZodNull:return kq(n);case j.ZodArray:return lq(t,n);case j.ZodUnion:case j.ZodDiscriminatedUnion:return Sq(t,n);case j.ZodIntersection:return yq(t,n);case j.ZodTuple:return Pq(t,n);case j.ZodRecord:return bw(t,n);case j.ZodLiteral:return vq(t,n);case j.ZodEnum:return gq(t);case j.ZodNativeEnum:return $q(t);case j.ZodNullable:return Iq(t,n);case j.ZodOptional:return Aq(t,n);case j.ZodMap:return wq(t,n);case j.ZodSet:return Cq(t,n);case j.ZodLazy:return()=>t.getter()._def;case j.ZodPromise:return Nq(t,n);case j.ZodNaN:case j.ZodNever:return _q(n);case j.ZodEffects:return hq(t,n);case j.ZodAny:return Ke(n);case j.ZodUnknown:return jq(n);case j.ZodDefault:return mq(t,n);case j.ZodBranded:return yw(t,n);case j.ZodReadonly:return zq(t,n);case j.ZodCatch:return pq(t,n);case j.ZodPipeline:return Oq(t,n);case j.ZodFunction:case j.ZodVoid:case j.ZodSymbol:return;default:return(i=>{})(e)}},"selectParser");function ee(t,e,n=!1){let i=e.seen.get(t);if(e.override){let c=e.override?.(t,e,i,n);if(c!==aq)return c}if(i&&!n){let c=Xoe(i,e);if(c!==void 0)return c}let r={def:t,path:e.currentPath,jsonSchema:void 0};e.seen.set(t,r);let o=Dq(t,t.typeName,e),s=typeof o=="function"?ee(o(),e):o;if(s&&Qoe(t,e,s),e.postProcess){let c=e.postProcess(s,t,e);return r.jsonSchema=s,c}return r.jsonSchema=s,s}a(ee,"parseDef");var Xoe=a((t,e)=>{switch(e.$refStrategy){case"root":return{$ref:t.path.join("/")};case"relative":return{$ref:gw(e.currentPath,t.path)};case"none":case"seen":return t.path.length<e.currentPath.length&&t.path.every((n,i)=>e.currentPath[i]===n)?(console.warn(`Recursive reference detected at ${e.currentPath.join("/")}! Defaulting to any`),Ke(e)):e.$refStrategy==="seen"?Ke(e):void 0}},"get$ref"),Qoe=a((t,e,n)=>(t.description&&(n.description=t.description,e.markdownDescription&&(n.markdownDescription=t.description)),n),"addMeta");var zO=a((t,e)=>{let n=uq(e),i=typeof e=="object"&&e.definitions?Object.entries(e.definitions).reduce((u,[l,d])=>({...u,[l]:ee(d._def,{...n,currentPath:[...n.basePath,n.definitionPath,l]},!0)??Ke(n)}),{}):void 0,r=typeof e=="string"?e:e?.nameStrategy==="title"?void 0:e?.name,o=ee(t._def,r===void 0?n:{...n,currentPath:[...n.basePath,n.definitionPath,r]},!1)??Ke(n),s=typeof e=="object"&&e.name!==void 0&&e.nameStrategy==="title"?e.name:void 0;s!==void 0&&(o.title=s),n.flags.hasReferencedOpenAiAnyType&&(i||(i={}),i[n.openAiAnyTypeName]||(i[n.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:n.$refStrategy==="relative"?"1":[...n.basePath,n.definitionPath,n.openAiAnyTypeName].join("/")}}));let c=r===void 0?i?{...o,[n.definitionPath]:i}:o:{$ref:[...n.$refStrategy==="relative"?[]:n.basePath,n.definitionPath,r].join("/"),[n.definitionPath]:{...i,[r]:o}};return n.target==="jsonSchema7"?c.$schema="http://json-schema.org/draft-07/schema#":(n.target==="jsonSchema2019-09"||n.target==="openAi")&&(c.$schema="https://json-schema.org/draft/2019-09/schema#"),n.target==="openAi"&&("anyOf"in c||"oneOf"in c||"allOf"in c||"type"in c&&Array.isArray(c.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),c},"zodToJsonSchema");function ese(t){return!t||t==="jsonSchema7"||t==="draft-7"?"draft-7":t==="jsonSchema2019-09"||t==="draft-2020-12"?"draft-2020-12":"draft-7"}a(ese,"mapMiniTarget");function DO(t,e){return Fr(t)?es(t,{target:ese(e?.target),io:e?.pipeStrategy??"input"}):zO(t,{strictUnions:e?.strictUnions??!0,pipeStrategy:e?.pipeStrategy??"input"})}a(DO,"toJsonSchemaCompat");function LO(t){let n=_o(t)?.method;if(!n)throw new Error("Schema is missing a method literal");let i=Zc(n);if(typeof i!="string")throw new Error("Schema method literal must be a string");return i}a(LO,"getMethodLiteral");function MO(t,e){let n=$o(t,e);if(!n.success)throw n.error;return n.data}a(MO,"parseWithCompat");var tse=6e4,ww=class{static{a(this,"Protocol")}constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(Xb,n=>{this._oncancel(n)}),this.setNotificationHandler(tw,n=>{this._onprogress(n)}),this.setRequestHandler(ew,n=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(nw,async(n,i)=>{let r=await this._taskStore.getTask(n.params.taskId,i.sessionId);if(!r)throw new K(W.InvalidParams,"Failed to retrieve task: Task not found");return{...r}}),this.setRequestHandler(iw,async(n,i)=>{let r=a(async()=>{let o=n.params.taskId;if(this._taskMessageQueue){let c;for(;c=await this._taskMessageQueue.dequeue(o,i.sessionId);){if(c.type==="response"||c.type==="error"){let u=c.message,l=u.id,d=this._requestResolvers.get(l);if(d)if(this._requestResolvers.delete(l),c.type==="response")d(u);else{let f=u,p=new K(f.error.code,f.error.message,f.error.data);d(p)}else{let f=c.type==="response"?"Response":"Error";this._onerror(new Error(`${f} handler missing for request ${l}`))}continue}await this._transport?.send(c.message,{relatedRequestId:i.requestId})}}let s=await this._taskStore.getTask(o,i.sessionId);if(!s)throw new K(W.InvalidParams,`Task not found: ${o}`);if(!xo(s.status))return await this._waitForTaskUpdate(o,i.signal),await r();if(xo(s.status)){let c=await this._taskStore.getTaskResult(o,i.sessionId);return this._clearTaskQueue(o),{...c,_meta:{...c._meta,[ko]:{taskId:o}}}}return await r()},"handleTaskResult");return await r()}),this.setRequestHandler(ow,async(n,i)=>{try{let{tasks:r,nextCursor:o}=await this._taskStore.listTasks(n.params?.cursor,i.sessionId);return{tasks:r,nextCursor:o,_meta:{}}}catch(r){throw new K(W.InvalidParams,`Failed to list tasks: ${r instanceof Error?r.message:String(r)}`)}}),this.setRequestHandler(aw,async(n,i)=>{try{let r=await this._taskStore.getTask(n.params.taskId,i.sessionId);if(!r)throw new K(W.InvalidParams,`Task not found: ${n.params.taskId}`);if(xo(r.status))throw new K(W.InvalidParams,`Cannot cancel task in terminal status: ${r.status}`);await this._taskStore.updateTaskStatus(n.params.taskId,"cancelled","Client cancelled task execution.",i.sessionId),this._clearTaskQueue(n.params.taskId);let o=await this._taskStore.getTask(n.params.taskId,i.sessionId);if(!o)throw new K(W.InvalidParams,`Task not found after cancellation: ${n.params.taskId}`);return{_meta:{},...o}}catch(r){throw r instanceof K?r:new K(W.InvalidRequest,`Failed to cancel task: ${r instanceof Error?r.message:String(r)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,n,i,r,o=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,n),startTime:Date.now(),timeout:n,maxTotalTimeout:i,resetTimeoutOnProgress:o,onTimeout:r})}_resetTimeout(e){let n=this._timeoutInfo.get(e);if(!n)return!1;let i=Date.now()-n.startTime;if(n.maxTotalTimeout&&i>=n.maxTotalTimeout)throw this._timeoutInfo.delete(e),K.fromError(W.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:n.maxTotalTimeout,totalElapsed:i});return clearTimeout(n.timeoutId),n.timeoutId=setTimeout(n.onTimeout,n.timeout),!0}_cleanupTimeout(e){let n=this._timeoutInfo.get(e);n&&(clearTimeout(n.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=e;let n=this.transport?.onclose;this._transport.onclose=()=>{n?.(),this._onclose()};let i=this.transport?.onerror;this._transport.onerror=o=>{i?.(o),this._onerror(o)};let r=this._transport?.onmessage;this._transport.onmessage=(o,s)=>{r?.(o,s),pi(o)||Kc(o)?this._onresponse(o):fi(o)?this._onrequest(o,s):J4(o)?this._onnotification(o):this._onerror(new Error(`Unknown message type: ${JSON.stringify(o)}`))},await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let i of this._timeoutInfo.values())clearTimeout(i.timeoutId);this._timeoutInfo.clear();for(let i of this._requestHandlerAbortControllers.values())i.abort();this._requestHandlerAbortControllers.clear();let n=K.fromError(W.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let i of e.values())i(n)}_onerror(e){this.onerror?.(e)}_onnotification(e){let n=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;n!==void 0&&Promise.resolve().then(()=>n(e)).catch(i=>this._onerror(new Error(`Uncaught error in notification handler: ${i}`)))}_onrequest(e,n){let i=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,r=this._transport,o=e.params?._meta?.[ko]?.taskId;if(i===void 0){let d={jsonrpc:"2.0",id:e.id,error:{code:W.MethodNotFound,message:"Method not found"}};o&&this._taskMessageQueue?this._enqueueTaskMessage(o,{type:"error",message:d,timestamp:Date.now()},r?.sessionId).catch(f=>this._onerror(new Error(`Failed to enqueue error response: ${f}`))):r?.send(d).catch(f=>this._onerror(new Error(`Failed to send an error response: ${f}`)));return}let s=new AbortController;this._requestHandlerAbortControllers.set(e.id,s);let c=H4(e.params)?e.params.task:void 0,u=this._taskStore?this.requestTaskStore(e,r?.sessionId):void 0,l={signal:s.signal,sessionId:r?.sessionId,_meta:e.params?._meta,sendNotification:a(async d=>{if(s.signal.aborted)return;let f={relatedRequestId:e.id};o&&(f.relatedTask={taskId:o}),await this.notification(d,f)},"sendNotification"),sendRequest:a(async(d,f,p)=>{if(s.signal.aborted)throw new K(W.ConnectionClosed,"Request was cancelled");let m={...p,relatedRequestId:e.id};o&&!m.relatedTask&&(m.relatedTask={taskId:o});let g=m.relatedTask?.taskId??o;return g&&u&&await u.updateTaskStatus(g,"input_required"),await this.request(d,f,m)},"sendRequest"),authInfo:n?.authInfo,requestId:e.id,requestInfo:n?.requestInfo,taskId:o,taskStore:u,taskRequestedTtl:c?.ttl,closeSSEStream:n?.closeSSEStream,closeStandaloneSSEStream:n?.closeStandaloneSSEStream};Promise.resolve().then(()=>{c&&this.assertTaskHandlerCapability(e.method)}).then(()=>i(e,l)).then(async d=>{if(s.signal.aborted)return;let f={result:d,jsonrpc:"2.0",id:e.id};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"response",message:f,timestamp:Date.now()},r?.sessionId):await r?.send(f)},async d=>{if(s.signal.aborted)return;let f={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(d.code)?d.code:W.InternalError,message:d.message??"Internal error",...d.data!==void 0&&{data:d.data}}};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"error",message:f,timestamp:Date.now()},r?.sessionId):await r?.send(f)}).catch(d=>this._onerror(new Error(`Failed to send response: ${d}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===s&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){let{progressToken:n,...i}=e.params,r=Number(n),o=this._progressHandlers.get(r);if(!o){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let s=this._responseHandlers.get(r),c=this._timeoutInfo.get(r);if(c&&s&&c.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(u){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),s(u);return}o(i)}_onresponse(e){let n=Number(e.id),i=this._requestResolvers.get(n);if(i){if(this._requestResolvers.delete(n),pi(e))i(e);else{let s=new K(e.error.code,e.error.message,e.error.data);i(s)}return}let r=this._responseHandlers.get(n);if(r===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(n),this._cleanupTimeout(n);let o=!1;if(pi(e)&&e.result&&typeof e.result=="object"){let s=e.result;if(s.task&&typeof s.task=="object"){let c=s.task;typeof c.taskId=="string"&&(o=!0,this._taskProgressTokens.set(c.taskId,n))}}if(o||this._progressHandlers.delete(n),pi(e))r(e);else{let s=K.fromError(e.error.code,e.error.message,e.error.data);r(s)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,n,i){let{task:r}=i??{};if(!r){try{yield{type:"result",result:await this.request(e,n,i)}}catch(s){yield{type:"error",error:s instanceof K?s:new K(W.InternalError,String(s))}}return}let o;try{let s=await this.request(e,Hc,i);if(s.task)o=s.task.taskId,yield{type:"taskCreated",task:s.task};else throw new K(W.InternalError,"Task creation did not return a task");for(;;){let c=await this.getTask({taskId:o},i);if(yield{type:"taskStatus",task:c},xo(c.status)){c.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:o},n,i)}:c.status==="failed"?yield{type:"error",error:new K(W.InternalError,`Task ${o} failed`)}:c.status==="cancelled"&&(yield{type:"error",error:new K(W.InternalError,`Task ${o} was cancelled`)});return}if(c.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:o},n,i)};return}let u=c.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(l=>setTimeout(l,u)),i?.signal?.throwIfAborted()}}catch(s){yield{type:"error",error:s instanceof K?s:new K(W.InternalError,String(s))}}}request(e,n,i){let{relatedRequestId:r,resumptionToken:o,onresumptiontoken:s,task:c,relatedTask:u}=i??{};return new Promise((l,d)=>{let f=a(b=>{d(b)},"earlyReject");if(!this._transport){f(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),c&&this.assertTaskCapability(e.method)}catch(b){f(b);return}i?.signal?.throwIfAborted();let p=this._requestMessageId++,m={...e,jsonrpc:"2.0",id:p};i?.onprogress&&(this._progressHandlers.set(p,i.onprogress),m.params={...e.params,_meta:{...e.params?._meta||{},progressToken:p}}),c&&(m.params={...m.params,task:c}),u&&(m.params={...m.params,_meta:{...m.params?._meta||{},[ko]:u}});let g=a(b=>{this._responseHandlers.delete(p),this._progressHandlers.delete(p),this._cleanupTimeout(p),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:p,reason:String(b)}},{relatedRequestId:r,resumptionToken:o,onresumptiontoken:s}).catch(x=>this._onerror(new Error(`Failed to send cancellation: ${x}`)));let $=b instanceof K?b:new K(W.RequestTimeout,String(b));d($)},"cancel");this._responseHandlers.set(p,b=>{if(!i?.signal?.aborted){if(b instanceof Error)return d(b);try{let $=$o(n,b.result);$.success?l($.data):d($.error)}catch($){d($)}}}),i?.signal?.addEventListener("abort",()=>{g(i?.signal?.reason)});let y=i?.timeout??tse,v=a(()=>g(K.fromError(W.RequestTimeout,"Request timed out",{timeout:y})),"timeoutHandler");this._setupTimeout(p,y,i?.maxTotalTimeout,v,i?.resetTimeoutOnProgress??!1);let w=u?.taskId;if(w){let b=a($=>{let x=this._responseHandlers.get(p);x?x($):this._onerror(new Error(`Response handler missing for side-channeled request ${p}`))},"responseResolver");this._requestResolvers.set(p,b),this._enqueueTaskMessage(w,{type:"request",message:m,timestamp:Date.now()}).catch($=>{this._cleanupTimeout(p),d($)})}else this._transport.send(m,{relatedRequestId:r,resumptionToken:o,onresumptiontoken:s}).catch(b=>{this._cleanupTimeout(p),d(b)})})}async getTask(e,n){return this.request({method:"tasks/get",params:e},rw,n)}async getTaskResult(e,n,i){return this.request({method:"tasks/result",params:e},n,i)}async listTasks(e,n){return this.request({method:"tasks/list",params:e},sw,n)}async cancelTask(e,n){return this.request({method:"tasks/cancel",params:e},X4,n)}async notification(e,n){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);let i=n?.relatedTask?.taskId;if(i){let c={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[ko]:n.relatedTask}}};await this._enqueueTaskMessage(i,{type:"notification",message:c,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!n?.relatedRequestId&&!n?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let c={...e,jsonrpc:"2.0"};n?.relatedTask&&(c={...c,params:{...c.params,_meta:{...c.params?._meta||{},[ko]:n.relatedTask}}}),this._transport?.send(c,n).catch(u=>this._onerror(u))});return}let s={...e,jsonrpc:"2.0"};n?.relatedTask&&(s={...s,params:{...s.params,_meta:{...s.params?._meta||{},[ko]:n.relatedTask}}}),await this._transport.send(s,n)}setRequestHandler(e,n){let i=LO(e);this.assertRequestHandlerCapability(i),this._requestHandlers.set(i,(r,o)=>{let s=MO(e,r);return Promise.resolve(n(s,o))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,n){let i=LO(e);this._notificationHandlers.set(i,r=>{let o=MO(e,r);return Promise.resolve(n(o))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){let n=this._taskProgressTokens.get(e);n!==void 0&&(this._progressHandlers.delete(n),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,n,i){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let r=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,n,i,r)}async _clearTaskQueue(e,n){if(this._taskMessageQueue){let i=await this._taskMessageQueue.dequeueAll(e,n);for(let r of i)if(r.type==="request"&&fi(r.message)){let o=r.message.id,s=this._requestResolvers.get(o);s?(s(new K(W.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(o)):this._onerror(new Error(`Resolver missing for request ${o} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,n){let i=this._options?.defaultTaskPollInterval??1e3;try{let r=await this._taskStore?.getTask(e);r?.pollInterval&&(i=r.pollInterval)}catch{}return new Promise((r,o)=>{if(n.aborted){o(new K(W.InvalidRequest,"Request cancelled"));return}let s=setTimeout(r,i);n.addEventListener("abort",()=>{clearTimeout(s),o(new K(W.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,n){let i=this._taskStore;if(!i)throw new Error("No task store configured");return{createTask:a(async r=>{if(!e)throw new Error("No request provided");return await i.createTask(r,e.id,{method:e.method,params:e.params},n)},"createTask"),getTask:a(async r=>{let o=await i.getTask(r,n);if(!o)throw new K(W.InvalidParams,"Failed to retrieve task: Task not found");return o},"getTask"),storeTaskResult:a(async(r,o,s)=>{await i.storeTaskResult(r,o,s,n);let c=await i.getTask(r,n);if(c){let u=yp.parse({method:"notifications/tasks/status",params:c});await this.notification(u),xo(c.status)&&this._cleanupTaskProgressHandler(r)}},"storeTaskResult"),getTaskResult:a(r=>i.getTaskResult(r,n),"getTaskResult"),updateTaskStatus:a(async(r,o,s)=>{let c=await i.getTask(r,n);if(!c)throw new K(W.InvalidParams,`Task "${r}" not found - it may have been cleaned up`);if(xo(c.status))throw new K(W.InvalidParams,`Cannot update task "${r}" from terminal status "${c.status}" to "${o}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await i.updateTaskStatus(r,o,s,n);let u=await i.getTask(r,n);if(u){let l=yp.parse({method:"notifications/tasks/status",params:u});await this.notification(l),xo(u.status)&&this._cleanupTaskProgressHandler(r)}},"updateTaskStatus"),listTasks:a(r=>i.listTasks(r,n),"listTasks")}}};function Lq(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}a(Lq,"isPlainObject");function Mq(t,e){let n={...t};for(let i in e){let r=i,o=e[r];if(o===void 0)continue;let s=n[r];Lq(s)&&Lq(o)?n[r]={...s,...o}:n[r]=o}return n}a(Mq,"mergeCapabilities");var MZ=ta(OC(),1),UZ=ta(LZ(),1);function ffe(){let t=new MZ.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,UZ.default)(t),t}a(ffe,"createDefaultAjvInstance");var r$=class{static{a(this,"AjvJsonSchemaValidator")}constructor(e){this._ajv=e??ffe()}getValidator(e){let n="$id"in e&&typeof e.$id=="string"?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return i=>n(i)?{valid:!0,data:i,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(n.errors)}}};var i$=class{static{a(this,"ExperimentalServerTasks")}constructor(e){this._server=e}requestStream(e,n,i){return this._server.requestStream(e,n,i)}createMessageStream(e,n){let i=this._server.getClientCapabilities();if((e.tools||e.toolChoice)&&!i?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if(e.messages.length>0){let r=e.messages[e.messages.length-1],o=Array.isArray(r.content)?r.content:[r.content],s=o.some(d=>d.type==="tool_result"),c=e.messages.length>1?e.messages[e.messages.length-2]:void 0,u=c?Array.isArray(c.content)?c.content:[c.content]:[],l=u.some(d=>d.type==="tool_use");if(s){if(o.some(d=>d.type!=="tool_result"))throw new Error("The last message must contain only tool_result content if any is present");if(!l)throw new Error("tool_result blocks are not matching any tool_use from the previous message")}if(l){let d=new Set(u.filter(p=>p.type==="tool_use").map(p=>p.id)),f=new Set(o.filter(p=>p.type==="tool_result").map(p=>p.toolUseId));if(d.size!==f.size||![...d].every(p=>f.has(p)))throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return this.requestStream({method:"sampling/createMessage",params:e},wp,n)}elicitInputStream(e,n){let i=this._server.getClientCapabilities(),r=e.mode??"form";switch(r){case"url":{if(!i?.elicitation?.url)throw new Error("Client does not support url elicitation.");break}case"form":{if(!i?.elicitation?.form)throw new Error("Client does not support form elicitation.");break}}let o=r==="form"&&e.mode===void 0?{...e,mode:"form"}:e;return this.requestStream({method:"elicitation/create",params:o},Jc,n)}async getTask(e,n){return this._server.getTask({taskId:e},n)}async getTaskResult(e,n,i){return this._server.getTaskResult({taskId:e},n,i)}async listTasks(e,n){return this._server.listTasks(e?{cursor:e}:void 0,n)}async cancelTask(e,n){return this._server.cancelTask({taskId:e},n)}};function FZ(t,e,n){if(!t)throw new Error(`${n} does not support task creation (required for ${e})`);switch(e){case"tools/call":if(!t.tools?.call)throw new Error(`${n} does not support task creation for tools/call (required for ${e})`);break;default:break}}a(FZ,"assertToolsCallTaskCapability");function qZ(t,e,n){if(!t)throw new Error(`${n} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!t.sampling?.createMessage)throw new Error(`${n} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!t.elicitation?.create)throw new Error(`${n} does not support task creation for elicitation/create (required for ${e})`);break;default:break}}a(qZ,"assertClientRequestTaskCapability");var o$=class extends ww{static{a(this,"Server")}constructor(e,n){super(n),this._serverInfo=e,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(bp.options.map((i,r)=>[i,r])),this.isMessageIgnored=(i,r)=>{let o=this._loggingLevels.get(r);return o?this.LOG_LEVEL_SEVERITY.get(i)<this.LOG_LEVEL_SEVERITY.get(o):!1},this._capabilities=n?.capabilities??{},this._instructions=n?.instructions,this._jsonSchemaValidator=n?.jsonSchemaValidator??new r$,this.setRequestHandler(Qb,i=>this._oninitialize(i)),this.setNotificationHandler(_O,()=>this.oninitialized?.()),this._capabilities.logging&&this.setRequestHandler(AO,async(i,r)=>{let o=r.sessionId||r.requestInfo?.headers["mcp-session-id"]||void 0,{level:s}=i.params,c=bp.safeParse(s);return c.success&&this._loggingLevels.set(o,c.data),{}})}get experimental(){return this._experimental||(this._experimental={tasks:new i$(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=Mq(this._capabilities,e)}setRequestHandler(e,n){let r=_o(e)?.method;if(!r)throw new Error("Schema is missing a method literal");let o=Zc(r);if(typeof o!="string")throw new Error("Schema method literal must be a string");if(o==="tools/call"){let c=a(async(u,l)=>{let d=$o(Gc,u);if(!d.success){let g=d.error instanceof Error?d.error.message:String(d.error);throw new K(W.InvalidParams,`Invalid tools/call request: ${g}`)}let{params:f}=d.data,p=await Promise.resolve(n(u,l));if(f.task){let g=$o(Hc,p);if(!g.success){let y=g.error instanceof Error?g.error.message:String(g.error);throw new K(W.InvalidParams,`Invalid task creation result: ${y}`)}return g.data}let m=$o(mw,p);if(!m.success){let g=m.error instanceof Error?m.error.message:String(m.error);throw new K(W.InvalidParams,`Invalid tools/call result: ${g}`)}return m.data},"wrappedHandler");return super.setRequestHandler(e,c)}return super.setRequestHandler(e,n)}assertCapabilityForMethod(e){switch(e){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw new Error(`Client does not support sampling (required for ${e})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new Error(`Client does not support elicitation (required for ${e})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new Error(`Client does not support listing roots (required for ${e})`);break;case"ping":break}}assertNotificationCapability(e){switch(e){case"notifications/message":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new Error(`Server does not support notifying about resources (required for ${e})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new Error(`Server does not support notifying of tool list changes (required for ${e})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new Error(`Server does not support notifying of prompt list changes (required for ${e})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new Error(`Client does not support URL elicitation (required for ${e})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"completion/complete":if(!this._capabilities.completions)throw new Error(`Server does not support completions (required for ${e})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new Error(`Server does not support resources (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new Error(`Server does not support tools (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Server does not support tasks capability (required for ${e})`);break;case"ping":case"initialize":break}}assertTaskCapability(e){qZ(this._clientCapabilities?.tasks?.requests,e,"Client")}assertTaskHandlerCapability(e){this._capabilities&&FZ(this._capabilities.tasks?.requests,e,"Server")}async _oninitialize(e){let n=e.params.protocolVersion;return this._clientCapabilities=e.params.capabilities,this._clientVersion=e.params.clientInfo,{protocolVersion:Bc.includes(n)?n:yO,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getCapabilities(){return this._capabilities}async ping(){return this.request({method:"ping"},Yb)}async createMessage(e,n){if((e.tools||e.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if(e.messages.length>0){let i=e.messages[e.messages.length-1],r=Array.isArray(i.content)?i.content:[i.content],o=r.some(l=>l.type==="tool_result"),s=e.messages.length>1?e.messages[e.messages.length-2]:void 0,c=s?Array.isArray(s.content)?s.content:[s.content]:[],u=c.some(l=>l.type==="tool_use");if(o){if(r.some(l=>l.type!=="tool_result"))throw new Error("The last message must contain only tool_result content if any is present");if(!u)throw new Error("tool_result blocks are not matching any tool_use from the previous message")}if(u){let l=new Set(c.filter(f=>f.type==="tool_use").map(f=>f.id)),d=new Set(r.filter(f=>f.type==="tool_result").map(f=>f.toolUseId));if(l.size!==d.size||![...l].every(f=>d.has(f)))throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return e.tools?this.request({method:"sampling/createMessage",params:e},OO,n):this.request({method:"sampling/createMessage",params:e},wp,n)}async elicitInput(e,n){switch(e.mode??"form"){case"url":{if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support url elicitation.");let r=e;return this.request({method:"elicitation/create",params:r},Jc,n)}case"form":{if(!this._clientCapabilities?.elicitation?.form)throw new Error("Client does not support form elicitation.");let r=e.mode==="form"?e:{...e,mode:"form"},o=await this.request({method:"elicitation/create",params:r},Jc,n);if(o.action==="accept"&&o.content&&r.requestedSchema)try{let c=this._jsonSchemaValidator.getValidator(r.requestedSchema)(o.content);if(!c.valid)throw new K(W.InvalidParams,`Elicitation response content does not match requested schema: ${c.errorMessage}`)}catch(s){throw s instanceof K?s:new K(W.InternalError,`Error validating elicitation response: ${s instanceof Error?s.message:String(s)}`)}return o}}}createElicitationCompletionNotifier(e,n){if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:e}},n)}async listRoots(e,n){return this.request({method:"roots/list",params:e},NO,n)}async sendLoggingMessage(e,n){if(this._capabilities.logging&&!this.isMessageIgnored(e.level,n))return this.notification({method:"notifications/message",params:e})}async sendResourceUpdated(e){return this.notification({method:"notifications/resources/updated",params:e})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}};var VZ=Symbol.for("mcp.completable");function LC(t){return!!t&&typeof t=="object"&&VZ in t}a(LC,"isCompletable");function BZ(t){return t[VZ]?.complete}a(BZ,"getCompleter");var ZZ;(function(t){t.Completable="McpCompletable"})(ZZ||(ZZ={}));var pfe=/^[A-Za-z0-9._-]{1,128}$/;function mfe(t){let e=[];if(t.length===0)return{isValid:!1,warnings:["Tool name cannot be empty"]};if(t.length>128)return{isValid:!1,warnings:[`Tool name exceeds maximum length of 128 characters (current: ${t.length})`]};if(t.includes(" ")&&e.push("Tool name contains spaces, which may cause parsing issues"),t.includes(",")&&e.push("Tool name contains commas, which may cause parsing issues"),(t.startsWith("-")||t.endsWith("-"))&&e.push("Tool name starts or ends with a dash, which may cause parsing issues in some contexts"),(t.startsWith(".")||t.endsWith("."))&&e.push("Tool name starts or ends with a dot, which may cause parsing issues in some contexts"),!pfe.test(t)){let n=t.split("").filter(i=>!/[A-Za-z0-9._-]/.test(i)).filter((i,r,o)=>o.indexOf(i)===r);return e.push(`Tool name contains invalid characters: ${n.map(i=>`"${i}"`).join(", ")}`,"Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)"),{isValid:!1,warnings:e}}return{isValid:!0,warnings:e}}a(mfe,"validateToolName");function hfe(t,e){if(e.length>0){console.warn(`Tool name validation warning for "${t}":`);for(let n of e)console.warn(` - ${n}`);console.warn("Tool registration will proceed, but this may cause compatibility issues."),console.warn("Consider updating the tool name to conform to the MCP tool naming standard."),console.warn("See SEP: Specify Format for Tool Names (https://github.com/modelcontextprotocol/modelcontextprotocol/issues/986) for more details.")}}a(hfe,"issueToolNameWarning");function MC(t){let e=mfe(t);return hfe(t,e.warnings),e.isValid}a(MC,"validateAndWarnToolName");var s$=class{static{a(this,"ExperimentalMcpServerTasks")}constructor(e){this._mcpServer=e}registerToolTask(e,n,i){let r={taskSupport:"required",...n.execution};if(r.taskSupport==="forbidden")throw new Error(`Cannot register task-based tool '${e}' with taskSupport 'forbidden'. Use registerTool() instead.`);return this._mcpServer._createRegisteredTool(e,n.title,n.description,n.inputSchema,n.outputSchema,n.annotations,r,n._meta,i)}};var a$=class{static{a(this,"McpServer")}constructor(e,n){this._registeredResources={},this._registeredResourceTemplates={},this._registeredTools={},this._registeredPrompts={},this._toolHandlersInitialized=!1,this._completionHandlerInitialized=!1,this._resourceHandlersInitialized=!1,this._promptHandlersInitialized=!1,this.server=new o$(e,n)}get experimental(){return this._experimental||(this._experimental={tasks:new s$(this)}),this._experimental}async connect(e){return await this.server.connect(e)}async close(){await this.server.close()}setToolRequestHandlers(){this._toolHandlersInitialized||(this.server.assertCanSetRequestHandler(Po(pw)),this.server.assertCanSetRequestHandler(Po(Gc)),this.server.registerCapabilities({tools:{listChanged:!0}}),this.server.setRequestHandler(pw,()=>({tools:Object.entries(this._registeredTools).filter(([,e])=>e.enabled).map(([e,n])=>{let i={name:e,title:n.title,description:n.description,inputSchema:(()=>{let r=qc(n.inputSchema);return r?DO(r,{strictUnions:!0,pipeStrategy:"input"}):gfe})(),annotations:n.annotations,execution:n.execution,_meta:n._meta};if(n.outputSchema){let r=qc(n.outputSchema);r&&(i.outputSchema=DO(r,{strictUnions:!0,pipeStrategy:"output"}))}return i})})),this.server.setRequestHandler(Gc,async(e,n)=>{try{let i=this._registeredTools[e.params.name];if(!i)throw new K(W.InvalidParams,`Tool ${e.params.name} not found`);if(!i.enabled)throw new K(W.InvalidParams,`Tool ${e.params.name} disabled`);let r=!!e.params.task,o=i.execution?.taskSupport,s="createTask"in i.handler;if((o==="required"||o==="optional")&&!s)throw new K(W.InternalError,`Tool ${e.params.name} has taskSupport '${o}' but was not registered with registerToolTask`);if(o==="required"&&!r)throw new K(W.MethodNotFound,`Tool ${e.params.name} requires task augmentation (taskSupport: 'required')`);if(o==="optional"&&!r&&s)return await this.handleAutomaticTaskPolling(i,e,n);let c=await this.validateToolInput(i,e.params.arguments,e.params.name),u=await this.executeToolHandler(i,c,n);return r||await this.validateToolOutput(i,u,e.params.name),u}catch(i){if(i instanceof K&&i.code===W.UrlElicitationRequired)throw i;return this.createToolError(i instanceof Error?i.message:String(i))}}),this._toolHandlersInitialized=!0)}createToolError(e){return{content:[{type:"text",text:e}],isError:!0}}async validateToolInput(e,n,i){if(!e.inputSchema)return;let o=qc(e.inputSchema)??e.inputSchema,s=await Kb(o,n);if(!s.success){let c="error"in s?s.error:"Unknown error",u=Hb(c);throw new K(W.InvalidParams,`Input validation error: Invalid arguments for tool ${i}: ${u}`)}return s.data}async validateToolOutput(e,n,i){if(!e.outputSchema||!("content"in n)||n.isError)return;if(!n.structuredContent)throw new K(W.InvalidParams,`Output validation error: Tool ${i} has an output schema but no structured content was provided`);let r=qc(e.outputSchema),o=await Kb(r,n.structuredContent);if(!o.success){let s="error"in o?o.error:"Unknown error",c=Hb(s);throw new K(W.InvalidParams,`Output validation error: Invalid structured content for tool ${i}: ${c}`)}}async executeToolHandler(e,n,i){let r=e.handler;if("createTask"in r){if(!i.taskStore)throw new Error("No task store provided.");let s={...i,taskStore:i.taskStore};if(e.inputSchema){let c=r;return await Promise.resolve(c.createTask(n,s))}else{let c=r;return await Promise.resolve(c.createTask(s))}}if(e.inputSchema){let s=r;return await Promise.resolve(s(n,i))}else{let s=r;return await Promise.resolve(s(i))}}async handleAutomaticTaskPolling(e,n,i){if(!i.taskStore)throw new Error("No task store provided for task-capable tool.");let r=await this.validateToolInput(e,n.params.arguments,n.params.name),o=e.handler,s={...i,taskStore:i.taskStore},c=r?await Promise.resolve(o.createTask(r,s)):await Promise.resolve(o.createTask(s)),u=c.task.taskId,l=c.task,d=l.pollInterval??5e3;for(;l.status!=="completed"&&l.status!=="failed"&&l.status!=="cancelled";){await new Promise(p=>setTimeout(p,d));let f=await i.taskStore.getTask(u);if(!f)throw new K(W.InternalError,`Task ${u} not found during polling`);l=f}return await i.taskStore.getTaskResult(u)}setCompletionRequestHandler(){this._completionHandlerInitialized||(this.server.assertCanSetRequestHandler(Po(hw)),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler(hw,async e=>{switch(e.params.ref.type){case"ref/prompt":return iq(e),this.handlePromptCompletion(e,e.params.ref);case"ref/resource":return oq(e),this.handleResourceCompletion(e,e.params.ref);default:throw new K(W.InvalidParams,`Invalid completion reference: ${e.params.ref}`)}}),this._completionHandlerInitialized=!0)}async handlePromptCompletion(e,n){let i=this._registeredPrompts[n.name];if(!i)throw new K(W.InvalidParams,`Prompt ${n.name} not found`);if(!i.enabled)throw new K(W.InvalidParams,`Prompt ${n.name} disabled`);if(!i.argsSchema)return Xp;let o=_o(i.argsSchema)?.[e.params.argument.name];if(!LC(o))return Xp;let s=BZ(o);if(!s)return Xp;let c=await s(e.params.argument.value,e.params.context);return HZ(c)}async handleResourceCompletion(e,n){let i=Object.values(this._registeredResourceTemplates).find(s=>s.resourceTemplate.uriTemplate.toString()===n.uri);if(!i){if(this._registeredResources[n.uri])return Xp;throw new K(W.InvalidParams,`Resource template ${e.params.ref.uri} not found`)}let r=i.resourceTemplate.completeCallback(e.params.argument.name);if(!r)return Xp;let o=await r(e.params.argument.value,e.params.context);return HZ(o)}setResourceRequestHandlers(){this._resourceHandlersInitialized||(this.server.assertCanSetRequestHandler(Po(cw)),this.server.assertCanSetRequestHandler(Po(uw)),this.server.assertCanSetRequestHandler(Po(lw)),this.server.registerCapabilities({resources:{listChanged:!0}}),this.server.setRequestHandler(cw,async(e,n)=>{let i=Object.entries(this._registeredResources).filter(([o,s])=>s.enabled).map(([o,s])=>({uri:o,name:s.name,...s.metadata})),r=[];for(let o of Object.values(this._registeredResourceTemplates)){if(!o.resourceTemplate.listCallback)continue;let s=await o.resourceTemplate.listCallback(n);for(let c of s.resources)r.push({...o.metadata,...c})}return{resources:[...i,...r]}}),this.server.setRequestHandler(uw,async()=>({resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([n,i])=>({name:n,uriTemplate:i.resourceTemplate.uriTemplate.toString(),...i.metadata}))})),this.server.setRequestHandler(lw,async(e,n)=>{let i=new URL(e.params.uri),r=this._registeredResources[i.toString()];if(r){if(!r.enabled)throw new K(W.InvalidParams,`Resource ${i} disabled`);return r.readCallback(i,n)}for(let o of Object.values(this._registeredResourceTemplates)){let s=o.resourceTemplate.uriTemplate.match(i.toString());if(s)return o.readCallback(i,s,n)}throw new K(W.InvalidParams,`Resource ${i} not found`)}),this._resourceHandlersInitialized=!0)}setPromptRequestHandlers(){this._promptHandlersInitialized||(this.server.assertCanSetRequestHandler(Po(dw)),this.server.assertCanSetRequestHandler(Po(fw)),this.server.registerCapabilities({prompts:{listChanged:!0}}),this.server.setRequestHandler(dw,()=>({prompts:Object.entries(this._registeredPrompts).filter(([,e])=>e.enabled).map(([e,n])=>({name:e,title:n.title,description:n.description,arguments:n.argsSchema?yfe(n.argsSchema):void 0}))})),this.server.setRequestHandler(fw,async(e,n)=>{let i=this._registeredPrompts[e.params.name];if(!i)throw new K(W.InvalidParams,`Prompt ${e.params.name} not found`);if(!i.enabled)throw new K(W.InvalidParams,`Prompt ${e.params.name} disabled`);if(i.argsSchema){let r=qc(i.argsSchema),o=await Kb(r,e.params.arguments);if(!o.success){let u="error"in o?o.error:"Unknown error",l=Hb(u);throw new K(W.InvalidParams,`Invalid arguments for prompt ${e.params.name}: ${l}`)}let s=o.data,c=i.callback;return await Promise.resolve(c(s,n))}else{let r=i.callback;return await Promise.resolve(r(n))}}),this._promptHandlersInitialized=!0)}resource(e,n,...i){let r;typeof i[0]=="object"&&(r=i.shift());let o=i[0];if(typeof n=="string"){if(this._registeredResources[n])throw new Error(`Resource ${n} is already registered`);let s=this._createRegisteredResource(e,void 0,n,r,o);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),s}else{if(this._registeredResourceTemplates[e])throw new Error(`Resource template ${e} is already registered`);let s=this._createRegisteredResourceTemplate(e,void 0,n,r,o);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),s}}registerResource(e,n,i,r){if(typeof n=="string"){if(this._registeredResources[n])throw new Error(`Resource ${n} is already registered`);let o=this._createRegisteredResource(e,i.title,n,i,r);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),o}else{if(this._registeredResourceTemplates[e])throw new Error(`Resource template ${e} is already registered`);let o=this._createRegisteredResourceTemplate(e,i.title,n,i,r);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),o}}_createRegisteredResource(e,n,i,r,o){let s={name:e,title:n,metadata:r,readCallback:o,enabled:!0,disable:a(()=>s.update({enabled:!1}),"disable"),enable:a(()=>s.update({enabled:!0}),"enable"),remove:a(()=>s.update({uri:null}),"remove"),update:a(c=>{typeof c.uri<"u"&&c.uri!==i&&(delete this._registeredResources[i],c.uri&&(this._registeredResources[c.uri]=s)),typeof c.name<"u"&&(s.name=c.name),typeof c.title<"u"&&(s.title=c.title),typeof c.metadata<"u"&&(s.metadata=c.metadata),typeof c.callback<"u"&&(s.readCallback=c.callback),typeof c.enabled<"u"&&(s.enabled=c.enabled),this.sendResourceListChanged()},"update")};return this._registeredResources[i]=s,s}_createRegisteredResourceTemplate(e,n,i,r,o){let s={resourceTemplate:i,title:n,metadata:r,readCallback:o,enabled:!0,disable:a(()=>s.update({enabled:!1}),"disable"),enable:a(()=>s.update({enabled:!0}),"enable"),remove:a(()=>s.update({name:null}),"remove"),update:a(l=>{typeof l.name<"u"&&l.name!==e&&(delete this._registeredResourceTemplates[e],l.name&&(this._registeredResourceTemplates[l.name]=s)),typeof l.title<"u"&&(s.title=l.title),typeof l.template<"u"&&(s.resourceTemplate=l.template),typeof l.metadata<"u"&&(s.metadata=l.metadata),typeof l.callback<"u"&&(s.readCallback=l.callback),typeof l.enabled<"u"&&(s.enabled=l.enabled),this.sendResourceListChanged()},"update")};this._registeredResourceTemplates[e]=s;let c=i.uriTemplate.variableNames;return Array.isArray(c)&&c.some(l=>!!i.completeCallback(l))&&this.setCompletionRequestHandler(),s}_createRegisteredPrompt(e,n,i,r,o){let s={title:n,description:i,argsSchema:r===void 0?void 0:Ns(r),callback:o,enabled:!0,disable:a(()=>s.update({enabled:!1}),"disable"),enable:a(()=>s.update({enabled:!0}),"enable"),remove:a(()=>s.update({name:null}),"remove"),update:a(c=>{typeof c.name<"u"&&c.name!==e&&(delete this._registeredPrompts[e],c.name&&(this._registeredPrompts[c.name]=s)),typeof c.title<"u"&&(s.title=c.title),typeof c.description<"u"&&(s.description=c.description),typeof c.argsSchema<"u"&&(s.argsSchema=Ns(c.argsSchema)),typeof c.callback<"u"&&(s.callback=c.callback),typeof c.enabled<"u"&&(s.enabled=c.enabled),this.sendPromptListChanged()},"update")};return this._registeredPrompts[e]=s,r&&Object.values(r).some(u=>{let l=u instanceof rs?u._def?.innerType:u;return LC(l)})&&this.setCompletionRequestHandler(),s}_createRegisteredTool(e,n,i,r,o,s,c,u,l){MC(e);let d={title:n,description:i,inputSchema:KZ(r),outputSchema:KZ(o),annotations:s,execution:c,_meta:u,handler:l,enabled:!0,disable:a(()=>d.update({enabled:!1}),"disable"),enable:a(()=>d.update({enabled:!0}),"enable"),remove:a(()=>d.update({name:null}),"remove"),update:a(f=>{typeof f.name<"u"&&f.name!==e&&(typeof f.name=="string"&&MC(f.name),delete this._registeredTools[e],f.name&&(this._registeredTools[f.name]=d)),typeof f.title<"u"&&(d.title=f.title),typeof f.description<"u"&&(d.description=f.description),typeof f.paramsSchema<"u"&&(d.inputSchema=Ns(f.paramsSchema)),typeof f.outputSchema<"u"&&(d.outputSchema=Ns(f.outputSchema)),typeof f.callback<"u"&&(d.handler=f.callback),typeof f.annotations<"u"&&(d.annotations=f.annotations),typeof f._meta<"u"&&(d._meta=f._meta),typeof f.enabled<"u"&&(d.enabled=f.enabled),this.sendToolListChanged()},"update")};return this._registeredTools[e]=d,this.setToolRequestHandlers(),this.sendToolListChanged(),d}tool(e,...n){if(this._registeredTools[e])throw new Error(`Tool ${e} is already registered`);let i,r,o,s;if(typeof n[0]=="string"&&(i=n.shift()),n.length>1){let u=n[0];if(UC(u))r=n.shift(),n.length>1&&typeof n[0]=="object"&&n[0]!==null&&!UC(n[0])&&(s=n.shift());else if(typeof u=="object"&&u!==null){if(Object.values(u).some(l=>typeof l=="object"&&l!==null))throw new Error(`Tool ${e} expected a Zod schema or ToolAnnotations, but received an unrecognized object`);s=n.shift()}}let c=n[0];return this._createRegisteredTool(e,void 0,i,r,o,s,{taskSupport:"forbidden"},void 0,c)}registerTool(e,n,i){if(this._registeredTools[e])throw new Error(`Tool ${e} is already registered`);let{title:r,description:o,inputSchema:s,outputSchema:c,annotations:u,_meta:l}=n;return this._createRegisteredTool(e,r,o,s,c,u,{taskSupport:"forbidden"},l,i)}prompt(e,...n){if(this._registeredPrompts[e])throw new Error(`Prompt ${e} is already registered`);let i;typeof n[0]=="string"&&(i=n.shift());let r;n.length>1&&(r=n.shift());let o=n[0],s=this._createRegisteredPrompt(e,void 0,i,r,o);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),s}registerPrompt(e,n,i){if(this._registeredPrompts[e])throw new Error(`Prompt ${e} is already registered`);let{title:r,description:o,argsSchema:s}=n,c=this._createRegisteredPrompt(e,r,o,s,i);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),c}isConnected(){return this.server.transport!==void 0}async sendLoggingMessage(e,n){return this.server.sendLoggingMessage(e,n)}sendResourceListChanged(){this.isConnected()&&this.server.sendResourceListChanged()}sendToolListChanged(){this.isConnected()&&this.server.sendToolListChanged()}sendPromptListChanged(){this.isConnected()&&this.server.sendPromptListChanged()}};var gfe={type:"object",properties:{}};function WZ(t){return t!==null&&typeof t=="object"&&"parse"in t&&typeof t.parse=="function"&&"safeParse"in t&&typeof t.safeParse=="function"}a(WZ,"isZodTypeLike");function GZ(t){return"_def"in t||"_zod"in t||WZ(t)}a(GZ,"isZodSchemaInstance");function UC(t){return typeof t!="object"||t===null||GZ(t)?!1:Object.keys(t).length===0?!0:Object.values(t).some(WZ)}a(UC,"isZodRawShapeCompat");function KZ(t){if(t){if(UC(t))return Ns(t);if(!GZ(t))throw new Error("inputSchema must be a Zod schema or raw shape, received an unrecognized object");return t}}a(KZ,"getZodSchemaObject");function yfe(t){let e=_o(t);return e?Object.entries(e).map(([n,i])=>{let r=q4(i),o=Z4(i);return{name:n,description:r,required:!o}}):[]}a(yfe,"promptArgumentsFromSchema");function Po(t){let n=_o(t)?.method;if(!n)throw new Error("Schema is missing a method literal");let i=Zc(n);if(typeof i=="string")return i;throw new Error("Schema method literal must be a string")}a(Po,"getMethodValue");function HZ(t){return{completion:{values:t.slice(0,100),total:t.length,hasMore:t.length>100}}}a(HZ,"createCompletionResult");var Xp={completion:{values:[],hasMore:!1}};var FC=ta(require("node:process"),1);var vfe=10*1024*1024,c$=class{static{a(this,"ReadBuffer")}constructor(e){this._maxBufferSize=e?.maxBufferSize??vfe}append(e){if((this._buffer?.length??0)+e.length>this._maxBufferSize)throw this.clear(),new Error(`ReadBuffer exceeded maximum size of ${this._maxBufferSize} bytes`);this._buffer=this._buffer?Buffer.concat([this._buffer,e]):e}readMessage(){if(!this._buffer)return null;let e=this._buffer.indexOf(`
|
|
270
|
+
`);if(e===-1)return null;let n=this._buffer.toString("utf8",0,e).replace(/\r$/,"");return this._buffer=this._buffer.subarray(e+1),bfe(n)}clear(){this._buffer=void 0}};function bfe(t){return fp.parse(JSON.parse(t))}a(bfe,"deserializeMessage");function JZ(t){return JSON.stringify(t)+`
|
|
271
|
+
`}a(JZ,"serializeMessage");var u$=class{static{a(this,"StdioServerTransport")}constructor(e=FC.default.stdin,n=FC.default.stdout,i){this._stdin=e,this._stdout=n,this._started=!1,this._ondata=r=>{try{this._readBuffer.append(r),this.processReadBuffer()}catch(o){this.onerror?.(o),this.close().catch(()=>{})}},this._onerror=r=>{this.onerror?.(r)},this._readBuffer=new c$({maxBufferSize:i?.maxBufferSize})}async start(){if(this._started)throw new Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");this._started=!0,this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror)}processReadBuffer(){for(;;)try{let e=this._readBuffer.readMessage();if(e===null)break;this.onmessage?.(e)}catch(e){this.onerror?.(e)}}async close(){this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),this._stdin.listenerCount("data")===0&&this._stdin.pause(),this._readBuffer.clear(),this.onclose?.()}send(e){return new Promise(n=>{let i=JZ(e);this._stdout.write(i)?n():this._stdout.once("drain",n)})}};var tV=ta(eV(),1);function Tfe(t){if(t)try{return tV.default.parse(t).type}catch{let e=(t.split(";",1)[0]??"").trim().toLowerCase();return e===""||t.slice(e.length).includes(",")?void 0:e}}a(Tfe,"mediaTypeEssence");function nV(t){return t==="application/json"?!0:Tfe(t)==="application/json"}a(nV,"isJsonContentType");function rV(t,e){if(!Number.isFinite(t)||t<1)return;let n=setInterval(e,Math.min(t,2147483647));return n.unref?.(),n}a(rV,"armSseKeepAlive");var l$=class{static{a(this,"WebStandardStreamableHTTPServerTransport")}constructor(e={}){this._started=!1,this._hasHandledRequest=!1,this._streamMapping=new Map,this._requestToStreamMapping=new Map,this._resumableStreams=new Set,this._requestResponseMap=new Map,this._initialized=!1,this._enableJsonResponse=!1,this._standaloneSseStreamId="_GET_stream",this._closed=!1,this.sessionIdGenerator=e.sessionIdGenerator,this._enableJsonResponse=e.enableJsonResponse??!1,this._eventStore=e.eventStore,this._onsessioninitialized=e.onsessioninitialized,this._onsessionclosed=e.onsessionclosed,this._allowedHosts=e.allowedHosts,this._allowedOrigins=e.allowedOrigins,this._enableDnsRebindingProtection=e.enableDnsRebindingProtection??!1,this._retryInterval=e.retryInterval,this._keepAliveMs=e.keepAliveMs??15e3}startKeepAlive(e,n){if(this._closed)return;let i=rV(this._keepAliveMs,()=>{try{e.enqueue(n.encode(`: keepalive
|
|
272
|
+
|
|
273
|
+
`))}catch{i!==void 0&&clearInterval(i)}});return i}async start(){if(this._started)throw new Error("Transport already started");this._started=!0}createJsonErrorResponse(e,n,i,r){let o={code:n,message:i};return r?.data!==void 0&&(o.data=r.data),new Response(JSON.stringify({jsonrpc:"2.0",error:o,id:null}),{status:e,headers:{"Content-Type":"application/json",...r?.headers}})}validateRequestHeaders(e){if(this._enableDnsRebindingProtection){if(this._allowedHosts&&this._allowedHosts.length>0){let n=e.headers.get("host");if(!n||!this._allowedHosts.includes(n)){let i=`Invalid Host header: ${n}`;return this.onerror?.(new Error(i)),this.createJsonErrorResponse(403,-32e3,i)}}if(this._allowedOrigins&&this._allowedOrigins.length>0){let n=e.headers.get("origin");if(n&&!this._allowedOrigins.includes(n)){let i=`Invalid Origin header: ${n}`;return this.onerror?.(new Error(i)),this.createJsonErrorResponse(403,-32e3,i)}}}}async handleRequest(e,n){if(this._closed)return this.createJsonErrorResponse(404,-32001,"Session not found");if(!this.sessionIdGenerator&&this._hasHandledRequest)throw new Error("Stateless transport cannot be reused across requests. Create a new transport per request.");this._hasHandledRequest=!0;let i=this.validateRequestHeaders(e);if(i)return i;switch(e.method){case"POST":return this.handlePostRequest(e,n);case"GET":return this.handleGetRequest(e);case"DELETE":return this.handleDeleteRequest(e);default:return this.handleUnsupportedRequest()}}async writePrimingEvent(e,n,i,r){if(!this._eventStore||r<"2025-11-25")return;let o=await this._eventStore.storeEvent(i,{}),s=`id: ${o}
|
|
274
|
+
data:
|
|
275
|
+
|
|
276
|
+
`;this._retryInterval!==void 0&&(s=`id: ${o}
|
|
277
|
+
retry: ${this._retryInterval}
|
|
278
|
+
data:
|
|
279
|
+
|
|
280
|
+
`),e.enqueue(n.encode(s)),this._resumableStreams.add(i)}async handleGetRequest(e){if(!e.headers.get("accept")?.includes("text/event-stream"))return this.onerror?.(new Error("Not Acceptable: Client must accept text/event-stream")),this.createJsonErrorResponse(406,-32e3,"Not Acceptable: Client must accept text/event-stream");let i=this.validateSession(e);if(i)return i;let r=this.validateProtocolVersion(e);if(r)return r;if(this._eventStore){let d=e.headers.get("last-event-id");if(d)return this.replayEvents(d)}if(this._streamMapping.get(this._standaloneSseStreamId)!==void 0)return this.onerror?.(new Error("Conflict: Only one SSE stream is allowed per session")),this.createJsonErrorResponse(409,-32e3,"Conflict: Only one SSE stream is allowed per session");let o=new TextEncoder,s,c,u=new ReadableStream({start:a(d=>{s=d},"start"),cancel:a(()=>{c!==void 0&&clearInterval(c),this._streamMapping.get(this._standaloneSseStreamId)?.controller===s&&this._streamMapping.delete(this._standaloneSseStreamId)},"cancel")}),l={"Content-Type":"text/event-stream","Cache-Control":"no-cache, no-transform",Connection:"keep-alive","X-Accel-Buffering":"no"};return this.sessionId!==void 0&&(l["mcp-session-id"]=this.sessionId),this._streamMapping.set(this._standaloneSseStreamId,{controller:s,encoder:o,cleanup:a(()=>{c!==void 0&&clearInterval(c),this._streamMapping.delete(this._standaloneSseStreamId);try{s.close()}catch{}},"cleanup")}),c=this.startKeepAlive(s,o),new Response(u,{headers:l})}async replayEvents(e){if(!this._eventStore)return this.onerror?.(new Error("Event store not configured")),this.createJsonErrorResponse(400,-32e3,"Event store not configured");try{let n;if(this._eventStore.getStreamIdForEventId){if(n=await this._eventStore.getStreamIdForEventId(e),!n)return this.onerror?.(new Error("Invalid event ID format")),this.createJsonErrorResponse(400,-32e3,"Invalid event ID format");if(this._streamMapping.get(n)!==void 0)return this.onerror?.(new Error("Conflict: Stream already has an active connection")),this.createJsonErrorResponse(409,-32e3,"Conflict: Stream already has an active connection")}let i={"Content-Type":"text/event-stream","Cache-Control":"no-cache, no-transform",Connection:"keep-alive","X-Accel-Buffering":"no"};this.sessionId!==void 0&&(i["mcp-session-id"]=this.sessionId);let r=new TextEncoder,o,s,c,u=!1,l=new ReadableStream({start:a(f=>{o=f},"start"),cancel:a(()=>{u=!0,s!==void 0&&clearInterval(s),c!==void 0&&this._streamMapping.get(c)?.controller===o&&this._streamMapping.delete(c)},"cancel")}),d=new Set;if(c=await this._eventStore.replayEventsAfter(e,{send:a(async(f,p)=>{if(this.writeSSEEvent(o,r,p,f))d.add(f);else{this.onerror?.(new Error("Failed replay events"));try{o.close()}catch{}}},"send")}),this._closed||u){try{o.close()}catch{}return this.createJsonErrorResponse(404,-32001,"Session not found")}return this._streamMapping.get(c)?.cleanup(),this._streamMapping.set(c,{controller:o,encoder:r,replayedEventIds:d,cleanup:a(()=>{s!==void 0&&clearInterval(s),this._streamMapping.delete(c);try{o.close()}catch{}},"cleanup")}),this._resumableStreams.add(c),s=this.startKeepAlive(o,r),new Response(l,{headers:i})}catch(n){return this.onerror?.(n),this.createJsonErrorResponse(500,-32e3,"Error replaying events")}}writeSSEEvent(e,n,i,r){try{let o=`event: message
|
|
281
|
+
`;return r&&(o+=`id: ${r}
|
|
282
|
+
`),o+=`data: ${JSON.stringify(i)}
|
|
283
|
+
|
|
284
|
+
`,e.enqueue(n.encode(o)),!0}catch(o){return this.onerror?.(o),!1}}handleUnsupportedRequest(){return this.onerror?.(new Error("Method not allowed.")),new Response(JSON.stringify({jsonrpc:"2.0",error:{code:-32e3,message:"Method not allowed."},id:null}),{status:405,headers:{Allow:"GET, POST, DELETE","Content-Type":"application/json"}})}async handlePostRequest(e,n){try{let i=e.headers.get("accept");if(!i?.includes("application/json")||!i.includes("text/event-stream"))return this.onerror?.(new Error("Not Acceptable: Client must accept both application/json and text/event-stream")),this.createJsonErrorResponse(406,-32e3,"Not Acceptable: Client must accept both application/json and text/event-stream");let r=e.headers.get("content-type");if(!nV(r))return this.onerror?.(new Error("Unsupported Media Type: Content-Type must be application/json")),this.createJsonErrorResponse(415,-32e3,"Unsupported Media Type: Content-Type must be application/json");let o={headers:Object.fromEntries(e.headers.entries()),url:new URL(e.url)},s;if(n?.parsedBody!==void 0)s=n.parsedBody;else try{s=await e.json()}catch{return this.onerror?.(new Error("Parse error: Invalid JSON")),this.createJsonErrorResponse(400,-32700,"Parse error: Invalid JSON")}let c;try{Array.isArray(s)?c=s.map(b=>fp.parse(b)):c=[fp.parse(s)]}catch{return this.onerror?.(new Error("Parse error: Invalid JSON-RPC message")),this.createJsonErrorResponse(400,-32700,"Parse error: Invalid JSON-RPC message")}if(this._closed)return this.createJsonErrorResponse(404,-32001,"Session not found");let u=c.some($O);if(u){if(this._initialized&&this.sessionId!==void 0)return this.onerror?.(new Error("Invalid Request: Server already initialized")),this.createJsonErrorResponse(400,-32600,"Invalid Request: Server already initialized");if(c.length>1)return this.onerror?.(new Error("Invalid Request: Only one initialization request is allowed")),this.createJsonErrorResponse(400,-32600,"Invalid Request: Only one initialization request is allowed");this.sessionId=this.sessionIdGenerator?.(),this._initialized=!0,this.sessionId&&this._onsessioninitialized&&await Promise.resolve(this._onsessioninitialized(this.sessionId))}if(!u){let b=this.validateSession(e);if(b)return b;let $=this.validateProtocolVersion(e);if($)return $}if(this._closed)return this.createJsonErrorResponse(404,-32001,"Session not found");if(!c.some(fi)){for(let b of c)this.onmessage?.(b,{authInfo:n?.authInfo,requestInfo:o});return new Response(null,{status:202})}let d=crypto.randomUUID(),f=c.find(b=>$O(b)),p=f?f.params.protocolVersion:e.headers.get("mcp-protocol-version")??V4;if(this._enableJsonResponse)return new Promise(b=>{this._streamMapping.set(d,{resolveJson:b,cleanup:a(()=>{this._streamMapping.delete(d)},"cleanup")});for(let $ of c)fi($)&&this._requestToStreamMapping.set($.id,d);for(let $ of c)this.onmessage?.($,{authInfo:n?.authInfo,requestInfo:o})});let m=new TextEncoder,g,y,v=new ReadableStream({start:a(b=>{g=b},"start"),cancel:a(()=>{y!==void 0&&clearInterval(y),this._streamMapping.get(d)?.controller===g&&this._streamMapping.delete(d)},"cancel")}),w={"Content-Type":"text/event-stream","Cache-Control":"no-cache, no-transform",Connection:"keep-alive","X-Accel-Buffering":"no"};this.sessionId!==void 0&&(w["mcp-session-id"]=this.sessionId);for(let b of c)fi(b)&&(this._streamMapping.set(d,{controller:g,encoder:m,cleanup:a(()=>{y!==void 0&&clearInterval(y),this._streamMapping.delete(d);try{g.close()}catch{}},"cleanup")}),this._requestToStreamMapping.set(b.id,d));try{await this.writePrimingEvent(g,m,d,p);for(let b of c){let $,x;fi(b)&&this._eventStore&&p>="2025-11-25"&&($=a(()=>{this.closeSSEStream(b.id)},"closeSSEStream"),x=a(()=>{this.closeStandaloneSSEStream()},"closeStandaloneSSEStream")),this.onmessage?.(b,{authInfo:n?.authInfo,requestInfo:o,closeSSEStream:$,closeStandaloneSSEStream:x})}}catch(b){this._streamMapping.get(d)?.cleanup(),this._resumableStreams.delete(d);for(let $ of c)fi($)&&this._requestToStreamMapping.delete($.id);throw b}return this._streamMapping.get(d)?.controller===g&&(y=this.startKeepAlive(g,m)),new Response(v,{status:200,headers:w})}catch(i){return this.onerror?.(i),this.createJsonErrorResponse(400,-32700,"Parse error",{data:String(i)})}}async handleDeleteRequest(e){let n=this.validateSession(e);if(n)return n;let i=this.validateProtocolVersion(e);if(i)return i;try{return await Promise.resolve(this._onsessionclosed?.(this.sessionId)),new Response(null,{status:200})}finally{await this.close()}}validateSession(e){if(this.sessionIdGenerator===void 0)return;if(!this._initialized)return this.onerror?.(new Error("Bad Request: Server not initialized")),this.createJsonErrorResponse(400,-32e3,"Bad Request: Server not initialized");let n=e.headers.get("mcp-session-id");if(!n)return this.onerror?.(new Error("Bad Request: Mcp-Session-Id header is required")),this.createJsonErrorResponse(400,-32e3,"Bad Request: Mcp-Session-Id header is required");if(n!==this.sessionId)return this.onerror?.(new Error("Session not found")),this.createJsonErrorResponse(404,-32001,"Session not found")}validateProtocolVersion(e){let n=e.headers.get("mcp-protocol-version");if(n!==null&&!Bc.includes(n))return this.onerror?.(new Error(`Bad Request: Unsupported protocol version: ${n} (supported versions: ${Bc.join(", ")})`)),this.createJsonErrorResponse(400,-32e3,`Bad Request: Unsupported protocol version: ${n} (supported versions: ${Bc.join(", ")})`)}async close(){this._closed||(this._closed=!0,this._streamMapping.forEach(({cleanup:e})=>{e()}),this._streamMapping.clear(),this._requestResponseMap.clear(),this._resumableStreams.clear(),this.onclose?.())}closeSSEStream(e){let n=this._requestToStreamMapping.get(e);if(!n)return;let i=this._streamMapping.get(n);i&&i.cleanup()}closeStandaloneSSEStream(){let e=this._streamMapping.get(this._standaloneSseStreamId);e&&e.cleanup()}async send(e,n){let i=n?.relatedRequestId;if((pi(e)||Kc(e))&&(i=e.id),i===void 0){if(pi(e)||Kc(e))throw new Error("Cannot send a response on a standalone SSE stream unless resuming a previous client request");let s;this._eventStore&&(s=await this._eventStore.storeEvent(this._standaloneSseStreamId,e));let c=this._streamMapping.get(this._standaloneSseStreamId);if(c===void 0)return;c.controller&&c.encoder&&(s===void 0||!c.replayedEventIds?.has(s))&&this.writeSSEEvent(c.controller,c.encoder,e,s);return}let r=this._requestToStreamMapping.get(i);if(!r)throw new Error(`No connection established for request ID: ${String(i)}`);let o=this._streamMapping.get(r);if(!this._enableJsonResponse){let s;this._eventStore&&(s=await this._eventStore.storeEvent(r,e),o=this._streamMapping.get(r)),o?.controller&&o?.encoder&&(s===void 0||!o.replayedEventIds?.has(s))&&this.writeSSEEvent(o.controller,o.encoder,e,s)&&s!==void 0&&this._resumableStreams.add(r)}if(pi(e)||Kc(e)){this._requestResponseMap.set(i,e);let s=Array.from(this._requestToStreamMapping.entries()).filter(([u,l])=>l===r).map(([u])=>u);if(s.every(u=>this._requestResponseMap.has(u))){if(!o){if(this._closed){for(let u of s)this._requestResponseMap.delete(u),this._requestToStreamMapping.delete(u);return}if(!this._enableJsonResponse&&this._eventStore&&this._resumableStreams.has(r)){for(let u of s)this._requestResponseMap.delete(u),this._requestToStreamMapping.delete(u);this._resumableStreams.delete(r);return}for(let u of s)this._requestResponseMap.delete(u),this._requestToStreamMapping.delete(u);throw new Error(`No connection established for request ID: ${String(i)}`)}if(this._enableJsonResponse&&o.resolveJson){let u={"Content-Type":"application/json"};this.sessionId!==void 0&&(u["mcp-session-id"]=this.sessionId);let l=s.map(d=>this._requestResponseMap.get(d));l.length===1?o.resolveJson(new Response(JSON.stringify(l[0]),{status:200,headers:u})):o.resolveJson(new Response(JSON.stringify(l),{status:200,headers:u}))}else o.cleanup();for(let u of s)this._requestResponseMap.delete(u),this._requestToStreamMapping.delete(u);this._resumableStreams.delete(r)}}}};var AB=require("node:crypto");var uV=require("node:readline");var oV=require("node:crypto");var Ofe="/api/tawareen",iV=1e4,Nfe=/^\s*at\s+(?:(.+?)\s+\()?(.+?)(?::(\d+))?(?::(\d+))?\)?\s*$/;function sV(t){if(t===void 0)return[];let e=[];for(let n of t.split(`
|
|
285
|
+
`)){let i=Nfe.exec(n);if(i===null)continue;let[,r,o,s,c]=i;o!==void 0&&e.push({filename:o,function:r??"<anonymous>",...s===void 0?{}:{lineno:Number(s)},...c===void 0?{}:{colno:Number(c)},in_app:o.startsWith("app:///")})}return e.reverse()}a(sV,"framesOf");function aV(){return(0,oV.randomBytes)(16).toString("hex")}a(aV,"newEventId");function Cfe(t,e){let n=e.eventId??aV(),[i,r]=t.os.split(" "),o={event_id:n,timestamp:t.at,platform:"node",level:"error",release:`tacticyl@${t.version}`,environment:e.environment,tags:{runtime:"companion",command:t.command,where:t.where},contexts:{os:{name:i,version:r},runtime:{name:"node",version:t.node}},exception:{values:[{type:t.name,value:t.message,stacktrace:{frames:sV(t.stack)}}]}};return[JSON.stringify({dsn:e.dsn,sent_at:new Date().toISOString(),event_id:n}),JSON.stringify({type:"event"}),JSON.stringify(o)].join(`
|
|
286
|
+
`)}a(Cfe,"envelopeFor");async function ZC(t,e){let n=e.fetch??((o,s)=>fetch(o,s)),i=`${e.service}${Ofe}`,r=mn();try{let o=await n(i,{headers:r,signal:AbortSignal.timeout(iV)});if(o.status===404)return{outcome:"off"};if(!o.ok)return{outcome:"unreachable"};let s=await o.json();if(s.sentry===null)return{outcome:"off"};let c=aV();return(await n(i,{method:"POST",headers:{...r,"content-type":"application/x-sentry-envelope"},body:Cfe(t,{...s.sentry,eventId:c}),signal:AbortSignal.timeout(iV)})).ok?{outcome:"sent",id:c}:{outcome:"unreachable"}}catch{return{outcome:"unreachable"}}}a(ZC,"sendReport");function cV(t){let e=[` when ${t.at}`,` command tacticyl ${t.command}${t.where===t.command?"":` (${t.where})`}`,` error ${t.name}: ${t.message}`,` version tacticyl ${t.version} \xB7 node ${t.node} \xB7 ${t.os}`],n=sV(t.stack).reverse();if(n.length>0){e.push(" where");for(let i of n){let r=i.lineno===void 0?"":`:${String(i.lineno)}${i.colno===void 0?"":`:${String(i.colno)}`}`;e.push(` ${i.function} (${i.filename}${r})`)}}return e}a(cV,"previewOf");async function lV(t){let[e,...n]=QD(t);if(e===void 0)return{kind:"nothing"};if(!await t.confirm(e,n.length))return{kind:"shown",record:e,older:n.length,sent:"declined"};let i=await ZC(e,{service:t.service,...t.fetch===void 0?{}:{fetch:t.fetch}});return{kind:"shown",record:e,older:n.length,sent:i}}a(lV,"report");function dV(t,e){let n=["This report will be sent to your Tacticyl cloud workspace if you confirm:",...cV(t)," Your home directory and the repository path have been replaced. File contents and environment variables are not included."];return e>0&&n.push(` ${String(e)} older error${e===1?"":"s"} ${e===1?"is":"are"} kept on this machine. Only the error shown above will be sent.`),n}a(dV,"renderPreview");var fV="Send this report to your workspace? [y/N] ";function pV(t){if(t==="declined")return"No report was sent.";switch(t.outcome){case"sent":return`This report was sent to your workspace. You can quote the reference id ${t.id} to support.`;case"off":return"Your Tacticyl cloud workspace is not set up to receive error reports. No report was sent.";case"unreachable":return"Your Tacticyl cloud workspace could not be reached. No report was sent."}}a(pV,"renderOutcome");var mV="There is no recent error on this machine to report.";function hV(t={}){let{until:e,already:n}=eL(t);return n?[`Error reports are already on until ${bv(e)}.`]:[`Error reports are on until ${bv(e)}. Any error the companion meets, including from background runs, will be sent to your Tacticyl cloud workspace as it happens.`,"Run `tacticyl report off` to turn them off sooner."]}a(hV,"reportOn");function gV(t={}){return[tL(t)?"Error reports are off.":"Error reports were not on."]}a(gV,"reportOff");function yV(t={}){let e=ff(t);return e===null?{on:!1,value:"off"}:{on:!0,until:e.toISOString(),value:`on until ${bv(e)}`}}a(yV,"reportingLine");function vV(t){return process.stdin.isTTY!==!0?Promise.resolve(!1):new Promise(e=>{let n=(0,uV.createInterface)({input:process.stdin,output:process.stderr});n.question(t,i=>{n.close(),e(/^y(es)?$/i.test(i.trim()))})})}a(vV,"askOnTerminal");async function d$(t,e,n={}){let i=vv(t,e,n);if(i===void 0||n.service===void 0||ff(n)===null)return;let r=await ZC(i,{service:n.service,...n.fetch===void 0?{}:{fetch:n.fetch}});return r.outcome==="sent"?`This error was reported to your Tacticyl cloud workspace. Reference id: ${r.id}.`:void 0}a(d$,"afterFailure");function ne(t,e){let n=h.object(t.args);return{name:t.name,title:t.title,description:BI(t),inputSchema:t.args,readOnly:t.readOnly,model:t.model,run:a((i,r)=>e(i,n.parse(r??{})),"run")}}a(ne,"defineTool");var bV=ne(jy,async(t,e)=>{let n=await t.client.venture(t.businessId);return oE(n.graph,{snapshot:uv(n.venture),...e.since===void 0?{}:{since:e.since}})});var wV=ne(zy,async t=>{let e=await t.client.venture(t.businessId);return rf(e.graph)});var $V=ne(Dy,async(t,e)=>{let n=await t.client.venture(t.businessId);try{let i=await t.client.node(t.businessId,e.ref);return lE(n.graph,i)}catch(i){if(i instanceof dt&&(i.code==="ref-not-found"||i.code==="malformed-ref"))return`${i.message}
|
|
287
|
+
|
|
288
|
+
Call overview for the reference grammar and the ids this venture uses, or query to search by facet, kind, status or tag.
|
|
289
|
+
`;throw i}});var _V=ne(Ly,async(t,e)=>{let n=await t.client.venture(t.businessId);return fE(n.graph,e)});var kV=ne(My,async(t,e)=>{let n=e.transitive===!0;try{let i=await t.client.consumers(t.businessId,e.ref,n);return dE(e.ref,i.consumers,{transitive:n})}catch(i){if(i instanceof dt&&i.status===400)return`${i.message}
|
|
290
|
+
|
|
291
|
+
Call overview for the reference grammar.
|
|
292
|
+
`;throw i}});var xV=ne(Uy,async(t,e)=>{let n=await t.client.venture(t.businessId);return mE(n.graph,e.mode,e.ref)});var SV=ne(Fy,async(t,e)=>{let n=await t.client.venture(t.businessId);return hE(n.graph,{...e.ref===void 0?{}:{ref:e.ref},...e.tags===void 0?{}:{tags:e.tags}})});var Ro=require("node:fs"),Qp=require("node:path");var VC=(0,Qp.join)(".tacticyl","nudged.local.json"),Pfe=360*60*1e3,Rfe=50;function IV(t){return(0,Qp.join)(t,VC)}a(IV,"pathIn");function EV(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}a(EV,"isRecord");function jfe(t){if(!EV(t))return;let{locator:e,path:n,harness:i,at:r}=t;if(!(typeof e!="string"||e.length===0))return{locator:e,path:typeof n=="string"?n:e,harness:typeof i=="string"?i:"unknown",at:typeof r=="string"?r:new Date(0).toISOString()}}a(jfe,"one");function TV(t,e=Date.now()){let n=IV(t);if(!(0,Ro.existsSync)(n))return[];try{let i=JSON.parse((0,Ro.readFileSync)(n,"utf8"));return(EV(i)&&Array.isArray(i.nudges)?i.nudges:[]).map(jfe).filter(o=>o!==void 0).filter(o=>e-Date.parse(o.at)<Pfe)}catch{return[]}}a(TV,"nudges");function AV(t,e){let n=IV(t);try{(0,Ro.mkdirSync)((0,Qp.dirname)(n),{recursive:!0}),(0,Ro.writeFileSync)(n,`${JSON.stringify({nudges:e},null,2)}
|
|
293
|
+
`,"utf8")}catch{}}a(AV,"write");function OV(t,e,n=Date.now()){let i=TV(t,n).filter(r=>r.locator!==e.locator);AV(t,[...i,e].slice(-Rfe))}a(OV,"noteNudge");function NV(t,e,n=Date.now()){let i=TV(t,n),r=e.trim(),o=i.find(s=>s.locator===r||s.path===r.replace(/^\.\//,""));if(o!==void 0)return AV(t,i.filter(s=>s!==o)),o}a(NV,"takeNudge");function CV(t,e){let n=t.trim().replace(/^\.\//,"");return Bi(n)?n:`repo:${e}/${n.replace(/^\/+/,"")}`}a(CV,"asLocator");var PV=ne(qy,async(t,e)=>{let n=CV(e.path,t.rootId),i=`agent:${t.harness}`;t.repo!==void 0&&NV(t.repo,n)!==void 0&&t.mark?.("hook");let r={summary:e.summary??`register ${n}`,operations:[{op:"add-node",parent:"docs",element:"doc",attributes:{home:n,about:e.about.join(" "),...e.tags===void 0||e.tags.length===0?{}:{tags:e.tags.join(" ")},by:i,at:new Date().toISOString().slice(0,10)}}]},o=await t.client.propose(t.businessId,r,{kind:"agent",name:t.harness});return st(o.change,o.findings,o.diagnostics)});function zfe(t,e){let n=`Operation ${String(e)} (${t.op})`;if(t.op==="add-node")return t.parent===void 0?`${n} needs a parent.`:t.element===void 0?`${n} needs an element (the XML tag).`:void 0;if(t.ref===void 0)return`${n} needs a ref naming the node.`;if(t.op==="set-attr"&&t.name===void 0)return`${n} needs the attribute name.`;if(t.op==="move-node"&&t.parent===void 0)return`${n} needs the parent to move it under.`}a(zfe,"whatIsMissing");var RV=ne(Zy,async(t,e)=>{for(let[r,o]of e.operations.entries()){let s=zfe(o,r);if(s!==void 0)return`${s}
|
|
294
|
+
`}let n={operations:e.operations,summary:e.summary},i=await t.client.propose(t.businessId,n,{kind:"agent",name:t.harness});return st(i.change,i.findings,i.diagnostics)});var jV=ne(Vy,async t=>{let e=await t.client.validate(t.businessId);return gE(e.diagnostics,e.valid,`The venture ${t.businessId}`)});var bi=require("node:fs"),Gr=require("node:path");var XC=require("node:crypto"),Qe=require("node:fs"),qt=require("node:path"),QC=require("node:os"),GV=ta(HV(),1);var yu=".tacticyl-root",JV=".tacticyl-ignore",dpe=12,fpe=200;function b$(t){let e=(0,qt.join)(t,yu);if(!(0,Qe.existsSync)(e))return;let n;try{n=(0,Qe.readFileSync)(e,"utf8")}catch{return}let i,r=[];for(let o of n.split(/\r?\n/)){let s=o.trim();if(s.length===0||s.startsWith("#"))continue;let c=s.indexOf(":"),u=c===-1?"":s.slice(0,c).trim().toLowerCase(),l=c===-1?s:s.slice(c+1).trim();if(u==="watch"){l.length>0&&r.push(Wr(l));continue}(u==="root"||u==="")&&(i??=l)}return i===void 0||i.length===0?void 0:{rootId:i,watch:r}}a(b$,"readRootMarker");function YV(t,e){let n=(0,qt.join)(t,yu),i=b$(t),r=[...new Set([...i?.watch??[],...e.watch])].sort(),o=["# tacticyl store root. This folder is part of a venture.","# It records which root the folder is, so a scan knows what it is looking at","# wherever the folder happens to be mounted. Safe to commit; safe to sync.",`root: ${e.rootId}`,...r.map(s=>`watch: ${s}`),""].join(`
|
|
295
|
+
`);return i!==void 0&&(0,Qe.existsSync)(n)&&(0,Qe.readFileSync)(n,"utf8")===o?{path:n,wrote:!1}:((0,Qe.writeFileSync)(n,o,"utf8"),{path:n,wrote:!0})}a(YV,"writeRootMarker");function Wr(t){return t.replaceAll("\\","/").replace(/^\/+/,"").replace(/\/+$/,"")}a(Wr,"normalizeRelative");function WV(t,e){let n=(0,qt.resolve)(t),i=(0,qt.resolve)(n,Wr(e));if(!(i!==n&&!i.startsWith(n.endsWith(qt.sep)?n:n+qt.sep)))return i}a(WV,"insideRoot");async function ppe(t){let e=(0,XC.createHash)("sha256");return await new Promise((n,i)=>{let r=(0,Qe.createReadStream)(t);r.on("data",o=>e.update(o)),r.on("error",i),r.on("end",()=>{n()})}),e.digest("hex")}a(ppe,"hashFile");async function YC(t){let e=(0,Qe.statSync)(t).size;return{sha256:await ppe(t),size:e}}a(YC,"hashOneFile");function v$(t,e,n,i=0){if(i>dpe)return[];let r;try{r=(0,Qe.readdirSync)(e).sort()}catch{return[]}let o=[];for(let s of r){if(s===yu||s===JV)continue;let c=(0,qt.join)(e,s),u=Wr((0,qt.relative)(t,c)),l;try{l=(0,Qe.statSync)(c)}catch{continue}if(l.isDirectory()){if(n(`${u}/`))continue;o.push(...v$(t,c,n,i+1));continue}!l.isFile()||n(u)||o.push(c)}return o}a(v$,"walk");async function mpe(t,e){let n=v$(t,t,e),i=[],r=0;for(let s of n){let c=await YC(s);r+=c.size,i.push(`${Wr((0,qt.relative)(t,s))} ${c.sha256} ${String(c.size)}`)}return{sha256:(0,XC.createHash)("sha256").update(i.join(`
|
|
296
|
+
`)).digest("hex"),size:r,files:n.length}}a(mpe,"hashDirectory");function hpe(t){let e=(0,qt.join)(t,JV);if(!(0,Qe.existsSync)(e))return{matches:a(()=>!1,"matches"),count:0};let n;try{n=(0,Qe.readFileSync)(e,"utf8")}catch{return{matches:a(()=>!1,"matches"),count:0}}let i=n.split(/\r?\n/).map(o=>o.trim()).filter(o=>o.length>0&&!o.startsWith("#"));if(i.length===0)return{matches:a(()=>!1,"matches"),count:0};let r=(0,GV.default)().add(i);return{matches:a(o=>{let s=o.replaceAll("\\","/").replace(/^\/+/,"");return s.length>0&&s!=="/"&&r.ignores(s)},"matches"),count:i.length}}a(hpe,"ignoreRules");async function XV(t){let e=Date.now(),n=t.machine??(0,QC.hostname)(),i=t.at??new Date().toISOString(),r=(0,qt.resolve)(t.path),o={rootId:t.rootId,path:r,marker:!1,watched:[],ignored:0,artifacts:[],unknown:[],ms:0};if(!(0,Qe.existsSync)(r)||!(0,Qe.statSync)(r).isDirectory())return{...o,problem:`${r} is not a folder on this machine. Mount the root, then \`tacticyl link --store ${t.rootId} <path>\`.`};let s=b$(r);if(s===void 0)return{...o,problem:`${r} has no ${yu}, so nothing there was read. \`tacticyl link --store ${t.rootId} ${r}\` writes one.`};if(s.rootId!==t.rootId)return{...o,problem:`${r} says it is the root "${s.rootId}", not "${t.rootId}". Nothing there was read.`};let c=hpe(r),u=[],l=new Set;for(let p of t.artifacts){let m=Wr(p.path),g=p.path.endsWith("/")?"directory":"file",y=WV(r,m),v={id:p.id,home:p.home,path:m,kind:g};if(y===void 0){u.push({...v,present:!1,error:`"${p.home}" points outside the root and was not read.`});continue}if(l.add(y),!(0,Qe.existsSync)(y)){u.push({...v,present:!1});continue}try{if((0,Qe.statSync)(y).isDirectory()){let $=await mpe(y,c.matches);for(let x of v$(y,y,c.matches))l.add(x);u.push($.files===0?{...v,present:!1,files:0}:{...v,present:!0,files:$.files,version:{sha256:$.sha256,size:$.size,seen:i,on:n}});continue}let b=await YC(y);u.push({...v,present:!0,version:{sha256:b.sha256,size:b.size,seen:i,on:n}})}catch(w){u.push({...v,present:!1,error:w instanceof Error?w.message:String(w)})}}let d=[],f=[];for(let p of[...new Set([...t.watch??[],...s.watch])].sort()){let m=WV(r,p);if(!(m===void 0||!(0,Qe.existsSync)(m))){d.push(Wr(p));for(let g of v$(r,m,c.matches)){if(l.has(g)||f.length>=fpe)continue;let y=Wr((0,qt.relative)(r,g));try{let v=await YC(g);f.push({home:`store:${t.rootId}/${y}`,path:y,sha256:v.sha256,size:v.size,seen:i})}catch{}}}}return{rootId:t.rootId,path:r,marker:!0,watched:d,ignored:c.count,artifacts:u,unknown:f,ms:Date.now()-e}}a(XV,"scanRoot");function QV(){return process.env.TACTICYL_MACHINE??(0,QC.hostname)()}a(QV,"machineName");function eP(t){return(t.roots?.roots??[]).filter(e=>e.kind==="store")}a(eP,"storeRoots");function gpe(t,e){let n=[];for(let i of t)for(let r of i.home??[])r.kind!=="store"||r.root!==e||n.push({id:i.id,home:An(r),path:r.path??""});return n}a(gpe,"targetsForRoot");async function tP(t,e,n={}){let i=(0,Gr.resolve)(n.dir??process.cwd()),r=await t.venture(e,{fresh:!0}),o=r.venture.inventory?.artifacts??[],s=ai(i),c=n.at??new Date().toISOString(),u=n.machine??QV(),l=eP(r.venture).filter(g=>n.rootId===void 0||g.id===n.rootId),d=[],f=[];for(let g of l){let y=s[g.id];if(y===void 0){f.push(g.id);continue}d.push(await XV({rootId:g.id,path:(0,Gr.isAbsolute)(y)?y:(0,Gr.resolve)(i,y),artifacts:gpe(o,g.id),...n.watch===void 0?{}:{watch:n.watch.map(Wr)},machine:u,at:c}))}let p={machine:u,at:c,adopt:n.adopt===!0,roots:d};if(d.length===0)return{report:p,unmounted:f};let m=await t.scanInventory(e,p,n.agent);return{report:p,answer:m,unmounted:f}}a(tP,"scanVenture");function nP(t,e={}){return tP(t.client,t.businessId,{dir:t.repo,...e})}a(nP,"scan");async function eB(t,e){try{let n=await nP(t);if(n.report.roots.length===0){n.unmounted.length>0&&e(`tacticyl scan: no store root is mounted here (${n.unmounted.join(", ")}). \`tacticyl link --store <id> <path>\` mounts one.`);return}e(`tacticyl scan: ${w$(n)}`)}catch(n){e(`tacticyl scan: ${n instanceof Error?n.message:String(n)}`)}}a(eB,"scanAtSessionStart");async function tB(t,e,n,i={}){let r=(0,Gr.resolve)(i.dir??t.repo),o=(0,Gr.resolve)(n),s=[];if(!(0,bi.existsSync)(o))throw new Error(`${o} is not a folder on this machine, so there is nothing to mount there.`);try{let d=await t.client.venture(t.businessId,{fresh:!0});if(eP(d.venture).find(p=>p.id===e)===void 0){let p=eP(d.venture).map(m=>m.id);s.push(`The business "${t.businessId}" declares no store root "${e}"${p.length===0?"":` (it has ${p.join(", ")})`}. The path is recorded; a scan will not read it until the business declares the root.`)}}catch(d){s.push(`${t.service} did not answer (${d instanceof Error?d.message:String(d)}), so the root id was not checked. The path is recorded anyway.`)}let c=b$(o);if(c!==void 0&&c.rootId!==e)throw new Error(`${o} already says it is the root "${c.rootId}". Mount it as that, or edit its .tacticyl-root first.`);let u=YV(o,{rootId:e,watch:(i.watch??[]).map(Wr)}),l=(0,Gr.join)(r,Xf);return ype(l,e,o),{rootId:e,path:o,localRootsPath:l,markerPath:u.path,wroteMarker:u.wrote,warnings:s}}a(tB,"linkStore");function ype(t,e,n){let i={};if((0,bi.existsSync)(t))try{let o=JSON.parse((0,bi.readFileSync)(t,"utf8"));if(typeof o=="object"&&o!==null)for(let[s,c]of Object.entries(o))typeof c=="string"&&c.length>0&&(i[s]=c)}catch{i={}}i[e]=n;let r=Object.fromEntries(Object.keys(i).sort().map(o=>[o,i[o]]));(0,bi.mkdirSync)((0,Gr.resolve)(t,".."),{recursive:!0}),(0,bi.writeFileSync)(t,`${JSON.stringify(r,null,2)}
|
|
297
|
+
`,"utf8")}a(ype,"writeLocalRoot");function w$(t){let e=t.report.roots.flatMap(s=>s.artifacts),n=e.filter(s=>s.present).length,i=e.length-n,r=[`${String(t.report.roots.length)} root${t.report.roots.length===1?"":"s"}`,`${String(n)} of ${String(e.length)} artifact${e.length===1?"":"s"} verified`];i>0&&r.push(`${String(i)} missing`);let o=t.answer;return o!==void 0&&(o.versions>0&&r.push(`${String(o.versions)} new version${o.versions===1?"":"s"}`),o.findings.length>0&&r.push(`${String(o.findings.length)} finding${o.findings.length===1?"":"s"}`)),r.join(" \xB7 ")}a(w$,"describeScan");function nB(t){let e=[w$(t)];for(let i of t.report.roots){if(e.push(` ${i.rootId} ${i.path}`),i.problem!==void 0){e.push(` ! ${i.problem}`);continue}for(let r of i.artifacts){let o=r.version;e.push(o===void 0?` missing ${r.id} (${r.path})${r.error===void 0?"":` \xB7 ${r.error}`}`:` verified ${r.id} ${o.sha256.slice(0,12)} ${String(o.size)} bytes`)}if(i.unknown.length>0){e.push(` \xB7 ${String(i.unknown.length)} file${i.unknown.length===1?"":"s"} in watched folders match no artifact${t.report.adopt?", proposed for adoption":"; `tacticyl scan --adopt` proposes them"}`);for(let r of i.unknown.slice(0,10))e.push(` ${r.path}`)}}for(let i of t.unmounted)e.push(` ! ${i} is not mounted on this machine. \`tacticyl link --store ${i} <path>\``);let n=t.answer;if(n!==void 0){for(let i of n.changes)e.push(` ${i.state.padEnd(9)} ${i.id} ${i.summary}`);for(let i of n.findings)e.push(` finding ${i.id} ${i.text??""}`)}return e.join(`
|
|
298
|
+
`)}a(nB,"renderScan");var rB=ne(By,async(t,e)=>{let n=Xe()?.repo??process.cwd(),i=await tP(t.client,t.businessId,{dir:n,...e.root===void 0?{}:{rootId:e.root},...e.adopt===void 0?{}:{adopt:e.adopt},agent:t.harness}),r=[w$(i)];for(let s of i.report.roots){if(r.push("",`${s.rootId} \xB7 ${s.path}`),s.problem!==void 0){r.push(` ! ${s.problem}`);continue}for(let c of s.artifacts){let u=c.version;r.push(u===void 0?` missing ${c.id} ${c.home}`:` verified ${c.id} sha256 ${u.sha256.slice(0,16)} ${String(u.size)} bytes seen ${u.seen} on ${u.on}`)}s.unknown.length>0&&r.push(` ${String(s.unknown.length)} file${s.unknown.length===1?"":"s"} in watched folders match no artifact: ${s.unknown.slice(0,8).map(c=>c.path).join(", ")}`)}for(let s of i.unmounted)r.push("",`${s} is not mounted on this machine. Its contents were not read.`);let o=i.answer;if(o!==void 0){if(o.changes.length>0){r.push("","Recorded:");for(let s of o.changes)r.push(` ${s.id} (${s.state}) ${s.summary}`)}if(o.findings.length>0){r.push("","Findings:");for(let s of o.findings)r.push(` ${s.id} ${s.text??""}`)}}return i.report.roots.length===0&&i.unmounted.length===0&&r.push("","This venture declares no store root, so there is nothing to scan."),r.join(`
|
|
299
|
+
`)});var iB=require("node:child_process"),oB=require("node:fs"),sB=require("node:os"),$$=require("node:path");function vpe(){return process.env.TACTICYL_MACHINE??(0,sB.hostname)()}a(vpe,"machineName");function bpe(t){try{let n=(0,iB.execFileSync)("git",["rev-parse","HEAD"],{cwd:t,encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:5e3}).trim();return/^[0-9a-f]{7,40}$/.test(n)?n:void 0}catch{return}}a(bpe,"commitOf");function wpe(t,e={}){if(e.repo!==void 0){let n=(0,$$.resolve)(e.repo);if(!(0,oB.existsSync)(n))throw new Error(`${n} is not a folder on this machine, so there is nothing to audit.`);let i=Xe(n);return{path:n,rootId:e.rootId??i?.link.rootId??(0,$$.basename)(n),from:"flag"}}return t.link!==void 0?{path:t.link.repo,rootId:e.rootId??t.rootId,from:"link"}:{path:t.repo,rootId:e.rootId??t.rootId,from:"cwd"}}a(wpe,"resolveRepo");async function rP(t,e,n,i={}){let r=i.only;if(r!==void 0&&Nb(r)===void 0)throw new Error(`There is no auditor called "${r}". This companion has ${eO().join(", ")}.`);let o=r===void 0?ks:[Nb(r)],s=i.commit??bpe(n.path),c=Jf({path:n.path,rootId:n.rootId,...s===void 0?{}:{commit:s}}),{ran:u,skipped:l}=await tO(c,o),d=CE(u,{businessId:e,rootId:n.rootId,machine:i.machine??vpe(),...s===void 0?{}:{commit:s},at:i.at??new Date().toISOString()});if(i.send===!1)return{report:d,path:c.path,skipped:l};if(e.length===0){let p=await t.draftFromAudit({report:d,documents:Pb(c.path).map(y=>({path:y.path,text:y.text}))}),m=Xe(n.path),g=m===void 0?void 0:zb(m.repo,{...m.link,businessId:p.id});return{report:d,path:c.path,skipped:l,drafted:p,...g===void 0?{}:{linked:g}}}let f=await t.audit(e,d,i.agent);return{report:d,answer:f,path:c.path,skipped:l}}a(rP,"auditRepo");function iP(t,e={}){let n=wpe(t,e);return rP(t.client,t.businessId,n,e)}a(iP,"audit");async function aB(t,e){try{e(`tacticyl audit: ${cB(await iP(t))}`)}catch(n){e(`tacticyl audit: ${n instanceof Error?n.message:String(n)}`)}}a(aB,"auditAtSessionStart");function cB(t){let e=t.report.auditors.filter(s=>s.ok&&s.applied!==!1),n=[`${t.report.rootId} \xB7 ${String(e.length)} auditor${e.length===1?"":"s"}`,`${String(t.report.facts.length)} fact${t.report.facts.length===1?"":"s"}`],i=t.report.auditors.filter(s=>!s.ok);i.length>0&&n.push(`${String(i.length)} failed`);let r=t.drafted;if(r!==void 0)return n.push(`drafted ${r.draft.name}`),n.push(`${String(r.stamped.length)} stamped`),r.done.length>0&&n.push(`${String(r.done.length)} already done`),n.join(" \xB7 ");let o=t.answer;if(o!==void 0){n.push(`${String(o.stamped.length)} stamped`),o.proposed.length>0&&n.push(`${String(o.proposed.length)} proposed`),o.contradicted.length>0&&n.push(`${String(o.contradicted.length)} contradicted`);let s=o.roots??[];s.length>0&&n.push(`${String(s.length)} repository proposed`);let c=o.noted??[];c.length>0&&n.push(`${String(c.length)} noted`);let u=o.asked??[];u.length>0&&n.push(`${String(u.length)} asked`);let l=o.externalities;l!==void 0&&l.found>0&&n.push(`${String(l.found)} externalit${l.found===1?"y":"ies"} (${String(l.mapped)} on the map)`)}return n.join(" \xB7 ")}a(cB,"describeAudit");function uB(t){let e=[cB(t),` ${t.path}`];t.report.commit!==void 0&&e.push(` commit ${t.report.commit.slice(0,12)}`);for(let o of t.report.auditors){if(o.applied===!1){e.push(` skipped ${o.id} (does not apply to this repository)`);continue}e.push(o.ok?` ok ${o.id} ${String(o.facts??0)} fact${o.facts===1?"":"s"} ${String(o.ms)}ms`:` failed ${o.id} ${o.error??"no reason given"}`)}let n=t.drafted;if(n!==void 0){e.push("",` Drafted ${n.draft.name} from this repository.`);for(let o of n.brief.lines)e.push(` ${o.label}: ${o.text}`);e.push(""),e.push(` ${String(n.stamped.length)} node${n.stamped.length===1?"":"s"} the audit proved, stamped: ${n.stamped.join(", ")}`);for(let o of n.setAside)e.push(` not mapped ${o.what}: ${o.why}`);for(let o of n.openExpectations)e.push(` expected ${o.capability} ${o.title}`);for(let o of n.done)e.push(` done ${o.key} ${o.basis}`);return e.push(` ${String(n.assumptions.length)} assumption${n.assumptions.length===1?"":"s"} to confirm, and ${String((n.draft.plan?.items??[]).length)} plan items`),t.linked!==void 0&&e.push("",` ${t.linked} now names ${n.id}.`),e.push("",` Open it: ${n.url}`),e.join(`
|
|
300
|
+
`)}let i=t.answer;if(i===void 0)return e.push(" not sent"),e.join(`
|
|
301
|
+
`);for(let o of i.stamped)e.push(` stamped ${o.text}`);for(let o of i.proposed)e.push(` proposed ${o.text}`);for(let o of i.contradicted)e.push(` finding ${o.finding??""} ${o.text}`);for(let o of i.roots??[])e.push(` repository ${o.finding??""} ${o.text}`),o.codeSide!==void 0&&e.push(` ${o.codeSide}`);for(let o of i.noted??[])e.push(` note ${o.finding??""} ${o.date??""} ${o.text}`),o.codeSide!==void 0&&e.push(` ${o.codeSide}`);for(let o of i.asked??[])e.push(` question ${o.finding??""} ${o.text}`),o.codeSide!==void 0&&e.push(` ${o.codeSide}`);for(let o of i.notes??[])e.push(` ${o.auditor.padEnd(9)} ${o.line}`);let r=i.churn?.line;r!=null&&e.push(` \xB7 ${r}`),i.unhandled>0&&e.push(` \xB7 ${String(i.unhandled)} thing${i.unhandled===1?"":"s"} nothing claimed: a name no service takes, or a fact of a kind with no rule yet`);for(let o of i.changes)e.push(` ${o.state.padEnd(9)} ${o.id} ${o.summary}`);return e.join(`
|
|
302
|
+
`)}a(uB,"renderAudit");var lB=ne(Ky,async(t,e)=>{let n=Xe(),r={path:n?.repo??process.cwd(),rootId:n?.link.rootId??t.rootId},o=await rP(t.client,t.businessId,r,{...e.only===void 0?{}:{only:e.only},agent:t.harness}),s=[`${r.rootId} \xB7 ${o.path}`];o.report.commit!==void 0&&s.push(`commit ${o.report.commit.slice(0,12)}`),s.push("");for(let l of o.report.auditors){if(l.applied===!1){s.push(` skipped ${l.id} \xB7 nothing in this repository for it to read`);continue}s.push(l.ok?` ok ${l.id} ${String(l.facts??0)} fact${l.facts===1?"":"s"} in ${String(l.ms)}ms`:` failed ${l.id} ${l.error??"no reason given"}`)}let c=o.drafted;if(c!==void 0){s.push("","This repository had no business, so Tacticyl drafted one from it:","",` ${c.draft.name} ${c.url}`,"","What it understood:");for(let l of c.brief.lines)s.push(` ${l.label}: ${l.text}`);s.push("","Stamped `audited` on creation, because the code proves them:");for(let l of c.stamped)s.push(` ${l}`);if(c.setAside.length>0){s.push("","Found but not on the map:");for(let l of c.setAside)s.push(` ${l.what} ${l.why}`)}if(c.openExpectations.length>0){s.push("","Customary capabilities not on the map yet:");for(let l of c.openExpectations)s.push(` ${l.capability} ${l.title}`)}if(c.done.length>0){s.push("","Plan items created done, with what proved each:");for(let l of c.done)s.push(` ${l.key} ${l.basis}`)}return s.push("",`${String(c.assumptions.length)} assumptions are marked and waiting for the founder. Do not confirm them: they are theirs to read on the Map. Running this tool again now This will be reconciled against the existing business instead of drafting a second one.`),s.join(`
|
|
303
|
+
`)}let u=o.answer;if(u===void 0)return s.push("","The report was not sent, and the business was not updated."),s.join(`
|
|
304
|
+
`);if(u.stamped.length>0){s.push("","Confirmed by the code (stamped `audited`, accepted):");for(let l of u.stamped)s.push(` ${l.ref??l.at} ${l.text}`)}if(u.proposed.length>0){s.push("","The code has these and the map does not. Proposed, waiting for the founder:");for(let l of u.proposed)s.push(` ${l.text}`)}if(u.contradicted.length>0){s.push("","These items disagree with the map. No changes were made. Each is recorded as a finding with both sides,","for the founder to resolve:");for(let l of u.contradicted)s.push(` ${l.finding??""} ${l.text}`)}if(u.unhandled>0&&s.push("",`${String(u.unhandled)} item${u.unhandled===1?"":"s"} of a kind that is not handled yet ${u.unhandled===1?"was":"were"} counted and not acted on.`),u.changes.length>0){s.push("","Recorded:");for(let l of u.changes)s.push(` ${l.id} (${l.state}) ${l.summary}`)}return u.stamped.length===0&&u.proposed.length===0&&u.contradicted.length===0&&s.push("","None of these findings relate to anything this business declares."),s.join(`
|
|
305
|
+
`)});var x$=require("node:fs");var k$=require("node:fs"),Bs=require("node:path");var tr=require("node:fs"),dB=require("node:path");function jo(t,e){let n=(0,tr.existsSync)(t);return n&&(0,tr.readFileSync)(t,"utf8")===e?{path:t,outcome:"unchanged"}:((0,tr.mkdirSync)((0,dB.dirname)(t),{recursive:!0}),(0,tr.writeFileSync)(t,e,"utf8"),{path:t,outcome:n?"updated":"created"})}a(jo,"writeIfChanged");function vu(t){return`${JSON.stringify(t,null,2)}
|
|
306
|
+
`}a(vu,"formatJson");function xr(t){if(!(0,tr.existsSync)(t))return{};try{let e=JSON.parse((0,tr.readFileSync)(t,"utf8"));return typeof e=="object"&&e!==null&&!Array.isArray(e)?e:{}}catch{return{}}}a(xr,"readJsonObject");function fB(t,e){let n=e.trimEnd(),i=n.startsWith(Ht)?n:`${Ht}
|
|
307
|
+
${n}
|
|
308
|
+
${jt}`;if(t===void 0||t.trim().length===0)return`${i}
|
|
309
|
+
`;let r=t.indexOf(Ht),o=t.indexOf(jt);if(r===-1||o===-1||o<r)return`${t.trimEnd()}
|
|
310
|
+
|
|
311
|
+
${i}
|
|
312
|
+
`;let s=t.slice(0,r),c=t.slice(o+jt.length);return`${s}${i}${c.replace(/^\n*/,(c.trim().length===0,`
|
|
313
|
+
`))}`}a(fB,"withGeneratedBlock");function wt(t){return(0,tr.existsSync)(t)?(0,tr.readFileSync)(t,"utf8"):void 0}a(wt,"readIfPresent");function pB(t,e,n){let i=t??"";return i.split(`
|
|
314
|
+
`).some(o=>o.trim()===e.trim())?i:`${i.trim().length===0?"":`${i.trimEnd()}
|
|
315
|
+
|
|
316
|
+
`}${n===void 0?"":`${n}
|
|
317
|
+
`}${e}
|
|
318
|
+
`}a(pB,"ensureLine");function _$(t,e){let n=(0,Bs.resolve)(t),i=e.replaceAll("\\","/").replace(/^\/+/,""),r=(0,Bs.resolve)(n,i);if(!(r!==n&&!r.startsWith(n.endsWith(Bs.sep)?n:n+Bs.sep)))return r}a(_$,"insideRepo");function $pe(t){return t.map(e=>({path:e.path,key:e.key,role:e.role,content:e.content,status:e.status}))}a($pe,"asFiles");async function mB(t,e,n={}){let i=n.dir??t.repo,r=await t.client.scaffold(t.businessId,e),o=lf($pe(r.files),u=>{let l=_$(i,u);if(!(l===void 0||!(0,k$.existsSync)(l)))try{return(0,k$.readFileSync)(l,"utf8")}catch{return}});if(n.write!==!0)return{businessId:t.businessId,system:e,dir:i,preview:r,diffs:o,summary:oc(o),written:[],applied:null};let s=[];for(let u of o){if(u.status!=="new"&&u.status!=="replaced")continue;let l=_$(i,u.path);l!==void 0&&s.push(jo(l,u.content))}let c=s.length===0?null:await t.client.applyScaffold(t.businessId,e,{written:s.map(u=>({path:u.path.startsWith(i)?u.path.slice(i.length+1):u.path,outcome:u.outcome}))});return{businessId:t.businessId,system:e,dir:i,preview:r,diffs:o,summary:oc(o),written:s,applied:c}}a(mB,"scaffold");function hB(t){let e=uf({system:t.system,stack:t.preview.stack,dir:t.preview.dir,modes:t.preview.modes,files:t.diffs.map(r=>({path:r.path,role:r.role,status:r.status,bytes:Buffer.byteLength(r.content,"utf8"),...r.why===void 0?{}:{why:r.why}})),bindings:t.preview.bindings.map(r=>({ref:r.ref,kind:r.kind,interfaceName:r.interfaceName,policy:r.policy,policyFrom:r.policyFrom,...r.provider===void 0?{}:{provider:r.provider},modes:r.modes.map(o=>({mode:o.mode,binding:o.binding,...o.via===void 0?{}:{via:o.via}})),secrets:r.secrets.map(o=>({name:o.name,required:o.required}))})),skipped:t.preview.skipped,summary:t.summary,written:t.written.map(r=>({path:r.path,outcome:r.outcome})),why:t.written.length>0?null:`No files were written. You can run \`tacticyl scaffold ${t.system} --write\` to write these files into ${t.dir}.`},t.written.length>0),n=t.applied;if(n===null)return e;let i=[e.trimEnd(),""];return n.docs!==null&&i.push(`Registered: ${n.docs.id} (${n.docs.state}) ${n.docs.changeSet.summary??""}`),n.bound!==null&&i.push(`Bound in code: ${n.boundModes.join(", ")} \xB7 ${n.bound.id} (${n.bound.state})`),n.why!==null&&i.push(n.why),`${i.join(`
|
|
319
|
+
`)}
|
|
320
|
+
`}a(hB,"renderScaffoldResult");var gB=ne(Hy,async(t,e)=>{let n=await t.client.scaffold(t.businessId,e.system),i=Xe()?.repo??process.cwd(),r=lf(n.files.map(o=>({path:o.path,key:o.key,role:o.role,content:o.content})),o=>{let s=_$(i,o);if(!(s===void 0||!(0,x$.existsSync)(s)))try{return(0,x$.readFileSync)(s,"utf8")}catch{return}});return uf({system:e.system,stack:n.stack,dir:n.dir,modes:n.modes,files:r.map(o=>({path:o.path,role:o.role,status:o.status,bytes:Buffer.byteLength(o.content,"utf8"),...o.why===void 0?{}:{why:o.why}})),bindings:n.bindings.map(o=>({ref:o.ref,kind:o.kind,interfaceName:o.interfaceName,policy:o.policy,policyFrom:o.policyFrom,...o.provider===void 0?{}:{provider:o.provider},modes:o.modes.map(s=>({mode:s.mode,binding:s.binding,...s.via===void 0?{}:{via:s.via}})),secrets:o.secrets.map(s=>({name:s.name,required:s.required}))})),skipped:n.skipped,summary:oc(r),why:`No files were written. To write and register the files above, run \`tacticyl scaffold ${e.system} --write\` in ${i}.`})});var yB=ne(Wy,async(t,e)=>{let n=e.item??await _pe(t.client,t.businessId);return n===null?"There are no items left to do in this plan. Each item is either complete or blocked on a milestone.":(await t.client.brief(t.businessId,n)).text});async function _pe(t,e){let n=await t.plan(e),i=new Map(n.derived.items.map(r=>[r.id,r.state]));for(let r of n.schedule.order){let o=i.get(r);if(o==="todo"||o==="in-progress")return r}return null}a(_pe,"nextItemId");var vB=ne(Gy,async(t,e)=>{let n=await t.client.questions(t.businessId,{...e.root===void 0?{}:{root:e.root},...e.kind===void 0?{}:{kind:e.kind}});return uE(n.questions,{...e.root===void 0?{}:{root:e.root},...e.limit===void 0?{}:{limit:e.limit}})});var bB=ne(Jy,async(t,e)=>{try{let n=await t.client.setItemState(t.businessId,e.item,{state:"done",...e.evidence===void 0?{}:{reason:e.evidence}},t.harness);return"result"in n&&n.result!==void 0?`${VI({item:n.itemId,state:n.state==="done"?"done":"in-progress",method:n.result.method,...n.result.failed===void 0?{}:{failed:n.result.failed},agent:ZI(t.harness)})}
|
|
321
|
+
|
|
322
|
+
${st(n.change)}`:st(n.change)}catch(n){if(n instanceof dt&&n.code==="fixes-unconfirmed")return qI(n.message);throw n}});var wB=ne(Yy,async(t,e)=>{let n=await t.client.venture(t.businessId,{fresh:!0}),i=kE(n.venture,{about:e.about,text:e.text,raisedBy:`agent:${t.harness}`,at:new Date().toISOString().slice(0,10)}),r=await t.client.propose(t.businessId,i,{kind:"agent",name:t.harness});return st(r.change,r.findings,r.diagnostics)});var $B=ne(Xy,async(t,e)=>{let n=await t.client.answerFinding(t.businessId,e.finding,{kind:e.answer,...e.provider===void 0?{}:{provider:e.provider},...e.name===void 0?{}:{name:e.name},...e.capability===void 0?{}:{capability:e.capability},...e.node===void 0?{}:{node:e.node},...e.hint===void 0?{}:{hint:e.hint}},t.harness);return st(n.change,[],n.diagnostics)});var _B=ne(Qy,async(t,e)=>{let n=await t.client.resolveFinding(t.businessId,e.finding,{kind:e.how,...e.reason===void 0?{}:{reason:e.reason},...e.revisit===void 0?{}:{revisit:e.revisit}},t.harness);return st(n.change,[],n.diagnostics)});var kB=ne(ev,async(t,e)=>{let n=await t.client.venture(t.businessId,{fresh:!0}),i=xE(n.venture,{what:e.what,why:e.why,...e.pins===void 0?{}:{pins:e.pins}}),r=await t.client.propose(t.businessId,i,{kind:"agent",name:t.harness});return st(r.change,r.findings,r.diagnostics)});var xB=ne(tv,async(t,e)=>{let n=await t.client.venture(t.businessId,{fresh:!0});if(e.action==="list")return aE(n.venture);let i=(e.capability??"").trim();if(i.length===0)return'Name the capability: `capability: "mail.transactional"`.';let r=e.action==="ours"?(e.node??"").trim().length===0?'Name the part that does it: `node: "systems/api"`.':{kind:"ours",capability:i,node:(e.node??"").trim()}:e.action==="provider"?(e.provider??"").trim().length===0?'Name the provider that does it: `provider: "resend"`.':{kind:"provider",capability:i,provider:(e.provider??"").trim()}:e.action==="not-needed"?{kind:"not-needed",capability:i,...e.note===void 0||e.note.trim().length===0?{}:{note:e.note.trim()}}:{kind:e.action,capability:i};if(typeof r=="string")return r;let o=new Date().toISOString().slice(0,10),s=LI(n.venture,r,o);if(!s.ok)return s.error;let c=await t.client.propose(t.businessId,s.changeSet,{kind:"agent",name:t.harness});return st(c.change,c.findings,c.diagnostics)});var SB=ne(nv,async(t,e)=>{let i=Xe()?.link.rootId??t.rootId;return(await t.client.report(t.businessId,{events:e.events,rootId:i},t.harness)).text});var Ks=require("node:fs"),Hs=require("node:path");var kpe="Say which file shows this: `evidence: [{ path, line, excerpt }]`, one to five files in this repository.",xpe="This companion is not serving from a repository, so there is no file to check an answer against. Run `tacticyl serve` in the repository.",Spe=2e6;function Ipe(t,e){let n=e.path.trim().replace(/^\.\//,"");if(n.length===0)return"A citation names a file.";if(n.startsWith("/")||n.includes("\\")||n.split("/").includes(".."))return`${n} is not a path inside this repository: give it relative to the repository's root, with no \`..\`.`;let i=(0,Hs.resolve)(t,n),r=(0,Hs.relative)((0,Hs.resolve)(t),i);if(r.startsWith("..")||r.startsWith(Hs.sep)||r.length===0)return`${n} is not inside this repository.`;if(!(0,Ks.existsSync)(i)||!(0,Ks.statSync)(i).isFile())return`There is no file ${n} in this repository. Cite a file that is there.`;if(e.line===void 0&&e.excerpt===void 0)return null;if((0,Ks.statSync)(i).size>Spe)return`${n} is too large to check a line in. Cite a smaller file, or the file alone.`;let o=(0,Ks.readFileSync)(i,"utf8").split(/\r?\n/);if(o.length>1&&o[o.length-1]===""&&o.pop(),e.line!==void 0&&e.line>o.length)return`${n} has ${String(o.length)} lines, so there is no line ${String(e.line)}.`;if(e.excerpt!==void 0){let s=e.excerpt.trim();if(s.length===0)return`The excerpt from ${n} has words in it.`;if(!(e.line===void 0?o:[o[e.line-1]??""]).some(u=>u.includes(s)))return e.line===void 0?`${n} does not contain "${s}". Quote the file exactly, or leave the excerpt out.`:`Line ${String(e.line)} of ${n} does not say "${s}". Quote the line exactly, or leave the excerpt out.`}return null}a(Ipe,"citationFault");var IB=ne(rv,async(t,e)=>{if(t.repo===void 0)return xpe;let n=e.evidence??[];if(n.length===0)return kpe;for(let r of n){let o=Ipe(t.repo,r);if(o!==null)return o}let i=await t.client.settle(t.businessId,e.question,{how:e.how,...e.value===void 0?{}:{value:e.value},...e.node===void 0?{}:{node:e.node},...e.provider===void 0?{}:{provider:e.provider},...e.name===void 0?{}:{name:e.name},...e.capability===void 0?{}:{capability:e.capability},...e.note===void 0?{}:{note:e.note},evidence:n.map(r=>({path:r.path.trim().replace(/^\.\//,""),...r.line===void 0?{}:{line:r.line},...r.excerpt===void 0?{}:{excerpt:r.excerpt}})),root:t.rootId},t.harness);return st(i.change,i.findings,i.diagnostics)});var Ws=[bV,wV,$V,_V,kV,xV,SV,PV,RV,jV,rB,lB,gB,yB,vB,bB,wB,$B,_B,kB,xB,SB,IB];function EB(t){return Ws.find(e=>e.name===t)}a(EB,"toolNamed");var Epe="tacticyl";function Tpe(t){return t instanceof dt&&t.status===404&&t.code==="not-found"&&t.message.startsWith("There is no route ")}a(Tpe,"isMissingRoute");var sP=6e4;async function Gs(t,e){try{return(await t.agentAccess(e)).access}catch{return}}a(Gs,"accessOf");var Ape="codex-mcp-client";function Ope(t){let e=t?.name?.trim();if(e===void 0||e.length===0)return"unknown";let n=e.toLowerCase().replace(/\s+/g,"-");return n===Ape||n.startsWith("codex")?"codex":n}a(Ope,"harnessName");function oP(t){return{content:[{type:"text",text:t instanceof Error?t.message:String(t)}],isError:!0}}a(oP,"failed");function OB(t){let e=new a$({name:Epe,version:t.version??"0.0.0"},{instructions:"This server is the map of the venture this repository belongs to: what it is made of, where each part lives, who depends on what, and what has already been decided. Call orient first: one small page with what this business is made of, what is next, what is open and what it is expected to have; then overview for the whole map and how things here are addressed, which nothing else will tell you. You change the map only through the tools that write (propose, register_doc, complete_item, raise_finding, answer_finding, resolve_finding, decide, expect, report, settle), and the founder decides whether those are refused, wait for them as proposals, or take effect at once; TACTICYL.md says which. You cannot edit it directly, and you should not try to keep a copy of it in a file."}),n=[],i,r=0,o=a(c=>{if(r=Date.now(),!(c===void 0||c===i)){i=c;for(let u of n)c==="read"?u.disable():u.enable()}},"applyAccess"),s=a(()=>{r=Date.now(),Gs(t.client,t.businessId).then(o)},"recheck");for(let c of t.tools??Ws){let u=e.registerTool(c.name,{title:c.title,description:c.description,inputSchema:c.inputSchema,annotations:{readOnlyHint:c.readOnly,openWorldHint:!0}},async l=>{let d=Ope(e.server.getClientVersion()),f=l??{},p=t.linkWatch?.state()??"same";if(p!=="same"){let v=b4(p);return t.onCall?.({tool:c.name,harness:d,args:f,ms:0,ok:!1,error:v}),oP(new Error(v))}let m,g={client:t.client,businessId:t.businessId,rootId:t.rootId,...t.repo===void 0?{}:{repo:t.repo},harness:d,mark:a(v=>{m=v},"mark")},y=Date.now();try{let v=await c.run(g,f);return TB(t,{tool:c.name,harness:d,args:f,ms:Date.now()-y,ok:!0,...m===void 0?{}:{via:m}}),Date.now()-r>sP&&s(),{content:[{type:"text",text:v}]}}catch(v){let w=t.ahead===!0&&Tpe(v),b=w?KD():v instanceof Error?v.message:String(v);return v instanceof dt&&v.code==="agent-access"&&s(),d$(v,{command:"serve",where:c.name},{service:t.client.service,...t.repo===void 0?{}:{repo:t.repo}}),TB(t,{tool:c.name,harness:d,args:f,ms:Date.now()-y,ok:!1,error:b,...m===void 0?{}:{via:m}}),oP(w?new Error(b):v)}});c.readOnly||n.push(u)}return t.access!==void 0?o(t.access):s(),e}a(OB,"createMcpServer");function TB(t,e){t.onCall?.(e),t.client.logToolCall({tool:e.tool,businessId:t.businessId,harness:e.harness,args:e.args,ms:e.ms,ok:e.ok,error:e.error??null,...e.via===void 0?{}:{via:e.via}})}a(TB,"report");async function NB(t){await t.connect(new u$)}a(NB,"serveStdio");var Npe=32;function CB(t){let e=new Map;async function n(r){let o=e.get(r);o!==void 0&&(e.delete(r),await o.server.close())}a(n,"forget");async function i(){let r=new l$({sessionIdGenerator:a(()=>(0,AB.randomUUID)(),"sessionIdGenerator"),enableJsonResponse:!0,onsessioninitialized:a(s=>{e.set(s,{transport:r,server:o})},"onsessioninitialized"),onsessionclosed:a(s=>{n(s)},"onsessionclosed")}),o=await t();return await o.connect(r),{transport:r,server:o}}return a(i,"open"),{get sessions(){return e.size},async handle(r){let o=r.headers.get("mcp-session-id"),s;if(o===null){for(;e.size>=Npe;){let c=e.keys().next().value;if(c===void 0)break;await n(c)}s=await i()}else{let c=e.get(o);if(c===void 0)return Response.json({error:`No MCP session ${o}. Reconnect: the companion was restarted.`},{status:404});s=c}return s.transport.handleRequest(r)},async close(){let r=[...e.keys()];e.clear(),await Promise.all(r.map(o=>n(o)))}}}a(CB,"httpMcp");var Je=require("node:path");var RB=require("node:child_process"),Js=require("node:fs"),jB=require("node:os"),$t=require("node:path");var zB=["claude-code","codex","cursor"],wi="tacticyl",em="tacticyl",bu=["serve"],DB=["mcp","add","--scope","project",wi,"--",em,...bu],LB=["mcp","add",wi,"--",em,...bu],MB=["mcp","remove","--scope","project",wi],UB=["mcp","remove",wi];function tm(t,e){return[t,...e].join(" ")}a(tm,"commandLine");function aP(t){return t.HOME??t.USERPROFILE??(0,jB.homedir)()}a(aP,"homeOf");function Ys(t){let e=t.CODEX_HOME;return(0,$t.join)(e!==void 0&&e.length>0?e:(0,$t.join)(aP(t),".codex"),"config.toml")}a(Ys,"codexConfigPath");function nm(t,e){let n=(e.PATH??e.Path??"").split($t.delimiter).filter(r=>r.length>0),i=process.platform==="win32"?["",...(e.PATHEXT??".EXE;.CMD;.BAT").split(";").map(r=>r.toLowerCase())]:[""];for(let r of n)for(let o of i){let s=(0,$t.join)(r,`${t}${o}`);try{if(!(0,Js.statSync)(s).isFile())continue;return process.platform!=="win32"&&(0,Js.accessSync)(s,Js.constants.X_OK),s}catch{}}}a(nm,"onPath");function I$(t,e,n,i){try{return(0,RB.execFileSync)(t,[...e],{cwd:n,env:i,stdio:["ignore","ignore","ignore"],timeout:3e4,shell:process.platform==="win32"}),!0}catch{return!1}}a(I$,"runAgentCommand");function wu(t){let e=t.mcpServers;if(typeof e!="object"||e===null)return!1;let n=e[wi];if(typeof n!="object"||n===null)return!1;let i=n;return i.command===em&&Array.isArray(i.args)&&i.args.length===bu.length&&i.args.every((r,o)=>r===bu[o])}a(wu,"hasJsonEntry");var Cpe=/^\s*\[\s*mcp_servers\s*\.\s*(?:tacticyl|"tacticyl"|'tacticyl')\s*\]\s*(?:#.*)?$/,FB=/^\s*\[/;function S$(){let t=bu.map(e=>JSON.stringify(e)).join(", ");return`[mcp_servers.${wi}]
|
|
323
|
+
command = ${JSON.stringify(em)}
|
|
324
|
+
args = [${t}]
|
|
325
|
+
`}a(S$,"codexTable");function E$(t){let e=t.findIndex(i=>Cpe.test(i));if(e===-1)return;let n=e+1;for(;n<t.length&&!FB.test(t[n]??"");)n+=1;return{start:e,end:n}}a(E$,"ourTable");function PB(t,e){let n=new RegExp(`^\\s*${e}\\s*=\\s*(.*?)\\s*(?:#.*)?$`);for(let i of t){let r=n.exec(i);if(r!==null)return(r[1]??"").replace(/\s+/g,"").replace(/'/g,'"')}}a(PB,"keyValue");function Ppe(t){let e="";for(let n of t){let i=/^\s*\[\s*([^\]]*?)\s*\]/.exec(n);if(i!==null){e=(i[1]??"").replace(/\s+/g,"");continue}if(e===""&&/^\s*mcp_servers\s*(?:\.\s*["']?tacticyl["']?\s*[.=]|=)/.test(n)||e==="mcp_servers"&&/^\s*["']?tacticyl["']?\s*[.=]/.test(n))return!0}return!1}a(Ppe,"definedOtherwise");function T$(t){if(t===void 0)return"absent";let e=t.split(/\r?\n/),n=E$(e);if(n===void 0)return Ppe(e)?"theirs":"absent";let i=e.slice(n.start+1,n.end),r=`[${bu.map(o=>JSON.stringify(o)).join(",")}]`;return PB(i,"command")===JSON.stringify(em)&&PB(i,"args")===r?"ours":"absent"}a(T$,"codexEntry");function qB(t){if(t===void 0||t.trim().length===0)return S$();let e=t.split(`
|
|
326
|
+
`),n=E$(e);if(n===void 0)return`${t.trimEnd()}
|
|
327
|
+
|
|
328
|
+
${S$()}`;let i=e.slice(0,n.start).join(`
|
|
329
|
+
`),r=e.slice(n.end).join(`
|
|
330
|
+
`),o=r.trim().length===0?S$():`${S$()}
|
|
331
|
+
`;return`${i.length>0?`${i}
|
|
332
|
+
`:""}${o}${r.trim().length===0?"":r}`}a(qB,"withCodexServer");var Rpe=/^\s*\[\s*mcp_servers\s*\.\s*(?:tacticyl|"tacticyl"|'tacticyl')\s*\.[^\]]*\]\s*(?:#.*)?$/;function A$(t){let e=T$(t);return e!=="absent"||t===void 0?e:E$(t.split(/\r?\n/))===void 0?"absent":"theirs"}a(A$,"codexHeld");function ZB(t){let e=t.split(`
|
|
333
|
+
`),n=E$(e);if(n===void 0)return t;let i=n.end;for(;!(i>=e.length||!Rpe.test(e[i]??""));)for(i+=1;i<e.length&&!FB.test(e[i]??"");)i+=1;return[...e.slice(0,n.start),...e.slice(i)].join(`
|
|
334
|
+
`)}a(ZB,"withoutCodexServer");function $i(t,e,n=process.env){let i=(0,$t.relative)(t,e);if(i.length>0&&!i.startsWith("..")&&!(0,$t.isAbsolute)(i))return i.split($t.sep).join("/");let r=aP(n),o=(0,$t.relative)(r,e);return o.length>0&&!o.startsWith("..")&&!(0,$t.isAbsolute)(o)?`~/${o.split($t.sep).join("/")}`:e}a($i,"displayPath");function VB(t,e,n=process.env){return e.startsWith("~/")?(0,$t.join)(aP(n),...e.slice(2).split("/")):(0,$t.isAbsolute)(e)?e:(0,$t.join)(t,...e.split("/"))}a(VB,"resolveDisplayed");var zo=require("node:fs"),rm=require("node:path");var jpe=["own","leave"];function BB(t){return jpe.includes(t)}a(BB,"isPromptAnswer");var cP=(0,rm.join)(rt,"prompts.json");function KB(t){return(0,rm.join)(t,cP)}a(KB,"pathIn");function im(t){let e=KB(t);if((0,zo.existsSync)(e))try{let n=JSON.parse((0,zo.readFileSync)(e,"utf8"));if(typeof n!="object"||n===null)return;let i=n;return typeof i.controls!="boolean"?void 0:{controls:i.controls,asked:typeof i.asked=="string"?i.asked:"",by:i.by==="founder"?"founder":"new"}}catch{return}}a(im,"readPromptControl");function uP(t,e){let n=KB(t);return(0,zo.mkdirSync)((0,rm.dirname)(n),{recursive:!0}),(0,zo.writeFileSync)(n,`${JSON.stringify(e,null,2)}
|
|
335
|
+
`,"utf8"),n}a(uP,"writePromptControl");var lP="Tacticyl has not written into this repository\u2019s own agent files. `tacticyl project --prompts own` lets it keep a section in them current; `--prompts leave` keeps it to TACTICYL.md.";function O$(t){return t===void 0?lP:t.controls?`Tacticyl keeps a section in this repository\u2019s agent files current${t.by==="founder"?`, since ${t.asked}`:""}.`:`Tacticyl writes TACTICYL.md and leaves this repository\u2019s own agent files alone, since ${t.asked}.`}a(O$,"promptControlLine");function zpe(){return{command:"tacticyl",args:["serve"]}}a(zpe,"mcpEntry");function HB(t){let e=t.mcpServers,n=typeof e=="object"&&e!==null&&!Array.isArray(e)?e:{};return{...t,mcpServers:{...n,tacticyl:zpe()}}}a(HB,"withMcpServer");function Dpe(t,e){return`---
|
|
336
|
+
description: The business map for ${e}: what this repository is part of, what it holds, and who depends on it.
|
|
337
|
+
alwaysApply: true
|
|
338
|
+
---
|
|
339
|
+
|
|
340
|
+
`+t}a(Dpe,"cursorRule");var _i=[{id:"claude-code",name:"Claude Code",mcp:".mcp.json",also:["CLAUDE.md",(0,Je.join)(".claude","skills","tacticyl","SKILL.md")],bin:{name:"claude",args:DB}},{id:"codex",name:"Codex",mcp:null,also:[],bin:{name:"codex",args:LB}},{id:"cursor",name:"Cursor",mcp:(0,Je.join)(".cursor","mcp.json"),also:[(0,Je.join)(".cursor","rules","tacticyl.mdc")]}];function om(t,e,n=process.env){return t.mcp===null?Ys(n):(0,Je.join)(e,t.mcp)}a(om,"mcpPathOf");var $u=(0,Je.join)(rt,"enrolled.json");function Lpe(t,e,n=process.env){let i=new Set(e);return _i.filter(r=>i.has(om(r,t,n))).map(r=>({id:r.id,name:r.name,files:[om(r,t,n),...r.also.map(o=>(0,Je.join)(t,o))].filter(o=>i.has(o))}))}a(Lpe,"enrolledBy");function Mpe(t,e,n){return vu({agents:e.map(i=>({id:i.id,name:i.name,files:i.files.map(r=>$i(t,r,n))}))})}a(Mpe,"enrolledRecord");function WB(t,e=process.env){let n=xr((0,Je.join)(t,$u)).agents;return Array.isArray(n)?n.flatMap(i=>{if(typeof i!="object"||i===null)return[];let r=i;if(typeof r.id!="string"||typeof r.name!="string")return[];let o=Array.isArray(r.files)?r.files.filter(s=>typeof s=="string"):[];return[{id:r.id,name:r.name,files:o.map(s=>VB(t,s,e))}]}):[]}a(WB,"readEnrolled");function GB(t,e=[]){let i=im(t)?.controls??YB(t).length===0;return N$(t,"planned","",i,e).map(r=>r.path)}a(GB,"plannedProjectionPaths");function JB(t,e=[],n=process.env){let i=[],r=[];for(let o of _i){if(e.includes(o.id)||o.bin===void 0)continue;let s=om(o,t,n);dP(o.id,s)||(nm(o.bin.name,n)!==void 0?i.push(tm(o.bin.name,o.bin.args)):o.mcp===null&&r.push(s))}return{commands:i,files:r}}a(JB,"plannedAgents");function dP(t,e){return t==="codex"?T$(wt(e))!=="absent":wu(xr(e))}a(dP,"holdsEntry");function YB(t){return Gf(Jf({path:t,rootId:"here"})).map(e=>e.path)}a(YB,"founderAgentFiles");var Upe=["TACTICYL.md",".mcp.json",(0,Je.join)(".cursor","mcp.json")];function N$(t,e,n,i=!0,r=[],o="here"){let s=[{path:(0,Je.join)(t,"TACTICYL.md"),content:n},{path:(0,Je.join)(t,".cursor","rules","tacticyl.mdc"),content:Dpe(n,e)},{path:(0,Je.join)(t,".claude","skills","tacticyl","SKILL.md"),content:vE({businessId:e,rootId:o})},{path:(0,Je.join)(t,"AGENTS.md"),content:fB(wt((0,Je.join)(t,"AGENTS.md")),n)},{path:(0,Je.join)(t,"CLAUDE.md"),content:pB(wt((0,Je.join)(t,"CLAUDE.md")),go,_s)},{path:(0,Je.join)(t,".mcp.json"),content:vu(HB(xr((0,Je.join)(t,".mcp.json"))))},{path:(0,Je.join)(t,".cursor","mcp.json"),content:vu(HB(xr((0,Je.join)(t,".cursor","mcp.json"))))}],c=i?s:s.filter(l=>Upe.some(d=>l.path===(0,Je.join)(t,d))),u=new Set(_i.filter(l=>r.includes(l.id)).flatMap(l=>[...l.mcp===null?[]:[l.mcp],...l.also].map(d=>(0,Je.join)(t,d))));return c.filter(l=>!u.has(l.path))}a(N$,"projectionFiles");function fP(t,e,n,i){return _E(e,{businessId:t.businessId,rootId:t.rootId,service:t.service,snapshot:n,...i===void 0?{}:{access:i}})}a(fP,"projectionBody");async function _u(t,e={}){let n=e.dir??t.repo,i=await t.client.venture(t.businessId,{fresh:!0}),r=fP(t,i.graph,i.snapshot,await Gs(t.client,t.businessId)),o=new Date().toISOString().slice(0,10),s=im(n),c=s===void 0?YB(n):[],u;e.prompts!==void 0?(u={controls:e.prompts==="own",asked:o,by:"founder"},uP(n,u)):s!==void 0?u=s:c.length===0?(u={controls:!0,asked:o,by:"new"},uP(n,u)):u={controls:!1,asked:o,by:"founder"};let l=e.prompts===void 0&&s===void 0?c:[],d=e.env??process.env,f=e.skip??[],p=new Map,m=[],g=[];for(let b of _i){if(f.includes(b.id))continue;let $=om(b,n,d);if(p.set($,wt($)),dP(b.id,$))continue;let x=b.bin===void 0?void 0:nm(b.bin.name,d);if(b.bin===void 0||x===void 0||!I$(x,b.bin.args,n,d)||!dP(b.id,$))continue;let T=tm(b.bin.name,b.bin.args);g.push(T),m.push({id:b.id,name:b.name,how:"command",command:T,path:$})}let y=N$(n,t.businessId,r,u.controls,f,t.rootId).map(b=>{let $=jo(b.path,b.content);if(!p.has(b.path))return $;let x=p.get(b.path),T=wt(b.path);return x===T?{path:b.path,outcome:"unchanged"}:{path:b.path,outcome:x===void 0?"created":"updated"}});if(!f.includes("codex")){let b=Ys(d);if(T$(wt(b))==="absent")y.push(jo(b,qB(wt(b))));else{let $=p.get(b),x=wt(b);y.push({path:b,outcome:$===x?"unchanged":$===void 0?"created":"updated"})}}for(let b of _i){if(f.includes(b.id)||m.some(T=>T.id===b.id))continue;let $=om(b,n,d),x=y.find(T=>T.path===$);x!==void 0&&m.push({id:b.id,name:b.name,how:x.outcome==="unchanged"?"unchanged":"file",path:$})}m.sort((b,$)=>_i.findIndex(x=>x.id===b.id)-_i.findIndex(x=>x.id===$.id));let v=Lpe(n,y.map(b=>b.path),d);jo((0,Je.join)(n,$u),Mpe(n,v,d));let w=i.graph.index.filter(b=>{let $=b.node.home;return b.depth===2&&Array.isArray($)&&$.some(x=>x.root===t.rootId)}).length;return{files:y,prompts:u,asking:l,businessId:t.businessId,rootId:t.rootId,snapshot:i.snapshot,sliceSize:w,enrolled:v,commands:g,agents:m}}a(_u,"project");var pP="Codex's setting applies to every repository on this machine. The tools will use whichever repository Codex is working in.";function C$(t,e,n=process.env){let i=[];for(let r of e){let o=$i(t,r.path,n);r.how==="command"?i.push(`${r.name}: added Tacticyl's tools with \`${r.command??""}\``):r.how==="file"?i.push(`${r.name}: wrote ${o}`):i.push(`${r.name}: already has Tacticyl's tools in ${o}, no changes made`),r.id==="codex"&&r.how!=="unchanged"&&i.push(pP)}return i}a(C$,"renderAgents");var ki=require("node:fs"),mP=require("node:child_process"),xn=require("node:path");var Fpe=["findings",(0,xn.join)("ledger","changes")];function qpe(t,e){let n=[];for(let i of Fpe){let r=(0,xn.join)(t,i);if((0,ki.existsSync)(r))for(let o of(0,ki.readdirSync)(r).sort()){let s=`${i.split(/[\\/]/).join("/")}/${o}`;e.has(s)||((0,ki.rmSync)((0,xn.join)(r,o),{force:!0,recursive:!0}),n.push(s))}}return n}a(qpe,"prune");function Zpe(t,e,n){let i=a((...l)=>(0,mP.spawnSync)("git",["-C",t,...l],{stdio:"pipe"}),"run");if((0,mP.spawnSync)("git",["--version"],{stdio:"ignore"}).status!==0)return{initialized:!1,committed:!1,says:"git was not found on the PATH. No commit was made."};let o=!(0,ki.existsSync)((0,xn.join)(t,".git"));if(o){let l=i("init","--quiet");if(l.status!==0)return{initialized:!1,committed:!1,says:`git init did not work: ${l.stderr?.toString().trim()??"no reason given"}`}}i("add","-A");let s=`tacticyl export: ${e} at ${n.slice(0,12)}`,c=(i("config","user.email").stdout?.toString().trim()??"")===""?["-c","user.name=tacticyl","-c","user.email=tacticyl@localhost"]:[],u=i(...c,"commit","--quiet","-m",s);if(u.status!==0){let l=u.stdout?.toString()??"",d=l.includes("nothing to commit")||l.includes("nothing added");return{initialized:o,committed:!1,says:d?"Nothing to commit: the hub already holds this snapshot.":`git commit did not work: ${(u.stderr?.toString()||l).trim()}`}}return{initialized:o,committed:!0,says:`Committed "${s}"${c.length>0?" with a fallback identity (no git user.email is configured)":""}. The commit was not pushed.`}}a(Zpe,"commit");function Vpe(t,e){let n=(0,xn.relative)((0,xn.resolve)(t),(0,xn.resolve)(e));return n===""||!n.startsWith("..")&&!(0,xn.isAbsolute)(n)}a(Vpe,"inside");async function XB(t,e,n={}){let i=(0,xn.resolve)(e),r=await t.client.hubExport(t.businessId),o=[],s=[];for(let u of r.files){if(u.path.startsWith("ledger/objects/")){let d=JSON.parse(u.content);if(to(d.xml)!==d.hash||u.path!==`ledger/objects/${d.hash}.json`)throw new Error(`The service served ${u.path} holding bytes that hash to ${to(d.xml)}. Nothing more was written; the export is incomplete.`)}let l=(0,xn.join)(i,...u.path.split("/"));if(!Vpe(i,l))throw new Error(`The service named a file at ${u.path}, which is outside the hub. Nothing more was written; the export is incomplete.`);if(s.push(l),u.path.endsWith(".code-workspace")&&(0,ki.existsSync)(l)){o.push({path:u.path,outcome:"kept"});continue}o.push({path:u.path,outcome:jo(l,u.content).outcome})}let c=qpe(i,new Set(r.files.map(u=>u.path)));return{dir:i,businessId:r.businessId,snapshot:r.snapshot,roots:r.roots,changes:r.changes,objects:r.objects,written:o,files:s,removed:c,...n.git===!0?{git:Zpe(i,r.businessId,r.snapshot)}:{}}}a(XB,"exportHub");function QB(t){let e=t.written.filter(i=>i.outcome!=="unchanged"),n=[`Exported ${t.businessId} to ${t.dir}: ${String(t.roots)} roots, ${String(t.changes)} changes, ${String(t.objects)} snapshots, ${String(t.written.length)} files.`];if(e.length===0)n.push(" This business is unchanged since the last export.");else for(let i of e)n.push(` ${i.outcome.padEnd(9)} ${i.path}`);for(let i of t.removed)n.push(` removed ${i}`);return t.git!==void 0&&n.push(` git ${t.git.says}`),n.push(" Next: commit it and push it to a private remote. `roots.local.json` and the opened"," workspace are gitignored: they are this machine\u2019s paths, not the business\u2019s."),n.join(`
|
|
341
|
+
`)}a(QB,"renderExport");var sm=require("node:fs"),Do=require("node:path");var n9=require("node:fs");var ku=30*1e3,Bpe=ku*4;function Xs(){let t=process.env.TACTICYL_MACHINE?.trim();return t!==void 0&&t.length>0?t:Ic()}a(Xs,"heartbeatName");var Kpe=a((t,e)=>{let n=setTimeout(t,e);return n.unref?.(),()=>{clearTimeout(n)}},"defaultSchedule");function e9(t,e={}){let n=e.intervalMs??ku,i=e.schedule??Kpe,r=e.now??(()=>Date.now()),o=e.machine??Xs(),s,c,u=!1,l=0,d=!1,f,p=t.roundTrips,m=a(v=>{s=v,v.ok&&v.synced&&(c=v.at),!v.ok&&v.signedOut&&(u=!0),e.onBeat?.(v)},"report");async function g(v={}){let w=v.synced??t.roundTrips>p,b=e.projections?.(),$=await t.heartbeat({machine:o,...w?{synced:!0}:{},...b===void 0?{}:{projections:b}});if(p=t.roundTrips,$.ok){l=0;let x=r();m({ok:!0,at:x,synced:w,machine:{id:$.answer.machine.id,name:$.answer.machine.name}})}else l+=1,m({ok:!1,at:r(),error:$.error,signedOut:$.signedOut});return s}a(g,"beat");function y(){if(d||u)return;let v=Math.min(n*Math.pow(2,Math.max(0,l-1)),Bpe);f=i(()=>{g().then(y,y)},v)}return a(y,"next"),g().then(y,y),{get last(){return s},get lastSyncAt(){return c},get signedOut(){return u},beat:g,stop(){d=!0,f?.()}}}a(e9,"startHeartbeat");var Hpe="You can run `tacticyl link` to link this repository to another business.";function Wpe(t,e){return e.length===0?"No agents are enrolled in this repository yet, and running tacticyl project will add them.":e.map(n=>`${n.name} (${n.files.map(i=>$i(t,i)).join(", ")})`).join(" \xB7 ")}a(Wpe,"enrolledLine");var gP=["TACTICYL.md",".mcp.json",".cursor/mcp.json",".cursor/rules/tacticyl.mdc","AGENTS.md","CLAUDE.md"];function Gpe(t){let e;for(let n of t)try{let i=(0,sm.statSync)(n).mtimeMs;(e===void 0||i>e)&&(e=i)}catch{}return e===void 0?void 0:new Date(e).toISOString()}a(Gpe,"newestMtime");function Jpe(t){return t.remote??t.share??t.via??t.provider??t.vault}a(Jpe,"rootDetail");function Ype(t,e,n){return t.map(i=>{let r=i.id===e.rootId,o=n[i.id]??(r?e.repo:void 0),s=o===void 0?void 0:(0,Do.isAbsolute)(o)?o:(0,Do.resolve)(e.repo,o),c=Jpe(i),u={id:i.id,kind:i.kind,here:r,...c===void 0?{}:{detail:c},...s===void 0?{}:{path:s}};if(i.kind==="account"||i.kind==="vault")return{...u,lastSyncWhat:"nothing on disk",ok:!0};if(s===void 0)return{...u,lastSyncWhat:"not mounted here",ok:!1,fix:`This machine has no path for "${i.id}". Add it to roots.local.json beside the workspace file, then \`tacticyl open\`.`};if(i.kind==="store")return{...u,lastSyncWhat:"not scanned yet",ok:!0};let l=Gpe(gP.map(d=>(0,Do.join)(s,d)));return{...u,...l===void 0?{}:{lastSync:l},lastSyncWhat:"projection written",ok:l!==void 0,...l===void 0?{fix:`No projection in ${s}. Run \`tacticyl project\` there so an agent starts with the map even without MCP.`}:{}}})}a(Ype,"rootStatuses");async function P$(t,e={}){let n=new Date().toISOString(),i=[],r=Is(e.linkWatch)?w4:void 0,o=await t.client.probe(),s={url:t.service,origin:t.origins.service,reachable:o.ok,...o.error===void 0?{}:{error:o.error},...o.fix===void 0?{}:{fix:o.fix},refreshes:t.client.refreshes};if(i.push({label:"service",value:`${t.service} (${t.origins.service}) \xB7 ${o.ok?"answering":"no answer"}`,ok:o.ok,...o.ok?{}:{fix:s.fix??"Your Tacticyl cloud workspace at this address did not respond. Check that it is running."}}),o.ok)try{let x=mv(await t.client.companionVersions());i.push({label:"companion",value:`${x.version} \xB7 ${x.service.minimum===x.service.current?`workspace is ${x.service.current}`:`workspace is ${x.service.current}, accepts ${x.service.minimum} or newer`}`,ok:x.standing!=="upgrade-required",...x.line.length===0?{}:{fix:x.line}})}catch{}let c,u,l=!1;if(o.ok&&Mr(t))try{c=await t.client.venture(t.businessId,{fresh:!0})}catch(x){x instanceof dt&&x.status===401&&(u=x.message),x instanceof dt&&x.code==="venture-not-found"&&(l=!0)}let d=Xpe(await Qpe(t),u);i.push({label:"sign-in",value:d.signedIn?`${d.account??"signed in"}${d.machine===void 0?"":` as ${d.machine}`} via ${d.provider}${d.expiresAt===void 0?"":` \xB7 token expires ${d.expiresAt}`}${u===void 0?"":" \xB7 your Tacticyl cloud workspace will not accept it"}`:`not signed in \xB7 ${t.client.credentials.explain}`,ok:d.ok,...d.fix===void 0?{}:{fix:d.fix}}),d.warning!==void 0&&i.push({label:"keychain",value:"file fallback",ok:!1,fix:d.warning});let f=yV();i.push({label:"error reports",value:f.value,ok:!0}),t.link===void 0?i.push({label:"link",value:`none \xB7 using defaults from ${t.origins.service==="default"?"the built-in workspace address":t.origins.service}`,ok:!1,fix:Mr(t)?`Run \`tacticyl link ${t.service} --business ${t.businessId}\` here, so every command agrees which business this repository belongs to.`:`Run \`tacticyl link ${t.service} --no-business\` here, then \`tacticyl audit\`.`}):r!==void 0?i.push({label:"link",value:r.title,ok:!1,fix:r.body}):i.push({label:"link",value:t.link.path,ok:!0}),i.push(l?{label:"business",value:`${t.businessId} \xB7 no longer in your Tacticyl cloud workspace`,ok:!1,fix:Hpe}:Mr(t)?{label:"business",value:`${t.businessId} (${t.origins.venture})`,ok:!0}:{label:"business",value:`none yet \xB7 ${Sc}`,ok:!0});let p=gP.filter(x=>(0,sm.existsSync)((0,Do.join)(t.repo,x))),m=gP.filter(x=>!p.includes(x)),g=r9(yP(t.repo),c?.snapshot,t.projectionOutcome),y={repo:t.repo,present:p,missing:m,prompts:O$(im(t.repo)),freshness:g,line:vP(g)},v=WB(t.repo);i.push({label:"agents",value:Wpe(t.repo,v),ok:!0});let w={at:n,enrolled:v,tools:Ws.map(x=>x.name),service:s,signIn:d,venture:{id:t.businessId,origin:t.origins.venture},hasBusiness:Mr(t),reporting:f,...t.link===void 0?{}:{link:{path:t.link.path,repo:t.link.repo}},projection:y,...r===void 0?{}:{reconnect:r}};if(c===void 0)return i.push({label:"root",value:`${t.rootId} (${t.origins.root}) \xB7 not checked`+(l?"":", ")+(l?"":u===void 0?"your Tacticyl cloud workspace did not answer":d.signedIn?"your Tacticyl cloud workspace would not accept this machine":"this machine is not signed in to your Tacticyl cloud workspace"),ok:!0}),{...w,lines:i,cache:t.client.cacheState(),root:{id:t.rootId,origin:t.origins.root,declared:!1},roots:[]};let b=c.venture.roots?.roots??[],$=b.some(x=>x.id===t.rootId);return i.push({label:"root",value:`${t.rootId} (${t.origins.root})${$?"":" \xB7 the business declares no such root"}`,ok:$,...$?{}:{fix:`The business's roots are ${b.map(x=>x.id).join(", ")||"none"}. Re-run \`tacticyl link\` with --root, or add this repository to the business.`}}),i.push({label:"snapshot",value:c.snapshot,ok:!0}),i.push({label:"agent files",value:y.prompts,ok:!0}),i.push({label:"projection",value:p.length===0?"not written here":`${p.join(", ")} in ${t.repo}`,ok:p.length>0,...p.length>0?{}:{fix:"Run `tacticyl project` to write TACTICYL.md and the harness config, so an agent starts with the map even without MCP."}}),i.push({label:"TACTICYL.md",value:y.line,ok:g.state!=="stale",...g.state==="stale"?{fix:"`tacticyl project` writes it again from the business as it is now."}:{}}),{...w,lines:i,cache:t.client.cacheState(),venture:{id:t.businessId,origin:t.origins.venture,name:c.venture.name},hasBusiness:!0,root:{id:t.rootId,origin:t.origins.root,declared:$},roots:Ype(b,t,ai(t.repo)),snapshot:c.snapshot}}a(P$,"collectStatus");function Xpe(t,e){if(e===void 0)return t;let n=e.includes("tacticyl login");return{...t,ok:!1,error:e,fix:n?e:t.signedIn?`${e} Run \`tacticyl login\` to sign this machine in again.`:`${e} Run \`tacticyl login\`: it opens your browser, you approve this machine, and no key is pasted anywhere.`}}a(Xpe,"withRefusal");async function Qpe(t){let e=t.client.credentials,n=await e.get(t.service).catch(()=>{}),i=await e.storage?.().catch(()=>{}),r=n?.expiresAt===void 0?void 0:Date.parse(n.expiresAt)-Date.now(),o={provider:e.name,...i?.where===void 0?{}:{storedIn:i.where},...i?.warning===void 0||n===void 0?{}:{warning:i.warning},...e.lastError===void 0?{}:{error:e.lastError}};if(n===void 0){let c=e.name==="keychain";return{...o,signedIn:!1,ok:!c,...c?{fix:"Run `tacticyl login`: it opens your browser, you approve this machine, and the token goes into the OS keychain. No key is pasted."}:{}}}let s=r!==void 0&&r<=0;return{...o,signedIn:!0,...n.account===void 0?{}:{account:n.account},...n.machine===void 0?{}:{machine:n.machine},...n.machineId===void 0?{}:{machineId:n.machineId},...n.expiresAt===void 0?{}:{expiresAt:n.expiresAt},...r===void 0?{}:{expiresInMs:r},ok:!s&&e.lastError===void 0,...s||e.lastError!==void 0?{fix:e.lastError??"This token has expired and could not be refreshed. Run `tacticyl login` to sign this machine in again."}:{}}}a(Qpe,"collectSignIn");function t9(t){let e=new Ie,n=Math.max(...t.lines.map(o=>o.label.length));for(let o of t.lines)e.add(`${o.ok?"\xB7":"!"} ${o.label.padEnd(n)} ${o.value}`),o.fix!==void 0&&e.add(` ${" ".repeat(n)} \u2192 ${o.fix}`);if(t.roots.length>0){e.blank().add("roots:");for(let o of t.roots)e.add(` ${o.ok?"\xB7":"!"} ${o.id} (${o.kind})${o.here?" \xB7 here":""} ${o.path??o.detail??""} [${o.lastSync??o.lastSyncWhat}]`),o.fix!==void 0&&e.add(` \u2192 ${o.fix}`)}let i=t.cache,r=i.ventures.map(o=>`${o.id} ${o.snapshot.slice(0,12)} (${String(o.bytes)} bytes, ${String(Math.round(o.ageMs/100)/10)}s old)`).join("; ");return e.blank().add(`cache: ${r.length===0?"empty":r} \xB7 ${String(i.hits)} hits, ${String(i.misses)} reads, ${String(i.ttlMs)}ms window`),e.add(`tools: ${t.tools.join(", ")}`),e.toString()}a(t9,"renderStatus");function yP(t){let e=(0,Do.join)(t,"TACTICYL.md");try{let n=(0,n9.readFileSync)(e,"utf8"),i=new Date((0,sm.statSync)(e).mtimeMs).toISOString();return{written:rO(n),writtenAt:i}}catch{return{written:null}}}a(yP,"readProjection");function r9(t,e,n){let i={written:t.written,...t.writtenAt===void 0?{}:{writtenAt:t.writtenAt}};if(e===void 0)return{...i,state:t.written===null?"unwritten":"unchecked"};let r=nO(t.written,e),o=r==="stale"&&n?.error!==void 0&&n.snapshot===e?{at:n.at,error:n.error}:void 0;return{...i,state:r,current:e,...o===void 0?{}:{failed:o}}}a(r9,"projectionFreshness");function hP(t){return`${t.slice(0,8)}\u2026`}a(hP,"short");function eme(t,e=Date.now()){let n=new Date(t);if(Number.isNaN(n.getTime()))return t;let i=a(c=>String(c).padStart(2,"0"),"pad"),r=`${i(n.getHours())}:${i(n.getMinutes())}`,o=new Date(e);return n.getFullYear()===o.getFullYear()&&n.getMonth()===o.getMonth()&&n.getDate()===o.getDate()?r:`${String(n.getFullYear())}-${i(n.getMonth()+1)}-${i(n.getDate())} ${r}`}a(eme,"clockOf");function vP(t,e=Date.now()){let n=t.written;if(n===null)return"Not written yet";switch(t.state){case"current":return`Projection current (snapshot ${hP(n)})`;case"stale":return t.failed===void 0?`Stale: written from snapshot ${hP(n)}, and the map has moved since`:`Stale since ${eme(t.failed.at,e)}: the map moved and the write failed: ${t.failed.error}`;default:return`This was projected from snapshot ${hP(n)} and has not been checked against your Tacticyl cloud workspace.`}}a(vP,"freshnessLine");function bP(t){if(!Mr(t))return;let e=yP(t.repo),n=t.projectionOutcome;return{businessId:t.businessId,rootId:t.rootId,written:e.written,...e.writtenAt===void 0?{}:{writtenAt:e.writtenAt},...n?.error===void 0?{}:{failed:{snapshot:n.snapshot,at:n.at,error:n.error}}}}a(bP,"projectionReport");function i9(t){let e=t.client.cacheState().ventures.find(n=>n.id===t.businessId)?.snapshot;return r9(yP(t.repo),e,t.projectionOutcome)}a(i9,"heldFreshness");async function R$(t){let e=bP(t);return e===void 0?!1:t.client.reportProjections({machine:Xs(),projections:[e]})}a(R$,"reportProjection");var u9=require("node:http");var o9=require("node:fs"),s9=require("node:path");var tme=1e3;function a9(t,e,n={}){let i,r,o=!1,s=a(async()=>{let p=Date.now();if(r!==void 0&&p-r<(n.accessEveryMs??sP))return!1;r=p;let m=await Gs(t.client,t.businessId);if(m===void 0)return!1;let g;try{g=(0,o9.readFileSync)((0,s9.join)(t.repo,"TACTICYL.md"),"utf8")}catch{return!1}return wE(g)!==m},"accessStale"),c=!1,u=a(async()=>{if(o||c)return;if(Is(n.linkWatch)){f();return}o=!0;let p;try{let m=await t.client.venture(t.businessId),g=i===void 0,y=i!==void 0&&m.snapshot!==i;i=m.snapshot;let v=await s();if(!y&&!v&&!(g&&n.initial===!0))return;p=m.snapshot;let w=await _u(t);t.projectionOutcome={snapshot:w.snapshot,at:new Date().toISOString()};let b=w.files.filter($=>$.outcome!=="unchanged");b.length>0&&e(`tacticyl serve: the projection is ${m.snapshot.slice(0,12)} \xB7 rewrote `+b.map($=>$.path).join(", "))}catch(m){let g=m instanceof Error?m.message:String(m);p!==void 0&&(t.projectionOutcome={snapshot:p,at:new Date().toISOString(),error:g}),e(`tacticyl serve: the projection could not be refreshed (${g})`)}finally{o=!1}},"tick"),l=Math.max(n.everyMs??t.client.cacheState().ttlMs,tme),d=setInterval(()=>void u(),l);d.unref?.();function f(){c=!0,clearInterval(d)}return a(f,"stop"),{tick:u,stop:f,get stopped(){return c}}}a(a9,"watchProjection");async function l9(t,e={}){let n=e.log??(m=>process.stderr.write(`${m}
|
|
342
|
+
`)),i=a(async()=>{let m=await Gs(t.client,t.businessId);return m===void 0?{}:{access:m}},"accessed"),r=a(async()=>OB({...await i(),client:t.client,businessId:t.businessId,rootId:t.rootId,repo:t.repo,...e.version===void 0?{}:{version:e.version},...e.onCall===void 0?{}:{onCall:e.onCall},...e.linkWatch===void 0?{}:{linkWatch:e.linkWatch},...e.ahead===!0?{ahead:!0}:{}}),"makeServer");e.scan!==!1&&eB(t,n),e.audit!==!1&&aB(t,n);let o=e.project===!1?void 0:a9(t,n,e.linkWatch===void 0?{}:{linkWatch:e.linkWatch});if(e.http===void 0){let m=await r();return await NB(m),n(`tacticyl serve: ${t.businessId} as ${t.rootId} from ${t.service} (stdio)`),{close:a(async()=>{o?.stop(),await m.close()},"close")}}let s=e.path??"/mcp",c=CB(r),u=e.host??"127.0.0.1",l=(0,u9.createServer)((m,g)=>{(async()=>{try{let y=ime(m.headers.host,m.headers.origin);if(y!==null){g.writeHead(403,{"content-type":"application/json"}),g.end(JSON.stringify({error:y}));return}let v=`http://${m.headers.host??u}${m.url??"/"}`;if(!(new URL(v).pathname===s)){g.writeHead(404,{"content-type":"application/json"}),g.end(JSON.stringify({error:`The MCP endpoint is ${s}.`}));return}let b=await ome(m),$=new Request(v,{method:m.method??"GET",headers:m.headers,...b===void 0?{}:{body:b}}),x=await c.handle($);g.writeHead(x.status,Object.fromEntries(x.headers)),g.end(x.body===null?void 0:Buffer.from(await x.arrayBuffer()))}catch(y){g.writeHead(500,{"content-type":"application/json"}),g.end(JSON.stringify({error:String(y)}))}})()});await new Promise(m=>l.listen(e.http,u,m));let d=l.address(),f=typeof d=="object"&&d!==null?d.port:e.http,p=`http://${u}:${String(f)}${s}`;return n(`tacticyl serve: ${t.businessId} as ${t.rootId} from ${t.service} at ${p}`),{url:p,close:a(async()=>{o?.stop(),await new Promise(m=>l.close(()=>m())),await c.close()},"close")}}a(l9,"serve");var c9=new Set(["localhost","127.0.0.1","[::1]"]);function nme(t){try{return new URL(`http://${t}/`).hostname.toLowerCase()}catch{return null}}a(nme,"hostnameOfHost");function rme(t){try{return new URL(t).hostname.toLowerCase()}catch{return null}}a(rme,"hostnameOfOrigin");function ime(t,e){let n=t===void 0?null:nme(t);if(n===null||!c9.has(n))return`This server answers on this machine only: the request was sent to "${t??""}", and it is served at localhost, 127.0.0.1 and [::1].`;let i=Array.isArray(e)?e[0]:e;if(i!==void 0){let r=rme(i);if(r===null||!c9.has(r))return`This server answers pages on this machine only: the request came from "${i}".`}return null}a(ime,"notLoopback");async function ome(t){if(t.method==="GET"||t.method==="HEAD"||t.method==="DELETE")return;let e=[];for await(let i of t)e.push(Buffer.from(i));let n=Buffer.concat(e).toString("utf8");return n.length===0?void 0:n}a(ome,"readBody");var m9=require("node:http"),h9=require("node:os");var d9=`<!doctype html>
|
|
343
|
+
<html lang="en">
|
|
344
|
+
<head>
|
|
345
|
+
<meta charset="utf-8">
|
|
346
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
347
|
+
<title>Tacticyl companion</title>
|
|
348
|
+
<style>
|
|
349
|
+
:root {
|
|
350
|
+
color-scheme: light dark;
|
|
351
|
+
--bg: #fbfbfa; --panel: #ffffff; --ink: #1c1b19; --dim: #6c6862; --line: #e4e1db;
|
|
352
|
+
--ok: #2f5d50; --bad: #8c3a2b; --warn: #7a5c17; --accent: #2f5d50;
|
|
353
|
+
--mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
|
|
354
|
+
}
|
|
355
|
+
@media (prefers-color-scheme: dark) {
|
|
356
|
+
:root {
|
|
357
|
+
--bg: #17181a; --panel: #1e2022; --ink: #eceae5; --dim: #a09b93; --line: #2f3235;
|
|
358
|
+
--ok: #7fb69f; --bad: #e08d78; --warn: #d9b45c; --accent: #7fb69f;
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
* { box-sizing: border-box; }
|
|
362
|
+
body {
|
|
363
|
+
margin: 0; background: var(--bg); color: var(--ink);
|
|
364
|
+
font: 14px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
|
|
365
|
+
}
|
|
366
|
+
main { max-width: 60rem; margin: 0 auto; padding: 1.5rem 1.25rem 4rem; }
|
|
367
|
+
header { display: flex; align-items: baseline; gap: .75rem; flex-wrap: wrap; margin-bottom: 1rem; }
|
|
368
|
+
header h1 { font-size: 1.05rem; margin: 0; font-weight: 600; }
|
|
369
|
+
header .sub { color: var(--dim); font-size: .8125rem; }
|
|
370
|
+
header .spacer { flex: 1; }
|
|
371
|
+
|
|
372
|
+
.pill {
|
|
373
|
+
font-size: .75rem; padding: .15rem .55rem; border-radius: 999px;
|
|
374
|
+
border: 1px solid var(--line); color: var(--dim); white-space: nowrap;
|
|
375
|
+
}
|
|
376
|
+
.pill.ok { color: var(--ok); border-color: currentColor; }
|
|
377
|
+
.pill.bad { color: var(--bad); border-color: currentColor; }
|
|
378
|
+
|
|
379
|
+
.banner {
|
|
380
|
+
border: 1px solid var(--bad); border-left-width: 3px; border-radius: .375rem;
|
|
381
|
+
padding: .75rem .9rem; margin-bottom: 1rem; background: var(--panel);
|
|
382
|
+
}
|
|
383
|
+
.banner strong { color: var(--bad); display: block; margin-bottom: .2rem; }
|
|
384
|
+
.banner p { margin: 0; color: var(--dim); }
|
|
385
|
+
|
|
386
|
+
section {
|
|
387
|
+
background: var(--panel); border: 1px solid var(--line); border-radius: .5rem;
|
|
388
|
+
padding: .9rem 1rem; margin-bottom: .85rem;
|
|
389
|
+
}
|
|
390
|
+
section > h2 {
|
|
391
|
+
font-size: .75rem; text-transform: uppercase; letter-spacing: .06em;
|
|
392
|
+
color: var(--dim); margin: 0 0 .6rem; font-weight: 600;
|
|
393
|
+
}
|
|
394
|
+
.row { display: flex; gap: .6rem; align-items: baseline; padding: .2rem 0; flex-wrap: wrap; }
|
|
395
|
+
.row .k { color: var(--dim); min-width: 8.5rem; font-size: .8125rem; }
|
|
396
|
+
.row .v { font-family: var(--mono); font-size: .8125rem; word-break: break-word; }
|
|
397
|
+
.fix { color: var(--warn); font-size: .8125rem; padding: .1rem 0 .35rem 9.1rem; }
|
|
398
|
+
.fix::before { content: "Fix: "; font-weight: 600; }
|
|
399
|
+
|
|
400
|
+
table { width: 100%; border-collapse: collapse; font-size: .8125rem; }
|
|
401
|
+
th {
|
|
402
|
+
text-align: left; font-weight: 600; color: var(--dim); font-size: .6875rem;
|
|
403
|
+
text-transform: uppercase; letter-spacing: .05em; padding: .3rem .5rem .3rem 0;
|
|
404
|
+
border-bottom: 1px solid var(--line);
|
|
405
|
+
}
|
|
406
|
+
td { padding: .35rem .5rem .35rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }
|
|
407
|
+
tr:last-child td { border-bottom: 0; }
|
|
408
|
+
td.mono, th.num { font-family: var(--mono); }
|
|
409
|
+
td.num, th.num { text-align: right; font-family: var(--mono); }
|
|
410
|
+
.scroll { overflow-x: auto; }
|
|
411
|
+
|
|
412
|
+
.ok { color: var(--ok); }
|
|
413
|
+
.bad { color: var(--bad); }
|
|
414
|
+
.dim { color: var(--dim); }
|
|
415
|
+
|
|
416
|
+
button {
|
|
417
|
+
font: inherit; font-size: .8125rem; padding: .35rem .8rem; border-radius: .375rem;
|
|
418
|
+
border: 1px solid var(--line); background: transparent; color: var(--ink); cursor: pointer;
|
|
419
|
+
}
|
|
420
|
+
button.primary { background: var(--accent); border-color: var(--accent); color: var(--bg); }
|
|
421
|
+
button:disabled { opacity: .5; cursor: default; }
|
|
422
|
+
.actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
|
|
423
|
+
.actions .note { color: var(--dim); font-size: .8125rem; }
|
|
424
|
+
|
|
425
|
+
pre {
|
|
426
|
+
margin: 0; max-height: 18rem; overflow: auto; font-family: var(--mono);
|
|
427
|
+
font-size: .75rem; line-height: 1.5; color: var(--dim); white-space: pre-wrap;
|
|
428
|
+
word-break: break-word;
|
|
429
|
+
}
|
|
430
|
+
pre .warn { color: var(--warn); }
|
|
431
|
+
pre .error { color: var(--bad); }
|
|
432
|
+
footer { color: var(--dim); font-size: .75rem; margin-top: 1.25rem; }
|
|
433
|
+
</style>
|
|
434
|
+
</head>
|
|
435
|
+
<body>
|
|
436
|
+
<main>
|
|
437
|
+
<header>
|
|
438
|
+
<h1>Tacticyl companion</h1>
|
|
439
|
+
<span class="sub" id="whoami"></span>
|
|
440
|
+
<span class="spacer"></span>
|
|
441
|
+
<span class="pill" id="conn">connecting</span>
|
|
442
|
+
<span class="pill" id="stamp"></span>
|
|
443
|
+
</header>
|
|
444
|
+
|
|
445
|
+
<div id="banners"></div>
|
|
446
|
+
|
|
447
|
+
<section id="liveness-section" hidden>
|
|
448
|
+
<h2>This machine, as your Tacticyl cloud workspace sees it</h2>
|
|
449
|
+
<div id="liveness"></div>
|
|
450
|
+
<div class="actions" style="margin-top:.6rem">
|
|
451
|
+
<button class="primary" id="sync">Sync now</button>
|
|
452
|
+
<span class="note" id="sync-note"></span>
|
|
453
|
+
</div>
|
|
454
|
+
</section>
|
|
455
|
+
|
|
456
|
+
<section>
|
|
457
|
+
<h2>Account</h2>
|
|
458
|
+
<div id="account"></div>
|
|
459
|
+
<div class="actions" style="margin-top:.6rem">
|
|
460
|
+
<button id="signout">Sign out</button>
|
|
461
|
+
<span class="note" id="signout-note"></span>
|
|
462
|
+
</div>
|
|
463
|
+
</section>
|
|
464
|
+
|
|
465
|
+
<section>
|
|
466
|
+
<h2>This business</h2>
|
|
467
|
+
<div id="venture"></div>
|
|
468
|
+
</section>
|
|
469
|
+
|
|
470
|
+
<section>
|
|
471
|
+
<h2>Roots</h2>
|
|
472
|
+
<div class="scroll"><table id="roots"></table></div>
|
|
473
|
+
</section>
|
|
474
|
+
|
|
475
|
+
<section>
|
|
476
|
+
<h2>Test sync</h2>
|
|
477
|
+
<div class="actions">
|
|
478
|
+
<button class="primary" id="test">Test sync</button>
|
|
479
|
+
<span class="note" id="test-note">Round-trips a locate call and a projection dry run.</span>
|
|
480
|
+
</div>
|
|
481
|
+
<div class="scroll" style="margin-top:.6rem"><table id="test-out"></table></div>
|
|
482
|
+
</section>
|
|
483
|
+
|
|
484
|
+
<section>
|
|
485
|
+
<h2>MCP calls served</h2>
|
|
486
|
+
<div class="scroll"><table id="calls"></table></div>
|
|
487
|
+
</section>
|
|
488
|
+
|
|
489
|
+
<section>
|
|
490
|
+
<h2>Log</h2>
|
|
491
|
+
<pre id="log"></pre>
|
|
492
|
+
</section>
|
|
493
|
+
|
|
494
|
+
<footer id="footer"></footer>
|
|
495
|
+
</main>
|
|
496
|
+
|
|
497
|
+
<script>
|
|
498
|
+
(function () {
|
|
499
|
+
'use strict';
|
|
500
|
+
var POLL_MS = __POLL_MS__;
|
|
501
|
+
var byId = function (id) { return document.getElementById(id); };
|
|
502
|
+
|
|
503
|
+
function el(tag, className, text) {
|
|
504
|
+
var node = document.createElement(tag);
|
|
505
|
+
if (className) node.className = className;
|
|
506
|
+
if (text !== undefined && text !== null) node.textContent = String(text);
|
|
507
|
+
return node;
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
function clear(node) { while (node.firstChild) node.removeChild(node.firstChild); }
|
|
511
|
+
|
|
512
|
+
function row(parent, key, value, className) {
|
|
513
|
+
var line = el('div', 'row');
|
|
514
|
+
line.appendChild(el('span', 'k', key));
|
|
515
|
+
line.appendChild(el('span', 'v ' + (className || ''), value));
|
|
516
|
+
parent.appendChild(line);
|
|
517
|
+
return line;
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
function fix(parent, sentence) {
|
|
521
|
+
if (!sentence) return;
|
|
522
|
+
parent.appendChild(el('div', 'fix', sentence));
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
function ago(iso) {
|
|
526
|
+
if (!iso) return 'not yet';
|
|
527
|
+
var ms = Date.now() - Date.parse(iso);
|
|
528
|
+
if (!isFinite(ms)) return String(iso);
|
|
529
|
+
if (ms < 0) ms = 0;
|
|
530
|
+
var s = Math.round(ms / 1000);
|
|
531
|
+
if (s < 60) return s + 's ago';
|
|
532
|
+
var m = Math.round(s / 60);
|
|
533
|
+
if (m < 60) return m + 'm ago';
|
|
534
|
+
var h = Math.round(m / 60);
|
|
535
|
+
if (h < 48) return h + 'h ago';
|
|
536
|
+
return Math.round(h / 24) + 'd ago';
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
function inWords(ms) {
|
|
540
|
+
if (ms === undefined || ms === null) return 'no expiry given';
|
|
541
|
+
if (ms <= 0) return 'expired';
|
|
542
|
+
var s = Math.round(ms / 1000);
|
|
543
|
+
if (s < 90) return 'in ' + s + 's';
|
|
544
|
+
var m = Math.round(s / 60);
|
|
545
|
+
if (m < 90) return 'in ' + m + ' min';
|
|
546
|
+
return 'in ' + Math.round(m / 60) + 'h';
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
function head(table, names) {
|
|
550
|
+
var tr = el('tr');
|
|
551
|
+
for (var i = 0; i < names.length; i += 1) tr.appendChild(el('th', '', names[i]));
|
|
552
|
+
table.appendChild(tr);
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
function cell(tr, text, className) { tr.appendChild(el('td', className || '', text)); return tr; }
|
|
556
|
+
|
|
557
|
+
// -- banners ---------------------------------------------------------------------------------
|
|
558
|
+
|
|
559
|
+
function banner(title, sentence) {
|
|
560
|
+
var box = el('div', 'banner');
|
|
561
|
+
box.appendChild(el('strong', '', title));
|
|
562
|
+
box.appendChild(el('p', '', sentence));
|
|
563
|
+
byId('banners').appendChild(box);
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
// -- rendering -------------------------------------------------------------------------------
|
|
567
|
+
|
|
568
|
+
var lastGood = null;
|
|
569
|
+
|
|
570
|
+
function renderUnreachable(why) {
|
|
571
|
+
byId('conn').textContent = 'companion not answering';
|
|
572
|
+
byId('conn').className = 'pill bad';
|
|
573
|
+
clear(byId('banners'));
|
|
574
|
+
banner(
|
|
575
|
+
'This page cannot reach the companion',
|
|
576
|
+
'The companion that serves this page has stopped (' + why + '). Start it again with ' +
|
|
577
|
+
'"tacticyl status --open" or "tacticyl serve", then reload this page.'
|
|
578
|
+
);
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
function render(data) {
|
|
582
|
+
lastGood = data;
|
|
583
|
+
var report = data.report;
|
|
584
|
+
var service = report.service;
|
|
585
|
+
|
|
586
|
+
byId('whoami').textContent = data.machine + ' \\u00b7 tacticyl ' + data.version;
|
|
587
|
+
byId('stamp').textContent = 'checked ' + ago(data.at);
|
|
588
|
+
byId('conn').textContent = service.reachable ? 'Tacticyl cloud workspace reachable' : 'cannot reach your Tacticyl cloud workspace';
|
|
589
|
+
byId('conn').className = 'pill ' + (service.reachable ? 'ok' : 'bad');
|
|
590
|
+
|
|
591
|
+
clear(byId('banners'));
|
|
592
|
+
// The link this companion started with changed or went. The one banner that matters.
|
|
593
|
+
if (report.reconnect) banner(report.reconnect.title, report.reconnect.body);
|
|
594
|
+
if (!service.reachable) {
|
|
595
|
+
banner(
|
|
596
|
+
'Cannot reach your Tacticyl cloud workspace at ' + service.url,
|
|
597
|
+
(service.error || 'It did not answer.') + ' ' + (service.fix || '')
|
|
598
|
+
);
|
|
599
|
+
}
|
|
600
|
+
if (report.signIn.warning) banner('The token is not in a keychain', report.signIn.warning);
|
|
601
|
+
if (data.error) banner('The companion could not gather its own status', data.error);
|
|
602
|
+
|
|
603
|
+
// -- liveness ------------------------------------------------------------------------------
|
|
604
|
+
// The three facts the tray shows, in the same words: whether the service has heard from this
|
|
605
|
+
// machine, when it last did, and when work last went through. The tray and this page read one
|
|
606
|
+
// Presence, so they cannot disagree.
|
|
607
|
+
var liveness = data.liveness;
|
|
608
|
+
byId('liveness-section').hidden = !liveness;
|
|
609
|
+
if (liveness) {
|
|
610
|
+
var live = byId('liveness');
|
|
611
|
+
clear(live);
|
|
612
|
+
var connected = liveness.condition === 'connected' || liveness.condition === 'syncing';
|
|
613
|
+
row(live, 'connection', liveness.status, connected ? 'ok' : 'bad');
|
|
614
|
+
if (liveness.detail) fix(live, liveness.detail);
|
|
615
|
+
row(live, 'last heard', liveness.lastHeardAt ? ago(liveness.lastHeardAt) : 'not yet',
|
|
616
|
+
connected ? 'ok' : 'bad');
|
|
617
|
+
row(live, 'last synced', liveness.lastSyncAt ? ago(liveness.lastSyncAt) : 'nothing yet');
|
|
618
|
+
row(live, 'heartbeat', 'every ' + Math.round(liveness.intervalMs / 1000)
|
|
619
|
+
+ 's, and the service calls this machine stale after two of those', 'dim');
|
|
620
|
+
// The row names the command: someone reading this page because the companion is invisible
|
|
621
|
+
// is exactly who wants the icon.
|
|
622
|
+
row(live, 'tray', liveness.tray === 'tray'
|
|
623
|
+
? 'an icon is in the system tray (tacticyl tray)'
|
|
624
|
+
: (liveness.trayWhy || 'no icon on this machine') + ' tacticyl tray puts one up',
|
|
625
|
+
liveness.tray === 'tray' ? '' : 'dim');
|
|
626
|
+
byId('sync').disabled = liveness.condition === 'signed-out';
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
// -- account -------------------------------------------------------------------------------
|
|
630
|
+
var account = byId('account');
|
|
631
|
+
clear(account);
|
|
632
|
+
var s = report.signIn;
|
|
633
|
+
row(account, 'account', s.signedIn ? (s.account || 'signed in') : 'not signed in',
|
|
634
|
+
s.signedIn ? 'ok' : 'dim');
|
|
635
|
+
row(account, 'machine', s.machine || data.machine);
|
|
636
|
+
row(account, 'credentials', (s.storedIn || s.provider) + ' (' + s.provider + ')');
|
|
637
|
+
if (s.signedIn) {
|
|
638
|
+
row(account, 'token expires', inWords(s.expiresInMs) + (s.expiresAt ? ' (' + s.expiresAt + ')' : ''),
|
|
639
|
+
(s.expiresInMs !== undefined && s.expiresInMs <= 0) ? 'bad' : '');
|
|
640
|
+
row(account, 'refreshed after 401',
|
|
641
|
+
String(service.refreshes) + (service.refreshes === 1 ? ' time' : ' times') + ' this session',
|
|
642
|
+
'dim');
|
|
643
|
+
}
|
|
644
|
+
if (s.error) row(account, 'last refresh', s.error, 'bad');
|
|
645
|
+
// Whether errors are being sent as they happen (tacticyl report on), the same words as
|
|
646
|
+
// tacticyl status.
|
|
647
|
+
if (report.reporting) row(account, 'error reports', report.reporting.value, report.reporting.on ? '' : 'dim');
|
|
648
|
+
fix(account, s.ok ? null : s.fix);
|
|
649
|
+
byId('signout').disabled = !s.signedIn;
|
|
650
|
+
byId('signout-note').textContent = s.signedIn
|
|
651
|
+
? 'Revokes this machine on the service and clears the credential store.'
|
|
652
|
+
: 'Nothing to sign out. Run "tacticyl login" in a terminal to sign in.';
|
|
653
|
+
|
|
654
|
+
// -- venture -------------------------------------------------------------------------------
|
|
655
|
+
var venture = byId('venture');
|
|
656
|
+
clear(venture);
|
|
657
|
+
row(venture, 'service', service.url + ' (' + service.origin + ')',
|
|
658
|
+
service.reachable ? 'ok' : 'bad');
|
|
659
|
+
if (!service.reachable) fix(venture, service.fix);
|
|
660
|
+
// A repository linked with no business yet is not a fault, so the row is plain and it says
|
|
661
|
+
// which command is next.
|
|
662
|
+
if (report.hasBusiness === false) {
|
|
663
|
+
row(venture, 'business', 'none yet', 'dim');
|
|
664
|
+
fix(venture, 'No business here yet. Run tacticyl audit and Tacticyl will draft one from the code.');
|
|
665
|
+
} else {
|
|
666
|
+
row(venture, 'business', report.venture.id + (report.venture.name ? ' ' + report.venture.name : '')
|
|
667
|
+
+ ' (' + report.venture.origin + ')');
|
|
668
|
+
}
|
|
669
|
+
row(venture, 'root', report.root.id + ' (' + report.root.origin + ')'
|
|
670
|
+
+ (report.root.declared ? '' : ' not declared by the business'),
|
|
671
|
+
report.root.declared ? '' : 'bad');
|
|
672
|
+
row(venture, 'link', report.link ? report.link.path : 'none \xB7 this directory is not linked',
|
|
673
|
+
report.link ? '' : 'dim');
|
|
674
|
+
row(venture, 'snapshot', report.snapshot || 'not read');
|
|
675
|
+
row(venture, 'projection', report.projection.present.length
|
|
676
|
+
? report.projection.present.join(', ')
|
|
677
|
+
: 'not written in ' + report.projection.repo,
|
|
678
|
+
report.projection.present.length ? '' : 'dim');
|
|
679
|
+
// The line tacticyl status says, and the word Account says from the heartbeat.
|
|
680
|
+
if (report.projection.line) {
|
|
681
|
+
row(venture, 'TACTICYL.md', report.projection.line,
|
|
682
|
+
report.projection.freshness && report.projection.freshness.state === 'stale' ? 'bad' : '');
|
|
683
|
+
}
|
|
684
|
+
// Whether Tacticyl keeps a section in this repository's own agent files
|
|
685
|
+
// current. Asked once by tacticyl project; said here so the two surfaces agree.
|
|
686
|
+
row(venture, 'agent files', report.projection.prompts, '');
|
|
687
|
+
for (var li = 0; li < report.lines.length; li += 1) {
|
|
688
|
+
if (!report.lines[li].ok && report.lines[li].fix) fix(venture, report.lines[li].fix);
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
// -- roots ---------------------------------------------------------------------------------
|
|
692
|
+
var roots = byId('roots');
|
|
693
|
+
clear(roots);
|
|
694
|
+
head(roots, ['root', 'kind', 'where', 'last sync', '']);
|
|
695
|
+
if (!report.roots.length) {
|
|
696
|
+
var none = el('tr');
|
|
697
|
+
cell(none, service.reachable ? 'Declare a root, and it appears here.' : 'Not read: your Tacticyl cloud workspace did not answer.', 'dim');
|
|
698
|
+
roots.appendChild(none);
|
|
699
|
+
}
|
|
700
|
+
for (var ri = 0; ri < report.roots.length; ri += 1) {
|
|
701
|
+
var r = report.roots[ri];
|
|
702
|
+
var tr = el('tr');
|
|
703
|
+
cell(tr, r.id + (r.here ? ' (here)' : ''), 'mono');
|
|
704
|
+
cell(tr, r.kind, 'dim');
|
|
705
|
+
cell(tr, r.path || r.detail || '-', 'mono');
|
|
706
|
+
cell(tr, r.lastSync ? ago(r.lastSync) : r.lastSyncWhat, r.ok ? '' : 'bad');
|
|
707
|
+
cell(tr, r.fix || '', 'dim');
|
|
708
|
+
roots.appendChild(tr);
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
// -- calls ---------------------------------------------------------------------------------
|
|
712
|
+
var calls = byId('calls');
|
|
713
|
+
clear(calls);
|
|
714
|
+
head(calls, ['when', 'tool', 'harness', 'arguments', 'ms', '']);
|
|
715
|
+
if (!data.calls.length) {
|
|
716
|
+
var empty = el('tr');
|
|
717
|
+
cell(empty, 'Point Claude Code or Cursor at this repository, and its calls appear here.', 'dim');
|
|
718
|
+
calls.appendChild(empty);
|
|
719
|
+
}
|
|
720
|
+
for (var ci = 0; ci < data.calls.length; ci += 1) {
|
|
721
|
+
var c = data.calls[ci];
|
|
722
|
+
var ctr = el('tr');
|
|
723
|
+
cell(ctr, ago(c.at), 'dim');
|
|
724
|
+
cell(ctr, c.tool, 'mono');
|
|
725
|
+
cell(ctr, c.harness, 'mono');
|
|
726
|
+
cell(ctr, c.args, 'mono');
|
|
727
|
+
cell(ctr, String(c.ms), 'num');
|
|
728
|
+
cell(ctr, c.ok ? 'ok' : (c.error || 'failed'), c.ok ? 'ok' : 'bad');
|
|
729
|
+
calls.appendChild(ctr);
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
// -- log -----------------------------------------------------------------------------------
|
|
733
|
+
var log = byId('log');
|
|
734
|
+
clear(log);
|
|
735
|
+
for (var gi = 0; gi < data.log.length; gi += 1) {
|
|
736
|
+
var entry = data.log[gi];
|
|
737
|
+
log.appendChild(el('div', entry.level === 'info' ? '' : entry.level,
|
|
738
|
+
entry.at.slice(11, 19) + ' ' + entry.line));
|
|
739
|
+
}
|
|
740
|
+
if (!data.log.length) log.appendChild(el('div', '', 'This log is empty, and any new lines from the companion will appear here.'));
|
|
741
|
+
log.scrollTop = log.scrollHeight;
|
|
742
|
+
|
|
743
|
+
byId('footer').textContent =
|
|
744
|
+
'Cache: ' + report.cache.hits + ' hits, ' + report.cache.misses + ' reads, '
|
|
745
|
+
+ report.cache.ttlMs + 'ms window. Tools: ' + report.tools.join(', ') + '.';
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
// -- polling ---------------------------------------------------------------------------------
|
|
749
|
+
|
|
750
|
+
function poll() {
|
|
751
|
+
fetch('/status.json', { headers: { accept: 'application/json' } })
|
|
752
|
+
.then(function (answer) {
|
|
753
|
+
if (!answer.ok) throw new Error('status.json answered ' + answer.status);
|
|
754
|
+
return answer.json();
|
|
755
|
+
})
|
|
756
|
+
.then(render)
|
|
757
|
+
.catch(function (cause) { renderUnreachable(cause.message || String(cause)); });
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
// -- the two buttons -------------------------------------------------------------------------
|
|
761
|
+
|
|
762
|
+
byId('test').addEventListener('click', function () {
|
|
763
|
+
var button = byId('test');
|
|
764
|
+
var out = byId('test-out');
|
|
765
|
+
button.disabled = true;
|
|
766
|
+
byId('test-note').textContent = 'Running\u2026';
|
|
767
|
+
clear(out);
|
|
768
|
+
fetch('/test-sync', { method: 'POST' })
|
|
769
|
+
.then(function (answer) { return answer.json(); })
|
|
770
|
+
.then(function (result) {
|
|
771
|
+
head(out, ['step', 'ms', 'result', '']);
|
|
772
|
+
for (var i = 0; i < result.steps.length; i += 1) {
|
|
773
|
+
var step = result.steps[i];
|
|
774
|
+
var tr = el('tr');
|
|
775
|
+
cell(tr, step.name, 'mono');
|
|
776
|
+
cell(tr, String(step.ms), 'num');
|
|
777
|
+
cell(tr, step.detail, step.ok ? '' : 'bad');
|
|
778
|
+
cell(tr, step.fix || '', 'dim');
|
|
779
|
+
out.appendChild(tr);
|
|
780
|
+
}
|
|
781
|
+
byId('test-note').textContent =
|
|
782
|
+
(result.ok ? 'Round trip complete' : 'Round trip failed') + ' in ' + result.ms + 'ms.';
|
|
783
|
+
})
|
|
784
|
+
.catch(function (cause) {
|
|
785
|
+
byId('test-note').textContent =
|
|
786
|
+
'The companion did not answer (' + (cause.message || cause) + '). ' +
|
|
787
|
+
'Start it again with "tacticyl status --open".';
|
|
788
|
+
})
|
|
789
|
+
.then(function () { button.disabled = false; poll(); });
|
|
790
|
+
});
|
|
791
|
+
|
|
792
|
+
byId('sync').addEventListener('click', function () {
|
|
793
|
+
var button = byId('sync');
|
|
794
|
+
button.disabled = true;
|
|
795
|
+
byId('sync-note').textContent = 'Syncing\u2026';
|
|
796
|
+
fetch('/sync-now', { method: 'POST' })
|
|
797
|
+
.then(function (answer) { return answer.json(); })
|
|
798
|
+
.then(function (result) { byId('sync-note').textContent = result.detail; })
|
|
799
|
+
.catch(function (cause) {
|
|
800
|
+
byId('sync-note').textContent =
|
|
801
|
+
'The companion did not answer (' + (cause.message || cause) + ').';
|
|
802
|
+
})
|
|
803
|
+
.then(function () { button.disabled = false; poll(); });
|
|
804
|
+
});
|
|
805
|
+
|
|
806
|
+
byId('signout').addEventListener('click', function () {
|
|
807
|
+
if (!window.confirm('Sign this machine out? The service revokes it, and the token is removed from this machine.')) return;
|
|
808
|
+
var button = byId('signout');
|
|
809
|
+
button.disabled = true;
|
|
810
|
+
byId('signout-note').textContent = 'Signing out\u2026';
|
|
811
|
+
fetch('/sign-out', { method: 'POST' })
|
|
812
|
+
.then(function (answer) { return answer.json(); })
|
|
813
|
+
.then(function (result) {
|
|
814
|
+
byId('signout-note').textContent = result.error
|
|
815
|
+
? result.error
|
|
816
|
+
: (result.wasSignedIn
|
|
817
|
+
? 'Signed out. Run "tacticyl login" to sign in again.'
|
|
818
|
+
: 'There was nothing signed in.');
|
|
819
|
+
})
|
|
820
|
+
.catch(function (cause) {
|
|
821
|
+
byId('signout-note').textContent = 'The companion did not answer (' + (cause.message || cause) + ').';
|
|
822
|
+
})
|
|
823
|
+
.then(poll);
|
|
824
|
+
});
|
|
825
|
+
|
|
826
|
+
poll();
|
|
827
|
+
setInterval(poll, POLL_MS);
|
|
828
|
+
setInterval(function () { if (lastGood) byId('stamp').textContent = 'checked ' + ago(lastGood.at); }, 1000);
|
|
829
|
+
})();
|
|
830
|
+
</script>
|
|
831
|
+
</body>
|
|
832
|
+
</html>
|
|
833
|
+
`.replace("__POLL_MS__",String(3e3));var f9=require("node:fs"),p9=require("node:path");function sme(t,e){let n=t.index.filter(o=>o.depth===2),r=n.find(o=>{let s=o.node.home;return Array.isArray(s)&&s.some(c=>c.root===e)})??n[0];return r===void 0?void 0:t.refs.get(r.path)}a(sme,"knownRef");async function j$(t,e={}){let n=new Date().toISOString(),i=Date.now(),r=[],o=Date.now(),s;try{t.client.forget(),s=await t.client.venture(t.businessId,{fresh:!0}),r.push({name:"read the map",ok:!0,ms:Date.now()-o,detail:`${String(Buffer.byteLength(s.xml,"utf8"))} bytes, snapshot ${s.snapshot.slice(0,12)}`})}catch(p){return r.push({name:"read the map",ok:!1,ms:Date.now()-o,detail:p instanceof Error?p.message:String(p),fix:`The companion could not read ${t.businessId} from your Tacticyl cloud workspace at ${t.service}. Check that your workspace is running, or run \`tacticyl status\` to see which workspace this repository is linked to.`}),{at:n,ok:!1,ms:Date.now()-i,steps:r}}let c=e.ref??sme(s.graph,t.rootId),u=EB("locate"),l=Date.now();if(c===void 0||u===void 0)r.push({name:"locate",ok:!1,ms:0,detail:"there is no node to locate",fix:`${t.businessId} has no nodes yet, so there is nothing for an agent to look up. Create one in the app, or check that --business names the venture you meant.`});else try{let p=await u.run({client:t.client,businessId:t.businessId,rootId:t.rootId,harness:"venture-status"},{ref:c});r.push({name:`locate ${c}`,ok:!0,ms:Date.now()-l,detail:`${String(p.split(`
|
|
834
|
+
`).length)} lines, ${String(Buffer.byteLength(p,"utf8"))} bytes \xB7 ${cme(p)}`})}catch(p){r.push({name:`locate ${c}`,ok:!1,ms:Date.now()-l,detail:p instanceof Error?p.message:String(p),fix:"Your Tacticyl cloud workspace answered for the map but not for the locate route. Check that your workspace is the version this companion expects; `tacticyl status` prints both."})}let d=e.dir??t.repo,f=Date.now();try{let p=fP(t,s.graph,s.snapshot),m=N$(d,t.businessId,p,!0,[],t.rootId),g=m.filter(y=>ame(y.path)!==y.content);r.push({name:"projection (dry run)",ok:!0,ms:Date.now()-f,detail:g.length===0?`all ${String(m.length)} files in ${d} are up to date`:`${String(g.length)} of ${String(m.length)} would change: ${g.map(y=>(0,p9.relative)(d,y.path)||y.path).join(", ")}`})}catch(p){r.push({name:"projection (dry run)",ok:!1,ms:Date.now()-f,detail:p instanceof Error?p.message:String(p),fix:"The map could not be rendered for this repository. Check that --root names a root the venture declares; `tacticyl status` says which it does."})}return{at:n,ok:r.every(p=>p.ok),ms:Date.now()-i,...c===void 0?{}:{ref:c},steps:r}}a(j$,"testSync");function ame(t){try{return(0,f9.readFileSync)(t,"utf8")}catch{return""}}a(ame,"readOrEmpty");function cme(t){let e=t.split(`
|
|
835
|
+
`).find(n=>n.trim().length>0)??"";return e.length>80?`${e.slice(0,79)}\u2026`:e}a(cme,"firstLine");var lme=8788,dme=new Set(["127.0.0.1","localhost","[::1]","::1"]);function fme(t,e,n){let i=t.headers.host??"",r=i.includes(":")?i.slice(0,i.lastIndexOf(":")):i,o=i.includes(":")?i.slice(i.lastIndexOf(":")+1):"";if(!dme.has(r)||o!==String(e))return!1;if(n==="GET")return!0;let s=t.headers["sec-fetch-site"];return s===void 0||s==="same-origin"||s==="none"}a(fme,"fromThisPage");function g9(t,e,n,i){t.writeHead(e,{"content-type":n,"cache-control":"no-store","content-security-policy":"default-src 'none'; style-src 'unsafe-inline'; script-src 'unsafe-inline'; connect-src 'self'","x-content-type-options":"nosniff","referrer-policy":"no-referrer"}),t.end(i)}a(g9,"send");function xi(t,e,n){g9(t,e,"application/json; charset=utf-8",JSON.stringify(n))}a(xi,"sendJson");async function pme(t,e={}){let n=(0,h9.hostname)(),i=e.version??"0.0.0",r=e.journal,o={at:new Date().toISOString(),version:i,machine:n,uptimeMs:r?.uptimeMs??0,pollMs:3e3,calls:r?.calls()??[],log:r?.lines(120)??[],...(()=>{let s=e.presence?.()?.liveness();return s===void 0?{}:{liveness:s}})()};try{return{...o,report:await P$(t,e.linkWatch===void 0?{}:{linkWatch:e.linkWatch})}}catch(s){let c=s instanceof Error?s.message:String(s);return r?.note(`status: ${c}`,"error"),{...o,error:`${c} Run \`tacticyl status\` in a terminal for the same report with the failure in full.`,report:mme(t,c)}}}a(pme,"statusPayload");function mme(t,e){return{at:new Date().toISOString(),lines:[{label:"status",value:e,ok:!1,fix:"Run `tacticyl status --debug` in a terminal: it prints the same report and the stack behind this."}],cache:{ventures:[],hits:0,misses:0,ttlMs:0},tools:[],service:{url:t.service,origin:t.origins.service,reachable:!1,error:e,fix:"Run `tacticyl status --debug` in a terminal for the failure in full.",refreshes:0},signIn:{provider:t.client.credentials.name,signedIn:!1,ok:!1},venture:{id:t.businessId,origin:t.origins.venture},root:{id:t.rootId,origin:t.origins.root,declared:!1},roots:[],projection:{repo:t.repo,present:[],missing:[],prompts:lP}}}a(mme,"emptyStatus");async function am(t,e={}){let n=e.host??"127.0.0.1",i=e.journal,r=e.log??(u=>process.stderr.write(`${u}
|
|
836
|
+
`)),o=0,s=(0,m9.createServer)((u,l)=>{(async()=>{let d=u.method==="POST"?"POST":"GET",f=new URL(u.url??"/","http://companion").pathname;if(!fme(u,o,d)){xi(l,403,{error:`This is the Tacticyl companion's status page, and it only answers requests from itself at 127.0.0.1:${String(o)}. Open that address directly.`});return}try{if(d==="GET"&&(f==="/"||f==="/index.html")){g9(l,200,"text/html; charset=utf-8",d9);return}if(d==="GET"&&f==="/health"){xi(l,200,{ok:!0,port:o});return}if(d==="GET"&&f==="/status.json"){xi(l,200,await pme(t,{...i===void 0?{}:{journal:i},...e.version===void 0?{}:{version:e.version},...e.presence===void 0?{}:{presence:e.presence},...e.linkWatch===void 0?{}:{linkWatch:e.linkWatch}}));return}if(d==="POST"&&f==="/test-sync"){let p=await j$(t);i?.note(`test sync: ${p.ok?"ok":"failed"} in ${String(p.ms)}ms`,p.ok?"info":"warn"),xi(l,200,p);return}if(d==="POST"&&f==="/sync-now"){let p=e.presence?.();if(p===void 0){xi(l,200,{ok:!1,ms:0,detail:"This process is not running a heartbeat. Both `tacticyl serve` and `tacticyl tray` run one. `tacticyl status --open` serves this page and nothing else."});return}xi(l,200,await p.syncNow());return}if(d==="POST"&&f==="/sign-out"){let p=await yo({service:t.service,credentials:t.client.credentials,fetch:t.client.fetcher});i?.note(p.wasSignedIn?`signed out ${p.machine??"this machine"}${p.revoked?"":" (your Tacticyl cloud workspace was not told)"}`:"You are not signed in.",p.revoked||!p.wasSignedIn?"info":"warn"),xi(l,200,p);return}xi(l,404,{error:`The status page has no ${f}. It is / , /status.json, /test-sync, /sync-now and /sign-out.`})}catch(p){let m=p instanceof Error?p.message:String(p);i?.note(`status page: ${m}`,"error"),xi(l,500,{error:m,fix:"Run the same thing from a terminal (`tacticyl status`, `tacticyl project`) to see it in full."})}})()});o=await hme(s,n,e.port??lme);let c=`http://${n}:${String(o)}/`;return i?.note(`status page at ${c}`),r(`tacticyl status: ${c}`),e.open===!0&&!Yf(c)&&r(" (no browser here; open that address yourself.)"),{url:c,port:o,close:a(()=>new Promise(u=>s.close(()=>u())),"close")}}a(am,"startStatusServer");async function hme(t,e,n){let i=a(s=>new Promise(c=>{let u=a(d=>{t.removeListener("listening",l),c(d.code==="EADDRINUSE"?void 0:0)},"failed"),l=a(()=>{t.removeListener("error",u);let d=t.address();c(typeof d=="object"&&d!==null?d.port:s)},"ok");t.once("error",u),t.once("listening",l),t.listen(s,e)}),"attempt"),r=await i(n);if(r!==void 0&&r!==0)return r;let o=await i(0);if(o===void 0||o===0)throw new Error(`The companion could not listen on ${e}: neither port ${String(n)} nor an ephemeral one. Something is blocking loopback sockets on this machine.`);return o}a(hme,"bind");var C9=require("node:child_process"),P9=require("node:fs"),R9=require("node:path");var Ln=require("node:fs"),v9=require("node:fs"),b9=require("node:module"),w9=require("node:os"),Qs=require("node:path");function gme(t=process.platform){return t==="win32"?"tray_windows_release.exe":t==="darwin"?"tray_darwin_release":"tray_linux_release"}a(gme,"helperName");function y9(t){try{return(0,v9.accessSync)(t,Ln.constants.X_OK),!0}catch{return!1}}a(y9,"runnable");function $9(t={}){let e=t.platform??process.platform,n=gme(e),i,r;try{let c=(t.resolve??(0,b9.createRequire)(__tacticyl_import_meta_url).resolve)("systray2/package.json");i=(0,Qs.join)((0,Qs.dirname)(c),"traybin",n),r=JSON.parse((0,Ln.readFileSync)(c,"utf8")).version??"0"}catch{return{why:"No tray helper is installed with this companion."}}if(!(0,Ln.existsSync)(i))return{why:`The tray helper for ${e} is not in this installation.`};if(e==="win32")return{path:i};if(y9(i))return{path:i};let o=(0,Qs.join)(t.cache??(0,Qs.join)((0,w9.homedir)(),".cache","node-systray"),r,n);try{return(0,Ln.existsSync)(o)||((0,Ln.mkdirSync)((0,Qs.dirname)(o),{recursive:!0}),(0,Ln.copyFileSync)(i,o)),y9(o)||(0,Ln.chmodSync)(o,493),{path:o}}catch(s){return{why:`The tray helper could not be made runnable (${s instanceof Error?s.message:String(s)}).`}}}a($9,"prepareHelper");var _9={kind:"dot",x:9,y:23,r:3.2},k9={kind:"ring",x:23,y:9,r:5,width:3.2},x9={kind:"stroke",x1:9,y1:23,x2:20.6,y2:11.4,width:3.2},yme={kind:"dot",x:23,y:9,r:1.7};function S9(t="active"){return t==="syncing"?[_9,x9,k9,yme]:[_9,x9,k9]}a(S9,"glyphParts");function I9(t="active"){return t==="stale"?.4:1}a(I9,"glyphOpacity");function vme(t,e,n,i,r,o){let s=r-n,c=o-i,u=s*s+c*c,l=u===0?0:Math.max(0,Math.min(1,((t-n)*s+(e-i)*c)/u));return Math.hypot(t-(n+l*s),e-(i+l*c))}a(vme,"toSegment");function bme(t,e,n){return t.kind==="dot"?Math.hypot(e-t.x,n-t.y)-t.r:t.kind==="ring"?Math.abs(Math.hypot(e-t.x,n-t.y)-t.r)-t.width/2:vme(e,n,t.x1,t.y1,t.x2,t.y2)-t.width/2}a(bme,"outside");function E9(t,e,n){let i=0;for(let r of t)if(i=Math.max(i,Math.min(1,Math.max(0,.5-bme(r,e,n)))),i>=1)return 1;return i}a(E9,"glyphCoverage");function wme(t=process.platform){return t==="darwin"?"dark":"light"}a(wme,"toneFor");function T9(t=process.platform){return t==="darwin"}a(T9,"isTemplate");function $me(t,e,n=32){let i=S9(t),r=I9(t),o=e==="dark"?0:255,s=32/n,c=new Uint8Array(n*n*2);for(let u=0;u<n;u+=1)for(let l=0;l<n;l+=1){let d=E9(i,(l+.5)*s,(u+.5)*s),f=(u*n+l)*2;c[f]=o,c[f+1]=Math.round(d*r*255)}return c}a($me,"glyphMask");var _me=(()=>{let t=new Uint32Array(256);for(let e=0;e<256;e+=1){let n=e;for(let i=0;i<8;i+=1)n=n&1?3988292384^n>>>1:n>>>1;t[e]=n>>>0}return t})();function kme(t){let e=4294967295;for(let n of t)e=_me[(e^n)&255]^e>>>8;return(e^4294967295)>>>0}a(kme,"crc32");function xme(t){let e=1,n=0;for(let i of t)e=(e+i)%65521,n=(n+e)%65521;return(n<<16|e)>>>0}a(xme,"adler32");function um(t){return Uint8Array.from([t>>>24&255,t>>>16&255,t>>>8&255,t&255])}a(um,"u32");function Lo(t){let e=new Uint8Array(t.reduce((i,r)=>i+r.length,0)),n=0;for(let i of t)e.set(i,n),n+=i.length;return e}a(Lo,"join");function wP(t,e){let n=Uint8Array.from([...t].map(r=>r.charCodeAt(0))),i=Lo([n,e]);return Lo([um(e.length),i,um(kme(i))])}a(wP,"chunk");function Sme(t){let e=[];for(let i=0;i<t.length||i===0;i+=65535){let r=t.subarray(i,Math.min(i+65535,t.length)),o=i+65535>=t.length?1:0,s=r.length;if(e.push(Uint8Array.from([o,s&255,s>>>8&255,~s&255,~s>>>8&255]),r),o===1)break}return Lo([Uint8Array.from([120,1]),...e,um(xme(t))])}a(Sme,"zlibStored");var Ime=Uint8Array.from([137,80,78,71,13,10,26,10]);function Eme(t,e,n=32){let i=$me(t,e,n),r=new Uint8Array(n*(1+n*2));for(let s=0;s<n;s+=1)r[s*(1+n*2)]=0,r.set(i.subarray(s*n*2,(s+1)*n*2),s*(1+n*2)+1);let o=Lo([um(n),um(n),Uint8Array.from([8,4,0,0,0])]);return Lo([Ime,wP("IHDR",o),wP("IDAT",Sme(r)),wP("IEND",new Uint8Array(0))])}a(Eme,"glyphPng");function Tme(t,e=32){let n=a(s=>Uint8Array.from([s&255,s>>>8&255]),"little16"),i=a(s=>Uint8Array.from([s&255,s>>>8&255,s>>>16&255,s>>>24&255]),"little32"),r=Lo([n(0),n(1),n(1)]),o=Lo([Uint8Array.from([e>=256?0:e,e>=256?0:e,0,0]),n(1),n(32),i(t.length),i(22)]);return Lo([r,o,t])}a(Tme,"icoOf");function A9(t,e=process.platform,n=32){let i=Eme(t,wme(e),n),r=e==="win32"?Tme(i,n):i;return Buffer.from(r).toString("base64")}a(A9,"trayIcon");function O9(t,e){let n=Math.max(0,e-t);if(n<6e4)return"just now";let i=a((r,o)=>`${String(r)} ${o}${r===1?"":"s"} ago`,"said");return n<36e5?i(Math.floor(n/6e4),"minute"):n<864e5?i(Math.floor(n/36e5),"hour"):i(Math.floor(n/864e5),"day")}a(O9,"ago");function Ame(t){if(t.signedOut===!0)return"signed-out";let e=t.intervalMs*2;return t.lastBeatAt===void 0?t.now-t.startedAt<=e?"starting":"unreachable":t.now-t.lastBeatAt>e?"unreachable":t.syncing===!0?"syncing":"connected"}a(Ame,"trayCondition");function $P(t){let e=Ome(t);return t.projection===void 0?e:{...e,projection:t.projection}}a($P,"trayState");function Ome(t){let e=Ame(t),n=t.businessId===void 0?"":` \xB7 ${t.businessId}`,i=t.lastSyncAt===void 0?"Nothing synced yet":`Last synced ${O9(t.lastSyncAt,t.now)}`;if(e==="signed-out")return{condition:e,glyph:"stale",status:"Signed out",synced:i,detail:t.failure??"This machine was signed out in your Tacticyl cloud workspace."};if(e==="starting")return{condition:e,glyph:"stale",status:`Starting${n}`,synced:i};if(e==="unreachable"){let r=t.lastBeatAt===void 0?"not heard from yet":`last heard ${O9(t.lastBeatAt,t.now)}`;return{condition:e,glyph:"stale",status:`Not connected \xB7 ${r}`,synced:i,...t.failure===void 0?{}:{detail:t.failure}}}return e==="syncing"?{condition:e,glyph:"syncing",status:`Syncing${n}`,synced:i}:{condition:e,glyph:"active",status:`Active${n}`,synced:i}}a(Ome,"connectionState");function Nme(t,e=process.platform){let i=(0,R9.join)(t,"traybin",e==="win32"?"tray_windows_release.exe":e==="darwin"?"tray_darwin_release":"tray_linux_release");return(0,P9.existsSync)(i)?i:void 0}a(Nme,"shadowedBinary");function Cme(t,e,n=process.platform){let i=n==="darwin"?{file:"osascript",args:["-e",`display notification ${JSON.stringify(e)} with title ${JSON.stringify(t)}`]}:n==="win32"?void 0:{file:"notify-send",args:[t,e]};if(i===void 0)return!1;try{let r=(0,C9.spawn)(i.file,i.args,{stdio:"ignore",detached:!0});return r.on("error",()=>{}),r.unref(),!0}catch{return!1}}a(Cme,"notify");async function Pme(){let t="systray2";try{return j9(await import(t))}catch{return}}a(Pme,"loadSysTray");function j9(t,e=3){if(typeof t=="function")return t;if(!(e===0||typeof t!="object"||t===null))return j9(t.default,e-1)}a(j9,"constructorIn");var N9=5e3;async function z9(t){let e=t.platform??process.platform,n=t.intervalMs??ku,i=t.now??(()=>Date.now()),r=t.log??(S=>process.stderr.write(`${S}
|
|
837
|
+
`)),o=t.open??(S=>Yf(S)),s=t.notify??((S,G)=>Cme(S,G,e)),c=i(),u=a(S=>{let G=t.heartbeat.last,me=t.projection?.();return{...me===void 0?{}:{projection:me},startedAt:c,now:i(),intervalMs:n,...G?.ok===!0?{lastBeatAt:G.at}:{},...G!==void 0&&!G.ok?{failure:G.error}:{},signedOut:t.heartbeat.signedOut,syncing:S,...t.heartbeat.lastSyncAt===void 0?{}:{lastSyncAt:t.heartbeat.lastSyncAt},...t.businessId===void 0?{}:{businessId:t.businessId}}},"facts"),l=!1,d=$P(u(!1)),f=!1,p=a(S=>{let G=[{title:S.status,tooltip:S.detail??S.status,enabled:!1,checked:!1},{title:S.synced,tooltip:S.synced,enabled:!1,checked:!1}];return S.projection!==void 0&&G.push({title:S.projection,tooltip:S.projection,enabled:!1,checked:!1}),S.detail!==void 0&&G.push({title:S.detail,tooltip:S.detail,enabled:!1,checked:!1}),[...G,{title:"<SEPARATOR>",tooltip:"",enabled:!0,checked:!1},{title:"Open status page",tooltip:t.statusUrl,enabled:!0,checked:!1,click:a(()=>{o(t.statusUrl)||r(`tacticyl tray: the status page is ${t.statusUrl}`)},"click")},{title:"Sync now",tooltip:"Round-trip this machine and the service, and report it",enabled:!l,checked:!1,click:a(()=>{w()},"click")},{title:"Sign out",tooltip:"Revoke this machine on the service and clear the credential here",enabled:!t.heartbeat.signedOut,checked:!1,click:a(()=>{t.actions.signOut().then(me=>{r(`tacticyl tray: ${me}`),v()},me=>{r(`tacticyl tray: ${me instanceof Error?me.message:String(me)}`)})},"click")},{title:"Quit",tooltip:"Stop the companion on this machine",enabled:!0,checked:!1,click:a(()=>{t.actions.quit()},"click")}]},"menuItems"),m=a(S=>({icon:A9(S.glyph,e),title:"",tooltip:`Tacticyl \xB7 ${S.status}`,isTemplateIcon:T9(e),items:p(S)}),"menu"),g;function y(){g!==void 0&&g.sendAction({type:"update-menu",menu:m(d)}).catch(()=>{})}a(y,"draw");function v(){if(f)return;let S=$P(u(l)),G=S.status!==d.status||S.synced!==d.synced||S.projection!==d.projection;if(d=S,!!G){if(g===void 0){r(`tacticyl tray: ${S.status} \xB7 ${S.synced}`+(S.projection===void 0?"":` \xB7 ${S.projection}`)),(S.condition==="unreachable"||S.condition==="signed-out")&&s("Tacticyl companion",S.status);return}y()}}a(v,"refresh");async function w(){if(!l){l=!0,v();try{r(`tacticyl tray: ${await t.actions.syncNow()}`)}catch(S){r(`tacticyl tray: ${S instanceof Error?S.message:String(S)}`)}finally{l=!1,v()}}}a(w,"runSync");let b=setInterval(v,Math.max(1e3,Math.floor(n/2)));b.unref?.();let $=a((S,G,me)=>({kind:S,...G===void 0?{}:{why:G},get state(){return d},refresh:v,close:me}),"made"),x=Nme(t.cwd??process.cwd(),e),T=a(S=>(r(`tacticyl tray: ${S} The status page is ${t.statusUrl}.`),$("fallback",S,()=>(f=!0,clearInterval(b),Promise.resolve()))),"fallback");if(x!==void 0)return T(`A tray helper in this directory (${x}) shadows the packaged one, so no icon was started.`);let C=await Pme();if(C===void 0)return T("No tray helper is installed with this companion.");let Z=$9({platform:e});if(Z.path===void 0)return T(Z.why??"No tray helper is installed with this companion.");try{let S=new C({menu:m(d),debug:!1,copyDir:!0});await Promise.race([S.ready(),new Promise((G,me)=>setTimeout(()=>me(new Error(`the tray helper did not start within ${String(N9/1e3)}s`)),N9).unref?.())]),await S.onClick(G=>{G.item.click?.()}),g=S}catch(S){return T(`This machine has no system tray (${S instanceof Error?S.message:String(S)}).`)}return y(),$("tray",void 0,async()=>{f=!0,clearInterval(b),await g?.kill(!1).catch(()=>{}),g=void 0})}a(z9,"startTray");async function z$(t,e={}){let n=e.log??(g=>process.stderr.write(`${g}
|
|
838
|
+
`)),i=e.journal,r=e.intervalMs??ku,o=Xs(),s=null,c=null,u,l,d=a(()=>{if(Is(e.linkWatch))return;let g=bP(t);return g===void 0?void 0:[g]},"projections"),f=a(()=>Mr(t)?vP(i9(t)):void 0,"projectionLine"),p=e9(t.client,{intervalMs:r,machine:o,projections:d,onBeat:a(g=>{Is(e.linkWatch)&&p.stop(),g.ok&&(s=new Date(g.at).toISOString(),g.synced&&(c=s)),l?.refresh();let y=l?.state.condition;y!==void 0&&y!==u&&(u=y,i?.note(`heartbeat: ${l?.state.status??y}`,y==="connected"||y==="syncing"?"info":"warn")),!g.ok&&g.signedOut&&(i?.note(`heartbeat: ${g.error}`,"error"),n(`tacticyl: ${g.error}`))},"onBeat")}),m=a(async()=>{let g=Date.now(),y=await j$(t),v=await p.beat({synced:y.ok});v.ok&&y.ok&&(c=new Date(v.at).toISOString()),v.ok&&(s=new Date(v.at).toISOString());let w=y.ok?`Synced in ${String(y.ms)}ms.`:y.steps.find(b=>!b.ok)?.detail??"The round trip did not finish.";return i?.note(`sync now: ${w}`,y.ok?"info":"warn"),{ok:y.ok&&v.ok,ms:Date.now()-g,detail:w}},"syncNow");return e.tray===!0&&e.statusUrl!==void 0&&(l=await z9({statusUrl:e.statusUrl,heartbeat:p,intervalMs:r,log:n,projection:f,...t.businessId===""?{}:{businessId:t.businessId},actions:{syncNow:a(async()=>(await m()).detail,"syncNow"),signOut:a(async()=>{let g=await yo({service:t.service,credentials:t.client.credentials,fetch:t.client.fetcher});return p.stop(),g.wasSignedIn?`Signed out ${g.machine??o}.`:"This machine is not signed in."},"signOut"),quit:a(()=>{e.onQuit?.()},"quit")}}),i?.note(l.kind==="tray"?"tray: an icon is in the system tray":`tray: ${l.why??"no icon"}`,l.kind==="tray"?"info":"warn")),{heartbeat:p,...l===void 0?{}:{tray:l},liveness(){let g=l?.state,y=p.last,v=y?.ok===!0?y.at:void 0,w=f(),b=g?.status??(p.signedOut?"Signed out":v===void 0?"Starting":Date.now()-v>r*2?"Not connected":"Active");return{condition:g?.condition??(p.signedOut?"signed-out":"connected"),status:b,synced:g?.synced??(c===null?"Nothing synced yet":"Synced"),...g?.detail===void 0?{}:{detail:g.detail},lastHeardAt:s,lastSyncAt:c,intervalMs:r,tray:l?.kind??"fallback",...l?.why===void 0?{}:{trayWhy:l.why},machine:o,...w===void 0?{}:{projection:w}}},syncNow:m,close:a(async()=>{p.stop(),await l?.close()},"close")}}a(z$,"startPresence");var ut=require("node:fs"),L9=require("node:child_process"),Ct=require("node:path");var M9="# >>> tacticyl audit >>>",U9="# <<< tacticyl audit <<<",Rme="# >>> tacticyl harvest >>>",jme="# <<< tacticyl harvest <<<";function F9(t){for(let[e,n]of[[M9,U9],[Rme,jme]]){let i=t.indexOf(e),r=t.indexOf(n);if(i!==-1&&r>i)return{begin:i,end:r,endLength:n.length}}return null}a(F9,"blockBounds");var q9="tacticyl audit",Z9="tacticyl project --quiet",V9="tacticyl audit --quiet",B9="tacticyl hook post-write",zme="Write|Edit",K9="tacticyl hook pre-edit",Dme="Write|Edit|Bash",H9={SessionStart:[q9,"tacticyl harvest","tacticyl harvest --quiet"]};function _P(){return[M9,"# Written by `tacticyl hooks install`. Everything between the markers is regenerated;","# edit outside them, or run `tacticyl hooks install` again to restore this.","#","# It runs in the background and swallows its own failure on purpose: a hook that can fail","# is a hook that can fail a commit, and a lost commit costs more than a stale map.",`(${q9} >/dev/null 2>&1 &) || true`,U9].join(`
|
|
839
|
+
`)}a(_P,"auditBlock");function Lme(){return["#!/bin/sh","",_P(),""].join(`
|
|
840
|
+
`)}a(Lme,"hookScript");function Mme(t){let e=F9(t);if(e!==null){let i=t.slice(0,e.begin),r=t.slice(e.end+e.endLength);return`${i}${_P()}${r}`}return`${t.endsWith(`
|
|
841
|
+
`)?t:`${t}
|
|
842
|
+
`}
|
|
843
|
+
${_P()}
|
|
844
|
+
`}a(Mme,"withBlock");function xu(t){try{let e=(0,L9.execFileSync)("git",["rev-parse","--path-format=absolute","--git-path","hooks"],{cwd:t,encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:5e3}).trim();return e.length===0?void 0:e}catch{return}}a(xu,"hooksDir");function Ume(t){let e=xu(t);if(e===void 0)return{id:"post-commit",path:(0,Ct.join)(t,".git","hooks","post-commit"),outcome:"skipped",why:`${t} is not a git repository, so there is no post-commit hook to write.`};let n=(0,Ct.join)(e,"post-commit"),i=(0,ut.existsSync)(n)?(0,ut.readFileSync)(n,"utf8"):void 0,r=i===void 0?Lme():Mme(i);return i===r?(D9(n),{id:"post-commit",path:n,outcome:"unchanged"}):((0,ut.mkdirSync)((0,Ct.dirname)(n),{recursive:!0}),(0,ut.writeFileSync)(n,r,"utf8"),D9(n),{id:"post-commit",path:n,outcome:i===void 0?"written":"updated"})}a(Ume,"installPostCommit");function D9(t){try{(0,ut.chmodSync)(t,493)}catch{}}a(D9,"ensureExecutable");var D$=(0,Ct.join)(".claude","settings.json");function W9(){return[{event:"SessionStart",command:Z9},{event:"SessionStart",command:V9},{event:"PostToolUse",matcher:zme,command:B9},{event:"PreToolUse",matcher:Dme,command:K9}]}a(W9,"ourHooks");function Sr(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}a(Sr,"isRecord");function G9(t){return Array.isArray(t)?t.filter(Sr).map(e=>({...typeof e.matcher=="string"?{matcher:e.matcher}:{},hooks:Array.isArray(e.hooks)?e.hooks.filter(Sr).map(n=>({type:"command",command:typeof n.command=="string"?n.command:""})).filter(n=>n.command.length>0):[]})):[]}a(G9,"groupsOf");function J9(t,e){return t.map(n=>({...n,hooks:n.hooks.filter(i=>!e.has(i.command))})).filter(n=>n.hooks.length>0)}a(J9,"without");function Y9(t){let e=new Map;for(let n of t){let i=e.get(n.event)??[];i.push(n),e.set(n.event,i)}return e}a(Y9,"byEvent");function Fme(t,e=W9()){let n=Sr(t)?{...t}:{},i=Sr(n.hooks)?{...n.hooks}:{};for(let[r,o]of Y9(e)){let s=new Set(H9[r]??[]),c=J9(G9(i[r]),s);for(let u of o){if(c.some(p=>p.hooks.some(m=>m.command===u.command)))continue;let d={type:"command",command:u.command},f=c.findIndex(p=>p.matcher===u.matcher);if(f===-1){c=[...c,{...u.matcher===void 0?{}:{matcher:u.matcher},hooks:[d]}];continue}c=c.map((p,m)=>m===f?{...p,hooks:[...p.hooks,d]}:p)}i[r]=c}return n.hooks=i,n}a(Fme,"mergeSettings");function xP(t,e=W9()){let n=Sr(t)?{...t}:{},i=Sr(n.hooks)?{...n.hooks}:{};for(let[r,o]of Y9(e)){let s=new Set([...o.map(u=>u.command),...H9[r]??[]]),c=J9(G9(i[r]),s);c.length===0?delete i[r]:i[r]=c}return Object.keys(i).length===0?delete n.hooks:n.hooks=i,n}a(xP,"withoutSettings");function L$(t,e,n,i={}){let r=(0,ut.existsSync)(e);if(!r&&i.removing===!0)return{id:t,path:e,outcome:"unchanged"};let o,s="";if(r){s=(0,ut.readFileSync)(e,"utf8");try{o=JSON.parse(s)}catch{return{id:t,path:e,outcome:"skipped",why:`${e} could not be read as JSON. No changes were made. You can correct the file and run this command again.`}}}let c=n(o),u=`${JSON.stringify(c,null,2)}
|
|
845
|
+
`;return i.removing===!0&&Object.keys(c).length===0?((0,ut.rmSync)(e,{force:!0}),{id:t,path:e,outcome:"removed"}):r&&s===u?{id:t,path:e,outcome:"unchanged"}:((0,ut.mkdirSync)((0,Ct.dirname)(e),{recursive:!0}),(0,ut.writeFileSync)(e,u,"utf8"),r?{id:t,path:e,outcome:i.removing===!0?"removed":"updated"}:{id:t,path:e,outcome:"written"})}a(L$,"editJsonFile");function qme(t){return L$("claude-code",(0,Ct.join)(t,D$),e=>Fme(e))}a(qme,"installClaudeCode");function SP(t){return L$("claude-code",(0,Ct.join)(t,D$),e=>xP(e),{removing:!0})}a(SP,"removeClaudeCode");var M$=(0,Ct.join)(".cursor","hooks.json"),Zme=1;function kP(){return[{event:"sessionStart",command:Z9},{event:"sessionStart",command:V9},{event:"postToolUse",command:B9},{event:"preToolUse",command:K9}]}a(kP,"cursorHooks");function X9(t){return Array.isArray(t)?t.filter(Sr):[]}a(X9,"cursorEntries");function Vme(t){let e=Sr(t)?{...t}:{},n=Sr(e.hooks)?{...e.hooks}:{};for(let i of kP()){let r=X9(n[i.event]),o=r.some(s=>s.command===i.command);n[i.event]=o?r:[...r,{command:i.command}]}return e.version=typeof e.version=="number"?e.version:Zme,e.hooks=n,e}a(Vme,"mergeCursorHooks");function IP(t){let e=Sr(t)?{...t}:{},n=Sr(e.hooks)?{...e.hooks}:{},i=new Set(kP().map(r=>r.command));for(let r of new Set(kP().map(o=>o.event))){let o=X9(n[r]).filter(s=>typeof s.command!="string"||!i.has(s.command));o.length===0?delete n[r]:n[r]=o}return Object.keys(n).length===0?(delete e.hooks,Object.keys(e).length===1&&e.version!==void 0&&delete e.version):e.hooks=n,e}a(IP,"withoutCursorHooks");function Bme(t){return L$("cursor",(0,Ct.join)(t,M$),e=>Vme(e))}a(Bme,"installCursor");function EP(t){return L$("cursor",(0,Ct.join)(t,M$),e=>IP(e),{removing:!0})}a(EP,"removeCursor");function TP(t){let e=xu(t),n=e===void 0?(0,Ct.join)(t,".git","hooks","post-commit"):(0,Ct.join)(e,"post-commit");if(e===void 0||!(0,ut.existsSync)(n))return{id:"post-commit",path:n,outcome:"unchanged"};let i=(0,ut.readFileSync)(n,"utf8"),r=AP(i);return r===i?{id:"post-commit",path:n,outcome:"unchanged"}:r.trim()==="#!/bin/sh"?((0,ut.rmSync)(n,{force:!0}),{id:"post-commit",path:n,outcome:"removed"}):((0,ut.writeFileSync)(n,r,"utf8"),{id:"post-commit",path:n,outcome:"removed"})}a(TP,"removePostCommit");function AP(t){let e=F9(t);if(e===null)return t;let n=t.slice(0,e.begin).replace(/\n+$/,`
|
|
846
|
+
`),i=t.slice(e.end+e.endLength).replace(/^\n+/,"");return`${n}${i}`}a(AP,"withoutBlock");function Q9(t){return t.git===!0||t.claudeCode===!0||t.cursor===!0?{git:t.git===!0,claudeCode:t.claudeCode===!0,cursor:t.cursor===!0}:{git:!0,claudeCode:!0,cursor:!0}}a(Q9,"chosen");function U$(t={}){let e=(0,Ct.resolve)(t.dir??process.cwd()),n=Q9(t),i=[];return n.git&&i.push(Ume(e)),n.claudeCode&&i.push(qme(e)),n.cursor&&i.push(Bme(e)),{dir:e,hooks:i}}a(U$,"installHooks");function eK(t={}){let e=(0,Ct.resolve)(t.dir??process.cwd()),n=Q9(t),i=[];return n.git&&i.push(TP(e)),n.claudeCode&&i.push(SP(e)),n.cursor&&i.push(EP(e)),{dir:e,hooks:i,removed:!0}}a(eK,"removeHooks");function tK(t){let e=[`Hooks in ${t.dir}`];for(let i of t.hooks)e.push(` ${i.outcome.padEnd(9)} ${i.id} ${i.path}`),i.why!==void 0&&e.push(` ! ${i.why}`);if(t.removed===!0)return e.push("Every hook you wrote yourself is still there. `tacticyl audit` still works."),e.join(`
|
|
847
|
+
`);let n=a(i=>t.hooks.some(r=>r.id===i&&r.outcome!=="skipped"),"has");return n("post-commit")&&e.push("Each commit in this repository will now run `tacticyl audit` in the background. The commit will complete regardless of the result."),(n("claude-code")||n("cursor"))&&(e.push("A session here now starts by refreshing the projection and the audit, and a document written under docs/ is offered for registration. Both are quiet, and neither waits longer than a second for the service."),e.push("The projection asks your coding agents to append a line to .tacticyl/inbox.md for a major reorganisation, a module added or removed, or an externality swapped, and each audit reads those lines and puts them on the Findings page with the fact it matched.")),e.join(`
|
|
848
|
+
`)}a(tK,"renderInstall");var Ir=require("node:path");function OP(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}a(OP,"isRecord");function Si(t){return typeof t=="string"&&t.length>0?t:void 0}a(Si,"text");function NP(t){if(t.conversation_id!==void 0||t.workspace_roots!==void 0||t.cursor_version!==void 0)return"cursor";let e=Si(t.hook_event_name);return t.session_id!==void 0||t.transcript_path!==void 0||e==="PostToolUse"?"claude-code":"unknown"}a(NP,"harnessOf");function CP(t){let e=OP(t.tool_input)?t.tool_input:{},n=OP(t.tool_response)?t.tool_response:{};return Si(e.file_path)??Si(e.path)??Si(e.target_file)??Si(e.notebook_path)??Si(t.file_path)??Si(n.filePath)}a(CP,"pathOf");function Kme(t){let e;try{e=JSON.parse(t)}catch{return{harness:"unknown"}}if(!OP(e))return{harness:"unknown"};let n=Si(e.tool_name),i=CP(e),r=Si(e.cwd);return{harness:NP(e),...n===void 0?{}:{tool:n},...i===void 0?{}:{path:i},...r===void 0?{}:{cwd:r}}}a(Kme,"readPayload");function PP(t,e){let n=(0,Ir.resolve)(t),i=(0,Ir.isAbsolute)(e)?(0,Ir.resolve)(e):(0,Ir.resolve)(n,e);if(i!==n&&i.startsWith(n.endsWith(Ir.sep)?n:n+Ir.sep))return(0,Ir.relative)(n,i).replaceAll("\\","/")}a(PP,"insideRepo");var Hme="docs",Wme=[".md",".mdx",".markdown"],Gme=new Set(["TACTICYL.md","AGENTS.md","CLAUDE.md","README.md"]),Jme=new Set(["a","an","and","doc","docs","for","index","md","note","notes","of","readme","the","to","v1","v2"]);function Er(t){return t.replaceAll("\\","/").replace(/^\.\//,"").replace(/^\/+/,"")}a(Er,"normalizePath");function nK(t){let e=Er(t);if(Gme.has(e))return!1;let n=e.split("/");if(n.length<2||n.some(r=>r.startsWith(".")||r==="node_modules"))return!1;let i=e.toLowerCase();return Wme.some(r=>i.endsWith(r))}a(nK,"looksLikeDocument");function Yme(t,e){let n=new Set([Hme]);for(let i of t){if(i.root!==e)continue;let r=Er(i.path).split("/"),o=r.length>1?r[0]:void 0;o!==void 0&&o.length>0&&n.add(o)}return[...n]}a(Yme,"documentDirectories");function Xme(t,e,n=6){let i=Er(t),r=e.filter(s=>s.paths.some(c=>c.length>0&&i.startsWith(Er(c)))),o=e.filter(s=>!r.includes(s));return[...r,...o].slice(0,n).map(s=>s.ref)}a(Xme,"suggestAbout");function Qme(t,e,n=4){let i=Er(t).split("/"),r=i[0]??"",o=e.includes(r)?i.slice(1):i,c=(o.pop()??"").replace(/\.[^.]+$/,""),u=[...o,...c.split(/[-_.\s]+/)].map(l=>l.toLowerCase()).filter(l=>l.length>1&&!Jme.has(l)&&!/^\d+$/.test(l));return[...new Set(u)].slice(0,n)}a(Qme,"suggestTags");function ehe(t){let e=t.about.length===0?"(no node of the map lives in this repository; name what it is about)":t.about.join(" "),n=t.tags.length===0?"(none suggested)":t.tags.join(" ");return[`Register this document with \`register_doc\`. Path: ${t.path}, about: ${e}, tags: ${n}.`,"","The nodes and tags are suggestions from the path and from what this repository holds; keep the ones that fit and add any that are missing. Registering proposes a change set a human accepts. It changes nothing on its own, and it is how the next agent finds this document instead of writing it again."].join(`
|
|
849
|
+
`)}a(ehe,"nudgeText");function the(t){let e=Er(t.path);if(!nK(e))return;let n=Yme(t.docs,t.rootId),i=e.split("/")[0]??"";if(!n.includes(i))return;let r=`repo:${t.rootId}/${e}`;if(t.docs.some(u=>u.root===t.rootId&&u.path===e))return;let s=Xme(e,t.nodes),c=Qme(e,n);return{path:e,locator:r,about:s,tags:c,text:ehe({path:e,locator:r,about:s,tags:c})}}a(the,"decideNudge");function nhe(t,e){if(t===void 0)return"";let n={hookSpecificOutput:{hookEventName:"PostToolUse",additionalContext:t}},i={additional_context:t};return JSON.stringify(e==="claude-code"?n:e==="cursor"?i:{...n,...i})}a(nhe,"hookAnswer");function rK(t){let e=t.home;return Array.isArray(e)?e:[]}a(rK,"locators");function rhe(t){let e=[];for(let n of t.index)if(!(n.tag!=="doc"||n.facet!=="docs"))for(let i of rK(n.node))e.push({root:i.root,path:Er(i.path??"")});return e}a(rhe,"registeredDocs");function ihe(t,e){let n=[];for(let i of t.index){if(i.depth!==2||i.facet==="docs"||i.facet==="plan")continue;let r=rK(i.node).filter(o=>o.root===e);r.length!==0&&n.push({ref:t.refs.get(i.path)??i.path,paths:r.map(o=>Er(o.path??"")).filter(o=>o.length>0)})}return n}a(ihe,"homedNodes");var ohe="hook_post_write";async function she(){if(process.stdin.isTTY===!0)return"";let t=[];for await(let e of process.stdin)t.push(Buffer.from(e));return Buffer.concat(t).toString("utf8")}a(she,"readStdin");async function iK(t={}){let e=t.out??(s=>process.stdout.write(`${s}
|
|
850
|
+
`)),n=Kme(t.stdin??await she());if(n.path===void 0)return 0;let i=t.dir??n.cwd??process.cwd(),r=Xe(i);if(r===void 0)return 0;let o=PP(r.repo,n.path);return o===void 0||!nK(o)||await ac(async()=>{let s=await(t.context??(l=>ct({dir:l})))(i),c=await s.client.venture(s.businessId),u=the({path:o,rootId:s.rootId,docs:rhe(c.graph),nodes:ihe(c.graph,s.rootId)});u!==void 0&&(OV(s.repo,{locator:u.locator,path:u.path,harness:n.harness,at:new Date().toISOString()}),e(nhe(u.text,n.harness)),await s.client.logToolCall({tool:ohe,businessId:s.businessId,harness:n.harness==="unknown"?"hook":n.harness,via:"hook",args:{path:u.path,about:u.about},ms:0,ok:!0}))}),0}a(iK,"postWrite");var Mo=require("node:fs"),Su=require("node:path");var ahe="hook_pre_edit",oK=(0,Su.join)(".tacticyl","caveats.local.json"),che=20;function RP(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}a(RP,"isRecord");function lm(t){return typeof t=="string"&&t.length>0?t:void 0}a(lm,"text");function uhe(t){let e;try{e=JSON.parse(t)}catch{return{harness:"unknown"}}if(!RP(e))return{harness:"unknown"};let n=RP(e.tool_input)?e.tool_input:{},i=lm(e.tool_name),r=CP(e),o=lm(n.command),s=lm(e.cwd),c=lm(e.session_id)??lm(e.conversation_id);return{harness:NP(e),...i===void 0?{}:{tool:i},...r===void 0?{}:{path:r},...o===void 0?{}:{command:o},...s===void 0?{}:{cwd:s},...c===void 0?{}:{session:c}}}a(uhe,"readPreEditPayload");function lhe(t){let e=t.home;return Array.isArray(e)?e:[]}a(lhe,"locators");function dhe(t,e){let n=[];for(let i of t.index){if(i.depth!==2||i.facet==="docs")continue;let r=av(i.node);if(r.length===0)continue;let o=t.refs.get(i.path)??i.path;if(i.tag==="root"){i.id===e&&n.push({ref:o,paths:[""],caveats:r});continue}let s=lhe(i.node).filter(c=>c.root===e);s.length!==0&&n.push({ref:o,paths:s.map(c=>Er(c.path??"")),caveats:r})}return n}a(dhe,"caveatedNodes");function fhe(t,e){return t.length===0||e.startsWith(t)}a(fhe,"covers");function phe(t,e){if(t.path!==void 0){let n=Er(t.path);return e.filter(i=>i.paths.some(r=>fhe(r,n)))}if(t.command!==void 0){let n=t.command;return e.filter(i=>i.paths.some(r=>r.length===0||n.includes(r)))}return[]}a(phe,"caveatsFor");function mhe(t){let e=[ef];for(let n of t){e.push(`${n.ref}:`);for(let i of n.caveats)e.push(cv(i))}return e.push("","These are caveats recorded on the business map for the parts this change touches: what has gone wrong here before. Read the file each one cites before you act on it."),e.join(`
|
|
851
|
+
`)}a(mhe,"preEditText");function hhe(t,e){if(t===void 0)return"";let n={hookSpecificOutput:{hookEventName:"PreToolUse",additionalContext:t}},i={permission:"allow",agent_message:t};return JSON.stringify(e==="claude-code"?n:e==="cursor"?i:{...n,...i})}a(hhe,"preEditAnswer");function ghe(t){let e=(0,Su.join)(t,oK);if(!(0,Mo.existsSync)(e))return{};try{let n=JSON.parse((0,Mo.readFileSync)(e,"utf8"));return RP(n)?n:{}}catch{return{}}}a(ghe,"readTold");function yhe(t,e,n){if(e===void 0)return[...n];let i=ghe(t),r=new Set(i[e]??[]),o=n.filter(l=>!r.has(l));if(o.length===0)return[];let s=Object.keys(i),c={};for(let l of s.slice(Math.max(0,s.length-che+1)))c[l]=i[l]??[];c[e]=[...r,...o];let u=(0,Su.join)(t,oK);try{(0,Mo.mkdirSync)((0,Su.dirname)(u),{recursive:!0}),(0,Mo.writeFileSync)(u,`${JSON.stringify(c,null,2)}
|
|
852
|
+
`,"utf8")}catch{}return o}a(yhe,"untold");async function vhe(){if(process.stdin.isTTY===!0)return"";let t=[];for await(let e of process.stdin)t.push(Buffer.from(e));return Buffer.concat(t).toString("utf8")}a(vhe,"readStdin");async function sK(t={}){let e=t.out??(s=>process.stdout.write(`${s}
|
|
853
|
+
`)),n=uhe(t.stdin??await vhe());if(n.path===void 0&&n.command===void 0)return 0;let i=t.dir??n.cwd??process.cwd(),r=Xe(i);if(r===void 0)return 0;let o=n.path===void 0?void 0:PP(r.repo,n.path);return n.path!==void 0&&o===void 0||await ac(async()=>{let s=await(t.context??(f=>ct({dir:f})))(i),c=await s.client.venture(s.businessId),u=phe({...o===void 0?{}:{path:o},...n.command===void 0?{}:{command:n.command}},dhe(c.graph,s.rootId)),l=new Set(yhe(s.repo,n.session,u.flatMap(f=>f.caveats.map(p=>p.id)))),d=u.map(f=>({...f,caveats:f.caveats.filter(p=>l.has(p.id))})).filter(f=>f.caveats.length>0);d.length!==0&&(e(hhe(mhe(d),n.harness)),await s.client.logToolCall({tool:ahe,businessId:s.businessId,harness:n.harness==="unknown"?"hook":n.harness,via:"hook",args:{...o===void 0?{}:{path:o},nodes:d.map(f=>f.ref)},ms:0,ok:!0}))}),0}a(sK,"preEdit");var hK=require("node:fs"),q$=require("node:path");var Ii=require("node:fs"),cK=require("node:child_process"),mt=require("node:path");var aK=(0,mt.join)(".tacticyl","hub"),Qt=class extends Error{static{a(this,"HubError")}name="HubError"};function F$(t){if((0,Ii.existsSync)(t))try{return JSON.parse((0,Ii.readFileSync)(t,"utf8"))}catch{return}}a(F$,"readJson");function uK(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}a(uK,"isRecord");function lK(t){try{return(0,Ii.readdirSync)(t).sort()}catch{return[]}}a(lK,"names");function dK(t){return/^[a-z][a-z0-9+.-]*:\/\//i.test(t)||/^[^/\s]+@[^/\s]+:/.test(t)||t.endsWith(".git")}a(dK,"isGitUrl");function fK(t){let n=t.replace(/\/+$/,"").replace(/\.git$/,"").split(/[/:]/).pop()??"hub";return n.length===0?"hub":n}a(fK,"cloneTarget");function pK(t,e){let n=(0,mt.resolve)(e);if((0,Ii.existsSync)(n))throw new Qt(`${n} already exists, and no files were cloned. You can remove it, or choose another location with --into.`);let i=(0,cK.spawnSync)("git",["clone","--quiet",t,n],{stdio:"pipe"});if(i.error!==void 0||i.status!==0){let r=i.stderr?.toString().trim()??"";throw new Qt(`git clone ${t} did not work${r.length===0?"":`: ${r}`}. Clone it yourself and run \`tacticyl import\` on the directory.`)}return n}a(pK,"cloneHub");function bhe(t){let e=(0,mt.join)(t,"ledger","changes"),n=lK(e).filter(r=>/^\d+\.json$/.test(r)).map(r=>({name:r,n:Number(r.slice(0,-5))})).sort((r,o)=>r.n-o.n),i=[];for(let r of n){let o=F$((0,mt.join)(e,r.name));if(!uK(o))throw new Qt(`${(0,mt.join)("ledger","changes",r.name)} is not a change record.`);i.push(o)}return i}a(bhe,"readChanges");function whe(t){let e=(0,mt.join)(t,"ledger","objects"),n=[];for(let i of lK(e)){if(!i.endsWith(".json"))continue;let r=F$((0,mt.join)(e,i));if(!uK(r)||typeof r.hash!="string"||typeof r.xml!="string")throw new Qt(`${(0,mt.join)("ledger","objects",i)} is not a { hash, xml } snapshot.`);let o=to(r.xml);if(o!==r.hash||`${r.hash}.json`!==i)throw new Qt(`${(0,mt.join)("ledger","objects",i)} holds bytes that hash to ${o.slice(0,12)}. This hub has been altered or corrupted and could not be read.`);n.push({hash:r.hash,xml:r.xml})}return n}a(whe,"readObjects");function mK(t){let e=(0,mt.resolve)(t),n=[],i=(0,mt.join)(e,"tacticyl.xml");if(!(0,Ii.existsSync)(i))throw new Qt(`${e} holds no tacticyl.xml, so it is not a hub. \`tacticyl export <dir>\` writes one.`);let r=(0,Ii.readFileSync)(i,"utf8"),o;try{o=Ny(r)}catch(d){throw d instanceof Yi?new Qt(`${(0,mt.join)(e,"tacticyl.xml")} is not a descriptor this version can read: ${d.message}`):d}let s=F$((0,mt.join)(e,aK)),c=F$((0,mt.join)(e,"roots.json")),u=typeof c?.business=="string"?c.business:void 0,l=(typeof s?.business=="string"&&s.business.length>0?s.business:void 0)??u??(0,mt.basename)(e);return s===void 0?n.push(`${e} has no ${aK} marker, so the venture id was taken from ${u===void 0?"the folder name":"roots.json"}: "${l}". A \`tacticyl export\` from this version writes the marker.`):typeof s.hub=="number"&&s.hub>1&&n.push(`That hub says it is format ${String(s.hub)}; this companion reads format 1. Anything it does not understand was ignored.`),{dir:e,businessId:l,name:o.name,xml:r,venture:o,changes:bhe(e),snapshots:whe(e),roots:Array.isArray(c?.roots)?c.roots:o.roots?.roots??[],warnings:n}}a(mK,"readHub");function $he(t){let e=t.share??t.id;return{id:t.id,share:t.share??null,via:t.via??null,command:`tacticyl link --store ${t.id} <path to ${e}>`}}a($he,"storeToMount");function _he(t){let e=new Set(t.snapshots.map(r=>r.hash)),n=new Set(t.changes.flatMap(r=>[r.base,r.result]).filter(r=>r.length>0&&!e.has(r)));if(n.size===0)return;let i=[...n][0]??"";throw new Qt(`${t.dir}'s ledger names snapshot ${i.slice(0,12)} and holds no ledger/objects/${i}.json for it (${String(n.size)} in all). Export the hub again from the service that holds them.`)}a(_he,"checkHub");async function gK(t){let e=(0,q$.resolve)(t.dir??process.cwd()),n=dK(t.source),i=n?pK(t.source,(0,q$.resolve)(e,t.into??fK(t.source))):(0,q$.resolve)(e,t.source);if(!n&&!(0,hK.existsSync)(i))throw new Qt(`${i} is not a directory on this machine. Give \`tacticyl import\` a hub directory, or a git URL to clone one from.`);let r=mK(i);_he(r);let o=r.roots.filter(d=>d.kind==="store").map($he),s=r.roots.filter(d=>d.kind==="repo").map(d=>({id:d.id,remote:d.remote??null})),c={hub:r.dir,businessId:r.businessId,name:r.name,cloned:n,stores:o,repos:s},u=t.client;if(u===void 0)throw new Qt("No workspace is signed in or linked for `tacticyl import` to import the hub into. Run `tacticyl login` to sign in, or `tacticyl link <url>` to link this repository to a workspace.");let l=await u.hubImport({id:r.businessId,xml:r.xml,changes:r.changes,snapshots:r.snapshots.map(d=>({hash:d.hash,xml:d.xml}))},{...t.replace===!0?{replace:!0}:{}});return{...c,businessId:l.venture.id,name:l.venture.name,snapshots:l.snapshots,changes:l.changes,remapped:l.remapped,superseded:l.superseded,warnings:r.warnings}}a(gK,"importHub");function yK(t,e){let n=[];n.push(`Imported ${t.name} (${t.businessId}) into ${e??"the service"}: ${String(t.changes)} changes, ${String(t.snapshots)} snapshots.`),t.cloned&&n.push(` cloned to ${t.hub}`),t.superseded!==null&&n.push(` ! The business that was at "${t.businessId}" is kept, with its whole ledger, as "${t.superseded}".`),t.remapped.length>0&&n.push(` ! ${String(t.remapped.length)} change id${t.remapped.length===1?"":"s"} ${t.remapped.length===1?"was":"were"} already taken here and ${t.remapped.length===1?"was":"were"} renamed (${t.remapped[0]?.from??""} \u2192 ${t.remapped[0]?.to??""}, \u2026). What each record says is unchanged.`);for(let i of t.warnings)n.push(` ! ${i}`);if(t.repos.length>0){n.push("","Repositories this business spans:");for(let i of t.repos)n.push(` ${i.id.padEnd(12)} ${i.remote??"(no remote recorded)"}`)}if(t.stores.length>0){n.push("","Store roots. Say where this machine keeps each:");for(let i of t.stores){let r=i.via===null?"":` (${i.via})`;n.push(` ${i.id.padEnd(12)} ${i.share??""}${r}`),n.push(` ${i.command}`)}}return n.push("","Then:"),n.push(` cd ${t.hub} && tacticyl open write the workspace`),n.join(`
|
|
854
|
+
`)}a(yK,"renderImport");var vK=require("node:os");async function bK(t,e={}){let n=new Es;n.note("tacticyl tray");let i={},r=Db(t),o=r===void 0?{}:{linkWatch:r},s=await am(t,{journal:n,...o,...e.version===void 0?{}:{version:e.version},...e.guiPort===void 0?{}:{port:e.guiPort},...e.open===!0?{open:!0}:{},...e.log===void 0?{}:{log:e.log},presence:a(()=>i.presence,"presence")}),c=await z$(t,{statusUrl:s.url,tray:!0,journal:n,...o,...e.onQuit===void 0?{}:{onQuit:e.onQuit},...e.log===void 0?{}:{log:e.log}});i.presence=c;let u=c.liveness(),l=[`tacticyl tray: ${(0,vK.hostname)()} \xB7 ${t.businessId} \xB7 ${t.service}`,u.tray==="tray"?" the icon is in the tray. Its menu: the status page, Sync now, Sign out, Quit.":` no icon on this machine: ${u.trayWhy??"this machine has no system tray"}`,` status page ${s.url}`,` a heartbeat every ${String(Math.round(u.intervalMs/1e3))}s. Ctrl-C stops it.`];return{status:s,presence:c,lines:l,close:a(async()=>{await c.close(),await s.close()},"close")}}a(bK,"tray");var UK=require("node:readline/promises");var $K=require("node:child_process"),jP=require("node:fs"),Pt=require("node:path");function V$(t){try{let n=(0,$K.execFileSync)("git",["rev-parse","--show-toplevel"],{cwd:t,encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:5e3}).trim();if(n.length>0)return(0,Pt.resolve)(n)}catch{}let e=(0,Pt.resolve)(t);for(;;){if((0,jP.existsSync)((0,Pt.join)(e,".git")))return e;let n=(0,Pt.dirname)(e);if(n===e)return;e=n}}a(V$,"repositoryOf");function _K(t,e){let n=Xe(t);if(n===void 0||(0,Pt.resolve)(n.repo)!==(0,Pt.resolve)(t))return;let i=n.link.businessId;return i!==void 0&&i!==e?i:void 0}a(_K,"linkedElsewhere");async function khe(t,e){try{return await t.venture(e,{fresh:!0}),"exists"}catch(n){return n instanceof dt?n.status===404&&n.code==="venture-not-found"?"gone":n.status===403?"exists":"unknown":"unknown"}}a(khe,"oldBusinessState");function kK(t,e){let n=t.trim().toLowerCase();return n.startsWith("y")?!0:n.startsWith("n")?!1:e}a(kK,"yesOrNo");function xhe(t,e,n){return t==="gone"?`The business ${e} that this repository was linked to is no longer in your Tacticyl cloud workspace. Link this repository to ${n} instead? [Y/n]`:t==="exists"?`This repository is linked to ${e}, which is still in your Tacticyl cloud workspace. Move this repository from ${e} to ${n}? [y/N]`:`This repository is already linked to ${e}, and that business could not be checked before sign-in; do you want to link this repository to ${n} instead? [y/N]`}a(xhe,"replaceQuestion");function She(t,e){return[{id:"post-commit",path:(0,Pt.join)(xu(t)??(0,Pt.join)(t,".git","hooks"),"post-commit")},{id:"claude-code",path:(0,Pt.join)(t,".claude","settings.json")},{id:"cursor",path:(0,Pt.join)(t,".cursor","hooks.json")}].filter(i=>!e.includes(i.id))}a(She,"plannedHooks");async function Ihe(t,e,n){let i=await oO({service:e,code:t.code,...t.fetch===void 0?{}:{fetch:t.fetch}}),r=V$(t.dir),o=r===void 0?void 0:Ss(qb(r)),s={dryRun:!0,service:e,machine:n,...r===void 0?{}:{repo:r},...o===void 0?{}:{remote:o},...i.businessId===null?{}:{businessId:i.businessId},...i.businessName===null?{}:{businessName:i.businessName},files:[],commands:[],agents:[],hooks:[],enrolled:[],seen:!1};if(r===void 0)return{...s,stopped:"no-repo"};if(i.businessId===null)return{...s,stopped:"no-business"};let c=_K(r,i.businessId);if(c!==void 0)return{...s,stopped:"other-business",other:c};let u=t.skip??[],l=GB(r,u),d=JB(r,u,t.env??process.env);return{...s,files:[(0,Pt.join)(r,rt,oi),(0,Pt.join)(r,rt,"inbox.md"),...l,...d.files,(0,Pt.join)(r,$u)].map(f=>({path:f})),commands:d.commands,hooks:She(r,u)}}a(Ihe,"dryRun");async function xK(t){let e=mr(t.service),n=t.machine??Ic();if(t.dryRun===!0)return Ihe(t,e,n);let i=t.fetch??((S,G)=>fetch(S,G)),r=t.credentials??Zn(e,{fetch:i}),o=V$(t.dir),s={};if(o!==void 0){let S=await oO({service:e,code:t.code,fetch:i}),G=S.businessId,me=G===null?void 0:_K(o,G);if(G!==null&&me!==void 0){let Zt=S.businessName??G,Fe=new lr({service:e,fetch:i,credentials:r}),Sn=await khe(Fe,me),fm=a((VP={})=>({dryRun:!1,service:e,machine:n,repo:o,businessId:G,...S.businessName===null?{}:{businessName:S.businessName},stopped:"other-business",other:me,otherState:Sn,unspent:!0,files:[],commands:[],agents:[],hooks:[],enrolled:[],seen:!1,...VP}),"stop"),pm;if(t.replace===!0)pm="flag";else if(t.ask!==void 0){if(!await t.ask(xhe(Sn,me,Zt),Sn==="gone"))return fm({declined:!0});pm="answer"}else if(Sn==="gone")pm="gone";else return fm();s={replaced:me,replacedBy:pm,otherState:Sn}}}let c=await C4({service:e,code:t.code,machine:n,fetch:i,credentials:r}),u={dryRun:!1,service:e,machine:c.machine,...c.account===void 0?{}:{account:c.account},storedIn:c.storedIn,...c.warning===void 0?{}:{warning:c.warning},...c.note===void 0?{}:{note:c.note},...c.businessId===void 0?{}:{businessId:c.businessId},files:[],commands:[],agents:[],hooks:[],enrolled:[],seen:!1};if(o===void 0)return{...u,stopped:"no-repo"};if(c.businessId===void 0)return{...u,repo:o,stopped:"no-business"};let l=new lr({service:e,fetch:i,credentials:r}),d=(0,jP.existsSync)((0,Pt.join)(o,rt,oi)),f=await Fb({dir:o,service:e,venture:c.businessId,client:l}),p=await ct({dir:o,fetch:i,credentials:r}),m=t.skip??[],g=await _u(p,{skip:m,...t.env===void 0?{}:{env:t.env}});await R$(p);let y=U$({dir:o,git:!0,claudeCode:!m.includes("claude-code"),cursor:!m.includes("cursor")}),v=g.enrolled.map(S=>S.id),w=await p.client.heartbeat({machine:c.machine,enrolled:v}),b=(await p.client.venture(c.businessId)).venture,$=b.name,x=Ss(qb(o)),T=b.roots?.roots??[],C=ai(o),Z=T.filter(S=>S.kind==="store"&&!(S.id in C)).map(S=>S.id);return{...u,...s,repo:o,businessName:$,...x===void 0?{}:{remote:x},rootId:f.link.rootId,declared:T.some(S=>S.kind==="repo"&&S.id===f.link.rootId),storesUnmounted:Z,files:[{path:f.path,outcome:d?"updated":"created"},{path:f.inbox.path,outcome:f.inbox.outcome==="written"?"created":"kept"},...g.files],commands:g.commands,agents:g.agents,hooks:y.hooks.map(S=>({id:S.id,path:S.path,outcome:S.outcome})),enrolled:g.enrolled,seen:w.ok}}a(xK,"enroll");function Z$(t,e){return e===void 0?t:$i(e,t)}a(Z$,"shown");var Ehe={"post-commit":"git post-commit","claude-code":"Claude Code",cursor:"Cursor"};function The(t){return t.map(e=>e.name).join(", ")}a(The,"agentNames");function SK(t){let e=t.businessName??t.businessId??"",n=t.repo;if(t.dryRun){let o=["No changes were made, and this code has not been used and still works. Running the command will:",` Pair this machine as ${t.machine} with ${t.service}`];if(t.stopped==="no-repo")return o.push("This folder is not in a git repository, so this line will only pair this machine."),o;if(t.stopped==="no-business")return o.push("This line does not name a business, so it will only pair this machine."),o;if(t.stopped==="other-business")return o.push(`This repository is linked to another business, ${t.other??""}. Running this command without \`--dry-run\` will ask you to confirm before linking it to ${e}.`),o;o.push(t.remote===void 0?` Link ${n??""} to ${e}`:` Link ${n??""} (${t.remote}) to ${e}`);for(let c of t.files)o.push(` Write ${Z$(c.path,n)}`);for(let c of t.commands)o.push(` Run ${c}`);let s=Ys(process.env);(t.commands.some(c=>c.startsWith("codex "))||t.files.some(c=>c.path===s))&&o.push(` ${pP}`);for(let c of t.hooks)o.push(` Install the ${Ehe[c.id]??c.id} hook in ${Z$(c.path,n)}`);return o}if(t.unspent===!0)return[wK(t,e)];let i=[`This machine was paired as ${t.machine} with ${t.service}, signed in as ${t.account??"this account"}.`,` stored in ${t.storedIn??"the credential store"}`];if(t.warning!==void 0&&i.push(` ! ${t.warning}`),t.note!==void 0&&i.push(` ${t.note}`),t.stopped==="no-repo")return i.push("This folder is not in a repository, so nothing was linked. This code has now been used, so you can link a repository by running a new line from Tacticyl inside it."),i;if(t.stopped==="no-business")return i.push("This line did not name a business, so this repository was not linked. Running a new line from the business's Overview in Tacticyl will link it."),i;if(t.stopped==="other-business")return i.push(wK(t,e)),i;t.replaced!==void 0&&i.push(Ahe(t,e));let r=t.rootId??"";if(i.push(t.remote===void 0?`${n??""}, which has no git remote, was linked to ${e} as ${r}.`:`${n??""} (${t.remote}) was linked to ${e} as ${r}.`),t.declared===!1&&i.push(`${e} does not list this repository yet. The next run of tacticyl audit will propose adding it, and you can confirm that on the Findings page in your workspace.`),t.storesUnmounted!==void 0&&t.storesUnmounted.length>0){let o=t.storesUnmounted.length;i.push(`${e} also keeps documents in ${String(o)} store root${o===1?"":"s"} outside any repository (${t.storesUnmounted.join(", ")}), and none of them has been pointed to on this machine yet. You can point to one with tacticyl link --store <root> <folder>.`)}for(let o of t.files)i.push(` ${(o.outcome??"").padEnd(9)} ${Z$(o.path,n)}`);for(let o of C$(n??"",t.agents))i.push(` ${o}`);for(let o of t.hooks)i.push(` ${(o.outcome??"").padEnd(9)} ${o.id} ${Z$(o.path,n)}`);return t.enrolled.length>0&&i.push(`Tacticyl's tools were added to ${The(t.enrolled)}.`),t.seen&&i.push("This machine now appears as connected in your Tacticyl cloud workspace."),i}a(SK,"renderEnroll");function wK(t,e){let n=t.other??"";return t.declined===!0?`This repository is still linked to ${n}. No changes were made, and your code was not used, so the same line still works.`:`This repository is linked to ${n}, and no terminal was attached to confirm a change. No changes were made, and your code was not used, so the same line still works. You can run the same line again with \`--replace\` to link this repository to ${e} instead.`}a(wK,"otherBusiness");function Ahe(t,e){let n=t.replaced??"";return t.replacedBy==="gone"?`The business ${n} that this repository was linked to is no longer in your Tacticyl cloud workspace. This repository is now linked to ${e}.`:`This repository is now linked to ${e}. It was linked to ${n} before.`}a(Ahe,"replacedLine");var en=require("node:fs"),Ee=require("node:path");function MP(t){return t.trim().length===0?"":`${t.trimEnd()}
|
|
855
|
+
`}a(MP,"tidy");function Ohe(t){let e=`${_s}
|
|
856
|
+
${go}
|
|
857
|
+
`,n=t.indexOf(e);if(n>=0)return MP(`${t.slice(0,n)}${t.slice(n+e.length)}`);let i=t.split(`
|
|
858
|
+
`),r=i.filter(o=>o.trim()!==go);return r.length===i.length?t:MP(r.join(`
|
|
859
|
+
`))}a(Ohe,"withoutClaudeImport");function Nhe(t){let e=t.indexOf(Ht);if(e<0)return t;let n=t.indexOf(jt,e);if(n<0)return t;let i=t.slice(0,e),r=t.slice(n+jt.length).replace(/^\n+/,"");return MP(r.length===0?i:`${i}${r}`)}a(Nhe,"withoutGeneratedBlock");function PK(t){let e=t.mcpServers,n={...t};if(delete n.mcpServers,typeof e=="object"&&e!==null&&!Array.isArray(e)){let i={...e};delete i[wi],Object.keys(i).length>0&&(n.mcpServers=i)}return Object.keys(n).length===0?void 0:n}a(PK,"withoutMcpServer");function Che(t){let e=t.mcpServers;return typeof e=="object"&&e!==null&&Object.prototype.hasOwnProperty.call(e,wi)}a(Che,"namesServer");function Phe(t){return t.replace(Ob,"").trim().length===0}a(Phe,"inboxIsEmpty");var Rhe={"claude-code":{bin:"claude",args:MB},codex:{bin:"codex",args:UB}};function RK(t){let e=xr(t);if(!wu(e))return;let n=PK(e);return n===void 0?{kind:"delete",path:t}:{kind:"write",path:t,content:vu(n)}}a(RK,"jsonChange");function jK(t){let e=wt(t);if(!(e===void 0||A$(e)!=="ours"))return{kind:"write",path:t,content:ZB(e)}}a(jK,"codexChange");function jhe(t,e,n,i){let r=[];for(let o of _i){if(e.includes(o.id))continue;let s=o.mcp===null?Ys(n):(0,Ee.join)(t,o.mcp),c=o.id==="codex"?A$(wt(s)):wu(xr(s))?"ours":Che(xr(s))?"theirs":"absent";if(c==="theirs"&&i.push({path:s,why:"theirs"}),c!=="ours")continue;let u=Rhe[o.id],l=u===void 0?void 0:nm(u.bin,n);r.push({id:o.id,name:o.name,path:s,...u===void 0||l===void 0?{}:{bin:{path:l,display:tm(u.bin,u.args),args:u.args}}})}return r}a(jhe,"planAgents");function zP(t,e,n){let i=wt(t);i!==void 0&&(i.includes(Ht)?e.push({kind:"delete",path:t}):n.push({path:t,why:"not-ours"}))}a(zP,"ownedFile");function IK(t,e,n){let i=wt(t);if(i===void 0)return;let r=e(i);r!==i&&n.push(r.trim().length===0?{kind:"delete",path:t}:{kind:"write",path:t,content:r})}a(IK,"sharedFile");function EK(t,e,n,i,r){let o=wt(e);if(o===void 0)return;let s;try{s=JSON.parse(o)}catch{r.push({path:e,why:"unreadable",detail:`${e} could not be read as JSON. No changes were made. You can correct the file and run this command again.`});return}JSON.stringify(n(s))!==JSON.stringify(s)&&i.push({id:t,path:e})}a(EK,"hookChanges");function zhe(t,e,n){let i=[],r=jhe(t,e,n,i),o=[];for(let g of r){if(g.bin!==void 0)continue;let y=g.id==="codex"?jK(g.path):RK(g.path);y!==void 0&&o.push(y)}zP((0,Ee.join)(t,"TACTICYL.md"),o,i),IK((0,Ee.join)(t,"CLAUDE.md"),Ohe,o),IK((0,Ee.join)(t,"AGENTS.md"),Nhe,o),zP((0,Ee.join)(t,".cursor","rules","tacticyl.mdc"),o,i),zP((0,Ee.join)(t,".claude","skills","tacticyl","SKILL.md"),o,i);let s=[],c=xu(t),u=(0,Ee.join)(c??(0,Ee.join)(t,".git","hooks"),"post-commit"),l=c===void 0?void 0:wt(u);l!==void 0&&AP(l)!==l&&s.push({id:"post-commit",path:u}),e.includes("claude-code")||EK("claude-code",(0,Ee.join)(t,D$),g=>xP(g),s,i),e.includes("cursor")||EK("cursor",(0,Ee.join)(t,M$),g=>IP(g),s,i);for(let g of[(0,Ee.join)(rt,oi),$u,cP,VC]){let y=(0,Ee.join)(t,g);(0,en.existsSync)(y)&&o.push({kind:"delete",path:y})}let d=(0,Ee.join)(t,rt,"inbox.md"),f=wt(d);f!==void 0&&(Phe(f)?o.push({kind:"delete",path:d}):i.push({path:d,why:"inbox"}));let p=(0,Ee.join)(t,Xf);if((0,en.existsSync)(p)){let g=Object.values(ai(t)).map(y=>(0,Ee.join)((0,Ee.resolve)(t,y),yu)).filter(y=>(0,en.existsSync)(y));i.push({path:p,why:"store",markers:g})}let m=[(0,Ee.join)(t,".cursor","rules"),(0,Ee.join)(t,".cursor"),(0,Ee.join)(t,".claude","skills","tacticyl"),(0,Ee.join)(t,".claude","skills"),(0,Ee.join)(t,".claude"),(0,Ee.join)(t,rt)];return{agents:r,changes:o,hooks:s,left:i,dirs:m}}a(zhe,"planRepository");function TK(t){t.kind==="delete"?(0,en.rmSync)(t.path,{force:!0}):(0,en.writeFileSync)(t.path,t.content,"utf8")}a(TK,"apply");function DP(t){return{path:t.path,change:t.kind==="delete"?"removed":"edited"}}a(DP,"asFile");function AK(t,e){let n=(0,Ee.relative)(e,t);if(!(n.length===0||n.startsWith("..")||(0,Ee.isAbsolute)(n)))try{(0,en.readdirSync)(t).length===0&&(0,en.rmdirSync)(t)}catch{}}a(AK,"removeIfEmpty");async function LP(t,e){if(t.keepSignedIn===!0)return{state:"kept",revoked:!1};let n=t.fetch??((o,s)=>fetch(o,s)),i=t.credentials??Zn(e,{fetch:n});if(t.dryRun===!0){let o=await i.stored(Rn(e));return o===void 0?{state:"not-signed-in",revoked:!1}:{state:"signed-out",revoked:!1,...o.machine===void 0?{}:{machine:o.machine}}}let r=await yo({service:e,fetch:n,credentials:i});return r.wasSignedIn?{state:"signed-out",revoked:r.revoked,...r.machine===void 0?{}:{machine:r.machine},...r.error===void 0?{}:{error:r.error}}:{state:"not-signed-in",revoked:!1}}a(LP,"machineStep");async function zK(t){let e=mr(t.service),n=t.env??process.env,i=t.skip??[],r=t.dryRun===!0,o=V$(t.dir);if(o===void 0)return{dryRun:r,service:e,files:[],commands:[],agents:[],hooks:[],left:[],signedOut:await LP(t,e)};let s=zhe(o,i,n);if(r)return{dryRun:r,service:e,repo:o,files:s.changes.map(DP),commands:s.agents.flatMap(m=>m.bin===void 0?[]:[m.bin.display]),agents:s.agents.map(m=>({id:m.id,name:m.name,how:m.bin===void 0?"file":"command",...m.bin===void 0?{}:{command:m.bin.display},path:m.path})),hooks:s.hooks,left:s.left,signedOut:await LP(t,e)};let c=[],u=[],l=[];for(let m of s.agents){if(m.bin===void 0){u.push({id:m.id,name:m.name,how:"file",path:m.path});continue}let g=I$(m.bin.path,m.bin.args,o,n),y=m.id==="codex"?A$(wt(m.path))==="ours":wu(xr(m.path));if(g&&!y){c.push(m.bin.display),u.push({id:m.id,name:m.name,how:"command",command:m.bin.display,path:m.path}),m.id!=="codex"&&(0,en.existsSync)(m.path)&&PK(xr(m.path))===void 0&&(0,en.rmSync)(m.path,{force:!0}),l.push({path:m.path,change:(0,en.existsSync)(m.path)?"edited":"removed"});continue}let v=m.id==="codex"?jK(m.path):RK(m.path);v!==void 0&&(TK(v),l.push(DP(v))),u.push({id:m.id,name:m.name,how:"file",path:m.path})}for(let m of s.changes)TK(m),l.push(DP(m));let d=[];for(let m of s.hooks)m.id==="post-commit"&&d.push(TP(o)),m.id==="claude-code"&&d.push(SP(o)),m.id==="cursor"&&d.push(EP(o));let f=d.filter(m=>m.outcome==="removed").map(m=>({id:m.id,path:m.path})),p=[...s.left];for(let m of d)m.outcome==="skipped"&&p.push({path:m.path,why:"unreadable",...m.why===void 0?{}:{detail:m.why}});for(let m of s.dirs)AK(m,o);for(let m of l)AK((0,Ee.dirname)(m.path),o);return{dryRun:r,service:e,repo:o,files:l,commands:c,agents:u,hooks:f,left:p,signedOut:await LP(t,e)}}a(zK,"remove");var OK="Run `npm uninstall -g tacticyl` to remove the program itself.",NK="Codex's setting applies to the entire machine. Codex no longer has Tacticyl's tools in any repository on this machine.",Dhe={"post-commit":"git post-commit","claude-code":"Claude Code",cursor:"Cursor"};function ea(t,e){return e===void 0?t:$i(e,t)}a(ea,"shown");function Lhe(t,e){let n=[];for(let i of t){let r=ea(i.path,e);if(i.why==="theirs")n.push(` The tacticyl entry in ${r} was not written by Tacticyl and was kept.`);else if(i.why==="not-ours")n.push(` The file ${r} was not written by Tacticyl and was kept.`);else if(i.why==="inbox")n.push(` The file ${r} contains lines written by you or your agents and was kept.`);else if(i.why==="store"){n.push(" Your store folders were kept, along with roots.local.json and the .tacticyl-root marker file in each one.");for(let o of i.markers??[])n.push(` ${o}`)}else n.push(` ! ${i.detail??r}`)}return n}a(Lhe,"leftLines");function CK(t){let e=t.signedOut;if(e.state==="kept")return[t.dryRun?`This machine will stay signed in to ${t.service}.`:`This machine is still signed in to ${t.service}.`];if(e.state==="not-signed-in")return[`This machine was not signed in to ${t.service}, and there was nothing to sign out.`];if(t.dryRun)return[` Sign this machine out of ${t.service}`];if(e.revoked)return[`${e.machine??"This machine"} was signed out. Its access was revoked on ${t.service} and the credential was removed from this machine.`];let n=["The credential was removed from this machine, but its access could not be revoked on the Tacticyl service."];return e.error!==void 0&&n.push(` ! ${e.error}`),n}a(CK,"signOutLines");function DK(t){let e=t.repo,n=[];if(t.dryRun&&n.push("This was a dry run, and no changes were made. Running `tacticyl remove` will make the changes listed below."),e===void 0){let o=!t.dryRun&&t.signedOut.state==="signed-out";return n.push(o?"This folder is not in a git repository, and only this machine was signed out. You can remove the files in a repository by running `tacticyl remove` inside it.":"This folder is not in a git repository, and only this machine's sign-in was checked. You can remove the files in a repository by running `tacticyl remove` inside it."),n.push(...CK(t)),n.push(OK),n}let i=t.files.length===0&&t.commands.length===0&&t.agents.length===0&&t.hooks.length===0,r=t.agents.some(o=>o.id==="codex");if(i)n.push(`No Tacticyl setup was found in ${e}. No changes were made.`);else if(t.dryRun){for(let o of t.commands)n.push(` Run \`${o}\``);for(let o of t.files)n.push(o.change==="removed"?` Delete ${ea(o.path,e)}`:` Remove Tacticyl's content from ${ea(o.path,e)}`);r&&n.push(` ${NK}`);for(let o of t.hooks)n.push(` Remove the ${Dhe[o.id]??o.id} hook from ${ea(o.path,e)}`)}else{n.push(`Tacticyl was removed from this repository: ${e}`);for(let o of t.files)n.push(` ${(o.change==="removed"?"removed":"edited").padEnd(9)} ${ea(o.path,e)}`);for(let o of t.agents)n.push(o.how==="command"?` ${o.name}: Tacticyl's tools were removed with \`${o.command??""}\`.`:` ${o.name}: Tacticyl's tools were removed from ${ea(o.path,e)}.`);r&&n.push(` ${NK}`);for(let o of t.hooks)n.push(` ${"removed".padEnd(9)} ${o.id} ${ea(o.path,e)}`);t.files.some(o=>o.change==="removed"&&o.path===(0,Ee.join)(e,rt,oi))&&n.push("Agent sessions that are already running will stop using Tacticyl's tools in this repository. You should restart or reconnect those sessions.")}return n.push(...Lhe(t.left,e)),n.push(...CK(t)),n.push(OK),n}a(DK,"renderRemove");var UP=`tacticyl \xB7 the Tacticyl companion
|
|
860
|
+
|
|
861
|
+
Usage: tacticyl <command> [options]
|
|
862
|
+
|
|
863
|
+
link <service-url> Links this repository to a business and writes .tacticyl/link.
|
|
864
|
+
--business <id> the business to link to (when the service has one
|
|
865
|
+
business, it is used)
|
|
866
|
+
--no-business link without a business and draft one from the code
|
|
867
|
+
--root <id> the root id for this repository (default: its directory
|
|
868
|
+
name)
|
|
869
|
+
link --store <id> <path>
|
|
870
|
+
Mounts a store root here. The path is recorded in roots.local.json, and a
|
|
871
|
+
.tacticyl-root marker is written in the folder if it has none.
|
|
872
|
+
--watch <folder>\u2026 folders inside it to watch for new files
|
|
873
|
+
scan Hashes the business's artifacts where this machine has the store roots and
|
|
874
|
+
reports which are verified and which are missing.
|
|
875
|
+
--root <id> only that root
|
|
876
|
+
--watch <folder>\u2026 extra folders to watch, relative to the root
|
|
877
|
+
--adopt propose an artifact for each file that matches none
|
|
878
|
+
audit Reads this repository and reports what the code says. What agrees with the
|
|
879
|
+
map is stamped, what is new is proposed, and what disagrees is recorded as
|
|
880
|
+
a finding. In a repository with no business, a business is drafted from
|
|
881
|
+
what was read.
|
|
882
|
+
--repo <path> a repository other than the linked one
|
|
883
|
+
--only <id> run only the check with this id
|
|
884
|
+
--dry-run print what was found and send nothing to the service
|
|
885
|
+
hooks install Writes the hooks that keep the map current: the post-commit audit, your
|
|
886
|
+
harness's session-start refresh, and the post-write reminder to register a
|
|
887
|
+
document. A second run makes no changes. With no flag, all three are
|
|
888
|
+
written. Your coding agents are asked to append a line to
|
|
889
|
+
.tacticyl/inbox.md when a module is added or removed, an externality is
|
|
890
|
+
swapped, or the code is reorganised, and each audit run reads those lines.
|
|
891
|
+
--claude-code .claude/settings.json only; your own hooks are left
|
|
892
|
+
unchanged
|
|
893
|
+
--cursor .cursor/hooks.json only, the same way
|
|
894
|
+
--git .git/hooks/post-commit only
|
|
895
|
+
hooks remove Removes the hooks. Takes the same three flags.
|
|
896
|
+
hook post-write Reads a harness's post-write payload on stdin and answers with the reminder
|
|
897
|
+
to register the document, or with nothing. The hooks above call this.
|
|
898
|
+
hook pre-edit Reads a harness's pre-edit payload on stdin and answers with the caveats on
|
|
899
|
+
the parts the change touches, once a session, or with nothing.
|
|
900
|
+
serve Runs the MCP server over stdio for Claude Code, Cursor and any other MCP
|
|
901
|
+
client.
|
|
902
|
+
--http [port] serve streamable HTTP on localhost instead of stdio
|
|
903
|
+
--tray show the icon in the system tray as well
|
|
904
|
+
--no-gui do not serve the status page
|
|
905
|
+
--no-heartbeat do not report to the service that this machine is running
|
|
906
|
+
tray Shows the icon in the system tray: active, syncing, or when it last synced,
|
|
907
|
+
with the status page, Sync now, Sign out and Quit. It serves no MCP and
|
|
908
|
+
reports to the service every 30 seconds so the app shows this machine as
|
|
909
|
+
connected.
|
|
910
|
+
--open also open a browser at the status page
|
|
911
|
+
--gui-port <n> the port the page listens on (default 8788)
|
|
912
|
+
scaffold <system> Writes the three modes into this repository's code: a Mode enum, a per-mode
|
|
913
|
+
config with every secret name and no value, and one binding per mode
|
|
914
|
+
following each service's mock policy. Prints what would change and writes
|
|
915
|
+
nothing unless --write is given.
|
|
916
|
+
--write write the files and register them with the service
|
|
917
|
+
project Writes TACTICYL.md, an import line in CLAUDE.md, a section in AGENTS.md and
|
|
918
|
+
Cursor's rules into this repository, and gives Claude Code, Codex and
|
|
919
|
+
Cursor Tacticyl's tools through their own commands or config files.
|
|
920
|
+
Running it again will make no changes, and you can commit these files. If
|
|
921
|
+
this repository already has its own agent files, you will be asked once.
|
|
922
|
+
Until you answer, only TACTICYL.md and the tool settings are written.
|
|
923
|
+
--prompts own keep a generated section in your agent files current
|
|
924
|
+
--prompts leave write TACTICYL.md and leave your own files unchanged
|
|
925
|
+
--no-claude-code Do not give Claude Code Tacticyl's tools
|
|
926
|
+
--no-codex Do not give Codex Tacticyl's tools
|
|
927
|
+
--no-cursor Do not give Cursor Tacticyl's tools
|
|
928
|
+
open Writes <business>.code-workspace from the business's roots and opens it.
|
|
929
|
+
--no-open write it without launching the editor
|
|
930
|
+
export <dir> Writes the hub: tacticyl.xml, roots.json, inventory.json, ledger/, findings/,
|
|
931
|
+
playbooks/, projections/, .mcp.json, the workspace and .tacticyl/hub.
|
|
932
|
+
--git initialise the directory as a git repository and commit
|
|
933
|
+
the tree. The commit is not pushed.
|
|
934
|
+
import <dir|git-url> Reads a hub written on another machine, registers it with the service you
|
|
935
|
+
are signed in to, and reports what to mount here.
|
|
936
|
+
--replace replace a business the service already has at that id
|
|
937
|
+
--into <dir> where to clone to (default: the repository's name)
|
|
938
|
+
status Shows what the companion is connected to, and what to do when that is
|
|
939
|
+
wrong.
|
|
940
|
+
--open serve the status page and open a browser at it
|
|
941
|
+
--gui-port <n> the port the page listens on (default 8788)
|
|
942
|
+
login Signs in. Your browser will open, and you approve this machine there.
|
|
943
|
+
--name <name> the name for this machine (default: its hostname)
|
|
944
|
+
--token <code> Pair this machine using the code from the line in
|
|
945
|
+
Tacticyl. Inside a repository, this will also link it,
|
|
946
|
+
write the agent files, and install the hooks.
|
|
947
|
+
--dry-run Print what the line will do without changing anything.
|
|
948
|
+
--replace Link the repository even if it is linked to another
|
|
949
|
+
business.
|
|
950
|
+
--no-claude-code Do not give Claude Code Tacticyl's tools
|
|
951
|
+
--no-codex Do not give Codex Tacticyl's tools
|
|
952
|
+
--no-cursor Do not give Cursor Tacticyl's tools
|
|
953
|
+
logout Revokes this machine on the service and clears the credential store.
|
|
954
|
+
remove Removes Tacticyl's tools, files, hooks and link from this repository and
|
|
955
|
+
signs this machine out of the service.
|
|
956
|
+
--dry-run List the changes without making them
|
|
957
|
+
--keep-signed-in Keep this machine signed in
|
|
958
|
+
--no-claude-code Leave Claude Code's tools and hook in place
|
|
959
|
+
--no-codex Leave Codex's tools in place
|
|
960
|
+
--no-cursor Leave Cursor's tools and hook in place
|
|
961
|
+
tools Lists the MCP tools and their arguments.
|
|
962
|
+
report Shows the most recent error on this machine as it would be sent and asks
|
|
963
|
+
before sending it to your Tacticyl cloud workspace.
|
|
964
|
+
--yes Send the report without asking first.
|
|
965
|
+
report on Sends each error the companion meets in the next 20 minutes as it happens,
|
|
966
|
+
including from background runs such as the MCP server and the git hook,
|
|
967
|
+
then turns itself off.
|
|
968
|
+
report off Turns error reports off before the 20 minutes are up.
|
|
969
|
+
|
|
970
|
+
Options everywhere:
|
|
971
|
+
--service <url> your workspace address, under tacticyl.com; overrides .tacticyl/link
|
|
972
|
+
--business <id> the business, overriding .tacticyl/link
|
|
973
|
+
--root <id> this repository's root id, overriding .tacticyl/link
|
|
974
|
+
--quiet print nothing, fail silently, and give up on the service within a second.
|
|
975
|
+
The session-start hooks run \`tacticyl project --quiet\`.
|
|
976
|
+
--debug print the stack trace when a command fails
|
|
977
|
+
-h, --help show this help
|
|
978
|
+
-v, --version show the companion's version
|
|
979
|
+
|
|
980
|
+
Environment: TACTICYL_SERVICE, TACTICYL_ID, TACTICYL_ROOT_ID, TACTICYL_TOKEN, TACTICYL_CACHE_TTL_MS,
|
|
981
|
+
TACTICYL_CREDENTIALS_FILE (used only where this machine has no keychain), TACTICYL_STATE_DIR (where
|
|
982
|
+
the companion keeps its own notes; ~/.tacticyl unless set).
|
|
983
|
+
TACTICYL_SERVICE must be an address under tacticyl.com, the same as --service.
|
|
984
|
+
`,dm=io,Mhe=new Set(["tools","hook","help","harvest"]);async function Uhe(t,e){try{let n=si(t),i=new lr({service:n.service,credentials:EE(),...e.fetch===void 0?{}:{fetch:e.fetch}});return mv(await i.companionVersions())}catch(n){if(n instanceof df)throw n;return}}a(Uhe,"versionCheckFor");function nr(t){let e=It(t,"service"),n=It(t,"business"),i=It(t,"root");return{...e===void 0?{}:{service:e},...n===void 0?{}:{venture:n},...i===void 0?{}:{rootId:i}}}a(nr,"contextOptions");function Iu(t){let e=It(t,"service");return e===void 0?{}:{service:e}}a(Iu,"serviceOption");function MK(){return Ws.map(t=>{let e=Object.keys(t.inputSchema);return`${t.name}(${e.join(", ")})
|
|
985
|
+
${t.title}${t.readOnly?"":" \xB7 proposes a change"}`}).join(`
|
|
986
|
+
`)}a(MK,"renderTools");async function qP(t,e={}){let n=rL(t);if(xe(n,"quiet")&&e.quiet!==!0)return ac(()=>qP(t,{...e,quiet:!0,out:a(()=>{},"out")}),{...n.command===void 0?{}:{command:n.command}});let i=e.out??(o=>console.log(o));if(S4(),xe(n,"version"))return i(`tacticyl ${dm()}`),0;if(n.command===void 0||xe(n,"help")||n.command==="help")return i(UP),n.command===void 0&&!xe(n,"help")?1:0;let r;if(!Mhe.has(n.command)){if(r=await Uhe(Iu(n),e),r?.standing==="upgrade-required")throw new df(r.line);(r?.standing==="upgrade-recommended"||r?.standing==="ahead")&&e.quiet!==!0&&console.error(`tacticyl: ${r.line}`)}switch(n.command){case"login":{if(xe(n,"token"))return Jhe(n,i);let o=si(Iu(n)),s=It(n,"name"),c=await O4({service:o.service,...s===void 0?{}:{machine:s},out:i});return i(`Signed in to ${c.service} as ${c.account??"this account"}.
|
|
987
|
+
machine ${c.machine} (${c.machineId})
|
|
988
|
+
token expires ${c.expiresAt}, refreshed automatically
|
|
989
|
+
stored in ${c.storedIn}`),c.warning!==void 0&&i(` ! ${c.warning}`),c.note!==void 0&&i(` ${c.note}`),i("Next: `tacticyl link` here if you have not, then `tacticyl status`."),0}case"logout":{let o=si(Iu(n)),s=await yo({service:o.service});return s.wasSignedIn?(i(s.revoked?`Signed out ${s.machine??"this machine"}: revoked on ${o.service} and removed from this machine.`:"Removed the credential from this machine."),s.error!==void 0&&i(` ! ${s.error}`),0):(i(`This machine is not signed in to ${o.service}. No changes were made.`),0)}case"remove":return ege(n,i);case"tools":return i(MK()),0;case"link":{if(xe(n,"store"))return qhe(n,i);let o=n.positional[0]??It(n,"service"),s=si({dir:process.cwd(),...o===void 0?{}:{service:o}}).service,c=It(n,"business"),u=It(n,"root"),l=await Fb({dir:process.cwd(),service:s,...c===void 0?{}:{venture:c},...u===void 0?{}:{rootId:u},...xe(n,"no-business")?{noBusiness:!0}:{}});i(l.link.businessId===void 0?`Linked ${l.link.rootId} to ${l.link.service}
|
|
990
|
+
${l.path}`:`Linked ${l.link.rootId} to business ${l.link.businessId} at ${l.link.service}
|
|
991
|
+
${l.path}`);let d=R4(l);d!==void 0&&i(` ${d}`),l.rootFrom==="remote"&&i(` Root ${l.link.rootId}, matched by this repository's remote.`);for(let f of l.warnings)i(` ! ${f}`);return i(l.inbox.outcome==="written"?` ${l.inbox.path}
|
|
992
|
+
Your coding agents append a line there for a major reorganisation, a module added or removed, or an externality swapped. Each audit reads the new lines and puts them on the Findings page.`:` ${l.inbox.path} (already here)`),i(l.next===void 0?"Next: `tacticyl project` to write the map into this repository.":`${l.next}`),0}case"serve":{let o=await ct(nr(n)),s=Db(o),c=s===void 0?{}:{linkWatch:s},u=cc(n,"http")??cc(n,"port"),l=new Es,d=await l9(o,{...u===void 0?{}:{http:u},version:dm(),onCall:a(y=>l.served(y),"onCall"),...c,...r?.standing==="ahead"?{ahead:!0}:{},log:a(y=>{l.note(y),process.stderr.write(`${y}
|
|
993
|
+
`)},"log")}),f=cc(n,"gui-port"),p,m=xe(n,"no-gui")?void 0:await am(o,{journal:l,version:dm(),presence:a(()=>p,"presence"),...c,...f===void 0?{}:{port:f}});if(!xe(n,"no-heartbeat")){p=await z$(o,{journal:l,...c,...m===void 0?{}:{statusUrl:m.url},...xe(n,"tray")?{tray:!0}:{},log:a(v=>{l.note(v),process.stderr.write(`${v}
|
|
994
|
+
`)},"log"),onQuit:a(()=>{process.stderr.write(`tacticyl serve: quit from the tray.
|
|
995
|
+
`),process.kill(process.pid,"SIGTERM")},"onQuit")});let y=p.liveness();process.stderr.write(`tacticyl serve: ${y.status}. ${y.tray==="tray"?"The tray icon has the status page, Sync now, Sign out and Quit.":`An icon in the system tray: \`tacticyl serve --tray\`${xe(n,"tray")?` (${y.trayWhy??"not on this machine"})`:""}.`}
|
|
996
|
+
`)}let g=a(()=>{d.close().then(()=>p?.close()).then(()=>m?.close())},"stop");return process.once("SIGINT",g),process.once("SIGTERM",g),0}case"project":{let o=await ct(nr(n)),s=It(n,"prompts");if(s!==void 0&&!BB(s))return i(`"${s}" is not an answer. --prompts own, or --prompts leave.`),1;let c=await _u(o,{...s===void 0?{}:{prompts:s},skip:ZP(n)});await R$(o),i(`${c.businessId} as ${c.rootId} \xB7 ${String(c.sliceSize)} node${c.sliceSize===1?"":"s"} of the map live here, snapshot ${c.snapshot.slice(0,12)}`);for(let u of c.files)i(` ${u.outcome.padEnd(9)} ${u.path}`);for(let u of C$(o.repo,c.agents))i(` ${u}`);return c.sliceSize===0&&i(` ! No node declares a home in "${c.rootId}". Check the root id with \`tacticyl status\`.`),c.asking.length>0?(i(""),i(` This repository already tells your coding agents how to work: ${c.asking.join(", ")}.`),i(" Tacticyl has not written into them."),i(" tacticyl project --prompts own keep a generated section in them current, and the map with it"),i(" tacticyl project --prompts leave TACTICYL.md and the MCP entries, and nothing of yours"),i(" Asked once. The answer lives in .tacticyl/prompts.json and on the status page.")):i(` ${O$(c.prompts)}`),0}case"open":{let o=await ct(nr(n)),s=await j4(o,{noOpen:xe(n,"no-open")});i(`${s.path} \xB7 ${String(s.workspace.folders.length)} folder${s.workspace.folders.length===1?"":"s"}`);for(let c of s.workspace.folders)i(` ${c.name} ${c.path}`);return s.unmounted.length>0&&i(` ! not mounted on this machine: ${s.unmounted.join(", ")}. Add them to roots.local.json`),s.notFolders.length>0&&i(` \xB7 accounts and vaults (no folder): ${s.notFolders.join(", ")}`),i(s.opened?" opened with code":" `code` not found; open the file yourself"),0}case"export":return Hhe(n,i);case"import":return Whe(n,i);case"status":{let o=await ct({...nr(n),offline:!0,businessOptional:!0}).catch(()=>ct({...nr(n),businessOptional:!0}));if(xe(n,"open")){let s=new Es;s.note("tacticyl status --open");let c=cc(n,"gui-port"),u=await am(o,{journal:s,version:dm(),open:!0,log:i,...c===void 0?{}:{port:c}});i("The page polls every few seconds. Ctrl-C to stop serving it.");let l=a(()=>void u.close(),"stop");return process.once("SIGINT",l),process.once("SIGTERM",l),0}return i(t9(await P$(o))),0}case"tray":return Ghe(n,i);case"scan":return Zhe(n,i);case"audit":return LK(n,i);case"harvest":return i("audit is the word now: this ran `tacticyl audit`."),LK(n,i);case"hooks":return Promise.resolve(Vhe(n,i));case"hook":return Khe(n,i);case"scaffold":return Bhe(n,i);case"report":return Qhe(n,i,e);default:return i(`tacticyl: there is no command "${n.command}".
|
|
997
|
+
|
|
998
|
+
${UP}`),1}}a(qP,"run");async function Fhe(t=process.argv.slice(2)){try{let e=await qP(t);e!==0&&(process.exitCode=e)}catch(e){let n=e instanceof Error?e.message:String(e);process.stderr.write(`tacticyl: ${n}
|
|
999
|
+
`),t.includes("--debug")&&e instanceof Error&&process.stderr.write(`${e.stack??""}
|
|
1000
|
+
`),process.exitCode=1;let i=await d$(e,{command:t[0]??"tacticyl"},Xhe());i!==void 0&&process.stderr.write(`${i}
|
|
1001
|
+
`)}}a(Fhe,"main");function FP(t,e){let n=It(t,e);if(n!==void 0)return{value:n,rest:t.positional};let[i,...r]=t.positional;return{value:i,rest:r}}a(FP,"flagOrPositional");async function qhe(t,e){let{value:n,rest:i}=FP(t,"store"),r=i[0];if(n===void 0||r===void 0)return e("tacticyl link --store needs a root and a path: `tacticyl link --store brand ~/OneDrive/Cairn`."),1;let o=await ct(nr(t)),s=xe(t,"watch")?i.slice(1):[],c=await tB(o,n,r,{watch:s});e(`Mounted store root ${c.rootId} at ${c.path}`),e(` ${c.localRootsPath}`),e(` ${c.markerPath}${c.wroteMarker?"":" (unchanged)"}`);for(let u of c.warnings)e(` ! ${u}`);return e("Next: `tacticyl scan` to hash what is in it."),0}a(qhe,"linkStoreCommand");async function Zhe(t,e){let n=await ct({...nr(t),businessOptional:!0});if(!Mr(n))return e("There is no business here to scan against yet. A scan hashes the artifacts a business declares, and this repository has not drafted one."),e(Sc),0;let i=xe(t,"watch")?[It(t,"watch"),...t.positional].filter(o=>o!==void 0&&o.length>0):[],r=await nP(n,{...It(t,"root")===void 0?{}:{rootId:It(t,"root")},...i.length===0?{}:{watch:i},...xe(t,"adopt")?{adopt:!0}:{}});return e(nB(r)),r.report.roots.length===0&&r.unmounted.length===0&&e(" This business declares no store root, so there was nothing to scan."),0}a(Zhe,"scanCommand");async function LK(t,e){let n=await ct({...nr(t),businessOptional:!0}),i=FP(t,"repo"),r=FP(t,"only"),o=await iP(n,{...xe(t,"repo")&&i.value!==void 0?{repo:i.value}:{},...xe(t,"only")&&r.value!==void 0?{only:r.value}:{},...xe(t,"dry-run")?{send:!1}:{}});return e(uB(o)),0}a(LK,"auditCommand");function Vhe(t,e){let n=t.positional[0]??"install";if(n!=="install"&&n!=="remove")return e(`tacticyl hooks: there is no "${n}". The two are \`tacticyl hooks install\` and \`tacticyl hooks remove\`.`),1;let i={dir:process.cwd(),claudeCode:xe(t,"claude-code"),cursor:xe(t,"cursor"),git:xe(t,"git")},r=n==="remove"?eK(i):U$(i);return e(tK(r)),r.hooks.some(o=>o.outcome==="skipped")?1:0}a(Vhe,"hooksCommand");async function Bhe(t,e){let n=t.positional[0];if(n===void 0)return e("tacticyl scaffold needs a system: `tacticyl scaffold condor`. `tacticyl tools` lists them."),1;let i=await ct(nr(t)),r=await mB(i,n,{write:xe(t,"write")});return e(hB(r)),0}a(Bhe,"scaffoldCommand");async function Khe(t,e){let n=t.positional[0];return n===void 0?(e("tacticyl hook needs an event: `tacticyl hook post-write`. The hooks install themselves."),1):n==="pre-edit"?sK({out:e}):n!=="post-write"?(e(`tacticyl hook: there is no "${n}". The events are \`post-write\` and \`pre-edit\`.`),1):iK({out:e})}a(Khe,"hookCommand");async function Hhe(t,e){let n=t.positional[0];if(n===void 0)return e("tacticyl export needs a directory: `tacticyl export ../cairn-venture`."),1;let i=await ct(nr(t)),r=await XB(i,n,{...xe(t,"git")?{git:!0}:{}});return e(QB(r)),0}a(Hhe,"exportCommand");async function Whe(t,e){let n=t.positional[0];if(n===void 0)return e("tacticyl import needs a hub: `tacticyl import ../cairn-venture`, or a git URL to clone one from."),1;let i=It(t,"into");try{let r={...nr(t),offline:!0},{client:o}=await ct(r).catch(()=>ct({...r,offline:!1})),s=await gK({source:n,dir:process.cwd(),...i===void 0?{}:{into:i},...xe(t,"replace")?{replace:!0}:{},client:o});return e(yK(s,o?.service)),0}catch(r){if(!(r instanceof Qt))throw r;return e(`tacticyl import: ${r.message}`),1}}a(Whe,"importCommand");async function Ghe(t,e){let n=await ct(nr(t)),i=cc(t,"gui-port"),r=await bK(n,{version:dm(),...i===void 0?{}:{guiPort:i},...xe(t,"open")?{open:!0}:{},log:e,onQuit:a(()=>{process.kill(process.pid,"SIGTERM")},"onQuit")});for(let s of r.lines)e(s);let o=a(()=>{r.close()},"stop");return process.once("SIGINT",o),process.once("SIGTERM",o),0}a(Ghe,"trayCommand");async function Jhe(t,e){let n=It(t,"token");if(n===void 0||n.length===0)return e("The --token flag needs the code from the line in Tacticyl."),1;let i=si(Iu(t)),r=await xK({dir:process.cwd(),service:i.service,code:n,machine:It(t,"name")??Xs(),dryRun:xe(t,"dry-run"),skip:ZP(t),...xe(t,"replace")?{replace:!0}:{},...process.stdin.isTTY&&process.stdout.isTTY?{ask:Yhe}:{}});for(let o of SK(r))e(o);return 0}a(Jhe,"enrollCommand");async function Yhe(t,e){let n=(0,UK.createInterface)({input:process.stdin,output:process.stdout});try{return kK(await n.question(`${t} `),e)}finally{n.close()}}a(Yhe,"askInTerminal");function ZP(t){return zB.filter(e=>xe(t,`no-${e}`))}a(ZP,"skippedAgents");function Xhe(){let t=process.cwd(),e=Xe(t),n;try{n=si({dir:t}).service}catch{n=void 0}return{...n===void 0?{}:{service:n},repo:e?.repo??t}}a(Xhe,"failurePlace");async function Qhe(t,e,n){let i=t.positional[0];if(i==="on"){for(let s of hV())e(s);return 0}if(i==="off"){for(let s of gV())e(s);return 0}if(i!==void 0)return e(`tacticyl report: there is no "${i}". The three are \`tacticyl report\`, \`tacticyl report on\` and \`tacticyl report off\`.`),1;let r=si({dir:process.cwd(),...Iu(t)}),o=await lV({service:r.service,...n.fetch===void 0?{}:{fetch:n.fetch},confirm:a((s,c)=>{for(let u of dV(s,c))e(u);return xe(t,"yes")?Promise.resolve(!0):vV(fV)},"confirm")});return o.kind==="nothing"?(e(mV),0):(e(pV(o.sent)),0)}a(Qhe,"reportCommand");async function ege(t,e){let n=si({dir:process.cwd(),...Iu(t)}),i=await zK({dir:process.cwd(),service:n.service,dryRun:xe(t,"dry-run"),keepSignedIn:xe(t,"keep-signed-in"),skip:ZP(t)});for(let r of DK(i))e(r);return 0}a(ege,"removeCommand");0&&(module.exports={USAGE,main,renderTools,run});
|
|
1002
|
+
/*! Bundled license information:
|
|
1003
|
+
|
|
1004
|
+
content-type/index.js:
|
|
1005
|
+
(*!
|
|
1006
|
+
* content-type
|
|
1007
|
+
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
1008
|
+
* MIT Licensed
|
|
1009
|
+
*)
|
|
1010
|
+
*/
|
|
1011
|
+
module.exports.main(process.argv.slice(2));
|
|
1012
|
+
//# sourceMappingURL=tacticyl.cjs.map
|