@codeatlas/mcp 2.0.1 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -3
- package/dist/mcp-server.js +11 -11
- package/dist/webview-ui/dist/assets/index.css +1 -1
- package/dist/webview-ui/dist/assets/index.js +51 -18
- package/package.json +1 -1
package/dist/mcp-server.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict";var h5=Object.create;var Pm=Object.defineProperty;var m5=Object.getOwnPropertyDescriptor;var g5=Object.getOwnPropertyNames;var y5=Object.getPrototypeOf,_5=Object.prototype.hasOwnProperty;var Kt=(e,t)=>()=>(e&&(t=e(e=0)),t);var G=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),zn=(e,t)=>{for(var r in t)Pm(e,r,{get:t[r],enumerable:!0})},AO=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of g5(t))!_5.call(e,s)&&s!==r&&Pm(e,s,{get:()=>t[s],enumerable:!(n=m5(t,s))||n.enumerable});return e};var Fe=(e,t,r)=>(r=e!=null?h5(y5(e)):{},AO(t||!e||!e.__esModule?Pm(r,"default",{value:e,enumerable:!0}):r,e)),kO=e=>AO(Pm({},"__esModule",{value:!0}),e);var jp=G(tr=>{"use strict";Object.defineProperty(tr,"__esModule",{value:!0});tr.regexpCode=tr.getEsmExportName=tr.getProperty=tr.safeStringify=tr.stringify=tr.strConcat=tr.addCodeArg=tr.str=tr._=tr.nil=tr._Code=tr.Name=tr.IDENTIFIER=tr._CodeOrName=void 0;var Lp=class{};tr._CodeOrName=Lp;tr.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var cc=class extends Lp{constructor(t){if(super(),!tr.IDENTIFIER.test(t))throw new Error("CodeGen: name must be a valid identifier");this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};tr.Name=cc;var ji=class extends Lp{constructor(t){super(),this._items=typeof t=="string"?[t]:t}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let t=this._items[0];return t===""||t==='""'}get str(){var t;return(t=this._str)!==null&&t!==void 0?t:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var t;return(t=this._names)!==null&&t!==void 0?t:this._names=this._items.reduce((r,n)=>(n instanceof cc&&(r[n.str]=(r[n.str]||0)+1),r),{})}};tr._Code=ji;tr.nil=new ji("");function JD(e,...t){let r=[e[0]],n=0;for(;n<t.length;)d0(r,t[n]),r.push(e[++n]);return new ji(r)}tr._=JD;var u0=new ji("+");function YD(e,...t){let r=[Fp(e[0])],n=0;for(;n<t.length;)r.push(u0),d0(r,t[n]),r.push(u0,Fp(e[++n]));return rH(r),new ji(r)}tr.str=YD;function d0(e,t){t instanceof ji?e.push(...t._items):t instanceof cc?e.push(t):e.push(sH(t))}tr.addCodeArg=d0;function rH(e){let t=1;for(;t<e.length-1;){if(e[t]===u0){let r=nH(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}function nH(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string")return t instanceof cc||e[e.length-1]!=='"'?void 0:typeof t!="string"?`${e.slice(0,-1)}${t}"`:t[0]==='"'?e.slice(0,-1)+t.slice(1):void 0;if(typeof t=="string"&&t[0]==='"'&&!(e instanceof cc))return`"${e}${t.slice(1)}`}function iH(e,t){return t.emptyStr()?e:e.emptyStr()?t:YD`${e}${t}`}tr.strConcat=iH;function sH(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:Fp(Array.isArray(e)?e.join(","):e)}function aH(e){return new ji(Fp(e))}tr.stringify=aH;function Fp(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}tr.safeStringify=Fp;function oH(e){return typeof e=="string"&&tr.IDENTIFIER.test(e)?new ji(`.${e}`):JD`[${e}]`}tr.getProperty=oH;function cH(e){if(typeof e=="string"&&tr.IDENTIFIER.test(e))return new ji(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}tr.getEsmExportName=cH;function lH(e){return new ji(e.toString())}tr.regexpCode=lH});var h0=G(oi=>{"use strict";Object.defineProperty(oi,"__esModule",{value:!0});oi.ValueScope=oi.ValueScopeName=oi.Scope=oi.varKinds=oi.UsedValueState=void 0;var ai=jp(),p0=class extends Error{constructor(t){super(`CodeGen: "code" for ${t} not defined`),this.value=t.value}},Hg;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(Hg||(oi.UsedValueState=Hg={}));oi.varKinds={const:new ai.Name("const"),let:new ai.Name("let"),var:new ai.Name("var")};var Jg=class{constructor({prefixes:t,parent:r}={}){this._names={},this._prefixes=t,this._parent=r}toName(t){return t instanceof ai.Name?t:this.name(t)}name(t){return new ai.Name(this._newName(t))}_newName(t){let r=this._names[t]||this._nameGroup(t);return`${t}${r.index++}`}_nameGroup(t){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(t)||this._prefixes&&!this._prefixes.has(t))throw new Error(`CodeGen: prefix "${t}" is not allowed in this scope`);return this._names[t]={prefix:t,index:0}}};oi.Scope=Jg;var Yg=class extends ai.Name{constructor(t,r){super(r),this.prefix=t}setValue(t,{property:r,itemIndex:n}){this.value=t,this.scopePath=(0,ai._)`.${new ai.Name(r)}[${n}]`}};oi.ValueScopeName=Yg;var uH=(0,ai._)`\n`,f0=class extends Jg{constructor(t){super(t),this._values={},this._scope=t.scope,this.opts={...t,_n:t.lines?uH:ai.nil}}get(){return this._scope}name(t){return new Yg(t,this._newName(t))}value(t,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let s=this.toName(t),{prefix:a}=s,o=(n=r.key)!==null&&n!==void 0?n:r.ref,c=this._values[a];if(c){let d=c.get(o);if(d)return d}else c=this._values[a]=new Map;c.set(o,s);let l=this._scope[a]||(this._scope[a]=[]),u=l.length;return l[u]=r.ref,s.setValue(r,{property:a,itemIndex:u}),s}getValue(t,r){let n=this._values[t];if(n)return n.get(r)}scopeRefs(t,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,ai._)`${t}${n.scopePath}`})}scopeCode(t=this._values,r,n){return this._reduceValues(t,s=>{if(s.value===void 0)throw new Error(`CodeGen: name "${s}" has no value`);return s.value.code},r,n)}_reduceValues(t,r,n={},s){let a=ai.nil;for(let o in t){let c=t[o];if(!c)continue;let l=n[o]=n[o]||new Map;c.forEach(u=>{if(l.has(u))return;l.set(u,Hg.Started);let d=r(u);if(d){let p=this.opts.es5?oi.varKinds.var:oi.varKinds.const;a=(0,ai._)`${a}${p} ${u} = ${d};${this.opts._n}`}else if(d=s?.(u))a=(0,ai._)`${a}${d}${this.opts._n}`;else throw new p0(u);l.set(u,Hg.Completed)})}return a}};oi.ValueScope=f0});var Nt=G(Lt=>{"use strict";Object.defineProperty(Lt,"__esModule",{value:!0});Lt.or=Lt.and=Lt.not=Lt.CodeGen=Lt.operators=Lt.varKinds=Lt.ValueScopeName=Lt.ValueScope=Lt.Scope=Lt.Name=Lt.regexpCode=Lt.stringify=Lt.getProperty=Lt.nil=Lt.strConcat=Lt.str=Lt._=void 0;var Jt=jp(),hs=h0(),ao=jp();Object.defineProperty(Lt,"_",{enumerable:!0,get:function(){return ao._}});Object.defineProperty(Lt,"str",{enumerable:!0,get:function(){return ao.str}});Object.defineProperty(Lt,"strConcat",{enumerable:!0,get:function(){return ao.strConcat}});Object.defineProperty(Lt,"nil",{enumerable:!0,get:function(){return ao.nil}});Object.defineProperty(Lt,"getProperty",{enumerable:!0,get:function(){return ao.getProperty}});Object.defineProperty(Lt,"stringify",{enumerable:!0,get:function(){return ao.stringify}});Object.defineProperty(Lt,"regexpCode",{enumerable:!0,get:function(){return ao.regexpCode}});Object.defineProperty(Lt,"Name",{enumerable:!0,get:function(){return ao.Name}});var ty=h0();Object.defineProperty(Lt,"Scope",{enumerable:!0,get:function(){return ty.Scope}});Object.defineProperty(Lt,"ValueScope",{enumerable:!0,get:function(){return ty.ValueScope}});Object.defineProperty(Lt,"ValueScopeName",{enumerable:!0,get:function(){return ty.ValueScopeName}});Object.defineProperty(Lt,"varKinds",{enumerable:!0,get:function(){return ty.varKinds}});Lt.operators={GT:new Jt._Code(">"),GTE:new Jt._Code(">="),LT:new Jt._Code("<"),LTE:new Jt._Code("<="),EQ:new Jt._Code("==="),NEQ:new Jt._Code("!=="),NOT:new Jt._Code("!"),OR:new Jt._Code("||"),AND:new Jt._Code("&&"),ADD:new Jt._Code("+")};var ma=class{optimizeNodes(){return this}optimizeNames(t,r){return this}},m0=class extends ma{constructor(t,r,n){super(),this.varKind=t,this.name=r,this.rhs=n}render({es5:t,_n:r}){let n=t?hs.varKinds.var:this.varKind,s=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${s};`+r}optimizeNames(t,r){if(t[this.name.str])return this.rhs&&(this.rhs=Gl(this.rhs,t,r)),this}get names(){return this.rhs instanceof Jt._CodeOrName?this.rhs.names:{}}},Xg=class extends ma{constructor(t,r,n){super(),this.lhs=t,this.rhs=r,this.sideEffects=n}render({_n:t}){return`${this.lhs} = ${this.rhs};`+t}optimizeNames(t,r){if(!(this.lhs instanceof Jt.Name&&!t[this.lhs.str]&&!this.sideEffects))return this.rhs=Gl(this.rhs,t,r),this}get names(){let t=this.lhs instanceof Jt.Name?{}:{...this.lhs.names};return ey(t,this.rhs)}},g0=class extends Xg{constructor(t,r,n,s){super(t,n,s),this.op=r}render({_n:t}){return`${this.lhs} ${this.op}= ${this.rhs};`+t}},y0=class extends ma{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`${this.label}:`+t}},_0=class extends ma{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`break${this.label?` ${this.label}`:""};`+t}},b0=class extends ma{constructor(t){super(),this.error=t}render({_n:t}){return`throw ${this.error};`+t}get names(){return this.error.names}},v0=class extends ma{constructor(t){super(),this.code=t}render({_n:t}){return`${this.code};`+t}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(t,r){return this.code=Gl(this.code,t,r),this}get names(){return this.code instanceof Jt._CodeOrName?this.code.names:{}}},Bp=class extends ma{constructor(t=[]){super(),this.nodes=t}render(t){return this.nodes.reduce((r,n)=>r+n.render(t),"")}optimizeNodes(){let{nodes:t}=this,r=t.length;for(;r--;){let n=t[r].optimizeNodes();Array.isArray(n)?t.splice(r,1,...n):n?t[r]=n:t.splice(r,1)}return t.length>0?this:void 0}optimizeNames(t,r){let{nodes:n}=this,s=n.length;for(;s--;){let a=n[s];a.optimizeNames(t,r)||(dH(t,a.names),n.splice(s,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((t,r)=>dc(t,r.names),{})}},ga=class extends Bp{render(t){return"{"+t._n+super.render(t)+"}"+t._n}},x0=class extends Bp{},Kl=class extends ga{};Kl.kind="else";var lc=class e extends ga{constructor(t,r){super(r),this.condition=t}render(t){let r=`if(${this.condition})`+super.render(t);return this.else&&(r+="else "+this.else.render(t)),r}optimizeNodes(){super.optimizeNodes();let t=this.condition;if(t===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new Kl(n):n}if(r)return t===!1?r instanceof e?r:r.nodes:this.nodes.length?this:new e(XD(t),r instanceof e?[r]:r.nodes);if(!(t===!1||!this.nodes.length))return this}optimizeNames(t,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(t,r),!!(super.optimizeNames(t,r)||this.else))return this.condition=Gl(this.condition,t,r),this}get names(){let t=super.names;return ey(t,this.condition),this.else&&dc(t,this.else.names),t}};lc.kind="if";var uc=class extends ga{};uc.kind="for";var S0=class extends uc{constructor(t){super(),this.iteration=t}render(t){return`for(${this.iteration})`+super.render(t)}optimizeNames(t,r){if(super.optimizeNames(t,r))return this.iteration=Gl(this.iteration,t,r),this}get names(){return dc(super.names,this.iteration.names)}},T0=class extends uc{constructor(t,r,n,s){super(),this.varKind=t,this.name=r,this.from=n,this.to=s}render(t){let r=t.es5?hs.varKinds.var:this.varKind,{name:n,from:s,to:a}=this;return`for(${r} ${n}=${s}; ${n}<${a}; ${n}++)`+super.render(t)}get names(){let t=ey(super.names,this.from);return ey(t,this.to)}},Qg=class extends uc{constructor(t,r,n,s){super(),this.loop=t,this.varKind=r,this.name=n,this.iterable=s}render(t){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(t)}optimizeNames(t,r){if(super.optimizeNames(t,r))return this.iterable=Gl(this.iterable,t,r),this}get names(){return dc(super.names,this.iterable.names)}},zp=class extends ga{constructor(t,r,n){super(),this.name=t,this.args=r,this.async=n}render(t){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(t)}};zp.kind="func";var Up=class extends Bp{render(t){return"return "+super.render(t)}};Up.kind="return";var w0=class extends ga{render(t){let r="try"+super.render(t);return this.catch&&(r+=this.catch.render(t)),this.finally&&(r+=this.finally.render(t)),r}optimizeNodes(){var t,r;return super.optimizeNodes(),(t=this.catch)===null||t===void 0||t.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(t,r){var n,s;return super.optimizeNames(t,r),(n=this.catch)===null||n===void 0||n.optimizeNames(t,r),(s=this.finally)===null||s===void 0||s.optimizeNames(t,r),this}get names(){let t=super.names;return this.catch&&dc(t,this.catch.names),this.finally&&dc(t,this.finally.names),t}},qp=class extends ga{constructor(t){super(),this.error=t}render(t){return`catch(${this.error})`+super.render(t)}};qp.kind="catch";var Wp=class extends ga{render(t){return"finally"+super.render(t)}};Wp.kind="finally";var E0=class{constructor(t,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
|
|
3
|
-
`:""},this._extScope=t,this._scope=new hs.Scope({parent:t}),this._nodes=[new x0]}toString(){return this._root.render(this.opts)}name(t){return this._scope.name(t)}scopeName(t){return this._extScope.name(t)}scopeValue(t,r){let n=this._extScope.value(t,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(t,r){return this._extScope.getValue(t,r)}scopeRefs(t){return this._extScope.scopeRefs(t,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(t,r,n,s){let a=this._scope.toName(r);return n!==void 0&&s&&(this._constants[a.str]=n),this._leafNode(new m0(t,a,n)),a}const(t,r,n){return this._def(hs.varKinds.const,t,r,n)}let(t,r,n){return this._def(hs.varKinds.let,t,r,n)}var(t,r,n){return this._def(hs.varKinds.var,t,r,n)}assign(t,r,n){return this._leafNode(new Xg(t,r,n))}add(t,r){return this._leafNode(new g0(t,Lt.operators.ADD,r))}code(t){return typeof t=="function"?t():t!==Jt.nil&&this._leafNode(new v0(t)),this}object(...t){let r=["{"];for(let[n,s]of t)r.length>1&&r.push(","),r.push(n),(n!==s||this.opts.es5)&&(r.push(":"),(0,Jt.addCodeArg)(r,s));return r.push("}"),new Jt._Code(r)}if(t,r,n){if(this._blockNode(new lc(t)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(t){return this._elseNode(new lc(t))}else(){return this._elseNode(new Kl)}endIf(){return this._endBlockNode(lc,Kl)}_for(t,r){return this._blockNode(t),r&&this.code(r).endFor(),this}for(t,r){return this._for(new S0(t),r)}forRange(t,r,n,s,a=this.opts.es5?hs.varKinds.var:hs.varKinds.let){let o=this._scope.toName(t);return this._for(new T0(a,o,r,n),()=>s(o))}forOf(t,r,n,s=hs.varKinds.const){let a=this._scope.toName(t);if(this.opts.es5){let o=r instanceof Jt.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,Jt._)`${o}.length`,c=>{this.var(a,(0,Jt._)`${o}[${c}]`),n(a)})}return this._for(new Qg("of",s,a,r),()=>n(a))}forIn(t,r,n,s=this.opts.es5?hs.varKinds.var:hs.varKinds.const){if(this.opts.ownProperties)return this.forOf(t,(0,Jt._)`Object.keys(${r})`,n);let a=this._scope.toName(t);return this._for(new Qg("in",s,a,r),()=>n(a))}endFor(){return this._endBlockNode(uc)}label(t){return this._leafNode(new y0(t))}break(t){return this._leafNode(new _0(t))}return(t){let r=new Up;if(this._blockNode(r),this.code(t),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Up)}try(t,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let s=new w0;if(this._blockNode(s),this.code(t),r){let a=this.name("e");this._currNode=s.catch=new qp(a),r(a)}return n&&(this._currNode=s.finally=new Wp,this.code(n)),this._endBlockNode(qp,Wp)}throw(t){return this._leafNode(new b0(t))}block(t,r){return this._blockStarts.push(this._nodes.length),t&&this.code(t).endBlock(r),this}endBlock(t){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||t!==void 0&&n!==t)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${t} expected`);return this._nodes.length=r,this}func(t,r=Jt.nil,n,s){return this._blockNode(new zp(t,r,n)),s&&this.code(s).endFunc(),this}endFunc(){return this._endBlockNode(zp)}optimize(t=1){for(;t-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(t){return this._currNode.nodes.push(t),this}_blockNode(t){this._currNode.nodes.push(t),this._nodes.push(t)}_endBlockNode(t,r){let n=this._currNode;if(n instanceof t||r&&n instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${t.kind}/${r.kind}`:t.kind}"`)}_elseNode(t){let r=this._currNode;if(!(r instanceof lc))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=t,this}get _root(){return this._nodes[0]}get _currNode(){let t=this._nodes;return t[t.length-1]}set _currNode(t){let r=this._nodes;r[r.length-1]=t}};Lt.CodeGen=E0;function dc(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function ey(e,t){return t instanceof Jt._CodeOrName?dc(e,t.names):e}function Gl(e,t,r){if(e instanceof Jt.Name)return n(e);if(!s(e))return e;return new Jt._Code(e._items.reduce((a,o)=>(o instanceof Jt.Name&&(o=n(o)),o instanceof Jt._Code?a.push(...o._items):a.push(o),a),[]));function n(a){let o=r[a.str];return o===void 0||t[a.str]!==1?a:(delete t[a.str],o)}function s(a){return a instanceof Jt._Code&&a._items.some(o=>o instanceof Jt.Name&&t[o.str]===1&&r[o.str]!==void 0)}}function dH(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}function XD(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:(0,Jt._)`!${P0(e)}`}Lt.not=XD;var pH=QD(Lt.operators.AND);function fH(...e){return e.reduce(pH)}Lt.and=fH;var hH=QD(Lt.operators.OR);function mH(...e){return e.reduce(hH)}Lt.or=mH;function QD(e){return(t,r)=>t===Jt.nil?r:r===Jt.nil?t:(0,Jt._)`${P0(t)} ${e} ${P0(r)}`}function P0(e){return e instanceof Jt.Name?e:(0,Jt._)`(${e})`}});var Qt=G(zt=>{"use strict";Object.defineProperty(zt,"__esModule",{value:!0});zt.checkStrictMode=zt.getErrorPath=zt.Type=zt.useFunc=zt.setEvaluated=zt.evaluatedPropsToName=zt.mergeEvaluated=zt.eachItem=zt.unescapeJsonPointer=zt.escapeJsonPointer=zt.escapeFragment=zt.unescapeFragment=zt.schemaRefOrVal=zt.schemaHasRulesButRef=zt.schemaHasRules=zt.checkUnknownRules=zt.alwaysValidSchema=zt.toHash=void 0;var vr=Nt(),gH=jp();function yH(e){let t={};for(let r of e)t[r]=!0;return t}zt.toHash=yH;function _H(e,t){return typeof t=="boolean"?t:Object.keys(t).length===0?!0:(rM(e,t),!nM(t,e.self.RULES.all))}zt.alwaysValidSchema=_H;function rM(e,t=e.schema){let{opts:r,self:n}=e;if(!r.strictSchema||typeof t=="boolean")return;let s=n.RULES.keywords;for(let a in t)s[a]||aM(e,`unknown keyword: "${a}"`)}zt.checkUnknownRules=rM;function nM(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(t[r])return!0;return!1}zt.schemaHasRules=nM;function bH(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}zt.schemaHasRulesButRef=bH;function vH({topSchemaRef:e,schemaPath:t},r,n,s){if(!s){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,vr._)`${r}`}return(0,vr._)`${e}${t}${(0,vr.getProperty)(n)}`}zt.schemaRefOrVal=vH;function xH(e){return iM(decodeURIComponent(e))}zt.unescapeFragment=xH;function SH(e){return encodeURIComponent(A0(e))}zt.escapeFragment=SH;function A0(e){return typeof e=="number"?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}zt.escapeJsonPointer=A0;function iM(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}zt.unescapeJsonPointer=iM;function TH(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)}zt.eachItem=TH;function eM({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(s,a,o,c)=>{let l=o===void 0?a:o instanceof vr.Name?(a instanceof vr.Name?e(s,a,o):t(s,a,o),o):a instanceof vr.Name?(t(s,o,a),a):r(a,o);return c===vr.Name&&!(l instanceof vr.Name)?n(s,l):l}}zt.mergeEvaluated={props:eM({mergeNames:(e,t,r)=>e.if((0,vr._)`${r} !== true && ${t} !== undefined`,()=>{e.if((0,vr._)`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,(0,vr._)`${r} || {}`).code((0,vr._)`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if((0,vr._)`${r} !== true`,()=>{t===!0?e.assign(r,!0):(e.assign(r,(0,vr._)`${r} || {}`),k0(e,r,t))}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:sM}),items:eM({mergeNames:(e,t,r)=>e.if((0,vr._)`${r} !== true && ${t} !== undefined`,()=>e.assign(r,(0,vr._)`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if((0,vr._)`${r} !== true`,()=>e.assign(r,t===!0?!0:(0,vr._)`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function sM(e,t){if(t===!0)return e.var("props",!0);let r=e.var("props",(0,vr._)`{}`);return t!==void 0&&k0(e,r,t),r}zt.evaluatedPropsToName=sM;function k0(e,t,r){Object.keys(r).forEach(n=>e.assign((0,vr._)`${t}${(0,vr.getProperty)(n)}`,!0))}zt.setEvaluated=k0;var tM={};function wH(e,t){return e.scopeValue("func",{ref:t,code:tM[t.code]||(tM[t.code]=new gH._Code(t.code))})}zt.useFunc=wH;var I0;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(I0||(zt.Type=I0={}));function EH(e,t,r){if(e instanceof vr.Name){let n=t===I0.Num;return r?n?(0,vr._)`"[" + ${e} + "]"`:(0,vr._)`"['" + ${e} + "']"`:n?(0,vr._)`"/" + ${e}`:(0,vr._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,vr.getProperty)(e).toString():"/"+A0(e)}zt.getErrorPath=EH;function aM(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,r===!0)throw new Error(t);e.self.logger.warn(t)}}zt.checkStrictMode=aM});var ya=G(C0=>{"use strict";Object.defineProperty(C0,"__esModule",{value:!0});var $n=Nt(),PH={data:new $n.Name("data"),valCxt:new $n.Name("valCxt"),instancePath:new $n.Name("instancePath"),parentData:new $n.Name("parentData"),parentDataProperty:new $n.Name("parentDataProperty"),rootData:new $n.Name("rootData"),dynamicAnchors:new $n.Name("dynamicAnchors"),vErrors:new $n.Name("vErrors"),errors:new $n.Name("errors"),this:new $n.Name("this"),self:new $n.Name("self"),scope:new $n.Name("scope"),json:new $n.Name("json"),jsonPos:new $n.Name("jsonPos"),jsonLen:new $n.Name("jsonLen"),jsonPart:new $n.Name("jsonPart")};C0.default=PH});var Vp=G(Rn=>{"use strict";Object.defineProperty(Rn,"__esModule",{value:!0});Rn.extendErrors=Rn.resetErrorsCount=Rn.reportExtraError=Rn.reportError=Rn.keyword$DataError=Rn.keywordError=void 0;var er=Nt(),ry=Qt(),Gn=ya();Rn.keywordError={message:({keyword:e})=>(0,er.str)`must pass "${e}" keyword validation`};Rn.keyword$DataError={message:({keyword:e,schemaType:t})=>t?(0,er.str)`"${e}" keyword must be ${t} ($data)`:(0,er.str)`"${e}" keyword is invalid ($data)`};function IH(e,t=Rn.keywordError,r,n){let{it:s}=e,{gen:a,compositeRule:o,allErrors:c}=s,l=lM(e,t,r);n??(o||c)?oM(a,l):cM(s,(0,er._)`[${l}]`)}Rn.reportError=IH;function AH(e,t=Rn.keywordError,r){let{it:n}=e,{gen:s,compositeRule:a,allErrors:o}=n,c=lM(e,t,r);oM(s,c),a||o||cM(n,Gn.default.vErrors)}Rn.reportExtraError=AH;function kH(e,t){e.assign(Gn.default.errors,t),e.if((0,er._)`${Gn.default.vErrors} !== null`,()=>e.if(t,()=>e.assign((0,er._)`${Gn.default.vErrors}.length`,t),()=>e.assign(Gn.default.vErrors,null)))}Rn.resetErrorsCount=kH;function CH({gen:e,keyword:t,schemaValue:r,data:n,errsCount:s,it:a}){if(s===void 0)throw new Error("ajv implementation error");let o=e.name("err");e.forRange("i",s,Gn.default.errors,c=>{e.const(o,(0,er._)`${Gn.default.vErrors}[${c}]`),e.if((0,er._)`${o}.instancePath === undefined`,()=>e.assign((0,er._)`${o}.instancePath`,(0,er.strConcat)(Gn.default.instancePath,a.errorPath))),e.assign((0,er._)`${o}.schemaPath`,(0,er.str)`${a.errSchemaPath}/${t}`),a.opts.verbose&&(e.assign((0,er._)`${o}.schema`,r),e.assign((0,er._)`${o}.data`,n))})}Rn.extendErrors=CH;function oM(e,t){let r=e.const("err",t);e.if((0,er._)`${Gn.default.vErrors} === null`,()=>e.assign(Gn.default.vErrors,(0,er._)`[${r}]`),(0,er._)`${Gn.default.vErrors}.push(${r})`),e.code((0,er._)`${Gn.default.errors}++`)}function cM(e,t){let{gen:r,validateName:n,schemaEnv:s}=e;s.$async?r.throw((0,er._)`new ${e.ValidationError}(${t})`):(r.assign((0,er._)`${n}.errors`,t),r.return(!1))}var pc={keyword:new er.Name("keyword"),schemaPath:new er.Name("schemaPath"),params:new er.Name("params"),propertyName:new er.Name("propertyName"),message:new er.Name("message"),schema:new er.Name("schema"),parentSchema:new er.Name("parentSchema")};function lM(e,t,r){let{createErrors:n}=e.it;return n===!1?(0,er._)`{}`:NH(e,t,r)}function NH(e,t,r={}){let{gen:n,it:s}=e,a=[OH(s,r),$H(e,r)];return RH(e,t,a),n.object(...a)}function OH({errorPath:e},{instancePath:t}){let r=t?(0,er.str)`${e}${(0,ry.getErrorPath)(t,ry.Type.Str)}`:e;return[Gn.default.instancePath,(0,er.strConcat)(Gn.default.instancePath,r)]}function $H({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:n}){let s=n?t:(0,er.str)`${t}/${e}`;return r&&(s=(0,er.str)`${s}${(0,ry.getErrorPath)(r,ry.Type.Str)}`),[pc.schemaPath,s]}function RH(e,{params:t,message:r},n){let{keyword:s,data:a,schemaValue:o,it:c}=e,{opts:l,propertyName:u,topSchemaRef:d,schemaPath:p}=c;n.push([pc.keyword,s],[pc.params,typeof t=="function"?t(e):t||(0,er._)`{}`]),l.messages&&n.push([pc.message,typeof r=="function"?r(e):r]),l.verbose&&n.push([pc.schema,o],[pc.parentSchema,(0,er._)`${d}${p}`],[Gn.default.data,a]),u&&n.push([pc.propertyName,u])}});var dM=G(Zl=>{"use strict";Object.defineProperty(Zl,"__esModule",{value:!0});Zl.boolOrEmptySchema=Zl.topBoolOrEmptySchema=void 0;var DH=Vp(),MH=Nt(),LH=ya(),FH={message:"boolean schema is false"};function jH(e){let{gen:t,schema:r,validateName:n}=e;r===!1?uM(e,!1):typeof r=="object"&&r.$async===!0?t.return(LH.default.data):(t.assign((0,MH._)`${n}.errors`,null),t.return(!0))}Zl.topBoolOrEmptySchema=jH;function BH(e,t){let{gen:r,schema:n}=e;n===!1?(r.var(t,!1),uM(e)):r.var(t,!0)}Zl.boolOrEmptySchema=BH;function uM(e,t){let{gen:r,data:n}=e,s={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,DH.reportError)(s,FH,void 0,t)}});var N0=G(Hl=>{"use strict";Object.defineProperty(Hl,"__esModule",{value:!0});Hl.getRules=Hl.isJSONType=void 0;var zH=["string","number","integer","boolean","null","object","array"],UH=new Set(zH);function qH(e){return typeof e=="string"&&UH.has(e)}Hl.isJSONType=qH;function WH(){let e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}Hl.getRules=WH});var O0=G(oo=>{"use strict";Object.defineProperty(oo,"__esModule",{value:!0});oo.shouldUseRule=oo.shouldUseGroup=oo.schemaHasRulesForType=void 0;function VH({schema:e,self:t},r){let n=t.RULES.types[r];return n&&n!==!0&&pM(e,n)}oo.schemaHasRulesForType=VH;function pM(e,t){return t.rules.some(r=>fM(e,r))}oo.shouldUseGroup=pM;function fM(e,t){var r;return e[t.keyword]!==void 0||((r=t.definition.implements)===null||r===void 0?void 0:r.some(n=>e[n]!==void 0))}oo.shouldUseRule=fM});var Kp=G(Dn=>{"use strict";Object.defineProperty(Dn,"__esModule",{value:!0});Dn.reportTypeError=Dn.checkDataTypes=Dn.checkDataType=Dn.coerceAndCheckDataType=Dn.getJSONTypes=Dn.getSchemaTypes=Dn.DataType=void 0;var KH=N0(),GH=O0(),ZH=Vp(),kt=Nt(),hM=Qt(),Jl;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(Jl||(Dn.DataType=Jl={}));function HH(e){let t=mM(e.type);if(t.includes("null")){if(e.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&e.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');e.nullable===!0&&t.push("null")}return t}Dn.getSchemaTypes=HH;function mM(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(KH.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}Dn.getJSONTypes=mM;function JH(e,t){let{gen:r,data:n,opts:s}=e,a=YH(t,s.coerceTypes),o=t.length>0&&!(a.length===0&&t.length===1&&(0,GH.schemaHasRulesForType)(e,t[0]));if(o){let c=R0(t,n,s.strictNumbers,Jl.Wrong);r.if(c,()=>{a.length?XH(e,t,a):D0(e)})}return o}Dn.coerceAndCheckDataType=JH;var gM=new Set(["string","number","integer","boolean","null"]);function YH(e,t){return t?e.filter(r=>gM.has(r)||t==="array"&&r==="array"):[]}function XH(e,t,r){let{gen:n,data:s,opts:a}=e,o=n.let("dataType",(0,kt._)`typeof ${s}`),c=n.let("coerced",(0,kt._)`undefined`);a.coerceTypes==="array"&&n.if((0,kt._)`${o} == 'object' && Array.isArray(${s}) && ${s}.length == 1`,()=>n.assign(s,(0,kt._)`${s}[0]`).assign(o,(0,kt._)`typeof ${s}`).if(R0(t,s,a.strictNumbers),()=>n.assign(c,s))),n.if((0,kt._)`${c} !== undefined`);for(let u of r)(gM.has(u)||u==="array"&&a.coerceTypes==="array")&&l(u);n.else(),D0(e),n.endIf(),n.if((0,kt._)`${c} !== undefined`,()=>{n.assign(s,c),QH(e,c)});function l(u){switch(u){case"string":n.elseIf((0,kt._)`${o} == "number" || ${o} == "boolean"`).assign(c,(0,kt._)`"" + ${s}`).elseIf((0,kt._)`${s} === null`).assign(c,(0,kt._)`""`);return;case"number":n.elseIf((0,kt._)`${o} == "boolean" || ${s} === null
|
|
3
|
+
`:""},this._extScope=t,this._scope=new hs.Scope({parent:t}),this._nodes=[new x0]}toString(){return this._root.render(this.opts)}name(t){return this._scope.name(t)}scopeName(t){return this._extScope.name(t)}scopeValue(t,r){let n=this._extScope.value(t,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(t,r){return this._extScope.getValue(t,r)}scopeRefs(t){return this._extScope.scopeRefs(t,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(t,r,n,s){let a=this._scope.toName(r);return n!==void 0&&s&&(this._constants[a.str]=n),this._leafNode(new m0(t,a,n)),a}const(t,r,n){return this._def(hs.varKinds.const,t,r,n)}let(t,r,n){return this._def(hs.varKinds.let,t,r,n)}var(t,r,n){return this._def(hs.varKinds.var,t,r,n)}assign(t,r,n){return this._leafNode(new Xg(t,r,n))}add(t,r){return this._leafNode(new g0(t,Lt.operators.ADD,r))}code(t){return typeof t=="function"?t():t!==Jt.nil&&this._leafNode(new v0(t)),this}object(...t){let r=["{"];for(let[n,s]of t)r.length>1&&r.push(","),r.push(n),(n!==s||this.opts.es5)&&(r.push(":"),(0,Jt.addCodeArg)(r,s));return r.push("}"),new Jt._Code(r)}if(t,r,n){if(this._blockNode(new lc(t)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(t){return this._elseNode(new lc(t))}else(){return this._elseNode(new Kl)}endIf(){return this._endBlockNode(lc,Kl)}_for(t,r){return this._blockNode(t),r&&this.code(r).endFor(),this}for(t,r){return this._for(new S0(t),r)}forRange(t,r,n,s,a=this.opts.es5?hs.varKinds.var:hs.varKinds.let){let o=this._scope.toName(t);return this._for(new T0(a,o,r,n),()=>s(o))}forOf(t,r,n,s=hs.varKinds.const){let a=this._scope.toName(t);if(this.opts.es5){let o=r instanceof Jt.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,Jt._)`${o}.length`,c=>{this.var(a,(0,Jt._)`${o}[${c}]`),n(a)})}return this._for(new Qg("of",s,a,r),()=>n(a))}forIn(t,r,n,s=this.opts.es5?hs.varKinds.var:hs.varKinds.const){if(this.opts.ownProperties)return this.forOf(t,(0,Jt._)`Object.keys(${r})`,n);let a=this._scope.toName(t);return this._for(new Qg("in",s,a,r),()=>n(a))}endFor(){return this._endBlockNode(uc)}label(t){return this._leafNode(new y0(t))}break(t){return this._leafNode(new _0(t))}return(t){let r=new Up;if(this._blockNode(r),this.code(t),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Up)}try(t,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let s=new w0;if(this._blockNode(s),this.code(t),r){let a=this.name("e");this._currNode=s.catch=new qp(a),r(a)}return n&&(this._currNode=s.finally=new Wp,this.code(n)),this._endBlockNode(qp,Wp)}throw(t){return this._leafNode(new b0(t))}block(t,r){return this._blockStarts.push(this._nodes.length),t&&this.code(t).endBlock(r),this}endBlock(t){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||t!==void 0&&n!==t)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${t} expected`);return this._nodes.length=r,this}func(t,r=Jt.nil,n,s){return this._blockNode(new zp(t,r,n)),s&&this.code(s).endFunc(),this}endFunc(){return this._endBlockNode(zp)}optimize(t=1){for(;t-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(t){return this._currNode.nodes.push(t),this}_blockNode(t){this._currNode.nodes.push(t),this._nodes.push(t)}_endBlockNode(t,r){let n=this._currNode;if(n instanceof t||r&&n instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${t.kind}/${r.kind}`:t.kind}"`)}_elseNode(t){let r=this._currNode;if(!(r instanceof lc))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=t,this}get _root(){return this._nodes[0]}get _currNode(){let t=this._nodes;return t[t.length-1]}set _currNode(t){let r=this._nodes;r[r.length-1]=t}};Lt.CodeGen=E0;function dc(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function ey(e,t){return t instanceof Jt._CodeOrName?dc(e,t.names):e}function Gl(e,t,r){if(e instanceof Jt.Name)return n(e);if(!s(e))return e;return new Jt._Code(e._items.reduce((a,o)=>(o instanceof Jt.Name&&(o=n(o)),o instanceof Jt._Code?a.push(...o._items):a.push(o),a),[]));function n(a){let o=r[a.str];return o===void 0||t[a.str]!==1?a:(delete t[a.str],o)}function s(a){return a instanceof Jt._Code&&a._items.some(o=>o instanceof Jt.Name&&t[o.str]===1&&r[o.str]!==void 0)}}function dH(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}function XD(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:(0,Jt._)`!${P0(e)}`}Lt.not=XD;var pH=QD(Lt.operators.AND);function fH(...e){return e.reduce(pH)}Lt.and=fH;var hH=QD(Lt.operators.OR);function mH(...e){return e.reduce(hH)}Lt.or=mH;function QD(e){return(t,r)=>t===Jt.nil?r:r===Jt.nil?t:(0,Jt._)`${P0(t)} ${e} ${P0(r)}`}function P0(e){return e instanceof Jt.Name?e:(0,Jt._)`(${e})`}});var Qt=G(zt=>{"use strict";Object.defineProperty(zt,"__esModule",{value:!0});zt.checkStrictMode=zt.getErrorPath=zt.Type=zt.useFunc=zt.setEvaluated=zt.evaluatedPropsToName=zt.mergeEvaluated=zt.eachItem=zt.unescapeJsonPointer=zt.escapeJsonPointer=zt.escapeFragment=zt.unescapeFragment=zt.schemaRefOrVal=zt.schemaHasRulesButRef=zt.schemaHasRules=zt.checkUnknownRules=zt.alwaysValidSchema=zt.toHash=void 0;var xr=Nt(),gH=jp();function yH(e){let t={};for(let r of e)t[r]=!0;return t}zt.toHash=yH;function _H(e,t){return typeof t=="boolean"?t:Object.keys(t).length===0?!0:(rM(e,t),!nM(t,e.self.RULES.all))}zt.alwaysValidSchema=_H;function rM(e,t=e.schema){let{opts:r,self:n}=e;if(!r.strictSchema||typeof t=="boolean")return;let s=n.RULES.keywords;for(let a in t)s[a]||aM(e,`unknown keyword: "${a}"`)}zt.checkUnknownRules=rM;function nM(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(t[r])return!0;return!1}zt.schemaHasRules=nM;function bH(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}zt.schemaHasRulesButRef=bH;function vH({topSchemaRef:e,schemaPath:t},r,n,s){if(!s){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,xr._)`${r}`}return(0,xr._)`${e}${t}${(0,xr.getProperty)(n)}`}zt.schemaRefOrVal=vH;function xH(e){return iM(decodeURIComponent(e))}zt.unescapeFragment=xH;function SH(e){return encodeURIComponent(A0(e))}zt.escapeFragment=SH;function A0(e){return typeof e=="number"?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}zt.escapeJsonPointer=A0;function iM(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}zt.unescapeJsonPointer=iM;function TH(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)}zt.eachItem=TH;function eM({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(s,a,o,c)=>{let l=o===void 0?a:o instanceof xr.Name?(a instanceof xr.Name?e(s,a,o):t(s,a,o),o):a instanceof xr.Name?(t(s,o,a),a):r(a,o);return c===xr.Name&&!(l instanceof xr.Name)?n(s,l):l}}zt.mergeEvaluated={props:eM({mergeNames:(e,t,r)=>e.if((0,xr._)`${r} !== true && ${t} !== undefined`,()=>{e.if((0,xr._)`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,(0,xr._)`${r} || {}`).code((0,xr._)`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if((0,xr._)`${r} !== true`,()=>{t===!0?e.assign(r,!0):(e.assign(r,(0,xr._)`${r} || {}`),k0(e,r,t))}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:sM}),items:eM({mergeNames:(e,t,r)=>e.if((0,xr._)`${r} !== true && ${t} !== undefined`,()=>e.assign(r,(0,xr._)`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if((0,xr._)`${r} !== true`,()=>e.assign(r,t===!0?!0:(0,xr._)`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function sM(e,t){if(t===!0)return e.var("props",!0);let r=e.var("props",(0,xr._)`{}`);return t!==void 0&&k0(e,r,t),r}zt.evaluatedPropsToName=sM;function k0(e,t,r){Object.keys(r).forEach(n=>e.assign((0,xr._)`${t}${(0,xr.getProperty)(n)}`,!0))}zt.setEvaluated=k0;var tM={};function wH(e,t){return e.scopeValue("func",{ref:t,code:tM[t.code]||(tM[t.code]=new gH._Code(t.code))})}zt.useFunc=wH;var I0;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(I0||(zt.Type=I0={}));function EH(e,t,r){if(e instanceof xr.Name){let n=t===I0.Num;return r?n?(0,xr._)`"[" + ${e} + "]"`:(0,xr._)`"['" + ${e} + "']"`:n?(0,xr._)`"/" + ${e}`:(0,xr._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,xr.getProperty)(e).toString():"/"+A0(e)}zt.getErrorPath=EH;function aM(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,r===!0)throw new Error(t);e.self.logger.warn(t)}}zt.checkStrictMode=aM});var ya=G(C0=>{"use strict";Object.defineProperty(C0,"__esModule",{value:!0});var $n=Nt(),PH={data:new $n.Name("data"),valCxt:new $n.Name("valCxt"),instancePath:new $n.Name("instancePath"),parentData:new $n.Name("parentData"),parentDataProperty:new $n.Name("parentDataProperty"),rootData:new $n.Name("rootData"),dynamicAnchors:new $n.Name("dynamicAnchors"),vErrors:new $n.Name("vErrors"),errors:new $n.Name("errors"),this:new $n.Name("this"),self:new $n.Name("self"),scope:new $n.Name("scope"),json:new $n.Name("json"),jsonPos:new $n.Name("jsonPos"),jsonLen:new $n.Name("jsonLen"),jsonPart:new $n.Name("jsonPart")};C0.default=PH});var Vp=G(Rn=>{"use strict";Object.defineProperty(Rn,"__esModule",{value:!0});Rn.extendErrors=Rn.resetErrorsCount=Rn.reportExtraError=Rn.reportError=Rn.keyword$DataError=Rn.keywordError=void 0;var er=Nt(),ry=Qt(),Gn=ya();Rn.keywordError={message:({keyword:e})=>(0,er.str)`must pass "${e}" keyword validation`};Rn.keyword$DataError={message:({keyword:e,schemaType:t})=>t?(0,er.str)`"${e}" keyword must be ${t} ($data)`:(0,er.str)`"${e}" keyword is invalid ($data)`};function IH(e,t=Rn.keywordError,r,n){let{it:s}=e,{gen:a,compositeRule:o,allErrors:c}=s,l=lM(e,t,r);n??(o||c)?oM(a,l):cM(s,(0,er._)`[${l}]`)}Rn.reportError=IH;function AH(e,t=Rn.keywordError,r){let{it:n}=e,{gen:s,compositeRule:a,allErrors:o}=n,c=lM(e,t,r);oM(s,c),a||o||cM(n,Gn.default.vErrors)}Rn.reportExtraError=AH;function kH(e,t){e.assign(Gn.default.errors,t),e.if((0,er._)`${Gn.default.vErrors} !== null`,()=>e.if(t,()=>e.assign((0,er._)`${Gn.default.vErrors}.length`,t),()=>e.assign(Gn.default.vErrors,null)))}Rn.resetErrorsCount=kH;function CH({gen:e,keyword:t,schemaValue:r,data:n,errsCount:s,it:a}){if(s===void 0)throw new Error("ajv implementation error");let o=e.name("err");e.forRange("i",s,Gn.default.errors,c=>{e.const(o,(0,er._)`${Gn.default.vErrors}[${c}]`),e.if((0,er._)`${o}.instancePath === undefined`,()=>e.assign((0,er._)`${o}.instancePath`,(0,er.strConcat)(Gn.default.instancePath,a.errorPath))),e.assign((0,er._)`${o}.schemaPath`,(0,er.str)`${a.errSchemaPath}/${t}`),a.opts.verbose&&(e.assign((0,er._)`${o}.schema`,r),e.assign((0,er._)`${o}.data`,n))})}Rn.extendErrors=CH;function oM(e,t){let r=e.const("err",t);e.if((0,er._)`${Gn.default.vErrors} === null`,()=>e.assign(Gn.default.vErrors,(0,er._)`[${r}]`),(0,er._)`${Gn.default.vErrors}.push(${r})`),e.code((0,er._)`${Gn.default.errors}++`)}function cM(e,t){let{gen:r,validateName:n,schemaEnv:s}=e;s.$async?r.throw((0,er._)`new ${e.ValidationError}(${t})`):(r.assign((0,er._)`${n}.errors`,t),r.return(!1))}var pc={keyword:new er.Name("keyword"),schemaPath:new er.Name("schemaPath"),params:new er.Name("params"),propertyName:new er.Name("propertyName"),message:new er.Name("message"),schema:new er.Name("schema"),parentSchema:new er.Name("parentSchema")};function lM(e,t,r){let{createErrors:n}=e.it;return n===!1?(0,er._)`{}`:NH(e,t,r)}function NH(e,t,r={}){let{gen:n,it:s}=e,a=[OH(s,r),$H(e,r)];return RH(e,t,a),n.object(...a)}function OH({errorPath:e},{instancePath:t}){let r=t?(0,er.str)`${e}${(0,ry.getErrorPath)(t,ry.Type.Str)}`:e;return[Gn.default.instancePath,(0,er.strConcat)(Gn.default.instancePath,r)]}function $H({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:n}){let s=n?t:(0,er.str)`${t}/${e}`;return r&&(s=(0,er.str)`${s}${(0,ry.getErrorPath)(r,ry.Type.Str)}`),[pc.schemaPath,s]}function RH(e,{params:t,message:r},n){let{keyword:s,data:a,schemaValue:o,it:c}=e,{opts:l,propertyName:u,topSchemaRef:d,schemaPath:p}=c;n.push([pc.keyword,s],[pc.params,typeof t=="function"?t(e):t||(0,er._)`{}`]),l.messages&&n.push([pc.message,typeof r=="function"?r(e):r]),l.verbose&&n.push([pc.schema,o],[pc.parentSchema,(0,er._)`${d}${p}`],[Gn.default.data,a]),u&&n.push([pc.propertyName,u])}});var dM=G(Zl=>{"use strict";Object.defineProperty(Zl,"__esModule",{value:!0});Zl.boolOrEmptySchema=Zl.topBoolOrEmptySchema=void 0;var DH=Vp(),MH=Nt(),LH=ya(),FH={message:"boolean schema is false"};function jH(e){let{gen:t,schema:r,validateName:n}=e;r===!1?uM(e,!1):typeof r=="object"&&r.$async===!0?t.return(LH.default.data):(t.assign((0,MH._)`${n}.errors`,null),t.return(!0))}Zl.topBoolOrEmptySchema=jH;function BH(e,t){let{gen:r,schema:n}=e;n===!1?(r.var(t,!1),uM(e)):r.var(t,!0)}Zl.boolOrEmptySchema=BH;function uM(e,t){let{gen:r,data:n}=e,s={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,DH.reportError)(s,FH,void 0,t)}});var N0=G(Hl=>{"use strict";Object.defineProperty(Hl,"__esModule",{value:!0});Hl.getRules=Hl.isJSONType=void 0;var zH=["string","number","integer","boolean","null","object","array"],UH=new Set(zH);function qH(e){return typeof e=="string"&&UH.has(e)}Hl.isJSONType=qH;function WH(){let e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}Hl.getRules=WH});var O0=G(oo=>{"use strict";Object.defineProperty(oo,"__esModule",{value:!0});oo.shouldUseRule=oo.shouldUseGroup=oo.schemaHasRulesForType=void 0;function VH({schema:e,self:t},r){let n=t.RULES.types[r];return n&&n!==!0&&pM(e,n)}oo.schemaHasRulesForType=VH;function pM(e,t){return t.rules.some(r=>fM(e,r))}oo.shouldUseGroup=pM;function fM(e,t){var r;return e[t.keyword]!==void 0||((r=t.definition.implements)===null||r===void 0?void 0:r.some(n=>e[n]!==void 0))}oo.shouldUseRule=fM});var Kp=G(Dn=>{"use strict";Object.defineProperty(Dn,"__esModule",{value:!0});Dn.reportTypeError=Dn.checkDataTypes=Dn.checkDataType=Dn.coerceAndCheckDataType=Dn.getJSONTypes=Dn.getSchemaTypes=Dn.DataType=void 0;var KH=N0(),GH=O0(),ZH=Vp(),kt=Nt(),hM=Qt(),Jl;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(Jl||(Dn.DataType=Jl={}));function HH(e){let t=mM(e.type);if(t.includes("null")){if(e.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&e.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');e.nullable===!0&&t.push("null")}return t}Dn.getSchemaTypes=HH;function mM(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(KH.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}Dn.getJSONTypes=mM;function JH(e,t){let{gen:r,data:n,opts:s}=e,a=YH(t,s.coerceTypes),o=t.length>0&&!(a.length===0&&t.length===1&&(0,GH.schemaHasRulesForType)(e,t[0]));if(o){let c=R0(t,n,s.strictNumbers,Jl.Wrong);r.if(c,()=>{a.length?XH(e,t,a):D0(e)})}return o}Dn.coerceAndCheckDataType=JH;var gM=new Set(["string","number","integer","boolean","null"]);function YH(e,t){return t?e.filter(r=>gM.has(r)||t==="array"&&r==="array"):[]}function XH(e,t,r){let{gen:n,data:s,opts:a}=e,o=n.let("dataType",(0,kt._)`typeof ${s}`),c=n.let("coerced",(0,kt._)`undefined`);a.coerceTypes==="array"&&n.if((0,kt._)`${o} == 'object' && Array.isArray(${s}) && ${s}.length == 1`,()=>n.assign(s,(0,kt._)`${s}[0]`).assign(o,(0,kt._)`typeof ${s}`).if(R0(t,s,a.strictNumbers),()=>n.assign(c,s))),n.if((0,kt._)`${c} !== undefined`);for(let u of r)(gM.has(u)||u==="array"&&a.coerceTypes==="array")&&l(u);n.else(),D0(e),n.endIf(),n.if((0,kt._)`${c} !== undefined`,()=>{n.assign(s,c),QH(e,c)});function l(u){switch(u){case"string":n.elseIf((0,kt._)`${o} == "number" || ${o} == "boolean"`).assign(c,(0,kt._)`"" + ${s}`).elseIf((0,kt._)`${s} === null`).assign(c,(0,kt._)`""`);return;case"number":n.elseIf((0,kt._)`${o} == "boolean" || ${s} === null
|
|
4
4
|
|| (${o} == "string" && ${s} && ${s} == +${s})`).assign(c,(0,kt._)`+${s}`);return;case"integer":n.elseIf((0,kt._)`${o} === "boolean" || ${s} === null
|
|
5
5
|
|| (${o} === "string" && ${s} && ${s} == +${s} && !(${s} % 1))`).assign(c,(0,kt._)`+${s}`);return;case"boolean":n.elseIf((0,kt._)`${s} === "false" || ${s} === 0 || ${s} === null`).assign(c,!1).elseIf((0,kt._)`${s} === "true" || ${s} === 1`).assign(c,!0);return;case"null":n.elseIf((0,kt._)`${s} === "" || ${s} === 0 || ${s} === false`),n.assign(c,null);return;case"array":n.elseIf((0,kt._)`${o} === "string" || ${o} === "number"
|
|
6
|
-
|| ${o} === "boolean" || ${s} === null`).assign(c,(0,kt._)`[${s}]`)}}}function QH({gen:e,parentData:t,parentDataProperty:r},n){e.if((0,kt._)`${t} !== undefined`,()=>e.assign((0,kt._)`${t}[${r}]`,n))}function $0(e,t,r,n=Jl.Correct){let s=n===Jl.Correct?kt.operators.EQ:kt.operators.NEQ,a;switch(e){case"null":return(0,kt._)`${t} ${s} null`;case"array":a=(0,kt._)`Array.isArray(${t})`;break;case"object":a=(0,kt._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":a=o((0,kt._)`!(${t} % 1) && !isNaN(${t})`);break;case"number":a=o();break;default:return(0,kt._)`typeof ${t} ${s} ${e}`}return n===Jl.Correct?a:(0,kt.not)(a);function o(c=kt.nil){return(0,kt.and)((0,kt._)`typeof ${t} == "number"`,c,r?(0,kt._)`isFinite(${t})`:kt.nil)}}Dn.checkDataType=$0;function R0(e,t,r,n){if(e.length===1)return $0(e[0],t,r,n);let s,a=(0,hM.toHash)(e);if(a.array&&a.object){let o=(0,kt._)`typeof ${t} != "object"`;s=a.null?o:(0,kt._)`!${t} || ${o}`,delete a.null,delete a.array,delete a.object}else s=kt.nil;a.number&&delete a.integer;for(let o in a)s=(0,kt.and)(s,$0(o,t,r,n));return s}Dn.checkDataTypes=R0;var eJ={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?(0,kt._)`{type: ${e}}`:(0,kt._)`{type: ${t}}`};function D0(e){let t=tJ(e);(0,ZH.reportError)(t,eJ)}Dn.reportTypeError=D0;function tJ(e){let{gen:t,data:r,schema:n}=e,s=(0,hM.schemaRefOrVal)(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:s,schemaValue:s,parentSchema:n,params:{},it:e}}});var _M=G(ny=>{"use strict";Object.defineProperty(ny,"__esModule",{value:!0});ny.assignDefaults=void 0;var Yl=Nt(),rJ=Qt();function nJ(e,t){let{properties:r,items:n}=e.schema;if(t==="object"&&r)for(let s in r)yM(e,s,r[s].default);else t==="array"&&Array.isArray(n)&&n.forEach((s,a)=>yM(e,a,s.default))}ny.assignDefaults=nJ;function yM(e,t,r){let{gen:n,compositeRule:s,data:a,opts:o}=e;if(r===void 0)return;let c=(0,Yl._)`${a}${(0,Yl.getProperty)(t)}`;if(s){(0,rJ.checkStrictMode)(e,`default is ignored for: ${c}`);return}let l=(0,Yl._)`${c} === undefined`;o.useDefaults==="empty"&&(l=(0,Yl._)`${l} || ${c} === null || ${c} === ""`),n.if(l,(0,Yl._)`${c} = ${(0,Yl.stringify)(r)}`)}});var Bi=G(mr=>{"use strict";Object.defineProperty(mr,"__esModule",{value:!0});mr.validateUnion=mr.validateArray=mr.usePattern=mr.callValidateCode=mr.schemaProperties=mr.allSchemaProperties=mr.noPropertyInData=mr.propertyInData=mr.isOwnProperty=mr.hasPropFunc=mr.reportMissingProp=mr.checkMissingProp=mr.checkReportMissingProp=void 0;var Nr=Nt(),M0=Qt(),co=ya(),iJ=Qt();function sJ(e,t){let{gen:r,data:n,it:s}=e;r.if(F0(r,n,t,s.opts.ownProperties),()=>{e.setParams({missingProperty:(0,Nr._)`${t}`},!0),e.error()})}mr.checkReportMissingProp=sJ;function aJ({gen:e,data:t,it:{opts:r}},n,s){return(0,Nr.or)(...n.map(a=>(0,Nr.and)(F0(e,t,a,r.ownProperties),(0,Nr._)`${s} = ${a}`)))}mr.checkMissingProp=aJ;function oJ(e,t){e.setParams({missingProperty:t},!0),e.error()}mr.reportMissingProp=oJ;function bM(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,Nr._)`Object.prototype.hasOwnProperty`})}mr.hasPropFunc=bM;function L0(e,t,r){return(0,Nr._)`${bM(e)}.call(${t}, ${r})`}mr.isOwnProperty=L0;function cJ(e,t,r,n){let s=(0,Nr._)`${t}${(0,Nr.getProperty)(r)} !== undefined`;return n?(0,Nr._)`${s} && ${L0(e,t,r)}`:s}mr.propertyInData=cJ;function F0(e,t,r,n){let s=(0,Nr._)`${t}${(0,Nr.getProperty)(r)} === undefined`;return n?(0,Nr.or)(s,(0,Nr.not)(L0(e,t,r))):s}mr.noPropertyInData=F0;function vM(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}mr.allSchemaProperties=vM;function lJ(e,t){return vM(t).filter(r=>!(0,M0.alwaysValidSchema)(e,t[r]))}mr.schemaProperties=lJ;function uJ({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:s,errorPath:a},it:o},c,l,u){let d=u?(0,Nr._)`${e}, ${t}, ${n}${s}`:t,p=[[co.default.instancePath,(0,Nr.strConcat)(co.default.instancePath,a)],[co.default.parentData,o.parentData],[co.default.parentDataProperty,o.parentDataProperty],[co.default.rootData,co.default.rootData]];o.opts.dynamicRef&&p.push([co.default.dynamicAnchors,co.default.dynamicAnchors]);let f=(0,Nr._)`${d}, ${r.object(...p)}`;return l!==Nr.nil?(0,Nr._)`${c}.call(${l}, ${f})`:(0,Nr._)`${c}(${f})`}mr.callValidateCode=uJ;var dJ=(0,Nr._)`new RegExp`;function pJ({gen:e,it:{opts:t}},r){let n=t.unicodeRegExp?"u":"",{regExp:s}=t.code,a=s(r,n);return e.scopeValue("pattern",{key:a.toString(),ref:a,code:(0,Nr._)`${s.code==="new RegExp"?dJ:(0,iJ.useFunc)(e,s)}(${r}, ${n})`})}mr.usePattern=pJ;function fJ(e){let{gen:t,data:r,keyword:n,it:s}=e,a=t.name("valid");if(s.allErrors){let c=t.let("valid",!0);return o(()=>t.assign(c,!1)),c}return t.var(a,!0),o(()=>t.break()),a;function o(c){let l=t.const("len",(0,Nr._)`${r}.length`);t.forRange("i",0,l,u=>{e.subschema({keyword:n,dataProp:u,dataPropType:M0.Type.Num},a),t.if((0,Nr.not)(a),c)})}}mr.validateArray=fJ;function hJ(e){let{gen:t,schema:r,keyword:n,it:s}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(l=>(0,M0.alwaysValidSchema)(s,l))&&!s.opts.unevaluated)return;let o=t.let("valid",!1),c=t.name("_valid");t.block(()=>r.forEach((l,u)=>{let d=e.subschema({keyword:n,schemaProp:u,compositeRule:!0},c);t.assign(o,(0,Nr._)`${o} || ${c}`),e.mergeValidEvaluated(d,c)||t.if((0,Nr.not)(o))})),e.result(o,()=>e.reset(),()=>e.error(!0))}mr.validateUnion=hJ});var TM=G(Rs=>{"use strict";Object.defineProperty(Rs,"__esModule",{value:!0});Rs.validateKeywordUsage=Rs.validSchemaType=Rs.funcKeywordCode=Rs.macroKeywordCode=void 0;var Zn=Nt(),fc=ya(),mJ=Bi(),gJ=Vp();function yJ(e,t){let{gen:r,keyword:n,schema:s,parentSchema:a,it:o}=e,c=t.macro.call(o.self,s,a,o),l=SM(r,n,c);o.opts.validateSchema!==!1&&o.self.validateSchema(c,!0);let u=r.name("valid");e.subschema({schema:c,schemaPath:Zn.nil,errSchemaPath:`${o.errSchemaPath}/${n}`,topSchemaRef:l,compositeRule:!0},u),e.pass(u,()=>e.error(!0))}Rs.macroKeywordCode=yJ;function _J(e,t){var r;let{gen:n,keyword:s,schema:a,parentSchema:o,$data:c,it:l}=e;vJ(l,t);let u=!c&&t.compile?t.compile.call(l.self,a,o,l):t.validate,d=SM(n,s,u),p=n.let("valid");e.block$data(p,f),e.ok((r=t.valid)!==null&&r!==void 0?r:p);function f(){if(t.errors===!1)g(),t.modifying&&xM(e),y(()=>e.error());else{let _=t.async?h():m();t.modifying&&xM(e),y(()=>bJ(e,_))}}function h(){let _=n.let("ruleErrs",null);return n.try(()=>g((0,Zn._)`await `),v=>n.assign(p,!1).if((0,Zn._)`${v} instanceof ${l.ValidationError}`,()=>n.assign(_,(0,Zn._)`${v}.errors`),()=>n.throw(v))),_}function m(){let _=(0,Zn._)`${d}.errors`;return n.assign(_,null),g(Zn.nil),_}function g(_=t.async?(0,Zn._)`await `:Zn.nil){let v=l.opts.passContext?fc.default.this:fc.default.self,S=!("compile"in t&&!c||t.schema===!1);n.assign(p,(0,Zn._)`${_}${(0,mJ.callValidateCode)(e,d,v,S)}`,t.modifying)}function y(_){var v;n.if((0,Zn.not)((v=t.valid)!==null&&v!==void 0?v:p),_)}}Rs.funcKeywordCode=_J;function xM(e){let{gen:t,data:r,it:n}=e;t.if(n.parentData,()=>t.assign(r,(0,Zn._)`${n.parentData}[${n.parentDataProperty}]`))}function bJ(e,t){let{gen:r}=e;r.if((0,Zn._)`Array.isArray(${t})`,()=>{r.assign(fc.default.vErrors,(0,Zn._)`${fc.default.vErrors} === null ? ${t} : ${fc.default.vErrors}.concat(${t})`).assign(fc.default.errors,(0,Zn._)`${fc.default.vErrors}.length`),(0,gJ.extendErrors)(e)},()=>e.error())}function vJ({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}function SM(e,t,r){if(r===void 0)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,Zn.stringify)(r)})}function xJ(e,t,r=!1){return!t.length||t.some(n=>n==="array"?Array.isArray(e):n==="object"?e&&typeof e=="object"&&!Array.isArray(e):typeof e==n||r&&typeof e>"u")}Rs.validSchemaType=xJ;function SJ({schema:e,opts:t,self:r,errSchemaPath:n},s,a){if(Array.isArray(s.keyword)?!s.keyword.includes(a):s.keyword!==a)throw new Error("ajv implementation error");let o=s.dependencies;if(o?.some(c=>!Object.prototype.hasOwnProperty.call(e,c)))throw new Error(`parent schema must have dependencies of ${a}: ${o.join(",")}`);if(s.validateSchema&&!s.validateSchema(e[a])){let l=`keyword "${a}" value is invalid at path "${n}": `+r.errorsText(s.validateSchema.errors);if(t.validateSchema==="log")r.logger.error(l);else throw new Error(l)}}Rs.validateKeywordUsage=SJ});var EM=G(lo=>{"use strict";Object.defineProperty(lo,"__esModule",{value:!0});lo.extendSubschemaMode=lo.extendSubschemaData=lo.getSubschema=void 0;var Ds=Nt(),wM=Qt();function TJ(e,{keyword:t,schemaProp:r,schema:n,schemaPath:s,errSchemaPath:a,topSchemaRef:o}){if(t!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){let c=e.schema[t];return r===void 0?{schema:c,schemaPath:(0,Ds._)`${e.schemaPath}${(0,Ds.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:c[r],schemaPath:(0,Ds._)`${e.schemaPath}${(0,Ds.getProperty)(t)}${(0,Ds.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,wM.escapeFragment)(r)}`}}if(n!==void 0){if(s===void 0||a===void 0||o===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:s,topSchemaRef:o,errSchemaPath:a}}throw new Error('either "keyword" or "schema" must be passed')}lo.getSubschema=TJ;function wJ(e,t,{dataProp:r,dataPropType:n,data:s,dataTypes:a,propertyName:o}){if(s!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:c}=t;if(r!==void 0){let{errorPath:u,dataPathArr:d,opts:p}=t,f=c.let("data",(0,Ds._)`${t.data}${(0,Ds.getProperty)(r)}`,!0);l(f),e.errorPath=(0,Ds.str)`${u}${(0,wM.getErrorPath)(r,n,p.jsPropertySyntax)}`,e.parentDataProperty=(0,Ds._)`${r}`,e.dataPathArr=[...d,e.parentDataProperty]}if(s!==void 0){let u=s instanceof Ds.Name?s:c.let("data",s,!0);l(u),o!==void 0&&(e.propertyName=o)}a&&(e.dataTypes=a);function l(u){e.data=u,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,u]}}lo.extendSubschemaData=wJ;function EJ(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:s,allErrors:a}){n!==void 0&&(e.compositeRule=n),s!==void 0&&(e.createErrors=s),a!==void 0&&(e.allErrors=a),e.jtdDiscriminator=t,e.jtdMetadata=r}lo.extendSubschemaMode=EJ});var j0=G((jHe,PM)=>{"use strict";PM.exports=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,s,a;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(s=n;s--!==0;)if(!e(t[s],r[s]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(a=Object.keys(t),n=a.length,n!==Object.keys(r).length)return!1;for(s=n;s--!==0;)if(!Object.prototype.hasOwnProperty.call(r,a[s]))return!1;for(s=n;s--!==0;){var o=a[s];if(!e(t[o],r[o]))return!1}return!0}return t!==t&&r!==r}});var AM=G((BHe,IM)=>{"use strict";var uo=IM.exports=function(e,t,r){typeof t=="function"&&(r=t,t={}),r=t.cb||r;var n=typeof r=="function"?r:r.pre||function(){},s=r.post||function(){};iy(t,n,s,e,"",e)};uo.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};uo.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};uo.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};uo.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 iy(e,t,r,n,s,a,o,c,l,u){if(n&&typeof n=="object"&&!Array.isArray(n)){t(n,s,a,o,c,l,u);for(var d in n){var p=n[d];if(Array.isArray(p)){if(d in uo.arrayKeywords)for(var f=0;f<p.length;f++)iy(e,t,r,p[f],s+"/"+d+"/"+f,a,s,d,n,f)}else if(d in uo.propsKeywords){if(p&&typeof p=="object")for(var h in p)iy(e,t,r,p[h],s+"/"+d+"/"+PJ(h),a,s,d,n,h)}else(d in uo.keywords||e.allKeys&&!(d in uo.skipKeywords))&&iy(e,t,r,p,s+"/"+d,a,s,d,n)}r(n,s,a,o,c,l,u)}}function PJ(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}});var Gp=G(ci=>{"use strict";Object.defineProperty(ci,"__esModule",{value:!0});ci.getSchemaRefs=ci.resolveUrl=ci.normalizeId=ci._getFullPath=ci.getFullPath=ci.inlineRef=void 0;var IJ=Qt(),AJ=j0(),kJ=AM(),CJ=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function NJ(e,t=!0){return typeof e=="boolean"?!0:t===!0?!B0(e):t?kM(e)<=t:!1}ci.inlineRef=NJ;var OJ=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function B0(e){for(let t in e){if(OJ.has(t))return!0;let r=e[t];if(Array.isArray(r)&&r.some(B0)||typeof r=="object"&&B0(r))return!0}return!1}function kM(e){let t=0;for(let r in e){if(r==="$ref")return 1/0;if(t++,!CJ.has(r)&&(typeof e[r]=="object"&&(0,IJ.eachItem)(e[r],n=>t+=kM(n)),t===1/0))return 1/0}return t}function CM(e,t="",r){r!==!1&&(t=Xl(t));let n=e.parse(t);return NM(e,n)}ci.getFullPath=CM;function NM(e,t){return e.serialize(t).split("#")[0]+"#"}ci._getFullPath=NM;var $J=/#\/?$/;function Xl(e){return e?e.replace($J,""):""}ci.normalizeId=Xl;function RJ(e,t,r){return r=Xl(r),e.resolve(t,r)}ci.resolveUrl=RJ;var DJ=/^[a-z_][-a-z0-9._]*$/i;function MJ(e,t){if(typeof e=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,s=Xl(e[r]||t),a={"":s},o=CM(n,s,!1),c={},l=new Set;return kJ(e,{allKeys:!0},(p,f,h,m)=>{if(m===void 0)return;let g=o+f,y=a[m];typeof p[r]=="string"&&(y=_.call(this,p[r])),v.call(this,p.$anchor),v.call(this,p.$dynamicAnchor),a[f]=y;function _(S){let w=this.opts.uriResolver.resolve;if(S=Xl(y?w(y,S):S),l.has(S))throw d(S);l.add(S);let E=this.refs[S];return typeof E=="string"&&(E=this.refs[E]),typeof E=="object"?u(p,E.schema,S):S!==Xl(g)&&(S[0]==="#"?(u(p,c[S],S),c[S]=p):this.refs[S]=g),S}function v(S){if(typeof S=="string"){if(!DJ.test(S))throw new Error(`invalid anchor "${S}"`);_.call(this,`#${S}`)}}}),c;function u(p,f,h){if(f!==void 0&&!AJ(p,f))throw d(h)}function d(p){return new Error(`reference "${p}" resolves to more than one schema`)}}ci.getSchemaRefs=MJ});var Jp=G(po=>{"use strict";Object.defineProperty(po,"__esModule",{value:!0});po.getData=po.KeywordCxt=po.validateFunctionCode=void 0;var MM=dM(),OM=Kp(),U0=O0(),sy=Kp(),LJ=_M(),Hp=TM(),z0=EM(),Je=Nt(),bt=ya(),FJ=Gp(),_a=Qt(),Zp=Vp();function jJ(e){if(jM(e)&&(BM(e),FM(e))){UJ(e);return}LM(e,()=>(0,MM.topBoolOrEmptySchema)(e))}po.validateFunctionCode=jJ;function LM({gen:e,validateName:t,schema:r,schemaEnv:n,opts:s},a){s.code.es5?e.func(t,(0,Je._)`${bt.default.data}, ${bt.default.valCxt}`,n.$async,()=>{e.code((0,Je._)`"use strict"; ${$M(r,s)}`),zJ(e,s),e.code(a)}):e.func(t,(0,Je._)`${bt.default.data}, ${BJ(s)}`,n.$async,()=>e.code($M(r,s)).code(a))}function BJ(e){return(0,Je._)`{${bt.default.instancePath}="", ${bt.default.parentData}, ${bt.default.parentDataProperty}, ${bt.default.rootData}=${bt.default.data}${e.dynamicRef?(0,Je._)`, ${bt.default.dynamicAnchors}={}`:Je.nil}}={}`}function zJ(e,t){e.if(bt.default.valCxt,()=>{e.var(bt.default.instancePath,(0,Je._)`${bt.default.valCxt}.${bt.default.instancePath}`),e.var(bt.default.parentData,(0,Je._)`${bt.default.valCxt}.${bt.default.parentData}`),e.var(bt.default.parentDataProperty,(0,Je._)`${bt.default.valCxt}.${bt.default.parentDataProperty}`),e.var(bt.default.rootData,(0,Je._)`${bt.default.valCxt}.${bt.default.rootData}`),t.dynamicRef&&e.var(bt.default.dynamicAnchors,(0,Je._)`${bt.default.valCxt}.${bt.default.dynamicAnchors}`)},()=>{e.var(bt.default.instancePath,(0,Je._)`""`),e.var(bt.default.parentData,(0,Je._)`undefined`),e.var(bt.default.parentDataProperty,(0,Je._)`undefined`),e.var(bt.default.rootData,bt.default.data),t.dynamicRef&&e.var(bt.default.dynamicAnchors,(0,Je._)`{}`)})}function UJ(e){let{schema:t,opts:r,gen:n}=e;LM(e,()=>{r.$comment&&t.$comment&&UM(e),GJ(e),n.let(bt.default.vErrors,null),n.let(bt.default.errors,0),r.unevaluated&&qJ(e),zM(e),JJ(e)})}function qJ(e){let{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",(0,Je._)`${r}.evaluated`),t.if((0,Je._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,Je._)`${e.evaluated}.props`,(0,Je._)`undefined`)),t.if((0,Je._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,Je._)`${e.evaluated}.items`,(0,Je._)`undefined`))}function $M(e,t){let r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?(0,Je._)`/*# sourceURL=${r} */`:Je.nil}function WJ(e,t){if(jM(e)&&(BM(e),FM(e))){VJ(e,t);return}(0,MM.boolOrEmptySchema)(e,t)}function FM({schema:e,self:t}){if(typeof e=="boolean")return!e;for(let r in e)if(t.RULES.all[r])return!0;return!1}function jM(e){return typeof e.schema!="boolean"}function VJ(e,t){let{schema:r,gen:n,opts:s}=e;s.$comment&&r.$comment&&UM(e),ZJ(e),HJ(e);let a=n.const("_errs",bt.default.errors);zM(e,a),n.var(t,(0,Je._)`${a} === ${bt.default.errors}`)}function BM(e){(0,_a.checkUnknownRules)(e),KJ(e)}function zM(e,t){if(e.opts.jtd)return RM(e,[],!1,t);let r=(0,OM.getSchemaTypes)(e.schema),n=(0,OM.coerceAndCheckDataType)(e,r);RM(e,r,!n,t)}function KJ(e){let{schema:t,errSchemaPath:r,opts:n,self:s}=e;t.$ref&&n.ignoreKeywordsWithRef&&(0,_a.schemaHasRulesButRef)(t,s.RULES)&&s.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function GJ(e){let{schema:t,opts:r}=e;t.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,_a.checkStrictMode)(e,"default is ignored in the schema root")}function ZJ(e){let t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,FJ.resolveUrl)(e.opts.uriResolver,e.baseId,t))}function HJ(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}function UM({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:s}){let a=r.$comment;if(s.$comment===!0)e.code((0,Je._)`${bt.default.self}.logger.log(${a})`);else if(typeof s.$comment=="function"){let o=(0,Je.str)`${n}/$comment`,c=e.scopeValue("root",{ref:t.root});e.code((0,Je._)`${bt.default.self}.opts.$comment(${a}, ${o}, ${c}.schema)`)}}function JJ(e){let{gen:t,schemaEnv:r,validateName:n,ValidationError:s,opts:a}=e;r.$async?t.if((0,Je._)`${bt.default.errors} === 0`,()=>t.return(bt.default.data),()=>t.throw((0,Je._)`new ${s}(${bt.default.vErrors})`)):(t.assign((0,Je._)`${n}.errors`,bt.default.vErrors),a.unevaluated&&YJ(e),t.return((0,Je._)`${bt.default.errors} === 0`))}function YJ({gen:e,evaluated:t,props:r,items:n}){r instanceof Je.Name&&e.assign((0,Je._)`${t}.props`,r),n instanceof Je.Name&&e.assign((0,Je._)`${t}.items`,n)}function RM(e,t,r,n){let{gen:s,schema:a,data:o,allErrors:c,opts:l,self:u}=e,{RULES:d}=u;if(a.$ref&&(l.ignoreKeywordsWithRef||!(0,_a.schemaHasRulesButRef)(a,d))){s.block(()=>WM(e,"$ref",d.all.$ref.definition));return}l.jtd||XJ(e,t),s.block(()=>{for(let f of d.rules)p(f);p(d.post)});function p(f){(0,U0.shouldUseGroup)(a,f)&&(f.type?(s.if((0,sy.checkDataType)(f.type,o,l.strictNumbers)),DM(e,f),t.length===1&&t[0]===f.type&&r&&(s.else(),(0,sy.reportTypeError)(e)),s.endIf()):DM(e,f),c||s.if((0,Je._)`${bt.default.errors} === ${n||0}`))}}function DM(e,t){let{gen:r,schema:n,opts:{useDefaults:s}}=e;s&&(0,LJ.assignDefaults)(e,t.type),r.block(()=>{for(let a of t.rules)(0,U0.shouldUseRule)(n,a)&&WM(e,a.keyword,a.definition,t.type)})}function XJ(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(QJ(e,t),e.opts.allowUnionTypes||eY(e,t),tY(e,e.dataTypes))}function QJ(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(r=>{qM(e.dataTypes,r)||q0(e,`type "${r}" not allowed by context "${e.dataTypes.join(",")}"`)}),nY(e,t)}}function eY(e,t){t.length>1&&!(t.length===2&&t.includes("null"))&&q0(e,"use allowUnionTypes to allow union type keyword")}function tY(e,t){let r=e.self.RULES.all;for(let n in r){let s=r[n];if(typeof s=="object"&&(0,U0.shouldUseRule)(e.schema,s)){let{type:a}=s.definition;a.length&&!a.some(o=>rY(t,o))&&q0(e,`missing type "${a.join(",")}" for keyword "${n}"`)}}}function rY(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function qM(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function nY(e,t){let r=[];for(let n of e.dataTypes)qM(t,n)?r.push(n):t.includes("integer")&&n==="number"&&r.push("integer");e.dataTypes=r}function q0(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,(0,_a.checkStrictMode)(e,t,e.opts.strictTypes)}var ay=class{constructor(t,r,n){if((0,Hp.validateKeywordUsage)(t,r,n),this.gen=t.gen,this.allErrors=t.allErrors,this.keyword=n,this.data=t.data,this.schema=t.schema[n],this.$data=r.$data&&t.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,_a.schemaRefOrVal)(t,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=t.schema,this.params={},this.it=t,this.def=r,this.$data)this.schemaCode=t.gen.const("vSchema",VM(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,Hp.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=t.gen.const("_errs",bt.default.errors))}result(t,r,n){this.failResult((0,Je.not)(t),r,n)}failResult(t,r,n){this.gen.if(t),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(t,r){this.failResult((0,Je.not)(t),void 0,r)}fail(t){if(t===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(t),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(t){if(!this.$data)return this.fail(t);let{schemaCode:r}=this;this.fail((0,Je._)`${r} !== undefined && (${(0,Je.or)(this.invalid$data(),t)})`)}error(t,r,n){if(r){this.setParams(r),this._error(t,n),this.setParams({});return}this._error(t,n)}_error(t,r){(t?Zp.reportExtraError:Zp.reportError)(this,this.def.error,r)}$dataError(){(0,Zp.reportError)(this,this.def.$dataError||Zp.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Zp.resetErrorsCount)(this.gen,this.errsCount)}ok(t){this.allErrors||this.gen.if(t)}setParams(t,r){r?Object.assign(this.params,t):this.params=t}block$data(t,r,n=Je.nil){this.gen.block(()=>{this.check$data(t,n),r()})}check$data(t=Je.nil,r=Je.nil){if(!this.$data)return;let{gen:n,schemaCode:s,schemaType:a,def:o}=this;n.if((0,Je.or)((0,Je._)`${s} === undefined`,r)),t!==Je.nil&&n.assign(t,!0),(a.length||o.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),t!==Je.nil&&n.assign(t,!1)),n.else()}invalid$data(){let{gen:t,schemaCode:r,schemaType:n,def:s,it:a}=this;return(0,Je.or)(o(),c());function o(){if(n.length){if(!(r instanceof Je.Name))throw new Error("ajv implementation error");let l=Array.isArray(n)?n:[n];return(0,Je._)`${(0,sy.checkDataTypes)(l,r,a.opts.strictNumbers,sy.DataType.Wrong)}`}return Je.nil}function c(){if(s.validateSchema){let l=t.scopeValue("validate$data",{ref:s.validateSchema});return(0,Je._)`!${l}(${r})`}return Je.nil}}subschema(t,r){let n=(0,z0.getSubschema)(this.it,t);(0,z0.extendSubschemaData)(n,this.it,t),(0,z0.extendSubschemaMode)(n,t);let s={...this.it,...n,items:void 0,props:void 0};return WJ(s,r),s}mergeEvaluated(t,r){let{it:n,gen:s}=this;n.opts.unevaluated&&(n.props!==!0&&t.props!==void 0&&(n.props=_a.mergeEvaluated.props(s,t.props,n.props,r)),n.items!==!0&&t.items!==void 0&&(n.items=_a.mergeEvaluated.items(s,t.items,n.items,r)))}mergeValidEvaluated(t,r){let{it:n,gen:s}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return s.if(r,()=>this.mergeEvaluated(t,Je.Name)),!0}};po.KeywordCxt=ay;function WM(e,t,r,n){let s=new ay(e,r,t);"code"in r?r.code(s,n):s.$data&&r.validate?(0,Hp.funcKeywordCode)(s,r):"macro"in r?(0,Hp.macroKeywordCode)(s,r):(r.compile||r.validate)&&(0,Hp.funcKeywordCode)(s,r)}var iY=/^\/(?:[^~]|~0|~1)*$/,sY=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function VM(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let s,a;if(e==="")return bt.default.rootData;if(e[0]==="/"){if(!iY.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);s=e,a=bt.default.rootData}else{let u=sY.exec(e);if(!u)throw new Error(`Invalid JSON-pointer: ${e}`);let d=+u[1];if(s=u[2],s==="#"){if(d>=t)throw new Error(l("property/index",d));return n[t-d]}if(d>t)throw new Error(l("data",d));if(a=r[t-d],!s)return a}let o=a,c=s.split("/");for(let u of c)u&&(a=(0,Je._)`${a}${(0,Je.getProperty)((0,_a.unescapeJsonPointer)(u))}`,o=(0,Je._)`${o} && ${a}`);return o;function l(u,d){return`Cannot access ${u} ${d} levels up, current level is ${t}`}}po.getData=VM});var oy=G(V0=>{"use strict";Object.defineProperty(V0,"__esModule",{value:!0});var W0=class extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}};V0.default=W0});var Yp=G(Z0=>{"use strict";Object.defineProperty(Z0,"__esModule",{value:!0});var K0=Gp(),G0=class extends Error{constructor(t,r,n,s){super(s||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,K0.resolveUrl)(t,r,n),this.missingSchema=(0,K0.normalizeId)((0,K0.getFullPath)(t,this.missingRef))}};Z0.default=G0});var ly=G(zi=>{"use strict";Object.defineProperty(zi,"__esModule",{value:!0});zi.resolveSchema=zi.getCompilingSchema=zi.resolveRef=zi.compileSchema=zi.SchemaEnv=void 0;var ms=Nt(),aY=oy(),hc=ya(),gs=Gp(),KM=Qt(),oY=Jp(),Ql=class{constructor(t){var r;this.refs={},this.dynamicAnchors={};let n;typeof t.schema=="object"&&(n=t.schema),this.schema=t.schema,this.schemaId=t.schemaId,this.root=t.root||this,this.baseId=(r=t.baseId)!==null&&r!==void 0?r:(0,gs.normalizeId)(n?.[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=n?.$async,this.refs={}}};zi.SchemaEnv=Ql;function J0(e){let t=GM.call(this,e);if(t)return t;let r=(0,gs.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:n,lines:s}=this.opts.code,{ownProperties:a}=this.opts,o=new ms.CodeGen(this.scope,{es5:n,lines:s,ownProperties:a}),c;e.$async&&(c=o.scopeValue("Error",{ref:aY.default,code:(0,ms._)`require("ajv/dist/runtime/validation_error").default`}));let l=o.scopeName("validate");e.validateName=l;let u={gen:o,allErrors:this.opts.allErrors,data:hc.default.data,parentData:hc.default.parentData,parentDataProperty:hc.default.parentDataProperty,dataNames:[hc.default.data],dataPathArr:[ms.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:o.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,ms.stringify)(e.schema)}:{ref:e.schema}),validateName:l,ValidationError:c,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:ms.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,ms._)`""`,opts:this.opts,self:this},d;try{this._compilations.add(e),(0,oY.validateFunctionCode)(u),o.optimize(this.opts.code.optimize);let p=o.toString();d=`${o.scopeRefs(hc.default.scope)}return ${p}`,this.opts.code.process&&(d=this.opts.code.process(d,e));let h=new Function(`${hc.default.self}`,`${hc.default.scope}`,d)(this,this.scope.get());if(this.scope.value(l,{ref:h}),h.errors=null,h.schema=e.schema,h.schemaEnv=e,e.$async&&(h.$async=!0),this.opts.code.source===!0&&(h.source={validateName:l,validateCode:p,scopeValues:o._values}),this.opts.unevaluated){let{props:m,items:g}=u;h.evaluated={props:m instanceof ms.Name?void 0:m,items:g instanceof ms.Name?void 0:g,dynamicProps:m instanceof ms.Name,dynamicItems:g instanceof ms.Name},h.source&&(h.source.evaluated=(0,ms.stringify)(h.evaluated))}return e.validate=h,e}catch(p){throw delete e.validate,delete e.validateName,d&&this.logger.error("Error compiling schema, function code:",d),p}finally{this._compilations.delete(e)}}zi.compileSchema=J0;function cY(e,t,r){var n;r=(0,gs.resolveUrl)(this.opts.uriResolver,t,r);let s=e.refs[r];if(s)return s;let a=dY.call(this,e,r);if(a===void 0){let o=(n=e.localRefs)===null||n===void 0?void 0:n[r],{schemaId:c}=this.opts;o&&(a=new Ql({schema:o,schemaId:c,root:e,baseId:t}))}if(a!==void 0)return e.refs[r]=lY.call(this,a)}zi.resolveRef=cY;function lY(e){return(0,gs.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:J0.call(this,e)}function GM(e){for(let t of this._compilations)if(uY(t,e))return t}zi.getCompilingSchema=GM;function uY(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function dY(e,t){let r;for(;typeof(r=this.refs[t])=="string";)t=r;return r||this.schemas[t]||cy.call(this,e,t)}function cy(e,t){let r=this.opts.uriResolver.parse(t),n=(0,gs._getFullPath)(this.opts.uriResolver,r),s=(0,gs.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===s)return H0.call(this,r,e);let a=(0,gs.normalizeId)(n),o=this.refs[a]||this.schemas[a];if(typeof o=="string"){let c=cy.call(this,e,o);return typeof c?.schema!="object"?void 0:H0.call(this,r,c)}if(typeof o?.schema=="object"){if(o.validate||J0.call(this,o),a===(0,gs.normalizeId)(t)){let{schema:c}=o,{schemaId:l}=this.opts,u=c[l];return u&&(s=(0,gs.resolveUrl)(this.opts.uriResolver,s,u)),new Ql({schema:c,schemaId:l,root:e,baseId:s})}return H0.call(this,r,o)}}zi.resolveSchema=cy;var pY=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function H0(e,{baseId:t,schema:r,root:n}){var s;if(((s=e.fragment)===null||s===void 0?void 0:s[0])!=="/")return;for(let c of e.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let l=r[(0,KM.unescapeFragment)(c)];if(l===void 0)return;r=l;let u=typeof r=="object"&&r[this.opts.schemaId];!pY.has(c)&&u&&(t=(0,gs.resolveUrl)(this.opts.uriResolver,t,u))}let a;if(typeof r!="boolean"&&r.$ref&&!(0,KM.schemaHasRulesButRef)(r,this.RULES)){let c=(0,gs.resolveUrl)(this.opts.uriResolver,t,r.$ref);a=cy.call(this,n,c)}let{schemaId:o}=this.opts;if(a=a||new Ql({schema:r,schemaId:o,root:n,baseId:t}),a.schema!==a.root.schema)return a}});var ZM=G((KHe,fY)=>{fY.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 X0=G((GHe,XM)=>{"use strict";var hY=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),JM=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function Y0(e){let t="",r=0,n=0;for(n=0;n<e.length;n++)if(r=e[n].charCodeAt(0),r!==48){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[n];break}for(n+=1;n<e.length;n++){if(r=e[n].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[n]}return t}var mY=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function HM(e){return e.length=0,!0}function gY(e,t,r){if(e.length){let n=Y0(e);if(n!=="")t.push(n);else return r.error=!0,!1;e.length=0}return!0}function yY(e){let t=0,r={error:!1,address:"",zone:""},n=[],s=[],a=!1,o=!1,c=gY;for(let l=0;l<e.length;l++){let u=e[l];if(!(u==="["||u==="]"))if(u===":"){if(a===!0&&(o=!0),!c(s,n,r))break;if(++t>7){r.error=!0;break}l>0&&e[l-1]===":"&&(a=!0),n.push(":");continue}else if(u==="%"){if(!c(s,n,r))break;c=HM}else{s.push(u);continue}}return s.length&&(c===HM?r.zone=s.join(""):o?n.push(s.join("")):n.push(Y0(s))),r.address=n.join(""),r}function YM(e){if(_Y(e,":")<2)return{host:e,isIPV6:!1};let t=yY(e);if(t.error)return{host:e,isIPV6:!1};{let r=t.address,n=t.address;return t.zone&&(r+="%"+t.zone,n+="%25"+t.zone),{host:r,isIPV6:!0,escapedHost:n}}}function _Y(e,t){let r=0;for(let n=0;n<e.length;n++)e[n]===t&&r++;return r}function bY(e){let t=e,r=[],n=-1,s=0;for(;s=t.length;){if(s===1){if(t===".")break;if(t==="/"){r.push("/");break}else{r.push(t);break}}else if(s===2){if(t[0]==="."){if(t[1]===".")break;if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"&&(t[1]==="."||t[1]==="/")){r.push("/");break}}else if(s===3&&t==="/.."){r.length!==0&&r.pop(),r.push("/");break}if(t[0]==="."){if(t[1]==="."){if(t[2]==="/"){t=t.slice(3);continue}}else if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"&&t[1]==="."){if(t[2]==="/"){t=t.slice(2);continue}else if(t[2]==="."&&t[3]==="/"){t=t.slice(3),r.length!==0&&r.pop();continue}}if((n=t.indexOf("/",1))===-1){r.push(t);break}else r.push(t.slice(0,n)),t=t.slice(n)}return r.join("")}function vY(e,t){let r=t!==!0?escape:unescape;return e.scheme!==void 0&&(e.scheme=r(e.scheme)),e.userinfo!==void 0&&(e.userinfo=r(e.userinfo)),e.host!==void 0&&(e.host=r(e.host)),e.path!==void 0&&(e.path=r(e.path)),e.query!==void 0&&(e.query=r(e.query)),e.fragment!==void 0&&(e.fragment=r(e.fragment)),e}function xY(e){let t=[];if(e.userinfo!==void 0&&(t.push(e.userinfo),t.push("@")),e.host!==void 0){let r=unescape(e.host);if(!JM(r)){let n=YM(r);n.isIPV6===!0?r=`[${n.escapedHost}]`:r=e.host}t.push(r)}return(typeof e.port=="number"||typeof e.port=="string")&&(t.push(":"),t.push(String(e.port))),t.length?t.join(""):void 0}XM.exports={nonSimpleDomain:mY,recomposeAuthority:xY,normalizeComponentEncoding:vY,removeDotSegments:bY,isIPv4:JM,isUUID:hY,normalizeIPv6:YM,stringArrayToHexStripped:Y0}});var nL=G((ZHe,rL)=>{"use strict";var{isUUID:SY}=X0(),TY=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,wY=["http","https","ws","wss","urn","urn:uuid"];function EY(e){return wY.indexOf(e)!==-1}function Q0(e){return e.secure===!0?!0:e.secure===!1?!1:e.scheme?e.scheme.length===3&&(e.scheme[0]==="w"||e.scheme[0]==="W")&&(e.scheme[1]==="s"||e.scheme[1]==="S")&&(e.scheme[2]==="s"||e.scheme[2]==="S"):!1}function QM(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function eL(e){let t=String(e.scheme).toLowerCase()==="https";return(e.port===(t?443:80)||e.port==="")&&(e.port=void 0),e.path||(e.path="/"),e}function PY(e){return e.secure=Q0(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function IY(e){if((e.port===(Q0(e)?443:80)||e.port==="")&&(e.port=void 0),typeof e.secure=="boolean"&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){let[t,r]=e.resourceName.split("?");e.path=t&&t!=="/"?t:void 0,e.query=r,e.resourceName=void 0}return e.fragment=void 0,e}function AY(e,t){if(!e.path)return e.error="URN can not be parsed",e;let r=e.path.match(TY);if(r){let n=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase(),e.nss=r[2];let s=`${n}:${t.nid||e.nid}`,a=eE(s);e.path=void 0,a&&(e=a.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e}function kY(e,t){if(e.nid===void 0)throw new Error("URN without nid cannot be serialized");let r=t.scheme||e.scheme||"urn",n=e.nid.toLowerCase(),s=`${r}:${t.nid||n}`,a=eE(s);a&&(e=a.serialize(e,t));let o=e,c=e.nss;return o.path=`${n||t.nid}:${c}`,t.skipEscape=!0,o}function CY(e,t){let r=e;return r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!SY(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function NY(e){let t=e;return t.nss=(e.uuid||"").toLowerCase(),t}var tL={scheme:"http",domainHost:!0,parse:QM,serialize:eL},OY={scheme:"https",domainHost:tL.domainHost,parse:QM,serialize:eL},uy={scheme:"ws",domainHost:!0,parse:PY,serialize:IY},$Y={scheme:"wss",domainHost:uy.domainHost,parse:uy.parse,serialize:uy.serialize},RY={scheme:"urn",parse:AY,serialize:kY,skipNormalize:!0},DY={scheme:"urn:uuid",parse:CY,serialize:NY,skipNormalize:!0},dy={http:tL,https:OY,ws:uy,wss:$Y,urn:RY,"urn:uuid":DY};Object.setPrototypeOf(dy,null);function eE(e){return e&&(dy[e]||dy[e.toLowerCase()])||void 0}rL.exports={wsIsSecure:Q0,SCHEMES:dy,isValidSchemeName:EY,getSchemeHandler:eE}});var aL=G((HHe,fy)=>{"use strict";var{normalizeIPv6:MY,removeDotSegments:Xp,recomposeAuthority:LY,normalizeComponentEncoding:py,isIPv4:FY,nonSimpleDomain:jY}=X0(),{SCHEMES:BY,getSchemeHandler:iL}=nL();function zY(e,t){return typeof e=="string"?e=Ms(ba(e,t),t):typeof e=="object"&&(e=ba(Ms(e,t),t)),e}function UY(e,t,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},s=sL(ba(e,n),ba(t,n),n,!0);return n.skipEscape=!0,Ms(s,n)}function sL(e,t,r,n){let s={};return n||(e=ba(Ms(e,r),r),t=ba(Ms(t,r),r)),r=r||{},!r.tolerant&&t.scheme?(s.scheme=t.scheme,s.userinfo=t.userinfo,s.host=t.host,s.port=t.port,s.path=Xp(t.path||""),s.query=t.query):(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0?(s.userinfo=t.userinfo,s.host=t.host,s.port=t.port,s.path=Xp(t.path||""),s.query=t.query):(t.path?(t.path[0]==="/"?s.path=Xp(t.path):((e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path?s.path="/"+t.path:e.path?s.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:s.path=t.path,s.path=Xp(s.path)),s.query=t.query):(s.path=e.path,t.query!==void 0?s.query=t.query:s.query=e.query),s.userinfo=e.userinfo,s.host=e.host,s.port=e.port),s.scheme=e.scheme),s.fragment=t.fragment,s}function qY(e,t,r){return typeof e=="string"?(e=unescape(e),e=Ms(py(ba(e,r),!0),{...r,skipEscape:!0})):typeof e=="object"&&(e=Ms(py(e,!0),{...r,skipEscape:!0})),typeof t=="string"?(t=unescape(t),t=Ms(py(ba(t,r),!0),{...r,skipEscape:!0})):typeof t=="object"&&(t=Ms(py(t,!0),{...r,skipEscape:!0})),e.toLowerCase()===t.toLowerCase()}function Ms(e,t){let r={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},n=Object.assign({},t),s=[],a=iL(n.scheme||r.scheme);a&&a.serialize&&a.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=unescape(r.path):(r.path=escape(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&s.push(r.scheme,":");let o=LY(r);if(o!==void 0&&(n.reference!=="suffix"&&s.push("//"),s.push(o),r.path&&r.path[0]!=="/"&&s.push("/")),r.path!==void 0){let c=r.path;!n.absolutePath&&(!a||!a.absolutePath)&&(c=Xp(c)),o===void 0&&c[0]==="/"&&c[1]==="/"&&(c="/%2F"+c.slice(2)),s.push(c)}return r.query!==void 0&&s.push("?",r.query),r.fragment!==void 0&&s.push("#",r.fragment),s.join("")}var WY=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function ba(e,t){let r=Object.assign({},t),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},s=!1;r.reference==="suffix"&&(r.scheme?e=r.scheme+":"+e:e="//"+e);let a=e.match(WY);if(a){if(n.scheme=a[1],n.userinfo=a[3],n.host=a[4],n.port=parseInt(a[5],10),n.path=a[6]||"",n.query=a[7],n.fragment=a[8],isNaN(n.port)&&(n.port=a[5]),n.host)if(FY(n.host)===!1){let l=MY(n.host);n.host=l.host.toLowerCase(),s=l.isIPV6}else s=!0;n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");let o=iL(r.scheme||n.scheme);if(!r.unicodeSupport&&(!o||!o.unicodeSupport)&&n.host&&(r.domainHost||o&&o.domainHost)&&s===!1&&jY(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(c){n.error=n.error||"Host's domain name can not be converted to ASCII: "+c}(!o||o&&!o.skipNormalize)&&(e.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=unescape(n.host))),n.path&&(n.path=escape(unescape(n.path))),n.fragment&&(n.fragment=encodeURI(decodeURIComponent(n.fragment)))),o&&o.parse&&o.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return n}var tE={SCHEMES:BY,normalize:zY,resolve:UY,resolveComponent:sL,equal:qY,serialize:Ms,parse:ba};fy.exports=tE;fy.exports.default=tE;fy.exports.fastUri=tE});var cL=G(rE=>{"use strict";Object.defineProperty(rE,"__esModule",{value:!0});var oL=aL();oL.code='require("ajv/dist/runtime/uri").default';rE.default=oL});var gL=G(Tn=>{"use strict";Object.defineProperty(Tn,"__esModule",{value:!0});Tn.CodeGen=Tn.Name=Tn.nil=Tn.stringify=Tn.str=Tn._=Tn.KeywordCxt=void 0;var VY=Jp();Object.defineProperty(Tn,"KeywordCxt",{enumerable:!0,get:function(){return VY.KeywordCxt}});var eu=Nt();Object.defineProperty(Tn,"_",{enumerable:!0,get:function(){return eu._}});Object.defineProperty(Tn,"str",{enumerable:!0,get:function(){return eu.str}});Object.defineProperty(Tn,"stringify",{enumerable:!0,get:function(){return eu.stringify}});Object.defineProperty(Tn,"nil",{enumerable:!0,get:function(){return eu.nil}});Object.defineProperty(Tn,"Name",{enumerable:!0,get:function(){return eu.Name}});Object.defineProperty(Tn,"CodeGen",{enumerable:!0,get:function(){return eu.CodeGen}});var KY=oy(),fL=Yp(),GY=N0(),Qp=ly(),ZY=Nt(),ef=Gp(),hy=Kp(),iE=Qt(),lL=ZM(),HY=cL(),hL=(e,t)=>new RegExp(e,t);hL.code="new RegExp";var JY=["removeAdditional","useDefaults","coerceTypes"],YY=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),XY={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."},QY={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},uL=200;function eX(e){var t,r,n,s,a,o,c,l,u,d,p,f,h,m,g,y,_,v,S,w,E,k,N,O,V;let te=e.strict,W=(t=e.code)===null||t===void 0?void 0:t.optimize,$=W===!0||W===void 0?1:W||0,H=(n=(r=e.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:hL,Y=(s=e.uriResolver)!==null&&s!==void 0?s:HY.default;return{strictSchema:(o=(a=e.strictSchema)!==null&&a!==void 0?a:te)!==null&&o!==void 0?o:!0,strictNumbers:(l=(c=e.strictNumbers)!==null&&c!==void 0?c:te)!==null&&l!==void 0?l:!0,strictTypes:(d=(u=e.strictTypes)!==null&&u!==void 0?u:te)!==null&&d!==void 0?d:"log",strictTuples:(f=(p=e.strictTuples)!==null&&p!==void 0?p:te)!==null&&f!==void 0?f:"log",strictRequired:(m=(h=e.strictRequired)!==null&&h!==void 0?h:te)!==null&&m!==void 0?m:!1,code:e.code?{...e.code,optimize:$,regExp:H}:{optimize:$,regExp:H},loopRequired:(g=e.loopRequired)!==null&&g!==void 0?g:uL,loopEnum:(y=e.loopEnum)!==null&&y!==void 0?y:uL,meta:(_=e.meta)!==null&&_!==void 0?_:!0,messages:(v=e.messages)!==null&&v!==void 0?v:!0,inlineRefs:(S=e.inlineRefs)!==null&&S!==void 0?S:!0,schemaId:(w=e.schemaId)!==null&&w!==void 0?w:"$id",addUsedSchema:(E=e.addUsedSchema)!==null&&E!==void 0?E:!0,validateSchema:(k=e.validateSchema)!==null&&k!==void 0?k:!0,validateFormats:(N=e.validateFormats)!==null&&N!==void 0?N:!0,unicodeRegExp:(O=e.unicodeRegExp)!==null&&O!==void 0?O:!0,int32range:(V=e.int32range)!==null&&V!==void 0?V:!0,uriResolver:Y}}var tf=class{constructor(t={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,t=this.opts={...t,...eX(t)};let{es5:r,lines:n}=this.opts.code;this.scope=new ZY.ValueScope({scope:{},prefixes:YY,es5:r,lines:n}),this.logger=aX(t.logger);let s=t.validateFormats;t.validateFormats=!1,this.RULES=(0,GY.getRules)(),dL.call(this,XY,t,"NOT SUPPORTED"),dL.call(this,QY,t,"DEPRECATED","warn"),this._metaOpts=iX.call(this),t.formats&&rX.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),t.keywords&&nX.call(this,t.keywords),typeof t.meta=="object"&&this.addMetaSchema(t.meta),tX.call(this),t.validateFormats=s}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:t,meta:r,schemaId:n}=this.opts,s=lL;n==="id"&&(s={...lL},s.id=s.$id,delete s.$id),r&&t&&this.addMetaSchema(s,s[n],!1)}defaultMeta(){let{meta:t,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof t=="object"?t[r]||t:void 0}validate(t,r){let n;if(typeof t=="string"){if(n=this.getSchema(t),!n)throw new Error(`no schema with key or ref "${t}"`)}else n=this.compile(t);let s=n(r);return"$async"in n||(this.errors=n.errors),s}compile(t,r){let n=this._addSchema(t,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(t,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return s.call(this,t,r);async function s(d,p){await a.call(this,d.$schema);let f=this._addSchema(d,p);return f.validate||o.call(this,f)}async function a(d){d&&!this.getSchema(d)&&await s.call(this,{$ref:d},!0)}async function o(d){try{return this._compileSchemaEnv(d)}catch(p){if(!(p instanceof fL.default))throw p;return c.call(this,p),await l.call(this,p.missingSchema),o.call(this,d)}}function c({missingSchema:d,missingRef:p}){if(this.refs[d])throw new Error(`AnySchema ${d} is loaded but ${p} cannot be resolved`)}async function l(d){let p=await u.call(this,d);this.refs[d]||await a.call(this,p.$schema),this.refs[d]||this.addSchema(p,d,r)}async function u(d){let p=this._loading[d];if(p)return p;try{return await(this._loading[d]=n(d))}finally{delete this._loading[d]}}}addSchema(t,r,n,s=this.opts.validateSchema){if(Array.isArray(t)){for(let o of t)this.addSchema(o,void 0,n,s);return this}let a;if(typeof t=="object"){let{schemaId:o}=this.opts;if(a=t[o],a!==void 0&&typeof a!="string")throw new Error(`schema ${o} must be string`)}return r=(0,ef.normalizeId)(r||a),this._checkUnique(r),this.schemas[r]=this._addSchema(t,n,r,s,!0),this}addMetaSchema(t,r,n=this.opts.validateSchema){return this.addSchema(t,r,!0,n),this}validateSchema(t,r){if(typeof t=="boolean")return!0;let n;if(n=t.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let s=this.validate(n,t);if(!s&&r){let a="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(a);else throw new Error(a)}return s}getSchema(t){let r;for(;typeof(r=pL.call(this,t))=="string";)t=r;if(r===void 0){let{schemaId:n}=this.opts,s=new Qp.SchemaEnv({schema:{},schemaId:n});if(r=Qp.resolveSchema.call(this,s,t),!r)return;this.refs[t]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(t){if(t instanceof RegExp)return this._removeAllSchemas(this.schemas,t),this._removeAllSchemas(this.refs,t),this;switch(typeof t){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=pL.call(this,t);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[t],delete this.refs[t],this}case"object":{let r=t;this._cache.delete(r);let n=t[this.opts.schemaId];return n&&(n=(0,ef.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(t){for(let r of t)this.addKeyword(r);return this}addKeyword(t,r){let n;if(typeof t=="string")n=t,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof t=="object"&&r===void 0){if(r=t,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(cX.call(this,n,r),!r)return(0,iE.eachItem)(n,a=>nE.call(this,a)),this;uX.call(this,r);let s={...r,type:(0,hy.getJSONTypes)(r.type),schemaType:(0,hy.getJSONTypes)(r.schemaType)};return(0,iE.eachItem)(n,s.type.length===0?a=>nE.call(this,a,s):a=>s.type.forEach(o=>nE.call(this,a,s,o))),this}getKeyword(t){let r=this.RULES.all[t];return typeof r=="object"?r.definition:!!r}removeKeyword(t){let{RULES:r}=this;delete r.keywords[t],delete r.all[t];for(let n of r.rules){let s=n.rules.findIndex(a=>a.keyword===t);s>=0&&n.rules.splice(s,1)}return this}addFormat(t,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[t]=r,this}errorsText(t=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!t||t.length===0?"No errors":t.map(s=>`${n}${s.instancePath} ${s.message}`).reduce((s,a)=>s+r+a)}$dataMetaSchema(t,r){let n=this.RULES.all;t=JSON.parse(JSON.stringify(t));for(let s of r){let a=s.split("/").slice(1),o=t;for(let c of a)o=o[c];for(let c in n){let l=n[c];if(typeof l!="object")continue;let{$data:u}=l.definition,d=o[c];u&&d&&(o[c]=mL(d))}}return t}_removeAllSchemas(t,r){for(let n in t){let s=t[n];(!r||r.test(n))&&(typeof s=="string"?delete t[n]:s&&!s.meta&&(this._cache.delete(s.schema),delete t[n]))}}_addSchema(t,r,n,s=this.opts.validateSchema,a=this.opts.addUsedSchema){let o,{schemaId:c}=this.opts;if(typeof t=="object")o=t[c];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof t!="boolean")throw new Error("schema must be object or boolean")}let l=this._cache.get(t);if(l!==void 0)return l;n=(0,ef.normalizeId)(o||n);let u=ef.getSchemaRefs.call(this,t,n);return l=new Qp.SchemaEnv({schema:t,schemaId:c,meta:r,baseId:n,localRefs:u}),this._cache.set(l.schema,l),a&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=l),s&&this.validateSchema(t,!0),l}_checkUnique(t){if(this.schemas[t]||this.refs[t])throw new Error(`schema with key or id "${t}" already exists`)}_compileSchemaEnv(t){if(t.meta?this._compileMetaSchema(t):Qp.compileSchema.call(this,t),!t.validate)throw new Error("ajv implementation error");return t.validate}_compileMetaSchema(t){let r=this.opts;this.opts=this._metaOpts;try{Qp.compileSchema.call(this,t)}finally{this.opts=r}}};tf.ValidationError=KY.default;tf.MissingRefError=fL.default;Tn.default=tf;function dL(e,t,r,n="error"){for(let s in e){let a=s;a in t&&this.logger[n](`${r}: option ${s}. ${e[a]}`)}}function pL(e){return e=(0,ef.normalizeId)(e),this.schemas[e]||this.refs[e]}function tX(){let e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(let t in e)this.addSchema(e[t],t)}function rX(){for(let e in this.opts.formats){let t=this.opts.formats[e];t&&this.addFormat(e,t)}}function nX(e){if(Array.isArray(e)){this.addVocabulary(e);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let t in e){let r=e[t];r.keyword||(r.keyword=t),this.addKeyword(r)}}function iX(){let e={...this.opts};for(let t of JY)delete e[t];return e}var sX={log(){},warn(){},error(){}};function aX(e){if(e===!1)return sX;if(e===void 0)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")}var oX=/^[a-z_$][a-z0-9_$:-]*$/i;function cX(e,t){let{RULES:r}=this;if((0,iE.eachItem)(e,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!oX.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!t&&t.$data&&!("code"in t||"validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}function nE(e,t,r){var n;let s=t?.post;if(r&&s)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:a}=this,o=s?a.post:a.rules.find(({type:l})=>l===r);if(o||(o={type:r,rules:[]},a.rules.push(o)),a.keywords[e]=!0,!t)return;let c={keyword:e,definition:{...t,type:(0,hy.getJSONTypes)(t.type),schemaType:(0,hy.getJSONTypes)(t.schemaType)}};t.before?lX.call(this,o,c,t.before):o.rules.push(c),a.all[e]=c,(n=t.implements)===null||n===void 0||n.forEach(l=>this.addKeyword(l))}function lX(e,t,r){let n=e.rules.findIndex(s=>s.keyword===r);n>=0?e.rules.splice(n,0,t):(e.rules.push(t),this.logger.warn(`rule ${r} is not defined`))}function uX(e){let{metaSchema:t}=e;t!==void 0&&(e.$data&&this.opts.$data&&(t=mL(t)),e.validateSchema=this.compile(t,!0))}var dX={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function mL(e){return{anyOf:[e,dX]}}});var yL=G(sE=>{"use strict";Object.defineProperty(sE,"__esModule",{value:!0});var pX={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};sE.default=pX});var xL=G(mc=>{"use strict";Object.defineProperty(mc,"__esModule",{value:!0});mc.callRef=mc.getValidate=void 0;var fX=Yp(),_L=Bi(),li=Nt(),tu=ya(),bL=ly(),my=Qt(),hX={keyword:"$ref",schemaType:"string",code(e){let{gen:t,schema:r,it:n}=e,{baseId:s,schemaEnv:a,validateName:o,opts:c,self:l}=n,{root:u}=a;if((r==="#"||r==="#/")&&s===u.baseId)return p();let d=bL.resolveRef.call(l,u,s,r);if(d===void 0)throw new fX.default(n.opts.uriResolver,s,r);if(d instanceof bL.SchemaEnv)return f(d);return h(d);function p(){if(a===u)return gy(e,o,a,a.$async);let m=t.scopeValue("root",{ref:u});return gy(e,(0,li._)`${m}.validate`,u,u.$async)}function f(m){let g=vL(e,m);gy(e,g,m,m.$async)}function h(m){let g=t.scopeValue("schema",c.code.source===!0?{ref:m,code:(0,li.stringify)(m)}:{ref:m}),y=t.name("valid"),_=e.subschema({schema:m,dataTypes:[],schemaPath:li.nil,topSchemaRef:g,errSchemaPath:r},y);e.mergeEvaluated(_),e.ok(y)}}};function vL(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):(0,li._)`${r.scopeValue("wrapper",{ref:t})}.validate`}mc.getValidate=vL;function gy(e,t,r,n){let{gen:s,it:a}=e,{allErrors:o,schemaEnv:c,opts:l}=a,u=l.passContext?tu.default.this:li.nil;n?d():p();function d(){if(!c.$async)throw new Error("async schema referenced by sync schema");let m=s.let("valid");s.try(()=>{s.code((0,li._)`await ${(0,_L.callValidateCode)(e,t,u)}`),h(t),o||s.assign(m,!0)},g=>{s.if((0,li._)`!(${g} instanceof ${a.ValidationError})`,()=>s.throw(g)),f(g),o||s.assign(m,!1)}),e.ok(m)}function p(){e.result((0,_L.callValidateCode)(e,t,u),()=>h(t),()=>f(t))}function f(m){let g=(0,li._)`${m}.errors`;s.assign(tu.default.vErrors,(0,li._)`${tu.default.vErrors} === null ? ${g} : ${tu.default.vErrors}.concat(${g})`),s.assign(tu.default.errors,(0,li._)`${tu.default.vErrors}.length`)}function h(m){var g;if(!a.opts.unevaluated)return;let y=(g=r?.validate)===null||g===void 0?void 0:g.evaluated;if(a.props!==!0)if(y&&!y.dynamicProps)y.props!==void 0&&(a.props=my.mergeEvaluated.props(s,y.props,a.props));else{let _=s.var("props",(0,li._)`${m}.evaluated.props`);a.props=my.mergeEvaluated.props(s,_,a.props,li.Name)}if(a.items!==!0)if(y&&!y.dynamicItems)y.items!==void 0&&(a.items=my.mergeEvaluated.items(s,y.items,a.items));else{let _=s.var("items",(0,li._)`${m}.evaluated.items`);a.items=my.mergeEvaluated.items(s,_,a.items,li.Name)}}}mc.callRef=gy;mc.default=hX});var SL=G(aE=>{"use strict";Object.defineProperty(aE,"__esModule",{value:!0});var mX=yL(),gX=xL(),yX=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",mX.default,gX.default];aE.default=yX});var TL=G(oE=>{"use strict";Object.defineProperty(oE,"__esModule",{value:!0});var yy=Nt(),fo=yy.operators,_y={maximum:{okStr:"<=",ok:fo.LTE,fail:fo.GT},minimum:{okStr:">=",ok:fo.GTE,fail:fo.LT},exclusiveMaximum:{okStr:"<",ok:fo.LT,fail:fo.GTE},exclusiveMinimum:{okStr:">",ok:fo.GT,fail:fo.LTE}},_X={message:({keyword:e,schemaCode:t})=>(0,yy.str)`must be ${_y[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,yy._)`{comparison: ${_y[e].okStr}, limit: ${t}}`},bX={keyword:Object.keys(_y),type:"number",schemaType:"number",$data:!0,error:_X,code(e){let{keyword:t,data:r,schemaCode:n}=e;e.fail$data((0,yy._)`${r} ${_y[t].fail} ${n} || isNaN(${r})`)}};oE.default=bX});var wL=G(cE=>{"use strict";Object.defineProperty(cE,"__esModule",{value:!0});var rf=Nt(),vX={message:({schemaCode:e})=>(0,rf.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,rf._)`{multipleOf: ${e}}`},xX={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:vX,code(e){let{gen:t,data:r,schemaCode:n,it:s}=e,a=s.opts.multipleOfPrecision,o=t.let("res"),c=a?(0,rf._)`Math.abs(Math.round(${o}) - ${o}) > 1e-${a}`:(0,rf._)`${o} !== parseInt(${o})`;e.fail$data((0,rf._)`(${n} === 0 || (${o} = ${r}/${n}, ${c}))`)}};cE.default=xX});var PL=G(lE=>{"use strict";Object.defineProperty(lE,"__esModule",{value:!0});function EL(e){let t=e.length,r=0,n=0,s;for(;n<t;)r++,s=e.charCodeAt(n++),s>=55296&&s<=56319&&n<t&&(s=e.charCodeAt(n),(s&64512)===56320&&n++);return r}lE.default=EL;EL.code='require("ajv/dist/runtime/ucs2length").default'});var IL=G(uE=>{"use strict";Object.defineProperty(uE,"__esModule",{value:!0});var gc=Nt(),SX=Qt(),TX=PL(),wX={message({keyword:e,schemaCode:t}){let r=e==="maxLength"?"more":"fewer";return(0,gc.str)`must NOT have ${r} than ${t} characters`},params:({schemaCode:e})=>(0,gc._)`{limit: ${e}}`},EX={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:wX,code(e){let{keyword:t,data:r,schemaCode:n,it:s}=e,a=t==="maxLength"?gc.operators.GT:gc.operators.LT,o=s.opts.unicode===!1?(0,gc._)`${r}.length`:(0,gc._)`${(0,SX.useFunc)(e.gen,TX.default)}(${r})`;e.fail$data((0,gc._)`${o} ${a} ${n}`)}};uE.default=EX});var AL=G(dE=>{"use strict";Object.defineProperty(dE,"__esModule",{value:!0});var PX=Bi(),IX=Qt(),ru=Nt(),AX={message:({schemaCode:e})=>(0,ru.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,ru._)`{pattern: ${e}}`},kX={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:AX,code(e){let{gen:t,data:r,$data:n,schema:s,schemaCode:a,it:o}=e,c=o.opts.unicodeRegExp?"u":"";if(n){let{regExp:l}=o.opts.code,u=l.code==="new RegExp"?(0,ru._)`new RegExp`:(0,IX.useFunc)(t,l),d=t.let("valid");t.try(()=>t.assign(d,(0,ru._)`${u}(${a}, ${c}).test(${r})`),()=>t.assign(d,!1)),e.fail$data((0,ru._)`!${d}`)}else{let l=(0,PX.usePattern)(e,s);e.fail$data((0,ru._)`!${l}.test(${r})`)}}};dE.default=kX});var kL=G(pE=>{"use strict";Object.defineProperty(pE,"__esModule",{value:!0});var nf=Nt(),CX={message({keyword:e,schemaCode:t}){let r=e==="maxProperties"?"more":"fewer";return(0,nf.str)`must NOT have ${r} than ${t} properties`},params:({schemaCode:e})=>(0,nf._)`{limit: ${e}}`},NX={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:CX,code(e){let{keyword:t,data:r,schemaCode:n}=e,s=t==="maxProperties"?nf.operators.GT:nf.operators.LT;e.fail$data((0,nf._)`Object.keys(${r}).length ${s} ${n}`)}};pE.default=NX});var CL=G(fE=>{"use strict";Object.defineProperty(fE,"__esModule",{value:!0});var sf=Bi(),af=Nt(),OX=Qt(),$X={message:({params:{missingProperty:e}})=>(0,af.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,af._)`{missingProperty: ${e}}`},RX={keyword:"required",type:"object",schemaType:"array",$data:!0,error:$X,code(e){let{gen:t,schema:r,schemaCode:n,data:s,$data:a,it:o}=e,{opts:c}=o;if(!a&&r.length===0)return;let l=r.length>=c.loopRequired;if(o.allErrors?u():d(),c.strictRequired){let h=e.parentSchema.properties,{definedProperties:m}=e.it;for(let g of r)if(h?.[g]===void 0&&!m.has(g)){let y=o.schemaEnv.baseId+o.errSchemaPath,_=`required property "${g}" is not defined at "${y}" (strictRequired)`;(0,OX.checkStrictMode)(o,_,o.opts.strictRequired)}}function u(){if(l||a)e.block$data(af.nil,p);else for(let h of r)(0,sf.checkReportMissingProp)(e,h)}function d(){let h=t.let("missing");if(l||a){let m=t.let("valid",!0);e.block$data(m,()=>f(h,m)),e.ok(m)}else t.if((0,sf.checkMissingProp)(e,r,h)),(0,sf.reportMissingProp)(e,h),t.else()}function p(){t.forOf("prop",n,h=>{e.setParams({missingProperty:h}),t.if((0,sf.noPropertyInData)(t,s,h,c.ownProperties),()=>e.error())})}function f(h,m){e.setParams({missingProperty:h}),t.forOf(h,n,()=>{t.assign(m,(0,sf.propertyInData)(t,s,h,c.ownProperties)),t.if((0,af.not)(m),()=>{e.error(),t.break()})},af.nil)}}};fE.default=RX});var NL=G(hE=>{"use strict";Object.defineProperty(hE,"__esModule",{value:!0});var of=Nt(),DX={message({keyword:e,schemaCode:t}){let r=e==="maxItems"?"more":"fewer";return(0,of.str)`must NOT have ${r} than ${t} items`},params:({schemaCode:e})=>(0,of._)`{limit: ${e}}`},MX={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:DX,code(e){let{keyword:t,data:r,schemaCode:n}=e,s=t==="maxItems"?of.operators.GT:of.operators.LT;e.fail$data((0,of._)`${r}.length ${s} ${n}`)}};hE.default=MX});var by=G(mE=>{"use strict";Object.defineProperty(mE,"__esModule",{value:!0});var OL=j0();OL.code='require("ajv/dist/runtime/equal").default';mE.default=OL});var $L=G(yE=>{"use strict";Object.defineProperty(yE,"__esModule",{value:!0});var gE=Kp(),wn=Nt(),LX=Qt(),FX=by(),jX={message:({params:{i:e,j:t}})=>(0,wn.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,wn._)`{i: ${e}, j: ${t}}`},BX={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:jX,code(e){let{gen:t,data:r,$data:n,schema:s,parentSchema:a,schemaCode:o,it:c}=e;if(!n&&!s)return;let l=t.let("valid"),u=a.items?(0,gE.getSchemaTypes)(a.items):[];e.block$data(l,d,(0,wn._)`${o} === false`),e.ok(l);function d(){let m=t.let("i",(0,wn._)`${r}.length`),g=t.let("j");e.setParams({i:m,j:g}),t.assign(l,!0),t.if((0,wn._)`${m} > 1`,()=>(p()?f:h)(m,g))}function p(){return u.length>0&&!u.some(m=>m==="object"||m==="array")}function f(m,g){let y=t.name("item"),_=(0,gE.checkDataTypes)(u,y,c.opts.strictNumbers,gE.DataType.Wrong),v=t.const("indices",(0,wn._)`{}`);t.for((0,wn._)`;${m}--;`,()=>{t.let(y,(0,wn._)`${r}[${m}]`),t.if(_,(0,wn._)`continue`),u.length>1&&t.if((0,wn._)`typeof ${y} == "string"`,(0,wn._)`${y} += "_"`),t.if((0,wn._)`typeof ${v}[${y}] == "number"`,()=>{t.assign(g,(0,wn._)`${v}[${y}]`),e.error(),t.assign(l,!1).break()}).code((0,wn._)`${v}[${y}] = ${m}`)})}function h(m,g){let y=(0,LX.useFunc)(t,FX.default),_=t.name("outer");t.label(_).for((0,wn._)`;${m}--;`,()=>t.for((0,wn._)`${g} = ${m}; ${g}--;`,()=>t.if((0,wn._)`${y}(${r}[${m}], ${r}[${g}])`,()=>{e.error(),t.assign(l,!1).break(_)})))}}};yE.default=BX});var RL=G(bE=>{"use strict";Object.defineProperty(bE,"__esModule",{value:!0});var _E=Nt(),zX=Qt(),UX=by(),qX={message:"must be equal to constant",params:({schemaCode:e})=>(0,_E._)`{allowedValue: ${e}}`},WX={keyword:"const",$data:!0,error:qX,code(e){let{gen:t,data:r,$data:n,schemaCode:s,schema:a}=e;n||a&&typeof a=="object"?e.fail$data((0,_E._)`!${(0,zX.useFunc)(t,UX.default)}(${r}, ${s})`):e.fail((0,_E._)`${a} !== ${r}`)}};bE.default=WX});var DL=G(vE=>{"use strict";Object.defineProperty(vE,"__esModule",{value:!0});var cf=Nt(),VX=Qt(),KX=by(),GX={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,cf._)`{allowedValues: ${e}}`},ZX={keyword:"enum",schemaType:"array",$data:!0,error:GX,code(e){let{gen:t,data:r,$data:n,schema:s,schemaCode:a,it:o}=e;if(!n&&s.length===0)throw new Error("enum must have non-empty array");let c=s.length>=o.opts.loopEnum,l,u=()=>l??(l=(0,VX.useFunc)(t,KX.default)),d;if(c||n)d=t.let("valid"),e.block$data(d,p);else{if(!Array.isArray(s))throw new Error("ajv implementation error");let h=t.const("vSchema",a);d=(0,cf.or)(...s.map((m,g)=>f(h,g)))}e.pass(d);function p(){t.assign(d,!1),t.forOf("v",a,h=>t.if((0,cf._)`${u()}(${r}, ${h})`,()=>t.assign(d,!0).break()))}function f(h,m){let g=s[m];return typeof g=="object"&&g!==null?(0,cf._)`${u()}(${r}, ${h}[${m}])`:(0,cf._)`${r} === ${g}`}}};vE.default=ZX});var ML=G(xE=>{"use strict";Object.defineProperty(xE,"__esModule",{value:!0});var HX=TL(),JX=wL(),YX=IL(),XX=AL(),QX=kL(),eQ=CL(),tQ=NL(),rQ=$L(),nQ=RL(),iQ=DL(),sQ=[HX.default,JX.default,YX.default,XX.default,QX.default,eQ.default,tQ.default,rQ.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},nQ.default,iQ.default];xE.default=sQ});var TE=G(lf=>{"use strict";Object.defineProperty(lf,"__esModule",{value:!0});lf.validateAdditionalItems=void 0;var yc=Nt(),SE=Qt(),aQ={message:({params:{len:e}})=>(0,yc.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,yc._)`{limit: ${e}}`},oQ={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:aQ,code(e){let{parentSchema:t,it:r}=e,{items:n}=t;if(!Array.isArray(n)){(0,SE.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}LL(e,n)}};function LL(e,t){let{gen:r,schema:n,data:s,keyword:a,it:o}=e;o.items=!0;let c=r.const("len",(0,yc._)`${s}.length`);if(n===!1)e.setParams({len:t.length}),e.pass((0,yc._)`${c} <= ${t.length}`);else if(typeof n=="object"&&!(0,SE.alwaysValidSchema)(o,n)){let u=r.var("valid",(0,yc._)`${c} <= ${t.length}`);r.if((0,yc.not)(u),()=>l(u)),e.ok(u)}function l(u){r.forRange("i",t.length,c,d=>{e.subschema({keyword:a,dataProp:d,dataPropType:SE.Type.Num},u),o.allErrors||r.if((0,yc.not)(u),()=>r.break())})}}lf.validateAdditionalItems=LL;lf.default=oQ});var wE=G(uf=>{"use strict";Object.defineProperty(uf,"__esModule",{value:!0});uf.validateTuple=void 0;var FL=Nt(),vy=Qt(),cQ=Bi(),lQ={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:r}=e;if(Array.isArray(t))return jL(e,"additionalItems",t);r.items=!0,!(0,vy.alwaysValidSchema)(r,t)&&e.ok((0,cQ.validateArray)(e))}};function jL(e,t,r=e.schema){let{gen:n,parentSchema:s,data:a,keyword:o,it:c}=e;d(s),c.opts.unevaluated&&r.length&&c.items!==!0&&(c.items=vy.mergeEvaluated.items(n,r.length,c.items));let l=n.name("valid"),u=n.const("len",(0,FL._)`${a}.length`);r.forEach((p,f)=>{(0,vy.alwaysValidSchema)(c,p)||(n.if((0,FL._)`${u} > ${f}`,()=>e.subschema({keyword:o,schemaProp:f,dataProp:f},l)),e.ok(l))});function d(p){let{opts:f,errSchemaPath:h}=c,m=r.length,g=m===p.minItems&&(m===p.maxItems||p[t]===!1);if(f.strictTuples&&!g){let y=`"${o}" is ${m}-tuple, but minItems or maxItems/${t} are not specified or different at path "${h}"`;(0,vy.checkStrictMode)(c,y,f.strictTuples)}}}uf.validateTuple=jL;uf.default=lQ});var BL=G(EE=>{"use strict";Object.defineProperty(EE,"__esModule",{value:!0});var uQ=wE(),dQ={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,uQ.validateTuple)(e,"items")};EE.default=dQ});var UL=G(PE=>{"use strict";Object.defineProperty(PE,"__esModule",{value:!0});var zL=Nt(),pQ=Qt(),fQ=Bi(),hQ=TE(),mQ={message:({params:{len:e}})=>(0,zL.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,zL._)`{limit: ${e}}`},gQ={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:mQ,code(e){let{schema:t,parentSchema:r,it:n}=e,{prefixItems:s}=r;n.items=!0,!(0,pQ.alwaysValidSchema)(n,t)&&(s?(0,hQ.validateAdditionalItems)(e,s):e.ok((0,fQ.validateArray)(e)))}};PE.default=gQ});var qL=G(IE=>{"use strict";Object.defineProperty(IE,"__esModule",{value:!0});var Ui=Nt(),xy=Qt(),yQ={message:({params:{min:e,max:t}})=>t===void 0?(0,Ui.str)`must contain at least ${e} valid item(s)`:(0,Ui.str)`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?(0,Ui._)`{minContains: ${e}}`:(0,Ui._)`{minContains: ${e}, maxContains: ${t}}`},_Q={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:yQ,code(e){let{gen:t,schema:r,parentSchema:n,data:s,it:a}=e,o,c,{minContains:l,maxContains:u}=n;a.opts.next?(o=l===void 0?1:l,c=u):o=1;let d=t.const("len",(0,Ui._)`${s}.length`);if(e.setParams({min:o,max:c}),c===void 0&&o===0){(0,xy.checkStrictMode)(a,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(c!==void 0&&o>c){(0,xy.checkStrictMode)(a,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,xy.alwaysValidSchema)(a,r)){let g=(0,Ui._)`${d} >= ${o}`;c!==void 0&&(g=(0,Ui._)`${g} && ${d} <= ${c}`),e.pass(g);return}a.items=!0;let p=t.name("valid");c===void 0&&o===1?h(p,()=>t.if(p,()=>t.break())):o===0?(t.let(p,!0),c!==void 0&&t.if((0,Ui._)`${s}.length > 0`,f)):(t.let(p,!1),f()),e.result(p,()=>e.reset());function f(){let g=t.name("_valid"),y=t.let("count",0);h(g,()=>t.if(g,()=>m(y)))}function h(g,y){t.forRange("i",0,d,_=>{e.subschema({keyword:"contains",dataProp:_,dataPropType:xy.Type.Num,compositeRule:!0},g),y()})}function m(g){t.code((0,Ui._)`${g}++`),c===void 0?t.if((0,Ui._)`${g} >= ${o}`,()=>t.assign(p,!0).break()):(t.if((0,Ui._)`${g} > ${c}`,()=>t.assign(p,!1).break()),o===1?t.assign(p,!0):t.if((0,Ui._)`${g} >= ${o}`,()=>t.assign(p,!0)))}}};IE.default=_Q});var KL=G(Ls=>{"use strict";Object.defineProperty(Ls,"__esModule",{value:!0});Ls.validateSchemaDeps=Ls.validatePropertyDeps=Ls.error=void 0;var AE=Nt(),bQ=Qt(),df=Bi();Ls.error={message:({params:{property:e,depsCount:t,deps:r}})=>{let n=t===1?"property":"properties";return(0,AE.str)`must have ${n} ${r} when property ${e} is present`},params:({params:{property:e,depsCount:t,deps:r,missingProperty:n}})=>(0,AE._)`{property: ${e},
|
|
6
|
+
|| ${o} === "boolean" || ${s} === null`).assign(c,(0,kt._)`[${s}]`)}}}function QH({gen:e,parentData:t,parentDataProperty:r},n){e.if((0,kt._)`${t} !== undefined`,()=>e.assign((0,kt._)`${t}[${r}]`,n))}function $0(e,t,r,n=Jl.Correct){let s=n===Jl.Correct?kt.operators.EQ:kt.operators.NEQ,a;switch(e){case"null":return(0,kt._)`${t} ${s} null`;case"array":a=(0,kt._)`Array.isArray(${t})`;break;case"object":a=(0,kt._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":a=o((0,kt._)`!(${t} % 1) && !isNaN(${t})`);break;case"number":a=o();break;default:return(0,kt._)`typeof ${t} ${s} ${e}`}return n===Jl.Correct?a:(0,kt.not)(a);function o(c=kt.nil){return(0,kt.and)((0,kt._)`typeof ${t} == "number"`,c,r?(0,kt._)`isFinite(${t})`:kt.nil)}}Dn.checkDataType=$0;function R0(e,t,r,n){if(e.length===1)return $0(e[0],t,r,n);let s,a=(0,hM.toHash)(e);if(a.array&&a.object){let o=(0,kt._)`typeof ${t} != "object"`;s=a.null?o:(0,kt._)`!${t} || ${o}`,delete a.null,delete a.array,delete a.object}else s=kt.nil;a.number&&delete a.integer;for(let o in a)s=(0,kt.and)(s,$0(o,t,r,n));return s}Dn.checkDataTypes=R0;var eJ={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?(0,kt._)`{type: ${e}}`:(0,kt._)`{type: ${t}}`};function D0(e){let t=tJ(e);(0,ZH.reportError)(t,eJ)}Dn.reportTypeError=D0;function tJ(e){let{gen:t,data:r,schema:n}=e,s=(0,hM.schemaRefOrVal)(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:s,schemaValue:s,parentSchema:n,params:{},it:e}}});var _M=G(ny=>{"use strict";Object.defineProperty(ny,"__esModule",{value:!0});ny.assignDefaults=void 0;var Yl=Nt(),rJ=Qt();function nJ(e,t){let{properties:r,items:n}=e.schema;if(t==="object"&&r)for(let s in r)yM(e,s,r[s].default);else t==="array"&&Array.isArray(n)&&n.forEach((s,a)=>yM(e,a,s.default))}ny.assignDefaults=nJ;function yM(e,t,r){let{gen:n,compositeRule:s,data:a,opts:o}=e;if(r===void 0)return;let c=(0,Yl._)`${a}${(0,Yl.getProperty)(t)}`;if(s){(0,rJ.checkStrictMode)(e,`default is ignored for: ${c}`);return}let l=(0,Yl._)`${c} === undefined`;o.useDefaults==="empty"&&(l=(0,Yl._)`${l} || ${c} === null || ${c} === ""`),n.if(l,(0,Yl._)`${c} = ${(0,Yl.stringify)(r)}`)}});var Bi=G(gr=>{"use strict";Object.defineProperty(gr,"__esModule",{value:!0});gr.validateUnion=gr.validateArray=gr.usePattern=gr.callValidateCode=gr.schemaProperties=gr.allSchemaProperties=gr.noPropertyInData=gr.propertyInData=gr.isOwnProperty=gr.hasPropFunc=gr.reportMissingProp=gr.checkMissingProp=gr.checkReportMissingProp=void 0;var Nr=Nt(),M0=Qt(),co=ya(),iJ=Qt();function sJ(e,t){let{gen:r,data:n,it:s}=e;r.if(F0(r,n,t,s.opts.ownProperties),()=>{e.setParams({missingProperty:(0,Nr._)`${t}`},!0),e.error()})}gr.checkReportMissingProp=sJ;function aJ({gen:e,data:t,it:{opts:r}},n,s){return(0,Nr.or)(...n.map(a=>(0,Nr.and)(F0(e,t,a,r.ownProperties),(0,Nr._)`${s} = ${a}`)))}gr.checkMissingProp=aJ;function oJ(e,t){e.setParams({missingProperty:t},!0),e.error()}gr.reportMissingProp=oJ;function bM(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,Nr._)`Object.prototype.hasOwnProperty`})}gr.hasPropFunc=bM;function L0(e,t,r){return(0,Nr._)`${bM(e)}.call(${t}, ${r})`}gr.isOwnProperty=L0;function cJ(e,t,r,n){let s=(0,Nr._)`${t}${(0,Nr.getProperty)(r)} !== undefined`;return n?(0,Nr._)`${s} && ${L0(e,t,r)}`:s}gr.propertyInData=cJ;function F0(e,t,r,n){let s=(0,Nr._)`${t}${(0,Nr.getProperty)(r)} === undefined`;return n?(0,Nr.or)(s,(0,Nr.not)(L0(e,t,r))):s}gr.noPropertyInData=F0;function vM(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}gr.allSchemaProperties=vM;function lJ(e,t){return vM(t).filter(r=>!(0,M0.alwaysValidSchema)(e,t[r]))}gr.schemaProperties=lJ;function uJ({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:s,errorPath:a},it:o},c,l,u){let d=u?(0,Nr._)`${e}, ${t}, ${n}${s}`:t,p=[[co.default.instancePath,(0,Nr.strConcat)(co.default.instancePath,a)],[co.default.parentData,o.parentData],[co.default.parentDataProperty,o.parentDataProperty],[co.default.rootData,co.default.rootData]];o.opts.dynamicRef&&p.push([co.default.dynamicAnchors,co.default.dynamicAnchors]);let f=(0,Nr._)`${d}, ${r.object(...p)}`;return l!==Nr.nil?(0,Nr._)`${c}.call(${l}, ${f})`:(0,Nr._)`${c}(${f})`}gr.callValidateCode=uJ;var dJ=(0,Nr._)`new RegExp`;function pJ({gen:e,it:{opts:t}},r){let n=t.unicodeRegExp?"u":"",{regExp:s}=t.code,a=s(r,n);return e.scopeValue("pattern",{key:a.toString(),ref:a,code:(0,Nr._)`${s.code==="new RegExp"?dJ:(0,iJ.useFunc)(e,s)}(${r}, ${n})`})}gr.usePattern=pJ;function fJ(e){let{gen:t,data:r,keyword:n,it:s}=e,a=t.name("valid");if(s.allErrors){let c=t.let("valid",!0);return o(()=>t.assign(c,!1)),c}return t.var(a,!0),o(()=>t.break()),a;function o(c){let l=t.const("len",(0,Nr._)`${r}.length`);t.forRange("i",0,l,u=>{e.subschema({keyword:n,dataProp:u,dataPropType:M0.Type.Num},a),t.if((0,Nr.not)(a),c)})}}gr.validateArray=fJ;function hJ(e){let{gen:t,schema:r,keyword:n,it:s}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(l=>(0,M0.alwaysValidSchema)(s,l))&&!s.opts.unevaluated)return;let o=t.let("valid",!1),c=t.name("_valid");t.block(()=>r.forEach((l,u)=>{let d=e.subschema({keyword:n,schemaProp:u,compositeRule:!0},c);t.assign(o,(0,Nr._)`${o} || ${c}`),e.mergeValidEvaluated(d,c)||t.if((0,Nr.not)(o))})),e.result(o,()=>e.reset(),()=>e.error(!0))}gr.validateUnion=hJ});var TM=G(Rs=>{"use strict";Object.defineProperty(Rs,"__esModule",{value:!0});Rs.validateKeywordUsage=Rs.validSchemaType=Rs.funcKeywordCode=Rs.macroKeywordCode=void 0;var Zn=Nt(),fc=ya(),mJ=Bi(),gJ=Vp();function yJ(e,t){let{gen:r,keyword:n,schema:s,parentSchema:a,it:o}=e,c=t.macro.call(o.self,s,a,o),l=SM(r,n,c);o.opts.validateSchema!==!1&&o.self.validateSchema(c,!0);let u=r.name("valid");e.subschema({schema:c,schemaPath:Zn.nil,errSchemaPath:`${o.errSchemaPath}/${n}`,topSchemaRef:l,compositeRule:!0},u),e.pass(u,()=>e.error(!0))}Rs.macroKeywordCode=yJ;function _J(e,t){var r;let{gen:n,keyword:s,schema:a,parentSchema:o,$data:c,it:l}=e;vJ(l,t);let u=!c&&t.compile?t.compile.call(l.self,a,o,l):t.validate,d=SM(n,s,u),p=n.let("valid");e.block$data(p,f),e.ok((r=t.valid)!==null&&r!==void 0?r:p);function f(){if(t.errors===!1)g(),t.modifying&&xM(e),y(()=>e.error());else{let _=t.async?h():m();t.modifying&&xM(e),y(()=>bJ(e,_))}}function h(){let _=n.let("ruleErrs",null);return n.try(()=>g((0,Zn._)`await `),v=>n.assign(p,!1).if((0,Zn._)`${v} instanceof ${l.ValidationError}`,()=>n.assign(_,(0,Zn._)`${v}.errors`),()=>n.throw(v))),_}function m(){let _=(0,Zn._)`${d}.errors`;return n.assign(_,null),g(Zn.nil),_}function g(_=t.async?(0,Zn._)`await `:Zn.nil){let v=l.opts.passContext?fc.default.this:fc.default.self,S=!("compile"in t&&!c||t.schema===!1);n.assign(p,(0,Zn._)`${_}${(0,mJ.callValidateCode)(e,d,v,S)}`,t.modifying)}function y(_){var v;n.if((0,Zn.not)((v=t.valid)!==null&&v!==void 0?v:p),_)}}Rs.funcKeywordCode=_J;function xM(e){let{gen:t,data:r,it:n}=e;t.if(n.parentData,()=>t.assign(r,(0,Zn._)`${n.parentData}[${n.parentDataProperty}]`))}function bJ(e,t){let{gen:r}=e;r.if((0,Zn._)`Array.isArray(${t})`,()=>{r.assign(fc.default.vErrors,(0,Zn._)`${fc.default.vErrors} === null ? ${t} : ${fc.default.vErrors}.concat(${t})`).assign(fc.default.errors,(0,Zn._)`${fc.default.vErrors}.length`),(0,gJ.extendErrors)(e)},()=>e.error())}function vJ({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}function SM(e,t,r){if(r===void 0)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,Zn.stringify)(r)})}function xJ(e,t,r=!1){return!t.length||t.some(n=>n==="array"?Array.isArray(e):n==="object"?e&&typeof e=="object"&&!Array.isArray(e):typeof e==n||r&&typeof e>"u")}Rs.validSchemaType=xJ;function SJ({schema:e,opts:t,self:r,errSchemaPath:n},s,a){if(Array.isArray(s.keyword)?!s.keyword.includes(a):s.keyword!==a)throw new Error("ajv implementation error");let o=s.dependencies;if(o?.some(c=>!Object.prototype.hasOwnProperty.call(e,c)))throw new Error(`parent schema must have dependencies of ${a}: ${o.join(",")}`);if(s.validateSchema&&!s.validateSchema(e[a])){let l=`keyword "${a}" value is invalid at path "${n}": `+r.errorsText(s.validateSchema.errors);if(t.validateSchema==="log")r.logger.error(l);else throw new Error(l)}}Rs.validateKeywordUsage=SJ});var EM=G(lo=>{"use strict";Object.defineProperty(lo,"__esModule",{value:!0});lo.extendSubschemaMode=lo.extendSubschemaData=lo.getSubschema=void 0;var Ds=Nt(),wM=Qt();function TJ(e,{keyword:t,schemaProp:r,schema:n,schemaPath:s,errSchemaPath:a,topSchemaRef:o}){if(t!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){let c=e.schema[t];return r===void 0?{schema:c,schemaPath:(0,Ds._)`${e.schemaPath}${(0,Ds.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:c[r],schemaPath:(0,Ds._)`${e.schemaPath}${(0,Ds.getProperty)(t)}${(0,Ds.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,wM.escapeFragment)(r)}`}}if(n!==void 0){if(s===void 0||a===void 0||o===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:s,topSchemaRef:o,errSchemaPath:a}}throw new Error('either "keyword" or "schema" must be passed')}lo.getSubschema=TJ;function wJ(e,t,{dataProp:r,dataPropType:n,data:s,dataTypes:a,propertyName:o}){if(s!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:c}=t;if(r!==void 0){let{errorPath:u,dataPathArr:d,opts:p}=t,f=c.let("data",(0,Ds._)`${t.data}${(0,Ds.getProperty)(r)}`,!0);l(f),e.errorPath=(0,Ds.str)`${u}${(0,wM.getErrorPath)(r,n,p.jsPropertySyntax)}`,e.parentDataProperty=(0,Ds._)`${r}`,e.dataPathArr=[...d,e.parentDataProperty]}if(s!==void 0){let u=s instanceof Ds.Name?s:c.let("data",s,!0);l(u),o!==void 0&&(e.propertyName=o)}a&&(e.dataTypes=a);function l(u){e.data=u,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,u]}}lo.extendSubschemaData=wJ;function EJ(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:s,allErrors:a}){n!==void 0&&(e.compositeRule=n),s!==void 0&&(e.createErrors=s),a!==void 0&&(e.allErrors=a),e.jtdDiscriminator=t,e.jtdMetadata=r}lo.extendSubschemaMode=EJ});var j0=G((jHe,PM)=>{"use strict";PM.exports=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,s,a;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(s=n;s--!==0;)if(!e(t[s],r[s]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(a=Object.keys(t),n=a.length,n!==Object.keys(r).length)return!1;for(s=n;s--!==0;)if(!Object.prototype.hasOwnProperty.call(r,a[s]))return!1;for(s=n;s--!==0;){var o=a[s];if(!e(t[o],r[o]))return!1}return!0}return t!==t&&r!==r}});var AM=G((BHe,IM)=>{"use strict";var uo=IM.exports=function(e,t,r){typeof t=="function"&&(r=t,t={}),r=t.cb||r;var n=typeof r=="function"?r:r.pre||function(){},s=r.post||function(){};iy(t,n,s,e,"",e)};uo.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};uo.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};uo.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};uo.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 iy(e,t,r,n,s,a,o,c,l,u){if(n&&typeof n=="object"&&!Array.isArray(n)){t(n,s,a,o,c,l,u);for(var d in n){var p=n[d];if(Array.isArray(p)){if(d in uo.arrayKeywords)for(var f=0;f<p.length;f++)iy(e,t,r,p[f],s+"/"+d+"/"+f,a,s,d,n,f)}else if(d in uo.propsKeywords){if(p&&typeof p=="object")for(var h in p)iy(e,t,r,p[h],s+"/"+d+"/"+PJ(h),a,s,d,n,h)}else(d in uo.keywords||e.allKeys&&!(d in uo.skipKeywords))&&iy(e,t,r,p,s+"/"+d,a,s,d,n)}r(n,s,a,o,c,l,u)}}function PJ(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}});var Gp=G(ci=>{"use strict";Object.defineProperty(ci,"__esModule",{value:!0});ci.getSchemaRefs=ci.resolveUrl=ci.normalizeId=ci._getFullPath=ci.getFullPath=ci.inlineRef=void 0;var IJ=Qt(),AJ=j0(),kJ=AM(),CJ=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function NJ(e,t=!0){return typeof e=="boolean"?!0:t===!0?!B0(e):t?kM(e)<=t:!1}ci.inlineRef=NJ;var OJ=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function B0(e){for(let t in e){if(OJ.has(t))return!0;let r=e[t];if(Array.isArray(r)&&r.some(B0)||typeof r=="object"&&B0(r))return!0}return!1}function kM(e){let t=0;for(let r in e){if(r==="$ref")return 1/0;if(t++,!CJ.has(r)&&(typeof e[r]=="object"&&(0,IJ.eachItem)(e[r],n=>t+=kM(n)),t===1/0))return 1/0}return t}function CM(e,t="",r){r!==!1&&(t=Xl(t));let n=e.parse(t);return NM(e,n)}ci.getFullPath=CM;function NM(e,t){return e.serialize(t).split("#")[0]+"#"}ci._getFullPath=NM;var $J=/#\/?$/;function Xl(e){return e?e.replace($J,""):""}ci.normalizeId=Xl;function RJ(e,t,r){return r=Xl(r),e.resolve(t,r)}ci.resolveUrl=RJ;var DJ=/^[a-z_][-a-z0-9._]*$/i;function MJ(e,t){if(typeof e=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,s=Xl(e[r]||t),a={"":s},o=CM(n,s,!1),c={},l=new Set;return kJ(e,{allKeys:!0},(p,f,h,m)=>{if(m===void 0)return;let g=o+f,y=a[m];typeof p[r]=="string"&&(y=_.call(this,p[r])),v.call(this,p.$anchor),v.call(this,p.$dynamicAnchor),a[f]=y;function _(S){let w=this.opts.uriResolver.resolve;if(S=Xl(y?w(y,S):S),l.has(S))throw d(S);l.add(S);let E=this.refs[S];return typeof E=="string"&&(E=this.refs[E]),typeof E=="object"?u(p,E.schema,S):S!==Xl(g)&&(S[0]==="#"?(u(p,c[S],S),c[S]=p):this.refs[S]=g),S}function v(S){if(typeof S=="string"){if(!DJ.test(S))throw new Error(`invalid anchor "${S}"`);_.call(this,`#${S}`)}}}),c;function u(p,f,h){if(f!==void 0&&!AJ(p,f))throw d(h)}function d(p){return new Error(`reference "${p}" resolves to more than one schema`)}}ci.getSchemaRefs=MJ});var Jp=G(po=>{"use strict";Object.defineProperty(po,"__esModule",{value:!0});po.getData=po.KeywordCxt=po.validateFunctionCode=void 0;var MM=dM(),OM=Kp(),U0=O0(),sy=Kp(),LJ=_M(),Hp=TM(),z0=EM(),Je=Nt(),bt=ya(),FJ=Gp(),_a=Qt(),Zp=Vp();function jJ(e){if(jM(e)&&(BM(e),FM(e))){UJ(e);return}LM(e,()=>(0,MM.topBoolOrEmptySchema)(e))}po.validateFunctionCode=jJ;function LM({gen:e,validateName:t,schema:r,schemaEnv:n,opts:s},a){s.code.es5?e.func(t,(0,Je._)`${bt.default.data}, ${bt.default.valCxt}`,n.$async,()=>{e.code((0,Je._)`"use strict"; ${$M(r,s)}`),zJ(e,s),e.code(a)}):e.func(t,(0,Je._)`${bt.default.data}, ${BJ(s)}`,n.$async,()=>e.code($M(r,s)).code(a))}function BJ(e){return(0,Je._)`{${bt.default.instancePath}="", ${bt.default.parentData}, ${bt.default.parentDataProperty}, ${bt.default.rootData}=${bt.default.data}${e.dynamicRef?(0,Je._)`, ${bt.default.dynamicAnchors}={}`:Je.nil}}={}`}function zJ(e,t){e.if(bt.default.valCxt,()=>{e.var(bt.default.instancePath,(0,Je._)`${bt.default.valCxt}.${bt.default.instancePath}`),e.var(bt.default.parentData,(0,Je._)`${bt.default.valCxt}.${bt.default.parentData}`),e.var(bt.default.parentDataProperty,(0,Je._)`${bt.default.valCxt}.${bt.default.parentDataProperty}`),e.var(bt.default.rootData,(0,Je._)`${bt.default.valCxt}.${bt.default.rootData}`),t.dynamicRef&&e.var(bt.default.dynamicAnchors,(0,Je._)`${bt.default.valCxt}.${bt.default.dynamicAnchors}`)},()=>{e.var(bt.default.instancePath,(0,Je._)`""`),e.var(bt.default.parentData,(0,Je._)`undefined`),e.var(bt.default.parentDataProperty,(0,Je._)`undefined`),e.var(bt.default.rootData,bt.default.data),t.dynamicRef&&e.var(bt.default.dynamicAnchors,(0,Je._)`{}`)})}function UJ(e){let{schema:t,opts:r,gen:n}=e;LM(e,()=>{r.$comment&&t.$comment&&UM(e),GJ(e),n.let(bt.default.vErrors,null),n.let(bt.default.errors,0),r.unevaluated&&qJ(e),zM(e),JJ(e)})}function qJ(e){let{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",(0,Je._)`${r}.evaluated`),t.if((0,Je._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,Je._)`${e.evaluated}.props`,(0,Je._)`undefined`)),t.if((0,Je._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,Je._)`${e.evaluated}.items`,(0,Je._)`undefined`))}function $M(e,t){let r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?(0,Je._)`/*# sourceURL=${r} */`:Je.nil}function WJ(e,t){if(jM(e)&&(BM(e),FM(e))){VJ(e,t);return}(0,MM.boolOrEmptySchema)(e,t)}function FM({schema:e,self:t}){if(typeof e=="boolean")return!e;for(let r in e)if(t.RULES.all[r])return!0;return!1}function jM(e){return typeof e.schema!="boolean"}function VJ(e,t){let{schema:r,gen:n,opts:s}=e;s.$comment&&r.$comment&&UM(e),ZJ(e),HJ(e);let a=n.const("_errs",bt.default.errors);zM(e,a),n.var(t,(0,Je._)`${a} === ${bt.default.errors}`)}function BM(e){(0,_a.checkUnknownRules)(e),KJ(e)}function zM(e,t){if(e.opts.jtd)return RM(e,[],!1,t);let r=(0,OM.getSchemaTypes)(e.schema),n=(0,OM.coerceAndCheckDataType)(e,r);RM(e,r,!n,t)}function KJ(e){let{schema:t,errSchemaPath:r,opts:n,self:s}=e;t.$ref&&n.ignoreKeywordsWithRef&&(0,_a.schemaHasRulesButRef)(t,s.RULES)&&s.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function GJ(e){let{schema:t,opts:r}=e;t.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,_a.checkStrictMode)(e,"default is ignored in the schema root")}function ZJ(e){let t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,FJ.resolveUrl)(e.opts.uriResolver,e.baseId,t))}function HJ(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}function UM({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:s}){let a=r.$comment;if(s.$comment===!0)e.code((0,Je._)`${bt.default.self}.logger.log(${a})`);else if(typeof s.$comment=="function"){let o=(0,Je.str)`${n}/$comment`,c=e.scopeValue("root",{ref:t.root});e.code((0,Je._)`${bt.default.self}.opts.$comment(${a}, ${o}, ${c}.schema)`)}}function JJ(e){let{gen:t,schemaEnv:r,validateName:n,ValidationError:s,opts:a}=e;r.$async?t.if((0,Je._)`${bt.default.errors} === 0`,()=>t.return(bt.default.data),()=>t.throw((0,Je._)`new ${s}(${bt.default.vErrors})`)):(t.assign((0,Je._)`${n}.errors`,bt.default.vErrors),a.unevaluated&&YJ(e),t.return((0,Je._)`${bt.default.errors} === 0`))}function YJ({gen:e,evaluated:t,props:r,items:n}){r instanceof Je.Name&&e.assign((0,Je._)`${t}.props`,r),n instanceof Je.Name&&e.assign((0,Je._)`${t}.items`,n)}function RM(e,t,r,n){let{gen:s,schema:a,data:o,allErrors:c,opts:l,self:u}=e,{RULES:d}=u;if(a.$ref&&(l.ignoreKeywordsWithRef||!(0,_a.schemaHasRulesButRef)(a,d))){s.block(()=>WM(e,"$ref",d.all.$ref.definition));return}l.jtd||XJ(e,t),s.block(()=>{for(let f of d.rules)p(f);p(d.post)});function p(f){(0,U0.shouldUseGroup)(a,f)&&(f.type?(s.if((0,sy.checkDataType)(f.type,o,l.strictNumbers)),DM(e,f),t.length===1&&t[0]===f.type&&r&&(s.else(),(0,sy.reportTypeError)(e)),s.endIf()):DM(e,f),c||s.if((0,Je._)`${bt.default.errors} === ${n||0}`))}}function DM(e,t){let{gen:r,schema:n,opts:{useDefaults:s}}=e;s&&(0,LJ.assignDefaults)(e,t.type),r.block(()=>{for(let a of t.rules)(0,U0.shouldUseRule)(n,a)&&WM(e,a.keyword,a.definition,t.type)})}function XJ(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(QJ(e,t),e.opts.allowUnionTypes||eY(e,t),tY(e,e.dataTypes))}function QJ(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(r=>{qM(e.dataTypes,r)||q0(e,`type "${r}" not allowed by context "${e.dataTypes.join(",")}"`)}),nY(e,t)}}function eY(e,t){t.length>1&&!(t.length===2&&t.includes("null"))&&q0(e,"use allowUnionTypes to allow union type keyword")}function tY(e,t){let r=e.self.RULES.all;for(let n in r){let s=r[n];if(typeof s=="object"&&(0,U0.shouldUseRule)(e.schema,s)){let{type:a}=s.definition;a.length&&!a.some(o=>rY(t,o))&&q0(e,`missing type "${a.join(",")}" for keyword "${n}"`)}}}function rY(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function qM(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function nY(e,t){let r=[];for(let n of e.dataTypes)qM(t,n)?r.push(n):t.includes("integer")&&n==="number"&&r.push("integer");e.dataTypes=r}function q0(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,(0,_a.checkStrictMode)(e,t,e.opts.strictTypes)}var ay=class{constructor(t,r,n){if((0,Hp.validateKeywordUsage)(t,r,n),this.gen=t.gen,this.allErrors=t.allErrors,this.keyword=n,this.data=t.data,this.schema=t.schema[n],this.$data=r.$data&&t.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,_a.schemaRefOrVal)(t,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=t.schema,this.params={},this.it=t,this.def=r,this.$data)this.schemaCode=t.gen.const("vSchema",VM(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,Hp.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=t.gen.const("_errs",bt.default.errors))}result(t,r,n){this.failResult((0,Je.not)(t),r,n)}failResult(t,r,n){this.gen.if(t),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(t,r){this.failResult((0,Je.not)(t),void 0,r)}fail(t){if(t===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(t),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(t){if(!this.$data)return this.fail(t);let{schemaCode:r}=this;this.fail((0,Je._)`${r} !== undefined && (${(0,Je.or)(this.invalid$data(),t)})`)}error(t,r,n){if(r){this.setParams(r),this._error(t,n),this.setParams({});return}this._error(t,n)}_error(t,r){(t?Zp.reportExtraError:Zp.reportError)(this,this.def.error,r)}$dataError(){(0,Zp.reportError)(this,this.def.$dataError||Zp.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Zp.resetErrorsCount)(this.gen,this.errsCount)}ok(t){this.allErrors||this.gen.if(t)}setParams(t,r){r?Object.assign(this.params,t):this.params=t}block$data(t,r,n=Je.nil){this.gen.block(()=>{this.check$data(t,n),r()})}check$data(t=Je.nil,r=Je.nil){if(!this.$data)return;let{gen:n,schemaCode:s,schemaType:a,def:o}=this;n.if((0,Je.or)((0,Je._)`${s} === undefined`,r)),t!==Je.nil&&n.assign(t,!0),(a.length||o.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),t!==Je.nil&&n.assign(t,!1)),n.else()}invalid$data(){let{gen:t,schemaCode:r,schemaType:n,def:s,it:a}=this;return(0,Je.or)(o(),c());function o(){if(n.length){if(!(r instanceof Je.Name))throw new Error("ajv implementation error");let l=Array.isArray(n)?n:[n];return(0,Je._)`${(0,sy.checkDataTypes)(l,r,a.opts.strictNumbers,sy.DataType.Wrong)}`}return Je.nil}function c(){if(s.validateSchema){let l=t.scopeValue("validate$data",{ref:s.validateSchema});return(0,Je._)`!${l}(${r})`}return Je.nil}}subschema(t,r){let n=(0,z0.getSubschema)(this.it,t);(0,z0.extendSubschemaData)(n,this.it,t),(0,z0.extendSubschemaMode)(n,t);let s={...this.it,...n,items:void 0,props:void 0};return WJ(s,r),s}mergeEvaluated(t,r){let{it:n,gen:s}=this;n.opts.unevaluated&&(n.props!==!0&&t.props!==void 0&&(n.props=_a.mergeEvaluated.props(s,t.props,n.props,r)),n.items!==!0&&t.items!==void 0&&(n.items=_a.mergeEvaluated.items(s,t.items,n.items,r)))}mergeValidEvaluated(t,r){let{it:n,gen:s}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return s.if(r,()=>this.mergeEvaluated(t,Je.Name)),!0}};po.KeywordCxt=ay;function WM(e,t,r,n){let s=new ay(e,r,t);"code"in r?r.code(s,n):s.$data&&r.validate?(0,Hp.funcKeywordCode)(s,r):"macro"in r?(0,Hp.macroKeywordCode)(s,r):(r.compile||r.validate)&&(0,Hp.funcKeywordCode)(s,r)}var iY=/^\/(?:[^~]|~0|~1)*$/,sY=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function VM(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let s,a;if(e==="")return bt.default.rootData;if(e[0]==="/"){if(!iY.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);s=e,a=bt.default.rootData}else{let u=sY.exec(e);if(!u)throw new Error(`Invalid JSON-pointer: ${e}`);let d=+u[1];if(s=u[2],s==="#"){if(d>=t)throw new Error(l("property/index",d));return n[t-d]}if(d>t)throw new Error(l("data",d));if(a=r[t-d],!s)return a}let o=a,c=s.split("/");for(let u of c)u&&(a=(0,Je._)`${a}${(0,Je.getProperty)((0,_a.unescapeJsonPointer)(u))}`,o=(0,Je._)`${o} && ${a}`);return o;function l(u,d){return`Cannot access ${u} ${d} levels up, current level is ${t}`}}po.getData=VM});var oy=G(V0=>{"use strict";Object.defineProperty(V0,"__esModule",{value:!0});var W0=class extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}};V0.default=W0});var Yp=G(Z0=>{"use strict";Object.defineProperty(Z0,"__esModule",{value:!0});var K0=Gp(),G0=class extends Error{constructor(t,r,n,s){super(s||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,K0.resolveUrl)(t,r,n),this.missingSchema=(0,K0.normalizeId)((0,K0.getFullPath)(t,this.missingRef))}};Z0.default=G0});var ly=G(zi=>{"use strict";Object.defineProperty(zi,"__esModule",{value:!0});zi.resolveSchema=zi.getCompilingSchema=zi.resolveRef=zi.compileSchema=zi.SchemaEnv=void 0;var ms=Nt(),aY=oy(),hc=ya(),gs=Gp(),KM=Qt(),oY=Jp(),Ql=class{constructor(t){var r;this.refs={},this.dynamicAnchors={};let n;typeof t.schema=="object"&&(n=t.schema),this.schema=t.schema,this.schemaId=t.schemaId,this.root=t.root||this,this.baseId=(r=t.baseId)!==null&&r!==void 0?r:(0,gs.normalizeId)(n?.[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=n?.$async,this.refs={}}};zi.SchemaEnv=Ql;function J0(e){let t=GM.call(this,e);if(t)return t;let r=(0,gs.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:n,lines:s}=this.opts.code,{ownProperties:a}=this.opts,o=new ms.CodeGen(this.scope,{es5:n,lines:s,ownProperties:a}),c;e.$async&&(c=o.scopeValue("Error",{ref:aY.default,code:(0,ms._)`require("ajv/dist/runtime/validation_error").default`}));let l=o.scopeName("validate");e.validateName=l;let u={gen:o,allErrors:this.opts.allErrors,data:hc.default.data,parentData:hc.default.parentData,parentDataProperty:hc.default.parentDataProperty,dataNames:[hc.default.data],dataPathArr:[ms.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:o.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,ms.stringify)(e.schema)}:{ref:e.schema}),validateName:l,ValidationError:c,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:ms.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,ms._)`""`,opts:this.opts,self:this},d;try{this._compilations.add(e),(0,oY.validateFunctionCode)(u),o.optimize(this.opts.code.optimize);let p=o.toString();d=`${o.scopeRefs(hc.default.scope)}return ${p}`,this.opts.code.process&&(d=this.opts.code.process(d,e));let h=new Function(`${hc.default.self}`,`${hc.default.scope}`,d)(this,this.scope.get());if(this.scope.value(l,{ref:h}),h.errors=null,h.schema=e.schema,h.schemaEnv=e,e.$async&&(h.$async=!0),this.opts.code.source===!0&&(h.source={validateName:l,validateCode:p,scopeValues:o._values}),this.opts.unevaluated){let{props:m,items:g}=u;h.evaluated={props:m instanceof ms.Name?void 0:m,items:g instanceof ms.Name?void 0:g,dynamicProps:m instanceof ms.Name,dynamicItems:g instanceof ms.Name},h.source&&(h.source.evaluated=(0,ms.stringify)(h.evaluated))}return e.validate=h,e}catch(p){throw delete e.validate,delete e.validateName,d&&this.logger.error("Error compiling schema, function code:",d),p}finally{this._compilations.delete(e)}}zi.compileSchema=J0;function cY(e,t,r){var n;r=(0,gs.resolveUrl)(this.opts.uriResolver,t,r);let s=e.refs[r];if(s)return s;let a=dY.call(this,e,r);if(a===void 0){let o=(n=e.localRefs)===null||n===void 0?void 0:n[r],{schemaId:c}=this.opts;o&&(a=new Ql({schema:o,schemaId:c,root:e,baseId:t}))}if(a!==void 0)return e.refs[r]=lY.call(this,a)}zi.resolveRef=cY;function lY(e){return(0,gs.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:J0.call(this,e)}function GM(e){for(let t of this._compilations)if(uY(t,e))return t}zi.getCompilingSchema=GM;function uY(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function dY(e,t){let r;for(;typeof(r=this.refs[t])=="string";)t=r;return r||this.schemas[t]||cy.call(this,e,t)}function cy(e,t){let r=this.opts.uriResolver.parse(t),n=(0,gs._getFullPath)(this.opts.uriResolver,r),s=(0,gs.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===s)return H0.call(this,r,e);let a=(0,gs.normalizeId)(n),o=this.refs[a]||this.schemas[a];if(typeof o=="string"){let c=cy.call(this,e,o);return typeof c?.schema!="object"?void 0:H0.call(this,r,c)}if(typeof o?.schema=="object"){if(o.validate||J0.call(this,o),a===(0,gs.normalizeId)(t)){let{schema:c}=o,{schemaId:l}=this.opts,u=c[l];return u&&(s=(0,gs.resolveUrl)(this.opts.uriResolver,s,u)),new Ql({schema:c,schemaId:l,root:e,baseId:s})}return H0.call(this,r,o)}}zi.resolveSchema=cy;var pY=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function H0(e,{baseId:t,schema:r,root:n}){var s;if(((s=e.fragment)===null||s===void 0?void 0:s[0])!=="/")return;for(let c of e.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let l=r[(0,KM.unescapeFragment)(c)];if(l===void 0)return;r=l;let u=typeof r=="object"&&r[this.opts.schemaId];!pY.has(c)&&u&&(t=(0,gs.resolveUrl)(this.opts.uriResolver,t,u))}let a;if(typeof r!="boolean"&&r.$ref&&!(0,KM.schemaHasRulesButRef)(r,this.RULES)){let c=(0,gs.resolveUrl)(this.opts.uriResolver,t,r.$ref);a=cy.call(this,n,c)}let{schemaId:o}=this.opts;if(a=a||new Ql({schema:r,schemaId:o,root:n,baseId:t}),a.schema!==a.root.schema)return a}});var ZM=G((KHe,fY)=>{fY.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 X0=G((GHe,XM)=>{"use strict";var hY=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),JM=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function Y0(e){let t="",r=0,n=0;for(n=0;n<e.length;n++)if(r=e[n].charCodeAt(0),r!==48){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[n];break}for(n+=1;n<e.length;n++){if(r=e[n].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[n]}return t}var mY=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function HM(e){return e.length=0,!0}function gY(e,t,r){if(e.length){let n=Y0(e);if(n!=="")t.push(n);else return r.error=!0,!1;e.length=0}return!0}function yY(e){let t=0,r={error:!1,address:"",zone:""},n=[],s=[],a=!1,o=!1,c=gY;for(let l=0;l<e.length;l++){let u=e[l];if(!(u==="["||u==="]"))if(u===":"){if(a===!0&&(o=!0),!c(s,n,r))break;if(++t>7){r.error=!0;break}l>0&&e[l-1]===":"&&(a=!0),n.push(":");continue}else if(u==="%"){if(!c(s,n,r))break;c=HM}else{s.push(u);continue}}return s.length&&(c===HM?r.zone=s.join(""):o?n.push(s.join("")):n.push(Y0(s))),r.address=n.join(""),r}function YM(e){if(_Y(e,":")<2)return{host:e,isIPV6:!1};let t=yY(e);if(t.error)return{host:e,isIPV6:!1};{let r=t.address,n=t.address;return t.zone&&(r+="%"+t.zone,n+="%25"+t.zone),{host:r,isIPV6:!0,escapedHost:n}}}function _Y(e,t){let r=0;for(let n=0;n<e.length;n++)e[n]===t&&r++;return r}function bY(e){let t=e,r=[],n=-1,s=0;for(;s=t.length;){if(s===1){if(t===".")break;if(t==="/"){r.push("/");break}else{r.push(t);break}}else if(s===2){if(t[0]==="."){if(t[1]===".")break;if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"&&(t[1]==="."||t[1]==="/")){r.push("/");break}}else if(s===3&&t==="/.."){r.length!==0&&r.pop(),r.push("/");break}if(t[0]==="."){if(t[1]==="."){if(t[2]==="/"){t=t.slice(3);continue}}else if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"&&t[1]==="."){if(t[2]==="/"){t=t.slice(2);continue}else if(t[2]==="."&&t[3]==="/"){t=t.slice(3),r.length!==0&&r.pop();continue}}if((n=t.indexOf("/",1))===-1){r.push(t);break}else r.push(t.slice(0,n)),t=t.slice(n)}return r.join("")}function vY(e,t){let r=t!==!0?escape:unescape;return e.scheme!==void 0&&(e.scheme=r(e.scheme)),e.userinfo!==void 0&&(e.userinfo=r(e.userinfo)),e.host!==void 0&&(e.host=r(e.host)),e.path!==void 0&&(e.path=r(e.path)),e.query!==void 0&&(e.query=r(e.query)),e.fragment!==void 0&&(e.fragment=r(e.fragment)),e}function xY(e){let t=[];if(e.userinfo!==void 0&&(t.push(e.userinfo),t.push("@")),e.host!==void 0){let r=unescape(e.host);if(!JM(r)){let n=YM(r);n.isIPV6===!0?r=`[${n.escapedHost}]`:r=e.host}t.push(r)}return(typeof e.port=="number"||typeof e.port=="string")&&(t.push(":"),t.push(String(e.port))),t.length?t.join(""):void 0}XM.exports={nonSimpleDomain:mY,recomposeAuthority:xY,normalizeComponentEncoding:vY,removeDotSegments:bY,isIPv4:JM,isUUID:hY,normalizeIPv6:YM,stringArrayToHexStripped:Y0}});var nL=G((ZHe,rL)=>{"use strict";var{isUUID:SY}=X0(),TY=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,wY=["http","https","ws","wss","urn","urn:uuid"];function EY(e){return wY.indexOf(e)!==-1}function Q0(e){return e.secure===!0?!0:e.secure===!1?!1:e.scheme?e.scheme.length===3&&(e.scheme[0]==="w"||e.scheme[0]==="W")&&(e.scheme[1]==="s"||e.scheme[1]==="S")&&(e.scheme[2]==="s"||e.scheme[2]==="S"):!1}function QM(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function eL(e){let t=String(e.scheme).toLowerCase()==="https";return(e.port===(t?443:80)||e.port==="")&&(e.port=void 0),e.path||(e.path="/"),e}function PY(e){return e.secure=Q0(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function IY(e){if((e.port===(Q0(e)?443:80)||e.port==="")&&(e.port=void 0),typeof e.secure=="boolean"&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){let[t,r]=e.resourceName.split("?");e.path=t&&t!=="/"?t:void 0,e.query=r,e.resourceName=void 0}return e.fragment=void 0,e}function AY(e,t){if(!e.path)return e.error="URN can not be parsed",e;let r=e.path.match(TY);if(r){let n=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase(),e.nss=r[2];let s=`${n}:${t.nid||e.nid}`,a=eE(s);e.path=void 0,a&&(e=a.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e}function kY(e,t){if(e.nid===void 0)throw new Error("URN without nid cannot be serialized");let r=t.scheme||e.scheme||"urn",n=e.nid.toLowerCase(),s=`${r}:${t.nid||n}`,a=eE(s);a&&(e=a.serialize(e,t));let o=e,c=e.nss;return o.path=`${n||t.nid}:${c}`,t.skipEscape=!0,o}function CY(e,t){let r=e;return r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!SY(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function NY(e){let t=e;return t.nss=(e.uuid||"").toLowerCase(),t}var tL={scheme:"http",domainHost:!0,parse:QM,serialize:eL},OY={scheme:"https",domainHost:tL.domainHost,parse:QM,serialize:eL},uy={scheme:"ws",domainHost:!0,parse:PY,serialize:IY},$Y={scheme:"wss",domainHost:uy.domainHost,parse:uy.parse,serialize:uy.serialize},RY={scheme:"urn",parse:AY,serialize:kY,skipNormalize:!0},DY={scheme:"urn:uuid",parse:CY,serialize:NY,skipNormalize:!0},dy={http:tL,https:OY,ws:uy,wss:$Y,urn:RY,"urn:uuid":DY};Object.setPrototypeOf(dy,null);function eE(e){return e&&(dy[e]||dy[e.toLowerCase()])||void 0}rL.exports={wsIsSecure:Q0,SCHEMES:dy,isValidSchemeName:EY,getSchemeHandler:eE}});var aL=G((HHe,fy)=>{"use strict";var{normalizeIPv6:MY,removeDotSegments:Xp,recomposeAuthority:LY,normalizeComponentEncoding:py,isIPv4:FY,nonSimpleDomain:jY}=X0(),{SCHEMES:BY,getSchemeHandler:iL}=nL();function zY(e,t){return typeof e=="string"?e=Ms(ba(e,t),t):typeof e=="object"&&(e=ba(Ms(e,t),t)),e}function UY(e,t,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},s=sL(ba(e,n),ba(t,n),n,!0);return n.skipEscape=!0,Ms(s,n)}function sL(e,t,r,n){let s={};return n||(e=ba(Ms(e,r),r),t=ba(Ms(t,r),r)),r=r||{},!r.tolerant&&t.scheme?(s.scheme=t.scheme,s.userinfo=t.userinfo,s.host=t.host,s.port=t.port,s.path=Xp(t.path||""),s.query=t.query):(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0?(s.userinfo=t.userinfo,s.host=t.host,s.port=t.port,s.path=Xp(t.path||""),s.query=t.query):(t.path?(t.path[0]==="/"?s.path=Xp(t.path):((e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path?s.path="/"+t.path:e.path?s.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:s.path=t.path,s.path=Xp(s.path)),s.query=t.query):(s.path=e.path,t.query!==void 0?s.query=t.query:s.query=e.query),s.userinfo=e.userinfo,s.host=e.host,s.port=e.port),s.scheme=e.scheme),s.fragment=t.fragment,s}function qY(e,t,r){return typeof e=="string"?(e=unescape(e),e=Ms(py(ba(e,r),!0),{...r,skipEscape:!0})):typeof e=="object"&&(e=Ms(py(e,!0),{...r,skipEscape:!0})),typeof t=="string"?(t=unescape(t),t=Ms(py(ba(t,r),!0),{...r,skipEscape:!0})):typeof t=="object"&&(t=Ms(py(t,!0),{...r,skipEscape:!0})),e.toLowerCase()===t.toLowerCase()}function Ms(e,t){let r={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},n=Object.assign({},t),s=[],a=iL(n.scheme||r.scheme);a&&a.serialize&&a.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=unescape(r.path):(r.path=escape(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&s.push(r.scheme,":");let o=LY(r);if(o!==void 0&&(n.reference!=="suffix"&&s.push("//"),s.push(o),r.path&&r.path[0]!=="/"&&s.push("/")),r.path!==void 0){let c=r.path;!n.absolutePath&&(!a||!a.absolutePath)&&(c=Xp(c)),o===void 0&&c[0]==="/"&&c[1]==="/"&&(c="/%2F"+c.slice(2)),s.push(c)}return r.query!==void 0&&s.push("?",r.query),r.fragment!==void 0&&s.push("#",r.fragment),s.join("")}var WY=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function ba(e,t){let r=Object.assign({},t),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},s=!1;r.reference==="suffix"&&(r.scheme?e=r.scheme+":"+e:e="//"+e);let a=e.match(WY);if(a){if(n.scheme=a[1],n.userinfo=a[3],n.host=a[4],n.port=parseInt(a[5],10),n.path=a[6]||"",n.query=a[7],n.fragment=a[8],isNaN(n.port)&&(n.port=a[5]),n.host)if(FY(n.host)===!1){let l=MY(n.host);n.host=l.host.toLowerCase(),s=l.isIPV6}else s=!0;n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");let o=iL(r.scheme||n.scheme);if(!r.unicodeSupport&&(!o||!o.unicodeSupport)&&n.host&&(r.domainHost||o&&o.domainHost)&&s===!1&&jY(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(c){n.error=n.error||"Host's domain name can not be converted to ASCII: "+c}(!o||o&&!o.skipNormalize)&&(e.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=unescape(n.host))),n.path&&(n.path=escape(unescape(n.path))),n.fragment&&(n.fragment=encodeURI(decodeURIComponent(n.fragment)))),o&&o.parse&&o.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return n}var tE={SCHEMES:BY,normalize:zY,resolve:UY,resolveComponent:sL,equal:qY,serialize:Ms,parse:ba};fy.exports=tE;fy.exports.default=tE;fy.exports.fastUri=tE});var cL=G(rE=>{"use strict";Object.defineProperty(rE,"__esModule",{value:!0});var oL=aL();oL.code='require("ajv/dist/runtime/uri").default';rE.default=oL});var gL=G(Tn=>{"use strict";Object.defineProperty(Tn,"__esModule",{value:!0});Tn.CodeGen=Tn.Name=Tn.nil=Tn.stringify=Tn.str=Tn._=Tn.KeywordCxt=void 0;var VY=Jp();Object.defineProperty(Tn,"KeywordCxt",{enumerable:!0,get:function(){return VY.KeywordCxt}});var eu=Nt();Object.defineProperty(Tn,"_",{enumerable:!0,get:function(){return eu._}});Object.defineProperty(Tn,"str",{enumerable:!0,get:function(){return eu.str}});Object.defineProperty(Tn,"stringify",{enumerable:!0,get:function(){return eu.stringify}});Object.defineProperty(Tn,"nil",{enumerable:!0,get:function(){return eu.nil}});Object.defineProperty(Tn,"Name",{enumerable:!0,get:function(){return eu.Name}});Object.defineProperty(Tn,"CodeGen",{enumerable:!0,get:function(){return eu.CodeGen}});var KY=oy(),fL=Yp(),GY=N0(),Qp=ly(),ZY=Nt(),ef=Gp(),hy=Kp(),iE=Qt(),lL=ZM(),HY=cL(),hL=(e,t)=>new RegExp(e,t);hL.code="new RegExp";var JY=["removeAdditional","useDefaults","coerceTypes"],YY=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),XY={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."},QY={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},uL=200;function eX(e){var t,r,n,s,a,o,c,l,u,d,p,f,h,m,g,y,_,v,S,w,E,k,N,O,V;let te=e.strict,W=(t=e.code)===null||t===void 0?void 0:t.optimize,$=W===!0||W===void 0?1:W||0,H=(n=(r=e.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:hL,Y=(s=e.uriResolver)!==null&&s!==void 0?s:HY.default;return{strictSchema:(o=(a=e.strictSchema)!==null&&a!==void 0?a:te)!==null&&o!==void 0?o:!0,strictNumbers:(l=(c=e.strictNumbers)!==null&&c!==void 0?c:te)!==null&&l!==void 0?l:!0,strictTypes:(d=(u=e.strictTypes)!==null&&u!==void 0?u:te)!==null&&d!==void 0?d:"log",strictTuples:(f=(p=e.strictTuples)!==null&&p!==void 0?p:te)!==null&&f!==void 0?f:"log",strictRequired:(m=(h=e.strictRequired)!==null&&h!==void 0?h:te)!==null&&m!==void 0?m:!1,code:e.code?{...e.code,optimize:$,regExp:H}:{optimize:$,regExp:H},loopRequired:(g=e.loopRequired)!==null&&g!==void 0?g:uL,loopEnum:(y=e.loopEnum)!==null&&y!==void 0?y:uL,meta:(_=e.meta)!==null&&_!==void 0?_:!0,messages:(v=e.messages)!==null&&v!==void 0?v:!0,inlineRefs:(S=e.inlineRefs)!==null&&S!==void 0?S:!0,schemaId:(w=e.schemaId)!==null&&w!==void 0?w:"$id",addUsedSchema:(E=e.addUsedSchema)!==null&&E!==void 0?E:!0,validateSchema:(k=e.validateSchema)!==null&&k!==void 0?k:!0,validateFormats:(N=e.validateFormats)!==null&&N!==void 0?N:!0,unicodeRegExp:(O=e.unicodeRegExp)!==null&&O!==void 0?O:!0,int32range:(V=e.int32range)!==null&&V!==void 0?V:!0,uriResolver:Y}}var tf=class{constructor(t={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,t=this.opts={...t,...eX(t)};let{es5:r,lines:n}=this.opts.code;this.scope=new ZY.ValueScope({scope:{},prefixes:YY,es5:r,lines:n}),this.logger=aX(t.logger);let s=t.validateFormats;t.validateFormats=!1,this.RULES=(0,GY.getRules)(),dL.call(this,XY,t,"NOT SUPPORTED"),dL.call(this,QY,t,"DEPRECATED","warn"),this._metaOpts=iX.call(this),t.formats&&rX.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),t.keywords&&nX.call(this,t.keywords),typeof t.meta=="object"&&this.addMetaSchema(t.meta),tX.call(this),t.validateFormats=s}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:t,meta:r,schemaId:n}=this.opts,s=lL;n==="id"&&(s={...lL},s.id=s.$id,delete s.$id),r&&t&&this.addMetaSchema(s,s[n],!1)}defaultMeta(){let{meta:t,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof t=="object"?t[r]||t:void 0}validate(t,r){let n;if(typeof t=="string"){if(n=this.getSchema(t),!n)throw new Error(`no schema with key or ref "${t}"`)}else n=this.compile(t);let s=n(r);return"$async"in n||(this.errors=n.errors),s}compile(t,r){let n=this._addSchema(t,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(t,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return s.call(this,t,r);async function s(d,p){await a.call(this,d.$schema);let f=this._addSchema(d,p);return f.validate||o.call(this,f)}async function a(d){d&&!this.getSchema(d)&&await s.call(this,{$ref:d},!0)}async function o(d){try{return this._compileSchemaEnv(d)}catch(p){if(!(p instanceof fL.default))throw p;return c.call(this,p),await l.call(this,p.missingSchema),o.call(this,d)}}function c({missingSchema:d,missingRef:p}){if(this.refs[d])throw new Error(`AnySchema ${d} is loaded but ${p} cannot be resolved`)}async function l(d){let p=await u.call(this,d);this.refs[d]||await a.call(this,p.$schema),this.refs[d]||this.addSchema(p,d,r)}async function u(d){let p=this._loading[d];if(p)return p;try{return await(this._loading[d]=n(d))}finally{delete this._loading[d]}}}addSchema(t,r,n,s=this.opts.validateSchema){if(Array.isArray(t)){for(let o of t)this.addSchema(o,void 0,n,s);return this}let a;if(typeof t=="object"){let{schemaId:o}=this.opts;if(a=t[o],a!==void 0&&typeof a!="string")throw new Error(`schema ${o} must be string`)}return r=(0,ef.normalizeId)(r||a),this._checkUnique(r),this.schemas[r]=this._addSchema(t,n,r,s,!0),this}addMetaSchema(t,r,n=this.opts.validateSchema){return this.addSchema(t,r,!0,n),this}validateSchema(t,r){if(typeof t=="boolean")return!0;let n;if(n=t.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let s=this.validate(n,t);if(!s&&r){let a="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(a);else throw new Error(a)}return s}getSchema(t){let r;for(;typeof(r=pL.call(this,t))=="string";)t=r;if(r===void 0){let{schemaId:n}=this.opts,s=new Qp.SchemaEnv({schema:{},schemaId:n});if(r=Qp.resolveSchema.call(this,s,t),!r)return;this.refs[t]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(t){if(t instanceof RegExp)return this._removeAllSchemas(this.schemas,t),this._removeAllSchemas(this.refs,t),this;switch(typeof t){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=pL.call(this,t);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[t],delete this.refs[t],this}case"object":{let r=t;this._cache.delete(r);let n=t[this.opts.schemaId];return n&&(n=(0,ef.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(t){for(let r of t)this.addKeyword(r);return this}addKeyword(t,r){let n;if(typeof t=="string")n=t,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof t=="object"&&r===void 0){if(r=t,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(cX.call(this,n,r),!r)return(0,iE.eachItem)(n,a=>nE.call(this,a)),this;uX.call(this,r);let s={...r,type:(0,hy.getJSONTypes)(r.type),schemaType:(0,hy.getJSONTypes)(r.schemaType)};return(0,iE.eachItem)(n,s.type.length===0?a=>nE.call(this,a,s):a=>s.type.forEach(o=>nE.call(this,a,s,o))),this}getKeyword(t){let r=this.RULES.all[t];return typeof r=="object"?r.definition:!!r}removeKeyword(t){let{RULES:r}=this;delete r.keywords[t],delete r.all[t];for(let n of r.rules){let s=n.rules.findIndex(a=>a.keyword===t);s>=0&&n.rules.splice(s,1)}return this}addFormat(t,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[t]=r,this}errorsText(t=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!t||t.length===0?"No errors":t.map(s=>`${n}${s.instancePath} ${s.message}`).reduce((s,a)=>s+r+a)}$dataMetaSchema(t,r){let n=this.RULES.all;t=JSON.parse(JSON.stringify(t));for(let s of r){let a=s.split("/").slice(1),o=t;for(let c of a)o=o[c];for(let c in n){let l=n[c];if(typeof l!="object")continue;let{$data:u}=l.definition,d=o[c];u&&d&&(o[c]=mL(d))}}return t}_removeAllSchemas(t,r){for(let n in t){let s=t[n];(!r||r.test(n))&&(typeof s=="string"?delete t[n]:s&&!s.meta&&(this._cache.delete(s.schema),delete t[n]))}}_addSchema(t,r,n,s=this.opts.validateSchema,a=this.opts.addUsedSchema){let o,{schemaId:c}=this.opts;if(typeof t=="object")o=t[c];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof t!="boolean")throw new Error("schema must be object or boolean")}let l=this._cache.get(t);if(l!==void 0)return l;n=(0,ef.normalizeId)(o||n);let u=ef.getSchemaRefs.call(this,t,n);return l=new Qp.SchemaEnv({schema:t,schemaId:c,meta:r,baseId:n,localRefs:u}),this._cache.set(l.schema,l),a&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=l),s&&this.validateSchema(t,!0),l}_checkUnique(t){if(this.schemas[t]||this.refs[t])throw new Error(`schema with key or id "${t}" already exists`)}_compileSchemaEnv(t){if(t.meta?this._compileMetaSchema(t):Qp.compileSchema.call(this,t),!t.validate)throw new Error("ajv implementation error");return t.validate}_compileMetaSchema(t){let r=this.opts;this.opts=this._metaOpts;try{Qp.compileSchema.call(this,t)}finally{this.opts=r}}};tf.ValidationError=KY.default;tf.MissingRefError=fL.default;Tn.default=tf;function dL(e,t,r,n="error"){for(let s in e){let a=s;a in t&&this.logger[n](`${r}: option ${s}. ${e[a]}`)}}function pL(e){return e=(0,ef.normalizeId)(e),this.schemas[e]||this.refs[e]}function tX(){let e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(let t in e)this.addSchema(e[t],t)}function rX(){for(let e in this.opts.formats){let t=this.opts.formats[e];t&&this.addFormat(e,t)}}function nX(e){if(Array.isArray(e)){this.addVocabulary(e);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let t in e){let r=e[t];r.keyword||(r.keyword=t),this.addKeyword(r)}}function iX(){let e={...this.opts};for(let t of JY)delete e[t];return e}var sX={log(){},warn(){},error(){}};function aX(e){if(e===!1)return sX;if(e===void 0)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")}var oX=/^[a-z_$][a-z0-9_$:-]*$/i;function cX(e,t){let{RULES:r}=this;if((0,iE.eachItem)(e,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!oX.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!t&&t.$data&&!("code"in t||"validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}function nE(e,t,r){var n;let s=t?.post;if(r&&s)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:a}=this,o=s?a.post:a.rules.find(({type:l})=>l===r);if(o||(o={type:r,rules:[]},a.rules.push(o)),a.keywords[e]=!0,!t)return;let c={keyword:e,definition:{...t,type:(0,hy.getJSONTypes)(t.type),schemaType:(0,hy.getJSONTypes)(t.schemaType)}};t.before?lX.call(this,o,c,t.before):o.rules.push(c),a.all[e]=c,(n=t.implements)===null||n===void 0||n.forEach(l=>this.addKeyword(l))}function lX(e,t,r){let n=e.rules.findIndex(s=>s.keyword===r);n>=0?e.rules.splice(n,0,t):(e.rules.push(t),this.logger.warn(`rule ${r} is not defined`))}function uX(e){let{metaSchema:t}=e;t!==void 0&&(e.$data&&this.opts.$data&&(t=mL(t)),e.validateSchema=this.compile(t,!0))}var dX={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function mL(e){return{anyOf:[e,dX]}}});var yL=G(sE=>{"use strict";Object.defineProperty(sE,"__esModule",{value:!0});var pX={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};sE.default=pX});var xL=G(mc=>{"use strict";Object.defineProperty(mc,"__esModule",{value:!0});mc.callRef=mc.getValidate=void 0;var fX=Yp(),_L=Bi(),li=Nt(),tu=ya(),bL=ly(),my=Qt(),hX={keyword:"$ref",schemaType:"string",code(e){let{gen:t,schema:r,it:n}=e,{baseId:s,schemaEnv:a,validateName:o,opts:c,self:l}=n,{root:u}=a;if((r==="#"||r==="#/")&&s===u.baseId)return p();let d=bL.resolveRef.call(l,u,s,r);if(d===void 0)throw new fX.default(n.opts.uriResolver,s,r);if(d instanceof bL.SchemaEnv)return f(d);return h(d);function p(){if(a===u)return gy(e,o,a,a.$async);let m=t.scopeValue("root",{ref:u});return gy(e,(0,li._)`${m}.validate`,u,u.$async)}function f(m){let g=vL(e,m);gy(e,g,m,m.$async)}function h(m){let g=t.scopeValue("schema",c.code.source===!0?{ref:m,code:(0,li.stringify)(m)}:{ref:m}),y=t.name("valid"),_=e.subschema({schema:m,dataTypes:[],schemaPath:li.nil,topSchemaRef:g,errSchemaPath:r},y);e.mergeEvaluated(_),e.ok(y)}}};function vL(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):(0,li._)`${r.scopeValue("wrapper",{ref:t})}.validate`}mc.getValidate=vL;function gy(e,t,r,n){let{gen:s,it:a}=e,{allErrors:o,schemaEnv:c,opts:l}=a,u=l.passContext?tu.default.this:li.nil;n?d():p();function d(){if(!c.$async)throw new Error("async schema referenced by sync schema");let m=s.let("valid");s.try(()=>{s.code((0,li._)`await ${(0,_L.callValidateCode)(e,t,u)}`),h(t),o||s.assign(m,!0)},g=>{s.if((0,li._)`!(${g} instanceof ${a.ValidationError})`,()=>s.throw(g)),f(g),o||s.assign(m,!1)}),e.ok(m)}function p(){e.result((0,_L.callValidateCode)(e,t,u),()=>h(t),()=>f(t))}function f(m){let g=(0,li._)`${m}.errors`;s.assign(tu.default.vErrors,(0,li._)`${tu.default.vErrors} === null ? ${g} : ${tu.default.vErrors}.concat(${g})`),s.assign(tu.default.errors,(0,li._)`${tu.default.vErrors}.length`)}function h(m){var g;if(!a.opts.unevaluated)return;let y=(g=r?.validate)===null||g===void 0?void 0:g.evaluated;if(a.props!==!0)if(y&&!y.dynamicProps)y.props!==void 0&&(a.props=my.mergeEvaluated.props(s,y.props,a.props));else{let _=s.var("props",(0,li._)`${m}.evaluated.props`);a.props=my.mergeEvaluated.props(s,_,a.props,li.Name)}if(a.items!==!0)if(y&&!y.dynamicItems)y.items!==void 0&&(a.items=my.mergeEvaluated.items(s,y.items,a.items));else{let _=s.var("items",(0,li._)`${m}.evaluated.items`);a.items=my.mergeEvaluated.items(s,_,a.items,li.Name)}}}mc.callRef=gy;mc.default=hX});var SL=G(aE=>{"use strict";Object.defineProperty(aE,"__esModule",{value:!0});var mX=yL(),gX=xL(),yX=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",mX.default,gX.default];aE.default=yX});var TL=G(oE=>{"use strict";Object.defineProperty(oE,"__esModule",{value:!0});var yy=Nt(),fo=yy.operators,_y={maximum:{okStr:"<=",ok:fo.LTE,fail:fo.GT},minimum:{okStr:">=",ok:fo.GTE,fail:fo.LT},exclusiveMaximum:{okStr:"<",ok:fo.LT,fail:fo.GTE},exclusiveMinimum:{okStr:">",ok:fo.GT,fail:fo.LTE}},_X={message:({keyword:e,schemaCode:t})=>(0,yy.str)`must be ${_y[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,yy._)`{comparison: ${_y[e].okStr}, limit: ${t}}`},bX={keyword:Object.keys(_y),type:"number",schemaType:"number",$data:!0,error:_X,code(e){let{keyword:t,data:r,schemaCode:n}=e;e.fail$data((0,yy._)`${r} ${_y[t].fail} ${n} || isNaN(${r})`)}};oE.default=bX});var wL=G(cE=>{"use strict";Object.defineProperty(cE,"__esModule",{value:!0});var rf=Nt(),vX={message:({schemaCode:e})=>(0,rf.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,rf._)`{multipleOf: ${e}}`},xX={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:vX,code(e){let{gen:t,data:r,schemaCode:n,it:s}=e,a=s.opts.multipleOfPrecision,o=t.let("res"),c=a?(0,rf._)`Math.abs(Math.round(${o}) - ${o}) > 1e-${a}`:(0,rf._)`${o} !== parseInt(${o})`;e.fail$data((0,rf._)`(${n} === 0 || (${o} = ${r}/${n}, ${c}))`)}};cE.default=xX});var PL=G(lE=>{"use strict";Object.defineProperty(lE,"__esModule",{value:!0});function EL(e){let t=e.length,r=0,n=0,s;for(;n<t;)r++,s=e.charCodeAt(n++),s>=55296&&s<=56319&&n<t&&(s=e.charCodeAt(n),(s&64512)===56320&&n++);return r}lE.default=EL;EL.code='require("ajv/dist/runtime/ucs2length").default'});var IL=G(uE=>{"use strict";Object.defineProperty(uE,"__esModule",{value:!0});var gc=Nt(),SX=Qt(),TX=PL(),wX={message({keyword:e,schemaCode:t}){let r=e==="maxLength"?"more":"fewer";return(0,gc.str)`must NOT have ${r} than ${t} characters`},params:({schemaCode:e})=>(0,gc._)`{limit: ${e}}`},EX={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:wX,code(e){let{keyword:t,data:r,schemaCode:n,it:s}=e,a=t==="maxLength"?gc.operators.GT:gc.operators.LT,o=s.opts.unicode===!1?(0,gc._)`${r}.length`:(0,gc._)`${(0,SX.useFunc)(e.gen,TX.default)}(${r})`;e.fail$data((0,gc._)`${o} ${a} ${n}`)}};uE.default=EX});var AL=G(dE=>{"use strict";Object.defineProperty(dE,"__esModule",{value:!0});var PX=Bi(),IX=Qt(),ru=Nt(),AX={message:({schemaCode:e})=>(0,ru.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,ru._)`{pattern: ${e}}`},kX={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:AX,code(e){let{gen:t,data:r,$data:n,schema:s,schemaCode:a,it:o}=e,c=o.opts.unicodeRegExp?"u":"";if(n){let{regExp:l}=o.opts.code,u=l.code==="new RegExp"?(0,ru._)`new RegExp`:(0,IX.useFunc)(t,l),d=t.let("valid");t.try(()=>t.assign(d,(0,ru._)`${u}(${a}, ${c}).test(${r})`),()=>t.assign(d,!1)),e.fail$data((0,ru._)`!${d}`)}else{let l=(0,PX.usePattern)(e,s);e.fail$data((0,ru._)`!${l}.test(${r})`)}}};dE.default=kX});var kL=G(pE=>{"use strict";Object.defineProperty(pE,"__esModule",{value:!0});var nf=Nt(),CX={message({keyword:e,schemaCode:t}){let r=e==="maxProperties"?"more":"fewer";return(0,nf.str)`must NOT have ${r} than ${t} properties`},params:({schemaCode:e})=>(0,nf._)`{limit: ${e}}`},NX={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:CX,code(e){let{keyword:t,data:r,schemaCode:n}=e,s=t==="maxProperties"?nf.operators.GT:nf.operators.LT;e.fail$data((0,nf._)`Object.keys(${r}).length ${s} ${n}`)}};pE.default=NX});var CL=G(fE=>{"use strict";Object.defineProperty(fE,"__esModule",{value:!0});var sf=Bi(),af=Nt(),OX=Qt(),$X={message:({params:{missingProperty:e}})=>(0,af.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,af._)`{missingProperty: ${e}}`},RX={keyword:"required",type:"object",schemaType:"array",$data:!0,error:$X,code(e){let{gen:t,schema:r,schemaCode:n,data:s,$data:a,it:o}=e,{opts:c}=o;if(!a&&r.length===0)return;let l=r.length>=c.loopRequired;if(o.allErrors?u():d(),c.strictRequired){let h=e.parentSchema.properties,{definedProperties:m}=e.it;for(let g of r)if(h?.[g]===void 0&&!m.has(g)){let y=o.schemaEnv.baseId+o.errSchemaPath,_=`required property "${g}" is not defined at "${y}" (strictRequired)`;(0,OX.checkStrictMode)(o,_,o.opts.strictRequired)}}function u(){if(l||a)e.block$data(af.nil,p);else for(let h of r)(0,sf.checkReportMissingProp)(e,h)}function d(){let h=t.let("missing");if(l||a){let m=t.let("valid",!0);e.block$data(m,()=>f(h,m)),e.ok(m)}else t.if((0,sf.checkMissingProp)(e,r,h)),(0,sf.reportMissingProp)(e,h),t.else()}function p(){t.forOf("prop",n,h=>{e.setParams({missingProperty:h}),t.if((0,sf.noPropertyInData)(t,s,h,c.ownProperties),()=>e.error())})}function f(h,m){e.setParams({missingProperty:h}),t.forOf(h,n,()=>{t.assign(m,(0,sf.propertyInData)(t,s,h,c.ownProperties)),t.if((0,af.not)(m),()=>{e.error(),t.break()})},af.nil)}}};fE.default=RX});var NL=G(hE=>{"use strict";Object.defineProperty(hE,"__esModule",{value:!0});var of=Nt(),DX={message({keyword:e,schemaCode:t}){let r=e==="maxItems"?"more":"fewer";return(0,of.str)`must NOT have ${r} than ${t} items`},params:({schemaCode:e})=>(0,of._)`{limit: ${e}}`},MX={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:DX,code(e){let{keyword:t,data:r,schemaCode:n}=e,s=t==="maxItems"?of.operators.GT:of.operators.LT;e.fail$data((0,of._)`${r}.length ${s} ${n}`)}};hE.default=MX});var by=G(mE=>{"use strict";Object.defineProperty(mE,"__esModule",{value:!0});var OL=j0();OL.code='require("ajv/dist/runtime/equal").default';mE.default=OL});var $L=G(yE=>{"use strict";Object.defineProperty(yE,"__esModule",{value:!0});var gE=Kp(),wn=Nt(),LX=Qt(),FX=by(),jX={message:({params:{i:e,j:t}})=>(0,wn.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,wn._)`{i: ${e}, j: ${t}}`},BX={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:jX,code(e){let{gen:t,data:r,$data:n,schema:s,parentSchema:a,schemaCode:o,it:c}=e;if(!n&&!s)return;let l=t.let("valid"),u=a.items?(0,gE.getSchemaTypes)(a.items):[];e.block$data(l,d,(0,wn._)`${o} === false`),e.ok(l);function d(){let m=t.let("i",(0,wn._)`${r}.length`),g=t.let("j");e.setParams({i:m,j:g}),t.assign(l,!0),t.if((0,wn._)`${m} > 1`,()=>(p()?f:h)(m,g))}function p(){return u.length>0&&!u.some(m=>m==="object"||m==="array")}function f(m,g){let y=t.name("item"),_=(0,gE.checkDataTypes)(u,y,c.opts.strictNumbers,gE.DataType.Wrong),v=t.const("indices",(0,wn._)`{}`);t.for((0,wn._)`;${m}--;`,()=>{t.let(y,(0,wn._)`${r}[${m}]`),t.if(_,(0,wn._)`continue`),u.length>1&&t.if((0,wn._)`typeof ${y} == "string"`,(0,wn._)`${y} += "_"`),t.if((0,wn._)`typeof ${v}[${y}] == "number"`,()=>{t.assign(g,(0,wn._)`${v}[${y}]`),e.error(),t.assign(l,!1).break()}).code((0,wn._)`${v}[${y}] = ${m}`)})}function h(m,g){let y=(0,LX.useFunc)(t,FX.default),_=t.name("outer");t.label(_).for((0,wn._)`;${m}--;`,()=>t.for((0,wn._)`${g} = ${m}; ${g}--;`,()=>t.if((0,wn._)`${y}(${r}[${m}], ${r}[${g}])`,()=>{e.error(),t.assign(l,!1).break(_)})))}}};yE.default=BX});var RL=G(bE=>{"use strict";Object.defineProperty(bE,"__esModule",{value:!0});var _E=Nt(),zX=Qt(),UX=by(),qX={message:"must be equal to constant",params:({schemaCode:e})=>(0,_E._)`{allowedValue: ${e}}`},WX={keyword:"const",$data:!0,error:qX,code(e){let{gen:t,data:r,$data:n,schemaCode:s,schema:a}=e;n||a&&typeof a=="object"?e.fail$data((0,_E._)`!${(0,zX.useFunc)(t,UX.default)}(${r}, ${s})`):e.fail((0,_E._)`${a} !== ${r}`)}};bE.default=WX});var DL=G(vE=>{"use strict";Object.defineProperty(vE,"__esModule",{value:!0});var cf=Nt(),VX=Qt(),KX=by(),GX={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,cf._)`{allowedValues: ${e}}`},ZX={keyword:"enum",schemaType:"array",$data:!0,error:GX,code(e){let{gen:t,data:r,$data:n,schema:s,schemaCode:a,it:o}=e;if(!n&&s.length===0)throw new Error("enum must have non-empty array");let c=s.length>=o.opts.loopEnum,l,u=()=>l??(l=(0,VX.useFunc)(t,KX.default)),d;if(c||n)d=t.let("valid"),e.block$data(d,p);else{if(!Array.isArray(s))throw new Error("ajv implementation error");let h=t.const("vSchema",a);d=(0,cf.or)(...s.map((m,g)=>f(h,g)))}e.pass(d);function p(){t.assign(d,!1),t.forOf("v",a,h=>t.if((0,cf._)`${u()}(${r}, ${h})`,()=>t.assign(d,!0).break()))}function f(h,m){let g=s[m];return typeof g=="object"&&g!==null?(0,cf._)`${u()}(${r}, ${h}[${m}])`:(0,cf._)`${r} === ${g}`}}};vE.default=ZX});var ML=G(xE=>{"use strict";Object.defineProperty(xE,"__esModule",{value:!0});var HX=TL(),JX=wL(),YX=IL(),XX=AL(),QX=kL(),eQ=CL(),tQ=NL(),rQ=$L(),nQ=RL(),iQ=DL(),sQ=[HX.default,JX.default,YX.default,XX.default,QX.default,eQ.default,tQ.default,rQ.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},nQ.default,iQ.default];xE.default=sQ});var TE=G(lf=>{"use strict";Object.defineProperty(lf,"__esModule",{value:!0});lf.validateAdditionalItems=void 0;var yc=Nt(),SE=Qt(),aQ={message:({params:{len:e}})=>(0,yc.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,yc._)`{limit: ${e}}`},oQ={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:aQ,code(e){let{parentSchema:t,it:r}=e,{items:n}=t;if(!Array.isArray(n)){(0,SE.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}LL(e,n)}};function LL(e,t){let{gen:r,schema:n,data:s,keyword:a,it:o}=e;o.items=!0;let c=r.const("len",(0,yc._)`${s}.length`);if(n===!1)e.setParams({len:t.length}),e.pass((0,yc._)`${c} <= ${t.length}`);else if(typeof n=="object"&&!(0,SE.alwaysValidSchema)(o,n)){let u=r.var("valid",(0,yc._)`${c} <= ${t.length}`);r.if((0,yc.not)(u),()=>l(u)),e.ok(u)}function l(u){r.forRange("i",t.length,c,d=>{e.subschema({keyword:a,dataProp:d,dataPropType:SE.Type.Num},u),o.allErrors||r.if((0,yc.not)(u),()=>r.break())})}}lf.validateAdditionalItems=LL;lf.default=oQ});var wE=G(uf=>{"use strict";Object.defineProperty(uf,"__esModule",{value:!0});uf.validateTuple=void 0;var FL=Nt(),vy=Qt(),cQ=Bi(),lQ={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:r}=e;if(Array.isArray(t))return jL(e,"additionalItems",t);r.items=!0,!(0,vy.alwaysValidSchema)(r,t)&&e.ok((0,cQ.validateArray)(e))}};function jL(e,t,r=e.schema){let{gen:n,parentSchema:s,data:a,keyword:o,it:c}=e;d(s),c.opts.unevaluated&&r.length&&c.items!==!0&&(c.items=vy.mergeEvaluated.items(n,r.length,c.items));let l=n.name("valid"),u=n.const("len",(0,FL._)`${a}.length`);r.forEach((p,f)=>{(0,vy.alwaysValidSchema)(c,p)||(n.if((0,FL._)`${u} > ${f}`,()=>e.subschema({keyword:o,schemaProp:f,dataProp:f},l)),e.ok(l))});function d(p){let{opts:f,errSchemaPath:h}=c,m=r.length,g=m===p.minItems&&(m===p.maxItems||p[t]===!1);if(f.strictTuples&&!g){let y=`"${o}" is ${m}-tuple, but minItems or maxItems/${t} are not specified or different at path "${h}"`;(0,vy.checkStrictMode)(c,y,f.strictTuples)}}}uf.validateTuple=jL;uf.default=lQ});var BL=G(EE=>{"use strict";Object.defineProperty(EE,"__esModule",{value:!0});var uQ=wE(),dQ={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,uQ.validateTuple)(e,"items")};EE.default=dQ});var UL=G(PE=>{"use strict";Object.defineProperty(PE,"__esModule",{value:!0});var zL=Nt(),pQ=Qt(),fQ=Bi(),hQ=TE(),mQ={message:({params:{len:e}})=>(0,zL.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,zL._)`{limit: ${e}}`},gQ={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:mQ,code(e){let{schema:t,parentSchema:r,it:n}=e,{prefixItems:s}=r;n.items=!0,!(0,pQ.alwaysValidSchema)(n,t)&&(s?(0,hQ.validateAdditionalItems)(e,s):e.ok((0,fQ.validateArray)(e)))}};PE.default=gQ});var qL=G(IE=>{"use strict";Object.defineProperty(IE,"__esModule",{value:!0});var Ui=Nt(),xy=Qt(),yQ={message:({params:{min:e,max:t}})=>t===void 0?(0,Ui.str)`must contain at least ${e} valid item(s)`:(0,Ui.str)`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?(0,Ui._)`{minContains: ${e}}`:(0,Ui._)`{minContains: ${e}, maxContains: ${t}}`},_Q={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:yQ,code(e){let{gen:t,schema:r,parentSchema:n,data:s,it:a}=e,o,c,{minContains:l,maxContains:u}=n;a.opts.next?(o=l===void 0?1:l,c=u):o=1;let d=t.const("len",(0,Ui._)`${s}.length`);if(e.setParams({min:o,max:c}),c===void 0&&o===0){(0,xy.checkStrictMode)(a,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(c!==void 0&&o>c){(0,xy.checkStrictMode)(a,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,xy.alwaysValidSchema)(a,r)){let g=(0,Ui._)`${d} >= ${o}`;c!==void 0&&(g=(0,Ui._)`${g} && ${d} <= ${c}`),e.pass(g);return}a.items=!0;let p=t.name("valid");c===void 0&&o===1?h(p,()=>t.if(p,()=>t.break())):o===0?(t.let(p,!0),c!==void 0&&t.if((0,Ui._)`${s}.length > 0`,f)):(t.let(p,!1),f()),e.result(p,()=>e.reset());function f(){let g=t.name("_valid"),y=t.let("count",0);h(g,()=>t.if(g,()=>m(y)))}function h(g,y){t.forRange("i",0,d,_=>{e.subschema({keyword:"contains",dataProp:_,dataPropType:xy.Type.Num,compositeRule:!0},g),y()})}function m(g){t.code((0,Ui._)`${g}++`),c===void 0?t.if((0,Ui._)`${g} >= ${o}`,()=>t.assign(p,!0).break()):(t.if((0,Ui._)`${g} > ${c}`,()=>t.assign(p,!1).break()),o===1?t.assign(p,!0):t.if((0,Ui._)`${g} >= ${o}`,()=>t.assign(p,!0)))}}};IE.default=_Q});var KL=G(Ls=>{"use strict";Object.defineProperty(Ls,"__esModule",{value:!0});Ls.validateSchemaDeps=Ls.validatePropertyDeps=Ls.error=void 0;var AE=Nt(),bQ=Qt(),df=Bi();Ls.error={message:({params:{property:e,depsCount:t,deps:r}})=>{let n=t===1?"property":"properties";return(0,AE.str)`must have ${n} ${r} when property ${e} is present`},params:({params:{property:e,depsCount:t,deps:r,missingProperty:n}})=>(0,AE._)`{property: ${e},
|
|
7
7
|
missingProperty: ${n},
|
|
8
8
|
depsCount: ${t},
|
|
9
9
|
deps: ${r}}`};var vQ={keyword:"dependencies",type:"object",schemaType:"object",error:Ls.error,code(e){let[t,r]=xQ(e);WL(e,t),VL(e,r)}};function xQ({schema:e}){let t={},r={};for(let n in e){if(n==="__proto__")continue;let s=Array.isArray(e[n])?t:r;s[n]=e[n]}return[t,r]}function WL(e,t=e.schema){let{gen:r,data:n,it:s}=e;if(Object.keys(t).length===0)return;let a=r.let("missing");for(let o in t){let c=t[o];if(c.length===0)continue;let l=(0,df.propertyInData)(r,n,o,s.opts.ownProperties);e.setParams({property:o,depsCount:c.length,deps:c.join(", ")}),s.allErrors?r.if(l,()=>{for(let u of c)(0,df.checkReportMissingProp)(e,u)}):(r.if((0,AE._)`${l} && (${(0,df.checkMissingProp)(e,c,a)})`),(0,df.reportMissingProp)(e,a),r.else())}}Ls.validatePropertyDeps=WL;function VL(e,t=e.schema){let{gen:r,data:n,keyword:s,it:a}=e,o=r.name("valid");for(let c in t)(0,bQ.alwaysValidSchema)(a,t[c])||(r.if((0,df.propertyInData)(r,n,c,a.opts.ownProperties),()=>{let l=e.subschema({keyword:s,schemaProp:c},o);e.mergeValidEvaluated(l,o)},()=>r.var(o,!0)),e.ok(o))}Ls.validateSchemaDeps=VL;Ls.default=vQ});var ZL=G(kE=>{"use strict";Object.defineProperty(kE,"__esModule",{value:!0});var GL=Nt(),SQ=Qt(),TQ={message:"property name must be valid",params:({params:e})=>(0,GL._)`{propertyName: ${e.propertyName}}`},wQ={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:TQ,code(e){let{gen:t,schema:r,data:n,it:s}=e;if((0,SQ.alwaysValidSchema)(s,r))return;let a=t.name("valid");t.forIn("key",n,o=>{e.setParams({propertyName:o}),e.subschema({keyword:"propertyNames",data:o,dataTypes:["string"],propertyName:o,compositeRule:!0},a),t.if((0,GL.not)(a),()=>{e.error(!0),s.allErrors||t.break()})}),e.ok(a)}};kE.default=wQ});var NE=G(CE=>{"use strict";Object.defineProperty(CE,"__esModule",{value:!0});var Sy=Bi(),ys=Nt(),EQ=ya(),Ty=Qt(),PQ={message:"must NOT have additional properties",params:({params:e})=>(0,ys._)`{additionalProperty: ${e.additionalProperty}}`},IQ={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:PQ,code(e){let{gen:t,schema:r,parentSchema:n,data:s,errsCount:a,it:o}=e;if(!a)throw new Error("ajv implementation error");let{allErrors:c,opts:l}=o;if(o.props=!0,l.removeAdditional!=="all"&&(0,Ty.alwaysValidSchema)(o,r))return;let u=(0,Sy.allSchemaProperties)(n.properties),d=(0,Sy.allSchemaProperties)(n.patternProperties);p(),e.ok((0,ys._)`${a} === ${EQ.default.errors}`);function p(){t.forIn("key",s,y=>{!u.length&&!d.length?m(y):t.if(f(y),()=>m(y))})}function f(y){let _;if(u.length>8){let v=(0,Ty.schemaRefOrVal)(o,n.properties,"properties");_=(0,Sy.isOwnProperty)(t,v,y)}else u.length?_=(0,ys.or)(...u.map(v=>(0,ys._)`${y} === ${v}`)):_=ys.nil;return d.length&&(_=(0,ys.or)(_,...d.map(v=>(0,ys._)`${(0,Sy.usePattern)(e,v)}.test(${y})`))),(0,ys.not)(_)}function h(y){t.code((0,ys._)`delete ${s}[${y}]`)}function m(y){if(l.removeAdditional==="all"||l.removeAdditional&&r===!1){h(y);return}if(r===!1){e.setParams({additionalProperty:y}),e.error(),c||t.break();return}if(typeof r=="object"&&!(0,Ty.alwaysValidSchema)(o,r)){let _=t.name("valid");l.removeAdditional==="failing"?(g(y,_,!1),t.if((0,ys.not)(_),()=>{e.reset(),h(y)})):(g(y,_),c||t.if((0,ys.not)(_),()=>t.break()))}}function g(y,_,v){let S={keyword:"additionalProperties",dataProp:y,dataPropType:Ty.Type.Str};v===!1&&Object.assign(S,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(S,_)}}};CE.default=IQ});var YL=G($E=>{"use strict";Object.defineProperty($E,"__esModule",{value:!0});var AQ=Jp(),HL=Bi(),OE=Qt(),JL=NE(),kQ={keyword:"properties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,parentSchema:n,data:s,it:a}=e;a.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&JL.default.code(new AQ.KeywordCxt(a,JL.default,"additionalProperties"));let o=(0,HL.allSchemaProperties)(r);for(let p of o)a.definedProperties.add(p);a.opts.unevaluated&&o.length&&a.props!==!0&&(a.props=OE.mergeEvaluated.props(t,(0,OE.toHash)(o),a.props));let c=o.filter(p=>!(0,OE.alwaysValidSchema)(a,r[p]));if(c.length===0)return;let l=t.name("valid");for(let p of c)u(p)?d(p):(t.if((0,HL.propertyInData)(t,s,p,a.opts.ownProperties)),d(p),a.allErrors||t.else().var(l,!0),t.endIf()),e.it.definedProperties.add(p),e.ok(l);function u(p){return a.opts.useDefaults&&!a.compositeRule&&r[p].default!==void 0}function d(p){e.subschema({keyword:"properties",schemaProp:p,dataProp:p},l)}}};$E.default=kQ});var tF=G(RE=>{"use strict";Object.defineProperty(RE,"__esModule",{value:!0});var XL=Bi(),wy=Nt(),QL=Qt(),eF=Qt(),CQ={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,data:n,parentSchema:s,it:a}=e,{opts:o}=a,c=(0,XL.allSchemaProperties)(r),l=c.filter(g=>(0,QL.alwaysValidSchema)(a,r[g]));if(c.length===0||l.length===c.length&&(!a.opts.unevaluated||a.props===!0))return;let u=o.strictSchema&&!o.allowMatchingProperties&&s.properties,d=t.name("valid");a.props!==!0&&!(a.props instanceof wy.Name)&&(a.props=(0,eF.evaluatedPropsToName)(t,a.props));let{props:p}=a;f();function f(){for(let g of c)u&&h(g),a.allErrors?m(g):(t.var(d,!0),m(g),t.if(d))}function h(g){for(let y in u)new RegExp(g).test(y)&&(0,QL.checkStrictMode)(a,`property ${y} matches pattern ${g} (use allowMatchingProperties)`)}function m(g){t.forIn("key",n,y=>{t.if((0,wy._)`${(0,XL.usePattern)(e,g)}.test(${y})`,()=>{let _=l.includes(g);_||e.subschema({keyword:"patternProperties",schemaProp:g,dataProp:y,dataPropType:eF.Type.Str},d),a.opts.unevaluated&&p!==!0?t.assign((0,wy._)`${p}[${y}]`,!0):!_&&!a.allErrors&&t.if((0,wy.not)(d),()=>t.break())})})}}};RE.default=CQ});var rF=G(DE=>{"use strict";Object.defineProperty(DE,"__esModule",{value:!0});var NQ=Qt(),OQ={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:r,it:n}=e;if((0,NQ.alwaysValidSchema)(n,r)){e.fail();return}let s=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},s),e.failResult(s,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};DE.default=OQ});var nF=G(ME=>{"use strict";Object.defineProperty(ME,"__esModule",{value:!0});var $Q=Bi(),RQ={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:$Q.validateUnion,error:{message:"must match a schema in anyOf"}};ME.default=RQ});var iF=G(LE=>{"use strict";Object.defineProperty(LE,"__esModule",{value:!0});var Ey=Nt(),DQ=Qt(),MQ={message:"must match exactly one schema in oneOf",params:({params:e})=>(0,Ey._)`{passingSchemas: ${e.passing}}`},LQ={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:MQ,code(e){let{gen:t,schema:r,parentSchema:n,it:s}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(s.opts.discriminator&&n.discriminator)return;let a=r,o=t.let("valid",!1),c=t.let("passing",null),l=t.name("_valid");e.setParams({passing:c}),t.block(u),e.result(o,()=>e.reset(),()=>e.error(!0));function u(){a.forEach((d,p)=>{let f;(0,DQ.alwaysValidSchema)(s,d)?t.var(l,!0):f=e.subschema({keyword:"oneOf",schemaProp:p,compositeRule:!0},l),p>0&&t.if((0,Ey._)`${l} && ${o}`).assign(o,!1).assign(c,(0,Ey._)`[${c}, ${p}]`).else(),t.if(l,()=>{t.assign(o,!0),t.assign(c,p),f&&e.mergeEvaluated(f,Ey.Name)})})}}};LE.default=LQ});var sF=G(FE=>{"use strict";Object.defineProperty(FE,"__esModule",{value:!0});var FQ=Qt(),jQ={keyword:"allOf",schemaType:"array",code(e){let{gen:t,schema:r,it:n}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");let s=t.name("valid");r.forEach((a,o)=>{if((0,FQ.alwaysValidSchema)(n,a))return;let c=e.subschema({keyword:"allOf",schemaProp:o},s);e.ok(s),e.mergeEvaluated(c)})}};FE.default=jQ});var cF=G(jE=>{"use strict";Object.defineProperty(jE,"__esModule",{value:!0});var Py=Nt(),oF=Qt(),BQ={message:({params:e})=>(0,Py.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,Py._)`{failingKeyword: ${e.ifClause}}`},zQ={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:BQ,code(e){let{gen:t,parentSchema:r,it:n}=e;r.then===void 0&&r.else===void 0&&(0,oF.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let s=aF(n,"then"),a=aF(n,"else");if(!s&&!a)return;let o=t.let("valid",!0),c=t.name("_valid");if(l(),e.reset(),s&&a){let d=t.let("ifClause");e.setParams({ifClause:d}),t.if(c,u("then",d),u("else",d))}else s?t.if(c,u("then")):t.if((0,Py.not)(c),u("else"));e.pass(o,()=>e.error(!0));function l(){let d=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},c);e.mergeEvaluated(d)}function u(d,p){return()=>{let f=e.subschema({keyword:d},c);t.assign(o,c),e.mergeValidEvaluated(f,o),p?t.assign(p,(0,Py._)`${d}`):e.setParams({ifClause:d})}}}};function aF(e,t){let r=e.schema[t];return r!==void 0&&!(0,oF.alwaysValidSchema)(e,r)}jE.default=zQ});var lF=G(BE=>{"use strict";Object.defineProperty(BE,"__esModule",{value:!0});var UQ=Qt(),qQ={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){t.if===void 0&&(0,UQ.checkStrictMode)(r,`"${e}" without "if" is ignored`)}};BE.default=qQ});var uF=G(zE=>{"use strict";Object.defineProperty(zE,"__esModule",{value:!0});var WQ=TE(),VQ=BL(),KQ=wE(),GQ=UL(),ZQ=qL(),HQ=KL(),JQ=ZL(),YQ=NE(),XQ=YL(),QQ=tF(),eee=rF(),tee=nF(),ree=iF(),nee=sF(),iee=cF(),see=lF();function aee(e=!1){let t=[eee.default,tee.default,ree.default,nee.default,iee.default,see.default,JQ.default,YQ.default,HQ.default,XQ.default,QQ.default];return e?t.push(VQ.default,GQ.default):t.push(WQ.default,KQ.default),t.push(ZQ.default),t}zE.default=aee});var dF=G(UE=>{"use strict";Object.defineProperty(UE,"__esModule",{value:!0});var Jr=Nt(),oee={message:({schemaCode:e})=>(0,Jr.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,Jr._)`{format: ${e}}`},cee={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:oee,code(e,t){let{gen:r,data:n,$data:s,schema:a,schemaCode:o,it:c}=e,{opts:l,errSchemaPath:u,schemaEnv:d,self:p}=c;if(!l.validateFormats)return;s?f():h();function f(){let m=r.scopeValue("formats",{ref:p.formats,code:l.code.formats}),g=r.const("fDef",(0,Jr._)`${m}[${o}]`),y=r.let("fType"),_=r.let("format");r.if((0,Jr._)`typeof ${g} == "object" && !(${g} instanceof RegExp)`,()=>r.assign(y,(0,Jr._)`${g}.type || "string"`).assign(_,(0,Jr._)`${g}.validate`),()=>r.assign(y,(0,Jr._)`"string"`).assign(_,g)),e.fail$data((0,Jr.or)(v(),S()));function v(){return l.strictSchema===!1?Jr.nil:(0,Jr._)`${o} && !${_}`}function S(){let w=d.$async?(0,Jr._)`(${g}.async ? await ${_}(${n}) : ${_}(${n}))`:(0,Jr._)`${_}(${n})`,E=(0,Jr._)`(typeof ${_} == "function" ? ${w} : ${_}.test(${n}))`;return(0,Jr._)`${_} && ${_} !== true && ${y} === ${t} && !${E}`}}function h(){let m=p.formats[a];if(!m){v();return}if(m===!0)return;let[g,y,_]=S(m);g===t&&e.pass(w());function v(){if(l.strictSchema===!1){p.logger.warn(E());return}throw new Error(E());function E(){return`unknown format "${a}" ignored in schema at path "${u}"`}}function S(E){let k=E instanceof RegExp?(0,Jr.regexpCode)(E):l.code.formats?(0,Jr._)`${l.code.formats}${(0,Jr.getProperty)(a)}`:void 0,N=r.scopeValue("formats",{key:a,ref:E,code:k});return typeof E=="object"&&!(E instanceof RegExp)?[E.type||"string",E.validate,(0,Jr._)`${N}.validate`]:["string",E,N]}function w(){if(typeof m=="object"&&!(m instanceof RegExp)&&m.async){if(!d.$async)throw new Error("async format in sync schema");return(0,Jr._)`await ${_}(${n})`}return typeof y=="function"?(0,Jr._)`${_}(${n})`:(0,Jr._)`${_}.test(${n})`}}}};UE.default=cee});var pF=G(qE=>{"use strict";Object.defineProperty(qE,"__esModule",{value:!0});var lee=dF(),uee=[lee.default];qE.default=uee});var fF=G(nu=>{"use strict";Object.defineProperty(nu,"__esModule",{value:!0});nu.contentVocabulary=nu.metadataVocabulary=void 0;nu.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];nu.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var mF=G(WE=>{"use strict";Object.defineProperty(WE,"__esModule",{value:!0});var dee=SL(),pee=ML(),fee=uF(),hee=pF(),hF=fF(),mee=[dee.default,pee.default,(0,fee.default)(),hee.default,hF.metadataVocabulary,hF.contentVocabulary];WE.default=mee});var yF=G(Iy=>{"use strict";Object.defineProperty(Iy,"__esModule",{value:!0});Iy.DiscrError=void 0;var gF;(function(e){e.Tag="tag",e.Mapping="mapping"})(gF||(Iy.DiscrError=gF={}))});var bF=G(KE=>{"use strict";Object.defineProperty(KE,"__esModule",{value:!0});var iu=Nt(),VE=yF(),_F=ly(),gee=Yp(),yee=Qt(),_ee={message:({params:{discrError:e,tagName:t}})=>e===VE.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>(0,iu._)`{error: ${e}, tag: ${r}, tagValue: ${t}}`},bee={keyword:"discriminator",type:"object",schemaType:"object",error:_ee,code(e){let{gen:t,data:r,schema:n,parentSchema:s,it:a}=e,{oneOf:o}=s;if(!a.opts.discriminator)throw new Error("discriminator: requires discriminator option");let c=n.propertyName;if(typeof c!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!o)throw new Error("discriminator: requires oneOf keyword");let l=t.let("valid",!1),u=t.const("tag",(0,iu._)`${r}${(0,iu.getProperty)(c)}`);t.if((0,iu._)`typeof ${u} == "string"`,()=>d(),()=>e.error(!1,{discrError:VE.DiscrError.Tag,tag:u,tagName:c})),e.ok(l);function d(){let h=f();t.if(!1);for(let m in h)t.elseIf((0,iu._)`${u} === ${m}`),t.assign(l,p(h[m]));t.else(),e.error(!1,{discrError:VE.DiscrError.Mapping,tag:u,tagName:c}),t.endIf()}function p(h){let m=t.name("valid"),g=e.subschema({keyword:"oneOf",schemaProp:h},m);return e.mergeEvaluated(g,iu.Name),m}function f(){var h;let m={},g=_(s),y=!0;for(let w=0;w<o.length;w++){let E=o[w];if(E?.$ref&&!(0,yee.schemaHasRulesButRef)(E,a.self.RULES)){let N=E.$ref;if(E=_F.resolveRef.call(a.self,a.schemaEnv.root,a.baseId,N),E instanceof _F.SchemaEnv&&(E=E.schema),E===void 0)throw new gee.default(a.opts.uriResolver,a.baseId,N)}let k=(h=E?.properties)===null||h===void 0?void 0:h[c];if(typeof k!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${c}"`);y=y&&(g||_(E)),v(k,w)}if(!y)throw new Error(`discriminator: "${c}" must be required`);return m;function _({required:w}){return Array.isArray(w)&&w.includes(c)}function v(w,E){if(w.const)S(w.const,E);else if(w.enum)for(let k of w.enum)S(k,E);else throw new Error(`discriminator: "properties/${c}" must have "const" or "enum"`)}function S(w,E){if(typeof w!="string"||w in m)throw new Error(`discriminator: "${c}" values must be unique strings`);m[w]=E}}}};KE.default=bee});var vF=G((LJe,vee)=>{vee.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 ZE=G((Or,GE)=>{"use strict";Object.defineProperty(Or,"__esModule",{value:!0});Or.MissingRefError=Or.ValidationError=Or.CodeGen=Or.Name=Or.nil=Or.stringify=Or.str=Or._=Or.KeywordCxt=Or.Ajv=void 0;var xee=gL(),See=mF(),Tee=bF(),xF=vF(),wee=["/properties"],Ay="http://json-schema.org/draft-07/schema",su=class extends xee.default{_addVocabularies(){super._addVocabularies(),See.default.forEach(t=>this.addVocabulary(t)),this.opts.discriminator&&this.addKeyword(Tee.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let t=this.opts.$data?this.$dataMetaSchema(xF,wee):xF;this.addMetaSchema(t,Ay,!1),this.refs["http://json-schema.org/schema"]=Ay}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Ay)?Ay:void 0)}};Or.Ajv=su;GE.exports=Or=su;GE.exports.Ajv=su;Object.defineProperty(Or,"__esModule",{value:!0});Or.default=su;var Eee=Jp();Object.defineProperty(Or,"KeywordCxt",{enumerable:!0,get:function(){return Eee.KeywordCxt}});var au=Nt();Object.defineProperty(Or,"_",{enumerable:!0,get:function(){return au._}});Object.defineProperty(Or,"str",{enumerable:!0,get:function(){return au.str}});Object.defineProperty(Or,"stringify",{enumerable:!0,get:function(){return au.stringify}});Object.defineProperty(Or,"nil",{enumerable:!0,get:function(){return au.nil}});Object.defineProperty(Or,"Name",{enumerable:!0,get:function(){return au.Name}});Object.defineProperty(Or,"CodeGen",{enumerable:!0,get:function(){return au.CodeGen}});var Pee=oy();Object.defineProperty(Or,"ValidationError",{enumerable:!0,get:function(){return Pee.default}});var Iee=Yp();Object.defineProperty(Or,"MissingRefError",{enumerable:!0,get:function(){return Iee.default}})});var kF=G(js=>{"use strict";Object.defineProperty(js,"__esModule",{value:!0});js.formatNames=js.fastFormats=js.fullFormats=void 0;function Fs(e,t){return{validate:e,compare:t}}js.fullFormats={date:Fs(EF,XE),time:Fs(JE(!0),QE),"date-time":Fs(SF(!0),IF),"iso-time":Fs(JE(),PF),"iso-date-time":Fs(SF(),AF),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:$ee,"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:Bee,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:Ree,int32:{type:"number",validate:Lee},int64:{type:"number",validate:Fee},float:{type:"number",validate:wF},double:{type:"number",validate:wF},password:!0,binary:!0};js.fastFormats={...js.fullFormats,date:Fs(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,XE),time:Fs(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,QE),"date-time":Fs(/^\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,IF),"iso-time":Fs(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,PF),"iso-date-time":Fs(/^\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,AF),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};js.formatNames=Object.keys(js.fullFormats);function Aee(e){return e%4===0&&(e%100!==0||e%400===0)}var kee=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,Cee=[0,31,28,31,30,31,30,31,31,30,31,30,31];function EF(e){let t=kee.exec(e);if(!t)return!1;let r=+t[1],n=+t[2],s=+t[3];return n>=1&&n<=12&&s>=1&&s<=(n===2&&Aee(r)?29:Cee[n])}function XE(e,t){if(e&&t)return e>t?1:e<t?-1:0}var HE=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function JE(e){return function(r){let n=HE.exec(r);if(!n)return!1;let s=+n[1],a=+n[2],o=+n[3],c=n[4],l=n[5]==="-"?-1:1,u=+(n[6]||0),d=+(n[7]||0);if(u>23||d>59||e&&!c)return!1;if(s<=23&&a<=59&&o<60)return!0;let p=a-d*l,f=s-u*l-(p<0?1:0);return(f===23||f===-1)&&(p===59||p===-1)&&o<61}}function QE(e,t){if(!(e&&t))return;let r=new Date("2020-01-01T"+e).valueOf(),n=new Date("2020-01-01T"+t).valueOf();if(r&&n)return r-n}function PF(e,t){if(!(e&&t))return;let r=HE.exec(e),n=HE.exec(t);if(r&&n)return e=r[1]+r[2]+r[3],t=n[1]+n[2]+n[3],e>t?1:e<t?-1:0}var YE=/t|\s/i;function SF(e){let t=JE(e);return function(n){let s=n.split(YE);return s.length===2&&EF(s[0])&&t(s[1])}}function IF(e,t){if(!(e&&t))return;let r=new Date(e).valueOf(),n=new Date(t).valueOf();if(r&&n)return r-n}function AF(e,t){if(!(e&&t))return;let[r,n]=e.split(YE),[s,a]=t.split(YE),o=XE(r,s);if(o!==void 0)return o||QE(n,a)}var Nee=/\/|:/,Oee=/^(?:[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 $ee(e){return Nee.test(e)&&Oee.test(e)}var TF=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function Ree(e){return TF.lastIndex=0,TF.test(e)}var Dee=-(2**31),Mee=2**31-1;function Lee(e){return Number.isInteger(e)&&e<=Mee&&e>=Dee}function Fee(e){return Number.isInteger(e)}function wF(){return!0}var jee=/[^\\]\\Z/;function Bee(e){if(jee.test(e))return!1;try{return new RegExp(e),!0}catch{return!1}}});var CF=G(ou=>{"use strict";Object.defineProperty(ou,"__esModule",{value:!0});ou.formatLimitDefinition=void 0;var zee=ZE(),_s=Nt(),ho=_s.operators,ky={formatMaximum:{okStr:"<=",ok:ho.LTE,fail:ho.GT},formatMinimum:{okStr:">=",ok:ho.GTE,fail:ho.LT},formatExclusiveMaximum:{okStr:"<",ok:ho.LT,fail:ho.GTE},formatExclusiveMinimum:{okStr:">",ok:ho.GT,fail:ho.LTE}},Uee={message:({keyword:e,schemaCode:t})=>(0,_s.str)`should be ${ky[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,_s._)`{comparison: ${ky[e].okStr}, limit: ${t}}`};ou.formatLimitDefinition={keyword:Object.keys(ky),type:"string",schemaType:"string",$data:!0,error:Uee,code(e){let{gen:t,data:r,schemaCode:n,keyword:s,it:a}=e,{opts:o,self:c}=a;if(!o.validateFormats)return;let l=new zee.KeywordCxt(a,c.RULES.all.format.definition,"format");l.$data?u():d();function u(){let f=t.scopeValue("formats",{ref:c.formats,code:o.code.formats}),h=t.const("fmt",(0,_s._)`${f}[${l.schemaCode}]`);e.fail$data((0,_s.or)((0,_s._)`typeof ${h} != "object"`,(0,_s._)`${h} instanceof RegExp`,(0,_s._)`typeof ${h}.compare != "function"`,p(h)))}function d(){let f=l.schema,h=c.formats[f];if(!h||h===!0)return;if(typeof h!="object"||h instanceof RegExp||typeof h.compare!="function")throw new Error(`"${s}": format "${f}" does not define "compare" function`);let m=t.scopeValue("formats",{key:f,ref:h,code:o.code.formats?(0,_s._)`${o.code.formats}${(0,_s.getProperty)(f)}`:void 0});e.fail$data(p(m))}function p(f){return(0,_s._)`${f}.compare(${r}, ${n}) ${ky[s].fail} 0`}},dependencies:["format"]};var qee=e=>(e.addKeyword(ou.formatLimitDefinition),e);ou.default=qee});var RF=G((pf,$F)=>{"use strict";Object.defineProperty(pf,"__esModule",{value:!0});var cu=kF(),Wee=CF(),eP=Nt(),NF=new eP.Name("fullFormats"),Vee=new eP.Name("fastFormats"),tP=(e,t={keywords:!0})=>{if(Array.isArray(t))return OF(e,t,cu.fullFormats,NF),e;let[r,n]=t.mode==="fast"?[cu.fastFormats,Vee]:[cu.fullFormats,NF],s=t.formats||cu.formatNames;return OF(e,s,r,n),t.keywords&&(0,Wee.default)(e),e};tP.get=(e,t="full")=>{let n=(t==="fast"?cu.fastFormats:cu.fullFormats)[e];if(!n)throw new Error(`Unknown format "${e}"`);return n};function OF(e,t,r,n){var s,a;(s=(a=e.opts.code).formats)!==null&&s!==void 0||(a.formats=(0,eP._)`require("ajv-formats/dist/formats").${n}`);for(let o of t)e.addFormat(o,r[o])}$F.exports=pf=tP;Object.defineProperty(pf,"__esModule",{value:!0});pf.default=tP});var BF={};zn(BF,{getApiSurfaceDiff:()=>iP,getDiffSummary:()=>lu,getEntryPointPack:()=>ff,getFeaturePack:()=>nP,getFunctionSource:()=>My,getHealthReport:()=>aP,getImpactOfChange:()=>Dy,getPreEditBrief:()=>sP,listEntryPoints:()=>ui});function ui(e,t={}){let r=Object.values(e.apiIndex??{}),n=new Map,s=new Map;for(let a of Object.values(e.clusters??{}))for(let o of a.files)n.set(o,{id:a.id,label:a.label});for(let a of Object.values(e.services??{}))s.set(a.id,a.id);return r.map(a=>{let o=n.get(a.filePath),c;return o&&(c=e.clusters?.[o.id]?.serviceId),{method:a.method,route:a.route,handlerName:a.handlerName,filePath:a.filePath,clusterId:o?.id,clusterLabel:o?.label,serviceId:c,auth:a.meta?.auth,middlewares:a.meta?.middlewares,error:a.meta?.error,webhook:a.meta?.webhook,webhookProvider:a.meta?.webhookProvider,dynamicRangeCount:a.meta?.dynamicRange?.count,diff:a.diff}}).filter(a=>!(t.method&&a.method!==t.method||t.clusterId&&a.clusterId!==t.clusterId||t.serviceId&&a.serviceId!==t.serviceId||t.authRequired&&a.auth!=="required"||t.onlyChanged&&(!a.diff||a.diff==="unchanged")||t.routeContains&&!a.route.includes(t.routeContains)))}function ff(e,t,r,n={}){let s=Object.values(e.apiIndex??{}),a=s.find(N=>N.method===t&&N.route===r);if(!a)return null;let c=ui(e,{method:t,routeContains:r}).find(N=>N.method===t&&N.route===r)??{method:a.method,route:a.route,handlerName:a.handlerName,filePath:a.filePath,auth:a.meta?.auth,middlewares:a.meta?.middlewares,error:a.meta?.error,webhook:a.meta?.webhook,webhookProvider:a.meta?.webhookProvider,dynamicRangeCount:a.meta?.dynamicRange?.count,diff:a.diff},l=`sequence:${a.filePath}:${a.handlerName}`,u=`flow:${a.filePath}:${a.handlerName}`,d=e.graphs?.[l],p=e.graphs?.[u],f=[],h=[],m=[],g=new Set;if(d){let N=new Map;for(let O of d.nodes)N.set(O.id,O);for(let O of d.nodes)O.type==="participant"&&O.label!=="API Client"&&(f.push({participant:O.label,kind:(O.subtitle??"\xABmodule\xBB").replace(/«|»/g,"").trim(),filePath:O.anchor?.filePath,diff:O.diff}),O.diff&&O.diff!=="unchanged"&&g.add(O.label));for(let O of d.edges){if(O.edgeType!=="message")continue;let V=N.get(O.source),te=N.get(O.target),W=V?.label??O.source,$=te?.label??O.target;h.push({from:W,to:$,label:O.label??"",diff:O.diff}),O.diff&&O.diff!=="unchanged"&&m.push(`${W} \u2192 ${$}: ${O.label}`)}}let y=[],_=0;if(p)for(let N of p.nodes)y.push({kind:N.type,label:N.label,diff:N.diff}),N.diff&&N.diff!=="unchanged"&&_++;let v=new Map;for(let N of Object.values(e.clusters??{}))for(let O of N.files)v.set(O,N);let S=v.get(a.filePath),w=[];if(S)for(let N of s)S.files.includes(N.filePath)&&!(N.method===t&&N.route===r)&&w.push({method:N.method,route:N.route});let E;if(n.workspaceFileContent&&a.anchor?.span){let N=n.workspaceFileContent(a.filePath),O=a.anchor.span.start??0,V=a.anchor.span.end??O;N&&V>O&&V<=N.length&&(E=N.slice(O,V))}let k={entryPoint:c,handlerSource:E,callsInto:f,messages:h,flowNodes:y,siblings:w};return(g.size>0||m.length>0||_>0)&&(k.diff={modifiedFunctions:[...g],modifiedMessages:m,modifiedFlowNodes:_}),k}function lu(e,t){let r=[];for(let[f,h]of Object.entries(e.files??{})){let m=t.files?.[f];(!m||m.hash!==h.hash)&&r.push(f)}for(let f of Object.keys(t.files??{}))f in(e.files??{})||r.push(f);let n=ui(e),s=ui(t),a=f=>`${f.method}:${f.route}::${f.filePath}`,o=new Set(s.map(a)),c=new Set(n.map(a)),l=n.filter(f=>!o.has(a(f))),u=s.filter(f=>!c.has(a(f))),d=[];for(let f of n){if(!o.has(a(f)))continue;let h=e.graphs?.[`sequence:${f.filePath}:${f.handlerName}`];if(!h)continue;(h.nodes.some(g=>g.diff&&g.diff!=="unchanged")||h.edges.some(g=>g.diff&&g.diff!=="unchanged"))&&d.push(f)}let p=[];for(let f of Object.values(e.clusters??{}))f.diff&&f.diff!=="unchanged"&&p.push({id:f.id,label:f.label});return{changedFiles:r,addedEntryPoints:l,deletedEntryPoints:u,modifiedEntryPoints:d,modifiedClusters:p}}function Dy(e,t,r){let n=[],s=Object.values(e.apiIndex??{}),a=[];for(let o of s){let c=`sequence:${o.filePath}:${o.handlerName}`,l=e.graphs?.[c];if(!l)continue;l.nodes.some(d=>d.type==="participant"&&(d.anchor?.filePath===t||r&&d.label===r))&&(n.push(c),a.push({method:o.method,route:o.route,handlerName:o.handlerName,filePath:o.filePath,auth:o.meta?.auth}))}return{entryPoints:a,affectedSequenceIds:n}}function nP(e,t,r){let n=e.clusters?.[t];if(!n)return null;let s=ui(e,{clusterId:t}),a=e.graphs?.[`api-list:${t}`],o=[];if(a){let l=a.meta??{};for(let u of l.subsystems??[])o.push(u.label)}let c={cluster:{id:n.id,label:n.label,files:n.files,serviceId:n.serviceId},entryPoints:s,subsystems:o};if(r){let l=lu(e,r),u=l.changedFiles.filter(p=>n.files.includes(p)),d=l.modifiedEntryPoints.filter(p=>p.clusterId===t).length;(u.length>0||d>0)&&(c.diff={changedFiles:u,modifiedEntryPoints:d})}return c}function My(e,t,r,n){let s=e.files?.[t];if(!s)return null;let a=s.symbols?.functions?.find(p=>p.name===r);if(!a)return null;let o=n(t);if(!o)return{filePath:t,name:a.name,kind:a.kind,signature:a.signature,span:a.span,source:`${a.signature} {
|
|
@@ -27,7 +27,7 @@ ${a}`)}function Ure(e,t){let{stackTraceLimit:r,prepareStackTrace:n}=Error,s;if(E
|
|
|
27
27
|
${o.join(`
|
|
28
28
|
`)}`)}return r.shapeOf=e,r}function Tle(){function e(t){var r;let n=t;for(;t;){let{type:s}=n;if(s==="OptionalCallExpression"){if(n.optional)return;n=n.callee;continue}if(s==="OptionalMemberExpression"){if(n.optional)return;n=n.object;continue}break}throw new TypeError(`Non-optional ${t.type} must chain from an optional OptionalMemberExpression or OptionalCallExpression. Found chain from ${(r=n)==null?void 0:r.type}`)}return e}function ej(...e){function t(...r){for(let n of e)n(...r)}if(t.chainOf=e,e.length>=2&&"type"in e[0]&&e[0].type==="array"&&!("each"in e[1]))throw new Error('An assertValueType("array") validator can only be followed by an assertEach(...) validator.');return t}var wle=new Set(["aliases","builder","deprecatedAlias","fields","inherits","visitor","validate","unionShape"]),Ele=new Set(["default","optional","deprecated","validate"]),fI={};function Ple(...e){return(t,r={})=>{let n=r.aliases;if(!n){var s;r.inherits&&(n=(s=fI[r.inherits].aliases)==null?void 0:s.slice()),n??(n=[]),r.aliases=n}let a=e.filter(o=>!n.includes(o));n.unshift(...a),tj(t,r)}}function tj(e,t={}){let r=t.inherits&&fI[t.inherits]||{},n=t.fields;if(!n&&(n={},r.fields)){let c=Object.getOwnPropertyNames(r.fields);for(let l of c){let u=r.fields[l],d=u.default;if(Array.isArray(d)?d.length>0:d&&typeof d=="object")throw new Error("field defaults can only be primitives or empty arrays currently");n[l]={default:Array.isArray(d)?[]:d,optional:u.optional,deprecated:u.deprecated,validate:u.validate}}}let s=t.visitor||r.visitor||[],a=t.aliases||r.aliases||[],o=t.builder||r.builder||t.visitor||[];for(let c of Object.keys(t))if(!wle.has(c))throw new Error(`Unknown type option "${c}" on ${e}`);t.deprecatedAlias&&(ple[t.deprecatedAlias]=e);for(let c of s.concat(o))n[c]=n[c]||{};for(let c of Object.keys(n)){let l=n[c];l.default!==void 0&&!o.includes(c)&&(l.optional=!0),l.default===void 0?l.default=null:!l.validate&&l.default!=null&&(l.validate=mI(n_(l.default)));for(let u of Object.keys(l))if(!Ele.has(u))throw new Error(`Unknown field key "${u}" on ${e}.${c}`)}cle[e]=t.visitor=s,dle[e]=t.builder=o,ule[e]=t.fields=n,lle[e]=t.aliases=a,a.forEach(c=>{pI[c]=pI[c]||[],pI[c].push(e)}),t.validate&&(fle[e]=t.validate),t.unionShape&&(hle[e]=t.unionShape),fI[e]=t}});var Of=G(hn=>{"use strict";Object.defineProperty(hn,"__esModule",{value:!0});hn.patternLikeCommon=hn.importAttributes=hn.functionTypeAnnotationCommon=hn.functionDeclarationCommon=hn.functionCommon=hn.classMethodOrPropertyUnionShapeCommon=hn.classMethodOrPropertyCommon=hn.classMethodOrDeclareMethodCommon=void 0;var Yn=Su(),Ile=Tu(),rj=Af(),Ale=Z2(),Eu=wu(),q=Gs(),Nf=(e=!1)=>({unionShape:{discriminator:"computed",shapes:[{name:"computed",value:[!0],properties:{key:{validate:(0,q.assertNodeType)("Expression")}}},{name:"nonComputed",value:[!1],properties:{key:{validate:e?(0,q.assertNodeType)("Identifier","StringLiteral","NumericLiteral","BigIntLiteral","PrivateName"):(0,q.assertNodeType)("Identifier","StringLiteral","NumericLiteral","BigIntLiteral")}}}]}});hn.classMethodOrPropertyUnionShapeCommon=Nf;var Ie=(0,q.defineAliasedType)("Standardized");Ie("ArrayExpression",{fields:{elements:{validate:(0,q.arrayOf)((0,q.assertNodeOrValueType)("null","Expression","SpreadElement")),default:process.env.BABEL_TYPES_8_BREAKING?void 0:[]}},visitor:["elements"],aliases:["Expression"]});Ie("AssignmentExpression",{fields:{operator:{validate:process.env.BABEL_TYPES_8_BREAKING?Object.assign(function(){let e=(0,q.assertOneOf)(...Eu.ASSIGNMENT_OPERATORS),t=(0,q.assertOneOf)("=");return function(r,n,s){((0,Yn.default)("Pattern",r.left)?t:e)(r,n,s)}}(),{oneOf:Eu.ASSIGNMENT_OPERATORS}):(0,q.assertValueType)("string")},left:{validate:process.env.BABEL_TYPES_8_BREAKING?(0,q.assertNodeType)("Identifier","MemberExpression","OptionalMemberExpression","ArrayPattern","ObjectPattern","TSAsExpression","TSSatisfiesExpression","TSTypeAssertion","TSNonNullExpression"):(0,q.assertNodeType)("LVal","OptionalMemberExpression")},right:{validate:(0,q.assertNodeType)("Expression")}},builder:["operator","left","right"],visitor:["left","right"],aliases:["Expression"]});Ie("BinaryExpression",{builder:["operator","left","right"],fields:{operator:{validate:(0,q.assertOneOf)(...Eu.BINARY_OPERATORS)},left:{validate:function(){let e=(0,q.assertNodeType)("Expression"),t=(0,q.assertNodeType)("Expression","PrivateName");return Object.assign(function(n,s,a){(n.operator==="in"?t:e)(n,s,a)},{oneOfNodeTypes:["Expression","PrivateName"]})}()},right:{validate:(0,q.assertNodeType)("Expression")}},visitor:["left","right"],aliases:["Binary","Expression"]});Ie("InterpreterDirective",{builder:["value"],fields:{value:{validate:(0,q.assertValueType)("string")}}});Ie("Directive",{visitor:["value"],fields:{value:{validate:(0,q.assertNodeType)("DirectiveLiteral")}}});Ie("DirectiveLiteral",{builder:["value"],fields:{value:{validate:(0,q.assertValueType)("string")}}});Ie("BlockStatement",{builder:["body","directives"],visitor:["directives","body"],fields:{directives:{validate:(0,q.arrayOfType)("Directive"),default:[]},body:(0,q.validateArrayOfType)("Statement")},aliases:["Scopable","BlockParent","Block","Statement"]});Ie("BreakStatement",{visitor:["label"],fields:{label:{validate:(0,q.assertNodeType)("Identifier"),optional:!0}},aliases:["Statement","Terminatorless","CompletionStatement"]});Ie("CallExpression",{visitor:["callee","typeParameters","typeArguments","arguments"],builder:["callee","arguments"],aliases:["Expression"],fields:Object.assign({callee:{validate:(0,q.assertNodeType)("Expression","Super","V8IntrinsicIdentifier")},arguments:(0,q.validateArrayOfType)("Expression","SpreadElement","ArgumentPlaceholder"),typeArguments:{validate:(0,q.assertNodeType)("TypeParameterInstantiation"),optional:!0}},process.env.BABEL_TYPES_8_BREAKING?{}:{optional:{validate:(0,q.assertValueType)("boolean"),optional:!0},typeParameters:{validate:(0,q.assertNodeType)("TSTypeParameterInstantiation"),optional:!0}})});Ie("CatchClause",{visitor:["param","body"],fields:{param:{validate:(0,q.assertNodeType)("Identifier","ArrayPattern","ObjectPattern"),optional:!0},body:{validate:(0,q.assertNodeType)("BlockStatement")}},aliases:["Scopable","BlockParent"]});Ie("ConditionalExpression",{visitor:["test","consequent","alternate"],fields:{test:{validate:(0,q.assertNodeType)("Expression")},consequent:{validate:(0,q.assertNodeType)("Expression")},alternate:{validate:(0,q.assertNodeType)("Expression")}},aliases:["Expression","Conditional"]});Ie("ContinueStatement",{visitor:["label"],fields:{label:{validate:(0,q.assertNodeType)("Identifier"),optional:!0}},aliases:["Statement","Terminatorless","CompletionStatement"]});Ie("DebuggerStatement",{aliases:["Statement"]});Ie("DoWhileStatement",{builder:["test","body"],visitor:["body","test"],fields:{test:{validate:(0,q.assertNodeType)("Expression")},body:{validate:(0,q.assertNodeType)("Statement")}},aliases:["Statement","BlockParent","Loop","While","Scopable"]});Ie("EmptyStatement",{aliases:["Statement"]});Ie("ExpressionStatement",{visitor:["expression"],fields:{expression:{validate:(0,q.assertNodeType)("Expression")}},aliases:["Statement","ExpressionWrapper"]});Ie("File",{builder:["program","comments","tokens"],visitor:["program"],fields:{program:{validate:(0,q.assertNodeType)("Program")},comments:{validate:process.env.BABEL_TYPES_8_BREAKING?(0,q.assertEach)((0,q.assertNodeType)("CommentBlock","CommentLine")):Object.assign(()=>{},{each:{oneOfNodeTypes:["CommentBlock","CommentLine"]}}),optional:!0},tokens:{validate:(0,q.assertEach)(Object.assign(()=>{},{type:"any"})),optional:!0}}});Ie("ForInStatement",{visitor:["left","right","body"],aliases:["Scopable","Statement","For","BlockParent","Loop","ForXStatement"],fields:{left:{validate:process.env.BABEL_TYPES_8_BREAKING?(0,q.assertNodeType)("VariableDeclaration","Identifier","MemberExpression","ArrayPattern","ObjectPattern","TSAsExpression","TSSatisfiesExpression","TSTypeAssertion","TSNonNullExpression"):(0,q.assertNodeType)("VariableDeclaration","LVal")},right:{validate:(0,q.assertNodeType)("Expression")},body:{validate:(0,q.assertNodeType)("Statement")}}});Ie("ForStatement",{visitor:["init","test","update","body"],aliases:["Scopable","Statement","For","BlockParent","Loop"],fields:{init:{validate:(0,q.assertNodeType)("VariableDeclaration","Expression"),optional:!0},test:{validate:(0,q.assertNodeType)("Expression"),optional:!0},update:{validate:(0,q.assertNodeType)("Expression"),optional:!0},body:{validate:(0,q.assertNodeType)("Statement")}}});var Pu=()=>({params:(0,q.validateArrayOfType)("FunctionParameter"),generator:{default:!1},async:{default:!1}});hn.functionCommon=Pu;var Ec=()=>({returnType:{validate:(0,q.assertNodeType)("TypeAnnotation","TSTypeAnnotation","Noop"),optional:!0},typeParameters:{validate:(0,q.assertNodeType)("TypeParameterDeclaration","TSTypeParameterDeclaration","Noop"),optional:!0}});hn.functionTypeAnnotationCommon=Ec;var nj=()=>Object.assign({},Pu(),{declare:{validate:(0,q.assertValueType)("boolean"),optional:!0},id:{validate:(0,q.assertNodeType)("Identifier"),optional:!0}});hn.functionDeclarationCommon=nj;Ie("FunctionDeclaration",{builder:["id","params","body","generator","async"],visitor:["id","typeParameters","params","predicate","returnType","body"],fields:Object.assign({},nj(),Ec(),{body:{validate:(0,q.assertNodeType)("BlockStatement")},predicate:{validate:(0,q.assertNodeType)("DeclaredPredicate","InferredPredicate"),optional:!0}}),aliases:["Scopable","Function","BlockParent","FunctionParent","Statement","Pureish","Declaration"],validate:process.env.BABEL_TYPES_8_BREAKING?function(){let e=(0,q.assertNodeType)("Identifier");return function(t,r,n){(0,Yn.default)("ExportDefaultDeclaration",t)||e(n,"id",n.id)}}():void 0});Ie("FunctionExpression",{inherits:"FunctionDeclaration",aliases:["Scopable","Function","BlockParent","FunctionParent","Expression","Pureish"],fields:Object.assign({},Pu(),Ec(),{id:{validate:(0,q.assertNodeType)("Identifier"),optional:!0},body:{validate:(0,q.assertNodeType)("BlockStatement")},predicate:{validate:(0,q.assertNodeType)("DeclaredPredicate","InferredPredicate"),optional:!0}})});var Iu=()=>({typeAnnotation:{validate:(0,q.assertNodeType)("TypeAnnotation","TSTypeAnnotation","Noop"),optional:!0},optional:{validate:(0,q.assertValueType)("boolean"),optional:!0},decorators:{validate:(0,q.arrayOfType)("Decorator"),optional:!0}});hn.patternLikeCommon=Iu;Ie("Identifier",{builder:["name"],visitor:["typeAnnotation","decorators"],aliases:["Expression","FunctionParameter","PatternLike","LVal","TSEntityName"],fields:Object.assign({},Iu(),{name:{validate:process.env.BABEL_TYPES_8_BREAKING?(0,q.chain)((0,q.assertValueType)("string"),Object.assign(function(e,t,r){if(!(0,Ile.default)(r,!1))throw new TypeError(`"${r}" is not a valid identifier name`)},{type:"string"})):(0,q.assertValueType)("string")}}),validate:process.env.BABEL_TYPES_8_BREAKING?function(e,t,r){let n=/\.(\w+)$/.exec(t.toString());if(!n)return;let[,s]=n,a={computed:!1};if(s==="property"){if((0,Yn.default)("MemberExpression",e,a)||(0,Yn.default)("OptionalMemberExpression",e,a))return}else if(s==="key"){if((0,Yn.default)("Property",e,a)||(0,Yn.default)("Method",e,a))return}else if(s==="exported"){if((0,Yn.default)("ExportSpecifier",e))return}else if(s==="imported"){if((0,Yn.default)("ImportSpecifier",e,{imported:r}))return}else if(s==="meta"&&(0,Yn.default)("MetaProperty",e,{meta:r}))return;if(((0,rj.isKeyword)(r.name)||(0,rj.isReservedWord)(r.name,!1))&&r.name!=="this")throw new TypeError(`"${r.name}" is not a valid identifier`)}:void 0});Ie("IfStatement",{visitor:["test","consequent","alternate"],aliases:["Statement","Conditional"],fields:{test:{validate:(0,q.assertNodeType)("Expression")},consequent:{validate:(0,q.assertNodeType)("Statement")},alternate:{optional:!0,validate:(0,q.assertNodeType)("Statement")}}});Ie("LabeledStatement",{visitor:["label","body"],aliases:["Statement"],fields:{label:{validate:(0,q.assertNodeType)("Identifier")},body:{validate:(0,q.assertNodeType)("Statement")}}});Ie("StringLiteral",{builder:["value"],fields:{value:{validate:(0,q.assertValueType)("string")}},aliases:["Expression","Pureish","Literal","Immutable"]});Ie("NumericLiteral",{builder:["value"],deprecatedAlias:"NumberLiteral",fields:{value:{validate:(0,q.chain)((0,q.assertValueType)("number"),Object.assign(function(e,t,r){if(1/r<0||!Number.isFinite(r)){let n=new Error(`NumericLiterals must be non-negative finite numbers. You can use t.valueToNode(${r}) instead.`)}},{type:"number"}))}},aliases:["Expression","Pureish","Literal","Immutable"]});Ie("NullLiteral",{aliases:["Expression","Pureish","Literal","Immutable"]});Ie("BooleanLiteral",{builder:["value"],fields:{value:{validate:(0,q.assertValueType)("boolean")}},aliases:["Expression","Pureish","Literal","Immutable"]});Ie("RegExpLiteral",{builder:["pattern","flags"],deprecatedAlias:"RegexLiteral",aliases:["Expression","Pureish","Literal"],fields:{pattern:{validate:(0,q.assertValueType)("string")},flags:{validate:process.env.BABEL_TYPES_8_BREAKING?(0,q.chain)((0,q.assertValueType)("string"),Object.assign(function(e,t,r){let n=/[^dgimsuvy]/.exec(r);if(n)throw new TypeError(`"${n[0]}" is not a valid RegExp flag`)},{type:"string"})):(0,q.assertValueType)("string"),default:""}}});Ie("LogicalExpression",{builder:["operator","left","right"],visitor:["left","right"],aliases:["Binary","Expression"],fields:{operator:{validate:(0,q.assertOneOf)(...Eu.LOGICAL_OPERATORS)},left:{validate:(0,q.assertNodeType)("Expression")},right:{validate:(0,q.assertNodeType)("Expression")}}});Ie("MemberExpression",{builder:["object","property","computed",...process.env.BABEL_TYPES_8_BREAKING?[]:["optional"]],visitor:["object","property"],aliases:["Expression","LVal","PatternLike"],unionShape:{discriminator:"computed",shapes:[{name:"computed",value:[!0],properties:{property:{validate:(0,q.assertNodeType)("Expression")}}},{name:"nonComputed",value:[!1],properties:{property:{validate:(0,q.assertNodeType)("Identifier","PrivateName")}}}]},fields:Object.assign({object:{validate:(0,q.assertNodeType)("Expression","Super")},property:{validate:function(){let e=(0,q.assertNodeType)("Identifier","PrivateName"),t=(0,q.assertNodeType)("Expression"),r=function(n,s,a){(n.computed?t:e)(n,s,a)};return r.oneOfNodeTypes=["Expression","Identifier","PrivateName"],r}()},computed:{default:!1}},process.env.BABEL_TYPES_8_BREAKING?{}:{optional:{validate:(0,q.assertValueType)("boolean"),optional:!0}})});Ie("NewExpression",{inherits:"CallExpression"});Ie("Program",{visitor:["directives","body"],builder:["body","directives","sourceType","interpreter"],fields:{sourceType:{validate:(0,q.assertOneOf)("script","module"),default:"script"},interpreter:{validate:(0,q.assertNodeType)("InterpreterDirective"),default:null,optional:!0},directives:{validate:(0,q.arrayOfType)("Directive"),default:[]},body:(0,q.validateArrayOfType)("Statement")},aliases:["Scopable","BlockParent","Block"]});Ie("ObjectExpression",{visitor:["properties"],aliases:["Expression"],fields:{properties:(0,q.validateArrayOfType)("ObjectMethod","ObjectProperty","SpreadElement")}});Ie("ObjectMethod",Object.assign({builder:["kind","key","params","body","computed","generator","async"],visitor:["decorators","key","typeParameters","params","returnType","body"]},Nf(),{fields:Object.assign({},Pu(),Ec(),{kind:Object.assign({validate:(0,q.assertOneOf)("method","get","set")},process.env.BABEL_TYPES_8_BREAKING?{}:{default:"method"}),computed:{default:!1},key:{validate:function(){let e=(0,q.assertNodeType)("Identifier","StringLiteral","NumericLiteral","BigIntLiteral"),t=(0,q.assertNodeType)("Expression"),r=function(n,s,a){(n.computed?t:e)(n,s,a)};return r.oneOfNodeTypes=["Expression","Identifier","StringLiteral","NumericLiteral","BigIntLiteral"],r}()},decorators:{validate:(0,q.arrayOfType)("Decorator"),optional:!0},body:{validate:(0,q.assertNodeType)("BlockStatement")}}),aliases:["UserWhitespacable","Function","Scopable","BlockParent","FunctionParent","Method","ObjectMember"]}));Ie("ObjectProperty",{builder:["key","value","computed","shorthand",...process.env.BABEL_TYPES_8_BREAKING?[]:["decorators"]],unionShape:{discriminator:"computed",shapes:[{name:"computed",value:[!0],properties:{key:{validate:(0,q.assertNodeType)("Expression")}}},{name:"nonComputed",value:[!1],properties:{key:{validate:(0,q.assertNodeType)("Identifier","StringLiteral","NumericLiteral","BigIntLiteral","DecimalLiteral","PrivateName")}}}]},fields:{computed:{default:!1},key:{validate:function(){let e=(0,q.assertNodeType)("Identifier","StringLiteral","NumericLiteral","BigIntLiteral","DecimalLiteral","PrivateName"),t=(0,q.assertNodeType)("Expression");return Object.assign(function(n,s,a){(n.computed?t:e)(n,s,a)},{oneOfNodeTypes:["Expression","Identifier","StringLiteral","NumericLiteral","BigIntLiteral","DecimalLiteral","PrivateName"]})}()},value:{validate:(0,q.assertNodeType)("Expression","PatternLike")},shorthand:{validate:process.env.BABEL_TYPES_8_BREAKING?(0,q.chain)((0,q.assertValueType)("boolean"),Object.assign(function(e,t,r){if(r){if(e.computed)throw new TypeError("Property shorthand of ObjectProperty cannot be true if computed is true");if(!(0,Yn.default)("Identifier",e.key))throw new TypeError("Property shorthand of ObjectProperty cannot be true if key is not an Identifier")}},{type:"boolean"})):(0,q.assertValueType)("boolean"),default:!1},decorators:{validate:(0,q.arrayOfType)("Decorator"),optional:!0}},visitor:["decorators","key","value"],aliases:["UserWhitespacable","Property","ObjectMember"],validate:process.env.BABEL_TYPES_8_BREAKING?function(){let e=(0,q.assertNodeType)("Identifier","Pattern","TSAsExpression","TSSatisfiesExpression","TSNonNullExpression","TSTypeAssertion"),t=(0,q.assertNodeType)("Expression");return function(r,n,s){((0,Yn.default)("ObjectPattern",r)?e:t)(s,"value",s.value)}}():void 0});Ie("RestElement",{visitor:["argument","typeAnnotation"],builder:["argument"],aliases:["FunctionParameter","PatternLike","LVal"],deprecatedAlias:"RestProperty",fields:Object.assign({},Iu(),{argument:{validate:process.env.BABEL_TYPES_8_BREAKING?(0,q.assertNodeType)("Identifier","ArrayPattern","ObjectPattern","MemberExpression","TSAsExpression","TSSatisfiesExpression","TSTypeAssertion","TSNonNullExpression"):(0,q.assertNodeType)("Identifier","ArrayPattern","ObjectPattern","MemberExpression","TSAsExpression","TSSatisfiesExpression","TSTypeAssertion","TSNonNullExpression","RestElement","AssignmentPattern")}}),validate:process.env.BABEL_TYPES_8_BREAKING?function(e,t){let r=/(\w+)\[(\d+)\]/.exec(t.toString());if(!r)throw new Error("Internal Babel error: malformed key.");let[,n,s]=r;if(e[n].length>+s+1)throw new TypeError(`RestElement must be last element of ${n}`)}:void 0});Ie("ReturnStatement",{visitor:["argument"],aliases:["Statement","Terminatorless","CompletionStatement"],fields:{argument:{validate:(0,q.assertNodeType)("Expression"),optional:!0}}});Ie("SequenceExpression",{visitor:["expressions"],fields:{expressions:(0,q.validateArrayOfType)("Expression")},aliases:["Expression"]});Ie("ParenthesizedExpression",{visitor:["expression"],aliases:["Expression","ExpressionWrapper"],fields:{expression:{validate:(0,q.assertNodeType)("Expression")}}});Ie("SwitchCase",{visitor:["test","consequent"],fields:{test:{validate:(0,q.assertNodeType)("Expression"),optional:!0},consequent:(0,q.validateArrayOfType)("Statement")}});Ie("SwitchStatement",{visitor:["discriminant","cases"],aliases:["Statement","BlockParent","Scopable"],fields:{discriminant:{validate:(0,q.assertNodeType)("Expression")},cases:(0,q.validateArrayOfType)("SwitchCase")}});Ie("ThisExpression",{aliases:["Expression"]});Ie("ThrowStatement",{visitor:["argument"],aliases:["Statement","Terminatorless","CompletionStatement"],fields:{argument:{validate:(0,q.assertNodeType)("Expression")}}});Ie("TryStatement",{visitor:["block","handler","finalizer"],aliases:["Statement"],fields:{block:{validate:process.env.BABEL_TYPES_8_BREAKING?(0,q.chain)((0,q.assertNodeType)("BlockStatement"),Object.assign(function(e){if(!e.handler&&!e.finalizer)throw new TypeError("TryStatement expects either a handler or finalizer, or both")},{oneOfNodeTypes:["BlockStatement"]})):(0,q.assertNodeType)("BlockStatement")},handler:{optional:!0,validate:(0,q.assertNodeType)("CatchClause")},finalizer:{optional:!0,validate:(0,q.assertNodeType)("BlockStatement")}}});Ie("UnaryExpression",{builder:["operator","argument","prefix"],fields:{prefix:{default:!0},argument:{validate:(0,q.assertNodeType)("Expression")},operator:{validate:(0,q.assertOneOf)(...Eu.UNARY_OPERATORS)}},visitor:["argument"],aliases:["UnaryLike","Expression"]});Ie("UpdateExpression",{builder:["operator","argument","prefix"],fields:{prefix:{default:!1},argument:{validate:process.env.BABEL_TYPES_8_BREAKING?(0,q.assertNodeType)("Identifier","MemberExpression"):(0,q.assertNodeType)("Expression")},operator:{validate:(0,q.assertOneOf)(...Eu.UPDATE_OPERATORS)}},visitor:["argument"],aliases:["Expression"]});Ie("VariableDeclaration",{builder:["kind","declarations"],visitor:["declarations"],aliases:["Statement","Declaration"],fields:{declare:{validate:(0,q.assertValueType)("boolean"),optional:!0},kind:{validate:(0,q.assertOneOf)("var","let","const","using","await using")},declarations:(0,q.validateArrayOfType)("VariableDeclarator")},validate:process.env.BABEL_TYPES_8_BREAKING?(()=>{let e=(0,q.assertNodeType)("Identifier","Placeholder"),t=(0,q.assertNodeType)("Identifier","ArrayPattern","ObjectPattern","Placeholder"),r=(0,q.assertNodeType)("Identifier","VoidPattern","Placeholder");return function(n,s,a){let{kind:o,declarations:c}=a,l=(0,Yn.default)("ForXStatement",n,{left:a});if(l&&c.length!==1)throw new TypeError(`Exactly one VariableDeclarator is required in the VariableDeclaration of a ${n.type}`);for(let u of c)o==="const"||o==="let"||o==="var"?!l&&!u.init?e(u,"id",u.id):t(u,"id",u.id):r(u,"id",u.id)}})():void 0});Ie("VariableDeclarator",{visitor:["id","init"],fields:{id:{validate:process.env.BABEL_TYPES_8_BREAKING?(0,q.assertNodeType)("Identifier","ArrayPattern","ObjectPattern","VoidPattern"):(0,q.assertNodeType)("LVal","VoidPattern")},definite:{optional:!0,validate:(0,q.assertValueType)("boolean")},init:{optional:!0,validate:(0,q.assertNodeType)("Expression")}}});Ie("WhileStatement",{visitor:["test","body"],aliases:["Statement","BlockParent","Loop","While","Scopable"],fields:{test:{validate:(0,q.assertNodeType)("Expression")},body:{validate:(0,q.assertNodeType)("Statement")}}});Ie("WithStatement",{visitor:["object","body"],aliases:["Statement"],fields:{object:{validate:(0,q.assertNodeType)("Expression")},body:{validate:(0,q.assertNodeType)("Statement")}}});Ie("AssignmentPattern",{visitor:["left","right","decorators"],builder:["left","right"],aliases:["FunctionParameter","Pattern","PatternLike","LVal"],fields:Object.assign({},Iu(),{left:{validate:(0,q.assertNodeType)("Identifier","ObjectPattern","ArrayPattern","MemberExpression","TSAsExpression","TSSatisfiesExpression","TSTypeAssertion","TSNonNullExpression")},right:{validate:(0,q.assertNodeType)("Expression")},decorators:{validate:(0,q.arrayOfType)("Decorator"),optional:!0}})});Ie("ArrayPattern",{visitor:["elements","typeAnnotation"],builder:["elements"],aliases:["FunctionParameter","Pattern","PatternLike","LVal"],fields:Object.assign({},Iu(),{elements:{validate:(0,q.chain)((0,q.assertValueType)("array"),(0,q.assertEach)((0,q.assertNodeOrValueType)("null","PatternLike")))}})});Ie("ArrowFunctionExpression",{builder:["params","body","async"],visitor:["typeParameters","params","predicate","returnType","body"],aliases:["Scopable","Function","BlockParent","FunctionParent","Expression","Pureish"],fields:Object.assign({},Pu(),Ec(),{expression:{validate:(0,q.assertValueType)("boolean")},body:{validate:(0,q.assertNodeType)("BlockStatement","Expression")},predicate:{validate:(0,q.assertNodeType)("DeclaredPredicate","InferredPredicate"),optional:!0}})});Ie("ClassBody",{visitor:["body"],fields:{body:(0,q.validateArrayOfType)("ClassMethod","ClassPrivateMethod","ClassProperty","ClassPrivateProperty","ClassAccessorProperty","TSDeclareMethod","TSIndexSignature","StaticBlock")}});Ie("ClassExpression",{builder:["id","superClass","body","decorators"],visitor:["decorators","id","typeParameters","superClass","superTypeParameters","mixins","implements","body"],aliases:["Scopable","Class","Expression"],fields:{id:{validate:(0,q.assertNodeType)("Identifier"),optional:!0},typeParameters:{validate:(0,q.assertNodeType)("TypeParameterDeclaration","TSTypeParameterDeclaration","Noop"),optional:!0},body:{validate:(0,q.assertNodeType)("ClassBody")},superClass:{optional:!0,validate:(0,q.assertNodeType)("Expression")},superTypeParameters:{validate:(0,q.assertNodeType)("TypeParameterInstantiation","TSTypeParameterInstantiation"),optional:!0},implements:{validate:(0,q.arrayOfType)("TSExpressionWithTypeArguments","ClassImplements"),optional:!0},decorators:{validate:(0,q.arrayOfType)("Decorator"),optional:!0},mixins:{validate:(0,q.assertNodeType)("InterfaceExtends"),optional:!0}}});Ie("ClassDeclaration",{inherits:"ClassExpression",aliases:["Scopable","Class","Statement","Declaration"],fields:{id:{validate:(0,q.assertNodeType)("Identifier"),optional:!0},typeParameters:{validate:(0,q.assertNodeType)("TypeParameterDeclaration","TSTypeParameterDeclaration","Noop"),optional:!0},body:{validate:(0,q.assertNodeType)("ClassBody")},superClass:{optional:!0,validate:(0,q.assertNodeType)("Expression")},superTypeParameters:{validate:(0,q.assertNodeType)("TypeParameterInstantiation","TSTypeParameterInstantiation"),optional:!0},implements:{validate:(0,q.arrayOfType)("TSExpressionWithTypeArguments","ClassImplements"),optional:!0},decorators:{validate:(0,q.arrayOfType)("Decorator"),optional:!0},mixins:{validate:(0,q.assertNodeType)("InterfaceExtends"),optional:!0},declare:{validate:(0,q.assertValueType)("boolean"),optional:!0},abstract:{validate:(0,q.assertValueType)("boolean"),optional:!0}},validate:process.env.BABEL_TYPES_8_BREAKING?function(){let e=(0,q.assertNodeType)("Identifier");return function(t,r,n){(0,Yn.default)("ExportDefaultDeclaration",t)||e(n,"id",n.id)}}():void 0});var a_=hn.importAttributes={attributes:{optional:!0,validate:(0,q.arrayOfType)("ImportAttribute")}};a_.assertions={deprecated:!0,optional:!0,validate:(0,q.arrayOfType)("ImportAttribute")};Ie("ExportAllDeclaration",{builder:["source","attributes"],visitor:["source","attributes","assertions"],aliases:["Statement","Declaration","ImportOrExportDeclaration","ExportDeclaration"],fields:Object.assign({source:{validate:(0,q.assertNodeType)("StringLiteral")},exportKind:(0,q.validateOptional)((0,q.assertOneOf)("type","value"))},a_)});Ie("ExportDefaultDeclaration",{visitor:["declaration"],aliases:["Statement","Declaration","ImportOrExportDeclaration","ExportDeclaration"],fields:{declaration:(0,q.validateType)("TSDeclareFunction","FunctionDeclaration","ClassDeclaration","Expression"),exportKind:(0,q.validateOptional)((0,q.assertOneOf)("value"))}});Ie("ExportNamedDeclaration",{builder:["declaration","specifiers","source","attributes"],visitor:["declaration","specifiers","source","attributes","assertions"],aliases:["Statement","Declaration","ImportOrExportDeclaration","ExportDeclaration"],fields:Object.assign({declaration:{optional:!0,validate:process.env.BABEL_TYPES_8_BREAKING?(0,q.chain)((0,q.assertNodeType)("Declaration"),Object.assign(function(e,t,r){if(r&&e.specifiers.length)throw new TypeError("Only declaration or specifiers is allowed on ExportNamedDeclaration");if(r&&e.source)throw new TypeError("Cannot export a declaration from a source")},{oneOfNodeTypes:["Declaration"]})):(0,q.assertNodeType)("Declaration")}},a_,{specifiers:{default:[],validate:(0,q.arrayOf)(function(){let e=(0,q.assertNodeType)("ExportSpecifier","ExportDefaultSpecifier","ExportNamespaceSpecifier"),t=(0,q.assertNodeType)("ExportSpecifier");return process.env.BABEL_TYPES_8_BREAKING?Object.assign(function(r,n,s){(r.source?e:t)(r,n,s)},{oneOfNodeTypes:["ExportSpecifier","ExportDefaultSpecifier","ExportNamespaceSpecifier"]}):e}())},source:{validate:(0,q.assertNodeType)("StringLiteral"),optional:!0},exportKind:(0,q.validateOptional)((0,q.assertOneOf)("type","value"))})});Ie("ExportSpecifier",{visitor:["local","exported"],aliases:["ModuleSpecifier"],fields:{local:{validate:(0,q.assertNodeType)("Identifier")},exported:{validate:(0,q.assertNodeType)("Identifier","StringLiteral")},exportKind:{validate:(0,q.assertOneOf)("type","value"),optional:!0}}});Ie("ForOfStatement",{visitor:["left","right","body"],builder:["left","right","body","await"],aliases:["Scopable","Statement","For","BlockParent","Loop","ForXStatement"],fields:{left:{validate:function(){if(!process.env.BABEL_TYPES_8_BREAKING)return(0,q.assertNodeType)("VariableDeclaration","LVal");let e=(0,q.assertNodeType)("VariableDeclaration"),t=(0,q.assertNodeType)("Identifier","MemberExpression","ArrayPattern","ObjectPattern","TSAsExpression","TSSatisfiesExpression","TSTypeAssertion","TSNonNullExpression");return Object.assign(function(r,n,s){(0,Yn.default)("VariableDeclaration",s)?e(r,n,s):t(r,n,s)},{oneOfNodeTypes:["VariableDeclaration","Identifier","MemberExpression","ArrayPattern","ObjectPattern","TSAsExpression","TSSatisfiesExpression","TSTypeAssertion","TSNonNullExpression"]})}()},right:{validate:(0,q.assertNodeType)("Expression")},body:{validate:(0,q.assertNodeType)("Statement")},await:{default:!1}}});Ie("ImportDeclaration",{builder:["specifiers","source","attributes"],visitor:["specifiers","source","attributes","assertions"],aliases:["Statement","Declaration","ImportOrExportDeclaration"],fields:Object.assign({},a_,{module:{optional:!0,validate:(0,q.assertValueType)("boolean")},phase:{default:null,validate:(0,q.assertOneOf)("source","defer")},specifiers:(0,q.validateArrayOfType)("ImportSpecifier","ImportDefaultSpecifier","ImportNamespaceSpecifier"),source:{validate:(0,q.assertNodeType)("StringLiteral")},importKind:{validate:(0,q.assertOneOf)("type","typeof","value"),optional:!0}})});Ie("ImportDefaultSpecifier",{visitor:["local"],aliases:["ModuleSpecifier"],fields:{local:{validate:(0,q.assertNodeType)("Identifier")}}});Ie("ImportNamespaceSpecifier",{visitor:["local"],aliases:["ModuleSpecifier"],fields:{local:{validate:(0,q.assertNodeType)("Identifier")}}});Ie("ImportSpecifier",{visitor:["imported","local"],builder:["local","imported"],aliases:["ModuleSpecifier"],fields:{local:{validate:(0,q.assertNodeType)("Identifier")},imported:{validate:(0,q.assertNodeType)("Identifier","StringLiteral")},importKind:{validate:(0,q.assertOneOf)("type","typeof","value"),optional:!0}}});Ie("ImportExpression",{visitor:["source","options"],aliases:["Expression"],fields:{phase:{default:null,validate:(0,q.assertOneOf)("source","defer")},source:{validate:(0,q.assertNodeType)("Expression")},options:{validate:(0,q.assertNodeType)("Expression"),optional:!0}}});Ie("MetaProperty",{visitor:["meta","property"],aliases:["Expression"],fields:{meta:{validate:process.env.BABEL_TYPES_8_BREAKING?(0,q.chain)((0,q.assertNodeType)("Identifier"),Object.assign(function(e,t,r){let n;switch(r.name){case"function":n="sent";break;case"new":n="target";break;case"import":n="meta";break}if(!(0,Yn.default)("Identifier",e.property,{name:n}))throw new TypeError("Unrecognised MetaProperty")},{oneOfNodeTypes:["Identifier"]})):(0,q.assertNodeType)("Identifier")},property:{validate:(0,q.assertNodeType)("Identifier")}}});var o_=()=>({abstract:{validate:(0,q.assertValueType)("boolean"),optional:!0},accessibility:{validate:(0,q.assertOneOf)("public","private","protected"),optional:!0},static:{default:!1},override:{default:!1},computed:{default:!1},optional:{validate:(0,q.assertValueType)("boolean"),optional:!0},key:{validate:(0,q.chain)(function(){let e=(0,q.assertNodeType)("Identifier","StringLiteral","NumericLiteral","BigIntLiteral"),t=(0,q.assertNodeType)("Expression");return function(r,n,s){(r.computed?t:e)(r,n,s)}}(),(0,q.assertNodeType)("Identifier","StringLiteral","NumericLiteral","BigIntLiteral","Expression"))}});hn.classMethodOrPropertyCommon=o_;var gI=()=>Object.assign({},Pu(),o_(),{params:(0,q.validateArrayOfType)("FunctionParameter","TSParameterProperty"),kind:{validate:(0,q.assertOneOf)("get","set","method","constructor"),default:"method"},access:{validate:(0,q.chain)((0,q.assertValueType)("string"),(0,q.assertOneOf)("public","private","protected")),optional:!0},decorators:{validate:(0,q.arrayOfType)("Decorator"),optional:!0}});hn.classMethodOrDeclareMethodCommon=gI;Ie("ClassMethod",Object.assign({aliases:["Function","Scopable","BlockParent","FunctionParent","Method"],builder:["kind","key","params","body","computed","static","generator","async"],visitor:["decorators","key","typeParameters","params","returnType","body"]},Nf(),{fields:Object.assign({},gI(),Ec(),{body:{validate:(0,q.assertNodeType)("BlockStatement")}})}));Ie("ObjectPattern",{visitor:["decorators","properties","typeAnnotation"],builder:["properties"],aliases:["FunctionParameter","Pattern","PatternLike","LVal"],fields:Object.assign({},Iu(),{properties:(0,q.validateArrayOfType)("RestElement","ObjectProperty")})});Ie("SpreadElement",{visitor:["argument"],aliases:["UnaryLike"],deprecatedAlias:"SpreadProperty",fields:{argument:{validate:(0,q.assertNodeType)("Expression")}}});Ie("Super",{aliases:["Expression"]});Ie("TaggedTemplateExpression",{visitor:["tag","typeParameters","quasi"],builder:["tag","quasi"],aliases:["Expression"],fields:{tag:{validate:(0,q.assertNodeType)("Expression")},quasi:{validate:(0,q.assertNodeType)("TemplateLiteral")},typeParameters:{validate:(0,q.assertNodeType)("TypeParameterInstantiation","TSTypeParameterInstantiation"),optional:!0}}});Ie("TemplateElement",{builder:["value","tail"],fields:{value:{validate:(0,q.chain)((0,q.assertShape)({raw:{validate:(0,q.assertValueType)("string")},cooked:{validate:(0,q.assertValueType)("string"),optional:!0}}),function(t){let r=t.value.raw,n=!1,s=()=>{throw new Error("Internal @babel/types error.")},{str:a,firstInvalidLoc:o}=(0,Ale.readStringContents)("template",r,0,0,0,{unterminated(){n=!0},strictNumericEscape:s,invalidEscapeSequence:s,numericSeparatorInEscapeSequence:s,unexpectedNumericSeparator:s,invalidDigit:s,invalidCodePoint:s});if(!n)throw new Error("Invalid raw");t.value.cooked=o?null:a})},tail:{default:!1}}});Ie("TemplateLiteral",{visitor:["quasis","expressions"],aliases:["Expression","Literal"],fields:{quasis:(0,q.validateArrayOfType)("TemplateElement"),expressions:{validate:(0,q.chain)((0,q.assertValueType)("array"),(0,q.assertEach)((0,q.assertNodeType)("Expression","TSType")),function(e,t,r){if(e.quasis.length!==r.length+1)throw new TypeError(`Number of ${e.type} quasis should be exactly one more than the number of expressions.
|
|
29
29
|
Expected ${r.length+1} quasis but got ${e.quasis.length}`)})}}});Ie("YieldExpression",{builder:["argument","delegate"],visitor:["argument"],aliases:["Expression","Terminatorless"],fields:{delegate:{validate:process.env.BABEL_TYPES_8_BREAKING?(0,q.chain)((0,q.assertValueType)("boolean"),Object.assign(function(e,t,r){if(r&&!e.argument)throw new TypeError("Property delegate of YieldExpression cannot be true if there is no argument")},{type:"boolean"})):(0,q.assertValueType)("boolean"),default:!1},argument:{optional:!0,validate:(0,q.assertNodeType)("Expression")}}});Ie("AwaitExpression",{builder:["argument"],visitor:["argument"],aliases:["Expression","Terminatorless"],fields:{argument:{validate:(0,q.assertNodeType)("Expression")}}});Ie("Import",{aliases:["Expression"]});Ie("BigIntLiteral",{builder:["value"],fields:{value:{validate:(0,q.assertValueType)("string")}},aliases:["Expression","Pureish","Literal","Immutable"]});Ie("ExportNamespaceSpecifier",{visitor:["exported"],aliases:["ModuleSpecifier"],fields:{exported:{validate:(0,q.assertNodeType)("Identifier")}}});Ie("OptionalMemberExpression",{builder:["object","property","computed","optional"],visitor:["object","property"],aliases:["Expression"],fields:{object:{validate:(0,q.assertNodeType)("Expression")},property:{validate:function(){let e=(0,q.assertNodeType)("Identifier"),t=(0,q.assertNodeType)("Expression");return Object.assign(function(n,s,a){(n.computed?t:e)(n,s,a)},{oneOfNodeTypes:["Expression","Identifier"]})}()},computed:{default:!1},optional:{validate:process.env.BABEL_TYPES_8_BREAKING?(0,q.chain)((0,q.assertValueType)("boolean"),(0,q.assertOptionalChainStart)()):(0,q.assertValueType)("boolean")}}});Ie("OptionalCallExpression",{visitor:["callee","typeParameters","typeArguments","arguments"],builder:["callee","arguments","optional"],aliases:["Expression"],fields:Object.assign({callee:{validate:(0,q.assertNodeType)("Expression")},arguments:(0,q.validateArrayOfType)("Expression","SpreadElement","ArgumentPlaceholder"),optional:{validate:process.env.BABEL_TYPES_8_BREAKING?(0,q.chain)((0,q.assertValueType)("boolean"),(0,q.assertOptionalChainStart)()):(0,q.assertValueType)("boolean")},typeArguments:{validate:(0,q.assertNodeType)("TypeParameterInstantiation"),optional:!0}},{typeParameters:{validate:(0,q.assertNodeType)("TSTypeParameterInstantiation"),optional:!0}})});Ie("ClassProperty",Object.assign({visitor:["decorators","variance","key","typeAnnotation","value"],builder:["key","value","typeAnnotation","decorators","computed","static"],aliases:["Property"]},Nf(),{fields:Object.assign({},o_(),{value:{validate:(0,q.assertNodeType)("Expression"),optional:!0},definite:{validate:(0,q.assertValueType)("boolean"),optional:!0},typeAnnotation:{validate:(0,q.assertNodeType)("TypeAnnotation","TSTypeAnnotation","Noop"),optional:!0},decorators:{validate:(0,q.arrayOfType)("Decorator"),optional:!0},readonly:{validate:(0,q.assertValueType)("boolean"),optional:!0},declare:{validate:(0,q.assertValueType)("boolean"),optional:!0},variance:{validate:(0,q.assertNodeType)("Variance"),optional:!0}})}));Ie("ClassAccessorProperty",Object.assign({visitor:["decorators","key","typeAnnotation","value"],builder:["key","value","typeAnnotation","decorators","computed","static"],aliases:["Property","Accessor"]},Nf(!0),{fields:Object.assign({},o_(),{key:{validate:(0,q.chain)(function(){let e=(0,q.assertNodeType)("Identifier","StringLiteral","NumericLiteral","BigIntLiteral","PrivateName"),t=(0,q.assertNodeType)("Expression");return function(r,n,s){(r.computed?t:e)(r,n,s)}}(),(0,q.assertNodeType)("Identifier","StringLiteral","NumericLiteral","BigIntLiteral","Expression","PrivateName"))},value:{validate:(0,q.assertNodeType)("Expression"),optional:!0},definite:{validate:(0,q.assertValueType)("boolean"),optional:!0},typeAnnotation:{validate:(0,q.assertNodeType)("TypeAnnotation","TSTypeAnnotation","Noop"),optional:!0},decorators:{validate:(0,q.arrayOfType)("Decorator"),optional:!0},readonly:{validate:(0,q.assertValueType)("boolean"),optional:!0},declare:{validate:(0,q.assertValueType)("boolean"),optional:!0},variance:{validate:(0,q.assertNodeType)("Variance"),optional:!0}})}));Ie("ClassPrivateProperty",{visitor:["decorators","variance","key","typeAnnotation","value"],builder:["key","value","decorators","static"],aliases:["Property","Private"],fields:{key:{validate:(0,q.assertNodeType)("PrivateName")},value:{validate:(0,q.assertNodeType)("Expression"),optional:!0},typeAnnotation:{validate:(0,q.assertNodeType)("TypeAnnotation","TSTypeAnnotation","Noop"),optional:!0},decorators:{validate:(0,q.arrayOfType)("Decorator"),optional:!0},static:{validate:(0,q.assertValueType)("boolean"),default:!1},readonly:{validate:(0,q.assertValueType)("boolean"),optional:!0},optional:{validate:(0,q.assertValueType)("boolean"),optional:!0},definite:{validate:(0,q.assertValueType)("boolean"),optional:!0},variance:{validate:(0,q.assertNodeType)("Variance"),optional:!0}}});Ie("ClassPrivateMethod",{builder:["kind","key","params","body","static"],visitor:["decorators","key","typeParameters","params","returnType","body"],aliases:["Function","Scopable","BlockParent","FunctionParent","Method","Private"],fields:Object.assign({},gI(),Ec(),{kind:{validate:(0,q.assertOneOf)("get","set","method"),default:"method"},key:{validate:(0,q.assertNodeType)("PrivateName")},body:{validate:(0,q.assertNodeType)("BlockStatement")}})});Ie("PrivateName",{visitor:["id"],aliases:["Private"],fields:{id:{validate:(0,q.assertNodeType)("Identifier")}}});Ie("StaticBlock",{visitor:["body"],fields:{body:(0,q.validateArrayOfType)("Statement")},aliases:["Scopable","BlockParent","FunctionParent"]});Ie("ImportAttribute",{visitor:["key","value"],fields:{key:{validate:(0,q.assertNodeType)("Identifier","StringLiteral")},value:{validate:(0,q.assertNodeType)("StringLiteral")}}})});var sj=G(()=>{"use strict";var ij=Of(),ie=Gs(),We=(0,ie.defineAliasedType)("Flow"),yI=e=>{let t=e==="DeclareClass";We(e,{builder:["id","typeParameters","extends","body"],visitor:["id","typeParameters","extends",...t?["mixins","implements"]:[],"body"],aliases:["FlowDeclaration","Statement","Declaration"],fields:Object.assign({id:(0,ie.validateType)("Identifier"),typeParameters:(0,ie.validateOptionalType)("TypeParameterDeclaration"),extends:(0,ie.validateOptional)((0,ie.arrayOfType)("InterfaceExtends"))},t?{mixins:(0,ie.validateOptional)((0,ie.arrayOfType)("InterfaceExtends")),implements:(0,ie.validateOptional)((0,ie.arrayOfType)("ClassImplements"))}:{},{body:(0,ie.validateType)("ObjectTypeAnnotation")})})};We("AnyTypeAnnotation",{aliases:["FlowType","FlowBaseAnnotation"]});We("ArrayTypeAnnotation",{visitor:["elementType"],aliases:["FlowType"],fields:{elementType:(0,ie.validateType)("FlowType")}});We("BooleanTypeAnnotation",{aliases:["FlowType","FlowBaseAnnotation"]});We("BooleanLiteralTypeAnnotation",{builder:["value"],aliases:["FlowType"],fields:{value:(0,ie.validate)((0,ie.assertValueType)("boolean"))}});We("NullLiteralTypeAnnotation",{aliases:["FlowType","FlowBaseAnnotation"]});We("ClassImplements",{visitor:["id","typeParameters"],fields:{id:(0,ie.validateType)("Identifier"),typeParameters:(0,ie.validateOptionalType)("TypeParameterInstantiation")}});yI("DeclareClass");We("DeclareFunction",{builder:["id"],visitor:["id","predicate"],aliases:["FlowDeclaration","Statement","Declaration"],fields:{id:(0,ie.validateType)("Identifier"),predicate:(0,ie.validateOptionalType)("DeclaredPredicate")}});yI("DeclareInterface");We("DeclareModule",{builder:["id","body","kind"],visitor:["id","body"],aliases:["FlowDeclaration","Statement","Declaration"],fields:{id:(0,ie.validateType)("Identifier","StringLiteral"),body:(0,ie.validateType)("BlockStatement"),kind:(0,ie.validateOptional)((0,ie.assertOneOf)("CommonJS","ES"))}});We("DeclareModuleExports",{visitor:["typeAnnotation"],aliases:["FlowDeclaration","Statement","Declaration"],fields:{typeAnnotation:(0,ie.validateType)("TypeAnnotation")}});We("DeclareTypeAlias",{visitor:["id","typeParameters","right"],aliases:["FlowDeclaration","Statement","Declaration"],fields:{id:(0,ie.validateType)("Identifier"),typeParameters:(0,ie.validateOptionalType)("TypeParameterDeclaration"),right:(0,ie.validateType)("FlowType")}});We("DeclareOpaqueType",{visitor:["id","typeParameters","supertype"],aliases:["FlowDeclaration","Statement","Declaration"],fields:{id:(0,ie.validateType)("Identifier"),typeParameters:(0,ie.validateOptionalType)("TypeParameterDeclaration"),supertype:(0,ie.validateOptionalType)("FlowType"),impltype:(0,ie.validateOptionalType)("FlowType")}});We("DeclareVariable",{visitor:["id"],aliases:["FlowDeclaration","Statement","Declaration"],fields:{id:(0,ie.validateType)("Identifier")}});We("DeclareExportDeclaration",{visitor:["declaration","specifiers","source","attributes"],aliases:["FlowDeclaration","Statement","Declaration"],fields:Object.assign({declaration:(0,ie.validateOptionalType)("Flow"),specifiers:(0,ie.validateOptional)((0,ie.arrayOfType)("ExportSpecifier","ExportNamespaceSpecifier")),source:(0,ie.validateOptionalType)("StringLiteral"),default:(0,ie.validateOptional)((0,ie.assertValueType)("boolean"))},ij.importAttributes)});We("DeclareExportAllDeclaration",{visitor:["source","attributes"],aliases:["FlowDeclaration","Statement","Declaration"],fields:Object.assign({source:(0,ie.validateType)("StringLiteral"),exportKind:(0,ie.validateOptional)((0,ie.assertOneOf)("type","value"))},ij.importAttributes)});We("DeclaredPredicate",{visitor:["value"],aliases:["FlowPredicate"],fields:{value:(0,ie.validateType)("Flow")}});We("ExistsTypeAnnotation",{aliases:["FlowType"]});We("FunctionTypeAnnotation",{builder:["typeParameters","params","rest","returnType"],visitor:["typeParameters","this","params","rest","returnType"],aliases:["FlowType"],fields:{typeParameters:(0,ie.validateOptionalType)("TypeParameterDeclaration"),params:(0,ie.validateArrayOfType)("FunctionTypeParam"),rest:(0,ie.validateOptionalType)("FunctionTypeParam"),this:(0,ie.validateOptionalType)("FunctionTypeParam"),returnType:(0,ie.validateType)("FlowType")}});We("FunctionTypeParam",{visitor:["name","typeAnnotation"],fields:{name:(0,ie.validateOptionalType)("Identifier"),typeAnnotation:(0,ie.validateType)("FlowType"),optional:(0,ie.validateOptional)((0,ie.assertValueType)("boolean"))}});We("GenericTypeAnnotation",{visitor:["id","typeParameters"],aliases:["FlowType"],fields:{id:(0,ie.validateType)("Identifier","QualifiedTypeIdentifier"),typeParameters:(0,ie.validateOptionalType)("TypeParameterInstantiation")}});We("InferredPredicate",{aliases:["FlowPredicate"]});We("InterfaceExtends",{visitor:["id","typeParameters"],fields:{id:(0,ie.validateType)("Identifier","QualifiedTypeIdentifier"),typeParameters:(0,ie.validateOptionalType)("TypeParameterInstantiation")}});yI("InterfaceDeclaration");We("InterfaceTypeAnnotation",{visitor:["extends","body"],aliases:["FlowType"],fields:{extends:(0,ie.validateOptional)((0,ie.arrayOfType)("InterfaceExtends")),body:(0,ie.validateType)("ObjectTypeAnnotation")}});We("IntersectionTypeAnnotation",{visitor:["types"],aliases:["FlowType"],fields:{types:(0,ie.validate)((0,ie.arrayOfType)("FlowType"))}});We("MixedTypeAnnotation",{aliases:["FlowType","FlowBaseAnnotation"]});We("EmptyTypeAnnotation",{aliases:["FlowType","FlowBaseAnnotation"]});We("NullableTypeAnnotation",{visitor:["typeAnnotation"],aliases:["FlowType"],fields:{typeAnnotation:(0,ie.validateType)("FlowType")}});We("NumberLiteralTypeAnnotation",{builder:["value"],aliases:["FlowType"],fields:{value:(0,ie.validate)((0,ie.assertValueType)("number"))}});We("NumberTypeAnnotation",{aliases:["FlowType","FlowBaseAnnotation"]});We("ObjectTypeAnnotation",{visitor:["properties","indexers","callProperties","internalSlots"],aliases:["FlowType"],builder:["properties","indexers","callProperties","internalSlots","exact"],fields:{properties:(0,ie.validate)((0,ie.arrayOfType)("ObjectTypeProperty","ObjectTypeSpreadProperty")),indexers:{validate:(0,ie.arrayOfType)("ObjectTypeIndexer"),optional:!0,default:[]},callProperties:{validate:(0,ie.arrayOfType)("ObjectTypeCallProperty"),optional:!0,default:[]},internalSlots:{validate:(0,ie.arrayOfType)("ObjectTypeInternalSlot"),optional:!0,default:[]},exact:{validate:(0,ie.assertValueType)("boolean"),default:!1},inexact:(0,ie.validateOptional)((0,ie.assertValueType)("boolean"))}});We("ObjectTypeInternalSlot",{visitor:["id","value"],builder:["id","value","optional","static","method"],aliases:["UserWhitespacable"],fields:{id:(0,ie.validateType)("Identifier"),value:(0,ie.validateType)("FlowType"),optional:(0,ie.validate)((0,ie.assertValueType)("boolean")),static:(0,ie.validate)((0,ie.assertValueType)("boolean")),method:(0,ie.validate)((0,ie.assertValueType)("boolean"))}});We("ObjectTypeCallProperty",{visitor:["value"],aliases:["UserWhitespacable"],fields:{value:(0,ie.validateType)("FlowType"),static:(0,ie.validate)((0,ie.assertValueType)("boolean"))}});We("ObjectTypeIndexer",{visitor:["variance","id","key","value"],builder:["id","key","value","variance"],aliases:["UserWhitespacable"],fields:{id:(0,ie.validateOptionalType)("Identifier"),key:(0,ie.validateType)("FlowType"),value:(0,ie.validateType)("FlowType"),static:(0,ie.validate)((0,ie.assertValueType)("boolean")),variance:(0,ie.validateOptionalType)("Variance")}});We("ObjectTypeProperty",{visitor:["key","value","variance"],aliases:["UserWhitespacable"],fields:{key:(0,ie.validateType)("Identifier","StringLiteral"),value:(0,ie.validateType)("FlowType"),kind:(0,ie.validate)((0,ie.assertOneOf)("init","get","set")),static:(0,ie.validate)((0,ie.assertValueType)("boolean")),proto:(0,ie.validate)((0,ie.assertValueType)("boolean")),optional:(0,ie.validate)((0,ie.assertValueType)("boolean")),variance:(0,ie.validateOptionalType)("Variance"),method:(0,ie.validate)((0,ie.assertValueType)("boolean"))}});We("ObjectTypeSpreadProperty",{visitor:["argument"],aliases:["UserWhitespacable"],fields:{argument:(0,ie.validateType)("FlowType")}});We("OpaqueType",{visitor:["id","typeParameters","supertype","impltype"],aliases:["FlowDeclaration","Statement","Declaration"],fields:{id:(0,ie.validateType)("Identifier"),typeParameters:(0,ie.validateOptionalType)("TypeParameterDeclaration"),supertype:(0,ie.validateOptionalType)("FlowType"),impltype:(0,ie.validateType)("FlowType")}});We("QualifiedTypeIdentifier",{visitor:["qualification","id"],builder:["id","qualification"],fields:{id:(0,ie.validateType)("Identifier"),qualification:(0,ie.validateType)("Identifier","QualifiedTypeIdentifier")}});We("StringLiteralTypeAnnotation",{builder:["value"],aliases:["FlowType"],fields:{value:(0,ie.validate)((0,ie.assertValueType)("string"))}});We("StringTypeAnnotation",{aliases:["FlowType","FlowBaseAnnotation"]});We("SymbolTypeAnnotation",{aliases:["FlowType","FlowBaseAnnotation"]});We("ThisTypeAnnotation",{aliases:["FlowType","FlowBaseAnnotation"]});We("TupleTypeAnnotation",{visitor:["types"],aliases:["FlowType"],fields:{types:(0,ie.validate)((0,ie.arrayOfType)("FlowType"))}});We("TypeofTypeAnnotation",{visitor:["argument"],aliases:["FlowType"],fields:{argument:(0,ie.validateType)("FlowType")}});We("TypeAlias",{visitor:["id","typeParameters","right"],aliases:["FlowDeclaration","Statement","Declaration"],fields:{id:(0,ie.validateType)("Identifier"),typeParameters:(0,ie.validateOptionalType)("TypeParameterDeclaration"),right:(0,ie.validateType)("FlowType")}});We("TypeAnnotation",{visitor:["typeAnnotation"],fields:{typeAnnotation:(0,ie.validateType)("FlowType")}});We("TypeCastExpression",{visitor:["expression","typeAnnotation"],aliases:["ExpressionWrapper","Expression"],fields:{expression:(0,ie.validateType)("Expression"),typeAnnotation:(0,ie.validateType)("TypeAnnotation")}});We("TypeParameter",{visitor:["bound","default","variance"],fields:{name:(0,ie.validate)((0,ie.assertValueType)("string")),bound:(0,ie.validateOptionalType)("TypeAnnotation"),default:(0,ie.validateOptionalType)("FlowType"),variance:(0,ie.validateOptionalType)("Variance")}});We("TypeParameterDeclaration",{visitor:["params"],fields:{params:(0,ie.validate)((0,ie.arrayOfType)("TypeParameter"))}});We("TypeParameterInstantiation",{visitor:["params"],fields:{params:(0,ie.validate)((0,ie.arrayOfType)("FlowType"))}});We("UnionTypeAnnotation",{visitor:["types"],aliases:["FlowType"],fields:{types:(0,ie.validate)((0,ie.arrayOfType)("FlowType"))}});We("Variance",{builder:["kind"],fields:{kind:(0,ie.validate)((0,ie.assertOneOf)("minus","plus"))}});We("VoidTypeAnnotation",{aliases:["FlowType","FlowBaseAnnotation"]});We("EnumDeclaration",{aliases:["Statement","Declaration"],visitor:["id","body"],fields:{id:(0,ie.validateType)("Identifier"),body:(0,ie.validateType)("EnumBooleanBody","EnumNumberBody","EnumStringBody","EnumSymbolBody")}});We("EnumBooleanBody",{aliases:["EnumBody"],visitor:["members"],fields:{explicitType:(0,ie.validate)((0,ie.assertValueType)("boolean")),members:(0,ie.validateArrayOfType)("EnumBooleanMember"),hasUnknownMembers:(0,ie.validate)((0,ie.assertValueType)("boolean"))}});We("EnumNumberBody",{aliases:["EnumBody"],visitor:["members"],fields:{explicitType:(0,ie.validate)((0,ie.assertValueType)("boolean")),members:(0,ie.validateArrayOfType)("EnumNumberMember"),hasUnknownMembers:(0,ie.validate)((0,ie.assertValueType)("boolean"))}});We("EnumStringBody",{aliases:["EnumBody"],visitor:["members"],fields:{explicitType:(0,ie.validate)((0,ie.assertValueType)("boolean")),members:(0,ie.validateArrayOfType)("EnumStringMember","EnumDefaultedMember"),hasUnknownMembers:(0,ie.validate)((0,ie.assertValueType)("boolean"))}});We("EnumSymbolBody",{aliases:["EnumBody"],visitor:["members"],fields:{members:(0,ie.validateArrayOfType)("EnumDefaultedMember"),hasUnknownMembers:(0,ie.validate)((0,ie.assertValueType)("boolean"))}});We("EnumBooleanMember",{aliases:["EnumMember"],builder:["id"],visitor:["id","init"],fields:{id:(0,ie.validateType)("Identifier"),init:(0,ie.validateType)("BooleanLiteral")}});We("EnumNumberMember",{aliases:["EnumMember"],visitor:["id","init"],fields:{id:(0,ie.validateType)("Identifier"),init:(0,ie.validateType)("NumericLiteral")}});We("EnumStringMember",{aliases:["EnumMember"],visitor:["id","init"],fields:{id:(0,ie.validateType)("Identifier"),init:(0,ie.validateType)("StringLiteral")}});We("EnumDefaultedMember",{aliases:["EnumMember"],visitor:["id"],fields:{id:(0,ie.validateType)("Identifier")}});We("IndexedAccessType",{visitor:["objectType","indexType"],aliases:["FlowType"],fields:{objectType:(0,ie.validateType)("FlowType"),indexType:(0,ie.validateType)("FlowType")}});We("OptionalIndexedAccessType",{visitor:["objectType","indexType"],aliases:["FlowType"],fields:{objectType:(0,ie.validateType)("FlowType"),indexType:(0,ie.validateType)("FlowType"),optional:(0,ie.validate)((0,ie.assertValueType)("boolean"))}})});var aj=G(()=>{"use strict";var Mr=Gs(),Xn=(0,Mr.defineAliasedType)("JSX");Xn("JSXAttribute",{visitor:["name","value"],aliases:["Immutable"],fields:{name:{validate:(0,Mr.assertNodeType)("JSXIdentifier","JSXNamespacedName")},value:{optional:!0,validate:(0,Mr.assertNodeType)("JSXElement","JSXFragment","StringLiteral","JSXExpressionContainer")}}});Xn("JSXClosingElement",{visitor:["name"],aliases:["Immutable"],fields:{name:{validate:(0,Mr.assertNodeType)("JSXIdentifier","JSXMemberExpression","JSXNamespacedName")}}});Xn("JSXElement",{builder:["openingElement","closingElement","children","selfClosing"],visitor:["openingElement","children","closingElement"],aliases:["Immutable","Expression"],fields:Object.assign({openingElement:{validate:(0,Mr.assertNodeType)("JSXOpeningElement")},closingElement:{optional:!0,validate:(0,Mr.assertNodeType)("JSXClosingElement")},children:(0,Mr.validateArrayOfType)("JSXText","JSXExpressionContainer","JSXSpreadChild","JSXElement","JSXFragment")},{selfClosing:{validate:(0,Mr.assertValueType)("boolean"),optional:!0}})});Xn("JSXEmptyExpression",{});Xn("JSXExpressionContainer",{visitor:["expression"],aliases:["Immutable"],fields:{expression:{validate:(0,Mr.assertNodeType)("Expression","JSXEmptyExpression")}}});Xn("JSXSpreadChild",{visitor:["expression"],aliases:["Immutable"],fields:{expression:{validate:(0,Mr.assertNodeType)("Expression")}}});Xn("JSXIdentifier",{builder:["name"],fields:{name:{validate:(0,Mr.assertValueType)("string")}}});Xn("JSXMemberExpression",{visitor:["object","property"],fields:{object:{validate:(0,Mr.assertNodeType)("JSXMemberExpression","JSXIdentifier")},property:{validate:(0,Mr.assertNodeType)("JSXIdentifier")}}});Xn("JSXNamespacedName",{visitor:["namespace","name"],fields:{namespace:{validate:(0,Mr.assertNodeType)("JSXIdentifier")},name:{validate:(0,Mr.assertNodeType)("JSXIdentifier")}}});Xn("JSXOpeningElement",{builder:["name","attributes","selfClosing"],visitor:["name","typeParameters","typeArguments","attributes"],aliases:["Immutable"],fields:Object.assign({name:{validate:(0,Mr.assertNodeType)("JSXIdentifier","JSXMemberExpression","JSXNamespacedName")},selfClosing:{default:!1},attributes:(0,Mr.validateArrayOfType)("JSXAttribute","JSXSpreadAttribute"),typeArguments:{validate:(0,Mr.assertNodeType)("TypeParameterInstantiation"),optional:!0}},{typeParameters:{validate:(0,Mr.assertNodeType)("TSTypeParameterInstantiation"),optional:!0}})});Xn("JSXSpreadAttribute",{visitor:["argument"],fields:{argument:{validate:(0,Mr.assertNodeType)("Expression")}}});Xn("JSXText",{aliases:["Immutable"],builder:["value"],fields:{value:{validate:(0,Mr.assertValueType)("string")}}});Xn("JSXFragment",{builder:["openingFragment","closingFragment","children"],visitor:["openingFragment","children","closingFragment"],aliases:["Immutable","Expression"],fields:{openingFragment:{validate:(0,Mr.assertNodeType)("JSXOpeningFragment")},closingFragment:{validate:(0,Mr.assertNodeType)("JSXClosingFragment")},children:(0,Mr.validateArrayOfType)("JSXText","JSXExpressionContainer","JSXSpreadChild","JSXElement","JSXFragment")}});Xn("JSXOpeningFragment",{aliases:["Immutable"]});Xn("JSXClosingFragment",{aliases:["Immutable"]})});var vI=G(bo=>{"use strict";Object.defineProperty(bo,"__esModule",{value:!0});bo.PLACEHOLDERS_FLIPPED_ALIAS=bo.PLACEHOLDERS_ALIAS=bo.PLACEHOLDERS=void 0;var kle=Gs(),Cle=bo.PLACEHOLDERS=["Identifier","StringLiteral","Expression","Statement","Declaration","BlockStatement","ClassBody","Pattern"],bI=bo.PLACEHOLDERS_ALIAS={Declaration:["Statement"],Pattern:["PatternLike","LVal"]};for(let e of Cle){let t=kle.ALIAS_KEYS[e];t!=null&&t.length&&(bI[e]=t)}var _I=bo.PLACEHOLDERS_FLIPPED_ALIAS={};Object.keys(bI).forEach(e=>{bI[e].forEach(t=>{hasOwnProperty.call(_I,t)||(_I[t]=[]),_I[t].push(e)})})});var oj=G(()=>{"use strict";var c_=Gs(),Nle=vI(),Ole=Of(),xI=(0,c_.defineAliasedType)("Miscellaneous");xI("Noop",{visitor:[]});xI("Placeholder",{visitor:[],builder:["expectedNode","name"],fields:Object.assign({name:{validate:(0,c_.assertNodeType)("Identifier")},expectedNode:{validate:(0,c_.assertOneOf)(...Nle.PLACEHOLDERS)}},(0,Ole.patternLikeCommon)())});xI("V8IntrinsicIdentifier",{builder:["name"],fields:{name:{validate:(0,c_.assertValueType)("string")}}})});var cj=G(()=>{"use strict";var Er=Gs();(0,Er.default)("ArgumentPlaceholder",{});(0,Er.default)("BindExpression",{visitor:["object","callee"],aliases:["Expression"],fields:process.env.BABEL_TYPES_8_BREAKING?{object:{validate:(0,Er.assertNodeType)("Expression")},callee:{validate:(0,Er.assertNodeType)("Expression")}}:{object:{validate:Object.assign(()=>{},{oneOfNodeTypes:["Expression"]})},callee:{validate:Object.assign(()=>{},{oneOfNodeTypes:["Expression"]})}}});(0,Er.default)("Decorator",{visitor:["expression"],fields:{expression:{validate:(0,Er.assertNodeType)("Expression")}}});(0,Er.default)("DoExpression",{visitor:["body"],builder:["body","async"],aliases:["Expression"],fields:{body:{validate:(0,Er.assertNodeType)("BlockStatement")},async:{validate:(0,Er.assertValueType)("boolean"),default:!1}}});(0,Er.default)("ExportDefaultSpecifier",{visitor:["exported"],aliases:["ModuleSpecifier"],fields:{exported:{validate:(0,Er.assertNodeType)("Identifier")}}});(0,Er.default)("RecordExpression",{visitor:["properties"],aliases:["Expression"],fields:{properties:(0,Er.validateArrayOfType)("ObjectProperty","SpreadElement")}});(0,Er.default)("TupleExpression",{fields:{elements:{validate:(0,Er.arrayOfType)("Expression","SpreadElement"),default:[]}},visitor:["elements"],aliases:["Expression"]});(0,Er.default)("DecimalLiteral",{builder:["value"],fields:{value:{validate:(0,Er.assertValueType)("string")}},aliases:["Expression","Pureish","Literal","Immutable"]});(0,Er.default)("ModuleExpression",{visitor:["body"],fields:{body:{validate:(0,Er.assertNodeType)("Program")}},aliases:["Expression"]});(0,Er.default)("TopicReference",{aliases:["Expression"]});(0,Er.default)("PipelineTopicExpression",{builder:["expression"],visitor:["expression"],fields:{expression:{validate:(0,Er.assertNodeType)("Expression")}},aliases:["Expression"]});(0,Er.default)("PipelineBareFunction",{builder:["callee"],visitor:["callee"],fields:{callee:{validate:(0,Er.assertNodeType)("Expression")}},aliases:["Expression"]});(0,Er.default)("PipelinePrimaryTopicReference",{aliases:["Expression"]});(0,Er.default)("VoidPattern",{aliases:["Pattern","PatternLike","FunctionParameter"]})});var mj=G(()=>{"use strict";var de=Gs(),SI=Of(),$le=Su(),at=(0,de.defineAliasedType)("TypeScript"),pi=(0,de.assertValueType)("boolean"),lj=()=>({returnType:{validate:(0,de.assertNodeType)("TSTypeAnnotation","Noop"),optional:!0},typeParameters:{validate:(0,de.assertNodeType)("TSTypeParameterDeclaration","Noop"),optional:!0}});at("TSParameterProperty",{aliases:["LVal"],visitor:["parameter"],fields:{accessibility:{validate:(0,de.assertOneOf)("public","private","protected"),optional:!0},readonly:{validate:(0,de.assertValueType)("boolean"),optional:!0},parameter:{validate:(0,de.assertNodeType)("Identifier","AssignmentPattern")},override:{validate:(0,de.assertValueType)("boolean"),optional:!0},decorators:{validate:(0,de.arrayOfType)("Decorator"),optional:!0}}});at("TSDeclareFunction",{aliases:["Statement","Declaration"],visitor:["id","typeParameters","params","returnType"],fields:Object.assign({},(0,SI.functionDeclarationCommon)(),lj())});at("TSDeclareMethod",Object.assign({visitor:["decorators","key","typeParameters","params","returnType"]},(0,SI.classMethodOrPropertyUnionShapeCommon)(),{fields:Object.assign({},(0,SI.classMethodOrDeclareMethodCommon)(),lj())}));at("TSQualifiedName",{aliases:["TSEntityName"],visitor:["left","right"],fields:{left:(0,de.validateType)("TSEntityName"),right:(0,de.validateType)("Identifier")}});var l_=()=>({typeParameters:(0,de.validateOptionalType)("TSTypeParameterDeclaration"),parameters:(0,de.validateArrayOfType)("ArrayPattern","Identifier","ObjectPattern","RestElement"),typeAnnotation:(0,de.validateOptionalType)("TSTypeAnnotation")}),uj={aliases:["TSTypeElement"],visitor:["typeParameters","parameters","typeAnnotation"],fields:l_()};at("TSCallSignatureDeclaration",uj);at("TSConstructSignatureDeclaration",uj);var dj=()=>({key:(0,de.validateType)("Expression"),computed:{default:!1},optional:(0,de.validateOptional)(pi)});at("TSPropertySignature",{aliases:["TSTypeElement"],visitor:["key","typeAnnotation"],fields:Object.assign({},dj(),{readonly:(0,de.validateOptional)(pi),typeAnnotation:(0,de.validateOptionalType)("TSTypeAnnotation"),kind:{optional:!0,validate:(0,de.assertOneOf)("get","set")}})});at("TSMethodSignature",{aliases:["TSTypeElement"],visitor:["key","typeParameters","parameters","typeAnnotation"],fields:Object.assign({},l_(),dj(),{kind:{validate:(0,de.assertOneOf)("method","get","set")}})});at("TSIndexSignature",{aliases:["TSTypeElement"],visitor:["parameters","typeAnnotation"],fields:{readonly:(0,de.validateOptional)(pi),static:(0,de.validateOptional)(pi),parameters:(0,de.validateArrayOfType)("Identifier"),typeAnnotation:(0,de.validateOptionalType)("TSTypeAnnotation")}});var Rle=["TSAnyKeyword","TSBooleanKeyword","TSBigIntKeyword","TSIntrinsicKeyword","TSNeverKeyword","TSNullKeyword","TSNumberKeyword","TSObjectKeyword","TSStringKeyword","TSSymbolKeyword","TSUndefinedKeyword","TSUnknownKeyword","TSVoidKeyword"];for(let e of Rle)at(e,{aliases:["TSType","TSBaseType"],visitor:[],fields:{}});at("TSThisType",{aliases:["TSType","TSBaseType"],visitor:[],fields:{}});var pj={aliases:["TSType"],visitor:["typeParameters","parameters","typeAnnotation"]};at("TSFunctionType",Object.assign({},pj,{fields:l_()}));at("TSConstructorType",Object.assign({},pj,{fields:Object.assign({},l_(),{abstract:(0,de.validateOptional)(pi)})}));at("TSTypeReference",{aliases:["TSType"],visitor:["typeName","typeParameters"],fields:{typeName:(0,de.validateType)("TSEntityName"),typeParameters:(0,de.validateOptionalType)("TSTypeParameterInstantiation")}});at("TSTypePredicate",{aliases:["TSType"],visitor:["parameterName","typeAnnotation"],builder:["parameterName","typeAnnotation","asserts"],fields:{parameterName:(0,de.validateType)("Identifier","TSThisType"),typeAnnotation:(0,de.validateOptionalType)("TSTypeAnnotation"),asserts:(0,de.validateOptional)(pi)}});at("TSTypeQuery",{aliases:["TSType"],visitor:["exprName","typeParameters"],fields:{exprName:(0,de.validateType)("TSEntityName","TSImportType"),typeParameters:(0,de.validateOptionalType)("TSTypeParameterInstantiation")}});at("TSTypeLiteral",{aliases:["TSType"],visitor:["members"],fields:{members:(0,de.validateArrayOfType)("TSTypeElement")}});at("TSArrayType",{aliases:["TSType"],visitor:["elementType"],fields:{elementType:(0,de.validateType)("TSType")}});at("TSTupleType",{aliases:["TSType"],visitor:["elementTypes"],fields:{elementTypes:(0,de.validateArrayOfType)("TSType","TSNamedTupleMember")}});at("TSOptionalType",{aliases:["TSType"],visitor:["typeAnnotation"],fields:{typeAnnotation:(0,de.validateType)("TSType")}});at("TSRestType",{aliases:["TSType"],visitor:["typeAnnotation"],fields:{typeAnnotation:(0,de.validateType)("TSType")}});at("TSNamedTupleMember",{visitor:["label","elementType"],builder:["label","elementType","optional"],fields:{label:(0,de.validateType)("Identifier"),optional:{validate:pi,default:!1},elementType:(0,de.validateType)("TSType")}});var fj={aliases:["TSType"],visitor:["types"],fields:{types:(0,de.validateArrayOfType)("TSType")}};at("TSUnionType",fj);at("TSIntersectionType",fj);at("TSConditionalType",{aliases:["TSType"],visitor:["checkType","extendsType","trueType","falseType"],fields:{checkType:(0,de.validateType)("TSType"),extendsType:(0,de.validateType)("TSType"),trueType:(0,de.validateType)("TSType"),falseType:(0,de.validateType)("TSType")}});at("TSInferType",{aliases:["TSType"],visitor:["typeParameter"],fields:{typeParameter:(0,de.validateType)("TSTypeParameter")}});at("TSParenthesizedType",{aliases:["TSType"],visitor:["typeAnnotation"],fields:{typeAnnotation:(0,de.validateType)("TSType")}});at("TSTypeOperator",{aliases:["TSType"],visitor:["typeAnnotation"],builder:["typeAnnotation","operator"],fields:{operator:{validate:(0,de.assertValueType)("string"),default:"keyof"},typeAnnotation:(0,de.validateType)("TSType")}});at("TSIndexedAccessType",{aliases:["TSType"],visitor:["objectType","indexType"],fields:{objectType:(0,de.validateType)("TSType"),indexType:(0,de.validateType)("TSType")}});at("TSMappedType",{aliases:["TSType"],visitor:["typeParameter","nameType","typeAnnotation"],builder:["typeParameter","typeAnnotation","nameType"],fields:Object.assign({},{typeParameter:(0,de.validateType)("TSTypeParameter")},{readonly:(0,de.validateOptional)((0,de.assertOneOf)(!0,!1,"+","-")),optional:(0,de.validateOptional)((0,de.assertOneOf)(!0,!1,"+","-")),typeAnnotation:(0,de.validateOptionalType)("TSType"),nameType:(0,de.validateOptionalType)("TSType")})});at("TSTemplateLiteralType",{aliases:["TSType","TSBaseType"],visitor:["quasis","types"],fields:{quasis:(0,de.validateArrayOfType)("TemplateElement"),types:{validate:(0,de.chain)((0,de.assertValueType)("array"),(0,de.assertEach)((0,de.assertNodeType)("TSType")),function(e,t,r){if(e.quasis.length!==r.length+1)throw new TypeError(`Number of ${e.type} quasis should be exactly one more than the number of types.
|
|
30
|
-
Expected ${r.length+1} quasis but got ${e.quasis.length}`)})}}});at("TSLiteralType",{aliases:["TSType","TSBaseType"],visitor:["literal"],fields:{literal:{validate:function(){let e=(0,de.assertNodeType)("NumericLiteral","BigIntLiteral"),t=(0,de.assertOneOf)("-"),r=(0,de.assertNodeType)("NumericLiteral","StringLiteral","BooleanLiteral","BigIntLiteral","TemplateLiteral"),n=function(a,o,c){(0,$le.default)("UnaryExpression",c)?(t(c,"operator",c.operator),e(c,"argument",c.argument)):r(a,o,c)};return n.oneOfNodeTypes=["NumericLiteral","StringLiteral","BooleanLiteral","BigIntLiteral","TemplateLiteral","UnaryExpression"],n}()}}});at("TSExpressionWithTypeArguments",{aliases:["TSType"],visitor:["expression","typeParameters"],fields:{expression:(0,de.validateType)("TSEntityName"),typeParameters:(0,de.validateOptionalType)("TSTypeParameterInstantiation")}});at("TSInterfaceDeclaration",{aliases:["Statement","Declaration"],visitor:["id","typeParameters","extends","body"],fields:{declare:(0,de.validateOptional)(pi),id:(0,de.validateType)("Identifier"),typeParameters:(0,de.validateOptionalType)("TSTypeParameterDeclaration"),extends:(0,de.validateOptional)((0,de.arrayOfType)("TSExpressionWithTypeArguments")),body:(0,de.validateType)("TSInterfaceBody")}});at("TSInterfaceBody",{visitor:["body"],fields:{body:(0,de.validateArrayOfType)("TSTypeElement")}});at("TSTypeAliasDeclaration",{aliases:["Statement","Declaration"],visitor:["id","typeParameters","typeAnnotation"],fields:{declare:(0,de.validateOptional)(pi),id:(0,de.validateType)("Identifier"),typeParameters:(0,de.validateOptionalType)("TSTypeParameterDeclaration"),typeAnnotation:(0,de.validateType)("TSType")}});at("TSInstantiationExpression",{aliases:["Expression"],visitor:["expression","typeParameters"],fields:{expression:(0,de.validateType)("Expression"),typeParameters:(0,de.validateOptionalType)("TSTypeParameterInstantiation")}});var hj={aliases:["Expression","LVal","PatternLike"],visitor:["expression","typeAnnotation"],fields:{expression:(0,de.validateType)("Expression"),typeAnnotation:(0,de.validateType)("TSType")}};at("TSAsExpression",hj);at("TSSatisfiesExpression",hj);at("TSTypeAssertion",{aliases:["Expression","LVal","PatternLike"],visitor:["typeAnnotation","expression"],fields:{typeAnnotation:(0,de.validateType)("TSType"),expression:(0,de.validateType)("Expression")}});at("TSEnumBody",{visitor:["members"],fields:{members:(0,de.validateArrayOfType)("TSEnumMember")}});at("TSEnumDeclaration",{aliases:["Statement","Declaration"],visitor:["id","members"],fields:{declare:(0,de.validateOptional)(pi),const:(0,de.validateOptional)(pi),id:(0,de.validateType)("Identifier"),members:(0,de.validateArrayOfType)("TSEnumMember"),initializer:(0,de.validateOptionalType)("Expression"),body:(0,de.validateOptionalType)("TSEnumBody")}});at("TSEnumMember",{visitor:["id","initializer"],fields:{id:(0,de.validateType)("Identifier","StringLiteral"),initializer:(0,de.validateOptionalType)("Expression")}});at("TSModuleDeclaration",{aliases:["Statement","Declaration"],visitor:["id","body"],fields:Object.assign({kind:{validate:(0,de.assertOneOf)("global","module","namespace")},declare:(0,de.validateOptional)(pi)},{global:(0,de.validateOptional)(pi)},{id:(0,de.validateType)("Identifier","StringLiteral"),body:(0,de.validateType)("TSModuleBlock","TSModuleDeclaration")})});at("TSModuleBlock",{aliases:["Scopable","Block","BlockParent","FunctionParent"],visitor:["body"],fields:{body:(0,de.validateArrayOfType)("Statement")}});at("TSImportType",{aliases:["TSType"],builder:["argument","qualifier","typeParameters"],visitor:["argument","options","qualifier","typeParameters"],fields:Object.assign({},{argument:(0,de.validateType)("StringLiteral")},{qualifier:(0,de.validateOptionalType)("TSEntityName")},{typeParameters:(0,de.validateOptionalType)("TSTypeParameterInstantiation")},{options:{validate:(0,de.assertNodeType)("ObjectExpression"),optional:!0}})});at("TSImportEqualsDeclaration",{aliases:["Statement","Declaration"],visitor:["id","moduleReference"],fields:Object.assign({},{isExport:(0,de.validate)(pi)},{id:(0,de.validateType)("Identifier"),moduleReference:(0,de.validateType)("TSEntityName","TSExternalModuleReference"),importKind:{validate:(0,de.assertOneOf)("type","value"),optional:!0}})});at("TSExternalModuleReference",{visitor:["expression"],fields:{expression:(0,de.validateType)("StringLiteral")}});at("TSNonNullExpression",{aliases:["Expression","LVal","PatternLike"],visitor:["expression"],fields:{expression:(0,de.validateType)("Expression")}});at("TSExportAssignment",{aliases:["Statement"],visitor:["expression"],fields:{expression:(0,de.validateType)("Expression")}});at("TSNamespaceExportDeclaration",{aliases:["Statement"],visitor:["id"],fields:{id:(0,de.validateType)("Identifier")}});at("TSTypeAnnotation",{visitor:["typeAnnotation"],fields:{typeAnnotation:{validate:(0,de.assertNodeType)("TSType")}}});at("TSTypeParameterInstantiation",{visitor:["params"],fields:{params:(0,de.validateArrayOfType)("TSType")}});at("TSTypeParameterDeclaration",{visitor:["params"],fields:{params:(0,de.validateArrayOfType)("TSTypeParameter")}});at("TSTypeParameter",{builder:["constraint","default","name"],visitor:["constraint","default"],fields:{name:{validate:(0,de.assertValueType)("string")},in:{validate:(0,de.assertValueType)("boolean"),optional:!0},out:{validate:(0,de.assertValueType)("boolean"),optional:!0},const:{validate:(0,de.assertValueType)("boolean"),optional:!0},constraint:{validate:(0,de.assertNodeType)("TSType"),optional:!0},default:{validate:(0,de.assertNodeType)("TSType"),optional:!0}}})});var gj=G(u_=>{"use strict";Object.defineProperty(u_,"__esModule",{value:!0});u_.DEPRECATED_ALIASES=void 0;var wXe=u_.DEPRECATED_ALIASES={ModuleDeclaration:"ImportOrExportDeclaration"}});var Wi=G(Mn=>{"use strict";Object.defineProperty(Mn,"__esModule",{value:!0});Object.defineProperty(Mn,"ALIAS_KEYS",{enumerable:!0,get:function(){return Qn.ALIAS_KEYS}});Object.defineProperty(Mn,"BUILDER_KEYS",{enumerable:!0,get:function(){return Qn.BUILDER_KEYS}});Object.defineProperty(Mn,"DEPRECATED_ALIASES",{enumerable:!0,get:function(){return TI.DEPRECATED_ALIASES}});Object.defineProperty(Mn,"DEPRECATED_KEYS",{enumerable:!0,get:function(){return Qn.DEPRECATED_KEYS}});Object.defineProperty(Mn,"FLIPPED_ALIAS_KEYS",{enumerable:!0,get:function(){return Qn.FLIPPED_ALIAS_KEYS}});Object.defineProperty(Mn,"NODE_FIELDS",{enumerable:!0,get:function(){return Qn.NODE_FIELDS}});Object.defineProperty(Mn,"NODE_PARENT_VALIDATIONS",{enumerable:!0,get:function(){return Qn.NODE_PARENT_VALIDATIONS}});Object.defineProperty(Mn,"NODE_UNION_SHAPES__PRIVATE",{enumerable:!0,get:function(){return Qn.NODE_UNION_SHAPES__PRIVATE}});Object.defineProperty(Mn,"PLACEHOLDERS",{enumerable:!0,get:function(){return wI.PLACEHOLDERS}});Object.defineProperty(Mn,"PLACEHOLDERS_ALIAS",{enumerable:!0,get:function(){return wI.PLACEHOLDERS_ALIAS}});Object.defineProperty(Mn,"PLACEHOLDERS_FLIPPED_ALIAS",{enumerable:!0,get:function(){return wI.PLACEHOLDERS_FLIPPED_ALIAS}});Mn.TYPES=void 0;Object.defineProperty(Mn,"VISITOR_KEYS",{enumerable:!0,get:function(){return Qn.VISITOR_KEYS}});Of();sj();aj();oj();cj();mj();var Qn=Gs(),wI=vI(),TI=gj();Object.keys(TI.DEPRECATED_ALIASES).forEach(e=>{Qn.FLIPPED_ALIAS_KEYS[e]=Qn.FLIPPED_ALIAS_KEYS[TI.DEPRECATED_ALIASES[e]]});for(let{types:e,set:t}of Qn.allExpandedTypes)for(let r of e){let n=Qn.FLIPPED_ALIAS_KEYS[r];n?n.forEach(t.add,t):t.add(r)}var PXe=Mn.TYPES=[].concat(Object.keys(Qn.VISITOR_KEYS),Object.keys(Qn.FLIPPED_ALIAS_KEYS),Object.keys(Qn.DEPRECATED_KEYS))});var s_=G(Au=>{"use strict";Object.defineProperty(Au,"__esModule",{value:!0});Au.default=Dle;Au.validateChild=_j;Au.validateField=yj;Au.validateInternal=Mle;var $f=Wi();function Dle(e,t,r){if(!e)return;let n=$f.NODE_FIELDS[e.type];if(!n)return;let s=n[t];yj(e,t,r,s),_j(e,t,r)}function Mle(e,t,r,n,s){if(e!=null&&e.validate&&!(e.optional&&n==null)&&(e.validate(t,r,n),s)){var a;let o=n.type;if(o==null)return;(a=$f.NODE_PARENT_VALIDATIONS[o])==null||a.call($f.NODE_PARENT_VALIDATIONS,t,r,n)}}function yj(e,t,r,n){n!=null&&n.validate&&(n.optional&&r==null||n.validate(e,t,r))}function _j(e,t,r){var n;let s=r?.type;s!=null&&((n=$f.NODE_PARENT_VALIDATIONS[s])==null||n.call($f.NODE_PARENT_VALIDATIONS,e,t,r))}});var EI=G(R=>{"use strict";Object.defineProperty(R,"__esModule",{value:!0});R.anyTypeAnnotation=gde;R.argumentPlaceholder=Vpe;R.arrayExpression=Ble;R.arrayPattern=Due;R.arrayTypeAnnotation=yde;R.arrowFunctionExpression=Mue;R.assignmentExpression=zle;R.assignmentPattern=Rue;R.awaitExpression=ide;R.bigIntLiteral=jle;R.binaryExpression=Ule;R.bindExpression=Kpe;R.blockStatement=Kle;R.booleanLiteral=pue;R.booleanLiteralTypeAnnotation=bde;R.booleanTypeAnnotation=_de;R.breakStatement=Gle;R.callExpression=Zle;R.catchClause=Hle;R.classAccessorProperty=ude;R.classBody=Lue;R.classDeclaration=jue;R.classExpression=Fue;R.classImplements=xde;R.classMethod=Yue;R.classPrivateMethod=pde;R.classPrivateProperty=dde;R.classProperty=lde;R.conditionalExpression=Jle;R.continueStatement=Yle;R.debuggerStatement=Xle;R.decimalLiteral=Xpe;R.declareClass=Sde;R.declareExportAllDeclaration=Nde;R.declareExportDeclaration=Cde;R.declareFunction=Tde;R.declareInterface=wde;R.declareModule=Ede;R.declareModuleExports=Pde;R.declareOpaqueType=Ade;R.declareTypeAlias=Ide;R.declareVariable=kde;R.declaredPredicate=Ode;R.decorator=Gpe;R.directive=Wle;R.directiveLiteral=Vle;R.doExpression=Zpe;R.doWhileStatement=Qle;R.emptyStatement=eue;R.emptyTypeAnnotation=qde;R.enumBooleanBody=ype;R.enumBooleanMember=xpe;R.enumDeclaration=gpe;R.enumDefaultedMember=wpe;R.enumNumberBody=_pe;R.enumNumberMember=Spe;R.enumStringBody=bpe;R.enumStringMember=Tpe;R.enumSymbolBody=vpe;R.existsTypeAnnotation=$de;R.exportAllDeclaration=Bue;R.exportDefaultDeclaration=zue;R.exportDefaultSpecifier=Hpe;R.exportNamedDeclaration=Uue;R.exportNamespaceSpecifier=ade;R.exportSpecifier=que;R.expressionStatement=tue;R.file=rue;R.forInStatement=nue;R.forOfStatement=Wue;R.forStatement=iue;R.functionDeclaration=sue;R.functionExpression=aue;R.functionTypeAnnotation=Rde;R.functionTypeParam=Dde;R.genericTypeAnnotation=Mde;R.identifier=oue;R.ifStatement=cue;R.import=sde;R.importAttribute=mde;R.importDeclaration=Vue;R.importDefaultSpecifier=Kue;R.importExpression=Hue;R.importNamespaceSpecifier=Gue;R.importSpecifier=Zue;R.indexedAccessType=Epe;R.inferredPredicate=Lde;R.interfaceDeclaration=jde;R.interfaceExtends=Fde;R.interfaceTypeAnnotation=Bde;R.interpreterDirective=qle;R.intersectionTypeAnnotation=zde;R.jSXAttribute=R.jsxAttribute=Ipe;R.jSXClosingElement=R.jsxClosingElement=Ape;R.jSXClosingFragment=R.jsxClosingFragment=zpe;R.jSXElement=R.jsxElement=kpe;R.jSXEmptyExpression=R.jsxEmptyExpression=Cpe;R.jSXExpressionContainer=R.jsxExpressionContainer=Npe;R.jSXFragment=R.jsxFragment=jpe;R.jSXIdentifier=R.jsxIdentifier=$pe;R.jSXMemberExpression=R.jsxMemberExpression=Rpe;R.jSXNamespacedName=R.jsxNamespacedName=Dpe;R.jSXOpeningElement=R.jsxOpeningElement=Mpe;R.jSXOpeningFragment=R.jsxOpeningFragment=Bpe;R.jSXSpreadAttribute=R.jsxSpreadAttribute=Lpe;R.jSXSpreadChild=R.jsxSpreadChild=Ope;R.jSXText=R.jsxText=Fpe;R.labeledStatement=lue;R.logicalExpression=fue;R.memberExpression=hue;R.metaProperty=Jue;R.mixedTypeAnnotation=Ude;R.moduleExpression=Qpe;R.newExpression=mue;R.noop=Upe;R.nullLiteral=due;R.nullLiteralTypeAnnotation=vde;R.nullableTypeAnnotation=Wde;R.numberLiteral=_he;R.numberLiteralTypeAnnotation=Vde;R.numberTypeAnnotation=Kde;R.numericLiteral=bj;R.objectExpression=yue;R.objectMethod=_ue;R.objectPattern=Xue;R.objectProperty=bue;R.objectTypeAnnotation=Gde;R.objectTypeCallProperty=Hde;R.objectTypeIndexer=Jde;R.objectTypeInternalSlot=Zde;R.objectTypeProperty=Yde;R.objectTypeSpreadProperty=Xde;R.opaqueType=Qde;R.optionalCallExpression=cde;R.optionalIndexedAccessType=Ppe;R.optionalMemberExpression=ode;R.parenthesizedExpression=Sue;R.pipelineBareFunction=rfe;R.pipelinePrimaryTopicReference=nfe;R.pipelineTopicExpression=tfe;R.placeholder=qpe;R.privateName=fde;R.program=gue;R.qualifiedTypeIdentifier=epe;R.recordExpression=Jpe;R.regExpLiteral=vj;R.regexLiteral=bhe;R.restElement=xj;R.restProperty=vhe;R.returnStatement=vue;R.sequenceExpression=xue;R.spreadElement=Sj;R.spreadProperty=xhe;R.staticBlock=hde;R.stringLiteral=uue;R.stringLiteralTypeAnnotation=tpe;R.stringTypeAnnotation=rpe;R.super=Que;R.switchCase=Tue;R.switchStatement=wue;R.symbolTypeAnnotation=npe;R.taggedTemplateExpression=ede;R.templateElement=tde;R.templateLiteral=rde;R.thisExpression=Eue;R.thisTypeAnnotation=ipe;R.throwStatement=Pue;R.topicReference=efe;R.tryStatement=Iue;R.tSAnyKeyword=R.tsAnyKeyword=hfe;R.tSArrayType=R.tsArrayType=Rfe;R.tSAsExpression=R.tsAsExpression=ehe;R.tSBigIntKeyword=R.tsBigIntKeyword=gfe;R.tSBooleanKeyword=R.tsBooleanKeyword=mfe;R.tSCallSignatureDeclaration=R.tsCallSignatureDeclaration=lfe;R.tSConditionalType=R.tsConditionalType=zfe;R.tSConstructSignatureDeclaration=R.tsConstructSignatureDeclaration=ufe;R.tSConstructorType=R.tsConstructorType=kfe;R.tSDeclareFunction=R.tsDeclareFunction=afe;R.tSDeclareMethod=R.tsDeclareMethod=ofe;R.tSEnumBody=R.tsEnumBody=nhe;R.tSEnumDeclaration=R.tsEnumDeclaration=ihe;R.tSEnumMember=R.tsEnumMember=she;R.tSExportAssignment=R.tsExportAssignment=phe;R.tSExpressionWithTypeArguments=R.tsExpressionWithTypeArguments=Hfe;R.tSExternalModuleReference=R.tsExternalModuleReference=uhe;R.tSFunctionType=R.tsFunctionType=Afe;R.tSImportEqualsDeclaration=R.tsImportEqualsDeclaration=lhe;R.tSImportType=R.tsImportType=che;R.tSIndexSignature=R.tsIndexSignature=ffe;R.tSIndexedAccessType=R.tsIndexedAccessType=Vfe;R.tSInferType=R.tsInferType=Ufe;R.tSInstantiationExpression=R.tsInstantiationExpression=Qfe;R.tSInterfaceBody=R.tsInterfaceBody=Yfe;R.tSInterfaceDeclaration=R.tsInterfaceDeclaration=Jfe;R.tSIntersectionType=R.tsIntersectionType=Bfe;R.tSIntrinsicKeyword=R.tsIntrinsicKeyword=yfe;R.tSLiteralType=R.tsLiteralType=Zfe;R.tSMappedType=R.tsMappedType=Kfe;R.tSMethodSignature=R.tsMethodSignature=pfe;R.tSModuleBlock=R.tsModuleBlock=ohe;R.tSModuleDeclaration=R.tsModuleDeclaration=ahe;R.tSNamedTupleMember=R.tsNamedTupleMember=Ffe;R.tSNamespaceExportDeclaration=R.tsNamespaceExportDeclaration=fhe;R.tSNeverKeyword=R.tsNeverKeyword=_fe;R.tSNonNullExpression=R.tsNonNullExpression=dhe;R.tSNullKeyword=R.tsNullKeyword=bfe;R.tSNumberKeyword=R.tsNumberKeyword=vfe;R.tSObjectKeyword=R.tsObjectKeyword=xfe;R.tSOptionalType=R.tsOptionalType=Mfe;R.tSParameterProperty=R.tsParameterProperty=sfe;R.tSParenthesizedType=R.tsParenthesizedType=qfe;R.tSPropertySignature=R.tsPropertySignature=dfe;R.tSQualifiedName=R.tsQualifiedName=cfe;R.tSRestType=R.tsRestType=Lfe;R.tSSatisfiesExpression=R.tsSatisfiesExpression=the;R.tSStringKeyword=R.tsStringKeyword=Sfe;R.tSSymbolKeyword=R.tsSymbolKeyword=Tfe;R.tSTemplateLiteralType=R.tsTemplateLiteralType=Gfe;R.tSThisType=R.tsThisType=Ife;R.tSTupleType=R.tsTupleType=Dfe;R.tSTypeAliasDeclaration=R.tsTypeAliasDeclaration=Xfe;R.tSTypeAnnotation=R.tsTypeAnnotation=hhe;R.tSTypeAssertion=R.tsTypeAssertion=rhe;R.tSTypeLiteral=R.tsTypeLiteral=$fe;R.tSTypeOperator=R.tsTypeOperator=Wfe;R.tSTypeParameter=R.tsTypeParameter=yhe;R.tSTypeParameterDeclaration=R.tsTypeParameterDeclaration=ghe;R.tSTypeParameterInstantiation=R.tsTypeParameterInstantiation=mhe;R.tSTypePredicate=R.tsTypePredicate=Nfe;R.tSTypeQuery=R.tsTypeQuery=Ofe;R.tSTypeReference=R.tsTypeReference=Cfe;R.tSUndefinedKeyword=R.tsUndefinedKeyword=wfe;R.tSUnionType=R.tsUnionType=jfe;R.tSUnknownKeyword=R.tsUnknownKeyword=Efe;R.tSVoidKeyword=R.tsVoidKeyword=Pfe;R.tupleExpression=Ype;R.tupleTypeAnnotation=spe;R.typeAlias=ope;R.typeAnnotation=cpe;R.typeCastExpression=lpe;R.typeParameter=upe;R.typeParameterDeclaration=dpe;R.typeParameterInstantiation=ppe;R.typeofTypeAnnotation=ape;R.unaryExpression=Aue;R.unionTypeAnnotation=fpe;R.updateExpression=kue;R.v8IntrinsicIdentifier=Wpe;R.variableDeclaration=Cue;R.variableDeclarator=Nue;R.variance=hpe;R.voidPattern=ife;R.voidTypeAnnotation=mpe;R.whileStatement=Oue;R.withStatement=$ue;R.yieldExpression=nde;var Lle=s_(),d_=xu(),Fle=Gs(),{validateInternal:I}=Lle,{NODE_FIELDS:X}=Fle;function jle(e){typeof e=="bigint"&&(e=e.toString());let t={type:"BigIntLiteral",value:e},r=X.BigIntLiteral;return I(r.value,t,"value",e),t}function Ble(e=[]){let t={type:"ArrayExpression",elements:e},r=X.ArrayExpression;return I(r.elements,t,"elements",e,1),t}function zle(e,t,r){let n={type:"AssignmentExpression",operator:e,left:t,right:r},s=X.AssignmentExpression;return I(s.operator,n,"operator",e),I(s.left,n,"left",t,1),I(s.right,n,"right",r,1),n}function Ule(e,t,r){let n={type:"BinaryExpression",operator:e,left:t,right:r},s=X.BinaryExpression;return I(s.operator,n,"operator",e),I(s.left,n,"left",t,1),I(s.right,n,"right",r,1),n}function qle(e){let t={type:"InterpreterDirective",value:e},r=X.InterpreterDirective;return I(r.value,t,"value",e),t}function Wle(e){let t={type:"Directive",value:e},r=X.Directive;return I(r.value,t,"value",e,1),t}function Vle(e){let t={type:"DirectiveLiteral",value:e},r=X.DirectiveLiteral;return I(r.value,t,"value",e),t}function Kle(e,t=[]){let r={type:"BlockStatement",body:e,directives:t},n=X.BlockStatement;return I(n.body,r,"body",e,1),I(n.directives,r,"directives",t,1),r}function Gle(e=null){let t={type:"BreakStatement",label:e},r=X.BreakStatement;return I(r.label,t,"label",e,1),t}function Zle(e,t){let r={type:"CallExpression",callee:e,arguments:t},n=X.CallExpression;return I(n.callee,r,"callee",e,1),I(n.arguments,r,"arguments",t,1),r}function Hle(e=null,t){let r={type:"CatchClause",param:e,body:t},n=X.CatchClause;return I(n.param,r,"param",e,1),I(n.body,r,"body",t,1),r}function Jle(e,t,r){let n={type:"ConditionalExpression",test:e,consequent:t,alternate:r},s=X.ConditionalExpression;return I(s.test,n,"test",e,1),I(s.consequent,n,"consequent",t,1),I(s.alternate,n,"alternate",r,1),n}function Yle(e=null){let t={type:"ContinueStatement",label:e},r=X.ContinueStatement;return I(r.label,t,"label",e,1),t}function Xle(){return{type:"DebuggerStatement"}}function Qle(e,t){let r={type:"DoWhileStatement",test:e,body:t},n=X.DoWhileStatement;return I(n.test,r,"test",e,1),I(n.body,r,"body",t,1),r}function eue(){return{type:"EmptyStatement"}}function tue(e){let t={type:"ExpressionStatement",expression:e},r=X.ExpressionStatement;return I(r.expression,t,"expression",e,1),t}function rue(e,t=null,r=null){let n={type:"File",program:e,comments:t,tokens:r},s=X.File;return I(s.program,n,"program",e,1),I(s.comments,n,"comments",t,1),I(s.tokens,n,"tokens",r),n}function nue(e,t,r){let n={type:"ForInStatement",left:e,right:t,body:r},s=X.ForInStatement;return I(s.left,n,"left",e,1),I(s.right,n,"right",t,1),I(s.body,n,"body",r,1),n}function iue(e=null,t=null,r=null,n){let s={type:"ForStatement",init:e,test:t,update:r,body:n},a=X.ForStatement;return I(a.init,s,"init",e,1),I(a.test,s,"test",t,1),I(a.update,s,"update",r,1),I(a.body,s,"body",n,1),s}function sue(e=null,t,r,n=!1,s=!1){let a={type:"FunctionDeclaration",id:e,params:t,body:r,generator:n,async:s},o=X.FunctionDeclaration;return I(o.id,a,"id",e,1),I(o.params,a,"params",t,1),I(o.body,a,"body",r,1),I(o.generator,a,"generator",n),I(o.async,a,"async",s),a}function aue(e=null,t,r,n=!1,s=!1){let a={type:"FunctionExpression",id:e,params:t,body:r,generator:n,async:s},o=X.FunctionExpression;return I(o.id,a,"id",e,1),I(o.params,a,"params",t,1),I(o.body,a,"body",r,1),I(o.generator,a,"generator",n),I(o.async,a,"async",s),a}function oue(e){let t={type:"Identifier",name:e},r=X.Identifier;return I(r.name,t,"name",e),t}function cue(e,t,r=null){let n={type:"IfStatement",test:e,consequent:t,alternate:r},s=X.IfStatement;return I(s.test,n,"test",e,1),I(s.consequent,n,"consequent",t,1),I(s.alternate,n,"alternate",r,1),n}function lue(e,t){let r={type:"LabeledStatement",label:e,body:t},n=X.LabeledStatement;return I(n.label,r,"label",e,1),I(n.body,r,"body",t,1),r}function uue(e){let t={type:"StringLiteral",value:e},r=X.StringLiteral;return I(r.value,t,"value",e),t}function bj(e){let t={type:"NumericLiteral",value:e},r=X.NumericLiteral;return I(r.value,t,"value",e),t}function due(){return{type:"NullLiteral"}}function pue(e){let t={type:"BooleanLiteral",value:e},r=X.BooleanLiteral;return I(r.value,t,"value",e),t}function vj(e,t=""){let r={type:"RegExpLiteral",pattern:e,flags:t},n=X.RegExpLiteral;return I(n.pattern,r,"pattern",e),I(n.flags,r,"flags",t),r}function fue(e,t,r){let n={type:"LogicalExpression",operator:e,left:t,right:r},s=X.LogicalExpression;return I(s.operator,n,"operator",e),I(s.left,n,"left",t,1),I(s.right,n,"right",r,1),n}function hue(e,t,r=!1,n=null){let s={type:"MemberExpression",object:e,property:t,computed:r,optional:n},a=X.MemberExpression;return I(a.object,s,"object",e,1),I(a.property,s,"property",t,1),I(a.computed,s,"computed",r),I(a.optional,s,"optional",n),s}function mue(e,t){let r={type:"NewExpression",callee:e,arguments:t},n=X.NewExpression;return I(n.callee,r,"callee",e,1),I(n.arguments,r,"arguments",t,1),r}function gue(e,t=[],r="script",n=null){let s={type:"Program",body:e,directives:t,sourceType:r,interpreter:n},a=X.Program;return I(a.body,s,"body",e,1),I(a.directives,s,"directives",t,1),I(a.sourceType,s,"sourceType",r),I(a.interpreter,s,"interpreter",n,1),s}function yue(e){let t={type:"ObjectExpression",properties:e},r=X.ObjectExpression;return I(r.properties,t,"properties",e,1),t}function _ue(e="method",t,r,n,s=!1,a=!1,o=!1){let c={type:"ObjectMethod",kind:e,key:t,params:r,body:n,computed:s,generator:a,async:o},l=X.ObjectMethod;return I(l.kind,c,"kind",e),I(l.key,c,"key",t,1),I(l.params,c,"params",r,1),I(l.body,c,"body",n,1),I(l.computed,c,"computed",s),I(l.generator,c,"generator",a),I(l.async,c,"async",o),c}function bue(e,t,r=!1,n=!1,s=null){let a={type:"ObjectProperty",key:e,value:t,computed:r,shorthand:n,decorators:s},o=X.ObjectProperty;return I(o.key,a,"key",e,1),I(o.value,a,"value",t,1),I(o.computed,a,"computed",r),I(o.shorthand,a,"shorthand",n),I(o.decorators,a,"decorators",s,1),a}function xj(e){let t={type:"RestElement",argument:e},r=X.RestElement;return I(r.argument,t,"argument",e,1),t}function vue(e=null){let t={type:"ReturnStatement",argument:e},r=X.ReturnStatement;return I(r.argument,t,"argument",e,1),t}function xue(e){let t={type:"SequenceExpression",expressions:e},r=X.SequenceExpression;return I(r.expressions,t,"expressions",e,1),t}function Sue(e){let t={type:"ParenthesizedExpression",expression:e},r=X.ParenthesizedExpression;return I(r.expression,t,"expression",e,1),t}function Tue(e=null,t){let r={type:"SwitchCase",test:e,consequent:t},n=X.SwitchCase;return I(n.test,r,"test",e,1),I(n.consequent,r,"consequent",t,1),r}function wue(e,t){let r={type:"SwitchStatement",discriminant:e,cases:t},n=X.SwitchStatement;return I(n.discriminant,r,"discriminant",e,1),I(n.cases,r,"cases",t,1),r}function Eue(){return{type:"ThisExpression"}}function Pue(e){let t={type:"ThrowStatement",argument:e},r=X.ThrowStatement;return I(r.argument,t,"argument",e,1),t}function Iue(e,t=null,r=null){let n={type:"TryStatement",block:e,handler:t,finalizer:r},s=X.TryStatement;return I(s.block,n,"block",e,1),I(s.handler,n,"handler",t,1),I(s.finalizer,n,"finalizer",r,1),n}function Aue(e,t,r=!0){let n={type:"UnaryExpression",operator:e,argument:t,prefix:r},s=X.UnaryExpression;return I(s.operator,n,"operator",e),I(s.argument,n,"argument",t,1),I(s.prefix,n,"prefix",r),n}function kue(e,t,r=!1){let n={type:"UpdateExpression",operator:e,argument:t,prefix:r},s=X.UpdateExpression;return I(s.operator,n,"operator",e),I(s.argument,n,"argument",t,1),I(s.prefix,n,"prefix",r),n}function Cue(e,t){let r={type:"VariableDeclaration",kind:e,declarations:t},n=X.VariableDeclaration;return I(n.kind,r,"kind",e),I(n.declarations,r,"declarations",t,1),r}function Nue(e,t=null){let r={type:"VariableDeclarator",id:e,init:t},n=X.VariableDeclarator;return I(n.id,r,"id",e,1),I(n.init,r,"init",t,1),r}function Oue(e,t){let r={type:"WhileStatement",test:e,body:t},n=X.WhileStatement;return I(n.test,r,"test",e,1),I(n.body,r,"body",t,1),r}function $ue(e,t){let r={type:"WithStatement",object:e,body:t},n=X.WithStatement;return I(n.object,r,"object",e,1),I(n.body,r,"body",t,1),r}function Rue(e,t){let r={type:"AssignmentPattern",left:e,right:t},n=X.AssignmentPattern;return I(n.left,r,"left",e,1),I(n.right,r,"right",t,1),r}function Due(e){let t={type:"ArrayPattern",elements:e},r=X.ArrayPattern;return I(r.elements,t,"elements",e,1),t}function Mue(e,t,r=!1){let n={type:"ArrowFunctionExpression",params:e,body:t,async:r,expression:null},s=X.ArrowFunctionExpression;return I(s.params,n,"params",e,1),I(s.body,n,"body",t,1),I(s.async,n,"async",r),n}function Lue(e){let t={type:"ClassBody",body:e},r=X.ClassBody;return I(r.body,t,"body",e,1),t}function Fue(e=null,t=null,r,n=null){let s={type:"ClassExpression",id:e,superClass:t,body:r,decorators:n},a=X.ClassExpression;return I(a.id,s,"id",e,1),I(a.superClass,s,"superClass",t,1),I(a.body,s,"body",r,1),I(a.decorators,s,"decorators",n,1),s}function jue(e=null,t=null,r,n=null){let s={type:"ClassDeclaration",id:e,superClass:t,body:r,decorators:n},a=X.ClassDeclaration;return I(a.id,s,"id",e,1),I(a.superClass,s,"superClass",t,1),I(a.body,s,"body",r,1),I(a.decorators,s,"decorators",n,1),s}function Bue(e,t=null){let r={type:"ExportAllDeclaration",source:e,attributes:t},n=X.ExportAllDeclaration;return I(n.source,r,"source",e,1),I(n.attributes,r,"attributes",t,1),r}function zue(e){let t={type:"ExportDefaultDeclaration",declaration:e},r=X.ExportDefaultDeclaration;return I(r.declaration,t,"declaration",e,1),t}function Uue(e=null,t=[],r=null,n=null){let s={type:"ExportNamedDeclaration",declaration:e,specifiers:t,source:r,attributes:n},a=X.ExportNamedDeclaration;return I(a.declaration,s,"declaration",e,1),I(a.specifiers,s,"specifiers",t,1),I(a.source,s,"source",r,1),I(a.attributes,s,"attributes",n,1),s}function que(e,t){let r={type:"ExportSpecifier",local:e,exported:t},n=X.ExportSpecifier;return I(n.local,r,"local",e,1),I(n.exported,r,"exported",t,1),r}function Wue(e,t,r,n=!1){let s={type:"ForOfStatement",left:e,right:t,body:r,await:n},a=X.ForOfStatement;return I(a.left,s,"left",e,1),I(a.right,s,"right",t,1),I(a.body,s,"body",r,1),I(a.await,s,"await",n),s}function Vue(e,t,r=null){let n={type:"ImportDeclaration",specifiers:e,source:t,attributes:r},s=X.ImportDeclaration;return I(s.specifiers,n,"specifiers",e,1),I(s.source,n,"source",t,1),I(s.attributes,n,"attributes",r,1),n}function Kue(e){let t={type:"ImportDefaultSpecifier",local:e},r=X.ImportDefaultSpecifier;return I(r.local,t,"local",e,1),t}function Gue(e){let t={type:"ImportNamespaceSpecifier",local:e},r=X.ImportNamespaceSpecifier;return I(r.local,t,"local",e,1),t}function Zue(e,t){let r={type:"ImportSpecifier",local:e,imported:t},n=X.ImportSpecifier;return I(n.local,r,"local",e,1),I(n.imported,r,"imported",t,1),r}function Hue(e,t=null){let r={type:"ImportExpression",source:e,options:t},n=X.ImportExpression;return I(n.source,r,"source",e,1),I(n.options,r,"options",t,1),r}function Jue(e,t){let r={type:"MetaProperty",meta:e,property:t},n=X.MetaProperty;return I(n.meta,r,"meta",e,1),I(n.property,r,"property",t,1),r}function Yue(e="method",t,r,n,s=!1,a=!1,o=!1,c=!1){let l={type:"ClassMethod",kind:e,key:t,params:r,body:n,computed:s,static:a,generator:o,async:c},u=X.ClassMethod;return I(u.kind,l,"kind",e),I(u.key,l,"key",t,1),I(u.params,l,"params",r,1),I(u.body,l,"body",n,1),I(u.computed,l,"computed",s),I(u.static,l,"static",a),I(u.generator,l,"generator",o),I(u.async,l,"async",c),l}function Xue(e){let t={type:"ObjectPattern",properties:e},r=X.ObjectPattern;return I(r.properties,t,"properties",e,1),t}function Sj(e){let t={type:"SpreadElement",argument:e},r=X.SpreadElement;return I(r.argument,t,"argument",e,1),t}function Que(){return{type:"Super"}}function ede(e,t){let r={type:"TaggedTemplateExpression",tag:e,quasi:t},n=X.TaggedTemplateExpression;return I(n.tag,r,"tag",e,1),I(n.quasi,r,"quasi",t,1),r}function tde(e,t=!1){let r={type:"TemplateElement",value:e,tail:t},n=X.TemplateElement;return I(n.value,r,"value",e),I(n.tail,r,"tail",t),r}function rde(e,t){let r={type:"TemplateLiteral",quasis:e,expressions:t},n=X.TemplateLiteral;return I(n.quasis,r,"quasis",e,1),I(n.expressions,r,"expressions",t,1),r}function nde(e=null,t=!1){let r={type:"YieldExpression",argument:e,delegate:t},n=X.YieldExpression;return I(n.argument,r,"argument",e,1),I(n.delegate,r,"delegate",t),r}function ide(e){let t={type:"AwaitExpression",argument:e},r=X.AwaitExpression;return I(r.argument,t,"argument",e,1),t}function sde(){return{type:"Import"}}function ade(e){let t={type:"ExportNamespaceSpecifier",exported:e},r=X.ExportNamespaceSpecifier;return I(r.exported,t,"exported",e,1),t}function ode(e,t,r=!1,n){let s={type:"OptionalMemberExpression",object:e,property:t,computed:r,optional:n},a=X.OptionalMemberExpression;return I(a.object,s,"object",e,1),I(a.property,s,"property",t,1),I(a.computed,s,"computed",r),I(a.optional,s,"optional",n),s}function cde(e,t,r){let n={type:"OptionalCallExpression",callee:e,arguments:t,optional:r},s=X.OptionalCallExpression;return I(s.callee,n,"callee",e,1),I(s.arguments,n,"arguments",t,1),I(s.optional,n,"optional",r),n}function lde(e,t=null,r=null,n=null,s=!1,a=!1){let o={type:"ClassProperty",key:e,value:t,typeAnnotation:r,decorators:n,computed:s,static:a},c=X.ClassProperty;return I(c.key,o,"key",e,1),I(c.value,o,"value",t,1),I(c.typeAnnotation,o,"typeAnnotation",r,1),I(c.decorators,o,"decorators",n,1),I(c.computed,o,"computed",s),I(c.static,o,"static",a),o}function ude(e,t=null,r=null,n=null,s=!1,a=!1){let o={type:"ClassAccessorProperty",key:e,value:t,typeAnnotation:r,decorators:n,computed:s,static:a},c=X.ClassAccessorProperty;return I(c.key,o,"key",e,1),I(c.value,o,"value",t,1),I(c.typeAnnotation,o,"typeAnnotation",r,1),I(c.decorators,o,"decorators",n,1),I(c.computed,o,"computed",s),I(c.static,o,"static",a),o}function dde(e,t=null,r=null,n=!1){let s={type:"ClassPrivateProperty",key:e,value:t,decorators:r,static:n},a=X.ClassPrivateProperty;return I(a.key,s,"key",e,1),I(a.value,s,"value",t,1),I(a.decorators,s,"decorators",r,1),I(a.static,s,"static",n),s}function pde(e="method",t,r,n,s=!1){let a={type:"ClassPrivateMethod",kind:e,key:t,params:r,body:n,static:s},o=X.ClassPrivateMethod;return I(o.kind,a,"kind",e),I(o.key,a,"key",t,1),I(o.params,a,"params",r,1),I(o.body,a,"body",n,1),I(o.static,a,"static",s),a}function fde(e){let t={type:"PrivateName",id:e},r=X.PrivateName;return I(r.id,t,"id",e,1),t}function hde(e){let t={type:"StaticBlock",body:e},r=X.StaticBlock;return I(r.body,t,"body",e,1),t}function mde(e,t){let r={type:"ImportAttribute",key:e,value:t},n=X.ImportAttribute;return I(n.key,r,"key",e,1),I(n.value,r,"value",t,1),r}function gde(){return{type:"AnyTypeAnnotation"}}function yde(e){let t={type:"ArrayTypeAnnotation",elementType:e},r=X.ArrayTypeAnnotation;return I(r.elementType,t,"elementType",e,1),t}function _de(){return{type:"BooleanTypeAnnotation"}}function bde(e){let t={type:"BooleanLiteralTypeAnnotation",value:e},r=X.BooleanLiteralTypeAnnotation;return I(r.value,t,"value",e),t}function vde(){return{type:"NullLiteralTypeAnnotation"}}function xde(e,t=null){let r={type:"ClassImplements",id:e,typeParameters:t},n=X.ClassImplements;return I(n.id,r,"id",e,1),I(n.typeParameters,r,"typeParameters",t,1),r}function Sde(e,t=null,r=null,n){let s={type:"DeclareClass",id:e,typeParameters:t,extends:r,body:n},a=X.DeclareClass;return I(a.id,s,"id",e,1),I(a.typeParameters,s,"typeParameters",t,1),I(a.extends,s,"extends",r,1),I(a.body,s,"body",n,1),s}function Tde(e){let t={type:"DeclareFunction",id:e},r=X.DeclareFunction;return I(r.id,t,"id",e,1),t}function wde(e,t=null,r=null,n){let s={type:"DeclareInterface",id:e,typeParameters:t,extends:r,body:n},a=X.DeclareInterface;return I(a.id,s,"id",e,1),I(a.typeParameters,s,"typeParameters",t,1),I(a.extends,s,"extends",r,1),I(a.body,s,"body",n,1),s}function Ede(e,t,r=null){let n={type:"DeclareModule",id:e,body:t,kind:r},s=X.DeclareModule;return I(s.id,n,"id",e,1),I(s.body,n,"body",t,1),I(s.kind,n,"kind",r),n}function Pde(e){let t={type:"DeclareModuleExports",typeAnnotation:e},r=X.DeclareModuleExports;return I(r.typeAnnotation,t,"typeAnnotation",e,1),t}function Ide(e,t=null,r){let n={type:"DeclareTypeAlias",id:e,typeParameters:t,right:r},s=X.DeclareTypeAlias;return I(s.id,n,"id",e,1),I(s.typeParameters,n,"typeParameters",t,1),I(s.right,n,"right",r,1),n}function Ade(e,t=null,r=null){let n={type:"DeclareOpaqueType",id:e,typeParameters:t,supertype:r},s=X.DeclareOpaqueType;return I(s.id,n,"id",e,1),I(s.typeParameters,n,"typeParameters",t,1),I(s.supertype,n,"supertype",r,1),n}function kde(e){let t={type:"DeclareVariable",id:e},r=X.DeclareVariable;return I(r.id,t,"id",e,1),t}function Cde(e=null,t=null,r=null,n=null){let s={type:"DeclareExportDeclaration",declaration:e,specifiers:t,source:r,attributes:n},a=X.DeclareExportDeclaration;return I(a.declaration,s,"declaration",e,1),I(a.specifiers,s,"specifiers",t,1),I(a.source,s,"source",r,1),I(a.attributes,s,"attributes",n,1),s}function Nde(e,t=null){let r={type:"DeclareExportAllDeclaration",source:e,attributes:t},n=X.DeclareExportAllDeclaration;return I(n.source,r,"source",e,1),I(n.attributes,r,"attributes",t,1),r}function Ode(e){let t={type:"DeclaredPredicate",value:e},r=X.DeclaredPredicate;return I(r.value,t,"value",e,1),t}function $de(){return{type:"ExistsTypeAnnotation"}}function Rde(e=null,t,r=null,n){let s={type:"FunctionTypeAnnotation",typeParameters:e,params:t,rest:r,returnType:n},a=X.FunctionTypeAnnotation;return I(a.typeParameters,s,"typeParameters",e,1),I(a.params,s,"params",t,1),I(a.rest,s,"rest",r,1),I(a.returnType,s,"returnType",n,1),s}function Dde(e=null,t){let r={type:"FunctionTypeParam",name:e,typeAnnotation:t},n=X.FunctionTypeParam;return I(n.name,r,"name",e,1),I(n.typeAnnotation,r,"typeAnnotation",t,1),r}function Mde(e,t=null){let r={type:"GenericTypeAnnotation",id:e,typeParameters:t},n=X.GenericTypeAnnotation;return I(n.id,r,"id",e,1),I(n.typeParameters,r,"typeParameters",t,1),r}function Lde(){return{type:"InferredPredicate"}}function Fde(e,t=null){let r={type:"InterfaceExtends",id:e,typeParameters:t},n=X.InterfaceExtends;return I(n.id,r,"id",e,1),I(n.typeParameters,r,"typeParameters",t,1),r}function jde(e,t=null,r=null,n){let s={type:"InterfaceDeclaration",id:e,typeParameters:t,extends:r,body:n},a=X.InterfaceDeclaration;return I(a.id,s,"id",e,1),I(a.typeParameters,s,"typeParameters",t,1),I(a.extends,s,"extends",r,1),I(a.body,s,"body",n,1),s}function Bde(e=null,t){let r={type:"InterfaceTypeAnnotation",extends:e,body:t},n=X.InterfaceTypeAnnotation;return I(n.extends,r,"extends",e,1),I(n.body,r,"body",t,1),r}function zde(e){let t={type:"IntersectionTypeAnnotation",types:e},r=X.IntersectionTypeAnnotation;return I(r.types,t,"types",e,1),t}function Ude(){return{type:"MixedTypeAnnotation"}}function qde(){return{type:"EmptyTypeAnnotation"}}function Wde(e){let t={type:"NullableTypeAnnotation",typeAnnotation:e},r=X.NullableTypeAnnotation;return I(r.typeAnnotation,t,"typeAnnotation",e,1),t}function Vde(e){let t={type:"NumberLiteralTypeAnnotation",value:e},r=X.NumberLiteralTypeAnnotation;return I(r.value,t,"value",e),t}function Kde(){return{type:"NumberTypeAnnotation"}}function Gde(e,t=[],r=[],n=[],s=!1){let a={type:"ObjectTypeAnnotation",properties:e,indexers:t,callProperties:r,internalSlots:n,exact:s},o=X.ObjectTypeAnnotation;return I(o.properties,a,"properties",e,1),I(o.indexers,a,"indexers",t,1),I(o.callProperties,a,"callProperties",r,1),I(o.internalSlots,a,"internalSlots",n,1),I(o.exact,a,"exact",s),a}function Zde(e,t,r,n,s){let a={type:"ObjectTypeInternalSlot",id:e,value:t,optional:r,static:n,method:s},o=X.ObjectTypeInternalSlot;return I(o.id,a,"id",e,1),I(o.value,a,"value",t,1),I(o.optional,a,"optional",r),I(o.static,a,"static",n),I(o.method,a,"method",s),a}function Hde(e){let t={type:"ObjectTypeCallProperty",value:e,static:null},r=X.ObjectTypeCallProperty;return I(r.value,t,"value",e,1),t}function Jde(e=null,t,r,n=null){let s={type:"ObjectTypeIndexer",id:e,key:t,value:r,variance:n,static:null},a=X.ObjectTypeIndexer;return I(a.id,s,"id",e,1),I(a.key,s,"key",t,1),I(a.value,s,"value",r,1),I(a.variance,s,"variance",n,1),s}function Yde(e,t,r=null){let n={type:"ObjectTypeProperty",key:e,value:t,variance:r,kind:null,method:null,optional:null,proto:null,static:null},s=X.ObjectTypeProperty;return I(s.key,n,"key",e,1),I(s.value,n,"value",t,1),I(s.variance,n,"variance",r,1),n}function Xde(e){let t={type:"ObjectTypeSpreadProperty",argument:e},r=X.ObjectTypeSpreadProperty;return I(r.argument,t,"argument",e,1),t}function Qde(e,t=null,r=null,n){let s={type:"OpaqueType",id:e,typeParameters:t,supertype:r,impltype:n},a=X.OpaqueType;return I(a.id,s,"id",e,1),I(a.typeParameters,s,"typeParameters",t,1),I(a.supertype,s,"supertype",r,1),I(a.impltype,s,"impltype",n,1),s}function epe(e,t){let r={type:"QualifiedTypeIdentifier",id:e,qualification:t},n=X.QualifiedTypeIdentifier;return I(n.id,r,"id",e,1),I(n.qualification,r,"qualification",t,1),r}function tpe(e){let t={type:"StringLiteralTypeAnnotation",value:e},r=X.StringLiteralTypeAnnotation;return I(r.value,t,"value",e),t}function rpe(){return{type:"StringTypeAnnotation"}}function npe(){return{type:"SymbolTypeAnnotation"}}function ipe(){return{type:"ThisTypeAnnotation"}}function spe(e){let t={type:"TupleTypeAnnotation",types:e},r=X.TupleTypeAnnotation;return I(r.types,t,"types",e,1),t}function ape(e){let t={type:"TypeofTypeAnnotation",argument:e},r=X.TypeofTypeAnnotation;return I(r.argument,t,"argument",e,1),t}function ope(e,t=null,r){let n={type:"TypeAlias",id:e,typeParameters:t,right:r},s=X.TypeAlias;return I(s.id,n,"id",e,1),I(s.typeParameters,n,"typeParameters",t,1),I(s.right,n,"right",r,1),n}function cpe(e){let t={type:"TypeAnnotation",typeAnnotation:e},r=X.TypeAnnotation;return I(r.typeAnnotation,t,"typeAnnotation",e,1),t}function lpe(e,t){let r={type:"TypeCastExpression",expression:e,typeAnnotation:t},n=X.TypeCastExpression;return I(n.expression,r,"expression",e,1),I(n.typeAnnotation,r,"typeAnnotation",t,1),r}function upe(e=null,t=null,r=null){let n={type:"TypeParameter",bound:e,default:t,variance:r,name:null},s=X.TypeParameter;return I(s.bound,n,"bound",e,1),I(s.default,n,"default",t,1),I(s.variance,n,"variance",r,1),n}function dpe(e){let t={type:"TypeParameterDeclaration",params:e},r=X.TypeParameterDeclaration;return I(r.params,t,"params",e,1),t}function ppe(e){let t={type:"TypeParameterInstantiation",params:e},r=X.TypeParameterInstantiation;return I(r.params,t,"params",e,1),t}function fpe(e){let t={type:"UnionTypeAnnotation",types:e},r=X.UnionTypeAnnotation;return I(r.types,t,"types",e,1),t}function hpe(e){let t={type:"Variance",kind:e},r=X.Variance;return I(r.kind,t,"kind",e),t}function mpe(){return{type:"VoidTypeAnnotation"}}function gpe(e,t){let r={type:"EnumDeclaration",id:e,body:t},n=X.EnumDeclaration;return I(n.id,r,"id",e,1),I(n.body,r,"body",t,1),r}function ype(e){let t={type:"EnumBooleanBody",members:e,explicitType:null,hasUnknownMembers:null},r=X.EnumBooleanBody;return I(r.members,t,"members",e,1),t}function _pe(e){let t={type:"EnumNumberBody",members:e,explicitType:null,hasUnknownMembers:null},r=X.EnumNumberBody;return I(r.members,t,"members",e,1),t}function bpe(e){let t={type:"EnumStringBody",members:e,explicitType:null,hasUnknownMembers:null},r=X.EnumStringBody;return I(r.members,t,"members",e,1),t}function vpe(e){let t={type:"EnumSymbolBody",members:e,hasUnknownMembers:null},r=X.EnumSymbolBody;return I(r.members,t,"members",e,1),t}function xpe(e){let t={type:"EnumBooleanMember",id:e,init:null},r=X.EnumBooleanMember;return I(r.id,t,"id",e,1),t}function Spe(e,t){let r={type:"EnumNumberMember",id:e,init:t},n=X.EnumNumberMember;return I(n.id,r,"id",e,1),I(n.init,r,"init",t,1),r}function Tpe(e,t){let r={type:"EnumStringMember",id:e,init:t},n=X.EnumStringMember;return I(n.id,r,"id",e,1),I(n.init,r,"init",t,1),r}function wpe(e){let t={type:"EnumDefaultedMember",id:e},r=X.EnumDefaultedMember;return I(r.id,t,"id",e,1),t}function Epe(e,t){let r={type:"IndexedAccessType",objectType:e,indexType:t},n=X.IndexedAccessType;return I(n.objectType,r,"objectType",e,1),I(n.indexType,r,"indexType",t,1),r}function Ppe(e,t){let r={type:"OptionalIndexedAccessType",objectType:e,indexType:t,optional:null},n=X.OptionalIndexedAccessType;return I(n.objectType,r,"objectType",e,1),I(n.indexType,r,"indexType",t,1),r}function Ipe(e,t=null){let r={type:"JSXAttribute",name:e,value:t},n=X.JSXAttribute;return I(n.name,r,"name",e,1),I(n.value,r,"value",t,1),r}function Ape(e){let t={type:"JSXClosingElement",name:e},r=X.JSXClosingElement;return I(r.name,t,"name",e,1),t}function kpe(e,t=null,r,n=null){let s={type:"JSXElement",openingElement:e,closingElement:t,children:r,selfClosing:n},a=X.JSXElement;return I(a.openingElement,s,"openingElement",e,1),I(a.closingElement,s,"closingElement",t,1),I(a.children,s,"children",r,1),I(a.selfClosing,s,"selfClosing",n),s}function Cpe(){return{type:"JSXEmptyExpression"}}function Npe(e){let t={type:"JSXExpressionContainer",expression:e},r=X.JSXExpressionContainer;return I(r.expression,t,"expression",e,1),t}function Ope(e){let t={type:"JSXSpreadChild",expression:e},r=X.JSXSpreadChild;return I(r.expression,t,"expression",e,1),t}function $pe(e){let t={type:"JSXIdentifier",name:e},r=X.JSXIdentifier;return I(r.name,t,"name",e),t}function Rpe(e,t){let r={type:"JSXMemberExpression",object:e,property:t},n=X.JSXMemberExpression;return I(n.object,r,"object",e,1),I(n.property,r,"property",t,1),r}function Dpe(e,t){let r={type:"JSXNamespacedName",namespace:e,name:t},n=X.JSXNamespacedName;return I(n.namespace,r,"namespace",e,1),I(n.name,r,"name",t,1),r}function Mpe(e,t,r=!1){let n={type:"JSXOpeningElement",name:e,attributes:t,selfClosing:r},s=X.JSXOpeningElement;return I(s.name,n,"name",e,1),I(s.attributes,n,"attributes",t,1),I(s.selfClosing,n,"selfClosing",r),n}function Lpe(e){let t={type:"JSXSpreadAttribute",argument:e},r=X.JSXSpreadAttribute;return I(r.argument,t,"argument",e,1),t}function Fpe(e){let t={type:"JSXText",value:e},r=X.JSXText;return I(r.value,t,"value",e),t}function jpe(e,t,r){let n={type:"JSXFragment",openingFragment:e,closingFragment:t,children:r},s=X.JSXFragment;return I(s.openingFragment,n,"openingFragment",e,1),I(s.closingFragment,n,"closingFragment",t,1),I(s.children,n,"children",r,1),n}function Bpe(){return{type:"JSXOpeningFragment"}}function zpe(){return{type:"JSXClosingFragment"}}function Upe(){return{type:"Noop"}}function qpe(e,t){let r={type:"Placeholder",expectedNode:e,name:t},n=X.Placeholder;return I(n.expectedNode,r,"expectedNode",e),I(n.name,r,"name",t,1),r}function Wpe(e){let t={type:"V8IntrinsicIdentifier",name:e},r=X.V8IntrinsicIdentifier;return I(r.name,t,"name",e),t}function Vpe(){return{type:"ArgumentPlaceholder"}}function Kpe(e,t){let r={type:"BindExpression",object:e,callee:t},n=X.BindExpression;return I(n.object,r,"object",e,1),I(n.callee,r,"callee",t,1),r}function Gpe(e){let t={type:"Decorator",expression:e},r=X.Decorator;return I(r.expression,t,"expression",e,1),t}function Zpe(e,t=!1){let r={type:"DoExpression",body:e,async:t},n=X.DoExpression;return I(n.body,r,"body",e,1),I(n.async,r,"async",t),r}function Hpe(e){let t={type:"ExportDefaultSpecifier",exported:e},r=X.ExportDefaultSpecifier;return I(r.exported,t,"exported",e,1),t}function Jpe(e){let t={type:"RecordExpression",properties:e},r=X.RecordExpression;return I(r.properties,t,"properties",e,1),t}function Ype(e=[]){let t={type:"TupleExpression",elements:e},r=X.TupleExpression;return I(r.elements,t,"elements",e,1),t}function Xpe(e){let t={type:"DecimalLiteral",value:e},r=X.DecimalLiteral;return I(r.value,t,"value",e),t}function Qpe(e){let t={type:"ModuleExpression",body:e},r=X.ModuleExpression;return I(r.body,t,"body",e,1),t}function efe(){return{type:"TopicReference"}}function tfe(e){let t={type:"PipelineTopicExpression",expression:e},r=X.PipelineTopicExpression;return I(r.expression,t,"expression",e,1),t}function rfe(e){let t={type:"PipelineBareFunction",callee:e},r=X.PipelineBareFunction;return I(r.callee,t,"callee",e,1),t}function nfe(){return{type:"PipelinePrimaryTopicReference"}}function ife(){return{type:"VoidPattern"}}function sfe(e){let t={type:"TSParameterProperty",parameter:e},r=X.TSParameterProperty;return I(r.parameter,t,"parameter",e,1),t}function afe(e=null,t=null,r,n=null){let s={type:"TSDeclareFunction",id:e,typeParameters:t,params:r,returnType:n},a=X.TSDeclareFunction;return I(a.id,s,"id",e,1),I(a.typeParameters,s,"typeParameters",t,1),I(a.params,s,"params",r,1),I(a.returnType,s,"returnType",n,1),s}function ofe(e=null,t,r=null,n,s=null){let a={type:"TSDeclareMethod",decorators:e,key:t,typeParameters:r,params:n,returnType:s},o=X.TSDeclareMethod;return I(o.decorators,a,"decorators",e,1),I(o.key,a,"key",t,1),I(o.typeParameters,a,"typeParameters",r,1),I(o.params,a,"params",n,1),I(o.returnType,a,"returnType",s,1),a}function cfe(e,t){let r={type:"TSQualifiedName",left:e,right:t},n=X.TSQualifiedName;return I(n.left,r,"left",e,1),I(n.right,r,"right",t,1),r}function lfe(e=null,t,r=null){let n={type:"TSCallSignatureDeclaration",typeParameters:e,parameters:t,typeAnnotation:r},s=X.TSCallSignatureDeclaration;return I(s.typeParameters,n,"typeParameters",e,1),I(s.parameters,n,"parameters",t,1),I(s.typeAnnotation,n,"typeAnnotation",r,1),n}function ufe(e=null,t,r=null){let n={type:"TSConstructSignatureDeclaration",typeParameters:e,parameters:t,typeAnnotation:r},s=X.TSConstructSignatureDeclaration;return I(s.typeParameters,n,"typeParameters",e,1),I(s.parameters,n,"parameters",t,1),I(s.typeAnnotation,n,"typeAnnotation",r,1),n}function dfe(e,t=null){let r={type:"TSPropertySignature",key:e,typeAnnotation:t},n=X.TSPropertySignature;return I(n.key,r,"key",e,1),I(n.typeAnnotation,r,"typeAnnotation",t,1),r}function pfe(e,t=null,r,n=null){let s={type:"TSMethodSignature",key:e,typeParameters:t,parameters:r,typeAnnotation:n,kind:null},a=X.TSMethodSignature;return I(a.key,s,"key",e,1),I(a.typeParameters,s,"typeParameters",t,1),I(a.parameters,s,"parameters",r,1),I(a.typeAnnotation,s,"typeAnnotation",n,1),s}function ffe(e,t=null){let r={type:"TSIndexSignature",parameters:e,typeAnnotation:t},n=X.TSIndexSignature;return I(n.parameters,r,"parameters",e,1),I(n.typeAnnotation,r,"typeAnnotation",t,1),r}function hfe(){return{type:"TSAnyKeyword"}}function mfe(){return{type:"TSBooleanKeyword"}}function gfe(){return{type:"TSBigIntKeyword"}}function yfe(){return{type:"TSIntrinsicKeyword"}}function _fe(){return{type:"TSNeverKeyword"}}function bfe(){return{type:"TSNullKeyword"}}function vfe(){return{type:"TSNumberKeyword"}}function xfe(){return{type:"TSObjectKeyword"}}function Sfe(){return{type:"TSStringKeyword"}}function Tfe(){return{type:"TSSymbolKeyword"}}function wfe(){return{type:"TSUndefinedKeyword"}}function Efe(){return{type:"TSUnknownKeyword"}}function Pfe(){return{type:"TSVoidKeyword"}}function Ife(){return{type:"TSThisType"}}function Afe(e=null,t,r=null){let n={type:"TSFunctionType",typeParameters:e,parameters:t,typeAnnotation:r},s=X.TSFunctionType;return I(s.typeParameters,n,"typeParameters",e,1),I(s.parameters,n,"parameters",t,1),I(s.typeAnnotation,n,"typeAnnotation",r,1),n}function kfe(e=null,t,r=null){let n={type:"TSConstructorType",typeParameters:e,parameters:t,typeAnnotation:r},s=X.TSConstructorType;return I(s.typeParameters,n,"typeParameters",e,1),I(s.parameters,n,"parameters",t,1),I(s.typeAnnotation,n,"typeAnnotation",r,1),n}function Cfe(e,t=null){let r={type:"TSTypeReference",typeName:e,typeParameters:t},n=X.TSTypeReference;return I(n.typeName,r,"typeName",e,1),I(n.typeParameters,r,"typeParameters",t,1),r}function Nfe(e,t=null,r=null){let n={type:"TSTypePredicate",parameterName:e,typeAnnotation:t,asserts:r},s=X.TSTypePredicate;return I(s.parameterName,n,"parameterName",e,1),I(s.typeAnnotation,n,"typeAnnotation",t,1),I(s.asserts,n,"asserts",r),n}function Ofe(e,t=null){let r={type:"TSTypeQuery",exprName:e,typeParameters:t},n=X.TSTypeQuery;return I(n.exprName,r,"exprName",e,1),I(n.typeParameters,r,"typeParameters",t,1),r}function $fe(e){let t={type:"TSTypeLiteral",members:e},r=X.TSTypeLiteral;return I(r.members,t,"members",e,1),t}function Rfe(e){let t={type:"TSArrayType",elementType:e},r=X.TSArrayType;return I(r.elementType,t,"elementType",e,1),t}function Dfe(e){let t={type:"TSTupleType",elementTypes:e},r=X.TSTupleType;return I(r.elementTypes,t,"elementTypes",e,1),t}function Mfe(e){let t={type:"TSOptionalType",typeAnnotation:e},r=X.TSOptionalType;return I(r.typeAnnotation,t,"typeAnnotation",e,1),t}function Lfe(e){let t={type:"TSRestType",typeAnnotation:e},r=X.TSRestType;return I(r.typeAnnotation,t,"typeAnnotation",e,1),t}function Ffe(e,t,r=!1){let n={type:"TSNamedTupleMember",label:e,elementType:t,optional:r},s=X.TSNamedTupleMember;return I(s.label,n,"label",e,1),I(s.elementType,n,"elementType",t,1),I(s.optional,n,"optional",r),n}function jfe(e){let t={type:"TSUnionType",types:e},r=X.TSUnionType;return I(r.types,t,"types",e,1),t}function Bfe(e){let t={type:"TSIntersectionType",types:e},r=X.TSIntersectionType;return I(r.types,t,"types",e,1),t}function zfe(e,t,r,n){let s={type:"TSConditionalType",checkType:e,extendsType:t,trueType:r,falseType:n},a=X.TSConditionalType;return I(a.checkType,s,"checkType",e,1),I(a.extendsType,s,"extendsType",t,1),I(a.trueType,s,"trueType",r,1),I(a.falseType,s,"falseType",n,1),s}function Ufe(e){let t={type:"TSInferType",typeParameter:e},r=X.TSInferType;return I(r.typeParameter,t,"typeParameter",e,1),t}function qfe(e){let t={type:"TSParenthesizedType",typeAnnotation:e},r=X.TSParenthesizedType;return I(r.typeAnnotation,t,"typeAnnotation",e,1),t}function Wfe(e,t="keyof"){let r={type:"TSTypeOperator",typeAnnotation:e,operator:t},n=X.TSTypeOperator;return I(n.typeAnnotation,r,"typeAnnotation",e,1),I(n.operator,r,"operator",t),r}function Vfe(e,t){let r={type:"TSIndexedAccessType",objectType:e,indexType:t},n=X.TSIndexedAccessType;return I(n.objectType,r,"objectType",e,1),I(n.indexType,r,"indexType",t,1),r}function Kfe(e,t=null,r=null){let n={type:"TSMappedType",typeParameter:e,typeAnnotation:t,nameType:r},s=X.TSMappedType;return I(s.typeParameter,n,"typeParameter",e,1),I(s.typeAnnotation,n,"typeAnnotation",t,1),I(s.nameType,n,"nameType",r,1),n}function Gfe(e,t){let r={type:"TSTemplateLiteralType",quasis:e,types:t},n=X.TSTemplateLiteralType;return I(n.quasis,r,"quasis",e,1),I(n.types,r,"types",t,1),r}function Zfe(e){let t={type:"TSLiteralType",literal:e},r=X.TSLiteralType;return I(r.literal,t,"literal",e,1),t}function Hfe(e,t=null){let r={type:"TSExpressionWithTypeArguments",expression:e,typeParameters:t},n=X.TSExpressionWithTypeArguments;return I(n.expression,r,"expression",e,1),I(n.typeParameters,r,"typeParameters",t,1),r}function Jfe(e,t=null,r=null,n){let s={type:"TSInterfaceDeclaration",id:e,typeParameters:t,extends:r,body:n},a=X.TSInterfaceDeclaration;return I(a.id,s,"id",e,1),I(a.typeParameters,s,"typeParameters",t,1),I(a.extends,s,"extends",r,1),I(a.body,s,"body",n,1),s}function Yfe(e){let t={type:"TSInterfaceBody",body:e},r=X.TSInterfaceBody;return I(r.body,t,"body",e,1),t}function Xfe(e,t=null,r){let n={type:"TSTypeAliasDeclaration",id:e,typeParameters:t,typeAnnotation:r},s=X.TSTypeAliasDeclaration;return I(s.id,n,"id",e,1),I(s.typeParameters,n,"typeParameters",t,1),I(s.typeAnnotation,n,"typeAnnotation",r,1),n}function Qfe(e,t=null){let r={type:"TSInstantiationExpression",expression:e,typeParameters:t},n=X.TSInstantiationExpression;return I(n.expression,r,"expression",e,1),I(n.typeParameters,r,"typeParameters",t,1),r}function ehe(e,t){let r={type:"TSAsExpression",expression:e,typeAnnotation:t},n=X.TSAsExpression;return I(n.expression,r,"expression",e,1),I(n.typeAnnotation,r,"typeAnnotation",t,1),r}function the(e,t){let r={type:"TSSatisfiesExpression",expression:e,typeAnnotation:t},n=X.TSSatisfiesExpression;return I(n.expression,r,"expression",e,1),I(n.typeAnnotation,r,"typeAnnotation",t,1),r}function rhe(e,t){let r={type:"TSTypeAssertion",typeAnnotation:e,expression:t},n=X.TSTypeAssertion;return I(n.typeAnnotation,r,"typeAnnotation",e,1),I(n.expression,r,"expression",t,1),r}function nhe(e){let t={type:"TSEnumBody",members:e},r=X.TSEnumBody;return I(r.members,t,"members",e,1),t}function ihe(e,t){let r={type:"TSEnumDeclaration",id:e,members:t},n=X.TSEnumDeclaration;return I(n.id,r,"id",e,1),I(n.members,r,"members",t,1),r}function she(e,t=null){let r={type:"TSEnumMember",id:e,initializer:t},n=X.TSEnumMember;return I(n.id,r,"id",e,1),I(n.initializer,r,"initializer",t,1),r}function ahe(e,t){let r={type:"TSModuleDeclaration",id:e,body:t,kind:null},n=X.TSModuleDeclaration;return I(n.id,r,"id",e,1),I(n.body,r,"body",t,1),r}function ohe(e){let t={type:"TSModuleBlock",body:e},r=X.TSModuleBlock;return I(r.body,t,"body",e,1),t}function che(e,t=null,r=null){let n={type:"TSImportType",argument:e,qualifier:t,typeParameters:r},s=X.TSImportType;return I(s.argument,n,"argument",e,1),I(s.qualifier,n,"qualifier",t,1),I(s.typeParameters,n,"typeParameters",r,1),n}function lhe(e,t){let r={type:"TSImportEqualsDeclaration",id:e,moduleReference:t,isExport:null},n=X.TSImportEqualsDeclaration;return I(n.id,r,"id",e,1),I(n.moduleReference,r,"moduleReference",t,1),r}function uhe(e){let t={type:"TSExternalModuleReference",expression:e},r=X.TSExternalModuleReference;return I(r.expression,t,"expression",e,1),t}function dhe(e){let t={type:"TSNonNullExpression",expression:e},r=X.TSNonNullExpression;return I(r.expression,t,"expression",e,1),t}function phe(e){let t={type:"TSExportAssignment",expression:e},r=X.TSExportAssignment;return I(r.expression,t,"expression",e,1),t}function fhe(e){let t={type:"TSNamespaceExportDeclaration",id:e},r=X.TSNamespaceExportDeclaration;return I(r.id,t,"id",e,1),t}function hhe(e){let t={type:"TSTypeAnnotation",typeAnnotation:e},r=X.TSTypeAnnotation;return I(r.typeAnnotation,t,"typeAnnotation",e,1),t}function mhe(e){let t={type:"TSTypeParameterInstantiation",params:e},r=X.TSTypeParameterInstantiation;return I(r.params,t,"params",e,1),t}function ghe(e){let t={type:"TSTypeParameterDeclaration",params:e},r=X.TSTypeParameterDeclaration;return I(r.params,t,"params",e,1),t}function yhe(e=null,t=null,r){let n={type:"TSTypeParameter",constraint:e,default:t,name:r},s=X.TSTypeParameter;return I(s.constraint,n,"constraint",e,1),I(s.default,n,"default",t,1),I(s.name,n,"name",r),n}function _he(e){return(0,d_.default)("NumberLiteral","NumericLiteral","The node type "),bj(e)}function bhe(e,t=""){return(0,d_.default)("RegexLiteral","RegExpLiteral","The node type "),vj(e,t)}function vhe(e){return(0,d_.default)("RestProperty","RestElement","The node type "),xj(e)}function xhe(e){return(0,d_.default)("SpreadProperty","SpreadElement","The node type "),Sj(e)}});var Tj=G(T=>{"use strict";Object.defineProperty(T,"__esModule",{value:!0});T.JSXIdentifier=T.JSXFragment=T.JSXExpressionContainer=T.JSXEmptyExpression=T.JSXElement=T.JSXClosingFragment=T.JSXClosingElement=T.JSXAttribute=T.IntersectionTypeAnnotation=T.InterpreterDirective=T.InterfaceTypeAnnotation=T.InterfaceExtends=T.InterfaceDeclaration=T.InferredPredicate=T.IndexedAccessType=T.ImportSpecifier=T.ImportNamespaceSpecifier=T.ImportExpression=T.ImportDefaultSpecifier=T.ImportDeclaration=T.ImportAttribute=T.Import=T.IfStatement=T.Identifier=T.GenericTypeAnnotation=T.FunctionTypeParam=T.FunctionTypeAnnotation=T.FunctionExpression=T.FunctionDeclaration=T.ForStatement=T.ForOfStatement=T.ForInStatement=T.File=T.ExpressionStatement=T.ExportSpecifier=T.ExportNamespaceSpecifier=T.ExportNamedDeclaration=T.ExportDefaultSpecifier=T.ExportDefaultDeclaration=T.ExportAllDeclaration=T.ExistsTypeAnnotation=T.EnumSymbolBody=T.EnumStringMember=T.EnumStringBody=T.EnumNumberMember=T.EnumNumberBody=T.EnumDefaultedMember=T.EnumDeclaration=T.EnumBooleanMember=T.EnumBooleanBody=T.EmptyTypeAnnotation=T.EmptyStatement=T.DoWhileStatement=T.DoExpression=T.DirectiveLiteral=T.Directive=T.Decorator=T.DeclaredPredicate=T.DeclareVariable=T.DeclareTypeAlias=T.DeclareOpaqueType=T.DeclareModuleExports=T.DeclareModule=T.DeclareInterface=T.DeclareFunction=T.DeclareExportDeclaration=T.DeclareExportAllDeclaration=T.DeclareClass=T.DecimalLiteral=T.DebuggerStatement=T.ContinueStatement=T.ConditionalExpression=T.ClassProperty=T.ClassPrivateProperty=T.ClassPrivateMethod=T.ClassMethod=T.ClassImplements=T.ClassExpression=T.ClassDeclaration=T.ClassBody=T.ClassAccessorProperty=T.CatchClause=T.CallExpression=T.BreakStatement=T.BooleanTypeAnnotation=T.BooleanLiteralTypeAnnotation=T.BooleanLiteral=T.BlockStatement=T.BindExpression=T.BinaryExpression=T.BigIntLiteral=T.AwaitExpression=T.AssignmentPattern=T.AssignmentExpression=T.ArrowFunctionExpression=T.ArrayTypeAnnotation=T.ArrayPattern=T.ArrayExpression=T.ArgumentPlaceholder=T.AnyTypeAnnotation=void 0;T.TSNumberKeyword=T.TSNullKeyword=T.TSNonNullExpression=T.TSNeverKeyword=T.TSNamespaceExportDeclaration=T.TSNamedTupleMember=T.TSModuleDeclaration=T.TSModuleBlock=T.TSMethodSignature=T.TSMappedType=T.TSLiteralType=T.TSIntrinsicKeyword=T.TSIntersectionType=T.TSInterfaceDeclaration=T.TSInterfaceBody=T.TSInstantiationExpression=T.TSInferType=T.TSIndexedAccessType=T.TSIndexSignature=T.TSImportType=T.TSImportEqualsDeclaration=T.TSFunctionType=T.TSExternalModuleReference=T.TSExpressionWithTypeArguments=T.TSExportAssignment=T.TSEnumMember=T.TSEnumDeclaration=T.TSEnumBody=T.TSDeclareMethod=T.TSDeclareFunction=T.TSConstructorType=T.TSConstructSignatureDeclaration=T.TSConditionalType=T.TSCallSignatureDeclaration=T.TSBooleanKeyword=T.TSBigIntKeyword=T.TSAsExpression=T.TSArrayType=T.TSAnyKeyword=T.SymbolTypeAnnotation=T.SwitchStatement=T.SwitchCase=T.Super=T.StringTypeAnnotation=T.StringLiteralTypeAnnotation=T.StringLiteral=T.StaticBlock=T.SpreadProperty=T.SpreadElement=T.SequenceExpression=T.ReturnStatement=T.RestProperty=T.RestElement=T.RegexLiteral=T.RegExpLiteral=T.RecordExpression=T.QualifiedTypeIdentifier=T.Program=T.PrivateName=T.Placeholder=T.PipelineTopicExpression=T.PipelinePrimaryTopicReference=T.PipelineBareFunction=T.ParenthesizedExpression=T.OptionalMemberExpression=T.OptionalIndexedAccessType=T.OptionalCallExpression=T.OpaqueType=T.ObjectTypeSpreadProperty=T.ObjectTypeProperty=T.ObjectTypeInternalSlot=T.ObjectTypeIndexer=T.ObjectTypeCallProperty=T.ObjectTypeAnnotation=T.ObjectProperty=T.ObjectPattern=T.ObjectMethod=T.ObjectExpression=T.NumericLiteral=T.NumberTypeAnnotation=T.NumberLiteralTypeAnnotation=T.NumberLiteral=T.NullableTypeAnnotation=T.NullLiteralTypeAnnotation=T.NullLiteral=T.Noop=T.NewExpression=T.ModuleExpression=T.MixedTypeAnnotation=T.MetaProperty=T.MemberExpression=T.LogicalExpression=T.LabeledStatement=T.JSXText=T.JSXSpreadChild=T.JSXSpreadAttribute=T.JSXOpeningFragment=T.JSXOpeningElement=T.JSXNamespacedName=T.JSXMemberExpression=void 0;T.YieldExpression=T.WithStatement=T.WhileStatement=T.VoidTypeAnnotation=T.VoidPattern=T.Variance=T.VariableDeclarator=T.VariableDeclaration=T.V8IntrinsicIdentifier=T.UpdateExpression=T.UnionTypeAnnotation=T.UnaryExpression=T.TypeofTypeAnnotation=T.TypeParameterInstantiation=T.TypeParameterDeclaration=T.TypeParameter=T.TypeCastExpression=T.TypeAnnotation=T.TypeAlias=T.TupleTypeAnnotation=T.TupleExpression=T.TryStatement=T.TopicReference=T.ThrowStatement=T.ThisTypeAnnotation=T.ThisExpression=T.TemplateLiteral=T.TemplateElement=T.TaggedTemplateExpression=T.TSVoidKeyword=T.TSUnknownKeyword=T.TSUnionType=T.TSUndefinedKeyword=T.TSTypeReference=T.TSTypeQuery=T.TSTypePredicate=T.TSTypeParameterInstantiation=T.TSTypeParameterDeclaration=T.TSTypeParameter=T.TSTypeOperator=T.TSTypeLiteral=T.TSTypeAssertion=T.TSTypeAnnotation=T.TSTypeAliasDeclaration=T.TSTupleType=T.TSThisType=T.TSTemplateLiteralType=T.TSSymbolKeyword=T.TSStringKeyword=T.TSSatisfiesExpression=T.TSRestType=T.TSQualifiedName=T.TSPropertySignature=T.TSParenthesizedType=T.TSParameterProperty=T.TSOptionalType=T.TSObjectKeyword=void 0;var Rf=EI(),CXe=xu();function Z(e){return Rf[e]}var NXe=T.ArrayExpression=Z("arrayExpression"),OXe=T.AssignmentExpression=Z("assignmentExpression"),$Xe=T.BinaryExpression=Z("binaryExpression"),RXe=T.InterpreterDirective=Z("interpreterDirective"),DXe=T.Directive=Z("directive"),MXe=T.DirectiveLiteral=Z("directiveLiteral"),LXe=T.BlockStatement=Z("blockStatement"),FXe=T.BreakStatement=Z("breakStatement"),jXe=T.CallExpression=Z("callExpression"),BXe=T.CatchClause=Z("catchClause"),zXe=T.ConditionalExpression=Z("conditionalExpression"),UXe=T.ContinueStatement=Z("continueStatement"),qXe=T.DebuggerStatement=Z("debuggerStatement"),WXe=T.DoWhileStatement=Z("doWhileStatement"),VXe=T.EmptyStatement=Z("emptyStatement"),KXe=T.ExpressionStatement=Z("expressionStatement"),GXe=T.File=Z("file"),ZXe=T.ForInStatement=Z("forInStatement"),HXe=T.ForStatement=Z("forStatement"),JXe=T.FunctionDeclaration=Z("functionDeclaration"),YXe=T.FunctionExpression=Z("functionExpression"),XXe=T.Identifier=Z("identifier"),QXe=T.IfStatement=Z("ifStatement"),eQe=T.LabeledStatement=Z("labeledStatement"),tQe=T.StringLiteral=Z("stringLiteral"),rQe=T.NumericLiteral=Z("numericLiteral"),nQe=T.NullLiteral=Z("nullLiteral"),iQe=T.BooleanLiteral=Z("booleanLiteral"),sQe=T.RegExpLiteral=Z("regExpLiteral"),aQe=T.LogicalExpression=Z("logicalExpression"),oQe=T.MemberExpression=Z("memberExpression"),cQe=T.NewExpression=Z("newExpression"),lQe=T.Program=Z("program"),uQe=T.ObjectExpression=Z("objectExpression"),dQe=T.ObjectMethod=Z("objectMethod"),pQe=T.ObjectProperty=Z("objectProperty"),fQe=T.RestElement=Z("restElement"),hQe=T.ReturnStatement=Z("returnStatement"),mQe=T.SequenceExpression=Z("sequenceExpression"),gQe=T.ParenthesizedExpression=Z("parenthesizedExpression"),yQe=T.SwitchCase=Z("switchCase"),_Qe=T.SwitchStatement=Z("switchStatement"),bQe=T.ThisExpression=Z("thisExpression"),vQe=T.ThrowStatement=Z("throwStatement"),xQe=T.TryStatement=Z("tryStatement"),SQe=T.UnaryExpression=Z("unaryExpression"),TQe=T.UpdateExpression=Z("updateExpression"),wQe=T.VariableDeclaration=Z("variableDeclaration"),EQe=T.VariableDeclarator=Z("variableDeclarator"),PQe=T.WhileStatement=Z("whileStatement"),IQe=T.WithStatement=Z("withStatement"),AQe=T.AssignmentPattern=Z("assignmentPattern"),kQe=T.ArrayPattern=Z("arrayPattern"),CQe=T.ArrowFunctionExpression=Z("arrowFunctionExpression"),NQe=T.ClassBody=Z("classBody"),OQe=T.ClassExpression=Z("classExpression"),$Qe=T.ClassDeclaration=Z("classDeclaration"),RQe=T.ExportAllDeclaration=Z("exportAllDeclaration"),DQe=T.ExportDefaultDeclaration=Z("exportDefaultDeclaration"),MQe=T.ExportNamedDeclaration=Z("exportNamedDeclaration"),LQe=T.ExportSpecifier=Z("exportSpecifier"),FQe=T.ForOfStatement=Z("forOfStatement"),jQe=T.ImportDeclaration=Z("importDeclaration"),BQe=T.ImportDefaultSpecifier=Z("importDefaultSpecifier"),zQe=T.ImportNamespaceSpecifier=Z("importNamespaceSpecifier"),UQe=T.ImportSpecifier=Z("importSpecifier"),qQe=T.ImportExpression=Z("importExpression"),WQe=T.MetaProperty=Z("metaProperty"),VQe=T.ClassMethod=Z("classMethod"),KQe=T.ObjectPattern=Z("objectPattern"),GQe=T.SpreadElement=Z("spreadElement"),ZQe=T.Super=Z("super"),HQe=T.TaggedTemplateExpression=Z("taggedTemplateExpression"),JQe=T.TemplateElement=Z("templateElement"),YQe=T.TemplateLiteral=Z("templateLiteral"),XQe=T.YieldExpression=Z("yieldExpression"),QQe=T.AwaitExpression=Z("awaitExpression"),eet=T.Import=Z("import"),tet=T.BigIntLiteral=Z("bigIntLiteral"),ret=T.ExportNamespaceSpecifier=Z("exportNamespaceSpecifier"),net=T.OptionalMemberExpression=Z("optionalMemberExpression"),iet=T.OptionalCallExpression=Z("optionalCallExpression"),set=T.ClassProperty=Z("classProperty"),aet=T.ClassAccessorProperty=Z("classAccessorProperty"),oet=T.ClassPrivateProperty=Z("classPrivateProperty"),cet=T.ClassPrivateMethod=Z("classPrivateMethod"),uet=T.PrivateName=Z("privateName"),det=T.StaticBlock=Z("staticBlock"),pet=T.ImportAttribute=Z("importAttribute"),fet=T.AnyTypeAnnotation=Z("anyTypeAnnotation"),het=T.ArrayTypeAnnotation=Z("arrayTypeAnnotation"),met=T.BooleanTypeAnnotation=Z("booleanTypeAnnotation"),get=T.BooleanLiteralTypeAnnotation=Z("booleanLiteralTypeAnnotation"),yet=T.NullLiteralTypeAnnotation=Z("nullLiteralTypeAnnotation"),_et=T.ClassImplements=Z("classImplements"),bet=T.DeclareClass=Z("declareClass"),vet=T.DeclareFunction=Z("declareFunction"),xet=T.DeclareInterface=Z("declareInterface"),Tet=T.DeclareModule=Z("declareModule"),wet=T.DeclareModuleExports=Z("declareModuleExports"),Eet=T.DeclareTypeAlias=Z("declareTypeAlias"),Pet=T.DeclareOpaqueType=Z("declareOpaqueType"),Iet=T.DeclareVariable=Z("declareVariable"),Aet=T.DeclareExportDeclaration=Z("declareExportDeclaration"),ket=T.DeclareExportAllDeclaration=Z("declareExportAllDeclaration"),Cet=T.DeclaredPredicate=Z("declaredPredicate"),Net=T.ExistsTypeAnnotation=Z("existsTypeAnnotation"),Oet=T.FunctionTypeAnnotation=Z("functionTypeAnnotation"),$et=T.FunctionTypeParam=Z("functionTypeParam"),Ret=T.GenericTypeAnnotation=Z("genericTypeAnnotation"),Det=T.InferredPredicate=Z("inferredPredicate"),Met=T.InterfaceExtends=Z("interfaceExtends"),Let=T.InterfaceDeclaration=Z("interfaceDeclaration"),Fet=T.InterfaceTypeAnnotation=Z("interfaceTypeAnnotation"),jet=T.IntersectionTypeAnnotation=Z("intersectionTypeAnnotation"),Bet=T.MixedTypeAnnotation=Z("mixedTypeAnnotation"),zet=T.EmptyTypeAnnotation=Z("emptyTypeAnnotation"),Uet=T.NullableTypeAnnotation=Z("nullableTypeAnnotation"),qet=T.NumberLiteralTypeAnnotation=Z("numberLiteralTypeAnnotation"),Wet=T.NumberTypeAnnotation=Z("numberTypeAnnotation"),Vet=T.ObjectTypeAnnotation=Z("objectTypeAnnotation"),Ket=T.ObjectTypeInternalSlot=Z("objectTypeInternalSlot"),Get=T.ObjectTypeCallProperty=Z("objectTypeCallProperty"),Zet=T.ObjectTypeIndexer=Z("objectTypeIndexer"),Het=T.ObjectTypeProperty=Z("objectTypeProperty"),Jet=T.ObjectTypeSpreadProperty=Z("objectTypeSpreadProperty"),Yet=T.OpaqueType=Z("opaqueType"),Xet=T.QualifiedTypeIdentifier=Z("qualifiedTypeIdentifier"),Qet=T.StringLiteralTypeAnnotation=Z("stringLiteralTypeAnnotation"),ett=T.StringTypeAnnotation=Z("stringTypeAnnotation"),ttt=T.SymbolTypeAnnotation=Z("symbolTypeAnnotation"),rtt=T.ThisTypeAnnotation=Z("thisTypeAnnotation"),ntt=T.TupleTypeAnnotation=Z("tupleTypeAnnotation"),itt=T.TypeofTypeAnnotation=Z("typeofTypeAnnotation"),stt=T.TypeAlias=Z("typeAlias"),att=T.TypeAnnotation=Z("typeAnnotation"),ott=T.TypeCastExpression=Z("typeCastExpression"),ctt=T.TypeParameter=Z("typeParameter"),ltt=T.TypeParameterDeclaration=Z("typeParameterDeclaration"),utt=T.TypeParameterInstantiation=Z("typeParameterInstantiation"),dtt=T.UnionTypeAnnotation=Z("unionTypeAnnotation"),ptt=T.Variance=Z("variance"),ftt=T.VoidTypeAnnotation=Z("voidTypeAnnotation"),htt=T.EnumDeclaration=Z("enumDeclaration"),mtt=T.EnumBooleanBody=Z("enumBooleanBody"),gtt=T.EnumNumberBody=Z("enumNumberBody"),ytt=T.EnumStringBody=Z("enumStringBody"),_tt=T.EnumSymbolBody=Z("enumSymbolBody"),btt=T.EnumBooleanMember=Z("enumBooleanMember"),vtt=T.EnumNumberMember=Z("enumNumberMember"),xtt=T.EnumStringMember=Z("enumStringMember"),Stt=T.EnumDefaultedMember=Z("enumDefaultedMember"),Ttt=T.IndexedAccessType=Z("indexedAccessType"),wtt=T.OptionalIndexedAccessType=Z("optionalIndexedAccessType"),Ett=T.JSXAttribute=Z("jsxAttribute"),Ptt=T.JSXClosingElement=Z("jsxClosingElement"),Itt=T.JSXElement=Z("jsxElement"),Att=T.JSXEmptyExpression=Z("jsxEmptyExpression"),ktt=T.JSXExpressionContainer=Z("jsxExpressionContainer"),Ctt=T.JSXSpreadChild=Z("jsxSpreadChild"),Ntt=T.JSXIdentifier=Z("jsxIdentifier"),Ott=T.JSXMemberExpression=Z("jsxMemberExpression"),$tt=T.JSXNamespacedName=Z("jsxNamespacedName"),Rtt=T.JSXOpeningElement=Z("jsxOpeningElement"),Dtt=T.JSXSpreadAttribute=Z("jsxSpreadAttribute"),Mtt=T.JSXText=Z("jsxText"),Ltt=T.JSXFragment=Z("jsxFragment"),Ftt=T.JSXOpeningFragment=Z("jsxOpeningFragment"),jtt=T.JSXClosingFragment=Z("jsxClosingFragment"),Btt=T.Noop=Z("noop"),ztt=T.Placeholder=Z("placeholder"),Utt=T.V8IntrinsicIdentifier=Z("v8IntrinsicIdentifier"),qtt=T.ArgumentPlaceholder=Z("argumentPlaceholder"),Wtt=T.BindExpression=Z("bindExpression"),Vtt=T.Decorator=Z("decorator"),Ktt=T.DoExpression=Z("doExpression"),Gtt=T.ExportDefaultSpecifier=Z("exportDefaultSpecifier"),Ztt=T.RecordExpression=Z("recordExpression"),Htt=T.TupleExpression=Z("tupleExpression"),Jtt=T.DecimalLiteral=Z("decimalLiteral"),Ytt=T.ModuleExpression=Z("moduleExpression"),Xtt=T.TopicReference=Z("topicReference"),Qtt=T.PipelineTopicExpression=Z("pipelineTopicExpression"),ert=T.PipelineBareFunction=Z("pipelineBareFunction"),trt=T.PipelinePrimaryTopicReference=Z("pipelinePrimaryTopicReference"),rrt=T.VoidPattern=Z("voidPattern"),nrt=T.TSParameterProperty=Z("tsParameterProperty"),irt=T.TSDeclareFunction=Z("tsDeclareFunction"),srt=T.TSDeclareMethod=Z("tsDeclareMethod"),art=T.TSQualifiedName=Z("tsQualifiedName"),ort=T.TSCallSignatureDeclaration=Z("tsCallSignatureDeclaration"),crt=T.TSConstructSignatureDeclaration=Z("tsConstructSignatureDeclaration"),lrt=T.TSPropertySignature=Z("tsPropertySignature"),urt=T.TSMethodSignature=Z("tsMethodSignature"),drt=T.TSIndexSignature=Z("tsIndexSignature"),prt=T.TSAnyKeyword=Z("tsAnyKeyword"),frt=T.TSBooleanKeyword=Z("tsBooleanKeyword"),hrt=T.TSBigIntKeyword=Z("tsBigIntKeyword"),mrt=T.TSIntrinsicKeyword=Z("tsIntrinsicKeyword"),grt=T.TSNeverKeyword=Z("tsNeverKeyword"),yrt=T.TSNullKeyword=Z("tsNullKeyword"),_rt=T.TSNumberKeyword=Z("tsNumberKeyword"),brt=T.TSObjectKeyword=Z("tsObjectKeyword"),vrt=T.TSStringKeyword=Z("tsStringKeyword"),xrt=T.TSSymbolKeyword=Z("tsSymbolKeyword"),Srt=T.TSUndefinedKeyword=Z("tsUndefinedKeyword"),Trt=T.TSUnknownKeyword=Z("tsUnknownKeyword"),wrt=T.TSVoidKeyword=Z("tsVoidKeyword"),Ert=T.TSThisType=Z("tsThisType"),Prt=T.TSFunctionType=Z("tsFunctionType"),Irt=T.TSConstructorType=Z("tsConstructorType"),Art=T.TSTypeReference=Z("tsTypeReference"),krt=T.TSTypePredicate=Z("tsTypePredicate"),Crt=T.TSTypeQuery=Z("tsTypeQuery"),Nrt=T.TSTypeLiteral=Z("tsTypeLiteral"),Ort=T.TSArrayType=Z("tsArrayType"),$rt=T.TSTupleType=Z("tsTupleType"),Rrt=T.TSOptionalType=Z("tsOptionalType"),Drt=T.TSRestType=Z("tsRestType"),Mrt=T.TSNamedTupleMember=Z("tsNamedTupleMember"),Lrt=T.TSUnionType=Z("tsUnionType"),Frt=T.TSIntersectionType=Z("tsIntersectionType"),jrt=T.TSConditionalType=Z("tsConditionalType"),Brt=T.TSInferType=Z("tsInferType"),zrt=T.TSParenthesizedType=Z("tsParenthesizedType"),Urt=T.TSTypeOperator=Z("tsTypeOperator"),qrt=T.TSIndexedAccessType=Z("tsIndexedAccessType"),Wrt=T.TSMappedType=Z("tsMappedType"),Vrt=T.TSTemplateLiteralType=Z("tsTemplateLiteralType"),Krt=T.TSLiteralType=Z("tsLiteralType"),Grt=T.TSExpressionWithTypeArguments=Z("tsExpressionWithTypeArguments"),Zrt=T.TSInterfaceDeclaration=Z("tsInterfaceDeclaration"),Hrt=T.TSInterfaceBody=Z("tsInterfaceBody"),Jrt=T.TSTypeAliasDeclaration=Z("tsTypeAliasDeclaration"),Yrt=T.TSInstantiationExpression=Z("tsInstantiationExpression"),Xrt=T.TSAsExpression=Z("tsAsExpression"),Qrt=T.TSSatisfiesExpression=Z("tsSatisfiesExpression"),ent=T.TSTypeAssertion=Z("tsTypeAssertion"),tnt=T.TSEnumBody=Z("tsEnumBody"),rnt=T.TSEnumDeclaration=Z("tsEnumDeclaration"),nnt=T.TSEnumMember=Z("tsEnumMember"),int=T.TSModuleDeclaration=Z("tsModuleDeclaration"),snt=T.TSModuleBlock=Z("tsModuleBlock"),ant=T.TSImportType=Z("tsImportType"),ont=T.TSImportEqualsDeclaration=Z("tsImportEqualsDeclaration"),cnt=T.TSExternalModuleReference=Z("tsExternalModuleReference"),lnt=T.TSNonNullExpression=Z("tsNonNullExpression"),unt=T.TSExportAssignment=Z("tsExportAssignment"),dnt=T.TSNamespaceExportDeclaration=Z("tsNamespaceExportDeclaration"),pnt=T.TSTypeAnnotation=Z("tsTypeAnnotation"),fnt=T.TSTypeParameterInstantiation=Z("tsTypeParameterInstantiation"),hnt=T.TSTypeParameterDeclaration=Z("tsTypeParameterDeclaration"),mnt=T.TSTypeParameter=Z("tsTypeParameter"),gnt=T.NumberLiteral=Rf.numberLiteral,ynt=T.RegexLiteral=Rf.regexLiteral,_nt=T.RestProperty=Rf.restProperty,bnt=T.SpreadProperty=Rf.spreadProperty});var fi=G(vo=>{"use strict";Object.defineProperty(vo,"__esModule",{value:!0});var PI=EI();Object.keys(PI).forEach(function(e){e==="default"||e==="__esModule"||e in vo&&vo[e]===PI[e]||Object.defineProperty(vo,e,{enumerable:!0,get:function(){return PI[e]}})});var II=Tj();Object.keys(II).forEach(function(e){e==="default"||e==="__esModule"||e in vo&&vo[e]===II[e]||Object.defineProperty(vo,e,{enumerable:!0,get:function(){return II[e]}})})});var wj=G(AI=>{"use strict";Object.defineProperty(AI,"__esModule",{value:!0});AI.default=whe;var She=fi(),The=Rt();function whe(e,t){let r=e.value.split(/\r\n|\n|\r/),n=0;for(let a=0;a<r.length;a++)/[^ \t]/.exec(r[a])&&(n=a);let s="";for(let a=0;a<r.length;a++){let o=r[a],c=a===0,l=a===r.length-1,u=a===n,d=o.replace(/\t/g," ");c||(d=d.replace(/^ +/,"")),l||(d=d.replace(/ +$/,"")),d&&(u||(d+=" "),s+=d)}s&&t.push((0,The.inherits)((0,She.stringLiteral)(s),e))}});var Ej=G(CI=>{"use strict";Object.defineProperty(CI,"__esModule",{value:!0});CI.default=Phe;var kI=Vr(),Ehe=wj();function Phe(e){let t=[];for(let r=0;r<e.children.length;r++){let n=e.children[r];if((0,kI.isJSXText)(n)){(0,Ehe.default)(n,t);continue}(0,kI.isJSXExpressionContainer)(n)&&(n=n.expression),!(0,kI.isJSXEmptyExpression)(n)&&t.push(n)}return t}});var OI=G(NI=>{"use strict";Object.defineProperty(NI,"__esModule",{value:!0});NI.default=Ahe;var Ihe=Wi();function Ahe(e){return!!(e&&Ihe.VISITOR_KEYS[e.type])}});var Pj=G($I=>{"use strict";Object.defineProperty($I,"__esModule",{value:!0});$I.default=Che;var khe=OI();function Che(e){if(!(0,khe.default)(e)){var t;let r=(t=e?.type)!=null?t:JSON.stringify(e);throw new TypeError(`Not a valid node of type "${r}"`)}}});var Ij=G(F=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0});F.assertAccessor=Jbe;F.assertAnyTypeAnnotation=fge;F.assertArgumentPlaceholder=Uye;F.assertArrayExpression=Ohe;F.assertArrayPattern=Cme;F.assertArrayTypeAnnotation=hge;F.assertArrowFunctionExpression=Nme;F.assertAssignmentExpression=$he;F.assertAssignmentPattern=kme;F.assertAwaitExpression=ege;F.assertBigIntLiteral=rge;F.assertBinary=ybe;F.assertBinaryExpression=Rhe;F.assertBindExpression=qye;F.assertBlock=vbe;F.assertBlockParent=bbe;F.assertBlockStatement=Fhe;F.assertBooleanLiteral=sme;F.assertBooleanLiteralTypeAnnotation=gge;F.assertBooleanTypeAnnotation=mge;F.assertBreakStatement=jhe;F.assertCallExpression=Bhe;F.assertCatchClause=zhe;F.assertClass=Kbe;F.assertClassAccessorProperty=oge;F.assertClassBody=Ome;F.assertClassDeclaration=Rme;F.assertClassExpression=$me;F.assertClassImplements=_ge;F.assertClassMethod=Kme;F.assertClassPrivateMethod=lge;F.assertClassPrivateProperty=cge;F.assertClassProperty=age;F.assertCompletionStatement=Tbe;F.assertConditional=wbe;F.assertConditionalExpression=Uhe;F.assertContinueStatement=qhe;F.assertDebuggerStatement=Whe;F.assertDecimalLiteral=Hye;F.assertDeclaration=$be;F.assertDeclareClass=bge;F.assertDeclareExportAllDeclaration=Age;F.assertDeclareExportDeclaration=Ige;F.assertDeclareFunction=vge;F.assertDeclareInterface=xge;F.assertDeclareModule=Sge;F.assertDeclareModuleExports=Tge;F.assertDeclareOpaqueType=Ege;F.assertDeclareTypeAlias=wge;F.assertDeclareVariable=Pge;F.assertDeclaredPredicate=kge;F.assertDecorator=Wye;F.assertDirective=Mhe;F.assertDirectiveLiteral=Lhe;F.assertDoExpression=Vye;F.assertDoWhileStatement=Vhe;F.assertEmptyStatement=Khe;F.assertEmptyTypeAnnotation=Bge;F.assertEnumBody=nve;F.assertEnumBooleanBody=hye;F.assertEnumBooleanMember=_ye;F.assertEnumDeclaration=fye;F.assertEnumDefaultedMember=xye;F.assertEnumMember=ive;F.assertEnumNumberBody=mye;F.assertEnumNumberMember=bye;F.assertEnumStringBody=gye;F.assertEnumStringMember=vye;F.assertEnumSymbolBody=yye;F.assertExistsTypeAnnotation=Cge;F.assertExportAllDeclaration=Dme;F.assertExportDeclaration=Zbe;F.assertExportDefaultDeclaration=Mme;F.assertExportDefaultSpecifier=Kye;F.assertExportNamedDeclaration=Lme;F.assertExportNamespaceSpecifier=nge;F.assertExportSpecifier=Fme;F.assertExpression=gbe;F.assertExpressionStatement=Ghe;F.assertExpressionWrapper=Ibe;F.assertFile=Zhe;F.assertFlow=Xbe;F.assertFlowBaseAnnotation=eve;F.assertFlowDeclaration=tve;F.assertFlowPredicate=rve;F.assertFlowType=Qbe;F.assertFor=Abe;F.assertForInStatement=Hhe;F.assertForOfStatement=jme;F.assertForStatement=Jhe;F.assertForXStatement=kbe;F.assertFunction=Cbe;F.assertFunctionDeclaration=Yhe;F.assertFunctionExpression=Xhe;F.assertFunctionParameter=Rbe;F.assertFunctionParent=Nbe;F.assertFunctionTypeAnnotation=Nge;F.assertFunctionTypeParam=Oge;F.assertGenericTypeAnnotation=$ge;F.assertIdentifier=Qhe;F.assertIfStatement=eme;F.assertImmutable=jbe;F.assertImport=tge;F.assertImportAttribute=pge;F.assertImportDeclaration=Bme;F.assertImportDefaultSpecifier=zme;F.assertImportExpression=Wme;F.assertImportNamespaceSpecifier=Ume;F.assertImportOrExportDeclaration=Gbe;F.assertImportSpecifier=qme;F.assertIndexedAccessType=Sye;F.assertInferredPredicate=Rge;F.assertInterfaceDeclaration=Mge;F.assertInterfaceExtends=Dge;F.assertInterfaceTypeAnnotation=Lge;F.assertInterpreterDirective=Dhe;F.assertIntersectionTypeAnnotation=Fge;F.assertJSX=sve;F.assertJSXAttribute=wye;F.assertJSXClosingElement=Eye;F.assertJSXClosingFragment=Fye;F.assertJSXElement=Pye;F.assertJSXEmptyExpression=Iye;F.assertJSXExpressionContainer=Aye;F.assertJSXFragment=Mye;F.assertJSXIdentifier=Cye;F.assertJSXMemberExpression=Nye;F.assertJSXNamespacedName=Oye;F.assertJSXOpeningElement=$ye;F.assertJSXOpeningFragment=Lye;F.assertJSXSpreadAttribute=Rye;F.assertJSXSpreadChild=kye;F.assertJSXText=Dye;F.assertLVal=Mbe;F.assertLabeledStatement=tme;F.assertLiteral=Fbe;F.assertLogicalExpression=ome;F.assertLoop=Ebe;F.assertMemberExpression=cme;F.assertMetaProperty=Vme;F.assertMethod=zbe;F.assertMiscellaneous=ave;F.assertMixedTypeAnnotation=jge;F.assertModuleDeclaration=mve;F.assertModuleExpression=Jye;F.assertModuleSpecifier=Hbe;F.assertNewExpression=lme;F.assertNoop=jye;F.assertNullLiteral=ime;F.assertNullLiteralTypeAnnotation=yge;F.assertNullableTypeAnnotation=zge;F.assertNumberLiteral=dve;F.assertNumberLiteralTypeAnnotation=Uge;F.assertNumberTypeAnnotation=qge;F.assertNumericLiteral=nme;F.assertObjectExpression=dme;F.assertObjectMember=Ube;F.assertObjectMethod=pme;F.assertObjectPattern=Gme;F.assertObjectProperty=fme;F.assertObjectTypeAnnotation=Wge;F.assertObjectTypeCallProperty=Kge;F.assertObjectTypeIndexer=Gge;F.assertObjectTypeInternalSlot=Vge;F.assertObjectTypeProperty=Zge;F.assertObjectTypeSpreadProperty=Hge;F.assertOpaqueType=Jge;F.assertOptionalCallExpression=sge;F.assertOptionalIndexedAccessType=Tye;F.assertOptionalMemberExpression=ige;F.assertParenthesizedExpression=yme;F.assertPattern=Vbe;F.assertPatternLike=Dbe;F.assertPipelineBareFunction=Qye;F.assertPipelinePrimaryTopicReference=e_e;F.assertPipelineTopicExpression=Xye;F.assertPlaceholder=Bye;F.assertPrivate=Ybe;F.assertPrivateName=uge;F.assertProgram=ume;F.assertProperty=qbe;F.assertPureish=Obe;F.assertQualifiedTypeIdentifier=Yge;F.assertRecordExpression=Gye;F.assertRegExpLiteral=ame;F.assertRegexLiteral=pve;F.assertRestElement=hme;F.assertRestProperty=fve;F.assertReturnStatement=mme;F.assertScopable=_be;F.assertSequenceExpression=gme;F.assertSpreadElement=Zme;F.assertSpreadProperty=hve;F.assertStandardized=mbe;F.assertStatement=xbe;F.assertStaticBlock=dge;F.assertStringLiteral=rme;F.assertStringLiteralTypeAnnotation=Xge;F.assertStringTypeAnnotation=Qge;F.assertSuper=Hme;F.assertSwitchCase=_me;F.assertSwitchStatement=bme;F.assertSymbolTypeAnnotation=eye;F.assertTSAnyKeyword=d_e;F.assertTSArrayType=N_e;F.assertTSAsExpression=Y_e;F.assertTSBaseType=uve;F.assertTSBigIntKeyword=f_e;F.assertTSBooleanKeyword=p_e;F.assertTSCallSignatureDeclaration=a_e;F.assertTSConditionalType=F_e;F.assertTSConstructSignatureDeclaration=o_e;F.assertTSConstructorType=P_e;F.assertTSDeclareFunction=n_e;F.assertTSDeclareMethod=i_e;F.assertTSEntityName=Lbe;F.assertTSEnumBody=ebe;F.assertTSEnumDeclaration=tbe;F.assertTSEnumMember=rbe;F.assertTSExportAssignment=lbe;F.assertTSExpressionWithTypeArguments=K_e;F.assertTSExternalModuleReference=obe;F.assertTSFunctionType=E_e;F.assertTSImportEqualsDeclaration=abe;F.assertTSImportType=sbe;F.assertTSIndexSignature=u_e;F.assertTSIndexedAccessType=U_e;F.assertTSInferType=j_e;F.assertTSInstantiationExpression=J_e;F.assertTSInterfaceBody=Z_e;F.assertTSInterfaceDeclaration=G_e;F.assertTSIntersectionType=L_e;F.assertTSIntrinsicKeyword=h_e;F.assertTSLiteralType=V_e;F.assertTSMappedType=q_e;F.assertTSMethodSignature=l_e;F.assertTSModuleBlock=ibe;F.assertTSModuleDeclaration=nbe;F.assertTSNamedTupleMember=D_e;F.assertTSNamespaceExportDeclaration=ube;F.assertTSNeverKeyword=m_e;F.assertTSNonNullExpression=cbe;F.assertTSNullKeyword=g_e;F.assertTSNumberKeyword=y_e;F.assertTSObjectKeyword=__e;F.assertTSOptionalType=$_e;F.assertTSParameterProperty=r_e;F.assertTSParenthesizedType=B_e;F.assertTSPropertySignature=c_e;F.assertTSQualifiedName=s_e;F.assertTSRestType=R_e;F.assertTSSatisfiesExpression=X_e;F.assertTSStringKeyword=b_e;F.assertTSSymbolKeyword=v_e;F.assertTSTemplateLiteralType=W_e;F.assertTSThisType=w_e;F.assertTSTupleType=O_e;F.assertTSType=lve;F.assertTSTypeAliasDeclaration=H_e;F.assertTSTypeAnnotation=dbe;F.assertTSTypeAssertion=Q_e;F.assertTSTypeElement=cve;F.assertTSTypeLiteral=C_e;F.assertTSTypeOperator=z_e;F.assertTSTypeParameter=hbe;F.assertTSTypeParameterDeclaration=fbe;F.assertTSTypeParameterInstantiation=pbe;F.assertTSTypePredicate=A_e;F.assertTSTypeQuery=k_e;F.assertTSTypeReference=I_e;F.assertTSUndefinedKeyword=x_e;F.assertTSUnionType=M_e;F.assertTSUnknownKeyword=S_e;F.assertTSVoidKeyword=T_e;F.assertTaggedTemplateExpression=Jme;F.assertTemplateElement=Yme;F.assertTemplateLiteral=Xme;F.assertTerminatorless=Sbe;F.assertThisExpression=vme;F.assertThisTypeAnnotation=tye;F.assertThrowStatement=xme;F.assertTopicReference=Yye;F.assertTryStatement=Sme;F.assertTupleExpression=Zye;F.assertTupleTypeAnnotation=rye;F.assertTypeAlias=iye;F.assertTypeAnnotation=sye;F.assertTypeCastExpression=aye;F.assertTypeParameter=oye;F.assertTypeParameterDeclaration=cye;F.assertTypeParameterInstantiation=lye;F.assertTypeScript=ove;F.assertTypeofTypeAnnotation=nye;F.assertUnaryExpression=Tme;F.assertUnaryLike=Wbe;F.assertUnionTypeAnnotation=uye;F.assertUpdateExpression=wme;F.assertUserWhitespacable=Bbe;F.assertV8IntrinsicIdentifier=zye;F.assertVariableDeclaration=Eme;F.assertVariableDeclarator=Pme;F.assertVariance=dye;F.assertVoidPattern=t_e;F.assertVoidTypeAnnotation=pye;F.assertWhile=Pbe;F.assertWhileStatement=Ime;F.assertWithStatement=Ame;F.assertYieldExpression=Qme;var Nhe=Su(),Df=xu();function j(e,t,r){if(!(0,Nhe.default)(e,t,r))throw new Error(`Expected type "${e}" with option ${JSON.stringify(r)}, but instead got "${t.type}".`)}function Ohe(e,t){j("ArrayExpression",e,t)}function $he(e,t){j("AssignmentExpression",e,t)}function Rhe(e,t){j("BinaryExpression",e,t)}function Dhe(e,t){j("InterpreterDirective",e,t)}function Mhe(e,t){j("Directive",e,t)}function Lhe(e,t){j("DirectiveLiteral",e,t)}function Fhe(e,t){j("BlockStatement",e,t)}function jhe(e,t){j("BreakStatement",e,t)}function Bhe(e,t){j("CallExpression",e,t)}function zhe(e,t){j("CatchClause",e,t)}function Uhe(e,t){j("ConditionalExpression",e,t)}function qhe(e,t){j("ContinueStatement",e,t)}function Whe(e,t){j("DebuggerStatement",e,t)}function Vhe(e,t){j("DoWhileStatement",e,t)}function Khe(e,t){j("EmptyStatement",e,t)}function Ghe(e,t){j("ExpressionStatement",e,t)}function Zhe(e,t){j("File",e,t)}function Hhe(e,t){j("ForInStatement",e,t)}function Jhe(e,t){j("ForStatement",e,t)}function Yhe(e,t){j("FunctionDeclaration",e,t)}function Xhe(e,t){j("FunctionExpression",e,t)}function Qhe(e,t){j("Identifier",e,t)}function eme(e,t){j("IfStatement",e,t)}function tme(e,t){j("LabeledStatement",e,t)}function rme(e,t){j("StringLiteral",e,t)}function nme(e,t){j("NumericLiteral",e,t)}function ime(e,t){j("NullLiteral",e,t)}function sme(e,t){j("BooleanLiteral",e,t)}function ame(e,t){j("RegExpLiteral",e,t)}function ome(e,t){j("LogicalExpression",e,t)}function cme(e,t){j("MemberExpression",e,t)}function lme(e,t){j("NewExpression",e,t)}function ume(e,t){j("Program",e,t)}function dme(e,t){j("ObjectExpression",e,t)}function pme(e,t){j("ObjectMethod",e,t)}function fme(e,t){j("ObjectProperty",e,t)}function hme(e,t){j("RestElement",e,t)}function mme(e,t){j("ReturnStatement",e,t)}function gme(e,t){j("SequenceExpression",e,t)}function yme(e,t){j("ParenthesizedExpression",e,t)}function _me(e,t){j("SwitchCase",e,t)}function bme(e,t){j("SwitchStatement",e,t)}function vme(e,t){j("ThisExpression",e,t)}function xme(e,t){j("ThrowStatement",e,t)}function Sme(e,t){j("TryStatement",e,t)}function Tme(e,t){j("UnaryExpression",e,t)}function wme(e,t){j("UpdateExpression",e,t)}function Eme(e,t){j("VariableDeclaration",e,t)}function Pme(e,t){j("VariableDeclarator",e,t)}function Ime(e,t){j("WhileStatement",e,t)}function Ame(e,t){j("WithStatement",e,t)}function kme(e,t){j("AssignmentPattern",e,t)}function Cme(e,t){j("ArrayPattern",e,t)}function Nme(e,t){j("ArrowFunctionExpression",e,t)}function Ome(e,t){j("ClassBody",e,t)}function $me(e,t){j("ClassExpression",e,t)}function Rme(e,t){j("ClassDeclaration",e,t)}function Dme(e,t){j("ExportAllDeclaration",e,t)}function Mme(e,t){j("ExportDefaultDeclaration",e,t)}function Lme(e,t){j("ExportNamedDeclaration",e,t)}function Fme(e,t){j("ExportSpecifier",e,t)}function jme(e,t){j("ForOfStatement",e,t)}function Bme(e,t){j("ImportDeclaration",e,t)}function zme(e,t){j("ImportDefaultSpecifier",e,t)}function Ume(e,t){j("ImportNamespaceSpecifier",e,t)}function qme(e,t){j("ImportSpecifier",e,t)}function Wme(e,t){j("ImportExpression",e,t)}function Vme(e,t){j("MetaProperty",e,t)}function Kme(e,t){j("ClassMethod",e,t)}function Gme(e,t){j("ObjectPattern",e,t)}function Zme(e,t){j("SpreadElement",e,t)}function Hme(e,t){j("Super",e,t)}function Jme(e,t){j("TaggedTemplateExpression",e,t)}function Yme(e,t){j("TemplateElement",e,t)}function Xme(e,t){j("TemplateLiteral",e,t)}function Qme(e,t){j("YieldExpression",e,t)}function ege(e,t){j("AwaitExpression",e,t)}function tge(e,t){j("Import",e,t)}function rge(e,t){j("BigIntLiteral",e,t)}function nge(e,t){j("ExportNamespaceSpecifier",e,t)}function ige(e,t){j("OptionalMemberExpression",e,t)}function sge(e,t){j("OptionalCallExpression",e,t)}function age(e,t){j("ClassProperty",e,t)}function oge(e,t){j("ClassAccessorProperty",e,t)}function cge(e,t){j("ClassPrivateProperty",e,t)}function lge(e,t){j("ClassPrivateMethod",e,t)}function uge(e,t){j("PrivateName",e,t)}function dge(e,t){j("StaticBlock",e,t)}function pge(e,t){j("ImportAttribute",e,t)}function fge(e,t){j("AnyTypeAnnotation",e,t)}function hge(e,t){j("ArrayTypeAnnotation",e,t)}function mge(e,t){j("BooleanTypeAnnotation",e,t)}function gge(e,t){j("BooleanLiteralTypeAnnotation",e,t)}function yge(e,t){j("NullLiteralTypeAnnotation",e,t)}function _ge(e,t){j("ClassImplements",e,t)}function bge(e,t){j("DeclareClass",e,t)}function vge(e,t){j("DeclareFunction",e,t)}function xge(e,t){j("DeclareInterface",e,t)}function Sge(e,t){j("DeclareModule",e,t)}function Tge(e,t){j("DeclareModuleExports",e,t)}function wge(e,t){j("DeclareTypeAlias",e,t)}function Ege(e,t){j("DeclareOpaqueType",e,t)}function Pge(e,t){j("DeclareVariable",e,t)}function Ige(e,t){j("DeclareExportDeclaration",e,t)}function Age(e,t){j("DeclareExportAllDeclaration",e,t)}function kge(e,t){j("DeclaredPredicate",e,t)}function Cge(e,t){j("ExistsTypeAnnotation",e,t)}function Nge(e,t){j("FunctionTypeAnnotation",e,t)}function Oge(e,t){j("FunctionTypeParam",e,t)}function $ge(e,t){j("GenericTypeAnnotation",e,t)}function Rge(e,t){j("InferredPredicate",e,t)}function Dge(e,t){j("InterfaceExtends",e,t)}function Mge(e,t){j("InterfaceDeclaration",e,t)}function Lge(e,t){j("InterfaceTypeAnnotation",e,t)}function Fge(e,t){j("IntersectionTypeAnnotation",e,t)}function jge(e,t){j("MixedTypeAnnotation",e,t)}function Bge(e,t){j("EmptyTypeAnnotation",e,t)}function zge(e,t){j("NullableTypeAnnotation",e,t)}function Uge(e,t){j("NumberLiteralTypeAnnotation",e,t)}function qge(e,t){j("NumberTypeAnnotation",e,t)}function Wge(e,t){j("ObjectTypeAnnotation",e,t)}function Vge(e,t){j("ObjectTypeInternalSlot",e,t)}function Kge(e,t){j("ObjectTypeCallProperty",e,t)}function Gge(e,t){j("ObjectTypeIndexer",e,t)}function Zge(e,t){j("ObjectTypeProperty",e,t)}function Hge(e,t){j("ObjectTypeSpreadProperty",e,t)}function Jge(e,t){j("OpaqueType",e,t)}function Yge(e,t){j("QualifiedTypeIdentifier",e,t)}function Xge(e,t){j("StringLiteralTypeAnnotation",e,t)}function Qge(e,t){j("StringTypeAnnotation",e,t)}function eye(e,t){j("SymbolTypeAnnotation",e,t)}function tye(e,t){j("ThisTypeAnnotation",e,t)}function rye(e,t){j("TupleTypeAnnotation",e,t)}function nye(e,t){j("TypeofTypeAnnotation",e,t)}function iye(e,t){j("TypeAlias",e,t)}function sye(e,t){j("TypeAnnotation",e,t)}function aye(e,t){j("TypeCastExpression",e,t)}function oye(e,t){j("TypeParameter",e,t)}function cye(e,t){j("TypeParameterDeclaration",e,t)}function lye(e,t){j("TypeParameterInstantiation",e,t)}function uye(e,t){j("UnionTypeAnnotation",e,t)}function dye(e,t){j("Variance",e,t)}function pye(e,t){j("VoidTypeAnnotation",e,t)}function fye(e,t){j("EnumDeclaration",e,t)}function hye(e,t){j("EnumBooleanBody",e,t)}function mye(e,t){j("EnumNumberBody",e,t)}function gye(e,t){j("EnumStringBody",e,t)}function yye(e,t){j("EnumSymbolBody",e,t)}function _ye(e,t){j("EnumBooleanMember",e,t)}function bye(e,t){j("EnumNumberMember",e,t)}function vye(e,t){j("EnumStringMember",e,t)}function xye(e,t){j("EnumDefaultedMember",e,t)}function Sye(e,t){j("IndexedAccessType",e,t)}function Tye(e,t){j("OptionalIndexedAccessType",e,t)}function wye(e,t){j("JSXAttribute",e,t)}function Eye(e,t){j("JSXClosingElement",e,t)}function Pye(e,t){j("JSXElement",e,t)}function Iye(e,t){j("JSXEmptyExpression",e,t)}function Aye(e,t){j("JSXExpressionContainer",e,t)}function kye(e,t){j("JSXSpreadChild",e,t)}function Cye(e,t){j("JSXIdentifier",e,t)}function Nye(e,t){j("JSXMemberExpression",e,t)}function Oye(e,t){j("JSXNamespacedName",e,t)}function $ye(e,t){j("JSXOpeningElement",e,t)}function Rye(e,t){j("JSXSpreadAttribute",e,t)}function Dye(e,t){j("JSXText",e,t)}function Mye(e,t){j("JSXFragment",e,t)}function Lye(e,t){j("JSXOpeningFragment",e,t)}function Fye(e,t){j("JSXClosingFragment",e,t)}function jye(e,t){j("Noop",e,t)}function Bye(e,t){j("Placeholder",e,t)}function zye(e,t){j("V8IntrinsicIdentifier",e,t)}function Uye(e,t){j("ArgumentPlaceholder",e,t)}function qye(e,t){j("BindExpression",e,t)}function Wye(e,t){j("Decorator",e,t)}function Vye(e,t){j("DoExpression",e,t)}function Kye(e,t){j("ExportDefaultSpecifier",e,t)}function Gye(e,t){j("RecordExpression",e,t)}function Zye(e,t){j("TupleExpression",e,t)}function Hye(e,t){j("DecimalLiteral",e,t)}function Jye(e,t){j("ModuleExpression",e,t)}function Yye(e,t){j("TopicReference",e,t)}function Xye(e,t){j("PipelineTopicExpression",e,t)}function Qye(e,t){j("PipelineBareFunction",e,t)}function e_e(e,t){j("PipelinePrimaryTopicReference",e,t)}function t_e(e,t){j("VoidPattern",e,t)}function r_e(e,t){j("TSParameterProperty",e,t)}function n_e(e,t){j("TSDeclareFunction",e,t)}function i_e(e,t){j("TSDeclareMethod",e,t)}function s_e(e,t){j("TSQualifiedName",e,t)}function a_e(e,t){j("TSCallSignatureDeclaration",e,t)}function o_e(e,t){j("TSConstructSignatureDeclaration",e,t)}function c_e(e,t){j("TSPropertySignature",e,t)}function l_e(e,t){j("TSMethodSignature",e,t)}function u_e(e,t){j("TSIndexSignature",e,t)}function d_e(e,t){j("TSAnyKeyword",e,t)}function p_e(e,t){j("TSBooleanKeyword",e,t)}function f_e(e,t){j("TSBigIntKeyword",e,t)}function h_e(e,t){j("TSIntrinsicKeyword",e,t)}function m_e(e,t){j("TSNeverKeyword",e,t)}function g_e(e,t){j("TSNullKeyword",e,t)}function y_e(e,t){j("TSNumberKeyword",e,t)}function __e(e,t){j("TSObjectKeyword",e,t)}function b_e(e,t){j("TSStringKeyword",e,t)}function v_e(e,t){j("TSSymbolKeyword",e,t)}function x_e(e,t){j("TSUndefinedKeyword",e,t)}function S_e(e,t){j("TSUnknownKeyword",e,t)}function T_e(e,t){j("TSVoidKeyword",e,t)}function w_e(e,t){j("TSThisType",e,t)}function E_e(e,t){j("TSFunctionType",e,t)}function P_e(e,t){j("TSConstructorType",e,t)}function I_e(e,t){j("TSTypeReference",e,t)}function A_e(e,t){j("TSTypePredicate",e,t)}function k_e(e,t){j("TSTypeQuery",e,t)}function C_e(e,t){j("TSTypeLiteral",e,t)}function N_e(e,t){j("TSArrayType",e,t)}function O_e(e,t){j("TSTupleType",e,t)}function $_e(e,t){j("TSOptionalType",e,t)}function R_e(e,t){j("TSRestType",e,t)}function D_e(e,t){j("TSNamedTupleMember",e,t)}function M_e(e,t){j("TSUnionType",e,t)}function L_e(e,t){j("TSIntersectionType",e,t)}function F_e(e,t){j("TSConditionalType",e,t)}function j_e(e,t){j("TSInferType",e,t)}function B_e(e,t){j("TSParenthesizedType",e,t)}function z_e(e,t){j("TSTypeOperator",e,t)}function U_e(e,t){j("TSIndexedAccessType",e,t)}function q_e(e,t){j("TSMappedType",e,t)}function W_e(e,t){j("TSTemplateLiteralType",e,t)}function V_e(e,t){j("TSLiteralType",e,t)}function K_e(e,t){j("TSExpressionWithTypeArguments",e,t)}function G_e(e,t){j("TSInterfaceDeclaration",e,t)}function Z_e(e,t){j("TSInterfaceBody",e,t)}function H_e(e,t){j("TSTypeAliasDeclaration",e,t)}function J_e(e,t){j("TSInstantiationExpression",e,t)}function Y_e(e,t){j("TSAsExpression",e,t)}function X_e(e,t){j("TSSatisfiesExpression",e,t)}function Q_e(e,t){j("TSTypeAssertion",e,t)}function ebe(e,t){j("TSEnumBody",e,t)}function tbe(e,t){j("TSEnumDeclaration",e,t)}function rbe(e,t){j("TSEnumMember",e,t)}function nbe(e,t){j("TSModuleDeclaration",e,t)}function ibe(e,t){j("TSModuleBlock",e,t)}function sbe(e,t){j("TSImportType",e,t)}function abe(e,t){j("TSImportEqualsDeclaration",e,t)}function obe(e,t){j("TSExternalModuleReference",e,t)}function cbe(e,t){j("TSNonNullExpression",e,t)}function lbe(e,t){j("TSExportAssignment",e,t)}function ube(e,t){j("TSNamespaceExportDeclaration",e,t)}function dbe(e,t){j("TSTypeAnnotation",e,t)}function pbe(e,t){j("TSTypeParameterInstantiation",e,t)}function fbe(e,t){j("TSTypeParameterDeclaration",e,t)}function hbe(e,t){j("TSTypeParameter",e,t)}function mbe(e,t){j("Standardized",e,t)}function gbe(e,t){j("Expression",e,t)}function ybe(e,t){j("Binary",e,t)}function _be(e,t){j("Scopable",e,t)}function bbe(e,t){j("BlockParent",e,t)}function vbe(e,t){j("Block",e,t)}function xbe(e,t){j("Statement",e,t)}function Sbe(e,t){j("Terminatorless",e,t)}function Tbe(e,t){j("CompletionStatement",e,t)}function wbe(e,t){j("Conditional",e,t)}function Ebe(e,t){j("Loop",e,t)}function Pbe(e,t){j("While",e,t)}function Ibe(e,t){j("ExpressionWrapper",e,t)}function Abe(e,t){j("For",e,t)}function kbe(e,t){j("ForXStatement",e,t)}function Cbe(e,t){j("Function",e,t)}function Nbe(e,t){j("FunctionParent",e,t)}function Obe(e,t){j("Pureish",e,t)}function $be(e,t){j("Declaration",e,t)}function Rbe(e,t){j("FunctionParameter",e,t)}function Dbe(e,t){j("PatternLike",e,t)}function Mbe(e,t){j("LVal",e,t)}function Lbe(e,t){j("TSEntityName",e,t)}function Fbe(e,t){j("Literal",e,t)}function jbe(e,t){j("Immutable",e,t)}function Bbe(e,t){j("UserWhitespacable",e,t)}function zbe(e,t){j("Method",e,t)}function Ube(e,t){j("ObjectMember",e,t)}function qbe(e,t){j("Property",e,t)}function Wbe(e,t){j("UnaryLike",e,t)}function Vbe(e,t){j("Pattern",e,t)}function Kbe(e,t){j("Class",e,t)}function Gbe(e,t){j("ImportOrExportDeclaration",e,t)}function Zbe(e,t){j("ExportDeclaration",e,t)}function Hbe(e,t){j("ModuleSpecifier",e,t)}function Jbe(e,t){j("Accessor",e,t)}function Ybe(e,t){j("Private",e,t)}function Xbe(e,t){j("Flow",e,t)}function Qbe(e,t){j("FlowType",e,t)}function eve(e,t){j("FlowBaseAnnotation",e,t)}function tve(e,t){j("FlowDeclaration",e,t)}function rve(e,t){j("FlowPredicate",e,t)}function nve(e,t){j("EnumBody",e,t)}function ive(e,t){j("EnumMember",e,t)}function sve(e,t){j("JSX",e,t)}function ave(e,t){j("Miscellaneous",e,t)}function ove(e,t){j("TypeScript",e,t)}function cve(e,t){j("TSTypeElement",e,t)}function lve(e,t){j("TSType",e,t)}function uve(e,t){j("TSBaseType",e,t)}function dve(e,t){(0,Df.default)("assertNumberLiteral","assertNumericLiteral"),j("NumberLiteral",e,t)}function pve(e,t){(0,Df.default)("assertRegexLiteral","assertRegExpLiteral"),j("RegexLiteral",e,t)}function fve(e,t){(0,Df.default)("assertRestProperty","assertRestElement"),j("RestProperty",e,t)}function hve(e,t){(0,Df.default)("assertSpreadProperty","assertSpreadElement"),j("SpreadProperty",e,t)}function mve(e,t){(0,Df.default)("assertModuleDeclaration","assertImportOrExportDeclaration"),j("ModuleDeclaration",e,t)}});var Aj=G(p_=>{"use strict";Object.defineProperty(p_,"__esModule",{value:!0});p_.default=void 0;var vs=fi(),Int=p_.default=gve;function gve(e){switch(e){case"string":return(0,vs.stringTypeAnnotation)();case"number":return(0,vs.numberTypeAnnotation)();case"undefined":return(0,vs.voidTypeAnnotation)();case"boolean":return(0,vs.booleanTypeAnnotation)();case"function":return(0,vs.genericTypeAnnotation)((0,vs.identifier)("Function"));case"object":return(0,vs.genericTypeAnnotation)((0,vs.identifier)("Object"));case"symbol":return(0,vs.genericTypeAnnotation)((0,vs.identifier)("Symbol"));case"bigint":return(0,vs.anyTypeAnnotation)()}throw new Error("Invalid typeof value: "+e)}});var DI=G(RI=>{"use strict";Object.defineProperty(RI,"__esModule",{value:!0});RI.default=Cj;var Mf=Vr();function kj(e){return(0,Mf.isIdentifier)(e)?e.name:`${e.id.name}.${kj(e.qualification)}`}function Cj(e){let t=Array.from(e),r=new Map,n=new Map,s=new Set,a=[];for(let o=0;o<t.length;o++){let c=t[o];if(c&&!a.includes(c)){if((0,Mf.isAnyTypeAnnotation)(c))return[c];if((0,Mf.isFlowBaseAnnotation)(c)){n.set(c.type,c);continue}if((0,Mf.isUnionTypeAnnotation)(c)){s.has(c.types)||(t.push(...c.types),s.add(c.types));continue}if((0,Mf.isGenericTypeAnnotation)(c)){let l=kj(c.id);if(r.has(l)){let u=r.get(l);u.typeParameters?c.typeParameters&&(u.typeParameters.params.push(...c.typeParameters.params),u.typeParameters.params=Cj(u.typeParameters.params)):u=c.typeParameters}else r.set(l,c);continue}a.push(c)}}for(let[,o]of n)a.push(o);for(let[,o]of r)a.push(o);return a}});var Nj=G(MI=>{"use strict";Object.defineProperty(MI,"__esModule",{value:!0});MI.default=bve;var yve=fi(),_ve=DI();function bve(e){let t=(0,_ve.default)(e);return t.length===1?t[0]:(0,yve.unionTypeAnnotation)(t)}});var Rj=G(LI=>{"use strict";Object.defineProperty(LI,"__esModule",{value:!0});LI.default=$j;var ku=Vr();function Oj(e){return(0,ku.isIdentifier)(e)?e.name:(0,ku.isThisExpression)(e)?"this":`${e.right.name}.${Oj(e.left)}`}function $j(e){let t=Array.from(e),r=new Map,n=new Map,s=new Set,a=[];for(let o=0;o<t.length;o++){let c=t[o];if(!c||a.includes(c))continue;if((0,ku.isTSAnyKeyword)(c))return[c];if((0,ku.isTSBaseType)(c)){n.set(c.type,c);continue}if((0,ku.isTSUnionType)(c)){s.has(c.types)||(t.push(...c.types),s.add(c.types));continue}let l="typeParameters";if((0,ku.isTSTypeReference)(c)&&c[l]){let u=c[l],d=Oj(c.typeName);if(r.has(d)){let p=r.get(d),f=p[l];f?(f.params.push(...u.params),f.params=$j(f.params)):p=u}else r.set(d,c);continue}a.push(c)}for(let[,o]of n)a.push(o);for(let[,o]of r)a.push(o);return a}});var Dj=G(FI=>{"use strict";Object.defineProperty(FI,"__esModule",{value:!0});FI.default=Tve;var vve=fi(),xve=Rj(),Sve=Vr();function Tve(e){let t=e.map(n=>(0,Sve.isTSTypeAnnotation)(n)?n.typeAnnotation:n),r=(0,xve.default)(t);return r.length===1?r[0]:(0,vve.tsUnionType)(r)}});var BI=G(jI=>{"use strict";Object.defineProperty(jI,"__esModule",{value:!0});jI.buildUndefinedNode=wve;var Mj=fi();function wve(){return(0,Mj.unaryExpression)("void",(0,Mj.numericLiteral)(0),!0)}});var xo=G(UI=>{"use strict";Object.defineProperty(UI,"__esModule",{value:!0});UI.default=Eve;var Lj=Wi(),Fj=Vr(),{hasOwn:Zs}={hasOwn:Function.call.bind(Object.prototype.hasOwnProperty)};function jj(e,t,r,n){return e&&typeof e.type=="string"?Bj(e,t,r,n):e}function zI(e,t,r,n){return Array.isArray(e)?e.map(s=>jj(s,t,r,n)):jj(e,t,r,n)}function Eve(e,t=!0,r=!1){return Bj(e,t,r,new Map)}function Bj(e,t=!0,r=!1,n){if(!e)return e;let{type:s}=e,a={type:e.type};if((0,Fj.isIdentifier)(e))a.name=e.name,Zs(e,"optional")&&typeof e.optional=="boolean"&&(a.optional=e.optional),Zs(e,"typeAnnotation")&&(a.typeAnnotation=t?zI(e.typeAnnotation,!0,r,n):e.typeAnnotation),Zs(e,"decorators")&&(a.decorators=t?zI(e.decorators,!0,r,n):e.decorators);else if(Zs(Lj.NODE_FIELDS,s))for(let o of Object.keys(Lj.NODE_FIELDS[s]))Zs(e,o)&&(t?a[o]=(0,Fj.isFile)(e)&&o==="comments"?f_(e.comments,t,r,n):zI(e[o],!0,r,n):a[o]=e[o]);else throw new Error(`Unknown node type: "${s}"`);return Zs(e,"loc")&&(r?a.loc=null:a.loc=e.loc),Zs(e,"leadingComments")&&(a.leadingComments=f_(e.leadingComments,t,r,n)),Zs(e,"innerComments")&&(a.innerComments=f_(e.innerComments,t,r,n)),Zs(e,"trailingComments")&&(a.trailingComments=f_(e.trailingComments,t,r,n)),Zs(e,"extra")&&(a.extra=Object.assign({},e.extra)),a}function f_(e,t,r,n){return!e||!t?e:e.map(s=>{let a=n.get(s);if(a)return a;let{type:o,value:c,loc:l}=s,u={type:o,value:c,loc:l};return r&&(u.loc=null),n.set(s,u),u})}});var zj=G(qI=>{"use strict";Object.defineProperty(qI,"__esModule",{value:!0});qI.default=Ive;var Pve=xo();function Ive(e){return(0,Pve.default)(e,!1)}});var Uj=G(WI=>{"use strict";Object.defineProperty(WI,"__esModule",{value:!0});WI.default=kve;var Ave=xo();function kve(e){return(0,Ave.default)(e)}});var qj=G(VI=>{"use strict";Object.defineProperty(VI,"__esModule",{value:!0});VI.default=Nve;var Cve=xo();function Nve(e){return(0,Cve.default)(e,!0,!0)}});var Wj=G(KI=>{"use strict";Object.defineProperty(KI,"__esModule",{value:!0});KI.default=$ve;var Ove=xo();function $ve(e){return(0,Ove.default)(e,!1,!0)}});var ZI=G(GI=>{"use strict";Object.defineProperty(GI,"__esModule",{value:!0});GI.default=Rve;function Rve(e,t,r){if(!r||!e)return e;let n=`${t}Comments`;return e[n]?t==="leading"?e[n]=r.concat(e[n]):e[n].push(...r):e[n]=r,e}});var Vj=G(HI=>{"use strict";Object.defineProperty(HI,"__esModule",{value:!0});HI.default=Mve;var Dve=ZI();function Mve(e,t,r,n){return(0,Dve.default)(e,t,[{type:n?"CommentLine":"CommentBlock",value:r}])}});var h_=G(JI=>{"use strict";Object.defineProperty(JI,"__esModule",{value:!0});JI.default=Lve;function Lve(e,t,r){t&&r&&(t[e]=Array.from(new Set([].concat(t[e],r[e]).filter(Boolean))))}});var XI=G(YI=>{"use strict";Object.defineProperty(YI,"__esModule",{value:!0});YI.default=jve;var Fve=h_();function jve(e,t){(0,Fve.default)("innerComments",e,t)}});var eA=G(QI=>{"use strict";Object.defineProperty(QI,"__esModule",{value:!0});QI.default=zve;var Bve=h_();function zve(e,t){(0,Bve.default)("leadingComments",e,t)}});var rA=G(tA=>{"use strict";Object.defineProperty(tA,"__esModule",{value:!0});tA.default=qve;var Uve=h_();function qve(e,t){(0,Uve.default)("trailingComments",e,t)}});var iA=G(nA=>{"use strict";Object.defineProperty(nA,"__esModule",{value:!0});nA.default=Gve;var Wve=rA(),Vve=eA(),Kve=XI();function Gve(e,t){return(0,Wve.default)(e,t),(0,Vve.default)(e,t),(0,Kve.default)(e,t),e}});var Kj=G(sA=>{"use strict";Object.defineProperty(sA,"__esModule",{value:!0});sA.default=Hve;var Zve=wu();function Hve(e){return Zve.COMMENT_KEYS.forEach(t=>{e[t]=null}),e}});var Gj=G(ve=>{"use strict";Object.defineProperty(ve,"__esModule",{value:!0});ve.WHILE_TYPES=ve.USERWHITESPACABLE_TYPES=ve.UNARYLIKE_TYPES=ve.TYPESCRIPT_TYPES=ve.TSTYPE_TYPES=ve.TSTYPEELEMENT_TYPES=ve.TSENTITYNAME_TYPES=ve.TSBASETYPE_TYPES=ve.TERMINATORLESS_TYPES=ve.STATEMENT_TYPES=ve.STANDARDIZED_TYPES=ve.SCOPABLE_TYPES=ve.PUREISH_TYPES=ve.PROPERTY_TYPES=ve.PRIVATE_TYPES=ve.PATTERN_TYPES=ve.PATTERNLIKE_TYPES=ve.OBJECTMEMBER_TYPES=ve.MODULESPECIFIER_TYPES=ve.MODULEDECLARATION_TYPES=ve.MISCELLANEOUS_TYPES=ve.METHOD_TYPES=ve.LVAL_TYPES=ve.LOOP_TYPES=ve.LITERAL_TYPES=ve.JSX_TYPES=ve.IMPORTOREXPORTDECLARATION_TYPES=ve.IMMUTABLE_TYPES=ve.FUNCTION_TYPES=ve.FUNCTIONPARENT_TYPES=ve.FUNCTIONPARAMETER_TYPES=ve.FOR_TYPES=ve.FORXSTATEMENT_TYPES=ve.FLOW_TYPES=ve.FLOWTYPE_TYPES=ve.FLOWPREDICATE_TYPES=ve.FLOWDECLARATION_TYPES=ve.FLOWBASEANNOTATION_TYPES=ve.EXPRESSION_TYPES=ve.EXPRESSIONWRAPPER_TYPES=ve.EXPORTDECLARATION_TYPES=ve.ENUMMEMBER_TYPES=ve.ENUMBODY_TYPES=ve.DECLARATION_TYPES=ve.CONDITIONAL_TYPES=ve.COMPLETIONSTATEMENT_TYPES=ve.CLASS_TYPES=ve.BLOCK_TYPES=ve.BLOCKPARENT_TYPES=ve.BINARY_TYPES=ve.ACCESSOR_TYPES=void 0;var ht=Wi(),Gnt=ve.STANDARDIZED_TYPES=ht.FLIPPED_ALIAS_KEYS.Standardized,Znt=ve.EXPRESSION_TYPES=ht.FLIPPED_ALIAS_KEYS.Expression,Hnt=ve.BINARY_TYPES=ht.FLIPPED_ALIAS_KEYS.Binary,Jnt=ve.SCOPABLE_TYPES=ht.FLIPPED_ALIAS_KEYS.Scopable,Ynt=ve.BLOCKPARENT_TYPES=ht.FLIPPED_ALIAS_KEYS.BlockParent,Xnt=ve.BLOCK_TYPES=ht.FLIPPED_ALIAS_KEYS.Block,Qnt=ve.STATEMENT_TYPES=ht.FLIPPED_ALIAS_KEYS.Statement,eit=ve.TERMINATORLESS_TYPES=ht.FLIPPED_ALIAS_KEYS.Terminatorless,tit=ve.COMPLETIONSTATEMENT_TYPES=ht.FLIPPED_ALIAS_KEYS.CompletionStatement,rit=ve.CONDITIONAL_TYPES=ht.FLIPPED_ALIAS_KEYS.Conditional,nit=ve.LOOP_TYPES=ht.FLIPPED_ALIAS_KEYS.Loop,iit=ve.WHILE_TYPES=ht.FLIPPED_ALIAS_KEYS.While,sit=ve.EXPRESSIONWRAPPER_TYPES=ht.FLIPPED_ALIAS_KEYS.ExpressionWrapper,ait=ve.FOR_TYPES=ht.FLIPPED_ALIAS_KEYS.For,oit=ve.FORXSTATEMENT_TYPES=ht.FLIPPED_ALIAS_KEYS.ForXStatement,cit=ve.FUNCTION_TYPES=ht.FLIPPED_ALIAS_KEYS.Function,lit=ve.FUNCTIONPARENT_TYPES=ht.FLIPPED_ALIAS_KEYS.FunctionParent,uit=ve.PUREISH_TYPES=ht.FLIPPED_ALIAS_KEYS.Pureish,dit=ve.DECLARATION_TYPES=ht.FLIPPED_ALIAS_KEYS.Declaration,pit=ve.FUNCTIONPARAMETER_TYPES=ht.FLIPPED_ALIAS_KEYS.FunctionParameter,fit=ve.PATTERNLIKE_TYPES=ht.FLIPPED_ALIAS_KEYS.PatternLike,hit=ve.LVAL_TYPES=ht.FLIPPED_ALIAS_KEYS.LVal,mit=ve.TSENTITYNAME_TYPES=ht.FLIPPED_ALIAS_KEYS.TSEntityName,git=ve.LITERAL_TYPES=ht.FLIPPED_ALIAS_KEYS.Literal,yit=ve.IMMUTABLE_TYPES=ht.FLIPPED_ALIAS_KEYS.Immutable,_it=ve.USERWHITESPACABLE_TYPES=ht.FLIPPED_ALIAS_KEYS.UserWhitespacable,bit=ve.METHOD_TYPES=ht.FLIPPED_ALIAS_KEYS.Method,vit=ve.OBJECTMEMBER_TYPES=ht.FLIPPED_ALIAS_KEYS.ObjectMember,xit=ve.PROPERTY_TYPES=ht.FLIPPED_ALIAS_KEYS.Property,Sit=ve.UNARYLIKE_TYPES=ht.FLIPPED_ALIAS_KEYS.UnaryLike,Tit=ve.PATTERN_TYPES=ht.FLIPPED_ALIAS_KEYS.Pattern,wit=ve.CLASS_TYPES=ht.FLIPPED_ALIAS_KEYS.Class,Jve=ve.IMPORTOREXPORTDECLARATION_TYPES=ht.FLIPPED_ALIAS_KEYS.ImportOrExportDeclaration,Eit=ve.EXPORTDECLARATION_TYPES=ht.FLIPPED_ALIAS_KEYS.ExportDeclaration,Pit=ve.MODULESPECIFIER_TYPES=ht.FLIPPED_ALIAS_KEYS.ModuleSpecifier,Iit=ve.ACCESSOR_TYPES=ht.FLIPPED_ALIAS_KEYS.Accessor,Ait=ve.PRIVATE_TYPES=ht.FLIPPED_ALIAS_KEYS.Private,kit=ve.FLOW_TYPES=ht.FLIPPED_ALIAS_KEYS.Flow,Cit=ve.FLOWTYPE_TYPES=ht.FLIPPED_ALIAS_KEYS.FlowType,Nit=ve.FLOWBASEANNOTATION_TYPES=ht.FLIPPED_ALIAS_KEYS.FlowBaseAnnotation,Oit=ve.FLOWDECLARATION_TYPES=ht.FLIPPED_ALIAS_KEYS.FlowDeclaration,$it=ve.FLOWPREDICATE_TYPES=ht.FLIPPED_ALIAS_KEYS.FlowPredicate,Rit=ve.ENUMBODY_TYPES=ht.FLIPPED_ALIAS_KEYS.EnumBody,Dit=ve.ENUMMEMBER_TYPES=ht.FLIPPED_ALIAS_KEYS.EnumMember,Mit=ve.JSX_TYPES=ht.FLIPPED_ALIAS_KEYS.JSX,Lit=ve.MISCELLANEOUS_TYPES=ht.FLIPPED_ALIAS_KEYS.Miscellaneous,Fit=ve.TYPESCRIPT_TYPES=ht.FLIPPED_ALIAS_KEYS.TypeScript,jit=ve.TSTYPEELEMENT_TYPES=ht.FLIPPED_ALIAS_KEYS.TSTypeElement,Bit=ve.TSTYPE_TYPES=ht.FLIPPED_ALIAS_KEYS.TSType,zit=ve.TSBASETYPE_TYPES=ht.FLIPPED_ALIAS_KEYS.TSBaseType,Uit=ve.MODULEDECLARATION_TYPES=Jve});var cA=G(oA=>{"use strict";Object.defineProperty(oA,"__esModule",{value:!0});oA.default=Yve;var m_=Vr(),aA=fi();function Yve(e,t){if((0,m_.isBlockStatement)(e))return e;let r=[];return(0,m_.isEmptyStatement)(e)?r=[]:((0,m_.isStatement)(e)||((0,m_.isFunction)(t)?e=(0,aA.returnStatement)(e):e=(0,aA.expressionStatement)(e)),r=[e]),(0,aA.blockStatement)(r)}});var Zj=G(lA=>{"use strict";Object.defineProperty(lA,"__esModule",{value:!0});lA.default=Qve;var Xve=cA();function Qve(e,t="body"){let r=(0,Xve.default)(e[t],e);return e[t]=r,r}});var dA=G(uA=>{"use strict";Object.defineProperty(uA,"__esModule",{value:!0});uA.default=rxe;var exe=Tu(),txe=Af();function rxe(e){e=e+"";let t="";for(let r of e)t+=(0,txe.isIdentifierChar)(r.codePointAt(0))?r:"-";return t=t.replace(/^[-0-9]+/,""),t=t.replace(/[-\s]+(.)?/g,function(r,n){return n?n.toUpperCase():""}),(0,exe.default)(t)||(t=`_${t}`),t||"_"}});var Hj=G(pA=>{"use strict";Object.defineProperty(pA,"__esModule",{value:!0});pA.default=ixe;var nxe=dA();function ixe(e){return e=(0,nxe.default)(e),(e==="eval"||e==="arguments")&&(e="_"+e),e}});var Jj=G(fA=>{"use strict";Object.defineProperty(fA,"__esModule",{value:!0});fA.default=oxe;var sxe=Vr(),axe=fi();function oxe(e,t=e.key||e.property){return!e.computed&&(0,sxe.isIdentifier)(t)&&(t=(0,axe.stringLiteral)(t.name)),t}});var Yj=G(g_=>{"use strict";Object.defineProperty(g_,"__esModule",{value:!0});g_.default=void 0;var Lf=Vr(),Hit=g_.default=cxe;function cxe(e){if((0,Lf.isExpressionStatement)(e)&&(e=e.expression),(0,Lf.isExpression)(e))return e;if((0,Lf.isClass)(e)?(e.type="ClassExpression",e.abstract=!1):(0,Lf.isFunction)(e)&&(e.type="FunctionExpression"),!(0,Lf.isExpression)(e))throw new Error(`cannot turn ${e.type} to an expression`);return e}});var mA=G(hA=>{"use strict";Object.defineProperty(hA,"__esModule",{value:!0});hA.default=Ff;var lxe=Wi(),Xj=Symbol(),Qj=Symbol();function Ff(e,t,r){if(!e)return!1;let n=lxe.VISITOR_KEYS[e.type];if(!n)return!1;r=r||{};let s=t(e,r);if(s!==void 0)switch(s){case Xj:return!1;case Qj:return!0}for(let a of n){let o=e[a];if(o){if(Array.isArray(o)){for(let c of o)if(Ff(c,t,r))return!0}else if(Ff(o,t,r))return!0}}return!1}Ff.skip=Xj;Ff.stop=Qj});var yA=G(gA=>{"use strict";Object.defineProperty(gA,"__esModule",{value:!0});gA.default=pxe;var uxe=wu(),eB=["tokens","start","end","loc","raw","rawValue"],dxe=[...uxe.COMMENT_KEYS,"comments",...eB];function pxe(e,t={}){let r=t.preserveComments?eB:dxe;for(let s of r)e[s]!=null&&(e[s]=void 0);for(let s of Object.keys(e))s.startsWith("_")&&e[s]!=null&&(e[s]=void 0);let n=Object.getOwnPropertySymbols(e);for(let s of n)e[s]=null}});var bA=G(_A=>{"use strict";Object.defineProperty(_A,"__esModule",{value:!0});_A.default=mxe;var fxe=mA(),hxe=yA();function mxe(e,t){return(0,fxe.default)(e,hxe.default,t),e}});var rB=G(vA=>{"use strict";Object.defineProperty(vA,"__esModule",{value:!0});vA.default=Pc;var tB=Vr(),gxe=xo(),yxe=bA();function Pc(e,t=e.key){let r;return e.kind==="method"?Pc.increment()+"":((0,tB.isIdentifier)(t)?r=t.name:(0,tB.isStringLiteral)(t)?r=JSON.stringify(t.value):r=JSON.stringify((0,yxe.default)((0,gxe.default)(t))),e.computed&&(r=`[${r}]`),e.static&&(r=`static:${r}`),r)}Pc.uid=0;Pc.increment=function(){return Pc.uid>=Number.MAX_SAFE_INTEGER?Pc.uid=0:Pc.uid++}});var nB=G(__=>{"use strict";Object.defineProperty(__,"__esModule",{value:!0});__.default=void 0;var y_=Vr(),_xe=fi(),tst=__.default=bxe;function bxe(e,t){if((0,y_.isStatement)(e))return e;let r=!1,n;if((0,y_.isClass)(e))r=!0,n="ClassDeclaration";else if((0,y_.isFunction)(e))r=!0,n="FunctionDeclaration";else if((0,y_.isAssignmentExpression)(e))return(0,_xe.expressionStatement)(e);if(r&&!e.id&&(n=!1),!n){if(t)return!1;throw new Error(`cannot turn ${e.type} to a statement`)}return e.type=n,e}});var iB=G(b_=>{"use strict";Object.defineProperty(b_,"__esModule",{value:!0});b_.default=void 0;var vxe=Tu(),nn=fi(),nst=b_.default=xA,xxe=Function.call.bind(Object.prototype.toString);function Sxe(e){return xxe(e)==="[object RegExp]"}function Txe(e){if(typeof e!="object"||e===null||Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);return t===null||Object.getPrototypeOf(t)===null}function xA(e){if(e===void 0)return(0,nn.identifier)("undefined");if(e===!0||e===!1)return(0,nn.booleanLiteral)(e);if(e===null)return(0,nn.nullLiteral)();if(typeof e=="string")return(0,nn.stringLiteral)(e);if(typeof e=="number"){let t;if(Number.isFinite(e))t=(0,nn.numericLiteral)(Math.abs(e));else{let r;Number.isNaN(e)?r=(0,nn.numericLiteral)(0):r=(0,nn.numericLiteral)(1),t=(0,nn.binaryExpression)("/",r,(0,nn.numericLiteral)(0))}return(e<0||Object.is(e,-0))&&(t=(0,nn.unaryExpression)("-",t)),t}if(typeof e=="bigint")return e<0?(0,nn.unaryExpression)("-",(0,nn.bigIntLiteral)(-e)):(0,nn.bigIntLiteral)(e);if(Sxe(e)){let t=e.source,r=/\/([a-z]*)$/.exec(e.toString())[1];return(0,nn.regExpLiteral)(t,r)}if(Array.isArray(e))return(0,nn.arrayExpression)(e.map(xA));if(Txe(e)){let t=[];for(let r of Object.keys(e)){let n,s=!1;(0,vxe.default)(r)?r==="__proto__"?(s=!0,n=(0,nn.stringLiteral)(r)):n=(0,nn.identifier)(r):n=(0,nn.stringLiteral)(r),t.push((0,nn.objectProperty)(n,xA(e[r]),s))}return(0,nn.objectExpression)(t)}throw new Error("don't know how to turn this value into a node")}});var sB=G(SA=>{"use strict";Object.defineProperty(SA,"__esModule",{value:!0});SA.default=Exe;var wxe=fi();function Exe(e,t,r=!1){return e.object=(0,wxe.memberExpression)(e.object,e.property,e.computed),e.property=t,e.computed=!!r,e}});var oB=G(TA=>{"use strict";Object.defineProperty(TA,"__esModule",{value:!0});TA.default=Ixe;var aB=wu(),Pxe=iA();function Ixe(e,t){if(!e||!t)return e;for(let r of aB.INHERIT_KEYS.optional)e[r]==null&&(e[r]=t[r]);for(let r of Object.keys(t))r.startsWith("_")&&r!=="__clone"&&(e[r]=t[r]);for(let r of aB.INHERIT_KEYS.force)e[r]=t[r];return(0,Pxe.default)(e,t),e}});var cB=G(wA=>{"use strict";Object.defineProperty(wA,"__esModule",{value:!0});wA.default=Cxe;var Axe=fi(),kxe=Rt();function Cxe(e,t){if((0,kxe.isSuper)(e.object))throw new Error("Cannot prepend node to super property access (`super.foo`).");return e.object=(0,Axe.memberExpression)(t,e.object),e}});var lB=G(EA=>{"use strict";Object.defineProperty(EA,"__esModule",{value:!0});EA.default=Nxe;function Nxe(e){let t=[].concat(e),r=Object.create(null);for(;t.length;){let n=t.pop();if(n)switch(n.type){case"ArrayPattern":t.push(...n.elements);break;case"AssignmentExpression":case"AssignmentPattern":case"ForInStatement":case"ForOfStatement":t.push(n.left);break;case"ObjectPattern":t.push(...n.properties);break;case"ObjectProperty":t.push(n.value);break;case"RestElement":case"UpdateExpression":t.push(n.argument);break;case"UnaryExpression":n.operator==="delete"&&t.push(n.argument);break;case"Identifier":r[n.name]=n;break;default:break}}return r}});var jf=G(IA=>{"use strict";Object.defineProperty(IA,"__esModule",{value:!0});IA.default=PA;var Sa=Vr();function PA(e,t,r,n){let s=[].concat(e),a=Object.create(null);for(;s.length;){let o=s.shift();if(!o||n&&((0,Sa.isAssignmentExpression)(o)||(0,Sa.isUnaryExpression)(o)||(0,Sa.isUpdateExpression)(o)))continue;if((0,Sa.isIdentifier)(o)){t?(a[o.name]=a[o.name]||[]).push(o):a[o.name]=o;continue}if((0,Sa.isExportDeclaration)(o)&&!(0,Sa.isExportAllDeclaration)(o)){(0,Sa.isDeclaration)(o.declaration)&&s.push(o.declaration);continue}if(r){if((0,Sa.isFunctionDeclaration)(o)){s.push(o.id);continue}if((0,Sa.isFunctionExpression)(o))continue}let c=PA.keys[o.type];if(c)for(let l=0;l<c.length;l++){let u=c[l],d=o[u];d&&(Array.isArray(d)?s.push(...d):s.push(d))}}return a}var Oxe={DeclareClass:["id"],DeclareFunction:["id"],DeclareModule:["id"],DeclareVariable:["id"],DeclareInterface:["id"],DeclareTypeAlias:["id"],DeclareOpaqueType:["id"],InterfaceDeclaration:["id"],TypeAlias:["id"],OpaqueType:["id"],CatchClause:["param"],LabeledStatement:["label"],UnaryExpression:["argument"],AssignmentExpression:["left"],ImportSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportDefaultSpecifier:["local"],ImportDeclaration:["specifiers"],TSImportEqualsDeclaration:["id"],ExportSpecifier:["exported"],ExportNamespaceSpecifier:["exported"],ExportDefaultSpecifier:["exported"],FunctionDeclaration:["id","params"],FunctionExpression:["id","params"],ArrowFunctionExpression:["params"],ObjectMethod:["params"],ClassMethod:["params"],ClassPrivateMethod:["params"],ForInStatement:["left"],ForOfStatement:["left"],ClassDeclaration:["id"],ClassExpression:["id"],RestElement:["argument"],UpdateExpression:["argument"],ObjectProperty:["value"],AssignmentPattern:["left"],ArrayPattern:["elements"],ObjectPattern:["properties"],VariableDeclaration:["declarations"],VariableDeclarator:["id"]};PA.keys=Oxe});var uB=G(v_=>{"use strict";Object.defineProperty(v_,"__esModule",{value:!0});v_.default=void 0;var $xe=jf(),ust=v_.default=Rxe;function Rxe(e,t){return(0,$xe.default)(e,t,!0)}});var pB=G(AA=>{"use strict";Object.defineProperty(AA,"__esModule",{value:!0});AA.default=Mxe;var Vi=Vr();function Dxe(e){return(0,Vi.isNullLiteral)(e)?"null":(0,Vi.isRegExpLiteral)(e)?`/${e.pattern}/${e.flags}`:(0,Vi.isTemplateLiteral)(e)?e.quasis.map(t=>t.value.raw).join(""):e.value!==void 0?String(e.value):null}function dB(e){if(!e.computed||(0,Vi.isLiteral)(e.key))return e.key}function Mxe(e,t){if("id"in e&&e.id)return{name:e.id.name,originalNode:e.id};let r="",n;if((0,Vi.isObjectProperty)(t,{value:e})?n=dB(t):(0,Vi.isObjectMethod)(e)||(0,Vi.isClassMethod)(e)?(n=dB(e),e.kind==="get"?r="get ":e.kind==="set"&&(r="set ")):(0,Vi.isVariableDeclarator)(t,{init:e})?n=t.id:(0,Vi.isAssignmentExpression)(t,{operator:"=",right:e})&&(n=t.left),!n)return null;let s=(0,Vi.isLiteral)(n)?Dxe(n):(0,Vi.isIdentifier)(n)?n.name:(0,Vi.isPrivateName)(n)?n.id.name:null;return s==null?null:{name:r+s,originalNode:n}}});var fB=G(CA=>{"use strict";Object.defineProperty(CA,"__esModule",{value:!0});CA.default=Fxe;var Lxe=Wi();function Fxe(e,t,r){typeof t=="function"&&(t={enter:t});let{enter:n,exit:s}=t;kA(e,n,s,r,[])}function kA(e,t,r,n,s){let a=Lxe.VISITOR_KEYS[e.type];if(a){t&&t(e,s,n);for(let o of a){let c=e[o];if(Array.isArray(c))for(let l=0;l<c.length;l++){let u=c[l];u&&(s.push({node:e,key:o,index:l}),kA(u,t,r,n,s),s.pop())}else c&&(s.push({node:e,key:o}),kA(c,t,r,n,s),s.pop())}r&&r(e,s,n)}}});var hB=G(NA=>{"use strict";Object.defineProperty(NA,"__esModule",{value:!0});NA.default=Bxe;var jxe=jf();function Bxe(e,t,r){if(r&&e.type==="Identifier"&&t.type==="ObjectProperty"&&r.type==="ObjectExpression")return!1;let n=jxe.default.keys[t.type];if(n)for(let s=0;s<n.length;s++){let a=n[s],o=t[a];if(Array.isArray(o)){if(o.includes(e))return!0}else if(o===e)return!0}return!1}});var $A=G(OA=>{"use strict";Object.defineProperty(OA,"__esModule",{value:!0});OA.default=qxe;var zxe=Vr(),Uxe=Symbol.for("var used to be block scoped");function qxe(e){return(0,zxe.isVariableDeclaration)(e)&&(e.kind!=="var"||e[Uxe])}});var gB=G(RA=>{"use strict";Object.defineProperty(RA,"__esModule",{value:!0});RA.default=Vxe;var mB=Vr(),Wxe=$A();function Vxe(e){return(0,mB.isFunctionDeclaration)(e)||(0,mB.isClassDeclaration)(e)||(0,Wxe.default)(e)}});var yB=G(DA=>{"use strict";Object.defineProperty(DA,"__esModule",{value:!0});DA.default=Zxe;var Kxe=t_(),Gxe=Vr();function Zxe(e){return(0,Kxe.default)(e.type,"Immutable")?!0:(0,Gxe.isIdentifier)(e)?e.name==="undefined":!1}});var bB=G(LA=>{"use strict";Object.defineProperty(LA,"__esModule",{value:!0});LA.default=MA;var _B=Wi();function MA(e,t){if(typeof e!="object"||typeof t!="object"||e==null||t==null)return e===t;if(e.type!==t.type)return!1;let r=Object.keys(_B.NODE_FIELDS[e.type]||e.type),n=_B.VISITOR_KEYS[e.type];for(let s of r){let a=e[s],o=t[s];if(typeof a!=typeof o)return!1;if(!(a==null&&o==null)){if(a==null||o==null)return!1;if(Array.isArray(a)){if(!Array.isArray(o)||a.length!==o.length)return!1;for(let c=0;c<a.length;c++)if(!MA(a[c],o[c]))return!1;continue}if(typeof a=="object"&&!(n!=null&&n.includes(s))){for(let c of Object.keys(a))if(a[c]!==o[c])return!1;continue}if(!MA(a,o))return!1}}return!0}});var vB=G(FA=>{"use strict";Object.defineProperty(FA,"__esModule",{value:!0});FA.default=Hxe;function Hxe(e,t,r){switch(t.type){case"MemberExpression":case"OptionalMemberExpression":return t.property===e?!!t.computed:t.object===e;case"JSXMemberExpression":return t.object===e;case"VariableDeclarator":return t.init===e;case"ArrowFunctionExpression":return t.body===e;case"PrivateName":return!1;case"ClassMethod":case"ClassPrivateMethod":case"ObjectMethod":return t.key===e?!!t.computed:!1;case"ObjectProperty":return t.key===e?!!t.computed:r?.type!=="ObjectPattern";case"ClassProperty":case"ClassAccessorProperty":return t.key===e?!!t.computed:!0;case"ClassPrivateProperty":return t.key!==e;case"ClassDeclaration":case"ClassExpression":return t.superClass===e;case"AssignmentExpression":return t.right===e;case"AssignmentPattern":return t.right===e;case"LabeledStatement":return!1;case"CatchClause":return!1;case"RestElement":return!1;case"BreakStatement":case"ContinueStatement":return!1;case"FunctionDeclaration":case"FunctionExpression":return!1;case"ExportNamespaceSpecifier":case"ExportDefaultSpecifier":return!1;case"ExportSpecifier":return r!=null&&r.source?!1:t.local===e;case"ImportDefaultSpecifier":case"ImportNamespaceSpecifier":case"ImportSpecifier":return!1;case"ImportAttribute":return!1;case"JSXAttribute":return!1;case"ObjectPattern":case"ArrayPattern":return!1;case"MetaProperty":return!1;case"ObjectTypeProperty":return t.key!==e;case"TSEnumMember":return t.id!==e;case"TSPropertySignature":return t.key===e?!!t.computed:!0}return!0}});var xB=G(jA=>{"use strict";Object.defineProperty(jA,"__esModule",{value:!0});jA.default=Jxe;var Ic=Vr();function Jxe(e,t){return(0,Ic.isBlockStatement)(e)&&((0,Ic.isFunction)(t)||(0,Ic.isCatchClause)(t))?!1:(0,Ic.isPattern)(e)&&((0,Ic.isFunction)(t)||(0,Ic.isCatchClause)(t))?!0:(0,Ic.isScopable)(e)}});var TB=G(BA=>{"use strict";Object.defineProperty(BA,"__esModule",{value:!0});BA.default=Yxe;var SB=Vr();function Yxe(e){return(0,SB.isImportDefaultSpecifier)(e)||(0,SB.isIdentifier)(e.imported||e.exported,{name:"default"})}});var wB=G(zA=>{"use strict";Object.defineProperty(zA,"__esModule",{value:!0});zA.default=eSe;var Xxe=Tu(),Qxe=new Set(["abstract","boolean","byte","char","double","enum","final","float","goto","implements","int","interface","long","native","package","private","protected","public","short","static","synchronized","throws","transient","volatile"]);function eSe(e){return(0,Xxe.default)(e)&&!Qxe.has(e)}});var EB=G(UA=>{"use strict";Object.defineProperty(UA,"__esModule",{value:!0});UA.default=nSe;var tSe=Vr(),rSe=Symbol.for("var used to be block scoped");function nSe(e){return(0,tSe.isVariableDeclaration)(e,{kind:"var"})&&!e[rSe]}});var PB=G(VA=>{"use strict";Object.defineProperty(VA,"__esModule",{value:!0});VA.default=x_;var iSe=jf(),Ac=Vr(),qA=fi(),WA=BI(),sSe=xo();function x_(e,t){let r=[],n=!0;for(let s of e)if((0,Ac.isEmptyStatement)(s)||(n=!1),(0,Ac.isExpression)(s))r.push(s);else if((0,Ac.isExpressionStatement)(s))r.push(s.expression);else if((0,Ac.isVariableDeclaration)(s)){if(s.kind!=="var")return;for(let a of s.declarations){let o=(0,iSe.default)(a);for(let c of Object.keys(o))t.push({kind:s.kind,id:(0,sSe.default)(o[c])});a.init&&r.push((0,qA.assignmentExpression)("=",a.id,a.init))}n=!0}else if((0,Ac.isIfStatement)(s)){let a=s.consequent?x_([s.consequent],t):(0,WA.buildUndefinedNode)(),o=s.alternate?x_([s.alternate],t):(0,WA.buildUndefinedNode)();if(!a||!o)return;r.push((0,qA.conditionalExpression)(s.test,a,o))}else if((0,Ac.isBlockStatement)(s)){let a=x_(s.body,t);if(!a)return;r.push(a)}else if((0,Ac.isEmptyStatement)(s))e.indexOf(s)===0&&(n=!0);else return;return n&&r.push((0,WA.buildUndefinedNode)()),r.length===1?r[0]:(0,qA.sequenceExpression)(r)}});var IB=G(KA=>{"use strict";Object.defineProperty(KA,"__esModule",{value:!0});KA.default=oSe;var aSe=PB();function oSe(e,t){if(!(e!=null&&e.length))return;let r=[],n=(0,aSe.default)(e,r);if(n){for(let s of r)t.push(s);return n}}});var Rt=G(Ce=>{"use strict";Object.defineProperty(Ce,"__esModule",{value:!0});var So={react:!0,assertNode:!0,createTypeAnnotationBasedOnTypeof:!0,createUnionTypeAnnotation:!0,createFlowUnionType:!0,createTSUnionType:!0,cloneNode:!0,clone:!0,cloneDeep:!0,cloneDeepWithoutLoc:!0,cloneWithoutLoc:!0,addComment:!0,addComments:!0,inheritInnerComments:!0,inheritLeadingComments:!0,inheritsComments:!0,inheritTrailingComments:!0,removeComments:!0,ensureBlock:!0,toBindingIdentifierName:!0,toBlock:!0,toComputedKey:!0,toExpression:!0,toIdentifier:!0,toKeyAlias:!0,toStatement:!0,valueToNode:!0,appendToMemberExpression:!0,inherits:!0,prependToMemberExpression:!0,removeProperties:!0,removePropertiesDeep:!0,removeTypeDuplicates:!0,getAssignmentIdentifiers:!0,getBindingIdentifiers:!0,getOuterBindingIdentifiers:!0,getFunctionName:!0,traverse:!0,traverseFast:!0,shallowEqual:!0,is:!0,isBinding:!0,isBlockScoped:!0,isImmutable:!0,isLet:!0,isNode:!0,isNodesEquivalent:!0,isPlaceholderType:!0,isReferenced:!0,isScope:!0,isSpecifierDefault:!0,isType:!0,isValidES3Identifier:!0,isValidIdentifier:!0,isVar:!0,matchesPattern:!0,validate:!0,buildMatchMemberExpression:!0,__internal__deprecationWarning:!0};Object.defineProperty(Ce,"__internal__deprecationWarning",{enumerable:!0,get:function(){return dTe.default}});Object.defineProperty(Ce,"addComment",{enumerable:!0,get:function(){return bSe.default}});Object.defineProperty(Ce,"addComments",{enumerable:!0,get:function(){return vSe.default}});Object.defineProperty(Ce,"appendToMemberExpression",{enumerable:!0,get:function(){return DSe.default}});Object.defineProperty(Ce,"assertNode",{enumerable:!0,get:function(){return dSe.default}});Object.defineProperty(Ce,"buildMatchMemberExpression",{enumerable:!0,get:function(){return uTe.default}});Object.defineProperty(Ce,"clone",{enumerable:!0,get:function(){return mSe.default}});Object.defineProperty(Ce,"cloneDeep",{enumerable:!0,get:function(){return gSe.default}});Object.defineProperty(Ce,"cloneDeepWithoutLoc",{enumerable:!0,get:function(){return ySe.default}});Object.defineProperty(Ce,"cloneNode",{enumerable:!0,get:function(){return hSe.default}});Object.defineProperty(Ce,"cloneWithoutLoc",{enumerable:!0,get:function(){return _Se.default}});Object.defineProperty(Ce,"createFlowUnionType",{enumerable:!0,get:function(){return AB.default}});Object.defineProperty(Ce,"createTSUnionType",{enumerable:!0,get:function(){return fSe.default}});Object.defineProperty(Ce,"createTypeAnnotationBasedOnTypeof",{enumerable:!0,get:function(){return pSe.default}});Object.defineProperty(Ce,"createUnionTypeAnnotation",{enumerable:!0,get:function(){return AB.default}});Object.defineProperty(Ce,"ensureBlock",{enumerable:!0,get:function(){return PSe.default}});Object.defineProperty(Ce,"getAssignmentIdentifiers",{enumerable:!0,get:function(){return zSe.default}});Object.defineProperty(Ce,"getBindingIdentifiers",{enumerable:!0,get:function(){return USe.default}});Object.defineProperty(Ce,"getFunctionName",{enumerable:!0,get:function(){return WSe.default}});Object.defineProperty(Ce,"getOuterBindingIdentifiers",{enumerable:!0,get:function(){return qSe.default}});Object.defineProperty(Ce,"inheritInnerComments",{enumerable:!0,get:function(){return xSe.default}});Object.defineProperty(Ce,"inheritLeadingComments",{enumerable:!0,get:function(){return SSe.default}});Object.defineProperty(Ce,"inheritTrailingComments",{enumerable:!0,get:function(){return wSe.default}});Object.defineProperty(Ce,"inherits",{enumerable:!0,get:function(){return MSe.default}});Object.defineProperty(Ce,"inheritsComments",{enumerable:!0,get:function(){return TSe.default}});Object.defineProperty(Ce,"is",{enumerable:!0,get:function(){return GSe.default}});Object.defineProperty(Ce,"isBinding",{enumerable:!0,get:function(){return ZSe.default}});Object.defineProperty(Ce,"isBlockScoped",{enumerable:!0,get:function(){return HSe.default}});Object.defineProperty(Ce,"isImmutable",{enumerable:!0,get:function(){return JSe.default}});Object.defineProperty(Ce,"isLet",{enumerable:!0,get:function(){return YSe.default}});Object.defineProperty(Ce,"isNode",{enumerable:!0,get:function(){return XSe.default}});Object.defineProperty(Ce,"isNodesEquivalent",{enumerable:!0,get:function(){return QSe.default}});Object.defineProperty(Ce,"isPlaceholderType",{enumerable:!0,get:function(){return eTe.default}});Object.defineProperty(Ce,"isReferenced",{enumerable:!0,get:function(){return tTe.default}});Object.defineProperty(Ce,"isScope",{enumerable:!0,get:function(){return rTe.default}});Object.defineProperty(Ce,"isSpecifierDefault",{enumerable:!0,get:function(){return nTe.default}});Object.defineProperty(Ce,"isType",{enumerable:!0,get:function(){return iTe.default}});Object.defineProperty(Ce,"isValidES3Identifier",{enumerable:!0,get:function(){return sTe.default}});Object.defineProperty(Ce,"isValidIdentifier",{enumerable:!0,get:function(){return aTe.default}});Object.defineProperty(Ce,"isVar",{enumerable:!0,get:function(){return oTe.default}});Object.defineProperty(Ce,"matchesPattern",{enumerable:!0,get:function(){return cTe.default}});Object.defineProperty(Ce,"prependToMemberExpression",{enumerable:!0,get:function(){return LSe.default}});Ce.react=void 0;Object.defineProperty(Ce,"removeComments",{enumerable:!0,get:function(){return ESe.default}});Object.defineProperty(Ce,"removeProperties",{enumerable:!0,get:function(){return FSe.default}});Object.defineProperty(Ce,"removePropertiesDeep",{enumerable:!0,get:function(){return jSe.default}});Object.defineProperty(Ce,"removeTypeDuplicates",{enumerable:!0,get:function(){return BSe.default}});Object.defineProperty(Ce,"shallowEqual",{enumerable:!0,get:function(){return KSe.default}});Object.defineProperty(Ce,"toBindingIdentifierName",{enumerable:!0,get:function(){return ISe.default}});Object.defineProperty(Ce,"toBlock",{enumerable:!0,get:function(){return ASe.default}});Object.defineProperty(Ce,"toComputedKey",{enumerable:!0,get:function(){return kSe.default}});Object.defineProperty(Ce,"toExpression",{enumerable:!0,get:function(){return CSe.default}});Object.defineProperty(Ce,"toIdentifier",{enumerable:!0,get:function(){return NSe.default}});Object.defineProperty(Ce,"toKeyAlias",{enumerable:!0,get:function(){return OSe.default}});Object.defineProperty(Ce,"toStatement",{enumerable:!0,get:function(){return $Se.default}});Object.defineProperty(Ce,"traverse",{enumerable:!0,get:function(){return S_.default}});Object.defineProperty(Ce,"traverseFast",{enumerable:!0,get:function(){return VSe.default}});Object.defineProperty(Ce,"validate",{enumerable:!0,get:function(){return lTe.default}});Object.defineProperty(Ce,"valueToNode",{enumerable:!0,get:function(){return RSe.default}});var cSe=$2(),lSe=R2(),uSe=Ej(),dSe=Pj(),GA=Ij();Object.keys(GA).forEach(function(e){e==="default"||e==="__esModule"||Object.prototype.hasOwnProperty.call(So,e)||e in Ce&&Ce[e]===GA[e]||Object.defineProperty(Ce,e,{enumerable:!0,get:function(){return GA[e]}})});var pSe=Aj(),AB=Nj(),fSe=Dj(),ZA=BI();Object.keys(ZA).forEach(function(e){e==="default"||e==="__esModule"||Object.prototype.hasOwnProperty.call(So,e)||e in Ce&&Ce[e]===ZA[e]||Object.defineProperty(Ce,e,{enumerable:!0,get:function(){return ZA[e]}})});var HA=fi();Object.keys(HA).forEach(function(e){e==="default"||e==="__esModule"||Object.prototype.hasOwnProperty.call(So,e)||e in Ce&&Ce[e]===HA[e]||Object.defineProperty(Ce,e,{enumerable:!0,get:function(){return HA[e]}})});var hSe=xo(),mSe=zj(),gSe=Uj(),ySe=qj(),_Se=Wj(),bSe=Vj(),vSe=ZI(),xSe=XI(),SSe=eA(),TSe=iA(),wSe=rA(),ESe=Kj(),JA=Gj();Object.keys(JA).forEach(function(e){e==="default"||e==="__esModule"||Object.prototype.hasOwnProperty.call(So,e)||e in Ce&&Ce[e]===JA[e]||Object.defineProperty(Ce,e,{enumerable:!0,get:function(){return JA[e]}})});var YA=wu();Object.keys(YA).forEach(function(e){e==="default"||e==="__esModule"||Object.prototype.hasOwnProperty.call(So,e)||e in Ce&&Ce[e]===YA[e]||Object.defineProperty(Ce,e,{enumerable:!0,get:function(){return YA[e]}})});var PSe=Zj(),ISe=Hj(),ASe=cA(),kSe=Jj(),CSe=Yj(),NSe=dA(),OSe=rB(),$Se=nB(),RSe=iB(),XA=Wi();Object.keys(XA).forEach(function(e){e==="default"||e==="__esModule"||Object.prototype.hasOwnProperty.call(So,e)||e in Ce&&Ce[e]===XA[e]||Object.defineProperty(Ce,e,{enumerable:!0,get:function(){return XA[e]}})});var DSe=sB(),MSe=oB(),LSe=cB(),FSe=yA(),jSe=bA(),BSe=DI(),zSe=lB(),USe=jf(),qSe=uB(),WSe=pB(),S_=fB();Object.keys(S_).forEach(function(e){e==="default"||e==="__esModule"||Object.prototype.hasOwnProperty.call(So,e)||e in Ce&&Ce[e]===S_[e]||Object.defineProperty(Ce,e,{enumerable:!0,get:function(){return S_[e]}})});var VSe=mA(),KSe=Qy(),GSe=Su(),ZSe=hB(),HSe=gB(),JSe=yB(),YSe=$A(),XSe=OI(),QSe=bB(),eTe=nI(),tTe=vB(),rTe=xB(),nTe=TB(),iTe=t_(),sTe=wB(),aTe=Tu(),oTe=EB(),cTe=YP(),lTe=s_(),uTe=QP(),QA=Vr();Object.keys(QA).forEach(function(e){e==="default"||e==="__esModule"||Object.prototype.hasOwnProperty.call(So,e)||e in Ce&&Ce[e]===QA[e]||Object.defineProperty(Ce,e,{enumerable:!0,get:function(){return QA[e]}})});var dTe=xu(),pTe=IB(),Pst=Ce.react={isReactComponent:cSe.default,isCompatTag:lSe.default,buildChildren:uSe.default};Ce.toSequenceExpression=pTe.default;process.env.BABEL_TYPES_8_BREAKING&&console.warn("BABEL_TYPES_8_BREAKING is not supported anymore. Use the latest Babel 8.0.0 pre-release instead!")});var ek=G(sn=>{"use strict";Object.defineProperty(sn,"__esModule",{value:!0});sn.isBindingIdentifier=DTe;sn.isBlockScoped=BTe;sn.isExpression=LTe;sn.isFlow=VTe;sn.isForAwaitStatement=ZTe;sn.isGenerated=qTe;sn.isPure=WTe;sn.isReferenced=jTe;sn.isReferencedIdentifier=$Te;sn.isReferencedMemberExpression=RTe;sn.isRestProperty=KTe;sn.isScope=FTe;sn.isSpreadProperty=GTe;sn.isStatement=MTe;sn.isUser=UTe;sn.isVar=zTe;var fTe=Rt(),{isBinding:hTe,isBlockScoped:mTe,isExportDeclaration:gTe,isExpression:yTe,isFlow:_Te,isForStatement:bTe,isForXStatement:vTe,isIdentifier:kB,isImportDeclaration:xTe,isImportSpecifier:STe,isJSXIdentifier:TTe,isJSXMemberExpression:wTe,isMemberExpression:ETe,isRestElement:CB,isReferenced:T_,isScope:PTe,isStatement:ITe,isVar:ATe,isVariableDeclaration:kTe,react:CTe,isForOfStatement:NTe}=fTe,{isCompatTag:OTe}=CTe;function $Te(e){let{node:t,parent:r}=this;return kB(t,e)?T_(t,r,this.parentPath.parent):TTe(t,e)?!wTe(r)&&OTe(t.name)?!1:T_(t,r,this.parentPath.parent):!1}function RTe(){let{node:e,parent:t}=this;return ETe(e)&&T_(e,t)}function DTe(){let{node:e,parent:t}=this,r=this.parentPath.parent;return kB(e)&&hTe(e,t,r)}function MTe(){let{node:e,parent:t}=this;return ITe(e)?!(kTe(e)&&(vTe(t,{left:e})||bTe(t,{init:e}))):!1}function LTe(){return this.isIdentifier()?this.isReferencedIdentifier():yTe(this.node)}function FTe(){return PTe(this.node,this.parent)}function jTe(){return T_(this.node,this.parent)}function BTe(){return mTe(this.node)}function zTe(){return ATe(this.node)}function UTe(){var e;return!!((e=this.node)!=null&&e.loc)}function qTe(){return!this.isUser()}function WTe(e){return this.scope.isPure(this.node,e)}function VTe(){let{node:e}=this;return _Te(e)?!0:xTe(e)?e.importKind==="type"||e.importKind==="typeof":gTe(e)?e.exportKind==="type":STe(e)?e.importKind==="type"||e.importKind==="typeof":!1}function KTe(){var e;return CB(this.node)&&((e=this.parentPath)==null?void 0:e.isObjectPattern())}function GTe(){var e;return CB(this.node)&&((e=this.parentPath)==null?void 0:e.isObjectExpression())}function ZTe(){return NTe(this.node,{await:!0})}sn.isExistentialTypeParam=function(){throw new Error("`path.isExistentialTypeParam` has been renamed to `path.isExistsTypeAnnotation()` in Babel 7.")};sn.isNumericLiteralTypeAnnotation=function(){throw new Error("`path.isNumericLiteralTypeAnnotation()` has been renamed to `path.isNumberLiteralTypeAnnotation()` in Babel 7.")}});var zf=G(Cc=>{"use strict";Object.defineProperty(Cc,"__esModule",{value:!0});Cc.environmentVisitor=rwe;Cc.explode=zB;Cc.isExplodedVisitor=BB;Cc.merge=qB;Cc.verify=UB;var jB=qP(),HTe=ek(),JTe=Rt(),NB=Ki(),{DEPRECATED_KEYS:OB,DEPRECATED_ALIASES:$B,FLIPPED_ALIAS_KEYS:RB,TYPES:YTe,__internal__deprecationWarning:DB}=JTe;function XTe(e){return e in jB}function BB(e){return e?._exploded}function zB(e){if(BB(e))return e;e._exploded=!0;for(let r of Object.keys(e)){if(kc(r))continue;let n=r.split("|");if(n.length===1)continue;let s=e[r];delete e[r];for(let a of n)e[a]=s}UB(e),delete e.__esModule,QTe(e),FB(e);for(let r of Object.keys(e)){if(kc(r)||!XTe(r))continue;let n=e[r];for(let a of Object.keys(n))n[a]=ewe(r,n[a]);delete e[r];let s=jB[r];if(s!==null)for(let a of s){var t;(t=e[a])!=null||(e[a]={}),Bf(e[a],n)}else Bf(e,n)}for(let r of Object.keys(e)){if(kc(r))continue;let n=RB[r];if(r in OB){let a=OB[r];DB(r,a,"Visitor "),n=[a]}else if(r in $B){let a=$B[r];DB(r,a,"Visitor "),n=RB[a]}if(!n)continue;let s=e[r];delete e[r];for(let a of n){let o=e[a];o?Bf(o,s):e[a]=Object.assign({},s)}}for(let r of Object.keys(e))kc(r)||FB(e[r]);return e}function UB(e){if(!e._verified){if(typeof e=="function")throw new Error("You passed `traverse()` a function when it expected a visitor object, are you sure you didn't mean `{ enter: Function }`?");for(let t of Object.keys(e)){if((t==="enter"||t==="exit")&&MB(t,e[t]),kc(t))continue;if(!YTe.includes(t))throw new Error(`You gave us a visitor for the node type ${t} but it's not a valid type in @babel/traverse 7.29.0`);let r=e[t];if(typeof r=="object")for(let n of Object.keys(r))if(n==="enter"||n==="exit")MB(`${t}.${n}`,r[n]);else throw new Error(`You passed \`traverse()\` a visitor object with the property ${t} that has the invalid property ${n}`)}e._verified=!0}}function MB(e,t){let r=[].concat(t);for(let n of r)if(typeof n!="function")throw new TypeError(`Non-function found defined in ${e} with type ${typeof n}`)}function qB(e,t=[],r){let n={_verified:!0,_exploded:!0};Object.defineProperty(n,"_exploded",{enumerable:!1}),Object.defineProperty(n,"_verified",{enumerable:!1});for(let s=0;s<e.length;s++){let a=zB(e[s]),o=t[s],c=a;(o||r)&&(c=LB(c,o,r)),Bf(n,c);for(let l of Object.keys(a)){if(kc(l))continue;let u=a[l];(o||r)&&(u=LB(u,o,r));let d=n[l]||(n[l]={});Bf(d,u)}}return n}function LB(e,t,r){let n={};for(let s of["enter","exit"]){let a=e[s];Array.isArray(a)&&(a=a.map(function(o){let c=o;return t&&(c=function(l){o.call(t,l,t)}),r&&(c=r(t?.key,s,c)),c!==o&&(c.toString=()=>o.toString()),c}),n[s]=a)}return n}function QTe(e){for(let t of Object.keys(e)){if(kc(t))continue;let r=e[t];typeof r=="function"&&(e[t]={enter:r})}}function FB(e){e.enter&&!Array.isArray(e.enter)&&(e.enter=[e.enter]),e.exit&&!Array.isArray(e.exit)&&(e.exit=[e.exit])}function ewe(e,t){let r=`is${e}`,n=HTe[r],s=function(a){if(n.call(a))return t.apply(this,arguments)};return s.toString=()=>t.toString(),s}function kc(e){return!!(e.startsWith("_")||e==="enter"||e==="exit"||e==="shouldSkip"||e==="denylist"||e==="noScope"||e==="skipKeys"||e==="blacklist")}function Bf(e,t){for(let r of["enter","exit"])t[r]&&(e[r]=[].concat(e[r]||[],t[r]))}var twe={FunctionParent(e){e.isArrowFunctionExpression()||(e.skip(),e.isMethod()&&(e.requeueComputedKeyAndDecorators?e.requeueComputedKeyAndDecorators():NB.requeueComputedKeyAndDecorators.call(e)))},Property(e){e.isObjectProperty()||(e.skip(),e.requeueComputedKeyAndDecorators?e.requeueComputedKeyAndDecorators():NB.requeueComputedKeyAndDecorators.call(e))}};function rwe(e){return qB([twe,e])}});var WB=G(E_=>{"use strict";Object.defineProperty(E_,"__esModule",{value:!0});E_.default=void 0;var w_=Rt(),nwe=w_,iwe=P_(),swe=zf(),awe=Ki(),{getAssignmentIdentifiers:owe}=nwe,cwe={ReferencedIdentifier({node:e},t){e.name===t.oldName&&(e.name=t.newName)},Scope(e,t){e.scope.bindingIdentifierEquals(t.oldName,t.binding.identifier)||(e.skip(),e.isMethod()&&(e.requeueComputedKeyAndDecorators?e.requeueComputedKeyAndDecorators():awe.requeueComputedKeyAndDecorators.call(e)),e.isSwitchStatement()&&e.context.maybeQueue(e.get("discriminant")))},ObjectProperty({node:e,scope:t},r){let{name:n}=e.key;if(e.shorthand&&(n===r.oldName||n===r.newName)&&t.getBindingIdentifier(n)===r.binding.identifier){var s;e.shorthand=!1,(s=e.extra)!=null&&s.shorthand&&(e.extra.shorthand=!1)}},"AssignmentExpression|Declaration|VariableDeclarator"(e,t){if(e.isVariableDeclaration())return;let r=e.isAssignmentExpression()?owe(e.node):e.getOuterBindingIdentifiers();for(let n in r)n===t.oldName&&(r[n].name=t.newName)}},tk=class{constructor(t,r,n){this.newName=n,this.oldName=r,this.binding=t}maybeConvertFromExportDeclaration(t){let r=t.parentPath;if(r.isExportDeclaration()){if(r.isExportDefaultDeclaration()){let{declaration:n}=r.node;if(w_.isDeclaration(n)&&!n.id)return}r.isExportAllDeclaration()||r.splitExportDeclaration()}}maybeConvertFromClassFunctionDeclaration(t){return t}maybeConvertFromClassFunctionExpression(t){return t}rename(){let{binding:t,oldName:r,newName:n}=this,{scope:s,path:a}=t,o=a.find(u=>u.isDeclaration()||u.isFunctionExpression()||u.isClassExpression());o&&o.getOuterBindingIdentifiers()[r]===t.identifier&&this.maybeConvertFromExportDeclaration(o);let c=arguments[0]||s.block,l={discriminant:!0};w_.isMethod(c)&&(c.computed&&(l.key=!0),w_.isObjectMethod(c)||(l.decorators=!0)),(0,iwe.traverseNode)(c,(0,swe.explode)(cwe),s,this,s.path,l),arguments[0]||(s.removeOwnBinding(r),s.bindings[n]=t,this.binding.identifier.name=n),o&&(this.maybeConvertFromClassFunctionDeclaration(a),this.maybeConvertFromClassFunctionExpression(a))}};E_.default=tk});var VB=G(rk=>{"use strict";Object.defineProperty(rk,"__esModule",{value:!0});rk.default=hwe;var lwe=Rt(),uwe=Ta(),dwe=zf(),pwe=Ki(),{VISITOR_KEYS:fwe}=lwe;function hwe(e,t,r){let n=(0,dwe.explode)(t);if(n.enter||n.exit)throw new Error("Should not be used with enter/exit visitors.");s(e.parentPath,e.parent,e.node,e.container,e.key,e.listKey,e.hub,e);function s(a,o,c,l,u,d,p,f){if(!c)return;let h=f||uwe.NodePath.get({hub:p,parentPath:a,parent:o,container:l,listKey:d,key:u});pwe._forceSetScope.call(h);let m=n[c.type];if(m!=null&&m.enter)for(let y of m.enter)y.call(r,h,r);if(h.shouldSkip)return;let g=fwe[c.type];if(g!=null&&g.length){for(let y of g){let _=c[y];if(_)if(Array.isArray(_))for(let v=0;v<_.length;v++){let S=_[v];s(h,c,S,_,v,y)}else s(h,c,_,c,y,null)}if(m!=null&&m.exit)for(let y of m.exit)y.call(r,h,r)}}}});var KB=G(I_=>{"use strict";Object.defineProperty(I_,"__esModule",{value:!0});I_.default=void 0;var nk=class{constructor({identifier:t,scope:r,path:n,kind:s}){this.identifier=void 0,this.scope=void 0,this.path=void 0,this.kind=void 0,this.constantViolations=[],this.constant=!0,this.referencePaths=[],this.referenced=!1,this.references=0,this.identifier=t,this.scope=r,this.path=n,this.kind=s,(s==="var"||s==="hoisted")&&mwe(n)&&this.reassign(n),this.clearValue()}deoptValue(){this.clearValue(),this.hasDeoptedValue=!0}setValue(t){this.hasDeoptedValue||(this.hasValue=!0,this.value=t)}clearValue(){this.hasDeoptedValue=!1,this.hasValue=!1,this.value=null}reassign(t){this.constant=!1,!this.constantViolations.includes(t)&&this.constantViolations.push(t)}reference(t){this.referencePaths.includes(t)||(this.referenced=!0,this.references++,this.referencePaths.push(t))}dereference(){this.references--,this.referenced=!!this.references}};I_.default=nk;function mwe(e){let t=!e.isVariableDeclarator()||e.node.init;for(let{parentPath:r,key:n}=e;r;{parentPath:r,key:n}=r){if(r.isFunctionParent())return!1;if(n==="left"&&r.isForXStatement()||t&&n==="body"&&r.isLoop())return!0}return!1}});var Nc=G(Ii=>{"use strict";Object.defineProperty(Ii,"__esModule",{value:!0});Ii.clear=ywe;Ii.clearPath=GB;Ii.clearScope=ZB;Ii.getCachedPaths=_we;Ii.getOrCreateCachedPaths=bwe;Ii.scope=Ii.path=void 0;var A_=Ii.path=new WeakMap,gwe=Ii.scope=new WeakMap;function ywe(){GB(),ZB()}function GB(){Ii.path=A_=new WeakMap}function ZB(){Ii.scope=gwe=new WeakMap}function _we(e){let{parent:t,parentPath:r}=e;return A_.get(t)}function bwe(e,t){let r=A_.get(e);return r||A_.set(e,r=new Map),r}});var HB=G((Rst,vwe)=>{vwe.exports=["decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","eval","globalThis","isFinite","isNaN","parseFloat","parseInt","undefined","unescape"]});var JB=G((Dst,xwe)=>{xwe.exports=["AggregateError","Array","ArrayBuffer","Atomics","BigInt","BigInt64Array","BigUint64Array","Boolean","DataView","Date","Error","EvalError","FinalizationRegistry","Float16Array","Float32Array","Float64Array","Function","Infinity","Int16Array","Int32Array","Int8Array","Intl","Iterator","JSON","Map","Math","NaN","Number","Object","Promise","Proxy","RangeError","ReferenceError","Reflect","RegExp","Set","SharedArrayBuffer","String","Symbol","SyntaxError","TypeError","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray","URIError","WeakMap","WeakRef","WeakSet"]});var ok=G(C_=>{"use strict";Object.defineProperty(C_,"__esModule",{value:!0});C_.default=void 0;var Swe=WB(),a4=Ta(),Mst=VB(),Twe=KB(),o4=Rt(),c4=o4,YB=Nc(),wwe=HB(),Ewe=JB(),{assignmentExpression:Pwe,callExpression:XB,cloneNode:QB,getBindingIdentifiers:l4,identifier:$c,isArrayExpression:u4,isBinary:Iwe,isCallExpression:e4,isClass:Awe,isClassBody:kwe,isClassDeclaration:Cwe,isExportAllDeclaration:d4,isExportDefaultDeclaration:Nwe,isExportNamedDeclaration:ik,isFunctionDeclaration:Owe,isIdentifier:Oc,isImportDeclaration:sk,isLiteral:$we,isMemberExpression:Rwe,isMethod:Dwe,isModuleSpecifier:Mwe,isNullLiteral:Lwe,isObjectExpression:Fwe,isProperty:jwe,isPureish:Bwe,isRegExpLiteral:zwe,isSuper:Uwe,isTaggedTemplateExpression:qwe,isTemplateLiteral:p4,isThisExpression:t4,isUnaryExpression:Wwe,isVariableDeclaration:Vwe,expressionStatement:Kwe,matchesPattern:r4,memberExpression:ak,numericLiteral:Gwe,toIdentifier:Zwe,variableDeclaration:Hwe,variableDeclarator:Jwe,isObjectProperty:Ywe,isTopicReference:n4,isMetaProperty:Xwe,isPrivateName:Qwe,isExportDeclaration:e0e,buildUndefinedNode:t0e,sequenceExpression:r0e}=o4;function Pr(e,t){switch(e?.type){default:if(sk(e)||e0e(e)){var r;if((d4(e)||ik(e)||sk(e))&&e.source)Pr(e.source,t);else if((ik(e)||sk(e))&&(r=e.specifiers)!=null&&r.length)for(let n of e.specifiers)Pr(n,t);else(Nwe(e)||ik(e))&&e.declaration&&Pr(e.declaration,t)}else Mwe(e)?Pr(e.local,t):$we(e)&&!Lwe(e)&&!zwe(e)&&!p4(e)&&t.push(e.value);break;case"MemberExpression":case"OptionalMemberExpression":case"JSXMemberExpression":Pr(e.object,t),Pr(e.property,t);break;case"Identifier":case"JSXIdentifier":t.push(e.name);break;case"CallExpression":case"OptionalCallExpression":case"NewExpression":Pr(e.callee,t);break;case"ObjectExpression":case"ObjectPattern":for(let n of e.properties)Pr(n,t);break;case"SpreadElement":case"RestElement":Pr(e.argument,t);break;case"ObjectProperty":case"ObjectMethod":case"ClassProperty":case"ClassMethod":case"ClassPrivateProperty":case"ClassPrivateMethod":Pr(e.key,t);break;case"ThisExpression":t.push("this");break;case"Super":t.push("super");break;case"Import":case"ImportExpression":t.push("import");break;case"DoExpression":t.push("do");break;case"YieldExpression":t.push("yield"),Pr(e.argument,t);break;case"AwaitExpression":t.push("await"),Pr(e.argument,t);break;case"AssignmentExpression":Pr(e.left,t);break;case"VariableDeclarator":Pr(e.id,t);break;case"FunctionExpression":case"FunctionDeclaration":case"ClassExpression":case"ClassDeclaration":Pr(e.id,t);break;case"PrivateName":Pr(e.id,t);break;case"ParenthesizedExpression":Pr(e.expression,t);break;case"UnaryExpression":case"UpdateExpression":Pr(e.argument,t);break;case"MetaProperty":Pr(e.meta,t),Pr(e.property,t);break;case"JSXElement":Pr(e.openingElement,t);break;case"JSXOpeningElement":Pr(e.name,t);break;case"JSXFragment":Pr(e.openingFragment,t);break;case"JSXOpeningFragment":t.push("Fragment");break;case"JSXNamespacedName":Pr(e.namespace,t),Pr(e.name,t);break}}function i4(e){e.references=Object.create(null),e.uids=Object.create(null),e.bindings=Object.create(null),e.globals=Object.create(null)}function n0e(e){return e.isFunctionExpression()&&!e.node.id||e.isArrowFunctionExpression()}var s4=Symbol.for("should not be considered a local binding"),i0e={ForStatement(e){let t=e.get("init");if(t.isVar()){let{scope:r}=e;(r.getFunctionParent()||r.getProgramParent()).registerBinding("var",t)}},Declaration(e){if(e.isBlockScoped()||e.isImportDeclaration()||e.isExportDeclaration())return;(e.scope.getFunctionParent()||e.scope.getProgramParent()).registerDeclaration(e)},ImportDeclaration(e){e.scope.getBlockParent().registerDeclaration(e)},TSImportEqualsDeclaration(e){e.scope.getBlockParent().registerDeclaration(e)},ReferencedIdentifier(e,t){c4.isTSQualifiedName(e.parent)&&e.parent.right===e.node||e.parentPath.isTSImportEqualsDeclaration()||t.references.push(e)},ForXStatement(e,t){let r=e.get("left");if(r.isPattern()||r.isIdentifier())t.constantViolations.push(e);else if(r.isVar()){let{scope:n}=e;(n.getFunctionParent()||n.getProgramParent()).registerBinding("var",r)}},ExportDeclaration:{exit(e){let{node:t,scope:r}=e;if(d4(t))return;let n=t.declaration;if(Cwe(n)||Owe(n)){let s=n.id;if(!s)return;let a=r.getBinding(s.name);a?.reference(e)}else if(Vwe(n))for(let s of n.declarations)for(let a of Object.keys(l4(s))){let o=r.getBinding(a);o?.reference(e)}}},LabeledStatement(e){e.scope.getBlockParent().registerDeclaration(e)},AssignmentExpression(e,t){t.assignments.push(e)},UpdateExpression(e,t){t.constantViolations.push(e)},UnaryExpression(e,t){e.node.operator==="delete"&&t.constantViolations.push(e)},BlockScoped(e){let t=e.scope;if(t.path===e&&(t=t.parent),t.getBlockParent().registerDeclaration(e),e.isClassDeclaration()&&e.node.id){let s=e.node.id.name;e.scope.bindings[s]=e.scope.parent.getBinding(s)}},CatchClause(e){e.scope.registerBinding("let",e)},Function(e){let t=e.get("params");for(let r of t)e.scope.registerBinding("param",r);e.isFunctionExpression()&&e.node.id&&!e.node.id[s4]&&e.scope.registerBinding("local",e.get("id"),e)},ClassExpression(e){e.node.id&&!e.node.id[s4]&&e.scope.registerBinding("local",e.get("id"),e)},TSTypeAnnotation(e){e.skip()}},k_,s0e=0,xs=class e{constructor(t){this.uid=void 0,this.path=void 0,this.block=void 0,this.inited=void 0,this.labels=void 0,this.bindings=void 0,this.referencesSet=void 0,this.globals=void 0,this.uidsSet=void 0,this.data=void 0,this.crawling=void 0;let{node:r}=t,n=YB.scope.get(r);if(n?.path===t)return n;YB.scope.set(r,this),this.uid=s0e++,this.block=r,this.path=t,this.labels=new Map,this.inited=!1,Object.defineProperties(this,{references:{enumerable:!0,configurable:!0,writable:!0,value:Object.create(null)},uids:{enumerable:!0,configurable:!0,writable:!0,value:Object.create(null)}})}get parent(){var t;let r,n=this.path;do{var s;let a=n.key==="key"||n.listKey==="decorators";n=n.parentPath,a&&n.isMethod()&&(n=n.parentPath),(s=n)!=null&&s.isScope()&&(r=n)}while(n&&!r);return(t=r)==null?void 0:t.scope}get references(){throw new Error("Scope#references is not available in Babel 8. Use Scope#referencesSet instead.")}get uids(){throw new Error("Scope#uids is not available in Babel 8. Use Scope#uidsSet instead.")}generateDeclaredUidIdentifier(t){let r=this.generateUidIdentifier(t);return this.push({id:r}),QB(r)}generateUidIdentifier(t){return $c(this.generateUid(t))}generateUid(t="temp"){t=Zwe(t).replace(/^_+/,"").replace(/\d+$/g,"");let r,n=0;do r=`_${t}`,n>=11?r+=n-1:n>=9?r+=n-9:n>=1&&(r+=n+1),n++;while(this.hasLabel(r)||this.hasBinding(r)||this.hasGlobal(r)||this.hasReference(r));let s=this.getProgramParent();return s.references[r]=!0,s.uids[r]=!0,r}generateUidBasedOnNode(t,r){let n=[];Pr(t,n);let s=n.join("$");return s=s.replace(/^_/,"")||r||"ref",this.generateUid(s.slice(0,20))}generateUidIdentifierBasedOnNode(t,r){return $c(this.generateUidBasedOnNode(t,r))}isStatic(t){if(t4(t)||Uwe(t)||n4(t))return!0;if(Oc(t)){let r=this.getBinding(t.name);return r?r.constant:this.hasBinding(t.name)}return!1}maybeGenerateMemoised(t,r){if(this.isStatic(t))return null;{let n=this.generateUidIdentifierBasedOnNode(t);return r?n:(this.push({id:n}),QB(n))}}checkBlockScopedCollisions(t,r,n,s){if(r==="param"||t.kind==="local")return;if(r==="let"||t.kind==="let"||t.kind==="const"||t.kind==="module"||t.kind==="param"&&r==="const")throw this.path.hub.buildError(s,`Duplicate declaration "${n}"`,TypeError)}rename(t,r){let n=this.getBinding(t);n&&(r||(r=this.generateUidIdentifier(t).name),new Swe.default(n,t,r).rename(arguments[2]))}dump(){let t="-".repeat(60);console.log(t);let r=this;do{console.log("#",r.block.type);for(let n of Object.keys(r.bindings)){let s=r.bindings[n];console.log(" -",n,{constant:s.constant,references:s.references,violations:s.constantViolations.length,kind:s.kind})}}while(r=r.parent);console.log(t)}hasLabel(t){return!!this.getLabel(t)}getLabel(t){return this.labels.get(t)}registerLabel(t){this.labels.set(t.node.label.name,t)}registerDeclaration(t){if(t.isLabeledStatement())this.registerLabel(t);else if(t.isFunctionDeclaration())this.registerBinding("hoisted",t.get("id"),t);else if(t.isVariableDeclaration()){let r=t.get("declarations"),{kind:n}=t.node;for(let s of r)this.registerBinding(n==="using"||n==="await using"?"const":n,s)}else if(t.isClassDeclaration()){if(t.node.declare)return;this.registerBinding("let",t)}else if(t.isImportDeclaration()){let r=t.node.importKind==="type"||t.node.importKind==="typeof",n=t.get("specifiers");for(let s of n){let a=r||s.isImportSpecifier()&&(s.node.importKind==="type"||s.node.importKind==="typeof");this.registerBinding(a?"unknown":"module",s)}}else if(t.isExportDeclaration()){let r=t.get("declaration");(r.isClassDeclaration()||r.isFunctionDeclaration()||r.isVariableDeclaration())&&this.registerDeclaration(r)}else this.registerBinding("unknown",t)}buildUndefinedNode(){return t0e()}registerConstantViolation(t){let r=t.getAssignmentIdentifiers();for(let s of Object.keys(r)){var n;(n=this.getBinding(s))==null||n.reassign(t)}}registerBinding(t,r,n=r){if(!t)throw new ReferenceError("no `kind`");if(r.isVariableDeclaration()){let o=r.get("declarations");for(let c of o)this.registerBinding(t,c);return}let s=this.getProgramParent(),a=r.getOuterBindingIdentifiers(!0);for(let o of Object.keys(a)){s.references[o]=!0;for(let c of a[o]){let l=this.getOwnBinding(o);if(l){if(l.identifier===c)continue;this.checkBlockScopedCollisions(l,t,o,c)}l?l.reassign(n):this.bindings[o]=new Twe.default({identifier:c,scope:this,path:n,kind:t})}}}addGlobal(t){this.globals[t.name]=t}hasUid(t){let r=this;do if(r.uids[t])return!0;while(r=r.parent);return!1}hasGlobal(t){let r=this;do if(r.globals[t])return!0;while(r=r.parent);return!1}hasReference(t){return!!this.getProgramParent().references[t]}isPure(t,r){if(Oc(t)){let o=this.getBinding(t.name);return o?r?o.constant:!0:!1}else{if(t4(t)||Xwe(t)||n4(t)||Qwe(t))return!0;if(Awe(t)){var n;return t.superClass&&!this.isPure(t.superClass,r)||((n=t.decorators)==null?void 0:n.length)>0?!1:this.isPure(t.body,r)}else if(kwe(t)){for(let o of t.body)if(!this.isPure(o,r))return!1;return!0}else{if(Iwe(t))return this.isPure(t.left,r)&&this.isPure(t.right,r);if(u4(t)||t?.type==="TupleExpression"){for(let o of t.elements)if(o!==null&&!this.isPure(o,r))return!1;return!0}else if(Fwe(t)||t?.type==="RecordExpression"){for(let o of t.properties)if(!this.isPure(o,r))return!1;return!0}else if(Dwe(t)){var s;return!(t.computed&&!this.isPure(t.key,r)||((s=t.decorators)==null?void 0:s.length)>0)}else if(jwe(t)){var a;return!(t.computed&&!this.isPure(t.key,r)||((a=t.decorators)==null?void 0:a.length)>0||(Ywe(t)||t.static)&&t.value!==null&&!this.isPure(t.value,r))}else{if(Wwe(t))return this.isPure(t.argument,r);if(p4(t)){for(let o of t.expressions)if(!this.isPure(o,r))return!1;return!0}else return qwe(t)?r4(t.tag,"String.raw")&&!this.hasBinding("String",{noGlobals:!0})&&this.isPure(t.quasi,r):Rwe(t)?!t.computed&&Oc(t.object)&&t.object.name==="Symbol"&&Oc(t.property)&&t.property.name!=="for"&&!this.hasBinding("Symbol",{noGlobals:!0}):e4(t)?r4(t.callee,"Symbol.for")&&!this.hasBinding("Symbol",{noGlobals:!0})&&t.arguments.length===1&&c4.isStringLiteral(t.arguments[0]):Bwe(t)}}}}setData(t,r){return this.data[t]=r}getData(t){let r=this;do{let n=r.data[t];if(n!=null)return n}while(r=r.parent)}removeData(t){let r=this;do r.data[t]!=null&&(r.data[t]=null);while(r=r.parent)}init(){this.inited||(this.inited=!0,this.crawl())}crawl(){let t=this.path;i4(this),this.data=Object.create(null);let r=this;do{if(r.crawling)return;if(r.path.isProgram())break}while(r=r.parent);let n=r,s={references:[],constantViolations:[],assignments:[]};if(this.crawling=!0,k_||(k_=a4.default.visitors.merge([{Scope(a){i4(a.scope)}},i0e])),t.type!=="Program"){let a=k_[t.type];if(a)for(let o of a.enter)o.call(s,t,s)}t.traverse(k_,s),this.crawling=!1;for(let a of s.assignments){let o=a.getAssignmentIdentifiers();for(let c of Object.keys(o))a.scope.getBinding(c)||n.addGlobal(o[c]);a.scope.registerConstantViolation(a)}for(let a of s.references){let o=a.scope.getBinding(a.node.name);o?o.reference(a):n.addGlobal(a.node)}for(let a of s.constantViolations)a.scope.registerConstantViolation(a)}push(t){let r=this.path;r.isPattern()?r=this.getPatternParent().path:!r.isBlockStatement()&&!r.isProgram()&&(r=this.getBlockParent().path),r.isSwitchStatement()&&(r=(this.getFunctionParent()||this.getProgramParent()).path);let{init:n,unique:s,kind:a="var",id:o}=t;if(!n&&!s&&(a==="var"||a==="let")&&n0e(r)&&e4(r.parent,{callee:r.node})&&r.parent.arguments.length<=r.node.params.length&&Oc(o)){r.pushContainer("params",o),r.scope.registerBinding("param",r.get("params")[r.node.params.length-1]);return}(r.isLoop()||r.isCatchClause()||r.isFunction())&&(r.ensureBlock(),r=r.get("body"));let c=t._blockHoist==null?2:t._blockHoist,l=`declaration:${a}:${c}`,u=!s&&r.getData(l);if(!u){let f=Hwe(a,[]);f._blockHoist=c,[u]=r.unshiftContainer("body",[f]),s||r.setData(l,u)}let d=Jwe(o,n),p=u.node.declarations.push(d);r.scope.registerBinding(a,u.get("declarations")[p-1])}getProgramParent(){let t=this;do if(t.path.isProgram())return t;while(t=t.parent);throw new Error("Couldn't find a Program")}getFunctionParent(){let t=this;do if(t.path.isFunctionParent())return t;while(t=t.parent);return null}getBlockParent(){let t=this;do if(t.path.isBlockParent())return t;while(t=t.parent);throw new Error("We couldn't find a BlockStatement, For, Switch, Function, Loop or Program...")}getPatternParent(){let t=this;do if(!t.path.isPattern())return t.getBlockParent();while(t=t.parent.parent);throw new Error("We couldn't find a BlockStatement, For, Switch, Function, Loop or Program...")}getAllBindings(){let t=Object.create(null),r=this;do{for(let n of Object.keys(r.bindings))n in t||(t[n]=r.bindings[n]);r=r.parent}while(r);return t}bindingIdentifierEquals(t,r){return this.getBindingIdentifier(t)===r}getBinding(t){let r=this,n;do{let a=r.getOwnBinding(t);if(a){var s;if(!((s=n)!=null&&s.isPattern()&&a.kind!=="param"&&a.kind!=="local"))return a}else if(!a&&t==="arguments"&&r.path.isFunction()&&!r.path.isArrowFunctionExpression())break;n=r.path}while(r=r.parent)}getOwnBinding(t){return this.bindings[t]}getBindingIdentifier(t){var r;return(r=this.getBinding(t))==null?void 0:r.identifier}getOwnBindingIdentifier(t){let r=this.bindings[t];return r?.identifier}hasOwnBinding(t){return!!this.getOwnBinding(t)}hasBinding(t,r){if(!t)return!1;let n,s,a;typeof r=="object"?(n=r.noGlobals,s=r.noUids,a=r.upToScope):typeof r=="boolean"&&(n=r);let o=this;do{if(a===o)break;if(o.hasOwnBinding(t))return!0}while(o=o.parent);return!!(!s&&this.hasUid(t)||!n&&e.globals.includes(t)||!n&&e.contextVariables.includes(t))}parentHasBinding(t,r){var n;return(n=this.parent)==null?void 0:n.hasBinding(t,r)}moveBindingTo(t,r){let n=this.getBinding(t);n&&(n.scope.removeOwnBinding(t),n.scope=r,r.bindings[t]=n)}removeOwnBinding(t){delete this.bindings[t]}removeBinding(t){var r;(r=this.getBinding(t))==null||r.scope.removeOwnBinding(t);let n=this;do n.uids[t]&&(n.uids[t]=!1);while(n=n.parent)}hoistVariables(t=r=>this.push({id:r})){this.crawl();let r=new Set;for(let n of Object.keys(this.bindings)){let s=this.bindings[n];if(!s)continue;let{path:a}=s;if(!a.isVariableDeclarator())continue;let{parent:o,parentPath:c}=a;if(o.kind!=="var"||r.has(o))continue;r.add(a.parent);let l,u=[];for(let d of o.declarations){l??(l=d.id),d.init&&u.push(Pwe("=",d.id,d.init));let p=Object.keys(l4(d,!1,!0,!0));for(let f of p)t($c(f),d.init!=null)}if(c.parentPath.isForXStatement({left:o}))c.replaceWith(l);else if(u.length===0)c.remove();else{let d=u.length===1?u[0]:r0e(u);c.parentPath.isForStatement({init:o})?c.replaceWith(d):c.replaceWith(Kwe(d))}}}};C_.default=xs;xs.globals=[...wwe,...Ewe];xs.contextVariables=["arguments","undefined","Infinity","NaN"];xs.prototype._renameFromMap=function(t,r,n,s){t[r]&&(t[n]=s,t[r]=null)};xs.prototype.traverse=function(e,t,r){(0,a4.default)(e,t,this,r,this.path)};xs.prototype._generateUid=function(t,r){let n=t;return r>1&&(n+=r),`_${n}`};xs.prototype.toArray=function(t,r,n){if(Oc(t)){let o=this.getBinding(t.name);if(o!=null&&o.constant&&o.path.isGenericType("Array"))return t}if(u4(t))return t;if(Oc(t,{name:"arguments"}))return XB(ak(ak(ak($c("Array"),$c("prototype")),$c("slice")),$c("call")),[t]);let s,a=[t];return r===!0?s="toConsumableArray":typeof r=="number"?(a.push(Gwe(r)),s="slicedToArray"):s="toArray",n&&(a.unshift(this.path.hub.addHelper(s)),s="maybeArrayLike"),XB(this.path.hub.addHelper(s),a)};xs.prototype.getAllBindingsOfKind=function(...t){let r=Object.create(null);for(let n of t){let s=this;do{for(let a of Object.keys(s.bindings)){let o=s.bindings[a];o.kind===n&&(r[a]=o)}s=s.parent}while(s)}return r};Object.defineProperties(xs.prototype,{parentBlock:{configurable:!0,enumerable:!0,get(){return this.path.parent}},hub:{configurable:!0,enumerable:!0,get(){return this.path.hub}}})});var lk=G((ck,Uf)=>{(function(e,t){if(typeof ck=="object"&&typeof Uf<"u")t(Uf),Uf.exports=r(Uf);else if(typeof define=="function"&&define.amd)define(["module"],function(n){t.apply(this,arguments),n.exports=r(n)});else{let n={exports:{}};t(n),e=typeof globalThis<"u"?globalThis:e||self,e.sourcemapCodec=r(n)}function r(n){return"default"in n.exports?n.exports.default:n.exports}})(ck,function(e){"use strict";var t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,a=(D,A)=>{for(var M in A)t(D,M,{get:A[M],enumerable:!0})},o=(D,A,M,z)=>{if(A&&typeof A=="object"||typeof A=="function")for(let ee of n(A))!s.call(D,ee)&&ee!==M&&t(D,ee,{get:()=>A[ee],enumerable:!(z=r(A,ee))||z.enumerable});return D},c=D=>o(t({},"__esModule",{value:!0}),D),l={};a(l,{decode:()=>H,decodeGeneratedRanges:()=>V,decodeOriginalScopes:()=>k,encode:()=>K,encodeGeneratedRanges:()=>te,encodeOriginalScopes:()=>N}),e.exports=c(l);var u=44,d=59,p="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",f=new Uint8Array(64),h=new Uint8Array(128);for(let D=0;D<p.length;D++){let A=p.charCodeAt(D);f[D]=A,h[A]=D}function m(D,A){let M=0,z=0,ee=0;do{let Se=D.next();ee=h[Se],M|=(ee&31)<<z,z+=5}while(ee&32);let le=M&1;return M>>>=1,le&&(M=-2147483648|-M),A+M}function g(D,A,M){let z=A-M;z=z<0?-z<<1|1:z<<1;do{let ee=z&31;z>>>=5,z>0&&(ee|=32),D.write(f[ee])}while(z>0);return A}function y(D,A){return D.pos>=A?!1:D.peek()!==u}var _=1024*16,v=typeof TextDecoder<"u"?new TextDecoder:typeof Buffer<"u"?{decode(D){return Buffer.from(D.buffer,D.byteOffset,D.byteLength).toString()}}:{decode(D){let A="";for(let M=0;M<D.length;M++)A+=String.fromCharCode(D[M]);return A}},S=class{constructor(){this.pos=0,this.out="",this.buffer=new Uint8Array(_)}write(D){let{buffer:A}=this;A[this.pos++]=D,this.pos===_&&(this.out+=v.decode(A),this.pos=0)}flush(){let{buffer:D,out:A,pos:M}=this;return M>0?A+v.decode(D.subarray(0,M)):A}},w=class{constructor(D){this.pos=0,this.buffer=D}next(){return this.buffer.charCodeAt(this.pos++)}peek(){return this.buffer.charCodeAt(this.pos)}indexOf(D){let{buffer:A,pos:M}=this,z=A.indexOf(D,M);return z===-1?A.length:z}},E=[];function k(D){let{length:A}=D,M=new w(D),z=[],ee=[],le=0;for(;M.pos<A;M.pos++){le=m(M,le);let Se=m(M,0);if(!y(M,A)){let Xe=ee.pop();Xe[2]=le,Xe[3]=Se;continue}let we=m(M,0),Ae=m(M,0)&1?[le,Se,0,0,we,m(M,0)]:[le,Se,0,0,we],ke=E;if(y(M,A)){ke=[];do{let Xe=m(M,0);ke.push(Xe)}while(y(M,A))}Ae.vars=ke,z.push(Ae),ee.push(Ae)}return z}function N(D){let A=new S;for(let M=0;M<D.length;)M=O(D,M,A,[0]);return A.flush()}function O(D,A,M,z){let ee=D[A],{0:le,1:Se,2:we,3:he,4:xe,vars:Ae}=ee;A>0&&M.write(u),z[0]=g(M,le,z[0]),g(M,Se,0),g(M,xe,0);let ke=ee.length===6?1:0;g(M,ke,0),ee.length===6&&g(M,ee[5],0);for(let Xe of Ae)g(M,Xe,0);for(A++;A<D.length;){let Xe=D[A],{0:De,1:et}=Xe;if(De>we||De===we&&et>=he)break;A=O(D,A,M,z)}return M.write(u),z[0]=g(M,we,z[0]),g(M,he,0),A}function V(D){let{length:A}=D,M=new w(D),z=[],ee=[],le=0,Se=0,we=0,he=0,xe=0,Ae=0,ke=0,Xe=0;do{let De=M.indexOf(";"),et=0;for(;M.pos<De;M.pos++){if(et=m(M,et),!y(M,De)){let Oe=ee.pop();Oe[2]=le,Oe[3]=et;continue}let tt=m(M,0),jt=tt&1,wt=tt&2,zr=tt&4,fe=null,ye=E,Pe;if(jt){let Oe=m(M,Se);we=m(M,Se===Oe?we:0),Se=Oe,Pe=[le,et,0,0,Oe,we]}else Pe=[le,et,0,0];if(Pe.isScope=!!zr,wt){let Oe=he,Qe=xe;he=m(M,he);let _t=Oe===he;xe=m(M,_t?xe:0),Ae=m(M,_t&&Qe===xe?Ae:0),fe=[he,xe,Ae]}if(Pe.callsite=fe,y(M,De)){ye=[];do{ke=le,Xe=et;let Oe=m(M,0),Qe;if(Oe<-1){Qe=[[m(M,0)]];for(let _t=-1;_t>Oe;_t--){let St=ke;ke=m(M,ke),Xe=m(M,ke===St?Xe:0);let ir=m(M,0);Qe.push([ir,ke,Xe])}}else Qe=[[Oe]];ye.push(Qe)}while(y(M,De))}Pe.bindings=ye,z.push(Pe),ee.push(Pe)}le++,M.pos=De+1}while(M.pos<A);return z}function te(D){if(D.length===0)return"";let A=new S;for(let M=0;M<D.length;)M=W(D,M,A,[0,0,0,0,0,0,0]);return A.flush()}function W(D,A,M,z){let ee=D[A],{0:le,1:Se,2:we,3:he,isScope:xe,callsite:Ae,bindings:ke}=ee;z[0]<le?($(M,z[0],le),z[0]=le,z[1]=0):A>0&&M.write(u),z[1]=g(M,ee[1],z[1]);let Xe=(ee.length===6?1:0)|(Ae?2:0)|(xe?4:0);if(g(M,Xe,0),ee.length===6){let{4:De,5:et}=ee;De!==z[2]&&(z[3]=0),z[2]=g(M,De,z[2]),z[3]=g(M,et,z[3])}if(Ae){let{0:De,1:et,2:tt}=ee.callsite;De!==z[4]?(z[5]=0,z[6]=0):et!==z[5]&&(z[6]=0),z[4]=g(M,De,z[4]),z[5]=g(M,et,z[5]),z[6]=g(M,tt,z[6])}if(ke)for(let De of ke){De.length>1&&g(M,-De.length,0);let et=De[0][0];g(M,et,0);let tt=le,jt=Se;for(let wt=1;wt<De.length;wt++){let zr=De[wt];tt=g(M,zr[1],tt),jt=g(M,zr[2],jt),g(M,zr[0],0)}}for(A++;A<D.length;){let De=D[A],{0:et,1:tt}=De;if(et>we||et===we&&tt>=he)break;A=W(D,A,M,z)}return z[0]<we?($(M,z[0],we),z[0]=we,z[1]=0):M.write(u),z[1]=g(M,he,z[1]),A}function $(D,A,M){do D.write(d);while(++A<M)}function H(D){let{length:A}=D,M=new w(D),z=[],ee=0,le=0,Se=0,we=0,he=0;do{let xe=M.indexOf(";"),Ae=[],ke=!0,Xe=0;for(ee=0;M.pos<xe;){let De;ee=m(M,ee),ee<Xe&&(ke=!1),Xe=ee,y(M,xe)?(le=m(M,le),Se=m(M,Se),we=m(M,we),y(M,xe)?(he=m(M,he),De=[ee,le,Se,we,he]):De=[ee,le,Se,we]):De=[ee],Ae.push(De),M.pos++}ke||Y(Ae),z.push(Ae),M.pos=xe+1}while(M.pos<=A);return z}function Y(D){D.sort(ae)}function ae(D,A){return D[0]-A[0]}function K(D){let A=new S,M=0,z=0,ee=0,le=0;for(let Se=0;Se<D.length;Se++){let we=D[Se];if(Se>0&&A.write(d),we.length===0)continue;let he=0;for(let xe=0;xe<we.length;xe++){let Ae=we[xe];xe>0&&A.write(u),he=g(A,Ae[0],he),Ae.length!==1&&(M=g(A,Ae[1],M),z=g(A,Ae[2],z),ee=g(A,Ae[3],ee),Ae.length!==4&&(le=g(A,Ae[4],le)))}}return A.flush()}})});var f4=G((uk,dk)=>{(function(e,t){typeof uk=="object"&&typeof dk<"u"?dk.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.resolveURI=t())})(uk,function(){"use strict";let e=/^[\w+.-]+:\/\//,t=/^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/,r=/^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i;function n(y){return e.test(y)}function s(y){return y.startsWith("//")}function a(y){return y.startsWith("/")}function o(y){return y.startsWith("file:")}function c(y){return/^[.?#]/.test(y)}function l(y){let _=t.exec(y);return d(_[1],_[2]||"",_[3],_[4]||"",_[5]||"/",_[6]||"",_[7]||"")}function u(y){let _=r.exec(y),v=_[2];return d("file:","",_[1]||"","",a(v)?v:"/"+v,_[3]||"",_[4]||"")}function d(y,_,v,S,w,E,k){return{scheme:y,user:_,host:v,port:S,path:w,query:E,hash:k,type:7}}function p(y){if(s(y)){let v=l("http:"+y);return v.scheme="",v.type=6,v}if(a(y)){let v=l("http://foo.com"+y);return v.scheme="",v.host="",v.type=5,v}if(o(y))return u(y);if(n(y))return l(y);let _=l("http://foo.com/"+y);return _.scheme="",_.host="",_.type=y?y.startsWith("?")?3:y.startsWith("#")?2:4:1,_}function f(y){if(y.endsWith("/.."))return y;let _=y.lastIndexOf("/");return y.slice(0,_+1)}function h(y,_){m(_,_.type),y.path==="/"?y.path=_.path:y.path=f(_.path)+y.path}function m(y,_){let v=_<=4,S=y.path.split("/"),w=1,E=0,k=!1;for(let O=1;O<S.length;O++){let V=S[O];if(!V){k=!0;continue}if(k=!1,V!=="."){if(V===".."){E?(k=!0,E--,w--):v&&(S[w++]=V);continue}S[w++]=V,E++}}let N="";for(let O=1;O<w;O++)N+="/"+S[O];(!N||k&&!N.endsWith("/.."))&&(N+="/"),y.path=N}function g(y,_){if(!y&&!_)return"";let v=p(y),S=v.type;if(_&&S!==7){let E=p(_),k=E.type;switch(S){case 1:v.hash=E.hash;case 2:v.query=E.query;case 3:case 4:h(v,E);case 5:v.user=E.user,v.host=E.host,v.port=E.port;case 6:v.scheme=E.scheme}k>S&&(S=k)}m(v,S);let w=v.query+v.hash;switch(S){case 2:case 3:return w;case 4:{let E=v.path.slice(1);return E?c(_||y)&&!c(E)?"./"+E+w:E+w:w||"."}case 5:return v.path+w;default:return v.scheme+"//"+v.user+v.host+v.port+v.path+w}}return g})});var fk=G((pk,qf)=>{(function(e,t){if(typeof pk=="object"&&typeof qf<"u")t(qf,f4(),lk()),qf.exports=r(qf);else if(typeof define=="function"&&define.amd)define(["module","@jridgewell/resolve-uri","@jridgewell/sourcemap-codec"],function(n){t.apply(this,arguments),n.exports=r(n)});else{let n={exports:{}};t(n,e.resolveURI,e.sourcemapCodec),e=typeof globalThis<"u"?globalThis:e||self,e.traceMapping=r(n)}function r(n){return"default"in n.exports?n.exports.default:n.exports}})(pk,function(e,t,r){"use strict";var n=Object.create,s=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,c=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,u=(se,me)=>function(){return me||(0,se[o(se)[0]])((me={exports:{}}).exports,me),me.exports},d=(se,me)=>{for(var _e in me)s(se,_e,{get:me[_e],enumerable:!0})},p=(se,me,_e,oe)=>{if(me&&typeof me=="object"||typeof me=="function")for(let it of o(me))!l.call(se,it)&&it!==_e&&s(se,it,{get:()=>me[it],enumerable:!(oe=a(me,it))||oe.enumerable});return se},f=(se,me,_e)=>(_e=se!=null?n(c(se)):{},p(me||!se||!se.__esModule?s(_e,"default",{value:se,enumerable:!0}):_e,se)),h=se=>p(s({},"__esModule",{value:!0}),se),m=u({"umd:@jridgewell/sourcemap-codec"(se,me){me.exports=r}}),g=u({"umd:@jridgewell/resolve-uri"(se,me){me.exports=t}}),y={};d(y,{AnyMap:()=>he,FlattenMap:()=>he,GREATEST_LOWER_BOUND:()=>jt,LEAST_UPPER_BOUND:()=>tt,TraceMap:()=>wt,allGeneratedPositionsFor:()=>_t,decodedMap:()=>Ni,decodedMappings:()=>ye,eachMapping:()=>St,encodedMap:()=>qa,encodedMappings:()=>fe,generatedPositionFor:()=>Qe,isIgnored:()=>ks,originalPositionFor:()=>Oe,presortedDecodedMap:()=>on,sourceContentFor:()=>tn,traceSegment:()=>Pe}),e.exports=h(y);var _=f(m()),v=f(g());function S(se){if(!se)return"";let me=se.lastIndexOf("/");return se.slice(0,me+1)}function w(se,me){let _e=S(se),oe=me?me+"/":"";return it=>(0,v.default)(oe+(it||""),_e)}var E=0,k=1,N=2,O=3,V=4,te=1,W=2;function $(se,me){let _e=H(se,0);if(_e===se.length)return se;me||(se=se.slice());for(let oe=_e;oe<se.length;oe=H(se,oe+1))se[oe]=ae(se[oe],me);return se}function H(se,me){for(let _e=me;_e<se.length;_e++)if(!Y(se[_e]))return _e;return se.length}function Y(se){for(let me=1;me<se.length;me++)if(se[me][E]<se[me-1][E])return!1;return!0}function ae(se,me){return me||(se=se.slice()),se.sort(K)}function K(se,me){return se[E]-me[E]}function D(se,me){let _e=me.map(()=>[]);for(let oe=0;oe<se.length;oe++){let it=se[oe];for(let Ve=0;Ve<it.length;Ve++){let mt=it[Ve];if(mt.length===1)continue;let sr=mt[k],Et=mt[N],Dr=mt[O],gr=_e[sr];(gr[Et]||(gr[Et]=[])).push([Dr,oe,mt[E]])}}for(let oe=0;oe<_e.length;oe++){let it=_e[oe];for(let Ve=0;Ve<it.length;Ve++){let mt=it[Ve];mt&&mt.sort(K)}}return _e}var A=!1;function M(se,me,_e,oe){for(;_e<=oe;){let it=_e+(oe-_e>>1),Ve=se[it][E]-me;if(Ve===0)return A=!0,it;Ve<0?_e=it+1:oe=it-1}return A=!1,_e-1}function z(se,me,_e){for(let oe=_e+1;oe<se.length&&se[oe][E]===me;_e=oe++);return _e}function ee(se,me,_e){for(let oe=_e-1;oe>=0&&se[oe][E]===me;_e=oe--);return _e}function le(){return{lastKey:-1,lastNeedle:-1,lastIndex:-1}}function Se(se,me,_e,oe){let{lastKey:it,lastNeedle:Ve,lastIndex:mt}=_e,sr=0,Et=se.length-1;if(oe===it){if(me===Ve)return A=mt!==-1&&se[mt][E]===me,mt;me>=Ve?sr=mt===-1?0:mt:Et=mt}return _e.lastKey=oe,_e.lastNeedle=me,_e.lastIndex=M(se,me,sr,Et)}function we(se){return typeof se=="string"?JSON.parse(se):se}var he=function(se,me){let _e=we(se);if(!("sections"in _e))return new wt(_e,me);let oe=[],it=[],Ve=[],mt=[],sr=[];xe(_e,me,oe,it,Ve,mt,sr,0,0,1/0,1/0);let Et={version:3,file:_e.file,names:mt,sources:it,sourcesContent:Ve,mappings:oe,ignoreList:sr};return on(Et)};function xe(se,me,_e,oe,it,Ve,mt,sr,Et,Dr,gr){let{sections:qr}=se;for(let pr=0;pr<qr.length;pr++){let{map:cn,offset:_i}=qr[pr],bi=Dr,ni=gr;if(pr+1<qr.length){let Wr=qr[pr+1].offset;bi=Math.min(Dr,sr+Wr.line),bi===Dr?ni=Math.min(gr,Et+Wr.column):bi<Dr&&(ni=Et+Wr.column)}Ae(cn,me,_e,oe,it,Ve,mt,sr+_i.line,Et+_i.column,bi,ni)}}function Ae(se,me,_e,oe,it,Ve,mt,sr,Et,Dr,gr){let qr=we(se);if("sections"in qr)return xe(...arguments);let pr=new wt(qr,me),cn=oe.length,_i=Ve.length,bi=ye(pr),{resolvedSources:ni,sourcesContent:Wr,ignoreList:ml}=pr;if(ke(oe,ni),ke(Ve,pr.names),Wr)ke(it,Wr);else for(let ii=0;ii<ni.length;ii++)it.push(null);if(ml)for(let ii=0;ii<ml.length;ii++)mt.push(ml[ii]+cn);for(let ii=0;ii<bi.length;ii++){let Go=sr+ii;if(Go>Dr)return;let mm=Xe(_e,Go),xd=ii===0?Et:0,Sd=bi[ii];for(let Va=0;Va<Sd.length;Va++){let ia=Sd[Va],Bn=xd+ia[E];if(Go===Dr&&Bn>=gr)return;if(ia.length===1){mm.push([Bn]);continue}let Zo=cn+ia[k],gl=ia[N],Td=ia[O];mm.push(ia.length===4?[Bn,Zo,gl,Td]:[Bn,Zo,gl,Td,_i+ia[V]])}}}function ke(se,me){for(let _e=0;_e<me.length;_e++)se.push(me[_e])}function Xe(se,me){for(let _e=se.length;_e<=me;_e++)se[_e]=[];return se[me]}var De="`line` must be greater than 0 (lines start at line 1)",et="`column` must be greater than or equal to 0 (columns start at column 0)",tt=-1,jt=1,wt=class{constructor(se,me){let _e=typeof se=="string";if(!_e&&se._decodedMemo)return se;let oe=we(se),{version:it,file:Ve,names:mt,sourceRoot:sr,sources:Et,sourcesContent:Dr}=oe;this.version=it,this.file=Ve,this.names=mt||[],this.sourceRoot=sr,this.sources=Et,this.sourcesContent=Dr,this.ignoreList=oe.ignoreList||oe.x_google_ignoreList||void 0;let gr=w(me,sr);this.resolvedSources=Et.map(gr);let{mappings:qr}=oe;if(typeof qr=="string")this._encoded=qr,this._decoded=void 0;else if(Array.isArray(qr))this._encoded=void 0,this._decoded=$(qr,_e);else throw oe.sections?new Error("TraceMap passed sectioned source map, please use FlattenMap export instead"):new Error(`invalid source map: ${JSON.stringify(oe)}`);this._decodedMemo=le(),this._bySources=void 0,this._bySourceMemos=void 0}};function zr(se){return se}function fe(se){var me,_e;return(_e=(me=se)._encoded)!=null?_e:me._encoded=(0,_.encode)(se._decoded)}function ye(se){var me;return(me=se)._decoded||(me._decoded=(0,_.decode)(se._encoded))}function Pe(se,me,_e){let oe=ye(se);if(me>=oe.length)return null;let it=oe[me],Ve=Cs(it,se._decodedMemo,me,_e,jt);return Ve===-1?null:it[Ve]}function Oe(se,me){let{line:_e,column:oe,bias:it}=me;if(_e--,_e<0)throw new Error(De);if(oe<0)throw new Error(et);let Ve=ye(se);if(_e>=Ve.length)return Oi(null,null,null,null);let mt=Ve[_e],sr=Cs(mt,se._decodedMemo,_e,oe,it||jt);if(sr===-1)return Oi(null,null,null,null);let Et=mt[sr];if(Et.length===1)return Oi(null,null,null,null);let{names:Dr,resolvedSources:gr}=se;return Oi(gr[Et[k]],Et[N]+1,Et[O],Et.length===5?Dr[Et[V]]:null)}function Qe(se,me){let{source:_e,line:oe,column:it,bias:Ve}=me;return hm(se,_e,oe,it,Ve||jt,!1)}function _t(se,me){let{source:_e,line:oe,column:it,bias:Ve}=me;return hm(se,_e,oe,it,Ve||tt,!0)}function St(se,me){let _e=ye(se),{names:oe,resolvedSources:it}=se;for(let Ve=0;Ve<_e.length;Ve++){let mt=_e[Ve];for(let sr=0;sr<mt.length;sr++){let Et=mt[sr],Dr=Ve+1,gr=Et[0],qr=null,pr=null,cn=null,_i=null;Et.length!==1&&(qr=it[Et[1]],pr=Et[2]+1,cn=Et[3]),Et.length===5&&(_i=oe[Et[4]]),me({generatedLine:Dr,generatedColumn:gr,source:qr,originalLine:pr,originalColumn:cn,name:_i})}}}function ir(se,me){let{sources:_e,resolvedSources:oe}=se,it=_e.indexOf(me);return it===-1&&(it=oe.indexOf(me)),it}function tn(se,me){let{sourcesContent:_e}=se;if(_e==null)return null;let oe=ir(se,me);return oe===-1?null:_e[oe]}function ks(se,me){let{ignoreList:_e}=se;if(_e==null)return!1;let oe=ir(se,me);return oe===-1?!1:_e.includes(oe)}function on(se,me){let _e=new wt(ut(se,[]),me);return _e._decoded=se.mappings,_e}function Ni(se){return ut(se,ye(se))}function qa(se){return ut(se,fe(se))}function ut(se,me){return{version:se.version,file:se.file,names:se.names,sourceRoot:se.sourceRoot,sources:se.sources,sourcesContent:se.sourcesContent,mappings:me,ignoreList:se.ignoreList||se.x_google_ignoreList}}function Oi(se,me,_e,oe){return{source:se,line:me,column:_e,name:oe}}function jn(se,me){return{line:se,column:me}}function Cs(se,me,_e,oe,it){let Ve=Se(se,oe,me,_e);return A?Ve=(it===tt?z:ee)(se,oe,Ve):it===tt&&Ve++,Ve===-1||Ve===se.length?-1:Ve}function Wa(se,me,_e,oe,it){let Ve=Cs(se,me,_e,oe,jt);if(!A&&it===tt&&Ve++,Ve===-1||Ve===se.length)return[];let mt=A?oe:se[Ve][E];A||(Ve=ee(se,mt,Ve));let sr=z(se,mt,Ve),Et=[];for(;Ve<=sr;Ve++){let Dr=se[Ve];Et.push(jn(Dr[te]+1,Dr[W]))}return Et}function hm(se,me,_e,oe,it,Ve){var mt,sr;if(_e--,_e<0)throw new Error(De);if(oe<0)throw new Error(et);let{sources:Et,resolvedSources:Dr}=se,gr=Et.indexOf(me);if(gr===-1&&(gr=Dr.indexOf(me)),gr===-1)return Ve?[]:jn(null,null);let qr=(mt=se)._bySourceMemos||(mt._bySourceMemos=Et.map(le)),cn=((sr=se)._bySources||(sr._bySources=D(ye(se),qr)))[gr][_e];if(cn==null)return Ve?[]:jn(null,null);let _i=qr[gr];if(Ve)return Wa(cn,_i,_e,oe,it);let bi=Cs(cn,_i,_e,oe,it);if(bi===-1)return jn(null,null);let ni=cn[bi];return jn(ni[te]+1,ni[W])}})});var h4=G((hk,Wf)=>{(function(e,t){if(typeof hk=="object"&&typeof Wf<"u")t(Wf,lk(),fk()),Wf.exports=r(Wf);else if(typeof define=="function"&&define.amd)define(["module","@jridgewell/sourcemap-codec","@jridgewell/trace-mapping"],function(n){t.apply(this,arguments),n.exports=r(n)});else{let n={exports:{}};t(n,e.sourcemapCodec,e.traceMapping),e=typeof globalThis<"u"?globalThis:e||self,e.genMapping=r(n)}function r(n){return"default"in n.exports?n.exports.default:n.exports}})(hk,function(e,t,r){"use strict";var n=Object.create,s=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,c=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,u=(fe,ye)=>function(){return ye||(0,fe[o(fe)[0]])((ye={exports:{}}).exports,ye),ye.exports},d=(fe,ye)=>{for(var Pe in ye)s(fe,Pe,{get:ye[Pe],enumerable:!0})},p=(fe,ye,Pe,Oe)=>{if(ye&&typeof ye=="object"||typeof ye=="function")for(let Qe of o(ye))!l.call(fe,Qe)&&Qe!==Pe&&s(fe,Qe,{get:()=>ye[Qe],enumerable:!(Oe=a(ye,Qe))||Oe.enumerable});return fe},f=(fe,ye,Pe)=>(Pe=fe!=null?n(c(fe)):{},p(ye||!fe||!fe.__esModule?s(Pe,"default",{value:fe,enumerable:!0}):Pe,fe)),h=fe=>p(s({},"__esModule",{value:!0}),fe),m=u({"umd:@jridgewell/sourcemap-codec"(fe,ye){ye.exports=t}}),g=u({"umd:@jridgewell/trace-mapping"(fe,ye){ye.exports=r}}),y={};d(y,{GenMapping:()=>Y,addMapping:()=>D,addSegment:()=>K,allMappings:()=>he,fromMap:()=>we,maybeAddMapping:()=>M,maybeAddSegment:()=>A,setIgnore:()=>ee,setSourceContent:()=>z,toDecodedMap:()=>le,toEncodedMap:()=>Se}),e.exports=h(y);var _=class{constructor(){this._indexes={__proto__:null},this.array=[]}};function v(fe){return fe}function S(fe,ye){return fe._indexes[ye]}function w(fe,ye){let Pe=S(fe,ye);if(Pe!==void 0)return Pe;let{array:Oe,_indexes:Qe}=fe,_t=Oe.push(ye);return Qe[ye]=_t-1}function E(fe,ye){let Pe=S(fe,ye);if(Pe===void 0)return;let{array:Oe,_indexes:Qe}=fe;for(let _t=Pe+1;_t<Oe.length;_t++){let St=Oe[_t];Oe[_t-1]=St,Qe[St]--}Qe[ye]=void 0,Oe.pop()}var k=f(m()),N=f(g()),O=0,V=1,te=2,W=3,$=4,H=-1,Y=class{constructor({file:fe,sourceRoot:ye}={}){this._names=new _,this._sources=new _,this._sourcesContent=[],this._mappings=[],this.file=fe,this.sourceRoot=ye,this._ignoreList=new _}};function ae(fe){return fe}function K(fe,ye,Pe,Oe,Qe,_t,St,ir){return xe(!1,fe,ye,Pe,Oe,Qe,_t,St,ir)}function D(fe,ye){return zr(!1,fe,ye)}var A=(fe,ye,Pe,Oe,Qe,_t,St,ir)=>xe(!0,fe,ye,Pe,Oe,Qe,_t,St,ir),M=(fe,ye)=>zr(!0,fe,ye);function z(fe,ye,Pe){let{_sources:Oe,_sourcesContent:Qe}=fe,_t=w(Oe,ye);Qe[_t]=Pe}function ee(fe,ye,Pe=!0){let{_sources:Oe,_sourcesContent:Qe,_ignoreList:_t}=fe,St=w(Oe,ye);St===Qe.length&&(Qe[St]=null),Pe?w(_t,St):E(_t,St)}function le(fe){let{_mappings:ye,_sources:Pe,_sourcesContent:Oe,_names:Qe,_ignoreList:_t}=fe;return et(ye),{version:3,file:fe.file||void 0,names:Qe.array,sourceRoot:fe.sourceRoot||void 0,sources:Pe.array,sourcesContent:Oe,mappings:ye,ignoreList:_t.array}}function Se(fe){let ye=le(fe);return Object.assign({},ye,{mappings:(0,k.encode)(ye.mappings)})}function we(fe){let ye=new N.TraceMap(fe),Pe=new Y({file:ye.file,sourceRoot:ye.sourceRoot});return tt(Pe._names,ye.names),tt(Pe._sources,ye.sources),Pe._sourcesContent=ye.sourcesContent||ye.sources.map(()=>null),Pe._mappings=(0,N.decodedMappings)(ye),ye.ignoreList&&tt(Pe._ignoreList,ye.ignoreList),Pe}function he(fe){let ye=[],{_mappings:Pe,_sources:Oe,_names:Qe}=fe;for(let _t=0;_t<Pe.length;_t++){let St=Pe[_t];for(let ir=0;ir<St.length;ir++){let tn=St[ir],ks={line:_t+1,column:tn[O]},on,Ni,qa;tn.length!==1&&(on=Oe.array[tn[V]],Ni={line:tn[te]+1,column:tn[W]},tn.length===5&&(qa=Qe.array[tn[$]])),ye.push({generated:ks,source:on,original:Ni,name:qa})}}return ye}function xe(fe,ye,Pe,Oe,Qe,_t,St,ir,tn){let{_mappings:ks,_sources:on,_sourcesContent:Ni,_names:qa}=ye,ut=ke(ks,Pe),Oi=Xe(ut,Oe);if(!Qe)return fe&&jt(ut,Oi)?void 0:De(ut,Oi,[Oe]);let jn=w(on,Qe),Cs=ir?w(qa,ir):H;if(jn===Ni.length&&(Ni[jn]=tn??null),!(fe&&wt(ut,Oi,jn,_t,St,Cs)))return De(ut,Oi,ir?[Oe,jn,_t,St,Cs]:[Oe,jn,_t,St])}function Ae(fe){}function ke(fe,ye){for(let Pe=fe.length;Pe<=ye;Pe++)fe[Pe]=[];return fe[ye]}function Xe(fe,ye){let Pe=fe.length;for(let Oe=Pe-1;Oe>=0;Pe=Oe--){let Qe=fe[Oe];if(ye>=Qe[O])break}return Pe}function De(fe,ye,Pe){for(let Oe=fe.length;Oe>ye;Oe--)fe[Oe]=fe[Oe-1];fe[ye]=Pe}function et(fe){let{length:ye}=fe,Pe=ye;for(let Oe=Pe-1;Oe>=0&&!(fe[Oe].length>0);Pe=Oe,Oe--);Pe<ye&&(fe.length=Pe)}function tt(fe,ye){for(let Pe=0;Pe<ye.length;Pe++)w(fe,ye[Pe])}function jt(fe,ye){return ye===0?!0:fe[ye-1].length===1}function wt(fe,ye,Pe,Oe,Qe,_t){if(ye===0)return!1;let St=fe[ye-1];return St.length===1?!1:Pe===St[V]&&Oe===St[te]&&Qe===St[W]&&_t===(St.length===5?St[$]:H)}function zr(fe,ye,Pe){let{generated:Oe,source:Qe,original:_t,name:St,content:ir}=Pe;return Qe?xe(fe,ye,Oe.line-1,Oe.column,Qe,_t.line-1,_t.column,St,ir):xe(fe,ye,Oe.line-1,Oe.column,null,null,null,null,null)}})});var m4=G(N_=>{"use strict";Object.defineProperty(N_,"__esModule",{value:!0});N_.default=void 0;var To=h4(),mk=fk(),gk=class{constructor(t,r){var n;this._map=void 0,this._rawMappings=void 0,this._sourceFileName=void 0,this._lastGenLine=0,this._lastSourceLine=0,this._lastSourceColumn=0,this._inputMap=null;let s=this._map=new To.GenMapping({sourceRoot:t.sourceRoot});if(this._sourceFileName=(n=t.sourceFileName)==null?void 0:n.replace(/\\/g,"/"),this._rawMappings=void 0,t.inputSourceMap){this._inputMap=new mk.TraceMap(t.inputSourceMap);let o=this._inputMap.resolvedSources;if(o.length)for(let c=0;c<o.length;c++){var a;(0,To.setSourceContent)(s,o[c],(a=this._inputMap.sourcesContent)==null?void 0:a[c])}}if(typeof r=="string"&&!t.inputSourceMap)(0,To.setSourceContent)(s,this._sourceFileName,r);else if(typeof r=="object")for(let o of Object.keys(r))(0,To.setSourceContent)(s,o.replace(/\\/g,"/"),r[o])}get(){return(0,To.toEncodedMap)(this._map)}getDecoded(){return(0,To.toDecodedMap)(this._map)}getRawMappings(){return this._rawMappings||(this._rawMappings=(0,To.allMappings)(this._map))}mark(t,r,n,s,a,o){var c;this._rawMappings=void 0;let l;if(r!=null)if(this._inputMap){if(l=(0,mk.originalPositionFor)(this._inputMap,{line:r,column:n}),!l.name&&a){let u=(0,mk.originalPositionFor)(this._inputMap,a);u.name&&(s=u.name)}}else l={name:null,source:o?.replace(/\\/g,"/")||this._sourceFileName,line:r,column:n};(0,To.maybeAddMapping)(this._map,{name:s,generated:t,source:(c=l)==null?void 0:c.source,original:l})}};N_.default=gk});var y4=G(O_=>{"use strict";Object.defineProperty(O_,"__esModule",{value:!0});O_.default=void 0;var g4=[];for(let e=0;e<32;e++)g4.push(" ".repeat(e*2));var yk=class{constructor(t,r){this._map=null,this._buf="",this._str="",this._appendCount=0,this._last=0,this._canMarkIdName=!0,this._indentChar="",this._queuedChar=0,this._position={line:1,column:0},this._sourcePosition={identifierName:void 0,identifierNamePos:void 0,line:void 0,column:void 0,filename:void 0},this._map=t,this._indentChar=r}get(){let{_map:t,_last:r}=this;this._queuedChar!==32&&this._flush();let n=r===10?(this._buf+this._str).trimRight():this._buf+this._str;if(t===null)return{code:n,decodedMap:void 0,map:null,rawMappings:void 0};let s={code:n,decodedMap:t.getDecoded(),get __mergedMap(){return this.map},get map(){let a=t.get();return s.map=a,a},set map(a){Object.defineProperty(s,"map",{value:a,writable:!0})},get rawMappings(){let a=t.getRawMappings();return s.rawMappings=a,a},set rawMappings(a){Object.defineProperty(s,"rawMappings",{value:a,writable:!0})}};return s}append(t,r){this._flush(),this._append(t,r)}appendChar(t){this._flush(),this._appendChar(t,1,!0)}queue(t){this._flush(),this._queuedChar=t}_flush(){let t=this._queuedChar;t!==0&&(this._appendChar(t,1,!0),this._queuedChar=0)}_appendChar(t,r,n){if(this._last=t,t===-1){let o=r>=64?this._indentChar.repeat(r):g4[r/2];this._str+=o}else this._str+=r>1?String.fromCharCode(t).repeat(r):String.fromCharCode(t);let s=t===32,a=this._position;if(t!==10){if(this._map){let o=this._sourcePosition;n&&o?(this._map.mark(a,o.line,o.column,s?void 0:o.identifierName,s?void 0:o.identifierNamePos,o.filename),!s&&this._canMarkIdName&&(o.identifierName=void 0,o.identifierNamePos=void 0)):this._map.mark(a)}a.column+=r}else a.line++,a.column=0}_append(t,r){let n=t.length,s=this._position,a=this._sourcePosition;this._last=-1,++this._appendCount>4096?(+this._str,this._buf+=this._str,this._str=t,this._appendCount=0):this._str+=t;let o=this._map!==null;if(!r&&!o){s.column+=n;return}let{column:c,identifierName:l,identifierNamePos:u,filename:d}=a,p=a.line;(l!=null||u!=null)&&this._canMarkIdName&&(a.identifierName=void 0,a.identifierNamePos=void 0);let f=t.indexOf(`
|
|
30
|
+
Expected ${r.length+1} quasis but got ${e.quasis.length}`)})}}});at("TSLiteralType",{aliases:["TSType","TSBaseType"],visitor:["literal"],fields:{literal:{validate:function(){let e=(0,de.assertNodeType)("NumericLiteral","BigIntLiteral"),t=(0,de.assertOneOf)("-"),r=(0,de.assertNodeType)("NumericLiteral","StringLiteral","BooleanLiteral","BigIntLiteral","TemplateLiteral"),n=function(a,o,c){(0,$le.default)("UnaryExpression",c)?(t(c,"operator",c.operator),e(c,"argument",c.argument)):r(a,o,c)};return n.oneOfNodeTypes=["NumericLiteral","StringLiteral","BooleanLiteral","BigIntLiteral","TemplateLiteral","UnaryExpression"],n}()}}});at("TSExpressionWithTypeArguments",{aliases:["TSType"],visitor:["expression","typeParameters"],fields:{expression:(0,de.validateType)("TSEntityName"),typeParameters:(0,de.validateOptionalType)("TSTypeParameterInstantiation")}});at("TSInterfaceDeclaration",{aliases:["Statement","Declaration"],visitor:["id","typeParameters","extends","body"],fields:{declare:(0,de.validateOptional)(pi),id:(0,de.validateType)("Identifier"),typeParameters:(0,de.validateOptionalType)("TSTypeParameterDeclaration"),extends:(0,de.validateOptional)((0,de.arrayOfType)("TSExpressionWithTypeArguments")),body:(0,de.validateType)("TSInterfaceBody")}});at("TSInterfaceBody",{visitor:["body"],fields:{body:(0,de.validateArrayOfType)("TSTypeElement")}});at("TSTypeAliasDeclaration",{aliases:["Statement","Declaration"],visitor:["id","typeParameters","typeAnnotation"],fields:{declare:(0,de.validateOptional)(pi),id:(0,de.validateType)("Identifier"),typeParameters:(0,de.validateOptionalType)("TSTypeParameterDeclaration"),typeAnnotation:(0,de.validateType)("TSType")}});at("TSInstantiationExpression",{aliases:["Expression"],visitor:["expression","typeParameters"],fields:{expression:(0,de.validateType)("Expression"),typeParameters:(0,de.validateOptionalType)("TSTypeParameterInstantiation")}});var hj={aliases:["Expression","LVal","PatternLike"],visitor:["expression","typeAnnotation"],fields:{expression:(0,de.validateType)("Expression"),typeAnnotation:(0,de.validateType)("TSType")}};at("TSAsExpression",hj);at("TSSatisfiesExpression",hj);at("TSTypeAssertion",{aliases:["Expression","LVal","PatternLike"],visitor:["typeAnnotation","expression"],fields:{typeAnnotation:(0,de.validateType)("TSType"),expression:(0,de.validateType)("Expression")}});at("TSEnumBody",{visitor:["members"],fields:{members:(0,de.validateArrayOfType)("TSEnumMember")}});at("TSEnumDeclaration",{aliases:["Statement","Declaration"],visitor:["id","members"],fields:{declare:(0,de.validateOptional)(pi),const:(0,de.validateOptional)(pi),id:(0,de.validateType)("Identifier"),members:(0,de.validateArrayOfType)("TSEnumMember"),initializer:(0,de.validateOptionalType)("Expression"),body:(0,de.validateOptionalType)("TSEnumBody")}});at("TSEnumMember",{visitor:["id","initializer"],fields:{id:(0,de.validateType)("Identifier","StringLiteral"),initializer:(0,de.validateOptionalType)("Expression")}});at("TSModuleDeclaration",{aliases:["Statement","Declaration"],visitor:["id","body"],fields:Object.assign({kind:{validate:(0,de.assertOneOf)("global","module","namespace")},declare:(0,de.validateOptional)(pi)},{global:(0,de.validateOptional)(pi)},{id:(0,de.validateType)("Identifier","StringLiteral"),body:(0,de.validateType)("TSModuleBlock","TSModuleDeclaration")})});at("TSModuleBlock",{aliases:["Scopable","Block","BlockParent","FunctionParent"],visitor:["body"],fields:{body:(0,de.validateArrayOfType)("Statement")}});at("TSImportType",{aliases:["TSType"],builder:["argument","qualifier","typeParameters"],visitor:["argument","options","qualifier","typeParameters"],fields:Object.assign({},{argument:(0,de.validateType)("StringLiteral")},{qualifier:(0,de.validateOptionalType)("TSEntityName")},{typeParameters:(0,de.validateOptionalType)("TSTypeParameterInstantiation")},{options:{validate:(0,de.assertNodeType)("ObjectExpression"),optional:!0}})});at("TSImportEqualsDeclaration",{aliases:["Statement","Declaration"],visitor:["id","moduleReference"],fields:Object.assign({},{isExport:(0,de.validate)(pi)},{id:(0,de.validateType)("Identifier"),moduleReference:(0,de.validateType)("TSEntityName","TSExternalModuleReference"),importKind:{validate:(0,de.assertOneOf)("type","value"),optional:!0}})});at("TSExternalModuleReference",{visitor:["expression"],fields:{expression:(0,de.validateType)("StringLiteral")}});at("TSNonNullExpression",{aliases:["Expression","LVal","PatternLike"],visitor:["expression"],fields:{expression:(0,de.validateType)("Expression")}});at("TSExportAssignment",{aliases:["Statement"],visitor:["expression"],fields:{expression:(0,de.validateType)("Expression")}});at("TSNamespaceExportDeclaration",{aliases:["Statement"],visitor:["id"],fields:{id:(0,de.validateType)("Identifier")}});at("TSTypeAnnotation",{visitor:["typeAnnotation"],fields:{typeAnnotation:{validate:(0,de.assertNodeType)("TSType")}}});at("TSTypeParameterInstantiation",{visitor:["params"],fields:{params:(0,de.validateArrayOfType)("TSType")}});at("TSTypeParameterDeclaration",{visitor:["params"],fields:{params:(0,de.validateArrayOfType)("TSTypeParameter")}});at("TSTypeParameter",{builder:["constraint","default","name"],visitor:["constraint","default"],fields:{name:{validate:(0,de.assertValueType)("string")},in:{validate:(0,de.assertValueType)("boolean"),optional:!0},out:{validate:(0,de.assertValueType)("boolean"),optional:!0},const:{validate:(0,de.assertValueType)("boolean"),optional:!0},constraint:{validate:(0,de.assertNodeType)("TSType"),optional:!0},default:{validate:(0,de.assertNodeType)("TSType"),optional:!0}}})});var gj=G(u_=>{"use strict";Object.defineProperty(u_,"__esModule",{value:!0});u_.DEPRECATED_ALIASES=void 0;var wXe=u_.DEPRECATED_ALIASES={ModuleDeclaration:"ImportOrExportDeclaration"}});var Wi=G(Mn=>{"use strict";Object.defineProperty(Mn,"__esModule",{value:!0});Object.defineProperty(Mn,"ALIAS_KEYS",{enumerable:!0,get:function(){return Qn.ALIAS_KEYS}});Object.defineProperty(Mn,"BUILDER_KEYS",{enumerable:!0,get:function(){return Qn.BUILDER_KEYS}});Object.defineProperty(Mn,"DEPRECATED_ALIASES",{enumerable:!0,get:function(){return TI.DEPRECATED_ALIASES}});Object.defineProperty(Mn,"DEPRECATED_KEYS",{enumerable:!0,get:function(){return Qn.DEPRECATED_KEYS}});Object.defineProperty(Mn,"FLIPPED_ALIAS_KEYS",{enumerable:!0,get:function(){return Qn.FLIPPED_ALIAS_KEYS}});Object.defineProperty(Mn,"NODE_FIELDS",{enumerable:!0,get:function(){return Qn.NODE_FIELDS}});Object.defineProperty(Mn,"NODE_PARENT_VALIDATIONS",{enumerable:!0,get:function(){return Qn.NODE_PARENT_VALIDATIONS}});Object.defineProperty(Mn,"NODE_UNION_SHAPES__PRIVATE",{enumerable:!0,get:function(){return Qn.NODE_UNION_SHAPES__PRIVATE}});Object.defineProperty(Mn,"PLACEHOLDERS",{enumerable:!0,get:function(){return wI.PLACEHOLDERS}});Object.defineProperty(Mn,"PLACEHOLDERS_ALIAS",{enumerable:!0,get:function(){return wI.PLACEHOLDERS_ALIAS}});Object.defineProperty(Mn,"PLACEHOLDERS_FLIPPED_ALIAS",{enumerable:!0,get:function(){return wI.PLACEHOLDERS_FLIPPED_ALIAS}});Mn.TYPES=void 0;Object.defineProperty(Mn,"VISITOR_KEYS",{enumerable:!0,get:function(){return Qn.VISITOR_KEYS}});Of();sj();aj();oj();cj();mj();var Qn=Gs(),wI=vI(),TI=gj();Object.keys(TI.DEPRECATED_ALIASES).forEach(e=>{Qn.FLIPPED_ALIAS_KEYS[e]=Qn.FLIPPED_ALIAS_KEYS[TI.DEPRECATED_ALIASES[e]]});for(let{types:e,set:t}of Qn.allExpandedTypes)for(let r of e){let n=Qn.FLIPPED_ALIAS_KEYS[r];n?n.forEach(t.add,t):t.add(r)}var PXe=Mn.TYPES=[].concat(Object.keys(Qn.VISITOR_KEYS),Object.keys(Qn.FLIPPED_ALIAS_KEYS),Object.keys(Qn.DEPRECATED_KEYS))});var s_=G(Au=>{"use strict";Object.defineProperty(Au,"__esModule",{value:!0});Au.default=Dle;Au.validateChild=_j;Au.validateField=yj;Au.validateInternal=Mle;var $f=Wi();function Dle(e,t,r){if(!e)return;let n=$f.NODE_FIELDS[e.type];if(!n)return;let s=n[t];yj(e,t,r,s),_j(e,t,r)}function Mle(e,t,r,n,s){if(e!=null&&e.validate&&!(e.optional&&n==null)&&(e.validate(t,r,n),s)){var a;let o=n.type;if(o==null)return;(a=$f.NODE_PARENT_VALIDATIONS[o])==null||a.call($f.NODE_PARENT_VALIDATIONS,t,r,n)}}function yj(e,t,r,n){n!=null&&n.validate&&(n.optional&&r==null||n.validate(e,t,r))}function _j(e,t,r){var n;let s=r?.type;s!=null&&((n=$f.NODE_PARENT_VALIDATIONS[s])==null||n.call($f.NODE_PARENT_VALIDATIONS,e,t,r))}});var EI=G(R=>{"use strict";Object.defineProperty(R,"__esModule",{value:!0});R.anyTypeAnnotation=gde;R.argumentPlaceholder=Vpe;R.arrayExpression=Ble;R.arrayPattern=Due;R.arrayTypeAnnotation=yde;R.arrowFunctionExpression=Mue;R.assignmentExpression=zle;R.assignmentPattern=Rue;R.awaitExpression=ide;R.bigIntLiteral=jle;R.binaryExpression=Ule;R.bindExpression=Kpe;R.blockStatement=Kle;R.booleanLiteral=pue;R.booleanLiteralTypeAnnotation=bde;R.booleanTypeAnnotation=_de;R.breakStatement=Gle;R.callExpression=Zle;R.catchClause=Hle;R.classAccessorProperty=ude;R.classBody=Lue;R.classDeclaration=jue;R.classExpression=Fue;R.classImplements=xde;R.classMethod=Yue;R.classPrivateMethod=pde;R.classPrivateProperty=dde;R.classProperty=lde;R.conditionalExpression=Jle;R.continueStatement=Yle;R.debuggerStatement=Xle;R.decimalLiteral=Xpe;R.declareClass=Sde;R.declareExportAllDeclaration=Nde;R.declareExportDeclaration=Cde;R.declareFunction=Tde;R.declareInterface=wde;R.declareModule=Ede;R.declareModuleExports=Pde;R.declareOpaqueType=Ade;R.declareTypeAlias=Ide;R.declareVariable=kde;R.declaredPredicate=Ode;R.decorator=Gpe;R.directive=Wle;R.directiveLiteral=Vle;R.doExpression=Zpe;R.doWhileStatement=Qle;R.emptyStatement=eue;R.emptyTypeAnnotation=qde;R.enumBooleanBody=ype;R.enumBooleanMember=xpe;R.enumDeclaration=gpe;R.enumDefaultedMember=wpe;R.enumNumberBody=_pe;R.enumNumberMember=Spe;R.enumStringBody=bpe;R.enumStringMember=Tpe;R.enumSymbolBody=vpe;R.existsTypeAnnotation=$de;R.exportAllDeclaration=Bue;R.exportDefaultDeclaration=zue;R.exportDefaultSpecifier=Hpe;R.exportNamedDeclaration=Uue;R.exportNamespaceSpecifier=ade;R.exportSpecifier=que;R.expressionStatement=tue;R.file=rue;R.forInStatement=nue;R.forOfStatement=Wue;R.forStatement=iue;R.functionDeclaration=sue;R.functionExpression=aue;R.functionTypeAnnotation=Rde;R.functionTypeParam=Dde;R.genericTypeAnnotation=Mde;R.identifier=oue;R.ifStatement=cue;R.import=sde;R.importAttribute=mde;R.importDeclaration=Vue;R.importDefaultSpecifier=Kue;R.importExpression=Hue;R.importNamespaceSpecifier=Gue;R.importSpecifier=Zue;R.indexedAccessType=Epe;R.inferredPredicate=Lde;R.interfaceDeclaration=jde;R.interfaceExtends=Fde;R.interfaceTypeAnnotation=Bde;R.interpreterDirective=qle;R.intersectionTypeAnnotation=zde;R.jSXAttribute=R.jsxAttribute=Ipe;R.jSXClosingElement=R.jsxClosingElement=Ape;R.jSXClosingFragment=R.jsxClosingFragment=zpe;R.jSXElement=R.jsxElement=kpe;R.jSXEmptyExpression=R.jsxEmptyExpression=Cpe;R.jSXExpressionContainer=R.jsxExpressionContainer=Npe;R.jSXFragment=R.jsxFragment=jpe;R.jSXIdentifier=R.jsxIdentifier=$pe;R.jSXMemberExpression=R.jsxMemberExpression=Rpe;R.jSXNamespacedName=R.jsxNamespacedName=Dpe;R.jSXOpeningElement=R.jsxOpeningElement=Mpe;R.jSXOpeningFragment=R.jsxOpeningFragment=Bpe;R.jSXSpreadAttribute=R.jsxSpreadAttribute=Lpe;R.jSXSpreadChild=R.jsxSpreadChild=Ope;R.jSXText=R.jsxText=Fpe;R.labeledStatement=lue;R.logicalExpression=fue;R.memberExpression=hue;R.metaProperty=Jue;R.mixedTypeAnnotation=Ude;R.moduleExpression=Qpe;R.newExpression=mue;R.noop=Upe;R.nullLiteral=due;R.nullLiteralTypeAnnotation=vde;R.nullableTypeAnnotation=Wde;R.numberLiteral=_he;R.numberLiteralTypeAnnotation=Vde;R.numberTypeAnnotation=Kde;R.numericLiteral=bj;R.objectExpression=yue;R.objectMethod=_ue;R.objectPattern=Xue;R.objectProperty=bue;R.objectTypeAnnotation=Gde;R.objectTypeCallProperty=Hde;R.objectTypeIndexer=Jde;R.objectTypeInternalSlot=Zde;R.objectTypeProperty=Yde;R.objectTypeSpreadProperty=Xde;R.opaqueType=Qde;R.optionalCallExpression=cde;R.optionalIndexedAccessType=Ppe;R.optionalMemberExpression=ode;R.parenthesizedExpression=Sue;R.pipelineBareFunction=rfe;R.pipelinePrimaryTopicReference=nfe;R.pipelineTopicExpression=tfe;R.placeholder=qpe;R.privateName=fde;R.program=gue;R.qualifiedTypeIdentifier=epe;R.recordExpression=Jpe;R.regExpLiteral=vj;R.regexLiteral=bhe;R.restElement=xj;R.restProperty=vhe;R.returnStatement=vue;R.sequenceExpression=xue;R.spreadElement=Sj;R.spreadProperty=xhe;R.staticBlock=hde;R.stringLiteral=uue;R.stringLiteralTypeAnnotation=tpe;R.stringTypeAnnotation=rpe;R.super=Que;R.switchCase=Tue;R.switchStatement=wue;R.symbolTypeAnnotation=npe;R.taggedTemplateExpression=ede;R.templateElement=tde;R.templateLiteral=rde;R.thisExpression=Eue;R.thisTypeAnnotation=ipe;R.throwStatement=Pue;R.topicReference=efe;R.tryStatement=Iue;R.tSAnyKeyword=R.tsAnyKeyword=hfe;R.tSArrayType=R.tsArrayType=Rfe;R.tSAsExpression=R.tsAsExpression=ehe;R.tSBigIntKeyword=R.tsBigIntKeyword=gfe;R.tSBooleanKeyword=R.tsBooleanKeyword=mfe;R.tSCallSignatureDeclaration=R.tsCallSignatureDeclaration=lfe;R.tSConditionalType=R.tsConditionalType=zfe;R.tSConstructSignatureDeclaration=R.tsConstructSignatureDeclaration=ufe;R.tSConstructorType=R.tsConstructorType=kfe;R.tSDeclareFunction=R.tsDeclareFunction=afe;R.tSDeclareMethod=R.tsDeclareMethod=ofe;R.tSEnumBody=R.tsEnumBody=nhe;R.tSEnumDeclaration=R.tsEnumDeclaration=ihe;R.tSEnumMember=R.tsEnumMember=she;R.tSExportAssignment=R.tsExportAssignment=phe;R.tSExpressionWithTypeArguments=R.tsExpressionWithTypeArguments=Hfe;R.tSExternalModuleReference=R.tsExternalModuleReference=uhe;R.tSFunctionType=R.tsFunctionType=Afe;R.tSImportEqualsDeclaration=R.tsImportEqualsDeclaration=lhe;R.tSImportType=R.tsImportType=che;R.tSIndexSignature=R.tsIndexSignature=ffe;R.tSIndexedAccessType=R.tsIndexedAccessType=Vfe;R.tSInferType=R.tsInferType=Ufe;R.tSInstantiationExpression=R.tsInstantiationExpression=Qfe;R.tSInterfaceBody=R.tsInterfaceBody=Yfe;R.tSInterfaceDeclaration=R.tsInterfaceDeclaration=Jfe;R.tSIntersectionType=R.tsIntersectionType=Bfe;R.tSIntrinsicKeyword=R.tsIntrinsicKeyword=yfe;R.tSLiteralType=R.tsLiteralType=Zfe;R.tSMappedType=R.tsMappedType=Kfe;R.tSMethodSignature=R.tsMethodSignature=pfe;R.tSModuleBlock=R.tsModuleBlock=ohe;R.tSModuleDeclaration=R.tsModuleDeclaration=ahe;R.tSNamedTupleMember=R.tsNamedTupleMember=Ffe;R.tSNamespaceExportDeclaration=R.tsNamespaceExportDeclaration=fhe;R.tSNeverKeyword=R.tsNeverKeyword=_fe;R.tSNonNullExpression=R.tsNonNullExpression=dhe;R.tSNullKeyword=R.tsNullKeyword=bfe;R.tSNumberKeyword=R.tsNumberKeyword=vfe;R.tSObjectKeyword=R.tsObjectKeyword=xfe;R.tSOptionalType=R.tsOptionalType=Mfe;R.tSParameterProperty=R.tsParameterProperty=sfe;R.tSParenthesizedType=R.tsParenthesizedType=qfe;R.tSPropertySignature=R.tsPropertySignature=dfe;R.tSQualifiedName=R.tsQualifiedName=cfe;R.tSRestType=R.tsRestType=Lfe;R.tSSatisfiesExpression=R.tsSatisfiesExpression=the;R.tSStringKeyword=R.tsStringKeyword=Sfe;R.tSSymbolKeyword=R.tsSymbolKeyword=Tfe;R.tSTemplateLiteralType=R.tsTemplateLiteralType=Gfe;R.tSThisType=R.tsThisType=Ife;R.tSTupleType=R.tsTupleType=Dfe;R.tSTypeAliasDeclaration=R.tsTypeAliasDeclaration=Xfe;R.tSTypeAnnotation=R.tsTypeAnnotation=hhe;R.tSTypeAssertion=R.tsTypeAssertion=rhe;R.tSTypeLiteral=R.tsTypeLiteral=$fe;R.tSTypeOperator=R.tsTypeOperator=Wfe;R.tSTypeParameter=R.tsTypeParameter=yhe;R.tSTypeParameterDeclaration=R.tsTypeParameterDeclaration=ghe;R.tSTypeParameterInstantiation=R.tsTypeParameterInstantiation=mhe;R.tSTypePredicate=R.tsTypePredicate=Nfe;R.tSTypeQuery=R.tsTypeQuery=Ofe;R.tSTypeReference=R.tsTypeReference=Cfe;R.tSUndefinedKeyword=R.tsUndefinedKeyword=wfe;R.tSUnionType=R.tsUnionType=jfe;R.tSUnknownKeyword=R.tsUnknownKeyword=Efe;R.tSVoidKeyword=R.tsVoidKeyword=Pfe;R.tupleExpression=Ype;R.tupleTypeAnnotation=spe;R.typeAlias=ope;R.typeAnnotation=cpe;R.typeCastExpression=lpe;R.typeParameter=upe;R.typeParameterDeclaration=dpe;R.typeParameterInstantiation=ppe;R.typeofTypeAnnotation=ape;R.unaryExpression=Aue;R.unionTypeAnnotation=fpe;R.updateExpression=kue;R.v8IntrinsicIdentifier=Wpe;R.variableDeclaration=Cue;R.variableDeclarator=Nue;R.variance=hpe;R.voidPattern=ife;R.voidTypeAnnotation=mpe;R.whileStatement=Oue;R.withStatement=$ue;R.yieldExpression=nde;var Lle=s_(),d_=xu(),Fle=Gs(),{validateInternal:I}=Lle,{NODE_FIELDS:X}=Fle;function jle(e){typeof e=="bigint"&&(e=e.toString());let t={type:"BigIntLiteral",value:e},r=X.BigIntLiteral;return I(r.value,t,"value",e),t}function Ble(e=[]){let t={type:"ArrayExpression",elements:e},r=X.ArrayExpression;return I(r.elements,t,"elements",e,1),t}function zle(e,t,r){let n={type:"AssignmentExpression",operator:e,left:t,right:r},s=X.AssignmentExpression;return I(s.operator,n,"operator",e),I(s.left,n,"left",t,1),I(s.right,n,"right",r,1),n}function Ule(e,t,r){let n={type:"BinaryExpression",operator:e,left:t,right:r},s=X.BinaryExpression;return I(s.operator,n,"operator",e),I(s.left,n,"left",t,1),I(s.right,n,"right",r,1),n}function qle(e){let t={type:"InterpreterDirective",value:e},r=X.InterpreterDirective;return I(r.value,t,"value",e),t}function Wle(e){let t={type:"Directive",value:e},r=X.Directive;return I(r.value,t,"value",e,1),t}function Vle(e){let t={type:"DirectiveLiteral",value:e},r=X.DirectiveLiteral;return I(r.value,t,"value",e),t}function Kle(e,t=[]){let r={type:"BlockStatement",body:e,directives:t},n=X.BlockStatement;return I(n.body,r,"body",e,1),I(n.directives,r,"directives",t,1),r}function Gle(e=null){let t={type:"BreakStatement",label:e},r=X.BreakStatement;return I(r.label,t,"label",e,1),t}function Zle(e,t){let r={type:"CallExpression",callee:e,arguments:t},n=X.CallExpression;return I(n.callee,r,"callee",e,1),I(n.arguments,r,"arguments",t,1),r}function Hle(e=null,t){let r={type:"CatchClause",param:e,body:t},n=X.CatchClause;return I(n.param,r,"param",e,1),I(n.body,r,"body",t,1),r}function Jle(e,t,r){let n={type:"ConditionalExpression",test:e,consequent:t,alternate:r},s=X.ConditionalExpression;return I(s.test,n,"test",e,1),I(s.consequent,n,"consequent",t,1),I(s.alternate,n,"alternate",r,1),n}function Yle(e=null){let t={type:"ContinueStatement",label:e},r=X.ContinueStatement;return I(r.label,t,"label",e,1),t}function Xle(){return{type:"DebuggerStatement"}}function Qle(e,t){let r={type:"DoWhileStatement",test:e,body:t},n=X.DoWhileStatement;return I(n.test,r,"test",e,1),I(n.body,r,"body",t,1),r}function eue(){return{type:"EmptyStatement"}}function tue(e){let t={type:"ExpressionStatement",expression:e},r=X.ExpressionStatement;return I(r.expression,t,"expression",e,1),t}function rue(e,t=null,r=null){let n={type:"File",program:e,comments:t,tokens:r},s=X.File;return I(s.program,n,"program",e,1),I(s.comments,n,"comments",t,1),I(s.tokens,n,"tokens",r),n}function nue(e,t,r){let n={type:"ForInStatement",left:e,right:t,body:r},s=X.ForInStatement;return I(s.left,n,"left",e,1),I(s.right,n,"right",t,1),I(s.body,n,"body",r,1),n}function iue(e=null,t=null,r=null,n){let s={type:"ForStatement",init:e,test:t,update:r,body:n},a=X.ForStatement;return I(a.init,s,"init",e,1),I(a.test,s,"test",t,1),I(a.update,s,"update",r,1),I(a.body,s,"body",n,1),s}function sue(e=null,t,r,n=!1,s=!1){let a={type:"FunctionDeclaration",id:e,params:t,body:r,generator:n,async:s},o=X.FunctionDeclaration;return I(o.id,a,"id",e,1),I(o.params,a,"params",t,1),I(o.body,a,"body",r,1),I(o.generator,a,"generator",n),I(o.async,a,"async",s),a}function aue(e=null,t,r,n=!1,s=!1){let a={type:"FunctionExpression",id:e,params:t,body:r,generator:n,async:s},o=X.FunctionExpression;return I(o.id,a,"id",e,1),I(o.params,a,"params",t,1),I(o.body,a,"body",r,1),I(o.generator,a,"generator",n),I(o.async,a,"async",s),a}function oue(e){let t={type:"Identifier",name:e},r=X.Identifier;return I(r.name,t,"name",e),t}function cue(e,t,r=null){let n={type:"IfStatement",test:e,consequent:t,alternate:r},s=X.IfStatement;return I(s.test,n,"test",e,1),I(s.consequent,n,"consequent",t,1),I(s.alternate,n,"alternate",r,1),n}function lue(e,t){let r={type:"LabeledStatement",label:e,body:t},n=X.LabeledStatement;return I(n.label,r,"label",e,1),I(n.body,r,"body",t,1),r}function uue(e){let t={type:"StringLiteral",value:e},r=X.StringLiteral;return I(r.value,t,"value",e),t}function bj(e){let t={type:"NumericLiteral",value:e},r=X.NumericLiteral;return I(r.value,t,"value",e),t}function due(){return{type:"NullLiteral"}}function pue(e){let t={type:"BooleanLiteral",value:e},r=X.BooleanLiteral;return I(r.value,t,"value",e),t}function vj(e,t=""){let r={type:"RegExpLiteral",pattern:e,flags:t},n=X.RegExpLiteral;return I(n.pattern,r,"pattern",e),I(n.flags,r,"flags",t),r}function fue(e,t,r){let n={type:"LogicalExpression",operator:e,left:t,right:r},s=X.LogicalExpression;return I(s.operator,n,"operator",e),I(s.left,n,"left",t,1),I(s.right,n,"right",r,1),n}function hue(e,t,r=!1,n=null){let s={type:"MemberExpression",object:e,property:t,computed:r,optional:n},a=X.MemberExpression;return I(a.object,s,"object",e,1),I(a.property,s,"property",t,1),I(a.computed,s,"computed",r),I(a.optional,s,"optional",n),s}function mue(e,t){let r={type:"NewExpression",callee:e,arguments:t},n=X.NewExpression;return I(n.callee,r,"callee",e,1),I(n.arguments,r,"arguments",t,1),r}function gue(e,t=[],r="script",n=null){let s={type:"Program",body:e,directives:t,sourceType:r,interpreter:n},a=X.Program;return I(a.body,s,"body",e,1),I(a.directives,s,"directives",t,1),I(a.sourceType,s,"sourceType",r),I(a.interpreter,s,"interpreter",n,1),s}function yue(e){let t={type:"ObjectExpression",properties:e},r=X.ObjectExpression;return I(r.properties,t,"properties",e,1),t}function _ue(e="method",t,r,n,s=!1,a=!1,o=!1){let c={type:"ObjectMethod",kind:e,key:t,params:r,body:n,computed:s,generator:a,async:o},l=X.ObjectMethod;return I(l.kind,c,"kind",e),I(l.key,c,"key",t,1),I(l.params,c,"params",r,1),I(l.body,c,"body",n,1),I(l.computed,c,"computed",s),I(l.generator,c,"generator",a),I(l.async,c,"async",o),c}function bue(e,t,r=!1,n=!1,s=null){let a={type:"ObjectProperty",key:e,value:t,computed:r,shorthand:n,decorators:s},o=X.ObjectProperty;return I(o.key,a,"key",e,1),I(o.value,a,"value",t,1),I(o.computed,a,"computed",r),I(o.shorthand,a,"shorthand",n),I(o.decorators,a,"decorators",s,1),a}function xj(e){let t={type:"RestElement",argument:e},r=X.RestElement;return I(r.argument,t,"argument",e,1),t}function vue(e=null){let t={type:"ReturnStatement",argument:e},r=X.ReturnStatement;return I(r.argument,t,"argument",e,1),t}function xue(e){let t={type:"SequenceExpression",expressions:e},r=X.SequenceExpression;return I(r.expressions,t,"expressions",e,1),t}function Sue(e){let t={type:"ParenthesizedExpression",expression:e},r=X.ParenthesizedExpression;return I(r.expression,t,"expression",e,1),t}function Tue(e=null,t){let r={type:"SwitchCase",test:e,consequent:t},n=X.SwitchCase;return I(n.test,r,"test",e,1),I(n.consequent,r,"consequent",t,1),r}function wue(e,t){let r={type:"SwitchStatement",discriminant:e,cases:t},n=X.SwitchStatement;return I(n.discriminant,r,"discriminant",e,1),I(n.cases,r,"cases",t,1),r}function Eue(){return{type:"ThisExpression"}}function Pue(e){let t={type:"ThrowStatement",argument:e},r=X.ThrowStatement;return I(r.argument,t,"argument",e,1),t}function Iue(e,t=null,r=null){let n={type:"TryStatement",block:e,handler:t,finalizer:r},s=X.TryStatement;return I(s.block,n,"block",e,1),I(s.handler,n,"handler",t,1),I(s.finalizer,n,"finalizer",r,1),n}function Aue(e,t,r=!0){let n={type:"UnaryExpression",operator:e,argument:t,prefix:r},s=X.UnaryExpression;return I(s.operator,n,"operator",e),I(s.argument,n,"argument",t,1),I(s.prefix,n,"prefix",r),n}function kue(e,t,r=!1){let n={type:"UpdateExpression",operator:e,argument:t,prefix:r},s=X.UpdateExpression;return I(s.operator,n,"operator",e),I(s.argument,n,"argument",t,1),I(s.prefix,n,"prefix",r),n}function Cue(e,t){let r={type:"VariableDeclaration",kind:e,declarations:t},n=X.VariableDeclaration;return I(n.kind,r,"kind",e),I(n.declarations,r,"declarations",t,1),r}function Nue(e,t=null){let r={type:"VariableDeclarator",id:e,init:t},n=X.VariableDeclarator;return I(n.id,r,"id",e,1),I(n.init,r,"init",t,1),r}function Oue(e,t){let r={type:"WhileStatement",test:e,body:t},n=X.WhileStatement;return I(n.test,r,"test",e,1),I(n.body,r,"body",t,1),r}function $ue(e,t){let r={type:"WithStatement",object:e,body:t},n=X.WithStatement;return I(n.object,r,"object",e,1),I(n.body,r,"body",t,1),r}function Rue(e,t){let r={type:"AssignmentPattern",left:e,right:t},n=X.AssignmentPattern;return I(n.left,r,"left",e,1),I(n.right,r,"right",t,1),r}function Due(e){let t={type:"ArrayPattern",elements:e},r=X.ArrayPattern;return I(r.elements,t,"elements",e,1),t}function Mue(e,t,r=!1){let n={type:"ArrowFunctionExpression",params:e,body:t,async:r,expression:null},s=X.ArrowFunctionExpression;return I(s.params,n,"params",e,1),I(s.body,n,"body",t,1),I(s.async,n,"async",r),n}function Lue(e){let t={type:"ClassBody",body:e},r=X.ClassBody;return I(r.body,t,"body",e,1),t}function Fue(e=null,t=null,r,n=null){let s={type:"ClassExpression",id:e,superClass:t,body:r,decorators:n},a=X.ClassExpression;return I(a.id,s,"id",e,1),I(a.superClass,s,"superClass",t,1),I(a.body,s,"body",r,1),I(a.decorators,s,"decorators",n,1),s}function jue(e=null,t=null,r,n=null){let s={type:"ClassDeclaration",id:e,superClass:t,body:r,decorators:n},a=X.ClassDeclaration;return I(a.id,s,"id",e,1),I(a.superClass,s,"superClass",t,1),I(a.body,s,"body",r,1),I(a.decorators,s,"decorators",n,1),s}function Bue(e,t=null){let r={type:"ExportAllDeclaration",source:e,attributes:t},n=X.ExportAllDeclaration;return I(n.source,r,"source",e,1),I(n.attributes,r,"attributes",t,1),r}function zue(e){let t={type:"ExportDefaultDeclaration",declaration:e},r=X.ExportDefaultDeclaration;return I(r.declaration,t,"declaration",e,1),t}function Uue(e=null,t=[],r=null,n=null){let s={type:"ExportNamedDeclaration",declaration:e,specifiers:t,source:r,attributes:n},a=X.ExportNamedDeclaration;return I(a.declaration,s,"declaration",e,1),I(a.specifiers,s,"specifiers",t,1),I(a.source,s,"source",r,1),I(a.attributes,s,"attributes",n,1),s}function que(e,t){let r={type:"ExportSpecifier",local:e,exported:t},n=X.ExportSpecifier;return I(n.local,r,"local",e,1),I(n.exported,r,"exported",t,1),r}function Wue(e,t,r,n=!1){let s={type:"ForOfStatement",left:e,right:t,body:r,await:n},a=X.ForOfStatement;return I(a.left,s,"left",e,1),I(a.right,s,"right",t,1),I(a.body,s,"body",r,1),I(a.await,s,"await",n),s}function Vue(e,t,r=null){let n={type:"ImportDeclaration",specifiers:e,source:t,attributes:r},s=X.ImportDeclaration;return I(s.specifiers,n,"specifiers",e,1),I(s.source,n,"source",t,1),I(s.attributes,n,"attributes",r,1),n}function Kue(e){let t={type:"ImportDefaultSpecifier",local:e},r=X.ImportDefaultSpecifier;return I(r.local,t,"local",e,1),t}function Gue(e){let t={type:"ImportNamespaceSpecifier",local:e},r=X.ImportNamespaceSpecifier;return I(r.local,t,"local",e,1),t}function Zue(e,t){let r={type:"ImportSpecifier",local:e,imported:t},n=X.ImportSpecifier;return I(n.local,r,"local",e,1),I(n.imported,r,"imported",t,1),r}function Hue(e,t=null){let r={type:"ImportExpression",source:e,options:t},n=X.ImportExpression;return I(n.source,r,"source",e,1),I(n.options,r,"options",t,1),r}function Jue(e,t){let r={type:"MetaProperty",meta:e,property:t},n=X.MetaProperty;return I(n.meta,r,"meta",e,1),I(n.property,r,"property",t,1),r}function Yue(e="method",t,r,n,s=!1,a=!1,o=!1,c=!1){let l={type:"ClassMethod",kind:e,key:t,params:r,body:n,computed:s,static:a,generator:o,async:c},u=X.ClassMethod;return I(u.kind,l,"kind",e),I(u.key,l,"key",t,1),I(u.params,l,"params",r,1),I(u.body,l,"body",n,1),I(u.computed,l,"computed",s),I(u.static,l,"static",a),I(u.generator,l,"generator",o),I(u.async,l,"async",c),l}function Xue(e){let t={type:"ObjectPattern",properties:e},r=X.ObjectPattern;return I(r.properties,t,"properties",e,1),t}function Sj(e){let t={type:"SpreadElement",argument:e},r=X.SpreadElement;return I(r.argument,t,"argument",e,1),t}function Que(){return{type:"Super"}}function ede(e,t){let r={type:"TaggedTemplateExpression",tag:e,quasi:t},n=X.TaggedTemplateExpression;return I(n.tag,r,"tag",e,1),I(n.quasi,r,"quasi",t,1),r}function tde(e,t=!1){let r={type:"TemplateElement",value:e,tail:t},n=X.TemplateElement;return I(n.value,r,"value",e),I(n.tail,r,"tail",t),r}function rde(e,t){let r={type:"TemplateLiteral",quasis:e,expressions:t},n=X.TemplateLiteral;return I(n.quasis,r,"quasis",e,1),I(n.expressions,r,"expressions",t,1),r}function nde(e=null,t=!1){let r={type:"YieldExpression",argument:e,delegate:t},n=X.YieldExpression;return I(n.argument,r,"argument",e,1),I(n.delegate,r,"delegate",t),r}function ide(e){let t={type:"AwaitExpression",argument:e},r=X.AwaitExpression;return I(r.argument,t,"argument",e,1),t}function sde(){return{type:"Import"}}function ade(e){let t={type:"ExportNamespaceSpecifier",exported:e},r=X.ExportNamespaceSpecifier;return I(r.exported,t,"exported",e,1),t}function ode(e,t,r=!1,n){let s={type:"OptionalMemberExpression",object:e,property:t,computed:r,optional:n},a=X.OptionalMemberExpression;return I(a.object,s,"object",e,1),I(a.property,s,"property",t,1),I(a.computed,s,"computed",r),I(a.optional,s,"optional",n),s}function cde(e,t,r){let n={type:"OptionalCallExpression",callee:e,arguments:t,optional:r},s=X.OptionalCallExpression;return I(s.callee,n,"callee",e,1),I(s.arguments,n,"arguments",t,1),I(s.optional,n,"optional",r),n}function lde(e,t=null,r=null,n=null,s=!1,a=!1){let o={type:"ClassProperty",key:e,value:t,typeAnnotation:r,decorators:n,computed:s,static:a},c=X.ClassProperty;return I(c.key,o,"key",e,1),I(c.value,o,"value",t,1),I(c.typeAnnotation,o,"typeAnnotation",r,1),I(c.decorators,o,"decorators",n,1),I(c.computed,o,"computed",s),I(c.static,o,"static",a),o}function ude(e,t=null,r=null,n=null,s=!1,a=!1){let o={type:"ClassAccessorProperty",key:e,value:t,typeAnnotation:r,decorators:n,computed:s,static:a},c=X.ClassAccessorProperty;return I(c.key,o,"key",e,1),I(c.value,o,"value",t,1),I(c.typeAnnotation,o,"typeAnnotation",r,1),I(c.decorators,o,"decorators",n,1),I(c.computed,o,"computed",s),I(c.static,o,"static",a),o}function dde(e,t=null,r=null,n=!1){let s={type:"ClassPrivateProperty",key:e,value:t,decorators:r,static:n},a=X.ClassPrivateProperty;return I(a.key,s,"key",e,1),I(a.value,s,"value",t,1),I(a.decorators,s,"decorators",r,1),I(a.static,s,"static",n),s}function pde(e="method",t,r,n,s=!1){let a={type:"ClassPrivateMethod",kind:e,key:t,params:r,body:n,static:s},o=X.ClassPrivateMethod;return I(o.kind,a,"kind",e),I(o.key,a,"key",t,1),I(o.params,a,"params",r,1),I(o.body,a,"body",n,1),I(o.static,a,"static",s),a}function fde(e){let t={type:"PrivateName",id:e},r=X.PrivateName;return I(r.id,t,"id",e,1),t}function hde(e){let t={type:"StaticBlock",body:e},r=X.StaticBlock;return I(r.body,t,"body",e,1),t}function mde(e,t){let r={type:"ImportAttribute",key:e,value:t},n=X.ImportAttribute;return I(n.key,r,"key",e,1),I(n.value,r,"value",t,1),r}function gde(){return{type:"AnyTypeAnnotation"}}function yde(e){let t={type:"ArrayTypeAnnotation",elementType:e},r=X.ArrayTypeAnnotation;return I(r.elementType,t,"elementType",e,1),t}function _de(){return{type:"BooleanTypeAnnotation"}}function bde(e){let t={type:"BooleanLiteralTypeAnnotation",value:e},r=X.BooleanLiteralTypeAnnotation;return I(r.value,t,"value",e),t}function vde(){return{type:"NullLiteralTypeAnnotation"}}function xde(e,t=null){let r={type:"ClassImplements",id:e,typeParameters:t},n=X.ClassImplements;return I(n.id,r,"id",e,1),I(n.typeParameters,r,"typeParameters",t,1),r}function Sde(e,t=null,r=null,n){let s={type:"DeclareClass",id:e,typeParameters:t,extends:r,body:n},a=X.DeclareClass;return I(a.id,s,"id",e,1),I(a.typeParameters,s,"typeParameters",t,1),I(a.extends,s,"extends",r,1),I(a.body,s,"body",n,1),s}function Tde(e){let t={type:"DeclareFunction",id:e},r=X.DeclareFunction;return I(r.id,t,"id",e,1),t}function wde(e,t=null,r=null,n){let s={type:"DeclareInterface",id:e,typeParameters:t,extends:r,body:n},a=X.DeclareInterface;return I(a.id,s,"id",e,1),I(a.typeParameters,s,"typeParameters",t,1),I(a.extends,s,"extends",r,1),I(a.body,s,"body",n,1),s}function Ede(e,t,r=null){let n={type:"DeclareModule",id:e,body:t,kind:r},s=X.DeclareModule;return I(s.id,n,"id",e,1),I(s.body,n,"body",t,1),I(s.kind,n,"kind",r),n}function Pde(e){let t={type:"DeclareModuleExports",typeAnnotation:e},r=X.DeclareModuleExports;return I(r.typeAnnotation,t,"typeAnnotation",e,1),t}function Ide(e,t=null,r){let n={type:"DeclareTypeAlias",id:e,typeParameters:t,right:r},s=X.DeclareTypeAlias;return I(s.id,n,"id",e,1),I(s.typeParameters,n,"typeParameters",t,1),I(s.right,n,"right",r,1),n}function Ade(e,t=null,r=null){let n={type:"DeclareOpaqueType",id:e,typeParameters:t,supertype:r},s=X.DeclareOpaqueType;return I(s.id,n,"id",e,1),I(s.typeParameters,n,"typeParameters",t,1),I(s.supertype,n,"supertype",r,1),n}function kde(e){let t={type:"DeclareVariable",id:e},r=X.DeclareVariable;return I(r.id,t,"id",e,1),t}function Cde(e=null,t=null,r=null,n=null){let s={type:"DeclareExportDeclaration",declaration:e,specifiers:t,source:r,attributes:n},a=X.DeclareExportDeclaration;return I(a.declaration,s,"declaration",e,1),I(a.specifiers,s,"specifiers",t,1),I(a.source,s,"source",r,1),I(a.attributes,s,"attributes",n,1),s}function Nde(e,t=null){let r={type:"DeclareExportAllDeclaration",source:e,attributes:t},n=X.DeclareExportAllDeclaration;return I(n.source,r,"source",e,1),I(n.attributes,r,"attributes",t,1),r}function Ode(e){let t={type:"DeclaredPredicate",value:e},r=X.DeclaredPredicate;return I(r.value,t,"value",e,1),t}function $de(){return{type:"ExistsTypeAnnotation"}}function Rde(e=null,t,r=null,n){let s={type:"FunctionTypeAnnotation",typeParameters:e,params:t,rest:r,returnType:n},a=X.FunctionTypeAnnotation;return I(a.typeParameters,s,"typeParameters",e,1),I(a.params,s,"params",t,1),I(a.rest,s,"rest",r,1),I(a.returnType,s,"returnType",n,1),s}function Dde(e=null,t){let r={type:"FunctionTypeParam",name:e,typeAnnotation:t},n=X.FunctionTypeParam;return I(n.name,r,"name",e,1),I(n.typeAnnotation,r,"typeAnnotation",t,1),r}function Mde(e,t=null){let r={type:"GenericTypeAnnotation",id:e,typeParameters:t},n=X.GenericTypeAnnotation;return I(n.id,r,"id",e,1),I(n.typeParameters,r,"typeParameters",t,1),r}function Lde(){return{type:"InferredPredicate"}}function Fde(e,t=null){let r={type:"InterfaceExtends",id:e,typeParameters:t},n=X.InterfaceExtends;return I(n.id,r,"id",e,1),I(n.typeParameters,r,"typeParameters",t,1),r}function jde(e,t=null,r=null,n){let s={type:"InterfaceDeclaration",id:e,typeParameters:t,extends:r,body:n},a=X.InterfaceDeclaration;return I(a.id,s,"id",e,1),I(a.typeParameters,s,"typeParameters",t,1),I(a.extends,s,"extends",r,1),I(a.body,s,"body",n,1),s}function Bde(e=null,t){let r={type:"InterfaceTypeAnnotation",extends:e,body:t},n=X.InterfaceTypeAnnotation;return I(n.extends,r,"extends",e,1),I(n.body,r,"body",t,1),r}function zde(e){let t={type:"IntersectionTypeAnnotation",types:e},r=X.IntersectionTypeAnnotation;return I(r.types,t,"types",e,1),t}function Ude(){return{type:"MixedTypeAnnotation"}}function qde(){return{type:"EmptyTypeAnnotation"}}function Wde(e){let t={type:"NullableTypeAnnotation",typeAnnotation:e},r=X.NullableTypeAnnotation;return I(r.typeAnnotation,t,"typeAnnotation",e,1),t}function Vde(e){let t={type:"NumberLiteralTypeAnnotation",value:e},r=X.NumberLiteralTypeAnnotation;return I(r.value,t,"value",e),t}function Kde(){return{type:"NumberTypeAnnotation"}}function Gde(e,t=[],r=[],n=[],s=!1){let a={type:"ObjectTypeAnnotation",properties:e,indexers:t,callProperties:r,internalSlots:n,exact:s},o=X.ObjectTypeAnnotation;return I(o.properties,a,"properties",e,1),I(o.indexers,a,"indexers",t,1),I(o.callProperties,a,"callProperties",r,1),I(o.internalSlots,a,"internalSlots",n,1),I(o.exact,a,"exact",s),a}function Zde(e,t,r,n,s){let a={type:"ObjectTypeInternalSlot",id:e,value:t,optional:r,static:n,method:s},o=X.ObjectTypeInternalSlot;return I(o.id,a,"id",e,1),I(o.value,a,"value",t,1),I(o.optional,a,"optional",r),I(o.static,a,"static",n),I(o.method,a,"method",s),a}function Hde(e){let t={type:"ObjectTypeCallProperty",value:e,static:null},r=X.ObjectTypeCallProperty;return I(r.value,t,"value",e,1),t}function Jde(e=null,t,r,n=null){let s={type:"ObjectTypeIndexer",id:e,key:t,value:r,variance:n,static:null},a=X.ObjectTypeIndexer;return I(a.id,s,"id",e,1),I(a.key,s,"key",t,1),I(a.value,s,"value",r,1),I(a.variance,s,"variance",n,1),s}function Yde(e,t,r=null){let n={type:"ObjectTypeProperty",key:e,value:t,variance:r,kind:null,method:null,optional:null,proto:null,static:null},s=X.ObjectTypeProperty;return I(s.key,n,"key",e,1),I(s.value,n,"value",t,1),I(s.variance,n,"variance",r,1),n}function Xde(e){let t={type:"ObjectTypeSpreadProperty",argument:e},r=X.ObjectTypeSpreadProperty;return I(r.argument,t,"argument",e,1),t}function Qde(e,t=null,r=null,n){let s={type:"OpaqueType",id:e,typeParameters:t,supertype:r,impltype:n},a=X.OpaqueType;return I(a.id,s,"id",e,1),I(a.typeParameters,s,"typeParameters",t,1),I(a.supertype,s,"supertype",r,1),I(a.impltype,s,"impltype",n,1),s}function epe(e,t){let r={type:"QualifiedTypeIdentifier",id:e,qualification:t},n=X.QualifiedTypeIdentifier;return I(n.id,r,"id",e,1),I(n.qualification,r,"qualification",t,1),r}function tpe(e){let t={type:"StringLiteralTypeAnnotation",value:e},r=X.StringLiteralTypeAnnotation;return I(r.value,t,"value",e),t}function rpe(){return{type:"StringTypeAnnotation"}}function npe(){return{type:"SymbolTypeAnnotation"}}function ipe(){return{type:"ThisTypeAnnotation"}}function spe(e){let t={type:"TupleTypeAnnotation",types:e},r=X.TupleTypeAnnotation;return I(r.types,t,"types",e,1),t}function ape(e){let t={type:"TypeofTypeAnnotation",argument:e},r=X.TypeofTypeAnnotation;return I(r.argument,t,"argument",e,1),t}function ope(e,t=null,r){let n={type:"TypeAlias",id:e,typeParameters:t,right:r},s=X.TypeAlias;return I(s.id,n,"id",e,1),I(s.typeParameters,n,"typeParameters",t,1),I(s.right,n,"right",r,1),n}function cpe(e){let t={type:"TypeAnnotation",typeAnnotation:e},r=X.TypeAnnotation;return I(r.typeAnnotation,t,"typeAnnotation",e,1),t}function lpe(e,t){let r={type:"TypeCastExpression",expression:e,typeAnnotation:t},n=X.TypeCastExpression;return I(n.expression,r,"expression",e,1),I(n.typeAnnotation,r,"typeAnnotation",t,1),r}function upe(e=null,t=null,r=null){let n={type:"TypeParameter",bound:e,default:t,variance:r,name:null},s=X.TypeParameter;return I(s.bound,n,"bound",e,1),I(s.default,n,"default",t,1),I(s.variance,n,"variance",r,1),n}function dpe(e){let t={type:"TypeParameterDeclaration",params:e},r=X.TypeParameterDeclaration;return I(r.params,t,"params",e,1),t}function ppe(e){let t={type:"TypeParameterInstantiation",params:e},r=X.TypeParameterInstantiation;return I(r.params,t,"params",e,1),t}function fpe(e){let t={type:"UnionTypeAnnotation",types:e},r=X.UnionTypeAnnotation;return I(r.types,t,"types",e,1),t}function hpe(e){let t={type:"Variance",kind:e},r=X.Variance;return I(r.kind,t,"kind",e),t}function mpe(){return{type:"VoidTypeAnnotation"}}function gpe(e,t){let r={type:"EnumDeclaration",id:e,body:t},n=X.EnumDeclaration;return I(n.id,r,"id",e,1),I(n.body,r,"body",t,1),r}function ype(e){let t={type:"EnumBooleanBody",members:e,explicitType:null,hasUnknownMembers:null},r=X.EnumBooleanBody;return I(r.members,t,"members",e,1),t}function _pe(e){let t={type:"EnumNumberBody",members:e,explicitType:null,hasUnknownMembers:null},r=X.EnumNumberBody;return I(r.members,t,"members",e,1),t}function bpe(e){let t={type:"EnumStringBody",members:e,explicitType:null,hasUnknownMembers:null},r=X.EnumStringBody;return I(r.members,t,"members",e,1),t}function vpe(e){let t={type:"EnumSymbolBody",members:e,hasUnknownMembers:null},r=X.EnumSymbolBody;return I(r.members,t,"members",e,1),t}function xpe(e){let t={type:"EnumBooleanMember",id:e,init:null},r=X.EnumBooleanMember;return I(r.id,t,"id",e,1),t}function Spe(e,t){let r={type:"EnumNumberMember",id:e,init:t},n=X.EnumNumberMember;return I(n.id,r,"id",e,1),I(n.init,r,"init",t,1),r}function Tpe(e,t){let r={type:"EnumStringMember",id:e,init:t},n=X.EnumStringMember;return I(n.id,r,"id",e,1),I(n.init,r,"init",t,1),r}function wpe(e){let t={type:"EnumDefaultedMember",id:e},r=X.EnumDefaultedMember;return I(r.id,t,"id",e,1),t}function Epe(e,t){let r={type:"IndexedAccessType",objectType:e,indexType:t},n=X.IndexedAccessType;return I(n.objectType,r,"objectType",e,1),I(n.indexType,r,"indexType",t,1),r}function Ppe(e,t){let r={type:"OptionalIndexedAccessType",objectType:e,indexType:t,optional:null},n=X.OptionalIndexedAccessType;return I(n.objectType,r,"objectType",e,1),I(n.indexType,r,"indexType",t,1),r}function Ipe(e,t=null){let r={type:"JSXAttribute",name:e,value:t},n=X.JSXAttribute;return I(n.name,r,"name",e,1),I(n.value,r,"value",t,1),r}function Ape(e){let t={type:"JSXClosingElement",name:e},r=X.JSXClosingElement;return I(r.name,t,"name",e,1),t}function kpe(e,t=null,r,n=null){let s={type:"JSXElement",openingElement:e,closingElement:t,children:r,selfClosing:n},a=X.JSXElement;return I(a.openingElement,s,"openingElement",e,1),I(a.closingElement,s,"closingElement",t,1),I(a.children,s,"children",r,1),I(a.selfClosing,s,"selfClosing",n),s}function Cpe(){return{type:"JSXEmptyExpression"}}function Npe(e){let t={type:"JSXExpressionContainer",expression:e},r=X.JSXExpressionContainer;return I(r.expression,t,"expression",e,1),t}function Ope(e){let t={type:"JSXSpreadChild",expression:e},r=X.JSXSpreadChild;return I(r.expression,t,"expression",e,1),t}function $pe(e){let t={type:"JSXIdentifier",name:e},r=X.JSXIdentifier;return I(r.name,t,"name",e),t}function Rpe(e,t){let r={type:"JSXMemberExpression",object:e,property:t},n=X.JSXMemberExpression;return I(n.object,r,"object",e,1),I(n.property,r,"property",t,1),r}function Dpe(e,t){let r={type:"JSXNamespacedName",namespace:e,name:t},n=X.JSXNamespacedName;return I(n.namespace,r,"namespace",e,1),I(n.name,r,"name",t,1),r}function Mpe(e,t,r=!1){let n={type:"JSXOpeningElement",name:e,attributes:t,selfClosing:r},s=X.JSXOpeningElement;return I(s.name,n,"name",e,1),I(s.attributes,n,"attributes",t,1),I(s.selfClosing,n,"selfClosing",r),n}function Lpe(e){let t={type:"JSXSpreadAttribute",argument:e},r=X.JSXSpreadAttribute;return I(r.argument,t,"argument",e,1),t}function Fpe(e){let t={type:"JSXText",value:e},r=X.JSXText;return I(r.value,t,"value",e),t}function jpe(e,t,r){let n={type:"JSXFragment",openingFragment:e,closingFragment:t,children:r},s=X.JSXFragment;return I(s.openingFragment,n,"openingFragment",e,1),I(s.closingFragment,n,"closingFragment",t,1),I(s.children,n,"children",r,1),n}function Bpe(){return{type:"JSXOpeningFragment"}}function zpe(){return{type:"JSXClosingFragment"}}function Upe(){return{type:"Noop"}}function qpe(e,t){let r={type:"Placeholder",expectedNode:e,name:t},n=X.Placeholder;return I(n.expectedNode,r,"expectedNode",e),I(n.name,r,"name",t,1),r}function Wpe(e){let t={type:"V8IntrinsicIdentifier",name:e},r=X.V8IntrinsicIdentifier;return I(r.name,t,"name",e),t}function Vpe(){return{type:"ArgumentPlaceholder"}}function Kpe(e,t){let r={type:"BindExpression",object:e,callee:t},n=X.BindExpression;return I(n.object,r,"object",e,1),I(n.callee,r,"callee",t,1),r}function Gpe(e){let t={type:"Decorator",expression:e},r=X.Decorator;return I(r.expression,t,"expression",e,1),t}function Zpe(e,t=!1){let r={type:"DoExpression",body:e,async:t},n=X.DoExpression;return I(n.body,r,"body",e,1),I(n.async,r,"async",t),r}function Hpe(e){let t={type:"ExportDefaultSpecifier",exported:e},r=X.ExportDefaultSpecifier;return I(r.exported,t,"exported",e,1),t}function Jpe(e){let t={type:"RecordExpression",properties:e},r=X.RecordExpression;return I(r.properties,t,"properties",e,1),t}function Ype(e=[]){let t={type:"TupleExpression",elements:e},r=X.TupleExpression;return I(r.elements,t,"elements",e,1),t}function Xpe(e){let t={type:"DecimalLiteral",value:e},r=X.DecimalLiteral;return I(r.value,t,"value",e),t}function Qpe(e){let t={type:"ModuleExpression",body:e},r=X.ModuleExpression;return I(r.body,t,"body",e,1),t}function efe(){return{type:"TopicReference"}}function tfe(e){let t={type:"PipelineTopicExpression",expression:e},r=X.PipelineTopicExpression;return I(r.expression,t,"expression",e,1),t}function rfe(e){let t={type:"PipelineBareFunction",callee:e},r=X.PipelineBareFunction;return I(r.callee,t,"callee",e,1),t}function nfe(){return{type:"PipelinePrimaryTopicReference"}}function ife(){return{type:"VoidPattern"}}function sfe(e){let t={type:"TSParameterProperty",parameter:e},r=X.TSParameterProperty;return I(r.parameter,t,"parameter",e,1),t}function afe(e=null,t=null,r,n=null){let s={type:"TSDeclareFunction",id:e,typeParameters:t,params:r,returnType:n},a=X.TSDeclareFunction;return I(a.id,s,"id",e,1),I(a.typeParameters,s,"typeParameters",t,1),I(a.params,s,"params",r,1),I(a.returnType,s,"returnType",n,1),s}function ofe(e=null,t,r=null,n,s=null){let a={type:"TSDeclareMethod",decorators:e,key:t,typeParameters:r,params:n,returnType:s},o=X.TSDeclareMethod;return I(o.decorators,a,"decorators",e,1),I(o.key,a,"key",t,1),I(o.typeParameters,a,"typeParameters",r,1),I(o.params,a,"params",n,1),I(o.returnType,a,"returnType",s,1),a}function cfe(e,t){let r={type:"TSQualifiedName",left:e,right:t},n=X.TSQualifiedName;return I(n.left,r,"left",e,1),I(n.right,r,"right",t,1),r}function lfe(e=null,t,r=null){let n={type:"TSCallSignatureDeclaration",typeParameters:e,parameters:t,typeAnnotation:r},s=X.TSCallSignatureDeclaration;return I(s.typeParameters,n,"typeParameters",e,1),I(s.parameters,n,"parameters",t,1),I(s.typeAnnotation,n,"typeAnnotation",r,1),n}function ufe(e=null,t,r=null){let n={type:"TSConstructSignatureDeclaration",typeParameters:e,parameters:t,typeAnnotation:r},s=X.TSConstructSignatureDeclaration;return I(s.typeParameters,n,"typeParameters",e,1),I(s.parameters,n,"parameters",t,1),I(s.typeAnnotation,n,"typeAnnotation",r,1),n}function dfe(e,t=null){let r={type:"TSPropertySignature",key:e,typeAnnotation:t},n=X.TSPropertySignature;return I(n.key,r,"key",e,1),I(n.typeAnnotation,r,"typeAnnotation",t,1),r}function pfe(e,t=null,r,n=null){let s={type:"TSMethodSignature",key:e,typeParameters:t,parameters:r,typeAnnotation:n,kind:null},a=X.TSMethodSignature;return I(a.key,s,"key",e,1),I(a.typeParameters,s,"typeParameters",t,1),I(a.parameters,s,"parameters",r,1),I(a.typeAnnotation,s,"typeAnnotation",n,1),s}function ffe(e,t=null){let r={type:"TSIndexSignature",parameters:e,typeAnnotation:t},n=X.TSIndexSignature;return I(n.parameters,r,"parameters",e,1),I(n.typeAnnotation,r,"typeAnnotation",t,1),r}function hfe(){return{type:"TSAnyKeyword"}}function mfe(){return{type:"TSBooleanKeyword"}}function gfe(){return{type:"TSBigIntKeyword"}}function yfe(){return{type:"TSIntrinsicKeyword"}}function _fe(){return{type:"TSNeverKeyword"}}function bfe(){return{type:"TSNullKeyword"}}function vfe(){return{type:"TSNumberKeyword"}}function xfe(){return{type:"TSObjectKeyword"}}function Sfe(){return{type:"TSStringKeyword"}}function Tfe(){return{type:"TSSymbolKeyword"}}function wfe(){return{type:"TSUndefinedKeyword"}}function Efe(){return{type:"TSUnknownKeyword"}}function Pfe(){return{type:"TSVoidKeyword"}}function Ife(){return{type:"TSThisType"}}function Afe(e=null,t,r=null){let n={type:"TSFunctionType",typeParameters:e,parameters:t,typeAnnotation:r},s=X.TSFunctionType;return I(s.typeParameters,n,"typeParameters",e,1),I(s.parameters,n,"parameters",t,1),I(s.typeAnnotation,n,"typeAnnotation",r,1),n}function kfe(e=null,t,r=null){let n={type:"TSConstructorType",typeParameters:e,parameters:t,typeAnnotation:r},s=X.TSConstructorType;return I(s.typeParameters,n,"typeParameters",e,1),I(s.parameters,n,"parameters",t,1),I(s.typeAnnotation,n,"typeAnnotation",r,1),n}function Cfe(e,t=null){let r={type:"TSTypeReference",typeName:e,typeParameters:t},n=X.TSTypeReference;return I(n.typeName,r,"typeName",e,1),I(n.typeParameters,r,"typeParameters",t,1),r}function Nfe(e,t=null,r=null){let n={type:"TSTypePredicate",parameterName:e,typeAnnotation:t,asserts:r},s=X.TSTypePredicate;return I(s.parameterName,n,"parameterName",e,1),I(s.typeAnnotation,n,"typeAnnotation",t,1),I(s.asserts,n,"asserts",r),n}function Ofe(e,t=null){let r={type:"TSTypeQuery",exprName:e,typeParameters:t},n=X.TSTypeQuery;return I(n.exprName,r,"exprName",e,1),I(n.typeParameters,r,"typeParameters",t,1),r}function $fe(e){let t={type:"TSTypeLiteral",members:e},r=X.TSTypeLiteral;return I(r.members,t,"members",e,1),t}function Rfe(e){let t={type:"TSArrayType",elementType:e},r=X.TSArrayType;return I(r.elementType,t,"elementType",e,1),t}function Dfe(e){let t={type:"TSTupleType",elementTypes:e},r=X.TSTupleType;return I(r.elementTypes,t,"elementTypes",e,1),t}function Mfe(e){let t={type:"TSOptionalType",typeAnnotation:e},r=X.TSOptionalType;return I(r.typeAnnotation,t,"typeAnnotation",e,1),t}function Lfe(e){let t={type:"TSRestType",typeAnnotation:e},r=X.TSRestType;return I(r.typeAnnotation,t,"typeAnnotation",e,1),t}function Ffe(e,t,r=!1){let n={type:"TSNamedTupleMember",label:e,elementType:t,optional:r},s=X.TSNamedTupleMember;return I(s.label,n,"label",e,1),I(s.elementType,n,"elementType",t,1),I(s.optional,n,"optional",r),n}function jfe(e){let t={type:"TSUnionType",types:e},r=X.TSUnionType;return I(r.types,t,"types",e,1),t}function Bfe(e){let t={type:"TSIntersectionType",types:e},r=X.TSIntersectionType;return I(r.types,t,"types",e,1),t}function zfe(e,t,r,n){let s={type:"TSConditionalType",checkType:e,extendsType:t,trueType:r,falseType:n},a=X.TSConditionalType;return I(a.checkType,s,"checkType",e,1),I(a.extendsType,s,"extendsType",t,1),I(a.trueType,s,"trueType",r,1),I(a.falseType,s,"falseType",n,1),s}function Ufe(e){let t={type:"TSInferType",typeParameter:e},r=X.TSInferType;return I(r.typeParameter,t,"typeParameter",e,1),t}function qfe(e){let t={type:"TSParenthesizedType",typeAnnotation:e},r=X.TSParenthesizedType;return I(r.typeAnnotation,t,"typeAnnotation",e,1),t}function Wfe(e,t="keyof"){let r={type:"TSTypeOperator",typeAnnotation:e,operator:t},n=X.TSTypeOperator;return I(n.typeAnnotation,r,"typeAnnotation",e,1),I(n.operator,r,"operator",t),r}function Vfe(e,t){let r={type:"TSIndexedAccessType",objectType:e,indexType:t},n=X.TSIndexedAccessType;return I(n.objectType,r,"objectType",e,1),I(n.indexType,r,"indexType",t,1),r}function Kfe(e,t=null,r=null){let n={type:"TSMappedType",typeParameter:e,typeAnnotation:t,nameType:r},s=X.TSMappedType;return I(s.typeParameter,n,"typeParameter",e,1),I(s.typeAnnotation,n,"typeAnnotation",t,1),I(s.nameType,n,"nameType",r,1),n}function Gfe(e,t){let r={type:"TSTemplateLiteralType",quasis:e,types:t},n=X.TSTemplateLiteralType;return I(n.quasis,r,"quasis",e,1),I(n.types,r,"types",t,1),r}function Zfe(e){let t={type:"TSLiteralType",literal:e},r=X.TSLiteralType;return I(r.literal,t,"literal",e,1),t}function Hfe(e,t=null){let r={type:"TSExpressionWithTypeArguments",expression:e,typeParameters:t},n=X.TSExpressionWithTypeArguments;return I(n.expression,r,"expression",e,1),I(n.typeParameters,r,"typeParameters",t,1),r}function Jfe(e,t=null,r=null,n){let s={type:"TSInterfaceDeclaration",id:e,typeParameters:t,extends:r,body:n},a=X.TSInterfaceDeclaration;return I(a.id,s,"id",e,1),I(a.typeParameters,s,"typeParameters",t,1),I(a.extends,s,"extends",r,1),I(a.body,s,"body",n,1),s}function Yfe(e){let t={type:"TSInterfaceBody",body:e},r=X.TSInterfaceBody;return I(r.body,t,"body",e,1),t}function Xfe(e,t=null,r){let n={type:"TSTypeAliasDeclaration",id:e,typeParameters:t,typeAnnotation:r},s=X.TSTypeAliasDeclaration;return I(s.id,n,"id",e,1),I(s.typeParameters,n,"typeParameters",t,1),I(s.typeAnnotation,n,"typeAnnotation",r,1),n}function Qfe(e,t=null){let r={type:"TSInstantiationExpression",expression:e,typeParameters:t},n=X.TSInstantiationExpression;return I(n.expression,r,"expression",e,1),I(n.typeParameters,r,"typeParameters",t,1),r}function ehe(e,t){let r={type:"TSAsExpression",expression:e,typeAnnotation:t},n=X.TSAsExpression;return I(n.expression,r,"expression",e,1),I(n.typeAnnotation,r,"typeAnnotation",t,1),r}function the(e,t){let r={type:"TSSatisfiesExpression",expression:e,typeAnnotation:t},n=X.TSSatisfiesExpression;return I(n.expression,r,"expression",e,1),I(n.typeAnnotation,r,"typeAnnotation",t,1),r}function rhe(e,t){let r={type:"TSTypeAssertion",typeAnnotation:e,expression:t},n=X.TSTypeAssertion;return I(n.typeAnnotation,r,"typeAnnotation",e,1),I(n.expression,r,"expression",t,1),r}function nhe(e){let t={type:"TSEnumBody",members:e},r=X.TSEnumBody;return I(r.members,t,"members",e,1),t}function ihe(e,t){let r={type:"TSEnumDeclaration",id:e,members:t},n=X.TSEnumDeclaration;return I(n.id,r,"id",e,1),I(n.members,r,"members",t,1),r}function she(e,t=null){let r={type:"TSEnumMember",id:e,initializer:t},n=X.TSEnumMember;return I(n.id,r,"id",e,1),I(n.initializer,r,"initializer",t,1),r}function ahe(e,t){let r={type:"TSModuleDeclaration",id:e,body:t,kind:null},n=X.TSModuleDeclaration;return I(n.id,r,"id",e,1),I(n.body,r,"body",t,1),r}function ohe(e){let t={type:"TSModuleBlock",body:e},r=X.TSModuleBlock;return I(r.body,t,"body",e,1),t}function che(e,t=null,r=null){let n={type:"TSImportType",argument:e,qualifier:t,typeParameters:r},s=X.TSImportType;return I(s.argument,n,"argument",e,1),I(s.qualifier,n,"qualifier",t,1),I(s.typeParameters,n,"typeParameters",r,1),n}function lhe(e,t){let r={type:"TSImportEqualsDeclaration",id:e,moduleReference:t,isExport:null},n=X.TSImportEqualsDeclaration;return I(n.id,r,"id",e,1),I(n.moduleReference,r,"moduleReference",t,1),r}function uhe(e){let t={type:"TSExternalModuleReference",expression:e},r=X.TSExternalModuleReference;return I(r.expression,t,"expression",e,1),t}function dhe(e){let t={type:"TSNonNullExpression",expression:e},r=X.TSNonNullExpression;return I(r.expression,t,"expression",e,1),t}function phe(e){let t={type:"TSExportAssignment",expression:e},r=X.TSExportAssignment;return I(r.expression,t,"expression",e,1),t}function fhe(e){let t={type:"TSNamespaceExportDeclaration",id:e},r=X.TSNamespaceExportDeclaration;return I(r.id,t,"id",e,1),t}function hhe(e){let t={type:"TSTypeAnnotation",typeAnnotation:e},r=X.TSTypeAnnotation;return I(r.typeAnnotation,t,"typeAnnotation",e,1),t}function mhe(e){let t={type:"TSTypeParameterInstantiation",params:e},r=X.TSTypeParameterInstantiation;return I(r.params,t,"params",e,1),t}function ghe(e){let t={type:"TSTypeParameterDeclaration",params:e},r=X.TSTypeParameterDeclaration;return I(r.params,t,"params",e,1),t}function yhe(e=null,t=null,r){let n={type:"TSTypeParameter",constraint:e,default:t,name:r},s=X.TSTypeParameter;return I(s.constraint,n,"constraint",e,1),I(s.default,n,"default",t,1),I(s.name,n,"name",r),n}function _he(e){return(0,d_.default)("NumberLiteral","NumericLiteral","The node type "),bj(e)}function bhe(e,t=""){return(0,d_.default)("RegexLiteral","RegExpLiteral","The node type "),vj(e,t)}function vhe(e){return(0,d_.default)("RestProperty","RestElement","The node type "),xj(e)}function xhe(e){return(0,d_.default)("SpreadProperty","SpreadElement","The node type "),Sj(e)}});var Tj=G(T=>{"use strict";Object.defineProperty(T,"__esModule",{value:!0});T.JSXIdentifier=T.JSXFragment=T.JSXExpressionContainer=T.JSXEmptyExpression=T.JSXElement=T.JSXClosingFragment=T.JSXClosingElement=T.JSXAttribute=T.IntersectionTypeAnnotation=T.InterpreterDirective=T.InterfaceTypeAnnotation=T.InterfaceExtends=T.InterfaceDeclaration=T.InferredPredicate=T.IndexedAccessType=T.ImportSpecifier=T.ImportNamespaceSpecifier=T.ImportExpression=T.ImportDefaultSpecifier=T.ImportDeclaration=T.ImportAttribute=T.Import=T.IfStatement=T.Identifier=T.GenericTypeAnnotation=T.FunctionTypeParam=T.FunctionTypeAnnotation=T.FunctionExpression=T.FunctionDeclaration=T.ForStatement=T.ForOfStatement=T.ForInStatement=T.File=T.ExpressionStatement=T.ExportSpecifier=T.ExportNamespaceSpecifier=T.ExportNamedDeclaration=T.ExportDefaultSpecifier=T.ExportDefaultDeclaration=T.ExportAllDeclaration=T.ExistsTypeAnnotation=T.EnumSymbolBody=T.EnumStringMember=T.EnumStringBody=T.EnumNumberMember=T.EnumNumberBody=T.EnumDefaultedMember=T.EnumDeclaration=T.EnumBooleanMember=T.EnumBooleanBody=T.EmptyTypeAnnotation=T.EmptyStatement=T.DoWhileStatement=T.DoExpression=T.DirectiveLiteral=T.Directive=T.Decorator=T.DeclaredPredicate=T.DeclareVariable=T.DeclareTypeAlias=T.DeclareOpaqueType=T.DeclareModuleExports=T.DeclareModule=T.DeclareInterface=T.DeclareFunction=T.DeclareExportDeclaration=T.DeclareExportAllDeclaration=T.DeclareClass=T.DecimalLiteral=T.DebuggerStatement=T.ContinueStatement=T.ConditionalExpression=T.ClassProperty=T.ClassPrivateProperty=T.ClassPrivateMethod=T.ClassMethod=T.ClassImplements=T.ClassExpression=T.ClassDeclaration=T.ClassBody=T.ClassAccessorProperty=T.CatchClause=T.CallExpression=T.BreakStatement=T.BooleanTypeAnnotation=T.BooleanLiteralTypeAnnotation=T.BooleanLiteral=T.BlockStatement=T.BindExpression=T.BinaryExpression=T.BigIntLiteral=T.AwaitExpression=T.AssignmentPattern=T.AssignmentExpression=T.ArrowFunctionExpression=T.ArrayTypeAnnotation=T.ArrayPattern=T.ArrayExpression=T.ArgumentPlaceholder=T.AnyTypeAnnotation=void 0;T.TSNumberKeyword=T.TSNullKeyword=T.TSNonNullExpression=T.TSNeverKeyword=T.TSNamespaceExportDeclaration=T.TSNamedTupleMember=T.TSModuleDeclaration=T.TSModuleBlock=T.TSMethodSignature=T.TSMappedType=T.TSLiteralType=T.TSIntrinsicKeyword=T.TSIntersectionType=T.TSInterfaceDeclaration=T.TSInterfaceBody=T.TSInstantiationExpression=T.TSInferType=T.TSIndexedAccessType=T.TSIndexSignature=T.TSImportType=T.TSImportEqualsDeclaration=T.TSFunctionType=T.TSExternalModuleReference=T.TSExpressionWithTypeArguments=T.TSExportAssignment=T.TSEnumMember=T.TSEnumDeclaration=T.TSEnumBody=T.TSDeclareMethod=T.TSDeclareFunction=T.TSConstructorType=T.TSConstructSignatureDeclaration=T.TSConditionalType=T.TSCallSignatureDeclaration=T.TSBooleanKeyword=T.TSBigIntKeyword=T.TSAsExpression=T.TSArrayType=T.TSAnyKeyword=T.SymbolTypeAnnotation=T.SwitchStatement=T.SwitchCase=T.Super=T.StringTypeAnnotation=T.StringLiteralTypeAnnotation=T.StringLiteral=T.StaticBlock=T.SpreadProperty=T.SpreadElement=T.SequenceExpression=T.ReturnStatement=T.RestProperty=T.RestElement=T.RegexLiteral=T.RegExpLiteral=T.RecordExpression=T.QualifiedTypeIdentifier=T.Program=T.PrivateName=T.Placeholder=T.PipelineTopicExpression=T.PipelinePrimaryTopicReference=T.PipelineBareFunction=T.ParenthesizedExpression=T.OptionalMemberExpression=T.OptionalIndexedAccessType=T.OptionalCallExpression=T.OpaqueType=T.ObjectTypeSpreadProperty=T.ObjectTypeProperty=T.ObjectTypeInternalSlot=T.ObjectTypeIndexer=T.ObjectTypeCallProperty=T.ObjectTypeAnnotation=T.ObjectProperty=T.ObjectPattern=T.ObjectMethod=T.ObjectExpression=T.NumericLiteral=T.NumberTypeAnnotation=T.NumberLiteralTypeAnnotation=T.NumberLiteral=T.NullableTypeAnnotation=T.NullLiteralTypeAnnotation=T.NullLiteral=T.Noop=T.NewExpression=T.ModuleExpression=T.MixedTypeAnnotation=T.MetaProperty=T.MemberExpression=T.LogicalExpression=T.LabeledStatement=T.JSXText=T.JSXSpreadChild=T.JSXSpreadAttribute=T.JSXOpeningFragment=T.JSXOpeningElement=T.JSXNamespacedName=T.JSXMemberExpression=void 0;T.YieldExpression=T.WithStatement=T.WhileStatement=T.VoidTypeAnnotation=T.VoidPattern=T.Variance=T.VariableDeclarator=T.VariableDeclaration=T.V8IntrinsicIdentifier=T.UpdateExpression=T.UnionTypeAnnotation=T.UnaryExpression=T.TypeofTypeAnnotation=T.TypeParameterInstantiation=T.TypeParameterDeclaration=T.TypeParameter=T.TypeCastExpression=T.TypeAnnotation=T.TypeAlias=T.TupleTypeAnnotation=T.TupleExpression=T.TryStatement=T.TopicReference=T.ThrowStatement=T.ThisTypeAnnotation=T.ThisExpression=T.TemplateLiteral=T.TemplateElement=T.TaggedTemplateExpression=T.TSVoidKeyword=T.TSUnknownKeyword=T.TSUnionType=T.TSUndefinedKeyword=T.TSTypeReference=T.TSTypeQuery=T.TSTypePredicate=T.TSTypeParameterInstantiation=T.TSTypeParameterDeclaration=T.TSTypeParameter=T.TSTypeOperator=T.TSTypeLiteral=T.TSTypeAssertion=T.TSTypeAnnotation=T.TSTypeAliasDeclaration=T.TSTupleType=T.TSThisType=T.TSTemplateLiteralType=T.TSSymbolKeyword=T.TSStringKeyword=T.TSSatisfiesExpression=T.TSRestType=T.TSQualifiedName=T.TSPropertySignature=T.TSParenthesizedType=T.TSParameterProperty=T.TSOptionalType=T.TSObjectKeyword=void 0;var Rf=EI(),CXe=xu();function Z(e){return Rf[e]}var NXe=T.ArrayExpression=Z("arrayExpression"),OXe=T.AssignmentExpression=Z("assignmentExpression"),$Xe=T.BinaryExpression=Z("binaryExpression"),RXe=T.InterpreterDirective=Z("interpreterDirective"),DXe=T.Directive=Z("directive"),MXe=T.DirectiveLiteral=Z("directiveLiteral"),LXe=T.BlockStatement=Z("blockStatement"),FXe=T.BreakStatement=Z("breakStatement"),jXe=T.CallExpression=Z("callExpression"),BXe=T.CatchClause=Z("catchClause"),zXe=T.ConditionalExpression=Z("conditionalExpression"),UXe=T.ContinueStatement=Z("continueStatement"),qXe=T.DebuggerStatement=Z("debuggerStatement"),WXe=T.DoWhileStatement=Z("doWhileStatement"),VXe=T.EmptyStatement=Z("emptyStatement"),KXe=T.ExpressionStatement=Z("expressionStatement"),GXe=T.File=Z("file"),ZXe=T.ForInStatement=Z("forInStatement"),HXe=T.ForStatement=Z("forStatement"),JXe=T.FunctionDeclaration=Z("functionDeclaration"),YXe=T.FunctionExpression=Z("functionExpression"),XXe=T.Identifier=Z("identifier"),QXe=T.IfStatement=Z("ifStatement"),eQe=T.LabeledStatement=Z("labeledStatement"),tQe=T.StringLiteral=Z("stringLiteral"),rQe=T.NumericLiteral=Z("numericLiteral"),nQe=T.NullLiteral=Z("nullLiteral"),iQe=T.BooleanLiteral=Z("booleanLiteral"),sQe=T.RegExpLiteral=Z("regExpLiteral"),aQe=T.LogicalExpression=Z("logicalExpression"),oQe=T.MemberExpression=Z("memberExpression"),cQe=T.NewExpression=Z("newExpression"),lQe=T.Program=Z("program"),uQe=T.ObjectExpression=Z("objectExpression"),dQe=T.ObjectMethod=Z("objectMethod"),pQe=T.ObjectProperty=Z("objectProperty"),fQe=T.RestElement=Z("restElement"),hQe=T.ReturnStatement=Z("returnStatement"),mQe=T.SequenceExpression=Z("sequenceExpression"),gQe=T.ParenthesizedExpression=Z("parenthesizedExpression"),yQe=T.SwitchCase=Z("switchCase"),_Qe=T.SwitchStatement=Z("switchStatement"),bQe=T.ThisExpression=Z("thisExpression"),vQe=T.ThrowStatement=Z("throwStatement"),xQe=T.TryStatement=Z("tryStatement"),SQe=T.UnaryExpression=Z("unaryExpression"),TQe=T.UpdateExpression=Z("updateExpression"),wQe=T.VariableDeclaration=Z("variableDeclaration"),EQe=T.VariableDeclarator=Z("variableDeclarator"),PQe=T.WhileStatement=Z("whileStatement"),IQe=T.WithStatement=Z("withStatement"),AQe=T.AssignmentPattern=Z("assignmentPattern"),kQe=T.ArrayPattern=Z("arrayPattern"),CQe=T.ArrowFunctionExpression=Z("arrowFunctionExpression"),NQe=T.ClassBody=Z("classBody"),OQe=T.ClassExpression=Z("classExpression"),$Qe=T.ClassDeclaration=Z("classDeclaration"),RQe=T.ExportAllDeclaration=Z("exportAllDeclaration"),DQe=T.ExportDefaultDeclaration=Z("exportDefaultDeclaration"),MQe=T.ExportNamedDeclaration=Z("exportNamedDeclaration"),LQe=T.ExportSpecifier=Z("exportSpecifier"),FQe=T.ForOfStatement=Z("forOfStatement"),jQe=T.ImportDeclaration=Z("importDeclaration"),BQe=T.ImportDefaultSpecifier=Z("importDefaultSpecifier"),zQe=T.ImportNamespaceSpecifier=Z("importNamespaceSpecifier"),UQe=T.ImportSpecifier=Z("importSpecifier"),qQe=T.ImportExpression=Z("importExpression"),WQe=T.MetaProperty=Z("metaProperty"),VQe=T.ClassMethod=Z("classMethod"),KQe=T.ObjectPattern=Z("objectPattern"),GQe=T.SpreadElement=Z("spreadElement"),ZQe=T.Super=Z("super"),HQe=T.TaggedTemplateExpression=Z("taggedTemplateExpression"),JQe=T.TemplateElement=Z("templateElement"),YQe=T.TemplateLiteral=Z("templateLiteral"),XQe=T.YieldExpression=Z("yieldExpression"),QQe=T.AwaitExpression=Z("awaitExpression"),eet=T.Import=Z("import"),tet=T.BigIntLiteral=Z("bigIntLiteral"),ret=T.ExportNamespaceSpecifier=Z("exportNamespaceSpecifier"),net=T.OptionalMemberExpression=Z("optionalMemberExpression"),iet=T.OptionalCallExpression=Z("optionalCallExpression"),set=T.ClassProperty=Z("classProperty"),aet=T.ClassAccessorProperty=Z("classAccessorProperty"),oet=T.ClassPrivateProperty=Z("classPrivateProperty"),cet=T.ClassPrivateMethod=Z("classPrivateMethod"),uet=T.PrivateName=Z("privateName"),det=T.StaticBlock=Z("staticBlock"),pet=T.ImportAttribute=Z("importAttribute"),fet=T.AnyTypeAnnotation=Z("anyTypeAnnotation"),het=T.ArrayTypeAnnotation=Z("arrayTypeAnnotation"),met=T.BooleanTypeAnnotation=Z("booleanTypeAnnotation"),get=T.BooleanLiteralTypeAnnotation=Z("booleanLiteralTypeAnnotation"),yet=T.NullLiteralTypeAnnotation=Z("nullLiteralTypeAnnotation"),_et=T.ClassImplements=Z("classImplements"),bet=T.DeclareClass=Z("declareClass"),vet=T.DeclareFunction=Z("declareFunction"),xet=T.DeclareInterface=Z("declareInterface"),Tet=T.DeclareModule=Z("declareModule"),wet=T.DeclareModuleExports=Z("declareModuleExports"),Eet=T.DeclareTypeAlias=Z("declareTypeAlias"),Pet=T.DeclareOpaqueType=Z("declareOpaqueType"),Iet=T.DeclareVariable=Z("declareVariable"),Aet=T.DeclareExportDeclaration=Z("declareExportDeclaration"),ket=T.DeclareExportAllDeclaration=Z("declareExportAllDeclaration"),Cet=T.DeclaredPredicate=Z("declaredPredicate"),Net=T.ExistsTypeAnnotation=Z("existsTypeAnnotation"),Oet=T.FunctionTypeAnnotation=Z("functionTypeAnnotation"),$et=T.FunctionTypeParam=Z("functionTypeParam"),Ret=T.GenericTypeAnnotation=Z("genericTypeAnnotation"),Det=T.InferredPredicate=Z("inferredPredicate"),Met=T.InterfaceExtends=Z("interfaceExtends"),Let=T.InterfaceDeclaration=Z("interfaceDeclaration"),Fet=T.InterfaceTypeAnnotation=Z("interfaceTypeAnnotation"),jet=T.IntersectionTypeAnnotation=Z("intersectionTypeAnnotation"),Bet=T.MixedTypeAnnotation=Z("mixedTypeAnnotation"),zet=T.EmptyTypeAnnotation=Z("emptyTypeAnnotation"),Uet=T.NullableTypeAnnotation=Z("nullableTypeAnnotation"),qet=T.NumberLiteralTypeAnnotation=Z("numberLiteralTypeAnnotation"),Wet=T.NumberTypeAnnotation=Z("numberTypeAnnotation"),Vet=T.ObjectTypeAnnotation=Z("objectTypeAnnotation"),Ket=T.ObjectTypeInternalSlot=Z("objectTypeInternalSlot"),Get=T.ObjectTypeCallProperty=Z("objectTypeCallProperty"),Zet=T.ObjectTypeIndexer=Z("objectTypeIndexer"),Het=T.ObjectTypeProperty=Z("objectTypeProperty"),Jet=T.ObjectTypeSpreadProperty=Z("objectTypeSpreadProperty"),Yet=T.OpaqueType=Z("opaqueType"),Xet=T.QualifiedTypeIdentifier=Z("qualifiedTypeIdentifier"),Qet=T.StringLiteralTypeAnnotation=Z("stringLiteralTypeAnnotation"),ett=T.StringTypeAnnotation=Z("stringTypeAnnotation"),ttt=T.SymbolTypeAnnotation=Z("symbolTypeAnnotation"),rtt=T.ThisTypeAnnotation=Z("thisTypeAnnotation"),ntt=T.TupleTypeAnnotation=Z("tupleTypeAnnotation"),itt=T.TypeofTypeAnnotation=Z("typeofTypeAnnotation"),stt=T.TypeAlias=Z("typeAlias"),att=T.TypeAnnotation=Z("typeAnnotation"),ott=T.TypeCastExpression=Z("typeCastExpression"),ctt=T.TypeParameter=Z("typeParameter"),ltt=T.TypeParameterDeclaration=Z("typeParameterDeclaration"),utt=T.TypeParameterInstantiation=Z("typeParameterInstantiation"),dtt=T.UnionTypeAnnotation=Z("unionTypeAnnotation"),ptt=T.Variance=Z("variance"),ftt=T.VoidTypeAnnotation=Z("voidTypeAnnotation"),htt=T.EnumDeclaration=Z("enumDeclaration"),mtt=T.EnumBooleanBody=Z("enumBooleanBody"),gtt=T.EnumNumberBody=Z("enumNumberBody"),ytt=T.EnumStringBody=Z("enumStringBody"),_tt=T.EnumSymbolBody=Z("enumSymbolBody"),btt=T.EnumBooleanMember=Z("enumBooleanMember"),vtt=T.EnumNumberMember=Z("enumNumberMember"),xtt=T.EnumStringMember=Z("enumStringMember"),Stt=T.EnumDefaultedMember=Z("enumDefaultedMember"),Ttt=T.IndexedAccessType=Z("indexedAccessType"),wtt=T.OptionalIndexedAccessType=Z("optionalIndexedAccessType"),Ett=T.JSXAttribute=Z("jsxAttribute"),Ptt=T.JSXClosingElement=Z("jsxClosingElement"),Itt=T.JSXElement=Z("jsxElement"),Att=T.JSXEmptyExpression=Z("jsxEmptyExpression"),ktt=T.JSXExpressionContainer=Z("jsxExpressionContainer"),Ctt=T.JSXSpreadChild=Z("jsxSpreadChild"),Ntt=T.JSXIdentifier=Z("jsxIdentifier"),Ott=T.JSXMemberExpression=Z("jsxMemberExpression"),$tt=T.JSXNamespacedName=Z("jsxNamespacedName"),Rtt=T.JSXOpeningElement=Z("jsxOpeningElement"),Dtt=T.JSXSpreadAttribute=Z("jsxSpreadAttribute"),Mtt=T.JSXText=Z("jsxText"),Ltt=T.JSXFragment=Z("jsxFragment"),Ftt=T.JSXOpeningFragment=Z("jsxOpeningFragment"),jtt=T.JSXClosingFragment=Z("jsxClosingFragment"),Btt=T.Noop=Z("noop"),ztt=T.Placeholder=Z("placeholder"),Utt=T.V8IntrinsicIdentifier=Z("v8IntrinsicIdentifier"),qtt=T.ArgumentPlaceholder=Z("argumentPlaceholder"),Wtt=T.BindExpression=Z("bindExpression"),Vtt=T.Decorator=Z("decorator"),Ktt=T.DoExpression=Z("doExpression"),Gtt=T.ExportDefaultSpecifier=Z("exportDefaultSpecifier"),Ztt=T.RecordExpression=Z("recordExpression"),Htt=T.TupleExpression=Z("tupleExpression"),Jtt=T.DecimalLiteral=Z("decimalLiteral"),Ytt=T.ModuleExpression=Z("moduleExpression"),Xtt=T.TopicReference=Z("topicReference"),Qtt=T.PipelineTopicExpression=Z("pipelineTopicExpression"),ert=T.PipelineBareFunction=Z("pipelineBareFunction"),trt=T.PipelinePrimaryTopicReference=Z("pipelinePrimaryTopicReference"),rrt=T.VoidPattern=Z("voidPattern"),nrt=T.TSParameterProperty=Z("tsParameterProperty"),irt=T.TSDeclareFunction=Z("tsDeclareFunction"),srt=T.TSDeclareMethod=Z("tsDeclareMethod"),art=T.TSQualifiedName=Z("tsQualifiedName"),ort=T.TSCallSignatureDeclaration=Z("tsCallSignatureDeclaration"),crt=T.TSConstructSignatureDeclaration=Z("tsConstructSignatureDeclaration"),lrt=T.TSPropertySignature=Z("tsPropertySignature"),urt=T.TSMethodSignature=Z("tsMethodSignature"),drt=T.TSIndexSignature=Z("tsIndexSignature"),prt=T.TSAnyKeyword=Z("tsAnyKeyword"),frt=T.TSBooleanKeyword=Z("tsBooleanKeyword"),hrt=T.TSBigIntKeyword=Z("tsBigIntKeyword"),mrt=T.TSIntrinsicKeyword=Z("tsIntrinsicKeyword"),grt=T.TSNeverKeyword=Z("tsNeverKeyword"),yrt=T.TSNullKeyword=Z("tsNullKeyword"),_rt=T.TSNumberKeyword=Z("tsNumberKeyword"),brt=T.TSObjectKeyword=Z("tsObjectKeyword"),vrt=T.TSStringKeyword=Z("tsStringKeyword"),xrt=T.TSSymbolKeyword=Z("tsSymbolKeyword"),Srt=T.TSUndefinedKeyword=Z("tsUndefinedKeyword"),Trt=T.TSUnknownKeyword=Z("tsUnknownKeyword"),wrt=T.TSVoidKeyword=Z("tsVoidKeyword"),Ert=T.TSThisType=Z("tsThisType"),Prt=T.TSFunctionType=Z("tsFunctionType"),Irt=T.TSConstructorType=Z("tsConstructorType"),Art=T.TSTypeReference=Z("tsTypeReference"),krt=T.TSTypePredicate=Z("tsTypePredicate"),Crt=T.TSTypeQuery=Z("tsTypeQuery"),Nrt=T.TSTypeLiteral=Z("tsTypeLiteral"),Ort=T.TSArrayType=Z("tsArrayType"),$rt=T.TSTupleType=Z("tsTupleType"),Rrt=T.TSOptionalType=Z("tsOptionalType"),Drt=T.TSRestType=Z("tsRestType"),Mrt=T.TSNamedTupleMember=Z("tsNamedTupleMember"),Lrt=T.TSUnionType=Z("tsUnionType"),Frt=T.TSIntersectionType=Z("tsIntersectionType"),jrt=T.TSConditionalType=Z("tsConditionalType"),Brt=T.TSInferType=Z("tsInferType"),zrt=T.TSParenthesizedType=Z("tsParenthesizedType"),Urt=T.TSTypeOperator=Z("tsTypeOperator"),qrt=T.TSIndexedAccessType=Z("tsIndexedAccessType"),Wrt=T.TSMappedType=Z("tsMappedType"),Vrt=T.TSTemplateLiteralType=Z("tsTemplateLiteralType"),Krt=T.TSLiteralType=Z("tsLiteralType"),Grt=T.TSExpressionWithTypeArguments=Z("tsExpressionWithTypeArguments"),Zrt=T.TSInterfaceDeclaration=Z("tsInterfaceDeclaration"),Hrt=T.TSInterfaceBody=Z("tsInterfaceBody"),Jrt=T.TSTypeAliasDeclaration=Z("tsTypeAliasDeclaration"),Yrt=T.TSInstantiationExpression=Z("tsInstantiationExpression"),Xrt=T.TSAsExpression=Z("tsAsExpression"),Qrt=T.TSSatisfiesExpression=Z("tsSatisfiesExpression"),ent=T.TSTypeAssertion=Z("tsTypeAssertion"),tnt=T.TSEnumBody=Z("tsEnumBody"),rnt=T.TSEnumDeclaration=Z("tsEnumDeclaration"),nnt=T.TSEnumMember=Z("tsEnumMember"),int=T.TSModuleDeclaration=Z("tsModuleDeclaration"),snt=T.TSModuleBlock=Z("tsModuleBlock"),ant=T.TSImportType=Z("tsImportType"),ont=T.TSImportEqualsDeclaration=Z("tsImportEqualsDeclaration"),cnt=T.TSExternalModuleReference=Z("tsExternalModuleReference"),lnt=T.TSNonNullExpression=Z("tsNonNullExpression"),unt=T.TSExportAssignment=Z("tsExportAssignment"),dnt=T.TSNamespaceExportDeclaration=Z("tsNamespaceExportDeclaration"),pnt=T.TSTypeAnnotation=Z("tsTypeAnnotation"),fnt=T.TSTypeParameterInstantiation=Z("tsTypeParameterInstantiation"),hnt=T.TSTypeParameterDeclaration=Z("tsTypeParameterDeclaration"),mnt=T.TSTypeParameter=Z("tsTypeParameter"),gnt=T.NumberLiteral=Rf.numberLiteral,ynt=T.RegexLiteral=Rf.regexLiteral,_nt=T.RestProperty=Rf.restProperty,bnt=T.SpreadProperty=Rf.spreadProperty});var fi=G(vo=>{"use strict";Object.defineProperty(vo,"__esModule",{value:!0});var PI=EI();Object.keys(PI).forEach(function(e){e==="default"||e==="__esModule"||e in vo&&vo[e]===PI[e]||Object.defineProperty(vo,e,{enumerable:!0,get:function(){return PI[e]}})});var II=Tj();Object.keys(II).forEach(function(e){e==="default"||e==="__esModule"||e in vo&&vo[e]===II[e]||Object.defineProperty(vo,e,{enumerable:!0,get:function(){return II[e]}})})});var wj=G(AI=>{"use strict";Object.defineProperty(AI,"__esModule",{value:!0});AI.default=whe;var She=fi(),The=Rt();function whe(e,t){let r=e.value.split(/\r\n|\n|\r/),n=0;for(let a=0;a<r.length;a++)/[^ \t]/.exec(r[a])&&(n=a);let s="";for(let a=0;a<r.length;a++){let o=r[a],c=a===0,l=a===r.length-1,u=a===n,d=o.replace(/\t/g," ");c||(d=d.replace(/^ +/,"")),l||(d=d.replace(/ +$/,"")),d&&(u||(d+=" "),s+=d)}s&&t.push((0,The.inherits)((0,She.stringLiteral)(s),e))}});var Ej=G(CI=>{"use strict";Object.defineProperty(CI,"__esModule",{value:!0});CI.default=Phe;var kI=Vr(),Ehe=wj();function Phe(e){let t=[];for(let r=0;r<e.children.length;r++){let n=e.children[r];if((0,kI.isJSXText)(n)){(0,Ehe.default)(n,t);continue}(0,kI.isJSXExpressionContainer)(n)&&(n=n.expression),!(0,kI.isJSXEmptyExpression)(n)&&t.push(n)}return t}});var OI=G(NI=>{"use strict";Object.defineProperty(NI,"__esModule",{value:!0});NI.default=Ahe;var Ihe=Wi();function Ahe(e){return!!(e&&Ihe.VISITOR_KEYS[e.type])}});var Pj=G($I=>{"use strict";Object.defineProperty($I,"__esModule",{value:!0});$I.default=Che;var khe=OI();function Che(e){if(!(0,khe.default)(e)){var t;let r=(t=e?.type)!=null?t:JSON.stringify(e);throw new TypeError(`Not a valid node of type "${r}"`)}}});var Ij=G(F=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0});F.assertAccessor=Jbe;F.assertAnyTypeAnnotation=fge;F.assertArgumentPlaceholder=Uye;F.assertArrayExpression=Ohe;F.assertArrayPattern=Cme;F.assertArrayTypeAnnotation=hge;F.assertArrowFunctionExpression=Nme;F.assertAssignmentExpression=$he;F.assertAssignmentPattern=kme;F.assertAwaitExpression=ege;F.assertBigIntLiteral=rge;F.assertBinary=ybe;F.assertBinaryExpression=Rhe;F.assertBindExpression=qye;F.assertBlock=vbe;F.assertBlockParent=bbe;F.assertBlockStatement=Fhe;F.assertBooleanLiteral=sme;F.assertBooleanLiteralTypeAnnotation=gge;F.assertBooleanTypeAnnotation=mge;F.assertBreakStatement=jhe;F.assertCallExpression=Bhe;F.assertCatchClause=zhe;F.assertClass=Kbe;F.assertClassAccessorProperty=oge;F.assertClassBody=Ome;F.assertClassDeclaration=Rme;F.assertClassExpression=$me;F.assertClassImplements=_ge;F.assertClassMethod=Kme;F.assertClassPrivateMethod=lge;F.assertClassPrivateProperty=cge;F.assertClassProperty=age;F.assertCompletionStatement=Tbe;F.assertConditional=wbe;F.assertConditionalExpression=Uhe;F.assertContinueStatement=qhe;F.assertDebuggerStatement=Whe;F.assertDecimalLiteral=Hye;F.assertDeclaration=$be;F.assertDeclareClass=bge;F.assertDeclareExportAllDeclaration=Age;F.assertDeclareExportDeclaration=Ige;F.assertDeclareFunction=vge;F.assertDeclareInterface=xge;F.assertDeclareModule=Sge;F.assertDeclareModuleExports=Tge;F.assertDeclareOpaqueType=Ege;F.assertDeclareTypeAlias=wge;F.assertDeclareVariable=Pge;F.assertDeclaredPredicate=kge;F.assertDecorator=Wye;F.assertDirective=Mhe;F.assertDirectiveLiteral=Lhe;F.assertDoExpression=Vye;F.assertDoWhileStatement=Vhe;F.assertEmptyStatement=Khe;F.assertEmptyTypeAnnotation=Bge;F.assertEnumBody=nve;F.assertEnumBooleanBody=hye;F.assertEnumBooleanMember=_ye;F.assertEnumDeclaration=fye;F.assertEnumDefaultedMember=xye;F.assertEnumMember=ive;F.assertEnumNumberBody=mye;F.assertEnumNumberMember=bye;F.assertEnumStringBody=gye;F.assertEnumStringMember=vye;F.assertEnumSymbolBody=yye;F.assertExistsTypeAnnotation=Cge;F.assertExportAllDeclaration=Dme;F.assertExportDeclaration=Zbe;F.assertExportDefaultDeclaration=Mme;F.assertExportDefaultSpecifier=Kye;F.assertExportNamedDeclaration=Lme;F.assertExportNamespaceSpecifier=nge;F.assertExportSpecifier=Fme;F.assertExpression=gbe;F.assertExpressionStatement=Ghe;F.assertExpressionWrapper=Ibe;F.assertFile=Zhe;F.assertFlow=Xbe;F.assertFlowBaseAnnotation=eve;F.assertFlowDeclaration=tve;F.assertFlowPredicate=rve;F.assertFlowType=Qbe;F.assertFor=Abe;F.assertForInStatement=Hhe;F.assertForOfStatement=jme;F.assertForStatement=Jhe;F.assertForXStatement=kbe;F.assertFunction=Cbe;F.assertFunctionDeclaration=Yhe;F.assertFunctionExpression=Xhe;F.assertFunctionParameter=Rbe;F.assertFunctionParent=Nbe;F.assertFunctionTypeAnnotation=Nge;F.assertFunctionTypeParam=Oge;F.assertGenericTypeAnnotation=$ge;F.assertIdentifier=Qhe;F.assertIfStatement=eme;F.assertImmutable=jbe;F.assertImport=tge;F.assertImportAttribute=pge;F.assertImportDeclaration=Bme;F.assertImportDefaultSpecifier=zme;F.assertImportExpression=Wme;F.assertImportNamespaceSpecifier=Ume;F.assertImportOrExportDeclaration=Gbe;F.assertImportSpecifier=qme;F.assertIndexedAccessType=Sye;F.assertInferredPredicate=Rge;F.assertInterfaceDeclaration=Mge;F.assertInterfaceExtends=Dge;F.assertInterfaceTypeAnnotation=Lge;F.assertInterpreterDirective=Dhe;F.assertIntersectionTypeAnnotation=Fge;F.assertJSX=sve;F.assertJSXAttribute=wye;F.assertJSXClosingElement=Eye;F.assertJSXClosingFragment=Fye;F.assertJSXElement=Pye;F.assertJSXEmptyExpression=Iye;F.assertJSXExpressionContainer=Aye;F.assertJSXFragment=Mye;F.assertJSXIdentifier=Cye;F.assertJSXMemberExpression=Nye;F.assertJSXNamespacedName=Oye;F.assertJSXOpeningElement=$ye;F.assertJSXOpeningFragment=Lye;F.assertJSXSpreadAttribute=Rye;F.assertJSXSpreadChild=kye;F.assertJSXText=Dye;F.assertLVal=Mbe;F.assertLabeledStatement=tme;F.assertLiteral=Fbe;F.assertLogicalExpression=ome;F.assertLoop=Ebe;F.assertMemberExpression=cme;F.assertMetaProperty=Vme;F.assertMethod=zbe;F.assertMiscellaneous=ave;F.assertMixedTypeAnnotation=jge;F.assertModuleDeclaration=mve;F.assertModuleExpression=Jye;F.assertModuleSpecifier=Hbe;F.assertNewExpression=lme;F.assertNoop=jye;F.assertNullLiteral=ime;F.assertNullLiteralTypeAnnotation=yge;F.assertNullableTypeAnnotation=zge;F.assertNumberLiteral=dve;F.assertNumberLiteralTypeAnnotation=Uge;F.assertNumberTypeAnnotation=qge;F.assertNumericLiteral=nme;F.assertObjectExpression=dme;F.assertObjectMember=Ube;F.assertObjectMethod=pme;F.assertObjectPattern=Gme;F.assertObjectProperty=fme;F.assertObjectTypeAnnotation=Wge;F.assertObjectTypeCallProperty=Kge;F.assertObjectTypeIndexer=Gge;F.assertObjectTypeInternalSlot=Vge;F.assertObjectTypeProperty=Zge;F.assertObjectTypeSpreadProperty=Hge;F.assertOpaqueType=Jge;F.assertOptionalCallExpression=sge;F.assertOptionalIndexedAccessType=Tye;F.assertOptionalMemberExpression=ige;F.assertParenthesizedExpression=yme;F.assertPattern=Vbe;F.assertPatternLike=Dbe;F.assertPipelineBareFunction=Qye;F.assertPipelinePrimaryTopicReference=e_e;F.assertPipelineTopicExpression=Xye;F.assertPlaceholder=Bye;F.assertPrivate=Ybe;F.assertPrivateName=uge;F.assertProgram=ume;F.assertProperty=qbe;F.assertPureish=Obe;F.assertQualifiedTypeIdentifier=Yge;F.assertRecordExpression=Gye;F.assertRegExpLiteral=ame;F.assertRegexLiteral=pve;F.assertRestElement=hme;F.assertRestProperty=fve;F.assertReturnStatement=mme;F.assertScopable=_be;F.assertSequenceExpression=gme;F.assertSpreadElement=Zme;F.assertSpreadProperty=hve;F.assertStandardized=mbe;F.assertStatement=xbe;F.assertStaticBlock=dge;F.assertStringLiteral=rme;F.assertStringLiteralTypeAnnotation=Xge;F.assertStringTypeAnnotation=Qge;F.assertSuper=Hme;F.assertSwitchCase=_me;F.assertSwitchStatement=bme;F.assertSymbolTypeAnnotation=eye;F.assertTSAnyKeyword=d_e;F.assertTSArrayType=N_e;F.assertTSAsExpression=Y_e;F.assertTSBaseType=uve;F.assertTSBigIntKeyword=f_e;F.assertTSBooleanKeyword=p_e;F.assertTSCallSignatureDeclaration=a_e;F.assertTSConditionalType=F_e;F.assertTSConstructSignatureDeclaration=o_e;F.assertTSConstructorType=P_e;F.assertTSDeclareFunction=n_e;F.assertTSDeclareMethod=i_e;F.assertTSEntityName=Lbe;F.assertTSEnumBody=ebe;F.assertTSEnumDeclaration=tbe;F.assertTSEnumMember=rbe;F.assertTSExportAssignment=lbe;F.assertTSExpressionWithTypeArguments=K_e;F.assertTSExternalModuleReference=obe;F.assertTSFunctionType=E_e;F.assertTSImportEqualsDeclaration=abe;F.assertTSImportType=sbe;F.assertTSIndexSignature=u_e;F.assertTSIndexedAccessType=U_e;F.assertTSInferType=j_e;F.assertTSInstantiationExpression=J_e;F.assertTSInterfaceBody=Z_e;F.assertTSInterfaceDeclaration=G_e;F.assertTSIntersectionType=L_e;F.assertTSIntrinsicKeyword=h_e;F.assertTSLiteralType=V_e;F.assertTSMappedType=q_e;F.assertTSMethodSignature=l_e;F.assertTSModuleBlock=ibe;F.assertTSModuleDeclaration=nbe;F.assertTSNamedTupleMember=D_e;F.assertTSNamespaceExportDeclaration=ube;F.assertTSNeverKeyword=m_e;F.assertTSNonNullExpression=cbe;F.assertTSNullKeyword=g_e;F.assertTSNumberKeyword=y_e;F.assertTSObjectKeyword=__e;F.assertTSOptionalType=$_e;F.assertTSParameterProperty=r_e;F.assertTSParenthesizedType=B_e;F.assertTSPropertySignature=c_e;F.assertTSQualifiedName=s_e;F.assertTSRestType=R_e;F.assertTSSatisfiesExpression=X_e;F.assertTSStringKeyword=b_e;F.assertTSSymbolKeyword=v_e;F.assertTSTemplateLiteralType=W_e;F.assertTSThisType=w_e;F.assertTSTupleType=O_e;F.assertTSType=lve;F.assertTSTypeAliasDeclaration=H_e;F.assertTSTypeAnnotation=dbe;F.assertTSTypeAssertion=Q_e;F.assertTSTypeElement=cve;F.assertTSTypeLiteral=C_e;F.assertTSTypeOperator=z_e;F.assertTSTypeParameter=hbe;F.assertTSTypeParameterDeclaration=fbe;F.assertTSTypeParameterInstantiation=pbe;F.assertTSTypePredicate=A_e;F.assertTSTypeQuery=k_e;F.assertTSTypeReference=I_e;F.assertTSUndefinedKeyword=x_e;F.assertTSUnionType=M_e;F.assertTSUnknownKeyword=S_e;F.assertTSVoidKeyword=T_e;F.assertTaggedTemplateExpression=Jme;F.assertTemplateElement=Yme;F.assertTemplateLiteral=Xme;F.assertTerminatorless=Sbe;F.assertThisExpression=vme;F.assertThisTypeAnnotation=tye;F.assertThrowStatement=xme;F.assertTopicReference=Yye;F.assertTryStatement=Sme;F.assertTupleExpression=Zye;F.assertTupleTypeAnnotation=rye;F.assertTypeAlias=iye;F.assertTypeAnnotation=sye;F.assertTypeCastExpression=aye;F.assertTypeParameter=oye;F.assertTypeParameterDeclaration=cye;F.assertTypeParameterInstantiation=lye;F.assertTypeScript=ove;F.assertTypeofTypeAnnotation=nye;F.assertUnaryExpression=Tme;F.assertUnaryLike=Wbe;F.assertUnionTypeAnnotation=uye;F.assertUpdateExpression=wme;F.assertUserWhitespacable=Bbe;F.assertV8IntrinsicIdentifier=zye;F.assertVariableDeclaration=Eme;F.assertVariableDeclarator=Pme;F.assertVariance=dye;F.assertVoidPattern=t_e;F.assertVoidTypeAnnotation=pye;F.assertWhile=Pbe;F.assertWhileStatement=Ime;F.assertWithStatement=Ame;F.assertYieldExpression=Qme;var Nhe=Su(),Df=xu();function j(e,t,r){if(!(0,Nhe.default)(e,t,r))throw new Error(`Expected type "${e}" with option ${JSON.stringify(r)}, but instead got "${t.type}".`)}function Ohe(e,t){j("ArrayExpression",e,t)}function $he(e,t){j("AssignmentExpression",e,t)}function Rhe(e,t){j("BinaryExpression",e,t)}function Dhe(e,t){j("InterpreterDirective",e,t)}function Mhe(e,t){j("Directive",e,t)}function Lhe(e,t){j("DirectiveLiteral",e,t)}function Fhe(e,t){j("BlockStatement",e,t)}function jhe(e,t){j("BreakStatement",e,t)}function Bhe(e,t){j("CallExpression",e,t)}function zhe(e,t){j("CatchClause",e,t)}function Uhe(e,t){j("ConditionalExpression",e,t)}function qhe(e,t){j("ContinueStatement",e,t)}function Whe(e,t){j("DebuggerStatement",e,t)}function Vhe(e,t){j("DoWhileStatement",e,t)}function Khe(e,t){j("EmptyStatement",e,t)}function Ghe(e,t){j("ExpressionStatement",e,t)}function Zhe(e,t){j("File",e,t)}function Hhe(e,t){j("ForInStatement",e,t)}function Jhe(e,t){j("ForStatement",e,t)}function Yhe(e,t){j("FunctionDeclaration",e,t)}function Xhe(e,t){j("FunctionExpression",e,t)}function Qhe(e,t){j("Identifier",e,t)}function eme(e,t){j("IfStatement",e,t)}function tme(e,t){j("LabeledStatement",e,t)}function rme(e,t){j("StringLiteral",e,t)}function nme(e,t){j("NumericLiteral",e,t)}function ime(e,t){j("NullLiteral",e,t)}function sme(e,t){j("BooleanLiteral",e,t)}function ame(e,t){j("RegExpLiteral",e,t)}function ome(e,t){j("LogicalExpression",e,t)}function cme(e,t){j("MemberExpression",e,t)}function lme(e,t){j("NewExpression",e,t)}function ume(e,t){j("Program",e,t)}function dme(e,t){j("ObjectExpression",e,t)}function pme(e,t){j("ObjectMethod",e,t)}function fme(e,t){j("ObjectProperty",e,t)}function hme(e,t){j("RestElement",e,t)}function mme(e,t){j("ReturnStatement",e,t)}function gme(e,t){j("SequenceExpression",e,t)}function yme(e,t){j("ParenthesizedExpression",e,t)}function _me(e,t){j("SwitchCase",e,t)}function bme(e,t){j("SwitchStatement",e,t)}function vme(e,t){j("ThisExpression",e,t)}function xme(e,t){j("ThrowStatement",e,t)}function Sme(e,t){j("TryStatement",e,t)}function Tme(e,t){j("UnaryExpression",e,t)}function wme(e,t){j("UpdateExpression",e,t)}function Eme(e,t){j("VariableDeclaration",e,t)}function Pme(e,t){j("VariableDeclarator",e,t)}function Ime(e,t){j("WhileStatement",e,t)}function Ame(e,t){j("WithStatement",e,t)}function kme(e,t){j("AssignmentPattern",e,t)}function Cme(e,t){j("ArrayPattern",e,t)}function Nme(e,t){j("ArrowFunctionExpression",e,t)}function Ome(e,t){j("ClassBody",e,t)}function $me(e,t){j("ClassExpression",e,t)}function Rme(e,t){j("ClassDeclaration",e,t)}function Dme(e,t){j("ExportAllDeclaration",e,t)}function Mme(e,t){j("ExportDefaultDeclaration",e,t)}function Lme(e,t){j("ExportNamedDeclaration",e,t)}function Fme(e,t){j("ExportSpecifier",e,t)}function jme(e,t){j("ForOfStatement",e,t)}function Bme(e,t){j("ImportDeclaration",e,t)}function zme(e,t){j("ImportDefaultSpecifier",e,t)}function Ume(e,t){j("ImportNamespaceSpecifier",e,t)}function qme(e,t){j("ImportSpecifier",e,t)}function Wme(e,t){j("ImportExpression",e,t)}function Vme(e,t){j("MetaProperty",e,t)}function Kme(e,t){j("ClassMethod",e,t)}function Gme(e,t){j("ObjectPattern",e,t)}function Zme(e,t){j("SpreadElement",e,t)}function Hme(e,t){j("Super",e,t)}function Jme(e,t){j("TaggedTemplateExpression",e,t)}function Yme(e,t){j("TemplateElement",e,t)}function Xme(e,t){j("TemplateLiteral",e,t)}function Qme(e,t){j("YieldExpression",e,t)}function ege(e,t){j("AwaitExpression",e,t)}function tge(e,t){j("Import",e,t)}function rge(e,t){j("BigIntLiteral",e,t)}function nge(e,t){j("ExportNamespaceSpecifier",e,t)}function ige(e,t){j("OptionalMemberExpression",e,t)}function sge(e,t){j("OptionalCallExpression",e,t)}function age(e,t){j("ClassProperty",e,t)}function oge(e,t){j("ClassAccessorProperty",e,t)}function cge(e,t){j("ClassPrivateProperty",e,t)}function lge(e,t){j("ClassPrivateMethod",e,t)}function uge(e,t){j("PrivateName",e,t)}function dge(e,t){j("StaticBlock",e,t)}function pge(e,t){j("ImportAttribute",e,t)}function fge(e,t){j("AnyTypeAnnotation",e,t)}function hge(e,t){j("ArrayTypeAnnotation",e,t)}function mge(e,t){j("BooleanTypeAnnotation",e,t)}function gge(e,t){j("BooleanLiteralTypeAnnotation",e,t)}function yge(e,t){j("NullLiteralTypeAnnotation",e,t)}function _ge(e,t){j("ClassImplements",e,t)}function bge(e,t){j("DeclareClass",e,t)}function vge(e,t){j("DeclareFunction",e,t)}function xge(e,t){j("DeclareInterface",e,t)}function Sge(e,t){j("DeclareModule",e,t)}function Tge(e,t){j("DeclareModuleExports",e,t)}function wge(e,t){j("DeclareTypeAlias",e,t)}function Ege(e,t){j("DeclareOpaqueType",e,t)}function Pge(e,t){j("DeclareVariable",e,t)}function Ige(e,t){j("DeclareExportDeclaration",e,t)}function Age(e,t){j("DeclareExportAllDeclaration",e,t)}function kge(e,t){j("DeclaredPredicate",e,t)}function Cge(e,t){j("ExistsTypeAnnotation",e,t)}function Nge(e,t){j("FunctionTypeAnnotation",e,t)}function Oge(e,t){j("FunctionTypeParam",e,t)}function $ge(e,t){j("GenericTypeAnnotation",e,t)}function Rge(e,t){j("InferredPredicate",e,t)}function Dge(e,t){j("InterfaceExtends",e,t)}function Mge(e,t){j("InterfaceDeclaration",e,t)}function Lge(e,t){j("InterfaceTypeAnnotation",e,t)}function Fge(e,t){j("IntersectionTypeAnnotation",e,t)}function jge(e,t){j("MixedTypeAnnotation",e,t)}function Bge(e,t){j("EmptyTypeAnnotation",e,t)}function zge(e,t){j("NullableTypeAnnotation",e,t)}function Uge(e,t){j("NumberLiteralTypeAnnotation",e,t)}function qge(e,t){j("NumberTypeAnnotation",e,t)}function Wge(e,t){j("ObjectTypeAnnotation",e,t)}function Vge(e,t){j("ObjectTypeInternalSlot",e,t)}function Kge(e,t){j("ObjectTypeCallProperty",e,t)}function Gge(e,t){j("ObjectTypeIndexer",e,t)}function Zge(e,t){j("ObjectTypeProperty",e,t)}function Hge(e,t){j("ObjectTypeSpreadProperty",e,t)}function Jge(e,t){j("OpaqueType",e,t)}function Yge(e,t){j("QualifiedTypeIdentifier",e,t)}function Xge(e,t){j("StringLiteralTypeAnnotation",e,t)}function Qge(e,t){j("StringTypeAnnotation",e,t)}function eye(e,t){j("SymbolTypeAnnotation",e,t)}function tye(e,t){j("ThisTypeAnnotation",e,t)}function rye(e,t){j("TupleTypeAnnotation",e,t)}function nye(e,t){j("TypeofTypeAnnotation",e,t)}function iye(e,t){j("TypeAlias",e,t)}function sye(e,t){j("TypeAnnotation",e,t)}function aye(e,t){j("TypeCastExpression",e,t)}function oye(e,t){j("TypeParameter",e,t)}function cye(e,t){j("TypeParameterDeclaration",e,t)}function lye(e,t){j("TypeParameterInstantiation",e,t)}function uye(e,t){j("UnionTypeAnnotation",e,t)}function dye(e,t){j("Variance",e,t)}function pye(e,t){j("VoidTypeAnnotation",e,t)}function fye(e,t){j("EnumDeclaration",e,t)}function hye(e,t){j("EnumBooleanBody",e,t)}function mye(e,t){j("EnumNumberBody",e,t)}function gye(e,t){j("EnumStringBody",e,t)}function yye(e,t){j("EnumSymbolBody",e,t)}function _ye(e,t){j("EnumBooleanMember",e,t)}function bye(e,t){j("EnumNumberMember",e,t)}function vye(e,t){j("EnumStringMember",e,t)}function xye(e,t){j("EnumDefaultedMember",e,t)}function Sye(e,t){j("IndexedAccessType",e,t)}function Tye(e,t){j("OptionalIndexedAccessType",e,t)}function wye(e,t){j("JSXAttribute",e,t)}function Eye(e,t){j("JSXClosingElement",e,t)}function Pye(e,t){j("JSXElement",e,t)}function Iye(e,t){j("JSXEmptyExpression",e,t)}function Aye(e,t){j("JSXExpressionContainer",e,t)}function kye(e,t){j("JSXSpreadChild",e,t)}function Cye(e,t){j("JSXIdentifier",e,t)}function Nye(e,t){j("JSXMemberExpression",e,t)}function Oye(e,t){j("JSXNamespacedName",e,t)}function $ye(e,t){j("JSXOpeningElement",e,t)}function Rye(e,t){j("JSXSpreadAttribute",e,t)}function Dye(e,t){j("JSXText",e,t)}function Mye(e,t){j("JSXFragment",e,t)}function Lye(e,t){j("JSXOpeningFragment",e,t)}function Fye(e,t){j("JSXClosingFragment",e,t)}function jye(e,t){j("Noop",e,t)}function Bye(e,t){j("Placeholder",e,t)}function zye(e,t){j("V8IntrinsicIdentifier",e,t)}function Uye(e,t){j("ArgumentPlaceholder",e,t)}function qye(e,t){j("BindExpression",e,t)}function Wye(e,t){j("Decorator",e,t)}function Vye(e,t){j("DoExpression",e,t)}function Kye(e,t){j("ExportDefaultSpecifier",e,t)}function Gye(e,t){j("RecordExpression",e,t)}function Zye(e,t){j("TupleExpression",e,t)}function Hye(e,t){j("DecimalLiteral",e,t)}function Jye(e,t){j("ModuleExpression",e,t)}function Yye(e,t){j("TopicReference",e,t)}function Xye(e,t){j("PipelineTopicExpression",e,t)}function Qye(e,t){j("PipelineBareFunction",e,t)}function e_e(e,t){j("PipelinePrimaryTopicReference",e,t)}function t_e(e,t){j("VoidPattern",e,t)}function r_e(e,t){j("TSParameterProperty",e,t)}function n_e(e,t){j("TSDeclareFunction",e,t)}function i_e(e,t){j("TSDeclareMethod",e,t)}function s_e(e,t){j("TSQualifiedName",e,t)}function a_e(e,t){j("TSCallSignatureDeclaration",e,t)}function o_e(e,t){j("TSConstructSignatureDeclaration",e,t)}function c_e(e,t){j("TSPropertySignature",e,t)}function l_e(e,t){j("TSMethodSignature",e,t)}function u_e(e,t){j("TSIndexSignature",e,t)}function d_e(e,t){j("TSAnyKeyword",e,t)}function p_e(e,t){j("TSBooleanKeyword",e,t)}function f_e(e,t){j("TSBigIntKeyword",e,t)}function h_e(e,t){j("TSIntrinsicKeyword",e,t)}function m_e(e,t){j("TSNeverKeyword",e,t)}function g_e(e,t){j("TSNullKeyword",e,t)}function y_e(e,t){j("TSNumberKeyword",e,t)}function __e(e,t){j("TSObjectKeyword",e,t)}function b_e(e,t){j("TSStringKeyword",e,t)}function v_e(e,t){j("TSSymbolKeyword",e,t)}function x_e(e,t){j("TSUndefinedKeyword",e,t)}function S_e(e,t){j("TSUnknownKeyword",e,t)}function T_e(e,t){j("TSVoidKeyword",e,t)}function w_e(e,t){j("TSThisType",e,t)}function E_e(e,t){j("TSFunctionType",e,t)}function P_e(e,t){j("TSConstructorType",e,t)}function I_e(e,t){j("TSTypeReference",e,t)}function A_e(e,t){j("TSTypePredicate",e,t)}function k_e(e,t){j("TSTypeQuery",e,t)}function C_e(e,t){j("TSTypeLiteral",e,t)}function N_e(e,t){j("TSArrayType",e,t)}function O_e(e,t){j("TSTupleType",e,t)}function $_e(e,t){j("TSOptionalType",e,t)}function R_e(e,t){j("TSRestType",e,t)}function D_e(e,t){j("TSNamedTupleMember",e,t)}function M_e(e,t){j("TSUnionType",e,t)}function L_e(e,t){j("TSIntersectionType",e,t)}function F_e(e,t){j("TSConditionalType",e,t)}function j_e(e,t){j("TSInferType",e,t)}function B_e(e,t){j("TSParenthesizedType",e,t)}function z_e(e,t){j("TSTypeOperator",e,t)}function U_e(e,t){j("TSIndexedAccessType",e,t)}function q_e(e,t){j("TSMappedType",e,t)}function W_e(e,t){j("TSTemplateLiteralType",e,t)}function V_e(e,t){j("TSLiteralType",e,t)}function K_e(e,t){j("TSExpressionWithTypeArguments",e,t)}function G_e(e,t){j("TSInterfaceDeclaration",e,t)}function Z_e(e,t){j("TSInterfaceBody",e,t)}function H_e(e,t){j("TSTypeAliasDeclaration",e,t)}function J_e(e,t){j("TSInstantiationExpression",e,t)}function Y_e(e,t){j("TSAsExpression",e,t)}function X_e(e,t){j("TSSatisfiesExpression",e,t)}function Q_e(e,t){j("TSTypeAssertion",e,t)}function ebe(e,t){j("TSEnumBody",e,t)}function tbe(e,t){j("TSEnumDeclaration",e,t)}function rbe(e,t){j("TSEnumMember",e,t)}function nbe(e,t){j("TSModuleDeclaration",e,t)}function ibe(e,t){j("TSModuleBlock",e,t)}function sbe(e,t){j("TSImportType",e,t)}function abe(e,t){j("TSImportEqualsDeclaration",e,t)}function obe(e,t){j("TSExternalModuleReference",e,t)}function cbe(e,t){j("TSNonNullExpression",e,t)}function lbe(e,t){j("TSExportAssignment",e,t)}function ube(e,t){j("TSNamespaceExportDeclaration",e,t)}function dbe(e,t){j("TSTypeAnnotation",e,t)}function pbe(e,t){j("TSTypeParameterInstantiation",e,t)}function fbe(e,t){j("TSTypeParameterDeclaration",e,t)}function hbe(e,t){j("TSTypeParameter",e,t)}function mbe(e,t){j("Standardized",e,t)}function gbe(e,t){j("Expression",e,t)}function ybe(e,t){j("Binary",e,t)}function _be(e,t){j("Scopable",e,t)}function bbe(e,t){j("BlockParent",e,t)}function vbe(e,t){j("Block",e,t)}function xbe(e,t){j("Statement",e,t)}function Sbe(e,t){j("Terminatorless",e,t)}function Tbe(e,t){j("CompletionStatement",e,t)}function wbe(e,t){j("Conditional",e,t)}function Ebe(e,t){j("Loop",e,t)}function Pbe(e,t){j("While",e,t)}function Ibe(e,t){j("ExpressionWrapper",e,t)}function Abe(e,t){j("For",e,t)}function kbe(e,t){j("ForXStatement",e,t)}function Cbe(e,t){j("Function",e,t)}function Nbe(e,t){j("FunctionParent",e,t)}function Obe(e,t){j("Pureish",e,t)}function $be(e,t){j("Declaration",e,t)}function Rbe(e,t){j("FunctionParameter",e,t)}function Dbe(e,t){j("PatternLike",e,t)}function Mbe(e,t){j("LVal",e,t)}function Lbe(e,t){j("TSEntityName",e,t)}function Fbe(e,t){j("Literal",e,t)}function jbe(e,t){j("Immutable",e,t)}function Bbe(e,t){j("UserWhitespacable",e,t)}function zbe(e,t){j("Method",e,t)}function Ube(e,t){j("ObjectMember",e,t)}function qbe(e,t){j("Property",e,t)}function Wbe(e,t){j("UnaryLike",e,t)}function Vbe(e,t){j("Pattern",e,t)}function Kbe(e,t){j("Class",e,t)}function Gbe(e,t){j("ImportOrExportDeclaration",e,t)}function Zbe(e,t){j("ExportDeclaration",e,t)}function Hbe(e,t){j("ModuleSpecifier",e,t)}function Jbe(e,t){j("Accessor",e,t)}function Ybe(e,t){j("Private",e,t)}function Xbe(e,t){j("Flow",e,t)}function Qbe(e,t){j("FlowType",e,t)}function eve(e,t){j("FlowBaseAnnotation",e,t)}function tve(e,t){j("FlowDeclaration",e,t)}function rve(e,t){j("FlowPredicate",e,t)}function nve(e,t){j("EnumBody",e,t)}function ive(e,t){j("EnumMember",e,t)}function sve(e,t){j("JSX",e,t)}function ave(e,t){j("Miscellaneous",e,t)}function ove(e,t){j("TypeScript",e,t)}function cve(e,t){j("TSTypeElement",e,t)}function lve(e,t){j("TSType",e,t)}function uve(e,t){j("TSBaseType",e,t)}function dve(e,t){(0,Df.default)("assertNumberLiteral","assertNumericLiteral"),j("NumberLiteral",e,t)}function pve(e,t){(0,Df.default)("assertRegexLiteral","assertRegExpLiteral"),j("RegexLiteral",e,t)}function fve(e,t){(0,Df.default)("assertRestProperty","assertRestElement"),j("RestProperty",e,t)}function hve(e,t){(0,Df.default)("assertSpreadProperty","assertSpreadElement"),j("SpreadProperty",e,t)}function mve(e,t){(0,Df.default)("assertModuleDeclaration","assertImportOrExportDeclaration"),j("ModuleDeclaration",e,t)}});var Aj=G(p_=>{"use strict";Object.defineProperty(p_,"__esModule",{value:!0});p_.default=void 0;var vs=fi(),Int=p_.default=gve;function gve(e){switch(e){case"string":return(0,vs.stringTypeAnnotation)();case"number":return(0,vs.numberTypeAnnotation)();case"undefined":return(0,vs.voidTypeAnnotation)();case"boolean":return(0,vs.booleanTypeAnnotation)();case"function":return(0,vs.genericTypeAnnotation)((0,vs.identifier)("Function"));case"object":return(0,vs.genericTypeAnnotation)((0,vs.identifier)("Object"));case"symbol":return(0,vs.genericTypeAnnotation)((0,vs.identifier)("Symbol"));case"bigint":return(0,vs.anyTypeAnnotation)()}throw new Error("Invalid typeof value: "+e)}});var DI=G(RI=>{"use strict";Object.defineProperty(RI,"__esModule",{value:!0});RI.default=Cj;var Mf=Vr();function kj(e){return(0,Mf.isIdentifier)(e)?e.name:`${e.id.name}.${kj(e.qualification)}`}function Cj(e){let t=Array.from(e),r=new Map,n=new Map,s=new Set,a=[];for(let o=0;o<t.length;o++){let c=t[o];if(c&&!a.includes(c)){if((0,Mf.isAnyTypeAnnotation)(c))return[c];if((0,Mf.isFlowBaseAnnotation)(c)){n.set(c.type,c);continue}if((0,Mf.isUnionTypeAnnotation)(c)){s.has(c.types)||(t.push(...c.types),s.add(c.types));continue}if((0,Mf.isGenericTypeAnnotation)(c)){let l=kj(c.id);if(r.has(l)){let u=r.get(l);u.typeParameters?c.typeParameters&&(u.typeParameters.params.push(...c.typeParameters.params),u.typeParameters.params=Cj(u.typeParameters.params)):u=c.typeParameters}else r.set(l,c);continue}a.push(c)}}for(let[,o]of n)a.push(o);for(let[,o]of r)a.push(o);return a}});var Nj=G(MI=>{"use strict";Object.defineProperty(MI,"__esModule",{value:!0});MI.default=bve;var yve=fi(),_ve=DI();function bve(e){let t=(0,_ve.default)(e);return t.length===1?t[0]:(0,yve.unionTypeAnnotation)(t)}});var Rj=G(LI=>{"use strict";Object.defineProperty(LI,"__esModule",{value:!0});LI.default=$j;var ku=Vr();function Oj(e){return(0,ku.isIdentifier)(e)?e.name:(0,ku.isThisExpression)(e)?"this":`${e.right.name}.${Oj(e.left)}`}function $j(e){let t=Array.from(e),r=new Map,n=new Map,s=new Set,a=[];for(let o=0;o<t.length;o++){let c=t[o];if(!c||a.includes(c))continue;if((0,ku.isTSAnyKeyword)(c))return[c];if((0,ku.isTSBaseType)(c)){n.set(c.type,c);continue}if((0,ku.isTSUnionType)(c)){s.has(c.types)||(t.push(...c.types),s.add(c.types));continue}let l="typeParameters";if((0,ku.isTSTypeReference)(c)&&c[l]){let u=c[l],d=Oj(c.typeName);if(r.has(d)){let p=r.get(d),f=p[l];f?(f.params.push(...u.params),f.params=$j(f.params)):p=u}else r.set(d,c);continue}a.push(c)}for(let[,o]of n)a.push(o);for(let[,o]of r)a.push(o);return a}});var Dj=G(FI=>{"use strict";Object.defineProperty(FI,"__esModule",{value:!0});FI.default=Tve;var vve=fi(),xve=Rj(),Sve=Vr();function Tve(e){let t=e.map(n=>(0,Sve.isTSTypeAnnotation)(n)?n.typeAnnotation:n),r=(0,xve.default)(t);return r.length===1?r[0]:(0,vve.tsUnionType)(r)}});var BI=G(jI=>{"use strict";Object.defineProperty(jI,"__esModule",{value:!0});jI.buildUndefinedNode=wve;var Mj=fi();function wve(){return(0,Mj.unaryExpression)("void",(0,Mj.numericLiteral)(0),!0)}});var xo=G(UI=>{"use strict";Object.defineProperty(UI,"__esModule",{value:!0});UI.default=Eve;var Lj=Wi(),Fj=Vr(),{hasOwn:Zs}={hasOwn:Function.call.bind(Object.prototype.hasOwnProperty)};function jj(e,t,r,n){return e&&typeof e.type=="string"?Bj(e,t,r,n):e}function zI(e,t,r,n){return Array.isArray(e)?e.map(s=>jj(s,t,r,n)):jj(e,t,r,n)}function Eve(e,t=!0,r=!1){return Bj(e,t,r,new Map)}function Bj(e,t=!0,r=!1,n){if(!e)return e;let{type:s}=e,a={type:e.type};if((0,Fj.isIdentifier)(e))a.name=e.name,Zs(e,"optional")&&typeof e.optional=="boolean"&&(a.optional=e.optional),Zs(e,"typeAnnotation")&&(a.typeAnnotation=t?zI(e.typeAnnotation,!0,r,n):e.typeAnnotation),Zs(e,"decorators")&&(a.decorators=t?zI(e.decorators,!0,r,n):e.decorators);else if(Zs(Lj.NODE_FIELDS,s))for(let o of Object.keys(Lj.NODE_FIELDS[s]))Zs(e,o)&&(t?a[o]=(0,Fj.isFile)(e)&&o==="comments"?f_(e.comments,t,r,n):zI(e[o],!0,r,n):a[o]=e[o]);else throw new Error(`Unknown node type: "${s}"`);return Zs(e,"loc")&&(r?a.loc=null:a.loc=e.loc),Zs(e,"leadingComments")&&(a.leadingComments=f_(e.leadingComments,t,r,n)),Zs(e,"innerComments")&&(a.innerComments=f_(e.innerComments,t,r,n)),Zs(e,"trailingComments")&&(a.trailingComments=f_(e.trailingComments,t,r,n)),Zs(e,"extra")&&(a.extra=Object.assign({},e.extra)),a}function f_(e,t,r,n){return!e||!t?e:e.map(s=>{let a=n.get(s);if(a)return a;let{type:o,value:c,loc:l}=s,u={type:o,value:c,loc:l};return r&&(u.loc=null),n.set(s,u),u})}});var zj=G(qI=>{"use strict";Object.defineProperty(qI,"__esModule",{value:!0});qI.default=Ive;var Pve=xo();function Ive(e){return(0,Pve.default)(e,!1)}});var Uj=G(WI=>{"use strict";Object.defineProperty(WI,"__esModule",{value:!0});WI.default=kve;var Ave=xo();function kve(e){return(0,Ave.default)(e)}});var qj=G(VI=>{"use strict";Object.defineProperty(VI,"__esModule",{value:!0});VI.default=Nve;var Cve=xo();function Nve(e){return(0,Cve.default)(e,!0,!0)}});var Wj=G(KI=>{"use strict";Object.defineProperty(KI,"__esModule",{value:!0});KI.default=$ve;var Ove=xo();function $ve(e){return(0,Ove.default)(e,!1,!0)}});var ZI=G(GI=>{"use strict";Object.defineProperty(GI,"__esModule",{value:!0});GI.default=Rve;function Rve(e,t,r){if(!r||!e)return e;let n=`${t}Comments`;return e[n]?t==="leading"?e[n]=r.concat(e[n]):e[n].push(...r):e[n]=r,e}});var Vj=G(HI=>{"use strict";Object.defineProperty(HI,"__esModule",{value:!0});HI.default=Mve;var Dve=ZI();function Mve(e,t,r,n){return(0,Dve.default)(e,t,[{type:n?"CommentLine":"CommentBlock",value:r}])}});var h_=G(JI=>{"use strict";Object.defineProperty(JI,"__esModule",{value:!0});JI.default=Lve;function Lve(e,t,r){t&&r&&(t[e]=Array.from(new Set([].concat(t[e],r[e]).filter(Boolean))))}});var XI=G(YI=>{"use strict";Object.defineProperty(YI,"__esModule",{value:!0});YI.default=jve;var Fve=h_();function jve(e,t){(0,Fve.default)("innerComments",e,t)}});var eA=G(QI=>{"use strict";Object.defineProperty(QI,"__esModule",{value:!0});QI.default=zve;var Bve=h_();function zve(e,t){(0,Bve.default)("leadingComments",e,t)}});var rA=G(tA=>{"use strict";Object.defineProperty(tA,"__esModule",{value:!0});tA.default=qve;var Uve=h_();function qve(e,t){(0,Uve.default)("trailingComments",e,t)}});var iA=G(nA=>{"use strict";Object.defineProperty(nA,"__esModule",{value:!0});nA.default=Gve;var Wve=rA(),Vve=eA(),Kve=XI();function Gve(e,t){return(0,Wve.default)(e,t),(0,Vve.default)(e,t),(0,Kve.default)(e,t),e}});var Kj=G(sA=>{"use strict";Object.defineProperty(sA,"__esModule",{value:!0});sA.default=Hve;var Zve=wu();function Hve(e){return Zve.COMMENT_KEYS.forEach(t=>{e[t]=null}),e}});var Gj=G(ve=>{"use strict";Object.defineProperty(ve,"__esModule",{value:!0});ve.WHILE_TYPES=ve.USERWHITESPACABLE_TYPES=ve.UNARYLIKE_TYPES=ve.TYPESCRIPT_TYPES=ve.TSTYPE_TYPES=ve.TSTYPEELEMENT_TYPES=ve.TSENTITYNAME_TYPES=ve.TSBASETYPE_TYPES=ve.TERMINATORLESS_TYPES=ve.STATEMENT_TYPES=ve.STANDARDIZED_TYPES=ve.SCOPABLE_TYPES=ve.PUREISH_TYPES=ve.PROPERTY_TYPES=ve.PRIVATE_TYPES=ve.PATTERN_TYPES=ve.PATTERNLIKE_TYPES=ve.OBJECTMEMBER_TYPES=ve.MODULESPECIFIER_TYPES=ve.MODULEDECLARATION_TYPES=ve.MISCELLANEOUS_TYPES=ve.METHOD_TYPES=ve.LVAL_TYPES=ve.LOOP_TYPES=ve.LITERAL_TYPES=ve.JSX_TYPES=ve.IMPORTOREXPORTDECLARATION_TYPES=ve.IMMUTABLE_TYPES=ve.FUNCTION_TYPES=ve.FUNCTIONPARENT_TYPES=ve.FUNCTIONPARAMETER_TYPES=ve.FOR_TYPES=ve.FORXSTATEMENT_TYPES=ve.FLOW_TYPES=ve.FLOWTYPE_TYPES=ve.FLOWPREDICATE_TYPES=ve.FLOWDECLARATION_TYPES=ve.FLOWBASEANNOTATION_TYPES=ve.EXPRESSION_TYPES=ve.EXPRESSIONWRAPPER_TYPES=ve.EXPORTDECLARATION_TYPES=ve.ENUMMEMBER_TYPES=ve.ENUMBODY_TYPES=ve.DECLARATION_TYPES=ve.CONDITIONAL_TYPES=ve.COMPLETIONSTATEMENT_TYPES=ve.CLASS_TYPES=ve.BLOCK_TYPES=ve.BLOCKPARENT_TYPES=ve.BINARY_TYPES=ve.ACCESSOR_TYPES=void 0;var ht=Wi(),Gnt=ve.STANDARDIZED_TYPES=ht.FLIPPED_ALIAS_KEYS.Standardized,Znt=ve.EXPRESSION_TYPES=ht.FLIPPED_ALIAS_KEYS.Expression,Hnt=ve.BINARY_TYPES=ht.FLIPPED_ALIAS_KEYS.Binary,Jnt=ve.SCOPABLE_TYPES=ht.FLIPPED_ALIAS_KEYS.Scopable,Ynt=ve.BLOCKPARENT_TYPES=ht.FLIPPED_ALIAS_KEYS.BlockParent,Xnt=ve.BLOCK_TYPES=ht.FLIPPED_ALIAS_KEYS.Block,Qnt=ve.STATEMENT_TYPES=ht.FLIPPED_ALIAS_KEYS.Statement,eit=ve.TERMINATORLESS_TYPES=ht.FLIPPED_ALIAS_KEYS.Terminatorless,tit=ve.COMPLETIONSTATEMENT_TYPES=ht.FLIPPED_ALIAS_KEYS.CompletionStatement,rit=ve.CONDITIONAL_TYPES=ht.FLIPPED_ALIAS_KEYS.Conditional,nit=ve.LOOP_TYPES=ht.FLIPPED_ALIAS_KEYS.Loop,iit=ve.WHILE_TYPES=ht.FLIPPED_ALIAS_KEYS.While,sit=ve.EXPRESSIONWRAPPER_TYPES=ht.FLIPPED_ALIAS_KEYS.ExpressionWrapper,ait=ve.FOR_TYPES=ht.FLIPPED_ALIAS_KEYS.For,oit=ve.FORXSTATEMENT_TYPES=ht.FLIPPED_ALIAS_KEYS.ForXStatement,cit=ve.FUNCTION_TYPES=ht.FLIPPED_ALIAS_KEYS.Function,lit=ve.FUNCTIONPARENT_TYPES=ht.FLIPPED_ALIAS_KEYS.FunctionParent,uit=ve.PUREISH_TYPES=ht.FLIPPED_ALIAS_KEYS.Pureish,dit=ve.DECLARATION_TYPES=ht.FLIPPED_ALIAS_KEYS.Declaration,pit=ve.FUNCTIONPARAMETER_TYPES=ht.FLIPPED_ALIAS_KEYS.FunctionParameter,fit=ve.PATTERNLIKE_TYPES=ht.FLIPPED_ALIAS_KEYS.PatternLike,hit=ve.LVAL_TYPES=ht.FLIPPED_ALIAS_KEYS.LVal,mit=ve.TSENTITYNAME_TYPES=ht.FLIPPED_ALIAS_KEYS.TSEntityName,git=ve.LITERAL_TYPES=ht.FLIPPED_ALIAS_KEYS.Literal,yit=ve.IMMUTABLE_TYPES=ht.FLIPPED_ALIAS_KEYS.Immutable,_it=ve.USERWHITESPACABLE_TYPES=ht.FLIPPED_ALIAS_KEYS.UserWhitespacable,bit=ve.METHOD_TYPES=ht.FLIPPED_ALIAS_KEYS.Method,vit=ve.OBJECTMEMBER_TYPES=ht.FLIPPED_ALIAS_KEYS.ObjectMember,xit=ve.PROPERTY_TYPES=ht.FLIPPED_ALIAS_KEYS.Property,Sit=ve.UNARYLIKE_TYPES=ht.FLIPPED_ALIAS_KEYS.UnaryLike,Tit=ve.PATTERN_TYPES=ht.FLIPPED_ALIAS_KEYS.Pattern,wit=ve.CLASS_TYPES=ht.FLIPPED_ALIAS_KEYS.Class,Jve=ve.IMPORTOREXPORTDECLARATION_TYPES=ht.FLIPPED_ALIAS_KEYS.ImportOrExportDeclaration,Eit=ve.EXPORTDECLARATION_TYPES=ht.FLIPPED_ALIAS_KEYS.ExportDeclaration,Pit=ve.MODULESPECIFIER_TYPES=ht.FLIPPED_ALIAS_KEYS.ModuleSpecifier,Iit=ve.ACCESSOR_TYPES=ht.FLIPPED_ALIAS_KEYS.Accessor,Ait=ve.PRIVATE_TYPES=ht.FLIPPED_ALIAS_KEYS.Private,kit=ve.FLOW_TYPES=ht.FLIPPED_ALIAS_KEYS.Flow,Cit=ve.FLOWTYPE_TYPES=ht.FLIPPED_ALIAS_KEYS.FlowType,Nit=ve.FLOWBASEANNOTATION_TYPES=ht.FLIPPED_ALIAS_KEYS.FlowBaseAnnotation,Oit=ve.FLOWDECLARATION_TYPES=ht.FLIPPED_ALIAS_KEYS.FlowDeclaration,$it=ve.FLOWPREDICATE_TYPES=ht.FLIPPED_ALIAS_KEYS.FlowPredicate,Rit=ve.ENUMBODY_TYPES=ht.FLIPPED_ALIAS_KEYS.EnumBody,Dit=ve.ENUMMEMBER_TYPES=ht.FLIPPED_ALIAS_KEYS.EnumMember,Mit=ve.JSX_TYPES=ht.FLIPPED_ALIAS_KEYS.JSX,Lit=ve.MISCELLANEOUS_TYPES=ht.FLIPPED_ALIAS_KEYS.Miscellaneous,Fit=ve.TYPESCRIPT_TYPES=ht.FLIPPED_ALIAS_KEYS.TypeScript,jit=ve.TSTYPEELEMENT_TYPES=ht.FLIPPED_ALIAS_KEYS.TSTypeElement,Bit=ve.TSTYPE_TYPES=ht.FLIPPED_ALIAS_KEYS.TSType,zit=ve.TSBASETYPE_TYPES=ht.FLIPPED_ALIAS_KEYS.TSBaseType,Uit=ve.MODULEDECLARATION_TYPES=Jve});var cA=G(oA=>{"use strict";Object.defineProperty(oA,"__esModule",{value:!0});oA.default=Yve;var m_=Vr(),aA=fi();function Yve(e,t){if((0,m_.isBlockStatement)(e))return e;let r=[];return(0,m_.isEmptyStatement)(e)?r=[]:((0,m_.isStatement)(e)||((0,m_.isFunction)(t)?e=(0,aA.returnStatement)(e):e=(0,aA.expressionStatement)(e)),r=[e]),(0,aA.blockStatement)(r)}});var Zj=G(lA=>{"use strict";Object.defineProperty(lA,"__esModule",{value:!0});lA.default=Qve;var Xve=cA();function Qve(e,t="body"){let r=(0,Xve.default)(e[t],e);return e[t]=r,r}});var dA=G(uA=>{"use strict";Object.defineProperty(uA,"__esModule",{value:!0});uA.default=rxe;var exe=Tu(),txe=Af();function rxe(e){e=e+"";let t="";for(let r of e)t+=(0,txe.isIdentifierChar)(r.codePointAt(0))?r:"-";return t=t.replace(/^[-0-9]+/,""),t=t.replace(/[-\s]+(.)?/g,function(r,n){return n?n.toUpperCase():""}),(0,exe.default)(t)||(t=`_${t}`),t||"_"}});var Hj=G(pA=>{"use strict";Object.defineProperty(pA,"__esModule",{value:!0});pA.default=ixe;var nxe=dA();function ixe(e){return e=(0,nxe.default)(e),(e==="eval"||e==="arguments")&&(e="_"+e),e}});var Jj=G(fA=>{"use strict";Object.defineProperty(fA,"__esModule",{value:!0});fA.default=oxe;var sxe=Vr(),axe=fi();function oxe(e,t=e.key||e.property){return!e.computed&&(0,sxe.isIdentifier)(t)&&(t=(0,axe.stringLiteral)(t.name)),t}});var Yj=G(g_=>{"use strict";Object.defineProperty(g_,"__esModule",{value:!0});g_.default=void 0;var Lf=Vr(),Hit=g_.default=cxe;function cxe(e){if((0,Lf.isExpressionStatement)(e)&&(e=e.expression),(0,Lf.isExpression)(e))return e;if((0,Lf.isClass)(e)?(e.type="ClassExpression",e.abstract=!1):(0,Lf.isFunction)(e)&&(e.type="FunctionExpression"),!(0,Lf.isExpression)(e))throw new Error(`cannot turn ${e.type} to an expression`);return e}});var mA=G(hA=>{"use strict";Object.defineProperty(hA,"__esModule",{value:!0});hA.default=Ff;var lxe=Wi(),Xj=Symbol(),Qj=Symbol();function Ff(e,t,r){if(!e)return!1;let n=lxe.VISITOR_KEYS[e.type];if(!n)return!1;r=r||{};let s=t(e,r);if(s!==void 0)switch(s){case Xj:return!1;case Qj:return!0}for(let a of n){let o=e[a];if(o){if(Array.isArray(o)){for(let c of o)if(Ff(c,t,r))return!0}else if(Ff(o,t,r))return!0}}return!1}Ff.skip=Xj;Ff.stop=Qj});var yA=G(gA=>{"use strict";Object.defineProperty(gA,"__esModule",{value:!0});gA.default=pxe;var uxe=wu(),eB=["tokens","start","end","loc","raw","rawValue"],dxe=[...uxe.COMMENT_KEYS,"comments",...eB];function pxe(e,t={}){let r=t.preserveComments?eB:dxe;for(let s of r)e[s]!=null&&(e[s]=void 0);for(let s of Object.keys(e))s.startsWith("_")&&e[s]!=null&&(e[s]=void 0);let n=Object.getOwnPropertySymbols(e);for(let s of n)e[s]=null}});var bA=G(_A=>{"use strict";Object.defineProperty(_A,"__esModule",{value:!0});_A.default=mxe;var fxe=mA(),hxe=yA();function mxe(e,t){return(0,fxe.default)(e,hxe.default,t),e}});var rB=G(vA=>{"use strict";Object.defineProperty(vA,"__esModule",{value:!0});vA.default=Pc;var tB=Vr(),gxe=xo(),yxe=bA();function Pc(e,t=e.key){let r;return e.kind==="method"?Pc.increment()+"":((0,tB.isIdentifier)(t)?r=t.name:(0,tB.isStringLiteral)(t)?r=JSON.stringify(t.value):r=JSON.stringify((0,yxe.default)((0,gxe.default)(t))),e.computed&&(r=`[${r}]`),e.static&&(r=`static:${r}`),r)}Pc.uid=0;Pc.increment=function(){return Pc.uid>=Number.MAX_SAFE_INTEGER?Pc.uid=0:Pc.uid++}});var nB=G(__=>{"use strict";Object.defineProperty(__,"__esModule",{value:!0});__.default=void 0;var y_=Vr(),_xe=fi(),tst=__.default=bxe;function bxe(e,t){if((0,y_.isStatement)(e))return e;let r=!1,n;if((0,y_.isClass)(e))r=!0,n="ClassDeclaration";else if((0,y_.isFunction)(e))r=!0,n="FunctionDeclaration";else if((0,y_.isAssignmentExpression)(e))return(0,_xe.expressionStatement)(e);if(r&&!e.id&&(n=!1),!n){if(t)return!1;throw new Error(`cannot turn ${e.type} to a statement`)}return e.type=n,e}});var iB=G(b_=>{"use strict";Object.defineProperty(b_,"__esModule",{value:!0});b_.default=void 0;var vxe=Tu(),nn=fi(),nst=b_.default=xA,xxe=Function.call.bind(Object.prototype.toString);function Sxe(e){return xxe(e)==="[object RegExp]"}function Txe(e){if(typeof e!="object"||e===null||Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);return t===null||Object.getPrototypeOf(t)===null}function xA(e){if(e===void 0)return(0,nn.identifier)("undefined");if(e===!0||e===!1)return(0,nn.booleanLiteral)(e);if(e===null)return(0,nn.nullLiteral)();if(typeof e=="string")return(0,nn.stringLiteral)(e);if(typeof e=="number"){let t;if(Number.isFinite(e))t=(0,nn.numericLiteral)(Math.abs(e));else{let r;Number.isNaN(e)?r=(0,nn.numericLiteral)(0):r=(0,nn.numericLiteral)(1),t=(0,nn.binaryExpression)("/",r,(0,nn.numericLiteral)(0))}return(e<0||Object.is(e,-0))&&(t=(0,nn.unaryExpression)("-",t)),t}if(typeof e=="bigint")return e<0?(0,nn.unaryExpression)("-",(0,nn.bigIntLiteral)(-e)):(0,nn.bigIntLiteral)(e);if(Sxe(e)){let t=e.source,r=/\/([a-z]*)$/.exec(e.toString())[1];return(0,nn.regExpLiteral)(t,r)}if(Array.isArray(e))return(0,nn.arrayExpression)(e.map(xA));if(Txe(e)){let t=[];for(let r of Object.keys(e)){let n,s=!1;(0,vxe.default)(r)?r==="__proto__"?(s=!0,n=(0,nn.stringLiteral)(r)):n=(0,nn.identifier)(r):n=(0,nn.stringLiteral)(r),t.push((0,nn.objectProperty)(n,xA(e[r]),s))}return(0,nn.objectExpression)(t)}throw new Error("don't know how to turn this value into a node")}});var sB=G(SA=>{"use strict";Object.defineProperty(SA,"__esModule",{value:!0});SA.default=Exe;var wxe=fi();function Exe(e,t,r=!1){return e.object=(0,wxe.memberExpression)(e.object,e.property,e.computed),e.property=t,e.computed=!!r,e}});var oB=G(TA=>{"use strict";Object.defineProperty(TA,"__esModule",{value:!0});TA.default=Ixe;var aB=wu(),Pxe=iA();function Ixe(e,t){if(!e||!t)return e;for(let r of aB.INHERIT_KEYS.optional)e[r]==null&&(e[r]=t[r]);for(let r of Object.keys(t))r.startsWith("_")&&r!=="__clone"&&(e[r]=t[r]);for(let r of aB.INHERIT_KEYS.force)e[r]=t[r];return(0,Pxe.default)(e,t),e}});var cB=G(wA=>{"use strict";Object.defineProperty(wA,"__esModule",{value:!0});wA.default=Cxe;var Axe=fi(),kxe=Rt();function Cxe(e,t){if((0,kxe.isSuper)(e.object))throw new Error("Cannot prepend node to super property access (`super.foo`).");return e.object=(0,Axe.memberExpression)(t,e.object),e}});var lB=G(EA=>{"use strict";Object.defineProperty(EA,"__esModule",{value:!0});EA.default=Nxe;function Nxe(e){let t=[].concat(e),r=Object.create(null);for(;t.length;){let n=t.pop();if(n)switch(n.type){case"ArrayPattern":t.push(...n.elements);break;case"AssignmentExpression":case"AssignmentPattern":case"ForInStatement":case"ForOfStatement":t.push(n.left);break;case"ObjectPattern":t.push(...n.properties);break;case"ObjectProperty":t.push(n.value);break;case"RestElement":case"UpdateExpression":t.push(n.argument);break;case"UnaryExpression":n.operator==="delete"&&t.push(n.argument);break;case"Identifier":r[n.name]=n;break;default:break}}return r}});var jf=G(IA=>{"use strict";Object.defineProperty(IA,"__esModule",{value:!0});IA.default=PA;var Sa=Vr();function PA(e,t,r,n){let s=[].concat(e),a=Object.create(null);for(;s.length;){let o=s.shift();if(!o||n&&((0,Sa.isAssignmentExpression)(o)||(0,Sa.isUnaryExpression)(o)||(0,Sa.isUpdateExpression)(o)))continue;if((0,Sa.isIdentifier)(o)){t?(a[o.name]=a[o.name]||[]).push(o):a[o.name]=o;continue}if((0,Sa.isExportDeclaration)(o)&&!(0,Sa.isExportAllDeclaration)(o)){(0,Sa.isDeclaration)(o.declaration)&&s.push(o.declaration);continue}if(r){if((0,Sa.isFunctionDeclaration)(o)){s.push(o.id);continue}if((0,Sa.isFunctionExpression)(o))continue}let c=PA.keys[o.type];if(c)for(let l=0;l<c.length;l++){let u=c[l],d=o[u];d&&(Array.isArray(d)?s.push(...d):s.push(d))}}return a}var Oxe={DeclareClass:["id"],DeclareFunction:["id"],DeclareModule:["id"],DeclareVariable:["id"],DeclareInterface:["id"],DeclareTypeAlias:["id"],DeclareOpaqueType:["id"],InterfaceDeclaration:["id"],TypeAlias:["id"],OpaqueType:["id"],CatchClause:["param"],LabeledStatement:["label"],UnaryExpression:["argument"],AssignmentExpression:["left"],ImportSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportDefaultSpecifier:["local"],ImportDeclaration:["specifiers"],TSImportEqualsDeclaration:["id"],ExportSpecifier:["exported"],ExportNamespaceSpecifier:["exported"],ExportDefaultSpecifier:["exported"],FunctionDeclaration:["id","params"],FunctionExpression:["id","params"],ArrowFunctionExpression:["params"],ObjectMethod:["params"],ClassMethod:["params"],ClassPrivateMethod:["params"],ForInStatement:["left"],ForOfStatement:["left"],ClassDeclaration:["id"],ClassExpression:["id"],RestElement:["argument"],UpdateExpression:["argument"],ObjectProperty:["value"],AssignmentPattern:["left"],ArrayPattern:["elements"],ObjectPattern:["properties"],VariableDeclaration:["declarations"],VariableDeclarator:["id"]};PA.keys=Oxe});var uB=G(v_=>{"use strict";Object.defineProperty(v_,"__esModule",{value:!0});v_.default=void 0;var $xe=jf(),ust=v_.default=Rxe;function Rxe(e,t){return(0,$xe.default)(e,t,!0)}});var pB=G(AA=>{"use strict";Object.defineProperty(AA,"__esModule",{value:!0});AA.default=Mxe;var Vi=Vr();function Dxe(e){return(0,Vi.isNullLiteral)(e)?"null":(0,Vi.isRegExpLiteral)(e)?`/${e.pattern}/${e.flags}`:(0,Vi.isTemplateLiteral)(e)?e.quasis.map(t=>t.value.raw).join(""):e.value!==void 0?String(e.value):null}function dB(e){if(!e.computed||(0,Vi.isLiteral)(e.key))return e.key}function Mxe(e,t){if("id"in e&&e.id)return{name:e.id.name,originalNode:e.id};let r="",n;if((0,Vi.isObjectProperty)(t,{value:e})?n=dB(t):(0,Vi.isObjectMethod)(e)||(0,Vi.isClassMethod)(e)?(n=dB(e),e.kind==="get"?r="get ":e.kind==="set"&&(r="set ")):(0,Vi.isVariableDeclarator)(t,{init:e})?n=t.id:(0,Vi.isAssignmentExpression)(t,{operator:"=",right:e})&&(n=t.left),!n)return null;let s=(0,Vi.isLiteral)(n)?Dxe(n):(0,Vi.isIdentifier)(n)?n.name:(0,Vi.isPrivateName)(n)?n.id.name:null;return s==null?null:{name:r+s,originalNode:n}}});var fB=G(CA=>{"use strict";Object.defineProperty(CA,"__esModule",{value:!0});CA.default=Fxe;var Lxe=Wi();function Fxe(e,t,r){typeof t=="function"&&(t={enter:t});let{enter:n,exit:s}=t;kA(e,n,s,r,[])}function kA(e,t,r,n,s){let a=Lxe.VISITOR_KEYS[e.type];if(a){t&&t(e,s,n);for(let o of a){let c=e[o];if(Array.isArray(c))for(let l=0;l<c.length;l++){let u=c[l];u&&(s.push({node:e,key:o,index:l}),kA(u,t,r,n,s),s.pop())}else c&&(s.push({node:e,key:o}),kA(c,t,r,n,s),s.pop())}r&&r(e,s,n)}}});var hB=G(NA=>{"use strict";Object.defineProperty(NA,"__esModule",{value:!0});NA.default=Bxe;var jxe=jf();function Bxe(e,t,r){if(r&&e.type==="Identifier"&&t.type==="ObjectProperty"&&r.type==="ObjectExpression")return!1;let n=jxe.default.keys[t.type];if(n)for(let s=0;s<n.length;s++){let a=n[s],o=t[a];if(Array.isArray(o)){if(o.includes(e))return!0}else if(o===e)return!0}return!1}});var $A=G(OA=>{"use strict";Object.defineProperty(OA,"__esModule",{value:!0});OA.default=qxe;var zxe=Vr(),Uxe=Symbol.for("var used to be block scoped");function qxe(e){return(0,zxe.isVariableDeclaration)(e)&&(e.kind!=="var"||e[Uxe])}});var gB=G(RA=>{"use strict";Object.defineProperty(RA,"__esModule",{value:!0});RA.default=Vxe;var mB=Vr(),Wxe=$A();function Vxe(e){return(0,mB.isFunctionDeclaration)(e)||(0,mB.isClassDeclaration)(e)||(0,Wxe.default)(e)}});var yB=G(DA=>{"use strict";Object.defineProperty(DA,"__esModule",{value:!0});DA.default=Zxe;var Kxe=t_(),Gxe=Vr();function Zxe(e){return(0,Kxe.default)(e.type,"Immutable")?!0:(0,Gxe.isIdentifier)(e)?e.name==="undefined":!1}});var bB=G(LA=>{"use strict";Object.defineProperty(LA,"__esModule",{value:!0});LA.default=MA;var _B=Wi();function MA(e,t){if(typeof e!="object"||typeof t!="object"||e==null||t==null)return e===t;if(e.type!==t.type)return!1;let r=Object.keys(_B.NODE_FIELDS[e.type]||e.type),n=_B.VISITOR_KEYS[e.type];for(let s of r){let a=e[s],o=t[s];if(typeof a!=typeof o)return!1;if(!(a==null&&o==null)){if(a==null||o==null)return!1;if(Array.isArray(a)){if(!Array.isArray(o)||a.length!==o.length)return!1;for(let c=0;c<a.length;c++)if(!MA(a[c],o[c]))return!1;continue}if(typeof a=="object"&&!(n!=null&&n.includes(s))){for(let c of Object.keys(a))if(a[c]!==o[c])return!1;continue}if(!MA(a,o))return!1}}return!0}});var vB=G(FA=>{"use strict";Object.defineProperty(FA,"__esModule",{value:!0});FA.default=Hxe;function Hxe(e,t,r){switch(t.type){case"MemberExpression":case"OptionalMemberExpression":return t.property===e?!!t.computed:t.object===e;case"JSXMemberExpression":return t.object===e;case"VariableDeclarator":return t.init===e;case"ArrowFunctionExpression":return t.body===e;case"PrivateName":return!1;case"ClassMethod":case"ClassPrivateMethod":case"ObjectMethod":return t.key===e?!!t.computed:!1;case"ObjectProperty":return t.key===e?!!t.computed:r?.type!=="ObjectPattern";case"ClassProperty":case"ClassAccessorProperty":return t.key===e?!!t.computed:!0;case"ClassPrivateProperty":return t.key!==e;case"ClassDeclaration":case"ClassExpression":return t.superClass===e;case"AssignmentExpression":return t.right===e;case"AssignmentPattern":return t.right===e;case"LabeledStatement":return!1;case"CatchClause":return!1;case"RestElement":return!1;case"BreakStatement":case"ContinueStatement":return!1;case"FunctionDeclaration":case"FunctionExpression":return!1;case"ExportNamespaceSpecifier":case"ExportDefaultSpecifier":return!1;case"ExportSpecifier":return r!=null&&r.source?!1:t.local===e;case"ImportDefaultSpecifier":case"ImportNamespaceSpecifier":case"ImportSpecifier":return!1;case"ImportAttribute":return!1;case"JSXAttribute":return!1;case"ObjectPattern":case"ArrayPattern":return!1;case"MetaProperty":return!1;case"ObjectTypeProperty":return t.key!==e;case"TSEnumMember":return t.id!==e;case"TSPropertySignature":return t.key===e?!!t.computed:!0}return!0}});var xB=G(jA=>{"use strict";Object.defineProperty(jA,"__esModule",{value:!0});jA.default=Jxe;var Ic=Vr();function Jxe(e,t){return(0,Ic.isBlockStatement)(e)&&((0,Ic.isFunction)(t)||(0,Ic.isCatchClause)(t))?!1:(0,Ic.isPattern)(e)&&((0,Ic.isFunction)(t)||(0,Ic.isCatchClause)(t))?!0:(0,Ic.isScopable)(e)}});var TB=G(BA=>{"use strict";Object.defineProperty(BA,"__esModule",{value:!0});BA.default=Yxe;var SB=Vr();function Yxe(e){return(0,SB.isImportDefaultSpecifier)(e)||(0,SB.isIdentifier)(e.imported||e.exported,{name:"default"})}});var wB=G(zA=>{"use strict";Object.defineProperty(zA,"__esModule",{value:!0});zA.default=eSe;var Xxe=Tu(),Qxe=new Set(["abstract","boolean","byte","char","double","enum","final","float","goto","implements","int","interface","long","native","package","private","protected","public","short","static","synchronized","throws","transient","volatile"]);function eSe(e){return(0,Xxe.default)(e)&&!Qxe.has(e)}});var EB=G(UA=>{"use strict";Object.defineProperty(UA,"__esModule",{value:!0});UA.default=nSe;var tSe=Vr(),rSe=Symbol.for("var used to be block scoped");function nSe(e){return(0,tSe.isVariableDeclaration)(e,{kind:"var"})&&!e[rSe]}});var PB=G(VA=>{"use strict";Object.defineProperty(VA,"__esModule",{value:!0});VA.default=x_;var iSe=jf(),Ac=Vr(),qA=fi(),WA=BI(),sSe=xo();function x_(e,t){let r=[],n=!0;for(let s of e)if((0,Ac.isEmptyStatement)(s)||(n=!1),(0,Ac.isExpression)(s))r.push(s);else if((0,Ac.isExpressionStatement)(s))r.push(s.expression);else if((0,Ac.isVariableDeclaration)(s)){if(s.kind!=="var")return;for(let a of s.declarations){let o=(0,iSe.default)(a);for(let c of Object.keys(o))t.push({kind:s.kind,id:(0,sSe.default)(o[c])});a.init&&r.push((0,qA.assignmentExpression)("=",a.id,a.init))}n=!0}else if((0,Ac.isIfStatement)(s)){let a=s.consequent?x_([s.consequent],t):(0,WA.buildUndefinedNode)(),o=s.alternate?x_([s.alternate],t):(0,WA.buildUndefinedNode)();if(!a||!o)return;r.push((0,qA.conditionalExpression)(s.test,a,o))}else if((0,Ac.isBlockStatement)(s)){let a=x_(s.body,t);if(!a)return;r.push(a)}else if((0,Ac.isEmptyStatement)(s))e.indexOf(s)===0&&(n=!0);else return;return n&&r.push((0,WA.buildUndefinedNode)()),r.length===1?r[0]:(0,qA.sequenceExpression)(r)}});var IB=G(KA=>{"use strict";Object.defineProperty(KA,"__esModule",{value:!0});KA.default=oSe;var aSe=PB();function oSe(e,t){if(!(e!=null&&e.length))return;let r=[],n=(0,aSe.default)(e,r);if(n){for(let s of r)t.push(s);return n}}});var Rt=G(Ce=>{"use strict";Object.defineProperty(Ce,"__esModule",{value:!0});var So={react:!0,assertNode:!0,createTypeAnnotationBasedOnTypeof:!0,createUnionTypeAnnotation:!0,createFlowUnionType:!0,createTSUnionType:!0,cloneNode:!0,clone:!0,cloneDeep:!0,cloneDeepWithoutLoc:!0,cloneWithoutLoc:!0,addComment:!0,addComments:!0,inheritInnerComments:!0,inheritLeadingComments:!0,inheritsComments:!0,inheritTrailingComments:!0,removeComments:!0,ensureBlock:!0,toBindingIdentifierName:!0,toBlock:!0,toComputedKey:!0,toExpression:!0,toIdentifier:!0,toKeyAlias:!0,toStatement:!0,valueToNode:!0,appendToMemberExpression:!0,inherits:!0,prependToMemberExpression:!0,removeProperties:!0,removePropertiesDeep:!0,removeTypeDuplicates:!0,getAssignmentIdentifiers:!0,getBindingIdentifiers:!0,getOuterBindingIdentifiers:!0,getFunctionName:!0,traverse:!0,traverseFast:!0,shallowEqual:!0,is:!0,isBinding:!0,isBlockScoped:!0,isImmutable:!0,isLet:!0,isNode:!0,isNodesEquivalent:!0,isPlaceholderType:!0,isReferenced:!0,isScope:!0,isSpecifierDefault:!0,isType:!0,isValidES3Identifier:!0,isValidIdentifier:!0,isVar:!0,matchesPattern:!0,validate:!0,buildMatchMemberExpression:!0,__internal__deprecationWarning:!0};Object.defineProperty(Ce,"__internal__deprecationWarning",{enumerable:!0,get:function(){return dTe.default}});Object.defineProperty(Ce,"addComment",{enumerable:!0,get:function(){return bSe.default}});Object.defineProperty(Ce,"addComments",{enumerable:!0,get:function(){return vSe.default}});Object.defineProperty(Ce,"appendToMemberExpression",{enumerable:!0,get:function(){return DSe.default}});Object.defineProperty(Ce,"assertNode",{enumerable:!0,get:function(){return dSe.default}});Object.defineProperty(Ce,"buildMatchMemberExpression",{enumerable:!0,get:function(){return uTe.default}});Object.defineProperty(Ce,"clone",{enumerable:!0,get:function(){return mSe.default}});Object.defineProperty(Ce,"cloneDeep",{enumerable:!0,get:function(){return gSe.default}});Object.defineProperty(Ce,"cloneDeepWithoutLoc",{enumerable:!0,get:function(){return ySe.default}});Object.defineProperty(Ce,"cloneNode",{enumerable:!0,get:function(){return hSe.default}});Object.defineProperty(Ce,"cloneWithoutLoc",{enumerable:!0,get:function(){return _Se.default}});Object.defineProperty(Ce,"createFlowUnionType",{enumerable:!0,get:function(){return AB.default}});Object.defineProperty(Ce,"createTSUnionType",{enumerable:!0,get:function(){return fSe.default}});Object.defineProperty(Ce,"createTypeAnnotationBasedOnTypeof",{enumerable:!0,get:function(){return pSe.default}});Object.defineProperty(Ce,"createUnionTypeAnnotation",{enumerable:!0,get:function(){return AB.default}});Object.defineProperty(Ce,"ensureBlock",{enumerable:!0,get:function(){return PSe.default}});Object.defineProperty(Ce,"getAssignmentIdentifiers",{enumerable:!0,get:function(){return zSe.default}});Object.defineProperty(Ce,"getBindingIdentifiers",{enumerable:!0,get:function(){return USe.default}});Object.defineProperty(Ce,"getFunctionName",{enumerable:!0,get:function(){return WSe.default}});Object.defineProperty(Ce,"getOuterBindingIdentifiers",{enumerable:!0,get:function(){return qSe.default}});Object.defineProperty(Ce,"inheritInnerComments",{enumerable:!0,get:function(){return xSe.default}});Object.defineProperty(Ce,"inheritLeadingComments",{enumerable:!0,get:function(){return SSe.default}});Object.defineProperty(Ce,"inheritTrailingComments",{enumerable:!0,get:function(){return wSe.default}});Object.defineProperty(Ce,"inherits",{enumerable:!0,get:function(){return MSe.default}});Object.defineProperty(Ce,"inheritsComments",{enumerable:!0,get:function(){return TSe.default}});Object.defineProperty(Ce,"is",{enumerable:!0,get:function(){return GSe.default}});Object.defineProperty(Ce,"isBinding",{enumerable:!0,get:function(){return ZSe.default}});Object.defineProperty(Ce,"isBlockScoped",{enumerable:!0,get:function(){return HSe.default}});Object.defineProperty(Ce,"isImmutable",{enumerable:!0,get:function(){return JSe.default}});Object.defineProperty(Ce,"isLet",{enumerable:!0,get:function(){return YSe.default}});Object.defineProperty(Ce,"isNode",{enumerable:!0,get:function(){return XSe.default}});Object.defineProperty(Ce,"isNodesEquivalent",{enumerable:!0,get:function(){return QSe.default}});Object.defineProperty(Ce,"isPlaceholderType",{enumerable:!0,get:function(){return eTe.default}});Object.defineProperty(Ce,"isReferenced",{enumerable:!0,get:function(){return tTe.default}});Object.defineProperty(Ce,"isScope",{enumerable:!0,get:function(){return rTe.default}});Object.defineProperty(Ce,"isSpecifierDefault",{enumerable:!0,get:function(){return nTe.default}});Object.defineProperty(Ce,"isType",{enumerable:!0,get:function(){return iTe.default}});Object.defineProperty(Ce,"isValidES3Identifier",{enumerable:!0,get:function(){return sTe.default}});Object.defineProperty(Ce,"isValidIdentifier",{enumerable:!0,get:function(){return aTe.default}});Object.defineProperty(Ce,"isVar",{enumerable:!0,get:function(){return oTe.default}});Object.defineProperty(Ce,"matchesPattern",{enumerable:!0,get:function(){return cTe.default}});Object.defineProperty(Ce,"prependToMemberExpression",{enumerable:!0,get:function(){return LSe.default}});Ce.react=void 0;Object.defineProperty(Ce,"removeComments",{enumerable:!0,get:function(){return ESe.default}});Object.defineProperty(Ce,"removeProperties",{enumerable:!0,get:function(){return FSe.default}});Object.defineProperty(Ce,"removePropertiesDeep",{enumerable:!0,get:function(){return jSe.default}});Object.defineProperty(Ce,"removeTypeDuplicates",{enumerable:!0,get:function(){return BSe.default}});Object.defineProperty(Ce,"shallowEqual",{enumerable:!0,get:function(){return KSe.default}});Object.defineProperty(Ce,"toBindingIdentifierName",{enumerable:!0,get:function(){return ISe.default}});Object.defineProperty(Ce,"toBlock",{enumerable:!0,get:function(){return ASe.default}});Object.defineProperty(Ce,"toComputedKey",{enumerable:!0,get:function(){return kSe.default}});Object.defineProperty(Ce,"toExpression",{enumerable:!0,get:function(){return CSe.default}});Object.defineProperty(Ce,"toIdentifier",{enumerable:!0,get:function(){return NSe.default}});Object.defineProperty(Ce,"toKeyAlias",{enumerable:!0,get:function(){return OSe.default}});Object.defineProperty(Ce,"toStatement",{enumerable:!0,get:function(){return $Se.default}});Object.defineProperty(Ce,"traverse",{enumerable:!0,get:function(){return S_.default}});Object.defineProperty(Ce,"traverseFast",{enumerable:!0,get:function(){return VSe.default}});Object.defineProperty(Ce,"validate",{enumerable:!0,get:function(){return lTe.default}});Object.defineProperty(Ce,"valueToNode",{enumerable:!0,get:function(){return RSe.default}});var cSe=$2(),lSe=R2(),uSe=Ej(),dSe=Pj(),GA=Ij();Object.keys(GA).forEach(function(e){e==="default"||e==="__esModule"||Object.prototype.hasOwnProperty.call(So,e)||e in Ce&&Ce[e]===GA[e]||Object.defineProperty(Ce,e,{enumerable:!0,get:function(){return GA[e]}})});var pSe=Aj(),AB=Nj(),fSe=Dj(),ZA=BI();Object.keys(ZA).forEach(function(e){e==="default"||e==="__esModule"||Object.prototype.hasOwnProperty.call(So,e)||e in Ce&&Ce[e]===ZA[e]||Object.defineProperty(Ce,e,{enumerable:!0,get:function(){return ZA[e]}})});var HA=fi();Object.keys(HA).forEach(function(e){e==="default"||e==="__esModule"||Object.prototype.hasOwnProperty.call(So,e)||e in Ce&&Ce[e]===HA[e]||Object.defineProperty(Ce,e,{enumerable:!0,get:function(){return HA[e]}})});var hSe=xo(),mSe=zj(),gSe=Uj(),ySe=qj(),_Se=Wj(),bSe=Vj(),vSe=ZI(),xSe=XI(),SSe=eA(),TSe=iA(),wSe=rA(),ESe=Kj(),JA=Gj();Object.keys(JA).forEach(function(e){e==="default"||e==="__esModule"||Object.prototype.hasOwnProperty.call(So,e)||e in Ce&&Ce[e]===JA[e]||Object.defineProperty(Ce,e,{enumerable:!0,get:function(){return JA[e]}})});var YA=wu();Object.keys(YA).forEach(function(e){e==="default"||e==="__esModule"||Object.prototype.hasOwnProperty.call(So,e)||e in Ce&&Ce[e]===YA[e]||Object.defineProperty(Ce,e,{enumerable:!0,get:function(){return YA[e]}})});var PSe=Zj(),ISe=Hj(),ASe=cA(),kSe=Jj(),CSe=Yj(),NSe=dA(),OSe=rB(),$Se=nB(),RSe=iB(),XA=Wi();Object.keys(XA).forEach(function(e){e==="default"||e==="__esModule"||Object.prototype.hasOwnProperty.call(So,e)||e in Ce&&Ce[e]===XA[e]||Object.defineProperty(Ce,e,{enumerable:!0,get:function(){return XA[e]}})});var DSe=sB(),MSe=oB(),LSe=cB(),FSe=yA(),jSe=bA(),BSe=DI(),zSe=lB(),USe=jf(),qSe=uB(),WSe=pB(),S_=fB();Object.keys(S_).forEach(function(e){e==="default"||e==="__esModule"||Object.prototype.hasOwnProperty.call(So,e)||e in Ce&&Ce[e]===S_[e]||Object.defineProperty(Ce,e,{enumerable:!0,get:function(){return S_[e]}})});var VSe=mA(),KSe=Qy(),GSe=Su(),ZSe=hB(),HSe=gB(),JSe=yB(),YSe=$A(),XSe=OI(),QSe=bB(),eTe=nI(),tTe=vB(),rTe=xB(),nTe=TB(),iTe=t_(),sTe=wB(),aTe=Tu(),oTe=EB(),cTe=YP(),lTe=s_(),uTe=QP(),QA=Vr();Object.keys(QA).forEach(function(e){e==="default"||e==="__esModule"||Object.prototype.hasOwnProperty.call(So,e)||e in Ce&&Ce[e]===QA[e]||Object.defineProperty(Ce,e,{enumerable:!0,get:function(){return QA[e]}})});var dTe=xu(),pTe=IB(),Pst=Ce.react={isReactComponent:cSe.default,isCompatTag:lSe.default,buildChildren:uSe.default};Ce.toSequenceExpression=pTe.default;process.env.BABEL_TYPES_8_BREAKING&&console.warn("BABEL_TYPES_8_BREAKING is not supported anymore. Use the latest Babel 8.0.0 pre-release instead!")});var ek=G(sn=>{"use strict";Object.defineProperty(sn,"__esModule",{value:!0});sn.isBindingIdentifier=DTe;sn.isBlockScoped=BTe;sn.isExpression=LTe;sn.isFlow=VTe;sn.isForAwaitStatement=ZTe;sn.isGenerated=qTe;sn.isPure=WTe;sn.isReferenced=jTe;sn.isReferencedIdentifier=$Te;sn.isReferencedMemberExpression=RTe;sn.isRestProperty=KTe;sn.isScope=FTe;sn.isSpreadProperty=GTe;sn.isStatement=MTe;sn.isUser=UTe;sn.isVar=zTe;var fTe=Rt(),{isBinding:hTe,isBlockScoped:mTe,isExportDeclaration:gTe,isExpression:yTe,isFlow:_Te,isForStatement:bTe,isForXStatement:vTe,isIdentifier:kB,isImportDeclaration:xTe,isImportSpecifier:STe,isJSXIdentifier:TTe,isJSXMemberExpression:wTe,isMemberExpression:ETe,isRestElement:CB,isReferenced:T_,isScope:PTe,isStatement:ITe,isVar:ATe,isVariableDeclaration:kTe,react:CTe,isForOfStatement:NTe}=fTe,{isCompatTag:OTe}=CTe;function $Te(e){let{node:t,parent:r}=this;return kB(t,e)?T_(t,r,this.parentPath.parent):TTe(t,e)?!wTe(r)&&OTe(t.name)?!1:T_(t,r,this.parentPath.parent):!1}function RTe(){let{node:e,parent:t}=this;return ETe(e)&&T_(e,t)}function DTe(){let{node:e,parent:t}=this,r=this.parentPath.parent;return kB(e)&&hTe(e,t,r)}function MTe(){let{node:e,parent:t}=this;return ITe(e)?!(kTe(e)&&(vTe(t,{left:e})||bTe(t,{init:e}))):!1}function LTe(){return this.isIdentifier()?this.isReferencedIdentifier():yTe(this.node)}function FTe(){return PTe(this.node,this.parent)}function jTe(){return T_(this.node,this.parent)}function BTe(){return mTe(this.node)}function zTe(){return ATe(this.node)}function UTe(){var e;return!!((e=this.node)!=null&&e.loc)}function qTe(){return!this.isUser()}function WTe(e){return this.scope.isPure(this.node,e)}function VTe(){let{node:e}=this;return _Te(e)?!0:xTe(e)?e.importKind==="type"||e.importKind==="typeof":gTe(e)?e.exportKind==="type":STe(e)?e.importKind==="type"||e.importKind==="typeof":!1}function KTe(){var e;return CB(this.node)&&((e=this.parentPath)==null?void 0:e.isObjectPattern())}function GTe(){var e;return CB(this.node)&&((e=this.parentPath)==null?void 0:e.isObjectExpression())}function ZTe(){return NTe(this.node,{await:!0})}sn.isExistentialTypeParam=function(){throw new Error("`path.isExistentialTypeParam` has been renamed to `path.isExistsTypeAnnotation()` in Babel 7.")};sn.isNumericLiteralTypeAnnotation=function(){throw new Error("`path.isNumericLiteralTypeAnnotation()` has been renamed to `path.isNumberLiteralTypeAnnotation()` in Babel 7.")}});var zf=G(Cc=>{"use strict";Object.defineProperty(Cc,"__esModule",{value:!0});Cc.environmentVisitor=rwe;Cc.explode=zB;Cc.isExplodedVisitor=BB;Cc.merge=qB;Cc.verify=UB;var jB=qP(),HTe=ek(),JTe=Rt(),NB=Ki(),{DEPRECATED_KEYS:OB,DEPRECATED_ALIASES:$B,FLIPPED_ALIAS_KEYS:RB,TYPES:YTe,__internal__deprecationWarning:DB}=JTe;function XTe(e){return e in jB}function BB(e){return e?._exploded}function zB(e){if(BB(e))return e;e._exploded=!0;for(let r of Object.keys(e)){if(kc(r))continue;let n=r.split("|");if(n.length===1)continue;let s=e[r];delete e[r];for(let a of n)e[a]=s}UB(e),delete e.__esModule,QTe(e),FB(e);for(let r of Object.keys(e)){if(kc(r)||!XTe(r))continue;let n=e[r];for(let a of Object.keys(n))n[a]=ewe(r,n[a]);delete e[r];let s=jB[r];if(s!==null)for(let a of s){var t;(t=e[a])!=null||(e[a]={}),Bf(e[a],n)}else Bf(e,n)}for(let r of Object.keys(e)){if(kc(r))continue;let n=RB[r];if(r in OB){let a=OB[r];DB(r,a,"Visitor "),n=[a]}else if(r in $B){let a=$B[r];DB(r,a,"Visitor "),n=RB[a]}if(!n)continue;let s=e[r];delete e[r];for(let a of n){let o=e[a];o?Bf(o,s):e[a]=Object.assign({},s)}}for(let r of Object.keys(e))kc(r)||FB(e[r]);return e}function UB(e){if(!e._verified){if(typeof e=="function")throw new Error("You passed `traverse()` a function when it expected a visitor object, are you sure you didn't mean `{ enter: Function }`?");for(let t of Object.keys(e)){if((t==="enter"||t==="exit")&&MB(t,e[t]),kc(t))continue;if(!YTe.includes(t))throw new Error(`You gave us a visitor for the node type ${t} but it's not a valid type in @babel/traverse 7.29.0`);let r=e[t];if(typeof r=="object")for(let n of Object.keys(r))if(n==="enter"||n==="exit")MB(`${t}.${n}`,r[n]);else throw new Error(`You passed \`traverse()\` a visitor object with the property ${t} that has the invalid property ${n}`)}e._verified=!0}}function MB(e,t){let r=[].concat(t);for(let n of r)if(typeof n!="function")throw new TypeError(`Non-function found defined in ${e} with type ${typeof n}`)}function qB(e,t=[],r){let n={_verified:!0,_exploded:!0};Object.defineProperty(n,"_exploded",{enumerable:!1}),Object.defineProperty(n,"_verified",{enumerable:!1});for(let s=0;s<e.length;s++){let a=zB(e[s]),o=t[s],c=a;(o||r)&&(c=LB(c,o,r)),Bf(n,c);for(let l of Object.keys(a)){if(kc(l))continue;let u=a[l];(o||r)&&(u=LB(u,o,r));let d=n[l]||(n[l]={});Bf(d,u)}}return n}function LB(e,t,r){let n={};for(let s of["enter","exit"]){let a=e[s];Array.isArray(a)&&(a=a.map(function(o){let c=o;return t&&(c=function(l){o.call(t,l,t)}),r&&(c=r(t?.key,s,c)),c!==o&&(c.toString=()=>o.toString()),c}),n[s]=a)}return n}function QTe(e){for(let t of Object.keys(e)){if(kc(t))continue;let r=e[t];typeof r=="function"&&(e[t]={enter:r})}}function FB(e){e.enter&&!Array.isArray(e.enter)&&(e.enter=[e.enter]),e.exit&&!Array.isArray(e.exit)&&(e.exit=[e.exit])}function ewe(e,t){let r=`is${e}`,n=HTe[r],s=function(a){if(n.call(a))return t.apply(this,arguments)};return s.toString=()=>t.toString(),s}function kc(e){return!!(e.startsWith("_")||e==="enter"||e==="exit"||e==="shouldSkip"||e==="denylist"||e==="noScope"||e==="skipKeys"||e==="blacklist")}function Bf(e,t){for(let r of["enter","exit"])t[r]&&(e[r]=[].concat(e[r]||[],t[r]))}var twe={FunctionParent(e){e.isArrowFunctionExpression()||(e.skip(),e.isMethod()&&(e.requeueComputedKeyAndDecorators?e.requeueComputedKeyAndDecorators():NB.requeueComputedKeyAndDecorators.call(e)))},Property(e){e.isObjectProperty()||(e.skip(),e.requeueComputedKeyAndDecorators?e.requeueComputedKeyAndDecorators():NB.requeueComputedKeyAndDecorators.call(e))}};function rwe(e){return qB([twe,e])}});var WB=G(E_=>{"use strict";Object.defineProperty(E_,"__esModule",{value:!0});E_.default=void 0;var w_=Rt(),nwe=w_,iwe=P_(),swe=zf(),awe=Ki(),{getAssignmentIdentifiers:owe}=nwe,cwe={ReferencedIdentifier({node:e},t){e.name===t.oldName&&(e.name=t.newName)},Scope(e,t){e.scope.bindingIdentifierEquals(t.oldName,t.binding.identifier)||(e.skip(),e.isMethod()&&(e.requeueComputedKeyAndDecorators?e.requeueComputedKeyAndDecorators():awe.requeueComputedKeyAndDecorators.call(e)),e.isSwitchStatement()&&e.context.maybeQueue(e.get("discriminant")))},ObjectProperty({node:e,scope:t},r){let{name:n}=e.key;if(e.shorthand&&(n===r.oldName||n===r.newName)&&t.getBindingIdentifier(n)===r.binding.identifier){var s;e.shorthand=!1,(s=e.extra)!=null&&s.shorthand&&(e.extra.shorthand=!1)}},"AssignmentExpression|Declaration|VariableDeclarator"(e,t){if(e.isVariableDeclaration())return;let r=e.isAssignmentExpression()?owe(e.node):e.getOuterBindingIdentifiers();for(let n in r)n===t.oldName&&(r[n].name=t.newName)}},tk=class{constructor(t,r,n){this.newName=n,this.oldName=r,this.binding=t}maybeConvertFromExportDeclaration(t){let r=t.parentPath;if(r.isExportDeclaration()){if(r.isExportDefaultDeclaration()){let{declaration:n}=r.node;if(w_.isDeclaration(n)&&!n.id)return}r.isExportAllDeclaration()||r.splitExportDeclaration()}}maybeConvertFromClassFunctionDeclaration(t){return t}maybeConvertFromClassFunctionExpression(t){return t}rename(){let{binding:t,oldName:r,newName:n}=this,{scope:s,path:a}=t,o=a.find(u=>u.isDeclaration()||u.isFunctionExpression()||u.isClassExpression());o&&o.getOuterBindingIdentifiers()[r]===t.identifier&&this.maybeConvertFromExportDeclaration(o);let c=arguments[0]||s.block,l={discriminant:!0};w_.isMethod(c)&&(c.computed&&(l.key=!0),w_.isObjectMethod(c)||(l.decorators=!0)),(0,iwe.traverseNode)(c,(0,swe.explode)(cwe),s,this,s.path,l),arguments[0]||(s.removeOwnBinding(r),s.bindings[n]=t,this.binding.identifier.name=n),o&&(this.maybeConvertFromClassFunctionDeclaration(a),this.maybeConvertFromClassFunctionExpression(a))}};E_.default=tk});var VB=G(rk=>{"use strict";Object.defineProperty(rk,"__esModule",{value:!0});rk.default=hwe;var lwe=Rt(),uwe=Ta(),dwe=zf(),pwe=Ki(),{VISITOR_KEYS:fwe}=lwe;function hwe(e,t,r){let n=(0,dwe.explode)(t);if(n.enter||n.exit)throw new Error("Should not be used with enter/exit visitors.");s(e.parentPath,e.parent,e.node,e.container,e.key,e.listKey,e.hub,e);function s(a,o,c,l,u,d,p,f){if(!c)return;let h=f||uwe.NodePath.get({hub:p,parentPath:a,parent:o,container:l,listKey:d,key:u});pwe._forceSetScope.call(h);let m=n[c.type];if(m!=null&&m.enter)for(let y of m.enter)y.call(r,h,r);if(h.shouldSkip)return;let g=fwe[c.type];if(g!=null&&g.length){for(let y of g){let _=c[y];if(_)if(Array.isArray(_))for(let v=0;v<_.length;v++){let S=_[v];s(h,c,S,_,v,y)}else s(h,c,_,c,y,null)}if(m!=null&&m.exit)for(let y of m.exit)y.call(r,h,r)}}}});var KB=G(I_=>{"use strict";Object.defineProperty(I_,"__esModule",{value:!0});I_.default=void 0;var nk=class{constructor({identifier:t,scope:r,path:n,kind:s}){this.identifier=void 0,this.scope=void 0,this.path=void 0,this.kind=void 0,this.constantViolations=[],this.constant=!0,this.referencePaths=[],this.referenced=!1,this.references=0,this.identifier=t,this.scope=r,this.path=n,this.kind=s,(s==="var"||s==="hoisted")&&mwe(n)&&this.reassign(n),this.clearValue()}deoptValue(){this.clearValue(),this.hasDeoptedValue=!0}setValue(t){this.hasDeoptedValue||(this.hasValue=!0,this.value=t)}clearValue(){this.hasDeoptedValue=!1,this.hasValue=!1,this.value=null}reassign(t){this.constant=!1,!this.constantViolations.includes(t)&&this.constantViolations.push(t)}reference(t){this.referencePaths.includes(t)||(this.referenced=!0,this.references++,this.referencePaths.push(t))}dereference(){this.references--,this.referenced=!!this.references}};I_.default=nk;function mwe(e){let t=!e.isVariableDeclarator()||e.node.init;for(let{parentPath:r,key:n}=e;r;{parentPath:r,key:n}=r){if(r.isFunctionParent())return!1;if(n==="left"&&r.isForXStatement()||t&&n==="body"&&r.isLoop())return!0}return!1}});var Nc=G(Ii=>{"use strict";Object.defineProperty(Ii,"__esModule",{value:!0});Ii.clear=ywe;Ii.clearPath=GB;Ii.clearScope=ZB;Ii.getCachedPaths=_we;Ii.getOrCreateCachedPaths=bwe;Ii.scope=Ii.path=void 0;var A_=Ii.path=new WeakMap,gwe=Ii.scope=new WeakMap;function ywe(){GB(),ZB()}function GB(){Ii.path=A_=new WeakMap}function ZB(){Ii.scope=gwe=new WeakMap}function _we(e){let{parent:t,parentPath:r}=e;return A_.get(t)}function bwe(e,t){let r=A_.get(e);return r||A_.set(e,r=new Map),r}});var HB=G((Rst,vwe)=>{vwe.exports=["decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","eval","globalThis","isFinite","isNaN","parseFloat","parseInt","undefined","unescape"]});var JB=G((Dst,xwe)=>{xwe.exports=["AggregateError","Array","ArrayBuffer","Atomics","BigInt","BigInt64Array","BigUint64Array","Boolean","DataView","Date","Error","EvalError","FinalizationRegistry","Float16Array","Float32Array","Float64Array","Function","Infinity","Int16Array","Int32Array","Int8Array","Intl","Iterator","JSON","Map","Math","NaN","Number","Object","Promise","Proxy","RangeError","ReferenceError","Reflect","RegExp","Set","SharedArrayBuffer","String","Symbol","SyntaxError","TypeError","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray","URIError","WeakMap","WeakRef","WeakSet"]});var ok=G(C_=>{"use strict";Object.defineProperty(C_,"__esModule",{value:!0});C_.default=void 0;var Swe=WB(),a4=Ta(),Mst=VB(),Twe=KB(),o4=Rt(),c4=o4,YB=Nc(),wwe=HB(),Ewe=JB(),{assignmentExpression:Pwe,callExpression:XB,cloneNode:QB,getBindingIdentifiers:l4,identifier:$c,isArrayExpression:u4,isBinary:Iwe,isCallExpression:e4,isClass:Awe,isClassBody:kwe,isClassDeclaration:Cwe,isExportAllDeclaration:d4,isExportDefaultDeclaration:Nwe,isExportNamedDeclaration:ik,isFunctionDeclaration:Owe,isIdentifier:Oc,isImportDeclaration:sk,isLiteral:$we,isMemberExpression:Rwe,isMethod:Dwe,isModuleSpecifier:Mwe,isNullLiteral:Lwe,isObjectExpression:Fwe,isProperty:jwe,isPureish:Bwe,isRegExpLiteral:zwe,isSuper:Uwe,isTaggedTemplateExpression:qwe,isTemplateLiteral:p4,isThisExpression:t4,isUnaryExpression:Wwe,isVariableDeclaration:Vwe,expressionStatement:Kwe,matchesPattern:r4,memberExpression:ak,numericLiteral:Gwe,toIdentifier:Zwe,variableDeclaration:Hwe,variableDeclarator:Jwe,isObjectProperty:Ywe,isTopicReference:n4,isMetaProperty:Xwe,isPrivateName:Qwe,isExportDeclaration:e0e,buildUndefinedNode:t0e,sequenceExpression:r0e}=o4;function Pr(e,t){switch(e?.type){default:if(sk(e)||e0e(e)){var r;if((d4(e)||ik(e)||sk(e))&&e.source)Pr(e.source,t);else if((ik(e)||sk(e))&&(r=e.specifiers)!=null&&r.length)for(let n of e.specifiers)Pr(n,t);else(Nwe(e)||ik(e))&&e.declaration&&Pr(e.declaration,t)}else Mwe(e)?Pr(e.local,t):$we(e)&&!Lwe(e)&&!zwe(e)&&!p4(e)&&t.push(e.value);break;case"MemberExpression":case"OptionalMemberExpression":case"JSXMemberExpression":Pr(e.object,t),Pr(e.property,t);break;case"Identifier":case"JSXIdentifier":t.push(e.name);break;case"CallExpression":case"OptionalCallExpression":case"NewExpression":Pr(e.callee,t);break;case"ObjectExpression":case"ObjectPattern":for(let n of e.properties)Pr(n,t);break;case"SpreadElement":case"RestElement":Pr(e.argument,t);break;case"ObjectProperty":case"ObjectMethod":case"ClassProperty":case"ClassMethod":case"ClassPrivateProperty":case"ClassPrivateMethod":Pr(e.key,t);break;case"ThisExpression":t.push("this");break;case"Super":t.push("super");break;case"Import":case"ImportExpression":t.push("import");break;case"DoExpression":t.push("do");break;case"YieldExpression":t.push("yield"),Pr(e.argument,t);break;case"AwaitExpression":t.push("await"),Pr(e.argument,t);break;case"AssignmentExpression":Pr(e.left,t);break;case"VariableDeclarator":Pr(e.id,t);break;case"FunctionExpression":case"FunctionDeclaration":case"ClassExpression":case"ClassDeclaration":Pr(e.id,t);break;case"PrivateName":Pr(e.id,t);break;case"ParenthesizedExpression":Pr(e.expression,t);break;case"UnaryExpression":case"UpdateExpression":Pr(e.argument,t);break;case"MetaProperty":Pr(e.meta,t),Pr(e.property,t);break;case"JSXElement":Pr(e.openingElement,t);break;case"JSXOpeningElement":Pr(e.name,t);break;case"JSXFragment":Pr(e.openingFragment,t);break;case"JSXOpeningFragment":t.push("Fragment");break;case"JSXNamespacedName":Pr(e.namespace,t),Pr(e.name,t);break}}function i4(e){e.references=Object.create(null),e.uids=Object.create(null),e.bindings=Object.create(null),e.globals=Object.create(null)}function n0e(e){return e.isFunctionExpression()&&!e.node.id||e.isArrowFunctionExpression()}var s4=Symbol.for("should not be considered a local binding"),i0e={ForStatement(e){let t=e.get("init");if(t.isVar()){let{scope:r}=e;(r.getFunctionParent()||r.getProgramParent()).registerBinding("var",t)}},Declaration(e){if(e.isBlockScoped()||e.isImportDeclaration()||e.isExportDeclaration())return;(e.scope.getFunctionParent()||e.scope.getProgramParent()).registerDeclaration(e)},ImportDeclaration(e){e.scope.getBlockParent().registerDeclaration(e)},TSImportEqualsDeclaration(e){e.scope.getBlockParent().registerDeclaration(e)},ReferencedIdentifier(e,t){c4.isTSQualifiedName(e.parent)&&e.parent.right===e.node||e.parentPath.isTSImportEqualsDeclaration()||t.references.push(e)},ForXStatement(e,t){let r=e.get("left");if(r.isPattern()||r.isIdentifier())t.constantViolations.push(e);else if(r.isVar()){let{scope:n}=e;(n.getFunctionParent()||n.getProgramParent()).registerBinding("var",r)}},ExportDeclaration:{exit(e){let{node:t,scope:r}=e;if(d4(t))return;let n=t.declaration;if(Cwe(n)||Owe(n)){let s=n.id;if(!s)return;let a=r.getBinding(s.name);a?.reference(e)}else if(Vwe(n))for(let s of n.declarations)for(let a of Object.keys(l4(s))){let o=r.getBinding(a);o?.reference(e)}}},LabeledStatement(e){e.scope.getBlockParent().registerDeclaration(e)},AssignmentExpression(e,t){t.assignments.push(e)},UpdateExpression(e,t){t.constantViolations.push(e)},UnaryExpression(e,t){e.node.operator==="delete"&&t.constantViolations.push(e)},BlockScoped(e){let t=e.scope;if(t.path===e&&(t=t.parent),t.getBlockParent().registerDeclaration(e),e.isClassDeclaration()&&e.node.id){let s=e.node.id.name;e.scope.bindings[s]=e.scope.parent.getBinding(s)}},CatchClause(e){e.scope.registerBinding("let",e)},Function(e){let t=e.get("params");for(let r of t)e.scope.registerBinding("param",r);e.isFunctionExpression()&&e.node.id&&!e.node.id[s4]&&e.scope.registerBinding("local",e.get("id"),e)},ClassExpression(e){e.node.id&&!e.node.id[s4]&&e.scope.registerBinding("local",e.get("id"),e)},TSTypeAnnotation(e){e.skip()}},k_,s0e=0,xs=class e{constructor(t){this.uid=void 0,this.path=void 0,this.block=void 0,this.inited=void 0,this.labels=void 0,this.bindings=void 0,this.referencesSet=void 0,this.globals=void 0,this.uidsSet=void 0,this.data=void 0,this.crawling=void 0;let{node:r}=t,n=YB.scope.get(r);if(n?.path===t)return n;YB.scope.set(r,this),this.uid=s0e++,this.block=r,this.path=t,this.labels=new Map,this.inited=!1,Object.defineProperties(this,{references:{enumerable:!0,configurable:!0,writable:!0,value:Object.create(null)},uids:{enumerable:!0,configurable:!0,writable:!0,value:Object.create(null)}})}get parent(){var t;let r,n=this.path;do{var s;let a=n.key==="key"||n.listKey==="decorators";n=n.parentPath,a&&n.isMethod()&&(n=n.parentPath),(s=n)!=null&&s.isScope()&&(r=n)}while(n&&!r);return(t=r)==null?void 0:t.scope}get references(){throw new Error("Scope#references is not available in Babel 8. Use Scope#referencesSet instead.")}get uids(){throw new Error("Scope#uids is not available in Babel 8. Use Scope#uidsSet instead.")}generateDeclaredUidIdentifier(t){let r=this.generateUidIdentifier(t);return this.push({id:r}),QB(r)}generateUidIdentifier(t){return $c(this.generateUid(t))}generateUid(t="temp"){t=Zwe(t).replace(/^_+/,"").replace(/\d+$/g,"");let r,n=0;do r=`_${t}`,n>=11?r+=n-1:n>=9?r+=n-9:n>=1&&(r+=n+1),n++;while(this.hasLabel(r)||this.hasBinding(r)||this.hasGlobal(r)||this.hasReference(r));let s=this.getProgramParent();return s.references[r]=!0,s.uids[r]=!0,r}generateUidBasedOnNode(t,r){let n=[];Pr(t,n);let s=n.join("$");return s=s.replace(/^_/,"")||r||"ref",this.generateUid(s.slice(0,20))}generateUidIdentifierBasedOnNode(t,r){return $c(this.generateUidBasedOnNode(t,r))}isStatic(t){if(t4(t)||Uwe(t)||n4(t))return!0;if(Oc(t)){let r=this.getBinding(t.name);return r?r.constant:this.hasBinding(t.name)}return!1}maybeGenerateMemoised(t,r){if(this.isStatic(t))return null;{let n=this.generateUidIdentifierBasedOnNode(t);return r?n:(this.push({id:n}),QB(n))}}checkBlockScopedCollisions(t,r,n,s){if(r==="param"||t.kind==="local")return;if(r==="let"||t.kind==="let"||t.kind==="const"||t.kind==="module"||t.kind==="param"&&r==="const")throw this.path.hub.buildError(s,`Duplicate declaration "${n}"`,TypeError)}rename(t,r){let n=this.getBinding(t);n&&(r||(r=this.generateUidIdentifier(t).name),new Swe.default(n,t,r).rename(arguments[2]))}dump(){let t="-".repeat(60);console.log(t);let r=this;do{console.log("#",r.block.type);for(let n of Object.keys(r.bindings)){let s=r.bindings[n];console.log(" -",n,{constant:s.constant,references:s.references,violations:s.constantViolations.length,kind:s.kind})}}while(r=r.parent);console.log(t)}hasLabel(t){return!!this.getLabel(t)}getLabel(t){return this.labels.get(t)}registerLabel(t){this.labels.set(t.node.label.name,t)}registerDeclaration(t){if(t.isLabeledStatement())this.registerLabel(t);else if(t.isFunctionDeclaration())this.registerBinding("hoisted",t.get("id"),t);else if(t.isVariableDeclaration()){let r=t.get("declarations"),{kind:n}=t.node;for(let s of r)this.registerBinding(n==="using"||n==="await using"?"const":n,s)}else if(t.isClassDeclaration()){if(t.node.declare)return;this.registerBinding("let",t)}else if(t.isImportDeclaration()){let r=t.node.importKind==="type"||t.node.importKind==="typeof",n=t.get("specifiers");for(let s of n){let a=r||s.isImportSpecifier()&&(s.node.importKind==="type"||s.node.importKind==="typeof");this.registerBinding(a?"unknown":"module",s)}}else if(t.isExportDeclaration()){let r=t.get("declaration");(r.isClassDeclaration()||r.isFunctionDeclaration()||r.isVariableDeclaration())&&this.registerDeclaration(r)}else this.registerBinding("unknown",t)}buildUndefinedNode(){return t0e()}registerConstantViolation(t){let r=t.getAssignmentIdentifiers();for(let s of Object.keys(r)){var n;(n=this.getBinding(s))==null||n.reassign(t)}}registerBinding(t,r,n=r){if(!t)throw new ReferenceError("no `kind`");if(r.isVariableDeclaration()){let o=r.get("declarations");for(let c of o)this.registerBinding(t,c);return}let s=this.getProgramParent(),a=r.getOuterBindingIdentifiers(!0);for(let o of Object.keys(a)){s.references[o]=!0;for(let c of a[o]){let l=this.getOwnBinding(o);if(l){if(l.identifier===c)continue;this.checkBlockScopedCollisions(l,t,o,c)}l?l.reassign(n):this.bindings[o]=new Twe.default({identifier:c,scope:this,path:n,kind:t})}}}addGlobal(t){this.globals[t.name]=t}hasUid(t){let r=this;do if(r.uids[t])return!0;while(r=r.parent);return!1}hasGlobal(t){let r=this;do if(r.globals[t])return!0;while(r=r.parent);return!1}hasReference(t){return!!this.getProgramParent().references[t]}isPure(t,r){if(Oc(t)){let o=this.getBinding(t.name);return o?r?o.constant:!0:!1}else{if(t4(t)||Xwe(t)||n4(t)||Qwe(t))return!0;if(Awe(t)){var n;return t.superClass&&!this.isPure(t.superClass,r)||((n=t.decorators)==null?void 0:n.length)>0?!1:this.isPure(t.body,r)}else if(kwe(t)){for(let o of t.body)if(!this.isPure(o,r))return!1;return!0}else{if(Iwe(t))return this.isPure(t.left,r)&&this.isPure(t.right,r);if(u4(t)||t?.type==="TupleExpression"){for(let o of t.elements)if(o!==null&&!this.isPure(o,r))return!1;return!0}else if(Fwe(t)||t?.type==="RecordExpression"){for(let o of t.properties)if(!this.isPure(o,r))return!1;return!0}else if(Dwe(t)){var s;return!(t.computed&&!this.isPure(t.key,r)||((s=t.decorators)==null?void 0:s.length)>0)}else if(jwe(t)){var a;return!(t.computed&&!this.isPure(t.key,r)||((a=t.decorators)==null?void 0:a.length)>0||(Ywe(t)||t.static)&&t.value!==null&&!this.isPure(t.value,r))}else{if(Wwe(t))return this.isPure(t.argument,r);if(p4(t)){for(let o of t.expressions)if(!this.isPure(o,r))return!1;return!0}else return qwe(t)?r4(t.tag,"String.raw")&&!this.hasBinding("String",{noGlobals:!0})&&this.isPure(t.quasi,r):Rwe(t)?!t.computed&&Oc(t.object)&&t.object.name==="Symbol"&&Oc(t.property)&&t.property.name!=="for"&&!this.hasBinding("Symbol",{noGlobals:!0}):e4(t)?r4(t.callee,"Symbol.for")&&!this.hasBinding("Symbol",{noGlobals:!0})&&t.arguments.length===1&&c4.isStringLiteral(t.arguments[0]):Bwe(t)}}}}setData(t,r){return this.data[t]=r}getData(t){let r=this;do{let n=r.data[t];if(n!=null)return n}while(r=r.parent)}removeData(t){let r=this;do r.data[t]!=null&&(r.data[t]=null);while(r=r.parent)}init(){this.inited||(this.inited=!0,this.crawl())}crawl(){let t=this.path;i4(this),this.data=Object.create(null);let r=this;do{if(r.crawling)return;if(r.path.isProgram())break}while(r=r.parent);let n=r,s={references:[],constantViolations:[],assignments:[]};if(this.crawling=!0,k_||(k_=a4.default.visitors.merge([{Scope(a){i4(a.scope)}},i0e])),t.type!=="Program"){let a=k_[t.type];if(a)for(let o of a.enter)o.call(s,t,s)}t.traverse(k_,s),this.crawling=!1;for(let a of s.assignments){let o=a.getAssignmentIdentifiers();for(let c of Object.keys(o))a.scope.getBinding(c)||n.addGlobal(o[c]);a.scope.registerConstantViolation(a)}for(let a of s.references){let o=a.scope.getBinding(a.node.name);o?o.reference(a):n.addGlobal(a.node)}for(let a of s.constantViolations)a.scope.registerConstantViolation(a)}push(t){let r=this.path;r.isPattern()?r=this.getPatternParent().path:!r.isBlockStatement()&&!r.isProgram()&&(r=this.getBlockParent().path),r.isSwitchStatement()&&(r=(this.getFunctionParent()||this.getProgramParent()).path);let{init:n,unique:s,kind:a="var",id:o}=t;if(!n&&!s&&(a==="var"||a==="let")&&n0e(r)&&e4(r.parent,{callee:r.node})&&r.parent.arguments.length<=r.node.params.length&&Oc(o)){r.pushContainer("params",o),r.scope.registerBinding("param",r.get("params")[r.node.params.length-1]);return}(r.isLoop()||r.isCatchClause()||r.isFunction())&&(r.ensureBlock(),r=r.get("body"));let c=t._blockHoist==null?2:t._blockHoist,l=`declaration:${a}:${c}`,u=!s&&r.getData(l);if(!u){let f=Hwe(a,[]);f._blockHoist=c,[u]=r.unshiftContainer("body",[f]),s||r.setData(l,u)}let d=Jwe(o,n),p=u.node.declarations.push(d);r.scope.registerBinding(a,u.get("declarations")[p-1])}getProgramParent(){let t=this;do if(t.path.isProgram())return t;while(t=t.parent);throw new Error("Couldn't find a Program")}getFunctionParent(){let t=this;do if(t.path.isFunctionParent())return t;while(t=t.parent);return null}getBlockParent(){let t=this;do if(t.path.isBlockParent())return t;while(t=t.parent);throw new Error("We couldn't find a BlockStatement, For, Switch, Function, Loop or Program...")}getPatternParent(){let t=this;do if(!t.path.isPattern())return t.getBlockParent();while(t=t.parent.parent);throw new Error("We couldn't find a BlockStatement, For, Switch, Function, Loop or Program...")}getAllBindings(){let t=Object.create(null),r=this;do{for(let n of Object.keys(r.bindings))n in t||(t[n]=r.bindings[n]);r=r.parent}while(r);return t}bindingIdentifierEquals(t,r){return this.getBindingIdentifier(t)===r}getBinding(t){let r=this,n;do{let a=r.getOwnBinding(t);if(a){var s;if(!((s=n)!=null&&s.isPattern()&&a.kind!=="param"&&a.kind!=="local"))return a}else if(!a&&t==="arguments"&&r.path.isFunction()&&!r.path.isArrowFunctionExpression())break;n=r.path}while(r=r.parent)}getOwnBinding(t){return this.bindings[t]}getBindingIdentifier(t){var r;return(r=this.getBinding(t))==null?void 0:r.identifier}getOwnBindingIdentifier(t){let r=this.bindings[t];return r?.identifier}hasOwnBinding(t){return!!this.getOwnBinding(t)}hasBinding(t,r){if(!t)return!1;let n,s,a;typeof r=="object"?(n=r.noGlobals,s=r.noUids,a=r.upToScope):typeof r=="boolean"&&(n=r);let o=this;do{if(a===o)break;if(o.hasOwnBinding(t))return!0}while(o=o.parent);return!!(!s&&this.hasUid(t)||!n&&e.globals.includes(t)||!n&&e.contextVariables.includes(t))}parentHasBinding(t,r){var n;return(n=this.parent)==null?void 0:n.hasBinding(t,r)}moveBindingTo(t,r){let n=this.getBinding(t);n&&(n.scope.removeOwnBinding(t),n.scope=r,r.bindings[t]=n)}removeOwnBinding(t){delete this.bindings[t]}removeBinding(t){var r;(r=this.getBinding(t))==null||r.scope.removeOwnBinding(t);let n=this;do n.uids[t]&&(n.uids[t]=!1);while(n=n.parent)}hoistVariables(t=r=>this.push({id:r})){this.crawl();let r=new Set;for(let n of Object.keys(this.bindings)){let s=this.bindings[n];if(!s)continue;let{path:a}=s;if(!a.isVariableDeclarator())continue;let{parent:o,parentPath:c}=a;if(o.kind!=="var"||r.has(o))continue;r.add(a.parent);let l,u=[];for(let d of o.declarations){l??(l=d.id),d.init&&u.push(Pwe("=",d.id,d.init));let p=Object.keys(l4(d,!1,!0,!0));for(let f of p)t($c(f),d.init!=null)}if(c.parentPath.isForXStatement({left:o}))c.replaceWith(l);else if(u.length===0)c.remove();else{let d=u.length===1?u[0]:r0e(u);c.parentPath.isForStatement({init:o})?c.replaceWith(d):c.replaceWith(Kwe(d))}}}};C_.default=xs;xs.globals=[...wwe,...Ewe];xs.contextVariables=["arguments","undefined","Infinity","NaN"];xs.prototype._renameFromMap=function(t,r,n,s){t[r]&&(t[n]=s,t[r]=null)};xs.prototype.traverse=function(e,t,r){(0,a4.default)(e,t,this,r,this.path)};xs.prototype._generateUid=function(t,r){let n=t;return r>1&&(n+=r),`_${n}`};xs.prototype.toArray=function(t,r,n){if(Oc(t)){let o=this.getBinding(t.name);if(o!=null&&o.constant&&o.path.isGenericType("Array"))return t}if(u4(t))return t;if(Oc(t,{name:"arguments"}))return XB(ak(ak(ak($c("Array"),$c("prototype")),$c("slice")),$c("call")),[t]);let s,a=[t];return r===!0?s="toConsumableArray":typeof r=="number"?(a.push(Gwe(r)),s="slicedToArray"):s="toArray",n&&(a.unshift(this.path.hub.addHelper(s)),s="maybeArrayLike"),XB(this.path.hub.addHelper(s),a)};xs.prototype.getAllBindingsOfKind=function(...t){let r=Object.create(null);for(let n of t){let s=this;do{for(let a of Object.keys(s.bindings)){let o=s.bindings[a];o.kind===n&&(r[a]=o)}s=s.parent}while(s)}return r};Object.defineProperties(xs.prototype,{parentBlock:{configurable:!0,enumerable:!0,get(){return this.path.parent}},hub:{configurable:!0,enumerable:!0,get(){return this.path.hub}}})});var lk=G((ck,Uf)=>{(function(e,t){if(typeof ck=="object"&&typeof Uf<"u")t(Uf),Uf.exports=r(Uf);else if(typeof define=="function"&&define.amd)define(["module"],function(n){t.apply(this,arguments),n.exports=r(n)});else{let n={exports:{}};t(n),e=typeof globalThis<"u"?globalThis:e||self,e.sourcemapCodec=r(n)}function r(n){return"default"in n.exports?n.exports.default:n.exports}})(ck,function(e){"use strict";var t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,a=(D,A)=>{for(var M in A)t(D,M,{get:A[M],enumerable:!0})},o=(D,A,M,z)=>{if(A&&typeof A=="object"||typeof A=="function")for(let ee of n(A))!s.call(D,ee)&&ee!==M&&t(D,ee,{get:()=>A[ee],enumerable:!(z=r(A,ee))||z.enumerable});return D},c=D=>o(t({},"__esModule",{value:!0}),D),l={};a(l,{decode:()=>H,decodeGeneratedRanges:()=>V,decodeOriginalScopes:()=>k,encode:()=>K,encodeGeneratedRanges:()=>te,encodeOriginalScopes:()=>N}),e.exports=c(l);var u=44,d=59,p="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",f=new Uint8Array(64),h=new Uint8Array(128);for(let D=0;D<p.length;D++){let A=p.charCodeAt(D);f[D]=A,h[A]=D}function m(D,A){let M=0,z=0,ee=0;do{let Se=D.next();ee=h[Se],M|=(ee&31)<<z,z+=5}while(ee&32);let le=M&1;return M>>>=1,le&&(M=-2147483648|-M),A+M}function g(D,A,M){let z=A-M;z=z<0?-z<<1|1:z<<1;do{let ee=z&31;z>>>=5,z>0&&(ee|=32),D.write(f[ee])}while(z>0);return A}function y(D,A){return D.pos>=A?!1:D.peek()!==u}var _=1024*16,v=typeof TextDecoder<"u"?new TextDecoder:typeof Buffer<"u"?{decode(D){return Buffer.from(D.buffer,D.byteOffset,D.byteLength).toString()}}:{decode(D){let A="";for(let M=0;M<D.length;M++)A+=String.fromCharCode(D[M]);return A}},S=class{constructor(){this.pos=0,this.out="",this.buffer=new Uint8Array(_)}write(D){let{buffer:A}=this;A[this.pos++]=D,this.pos===_&&(this.out+=v.decode(A),this.pos=0)}flush(){let{buffer:D,out:A,pos:M}=this;return M>0?A+v.decode(D.subarray(0,M)):A}},w=class{constructor(D){this.pos=0,this.buffer=D}next(){return this.buffer.charCodeAt(this.pos++)}peek(){return this.buffer.charCodeAt(this.pos)}indexOf(D){let{buffer:A,pos:M}=this,z=A.indexOf(D,M);return z===-1?A.length:z}},E=[];function k(D){let{length:A}=D,M=new w(D),z=[],ee=[],le=0;for(;M.pos<A;M.pos++){le=m(M,le);let Se=m(M,0);if(!y(M,A)){let Xe=ee.pop();Xe[2]=le,Xe[3]=Se;continue}let we=m(M,0),Ae=m(M,0)&1?[le,Se,0,0,we,m(M,0)]:[le,Se,0,0,we],ke=E;if(y(M,A)){ke=[];do{let Xe=m(M,0);ke.push(Xe)}while(y(M,A))}Ae.vars=ke,z.push(Ae),ee.push(Ae)}return z}function N(D){let A=new S;for(let M=0;M<D.length;)M=O(D,M,A,[0]);return A.flush()}function O(D,A,M,z){let ee=D[A],{0:le,1:Se,2:we,3:he,4:xe,vars:Ae}=ee;A>0&&M.write(u),z[0]=g(M,le,z[0]),g(M,Se,0),g(M,xe,0);let ke=ee.length===6?1:0;g(M,ke,0),ee.length===6&&g(M,ee[5],0);for(let Xe of Ae)g(M,Xe,0);for(A++;A<D.length;){let Xe=D[A],{0:De,1:et}=Xe;if(De>we||De===we&&et>=he)break;A=O(D,A,M,z)}return M.write(u),z[0]=g(M,we,z[0]),g(M,he,0),A}function V(D){let{length:A}=D,M=new w(D),z=[],ee=[],le=0,Se=0,we=0,he=0,xe=0,Ae=0,ke=0,Xe=0;do{let De=M.indexOf(";"),et=0;for(;M.pos<De;M.pos++){if(et=m(M,et),!y(M,De)){let Oe=ee.pop();Oe[2]=le,Oe[3]=et;continue}let tt=m(M,0),jt=tt&1,wt=tt&2,zr=tt&4,fe=null,ye=E,Pe;if(jt){let Oe=m(M,Se);we=m(M,Se===Oe?we:0),Se=Oe,Pe=[le,et,0,0,Oe,we]}else Pe=[le,et,0,0];if(Pe.isScope=!!zr,wt){let Oe=he,Qe=xe;he=m(M,he);let _t=Oe===he;xe=m(M,_t?xe:0),Ae=m(M,_t&&Qe===xe?Ae:0),fe=[he,xe,Ae]}if(Pe.callsite=fe,y(M,De)){ye=[];do{ke=le,Xe=et;let Oe=m(M,0),Qe;if(Oe<-1){Qe=[[m(M,0)]];for(let _t=-1;_t>Oe;_t--){let St=ke;ke=m(M,ke),Xe=m(M,ke===St?Xe:0);let ir=m(M,0);Qe.push([ir,ke,Xe])}}else Qe=[[Oe]];ye.push(Qe)}while(y(M,De))}Pe.bindings=ye,z.push(Pe),ee.push(Pe)}le++,M.pos=De+1}while(M.pos<A);return z}function te(D){if(D.length===0)return"";let A=new S;for(let M=0;M<D.length;)M=W(D,M,A,[0,0,0,0,0,0,0]);return A.flush()}function W(D,A,M,z){let ee=D[A],{0:le,1:Se,2:we,3:he,isScope:xe,callsite:Ae,bindings:ke}=ee;z[0]<le?($(M,z[0],le),z[0]=le,z[1]=0):A>0&&M.write(u),z[1]=g(M,ee[1],z[1]);let Xe=(ee.length===6?1:0)|(Ae?2:0)|(xe?4:0);if(g(M,Xe,0),ee.length===6){let{4:De,5:et}=ee;De!==z[2]&&(z[3]=0),z[2]=g(M,De,z[2]),z[3]=g(M,et,z[3])}if(Ae){let{0:De,1:et,2:tt}=ee.callsite;De!==z[4]?(z[5]=0,z[6]=0):et!==z[5]&&(z[6]=0),z[4]=g(M,De,z[4]),z[5]=g(M,et,z[5]),z[6]=g(M,tt,z[6])}if(ke)for(let De of ke){De.length>1&&g(M,-De.length,0);let et=De[0][0];g(M,et,0);let tt=le,jt=Se;for(let wt=1;wt<De.length;wt++){let zr=De[wt];tt=g(M,zr[1],tt),jt=g(M,zr[2],jt),g(M,zr[0],0)}}for(A++;A<D.length;){let De=D[A],{0:et,1:tt}=De;if(et>we||et===we&&tt>=he)break;A=W(D,A,M,z)}return z[0]<we?($(M,z[0],we),z[0]=we,z[1]=0):M.write(u),z[1]=g(M,he,z[1]),A}function $(D,A,M){do D.write(d);while(++A<M)}function H(D){let{length:A}=D,M=new w(D),z=[],ee=0,le=0,Se=0,we=0,he=0;do{let xe=M.indexOf(";"),Ae=[],ke=!0,Xe=0;for(ee=0;M.pos<xe;){let De;ee=m(M,ee),ee<Xe&&(ke=!1),Xe=ee,y(M,xe)?(le=m(M,le),Se=m(M,Se),we=m(M,we),y(M,xe)?(he=m(M,he),De=[ee,le,Se,we,he]):De=[ee,le,Se,we]):De=[ee],Ae.push(De),M.pos++}ke||Y(Ae),z.push(Ae),M.pos=xe+1}while(M.pos<=A);return z}function Y(D){D.sort(ae)}function ae(D,A){return D[0]-A[0]}function K(D){let A=new S,M=0,z=0,ee=0,le=0;for(let Se=0;Se<D.length;Se++){let we=D[Se];if(Se>0&&A.write(d),we.length===0)continue;let he=0;for(let xe=0;xe<we.length;xe++){let Ae=we[xe];xe>0&&A.write(u),he=g(A,Ae[0],he),Ae.length!==1&&(M=g(A,Ae[1],M),z=g(A,Ae[2],z),ee=g(A,Ae[3],ee),Ae.length!==4&&(le=g(A,Ae[4],le)))}}return A.flush()}})});var f4=G((uk,dk)=>{(function(e,t){typeof uk=="object"&&typeof dk<"u"?dk.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.resolveURI=t())})(uk,function(){"use strict";let e=/^[\w+.-]+:\/\//,t=/^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/,r=/^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i;function n(y){return e.test(y)}function s(y){return y.startsWith("//")}function a(y){return y.startsWith("/")}function o(y){return y.startsWith("file:")}function c(y){return/^[.?#]/.test(y)}function l(y){let _=t.exec(y);return d(_[1],_[2]||"",_[3],_[4]||"",_[5]||"/",_[6]||"",_[7]||"")}function u(y){let _=r.exec(y),v=_[2];return d("file:","",_[1]||"","",a(v)?v:"/"+v,_[3]||"",_[4]||"")}function d(y,_,v,S,w,E,k){return{scheme:y,user:_,host:v,port:S,path:w,query:E,hash:k,type:7}}function p(y){if(s(y)){let v=l("http:"+y);return v.scheme="",v.type=6,v}if(a(y)){let v=l("http://foo.com"+y);return v.scheme="",v.host="",v.type=5,v}if(o(y))return u(y);if(n(y))return l(y);let _=l("http://foo.com/"+y);return _.scheme="",_.host="",_.type=y?y.startsWith("?")?3:y.startsWith("#")?2:4:1,_}function f(y){if(y.endsWith("/.."))return y;let _=y.lastIndexOf("/");return y.slice(0,_+1)}function h(y,_){m(_,_.type),y.path==="/"?y.path=_.path:y.path=f(_.path)+y.path}function m(y,_){let v=_<=4,S=y.path.split("/"),w=1,E=0,k=!1;for(let O=1;O<S.length;O++){let V=S[O];if(!V){k=!0;continue}if(k=!1,V!=="."){if(V===".."){E?(k=!0,E--,w--):v&&(S[w++]=V);continue}S[w++]=V,E++}}let N="";for(let O=1;O<w;O++)N+="/"+S[O];(!N||k&&!N.endsWith("/.."))&&(N+="/"),y.path=N}function g(y,_){if(!y&&!_)return"";let v=p(y),S=v.type;if(_&&S!==7){let E=p(_),k=E.type;switch(S){case 1:v.hash=E.hash;case 2:v.query=E.query;case 3:case 4:h(v,E);case 5:v.user=E.user,v.host=E.host,v.port=E.port;case 6:v.scheme=E.scheme}k>S&&(S=k)}m(v,S);let w=v.query+v.hash;switch(S){case 2:case 3:return w;case 4:{let E=v.path.slice(1);return E?c(_||y)&&!c(E)?"./"+E+w:E+w:w||"."}case 5:return v.path+w;default:return v.scheme+"//"+v.user+v.host+v.port+v.path+w}}return g})});var fk=G((pk,qf)=>{(function(e,t){if(typeof pk=="object"&&typeof qf<"u")t(qf,f4(),lk()),qf.exports=r(qf);else if(typeof define=="function"&&define.amd)define(["module","@jridgewell/resolve-uri","@jridgewell/sourcemap-codec"],function(n){t.apply(this,arguments),n.exports=r(n)});else{let n={exports:{}};t(n,e.resolveURI,e.sourcemapCodec),e=typeof globalThis<"u"?globalThis:e||self,e.traceMapping=r(n)}function r(n){return"default"in n.exports?n.exports.default:n.exports}})(pk,function(e,t,r){"use strict";var n=Object.create,s=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,c=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,u=(se,me)=>function(){return me||(0,se[o(se)[0]])((me={exports:{}}).exports,me),me.exports},d=(se,me)=>{for(var _e in me)s(se,_e,{get:me[_e],enumerable:!0})},p=(se,me,_e,oe)=>{if(me&&typeof me=="object"||typeof me=="function")for(let it of o(me))!l.call(se,it)&&it!==_e&&s(se,it,{get:()=>me[it],enumerable:!(oe=a(me,it))||oe.enumerable});return se},f=(se,me,_e)=>(_e=se!=null?n(c(se)):{},p(me||!se||!se.__esModule?s(_e,"default",{value:se,enumerable:!0}):_e,se)),h=se=>p(s({},"__esModule",{value:!0}),se),m=u({"umd:@jridgewell/sourcemap-codec"(se,me){me.exports=r}}),g=u({"umd:@jridgewell/resolve-uri"(se,me){me.exports=t}}),y={};d(y,{AnyMap:()=>he,FlattenMap:()=>he,GREATEST_LOWER_BOUND:()=>jt,LEAST_UPPER_BOUND:()=>tt,TraceMap:()=>wt,allGeneratedPositionsFor:()=>_t,decodedMap:()=>Ni,decodedMappings:()=>ye,eachMapping:()=>St,encodedMap:()=>qa,encodedMappings:()=>fe,generatedPositionFor:()=>Qe,isIgnored:()=>ks,originalPositionFor:()=>Oe,presortedDecodedMap:()=>on,sourceContentFor:()=>tn,traceSegment:()=>Pe}),e.exports=h(y);var _=f(m()),v=f(g());function S(se){if(!se)return"";let me=se.lastIndexOf("/");return se.slice(0,me+1)}function w(se,me){let _e=S(se),oe=me?me+"/":"";return it=>(0,v.default)(oe+(it||""),_e)}var E=0,k=1,N=2,O=3,V=4,te=1,W=2;function $(se,me){let _e=H(se,0);if(_e===se.length)return se;me||(se=se.slice());for(let oe=_e;oe<se.length;oe=H(se,oe+1))se[oe]=ae(se[oe],me);return se}function H(se,me){for(let _e=me;_e<se.length;_e++)if(!Y(se[_e]))return _e;return se.length}function Y(se){for(let me=1;me<se.length;me++)if(se[me][E]<se[me-1][E])return!1;return!0}function ae(se,me){return me||(se=se.slice()),se.sort(K)}function K(se,me){return se[E]-me[E]}function D(se,me){let _e=me.map(()=>[]);for(let oe=0;oe<se.length;oe++){let it=se[oe];for(let Ve=0;Ve<it.length;Ve++){let mt=it[Ve];if(mt.length===1)continue;let sr=mt[k],Et=mt[N],Dr=mt[O],yr=_e[sr];(yr[Et]||(yr[Et]=[])).push([Dr,oe,mt[E]])}}for(let oe=0;oe<_e.length;oe++){let it=_e[oe];for(let Ve=0;Ve<it.length;Ve++){let mt=it[Ve];mt&&mt.sort(K)}}return _e}var A=!1;function M(se,me,_e,oe){for(;_e<=oe;){let it=_e+(oe-_e>>1),Ve=se[it][E]-me;if(Ve===0)return A=!0,it;Ve<0?_e=it+1:oe=it-1}return A=!1,_e-1}function z(se,me,_e){for(let oe=_e+1;oe<se.length&&se[oe][E]===me;_e=oe++);return _e}function ee(se,me,_e){for(let oe=_e-1;oe>=0&&se[oe][E]===me;_e=oe--);return _e}function le(){return{lastKey:-1,lastNeedle:-1,lastIndex:-1}}function Se(se,me,_e,oe){let{lastKey:it,lastNeedle:Ve,lastIndex:mt}=_e,sr=0,Et=se.length-1;if(oe===it){if(me===Ve)return A=mt!==-1&&se[mt][E]===me,mt;me>=Ve?sr=mt===-1?0:mt:Et=mt}return _e.lastKey=oe,_e.lastNeedle=me,_e.lastIndex=M(se,me,sr,Et)}function we(se){return typeof se=="string"?JSON.parse(se):se}var he=function(se,me){let _e=we(se);if(!("sections"in _e))return new wt(_e,me);let oe=[],it=[],Ve=[],mt=[],sr=[];xe(_e,me,oe,it,Ve,mt,sr,0,0,1/0,1/0);let Et={version:3,file:_e.file,names:mt,sources:it,sourcesContent:Ve,mappings:oe,ignoreList:sr};return on(Et)};function xe(se,me,_e,oe,it,Ve,mt,sr,Et,Dr,yr){let{sections:qr}=se;for(let fr=0;fr<qr.length;fr++){let{map:cn,offset:_i}=qr[fr],bi=Dr,ni=yr;if(fr+1<qr.length){let Wr=qr[fr+1].offset;bi=Math.min(Dr,sr+Wr.line),bi===Dr?ni=Math.min(yr,Et+Wr.column):bi<Dr&&(ni=Et+Wr.column)}Ae(cn,me,_e,oe,it,Ve,mt,sr+_i.line,Et+_i.column,bi,ni)}}function Ae(se,me,_e,oe,it,Ve,mt,sr,Et,Dr,yr){let qr=we(se);if("sections"in qr)return xe(...arguments);let fr=new wt(qr,me),cn=oe.length,_i=Ve.length,bi=ye(fr),{resolvedSources:ni,sourcesContent:Wr,ignoreList:ml}=fr;if(ke(oe,ni),ke(Ve,fr.names),Wr)ke(it,Wr);else for(let ii=0;ii<ni.length;ii++)it.push(null);if(ml)for(let ii=0;ii<ml.length;ii++)mt.push(ml[ii]+cn);for(let ii=0;ii<bi.length;ii++){let Go=sr+ii;if(Go>Dr)return;let mm=Xe(_e,Go),xd=ii===0?Et:0,Sd=bi[ii];for(let Va=0;Va<Sd.length;Va++){let ia=Sd[Va],Bn=xd+ia[E];if(Go===Dr&&Bn>=yr)return;if(ia.length===1){mm.push([Bn]);continue}let Zo=cn+ia[k],gl=ia[N],Td=ia[O];mm.push(ia.length===4?[Bn,Zo,gl,Td]:[Bn,Zo,gl,Td,_i+ia[V]])}}}function ke(se,me){for(let _e=0;_e<me.length;_e++)se.push(me[_e])}function Xe(se,me){for(let _e=se.length;_e<=me;_e++)se[_e]=[];return se[me]}var De="`line` must be greater than 0 (lines start at line 1)",et="`column` must be greater than or equal to 0 (columns start at column 0)",tt=-1,jt=1,wt=class{constructor(se,me){let _e=typeof se=="string";if(!_e&&se._decodedMemo)return se;let oe=we(se),{version:it,file:Ve,names:mt,sourceRoot:sr,sources:Et,sourcesContent:Dr}=oe;this.version=it,this.file=Ve,this.names=mt||[],this.sourceRoot=sr,this.sources=Et,this.sourcesContent=Dr,this.ignoreList=oe.ignoreList||oe.x_google_ignoreList||void 0;let yr=w(me,sr);this.resolvedSources=Et.map(yr);let{mappings:qr}=oe;if(typeof qr=="string")this._encoded=qr,this._decoded=void 0;else if(Array.isArray(qr))this._encoded=void 0,this._decoded=$(qr,_e);else throw oe.sections?new Error("TraceMap passed sectioned source map, please use FlattenMap export instead"):new Error(`invalid source map: ${JSON.stringify(oe)}`);this._decodedMemo=le(),this._bySources=void 0,this._bySourceMemos=void 0}};function zr(se){return se}function fe(se){var me,_e;return(_e=(me=se)._encoded)!=null?_e:me._encoded=(0,_.encode)(se._decoded)}function ye(se){var me;return(me=se)._decoded||(me._decoded=(0,_.decode)(se._encoded))}function Pe(se,me,_e){let oe=ye(se);if(me>=oe.length)return null;let it=oe[me],Ve=Cs(it,se._decodedMemo,me,_e,jt);return Ve===-1?null:it[Ve]}function Oe(se,me){let{line:_e,column:oe,bias:it}=me;if(_e--,_e<0)throw new Error(De);if(oe<0)throw new Error(et);let Ve=ye(se);if(_e>=Ve.length)return Oi(null,null,null,null);let mt=Ve[_e],sr=Cs(mt,se._decodedMemo,_e,oe,it||jt);if(sr===-1)return Oi(null,null,null,null);let Et=mt[sr];if(Et.length===1)return Oi(null,null,null,null);let{names:Dr,resolvedSources:yr}=se;return Oi(yr[Et[k]],Et[N]+1,Et[O],Et.length===5?Dr[Et[V]]:null)}function Qe(se,me){let{source:_e,line:oe,column:it,bias:Ve}=me;return hm(se,_e,oe,it,Ve||jt,!1)}function _t(se,me){let{source:_e,line:oe,column:it,bias:Ve}=me;return hm(se,_e,oe,it,Ve||tt,!0)}function St(se,me){let _e=ye(se),{names:oe,resolvedSources:it}=se;for(let Ve=0;Ve<_e.length;Ve++){let mt=_e[Ve];for(let sr=0;sr<mt.length;sr++){let Et=mt[sr],Dr=Ve+1,yr=Et[0],qr=null,fr=null,cn=null,_i=null;Et.length!==1&&(qr=it[Et[1]],fr=Et[2]+1,cn=Et[3]),Et.length===5&&(_i=oe[Et[4]]),me({generatedLine:Dr,generatedColumn:yr,source:qr,originalLine:fr,originalColumn:cn,name:_i})}}}function ir(se,me){let{sources:_e,resolvedSources:oe}=se,it=_e.indexOf(me);return it===-1&&(it=oe.indexOf(me)),it}function tn(se,me){let{sourcesContent:_e}=se;if(_e==null)return null;let oe=ir(se,me);return oe===-1?null:_e[oe]}function ks(se,me){let{ignoreList:_e}=se;if(_e==null)return!1;let oe=ir(se,me);return oe===-1?!1:_e.includes(oe)}function on(se,me){let _e=new wt(ut(se,[]),me);return _e._decoded=se.mappings,_e}function Ni(se){return ut(se,ye(se))}function qa(se){return ut(se,fe(se))}function ut(se,me){return{version:se.version,file:se.file,names:se.names,sourceRoot:se.sourceRoot,sources:se.sources,sourcesContent:se.sourcesContent,mappings:me,ignoreList:se.ignoreList||se.x_google_ignoreList}}function Oi(se,me,_e,oe){return{source:se,line:me,column:_e,name:oe}}function jn(se,me){return{line:se,column:me}}function Cs(se,me,_e,oe,it){let Ve=Se(se,oe,me,_e);return A?Ve=(it===tt?z:ee)(se,oe,Ve):it===tt&&Ve++,Ve===-1||Ve===se.length?-1:Ve}function Wa(se,me,_e,oe,it){let Ve=Cs(se,me,_e,oe,jt);if(!A&&it===tt&&Ve++,Ve===-1||Ve===se.length)return[];let mt=A?oe:se[Ve][E];A||(Ve=ee(se,mt,Ve));let sr=z(se,mt,Ve),Et=[];for(;Ve<=sr;Ve++){let Dr=se[Ve];Et.push(jn(Dr[te]+1,Dr[W]))}return Et}function hm(se,me,_e,oe,it,Ve){var mt,sr;if(_e--,_e<0)throw new Error(De);if(oe<0)throw new Error(et);let{sources:Et,resolvedSources:Dr}=se,yr=Et.indexOf(me);if(yr===-1&&(yr=Dr.indexOf(me)),yr===-1)return Ve?[]:jn(null,null);let qr=(mt=se)._bySourceMemos||(mt._bySourceMemos=Et.map(le)),cn=((sr=se)._bySources||(sr._bySources=D(ye(se),qr)))[yr][_e];if(cn==null)return Ve?[]:jn(null,null);let _i=qr[yr];if(Ve)return Wa(cn,_i,_e,oe,it);let bi=Cs(cn,_i,_e,oe,it);if(bi===-1)return jn(null,null);let ni=cn[bi];return jn(ni[te]+1,ni[W])}})});var h4=G((hk,Wf)=>{(function(e,t){if(typeof hk=="object"&&typeof Wf<"u")t(Wf,lk(),fk()),Wf.exports=r(Wf);else if(typeof define=="function"&&define.amd)define(["module","@jridgewell/sourcemap-codec","@jridgewell/trace-mapping"],function(n){t.apply(this,arguments),n.exports=r(n)});else{let n={exports:{}};t(n,e.sourcemapCodec,e.traceMapping),e=typeof globalThis<"u"?globalThis:e||self,e.genMapping=r(n)}function r(n){return"default"in n.exports?n.exports.default:n.exports}})(hk,function(e,t,r){"use strict";var n=Object.create,s=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,c=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,u=(fe,ye)=>function(){return ye||(0,fe[o(fe)[0]])((ye={exports:{}}).exports,ye),ye.exports},d=(fe,ye)=>{for(var Pe in ye)s(fe,Pe,{get:ye[Pe],enumerable:!0})},p=(fe,ye,Pe,Oe)=>{if(ye&&typeof ye=="object"||typeof ye=="function")for(let Qe of o(ye))!l.call(fe,Qe)&&Qe!==Pe&&s(fe,Qe,{get:()=>ye[Qe],enumerable:!(Oe=a(ye,Qe))||Oe.enumerable});return fe},f=(fe,ye,Pe)=>(Pe=fe!=null?n(c(fe)):{},p(ye||!fe||!fe.__esModule?s(Pe,"default",{value:fe,enumerable:!0}):Pe,fe)),h=fe=>p(s({},"__esModule",{value:!0}),fe),m=u({"umd:@jridgewell/sourcemap-codec"(fe,ye){ye.exports=t}}),g=u({"umd:@jridgewell/trace-mapping"(fe,ye){ye.exports=r}}),y={};d(y,{GenMapping:()=>Y,addMapping:()=>D,addSegment:()=>K,allMappings:()=>he,fromMap:()=>we,maybeAddMapping:()=>M,maybeAddSegment:()=>A,setIgnore:()=>ee,setSourceContent:()=>z,toDecodedMap:()=>le,toEncodedMap:()=>Se}),e.exports=h(y);var _=class{constructor(){this._indexes={__proto__:null},this.array=[]}};function v(fe){return fe}function S(fe,ye){return fe._indexes[ye]}function w(fe,ye){let Pe=S(fe,ye);if(Pe!==void 0)return Pe;let{array:Oe,_indexes:Qe}=fe,_t=Oe.push(ye);return Qe[ye]=_t-1}function E(fe,ye){let Pe=S(fe,ye);if(Pe===void 0)return;let{array:Oe,_indexes:Qe}=fe;for(let _t=Pe+1;_t<Oe.length;_t++){let St=Oe[_t];Oe[_t-1]=St,Qe[St]--}Qe[ye]=void 0,Oe.pop()}var k=f(m()),N=f(g()),O=0,V=1,te=2,W=3,$=4,H=-1,Y=class{constructor({file:fe,sourceRoot:ye}={}){this._names=new _,this._sources=new _,this._sourcesContent=[],this._mappings=[],this.file=fe,this.sourceRoot=ye,this._ignoreList=new _}};function ae(fe){return fe}function K(fe,ye,Pe,Oe,Qe,_t,St,ir){return xe(!1,fe,ye,Pe,Oe,Qe,_t,St,ir)}function D(fe,ye){return zr(!1,fe,ye)}var A=(fe,ye,Pe,Oe,Qe,_t,St,ir)=>xe(!0,fe,ye,Pe,Oe,Qe,_t,St,ir),M=(fe,ye)=>zr(!0,fe,ye);function z(fe,ye,Pe){let{_sources:Oe,_sourcesContent:Qe}=fe,_t=w(Oe,ye);Qe[_t]=Pe}function ee(fe,ye,Pe=!0){let{_sources:Oe,_sourcesContent:Qe,_ignoreList:_t}=fe,St=w(Oe,ye);St===Qe.length&&(Qe[St]=null),Pe?w(_t,St):E(_t,St)}function le(fe){let{_mappings:ye,_sources:Pe,_sourcesContent:Oe,_names:Qe,_ignoreList:_t}=fe;return et(ye),{version:3,file:fe.file||void 0,names:Qe.array,sourceRoot:fe.sourceRoot||void 0,sources:Pe.array,sourcesContent:Oe,mappings:ye,ignoreList:_t.array}}function Se(fe){let ye=le(fe);return Object.assign({},ye,{mappings:(0,k.encode)(ye.mappings)})}function we(fe){let ye=new N.TraceMap(fe),Pe=new Y({file:ye.file,sourceRoot:ye.sourceRoot});return tt(Pe._names,ye.names),tt(Pe._sources,ye.sources),Pe._sourcesContent=ye.sourcesContent||ye.sources.map(()=>null),Pe._mappings=(0,N.decodedMappings)(ye),ye.ignoreList&&tt(Pe._ignoreList,ye.ignoreList),Pe}function he(fe){let ye=[],{_mappings:Pe,_sources:Oe,_names:Qe}=fe;for(let _t=0;_t<Pe.length;_t++){let St=Pe[_t];for(let ir=0;ir<St.length;ir++){let tn=St[ir],ks={line:_t+1,column:tn[O]},on,Ni,qa;tn.length!==1&&(on=Oe.array[tn[V]],Ni={line:tn[te]+1,column:tn[W]},tn.length===5&&(qa=Qe.array[tn[$]])),ye.push({generated:ks,source:on,original:Ni,name:qa})}}return ye}function xe(fe,ye,Pe,Oe,Qe,_t,St,ir,tn){let{_mappings:ks,_sources:on,_sourcesContent:Ni,_names:qa}=ye,ut=ke(ks,Pe),Oi=Xe(ut,Oe);if(!Qe)return fe&&jt(ut,Oi)?void 0:De(ut,Oi,[Oe]);let jn=w(on,Qe),Cs=ir?w(qa,ir):H;if(jn===Ni.length&&(Ni[jn]=tn??null),!(fe&&wt(ut,Oi,jn,_t,St,Cs)))return De(ut,Oi,ir?[Oe,jn,_t,St,Cs]:[Oe,jn,_t,St])}function Ae(fe){}function ke(fe,ye){for(let Pe=fe.length;Pe<=ye;Pe++)fe[Pe]=[];return fe[ye]}function Xe(fe,ye){let Pe=fe.length;for(let Oe=Pe-1;Oe>=0;Pe=Oe--){let Qe=fe[Oe];if(ye>=Qe[O])break}return Pe}function De(fe,ye,Pe){for(let Oe=fe.length;Oe>ye;Oe--)fe[Oe]=fe[Oe-1];fe[ye]=Pe}function et(fe){let{length:ye}=fe,Pe=ye;for(let Oe=Pe-1;Oe>=0&&!(fe[Oe].length>0);Pe=Oe,Oe--);Pe<ye&&(fe.length=Pe)}function tt(fe,ye){for(let Pe=0;Pe<ye.length;Pe++)w(fe,ye[Pe])}function jt(fe,ye){return ye===0?!0:fe[ye-1].length===1}function wt(fe,ye,Pe,Oe,Qe,_t){if(ye===0)return!1;let St=fe[ye-1];return St.length===1?!1:Pe===St[V]&&Oe===St[te]&&Qe===St[W]&&_t===(St.length===5?St[$]:H)}function zr(fe,ye,Pe){let{generated:Oe,source:Qe,original:_t,name:St,content:ir}=Pe;return Qe?xe(fe,ye,Oe.line-1,Oe.column,Qe,_t.line-1,_t.column,St,ir):xe(fe,ye,Oe.line-1,Oe.column,null,null,null,null,null)}})});var m4=G(N_=>{"use strict";Object.defineProperty(N_,"__esModule",{value:!0});N_.default=void 0;var To=h4(),mk=fk(),gk=class{constructor(t,r){var n;this._map=void 0,this._rawMappings=void 0,this._sourceFileName=void 0,this._lastGenLine=0,this._lastSourceLine=0,this._lastSourceColumn=0,this._inputMap=null;let s=this._map=new To.GenMapping({sourceRoot:t.sourceRoot});if(this._sourceFileName=(n=t.sourceFileName)==null?void 0:n.replace(/\\/g,"/"),this._rawMappings=void 0,t.inputSourceMap){this._inputMap=new mk.TraceMap(t.inputSourceMap);let o=this._inputMap.resolvedSources;if(o.length)for(let c=0;c<o.length;c++){var a;(0,To.setSourceContent)(s,o[c],(a=this._inputMap.sourcesContent)==null?void 0:a[c])}}if(typeof r=="string"&&!t.inputSourceMap)(0,To.setSourceContent)(s,this._sourceFileName,r);else if(typeof r=="object")for(let o of Object.keys(r))(0,To.setSourceContent)(s,o.replace(/\\/g,"/"),r[o])}get(){return(0,To.toEncodedMap)(this._map)}getDecoded(){return(0,To.toDecodedMap)(this._map)}getRawMappings(){return this._rawMappings||(this._rawMappings=(0,To.allMappings)(this._map))}mark(t,r,n,s,a,o){var c;this._rawMappings=void 0;let l;if(r!=null)if(this._inputMap){if(l=(0,mk.originalPositionFor)(this._inputMap,{line:r,column:n}),!l.name&&a){let u=(0,mk.originalPositionFor)(this._inputMap,a);u.name&&(s=u.name)}}else l={name:null,source:o?.replace(/\\/g,"/")||this._sourceFileName,line:r,column:n};(0,To.maybeAddMapping)(this._map,{name:s,generated:t,source:(c=l)==null?void 0:c.source,original:l})}};N_.default=gk});var y4=G(O_=>{"use strict";Object.defineProperty(O_,"__esModule",{value:!0});O_.default=void 0;var g4=[];for(let e=0;e<32;e++)g4.push(" ".repeat(e*2));var yk=class{constructor(t,r){this._map=null,this._buf="",this._str="",this._appendCount=0,this._last=0,this._canMarkIdName=!0,this._indentChar="",this._queuedChar=0,this._position={line:1,column:0},this._sourcePosition={identifierName:void 0,identifierNamePos:void 0,line:void 0,column:void 0,filename:void 0},this._map=t,this._indentChar=r}get(){let{_map:t,_last:r}=this;this._queuedChar!==32&&this._flush();let n=r===10?(this._buf+this._str).trimRight():this._buf+this._str;if(t===null)return{code:n,decodedMap:void 0,map:null,rawMappings:void 0};let s={code:n,decodedMap:t.getDecoded(),get __mergedMap(){return this.map},get map(){let a=t.get();return s.map=a,a},set map(a){Object.defineProperty(s,"map",{value:a,writable:!0})},get rawMappings(){let a=t.getRawMappings();return s.rawMappings=a,a},set rawMappings(a){Object.defineProperty(s,"rawMappings",{value:a,writable:!0})}};return s}append(t,r){this._flush(),this._append(t,r)}appendChar(t){this._flush(),this._appendChar(t,1,!0)}queue(t){this._flush(),this._queuedChar=t}_flush(){let t=this._queuedChar;t!==0&&(this._appendChar(t,1,!0),this._queuedChar=0)}_appendChar(t,r,n){if(this._last=t,t===-1){let o=r>=64?this._indentChar.repeat(r):g4[r/2];this._str+=o}else this._str+=r>1?String.fromCharCode(t).repeat(r):String.fromCharCode(t);let s=t===32,a=this._position;if(t!==10){if(this._map){let o=this._sourcePosition;n&&o?(this._map.mark(a,o.line,o.column,s?void 0:o.identifierName,s?void 0:o.identifierNamePos,o.filename),!s&&this._canMarkIdName&&(o.identifierName=void 0,o.identifierNamePos=void 0)):this._map.mark(a)}a.column+=r}else a.line++,a.column=0}_append(t,r){let n=t.length,s=this._position,a=this._sourcePosition;this._last=-1,++this._appendCount>4096?(+this._str,this._buf+=this._str,this._str=t,this._appendCount=0):this._str+=t;let o=this._map!==null;if(!r&&!o){s.column+=n;return}let{column:c,identifierName:l,identifierNamePos:u,filename:d}=a,p=a.line;(l!=null||u!=null)&&this._canMarkIdName&&(a.identifierName=void 0,a.identifierNamePos=void 0);let f=t.indexOf(`
|
|
31
31
|
`),h=0;for(o&&f!==0&&this._map.mark(s,p,c,l,u,d);f!==-1;)s.line++,s.column=0,h=f+1,h<n&&p!==void 0&&(p++,o&&this._map.mark(s,p,0,void 0,void 0,d)),f=t.indexOf(`
|
|
32
32
|
`,h);s.column+=n-h}removeLastSemicolon(){this._queuedChar===59&&(this._queuedChar=0)}getLastChar(t){if(!t)return this._last;let r=this._queuedChar;return r!==0?r:this._last}getNewlineCount(){return this._queuedChar===0&&this._last===10?1:0}hasContent(){return this._last!==0}exactSource(t,r){if(!this._map){r();return}this.source("start",t);let n=t.identifierName,s=this._sourcePosition;n!=null&&(this._canMarkIdName=!1,s.identifierName=n),r(),n!=null&&(this._canMarkIdName=!0,s.identifierName=void 0,s.identifierNamePos=void 0),this.source("end",t)}source(t,r){this._map&&this._normalizePosition(t,r,0)}sourceWithOffset(t,r,n){this._map&&this._normalizePosition(t,r,n)}_normalizePosition(t,r,n){this._flush();let s=r[t],a=this._sourcePosition;s&&(a.line=s.line,a.column=Math.max(s.column+n,0),a.filename=r.filename)}getCurrentColumn(){return this._position.column+(this._queuedChar?1:0)}getCurrentLine(){return this._position.line}};O_.default=yk});var w4=G(Ht=>{"use strict";Object.defineProperty(Ht,"__esModule",{value:!0});Ht.AssignmentExpression=N0e;Ht.BinaryExpression=w0e;Ht.ClassExpression=A0e;Ht.ArrowFunctionExpression=Ht.ConditionalExpression=T4;Ht.DoExpression=m0e;Ht.FunctionExpression=k0e;Ht.FunctionTypeAnnotation=p0e;Ht.Identifier=O0e;Ht.LogicalExpression=E0e;Ht.NullableTypeAnnotation=d0e;Ht.ObjectExpression=h0e;Ht.OptionalIndexedAccessType=y0e;Ht.OptionalCallExpression=Ht.OptionalMemberExpression=C0e;Ht.SequenceExpression=P0e;Ht.TSSatisfiesExpression=Ht.TSAsExpression=_0e;Ht.TSConditionalType=b0e;Ht.TSConstructorType=Ht.TSFunctionType=T0e;Ht.TSInferType=x0e;Ht.TSInstantiationExpression=S0e;Ht.TSIntersectionType=v0e;Ht.SpreadElement=Ht.UnaryExpression=Ht.TSTypeAssertion=S4;Ht.TSTypeOperator=bk;Ht.TSUnionType=x4;Ht.IntersectionTypeAnnotation=Ht.UnionTypeAnnotation=g0e;Ht.UpdateExpression=f0e;Ht.AwaitExpression=Ht.YieldExpression=I0e;var a0e=Rt(),En=wo(),{isMemberExpression:o0e,isOptionalMemberExpression:c0e,isYieldExpression:l0e,isStatement:u0e}=a0e,_4=new Map([["||",0],["??",1],["&&",2],["|",3],["^",4],["&",5],["==",6],["===",6],["!=",6],["!==",6],["<",7],[">",7],["<=",7],[">=",7],["in",7],["instanceof",7],[">>",8],["<<",8],[">>>",8],["+",9],["-",9],["*",10],["/",10],["%",10],["**",11]]);function b4(e){return e===156||e===201||e===209}var $_=(e,t,r)=>(r===21||r===22)&&t.superClass===e,R_=(e,t,r)=>{switch(r){case 108:case 132:return t.object===e;case 17:case 130:case 112:return t.callee===e;case 222:return t.tag===e;case 191:return!0}return!1};function d0e(e,t,r){return r===4}function p0e(e,t,r,n){return r===239||r===90||r===4||(n&En.TokenContext.arrowFlowReturnType)>0}function f0e(e,t,r){return R_(e,t,r)||$_(e,t,r)}function v4(e){return(e&(En.TokenContext.expressionStatement|En.TokenContext.arrowBody))>0}function h0e(e,t,r,n){return v4(n)}function m0e(e,t,r,n){return(n&En.TokenContext.expressionStatement)>0&&!e.async}function _k(e,t,r,n){if($_(e,t,r)||R_(e,t,r)||r===238||r===145||r===8)return!0;let s;switch(r){case 10:case 107:s=_4.get(t.operator);break;case 156:case 201:s=7}if(s!==void 0){let a=n===2?7:_4.get(e.operator);if(s>a||s===a&&r===10&&(a===11?t.left===e:t.right===e)||n===1&&r===107&&(a===1&&s!==1||s===1&&a!==1))return!0}return!1}function g0e(e,t,r){switch(r){case 4:case 115:case 90:case 239:return!0}return!1}function y0e(e,t,r){return r===84&&t.objectType===e}function _0e(e,t,r){return(r===6||r===7)&&t.left===e||r===10&&(t.operator==="|"||t.operator==="&")&&e===t.left?!0:_k(e,t,r,2)}function b0e(e,t,r){switch(r){case 155:case 195:case 211:case 212:return!0;case 175:return t.objectType===e;case 181:case 219:return t.types[0]===e;case 161:return t.checkType===e||t.extendsType===e}return!1}function x4(e,t,r){switch(r){case 181:case 211:case 155:case 195:return!0;case 175:return t.objectType===e}return!1}function v0e(e,t,r){return r===211||bk(e,t,r)}function x0e(e,t,r){return!!(bk(e,t,r)||(r===181||r===219)&&e.typeParameter.constraint&&t.types[0]===e)}function bk(e,t,r){switch(r){case 155:case 195:return!0;case 175:if(t.objectType===e)return!0}return!1}function S0e(e,t,r){switch(r){case 17:case 130:case 112:case 177:return t.typeParameters!=null}return!1}function T0e(e,t,r){return x4(e,t,r)?!0:r===219||r===161&&(t.checkType===e||t.extendsType===e)}function w0e(e,t,r,n){return _k(e,t,r,0)?!0:(n&En.TokenContext.forInOrInitHeadAccumulate)>0&&e.operator==="in"}function E0e(e,t,r){return _k(e,t,r,1)}function P0e(e,t,r){return r===144||r===133||r===108&&t.property===e||r===132&&t.property===e||r===224?!1:r===21?!0:r===68?t.right===e:r===60?!0:!u0e(t)}function I0e(e,t,r){return r===10||r===107||r===238||r===145||R_(e,t,r)||r===8&&l0e(e)||r===28&&e===t.test||$_(e,t,r)||b4(r)}function A0e(e,t,r,n){return(n&(En.TokenContext.expressionStatement|En.TokenContext.exportDefault))>0}function S4(e,t,r){return R_(e,t,r)||r===10&&t.operator==="**"&&t.left===e||$_(e,t,r)}function k0e(e,t,r,n){return(n&(En.TokenContext.expressionStatement|En.TokenContext.exportDefault))>0}function T4(e,t,r){switch(r){case 238:case 145:case 10:case 107:case 8:return!0;case 28:if(t.test===e)return!0}return b4(r)?!0:S4(e,t,r)}function C0e(e,t,r){switch(r){case 17:return t.callee===e;case 108:return t.object===e}return!1}function N0e(e,t,r,n){return v4(n)&&e.left.type==="ObjectPattern"?!0:T4(e,t,r)}function O0e(e,t,r,n,s){var a;if(s&&s(e)!==e.name)return!1;if(r===6&&(a=e.extra)!=null&&a.parenthesized&&t.left===e){let o=t.right.type;if((o==="FunctionExpression"||o==="ClassExpression")&&t.right.id==null)return!0}return(n&En.TokenContext.forOfHead||(r===108||r===132)&&n&(En.TokenContext.expressionStatement|En.TokenContext.forInitHead|En.TokenContext.forInHead))&&e.name==="let"?(o0e(t,{object:e,computed:!0})||c0e(t,{object:e,computed:!0,optional:!1}))&&n&(En.TokenContext.expressionStatement|En.TokenContext.forInitHead|En.TokenContext.forInHead)?!0:(n&En.TokenContext.forOfHead)>0:r===68&&t.left===e&&e.name==="async"&&!t.await}});var vk=G(Cu=>{"use strict";Object.defineProperty(Cu,"__esModule",{value:!0});Cu.TaggedTemplateExpression=$0e;Cu.TemplateElement=R0e;Cu.TemplateLiteral=D0e;Cu._printTemplate=E4;function $0e(e){this.print(e.tag),this.print(e.typeParameters),this.print(e.quasi)}function R0e(){throw new Error("TemplateElement printing is handled in TemplateLiteral")}function E4(e,t){let r=e.quasis,n="`";for(let s=0;s<r.length-1;s++)if(n+=r[s].value.raw,this.token(n+"${",!0),this.print(t[s]),n="}",this.tokenMap){let a=this.tokenMap.findMatching(e,"}",s);a&&this._catchUpTo(a.loc.start)}n+=r[r.length-1].value.raw,this.token(n+"`",!0)}function D0e(e){E4.call(this,e,e.expressions)}});var D_=G(cr=>{"use strict";Object.defineProperty(cr,"__esModule",{value:!0});cr.LogicalExpression=cr.AssignmentExpression=oEe;cr.AssignmentPattern=aEe;cr.AwaitExpression=rEe;cr.BinaryExpression=cEe;cr.BindExpression=lEe;cr.CallExpression=eEe;cr.ConditionalExpression=V0e;cr.Decorator=Y0e;cr.DoExpression=U0e;cr.EmptyStatement=iEe;cr.ExpressionStatement=sEe;cr.Import=tEe;cr.MemberExpression=uEe;cr.MetaProperty=dEe;cr.ModuleExpression=hEe;cr.NewExpression=K0e;cr.OptionalCallExpression=Q0e;cr.OptionalMemberExpression=X0e;cr.ParenthesizedExpression=q0e;cr.PrivateName=pEe;cr.SequenceExpression=G0e;cr.Super=H0e;cr.ThisExpression=Z0e;cr.UnaryExpression=z0e;cr.UpdateExpression=W0e;cr.V8IntrinsicIdentifier=fEe;cr.YieldExpression=nEe;cr._shouldPrintDecoratorsBeforeExport=J0e;var M0e=Rt(),L0e=wo(),{isCallExpression:F0e,isLiteral:P4,isMemberExpression:xk,isNewExpression:j0e,isPattern:B0e}=M0e;function z0e(e){let{operator:t}=e,r=t.charCodeAt(0);r>=97&&r<=122?(this.word(t),this.space()):this.tokenChar(r),this.print(e.argument)}function U0e(e){e.async&&(this.word("async",!0),this.space()),this.word("do"),this.space(),this.print(e.body)}function q0e(e){this.tokenChar(40);let t=this.enterDelimited();this.print(e.expression,void 0,!0),this._noLineTerminatorAfterNode=t,this.rightParens(e)}function W0e(e){e.prefix?(this.token(e.operator,!1,0,!0),this.print(e.argument)):(this.print(e.argument,!0),this.token(e.operator,!1,0,!0))}function V0e(e){this.print(e.test),this.space(),this.tokenChar(63),this.space(),this.print(e.consequent),this.space(),this.tokenChar(58),this.space(),this.print(e.alternate)}function K0e(e,t){if(this.word("new"),this.space(),this.print(e.callee),this.format.minified&&e.arguments.length===0&&!e.optional&&!F0e(t,{callee:e})&&!xk(t)&&!j0e(t)||(this.print(e.typeArguments),this.print(e.typeParameters),e.optional&&this.token("?."),e.arguments.length===0&&this.tokenMap&&!this.tokenMap.endMatches(e,")")))return;this.tokenChar(40);let r=this.enterDelimited();this.printList(e.arguments,this.shouldPrintTrailingComma(")"),void 0,void 0,void 0,!0),this._noLineTerminatorAfterNode=r,this.rightParens(e)}function G0e(e){this.printList(e.expressions)}function Z0e(){this.word("this")}function H0e(){this.word("super")}function J0e(e){return typeof this.format.decoratorsBeforeExport=="boolean"?this.format.decoratorsBeforeExport:typeof e.start=="number"&&e.start===e.declaration.start}function Y0e(e){this.tokenChar(64);let{expression:t}=e;this.print(t),this.newline()}function X0e(e){let{computed:t}=e,{optional:r,property:n}=e;if(this.print(e.object),!t&&xk(n))throw new TypeError("Got a MemberExpression for MemberExpression property");P4(n)&&typeof n.value=="number"&&(t=!0),r&&this.token("?."),t?(this.tokenChar(91),this.print(n),this.tokenChar(93)):(r||this.tokenChar(46),this.print(n))}function Q0e(e){this.print(e.callee),this.print(e.typeParameters),e.optional&&this.token("?."),this.print(e.typeArguments),this.tokenChar(40);let t=this.enterDelimited();this.printList(e.arguments,void 0,void 0,void 0,void 0,!0),this._noLineTerminatorAfterNode=t,this.rightParens(e)}function eEe(e){this.print(e.callee),this.print(e.typeArguments),this.print(e.typeParameters),this.tokenChar(40);let t=this.enterDelimited();this.printList(e.arguments,this.shouldPrintTrailingComma(")"),void 0,void 0,void 0,!0),this._noLineTerminatorAfterNode=t,this.rightParens(e)}function tEe(){this.word("import")}function rEe(e){this.word("await"),this.space(),this.print(e.argument)}function nEe(e){e.delegate?(this.word("yield",!0),this.tokenChar(42),e.argument&&(this.space(),this.print(e.argument))):e.argument?(this.word("yield",!0),this.space(),this.print(e.argument)):this.word("yield")}function iEe(){this.semicolon(!0)}function sEe(e){this.tokenContext|=L0e.TokenContext.expressionStatement,this.print(e.expression),this.semicolon()}function aEe(e){this.print(e.left),(e.left.type==="Identifier"||B0e(e.left))&&(e.left.optional&&this.tokenChar(63),this.print(e.left.typeAnnotation)),this.space(),this.tokenChar(61),this.space(),this.print(e.right)}function oEe(e){this.print(e.left),this.space(),this.token(e.operator,!1,0,!0),this.space(),this.print(e.right)}function cEe(e){this.print(e.left),this.space();let{operator:t}=e;t.charCodeAt(0)===105?this.word(t):(this.token(t,!1,0,!0),this.setLastChar(t.charCodeAt(t.length-1))),this.space(),this.print(e.right)}function lEe(e){this.print(e.object),this.token("::"),this.print(e.callee)}function uEe(e){if(this.print(e.object),!e.computed&&xk(e.property))throw new TypeError("Got a MemberExpression for MemberExpression property");let t=e.computed;if(P4(e.property)&&typeof e.property.value=="number"&&(t=!0),t){let r=this.enterDelimited();this.tokenChar(91),this.print(e.property,void 0,!0),this.tokenChar(93),this._noLineTerminatorAfterNode=r}else this.tokenChar(46),this.print(e.property)}function dEe(e){this.print(e.meta),this.tokenChar(46),this.print(e.property)}function pEe(e){this.tokenChar(35),this.print(e.id)}function fEe(e){this.tokenChar(37),this.word(e.name)}function hEe(e){this.word("module",!0),this.space(),this.tokenChar(123),this.indent();let{body:t}=e;(t.body.length||t.directives.length)&&this.newline(),this.print(t),this.dedent(),this.rightBrace(e)}});var A4=G(Yr=>{"use strict";Object.defineProperty(Yr,"__esModule",{value:!0});Yr.BreakStatement=PEe;Yr.CatchClause=OEe;Yr.ContinueStatement=IEe;Yr.DebuggerStatement=DEe;Yr.DoWhileStatement=EEe;Yr.ForInStatement=TEe;Yr.ForOfStatement=wEe;Yr.ForStatement=xEe;Yr.IfStatement=vEe;Yr.LabeledStatement=CEe;Yr.ReturnStatement=AEe;Yr.SwitchCase=REe;Yr.SwitchStatement=$Ee;Yr.ThrowStatement=kEe;Yr.TryStatement=NEe;Yr.VariableDeclaration=LEe;Yr.VariableDeclarator=FEe;Yr.WhileStatement=SEe;Yr.WithStatement=bEe;var mEe=Rt(),Rc=wo(),{isFor:gEe,isIfStatement:yEe,isStatement:_Ee}=mEe;function bEe(e){this.word("with"),this.space(),this.tokenChar(40),this.print(e.object),this.tokenChar(41),this.printBlock(e.body)}function vEe(e){this.word("if"),this.space(),this.tokenChar(40),this.print(e.test),this.tokenChar(41),this.space();let t=e.alternate&&yEe(I4(e.consequent));t&&(this.tokenChar(123),this.newline(),this.indent()),this.printAndIndentOnComments(e.consequent),t&&(this.dedent(),this.newline(),this.tokenChar(125)),e.alternate&&(this.endsWith(125)&&this.space(),this.word("else"),this.space(),this.printAndIndentOnComments(e.alternate))}function I4(e){let{body:t}=e;return _Ee(t)===!1?e:I4(t)}function xEe(e){this.word("for"),this.space(),this.tokenChar(40),this.tokenContext|=Rc.TokenContext.forInitHead|Rc.TokenContext.forInOrInitHeadAccumulate,this.print(e.init),this.tokenContext=Rc.TokenContext.normal,this.tokenChar(59),e.test&&(this.space(),this.print(e.test)),this.tokenChar(59,1),e.update&&(this.space(),this.print(e.update)),this.tokenChar(41),this.printBlock(e.body)}function SEe(e){this.word("while"),this.space(),this.tokenChar(40),this.print(e.test),this.tokenChar(41),this.printBlock(e.body)}function TEe(e){this.word("for"),this.space(),this.noIndentInnerCommentsHere(),this.tokenChar(40),this.tokenContext|=Rc.TokenContext.forInHead|Rc.TokenContext.forInOrInitHeadAccumulate,this.print(e.left),this.tokenContext=Rc.TokenContext.normal,this.space(),this.word("in"),this.space(),this.print(e.right),this.tokenChar(41),this.printBlock(e.body)}function wEe(e){this.word("for"),this.space(),e.await&&(this.word("await"),this.space()),this.noIndentInnerCommentsHere(),this.tokenChar(40),this.tokenContext|=Rc.TokenContext.forOfHead,this.print(e.left),this.space(),this.word("of"),this.space(),this.print(e.right),this.tokenChar(41),this.printBlock(e.body)}function EEe(e){this.word("do"),this.space(),this.print(e.body),this.space(),this.word("while"),this.space(),this.tokenChar(40),this.print(e.test),this.tokenChar(41),this.semicolon()}function M_(e,t){t&&(e.space(),e.printTerminatorless(t)),e.semicolon()}function PEe(e){this.word("break"),M_(this,e.label)}function IEe(e){this.word("continue"),M_(this,e.label)}function AEe(e){this.word("return"),M_(this,e.argument)}function kEe(e){this.word("throw"),M_(this,e.argument)}function CEe(e){this.print(e.label),this.tokenChar(58),this.space(),this.print(e.body)}function NEe(e){this.word("try"),this.space(),this.print(e.block),this.space(),e.handlers?this.print(e.handlers[0]):this.print(e.handler),e.finalizer&&(this.space(),this.word("finally"),this.space(),this.print(e.finalizer))}function OEe(e){this.word("catch"),this.space(),e.param&&(this.tokenChar(40),this.print(e.param),this.print(e.param.typeAnnotation),this.tokenChar(41),this.space()),this.print(e.body)}function $Ee(e){this.word("switch"),this.space(),this.tokenChar(40),this.print(e.discriminant),this.tokenChar(41),this.space(),this.tokenChar(123),this.printSequence(e.cases,!0),this.rightBrace(e)}function REe(e){e.test?(this.word("case"),this.space(),this.print(e.test),this.tokenChar(58)):(this.word("default"),this.tokenChar(58)),e.consequent.length&&(this.newline(),this.printSequence(e.consequent,!0))}function DEe(){this.word("debugger"),this.semicolon()}function MEe(e){this.tokenChar(44,e),this.newline()}function LEe(e,t){e.declare&&(this.word("declare"),this.space());let{kind:r}=e;switch(r){case"await using":this.word("await"),this.space();case"using":this.word("using",!0);break;default:this.word(r)}this.space();let n=!1;if(!gEe(t)){for(let s of e.declarations)if(s.init){n=!0;break}}if(this.printList(e.declarations,void 0,void 0,e.declarations.length>1,n?MEe:void 0),t!=null)switch(t.type){case"ForStatement":if(t.init===e)return;break;case"ForInStatement":case"ForOfStatement":if(t.left===e)return}this.semicolon()}function FEe(e){this.print(e.id),e.definite&&this.tokenChar(33),this.print(e.id.typeAnnotation),e.init&&(this.space(),this.tokenChar(61),this.space(),this.print(e.init))}});var Vf=G(Gi=>{"use strict";Object.defineProperty(Gi,"__esModule",{value:!0});Gi.ArrowFunctionExpression=WEe;Gi.FunctionDeclaration=Gi.FunctionExpression=qEe;Gi._functionHead=N4;Gi._methodHead=UEe;Gi._param=C4;Gi._parameters=k4;Gi._params=Nu;Gi._predicate=Sk;Gi._shouldPrintArrowParamsParens=O4;var jEe=Rt(),BEe=wo(),{isIdentifier:zEe}=jEe;function Nu(e,t,r,n){if(this.print(e.typeParameters),r!==void 0||n!==void 0){let s=VEe.call(this,r,n);s&&this.sourceIdentifierName(s.name,s.pos)}this.tokenChar(40),k4.call(this,e.params,41),this.print(e.returnType,t),this._noLineTerminator=t}function k4(e,t){let r=this.enterDelimited(),n=this.shouldPrintTrailingComma(t),s=e.length;for(let a=0;a<s;a++)C4.call(this,e[a]),(n||a<s-1)&&(this.tokenChar(44,a),this.space());this.tokenChar(t),this._noLineTerminatorAfterNode=r}function C4(e){this.printJoin(e.decorators,void 0,void 0,void 0,void 0,!0),this.print(e,void 0,!0),e.optional&&this.tokenChar(63),this.print(e.typeAnnotation,void 0,!0)}function UEe(e){let t=e.kind,r=e.key;(t==="get"||t==="set")&&(this.word(t),this.space()),e.async&&(this.word("async",!0),this.space()),(t==="method"||t==="init")&&e.generator&&this.tokenChar(42),e.computed?(this.tokenChar(91),this.print(r),this.tokenChar(93)):this.print(r),e.optional&&this.tokenChar(63),this._buf._map?Nu.call(this,e,!1,e.computed&&e.key.type!=="StringLiteral"?void 0:e.key):Nu.call(this,e,!1)}function Sk(e,t){e.predicate&&(e.returnType||this.tokenChar(58),this.space(),this.print(e.predicate,t))}function N4(e,t,r){e.async&&(this.word("async"),this.format.preserveFormat||(this._innerCommentsState=0),this.space()),this.word("function"),e.generator&&(this.format.preserveFormat||(this._innerCommentsState=0),this.tokenChar(42)),this.space(),e.id&&this.print(e.id),this._buf._map?Nu.call(this,e,!1,e.id,t):Nu.call(this,e,!1),r&&Sk.call(this,e)}function qEe(e,t){N4.call(this,e,t,!0),this.space(),this.print(e.body)}function WEe(e,t){e.async&&(this.word("async",!0),this.space()),O4.call(this,e)?Nu.call(this,e,!0,void 0,this._buf._map?t:void 0):this.print(e.params[0],!0),Sk.call(this,e,!0),this.space(),this.printInnerComments(),this.token("=>"),this.space(),this.tokenContext|=BEe.TokenContext.arrowBody,this.print(e.body)}function O4(e){var t,r;if(e.params.length!==1||e.typeParameters||e.returnType||e.predicate)return!0;let n=e.params[0];if(!zEe(n)||n.typeAnnotation||n.optional||(t=n.leadingComments)!=null&&t.length||(r=n.trailingComments)!=null&&r.length)return!0;if(this.tokenMap){if(e.loc==null||this.tokenMap.findMatching(e,"(")!==null)return!0;let s=this.tokenMap.findMatching(e,"=>");return s?.loc==null?!0:s.loc.start.line!==e.loc.start.line}return!!this.format.retainLines}function VEe(e,t){let r=e;if(!r&&t){let l=t.type;l==="VariableDeclarator"?r=t.id:l==="AssignmentExpression"||l==="AssignmentPattern"?r=t.left:l==="ObjectProperty"||l==="ClassProperty"?(!t.computed||t.key.type==="StringLiteral")&&(r=t.key):(l==="ClassPrivateProperty"||l==="ClassAccessorProperty")&&(r=t.key)}if(!r)return;let n;if(r.type==="Identifier"){var s,a;n={pos:(s=r.loc)==null?void 0:s.start,name:((a=r.loc)==null?void 0:a.identifierName)||r.name}}else if(r.type==="PrivateName"){var o;n={pos:(o=r.loc)==null?void 0:o.start,name:"#"+r.id.name}}else if(r.type==="StringLiteral"){var c;n={pos:(c=r.loc)==null?void 0:c.start,name:r.value}}return n}});var wk=G(je=>{"use strict";Object.defineProperty(je,"__esModule",{value:!0});je.TSAnyKeyword=aPe;je.TSArrayType=PPe;je.TSAsExpression=VPe;je.TSBigIntKeyword=oPe;je.TSBooleanKeyword=dPe;je.TSCallSignatureDeclaration=tPe;je.TSInterfaceHeritage=je.TSClassImplements=zPe;je.TSConditionalType=$Pe;je.TSConstructSignatureDeclaration=rPe;je.TSConstructorType=xPe;je.TSDeclareFunction=XEe;je.TSDeclareMethod=QEe;je.TSEnumBody=F4;je.TSEnumDeclaration=HPe;je.TSEnumMember=JPe;je.TSExportAssignment=nIe;je.TSExternalModuleReference=tIe;je.TSFunctionType=vPe;je.TSImportEqualsDeclaration=eIe;je.TSImportType=QPe;je.TSIndexSignature=sPe;je.TSIndexedAccessType=LPe;je.TSInferType=RPe;je.TSInstantiationExpression=ZPe;je.TSInterfaceBody=qPe;je.TSInterfaceDeclaration=UPe;je.TSIntersectionType=OPe;je.TSIntrinsicKeyword=_Pe;je.TSLiteralType=BPe;je.TSMappedType=FPe;je.TSMethodSignature=iPe;je.TSModuleBlock=XPe;je.TSModuleDeclaration=YPe;je.TSNamedTupleMember=CPe;je.TSNamespaceExportDeclaration=iIe;je.TSNeverKeyword=yPe;je.TSNonNullExpression=rIe;je.TSNullKeyword=gPe;je.TSNumberKeyword=lPe;je.TSObjectKeyword=uPe;je.TSOptionalType=APe;je.TSParameterProperty=YEe;je.TSParenthesizedType=DPe;je.TSPropertySignature=nPe;je.TSQualifiedName=ePe;je.TSRestType=kPe;je.TSSatisfiesExpression=KPe;je.TSStringKeyword=pPe;je.TSSymbolKeyword=fPe;je.TSTemplateLiteralType=jPe;je.TSThisType=bPe;je.TSTupleType=IPe;je.TSTypeAliasDeclaration=WPe;je.TSTypeAnnotation=ZEe;je.TSTypeAssertion=GPe;je.TSTypeLiteral=EPe;je.TSTypeOperator=MPe;je.TSTypeParameter=JEe;je.TSTypeParameterDeclaration=je.TSTypeParameterInstantiation=HEe;je.TSTypePredicate=TPe;je.TSTypeQuery=wPe;je.TSTypeReference=SPe;je.TSUndefinedKeyword=mPe;je.TSUnionType=NPe;je.TSUnknownKeyword=cPe;je.TSVoidKeyword=hPe;je._tsPrintClassMemberModifiers=sIe;var Kf=Vf(),KEe=Ek(),GEe=vk();function ZEe(e,t){this.token((t.type==="TSFunctionType"||t.type==="TSConstructorType")&&t.typeAnnotation===e?"=>":":"),this.space(),e.optional&&this.tokenChar(63),this.print(e.typeAnnotation)}function HEe(e,t){this.tokenChar(60);let r=t.type==="ArrowFunctionExpression"&&e.params.length===1;this.tokenMap&&e.start!=null&&e.end!=null&&(r&&(r=!!this.tokenMap.find(e,n=>this.tokenMap.matchesOriginal(n,","))),r||(r=this.shouldPrintTrailingComma(">"))),this.printList(e.params,r),this.tokenChar(62)}function JEe(e){e.const&&(this.word("const"),this.space()),e.in&&(this.word("in"),this.space()),e.out&&(this.word("out"),this.space()),this.word(e.name),e.constraint&&(this.space(),this.word("extends"),this.space(),this.print(e.constraint)),e.default&&(this.space(),this.tokenChar(61),this.space(),this.print(e.default))}function YEe(e){e.accessibility&&(this.word(e.accessibility),this.space()),e.readonly&&(this.word("readonly"),this.space()),Kf._param.call(this,e.parameter)}function XEe(e,t){e.declare&&(this.word("declare"),this.space()),Kf._functionHead.call(this,e,t,!1),this.semicolon()}function QEe(e){KEe._classMethodHead.call(this,e),this.semicolon()}function ePe(e){this.print(e.left),this.tokenChar(46),this.print(e.right)}function tPe(e){Tk.call(this,e),Gf(this,e)}function Gf(e,t){if(!e.tokenMap||!t.start||!t.end){e.semicolon();return}e.tokenMap.endMatches(t,",")?e.token(","):e.tokenMap.endMatches(t,";")&&e.semicolon()}function rPe(e){this.word("new"),this.space(),Tk.call(this,e),Gf(this,e)}function nPe(e){let{readonly:t}=e;t&&(this.word("readonly"),this.space()),D4.call(this,e),this.print(e.typeAnnotation),Gf(this,e)}function D4(e){e.computed&&this.tokenChar(91),this.print(e.key),e.computed&&this.tokenChar(93),e.optional&&this.tokenChar(63)}function iPe(e){let{kind:t}=e;(t==="set"||t==="get")&&(this.word(t),this.space()),D4.call(this,e),Tk.call(this,e),Gf(this,e)}function sPe(e){let{readonly:t,static:r}=e;r&&(this.word("static"),this.space()),t&&(this.word("readonly"),this.space()),this.tokenChar(91),Kf._parameters.call(this,e.parameters,93),this.print(e.typeAnnotation),Gf(this,e)}function aPe(){this.word("any")}function oPe(){this.word("bigint")}function cPe(){this.word("unknown")}function lPe(){this.word("number")}function uPe(){this.word("object")}function dPe(){this.word("boolean")}function pPe(){this.word("string")}function fPe(){this.word("symbol")}function hPe(){this.word("void")}function mPe(){this.word("undefined")}function gPe(){this.word("null")}function yPe(){this.word("never")}function _Pe(){this.word("intrinsic")}function bPe(){this.word("this")}function vPe(e){M4.call(this,e)}function xPe(e){e.abstract&&(this.word("abstract"),this.space()),this.word("new"),this.space(),M4.call(this,e)}function M4(e){let{typeParameters:t}=e,r=e.parameters;this.print(t),this.tokenChar(40),Kf._parameters.call(this,r,41),this.space();let n=e.typeAnnotation;this.print(n)}function SPe(e){let t=e.typeParameters;this.print(e.typeName,!!t),this.print(t)}function TPe(e){e.asserts&&(this.word("asserts"),this.space()),this.print(e.parameterName),e.typeAnnotation&&(this.space(),this.word("is"),this.space(),this.print(e.typeAnnotation.typeAnnotation))}function wPe(e){this.word("typeof"),this.space(),this.print(e.exprName);let t=e.typeParameters;t&&this.print(t)}function EPe(e){L_(this,e,()=>this.printJoin(e.members,!0,!0,void 0,void 0,!0))}function PPe(e){this.print(e.elementType,!0),this.tokenChar(91),this.tokenChar(93)}function IPe(e){this.tokenChar(91),this.printList(e.elementTypes,this.shouldPrintTrailingComma("]")),this.tokenChar(93)}function APe(e){this.print(e.typeAnnotation),this.tokenChar(63)}function kPe(e){this.token("..."),this.print(e.typeAnnotation)}function CPe(e){this.print(e.label),e.optional&&this.tokenChar(63),this.tokenChar(58),this.space(),this.print(e.elementType)}function NPe(e){L4(this,e,"|")}function OPe(e){L4(this,e,"&")}function L4(e,t,r){var n;let s=0;(n=e.tokenMap)!=null&&n.startMatches(t,r)&&(s=1,e.token(r)),e.printJoin(t.types,void 0,void 0,function(a){this.space(),this.token(r,void 0,a+s),this.space()})}function $Pe(e){this.print(e.checkType),this.space(),this.word("extends"),this.space(),this.print(e.extendsType),this.space(),this.tokenChar(63),this.space(),this.print(e.trueType),this.space(),this.tokenChar(58),this.space(),this.print(e.falseType)}function RPe(e){this.word("infer"),this.print(e.typeParameter)}function DPe(e){this.tokenChar(40),this.print(e.typeAnnotation),this.tokenChar(41)}function MPe(e){this.word(e.operator),this.space(),this.print(e.typeAnnotation)}function LPe(e){this.print(e.objectType,!0),this.tokenChar(91),this.print(e.indexType),this.tokenChar(93)}function FPe(e){let{nameType:t,optional:r,readonly:n,typeAnnotation:s}=e;this.tokenChar(123);let a=this.enterDelimited();this.space(),n&&($4(this,n),this.word("readonly"),this.space()),this.tokenChar(91),this.word(e.typeParameter.name),this.space(),this.word("in"),this.space(),this.print(e.typeParameter.constraint,void 0,!0),t&&(this.space(),this.word("as"),this.space(),this.print(t,void 0,!0)),this.tokenChar(93),r&&($4(this,r),this.tokenChar(63)),s&&(this.tokenChar(58),this.space(),this.print(s,void 0,!0)),this.space(),this._noLineTerminatorAfterNode=a,this.tokenChar(125)}function $4(e,t){t!==!0&&e.token(t)}function jPe(e){GEe._printTemplate.call(this,e,e.types)}function BPe(e){this.print(e.literal)}function zPe(e){this.print(e.expression),this.print(e.typeArguments)}function UPe(e){let{declare:t,id:r,typeParameters:n,extends:s,body:a}=e;t&&(this.word("declare"),this.space()),this.word("interface"),this.space(),this.print(r),this.print(n),s!=null&&s.length&&(this.space(),this.word("extends"),this.space(),this.printList(s)),this.space(),this.print(a)}function qPe(e){L_(this,e,()=>this.printJoin(e.body,!0,!0,void 0,void 0,!0))}function WPe(e){let{declare:t,id:r,typeParameters:n,typeAnnotation:s}=e;t&&(this.word("declare"),this.space()),this.word("type"),this.space(),this.print(r),this.print(n),this.space(),this.tokenChar(61),this.space(),this.print(s),this.semicolon()}function VPe(e){let{expression:t,typeAnnotation:r}=e;this.print(t,!0),this.space(),this.word("as"),this.space(),this.print(r)}function KPe(e){let{expression:t,typeAnnotation:r}=e;this.print(t,!0),this.space(),this.word("satisfies"),this.space(),this.print(r)}function GPe(e){let{typeAnnotation:t,expression:r}=e;this.tokenChar(60),this.print(t),this.tokenChar(62),this.space(),this.print(r)}function ZPe(e){this.print(e.expression),this.print(e.typeParameters)}function HPe(e){let{declare:t,const:r,id:n}=e;t&&(this.word("declare"),this.space()),r&&(this.word("const"),this.space()),this.word("enum"),this.space(),this.print(n),this.space(),F4.call(this,e)}function F4(e){L_(this,e,()=>{var t;return this.printList(e.members,(t=this.shouldPrintTrailingComma("}"))!=null?t:!0,!0,!0,void 0,!0)})}function JPe(e){let{id:t,initializer:r}=e;this.print(t),r&&(this.space(),this.tokenChar(61),this.space(),this.print(r))}function YPe(e){let{declare:t,id:r,kind:n}=e;if(t&&(this.word("declare"),this.space()),e.global||(this.word(n??(r.type==="Identifier"?"namespace":"module")),this.space()),this.print(r),!e.body){this.semicolon();return}let s=e.body;for(;s.type==="TSModuleDeclaration";)this.tokenChar(46),this.print(s.id),s=s.body;this.space(),this.print(s)}function XPe(e){L_(this,e,()=>this.printSequence(e.body,!0,!0))}function QPe(e){let{qualifier:t,options:r}=e;this.word("import"),this.tokenChar(40),this.print(e.argument),r&&(this.tokenChar(44),this.print(r)),this.tokenChar(41),t&&(this.tokenChar(46),this.print(t));let n=e.typeParameters;n&&this.print(n)}function eIe(e){let{id:t,moduleReference:r}=e;e.isExport&&(this.word("export"),this.space()),this.word("import"),this.space(),this.print(t),this.space(),this.tokenChar(61),this.space(),this.print(r),this.semicolon()}function tIe(e){this.token("require("),this.print(e.expression),this.tokenChar(41)}function rIe(e){this.print(e.expression),this.tokenChar(33),this.setLastChar(33)}function nIe(e){this.word("export"),this.space(),this.tokenChar(61),this.space(),this.print(e.expression),this.semicolon()}function iIe(e){this.word("export"),this.space(),this.word("as"),this.space(),this.word("namespace"),this.space(),this.print(e.id),this.semicolon()}function Tk(e){let{typeParameters:t}=e,r=e.parameters;this.print(t),this.tokenChar(40),Kf._parameters.call(this,r,41);let n=e.typeAnnotation;this.print(n)}function sIe(e){let t=e.type==="ClassPrivateProperty",r=e.type==="ClassAccessorProperty"||e.type==="ClassProperty";R4(this,e,[r&&e.declare&&"declare",!t&&e.accessibility]),e.static&&(this.word("static"),this.space()),R4(this,e,[!t&&e.abstract&&"abstract",!t&&e.override&&"override",(r||t)&&e.readonly&&"readonly"])}function L_(e,t,r){e.token("{");let n=e.enterDelimited();r(),e._noLineTerminatorAfterNode=n,e.rightBrace(t)}function R4(e,t,r){var n;let s=new Set;for(let a of r)a&&s.add(a);(n=e.tokenMap)==null||n.find(t,a=>s.has(a.value)?(e.token(a.value),e.space(),s.delete(a.value),s.size===0):!1);for(let a of s)e.word(a),e.space()}});var Pk=G(ei=>{"use strict";Object.defineProperty(ei,"__esModule",{value:!0});ei.ExportAllDeclaration=bIe;ei.ExportDefaultDeclaration=xIe;ei.ExportDefaultSpecifier=gIe;ei.ExportNamedDeclaration=vIe;ei.ExportNamespaceSpecifier=_Ie;ei.ExportSpecifier=yIe;ei.ImportAttribute=TIe;ei.ImportDeclaration=SIe;ei.ImportDefaultSpecifier=mIe;ei.ImportExpression=EIe;ei.ImportNamespaceSpecifier=wIe;ei.ImportSpecifier=hIe;ei._printAttributes=F_;var aIe=Rt(),oIe=wo(),cIe=D_(),{isClassDeclaration:lIe,isExportDefaultSpecifier:uIe,isExportNamespaceSpecifier:dIe,isImportDefaultSpecifier:pIe,isImportNamespaceSpecifier:fIe,isStatement:B4}=aIe;function hIe(e){(e.importKind==="type"||e.importKind==="typeof")&&(this.word(e.importKind),this.space()),this.print(e.imported),e.local&&e.local.name!==e.imported.name&&(this.space(),this.word("as"),this.space(),this.print(e.local))}function mIe(e){this.print(e.local)}function gIe(e){this.print(e.exported)}function yIe(e){e.exportKind==="type"&&(this.word("type"),this.space()),this.print(e.local),e.exported&&e.local.name!==e.exported.name&&(this.space(),this.word("as"),this.space(),this.print(e.exported))}function _Ie(e){this.tokenChar(42),this.space(),this.word("as"),this.space(),this.print(e.exported)}var j4=!1;function F_(e,t){var r;let{attributes:n}=e;var{assertions:s}=e;let{importAttributesKeyword:a}=this.format;n&&!a&&e.extra&&(e.extra.deprecatedAssertSyntax||e.extra.deprecatedWithLegacySyntax)&&!j4&&(j4=!0,console.warn('You are using import attributes, without specifying the desired output syntax.\nPlease specify the "importAttributesKeyword" generator option, whose value can be one of:\n - "with" : `import { a } from "b" with { type: "json" };`\n - "assert" : `import { a } from "b" assert { type: "json" };`\n - "with-legacy" : `import { a } from "b" with type: "json";`\n'));let o=a==="assert"||!a&&s;if(this.word(o?"assert":"with"),this.space(),!o&&(a==="with-legacy"||!a&&(r=e.extra)!=null&&r.deprecatedWithLegacySyntax)){this.printList(n||s);return}let c=t?1:0;this.token("{",void 0,c),this.space(),this.printList(n||s,this.shouldPrintTrailingComma("}")),this.space(),this.token("}",void 0,c)}function bIe(e){var t,r;this.word("export"),this.space(),e.exportKind==="type"&&(this.word("type"),this.space()),this.tokenChar(42),this.space(),this.word("from"),this.space(),(t=e.attributes)!=null&&t.length||(r=e.assertions)!=null&&r.length?(this.print(e.source,!0),this.space(),F_.call(this,e,!1)):this.print(e.source),this.semicolon()}function z4(e,t){lIe(t.declaration)&&cIe._shouldPrintDecoratorsBeforeExport.call(e,t)&&e.printJoin(t.declaration.decorators)}function vIe(e){if(z4(this,e),this.word("export"),this.space(),e.declaration){let n=e.declaration;this.print(n),B4(n)||this.semicolon()}else{e.exportKind==="type"&&(this.word("type"),this.space());let n=e.specifiers.slice(0),s=!1;for(;;){let o=n[0];if(uIe(o)||dIe(o))s=!0,this.print(n.shift()),n.length&&(this.tokenChar(44),this.space());else break}let a=!1;if((n.length||!n.length&&!s)&&(a=!0,this.tokenChar(123),n.length&&(this.space(),this.printList(n,this.shouldPrintTrailingComma("}")),this.space()),this.tokenChar(125)),e.source){var t,r;this.space(),this.word("from"),this.space(),(t=e.attributes)!=null&&t.length||(r=e.assertions)!=null&&r.length?(this.print(e.source,!0),this.space(),F_.call(this,e,a)):this.print(e.source)}this.semicolon()}}function xIe(e){z4(this,e),this.word("export"),this.noIndentInnerCommentsHere(),this.space(),this.word("default"),this.space(),this.tokenContext|=oIe.TokenContext.exportDefault;let t=e.declaration;this.print(t),B4(t)||this.semicolon()}function SIe(e){var t,r;this.word("import"),this.space();let n=e.importKind==="type"||e.importKind==="typeof";n?(this.noIndentInnerCommentsHere(),this.word(e.importKind),this.space()):e.module?(this.noIndentInnerCommentsHere(),this.word("module"),this.space()):e.phase&&(this.noIndentInnerCommentsHere(),this.word(e.phase),this.space());let s=e.specifiers.slice(0),a=!!s.length;for(;a;){let c=s[0];if(pIe(c)||fIe(c))this.print(s.shift()),s.length&&(this.tokenChar(44),this.space());else break}let o=!1;s.length?(o=!0,this.tokenChar(123),this.space(),this.printList(s,this.shouldPrintTrailingComma("}")),this.space(),this.tokenChar(125)):n&&!a&&(o=!0,this.tokenChar(123),this.tokenChar(125)),(a||n)&&(this.space(),this.word("from"),this.space()),(t=e.attributes)!=null&&t.length||(r=e.assertions)!=null&&r.length?(this.print(e.source,!0),this.space(),F_.call(this,e,o)):this.print(e.source),this.semicolon()}function TIe(e){this.print(e.key),this.tokenChar(58),this.space(),this.print(e.value)}function wIe(e){this.tokenChar(42),this.space(),this.word("as"),this.space(),this.print(e.local)}function EIe(e){this.word("import"),e.phase&&(this.tokenChar(46),this.word(e.phase)),this.tokenChar(40);let t=this.shouldPrintTrailingComma(")");this.print(e.source),e.options!=null&&(this.tokenChar(44),this.space(),this.print(e.options)),t&&this.tokenChar(44),this.rightParens(e)}});var V4=G((Xst,W4)=>{"use strict";var U4={},PIe=U4.hasOwnProperty,q4=(e,t)=>{for(let r in e)PIe.call(e,r)&&t(r,e[r])},IIe=(e,t)=>(t&&q4(t,(r,n)=>{e[r]=n}),e),AIe=(e,t)=>{let r=e.length,n=-1;for(;++n<r;)t(e[n])},j_=e=>"\\u"+("0000"+e).slice(-4),Zf=(e,t)=>{let r=e.toString(16);return t?r:r.toUpperCase()},Hf=U4.toString,kIe=Array.isArray,CIe=e=>typeof Buffer=="function"&&Buffer.isBuffer(e),NIe=e=>Hf.call(e)=="[object Object]",OIe=e=>typeof e=="string"||Hf.call(e)=="[object String]",$Ie=e=>typeof e=="number"||Hf.call(e)=="[object Number]",Ik=e=>typeof e=="bigint",RIe=e=>typeof e=="function",DIe=e=>Hf.call(e)=="[object Map]",MIe=e=>Hf.call(e)=="[object Set]",LIe={"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"},FIe=/[\\\b\f\n\r\t]/,jIe=/[0-9]/,BIe=/[\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,zIe=/([\uD800-\uDBFF][\uDC00-\uDFFF])|([\uD800-\uDFFF])|(['"`])|[^]/g,UIe=/([\uD800-\uDBFF][\uDC00-\uDFFF])|([\uD800-\uDFFF])|(['"`])|[^ !#-&\(-\[\]-_a-~]/g,Eo=(e,t)=>{let r=()=>{u=l,++t.indentLevel,l=t.indent.repeat(t.indentLevel)},n={escapeEverything:!1,minimal:!1,isScriptContext:!1,quotes:"single",wrap:!1,es6:!1,json:!1,compact:!0,lowercaseHex:!1,numbers:"decimal",indent:" ",indentLevel:0,__inline1__:!1,__inline2__:!1},s=t&&t.json;s&&(n.quotes="double",n.wrap=!0),t=IIe(n,t),t.quotes!="single"&&t.quotes!="double"&&t.quotes!="backtick"&&(t.quotes="single");let a=t.quotes=="double"?'"':t.quotes=="backtick"?"`":"'",o=t.compact,c=t.lowercaseHex,l=t.indent.repeat(t.indentLevel),u="",d=t.__inline1__,p=t.__inline2__,f=o?"":`
|
|
33
33
|
`,h,m=!0,g=t.numbers=="binary",y=t.numbers=="octal",_=t.numbers=="decimal",v=t.numbers=="hexadecimal";if(s&&e&&RIe(e.toJSON)&&(e=e.toJSON()),!OIe(e)){if(DIe(e))return e.size==0?"new Map()":(o||(t.__inline1__=!0,t.__inline2__=!1),"new Map("+Eo(Array.from(e),t)+")");if(MIe(e))return e.size==0?"new Set()":"new Set("+Eo(Array.from(e),t)+")";if(CIe(e))return e.length==0?"Buffer.from([])":"Buffer.from("+Eo(Array.from(e),t)+")";if(kIe(e))return h=[],t.wrap=!0,d&&(t.__inline1__=!1,t.__inline2__=!0),p||r(),AIe(e,w=>{m=!1,p&&(t.__inline2__=!1),h.push((o||p?"":l)+Eo(w,t))}),m?"[]":p?"["+h.join(", ")+"]":"["+f+h.join(","+f)+f+(o?"":u)+"]";if($Ie(e)||Ik(e)){if(s)return JSON.stringify(Number(e));let w;if(_)w=String(e);else if(v){let E=e.toString(16);c||(E=E.toUpperCase()),w="0x"+E}else g?w="0b"+e.toString(2):y&&(w="0o"+e.toString(8));return Ik(e)?w+"n":w}else return Ik(e)?s?JSON.stringify(Number(e)):e+"n":NIe(e)?(h=[],t.wrap=!0,r(),q4(e,(w,E)=>{m=!1,h.push((o?"":l)+Eo(w,t)+":"+(o?"":" ")+Eo(E,t))}),m?"{}":"{"+f+h.join(","+f)+f+(o?"":u)+"}"):s?JSON.stringify(e)||"null":String(e)}let S=t.escapeEverything?zIe:UIe;return h=e.replace(S,(w,E,k,N,O,V)=>{if(E){if(t.minimal)return E;let W=E.charCodeAt(0),$=E.charCodeAt(1);if(t.es6){let H=(W-55296)*1024+$-56320+65536;return"\\u{"+Zf(H,c)+"}"}return j_(Zf(W,c))+j_(Zf($,c))}if(k)return j_(Zf(k.charCodeAt(0),c));if(w=="\0"&&!s&&!jIe.test(V.charAt(O+1)))return"\\0";if(N)return N==a||t.escapeEverything?"\\"+N:N;if(FIe.test(w))return LIe[w];if(t.minimal&&!BIe.test(w))return w;let te=Zf(w.charCodeAt(0),c);return s||te.length>2?j_(te):"\\x"+("00"+te).slice(-2)}),a=="`"&&(h=h.replace(/\$\{/g,"\\${")),t.isScriptContext&&(h=h.replace(/<\/(script|style)/gi,"<\\/$1").replace(/<!--/g,s?"\\u003C!--":"\\x3C!--")),t.wrap&&(h=a+h+a),h};Eo.version="3.0.2";W4.exports=Eo});var z_=G(Lr=>{"use strict";Object.defineProperty(Lr,"__esModule",{value:!0});Lr.ArgumentPlaceholder=ZIe;Lr.ArrayPattern=Lr.ArrayExpression=QIe;Lr.BigIntLiteral=sAe;Lr.BooleanLiteral=tAe;Lr.Identifier=GIe;Lr.NullLiteral=rAe;Lr.NumericLiteral=nAe;Lr.ObjectPattern=Lr.ObjectExpression=JIe;Lr.ObjectMethod=YIe;Lr.ObjectProperty=XIe;Lr.PipelineBareFunction=cAe;Lr.PipelinePrimaryTopicReference=lAe;Lr.PipelineTopicExpression=oAe;Lr.RegExpLiteral=eAe;Lr.SpreadElement=Lr.RestElement=HIe;Lr.StringLiteral=iAe;Lr.TopicReference=aAe;Lr.VoidPattern=uAe;Lr._getRawIdentifier=KIe;var qIe=Rt(),G4=V4(),WIe=Vf(),{isAssignmentPattern:VIe,isIdentifier:Ak}=qIe,B_="";function KIe(e){let{name:t}=e,r=this.tokenMap.find(e,n=>n.value===t);return r?(B_=this._originalCode.slice(r.start,r.end),B_):B_=e.name}function GIe(e){if(this._buf._map){var t;this.sourceIdentifierName(((t=e.loc)==null?void 0:t.identifierName)||e.name)}this.word(this.tokenMap?B_:e.name)}function ZIe(){this.tokenChar(63)}function HIe(e){this.token("..."),this.print(e.argument)}function JIe(e){let t=e.properties;if(this.tokenChar(123),t.length){let r=this.enterDelimited();this.space(),this.printList(t,this.shouldPrintTrailingComma("}"),!0,!0,void 0,!0),this.space(),this._noLineTerminatorAfterNode=r}this.rightBrace(e)}function YIe(e){this.printJoin(e.decorators),WIe._methodHead.call(this,e),this.space(),this.print(e.body)}function XIe(e){if(this.printJoin(e.decorators),e.computed)this.tokenChar(91),this.print(e.key),this.tokenChar(93);else{if(VIe(e.value)&&Ak(e.key)&&e.key.name===e.value.left.name){this.print(e.value);return}if(this.print(e.key),e.shorthand&&Ak(e.key)&&Ak(e.value)&&e.key.name===e.value.name)return}this.tokenChar(58),this.space(),this.print(e.value)}function QIe(e){let t=e.elements,r=t.length;this.tokenChar(91);let n=this.enterDelimited();for(let s=0;s<t.length;s++){let a=t[s];a?(s>0&&this.space(),this.print(a,void 0,!0),(s<r-1||this.shouldPrintTrailingComma("]"))&&this.tokenChar(44,s)):this.tokenChar(44,s)}this._noLineTerminatorAfterNode=n,this.tokenChar(93)}function eAe(e){this.word(`/${e.pattern}/${e.flags}`,!1)}function tAe(e){this.word(e.value?"true":"false")}function rAe(){this.word("null")}function nAe(e){let t=this.getPossibleRaw(e),r=this.format.jsescOption,n=e.value,s=n+"";r.numbers?this.number(G4(n,r),n):t==null?this.number(s,n):this.format.minified?this.number(t.length<s.length?t:s,n):this.number(t,n)}function iAe(e){let t=this.getPossibleRaw(e);if(!this.format.minified&&t!==void 0){this.token(t);return}let r=G4(e.value,this.format.jsescOption);this.token(r)}function sAe(e){let t=this.getPossibleRaw(e);if(!this.format.minified&&t!==void 0){this.word(t);return}this.word(e.value+"n")}var K4=new Set(["^^","@@","^","%","#"]);function aAe(){let{topicToken:e}=this.format;if(K4.has(e))this.token(e);else{let t=JSON.stringify(e),r=Array.from(K4,n=>JSON.stringify(n));throw new Error(`The "topicToken" generator option must be one of ${r.join(", ")} (${t} received instead).`)}}function oAe(e){this.print(e.expression)}function cAe(e){this.print(e.callee)}function lAe(){this.tokenChar(35)}function uAe(){this.word("void")}});var Nk=G(Ue=>{"use strict";Object.defineProperty(Ue,"__esModule",{value:!0});Ue.AnyTypeAnnotation=mAe;Ue.ArrayTypeAnnotation=gAe;Ue.BooleanLiteralTypeAnnotation=_Ae;Ue.BooleanTypeAnnotation=yAe;Ue.DeclareClass=vAe;Ue.DeclareExportAllDeclaration=NAe;Ue.DeclareExportDeclaration=CAe;Ue.DeclareFunction=xAe;Ue.DeclareInterface=wAe;Ue.DeclareModule=EAe;Ue.DeclareModuleExports=PAe;Ue.DeclareOpaqueType=AAe;Ue.DeclareTypeAlias=IAe;Ue.DeclareVariable=kAe;Ue.DeclaredPredicate=TAe;Ue.EmptyTypeAnnotation=JAe;Ue.EnumBooleanBody=$Ae;Ue.EnumBooleanMember=FAe;Ue.EnumDeclaration=OAe;Ue.EnumDefaultedMember=LAe;Ue.EnumNumberBody=RAe;Ue.EnumNumberMember=jAe;Ue.EnumStringBody=DAe;Ue.EnumStringMember=BAe;Ue.EnumSymbolBody=MAe;Ue.ExistsTypeAnnotation=UAe;Ue.FunctionTypeAnnotation=qAe;Ue.FunctionTypeParam=WAe;Ue.IndexedAccessType=bke;Ue.InferredPredicate=SAe;Ue.InterfaceDeclaration=H4;Ue.GenericTypeAnnotation=Ue.ClassImplements=Ue.InterfaceExtends=VAe;Ue.InterfaceTypeAnnotation=GAe;Ue.IntersectionTypeAnnotation=ZAe;Ue.MixedTypeAnnotation=HAe;Ue.NullLiteralTypeAnnotation=bAe;Ue.NullableTypeAnnotation=YAe;Object.defineProperty(Ue,"NumberLiteralTypeAnnotation",{enumerable:!0,get:function(){return Z4.NumericLiteral}});Ue.NumberTypeAnnotation=XAe;Ue.ObjectTypeAnnotation=ake;Ue.ObjectTypeCallProperty=cke;Ue.ObjectTypeIndexer=lke;Ue.ObjectTypeInternalSlot=oke;Ue.ObjectTypeProperty=uke;Ue.ObjectTypeSpreadProperty=dke;Ue.OpaqueType=Y4;Ue.OptionalIndexedAccessType=vke;Ue.QualifiedTypeIdentifier=pke;Object.defineProperty(Ue,"StringLiteralTypeAnnotation",{enumerable:!0,get:function(){return Z4.StringLiteral}});Ue.StringTypeAnnotation=QAe;Ue.SymbolTypeAnnotation=fke;Ue.ThisTypeAnnotation=eke;Ue.TupleTypeAnnotation=tke;Ue.TypeAlias=J4;Ue.TypeAnnotation=nke;Ue.TypeCastExpression=gke;Ue.TypeParameter=ske;Ue.TypeParameterDeclaration=Ue.TypeParameterInstantiation=ike;Ue.TypeofTypeAnnotation=rke;Ue.UnionTypeAnnotation=mke;Ue.Variance=yke;Ue.VoidTypeAnnotation=_ke;Ue._interfaceish=Ck;Ue._variance=V_;var dAe=Rt(),pAe=Pk(),fAe=wo(),Z4=z_(),{isDeclareExportDeclaration:U_,isStatement:hAe}=dAe;function mAe(){this.word("any")}function gAe(e){this.print(e.elementType,!0),this.tokenChar(91),this.tokenChar(93)}function yAe(){this.word("boolean")}function _Ae(e){this.word(e.value?"true":"false")}function bAe(){this.word("null")}function vAe(e,t){U_(t)||(this.word("declare"),this.space()),this.word("class"),this.space(),Ck.call(this,e)}function xAe(e,t){U_(t)||(this.word("declare"),this.space()),this.word("function"),this.space(),this.print(e.id),this.print(e.id.typeAnnotation.typeAnnotation),e.predicate&&(this.space(),this.print(e.predicate)),this.semicolon()}function SAe(){this.tokenChar(37),this.word("checks")}function TAe(e){this.tokenChar(37),this.word("checks"),this.tokenChar(40),this.print(e.value),this.tokenChar(41)}function wAe(e){this.word("declare"),this.space(),H4.call(this,e)}function EAe(e){this.word("declare"),this.space(),this.word("module"),this.space(),this.print(e.id),this.space(),this.print(e.body)}function PAe(e){this.word("declare"),this.space(),this.word("module"),this.tokenChar(46),this.word("exports"),this.print(e.typeAnnotation)}function IAe(e){this.word("declare"),this.space(),J4.call(this,e)}function AAe(e,t){U_(t)||(this.word("declare"),this.space()),Y4.call(this,e)}function kAe(e,t){U_(t)||(this.word("declare"),this.space()),this.word("var"),this.space(),this.print(e.id),this.print(e.id.typeAnnotation),this.semicolon()}function CAe(e){this.word("declare"),this.space(),this.word("export"),this.space(),e.default&&(this.word("default"),this.space()),zAe.call(this,e)}function NAe(e){this.word("declare"),this.space(),pAe.ExportAllDeclaration.call(this,e)}function OAe(e){let{id:t,body:r}=e;this.word("enum"),this.space(),this.print(t),this.print(r)}function q_(e,t,r){r&&(e.space(),e.word("of"),e.space(),e.word(t)),e.space()}function W_(e,t){let{members:r}=t;e.token("{"),e.indent(),e.newline();for(let n of r)e.print(n),e.newline();t.hasUnknownMembers&&(e.token("..."),e.newline()),e.dedent(),e.token("}")}function $Ae(e){let{explicitType:t}=e;q_(this,"boolean",t),W_(this,e)}function RAe(e){let{explicitType:t}=e;q_(this,"number",t),W_(this,e)}function DAe(e){let{explicitType:t}=e;q_(this,"string",t),W_(this,e)}function MAe(e){q_(this,"symbol",!0),W_(this,e)}function LAe(e){let{id:t}=e;this.print(t),this.tokenChar(44)}function kk(e,t){e.print(t.id),e.space(),e.token("="),e.space(),e.print(t.init),e.token(",")}function FAe(e){kk(this,e)}function jAe(e){kk(this,e)}function BAe(e){kk(this,e)}function zAe(e){if(e.declaration){let t=e.declaration;this.print(t),hAe(t)||this.semicolon()}else this.tokenChar(123),e.specifiers.length&&(this.space(),this.printList(e.specifiers),this.space()),this.tokenChar(125),e.source&&(this.space(),this.word("from"),this.space(),this.print(e.source)),this.semicolon()}function UAe(){this.tokenChar(42)}function qAe(e,t){this.print(e.typeParameters),this.tokenChar(40),e.this&&(this.word("this"),this.tokenChar(58),this.space(),this.print(e.this.typeAnnotation),(e.params.length||e.rest)&&(this.tokenChar(44),this.space())),this.printList(e.params),e.rest&&(e.params.length&&(this.tokenChar(44),this.space()),this.token("..."),this.print(e.rest)),this.tokenChar(41);let r=t?.type;r!=null&&(r==="ObjectTypeCallProperty"||r==="ObjectTypeInternalSlot"||r==="DeclareFunction"||r==="ObjectTypeProperty"&&t.method)?this.tokenChar(58):(this.space(),this.token("=>")),this.space(),this.print(e.returnType)}function WAe(e){this.print(e.name),e.optional&&this.tokenChar(63),e.name&&(this.tokenChar(58),this.space()),this.print(e.typeAnnotation)}function VAe(e){this.print(e.id),this.print(e.typeParameters,!0)}function Ck(e){var t;if(this.print(e.id),this.print(e.typeParameters),(t=e.extends)!=null&&t.length&&(this.space(),this.word("extends"),this.space(),this.printList(e.extends)),e.type==="DeclareClass"){var r,n;(r=e.mixins)!=null&&r.length&&(this.space(),this.word("mixins"),this.space(),this.printList(e.mixins)),(n=e.implements)!=null&&n.length&&(this.space(),this.word("implements"),this.space(),this.printList(e.implements))}this.space(),this.print(e.body)}function V_(e){var t;let r=(t=e.variance)==null?void 0:t.kind;r!=null&&(r==="plus"?this.tokenChar(43):r==="minus"&&this.tokenChar(45))}function H4(e){this.word("interface"),this.space(),Ck.call(this,e)}function KAe(e){this.space(),this.token("&",!1,e),this.space()}function GAe(e){var t;this.word("interface"),(t=e.extends)!=null&&t.length&&(this.space(),this.word("extends"),this.space(),this.printList(e.extends)),this.space(),this.print(e.body)}function ZAe(e){this.printJoin(e.types,void 0,void 0,KAe)}function HAe(){this.word("mixed")}function JAe(){this.word("empty")}function YAe(e){this.tokenChar(63),this.print(e.typeAnnotation)}function XAe(){this.word("number")}function QAe(){this.word("string")}function eke(){this.word("this")}function tke(e){this.tokenChar(91),this.printList(e.types),this.tokenChar(93)}function rke(e){this.word("typeof"),this.space(),this.print(e.argument)}function J4(e){this.word("type"),this.space(),this.print(e.id),this.print(e.typeParameters),this.space(),this.tokenChar(61),this.space(),this.print(e.right),this.semicolon()}function nke(e,t){this.tokenChar(58),this.space(),t.type==="ArrowFunctionExpression"?this.tokenContext|=fAe.TokenContext.arrowFlowReturnType:e.optional&&this.tokenChar(63),this.print(e.typeAnnotation)}function ike(e){this.tokenChar(60),this.printList(e.params),this.tokenChar(62)}function ske(e){V_.call(this,e),this.word(e.name),e.bound&&this.print(e.bound),e.default&&(this.space(),this.tokenChar(61),this.space(),this.print(e.default))}function Y4(e){this.word("opaque"),this.space(),this.word("type"),this.space(),this.print(e.id),this.print(e.typeParameters),e.supertype&&(this.tokenChar(58),this.space(),this.print(e.supertype)),e.impltype&&(this.space(),this.tokenChar(61),this.space(),this.print(e.impltype)),this.semicolon()}function ake(e){e.exact?this.token("{|"):this.tokenChar(123);let t=[...e.properties,...e.callProperties||[],...e.indexers||[],...e.internalSlots||[]];t.length&&(this.newline(),this.space(),this.printJoin(t,!0,!0,()=>{(t.length!==1||e.inexact)&&(this.tokenChar(44),this.space())},!0),this.space()),e.inexact&&(this.indent(),this.token("..."),t.length&&this.newline(),this.dedent()),e.exact?this.token("|}"):this.tokenChar(125)}function oke(e){e.static&&(this.word("static"),this.space()),this.tokenChar(91),this.tokenChar(91),this.print(e.id),this.tokenChar(93),this.tokenChar(93),e.optional&&this.tokenChar(63),e.method||(this.tokenChar(58),this.space()),this.print(e.value)}function cke(e){e.static&&(this.word("static"),this.space()),this.print(e.value)}function lke(e){e.static&&(this.word("static"),this.space()),V_.call(this,e),this.tokenChar(91),e.id&&(this.print(e.id),this.tokenChar(58),this.space()),this.print(e.key),this.tokenChar(93),this.tokenChar(58),this.space(),this.print(e.value)}function uke(e){e.proto&&(this.word("proto"),this.space()),e.static&&(this.word("static"),this.space()),(e.kind==="get"||e.kind==="set")&&(this.word(e.kind),this.space()),V_.call(this,e),this.print(e.key),e.optional&&this.tokenChar(63),e.method||(this.tokenChar(58),this.space()),this.print(e.value)}function dke(e){this.token("..."),this.print(e.argument)}function pke(e){this.print(e.qualification),this.tokenChar(46),this.print(e.id)}function fke(){this.word("symbol")}function hke(e){this.space(),this.token("|",!1,e),this.space()}function mke(e){this.printJoin(e.types,void 0,void 0,hke)}function gke(e){this.tokenChar(40),this.print(e.expression),this.print(e.typeAnnotation),this.tokenChar(41)}function yke(e){e.kind==="plus"?this.tokenChar(43):this.tokenChar(45)}function _ke(){this.word("void")}function bke(e){this.print(e.objectType,!0),this.tokenChar(91),this.print(e.indexType),this.tokenChar(93)}function vke(e){this.print(e.objectType),e.optional&&this.token("?."),this.tokenChar(91),this.print(e.indexType),this.tokenChar(93)}});var Ek=G(Zi=>{"use strict";Object.defineProperty(Zi,"__esModule",{value:!0});Zi.ClassAccessorProperty=Cke;Zi.ClassBody=Ike;Zi.ClassExpression=Zi.ClassDeclaration=Pke;Zi.ClassMethod=Oke;Zi.ClassPrivateMethod=$ke;Zi.ClassPrivateProperty=Nke;Zi.ClassProperty=kke;Zi.StaticBlock=Rke;Zi._classMethodHead=Ok;var xke=Rt(),Ske=D_(),K_=wk(),X4=Nk(),Tke=Vf(),{isExportDefaultDeclaration:wke,isExportNamedDeclaration:Eke}=xke;function Pke(e,t){(!(wke(t)||Eke(t))||!Ske._shouldPrintDecoratorsBeforeExport.call(this,t))&&this.printJoin(e.decorators),e.declare&&(this.word("declare"),this.space()),e.abstract&&(this.word("abstract"),this.space()),this.word("class"),e.id&&(this.space(),this.print(e.id)),this.print(e.typeParameters),e.superClass&&(this.space(),this.word("extends"),this.space(),this.print(e.superClass),this.print(e.superTypeParameters)),e.implements&&(this.space(),this.word("implements"),this.space(),this.printList(e.implements)),this.space(),this.print(e.body)}function Ike(e){if(this.tokenChar(123),e.body.length===0)this.tokenChar(125);else{let t=Ake(this,e);t?.(-1);let r=this.enterDelimited();this.printJoin(e.body,!0,!0,t,!0,!0),this._noLineTerminatorAfterNode=r,this.endsWith(10)||this.newline(),this.rightBrace(e)}}function Ake(e,t){if(!e.tokenMap||t.start==null||t.end==null)return null;let r=e.tokenMap.getIndexes(t);if(!r)return null;let n=1,s=0,a=0,o=()=>{for(;a<t.body.length&&t.body[a].start==null;)a++};return o(),c=>{a<=c&&(a=c+1,o());let l=a===t.body.length?t.end:t.body[a].start,u;for(;n<r.length&&e.tokenMap.matchesOriginal(u=e._tokens[r[n]],";")&&u.start<l;)e.tokenChar(59,s++),n++}}function kke(e){if(this.printJoin(e.decorators),!e.static&&!this.format.preserveFormat){var t;let r=(t=e.key.loc)==null||(t=t.end)==null?void 0:t.line;r&&this.catchUp(r)}K_._tsPrintClassMemberModifiers.call(this,e),e.computed?(this.tokenChar(91),this.print(e.key),this.tokenChar(93)):(X4._variance.call(this,e),this.print(e.key)),e.optional&&this.tokenChar(63),e.definite&&this.tokenChar(33),this.print(e.typeAnnotation),e.value&&(this.space(),this.tokenChar(61),this.space(),this.print(e.value)),this.semicolon()}function Cke(e){var t;this.printJoin(e.decorators);let r=(t=e.key.loc)==null||(t=t.end)==null?void 0:t.line;r&&this.catchUp(r),K_._tsPrintClassMemberModifiers.call(this,e),this.word("accessor",!0),this.space(),e.computed?(this.tokenChar(91),this.print(e.key),this.tokenChar(93)):(X4._variance.call(this,e),this.print(e.key)),e.optional&&this.tokenChar(63),e.definite&&this.tokenChar(33),this.print(e.typeAnnotation),e.value&&(this.space(),this.tokenChar(61),this.space(),this.print(e.value)),this.semicolon()}function Nke(e){this.printJoin(e.decorators),K_._tsPrintClassMemberModifiers.call(this,e),this.print(e.key),e.optional&&this.tokenChar(63),e.definite&&this.tokenChar(33),this.print(e.typeAnnotation),e.value&&(this.space(),this.tokenChar(61),this.space(),this.print(e.value)),this.semicolon()}function Oke(e){Ok.call(this,e),this.space(),this.print(e.body)}function $ke(e){Ok.call(this,e),this.space(),this.print(e.body)}function Ok(e){if(this.printJoin(e.decorators),!this.format.preserveFormat){var t;let r=(t=e.key.loc)==null||(t=t.end)==null?void 0:t.line;r&&this.catchUp(r)}K_._tsPrintClassMemberModifiers.call(this,e),Tke._methodHead.call(this,e)}function Rke(e){this.word("static"),this.space(),this.tokenChar(123),e.body.length===0?this.tokenChar(125):(this.newline(),this.printSequence(e.body,!0),this.rightBrace(e))}});var Q4=G(wa=>{"use strict";Object.defineProperty(wa,"__esModule",{value:!0});wa.BlockStatement=Lke;wa.Directive=Fke;wa.DirectiveLiteral=zke;wa.File=Dke;wa.InterpreterDirective=Uke;wa.Placeholder=qke;wa.Program=Mke;function Dke(e){e.program&&this.print(e.program.interpreter),this.print(e.program)}function Mke(e){var t;this.printInnerComments(!1);let r=(t=e.directives)==null?void 0:t.length;if(r){var n;let s=e.body.length?2:1;this.printSequence(e.directives,void 0,void 0,s),(n=e.directives[r-1].trailingComments)!=null&&n.length||this.newline(s)}this.printSequence(e.body)}function Lke(e){var t;this.tokenChar(123);let r=this.enterDelimited(),n=(t=e.directives)==null?void 0:t.length;if(n){var s;let a=e.body.length?2:1;this.printSequence(e.directives,!0,!0,a),(s=e.directives[n-1].trailingComments)!=null&&s.length||this.newline(a)}this.printSequence(e.body,!0,!0),this._noLineTerminatorAfterNode=r,this.rightBrace(e)}function Fke(e){this.print(e.value),this.semicolon()}var jke=/(?:^|[^\\])(?:\\\\)*'/,Bke=/(?:^|[^\\])(?:\\\\)*"/;function zke(e){let t=this.getPossibleRaw(e);if(!this.format.minified&&t!==void 0){this.token(t);return}let{value:r}=e;if(!Bke.test(r))this.token(`"${r}"`);else if(!jke.test(r))this.token(`'${r}'`);else throw new Error("Malformed AST: it is not possible to print a directive containing both unescaped single and double quotes.")}function Uke(e){this.token(`#!${e.value}`),this._newline()}function qke(e){this.token("%%"),this.print(e.name),this.token("%%"),e.expectedNode==="Statement"&&this.semicolon()}});var ez=G(Pn=>{"use strict";Object.defineProperty(Pn,"__esModule",{value:!0});Pn.JSXAttribute=Wke;Pn.JSXClosingElement=t1e;Pn.JSXClosingFragment=s1e;Pn.JSXElement=Xke;Pn.JSXEmptyExpression=r1e;Pn.JSXExpressionContainer=Hke;Pn.JSXFragment=n1e;Pn.JSXIdentifier=Vke;Pn.JSXMemberExpression=Gke;Pn.JSXNamespacedName=Kke;Pn.JSXOpeningElement=e1e;Pn.JSXOpeningFragment=i1e;Pn.JSXSpreadAttribute=Zke;Pn.JSXSpreadChild=Jke;Pn.JSXText=Yke;function Wke(e){this.print(e.name),e.value&&(this.tokenChar(61),this.print(e.value))}function Vke(e){this.word(e.name)}function Kke(e){this.print(e.namespace),this.tokenChar(58),this.print(e.name)}function Gke(e){this.print(e.object),this.tokenChar(46),this.print(e.property)}function Zke(e){this.tokenChar(123),this.token("..."),this.print(e.argument),this.rightBrace(e)}function Hke(e){this.tokenChar(123),this.print(e.expression),this.rightBrace(e)}function Jke(e){this.tokenChar(123),this.token("..."),this.print(e.expression),this.rightBrace(e)}function Yke(e){let t=this.getPossibleRaw(e);t!==void 0?this.token(t,!0):this.token(e.value,!0)}function Xke(e){let t=e.openingElement;if(this.print(t),!t.selfClosing){this.indent();for(let r of e.children)this.print(r);this.dedent(),this.print(e.closingElement)}}function Qke(){this.space()}function e1e(e){this.tokenChar(60),this.print(e.name),e.typeArguments&&this.print(e.typeArguments),this.print(e.typeParameters),e.attributes.length>0&&(this.space(),this.printJoin(e.attributes,void 0,void 0,Qke)),e.selfClosing&&(this.space(),this.tokenChar(47)),this.tokenChar(62)}function t1e(e){this.tokenChar(60),this.tokenChar(47),this.print(e.name),this.tokenChar(62)}function r1e(){this.printInnerComments()}function n1e(e){this.print(e.openingFragment),this.indent();for(let t of e.children)this.print(t);this.dedent(),this.print(e.closingFragment)}function i1e(){this.tokenChar(60),this.tokenChar(62)}function s1e(){this.token("</"),this.tokenChar(62)}});var tz=G(Xt=>{"use strict";Object.defineProperty(Xt,"__esModule",{value:!0});var $k=vk();Object.keys($k).forEach(function(e){e==="default"||e==="__esModule"||e in Xt&&Xt[e]===$k[e]||Object.defineProperty(Xt,e,{enumerable:!0,get:function(){return $k[e]}})});var Rk=D_();Object.keys(Rk).forEach(function(e){e==="default"||e==="__esModule"||e in Xt&&Xt[e]===Rk[e]||Object.defineProperty(Xt,e,{enumerable:!0,get:function(){return Rk[e]}})});var Dk=A4();Object.keys(Dk).forEach(function(e){e==="default"||e==="__esModule"||e in Xt&&Xt[e]===Dk[e]||Object.defineProperty(Xt,e,{enumerable:!0,get:function(){return Dk[e]}})});var Mk=Ek();Object.keys(Mk).forEach(function(e){e==="default"||e==="__esModule"||e in Xt&&Xt[e]===Mk[e]||Object.defineProperty(Xt,e,{enumerable:!0,get:function(){return Mk[e]}})});var Lk=Vf();Object.keys(Lk).forEach(function(e){e==="default"||e==="__esModule"||e in Xt&&Xt[e]===Lk[e]||Object.defineProperty(Xt,e,{enumerable:!0,get:function(){return Lk[e]}})});var Fk=Pk();Object.keys(Fk).forEach(function(e){e==="default"||e==="__esModule"||e in Xt&&Xt[e]===Fk[e]||Object.defineProperty(Xt,e,{enumerable:!0,get:function(){return Fk[e]}})});var jk=z_();Object.keys(jk).forEach(function(e){e==="default"||e==="__esModule"||e in Xt&&Xt[e]===jk[e]||Object.defineProperty(Xt,e,{enumerable:!0,get:function(){return jk[e]}})});var Bk=Nk();Object.keys(Bk).forEach(function(e){e==="default"||e==="__esModule"||e in Xt&&Xt[e]===Bk[e]||Object.defineProperty(Xt,e,{enumerable:!0,get:function(){return Bk[e]}})});var zk=Q4();Object.keys(zk).forEach(function(e){e==="default"||e==="__esModule"||e in Xt&&Xt[e]===zk[e]||Object.defineProperty(Xt,e,{enumerable:!0,get:function(){return zk[e]}})});var Uk=ez();Object.keys(Uk).forEach(function(e){e==="default"||e==="__esModule"||e in Xt&&Xt[e]===Uk[e]||Object.defineProperty(Xt,e,{enumerable:!0,get:function(){return Uk[e]}})});var qk=wk();Object.keys(qk).forEach(function(e){e==="default"||e==="__esModule"||e in Xt&&Xt[e]===qk[e]||Object.defineProperty(Xt,e,{enumerable:!0,get:function(){return qk[e]}})})});var rz=G(Dc=>{"use strict";Object.defineProperty(Dc,"__esModule",{value:!0});Dc.DecimalLiteral=c1e;Dc.Noop=a1e;Dc.RecordExpression=l1e;Dc.TSExpressionWithTypeArguments=o1e;Dc.TupleExpression=u1e;function a1e(){}function o1e(e){this.print(e.expression),this.print(e.typeParameters)}function c1e(e){let t=this.getPossibleRaw(e);if(!this.format.minified&&t!==void 0){this.word(t);return}this.word(e.value+"m")}function l1e(e){let t=e.properties,r,n;if(this.format.recordAndTupleSyntaxType==="bar")r="{|",n="|}";else{if(this.format.recordAndTupleSyntaxType!=="hash"&&this.format.recordAndTupleSyntaxType!=null)throw new Error(`The "recordAndTupleSyntaxType" generator option must be "bar" or "hash" (${JSON.stringify(this.format.recordAndTupleSyntaxType)} received).`);r="#{",n="}"}this.token(r),t.length&&(this.space(),this.printList(t,this.shouldPrintTrailingComma(n),!0,!0),this.space()),this.token(n)}function u1e(e){let t=e.elements,r=t.length,n,s;if(this.format.recordAndTupleSyntaxType==="bar")n="[|",s="|]";else if(this.format.recordAndTupleSyntaxType==="hash")n="#[",s="]";else throw new Error(`${this.format.recordAndTupleSyntaxType} is not a valid recordAndTuple syntax type`);this.token(n);for(let a=0;a<t.length;a++){let o=t[a];o&&(a>0&&this.space(),this.print(o),(a<r-1||this.shouldPrintTrailingComma(s))&&this.token(",",!1,a))}this.token(s)}});var Wk=G(G_=>{"use strict";Object.defineProperty(G_,"__esModule",{value:!0});G_.generatorInfosMap=void 0;var nz=tz(),iz=rz(),sz=G_.generatorInfosMap=new Map,az=0;for(let e of Object.keys(nz).sort())e.startsWith("_")||sz.set(e,[nz[e],az++,void 0]);for(let e of Object.keys(iz))sz.set(e,[iz[e],az++,void 0])});var wo=G(Ou=>{"use strict";Object.defineProperty(Ou,"__esModule",{value:!0});Ou.TokenContext=void 0;Ou.isLastChild=h1e;Ou.parentNeedsParens=f1e;var oz=w4(),d1e=Rt(),cz=Wk(),{VISITOR_KEYS:p1e}=d1e,oat=Ou.TokenContext={normal:0,expressionStatement:1,arrowBody:2,exportDefault:4,arrowFlowReturnType:8,forInitHead:16,forInHead:32,forOfHead:64,forInOrInitHeadAccumulate:128,forInOrInitHeadAccumulatePassThroughMask:128};for(let e of Object.keys(oz)){let t=oz[e];cz.generatorInfosMap.has(e)&&(cz.generatorInfosMap.get(e)[2]=t)}function lz(e){switch(e.type){case"CallExpression":return!0;case"MemberExpression":return lz(e.object)}return!1}function f1e(e,t,r){switch(r){case 112:if(t.callee===e&&lz(e))return!0;break;case 42:return!Vk(e)&&!(e.type==="CallExpression"&&Vk(e.callee))&&e.type!=="ParenthesizedExpression"}return!1}function Vk(e){switch(e.type){case"Identifier":return!0;case"MemberExpression":return!e.computed&&e.property.type==="Identifier"&&Vk(e.object);default:return!1}}function h1e(e,t){let r=p1e[e.type];for(let n=r.length-1;n>=0;n--){let s=e[r[n]];if(s===t)return!0;if(Array.isArray(s)){let a=s.length-1;for(;a>=0&&s[a]===null;)a--;return a>=0&&s[a]===t}else if(s)return!1}return!1}});var uz=G(Z_=>{"use strict";Object.defineProperty(Z_,"__esModule",{value:!0});Z_.TokenMap=void 0;var m1e=Rt(),{traverseFast:g1e,VISITOR_KEYS:y1e}=m1e,Kk=class{constructor(t,r,n){this._tokens=void 0,this._source=void 0,this._nodesToTokenIndexes=new Map,this._nodesOccurrencesCountCache=new Map,this._tokensCache=new Map,this._tokens=r,this._source=n,g1e(t,s=>{let a=this._getTokensIndexesOfNode(s);a.length>0&&this._nodesToTokenIndexes.set(s,a)}),this._tokensCache.clear()}has(t){return this._nodesToTokenIndexes.has(t)}getIndexes(t){return this._nodesToTokenIndexes.get(t)}find(t,r){let n=this._nodesToTokenIndexes.get(t);if(n)for(let s=0;s<n.length;s++){let a=n[s],o=this._tokens[a];if(r(o,a))return o}return null}findLastIndex(t,r){let n=this._nodesToTokenIndexes.get(t);if(n)for(let s=n.length-1;s>=0;s--){let a=n[s],o=this._tokens[a];if(r(o,a))return a}return-1}findMatching(t,r,n=0){let s=this._nodesToTokenIndexes.get(t);if(s){typeof r=="number"&&(r=String.fromCharCode(r));let a=0,o=n;if(o>1){let c=this._nodesOccurrencesCountCache.get(t);c?.test===r&&c.count<o&&(a=c.i+1,n-=c.count+1)}for(;a<s.length;a++){let c=this._tokens[s[a]];if(this.matchesOriginal(c,r)){if(n===0)return o>0&&this._nodesOccurrencesCountCache.set(t,{test:r,count:o,i:a}),c;n--}}}return null}matchesOriginal(t,r){return t.end-t.start!==r.length?!1:t.value!=null?t.value===r:this._source.startsWith(r,t.start)}startMatches(t,r){let n=this._nodesToTokenIndexes.get(t);if(!n)return!1;let s=this._tokens[n[0]];return s.start!==t.start?!1:this.matchesOriginal(s,r)}endMatches(t,r){let n=this._nodesToTokenIndexes.get(t);if(!n)return!1;let s=this._tokens[n[n.length-1]];return s.end!==t.end?!1:this.matchesOriginal(s,r)}_getTokensIndexesOfNode(t){var r;if(t.start==null||t.end==null)return[];let{first:n,last:s}=this._findTokensOfNode(t,0,this._tokens.length-1),a=n,o=_1e(t);(t.type==="ExportNamedDeclaration"||t.type==="ExportDefaultDeclaration")&&((r=t.declaration)==null?void 0:r.type)==="ClassDeclaration"&&o.next();let c=[];for(let l of o){if(l==null||l.start==null||l.end==null)continue;let u=this._findTokensOfNode(l,a,s),d=u.first;for(let p=a;p<d;p++)c.push(p);a=u.last+1}for(let l=a;l<=s;l++)c.push(l);return c}_findTokensOfNode(t,r,n){let s=this._tokensCache.get(t);if(s)return s;let a=this._findFirstTokenOfNode(t.start,r,n),o=this._findLastTokenOfNode(t.end,a,n);return this._tokensCache.set(t,{first:a,last:o}),{first:a,last:o}}_findFirstTokenOfNode(t,r,n){for(;r<=n;){let s=n+r>>1;if(t<this._tokens[s].start)n=s-1;else if(t>this._tokens[s].start)r=s+1;else return s}return r}_findLastTokenOfNode(t,r,n){for(;r<=n;){let s=n+r>>1;if(t<this._tokens[s].end)n=s-1;else if(t>this._tokens[s].end)r=s+1;else return s}return n}};Z_.TokenMap=Kk;function*_1e(e){if(e.type==="TemplateLiteral"){yield e.quasis[0];for(let r=1;r<e.quasis.length;r++)yield e.expressions[r-1],yield e.quasis[r];return}let t=y1e[e.type];for(let r of t){let n=e[r];n&&(Array.isArray(n)?yield*n:yield n)}}});var fz=G(H_=>{"use strict";Object.defineProperty(H_,"__esModule",{value:!0});H_.default=void 0;var b1e=y4(),Po=wo(),v1e=Wk(),x1e=Rt(),S1e=uz(),T1e=z_(),{isExpression:w1e,isFunction:E1e,isStatement:P1e,isClassBody:I1e,isTSInterfaceBody:A1e,isTSEnumMember:k1e}=x1e,C1e=/e/i,N1e=/\.0+$/,pz=/[\n\r\u2028\u2029]/,O1e=/[\n\r\u2028\u2029]|\*\//;function dz(e){return e.type==="CommentLine"||pz.test(e.value)}var Gk=class{constructor(t,r,n=null,s=null){this.tokenContext=Po.TokenContext.normal,this._tokens=null,this._originalCode=null,this._currentNode=null,this._currentTypeId=null,this._indent=0,this._indentRepeat=0,this._insideAux=!1,this._noLineTerminator=!1,this._noLineTerminatorAfterNode=null,this._printAuxAfterOnNextUserNode=!1,this._printedComments=new Set,this._lastCommentLine=0,this._innerCommentsState=0,this._flags=0,this.tokenMap=null,this._boundGetRawIdentifier=null,this._printSemicolonBeforeNextNode=-1,this._printSemicolonBeforeNextToken=-1,this.format=t,this._tokens=n,this._originalCode=s,this._indentRepeat=t.indent.style.length,this._inputMap=r?._inputMap||null,this._buf=new b1e.default(r,t.indent.style[0]);let{preserveFormat:a,compact:o,concise:c,retainLines:l,retainFunctionParens:u}=t;a&&(this._flags|=1),o&&(this._flags|=2),c&&(this._flags|=4),l&&(this._flags|=8),u&&(this._flags|=16),(t.auxiliaryCommentBefore||t.auxiliaryCommentAfter)&&(this._flags|=32)}enterDelimited(){let t=this._noLineTerminatorAfterNode;return t!==null&&(this._noLineTerminatorAfterNode=null),t}generate(t){return this.format.preserveFormat&&(this.tokenMap=new S1e.TokenMap(t,this._tokens,this._originalCode),this._boundGetRawIdentifier=T1e._getRawIdentifier.bind(this)),this.print(t),this._maybeAddAuxComment(),this._buf.get()}indent(t=this._flags){t&7||(this._indent+=this._indentRepeat)}dedent(t=this._flags){t&7||(this._indent-=this._indentRepeat)}semicolon(t=!1){let r=this._flags;if(r&32&&this._maybeAddAuxComment(),r&1){let n=this._currentNode;if(n.start!=null&&n.end!=null){if(!this.tokenMap.endMatches(n,";")){this._printSemicolonBeforeNextNode=this._buf.getCurrentLine();return}let s=this.tokenMap.getIndexes(this._currentNode);this._catchUpTo(this._tokens[s[s.length-1]].loc.start)}}t?this._appendChar(59):this._queue(59),this._noLineTerminator=!1}rightBrace(t){this.format.minified&&this._buf.removeLastSemicolon(),this.sourceWithOffset("end",t.loc,-1),this.tokenChar(125)}rightParens(t){this.sourceWithOffset("end",t.loc,-1),this.tokenChar(41)}space(t=!1){if(!(this._flags&3))if(t)this._space();else{let r=this.getLastChar(!0);r!==0&&r!==32&&r!==10&&this._space()}}word(t,r=!1){this.tokenContext&=Po.TokenContext.forInOrInitHeadAccumulatePassThroughMask,this._maybePrintInnerComments(t);let n=this._flags;n&32&&this._maybeAddAuxComment(),n&1&&this._catchUpToCurrentToken(t);let s=this.getLastChar();(s===-2||s===-3||s===47&&t.charCodeAt(0)===47)&&this._space(),this._append(t,!1),this.setLastChar(-3),this._noLineTerminator=r}number(t,r){function n(s){if(s.length>2&&s.charCodeAt(0)===48){let a=s.charCodeAt(1);return a===98||a===111||a===120}return!1}this.word(t),Number.isInteger(r)&&!n(t)&&!C1e.test(t)&&!N1e.test(t)&&t.charCodeAt(t.length-1)!==46&&this.setLastChar(-2)}token(t,r=!1,n=0,s=!1){this.tokenContext&=Po.TokenContext.forInOrInitHeadAccumulatePassThroughMask,this._maybePrintInnerComments(t,n);let a=this._flags;if(a&32&&this._maybeAddAuxComment(),a&1&&this._catchUpToCurrentToken(t,n),s){let o=t.charCodeAt(0);((o===45&&t==="--"||o===61)&&this.getLastChar()===33||o===43&&this.getLastChar()===43||o===45&&this.getLastChar()===45||o===46&&this.getLastChar()===-2)&&this._space()}this._append(t,r),this._noLineTerminator=!1}tokenChar(t,r=0){this.tokenContext&=Po.TokenContext.forInOrInitHeadAccumulatePassThroughMask,this._maybePrintInnerComments(t,r);let n=this._flags;n&32&&this._maybeAddAuxComment(),n&1&&this._catchUpToCurrentToken(t,r),(t===43&&this.getLastChar()===43||t===45&&this.getLastChar()===45||t===46&&this.getLastChar()===-2)&&this._space(),this._appendChar(t),this._noLineTerminator=!1}newline(t=1,r=this._flags){if(!(t<=0)&&!(r&10)){if(r&4){this.space();return}t>2&&(t=2),t-=this._buf.getNewlineCount();for(let n=0;n<t;n++)this._newline()}}endsWith(t){return this.getLastChar(!0)===t}getLastChar(t){return this._buf.getLastChar(t)}setLastChar(t){this._buf._last=t}exactSource(t,r){if(!t){r();return}this._catchUp("start",t),this._buf.exactSource(t,r)}source(t,r){r&&(this._catchUp(t,r),this._buf.source(t,r))}sourceWithOffset(t,r,n){!r||this.format.preserveFormat||(this._catchUp(t,r),this._buf.sourceWithOffset(t,r,n))}sourceIdentifierName(t,r){if(!this._buf._canMarkIdName)return;let n=this._buf._sourcePosition;n.identifierNamePos=r,n.identifierName=t}_space(){this._queue(32)}_newline(){this._buf._queuedChar===32&&(this._buf._queuedChar=0),this._appendChar(10,!0)}_catchUpToCurrentToken(t,r=0){let n=this.tokenMap.findMatching(this._currentNode,t,r);n&&this._catchUpTo(n.loc.start),this._printSemicolonBeforeNextToken!==-1&&this._printSemicolonBeforeNextToken===this._buf.getCurrentLine()&&this._appendChar(59,!0),this._printSemicolonBeforeNextToken=-1,this._printSemicolonBeforeNextNode=-1}_append(t,r){this._maybeIndent(),this._buf.append(t,r)}_appendChar(t,r){r||this._maybeIndent(),this._buf.appendChar(t)}_queue(t){this._buf.queue(t),this.setLastChar(-1)}_maybeIndent(){let t=this._shouldIndent();t>0&&this._buf._appendChar(-1,t,!1)}_shouldIndent(){return this.endsWith(10)?this._indent:0}catchUp(t){if(!this.format.retainLines)return;let r=t-this._buf.getCurrentLine();for(let n=0;n<r;n++)this._newline()}_catchUp(t,r){let n=this._flags;if(!(n&1)){n&8&&r!=null&&r[t]&&this.catchUp(r[t].line);return}let s=r?.[t];s!=null&&this._catchUpTo(s)}_catchUpTo({line:t,column:r,index:n}){let s=t-this._buf.getCurrentLine();if(s>0&&this._noLineTerminator)return;for(let o=0;o<s;o++)this._newline();let a=s>0?r:r-this._buf.getCurrentColumn();if(a>0){let o=this._originalCode?this._originalCode.slice(n-a,n).replace(/[^\t\x0B\f \xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF]/gu," "):" ".repeat(a);this._append(o,!1),this.setLastChar(32)}}printTerminatorless(t){this._noLineTerminator=!0,this.print(t)}print(t,r=!1,n=!1,s){var a,o;if(!t)return;this._innerCommentsState=0;let{type:c,loc:l,extra:u}=t,d=this._flags,p=!1;t._compact&&(this._flags|=4,p=!0);let f=v1e.generatorInfosMap.get(c);if(f===void 0)throw new ReferenceError(`unknown node of type ${JSON.stringify(c)} with constructor ${JSON.stringify(t.constructor.name)}`);let[h,m,g]=f,y=this._currentNode,_=this._currentTypeId;this._currentNode=t,this._currentTypeId=m,d&1&&(this._printSemicolonBeforeNextToken=this._printSemicolonBeforeNextNode);let v;d&32&&(v=this._insideAux,this._insideAux=l==null,this._maybeAddAuxComment(this._insideAux&&!v));let S=0;n&&(S=this.tokenContext,S&Po.TokenContext.forInOrInitHeadAccumulate?this.tokenContext=0:S=0);let w=u!=null&&u.parenthesized,E=w&&d&1||w&&d&16&&m===71||y&&((0,Po.parentNeedsParens)(t,y,_)||g!=null&&g(t,y,_,this.tokenContext,d&1?this._boundGetRawIdentifier:void 0));if(!E&&w&&(a=t.leadingComments)!=null&&a.length&&t.leadingComments[0].type==="CommentBlock")switch(_){case 65:case 243:case 6:case 143:break;case 17:case 130:case 112:if(y.callee!==t)break;default:E=!0}let k=!1;!E&&this._noLineTerminator&&((o=t.leadingComments)!=null&&o.some(dz)||d&8&&l&&l.start.line>this._buf.getCurrentLine())&&(E=!0,k=!0);let N;if(!E&&(r||(r=!!y&&this._noLineTerminatorAfterNode===y&&(0,Po.isLastChild)(y,t)),r)){var O;(O=t.trailingComments)!=null&&O.some(dz)?w1e(t)&&(E=!0):(N=this._noLineTerminatorAfterNode,this._noLineTerminatorAfterNode=t)}E&&(this.tokenChar(40),k&&this.indent(),this._innerCommentsState=0,n||(S=this.tokenContext),S&Po.TokenContext.forInOrInitHeadAccumulate&&(this.tokenContext=0),N=this._noLineTerminatorAfterNode,this._noLineTerminatorAfterNode=null),this._printLeadingComments(t,y),this.exactSource(m===139||m===66?null:l,h.bind(this,t,y)),E?(this._printTrailingComments(t,y),k&&(this.dedent(),this.newline()),this.tokenChar(41),this._noLineTerminator=r):r&&!this._noLineTerminator?(this._noLineTerminator=!0,this._printTrailingComments(t,y)):this._printTrailingComments(t,y,s),S&&(this.tokenContext=S),this._currentNode=y,this._currentTypeId=_,p&&(this._flags=d),d&32&&(this._insideAux=v),N!=null&&(this._noLineTerminatorAfterNode=N),this._innerCommentsState=0}_maybeAddAuxComment(t){t&&this._printAuxBeforeComment(),this._insideAux||this._printAuxAfterComment()}_printAuxBeforeComment(){if(this._printAuxAfterOnNextUserNode)return;this._printAuxAfterOnNextUserNode=!0;let t=this.format.auxiliaryCommentBefore;t&&this._printComment({type:"CommentBlock",value:t},0)}_printAuxAfterComment(){if(!this._printAuxAfterOnNextUserNode)return;this._printAuxAfterOnNextUserNode=!1;let t=this.format.auxiliaryCommentAfter;t&&this._printComment({type:"CommentBlock",value:t},0)}getPossibleRaw(t){let r=t.extra;if(r?.raw!=null&&r.rawValue!=null&&t.value===r.rawValue)return r.raw}printJoin(t,r,n,s,a,o,c){if(!(t!=null&&t.length))return;let l=this._flags;if(n==null&&l&8){var u;let f=(u=t[0].loc)==null?void 0:u.start.line;f!=null&&f!==this._buf.getCurrentLine()&&(n=!0)}n&&this.indent(l);let d=t.length;for(let f=0;f<d;f++){let h=t[f];if(h&&(r&&f===0&&this._buf.hasContent()&&this.newline(1,l),this.print(h,!1,o,c||0),s!=null&&(f<d-1?s.call(this,f,!1):a&&s.call(this,f,!0)),r))if(f+1===d)this.newline(1,l);else{let m=this._lastCommentLine;if(m>0){var p;let g=(((p=t[f+1].loc)==null?void 0:p.start.line)||0)-m;if(g>=0){this.newline(g||1,l);continue}}this.newline(1,l)}}n&&this.dedent(l)}printAndIndentOnComments(t){let r=t.leadingComments&&t.leadingComments.length>0;r&&this.indent(),this.print(t),r&&this.dedent()}printBlock(t){t.type!=="EmptyStatement"&&this.space(),this.print(t)}_printTrailingComments(t,r,n){let{innerComments:s,trailingComments:a}=t;s!=null&&s.length&&this._printComments(2,s,t,r,n),a!=null&&a.length?this._printComments(2,a,t,r,n):this._lastCommentLine=0}_printLeadingComments(t,r){let n=t.leadingComments;n!=null&&n.length&&this._printComments(0,n,t,r)}_maybePrintInnerComments(t,r){var n;let s=this._innerCommentsState;switch(s&3){case 0:this._innerCommentsState=5;return;case 1:this.printInnerComments((s&4)>0,(n=this.tokenMap)==null?void 0:n.findMatching(this._currentNode,t,r))}}printInnerComments(t=!0,r){let n=this._currentNode,s=n.innerComments;if(!(s!=null&&s.length)){this._innerCommentsState=2;return}let a=this.endsWith(32);switch(t&&this.indent(),this._printComments(1,s,n,void 0,void 0,r)){case 2:this._innerCommentsState=2;case 1:a&&this.space()}t&&this.dedent()}noIndentInnerCommentsHere(){this._innerCommentsState&=-5}printSequence(t,r,n,s){this.printJoin(t,!0,r??!1,void 0,void 0,n,s)}printList(t,r,n,s,a,o){this.printJoin(t,n,s,a??$1e,r,o)}shouldPrintTrailingComma(t){if(!this.tokenMap)return null;let r=this.tokenMap.findLastIndex(this._currentNode,n=>this.tokenMap.matchesOriginal(n,typeof t=="number"?String.fromCharCode(t):t));return r<=0?null:this.tokenMap.matchesOriginal(this._tokens[r-1],",")}_shouldPrintComment(t,r){if(t.ignore||this._printedComments.has(t))return 0;if(this._noLineTerminator&&O1e.test(t.value))return 2;if(r&&this.tokenMap){let n=this.tokenMap.find(this._currentNode,s=>s.value===t.value);if(n&&n.start>r.start)return 2}return this._printedComments.add(t),this.format.shouldPrintComment(t.value)?1:0}_printComment(t,r){let n=this._noLineTerminator,s=t.type==="CommentBlock",a=s&&r!==1&&!n;switch(a&&this._buf.hasContent()&&r!==2&&this.newline(1),this.getLastChar(!0)){case 47:this._space();case 91:case 123:case 40:break;default:this.space()}let o;if(s){if(o=`/*${t.value}*/`,this.format.indent.adjustMultilineComment){var c;let l=(c=t.loc)==null?void 0:c.start.column;if(l){let u=new RegExp("\\n\\s{1,"+l+"}","g");o=o.replace(u,`
|
|
@@ -62,7 +62,7 @@ ${t}`,n}}}});var LU=G(hi=>{"use strict";Object.defineProperty(hi,"__esModule",{v
|
|
|
62
62
|
return ${jc(n)};
|
|
63
63
|
})(${UU(this.node)})
|
|
64
64
|
`;return this.replaceWith(u)[0].get("arguments.0")}function vRe(e){let t=e.params.findIndex(r=>Y$e(r)||X$e(r));return t===-1?e.params.length:t}});var YU=G(Kr=>{"use strict";Object.defineProperty(Kr,"__esModule",{value:!0});Kr._guessExecutionStatusRelativeTo=zRe;Kr._resolve=JU;Kr.canHaveVariableDeclarationOrExpression=$Re;Kr.canSwapBetweenExpressionAndStatement=RRe;Kr.getSource=FRe;Kr.isCompletionRecord=DRe;Kr.isConstantExpression=VRe;Kr.isInStrictMode=KRe;Kr.isNodeType=ORe;Kr.isStatementOrBlock=MRe;Kr.isStatic=NRe;Kr.matchesPattern=CRe;Kr.referencesImport=LRe;Kr.resolve=WRe;Kr.willIMaybeExecuteBefore=jRe;var xRe=Rt(),{STATEMENT_OR_BLOCK_KEYS:SRe,VISITOR_KEYS:TRe,isBlockStatement:HU,isExpression:wRe,isIdentifier:ERe,isLiteral:PRe,isStringLiteral:IRe,isType:ARe,matchesPattern:kRe}=xRe;function CRe(e,t){return kRe(this.node,e,t)}Kr.has=function(t){var r;let n=(r=this.node)==null?void 0:r[t];return n&&Array.isArray(n)?!!n.length:!!n};function NRe(){return this.scope.isStatic(this.node)}Kr.is=Kr.has;Kr.isnt=function(t){return!this.has(t)};Kr.equals=function(t,r){return this.node[t]===r};function ORe(e){return ARe(this.type,e)}function $Re(){return(this.key==="init"||this.key==="left")&&this.parentPath.isFor()}function RRe(e){return this.key!=="body"||!this.parentPath.isArrowFunctionExpression()?!1:this.isExpression()?HU(e):this.isBlockStatement()?wRe(e):!1}function DRe(e){let t=this,r=!0;do{let{type:n,container:s}=t;if(!r&&(t.isFunction()||n==="StaticBlock"))return!!e;if(r=!1,Array.isArray(s)&&t.key!==s.length-1)return!1}while((t=t.parentPath)&&!t.isProgram()&&!t.isDoExpression());return!0}function MRe(){return this.parentPath.isLabeledStatement()||HU(this.container)?!1:SRe.includes(this.key)}function LRe(e,t){if(!this.isReferencedIdentifier()){if(this.isJSXMemberExpression()&&this.node.property.name===t||(this.isMemberExpression()||this.isOptionalMemberExpression())&&(this.node.computed?IRe(this.node.property,{value:t}):this.node.property.name===t)){let a=this.get("object");return a.isReferencedIdentifier()&&a.referencesImport(e,"*")}return!1}let r=this.scope.getBinding(this.node.name);if(r?.kind!=="module")return!1;let n=r.path,s=n.parentPath;if(!s.isImportDeclaration())return!1;if(s.node.source.value===e){if(!t)return!0}else return!1;return!!(n.isImportDefaultSpecifier()&&t==="default"||n.isImportNamespaceSpecifier()&&t==="*"||n.isImportSpecifier()&&ERe(n.node.imported,{name:t}))}function FRe(){let e=this.node;if(e.end){let t=this.hub.getCode();if(t)return t.slice(e.start,e.end)}return""}function jRe(e){return this._guessExecutionStatusRelativeTo(e)!=="after"}function KU(e){return e.isProgram()?e:(e.parentPath.scope.getFunctionParent()||e.parentPath.scope.getProgramParent()).path}function BRe(e,t){switch(e){case"LogicalExpression":return t==="right";case"ConditionalExpression":case"IfStatement":return t==="consequent"||t==="alternate";case"WhileStatement":case"DoWhileStatement":case"ForInStatement":case"ForOfStatement":return t==="body";case"ForStatement":return t==="body"||t==="update";case"SwitchStatement":return t==="cases";case"TryStatement":return t==="handler";case"AssignmentPattern":return t==="right";case"OptionalMemberExpression":return t==="property";case"OptionalCallExpression":return t==="arguments";default:return!1}}function GU(e,t){for(let r=0;r<t;r++){let n=e[r];if(BRe(n.parent.type,n.parentKey))return!0}return!1}var ZU=Symbol();function zRe(e){return O1(this,e,new Map)}function O1(e,t,r){let n={this:KU(e),target:KU(t)};if(n.target.node!==n.this.node)return qRe(e,n.target,r);let s={target:t.getAncestry(),this:e.getAncestry()};if(s.target.includes(e))return"after";if(s.this.includes(t))return"before";let a,o={target:0,this:0};for(;!a&&o.this<s.this.length;){let d=s.this[o.this];o.target=s.target.indexOf(d),o.target>=0?a=d:o.this++}if(!a)throw new Error("Internal Babel error - The two compared nodes don't appear to belong to the same program.");if(GU(s.this,o.this-1)||GU(s.target,o.target-1))return"unknown";let c={this:s.this[o.this-1],target:s.target[o.target-1]};if(c.target.listKey&&c.this.listKey&&c.target.container===c.this.container)return c.target.key>c.this.key?"before":"after";let l=TRe[a.type],u={this:l.indexOf(c.this.parentKey),target:l.indexOf(c.target.parentKey)};return u.target>u.this?"before":"after"}function URe(e,t,r){if(t.isFunctionDeclaration()){if(t.parentPath.isExportDeclaration())return"unknown"}else return O1(e,t,r)==="before"?"before":"unknown";let n=t.scope.getBinding(t.node.id.name);if(!n.references)return"before";let s=n.referencePaths,a;for(let o of s){if(!!o.find(u=>u.node===t.node))continue;if(o.key!=="callee"||!o.parentPath.isCallExpression())return"unknown";let l=O1(e,o,r);if(a&&a!==l)return"unknown";a=l}return a}function qRe(e,t,r){let n=r.get(e.node),s;if(!n)r.set(e.node,n=new Map);else if(s=n.get(t.node))return s===ZU?"unknown":s;n.set(t.node,ZU);let a=URe(e,t,r);return n.set(t.node,a),a}function WRe(e,t){return JU.call(this,e,t)||this}function JU(e,t){var r;if(!((r=t)!=null&&r.includes(this)))if(t=t||[],t.push(this),this.isVariableDeclarator()){if(this.get("id").isIdentifier())return this.get("init").resolve(e,t)}else if(this.isReferencedIdentifier()){let n=this.scope.getBinding(this.node.name);if(!n||!n.constant||n.kind==="module")return;if(n.path!==this){let s=n.path.resolve(e,t);return this.find(a=>a.node===s.node)?void 0:s}}else{if(this.isTypeCastExpression())return this.get("expression").resolve(e,t);if(e&&this.isMemberExpression()){let n=this.toComputedKey();if(!PRe(n))return;let s=n.value,a=this.get("object").resolve(e,t);if(a.isObjectExpression()){let o=a.get("properties");for(let c of o){if(!c.isProperty())continue;let l=c.get("key"),u=c.isnt("computed")&&l.isIdentifier({name:s});if(u=u||l.isLiteral({value:s}),u)return c.get("value").resolve(e,t)}}else if(a.isArrayExpression()&&!isNaN(+s)){let c=a.get("elements")[s];if(c)return c.resolve(e,t)}}}}function VRe(){if(this.isIdentifier()){let e=this.scope.getBinding(this.node.name);return e?e.constant:!1}if(this.isLiteral())return this.isRegExpLiteral()?!1:this.isTemplateLiteral()?this.get("expressions").every(e=>e.isConstantExpression()):!0;if(this.isUnaryExpression())return this.node.operator!=="void"?!1:this.get("argument").isConstantExpression();if(this.isBinaryExpression()){let{operator:e}=this.node;return e!=="in"&&e!=="instanceof"&&this.get("left").isConstantExpression()&&this.get("right").isConstantExpression()}return this.isMemberExpression()?!this.node.computed&&this.get("object").isIdentifier({name:"Symbol"})&&!this.scope.hasBinding("Symbol",{noGlobals:!0}):this.isCallExpression()?this.node.arguments.length===1&&this.get("callee").matchesPattern("Symbol.for")&&!this.scope.hasBinding("Symbol",{noGlobals:!0})&&this.get("arguments")[0].isStringLiteral():!1}function KRe(){return!!(this.isProgram()?this:this.parentPath).find(r=>{if(r.isProgram({sourceType:"module"})||r.isClass())return!0;if(r.isArrowFunctionExpression()&&!r.get("body").isBlockStatement())return!1;let n;if(r.isFunction())n=r.node.body;else if(r.isProgram())n=r.node;else return!1;for(let s of n.directives)if(s.value.value==="use strict")return!0;return!1})}});var r3=G(In=>{"use strict";Object.defineProperty(In,"__esModule",{value:!0});In._getKey=e3;In._getPattern=t3;In.get=lDe;In.getAllNextSiblings=oDe;In.getAllPrevSiblings=cDe;In.getAssignmentIdentifiers=uDe;In.getBindingIdentifierPaths=fDe;In.getBindingIdentifiers=dDe;In.getCompletionRecords=nDe;In.getNextSibling=aDe;In.getOpposite=eDe;In.getOuterBindingIdentifierPaths=hDe;In.getOuterBindingIdentifiers=pDe;In.getPrevSibling=sDe;In.getSibling=iDe;var R1=Ea(),GRe=Rt(),{getAssignmentIdentifiers:ZRe,getBindingIdentifiers:QU,getOuterBindingIdentifiers:HRe,numericLiteral:JRe,unaryExpression:YRe}=GRe,D1=0,nh=1;function XRe(e){return{type:D1,path:e}}function QRe(e){return{type:nh,path:e}}function eDe(){return this.key==="left"?this.getSibling("right"):this.key==="right"?this.getSibling("left"):null}function Lu(e,t,r){return e&&t.push(...Fu(e,r)),t}function tDe(e,t,r){let n=[];for(let s=0;s<e.length;s++){let a=e[s],o=Fu(a,r),c=[],l=[];for(let u of o)u.type===D1&&c.push(u),u.type===nh&&l.push(u);c.length&&(n=c),t.push(...l)}return t.push(...n),t}function rDe(e){e.forEach(t=>{t.type=nh})}function $1(e,t){e.forEach(r=>{r.path.isBreakStatement({label:null})&&(t?r.path.replaceWith(YRe("void",JRe(0))):r.path.remove())})}function XU(e,t){let r=[];if(t.canHaveBreak){let n=[];for(let s=0;s<e.length;s++){let a=e[s],o=Object.assign({},t,{inCaseClause:!1});a.isBlockStatement()&&(t.inCaseClause||t.shouldPopulateBreak)?o.shouldPopulateBreak=!0:o.shouldPopulateBreak=!1;let c=Fu(a,o);if(c.length>0&&c.every(l=>l.type===nh)){n.length>0&&c.every(l=>l.path.isBreakStatement({label:null}))?(rDe(n),r.push(...n),n.some(l=>l.path.isDeclaration())&&(r.push(...c),t.shouldPreserveBreak||$1(c,!0)),t.shouldPreserveBreak||$1(c,!1)):(r.push(...c),!t.shouldPopulateBreak&&!t.shouldPreserveBreak&&$1(c,!0));break}if(s===e.length-1)r.push(...c);else{n=[];for(let l=0;l<c.length;l++){let u=c[l];u.type===nh&&r.push(u),u.type===D1&&n.push(u)}}}}else if(e.length)for(let n=e.length-1;n>=0;n--){let s=Fu(e[n],t);if(s.length>1||s.length===1&&!s[0].path.isVariableDeclaration()&&!s[0].path.isEmptyStatement()){r.push(...s);break}}return r}function Fu(e,t){let r=[];if(e.isIfStatement())r=Lu(e.get("consequent"),r,t),r=Lu(e.get("alternate"),r,t);else{if(e.isDoExpression()||e.isFor()||e.isWhile()||e.isLabeledStatement())return Lu(e.get("body"),r,t);if(e.isProgram()||e.isBlockStatement())return XU(e.get("body"),t);if(e.isFunction())return Fu(e.get("body"),t);if(e.isTryStatement())r=Lu(e.get("block"),r,t),r=Lu(e.get("handler"),r,t);else{if(e.isCatchClause())return Lu(e.get("body"),r,t);if(e.isSwitchStatement())return tDe(e.get("cases"),r,t);if(e.isSwitchCase())return XU(e.get("consequent"),{canHaveBreak:!0,shouldPopulateBreak:!1,inCaseClause:!0,shouldPreserveBreak:t.shouldPreserveBreak});e.isBreakStatement()?r.push(QRe(e)):r.push(XRe(e))}}return r}function nDe(e=!1){return Fu(this,{canHaveBreak:!1,shouldPopulateBreak:!1,inCaseClause:!1,shouldPreserveBreak:e}).map(r=>r.path)}function iDe(e){return R1.default.get({parentPath:this.parentPath,parent:this.parent,container:this.container,listKey:this.listKey,key:e}).setContext(this.context)}function sDe(){return this.getSibling(this.key-1)}function aDe(){return this.getSibling(this.key+1)}function oDe(){let e=this.key,t=this.getSibling(++e),r=[];for(;t.node;)r.push(t),t=this.getSibling(++e);return r}function cDe(){let e=this.key,t=this.getSibling(--e),r=[];for(;t.node;)r.push(t),t=this.getSibling(--e);return r}function lDe(e,t=!0){t===!0&&(t=this.context);let r=e.split(".");return r.length===1?e3.call(this,e,t):t3.call(this,r,t)}function e3(e,t){let r=this.node,n=r[e];return Array.isArray(n)?n.map((s,a)=>R1.default.get({listKey:e,parentPath:this,parent:r,container:n,key:a}).setContext(t)):R1.default.get({parentPath:this,parent:r,container:r,key:e}).setContext(t)}function t3(e,t){let r=this;for(let n of e)n==="."?r=r.parentPath:Array.isArray(r)?r=r[n]:r=r.get(n,t);return r}function uDe(){return ZRe(this.node)}function dDe(e){return QU(this.node,e)}function pDe(e){return HRe(this.node,e)}function fDe(e=!1,t=!1){let n=[this],s=Object.create(null);for(;n.length;){let a=n.shift();if(!a||!a.node)continue;let o=QU.keys[a.node.type];if(a.isIdentifier()){e?(s[a.node.name]=s[a.node.name]||[]).push(a):s[a.node.name]=a;continue}if(a.isExportDeclaration()){let c=a.get("declaration");c.isDeclaration()&&n.push(c);continue}if(t){if(a.isFunctionDeclaration()){n.push(a.get("id"));continue}if(a.isFunctionExpression())continue}if(o)for(let c=0;c<o.length;c++){let l=o[c],u=a.get(l);Array.isArray(u)?n.push(...u):u.node&&n.push(u)}}return s}function hDe(e=!1){return this.getBindingIdentifierPaths(e,!0)}});var i3=G(ih=>{"use strict";Object.defineProperty(ih,"__esModule",{value:!0});ih.addComment=bDe;ih.addComments=vDe;ih.shareCommentsWithSiblings=_De;var mDe=Rt(),{addComment:gDe,addComments:yDe}=mDe;function _De(){if(typeof this.key=="string")return;let e=this.node;if(!e)return;let t=e.trailingComments,r=e.leadingComments;if(!t&&!r)return;let n=this.getSibling(this.key-1),s=this.getSibling(this.key+1),a=!!n.node,o=!!s.node;a&&(r&&n.addComments("trailing",n3(r,n.node.trailingComments)),t&&!o&&n.addComments("trailing",t)),o&&(t&&s.addComments("leading",n3(t,s.node.leadingComments)),r&&!a&&s.addComments("leading",r))}function n3(e,t){if(!(t!=null&&t.length))return e;let r=new Set(t);return e.filter(n=>!r.has(n))}function bDe(e,t,r){gDe(this.node,e,t,r)}function vDe(e,t){yDe(this.node,e,t)}});var Ea=G(Xs=>{"use strict";Object.defineProperty(Xs,"__esModule",{value:!0});Xs.default=Xs.SHOULD_STOP=Xs.SHOULD_SKIP=Xs.REMOVED=void 0;var xDe=qP(),SDe=k2(),TDe=Ta(),wDe=ok(),o3=Rt(),pb=o3,EDe=Nc(),PDe=_z(),Js=bz(),ju=jz(),Bu=s1(),s3=wU(),Bc=VU(),Xr=YU(),c3=Ki(),Gr=c3,zu=nb(),Ys=ib(),ri=r3(),M1=i3(),IDe=ek(),{validate:ADe}=o3,a3=SDe("babel"),Gat=Xs.REMOVED=1,Zat=Xs.SHOULD_STOP=2,Hat=Xs.SHOULD_SKIP=4,Ia=Xs.default=class l3{constructor(t,r){this.contexts=[],this.state=null,this._traverseFlags=0,this.skipKeys=null,this.parentPath=null,this.container=null,this.listKey=null,this.key=null,this.node=null,this.type=null,this._store=null,this.parent=r,this.hub=t,this.data=null,this.context=null,this.scope=null}get removed(){return(this._traverseFlags&1)>0}set removed(t){t?this._traverseFlags|=1:this._traverseFlags&=-2}get shouldStop(){return(this._traverseFlags&2)>0}set shouldStop(t){t?this._traverseFlags|=2:this._traverseFlags&=-3}get shouldSkip(){return(this._traverseFlags&4)>0}set shouldSkip(t){t?this._traverseFlags|=4:this._traverseFlags&=-5}static get({hub:t,parentPath:r,parent:n,container:s,listKey:a,key:o}){if(!t&&r&&(t=r.hub),!n)throw new Error("To get a node path the parent needs to exist");let c=s[o],l=EDe.getOrCreateCachedPaths(n,r),u=l.get(c);return u||(u=new l3(t,n),c&&l.set(c,u)),c3.setup.call(u,r,s,a,o),u}getScope(t){return this.isScope()?new wDe.default(this):t}setData(t,r){return this.data==null&&(this.data=Object.create(null)),this.data[t]=r}getData(t,r){this.data==null&&(this.data=Object.create(null));let n=this.data[t];return n===void 0&&r!==void 0&&(n=this.data[t]=r),n}hasNode(){return this.node!=null}buildCodeFrameError(t,r=SyntaxError){return this.hub.buildError(this.node,t,r)}traverse(t,r){(0,TDe.default)(this.node,t,this.scope,r,this)}set(t,r){ADe(this.node,t,r),this.node[t]=r}getPathLocation(){let t=[],r=this;do{let n=r.key;r.inList&&(n=`${r.listKey}[${n}]`),t.unshift(n)}while(r=r.parentPath);return t.join(".")}debug(t){a3.enabled&&a3(`${this.getPathLocation()} ${this.type}: ${t}`)}toString(){return(0,PDe.default)(this.node).code}get inList(){return!!this.listKey}set inList(t){t||(this.listKey=null)}get parentKey(){return this.listKey||this.key}},kDe={findParent:Js.findParent,find:Js.find,getFunctionParent:Js.getFunctionParent,getStatementParent:Js.getStatementParent,getEarliestCommonAncestorFrom:Js.getEarliestCommonAncestorFrom,getDeepestCommonAncestorFrom:Js.getDeepestCommonAncestorFrom,getAncestry:Js.getAncestry,isAncestor:Js.isAncestor,isDescendant:Js.isDescendant,inType:Js.inType,getTypeAnnotation:ju.getTypeAnnotation,isBaseType:ju.isBaseType,couldBeBaseType:ju.couldBeBaseType,baseTypeStrictlyMatches:ju.baseTypeStrictlyMatches,isGenericType:ju.isGenericType,replaceWithMultiple:Bu.replaceWithMultiple,replaceWithSourceString:Bu.replaceWithSourceString,replaceWith:Bu.replaceWith,replaceExpressionWithStatements:Bu.replaceExpressionWithStatements,replaceInline:Bu.replaceInline,evaluateTruthy:s3.evaluateTruthy,evaluate:s3.evaluate,toComputedKey:Bc.toComputedKey,ensureBlock:Bc.ensureBlock,unwrapFunctionEnvironment:Bc.unwrapFunctionEnvironment,arrowFunctionToExpression:Bc.arrowFunctionToExpression,splitExportDeclaration:Bc.splitExportDeclaration,ensureFunctionName:Bc.ensureFunctionName,matchesPattern:Xr.matchesPattern,isStatic:Xr.isStatic,isNodeType:Xr.isNodeType,canHaveVariableDeclarationOrExpression:Xr.canHaveVariableDeclarationOrExpression,canSwapBetweenExpressionAndStatement:Xr.canSwapBetweenExpressionAndStatement,isCompletionRecord:Xr.isCompletionRecord,isStatementOrBlock:Xr.isStatementOrBlock,referencesImport:Xr.referencesImport,getSource:Xr.getSource,willIMaybeExecuteBefore:Xr.willIMaybeExecuteBefore,_guessExecutionStatusRelativeTo:Xr._guessExecutionStatusRelativeTo,resolve:Xr.resolve,isConstantExpression:Xr.isConstantExpression,isInStrictMode:Xr.isInStrictMode,isDenylisted:Gr.isDenylisted,visit:Gr.visit,skip:Gr.skip,skipKey:Gr.skipKey,stop:Gr.stop,setContext:Gr.setContext,requeue:Gr.requeue,requeueComputedKeyAndDecorators:Gr.requeueComputedKeyAndDecorators,remove:zu.remove,insertBefore:Ys.insertBefore,insertAfter:Ys.insertAfter,unshiftContainer:Ys.unshiftContainer,pushContainer:Ys.pushContainer,getOpposite:ri.getOpposite,getCompletionRecords:ri.getCompletionRecords,getSibling:ri.getSibling,getPrevSibling:ri.getPrevSibling,getNextSibling:ri.getNextSibling,getAllNextSiblings:ri.getAllNextSiblings,getAllPrevSiblings:ri.getAllPrevSiblings,get:ri.get,getAssignmentIdentifiers:ri.getAssignmentIdentifiers,getBindingIdentifiers:ri.getBindingIdentifiers,getOuterBindingIdentifiers:ri.getOuterBindingIdentifiers,getBindingIdentifierPaths:ri.getBindingIdentifierPaths,getOuterBindingIdentifierPaths:ri.getOuterBindingIdentifierPaths,shareCommentsWithSiblings:M1.shareCommentsWithSiblings,addComment:M1.addComment,addComments:M1.addComments};Object.assign(Ia.prototype,kDe);Ia.prototype.arrowFunctionToShadowed=Bc.arrowFunctionToShadowed;Object.assign(Ia.prototype,{has:Xr.has,is:Xr.is,isnt:Xr.isnt,equals:Xr.equals,hoist:Ys.hoist,updateSiblingKeys:Ys.updateSiblingKeys,call:Gr.call,isBlacklisted:Gr.isBlacklisted,setScope:Gr.setScope,resync:Gr.resync,popContext:Gr.popContext,pushContext:Gr.pushContext,setup:Gr.setup,setKey:Gr.setKey});Ia.prototype._guessExecutionStatusRelativeToDifferentFunctions=Xr._guessExecutionStatusRelativeTo;Ia.prototype._guessExecutionStatusRelativeToDifferentFunctions=Xr._guessExecutionStatusRelativeTo;Object.assign(Ia.prototype,{_getTypeAnnotation:ju._getTypeAnnotation,_replaceWith:Bu._replaceWith,_resolve:Xr._resolve,_call:Gr._call,_resyncParent:Gr._resyncParent,_resyncKey:Gr._resyncKey,_resyncList:Gr._resyncList,_resyncRemoved:Gr._resyncRemoved,_getQueueContexts:Gr._getQueueContexts,_removeFromScope:zu._removeFromScope,_callRemovalHooks:zu._callRemovalHooks,_remove:zu._remove,_markRemoved:zu._markRemoved,_assertUnremoved:zu._assertUnremoved,_containerInsert:Ys._containerInsert,_containerInsertBefore:Ys._containerInsertBefore,_containerInsertAfter:Ys._containerInsertAfter,_verifyNodeList:Ys._verifyNodeList,_getKey:ri._getKey,_getPattern:ri._getPattern});for(let e of pb.TYPES){let t=`is${e}`,r=pb[t];Ia.prototype[t]=function(n){return r(this.node,n)},Ia.prototype[`assert${e}`]=function(n){if(!r(this.node,n))throw new TypeError(`Expected node path of type ${e}`)}}Object.assign(Ia.prototype,IDe);for(let e of Object.keys(xDe))e.startsWith("_")||pb.TYPES.includes(e)||pb.TYPES.push(e)});var F1=G(fb=>{"use strict";Object.defineProperty(fb,"__esModule",{value:!0});fb.default=void 0;var L1=class{getCode(){}getScope(){}addHelper(){throw new Error("Helpers are not supported by the default hub.")}buildError(t,r,n=TypeError){return new n(r)}};fb.default=L1});var u3=G(hb=>{"use strict";Object.defineProperty(hb,"__esModule",{value:!0});hb.default=void 0;var CDe=Ea(),NDe=Rt(),j1=Ki(),ODe=F1(),{VISITOR_KEYS:$De}=NDe,B1=class{constructor(t,r,n,s){this.queue=null,this.priorityQueue=null,this.parentPath=s,this.scope=t,this.state=n,this.opts=r}shouldVisit(t){let r=this.opts;if(r.enter||r.exit||r[t.type])return!0;let n=$De[t.type];if(!(n!=null&&n.length))return!1;for(let s of n)if(t[s])return!0;return!1}create(t,r,n,s){let{parentPath:a}=this,o=a==null?t.type==="Program"||t.type==="File"?new ODe.default:void 0:a.hub;return CDe.default.get({parentPath:a,parent:t,container:r,key:n,listKey:s,hub:o})}maybeQueue(t,r){this.queue&&(r?this.queue.push(t):this.priorityQueue.push(t))}visitMultiple(t,r,n){if(t.length===0)return!1;let s=[];for(let a=0;a<t.length;a++){let o=t[a];o&&this.shouldVisit(o)&&s.push(this.create(r,t,a,n))}return this.visitQueue(s)}visitSingle(t,r){return this.shouldVisit(t[r])?this.visitQueue([this.create(t,t,r)]):!1}visitQueue(t){this.queue=t,this.priorityQueue=[];let r=new WeakSet,n=!1,s=0;for(;s<t.length;){let a=t[s];if(s++,j1.resync.call(a),(a.contexts.length===0||a.contexts[a.contexts.length-1]!==this)&&j1.pushContext.call(a,this),a.key===null)continue;let{node:o}=a;if(!r.has(o)){if(o&&r.add(o),a.visit()){n=!0;break}if(this.priorityQueue.length&&(n=this.visitQueue(this.priorityQueue),this.priorityQueue=[],this.queue=t,n))break}}for(let a=0;a<s;a++)j1.popContext.call(t[a]);return this.queue=null,n}visit(t,r){let n=t[r];return n?Array.isArray(n)?this.visitMultiple(n,t,r):this.visitSingle(t,r):!1}};hb.default=B1});var P_=G(z1=>{"use strict";Object.defineProperty(z1,"__esModule",{value:!0});z1.traverseNode=LDe;var RDe=u3(),Qat=Ea(),DDe=Rt(),eot=Ki(),{VISITOR_KEYS:MDe}=DDe;function LDe(e,t,r,n,s,a,o){let c=MDe[e.type];if(!c)return!1;let l=new RDe.default(r,t,n,s);if(o)return a!=null&&a[s.parentKey]?!1:l.visitQueue([s]);for(let u of c)if(!(a!=null&&a[u])&&l.visit(e,u))return!0;return!1}});var Ki=G($r=>{"use strict";Object.defineProperty($r,"__esModule",{value:!0});$r._call=q1;$r._forceSetScope=VDe;$r._getQueueContexts=eMe;$r._resyncKey=g3;$r._resyncList=y3;$r._resyncParent=m3;$r._resyncRemoved=ZDe;$r.call=U1;$r.isDenylisted=f3;$r.popContext=HDe;$r.pushContext=JDe;$r.requeue=XDe;$r.requeueComputedKeyAndDecorators=QDe;$r.resync=GDe;$r.setContext=KDe;$r.setKey=mb;$r.setScope=h3;$r.setup=YDe;$r.skip=UDe;$r.skipKey=qDe;$r.stop=WDe;$r.visit=zDe;var FDe=P_(),d3=Ea(),jDe=nb(),BDe=Rt();function U1(e){let t=this.opts;if(this.debug(e),this.node&&q1.call(this,t[e]))return!0;if(this.node){var r;return q1.call(this,(r=t[this.node.type])==null?void 0:r[e])}return!1}function q1(e){if(!e)return!1;for(let t of e){if(!t)continue;let r=this.node;if(!r)return!0;let n=t.call(this.state,this,this.state);if(n&&typeof n=="object"&&typeof n.then=="function")throw new Error("You appear to be using a plugin with an async traversal visitor, which your current version of Babel does not support. If you're using a published plugin, you may need to upgrade your @babel/core version.");if(n)throw new Error(`Unexpected return value from visitor method ${t}`);if(this.node!==r||this._traverseFlags>0)return!0}return!1}function f3(){var e;let t=(e=this.opts.denylist)!=null?e:this.opts.blacklist;return t?.includes(this.node.type)}$r.isBlacklisted=f3;function p3(e,t){e.context!==t&&(e.context=t,e.state=t.state,e.opts=t.opts)}function zDe(){var e,t;if(!this.node||this.isDenylisted()||(e=(t=this.opts).shouldSkip)!=null&&e.call(t,this))return!1;let r=this.context;return this.shouldSkip||U1.call(this,"enter")?(this.debug("Skip..."),this.shouldStop):(p3(this,r),this.debug("Recursing into..."),this.shouldStop=(0,FDe.traverseNode)(this.node,this.opts,this.scope,this.state,this,this.skipKeys),p3(this,r),U1.call(this,"exit"),this.shouldStop)}function UDe(){this.shouldSkip=!0}function qDe(e){this.skipKeys==null&&(this.skipKeys={}),this.skipKeys[e]=!0}function WDe(){this._traverseFlags|=d3.SHOULD_SKIP|d3.SHOULD_STOP}function VDe(){var e;let t=this.parentPath;((this.key==="key"||this.listKey==="decorators")&&t.isMethod()||this.key==="discriminant"&&t.isSwitchStatement())&&(t=t.parentPath);let r;for(;t&&!r;)r=t.scope,t=t.parentPath;this.scope=this.getScope(r),(e=this.scope)==null||e.init()}function h3(){var e,t;if((e=this.opts)!=null&&e.noScope)return;let r=this.parentPath;((this.key==="key"||this.listKey==="decorators")&&r.isMethod()||this.key==="discriminant"&&r.isSwitchStatement())&&(r=r.parentPath);let n;for(;r&&!n;){var s;if((s=r.opts)!=null&&s.noScope)return;n=r.scope,r=r.parentPath}this.scope=this.getScope(n),(t=this.scope)==null||t.init()}function KDe(e){return this.skipKeys!=null&&(this.skipKeys={}),this._traverseFlags=0,e&&(this.context=e,this.state=e.state,this.opts=e.opts),h3.call(this),this}function GDe(){this.removed||(m3.call(this),y3.call(this),g3.call(this))}function m3(){this.parentPath&&(this.parent=this.parentPath.node)}function g3(){if(this.container&&this.node!==this.container[this.key]){if(Array.isArray(this.container)){for(let e=0;e<this.container.length;e++)if(this.container[e]===this.node){mb.call(this,e);return}}else for(let e of Object.keys(this.container))if(this.container[e]===this.node){mb.call(this,e);return}this.key=null}}function y3(){if(!this.parent||!this.inList)return;let e=this.parent[this.listKey];this.container!==e&&(this.container=e||null)}function ZDe(){(this.key==null||!this.container||this.container[this.key]!==this.node)&&jDe._markRemoved.call(this)}function HDe(){this.contexts.pop(),this.contexts.length>0?this.setContext(this.contexts[this.contexts.length-1]):this.setContext(void 0)}function JDe(e){this.contexts.push(e),this.setContext(e)}function YDe(e,t,r,n){this.listKey=r,this.container=t,this.parentPath=e||this.parentPath,mb.call(this,n)}function mb(e){var t;this.key=e,this.node=this.container[this.key],this.type=(t=this.node)==null?void 0:t.type}function XDe(e=this){if(e.removed)return;let t=this.contexts;for(let r of t)r.maybeQueue(e)}function QDe(){let{context:e,node:t}=this;if(!BDe.isPrivate(t)&&t.computed&&e.maybeQueue(this.get("key")),t.decorators)for(let r of this.get("decorators"))e.maybeQueue(r)}function eMe(){let e=this,t=this.contexts;for(;!t.length&&(e=e.parentPath,!!e);)t=e.contexts;return t}});var Ta=G(Aa=>{"use strict";Object.defineProperty(Aa,"__esModule",{value:!0});Object.defineProperty(Aa,"Hub",{enumerable:!0,get:function(){return sMe.default}});Object.defineProperty(Aa,"NodePath",{enumerable:!0,get:function(){return nMe.default}});Object.defineProperty(Aa,"Scope",{enumerable:!0,get:function(){return iMe.default}});Aa.visitors=Aa.default=void 0;Ki();var ah=zf();Aa.visitors=ah;var tMe=Rt(),rMe=Nc(),_3=P_(),nMe=Ea(),iMe=ok(),sMe=F1(),{VISITOR_KEYS:aMe,removeProperties:oMe,traverseFast:sh}=tMe;function Ts(e,t={},r,n,s,a){if(e){if(!t.noScope&&!r&&e.type!=="Program"&&e.type!=="File")throw new Error(`You must pass a scope and parentPath unless traversing a Program/File. Instead of that you tried to traverse a ${e.type} node without passing scope and parentPath.`);if(!s&&a)throw new Error("visitSelf can only be used when providing a NodePath.");aMe[e.type]&&(ah.explode(t),(0,_3.traverseNode)(e,t,r,n,s,void 0,a))}}var not=Aa.default=Ts;Ts.visitors=ah;Ts.verify=ah.verify;Ts.explode=ah.explode;Ts.cheap=function(e,t){sh(e,t)};Ts.node=function(e,t,r,n,s,a){(0,_3.traverseNode)(e,t,r,n,s,a)};Ts.clearNode=function(e,t){oMe(e,t)};Ts.removeProperties=function(e,t){return sh(e,Ts.clearNode,t),e};Ts.hasType=function(e,t,r){return r!=null&&r.includes(e.type)?!1:e.type===t?!0:sh(e,function(n){if(r!=null&&r.includes(n.type))return sh.skip;if(n.type===t)return sh.stop})};Ts.cache=rMe});function ot(e,t){return!e||e.start==null||e.end==null?"":t.slice(e.start,e.end).trim()}function ct(e){return(e||"").replace(/\s+/g," ").trim()}function cMe(e){let t=e?.parentPath;for(;t;){if(t.node?.type==="ForStatement")return t.node;t=t.parentPath}return null}function lMe(e){let t=e?.init;if(t?.type!=="VariableDeclaration"||t.declarations?.length!==1)return null;let r=t.declarations[0];return r?.id?.type!=="Identifier"?null:r.id.name}function gb(e){return(e.params||[]).map(t=>t.type==="Identifier"?t.name:"arg").join(", ")}function Ai(e,t="file.js"){let r=yu(e,t),n=[],s=new Map,a=new Map,o=new Map,c=r.program.body||[];for(let p of c){let f=p;if((f.type==="ExportNamedDeclaration"&&f.declaration||f.type==="ExportDefaultDeclaration"&&(f.declaration?.type==="FunctionDeclaration"||f.declaration?.type==="ClassDeclaration"))&&(f=f.declaration),f.type==="ImportDeclaration"){let h=f.source?.value||"",m=(f.specifiers||[]).map(g=>{let y=g.local?.name,_=g.type==="ImportDefaultSpecifier"?"default":g.type==="ImportNamespaceSpecifier"?"*":g.imported?.name||"unknown";return y&&s.set(y,h),`${_} as ${y}`});n.push({kind:"import",name:h,key:`import:${h}`,signature:`import ${m.join(", ")} from "${h}"`,bodyText:ct(ot(f,e)),locText:ct(ot(f,e))});continue}if(f.type==="FunctionDeclaration"&&f.id?.name){let h=f.id.name,g=`${f.async?"async ":""}function ${h}(${gb(f)})`,y=ct(ot(f.body,e)),_={kind:"function",name:h,key:`function:${h}`,signature:g,bodyText:y,locText:ct(ot(f,e)),node:f,calls:new Set,usesVars:new Set,usesImports:new Set};o.set(h,_),n.push(_);continue}if(f.type==="ClassDeclaration"&&f.id?.name){let h=f.id.name;for(let m of f.body?.body??[]){if(m.type!=="ClassMethod"&&m.type!=="ClassPrivateMethod"||!m.key||m.key.type!=="Identifier")continue;let g=m.key.name,y=`${h}.${g}`,v=`${m.async?"async ":""}${g}(${gb(m)})`,S=m.body?ct(ot(m.body,e)):"",w={kind:"function",name:y,key:`function:${y}`,signature:v,bodyText:S,locText:ct(ot(m,e)),node:m,calls:new Set,usesVars:new Set,usesImports:new Set};o.set(y,w),n.push(w)}continue}if(f.type==="VariableDeclaration"){for(let h of f.declarations||[]){if(!h.id||h.id.type!=="Identifier")continue;let m=h.id.name,g=h.init,y=null;if(g&&(g.type==="ArrowFunctionExpression"||g.type==="FunctionExpression"))y=g;else if(g&&g.type==="CallExpression"&&Array.isArray(g.arguments)&&g.arguments.length>0){let _=g.arguments[0];_&&(_.type==="ArrowFunctionExpression"||_.type==="FunctionExpression")&&(y=_)}if(y){let _={...y,id:h.id},S=`${y.async?"async ":""}function ${m}(${gb(_)})`,w=(y.body?.type==="BlockStatement",ct(ot(y.body,e))),E={kind:"function",name:m,key:`function:${m}`,signature:S,bodyText:w,locText:ct(ot(h,e)),node:_,calls:new Set,usesVars:new Set,usesImports:new Set};o.set(m,E),n.push(E)}else{let _=`var ${m}`,v=ct(ot(h,e)),S={kind:"variable",name:m,key:`variable:${m}`,signature:_,bodyText:v,locText:ct(ot(h,e))};a.set(m,S),n.push(S)}}for(let h of f.declarations||[])if(h.init?.type==="CallExpression"&&h.init.callee?.type==="Identifier"&&h.init.callee.name==="require"&&h.init.arguments?.[0]?.type==="StringLiteral"){let m=h.init.arguments[0].value;if(h.id?.type==="Identifier")s.set(h.id.name,m);else if(h.id?.type==="ObjectPattern")for(let g of h.id.properties)g.value?.type==="Identifier"&&s.set(g.value.name,m);n.find(g=>g.key===`import:${m}`)||n.push({kind:"import",name:m,key:`import:${m}`,signature:`require("${m}")`,bodyText:`require("${m}")`,locText:`require("${m}")`})}continue}if(f.type==="ExpressionStatement"&&f.expression?.type==="AssignmentExpression"){let h=f.expression,m=h.left,g=h.right;if(m.type==="MemberExpression"&&m.object?.name==="module"&&m.property?.name==="exports"){let y=ct(ot(g,e)),_=ct(ot(p,e));if(!n.find(v=>v.key==="variable:module.exports")){let v={kind:"variable",name:"module.exports",key:"variable:module.exports",signature:"module.exports",bodyText:y,locText:_};a.set("module.exports",v),n.push(v)}continue}if(m.type==="MemberExpression"&&m.object?.name==="exports"&&m.property?.type==="Identifier"){let y=m.property.name,_=`variable:exports.${y}`,v=ct(ot(g,e)),S=ct(ot(p,e));if(!n.find(w=>w.key===_)){let w={kind:"variable",name:`exports.${y}`,key:_,signature:`exports.${y}`,bodyText:v,locText:S};a.set(`exports.${y}`,w),n.push(w)}continue}}}b3(r,{CallExpression(p){let f=p.node.callee;if(f?.type!=="MemberExpression")return;let h=f.property?.name?.toLowerCase();if(!h||!["get","post","put","patch","delete","options","head","all"].includes(h))return;let m=p.node.arguments||[];if(m.length<2)return;let g=m[0],y="";if(g.type==="StringLiteral")y=g.value;else if(g.type==="TemplateLiteral"&&g.quasis?.length===1)y=g.quasis[0].value.raw;else if(g.type==="TemplateLiteral"){let k=cMe(p);if(!k)return;let N=lMe(k);if(!N)return;let O="",V=!0;for(let te=0;te<g.quasis.length;te++)if(O+=g.quasis[te].value.raw,te<g.expressions.length){let W=g.expressions[te];if(W?.type==="Identifier"&&W.name===N)O+=`:${N}`;else{V=!1;break}}if(!V)return;y=O}else return;if(!y.startsWith("/")&&y!=="*")return;let _=m[m.length-1];if(_?.type!=="ArrowFunctionExpression"&&_?.type!=="FunctionExpression")return;let v=`anonymous@${h.toUpperCase()}:${y}`;if(o.has(v))return;let S=_.async?"async ":"",w=_.body?ct(ot(_.body,e)):"",E={kind:"function",name:v,key:`function:${v}`,signature:`${S}${h} route handler(${(_.params||[]).map(k=>k.type==="Identifier"?k.name:"arg").join(", ")})`,bodyText:w,locText:ct(ot(_,e)),node:_,calls:new Set,usesVars:new Set,usesImports:new Set};o.set(v,E),n.push(E)},FunctionExpression(p){let f=p.node;if(!f.id?.name)return;let h=f.id.name;if(o.has(h))return;let m=f.async?"async ":"";o.set(h,{kind:"function",name:h,key:`function:${h}`,signature:`${m}function ${h}(${gb(f)})`,bodyText:f.body?ct(ot(f.body,e)):"",locText:ct(ot(f,e)),node:f,calls:new Set,usesVars:new Set,usesImports:new Set}),n.push(o.get(h))},ObjectProperty(p){let f=p.node;if(!f.key||f.key.type!=="Identifier")return;let h=f.value;if(h?.type!=="CallExpression")return;let m=h.callee;if(m?.type!=="MemberExpression")return;let g=m.property?.name;if(g!=="query"&&g!=="mutation"&&g!=="subscription")return;let y=h.arguments?.[0];if(!y||y.type!=="ArrowFunctionExpression"&&y.type!=="FunctionExpression")return;let _=f.key.name;if(o.has(_))return;let v=ot(y,e),S=`function ${_}() /* tRPC ${g} */`;o.set(_,{kind:"function",name:_,key:`function:${_}`,signature:S,bodyText:y.body?ct(ot(y.body,e)):"",locText:ct(v),node:y,calls:new Set,usesVars:new Set,usesImports:new Set}),n.push(o.get(_))}});let l=new Set([...o.keys()]),u=new Set([...a.keys()]),d=new Set([...s.keys()]);for(let p of Array.from(o.values()))if(p.node)try{let f=ot(p.node,e);if(!f)continue;let h=Vs(f,t);b3(h,{CallExpression(m){let g=m.node.callee;g.type==="Identifier"&&l.has(g.name)&&p.calls.add(g.name),g.type==="Identifier"&&d.has(g.name)&&p.usesImports.add(g.name),g.type==="MemberExpression"&&g.object?.type==="Identifier"&&d.has(g.object.name)&&p.usesImports.add(g.object.name)},Identifier(m){if(m.parent.type==="FunctionDeclaration"&&m.parent.id===m.node||m.parent.type==="VariableDeclarator"&&m.parent.id===m.node||m.parent.type==="FunctionExpression"&&m.parent.id===m.node)return;let g=m.node.name;u.has(g)&&p.usesVars.add(g),d.has(g)&&p.usesImports.add(g)}})}catch{}return{entities:n,funcs:o,vars:a,importsByLocal:s,fileName:t}}var yb,b3,zc=Kt(()=>{"use strict";gu();Zy();yb=Fe(Ta()),b3=typeof yb.default=="function"?yb.default:yb.default.default});function No(e,t,r){if(!e.startsWith("."))return;let n=_b.dirname(t),s=["",".ts",".tsx",".js",".jsx","/index.ts","/index.js","/index.tsx","/index.jsx"],a=e;for(let o of[".ts",".js",".tsx",".jsx"])if(a.endsWith(o)){a=a.slice(0,-o.length);break}for(let o of s){let c=_b.join(n,a+o).replace(/\\/g,"/");if(r[c]!==void 0)return c}}function dMe(e,t,r){let n=t.symbols?.functions??[];if(n.length===0)return;let s=new Map;for(let a of n){if(!a||!a.name)continue;s.set(a.name,a.name);let o=a.name.lastIndexOf(".");if(o>=0){let c=a.name.slice(o+1);s.has(c)||s.set(c,a.name)}}for(let a of n){if(!a?.name||a.kind==="class")continue;let o=Qr.makeKey(e,a.name);r.ensureNode(e,a.name);let c=Array.isArray(a.calls)?a.calls:[];for(let l of c){let u=s.get(l);if(!u)continue;let d=Qr.makeKey(e,u);r.ensureNode(e,u),r.addEdge(o,d,.85,"calls")}}}function ws(e,t){let r=new Qr,n=e.files;for(let[a,o]of Object.entries(n))for(let c of o.symbols?.functions??[])r.ensureNode(a,c.name);let s=a=>/\.(js|jsx|ts|tsx|mjs|cjs|mts|cts)$/.test(a);for(let[a,o]of Object.entries(n)){if(!s(a)){dMe(a,o,r);continue}let c=o.content;if(!c)continue;let l;try{l=Ai(c,a)}catch{continue}let u=l.importsByLocal,d=new Map;for(let[p,f]of u.entries()){let h=No(f,a,n);if(!h&&t){let m=t.resolveFromSnapshot(p,n);m&&(h=m.filePath)}h&&d.set(p,h)}for(let p of l.funcs.values()){let f=Qr.makeKey(a,p.name);if(r.ensureNode(a,p.name),p.calls)for(let h of p.calls){let m=Qr.makeKey(a,h);r.ensureNode(a,h),r.addEdge(f,m,.9,"calls")}if(p.usesImports)for(let h of p.usesImports){let m=d.get(h);if(!m)continue;let g=n[m];if(!g)continue;let y=!1;for(let _ of g.symbols?.functions??[])if(_.name===h){let v=Qr.makeKey(m,_.name);r.ensureNode(m,_.name),r.addEdge(f,v,.85,"calls"),y=!0}if(!y&&(g.symbols?.functions?.length??0)>0){let _=g.symbols.functions[0],v=Qr.makeKey(m,_.name);r.ensureNode(m,_.name),r.addEdge(f,v,.6,"calls"),y=!0}if(!y&&(g.symbols?.variables??[]).some(v=>v.name==="module.exports"||v.name==="default")){let v=Qr.makeKey(m,h);r.ensureNode(m,h),r.addEdge(f,v,.5,"imports")}}}}return r}function oh(e,t){let r=new Set(e);return t.getAllNodes().filter(n=>r.has(n.filePath)).map(n=>n.key)}var _b,uMe,Qr,Oo=Kt(()=>{"use strict";_b=Fe(require("path"));zc();uMe=2,Qr=class e{constructor(){this.nodes=new Map;this.edgeMeta=new Map}static makeKey(t,r){return`${t}::${r}`}static edgeMetaKey(t,r){return`${t}\u2192${r}`}ensureNode(t,r){let n=e.makeKey(t,r);return this.nodes.has(n)||this.nodes.set(n,{key:n,filePath:t,functionName:r,calls:[],calledBy:[]}),this.nodes.get(n)}addEdge(t,r,n=.9,s="calls"){let a=this.nodes.get(t),o=this.nodes.get(r);if(!a||!o)return;a.calls.includes(r)||a.calls.push(r),o.calledBy.includes(t)||o.calledBy.push(t);let c=e.edgeMetaKey(t,r);this.edgeMeta.has(c)||this.edgeMeta.set(c,{confidence:n,kind:s})}getEdgeMeta(t,r){return this.edgeMeta.get(e.edgeMetaKey(t,r))}getNode(t){return this.nodes.get(t)}getAllNodes(){return Array.from(this.nodes.values())}getReachable(t,r=5){let n=[],s=new Set,a=[{key:t,depth:0}];for(;a.length>0;){let{key:o,depth:c}=a.shift();if(s.has(o)||c>r)continue;s.add(o),o!==t&&n.push({key:o,depth:c});let l=this.nodes.get(o);if(l)for(let u of l.calls)a.push({key:u,depth:c+1})}return n}getImpacted(t,r=5){let n=[],s=new Set,a=new Set(t),o=t.map(c=>({key:c,depth:0}));for(;o.length>0;){let{key:c,depth:l}=o.shift();if(s.has(c)||l>r)continue;s.add(c),a.has(c)||n.push({key:c,depth:l});let u=this.nodes.get(c);if(u)for(let d of u.calledBy)o.push({key:d,depth:l+1})}return n}getImpactedFiltered(t,r){let{maxDepth:n,minConfidence:s,kinds:a}=r,o=new Set(a),c=[],l=new Set,u=new Set(t),d=t.map(p=>({key:p,depth:0,confidence:1,kind:"calls"}));for(;d.length>0;){let p=d.shift();if(l.has(p.key)||p.depth>n)continue;l.add(p.key),u.has(p.key)||c.push(p);let f=this.nodes.get(p.key);if(f)for(let h of f.calledBy){let m=this.edgeMeta.get(e.edgeMetaKey(h,p.key)),g=m?.confidence??1,y=m?.kind??"calls";g<s||o.has(y)&&d.push({key:h,depth:p.depth+1,confidence:g,kind:y})}}return c}serialize(){let t={nodes:{},edges:[],version:uMe};for(let[r,n]of this.nodes.entries()){let s=n.calls.map(a=>{let o=this.edgeMeta.get(e.edgeMetaKey(r,a));return{key:a,confidence:o?.confidence??1,kind:o?.kind??"calls"}});t.nodes[r]={...n,callEdges:s};for(let a of s)t.edges.push({callerKey:r,calleeKey:a.key,confidence:a.confidence,kind:a.kind})}return t}static deserialize(t){let r=new e;for(let[n,s]of Object.entries(t.nodes))if(r.nodes.set(n,{...s}),s.callEdges)for(let a of s.callEdges)r.edgeMeta.set(e.edgeMetaKey(n,a.key),{confidence:a.confidence,kind:a.kind});return r}}});function fMe(e){let t=new Map;for(let r of Object.keys(e.files))t.set(r,new Set);for(let[r,n]of Object.entries(e.files))for(let s of n.symbols?.imports??[]){if(!s.source.startsWith("."))continue;let a=No(s.source,r,e.files);a&&a!==r&&t.has(a)&&(t.get(r).add(a),t.get(a).add(r))}return t}function hMe(e,t,r){let n=new Map;for(let l of t)n.set(l,new Map);let s=new Set;function a(l,u){return l<u?`${l}|${u}`:`${u}|${l}`}for(let l of e.getAllNodes())for(let u of l.calls){let d=u.split("::")[0];if(d&&d!==l.filePath&&n.has(l.filePath)&&n.has(d)){let p=n.get(l.filePath).get(d)??0;n.get(l.filePath).set(d,p+1),n.get(d).set(l.filePath,(n.get(d).get(l.filePath)??0)+1),s.add(a(l.filePath,d))}}if(r)for(let[l,u]of r)for(let d of u)n.has(l)&&n.has(d)&&!s.has(a(l,d))&&(n.get(l).set(d,(n.get(l).get(d)??0)+1),n.get(d).set(l,(n.get(d).get(l)??0)+1),s.add(a(l,d)));let o=new Map;for(let l of t){let u=l.substring(0,l.lastIndexOf("/"));o.has(u)||o.set(u,[]),o.get(u).push(l)}for(let l of o.values())if(!(l.length<2))for(let u=0;u<l.length;u++)for(let d=u+1;d<l.length;d++){let p=l[u],f=l[d];n.get(p).set(f,(n.get(p).get(f)??0)+.5),n.get(f).set(p,(n.get(f).get(p)??0)+.5)}let c=0;for(let l of n.values())for(let u of l.values())c+=u;return{adj:n,totalWeight:c}}function mMe(e,t,r){if(r===0)return 0;let n=r,s=new Map;for(let[o,c]of e){let l=0;for(let u of c.values())l+=u;s.set(o,l)}let a=0;for(let[o,c]of e){let l=t.get(o),u=s.get(o);for(let[d,p]of c){let f=t.get(d);if(l!==f)continue;let h=s.get(d);a+=p-u*h/n}}return a/n}function gMe(e,t,r){if(r===0)return!1;let n=r,s=new Map;for(let[l,u]of e){let d=0;for(let p of u.values())d+=p;s.set(l,d)}let a=new Map;for(let[l,u]of t)a.set(u,(a.get(u)??0)+s.get(l));let o=!1,c=[...e.keys()].sort();for(let l of c){let u=s.get(l),d=t.get(l),p=new Map;for(let[m,g]of e.get(l)){let y=t.get(m);p.set(y,(p.get(y)??0)+g)}a.set(d,(a.get(d)??0)-u);let f=d,h=0;for(let[m,g]of p){let y=a.get(m)??0,_=g/n-y*u/(n*n);if(m===d)continue;let v=p.get(d)??0,S=a.get(d)??0,w=-(v/n-S*u/(n*n)),E=_+w;E>h&&(h=E,f=m)}a.set(d,(a.get(d)??0)+u),f!==d&&h>1e-10&&(a.set(d,(a.get(d)??0)-u),a.set(f,(a.get(f)??0)+u),t.set(l,f),o=!0)}return o}function S3(e,t,r){if(t.length===0)return{communities:new Map,modularity:0};let{adj:n,totalWeight:s}=hMe(e,t,r);if(s===0){let u=new Map;return t.forEach((d,p)=>u.set(d,p)),{communities:u,modularity:0}}let a=new Map;t.forEach((u,d)=>a.set(u,d));for(let u=0;u<100&&gMe(n,a,s);u++);let o=[...new Set(a.values())],c=new Map;o.forEach((u,d)=>c.set(u,d));for(let[u,d]of a)a.set(u,c.get(d));let l=mMe(n,a,s);return{communities:a,modularity:l}}function yMe(e,t,r){let n=new Map;for(let a of t){let o=a.includes("/")?a.split("/").slice(0,-1).join("/"):a;n.set(a,o)}let s=new Map;for(let a of t)s.set(a,new Set);for(let a of e.getAllNodes())for(let o of a.calls){let c=o.split("::")[0];c&&c!==a.filePath&&(s.get(a.filePath)?.add(c),s.get(c)?.add(a.filePath))}if(r)for(let[a,o]of r)for(let c of o)s.get(a)?.add(c),s.get(c)?.add(a);for(let a=0;a<pMe;a++){let o=!1,c=[...t].sort((l,u)=>l.localeCompare(u));for(let l of c){let u=s.get(l);if(!u||u.size===0)continue;let d=new Map;for(let m of u){let g=n.get(m)??m;d.set(g,(d.get(g)??0)+1)}let p=0;for(let m of d.values())m>p&&(p=m);let f=d.get(n.get(l))??0,h=n.get(l);if(p>f){let m=[...d.entries()].filter(([,g])=>g===p);m.length===1&&(h=m[0][0])}h!==n.get(l)&&(n.set(l,h),o=!0)}if(!o)break}return n}function T3(e,t){if(e.length===0)return"unknown";let r=new Set(["src","lib","app","api","utils","helpers","common","shared","core","index","features","modules","components","services","controllers","routes","models","middleware","config","types","hooks"]);if(t){let m=t.split("/");for(let g=m.length-1;g>=0;g--){let y=m[g].toLowerCase();if(!r.has(y)&&y.length>1)return y}}let n=new Map,s=new Map;for(let m of e){let g=m.split("/").slice(0,-1);for(let y=0;y<g.length;y++){let _=g[y].toLowerCase();if(r.has(_))continue;n.set(_,(n.get(_)??0)+1);let v=y+1;v>(s.get(_)??0)&&s.set(_,v)}}let a="",o=0,c=0;for(let[m,g]of n.entries()){let y=s.get(m)??0;(g>o||g===o&&y>c)&&(a=m,o=g,c=y)}if(a)return a;let l=[...e].sort(),u=l[0],d=l[l.length-1],p="";for(let m=0;m<Math.min(u.length,d.length)&&u[m]===d[m];m++)p+=u[m];let h=x3.dirname(p.replace(/\/$/,"")).split("/").pop()||"cluster";return h==="."?"misc":h}function _Me(e,t){let r=new Map,n=Object.values(t).sort((s,a)=>a.rootPath.length-s.rootPath.length);for(let s of e)for(let a of n)if(a.rootPath===""||s.startsWith(a.rootPath+"/")||s===a.rootPath){r.set(s,a.id);break}return r}function EMe(e,t){let r=e.split("/"),n=r[r.length-1]??"";for(let s of r.slice(0,-1))if(bMe.has(s))return!1;return!(vMe.test(n)||xMe.test(n)||TMe.test(n)||wMe.test(e)||r.length<=2&&SMe.test(n)&&(!t||!t.has(e))||n.includes("mock")||n.includes("Mock"))}function $o(e,t,r,n){let s=t??ws(e),a=Object.keys(e.files),o=Object.values(e.apiIndex),c=new Set(o.map(k=>k.filePath)),l=a.filter(k=>EMe(k,c));if(l.length===0)return{};let u=r?_Me(l,r):new Map,d=fMe(e),{communities:p,modularity:f}=S3(s,l,d),h=new Set(p.values()).size,m,g=f;if(h>=2){m=new Map;let k=new Map;for(let[N,O]of p)k.has(O)||k.set(O,[]),k.get(O).push(N);for(let[,N]of k){let O=new Map;for(let W of N){let $=W.includes("/")?W.split("/").slice(0,-1).join("/"):W;O.set($,(O.get($)??0)+1)}let V=N[0],te=0;for(let[W,$]of O)$>te&&(te=$,V=W);for(let W of N)m.set(W,V)}}else m=yMe(s,l,d),g=0;let y=new Map;for(let[k,N]of m.entries())y.has(N)||y.set(N,[]),y.get(N).push(k);let _=new Set;for(let[k,N]of y.entries())N.length>=v3&&_.add(k);for(let[k,N]of[...y.entries()]){if(N.length>=v3)continue;let O=null,V=0;for(let te of N)for(let W of s.getAllNodes().filter($=>$.filePath===te))for(let $ of[...W.calls,...W.calledBy]){let H=$.split("::")[0],Y=m.get(H);Y&&_.has(Y)&&(V++,O=Y)}if(O)for(let te of N)m.set(te,O)}let v=new Map;for(let[k,N]of m.entries())v.has(N)||v.set(N,[]),v.get(N).push(k);if(v.size>=5){let k=new Map;for(let[V,te]of v)for(let W of te)k.set(W,V);let N=new Map;for(let[V,te]of d)for(let W of te)k.get(W)&&(N.has(W)||N.set(W,new Set),N.get(W).add(k.get(V)??""));let O=Math.max(3,Math.ceil(v.size*.8));for(let[V,te]of N)if(te.size>=O&&!c.has(V)){let W=k.get(V);if(W){let $=v.get(W);if($){let H=$.filter(Y=>Y!==V);H.length===0?v.delete(W):v.set(W,H)}}}}for(let[k,N]of[...v.entries()]){let O=N.filter(W=>c.has(W));if(O.length<=1)continue;let V=new Map;for(let W of O){let $=W.includes("/")?W.split("/").slice(0,-1).join("/"):"";V.has($)||V.set($,[]),V.get($).push(W)}if(V.size<=1)continue;v.delete(k);let te=N.filter(W=>!c.has(W));for(let W of te){let $=W.includes("/")?W.split("/").slice(0,-1).join("/"):"",H="",Y=0;for(let ae of V.keys())($===ae||$.startsWith(ae+"/")||ae.startsWith($+"/"))&&ae.length>Y&&(H=ae,Y=ae.length);if(!H){let ae=0;for(let[K,D]of V)D.length>ae&&(ae=D.length,H=K)}V.has(H)||V.set(H,[]),V.get(H).push(W)}for(let[W,$]of V){let H=W||k,Y=v.has(H)?`${H}__${k}`:H;v.set(Y,$)}}let S={},w=new Set(Object.values(e.apiIndex).map(k=>k.filePath)),E=new Map;for(let[k,N]of v.entries()){let O=T3(N,k);E.has(O)||E.set(O,[]),E.get(O).push(...N)}for(let[k,N]of E.entries()){let O=`cluster:${k}`,V=new Set(N),te=0,W=0;for(let z of s.getAllNodes().filter(ee=>V.has(ee.filePath)))for(let ee of z.calls){let le=ee.split("::")[0];V.has(le)?te++:W++}let $=[];for(let z of N)if(w.has(z)){let ee=oh([z],s);$.push(...ee)}let H;if(u.size>0){let z=new Map;for(let le of N){let Se=u.get(le);Se&&z.set(Se,(z.get(Se)??0)+1)}let ee=0;for(let[le,Se]of z.entries())Se>ee&&(ee=Se,H=le)}let Y=o.filter(z=>V.has(z.filePath)),ae={SCREEN:"screensInCluster",NAV_ROUTE:"navRoutesInCluster",NETWORK:"networkCallsInCluster",DI_BINDING:"diBindingsInCluster"},K=Y.filter(z=>z.method==="SCREEN"),D=Y.filter(z=>z.method==="NAV_ROUTE"),A=Y.filter(z=>z.method==="NETWORK"),M=Y.filter(z=>z.method==="DI_BINDING");S[O]={id:O,label:k,name:k,serviceId:H,files:[...N].sort(),entryPoints:$,apisInCluster:Y,screensInCluster:K.length>0?K:void 0,navRoutesInCluster:D.length>0?D:void 0,networkCallsInCluster:A.length>0?A:void 0,diBindingsInCluster:M.length>0?M:void 0,internalCallCount:te,externalCallCount:W,modularity:g}}for(let[k,N]of Object.entries(S))if(N.files.length>w3){let O=PMe(N,s,d,o);O&&Object.keys(O).length>=2&&(N.subClusters=O)}return IMe(S,n)}function PMe(e,t,r,n,s=0){if(s>=1)return null;let a=e.files;if(a.length<=w3)return null;let o=new Set(a),c;if(r){c=new Map;for(let g of a){let y=r.get(g);if(y){let _=new Set;for(let v of y)o.has(v)&&_.add(v);c.set(g,_)}else c.set(g,new Set)}}let{communities:l,modularity:u}=S3(t,a,c);if(new Set(l.values()).size<2)return null;let p=new Map;for(let[g,y]of l)p.has(y)||p.set(y,[]),p.get(y).push(g);let f={},h=n??[],m=new Set(h.map(g=>g.filePath));for(let[,g]of p){let y=T3(g),_=`${e.id}/${y}`,v=new Set(g),S=0,w=0;for(let N of t.getAllNodes().filter(O=>v.has(O.filePath)))for(let O of N.calls){let V=O.split("::")[0];v.has(V)?S++:w++}let E=[];for(let N of g)m.has(N)&&E.push(...oh([N],t));let k=h.filter(N=>v.has(N.filePath));f[_]={id:_,label:y,name:y,serviceId:e.serviceId,files:[...g].sort(),entryPoints:E,apisInCluster:k,internalCallCount:S,externalCallCount:w,modularity:u}}return Object.keys(f).length>=2?f:null}function IMe(e,t){if(!t||Object.keys(t).length===0)return e;let r=Object.values(t),n=Object.values(e);if(n.length===0)return e;let s=[];for(let p of r){let f=new Set(p.files);for(let h of n){let m=new Set(h.files),g=0;for(let v of m)f.has(v)&&g++;let y=f.size+m.size-g,_=y>0?g/y:0;_>0&&s.push({baseId:p.id,freshId:h.id,jaccard:_})}}s.sort((p,f)=>f.jaccard-p.jaccard);let a=.3,o=new Set,c=new Set,l=new Map;for(let{baseId:p,freshId:f,jaccard:h}of s){if(h<a)break;o.has(p)||c.has(f)||(o.add(p),c.add(f),l.set(f,p))}let u={},d=new Set;for(let[p,f]of Object.entries(e)){let h=l.get(p),m;if(h?m=h:m=p,d.has(m)){let g=2;for(;d.has(`${m}_${g}`);)g++;m=`${m}_${g}`}d.add(m),u[m]={...f,id:m}}return u}function E3(e,t,r,n){let s={},a=new Map(Object.values(e).map(d=>[d.id,d])),o=new Map(Object.values(e).map(d=>[d.label,d])),c=new Set;for(let d of Object.values(e))for(let p of d.files)c.add(p);for(let[d,p]of Object.entries(t)){let f=a.get(d)??o.get(p.label),h="unchanged";if(f)if(r&&n){let m=new Set(f.files),g=v=>{let S=r[v]?.hash,w=n[v]?.hash;return!!(S&&w&&S!==w||!r[v]&&n[v])},y=p.files.some(g),_=f.files.some(v=>!p.files.includes(v)&&!n[v]);(y||_)&&(h="modified")}else{let m=new Set(f.files),g=new Set(p.files);(p.files.some(_=>!m.has(_))||f.files.some(_=>!g.has(_)))&&(h="modified")}else{let m=p.files.length>0&&p.files.every(y=>c.has(y)),g=!1;m&&r&&n&&(g=p.files.some(y=>{let _=r[y]?.hash,v=n[y]?.hash;return _!==void 0&&v!==void 0&&_!==v})),h=m&&!g?"unchanged":"added"}s[d]={...p,diff:h}}let l=new Set(Object.keys(t)),u=new Set(Object.values(t).map(d=>d.label));for(let d of Object.values(e))!l.has(d.id)&&!u.has(d.label)&&(s[`${d.id}__deleted`]={...d,diff:"deleted"});return s}function P3(e,t){return Object.values(t).find(r=>r.files.includes(e))}var x3,pMe,v3,bMe,vMe,xMe,SMe,TMe,wMe,w3,ch=Kt(()=>{"use strict";x3=Fe(require("path"));Oo();pMe=20,v3=2;bMe=new Set(["tests","test","__tests__","__test__","e2e","cypress","playwright","fixtures","mocks","__mocks__","support","spec","specs"]),vMe=/(?:\.test\.|\.spec\.|\.e2e\.|-test\.|\.mock\.)/,xMe=/^(?:jest|vitest|babel|webpack|rollup|esbuild|tsconfig|eslint|prettier|tailwind|postcss|vite)[\.\-]/,SMe=/^(?:main|app|index|server|bootstrap)\.\w+$/,TMe=/^(?:setup|teardown|global-setup|global-teardown|test-setup|test-teardown)\.\w+$/,wMe=/(?:\/seed\.\w+$|\/seeds\/|\/migrations\/)/;w3=15});var U3=G((Tb,qc)=>{var xb=void 0,Sb=function(e){return xb||(xb=new Promise(function(t,r){var n=typeof e<"u"?e:{},s=n.onAbort;n.onAbort=function(b){r(new Error(b)),s&&s(b)},n.postRun=n.postRun||[],n.postRun.push(function(){t(n)}),qc=void 0;var a;a||=typeof n<"u"?n:{};var o=!!globalThis.window,c=!!globalThis.WorkerGlobalScope,l=globalThis.process?.versions?.node&&globalThis.process?.type!="renderer";a.onRuntimeInitialized=function(){function b(ne,be){switch(typeof be){case"boolean":p5(ne,be?1:0);break;case"number":l5(ne,be);break;case"string":u5(ne,be,-1,-1);break;case"object":if(be===null)wO(ne);else if(be.length!=null){var Ge=xm(be.length);k.set(be,Ge),d5(ne,Ge,be.length,-1),Id(Ge)}else Em(ne,"Wrong API use : tried to return a value of an unknown type ("+be+").",-1);break;default:wO(ne)}}function x(ne,be){for(var Ge=[],rt=0;rt<ne;rt+=1){var qt=Ae(be+4*rt,"i32"),ur=i5(qt);if(ur===1||ur===2)qt=c5(qt);else if(ur===3)qt=a5(qt);else if(ur===4){ur=qt,qt=s5(ur),ur=o5(ur);for(var cs=new Uint8Array(qt),$i=0;$i<qt;$i+=1)cs[$i]=k[ur+$i];qt=cs}else qt=null;Ge.push(qt)}return Ge}function P(ne,be){this.Qa=ne,this.db=be,this.Oa=1,this.mb=[]}function U(ne,be){if(this.db=be,this.fb=vm(ne),this.fb===null)throw Error("Unable to allocate memory for the SQL string");this.lb=this.fb,this.$a=this.sb=null}function Q(ne){if(this.filename="dbfile_"+(4294967295*Math.random()>>>0),ne!=null){var be=this.filename,Ge="/",rt=be;if(Ge&&(Ge=typeof Ge=="string"?Ge:sr(Ge),rt=be?wt(Ge+"/"+be):Ge),be=Oi(!0,!0),rt=ia(rt,be),ne){if(typeof ne=="string"){Ge=Array(ne.length);for(var qt=0,ur=ne.length;qt<ur;++qt)Ge[qt]=ne.charCodeAt(qt);ne=Ge}gm(rt,be|146),Ge=yl(rt,577),pO(Ge,ne,0,ne.length,0),ox(Ge),gm(rt,be)}}this.handleError(vt(this.filename,ce)),this.db=Ae(ce,"i32"),PO(this.db),this.gb={},this.Sa={}}var ce=Yo(4),ge=a.cwrap,vt=ge("sqlite3_open","number",["string","number"]),lr=ge("sqlite3_close_v2","number",["number"]),Ct=ge("sqlite3_exec","number",["number","string","number","number","number"]),kr=ge("sqlite3_changes","number",["number"]),_n=ge("sqlite3_prepare_v2","number",["number","string","number","number","number"]),bO=ge("sqlite3_sql","string",["number"]),zV=ge("sqlite3_normalized_sql","string",["number"]),vO=ge("sqlite3_prepare_v2","number",["number","number","number","number","number"]),UV=ge("sqlite3_bind_text","number",["number","number","number","number","number"]),xO=ge("sqlite3_bind_blob","number",["number","number","number","number","number"]),qV=ge("sqlite3_bind_double","number",["number","number","number"]),WV=ge("sqlite3_bind_int","number",["number","number","number"]),VV=ge("sqlite3_bind_parameter_index","number",["number","string"]),KV=ge("sqlite3_step","number",["number"]),GV=ge("sqlite3_errmsg","string",["number"]),ZV=ge("sqlite3_column_count","number",["number"]),HV=ge("sqlite3_data_count","number",["number"]),JV=ge("sqlite3_column_double","number",["number","number"]),SO=ge("sqlite3_column_text","string",["number","number"]),YV=ge("sqlite3_column_blob","number",["number","number"]),XV=ge("sqlite3_column_bytes","number",["number","number"]),QV=ge("sqlite3_column_type","number",["number","number"]),e5=ge("sqlite3_column_name","string",["number","number"]),t5=ge("sqlite3_reset","number",["number"]),r5=ge("sqlite3_clear_bindings","number",["number"]),n5=ge("sqlite3_finalize","number",["number"]),TO=ge("sqlite3_create_function_v2","number","number string number number number number number number number".split(" ")),i5=ge("sqlite3_value_type","number",["number"]),s5=ge("sqlite3_value_bytes","number",["number"]),a5=ge("sqlite3_value_text","string",["number"]),o5=ge("sqlite3_value_blob","number",["number"]),c5=ge("sqlite3_value_double","number",["number"]),l5=ge("sqlite3_result_double","",["number","number"]),wO=ge("sqlite3_result_null","",["number"]),u5=ge("sqlite3_result_text","",["number","string","number","number"]),d5=ge("sqlite3_result_blob","",["number","number","number","number"]),p5=ge("sqlite3_result_int","",["number","number"]),Em=ge("sqlite3_result_error","",["number","string","number"]),EO=ge("sqlite3_aggregate_context","number",["number","number"]),PO=ge("RegisterExtensionFunctions","number",["number"]),IO=ge("sqlite3_update_hook","number",["number","number","number"]);P.prototype.bind=function(ne){if(!this.Qa)throw"Statement closed";return this.reset(),Array.isArray(ne)?this.Gb(ne):ne!=null&&typeof ne=="object"?this.Hb(ne):!0},P.prototype.step=function(){if(!this.Qa)throw"Statement closed";this.Oa=1;var ne=KV(this.Qa);switch(ne){case 100:return!0;case 101:return!1;default:throw this.db.handleError(ne)}},P.prototype.Ab=function(ne){return ne==null&&(ne=this.Oa,this.Oa+=1),JV(this.Qa,ne)},P.prototype.Ob=function(ne){if(ne==null&&(ne=this.Oa,this.Oa+=1),ne=SO(this.Qa,ne),typeof BigInt!="function")throw Error("BigInt is not supported");return BigInt(ne)},P.prototype.Tb=function(ne){return ne==null&&(ne=this.Oa,this.Oa+=1),SO(this.Qa,ne)},P.prototype.getBlob=function(ne){ne==null&&(ne=this.Oa,this.Oa+=1);var be=XV(this.Qa,ne);ne=YV(this.Qa,ne);for(var Ge=new Uint8Array(be),rt=0;rt<be;rt+=1)Ge[rt]=k[ne+rt];return Ge},P.prototype.get=function(ne,be){be=be||{},ne!=null&&this.bind(ne)&&this.step(),ne=[];for(var Ge=HV(this.Qa),rt=0;rt<Ge;rt+=1)switch(QV(this.Qa,rt)){case 1:var qt=be.useBigInt?this.Ob(rt):this.Ab(rt);ne.push(qt);break;case 2:ne.push(this.Ab(rt));break;case 3:ne.push(this.Tb(rt));break;case 4:ne.push(this.getBlob(rt));break;default:ne.push(null)}return ne},P.prototype.qb=function(){for(var ne=[],be=ZV(this.Qa),Ge=0;Ge<be;Ge+=1)ne.push(e5(this.Qa,Ge));return ne},P.prototype.zb=function(ne,be){ne=this.get(ne,be),be=this.qb();for(var Ge={},rt=0;rt<be.length;rt+=1)Ge[be[rt]]=ne[rt];return Ge},P.prototype.Sb=function(){return bO(this.Qa)},P.prototype.Pb=function(){return zV(this.Qa)},P.prototype.run=function(ne){return ne!=null&&this.bind(ne),this.step(),this.reset()},P.prototype.wb=function(ne,be){be==null&&(be=this.Oa,this.Oa+=1),ne=vm(ne),this.mb.push(ne),this.db.handleError(UV(this.Qa,be,ne,-1,0))},P.prototype.Fb=function(ne,be){be==null&&(be=this.Oa,this.Oa+=1);var Ge=xm(ne.length);k.set(ne,Ge),this.mb.push(Ge),this.db.handleError(xO(this.Qa,be,Ge,ne.length,0))},P.prototype.vb=function(ne,be){be==null&&(be=this.Oa,this.Oa+=1),this.db.handleError((ne===(ne|0)?WV:qV)(this.Qa,be,ne))},P.prototype.Ib=function(ne){ne==null&&(ne=this.Oa,this.Oa+=1),xO(this.Qa,ne,0,0,0)},P.prototype.xb=function(ne,be){switch(be==null&&(be=this.Oa,this.Oa+=1),typeof ne){case"string":this.wb(ne,be);return;case"number":this.vb(ne,be);return;case"bigint":this.wb(ne.toString(),be);return;case"boolean":this.vb(ne+0,be);return;case"object":if(ne===null){this.Ib(be);return}if(ne.length!=null){this.Fb(ne,be);return}}throw"Wrong API use : tried to bind a value of an unknown type ("+ne+")."},P.prototype.Hb=function(ne){var be=this;return Object.keys(ne).forEach(function(Ge){var rt=VV(be.Qa,Ge);rt!==0&&be.xb(ne[Ge],rt)}),!0},P.prototype.Gb=function(ne){for(var be=0;be<ne.length;be+=1)this.xb(ne[be],be+1);return!0},P.prototype.reset=function(){return this.freemem(),r5(this.Qa)===0&&t5(this.Qa)===0},P.prototype.freemem=function(){for(var ne;(ne=this.mb.pop())!==void 0;)Id(ne)},P.prototype.Ya=function(){this.freemem();var ne=n5(this.Qa)===0;return delete this.db.gb[this.Qa],this.Qa=0,ne},U.prototype.next=function(){if(this.fb===null)return{done:!0};if(this.$a!==null&&(this.$a.Ya(),this.$a=null),!this.db.db)throw this.ob(),Error("Database closed");var ne=Tm(),be=Yo(4);Xe(ce),Xe(be);try{this.db.handleError(vO(this.db.db,this.lb,-1,ce,be)),this.lb=Ae(be,"i32");var Ge=Ae(ce,"i32");return Ge===0?(this.ob(),{done:!0}):(this.$a=new P(Ge,this.db),this.db.gb[Ge]=this.$a,{value:this.$a,done:!1})}catch(rt){throw this.sb=tt(this.lb),this.ob(),rt}finally{Sm(ne)}},U.prototype.ob=function(){Id(this.fb),this.fb=null},U.prototype.Qb=function(){return this.sb!==null?this.sb:tt(this.lb)},typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"&&(U.prototype[Symbol.iterator]=function(){return this}),Q.prototype.run=function(ne,be){if(!this.db)throw"Database closed";if(be){ne=this.tb(ne,be);try{ne.step()}finally{ne.Ya()}}else this.handleError(Ct(this.db,ne,0,0,ce));return this},Q.prototype.exec=function(ne,be,Ge){if(!this.db)throw"Database closed";var rt=null,qt=null,ur=null;try{ur=qt=vm(ne);var cs=Yo(4);for(ne=[];Ae(ur,"i8")!==0;){Xe(ce),Xe(cs),this.handleError(vO(this.db,ur,-1,ce,cs));var $i=Ae(ce,"i32");if(ur=Ae(cs,"i32"),$i!==0){var vi=null;for(rt=new P($i,this),be!=null&&rt.bind(be);rt.step();)vi===null&&(vi={columns:rt.qb(),values:[]},ne.push(vi)),vi.values.push(rt.get(null,Ge));rt.Ya()}}return ne}catch(ls){throw rt&&rt.Ya(),ls}finally{qt&&Id(qt)}},Q.prototype.Mb=function(ne,be,Ge,rt,qt){typeof be=="function"&&(rt=Ge,Ge=be,be=void 0),ne=this.tb(ne,be);try{for(;ne.step();)Ge(ne.zb(null,qt))}finally{ne.Ya()}if(typeof rt=="function")return rt()},Q.prototype.tb=function(ne,be){if(Xe(ce),this.handleError(_n(this.db,ne,-1,ce,0)),ne=Ae(ce,"i32"),ne===0)throw"Nothing to prepare";var Ge=new P(ne,this);return be!=null&&Ge.bind(be),this.gb[ne]=Ge},Q.prototype.Ub=function(ne){return new U(ne,this)},Q.prototype.Nb=function(){Object.values(this.gb).forEach(function(be){be.Ya()}),Object.values(this.Sa).forEach(Ga),this.Sa={},this.handleError(lr(this.db));var ne=RV(this.filename);return this.handleError(vt(this.filename,ce)),this.db=Ae(ce,"i32"),PO(this.db),ne},Q.prototype.close=function(){this.db!==null&&(Object.values(this.gb).forEach(function(ne){ne.Ya()}),Object.values(this.Sa).forEach(Ga),this.Sa={},this.Za&&(Ga(this.Za),this.Za=void 0),this.handleError(lr(this.db)),oO("/"+this.filename),this.db=null)},Q.prototype.handleError=function(ne){if(ne===0)return null;throw ne=GV(this.db),Error(ne)},Q.prototype.Rb=function(){return kr(this.db)},Q.prototype.Kb=function(ne,be){Object.prototype.hasOwnProperty.call(this.Sa,ne)&&(Ga(this.Sa[ne]),delete this.Sa[ne]);var Ge=Pd(function(rt,qt,ur){qt=x(qt,ur);try{var cs=be.apply(null,qt)}catch($i){Em(rt,$i,-1);return}b(rt,cs)},"viii");return this.Sa[ne]=Ge,this.handleError(TO(this.db,ne,be.length,1,0,Ge,0,0,0)),this},Q.prototype.Jb=function(ne,be){var Ge=be.init||function(){return null},rt=be.finalize||function(vi){return vi},qt=be.step;if(!qt)throw"An aggregate function must have a step function in "+ne;var ur={};Object.hasOwnProperty.call(this.Sa,ne)&&(Ga(this.Sa[ne]),delete this.Sa[ne]),be=ne+"__finalize",Object.hasOwnProperty.call(this.Sa,be)&&(Ga(this.Sa[be]),delete this.Sa[be]);var cs=Pd(function(vi,ls,hx){var Xo=EO(vi,1);Object.hasOwnProperty.call(ur,Xo)||(ur[Xo]=Ge()),ls=x(ls,hx),ls=[ur[Xo]].concat(ls);try{ur[Xo]=qt.apply(null,ls)}catch(f5){delete ur[Xo],Em(vi,f5,-1)}},"viii"),$i=Pd(function(vi){var ls=EO(vi,1);try{var hx=rt(ur[ls])}catch(Xo){delete ur[ls],Em(vi,Xo,-1);return}b(vi,hx),delete ur[ls]},"vi");return this.Sa[ne]=cs,this.Sa[be]=$i,this.handleError(TO(this.db,ne,qt.length-1,1,0,0,cs,$i,0)),this},Q.prototype.Zb=function(ne){return this.Za&&(IO(this.db,0,0),Ga(this.Za),this.Za=void 0),ne?(this.Za=Pd(function(be,Ge,rt,qt,ur){switch(Ge){case 18:be="insert";break;case 23:be="update";break;case 9:be="delete";break;default:throw"unknown operationCode in updateHook callback: "+Ge}if(rt=tt(rt),qt=tt(qt),ur>Number.MAX_SAFE_INTEGER)throw"rowId too big to fit inside a Number";ne(be,rt,qt,Number(ur))},"viiiij"),IO(this.db,this.Za,0),this):this},P.prototype.bind=P.prototype.bind,P.prototype.step=P.prototype.step,P.prototype.get=P.prototype.get,P.prototype.getColumnNames=P.prototype.qb,P.prototype.getAsObject=P.prototype.zb,P.prototype.getSQL=P.prototype.Sb,P.prototype.getNormalizedSQL=P.prototype.Pb,P.prototype.run=P.prototype.run,P.prototype.reset=P.prototype.reset,P.prototype.freemem=P.prototype.freemem,P.prototype.free=P.prototype.Ya,U.prototype.next=U.prototype.next,U.prototype.getRemainingSQL=U.prototype.Qb,Q.prototype.run=Q.prototype.run,Q.prototype.exec=Q.prototype.exec,Q.prototype.each=Q.prototype.Mb,Q.prototype.prepare=Q.prototype.tb,Q.prototype.iterateStatements=Q.prototype.Ub,Q.prototype.export=Q.prototype.Nb,Q.prototype.close=Q.prototype.close,Q.prototype.handleError=Q.prototype.handleError,Q.prototype.getRowsModified=Q.prototype.Rb,Q.prototype.create_function=Q.prototype.Kb,Q.prototype.create_aggregate=Q.prototype.Jb,Q.prototype.updateHook=Q.prototype.Zb,a.Database=Q};var u="./this.program",d=(b,x)=>{throw x},p=globalThis.document?.currentScript?.src;typeof __filename<"u"?p=__filename:c&&(p=self.location.href);var f="",h,m;if(l){var g=require("node:fs");f=__dirname+"/",m=b=>(b=E(b)?new URL(b):b,g.readFileSync(b)),h=async b=>(b=E(b)?new URL(b):b,g.readFileSync(b,void 0)),1<process.argv.length&&(u=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),typeof qc<"u"&&(qc.exports=a),d=(b,x)=>{throw process.exitCode=b,x}}else if(o||c){try{f=new URL(".",p).href}catch{}c&&(m=b=>{var x=new XMLHttpRequest;return x.open("GET",b,!1),x.responseType="arraybuffer",x.send(null),new Uint8Array(x.response)}),h=async b=>{if(E(b))return new Promise((P,U)=>{var Q=new XMLHttpRequest;Q.open("GET",b,!0),Q.responseType="arraybuffer",Q.onload=()=>{Q.status==200||Q.status==0&&Q.response?P(Q.response):U(Q.status)},Q.onerror=U,Q.send(null)});var x=await fetch(b,{credentials:"same-origin"});if(x.ok)return x.arrayBuffer();throw Error(x.status+" : "+x.url)}}var y=console.log.bind(console),_=console.error.bind(console),v,S=!1,w,E=b=>b.startsWith("file://"),k,N,O,V,te,W,$,H;function Y(){var b=wm.buffer;k=new Int8Array(b),O=new Int16Array(b),N=new Uint8Array(b),new Uint16Array(b),V=new Int32Array(b),te=new Uint32Array(b),W=new Float32Array(b),$=new Float64Array(b),H=new BigInt64Array(b),new BigUint64Array(b)}function ae(b){throw a.onAbort?.(b),b="Aborted("+b+")",_(b),S=!0,new WebAssembly.RuntimeError(b+". Build with -sASSERTIONS for more info.")}var K;async function D(b){if(!v)try{var x=await h(b);return new Uint8Array(x)}catch{}if(b==K&&v)b=new Uint8Array(v);else if(m)b=m(b);else throw"both async and sync fetching of the wasm failed";return b}async function A(b,x){try{var P=await D(b);return await WebAssembly.instantiate(P,x)}catch(U){_(`failed to asynchronously prepare wasm: ${U}`),ae(U)}}async function M(b){var x=K;if(!v&&!E(x)&&!l)try{var P=fetch(x,{credentials:"same-origin"});return await WebAssembly.instantiateStreaming(P,b)}catch(U){_(`wasm streaming compile failed: ${U}`),_("falling back to ArrayBuffer instantiation")}return A(x,b)}class z{name="ExitStatus";constructor(x){this.message=`Program terminated with exit(${x})`,this.status=x}}var ee=b=>{for(;0<b.length;)b.shift()(a)},le=[],Se=[],we=()=>{var b=a.preRun.shift();Se.push(b)},he=0,xe=null;function Ae(b,x="i8"){switch(x.endsWith("*")&&(x="*"),x){case"i1":return k[b];case"i8":return k[b];case"i16":return O[b>>1];case"i32":return V[b>>2];case"i64":return H[b>>3];case"float":return W[b>>2];case"double":return $[b>>3];case"*":return te[b>>2];default:ae(`invalid type for getValue: ${x}`)}}var ke=!0;function Xe(b){var x="i32";switch(x.endsWith("*")&&(x="*"),x){case"i1":k[b]=0;break;case"i8":k[b]=0;break;case"i16":O[b>>1]=0;break;case"i32":V[b>>2]=0;break;case"i64":H[b>>3]=BigInt(0);break;case"float":W[b>>2]=0;break;case"double":$[b>>3]=0;break;case"*":te[b>>2]=0;break;default:ae(`invalid type for setValue: ${x}`)}}var De=new TextDecoder,et=(b,x,P,U)=>{if(P=x+P,U)return P;for(;b[x]&&!(x>=P);)++x;return x},tt=(b,x,P)=>b?De.decode(N.subarray(b,et(N,b,x,P))):"",jt=(b,x)=>{for(var P=0,U=b.length-1;0<=U;U--){var Q=b[U];Q==="."?b.splice(U,1):Q===".."?(b.splice(U,1),P++):P&&(b.splice(U,1),P--)}if(x)for(;P;P--)b.unshift("..");return b},wt=b=>{var x=b.charAt(0)==="/",P=b.slice(-1)==="/";return(b=jt(b.split("/").filter(U=>!!U),!x).join("/"))||x||(b="."),b&&P&&(b+="/"),(x?"/":"")+b},zr=b=>{var x=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(b).slice(1);return b=x[0],x=x[1],!b&&!x?".":(x&&=x.slice(0,-1),b+x)},fe=b=>b&&b.match(/([^\/]+|\/)\/*$/)[1],ye=()=>{if(l){var b=require("node:crypto");return x=>b.randomFillSync(x)}return x=>crypto.getRandomValues(x)},Pe=b=>{(Pe=ye())(b)},Oe=(...b)=>{for(var x="",P=!1,U=b.length-1;-1<=U&&!P;U--){if(P=0<=U?b[U]:"/",typeof P!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!P)return"";x=P+"/"+x,P=P.charAt(0)==="/"}return x=jt(x.split("/").filter(Q=>!!Q),!P).join("/"),(P?"/":"")+x||"."},Qe=b=>{var x=et(b,0);return De.decode(b.buffer?b.subarray(0,x):new Uint8Array(b.slice(0,x)))},_t=[],St=b=>{for(var x=0,P=0;P<b.length;++P){var U=b.charCodeAt(P);127>=U?x++:2047>=U?x+=2:55296<=U&&57343>=U?(x+=4,++P):x+=3}return x},ir=(b,x,P,U)=>{if(!(0<U))return 0;var Q=P;U=P+U-1;for(var ce=0;ce<b.length;++ce){var ge=b.codePointAt(ce);if(127>=ge){if(P>=U)break;x[P++]=ge}else if(2047>=ge){if(P+1>=U)break;x[P++]=192|ge>>6,x[P++]=128|ge&63}else if(65535>=ge){if(P+2>=U)break;x[P++]=224|ge>>12,x[P++]=128|ge>>6&63,x[P++]=128|ge&63}else{if(P+3>=U)break;x[P++]=240|ge>>18,x[P++]=128|ge>>12&63,x[P++]=128|ge>>6&63,x[P++]=128|ge&63,ce++}}return x[P]=0,P-Q},tn=[];function ks(b,x){tn[b]={input:[],output:[],eb:x},xd(b,on)}var on={open(b){var x=tn[b.node.rdev];if(!x)throw new oe(43);b.tty=x,b.seekable=!1},close(b){b.tty.eb.fsync(b.tty)},fsync(b){b.tty.eb.fsync(b.tty)},read(b,x,P,U){if(!b.tty||!b.tty.eb.Bb)throw new oe(60);for(var Q=0,ce=0;ce<U;ce++){try{var ge=b.tty.eb.Bb(b.tty)}catch{throw new oe(29)}if(ge===void 0&&Q===0)throw new oe(6);if(ge==null)break;Q++,x[P+ce]=ge}return Q&&(b.node.atime=Date.now()),Q},write(b,x,P,U){if(!b.tty||!b.tty.eb.ub)throw new oe(60);try{for(var Q=0;Q<U;Q++)b.tty.eb.ub(b.tty,x[P+Q])}catch{throw new oe(29)}return U&&(b.node.mtime=b.node.ctime=Date.now()),Q}},Ni={Bb(){e:{if(!_t.length){var b=null;if(l){var x=Buffer.alloc(256),P=0,U=process.stdin.fd;try{P=g.readSync(U,x,0,256)}catch(Q){if(Q.toString().includes("EOF"))P=0;else throw Q}0<P&&(b=x.slice(0,P).toString("utf-8"))}else globalThis.window?.prompt&&(b=window.prompt("Input: "),b!==null&&(b+=`
|
|
65
|
-
`));if(!b){b=null;break e}x=Array(St(b)+1),b=ir(b,x,0,x.length),x.length=b,_t=x}b=_t.shift()}return b},ub(b,x){x===null||x===10?(y(Qe(b.output)),b.output=[]):x!=0&&b.output.push(x)},fsync(b){0<b.output?.length&&(y(Qe(b.output)),b.output=[])},hc(){return{bc:25856,dc:5,ac:191,cc:35387,$b:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}},ic(){return 0},jc(){return[24,80]}},qa={ub(b,x){x===null||x===10?(_(Qe(b.output)),b.output=[]):x!=0&&b.output.push(x)},fsync(b){0<b.output?.length&&(_(Qe(b.output)),b.output=[])}},ut={Wa:null,Xa(){return ut.createNode(null,"/",16895,0)},createNode(b,x,P,U){if((P&61440)===24576||(P&61440)===4096)throw new oe(63);return ut.Wa||(ut.Wa={dir:{node:{Ta:ut.La.Ta,Ua:ut.La.Ua,lookup:ut.La.lookup,ib:ut.La.ib,rename:ut.La.rename,unlink:ut.La.unlink,rmdir:ut.La.rmdir,readdir:ut.La.readdir,symlink:ut.La.symlink},stream:{Va:ut.Ma.Va}},file:{node:{Ta:ut.La.Ta,Ua:ut.La.Ua},stream:{Va:ut.Ma.Va,read:ut.Ma.read,write:ut.Ma.write,jb:ut.Ma.jb,kb:ut.Ma.kb}},link:{node:{Ta:ut.La.Ta,Ua:ut.La.Ua,readlink:ut.La.readlink},stream:{}},yb:{node:{Ta:ut.La.Ta,Ua:ut.La.Ua},stream:mm}}),P=qr(b,x,P,U),pr(P.mode)?(P.La=ut.Wa.dir.node,P.Ma=ut.Wa.dir.stream,P.Na={}):(P.mode&61440)===32768?(P.La=ut.Wa.file.node,P.Ma=ut.Wa.file.stream,P.Ra=0,P.Na=null):(P.mode&61440)===40960?(P.La=ut.Wa.link.node,P.Ma=ut.Wa.link.stream):(P.mode&61440)===8192&&(P.La=ut.Wa.yb.node,P.Ma=ut.Wa.yb.stream),P.atime=P.mtime=P.ctime=Date.now(),b&&(b.Na[x]=P,b.atime=b.mtime=b.ctime=P.atime),P},fc(b){return b.Na?b.Na.subarray?b.Na.subarray(0,b.Ra):new Uint8Array(b.Na):new Uint8Array(0)},La:{Ta(b){var x={};return x.dev=(b.mode&61440)===8192?b.id:1,x.ino=b.id,x.mode=b.mode,x.nlink=1,x.uid=0,x.gid=0,x.rdev=b.rdev,pr(b.mode)?x.size=4096:(b.mode&61440)===32768?x.size=b.Ra:(b.mode&61440)===40960?x.size=b.link.length:x.size=0,x.atime=new Date(b.atime),x.mtime=new Date(b.mtime),x.ctime=new Date(b.ctime),x.blksize=4096,x.blocks=Math.ceil(x.size/x.blksize),x},Ua(b,x){for(var P of["mode","atime","mtime","ctime"])x[P]!=null&&(b[P]=x[P]);x.size!==void 0&&(x=x.size,b.Ra!=x&&(x==0?(b.Na=null,b.Ra=0):(P=b.Na,b.Na=new Uint8Array(x),P&&b.Na.set(P.subarray(0,Math.min(x,b.Ra))),b.Ra=x)))},lookup(){throw ut.nb||(ut.nb=new oe(44),ut.nb.stack="<generic error, no stack>"),ut.nb},ib(b,x,P,U){return ut.createNode(b,x,P,U)},rename(b,x,P){try{var U=gr(x,P)}catch{}if(U){if(pr(b.mode))for(var Q in U.Na)throw new oe(55);Dr(U)}delete b.parent.Na[b.name],x.Na[P]=b,b.name=P,x.ctime=x.mtime=b.parent.ctime=b.parent.mtime=Date.now()},unlink(b,x){delete b.Na[x],b.ctime=b.mtime=Date.now()},rmdir(b,x){var P=gr(b,x),U;for(U in P.Na)throw new oe(55);delete b.Na[x],b.ctime=b.mtime=Date.now()},readdir(b){return[".","..",...Object.keys(b.Na)]},symlink(b,x,P){return b=ut.createNode(b,x,41471,0),b.link=P,b},readlink(b){if((b.mode&61440)!==40960)throw new oe(28);return b.link}},Ma:{read(b,x,P,U,Q){var ce=b.node.Na;if(Q>=b.node.Ra)return 0;if(b=Math.min(b.node.Ra-Q,U),8<b&&ce.subarray)x.set(ce.subarray(Q,Q+b),P);else for(U=0;U<b;U++)x[P+U]=ce[Q+U];return b},write(b,x,P,U,Q,ce){if(x.buffer===k.buffer&&(ce=!1),!U)return 0;if(b=b.node,b.mtime=b.ctime=Date.now(),x.subarray&&(!b.Na||b.Na.subarray)){if(ce)return b.Na=x.subarray(P,P+U),b.Ra=U;if(b.Ra===0&&Q===0)return b.Na=x.slice(P,P+U),b.Ra=U;if(Q+U<=b.Ra)return b.Na.set(x.subarray(P,P+U),Q),U}ce=Q+U;var ge=b.Na?b.Na.length:0;if(ge>=ce||(ce=Math.max(ce,ge*(1048576>ge?2:1.125)>>>0),ge!=0&&(ce=Math.max(ce,256)),ge=b.Na,b.Na=new Uint8Array(ce),0<b.Ra&&b.Na.set(ge.subarray(0,b.Ra),0)),b.Na.subarray&&x.subarray)b.Na.set(x.subarray(P,P+U),Q);else for(ce=0;ce<U;ce++)b.Na[Q+ce]=x[P+ce];return b.Ra=Math.max(b.Ra,Q+U),U},Va(b,x,P){if(P===1?x+=b.position:P===2&&(b.node.mode&61440)===32768&&(x+=b.node.Ra),0>x)throw new oe(28);return x},jb(b,x,P,U,Q){if((b.node.mode&61440)!==32768)throw new oe(43);if(b=b.node.Na,Q&2||!b||b.buffer!==k.buffer){Q=!0,U=65536*Math.ceil(x/65536);var ce=yO(65536,U);if(ce&&N.fill(0,ce,ce+U),U=ce,!U)throw new oe(48);b&&((0<P||P+x<b.length)&&(b.subarray?b=b.subarray(P,P+x):b=Array.prototype.slice.call(b,P,P+x)),k.set(b,U))}else Q=!1,U=b.byteOffset;return{Xb:U,Eb:Q}},kb(b,x,P,U){return ut.Ma.write(b,x,0,U,P,!1),0}}},Oi=(b,x)=>{var P=0;return b&&(P|=365),x&&(P|=146),P},jn=null,Cs={},Wa=[],hm=1,se=null,me=!1,_e=!0,oe=class{name="ErrnoError";constructor(b){this.Pa=b}},it=class{hb={};node=null;get flags(){return this.hb.flags}set flags(b){this.hb.flags=b}get position(){return this.hb.position}set position(b){this.hb.position=b}},Ve=class{La={};Ma={};bb=null;constructor(b,x,P,U){b||=this,this.parent=b,this.Xa=b.Xa,this.id=hm++,this.name=x,this.mode=P,this.rdev=U,this.atime=this.mtime=this.ctime=Date.now()}get read(){return(this.mode&365)===365}set read(b){b?this.mode|=365:this.mode&=-366}get write(){return(this.mode&146)===146}set write(b){b?this.mode|=146:this.mode&=-147}};function mt(b,x={}){if(!b)throw new oe(44);x.pb??(x.pb=!0),b.charAt(0)==="/"||(b="//"+b);var P=0;e:for(;40>P;P++){b=b.split("/").filter(vt=>!!vt);for(var U=jn,Q="/",ce=0;ce<b.length;ce++){var ge=ce===b.length-1;if(ge&&x.parent)break;if(b[ce]!==".")if(b[ce]==="..")if(Q=zr(Q),U===U.parent){b=Q+"/"+b.slice(ce+1).join("/"),P--;continue e}else U=U.parent;else{Q=wt(Q+"/"+b[ce]);try{U=gr(U,b[ce])}catch(vt){if(vt?.Pa===44&&ge&&x.Wb)return{path:Q};throw vt}if(!U.bb||ge&&!x.pb||(U=U.bb.root),(U.mode&61440)===40960&&(!ge||x.ab)){if(!U.La.readlink)throw new oe(52);U=U.La.readlink(U),U.charAt(0)==="/"||(U=zr(Q)+"/"+U),b=U+"/"+b.slice(ce+1).join("/");continue e}}}return{path:Q,node:U}}throw new oe(32)}function sr(b){for(var x;;){if(b===b.parent)return b=b.Xa.Db,x?b[b.length-1]!=="/"?`${b}/${x}`:b+x:b;x=x?`${b.name}/${x}`:b.name,b=b.parent}}function Et(b,x){for(var P=0,U=0;U<x.length;U++)P=(P<<5)-P+x.charCodeAt(U)|0;return(b+P>>>0)%se.length}function Dr(b){var x=Et(b.parent.id,b.name);if(se[x]===b)se[x]=b.cb;else for(x=se[x];x;){if(x.cb===b){x.cb=b.cb;break}x=x.cb}}function gr(b,x){var P=pr(b.mode)?(P=cn(b,"x"))?P:b.La.lookup?0:2:54;if(P)throw new oe(P);for(P=se[Et(b.id,x)];P;P=P.cb){var U=P.name;if(P.parent.id===b.id&&U===x)return P}return b.La.lookup(b,x)}function qr(b,x,P,U){return b=new Ve(b,x,P,U),x=Et(b.parent.id,b.name),b.cb=se[x],se[x]=b}function pr(b){return(b&61440)===16384}function cn(b,x){return _e?0:x.includes("r")&&!(b.mode&292)||x.includes("w")&&!(b.mode&146)||x.includes("x")&&!(b.mode&73)?2:0}function _i(b,x){if(!pr(b.mode))return 54;try{return gr(b,x),20}catch{}return cn(b,"wx")}function bi(b,x,P){try{var U=gr(b,x)}catch(Q){return Q.Pa}if(b=cn(b,"wx"))return b;if(P){if(!pr(U.mode))return 54;if(U===U.parent||sr(U)==="/")return 10}else if(pr(U.mode))return 31;return 0}function ni(b){if(!b)throw new oe(63);return b}function Wr(b){if(b=Wa[b],!b)throw new oe(8);return b}function ml(b,x=-1){if(b=Object.assign(new it,b),x==-1)e:{for(x=0;4096>=x;x++)if(!Wa[x])break e;throw new oe(33)}return b.fd=x,Wa[x]=b}function ii(b,x=-1){return b=ml(b,x),b.Ma?.ec?.(b),b}function Go(b,x,P){var U=b?.Ma.Ua;b=U?b:x,U??=x.La.Ua,ni(U),U(b,P)}var mm={open(b){b.Ma=Cs[b.node.rdev].Ma,b.Ma.open?.(b)},Va(){throw new oe(70)}};function xd(b,x){Cs[b]={Ma:x}}function Sd(b,x){var P=x==="/";if(P&&jn)throw new oe(10);if(!P&&x){var U=mt(x,{pb:!1});if(x=U.path,U=U.node,U.bb)throw new oe(10);if(!pr(U.mode))throw new oe(54)}x={type:b,kc:{},Db:x,Vb:[]},b=b.Xa(x),b.Xa=x,x.root=b,P?jn=b:U&&(U.bb=x,U.Xa&&U.Xa.Vb.push(x))}function Va(b,x,P){var U=mt(b,{parent:!0}).node;if(b=fe(b),!b)throw new oe(28);if(b==="."||b==="..")throw new oe(20);var Q=_i(U,b);if(Q)throw new oe(Q);if(!U.La.ib)throw new oe(63);return U.La.ib(U,b,x,P)}function ia(b,x=438){return Va(b,x&4095|32768,0)}function Bn(b,x=511){return Va(b,x&1023|16384,0)}function Zo(b,x,P){typeof P>"u"&&(P=x,x=438),Va(b,x|8192,P)}function gl(b,x){if(!Oe(b))throw new oe(44);var P=mt(x,{parent:!0}).node;if(!P)throw new oe(44);x=fe(x);var U=_i(P,x);if(U)throw new oe(U);if(!P.La.symlink)throw new oe(63);P.La.symlink(P,x,b)}function Td(b){var x=mt(b,{parent:!0}).node;b=fe(b);var P=gr(x,b),U=bi(x,b,!0);if(U)throw new oe(U);if(!x.La.rmdir)throw new oe(63);if(P.bb)throw new oe(10);x.La.rmdir(x,b),Dr(P)}function oO(b){var x=mt(b,{parent:!0}).node;if(!x)throw new oe(44);b=fe(b);var P=gr(x,b),U=bi(x,b,!1);if(U)throw new oe(U);if(!x.La.unlink)throw new oe(63);if(P.bb)throw new oe(10);x.La.unlink(x,b),Dr(P)}function wd(b,x){return b=mt(b,{ab:!x}).node,ni(b.La.Ta)(b)}function cO(b,x,P,U){Go(b,x,{mode:P&4095|x.mode&-4096,ctime:Date.now(),Lb:U})}function gm(b,x){b=typeof b=="string"?mt(b,{ab:!0}).node:b,cO(null,b,x)}function lO(b,x,P){if(pr(x.mode))throw new oe(31);if((x.mode&61440)!==32768)throw new oe(28);var U=cn(x,"w");if(U)throw new oe(U);Go(b,x,{size:P,timestamp:Date.now()})}function yl(b,x,P=438){if(b==="")throw new oe(44);if(typeof x=="string"){var U={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[x];if(typeof U>"u")throw Error(`Unknown file open mode: ${x}`);x=U}if(P=x&64?P&4095|32768:0,typeof b=="object")U=b;else{var Q=b.endsWith("/"),ce=mt(b,{ab:!(x&131072),Wb:!0});U=ce.node,b=ce.path}if(ce=!1,x&64)if(U){if(x&128)throw new oe(20)}else{if(Q)throw new oe(31);U=Va(b,P|511,0),ce=!0}if(!U)throw new oe(44);if((U.mode&61440)===8192&&(x&=-513),x&65536&&!pr(U.mode))throw new oe(54);if(!ce&&(U?(U.mode&61440)===40960?Q=32:(Q=["r","w","rw"][x&3],x&512&&(Q+="w"),Q=pr(U.mode)&&(Q!=="r"||x&576)?31:cn(U,Q)):Q=44,Q))throw new oe(Q);return x&512&&!ce&&(Q=U,Q=typeof Q=="string"?mt(Q,{ab:!0}).node:Q,lO(null,Q,0)),x=ml({node:U,path:sr(U),flags:x&-131713,seekable:!0,position:0,Ma:U.Ma,Yb:[],error:!1}),x.Ma.open&&x.Ma.open(x),ce&&gm(U,P&511),x}function ox(b){if(b.fd===null)throw new oe(8);b.rb&&(b.rb=null);try{b.Ma.close&&b.Ma.close(b)}catch(x){throw x}finally{Wa[b.fd]=null}b.fd=null}function uO(b,x,P){if(b.fd===null)throw new oe(8);if(!b.seekable||!b.Ma.Va)throw new oe(70);if(P!=0&&P!=1&&P!=2)throw new oe(28);b.position=b.Ma.Va(b,x,P),b.Yb=[]}function dO(b,x,P,U,Q){if(0>U||0>Q)throw new oe(28);if(b.fd===null)throw new oe(8);if((b.flags&2097155)===1)throw new oe(8);if(pr(b.node.mode))throw new oe(31);if(!b.Ma.read)throw new oe(28);var ce=typeof Q<"u";if(!ce)Q=b.position;else if(!b.seekable)throw new oe(70);return x=b.Ma.read(b,x,P,U,Q),ce||(b.position+=x),x}function pO(b,x,P,U,Q){if(0>U||0>Q)throw new oe(28);if(b.fd===null)throw new oe(8);if(!(b.flags&2097155))throw new oe(8);if(pr(b.node.mode))throw new oe(31);if(!b.Ma.write)throw new oe(28);b.seekable&&b.flags&1024&&uO(b,0,2);var ce=typeof Q<"u";if(!ce)Q=b.position;else if(!b.seekable)throw new oe(70);return x=b.Ma.write(b,x,P,U,Q,void 0),ce||(b.position+=x),x}function RV(b){var x=x||0,P="binary";P!=="utf8"&&P!=="binary"&&ae(`Invalid encoding type "${P}"`),x=yl(b,x),b=wd(b).size;var U=new Uint8Array(b);return dO(x,U,0,b,0),P==="utf8"&&(U=Qe(U)),ox(x),U}function Ka(b,x,P){b=wt("/dev/"+b);var U=Oi(!!x,!!P);Ka.Cb??(Ka.Cb=64);var Q=Ka.Cb++<<8|0;xd(Q,{open(ce){ce.seekable=!1},close(){P?.buffer?.length&&P(10)},read(ce,ge,vt,lr){for(var Ct=0,kr=0;kr<lr;kr++){try{var _n=x()}catch{throw new oe(29)}if(_n===void 0&&Ct===0)throw new oe(6);if(_n==null)break;Ct++,ge[vt+kr]=_n}return Ct&&(ce.node.atime=Date.now()),Ct},write(ce,ge,vt,lr){for(var Ct=0;Ct<lr;Ct++)try{P(ge[vt+Ct])}catch{throw new oe(29)}return lr&&(ce.node.mtime=ce.node.ctime=Date.now()),Ct}}),Zo(b,U,Q)}var Ar={};function Ho(b,x,P){if(x.charAt(0)==="/")return x;if(b=b===-100?"/":Wr(b).path,x.length==0){if(!P)throw new oe(44);return b}return b+"/"+x}function ym(b,x){te[b>>2]=x.dev,te[b+4>>2]=x.mode,te[b+8>>2]=x.nlink,te[b+12>>2]=x.uid,te[b+16>>2]=x.gid,te[b+20>>2]=x.rdev,H[b+24>>3]=BigInt(x.size),V[b+32>>2]=4096,V[b+36>>2]=x.blocks;var P=x.atime.getTime(),U=x.mtime.getTime(),Q=x.ctime.getTime();return H[b+40>>3]=BigInt(Math.floor(P/1e3)),te[b+48>>2]=P%1e3*1e6,H[b+56>>3]=BigInt(Math.floor(U/1e3)),te[b+64>>2]=U%1e3*1e6,H[b+72>>3]=BigInt(Math.floor(Q/1e3)),te[b+80>>2]=Q%1e3*1e6,H[b+88>>3]=BigInt(x.ino),0}var _m=void 0,bm=()=>{var b=V[+_m>>2];return _m+=4,b},cx=0,DV=[0,31,60,91,121,152,182,213,244,274,305,335],MV=[0,31,59,90,120,151,181,212,243,273,304,334],Ed={},fO=b=>{w=b,ke||0<cx||(a.onExit?.(b),S=!0),d(b,new z(b))},LV=b=>{if(!S)try{b()}catch(x){x instanceof z||x=="unwind"||d(1,x)}finally{if(!(ke||0<cx))try{w=b=w,fO(b)}catch(x){x instanceof z||x=="unwind"||d(1,x)}}},lx={},hO=()=>{if(!ux){var b={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(globalThis.navigator?.language??"C").replace("-","_")+".UTF-8",_:u||"./this.program"},x;for(x in lx)lx[x]===void 0?delete b[x]:b[x]=lx[x];var P=[];for(x in b)P.push(`${x}=${b[x]}`);ux=P}return ux},ux,FV=(b,x,P,U)=>{var Q={string:Ct=>{var kr=0;if(Ct!=null&&Ct!==0){kr=St(Ct)+1;var _n=Yo(kr);ir(Ct,N,_n,kr),kr=_n}return kr},array:Ct=>{var kr=Yo(Ct.length);return k.set(Ct,kr),kr}};b=a["_"+b];var ce=[],ge=0;if(U)for(var vt=0;vt<U.length;vt++){var lr=Q[P[vt]];lr?(ge===0&&(ge=Tm()),ce[vt]=lr(U[vt])):ce[vt]=U[vt]}return P=b(...ce),P=function(Ct){return ge!==0&&Sm(ge),x==="string"?tt(Ct):x==="boolean"?!!Ct:Ct}(P)},vm=b=>{var x=St(b)+1,P=xm(x);return P&&ir(b,N,P,x),P},Jo,dx=[],Ga=b=>{Jo.delete(Za.get(b)),Za.set(b,null),dx.push(b)},mO=b=>{let x=b.length;return[x%128|128,x>>7,...b]},jV={i:127,p:127,j:126,f:125,d:124,e:111},gO=b=>mO(Array.from(b,x=>jV[x])),Pd=(b,x)=>{if(!Jo){Jo=new WeakMap;var P=Za.length;if(Jo)for(var U=0;U<0+P;U++){var Q=Za.get(U);Q&&Jo.set(Q,U)}}if(P=Jo.get(b)||0)return P;P=dx.length?dx.pop():Za.grow(1);try{Za.set(P,b)}catch(ce){if(!(ce instanceof TypeError))throw ce;x=Uint8Array.of(0,97,115,109,1,0,0,0,1,...mO([1,96,...gO(x.slice(1)),...gO(x[0]==="v"?"":x[0])]),2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0),x=new WebAssembly.Module(x),x=new WebAssembly.Instance(x,{e:{f:b}}).exports.f,Za.set(P,x)}return Jo.set(b,P),P};if(se=Array(4096),Sd(ut,"/"),Bn("/tmp"),Bn("/home"),Bn("/home/web_user"),function(){Bn("/dev"),xd(259,{read:()=>0,write:(U,Q,ce,ge)=>ge,Va:()=>0}),Zo("/dev/null",259),ks(1280,Ni),ks(1536,qa),Zo("/dev/tty",1280),Zo("/dev/tty1",1536);var b=new Uint8Array(1024),x=0,P=()=>(x===0&&(Pe(b),x=b.byteLength),b[--x]);Ka("random",P),Ka("urandom",P),Bn("/dev/shm"),Bn("/dev/shm/tmp")}(),function(){Bn("/proc");var b=Bn("/proc/self");Bn("/proc/self/fd"),Sd({Xa(){var x=qr(b,"fd",16895,73);return x.Ma={Va:ut.Ma.Va},x.La={lookup(P,U){P=+U;var Q=Wr(P);return P={parent:null,Xa:{Db:"fake"},La:{readlink:()=>Q.path},id:P+1},P.parent=P},readdir(){return Array.from(Wa.entries()).filter(([,P])=>P).map(([P])=>P.toString())}},x}},"/proc/self/fd")}(),a.noExitRuntime&&(ke=a.noExitRuntime),a.print&&(y=a.print),a.printErr&&(_=a.printErr),a.wasmBinary&&(v=a.wasmBinary),a.thisProgram&&(u=a.thisProgram),a.preInit)for(typeof a.preInit=="function"&&(a.preInit=[a.preInit]);0<a.preInit.length;)a.preInit.shift()();a.stackSave=()=>Tm(),a.stackRestore=b=>Sm(b),a.stackAlloc=b=>Yo(b),a.cwrap=(b,x,P,U)=>{var Q=!P||P.every(ce=>ce==="number"||ce==="boolean");return x!=="string"&&Q&&!U?a["_"+b]:(...ce)=>FV(b,x,P,ce)},a.addFunction=Pd,a.removeFunction=Ga,a.UTF8ToString=tt,a.stringToNewUTF8=vm,a.writeArrayToMemory=(b,x)=>{k.set(b,x)};var xm,Id,yO,_O,Sm,Yo,Tm,wm,Za,BV={a:(b,x,P,U)=>ae(`Assertion failed: ${tt(b)}, at: `+[x?tt(x):"unknown filename",P,U?tt(U):"unknown function"]),i:function(b,x){try{return b=tt(b),gm(b,x),0}catch(P){if(typeof Ar>"u"||P.name!=="ErrnoError")throw P;return-P.Pa}},L:function(b,x,P){try{if(x=tt(x),x=Ho(b,x),P&-8)return-28;var U=mt(x,{ab:!0}).node;return U?(b="",P&4&&(b+="r"),P&2&&(b+="w"),P&1&&(b+="x"),b&&cn(U,b)?-2:0):-44}catch(Q){if(typeof Ar>"u"||Q.name!=="ErrnoError")throw Q;return-Q.Pa}},j:function(b,x){try{var P=Wr(b);return cO(P,P.node,x,!1),0}catch(U){if(typeof Ar>"u"||U.name!=="ErrnoError")throw U;return-U.Pa}},h:function(b){try{var x=Wr(b);return Go(x,x.node,{timestamp:Date.now(),Lb:!1}),0}catch(P){if(typeof Ar>"u"||P.name!=="ErrnoError")throw P;return-P.Pa}},b:function(b,x,P){_m=P;try{var U=Wr(b);switch(x){case 0:var Q=bm();if(0>Q)break;for(;Wa[Q];)Q++;return ii(U,Q).fd;case 1:case 2:return 0;case 3:return U.flags;case 4:return Q=bm(),U.flags|=Q,0;case 12:return Q=bm(),O[Q+0>>1]=2,0;case 13:case 14:return 0}return-28}catch(ce){if(typeof Ar>"u"||ce.name!=="ErrnoError")throw ce;return-ce.Pa}},g:function(b,x){try{var P=Wr(b),U=P.node,Q=P.Ma.Ta;b=Q?P:U,Q??=U.La.Ta,ni(Q);var ce=Q(b);return ym(x,ce)}catch(ge){if(typeof Ar>"u"||ge.name!=="ErrnoError")throw ge;return-ge.Pa}},H:function(b,x){x=-9007199254740992>x||9007199254740992<x?NaN:Number(x);try{if(isNaN(x))return-61;var P=Wr(b);if(0>x||!(P.flags&2097155))throw new oe(28);return lO(P,P.node,x),0}catch(U){if(typeof Ar>"u"||U.name!=="ErrnoError")throw U;return-U.Pa}},G:function(b,x){try{if(x===0)return-28;var P=St("/")+1;return x<P?-68:(ir("/",N,b,x),P)}catch(U){if(typeof Ar>"u"||U.name!=="ErrnoError")throw U;return-U.Pa}},K:function(b,x){try{return b=tt(b),ym(x,wd(b,!0))}catch(P){if(typeof Ar>"u"||P.name!=="ErrnoError")throw P;return-P.Pa}},C:function(b,x,P){try{return x=tt(x),x=Ho(b,x),Bn(x,P),0}catch(U){if(typeof Ar>"u"||U.name!=="ErrnoError")throw U;return-U.Pa}},J:function(b,x,P,U){try{x=tt(x);var Q=U&256;return x=Ho(b,x,U&4096),ym(P,Q?wd(x,!0):wd(x))}catch(ce){if(typeof Ar>"u"||ce.name!=="ErrnoError")throw ce;return-ce.Pa}},x:function(b,x,P,U){_m=U;try{x=tt(x),x=Ho(b,x);var Q=U?bm():0;return yl(x,P,Q).fd}catch(ce){if(typeof Ar>"u"||ce.name!=="ErrnoError")throw ce;return-ce.Pa}},v:function(b,x,P,U){try{if(x=tt(x),x=Ho(b,x),0>=U)return-28;var Q=mt(x).node;if(!Q)throw new oe(44);if(!Q.La.readlink)throw new oe(28);var ce=Q.La.readlink(Q),ge=Math.min(U,St(ce)),vt=k[P+ge];return ir(ce,N,P,U+1),k[P+ge]=vt,ge}catch(lr){if(typeof Ar>"u"||lr.name!=="ErrnoError")throw lr;return-lr.Pa}},u:function(b){try{return b=tt(b),Td(b),0}catch(x){if(typeof Ar>"u"||x.name!=="ErrnoError")throw x;return-x.Pa}},f:function(b,x){try{return b=tt(b),ym(x,wd(b))}catch(P){if(typeof Ar>"u"||P.name!=="ErrnoError")throw P;return-P.Pa}},r:function(b,x,P){try{if(x=tt(x),x=Ho(b,x),P)if(P===512)Td(x);else return-28;else oO(x);return 0}catch(U){if(typeof Ar>"u"||U.name!=="ErrnoError")throw U;return-U.Pa}},q:function(b,x,P){try{x=tt(x),x=Ho(b,x,!0);var U=Date.now(),Q,ce;if(P){var ge=te[P>>2]+4294967296*V[P+4>>2],vt=V[P+8>>2];vt==1073741823?Q=U:vt==1073741822?Q=null:Q=1e3*ge+vt/1e6,P+=16,ge=te[P>>2]+4294967296*V[P+4>>2],vt=V[P+8>>2],vt==1073741823?ce=U:vt==1073741822?ce=null:ce=1e3*ge+vt/1e6}else ce=Q=U;if((ce??Q)!==null){b=Q;var lr=mt(x,{ab:!0}).node;ni(lr.La.Ua)(lr,{atime:b,mtime:ce})}return 0}catch(Ct){if(typeof Ar>"u"||Ct.name!=="ErrnoError")throw Ct;return-Ct.Pa}},m:()=>ae(""),l:()=>{ke=!1,cx=0},A:function(b,x){b=-9007199254740992>b||9007199254740992<b?NaN:Number(b),b=new Date(1e3*b),V[x>>2]=b.getSeconds(),V[x+4>>2]=b.getMinutes(),V[x+8>>2]=b.getHours(),V[x+12>>2]=b.getDate(),V[x+16>>2]=b.getMonth(),V[x+20>>2]=b.getFullYear()-1900,V[x+24>>2]=b.getDay();var P=b.getFullYear();V[x+28>>2]=(P%4!==0||P%100===0&&P%400!==0?MV:DV)[b.getMonth()]+b.getDate()-1|0,V[x+36>>2]=-(60*b.getTimezoneOffset()),P=new Date(b.getFullYear(),6,1).getTimezoneOffset();var U=new Date(b.getFullYear(),0,1).getTimezoneOffset();V[x+32>>2]=(P!=U&&b.getTimezoneOffset()==Math.min(U,P))|0},y:function(b,x,P,U,Q,ce,ge){Q=-9007199254740992>Q||9007199254740992<Q?NaN:Number(Q);try{var vt=Wr(U);if(x&2&&!(P&2)&&(vt.flags&2097155)!==2)throw new oe(2);if((vt.flags&2097155)===1)throw new oe(2);if(!vt.Ma.jb)throw new oe(43);if(!b)throw new oe(28);var lr=vt.Ma.jb(vt,b,Q,x,P),Ct=lr.Xb;return V[ce>>2]=lr.Eb,te[ge>>2]=Ct,0}catch(kr){if(typeof Ar>"u"||kr.name!=="ErrnoError")throw kr;return-kr.Pa}},z:function(b,x,P,U,Q,ce){ce=-9007199254740992>ce||9007199254740992<ce?NaN:Number(ce);try{var ge=Wr(Q);if(P&2){if(P=ce,(ge.node.mode&61440)!==32768)throw new oe(43);if(!(U&2)){var vt=N.slice(b,b+x);ge.Ma.kb&&ge.Ma.kb(ge,vt,P,x,U)}}}catch(lr){if(typeof Ar>"u"||lr.name!=="ErrnoError")throw lr;return-lr.Pa}},n:(b,x)=>{if(Ed[b]&&(clearTimeout(Ed[b].id),delete Ed[b]),!x)return 0;var P=setTimeout(()=>{delete Ed[b],LV(()=>_O(b,performance.now()))},x);return Ed[b]={id:P,lc:x},0},B:(b,x,P,U)=>{var Q=new Date().getFullYear(),ce=new Date(Q,0,1).getTimezoneOffset();Q=new Date(Q,6,1).getTimezoneOffset(),te[b>>2]=60*Math.max(ce,Q),V[x>>2]=+(ce!=Q),x=ge=>{var vt=Math.abs(ge);return`UTC${0<=ge?"-":"+"}${String(Math.floor(vt/60)).padStart(2,"0")}${String(vt%60).padStart(2,"0")}`},b=x(ce),x=x(Q),Q<ce?(ir(b,N,P,17),ir(x,N,U,17)):(ir(b,N,U,17),ir(x,N,P,17))},d:()=>Date.now(),s:()=>2147483648,c:()=>performance.now(),o:b=>{var x=N.length;if(b>>>=0,2147483648<b)return!1;for(var P=1;4>=P;P*=2){var U=x*(1+.2/P);U=Math.min(U,b+100663296);e:{U=(Math.min(2147483648,65536*Math.ceil(Math.max(b,U)/65536))-wm.buffer.byteLength+65535)/65536|0;try{wm.grow(U),Y();var Q=1;break e}catch{}Q=void 0}if(Q)return!0}return!1},E:(b,x)=>{var P=0,U=0,Q;for(Q of hO()){var ce=x+P;te[b+U>>2]=ce,P+=ir(Q,N,ce,1/0)+1,U+=4}return 0},F:(b,x)=>{var P=hO();te[b>>2]=P.length,b=0;for(var U of P)b+=St(U)+1;return te[x>>2]=b,0},e:function(b){try{var x=Wr(b);return ox(x),0}catch(P){if(typeof Ar>"u"||P.name!=="ErrnoError")throw P;return P.Pa}},p:function(b,x){try{var P=Wr(b);return k[x]=P.tty?2:pr(P.mode)?3:(P.mode&61440)===40960?7:4,O[x+2>>1]=0,H[x+8>>3]=BigInt(0),H[x+16>>3]=BigInt(0),0}catch(U){if(typeof Ar>"u"||U.name!=="ErrnoError")throw U;return U.Pa}},w:function(b,x,P,U){try{e:{var Q=Wr(b);b=x;for(var ce,ge=x=0;ge<P;ge++){var vt=te[b>>2],lr=te[b+4>>2];b+=8;var Ct=dO(Q,k,vt,lr,ce);if(0>Ct){var kr=-1;break e}if(x+=Ct,Ct<lr)break;typeof ce<"u"&&(ce+=Ct)}kr=x}return te[U>>2]=kr,0}catch(_n){if(typeof Ar>"u"||_n.name!=="ErrnoError")throw _n;return _n.Pa}},D:function(b,x,P,U){x=-9007199254740992>x||9007199254740992<x?NaN:Number(x);try{if(isNaN(x))return 61;var Q=Wr(b);return uO(Q,x,P),H[U>>3]=BigInt(Q.position),Q.rb&&x===0&&P===0&&(Q.rb=null),0}catch(ce){if(typeof Ar>"u"||ce.name!=="ErrnoError")throw ce;return ce.Pa}},I:function(b){try{var x=Wr(b);return x.Ma?.fsync?.(x)}catch(P){if(typeof Ar>"u"||P.name!=="ErrnoError")throw P;return P.Pa}},t:function(b,x,P,U){try{e:{var Q=Wr(b);b=x;for(var ce,ge=x=0;ge<P;ge++){var vt=te[b>>2],lr=te[b+4>>2];b+=8;var Ct=pO(Q,k,vt,lr,ce);if(0>Ct){var kr=-1;break e}if(x+=Ct,Ct<lr)break;typeof ce<"u"&&(ce+=Ct)}kr=x}return te[U>>2]=kr,0}catch(_n){if(typeof Ar>"u"||_n.name!=="ErrnoError")throw _n;return _n.Pa}},k:fO};function px(){function b(){if(a.calledRun=!0,!S){if(!a.noFSInit&&!me){var x,P;me=!0,x??=a.stdin,P??=a.stdout,U??=a.stderr,x?Ka("stdin",x):gl("/dev/tty","/dev/stdin"),P?Ka("stdout",null,P):gl("/dev/tty","/dev/stdout"),U?Ka("stderr",null,U):gl("/dev/tty1","/dev/stderr"),yl("/dev/stdin",0),yl("/dev/stdout",1),yl("/dev/stderr",1)}if(fx.N(),_e=!1,a.onRuntimeInitialized?.(),a.postRun)for(typeof a.postRun=="function"&&(a.postRun=[a.postRun]);a.postRun.length;){var U=a.postRun.shift();le.push(U)}ee(le)}}if(0<he)xe=px;else{if(a.preRun)for(typeof a.preRun=="function"&&(a.preRun=[a.preRun]);a.preRun.length;)we();ee(Se),0<he?xe=px:a.setStatus?(a.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>a.setStatus(""),1),b()},1)):b()}}var fx;return async function(){function b(P){return P=fx=P.exports,a._sqlite3_free=P.P,a._sqlite3_value_text=P.Q,a._sqlite3_prepare_v2=P.R,a._sqlite3_step=P.S,a._sqlite3_reset=P.T,a._sqlite3_exec=P.U,a._sqlite3_finalize=P.V,a._sqlite3_column_name=P.W,a._sqlite3_column_text=P.X,a._sqlite3_column_type=P.Y,a._sqlite3_errmsg=P.Z,a._sqlite3_clear_bindings=P._,a._sqlite3_value_blob=P.$,a._sqlite3_value_bytes=P.aa,a._sqlite3_value_double=P.ba,a._sqlite3_value_int=P.ca,a._sqlite3_value_type=P.da,a._sqlite3_result_blob=P.ea,a._sqlite3_result_double=P.fa,a._sqlite3_result_error=P.ga,a._sqlite3_result_int=P.ha,a._sqlite3_result_int64=P.ia,a._sqlite3_result_null=P.ja,a._sqlite3_result_text=P.ka,a._sqlite3_aggregate_context=P.la,a._sqlite3_column_count=P.ma,a._sqlite3_data_count=P.na,a._sqlite3_column_blob=P.oa,a._sqlite3_column_bytes=P.pa,a._sqlite3_column_double=P.qa,a._sqlite3_bind_blob=P.ra,a._sqlite3_bind_double=P.sa,a._sqlite3_bind_int=P.ta,a._sqlite3_bind_text=P.ua,a._sqlite3_bind_parameter_index=P.va,a._sqlite3_sql=P.wa,a._sqlite3_normalized_sql=P.xa,a._sqlite3_changes=P.ya,a._sqlite3_close_v2=P.za,a._sqlite3_create_function_v2=P.Aa,a._sqlite3_update_hook=P.Ba,a._sqlite3_open=P.Ca,xm=a._malloc=P.Da,Id=a._free=P.Ea,a._RegisterExtensionFunctions=P.Fa,yO=P.Ga,_O=P.Ha,Sm=P.Ia,Yo=P.Ja,Tm=P.Ka,wm=P.M,Za=P.O,Y(),he--,a.monitorRunDependencies?.(he),he==0&&xe&&(P=xe,xe=null,P()),fx}he++,a.monitorRunDependencies?.(he);var x={a:BV};return a.instantiateWasm?new Promise(P=>{a.instantiateWasm(x,(U,Q)=>{P(b(U,Q))})}):(K??=a.locateFile?a.locateFile("sql-wasm.wasm",f):f+"sql-wasm.wasm",b((await M(x)).instance))}(),px(),n}),xb)};typeof Tb=="object"&&typeof qc=="object"?(qc.exports=Sb,qc.exports.default=Sb):typeof define=="function"&&define.amd?define([],function(){return Sb}):typeof Tb=="object"&&(Tb.Module=Sb)});var Ab={};zn(Ab,{parseIntent:()=>rq,searchFindings:()=>nLe});function rq(e,t){let r={scope:{},keywords:[],raw:e};if(!e||typeof e!="string")return r;let n=e.trim();/\b(error|errors|critical)\b/i.test(n)?r.severity="error":/\b(warning|warnings|warn)\b/i.test(n)?r.severity="warning":/\b(info|informational)\b/i.test(n)&&(r.severity="info");let s=n.match(YMe),a=n.match(XMe);if(a){let l=(s?.[1]??"").toUpperCase(),u=a[1],p=t.getWorking()?.apiIndex??{},f=Object.values(p).filter(h=>!h||l&&String(h.method??"").toUpperCase()!==l?!1:String(h.route??"").toLowerCase()===u.toLowerCase());if(f.length===1){let h=f[0];r.scope.entryPointId=`${String(h.method).toUpperCase()}:${h.route}`}}let o=n.toLowerCase();for(let l of QMe){let u=o.indexOf(l);if(u===-1)continue;let p=o.slice(Math.max(0,u-32),u+l.length+32).match(/[a-z0-9_-]+\s+(?:cluster|feature|module|area)|(?:cluster|feature|module|area)[:\s]+([a-z0-9_-]+)/i);if(p){let h=(p[1]??p[0].split(/\s+/)[0]).replace(/^(cluster|feature|module|area)$/i,"").replace(/[:.]+$/,"").trim();h&&(r.scope.clusterId=`cluster:${h}`);break}}if(eLe.some(l=>o.includes(l))){let l=t.getWorking(),u=Object.keys(l?.files??{});for(let d of u){let p=d.split("/").pop()?.replace(/\.[^.]+$/,"")??"";if(p.length<4)continue;if(new RegExp(`\\b${p.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\b`,"i").test(n)){r.scope.filePath=d;break}}}let c=n.toLowerCase().split(/[^a-z0-9_-]+/).filter(l=>l&&l.length>2&&!tLe.has(l));return r.keywords=Array.from(new Set(c)),r}function rLe(e,t){let r=0;t.scope.entryPointId&&e.entryPointId===t.scope.entryPointId&&(r+=50),t.scope.clusterId&&e.bindings.some(a=>a.graphId.endsWith(t.scope.clusterId)||a.graphId.includes(t.scope.clusterId))&&(r+=35),t.scope.filePath&&e.anchor?.filePath===t.scope.filePath&&(r+=30),t.scope.filePath&&e.bindings.some(a=>a.graphId.includes(t.scope.filePath))&&(r+=20),t.severity&&e.severity===t.severity&&(r+=8);let n=`${e.title} ${e.body} ${e.category} ${e.entryPointId}`.toLowerCase();for(let a of t.keywords)e.title.toLowerCase().includes(a)?r+=6:n.includes(a)&&(r+=2);let s=Date.now()-Date.parse(e.updatedAt||e.createdAt||new Date().toISOString());if(Number.isFinite(s)&&s>=0){let a=s/864e5;r+=Math.max(0,5-a)}return r}function nLe(e,t,r=20){let n=rq(t,e),s=e.listAiReviewFindings({status:"open"}),a=[];for(let o of s){let c=rLe(o,n);if(c<=0)continue;let l=[];n.scope.entryPointId&&o.entryPointId===n.scope.entryPointId&&l.push("entry-point match"),n.scope.clusterId&&o.bindings.some(d=>d.graphId.includes(n.scope.clusterId))&&l.push("cluster match"),n.scope.filePath&&o.anchor?.filePath===n.scope.filePath&&l.push("file match"),n.keywords.some(d=>o.title.toLowerCase().includes(d))&&l.push("keyword in title"),a.push({finding:o,score:c,reason:l.join(" + ")||"keyword"})}return a.sort((o,c)=>c.score-o.score),{intent:n,matches:a.slice(0,r),totalScanned:s.length}}var YMe,XMe,QMe,eLe,tLe,kb=Kt(()=>{"use strict";YMe=/\b(GET|POST|PUT|PATCH|DELETE|HEAD|OPTIONS)\b/i,XMe=/(\/(?:[a-z0-9_:.-]+|\{[^}]+\}|:[a-z0-9_]+)+)/i,QMe=["cluster","feature","module","area"],eLe=["file","in ","inside "],tLe=new Set(["a","an","and","are","as","at","be","by","do","for","from","has","have","in","into","is","it","me","of","on","or","show","that","the","this","to","was","what","when","where","which","why","with","about","find","findings","finding","review","ai"])});function _h(e,t){let r=yu(e,t),n=[],s=oFe(r),a=cFe(r);return Hu(r,{ForStatement(o){let c=o.node;if(c.init?.type!=="VariableDeclaration"||c.init.declarations?.length!==1)return;let l=c.init.declarations[0];if(l.id?.type!=="Identifier")return;let u=l.id.name,d=Pq(l.init,r);if(d===null)return;let p=c.test;if(p?.type!=="BinaryExpression"||p.left?.type!=="Identifier"||p.left.name!==u)return;let f;if(p.operator==="<=")f=!0;else if(p.operator==="<")f=!1;else return;let h=Pq(p.right,r);if(h===null)return;let m=uFe(c.update,u);if(m===null||m<=0||m>1e3)return;let g=f?Math.floor((h-d)/m)+1:Math.floor((h-1-d)/m)+1;if(g<=0)return;let y=f?h:h-1;o.traverse({CallExpression(_){let v=_.node;if(v.callee?.type!=="MemberExpression")return;let S=v.callee.property?.name?.toLowerCase();if(!S||!wq.has(S))return;let w=v.arguments||[];if(w.length<2)return;let E=w[0];if(E.type!=="TemplateLiteral")return;let k="",N=!0;for(let H=0;H<E.quasis.length;H++)if(k+=E.quasis[H].value.raw,H<E.expressions.length){let Y=E.expressions[H];if(Y?.type==="Identifier"&&Y.name===u)k+=`:${u}`;else{N=!1;break}}if(!N||!k.startsWith("/")&&k!=="*")return;let O=w[w.length-1],V="",te=null;O.type==="Identifier"?V=O.name:O.type==="ArrowFunctionExpression"||O.type==="FunctionExpression"?(V=O.id?.name||`anonymous@${S.toUpperCase()}:${k}`,te=O):O.type==="MemberExpression"&&O.property?.type==="Identifier"&&(V=O.property.name);let W=`${S.toUpperCase()}:${k}::${t}::${V}`,$=te?{start:te.start??0,end:te.end??0}:{start:v.start??0,end:v.end??0};n.push({apiId:W,method:S.toUpperCase(),route:k,handlerName:V,filePath:t,anchor:{filePath:t,symbol:V,span:$},meta:{dynamicRange:{var:u,from:d,to:y,step:m,count:g}}}),_.skip()}})},CallExpression(o){let c=o.node,l=c.callee;if(l.type==="MemberExpression"&&l.property?.type==="Identifier"&&l.property.name==="use"){let u=c.arguments||[],d=u[u.length-1];if(d&&(d.type==="ArrowFunctionExpression"||d.type==="FunctionExpression")&&Array.isArray(d.params)&&d.params.length===4){let p=d.id?.name||"errorHandler",f="/*",h=`MIDDLEWARE:${f}::${t}::${p}`;n.push({apiId:h,method:"MIDDLEWARE",route:f,handlerName:p,filePath:t,anchor:{filePath:t,symbol:p,span:{start:c.start??0,end:c.end??0}},meta:{error:!0}});return}}if(l.type==="MemberExpression"){let u=l.property?.name?.toLowerCase();if(!u||!wq.has(u))return;let d=c.arguments||[];if(d.length<1)return;let p=d[0],f="",h=1;if(p.type==="StringLiteral"?f=p.value:p.type==="TemplateLiteral"&&p.quasis?.length===1?f=p.quasis[0].value.raw:(f=aFe(l.object),h=0),!f||d.length<h+1||!f.startsWith("/")&&f!=="*")return;let m=d[d.length-1],g="";if(m.type==="Identifier"){if(g=m.name,sFe(o,m.name))return}else m.type==="ArrowFunctionExpression"||m.type==="FunctionExpression"?g=m.id?.name||`anonymous@${u.toUpperCase()}:${f}`:m.type==="MemberExpression"&&m.property?.type==="Identifier"&&typeof m.property.name=="string"&&(g=m.property.name);let y=`${u.toUpperCase()}:${f}::${t}::${g}`,_=[];for(let w=h;w<d.length-1;w++){let E=d[w];if(E?.type==="ObjectExpression"){let N=lFe(E);_.push(...N);continue}let k=Vc(E);k&&_.push(k)}for(let w of s)if(w.matcher.test(f))for(let E of w.mws)_.includes(E)||_.push(E);for(let w of a)_.includes(w)||_.push(w);let v;for(let w of _){if(/(?:^|\.)auth\.required$/i.test(w)||/^auth$/i.test(w)||/^authRequired$/i.test(w)||/^authMiddleware$/i.test(w)||/^requireAuth$/i.test(w)||/^isAuthenticated$/i.test(w)||/^ensureAuth(?:enticated)?$/i.test(w)||/^basicAuth$/i.test(w)||/^bearerAuth$/i.test(w)||/^jwt(?:Auth)?$/i.test(w)||/(?:^|\.)passport\.authenticate$/i.test(w)||/^expressJwt$/i.test(w)||/^koaJwt$/i.test(w)){v="required";break}(/(?:^|\.)auth\.optional$/i.test(w)||/^optionalAuth$/i.test(w))&&(v="optional")}if(!v){let w=c,E=o;for(;E&&!w?.leadingComments?.length&&(E=E.parentPath,!!E);)w=E.node;let k=dFe(w?.leadingComments);k&&(v=k)}let S={};_.length>0&&(S.middlewares=_),v&&(S.auth=v),n.push({apiId:y,method:u.toUpperCase(),route:f,handlerName:g,filePath:t,anchor:{filePath:t,symbol:g,span:{start:c.start??0,end:c.end??0}},...Object.keys(S).length>0?{meta:S}:{}})}}}),n}function sFe(e,t){let r=e.scope?.getProgramParent?.()?.block;if(!r?.body)return!1;let n=!1;for(let a of r.body)if(a.type==="VariableDeclaration")for(let o of a.declarations??[]){if(o.id?.type!=="Identifier"||o.id.name!==t)continue;let c=o.init;if(c){if(c.type==="ConditionalExpression"){let l=u=>u?.type==="CallExpression"||u?.type==="AwaitExpression"&&u.argument?.type==="CallExpression";(l(c.consequent)||l(c.alternate))&&(n=!0)}c.type==="CallExpression"&&c.callee?.type==="Identifier"&&(n=!0)}}let s=e.scope;for(;s;){let a=s.bindings?.[t];if(a&&a.path?.node?.type==="VariableDeclarator"){let o=a.path.node.init;if(o?.type==="ConditionalExpression"){let c=l=>l?.type==="CallExpression"||l?.type==="AwaitExpression"&&l.argument?.type==="CallExpression";if(c(o.consequent)||c(o.alternate)){n=!0;break}}if(o?.type==="CallExpression"&&o.callee?.type==="Identifier"){n=!0;break}}s=s.parent}return n}function aFe(e){let t=e;for(;t;)if(t.type==="CallExpression"){let r=t.callee;if(r?.type==="MemberExpression"&&r.property?.name==="route"){let n=t.arguments?.[0];return n?.type==="StringLiteral"?n.value:n?.type==="TemplateLiteral"&&n.quasis?.length===1?n.quasis[0].value.raw:""}t=r?.object}else if(t.type==="MemberExpression")t=t.object;else return"";return""}function oFe(e){let t=[];return Hu(e,{CallExpression(r){let n=r.node.callee;if(n?.type!=="MemberExpression"||n.property?.name!=="use")return;let s=r.node.arguments||[];if(s.length<2)return;let a=s[0];if(a?.type!=="StringLiteral")return;let o=a.value;if(!o.startsWith("/")&&o!=="*")return;let c=[];for(let u=1;u<s.length;u++){let d=s[u];if(d?.type==="ObjectExpression")continue;let p=Vc(d);p&&c.push(p)}if(c.length===0)return;let l;o==="*"?l="^/.*$":l="^"+o.replace(/[.+?^${}()|[\]\\]/g,"\\$&").replace(/\\\*/g,".*")+"(?:/.*)?$",t.push({matcher:new RegExp(l),mws:c})}}),t}function cFe(e){let t=[];return Hu(e,{CallExpression(r){let n=r.node.callee;if(n?.type!=="MemberExpression"||n.property?.name!=="use")return;let s=r.node.arguments||[];if(s.length!==1)return;let a=s[0];if(a?.type==="StringLiteral")return;let o=Vc(a);if(!o)return;let c=o.includes(".")?o.split(".").pop():o;(Eq.test(o)||Eq.test(c))&&(t.includes(o)||t.push(o))}}),t}function lFe(e){let t=new Set(["preHandler","onRequest","preValidation","preParsing","preSerialization","onResponse","onError","onSend"]),r=[];for(let n of e.properties??[]){if(n.type!=="ObjectProperty"&&n.type!=="Property")continue;let s=n.key?.type==="Identifier"?n.key.name:n.key?.type==="StringLiteral"?n.key.value:"";if(!t.has(s))continue;let a=n.value;if(a)if(a.type==="ArrayExpression")for(let o of a.elements??[]){let c=Vc(o);c&&r.push(c)}else{let o=Vc(a);o&&r.push(o)}}return r}function Pq(e,t){if(!e)return null;if(e.type==="NumericLiteral")return e.value;if(e.type==="UnaryExpression"&&e.operator==="-"&&e.argument?.type==="NumericLiteral")return-e.argument.value;if(e.type==="Identifier"){let r=t?.program?.body||[];for(let n of r){let s=n;if(s.type==="ExportNamedDeclaration"&&s.declaration&&(s=s.declaration),s.type==="VariableDeclaration"){for(let a of s.declarations??[])if(a.id?.type==="Identifier"&&a.id.name===e.name){if(a.init?.type==="NumericLiteral")return a.init.value;if(a.init?.type==="UnaryExpression"&&a.init.operator==="-"&&a.init.argument?.type==="NumericLiteral")return-a.init.argument.value}}}}return null}function uFe(e,t){if(!e)return null;if(e.type==="UpdateExpression"&&e.argument?.type==="Identifier"&&e.argument.name===t){if(e.operator==="++")return 1;if(e.operator==="--")return-1}if(e.type==="AssignmentExpression"&&e.left?.type==="Identifier"&&e.left.name===t){if(e.operator==="+="&&e.right?.type==="NumericLiteral")return e.right.value;if(e.operator==="-="&&e.right?.type==="NumericLiteral")return-e.right.value;if(e.operator==="="&&e.right?.type==="BinaryExpression"){let r=e.right;if(r.operator==="+"&&r.left?.type==="Identifier"&&r.left.name===t&&r.right?.type==="NumericLiteral")return r.right.value}}return null}function Vc(e){if(!e)return"";if(e.type==="Identifier")return e.name||"";if(e.type==="MemberExpression"){let t=Vc(e.object),r=e.property?.type==="Identifier"?e.property.name:"";return t&&r?`${t}.${r}`:r||t||""}return e.type==="CallExpression"?Vc(e.callee):""}function dFe(e){if(!(!e||e.length===0))for(let t of e){let n=(t?.value??"").match(/@auth\s+(required|optional|none)\b/i);if(n){let s=n[1].toLowerCase();return s==="required"?"required":s==="optional"?"optional":void 0}}}function pFe(e){let t;try{t=Vs(e)}catch{return[]}let r=new Map,n=new Map;Hu(t,{ImportDeclaration(a){let o=a.node.source?.value??"";for(let c of a.node.specifiers??[]){let l=c.local?.name??"";l&&r.set(l,o)}},VariableDeclarator(a){let o=a.node.init;if(!o||o.type!=="CallExpression")return;let c=o.callee;if(c.type==="Identifier"&&c.name==="require"){let l=o.arguments?.[0];if(!l||l.type!=="StringLiteral")return;let u=a.node.id?.name??"";u&&r.set(u,l.value)}}}),Hu(t,{VariableDeclarator(a){let o=a.node.init;if(!o||o.type!=="CallExpression"||a.node.id?.type!=="Identifier")return;let c=a.node.id.name,l=[],u=o;for(;u&&u.type==="CallExpression";){let d=u.callee;if(d?.type==="MemberExpression"&&d.property?.name==="use"){let p=u.arguments||[],f=p[p.length-1],h=p[0];if(h?.type==="StringLiteral"&&h.value.startsWith("/"))return;if(f?.type==="Identifier"){let m=r.get(f.name);m&&l.push(m)}u=d.object}else break}l.length>0&&n.set(c,l.reverse())}});let s=[];return Hu(t,{CallExpression(a){let o=a.node,c=o.callee;if(c.type!=="MemberExpression"||c.property?.name!=="use")return;let l=o.arguments??[];if(l.length<2)return;let u=l[0];if(u.type!=="StringLiteral")return;let d=u.value;if(!d.startsWith("/"))return;let p=l[l.length-1];if(p.type!=="Identifier")return;let f=p.name,h=r.get(f)??"",m=n.get(f);if(!h&&m&&m.length>0){for(let g of m)s.push({prefix:d,routerVar:f,importSource:g});return}s.push({prefix:d,routerVar:f,importSource:h})}}),s}function fFe(e,t){let r=e.endsWith("/")?e.slice(0,-1):e,n=t.startsWith("/")?t:"/"+t;return r+(n==="/"?"":n)||"/"}function Q1(e,t,r){let n=new Map;for(let[a,o]of t.entries()){let c=pFe(o);for(let l of c){if(!l.importSource)continue;let u=a.includes("/")?a.substring(0,a.lastIndexOf("/")):"",d=l.importSource;if(d.startsWith(".")){let f=u?u+"/"+d:d;d=Iq.normalize(f).replace(/\\/g,"/"),d=d.replace(/^\.\//,"")}let p=[d,d+".js",d+".ts",d+"/index.js",d+"/index.ts"];for(let f of p)if(t.has(f)){let h=n.get(f)??[];h.includes(l.prefix)||h.push(l.prefix),n.set(f,h);break}}}if(n.size===0)return e;let s={};for(let[a,o]of Object.entries(e)){let c=n.get(o.filePath);if(!c||c.length===0||o.rawRoute!==void 0){s[a]=o;continue}let l=c[0],u=fFe(l,o.route),d=`${o.method}:${u}::${o.filePath}::${o.handlerName}`;s[d]={...o,apiId:d,route:u,rawRoute:o.route}}return s}function Ju(e){let t=(e||"").toLowerCase();return["mongoose","sequelize","prisma","typeorm","knex","pg","mysql","mongodb"].some(r=>t.includes(r))?"database":["redis","ioredis","memcached","valkey"].some(r=>t.includes(r))?"cache":["s3","gcs","storage","bucket","minio","blob","azure/storage"].some(r=>t.includes(r))?"storage":["axios","fetch","got","request","grpc","amqplib","kafka","sns","sqs"].some(r=>t.includes(r))?"service":"module"}var Iq,Ob,Hu,wq,Eq,$b=Kt(()=>{"use strict";Iq=Fe(require("path"));gu();Zy();Ob=Fe(Ta()),Hu=typeof Ob.default=="function"?Ob.default:Ob.default.default;wq=new Set(["get","post","put","patch","delete","options","head","all"]);Eq=/^(?:auth|authRequired|requireAuth|isAuthenticated|jwtAuth|jwt|passport(?:\.authenticate)?|koaJwt|ensureAuth|ensureAuthenticated|sessionAuth|authMiddleware)$/i});var eC=G((exports,module)=>{var Module=Module!==void 0?Module:{},TreeSitter=function(){var initPromise,document=typeof window=="object"?{currentScript:window.document.currentScript}:null;class Parser{constructor(){this.initialize()}initialize(){throw new Error("cannot construct a Parser before calling `init()`")}static init(moduleOptions){return initPromise||(Module=Object.assign({},Module,moduleOptions),initPromise=new Promise(resolveInitPromise=>{var moduleOverrides=Object.assign({},Module),arguments_=[],thisProgram="./this.program",quit_=(e,t)=>{throw t},ENVIRONMENT_IS_WEB=typeof window=="object",ENVIRONMENT_IS_WORKER=typeof importScripts=="function",ENVIRONMENT_IS_NODE=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",scriptDirectory="",read_,readAsync,readBinary;function locateFile(e){return Module.locateFile?Module.locateFile(e,scriptDirectory):scriptDirectory+e}if(ENVIRONMENT_IS_NODE){var fs=require("fs"),nodePath=require("path");scriptDirectory=ENVIRONMENT_IS_WORKER?nodePath.dirname(scriptDirectory)+"/":__dirname+"/",read_=(e,t)=>(e=isFileURI(e)?new URL(e):nodePath.normalize(e),fs.readFileSync(e,t?void 0:"utf8")),readBinary=e=>{var t=read_(e,!0);return t.buffer||(t=new Uint8Array(t)),t},readAsync=(e,t,r,n=!0)=>{e=isFileURI(e)?new URL(e):nodePath.normalize(e),fs.readFile(e,n?void 0:"utf8",(s,a)=>{s?r(s):t(n?a.buffer:a)})},!Module.thisProgram&&process.argv.length>1&&(thisProgram=process.argv[1].replace(/\\/g,"/")),arguments_=process.argv.slice(2),typeof module<"u"&&(module.exports=Module),quit_=(e,t)=>{throw process.exitCode=e,t}}else(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)&&(ENVIRONMENT_IS_WORKER?scriptDirectory=self.location.href:document!==void 0&&document.currentScript&&(scriptDirectory=document.currentScript.src),scriptDirectory=scriptDirectory.startsWith("blob:")?"":scriptDirectory.substr(0,scriptDirectory.replace(/[?#].*/,"").lastIndexOf("/")+1),read_=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},ENVIRONMENT_IS_WORKER&&(readBinary=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),readAsync=(e,t,r)=>{var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=()=>{n.status==200||n.status==0&&n.response?t(n.response):r()},n.onerror=r,n.send(null)});var out=Module.print||console.log.bind(console),err=Module.printErr||console.error.bind(console);Object.assign(Module,moduleOverrides),moduleOverrides=null,Module.arguments&&(arguments_=Module.arguments),Module.thisProgram&&(thisProgram=Module.thisProgram),Module.quit&&(quit_=Module.quit);var dynamicLibraries=Module.dynamicLibraries||[],wasmBinary,wasmMemory;Module.wasmBinary&&(wasmBinary=Module.wasmBinary),typeof WebAssembly!="object"&&abort("no native wasm support detected");var ABORT=!1,EXITSTATUS,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateMemoryViews(){var e=wasmMemory.buffer;Module.HEAP8=HEAP8=new Int8Array(e),Module.HEAP16=HEAP16=new Int16Array(e),Module.HEAPU8=HEAPU8=new Uint8Array(e),Module.HEAPU16=HEAPU16=new Uint16Array(e),Module.HEAP32=HEAP32=new Int32Array(e),Module.HEAPU32=HEAPU32=new Uint32Array(e),Module.HEAPF32=HEAPF32=new Float32Array(e),Module.HEAPF64=HEAPF64=new Float64Array(e)}var INITIAL_MEMORY=Module.INITIAL_MEMORY||33554432;wasmMemory=Module.wasmMemory?Module.wasmMemory:new WebAssembly.Memory({initial:INITIAL_MEMORY/65536,maximum:32768}),updateMemoryViews(),INITIAL_MEMORY=wasmMemory.buffer.byteLength;var __ATPRERUN__=[],__ATINIT__=[],__ATMAIN__=[],__ATPOSTRUN__=[],__RELOC_FUNCS__=[],runtimeInitialized=!1;function preRun(){if(Module.preRun)for(typeof Module.preRun=="function"&&(Module.preRun=[Module.preRun]);Module.preRun.length;)addOnPreRun(Module.preRun.shift());callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=!0,callRuntimeCallbacks(__RELOC_FUNCS__),callRuntimeCallbacks(__ATINIT__)}function preMain(){callRuntimeCallbacks(__ATMAIN__)}function postRun(){if(Module.postRun)for(typeof Module.postRun=="function"&&(Module.postRun=[Module.postRun]);Module.postRun.length;)addOnPostRun(Module.postRun.shift());callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(e){__ATPRERUN__.unshift(e)}function addOnInit(e){__ATINIT__.unshift(e)}function addOnPostRun(e){__ATPOSTRUN__.unshift(e)}var runDependencies=0,runDependencyWatcher=null,dependenciesFulfilled=null;function getUniqueRunDependency(e){return e}function addRunDependency(e){runDependencies++,Module.monitorRunDependencies?.(runDependencies)}function removeRunDependency(e){if(runDependencies--,Module.monitorRunDependencies?.(runDependencies),runDependencies==0&&(runDependencyWatcher!==null&&(clearInterval(runDependencyWatcher),runDependencyWatcher=null),dependenciesFulfilled)){var t=dependenciesFulfilled;dependenciesFulfilled=null,t()}}function abort(e){throw Module.onAbort?.(e),err(e="Aborted("+e+")"),ABORT=!0,EXITSTATUS=1,e+=". Build with -sASSERTIONS for more info.",new WebAssembly.RuntimeError(e)}var dataURIPrefix="data:application/octet-stream;base64,",isDataURI=e=>e.startsWith(dataURIPrefix),isFileURI=e=>e.startsWith("file://"),wasmBinaryFile;function getBinarySync(e){if(e==wasmBinaryFile&&wasmBinary)return new Uint8Array(wasmBinary);if(readBinary)return readBinary(e);throw"both async and sync fetching of the wasm failed"}function getBinaryPromise(e){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch=="function"&&!isFileURI(e))return fetch(e,{credentials:"same-origin"}).then(t=>{if(!t.ok)throw`failed to load wasm binary file at '${e}'`;return t.arrayBuffer()}).catch(()=>getBinarySync(e));if(readAsync)return new Promise((t,r)=>{readAsync(e,n=>t(new Uint8Array(n)),r)})}return Promise.resolve().then(()=>getBinarySync(e))}function instantiateArrayBuffer(e,t,r){return getBinaryPromise(e).then(n=>WebAssembly.instantiate(n,t)).then(r,n=>{err(`failed to asynchronously prepare wasm: ${n}`),abort(n)})}function instantiateAsync(e,t,r,n){return e||typeof WebAssembly.instantiateStreaming!="function"||isDataURI(t)||isFileURI(t)||ENVIRONMENT_IS_NODE||typeof fetch!="function"?instantiateArrayBuffer(t,r,n):fetch(t,{credentials:"same-origin"}).then(s=>WebAssembly.instantiateStreaming(s,r).then(n,function(a){return err(`wasm streaming compile failed: ${a}`),err("falling back to ArrayBuffer instantiation"),instantiateArrayBuffer(t,r,n)}))}function createWasm(){var e={env:wasmImports,wasi_snapshot_preview1:wasmImports,"GOT.mem":new Proxy(wasmImports,GOTHandler),"GOT.func":new Proxy(wasmImports,GOTHandler)};function t(r,n){wasmExports=r.exports,wasmExports=relocateExports(wasmExports,1024);var s=getDylinkMetadata(n);return s.neededDynlibs&&(dynamicLibraries=s.neededDynlibs.concat(dynamicLibraries)),mergeLibSymbols(wasmExports,"main"),LDSO.init(),loadDylibs(),addOnInit(wasmExports.__wasm_call_ctors),__RELOC_FUNCS__.push(wasmExports.__wasm_apply_data_relocs),removeRunDependency("wasm-instantiate"),wasmExports}if(addRunDependency("wasm-instantiate"),Module.instantiateWasm)try{return Module.instantiateWasm(e,t)}catch(r){return err(`Module.instantiateWasm callback failed with error: ${r}`),!1}return instantiateAsync(wasmBinary,wasmBinaryFile,e,function(r){t(r.instance,r.module)}),{}}wasmBinaryFile="tree-sitter.wasm",isDataURI(wasmBinaryFile)||(wasmBinaryFile=locateFile(wasmBinaryFile));var ASM_CONSTS={};function ExitStatus(e){this.name="ExitStatus",this.message=`Program terminated with exit(${e})`,this.status=e}var GOT={},currentModuleWeakSymbols=new Set([]),GOTHandler={get(e,t){var r=GOT[t];return r||(r=GOT[t]=new WebAssembly.Global({value:"i32",mutable:!0})),currentModuleWeakSymbols.has(t)||(r.required=!0),r}},callRuntimeCallbacks=e=>{for(;e.length>0;)e.shift()(Module)},UTF8Decoder=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,UTF8ArrayToString=(e,t,r)=>{for(var n=t+r,s=t;e[s]&&!(s>=n);)++s;if(s-t>16&&e.buffer&&UTF8Decoder)return UTF8Decoder.decode(e.subarray(t,s));for(var a="";t<s;){var o=e[t++];if(128&o){var c=63&e[t++];if((224&o)!=192){var l=63&e[t++];if((o=(240&o)==224?(15&o)<<12|c<<6|l:(7&o)<<18|c<<12|l<<6|63&e[t++])<65536)a+=String.fromCharCode(o);else{var u=o-65536;a+=String.fromCharCode(55296|u>>10,56320|1023&u)}}else a+=String.fromCharCode((31&o)<<6|c)}else a+=String.fromCharCode(o)}return a},getDylinkMetadata=e=>{var t=0,r=0;function n(){for(var _=0,v=1;;){var S=e[t++];if(_+=(127&S)*v,v*=128,!(128&S))break}return _}function s(){var _=n();return UTF8ArrayToString(e,(t+=_)-_,_)}function a(_,v){if(_)throw new Error(v)}var o="dylink.0";if(e instanceof WebAssembly.Module){var c=WebAssembly.Module.customSections(e,o);c.length===0&&(o="dylink",c=WebAssembly.Module.customSections(e,o)),a(c.length===0,"need dylink section"),r=(e=new Uint8Array(c[0])).length}else{a(new Uint32Array(new Uint8Array(e.subarray(0,24)).buffer)[0]!=1836278016,"need to see wasm magic number"),a(e[8]!==0,"need the dylink section to be first"),t=9;var l=n();r=t+l,o=s()}var u={neededDynlibs:[],tlsExports:new Set,weakImports:new Set};if(o=="dylink"){u.memorySize=n(),u.memoryAlign=n(),u.tableSize=n(),u.tableAlign=n();for(var d=n(),p=0;p<d;++p){var f=s();u.neededDynlibs.push(f)}}else for(a(o!=="dylink.0");t<r;){var h=e[t++],m=n();if(h===1)u.memorySize=n(),u.memoryAlign=n(),u.tableSize=n(),u.tableAlign=n();else if(h===2)for(d=n(),p=0;p<d;++p)f=s(),u.neededDynlibs.push(f);else if(h===3)for(var g=n();g--;){var y=s();256&n()&&u.tlsExports.add(y)}else if(h===4)for(g=n();g--;)s(),y=s(),(3&n())==1&&u.weakImports.add(y);else t+=m}return u};function getValue(e,t="i8"){switch(t.endsWith("*")&&(t="*"),t){case"i1":case"i8":return HEAP8[e];case"i16":return HEAP16[e>>1];case"i32":return HEAP32[e>>2];case"i64":abort("to do getValue(i64) use WASM_BIGINT");case"float":return HEAPF32[e>>2];case"double":return HEAPF64[e>>3];case"*":return HEAPU32[e>>2];default:abort(`invalid type for getValue: ${t}`)}}var newDSO=(e,t,r)=>{var n={refcount:1/0,name:e,exports:r,global:!0};return LDSO.loadedLibsByName[e]=n,t!=null&&(LDSO.loadedLibsByHandle[t]=n),n},LDSO={loadedLibsByName:{},loadedLibsByHandle:{},init(){newDSO("__main__",0,wasmImports)}},___heap_base=78096,zeroMemory=(e,t)=>(HEAPU8.fill(0,e,e+t),e),alignMemory=(e,t)=>Math.ceil(e/t)*t,getMemory=e=>{if(runtimeInitialized)return zeroMemory(_malloc(e),e);var t=___heap_base,r=t+alignMemory(e,16);return ___heap_base=r,GOT.__heap_base.value=r,t},isInternalSym=e=>["__cpp_exception","__c_longjmp","__wasm_apply_data_relocs","__dso_handle","__tls_size","__tls_align","__set_stack_limits","_emscripten_tls_init","__wasm_init_tls","__wasm_call_ctors","__start_em_asm","__stop_em_asm","__start_em_js","__stop_em_js"].includes(e)||e.startsWith("__em_js__"),uleb128Encode=(e,t)=>{e<128?t.push(e):t.push(e%128|128,e>>7)},sigToWasmTypes=e=>{for(var t={i:"i32",j:"i64",f:"f32",d:"f64",e:"externref",p:"i32"},r={parameters:[],results:e[0]=="v"?[]:[t[e[0]]]},n=1;n<e.length;++n)r.parameters.push(t[e[n]]);return r},generateFuncType=(e,t)=>{var r=e.slice(0,1),n=e.slice(1),s={i:127,p:127,j:126,f:125,d:124,e:111};t.push(96),uleb128Encode(n.length,t);for(var a=0;a<n.length;++a)t.push(s[n[a]]);r=="v"?t.push(0):t.push(1,s[r])},convertJsFunctionToWasm=(e,t)=>{if(typeof WebAssembly.Function=="function")return new WebAssembly.Function(sigToWasmTypes(t),e);var r=[1];generateFuncType(t,r);var n=[0,97,115,109,1,0,0,0,1];uleb128Encode(r.length,n),n.push(...r),n.push(2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0);var s=new WebAssembly.Module(new Uint8Array(n));return new WebAssembly.Instance(s,{e:{f:e}}).exports.f},wasmTableMirror=[],wasmTable=new WebAssembly.Table({initial:27,element:"anyfunc"}),getWasmTableEntry=e=>{var t=wasmTableMirror[e];return t||(e>=wasmTableMirror.length&&(wasmTableMirror.length=e+1),wasmTableMirror[e]=t=wasmTable.get(e)),t},updateTableMap=(e,t)=>{if(functionsInTableMap)for(var r=e;r<e+t;r++){var n=getWasmTableEntry(r);n&&functionsInTableMap.set(n,r)}},functionsInTableMap,getFunctionAddress=e=>(functionsInTableMap||(functionsInTableMap=new WeakMap,updateTableMap(0,wasmTable.length)),functionsInTableMap.get(e)||0),freeTableIndexes=[],getEmptyTableSlot=()=>{if(freeTableIndexes.length)return freeTableIndexes.pop();try{wasmTable.grow(1)}catch(e){throw e instanceof RangeError?"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH.":e}return wasmTable.length-1},setWasmTableEntry=(e,t)=>{wasmTable.set(e,t),wasmTableMirror[e]=wasmTable.get(e)},addFunction=(e,t)=>{var r=getFunctionAddress(e);if(r)return r;var n=getEmptyTableSlot();try{setWasmTableEntry(n,e)}catch(a){if(!(a instanceof TypeError))throw a;var s=convertJsFunctionToWasm(e,t);setWasmTableEntry(n,s)}return functionsInTableMap.set(e,n),n},updateGOT=(e,t)=>{for(var r in e)if(!isInternalSym(r)){var n=e[r];r.startsWith("orig$")&&(r=r.split("$")[1],t=!0),GOT[r]||=new WebAssembly.Global({value:"i32",mutable:!0}),(t||GOT[r].value==0)&&(typeof n=="function"?GOT[r].value=addFunction(n):typeof n=="number"?GOT[r].value=n:err(`unhandled export type for '${r}': ${typeof n}`))}},relocateExports=(e,t,r)=>{var n={};for(var s in e){var a=e[s];typeof a=="object"&&(a=a.value),typeof a=="number"&&(a+=t),n[s]=a}return updateGOT(n,r),n},isSymbolDefined=e=>{var t=wasmImports[e];return!(!t||t.stub)},dynCallLegacy=(e,t,r)=>(0,Module["dynCall_"+e])(t,...r),dynCall=(e,t,r=[])=>e.includes("j")?dynCallLegacy(e,t,r):getWasmTableEntry(t)(...r),createInvokeFunction=e=>function(){var t=stackSave();try{return dynCall(e,arguments[0],Array.prototype.slice.call(arguments,1))}catch(r){if(stackRestore(t),r!==r+0)throw r;_setThrew(1,0)}},resolveGlobalSymbol=(e,t=!1)=>{var r;return t&&"orig$"+e in wasmImports&&(e="orig$"+e),isSymbolDefined(e)?r=wasmImports[e]:e.startsWith("invoke_")&&(r=wasmImports[e]=createInvokeFunction(e.split("_")[1])),{sym:r,name:e}},UTF8ToString=(e,t)=>e?UTF8ArrayToString(HEAPU8,e,t):"",loadWebAssemblyModule=(binary,flags,libName,localScope,handle)=>{var metadata=getDylinkMetadata(binary);function loadModule(){var firstLoad=!handle||!HEAP8[handle+8];if(firstLoad){var memAlign=Math.pow(2,metadata.memoryAlign),memoryBase=metadata.memorySize?alignMemory(getMemory(metadata.memorySize+memAlign),memAlign):0,tableBase=metadata.tableSize?wasmTable.length:0;handle&&(HEAP8[handle+8]=1,HEAPU32[handle+12>>2]=memoryBase,HEAP32[handle+16>>2]=metadata.memorySize,HEAPU32[handle+20>>2]=tableBase,HEAP32[handle+24>>2]=metadata.tableSize)}else memoryBase=HEAPU32[handle+12>>2],tableBase=HEAPU32[handle+20>>2];var tableGrowthNeeded=tableBase+metadata.tableSize-wasmTable.length,moduleExports;function resolveSymbol(e){var t=resolveGlobalSymbol(e).sym;return!t&&localScope&&(t=localScope[e]),t||(t=moduleExports[e]),t}tableGrowthNeeded>0&&wasmTable.grow(tableGrowthNeeded);var proxyHandler={get(e,t){switch(t){case"__memory_base":return memoryBase;case"__table_base":return tableBase}if(t in wasmImports&&!wasmImports[t].stub)return wasmImports[t];var r;return t in e||(e[t]=(...n)=>(r||=resolveSymbol(t),r(...n))),e[t]}},proxy=new Proxy({},proxyHandler),info={"GOT.mem":new Proxy({},GOTHandler),"GOT.func":new Proxy({},GOTHandler),env:proxy,wasi_snapshot_preview1:proxy};function postInstantiation(module,instance){function addEmAsm(addr,body){for(var args=[],arity=0;arity<16&&body.indexOf("$"+arity)!=-1;arity++)args.push("$"+arity);args=args.join(",");var func=`(${args}) => { ${body} };`;ASM_CONSTS[start]=eval(func)}if(updateTableMap(tableBase,metadata.tableSize),moduleExports=relocateExports(instance.exports,memoryBase),flags.allowUndefined||reportUndefinedSymbols(),"__start_em_asm"in moduleExports)for(var start=moduleExports.__start_em_asm,stop=moduleExports.__stop_em_asm;start<stop;){var jsString=UTF8ToString(start);addEmAsm(start,jsString),start=HEAPU8.indexOf(0,start)+1}function addEmJs(name,cSig,body){var jsArgs=[];if(cSig=cSig.slice(1,-1),cSig!="void")for(var i in cSig=cSig.split(","),cSig){var jsArg=cSig[i].split(" ").pop();jsArgs.push(jsArg.replace("*",""))}var func=`(${jsArgs}) => ${body};`;moduleExports[name]=eval(func)}for(var name in moduleExports)if(name.startsWith("__em_js__")){var start=moduleExports[name],jsString=UTF8ToString(start),parts=jsString.split("<::>");addEmJs(name.replace("__em_js__",""),parts[0],parts[1]),delete moduleExports[name]}var applyRelocs=moduleExports.__wasm_apply_data_relocs;applyRelocs&&(runtimeInitialized?applyRelocs():__RELOC_FUNCS__.push(applyRelocs));var init=moduleExports.__wasm_call_ctors;return init&&(runtimeInitialized?init():__ATINIT__.push(init)),moduleExports}if(flags.loadAsync){if(binary instanceof WebAssembly.Module){var instance=new WebAssembly.Instance(binary,info);return Promise.resolve(postInstantiation(binary,instance))}return WebAssembly.instantiate(binary,info).then(e=>postInstantiation(e.module,e.instance))}var module=binary instanceof WebAssembly.Module?binary:new WebAssembly.Module(binary),instance=new WebAssembly.Instance(module,info);return postInstantiation(module,instance)}return currentModuleWeakSymbols=metadata.weakImports,flags.loadAsync?metadata.neededDynlibs.reduce((e,t)=>e.then(()=>loadDynamicLibrary(t,flags)),Promise.resolve()).then(loadModule):(metadata.neededDynlibs.forEach(e=>loadDynamicLibrary(e,flags,localScope)),loadModule())},mergeLibSymbols=(e,t)=>{for(var[r,n]of Object.entries(e)){let s=o=>{isSymbolDefined(o)||(wasmImports[o]=n)};s(r);let a="__main_argc_argv";r=="main"&&s(a),r==a&&s("main"),r.startsWith("dynCall_")&&!Module.hasOwnProperty(r)&&(Module[r]=n)}},asyncLoad=(e,t,r,n)=>{var s=n?"":`al ${e}`;readAsync(e,a=>{t(new Uint8Array(a)),s&&removeRunDependency(s)},a=>{if(!r)throw`Loading data file "${e}" failed.`;r()}),s&&addRunDependency(s)};function loadDynamicLibrary(e,t={global:!0,nodelete:!0},r,n){var s=LDSO.loadedLibsByName[e];if(s)return t.global?s.global||(s.global=!0,mergeLibSymbols(s.exports,e)):r&&Object.assign(r,s.exports),t.nodelete&&s.refcount!==1/0&&(s.refcount=1/0),s.refcount++,n&&(LDSO.loadedLibsByHandle[n]=s),!t.loadAsync||Promise.resolve(!0);function a(){if(n){var l=HEAPU32[n+28>>2],u=HEAPU32[n+32>>2];if(l&&u){var d=HEAP8.slice(l,l+u);return t.loadAsync?Promise.resolve(d):d}}var p=locateFile(e);if(t.loadAsync)return new Promise(function(f,h){asyncLoad(p,f,h)});if(!readBinary)throw new Error(`${p}: file not found, and synchronous loading of external files is not available`);return readBinary(p)}function o(){return t.loadAsync?a().then(l=>loadWebAssemblyModule(l,t,e,r,n)):loadWebAssemblyModule(a(),t,e,r,n)}function c(l){s.global?mergeLibSymbols(l,e):r&&Object.assign(r,l),s.exports=l}return(s=newDSO(e,n,"loading")).refcount=t.nodelete?1/0:1,s.global=t.global,t.loadAsync?o().then(l=>(c(l),!0)):(c(o()),!0)}var reportUndefinedSymbols=()=>{for(var[e,t]of Object.entries(GOT))if(t.value==0){var r=resolveGlobalSymbol(e,!0).sym;if(!r&&!t.required)continue;if(typeof r=="function")t.value=addFunction(r,r.sig);else{if(typeof r!="number")throw new Error(`bad export type for '${e}': ${typeof r}`);t.value=r}}},loadDylibs=()=>{dynamicLibraries.length?(addRunDependency("loadDylibs"),dynamicLibraries.reduce((e,t)=>e.then(()=>loadDynamicLibrary(t,{loadAsync:!0,global:!0,nodelete:!0,allowUndefined:!0})),Promise.resolve()).then(()=>{reportUndefinedSymbols(),removeRunDependency("loadDylibs")})):reportUndefinedSymbols()},noExitRuntime=Module.noExitRuntime||!0;function setValue(e,t,r="i8"){switch(r.endsWith("*")&&(r="*"),r){case"i1":case"i8":HEAP8[e]=t;break;case"i16":HEAP16[e>>1]=t;break;case"i32":HEAP32[e>>2]=t;break;case"i64":abort("to do setValue(i64) use WASM_BIGINT");case"float":HEAPF32[e>>2]=t;break;case"double":HEAPF64[e>>3]=t;break;case"*":HEAPU32[e>>2]=t;break;default:abort(`invalid type for setValue: ${r}`)}}var ___memory_base=new WebAssembly.Global({value:"i32",mutable:!1},1024),___stack_pointer=new WebAssembly.Global({value:"i32",mutable:!0},78096),___table_base=new WebAssembly.Global({value:"i32",mutable:!1},1),nowIsMonotonic=1,__emscripten_get_now_is_monotonic=()=>nowIsMonotonic;__emscripten_get_now_is_monotonic.sig="i";var _abort=()=>{abort("")};_abort.sig="v";var _emscripten_date_now=()=>Date.now(),_emscripten_get_now;_emscripten_date_now.sig="d",_emscripten_get_now=()=>performance.now(),_emscripten_get_now.sig="d";var _emscripten_memcpy_js=(e,t,r)=>HEAPU8.copyWithin(e,t,t+r);_emscripten_memcpy_js.sig="vppp";var getHeapMax=()=>2147483648,growMemory=e=>{var t=(e-wasmMemory.buffer.byteLength+65535)/65536;try{return wasmMemory.grow(t),updateMemoryViews(),1}catch{}},_emscripten_resize_heap=e=>{var t=HEAPU8.length;e>>>=0;var r=getHeapMax();if(e>r)return!1;for(var n,s,a=1;a<=4;a*=2){var o=t*(1+.2/a);o=Math.min(o,e+100663296);var c=Math.min(r,(n=Math.max(e,o))+((s=65536)-n%s)%s);if(growMemory(c))return!0}return!1};_emscripten_resize_heap.sig="ip";var _fd_close=e=>52;_fd_close.sig="ii";var convertI32PairToI53Checked=(e,t)=>t+2097152>>>0<4194305-!!e?(e>>>0)+4294967296*t:NaN;function _fd_seek(e,t,r,n,s){return convertI32PairToI53Checked(t,r),70}_fd_seek.sig="iiiiip";var printCharBuffers=[null,[],[]],printChar=(e,t)=>{var r=printCharBuffers[e];t===0||t===10?((e===1?out:err)(UTF8ArrayToString(r,0)),r.length=0):r.push(t)},SYSCALLS={varargs:void 0,get(){var e=HEAP32[+SYSCALLS.varargs>>2];return SYSCALLS.varargs+=4,e},getp:()=>SYSCALLS.get(),getStr:e=>UTF8ToString(e)},_fd_write=(e,t,r,n)=>{for(var s=0,a=0;a<r;a++){var o=HEAPU32[t>>2],c=HEAPU32[t+4>>2];t+=8;for(var l=0;l<c;l++)printChar(e,HEAPU8[o+l]);s+=c}return HEAPU32[n>>2]=s,0};function _tree_sitter_log_callback(e,t){if(currentLogCallback){let r=UTF8ToString(t);currentLogCallback(r,e!==0)}}function _tree_sitter_parse_callback(e,t,r,n,s){let a=currentParseCallback(t,{row:r,column:n});typeof a=="string"?(setValue(s,a.length,"i32"),stringToUTF16(a,e,10240)):setValue(s,0,"i32")}_fd_write.sig="iippp";var runtimeKeepaliveCounter=0,keepRuntimeAlive=()=>noExitRuntime||runtimeKeepaliveCounter>0,_proc_exit=e=>{EXITSTATUS=e,keepRuntimeAlive()||(Module.onExit?.(e),ABORT=!0),quit_(e,new ExitStatus(e))};_proc_exit.sig="vi";var exitJS=(e,t)=>{EXITSTATUS=e,_proc_exit(e)},handleException=e=>{if(e instanceof ExitStatus||e=="unwind")return EXITSTATUS;quit_(1,e)},lengthBytesUTF8=e=>{for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n<=127?t++:n<=2047?t+=2:n>=55296&&n<=57343?(t+=4,++r):t+=3}return t},stringToUTF8Array=(e,t,r,n)=>{if(!(n>0))return 0;for(var s=r,a=r+n-1,o=0;o<e.length;++o){var c=e.charCodeAt(o);if(c>=55296&&c<=57343&&(c=65536+((1023&c)<<10)|1023&e.charCodeAt(++o)),c<=127){if(r>=a)break;t[r++]=c}else if(c<=2047){if(r+1>=a)break;t[r++]=192|c>>6,t[r++]=128|63&c}else if(c<=65535){if(r+2>=a)break;t[r++]=224|c>>12,t[r++]=128|c>>6&63,t[r++]=128|63&c}else{if(r+3>=a)break;t[r++]=240|c>>18,t[r++]=128|c>>12&63,t[r++]=128|c>>6&63,t[r++]=128|63&c}}return t[r]=0,r-s},stringToUTF8=(e,t,r)=>stringToUTF8Array(e,HEAPU8,t,r),stringToUTF8OnStack=e=>{var t=lengthBytesUTF8(e)+1,r=stackAlloc(t);return stringToUTF8(e,r,t),r},stringToUTF16=(e,t,r)=>{if(r??=2147483647,r<2)return 0;for(var n=t,s=(r-=2)<2*e.length?r/2:e.length,a=0;a<s;++a){var o=e.charCodeAt(a);HEAP16[t>>1]=o,t+=2}return HEAP16[t>>1]=0,t-n},AsciiToString=e=>{for(var t="";;){var r=HEAPU8[e++];if(!r)return t;t+=String.fromCharCode(r)}},wasmImports={__heap_base:___heap_base,__indirect_function_table:wasmTable,__memory_base:___memory_base,__stack_pointer:___stack_pointer,__table_base:___table_base,_emscripten_get_now_is_monotonic:__emscripten_get_now_is_monotonic,abort:_abort,emscripten_get_now:_emscripten_get_now,emscripten_memcpy_js:_emscripten_memcpy_js,emscripten_resize_heap:_emscripten_resize_heap,fd_close:_fd_close,fd_seek:_fd_seek,fd_write:_fd_write,memory:wasmMemory,tree_sitter_log_callback:_tree_sitter_log_callback,tree_sitter_parse_callback:_tree_sitter_parse_callback},wasmExports=createWasm(),___wasm_call_ctors=()=>(___wasm_call_ctors=wasmExports.__wasm_call_ctors)(),___wasm_apply_data_relocs=()=>(___wasm_apply_data_relocs=wasmExports.__wasm_apply_data_relocs)(),_malloc=Module._malloc=e=>(_malloc=Module._malloc=wasmExports.malloc)(e),_calloc=Module._calloc=(e,t)=>(_calloc=Module._calloc=wasmExports.calloc)(e,t),_realloc=Module._realloc=(e,t)=>(_realloc=Module._realloc=wasmExports.realloc)(e,t),_free=Module._free=e=>(_free=Module._free=wasmExports.free)(e),_ts_language_symbol_count=Module._ts_language_symbol_count=e=>(_ts_language_symbol_count=Module._ts_language_symbol_count=wasmExports.ts_language_symbol_count)(e),_ts_language_state_count=Module._ts_language_state_count=e=>(_ts_language_state_count=Module._ts_language_state_count=wasmExports.ts_language_state_count)(e),_ts_language_version=Module._ts_language_version=e=>(_ts_language_version=Module._ts_language_version=wasmExports.ts_language_version)(e),_ts_language_field_count=Module._ts_language_field_count=e=>(_ts_language_field_count=Module._ts_language_field_count=wasmExports.ts_language_field_count)(e),_ts_language_next_state=Module._ts_language_next_state=(e,t,r)=>(_ts_language_next_state=Module._ts_language_next_state=wasmExports.ts_language_next_state)(e,t,r),_ts_language_symbol_name=Module._ts_language_symbol_name=(e,t)=>(_ts_language_symbol_name=Module._ts_language_symbol_name=wasmExports.ts_language_symbol_name)(e,t),_ts_language_symbol_for_name=Module._ts_language_symbol_for_name=(e,t,r,n)=>(_ts_language_symbol_for_name=Module._ts_language_symbol_for_name=wasmExports.ts_language_symbol_for_name)(e,t,r,n),_strncmp=Module._strncmp=(e,t,r)=>(_strncmp=Module._strncmp=wasmExports.strncmp)(e,t,r),_ts_language_symbol_type=Module._ts_language_symbol_type=(e,t)=>(_ts_language_symbol_type=Module._ts_language_symbol_type=wasmExports.ts_language_symbol_type)(e,t),_ts_language_field_name_for_id=Module._ts_language_field_name_for_id=(e,t)=>(_ts_language_field_name_for_id=Module._ts_language_field_name_for_id=wasmExports.ts_language_field_name_for_id)(e,t),_ts_lookahead_iterator_new=Module._ts_lookahead_iterator_new=(e,t)=>(_ts_lookahead_iterator_new=Module._ts_lookahead_iterator_new=wasmExports.ts_lookahead_iterator_new)(e,t),_ts_lookahead_iterator_delete=Module._ts_lookahead_iterator_delete=e=>(_ts_lookahead_iterator_delete=Module._ts_lookahead_iterator_delete=wasmExports.ts_lookahead_iterator_delete)(e),_ts_lookahead_iterator_reset_state=Module._ts_lookahead_iterator_reset_state=(e,t)=>(_ts_lookahead_iterator_reset_state=Module._ts_lookahead_iterator_reset_state=wasmExports.ts_lookahead_iterator_reset_state)(e,t),_ts_lookahead_iterator_reset=Module._ts_lookahead_iterator_reset=(e,t,r)=>(_ts_lookahead_iterator_reset=Module._ts_lookahead_iterator_reset=wasmExports.ts_lookahead_iterator_reset)(e,t,r),_ts_lookahead_iterator_next=Module._ts_lookahead_iterator_next=e=>(_ts_lookahead_iterator_next=Module._ts_lookahead_iterator_next=wasmExports.ts_lookahead_iterator_next)(e),_ts_lookahead_iterator_current_symbol=Module._ts_lookahead_iterator_current_symbol=e=>(_ts_lookahead_iterator_current_symbol=Module._ts_lookahead_iterator_current_symbol=wasmExports.ts_lookahead_iterator_current_symbol)(e),_memset=Module._memset=(e,t,r)=>(_memset=Module._memset=wasmExports.memset)(e,t,r),_memcpy=Module._memcpy=(e,t,r)=>(_memcpy=Module._memcpy=wasmExports.memcpy)(e,t,r),_ts_parser_delete=Module._ts_parser_delete=e=>(_ts_parser_delete=Module._ts_parser_delete=wasmExports.ts_parser_delete)(e),_ts_parser_reset=Module._ts_parser_reset=e=>(_ts_parser_reset=Module._ts_parser_reset=wasmExports.ts_parser_reset)(e),_ts_parser_set_language=Module._ts_parser_set_language=(e,t)=>(_ts_parser_set_language=Module._ts_parser_set_language=wasmExports.ts_parser_set_language)(e,t),_ts_parser_timeout_micros=Module._ts_parser_timeout_micros=e=>(_ts_parser_timeout_micros=Module._ts_parser_timeout_micros=wasmExports.ts_parser_timeout_micros)(e),_ts_parser_set_timeout_micros=Module._ts_parser_set_timeout_micros=(e,t,r)=>(_ts_parser_set_timeout_micros=Module._ts_parser_set_timeout_micros=wasmExports.ts_parser_set_timeout_micros)(e,t,r),_ts_parser_set_included_ranges=Module._ts_parser_set_included_ranges=(e,t,r)=>(_ts_parser_set_included_ranges=Module._ts_parser_set_included_ranges=wasmExports.ts_parser_set_included_ranges)(e,t,r),_memmove=Module._memmove=(e,t,r)=>(_memmove=Module._memmove=wasmExports.memmove)(e,t,r),_memcmp=Module._memcmp=(e,t,r)=>(_memcmp=Module._memcmp=wasmExports.memcmp)(e,t,r),_ts_query_new=Module._ts_query_new=(e,t,r,n,s)=>(_ts_query_new=Module._ts_query_new=wasmExports.ts_query_new)(e,t,r,n,s),_ts_query_delete=Module._ts_query_delete=e=>(_ts_query_delete=Module._ts_query_delete=wasmExports.ts_query_delete)(e),_iswspace=Module._iswspace=e=>(_iswspace=Module._iswspace=wasmExports.iswspace)(e),_iswalnum=Module._iswalnum=e=>(_iswalnum=Module._iswalnum=wasmExports.iswalnum)(e),_ts_query_pattern_count=Module._ts_query_pattern_count=e=>(_ts_query_pattern_count=Module._ts_query_pattern_count=wasmExports.ts_query_pattern_count)(e),_ts_query_capture_count=Module._ts_query_capture_count=e=>(_ts_query_capture_count=Module._ts_query_capture_count=wasmExports.ts_query_capture_count)(e),_ts_query_string_count=Module._ts_query_string_count=e=>(_ts_query_string_count=Module._ts_query_string_count=wasmExports.ts_query_string_count)(e),_ts_query_capture_name_for_id=Module._ts_query_capture_name_for_id=(e,t,r)=>(_ts_query_capture_name_for_id=Module._ts_query_capture_name_for_id=wasmExports.ts_query_capture_name_for_id)(e,t,r),_ts_query_string_value_for_id=Module._ts_query_string_value_for_id=(e,t,r)=>(_ts_query_string_value_for_id=Module._ts_query_string_value_for_id=wasmExports.ts_query_string_value_for_id)(e,t,r),_ts_query_predicates_for_pattern=Module._ts_query_predicates_for_pattern=(e,t,r)=>(_ts_query_predicates_for_pattern=Module._ts_query_predicates_for_pattern=wasmExports.ts_query_predicates_for_pattern)(e,t,r),_ts_query_disable_capture=Module._ts_query_disable_capture=(e,t,r)=>(_ts_query_disable_capture=Module._ts_query_disable_capture=wasmExports.ts_query_disable_capture)(e,t,r),_ts_tree_copy=Module._ts_tree_copy=e=>(_ts_tree_copy=Module._ts_tree_copy=wasmExports.ts_tree_copy)(e),_ts_tree_delete=Module._ts_tree_delete=e=>(_ts_tree_delete=Module._ts_tree_delete=wasmExports.ts_tree_delete)(e),_ts_init=Module._ts_init=()=>(_ts_init=Module._ts_init=wasmExports.ts_init)(),_ts_parser_new_wasm=Module._ts_parser_new_wasm=()=>(_ts_parser_new_wasm=Module._ts_parser_new_wasm=wasmExports.ts_parser_new_wasm)(),_ts_parser_enable_logger_wasm=Module._ts_parser_enable_logger_wasm=(e,t)=>(_ts_parser_enable_logger_wasm=Module._ts_parser_enable_logger_wasm=wasmExports.ts_parser_enable_logger_wasm)(e,t),_ts_parser_parse_wasm=Module._ts_parser_parse_wasm=(e,t,r,n,s)=>(_ts_parser_parse_wasm=Module._ts_parser_parse_wasm=wasmExports.ts_parser_parse_wasm)(e,t,r,n,s),_ts_parser_included_ranges_wasm=Module._ts_parser_included_ranges_wasm=e=>(_ts_parser_included_ranges_wasm=Module._ts_parser_included_ranges_wasm=wasmExports.ts_parser_included_ranges_wasm)(e),_ts_language_type_is_named_wasm=Module._ts_language_type_is_named_wasm=(e,t)=>(_ts_language_type_is_named_wasm=Module._ts_language_type_is_named_wasm=wasmExports.ts_language_type_is_named_wasm)(e,t),_ts_language_type_is_visible_wasm=Module._ts_language_type_is_visible_wasm=(e,t)=>(_ts_language_type_is_visible_wasm=Module._ts_language_type_is_visible_wasm=wasmExports.ts_language_type_is_visible_wasm)(e,t),_ts_tree_root_node_wasm=Module._ts_tree_root_node_wasm=e=>(_ts_tree_root_node_wasm=Module._ts_tree_root_node_wasm=wasmExports.ts_tree_root_node_wasm)(e),_ts_tree_root_node_with_offset_wasm=Module._ts_tree_root_node_with_offset_wasm=e=>(_ts_tree_root_node_with_offset_wasm=Module._ts_tree_root_node_with_offset_wasm=wasmExports.ts_tree_root_node_with_offset_wasm)(e),_ts_tree_edit_wasm=Module._ts_tree_edit_wasm=e=>(_ts_tree_edit_wasm=Module._ts_tree_edit_wasm=wasmExports.ts_tree_edit_wasm)(e),_ts_tree_included_ranges_wasm=Module._ts_tree_included_ranges_wasm=e=>(_ts_tree_included_ranges_wasm=Module._ts_tree_included_ranges_wasm=wasmExports.ts_tree_included_ranges_wasm)(e),_ts_tree_get_changed_ranges_wasm=Module._ts_tree_get_changed_ranges_wasm=(e,t)=>(_ts_tree_get_changed_ranges_wasm=Module._ts_tree_get_changed_ranges_wasm=wasmExports.ts_tree_get_changed_ranges_wasm)(e,t),_ts_tree_cursor_new_wasm=Module._ts_tree_cursor_new_wasm=e=>(_ts_tree_cursor_new_wasm=Module._ts_tree_cursor_new_wasm=wasmExports.ts_tree_cursor_new_wasm)(e),_ts_tree_cursor_delete_wasm=Module._ts_tree_cursor_delete_wasm=e=>(_ts_tree_cursor_delete_wasm=Module._ts_tree_cursor_delete_wasm=wasmExports.ts_tree_cursor_delete_wasm)(e),_ts_tree_cursor_reset_wasm=Module._ts_tree_cursor_reset_wasm=e=>(_ts_tree_cursor_reset_wasm=Module._ts_tree_cursor_reset_wasm=wasmExports.ts_tree_cursor_reset_wasm)(e),_ts_tree_cursor_reset_to_wasm=Module._ts_tree_cursor_reset_to_wasm=(e,t)=>(_ts_tree_cursor_reset_to_wasm=Module._ts_tree_cursor_reset_to_wasm=wasmExports.ts_tree_cursor_reset_to_wasm)(e,t),_ts_tree_cursor_goto_first_child_wasm=Module._ts_tree_cursor_goto_first_child_wasm=e=>(_ts_tree_cursor_goto_first_child_wasm=Module._ts_tree_cursor_goto_first_child_wasm=wasmExports.ts_tree_cursor_goto_first_child_wasm)(e),_ts_tree_cursor_goto_last_child_wasm=Module._ts_tree_cursor_goto_last_child_wasm=e=>(_ts_tree_cursor_goto_last_child_wasm=Module._ts_tree_cursor_goto_last_child_wasm=wasmExports.ts_tree_cursor_goto_last_child_wasm)(e),_ts_tree_cursor_goto_first_child_for_index_wasm=Module._ts_tree_cursor_goto_first_child_for_index_wasm=e=>(_ts_tree_cursor_goto_first_child_for_index_wasm=Module._ts_tree_cursor_goto_first_child_for_index_wasm=wasmExports.ts_tree_cursor_goto_first_child_for_index_wasm)(e),_ts_tree_cursor_goto_first_child_for_position_wasm=Module._ts_tree_cursor_goto_first_child_for_position_wasm=e=>(_ts_tree_cursor_goto_first_child_for_position_wasm=Module._ts_tree_cursor_goto_first_child_for_position_wasm=wasmExports.ts_tree_cursor_goto_first_child_for_position_wasm)(e),_ts_tree_cursor_goto_next_sibling_wasm=Module._ts_tree_cursor_goto_next_sibling_wasm=e=>(_ts_tree_cursor_goto_next_sibling_wasm=Module._ts_tree_cursor_goto_next_sibling_wasm=wasmExports.ts_tree_cursor_goto_next_sibling_wasm)(e),_ts_tree_cursor_goto_previous_sibling_wasm=Module._ts_tree_cursor_goto_previous_sibling_wasm=e=>(_ts_tree_cursor_goto_previous_sibling_wasm=Module._ts_tree_cursor_goto_previous_sibling_wasm=wasmExports.ts_tree_cursor_goto_previous_sibling_wasm)(e),_ts_tree_cursor_goto_descendant_wasm=Module._ts_tree_cursor_goto_descendant_wasm=(e,t)=>(_ts_tree_cursor_goto_descendant_wasm=Module._ts_tree_cursor_goto_descendant_wasm=wasmExports.ts_tree_cursor_goto_descendant_wasm)(e,t),_ts_tree_cursor_goto_parent_wasm=Module._ts_tree_cursor_goto_parent_wasm=e=>(_ts_tree_cursor_goto_parent_wasm=Module._ts_tree_cursor_goto_parent_wasm=wasmExports.ts_tree_cursor_goto_parent_wasm)(e),_ts_tree_cursor_current_node_type_id_wasm=Module._ts_tree_cursor_current_node_type_id_wasm=e=>(_ts_tree_cursor_current_node_type_id_wasm=Module._ts_tree_cursor_current_node_type_id_wasm=wasmExports.ts_tree_cursor_current_node_type_id_wasm)(e),_ts_tree_cursor_current_node_state_id_wasm=Module._ts_tree_cursor_current_node_state_id_wasm=e=>(_ts_tree_cursor_current_node_state_id_wasm=Module._ts_tree_cursor_current_node_state_id_wasm=wasmExports.ts_tree_cursor_current_node_state_id_wasm)(e),_ts_tree_cursor_current_node_is_named_wasm=Module._ts_tree_cursor_current_node_is_named_wasm=e=>(_ts_tree_cursor_current_node_is_named_wasm=Module._ts_tree_cursor_current_node_is_named_wasm=wasmExports.ts_tree_cursor_current_node_is_named_wasm)(e),_ts_tree_cursor_current_node_is_missing_wasm=Module._ts_tree_cursor_current_node_is_missing_wasm=e=>(_ts_tree_cursor_current_node_is_missing_wasm=Module._ts_tree_cursor_current_node_is_missing_wasm=wasmExports.ts_tree_cursor_current_node_is_missing_wasm)(e),_ts_tree_cursor_current_node_id_wasm=Module._ts_tree_cursor_current_node_id_wasm=e=>(_ts_tree_cursor_current_node_id_wasm=Module._ts_tree_cursor_current_node_id_wasm=wasmExports.ts_tree_cursor_current_node_id_wasm)(e),_ts_tree_cursor_start_position_wasm=Module._ts_tree_cursor_start_position_wasm=e=>(_ts_tree_cursor_start_position_wasm=Module._ts_tree_cursor_start_position_wasm=wasmExports.ts_tree_cursor_start_position_wasm)(e),_ts_tree_cursor_end_position_wasm=Module._ts_tree_cursor_end_position_wasm=e=>(_ts_tree_cursor_end_position_wasm=Module._ts_tree_cursor_end_position_wasm=wasmExports.ts_tree_cursor_end_position_wasm)(e),_ts_tree_cursor_start_index_wasm=Module._ts_tree_cursor_start_index_wasm=e=>(_ts_tree_cursor_start_index_wasm=Module._ts_tree_cursor_start_index_wasm=wasmExports.ts_tree_cursor_start_index_wasm)(e),_ts_tree_cursor_end_index_wasm=Module._ts_tree_cursor_end_index_wasm=e=>(_ts_tree_cursor_end_index_wasm=Module._ts_tree_cursor_end_index_wasm=wasmExports.ts_tree_cursor_end_index_wasm)(e),_ts_tree_cursor_current_field_id_wasm=Module._ts_tree_cursor_current_field_id_wasm=e=>(_ts_tree_cursor_current_field_id_wasm=Module._ts_tree_cursor_current_field_id_wasm=wasmExports.ts_tree_cursor_current_field_id_wasm)(e),_ts_tree_cursor_current_depth_wasm=Module._ts_tree_cursor_current_depth_wasm=e=>(_ts_tree_cursor_current_depth_wasm=Module._ts_tree_cursor_current_depth_wasm=wasmExports.ts_tree_cursor_current_depth_wasm)(e),_ts_tree_cursor_current_descendant_index_wasm=Module._ts_tree_cursor_current_descendant_index_wasm=e=>(_ts_tree_cursor_current_descendant_index_wasm=Module._ts_tree_cursor_current_descendant_index_wasm=wasmExports.ts_tree_cursor_current_descendant_index_wasm)(e),_ts_tree_cursor_current_node_wasm=Module._ts_tree_cursor_current_node_wasm=e=>(_ts_tree_cursor_current_node_wasm=Module._ts_tree_cursor_current_node_wasm=wasmExports.ts_tree_cursor_current_node_wasm)(e),_ts_node_symbol_wasm=Module._ts_node_symbol_wasm=e=>(_ts_node_symbol_wasm=Module._ts_node_symbol_wasm=wasmExports.ts_node_symbol_wasm)(e),_ts_node_field_name_for_child_wasm=Module._ts_node_field_name_for_child_wasm=(e,t)=>(_ts_node_field_name_for_child_wasm=Module._ts_node_field_name_for_child_wasm=wasmExports.ts_node_field_name_for_child_wasm)(e,t),_ts_node_children_by_field_id_wasm=Module._ts_node_children_by_field_id_wasm=(e,t)=>(_ts_node_children_by_field_id_wasm=Module._ts_node_children_by_field_id_wasm=wasmExports.ts_node_children_by_field_id_wasm)(e,t),_ts_node_first_child_for_byte_wasm=Module._ts_node_first_child_for_byte_wasm=e=>(_ts_node_first_child_for_byte_wasm=Module._ts_node_first_child_for_byte_wasm=wasmExports.ts_node_first_child_for_byte_wasm)(e),_ts_node_first_named_child_for_byte_wasm=Module._ts_node_first_named_child_for_byte_wasm=e=>(_ts_node_first_named_child_for_byte_wasm=Module._ts_node_first_named_child_for_byte_wasm=wasmExports.ts_node_first_named_child_for_byte_wasm)(e),_ts_node_grammar_symbol_wasm=Module._ts_node_grammar_symbol_wasm=e=>(_ts_node_grammar_symbol_wasm=Module._ts_node_grammar_symbol_wasm=wasmExports.ts_node_grammar_symbol_wasm)(e),_ts_node_child_count_wasm=Module._ts_node_child_count_wasm=e=>(_ts_node_child_count_wasm=Module._ts_node_child_count_wasm=wasmExports.ts_node_child_count_wasm)(e),_ts_node_named_child_count_wasm=Module._ts_node_named_child_count_wasm=e=>(_ts_node_named_child_count_wasm=Module._ts_node_named_child_count_wasm=wasmExports.ts_node_named_child_count_wasm)(e),_ts_node_child_wasm=Module._ts_node_child_wasm=(e,t)=>(_ts_node_child_wasm=Module._ts_node_child_wasm=wasmExports.ts_node_child_wasm)(e,t),_ts_node_named_child_wasm=Module._ts_node_named_child_wasm=(e,t)=>(_ts_node_named_child_wasm=Module._ts_node_named_child_wasm=wasmExports.ts_node_named_child_wasm)(e,t),_ts_node_child_by_field_id_wasm=Module._ts_node_child_by_field_id_wasm=(e,t)=>(_ts_node_child_by_field_id_wasm=Module._ts_node_child_by_field_id_wasm=wasmExports.ts_node_child_by_field_id_wasm)(e,t),_ts_node_next_sibling_wasm=Module._ts_node_next_sibling_wasm=e=>(_ts_node_next_sibling_wasm=Module._ts_node_next_sibling_wasm=wasmExports.ts_node_next_sibling_wasm)(e),_ts_node_prev_sibling_wasm=Module._ts_node_prev_sibling_wasm=e=>(_ts_node_prev_sibling_wasm=Module._ts_node_prev_sibling_wasm=wasmExports.ts_node_prev_sibling_wasm)(e),_ts_node_next_named_sibling_wasm=Module._ts_node_next_named_sibling_wasm=e=>(_ts_node_next_named_sibling_wasm=Module._ts_node_next_named_sibling_wasm=wasmExports.ts_node_next_named_sibling_wasm)(e),_ts_node_prev_named_sibling_wasm=Module._ts_node_prev_named_sibling_wasm=e=>(_ts_node_prev_named_sibling_wasm=Module._ts_node_prev_named_sibling_wasm=wasmExports.ts_node_prev_named_sibling_wasm)(e),_ts_node_descendant_count_wasm=Module._ts_node_descendant_count_wasm=e=>(_ts_node_descendant_count_wasm=Module._ts_node_descendant_count_wasm=wasmExports.ts_node_descendant_count_wasm)(e),_ts_node_parent_wasm=Module._ts_node_parent_wasm=e=>(_ts_node_parent_wasm=Module._ts_node_parent_wasm=wasmExports.ts_node_parent_wasm)(e),_ts_node_descendant_for_index_wasm=Module._ts_node_descendant_for_index_wasm=e=>(_ts_node_descendant_for_index_wasm=Module._ts_node_descendant_for_index_wasm=wasmExports.ts_node_descendant_for_index_wasm)(e),_ts_node_named_descendant_for_index_wasm=Module._ts_node_named_descendant_for_index_wasm=e=>(_ts_node_named_descendant_for_index_wasm=Module._ts_node_named_descendant_for_index_wasm=wasmExports.ts_node_named_descendant_for_index_wasm)(e),_ts_node_descendant_for_position_wasm=Module._ts_node_descendant_for_position_wasm=e=>(_ts_node_descendant_for_position_wasm=Module._ts_node_descendant_for_position_wasm=wasmExports.ts_node_descendant_for_position_wasm)(e),_ts_node_named_descendant_for_position_wasm=Module._ts_node_named_descendant_for_position_wasm=e=>(_ts_node_named_descendant_for_position_wasm=Module._ts_node_named_descendant_for_position_wasm=wasmExports.ts_node_named_descendant_for_position_wasm)(e),_ts_node_start_point_wasm=Module._ts_node_start_point_wasm=e=>(_ts_node_start_point_wasm=Module._ts_node_start_point_wasm=wasmExports.ts_node_start_point_wasm)(e),_ts_node_end_point_wasm=Module._ts_node_end_point_wasm=e=>(_ts_node_end_point_wasm=Module._ts_node_end_point_wasm=wasmExports.ts_node_end_point_wasm)(e),_ts_node_start_index_wasm=Module._ts_node_start_index_wasm=e=>(_ts_node_start_index_wasm=Module._ts_node_start_index_wasm=wasmExports.ts_node_start_index_wasm)(e),_ts_node_end_index_wasm=Module._ts_node_end_index_wasm=e=>(_ts_node_end_index_wasm=Module._ts_node_end_index_wasm=wasmExports.ts_node_end_index_wasm)(e),_ts_node_to_string_wasm=Module._ts_node_to_string_wasm=e=>(_ts_node_to_string_wasm=Module._ts_node_to_string_wasm=wasmExports.ts_node_to_string_wasm)(e),_ts_node_children_wasm=Module._ts_node_children_wasm=e=>(_ts_node_children_wasm=Module._ts_node_children_wasm=wasmExports.ts_node_children_wasm)(e),_ts_node_named_children_wasm=Module._ts_node_named_children_wasm=e=>(_ts_node_named_children_wasm=Module._ts_node_named_children_wasm=wasmExports.ts_node_named_children_wasm)(e),_ts_node_descendants_of_type_wasm=Module._ts_node_descendants_of_type_wasm=(e,t,r,n,s,a,o)=>(_ts_node_descendants_of_type_wasm=Module._ts_node_descendants_of_type_wasm=wasmExports.ts_node_descendants_of_type_wasm)(e,t,r,n,s,a,o),_ts_node_is_named_wasm=Module._ts_node_is_named_wasm=e=>(_ts_node_is_named_wasm=Module._ts_node_is_named_wasm=wasmExports.ts_node_is_named_wasm)(e),_ts_node_has_changes_wasm=Module._ts_node_has_changes_wasm=e=>(_ts_node_has_changes_wasm=Module._ts_node_has_changes_wasm=wasmExports.ts_node_has_changes_wasm)(e),_ts_node_has_error_wasm=Module._ts_node_has_error_wasm=e=>(_ts_node_has_error_wasm=Module._ts_node_has_error_wasm=wasmExports.ts_node_has_error_wasm)(e),_ts_node_is_error_wasm=Module._ts_node_is_error_wasm=e=>(_ts_node_is_error_wasm=Module._ts_node_is_error_wasm=wasmExports.ts_node_is_error_wasm)(e),_ts_node_is_missing_wasm=Module._ts_node_is_missing_wasm=e=>(_ts_node_is_missing_wasm=Module._ts_node_is_missing_wasm=wasmExports.ts_node_is_missing_wasm)(e),_ts_node_is_extra_wasm=Module._ts_node_is_extra_wasm=e=>(_ts_node_is_extra_wasm=Module._ts_node_is_extra_wasm=wasmExports.ts_node_is_extra_wasm)(e),_ts_node_parse_state_wasm=Module._ts_node_parse_state_wasm=e=>(_ts_node_parse_state_wasm=Module._ts_node_parse_state_wasm=wasmExports.ts_node_parse_state_wasm)(e),_ts_node_next_parse_state_wasm=Module._ts_node_next_parse_state_wasm=e=>(_ts_node_next_parse_state_wasm=Module._ts_node_next_parse_state_wasm=wasmExports.ts_node_next_parse_state_wasm)(e),_ts_query_matches_wasm=Module._ts_query_matches_wasm=(e,t,r,n,s,a,o,c,l,u)=>(_ts_query_matches_wasm=Module._ts_query_matches_wasm=wasmExports.ts_query_matches_wasm)(e,t,r,n,s,a,o,c,l,u),_ts_query_captures_wasm=Module._ts_query_captures_wasm=(e,t,r,n,s,a,o,c,l,u)=>(_ts_query_captures_wasm=Module._ts_query_captures_wasm=wasmExports.ts_query_captures_wasm)(e,t,r,n,s,a,o,c,l,u),_iswalpha=Module._iswalpha=e=>(_iswalpha=Module._iswalpha=wasmExports.iswalpha)(e),_iswblank=Module._iswblank=e=>(_iswblank=Module._iswblank=wasmExports.iswblank)(e),_iswdigit=Module._iswdigit=e=>(_iswdigit=Module._iswdigit=wasmExports.iswdigit)(e),_iswlower=Module._iswlower=e=>(_iswlower=Module._iswlower=wasmExports.iswlower)(e),_iswupper=Module._iswupper=e=>(_iswupper=Module._iswupper=wasmExports.iswupper)(e),_iswxdigit=Module._iswxdigit=e=>(_iswxdigit=Module._iswxdigit=wasmExports.iswxdigit)(e),_memchr=Module._memchr=(e,t,r)=>(_memchr=Module._memchr=wasmExports.memchr)(e,t,r),_strlen=Module._strlen=e=>(_strlen=Module._strlen=wasmExports.strlen)(e),_strcmp=Module._strcmp=(e,t)=>(_strcmp=Module._strcmp=wasmExports.strcmp)(e,t),_strncat=Module._strncat=(e,t,r)=>(_strncat=Module._strncat=wasmExports.strncat)(e,t,r),_strncpy=Module._strncpy=(e,t,r)=>(_strncpy=Module._strncpy=wasmExports.strncpy)(e,t,r),_towlower=Module._towlower=e=>(_towlower=Module._towlower=wasmExports.towlower)(e),_towupper=Module._towupper=e=>(_towupper=Module._towupper=wasmExports.towupper)(e),_setThrew=(e,t)=>(_setThrew=wasmExports.setThrew)(e,t),stackSave=()=>(stackSave=wasmExports.stackSave)(),stackRestore=e=>(stackRestore=wasmExports.stackRestore)(e),stackAlloc=e=>(stackAlloc=wasmExports.stackAlloc)(e),dynCall_jiji=Module.dynCall_jiji=(e,t,r,n,s)=>(dynCall_jiji=Module.dynCall_jiji=wasmExports.dynCall_jiji)(e,t,r,n,s),_orig$ts_parser_timeout_micros=Module._orig$ts_parser_timeout_micros=e=>(_orig$ts_parser_timeout_micros=Module._orig$ts_parser_timeout_micros=wasmExports.orig$ts_parser_timeout_micros)(e),_orig$ts_parser_set_timeout_micros=Module._orig$ts_parser_set_timeout_micros=(e,t)=>(_orig$ts_parser_set_timeout_micros=Module._orig$ts_parser_set_timeout_micros=wasmExports.orig$ts_parser_set_timeout_micros)(e,t),calledRun;function callMain(e=[]){var t=resolveGlobalSymbol("main").sym;if(t){e.unshift(thisProgram);var r=e.length,n=stackAlloc(4*(r+1)),s=n;e.forEach(o=>{HEAPU32[s>>2]=stringToUTF8OnStack(o),s+=4}),HEAPU32[s>>2]=0;try{var a=t(r,n);return exitJS(a,!0),a}catch(o){return handleException(o)}}}function run(e=arguments_){function t(){calledRun||(calledRun=!0,Module.calledRun=!0,ABORT||(initRuntime(),preMain(),Module.onRuntimeInitialized&&Module.onRuntimeInitialized(),shouldRunNow&&callMain(e),postRun()))}runDependencies>0||(preRun(),runDependencies>0||(Module.setStatus?(Module.setStatus("Running..."),setTimeout(function(){setTimeout(function(){Module.setStatus("")},1),t()},1)):t()))}if(Module.AsciiToString=AsciiToString,Module.stringToUTF16=stringToUTF16,dependenciesFulfilled=function e(){calledRun||run(),calledRun||(dependenciesFulfilled=e)},Module.preInit)for(typeof Module.preInit=="function"&&(Module.preInit=[Module.preInit]);Module.preInit.length>0;)Module.preInit.pop()();var shouldRunNow=!0;Module.noInitialRun&&(shouldRunNow=!1),run();let C=Module,INTERNAL={},SIZE_OF_INT=4,SIZE_OF_CURSOR=4*SIZE_OF_INT,SIZE_OF_NODE=5*SIZE_OF_INT,SIZE_OF_POINT=2*SIZE_OF_INT,SIZE_OF_RANGE=2*SIZE_OF_INT+2*SIZE_OF_POINT,ZERO_POINT={row:0,column:0},QUERY_WORD_REGEX=/[\w-.]*/g,PREDICATE_STEP_TYPE_CAPTURE=1,PREDICATE_STEP_TYPE_STRING=2,LANGUAGE_FUNCTION_REGEX=/^_?tree_sitter_\w+/,VERSION,MIN_COMPATIBLE_VERSION,TRANSFER_BUFFER,currentParseCallback,currentLogCallback;class ParserImpl{static init(){TRANSFER_BUFFER=C._ts_init(),VERSION=getValue(TRANSFER_BUFFER,"i32"),MIN_COMPATIBLE_VERSION=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32")}initialize(){C._ts_parser_new_wasm(),this[0]=getValue(TRANSFER_BUFFER,"i32"),this[1]=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32")}delete(){C._ts_parser_delete(this[0]),C._free(this[1]),this[0]=0,this[1]=0}setLanguage(t){let r;if(t){if(t.constructor!==Language)throw new Error("Argument must be a Language");{r=t[0];let n=C._ts_language_version(r);if(n<MIN_COMPATIBLE_VERSION||VERSION<n)throw new Error(`Incompatible language version ${n}. Compatibility range ${MIN_COMPATIBLE_VERSION} through ${VERSION}.`)}}else r=0,t=null;return this.language=t,C._ts_parser_set_language(this[0],r),this}getLanguage(){return this.language}parse(t,r,n){if(typeof t=="string")currentParseCallback=(l,u)=>t.slice(l);else{if(typeof t!="function")throw new Error("Argument must be a string or a function");currentParseCallback=t}this.logCallback?(currentLogCallback=this.logCallback,C._ts_parser_enable_logger_wasm(this[0],1)):(currentLogCallback=null,C._ts_parser_enable_logger_wasm(this[0],0));let s=0,a=0;if(n?.includedRanges){s=n.includedRanges.length,a=C._calloc(s,SIZE_OF_RANGE);let l=a;for(let u=0;u<s;u++)marshalRange(l,n.includedRanges[u]),l+=SIZE_OF_RANGE}let o=C._ts_parser_parse_wasm(this[0],this[1],r?r[0]:0,a,s);if(!o)throw currentParseCallback=null,currentLogCallback=null,new Error("Parsing failed");let c=new Tree(INTERNAL,o,this.language,currentParseCallback);return currentParseCallback=null,currentLogCallback=null,c}reset(){C._ts_parser_reset(this[0])}getIncludedRanges(){C._ts_parser_included_ranges_wasm(this[0]);let t=getValue(TRANSFER_BUFFER,"i32"),r=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),n=new Array(t);if(t>0){let s=r;for(let a=0;a<t;a++)n[a]=unmarshalRange(s),s+=SIZE_OF_RANGE;C._free(r)}return n}getTimeoutMicros(){return C._ts_parser_timeout_micros(this[0])}setTimeoutMicros(t){C._ts_parser_set_timeout_micros(this[0],t)}setLogger(t){if(t){if(typeof t!="function")throw new Error("Logger callback must be a function")}else t=null;return this.logCallback=t,this}getLogger(){return this.logCallback}}class Tree{constructor(t,r,n,s){assertInternal(t),this[0]=r,this.language=n,this.textCallback=s}copy(){let t=C._ts_tree_copy(this[0]);return new Tree(INTERNAL,t,this.language,this.textCallback)}delete(){C._ts_tree_delete(this[0]),this[0]=0}edit(t){marshalEdit(t),C._ts_tree_edit_wasm(this[0])}get rootNode(){return C._ts_tree_root_node_wasm(this[0]),unmarshalNode(this)}rootNodeWithOffset(t,r){let n=TRANSFER_BUFFER+SIZE_OF_NODE;return setValue(n,t,"i32"),marshalPoint(n+SIZE_OF_INT,r),C._ts_tree_root_node_with_offset_wasm(this[0]),unmarshalNode(this)}getLanguage(){return this.language}walk(){return this.rootNode.walk()}getChangedRanges(t){if(t.constructor!==Tree)throw new TypeError("Argument must be a Tree");C._ts_tree_get_changed_ranges_wasm(this[0],t[0]);let r=getValue(TRANSFER_BUFFER,"i32"),n=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),s=new Array(r);if(r>0){let a=n;for(let o=0;o<r;o++)s[o]=unmarshalRange(a),a+=SIZE_OF_RANGE;C._free(n)}return s}getIncludedRanges(){C._ts_tree_included_ranges_wasm(this[0]);let t=getValue(TRANSFER_BUFFER,"i32"),r=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),n=new Array(t);if(t>0){let s=r;for(let a=0;a<t;a++)n[a]=unmarshalRange(s),s+=SIZE_OF_RANGE;C._free(r)}return n}}class Node{constructor(t,r){assertInternal(t),this.tree=r}get typeId(){return marshalNode(this),C._ts_node_symbol_wasm(this.tree[0])}get grammarId(){return marshalNode(this),C._ts_node_grammar_symbol_wasm(this.tree[0])}get type(){return this.tree.language.types[this.typeId]||"ERROR"}get grammarType(){return this.tree.language.types[this.grammarId]||"ERROR"}get endPosition(){return marshalNode(this),C._ts_node_end_point_wasm(this.tree[0]),unmarshalPoint(TRANSFER_BUFFER)}get endIndex(){return marshalNode(this),C._ts_node_end_index_wasm(this.tree[0])}get text(){return getText(this.tree,this.startIndex,this.endIndex)}get parseState(){return marshalNode(this),C._ts_node_parse_state_wasm(this.tree[0])}get nextParseState(){return marshalNode(this),C._ts_node_next_parse_state_wasm(this.tree[0])}get isNamed(){return marshalNode(this),C._ts_node_is_named_wasm(this.tree[0])===1}get hasError(){return marshalNode(this),C._ts_node_has_error_wasm(this.tree[0])===1}get hasChanges(){return marshalNode(this),C._ts_node_has_changes_wasm(this.tree[0])===1}get isError(){return marshalNode(this),C._ts_node_is_error_wasm(this.tree[0])===1}get isMissing(){return marshalNode(this),C._ts_node_is_missing_wasm(this.tree[0])===1}get isExtra(){return marshalNode(this),C._ts_node_is_extra_wasm(this.tree[0])===1}equals(t){return this.id===t.id}child(t){return marshalNode(this),C._ts_node_child_wasm(this.tree[0],t),unmarshalNode(this.tree)}namedChild(t){return marshalNode(this),C._ts_node_named_child_wasm(this.tree[0],t),unmarshalNode(this.tree)}childForFieldId(t){return marshalNode(this),C._ts_node_child_by_field_id_wasm(this.tree[0],t),unmarshalNode(this.tree)}childForFieldName(t){let r=this.tree.language.fields.indexOf(t);return r!==-1?this.childForFieldId(r):null}fieldNameForChild(t){marshalNode(this);let r=C._ts_node_field_name_for_child_wasm(this.tree[0],t);return r?AsciiToString(r):null}childrenForFieldName(t){let r=this.tree.language.fields.indexOf(t);return r!==-1&&r!==0?this.childrenForFieldId(r):[]}childrenForFieldId(t){marshalNode(this),C._ts_node_children_by_field_id_wasm(this.tree[0],t);let r=getValue(TRANSFER_BUFFER,"i32"),n=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),s=new Array(r);if(r>0){let a=n;for(let o=0;o<r;o++)s[o]=unmarshalNode(this.tree,a),a+=SIZE_OF_NODE;C._free(n)}return s}firstChildForIndex(t){return marshalNode(this),setValue(TRANSFER_BUFFER+SIZE_OF_NODE,t,"i32"),C._ts_node_first_child_for_byte_wasm(this.tree[0]),unmarshalNode(this.tree)}firstNamedChildForIndex(t){return marshalNode(this),setValue(TRANSFER_BUFFER+SIZE_OF_NODE,t,"i32"),C._ts_node_first_named_child_for_byte_wasm(this.tree[0]),unmarshalNode(this.tree)}get childCount(){return marshalNode(this),C._ts_node_child_count_wasm(this.tree[0])}get namedChildCount(){return marshalNode(this),C._ts_node_named_child_count_wasm(this.tree[0])}get firstChild(){return this.child(0)}get firstNamedChild(){return this.namedChild(0)}get lastChild(){return this.child(this.childCount-1)}get lastNamedChild(){return this.namedChild(this.namedChildCount-1)}get children(){if(!this._children){marshalNode(this),C._ts_node_children_wasm(this.tree[0]);let t=getValue(TRANSFER_BUFFER,"i32"),r=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32");if(this._children=new Array(t),t>0){let n=r;for(let s=0;s<t;s++)this._children[s]=unmarshalNode(this.tree,n),n+=SIZE_OF_NODE;C._free(r)}}return this._children}get namedChildren(){if(!this._namedChildren){marshalNode(this),C._ts_node_named_children_wasm(this.tree[0]);let t=getValue(TRANSFER_BUFFER,"i32"),r=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32");if(this._namedChildren=new Array(t),t>0){let n=r;for(let s=0;s<t;s++)this._namedChildren[s]=unmarshalNode(this.tree,n),n+=SIZE_OF_NODE;C._free(r)}}return this._namedChildren}descendantsOfType(t,r,n){Array.isArray(t)||(t=[t]),r||(r=ZERO_POINT),n||(n=ZERO_POINT);let s=[],a=this.tree.language.types;for(let d=0,p=a.length;d<p;d++)t.includes(a[d])&&s.push(d);let o=C._malloc(SIZE_OF_INT*s.length);for(let d=0,p=s.length;d<p;d++)setValue(o+d*SIZE_OF_INT,s[d],"i32");marshalNode(this),C._ts_node_descendants_of_type_wasm(this.tree[0],o,s.length,r.row,r.column,n.row,n.column);let c=getValue(TRANSFER_BUFFER,"i32"),l=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),u=new Array(c);if(c>0){let d=l;for(let p=0;p<c;p++)u[p]=unmarshalNode(this.tree,d),d+=SIZE_OF_NODE}return C._free(l),C._free(o),u}get nextSibling(){return marshalNode(this),C._ts_node_next_sibling_wasm(this.tree[0]),unmarshalNode(this.tree)}get previousSibling(){return marshalNode(this),C._ts_node_prev_sibling_wasm(this.tree[0]),unmarshalNode(this.tree)}get nextNamedSibling(){return marshalNode(this),C._ts_node_next_named_sibling_wasm(this.tree[0]),unmarshalNode(this.tree)}get previousNamedSibling(){return marshalNode(this),C._ts_node_prev_named_sibling_wasm(this.tree[0]),unmarshalNode(this.tree)}get descendantCount(){return marshalNode(this),C._ts_node_descendant_count_wasm(this.tree[0])}get parent(){return marshalNode(this),C._ts_node_parent_wasm(this.tree[0]),unmarshalNode(this.tree)}descendantForIndex(t,r=t){if(typeof t!="number"||typeof r!="number")throw new Error("Arguments must be numbers");marshalNode(this);let n=TRANSFER_BUFFER+SIZE_OF_NODE;return setValue(n,t,"i32"),setValue(n+SIZE_OF_INT,r,"i32"),C._ts_node_descendant_for_index_wasm(this.tree[0]),unmarshalNode(this.tree)}namedDescendantForIndex(t,r=t){if(typeof t!="number"||typeof r!="number")throw new Error("Arguments must be numbers");marshalNode(this);let n=TRANSFER_BUFFER+SIZE_OF_NODE;return setValue(n,t,"i32"),setValue(n+SIZE_OF_INT,r,"i32"),C._ts_node_named_descendant_for_index_wasm(this.tree[0]),unmarshalNode(this.tree)}descendantForPosition(t,r=t){if(!isPoint(t)||!isPoint(r))throw new Error("Arguments must be {row, column} objects");marshalNode(this);let n=TRANSFER_BUFFER+SIZE_OF_NODE;return marshalPoint(n,t),marshalPoint(n+SIZE_OF_POINT,r),C._ts_node_descendant_for_position_wasm(this.tree[0]),unmarshalNode(this.tree)}namedDescendantForPosition(t,r=t){if(!isPoint(t)||!isPoint(r))throw new Error("Arguments must be {row, column} objects");marshalNode(this);let n=TRANSFER_BUFFER+SIZE_OF_NODE;return marshalPoint(n,t),marshalPoint(n+SIZE_OF_POINT,r),C._ts_node_named_descendant_for_position_wasm(this.tree[0]),unmarshalNode(this.tree)}walk(){return marshalNode(this),C._ts_tree_cursor_new_wasm(this.tree[0]),new TreeCursor(INTERNAL,this.tree)}toString(){marshalNode(this);let t=C._ts_node_to_string_wasm(this.tree[0]),r=AsciiToString(t);return C._free(t),r}}class TreeCursor{constructor(t,r){assertInternal(t),this.tree=r,unmarshalTreeCursor(this)}delete(){marshalTreeCursor(this),C._ts_tree_cursor_delete_wasm(this.tree[0]),this[0]=this[1]=this[2]=0}reset(t){marshalNode(t),marshalTreeCursor(this,TRANSFER_BUFFER+SIZE_OF_NODE),C._ts_tree_cursor_reset_wasm(this.tree[0]),unmarshalTreeCursor(this)}resetTo(t){marshalTreeCursor(this,TRANSFER_BUFFER),marshalTreeCursor(t,TRANSFER_BUFFER+SIZE_OF_CURSOR),C._ts_tree_cursor_reset_to_wasm(this.tree[0],t.tree[0]),unmarshalTreeCursor(this)}get nodeType(){return this.tree.language.types[this.nodeTypeId]||"ERROR"}get nodeTypeId(){return marshalTreeCursor(this),C._ts_tree_cursor_current_node_type_id_wasm(this.tree[0])}get nodeStateId(){return marshalTreeCursor(this),C._ts_tree_cursor_current_node_state_id_wasm(this.tree[0])}get nodeId(){return marshalTreeCursor(this),C._ts_tree_cursor_current_node_id_wasm(this.tree[0])}get nodeIsNamed(){return marshalTreeCursor(this),C._ts_tree_cursor_current_node_is_named_wasm(this.tree[0])===1}get nodeIsMissing(){return marshalTreeCursor(this),C._ts_tree_cursor_current_node_is_missing_wasm(this.tree[0])===1}get nodeText(){marshalTreeCursor(this);let t=C._ts_tree_cursor_start_index_wasm(this.tree[0]),r=C._ts_tree_cursor_end_index_wasm(this.tree[0]);return getText(this.tree,t,r)}get startPosition(){return marshalTreeCursor(this),C._ts_tree_cursor_start_position_wasm(this.tree[0]),unmarshalPoint(TRANSFER_BUFFER)}get endPosition(){return marshalTreeCursor(this),C._ts_tree_cursor_end_position_wasm(this.tree[0]),unmarshalPoint(TRANSFER_BUFFER)}get startIndex(){return marshalTreeCursor(this),C._ts_tree_cursor_start_index_wasm(this.tree[0])}get endIndex(){return marshalTreeCursor(this),C._ts_tree_cursor_end_index_wasm(this.tree[0])}get currentNode(){return marshalTreeCursor(this),C._ts_tree_cursor_current_node_wasm(this.tree[0]),unmarshalNode(this.tree)}get currentFieldId(){return marshalTreeCursor(this),C._ts_tree_cursor_current_field_id_wasm(this.tree[0])}get currentFieldName(){return this.tree.language.fields[this.currentFieldId]}get currentDepth(){return marshalTreeCursor(this),C._ts_tree_cursor_current_depth_wasm(this.tree[0])}get currentDescendantIndex(){return marshalTreeCursor(this),C._ts_tree_cursor_current_descendant_index_wasm(this.tree[0])}gotoFirstChild(){marshalTreeCursor(this);let t=C._ts_tree_cursor_goto_first_child_wasm(this.tree[0]);return unmarshalTreeCursor(this),t===1}gotoLastChild(){marshalTreeCursor(this);let t=C._ts_tree_cursor_goto_last_child_wasm(this.tree[0]);return unmarshalTreeCursor(this),t===1}gotoFirstChildForIndex(t){marshalTreeCursor(this),setValue(TRANSFER_BUFFER+SIZE_OF_CURSOR,t,"i32");let r=C._ts_tree_cursor_goto_first_child_for_index_wasm(this.tree[0]);return unmarshalTreeCursor(this),r===1}gotoFirstChildForPosition(t){marshalTreeCursor(this),marshalPoint(TRANSFER_BUFFER+SIZE_OF_CURSOR,t);let r=C._ts_tree_cursor_goto_first_child_for_position_wasm(this.tree[0]);return unmarshalTreeCursor(this),r===1}gotoNextSibling(){marshalTreeCursor(this);let t=C._ts_tree_cursor_goto_next_sibling_wasm(this.tree[0]);return unmarshalTreeCursor(this),t===1}gotoPreviousSibling(){marshalTreeCursor(this);let t=C._ts_tree_cursor_goto_previous_sibling_wasm(this.tree[0]);return unmarshalTreeCursor(this),t===1}gotoDescendant(t){marshalTreeCursor(this),C._ts_tree_cursor_goto_descendant_wasm(this.tree[0],t),unmarshalTreeCursor(this)}gotoParent(){marshalTreeCursor(this);let t=C._ts_tree_cursor_goto_parent_wasm(this.tree[0]);return unmarshalTreeCursor(this),t===1}}class Language{constructor(t,r){assertInternal(t),this[0]=r,this.types=new Array(C._ts_language_symbol_count(this[0]));for(let n=0,s=this.types.length;n<s;n++)C._ts_language_symbol_type(this[0],n)<2&&(this.types[n]=UTF8ToString(C._ts_language_symbol_name(this[0],n)));this.fields=new Array(C._ts_language_field_count(this[0])+1);for(let n=0,s=this.fields.length;n<s;n++){let a=C._ts_language_field_name_for_id(this[0],n);this.fields[n]=a!==0?UTF8ToString(a):null}}get version(){return C._ts_language_version(this[0])}get fieldCount(){return this.fields.length-1}get stateCount(){return C._ts_language_state_count(this[0])}fieldIdForName(t){let r=this.fields.indexOf(t);return r!==-1?r:null}fieldNameForId(t){return this.fields[t]||null}idForNodeType(t,r){let n=lengthBytesUTF8(t),s=C._malloc(n+1);stringToUTF8(t,s,n+1);let a=C._ts_language_symbol_for_name(this[0],s,n,r);return C._free(s),a||null}get nodeTypeCount(){return C._ts_language_symbol_count(this[0])}nodeTypeForId(t){let r=C._ts_language_symbol_name(this[0],t);return r?UTF8ToString(r):null}nodeTypeIsNamed(t){return!!C._ts_language_type_is_named_wasm(this[0],t)}nodeTypeIsVisible(t){return!!C._ts_language_type_is_visible_wasm(this[0],t)}nextState(t,r){return C._ts_language_next_state(this[0],t,r)}lookaheadIterator(t){let r=C._ts_lookahead_iterator_new(this[0],t);return r?new LookaheadIterable(INTERNAL,r,this):null}query(t){let r=lengthBytesUTF8(t),n=C._malloc(r+1);stringToUTF8(t,n,r+1);let s=C._ts_query_new(this[0],n,r,TRANSFER_BUFFER,TRANSFER_BUFFER+SIZE_OF_INT);if(!s){let g=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),y=getValue(TRANSFER_BUFFER,"i32"),_=UTF8ToString(n,y).length,v=t.substr(_,100).split(`
|
|
65
|
+
`));if(!b){b=null;break e}x=Array(St(b)+1),b=ir(b,x,0,x.length),x.length=b,_t=x}b=_t.shift()}return b},ub(b,x){x===null||x===10?(y(Qe(b.output)),b.output=[]):x!=0&&b.output.push(x)},fsync(b){0<b.output?.length&&(y(Qe(b.output)),b.output=[])},hc(){return{bc:25856,dc:5,ac:191,cc:35387,$b:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}},ic(){return 0},jc(){return[24,80]}},qa={ub(b,x){x===null||x===10?(_(Qe(b.output)),b.output=[]):x!=0&&b.output.push(x)},fsync(b){0<b.output?.length&&(_(Qe(b.output)),b.output=[])}},ut={Wa:null,Xa(){return ut.createNode(null,"/",16895,0)},createNode(b,x,P,U){if((P&61440)===24576||(P&61440)===4096)throw new oe(63);return ut.Wa||(ut.Wa={dir:{node:{Ta:ut.La.Ta,Ua:ut.La.Ua,lookup:ut.La.lookup,ib:ut.La.ib,rename:ut.La.rename,unlink:ut.La.unlink,rmdir:ut.La.rmdir,readdir:ut.La.readdir,symlink:ut.La.symlink},stream:{Va:ut.Ma.Va}},file:{node:{Ta:ut.La.Ta,Ua:ut.La.Ua},stream:{Va:ut.Ma.Va,read:ut.Ma.read,write:ut.Ma.write,jb:ut.Ma.jb,kb:ut.Ma.kb}},link:{node:{Ta:ut.La.Ta,Ua:ut.La.Ua,readlink:ut.La.readlink},stream:{}},yb:{node:{Ta:ut.La.Ta,Ua:ut.La.Ua},stream:mm}}),P=qr(b,x,P,U),fr(P.mode)?(P.La=ut.Wa.dir.node,P.Ma=ut.Wa.dir.stream,P.Na={}):(P.mode&61440)===32768?(P.La=ut.Wa.file.node,P.Ma=ut.Wa.file.stream,P.Ra=0,P.Na=null):(P.mode&61440)===40960?(P.La=ut.Wa.link.node,P.Ma=ut.Wa.link.stream):(P.mode&61440)===8192&&(P.La=ut.Wa.yb.node,P.Ma=ut.Wa.yb.stream),P.atime=P.mtime=P.ctime=Date.now(),b&&(b.Na[x]=P,b.atime=b.mtime=b.ctime=P.atime),P},fc(b){return b.Na?b.Na.subarray?b.Na.subarray(0,b.Ra):new Uint8Array(b.Na):new Uint8Array(0)},La:{Ta(b){var x={};return x.dev=(b.mode&61440)===8192?b.id:1,x.ino=b.id,x.mode=b.mode,x.nlink=1,x.uid=0,x.gid=0,x.rdev=b.rdev,fr(b.mode)?x.size=4096:(b.mode&61440)===32768?x.size=b.Ra:(b.mode&61440)===40960?x.size=b.link.length:x.size=0,x.atime=new Date(b.atime),x.mtime=new Date(b.mtime),x.ctime=new Date(b.ctime),x.blksize=4096,x.blocks=Math.ceil(x.size/x.blksize),x},Ua(b,x){for(var P of["mode","atime","mtime","ctime"])x[P]!=null&&(b[P]=x[P]);x.size!==void 0&&(x=x.size,b.Ra!=x&&(x==0?(b.Na=null,b.Ra=0):(P=b.Na,b.Na=new Uint8Array(x),P&&b.Na.set(P.subarray(0,Math.min(x,b.Ra))),b.Ra=x)))},lookup(){throw ut.nb||(ut.nb=new oe(44),ut.nb.stack="<generic error, no stack>"),ut.nb},ib(b,x,P,U){return ut.createNode(b,x,P,U)},rename(b,x,P){try{var U=yr(x,P)}catch{}if(U){if(fr(b.mode))for(var Q in U.Na)throw new oe(55);Dr(U)}delete b.parent.Na[b.name],x.Na[P]=b,b.name=P,x.ctime=x.mtime=b.parent.ctime=b.parent.mtime=Date.now()},unlink(b,x){delete b.Na[x],b.ctime=b.mtime=Date.now()},rmdir(b,x){var P=yr(b,x),U;for(U in P.Na)throw new oe(55);delete b.Na[x],b.ctime=b.mtime=Date.now()},readdir(b){return[".","..",...Object.keys(b.Na)]},symlink(b,x,P){return b=ut.createNode(b,x,41471,0),b.link=P,b},readlink(b){if((b.mode&61440)!==40960)throw new oe(28);return b.link}},Ma:{read(b,x,P,U,Q){var ce=b.node.Na;if(Q>=b.node.Ra)return 0;if(b=Math.min(b.node.Ra-Q,U),8<b&&ce.subarray)x.set(ce.subarray(Q,Q+b),P);else for(U=0;U<b;U++)x[P+U]=ce[Q+U];return b},write(b,x,P,U,Q,ce){if(x.buffer===k.buffer&&(ce=!1),!U)return 0;if(b=b.node,b.mtime=b.ctime=Date.now(),x.subarray&&(!b.Na||b.Na.subarray)){if(ce)return b.Na=x.subarray(P,P+U),b.Ra=U;if(b.Ra===0&&Q===0)return b.Na=x.slice(P,P+U),b.Ra=U;if(Q+U<=b.Ra)return b.Na.set(x.subarray(P,P+U),Q),U}ce=Q+U;var ge=b.Na?b.Na.length:0;if(ge>=ce||(ce=Math.max(ce,ge*(1048576>ge?2:1.125)>>>0),ge!=0&&(ce=Math.max(ce,256)),ge=b.Na,b.Na=new Uint8Array(ce),0<b.Ra&&b.Na.set(ge.subarray(0,b.Ra),0)),b.Na.subarray&&x.subarray)b.Na.set(x.subarray(P,P+U),Q);else for(ce=0;ce<U;ce++)b.Na[Q+ce]=x[P+ce];return b.Ra=Math.max(b.Ra,Q+U),U},Va(b,x,P){if(P===1?x+=b.position:P===2&&(b.node.mode&61440)===32768&&(x+=b.node.Ra),0>x)throw new oe(28);return x},jb(b,x,P,U,Q){if((b.node.mode&61440)!==32768)throw new oe(43);if(b=b.node.Na,Q&2||!b||b.buffer!==k.buffer){Q=!0,U=65536*Math.ceil(x/65536);var ce=yO(65536,U);if(ce&&N.fill(0,ce,ce+U),U=ce,!U)throw new oe(48);b&&((0<P||P+x<b.length)&&(b.subarray?b=b.subarray(P,P+x):b=Array.prototype.slice.call(b,P,P+x)),k.set(b,U))}else Q=!1,U=b.byteOffset;return{Xb:U,Eb:Q}},kb(b,x,P,U){return ut.Ma.write(b,x,0,U,P,!1),0}}},Oi=(b,x)=>{var P=0;return b&&(P|=365),x&&(P|=146),P},jn=null,Cs={},Wa=[],hm=1,se=null,me=!1,_e=!0,oe=class{name="ErrnoError";constructor(b){this.Pa=b}},it=class{hb={};node=null;get flags(){return this.hb.flags}set flags(b){this.hb.flags=b}get position(){return this.hb.position}set position(b){this.hb.position=b}},Ve=class{La={};Ma={};bb=null;constructor(b,x,P,U){b||=this,this.parent=b,this.Xa=b.Xa,this.id=hm++,this.name=x,this.mode=P,this.rdev=U,this.atime=this.mtime=this.ctime=Date.now()}get read(){return(this.mode&365)===365}set read(b){b?this.mode|=365:this.mode&=-366}get write(){return(this.mode&146)===146}set write(b){b?this.mode|=146:this.mode&=-147}};function mt(b,x={}){if(!b)throw new oe(44);x.pb??(x.pb=!0),b.charAt(0)==="/"||(b="//"+b);var P=0;e:for(;40>P;P++){b=b.split("/").filter(vt=>!!vt);for(var U=jn,Q="/",ce=0;ce<b.length;ce++){var ge=ce===b.length-1;if(ge&&x.parent)break;if(b[ce]!==".")if(b[ce]==="..")if(Q=zr(Q),U===U.parent){b=Q+"/"+b.slice(ce+1).join("/"),P--;continue e}else U=U.parent;else{Q=wt(Q+"/"+b[ce]);try{U=yr(U,b[ce])}catch(vt){if(vt?.Pa===44&&ge&&x.Wb)return{path:Q};throw vt}if(!U.bb||ge&&!x.pb||(U=U.bb.root),(U.mode&61440)===40960&&(!ge||x.ab)){if(!U.La.readlink)throw new oe(52);U=U.La.readlink(U),U.charAt(0)==="/"||(U=zr(Q)+"/"+U),b=U+"/"+b.slice(ce+1).join("/");continue e}}}return{path:Q,node:U}}throw new oe(32)}function sr(b){for(var x;;){if(b===b.parent)return b=b.Xa.Db,x?b[b.length-1]!=="/"?`${b}/${x}`:b+x:b;x=x?`${b.name}/${x}`:b.name,b=b.parent}}function Et(b,x){for(var P=0,U=0;U<x.length;U++)P=(P<<5)-P+x.charCodeAt(U)|0;return(b+P>>>0)%se.length}function Dr(b){var x=Et(b.parent.id,b.name);if(se[x]===b)se[x]=b.cb;else for(x=se[x];x;){if(x.cb===b){x.cb=b.cb;break}x=x.cb}}function yr(b,x){var P=fr(b.mode)?(P=cn(b,"x"))?P:b.La.lookup?0:2:54;if(P)throw new oe(P);for(P=se[Et(b.id,x)];P;P=P.cb){var U=P.name;if(P.parent.id===b.id&&U===x)return P}return b.La.lookup(b,x)}function qr(b,x,P,U){return b=new Ve(b,x,P,U),x=Et(b.parent.id,b.name),b.cb=se[x],se[x]=b}function fr(b){return(b&61440)===16384}function cn(b,x){return _e?0:x.includes("r")&&!(b.mode&292)||x.includes("w")&&!(b.mode&146)||x.includes("x")&&!(b.mode&73)?2:0}function _i(b,x){if(!fr(b.mode))return 54;try{return yr(b,x),20}catch{}return cn(b,"wx")}function bi(b,x,P){try{var U=yr(b,x)}catch(Q){return Q.Pa}if(b=cn(b,"wx"))return b;if(P){if(!fr(U.mode))return 54;if(U===U.parent||sr(U)==="/")return 10}else if(fr(U.mode))return 31;return 0}function ni(b){if(!b)throw new oe(63);return b}function Wr(b){if(b=Wa[b],!b)throw new oe(8);return b}function ml(b,x=-1){if(b=Object.assign(new it,b),x==-1)e:{for(x=0;4096>=x;x++)if(!Wa[x])break e;throw new oe(33)}return b.fd=x,Wa[x]=b}function ii(b,x=-1){return b=ml(b,x),b.Ma?.ec?.(b),b}function Go(b,x,P){var U=b?.Ma.Ua;b=U?b:x,U??=x.La.Ua,ni(U),U(b,P)}var mm={open(b){b.Ma=Cs[b.node.rdev].Ma,b.Ma.open?.(b)},Va(){throw new oe(70)}};function xd(b,x){Cs[b]={Ma:x}}function Sd(b,x){var P=x==="/";if(P&&jn)throw new oe(10);if(!P&&x){var U=mt(x,{pb:!1});if(x=U.path,U=U.node,U.bb)throw new oe(10);if(!fr(U.mode))throw new oe(54)}x={type:b,kc:{},Db:x,Vb:[]},b=b.Xa(x),b.Xa=x,x.root=b,P?jn=b:U&&(U.bb=x,U.Xa&&U.Xa.Vb.push(x))}function Va(b,x,P){var U=mt(b,{parent:!0}).node;if(b=fe(b),!b)throw new oe(28);if(b==="."||b==="..")throw new oe(20);var Q=_i(U,b);if(Q)throw new oe(Q);if(!U.La.ib)throw new oe(63);return U.La.ib(U,b,x,P)}function ia(b,x=438){return Va(b,x&4095|32768,0)}function Bn(b,x=511){return Va(b,x&1023|16384,0)}function Zo(b,x,P){typeof P>"u"&&(P=x,x=438),Va(b,x|8192,P)}function gl(b,x){if(!Oe(b))throw new oe(44);var P=mt(x,{parent:!0}).node;if(!P)throw new oe(44);x=fe(x);var U=_i(P,x);if(U)throw new oe(U);if(!P.La.symlink)throw new oe(63);P.La.symlink(P,x,b)}function Td(b){var x=mt(b,{parent:!0}).node;b=fe(b);var P=yr(x,b),U=bi(x,b,!0);if(U)throw new oe(U);if(!x.La.rmdir)throw new oe(63);if(P.bb)throw new oe(10);x.La.rmdir(x,b),Dr(P)}function oO(b){var x=mt(b,{parent:!0}).node;if(!x)throw new oe(44);b=fe(b);var P=yr(x,b),U=bi(x,b,!1);if(U)throw new oe(U);if(!x.La.unlink)throw new oe(63);if(P.bb)throw new oe(10);x.La.unlink(x,b),Dr(P)}function wd(b,x){return b=mt(b,{ab:!x}).node,ni(b.La.Ta)(b)}function cO(b,x,P,U){Go(b,x,{mode:P&4095|x.mode&-4096,ctime:Date.now(),Lb:U})}function gm(b,x){b=typeof b=="string"?mt(b,{ab:!0}).node:b,cO(null,b,x)}function lO(b,x,P){if(fr(x.mode))throw new oe(31);if((x.mode&61440)!==32768)throw new oe(28);var U=cn(x,"w");if(U)throw new oe(U);Go(b,x,{size:P,timestamp:Date.now()})}function yl(b,x,P=438){if(b==="")throw new oe(44);if(typeof x=="string"){var U={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[x];if(typeof U>"u")throw Error(`Unknown file open mode: ${x}`);x=U}if(P=x&64?P&4095|32768:0,typeof b=="object")U=b;else{var Q=b.endsWith("/"),ce=mt(b,{ab:!(x&131072),Wb:!0});U=ce.node,b=ce.path}if(ce=!1,x&64)if(U){if(x&128)throw new oe(20)}else{if(Q)throw new oe(31);U=Va(b,P|511,0),ce=!0}if(!U)throw new oe(44);if((U.mode&61440)===8192&&(x&=-513),x&65536&&!fr(U.mode))throw new oe(54);if(!ce&&(U?(U.mode&61440)===40960?Q=32:(Q=["r","w","rw"][x&3],x&512&&(Q+="w"),Q=fr(U.mode)&&(Q!=="r"||x&576)?31:cn(U,Q)):Q=44,Q))throw new oe(Q);return x&512&&!ce&&(Q=U,Q=typeof Q=="string"?mt(Q,{ab:!0}).node:Q,lO(null,Q,0)),x=ml({node:U,path:sr(U),flags:x&-131713,seekable:!0,position:0,Ma:U.Ma,Yb:[],error:!1}),x.Ma.open&&x.Ma.open(x),ce&&gm(U,P&511),x}function ox(b){if(b.fd===null)throw new oe(8);b.rb&&(b.rb=null);try{b.Ma.close&&b.Ma.close(b)}catch(x){throw x}finally{Wa[b.fd]=null}b.fd=null}function uO(b,x,P){if(b.fd===null)throw new oe(8);if(!b.seekable||!b.Ma.Va)throw new oe(70);if(P!=0&&P!=1&&P!=2)throw new oe(28);b.position=b.Ma.Va(b,x,P),b.Yb=[]}function dO(b,x,P,U,Q){if(0>U||0>Q)throw new oe(28);if(b.fd===null)throw new oe(8);if((b.flags&2097155)===1)throw new oe(8);if(fr(b.node.mode))throw new oe(31);if(!b.Ma.read)throw new oe(28);var ce=typeof Q<"u";if(!ce)Q=b.position;else if(!b.seekable)throw new oe(70);return x=b.Ma.read(b,x,P,U,Q),ce||(b.position+=x),x}function pO(b,x,P,U,Q){if(0>U||0>Q)throw new oe(28);if(b.fd===null)throw new oe(8);if(!(b.flags&2097155))throw new oe(8);if(fr(b.node.mode))throw new oe(31);if(!b.Ma.write)throw new oe(28);b.seekable&&b.flags&1024&&uO(b,0,2);var ce=typeof Q<"u";if(!ce)Q=b.position;else if(!b.seekable)throw new oe(70);return x=b.Ma.write(b,x,P,U,Q,void 0),ce||(b.position+=x),x}function RV(b){var x=x||0,P="binary";P!=="utf8"&&P!=="binary"&&ae(`Invalid encoding type "${P}"`),x=yl(b,x),b=wd(b).size;var U=new Uint8Array(b);return dO(x,U,0,b,0),P==="utf8"&&(U=Qe(U)),ox(x),U}function Ka(b,x,P){b=wt("/dev/"+b);var U=Oi(!!x,!!P);Ka.Cb??(Ka.Cb=64);var Q=Ka.Cb++<<8|0;xd(Q,{open(ce){ce.seekable=!1},close(){P?.buffer?.length&&P(10)},read(ce,ge,vt,lr){for(var Ct=0,kr=0;kr<lr;kr++){try{var _n=x()}catch{throw new oe(29)}if(_n===void 0&&Ct===0)throw new oe(6);if(_n==null)break;Ct++,ge[vt+kr]=_n}return Ct&&(ce.node.atime=Date.now()),Ct},write(ce,ge,vt,lr){for(var Ct=0;Ct<lr;Ct++)try{P(ge[vt+Ct])}catch{throw new oe(29)}return lr&&(ce.node.mtime=ce.node.ctime=Date.now()),Ct}}),Zo(b,U,Q)}var Ar={};function Ho(b,x,P){if(x.charAt(0)==="/")return x;if(b=b===-100?"/":Wr(b).path,x.length==0){if(!P)throw new oe(44);return b}return b+"/"+x}function ym(b,x){te[b>>2]=x.dev,te[b+4>>2]=x.mode,te[b+8>>2]=x.nlink,te[b+12>>2]=x.uid,te[b+16>>2]=x.gid,te[b+20>>2]=x.rdev,H[b+24>>3]=BigInt(x.size),V[b+32>>2]=4096,V[b+36>>2]=x.blocks;var P=x.atime.getTime(),U=x.mtime.getTime(),Q=x.ctime.getTime();return H[b+40>>3]=BigInt(Math.floor(P/1e3)),te[b+48>>2]=P%1e3*1e6,H[b+56>>3]=BigInt(Math.floor(U/1e3)),te[b+64>>2]=U%1e3*1e6,H[b+72>>3]=BigInt(Math.floor(Q/1e3)),te[b+80>>2]=Q%1e3*1e6,H[b+88>>3]=BigInt(x.ino),0}var _m=void 0,bm=()=>{var b=V[+_m>>2];return _m+=4,b},cx=0,DV=[0,31,60,91,121,152,182,213,244,274,305,335],MV=[0,31,59,90,120,151,181,212,243,273,304,334],Ed={},fO=b=>{w=b,ke||0<cx||(a.onExit?.(b),S=!0),d(b,new z(b))},LV=b=>{if(!S)try{b()}catch(x){x instanceof z||x=="unwind"||d(1,x)}finally{if(!(ke||0<cx))try{w=b=w,fO(b)}catch(x){x instanceof z||x=="unwind"||d(1,x)}}},lx={},hO=()=>{if(!ux){var b={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(globalThis.navigator?.language??"C").replace("-","_")+".UTF-8",_:u||"./this.program"},x;for(x in lx)lx[x]===void 0?delete b[x]:b[x]=lx[x];var P=[];for(x in b)P.push(`${x}=${b[x]}`);ux=P}return ux},ux,FV=(b,x,P,U)=>{var Q={string:Ct=>{var kr=0;if(Ct!=null&&Ct!==0){kr=St(Ct)+1;var _n=Yo(kr);ir(Ct,N,_n,kr),kr=_n}return kr},array:Ct=>{var kr=Yo(Ct.length);return k.set(Ct,kr),kr}};b=a["_"+b];var ce=[],ge=0;if(U)for(var vt=0;vt<U.length;vt++){var lr=Q[P[vt]];lr?(ge===0&&(ge=Tm()),ce[vt]=lr(U[vt])):ce[vt]=U[vt]}return P=b(...ce),P=function(Ct){return ge!==0&&Sm(ge),x==="string"?tt(Ct):x==="boolean"?!!Ct:Ct}(P)},vm=b=>{var x=St(b)+1,P=xm(x);return P&&ir(b,N,P,x),P},Jo,dx=[],Ga=b=>{Jo.delete(Za.get(b)),Za.set(b,null),dx.push(b)},mO=b=>{let x=b.length;return[x%128|128,x>>7,...b]},jV={i:127,p:127,j:126,f:125,d:124,e:111},gO=b=>mO(Array.from(b,x=>jV[x])),Pd=(b,x)=>{if(!Jo){Jo=new WeakMap;var P=Za.length;if(Jo)for(var U=0;U<0+P;U++){var Q=Za.get(U);Q&&Jo.set(Q,U)}}if(P=Jo.get(b)||0)return P;P=dx.length?dx.pop():Za.grow(1);try{Za.set(P,b)}catch(ce){if(!(ce instanceof TypeError))throw ce;x=Uint8Array.of(0,97,115,109,1,0,0,0,1,...mO([1,96,...gO(x.slice(1)),...gO(x[0]==="v"?"":x[0])]),2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0),x=new WebAssembly.Module(x),x=new WebAssembly.Instance(x,{e:{f:b}}).exports.f,Za.set(P,x)}return Jo.set(b,P),P};if(se=Array(4096),Sd(ut,"/"),Bn("/tmp"),Bn("/home"),Bn("/home/web_user"),function(){Bn("/dev"),xd(259,{read:()=>0,write:(U,Q,ce,ge)=>ge,Va:()=>0}),Zo("/dev/null",259),ks(1280,Ni),ks(1536,qa),Zo("/dev/tty",1280),Zo("/dev/tty1",1536);var b=new Uint8Array(1024),x=0,P=()=>(x===0&&(Pe(b),x=b.byteLength),b[--x]);Ka("random",P),Ka("urandom",P),Bn("/dev/shm"),Bn("/dev/shm/tmp")}(),function(){Bn("/proc");var b=Bn("/proc/self");Bn("/proc/self/fd"),Sd({Xa(){var x=qr(b,"fd",16895,73);return x.Ma={Va:ut.Ma.Va},x.La={lookup(P,U){P=+U;var Q=Wr(P);return P={parent:null,Xa:{Db:"fake"},La:{readlink:()=>Q.path},id:P+1},P.parent=P},readdir(){return Array.from(Wa.entries()).filter(([,P])=>P).map(([P])=>P.toString())}},x}},"/proc/self/fd")}(),a.noExitRuntime&&(ke=a.noExitRuntime),a.print&&(y=a.print),a.printErr&&(_=a.printErr),a.wasmBinary&&(v=a.wasmBinary),a.thisProgram&&(u=a.thisProgram),a.preInit)for(typeof a.preInit=="function"&&(a.preInit=[a.preInit]);0<a.preInit.length;)a.preInit.shift()();a.stackSave=()=>Tm(),a.stackRestore=b=>Sm(b),a.stackAlloc=b=>Yo(b),a.cwrap=(b,x,P,U)=>{var Q=!P||P.every(ce=>ce==="number"||ce==="boolean");return x!=="string"&&Q&&!U?a["_"+b]:(...ce)=>FV(b,x,P,ce)},a.addFunction=Pd,a.removeFunction=Ga,a.UTF8ToString=tt,a.stringToNewUTF8=vm,a.writeArrayToMemory=(b,x)=>{k.set(b,x)};var xm,Id,yO,_O,Sm,Yo,Tm,wm,Za,BV={a:(b,x,P,U)=>ae(`Assertion failed: ${tt(b)}, at: `+[x?tt(x):"unknown filename",P,U?tt(U):"unknown function"]),i:function(b,x){try{return b=tt(b),gm(b,x),0}catch(P){if(typeof Ar>"u"||P.name!=="ErrnoError")throw P;return-P.Pa}},L:function(b,x,P){try{if(x=tt(x),x=Ho(b,x),P&-8)return-28;var U=mt(x,{ab:!0}).node;return U?(b="",P&4&&(b+="r"),P&2&&(b+="w"),P&1&&(b+="x"),b&&cn(U,b)?-2:0):-44}catch(Q){if(typeof Ar>"u"||Q.name!=="ErrnoError")throw Q;return-Q.Pa}},j:function(b,x){try{var P=Wr(b);return cO(P,P.node,x,!1),0}catch(U){if(typeof Ar>"u"||U.name!=="ErrnoError")throw U;return-U.Pa}},h:function(b){try{var x=Wr(b);return Go(x,x.node,{timestamp:Date.now(),Lb:!1}),0}catch(P){if(typeof Ar>"u"||P.name!=="ErrnoError")throw P;return-P.Pa}},b:function(b,x,P){_m=P;try{var U=Wr(b);switch(x){case 0:var Q=bm();if(0>Q)break;for(;Wa[Q];)Q++;return ii(U,Q).fd;case 1:case 2:return 0;case 3:return U.flags;case 4:return Q=bm(),U.flags|=Q,0;case 12:return Q=bm(),O[Q+0>>1]=2,0;case 13:case 14:return 0}return-28}catch(ce){if(typeof Ar>"u"||ce.name!=="ErrnoError")throw ce;return-ce.Pa}},g:function(b,x){try{var P=Wr(b),U=P.node,Q=P.Ma.Ta;b=Q?P:U,Q??=U.La.Ta,ni(Q);var ce=Q(b);return ym(x,ce)}catch(ge){if(typeof Ar>"u"||ge.name!=="ErrnoError")throw ge;return-ge.Pa}},H:function(b,x){x=-9007199254740992>x||9007199254740992<x?NaN:Number(x);try{if(isNaN(x))return-61;var P=Wr(b);if(0>x||!(P.flags&2097155))throw new oe(28);return lO(P,P.node,x),0}catch(U){if(typeof Ar>"u"||U.name!=="ErrnoError")throw U;return-U.Pa}},G:function(b,x){try{if(x===0)return-28;var P=St("/")+1;return x<P?-68:(ir("/",N,b,x),P)}catch(U){if(typeof Ar>"u"||U.name!=="ErrnoError")throw U;return-U.Pa}},K:function(b,x){try{return b=tt(b),ym(x,wd(b,!0))}catch(P){if(typeof Ar>"u"||P.name!=="ErrnoError")throw P;return-P.Pa}},C:function(b,x,P){try{return x=tt(x),x=Ho(b,x),Bn(x,P),0}catch(U){if(typeof Ar>"u"||U.name!=="ErrnoError")throw U;return-U.Pa}},J:function(b,x,P,U){try{x=tt(x);var Q=U&256;return x=Ho(b,x,U&4096),ym(P,Q?wd(x,!0):wd(x))}catch(ce){if(typeof Ar>"u"||ce.name!=="ErrnoError")throw ce;return-ce.Pa}},x:function(b,x,P,U){_m=U;try{x=tt(x),x=Ho(b,x);var Q=U?bm():0;return yl(x,P,Q).fd}catch(ce){if(typeof Ar>"u"||ce.name!=="ErrnoError")throw ce;return-ce.Pa}},v:function(b,x,P,U){try{if(x=tt(x),x=Ho(b,x),0>=U)return-28;var Q=mt(x).node;if(!Q)throw new oe(44);if(!Q.La.readlink)throw new oe(28);var ce=Q.La.readlink(Q),ge=Math.min(U,St(ce)),vt=k[P+ge];return ir(ce,N,P,U+1),k[P+ge]=vt,ge}catch(lr){if(typeof Ar>"u"||lr.name!=="ErrnoError")throw lr;return-lr.Pa}},u:function(b){try{return b=tt(b),Td(b),0}catch(x){if(typeof Ar>"u"||x.name!=="ErrnoError")throw x;return-x.Pa}},f:function(b,x){try{return b=tt(b),ym(x,wd(b))}catch(P){if(typeof Ar>"u"||P.name!=="ErrnoError")throw P;return-P.Pa}},r:function(b,x,P){try{if(x=tt(x),x=Ho(b,x),P)if(P===512)Td(x);else return-28;else oO(x);return 0}catch(U){if(typeof Ar>"u"||U.name!=="ErrnoError")throw U;return-U.Pa}},q:function(b,x,P){try{x=tt(x),x=Ho(b,x,!0);var U=Date.now(),Q,ce;if(P){var ge=te[P>>2]+4294967296*V[P+4>>2],vt=V[P+8>>2];vt==1073741823?Q=U:vt==1073741822?Q=null:Q=1e3*ge+vt/1e6,P+=16,ge=te[P>>2]+4294967296*V[P+4>>2],vt=V[P+8>>2],vt==1073741823?ce=U:vt==1073741822?ce=null:ce=1e3*ge+vt/1e6}else ce=Q=U;if((ce??Q)!==null){b=Q;var lr=mt(x,{ab:!0}).node;ni(lr.La.Ua)(lr,{atime:b,mtime:ce})}return 0}catch(Ct){if(typeof Ar>"u"||Ct.name!=="ErrnoError")throw Ct;return-Ct.Pa}},m:()=>ae(""),l:()=>{ke=!1,cx=0},A:function(b,x){b=-9007199254740992>b||9007199254740992<b?NaN:Number(b),b=new Date(1e3*b),V[x>>2]=b.getSeconds(),V[x+4>>2]=b.getMinutes(),V[x+8>>2]=b.getHours(),V[x+12>>2]=b.getDate(),V[x+16>>2]=b.getMonth(),V[x+20>>2]=b.getFullYear()-1900,V[x+24>>2]=b.getDay();var P=b.getFullYear();V[x+28>>2]=(P%4!==0||P%100===0&&P%400!==0?MV:DV)[b.getMonth()]+b.getDate()-1|0,V[x+36>>2]=-(60*b.getTimezoneOffset()),P=new Date(b.getFullYear(),6,1).getTimezoneOffset();var U=new Date(b.getFullYear(),0,1).getTimezoneOffset();V[x+32>>2]=(P!=U&&b.getTimezoneOffset()==Math.min(U,P))|0},y:function(b,x,P,U,Q,ce,ge){Q=-9007199254740992>Q||9007199254740992<Q?NaN:Number(Q);try{var vt=Wr(U);if(x&2&&!(P&2)&&(vt.flags&2097155)!==2)throw new oe(2);if((vt.flags&2097155)===1)throw new oe(2);if(!vt.Ma.jb)throw new oe(43);if(!b)throw new oe(28);var lr=vt.Ma.jb(vt,b,Q,x,P),Ct=lr.Xb;return V[ce>>2]=lr.Eb,te[ge>>2]=Ct,0}catch(kr){if(typeof Ar>"u"||kr.name!=="ErrnoError")throw kr;return-kr.Pa}},z:function(b,x,P,U,Q,ce){ce=-9007199254740992>ce||9007199254740992<ce?NaN:Number(ce);try{var ge=Wr(Q);if(P&2){if(P=ce,(ge.node.mode&61440)!==32768)throw new oe(43);if(!(U&2)){var vt=N.slice(b,b+x);ge.Ma.kb&&ge.Ma.kb(ge,vt,P,x,U)}}}catch(lr){if(typeof Ar>"u"||lr.name!=="ErrnoError")throw lr;return-lr.Pa}},n:(b,x)=>{if(Ed[b]&&(clearTimeout(Ed[b].id),delete Ed[b]),!x)return 0;var P=setTimeout(()=>{delete Ed[b],LV(()=>_O(b,performance.now()))},x);return Ed[b]={id:P,lc:x},0},B:(b,x,P,U)=>{var Q=new Date().getFullYear(),ce=new Date(Q,0,1).getTimezoneOffset();Q=new Date(Q,6,1).getTimezoneOffset(),te[b>>2]=60*Math.max(ce,Q),V[x>>2]=+(ce!=Q),x=ge=>{var vt=Math.abs(ge);return`UTC${0<=ge?"-":"+"}${String(Math.floor(vt/60)).padStart(2,"0")}${String(vt%60).padStart(2,"0")}`},b=x(ce),x=x(Q),Q<ce?(ir(b,N,P,17),ir(x,N,U,17)):(ir(b,N,U,17),ir(x,N,P,17))},d:()=>Date.now(),s:()=>2147483648,c:()=>performance.now(),o:b=>{var x=N.length;if(b>>>=0,2147483648<b)return!1;for(var P=1;4>=P;P*=2){var U=x*(1+.2/P);U=Math.min(U,b+100663296);e:{U=(Math.min(2147483648,65536*Math.ceil(Math.max(b,U)/65536))-wm.buffer.byteLength+65535)/65536|0;try{wm.grow(U),Y();var Q=1;break e}catch{}Q=void 0}if(Q)return!0}return!1},E:(b,x)=>{var P=0,U=0,Q;for(Q of hO()){var ce=x+P;te[b+U>>2]=ce,P+=ir(Q,N,ce,1/0)+1,U+=4}return 0},F:(b,x)=>{var P=hO();te[b>>2]=P.length,b=0;for(var U of P)b+=St(U)+1;return te[x>>2]=b,0},e:function(b){try{var x=Wr(b);return ox(x),0}catch(P){if(typeof Ar>"u"||P.name!=="ErrnoError")throw P;return P.Pa}},p:function(b,x){try{var P=Wr(b);return k[x]=P.tty?2:fr(P.mode)?3:(P.mode&61440)===40960?7:4,O[x+2>>1]=0,H[x+8>>3]=BigInt(0),H[x+16>>3]=BigInt(0),0}catch(U){if(typeof Ar>"u"||U.name!=="ErrnoError")throw U;return U.Pa}},w:function(b,x,P,U){try{e:{var Q=Wr(b);b=x;for(var ce,ge=x=0;ge<P;ge++){var vt=te[b>>2],lr=te[b+4>>2];b+=8;var Ct=dO(Q,k,vt,lr,ce);if(0>Ct){var kr=-1;break e}if(x+=Ct,Ct<lr)break;typeof ce<"u"&&(ce+=Ct)}kr=x}return te[U>>2]=kr,0}catch(_n){if(typeof Ar>"u"||_n.name!=="ErrnoError")throw _n;return _n.Pa}},D:function(b,x,P,U){x=-9007199254740992>x||9007199254740992<x?NaN:Number(x);try{if(isNaN(x))return 61;var Q=Wr(b);return uO(Q,x,P),H[U>>3]=BigInt(Q.position),Q.rb&&x===0&&P===0&&(Q.rb=null),0}catch(ce){if(typeof Ar>"u"||ce.name!=="ErrnoError")throw ce;return ce.Pa}},I:function(b){try{var x=Wr(b);return x.Ma?.fsync?.(x)}catch(P){if(typeof Ar>"u"||P.name!=="ErrnoError")throw P;return P.Pa}},t:function(b,x,P,U){try{e:{var Q=Wr(b);b=x;for(var ce,ge=x=0;ge<P;ge++){var vt=te[b>>2],lr=te[b+4>>2];b+=8;var Ct=pO(Q,k,vt,lr,ce);if(0>Ct){var kr=-1;break e}if(x+=Ct,Ct<lr)break;typeof ce<"u"&&(ce+=Ct)}kr=x}return te[U>>2]=kr,0}catch(_n){if(typeof Ar>"u"||_n.name!=="ErrnoError")throw _n;return _n.Pa}},k:fO};function px(){function b(){if(a.calledRun=!0,!S){if(!a.noFSInit&&!me){var x,P;me=!0,x??=a.stdin,P??=a.stdout,U??=a.stderr,x?Ka("stdin",x):gl("/dev/tty","/dev/stdin"),P?Ka("stdout",null,P):gl("/dev/tty","/dev/stdout"),U?Ka("stderr",null,U):gl("/dev/tty1","/dev/stderr"),yl("/dev/stdin",0),yl("/dev/stdout",1),yl("/dev/stderr",1)}if(fx.N(),_e=!1,a.onRuntimeInitialized?.(),a.postRun)for(typeof a.postRun=="function"&&(a.postRun=[a.postRun]);a.postRun.length;){var U=a.postRun.shift();le.push(U)}ee(le)}}if(0<he)xe=px;else{if(a.preRun)for(typeof a.preRun=="function"&&(a.preRun=[a.preRun]);a.preRun.length;)we();ee(Se),0<he?xe=px:a.setStatus?(a.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>a.setStatus(""),1),b()},1)):b()}}var fx;return async function(){function b(P){return P=fx=P.exports,a._sqlite3_free=P.P,a._sqlite3_value_text=P.Q,a._sqlite3_prepare_v2=P.R,a._sqlite3_step=P.S,a._sqlite3_reset=P.T,a._sqlite3_exec=P.U,a._sqlite3_finalize=P.V,a._sqlite3_column_name=P.W,a._sqlite3_column_text=P.X,a._sqlite3_column_type=P.Y,a._sqlite3_errmsg=P.Z,a._sqlite3_clear_bindings=P._,a._sqlite3_value_blob=P.$,a._sqlite3_value_bytes=P.aa,a._sqlite3_value_double=P.ba,a._sqlite3_value_int=P.ca,a._sqlite3_value_type=P.da,a._sqlite3_result_blob=P.ea,a._sqlite3_result_double=P.fa,a._sqlite3_result_error=P.ga,a._sqlite3_result_int=P.ha,a._sqlite3_result_int64=P.ia,a._sqlite3_result_null=P.ja,a._sqlite3_result_text=P.ka,a._sqlite3_aggregate_context=P.la,a._sqlite3_column_count=P.ma,a._sqlite3_data_count=P.na,a._sqlite3_column_blob=P.oa,a._sqlite3_column_bytes=P.pa,a._sqlite3_column_double=P.qa,a._sqlite3_bind_blob=P.ra,a._sqlite3_bind_double=P.sa,a._sqlite3_bind_int=P.ta,a._sqlite3_bind_text=P.ua,a._sqlite3_bind_parameter_index=P.va,a._sqlite3_sql=P.wa,a._sqlite3_normalized_sql=P.xa,a._sqlite3_changes=P.ya,a._sqlite3_close_v2=P.za,a._sqlite3_create_function_v2=P.Aa,a._sqlite3_update_hook=P.Ba,a._sqlite3_open=P.Ca,xm=a._malloc=P.Da,Id=a._free=P.Ea,a._RegisterExtensionFunctions=P.Fa,yO=P.Ga,_O=P.Ha,Sm=P.Ia,Yo=P.Ja,Tm=P.Ka,wm=P.M,Za=P.O,Y(),he--,a.monitorRunDependencies?.(he),he==0&&xe&&(P=xe,xe=null,P()),fx}he++,a.monitorRunDependencies?.(he);var x={a:BV};return a.instantiateWasm?new Promise(P=>{a.instantiateWasm(x,(U,Q)=>{P(b(U,Q))})}):(K??=a.locateFile?a.locateFile("sql-wasm.wasm",f):f+"sql-wasm.wasm",b((await M(x)).instance))}(),px(),n}),xb)};typeof Tb=="object"&&typeof qc=="object"?(qc.exports=Sb,qc.exports.default=Sb):typeof define=="function"&&define.amd?define([],function(){return Sb}):typeof Tb=="object"&&(Tb.Module=Sb)});var Ab={};zn(Ab,{parseIntent:()=>rq,searchFindings:()=>nLe});function rq(e,t){let r={scope:{},keywords:[],raw:e};if(!e||typeof e!="string")return r;let n=e.trim();/\b(error|errors|critical)\b/i.test(n)?r.severity="error":/\b(warning|warnings|warn)\b/i.test(n)?r.severity="warning":/\b(info|informational)\b/i.test(n)&&(r.severity="info");let s=n.match(YMe),a=n.match(XMe);if(a){let l=(s?.[1]??"").toUpperCase(),u=a[1],p=t.getWorking()?.apiIndex??{},f=Object.values(p).filter(h=>!h||l&&String(h.method??"").toUpperCase()!==l?!1:String(h.route??"").toLowerCase()===u.toLowerCase());if(f.length===1){let h=f[0];r.scope.entryPointId=`${String(h.method).toUpperCase()}:${h.route}`}}let o=n.toLowerCase();for(let l of QMe){let u=o.indexOf(l);if(u===-1)continue;let p=o.slice(Math.max(0,u-32),u+l.length+32).match(/[a-z0-9_-]+\s+(?:cluster|feature|module|area)|(?:cluster|feature|module|area)[:\s]+([a-z0-9_-]+)/i);if(p){let h=(p[1]??p[0].split(/\s+/)[0]).replace(/^(cluster|feature|module|area)$/i,"").replace(/[:.]+$/,"").trim();h&&(r.scope.clusterId=`cluster:${h}`);break}}if(eLe.some(l=>o.includes(l))){let l=t.getWorking(),u=Object.keys(l?.files??{});for(let d of u){let p=d.split("/").pop()?.replace(/\.[^.]+$/,"")??"";if(p.length<4)continue;if(new RegExp(`\\b${p.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\b`,"i").test(n)){r.scope.filePath=d;break}}}let c=n.toLowerCase().split(/[^a-z0-9_-]+/).filter(l=>l&&l.length>2&&!tLe.has(l));return r.keywords=Array.from(new Set(c)),r}function rLe(e,t){let r=0;t.scope.entryPointId&&e.entryPointId===t.scope.entryPointId&&(r+=50),t.scope.clusterId&&e.bindings.some(a=>a.graphId.endsWith(t.scope.clusterId)||a.graphId.includes(t.scope.clusterId))&&(r+=35),t.scope.filePath&&e.anchor?.filePath===t.scope.filePath&&(r+=30),t.scope.filePath&&e.bindings.some(a=>a.graphId.includes(t.scope.filePath))&&(r+=20),t.severity&&e.severity===t.severity&&(r+=8);let n=`${e.title} ${e.body} ${e.category} ${e.entryPointId}`.toLowerCase();for(let a of t.keywords)e.title.toLowerCase().includes(a)?r+=6:n.includes(a)&&(r+=2);let s=Date.now()-Date.parse(e.updatedAt||e.createdAt||new Date().toISOString());if(Number.isFinite(s)&&s>=0){let a=s/864e5;r+=Math.max(0,5-a)}return r}function nLe(e,t,r=20){let n=rq(t,e),s=e.listAiReviewFindings({status:"open"}),a=[];for(let o of s){let c=rLe(o,n);if(c<=0)continue;let l=[];n.scope.entryPointId&&o.entryPointId===n.scope.entryPointId&&l.push("entry-point match"),n.scope.clusterId&&o.bindings.some(d=>d.graphId.includes(n.scope.clusterId))&&l.push("cluster match"),n.scope.filePath&&o.anchor?.filePath===n.scope.filePath&&l.push("file match"),n.keywords.some(d=>o.title.toLowerCase().includes(d))&&l.push("keyword in title"),a.push({finding:o,score:c,reason:l.join(" + ")||"keyword"})}return a.sort((o,c)=>c.score-o.score),{intent:n,matches:a.slice(0,r),totalScanned:s.length}}var YMe,XMe,QMe,eLe,tLe,kb=Kt(()=>{"use strict";YMe=/\b(GET|POST|PUT|PATCH|DELETE|HEAD|OPTIONS)\b/i,XMe=/(\/(?:[a-z0-9_:.-]+|\{[^}]+\}|:[a-z0-9_]+)+)/i,QMe=["cluster","feature","module","area"],eLe=["file","in ","inside "],tLe=new Set(["a","an","and","are","as","at","be","by","do","for","from","has","have","in","into","is","it","me","of","on","or","show","that","the","this","to","was","what","when","where","which","why","with","about","find","findings","finding","review","ai"])});function _h(e,t){let r=yu(e,t),n=[],s=oFe(r),a=cFe(r);return Hu(r,{ForStatement(o){let c=o.node;if(c.init?.type!=="VariableDeclaration"||c.init.declarations?.length!==1)return;let l=c.init.declarations[0];if(l.id?.type!=="Identifier")return;let u=l.id.name,d=Pq(l.init,r);if(d===null)return;let p=c.test;if(p?.type!=="BinaryExpression"||p.left?.type!=="Identifier"||p.left.name!==u)return;let f;if(p.operator==="<=")f=!0;else if(p.operator==="<")f=!1;else return;let h=Pq(p.right,r);if(h===null)return;let m=uFe(c.update,u);if(m===null||m<=0||m>1e3)return;let g=f?Math.floor((h-d)/m)+1:Math.floor((h-1-d)/m)+1;if(g<=0)return;let y=f?h:h-1;o.traverse({CallExpression(_){let v=_.node;if(v.callee?.type!=="MemberExpression")return;let S=v.callee.property?.name?.toLowerCase();if(!S||!wq.has(S))return;let w=v.arguments||[];if(w.length<2)return;let E=w[0];if(E.type!=="TemplateLiteral")return;let k="",N=!0;for(let H=0;H<E.quasis.length;H++)if(k+=E.quasis[H].value.raw,H<E.expressions.length){let Y=E.expressions[H];if(Y?.type==="Identifier"&&Y.name===u)k+=`:${u}`;else{N=!1;break}}if(!N||!k.startsWith("/")&&k!=="*")return;let O=w[w.length-1],V="",te=null;O.type==="Identifier"?V=O.name:O.type==="ArrowFunctionExpression"||O.type==="FunctionExpression"?(V=O.id?.name||`anonymous@${S.toUpperCase()}:${k}`,te=O):O.type==="MemberExpression"&&O.property?.type==="Identifier"&&(V=O.property.name);let W=`${S.toUpperCase()}:${k}::${t}::${V}`,$=te?{start:te.start??0,end:te.end??0}:{start:v.start??0,end:v.end??0};n.push({apiId:W,method:S.toUpperCase(),route:k,handlerName:V,filePath:t,anchor:{filePath:t,symbol:V,span:$},meta:{dynamicRange:{var:u,from:d,to:y,step:m,count:g}}}),_.skip()}})},CallExpression(o){let c=o.node,l=c.callee;if(l.type==="MemberExpression"&&l.property?.type==="Identifier"&&l.property.name==="use"){let u=c.arguments||[],d=u[u.length-1];if(d&&(d.type==="ArrowFunctionExpression"||d.type==="FunctionExpression")&&Array.isArray(d.params)&&d.params.length===4){let p=d.id?.name||"errorHandler",f="/*",h=`MIDDLEWARE:${f}::${t}::${p}`;n.push({apiId:h,method:"MIDDLEWARE",route:f,handlerName:p,filePath:t,anchor:{filePath:t,symbol:p,span:{start:c.start??0,end:c.end??0}},meta:{error:!0}});return}}if(l.type==="MemberExpression"){let u=l.property?.name?.toLowerCase();if(!u||!wq.has(u))return;let d=c.arguments||[];if(d.length<1)return;let p=d[0],f="",h=1;if(p.type==="StringLiteral"?f=p.value:p.type==="TemplateLiteral"&&p.quasis?.length===1?f=p.quasis[0].value.raw:(f=aFe(l.object),h=0),!f||d.length<h+1||!f.startsWith("/")&&f!=="*")return;let m=d[d.length-1],g="";if(m.type==="Identifier"){if(g=m.name,sFe(o,m.name))return}else m.type==="ArrowFunctionExpression"||m.type==="FunctionExpression"?g=m.id?.name||`anonymous@${u.toUpperCase()}:${f}`:m.type==="MemberExpression"&&m.property?.type==="Identifier"&&typeof m.property.name=="string"&&(g=m.property.name);let y=`${u.toUpperCase()}:${f}::${t}::${g}`,_=[];for(let w=h;w<d.length-1;w++){let E=d[w];if(E?.type==="ObjectExpression"){let N=lFe(E);_.push(...N);continue}let k=Vc(E);k&&_.push(k)}for(let w of s)if(w.matcher.test(f))for(let E of w.mws)_.includes(E)||_.push(E);for(let w of a)_.includes(w)||_.push(w);let v;for(let w of _){if(/(?:^|\.)auth\.required$/i.test(w)||/^auth$/i.test(w)||/^authRequired$/i.test(w)||/^authMiddleware$/i.test(w)||/^requireAuth$/i.test(w)||/^isAuthenticated$/i.test(w)||/^ensureAuth(?:enticated)?$/i.test(w)||/^basicAuth$/i.test(w)||/^bearerAuth$/i.test(w)||/^jwt(?:Auth)?$/i.test(w)||/(?:^|\.)passport\.authenticate$/i.test(w)||/^expressJwt$/i.test(w)||/^koaJwt$/i.test(w)){v="required";break}(/(?:^|\.)auth\.optional$/i.test(w)||/^optionalAuth$/i.test(w))&&(v="optional")}if(!v){let w=c,E=o;for(;E&&!w?.leadingComments?.length&&(E=E.parentPath,!!E);)w=E.node;let k=dFe(w?.leadingComments);k&&(v=k)}let S={};_.length>0&&(S.middlewares=_),v&&(S.auth=v),n.push({apiId:y,method:u.toUpperCase(),route:f,handlerName:g,filePath:t,anchor:{filePath:t,symbol:g,span:{start:c.start??0,end:c.end??0}},...Object.keys(S).length>0?{meta:S}:{}})}}}),n}function sFe(e,t){let r=e.scope?.getProgramParent?.()?.block;if(!r?.body)return!1;let n=!1;for(let a of r.body)if(a.type==="VariableDeclaration")for(let o of a.declarations??[]){if(o.id?.type!=="Identifier"||o.id.name!==t)continue;let c=o.init;if(c){if(c.type==="ConditionalExpression"){let l=u=>u?.type==="CallExpression"||u?.type==="AwaitExpression"&&u.argument?.type==="CallExpression";(l(c.consequent)||l(c.alternate))&&(n=!0)}c.type==="CallExpression"&&c.callee?.type==="Identifier"&&(n=!0)}}let s=e.scope;for(;s;){let a=s.bindings?.[t];if(a&&a.path?.node?.type==="VariableDeclarator"){let o=a.path.node.init;if(o?.type==="ConditionalExpression"){let c=l=>l?.type==="CallExpression"||l?.type==="AwaitExpression"&&l.argument?.type==="CallExpression";if(c(o.consequent)||c(o.alternate)){n=!0;break}}if(o?.type==="CallExpression"&&o.callee?.type==="Identifier"){n=!0;break}}s=s.parent}return n}function aFe(e){let t=e;for(;t;)if(t.type==="CallExpression"){let r=t.callee;if(r?.type==="MemberExpression"&&r.property?.name==="route"){let n=t.arguments?.[0];return n?.type==="StringLiteral"?n.value:n?.type==="TemplateLiteral"&&n.quasis?.length===1?n.quasis[0].value.raw:""}t=r?.object}else if(t.type==="MemberExpression")t=t.object;else return"";return""}function oFe(e){let t=[];return Hu(e,{CallExpression(r){let n=r.node.callee;if(n?.type!=="MemberExpression"||n.property?.name!=="use")return;let s=r.node.arguments||[];if(s.length<2)return;let a=s[0];if(a?.type!=="StringLiteral")return;let o=a.value;if(!o.startsWith("/")&&o!=="*")return;let c=[];for(let u=1;u<s.length;u++){let d=s[u];if(d?.type==="ObjectExpression")continue;let p=Vc(d);p&&c.push(p)}if(c.length===0)return;let l;o==="*"?l="^/.*$":l="^"+o.replace(/[.+?^${}()|[\]\\]/g,"\\$&").replace(/\\\*/g,".*")+"(?:/.*)?$",t.push({matcher:new RegExp(l),mws:c})}}),t}function cFe(e){let t=[];return Hu(e,{CallExpression(r){let n=r.node.callee;if(n?.type!=="MemberExpression"||n.property?.name!=="use")return;let s=r.node.arguments||[];if(s.length!==1)return;let a=s[0];if(a?.type==="StringLiteral")return;let o=Vc(a);if(!o)return;let c=o.includes(".")?o.split(".").pop():o;(Eq.test(o)||Eq.test(c))&&(t.includes(o)||t.push(o))}}),t}function lFe(e){let t=new Set(["preHandler","onRequest","preValidation","preParsing","preSerialization","onResponse","onError","onSend"]),r=[];for(let n of e.properties??[]){if(n.type!=="ObjectProperty"&&n.type!=="Property")continue;let s=n.key?.type==="Identifier"?n.key.name:n.key?.type==="StringLiteral"?n.key.value:"";if(!t.has(s))continue;let a=n.value;if(a)if(a.type==="ArrayExpression")for(let o of a.elements??[]){let c=Vc(o);c&&r.push(c)}else{let o=Vc(a);o&&r.push(o)}}return r}function Pq(e,t){if(!e)return null;if(e.type==="NumericLiteral")return e.value;if(e.type==="UnaryExpression"&&e.operator==="-"&&e.argument?.type==="NumericLiteral")return-e.argument.value;if(e.type==="Identifier"){let r=t?.program?.body||[];for(let n of r){let s=n;if(s.type==="ExportNamedDeclaration"&&s.declaration&&(s=s.declaration),s.type==="VariableDeclaration"){for(let a of s.declarations??[])if(a.id?.type==="Identifier"&&a.id.name===e.name){if(a.init?.type==="NumericLiteral")return a.init.value;if(a.init?.type==="UnaryExpression"&&a.init.operator==="-"&&a.init.argument?.type==="NumericLiteral")return-a.init.argument.value}}}}return null}function uFe(e,t){if(!e)return null;if(e.type==="UpdateExpression"&&e.argument?.type==="Identifier"&&e.argument.name===t){if(e.operator==="++")return 1;if(e.operator==="--")return-1}if(e.type==="AssignmentExpression"&&e.left?.type==="Identifier"&&e.left.name===t){if(e.operator==="+="&&e.right?.type==="NumericLiteral")return e.right.value;if(e.operator==="-="&&e.right?.type==="NumericLiteral")return-e.right.value;if(e.operator==="="&&e.right?.type==="BinaryExpression"){let r=e.right;if(r.operator==="+"&&r.left?.type==="Identifier"&&r.left.name===t&&r.right?.type==="NumericLiteral")return r.right.value}}return null}function Vc(e){if(!e)return"";if(e.type==="Identifier")return e.name||"";if(e.type==="MemberExpression"){let t=Vc(e.object),r=e.property?.type==="Identifier"?e.property.name:"";return t&&r?`${t}.${r}`:r||t||""}return e.type==="CallExpression"?Vc(e.callee):""}function dFe(e){if(!(!e||e.length===0))for(let t of e){let n=(t?.value??"").match(/@auth\s+(required|optional|none)\b/i);if(n){let s=n[1].toLowerCase();return s==="required"?"required":s==="optional"?"optional":void 0}}}function pFe(e){let t;try{t=Vs(e)}catch{return[]}let r=new Map,n=new Map;Hu(t,{ImportDeclaration(a){let o=a.node.source?.value??"";for(let c of a.node.specifiers??[]){let l=c.local?.name??"";l&&r.set(l,o)}},VariableDeclarator(a){let o=a.node.init;if(!o||o.type!=="CallExpression")return;let c=o.callee;if(c.type==="Identifier"&&c.name==="require"){let l=o.arguments?.[0];if(!l||l.type!=="StringLiteral")return;let u=a.node.id?.name??"";u&&r.set(u,l.value)}}}),Hu(t,{VariableDeclarator(a){let o=a.node.init;if(!o||o.type!=="CallExpression"||a.node.id?.type!=="Identifier")return;let c=a.node.id.name,l=[],u=o;for(;u&&u.type==="CallExpression";){let d=u.callee;if(d?.type==="MemberExpression"&&d.property?.name==="use"){let p=u.arguments||[],f=p[p.length-1],h=p[0];if(h?.type==="StringLiteral"&&h.value.startsWith("/"))return;if(f?.type==="Identifier"){let m=r.get(f.name);m&&l.push(m)}u=d.object}else break}l.length>0&&n.set(c,l.reverse())}});let s=[];return Hu(t,{CallExpression(a){let o=a.node,c=o.callee;if(c.type!=="MemberExpression"||c.property?.name!=="use")return;let l=o.arguments??[];if(l.length<2)return;let u=l[0];if(u.type!=="StringLiteral")return;let d=u.value;if(!d.startsWith("/"))return;let p=l[l.length-1];if(p.type!=="Identifier")return;let f=p.name,h=r.get(f)??"",m=n.get(f);if(!h&&m&&m.length>0){for(let g of m)s.push({prefix:d,routerVar:f,importSource:g});return}s.push({prefix:d,routerVar:f,importSource:h})}}),s}function fFe(e,t){let r=e.endsWith("/")?e.slice(0,-1):e,n=t.startsWith("/")?t:"/"+t;return r+(n==="/"?"":n)||"/"}function Q1(e,t,r){let n=new Map;for(let[a,o]of t.entries()){let c=pFe(o);for(let l of c){if(!l.importSource)continue;let u=a.includes("/")?a.substring(0,a.lastIndexOf("/")):"",d=l.importSource;if(d.startsWith(".")){let f=u?u+"/"+d:d;d=Iq.normalize(f).replace(/\\/g,"/"),d=d.replace(/^\.\//,"")}let p=[d,d+".js",d+".ts",d+"/index.js",d+"/index.ts"];for(let f of p)if(t.has(f)){let h=n.get(f)??[];h.includes(l.prefix)||h.push(l.prefix),n.set(f,h);break}}}if(n.size===0)return e;let s={};for(let[a,o]of Object.entries(e)){let c=n.get(o.filePath);if(!c||c.length===0||o.rawRoute!==void 0){s[a]=o;continue}let l=c[0],u=fFe(l,o.route),d=`${o.method}:${u}::${o.filePath}::${o.handlerName}`;s[d]={...o,apiId:d,route:u,rawRoute:o.route}}return s}function Ju(e){let t=(e||"").toLowerCase();return["mongoose","sequelize","prisma","typeorm","knex","pg","mysql","mongodb"].some(r=>t.includes(r))?"database":["redis","ioredis","memcached","valkey"].some(r=>t.includes(r))?"cache":["s3","gcs","storage","bucket","minio","blob","azure/storage"].some(r=>t.includes(r))?"storage":["axios","fetch","got","request","grpc","amqplib","kafka","sns","sqs"].some(r=>t.includes(r))?"service":"module"}var Iq,Ob,Hu,wq,Eq,$b=Kt(()=>{"use strict";Iq=Fe(require("path"));gu();Zy();Ob=Fe(Ta()),Hu=typeof Ob.default=="function"?Ob.default:Ob.default.default;wq=new Set(["get","post","put","patch","delete","options","head","all"]);Eq=/^(?:auth|authRequired|requireAuth|isAuthenticated|jwtAuth|jwt|passport(?:\.authenticate)?|koaJwt|ensureAuth|ensureAuthenticated|sessionAuth|authMiddleware)$/i});var eC=G((exports,module)=>{var Module=Module!==void 0?Module:{},TreeSitter=function(){var initPromise,document=typeof window=="object"?{currentScript:window.document.currentScript}:null;class Parser{constructor(){this.initialize()}initialize(){throw new Error("cannot construct a Parser before calling `init()`")}static init(moduleOptions){return initPromise||(Module=Object.assign({},Module,moduleOptions),initPromise=new Promise(resolveInitPromise=>{var moduleOverrides=Object.assign({},Module),arguments_=[],thisProgram="./this.program",quit_=(e,t)=>{throw t},ENVIRONMENT_IS_WEB=typeof window=="object",ENVIRONMENT_IS_WORKER=typeof importScripts=="function",ENVIRONMENT_IS_NODE=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",scriptDirectory="",read_,readAsync,readBinary;function locateFile(e){return Module.locateFile?Module.locateFile(e,scriptDirectory):scriptDirectory+e}if(ENVIRONMENT_IS_NODE){var fs=require("fs"),nodePath=require("path");scriptDirectory=ENVIRONMENT_IS_WORKER?nodePath.dirname(scriptDirectory)+"/":__dirname+"/",read_=(e,t)=>(e=isFileURI(e)?new URL(e):nodePath.normalize(e),fs.readFileSync(e,t?void 0:"utf8")),readBinary=e=>{var t=read_(e,!0);return t.buffer||(t=new Uint8Array(t)),t},readAsync=(e,t,r,n=!0)=>{e=isFileURI(e)?new URL(e):nodePath.normalize(e),fs.readFile(e,n?void 0:"utf8",(s,a)=>{s?r(s):t(n?a.buffer:a)})},!Module.thisProgram&&process.argv.length>1&&(thisProgram=process.argv[1].replace(/\\/g,"/")),arguments_=process.argv.slice(2),typeof module<"u"&&(module.exports=Module),quit_=(e,t)=>{throw process.exitCode=e,t}}else(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)&&(ENVIRONMENT_IS_WORKER?scriptDirectory=self.location.href:document!==void 0&&document.currentScript&&(scriptDirectory=document.currentScript.src),scriptDirectory=scriptDirectory.startsWith("blob:")?"":scriptDirectory.substr(0,scriptDirectory.replace(/[?#].*/,"").lastIndexOf("/")+1),read_=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},ENVIRONMENT_IS_WORKER&&(readBinary=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),readAsync=(e,t,r)=>{var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=()=>{n.status==200||n.status==0&&n.response?t(n.response):r()},n.onerror=r,n.send(null)});var out=Module.print||console.log.bind(console),err=Module.printErr||console.error.bind(console);Object.assign(Module,moduleOverrides),moduleOverrides=null,Module.arguments&&(arguments_=Module.arguments),Module.thisProgram&&(thisProgram=Module.thisProgram),Module.quit&&(quit_=Module.quit);var dynamicLibraries=Module.dynamicLibraries||[],wasmBinary,wasmMemory;Module.wasmBinary&&(wasmBinary=Module.wasmBinary),typeof WebAssembly!="object"&&abort("no native wasm support detected");var ABORT=!1,EXITSTATUS,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateMemoryViews(){var e=wasmMemory.buffer;Module.HEAP8=HEAP8=new Int8Array(e),Module.HEAP16=HEAP16=new Int16Array(e),Module.HEAPU8=HEAPU8=new Uint8Array(e),Module.HEAPU16=HEAPU16=new Uint16Array(e),Module.HEAP32=HEAP32=new Int32Array(e),Module.HEAPU32=HEAPU32=new Uint32Array(e),Module.HEAPF32=HEAPF32=new Float32Array(e),Module.HEAPF64=HEAPF64=new Float64Array(e)}var INITIAL_MEMORY=Module.INITIAL_MEMORY||33554432;wasmMemory=Module.wasmMemory?Module.wasmMemory:new WebAssembly.Memory({initial:INITIAL_MEMORY/65536,maximum:32768}),updateMemoryViews(),INITIAL_MEMORY=wasmMemory.buffer.byteLength;var __ATPRERUN__=[],__ATINIT__=[],__ATMAIN__=[],__ATPOSTRUN__=[],__RELOC_FUNCS__=[],runtimeInitialized=!1;function preRun(){if(Module.preRun)for(typeof Module.preRun=="function"&&(Module.preRun=[Module.preRun]);Module.preRun.length;)addOnPreRun(Module.preRun.shift());callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=!0,callRuntimeCallbacks(__RELOC_FUNCS__),callRuntimeCallbacks(__ATINIT__)}function preMain(){callRuntimeCallbacks(__ATMAIN__)}function postRun(){if(Module.postRun)for(typeof Module.postRun=="function"&&(Module.postRun=[Module.postRun]);Module.postRun.length;)addOnPostRun(Module.postRun.shift());callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(e){__ATPRERUN__.unshift(e)}function addOnInit(e){__ATINIT__.unshift(e)}function addOnPostRun(e){__ATPOSTRUN__.unshift(e)}var runDependencies=0,runDependencyWatcher=null,dependenciesFulfilled=null;function getUniqueRunDependency(e){return e}function addRunDependency(e){runDependencies++,Module.monitorRunDependencies?.(runDependencies)}function removeRunDependency(e){if(runDependencies--,Module.monitorRunDependencies?.(runDependencies),runDependencies==0&&(runDependencyWatcher!==null&&(clearInterval(runDependencyWatcher),runDependencyWatcher=null),dependenciesFulfilled)){var t=dependenciesFulfilled;dependenciesFulfilled=null,t()}}function abort(e){throw Module.onAbort?.(e),err(e="Aborted("+e+")"),ABORT=!0,EXITSTATUS=1,e+=". Build with -sASSERTIONS for more info.",new WebAssembly.RuntimeError(e)}var dataURIPrefix="data:application/octet-stream;base64,",isDataURI=e=>e.startsWith(dataURIPrefix),isFileURI=e=>e.startsWith("file://"),wasmBinaryFile;function getBinarySync(e){if(e==wasmBinaryFile&&wasmBinary)return new Uint8Array(wasmBinary);if(readBinary)return readBinary(e);throw"both async and sync fetching of the wasm failed"}function getBinaryPromise(e){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch=="function"&&!isFileURI(e))return fetch(e,{credentials:"same-origin"}).then(t=>{if(!t.ok)throw`failed to load wasm binary file at '${e}'`;return t.arrayBuffer()}).catch(()=>getBinarySync(e));if(readAsync)return new Promise((t,r)=>{readAsync(e,n=>t(new Uint8Array(n)),r)})}return Promise.resolve().then(()=>getBinarySync(e))}function instantiateArrayBuffer(e,t,r){return getBinaryPromise(e).then(n=>WebAssembly.instantiate(n,t)).then(r,n=>{err(`failed to asynchronously prepare wasm: ${n}`),abort(n)})}function instantiateAsync(e,t,r,n){return e||typeof WebAssembly.instantiateStreaming!="function"||isDataURI(t)||isFileURI(t)||ENVIRONMENT_IS_NODE||typeof fetch!="function"?instantiateArrayBuffer(t,r,n):fetch(t,{credentials:"same-origin"}).then(s=>WebAssembly.instantiateStreaming(s,r).then(n,function(a){return err(`wasm streaming compile failed: ${a}`),err("falling back to ArrayBuffer instantiation"),instantiateArrayBuffer(t,r,n)}))}function createWasm(){var e={env:wasmImports,wasi_snapshot_preview1:wasmImports,"GOT.mem":new Proxy(wasmImports,GOTHandler),"GOT.func":new Proxy(wasmImports,GOTHandler)};function t(r,n){wasmExports=r.exports,wasmExports=relocateExports(wasmExports,1024);var s=getDylinkMetadata(n);return s.neededDynlibs&&(dynamicLibraries=s.neededDynlibs.concat(dynamicLibraries)),mergeLibSymbols(wasmExports,"main"),LDSO.init(),loadDylibs(),addOnInit(wasmExports.__wasm_call_ctors),__RELOC_FUNCS__.push(wasmExports.__wasm_apply_data_relocs),removeRunDependency("wasm-instantiate"),wasmExports}if(addRunDependency("wasm-instantiate"),Module.instantiateWasm)try{return Module.instantiateWasm(e,t)}catch(r){return err(`Module.instantiateWasm callback failed with error: ${r}`),!1}return instantiateAsync(wasmBinary,wasmBinaryFile,e,function(r){t(r.instance,r.module)}),{}}wasmBinaryFile="tree-sitter.wasm",isDataURI(wasmBinaryFile)||(wasmBinaryFile=locateFile(wasmBinaryFile));var ASM_CONSTS={};function ExitStatus(e){this.name="ExitStatus",this.message=`Program terminated with exit(${e})`,this.status=e}var GOT={},currentModuleWeakSymbols=new Set([]),GOTHandler={get(e,t){var r=GOT[t];return r||(r=GOT[t]=new WebAssembly.Global({value:"i32",mutable:!0})),currentModuleWeakSymbols.has(t)||(r.required=!0),r}},callRuntimeCallbacks=e=>{for(;e.length>0;)e.shift()(Module)},UTF8Decoder=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,UTF8ArrayToString=(e,t,r)=>{for(var n=t+r,s=t;e[s]&&!(s>=n);)++s;if(s-t>16&&e.buffer&&UTF8Decoder)return UTF8Decoder.decode(e.subarray(t,s));for(var a="";t<s;){var o=e[t++];if(128&o){var c=63&e[t++];if((224&o)!=192){var l=63&e[t++];if((o=(240&o)==224?(15&o)<<12|c<<6|l:(7&o)<<18|c<<12|l<<6|63&e[t++])<65536)a+=String.fromCharCode(o);else{var u=o-65536;a+=String.fromCharCode(55296|u>>10,56320|1023&u)}}else a+=String.fromCharCode((31&o)<<6|c)}else a+=String.fromCharCode(o)}return a},getDylinkMetadata=e=>{var t=0,r=0;function n(){for(var _=0,v=1;;){var S=e[t++];if(_+=(127&S)*v,v*=128,!(128&S))break}return _}function s(){var _=n();return UTF8ArrayToString(e,(t+=_)-_,_)}function a(_,v){if(_)throw new Error(v)}var o="dylink.0";if(e instanceof WebAssembly.Module){var c=WebAssembly.Module.customSections(e,o);c.length===0&&(o="dylink",c=WebAssembly.Module.customSections(e,o)),a(c.length===0,"need dylink section"),r=(e=new Uint8Array(c[0])).length}else{a(new Uint32Array(new Uint8Array(e.subarray(0,24)).buffer)[0]!=1836278016,"need to see wasm magic number"),a(e[8]!==0,"need the dylink section to be first"),t=9;var l=n();r=t+l,o=s()}var u={neededDynlibs:[],tlsExports:new Set,weakImports:new Set};if(o=="dylink"){u.memorySize=n(),u.memoryAlign=n(),u.tableSize=n(),u.tableAlign=n();for(var d=n(),p=0;p<d;++p){var f=s();u.neededDynlibs.push(f)}}else for(a(o!=="dylink.0");t<r;){var h=e[t++],m=n();if(h===1)u.memorySize=n(),u.memoryAlign=n(),u.tableSize=n(),u.tableAlign=n();else if(h===2)for(d=n(),p=0;p<d;++p)f=s(),u.neededDynlibs.push(f);else if(h===3)for(var g=n();g--;){var y=s();256&n()&&u.tlsExports.add(y)}else if(h===4)for(g=n();g--;)s(),y=s(),(3&n())==1&&u.weakImports.add(y);else t+=m}return u};function getValue(e,t="i8"){switch(t.endsWith("*")&&(t="*"),t){case"i1":case"i8":return HEAP8[e];case"i16":return HEAP16[e>>1];case"i32":return HEAP32[e>>2];case"i64":abort("to do getValue(i64) use WASM_BIGINT");case"float":return HEAPF32[e>>2];case"double":return HEAPF64[e>>3];case"*":return HEAPU32[e>>2];default:abort(`invalid type for getValue: ${t}`)}}var newDSO=(e,t,r)=>{var n={refcount:1/0,name:e,exports:r,global:!0};return LDSO.loadedLibsByName[e]=n,t!=null&&(LDSO.loadedLibsByHandle[t]=n),n},LDSO={loadedLibsByName:{},loadedLibsByHandle:{},init(){newDSO("__main__",0,wasmImports)}},___heap_base=78096,zeroMemory=(e,t)=>(HEAPU8.fill(0,e,e+t),e),alignMemory=(e,t)=>Math.ceil(e/t)*t,getMemory=e=>{if(runtimeInitialized)return zeroMemory(_malloc(e),e);var t=___heap_base,r=t+alignMemory(e,16);return ___heap_base=r,GOT.__heap_base.value=r,t},isInternalSym=e=>["__cpp_exception","__c_longjmp","__wasm_apply_data_relocs","__dso_handle","__tls_size","__tls_align","__set_stack_limits","_emscripten_tls_init","__wasm_init_tls","__wasm_call_ctors","__start_em_asm","__stop_em_asm","__start_em_js","__stop_em_js"].includes(e)||e.startsWith("__em_js__"),uleb128Encode=(e,t)=>{e<128?t.push(e):t.push(e%128|128,e>>7)},sigToWasmTypes=e=>{for(var t={i:"i32",j:"i64",f:"f32",d:"f64",e:"externref",p:"i32"},r={parameters:[],results:e[0]=="v"?[]:[t[e[0]]]},n=1;n<e.length;++n)r.parameters.push(t[e[n]]);return r},generateFuncType=(e,t)=>{var r=e.slice(0,1),n=e.slice(1),s={i:127,p:127,j:126,f:125,d:124,e:111};t.push(96),uleb128Encode(n.length,t);for(var a=0;a<n.length;++a)t.push(s[n[a]]);r=="v"?t.push(0):t.push(1,s[r])},convertJsFunctionToWasm=(e,t)=>{if(typeof WebAssembly.Function=="function")return new WebAssembly.Function(sigToWasmTypes(t),e);var r=[1];generateFuncType(t,r);var n=[0,97,115,109,1,0,0,0,1];uleb128Encode(r.length,n),n.push(...r),n.push(2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0);var s=new WebAssembly.Module(new Uint8Array(n));return new WebAssembly.Instance(s,{e:{f:e}}).exports.f},wasmTableMirror=[],wasmTable=new WebAssembly.Table({initial:27,element:"anyfunc"}),getWasmTableEntry=e=>{var t=wasmTableMirror[e];return t||(e>=wasmTableMirror.length&&(wasmTableMirror.length=e+1),wasmTableMirror[e]=t=wasmTable.get(e)),t},updateTableMap=(e,t)=>{if(functionsInTableMap)for(var r=e;r<e+t;r++){var n=getWasmTableEntry(r);n&&functionsInTableMap.set(n,r)}},functionsInTableMap,getFunctionAddress=e=>(functionsInTableMap||(functionsInTableMap=new WeakMap,updateTableMap(0,wasmTable.length)),functionsInTableMap.get(e)||0),freeTableIndexes=[],getEmptyTableSlot=()=>{if(freeTableIndexes.length)return freeTableIndexes.pop();try{wasmTable.grow(1)}catch(e){throw e instanceof RangeError?"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH.":e}return wasmTable.length-1},setWasmTableEntry=(e,t)=>{wasmTable.set(e,t),wasmTableMirror[e]=wasmTable.get(e)},addFunction=(e,t)=>{var r=getFunctionAddress(e);if(r)return r;var n=getEmptyTableSlot();try{setWasmTableEntry(n,e)}catch(a){if(!(a instanceof TypeError))throw a;var s=convertJsFunctionToWasm(e,t);setWasmTableEntry(n,s)}return functionsInTableMap.set(e,n),n},updateGOT=(e,t)=>{for(var r in e)if(!isInternalSym(r)){var n=e[r];r.startsWith("orig$")&&(r=r.split("$")[1],t=!0),GOT[r]||=new WebAssembly.Global({value:"i32",mutable:!0}),(t||GOT[r].value==0)&&(typeof n=="function"?GOT[r].value=addFunction(n):typeof n=="number"?GOT[r].value=n:err(`unhandled export type for '${r}': ${typeof n}`))}},relocateExports=(e,t,r)=>{var n={};for(var s in e){var a=e[s];typeof a=="object"&&(a=a.value),typeof a=="number"&&(a+=t),n[s]=a}return updateGOT(n,r),n},isSymbolDefined=e=>{var t=wasmImports[e];return!(!t||t.stub)},dynCallLegacy=(e,t,r)=>(0,Module["dynCall_"+e])(t,...r),dynCall=(e,t,r=[])=>e.includes("j")?dynCallLegacy(e,t,r):getWasmTableEntry(t)(...r),createInvokeFunction=e=>function(){var t=stackSave();try{return dynCall(e,arguments[0],Array.prototype.slice.call(arguments,1))}catch(r){if(stackRestore(t),r!==r+0)throw r;_setThrew(1,0)}},resolveGlobalSymbol=(e,t=!1)=>{var r;return t&&"orig$"+e in wasmImports&&(e="orig$"+e),isSymbolDefined(e)?r=wasmImports[e]:e.startsWith("invoke_")&&(r=wasmImports[e]=createInvokeFunction(e.split("_")[1])),{sym:r,name:e}},UTF8ToString=(e,t)=>e?UTF8ArrayToString(HEAPU8,e,t):"",loadWebAssemblyModule=(binary,flags,libName,localScope,handle)=>{var metadata=getDylinkMetadata(binary);function loadModule(){var firstLoad=!handle||!HEAP8[handle+8];if(firstLoad){var memAlign=Math.pow(2,metadata.memoryAlign),memoryBase=metadata.memorySize?alignMemory(getMemory(metadata.memorySize+memAlign),memAlign):0,tableBase=metadata.tableSize?wasmTable.length:0;handle&&(HEAP8[handle+8]=1,HEAPU32[handle+12>>2]=memoryBase,HEAP32[handle+16>>2]=metadata.memorySize,HEAPU32[handle+20>>2]=tableBase,HEAP32[handle+24>>2]=metadata.tableSize)}else memoryBase=HEAPU32[handle+12>>2],tableBase=HEAPU32[handle+20>>2];var tableGrowthNeeded=tableBase+metadata.tableSize-wasmTable.length,moduleExports;function resolveSymbol(e){var t=resolveGlobalSymbol(e).sym;return!t&&localScope&&(t=localScope[e]),t||(t=moduleExports[e]),t}tableGrowthNeeded>0&&wasmTable.grow(tableGrowthNeeded);var proxyHandler={get(e,t){switch(t){case"__memory_base":return memoryBase;case"__table_base":return tableBase}if(t in wasmImports&&!wasmImports[t].stub)return wasmImports[t];var r;return t in e||(e[t]=(...n)=>(r||=resolveSymbol(t),r(...n))),e[t]}},proxy=new Proxy({},proxyHandler),info={"GOT.mem":new Proxy({},GOTHandler),"GOT.func":new Proxy({},GOTHandler),env:proxy,wasi_snapshot_preview1:proxy};function postInstantiation(module,instance){function addEmAsm(addr,body){for(var args=[],arity=0;arity<16&&body.indexOf("$"+arity)!=-1;arity++)args.push("$"+arity);args=args.join(",");var func=`(${args}) => { ${body} };`;ASM_CONSTS[start]=eval(func)}if(updateTableMap(tableBase,metadata.tableSize),moduleExports=relocateExports(instance.exports,memoryBase),flags.allowUndefined||reportUndefinedSymbols(),"__start_em_asm"in moduleExports)for(var start=moduleExports.__start_em_asm,stop=moduleExports.__stop_em_asm;start<stop;){var jsString=UTF8ToString(start);addEmAsm(start,jsString),start=HEAPU8.indexOf(0,start)+1}function addEmJs(name,cSig,body){var jsArgs=[];if(cSig=cSig.slice(1,-1),cSig!="void")for(var i in cSig=cSig.split(","),cSig){var jsArg=cSig[i].split(" ").pop();jsArgs.push(jsArg.replace("*",""))}var func=`(${jsArgs}) => ${body};`;moduleExports[name]=eval(func)}for(var name in moduleExports)if(name.startsWith("__em_js__")){var start=moduleExports[name],jsString=UTF8ToString(start),parts=jsString.split("<::>");addEmJs(name.replace("__em_js__",""),parts[0],parts[1]),delete moduleExports[name]}var applyRelocs=moduleExports.__wasm_apply_data_relocs;applyRelocs&&(runtimeInitialized?applyRelocs():__RELOC_FUNCS__.push(applyRelocs));var init=moduleExports.__wasm_call_ctors;return init&&(runtimeInitialized?init():__ATINIT__.push(init)),moduleExports}if(flags.loadAsync){if(binary instanceof WebAssembly.Module){var instance=new WebAssembly.Instance(binary,info);return Promise.resolve(postInstantiation(binary,instance))}return WebAssembly.instantiate(binary,info).then(e=>postInstantiation(e.module,e.instance))}var module=binary instanceof WebAssembly.Module?binary:new WebAssembly.Module(binary),instance=new WebAssembly.Instance(module,info);return postInstantiation(module,instance)}return currentModuleWeakSymbols=metadata.weakImports,flags.loadAsync?metadata.neededDynlibs.reduce((e,t)=>e.then(()=>loadDynamicLibrary(t,flags)),Promise.resolve()).then(loadModule):(metadata.neededDynlibs.forEach(e=>loadDynamicLibrary(e,flags,localScope)),loadModule())},mergeLibSymbols=(e,t)=>{for(var[r,n]of Object.entries(e)){let s=o=>{isSymbolDefined(o)||(wasmImports[o]=n)};s(r);let a="__main_argc_argv";r=="main"&&s(a),r==a&&s("main"),r.startsWith("dynCall_")&&!Module.hasOwnProperty(r)&&(Module[r]=n)}},asyncLoad=(e,t,r,n)=>{var s=n?"":`al ${e}`;readAsync(e,a=>{t(new Uint8Array(a)),s&&removeRunDependency(s)},a=>{if(!r)throw`Loading data file "${e}" failed.`;r()}),s&&addRunDependency(s)};function loadDynamicLibrary(e,t={global:!0,nodelete:!0},r,n){var s=LDSO.loadedLibsByName[e];if(s)return t.global?s.global||(s.global=!0,mergeLibSymbols(s.exports,e)):r&&Object.assign(r,s.exports),t.nodelete&&s.refcount!==1/0&&(s.refcount=1/0),s.refcount++,n&&(LDSO.loadedLibsByHandle[n]=s),!t.loadAsync||Promise.resolve(!0);function a(){if(n){var l=HEAPU32[n+28>>2],u=HEAPU32[n+32>>2];if(l&&u){var d=HEAP8.slice(l,l+u);return t.loadAsync?Promise.resolve(d):d}}var p=locateFile(e);if(t.loadAsync)return new Promise(function(f,h){asyncLoad(p,f,h)});if(!readBinary)throw new Error(`${p}: file not found, and synchronous loading of external files is not available`);return readBinary(p)}function o(){return t.loadAsync?a().then(l=>loadWebAssemblyModule(l,t,e,r,n)):loadWebAssemblyModule(a(),t,e,r,n)}function c(l){s.global?mergeLibSymbols(l,e):r&&Object.assign(r,l),s.exports=l}return(s=newDSO(e,n,"loading")).refcount=t.nodelete?1/0:1,s.global=t.global,t.loadAsync?o().then(l=>(c(l),!0)):(c(o()),!0)}var reportUndefinedSymbols=()=>{for(var[e,t]of Object.entries(GOT))if(t.value==0){var r=resolveGlobalSymbol(e,!0).sym;if(!r&&!t.required)continue;if(typeof r=="function")t.value=addFunction(r,r.sig);else{if(typeof r!="number")throw new Error(`bad export type for '${e}': ${typeof r}`);t.value=r}}},loadDylibs=()=>{dynamicLibraries.length?(addRunDependency("loadDylibs"),dynamicLibraries.reduce((e,t)=>e.then(()=>loadDynamicLibrary(t,{loadAsync:!0,global:!0,nodelete:!0,allowUndefined:!0})),Promise.resolve()).then(()=>{reportUndefinedSymbols(),removeRunDependency("loadDylibs")})):reportUndefinedSymbols()},noExitRuntime=Module.noExitRuntime||!0;function setValue(e,t,r="i8"){switch(r.endsWith("*")&&(r="*"),r){case"i1":case"i8":HEAP8[e]=t;break;case"i16":HEAP16[e>>1]=t;break;case"i32":HEAP32[e>>2]=t;break;case"i64":abort("to do setValue(i64) use WASM_BIGINT");case"float":HEAPF32[e>>2]=t;break;case"double":HEAPF64[e>>3]=t;break;case"*":HEAPU32[e>>2]=t;break;default:abort(`invalid type for setValue: ${r}`)}}var ___memory_base=new WebAssembly.Global({value:"i32",mutable:!1},1024),___stack_pointer=new WebAssembly.Global({value:"i32",mutable:!0},78096),___table_base=new WebAssembly.Global({value:"i32",mutable:!1},1),nowIsMonotonic=1,__emscripten_get_now_is_monotonic=()=>nowIsMonotonic;__emscripten_get_now_is_monotonic.sig="i";var _abort=()=>{abort("")};_abort.sig="v";var _emscripten_date_now=()=>Date.now(),_emscripten_get_now;_emscripten_date_now.sig="d",_emscripten_get_now=()=>performance.now(),_emscripten_get_now.sig="d";var _emscripten_memcpy_js=(e,t,r)=>HEAPU8.copyWithin(e,t,t+r);_emscripten_memcpy_js.sig="vppp";var getHeapMax=()=>2147483648,growMemory=e=>{var t=(e-wasmMemory.buffer.byteLength+65535)/65536;try{return wasmMemory.grow(t),updateMemoryViews(),1}catch{}},_emscripten_resize_heap=e=>{var t=HEAPU8.length;e>>>=0;var r=getHeapMax();if(e>r)return!1;for(var n,s,a=1;a<=4;a*=2){var o=t*(1+.2/a);o=Math.min(o,e+100663296);var c=Math.min(r,(n=Math.max(e,o))+((s=65536)-n%s)%s);if(growMemory(c))return!0}return!1};_emscripten_resize_heap.sig="ip";var _fd_close=e=>52;_fd_close.sig="ii";var convertI32PairToI53Checked=(e,t)=>t+2097152>>>0<4194305-!!e?(e>>>0)+4294967296*t:NaN;function _fd_seek(e,t,r,n,s){return convertI32PairToI53Checked(t,r),70}_fd_seek.sig="iiiiip";var printCharBuffers=[null,[],[]],printChar=(e,t)=>{var r=printCharBuffers[e];t===0||t===10?((e===1?out:err)(UTF8ArrayToString(r,0)),r.length=0):r.push(t)},SYSCALLS={varargs:void 0,get(){var e=HEAP32[+SYSCALLS.varargs>>2];return SYSCALLS.varargs+=4,e},getp:()=>SYSCALLS.get(),getStr:e=>UTF8ToString(e)},_fd_write=(e,t,r,n)=>{for(var s=0,a=0;a<r;a++){var o=HEAPU32[t>>2],c=HEAPU32[t+4>>2];t+=8;for(var l=0;l<c;l++)printChar(e,HEAPU8[o+l]);s+=c}return HEAPU32[n>>2]=s,0};function _tree_sitter_log_callback(e,t){if(currentLogCallback){let r=UTF8ToString(t);currentLogCallback(r,e!==0)}}function _tree_sitter_parse_callback(e,t,r,n,s){let a=currentParseCallback(t,{row:r,column:n});typeof a=="string"?(setValue(s,a.length,"i32"),stringToUTF16(a,e,10240)):setValue(s,0,"i32")}_fd_write.sig="iippp";var runtimeKeepaliveCounter=0,keepRuntimeAlive=()=>noExitRuntime||runtimeKeepaliveCounter>0,_proc_exit=e=>{EXITSTATUS=e,keepRuntimeAlive()||(Module.onExit?.(e),ABORT=!0),quit_(e,new ExitStatus(e))};_proc_exit.sig="vi";var exitJS=(e,t)=>{EXITSTATUS=e,_proc_exit(e)},handleException=e=>{if(e instanceof ExitStatus||e=="unwind")return EXITSTATUS;quit_(1,e)},lengthBytesUTF8=e=>{for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n<=127?t++:n<=2047?t+=2:n>=55296&&n<=57343?(t+=4,++r):t+=3}return t},stringToUTF8Array=(e,t,r,n)=>{if(!(n>0))return 0;for(var s=r,a=r+n-1,o=0;o<e.length;++o){var c=e.charCodeAt(o);if(c>=55296&&c<=57343&&(c=65536+((1023&c)<<10)|1023&e.charCodeAt(++o)),c<=127){if(r>=a)break;t[r++]=c}else if(c<=2047){if(r+1>=a)break;t[r++]=192|c>>6,t[r++]=128|63&c}else if(c<=65535){if(r+2>=a)break;t[r++]=224|c>>12,t[r++]=128|c>>6&63,t[r++]=128|63&c}else{if(r+3>=a)break;t[r++]=240|c>>18,t[r++]=128|c>>12&63,t[r++]=128|c>>6&63,t[r++]=128|63&c}}return t[r]=0,r-s},stringToUTF8=(e,t,r)=>stringToUTF8Array(e,HEAPU8,t,r),stringToUTF8OnStack=e=>{var t=lengthBytesUTF8(e)+1,r=stackAlloc(t);return stringToUTF8(e,r,t),r},stringToUTF16=(e,t,r)=>{if(r??=2147483647,r<2)return 0;for(var n=t,s=(r-=2)<2*e.length?r/2:e.length,a=0;a<s;++a){var o=e.charCodeAt(a);HEAP16[t>>1]=o,t+=2}return HEAP16[t>>1]=0,t-n},AsciiToString=e=>{for(var t="";;){var r=HEAPU8[e++];if(!r)return t;t+=String.fromCharCode(r)}},wasmImports={__heap_base:___heap_base,__indirect_function_table:wasmTable,__memory_base:___memory_base,__stack_pointer:___stack_pointer,__table_base:___table_base,_emscripten_get_now_is_monotonic:__emscripten_get_now_is_monotonic,abort:_abort,emscripten_get_now:_emscripten_get_now,emscripten_memcpy_js:_emscripten_memcpy_js,emscripten_resize_heap:_emscripten_resize_heap,fd_close:_fd_close,fd_seek:_fd_seek,fd_write:_fd_write,memory:wasmMemory,tree_sitter_log_callback:_tree_sitter_log_callback,tree_sitter_parse_callback:_tree_sitter_parse_callback},wasmExports=createWasm(),___wasm_call_ctors=()=>(___wasm_call_ctors=wasmExports.__wasm_call_ctors)(),___wasm_apply_data_relocs=()=>(___wasm_apply_data_relocs=wasmExports.__wasm_apply_data_relocs)(),_malloc=Module._malloc=e=>(_malloc=Module._malloc=wasmExports.malloc)(e),_calloc=Module._calloc=(e,t)=>(_calloc=Module._calloc=wasmExports.calloc)(e,t),_realloc=Module._realloc=(e,t)=>(_realloc=Module._realloc=wasmExports.realloc)(e,t),_free=Module._free=e=>(_free=Module._free=wasmExports.free)(e),_ts_language_symbol_count=Module._ts_language_symbol_count=e=>(_ts_language_symbol_count=Module._ts_language_symbol_count=wasmExports.ts_language_symbol_count)(e),_ts_language_state_count=Module._ts_language_state_count=e=>(_ts_language_state_count=Module._ts_language_state_count=wasmExports.ts_language_state_count)(e),_ts_language_version=Module._ts_language_version=e=>(_ts_language_version=Module._ts_language_version=wasmExports.ts_language_version)(e),_ts_language_field_count=Module._ts_language_field_count=e=>(_ts_language_field_count=Module._ts_language_field_count=wasmExports.ts_language_field_count)(e),_ts_language_next_state=Module._ts_language_next_state=(e,t,r)=>(_ts_language_next_state=Module._ts_language_next_state=wasmExports.ts_language_next_state)(e,t,r),_ts_language_symbol_name=Module._ts_language_symbol_name=(e,t)=>(_ts_language_symbol_name=Module._ts_language_symbol_name=wasmExports.ts_language_symbol_name)(e,t),_ts_language_symbol_for_name=Module._ts_language_symbol_for_name=(e,t,r,n)=>(_ts_language_symbol_for_name=Module._ts_language_symbol_for_name=wasmExports.ts_language_symbol_for_name)(e,t,r,n),_strncmp=Module._strncmp=(e,t,r)=>(_strncmp=Module._strncmp=wasmExports.strncmp)(e,t,r),_ts_language_symbol_type=Module._ts_language_symbol_type=(e,t)=>(_ts_language_symbol_type=Module._ts_language_symbol_type=wasmExports.ts_language_symbol_type)(e,t),_ts_language_field_name_for_id=Module._ts_language_field_name_for_id=(e,t)=>(_ts_language_field_name_for_id=Module._ts_language_field_name_for_id=wasmExports.ts_language_field_name_for_id)(e,t),_ts_lookahead_iterator_new=Module._ts_lookahead_iterator_new=(e,t)=>(_ts_lookahead_iterator_new=Module._ts_lookahead_iterator_new=wasmExports.ts_lookahead_iterator_new)(e,t),_ts_lookahead_iterator_delete=Module._ts_lookahead_iterator_delete=e=>(_ts_lookahead_iterator_delete=Module._ts_lookahead_iterator_delete=wasmExports.ts_lookahead_iterator_delete)(e),_ts_lookahead_iterator_reset_state=Module._ts_lookahead_iterator_reset_state=(e,t)=>(_ts_lookahead_iterator_reset_state=Module._ts_lookahead_iterator_reset_state=wasmExports.ts_lookahead_iterator_reset_state)(e,t),_ts_lookahead_iterator_reset=Module._ts_lookahead_iterator_reset=(e,t,r)=>(_ts_lookahead_iterator_reset=Module._ts_lookahead_iterator_reset=wasmExports.ts_lookahead_iterator_reset)(e,t,r),_ts_lookahead_iterator_next=Module._ts_lookahead_iterator_next=e=>(_ts_lookahead_iterator_next=Module._ts_lookahead_iterator_next=wasmExports.ts_lookahead_iterator_next)(e),_ts_lookahead_iterator_current_symbol=Module._ts_lookahead_iterator_current_symbol=e=>(_ts_lookahead_iterator_current_symbol=Module._ts_lookahead_iterator_current_symbol=wasmExports.ts_lookahead_iterator_current_symbol)(e),_memset=Module._memset=(e,t,r)=>(_memset=Module._memset=wasmExports.memset)(e,t,r),_memcpy=Module._memcpy=(e,t,r)=>(_memcpy=Module._memcpy=wasmExports.memcpy)(e,t,r),_ts_parser_delete=Module._ts_parser_delete=e=>(_ts_parser_delete=Module._ts_parser_delete=wasmExports.ts_parser_delete)(e),_ts_parser_reset=Module._ts_parser_reset=e=>(_ts_parser_reset=Module._ts_parser_reset=wasmExports.ts_parser_reset)(e),_ts_parser_set_language=Module._ts_parser_set_language=(e,t)=>(_ts_parser_set_language=Module._ts_parser_set_language=wasmExports.ts_parser_set_language)(e,t),_ts_parser_timeout_micros=Module._ts_parser_timeout_micros=e=>(_ts_parser_timeout_micros=Module._ts_parser_timeout_micros=wasmExports.ts_parser_timeout_micros)(e),_ts_parser_set_timeout_micros=Module._ts_parser_set_timeout_micros=(e,t,r)=>(_ts_parser_set_timeout_micros=Module._ts_parser_set_timeout_micros=wasmExports.ts_parser_set_timeout_micros)(e,t,r),_ts_parser_set_included_ranges=Module._ts_parser_set_included_ranges=(e,t,r)=>(_ts_parser_set_included_ranges=Module._ts_parser_set_included_ranges=wasmExports.ts_parser_set_included_ranges)(e,t,r),_memmove=Module._memmove=(e,t,r)=>(_memmove=Module._memmove=wasmExports.memmove)(e,t,r),_memcmp=Module._memcmp=(e,t,r)=>(_memcmp=Module._memcmp=wasmExports.memcmp)(e,t,r),_ts_query_new=Module._ts_query_new=(e,t,r,n,s)=>(_ts_query_new=Module._ts_query_new=wasmExports.ts_query_new)(e,t,r,n,s),_ts_query_delete=Module._ts_query_delete=e=>(_ts_query_delete=Module._ts_query_delete=wasmExports.ts_query_delete)(e),_iswspace=Module._iswspace=e=>(_iswspace=Module._iswspace=wasmExports.iswspace)(e),_iswalnum=Module._iswalnum=e=>(_iswalnum=Module._iswalnum=wasmExports.iswalnum)(e),_ts_query_pattern_count=Module._ts_query_pattern_count=e=>(_ts_query_pattern_count=Module._ts_query_pattern_count=wasmExports.ts_query_pattern_count)(e),_ts_query_capture_count=Module._ts_query_capture_count=e=>(_ts_query_capture_count=Module._ts_query_capture_count=wasmExports.ts_query_capture_count)(e),_ts_query_string_count=Module._ts_query_string_count=e=>(_ts_query_string_count=Module._ts_query_string_count=wasmExports.ts_query_string_count)(e),_ts_query_capture_name_for_id=Module._ts_query_capture_name_for_id=(e,t,r)=>(_ts_query_capture_name_for_id=Module._ts_query_capture_name_for_id=wasmExports.ts_query_capture_name_for_id)(e,t,r),_ts_query_string_value_for_id=Module._ts_query_string_value_for_id=(e,t,r)=>(_ts_query_string_value_for_id=Module._ts_query_string_value_for_id=wasmExports.ts_query_string_value_for_id)(e,t,r),_ts_query_predicates_for_pattern=Module._ts_query_predicates_for_pattern=(e,t,r)=>(_ts_query_predicates_for_pattern=Module._ts_query_predicates_for_pattern=wasmExports.ts_query_predicates_for_pattern)(e,t,r),_ts_query_disable_capture=Module._ts_query_disable_capture=(e,t,r)=>(_ts_query_disable_capture=Module._ts_query_disable_capture=wasmExports.ts_query_disable_capture)(e,t,r),_ts_tree_copy=Module._ts_tree_copy=e=>(_ts_tree_copy=Module._ts_tree_copy=wasmExports.ts_tree_copy)(e),_ts_tree_delete=Module._ts_tree_delete=e=>(_ts_tree_delete=Module._ts_tree_delete=wasmExports.ts_tree_delete)(e),_ts_init=Module._ts_init=()=>(_ts_init=Module._ts_init=wasmExports.ts_init)(),_ts_parser_new_wasm=Module._ts_parser_new_wasm=()=>(_ts_parser_new_wasm=Module._ts_parser_new_wasm=wasmExports.ts_parser_new_wasm)(),_ts_parser_enable_logger_wasm=Module._ts_parser_enable_logger_wasm=(e,t)=>(_ts_parser_enable_logger_wasm=Module._ts_parser_enable_logger_wasm=wasmExports.ts_parser_enable_logger_wasm)(e,t),_ts_parser_parse_wasm=Module._ts_parser_parse_wasm=(e,t,r,n,s)=>(_ts_parser_parse_wasm=Module._ts_parser_parse_wasm=wasmExports.ts_parser_parse_wasm)(e,t,r,n,s),_ts_parser_included_ranges_wasm=Module._ts_parser_included_ranges_wasm=e=>(_ts_parser_included_ranges_wasm=Module._ts_parser_included_ranges_wasm=wasmExports.ts_parser_included_ranges_wasm)(e),_ts_language_type_is_named_wasm=Module._ts_language_type_is_named_wasm=(e,t)=>(_ts_language_type_is_named_wasm=Module._ts_language_type_is_named_wasm=wasmExports.ts_language_type_is_named_wasm)(e,t),_ts_language_type_is_visible_wasm=Module._ts_language_type_is_visible_wasm=(e,t)=>(_ts_language_type_is_visible_wasm=Module._ts_language_type_is_visible_wasm=wasmExports.ts_language_type_is_visible_wasm)(e,t),_ts_tree_root_node_wasm=Module._ts_tree_root_node_wasm=e=>(_ts_tree_root_node_wasm=Module._ts_tree_root_node_wasm=wasmExports.ts_tree_root_node_wasm)(e),_ts_tree_root_node_with_offset_wasm=Module._ts_tree_root_node_with_offset_wasm=e=>(_ts_tree_root_node_with_offset_wasm=Module._ts_tree_root_node_with_offset_wasm=wasmExports.ts_tree_root_node_with_offset_wasm)(e),_ts_tree_edit_wasm=Module._ts_tree_edit_wasm=e=>(_ts_tree_edit_wasm=Module._ts_tree_edit_wasm=wasmExports.ts_tree_edit_wasm)(e),_ts_tree_included_ranges_wasm=Module._ts_tree_included_ranges_wasm=e=>(_ts_tree_included_ranges_wasm=Module._ts_tree_included_ranges_wasm=wasmExports.ts_tree_included_ranges_wasm)(e),_ts_tree_get_changed_ranges_wasm=Module._ts_tree_get_changed_ranges_wasm=(e,t)=>(_ts_tree_get_changed_ranges_wasm=Module._ts_tree_get_changed_ranges_wasm=wasmExports.ts_tree_get_changed_ranges_wasm)(e,t),_ts_tree_cursor_new_wasm=Module._ts_tree_cursor_new_wasm=e=>(_ts_tree_cursor_new_wasm=Module._ts_tree_cursor_new_wasm=wasmExports.ts_tree_cursor_new_wasm)(e),_ts_tree_cursor_delete_wasm=Module._ts_tree_cursor_delete_wasm=e=>(_ts_tree_cursor_delete_wasm=Module._ts_tree_cursor_delete_wasm=wasmExports.ts_tree_cursor_delete_wasm)(e),_ts_tree_cursor_reset_wasm=Module._ts_tree_cursor_reset_wasm=e=>(_ts_tree_cursor_reset_wasm=Module._ts_tree_cursor_reset_wasm=wasmExports.ts_tree_cursor_reset_wasm)(e),_ts_tree_cursor_reset_to_wasm=Module._ts_tree_cursor_reset_to_wasm=(e,t)=>(_ts_tree_cursor_reset_to_wasm=Module._ts_tree_cursor_reset_to_wasm=wasmExports.ts_tree_cursor_reset_to_wasm)(e,t),_ts_tree_cursor_goto_first_child_wasm=Module._ts_tree_cursor_goto_first_child_wasm=e=>(_ts_tree_cursor_goto_first_child_wasm=Module._ts_tree_cursor_goto_first_child_wasm=wasmExports.ts_tree_cursor_goto_first_child_wasm)(e),_ts_tree_cursor_goto_last_child_wasm=Module._ts_tree_cursor_goto_last_child_wasm=e=>(_ts_tree_cursor_goto_last_child_wasm=Module._ts_tree_cursor_goto_last_child_wasm=wasmExports.ts_tree_cursor_goto_last_child_wasm)(e),_ts_tree_cursor_goto_first_child_for_index_wasm=Module._ts_tree_cursor_goto_first_child_for_index_wasm=e=>(_ts_tree_cursor_goto_first_child_for_index_wasm=Module._ts_tree_cursor_goto_first_child_for_index_wasm=wasmExports.ts_tree_cursor_goto_first_child_for_index_wasm)(e),_ts_tree_cursor_goto_first_child_for_position_wasm=Module._ts_tree_cursor_goto_first_child_for_position_wasm=e=>(_ts_tree_cursor_goto_first_child_for_position_wasm=Module._ts_tree_cursor_goto_first_child_for_position_wasm=wasmExports.ts_tree_cursor_goto_first_child_for_position_wasm)(e),_ts_tree_cursor_goto_next_sibling_wasm=Module._ts_tree_cursor_goto_next_sibling_wasm=e=>(_ts_tree_cursor_goto_next_sibling_wasm=Module._ts_tree_cursor_goto_next_sibling_wasm=wasmExports.ts_tree_cursor_goto_next_sibling_wasm)(e),_ts_tree_cursor_goto_previous_sibling_wasm=Module._ts_tree_cursor_goto_previous_sibling_wasm=e=>(_ts_tree_cursor_goto_previous_sibling_wasm=Module._ts_tree_cursor_goto_previous_sibling_wasm=wasmExports.ts_tree_cursor_goto_previous_sibling_wasm)(e),_ts_tree_cursor_goto_descendant_wasm=Module._ts_tree_cursor_goto_descendant_wasm=(e,t)=>(_ts_tree_cursor_goto_descendant_wasm=Module._ts_tree_cursor_goto_descendant_wasm=wasmExports.ts_tree_cursor_goto_descendant_wasm)(e,t),_ts_tree_cursor_goto_parent_wasm=Module._ts_tree_cursor_goto_parent_wasm=e=>(_ts_tree_cursor_goto_parent_wasm=Module._ts_tree_cursor_goto_parent_wasm=wasmExports.ts_tree_cursor_goto_parent_wasm)(e),_ts_tree_cursor_current_node_type_id_wasm=Module._ts_tree_cursor_current_node_type_id_wasm=e=>(_ts_tree_cursor_current_node_type_id_wasm=Module._ts_tree_cursor_current_node_type_id_wasm=wasmExports.ts_tree_cursor_current_node_type_id_wasm)(e),_ts_tree_cursor_current_node_state_id_wasm=Module._ts_tree_cursor_current_node_state_id_wasm=e=>(_ts_tree_cursor_current_node_state_id_wasm=Module._ts_tree_cursor_current_node_state_id_wasm=wasmExports.ts_tree_cursor_current_node_state_id_wasm)(e),_ts_tree_cursor_current_node_is_named_wasm=Module._ts_tree_cursor_current_node_is_named_wasm=e=>(_ts_tree_cursor_current_node_is_named_wasm=Module._ts_tree_cursor_current_node_is_named_wasm=wasmExports.ts_tree_cursor_current_node_is_named_wasm)(e),_ts_tree_cursor_current_node_is_missing_wasm=Module._ts_tree_cursor_current_node_is_missing_wasm=e=>(_ts_tree_cursor_current_node_is_missing_wasm=Module._ts_tree_cursor_current_node_is_missing_wasm=wasmExports.ts_tree_cursor_current_node_is_missing_wasm)(e),_ts_tree_cursor_current_node_id_wasm=Module._ts_tree_cursor_current_node_id_wasm=e=>(_ts_tree_cursor_current_node_id_wasm=Module._ts_tree_cursor_current_node_id_wasm=wasmExports.ts_tree_cursor_current_node_id_wasm)(e),_ts_tree_cursor_start_position_wasm=Module._ts_tree_cursor_start_position_wasm=e=>(_ts_tree_cursor_start_position_wasm=Module._ts_tree_cursor_start_position_wasm=wasmExports.ts_tree_cursor_start_position_wasm)(e),_ts_tree_cursor_end_position_wasm=Module._ts_tree_cursor_end_position_wasm=e=>(_ts_tree_cursor_end_position_wasm=Module._ts_tree_cursor_end_position_wasm=wasmExports.ts_tree_cursor_end_position_wasm)(e),_ts_tree_cursor_start_index_wasm=Module._ts_tree_cursor_start_index_wasm=e=>(_ts_tree_cursor_start_index_wasm=Module._ts_tree_cursor_start_index_wasm=wasmExports.ts_tree_cursor_start_index_wasm)(e),_ts_tree_cursor_end_index_wasm=Module._ts_tree_cursor_end_index_wasm=e=>(_ts_tree_cursor_end_index_wasm=Module._ts_tree_cursor_end_index_wasm=wasmExports.ts_tree_cursor_end_index_wasm)(e),_ts_tree_cursor_current_field_id_wasm=Module._ts_tree_cursor_current_field_id_wasm=e=>(_ts_tree_cursor_current_field_id_wasm=Module._ts_tree_cursor_current_field_id_wasm=wasmExports.ts_tree_cursor_current_field_id_wasm)(e),_ts_tree_cursor_current_depth_wasm=Module._ts_tree_cursor_current_depth_wasm=e=>(_ts_tree_cursor_current_depth_wasm=Module._ts_tree_cursor_current_depth_wasm=wasmExports.ts_tree_cursor_current_depth_wasm)(e),_ts_tree_cursor_current_descendant_index_wasm=Module._ts_tree_cursor_current_descendant_index_wasm=e=>(_ts_tree_cursor_current_descendant_index_wasm=Module._ts_tree_cursor_current_descendant_index_wasm=wasmExports.ts_tree_cursor_current_descendant_index_wasm)(e),_ts_tree_cursor_current_node_wasm=Module._ts_tree_cursor_current_node_wasm=e=>(_ts_tree_cursor_current_node_wasm=Module._ts_tree_cursor_current_node_wasm=wasmExports.ts_tree_cursor_current_node_wasm)(e),_ts_node_symbol_wasm=Module._ts_node_symbol_wasm=e=>(_ts_node_symbol_wasm=Module._ts_node_symbol_wasm=wasmExports.ts_node_symbol_wasm)(e),_ts_node_field_name_for_child_wasm=Module._ts_node_field_name_for_child_wasm=(e,t)=>(_ts_node_field_name_for_child_wasm=Module._ts_node_field_name_for_child_wasm=wasmExports.ts_node_field_name_for_child_wasm)(e,t),_ts_node_children_by_field_id_wasm=Module._ts_node_children_by_field_id_wasm=(e,t)=>(_ts_node_children_by_field_id_wasm=Module._ts_node_children_by_field_id_wasm=wasmExports.ts_node_children_by_field_id_wasm)(e,t),_ts_node_first_child_for_byte_wasm=Module._ts_node_first_child_for_byte_wasm=e=>(_ts_node_first_child_for_byte_wasm=Module._ts_node_first_child_for_byte_wasm=wasmExports.ts_node_first_child_for_byte_wasm)(e),_ts_node_first_named_child_for_byte_wasm=Module._ts_node_first_named_child_for_byte_wasm=e=>(_ts_node_first_named_child_for_byte_wasm=Module._ts_node_first_named_child_for_byte_wasm=wasmExports.ts_node_first_named_child_for_byte_wasm)(e),_ts_node_grammar_symbol_wasm=Module._ts_node_grammar_symbol_wasm=e=>(_ts_node_grammar_symbol_wasm=Module._ts_node_grammar_symbol_wasm=wasmExports.ts_node_grammar_symbol_wasm)(e),_ts_node_child_count_wasm=Module._ts_node_child_count_wasm=e=>(_ts_node_child_count_wasm=Module._ts_node_child_count_wasm=wasmExports.ts_node_child_count_wasm)(e),_ts_node_named_child_count_wasm=Module._ts_node_named_child_count_wasm=e=>(_ts_node_named_child_count_wasm=Module._ts_node_named_child_count_wasm=wasmExports.ts_node_named_child_count_wasm)(e),_ts_node_child_wasm=Module._ts_node_child_wasm=(e,t)=>(_ts_node_child_wasm=Module._ts_node_child_wasm=wasmExports.ts_node_child_wasm)(e,t),_ts_node_named_child_wasm=Module._ts_node_named_child_wasm=(e,t)=>(_ts_node_named_child_wasm=Module._ts_node_named_child_wasm=wasmExports.ts_node_named_child_wasm)(e,t),_ts_node_child_by_field_id_wasm=Module._ts_node_child_by_field_id_wasm=(e,t)=>(_ts_node_child_by_field_id_wasm=Module._ts_node_child_by_field_id_wasm=wasmExports.ts_node_child_by_field_id_wasm)(e,t),_ts_node_next_sibling_wasm=Module._ts_node_next_sibling_wasm=e=>(_ts_node_next_sibling_wasm=Module._ts_node_next_sibling_wasm=wasmExports.ts_node_next_sibling_wasm)(e),_ts_node_prev_sibling_wasm=Module._ts_node_prev_sibling_wasm=e=>(_ts_node_prev_sibling_wasm=Module._ts_node_prev_sibling_wasm=wasmExports.ts_node_prev_sibling_wasm)(e),_ts_node_next_named_sibling_wasm=Module._ts_node_next_named_sibling_wasm=e=>(_ts_node_next_named_sibling_wasm=Module._ts_node_next_named_sibling_wasm=wasmExports.ts_node_next_named_sibling_wasm)(e),_ts_node_prev_named_sibling_wasm=Module._ts_node_prev_named_sibling_wasm=e=>(_ts_node_prev_named_sibling_wasm=Module._ts_node_prev_named_sibling_wasm=wasmExports.ts_node_prev_named_sibling_wasm)(e),_ts_node_descendant_count_wasm=Module._ts_node_descendant_count_wasm=e=>(_ts_node_descendant_count_wasm=Module._ts_node_descendant_count_wasm=wasmExports.ts_node_descendant_count_wasm)(e),_ts_node_parent_wasm=Module._ts_node_parent_wasm=e=>(_ts_node_parent_wasm=Module._ts_node_parent_wasm=wasmExports.ts_node_parent_wasm)(e),_ts_node_descendant_for_index_wasm=Module._ts_node_descendant_for_index_wasm=e=>(_ts_node_descendant_for_index_wasm=Module._ts_node_descendant_for_index_wasm=wasmExports.ts_node_descendant_for_index_wasm)(e),_ts_node_named_descendant_for_index_wasm=Module._ts_node_named_descendant_for_index_wasm=e=>(_ts_node_named_descendant_for_index_wasm=Module._ts_node_named_descendant_for_index_wasm=wasmExports.ts_node_named_descendant_for_index_wasm)(e),_ts_node_descendant_for_position_wasm=Module._ts_node_descendant_for_position_wasm=e=>(_ts_node_descendant_for_position_wasm=Module._ts_node_descendant_for_position_wasm=wasmExports.ts_node_descendant_for_position_wasm)(e),_ts_node_named_descendant_for_position_wasm=Module._ts_node_named_descendant_for_position_wasm=e=>(_ts_node_named_descendant_for_position_wasm=Module._ts_node_named_descendant_for_position_wasm=wasmExports.ts_node_named_descendant_for_position_wasm)(e),_ts_node_start_point_wasm=Module._ts_node_start_point_wasm=e=>(_ts_node_start_point_wasm=Module._ts_node_start_point_wasm=wasmExports.ts_node_start_point_wasm)(e),_ts_node_end_point_wasm=Module._ts_node_end_point_wasm=e=>(_ts_node_end_point_wasm=Module._ts_node_end_point_wasm=wasmExports.ts_node_end_point_wasm)(e),_ts_node_start_index_wasm=Module._ts_node_start_index_wasm=e=>(_ts_node_start_index_wasm=Module._ts_node_start_index_wasm=wasmExports.ts_node_start_index_wasm)(e),_ts_node_end_index_wasm=Module._ts_node_end_index_wasm=e=>(_ts_node_end_index_wasm=Module._ts_node_end_index_wasm=wasmExports.ts_node_end_index_wasm)(e),_ts_node_to_string_wasm=Module._ts_node_to_string_wasm=e=>(_ts_node_to_string_wasm=Module._ts_node_to_string_wasm=wasmExports.ts_node_to_string_wasm)(e),_ts_node_children_wasm=Module._ts_node_children_wasm=e=>(_ts_node_children_wasm=Module._ts_node_children_wasm=wasmExports.ts_node_children_wasm)(e),_ts_node_named_children_wasm=Module._ts_node_named_children_wasm=e=>(_ts_node_named_children_wasm=Module._ts_node_named_children_wasm=wasmExports.ts_node_named_children_wasm)(e),_ts_node_descendants_of_type_wasm=Module._ts_node_descendants_of_type_wasm=(e,t,r,n,s,a,o)=>(_ts_node_descendants_of_type_wasm=Module._ts_node_descendants_of_type_wasm=wasmExports.ts_node_descendants_of_type_wasm)(e,t,r,n,s,a,o),_ts_node_is_named_wasm=Module._ts_node_is_named_wasm=e=>(_ts_node_is_named_wasm=Module._ts_node_is_named_wasm=wasmExports.ts_node_is_named_wasm)(e),_ts_node_has_changes_wasm=Module._ts_node_has_changes_wasm=e=>(_ts_node_has_changes_wasm=Module._ts_node_has_changes_wasm=wasmExports.ts_node_has_changes_wasm)(e),_ts_node_has_error_wasm=Module._ts_node_has_error_wasm=e=>(_ts_node_has_error_wasm=Module._ts_node_has_error_wasm=wasmExports.ts_node_has_error_wasm)(e),_ts_node_is_error_wasm=Module._ts_node_is_error_wasm=e=>(_ts_node_is_error_wasm=Module._ts_node_is_error_wasm=wasmExports.ts_node_is_error_wasm)(e),_ts_node_is_missing_wasm=Module._ts_node_is_missing_wasm=e=>(_ts_node_is_missing_wasm=Module._ts_node_is_missing_wasm=wasmExports.ts_node_is_missing_wasm)(e),_ts_node_is_extra_wasm=Module._ts_node_is_extra_wasm=e=>(_ts_node_is_extra_wasm=Module._ts_node_is_extra_wasm=wasmExports.ts_node_is_extra_wasm)(e),_ts_node_parse_state_wasm=Module._ts_node_parse_state_wasm=e=>(_ts_node_parse_state_wasm=Module._ts_node_parse_state_wasm=wasmExports.ts_node_parse_state_wasm)(e),_ts_node_next_parse_state_wasm=Module._ts_node_next_parse_state_wasm=e=>(_ts_node_next_parse_state_wasm=Module._ts_node_next_parse_state_wasm=wasmExports.ts_node_next_parse_state_wasm)(e),_ts_query_matches_wasm=Module._ts_query_matches_wasm=(e,t,r,n,s,a,o,c,l,u)=>(_ts_query_matches_wasm=Module._ts_query_matches_wasm=wasmExports.ts_query_matches_wasm)(e,t,r,n,s,a,o,c,l,u),_ts_query_captures_wasm=Module._ts_query_captures_wasm=(e,t,r,n,s,a,o,c,l,u)=>(_ts_query_captures_wasm=Module._ts_query_captures_wasm=wasmExports.ts_query_captures_wasm)(e,t,r,n,s,a,o,c,l,u),_iswalpha=Module._iswalpha=e=>(_iswalpha=Module._iswalpha=wasmExports.iswalpha)(e),_iswblank=Module._iswblank=e=>(_iswblank=Module._iswblank=wasmExports.iswblank)(e),_iswdigit=Module._iswdigit=e=>(_iswdigit=Module._iswdigit=wasmExports.iswdigit)(e),_iswlower=Module._iswlower=e=>(_iswlower=Module._iswlower=wasmExports.iswlower)(e),_iswupper=Module._iswupper=e=>(_iswupper=Module._iswupper=wasmExports.iswupper)(e),_iswxdigit=Module._iswxdigit=e=>(_iswxdigit=Module._iswxdigit=wasmExports.iswxdigit)(e),_memchr=Module._memchr=(e,t,r)=>(_memchr=Module._memchr=wasmExports.memchr)(e,t,r),_strlen=Module._strlen=e=>(_strlen=Module._strlen=wasmExports.strlen)(e),_strcmp=Module._strcmp=(e,t)=>(_strcmp=Module._strcmp=wasmExports.strcmp)(e,t),_strncat=Module._strncat=(e,t,r)=>(_strncat=Module._strncat=wasmExports.strncat)(e,t,r),_strncpy=Module._strncpy=(e,t,r)=>(_strncpy=Module._strncpy=wasmExports.strncpy)(e,t,r),_towlower=Module._towlower=e=>(_towlower=Module._towlower=wasmExports.towlower)(e),_towupper=Module._towupper=e=>(_towupper=Module._towupper=wasmExports.towupper)(e),_setThrew=(e,t)=>(_setThrew=wasmExports.setThrew)(e,t),stackSave=()=>(stackSave=wasmExports.stackSave)(),stackRestore=e=>(stackRestore=wasmExports.stackRestore)(e),stackAlloc=e=>(stackAlloc=wasmExports.stackAlloc)(e),dynCall_jiji=Module.dynCall_jiji=(e,t,r,n,s)=>(dynCall_jiji=Module.dynCall_jiji=wasmExports.dynCall_jiji)(e,t,r,n,s),_orig$ts_parser_timeout_micros=Module._orig$ts_parser_timeout_micros=e=>(_orig$ts_parser_timeout_micros=Module._orig$ts_parser_timeout_micros=wasmExports.orig$ts_parser_timeout_micros)(e),_orig$ts_parser_set_timeout_micros=Module._orig$ts_parser_set_timeout_micros=(e,t)=>(_orig$ts_parser_set_timeout_micros=Module._orig$ts_parser_set_timeout_micros=wasmExports.orig$ts_parser_set_timeout_micros)(e,t),calledRun;function callMain(e=[]){var t=resolveGlobalSymbol("main").sym;if(t){e.unshift(thisProgram);var r=e.length,n=stackAlloc(4*(r+1)),s=n;e.forEach(o=>{HEAPU32[s>>2]=stringToUTF8OnStack(o),s+=4}),HEAPU32[s>>2]=0;try{var a=t(r,n);return exitJS(a,!0),a}catch(o){return handleException(o)}}}function run(e=arguments_){function t(){calledRun||(calledRun=!0,Module.calledRun=!0,ABORT||(initRuntime(),preMain(),Module.onRuntimeInitialized&&Module.onRuntimeInitialized(),shouldRunNow&&callMain(e),postRun()))}runDependencies>0||(preRun(),runDependencies>0||(Module.setStatus?(Module.setStatus("Running..."),setTimeout(function(){setTimeout(function(){Module.setStatus("")},1),t()},1)):t()))}if(Module.AsciiToString=AsciiToString,Module.stringToUTF16=stringToUTF16,dependenciesFulfilled=function e(){calledRun||run(),calledRun||(dependenciesFulfilled=e)},Module.preInit)for(typeof Module.preInit=="function"&&(Module.preInit=[Module.preInit]);Module.preInit.length>0;)Module.preInit.pop()();var shouldRunNow=!0;Module.noInitialRun&&(shouldRunNow=!1),run();let C=Module,INTERNAL={},SIZE_OF_INT=4,SIZE_OF_CURSOR=4*SIZE_OF_INT,SIZE_OF_NODE=5*SIZE_OF_INT,SIZE_OF_POINT=2*SIZE_OF_INT,SIZE_OF_RANGE=2*SIZE_OF_INT+2*SIZE_OF_POINT,ZERO_POINT={row:0,column:0},QUERY_WORD_REGEX=/[\w-.]*/g,PREDICATE_STEP_TYPE_CAPTURE=1,PREDICATE_STEP_TYPE_STRING=2,LANGUAGE_FUNCTION_REGEX=/^_?tree_sitter_\w+/,VERSION,MIN_COMPATIBLE_VERSION,TRANSFER_BUFFER,currentParseCallback,currentLogCallback;class ParserImpl{static init(){TRANSFER_BUFFER=C._ts_init(),VERSION=getValue(TRANSFER_BUFFER,"i32"),MIN_COMPATIBLE_VERSION=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32")}initialize(){C._ts_parser_new_wasm(),this[0]=getValue(TRANSFER_BUFFER,"i32"),this[1]=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32")}delete(){C._ts_parser_delete(this[0]),C._free(this[1]),this[0]=0,this[1]=0}setLanguage(t){let r;if(t){if(t.constructor!==Language)throw new Error("Argument must be a Language");{r=t[0];let n=C._ts_language_version(r);if(n<MIN_COMPATIBLE_VERSION||VERSION<n)throw new Error(`Incompatible language version ${n}. Compatibility range ${MIN_COMPATIBLE_VERSION} through ${VERSION}.`)}}else r=0,t=null;return this.language=t,C._ts_parser_set_language(this[0],r),this}getLanguage(){return this.language}parse(t,r,n){if(typeof t=="string")currentParseCallback=(l,u)=>t.slice(l);else{if(typeof t!="function")throw new Error("Argument must be a string or a function");currentParseCallback=t}this.logCallback?(currentLogCallback=this.logCallback,C._ts_parser_enable_logger_wasm(this[0],1)):(currentLogCallback=null,C._ts_parser_enable_logger_wasm(this[0],0));let s=0,a=0;if(n?.includedRanges){s=n.includedRanges.length,a=C._calloc(s,SIZE_OF_RANGE);let l=a;for(let u=0;u<s;u++)marshalRange(l,n.includedRanges[u]),l+=SIZE_OF_RANGE}let o=C._ts_parser_parse_wasm(this[0],this[1],r?r[0]:0,a,s);if(!o)throw currentParseCallback=null,currentLogCallback=null,new Error("Parsing failed");let c=new Tree(INTERNAL,o,this.language,currentParseCallback);return currentParseCallback=null,currentLogCallback=null,c}reset(){C._ts_parser_reset(this[0])}getIncludedRanges(){C._ts_parser_included_ranges_wasm(this[0]);let t=getValue(TRANSFER_BUFFER,"i32"),r=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),n=new Array(t);if(t>0){let s=r;for(let a=0;a<t;a++)n[a]=unmarshalRange(s),s+=SIZE_OF_RANGE;C._free(r)}return n}getTimeoutMicros(){return C._ts_parser_timeout_micros(this[0])}setTimeoutMicros(t){C._ts_parser_set_timeout_micros(this[0],t)}setLogger(t){if(t){if(typeof t!="function")throw new Error("Logger callback must be a function")}else t=null;return this.logCallback=t,this}getLogger(){return this.logCallback}}class Tree{constructor(t,r,n,s){assertInternal(t),this[0]=r,this.language=n,this.textCallback=s}copy(){let t=C._ts_tree_copy(this[0]);return new Tree(INTERNAL,t,this.language,this.textCallback)}delete(){C._ts_tree_delete(this[0]),this[0]=0}edit(t){marshalEdit(t),C._ts_tree_edit_wasm(this[0])}get rootNode(){return C._ts_tree_root_node_wasm(this[0]),unmarshalNode(this)}rootNodeWithOffset(t,r){let n=TRANSFER_BUFFER+SIZE_OF_NODE;return setValue(n,t,"i32"),marshalPoint(n+SIZE_OF_INT,r),C._ts_tree_root_node_with_offset_wasm(this[0]),unmarshalNode(this)}getLanguage(){return this.language}walk(){return this.rootNode.walk()}getChangedRanges(t){if(t.constructor!==Tree)throw new TypeError("Argument must be a Tree");C._ts_tree_get_changed_ranges_wasm(this[0],t[0]);let r=getValue(TRANSFER_BUFFER,"i32"),n=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),s=new Array(r);if(r>0){let a=n;for(let o=0;o<r;o++)s[o]=unmarshalRange(a),a+=SIZE_OF_RANGE;C._free(n)}return s}getIncludedRanges(){C._ts_tree_included_ranges_wasm(this[0]);let t=getValue(TRANSFER_BUFFER,"i32"),r=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),n=new Array(t);if(t>0){let s=r;for(let a=0;a<t;a++)n[a]=unmarshalRange(s),s+=SIZE_OF_RANGE;C._free(r)}return n}}class Node{constructor(t,r){assertInternal(t),this.tree=r}get typeId(){return marshalNode(this),C._ts_node_symbol_wasm(this.tree[0])}get grammarId(){return marshalNode(this),C._ts_node_grammar_symbol_wasm(this.tree[0])}get type(){return this.tree.language.types[this.typeId]||"ERROR"}get grammarType(){return this.tree.language.types[this.grammarId]||"ERROR"}get endPosition(){return marshalNode(this),C._ts_node_end_point_wasm(this.tree[0]),unmarshalPoint(TRANSFER_BUFFER)}get endIndex(){return marshalNode(this),C._ts_node_end_index_wasm(this.tree[0])}get text(){return getText(this.tree,this.startIndex,this.endIndex)}get parseState(){return marshalNode(this),C._ts_node_parse_state_wasm(this.tree[0])}get nextParseState(){return marshalNode(this),C._ts_node_next_parse_state_wasm(this.tree[0])}get isNamed(){return marshalNode(this),C._ts_node_is_named_wasm(this.tree[0])===1}get hasError(){return marshalNode(this),C._ts_node_has_error_wasm(this.tree[0])===1}get hasChanges(){return marshalNode(this),C._ts_node_has_changes_wasm(this.tree[0])===1}get isError(){return marshalNode(this),C._ts_node_is_error_wasm(this.tree[0])===1}get isMissing(){return marshalNode(this),C._ts_node_is_missing_wasm(this.tree[0])===1}get isExtra(){return marshalNode(this),C._ts_node_is_extra_wasm(this.tree[0])===1}equals(t){return this.id===t.id}child(t){return marshalNode(this),C._ts_node_child_wasm(this.tree[0],t),unmarshalNode(this.tree)}namedChild(t){return marshalNode(this),C._ts_node_named_child_wasm(this.tree[0],t),unmarshalNode(this.tree)}childForFieldId(t){return marshalNode(this),C._ts_node_child_by_field_id_wasm(this.tree[0],t),unmarshalNode(this.tree)}childForFieldName(t){let r=this.tree.language.fields.indexOf(t);return r!==-1?this.childForFieldId(r):null}fieldNameForChild(t){marshalNode(this);let r=C._ts_node_field_name_for_child_wasm(this.tree[0],t);return r?AsciiToString(r):null}childrenForFieldName(t){let r=this.tree.language.fields.indexOf(t);return r!==-1&&r!==0?this.childrenForFieldId(r):[]}childrenForFieldId(t){marshalNode(this),C._ts_node_children_by_field_id_wasm(this.tree[0],t);let r=getValue(TRANSFER_BUFFER,"i32"),n=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),s=new Array(r);if(r>0){let a=n;for(let o=0;o<r;o++)s[o]=unmarshalNode(this.tree,a),a+=SIZE_OF_NODE;C._free(n)}return s}firstChildForIndex(t){return marshalNode(this),setValue(TRANSFER_BUFFER+SIZE_OF_NODE,t,"i32"),C._ts_node_first_child_for_byte_wasm(this.tree[0]),unmarshalNode(this.tree)}firstNamedChildForIndex(t){return marshalNode(this),setValue(TRANSFER_BUFFER+SIZE_OF_NODE,t,"i32"),C._ts_node_first_named_child_for_byte_wasm(this.tree[0]),unmarshalNode(this.tree)}get childCount(){return marshalNode(this),C._ts_node_child_count_wasm(this.tree[0])}get namedChildCount(){return marshalNode(this),C._ts_node_named_child_count_wasm(this.tree[0])}get firstChild(){return this.child(0)}get firstNamedChild(){return this.namedChild(0)}get lastChild(){return this.child(this.childCount-1)}get lastNamedChild(){return this.namedChild(this.namedChildCount-1)}get children(){if(!this._children){marshalNode(this),C._ts_node_children_wasm(this.tree[0]);let t=getValue(TRANSFER_BUFFER,"i32"),r=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32");if(this._children=new Array(t),t>0){let n=r;for(let s=0;s<t;s++)this._children[s]=unmarshalNode(this.tree,n),n+=SIZE_OF_NODE;C._free(r)}}return this._children}get namedChildren(){if(!this._namedChildren){marshalNode(this),C._ts_node_named_children_wasm(this.tree[0]);let t=getValue(TRANSFER_BUFFER,"i32"),r=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32");if(this._namedChildren=new Array(t),t>0){let n=r;for(let s=0;s<t;s++)this._namedChildren[s]=unmarshalNode(this.tree,n),n+=SIZE_OF_NODE;C._free(r)}}return this._namedChildren}descendantsOfType(t,r,n){Array.isArray(t)||(t=[t]),r||(r=ZERO_POINT),n||(n=ZERO_POINT);let s=[],a=this.tree.language.types;for(let d=0,p=a.length;d<p;d++)t.includes(a[d])&&s.push(d);let o=C._malloc(SIZE_OF_INT*s.length);for(let d=0,p=s.length;d<p;d++)setValue(o+d*SIZE_OF_INT,s[d],"i32");marshalNode(this),C._ts_node_descendants_of_type_wasm(this.tree[0],o,s.length,r.row,r.column,n.row,n.column);let c=getValue(TRANSFER_BUFFER,"i32"),l=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),u=new Array(c);if(c>0){let d=l;for(let p=0;p<c;p++)u[p]=unmarshalNode(this.tree,d),d+=SIZE_OF_NODE}return C._free(l),C._free(o),u}get nextSibling(){return marshalNode(this),C._ts_node_next_sibling_wasm(this.tree[0]),unmarshalNode(this.tree)}get previousSibling(){return marshalNode(this),C._ts_node_prev_sibling_wasm(this.tree[0]),unmarshalNode(this.tree)}get nextNamedSibling(){return marshalNode(this),C._ts_node_next_named_sibling_wasm(this.tree[0]),unmarshalNode(this.tree)}get previousNamedSibling(){return marshalNode(this),C._ts_node_prev_named_sibling_wasm(this.tree[0]),unmarshalNode(this.tree)}get descendantCount(){return marshalNode(this),C._ts_node_descendant_count_wasm(this.tree[0])}get parent(){return marshalNode(this),C._ts_node_parent_wasm(this.tree[0]),unmarshalNode(this.tree)}descendantForIndex(t,r=t){if(typeof t!="number"||typeof r!="number")throw new Error("Arguments must be numbers");marshalNode(this);let n=TRANSFER_BUFFER+SIZE_OF_NODE;return setValue(n,t,"i32"),setValue(n+SIZE_OF_INT,r,"i32"),C._ts_node_descendant_for_index_wasm(this.tree[0]),unmarshalNode(this.tree)}namedDescendantForIndex(t,r=t){if(typeof t!="number"||typeof r!="number")throw new Error("Arguments must be numbers");marshalNode(this);let n=TRANSFER_BUFFER+SIZE_OF_NODE;return setValue(n,t,"i32"),setValue(n+SIZE_OF_INT,r,"i32"),C._ts_node_named_descendant_for_index_wasm(this.tree[0]),unmarshalNode(this.tree)}descendantForPosition(t,r=t){if(!isPoint(t)||!isPoint(r))throw new Error("Arguments must be {row, column} objects");marshalNode(this);let n=TRANSFER_BUFFER+SIZE_OF_NODE;return marshalPoint(n,t),marshalPoint(n+SIZE_OF_POINT,r),C._ts_node_descendant_for_position_wasm(this.tree[0]),unmarshalNode(this.tree)}namedDescendantForPosition(t,r=t){if(!isPoint(t)||!isPoint(r))throw new Error("Arguments must be {row, column} objects");marshalNode(this);let n=TRANSFER_BUFFER+SIZE_OF_NODE;return marshalPoint(n,t),marshalPoint(n+SIZE_OF_POINT,r),C._ts_node_named_descendant_for_position_wasm(this.tree[0]),unmarshalNode(this.tree)}walk(){return marshalNode(this),C._ts_tree_cursor_new_wasm(this.tree[0]),new TreeCursor(INTERNAL,this.tree)}toString(){marshalNode(this);let t=C._ts_node_to_string_wasm(this.tree[0]),r=AsciiToString(t);return C._free(t),r}}class TreeCursor{constructor(t,r){assertInternal(t),this.tree=r,unmarshalTreeCursor(this)}delete(){marshalTreeCursor(this),C._ts_tree_cursor_delete_wasm(this.tree[0]),this[0]=this[1]=this[2]=0}reset(t){marshalNode(t),marshalTreeCursor(this,TRANSFER_BUFFER+SIZE_OF_NODE),C._ts_tree_cursor_reset_wasm(this.tree[0]),unmarshalTreeCursor(this)}resetTo(t){marshalTreeCursor(this,TRANSFER_BUFFER),marshalTreeCursor(t,TRANSFER_BUFFER+SIZE_OF_CURSOR),C._ts_tree_cursor_reset_to_wasm(this.tree[0],t.tree[0]),unmarshalTreeCursor(this)}get nodeType(){return this.tree.language.types[this.nodeTypeId]||"ERROR"}get nodeTypeId(){return marshalTreeCursor(this),C._ts_tree_cursor_current_node_type_id_wasm(this.tree[0])}get nodeStateId(){return marshalTreeCursor(this),C._ts_tree_cursor_current_node_state_id_wasm(this.tree[0])}get nodeId(){return marshalTreeCursor(this),C._ts_tree_cursor_current_node_id_wasm(this.tree[0])}get nodeIsNamed(){return marshalTreeCursor(this),C._ts_tree_cursor_current_node_is_named_wasm(this.tree[0])===1}get nodeIsMissing(){return marshalTreeCursor(this),C._ts_tree_cursor_current_node_is_missing_wasm(this.tree[0])===1}get nodeText(){marshalTreeCursor(this);let t=C._ts_tree_cursor_start_index_wasm(this.tree[0]),r=C._ts_tree_cursor_end_index_wasm(this.tree[0]);return getText(this.tree,t,r)}get startPosition(){return marshalTreeCursor(this),C._ts_tree_cursor_start_position_wasm(this.tree[0]),unmarshalPoint(TRANSFER_BUFFER)}get endPosition(){return marshalTreeCursor(this),C._ts_tree_cursor_end_position_wasm(this.tree[0]),unmarshalPoint(TRANSFER_BUFFER)}get startIndex(){return marshalTreeCursor(this),C._ts_tree_cursor_start_index_wasm(this.tree[0])}get endIndex(){return marshalTreeCursor(this),C._ts_tree_cursor_end_index_wasm(this.tree[0])}get currentNode(){return marshalTreeCursor(this),C._ts_tree_cursor_current_node_wasm(this.tree[0]),unmarshalNode(this.tree)}get currentFieldId(){return marshalTreeCursor(this),C._ts_tree_cursor_current_field_id_wasm(this.tree[0])}get currentFieldName(){return this.tree.language.fields[this.currentFieldId]}get currentDepth(){return marshalTreeCursor(this),C._ts_tree_cursor_current_depth_wasm(this.tree[0])}get currentDescendantIndex(){return marshalTreeCursor(this),C._ts_tree_cursor_current_descendant_index_wasm(this.tree[0])}gotoFirstChild(){marshalTreeCursor(this);let t=C._ts_tree_cursor_goto_first_child_wasm(this.tree[0]);return unmarshalTreeCursor(this),t===1}gotoLastChild(){marshalTreeCursor(this);let t=C._ts_tree_cursor_goto_last_child_wasm(this.tree[0]);return unmarshalTreeCursor(this),t===1}gotoFirstChildForIndex(t){marshalTreeCursor(this),setValue(TRANSFER_BUFFER+SIZE_OF_CURSOR,t,"i32");let r=C._ts_tree_cursor_goto_first_child_for_index_wasm(this.tree[0]);return unmarshalTreeCursor(this),r===1}gotoFirstChildForPosition(t){marshalTreeCursor(this),marshalPoint(TRANSFER_BUFFER+SIZE_OF_CURSOR,t);let r=C._ts_tree_cursor_goto_first_child_for_position_wasm(this.tree[0]);return unmarshalTreeCursor(this),r===1}gotoNextSibling(){marshalTreeCursor(this);let t=C._ts_tree_cursor_goto_next_sibling_wasm(this.tree[0]);return unmarshalTreeCursor(this),t===1}gotoPreviousSibling(){marshalTreeCursor(this);let t=C._ts_tree_cursor_goto_previous_sibling_wasm(this.tree[0]);return unmarshalTreeCursor(this),t===1}gotoDescendant(t){marshalTreeCursor(this),C._ts_tree_cursor_goto_descendant_wasm(this.tree[0],t),unmarshalTreeCursor(this)}gotoParent(){marshalTreeCursor(this);let t=C._ts_tree_cursor_goto_parent_wasm(this.tree[0]);return unmarshalTreeCursor(this),t===1}}class Language{constructor(t,r){assertInternal(t),this[0]=r,this.types=new Array(C._ts_language_symbol_count(this[0]));for(let n=0,s=this.types.length;n<s;n++)C._ts_language_symbol_type(this[0],n)<2&&(this.types[n]=UTF8ToString(C._ts_language_symbol_name(this[0],n)));this.fields=new Array(C._ts_language_field_count(this[0])+1);for(let n=0,s=this.fields.length;n<s;n++){let a=C._ts_language_field_name_for_id(this[0],n);this.fields[n]=a!==0?UTF8ToString(a):null}}get version(){return C._ts_language_version(this[0])}get fieldCount(){return this.fields.length-1}get stateCount(){return C._ts_language_state_count(this[0])}fieldIdForName(t){let r=this.fields.indexOf(t);return r!==-1?r:null}fieldNameForId(t){return this.fields[t]||null}idForNodeType(t,r){let n=lengthBytesUTF8(t),s=C._malloc(n+1);stringToUTF8(t,s,n+1);let a=C._ts_language_symbol_for_name(this[0],s,n,r);return C._free(s),a||null}get nodeTypeCount(){return C._ts_language_symbol_count(this[0])}nodeTypeForId(t){let r=C._ts_language_symbol_name(this[0],t);return r?UTF8ToString(r):null}nodeTypeIsNamed(t){return!!C._ts_language_type_is_named_wasm(this[0],t)}nodeTypeIsVisible(t){return!!C._ts_language_type_is_visible_wasm(this[0],t)}nextState(t,r){return C._ts_language_next_state(this[0],t,r)}lookaheadIterator(t){let r=C._ts_lookahead_iterator_new(this[0],t);return r?new LookaheadIterable(INTERNAL,r,this):null}query(t){let r=lengthBytesUTF8(t),n=C._malloc(r+1);stringToUTF8(t,n,r+1);let s=C._ts_query_new(this[0],n,r,TRANSFER_BUFFER,TRANSFER_BUFFER+SIZE_OF_INT);if(!s){let g=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),y=getValue(TRANSFER_BUFFER,"i32"),_=UTF8ToString(n,y).length,v=t.substr(_,100).split(`
|
|
66
66
|
`)[0],S,w=v.match(QUERY_WORD_REGEX)[0];switch(g){case 2:S=new RangeError(`Bad node name '${w}'`);break;case 3:S=new RangeError(`Bad field name '${w}'`);break;case 4:S=new RangeError(`Bad capture name @${w}`);break;case 5:S=new TypeError(`Bad pattern structure at offset ${_}: '${v}'...`),w="";break;default:S=new SyntaxError(`Bad syntax at offset ${_}: '${v}'...`),w=""}throw S.index=_,S.length=w.length,C._free(n),S}let a=C._ts_query_string_count(s),o=C._ts_query_capture_count(s),c=C._ts_query_pattern_count(s),l=new Array(o),u=new Array(a);for(let g=0;g<o;g++){let y=C._ts_query_capture_name_for_id(s,g,TRANSFER_BUFFER),_=getValue(TRANSFER_BUFFER,"i32");l[g]=UTF8ToString(y,_)}for(let g=0;g<a;g++){let y=C._ts_query_string_value_for_id(s,g,TRANSFER_BUFFER),_=getValue(TRANSFER_BUFFER,"i32");u[g]=UTF8ToString(y,_)}let d=new Array(c),p=new Array(c),f=new Array(c),h=new Array(c),m=new Array(c);for(let g=0;g<c;g++){let y=C._ts_query_predicates_for_pattern(s,g,TRANSFER_BUFFER),_=getValue(TRANSFER_BUFFER,"i32");h[g]=[],m[g]=[];let v=[],S=y;for(let w=0;w<_;w++){let E=getValue(S,"i32");S+=SIZE_OF_INT;let k=getValue(S,"i32");if(S+=SIZE_OF_INT,E===PREDICATE_STEP_TYPE_CAPTURE)v.push({type:"capture",name:l[k]});else if(E===PREDICATE_STEP_TYPE_STRING)v.push({type:"string",value:u[k]});else if(v.length>0){if(v[0].type!=="string")throw new Error("Predicates must begin with a literal value");let N=v[0].value,O,V=!0,te=!0;switch(N){case"any-not-eq?":case"not-eq?":V=!1;case"any-eq?":case"eq?":if(v.length!==3)throw new Error(`Wrong number of arguments to \`#${N}\` predicate. Expected 2, got ${v.length-1}`);if(v[1].type!=="capture")throw new Error(`First argument of \`#${N}\` predicate must be a capture. Got "${v[1].value}"`);if(te=!N.startsWith("any-"),v[2].type==="capture"){let Y=v[1].name,ae=v[2].name;m[g].push(K=>{let D=[],A=[];for(let z of K)z.name===Y&&D.push(z.node),z.name===ae&&A.push(z.node);let M=(z,ee,le)=>le?z.text===ee.text:z.text!==ee.text;return te?D.every(z=>A.some(ee=>M(z,ee,V))):D.some(z=>A.some(ee=>M(z,ee,V)))})}else{O=v[1].name;let Y=v[2].value,ae=D=>D.text===Y,K=D=>D.text!==Y;m[g].push(D=>{let A=[];for(let z of D)z.name===O&&A.push(z.node);let M=V?ae:K;return te?A.every(M):A.some(M)})}break;case"any-not-match?":case"not-match?":V=!1;case"any-match?":case"match?":if(v.length!==3)throw new Error(`Wrong number of arguments to \`#${N}\` predicate. Expected 2, got ${v.length-1}.`);if(v[1].type!=="capture")throw new Error(`First argument of \`#${N}\` predicate must be a capture. Got "${v[1].value}".`);if(v[2].type!=="string")throw new Error(`Second argument of \`#${N}\` predicate must be a string. Got @${v[2].value}.`);O=v[1].name;let W=new RegExp(v[2].value);te=!N.startsWith("any-"),m[g].push(Y=>{let ae=[];for(let D of Y)D.name===O&&ae.push(D.node.text);let K=(D,A)=>A?W.test(D):!W.test(D);return ae.length===0?!V:te?ae.every(D=>K(D,V)):ae.some(D=>K(D,V))});break;case"set!":if(v.length<2||v.length>3)throw new Error(`Wrong number of arguments to \`#set!\` predicate. Expected 1 or 2. Got ${v.length-1}.`);if(v.some(Y=>Y.type!=="string"))throw new Error('Arguments to `#set!` predicate must be a strings.".');d[g]||(d[g]={}),d[g][v[1].value]=v[2]?v[2].value:null;break;case"is?":case"is-not?":if(v.length<2||v.length>3)throw new Error(`Wrong number of arguments to \`#${N}\` predicate. Expected 1 or 2. Got ${v.length-1}.`);if(v.some(Y=>Y.type!=="string"))throw new Error(`Arguments to \`#${N}\` predicate must be a strings.".`);let $=N==="is?"?p:f;$[g]||($[g]={}),$[g][v[1].value]=v[2]?v[2].value:null;break;case"not-any-of?":V=!1;case"any-of?":if(v.length<2)throw new Error(`Wrong number of arguments to \`#${N}\` predicate. Expected at least 1. Got ${v.length-1}.`);if(v[1].type!=="capture")throw new Error(`First argument of \`#${N}\` predicate must be a capture. Got "${v[1].value}".`);for(let Y=2;Y<v.length;Y++)if(v[Y].type!=="string")throw new Error(`Arguments to \`#${N}\` predicate must be a strings.".`);O=v[1].name;let H=v.slice(2).map(Y=>Y.value);m[g].push(Y=>{let ae=[];for(let K of Y)K.name===O&&ae.push(K.node.text);return ae.length===0?!V:ae.every(K=>H.includes(K))===V});break;default:h[g].push({operator:N,operands:v.slice(1)})}v.length=0}}Object.freeze(d[g]),Object.freeze(p[g]),Object.freeze(f[g])}return C._free(n),new Query(INTERNAL,s,l,m,h,Object.freeze(d),Object.freeze(p),Object.freeze(f))}static load(t){let r;if(t instanceof Uint8Array)r=Promise.resolve(t);else{let n=t;if(typeof process<"u"&&process.versions&&process.versions.node){let s=require("fs");r=Promise.resolve(s.readFileSync(n))}else r=fetch(n).then(s=>s.arrayBuffer().then(a=>{if(s.ok)return new Uint8Array(a);{let o=new TextDecoder("utf-8").decode(a);throw new Error(`Language.load failed with status ${s.status}.
|
|
67
67
|
|
|
68
68
|
${o}`)}}))}return r.then(n=>loadWebAssemblyModule(n,{loadAsync:!0})).then(n=>{let s=Object.keys(n),a=s.find(c=>LANGUAGE_FUNCTION_REGEX.test(c)&&!c.includes("external_scanner_"));a||console.log(`Couldn't find language function in WASM file. Symbols:
|
|
@@ -214,9 +214,9 @@ These guidelines are the ONLY guidelines. Do not invent new ones.`:""].join(`
|
|
|
214
214
|
|
|
215
215
|
[USER-REQUESTED REVIEW FOCUS]
|
|
216
216
|
${r}
|
|
217
|
-
[END]`,k=await g(d,[{role:"system",content:v},{role:"user",content:E}],w?.signal??n.signal);return JN(String(k?.text??"{}"))};try{e.wsBridge.broadcast({type:"aiReviewProgress",message:"Scanning project-level files\u2026",completed:0,total:1});let v=await y({store:e.snapshotStore,model:u,llmCall:_,evidenceGate:f,signal:n.signal,baselineRef:m,onFinding:w=>e.wsBridge.broadcast({type:"aiFindingAdded",entryPointId:w.entryPointId,findings:[w]})});if(n.signal.aborted){e.wsBridge.broadcast({type:"aiReviewCancelled",reason:"user"}),Br(e.wsBridge,"warning","Specific review cancelled.");return}let S=e.snapshotStore.getAiReviewFindingCounts();e.wsBridge.broadcast({type:"aiReviewComplete",summary:{totalEntryPoints:v.files.length,reviewed:v.files.length,failed:0,findingsCount:0,projectFindings:v.findingsCount,durationMs:v.durationMs,kind:"specific"},counts:S}),Br(e.wsBridge,"info",`Specific review done \u2014 ${v.findingsCount} findings across ${v.files.length} files.`)}catch(v){n.signal.aborted?(e.wsBridge.broadcast({type:"aiReviewCancelled",reason:"user"}),Br(e.wsBridge,"warning","Specific review cancelled.")):Br(e.wsBridge,"error",`Specific review failed: ${(v?.message??v).slice(0,200)}`)}finally{yi=null,e.wsBridge.broadcast({type:"aiReviewLoading",loading:!1})}}function Br(e,t,r){e.broadcast({type:"clientToast",level:t,text:r})}function JN(e){let t=e.replace(/```(?:json|JSON)?\s*/g,"").replace(/```/g,""),r=t.indexOf("{");if(r<0)return{findings:[]};let n=0,s=!1,a=!1,o=-1;for(let l=r;l<t.length;l++){let u=t[l];if(a){a=!1;continue}if(u==="\\"){a=!0;continue}if(u==='"'){s=!s;continue}if(!s){if(u==="{")n+=1;else if(u==="}"&&(n-=1,n===0)){o=l;break}}}if(o<0)return{findings:[]};let c=t.slice(r,o+1);try{let l=JSON.parse(c);return l&&Array.isArray(l.findings)?l:{findings:[]}}catch{return{findings:[]}}}var yi,um=Kt(()=>{"use strict";DN();V8();yi=null});var Gt;(function(e){e.assertEqual=s=>{};function t(s){}e.assertIs=t;function r(s){throw new Error}e.assertNever=r,e.arrayToEnum=s=>{let a={};for(let o of s)a[o]=o;return a},e.getValidEnumValues=s=>{let a=e.objectKeys(s).filter(c=>typeof s[s[c]]!="number"),o={};for(let c of a)o[c]=s[c];return e.objectValues(o)},e.objectValues=s=>e.objectKeys(s).map(function(a){return s[a]}),e.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{let a=[];for(let o in s)Object.prototype.hasOwnProperty.call(s,o)&&a.push(o);return a},e.find=(s,a)=>{for(let o of s)if(a(o))return o},e.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function n(s,a=" | "){return s.map(o=>typeof o=="string"?`'${o}'`:o).join(a)}e.joinValues=n,e.jsonStringifyReplacer=(s,a)=>typeof a=="bigint"?a.toString():a})(Gt||(Gt={}));var CO;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(CO||(CO={}));var Be=Gt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),sa=e=>{switch(typeof e){case"undefined":return Be.undefined;case"string":return Be.string;case"number":return Number.isNaN(e)?Be.nan:Be.number;case"boolean":return Be.boolean;case"function":return Be.function;case"bigint":return Be.bigint;case"symbol":return Be.symbol;case"object":return Array.isArray(e)?Be.array:e===null?Be.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Be.promise:typeof Map<"u"&&e instanceof Map?Be.map:typeof Set<"u"&&e instanceof Set?Be.set:typeof Date<"u"&&e instanceof Date?Be.date:Be.object;default:return Be.unknown}};var Te=Gt.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 xi=class e extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){let r=t||function(a){return a.message},n={_errors:[]},s=a=>{for(let o of a.issues)if(o.code==="invalid_union")o.unionErrors.map(s);else if(o.code==="invalid_return_type")s(o.returnTypeError);else if(o.code==="invalid_arguments")s(o.argumentsError);else if(o.path.length===0)n._errors.push(r(o));else{let c=n,l=0;for(;l<o.path.length;){let u=o.path[l];l===o.path.length-1?(c[u]=c[u]||{_errors:[]},c[u]._errors.push(r(o))):c[u]=c[u]||{_errors:[]},c=c[u],l++}}};return s(this),n}static assert(t){if(!(t instanceof e))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Gt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){let r=Object.create(null),n=[];for(let s of this.issues)if(s.path.length>0){let a=s.path[0];r[a]=r[a]||[],r[a].push(t(s))}else n.push(t(s));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};xi.create=e=>new xi(e);var b5=(e,t)=>{let r;switch(e.code){case Te.invalid_type:e.received===Be.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case Te.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,Gt.jsonStringifyReplacer)}`;break;case Te.unrecognized_keys:r=`Unrecognized key(s) in object: ${Gt.joinValues(e.keys,", ")}`;break;case Te.invalid_union:r="Invalid input";break;case Te.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Gt.joinValues(e.options)}`;break;case Te.invalid_enum_value:r=`Invalid enum value. Expected ${Gt.joinValues(e.options)}, received '${e.received}'`;break;case Te.invalid_arguments:r="Invalid function arguments";break;case Te.invalid_return_type:r="Invalid function return type";break;case Te.invalid_date:r="Invalid date";break;case Te.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:Gt.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case Te.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case Te.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case Te.custom:r="Invalid input";break;case Te.invalid_intersection_types:r="Intersection results could not be merged";break;case Te.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case Te.not_finite:r="Number must be finite";break;default:r=t.defaultError,Gt.assertNever(e)}return{message:r}},Ha=b5;var v5=Ha;function Ad(){return v5}var Im=e=>{let{data:t,path:r,errorMaps:n,issueData:s}=e,a=[...r,...s.path||[]],o={...s,path:a};if(s.message!==void 0)return{...s,path:a,message:s.message};let c="",l=n.filter(u=>!!u).slice().reverse();for(let u of l)c=u(o,{data:t,defaultError:c}).message;return{...s,path:a,message:c}};function $e(e,t){let r=Ad(),n=Im({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===Ha?void 0:Ha].filter(s=>!!s)});e.common.issues.push(n)}var Cn=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){let n=[];for(let s of r){if(s.status==="aborted")return gt;s.status==="dirty"&&t.dirty(),n.push(s.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){let n=[];for(let s of r){let a=await s.key,o=await s.value;n.push({key:a,value:o})}return e.mergeObjectSync(t,n)}static mergeObjectSync(t,r){let n={};for(let s of r){let{key:a,value:o}=s;if(a.status==="aborted"||o.status==="aborted")return gt;a.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),a.value!=="__proto__"&&(typeof o.value<"u"||s.alwaysSet)&&(n[a.value]=o.value)}return{status:t.value,value:n}}},gt=Object.freeze({status:"aborted"}),_l=e=>({status:"dirty",value:e}),Un=e=>({status:"valid",value:e}),mx=e=>e.status==="aborted",gx=e=>e.status==="dirty",Qo=e=>e.status==="valid",kd=e=>typeof Promise<"u"&&e instanceof Promise;var Ke;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(Ke||(Ke={}));var Ri=class{constructor(t,r,n,s){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=s}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}},NO=(e,t)=>{if(Qo(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new xi(e.common.issues);return this._error=r,this._error}}};function Tt(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:s}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:s}:{errorMap:(o,c)=>{let{message:l}=e;return o.code==="invalid_enum_value"?{message:l??c.defaultError}:typeof c.data>"u"?{message:l??n??c.defaultError}:o.code!=="invalid_type"?{message:c.defaultError}:{message:l??r??c.defaultError}},description:s}}var Mt=class{get description(){return this._def.description}_getType(t){return sa(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:sa(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Cn,ctx:{common:t.parent.common,data:t.data,parsedType:sa(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(kd(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){let r=this._parse(t);return Promise.resolve(r)}parse(t,r){let n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){let n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:sa(t)},s=this._parseSync({data:t,path:n.path,parent:n});return NO(n,s)}"~validate"(t){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:sa(t)};if(!this["~standard"].async)try{let n=this._parseSync({data:t,path:[],parent:r});return Qo(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:r}).then(n=>Qo(n)?{value:n.value}:{issues:r.common.issues})}async parseAsync(t,r){let n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:sa(t)},s=this._parse({data:t,path:n.path,parent:n}),a=await(kd(s)?s:Promise.resolve(s));return NO(n,a)}refine(t,r){let n=s=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(s):r;return this._refinement((s,a)=>{let o=t(s),c=()=>a.addIssue({code:Te.custom,...n(s)});return typeof Promise<"u"&&o instanceof Promise?o.then(l=>l?!0:(c(),!1)):o?!0:(c(),!1)})}refinement(t,r){return this._refinement((n,s)=>t(n)?!0:(s.addIssue(typeof r=="function"?r(n,s):r),!1))}_refinement(t){return new ds({schema:this,typeName:dt.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return us.create(this,this._def)}nullable(){return ca.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ya.create(this)}promise(){return ec.create(this,this._def)}or(t){return Tl.create([this,t],this._def)}and(t){return wl.create(this,t,this._def)}transform(t){return new ds({...Tt(this._def),schema:this,typeName:dt.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new kl({...Tt(this._def),innerType:this,defaultValue:r,typeName:dt.ZodDefault})}brand(){return new Am({typeName:dt.ZodBranded,type:this,...Tt(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new Cl({...Tt(this._def),innerType:this,catchValue:r,typeName:dt.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return km.create(this,t)}readonly(){return Nl.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},x5=/^c[^\s-]{8,}$/i,S5=/^[0-9a-z]+$/,T5=/^[0-9A-HJKMNP-TV-Z]{26}$/i,w5=/^[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,E5=/^[a-z0-9_-]{21}$/i,P5=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,I5=/^[-+]?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)?)??$/,A5=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,k5="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",yx,C5=/^(?:(?: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])$/,N5=/^(?:(?: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])$/,O5=/^(([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]))$/,$5=/^(([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])$/,R5=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,D5=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,OO="((\\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])))",M5=new RegExp(`^${OO}$`);function $O(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);let r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function L5(e){return new RegExp(`^${$O(e)}$`)}function F5(e){let t=`${OO}T${$O(e)}`,r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function j5(e,t){return!!((t==="v4"||!t)&&C5.test(e)||(t==="v6"||!t)&&O5.test(e))}function B5(e,t){if(!P5.test(e))return!1;try{let[r]=e.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),s=JSON.parse(atob(n));return!(typeof s!="object"||s===null||"typ"in s&&s?.typ!=="JWT"||!s.alg||t&&s.alg!==t)}catch{return!1}}function z5(e,t){return!!((t==="v4"||!t)&&N5.test(e)||(t==="v6"||!t)&&$5.test(e))}var vl=class e extends Mt{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Be.string){let a=this._getOrReturnCtx(t);return $e(a,{code:Te.invalid_type,expected:Be.string,received:a.parsedType}),gt}let n=new Cn,s;for(let a of this._def.checks)if(a.kind==="min")t.data.length<a.value&&(s=this._getOrReturnCtx(t,s),$e(s,{code:Te.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="max")t.data.length>a.value&&(s=this._getOrReturnCtx(t,s),$e(s,{code:Te.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="length"){let o=t.data.length>a.value,c=t.data.length<a.value;(o||c)&&(s=this._getOrReturnCtx(t,s),o?$e(s,{code:Te.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):c&&$e(s,{code:Te.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),n.dirty())}else if(a.kind==="email")A5.test(t.data)||(s=this._getOrReturnCtx(t,s),$e(s,{validation:"email",code:Te.invalid_string,message:a.message}),n.dirty());else if(a.kind==="emoji")yx||(yx=new RegExp(k5,"u")),yx.test(t.data)||(s=this._getOrReturnCtx(t,s),$e(s,{validation:"emoji",code:Te.invalid_string,message:a.message}),n.dirty());else if(a.kind==="uuid")w5.test(t.data)||(s=this._getOrReturnCtx(t,s),$e(s,{validation:"uuid",code:Te.invalid_string,message:a.message}),n.dirty());else if(a.kind==="nanoid")E5.test(t.data)||(s=this._getOrReturnCtx(t,s),$e(s,{validation:"nanoid",code:Te.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid")x5.test(t.data)||(s=this._getOrReturnCtx(t,s),$e(s,{validation:"cuid",code:Te.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid2")S5.test(t.data)||(s=this._getOrReturnCtx(t,s),$e(s,{validation:"cuid2",code:Te.invalid_string,message:a.message}),n.dirty());else if(a.kind==="ulid")T5.test(t.data)||(s=this._getOrReturnCtx(t,s),$e(s,{validation:"ulid",code:Te.invalid_string,message:a.message}),n.dirty());else if(a.kind==="url")try{new URL(t.data)}catch{s=this._getOrReturnCtx(t,s),$e(s,{validation:"url",code:Te.invalid_string,message:a.message}),n.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(t.data)||(s=this._getOrReturnCtx(t,s),$e(s,{validation:"regex",code:Te.invalid_string,message:a.message}),n.dirty())):a.kind==="trim"?t.data=t.data.trim():a.kind==="includes"?t.data.includes(a.value,a.position)||(s=this._getOrReturnCtx(t,s),$e(s,{code:Te.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),n.dirty()):a.kind==="toLowerCase"?t.data=t.data.toLowerCase():a.kind==="toUpperCase"?t.data=t.data.toUpperCase():a.kind==="startsWith"?t.data.startsWith(a.value)||(s=this._getOrReturnCtx(t,s),$e(s,{code:Te.invalid_string,validation:{startsWith:a.value},message:a.message}),n.dirty()):a.kind==="endsWith"?t.data.endsWith(a.value)||(s=this._getOrReturnCtx(t,s),$e(s,{code:Te.invalid_string,validation:{endsWith:a.value},message:a.message}),n.dirty()):a.kind==="datetime"?F5(a).test(t.data)||(s=this._getOrReturnCtx(t,s),$e(s,{code:Te.invalid_string,validation:"datetime",message:a.message}),n.dirty()):a.kind==="date"?M5.test(t.data)||(s=this._getOrReturnCtx(t,s),$e(s,{code:Te.invalid_string,validation:"date",message:a.message}),n.dirty()):a.kind==="time"?L5(a).test(t.data)||(s=this._getOrReturnCtx(t,s),$e(s,{code:Te.invalid_string,validation:"time",message:a.message}),n.dirty()):a.kind==="duration"?I5.test(t.data)||(s=this._getOrReturnCtx(t,s),$e(s,{validation:"duration",code:Te.invalid_string,message:a.message}),n.dirty()):a.kind==="ip"?j5(t.data,a.version)||(s=this._getOrReturnCtx(t,s),$e(s,{validation:"ip",code:Te.invalid_string,message:a.message}),n.dirty()):a.kind==="jwt"?B5(t.data,a.alg)||(s=this._getOrReturnCtx(t,s),$e(s,{validation:"jwt",code:Te.invalid_string,message:a.message}),n.dirty()):a.kind==="cidr"?z5(t.data,a.version)||(s=this._getOrReturnCtx(t,s),$e(s,{validation:"cidr",code:Te.invalid_string,message:a.message}),n.dirty()):a.kind==="base64"?R5.test(t.data)||(s=this._getOrReturnCtx(t,s),$e(s,{validation:"base64",code:Te.invalid_string,message:a.message}),n.dirty()):a.kind==="base64url"?D5.test(t.data)||(s=this._getOrReturnCtx(t,s),$e(s,{validation:"base64url",code:Te.invalid_string,message:a.message}),n.dirty()):Gt.assertNever(a);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(s=>t.test(s),{validation:r,code:Te.invalid_string,...Ke.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Ke.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Ke.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Ke.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Ke.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...Ke.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Ke.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Ke.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Ke.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...Ke.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...Ke.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...Ke.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Ke.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...Ke.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...Ke.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...Ke.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...Ke.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...Ke.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,...Ke.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...Ke.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...Ke.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...Ke.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...Ke.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...Ke.errToObj(r)})}nonempty(t){return this.min(1,Ke.errToObj(t))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};vl.create=e=>new vl({checks:[],typeName:dt.ZodString,coerce:e?.coerce??!1,...Tt(e)});function U5(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,s=r>n?r:n,a=Number.parseInt(e.toFixed(s).replace(".","")),o=Number.parseInt(t.toFixed(s).replace(".",""));return a%o/10**s}var Cd=class e extends Mt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==Be.number){let a=this._getOrReturnCtx(t);return $e(a,{code:Te.invalid_type,expected:Be.number,received:a.parsedType}),gt}let n,s=new Cn;for(let a of this._def.checks)a.kind==="int"?Gt.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),$e(n,{code:Te.invalid_type,expected:"integer",received:"float",message:a.message}),s.dirty()):a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(n=this._getOrReturnCtx(t,n),$e(n,{code:Te.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),s.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(n=this._getOrReturnCtx(t,n),$e(n,{code:Te.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),s.dirty()):a.kind==="multipleOf"?U5(t.data,a.value)!==0&&(n=this._getOrReturnCtx(t,n),$e(n,{code:Te.not_multiple_of,multipleOf:a.value,message:a.message}),s.dirty()):a.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),$e(n,{code:Te.not_finite,message:a.message}),s.dirty()):Gt.assertNever(a);return{status:s.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,Ke.toString(r))}gt(t,r){return this.setLimit("min",t,!1,Ke.toString(r))}lte(t,r){return this.setLimit("max",t,!0,Ke.toString(r))}lt(t,r){return this.setLimit("max",t,!1,Ke.toString(r))}setLimit(t,r,n,s){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:Ke.toString(s)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Ke.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ke.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ke.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ke.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ke.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:Ke.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:Ke.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ke.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ke.toString(t)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Gt.isInteger(t.value))}get isFinite(){let t=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}};Cd.create=e=>new Cd({checks:[],typeName:dt.ZodNumber,coerce:e?.coerce||!1,...Tt(e)});var Nd=class e extends Mt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==Be.bigint)return this._getInvalidInput(t);let n,s=new Cn;for(let a of this._def.checks)a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(n=this._getOrReturnCtx(t,n),$e(n,{code:Te.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),s.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(n=this._getOrReturnCtx(t,n),$e(n,{code:Te.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),s.dirty()):a.kind==="multipleOf"?t.data%a.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),$e(n,{code:Te.not_multiple_of,multipleOf:a.value,message:a.message}),s.dirty()):Gt.assertNever(a);return{status:s.value,value:t.data}}_getInvalidInput(t){let r=this._getOrReturnCtx(t);return $e(r,{code:Te.invalid_type,expected:Be.bigint,received:r.parsedType}),gt}gte(t,r){return this.setLimit("min",t,!0,Ke.toString(r))}gt(t,r){return this.setLimit("min",t,!1,Ke.toString(r))}lte(t,r){return this.setLimit("max",t,!0,Ke.toString(r))}lt(t,r){return this.setLimit("max",t,!1,Ke.toString(r))}setLimit(t,r,n,s){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:Ke.toString(s)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ke.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ke.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ke.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ke.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:Ke.toString(r)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};Nd.create=e=>new Nd({checks:[],typeName:dt.ZodBigInt,coerce:e?.coerce??!1,...Tt(e)});var Od=class extends Mt{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==Be.boolean){let n=this._getOrReturnCtx(t);return $e(n,{code:Te.invalid_type,expected:Be.boolean,received:n.parsedType}),gt}return Un(t.data)}};Od.create=e=>new Od({typeName:dt.ZodBoolean,coerce:e?.coerce||!1,...Tt(e)});var $d=class e extends Mt{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Be.date){let a=this._getOrReturnCtx(t);return $e(a,{code:Te.invalid_type,expected:Be.date,received:a.parsedType}),gt}if(Number.isNaN(t.data.getTime())){let a=this._getOrReturnCtx(t);return $e(a,{code:Te.invalid_date}),gt}let n=new Cn,s;for(let a of this._def.checks)a.kind==="min"?t.data.getTime()<a.value&&(s=this._getOrReturnCtx(t,s),$e(s,{code:Te.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),n.dirty()):a.kind==="max"?t.data.getTime()>a.value&&(s=this._getOrReturnCtx(t,s),$e(s,{code:Te.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),n.dirty()):Gt.assertNever(a);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:Ke.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:Ke.toString(r)})}get minDate(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}};$d.create=e=>new $d({checks:[],coerce:e?.coerce||!1,typeName:dt.ZodDate,...Tt(e)});var Rd=class extends Mt{_parse(t){if(this._getType(t)!==Be.symbol){let n=this._getOrReturnCtx(t);return $e(n,{code:Te.invalid_type,expected:Be.symbol,received:n.parsedType}),gt}return Un(t.data)}};Rd.create=e=>new Rd({typeName:dt.ZodSymbol,...Tt(e)});var xl=class extends Mt{_parse(t){if(this._getType(t)!==Be.undefined){let n=this._getOrReturnCtx(t);return $e(n,{code:Te.invalid_type,expected:Be.undefined,received:n.parsedType}),gt}return Un(t.data)}};xl.create=e=>new xl({typeName:dt.ZodUndefined,...Tt(e)});var Sl=class extends Mt{_parse(t){if(this._getType(t)!==Be.null){let n=this._getOrReturnCtx(t);return $e(n,{code:Te.invalid_type,expected:Be.null,received:n.parsedType}),gt}return Un(t.data)}};Sl.create=e=>new Sl({typeName:dt.ZodNull,...Tt(e)});var Dd=class extends Mt{constructor(){super(...arguments),this._any=!0}_parse(t){return Un(t.data)}};Dd.create=e=>new Dd({typeName:dt.ZodAny,...Tt(e)});var Ja=class extends Mt{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Un(t.data)}};Ja.create=e=>new Ja({typeName:dt.ZodUnknown,...Tt(e)});var Ns=class extends Mt{_parse(t){let r=this._getOrReturnCtx(t);return $e(r,{code:Te.invalid_type,expected:Be.never,received:r.parsedType}),gt}};Ns.create=e=>new Ns({typeName:dt.ZodNever,...Tt(e)});var Md=class extends Mt{_parse(t){if(this._getType(t)!==Be.undefined){let n=this._getOrReturnCtx(t);return $e(n,{code:Te.invalid_type,expected:Be.void,received:n.parsedType}),gt}return Un(t.data)}};Md.create=e=>new Md({typeName:dt.ZodVoid,...Tt(e)});var Ya=class e extends Mt{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),s=this._def;if(r.parsedType!==Be.array)return $e(r,{code:Te.invalid_type,expected:Be.array,received:r.parsedType}),gt;if(s.exactLength!==null){let o=r.data.length>s.exactLength.value,c=r.data.length<s.exactLength.value;(o||c)&&($e(r,{code:o?Te.too_big:Te.too_small,minimum:c?s.exactLength.value:void 0,maximum:o?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),n.dirty())}if(s.minLength!==null&&r.data.length<s.minLength.value&&($e(r,{code:Te.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),n.dirty()),s.maxLength!==null&&r.data.length>s.maxLength.value&&($e(r,{code:Te.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((o,c)=>s.type._parseAsync(new Ri(r,o,r.path,c)))).then(o=>Cn.mergeArray(n,o));let a=[...r.data].map((o,c)=>s.type._parseSync(new Ri(r,o,r.path,c)));return Cn.mergeArray(n,a)}get element(){return this._def.type}min(t,r){return new e({...this._def,minLength:{value:t,message:Ke.toString(r)}})}max(t,r){return new e({...this._def,maxLength:{value:t,message:Ke.toString(r)}})}length(t,r){return new e({...this._def,exactLength:{value:t,message:Ke.toString(r)}})}nonempty(t){return this.min(1,t)}};Ya.create=(e,t)=>new Ya({type:e,minLength:null,maxLength:null,exactLength:null,typeName:dt.ZodArray,...Tt(t)});function bl(e){if(e instanceof Si){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=us.create(bl(n))}return new Si({...e._def,shape:()=>t})}else return e instanceof Ya?new Ya({...e._def,type:bl(e.element)}):e instanceof us?us.create(bl(e.unwrap())):e instanceof ca?ca.create(bl(e.unwrap())):e instanceof oa?oa.create(e.items.map(t=>bl(t))):e}var Si=class e extends Mt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),r=Gt.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==Be.object){let u=this._getOrReturnCtx(t);return $e(u,{code:Te.invalid_type,expected:Be.object,received:u.parsedType}),gt}let{status:n,ctx:s}=this._processInputParams(t),{shape:a,keys:o}=this._getCached(),c=[];if(!(this._def.catchall instanceof Ns&&this._def.unknownKeys==="strip"))for(let u in s.data)o.includes(u)||c.push(u);let l=[];for(let u of o){let d=a[u],p=s.data[u];l.push({key:{status:"valid",value:u},value:d._parse(new Ri(s,p,s.path,u)),alwaysSet:u in s.data})}if(this._def.catchall instanceof Ns){let u=this._def.unknownKeys;if(u==="passthrough")for(let d of c)l.push({key:{status:"valid",value:d},value:{status:"valid",value:s.data[d]}});else if(u==="strict")c.length>0&&($e(s,{code:Te.unrecognized_keys,keys:c}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let d of c){let p=s.data[d];l.push({key:{status:"valid",value:d},value:u._parse(new Ri(s,p,s.path,d)),alwaysSet:d in s.data})}}return s.common.async?Promise.resolve().then(async()=>{let u=[];for(let d of l){let p=await d.key,f=await d.value;u.push({key:p,value:f,alwaysSet:d.alwaysSet})}return u}).then(u=>Cn.mergeObjectSync(n,u)):Cn.mergeObjectSync(n,l)}get shape(){return this._def.shape()}strict(t){return Ke.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{let s=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:Ke.errToObj(t).message??s}:{message:s}}}:{}})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:dt.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let r={};for(let n of Gt.objectKeys(t))t[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}omit(t){let r={};for(let n of Gt.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}deepPartial(){return bl(this)}partial(t){let r={};for(let n of Gt.objectKeys(this.shape)){let s=this.shape[n];t&&!t[n]?r[n]=s:r[n]=s.optional()}return new e({...this._def,shape:()=>r})}required(t){let r={};for(let n of Gt.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let a=this.shape[n];for(;a instanceof us;)a=a._def.innerType;r[n]=a}return new e({...this._def,shape:()=>r})}keyof(){return RO(Gt.objectKeys(this.shape))}};Si.create=(e,t)=>new Si({shape:()=>e,unknownKeys:"strip",catchall:Ns.create(),typeName:dt.ZodObject,...Tt(t)});Si.strictCreate=(e,t)=>new Si({shape:()=>e,unknownKeys:"strict",catchall:Ns.create(),typeName:dt.ZodObject,...Tt(t)});Si.lazycreate=(e,t)=>new Si({shape:e,unknownKeys:"strip",catchall:Ns.create(),typeName:dt.ZodObject,...Tt(t)});var Tl=class extends Mt{_parse(t){let{ctx:r}=this._processInputParams(t),n=this._def.options;function s(a){for(let c of a)if(c.result.status==="valid")return c.result;for(let c of a)if(c.result.status==="dirty")return r.common.issues.push(...c.ctx.common.issues),c.result;let o=a.map(c=>new xi(c.ctx.common.issues));return $e(r,{code:Te.invalid_union,unionErrors:o}),gt}if(r.common.async)return Promise.all(n.map(async a=>{let o={...r,common:{...r.common,issues:[]},parent:null};return{result:await a._parseAsync({data:r.data,path:r.path,parent:o}),ctx:o}})).then(s);{let a,o=[];for(let l of n){let u={...r,common:{...r.common,issues:[]},parent:null},d=l._parseSync({data:r.data,path:r.path,parent:u});if(d.status==="valid")return d;d.status==="dirty"&&!a&&(a={result:d,ctx:u}),u.common.issues.length&&o.push(u.common.issues)}if(a)return r.common.issues.push(...a.ctx.common.issues),a.result;let c=o.map(l=>new xi(l));return $e(r,{code:Te.invalid_union,unionErrors:c}),gt}}get options(){return this._def.options}};Tl.create=(e,t)=>new Tl({options:e,typeName:dt.ZodUnion,...Tt(t)});var aa=e=>e instanceof El?aa(e.schema):e instanceof ds?aa(e.innerType()):e instanceof Pl?[e.value]:e instanceof Il?e.options:e instanceof Al?Gt.objectValues(e.enum):e instanceof kl?aa(e._def.innerType):e instanceof xl?[void 0]:e instanceof Sl?[null]:e instanceof us?[void 0,...aa(e.unwrap())]:e instanceof ca?[null,...aa(e.unwrap())]:e instanceof Am||e instanceof Nl?aa(e.unwrap()):e instanceof Cl?aa(e._def.innerType):[],_x=class e extends Mt{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==Be.object)return $e(r,{code:Te.invalid_type,expected:Be.object,received:r.parsedType}),gt;let n=this.discriminator,s=r.data[n],a=this.optionsMap.get(s);return a?r.common.async?a._parseAsync({data:r.data,path:r.path,parent:r}):a._parseSync({data:r.data,path:r.path,parent:r}):($e(r,{code:Te.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),gt)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){let s=new Map;for(let a of r){let o=aa(a.shape[t]);if(!o.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let c of o){if(s.has(c))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(c)}`);s.set(c,a)}}return new e({typeName:dt.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:s,...Tt(n)})}};function bx(e,t){let r=sa(e),n=sa(t);if(e===t)return{valid:!0,data:e};if(r===Be.object&&n===Be.object){let s=Gt.objectKeys(t),a=Gt.objectKeys(e).filter(c=>s.indexOf(c)!==-1),o={...e,...t};for(let c of a){let l=bx(e[c],t[c]);if(!l.valid)return{valid:!1};o[c]=l.data}return{valid:!0,data:o}}else if(r===Be.array&&n===Be.array){if(e.length!==t.length)return{valid:!1};let s=[];for(let a=0;a<e.length;a++){let o=e[a],c=t[a],l=bx(o,c);if(!l.valid)return{valid:!1};s.push(l.data)}return{valid:!0,data:s}}else return r===Be.date&&n===Be.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var wl=class extends Mt{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),s=(a,o)=>{if(mx(a)||mx(o))return gt;let c=bx(a.value,o.value);return c.valid?((gx(a)||gx(o))&&r.dirty(),{status:r.value,value:c.data}):($e(n,{code:Te.invalid_intersection_types}),gt)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([a,o])=>s(a,o)):s(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};wl.create=(e,t,r)=>new wl({left:e,right:t,typeName:dt.ZodIntersection,...Tt(r)});var oa=class e extends Mt{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==Be.array)return $e(n,{code:Te.invalid_type,expected:Be.array,received:n.parsedType}),gt;if(n.data.length<this._def.items.length)return $e(n,{code:Te.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),gt;!this._def.rest&&n.data.length>this._def.items.length&&($e(n,{code:Te.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let a=[...n.data].map((o,c)=>{let l=this._def.items[c]||this._def.rest;return l?l._parse(new Ri(n,o,n.path,c)):null}).filter(o=>!!o);return n.common.async?Promise.all(a).then(o=>Cn.mergeArray(r,o)):Cn.mergeArray(r,a)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};oa.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new oa({items:e,typeName:dt.ZodTuple,rest:null,...Tt(t)})};var vx=class e extends Mt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==Be.object)return $e(n,{code:Te.invalid_type,expected:Be.object,received:n.parsedType}),gt;let s=[],a=this._def.keyType,o=this._def.valueType;for(let c in n.data)s.push({key:a._parse(new Ri(n,c,n.path,c)),value:o._parse(new Ri(n,n.data[c],n.path,c)),alwaysSet:c in n.data});return n.common.async?Cn.mergeObjectAsync(r,s):Cn.mergeObjectSync(r,s)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof Mt?new e({keyType:t,valueType:r,typeName:dt.ZodRecord,...Tt(n)}):new e({keyType:vl.create(),valueType:t,typeName:dt.ZodRecord,...Tt(r)})}},Ld=class extends Mt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==Be.map)return $e(n,{code:Te.invalid_type,expected:Be.map,received:n.parsedType}),gt;let s=this._def.keyType,a=this._def.valueType,o=[...n.data.entries()].map(([c,l],u)=>({key:s._parse(new Ri(n,c,n.path,[u,"key"])),value:a._parse(new Ri(n,l,n.path,[u,"value"]))}));if(n.common.async){let c=new Map;return Promise.resolve().then(async()=>{for(let l of o){let u=await l.key,d=await l.value;if(u.status==="aborted"||d.status==="aborted")return gt;(u.status==="dirty"||d.status==="dirty")&&r.dirty(),c.set(u.value,d.value)}return{status:r.value,value:c}})}else{let c=new Map;for(let l of o){let u=l.key,d=l.value;if(u.status==="aborted"||d.status==="aborted")return gt;(u.status==="dirty"||d.status==="dirty")&&r.dirty(),c.set(u.value,d.value)}return{status:r.value,value:c}}}};Ld.create=(e,t,r)=>new Ld({valueType:t,keyType:e,typeName:dt.ZodMap,...Tt(r)});var Fd=class e extends Mt{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==Be.set)return $e(n,{code:Te.invalid_type,expected:Be.set,received:n.parsedType}),gt;let s=this._def;s.minSize!==null&&n.data.size<s.minSize.value&&($e(n,{code:Te.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),r.dirty()),s.maxSize!==null&&n.data.size>s.maxSize.value&&($e(n,{code:Te.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),r.dirty());let a=this._def.valueType;function o(l){let u=new Set;for(let d of l){if(d.status==="aborted")return gt;d.status==="dirty"&&r.dirty(),u.add(d.value)}return{status:r.value,value:u}}let c=[...n.data.values()].map((l,u)=>a._parse(new Ri(n,l,n.path,u)));return n.common.async?Promise.all(c).then(l=>o(l)):o(c)}min(t,r){return new e({...this._def,minSize:{value:t,message:Ke.toString(r)}})}max(t,r){return new e({...this._def,maxSize:{value:t,message:Ke.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};Fd.create=(e,t)=>new Fd({valueType:e,minSize:null,maxSize:null,typeName:dt.ZodSet,...Tt(t)});var xx=class e extends Mt{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==Be.function)return $e(r,{code:Te.invalid_type,expected:Be.function,received:r.parsedType}),gt;function n(c,l){return Im({data:c,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Ad(),Ha].filter(u=>!!u),issueData:{code:Te.invalid_arguments,argumentsError:l}})}function s(c,l){return Im({data:c,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Ad(),Ha].filter(u=>!!u),issueData:{code:Te.invalid_return_type,returnTypeError:l}})}let a={errorMap:r.common.contextualErrorMap},o=r.data;if(this._def.returns instanceof ec){let c=this;return Un(async function(...l){let u=new xi([]),d=await c._def.args.parseAsync(l,a).catch(h=>{throw u.addIssue(n(l,h)),u}),p=await Reflect.apply(o,this,d);return await c._def.returns._def.type.parseAsync(p,a).catch(h=>{throw u.addIssue(s(p,h)),u})})}else{let c=this;return Un(function(...l){let u=c._def.args.safeParse(l,a);if(!u.success)throw new xi([n(l,u.error)]);let d=Reflect.apply(o,this,u.data),p=c._def.returns.safeParse(d,a);if(!p.success)throw new xi([s(d,p.error)]);return p.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:oa.create(t).rest(Ja.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new e({args:t||oa.create([]).rest(Ja.create()),returns:r||Ja.create(),typeName:dt.ZodFunction,...Tt(n)})}},El=class extends Mt{get schema(){return this._def.getter()}_parse(t){let{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};El.create=(e,t)=>new El({getter:e,typeName:dt.ZodLazy,...Tt(t)});var Pl=class extends Mt{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return $e(r,{received:r.data,code:Te.invalid_literal,expected:this._def.value}),gt}return{status:"valid",value:t.data}}get value(){return this._def.value}};Pl.create=(e,t)=>new Pl({value:e,typeName:dt.ZodLiteral,...Tt(t)});function RO(e,t){return new Il({values:e,typeName:dt.ZodEnum,...Tt(t)})}var Il=class e extends Mt{_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return $e(r,{expected:Gt.joinValues(n),received:r.parsedType,code:Te.invalid_type}),gt}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let r=this._getOrReturnCtx(t),n=this._def.values;return $e(r,{received:r.data,code:Te.invalid_enum_value,options:n}),gt}return Un(t.data)}get options(){return this._def.values}get enum(){let t={};for(let r of this._def.values)t[r]=r;return t}get Values(){let t={};for(let r of this._def.values)t[r]=r;return t}get Enum(){let t={};for(let r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return e.create(t,{...this._def,...r})}exclude(t,r=this._def){return e.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}};Il.create=RO;var Al=class extends Mt{_parse(t){let r=Gt.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==Be.string&&n.parsedType!==Be.number){let s=Gt.objectValues(r);return $e(n,{expected:Gt.joinValues(s),received:n.parsedType,code:Te.invalid_type}),gt}if(this._cache||(this._cache=new Set(Gt.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let s=Gt.objectValues(r);return $e(n,{received:n.data,code:Te.invalid_enum_value,options:s}),gt}return Un(t.data)}get enum(){return this._def.values}};Al.create=(e,t)=>new Al({values:e,typeName:dt.ZodNativeEnum,...Tt(t)});var ec=class extends Mt{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==Be.promise&&r.common.async===!1)return $e(r,{code:Te.invalid_type,expected:Be.promise,received:r.parsedType}),gt;let n=r.parsedType===Be.promise?r.data:Promise.resolve(r.data);return Un(n.then(s=>this._def.type.parseAsync(s,{path:r.path,errorMap:r.common.contextualErrorMap})))}};ec.create=(e,t)=>new ec({type:e,typeName:dt.ZodPromise,...Tt(t)});var ds=class extends Mt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===dt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:r,ctx:n}=this._processInputParams(t),s=this._def.effect||null,a={addIssue:o=>{$e(n,o),o.fatal?r.abort():r.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),s.type==="preprocess"){let o=s.transform(n.data,a);if(n.common.async)return Promise.resolve(o).then(async c=>{if(r.value==="aborted")return gt;let l=await this._def.schema._parseAsync({data:c,path:n.path,parent:n});return l.status==="aborted"?gt:l.status==="dirty"?_l(l.value):r.value==="dirty"?_l(l.value):l});{if(r.value==="aborted")return gt;let c=this._def.schema._parseSync({data:o,path:n.path,parent:n});return c.status==="aborted"?gt:c.status==="dirty"?_l(c.value):r.value==="dirty"?_l(c.value):c}}if(s.type==="refinement"){let o=c=>{let l=s.refinement(c,a);if(n.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c};if(n.common.async===!1){let c=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return c.status==="aborted"?gt:(c.status==="dirty"&&r.dirty(),o(c.value),{status:r.value,value:c.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(c=>c.status==="aborted"?gt:(c.status==="dirty"&&r.dirty(),o(c.value).then(()=>({status:r.value,value:c.value}))))}if(s.type==="transform")if(n.common.async===!1){let o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Qo(o))return gt;let c=s.transform(o.value,a);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:c}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>Qo(o)?Promise.resolve(s.transform(o.value,a)).then(c=>({status:r.value,value:c})):gt);Gt.assertNever(s)}};ds.create=(e,t,r)=>new ds({schema:e,typeName:dt.ZodEffects,effect:t,...Tt(r)});ds.createWithPreprocess=(e,t,r)=>new ds({schema:t,effect:{type:"preprocess",transform:e},typeName:dt.ZodEffects,...Tt(r)});var us=class extends Mt{_parse(t){return this._getType(t)===Be.undefined?Un(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};us.create=(e,t)=>new us({innerType:e,typeName:dt.ZodOptional,...Tt(t)});var ca=class extends Mt{_parse(t){return this._getType(t)===Be.null?Un(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};ca.create=(e,t)=>new ca({innerType:e,typeName:dt.ZodNullable,...Tt(t)});var kl=class extends Mt{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return r.parsedType===Be.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};kl.create=(e,t)=>new kl({innerType:e,typeName:dt.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Tt(t)});var Cl=class extends Mt{_parse(t){let{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},s=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return kd(s)?s.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new xi(n.common.issues)},input:n.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new xi(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Cl.create=(e,t)=>new Cl({innerType:e,typeName:dt.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Tt(t)});var jd=class extends Mt{_parse(t){if(this._getType(t)!==Be.nan){let n=this._getOrReturnCtx(t);return $e(n,{code:Te.invalid_type,expected:Be.nan,received:n.parsedType}),gt}return{status:"valid",value:t.data}}};jd.create=e=>new jd({typeName:dt.ZodNaN,...Tt(e)});var P9e=Symbol("zod_brand"),Am=class extends Mt{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},km=class e extends Mt{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{let a=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?gt:a.status==="dirty"?(r.dirty(),_l(a.value)):this._def.out._parseAsync({data:a.value,path:n.path,parent:n})})();{let s=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?gt:s.status==="dirty"?(r.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:n.path,parent:n})}}static create(t,r){return new e({in:t,out:r,typeName:dt.ZodPipeline})}},Nl=class extends Mt{_parse(t){let r=this._def.innerType._parse(t),n=s=>(Qo(s)&&(s.value=Object.freeze(s.value)),s);return kd(r)?r.then(s=>n(s)):n(r)}unwrap(){return this._def.innerType}};Nl.create=(e,t)=>new Nl({innerType:e,typeName:dt.ZodReadonly,...Tt(t)});var I9e={object:Si.lazycreate},dt;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(dt||(dt={}));var A9e=vl.create,k9e=Cd.create,C9e=jd.create,N9e=Nd.create,O9e=Od.create,$9e=$d.create,R9e=Rd.create,D9e=xl.create,M9e=Sl.create,L9e=Dd.create,F9e=Ja.create,j9e=Ns.create,B9e=Md.create,z9e=Ya.create,q5=Si.create,U9e=Si.strictCreate,q9e=Tl.create,W9e=_x.create,V9e=wl.create,K9e=oa.create,G9e=vx.create,Z9e=Ld.create,H9e=Fd.create,J9e=xx.create,Y9e=El.create,X9e=Pl.create,Q9e=Il.create,eWe=Al.create,tWe=ec.create,rWe=ds.create,nWe=us.create,iWe=ca.create,sWe=ds.createWithPreprocess,aWe=km.create;var DO=Object.freeze({status:"aborted"});function re(e,t,r){function n(c,l){if(c._zod||Object.defineProperty(c,"_zod",{value:{def:l,constr:o,traits:new Set},enumerable:!1}),c._zod.traits.has(e))return;c._zod.traits.add(e),t(c,l);let u=o.prototype,d=Object.keys(u);for(let p=0;p<d.length;p++){let f=d[p];f in c||(c[f]=u[f].bind(c))}}let s=r?.Parent??Object;class a extends s{}Object.defineProperty(a,"name",{value:e});function o(c){var l;let u=r?.Parent?new a:this;n(u,c),(l=u._zod).deferred??(l.deferred=[]);for(let d of u._zod.deferred)d();return u}return Object.defineProperty(o,"init",{value:n}),Object.defineProperty(o,Symbol.hasInstance,{value:c=>r?.Parent&&c instanceof r.Parent?!0:c?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}var Sx=Symbol("zod_brand"),Os=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},tc=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},Cm={};function ln(e){return e&&Object.assign(Cm,e),Cm}var Ee={};zn(Ee,{BIGINT_FORMAT_RANGES:()=>Ox,Class:()=>wx,NUMBER_FORMAT_RANGES:()=>Nx,aborted:()=>to,allowsEval:()=>Ix,assert:()=>J5,assertEqual:()=>K5,assertIs:()=>Z5,assertNever:()=>H5,assertNotEqual:()=>G5,assignProp:()=>Qa,base64ToUint8Array:()=>qO,base64urlToUint8Array:()=>oK,cached:()=>$l,captureStackTrace:()=>Om,cleanEnum:()=>aK,cleanRegex:()=>Ud,clone:()=>qn,cloneDef:()=>X5,createTransparentProxy:()=>iK,defineLazy:()=>Pt,esc:()=>Nm,escapeRegex:()=>Di,extend:()=>jO,finalizeIssue:()=>si,floatSafeRemainder:()=>Ex,getElementAtPath:()=>Q5,getEnumValues:()=>zd,getLengthableOrigin:()=>Vd,getParsedType:()=>nK,getSizableOrigin:()=>Wd,hexToUint8Array:()=>lK,isObject:()=>rc,isPlainObject:()=>eo,issue:()=>Rl,joinValues:()=>pt,jsonStringifyReplacer:()=>Ol,merge:()=>sK,mergeDefs:()=>la,normalizeParams:()=>Re,nullish:()=>Xa,numKeys:()=>rK,objectClone:()=>Y5,omit:()=>FO,optionalKeys:()=>Cx,parsedType:()=>yt,partial:()=>zO,pick:()=>LO,prefixIssues:()=>Ti,primitiveTypes:()=>kx,promiseAllObject:()=>eK,propertyKeyTypes:()=>qd,randomString:()=>tK,required:()=>UO,safeExtend:()=>BO,shallowClone:()=>Ax,slugify:()=>Px,stringifyPrimitive:()=>ft,uint8ArrayToBase64:()=>WO,uint8ArrayToBase64url:()=>cK,uint8ArrayToHex:()=>uK,unwrapMessage:()=>Bd});function K5(e){return e}function G5(e){return e}function Z5(e){}function H5(e){throw new Error("Unexpected value in exhaustive check")}function J5(e){}function zd(e){let t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,s])=>t.indexOf(+n)===-1).map(([n,s])=>s)}function pt(e,t="|"){return e.map(r=>ft(r)).join(t)}function Ol(e,t){return typeof t=="bigint"?t.toString():t}function $l(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function Xa(e){return e==null}function Ud(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function Ex(e,t){let r=(e.toString().split(".")[1]||"").length,n=t.toString(),s=(n.split(".")[1]||"").length;if(s===0&&/\d?e-\d?/.test(n)){let l=n.match(/\d?e-(\d?)/);l?.[1]&&(s=Number.parseInt(l[1]))}let a=r>s?r:s,o=Number.parseInt(e.toFixed(a).replace(".","")),c=Number.parseInt(t.toFixed(a).replace(".",""));return o%c/10**a}var MO=Symbol("evaluating");function Pt(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==MO)return n===void 0&&(n=MO,n=r()),n},set(s){Object.defineProperty(e,t,{value:s})},configurable:!0})}function Y5(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Qa(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function la(...e){let t={};for(let r of e){let n=Object.getOwnPropertyDescriptors(r);Object.assign(t,n)}return Object.defineProperties({},t)}function X5(e){return la(e._zod.def)}function Q5(e,t){return t?t.reduce((r,n)=>r?.[n],e):e}function eK(e){let t=Object.keys(e),r=t.map(n=>e[n]);return Promise.all(r).then(n=>{let s={};for(let a=0;a<t.length;a++)s[t[a]]=n[a];return s})}function tK(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let n=0;n<e;n++)r+=t[Math.floor(Math.random()*t.length)];return r}function Nm(e){return JSON.stringify(e)}function Px(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Om="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function rc(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Ix=$l(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function eo(e){if(rc(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(rc(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Ax(e){return eo(e)?{...e}:Array.isArray(e)?[...e]:e}function rK(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}var nK=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},qd=new Set(["string","number","symbol"]),kx=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Di(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function qn(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}function Re(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function iK(e){let t;return new Proxy({},{get(r,n,s){return t??(t=e()),Reflect.get(t,n,s)},set(r,n,s,a){return t??(t=e()),Reflect.set(t,n,s,a)},has(r,n){return t??(t=e()),Reflect.has(t,n)},deleteProperty(r,n){return t??(t=e()),Reflect.deleteProperty(t,n)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,n){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,n)},defineProperty(r,n,s){return t??(t=e()),Reflect.defineProperty(t,n,s)}})}function ft(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function Cx(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var Nx={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]},Ox={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function LO(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let a=la(e._zod.def,{get shape(){let o={};for(let c in t){if(!(c in r.shape))throw new Error(`Unrecognized key: "${c}"`);t[c]&&(o[c]=r.shape[c])}return Qa(this,"shape",o),o},checks:[]});return qn(e,a)}function FO(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let a=la(e._zod.def,{get shape(){let o={...e._zod.def.shape};for(let c in t){if(!(c in r.shape))throw new Error(`Unrecognized key: "${c}"`);t[c]&&delete o[c]}return Qa(this,"shape",o),o},checks:[]});return qn(e,a)}function jO(e,t){if(!eo(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let a=e._zod.def.shape;for(let o in t)if(Object.getOwnPropertyDescriptor(a,o)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let s=la(e._zod.def,{get shape(){let a={...e._zod.def.shape,...t};return Qa(this,"shape",a),a}});return qn(e,s)}function BO(e,t){if(!eo(t))throw new Error("Invalid input to safeExtend: expected a plain object");let r=la(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Qa(this,"shape",n),n}});return qn(e,r)}function sK(e,t){let r=la(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return Qa(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return qn(e,r)}function zO(e,t,r){let s=t._zod.def.checks;if(s&&s.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let o=la(t._zod.def,{get shape(){let c=t._zod.def.shape,l={...c};if(r)for(let u in r){if(!(u in c))throw new Error(`Unrecognized key: "${u}"`);r[u]&&(l[u]=e?new e({type:"optional",innerType:c[u]}):c[u])}else for(let u in c)l[u]=e?new e({type:"optional",innerType:c[u]}):c[u];return Qa(this,"shape",l),l},checks:[]});return qn(t,o)}function UO(e,t,r){let n=la(t._zod.def,{get shape(){let s=t._zod.def.shape,a={...s};if(r)for(let o in r){if(!(o in a))throw new Error(`Unrecognized key: "${o}"`);r[o]&&(a[o]=new e({type:"nonoptional",innerType:s[o]}))}else for(let o in s)a[o]=new e({type:"nonoptional",innerType:s[o]});return Qa(this,"shape",a),a}});return qn(t,n)}function to(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function Ti(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function Bd(e){return typeof e=="string"?e:e?.message}function si(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let s=Bd(e.inst?._zod.def?.error?.(e))??Bd(t?.error?.(e))??Bd(r.customError?.(e))??Bd(r.localeError?.(e))??"Invalid input";n.message=s}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}function Wd(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function Vd(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function yt(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function Rl(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}function aK(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function qO(e){let t=atob(e),r=new Uint8Array(t.length);for(let n=0;n<t.length;n++)r[n]=t.charCodeAt(n);return r}function WO(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function oK(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return qO(t+r)}function cK(e){return WO(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function lK(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let n=0;n<t.length;n+=2)r[n/2]=Number.parseInt(t.slice(n,n+2),16);return r}function uK(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var wx=class{constructor(...t){}};var VO=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Ol,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},$m=re("$ZodError",VO),Kd=re("$ZodError",VO,{Parent:Error});function Rm(e,t=r=>r.message){let r={},n=[];for(let s of e.issues)s.path.length>0?(r[s.path[0]]=r[s.path[0]]||[],r[s.path[0]].push(t(s))):n.push(t(s));return{formErrors:n,fieldErrors:r}}function Dm(e,t=r=>r.message){let r={_errors:[]},n=s=>{for(let a of s.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(o=>n({issues:o}));else if(a.code==="invalid_key")n({issues:a.issues});else if(a.code==="invalid_element")n({issues:a.issues});else if(a.path.length===0)r._errors.push(t(a));else{let o=r,c=0;for(;c<a.path.length;){let l=a.path[c];c===a.path.length-1?(o[l]=o[l]||{_errors:[]},o[l]._errors.push(t(a))):o[l]=o[l]||{_errors:[]},o=o[l],c++}}};return n(e),r}var Gd=e=>(t,r,n,s)=>{let a=n?Object.assign(n,{async:!1}):{async:!1},o=t._zod.run({value:r,issues:[]},a);if(o instanceof Promise)throw new Os;if(o.issues.length){let c=new(s?.Err??e)(o.issues.map(l=>si(l,a,ln())));throw Om(c,s?.callee),c}return o.value},Zd=Gd(Kd),Hd=e=>async(t,r,n,s)=>{let a=n?Object.assign(n,{async:!0}):{async:!0},o=t._zod.run({value:r,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let c=new(s?.Err??e)(o.issues.map(l=>si(l,a,ln())));throw Om(c,s?.callee),c}return o.value},Jd=Hd(Kd),Yd=e=>(t,r,n)=>{let s=n?{...n,async:!1}:{async:!1},a=t._zod.run({value:r,issues:[]},s);if(a instanceof Promise)throw new Os;return a.issues.length?{success:!1,error:new(e??$m)(a.issues.map(o=>si(o,s,ln())))}:{success:!0,data:a.value}},Dl=Yd(Kd),Xd=e=>async(t,r,n)=>{let s=n?Object.assign(n,{async:!0}):{async:!0},a=t._zod.run({value:r,issues:[]},s);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(o=>si(o,s,ln())))}:{success:!0,data:a.value}},Qd=Xd(Kd),KO=e=>(t,r,n)=>{let s=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Gd(e)(t,r,s)};var GO=e=>(t,r,n)=>Gd(e)(t,r,n);var ZO=e=>async(t,r,n)=>{let s=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Hd(e)(t,r,s)};var HO=e=>async(t,r,n)=>Hd(e)(t,r,n);var JO=e=>(t,r,n)=>{let s=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Yd(e)(t,r,s)};var YO=e=>(t,r,n)=>Yd(e)(t,r,n);var XO=e=>async(t,r,n)=>{let s=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Xd(e)(t,r,s)};var QO=e=>async(t,r,n)=>Xd(e)(t,r,n);var Mi={};zn(Mi,{base64:()=>Zx,base64url:()=>Mm,bigint:()=>eS,boolean:()=>rS,browserEmail:()=>bK,cidrv4:()=>Kx,cidrv6:()=>Gx,cuid:()=>$x,cuid2:()=>Rx,date:()=>Jx,datetime:()=>Xx,domain:()=>SK,duration:()=>jx,e164:()=>Hx,email:()=>zx,emoji:()=>Ux,extendedDuration:()=>pK,guid:()=>Bx,hex:()=>TK,hostname:()=>xK,html5Email:()=>gK,idnEmail:()=>_K,integer:()=>tS,ipv4:()=>qx,ipv6:()=>Wx,ksuid:()=>Lx,lowercase:()=>sS,mac:()=>Vx,md5_base64:()=>EK,md5_base64url:()=>PK,md5_hex:()=>wK,nanoid:()=>Fx,null:()=>nS,number:()=>Lm,rfc5322Email:()=>yK,sha1_base64:()=>AK,sha1_base64url:()=>kK,sha1_hex:()=>IK,sha256_base64:()=>NK,sha256_base64url:()=>OK,sha256_hex:()=>CK,sha384_base64:()=>RK,sha384_base64url:()=>DK,sha384_hex:()=>$K,sha512_base64:()=>LK,sha512_base64url:()=>FK,sha512_hex:()=>MK,string:()=>Qx,time:()=>Yx,ulid:()=>Dx,undefined:()=>iS,unicodeEmail:()=>e$,uppercase:()=>aS,uuid:()=>nc,uuid4:()=>fK,uuid6:()=>hK,uuid7:()=>mK,xid:()=>Mx});var $x=/^[cC][^\s-]{8,}$/,Rx=/^[0-9a-z]+$/,Dx=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Mx=/^[0-9a-vA-V]{20}$/,Lx=/^[A-Za-z0-9]{27}$/,Fx=/^[a-zA-Z0-9_-]{21}$/,jx=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,pK=/^[-+]?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)?)??$/,Bx=/^([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})$/,nc=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,fK=nc(4),hK=nc(6),mK=nc(7),zx=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,gK=/^[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])?)*$/,yK=/^(([^<>()\[\]\\.,;:\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,}))$/,e$=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,_K=e$,bK=/^[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])?)*$/,vK="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Ux(){return new RegExp(vK,"u")}var qx=/^(?:(?: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])$/,Wx=/^(([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}|:))$/,Vx=e=>{let t=Di(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},Kx=/^((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])$/,Gx=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Zx=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Mm=/^[A-Za-z0-9_-]*$/,xK=/^(?=.{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])?)*\.?$/,SK=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Hx=/^\+[1-9]\d{6,14}$/,t$="(?:(?:\\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])))",Jx=new RegExp(`^${t$}$`);function r$(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Yx(e){return new RegExp(`^${r$(e)}$`)}function Xx(e){let t=r$({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let n=`${t}(?:${r.join("|")})`;return new RegExp(`^${t$}T(?:${n})$`)}var Qx=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},eS=/^-?\d+n?$/,tS=/^-?\d+$/,Lm=/^-?\d+(?:\.\d+)?$/,rS=/^(?:true|false)$/i,nS=/^null$/i;var iS=/^undefined$/i;var sS=/^[^A-Z]*$/,aS=/^[^a-z]*$/,TK=/^[0-9a-fA-F]*$/;function ep(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function tp(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var wK=/^[0-9a-fA-F]{32}$/,EK=ep(22,"=="),PK=tp(22),IK=/^[0-9a-fA-F]{40}$/,AK=ep(27,"="),kK=tp(27),CK=/^[0-9a-fA-F]{64}$/,NK=ep(43,"="),OK=tp(43),$K=/^[0-9a-fA-F]{96}$/,RK=ep(64,""),DK=tp(64),MK=/^[0-9a-fA-F]{128}$/,LK=ep(86,"=="),FK=tp(86);var yr=re("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),i$={number:"number",bigint:"bigint",object:"date"},oS=re("$ZodCheckLessThan",(e,t)=>{yr.init(e,t);let r=i$[typeof t.value];e._zod.onattach.push(n=>{let s=n._zod.bag,a=(t.inclusive?s.maximum:s.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<a&&(t.inclusive?s.maximum=t.value:s.exclusiveMaximum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),cS=re("$ZodCheckGreaterThan",(e,t)=>{yr.init(e,t);let r=i$[typeof t.value];e._zod.onattach.push(n=>{let s=n._zod.bag,a=(t.inclusive?s.minimum:s.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>a&&(t.inclusive?s.minimum=t.value:s.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),s$=re("$ZodCheckMultipleOf",(e,t)=>{yr.init(e,t),e._zod.onattach.push(r=>{var n;(n=r._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):Ex(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),a$=re("$ZodCheckNumberFormat",(e,t)=>{yr.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[s,a]=Nx[t.format];e._zod.onattach.push(o=>{let c=o._zod.bag;c.format=t.format,c.minimum=s,c.maximum=a,r&&(c.pattern=tS)}),e._zod.check=o=>{let c=o.value;if(r){if(!Number.isInteger(c)){o.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){c>0?o.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):o.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}c<s&&o.issues.push({origin:"number",input:c,code:"too_small",minimum:s,inclusive:!0,inst:e,continue:!t.abort}),c>a&&o.issues.push({origin:"number",input:c,code:"too_big",maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),o$=re("$ZodCheckBigIntFormat",(e,t)=>{yr.init(e,t);let[r,n]=Ox[t.format];e._zod.onattach.push(s=>{let a=s._zod.bag;a.format=t.format,a.minimum=r,a.maximum=n}),e._zod.check=s=>{let a=s.value;a<r&&s.issues.push({origin:"bigint",input:a,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),a>n&&s.issues.push({origin:"bigint",input:a,code:"too_big",maximum:n,inclusive:!0,inst:e,continue:!t.abort})}}),c$=re("$ZodCheckMaxSize",(e,t)=>{var r;yr.init(e,t),(r=e._zod.def).when??(r.when=n=>{let s=n.value;return!Xa(s)&&s.size!==void 0}),e._zod.onattach.push(n=>{let s=n._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<s&&(n._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let s=n.value;s.size<=t.maximum||n.issues.push({origin:Wd(s),code:"too_big",maximum:t.maximum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),l$=re("$ZodCheckMinSize",(e,t)=>{var r;yr.init(e,t),(r=e._zod.def).when??(r.when=n=>{let s=n.value;return!Xa(s)&&s.size!==void 0}),e._zod.onattach.push(n=>{let s=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>s&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let s=n.value;s.size>=t.minimum||n.issues.push({origin:Wd(s),code:"too_small",minimum:t.minimum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),u$=re("$ZodCheckSizeEquals",(e,t)=>{var r;yr.init(e,t),(r=e._zod.def).when??(r.when=n=>{let s=n.value;return!Xa(s)&&s.size!==void 0}),e._zod.onattach.push(n=>{let s=n._zod.bag;s.minimum=t.size,s.maximum=t.size,s.size=t.size}),e._zod.check=n=>{let s=n.value,a=s.size;if(a===t.size)return;let o=a>t.size;n.issues.push({origin:Wd(s),...o?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),d$=re("$ZodCheckMaxLength",(e,t)=>{var r;yr.init(e,t),(r=e._zod.def).when??(r.when=n=>{let s=n.value;return!Xa(s)&&s.length!==void 0}),e._zod.onattach.push(n=>{let s=n._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<s&&(n._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let s=n.value;if(s.length<=t.maximum)return;let o=Vd(s);n.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),p$=re("$ZodCheckMinLength",(e,t)=>{var r;yr.init(e,t),(r=e._zod.def).when??(r.when=n=>{let s=n.value;return!Xa(s)&&s.length!==void 0}),e._zod.onattach.push(n=>{let s=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>s&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let s=n.value;if(s.length>=t.minimum)return;let o=Vd(s);n.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),f$=re("$ZodCheckLengthEquals",(e,t)=>{var r;yr.init(e,t),(r=e._zod.def).when??(r.when=n=>{let s=n.value;return!Xa(s)&&s.length!==void 0}),e._zod.onattach.push(n=>{let s=n._zod.bag;s.minimum=t.length,s.maximum=t.length,s.length=t.length}),e._zod.check=n=>{let s=n.value,a=s.length;if(a===t.length)return;let o=Vd(s),c=a>t.length;n.issues.push({origin:o,...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),rp=re("$ZodCheckStringFormat",(e,t)=>{var r,n;yr.init(e,t),e._zod.onattach.push(s=>{let a=s._zod.bag;a.format=t.format,t.pattern&&(a.patterns??(a.patterns=new Set),a.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=s=>{t.pattern.lastIndex=0,!t.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:t.format,input:s.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),h$=re("$ZodCheckRegex",(e,t)=>{rp.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),m$=re("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=sS),rp.init(e,t)}),g$=re("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=aS),rp.init(e,t)}),y$=re("$ZodCheckIncludes",(e,t)=>{yr.init(e,t);let r=Di(t.includes),n=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=n,e._zod.onattach.push(s=>{let a=s._zod.bag;a.patterns??(a.patterns=new Set),a.patterns.add(n)}),e._zod.check=s=>{s.value.includes(t.includes,t.position)||s.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:s.value,inst:e,continue:!t.abort})}}),_$=re("$ZodCheckStartsWith",(e,t)=>{yr.init(e,t);let r=new RegExp(`^${Di(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{let s=n._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(r)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),b$=re("$ZodCheckEndsWith",(e,t)=>{yr.init(e,t);let r=new RegExp(`.*${Di(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{let s=n._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(r)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}});function n$(e,t,r){e.issues.length&&t.issues.push(...Ti(r,e.issues))}var v$=re("$ZodCheckProperty",(e,t)=>{yr.init(e,t),e._zod.check=r=>{let n=t.schema._zod.run({value:r.value[t.property],issues:[]},{});if(n instanceof Promise)return n.then(s=>n$(s,r,t.property));n$(n,r,t.property)}}),x$=re("$ZodCheckMimeType",(e,t)=>{yr.init(e,t);let r=new Set(t.mime);e._zod.onattach.push(n=>{n._zod.bag.mime=t.mime}),e._zod.check=n=>{r.has(n.value.type)||n.issues.push({code:"invalid_value",values:t.mime,input:n.value.type,inst:e,continue:!t.abort})}}),S$=re("$ZodCheckOverwrite",(e,t)=>{yr.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});var Fm=class{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let n=t.split(`
|
|
217
|
+
[END]`,k=await g(d,[{role:"system",content:v},{role:"user",content:E}],w?.signal??n.signal);return JN(String(k?.text??"{}"))};try{e.wsBridge.broadcast({type:"aiReviewProgress",message:"Scanning project-level files\u2026",completed:0,total:1});let v=await y({store:e.snapshotStore,model:u,llmCall:_,evidenceGate:f,signal:n.signal,baselineRef:m,onFinding:w=>e.wsBridge.broadcast({type:"aiFindingAdded",entryPointId:w.entryPointId,findings:[w]})});if(n.signal.aborted){e.wsBridge.broadcast({type:"aiReviewCancelled",reason:"user"}),Br(e.wsBridge,"warning","Specific review cancelled.");return}let S=e.snapshotStore.getAiReviewFindingCounts();e.wsBridge.broadcast({type:"aiReviewComplete",summary:{totalEntryPoints:v.files.length,reviewed:v.files.length,failed:0,findingsCount:0,projectFindings:v.findingsCount,durationMs:v.durationMs,kind:"specific"},counts:S}),Br(e.wsBridge,"info",`Specific review done \u2014 ${v.findingsCount} findings across ${v.files.length} files.`)}catch(v){n.signal.aborted?(e.wsBridge.broadcast({type:"aiReviewCancelled",reason:"user"}),Br(e.wsBridge,"warning","Specific review cancelled.")):Br(e.wsBridge,"error",`Specific review failed: ${(v?.message??v).slice(0,200)}`)}finally{yi=null,e.wsBridge.broadcast({type:"aiReviewLoading",loading:!1})}}function Br(e,t,r){e.broadcast({type:"clientToast",level:t,text:r})}function JN(e){let t=e.replace(/```(?:json|JSON)?\s*/g,"").replace(/```/g,""),r=t.indexOf("{");if(r<0)return{findings:[]};let n=0,s=!1,a=!1,o=-1;for(let l=r;l<t.length;l++){let u=t[l];if(a){a=!1;continue}if(u==="\\"){a=!0;continue}if(u==='"'){s=!s;continue}if(!s){if(u==="{")n+=1;else if(u==="}"&&(n-=1,n===0)){o=l;break}}}if(o<0)return{findings:[]};let c=t.slice(r,o+1);try{let l=JSON.parse(c);return l&&Array.isArray(l.findings)?l:{findings:[]}}catch{return{findings:[]}}}var yi,um=Kt(()=>{"use strict";DN();V8();yi=null});var Gt;(function(e){e.assertEqual=s=>{};function t(s){}e.assertIs=t;function r(s){throw new Error}e.assertNever=r,e.arrayToEnum=s=>{let a={};for(let o of s)a[o]=o;return a},e.getValidEnumValues=s=>{let a=e.objectKeys(s).filter(c=>typeof s[s[c]]!="number"),o={};for(let c of a)o[c]=s[c];return e.objectValues(o)},e.objectValues=s=>e.objectKeys(s).map(function(a){return s[a]}),e.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{let a=[];for(let o in s)Object.prototype.hasOwnProperty.call(s,o)&&a.push(o);return a},e.find=(s,a)=>{for(let o of s)if(a(o))return o},e.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function n(s,a=" | "){return s.map(o=>typeof o=="string"?`'${o}'`:o).join(a)}e.joinValues=n,e.jsonStringifyReplacer=(s,a)=>typeof a=="bigint"?a.toString():a})(Gt||(Gt={}));var CO;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(CO||(CO={}));var Be=Gt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),sa=e=>{switch(typeof e){case"undefined":return Be.undefined;case"string":return Be.string;case"number":return Number.isNaN(e)?Be.nan:Be.number;case"boolean":return Be.boolean;case"function":return Be.function;case"bigint":return Be.bigint;case"symbol":return Be.symbol;case"object":return Array.isArray(e)?Be.array:e===null?Be.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Be.promise:typeof Map<"u"&&e instanceof Map?Be.map:typeof Set<"u"&&e instanceof Set?Be.set:typeof Date<"u"&&e instanceof Date?Be.date:Be.object;default:return Be.unknown}};var Te=Gt.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 xi=class e extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){let r=t||function(a){return a.message},n={_errors:[]},s=a=>{for(let o of a.issues)if(o.code==="invalid_union")o.unionErrors.map(s);else if(o.code==="invalid_return_type")s(o.returnTypeError);else if(o.code==="invalid_arguments")s(o.argumentsError);else if(o.path.length===0)n._errors.push(r(o));else{let c=n,l=0;for(;l<o.path.length;){let u=o.path[l];l===o.path.length-1?(c[u]=c[u]||{_errors:[]},c[u]._errors.push(r(o))):c[u]=c[u]||{_errors:[]},c=c[u],l++}}};return s(this),n}static assert(t){if(!(t instanceof e))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Gt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){let r=Object.create(null),n=[];for(let s of this.issues)if(s.path.length>0){let a=s.path[0];r[a]=r[a]||[],r[a].push(t(s))}else n.push(t(s));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};xi.create=e=>new xi(e);var b5=(e,t)=>{let r;switch(e.code){case Te.invalid_type:e.received===Be.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case Te.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,Gt.jsonStringifyReplacer)}`;break;case Te.unrecognized_keys:r=`Unrecognized key(s) in object: ${Gt.joinValues(e.keys,", ")}`;break;case Te.invalid_union:r="Invalid input";break;case Te.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Gt.joinValues(e.options)}`;break;case Te.invalid_enum_value:r=`Invalid enum value. Expected ${Gt.joinValues(e.options)}, received '${e.received}'`;break;case Te.invalid_arguments:r="Invalid function arguments";break;case Te.invalid_return_type:r="Invalid function return type";break;case Te.invalid_date:r="Invalid date";break;case Te.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:Gt.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case Te.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case Te.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case Te.custom:r="Invalid input";break;case Te.invalid_intersection_types:r="Intersection results could not be merged";break;case Te.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case Te.not_finite:r="Number must be finite";break;default:r=t.defaultError,Gt.assertNever(e)}return{message:r}},Ha=b5;var v5=Ha;function Ad(){return v5}var Im=e=>{let{data:t,path:r,errorMaps:n,issueData:s}=e,a=[...r,...s.path||[]],o={...s,path:a};if(s.message!==void 0)return{...s,path:a,message:s.message};let c="",l=n.filter(u=>!!u).slice().reverse();for(let u of l)c=u(o,{data:t,defaultError:c}).message;return{...s,path:a,message:c}};function $e(e,t){let r=Ad(),n=Im({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===Ha?void 0:Ha].filter(s=>!!s)});e.common.issues.push(n)}var Cn=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){let n=[];for(let s of r){if(s.status==="aborted")return gt;s.status==="dirty"&&t.dirty(),n.push(s.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){let n=[];for(let s of r){let a=await s.key,o=await s.value;n.push({key:a,value:o})}return e.mergeObjectSync(t,n)}static mergeObjectSync(t,r){let n={};for(let s of r){let{key:a,value:o}=s;if(a.status==="aborted"||o.status==="aborted")return gt;a.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),a.value!=="__proto__"&&(typeof o.value<"u"||s.alwaysSet)&&(n[a.value]=o.value)}return{status:t.value,value:n}}},gt=Object.freeze({status:"aborted"}),_l=e=>({status:"dirty",value:e}),Un=e=>({status:"valid",value:e}),mx=e=>e.status==="aborted",gx=e=>e.status==="dirty",Qo=e=>e.status==="valid",kd=e=>typeof Promise<"u"&&e instanceof Promise;var Ke;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(Ke||(Ke={}));var Ri=class{constructor(t,r,n,s){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=s}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}},NO=(e,t)=>{if(Qo(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new xi(e.common.issues);return this._error=r,this._error}}};function Tt(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:s}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:s}:{errorMap:(o,c)=>{let{message:l}=e;return o.code==="invalid_enum_value"?{message:l??c.defaultError}:typeof c.data>"u"?{message:l??n??c.defaultError}:o.code!=="invalid_type"?{message:c.defaultError}:{message:l??r??c.defaultError}},description:s}}var Mt=class{get description(){return this._def.description}_getType(t){return sa(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:sa(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Cn,ctx:{common:t.parent.common,data:t.data,parsedType:sa(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(kd(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){let r=this._parse(t);return Promise.resolve(r)}parse(t,r){let n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){let n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:sa(t)},s=this._parseSync({data:t,path:n.path,parent:n});return NO(n,s)}"~validate"(t){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:sa(t)};if(!this["~standard"].async)try{let n=this._parseSync({data:t,path:[],parent:r});return Qo(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:r}).then(n=>Qo(n)?{value:n.value}:{issues:r.common.issues})}async parseAsync(t,r){let n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:sa(t)},s=this._parse({data:t,path:n.path,parent:n}),a=await(kd(s)?s:Promise.resolve(s));return NO(n,a)}refine(t,r){let n=s=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(s):r;return this._refinement((s,a)=>{let o=t(s),c=()=>a.addIssue({code:Te.custom,...n(s)});return typeof Promise<"u"&&o instanceof Promise?o.then(l=>l?!0:(c(),!1)):o?!0:(c(),!1)})}refinement(t,r){return this._refinement((n,s)=>t(n)?!0:(s.addIssue(typeof r=="function"?r(n,s):r),!1))}_refinement(t){return new ds({schema:this,typeName:dt.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return us.create(this,this._def)}nullable(){return ca.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ya.create(this)}promise(){return ec.create(this,this._def)}or(t){return Tl.create([this,t],this._def)}and(t){return wl.create(this,t,this._def)}transform(t){return new ds({...Tt(this._def),schema:this,typeName:dt.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new kl({...Tt(this._def),innerType:this,defaultValue:r,typeName:dt.ZodDefault})}brand(){return new Am({typeName:dt.ZodBranded,type:this,...Tt(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new Cl({...Tt(this._def),innerType:this,catchValue:r,typeName:dt.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return km.create(this,t)}readonly(){return Nl.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},x5=/^c[^\s-]{8,}$/i,S5=/^[0-9a-z]+$/,T5=/^[0-9A-HJKMNP-TV-Z]{26}$/i,w5=/^[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,E5=/^[a-z0-9_-]{21}$/i,P5=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,I5=/^[-+]?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)?)??$/,A5=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,k5="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",yx,C5=/^(?:(?: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])$/,N5=/^(?:(?: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])$/,O5=/^(([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]))$/,$5=/^(([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])$/,R5=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,D5=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,OO="((\\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])))",M5=new RegExp(`^${OO}$`);function $O(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);let r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function L5(e){return new RegExp(`^${$O(e)}$`)}function F5(e){let t=`${OO}T${$O(e)}`,r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function j5(e,t){return!!((t==="v4"||!t)&&C5.test(e)||(t==="v6"||!t)&&O5.test(e))}function B5(e,t){if(!P5.test(e))return!1;try{let[r]=e.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),s=JSON.parse(atob(n));return!(typeof s!="object"||s===null||"typ"in s&&s?.typ!=="JWT"||!s.alg||t&&s.alg!==t)}catch{return!1}}function z5(e,t){return!!((t==="v4"||!t)&&N5.test(e)||(t==="v6"||!t)&&$5.test(e))}var vl=class e extends Mt{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Be.string){let a=this._getOrReturnCtx(t);return $e(a,{code:Te.invalid_type,expected:Be.string,received:a.parsedType}),gt}let n=new Cn,s;for(let a of this._def.checks)if(a.kind==="min")t.data.length<a.value&&(s=this._getOrReturnCtx(t,s),$e(s,{code:Te.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="max")t.data.length>a.value&&(s=this._getOrReturnCtx(t,s),$e(s,{code:Te.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="length"){let o=t.data.length>a.value,c=t.data.length<a.value;(o||c)&&(s=this._getOrReturnCtx(t,s),o?$e(s,{code:Te.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):c&&$e(s,{code:Te.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),n.dirty())}else if(a.kind==="email")A5.test(t.data)||(s=this._getOrReturnCtx(t,s),$e(s,{validation:"email",code:Te.invalid_string,message:a.message}),n.dirty());else if(a.kind==="emoji")yx||(yx=new RegExp(k5,"u")),yx.test(t.data)||(s=this._getOrReturnCtx(t,s),$e(s,{validation:"emoji",code:Te.invalid_string,message:a.message}),n.dirty());else if(a.kind==="uuid")w5.test(t.data)||(s=this._getOrReturnCtx(t,s),$e(s,{validation:"uuid",code:Te.invalid_string,message:a.message}),n.dirty());else if(a.kind==="nanoid")E5.test(t.data)||(s=this._getOrReturnCtx(t,s),$e(s,{validation:"nanoid",code:Te.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid")x5.test(t.data)||(s=this._getOrReturnCtx(t,s),$e(s,{validation:"cuid",code:Te.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid2")S5.test(t.data)||(s=this._getOrReturnCtx(t,s),$e(s,{validation:"cuid2",code:Te.invalid_string,message:a.message}),n.dirty());else if(a.kind==="ulid")T5.test(t.data)||(s=this._getOrReturnCtx(t,s),$e(s,{validation:"ulid",code:Te.invalid_string,message:a.message}),n.dirty());else if(a.kind==="url")try{new URL(t.data)}catch{s=this._getOrReturnCtx(t,s),$e(s,{validation:"url",code:Te.invalid_string,message:a.message}),n.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(t.data)||(s=this._getOrReturnCtx(t,s),$e(s,{validation:"regex",code:Te.invalid_string,message:a.message}),n.dirty())):a.kind==="trim"?t.data=t.data.trim():a.kind==="includes"?t.data.includes(a.value,a.position)||(s=this._getOrReturnCtx(t,s),$e(s,{code:Te.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),n.dirty()):a.kind==="toLowerCase"?t.data=t.data.toLowerCase():a.kind==="toUpperCase"?t.data=t.data.toUpperCase():a.kind==="startsWith"?t.data.startsWith(a.value)||(s=this._getOrReturnCtx(t,s),$e(s,{code:Te.invalid_string,validation:{startsWith:a.value},message:a.message}),n.dirty()):a.kind==="endsWith"?t.data.endsWith(a.value)||(s=this._getOrReturnCtx(t,s),$e(s,{code:Te.invalid_string,validation:{endsWith:a.value},message:a.message}),n.dirty()):a.kind==="datetime"?F5(a).test(t.data)||(s=this._getOrReturnCtx(t,s),$e(s,{code:Te.invalid_string,validation:"datetime",message:a.message}),n.dirty()):a.kind==="date"?M5.test(t.data)||(s=this._getOrReturnCtx(t,s),$e(s,{code:Te.invalid_string,validation:"date",message:a.message}),n.dirty()):a.kind==="time"?L5(a).test(t.data)||(s=this._getOrReturnCtx(t,s),$e(s,{code:Te.invalid_string,validation:"time",message:a.message}),n.dirty()):a.kind==="duration"?I5.test(t.data)||(s=this._getOrReturnCtx(t,s),$e(s,{validation:"duration",code:Te.invalid_string,message:a.message}),n.dirty()):a.kind==="ip"?j5(t.data,a.version)||(s=this._getOrReturnCtx(t,s),$e(s,{validation:"ip",code:Te.invalid_string,message:a.message}),n.dirty()):a.kind==="jwt"?B5(t.data,a.alg)||(s=this._getOrReturnCtx(t,s),$e(s,{validation:"jwt",code:Te.invalid_string,message:a.message}),n.dirty()):a.kind==="cidr"?z5(t.data,a.version)||(s=this._getOrReturnCtx(t,s),$e(s,{validation:"cidr",code:Te.invalid_string,message:a.message}),n.dirty()):a.kind==="base64"?R5.test(t.data)||(s=this._getOrReturnCtx(t,s),$e(s,{validation:"base64",code:Te.invalid_string,message:a.message}),n.dirty()):a.kind==="base64url"?D5.test(t.data)||(s=this._getOrReturnCtx(t,s),$e(s,{validation:"base64url",code:Te.invalid_string,message:a.message}),n.dirty()):Gt.assertNever(a);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(s=>t.test(s),{validation:r,code:Te.invalid_string,...Ke.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Ke.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Ke.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Ke.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Ke.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...Ke.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Ke.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Ke.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Ke.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...Ke.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...Ke.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...Ke.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Ke.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...Ke.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...Ke.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...Ke.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...Ke.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...Ke.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,...Ke.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...Ke.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...Ke.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...Ke.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...Ke.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...Ke.errToObj(r)})}nonempty(t){return this.min(1,Ke.errToObj(t))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};vl.create=e=>new vl({checks:[],typeName:dt.ZodString,coerce:e?.coerce??!1,...Tt(e)});function U5(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,s=r>n?r:n,a=Number.parseInt(e.toFixed(s).replace(".","")),o=Number.parseInt(t.toFixed(s).replace(".",""));return a%o/10**s}var Cd=class e extends Mt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==Be.number){let a=this._getOrReturnCtx(t);return $e(a,{code:Te.invalid_type,expected:Be.number,received:a.parsedType}),gt}let n,s=new Cn;for(let a of this._def.checks)a.kind==="int"?Gt.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),$e(n,{code:Te.invalid_type,expected:"integer",received:"float",message:a.message}),s.dirty()):a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(n=this._getOrReturnCtx(t,n),$e(n,{code:Te.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),s.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(n=this._getOrReturnCtx(t,n),$e(n,{code:Te.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),s.dirty()):a.kind==="multipleOf"?U5(t.data,a.value)!==0&&(n=this._getOrReturnCtx(t,n),$e(n,{code:Te.not_multiple_of,multipleOf:a.value,message:a.message}),s.dirty()):a.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),$e(n,{code:Te.not_finite,message:a.message}),s.dirty()):Gt.assertNever(a);return{status:s.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,Ke.toString(r))}gt(t,r){return this.setLimit("min",t,!1,Ke.toString(r))}lte(t,r){return this.setLimit("max",t,!0,Ke.toString(r))}lt(t,r){return this.setLimit("max",t,!1,Ke.toString(r))}setLimit(t,r,n,s){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:Ke.toString(s)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Ke.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ke.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ke.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ke.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ke.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:Ke.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:Ke.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ke.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ke.toString(t)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Gt.isInteger(t.value))}get isFinite(){let t=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}};Cd.create=e=>new Cd({checks:[],typeName:dt.ZodNumber,coerce:e?.coerce||!1,...Tt(e)});var Nd=class e extends Mt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==Be.bigint)return this._getInvalidInput(t);let n,s=new Cn;for(let a of this._def.checks)a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(n=this._getOrReturnCtx(t,n),$e(n,{code:Te.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),s.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(n=this._getOrReturnCtx(t,n),$e(n,{code:Te.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),s.dirty()):a.kind==="multipleOf"?t.data%a.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),$e(n,{code:Te.not_multiple_of,multipleOf:a.value,message:a.message}),s.dirty()):Gt.assertNever(a);return{status:s.value,value:t.data}}_getInvalidInput(t){let r=this._getOrReturnCtx(t);return $e(r,{code:Te.invalid_type,expected:Be.bigint,received:r.parsedType}),gt}gte(t,r){return this.setLimit("min",t,!0,Ke.toString(r))}gt(t,r){return this.setLimit("min",t,!1,Ke.toString(r))}lte(t,r){return this.setLimit("max",t,!0,Ke.toString(r))}lt(t,r){return this.setLimit("max",t,!1,Ke.toString(r))}setLimit(t,r,n,s){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:Ke.toString(s)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ke.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ke.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ke.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ke.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:Ke.toString(r)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};Nd.create=e=>new Nd({checks:[],typeName:dt.ZodBigInt,coerce:e?.coerce??!1,...Tt(e)});var Od=class extends Mt{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==Be.boolean){let n=this._getOrReturnCtx(t);return $e(n,{code:Te.invalid_type,expected:Be.boolean,received:n.parsedType}),gt}return Un(t.data)}};Od.create=e=>new Od({typeName:dt.ZodBoolean,coerce:e?.coerce||!1,...Tt(e)});var $d=class e extends Mt{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Be.date){let a=this._getOrReturnCtx(t);return $e(a,{code:Te.invalid_type,expected:Be.date,received:a.parsedType}),gt}if(Number.isNaN(t.data.getTime())){let a=this._getOrReturnCtx(t);return $e(a,{code:Te.invalid_date}),gt}let n=new Cn,s;for(let a of this._def.checks)a.kind==="min"?t.data.getTime()<a.value&&(s=this._getOrReturnCtx(t,s),$e(s,{code:Te.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),n.dirty()):a.kind==="max"?t.data.getTime()>a.value&&(s=this._getOrReturnCtx(t,s),$e(s,{code:Te.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),n.dirty()):Gt.assertNever(a);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:Ke.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:Ke.toString(r)})}get minDate(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}};$d.create=e=>new $d({checks:[],coerce:e?.coerce||!1,typeName:dt.ZodDate,...Tt(e)});var Rd=class extends Mt{_parse(t){if(this._getType(t)!==Be.symbol){let n=this._getOrReturnCtx(t);return $e(n,{code:Te.invalid_type,expected:Be.symbol,received:n.parsedType}),gt}return Un(t.data)}};Rd.create=e=>new Rd({typeName:dt.ZodSymbol,...Tt(e)});var xl=class extends Mt{_parse(t){if(this._getType(t)!==Be.undefined){let n=this._getOrReturnCtx(t);return $e(n,{code:Te.invalid_type,expected:Be.undefined,received:n.parsedType}),gt}return Un(t.data)}};xl.create=e=>new xl({typeName:dt.ZodUndefined,...Tt(e)});var Sl=class extends Mt{_parse(t){if(this._getType(t)!==Be.null){let n=this._getOrReturnCtx(t);return $e(n,{code:Te.invalid_type,expected:Be.null,received:n.parsedType}),gt}return Un(t.data)}};Sl.create=e=>new Sl({typeName:dt.ZodNull,...Tt(e)});var Dd=class extends Mt{constructor(){super(...arguments),this._any=!0}_parse(t){return Un(t.data)}};Dd.create=e=>new Dd({typeName:dt.ZodAny,...Tt(e)});var Ja=class extends Mt{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Un(t.data)}};Ja.create=e=>new Ja({typeName:dt.ZodUnknown,...Tt(e)});var Ns=class extends Mt{_parse(t){let r=this._getOrReturnCtx(t);return $e(r,{code:Te.invalid_type,expected:Be.never,received:r.parsedType}),gt}};Ns.create=e=>new Ns({typeName:dt.ZodNever,...Tt(e)});var Md=class extends Mt{_parse(t){if(this._getType(t)!==Be.undefined){let n=this._getOrReturnCtx(t);return $e(n,{code:Te.invalid_type,expected:Be.void,received:n.parsedType}),gt}return Un(t.data)}};Md.create=e=>new Md({typeName:dt.ZodVoid,...Tt(e)});var Ya=class e extends Mt{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),s=this._def;if(r.parsedType!==Be.array)return $e(r,{code:Te.invalid_type,expected:Be.array,received:r.parsedType}),gt;if(s.exactLength!==null){let o=r.data.length>s.exactLength.value,c=r.data.length<s.exactLength.value;(o||c)&&($e(r,{code:o?Te.too_big:Te.too_small,minimum:c?s.exactLength.value:void 0,maximum:o?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),n.dirty())}if(s.minLength!==null&&r.data.length<s.minLength.value&&($e(r,{code:Te.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),n.dirty()),s.maxLength!==null&&r.data.length>s.maxLength.value&&($e(r,{code:Te.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((o,c)=>s.type._parseAsync(new Ri(r,o,r.path,c)))).then(o=>Cn.mergeArray(n,o));let a=[...r.data].map((o,c)=>s.type._parseSync(new Ri(r,o,r.path,c)));return Cn.mergeArray(n,a)}get element(){return this._def.type}min(t,r){return new e({...this._def,minLength:{value:t,message:Ke.toString(r)}})}max(t,r){return new e({...this._def,maxLength:{value:t,message:Ke.toString(r)}})}length(t,r){return new e({...this._def,exactLength:{value:t,message:Ke.toString(r)}})}nonempty(t){return this.min(1,t)}};Ya.create=(e,t)=>new Ya({type:e,minLength:null,maxLength:null,exactLength:null,typeName:dt.ZodArray,...Tt(t)});function bl(e){if(e instanceof Si){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=us.create(bl(n))}return new Si({...e._def,shape:()=>t})}else return e instanceof Ya?new Ya({...e._def,type:bl(e.element)}):e instanceof us?us.create(bl(e.unwrap())):e instanceof ca?ca.create(bl(e.unwrap())):e instanceof oa?oa.create(e.items.map(t=>bl(t))):e}var Si=class e extends Mt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),r=Gt.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==Be.object){let u=this._getOrReturnCtx(t);return $e(u,{code:Te.invalid_type,expected:Be.object,received:u.parsedType}),gt}let{status:n,ctx:s}=this._processInputParams(t),{shape:a,keys:o}=this._getCached(),c=[];if(!(this._def.catchall instanceof Ns&&this._def.unknownKeys==="strip"))for(let u in s.data)o.includes(u)||c.push(u);let l=[];for(let u of o){let d=a[u],p=s.data[u];l.push({key:{status:"valid",value:u},value:d._parse(new Ri(s,p,s.path,u)),alwaysSet:u in s.data})}if(this._def.catchall instanceof Ns){let u=this._def.unknownKeys;if(u==="passthrough")for(let d of c)l.push({key:{status:"valid",value:d},value:{status:"valid",value:s.data[d]}});else if(u==="strict")c.length>0&&($e(s,{code:Te.unrecognized_keys,keys:c}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let d of c){let p=s.data[d];l.push({key:{status:"valid",value:d},value:u._parse(new Ri(s,p,s.path,d)),alwaysSet:d in s.data})}}return s.common.async?Promise.resolve().then(async()=>{let u=[];for(let d of l){let p=await d.key,f=await d.value;u.push({key:p,value:f,alwaysSet:d.alwaysSet})}return u}).then(u=>Cn.mergeObjectSync(n,u)):Cn.mergeObjectSync(n,l)}get shape(){return this._def.shape()}strict(t){return Ke.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{let s=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:Ke.errToObj(t).message??s}:{message:s}}}:{}})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:dt.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let r={};for(let n of Gt.objectKeys(t))t[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}omit(t){let r={};for(let n of Gt.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}deepPartial(){return bl(this)}partial(t){let r={};for(let n of Gt.objectKeys(this.shape)){let s=this.shape[n];t&&!t[n]?r[n]=s:r[n]=s.optional()}return new e({...this._def,shape:()=>r})}required(t){let r={};for(let n of Gt.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let a=this.shape[n];for(;a instanceof us;)a=a._def.innerType;r[n]=a}return new e({...this._def,shape:()=>r})}keyof(){return RO(Gt.objectKeys(this.shape))}};Si.create=(e,t)=>new Si({shape:()=>e,unknownKeys:"strip",catchall:Ns.create(),typeName:dt.ZodObject,...Tt(t)});Si.strictCreate=(e,t)=>new Si({shape:()=>e,unknownKeys:"strict",catchall:Ns.create(),typeName:dt.ZodObject,...Tt(t)});Si.lazycreate=(e,t)=>new Si({shape:e,unknownKeys:"strip",catchall:Ns.create(),typeName:dt.ZodObject,...Tt(t)});var Tl=class extends Mt{_parse(t){let{ctx:r}=this._processInputParams(t),n=this._def.options;function s(a){for(let c of a)if(c.result.status==="valid")return c.result;for(let c of a)if(c.result.status==="dirty")return r.common.issues.push(...c.ctx.common.issues),c.result;let o=a.map(c=>new xi(c.ctx.common.issues));return $e(r,{code:Te.invalid_union,unionErrors:o}),gt}if(r.common.async)return Promise.all(n.map(async a=>{let o={...r,common:{...r.common,issues:[]},parent:null};return{result:await a._parseAsync({data:r.data,path:r.path,parent:o}),ctx:o}})).then(s);{let a,o=[];for(let l of n){let u={...r,common:{...r.common,issues:[]},parent:null},d=l._parseSync({data:r.data,path:r.path,parent:u});if(d.status==="valid")return d;d.status==="dirty"&&!a&&(a={result:d,ctx:u}),u.common.issues.length&&o.push(u.common.issues)}if(a)return r.common.issues.push(...a.ctx.common.issues),a.result;let c=o.map(l=>new xi(l));return $e(r,{code:Te.invalid_union,unionErrors:c}),gt}}get options(){return this._def.options}};Tl.create=(e,t)=>new Tl({options:e,typeName:dt.ZodUnion,...Tt(t)});var aa=e=>e instanceof El?aa(e.schema):e instanceof ds?aa(e.innerType()):e instanceof Pl?[e.value]:e instanceof Il?e.options:e instanceof Al?Gt.objectValues(e.enum):e instanceof kl?aa(e._def.innerType):e instanceof xl?[void 0]:e instanceof Sl?[null]:e instanceof us?[void 0,...aa(e.unwrap())]:e instanceof ca?[null,...aa(e.unwrap())]:e instanceof Am||e instanceof Nl?aa(e.unwrap()):e instanceof Cl?aa(e._def.innerType):[],_x=class e extends Mt{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==Be.object)return $e(r,{code:Te.invalid_type,expected:Be.object,received:r.parsedType}),gt;let n=this.discriminator,s=r.data[n],a=this.optionsMap.get(s);return a?r.common.async?a._parseAsync({data:r.data,path:r.path,parent:r}):a._parseSync({data:r.data,path:r.path,parent:r}):($e(r,{code:Te.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),gt)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){let s=new Map;for(let a of r){let o=aa(a.shape[t]);if(!o.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let c of o){if(s.has(c))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(c)}`);s.set(c,a)}}return new e({typeName:dt.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:s,...Tt(n)})}};function bx(e,t){let r=sa(e),n=sa(t);if(e===t)return{valid:!0,data:e};if(r===Be.object&&n===Be.object){let s=Gt.objectKeys(t),a=Gt.objectKeys(e).filter(c=>s.indexOf(c)!==-1),o={...e,...t};for(let c of a){let l=bx(e[c],t[c]);if(!l.valid)return{valid:!1};o[c]=l.data}return{valid:!0,data:o}}else if(r===Be.array&&n===Be.array){if(e.length!==t.length)return{valid:!1};let s=[];for(let a=0;a<e.length;a++){let o=e[a],c=t[a],l=bx(o,c);if(!l.valid)return{valid:!1};s.push(l.data)}return{valid:!0,data:s}}else return r===Be.date&&n===Be.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var wl=class extends Mt{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),s=(a,o)=>{if(mx(a)||mx(o))return gt;let c=bx(a.value,o.value);return c.valid?((gx(a)||gx(o))&&r.dirty(),{status:r.value,value:c.data}):($e(n,{code:Te.invalid_intersection_types}),gt)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([a,o])=>s(a,o)):s(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};wl.create=(e,t,r)=>new wl({left:e,right:t,typeName:dt.ZodIntersection,...Tt(r)});var oa=class e extends Mt{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==Be.array)return $e(n,{code:Te.invalid_type,expected:Be.array,received:n.parsedType}),gt;if(n.data.length<this._def.items.length)return $e(n,{code:Te.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),gt;!this._def.rest&&n.data.length>this._def.items.length&&($e(n,{code:Te.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let a=[...n.data].map((o,c)=>{let l=this._def.items[c]||this._def.rest;return l?l._parse(new Ri(n,o,n.path,c)):null}).filter(o=>!!o);return n.common.async?Promise.all(a).then(o=>Cn.mergeArray(r,o)):Cn.mergeArray(r,a)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};oa.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new oa({items:e,typeName:dt.ZodTuple,rest:null,...Tt(t)})};var vx=class e extends Mt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==Be.object)return $e(n,{code:Te.invalid_type,expected:Be.object,received:n.parsedType}),gt;let s=[],a=this._def.keyType,o=this._def.valueType;for(let c in n.data)s.push({key:a._parse(new Ri(n,c,n.path,c)),value:o._parse(new Ri(n,n.data[c],n.path,c)),alwaysSet:c in n.data});return n.common.async?Cn.mergeObjectAsync(r,s):Cn.mergeObjectSync(r,s)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof Mt?new e({keyType:t,valueType:r,typeName:dt.ZodRecord,...Tt(n)}):new e({keyType:vl.create(),valueType:t,typeName:dt.ZodRecord,...Tt(r)})}},Ld=class extends Mt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==Be.map)return $e(n,{code:Te.invalid_type,expected:Be.map,received:n.parsedType}),gt;let s=this._def.keyType,a=this._def.valueType,o=[...n.data.entries()].map(([c,l],u)=>({key:s._parse(new Ri(n,c,n.path,[u,"key"])),value:a._parse(new Ri(n,l,n.path,[u,"value"]))}));if(n.common.async){let c=new Map;return Promise.resolve().then(async()=>{for(let l of o){let u=await l.key,d=await l.value;if(u.status==="aborted"||d.status==="aborted")return gt;(u.status==="dirty"||d.status==="dirty")&&r.dirty(),c.set(u.value,d.value)}return{status:r.value,value:c}})}else{let c=new Map;for(let l of o){let u=l.key,d=l.value;if(u.status==="aborted"||d.status==="aborted")return gt;(u.status==="dirty"||d.status==="dirty")&&r.dirty(),c.set(u.value,d.value)}return{status:r.value,value:c}}}};Ld.create=(e,t,r)=>new Ld({valueType:t,keyType:e,typeName:dt.ZodMap,...Tt(r)});var Fd=class e extends Mt{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==Be.set)return $e(n,{code:Te.invalid_type,expected:Be.set,received:n.parsedType}),gt;let s=this._def;s.minSize!==null&&n.data.size<s.minSize.value&&($e(n,{code:Te.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),r.dirty()),s.maxSize!==null&&n.data.size>s.maxSize.value&&($e(n,{code:Te.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),r.dirty());let a=this._def.valueType;function o(l){let u=new Set;for(let d of l){if(d.status==="aborted")return gt;d.status==="dirty"&&r.dirty(),u.add(d.value)}return{status:r.value,value:u}}let c=[...n.data.values()].map((l,u)=>a._parse(new Ri(n,l,n.path,u)));return n.common.async?Promise.all(c).then(l=>o(l)):o(c)}min(t,r){return new e({...this._def,minSize:{value:t,message:Ke.toString(r)}})}max(t,r){return new e({...this._def,maxSize:{value:t,message:Ke.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};Fd.create=(e,t)=>new Fd({valueType:e,minSize:null,maxSize:null,typeName:dt.ZodSet,...Tt(t)});var xx=class e extends Mt{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==Be.function)return $e(r,{code:Te.invalid_type,expected:Be.function,received:r.parsedType}),gt;function n(c,l){return Im({data:c,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Ad(),Ha].filter(u=>!!u),issueData:{code:Te.invalid_arguments,argumentsError:l}})}function s(c,l){return Im({data:c,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Ad(),Ha].filter(u=>!!u),issueData:{code:Te.invalid_return_type,returnTypeError:l}})}let a={errorMap:r.common.contextualErrorMap},o=r.data;if(this._def.returns instanceof ec){let c=this;return Un(async function(...l){let u=new xi([]),d=await c._def.args.parseAsync(l,a).catch(h=>{throw u.addIssue(n(l,h)),u}),p=await Reflect.apply(o,this,d);return await c._def.returns._def.type.parseAsync(p,a).catch(h=>{throw u.addIssue(s(p,h)),u})})}else{let c=this;return Un(function(...l){let u=c._def.args.safeParse(l,a);if(!u.success)throw new xi([n(l,u.error)]);let d=Reflect.apply(o,this,u.data),p=c._def.returns.safeParse(d,a);if(!p.success)throw new xi([s(d,p.error)]);return p.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:oa.create(t).rest(Ja.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new e({args:t||oa.create([]).rest(Ja.create()),returns:r||Ja.create(),typeName:dt.ZodFunction,...Tt(n)})}},El=class extends Mt{get schema(){return this._def.getter()}_parse(t){let{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};El.create=(e,t)=>new El({getter:e,typeName:dt.ZodLazy,...Tt(t)});var Pl=class extends Mt{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return $e(r,{received:r.data,code:Te.invalid_literal,expected:this._def.value}),gt}return{status:"valid",value:t.data}}get value(){return this._def.value}};Pl.create=(e,t)=>new Pl({value:e,typeName:dt.ZodLiteral,...Tt(t)});function RO(e,t){return new Il({values:e,typeName:dt.ZodEnum,...Tt(t)})}var Il=class e extends Mt{_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return $e(r,{expected:Gt.joinValues(n),received:r.parsedType,code:Te.invalid_type}),gt}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let r=this._getOrReturnCtx(t),n=this._def.values;return $e(r,{received:r.data,code:Te.invalid_enum_value,options:n}),gt}return Un(t.data)}get options(){return this._def.values}get enum(){let t={};for(let r of this._def.values)t[r]=r;return t}get Values(){let t={};for(let r of this._def.values)t[r]=r;return t}get Enum(){let t={};for(let r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return e.create(t,{...this._def,...r})}exclude(t,r=this._def){return e.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}};Il.create=RO;var Al=class extends Mt{_parse(t){let r=Gt.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==Be.string&&n.parsedType!==Be.number){let s=Gt.objectValues(r);return $e(n,{expected:Gt.joinValues(s),received:n.parsedType,code:Te.invalid_type}),gt}if(this._cache||(this._cache=new Set(Gt.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let s=Gt.objectValues(r);return $e(n,{received:n.data,code:Te.invalid_enum_value,options:s}),gt}return Un(t.data)}get enum(){return this._def.values}};Al.create=(e,t)=>new Al({values:e,typeName:dt.ZodNativeEnum,...Tt(t)});var ec=class extends Mt{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==Be.promise&&r.common.async===!1)return $e(r,{code:Te.invalid_type,expected:Be.promise,received:r.parsedType}),gt;let n=r.parsedType===Be.promise?r.data:Promise.resolve(r.data);return Un(n.then(s=>this._def.type.parseAsync(s,{path:r.path,errorMap:r.common.contextualErrorMap})))}};ec.create=(e,t)=>new ec({type:e,typeName:dt.ZodPromise,...Tt(t)});var ds=class extends Mt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===dt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:r,ctx:n}=this._processInputParams(t),s=this._def.effect||null,a={addIssue:o=>{$e(n,o),o.fatal?r.abort():r.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),s.type==="preprocess"){let o=s.transform(n.data,a);if(n.common.async)return Promise.resolve(o).then(async c=>{if(r.value==="aborted")return gt;let l=await this._def.schema._parseAsync({data:c,path:n.path,parent:n});return l.status==="aborted"?gt:l.status==="dirty"?_l(l.value):r.value==="dirty"?_l(l.value):l});{if(r.value==="aborted")return gt;let c=this._def.schema._parseSync({data:o,path:n.path,parent:n});return c.status==="aborted"?gt:c.status==="dirty"?_l(c.value):r.value==="dirty"?_l(c.value):c}}if(s.type==="refinement"){let o=c=>{let l=s.refinement(c,a);if(n.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c};if(n.common.async===!1){let c=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return c.status==="aborted"?gt:(c.status==="dirty"&&r.dirty(),o(c.value),{status:r.value,value:c.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(c=>c.status==="aborted"?gt:(c.status==="dirty"&&r.dirty(),o(c.value).then(()=>({status:r.value,value:c.value}))))}if(s.type==="transform")if(n.common.async===!1){let o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Qo(o))return gt;let c=s.transform(o.value,a);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:c}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>Qo(o)?Promise.resolve(s.transform(o.value,a)).then(c=>({status:r.value,value:c})):gt);Gt.assertNever(s)}};ds.create=(e,t,r)=>new ds({schema:e,typeName:dt.ZodEffects,effect:t,...Tt(r)});ds.createWithPreprocess=(e,t,r)=>new ds({schema:t,effect:{type:"preprocess",transform:e},typeName:dt.ZodEffects,...Tt(r)});var us=class extends Mt{_parse(t){return this._getType(t)===Be.undefined?Un(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};us.create=(e,t)=>new us({innerType:e,typeName:dt.ZodOptional,...Tt(t)});var ca=class extends Mt{_parse(t){return this._getType(t)===Be.null?Un(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};ca.create=(e,t)=>new ca({innerType:e,typeName:dt.ZodNullable,...Tt(t)});var kl=class extends Mt{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return r.parsedType===Be.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};kl.create=(e,t)=>new kl({innerType:e,typeName:dt.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Tt(t)});var Cl=class extends Mt{_parse(t){let{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},s=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return kd(s)?s.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new xi(n.common.issues)},input:n.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new xi(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Cl.create=(e,t)=>new Cl({innerType:e,typeName:dt.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Tt(t)});var jd=class extends Mt{_parse(t){if(this._getType(t)!==Be.nan){let n=this._getOrReturnCtx(t);return $e(n,{code:Te.invalid_type,expected:Be.nan,received:n.parsedType}),gt}return{status:"valid",value:t.data}}};jd.create=e=>new jd({typeName:dt.ZodNaN,...Tt(e)});var P9e=Symbol("zod_brand"),Am=class extends Mt{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},km=class e extends Mt{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{let a=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?gt:a.status==="dirty"?(r.dirty(),_l(a.value)):this._def.out._parseAsync({data:a.value,path:n.path,parent:n})})();{let s=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?gt:s.status==="dirty"?(r.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:n.path,parent:n})}}static create(t,r){return new e({in:t,out:r,typeName:dt.ZodPipeline})}},Nl=class extends Mt{_parse(t){let r=this._def.innerType._parse(t),n=s=>(Qo(s)&&(s.value=Object.freeze(s.value)),s);return kd(r)?r.then(s=>n(s)):n(r)}unwrap(){return this._def.innerType}};Nl.create=(e,t)=>new Nl({innerType:e,typeName:dt.ZodReadonly,...Tt(t)});var I9e={object:Si.lazycreate},dt;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(dt||(dt={}));var A9e=vl.create,k9e=Cd.create,C9e=jd.create,N9e=Nd.create,O9e=Od.create,$9e=$d.create,R9e=Rd.create,D9e=xl.create,M9e=Sl.create,L9e=Dd.create,F9e=Ja.create,j9e=Ns.create,B9e=Md.create,z9e=Ya.create,q5=Si.create,U9e=Si.strictCreate,q9e=Tl.create,W9e=_x.create,V9e=wl.create,K9e=oa.create,G9e=vx.create,Z9e=Ld.create,H9e=Fd.create,J9e=xx.create,Y9e=El.create,X9e=Pl.create,Q9e=Il.create,eWe=Al.create,tWe=ec.create,rWe=ds.create,nWe=us.create,iWe=ca.create,sWe=ds.createWithPreprocess,aWe=km.create;var DO=Object.freeze({status:"aborted"});function re(e,t,r){function n(c,l){if(c._zod||Object.defineProperty(c,"_zod",{value:{def:l,constr:o,traits:new Set},enumerable:!1}),c._zod.traits.has(e))return;c._zod.traits.add(e),t(c,l);let u=o.prototype,d=Object.keys(u);for(let p=0;p<d.length;p++){let f=d[p];f in c||(c[f]=u[f].bind(c))}}let s=r?.Parent??Object;class a extends s{}Object.defineProperty(a,"name",{value:e});function o(c){var l;let u=r?.Parent?new a:this;n(u,c),(l=u._zod).deferred??(l.deferred=[]);for(let d of u._zod.deferred)d();return u}return Object.defineProperty(o,"init",{value:n}),Object.defineProperty(o,Symbol.hasInstance,{value:c=>r?.Parent&&c instanceof r.Parent?!0:c?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}var Sx=Symbol("zod_brand"),Os=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},tc=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},Cm={};function ln(e){return e&&Object.assign(Cm,e),Cm}var Ee={};zn(Ee,{BIGINT_FORMAT_RANGES:()=>Ox,Class:()=>wx,NUMBER_FORMAT_RANGES:()=>Nx,aborted:()=>to,allowsEval:()=>Ix,assert:()=>J5,assertEqual:()=>K5,assertIs:()=>Z5,assertNever:()=>H5,assertNotEqual:()=>G5,assignProp:()=>Qa,base64ToUint8Array:()=>qO,base64urlToUint8Array:()=>oK,cached:()=>$l,captureStackTrace:()=>Om,cleanEnum:()=>aK,cleanRegex:()=>Ud,clone:()=>qn,cloneDef:()=>X5,createTransparentProxy:()=>iK,defineLazy:()=>Pt,esc:()=>Nm,escapeRegex:()=>Di,extend:()=>jO,finalizeIssue:()=>si,floatSafeRemainder:()=>Ex,getElementAtPath:()=>Q5,getEnumValues:()=>zd,getLengthableOrigin:()=>Vd,getParsedType:()=>nK,getSizableOrigin:()=>Wd,hexToUint8Array:()=>lK,isObject:()=>rc,isPlainObject:()=>eo,issue:()=>Rl,joinValues:()=>pt,jsonStringifyReplacer:()=>Ol,merge:()=>sK,mergeDefs:()=>la,normalizeParams:()=>Re,nullish:()=>Xa,numKeys:()=>rK,objectClone:()=>Y5,omit:()=>FO,optionalKeys:()=>Cx,parsedType:()=>yt,partial:()=>zO,pick:()=>LO,prefixIssues:()=>Ti,primitiveTypes:()=>kx,promiseAllObject:()=>eK,propertyKeyTypes:()=>qd,randomString:()=>tK,required:()=>UO,safeExtend:()=>BO,shallowClone:()=>Ax,slugify:()=>Px,stringifyPrimitive:()=>ft,uint8ArrayToBase64:()=>WO,uint8ArrayToBase64url:()=>cK,uint8ArrayToHex:()=>uK,unwrapMessage:()=>Bd});function K5(e){return e}function G5(e){return e}function Z5(e){}function H5(e){throw new Error("Unexpected value in exhaustive check")}function J5(e){}function zd(e){let t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,s])=>t.indexOf(+n)===-1).map(([n,s])=>s)}function pt(e,t="|"){return e.map(r=>ft(r)).join(t)}function Ol(e,t){return typeof t=="bigint"?t.toString():t}function $l(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function Xa(e){return e==null}function Ud(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function Ex(e,t){let r=(e.toString().split(".")[1]||"").length,n=t.toString(),s=(n.split(".")[1]||"").length;if(s===0&&/\d?e-\d?/.test(n)){let l=n.match(/\d?e-(\d?)/);l?.[1]&&(s=Number.parseInt(l[1]))}let a=r>s?r:s,o=Number.parseInt(e.toFixed(a).replace(".","")),c=Number.parseInt(t.toFixed(a).replace(".",""));return o%c/10**a}var MO=Symbol("evaluating");function Pt(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==MO)return n===void 0&&(n=MO,n=r()),n},set(s){Object.defineProperty(e,t,{value:s})},configurable:!0})}function Y5(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Qa(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function la(...e){let t={};for(let r of e){let n=Object.getOwnPropertyDescriptors(r);Object.assign(t,n)}return Object.defineProperties({},t)}function X5(e){return la(e._zod.def)}function Q5(e,t){return t?t.reduce((r,n)=>r?.[n],e):e}function eK(e){let t=Object.keys(e),r=t.map(n=>e[n]);return Promise.all(r).then(n=>{let s={};for(let a=0;a<t.length;a++)s[t[a]]=n[a];return s})}function tK(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let n=0;n<e;n++)r+=t[Math.floor(Math.random()*t.length)];return r}function Nm(e){return JSON.stringify(e)}function Px(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Om="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function rc(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Ix=$l(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function eo(e){if(rc(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(rc(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Ax(e){return eo(e)?{...e}:Array.isArray(e)?[...e]:e}function rK(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}var nK=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},qd=new Set(["string","number","symbol"]),kx=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Di(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function qn(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}function Re(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function iK(e){let t;return new Proxy({},{get(r,n,s){return t??(t=e()),Reflect.get(t,n,s)},set(r,n,s,a){return t??(t=e()),Reflect.set(t,n,s,a)},has(r,n){return t??(t=e()),Reflect.has(t,n)},deleteProperty(r,n){return t??(t=e()),Reflect.deleteProperty(t,n)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,n){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,n)},defineProperty(r,n,s){return t??(t=e()),Reflect.defineProperty(t,n,s)}})}function ft(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function Cx(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var Nx={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]},Ox={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function LO(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let a=la(e._zod.def,{get shape(){let o={};for(let c in t){if(!(c in r.shape))throw new Error(`Unrecognized key: "${c}"`);t[c]&&(o[c]=r.shape[c])}return Qa(this,"shape",o),o},checks:[]});return qn(e,a)}function FO(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let a=la(e._zod.def,{get shape(){let o={...e._zod.def.shape};for(let c in t){if(!(c in r.shape))throw new Error(`Unrecognized key: "${c}"`);t[c]&&delete o[c]}return Qa(this,"shape",o),o},checks:[]});return qn(e,a)}function jO(e,t){if(!eo(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let a=e._zod.def.shape;for(let o in t)if(Object.getOwnPropertyDescriptor(a,o)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let s=la(e._zod.def,{get shape(){let a={...e._zod.def.shape,...t};return Qa(this,"shape",a),a}});return qn(e,s)}function BO(e,t){if(!eo(t))throw new Error("Invalid input to safeExtend: expected a plain object");let r=la(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Qa(this,"shape",n),n}});return qn(e,r)}function sK(e,t){let r=la(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return Qa(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return qn(e,r)}function zO(e,t,r){let s=t._zod.def.checks;if(s&&s.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let o=la(t._zod.def,{get shape(){let c=t._zod.def.shape,l={...c};if(r)for(let u in r){if(!(u in c))throw new Error(`Unrecognized key: "${u}"`);r[u]&&(l[u]=e?new e({type:"optional",innerType:c[u]}):c[u])}else for(let u in c)l[u]=e?new e({type:"optional",innerType:c[u]}):c[u];return Qa(this,"shape",l),l},checks:[]});return qn(t,o)}function UO(e,t,r){let n=la(t._zod.def,{get shape(){let s=t._zod.def.shape,a={...s};if(r)for(let o in r){if(!(o in a))throw new Error(`Unrecognized key: "${o}"`);r[o]&&(a[o]=new e({type:"nonoptional",innerType:s[o]}))}else for(let o in s)a[o]=new e({type:"nonoptional",innerType:s[o]});return Qa(this,"shape",a),a}});return qn(t,n)}function to(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function Ti(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function Bd(e){return typeof e=="string"?e:e?.message}function si(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let s=Bd(e.inst?._zod.def?.error?.(e))??Bd(t?.error?.(e))??Bd(r.customError?.(e))??Bd(r.localeError?.(e))??"Invalid input";n.message=s}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}function Wd(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function Vd(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function yt(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function Rl(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}function aK(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function qO(e){let t=atob(e),r=new Uint8Array(t.length);for(let n=0;n<t.length;n++)r[n]=t.charCodeAt(n);return r}function WO(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function oK(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return qO(t+r)}function cK(e){return WO(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function lK(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let n=0;n<t.length;n+=2)r[n/2]=Number.parseInt(t.slice(n,n+2),16);return r}function uK(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var wx=class{constructor(...t){}};var VO=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Ol,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},$m=re("$ZodError",VO),Kd=re("$ZodError",VO,{Parent:Error});function Rm(e,t=r=>r.message){let r={},n=[];for(let s of e.issues)s.path.length>0?(r[s.path[0]]=r[s.path[0]]||[],r[s.path[0]].push(t(s))):n.push(t(s));return{formErrors:n,fieldErrors:r}}function Dm(e,t=r=>r.message){let r={_errors:[]},n=s=>{for(let a of s.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(o=>n({issues:o}));else if(a.code==="invalid_key")n({issues:a.issues});else if(a.code==="invalid_element")n({issues:a.issues});else if(a.path.length===0)r._errors.push(t(a));else{let o=r,c=0;for(;c<a.path.length;){let l=a.path[c];c===a.path.length-1?(o[l]=o[l]||{_errors:[]},o[l]._errors.push(t(a))):o[l]=o[l]||{_errors:[]},o=o[l],c++}}};return n(e),r}var Gd=e=>(t,r,n,s)=>{let a=n?Object.assign(n,{async:!1}):{async:!1},o=t._zod.run({value:r,issues:[]},a);if(o instanceof Promise)throw new Os;if(o.issues.length){let c=new(s?.Err??e)(o.issues.map(l=>si(l,a,ln())));throw Om(c,s?.callee),c}return o.value},Zd=Gd(Kd),Hd=e=>async(t,r,n,s)=>{let a=n?Object.assign(n,{async:!0}):{async:!0},o=t._zod.run({value:r,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let c=new(s?.Err??e)(o.issues.map(l=>si(l,a,ln())));throw Om(c,s?.callee),c}return o.value},Jd=Hd(Kd),Yd=e=>(t,r,n)=>{let s=n?{...n,async:!1}:{async:!1},a=t._zod.run({value:r,issues:[]},s);if(a instanceof Promise)throw new Os;return a.issues.length?{success:!1,error:new(e??$m)(a.issues.map(o=>si(o,s,ln())))}:{success:!0,data:a.value}},Dl=Yd(Kd),Xd=e=>async(t,r,n)=>{let s=n?Object.assign(n,{async:!0}):{async:!0},a=t._zod.run({value:r,issues:[]},s);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(o=>si(o,s,ln())))}:{success:!0,data:a.value}},Qd=Xd(Kd),KO=e=>(t,r,n)=>{let s=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Gd(e)(t,r,s)};var GO=e=>(t,r,n)=>Gd(e)(t,r,n);var ZO=e=>async(t,r,n)=>{let s=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Hd(e)(t,r,s)};var HO=e=>async(t,r,n)=>Hd(e)(t,r,n);var JO=e=>(t,r,n)=>{let s=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Yd(e)(t,r,s)};var YO=e=>(t,r,n)=>Yd(e)(t,r,n);var XO=e=>async(t,r,n)=>{let s=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Xd(e)(t,r,s)};var QO=e=>async(t,r,n)=>Xd(e)(t,r,n);var Mi={};zn(Mi,{base64:()=>Zx,base64url:()=>Mm,bigint:()=>eS,boolean:()=>rS,browserEmail:()=>bK,cidrv4:()=>Kx,cidrv6:()=>Gx,cuid:()=>$x,cuid2:()=>Rx,date:()=>Jx,datetime:()=>Xx,domain:()=>SK,duration:()=>jx,e164:()=>Hx,email:()=>zx,emoji:()=>Ux,extendedDuration:()=>pK,guid:()=>Bx,hex:()=>TK,hostname:()=>xK,html5Email:()=>gK,idnEmail:()=>_K,integer:()=>tS,ipv4:()=>qx,ipv6:()=>Wx,ksuid:()=>Lx,lowercase:()=>sS,mac:()=>Vx,md5_base64:()=>EK,md5_base64url:()=>PK,md5_hex:()=>wK,nanoid:()=>Fx,null:()=>nS,number:()=>Lm,rfc5322Email:()=>yK,sha1_base64:()=>AK,sha1_base64url:()=>kK,sha1_hex:()=>IK,sha256_base64:()=>NK,sha256_base64url:()=>OK,sha256_hex:()=>CK,sha384_base64:()=>RK,sha384_base64url:()=>DK,sha384_hex:()=>$K,sha512_base64:()=>LK,sha512_base64url:()=>FK,sha512_hex:()=>MK,string:()=>Qx,time:()=>Yx,ulid:()=>Dx,undefined:()=>iS,unicodeEmail:()=>e$,uppercase:()=>aS,uuid:()=>nc,uuid4:()=>fK,uuid6:()=>hK,uuid7:()=>mK,xid:()=>Mx});var $x=/^[cC][^\s-]{8,}$/,Rx=/^[0-9a-z]+$/,Dx=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Mx=/^[0-9a-vA-V]{20}$/,Lx=/^[A-Za-z0-9]{27}$/,Fx=/^[a-zA-Z0-9_-]{21}$/,jx=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,pK=/^[-+]?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)?)??$/,Bx=/^([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})$/,nc=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,fK=nc(4),hK=nc(6),mK=nc(7),zx=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,gK=/^[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])?)*$/,yK=/^(([^<>()\[\]\\.,;:\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,}))$/,e$=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,_K=e$,bK=/^[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])?)*$/,vK="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Ux(){return new RegExp(vK,"u")}var qx=/^(?:(?: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])$/,Wx=/^(([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}|:))$/,Vx=e=>{let t=Di(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},Kx=/^((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])$/,Gx=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Zx=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Mm=/^[A-Za-z0-9_-]*$/,xK=/^(?=.{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])?)*\.?$/,SK=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Hx=/^\+[1-9]\d{6,14}$/,t$="(?:(?:\\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])))",Jx=new RegExp(`^${t$}$`);function r$(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Yx(e){return new RegExp(`^${r$(e)}$`)}function Xx(e){let t=r$({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let n=`${t}(?:${r.join("|")})`;return new RegExp(`^${t$}T(?:${n})$`)}var Qx=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},eS=/^-?\d+n?$/,tS=/^-?\d+$/,Lm=/^-?\d+(?:\.\d+)?$/,rS=/^(?:true|false)$/i,nS=/^null$/i;var iS=/^undefined$/i;var sS=/^[^A-Z]*$/,aS=/^[^a-z]*$/,TK=/^[0-9a-fA-F]*$/;function ep(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function tp(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var wK=/^[0-9a-fA-F]{32}$/,EK=ep(22,"=="),PK=tp(22),IK=/^[0-9a-fA-F]{40}$/,AK=ep(27,"="),kK=tp(27),CK=/^[0-9a-fA-F]{64}$/,NK=ep(43,"="),OK=tp(43),$K=/^[0-9a-fA-F]{96}$/,RK=ep(64,""),DK=tp(64),MK=/^[0-9a-fA-F]{128}$/,LK=ep(86,"=="),FK=tp(86);var _r=re("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),i$={number:"number",bigint:"bigint",object:"date"},oS=re("$ZodCheckLessThan",(e,t)=>{_r.init(e,t);let r=i$[typeof t.value];e._zod.onattach.push(n=>{let s=n._zod.bag,a=(t.inclusive?s.maximum:s.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<a&&(t.inclusive?s.maximum=t.value:s.exclusiveMaximum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),cS=re("$ZodCheckGreaterThan",(e,t)=>{_r.init(e,t);let r=i$[typeof t.value];e._zod.onattach.push(n=>{let s=n._zod.bag,a=(t.inclusive?s.minimum:s.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>a&&(t.inclusive?s.minimum=t.value:s.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),s$=re("$ZodCheckMultipleOf",(e,t)=>{_r.init(e,t),e._zod.onattach.push(r=>{var n;(n=r._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):Ex(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),a$=re("$ZodCheckNumberFormat",(e,t)=>{_r.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[s,a]=Nx[t.format];e._zod.onattach.push(o=>{let c=o._zod.bag;c.format=t.format,c.minimum=s,c.maximum=a,r&&(c.pattern=tS)}),e._zod.check=o=>{let c=o.value;if(r){if(!Number.isInteger(c)){o.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){c>0?o.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):o.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}c<s&&o.issues.push({origin:"number",input:c,code:"too_small",minimum:s,inclusive:!0,inst:e,continue:!t.abort}),c>a&&o.issues.push({origin:"number",input:c,code:"too_big",maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),o$=re("$ZodCheckBigIntFormat",(e,t)=>{_r.init(e,t);let[r,n]=Ox[t.format];e._zod.onattach.push(s=>{let a=s._zod.bag;a.format=t.format,a.minimum=r,a.maximum=n}),e._zod.check=s=>{let a=s.value;a<r&&s.issues.push({origin:"bigint",input:a,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),a>n&&s.issues.push({origin:"bigint",input:a,code:"too_big",maximum:n,inclusive:!0,inst:e,continue:!t.abort})}}),c$=re("$ZodCheckMaxSize",(e,t)=>{var r;_r.init(e,t),(r=e._zod.def).when??(r.when=n=>{let s=n.value;return!Xa(s)&&s.size!==void 0}),e._zod.onattach.push(n=>{let s=n._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<s&&(n._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let s=n.value;s.size<=t.maximum||n.issues.push({origin:Wd(s),code:"too_big",maximum:t.maximum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),l$=re("$ZodCheckMinSize",(e,t)=>{var r;_r.init(e,t),(r=e._zod.def).when??(r.when=n=>{let s=n.value;return!Xa(s)&&s.size!==void 0}),e._zod.onattach.push(n=>{let s=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>s&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let s=n.value;s.size>=t.minimum||n.issues.push({origin:Wd(s),code:"too_small",minimum:t.minimum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),u$=re("$ZodCheckSizeEquals",(e,t)=>{var r;_r.init(e,t),(r=e._zod.def).when??(r.when=n=>{let s=n.value;return!Xa(s)&&s.size!==void 0}),e._zod.onattach.push(n=>{let s=n._zod.bag;s.minimum=t.size,s.maximum=t.size,s.size=t.size}),e._zod.check=n=>{let s=n.value,a=s.size;if(a===t.size)return;let o=a>t.size;n.issues.push({origin:Wd(s),...o?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),d$=re("$ZodCheckMaxLength",(e,t)=>{var r;_r.init(e,t),(r=e._zod.def).when??(r.when=n=>{let s=n.value;return!Xa(s)&&s.length!==void 0}),e._zod.onattach.push(n=>{let s=n._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<s&&(n._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let s=n.value;if(s.length<=t.maximum)return;let o=Vd(s);n.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),p$=re("$ZodCheckMinLength",(e,t)=>{var r;_r.init(e,t),(r=e._zod.def).when??(r.when=n=>{let s=n.value;return!Xa(s)&&s.length!==void 0}),e._zod.onattach.push(n=>{let s=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>s&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let s=n.value;if(s.length>=t.minimum)return;let o=Vd(s);n.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),f$=re("$ZodCheckLengthEquals",(e,t)=>{var r;_r.init(e,t),(r=e._zod.def).when??(r.when=n=>{let s=n.value;return!Xa(s)&&s.length!==void 0}),e._zod.onattach.push(n=>{let s=n._zod.bag;s.minimum=t.length,s.maximum=t.length,s.length=t.length}),e._zod.check=n=>{let s=n.value,a=s.length;if(a===t.length)return;let o=Vd(s),c=a>t.length;n.issues.push({origin:o,...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),rp=re("$ZodCheckStringFormat",(e,t)=>{var r,n;_r.init(e,t),e._zod.onattach.push(s=>{let a=s._zod.bag;a.format=t.format,t.pattern&&(a.patterns??(a.patterns=new Set),a.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=s=>{t.pattern.lastIndex=0,!t.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:t.format,input:s.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),h$=re("$ZodCheckRegex",(e,t)=>{rp.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),m$=re("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=sS),rp.init(e,t)}),g$=re("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=aS),rp.init(e,t)}),y$=re("$ZodCheckIncludes",(e,t)=>{_r.init(e,t);let r=Di(t.includes),n=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=n,e._zod.onattach.push(s=>{let a=s._zod.bag;a.patterns??(a.patterns=new Set),a.patterns.add(n)}),e._zod.check=s=>{s.value.includes(t.includes,t.position)||s.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:s.value,inst:e,continue:!t.abort})}}),_$=re("$ZodCheckStartsWith",(e,t)=>{_r.init(e,t);let r=new RegExp(`^${Di(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{let s=n._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(r)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),b$=re("$ZodCheckEndsWith",(e,t)=>{_r.init(e,t);let r=new RegExp(`.*${Di(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{let s=n._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(r)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}});function n$(e,t,r){e.issues.length&&t.issues.push(...Ti(r,e.issues))}var v$=re("$ZodCheckProperty",(e,t)=>{_r.init(e,t),e._zod.check=r=>{let n=t.schema._zod.run({value:r.value[t.property],issues:[]},{});if(n instanceof Promise)return n.then(s=>n$(s,r,t.property));n$(n,r,t.property)}}),x$=re("$ZodCheckMimeType",(e,t)=>{_r.init(e,t);let r=new Set(t.mime);e._zod.onattach.push(n=>{n._zod.bag.mime=t.mime}),e._zod.check=n=>{r.has(n.value.type)||n.issues.push({code:"invalid_value",values:t.mime,input:n.value.type,inst:e,continue:!t.abort})}}),S$=re("$ZodCheckOverwrite",(e,t)=>{_r.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});var Fm=class{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let n=t.split(`
|
|
218
218
|
`).filter(o=>o),s=Math.min(...n.map(o=>o.length-o.trimStart().length)),a=n.map(o=>o.slice(s)).map(o=>" ".repeat(this.indent*2)+o);for(let o of a)this.content.push(o)}compile(){let t=Function,r=this?.args,s=[...(this?.content??[""]).map(a=>` ${a}`)];return new t(...r,s.join(`
|
|
219
|
-
`))}};var w$={major:4,minor:3,patch:6};var xt=re("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=w$;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let s of n)for(let a of s._zod.onattach)a(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let s=(o,c,l)=>{let u=to(o),d;for(let p of c){if(p._zod.def.when){if(!p._zod.def.when(o))continue}else if(u)continue;let f=o.issues.length,h=p._zod.check(o);if(h instanceof Promise&&l?.async===!1)throw new Os;if(d||h instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await h,o.issues.length!==f&&(u||(u=to(o,f)))});else{if(o.issues.length===f)continue;u||(u=to(o,f))}}return d?d.then(()=>o):o},a=(o,c,l)=>{if(to(o))return o.aborted=!0,o;let u=s(c,n,l);if(u instanceof Promise){if(l.async===!1)throw new Os;return u.then(d=>e._zod.parse(d,l))}return e._zod.parse(u,l)};e._zod.run=(o,c)=>{if(c.skipChecks)return e._zod.parse(o,c);if(c.direction==="backward"){let u=e._zod.parse({value:o.value,issues:[]},{...c,skipChecks:!0});return u instanceof Promise?u.then(d=>a(d,o,c)):a(u,o,c)}let l=e._zod.parse(o,c);if(l instanceof Promise){if(c.async===!1)throw new Os;return l.then(u=>s(u,n,c))}return s(l,n,c)}}Pt(e,"~standard",()=>({validate:s=>{try{let a=Dl(e,s);return a.success?{value:a.data}:{issues:a.error?.issues}}catch{return Qd(e,s).then(o=>o.success?{value:o.data}:{issues:o.error?.issues})}},vendor:"zod",version:1}))}),ic=re("$ZodString",(e,t)=>{xt.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Qx(e._zod.bag),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),fr=re("$ZodStringFormat",(e,t)=>{rp.init(e,t),ic.init(e,t)}),uS=re("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Bx),fr.init(e,t)}),dS=re("$ZodUUID",(e,t)=>{if(t.version){let n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(n===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=nc(n))}else t.pattern??(t.pattern=nc());fr.init(e,t)}),pS=re("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=zx),fr.init(e,t)}),fS=re("$ZodURL",(e,t)=>{fr.init(e,t),e._zod.check=r=>{try{let n=r.value.trim(),s=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(s.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(s.protocol.endsWith(":")?s.protocol.slice(0,-1):s.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=s.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),hS=re("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Ux()),fr.init(e,t)}),mS=re("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Fx),fr.init(e,t)}),gS=re("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=$x),fr.init(e,t)}),yS=re("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Rx),fr.init(e,t)}),_S=re("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Dx),fr.init(e,t)}),bS=re("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Mx),fr.init(e,t)}),vS=re("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Lx),fr.init(e,t)}),xS=re("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Xx(t)),fr.init(e,t)}),SS=re("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Jx),fr.init(e,t)}),TS=re("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Yx(t)),fr.init(e,t)}),wS=re("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=jx),fr.init(e,t)}),ES=re("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=qx),fr.init(e,t),e._zod.bag.format="ipv4"}),PS=re("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Wx),fr.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),IS=re("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=Vx(t.delimiter)),fr.init(e,t),e._zod.bag.format="mac"}),AS=re("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Kx),fr.init(e,t)}),kS=re("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Gx),fr.init(e,t),e._zod.check=r=>{let n=r.value.split("/");try{if(n.length!==2)throw new Error;let[s,a]=n;if(!a)throw new Error;let o=Number(a);if(`${o}`!==a)throw new Error;if(o<0||o>128)throw new Error;new URL(`http://[${s}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function M$(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var CS=re("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Zx),fr.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{M$(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function jK(e){if(!Mm.test(e))return!1;let t=e.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return M$(r)}var NS=re("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Mm),fr.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{jK(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),OS=re("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Hx),fr.init(e,t)});function BK(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[n]=r;if(!n)return!1;let s=JSON.parse(atob(n));return!("typ"in s&&s?.typ!=="JWT"||!s.alg||t&&(!("alg"in s)||s.alg!==t))}catch{return!1}}var $S=re("$ZodJWT",(e,t)=>{fr.init(e,t),e._zod.check=r=>{BK(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),RS=re("$ZodCustomStringFormat",(e,t)=>{fr.init(e,t),e._zod.check=r=>{t.fn(r.value)||r.issues.push({code:"invalid_format",format:t.format,input:r.value,inst:e,continue:!t.abort})}}),Wm=re("$ZodNumber",(e,t)=>{xt.init(e,t),e._zod.pattern=e._zod.bag.pattern??Lm,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let s=r.value;if(typeof s=="number"&&!Number.isNaN(s)&&Number.isFinite(s))return r;let a=typeof s=="number"?Number.isNaN(s)?"NaN":Number.isFinite(s)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:s,inst:e,...a?{received:a}:{}}),r}}),DS=re("$ZodNumberFormat",(e,t)=>{a$.init(e,t),Wm.init(e,t)}),np=re("$ZodBoolean",(e,t)=>{xt.init(e,t),e._zod.pattern=rS,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}let s=r.value;return typeof s=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:s,inst:e}),r}}),Vm=re("$ZodBigInt",(e,t)=>{xt.init(e,t),e._zod.pattern=eS,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}}),MS=re("$ZodBigIntFormat",(e,t)=>{o$.init(e,t),Vm.init(e,t)}),LS=re("$ZodSymbol",(e,t)=>{xt.init(e,t),e._zod.parse=(r,n)=>{let s=r.value;return typeof s=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:s,inst:e}),r}}),FS=re("$ZodUndefined",(e,t)=>{xt.init(e,t),e._zod.pattern=iS,e._zod.values=new Set([void 0]),e._zod.optin="optional",e._zod.optout="optional",e._zod.parse=(r,n)=>{let s=r.value;return typeof s>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:s,inst:e}),r}}),jS=re("$ZodNull",(e,t)=>{xt.init(e,t),e._zod.pattern=nS,e._zod.values=new Set([null]),e._zod.parse=(r,n)=>{let s=r.value;return s===null||r.issues.push({expected:"null",code:"invalid_type",input:s,inst:e}),r}}),BS=re("$ZodAny",(e,t)=>{xt.init(e,t),e._zod.parse=r=>r}),zS=re("$ZodUnknown",(e,t)=>{xt.init(e,t),e._zod.parse=r=>r}),US=re("$ZodNever",(e,t)=>{xt.init(e,t),e._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)}),qS=re("$ZodVoid",(e,t)=>{xt.init(e,t),e._zod.parse=(r,n)=>{let s=r.value;return typeof s>"u"||r.issues.push({expected:"void",code:"invalid_type",input:s,inst:e}),r}}),WS=re("$ZodDate",(e,t)=>{xt.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let s=r.value,a=s instanceof Date;return a&&!Number.isNaN(s.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:s,...a?{received:"Invalid Date"}:{},inst:e}),r}});function E$(e,t,r){e.issues.length&&t.issues.push(...Ti(r,e.issues)),t.value[r]=e.value}var VS=re("$ZodArray",(e,t)=>{xt.init(e,t),e._zod.parse=(r,n)=>{let s=r.value;if(!Array.isArray(s))return r.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),r;r.value=Array(s.length);let a=[];for(let o=0;o<s.length;o++){let c=s[o],l=t.element._zod.run({value:c,issues:[]},n);l instanceof Promise?a.push(l.then(u=>E$(u,r,o))):E$(l,r,o)}return a.length?Promise.all(a).then(()=>r):r}});function qm(e,t,r,n,s){if(e.issues.length){if(s&&!(r in n))return;t.issues.push(...Ti(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}function L$(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);let r=Cx(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function F$(e,t,r,n,s,a){let o=[],c=s.keySet,l=s.catchall._zod,u=l.def.type,d=l.optout==="optional";for(let p in t){if(c.has(p))continue;if(u==="never"){o.push(p);continue}let f=l.run({value:t[p],issues:[]},n);f instanceof Promise?e.push(f.then(h=>qm(h,r,p,t,d))):qm(f,r,p,t,d)}return o.length&&r.issues.push({code:"unrecognized_keys",keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>r):r}var j$=re("$ZodObject",(e,t)=>{if(xt.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let c=t.shape;Object.defineProperty(t,"shape",{get:()=>{let l={...c};return Object.defineProperty(t,"shape",{value:l}),l}})}let n=$l(()=>L$(t));Pt(e._zod,"propValues",()=>{let c=t.shape,l={};for(let u in c){let d=c[u]._zod;if(d.values){l[u]??(l[u]=new Set);for(let p of d.values)l[u].add(p)}}return l});let s=rc,a=t.catchall,o;e._zod.parse=(c,l)=>{o??(o=n.value);let u=c.value;if(!s(u))return c.issues.push({expected:"object",code:"invalid_type",input:u,inst:e}),c;c.value={};let d=[],p=o.shape;for(let f of o.keys){let h=p[f],m=h._zod.optout==="optional",g=h._zod.run({value:u[f],issues:[]},l);g instanceof Promise?d.push(g.then(y=>qm(y,c,f,u,m))):qm(g,c,f,u,m)}return a?F$(d,u,c,l,n.value,e):d.length?Promise.all(d).then(()=>c):c}}),B$=re("$ZodObjectJIT",(e,t)=>{j$.init(e,t);let r=e._zod.parse,n=$l(()=>L$(t)),s=f=>{let h=new Fm(["shape","payload","ctx"]),m=n.value,g=S=>{let w=Nm(S);return`shape[${w}]._zod.run({ value: input[${w}], issues: [] }, ctx)`};h.write("const input = payload.value;");let y=Object.create(null),_=0;for(let S of m.keys)y[S]=`key_${_++}`;h.write("const newResult = {};");for(let S of m.keys){let w=y[S],E=Nm(S),N=f[S]?._zod?.optout==="optional";h.write(`const ${w} = ${g(S)};`),N?h.write(`
|
|
219
|
+
`))}};var w$={major:4,minor:3,patch:6};var xt=re("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=w$;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let s of n)for(let a of s._zod.onattach)a(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let s=(o,c,l)=>{let u=to(o),d;for(let p of c){if(p._zod.def.when){if(!p._zod.def.when(o))continue}else if(u)continue;let f=o.issues.length,h=p._zod.check(o);if(h instanceof Promise&&l?.async===!1)throw new Os;if(d||h instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await h,o.issues.length!==f&&(u||(u=to(o,f)))});else{if(o.issues.length===f)continue;u||(u=to(o,f))}}return d?d.then(()=>o):o},a=(o,c,l)=>{if(to(o))return o.aborted=!0,o;let u=s(c,n,l);if(u instanceof Promise){if(l.async===!1)throw new Os;return u.then(d=>e._zod.parse(d,l))}return e._zod.parse(u,l)};e._zod.run=(o,c)=>{if(c.skipChecks)return e._zod.parse(o,c);if(c.direction==="backward"){let u=e._zod.parse({value:o.value,issues:[]},{...c,skipChecks:!0});return u instanceof Promise?u.then(d=>a(d,o,c)):a(u,o,c)}let l=e._zod.parse(o,c);if(l instanceof Promise){if(c.async===!1)throw new Os;return l.then(u=>s(u,n,c))}return s(l,n,c)}}Pt(e,"~standard",()=>({validate:s=>{try{let a=Dl(e,s);return a.success?{value:a.data}:{issues:a.error?.issues}}catch{return Qd(e,s).then(o=>o.success?{value:o.data}:{issues:o.error?.issues})}},vendor:"zod",version:1}))}),ic=re("$ZodString",(e,t)=>{xt.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Qx(e._zod.bag),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),hr=re("$ZodStringFormat",(e,t)=>{rp.init(e,t),ic.init(e,t)}),uS=re("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Bx),hr.init(e,t)}),dS=re("$ZodUUID",(e,t)=>{if(t.version){let n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(n===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=nc(n))}else t.pattern??(t.pattern=nc());hr.init(e,t)}),pS=re("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=zx),hr.init(e,t)}),fS=re("$ZodURL",(e,t)=>{hr.init(e,t),e._zod.check=r=>{try{let n=r.value.trim(),s=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(s.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(s.protocol.endsWith(":")?s.protocol.slice(0,-1):s.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=s.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),hS=re("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Ux()),hr.init(e,t)}),mS=re("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Fx),hr.init(e,t)}),gS=re("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=$x),hr.init(e,t)}),yS=re("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Rx),hr.init(e,t)}),_S=re("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Dx),hr.init(e,t)}),bS=re("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Mx),hr.init(e,t)}),vS=re("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Lx),hr.init(e,t)}),xS=re("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Xx(t)),hr.init(e,t)}),SS=re("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Jx),hr.init(e,t)}),TS=re("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Yx(t)),hr.init(e,t)}),wS=re("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=jx),hr.init(e,t)}),ES=re("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=qx),hr.init(e,t),e._zod.bag.format="ipv4"}),PS=re("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Wx),hr.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),IS=re("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=Vx(t.delimiter)),hr.init(e,t),e._zod.bag.format="mac"}),AS=re("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Kx),hr.init(e,t)}),kS=re("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Gx),hr.init(e,t),e._zod.check=r=>{let n=r.value.split("/");try{if(n.length!==2)throw new Error;let[s,a]=n;if(!a)throw new Error;let o=Number(a);if(`${o}`!==a)throw new Error;if(o<0||o>128)throw new Error;new URL(`http://[${s}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function M$(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var CS=re("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Zx),hr.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{M$(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function jK(e){if(!Mm.test(e))return!1;let t=e.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return M$(r)}var NS=re("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Mm),hr.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{jK(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),OS=re("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Hx),hr.init(e,t)});function BK(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[n]=r;if(!n)return!1;let s=JSON.parse(atob(n));return!("typ"in s&&s?.typ!=="JWT"||!s.alg||t&&(!("alg"in s)||s.alg!==t))}catch{return!1}}var $S=re("$ZodJWT",(e,t)=>{hr.init(e,t),e._zod.check=r=>{BK(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),RS=re("$ZodCustomStringFormat",(e,t)=>{hr.init(e,t),e._zod.check=r=>{t.fn(r.value)||r.issues.push({code:"invalid_format",format:t.format,input:r.value,inst:e,continue:!t.abort})}}),Wm=re("$ZodNumber",(e,t)=>{xt.init(e,t),e._zod.pattern=e._zod.bag.pattern??Lm,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let s=r.value;if(typeof s=="number"&&!Number.isNaN(s)&&Number.isFinite(s))return r;let a=typeof s=="number"?Number.isNaN(s)?"NaN":Number.isFinite(s)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:s,inst:e,...a?{received:a}:{}}),r}}),DS=re("$ZodNumberFormat",(e,t)=>{a$.init(e,t),Wm.init(e,t)}),np=re("$ZodBoolean",(e,t)=>{xt.init(e,t),e._zod.pattern=rS,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}let s=r.value;return typeof s=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:s,inst:e}),r}}),Vm=re("$ZodBigInt",(e,t)=>{xt.init(e,t),e._zod.pattern=eS,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}}),MS=re("$ZodBigIntFormat",(e,t)=>{o$.init(e,t),Vm.init(e,t)}),LS=re("$ZodSymbol",(e,t)=>{xt.init(e,t),e._zod.parse=(r,n)=>{let s=r.value;return typeof s=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:s,inst:e}),r}}),FS=re("$ZodUndefined",(e,t)=>{xt.init(e,t),e._zod.pattern=iS,e._zod.values=new Set([void 0]),e._zod.optin="optional",e._zod.optout="optional",e._zod.parse=(r,n)=>{let s=r.value;return typeof s>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:s,inst:e}),r}}),jS=re("$ZodNull",(e,t)=>{xt.init(e,t),e._zod.pattern=nS,e._zod.values=new Set([null]),e._zod.parse=(r,n)=>{let s=r.value;return s===null||r.issues.push({expected:"null",code:"invalid_type",input:s,inst:e}),r}}),BS=re("$ZodAny",(e,t)=>{xt.init(e,t),e._zod.parse=r=>r}),zS=re("$ZodUnknown",(e,t)=>{xt.init(e,t),e._zod.parse=r=>r}),US=re("$ZodNever",(e,t)=>{xt.init(e,t),e._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)}),qS=re("$ZodVoid",(e,t)=>{xt.init(e,t),e._zod.parse=(r,n)=>{let s=r.value;return typeof s>"u"||r.issues.push({expected:"void",code:"invalid_type",input:s,inst:e}),r}}),WS=re("$ZodDate",(e,t)=>{xt.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let s=r.value,a=s instanceof Date;return a&&!Number.isNaN(s.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:s,...a?{received:"Invalid Date"}:{},inst:e}),r}});function E$(e,t,r){e.issues.length&&t.issues.push(...Ti(r,e.issues)),t.value[r]=e.value}var VS=re("$ZodArray",(e,t)=>{xt.init(e,t),e._zod.parse=(r,n)=>{let s=r.value;if(!Array.isArray(s))return r.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),r;r.value=Array(s.length);let a=[];for(let o=0;o<s.length;o++){let c=s[o],l=t.element._zod.run({value:c,issues:[]},n);l instanceof Promise?a.push(l.then(u=>E$(u,r,o))):E$(l,r,o)}return a.length?Promise.all(a).then(()=>r):r}});function qm(e,t,r,n,s){if(e.issues.length){if(s&&!(r in n))return;t.issues.push(...Ti(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}function L$(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);let r=Cx(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function F$(e,t,r,n,s,a){let o=[],c=s.keySet,l=s.catchall._zod,u=l.def.type,d=l.optout==="optional";for(let p in t){if(c.has(p))continue;if(u==="never"){o.push(p);continue}let f=l.run({value:t[p],issues:[]},n);f instanceof Promise?e.push(f.then(h=>qm(h,r,p,t,d))):qm(f,r,p,t,d)}return o.length&&r.issues.push({code:"unrecognized_keys",keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>r):r}var j$=re("$ZodObject",(e,t)=>{if(xt.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let c=t.shape;Object.defineProperty(t,"shape",{get:()=>{let l={...c};return Object.defineProperty(t,"shape",{value:l}),l}})}let n=$l(()=>L$(t));Pt(e._zod,"propValues",()=>{let c=t.shape,l={};for(let u in c){let d=c[u]._zod;if(d.values){l[u]??(l[u]=new Set);for(let p of d.values)l[u].add(p)}}return l});let s=rc,a=t.catchall,o;e._zod.parse=(c,l)=>{o??(o=n.value);let u=c.value;if(!s(u))return c.issues.push({expected:"object",code:"invalid_type",input:u,inst:e}),c;c.value={};let d=[],p=o.shape;for(let f of o.keys){let h=p[f],m=h._zod.optout==="optional",g=h._zod.run({value:u[f],issues:[]},l);g instanceof Promise?d.push(g.then(y=>qm(y,c,f,u,m))):qm(g,c,f,u,m)}return a?F$(d,u,c,l,n.value,e):d.length?Promise.all(d).then(()=>c):c}}),B$=re("$ZodObjectJIT",(e,t)=>{j$.init(e,t);let r=e._zod.parse,n=$l(()=>L$(t)),s=f=>{let h=new Fm(["shape","payload","ctx"]),m=n.value,g=S=>{let w=Nm(S);return`shape[${w}]._zod.run({ value: input[${w}], issues: [] }, ctx)`};h.write("const input = payload.value;");let y=Object.create(null),_=0;for(let S of m.keys)y[S]=`key_${_++}`;h.write("const newResult = {};");for(let S of m.keys){let w=y[S],E=Nm(S),N=f[S]?._zod?.optout==="optional";h.write(`const ${w} = ${g(S)};`),N?h.write(`
|
|
220
220
|
if (${w}.issues.length) {
|
|
221
221
|
if (${E} in input) {
|
|
222
222
|
payload.issues = payload.issues.concat(${w}.issues.map(iss => ({
|
|
@@ -250,9 +250,9 @@ ${r}
|
|
|
250
250
|
newResult[${E}] = ${w}.value;
|
|
251
251
|
}
|
|
252
252
|
|
|
253
|
-
`)}h.write("payload.value = newResult;"),h.write("return payload;");let v=h.compile();return(S,w)=>v(f,S,w)},a,o=rc,c=!Cm.jitless,u=c&&Ix.value,d=t.catchall,p;e._zod.parse=(f,h)=>{p??(p=n.value);let m=f.value;return o(m)?c&&u&&h?.async===!1&&h.jitless!==!0?(a||(a=s(t.shape)),f=a(f,h),d?F$([],m,f,h,p,e):f):r(f,h):(f.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),f)}});function P$(e,t,r,n){for(let a of e)if(a.issues.length===0)return t.value=a.value,t;let s=e.filter(a=>!to(a));return s.length===1?(t.value=s[0].value,s[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(a=>a.issues.map(o=>si(o,n,ln())))}),t)}var ip=re("$ZodUnion",(e,t)=>{xt.init(e,t),Pt(e._zod,"optin",()=>t.options.some(s=>s._zod.optin==="optional")?"optional":void 0),Pt(e._zod,"optout",()=>t.options.some(s=>s._zod.optout==="optional")?"optional":void 0),Pt(e._zod,"values",()=>{if(t.options.every(s=>s._zod.values))return new Set(t.options.flatMap(s=>Array.from(s._zod.values)))}),Pt(e._zod,"pattern",()=>{if(t.options.every(s=>s._zod.pattern)){let s=t.options.map(a=>a._zod.pattern);return new RegExp(`^(${s.map(a=>Ud(a.source)).join("|")})$`)}});let r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(s,a)=>{if(r)return n(s,a);let o=!1,c=[];for(let l of t.options){let u=l._zod.run({value:s.value,issues:[]},a);if(u instanceof Promise)c.push(u),o=!0;else{if(u.issues.length===0)return u;c.push(u)}}return o?Promise.all(c).then(l=>P$(l,s,e,a)):P$(c,s,e,a)}});function I$(e,t,r,n){let s=e.filter(a=>a.issues.length===0);return s.length===1?(t.value=s[0].value,t):(s.length===0?t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(a=>a.issues.map(o=>si(o,n,ln())))}):t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:[],inclusive:!1}),t)}var KS=re("$ZodXor",(e,t)=>{ip.init(e,t),t.inclusive=!1;let r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(s,a)=>{if(r)return n(s,a);let o=!1,c=[];for(let l of t.options){let u=l._zod.run({value:s.value,issues:[]},a);u instanceof Promise?(c.push(u),o=!0):c.push(u)}return o?Promise.all(c).then(l=>I$(l,s,e,a)):I$(c,s,e,a)}}),GS=re("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,ip.init(e,t);let r=e._zod.parse;Pt(e._zod,"propValues",()=>{let s={};for(let a of t.options){let o=a._zod.propValues;if(!o||Object.keys(o).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(let[c,l]of Object.entries(o)){s[c]||(s[c]=new Set);for(let u of l)s[c].add(u)}}return s});let n=$l(()=>{let s=t.options,a=new Map;for(let o of s){let c=o._zod.propValues?.[t.discriminator];if(!c||c.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(o)}"`);for(let l of c){if(a.has(l))throw new Error(`Duplicate discriminator value "${String(l)}"`);a.set(l,o)}}return a});e._zod.parse=(s,a)=>{let o=s.value;if(!rc(o))return s.issues.push({code:"invalid_type",expected:"object",input:o,inst:e}),s;let c=n.value.get(o?.[t.discriminator]);return c?c._zod.run(s,a):t.unionFallback?r(s,a):(s.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:o,path:[t.discriminator],inst:e}),s)}}),ZS=re("$ZodIntersection",(e,t)=>{xt.init(e,t),e._zod.parse=(r,n)=>{let s=r.value,a=t.left._zod.run({value:s,issues:[]},n),o=t.right._zod.run({value:s,issues:[]},n);return a instanceof Promise||o instanceof Promise?Promise.all([a,o]).then(([l,u])=>A$(r,l,u)):A$(r,a,o)}});function lS(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(eo(e)&&eo(t)){let r=Object.keys(t),n=Object.keys(e).filter(a=>r.indexOf(a)!==-1),s={...e,...t};for(let a of n){let o=lS(e[a],t[a]);if(!o.valid)return{valid:!1,mergeErrorPath:[a,...o.mergeErrorPath]};s[a]=o.data}return{valid:!0,data:s}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let n=0;n<e.length;n++){let s=e[n],a=t[n],o=lS(s,a);if(!o.valid)return{valid:!1,mergeErrorPath:[n,...o.mergeErrorPath]};r.push(o.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function A$(e,t,r){let n=new Map,s;for(let c of t.issues)if(c.code==="unrecognized_keys"){s??(s=c);for(let l of c.keys)n.has(l)||n.set(l,{}),n.get(l).l=!0}else e.issues.push(c);for(let c of r.issues)if(c.code==="unrecognized_keys")for(let l of c.keys)n.has(l)||n.set(l,{}),n.get(l).r=!0;else e.issues.push(c);let a=[...n].filter(([,c])=>c.l&&c.r).map(([c])=>c);if(a.length&&s&&e.issues.push({...s,keys:a}),to(e))return e;let o=lS(t.value,r.value);if(!o.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var Km=re("$ZodTuple",(e,t)=>{xt.init(e,t);let r=t.items;e._zod.parse=(n,s)=>{let a=n.value;if(!Array.isArray(a))return n.issues.push({input:a,inst:e,expected:"tuple",code:"invalid_type"}),n;n.value=[];let o=[],c=[...r].reverse().findIndex(d=>d._zod.optin!=="optional"),l=c===-1?0:r.length-c;if(!t.rest){let d=a.length>r.length,p=a.length<l-1;if(d||p)return n.issues.push({...d?{code:"too_big",maximum:r.length,inclusive:!0}:{code:"too_small",minimum:r.length},input:a,inst:e,origin:"array"}),n}let u=-1;for(let d of r){if(u++,u>=a.length&&u>=l)continue;let p=d._zod.run({value:a[u],issues:[]},s);p instanceof Promise?o.push(p.then(f=>jm(f,n,u))):jm(p,n,u)}if(t.rest){let d=a.slice(r.length);for(let p of d){u++;let f=t.rest._zod.run({value:p,issues:[]},s);f instanceof Promise?o.push(f.then(h=>jm(h,n,u))):jm(f,n,u)}}return o.length?Promise.all(o).then(()=>n):n}});function jm(e,t,r){e.issues.length&&t.issues.push(...Ti(r,e.issues)),t.value[r]=e.value}var HS=re("$ZodRecord",(e,t)=>{xt.init(e,t),e._zod.parse=(r,n)=>{let s=r.value;if(!eo(s))return r.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),r;let a=[],o=t.keyType._zod.values;if(o){r.value={};let c=new Set;for(let u of o)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){c.add(typeof u=="number"?u.toString():u);let d=t.valueType._zod.run({value:s[u],issues:[]},n);d instanceof Promise?a.push(d.then(p=>{p.issues.length&&r.issues.push(...Ti(u,p.issues)),r.value[u]=p.value})):(d.issues.length&&r.issues.push(...Ti(u,d.issues)),r.value[u]=d.value)}let l;for(let u in s)c.has(u)||(l=l??[],l.push(u));l&&l.length>0&&r.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:l})}else{r.value={};for(let c of Reflect.ownKeys(s)){if(c==="__proto__")continue;let l=t.keyType._zod.run({value:c,issues:[]},n);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof c=="string"&&Lm.test(c)&&l.issues.length){let p=t.keyType._zod.run({value:Number(c),issues:[]},n);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");p.issues.length===0&&(l=p)}if(l.issues.length){t.mode==="loose"?r.value[c]=s[c]:r.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(p=>si(p,n,ln())),input:c,path:[c],inst:e});continue}let d=t.valueType._zod.run({value:s[c],issues:[]},n);d instanceof Promise?a.push(d.then(p=>{p.issues.length&&r.issues.push(...Ti(c,p.issues)),r.value[l.value]=p.value})):(d.issues.length&&r.issues.push(...Ti(c,d.issues)),r.value[l.value]=d.value)}}return a.length?Promise.all(a).then(()=>r):r}}),JS=re("$ZodMap",(e,t)=>{xt.init(e,t),e._zod.parse=(r,n)=>{let s=r.value;if(!(s instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:s,inst:e}),r;let a=[];r.value=new Map;for(let[o,c]of s){let l=t.keyType._zod.run({value:o,issues:[]},n),u=t.valueType._zod.run({value:c,issues:[]},n);l instanceof Promise||u instanceof Promise?a.push(Promise.all([l,u]).then(([d,p])=>{k$(d,p,r,o,s,e,n)})):k$(l,u,r,o,s,e,n)}return a.length?Promise.all(a).then(()=>r):r}});function k$(e,t,r,n,s,a,o){e.issues.length&&(qd.has(typeof n)?r.issues.push(...Ti(n,e.issues)):r.issues.push({code:"invalid_key",origin:"map",input:s,inst:a,issues:e.issues.map(c=>si(c,o,ln()))})),t.issues.length&&(qd.has(typeof n)?r.issues.push(...Ti(n,t.issues)):r.issues.push({origin:"map",code:"invalid_element",input:s,inst:a,key:n,issues:t.issues.map(c=>si(c,o,ln()))})),r.value.set(e.value,t.value)}var YS=re("$ZodSet",(e,t)=>{xt.init(e,t),e._zod.parse=(r,n)=>{let s=r.value;if(!(s instanceof Set))return r.issues.push({input:s,inst:e,expected:"set",code:"invalid_type"}),r;let a=[];r.value=new Set;for(let o of s){let c=t.valueType._zod.run({value:o,issues:[]},n);c instanceof Promise?a.push(c.then(l=>C$(l,r))):C$(c,r)}return a.length?Promise.all(a).then(()=>r):r}});function C$(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}var XS=re("$ZodEnum",(e,t)=>{xt.init(e,t);let r=zd(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(s=>qd.has(typeof s)).map(s=>typeof s=="string"?Di(s):s.toString()).join("|")})$`),e._zod.parse=(s,a)=>{let o=s.value;return n.has(o)||s.issues.push({code:"invalid_value",values:r,input:o,inst:e}),s}}),QS=re("$ZodLiteral",(e,t)=>{if(xt.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?Di(n):n?Di(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,s)=>{let a=n.value;return r.has(a)||n.issues.push({code:"invalid_value",values:t.values,input:a,inst:e}),n}}),eT=re("$ZodFile",(e,t)=>{xt.init(e,t),e._zod.parse=(r,n)=>{let s=r.value;return s instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:s,inst:e}),r}}),tT=re("$ZodTransform",(e,t)=>{xt.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new tc(e.constructor.name);let s=t.transform(r.value,r);if(n.async)return(s instanceof Promise?s:Promise.resolve(s)).then(o=>(r.value=o,r));if(s instanceof Promise)throw new Os;return r.value=s,r}});function N$(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}var Gm=re("$ZodOptional",(e,t)=>{xt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Pt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Pt(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Ud(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){let s=t.innerType._zod.run(r,n);return s instanceof Promise?s.then(a=>N$(a,r.value)):N$(s,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}}),rT=re("$ZodExactOptional",(e,t)=>{Gm.init(e,t),Pt(e._zod,"values",()=>t.innerType._zod.values),Pt(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(r,n)=>t.innerType._zod.run(r,n)}),nT=re("$ZodNullable",(e,t)=>{xt.init(e,t),Pt(e._zod,"optin",()=>t.innerType._zod.optin),Pt(e._zod,"optout",()=>t.innerType._zod.optout),Pt(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Ud(r.source)}|null)$`):void 0}),Pt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)}),iT=re("$ZodDefault",(e,t)=>{xt.init(e,t),e._zod.optin="optional",Pt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);if(r.value===void 0)return r.value=t.defaultValue,r;let s=t.innerType._zod.run(r,n);return s instanceof Promise?s.then(a=>O$(a,t)):O$(s,t)}});function O$(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var sT=re("$ZodPrefault",(e,t)=>{xt.init(e,t),e._zod.optin="optional",Pt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>(n.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,n))}),aT=re("$ZodNonOptional",(e,t)=>{xt.init(e,t),Pt(e._zod,"values",()=>{let r=t.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),e._zod.parse=(r,n)=>{let s=t.innerType._zod.run(r,n);return s instanceof Promise?s.then(a=>$$(a,e)):$$(s,e)}});function $$(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}var oT=re("$ZodSuccess",(e,t)=>{xt.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new tc("ZodSuccess");let s=t.innerType._zod.run(r,n);return s instanceof Promise?s.then(a=>(r.value=a.issues.length===0,r)):(r.value=s.issues.length===0,r)}}),cT=re("$ZodCatch",(e,t)=>{xt.init(e,t),Pt(e._zod,"optin",()=>t.innerType._zod.optin),Pt(e._zod,"optout",()=>t.innerType._zod.optout),Pt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);let s=t.innerType._zod.run(r,n);return s instanceof Promise?s.then(a=>(r.value=a.value,a.issues.length&&(r.value=t.catchValue({...r,error:{issues:a.issues.map(o=>si(o,n,ln()))},input:r.value}),r.issues=[]),r)):(r.value=s.value,s.issues.length&&(r.value=t.catchValue({...r,error:{issues:s.issues.map(a=>si(a,n,ln()))},input:r.value}),r.issues=[]),r)}}),lT=re("$ZodNaN",(e,t)=>{xt.init(e,t),e._zod.parse=(r,n)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:e,expected:"nan",code:"invalid_type"}),r)}),uT=re("$ZodPipe",(e,t)=>{xt.init(e,t),Pt(e._zod,"values",()=>t.in._zod.values),Pt(e._zod,"optin",()=>t.in._zod.optin),Pt(e._zod,"optout",()=>t.out._zod.optout),Pt(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let a=t.out._zod.run(r,n);return a instanceof Promise?a.then(o=>Bm(o,t.in,n)):Bm(a,t.in,n)}let s=t.in._zod.run(r,n);return s instanceof Promise?s.then(a=>Bm(a,t.out,n)):Bm(s,t.out,n)}});function Bm(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}var sp=re("$ZodCodec",(e,t)=>{xt.init(e,t),Pt(e._zod,"values",()=>t.in._zod.values),Pt(e._zod,"optin",()=>t.in._zod.optin),Pt(e._zod,"optout",()=>t.out._zod.optout),Pt(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if((n.direction||"forward")==="forward"){let a=t.in._zod.run(r,n);return a instanceof Promise?a.then(o=>zm(o,t,n)):zm(a,t,n)}else{let a=t.out._zod.run(r,n);return a instanceof Promise?a.then(o=>zm(o,t,n)):zm(a,t,n)}}});function zm(e,t,r){if(e.issues.length)return e.aborted=!0,e;if((r.direction||"forward")==="forward"){let s=t.transform(e.value,e);return s instanceof Promise?s.then(a=>Um(e,a,t.out,r)):Um(e,s,t.out,r)}else{let s=t.reverseTransform(e.value,e);return s instanceof Promise?s.then(a=>Um(e,a,t.in,r)):Um(e,s,t.in,r)}}function Um(e,t,r,n){return e.issues.length?(e.aborted=!0,e):r._zod.run({value:t,issues:e.issues},n)}var dT=re("$ZodReadonly",(e,t)=>{xt.init(e,t),Pt(e._zod,"propValues",()=>t.innerType._zod.propValues),Pt(e._zod,"values",()=>t.innerType._zod.values),Pt(e._zod,"optin",()=>t.innerType?._zod?.optin),Pt(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);let s=t.innerType._zod.run(r,n);return s instanceof Promise?s.then(R$):R$(s)}});function R$(e){return e.value=Object.freeze(e.value),e}var pT=re("$ZodTemplateLiteral",(e,t)=>{xt.init(e,t);let r=[];for(let n of t.parts)if(typeof n=="object"&&n!==null){if(!n._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...n._zod.traits].shift()}`);let s=n._zod.pattern instanceof RegExp?n._zod.pattern.source:n._zod.pattern;if(!s)throw new Error(`Invalid template literal part: ${n._zod.traits}`);let a=s.startsWith("^")?1:0,o=s.endsWith("$")?s.length-1:s.length;r.push(s.slice(a,o))}else if(n===null||kx.has(typeof n))r.push(Di(`${n}`));else throw new Error(`Invalid template literal part: ${n}`);e._zod.pattern=new RegExp(`^${r.join("")}$`),e._zod.parse=(n,s)=>typeof n.value!="string"?(n.issues.push({input:n.value,inst:e,expected:"string",code:"invalid_type"}),n):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(n.value)||n.issues.push({input:n.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),n)}),fT=re("$ZodFunction",(e,t)=>(xt.init(e,t),e._def=t,e._zod.def=t,e.implement=r=>{if(typeof r!="function")throw new Error("implement() must be called with a function");return function(...n){let s=e._def.input?Zd(e._def.input,n):n,a=Reflect.apply(r,this,s);return e._def.output?Zd(e._def.output,a):a}},e.implementAsync=r=>{if(typeof r!="function")throw new Error("implementAsync() must be called with a function");return async function(...n){let s=e._def.input?await Jd(e._def.input,n):n,a=await Reflect.apply(r,this,s);return e._def.output?await Jd(e._def.output,a):a}},e._zod.parse=(r,n)=>typeof r.value!="function"?(r.issues.push({code:"invalid_type",expected:"function",input:r.value,inst:e}),r):(e._def.output&&e._def.output._zod.def.type==="promise"?r.value=e.implementAsync(r.value):r.value=e.implement(r.value),r),e.input=(...r)=>{let n=e.constructor;return Array.isArray(r[0])?new n({type:"function",input:new Km({type:"tuple",items:r[0],rest:r[1]}),output:e._def.output}):new n({type:"function",input:r[0],output:e._def.output})},e.output=r=>{let n=e.constructor;return new n({type:"function",input:e._def.input,output:r})},e)),hT=re("$ZodPromise",(e,t)=>{xt.init(e,t),e._zod.parse=(r,n)=>Promise.resolve(r.value).then(s=>t.innerType._zod.run({value:s,issues:[]},n))}),mT=re("$ZodLazy",(e,t)=>{xt.init(e,t),Pt(e._zod,"innerType",()=>t.getter()),Pt(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),Pt(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),Pt(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),Pt(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(r,n)=>e._zod.innerType._zod.run(r,n)}),gT=re("$ZodCustom",(e,t)=>{yr.init(e,t),xt.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,s=t.fn(n);if(s instanceof Promise)return s.then(a=>D$(a,r,n,e));D$(s,r,n,e)}});function D$(e,t,r,n){if(!e){let s={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(s.params=n._zod.def.params),t.issues.push(Rl(s))}}var UK=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(s){return e[s]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},n={nan:"NaN"};return s=>{switch(s.code){case"invalid_type":{let a=n[s.expected]??s.expected,o=yt(s.input),c=n[o]??o;return`Invalid input: expected ${a}, received ${c}`}case"invalid_value":return s.values.length===1?`Invalid input: expected ${ft(s.values[0])}`:`Invalid option: expected one of ${pt(s.values,"|")}`;case"too_big":{let a=s.inclusive?"<=":"<",o=t(s.origin);return o?`Too big: expected ${s.origin??"value"} to have ${a}${s.maximum.toString()} ${o.unit??"elements"}`:`Too big: expected ${s.origin??"value"} to be ${a}${s.maximum.toString()}`}case"too_small":{let a=s.inclusive?">=":">",o=t(s.origin);return o?`Too small: expected ${s.origin} to have ${a}${s.minimum.toString()} ${o.unit}`:`Too small: expected ${s.origin} to be ${a}${s.minimum.toString()}`}case"invalid_format":{let a=s;return a.format==="starts_with"?`Invalid string: must start with "${a.prefix}"`:a.format==="ends_with"?`Invalid string: must end with "${a.suffix}"`:a.format==="includes"?`Invalid string: must include "${a.includes}"`:a.format==="regex"?`Invalid string: must match pattern ${a.pattern}`:`Invalid ${r[a.format]??s.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${s.divisor}`;case"unrecognized_keys":return`Unrecognized key${s.keys.length>1?"s":""}: ${pt(s.keys,", ")}`;case"invalid_key":return`Invalid key in ${s.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${s.origin}`;default:return"Invalid input"}}};function yT(){return{localeError:UK()}}var z$,U$=Symbol("ZodOutput"),q$=Symbol("ZodInput"),bT=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let n=r[0];return this._map.set(t,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let n={...this.get(r)??{}};delete n.id;let s={...n,...this._map.get(t)};return Object.keys(s).length?s:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function vT(){return new bT}(z$=globalThis).__zod_globalRegistry??(z$.__zod_globalRegistry=vT());var Wn=globalThis.__zod_globalRegistry;function xT(e,t){return new e({type:"string",...Re(t)})}function Zm(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Re(t)})}function ap(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Re(t)})}function Hm(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Re(t)})}function Jm(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Re(t)})}function Ym(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Re(t)})}function Xm(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Re(t)})}function op(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Re(t)})}function Qm(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Re(t)})}function eg(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Re(t)})}function tg(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Re(t)})}function rg(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Re(t)})}function ng(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Re(t)})}function ig(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Re(t)})}function sg(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Re(t)})}function ag(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Re(t)})}function og(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Re(t)})}function ST(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...Re(t)})}function cg(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Re(t)})}function lg(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Re(t)})}function ug(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Re(t)})}function dg(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Re(t)})}function pg(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Re(t)})}function fg(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Re(t)})}function TT(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Re(t)})}function wT(e,t){return new e({type:"string",format:"date",check:"string_format",...Re(t)})}function ET(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Re(t)})}function PT(e,t){return new e({type:"string",format:"duration",check:"string_format",...Re(t)})}function IT(e,t){return new e({type:"number",checks:[],...Re(t)})}function AT(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Re(t)})}function kT(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...Re(t)})}function CT(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...Re(t)})}function NT(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...Re(t)})}function OT(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...Re(t)})}function $T(e,t){return new e({type:"boolean",...Re(t)})}function RT(e,t){return new e({type:"bigint",...Re(t)})}function DT(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...Re(t)})}function MT(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...Re(t)})}function LT(e,t){return new e({type:"symbol",...Re(t)})}function FT(e,t){return new e({type:"undefined",...Re(t)})}function jT(e,t){return new e({type:"null",...Re(t)})}function BT(e){return new e({type:"any"})}function zT(e){return new e({type:"unknown"})}function UT(e,t){return new e({type:"never",...Re(t)})}function qT(e,t){return new e({type:"void",...Re(t)})}function WT(e,t){return new e({type:"date",...Re(t)})}function VT(e,t){return new e({type:"nan",...Re(t)})}function ua(e,t){return new oS({check:"less_than",...Re(t),value:e,inclusive:!1})}function wi(e,t){return new oS({check:"less_than",...Re(t),value:e,inclusive:!0})}function da(e,t){return new cS({check:"greater_than",...Re(t),value:e,inclusive:!1})}function Vn(e,t){return new cS({check:"greater_than",...Re(t),value:e,inclusive:!0})}function KT(e){return da(0,e)}function GT(e){return ua(0,e)}function ZT(e){return wi(0,e)}function HT(e){return Vn(0,e)}function sc(e,t){return new s$({check:"multiple_of",...Re(t),value:e})}function ac(e,t){return new c$({check:"max_size",...Re(t),maximum:e})}function pa(e,t){return new l$({check:"min_size",...Re(t),minimum:e})}function Ml(e,t){return new u$({check:"size_equals",...Re(t),size:e})}function Ll(e,t){return new d$({check:"max_length",...Re(t),maximum:e})}function ro(e,t){return new p$({check:"min_length",...Re(t),minimum:e})}function Fl(e,t){return new f$({check:"length_equals",...Re(t),length:e})}function cp(e,t){return new h$({check:"string_format",format:"regex",...Re(t),pattern:e})}function lp(e){return new m$({check:"string_format",format:"lowercase",...Re(e)})}function up(e){return new g$({check:"string_format",format:"uppercase",...Re(e)})}function dp(e,t){return new y$({check:"string_format",format:"includes",...Re(t),includes:e})}function pp(e,t){return new _$({check:"string_format",format:"starts_with",...Re(t),prefix:e})}function fp(e,t){return new b$({check:"string_format",format:"ends_with",...Re(t),suffix:e})}function JT(e,t,r){return new v$({check:"property",property:e,schema:t,...Re(r)})}function hp(e,t){return new x$({check:"mime_type",mime:e,...Re(t)})}function $s(e){return new S$({check:"overwrite",tx:e})}function mp(e){return $s(t=>t.normalize(e))}function gp(){return $s(e=>e.trim())}function yp(){return $s(e=>e.toLowerCase())}function _p(){return $s(e=>e.toUpperCase())}function hg(){return $s(e=>Px(e))}function W$(e,t,r){return new e({type:"array",element:t,...Re(r)})}function YT(e,t){return new e({type:"file",...Re(t)})}function XT(e,t,r){let n=Re(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}function QT(e,t,r){return new e({type:"custom",check:"custom",fn:t,...Re(r)})}function ew(e){let t=KK(r=>(r.addIssue=n=>{if(typeof n=="string")r.issues.push(Rl(n,r.value,t._zod.def));else{let s=n;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=t),s.continue??(s.continue=!t._zod.def.abort),r.issues.push(Rl(s))}},e(r.value,r)));return t}function KK(e,t){let r=new yr({check:"custom",...Re(t)});return r._zod.check=e,r}function tw(e){let t=new yr({check:"describe"});return t._zod.onattach=[r=>{let n=Wn.get(r)??{};Wn.add(r,{...n,description:e})}],t._zod.check=()=>{},t}function rw(e){let t=new yr({check:"meta"});return t._zod.onattach=[r=>{let n=Wn.get(r)??{};Wn.add(r,{...n,...e})}],t._zod.check=()=>{},t}function nw(e,t){let r=Re(t),n=r.truthy??["true","1","yes","on","y","enabled"],s=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(n=n.map(h=>typeof h=="string"?h.toLowerCase():h),s=s.map(h=>typeof h=="string"?h.toLowerCase():h));let a=new Set(n),o=new Set(s),c=e.Codec??sp,l=e.Boolean??np,u=e.String??ic,d=new u({type:"string",error:r.error}),p=new l({type:"boolean",error:r.error}),f=new c({type:"pipe",in:d,out:p,transform:(h,m)=>{let g=h;return r.case!=="sensitive"&&(g=g.toLowerCase()),a.has(g)?!0:o.has(g)?!1:(m.issues.push({code:"invalid_value",expected:"stringbool",values:[...a,...o],input:m.value,inst:f,continue:!1}),{})},reverseTransform:(h,m)=>h===!0?n[0]||"true":s[0]||"false",error:r.error});return f}function jl(e,t,r,n={}){let s=Re(n),a={...Re(n),check:"string_format",type:"string",format:t,fn:typeof r=="function"?r:c=>r.test(c),...s};return r instanceof RegExp&&(a.pattern=r),new e(a)}function mg(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Wn,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function Tr(e,t,r={path:[],schemaPath:[]}){var n;let s=e._zod.def,a=t.seen.get(e);if(a)return a.count++,r.schemaPath.includes(e)&&(a.cycle=r.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,o);let c=e._zod.toJSONSchema?.();if(c)o.schema=c;else{let d={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,d);else{let f=o.schema,h=t.processors[s.type];if(!h)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);h(e,t,f,d)}let p=e._zod.parent;p&&(o.ref||(o.ref=p),Tr(p,t,d),t.seen.get(p).isParent=!0)}let l=t.metadataRegistry.get(e);return l&&Object.assign(o.schema,l),t.io==="input"&&Kn(e)&&(delete o.schema.examples,delete o.schema.default),t.io==="input"&&o.schema._prefault&&((n=o.schema).default??(n.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function gg(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let n=new Map;for(let o of e.seen.entries()){let c=e.metadataRegistry.get(o[0])?.id;if(c){let l=n.get(c);if(l&&l!==o[0])throw new Error(`Duplicate schema id "${c}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(c,o[0])}}let s=o=>{let c=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let p=e.external.registry.get(o[0])?.id,f=e.external.uri??(m=>m);if(p)return{ref:f(p)};let h=o[1].defId??o[1].schema.id??`schema${e.counter++}`;return o[1].defId=h,{defId:h,ref:`${f("__shared")}#/${c}/${h}`}}if(o[1]===r)return{ref:"#"};let u=`#/${c}/`,d=o[1].schema.id??`__schema${e.counter++}`;return{defId:d,ref:u+d}},a=o=>{if(o[1].schema.$ref)return;let c=o[1],{ref:l,defId:u}=s(o);c.def={...c.schema},u&&(c.defId=u);let d=c.schema;for(let p in d)delete d[p];d.$ref=l};if(e.cycles==="throw")for(let o of e.seen.entries()){let c=o[1];if(c.cycle)throw new Error(`Cycle detected: #/${c.cycle?.join("/")}/<root>
|
|
253
|
+
`)}h.write("payload.value = newResult;"),h.write("return payload;");let v=h.compile();return(S,w)=>v(f,S,w)},a,o=rc,c=!Cm.jitless,u=c&&Ix.value,d=t.catchall,p;e._zod.parse=(f,h)=>{p??(p=n.value);let m=f.value;return o(m)?c&&u&&h?.async===!1&&h.jitless!==!0?(a||(a=s(t.shape)),f=a(f,h),d?F$([],m,f,h,p,e):f):r(f,h):(f.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),f)}});function P$(e,t,r,n){for(let a of e)if(a.issues.length===0)return t.value=a.value,t;let s=e.filter(a=>!to(a));return s.length===1?(t.value=s[0].value,s[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(a=>a.issues.map(o=>si(o,n,ln())))}),t)}var ip=re("$ZodUnion",(e,t)=>{xt.init(e,t),Pt(e._zod,"optin",()=>t.options.some(s=>s._zod.optin==="optional")?"optional":void 0),Pt(e._zod,"optout",()=>t.options.some(s=>s._zod.optout==="optional")?"optional":void 0),Pt(e._zod,"values",()=>{if(t.options.every(s=>s._zod.values))return new Set(t.options.flatMap(s=>Array.from(s._zod.values)))}),Pt(e._zod,"pattern",()=>{if(t.options.every(s=>s._zod.pattern)){let s=t.options.map(a=>a._zod.pattern);return new RegExp(`^(${s.map(a=>Ud(a.source)).join("|")})$`)}});let r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(s,a)=>{if(r)return n(s,a);let o=!1,c=[];for(let l of t.options){let u=l._zod.run({value:s.value,issues:[]},a);if(u instanceof Promise)c.push(u),o=!0;else{if(u.issues.length===0)return u;c.push(u)}}return o?Promise.all(c).then(l=>P$(l,s,e,a)):P$(c,s,e,a)}});function I$(e,t,r,n){let s=e.filter(a=>a.issues.length===0);return s.length===1?(t.value=s[0].value,t):(s.length===0?t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(a=>a.issues.map(o=>si(o,n,ln())))}):t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:[],inclusive:!1}),t)}var KS=re("$ZodXor",(e,t)=>{ip.init(e,t),t.inclusive=!1;let r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(s,a)=>{if(r)return n(s,a);let o=!1,c=[];for(let l of t.options){let u=l._zod.run({value:s.value,issues:[]},a);u instanceof Promise?(c.push(u),o=!0):c.push(u)}return o?Promise.all(c).then(l=>I$(l,s,e,a)):I$(c,s,e,a)}}),GS=re("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,ip.init(e,t);let r=e._zod.parse;Pt(e._zod,"propValues",()=>{let s={};for(let a of t.options){let o=a._zod.propValues;if(!o||Object.keys(o).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(let[c,l]of Object.entries(o)){s[c]||(s[c]=new Set);for(let u of l)s[c].add(u)}}return s});let n=$l(()=>{let s=t.options,a=new Map;for(let o of s){let c=o._zod.propValues?.[t.discriminator];if(!c||c.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(o)}"`);for(let l of c){if(a.has(l))throw new Error(`Duplicate discriminator value "${String(l)}"`);a.set(l,o)}}return a});e._zod.parse=(s,a)=>{let o=s.value;if(!rc(o))return s.issues.push({code:"invalid_type",expected:"object",input:o,inst:e}),s;let c=n.value.get(o?.[t.discriminator]);return c?c._zod.run(s,a):t.unionFallback?r(s,a):(s.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:o,path:[t.discriminator],inst:e}),s)}}),ZS=re("$ZodIntersection",(e,t)=>{xt.init(e,t),e._zod.parse=(r,n)=>{let s=r.value,a=t.left._zod.run({value:s,issues:[]},n),o=t.right._zod.run({value:s,issues:[]},n);return a instanceof Promise||o instanceof Promise?Promise.all([a,o]).then(([l,u])=>A$(r,l,u)):A$(r,a,o)}});function lS(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(eo(e)&&eo(t)){let r=Object.keys(t),n=Object.keys(e).filter(a=>r.indexOf(a)!==-1),s={...e,...t};for(let a of n){let o=lS(e[a],t[a]);if(!o.valid)return{valid:!1,mergeErrorPath:[a,...o.mergeErrorPath]};s[a]=o.data}return{valid:!0,data:s}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let n=0;n<e.length;n++){let s=e[n],a=t[n],o=lS(s,a);if(!o.valid)return{valid:!1,mergeErrorPath:[n,...o.mergeErrorPath]};r.push(o.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function A$(e,t,r){let n=new Map,s;for(let c of t.issues)if(c.code==="unrecognized_keys"){s??(s=c);for(let l of c.keys)n.has(l)||n.set(l,{}),n.get(l).l=!0}else e.issues.push(c);for(let c of r.issues)if(c.code==="unrecognized_keys")for(let l of c.keys)n.has(l)||n.set(l,{}),n.get(l).r=!0;else e.issues.push(c);let a=[...n].filter(([,c])=>c.l&&c.r).map(([c])=>c);if(a.length&&s&&e.issues.push({...s,keys:a}),to(e))return e;let o=lS(t.value,r.value);if(!o.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var Km=re("$ZodTuple",(e,t)=>{xt.init(e,t);let r=t.items;e._zod.parse=(n,s)=>{let a=n.value;if(!Array.isArray(a))return n.issues.push({input:a,inst:e,expected:"tuple",code:"invalid_type"}),n;n.value=[];let o=[],c=[...r].reverse().findIndex(d=>d._zod.optin!=="optional"),l=c===-1?0:r.length-c;if(!t.rest){let d=a.length>r.length,p=a.length<l-1;if(d||p)return n.issues.push({...d?{code:"too_big",maximum:r.length,inclusive:!0}:{code:"too_small",minimum:r.length},input:a,inst:e,origin:"array"}),n}let u=-1;for(let d of r){if(u++,u>=a.length&&u>=l)continue;let p=d._zod.run({value:a[u],issues:[]},s);p instanceof Promise?o.push(p.then(f=>jm(f,n,u))):jm(p,n,u)}if(t.rest){let d=a.slice(r.length);for(let p of d){u++;let f=t.rest._zod.run({value:p,issues:[]},s);f instanceof Promise?o.push(f.then(h=>jm(h,n,u))):jm(f,n,u)}}return o.length?Promise.all(o).then(()=>n):n}});function jm(e,t,r){e.issues.length&&t.issues.push(...Ti(r,e.issues)),t.value[r]=e.value}var HS=re("$ZodRecord",(e,t)=>{xt.init(e,t),e._zod.parse=(r,n)=>{let s=r.value;if(!eo(s))return r.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),r;let a=[],o=t.keyType._zod.values;if(o){r.value={};let c=new Set;for(let u of o)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){c.add(typeof u=="number"?u.toString():u);let d=t.valueType._zod.run({value:s[u],issues:[]},n);d instanceof Promise?a.push(d.then(p=>{p.issues.length&&r.issues.push(...Ti(u,p.issues)),r.value[u]=p.value})):(d.issues.length&&r.issues.push(...Ti(u,d.issues)),r.value[u]=d.value)}let l;for(let u in s)c.has(u)||(l=l??[],l.push(u));l&&l.length>0&&r.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:l})}else{r.value={};for(let c of Reflect.ownKeys(s)){if(c==="__proto__")continue;let l=t.keyType._zod.run({value:c,issues:[]},n);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof c=="string"&&Lm.test(c)&&l.issues.length){let p=t.keyType._zod.run({value:Number(c),issues:[]},n);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");p.issues.length===0&&(l=p)}if(l.issues.length){t.mode==="loose"?r.value[c]=s[c]:r.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(p=>si(p,n,ln())),input:c,path:[c],inst:e});continue}let d=t.valueType._zod.run({value:s[c],issues:[]},n);d instanceof Promise?a.push(d.then(p=>{p.issues.length&&r.issues.push(...Ti(c,p.issues)),r.value[l.value]=p.value})):(d.issues.length&&r.issues.push(...Ti(c,d.issues)),r.value[l.value]=d.value)}}return a.length?Promise.all(a).then(()=>r):r}}),JS=re("$ZodMap",(e,t)=>{xt.init(e,t),e._zod.parse=(r,n)=>{let s=r.value;if(!(s instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:s,inst:e}),r;let a=[];r.value=new Map;for(let[o,c]of s){let l=t.keyType._zod.run({value:o,issues:[]},n),u=t.valueType._zod.run({value:c,issues:[]},n);l instanceof Promise||u instanceof Promise?a.push(Promise.all([l,u]).then(([d,p])=>{k$(d,p,r,o,s,e,n)})):k$(l,u,r,o,s,e,n)}return a.length?Promise.all(a).then(()=>r):r}});function k$(e,t,r,n,s,a,o){e.issues.length&&(qd.has(typeof n)?r.issues.push(...Ti(n,e.issues)):r.issues.push({code:"invalid_key",origin:"map",input:s,inst:a,issues:e.issues.map(c=>si(c,o,ln()))})),t.issues.length&&(qd.has(typeof n)?r.issues.push(...Ti(n,t.issues)):r.issues.push({origin:"map",code:"invalid_element",input:s,inst:a,key:n,issues:t.issues.map(c=>si(c,o,ln()))})),r.value.set(e.value,t.value)}var YS=re("$ZodSet",(e,t)=>{xt.init(e,t),e._zod.parse=(r,n)=>{let s=r.value;if(!(s instanceof Set))return r.issues.push({input:s,inst:e,expected:"set",code:"invalid_type"}),r;let a=[];r.value=new Set;for(let o of s){let c=t.valueType._zod.run({value:o,issues:[]},n);c instanceof Promise?a.push(c.then(l=>C$(l,r))):C$(c,r)}return a.length?Promise.all(a).then(()=>r):r}});function C$(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}var XS=re("$ZodEnum",(e,t)=>{xt.init(e,t);let r=zd(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(s=>qd.has(typeof s)).map(s=>typeof s=="string"?Di(s):s.toString()).join("|")})$`),e._zod.parse=(s,a)=>{let o=s.value;return n.has(o)||s.issues.push({code:"invalid_value",values:r,input:o,inst:e}),s}}),QS=re("$ZodLiteral",(e,t)=>{if(xt.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?Di(n):n?Di(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,s)=>{let a=n.value;return r.has(a)||n.issues.push({code:"invalid_value",values:t.values,input:a,inst:e}),n}}),eT=re("$ZodFile",(e,t)=>{xt.init(e,t),e._zod.parse=(r,n)=>{let s=r.value;return s instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:s,inst:e}),r}}),tT=re("$ZodTransform",(e,t)=>{xt.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new tc(e.constructor.name);let s=t.transform(r.value,r);if(n.async)return(s instanceof Promise?s:Promise.resolve(s)).then(o=>(r.value=o,r));if(s instanceof Promise)throw new Os;return r.value=s,r}});function N$(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}var Gm=re("$ZodOptional",(e,t)=>{xt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Pt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Pt(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Ud(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){let s=t.innerType._zod.run(r,n);return s instanceof Promise?s.then(a=>N$(a,r.value)):N$(s,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}}),rT=re("$ZodExactOptional",(e,t)=>{Gm.init(e,t),Pt(e._zod,"values",()=>t.innerType._zod.values),Pt(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(r,n)=>t.innerType._zod.run(r,n)}),nT=re("$ZodNullable",(e,t)=>{xt.init(e,t),Pt(e._zod,"optin",()=>t.innerType._zod.optin),Pt(e._zod,"optout",()=>t.innerType._zod.optout),Pt(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Ud(r.source)}|null)$`):void 0}),Pt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)}),iT=re("$ZodDefault",(e,t)=>{xt.init(e,t),e._zod.optin="optional",Pt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);if(r.value===void 0)return r.value=t.defaultValue,r;let s=t.innerType._zod.run(r,n);return s instanceof Promise?s.then(a=>O$(a,t)):O$(s,t)}});function O$(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var sT=re("$ZodPrefault",(e,t)=>{xt.init(e,t),e._zod.optin="optional",Pt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>(n.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,n))}),aT=re("$ZodNonOptional",(e,t)=>{xt.init(e,t),Pt(e._zod,"values",()=>{let r=t.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),e._zod.parse=(r,n)=>{let s=t.innerType._zod.run(r,n);return s instanceof Promise?s.then(a=>$$(a,e)):$$(s,e)}});function $$(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}var oT=re("$ZodSuccess",(e,t)=>{xt.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new tc("ZodSuccess");let s=t.innerType._zod.run(r,n);return s instanceof Promise?s.then(a=>(r.value=a.issues.length===0,r)):(r.value=s.issues.length===0,r)}}),cT=re("$ZodCatch",(e,t)=>{xt.init(e,t),Pt(e._zod,"optin",()=>t.innerType._zod.optin),Pt(e._zod,"optout",()=>t.innerType._zod.optout),Pt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);let s=t.innerType._zod.run(r,n);return s instanceof Promise?s.then(a=>(r.value=a.value,a.issues.length&&(r.value=t.catchValue({...r,error:{issues:a.issues.map(o=>si(o,n,ln()))},input:r.value}),r.issues=[]),r)):(r.value=s.value,s.issues.length&&(r.value=t.catchValue({...r,error:{issues:s.issues.map(a=>si(a,n,ln()))},input:r.value}),r.issues=[]),r)}}),lT=re("$ZodNaN",(e,t)=>{xt.init(e,t),e._zod.parse=(r,n)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:e,expected:"nan",code:"invalid_type"}),r)}),uT=re("$ZodPipe",(e,t)=>{xt.init(e,t),Pt(e._zod,"values",()=>t.in._zod.values),Pt(e._zod,"optin",()=>t.in._zod.optin),Pt(e._zod,"optout",()=>t.out._zod.optout),Pt(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let a=t.out._zod.run(r,n);return a instanceof Promise?a.then(o=>Bm(o,t.in,n)):Bm(a,t.in,n)}let s=t.in._zod.run(r,n);return s instanceof Promise?s.then(a=>Bm(a,t.out,n)):Bm(s,t.out,n)}});function Bm(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}var sp=re("$ZodCodec",(e,t)=>{xt.init(e,t),Pt(e._zod,"values",()=>t.in._zod.values),Pt(e._zod,"optin",()=>t.in._zod.optin),Pt(e._zod,"optout",()=>t.out._zod.optout),Pt(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if((n.direction||"forward")==="forward"){let a=t.in._zod.run(r,n);return a instanceof Promise?a.then(o=>zm(o,t,n)):zm(a,t,n)}else{let a=t.out._zod.run(r,n);return a instanceof Promise?a.then(o=>zm(o,t,n)):zm(a,t,n)}}});function zm(e,t,r){if(e.issues.length)return e.aborted=!0,e;if((r.direction||"forward")==="forward"){let s=t.transform(e.value,e);return s instanceof Promise?s.then(a=>Um(e,a,t.out,r)):Um(e,s,t.out,r)}else{let s=t.reverseTransform(e.value,e);return s instanceof Promise?s.then(a=>Um(e,a,t.in,r)):Um(e,s,t.in,r)}}function Um(e,t,r,n){return e.issues.length?(e.aborted=!0,e):r._zod.run({value:t,issues:e.issues},n)}var dT=re("$ZodReadonly",(e,t)=>{xt.init(e,t),Pt(e._zod,"propValues",()=>t.innerType._zod.propValues),Pt(e._zod,"values",()=>t.innerType._zod.values),Pt(e._zod,"optin",()=>t.innerType?._zod?.optin),Pt(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);let s=t.innerType._zod.run(r,n);return s instanceof Promise?s.then(R$):R$(s)}});function R$(e){return e.value=Object.freeze(e.value),e}var pT=re("$ZodTemplateLiteral",(e,t)=>{xt.init(e,t);let r=[];for(let n of t.parts)if(typeof n=="object"&&n!==null){if(!n._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...n._zod.traits].shift()}`);let s=n._zod.pattern instanceof RegExp?n._zod.pattern.source:n._zod.pattern;if(!s)throw new Error(`Invalid template literal part: ${n._zod.traits}`);let a=s.startsWith("^")?1:0,o=s.endsWith("$")?s.length-1:s.length;r.push(s.slice(a,o))}else if(n===null||kx.has(typeof n))r.push(Di(`${n}`));else throw new Error(`Invalid template literal part: ${n}`);e._zod.pattern=new RegExp(`^${r.join("")}$`),e._zod.parse=(n,s)=>typeof n.value!="string"?(n.issues.push({input:n.value,inst:e,expected:"string",code:"invalid_type"}),n):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(n.value)||n.issues.push({input:n.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),n)}),fT=re("$ZodFunction",(e,t)=>(xt.init(e,t),e._def=t,e._zod.def=t,e.implement=r=>{if(typeof r!="function")throw new Error("implement() must be called with a function");return function(...n){let s=e._def.input?Zd(e._def.input,n):n,a=Reflect.apply(r,this,s);return e._def.output?Zd(e._def.output,a):a}},e.implementAsync=r=>{if(typeof r!="function")throw new Error("implementAsync() must be called with a function");return async function(...n){let s=e._def.input?await Jd(e._def.input,n):n,a=await Reflect.apply(r,this,s);return e._def.output?await Jd(e._def.output,a):a}},e._zod.parse=(r,n)=>typeof r.value!="function"?(r.issues.push({code:"invalid_type",expected:"function",input:r.value,inst:e}),r):(e._def.output&&e._def.output._zod.def.type==="promise"?r.value=e.implementAsync(r.value):r.value=e.implement(r.value),r),e.input=(...r)=>{let n=e.constructor;return Array.isArray(r[0])?new n({type:"function",input:new Km({type:"tuple",items:r[0],rest:r[1]}),output:e._def.output}):new n({type:"function",input:r[0],output:e._def.output})},e.output=r=>{let n=e.constructor;return new n({type:"function",input:e._def.input,output:r})},e)),hT=re("$ZodPromise",(e,t)=>{xt.init(e,t),e._zod.parse=(r,n)=>Promise.resolve(r.value).then(s=>t.innerType._zod.run({value:s,issues:[]},n))}),mT=re("$ZodLazy",(e,t)=>{xt.init(e,t),Pt(e._zod,"innerType",()=>t.getter()),Pt(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),Pt(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),Pt(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),Pt(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(r,n)=>e._zod.innerType._zod.run(r,n)}),gT=re("$ZodCustom",(e,t)=>{_r.init(e,t),xt.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,s=t.fn(n);if(s instanceof Promise)return s.then(a=>D$(a,r,n,e));D$(s,r,n,e)}});function D$(e,t,r,n){if(!e){let s={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(s.params=n._zod.def.params),t.issues.push(Rl(s))}}var UK=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(s){return e[s]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},n={nan:"NaN"};return s=>{switch(s.code){case"invalid_type":{let a=n[s.expected]??s.expected,o=yt(s.input),c=n[o]??o;return`Invalid input: expected ${a}, received ${c}`}case"invalid_value":return s.values.length===1?`Invalid input: expected ${ft(s.values[0])}`:`Invalid option: expected one of ${pt(s.values,"|")}`;case"too_big":{let a=s.inclusive?"<=":"<",o=t(s.origin);return o?`Too big: expected ${s.origin??"value"} to have ${a}${s.maximum.toString()} ${o.unit??"elements"}`:`Too big: expected ${s.origin??"value"} to be ${a}${s.maximum.toString()}`}case"too_small":{let a=s.inclusive?">=":">",o=t(s.origin);return o?`Too small: expected ${s.origin} to have ${a}${s.minimum.toString()} ${o.unit}`:`Too small: expected ${s.origin} to be ${a}${s.minimum.toString()}`}case"invalid_format":{let a=s;return a.format==="starts_with"?`Invalid string: must start with "${a.prefix}"`:a.format==="ends_with"?`Invalid string: must end with "${a.suffix}"`:a.format==="includes"?`Invalid string: must include "${a.includes}"`:a.format==="regex"?`Invalid string: must match pattern ${a.pattern}`:`Invalid ${r[a.format]??s.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${s.divisor}`;case"unrecognized_keys":return`Unrecognized key${s.keys.length>1?"s":""}: ${pt(s.keys,", ")}`;case"invalid_key":return`Invalid key in ${s.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${s.origin}`;default:return"Invalid input"}}};function yT(){return{localeError:UK()}}var z$,U$=Symbol("ZodOutput"),q$=Symbol("ZodInput"),bT=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let n=r[0];return this._map.set(t,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let n={...this.get(r)??{}};delete n.id;let s={...n,...this._map.get(t)};return Object.keys(s).length?s:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function vT(){return new bT}(z$=globalThis).__zod_globalRegistry??(z$.__zod_globalRegistry=vT());var Wn=globalThis.__zod_globalRegistry;function xT(e,t){return new e({type:"string",...Re(t)})}function Zm(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Re(t)})}function ap(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Re(t)})}function Hm(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Re(t)})}function Jm(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Re(t)})}function Ym(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Re(t)})}function Xm(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Re(t)})}function op(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Re(t)})}function Qm(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Re(t)})}function eg(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Re(t)})}function tg(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Re(t)})}function rg(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Re(t)})}function ng(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Re(t)})}function ig(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Re(t)})}function sg(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Re(t)})}function ag(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Re(t)})}function og(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Re(t)})}function ST(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...Re(t)})}function cg(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Re(t)})}function lg(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Re(t)})}function ug(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Re(t)})}function dg(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Re(t)})}function pg(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Re(t)})}function fg(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Re(t)})}function TT(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Re(t)})}function wT(e,t){return new e({type:"string",format:"date",check:"string_format",...Re(t)})}function ET(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Re(t)})}function PT(e,t){return new e({type:"string",format:"duration",check:"string_format",...Re(t)})}function IT(e,t){return new e({type:"number",checks:[],...Re(t)})}function AT(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Re(t)})}function kT(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...Re(t)})}function CT(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...Re(t)})}function NT(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...Re(t)})}function OT(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...Re(t)})}function $T(e,t){return new e({type:"boolean",...Re(t)})}function RT(e,t){return new e({type:"bigint",...Re(t)})}function DT(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...Re(t)})}function MT(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...Re(t)})}function LT(e,t){return new e({type:"symbol",...Re(t)})}function FT(e,t){return new e({type:"undefined",...Re(t)})}function jT(e,t){return new e({type:"null",...Re(t)})}function BT(e){return new e({type:"any"})}function zT(e){return new e({type:"unknown"})}function UT(e,t){return new e({type:"never",...Re(t)})}function qT(e,t){return new e({type:"void",...Re(t)})}function WT(e,t){return new e({type:"date",...Re(t)})}function VT(e,t){return new e({type:"nan",...Re(t)})}function ua(e,t){return new oS({check:"less_than",...Re(t),value:e,inclusive:!1})}function wi(e,t){return new oS({check:"less_than",...Re(t),value:e,inclusive:!0})}function da(e,t){return new cS({check:"greater_than",...Re(t),value:e,inclusive:!1})}function Vn(e,t){return new cS({check:"greater_than",...Re(t),value:e,inclusive:!0})}function KT(e){return da(0,e)}function GT(e){return ua(0,e)}function ZT(e){return wi(0,e)}function HT(e){return Vn(0,e)}function sc(e,t){return new s$({check:"multiple_of",...Re(t),value:e})}function ac(e,t){return new c$({check:"max_size",...Re(t),maximum:e})}function pa(e,t){return new l$({check:"min_size",...Re(t),minimum:e})}function Ml(e,t){return new u$({check:"size_equals",...Re(t),size:e})}function Ll(e,t){return new d$({check:"max_length",...Re(t),maximum:e})}function ro(e,t){return new p$({check:"min_length",...Re(t),minimum:e})}function Fl(e,t){return new f$({check:"length_equals",...Re(t),length:e})}function cp(e,t){return new h$({check:"string_format",format:"regex",...Re(t),pattern:e})}function lp(e){return new m$({check:"string_format",format:"lowercase",...Re(e)})}function up(e){return new g$({check:"string_format",format:"uppercase",...Re(e)})}function dp(e,t){return new y$({check:"string_format",format:"includes",...Re(t),includes:e})}function pp(e,t){return new _$({check:"string_format",format:"starts_with",...Re(t),prefix:e})}function fp(e,t){return new b$({check:"string_format",format:"ends_with",...Re(t),suffix:e})}function JT(e,t,r){return new v$({check:"property",property:e,schema:t,...Re(r)})}function hp(e,t){return new x$({check:"mime_type",mime:e,...Re(t)})}function $s(e){return new S$({check:"overwrite",tx:e})}function mp(e){return $s(t=>t.normalize(e))}function gp(){return $s(e=>e.trim())}function yp(){return $s(e=>e.toLowerCase())}function _p(){return $s(e=>e.toUpperCase())}function hg(){return $s(e=>Px(e))}function W$(e,t,r){return new e({type:"array",element:t,...Re(r)})}function YT(e,t){return new e({type:"file",...Re(t)})}function XT(e,t,r){let n=Re(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}function QT(e,t,r){return new e({type:"custom",check:"custom",fn:t,...Re(r)})}function ew(e){let t=KK(r=>(r.addIssue=n=>{if(typeof n=="string")r.issues.push(Rl(n,r.value,t._zod.def));else{let s=n;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=t),s.continue??(s.continue=!t._zod.def.abort),r.issues.push(Rl(s))}},e(r.value,r)));return t}function KK(e,t){let r=new _r({check:"custom",...Re(t)});return r._zod.check=e,r}function tw(e){let t=new _r({check:"describe"});return t._zod.onattach=[r=>{let n=Wn.get(r)??{};Wn.add(r,{...n,description:e})}],t._zod.check=()=>{},t}function rw(e){let t=new _r({check:"meta"});return t._zod.onattach=[r=>{let n=Wn.get(r)??{};Wn.add(r,{...n,...e})}],t._zod.check=()=>{},t}function nw(e,t){let r=Re(t),n=r.truthy??["true","1","yes","on","y","enabled"],s=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(n=n.map(h=>typeof h=="string"?h.toLowerCase():h),s=s.map(h=>typeof h=="string"?h.toLowerCase():h));let a=new Set(n),o=new Set(s),c=e.Codec??sp,l=e.Boolean??np,u=e.String??ic,d=new u({type:"string",error:r.error}),p=new l({type:"boolean",error:r.error}),f=new c({type:"pipe",in:d,out:p,transform:(h,m)=>{let g=h;return r.case!=="sensitive"&&(g=g.toLowerCase()),a.has(g)?!0:o.has(g)?!1:(m.issues.push({code:"invalid_value",expected:"stringbool",values:[...a,...o],input:m.value,inst:f,continue:!1}),{})},reverseTransform:(h,m)=>h===!0?n[0]||"true":s[0]||"false",error:r.error});return f}function jl(e,t,r,n={}){let s=Re(n),a={...Re(n),check:"string_format",type:"string",format:t,fn:typeof r=="function"?r:c=>r.test(c),...s};return r instanceof RegExp&&(a.pattern=r),new e(a)}function mg(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Wn,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function Tr(e,t,r={path:[],schemaPath:[]}){var n;let s=e._zod.def,a=t.seen.get(e);if(a)return a.count++,r.schemaPath.includes(e)&&(a.cycle=r.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,o);let c=e._zod.toJSONSchema?.();if(c)o.schema=c;else{let d={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,d);else{let f=o.schema,h=t.processors[s.type];if(!h)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);h(e,t,f,d)}let p=e._zod.parent;p&&(o.ref||(o.ref=p),Tr(p,t,d),t.seen.get(p).isParent=!0)}let l=t.metadataRegistry.get(e);return l&&Object.assign(o.schema,l),t.io==="input"&&Kn(e)&&(delete o.schema.examples,delete o.schema.default),t.io==="input"&&o.schema._prefault&&((n=o.schema).default??(n.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function gg(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let n=new Map;for(let o of e.seen.entries()){let c=e.metadataRegistry.get(o[0])?.id;if(c){let l=n.get(c);if(l&&l!==o[0])throw new Error(`Duplicate schema id "${c}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(c,o[0])}}let s=o=>{let c=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let p=e.external.registry.get(o[0])?.id,f=e.external.uri??(m=>m);if(p)return{ref:f(p)};let h=o[1].defId??o[1].schema.id??`schema${e.counter++}`;return o[1].defId=h,{defId:h,ref:`${f("__shared")}#/${c}/${h}`}}if(o[1]===r)return{ref:"#"};let u=`#/${c}/`,d=o[1].schema.id??`__schema${e.counter++}`;return{defId:d,ref:u+d}},a=o=>{if(o[1].schema.$ref)return;let c=o[1],{ref:l,defId:u}=s(o);c.def={...c.schema},u&&(c.defId=u);let d=c.schema;for(let p in d)delete d[p];d.$ref=l};if(e.cycles==="throw")for(let o of e.seen.entries()){let c=o[1];if(c.cycle)throw new Error(`Cycle detected: #/${c.cycle?.join("/")}/<root>
|
|
254
254
|
|
|
255
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let o of e.seen.entries()){let c=o[1];if(t===o[0]){a(o);continue}if(e.external){let u=e.external.registry.get(o[0])?.id;if(t!==o[0]&&u){a(o);continue}}if(e.metadataRegistry.get(o[0])?.id){a(o);continue}if(c.cycle){a(o);continue}if(c.count>1&&e.reused==="ref"){a(o);continue}}}function yg(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let n=o=>{let c=e.seen.get(o);if(c.ref===null)return;let l=c.def??c.schema,u={...l},d=c.ref;if(c.ref=null,d){n(d);let f=e.seen.get(d),h=f.schema;if(h.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(l.allOf=l.allOf??[],l.allOf.push(h)):Object.assign(l,h),Object.assign(l,u),o._zod.parent===d)for(let g in l)g==="$ref"||g==="allOf"||g in u||delete l[g];if(h.$ref&&f.def)for(let g in l)g==="$ref"||g==="allOf"||g in f.def&&JSON.stringify(l[g])===JSON.stringify(f.def[g])&&delete l[g]}let p=o._zod.parent;if(p&&p!==d){n(p);let f=e.seen.get(p);if(f?.schema.$ref&&(l.$ref=f.schema.$ref,f.def))for(let h in l)h==="$ref"||h==="allOf"||h in f.def&&JSON.stringify(l[h])===JSON.stringify(f.def[h])&&delete l[h]}e.override({zodSchema:o,jsonSchema:l,path:c.path??[]})};for(let o of[...e.seen.entries()].reverse())n(o[0]);let s={};if(e.target==="draft-2020-12"?s.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?s.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?s.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let o=e.external.registry.get(t)?.id;if(!o)throw new Error("Schema is missing an `id` property");s.$id=e.external.uri(o)}Object.assign(s,r.def??r.schema);let a=e.external?.defs??{};for(let o of e.seen.entries()){let c=o[1];c.def&&c.defId&&(a[c.defId]=c.def)}e.external||Object.keys(a).length>0&&(e.target==="draft-2020-12"?s.$defs=a:s.definitions=a);try{let o=JSON.parse(JSON.stringify(s));return Object.defineProperty(o,"~standard",{value:{...t["~standard"],jsonSchema:{input:bp(t,"input",e.processors),output:bp(t,"output",e.processors)}},enumerable:!1,writable:!1}),o}catch{throw new Error("Error converting schema to JSON.")}}function Kn(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let n=e._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return Kn(n.element,r);if(n.type==="set")return Kn(n.valueType,r);if(n.type==="lazy")return Kn(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return Kn(n.innerType,r);if(n.type==="intersection")return Kn(n.left,r)||Kn(n.right,r);if(n.type==="record"||n.type==="map")return Kn(n.keyType,r)||Kn(n.valueType,r);if(n.type==="pipe")return Kn(n.in,r)||Kn(n.out,r);if(n.type==="object"){for(let s in n.shape)if(Kn(n.shape[s],r))return!0;return!1}if(n.type==="union"){for(let s of n.options)if(Kn(s,r))return!0;return!1}if(n.type==="tuple"){for(let s of n.items)if(Kn(s,r))return!0;return!!(n.rest&&Kn(n.rest,r))}return!1}var V$=(e,t={})=>r=>{let n=mg({...r,processors:t});return Tr(e,n),gg(n,e),yg(n,e)},bp=(e,t,r={})=>n=>{let{libraryOptions:s,target:a}=n??{},o=mg({...s??{},target:a,io:t,processors:r});return Tr(e,o),gg(o,e),yg(o,e)};var GK={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},K$=(e,t,r,n)=>{let s=r;s.type="string";let{minimum:a,maximum:o,format:c,patterns:l,contentEncoding:u}=e._zod.bag;if(typeof a=="number"&&(s.minLength=a),typeof o=="number"&&(s.maxLength=o),c&&(s.format=GK[c]??c,s.format===""&&delete s.format,c==="time"&&delete s.format),u&&(s.contentEncoding=u),l&&l.size>0){let d=[...l];d.length===1?s.pattern=d[0].source:d.length>1&&(s.allOf=[...d.map(p=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:p.source}))])}},G$=(e,t,r,n)=>{let s=r,{minimum:a,maximum:o,format:c,multipleOf:l,exclusiveMaximum:u,exclusiveMinimum:d}=e._zod.bag;typeof c=="string"&&c.includes("int")?s.type="integer":s.type="number",typeof d=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(s.minimum=d,s.exclusiveMinimum=!0):s.exclusiveMinimum=d),typeof a=="number"&&(s.minimum=a,typeof d=="number"&&t.target!=="draft-04"&&(d>=a?delete s.minimum:delete s.exclusiveMinimum)),typeof u=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(s.maximum=u,s.exclusiveMaximum=!0):s.exclusiveMaximum=u),typeof o=="number"&&(s.maximum=o,typeof u=="number"&&t.target!=="draft-04"&&(u<=o?delete s.maximum:delete s.exclusiveMaximum)),typeof l=="number"&&(s.multipleOf=l)},Z$=(e,t,r,n)=>{r.type="boolean"},H$=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},J$=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},Y$=(e,t,r,n)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},X$=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},Q$=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},eR=(e,t,r,n)=>{r.not={}},tR=(e,t,r,n)=>{},rR=(e,t,r,n)=>{},nR=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},iR=(e,t,r,n)=>{let s=e._zod.def,a=zd(s.entries);a.every(o=>typeof o=="number")&&(r.type="number"),a.every(o=>typeof o=="string")&&(r.type="string"),r.enum=a},sR=(e,t,r,n)=>{let s=e._zod.def,a=[];for(let o of s.values)if(o===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof o=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");a.push(Number(o))}else a.push(o);if(a.length!==0)if(a.length===1){let o=a[0];r.type=o===null?"null":typeof o,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[o]:r.const=o}else a.every(o=>typeof o=="number")&&(r.type="number"),a.every(o=>typeof o=="string")&&(r.type="string"),a.every(o=>typeof o=="boolean")&&(r.type="boolean"),a.every(o=>o===null)&&(r.type="null"),r.enum=a},aR=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},oR=(e,t,r,n)=>{let s=r,a=e._zod.pattern;if(!a)throw new Error("Pattern not found in template literal");s.type="string",s.pattern=a.source},cR=(e,t,r,n)=>{let s=r,a={type:"string",format:"binary",contentEncoding:"binary"},{minimum:o,maximum:c,mime:l}=e._zod.bag;o!==void 0&&(a.minLength=o),c!==void 0&&(a.maxLength=c),l?l.length===1?(a.contentMediaType=l[0],Object.assign(s,a)):(Object.assign(s,a),s.anyOf=l.map(u=>({contentMediaType:u}))):Object.assign(s,a)},lR=(e,t,r,n)=>{r.type="boolean"},uR=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},dR=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},pR=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},fR=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},hR=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},mR=(e,t,r,n)=>{let s=r,a=e._zod.def,{minimum:o,maximum:c}=e._zod.bag;typeof o=="number"&&(s.minItems=o),typeof c=="number"&&(s.maxItems=c),s.type="array",s.items=Tr(a.element,t,{...n,path:[...n.path,"items"]})},gR=(e,t,r,n)=>{let s=r,a=e._zod.def;s.type="object",s.properties={};let o=a.shape;for(let u in o)s.properties[u]=Tr(o[u],t,{...n,path:[...n.path,"properties",u]});let c=new Set(Object.keys(o)),l=new Set([...c].filter(u=>{let d=a.shape[u]._zod;return t.io==="input"?d.optin===void 0:d.optout===void 0}));l.size>0&&(s.required=Array.from(l)),a.catchall?._zod.def.type==="never"?s.additionalProperties=!1:a.catchall?a.catchall&&(s.additionalProperties=Tr(a.catchall,t,{...n,path:[...n.path,"additionalProperties"]})):t.io==="output"&&(s.additionalProperties=!1)},iw=(e,t,r,n)=>{let s=e._zod.def,a=s.inclusive===!1,o=s.options.map((c,l)=>Tr(c,t,{...n,path:[...n.path,a?"oneOf":"anyOf",l]}));a?r.oneOf=o:r.anyOf=o},yR=(e,t,r,n)=>{let s=e._zod.def,a=Tr(s.left,t,{...n,path:[...n.path,"allOf",0]}),o=Tr(s.right,t,{...n,path:[...n.path,"allOf",1]}),c=u=>"allOf"in u&&Object.keys(u).length===1,l=[...c(a)?a.allOf:[a],...c(o)?o.allOf:[o]];r.allOf=l},_R=(e,t,r,n)=>{let s=r,a=e._zod.def;s.type="array";let o=t.target==="draft-2020-12"?"prefixItems":"items",c=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",l=a.items.map((f,h)=>Tr(f,t,{...n,path:[...n.path,o,h]})),u=a.rest?Tr(a.rest,t,{...n,path:[...n.path,c,...t.target==="openapi-3.0"?[a.items.length]:[]]}):null;t.target==="draft-2020-12"?(s.prefixItems=l,u&&(s.items=u)):t.target==="openapi-3.0"?(s.items={anyOf:l},u&&s.items.anyOf.push(u),s.minItems=l.length,u||(s.maxItems=l.length)):(s.items=l,u&&(s.additionalItems=u));let{minimum:d,maximum:p}=e._zod.bag;typeof d=="number"&&(s.minItems=d),typeof p=="number"&&(s.maxItems=p)},bR=(e,t,r,n)=>{let s=r,a=e._zod.def;s.type="object";let o=a.keyType,l=o._zod.bag?.patterns;if(a.mode==="loose"&&l&&l.size>0){let d=Tr(a.valueType,t,{...n,path:[...n.path,"patternProperties","*"]});s.patternProperties={};for(let p of l)s.patternProperties[p.source]=d}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(s.propertyNames=Tr(a.keyType,t,{...n,path:[...n.path,"propertyNames"]})),s.additionalProperties=Tr(a.valueType,t,{...n,path:[...n.path,"additionalProperties"]});let u=o._zod.values;if(u){let d=[...u].filter(p=>typeof p=="string"||typeof p=="number");d.length>0&&(s.required=d)}},vR=(e,t,r,n)=>{let s=e._zod.def,a=Tr(s.innerType,t,n),o=t.seen.get(e);t.target==="openapi-3.0"?(o.ref=s.innerType,r.nullable=!0):r.anyOf=[a,{type:"null"}]},xR=(e,t,r,n)=>{let s=e._zod.def;Tr(s.innerType,t,n);let a=t.seen.get(e);a.ref=s.innerType},SR=(e,t,r,n)=>{let s=e._zod.def;Tr(s.innerType,t,n);let a=t.seen.get(e);a.ref=s.innerType,r.default=JSON.parse(JSON.stringify(s.defaultValue))},TR=(e,t,r,n)=>{let s=e._zod.def;Tr(s.innerType,t,n);let a=t.seen.get(e);a.ref=s.innerType,t.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(s.defaultValue)))},wR=(e,t,r,n)=>{let s=e._zod.def;Tr(s.innerType,t,n);let a=t.seen.get(e);a.ref=s.innerType;let o;try{o=s.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=o},ER=(e,t,r,n)=>{let s=e._zod.def,a=t.io==="input"?s.in._zod.def.type==="transform"?s.out:s.in:s.out;Tr(a,t,n);let o=t.seen.get(e);o.ref=a},PR=(e,t,r,n)=>{let s=e._zod.def;Tr(s.innerType,t,n);let a=t.seen.get(e);a.ref=s.innerType,r.readOnly=!0},IR=(e,t,r,n)=>{let s=e._zod.def;Tr(s.innerType,t,n);let a=t.seen.get(e);a.ref=s.innerType},sw=(e,t,r,n)=>{let s=e._zod.def;Tr(s.innerType,t,n);let a=t.seen.get(e);a.ref=s.innerType},AR=(e,t,r,n)=>{let s=e._zod.innerType;Tr(s,t,n);let a=t.seen.get(e);a.ref=s};function Bl(e){return!!e._zod}function no(e,t){return Bl(e)?Dl(e,t):e.safeParse(t)}function _g(e){if(!e)return;let t;if(Bl(e)?t=e._zod?.def?.shape:t=e.shape,!!t){if(typeof t=="function")try{return t()}catch{return}return t}}function NR(e){if(Bl(e)){let a=e._zod?.def;if(a){if(a.value!==void 0)return a.value;if(Array.isArray(a.values)&&a.values.length>0)return a.values[0]}}let r=e._def;if(r){if(r.value!==void 0)return r.value;if(Array.isArray(r.values)&&r.values.length>0)return r.values[0]}let n=e.value;if(n!==void 0)return n}var vp={};zn(vp,{ZodAny:()=>HR,ZodArray:()=>QR,ZodBase64:()=>kw,ZodBase64URL:()=>Cw,ZodBigInt:()=>Ig,ZodBigIntFormat:()=>$w,ZodBoolean:()=>Pg,ZodCIDRv4:()=>Iw,ZodCIDRv6:()=>Aw,ZodCUID:()=>vw,ZodCUID2:()=>xw,ZodCatch:()=>bD,ZodCodec:()=>Bw,ZodCustom:()=>Og,ZodCustomStringFormat:()=>Sp,ZodDate:()=>Dw,ZodDefault:()=>fD,ZodDiscriminatedUnion:()=>tD,ZodE164:()=>Nw,ZodEmail:()=>yw,ZodEmoji:()=>_w,ZodEnum:()=>xp,ZodExactOptional:()=>uD,ZodFile:()=>cD,ZodFunction:()=>AD,ZodGUID:()=>vg,ZodIPv4:()=>Ew,ZodIPv6:()=>Pw,ZodIntersection:()=>rD,ZodJWT:()=>Ow,ZodKSUID:()=>ww,ZodLazy:()=>ED,ZodLiteral:()=>oD,ZodMAC:()=>VR,ZodMap:()=>sD,ZodNaN:()=>xD,ZodNanoID:()=>bw,ZodNever:()=>YR,ZodNonOptional:()=>Fw,ZodNull:()=>ZR,ZodNullable:()=>pD,ZodNumber:()=>Eg,ZodNumberFormat:()=>zl,ZodObject:()=>Ag,ZodOptional:()=>Lw,ZodPipe:()=>jw,ZodPrefault:()=>mD,ZodPromise:()=>ID,ZodReadonly:()=>SD,ZodRecord:()=>Ng,ZodSet:()=>aD,ZodString:()=>Tg,ZodStringFormat:()=>_r,ZodSuccess:()=>_D,ZodSymbol:()=>KR,ZodTemplateLiteral:()=>wD,ZodTransform:()=>lD,ZodTuple:()=>nD,ZodType:()=>It,ZodULID:()=>Sw,ZodURL:()=>wg,ZodUUID:()=>fa,ZodUndefined:()=>GR,ZodUnion:()=>kg,ZodUnknown:()=>JR,ZodVoid:()=>XR,ZodXID:()=>Tw,ZodXor:()=>eD,_ZodString:()=>gw,_default:()=>hD,_function:()=>lZ,any:()=>VG,array:()=>Bt,base64:()=>AG,base64url:()=>kG,bigint:()=>BG,boolean:()=>rn,catch:()=>vD,check:()=>uZ,cidrv4:()=>PG,cidrv6:()=>IG,codec:()=>aZ,cuid:()=>_G,cuid2:()=>bG,custom:()=>zw,date:()=>GG,describe:()=>dZ,discriminatedUnion:()=>Cg,e164:()=>CG,email:()=>cG,emoji:()=>gG,enum:()=>On,exactOptional:()=>dD,file:()=>rZ,float32:()=>MG,float64:()=>LG,function:()=>lZ,guid:()=>lG,hash:()=>DG,hex:()=>RG,hostname:()=>$G,httpUrl:()=>mG,instanceof:()=>fZ,int:()=>mw,int32:()=>FG,int64:()=>zG,intersection:()=>wp,ipv4:()=>TG,ipv6:()=>EG,json:()=>mZ,jwt:()=>NG,keyof:()=>ZG,ksuid:()=>SG,lazy:()=>PD,literal:()=>He,looseObject:()=>Nn,looseRecord:()=>XG,mac:()=>wG,map:()=>QG,meta:()=>pZ,nan:()=>sZ,nanoid:()=>yG,nativeEnum:()=>tZ,never:()=>Rw,nonoptional:()=>yD,null:()=>Tp,nullable:()=>xg,nullish:()=>nZ,number:()=>ar,object:()=>ze,optional:()=>Cr,partialRecord:()=>YG,pipe:()=>Sg,prefault:()=>gD,preprocess:()=>$g,promise:()=>cZ,readonly:()=>TD,record:()=>wr,refine:()=>kD,set:()=>eZ,strictObject:()=>HG,string:()=>ue,stringFormat:()=>OG,stringbool:()=>hZ,success:()=>iZ,superRefine:()=>CD,symbol:()=>qG,templateLiteral:()=>oZ,transform:()=>Mw,tuple:()=>iD,uint32:()=>jG,uint64:()=>UG,ulid:()=>vG,undefined:()=>WG,union:()=>hr,unknown:()=>br,url:()=>hG,uuid:()=>uG,uuidv4:()=>dG,uuidv6:()=>pG,uuidv7:()=>fG,void:()=>KG,xid:()=>xG,xor:()=>JG});var bg={};zn(bg,{endsWith:()=>fp,gt:()=>da,gte:()=>Vn,includes:()=>dp,length:()=>Fl,lowercase:()=>lp,lt:()=>ua,lte:()=>wi,maxLength:()=>Ll,maxSize:()=>ac,mime:()=>hp,minLength:()=>ro,minSize:()=>pa,multipleOf:()=>sc,negative:()=>GT,nonnegative:()=>HT,nonpositive:()=>ZT,normalize:()=>mp,overwrite:()=>$s,positive:()=>KT,property:()=>JT,regex:()=>cp,size:()=>Ml,slugify:()=>hg,startsWith:()=>pp,toLowerCase:()=>yp,toUpperCase:()=>_p,trim:()=>gp,uppercase:()=>up});var oc={};zn(oc,{ZodISODate:()=>lw,ZodISODateTime:()=>ow,ZodISODuration:()=>fw,ZodISOTime:()=>dw,date:()=>uw,datetime:()=>cw,duration:()=>hw,time:()=>pw});var ow=re("ZodISODateTime",(e,t)=>{xS.init(e,t),_r.init(e,t)});function cw(e){return TT(ow,e)}var lw=re("ZodISODate",(e,t)=>{SS.init(e,t),_r.init(e,t)});function uw(e){return wT(lw,e)}var dw=re("ZodISOTime",(e,t)=>{TS.init(e,t),_r.init(e,t)});function pw(e){return ET(dw,e)}var fw=re("ZodISODuration",(e,t)=>{wS.init(e,t),_r.init(e,t)});function hw(e){return PT(fw,e)}var OR=(e,t)=>{$m.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>Dm(e,r)},flatten:{value:r=>Rm(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,Ol,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,Ol,2)}},isEmpty:{get(){return e.issues.length===0}}})},cKe=re("ZodError",OR),Ei=re("ZodError",OR,{Parent:Error});var $R=Gd(Ei),RR=Hd(Ei),DR=Yd(Ei),MR=Xd(Ei),LR=KO(Ei),FR=GO(Ei),jR=ZO(Ei),BR=HO(Ei),zR=JO(Ei),UR=YO(Ei),qR=XO(Ei),WR=QO(Ei);var It=re("ZodType",(e,t)=>(xt.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:bp(e,"input"),output:bp(e,"output")}}),e.toJSONSchema=V$(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone(Ee.mergeDefs(t,{checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0}),e.with=e.check,e.clone=(r,n)=>qn(e,r,n),e.brand=()=>e,e.register=(r,n)=>(r.add(e,n),e),e.parse=(r,n)=>$R(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>DR(e,r,n),e.parseAsync=async(r,n)=>RR(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>MR(e,r,n),e.spa=e.safeParseAsync,e.encode=(r,n)=>LR(e,r,n),e.decode=(r,n)=>FR(e,r,n),e.encodeAsync=async(r,n)=>jR(e,r,n),e.decodeAsync=async(r,n)=>BR(e,r,n),e.safeEncode=(r,n)=>zR(e,r,n),e.safeDecode=(r,n)=>UR(e,r,n),e.safeEncodeAsync=async(r,n)=>qR(e,r,n),e.safeDecodeAsync=async(r,n)=>WR(e,r,n),e.refine=(r,n)=>e.check(kD(r,n)),e.superRefine=r=>e.check(CD(r)),e.overwrite=r=>e.check($s(r)),e.optional=()=>Cr(e),e.exactOptional=()=>dD(e),e.nullable=()=>xg(e),e.nullish=()=>Cr(xg(e)),e.nonoptional=r=>yD(e,r),e.array=()=>Bt(e),e.or=r=>hr([e,r]),e.and=r=>wp(e,r),e.transform=r=>Sg(e,Mw(r)),e.default=r=>hD(e,r),e.prefault=r=>gD(e,r),e.catch=r=>vD(e,r),e.pipe=r=>Sg(e,r),e.readonly=()=>TD(e),e.describe=r=>{let n=e.clone();return Wn.add(n,{description:r}),n},Object.defineProperty(e,"description",{get(){return Wn.get(e)?.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return Wn.get(e);let n=e.clone();return Wn.add(n,r[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=r=>r(e),e)),gw=re("_ZodString",(e,t)=>{ic.init(e,t),It.init(e,t),e._zod.processJSONSchema=(n,s,a)=>K$(e,n,s,a);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...n)=>e.check(cp(...n)),e.includes=(...n)=>e.check(dp(...n)),e.startsWith=(...n)=>e.check(pp(...n)),e.endsWith=(...n)=>e.check(fp(...n)),e.min=(...n)=>e.check(ro(...n)),e.max=(...n)=>e.check(Ll(...n)),e.length=(...n)=>e.check(Fl(...n)),e.nonempty=(...n)=>e.check(ro(1,...n)),e.lowercase=n=>e.check(lp(n)),e.uppercase=n=>e.check(up(n)),e.trim=()=>e.check(gp()),e.normalize=(...n)=>e.check(mp(...n)),e.toLowerCase=()=>e.check(yp()),e.toUpperCase=()=>e.check(_p()),e.slugify=()=>e.check(hg())}),Tg=re("ZodString",(e,t)=>{ic.init(e,t),gw.init(e,t),e.email=r=>e.check(Zm(yw,r)),e.url=r=>e.check(op(wg,r)),e.jwt=r=>e.check(fg(Ow,r)),e.emoji=r=>e.check(Qm(_w,r)),e.guid=r=>e.check(ap(vg,r)),e.uuid=r=>e.check(Hm(fa,r)),e.uuidv4=r=>e.check(Jm(fa,r)),e.uuidv6=r=>e.check(Ym(fa,r)),e.uuidv7=r=>e.check(Xm(fa,r)),e.nanoid=r=>e.check(eg(bw,r)),e.guid=r=>e.check(ap(vg,r)),e.cuid=r=>e.check(tg(vw,r)),e.cuid2=r=>e.check(rg(xw,r)),e.ulid=r=>e.check(ng(Sw,r)),e.base64=r=>e.check(ug(kw,r)),e.base64url=r=>e.check(dg(Cw,r)),e.xid=r=>e.check(ig(Tw,r)),e.ksuid=r=>e.check(sg(ww,r)),e.ipv4=r=>e.check(ag(Ew,r)),e.ipv6=r=>e.check(og(Pw,r)),e.cidrv4=r=>e.check(cg(Iw,r)),e.cidrv6=r=>e.check(lg(Aw,r)),e.e164=r=>e.check(pg(Nw,r)),e.datetime=r=>e.check(cw(r)),e.date=r=>e.check(uw(r)),e.time=r=>e.check(pw(r)),e.duration=r=>e.check(hw(r))});function ue(e){return xT(Tg,e)}var _r=re("ZodStringFormat",(e,t)=>{fr.init(e,t),gw.init(e,t)}),yw=re("ZodEmail",(e,t)=>{pS.init(e,t),_r.init(e,t)});function cG(e){return Zm(yw,e)}var vg=re("ZodGUID",(e,t)=>{uS.init(e,t),_r.init(e,t)});function lG(e){return ap(vg,e)}var fa=re("ZodUUID",(e,t)=>{dS.init(e,t),_r.init(e,t)});function uG(e){return Hm(fa,e)}function dG(e){return Jm(fa,e)}function pG(e){return Ym(fa,e)}function fG(e){return Xm(fa,e)}var wg=re("ZodURL",(e,t)=>{fS.init(e,t),_r.init(e,t)});function hG(e){return op(wg,e)}function mG(e){return op(wg,{protocol:/^https?$/,hostname:Mi.domain,...Ee.normalizeParams(e)})}var _w=re("ZodEmoji",(e,t)=>{hS.init(e,t),_r.init(e,t)});function gG(e){return Qm(_w,e)}var bw=re("ZodNanoID",(e,t)=>{mS.init(e,t),_r.init(e,t)});function yG(e){return eg(bw,e)}var vw=re("ZodCUID",(e,t)=>{gS.init(e,t),_r.init(e,t)});function _G(e){return tg(vw,e)}var xw=re("ZodCUID2",(e,t)=>{yS.init(e,t),_r.init(e,t)});function bG(e){return rg(xw,e)}var Sw=re("ZodULID",(e,t)=>{_S.init(e,t),_r.init(e,t)});function vG(e){return ng(Sw,e)}var Tw=re("ZodXID",(e,t)=>{bS.init(e,t),_r.init(e,t)});function xG(e){return ig(Tw,e)}var ww=re("ZodKSUID",(e,t)=>{vS.init(e,t),_r.init(e,t)});function SG(e){return sg(ww,e)}var Ew=re("ZodIPv4",(e,t)=>{ES.init(e,t),_r.init(e,t)});function TG(e){return ag(Ew,e)}var VR=re("ZodMAC",(e,t)=>{IS.init(e,t),_r.init(e,t)});function wG(e){return ST(VR,e)}var Pw=re("ZodIPv6",(e,t)=>{PS.init(e,t),_r.init(e,t)});function EG(e){return og(Pw,e)}var Iw=re("ZodCIDRv4",(e,t)=>{AS.init(e,t),_r.init(e,t)});function PG(e){return cg(Iw,e)}var Aw=re("ZodCIDRv6",(e,t)=>{kS.init(e,t),_r.init(e,t)});function IG(e){return lg(Aw,e)}var kw=re("ZodBase64",(e,t)=>{CS.init(e,t),_r.init(e,t)});function AG(e){return ug(kw,e)}var Cw=re("ZodBase64URL",(e,t)=>{NS.init(e,t),_r.init(e,t)});function kG(e){return dg(Cw,e)}var Nw=re("ZodE164",(e,t)=>{OS.init(e,t),_r.init(e,t)});function CG(e){return pg(Nw,e)}var Ow=re("ZodJWT",(e,t)=>{$S.init(e,t),_r.init(e,t)});function NG(e){return fg(Ow,e)}var Sp=re("ZodCustomStringFormat",(e,t)=>{RS.init(e,t),_r.init(e,t)});function OG(e,t,r={}){return jl(Sp,e,t,r)}function $G(e){return jl(Sp,"hostname",Mi.hostname,e)}function RG(e){return jl(Sp,"hex",Mi.hex,e)}function DG(e,t){let r=t?.enc??"hex",n=`${e}_${r}`,s=Mi[n];if(!s)throw new Error(`Unrecognized hash format: ${n}`);return jl(Sp,n,s,t)}var Eg=re("ZodNumber",(e,t)=>{Wm.init(e,t),It.init(e,t),e._zod.processJSONSchema=(n,s,a)=>G$(e,n,s,a),e.gt=(n,s)=>e.check(da(n,s)),e.gte=(n,s)=>e.check(Vn(n,s)),e.min=(n,s)=>e.check(Vn(n,s)),e.lt=(n,s)=>e.check(ua(n,s)),e.lte=(n,s)=>e.check(wi(n,s)),e.max=(n,s)=>e.check(wi(n,s)),e.int=n=>e.check(mw(n)),e.safe=n=>e.check(mw(n)),e.positive=n=>e.check(da(0,n)),e.nonnegative=n=>e.check(Vn(0,n)),e.negative=n=>e.check(ua(0,n)),e.nonpositive=n=>e.check(wi(0,n)),e.multipleOf=(n,s)=>e.check(sc(n,s)),e.step=(n,s)=>e.check(sc(n,s)),e.finite=()=>e;let r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function ar(e){return IT(Eg,e)}var zl=re("ZodNumberFormat",(e,t)=>{DS.init(e,t),Eg.init(e,t)});function mw(e){return AT(zl,e)}function MG(e){return kT(zl,e)}function LG(e){return CT(zl,e)}function FG(e){return NT(zl,e)}function jG(e){return OT(zl,e)}var Pg=re("ZodBoolean",(e,t)=>{np.init(e,t),It.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Z$(e,r,n,s)});function rn(e){return $T(Pg,e)}var Ig=re("ZodBigInt",(e,t)=>{Vm.init(e,t),It.init(e,t),e._zod.processJSONSchema=(n,s,a)=>H$(e,n,s,a),e.gte=(n,s)=>e.check(Vn(n,s)),e.min=(n,s)=>e.check(Vn(n,s)),e.gt=(n,s)=>e.check(da(n,s)),e.gte=(n,s)=>e.check(Vn(n,s)),e.min=(n,s)=>e.check(Vn(n,s)),e.lt=(n,s)=>e.check(ua(n,s)),e.lte=(n,s)=>e.check(wi(n,s)),e.max=(n,s)=>e.check(wi(n,s)),e.positive=n=>e.check(da(BigInt(0),n)),e.negative=n=>e.check(ua(BigInt(0),n)),e.nonpositive=n=>e.check(wi(BigInt(0),n)),e.nonnegative=n=>e.check(Vn(BigInt(0),n)),e.multipleOf=(n,s)=>e.check(sc(n,s));let r=e._zod.bag;e.minValue=r.minimum??null,e.maxValue=r.maximum??null,e.format=r.format??null});function BG(e){return RT(Ig,e)}var $w=re("ZodBigIntFormat",(e,t)=>{MS.init(e,t),Ig.init(e,t)});function zG(e){return DT($w,e)}function UG(e){return MT($w,e)}var KR=re("ZodSymbol",(e,t)=>{LS.init(e,t),It.init(e,t),e._zod.processJSONSchema=(r,n,s)=>J$(e,r,n,s)});function qG(e){return LT(KR,e)}var GR=re("ZodUndefined",(e,t)=>{FS.init(e,t),It.init(e,t),e._zod.processJSONSchema=(r,n,s)=>X$(e,r,n,s)});function WG(e){return FT(GR,e)}var ZR=re("ZodNull",(e,t)=>{jS.init(e,t),It.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Y$(e,r,n,s)});function Tp(e){return jT(ZR,e)}var HR=re("ZodAny",(e,t)=>{BS.init(e,t),It.init(e,t),e._zod.processJSONSchema=(r,n,s)=>tR(e,r,n,s)});function VG(){return BT(HR)}var JR=re("ZodUnknown",(e,t)=>{zS.init(e,t),It.init(e,t),e._zod.processJSONSchema=(r,n,s)=>rR(e,r,n,s)});function br(){return zT(JR)}var YR=re("ZodNever",(e,t)=>{US.init(e,t),It.init(e,t),e._zod.processJSONSchema=(r,n,s)=>eR(e,r,n,s)});function Rw(e){return UT(YR,e)}var XR=re("ZodVoid",(e,t)=>{qS.init(e,t),It.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Q$(e,r,n,s)});function KG(e){return qT(XR,e)}var Dw=re("ZodDate",(e,t)=>{WS.init(e,t),It.init(e,t),e._zod.processJSONSchema=(n,s,a)=>nR(e,n,s,a),e.min=(n,s)=>e.check(Vn(n,s)),e.max=(n,s)=>e.check(wi(n,s));let r=e._zod.bag;e.minDate=r.minimum?new Date(r.minimum):null,e.maxDate=r.maximum?new Date(r.maximum):null});function GG(e){return WT(Dw,e)}var QR=re("ZodArray",(e,t)=>{VS.init(e,t),It.init(e,t),e._zod.processJSONSchema=(r,n,s)=>mR(e,r,n,s),e.element=t.element,e.min=(r,n)=>e.check(ro(r,n)),e.nonempty=r=>e.check(ro(1,r)),e.max=(r,n)=>e.check(Ll(r,n)),e.length=(r,n)=>e.check(Fl(r,n)),e.unwrap=()=>e.element});function Bt(e,t){return W$(QR,e,t)}function ZG(e){let t=e._zod.def.shape;return On(Object.keys(t))}var Ag=re("ZodObject",(e,t)=>{B$.init(e,t),It.init(e,t),e._zod.processJSONSchema=(r,n,s)=>gR(e,r,n,s),Ee.defineLazy(e,"shape",()=>t.shape),e.keyof=()=>On(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:br()}),e.loose=()=>e.clone({...e._zod.def,catchall:br()}),e.strict=()=>e.clone({...e._zod.def,catchall:Rw()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>Ee.extend(e,r),e.safeExtend=r=>Ee.safeExtend(e,r),e.merge=r=>Ee.merge(e,r),e.pick=r=>Ee.pick(e,r),e.omit=r=>Ee.omit(e,r),e.partial=(...r)=>Ee.partial(Lw,e,r[0]),e.required=(...r)=>Ee.required(Fw,e,r[0])});function ze(e,t){let r={type:"object",shape:e??{},...Ee.normalizeParams(t)};return new Ag(r)}function HG(e,t){return new Ag({type:"object",shape:e,catchall:Rw(),...Ee.normalizeParams(t)})}function Nn(e,t){return new Ag({type:"object",shape:e,catchall:br(),...Ee.normalizeParams(t)})}var kg=re("ZodUnion",(e,t)=>{ip.init(e,t),It.init(e,t),e._zod.processJSONSchema=(r,n,s)=>iw(e,r,n,s),e.options=t.options});function hr(e,t){return new kg({type:"union",options:e,...Ee.normalizeParams(t)})}var eD=re("ZodXor",(e,t)=>{kg.init(e,t),KS.init(e,t),e._zod.processJSONSchema=(r,n,s)=>iw(e,r,n,s),e.options=t.options});function JG(e,t){return new eD({type:"union",options:e,inclusive:!1,...Ee.normalizeParams(t)})}var tD=re("ZodDiscriminatedUnion",(e,t)=>{kg.init(e,t),GS.init(e,t)});function Cg(e,t,r){return new tD({type:"union",options:t,discriminator:e,...Ee.normalizeParams(r)})}var rD=re("ZodIntersection",(e,t)=>{ZS.init(e,t),It.init(e,t),e._zod.processJSONSchema=(r,n,s)=>yR(e,r,n,s)});function wp(e,t){return new rD({type:"intersection",left:e,right:t})}var nD=re("ZodTuple",(e,t)=>{Km.init(e,t),It.init(e,t),e._zod.processJSONSchema=(r,n,s)=>_R(e,r,n,s),e.rest=r=>e.clone({...e._zod.def,rest:r})});function iD(e,t,r){let n=t instanceof xt,s=n?r:t,a=n?t:null;return new nD({type:"tuple",items:e,rest:a,...Ee.normalizeParams(s)})}var Ng=re("ZodRecord",(e,t)=>{HS.init(e,t),It.init(e,t),e._zod.processJSONSchema=(r,n,s)=>bR(e,r,n,s),e.keyType=t.keyType,e.valueType=t.valueType});function wr(e,t,r){return new Ng({type:"record",keyType:e,valueType:t,...Ee.normalizeParams(r)})}function YG(e,t,r){let n=qn(e);return n._zod.values=void 0,new Ng({type:"record",keyType:n,valueType:t,...Ee.normalizeParams(r)})}function XG(e,t,r){return new Ng({type:"record",keyType:e,valueType:t,mode:"loose",...Ee.normalizeParams(r)})}var sD=re("ZodMap",(e,t)=>{JS.init(e,t),It.init(e,t),e._zod.processJSONSchema=(r,n,s)=>fR(e,r,n,s),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...r)=>e.check(pa(...r)),e.nonempty=r=>e.check(pa(1,r)),e.max=(...r)=>e.check(ac(...r)),e.size=(...r)=>e.check(Ml(...r))});function QG(e,t,r){return new sD({type:"map",keyType:e,valueType:t,...Ee.normalizeParams(r)})}var aD=re("ZodSet",(e,t)=>{YS.init(e,t),It.init(e,t),e._zod.processJSONSchema=(r,n,s)=>hR(e,r,n,s),e.min=(...r)=>e.check(pa(...r)),e.nonempty=r=>e.check(pa(1,r)),e.max=(...r)=>e.check(ac(...r)),e.size=(...r)=>e.check(Ml(...r))});function eZ(e,t){return new aD({type:"set",valueType:e,...Ee.normalizeParams(t)})}var xp=re("ZodEnum",(e,t)=>{XS.init(e,t),It.init(e,t),e._zod.processJSONSchema=(n,s,a)=>iR(e,n,s,a),e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(n,s)=>{let a={};for(let o of n)if(r.has(o))a[o]=t.entries[o];else throw new Error(`Key ${o} not found in enum`);return new xp({...t,checks:[],...Ee.normalizeParams(s),entries:a})},e.exclude=(n,s)=>{let a={...t.entries};for(let o of n)if(r.has(o))delete a[o];else throw new Error(`Key ${o} not found in enum`);return new xp({...t,checks:[],...Ee.normalizeParams(s),entries:a})}});function On(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new xp({type:"enum",entries:r,...Ee.normalizeParams(t)})}function tZ(e,t){return new xp({type:"enum",entries:e,...Ee.normalizeParams(t)})}var oD=re("ZodLiteral",(e,t)=>{QS.init(e,t),It.init(e,t),e._zod.processJSONSchema=(r,n,s)=>sR(e,r,n,s),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function He(e,t){return new oD({type:"literal",values:Array.isArray(e)?e:[e],...Ee.normalizeParams(t)})}var cD=re("ZodFile",(e,t)=>{eT.init(e,t),It.init(e,t),e._zod.processJSONSchema=(r,n,s)=>cR(e,r,n,s),e.min=(r,n)=>e.check(pa(r,n)),e.max=(r,n)=>e.check(ac(r,n)),e.mime=(r,n)=>e.check(hp(Array.isArray(r)?r:[r],n))});function rZ(e){return YT(cD,e)}var lD=re("ZodTransform",(e,t)=>{tT.init(e,t),It.init(e,t),e._zod.processJSONSchema=(r,n,s)=>pR(e,r,n,s),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new tc(e.constructor.name);r.addIssue=a=>{if(typeof a=="string")r.issues.push(Ee.issue(a,r.value,t));else{let o=a;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=r.value),o.inst??(o.inst=e),r.issues.push(Ee.issue(o))}};let s=t.transform(r.value,r);return s instanceof Promise?s.then(a=>(r.value=a,r)):(r.value=s,r)}});function Mw(e){return new lD({type:"transform",transform:e})}var Lw=re("ZodOptional",(e,t)=>{Gm.init(e,t),It.init(e,t),e._zod.processJSONSchema=(r,n,s)=>sw(e,r,n,s),e.unwrap=()=>e._zod.def.innerType});function Cr(e){return new Lw({type:"optional",innerType:e})}var uD=re("ZodExactOptional",(e,t)=>{rT.init(e,t),It.init(e,t),e._zod.processJSONSchema=(r,n,s)=>sw(e,r,n,s),e.unwrap=()=>e._zod.def.innerType});function dD(e){return new uD({type:"optional",innerType:e})}var pD=re("ZodNullable",(e,t)=>{nT.init(e,t),It.init(e,t),e._zod.processJSONSchema=(r,n,s)=>vR(e,r,n,s),e.unwrap=()=>e._zod.def.innerType});function xg(e){return new pD({type:"nullable",innerType:e})}function nZ(e){return Cr(xg(e))}var fD=re("ZodDefault",(e,t)=>{iT.init(e,t),It.init(e,t),e._zod.processJSONSchema=(r,n,s)=>SR(e,r,n,s),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function hD(e,t){return new fD({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Ee.shallowClone(t)}})}var mD=re("ZodPrefault",(e,t)=>{sT.init(e,t),It.init(e,t),e._zod.processJSONSchema=(r,n,s)=>TR(e,r,n,s),e.unwrap=()=>e._zod.def.innerType});function gD(e,t){return new mD({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Ee.shallowClone(t)}})}var Fw=re("ZodNonOptional",(e,t)=>{aT.init(e,t),It.init(e,t),e._zod.processJSONSchema=(r,n,s)=>xR(e,r,n,s),e.unwrap=()=>e._zod.def.innerType});function yD(e,t){return new Fw({type:"nonoptional",innerType:e,...Ee.normalizeParams(t)})}var _D=re("ZodSuccess",(e,t)=>{oT.init(e,t),It.init(e,t),e._zod.processJSONSchema=(r,n,s)=>lR(e,r,n,s),e.unwrap=()=>e._zod.def.innerType});function iZ(e){return new _D({type:"success",innerType:e})}var bD=re("ZodCatch",(e,t)=>{cT.init(e,t),It.init(e,t),e._zod.processJSONSchema=(r,n,s)=>wR(e,r,n,s),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function vD(e,t){return new bD({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}var xD=re("ZodNaN",(e,t)=>{lT.init(e,t),It.init(e,t),e._zod.processJSONSchema=(r,n,s)=>aR(e,r,n,s)});function sZ(e){return VT(xD,e)}var jw=re("ZodPipe",(e,t)=>{uT.init(e,t),It.init(e,t),e._zod.processJSONSchema=(r,n,s)=>ER(e,r,n,s),e.in=t.in,e.out=t.out});function Sg(e,t){return new jw({type:"pipe",in:e,out:t})}var Bw=re("ZodCodec",(e,t)=>{jw.init(e,t),sp.init(e,t)});function aZ(e,t,r){return new Bw({type:"pipe",in:e,out:t,transform:r.decode,reverseTransform:r.encode})}var SD=re("ZodReadonly",(e,t)=>{dT.init(e,t),It.init(e,t),e._zod.processJSONSchema=(r,n,s)=>PR(e,r,n,s),e.unwrap=()=>e._zod.def.innerType});function TD(e){return new SD({type:"readonly",innerType:e})}var wD=re("ZodTemplateLiteral",(e,t)=>{pT.init(e,t),It.init(e,t),e._zod.processJSONSchema=(r,n,s)=>oR(e,r,n,s)});function oZ(e,t){return new wD({type:"template_literal",parts:e,...Ee.normalizeParams(t)})}var ED=re("ZodLazy",(e,t)=>{mT.init(e,t),It.init(e,t),e._zod.processJSONSchema=(r,n,s)=>AR(e,r,n,s),e.unwrap=()=>e._zod.def.getter()});function PD(e){return new ED({type:"lazy",getter:e})}var ID=re("ZodPromise",(e,t)=>{hT.init(e,t),It.init(e,t),e._zod.processJSONSchema=(r,n,s)=>IR(e,r,n,s),e.unwrap=()=>e._zod.def.innerType});function cZ(e){return new ID({type:"promise",innerType:e})}var AD=re("ZodFunction",(e,t)=>{fT.init(e,t),It.init(e,t),e._zod.processJSONSchema=(r,n,s)=>dR(e,r,n,s)});function lZ(e){return new AD({type:"function",input:Array.isArray(e?.input)?iD(e?.input):e?.input??Bt(br()),output:e?.output??br()})}var Og=re("ZodCustom",(e,t)=>{gT.init(e,t),It.init(e,t),e._zod.processJSONSchema=(r,n,s)=>uR(e,r,n,s)});function uZ(e){let t=new yr({check:"custom"});return t._zod.check=e,t}function zw(e,t){return XT(Og,e??(()=>!0),t)}function kD(e,t={}){return QT(Og,e,t)}function CD(e){return ew(e)}var dZ=tw,pZ=rw;function fZ(e,t={}){let r=new Og({type:"custom",check:"custom",fn:n=>n instanceof e,abort:!0,...Ee.normalizeParams(t)});return r._zod.bag.Class=e,r._zod.check=n=>{n.value instanceof e||n.issues.push({code:"invalid_type",expected:e.name,input:n.value,inst:r,path:[...r._zod.def.path??[]]})},r}var hZ=(...e)=>nw({Codec:Bw,Boolean:Pg,String:Tg},...e);function mZ(e){let t=PD(()=>hr([ue(e),ar(),rn(),Tp(),Bt(t),wr(ue(),t)]));return t}function $g(e,t){return Sg(Mw(e),t)}var ND;ND||(ND={});var gKe={...vp,...bg,iso:oc};ln(yT());var qw="2025-11-25";var OD=[qw,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],io="io.modelcontextprotocol/related-task",Dg="2.0",bn=zw(e=>e!==null&&(typeof e=="object"||typeof e=="function")),$D=hr([ue(),ar().int()]),RD=ue(),DKe=Nn({ttl:hr([ar(),Tp()]).optional(),pollInterval:ar().optional()}),bZ=ze({ttl:ar().optional()}),vZ=ze({taskId:ue()}),Ww=Nn({progressToken:$D.optional(),[io]:vZ.optional()}),Pi=ze({_meta:Ww.optional()}),Ep=Pi.extend({task:bZ.optional()}),DD=e=>Ep.safeParse(e).success,vn=ze({method:ue(),params:Pi.loose().optional()}),Li=ze({_meta:Ww.optional()}),Fi=ze({method:ue(),params:Li.loose().optional()}),xn=Nn({_meta:Ww.optional()}),Mg=hr([ue(),ar().int()]),MD=ze({jsonrpc:He(Dg),id:Mg,...vn.shape}).strict(),Vw=e=>MD.safeParse(e).success,LD=ze({jsonrpc:He(Dg),...Fi.shape}).strict(),FD=e=>LD.safeParse(e).success,Kw=ze({jsonrpc:He(Dg),id:Mg,result:xn}).strict(),Pp=e=>Kw.safeParse(e).success;var Zt;(function(e){e[e.ConnectionClosed=-32e3]="ConnectionClosed",e[e.RequestTimeout=-32001]="RequestTimeout",e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(Zt||(Zt={}));var Gw=ze({jsonrpc:He(Dg),id:Mg.optional(),error:ze({code:ar().int(),message:ue(),data:br().optional()})}).strict();var jD=e=>Gw.safeParse(e).success;var BD=hr([MD,LD,Kw,Gw]),MKe=hr([Kw,Gw]),Lg=xn.strict(),xZ=Li.extend({requestId:Mg.optional(),reason:ue().optional()}),Fg=Fi.extend({method:He("notifications/cancelled"),params:xZ}),SZ=ze({src:ue(),mimeType:ue().optional(),sizes:Bt(ue()).optional(),theme:On(["light","dark"]).optional()}),Ip=ze({icons:Bt(SZ).optional()}),Ul=ze({name:ue(),title:ue().optional()}),zD=Ul.extend({...Ul.shape,...Ip.shape,version:ue(),websiteUrl:ue().optional(),description:ue().optional()}),TZ=wp(ze({applyDefaults:rn().optional()}),wr(ue(),br())),wZ=$g(e=>e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,wp(ze({form:TZ.optional(),url:bn.optional()}),wr(ue(),br()).optional())),EZ=Nn({list:bn.optional(),cancel:bn.optional(),requests:Nn({sampling:Nn({createMessage:bn.optional()}).optional(),elicitation:Nn({create:bn.optional()}).optional()}).optional()}),PZ=Nn({list:bn.optional(),cancel:bn.optional(),requests:Nn({tools:Nn({call:bn.optional()}).optional()}).optional()}),IZ=ze({experimental:wr(ue(),bn).optional(),sampling:ze({context:bn.optional(),tools:bn.optional()}).optional(),elicitation:wZ.optional(),roots:ze({listChanged:rn().optional()}).optional(),tasks:EZ.optional()}),AZ=Pi.extend({protocolVersion:ue(),capabilities:IZ,clientInfo:zD}),Zw=vn.extend({method:He("initialize"),params:AZ});var kZ=ze({experimental:wr(ue(),bn).optional(),logging:bn.optional(),completions:bn.optional(),prompts:ze({listChanged:rn().optional()}).optional(),resources:ze({subscribe:rn().optional(),listChanged:rn().optional()}).optional(),tools:ze({listChanged:rn().optional()}).optional(),tasks:PZ.optional()}),CZ=xn.extend({protocolVersion:ue(),capabilities:kZ,serverInfo:zD,instructions:ue().optional()}),Hw=Fi.extend({method:He("notifications/initialized"),params:Li.optional()});var jg=vn.extend({method:He("ping"),params:Pi.optional()}),NZ=ze({progress:ar(),total:Cr(ar()),message:Cr(ue())}),OZ=ze({...Li.shape,...NZ.shape,progressToken:$D}),Bg=Fi.extend({method:He("notifications/progress"),params:OZ}),$Z=Pi.extend({cursor:RD.optional()}),Ap=vn.extend({params:$Z.optional()}),kp=xn.extend({nextCursor:RD.optional()}),RZ=On(["working","input_required","completed","failed","cancelled"]),Cp=ze({taskId:ue(),status:RZ,ttl:hr([ar(),Tp()]),createdAt:ue(),lastUpdatedAt:ue(),pollInterval:Cr(ar()),statusMessage:Cr(ue())}),ql=xn.extend({task:Cp}),DZ=Li.merge(Cp),Np=Fi.extend({method:He("notifications/tasks/status"),params:DZ}),zg=vn.extend({method:He("tasks/get"),params:Pi.extend({taskId:ue()})}),Ug=xn.merge(Cp),qg=vn.extend({method:He("tasks/result"),params:Pi.extend({taskId:ue()})}),LKe=xn.loose(),Wg=Ap.extend({method:He("tasks/list")}),Vg=kp.extend({tasks:Bt(Cp)}),Kg=vn.extend({method:He("tasks/cancel"),params:Pi.extend({taskId:ue()})}),UD=xn.merge(Cp),qD=ze({uri:ue(),mimeType:Cr(ue()),_meta:wr(ue(),br()).optional()}),WD=qD.extend({text:ue()}),Jw=ue().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),VD=qD.extend({blob:Jw}),Op=On(["user","assistant"]),Wl=ze({audience:Bt(Op).optional(),priority:ar().min(0).max(1).optional(),lastModified:oc.datetime({offset:!0}).optional()}),KD=ze({...Ul.shape,...Ip.shape,uri:ue(),description:Cr(ue()),mimeType:Cr(ue()),annotations:Wl.optional(),_meta:Cr(Nn({}))}),MZ=ze({...Ul.shape,...Ip.shape,uriTemplate:ue(),description:Cr(ue()),mimeType:Cr(ue()),annotations:Wl.optional(),_meta:Cr(Nn({}))}),Yw=Ap.extend({method:He("resources/list")}),LZ=kp.extend({resources:Bt(KD)}),FZ=Ap.extend({method:He("resources/templates/list")}),jZ=kp.extend({resourceTemplates:Bt(MZ)}),Xw=Pi.extend({uri:ue()}),BZ=Xw,Qw=vn.extend({method:He("resources/read"),params:BZ}),zZ=xn.extend({contents:Bt(hr([WD,VD]))}),UZ=Fi.extend({method:He("notifications/resources/list_changed"),params:Li.optional()}),qZ=Xw,WZ=vn.extend({method:He("resources/subscribe"),params:qZ}),VZ=Xw,KZ=vn.extend({method:He("resources/unsubscribe"),params:VZ}),GZ=Li.extend({uri:ue()}),ZZ=Fi.extend({method:He("notifications/resources/updated"),params:GZ}),HZ=ze({name:ue(),description:Cr(ue()),required:Cr(rn())}),JZ=ze({...Ul.shape,...Ip.shape,description:Cr(ue()),arguments:Cr(Bt(HZ)),_meta:Cr(Nn({}))}),YZ=Ap.extend({method:He("prompts/list")}),XZ=kp.extend({prompts:Bt(JZ)}),QZ=Pi.extend({name:ue(),arguments:wr(ue(),ue()).optional()}),e7=vn.extend({method:He("prompts/get"),params:QZ}),e0=ze({type:He("text"),text:ue(),annotations:Wl.optional(),_meta:wr(ue(),br()).optional()}),t0=ze({type:He("image"),data:Jw,mimeType:ue(),annotations:Wl.optional(),_meta:wr(ue(),br()).optional()}),r0=ze({type:He("audio"),data:Jw,mimeType:ue(),annotations:Wl.optional(),_meta:wr(ue(),br()).optional()}),t7=ze({type:He("tool_use"),name:ue(),id:ue(),input:wr(ue(),br()),_meta:wr(ue(),br()).optional()}),r7=ze({type:He("resource"),resource:hr([WD,VD]),annotations:Wl.optional(),_meta:wr(ue(),br()).optional()}),n7=KD.extend({type:He("resource_link")}),n0=hr([e0,t0,r0,n7,r7]),i7=ze({role:Op,content:n0}),s7=xn.extend({description:ue().optional(),messages:Bt(i7)}),a7=Fi.extend({method:He("notifications/prompts/list_changed"),params:Li.optional()}),o7=ze({title:ue().optional(),readOnlyHint:rn().optional(),destructiveHint:rn().optional(),idempotentHint:rn().optional(),openWorldHint:rn().optional()}),c7=ze({taskSupport:On(["required","optional","forbidden"]).optional()}),GD=ze({...Ul.shape,...Ip.shape,description:ue().optional(),inputSchema:ze({type:He("object"),properties:wr(ue(),bn).optional(),required:Bt(ue()).optional()}).catchall(br()),outputSchema:ze({type:He("object"),properties:wr(ue(),bn).optional(),required:Bt(ue()).optional()}).catchall(br()).optional(),annotations:o7.optional(),execution:c7.optional(),_meta:wr(ue(),br()).optional()}),i0=Ap.extend({method:He("tools/list")}),l7=kp.extend({tools:Bt(GD)}),Gg=xn.extend({content:Bt(n0).default([]),structuredContent:wr(ue(),br()).optional(),isError:rn().optional()}),FKe=Gg.or(xn.extend({toolResult:br()})),u7=Ep.extend({name:ue(),arguments:wr(ue(),br()).optional()}),$p=vn.extend({method:He("tools/call"),params:u7}),d7=Fi.extend({method:He("notifications/tools/list_changed"),params:Li.optional()}),jKe=ze({autoRefresh:rn().default(!0),debounceMs:ar().int().nonnegative().default(300)}),Rp=On(["debug","info","notice","warning","error","critical","alert","emergency"]),p7=Pi.extend({level:Rp}),s0=vn.extend({method:He("logging/setLevel"),params:p7}),f7=Li.extend({level:Rp,logger:ue().optional(),data:br()}),h7=Fi.extend({method:He("notifications/message"),params:f7}),m7=ze({name:ue().optional()}),g7=ze({hints:Bt(m7).optional(),costPriority:ar().min(0).max(1).optional(),speedPriority:ar().min(0).max(1).optional(),intelligencePriority:ar().min(0).max(1).optional()}),y7=ze({mode:On(["auto","required","none"]).optional()}),_7=ze({type:He("tool_result"),toolUseId:ue().describe("The unique identifier for the corresponding tool call."),content:Bt(n0).default([]),structuredContent:ze({}).loose().optional(),isError:rn().optional(),_meta:wr(ue(),br()).optional()}),b7=Cg("type",[e0,t0,r0]),Rg=Cg("type",[e0,t0,r0,t7,_7]),v7=ze({role:Op,content:hr([Rg,Bt(Rg)]),_meta:wr(ue(),br()).optional()}),x7=Ep.extend({messages:Bt(v7),modelPreferences:g7.optional(),systemPrompt:ue().optional(),includeContext:On(["none","thisServer","allServers"]).optional(),temperature:ar().optional(),maxTokens:ar().int(),stopSequences:Bt(ue()).optional(),metadata:bn.optional(),tools:Bt(GD).optional(),toolChoice:y7.optional()}),S7=vn.extend({method:He("sampling/createMessage"),params:x7}),Dp=xn.extend({model:ue(),stopReason:Cr(On(["endTurn","stopSequence","maxTokens"]).or(ue())),role:Op,content:b7}),a0=xn.extend({model:ue(),stopReason:Cr(On(["endTurn","stopSequence","maxTokens","toolUse"]).or(ue())),role:Op,content:hr([Rg,Bt(Rg)])}),T7=ze({type:He("boolean"),title:ue().optional(),description:ue().optional(),default:rn().optional()}),w7=ze({type:He("string"),title:ue().optional(),description:ue().optional(),minLength:ar().optional(),maxLength:ar().optional(),format:On(["email","uri","date","date-time"]).optional(),default:ue().optional()}),E7=ze({type:On(["number","integer"]),title:ue().optional(),description:ue().optional(),minimum:ar().optional(),maximum:ar().optional(),default:ar().optional()}),P7=ze({type:He("string"),title:ue().optional(),description:ue().optional(),enum:Bt(ue()),default:ue().optional()}),I7=ze({type:He("string"),title:ue().optional(),description:ue().optional(),oneOf:Bt(ze({const:ue(),title:ue()})),default:ue().optional()}),A7=ze({type:He("string"),title:ue().optional(),description:ue().optional(),enum:Bt(ue()),enumNames:Bt(ue()).optional(),default:ue().optional()}),k7=hr([P7,I7]),C7=ze({type:He("array"),title:ue().optional(),description:ue().optional(),minItems:ar().optional(),maxItems:ar().optional(),items:ze({type:He("string"),enum:Bt(ue())}),default:Bt(ue()).optional()}),N7=ze({type:He("array"),title:ue().optional(),description:ue().optional(),minItems:ar().optional(),maxItems:ar().optional(),items:ze({anyOf:Bt(ze({const:ue(),title:ue()}))}),default:Bt(ue()).optional()}),O7=hr([C7,N7]),$7=hr([A7,k7,O7]),R7=hr([$7,T7,w7,E7]),D7=Ep.extend({mode:He("form").optional(),message:ue(),requestedSchema:ze({type:He("object"),properties:wr(ue(),R7),required:Bt(ue()).optional()})}),M7=Ep.extend({mode:He("url"),message:ue(),elicitationId:ue(),url:ue().url()}),L7=hr([D7,M7]),F7=vn.extend({method:He("elicitation/create"),params:L7}),j7=Li.extend({elicitationId:ue()}),B7=Fi.extend({method:He("notifications/elicitation/complete"),params:j7}),Vl=xn.extend({action:On(["accept","decline","cancel"]),content:$g(e=>e===null?void 0:e,wr(ue(),hr([ue(),ar(),rn(),Bt(ue())])).optional())}),z7=ze({type:He("ref/resource"),uri:ue()});var U7=ze({type:He("ref/prompt"),name:ue()}),q7=Pi.extend({ref:hr([U7,z7]),argument:ze({name:ue(),value:ue()}),context:ze({arguments:wr(ue(),ue()).optional()}).optional()}),W7=vn.extend({method:He("completion/complete"),params:q7});var V7=xn.extend({completion:Nn({values:Bt(ue()).max(100),total:Cr(ar().int()),hasMore:Cr(rn())})}),K7=ze({uri:ue().startsWith("file://"),name:ue().optional(),_meta:wr(ue(),br()).optional()}),G7=vn.extend({method:He("roots/list"),params:Pi.optional()}),o0=xn.extend({roots:Bt(K7)}),Z7=Fi.extend({method:He("notifications/roots/list_changed"),params:Li.optional()}),BKe=hr([jg,Zw,W7,s0,e7,YZ,Yw,FZ,Qw,WZ,KZ,$p,i0,zg,qg,Wg,Kg]),zKe=hr([Fg,Bg,Hw,Z7,Np]),UKe=hr([Lg,Dp,a0,Vl,o0,Ug,Vg,ql]),qKe=hr([jg,S7,F7,G7,zg,qg,Wg,Kg]),WKe=hr([Fg,Bg,h7,ZZ,UZ,d7,a7,Np,B7]),VKe=hr([Lg,CZ,V7,s7,XZ,LZ,jZ,zZ,Gg,l7,Ug,Vg,ql]),At=class e extends Error{constructor(t,r,n){super(`MCP error ${t}: ${r}`),this.code=t,this.data=n,this.name="McpError"}static fromError(t,r,n){if(t===Zt.UrlElicitationRequired&&n){let s=n;if(s.elicitations)return new Uw(s.elicitations,r)}return new e(t,r,n)}},Uw=class extends At{constructor(t,r=`URL elicitation${t.length>1?"s":""} required`){super(Zt.UrlElicitationRequired,r,{elicitations:t})}get elicitations(){return this.data?.elicitations??[]}};function so(e){return e==="completed"||e==="failed"||e==="cancelled"}var H7=Symbol("Let zodToJsonSchema decide on which parser to use");var EGe=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function c0(e){let r=_g(e)?.method;if(!r)throw new Error("Schema is missing a method literal");let n=NR(r);if(typeof n!="string")throw new Error("Schema method literal must be a string");return n}function l0(e,t){let r=no(e,t);if(!r.success)throw r.error;return r.data}var tH=6e4,Zg=class{constructor(t){this._options=t,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(Fg,r=>{this._oncancel(r)}),this.setNotificationHandler(Bg,r=>{this._onprogress(r)}),this.setRequestHandler(jg,r=>({})),this._taskStore=t?.taskStore,this._taskMessageQueue=t?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(zg,async(r,n)=>{let s=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!s)throw new At(Zt.InvalidParams,"Failed to retrieve task: Task not found");return{...s}}),this.setRequestHandler(qg,async(r,n)=>{let s=async()=>{let a=r.params.taskId;if(this._taskMessageQueue){let c;for(;c=await this._taskMessageQueue.dequeue(a,n.sessionId);){if(c.type==="response"||c.type==="error"){let l=c.message,u=l.id,d=this._requestResolvers.get(u);if(d)if(this._requestResolvers.delete(u),c.type==="response")d(l);else{let p=l,f=new At(p.error.code,p.error.message,p.error.data);d(f)}else{let p=c.type==="response"?"Response":"Error";this._onerror(new Error(`${p} handler missing for request ${u}`))}continue}await this._transport?.send(c.message,{relatedRequestId:n.requestId})}}let o=await this._taskStore.getTask(a,n.sessionId);if(!o)throw new At(Zt.InvalidParams,`Task not found: ${a}`);if(!so(o.status))return await this._waitForTaskUpdate(a,n.signal),await s();if(so(o.status)){let c=await this._taskStore.getTaskResult(a,n.sessionId);return this._clearTaskQueue(a),{...c,_meta:{...c._meta,[io]:{taskId:a}}}}return await s()};return await s()}),this.setRequestHandler(Wg,async(r,n)=>{try{let{tasks:s,nextCursor:a}=await this._taskStore.listTasks(r.params?.cursor,n.sessionId);return{tasks:s,nextCursor:a,_meta:{}}}catch(s){throw new At(Zt.InvalidParams,`Failed to list tasks: ${s instanceof Error?s.message:String(s)}`)}}),this.setRequestHandler(Kg,async(r,n)=>{try{let s=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!s)throw new At(Zt.InvalidParams,`Task not found: ${r.params.taskId}`);if(so(s.status))throw new At(Zt.InvalidParams,`Cannot cancel task in terminal status: ${s.status}`);await this._taskStore.updateTaskStatus(r.params.taskId,"cancelled","Client cancelled task execution.",n.sessionId),this._clearTaskQueue(r.params.taskId);let a=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!a)throw new At(Zt.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...a}}catch(s){throw s instanceof At?s:new At(Zt.InvalidRequest,`Failed to cancel task: ${s instanceof Error?s.message:String(s)}`)}}))}async _oncancel(t){if(!t.params.requestId)return;this._requestHandlerAbortControllers.get(t.params.requestId)?.abort(t.params.reason)}_setupTimeout(t,r,n,s,a=!1){this._timeoutInfo.set(t,{timeoutId:setTimeout(s,r),startTime:Date.now(),timeout:r,maxTotalTimeout:n,resetTimeoutOnProgress:a,onTimeout:s})}_resetTimeout(t){let r=this._timeoutInfo.get(t);if(!r)return!1;let n=Date.now()-r.startTime;if(r.maxTotalTimeout&&n>=r.maxTotalTimeout)throw this._timeoutInfo.delete(t),At.fromError(Zt.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:r.maxTotalTimeout,totalElapsed:n});return clearTimeout(r.timeoutId),r.timeoutId=setTimeout(r.onTimeout,r.timeout),!0}_cleanupTimeout(t){let r=this._timeoutInfo.get(t);r&&(clearTimeout(r.timeoutId),this._timeoutInfo.delete(t))}async connect(t){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=t;let r=this.transport?.onclose;this._transport.onclose=()=>{r?.(),this._onclose()};let n=this.transport?.onerror;this._transport.onerror=a=>{n?.(a),this._onerror(a)};let s=this._transport?.onmessage;this._transport.onmessage=(a,o)=>{s?.(a,o),Pp(a)||jD(a)?this._onresponse(a):Vw(a)?this._onrequest(a,o):FD(a)?this._onnotification(a):this._onerror(new Error(`Unknown message type: ${JSON.stringify(a)}`))},await this._transport.start()}_onclose(){let t=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let n of this._requestHandlerAbortControllers.values())n.abort();this._requestHandlerAbortControllers.clear();let r=At.fromError(Zt.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let n of t.values())n(r)}_onerror(t){this.onerror?.(t)}_onnotification(t){let r=this._notificationHandlers.get(t.method)??this.fallbackNotificationHandler;r!==void 0&&Promise.resolve().then(()=>r(t)).catch(n=>this._onerror(new Error(`Uncaught error in notification handler: ${n}`)))}_onrequest(t,r){let n=this._requestHandlers.get(t.method)??this.fallbackRequestHandler,s=this._transport,a=t.params?._meta?.[io]?.taskId;if(n===void 0){let d={jsonrpc:"2.0",id:t.id,error:{code:Zt.MethodNotFound,message:"Method not found"}};a&&this._taskMessageQueue?this._enqueueTaskMessage(a,{type:"error",message:d,timestamp:Date.now()},s?.sessionId).catch(p=>this._onerror(new Error(`Failed to enqueue error response: ${p}`))):s?.send(d).catch(p=>this._onerror(new Error(`Failed to send an error response: ${p}`)));return}let o=new AbortController;this._requestHandlerAbortControllers.set(t.id,o);let c=DD(t.params)?t.params.task:void 0,l=this._taskStore?this.requestTaskStore(t,s?.sessionId):void 0,u={signal:o.signal,sessionId:s?.sessionId,_meta:t.params?._meta,sendNotification:async d=>{if(o.signal.aborted)return;let p={relatedRequestId:t.id};a&&(p.relatedTask={taskId:a}),await this.notification(d,p)},sendRequest:async(d,p,f)=>{if(o.signal.aborted)throw new At(Zt.ConnectionClosed,"Request was cancelled");let h={...f,relatedRequestId:t.id};a&&!h.relatedTask&&(h.relatedTask={taskId:a});let m=h.relatedTask?.taskId??a;return m&&l&&await l.updateTaskStatus(m,"input_required"),await this.request(d,p,h)},authInfo:r?.authInfo,requestId:t.id,requestInfo:r?.requestInfo,taskId:a,taskStore:l,taskRequestedTtl:c?.ttl,closeSSEStream:r?.closeSSEStream,closeStandaloneSSEStream:r?.closeStandaloneSSEStream};Promise.resolve().then(()=>{c&&this.assertTaskHandlerCapability(t.method)}).then(()=>n(t,u)).then(async d=>{if(o.signal.aborted)return;let p={result:d,jsonrpc:"2.0",id:t.id};a&&this._taskMessageQueue?await this._enqueueTaskMessage(a,{type:"response",message:p,timestamp:Date.now()},s?.sessionId):await s?.send(p)},async d=>{if(o.signal.aborted)return;let p={jsonrpc:"2.0",id:t.id,error:{code:Number.isSafeInteger(d.code)?d.code:Zt.InternalError,message:d.message??"Internal error",...d.data!==void 0&&{data:d.data}}};a&&this._taskMessageQueue?await this._enqueueTaskMessage(a,{type:"error",message:p,timestamp:Date.now()},s?.sessionId):await s?.send(p)}).catch(d=>this._onerror(new Error(`Failed to send response: ${d}`))).finally(()=>{this._requestHandlerAbortControllers.delete(t.id)})}_onprogress(t){let{progressToken:r,...n}=t.params,s=Number(r),a=this._progressHandlers.get(s);if(!a){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(t)}`));return}let o=this._responseHandlers.get(s),c=this._timeoutInfo.get(s);if(c&&o&&c.resetTimeoutOnProgress)try{this._resetTimeout(s)}catch(l){this._responseHandlers.delete(s),this._progressHandlers.delete(s),this._cleanupTimeout(s),o(l);return}a(n)}_onresponse(t){let r=Number(t.id),n=this._requestResolvers.get(r);if(n){if(this._requestResolvers.delete(r),Pp(t))n(t);else{let o=new At(t.error.code,t.error.message,t.error.data);n(o)}return}let s=this._responseHandlers.get(r);if(s===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(t)}`));return}this._responseHandlers.delete(r),this._cleanupTimeout(r);let a=!1;if(Pp(t)&&t.result&&typeof t.result=="object"){let o=t.result;if(o.task&&typeof o.task=="object"){let c=o.task;typeof c.taskId=="string"&&(a=!0,this._taskProgressTokens.set(c.taskId,r))}}if(a||this._progressHandlers.delete(r),Pp(t))s(t);else{let o=At.fromError(t.error.code,t.error.message,t.error.data);s(o)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(t,r,n){let{task:s}=n??{};if(!s){try{yield{type:"result",result:await this.request(t,r,n)}}catch(o){yield{type:"error",error:o instanceof At?o:new At(Zt.InternalError,String(o))}}return}let a;try{let o=await this.request(t,ql,n);if(o.task)a=o.task.taskId,yield{type:"taskCreated",task:o.task};else throw new At(Zt.InternalError,"Task creation did not return a task");for(;;){let c=await this.getTask({taskId:a},n);if(yield{type:"taskStatus",task:c},so(c.status)){c.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:a},r,n)}:c.status==="failed"?yield{type:"error",error:new At(Zt.InternalError,`Task ${a} failed`)}:c.status==="cancelled"&&(yield{type:"error",error:new At(Zt.InternalError,`Task ${a} was cancelled`)});return}if(c.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:a},r,n)};return}let l=c.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(u=>setTimeout(u,l)),n?.signal?.throwIfAborted()}}catch(o){yield{type:"error",error:o instanceof At?o:new At(Zt.InternalError,String(o))}}}request(t,r,n){let{relatedRequestId:s,resumptionToken:a,onresumptiontoken:o,task:c,relatedTask:l}=n??{};return new Promise((u,d)=>{let p=v=>{d(v)};if(!this._transport){p(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method),c&&this.assertTaskCapability(t.method)}catch(v){p(v);return}n?.signal?.throwIfAborted();let f=this._requestMessageId++,h={...t,jsonrpc:"2.0",id:f};n?.onprogress&&(this._progressHandlers.set(f,n.onprogress),h.params={...t.params,_meta:{...t.params?._meta||{},progressToken:f}}),c&&(h.params={...h.params,task:c}),l&&(h.params={...h.params,_meta:{...h.params?._meta||{},[io]:l}});let m=v=>{this._responseHandlers.delete(f),this._progressHandlers.delete(f),this._cleanupTimeout(f),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:f,reason:String(v)}},{relatedRequestId:s,resumptionToken:a,onresumptiontoken:o}).catch(w=>this._onerror(new Error(`Failed to send cancellation: ${w}`)));let S=v instanceof At?v:new At(Zt.RequestTimeout,String(v));d(S)};this._responseHandlers.set(f,v=>{if(!n?.signal?.aborted){if(v instanceof Error)return d(v);try{let S=no(r,v.result);S.success?u(S.data):d(S.error)}catch(S){d(S)}}}),n?.signal?.addEventListener("abort",()=>{m(n?.signal?.reason)});let g=n?.timeout??tH,y=()=>m(At.fromError(Zt.RequestTimeout,"Request timed out",{timeout:g}));this._setupTimeout(f,g,n?.maxTotalTimeout,y,n?.resetTimeoutOnProgress??!1);let _=l?.taskId;if(_){let v=S=>{let w=this._responseHandlers.get(f);w?w(S):this._onerror(new Error(`Response handler missing for side-channeled request ${f}`))};this._requestResolvers.set(f,v),this._enqueueTaskMessage(_,{type:"request",message:h,timestamp:Date.now()}).catch(S=>{this._cleanupTimeout(f),d(S)})}else this._transport.send(h,{relatedRequestId:s,resumptionToken:a,onresumptiontoken:o}).catch(v=>{this._cleanupTimeout(f),d(v)})})}async getTask(t,r){return this.request({method:"tasks/get",params:t},Ug,r)}async getTaskResult(t,r,n){return this.request({method:"tasks/result",params:t},r,n)}async listTasks(t,r){return this.request({method:"tasks/list",params:t},Vg,r)}async cancelTask(t,r){return this.request({method:"tasks/cancel",params:t},UD,r)}async notification(t,r){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(t.method);let n=r?.relatedTask?.taskId;if(n){let c={...t,jsonrpc:"2.0",params:{...t.params,_meta:{...t.params?._meta||{},[io]:r.relatedTask}}};await this._enqueueTaskMessage(n,{type:"notification",message:c,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(t.method)&&!t.params&&!r?.relatedRequestId&&!r?.relatedTask){if(this._pendingDebouncedNotifications.has(t.method))return;this._pendingDebouncedNotifications.add(t.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(t.method),!this._transport)return;let c={...t,jsonrpc:"2.0"};r?.relatedTask&&(c={...c,params:{...c.params,_meta:{...c.params?._meta||{},[io]:r.relatedTask}}}),this._transport?.send(c,r).catch(l=>this._onerror(l))});return}let o={...t,jsonrpc:"2.0"};r?.relatedTask&&(o={...o,params:{...o.params,_meta:{...o.params?._meta||{},[io]:r.relatedTask}}}),await this._transport.send(o,r)}setRequestHandler(t,r){let n=c0(t);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(s,a)=>{let o=l0(t,s);return Promise.resolve(r(o,a))})}removeRequestHandler(t){this._requestHandlers.delete(t)}assertCanSetRequestHandler(t){if(this._requestHandlers.has(t))throw new Error(`A request handler for ${t} already exists, which would be overridden`)}setNotificationHandler(t,r){let n=c0(t);this._notificationHandlers.set(n,s=>{let a=l0(t,s);return Promise.resolve(r(a))})}removeNotificationHandler(t){this._notificationHandlers.delete(t)}_cleanupTaskProgressHandler(t){let r=this._taskProgressTokens.get(t);r!==void 0&&(this._progressHandlers.delete(r),this._taskProgressTokens.delete(t))}async _enqueueTaskMessage(t,r,n){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let s=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(t,r,n,s)}async _clearTaskQueue(t,r){if(this._taskMessageQueue){let n=await this._taskMessageQueue.dequeueAll(t,r);for(let s of n)if(s.type==="request"&&Vw(s.message)){let a=s.message.id,o=this._requestResolvers.get(a);o?(o(new At(Zt.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(a)):this._onerror(new Error(`Resolver missing for request ${a} during task ${t} cleanup`))}}}async _waitForTaskUpdate(t,r){let n=this._options?.defaultTaskPollInterval??1e3;try{let s=await this._taskStore?.getTask(t);s?.pollInterval&&(n=s.pollInterval)}catch{}return new Promise((s,a)=>{if(r.aborted){a(new At(Zt.InvalidRequest,"Request cancelled"));return}let o=setTimeout(s,n);r.addEventListener("abort",()=>{clearTimeout(o),a(new At(Zt.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(t,r){let n=this._taskStore;if(!n)throw new Error("No task store configured");return{createTask:async s=>{if(!t)throw new Error("No request provided");return await n.createTask(s,t.id,{method:t.method,params:t.params},r)},getTask:async s=>{let a=await n.getTask(s,r);if(!a)throw new At(Zt.InvalidParams,"Failed to retrieve task: Task not found");return a},storeTaskResult:async(s,a,o)=>{await n.storeTaskResult(s,a,o,r);let c=await n.getTask(s,r);if(c){let l=Np.parse({method:"notifications/tasks/status",params:c});await this.notification(l),so(c.status)&&this._cleanupTaskProgressHandler(s)}},getTaskResult:s=>n.getTaskResult(s,r),updateTaskStatus:async(s,a,o)=>{let c=await n.getTask(s,r);if(!c)throw new At(Zt.InvalidParams,`Task "${s}" not found - it may have been cleaned up`);if(so(c.status))throw new At(Zt.InvalidParams,`Cannot update task "${s}" from terminal status "${c.status}" to "${a}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await n.updateTaskStatus(s,a,o,r);let l=await n.getTask(s,r);if(l){let u=Np.parse({method:"notifications/tasks/status",params:l});await this.notification(u),so(l.status)&&this._cleanupTaskProgressHandler(s)}},listTasks:s=>n.listTasks(s,r)}}};function ZD(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function HD(e,t){let r={...e};for(let n in t){let s=n,a=t[s];if(a===void 0)continue;let o=r[s];ZD(o)&&ZD(a)?r[s]={...o,...a}:r[s]=a}return r}var DF=Fe(ZE(),1),MF=Fe(RF(),1);function Kee(){let e=new DF.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,MF.default)(e),e}var Cy=class{constructor(t){this._ajv=t??Kee()}getValidator(t){let r="$id"in t&&typeof t.$id=="string"?this._ajv.getSchema(t.$id)??this._ajv.compile(t):this._ajv.compile(t);return n=>r(n)?{valid:!0,data:n,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(r.errors)}}};var Ny=class{constructor(t){this._server=t}requestStream(t,r,n){return this._server.requestStream(t,r,n)}createMessageStream(t,r){let n=this._server.getClientCapabilities();if((t.tools||t.toolChoice)&&!n?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if(t.messages.length>0){let s=t.messages[t.messages.length-1],a=Array.isArray(s.content)?s.content:[s.content],o=a.some(d=>d.type==="tool_result"),c=t.messages.length>1?t.messages[t.messages.length-2]:void 0,l=c?Array.isArray(c.content)?c.content:[c.content]:[],u=l.some(d=>d.type==="tool_use");if(o){if(a.some(d=>d.type!=="tool_result"))throw new Error("The last message must contain only tool_result content if any is present");if(!u)throw new Error("tool_result blocks are not matching any tool_use from the previous message")}if(u){let d=new Set(l.filter(f=>f.type==="tool_use").map(f=>f.id)),p=new Set(a.filter(f=>f.type==="tool_result").map(f=>f.toolUseId));if(d.size!==p.size||![...d].every(f=>p.has(f)))throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return this.requestStream({method:"sampling/createMessage",params:t},Dp,r)}elicitInputStream(t,r){let n=this._server.getClientCapabilities(),s=t.mode??"form";switch(s){case"url":{if(!n?.elicitation?.url)throw new Error("Client does not support url elicitation.");break}case"form":{if(!n?.elicitation?.form)throw new Error("Client does not support form elicitation.");break}}let a=s==="form"&&t.mode===void 0?{...t,mode:"form"}:t;return this.requestStream({method:"elicitation/create",params:a},Vl,r)}async getTask(t,r){return this._server.getTask({taskId:t},r)}async getTaskResult(t,r,n){return this._server.getTaskResult({taskId:t},r,n)}async listTasks(t,r){return this._server.listTasks(t?{cursor:t}:void 0,r)}async cancelTask(t,r){return this._server.cancelTask({taskId:t},r)}};function LF(e,t,r){if(!e)throw new Error(`${r} does not support task creation (required for ${t})`);switch(t){case"tools/call":if(!e.tools?.call)throw new Error(`${r} does not support task creation for tools/call (required for ${t})`);break;default:break}}function FF(e,t,r){if(!e)throw new Error(`${r} does not support task creation (required for ${t})`);switch(t){case"sampling/createMessage":if(!e.sampling?.createMessage)throw new Error(`${r} does not support task creation for sampling/createMessage (required for ${t})`);break;case"elicitation/create":if(!e.elicitation?.create)throw new Error(`${r} does not support task creation for elicitation/create (required for ${t})`);break;default:break}}var Oy=class extends Zg{constructor(t,r){super(r),this._serverInfo=t,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(Rp.options.map((n,s)=>[n,s])),this.isMessageIgnored=(n,s)=>{let a=this._loggingLevels.get(s);return a?this.LOG_LEVEL_SEVERITY.get(n)<this.LOG_LEVEL_SEVERITY.get(a):!1},this._capabilities=r?.capabilities??{},this._instructions=r?.instructions,this._jsonSchemaValidator=r?.jsonSchemaValidator??new Cy,this.setRequestHandler(Zw,n=>this._oninitialize(n)),this.setNotificationHandler(Hw,()=>this.oninitialized?.()),this._capabilities.logging&&this.setRequestHandler(s0,async(n,s)=>{let a=s.sessionId||s.requestInfo?.headers["mcp-session-id"]||void 0,{level:o}=n.params,c=Rp.safeParse(o);return c.success&&this._loggingLevels.set(a,c.data),{}})}get experimental(){return this._experimental||(this._experimental={tasks:new Ny(this)}),this._experimental}registerCapabilities(t){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=HD(this._capabilities,t)}setRequestHandler(t,r){let s=_g(t)?.method;if(!s)throw new Error("Schema is missing a method literal");let a;if(Bl(s)){let c=s;a=c._zod?.def?.value??c.value}else{let c=s;a=c._def?.value??c.value}if(typeof a!="string")throw new Error("Schema method literal must be a string");if(a==="tools/call"){let c=async(l,u)=>{let d=no($p,l);if(!d.success){let m=d.error instanceof Error?d.error.message:String(d.error);throw new At(Zt.InvalidParams,`Invalid tools/call request: ${m}`)}let{params:p}=d.data,f=await Promise.resolve(r(l,u));if(p.task){let m=no(ql,f);if(!m.success){let g=m.error instanceof Error?m.error.message:String(m.error);throw new At(Zt.InvalidParams,`Invalid task creation result: ${g}`)}return m.data}let h=no(Gg,f);if(!h.success){let m=h.error instanceof Error?h.error.message:String(h.error);throw new At(Zt.InvalidParams,`Invalid tools/call result: ${m}`)}return h.data};return super.setRequestHandler(t,c)}return super.setRequestHandler(t,r)}assertCapabilityForMethod(t){switch(t){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw new Error(`Client does not support sampling (required for ${t})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new Error(`Client does not support elicitation (required for ${t})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new Error(`Client does not support listing roots (required for ${t})`);break;case"ping":break}}assertNotificationCapability(t){switch(t){case"notifications/message":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${t})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new Error(`Server does not support notifying about resources (required for ${t})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new Error(`Server does not support notifying of tool list changes (required for ${t})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new Error(`Server does not support notifying of prompt list changes (required for ${t})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new Error(`Client does not support URL elicitation (required for ${t})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(t){if(this._capabilities)switch(t){case"completion/complete":if(!this._capabilities.completions)throw new Error(`Server does not support completions (required for ${t})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${t})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new Error(`Server does not support prompts (required for ${t})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new Error(`Server does not support resources (required for ${t})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new Error(`Server does not support tools (required for ${t})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Server does not support tasks capability (required for ${t})`);break;case"ping":case"initialize":break}}assertTaskCapability(t){FF(this._clientCapabilities?.tasks?.requests,t,"Client")}assertTaskHandlerCapability(t){this._capabilities&&LF(this._capabilities.tasks?.requests,t,"Server")}async _oninitialize(t){let r=t.params.protocolVersion;return this._clientCapabilities=t.params.capabilities,this._clientVersion=t.params.clientInfo,{protocolVersion:OD.includes(r)?r:qw,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"},Lg)}async createMessage(t,r){if((t.tools||t.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if(t.messages.length>0){let n=t.messages[t.messages.length-1],s=Array.isArray(n.content)?n.content:[n.content],a=s.some(u=>u.type==="tool_result"),o=t.messages.length>1?t.messages[t.messages.length-2]:void 0,c=o?Array.isArray(o.content)?o.content:[o.content]:[],l=c.some(u=>u.type==="tool_use");if(a){if(s.some(u=>u.type!=="tool_result"))throw new Error("The last message must contain only tool_result content if any is present");if(!l)throw new Error("tool_result blocks are not matching any tool_use from the previous message")}if(l){let u=new Set(c.filter(p=>p.type==="tool_use").map(p=>p.id)),d=new Set(s.filter(p=>p.type==="tool_result").map(p=>p.toolUseId));if(u.size!==d.size||![...u].every(p=>d.has(p)))throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return t.tools?this.request({method:"sampling/createMessage",params:t},a0,r):this.request({method:"sampling/createMessage",params:t},Dp,r)}async elicitInput(t,r){switch(t.mode??"form"){case"url":{if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support url elicitation.");let s=t;return this.request({method:"elicitation/create",params:s},Vl,r)}case"form":{if(!this._clientCapabilities?.elicitation?.form)throw new Error("Client does not support form elicitation.");let s=t.mode==="form"?t:{...t,mode:"form"},a=await this.request({method:"elicitation/create",params:s},Vl,r);if(a.action==="accept"&&a.content&&s.requestedSchema)try{let c=this._jsonSchemaValidator.getValidator(s.requestedSchema)(a.content);if(!c.valid)throw new At(Zt.InvalidParams,`Elicitation response content does not match requested schema: ${c.errorMessage}`)}catch(o){throw o instanceof At?o:new At(Zt.InternalError,`Error validating elicitation response: ${o instanceof Error?o.message:String(o)}`)}return a}}}createElicitationCompletionNotifier(t,r){if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:t}},r)}async listRoots(t,r){return this.request({method:"roots/list",params:t},o0,r)}async sendLoggingMessage(t,r){if(this._capabilities.logging&&!this.isMessageIgnored(t.level,r))return this.notification({method:"notifications/message",params:t})}async sendResourceUpdated(t){return this.notification({method:"notifications/resources/updated",params:t})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}};var rP=Fe(require("node:process"),1);var $y=class{append(t){this._buffer=this._buffer?Buffer.concat([this._buffer,t]):t}readMessage(){if(!this._buffer)return null;let t=this._buffer.indexOf(`
|
|
255
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let o of e.seen.entries()){let c=o[1];if(t===o[0]){a(o);continue}if(e.external){let u=e.external.registry.get(o[0])?.id;if(t!==o[0]&&u){a(o);continue}}if(e.metadataRegistry.get(o[0])?.id){a(o);continue}if(c.cycle){a(o);continue}if(c.count>1&&e.reused==="ref"){a(o);continue}}}function yg(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let n=o=>{let c=e.seen.get(o);if(c.ref===null)return;let l=c.def??c.schema,u={...l},d=c.ref;if(c.ref=null,d){n(d);let f=e.seen.get(d),h=f.schema;if(h.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(l.allOf=l.allOf??[],l.allOf.push(h)):Object.assign(l,h),Object.assign(l,u),o._zod.parent===d)for(let g in l)g==="$ref"||g==="allOf"||g in u||delete l[g];if(h.$ref&&f.def)for(let g in l)g==="$ref"||g==="allOf"||g in f.def&&JSON.stringify(l[g])===JSON.stringify(f.def[g])&&delete l[g]}let p=o._zod.parent;if(p&&p!==d){n(p);let f=e.seen.get(p);if(f?.schema.$ref&&(l.$ref=f.schema.$ref,f.def))for(let h in l)h==="$ref"||h==="allOf"||h in f.def&&JSON.stringify(l[h])===JSON.stringify(f.def[h])&&delete l[h]}e.override({zodSchema:o,jsonSchema:l,path:c.path??[]})};for(let o of[...e.seen.entries()].reverse())n(o[0]);let s={};if(e.target==="draft-2020-12"?s.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?s.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?s.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let o=e.external.registry.get(t)?.id;if(!o)throw new Error("Schema is missing an `id` property");s.$id=e.external.uri(o)}Object.assign(s,r.def??r.schema);let a=e.external?.defs??{};for(let o of e.seen.entries()){let c=o[1];c.def&&c.defId&&(a[c.defId]=c.def)}e.external||Object.keys(a).length>0&&(e.target==="draft-2020-12"?s.$defs=a:s.definitions=a);try{let o=JSON.parse(JSON.stringify(s));return Object.defineProperty(o,"~standard",{value:{...t["~standard"],jsonSchema:{input:bp(t,"input",e.processors),output:bp(t,"output",e.processors)}},enumerable:!1,writable:!1}),o}catch{throw new Error("Error converting schema to JSON.")}}function Kn(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let n=e._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return Kn(n.element,r);if(n.type==="set")return Kn(n.valueType,r);if(n.type==="lazy")return Kn(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return Kn(n.innerType,r);if(n.type==="intersection")return Kn(n.left,r)||Kn(n.right,r);if(n.type==="record"||n.type==="map")return Kn(n.keyType,r)||Kn(n.valueType,r);if(n.type==="pipe")return Kn(n.in,r)||Kn(n.out,r);if(n.type==="object"){for(let s in n.shape)if(Kn(n.shape[s],r))return!0;return!1}if(n.type==="union"){for(let s of n.options)if(Kn(s,r))return!0;return!1}if(n.type==="tuple"){for(let s of n.items)if(Kn(s,r))return!0;return!!(n.rest&&Kn(n.rest,r))}return!1}var V$=(e,t={})=>r=>{let n=mg({...r,processors:t});return Tr(e,n),gg(n,e),yg(n,e)},bp=(e,t,r={})=>n=>{let{libraryOptions:s,target:a}=n??{},o=mg({...s??{},target:a,io:t,processors:r});return Tr(e,o),gg(o,e),yg(o,e)};var GK={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},K$=(e,t,r,n)=>{let s=r;s.type="string";let{minimum:a,maximum:o,format:c,patterns:l,contentEncoding:u}=e._zod.bag;if(typeof a=="number"&&(s.minLength=a),typeof o=="number"&&(s.maxLength=o),c&&(s.format=GK[c]??c,s.format===""&&delete s.format,c==="time"&&delete s.format),u&&(s.contentEncoding=u),l&&l.size>0){let d=[...l];d.length===1?s.pattern=d[0].source:d.length>1&&(s.allOf=[...d.map(p=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:p.source}))])}},G$=(e,t,r,n)=>{let s=r,{minimum:a,maximum:o,format:c,multipleOf:l,exclusiveMaximum:u,exclusiveMinimum:d}=e._zod.bag;typeof c=="string"&&c.includes("int")?s.type="integer":s.type="number",typeof d=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(s.minimum=d,s.exclusiveMinimum=!0):s.exclusiveMinimum=d),typeof a=="number"&&(s.minimum=a,typeof d=="number"&&t.target!=="draft-04"&&(d>=a?delete s.minimum:delete s.exclusiveMinimum)),typeof u=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(s.maximum=u,s.exclusiveMaximum=!0):s.exclusiveMaximum=u),typeof o=="number"&&(s.maximum=o,typeof u=="number"&&t.target!=="draft-04"&&(u<=o?delete s.maximum:delete s.exclusiveMaximum)),typeof l=="number"&&(s.multipleOf=l)},Z$=(e,t,r,n)=>{r.type="boolean"},H$=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},J$=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},Y$=(e,t,r,n)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},X$=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},Q$=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},eR=(e,t,r,n)=>{r.not={}},tR=(e,t,r,n)=>{},rR=(e,t,r,n)=>{},nR=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},iR=(e,t,r,n)=>{let s=e._zod.def,a=zd(s.entries);a.every(o=>typeof o=="number")&&(r.type="number"),a.every(o=>typeof o=="string")&&(r.type="string"),r.enum=a},sR=(e,t,r,n)=>{let s=e._zod.def,a=[];for(let o of s.values)if(o===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof o=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");a.push(Number(o))}else a.push(o);if(a.length!==0)if(a.length===1){let o=a[0];r.type=o===null?"null":typeof o,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[o]:r.const=o}else a.every(o=>typeof o=="number")&&(r.type="number"),a.every(o=>typeof o=="string")&&(r.type="string"),a.every(o=>typeof o=="boolean")&&(r.type="boolean"),a.every(o=>o===null)&&(r.type="null"),r.enum=a},aR=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},oR=(e,t,r,n)=>{let s=r,a=e._zod.pattern;if(!a)throw new Error("Pattern not found in template literal");s.type="string",s.pattern=a.source},cR=(e,t,r,n)=>{let s=r,a={type:"string",format:"binary",contentEncoding:"binary"},{minimum:o,maximum:c,mime:l}=e._zod.bag;o!==void 0&&(a.minLength=o),c!==void 0&&(a.maxLength=c),l?l.length===1?(a.contentMediaType=l[0],Object.assign(s,a)):(Object.assign(s,a),s.anyOf=l.map(u=>({contentMediaType:u}))):Object.assign(s,a)},lR=(e,t,r,n)=>{r.type="boolean"},uR=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},dR=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},pR=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},fR=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},hR=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},mR=(e,t,r,n)=>{let s=r,a=e._zod.def,{minimum:o,maximum:c}=e._zod.bag;typeof o=="number"&&(s.minItems=o),typeof c=="number"&&(s.maxItems=c),s.type="array",s.items=Tr(a.element,t,{...n,path:[...n.path,"items"]})},gR=(e,t,r,n)=>{let s=r,a=e._zod.def;s.type="object",s.properties={};let o=a.shape;for(let u in o)s.properties[u]=Tr(o[u],t,{...n,path:[...n.path,"properties",u]});let c=new Set(Object.keys(o)),l=new Set([...c].filter(u=>{let d=a.shape[u]._zod;return t.io==="input"?d.optin===void 0:d.optout===void 0}));l.size>0&&(s.required=Array.from(l)),a.catchall?._zod.def.type==="never"?s.additionalProperties=!1:a.catchall?a.catchall&&(s.additionalProperties=Tr(a.catchall,t,{...n,path:[...n.path,"additionalProperties"]})):t.io==="output"&&(s.additionalProperties=!1)},iw=(e,t,r,n)=>{let s=e._zod.def,a=s.inclusive===!1,o=s.options.map((c,l)=>Tr(c,t,{...n,path:[...n.path,a?"oneOf":"anyOf",l]}));a?r.oneOf=o:r.anyOf=o},yR=(e,t,r,n)=>{let s=e._zod.def,a=Tr(s.left,t,{...n,path:[...n.path,"allOf",0]}),o=Tr(s.right,t,{...n,path:[...n.path,"allOf",1]}),c=u=>"allOf"in u&&Object.keys(u).length===1,l=[...c(a)?a.allOf:[a],...c(o)?o.allOf:[o]];r.allOf=l},_R=(e,t,r,n)=>{let s=r,a=e._zod.def;s.type="array";let o=t.target==="draft-2020-12"?"prefixItems":"items",c=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",l=a.items.map((f,h)=>Tr(f,t,{...n,path:[...n.path,o,h]})),u=a.rest?Tr(a.rest,t,{...n,path:[...n.path,c,...t.target==="openapi-3.0"?[a.items.length]:[]]}):null;t.target==="draft-2020-12"?(s.prefixItems=l,u&&(s.items=u)):t.target==="openapi-3.0"?(s.items={anyOf:l},u&&s.items.anyOf.push(u),s.minItems=l.length,u||(s.maxItems=l.length)):(s.items=l,u&&(s.additionalItems=u));let{minimum:d,maximum:p}=e._zod.bag;typeof d=="number"&&(s.minItems=d),typeof p=="number"&&(s.maxItems=p)},bR=(e,t,r,n)=>{let s=r,a=e._zod.def;s.type="object";let o=a.keyType,l=o._zod.bag?.patterns;if(a.mode==="loose"&&l&&l.size>0){let d=Tr(a.valueType,t,{...n,path:[...n.path,"patternProperties","*"]});s.patternProperties={};for(let p of l)s.patternProperties[p.source]=d}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(s.propertyNames=Tr(a.keyType,t,{...n,path:[...n.path,"propertyNames"]})),s.additionalProperties=Tr(a.valueType,t,{...n,path:[...n.path,"additionalProperties"]});let u=o._zod.values;if(u){let d=[...u].filter(p=>typeof p=="string"||typeof p=="number");d.length>0&&(s.required=d)}},vR=(e,t,r,n)=>{let s=e._zod.def,a=Tr(s.innerType,t,n),o=t.seen.get(e);t.target==="openapi-3.0"?(o.ref=s.innerType,r.nullable=!0):r.anyOf=[a,{type:"null"}]},xR=(e,t,r,n)=>{let s=e._zod.def;Tr(s.innerType,t,n);let a=t.seen.get(e);a.ref=s.innerType},SR=(e,t,r,n)=>{let s=e._zod.def;Tr(s.innerType,t,n);let a=t.seen.get(e);a.ref=s.innerType,r.default=JSON.parse(JSON.stringify(s.defaultValue))},TR=(e,t,r,n)=>{let s=e._zod.def;Tr(s.innerType,t,n);let a=t.seen.get(e);a.ref=s.innerType,t.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(s.defaultValue)))},wR=(e,t,r,n)=>{let s=e._zod.def;Tr(s.innerType,t,n);let a=t.seen.get(e);a.ref=s.innerType;let o;try{o=s.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=o},ER=(e,t,r,n)=>{let s=e._zod.def,a=t.io==="input"?s.in._zod.def.type==="transform"?s.out:s.in:s.out;Tr(a,t,n);let o=t.seen.get(e);o.ref=a},PR=(e,t,r,n)=>{let s=e._zod.def;Tr(s.innerType,t,n);let a=t.seen.get(e);a.ref=s.innerType,r.readOnly=!0},IR=(e,t,r,n)=>{let s=e._zod.def;Tr(s.innerType,t,n);let a=t.seen.get(e);a.ref=s.innerType},sw=(e,t,r,n)=>{let s=e._zod.def;Tr(s.innerType,t,n);let a=t.seen.get(e);a.ref=s.innerType},AR=(e,t,r,n)=>{let s=e._zod.innerType;Tr(s,t,n);let a=t.seen.get(e);a.ref=s};function Bl(e){return!!e._zod}function no(e,t){return Bl(e)?Dl(e,t):e.safeParse(t)}function _g(e){if(!e)return;let t;if(Bl(e)?t=e._zod?.def?.shape:t=e.shape,!!t){if(typeof t=="function")try{return t()}catch{return}return t}}function NR(e){if(Bl(e)){let a=e._zod?.def;if(a){if(a.value!==void 0)return a.value;if(Array.isArray(a.values)&&a.values.length>0)return a.values[0]}}let r=e._def;if(r){if(r.value!==void 0)return r.value;if(Array.isArray(r.values)&&r.values.length>0)return r.values[0]}let n=e.value;if(n!==void 0)return n}var vp={};zn(vp,{ZodAny:()=>HR,ZodArray:()=>QR,ZodBase64:()=>kw,ZodBase64URL:()=>Cw,ZodBigInt:()=>Ig,ZodBigIntFormat:()=>$w,ZodBoolean:()=>Pg,ZodCIDRv4:()=>Iw,ZodCIDRv6:()=>Aw,ZodCUID:()=>vw,ZodCUID2:()=>xw,ZodCatch:()=>bD,ZodCodec:()=>Bw,ZodCustom:()=>Og,ZodCustomStringFormat:()=>Sp,ZodDate:()=>Dw,ZodDefault:()=>fD,ZodDiscriminatedUnion:()=>tD,ZodE164:()=>Nw,ZodEmail:()=>yw,ZodEmoji:()=>_w,ZodEnum:()=>xp,ZodExactOptional:()=>uD,ZodFile:()=>cD,ZodFunction:()=>AD,ZodGUID:()=>vg,ZodIPv4:()=>Ew,ZodIPv6:()=>Pw,ZodIntersection:()=>rD,ZodJWT:()=>Ow,ZodKSUID:()=>ww,ZodLazy:()=>ED,ZodLiteral:()=>oD,ZodMAC:()=>VR,ZodMap:()=>sD,ZodNaN:()=>xD,ZodNanoID:()=>bw,ZodNever:()=>YR,ZodNonOptional:()=>Fw,ZodNull:()=>ZR,ZodNullable:()=>pD,ZodNumber:()=>Eg,ZodNumberFormat:()=>zl,ZodObject:()=>Ag,ZodOptional:()=>Lw,ZodPipe:()=>jw,ZodPrefault:()=>mD,ZodPromise:()=>ID,ZodReadonly:()=>SD,ZodRecord:()=>Ng,ZodSet:()=>aD,ZodString:()=>Tg,ZodStringFormat:()=>br,ZodSuccess:()=>_D,ZodSymbol:()=>KR,ZodTemplateLiteral:()=>wD,ZodTransform:()=>lD,ZodTuple:()=>nD,ZodType:()=>It,ZodULID:()=>Sw,ZodURL:()=>wg,ZodUUID:()=>fa,ZodUndefined:()=>GR,ZodUnion:()=>kg,ZodUnknown:()=>JR,ZodVoid:()=>XR,ZodXID:()=>Tw,ZodXor:()=>eD,_ZodString:()=>gw,_default:()=>hD,_function:()=>lZ,any:()=>VG,array:()=>Bt,base64:()=>AG,base64url:()=>kG,bigint:()=>BG,boolean:()=>rn,catch:()=>vD,check:()=>uZ,cidrv4:()=>PG,cidrv6:()=>IG,codec:()=>aZ,cuid:()=>_G,cuid2:()=>bG,custom:()=>zw,date:()=>GG,describe:()=>dZ,discriminatedUnion:()=>Cg,e164:()=>CG,email:()=>cG,emoji:()=>gG,enum:()=>On,exactOptional:()=>dD,file:()=>rZ,float32:()=>MG,float64:()=>LG,function:()=>lZ,guid:()=>lG,hash:()=>DG,hex:()=>RG,hostname:()=>$G,httpUrl:()=>mG,instanceof:()=>fZ,int:()=>mw,int32:()=>FG,int64:()=>zG,intersection:()=>wp,ipv4:()=>TG,ipv6:()=>EG,json:()=>mZ,jwt:()=>NG,keyof:()=>ZG,ksuid:()=>SG,lazy:()=>PD,literal:()=>He,looseObject:()=>Nn,looseRecord:()=>XG,mac:()=>wG,map:()=>QG,meta:()=>pZ,nan:()=>sZ,nanoid:()=>yG,nativeEnum:()=>tZ,never:()=>Rw,nonoptional:()=>yD,null:()=>Tp,nullable:()=>xg,nullish:()=>nZ,number:()=>ar,object:()=>ze,optional:()=>Cr,partialRecord:()=>YG,pipe:()=>Sg,prefault:()=>gD,preprocess:()=>$g,promise:()=>cZ,readonly:()=>TD,record:()=>wr,refine:()=>kD,set:()=>eZ,strictObject:()=>HG,string:()=>ue,stringFormat:()=>OG,stringbool:()=>hZ,success:()=>iZ,superRefine:()=>CD,symbol:()=>qG,templateLiteral:()=>oZ,transform:()=>Mw,tuple:()=>iD,uint32:()=>jG,uint64:()=>UG,ulid:()=>vG,undefined:()=>WG,union:()=>mr,unknown:()=>vr,url:()=>hG,uuid:()=>uG,uuidv4:()=>dG,uuidv6:()=>pG,uuidv7:()=>fG,void:()=>KG,xid:()=>xG,xor:()=>JG});var bg={};zn(bg,{endsWith:()=>fp,gt:()=>da,gte:()=>Vn,includes:()=>dp,length:()=>Fl,lowercase:()=>lp,lt:()=>ua,lte:()=>wi,maxLength:()=>Ll,maxSize:()=>ac,mime:()=>hp,minLength:()=>ro,minSize:()=>pa,multipleOf:()=>sc,negative:()=>GT,nonnegative:()=>HT,nonpositive:()=>ZT,normalize:()=>mp,overwrite:()=>$s,positive:()=>KT,property:()=>JT,regex:()=>cp,size:()=>Ml,slugify:()=>hg,startsWith:()=>pp,toLowerCase:()=>yp,toUpperCase:()=>_p,trim:()=>gp,uppercase:()=>up});var oc={};zn(oc,{ZodISODate:()=>lw,ZodISODateTime:()=>ow,ZodISODuration:()=>fw,ZodISOTime:()=>dw,date:()=>uw,datetime:()=>cw,duration:()=>hw,time:()=>pw});var ow=re("ZodISODateTime",(e,t)=>{xS.init(e,t),br.init(e,t)});function cw(e){return TT(ow,e)}var lw=re("ZodISODate",(e,t)=>{SS.init(e,t),br.init(e,t)});function uw(e){return wT(lw,e)}var dw=re("ZodISOTime",(e,t)=>{TS.init(e,t),br.init(e,t)});function pw(e){return ET(dw,e)}var fw=re("ZodISODuration",(e,t)=>{wS.init(e,t),br.init(e,t)});function hw(e){return PT(fw,e)}var OR=(e,t)=>{$m.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>Dm(e,r)},flatten:{value:r=>Rm(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,Ol,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,Ol,2)}},isEmpty:{get(){return e.issues.length===0}}})},cKe=re("ZodError",OR),Ei=re("ZodError",OR,{Parent:Error});var $R=Gd(Ei),RR=Hd(Ei),DR=Yd(Ei),MR=Xd(Ei),LR=KO(Ei),FR=GO(Ei),jR=ZO(Ei),BR=HO(Ei),zR=JO(Ei),UR=YO(Ei),qR=XO(Ei),WR=QO(Ei);var It=re("ZodType",(e,t)=>(xt.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:bp(e,"input"),output:bp(e,"output")}}),e.toJSONSchema=V$(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone(Ee.mergeDefs(t,{checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0}),e.with=e.check,e.clone=(r,n)=>qn(e,r,n),e.brand=()=>e,e.register=(r,n)=>(r.add(e,n),e),e.parse=(r,n)=>$R(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>DR(e,r,n),e.parseAsync=async(r,n)=>RR(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>MR(e,r,n),e.spa=e.safeParseAsync,e.encode=(r,n)=>LR(e,r,n),e.decode=(r,n)=>FR(e,r,n),e.encodeAsync=async(r,n)=>jR(e,r,n),e.decodeAsync=async(r,n)=>BR(e,r,n),e.safeEncode=(r,n)=>zR(e,r,n),e.safeDecode=(r,n)=>UR(e,r,n),e.safeEncodeAsync=async(r,n)=>qR(e,r,n),e.safeDecodeAsync=async(r,n)=>WR(e,r,n),e.refine=(r,n)=>e.check(kD(r,n)),e.superRefine=r=>e.check(CD(r)),e.overwrite=r=>e.check($s(r)),e.optional=()=>Cr(e),e.exactOptional=()=>dD(e),e.nullable=()=>xg(e),e.nullish=()=>Cr(xg(e)),e.nonoptional=r=>yD(e,r),e.array=()=>Bt(e),e.or=r=>mr([e,r]),e.and=r=>wp(e,r),e.transform=r=>Sg(e,Mw(r)),e.default=r=>hD(e,r),e.prefault=r=>gD(e,r),e.catch=r=>vD(e,r),e.pipe=r=>Sg(e,r),e.readonly=()=>TD(e),e.describe=r=>{let n=e.clone();return Wn.add(n,{description:r}),n},Object.defineProperty(e,"description",{get(){return Wn.get(e)?.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return Wn.get(e);let n=e.clone();return Wn.add(n,r[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=r=>r(e),e)),gw=re("_ZodString",(e,t)=>{ic.init(e,t),It.init(e,t),e._zod.processJSONSchema=(n,s,a)=>K$(e,n,s,a);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...n)=>e.check(cp(...n)),e.includes=(...n)=>e.check(dp(...n)),e.startsWith=(...n)=>e.check(pp(...n)),e.endsWith=(...n)=>e.check(fp(...n)),e.min=(...n)=>e.check(ro(...n)),e.max=(...n)=>e.check(Ll(...n)),e.length=(...n)=>e.check(Fl(...n)),e.nonempty=(...n)=>e.check(ro(1,...n)),e.lowercase=n=>e.check(lp(n)),e.uppercase=n=>e.check(up(n)),e.trim=()=>e.check(gp()),e.normalize=(...n)=>e.check(mp(...n)),e.toLowerCase=()=>e.check(yp()),e.toUpperCase=()=>e.check(_p()),e.slugify=()=>e.check(hg())}),Tg=re("ZodString",(e,t)=>{ic.init(e,t),gw.init(e,t),e.email=r=>e.check(Zm(yw,r)),e.url=r=>e.check(op(wg,r)),e.jwt=r=>e.check(fg(Ow,r)),e.emoji=r=>e.check(Qm(_w,r)),e.guid=r=>e.check(ap(vg,r)),e.uuid=r=>e.check(Hm(fa,r)),e.uuidv4=r=>e.check(Jm(fa,r)),e.uuidv6=r=>e.check(Ym(fa,r)),e.uuidv7=r=>e.check(Xm(fa,r)),e.nanoid=r=>e.check(eg(bw,r)),e.guid=r=>e.check(ap(vg,r)),e.cuid=r=>e.check(tg(vw,r)),e.cuid2=r=>e.check(rg(xw,r)),e.ulid=r=>e.check(ng(Sw,r)),e.base64=r=>e.check(ug(kw,r)),e.base64url=r=>e.check(dg(Cw,r)),e.xid=r=>e.check(ig(Tw,r)),e.ksuid=r=>e.check(sg(ww,r)),e.ipv4=r=>e.check(ag(Ew,r)),e.ipv6=r=>e.check(og(Pw,r)),e.cidrv4=r=>e.check(cg(Iw,r)),e.cidrv6=r=>e.check(lg(Aw,r)),e.e164=r=>e.check(pg(Nw,r)),e.datetime=r=>e.check(cw(r)),e.date=r=>e.check(uw(r)),e.time=r=>e.check(pw(r)),e.duration=r=>e.check(hw(r))});function ue(e){return xT(Tg,e)}var br=re("ZodStringFormat",(e,t)=>{hr.init(e,t),gw.init(e,t)}),yw=re("ZodEmail",(e,t)=>{pS.init(e,t),br.init(e,t)});function cG(e){return Zm(yw,e)}var vg=re("ZodGUID",(e,t)=>{uS.init(e,t),br.init(e,t)});function lG(e){return ap(vg,e)}var fa=re("ZodUUID",(e,t)=>{dS.init(e,t),br.init(e,t)});function uG(e){return Hm(fa,e)}function dG(e){return Jm(fa,e)}function pG(e){return Ym(fa,e)}function fG(e){return Xm(fa,e)}var wg=re("ZodURL",(e,t)=>{fS.init(e,t),br.init(e,t)});function hG(e){return op(wg,e)}function mG(e){return op(wg,{protocol:/^https?$/,hostname:Mi.domain,...Ee.normalizeParams(e)})}var _w=re("ZodEmoji",(e,t)=>{hS.init(e,t),br.init(e,t)});function gG(e){return Qm(_w,e)}var bw=re("ZodNanoID",(e,t)=>{mS.init(e,t),br.init(e,t)});function yG(e){return eg(bw,e)}var vw=re("ZodCUID",(e,t)=>{gS.init(e,t),br.init(e,t)});function _G(e){return tg(vw,e)}var xw=re("ZodCUID2",(e,t)=>{yS.init(e,t),br.init(e,t)});function bG(e){return rg(xw,e)}var Sw=re("ZodULID",(e,t)=>{_S.init(e,t),br.init(e,t)});function vG(e){return ng(Sw,e)}var Tw=re("ZodXID",(e,t)=>{bS.init(e,t),br.init(e,t)});function xG(e){return ig(Tw,e)}var ww=re("ZodKSUID",(e,t)=>{vS.init(e,t),br.init(e,t)});function SG(e){return sg(ww,e)}var Ew=re("ZodIPv4",(e,t)=>{ES.init(e,t),br.init(e,t)});function TG(e){return ag(Ew,e)}var VR=re("ZodMAC",(e,t)=>{IS.init(e,t),br.init(e,t)});function wG(e){return ST(VR,e)}var Pw=re("ZodIPv6",(e,t)=>{PS.init(e,t),br.init(e,t)});function EG(e){return og(Pw,e)}var Iw=re("ZodCIDRv4",(e,t)=>{AS.init(e,t),br.init(e,t)});function PG(e){return cg(Iw,e)}var Aw=re("ZodCIDRv6",(e,t)=>{kS.init(e,t),br.init(e,t)});function IG(e){return lg(Aw,e)}var kw=re("ZodBase64",(e,t)=>{CS.init(e,t),br.init(e,t)});function AG(e){return ug(kw,e)}var Cw=re("ZodBase64URL",(e,t)=>{NS.init(e,t),br.init(e,t)});function kG(e){return dg(Cw,e)}var Nw=re("ZodE164",(e,t)=>{OS.init(e,t),br.init(e,t)});function CG(e){return pg(Nw,e)}var Ow=re("ZodJWT",(e,t)=>{$S.init(e,t),br.init(e,t)});function NG(e){return fg(Ow,e)}var Sp=re("ZodCustomStringFormat",(e,t)=>{RS.init(e,t),br.init(e,t)});function OG(e,t,r={}){return jl(Sp,e,t,r)}function $G(e){return jl(Sp,"hostname",Mi.hostname,e)}function RG(e){return jl(Sp,"hex",Mi.hex,e)}function DG(e,t){let r=t?.enc??"hex",n=`${e}_${r}`,s=Mi[n];if(!s)throw new Error(`Unrecognized hash format: ${n}`);return jl(Sp,n,s,t)}var Eg=re("ZodNumber",(e,t)=>{Wm.init(e,t),It.init(e,t),e._zod.processJSONSchema=(n,s,a)=>G$(e,n,s,a),e.gt=(n,s)=>e.check(da(n,s)),e.gte=(n,s)=>e.check(Vn(n,s)),e.min=(n,s)=>e.check(Vn(n,s)),e.lt=(n,s)=>e.check(ua(n,s)),e.lte=(n,s)=>e.check(wi(n,s)),e.max=(n,s)=>e.check(wi(n,s)),e.int=n=>e.check(mw(n)),e.safe=n=>e.check(mw(n)),e.positive=n=>e.check(da(0,n)),e.nonnegative=n=>e.check(Vn(0,n)),e.negative=n=>e.check(ua(0,n)),e.nonpositive=n=>e.check(wi(0,n)),e.multipleOf=(n,s)=>e.check(sc(n,s)),e.step=(n,s)=>e.check(sc(n,s)),e.finite=()=>e;let r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function ar(e){return IT(Eg,e)}var zl=re("ZodNumberFormat",(e,t)=>{DS.init(e,t),Eg.init(e,t)});function mw(e){return AT(zl,e)}function MG(e){return kT(zl,e)}function LG(e){return CT(zl,e)}function FG(e){return NT(zl,e)}function jG(e){return OT(zl,e)}var Pg=re("ZodBoolean",(e,t)=>{np.init(e,t),It.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Z$(e,r,n,s)});function rn(e){return $T(Pg,e)}var Ig=re("ZodBigInt",(e,t)=>{Vm.init(e,t),It.init(e,t),e._zod.processJSONSchema=(n,s,a)=>H$(e,n,s,a),e.gte=(n,s)=>e.check(Vn(n,s)),e.min=(n,s)=>e.check(Vn(n,s)),e.gt=(n,s)=>e.check(da(n,s)),e.gte=(n,s)=>e.check(Vn(n,s)),e.min=(n,s)=>e.check(Vn(n,s)),e.lt=(n,s)=>e.check(ua(n,s)),e.lte=(n,s)=>e.check(wi(n,s)),e.max=(n,s)=>e.check(wi(n,s)),e.positive=n=>e.check(da(BigInt(0),n)),e.negative=n=>e.check(ua(BigInt(0),n)),e.nonpositive=n=>e.check(wi(BigInt(0),n)),e.nonnegative=n=>e.check(Vn(BigInt(0),n)),e.multipleOf=(n,s)=>e.check(sc(n,s));let r=e._zod.bag;e.minValue=r.minimum??null,e.maxValue=r.maximum??null,e.format=r.format??null});function BG(e){return RT(Ig,e)}var $w=re("ZodBigIntFormat",(e,t)=>{MS.init(e,t),Ig.init(e,t)});function zG(e){return DT($w,e)}function UG(e){return MT($w,e)}var KR=re("ZodSymbol",(e,t)=>{LS.init(e,t),It.init(e,t),e._zod.processJSONSchema=(r,n,s)=>J$(e,r,n,s)});function qG(e){return LT(KR,e)}var GR=re("ZodUndefined",(e,t)=>{FS.init(e,t),It.init(e,t),e._zod.processJSONSchema=(r,n,s)=>X$(e,r,n,s)});function WG(e){return FT(GR,e)}var ZR=re("ZodNull",(e,t)=>{jS.init(e,t),It.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Y$(e,r,n,s)});function Tp(e){return jT(ZR,e)}var HR=re("ZodAny",(e,t)=>{BS.init(e,t),It.init(e,t),e._zod.processJSONSchema=(r,n,s)=>tR(e,r,n,s)});function VG(){return BT(HR)}var JR=re("ZodUnknown",(e,t)=>{zS.init(e,t),It.init(e,t),e._zod.processJSONSchema=(r,n,s)=>rR(e,r,n,s)});function vr(){return zT(JR)}var YR=re("ZodNever",(e,t)=>{US.init(e,t),It.init(e,t),e._zod.processJSONSchema=(r,n,s)=>eR(e,r,n,s)});function Rw(e){return UT(YR,e)}var XR=re("ZodVoid",(e,t)=>{qS.init(e,t),It.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Q$(e,r,n,s)});function KG(e){return qT(XR,e)}var Dw=re("ZodDate",(e,t)=>{WS.init(e,t),It.init(e,t),e._zod.processJSONSchema=(n,s,a)=>nR(e,n,s,a),e.min=(n,s)=>e.check(Vn(n,s)),e.max=(n,s)=>e.check(wi(n,s));let r=e._zod.bag;e.minDate=r.minimum?new Date(r.minimum):null,e.maxDate=r.maximum?new Date(r.maximum):null});function GG(e){return WT(Dw,e)}var QR=re("ZodArray",(e,t)=>{VS.init(e,t),It.init(e,t),e._zod.processJSONSchema=(r,n,s)=>mR(e,r,n,s),e.element=t.element,e.min=(r,n)=>e.check(ro(r,n)),e.nonempty=r=>e.check(ro(1,r)),e.max=(r,n)=>e.check(Ll(r,n)),e.length=(r,n)=>e.check(Fl(r,n)),e.unwrap=()=>e.element});function Bt(e,t){return W$(QR,e,t)}function ZG(e){let t=e._zod.def.shape;return On(Object.keys(t))}var Ag=re("ZodObject",(e,t)=>{B$.init(e,t),It.init(e,t),e._zod.processJSONSchema=(r,n,s)=>gR(e,r,n,s),Ee.defineLazy(e,"shape",()=>t.shape),e.keyof=()=>On(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:vr()}),e.loose=()=>e.clone({...e._zod.def,catchall:vr()}),e.strict=()=>e.clone({...e._zod.def,catchall:Rw()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>Ee.extend(e,r),e.safeExtend=r=>Ee.safeExtend(e,r),e.merge=r=>Ee.merge(e,r),e.pick=r=>Ee.pick(e,r),e.omit=r=>Ee.omit(e,r),e.partial=(...r)=>Ee.partial(Lw,e,r[0]),e.required=(...r)=>Ee.required(Fw,e,r[0])});function ze(e,t){let r={type:"object",shape:e??{},...Ee.normalizeParams(t)};return new Ag(r)}function HG(e,t){return new Ag({type:"object",shape:e,catchall:Rw(),...Ee.normalizeParams(t)})}function Nn(e,t){return new Ag({type:"object",shape:e,catchall:vr(),...Ee.normalizeParams(t)})}var kg=re("ZodUnion",(e,t)=>{ip.init(e,t),It.init(e,t),e._zod.processJSONSchema=(r,n,s)=>iw(e,r,n,s),e.options=t.options});function mr(e,t){return new kg({type:"union",options:e,...Ee.normalizeParams(t)})}var eD=re("ZodXor",(e,t)=>{kg.init(e,t),KS.init(e,t),e._zod.processJSONSchema=(r,n,s)=>iw(e,r,n,s),e.options=t.options});function JG(e,t){return new eD({type:"union",options:e,inclusive:!1,...Ee.normalizeParams(t)})}var tD=re("ZodDiscriminatedUnion",(e,t)=>{kg.init(e,t),GS.init(e,t)});function Cg(e,t,r){return new tD({type:"union",options:t,discriminator:e,...Ee.normalizeParams(r)})}var rD=re("ZodIntersection",(e,t)=>{ZS.init(e,t),It.init(e,t),e._zod.processJSONSchema=(r,n,s)=>yR(e,r,n,s)});function wp(e,t){return new rD({type:"intersection",left:e,right:t})}var nD=re("ZodTuple",(e,t)=>{Km.init(e,t),It.init(e,t),e._zod.processJSONSchema=(r,n,s)=>_R(e,r,n,s),e.rest=r=>e.clone({...e._zod.def,rest:r})});function iD(e,t,r){let n=t instanceof xt,s=n?r:t,a=n?t:null;return new nD({type:"tuple",items:e,rest:a,...Ee.normalizeParams(s)})}var Ng=re("ZodRecord",(e,t)=>{HS.init(e,t),It.init(e,t),e._zod.processJSONSchema=(r,n,s)=>bR(e,r,n,s),e.keyType=t.keyType,e.valueType=t.valueType});function wr(e,t,r){return new Ng({type:"record",keyType:e,valueType:t,...Ee.normalizeParams(r)})}function YG(e,t,r){let n=qn(e);return n._zod.values=void 0,new Ng({type:"record",keyType:n,valueType:t,...Ee.normalizeParams(r)})}function XG(e,t,r){return new Ng({type:"record",keyType:e,valueType:t,mode:"loose",...Ee.normalizeParams(r)})}var sD=re("ZodMap",(e,t)=>{JS.init(e,t),It.init(e,t),e._zod.processJSONSchema=(r,n,s)=>fR(e,r,n,s),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...r)=>e.check(pa(...r)),e.nonempty=r=>e.check(pa(1,r)),e.max=(...r)=>e.check(ac(...r)),e.size=(...r)=>e.check(Ml(...r))});function QG(e,t,r){return new sD({type:"map",keyType:e,valueType:t,...Ee.normalizeParams(r)})}var aD=re("ZodSet",(e,t)=>{YS.init(e,t),It.init(e,t),e._zod.processJSONSchema=(r,n,s)=>hR(e,r,n,s),e.min=(...r)=>e.check(pa(...r)),e.nonempty=r=>e.check(pa(1,r)),e.max=(...r)=>e.check(ac(...r)),e.size=(...r)=>e.check(Ml(...r))});function eZ(e,t){return new aD({type:"set",valueType:e,...Ee.normalizeParams(t)})}var xp=re("ZodEnum",(e,t)=>{XS.init(e,t),It.init(e,t),e._zod.processJSONSchema=(n,s,a)=>iR(e,n,s,a),e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(n,s)=>{let a={};for(let o of n)if(r.has(o))a[o]=t.entries[o];else throw new Error(`Key ${o} not found in enum`);return new xp({...t,checks:[],...Ee.normalizeParams(s),entries:a})},e.exclude=(n,s)=>{let a={...t.entries};for(let o of n)if(r.has(o))delete a[o];else throw new Error(`Key ${o} not found in enum`);return new xp({...t,checks:[],...Ee.normalizeParams(s),entries:a})}});function On(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new xp({type:"enum",entries:r,...Ee.normalizeParams(t)})}function tZ(e,t){return new xp({type:"enum",entries:e,...Ee.normalizeParams(t)})}var oD=re("ZodLiteral",(e,t)=>{QS.init(e,t),It.init(e,t),e._zod.processJSONSchema=(r,n,s)=>sR(e,r,n,s),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function He(e,t){return new oD({type:"literal",values:Array.isArray(e)?e:[e],...Ee.normalizeParams(t)})}var cD=re("ZodFile",(e,t)=>{eT.init(e,t),It.init(e,t),e._zod.processJSONSchema=(r,n,s)=>cR(e,r,n,s),e.min=(r,n)=>e.check(pa(r,n)),e.max=(r,n)=>e.check(ac(r,n)),e.mime=(r,n)=>e.check(hp(Array.isArray(r)?r:[r],n))});function rZ(e){return YT(cD,e)}var lD=re("ZodTransform",(e,t)=>{tT.init(e,t),It.init(e,t),e._zod.processJSONSchema=(r,n,s)=>pR(e,r,n,s),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new tc(e.constructor.name);r.addIssue=a=>{if(typeof a=="string")r.issues.push(Ee.issue(a,r.value,t));else{let o=a;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=r.value),o.inst??(o.inst=e),r.issues.push(Ee.issue(o))}};let s=t.transform(r.value,r);return s instanceof Promise?s.then(a=>(r.value=a,r)):(r.value=s,r)}});function Mw(e){return new lD({type:"transform",transform:e})}var Lw=re("ZodOptional",(e,t)=>{Gm.init(e,t),It.init(e,t),e._zod.processJSONSchema=(r,n,s)=>sw(e,r,n,s),e.unwrap=()=>e._zod.def.innerType});function Cr(e){return new Lw({type:"optional",innerType:e})}var uD=re("ZodExactOptional",(e,t)=>{rT.init(e,t),It.init(e,t),e._zod.processJSONSchema=(r,n,s)=>sw(e,r,n,s),e.unwrap=()=>e._zod.def.innerType});function dD(e){return new uD({type:"optional",innerType:e})}var pD=re("ZodNullable",(e,t)=>{nT.init(e,t),It.init(e,t),e._zod.processJSONSchema=(r,n,s)=>vR(e,r,n,s),e.unwrap=()=>e._zod.def.innerType});function xg(e){return new pD({type:"nullable",innerType:e})}function nZ(e){return Cr(xg(e))}var fD=re("ZodDefault",(e,t)=>{iT.init(e,t),It.init(e,t),e._zod.processJSONSchema=(r,n,s)=>SR(e,r,n,s),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function hD(e,t){return new fD({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Ee.shallowClone(t)}})}var mD=re("ZodPrefault",(e,t)=>{sT.init(e,t),It.init(e,t),e._zod.processJSONSchema=(r,n,s)=>TR(e,r,n,s),e.unwrap=()=>e._zod.def.innerType});function gD(e,t){return new mD({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Ee.shallowClone(t)}})}var Fw=re("ZodNonOptional",(e,t)=>{aT.init(e,t),It.init(e,t),e._zod.processJSONSchema=(r,n,s)=>xR(e,r,n,s),e.unwrap=()=>e._zod.def.innerType});function yD(e,t){return new Fw({type:"nonoptional",innerType:e,...Ee.normalizeParams(t)})}var _D=re("ZodSuccess",(e,t)=>{oT.init(e,t),It.init(e,t),e._zod.processJSONSchema=(r,n,s)=>lR(e,r,n,s),e.unwrap=()=>e._zod.def.innerType});function iZ(e){return new _D({type:"success",innerType:e})}var bD=re("ZodCatch",(e,t)=>{cT.init(e,t),It.init(e,t),e._zod.processJSONSchema=(r,n,s)=>wR(e,r,n,s),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function vD(e,t){return new bD({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}var xD=re("ZodNaN",(e,t)=>{lT.init(e,t),It.init(e,t),e._zod.processJSONSchema=(r,n,s)=>aR(e,r,n,s)});function sZ(e){return VT(xD,e)}var jw=re("ZodPipe",(e,t)=>{uT.init(e,t),It.init(e,t),e._zod.processJSONSchema=(r,n,s)=>ER(e,r,n,s),e.in=t.in,e.out=t.out});function Sg(e,t){return new jw({type:"pipe",in:e,out:t})}var Bw=re("ZodCodec",(e,t)=>{jw.init(e,t),sp.init(e,t)});function aZ(e,t,r){return new Bw({type:"pipe",in:e,out:t,transform:r.decode,reverseTransform:r.encode})}var SD=re("ZodReadonly",(e,t)=>{dT.init(e,t),It.init(e,t),e._zod.processJSONSchema=(r,n,s)=>PR(e,r,n,s),e.unwrap=()=>e._zod.def.innerType});function TD(e){return new SD({type:"readonly",innerType:e})}var wD=re("ZodTemplateLiteral",(e,t)=>{pT.init(e,t),It.init(e,t),e._zod.processJSONSchema=(r,n,s)=>oR(e,r,n,s)});function oZ(e,t){return new wD({type:"template_literal",parts:e,...Ee.normalizeParams(t)})}var ED=re("ZodLazy",(e,t)=>{mT.init(e,t),It.init(e,t),e._zod.processJSONSchema=(r,n,s)=>AR(e,r,n,s),e.unwrap=()=>e._zod.def.getter()});function PD(e){return new ED({type:"lazy",getter:e})}var ID=re("ZodPromise",(e,t)=>{hT.init(e,t),It.init(e,t),e._zod.processJSONSchema=(r,n,s)=>IR(e,r,n,s),e.unwrap=()=>e._zod.def.innerType});function cZ(e){return new ID({type:"promise",innerType:e})}var AD=re("ZodFunction",(e,t)=>{fT.init(e,t),It.init(e,t),e._zod.processJSONSchema=(r,n,s)=>dR(e,r,n,s)});function lZ(e){return new AD({type:"function",input:Array.isArray(e?.input)?iD(e?.input):e?.input??Bt(vr()),output:e?.output??vr()})}var Og=re("ZodCustom",(e,t)=>{gT.init(e,t),It.init(e,t),e._zod.processJSONSchema=(r,n,s)=>uR(e,r,n,s)});function uZ(e){let t=new _r({check:"custom"});return t._zod.check=e,t}function zw(e,t){return XT(Og,e??(()=>!0),t)}function kD(e,t={}){return QT(Og,e,t)}function CD(e){return ew(e)}var dZ=tw,pZ=rw;function fZ(e,t={}){let r=new Og({type:"custom",check:"custom",fn:n=>n instanceof e,abort:!0,...Ee.normalizeParams(t)});return r._zod.bag.Class=e,r._zod.check=n=>{n.value instanceof e||n.issues.push({code:"invalid_type",expected:e.name,input:n.value,inst:r,path:[...r._zod.def.path??[]]})},r}var hZ=(...e)=>nw({Codec:Bw,Boolean:Pg,String:Tg},...e);function mZ(e){let t=PD(()=>mr([ue(e),ar(),rn(),Tp(),Bt(t),wr(ue(),t)]));return t}function $g(e,t){return Sg(Mw(e),t)}var ND;ND||(ND={});var gKe={...vp,...bg,iso:oc};ln(yT());var qw="2025-11-25";var OD=[qw,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],io="io.modelcontextprotocol/related-task",Dg="2.0",bn=zw(e=>e!==null&&(typeof e=="object"||typeof e=="function")),$D=mr([ue(),ar().int()]),RD=ue(),DKe=Nn({ttl:mr([ar(),Tp()]).optional(),pollInterval:ar().optional()}),bZ=ze({ttl:ar().optional()}),vZ=ze({taskId:ue()}),Ww=Nn({progressToken:$D.optional(),[io]:vZ.optional()}),Pi=ze({_meta:Ww.optional()}),Ep=Pi.extend({task:bZ.optional()}),DD=e=>Ep.safeParse(e).success,vn=ze({method:ue(),params:Pi.loose().optional()}),Li=ze({_meta:Ww.optional()}),Fi=ze({method:ue(),params:Li.loose().optional()}),xn=Nn({_meta:Ww.optional()}),Mg=mr([ue(),ar().int()]),MD=ze({jsonrpc:He(Dg),id:Mg,...vn.shape}).strict(),Vw=e=>MD.safeParse(e).success,LD=ze({jsonrpc:He(Dg),...Fi.shape}).strict(),FD=e=>LD.safeParse(e).success,Kw=ze({jsonrpc:He(Dg),id:Mg,result:xn}).strict(),Pp=e=>Kw.safeParse(e).success;var Zt;(function(e){e[e.ConnectionClosed=-32e3]="ConnectionClosed",e[e.RequestTimeout=-32001]="RequestTimeout",e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(Zt||(Zt={}));var Gw=ze({jsonrpc:He(Dg),id:Mg.optional(),error:ze({code:ar().int(),message:ue(),data:vr().optional()})}).strict();var jD=e=>Gw.safeParse(e).success;var BD=mr([MD,LD,Kw,Gw]),MKe=mr([Kw,Gw]),Lg=xn.strict(),xZ=Li.extend({requestId:Mg.optional(),reason:ue().optional()}),Fg=Fi.extend({method:He("notifications/cancelled"),params:xZ}),SZ=ze({src:ue(),mimeType:ue().optional(),sizes:Bt(ue()).optional(),theme:On(["light","dark"]).optional()}),Ip=ze({icons:Bt(SZ).optional()}),Ul=ze({name:ue(),title:ue().optional()}),zD=Ul.extend({...Ul.shape,...Ip.shape,version:ue(),websiteUrl:ue().optional(),description:ue().optional()}),TZ=wp(ze({applyDefaults:rn().optional()}),wr(ue(),vr())),wZ=$g(e=>e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,wp(ze({form:TZ.optional(),url:bn.optional()}),wr(ue(),vr()).optional())),EZ=Nn({list:bn.optional(),cancel:bn.optional(),requests:Nn({sampling:Nn({createMessage:bn.optional()}).optional(),elicitation:Nn({create:bn.optional()}).optional()}).optional()}),PZ=Nn({list:bn.optional(),cancel:bn.optional(),requests:Nn({tools:Nn({call:bn.optional()}).optional()}).optional()}),IZ=ze({experimental:wr(ue(),bn).optional(),sampling:ze({context:bn.optional(),tools:bn.optional()}).optional(),elicitation:wZ.optional(),roots:ze({listChanged:rn().optional()}).optional(),tasks:EZ.optional()}),AZ=Pi.extend({protocolVersion:ue(),capabilities:IZ,clientInfo:zD}),Zw=vn.extend({method:He("initialize"),params:AZ});var kZ=ze({experimental:wr(ue(),bn).optional(),logging:bn.optional(),completions:bn.optional(),prompts:ze({listChanged:rn().optional()}).optional(),resources:ze({subscribe:rn().optional(),listChanged:rn().optional()}).optional(),tools:ze({listChanged:rn().optional()}).optional(),tasks:PZ.optional()}),CZ=xn.extend({protocolVersion:ue(),capabilities:kZ,serverInfo:zD,instructions:ue().optional()}),Hw=Fi.extend({method:He("notifications/initialized"),params:Li.optional()});var jg=vn.extend({method:He("ping"),params:Pi.optional()}),NZ=ze({progress:ar(),total:Cr(ar()),message:Cr(ue())}),OZ=ze({...Li.shape,...NZ.shape,progressToken:$D}),Bg=Fi.extend({method:He("notifications/progress"),params:OZ}),$Z=Pi.extend({cursor:RD.optional()}),Ap=vn.extend({params:$Z.optional()}),kp=xn.extend({nextCursor:RD.optional()}),RZ=On(["working","input_required","completed","failed","cancelled"]),Cp=ze({taskId:ue(),status:RZ,ttl:mr([ar(),Tp()]),createdAt:ue(),lastUpdatedAt:ue(),pollInterval:Cr(ar()),statusMessage:Cr(ue())}),ql=xn.extend({task:Cp}),DZ=Li.merge(Cp),Np=Fi.extend({method:He("notifications/tasks/status"),params:DZ}),zg=vn.extend({method:He("tasks/get"),params:Pi.extend({taskId:ue()})}),Ug=xn.merge(Cp),qg=vn.extend({method:He("tasks/result"),params:Pi.extend({taskId:ue()})}),LKe=xn.loose(),Wg=Ap.extend({method:He("tasks/list")}),Vg=kp.extend({tasks:Bt(Cp)}),Kg=vn.extend({method:He("tasks/cancel"),params:Pi.extend({taskId:ue()})}),UD=xn.merge(Cp),qD=ze({uri:ue(),mimeType:Cr(ue()),_meta:wr(ue(),vr()).optional()}),WD=qD.extend({text:ue()}),Jw=ue().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),VD=qD.extend({blob:Jw}),Op=On(["user","assistant"]),Wl=ze({audience:Bt(Op).optional(),priority:ar().min(0).max(1).optional(),lastModified:oc.datetime({offset:!0}).optional()}),KD=ze({...Ul.shape,...Ip.shape,uri:ue(),description:Cr(ue()),mimeType:Cr(ue()),annotations:Wl.optional(),_meta:Cr(Nn({}))}),MZ=ze({...Ul.shape,...Ip.shape,uriTemplate:ue(),description:Cr(ue()),mimeType:Cr(ue()),annotations:Wl.optional(),_meta:Cr(Nn({}))}),Yw=Ap.extend({method:He("resources/list")}),LZ=kp.extend({resources:Bt(KD)}),FZ=Ap.extend({method:He("resources/templates/list")}),jZ=kp.extend({resourceTemplates:Bt(MZ)}),Xw=Pi.extend({uri:ue()}),BZ=Xw,Qw=vn.extend({method:He("resources/read"),params:BZ}),zZ=xn.extend({contents:Bt(mr([WD,VD]))}),UZ=Fi.extend({method:He("notifications/resources/list_changed"),params:Li.optional()}),qZ=Xw,WZ=vn.extend({method:He("resources/subscribe"),params:qZ}),VZ=Xw,KZ=vn.extend({method:He("resources/unsubscribe"),params:VZ}),GZ=Li.extend({uri:ue()}),ZZ=Fi.extend({method:He("notifications/resources/updated"),params:GZ}),HZ=ze({name:ue(),description:Cr(ue()),required:Cr(rn())}),JZ=ze({...Ul.shape,...Ip.shape,description:Cr(ue()),arguments:Cr(Bt(HZ)),_meta:Cr(Nn({}))}),YZ=Ap.extend({method:He("prompts/list")}),XZ=kp.extend({prompts:Bt(JZ)}),QZ=Pi.extend({name:ue(),arguments:wr(ue(),ue()).optional()}),e7=vn.extend({method:He("prompts/get"),params:QZ}),e0=ze({type:He("text"),text:ue(),annotations:Wl.optional(),_meta:wr(ue(),vr()).optional()}),t0=ze({type:He("image"),data:Jw,mimeType:ue(),annotations:Wl.optional(),_meta:wr(ue(),vr()).optional()}),r0=ze({type:He("audio"),data:Jw,mimeType:ue(),annotations:Wl.optional(),_meta:wr(ue(),vr()).optional()}),t7=ze({type:He("tool_use"),name:ue(),id:ue(),input:wr(ue(),vr()),_meta:wr(ue(),vr()).optional()}),r7=ze({type:He("resource"),resource:mr([WD,VD]),annotations:Wl.optional(),_meta:wr(ue(),vr()).optional()}),n7=KD.extend({type:He("resource_link")}),n0=mr([e0,t0,r0,n7,r7]),i7=ze({role:Op,content:n0}),s7=xn.extend({description:ue().optional(),messages:Bt(i7)}),a7=Fi.extend({method:He("notifications/prompts/list_changed"),params:Li.optional()}),o7=ze({title:ue().optional(),readOnlyHint:rn().optional(),destructiveHint:rn().optional(),idempotentHint:rn().optional(),openWorldHint:rn().optional()}),c7=ze({taskSupport:On(["required","optional","forbidden"]).optional()}),GD=ze({...Ul.shape,...Ip.shape,description:ue().optional(),inputSchema:ze({type:He("object"),properties:wr(ue(),bn).optional(),required:Bt(ue()).optional()}).catchall(vr()),outputSchema:ze({type:He("object"),properties:wr(ue(),bn).optional(),required:Bt(ue()).optional()}).catchall(vr()).optional(),annotations:o7.optional(),execution:c7.optional(),_meta:wr(ue(),vr()).optional()}),i0=Ap.extend({method:He("tools/list")}),l7=kp.extend({tools:Bt(GD)}),Gg=xn.extend({content:Bt(n0).default([]),structuredContent:wr(ue(),vr()).optional(),isError:rn().optional()}),FKe=Gg.or(xn.extend({toolResult:vr()})),u7=Ep.extend({name:ue(),arguments:wr(ue(),vr()).optional()}),$p=vn.extend({method:He("tools/call"),params:u7}),d7=Fi.extend({method:He("notifications/tools/list_changed"),params:Li.optional()}),jKe=ze({autoRefresh:rn().default(!0),debounceMs:ar().int().nonnegative().default(300)}),Rp=On(["debug","info","notice","warning","error","critical","alert","emergency"]),p7=Pi.extend({level:Rp}),s0=vn.extend({method:He("logging/setLevel"),params:p7}),f7=Li.extend({level:Rp,logger:ue().optional(),data:vr()}),h7=Fi.extend({method:He("notifications/message"),params:f7}),m7=ze({name:ue().optional()}),g7=ze({hints:Bt(m7).optional(),costPriority:ar().min(0).max(1).optional(),speedPriority:ar().min(0).max(1).optional(),intelligencePriority:ar().min(0).max(1).optional()}),y7=ze({mode:On(["auto","required","none"]).optional()}),_7=ze({type:He("tool_result"),toolUseId:ue().describe("The unique identifier for the corresponding tool call."),content:Bt(n0).default([]),structuredContent:ze({}).loose().optional(),isError:rn().optional(),_meta:wr(ue(),vr()).optional()}),b7=Cg("type",[e0,t0,r0]),Rg=Cg("type",[e0,t0,r0,t7,_7]),v7=ze({role:Op,content:mr([Rg,Bt(Rg)]),_meta:wr(ue(),vr()).optional()}),x7=Ep.extend({messages:Bt(v7),modelPreferences:g7.optional(),systemPrompt:ue().optional(),includeContext:On(["none","thisServer","allServers"]).optional(),temperature:ar().optional(),maxTokens:ar().int(),stopSequences:Bt(ue()).optional(),metadata:bn.optional(),tools:Bt(GD).optional(),toolChoice:y7.optional()}),S7=vn.extend({method:He("sampling/createMessage"),params:x7}),Dp=xn.extend({model:ue(),stopReason:Cr(On(["endTurn","stopSequence","maxTokens"]).or(ue())),role:Op,content:b7}),a0=xn.extend({model:ue(),stopReason:Cr(On(["endTurn","stopSequence","maxTokens","toolUse"]).or(ue())),role:Op,content:mr([Rg,Bt(Rg)])}),T7=ze({type:He("boolean"),title:ue().optional(),description:ue().optional(),default:rn().optional()}),w7=ze({type:He("string"),title:ue().optional(),description:ue().optional(),minLength:ar().optional(),maxLength:ar().optional(),format:On(["email","uri","date","date-time"]).optional(),default:ue().optional()}),E7=ze({type:On(["number","integer"]),title:ue().optional(),description:ue().optional(),minimum:ar().optional(),maximum:ar().optional(),default:ar().optional()}),P7=ze({type:He("string"),title:ue().optional(),description:ue().optional(),enum:Bt(ue()),default:ue().optional()}),I7=ze({type:He("string"),title:ue().optional(),description:ue().optional(),oneOf:Bt(ze({const:ue(),title:ue()})),default:ue().optional()}),A7=ze({type:He("string"),title:ue().optional(),description:ue().optional(),enum:Bt(ue()),enumNames:Bt(ue()).optional(),default:ue().optional()}),k7=mr([P7,I7]),C7=ze({type:He("array"),title:ue().optional(),description:ue().optional(),minItems:ar().optional(),maxItems:ar().optional(),items:ze({type:He("string"),enum:Bt(ue())}),default:Bt(ue()).optional()}),N7=ze({type:He("array"),title:ue().optional(),description:ue().optional(),minItems:ar().optional(),maxItems:ar().optional(),items:ze({anyOf:Bt(ze({const:ue(),title:ue()}))}),default:Bt(ue()).optional()}),O7=mr([C7,N7]),$7=mr([A7,k7,O7]),R7=mr([$7,T7,w7,E7]),D7=Ep.extend({mode:He("form").optional(),message:ue(),requestedSchema:ze({type:He("object"),properties:wr(ue(),R7),required:Bt(ue()).optional()})}),M7=Ep.extend({mode:He("url"),message:ue(),elicitationId:ue(),url:ue().url()}),L7=mr([D7,M7]),F7=vn.extend({method:He("elicitation/create"),params:L7}),j7=Li.extend({elicitationId:ue()}),B7=Fi.extend({method:He("notifications/elicitation/complete"),params:j7}),Vl=xn.extend({action:On(["accept","decline","cancel"]),content:$g(e=>e===null?void 0:e,wr(ue(),mr([ue(),ar(),rn(),Bt(ue())])).optional())}),z7=ze({type:He("ref/resource"),uri:ue()});var U7=ze({type:He("ref/prompt"),name:ue()}),q7=Pi.extend({ref:mr([U7,z7]),argument:ze({name:ue(),value:ue()}),context:ze({arguments:wr(ue(),ue()).optional()}).optional()}),W7=vn.extend({method:He("completion/complete"),params:q7});var V7=xn.extend({completion:Nn({values:Bt(ue()).max(100),total:Cr(ar().int()),hasMore:Cr(rn())})}),K7=ze({uri:ue().startsWith("file://"),name:ue().optional(),_meta:wr(ue(),vr()).optional()}),G7=vn.extend({method:He("roots/list"),params:Pi.optional()}),o0=xn.extend({roots:Bt(K7)}),Z7=Fi.extend({method:He("notifications/roots/list_changed"),params:Li.optional()}),BKe=mr([jg,Zw,W7,s0,e7,YZ,Yw,FZ,Qw,WZ,KZ,$p,i0,zg,qg,Wg,Kg]),zKe=mr([Fg,Bg,Hw,Z7,Np]),UKe=mr([Lg,Dp,a0,Vl,o0,Ug,Vg,ql]),qKe=mr([jg,S7,F7,G7,zg,qg,Wg,Kg]),WKe=mr([Fg,Bg,h7,ZZ,UZ,d7,a7,Np,B7]),VKe=mr([Lg,CZ,V7,s7,XZ,LZ,jZ,zZ,Gg,l7,Ug,Vg,ql]),At=class e extends Error{constructor(t,r,n){super(`MCP error ${t}: ${r}`),this.code=t,this.data=n,this.name="McpError"}static fromError(t,r,n){if(t===Zt.UrlElicitationRequired&&n){let s=n;if(s.elicitations)return new Uw(s.elicitations,r)}return new e(t,r,n)}},Uw=class extends At{constructor(t,r=`URL elicitation${t.length>1?"s":""} required`){super(Zt.UrlElicitationRequired,r,{elicitations:t})}get elicitations(){return this.data?.elicitations??[]}};function so(e){return e==="completed"||e==="failed"||e==="cancelled"}var H7=Symbol("Let zodToJsonSchema decide on which parser to use");var EGe=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function c0(e){let r=_g(e)?.method;if(!r)throw new Error("Schema is missing a method literal");let n=NR(r);if(typeof n!="string")throw new Error("Schema method literal must be a string");return n}function l0(e,t){let r=no(e,t);if(!r.success)throw r.error;return r.data}var tH=6e4,Zg=class{constructor(t){this._options=t,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(Fg,r=>{this._oncancel(r)}),this.setNotificationHandler(Bg,r=>{this._onprogress(r)}),this.setRequestHandler(jg,r=>({})),this._taskStore=t?.taskStore,this._taskMessageQueue=t?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(zg,async(r,n)=>{let s=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!s)throw new At(Zt.InvalidParams,"Failed to retrieve task: Task not found");return{...s}}),this.setRequestHandler(qg,async(r,n)=>{let s=async()=>{let a=r.params.taskId;if(this._taskMessageQueue){let c;for(;c=await this._taskMessageQueue.dequeue(a,n.sessionId);){if(c.type==="response"||c.type==="error"){let l=c.message,u=l.id,d=this._requestResolvers.get(u);if(d)if(this._requestResolvers.delete(u),c.type==="response")d(l);else{let p=l,f=new At(p.error.code,p.error.message,p.error.data);d(f)}else{let p=c.type==="response"?"Response":"Error";this._onerror(new Error(`${p} handler missing for request ${u}`))}continue}await this._transport?.send(c.message,{relatedRequestId:n.requestId})}}let o=await this._taskStore.getTask(a,n.sessionId);if(!o)throw new At(Zt.InvalidParams,`Task not found: ${a}`);if(!so(o.status))return await this._waitForTaskUpdate(a,n.signal),await s();if(so(o.status)){let c=await this._taskStore.getTaskResult(a,n.sessionId);return this._clearTaskQueue(a),{...c,_meta:{...c._meta,[io]:{taskId:a}}}}return await s()};return await s()}),this.setRequestHandler(Wg,async(r,n)=>{try{let{tasks:s,nextCursor:a}=await this._taskStore.listTasks(r.params?.cursor,n.sessionId);return{tasks:s,nextCursor:a,_meta:{}}}catch(s){throw new At(Zt.InvalidParams,`Failed to list tasks: ${s instanceof Error?s.message:String(s)}`)}}),this.setRequestHandler(Kg,async(r,n)=>{try{let s=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!s)throw new At(Zt.InvalidParams,`Task not found: ${r.params.taskId}`);if(so(s.status))throw new At(Zt.InvalidParams,`Cannot cancel task in terminal status: ${s.status}`);await this._taskStore.updateTaskStatus(r.params.taskId,"cancelled","Client cancelled task execution.",n.sessionId),this._clearTaskQueue(r.params.taskId);let a=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!a)throw new At(Zt.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...a}}catch(s){throw s instanceof At?s:new At(Zt.InvalidRequest,`Failed to cancel task: ${s instanceof Error?s.message:String(s)}`)}}))}async _oncancel(t){if(!t.params.requestId)return;this._requestHandlerAbortControllers.get(t.params.requestId)?.abort(t.params.reason)}_setupTimeout(t,r,n,s,a=!1){this._timeoutInfo.set(t,{timeoutId:setTimeout(s,r),startTime:Date.now(),timeout:r,maxTotalTimeout:n,resetTimeoutOnProgress:a,onTimeout:s})}_resetTimeout(t){let r=this._timeoutInfo.get(t);if(!r)return!1;let n=Date.now()-r.startTime;if(r.maxTotalTimeout&&n>=r.maxTotalTimeout)throw this._timeoutInfo.delete(t),At.fromError(Zt.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:r.maxTotalTimeout,totalElapsed:n});return clearTimeout(r.timeoutId),r.timeoutId=setTimeout(r.onTimeout,r.timeout),!0}_cleanupTimeout(t){let r=this._timeoutInfo.get(t);r&&(clearTimeout(r.timeoutId),this._timeoutInfo.delete(t))}async connect(t){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=t;let r=this.transport?.onclose;this._transport.onclose=()=>{r?.(),this._onclose()};let n=this.transport?.onerror;this._transport.onerror=a=>{n?.(a),this._onerror(a)};let s=this._transport?.onmessage;this._transport.onmessage=(a,o)=>{s?.(a,o),Pp(a)||jD(a)?this._onresponse(a):Vw(a)?this._onrequest(a,o):FD(a)?this._onnotification(a):this._onerror(new Error(`Unknown message type: ${JSON.stringify(a)}`))},await this._transport.start()}_onclose(){let t=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let n of this._requestHandlerAbortControllers.values())n.abort();this._requestHandlerAbortControllers.clear();let r=At.fromError(Zt.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let n of t.values())n(r)}_onerror(t){this.onerror?.(t)}_onnotification(t){let r=this._notificationHandlers.get(t.method)??this.fallbackNotificationHandler;r!==void 0&&Promise.resolve().then(()=>r(t)).catch(n=>this._onerror(new Error(`Uncaught error in notification handler: ${n}`)))}_onrequest(t,r){let n=this._requestHandlers.get(t.method)??this.fallbackRequestHandler,s=this._transport,a=t.params?._meta?.[io]?.taskId;if(n===void 0){let d={jsonrpc:"2.0",id:t.id,error:{code:Zt.MethodNotFound,message:"Method not found"}};a&&this._taskMessageQueue?this._enqueueTaskMessage(a,{type:"error",message:d,timestamp:Date.now()},s?.sessionId).catch(p=>this._onerror(new Error(`Failed to enqueue error response: ${p}`))):s?.send(d).catch(p=>this._onerror(new Error(`Failed to send an error response: ${p}`)));return}let o=new AbortController;this._requestHandlerAbortControllers.set(t.id,o);let c=DD(t.params)?t.params.task:void 0,l=this._taskStore?this.requestTaskStore(t,s?.sessionId):void 0,u={signal:o.signal,sessionId:s?.sessionId,_meta:t.params?._meta,sendNotification:async d=>{if(o.signal.aborted)return;let p={relatedRequestId:t.id};a&&(p.relatedTask={taskId:a}),await this.notification(d,p)},sendRequest:async(d,p,f)=>{if(o.signal.aborted)throw new At(Zt.ConnectionClosed,"Request was cancelled");let h={...f,relatedRequestId:t.id};a&&!h.relatedTask&&(h.relatedTask={taskId:a});let m=h.relatedTask?.taskId??a;return m&&l&&await l.updateTaskStatus(m,"input_required"),await this.request(d,p,h)},authInfo:r?.authInfo,requestId:t.id,requestInfo:r?.requestInfo,taskId:a,taskStore:l,taskRequestedTtl:c?.ttl,closeSSEStream:r?.closeSSEStream,closeStandaloneSSEStream:r?.closeStandaloneSSEStream};Promise.resolve().then(()=>{c&&this.assertTaskHandlerCapability(t.method)}).then(()=>n(t,u)).then(async d=>{if(o.signal.aborted)return;let p={result:d,jsonrpc:"2.0",id:t.id};a&&this._taskMessageQueue?await this._enqueueTaskMessage(a,{type:"response",message:p,timestamp:Date.now()},s?.sessionId):await s?.send(p)},async d=>{if(o.signal.aborted)return;let p={jsonrpc:"2.0",id:t.id,error:{code:Number.isSafeInteger(d.code)?d.code:Zt.InternalError,message:d.message??"Internal error",...d.data!==void 0&&{data:d.data}}};a&&this._taskMessageQueue?await this._enqueueTaskMessage(a,{type:"error",message:p,timestamp:Date.now()},s?.sessionId):await s?.send(p)}).catch(d=>this._onerror(new Error(`Failed to send response: ${d}`))).finally(()=>{this._requestHandlerAbortControllers.delete(t.id)})}_onprogress(t){let{progressToken:r,...n}=t.params,s=Number(r),a=this._progressHandlers.get(s);if(!a){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(t)}`));return}let o=this._responseHandlers.get(s),c=this._timeoutInfo.get(s);if(c&&o&&c.resetTimeoutOnProgress)try{this._resetTimeout(s)}catch(l){this._responseHandlers.delete(s),this._progressHandlers.delete(s),this._cleanupTimeout(s),o(l);return}a(n)}_onresponse(t){let r=Number(t.id),n=this._requestResolvers.get(r);if(n){if(this._requestResolvers.delete(r),Pp(t))n(t);else{let o=new At(t.error.code,t.error.message,t.error.data);n(o)}return}let s=this._responseHandlers.get(r);if(s===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(t)}`));return}this._responseHandlers.delete(r),this._cleanupTimeout(r);let a=!1;if(Pp(t)&&t.result&&typeof t.result=="object"){let o=t.result;if(o.task&&typeof o.task=="object"){let c=o.task;typeof c.taskId=="string"&&(a=!0,this._taskProgressTokens.set(c.taskId,r))}}if(a||this._progressHandlers.delete(r),Pp(t))s(t);else{let o=At.fromError(t.error.code,t.error.message,t.error.data);s(o)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(t,r,n){let{task:s}=n??{};if(!s){try{yield{type:"result",result:await this.request(t,r,n)}}catch(o){yield{type:"error",error:o instanceof At?o:new At(Zt.InternalError,String(o))}}return}let a;try{let o=await this.request(t,ql,n);if(o.task)a=o.task.taskId,yield{type:"taskCreated",task:o.task};else throw new At(Zt.InternalError,"Task creation did not return a task");for(;;){let c=await this.getTask({taskId:a},n);if(yield{type:"taskStatus",task:c},so(c.status)){c.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:a},r,n)}:c.status==="failed"?yield{type:"error",error:new At(Zt.InternalError,`Task ${a} failed`)}:c.status==="cancelled"&&(yield{type:"error",error:new At(Zt.InternalError,`Task ${a} was cancelled`)});return}if(c.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:a},r,n)};return}let l=c.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(u=>setTimeout(u,l)),n?.signal?.throwIfAborted()}}catch(o){yield{type:"error",error:o instanceof At?o:new At(Zt.InternalError,String(o))}}}request(t,r,n){let{relatedRequestId:s,resumptionToken:a,onresumptiontoken:o,task:c,relatedTask:l}=n??{};return new Promise((u,d)=>{let p=v=>{d(v)};if(!this._transport){p(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method),c&&this.assertTaskCapability(t.method)}catch(v){p(v);return}n?.signal?.throwIfAborted();let f=this._requestMessageId++,h={...t,jsonrpc:"2.0",id:f};n?.onprogress&&(this._progressHandlers.set(f,n.onprogress),h.params={...t.params,_meta:{...t.params?._meta||{},progressToken:f}}),c&&(h.params={...h.params,task:c}),l&&(h.params={...h.params,_meta:{...h.params?._meta||{},[io]:l}});let m=v=>{this._responseHandlers.delete(f),this._progressHandlers.delete(f),this._cleanupTimeout(f),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:f,reason:String(v)}},{relatedRequestId:s,resumptionToken:a,onresumptiontoken:o}).catch(w=>this._onerror(new Error(`Failed to send cancellation: ${w}`)));let S=v instanceof At?v:new At(Zt.RequestTimeout,String(v));d(S)};this._responseHandlers.set(f,v=>{if(!n?.signal?.aborted){if(v instanceof Error)return d(v);try{let S=no(r,v.result);S.success?u(S.data):d(S.error)}catch(S){d(S)}}}),n?.signal?.addEventListener("abort",()=>{m(n?.signal?.reason)});let g=n?.timeout??tH,y=()=>m(At.fromError(Zt.RequestTimeout,"Request timed out",{timeout:g}));this._setupTimeout(f,g,n?.maxTotalTimeout,y,n?.resetTimeoutOnProgress??!1);let _=l?.taskId;if(_){let v=S=>{let w=this._responseHandlers.get(f);w?w(S):this._onerror(new Error(`Response handler missing for side-channeled request ${f}`))};this._requestResolvers.set(f,v),this._enqueueTaskMessage(_,{type:"request",message:h,timestamp:Date.now()}).catch(S=>{this._cleanupTimeout(f),d(S)})}else this._transport.send(h,{relatedRequestId:s,resumptionToken:a,onresumptiontoken:o}).catch(v=>{this._cleanupTimeout(f),d(v)})})}async getTask(t,r){return this.request({method:"tasks/get",params:t},Ug,r)}async getTaskResult(t,r,n){return this.request({method:"tasks/result",params:t},r,n)}async listTasks(t,r){return this.request({method:"tasks/list",params:t},Vg,r)}async cancelTask(t,r){return this.request({method:"tasks/cancel",params:t},UD,r)}async notification(t,r){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(t.method);let n=r?.relatedTask?.taskId;if(n){let c={...t,jsonrpc:"2.0",params:{...t.params,_meta:{...t.params?._meta||{},[io]:r.relatedTask}}};await this._enqueueTaskMessage(n,{type:"notification",message:c,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(t.method)&&!t.params&&!r?.relatedRequestId&&!r?.relatedTask){if(this._pendingDebouncedNotifications.has(t.method))return;this._pendingDebouncedNotifications.add(t.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(t.method),!this._transport)return;let c={...t,jsonrpc:"2.0"};r?.relatedTask&&(c={...c,params:{...c.params,_meta:{...c.params?._meta||{},[io]:r.relatedTask}}}),this._transport?.send(c,r).catch(l=>this._onerror(l))});return}let o={...t,jsonrpc:"2.0"};r?.relatedTask&&(o={...o,params:{...o.params,_meta:{...o.params?._meta||{},[io]:r.relatedTask}}}),await this._transport.send(o,r)}setRequestHandler(t,r){let n=c0(t);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(s,a)=>{let o=l0(t,s);return Promise.resolve(r(o,a))})}removeRequestHandler(t){this._requestHandlers.delete(t)}assertCanSetRequestHandler(t){if(this._requestHandlers.has(t))throw new Error(`A request handler for ${t} already exists, which would be overridden`)}setNotificationHandler(t,r){let n=c0(t);this._notificationHandlers.set(n,s=>{let a=l0(t,s);return Promise.resolve(r(a))})}removeNotificationHandler(t){this._notificationHandlers.delete(t)}_cleanupTaskProgressHandler(t){let r=this._taskProgressTokens.get(t);r!==void 0&&(this._progressHandlers.delete(r),this._taskProgressTokens.delete(t))}async _enqueueTaskMessage(t,r,n){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let s=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(t,r,n,s)}async _clearTaskQueue(t,r){if(this._taskMessageQueue){let n=await this._taskMessageQueue.dequeueAll(t,r);for(let s of n)if(s.type==="request"&&Vw(s.message)){let a=s.message.id,o=this._requestResolvers.get(a);o?(o(new At(Zt.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(a)):this._onerror(new Error(`Resolver missing for request ${a} during task ${t} cleanup`))}}}async _waitForTaskUpdate(t,r){let n=this._options?.defaultTaskPollInterval??1e3;try{let s=await this._taskStore?.getTask(t);s?.pollInterval&&(n=s.pollInterval)}catch{}return new Promise((s,a)=>{if(r.aborted){a(new At(Zt.InvalidRequest,"Request cancelled"));return}let o=setTimeout(s,n);r.addEventListener("abort",()=>{clearTimeout(o),a(new At(Zt.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(t,r){let n=this._taskStore;if(!n)throw new Error("No task store configured");return{createTask:async s=>{if(!t)throw new Error("No request provided");return await n.createTask(s,t.id,{method:t.method,params:t.params},r)},getTask:async s=>{let a=await n.getTask(s,r);if(!a)throw new At(Zt.InvalidParams,"Failed to retrieve task: Task not found");return a},storeTaskResult:async(s,a,o)=>{await n.storeTaskResult(s,a,o,r);let c=await n.getTask(s,r);if(c){let l=Np.parse({method:"notifications/tasks/status",params:c});await this.notification(l),so(c.status)&&this._cleanupTaskProgressHandler(s)}},getTaskResult:s=>n.getTaskResult(s,r),updateTaskStatus:async(s,a,o)=>{let c=await n.getTask(s,r);if(!c)throw new At(Zt.InvalidParams,`Task "${s}" not found - it may have been cleaned up`);if(so(c.status))throw new At(Zt.InvalidParams,`Cannot update task "${s}" from terminal status "${c.status}" to "${a}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await n.updateTaskStatus(s,a,o,r);let l=await n.getTask(s,r);if(l){let u=Np.parse({method:"notifications/tasks/status",params:l});await this.notification(u),so(l.status)&&this._cleanupTaskProgressHandler(s)}},listTasks:s=>n.listTasks(s,r)}}};function ZD(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function HD(e,t){let r={...e};for(let n in t){let s=n,a=t[s];if(a===void 0)continue;let o=r[s];ZD(o)&&ZD(a)?r[s]={...o,...a}:r[s]=a}return r}var DF=Fe(ZE(),1),MF=Fe(RF(),1);function Kee(){let e=new DF.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,MF.default)(e),e}var Cy=class{constructor(t){this._ajv=t??Kee()}getValidator(t){let r="$id"in t&&typeof t.$id=="string"?this._ajv.getSchema(t.$id)??this._ajv.compile(t):this._ajv.compile(t);return n=>r(n)?{valid:!0,data:n,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(r.errors)}}};var Ny=class{constructor(t){this._server=t}requestStream(t,r,n){return this._server.requestStream(t,r,n)}createMessageStream(t,r){let n=this._server.getClientCapabilities();if((t.tools||t.toolChoice)&&!n?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if(t.messages.length>0){let s=t.messages[t.messages.length-1],a=Array.isArray(s.content)?s.content:[s.content],o=a.some(d=>d.type==="tool_result"),c=t.messages.length>1?t.messages[t.messages.length-2]:void 0,l=c?Array.isArray(c.content)?c.content:[c.content]:[],u=l.some(d=>d.type==="tool_use");if(o){if(a.some(d=>d.type!=="tool_result"))throw new Error("The last message must contain only tool_result content if any is present");if(!u)throw new Error("tool_result blocks are not matching any tool_use from the previous message")}if(u){let d=new Set(l.filter(f=>f.type==="tool_use").map(f=>f.id)),p=new Set(a.filter(f=>f.type==="tool_result").map(f=>f.toolUseId));if(d.size!==p.size||![...d].every(f=>p.has(f)))throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return this.requestStream({method:"sampling/createMessage",params:t},Dp,r)}elicitInputStream(t,r){let n=this._server.getClientCapabilities(),s=t.mode??"form";switch(s){case"url":{if(!n?.elicitation?.url)throw new Error("Client does not support url elicitation.");break}case"form":{if(!n?.elicitation?.form)throw new Error("Client does not support form elicitation.");break}}let a=s==="form"&&t.mode===void 0?{...t,mode:"form"}:t;return this.requestStream({method:"elicitation/create",params:a},Vl,r)}async getTask(t,r){return this._server.getTask({taskId:t},r)}async getTaskResult(t,r,n){return this._server.getTaskResult({taskId:t},r,n)}async listTasks(t,r){return this._server.listTasks(t?{cursor:t}:void 0,r)}async cancelTask(t,r){return this._server.cancelTask({taskId:t},r)}};function LF(e,t,r){if(!e)throw new Error(`${r} does not support task creation (required for ${t})`);switch(t){case"tools/call":if(!e.tools?.call)throw new Error(`${r} does not support task creation for tools/call (required for ${t})`);break;default:break}}function FF(e,t,r){if(!e)throw new Error(`${r} does not support task creation (required for ${t})`);switch(t){case"sampling/createMessage":if(!e.sampling?.createMessage)throw new Error(`${r} does not support task creation for sampling/createMessage (required for ${t})`);break;case"elicitation/create":if(!e.elicitation?.create)throw new Error(`${r} does not support task creation for elicitation/create (required for ${t})`);break;default:break}}var Oy=class extends Zg{constructor(t,r){super(r),this._serverInfo=t,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(Rp.options.map((n,s)=>[n,s])),this.isMessageIgnored=(n,s)=>{let a=this._loggingLevels.get(s);return a?this.LOG_LEVEL_SEVERITY.get(n)<this.LOG_LEVEL_SEVERITY.get(a):!1},this._capabilities=r?.capabilities??{},this._instructions=r?.instructions,this._jsonSchemaValidator=r?.jsonSchemaValidator??new Cy,this.setRequestHandler(Zw,n=>this._oninitialize(n)),this.setNotificationHandler(Hw,()=>this.oninitialized?.()),this._capabilities.logging&&this.setRequestHandler(s0,async(n,s)=>{let a=s.sessionId||s.requestInfo?.headers["mcp-session-id"]||void 0,{level:o}=n.params,c=Rp.safeParse(o);return c.success&&this._loggingLevels.set(a,c.data),{}})}get experimental(){return this._experimental||(this._experimental={tasks:new Ny(this)}),this._experimental}registerCapabilities(t){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=HD(this._capabilities,t)}setRequestHandler(t,r){let s=_g(t)?.method;if(!s)throw new Error("Schema is missing a method literal");let a;if(Bl(s)){let c=s;a=c._zod?.def?.value??c.value}else{let c=s;a=c._def?.value??c.value}if(typeof a!="string")throw new Error("Schema method literal must be a string");if(a==="tools/call"){let c=async(l,u)=>{let d=no($p,l);if(!d.success){let m=d.error instanceof Error?d.error.message:String(d.error);throw new At(Zt.InvalidParams,`Invalid tools/call request: ${m}`)}let{params:p}=d.data,f=await Promise.resolve(r(l,u));if(p.task){let m=no(ql,f);if(!m.success){let g=m.error instanceof Error?m.error.message:String(m.error);throw new At(Zt.InvalidParams,`Invalid task creation result: ${g}`)}return m.data}let h=no(Gg,f);if(!h.success){let m=h.error instanceof Error?h.error.message:String(h.error);throw new At(Zt.InvalidParams,`Invalid tools/call result: ${m}`)}return h.data};return super.setRequestHandler(t,c)}return super.setRequestHandler(t,r)}assertCapabilityForMethod(t){switch(t){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw new Error(`Client does not support sampling (required for ${t})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new Error(`Client does not support elicitation (required for ${t})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new Error(`Client does not support listing roots (required for ${t})`);break;case"ping":break}}assertNotificationCapability(t){switch(t){case"notifications/message":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${t})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new Error(`Server does not support notifying about resources (required for ${t})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new Error(`Server does not support notifying of tool list changes (required for ${t})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new Error(`Server does not support notifying of prompt list changes (required for ${t})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new Error(`Client does not support URL elicitation (required for ${t})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(t){if(this._capabilities)switch(t){case"completion/complete":if(!this._capabilities.completions)throw new Error(`Server does not support completions (required for ${t})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${t})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new Error(`Server does not support prompts (required for ${t})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new Error(`Server does not support resources (required for ${t})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new Error(`Server does not support tools (required for ${t})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Server does not support tasks capability (required for ${t})`);break;case"ping":case"initialize":break}}assertTaskCapability(t){FF(this._clientCapabilities?.tasks?.requests,t,"Client")}assertTaskHandlerCapability(t){this._capabilities&&LF(this._capabilities.tasks?.requests,t,"Server")}async _oninitialize(t){let r=t.params.protocolVersion;return this._clientCapabilities=t.params.capabilities,this._clientVersion=t.params.clientInfo,{protocolVersion:OD.includes(r)?r:qw,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"},Lg)}async createMessage(t,r){if((t.tools||t.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if(t.messages.length>0){let n=t.messages[t.messages.length-1],s=Array.isArray(n.content)?n.content:[n.content],a=s.some(u=>u.type==="tool_result"),o=t.messages.length>1?t.messages[t.messages.length-2]:void 0,c=o?Array.isArray(o.content)?o.content:[o.content]:[],l=c.some(u=>u.type==="tool_use");if(a){if(s.some(u=>u.type!=="tool_result"))throw new Error("The last message must contain only tool_result content if any is present");if(!l)throw new Error("tool_result blocks are not matching any tool_use from the previous message")}if(l){let u=new Set(c.filter(p=>p.type==="tool_use").map(p=>p.id)),d=new Set(s.filter(p=>p.type==="tool_result").map(p=>p.toolUseId));if(u.size!==d.size||![...u].every(p=>d.has(p)))throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return t.tools?this.request({method:"sampling/createMessage",params:t},a0,r):this.request({method:"sampling/createMessage",params:t},Dp,r)}async elicitInput(t,r){switch(t.mode??"form"){case"url":{if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support url elicitation.");let s=t;return this.request({method:"elicitation/create",params:s},Vl,r)}case"form":{if(!this._clientCapabilities?.elicitation?.form)throw new Error("Client does not support form elicitation.");let s=t.mode==="form"?t:{...t,mode:"form"},a=await this.request({method:"elicitation/create",params:s},Vl,r);if(a.action==="accept"&&a.content&&s.requestedSchema)try{let c=this._jsonSchemaValidator.getValidator(s.requestedSchema)(a.content);if(!c.valid)throw new At(Zt.InvalidParams,`Elicitation response content does not match requested schema: ${c.errorMessage}`)}catch(o){throw o instanceof At?o:new At(Zt.InternalError,`Error validating elicitation response: ${o instanceof Error?o.message:String(o)}`)}return a}}}createElicitationCompletionNotifier(t,r){if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:t}},r)}async listRoots(t,r){return this.request({method:"roots/list",params:t},o0,r)}async sendLoggingMessage(t,r){if(this._capabilities.logging&&!this.isMessageIgnored(t.level,r))return this.notification({method:"notifications/message",params:t})}async sendResourceUpdated(t){return this.notification({method:"notifications/resources/updated",params:t})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}};var rP=Fe(require("node:process"),1);var $y=class{append(t){this._buffer=this._buffer?Buffer.concat([this._buffer,t]):t}readMessage(){if(!this._buffer)return null;let t=this._buffer.indexOf(`
|
|
256
256
|
`);if(t===-1)return null;let r=this._buffer.toString("utf8",0,t).replace(/\r$/,"");return this._buffer=this._buffer.subarray(t+1),Gee(r)}clear(){this._buffer=void 0}};function Gee(e){return BD.parse(JSON.parse(e))}function jF(e){return JSON.stringify(e)+`
|
|
257
257
|
`}var Ry=class{constructor(t=rP.default.stdin,r=rP.default.stdout){this._stdin=t,this._stdout=r,this._readBuffer=new $y,this._started=!1,this._ondata=n=>{this._readBuffer.append(n),this.processReadBuffer()},this._onerror=n=>{this.onerror?.(n)}}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 t=this._readBuffer.readMessage();if(t===null)break;this.onmessage?.(t)}catch(t){this.onerror?.(t)}}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(t){return new Promise(r=>{let n=jF(t);this._stdout.write(n)?r():this._stdout.once("drain",r)})}};_c();function zF(e,t){e.setRequestHandler(Yw,async()=>({resources:[{uri:"codeatlas://workspace/microservices",name:"Workspace Microservices",mimeType:"application/json",description:"A map of all detected microservices, backend apps, and their interconnectivity."},{uri:"codeatlas://workspace/apis",name:"Workspace Exposed APIs",mimeType:"application/json",description:"A list of all detected REST API routes, webhooks, and controllers."},{uri:"codeatlas://workspace/features",name:"Workspace Feature Clusters",mimeType:"application/json",description:"A list of related file clusters mapping to high-level features."},{uri:"codeatlas://workspace/entrypoints",name:"Workspace Entry Points (all categories)",mimeType:"application/json",description:"Every architectural entry point in the workspace \u2014 HTTP routes, background jobs, MQ consumers, CLI commands, mobile screens, navigation routes, DB migrations/seeds, websockets, GraphQL subscriptions, model hooks, etc. Each entry includes its file, cluster, service, auth status, and middleware chain."},{uri:"codeatlas://workspace/diff-summary",name:"Workspace Diff Summary",mimeType:"application/json",description:'What changed since the baseline snapshot \u2014 added/deleted/modified entry points, modified clusters, changed file list. Single-call answer to "what is this PR/branch touching?".'},{uri:"codeatlas://workspace/ai-findings",name:"AI Review Findings",mimeType:"application/json",description:"Full list of AI-review findings on the workspace. Each finding includes layer bindings, severity, category, and an optional file/symbol anchor."},{uri:"codeatlas://workspace/review-guidelines",name:"Review Guidelines",mimeType:"application/json",description:"User-supplied review guidelines injected into every AI review prompt (\u22648 KB)."},{uri:"codeatlas://workspace/review-summary",name:"Review Summary",mimeType:"application/json",description:"Aggregate review state \u2014 counts by layer + severity, last guidelines hash, sample top findings."}]})),e.setRequestHandler(Qw,async r=>{let{uri:n}=r.params,s=t.getWorking();if(n==="codeatlas://workspace/microservices"){let a=Object.values(s.services||{}).map(o=>({id:o.id,name:o.name,rootPath:o.rootPath,technology:o.technology,exposedApiCount:o.exposedApiCount,consumesUrlPatterns:(o.consumedUrls??[]).map(c=>typeof c=="string"?c.replace(/env:[A-Z_][A-Z0-9_]*/g,"env:[REDACTED]"):c),consumesServices:o.consumedServices}));return{contents:[{uri:n,mimeType:"application/json",text:JSON.stringify(a,null,2)}]}}if(n==="codeatlas://workspace/apis"){let a=Object.values(s.apiIndex||{}).map(o=>({method:o.method,route:o.route,filePath:o.filePath,handlerName:o.handlerName,auth:o.meta?.auth,middlewares:o.meta?.middlewares,error:o.meta?.error,webhook:o.meta?.webhook,webhookProvider:o.meta?.webhookProvider,dynamicRangeCount:o.meta?.dynamicRange?.count,diff:o.diff}));return{contents:[{uri:n,mimeType:"application/json",text:JSON.stringify(a,null,2)}]}}if(n==="codeatlas://workspace/entrypoints"){let a=ui(s);return{contents:[{uri:n,mimeType:"application/json",text:JSON.stringify(a,null,2)}]}}if(n==="codeatlas://workspace/diff-summary"){let a=lu(s,t.getBaseline());return{contents:[{uri:n,mimeType:"application/json",text:JSON.stringify(a,null,2)}]}}if(n==="codeatlas://workspace/features"){let a=Object.values(s.clusters||{}).map(o=>({id:o.id,concept:o.label,files:o.files}));return{contents:[{uri:n,mimeType:"application/json",text:JSON.stringify(a,null,2)}]}}if(n==="codeatlas://workspace/ai-findings"){let a=t.listAiReviewFindings();return{contents:[{uri:n,mimeType:"application/json",text:JSON.stringify(a,null,2)}]}}if(n==="codeatlas://workspace/review-guidelines"){let a=t.getReviewGuidelines();return{contents:[{uri:n,mimeType:"application/json",text:JSON.stringify(a,null,2)}]}}if(n==="codeatlas://workspace/review-summary"){let a=t.getAiReviewFindingCounts(),o=t.getReviewGuidelines(),c=t.listAiReviewFindings({severity:"error",status:"open"}).slice(0,5);return{contents:[{uri:n,mimeType:"application/json",text:JSON.stringify({counts:a,guidelines:{hash:o.hash,updatedAt:o.updatedAt},topErrors:c},null,2)}]}}throw new Error(`Resource not found: ${n}`)})}Oo();ch();var lh=class{constructor(t,r,n=100){this.ids=new Set;this.cache=new Map;this.lru=[];this.dirty=new Map;this.tombstones=new Set;this.sqlite=t,this.kind=r,this.lruLimit=n}resetWithIds(t){this.ids.clear();for(let r of t)this.ids.add(r);this.cache.clear(),this.lru.length=0,this.dirty.clear(),this.tombstones.clear()}get(t){if(this.tombstones.has(t))return;if(this.dirty.has(t))return this.dirty.get(t);if(this.cache.has(t))return this.touch(t),this.cache.get(t);if(!this.ids.has(t))return;let r=this.sqlite.get("SELECT graph_json FROM graphs WHERE snapshot_kind = ? AND graph_id = ?",[this.kind,t]);if(!r||typeof r.graph_json!="string")return;let n;try{n=JSON.parse(r.graph_json)}catch{return}return this.cache.set(t,n),this.lru.push(t),this.evictIfNeeded(),n}set(t,r){this.dirty.set(t,r),this.tombstones.delete(t),this.ids.add(t),this.cache.set(t,r),this.touch(t),this.evictIfNeeded()}delete(t){let r=this.ids.has(t)||this.dirty.has(t);this.dirty.delete(t),this.cache.delete(t),this.tombstones.add(t),this.ids.delete(t);let n=this.lru.indexOf(t);return n>=0&&this.lru.splice(n,1),r}has(t){return this.tombstones.has(t)?!1:this.ids.has(t)}keys(){return Array.from(this.ids)}size(){return this.ids.size}forEach(t){for(let[n,s]of this.dirty){if(this.tombstones.has(n))continue;if(t(n,s)===!1)return}if(!this.sqlite.isOpen())return;let r=this.sqlite.prepareIterator("SELECT graph_id, graph_json FROM graphs WHERE snapshot_kind = ?",[this.kind]);try{for(;r.step();){let n=r.getAsObject(),s=String(n.graph_id);if(this.dirty.has(s)||this.tombstones.has(s))continue;let a;try{a=JSON.parse(String(n.graph_json))}catch{continue}if(t(s,a)===!1)return}}finally{r.free()}}flushDirty(){for(let t of this.tombstones)this.sqlite.run("DELETE FROM graphs WHERE snapshot_kind = ? AND graph_id = ?",[this.kind,t]);this.tombstones.clear();for(let[t,r]of this.dirty)this.sqlite.run(`INSERT INTO graphs (snapshot_kind, graph_id, graph_json) VALUES (?, ?, ?)
|
|
258
258
|
ON CONFLICT(snapshot_kind, graph_id) DO UPDATE SET graph_json = excluded.graph_json`,[this.kind,t,JSON.stringify(r)]);this.dirty.clear()}forgetBodies(){this.cache.clear(),this.lru.length=0}forgetAll(){this.ids.clear(),this.cache.clear(),this.lru.length=0,this.dirty.clear(),this.tombstones.clear()}getDirtyPayload(){return{writes:new Map(this.dirty),tombstones:new Set(this.tombstones)}}touch(t){let r=this.lru.indexOf(t);r>=0&&this.lru.splice(r,1),this.lru.push(t)}evictIfNeeded(){for(;this.lru.length>this.lruLimit;){let t=this.lru.shift();t!==void 0&&!this.dirty.has(t)&&this.cache.delete(t)}}},I3=new WeakMap;function uh(e){let t=Object.create(null),r=new Proxy(t,{get(n,s){if(typeof s=="string")return e.get(s)},set(n,s,a){return typeof s!="string"?!1:(e.set(s,a),!0)},deleteProperty(n,s){return typeof s!="string"?!1:(e.delete(s),!0)},has(n,s){return typeof s!="string"?!1:e.has(s)},ownKeys(){return e.keys()},getOwnPropertyDescriptor(n,s){if(typeof s!="string"||!e.has(s))return;let a=e.get(s);return a===void 0?void 0:{enumerable:!0,configurable:!0,writable:!0,value:a}}});return I3.set(r,e),r}function W1(e){return I3.get(e)}function V1(e,t){let r=W1(e);if(r){r.forEach(t);return}for(let[n,s]of Object.entries(e))if(t(n,s)===!1)return}var AMe=/[/\\](tests?|__tests?__|spec)[/\\]|\.test\.|\.spec\./i;function A3(e,t,r={}){let n=typeof r=="number"?{maxDepth:r,minConfidence:0,relationTypes:["calls","imports"],includeTests:!0}:{maxDepth:r.maxDepth??4,minConfidence:r.minConfidence??0,relationTypes:r.relationTypes??["calls","imports"],includeTests:r.includeTests??!0},s;t.callGraph?s=Qr.deserialize(t.callGraph):s=ws(t);let a=new Set(e),o=oh(e,s),c=o.map($=>{let H=$.indexOf("::"),Y=H>=0?$.slice(0,H):$,ae=H>=0?$.slice(H+2):$;return{key:$,filePath:Y,functionName:ae,depth:0,impactKind:"direct"}}),l=(t.callGraph?.edges?.length??0)>0||t.callGraph?.nodes&&Object.values(t.callGraph.nodes).some($=>($.callEdges?.length??0)>0),u;l&&(n.minConfidence>0||n.relationTypes.length<2)?u=s.getImpactedFiltered(o,{maxDepth:n.maxDepth,minConfidence:n.minConfidence,kinds:n.relationTypes}).map(({key:H,depth:Y,confidence:ae,kind:K})=>{let D=H.indexOf("::"),A=D>=0?H.slice(0,D):H,M=D>=0?H.slice(D+2):H;return{key:H,filePath:A,functionName:M,depth:Y,impactKind:"transitive",edgeConfidence:ae,edgeKind:K}}):u=s.getImpacted(o,n.maxDepth).map(({key:H,depth:Y})=>{let ae=H.indexOf("::"),K=ae>=0?H.slice(0,ae):H,D=ae>=0?H.slice(ae+2):H;return{key:H,filePath:K,functionName:D,depth:Y,impactKind:"transitive"}});let d=new Set(u.map($=>$.key)),p=new Set(o),f=[],h=new Map;for(let $ of s.getAllNodes())h.has($.filePath)||h.set($.filePath,[]),h.get($.filePath).push({key:$.key,functionName:$.functionName});let m=new Set(a);for(let $=0;$<3;$++){let H=[];for(let[Y,ae]of Object.entries(t.files)){if(m.has(Y))continue;(ae.symbols?.imports??[]).some(D=>{let A=No(D.source,Y,t.files);return A!==void 0&&m.has(A)})&&H.push(Y)}if(H.length===0)break;H.forEach(Y=>m.add(Y))}let g=new Set;for(let[$,H]of Object.entries(t.files))if(!(a.has($)||!(H.symbols?.imports??[]).some(ae=>{let K=No(ae.source,$,t.files);return K!==void 0&&m.has(K)})))for(let ae of h.get($)??[])p.has(ae.key)||d.has(ae.key)||g.has(ae.key)||(f.push({key:ae.key,filePath:$,functionName:ae.functionName,depth:1,impactKind:"review-required"}),g.add(ae.key));let y=[...c,...u,...f];n.includeTests||(y=y.filter($=>!AMe.test($.filePath)));let _=new Set([...e,...y.map($=>$.filePath)]),v=new Set;if(t.clusters)for(let $ of _){let H=P3($,t.clusters);H&&v.add(H.id)}let S=new Set;if(t.services)for(let $ of Object.values(t.services)){let H=$.rootPath;for(let Y of _)if(Y.startsWith(H)||H===""||H==="."){S.add($.id);break}}let w=[],E=[],k=[],N=W1(t.graphs),O=N?N.keys():Object.keys(t.graphs);for(let $ of O)if($.startsWith("sequence:")){let H=$.replace("sequence:","");if(a.has(H)){w.push($);continue}let ae=N?N.get($):t.graphs[$];ae&&ae.nodes.some(K=>_.has(K.anchor?.filePath))&&w.push($)}else if($.startsWith("file:")){let H=$.replace("file:","");_.has(H)&&E.push($)}else if($.startsWith("flow:")){let Y=$.replace("flow:","").split(":").slice(0,-1).join(":");_.has(Y)&&k.push($)}let V=y.filter($=>$.impactKind==="direct").length,te=y.filter($=>$.impactKind==="transitive").length,W=y.filter($=>$.impactKind==="review-required").length;return{changedFiles:e,changedFunctionKeys:o,impactedFunctions:y,affectedClusterIds:[...v],affectedServiceIds:[...S],affectedSequenceGraphIds:w,affectedFileGraphIds:E,affectedFlowGraphIds:k,options:n,summary:{directImpacts:V,transitiveImpacts:te,reviewRequired:W,clustersAffected:v.size,servicesAffected:S.size}}}Oo();_c();var k3=new Set(["the","and","or","but","is","in","on","at","to","of","a","an","for","with","by","as","be","this","that","it","from","into","return","const","let","var","function","async","await"]);function un(e){if(!e)return[];let t=new Set,r=e.split(/[^A-Za-z0-9_]+/).filter(Boolean);for(let n of r){let s=n.toLowerCase();s.length>=2&&!k3.has(s)&&t.add(s);let a=n.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Za-z])([0-9])/g,"$1 $2");for(let o of a.split(/[_\-./\s]+/)){let c=o.toLowerCase();c.length>=2&&!k3.has(c)&&t.add(c)}}return[...t]}var kMe={route:1.6,feature:1.4,service:1.4,class:1.2,function:1.1,file:.8};function CMe(e){let t=[];for(let n of Object.values(e.clusters??{})){let s=n.name??n.label,a=`feature: ${s} (${n.files.length} files, ${n.entryPoints?.length??0} entry points)`;t.push({kind:"feature",id:n.id,name:s,headline:a,clusterLabel:n.label,serviceId:n.serviceId,diff:n.diff,primaryTokens:new Set(un(s)),secondaryTokens:new Set([...un(n.id),...n.files.flatMap(o=>un(o))])})}for(let n of Object.values(e.services??{})){let s=`service: ${n.name} (${n.technology}, ${n.exposedApiCount} exposed APIs)`;t.push({kind:"service",id:n.id,name:n.name,headline:s,serviceId:n.id,diff:n.diff,primaryTokens:new Set(un(n.name)),secondaryTokens:new Set([...un(n.id),...un(n.rootPath),...un(n.technology)])})}let r=new Map;for(let n of Object.values(e.clusters??{}))for(let s of n.files)r.set(s,{id:n.id,label:n.name??n.label,serviceId:n.serviceId});for(let n of Object.values(e.apiIndex??{})){let s=r.get(n.filePath),a=`${n.method} ${n.route} \u2192 ${n.handlerName} (${n.filePath})`;t.push({kind:"route",id:n.apiId,name:`${n.method} ${n.route}`,headline:a,method:n.method,route:n.route,filePath:n.filePath,clusterLabel:s?.label,serviceId:s?.serviceId,diff:n.diff,primaryTokens:new Set([...un(n.route),...un(n.handlerName),...un(n.method.toLowerCase())]),secondaryTokens:new Set([...un(n.filePath),...(n.meta?.middlewares??[]).flatMap(o=>un(o))])})}for(let[n,s]of Object.entries(e.files??{}))for(let a of s.symbols?.functions??[]){let o=a.kind==="class"?"class":"function",c=`${o}: ${a.name} (${n})`;t.push({kind:o,id:`${n}::${a.name}`,name:a.name,headline:c,filePath:n,primaryTokens:new Set(un(a.name)),secondaryTokens:new Set([...un(n),...un(a.signature??""),...(a.calls??[]).flatMap(l=>un(l))])})}for(let[n]of Object.entries(e.files??{}))t.push({kind:"file",id:n,name:n.split("/").pop()??n,headline:`file: ${n}`,filePath:n,primaryTokens:new Set(un(n)),secondaryTokens:new Set});return t}function C3(e,t,r={}){let n=[];if(Array.isArray(t)){let p=new Set;for(let f of t)for(let h of un(f))p.has(h)||(p.add(h),n.push(h))}else n.push(...un(t));if(n.length===0)return[];let s=r.limit??20,a=r.minScore??.05,o=r.requireAll===!0,c=r.kinds&&r.kinds.length>0?new Set(r.kinds):null,l=CMe(e),u=[];for(let p of l){if(c&&!c.has(p.kind))continue;let f=0,h=0;for(let y of n){let _=p.primaryTokens.has(y),v=p.secondaryTokens.has(y);_?(f+=3,h++):v&&(f+=1,h++)}if(h===0||o&&h<n.length)continue;let m=h/n.length,g=f*m*kMe[p.kind];p.diff&&p.diff!=="unchanged"&&(g*=1.2),u.push({entry:p,raw:g})}if(u.length===0)return[];u.sort((p,f)=>f.raw-p.raw);let d=u[0].raw;return u.map(({entry:p,raw:f})=>({kind:p.kind,id:p.id,name:p.name,headline:p.headline,score:Number((f/d).toFixed(3)),filePath:p.filePath,route:p.route,method:p.method,clusterLabel:p.clusterLabel,serviceId:p.serviceId,diff:p.diff})).filter(p=>p.score>=a).slice(0,s)}var NMe=["INSERT","UPDATE","DELETE","REPLACE","DROP","ALTER","CREATE","ATTACH","DETACH","PRAGMA","REINDEX","VACUUM","BEGIN","COMMIT","ROLLBACK","SAVEPOINT","RELEASE","TRUNCATE","MERGE","GRANT","REVOKE"],OMe=new RegExp(`\\b(${NMe.join("|")})\\b`,"i"),K1=new Set(["apis","graphs","files","snapshots","comments","settings","sqlite_master"]);function $Me(e){let t=[],r=e.replace(/'[^']*'/g,"''").replace(/"[^"]*"/g,'""'),n=/\b(?:FROM|JOIN)\s+([a-z_][a-z0-9_]*)/gi,s;for(;(s=n.exec(r))!==null;)t.push(s[1].toLowerCase());return t}function RMe(e){let t=e.replace(/'[^']*'/g,"''").replace(/"[^"]*"/g,'""');if(!/^\s*WITH\b/i.test(t))return[];let r=[],n=/(?:WITH|,)\s+([a-z_][a-z0-9_]*)\s+AS\s*\(/gi,s;for(;(s=n.exec(t))!==null;)r.push(s[1].toLowerCase());return r}function N3(e,t,r=100){if(!t||typeof t!="string")return{error:"query must be a non-empty string"};if(t.length>4e3)return{error:"query exceeds max length (4000 bytes)"};let n=t.trim().replace(/;\s*$/,"");if(n.includes(";"))return{error:"multiple statements not allowed",hint:"remove the embedded semicolon"};let s=n.split(/\s+/,1)[0]?.toUpperCase();if(s!=="SELECT"&&s!=="WITH")return{error:"only SELECT (or WITH \u2026 SELECT) statements are allowed",hint:`got: ${s}`};let a=n.replace(/'[^']*'/g,"''").replace(/"[^"]*"/g,'""'),o=a.match(OMe);if(o)return{error:`forbidden keyword: ${o[1]}`,hint:"only read-only SELECTs are allowed"};let c=new Set(RMe(n)),l=$Me(n);for(let g of l)if(!K1.has(g)&&!c.has(g))return{error:`table not allowed: ${g}`,hint:`allowed tables: ${[...K1].join(", ")}`};let u=Math.min(Math.max(1,r),1e3),p=/\bLIMIT\s+\d+/i.test(a)?n:`${n} LIMIT ${u+1}`,f;try{f=e.getSqliteStore().all(p)}catch(g){return{error:`sql error: ${g?.message??String(g)}`}}let h=f.length>u;return h&&(f=f.slice(0,u)),{columns:f.length>0?Object.keys(f[0]):[],rows:f,rowCount:f.length,truncated:h,executedSql:p}}function O3(e){let t=e.getSqliteStore(),r=[];for(let n of K1)if(n!=="sqlite_master")try{let s=t.all(`PRAGMA table_info(${n})`);if(s.length===0)continue;let a=t.get(`SELECT count(*) AS c FROM ${n}`);r.push({name:n,columns:s.map(o=>({name:o.name,type:o.type,notnull:!!o.notnull,pk:!!o.pk})),rowCount:Number(a?.c??0)})}catch{}return{tables:r,notes:["apis.record_json is a JSON-encoded ApiRecord (method, route, handlerName, filePath, meta {auth, middlewares, error, webhook, dynamicRange}, diff). Query JSON fields with json_extract(record_json, '$.path.to.field').","graphs.graph_json is a JSON-encoded DiagramGraph (graphId, type, nodes[], edges[], anchors, meta). The graph_id column is `<type>:<filePath>:<handlerName>` for sequence/flow graphs.","files.record_json is the FileRecord; the `content` column may be NULL after a save (#354/#355) \u2014 use the SnapshotStore.getFileContent() API for content access instead.","snapshot_kind column on apis/graphs/files is 'baseline' | 'working'. Filter by it explicitly.","Forbidden keywords (will be rejected): INSERT, UPDATE, DELETE, DROP, ALTER, CREATE, ATTACH, DETACH, PRAGMA, VACUUM, BEGIN, COMMIT, ROLLBACK, TRUNCATE."]}}Oo();function $3(e,t,r,n,s,a=8){let o=Qr.makeKey(t,r),c=Qr.makeKey(n,s),l={fromKey:o,toKey:c,path:[],visited:0,truncated:!1};if(!e.callGraph)return l;let u=Qr.deserialize(e.callGraph);if(!u.getNode(o)||!u.getNode(c))return l;let d=new Map,p=[{key:o,depth:0}];d.set(o,{prev:""});let f=!1,h=!1;for(;p.length>0;){let{key:y,depth:_}=p.shift();if(y===c){h=!0;break}if(_>=a){f=!0;continue}let v=u.getReachable(y,1);for(let S of v){if(d.has(S.key))continue;let E=u.getNode(y)?.callEdges?.find(k=>k.key===S.key);d.set(S.key,{prev:y,edgeKind:E?.kind,edgeConfidence:E?.confidence}),p.push({key:S.key,depth:_+1})}}if(!h)return{fromKey:o,toKey:c,path:[],visited:d.size,truncated:f};let m=[],g=c;for(;g&&g!==o;){let y=d.get(g);if(!y||!y.prev)break;let _=g.indexOf("::"),v=_>=0?g.slice(0,_):g,S=_>=0?g.slice(_+2):g;m.push({from:y.prev,to:g,toFile:v,toFunction:S,confidence:y.edgeConfidence,kind:y.edgeKind}),g=y.prev}return{fromKey:o,toKey:c,path:m.reverse(),visited:d.size,truncated:f}}var qu=Fe(require("fs")),bb=Fe(require("path"));_c();var Uu=Fe(require("fs")),Uc=Fe(require("path"));function R3(e){let t=[Uc.join(e,"coverage","lcov.info"),Uc.join(e,".nyc_output","lcov.info"),Uc.join(e,"lcov.info"),Uc.join(e,"htmlcov","lcov.info")];for(let n of t)try{if(Uu.statSync(n).isFile()){let a=Uu.readFileSync(n,"utf-8");return DMe(a,e)}}catch{continue}let r=[Uc.join(e,"coverage","coverage-summary.json"),Uc.join(e,".nyc_output","coverage-summary.json")];for(let n of r)try{if(Uu.statSync(n).isFile()){let a=Uu.readFileSync(n,"utf-8");return MMe(a,e)}}catch{continue}return null}function DMe(e,t){let r={},n="",s=0,a=0,o=0,c=0,l={};for(let u of e.split(`
|
|
@@ -474,7 +474,7 @@ globstar while`,t,f,r,h,m),this.matchOne(t.slice(f),r.slice(h),n))return this.de
|
|
|
474
474
|
${z.bodyText}
|
|
475
475
|
}`;return`${he} ${xe}`})():ee&&z.span.start<z.span.end?ee.slice(z.span.start,z.span.end):void 0:void 0,Se=Yc(M,u,A.name,le,void 0,A.node.start);this.store.updateWorkingGraph(Se.graphId,Se),n.push(Se.graphId);let we=z&&ee&&z.span.start<z.span.end?ee.slice(z.span.start,z.span.end):z?.bodyText;z?M!==we&&v.add(A.name):(S.add(A.name),v.add(A.name))}catch{}let E=new Set([...w].map(A=>`flow:${u}:${A}`)),k=new Set;m?.symbols?.functions?.forEach(A=>k.add(`flow:${u}:${A.name}`)),p?.symbols?.functions?.forEach(A=>k.add(`flow:${u}:${A.name}`));for(let A of k)if(!E.has(A)&&this.store.getWorking().graphs[A]){let M=this.store.getBaseline().graphs[A];M?this.store.updateWorkingGraph(A,Hh(M)):this.store.removeWorkingGraph(A),n.push(A)}let N=new Set;for(let A of m?.symbols?.functions??[])w.has(A.name)||N.add(A.name);if(this._lastChangedFnNames=v,this._lastNewFnNames=S,this._lastDeletedFnNames=N,v.size>0){let A=gn.basename(u).replace(/\.[^.]+$/,""),M=this.store.getWorking().files;for(let[z,ee]of Object.entries(M))if(!(z===u||!Zh(z)||!ee.symbols.imports.some(Se=>{let we=Se.source.replace(/\.[^.]+$/,"");return we.endsWith("/"+A)||we===A})))try{let Se=ee.content??is.readFileSync(gn.join(this.workspaceRoot,z),"utf-8"),we=Ai(Se,z),he=this.store.getBaseline().files[z];for(let xe of we.funcs.values())if(xe.node)try{let Ae=Se.slice(xe.node.start,xe.node.end);if(xe.node.type==="ClassMethod"||xe.node.type==="ClassPrivateMethod"){let et=xe.node.key?.start,tt=typeof et=="number"?et:xe.node.start,jt=Se.slice(tt,xe.node.end);Ae=(xe.node.async?"async ":"")+"function "+(xe.node.generator?"*":"")+jt}let ke=he?.symbols?.functions?.find(et=>et.stableKey===xe.key),Xe=ke?ke.bodyText&&ke.signature?(()=>{let et=ke.signature;if(!/\bfunction\b/.test(et)){let jt=et.match(/^(\s*async\s+)/),wt=jt?et.slice(jt[0].length):et;et=(jt?"async ":"")+"function "+wt}let tt=ke.bodyText.trim().startsWith("{")?ke.bodyText:`{
|
|
476
476
|
${ke.bodyText}
|
|
477
|
-
}`;return`${et} ${tt}`})():he?.content&&ke.span.start<ke.span.end?he.content.slice(ke.span.start,ke.span.end):void 0:void 0,De=Yc(Ae,z,xe.name,Xe,v,xe.node.start);this.store.updateWorkingGraph(De.graphId,De),n.push(De.graphId)}catch{}}catch{}}let O=_h(l,u),V=/\.tsx?$/.test(t)?"typescript":"javascript",te=Zc(l,u,V),W=Ph(l,u,V),$=[...O,...te,...W];for(let A of W)this.store.updateWorkingApi(A.apiId,A);for(let A of te)this.store.updateWorkingApi(A.apiId,A);let H=this.store.getWorking(),Y=new Map,ae=new Set;for(let A of Object.values(this.store.getBaseline().apiIndex))A.filePath===u&&ae.add(`sequence:${u}:${A.handlerName}`);for(let[A,M]of Object.entries(H.apiIndex))M.filePath===u&&(ae.add(`sequence:${u}:${M.handlerName}`),(typeof M.handlerName=="string"&&M.handlerName.startsWith("anonymous@")?$.some(le=>le.apiId===A):$.some(le=>le.handlerName===M.handlerName))||this.store.removeWorkingApi(A));if(O.length>0)for(let A of O)this.store.updateWorkingApi(A.apiId,A);try{let A=this.store.getWorking(),M=new Map;for(let[ee,le]of Object.entries(A.files))Zh(ee)&&le.content&&M.set(ee,le.content);let z=Q1(A.apiIndex,M,this.workspaceRoot);this.store.replaceWorkingApiIndex(z)}catch{}let K=O.length>0?O.map(A=>this.store.getWorking().apiIndex[A.apiId]??Object.values(this.store.getWorking().apiIndex).find(M=>M.filePath===A.filePath&&M.handlerName===A.handlerName)??A):[];if(K.length>0){let A=new Set;for(let M of K){if(A.has(M.handlerName))continue;A.add(M.handlerName);let z=`sequence:${u}:${M.handlerName}`;Y.set(z,{seqFilePath:u,handlerName:M.handlerName})}}let D=new Set(O.map(A=>`sequence:${u}:${A.handlerName}`));for(let A of ae)if(!D.has(A)&&H.graphs[A]){let M=this.store.getBaseline().graphs[A];M?this.store.updateWorkingGraph(A,Hh(M)):this.store.removeWorkingGraph(A),n.push(A)}V1(H.graphs,(A,M)=>{if(M.type==="sequence"&&!Y.has(A)&&!A.startsWith(`sequence:${u}:`)&&M.nodes.some(ee=>ee.anchor?.filePath===u)){let ee=M.meta,le=ee?.filePath||"";if(!le){let Se=A.replace(/^sequence:/,""),we=Se.match(/^(.+\.(?:js|mjs|cjs|jsx|ts|tsx|mts|cts|py|pyw|java|kt|kts|go|rs|cs|php|rb|swift|dart)):/);le=we?we[1]:Se.split(":")[0]}Y.set(A,{seqFilePath:le,handlerName:ee?.handlerName})}});for(let[,{seqFilePath:A,handlerName:M}]of Y){let z=A===u?l:this.store.getFileContent("working",A);if(!z)try{let ee=gn.join(this.workspaceRoot,A);is.existsSync(ee)&&(z=is.readFileSync(ee,"utf-8"))}catch{}if(z){let ee=this.store.getFileContent("baseline",A),le=Mh(z,A,ee,this.sequenceResolver,this.oldSequenceResolver,M,this.store.getWorking().files,this.lspFallbackResolver??void 0);if(le.nodes.length===0)continue;this.store.updateWorkingGraph(le.graphId,le),n.push(le.graphId)}}}else{let g=vh(t);if(g){let y=await wh(l,u,g),_=Zc(l,u,g),v=Ph(l,u,g);for(let D of[..._,...v])this.store.updateWorkingApi(D.apiId,D);let S=[..._,...v];for(let[D,A]of Object.entries(this.store.getWorking().apiIndex)){if(A.filePath!==u)continue;(typeof A.handlerName=="string"&&A.handlerName.startsWith("anonymous@")?S.some(ee=>ee.apiId===D):S.some(ee=>ee.handlerName===A.handlerName))||this.store.removeWorkingApi(D)}if(t.endsWith(".go")?"go":t.endsWith(".kt")||t.endsWith(".kts")?"kotlin":null){let D=new Map;for(let A of Object.values(this.store.getWorking().apiIndex))A.filePath===u&&D.set(`${A.method}::${A.handlerName}::${A.filePath}`,A.apiId);for(let A of this.routerTracker.resolvedRoutes()){if(A.filePath!==u)continue;let M=`${A.method}:${A.path}@${A.filePath}`,z=`${A.method}::${A.handlerName}::${A.filePath}`,ee=D.get(z);if(ee&&ee!==M){let le=this.store.getWorking().apiIndex[ee];le&&(A.path.endsWith(le.route)||A.path===le.route)&&this.store.removeWorkingApi(ee)}this.store.getWorking().apiIndex[M]||this.store.updateWorkingApi(M,{apiId:M,method:A.method,route:A.path,rawRoute:A.path,handlerName:A.handlerName,filePath:A.filePath,anchor:{filePath:A.filePath}})}}let E=this.store.getBaseline().files[u],k=E?{functions:(E.symbols.functions??[]).map(D=>({name:D.name,signature:D.signature,bodyText:D.bodyText,stableKey:D.stableKey||`function:${D.name}`})),variables:(E.symbols.variables??[]).map(D=>({name:D.name,bodyText:D.bodyText,stableKey:D.stableKey||`variable:${D.name}`})),imports:(E.symbols.imports??[]).map(D=>({source:D.source,stableKey:D.stableKey||`import:${D.source}`}))}:void 0,N=Ah(y,u,k);cC(N,E,y),this.store.updateWorkingGraph(N.graphId,N),n.push(N.graphId);for(let D of y.entities)D.kind==="function"||D.kind==="class"?h.symbols.functions.push({name:D.name,kind:D.kind==="class"?"class":"function",span:{start:0,end:0},signature:D.signature,bodyText:D.bodyText,stableKey:D.key,calls:Array.from(D.calls||[]),memberCalls:D.memberCalls?Object.fromEntries([...D.memberCalls.entries()].map(([A,M])=>[A,Array.from(M)])):void 0,localVarTypes:D.localVarTypes?Object.fromEntries(D.localVarTypes.entries()):void 0,extendsClass:D.extendsClass,implementsInterfaces:D.implementsInterfaces}):D.kind==="variable"&&h.symbols.variables.push({name:D.name,kind:D.kind,span:{start:0,end:0},signature:D.signature,bodyText:D.bodyText,stableKey:D.key});for(let[D,A]of y.importsByLocal.entries())h.symbols.imports.push({source:A,specifiers:[{local:D,imported:D}],span:{start:0,end:0},stableKey:`import::${A}::${D}`});h.symbols.injectedDeps=y.injectedDeps?Object.fromEntries(y.injectedDeps.entries()):void 0,this.store.updateWorkingFile(u,h);let O=E?new Map([...(E.symbols.imports??[]).map(D=>[D.specifiers?.[0]?.local??D.source,D.source]),...Object.entries(E.symbols.injectedDeps??{})]):void 0,V=D=>{let A=`sequence:${u}:${D}`,M=this.store.getBaseline().graphs[A];if(M)return new Set(M.nodes.filter(z=>z.type==="participant"&&z.body).map(z=>z.body))},te=new Set;if(E)for(let D of y.entities){if(D.kind!=="function"&&D.kind!=="class")continue;let A=k?.functions.find(M=>M.stableKey===D.key);A&&A.bodyText!==D.bodyText&&te.add(D.name)}let W=new Set;if(_.length>0)for(let D of _){if(W.has(D.handlerName))continue;W.add(D.handlerName);let A=(z,ee)=>{let le=z.includes("/")?z.split("/").pop():z.split(".").pop();if(!le)return;let Se=Object.keys(this.store.getWorking().files);if(z.startsWith(".")&&ee){let we=ee.includes("/")?ee.substring(0,ee.lastIndexOf("/")):"";for(let he of Se){if((he.includes("/")?he.substring(0,he.lastIndexOf("/")):"")!==we)continue;if((he.split("/").pop()||he).replace(/\.[^/.]+$/,"")===le)return{code:"",filePath:he}}}for(let we of Se)if((we.split("/").pop()||we).replace(/\.[^/.]+$/,"")===le)return{code:"",filePath:we}},M=Lh({...y,funcs:y.funcs},u,_,D.handlerName,O,te.size>0?te:void 0,A,this.store.getWorking().files,V(D.handlerName),this.lspFallbackResolver??void 0);M.nodes.length!==0&&(this.store.updateWorkingGraph(M.graphId,M),n.push(M.graphId))}let $=new Set([...W].map(D=>`sequence:${u}:${D}`)),H=new Set;for(let D of Object.values(this.store.getBaseline().apiIndex))D.filePath===u&&H.add(`sequence:${u}:${D.handlerName}`);for(let D of Object.values(this.store.getWorking().apiIndex))D.filePath===u&&H.add(`sequence:${u}:${D.handlerName}`);for(let D of H)if(!$.has(D)&&this.store.getWorking().graphs[D]){let A=this.store.getBaseline().graphs[D];A?this.store.updateWorkingGraph(D,Hh(A)):this.store.removeWorkingGraph(D),n.push(D)}let Y=new Set;for(let D of y.entities)if((D.kind==="function"||D.kind==="class")&&Y.add(D.name),D.kind==="function")try{let M=k?.functions.find(le=>le.stableKey===D.key)?.bodyText,z;if(D.node)z=Rh(D.node,l,u,D.name,M);else if(D.bodyText)z=pC(D.bodyText,u,D.name,M);else continue;let ee=this.store.getBaseline().graphs[z.graphId];ee&&r6(z,ee),this.store.updateWorkingGraph(z.graphId,z),n.push(z.graphId)}catch{}let ae=new Set([...Y].map(D=>`flow:${u}:${D}`)),K=new Set;k?.functions?.forEach(D=>K.add(`flow:${u}:${D.name}`)),p?.symbols?.functions?.forEach(D=>K.add(`flow:${u}:${D.name}`));for(let D of K)if(!ae.has(D)&&this.store.getWorking().graphs[D]){let A=this.store.getBaseline().graphs[D];A?this.store.updateWorkingGraph(D,Hh(A)):this.store.removeWorkingGraph(D),n.push(D)}}}if(!r)try{let g=this.store.getWorking(),y=this.store.getBaseline(),_=ws(g,this.lspFallbackResolver??void 0);this.store.updateWorkingCallGraph(_.serialize());let v=Y=>this.store.getFileContent("working",Y),S=Y=>this.store.getFileContent("baseline",Y),w=Es(this.workspaceRoot,g,v);this.store.updateWorkingServices(w);let E=this.store.getBaseline().clusters,k=$o(g,_,w,E);if(this.store.updateWorkingClusters(k),this.llmNamingService?.isConfigured){let Y={};for(let[ae,K]of Object.entries(g.files))K.content&&(Y[ae]=K.content);this.llmNamingService.nameClusters(k,Y).then(ae=>{this.store.updateWorkingClusters(ae),this.store.updateBaselineClusters(ae);let K=[],D=this.store.getWorking(),A=Object.keys(D.services??{});if(A.length>1)for(let z of A){let ee=ns(D,this.store.getBaseline(),z);this.store.updateWorkingGraph(ee.graphId,ee),this.store.updateBaselineGraph(ee.graphId,ee),K.push(ee.graphId)}else{let z=ns(D,this.store.getBaseline());this.store.updateWorkingGraph(z.graphId,z),this.store.updateBaselineGraph(z.graphId,z),K.push(z.graphId)}let M=this.store.getWorking();for(let z of Object.values(ae)){let ee=zo(z,M,M);this.store.updateWorkingGraph(ee.graphId,ee),this.store.updateBaselineGraph(ee.graphId,ee),K.push(ee.graphId)}nl(this.store.getWorking().graphs),this.store.save(),this.notifyRefresh(K)}).catch(ae=>{this.log(`[Rebuild] LLM naming failed: ${ae?.message??ae}`)})}let N=Object.keys(this.store.getWorking().clusters||{}),O=Object.keys(k||{}),V=new Set([...N,...O]);for(let Y of V){let ae=k?.[Y];if(!ae){this.store.getWorking().graphs[`api-list:${Y}`]&&(this.store.removeWorkingGraph(`api-list:${Y}`),n.push(`api-list:${Y}`));continue}let K=zo(ae,g,y);this.store.updateWorkingGraph(K.graphId,K),n.push(K.graphId)}let te=Object.keys(w);if(te.length>1)for(let Y of te){let ae=ns(g,y,Y);this.store.updateWorkingGraph(ae.graphId,ae),n.push(ae.graphId)}else{let Y=ns(g,y);this.store.updateWorkingGraph(Y.graphId,Y),n.push(Y.graphId)}let W=qh(this.workspaceRoot,g,y,v,S);this.store.updateWorkingGraph(W.graphId,W),n.push(W.graphId);let $=this.store.getWorking().graphs;id($);for(let Y of Object.values(k||{})){let ae=zo(Y,g,y);this.store.updateWorkingGraph(ae.graphId,ae),n.includes(ae.graphId)||n.push(ae.graphId)}nl(this.store.getWorking().graphs);let H=GC(this.store.getWorking());this.store.updateWorkingHealth(H)}catch(g){this.log(`[Rebuild] Feature/microservice graph rebuild failed: ${g?.message??g}`)}}catch(l){this.log(`[Rebuild] Failed for ${t}: ${l?.message??l}`)}let o={filePath:gn.relative(this.workspaceRoot,t),changedFunctions:[...this._lastChangedFnNames],newFunctions:[...this._lastNewFnNames],deletedFunctions:[...this._lastDeletedFnNames],updatedGraphIds:n};this._lastChangedFnNames.clear(),this._lastNewFnNames.clear(),this._lastDeletedFnNames.clear();let c=Date.now()-s;return n.length>0&&Gh.track("file_rebuilt_perf",{duration_ms:c,updated_graph_count:n.length,changed_fns:o.changedFunctions.length,new_fns:o.newFunctions.length,deleted_fns:o.deletedFunctions.length}),{graphIds:n,changeDetail:o,durationMs:c}}async syncDriftedFilesFromDisk(){let t=[];try{let r=this.store.getWorking(),n=this.store.getBaseline(),{getFileContentAtCommit:s,resolveRef:a}=await Promise.resolve().then(()=>(uv(),P9)),o=null;try{o=a(this.workspaceRoot,"HEAD")}catch{}for(let[c,l]of Object.entries(r.files??{})){let u=typeof l.content=="string"?l.content:this.store.getFileContent("working",c);if(typeof u!="string")continue;let d=gn.join(this.workspaceRoot,c),p;try{p=await Jh.readFile(d,"utf-8")}catch{continue}if(p!==u){if(t.push(c),this.store.updateWorkingFile(c,{...l,hash:"__drift__"+Date.now()}),o)try{let f=s(this.workspaceRoot,o,c);if(typeof f=="string"&&f.length>0){let h=n.files[c];h&&(h.content=f)}}catch{}try{await this.rebuildFile(d,p)}catch(f){this.log(`[syncDrift] rebuild failed for ${c}: ${f?.message??f}`)}}}}catch(r){this.log(`[syncDrift] failed: ${r?.message??r}`)}return t}enqueueCascade(t){return this.mutationQueue.enqueue({key:"cascade",run:()=>this.applyDiffCascadeToLiveGraphs(t)})}waitForMutationQueueIdle(){return this.mutationQueue.waitForIdle()}async scanAndroidManifests(){let t=await import("fs"),r=await import("path"),n=[],s=this.workspaceRoot,a=/(?:^|\/)(?:node_modules|\.git|build|dist|coverage|out|bin|obj)(?:\/|$)/,o=8,c=5e3,l=0,u=(d,p)=>{if(p>o||l>c)return;let f;try{f=t.readdirSync(d,{withFileTypes:!0})}catch{return}for(let h of f){if(l++,l>c)return;let m=r.join(d,h.name),g=r.relative(s,m);if(!a.test(g)){if(h.isDirectory())u(m,p+1);else if(h.isFile()&&h.name==="AndroidManifest.xml")try{let y=t.readFileSync(m,"utf-8");n.push(...Kq(y,g))}catch{}}}};return u(s,0),n}applyDiffCascadeToLiveGraphs(t){let r=[];try{let n=this.store.getWorking(),s=this.store.getBaseline(),a=n.graphs;id(a);for(let c of Object.keys(a))c.startsWith("sequence:")&&r.push(c);let o=t?Object.values(n.clusters??{}).filter(c=>(c.files??[]).some(l=>t.has(l))):Object.values(n.clusters??{});for(let c of o){let l=zo(c,n,s);this.store.updateWorkingGraph(l.graphId,l),r.push(l.graphId)}nl(this.store.getWorking().graphs);for(let c of Object.keys(this.store.getWorking().graphs))(c.startsWith("feature:")||c.startsWith("microservice:"))&&r.push(c);this.store.save()}catch(n){this.log(`[applyDiffCascade] failed: ${n?.message??n}`)}return Array.from(new Set(r))}async resync(){this.store.clearAllFiles(),this.log("[Resync] Cleared SQLite store + legacy files before reinit"),await this.initialize();let t=new Map,r=this.store.getWorking();V1(r.graphs,(n,s)=>{for(let[a,o]of Object.entries(s.anchors))t.set(`${n}::${a}`,o)}),this.commentStore.reanchor(t),this.store.setComments(this.commentStore.toJSON()),this.store.save()}notifyChangeDetail(t){for(let r of this.changeDetailCallbacks)r(t)}notifyRefresh(t){for(let r of this.refreshCallbacks)r(t)}};var dze=0;function pze(){return`c_${++dze}_${Date.now()}_${Math.random().toString(36).slice(2,7)}`}var sd=class{constructor(t=[]){this.comments=[];this.comments=[...t]}getAll(){return[...this.comments]}getByLayer(t){return this.comments.filter(r=>r.layer===t)}getForTarget(t){return this.comments.filter(r=>r.targetId===t)}getOpen(){return this.comments.filter(t=>t.status==="open")}getResolved(){return this.comments.filter(t=>t.status==="resolved")}add(t){let r={id:pze(),status:"open",layer:t.layer,targetType:t.targetType,targetId:t.targetId,anchor:t.anchor,body:t.body,author:t.author||"local",createdAt:new Date().toISOString()};return this.comments.push(r),r}resolve(t){let r=this.comments.find(n=>n.id===t);return r?(r.status="resolved",!0):!1}reopen(t){let r=this.comments.find(n=>n.id===t);return r?(r.status="open",!0):!1}delete(t){let r=this.comments.findIndex(n=>n.id===t);return r===-1?!1:(this.comments.splice(r,1),!0)}reanchor(t){let r=[],n=(a,o)=>{let c=Array.isArray(a.anchor_history)?a.anchor_history:[];c.push({anchor:a.anchor,capturedAt:Date.now(),reason:o}),a.anchor_history=c.slice(-10)},s=a=>{let o=a.lastIndexOf("::");return o>=0?a.slice(o+2):a};for(let a of this.comments){if(!a.anchor){r.push(a.id);continue}let o=!1;for(let[c,l]of t.entries())if(l.filePath===a.anchor.filePath&&l.span&&a.anchor.span&&l.span.start===a.anchor.span.start&&l.span.end===a.anchor.span.end){if(a.anchor.stableKey&&l.stableKey&&a.anchor.stableKey!==l.stableKey)continue;let u=s(c);a.targetId!==u&&n(a,"span-match"),a.targetId=u,a.anchor={...l},o=!0;break}if(!o){if(a.anchor.stableKey){for(let[c,l]of t.entries())if(l.stableKey===a.anchor.stableKey){a.targetId=s(c),a.anchor={...l},o=!0;break}}if(!o){if(a.anchor.filePath&&a.anchor.symbol){let c=`${a.anchor.filePath}:${a.anchor.symbol}`;for(let[l,u]of t.entries())if(u.filePath&&u.symbol&&`${u.filePath}:${u.symbol}`===c){a.targetId=s(l),a.anchor={...u},o=!0;break}}if(!o){if(a.anchor.symbol){for(let[c,l]of t.entries())if(l.filePath===a.anchor.filePath&&l.symbol===a.anchor.symbol){a.targetId=s(c),a.anchor={...l},o=!0;break}}o||r.push(a.id)}}}}return r}clear(){this.comments=[]}toJSON(){return this.comments}};var xr=Fe(require("fs")),Uo=Fe(require("path")),HC=".mcp-owner",D9=".mcp-preempt";function hv(e,t){let r=Uo.join(e,".codeatlas"),n=Uo.join(r,HC),s=()=>{try{xr.existsSync(r)||xr.mkdirSync(r,{recursive:!0});let o=xr.openSync(n,"wx"),c={pid:process.pid,startedAt:Date.now(),label:t};return xr.writeSync(o,JSON.stringify(c)),xr.closeSync(o),{path:n,pid:process.pid,release:()=>fze(n)}}catch(o){return o?.code!=="EEXIST",null}},a=s();if(a)return R9(a.release),a;try{let o=JSON.parse(xr.readFileSync(n,"utf-8"));if(typeof o.pid=="number"&&!ZC(o.pid)){try{xr.unlinkSync(n)}catch{}let c=s();if(c)return R9(c.release),c}}catch{}return null}function N9(e){let t=Uo.join(e,".codeatlas",HC);if(!xr.existsSync(t))return null;try{let r=JSON.parse(xr.readFileSync(t,"utf-8"));return typeof r.pid!="number"?null:r}catch{return null}}function fze(e){try{JSON.parse(xr.readFileSync(e,"utf-8")).pid===process.pid&&xr.unlinkSync(e)}catch{}}function ZC(e){if(!Number.isFinite(e)||e<=0)return!1;try{return process.kill(e,0),!0}catch(t){return t?.code==="EPERM"}}var O9=!1,$9=new Set;function R9(e){if($9.add(e),O9)return;O9=!0;let t=()=>{for(let r of $9)try{r()}catch{}};process.on("exit",t),process.on("SIGINT",()=>{t(),process.exit(130)}),process.on("SIGTERM",()=>{t(),process.exit(143)})}function hze(e,t="mcp-server"){try{let r=Uo.join(e,".codeatlas");xr.existsSync(r)||xr.mkdirSync(r,{recursive:!0});let n=Uo.join(r,D9),s={pid:process.pid,requestedAt:Date.now(),label:t};return xr.writeFileSync(n,JSON.stringify(s)),n}catch{return null}}function mv(e){let t=Uo.join(e,".codeatlas",D9);try{xr.unlinkSync(t)}catch{}}async function M9(e,t,r=5e3,n=100){let s=Uo.join(e,".codeatlas",HC),a=hv(e,t);if(a)return mv(e),a;let o=N9(e);if(!o||!ZC(o.pid)){let l=hv(e,t);return l?(mv(e),l):null}if(o.label!=="vscode-extension")return null;hze(e,t);let c=Date.now()+r;for(;Date.now()<c;){if(!xr.existsSync(s)){let u=hv(e,t);if(u)return mv(e),u}let l=N9(e);if(l&&!ZC(l.pid)){try{xr.unlinkSync(s)}catch{}let u=hv(e,t);if(u)return mv(e),u}await new Promise(u=>setTimeout(u,n))}return null}var L9=new Set([".ts",".tsx",".js",".jsx",".mts",".cts",".mjs",".cjs",".py",".pyw",".java",".kt",".kts",".go",".rs",".cs",".php",".rb",".swift",".dart"]),mze=new Set(["node_modules",".git","dist","build",".next",".nuxt","out","target","coverage","__pycache__",".venv","venv",".codeatlas",".codeatlas-sa",".vscode",".gradle",".idea","bin","obj","Pods","DerivedData"]),gv=class{constructor(t,r={}){this.workspaceRoot=t;this.opts=r;this.orchestrator=null;this.watcher=null;this.rebuildTimer=null;this.pendingChanges=new Set;this.lock=null;this.readOnly=r.readOnly===!0,this.status={status:"initializing",startedAt:Date.now()},this.store=new Vu(t,{storageDirName:r.storageDirName})}getStatus(){return this.status}getStore(){return this.store}async handleFileChange(t){if(!this.orchestrator)return;let r=ea.isAbsolute(t)?t:ea.join(this.workspaceRoot,t);try{await this.orchestrator.rebuildFile(r),this.store.save()}catch(n){(this.opts.log??(a=>process.stderr.write(`[mcp-bootstrap] ${a}
|
|
477
|
+
}`;return`${et} ${tt}`})():he?.content&&ke.span.start<ke.span.end?he.content.slice(ke.span.start,ke.span.end):void 0:void 0,De=Yc(Ae,z,xe.name,Xe,v,xe.node.start);this.store.updateWorkingGraph(De.graphId,De),n.push(De.graphId)}catch{}}catch{}}let O=_h(l,u),V=/\.tsx?$/.test(t)?"typescript":"javascript",te=Zc(l,u,V),W=Ph(l,u,V),$=[...O,...te,...W];for(let A of W)this.store.updateWorkingApi(A.apiId,A);for(let A of te)this.store.updateWorkingApi(A.apiId,A);let H=this.store.getWorking(),Y=new Map,ae=new Set;for(let A of Object.values(this.store.getBaseline().apiIndex))A.filePath===u&&ae.add(`sequence:${u}:${A.handlerName}`);for(let[A,M]of Object.entries(H.apiIndex))M.filePath===u&&(ae.add(`sequence:${u}:${M.handlerName}`),(typeof M.handlerName=="string"&&M.handlerName.startsWith("anonymous@")?$.some(le=>le.apiId===A):$.some(le=>le.handlerName===M.handlerName))||this.store.removeWorkingApi(A));if(O.length>0)for(let A of O)this.store.updateWorkingApi(A.apiId,A);try{let A=this.store.getWorking(),M=new Map;for(let[ee,le]of Object.entries(A.files))Zh(ee)&&le.content&&M.set(ee,le.content);let z=Q1(A.apiIndex,M,this.workspaceRoot);this.store.replaceWorkingApiIndex(z)}catch{}let K=O.length>0?O.map(A=>this.store.getWorking().apiIndex[A.apiId]??Object.values(this.store.getWorking().apiIndex).find(M=>M.filePath===A.filePath&&M.handlerName===A.handlerName)??A):[];if(K.length>0){let A=new Set;for(let M of K){if(A.has(M.handlerName))continue;A.add(M.handlerName);let z=`sequence:${u}:${M.handlerName}`;Y.set(z,{seqFilePath:u,handlerName:M.handlerName})}}let D=new Set(O.map(A=>`sequence:${u}:${A.handlerName}`));for(let A of ae)if(!D.has(A)&&H.graphs[A]){let M=this.store.getBaseline().graphs[A];M?this.store.updateWorkingGraph(A,Hh(M)):this.store.removeWorkingGraph(A),n.push(A)}V1(H.graphs,(A,M)=>{if(M.type==="sequence"&&!Y.has(A)&&!A.startsWith(`sequence:${u}:`)&&M.nodes.some(ee=>ee.anchor?.filePath===u)){let ee=M.meta,le=ee?.filePath||"";if(!le){let Se=A.replace(/^sequence:/,""),we=Se.match(/^(.+\.(?:js|mjs|cjs|jsx|ts|tsx|mts|cts|py|pyw|java|kt|kts|go|rs|cs|php|rb|swift|dart)):/);le=we?we[1]:Se.split(":")[0]}Y.set(A,{seqFilePath:le,handlerName:ee?.handlerName})}});for(let[,{seqFilePath:A,handlerName:M}]of Y){let z=A===u?l:this.store.getFileContent("working",A);if(!z)try{let ee=gn.join(this.workspaceRoot,A);is.existsSync(ee)&&(z=is.readFileSync(ee,"utf-8"))}catch{}if(z){let ee=this.store.getFileContent("baseline",A),le=Mh(z,A,ee,this.sequenceResolver,this.oldSequenceResolver,M,this.store.getWorking().files,this.lspFallbackResolver??void 0);if(le.nodes.length===0)continue;this.store.updateWorkingGraph(le.graphId,le),n.push(le.graphId)}}}else{let g=vh(t);if(g){let y=await wh(l,u,g),_=Zc(l,u,g),v=Ph(l,u,g);for(let D of[..._,...v])this.store.updateWorkingApi(D.apiId,D);let S=[..._,...v];for(let[D,A]of Object.entries(this.store.getWorking().apiIndex)){if(A.filePath!==u)continue;(typeof A.handlerName=="string"&&A.handlerName.startsWith("anonymous@")?S.some(ee=>ee.apiId===D):S.some(ee=>ee.handlerName===A.handlerName))||this.store.removeWorkingApi(D)}if(t.endsWith(".go")?"go":t.endsWith(".kt")||t.endsWith(".kts")?"kotlin":null){let D=new Map;for(let A of Object.values(this.store.getWorking().apiIndex))A.filePath===u&&D.set(`${A.method}::${A.handlerName}::${A.filePath}`,A.apiId);for(let A of this.routerTracker.resolvedRoutes()){if(A.filePath!==u)continue;let M=`${A.method}:${A.path}@${A.filePath}`,z=`${A.method}::${A.handlerName}::${A.filePath}`,ee=D.get(z);if(ee&&ee!==M){let le=this.store.getWorking().apiIndex[ee];le&&(A.path.endsWith(le.route)||A.path===le.route)&&this.store.removeWorkingApi(ee)}this.store.getWorking().apiIndex[M]||this.store.updateWorkingApi(M,{apiId:M,method:A.method,route:A.path,rawRoute:A.path,handlerName:A.handlerName,filePath:A.filePath,anchor:{filePath:A.filePath}})}}let E=this.store.getBaseline().files[u],k=E?{functions:(E.symbols.functions??[]).map(D=>({name:D.name,signature:D.signature,bodyText:D.bodyText,stableKey:D.stableKey||`function:${D.name}`})),variables:(E.symbols.variables??[]).map(D=>({name:D.name,bodyText:D.bodyText,stableKey:D.stableKey||`variable:${D.name}`})),imports:(E.symbols.imports??[]).map(D=>({source:D.source,stableKey:D.stableKey||`import:${D.source}`}))}:void 0,N=Ah(y,u,k);cC(N,E,y),this.store.updateWorkingGraph(N.graphId,N),n.push(N.graphId);for(let D of y.entities)D.kind==="function"||D.kind==="class"?h.symbols.functions.push({name:D.name,kind:D.kind==="class"?"class":"function",span:{start:0,end:0},signature:D.signature,bodyText:D.bodyText,stableKey:D.key,calls:Array.from(D.calls||[]),memberCalls:D.memberCalls?Object.fromEntries([...D.memberCalls.entries()].map(([A,M])=>[A,Array.from(M)])):void 0,localVarTypes:D.localVarTypes?Object.fromEntries(D.localVarTypes.entries()):void 0,extendsClass:D.extendsClass,implementsInterfaces:D.implementsInterfaces}):D.kind==="variable"&&h.symbols.variables.push({name:D.name,kind:D.kind,span:{start:0,end:0},signature:D.signature,bodyText:D.bodyText,stableKey:D.key});for(let[D,A]of y.importsByLocal.entries())h.symbols.imports.push({source:A,specifiers:[{local:D,imported:D}],span:{start:0,end:0},stableKey:`import::${A}::${D}`});h.symbols.injectedDeps=y.injectedDeps?Object.fromEntries(y.injectedDeps.entries()):void 0,this.store.updateWorkingFile(u,h);let O=E?new Map([...(E.symbols.imports??[]).map(D=>[D.specifiers?.[0]?.local??D.source,D.source]),...Object.entries(E.symbols.injectedDeps??{})]):void 0,V=D=>{let A=`sequence:${u}:${D}`,M=this.store.getBaseline().graphs[A];if(M)return new Set(M.nodes.filter(z=>z.type==="participant"&&z.body).map(z=>z.body))},te=new Set;if(E)for(let D of y.entities){if(D.kind!=="function"&&D.kind!=="class")continue;let A=k?.functions.find(M=>M.stableKey===D.key);A&&A.bodyText!==D.bodyText&&te.add(D.name)}let W=new Set;if(_.length>0)for(let D of _){if(W.has(D.handlerName))continue;W.add(D.handlerName);let A=(z,ee)=>{let le=z.includes("/")?z.split("/").pop():z.split(".").pop();if(!le)return;let Se=Object.keys(this.store.getWorking().files);if(z.startsWith(".")&&ee){let we=ee.includes("/")?ee.substring(0,ee.lastIndexOf("/")):"";for(let he of Se){if((he.includes("/")?he.substring(0,he.lastIndexOf("/")):"")!==we)continue;if((he.split("/").pop()||he).replace(/\.[^/.]+$/,"")===le)return{code:"",filePath:he}}}for(let we of Se)if((we.split("/").pop()||we).replace(/\.[^/.]+$/,"")===le)return{code:"",filePath:we}},M=Lh({...y,funcs:y.funcs},u,_,D.handlerName,O,te.size>0?te:void 0,A,this.store.getWorking().files,V(D.handlerName),this.lspFallbackResolver??void 0);M.nodes.length!==0&&(this.store.updateWorkingGraph(M.graphId,M),n.push(M.graphId))}let $=new Set([...W].map(D=>`sequence:${u}:${D}`)),H=new Set;for(let D of Object.values(this.store.getBaseline().apiIndex))D.filePath===u&&H.add(`sequence:${u}:${D.handlerName}`);for(let D of Object.values(this.store.getWorking().apiIndex))D.filePath===u&&H.add(`sequence:${u}:${D.handlerName}`);for(let D of H)if(!$.has(D)&&this.store.getWorking().graphs[D]){let A=this.store.getBaseline().graphs[D];A?this.store.updateWorkingGraph(D,Hh(A)):this.store.removeWorkingGraph(D),n.push(D)}let Y=new Set;for(let D of y.entities)if((D.kind==="function"||D.kind==="class")&&Y.add(D.name),D.kind==="function")try{let M=k?.functions.find(le=>le.stableKey===D.key)?.bodyText,z;if(D.node)z=Rh(D.node,l,u,D.name,M);else if(D.bodyText)z=pC(D.bodyText,u,D.name,M);else continue;let ee=this.store.getBaseline().graphs[z.graphId];ee&&r6(z,ee),this.store.updateWorkingGraph(z.graphId,z),n.push(z.graphId)}catch{}let ae=new Set([...Y].map(D=>`flow:${u}:${D}`)),K=new Set;k?.functions?.forEach(D=>K.add(`flow:${u}:${D.name}`)),p?.symbols?.functions?.forEach(D=>K.add(`flow:${u}:${D.name}`));for(let D of K)if(!ae.has(D)&&this.store.getWorking().graphs[D]){let A=this.store.getBaseline().graphs[D];A?this.store.updateWorkingGraph(D,Hh(A)):this.store.removeWorkingGraph(D),n.push(D)}}}if(!r)try{let g=this.store.getWorking(),y=this.store.getBaseline(),_=ws(g,this.lspFallbackResolver??void 0);this.store.updateWorkingCallGraph(_.serialize());let v=Y=>this.store.getFileContent("working",Y),S=Y=>this.store.getFileContent("baseline",Y),w=Es(this.workspaceRoot,g,v);this.store.updateWorkingServices(w);let E=this.store.getBaseline().clusters,k=$o(g,_,w,E);if(this.store.updateWorkingClusters(k),this.llmNamingService?.isConfigured){let Y={};for(let[ae,K]of Object.entries(g.files))K.content&&(Y[ae]=K.content);this.llmNamingService.nameClusters(k,Y).then(ae=>{this.store.updateWorkingClusters(ae),this.store.updateBaselineClusters(ae);let K=[],D=this.store.getWorking(),A=Object.keys(D.services??{});if(A.length>1)for(let z of A){let ee=ns(D,this.store.getBaseline(),z);this.store.updateWorkingGraph(ee.graphId,ee),this.store.updateBaselineGraph(ee.graphId,ee),K.push(ee.graphId)}else{let z=ns(D,this.store.getBaseline());this.store.updateWorkingGraph(z.graphId,z),this.store.updateBaselineGraph(z.graphId,z),K.push(z.graphId)}let M=this.store.getWorking();for(let z of Object.values(ae)){let ee=zo(z,M,M);this.store.updateWorkingGraph(ee.graphId,ee),this.store.updateBaselineGraph(ee.graphId,ee),K.push(ee.graphId)}nl(this.store.getWorking().graphs),this.store.save(),this.notifyRefresh(K)}).catch(ae=>{this.log(`[Rebuild] LLM naming failed: ${ae?.message??ae}`)})}let N=Object.keys(this.store.getWorking().clusters||{}),O=Object.keys(k||{}),V=new Set([...N,...O]);for(let Y of V){let ae=k?.[Y];if(!ae){this.store.getWorking().graphs[`api-list:${Y}`]&&(this.store.removeWorkingGraph(`api-list:${Y}`),n.push(`api-list:${Y}`));continue}let K=zo(ae,g,y);this.store.updateWorkingGraph(K.graphId,K),n.push(K.graphId)}let te=Object.keys(w);if(te.length>1)for(let Y of te){let ae=ns(g,y,Y);this.store.updateWorkingGraph(ae.graphId,ae),n.push(ae.graphId)}else{let Y=ns(g,y);this.store.updateWorkingGraph(Y.graphId,Y),n.push(Y.graphId)}let W=qh(this.workspaceRoot,g,y,v,S);this.store.updateWorkingGraph(W.graphId,W),n.push(W.graphId);let $=this.store.getWorking().graphs;id($);for(let Y of Object.values(k||{})){let ae=zo(Y,g,y);this.store.updateWorkingGraph(ae.graphId,ae),n.includes(ae.graphId)||n.push(ae.graphId)}nl(this.store.getWorking().graphs);let H=GC(this.store.getWorking());this.store.updateWorkingHealth(H)}catch(g){this.log(`[Rebuild] Feature/microservice graph rebuild failed: ${g?.message??g}`)}}catch(l){this.log(`[Rebuild] Failed for ${t}: ${l?.message??l}`)}let o={filePath:gn.relative(this.workspaceRoot,t),changedFunctions:[...this._lastChangedFnNames],newFunctions:[...this._lastNewFnNames],deletedFunctions:[...this._lastDeletedFnNames],updatedGraphIds:n};this._lastChangedFnNames.clear(),this._lastNewFnNames.clear(),this._lastDeletedFnNames.clear();let c=Date.now()-s;return n.length>0&&Gh.track("file_rebuilt_perf",{duration_ms:c,updated_graph_count:n.length,changed_fns:o.changedFunctions.length,new_fns:o.newFunctions.length,deleted_fns:o.deletedFunctions.length}),{graphIds:n,changeDetail:o,durationMs:c}}async syncDriftedFilesFromDisk(){let t=[];try{let r=this.store.getWorking(),n=this.store.getBaseline(),{getFileContentAtCommit:s,resolveRef:a}=await Promise.resolve().then(()=>(uv(),P9)),o=null;try{o=a(this.workspaceRoot,"HEAD")}catch{}for(let[c,l]of Object.entries(r.files??{})){let u=typeof l.content=="string"?l.content:this.store.getFileContent("working",c);if(typeof u!="string")continue;let d=gn.join(this.workspaceRoot,c),p;try{p=await Jh.readFile(d,"utf-8")}catch{continue}if(p!==u){if(t.push(c),this.store.updateWorkingFile(c,{...l,hash:"__drift__"+Date.now()}),o)try{let f=s(this.workspaceRoot,o,c);if(typeof f=="string"&&f.length>0){let h=n.files[c];h&&(h.content=f)}}catch{}try{await this.rebuildFile(d,p)}catch(f){this.log(`[syncDrift] rebuild failed for ${c}: ${f?.message??f}`)}}}}catch(r){this.log(`[syncDrift] failed: ${r?.message??r}`)}return t}enqueueCascade(t){return this.mutationQueue.enqueue({key:"cascade",run:()=>this.applyDiffCascadeToLiveGraphs(t)})}waitForMutationQueueIdle(){return this.mutationQueue.waitForIdle()}async scanAndroidManifests(){let t=await import("fs"),r=await import("path"),n=[],s=this.workspaceRoot,a=/(?:^|\/)(?:node_modules|\.git|build|dist|coverage|out|bin|obj)(?:\/|$)/,o=8,c=5e3,l=0,u=(d,p)=>{if(p>o||l>c)return;let f;try{f=t.readdirSync(d,{withFileTypes:!0})}catch{return}for(let h of f){if(l++,l>c)return;let m=r.join(d,h.name),g=r.relative(s,m);if(!a.test(g)){if(h.isDirectory())u(m,p+1);else if(h.isFile()&&h.name==="AndroidManifest.xml")try{let y=t.readFileSync(m,"utf-8");n.push(...Kq(y,g))}catch{}}}};return u(s,0),n}applyDiffCascadeToLiveGraphs(t){let r=[];try{let n=this.store.getWorking(),s=this.store.getBaseline(),a=n.graphs;id(a);for(let c of Object.keys(a))c.startsWith("sequence:")&&r.push(c);let o=t?Object.values(n.clusters??{}).filter(c=>(c.files??[]).some(l=>t.has(l))):Object.values(n.clusters??{});for(let c of o){let l=zo(c,n,s);this.store.updateWorkingGraph(l.graphId,l),r.push(l.graphId)}nl(this.store.getWorking().graphs);for(let c of Object.keys(this.store.getWorking().graphs))(c.startsWith("feature:")||c.startsWith("microservice:"))&&r.push(c);this.store.save()}catch(n){this.log(`[applyDiffCascade] failed: ${n?.message??n}`)}return Array.from(new Set(r))}async resync(){this.store.clearAllFiles(),this.log("[Resync] Cleared SQLite store + legacy files before reinit"),await this.initialize();let t=new Map,r=this.store.getWorking();V1(r.graphs,(n,s)=>{for(let[a,o]of Object.entries(s.anchors))t.set(`${n}::${a}`,o)}),this.commentStore.reanchor(t),this.store.setComments(this.commentStore.toJSON()),this.store.save()}notifyChangeDetail(t){for(let r of this.changeDetailCallbacks)r(t)}notifyRefresh(t){for(let r of this.refreshCallbacks)r(t)}};var dze=0;function pze(){return`c_${++dze}_${Date.now()}_${Math.random().toString(36).slice(2,7)}`}var sd=class{constructor(t=[]){this.comments=[];this.comments=[...t]}getAll(){return[...this.comments]}getByLayer(t){return this.comments.filter(r=>r.layer===t)}getForTarget(t){return this.comments.filter(r=>r.targetId===t)}getOpen(){return this.comments.filter(t=>t.status==="open")}getResolved(){return this.comments.filter(t=>t.status==="resolved")}add(t){let r={id:pze(),status:"open",layer:t.layer,targetType:t.targetType,targetId:t.targetId,anchor:t.anchor,body:t.body,author:t.author||"local",createdAt:new Date().toISOString(),...t.source?{source:t.source}:{}};return this.comments.push(r),r}resolve(t){let r=this.comments.find(n=>n.id===t);return r?(r.status="resolved",!0):!1}reopen(t){let r=this.comments.find(n=>n.id===t);return r?(r.status="open",!0):!1}delete(t){let r=this.comments.findIndex(n=>n.id===t);return r===-1?!1:(this.comments.splice(r,1),!0)}reanchor(t){let r=[],n=(a,o)=>{let c=Array.isArray(a.anchor_history)?a.anchor_history:[];c.push({anchor:a.anchor,capturedAt:Date.now(),reason:o}),a.anchor_history=c.slice(-10)},s=a=>{let o=a.lastIndexOf("::");return o>=0?a.slice(o+2):a};for(let a of this.comments){if(!a.anchor){r.push(a.id);continue}let o=!1;for(let[c,l]of t.entries())if(l.filePath===a.anchor.filePath&&l.span&&a.anchor.span&&l.span.start===a.anchor.span.start&&l.span.end===a.anchor.span.end){if(a.anchor.stableKey&&l.stableKey&&a.anchor.stableKey!==l.stableKey)continue;let u=s(c);a.targetId!==u&&n(a,"span-match"),a.targetId=u,a.anchor={...l},o=!0;break}if(!o){if(a.anchor.stableKey){for(let[c,l]of t.entries())if(l.stableKey===a.anchor.stableKey){a.targetId=s(c),a.anchor={...l},o=!0;break}}if(!o){if(a.anchor.filePath&&a.anchor.symbol){let c=`${a.anchor.filePath}:${a.anchor.symbol}`;for(let[l,u]of t.entries())if(u.filePath&&u.symbol&&`${u.filePath}:${u.symbol}`===c){a.targetId=s(l),a.anchor={...u},o=!0;break}}if(!o){if(a.anchor.symbol){for(let[c,l]of t.entries())if(l.filePath===a.anchor.filePath&&l.symbol===a.anchor.symbol){a.targetId=s(c),a.anchor={...l},o=!0;break}}o||r.push(a.id)}}}}return r}clear(){this.comments=[]}toJSON(){return this.comments}};var Sr=Fe(require("fs")),Uo=Fe(require("path")),HC=".mcp-owner",D9=".mcp-preempt";function hv(e,t){let r=Uo.join(e,".codeatlas"),n=Uo.join(r,HC),s=()=>{try{Sr.existsSync(r)||Sr.mkdirSync(r,{recursive:!0});let o=Sr.openSync(n,"wx"),c={pid:process.pid,startedAt:Date.now(),label:t};return Sr.writeSync(o,JSON.stringify(c)),Sr.closeSync(o),{path:n,pid:process.pid,release:()=>fze(n)}}catch(o){return o?.code!=="EEXIST",null}},a=s();if(a)return R9(a.release),a;try{let o=JSON.parse(Sr.readFileSync(n,"utf-8"));if(typeof o.pid=="number"&&!ZC(o.pid)){try{Sr.unlinkSync(n)}catch{}let c=s();if(c)return R9(c.release),c}}catch{}return null}function N9(e){let t=Uo.join(e,".codeatlas",HC);if(!Sr.existsSync(t))return null;try{let r=JSON.parse(Sr.readFileSync(t,"utf-8"));return typeof r.pid!="number"?null:r}catch{return null}}function fze(e){try{JSON.parse(Sr.readFileSync(e,"utf-8")).pid===process.pid&&Sr.unlinkSync(e)}catch{}}function ZC(e){if(!Number.isFinite(e)||e<=0)return!1;try{return process.kill(e,0),!0}catch(t){return t?.code==="EPERM"}}var O9=!1,$9=new Set;function R9(e){if($9.add(e),O9)return;O9=!0;let t=()=>{for(let r of $9)try{r()}catch{}};process.on("exit",t),process.on("SIGINT",()=>{t(),process.exit(130)}),process.on("SIGTERM",()=>{t(),process.exit(143)})}function hze(e,t="mcp-server"){try{let r=Uo.join(e,".codeatlas");Sr.existsSync(r)||Sr.mkdirSync(r,{recursive:!0});let n=Uo.join(r,D9),s={pid:process.pid,requestedAt:Date.now(),label:t};return Sr.writeFileSync(n,JSON.stringify(s)),n}catch{return null}}function mv(e){let t=Uo.join(e,".codeatlas",D9);try{Sr.unlinkSync(t)}catch{}}async function M9(e,t,r=5e3,n=100){let s=Uo.join(e,".codeatlas",HC),a=hv(e,t);if(a)return mv(e),a;let o=N9(e);if(!o||!ZC(o.pid)){let l=hv(e,t);return l?(mv(e),l):null}if(o.label!=="vscode-extension")return null;hze(e,t);let c=Date.now()+r;for(;Date.now()<c;){if(!Sr.existsSync(s)){let u=hv(e,t);if(u)return mv(e),u}let l=N9(e);if(l&&!ZC(l.pid)){try{Sr.unlinkSync(s)}catch{}let u=hv(e,t);if(u)return mv(e),u}await new Promise(u=>setTimeout(u,n))}return null}var L9=new Set([".ts",".tsx",".js",".jsx",".mts",".cts",".mjs",".cjs",".py",".pyw",".java",".kt",".kts",".go",".rs",".cs",".php",".rb",".swift",".dart"]),mze=new Set(["node_modules",".git","dist","build",".next",".nuxt","out","target","coverage","__pycache__",".venv","venv",".codeatlas",".codeatlas-sa",".vscode",".gradle",".idea","bin","obj","Pods","DerivedData"]),gv=class{constructor(t,r={}){this.workspaceRoot=t;this.opts=r;this.orchestrator=null;this.watcher=null;this.rebuildTimer=null;this.pendingChanges=new Set;this.lock=null;this.readOnly=r.readOnly===!0,this.status={status:"initializing",startedAt:Date.now()},this.store=new Vu(t,{storageDirName:r.storageDirName})}getStatus(){return this.status}getStore(){return this.store}async handleFileChange(t){if(!this.orchestrator)return;let r=ea.isAbsolute(t)?t:ea.join(this.workspaceRoot,t);try{await this.orchestrator.rebuildFile(r),this.store.save()}catch(n){(this.opts.log??(a=>process.stderr.write(`[mcp-bootstrap] ${a}
|
|
478
478
|
`)))(`handleFileChange(${t}) failed: ${n?.message??n}`)}}async start(){let t=this.opts.log??(c=>process.stderr.write(`[mcp-bootstrap] ${c}
|
|
479
479
|
`));if(!qo.existsSync(this.workspaceRoot))return this.status={status:"error",message:`workspace not found: ${this.workspaceRoot}`},this.status;let r=gze(this.workspaceRoot,this.opts.maxScan??5e3);if(r.supportedFiles===0)return this.status={status:"not_a_codebase",scanned:r.scanned,supportedFiles:0,reason:r.scanned===0?"no files found at workspace root":`scanned ${r.scanned} files; none matched a supported language extension`},t(`workspace at ${this.workspaceRoot} is not a recognised codebase \u2014 MCP read-only with empty snapshot`),await this.store.load(),this.status;t(`workspace scan: ${r.scanned} files seen, ${r.supportedFiles} indexable`),await this.store.load();let n=this.readOnly?!1:await this.tryAcquireLockPreferred(),s=this.opts.storageDirName??".codeatlas",a=qo.existsSync(ea.join(this.workspaceRoot,s,"state.db"));if(!n){let c=this.store.getWorking();return this.status={status:"ready",fileCount:Object.keys(c.files??{}).length,apiCount:Object.keys(c.apiIndex??{}).length,graphCount:Object.keys(c.graphs??{}).length,mode:"read_only",warning:this.readOnly?"MCP started in read-only mode":"another process holds the write lock \u2014 likely VS Code is open on this workspace"},t(`mode=read_only (${this.status.warning})`),this.status}if(this.orchestrator=new fv(this.workspaceRoot,this.store,new sd),!a||Object.keys(this.store.getWorking().files??{}).length===0){t("no state.db / empty snapshot \u2014 running SyncOrchestrator.initialize() \u2026");let c=Date.now();try{let l=await this.orchestrator.initialize();this.store.save();let u=Date.now()-c;t(`initialize: ${l.fileCount} files, ${l.apiCount} APIs, ${l.graphCount} graphs in ${u}ms`)}catch(l){return this.status={status:"error",message:`initialize failed: ${l?.message??l}`},this.releaseLock(),this.status}}else t(`existing snapshot loaded: ${Object.keys(this.store.getWorking().files).length} files`);this.startWatcher();let o=this.store.getWorking();return this.status={status:"ready",fileCount:Object.keys(o.files??{}).length,apiCount:Object.keys(o.apiIndex??{}).length,graphCount:Object.keys(o.graphs??{}).length,mode:"read_write"},this.status}stop(){this.watcher&&(this.watcher.close(),this.watcher=null),this.rebuildTimer&&(clearTimeout(this.rebuildTimer),this.rebuildTimer=null),this.releaseLock()}async tryAcquireLockPreferred(){return this.lock=await M9(this.workspaceRoot,"mcp-server"),this.lock!==null}releaseLock(){this.lock&&(this.lock.release(),this.lock=null)}startWatcher(){let t=this.opts.log??(r=>process.stderr.write(`[mcp-watcher] ${r}
|
|
480
480
|
`));try{this.watcher=qo.watch(this.workspaceRoot,{recursive:!0},(r,n)=>{n&&(yze(n.toString())||(this.pendingChanges.add(n.toString()),this.scheduleRebuild()))}),t("file watcher started")}catch(r){t(`file watcher unavailable (${r?.message??r}); changes won't auto-rebuild`)}}scheduleRebuild(){this.rebuildTimer&&clearTimeout(this.rebuildTimer),this.rebuildTimer=setTimeout(()=>this.flushRebuild().catch(()=>{}),500)}async flushRebuild(){if(!this.orchestrator)return;let t=this.opts.log??(s=>process.stderr.write(`[mcp-watcher] ${s}
|
|
@@ -525,8 +525,8 @@ Rules:
|
|
|
525
525
|
`}return e.truncated&&(r+=`Note: Summary truncated. Total files: ${e.truncated.files??e.files.length}, total functions: ${e.truncated.functions??e.functions.length}.
|
|
526
526
|
|
|
527
527
|
`),r+=`## Query
|
|
528
|
-
${t}`,r}function O6e(e){try{return JSON.parse(e)}catch{}let t=e.match(/```(?:json)?\s*\n?([\s\S]*?)\n?```/);if(t)try{return JSON.parse(t[1])}catch{}let r=e.match(/\{[\s\S]*\}/);if(r)try{return JSON.parse(r[0])}catch{}return null}var $6e=5*60*1e3,R6e=20,pm=new Map;function D6e(e,t){return`${e.toLowerCase().trim()}::${t}`}async function tV(e,t,r,n){let s=D6e(r,Object.keys(t.files).length),a=pm.get(s);if(a&&Date.now()-a.timestamp<$6e)return a.result;let o=k6e(t),c=_d(N6e(o,r)),l=await gd(e,[{role:"system",content:C6e},{role:"user",content:c}],n),u=O6e(l.text);if(!u)return{...A6e,error:"Failed to parse LLM response"};let d={matchedServices:Array.isArray(u.matchedServices)?u.matchedServices:[],matchedClusters:Array.isArray(u.matchedClusters)?u.matchedClusters:[],matchedApis:Array.isArray(u.matchedApis)?u.matchedApis:[],matchedFiles:Array.isArray(u.matchedFiles)?u.matchedFiles:[],matchedFunctions:Array.isArray(u.matchedFunctions)?u.matchedFunctions:[],matchedClasses:Array.isArray(u.matchedClasses)?u.matchedClasses:[],explanation:typeof u.explanation=="string"?u.explanation:""};if(pm.size>=R6e){let p=pm.keys().next().value;p!==void 0&&pm.delete(p)}return pm.set(s,{result:d,timestamp:Date.now()}),d}function rV(e,t){let r=new Set,n=[];function s(o,c,l){let u=`${o}::${c}`;r.has(u)||(r.add(u),n.push({filePath:o,functionName:c,impactKind:"nl-query",matchReason:l}))}function a(o,c){let l=t.files[o];if(l){if(l.symbols.functions.length===0){s(o,"*",c);return}for(let u of l.symbols.functions)s(o,u.name,c)}}for(let o of e.matchedFunctions){let c=o.indexOf("::");if(c>0){let l=o.slice(c+2);s(o.slice(0,c),l,`Matched function: ${l}`)}}for(let o of e.matchedClasses){let c=o.indexOf("::");if(c>0){let l=o.slice(c+2);s(o.slice(0,c),l,`Matched class: ${l}`)}}for(let o of e.matchedFiles)a(o,`File matched: ${o.split("/").pop()}`);for(let o of e.matchedApis){let c=t.apiIndex[o];c&&s(c.filePath,c.handlerName,`API handler: ${c.method} ${c.route}`)}for(let o of e.matchedClusters){let c=t.clusters?.[o];if(c){let l=c.name??c.label;for(let u of c.files)a(u,`In cluster: ${l}`)}}for(let o of e.matchedServices){let c=t.services?.[o];if(!c)continue;let l=c.name;for(let d of Object.values(t.clusters??{}))if(d.serviceId===o)for(let p of d.files)a(p,`In service: ${l}`);let u=c.rootPath.endsWith("/")?c.rootPath:c.rootPath+"/";for(let d of Object.keys(t.files))(d.startsWith(u)||d===c.rootPath)&&a(d,`In service: ${l}`)}return n}function nV(){return{requestId:0,inflight:null}}async function iV(e,t,r){t.inflight?.abort();let n=new AbortController;t.inflight=n;let s=++t.requestId;e.wsBridge.broadcast({type:"nlQueryLoading",loading:!0});try{let a=e.settings.get("codeatlas.llmProvider")||"openrouter",o=e.settings.get("codeatlas.llmEndpoint")||"",c=a==="ollama"||a==="custom",l=await e.secrets.get("codeatlas.openRouterApiKey")??"";if(!l&&!c){if(s!==t.requestId)return;e.wsBridge.broadcast({type:"nlQueryResult",result:{explanation:"",matchCount:0,error:"No API key configured. Set OPENROUTER_API_KEY env var or use a local LLM (provider=ollama / custom)."}});return}if(a==="custom"&&!o){if(s!==t.requestId)return;e.wsBridge.broadcast({type:"nlQueryResult",result:{explanation:"",matchCount:0,error:'Provider "custom" needs codeatlas.llmEndpoint set (e.g. http://localhost:8080/v1/chat/completions).'}});return}let u=a==="ollama"||a==="custom",d={apiKey:l,model:e.settings.get("codeatlas.llmModel")||"openrouter/free",timeoutMs:u?12e4:3e4,provider:a,endpoint:o,responseFormat:"json_object"},p=e.snapshotStore.getWorking(),f=await tV(d,p,r,n.signal);if(s!==t.requestId)return;let h=rV(f,p);e.wsBridge.broadcast({type:"clearHighlights"}),h.length>0&&e.wsBridge.broadcast({type:"highlightNodes",highlights:h}),e.wsBridge.broadcast({type:"nlQueryResult",result:{explanation:f.explanation,matchCount:h.length,error:f.error}})}catch(a){if(a?.name==="AbortError"||s!==t.requestId)return;let o=a?.message??String(a);e.log(`[nl-query] error: ${o}`),e.wsBridge.broadcast({type:"nlQueryResult",result:{explanation:"",matchCount:0,error:`Query failed: ${o.slice(0,200)}`}})}finally{s===t.requestId&&(t.inflight=null),e.wsBridge.broadcast({type:"nlQueryLoading",loading:!1})}}function sV(e){e.wsBridge.broadcast({type:"clearHighlights"})}var M6e=3,L6e=3,F6e=2,j6e=2,vd=class{constructor(t,r,n=2e3){this.callbacks=t;this.gitOps=r;this._isPlaying=!1;this._isPaused=!1;this.autoPlayTimer=null;this.allSteps=[];this.diffCache=new Map;this.pairContexts=new Map;this.currentStepIndex=-1;this.activeDiffPairIndex=-1;this.stepDurationMs=n}get isPlaying(){return this._isPlaying}get isPaused(){return this._isPaused}setSpeed(t){this.stepDurationMs=Math.max(500,Math.min(1e4,t))}async play(t){if(t.length<2)return;this.resetState(),this._isPlaying=!0,this._isPaused=!1;let r=t.length-1;try{for(let n=0;n<r;n++){if(!this._isPlaying)return;let s=t[n],a=t[n+1];this.callbacks.onCommitStart(n,r,a.hash,a.subject);let o=await this.gitOps.buildDiff(s.hash,a.hash);if(!this._isPlaying)return;this.diffCache.set(n,o),this.pairContexts.set(n,{baseHash:s.hash,headHash:a.hash,baseLabel:`${s.shortHash} ${s.subject}`,headLabel:`${a.shortHash} ${a.subject}`});let c=this.buildSteps(o,a,n,r);for(let l of c)this.allSteps.push({...l,diffPairIndex:n,globalIndex:0,totalSteps:0})}for(let n=0;n<this.allSteps.length;n++)this.allSteps[n].globalIndex=n,this.allSteps[n].totalSteps=this.allSteps.length;if(this.allSteps.length===0||!this._isPlaying){this._isPlaying=!1,this.callbacks.onReplayEnd();return}this.currentStepIndex=0,this.navigateToCurrentStep(),this.scheduleNextAdvance()}catch(n){throw this._isPlaying&&(this._isPlaying=!1,this._isPaused=!1,this.clearAutoPlayTimer(),this.callbacks.clearDiffContext(),this.callbacks.onReplayEnd()),n}}pause(){!this._isPlaying||this._isPaused||(this._isPaused=!0,this.clearAutoPlayTimer(),this.callbacks.onPaused())}resume(){!this._isPaused||!this._isPlaying||(this._isPaused=!1,this.callbacks.onResumed(),this.currentStepIndex<this.allSteps.length-1&&this.scheduleNextAdvance())}nextStep(){if(!this._isPlaying||this.currentStepIndex>=this.allSteps.length-1)return;let t=this._isPaused;this._isPaused=!0,this.clearAutoPlayTimer(),this.currentStepIndex++,this.navigateToCurrentStep(),t||this.callbacks.onPaused()}prevStep(){if(!this._isPlaying||this.currentStepIndex<=0)return;let t=this._isPaused;this._isPaused=!0,this.clearAutoPlayTimer(),this.currentStepIndex--,this.navigateToCurrentStep(),t||this.callbacks.onPaused()}skipCommit(){if(!this._isPlaying||this.allSteps.length===0)return;let t=this.allSteps[this.currentStepIndex];if(!t)return;let r=t.diffPairIndex+1,n=this.allSteps.findIndex(s=>s.diffPairIndex===r);if(n<0){this.currentStepIndex=this.allSteps.length-1,this.clearAutoPlayTimer(),this.navigateToCurrentStep(),this._isPaused||(this._isPaused=!0,this.callbacks.onPaused());return}this.clearAutoPlayTimer(),this.currentStepIndex=n,this.navigateToCurrentStep(),this._isPaused||this.scheduleNextAdvance()}stop(){let t=this._isPlaying,r=this.currentStepIndex,n=this.allSteps.length;this.resetState(),t&&(n>0&&r<n-1&&Gh.track("timeline_replay_abandoned",{exited_at_step:r,total_steps:n,progress_percent:Math.round(r/n*100)}),this.callbacks.clearDiffContext(),this.callbacks.onReplayEnd())}playFromDiffResult(t){this.resetState(),this._isPlaying=!0,this._isPaused=!1;let r={diffedGraphs:t.diffedGraphs,headSnapshot:{files:{},apiIndex:{},graphs:{}},baseSnapshot:{files:{},apiIndex:{},graphs:{}}};this.diffCache.set(0,r),this.pairContexts.set(0,{baseHash:t.baseHash,headHash:t.headHash,baseLabel:t.baseLabel,headLabel:t.headLabel});let n={hash:t.headHash,shortHash:t.headHash.slice(0,7),subject:t.headLabel,author:"",relativeDate:""},s=this.buildSteps(r,n,0,1);for(let a=0;a<s.length;a++)this.allSteps.push({...s[a],diffPairIndex:0,globalIndex:a,totalSteps:s.length});if(this.allSteps.length===0){this._isPlaying=!1,this.callbacks.onReplayEnd();return}this.currentStepIndex=0,this.callbacks.onCommitStart(0,1,t.headHash,t.headLabel),this.navigateToCurrentStep(),this.scheduleNextAdvance()}playFocused(t,r){this.resetState(),this._isPlaying=!0,this._isPaused=!1;let n={diffedGraphs:r.diffedGraphs,headSnapshot:{files:{},apiIndex:{},graphs:{}},baseSnapshot:{files:{},apiIndex:{},graphs:{}}};this.diffCache.set(0,n),this.pairContexts.set(0,{baseHash:r.baseHash,headHash:r.headHash,baseLabel:r.baseLabel,headLabel:r.headLabel});let s={hash:r.headHash,shortHash:r.headHash.slice(0,7),subject:r.headLabel,author:"",relativeDate:""},o=this.buildSteps(n,s,0,1).filter(c=>c.mode==="feature"||c.mode==="microservice"?!0:c.mode==="api-list"?r.diffedGraphs[c.graphId]?.meta?.files?.some(d=>d===t)??!1:c.graphId.includes(t));for(let c=0;c<o.length;c++)this.allSteps.push({...o[c],diffPairIndex:0,globalIndex:c,totalSteps:o.length});if(this.allSteps.length===0){this._isPlaying=!1,this.callbacks.onReplayEnd();return}this.currentStepIndex=0,this.callbacks.onCommitStart(0,1,r.headHash,r.headLabel),this.navigateToCurrentStep(),this.scheduleNextAdvance()}resetState(){this._isPlaying=!1,this._isPaused=!1,this.clearAutoPlayTimer(),this.allSteps=[],this.diffCache.clear(),this.pairContexts.clear(),this.currentStepIndex=-1,this.activeDiffPairIndex=-1}scheduleNextAdvance(){if(this.clearAutoPlayTimer(),!(!this._isPlaying||this._isPaused)){if(this.currentStepIndex>=this.allSteps.length-1){Gh.track("timeline_replay_completed",{total_steps:this.allSteps.length}),this._isPaused=!0,this.callbacks.onPaused();return}this.autoPlayTimer=setTimeout(()=>{this.autoPlayTimer=null,!(!this._isPlaying||this._isPaused)&&(this.currentStepIndex++,this.navigateToCurrentStep(),this.scheduleNextAdvance())},this.stepDurationMs)}}clearAutoPlayTimer(){this.autoPlayTimer&&(clearTimeout(this.autoPlayTimer),this.autoPlayTimer=null)}navigateToCurrentStep(){let t=this.allSteps[this.currentStepIndex];if(!t)return;if(t.diffPairIndex!==this.activeDiffPairIndex){let s=this.pairContexts.get(t.diffPairIndex);s&&(this.callbacks.setDiffContext(s.baseHash,s.headHash,s.baseLabel,s.headLabel),this.activeDiffPairIndex=t.diffPairIndex)}this.callbacks.onCommitStart(t.commitIndex,t.totalCommits,t.commitHash,t.commitSubject);let n=this.diffCache.get(t.diffPairIndex)?.diffedGraphs[t.graphId];n&&(this.callbacks.onStepStart(t),this.callbacks.navigate(t.graphId,t.mode,n,t.label))}buildSteps(t,r,n,s){let a=[],o={commitHash:r.hash,commitSubject:r.subject,commitIndex:n,totalCommits:s},c=[],l=[];for(let[f,h]of Object.entries(t.diffedGraphs)){if(f.startsWith("file:")){let m=f.slice(5);h.nodes.some(g=>g.diff&&g.diff!=="unchanged")&&c.push(m)}if(f.startsWith("flow:")){let m=f.slice(5),g=m.lastIndexOf(":");if(g>0){let y=m.slice(0,g),_=m.slice(g+1);h.nodes.some(v=>v.diff&&v.diff!=="unchanged")&&l.push({filePath:y,fnName:_})}}}for(let{filePath:f}of l){if(c.includes(f))continue;t.diffedGraphs[`file:${f}`]&&c.push(f)}for(let{filePath:f,fnName:h}of l.slice(0,M6e))a.push({...o,graphId:`flow:${f}:${h}`,mode:"flow",label:`Flow: ${h}`,layer:"L5 Flow",changedEntity:h});for(let f of c.slice(0,L6e))a.push({...o,graphId:`file:${f}`,mode:"file",label:`File: ${f.split("/").pop()}`,layer:"L4 File",changedEntity:f.split("/").pop()??f});let u=0;for(let[f,h]of Object.entries(t.diffedGraphs)){if(u>=F6e)break;if(f.startsWith("sequence:")&&h.nodes.some(m=>m.diff&&m.diff!=="unchanged")){let m=f.split(":").pop();a.push({...o,graphId:f,mode:"sequence",label:`Sequence: ${m}`,layer:"L3 Sequence",changedEntity:m}),u++}}let d=Object.keys(t.diffedGraphs).find(f=>f.startsWith("feature:"));d&&a.push({...o,graphId:d,mode:"feature",label:"Feature Areas",layer:"L2a Feature",changedEntity:"clusters"});let p=0;for(let[f,h]of Object.entries(t.diffedGraphs)){if(p>=j6e)break;if(f.startsWith("api-list:")&&h.meta?.apis?.some(g=>g.diff&&g.diff!=="unchanged")){let g=h.meta?.clusterLabel??f.slice(9);a.push({...o,graphId:f,mode:"api-list",label:`APIs: ${g}`,layer:"L2b API List",changedEntity:g}),p++}}return t.diffedGraphs["microservice:workspace"]&&a.push({...o,graphId:"microservice:workspace",mode:"microservice",label:"System Design",layer:"L1 System",changedEntity:"services"}),a}};DN();function aV(){return{timeline:null}}function B6e(e,t){return t.timeline||(t.timeline=new vd({navigate:(r,n,s,a)=>{e.wsBridge.broadcast({type:"navigateTo",graphId:r,mode:n,graph:s,label:a})},setDiffContext:(r,n,s,a)=>{e.wsBridge.broadcast({type:"setGitDiffContext",baseHash:r,headHash:n,baseLabel:s,headLabel:a})},clearDiffContext:()=>{e.wsBridge.broadcast({type:"clearGitDiffContext"})},onStepStart:r=>{e.wsBridge.broadcast({type:"replayStep",step:r})},onCommitStart:(r,n,s,a)=>{e.wsBridge.broadcast({type:"replayCommitStart",index:r,total:n,hash:s,subject:a})},onReplayEnd:()=>{e.wsBridge.broadcast({type:"replayEnded"})},onPaused:()=>{e.wsBridge.broadcast({type:"replayPaused"})},onResumed:()=>{e.wsBridge.broadcast({type:"replayResumed"})}},{buildDiff:async()=>{throw new Error("Commit-history replay not yet supported in standalone \u2014 use Replay Working Changes for now.")}})),t.timeline}function oV(e,t){let r=e.snapshotStore.getBaseline(),n=e.snapshotStore.getWorking();if(!Yv(r,n)){e.wsBridge.broadcast({type:"clientToast",level:"warning",text:"No working changes to replay \u2014 edit a file first."});return}let s=Xv(r,n);B6e(e,t).playFromDiffResult({diffedGraphs:s,baseHash:"baseline",headHash:"working",baseLabel:"Baseline",headLabel:"Working (uncommitted)"}),e.wsBridge.broadcast({type:"replayStarted"})}function YN(e,t){t.timeline?.stop(),e.wsBridge.broadcast({type:"replayStopped"})}function cV(e,t,r){let n=t.timeline;if(n)switch(r){case"pause":n.pause();break;case"resume":n.resume();break;case"next":n.nextStep();break;case"prev":n.prevStep();break;default:e.log(`[replay] unknown control action: ${r}`)}}function lV(e,t,r){t.timeline?.setSpeed(r)}uv();var uV=require("child_process"),QN=Fe(require("https"));function XN(e,t){return(0,uV.execSync)(e,{cwd:t,encoding:"utf-8",maxBuffer:10*1024*1024})}function eO(e){try{let r=XN("git remote get-url origin",e).trim().match(/github\.com[/:]([^/]+)\/([^/.]+?)(?:\.git)?$/);return r?{owner:r[1],repo:r[2]}:null}catch{return null}}function dV(e,t,r){return new Promise(n=>{let s={hostname:"api.github.com",path:`/repos/${e}/${t}/pulls?state=open&per_page=30&sort=updated&direction=desc`,headers:{"User-Agent":"codeatlas-vscode",Accept:"application/vnd.github+json",...r?{Authorization:`Bearer ${r}`}:{}}},a=QN.get(s,o=>{let c="";o.on("data",l=>{c+=l}),o.on("end",()=>{if(o.statusCode!==200){n([]);return}try{let l=JSON.parse(c);n(l.map(u=>({number:u.number,title:u.title??`PR #${u.number}`,author:u.user?.login??"unknown",branch:u.head?.ref??"",updatedAt:u.updated_at??"",isDraft:u.draft===!0})))}catch{n([])}})});a.on("error",()=>n([])),a.setTimeout(8e3,()=>{a.destroy(),n([])})})}function pV(e,t,r,n){return new Promise((s,a)=>{let o={hostname:"api.github.com",path:`/repos/${e}/${t}/pulls/${r}`,headers:{"User-Agent":"codeatlas-vscode",Accept:"application/vnd.github+json",...n?{Authorization:`Bearer ${n}`}:{}}};QN.get(o,l=>{let u="";l.on("data",d=>{u+=d}),l.on("end",()=>{let d=l.statusCode??0;if(d===401){a(new Error("GitHub authentication failed (401). Your token may be invalid or expired \u2014 re-sign in via VS Code's GitHub extension."));return}if(d===403){let m="";try{m=JSON.parse(u).message??""}catch{}m.toLowerCase().includes("rate limit")?a(new Error("GitHub API rate limit exceeded (403). Sign in to GitHub via VS Code for a higher limit (5000 req/hr).")):a(new Error(`GitHub access denied (403): ${m||'token may lack the "repo" scope needed for private repositories.'}`));return}if(d===404){let m=n?"":" If this is a private repository, sign in to GitHub via VS Code's GitHub extension first.";a(new Error(`PR #${r} not found in ${e}/${t}.${m}`));return}if(d!==200){let m="";try{m=JSON.parse(u).message??""}catch{}a(new Error(`GitHub API error ${d}: ${m||u.slice(0,200)}`));return}let p;try{p=JSON.parse(u)}catch{a(new Error("Failed to parse GitHub API response \u2014 unexpected non-JSON body."));return}let f=p?.base?.sha,h=p?.head?.sha;if(typeof f!="string"||typeof h!="string"){a(new Error("GitHub API response is missing base or head commit SHA."));return}s({prNumber:r,prTitle:p.title??`PR #${r}`,baseHash:f,headHash:h,baseRef:p.base.ref??"",headRef:p.head.ref??""})})}).on("error",l=>{a(new Error(`Network error contacting GitHub API: ${l.message}`))})})}function tO(e,t){try{XN(`git cat-file -e ${t}^{commit}`,e)}catch{try{XN("git fetch origin",e)}catch{}}}dv();function fV(){return{timeline:null,activeContext:null}}function ix(e,t){return t.timeline||(t.timeline=new vd({navigate:(r,n,s,a)=>e.wsBridge.broadcast({type:"navigateTo",graphId:r,mode:n,graph:s,label:a}),setDiffContext:(r,n,s,a)=>e.wsBridge.broadcast({type:"setGitDiffContext",baseHash:r,headHash:n,baseLabel:s,headLabel:a}),clearDiffContext:()=>e.wsBridge.broadcast({type:"clearGitDiffContext"}),onStepStart:r=>e.wsBridge.broadcast({type:"replayStep",step:r}),onCommitStart:(r,n,s,a)=>e.wsBridge.broadcast({type:"replayCommitStart",index:r,total:n,hash:s,subject:a}),onReplayEnd:()=>e.wsBridge.broadcast({type:"replayEnded"}),onPaused:()=>e.wsBridge.broadcast({type:"replayPaused"}),onResumed:()=>e.wsBridge.broadcast({type:"replayResumed"})},{buildDiff:(r,n)=>Kh(e.workspaceRoot,r,n,e.log)})),t.timeline}function ra(e,t){e.wsBridge.broadcast({type:"clientToast",level:"error",text:t})}function rO(e,t){e.wsBridge.broadcast({type:"clientToast",level:"warning",text:t})}function hV(e,t){let r=cv(e.workspaceRoot,100);if(r.length===0){rO(e,"No git commits found in this repository.");return}e.wsBridge.sendTo(t,{type:"showCommitPicker",commits:r.map(n=>({hash:n.hash,shortHash:n.shortHash,subject:n.subject,author:n.author,relativeDate:n.relativeDate})),mode:"both"})}async function mV(e,t,r,n){try{let s=await Kh(e.workspaceRoot,r,n,e.log),a=r.slice(0,7),o=n.slice(0,7),c={baseHash:r,headHash:n,baseLabel:`${a} (base)`,headLabel:`${o} (head)`};t.activeContext=c,ix(e,t).playFromDiffResult({diffedGraphs:s.diffedGraphs,...c}),e.wsBridge.broadcast({type:"replayStarted"})}catch(s){ra(e,`Commit diff failed: ${(s?.message??String(s)).slice(0,200)}`)}}function gV(e,t){let r=sv(e.workspaceRoot);if(r.length===0){rO(e,"No local branches found.");return}e.wsBridge.sendTo(t,{type:"showBranchPicker",branches:r.map(n=>({name:n.name,isCurrent:n.isCurrent,isRemote:n.isRemote}))})}async function yV(e,t,r){try{let n=av(e.workspaceRoot,r),s=av(e.workspaceRoot,"HEAD");if(!n||!s){ra(e,`Could not resolve branch ${r}.`);return}let a=ov(e.workspaceRoot,n,s)??n,o=await Kh(e.workspaceRoot,a,n,e.log),c={baseHash:a,headHash:n,baseLabel:`${a.slice(0,7)} (merge-base)`,headLabel:`${r} (${n.slice(0,7)})`};t.activeContext=c,ix(e,t).playFromDiffResult({diffedGraphs:o.diffedGraphs,...c}),e.wsBridge.broadcast({type:"replayStarted"})}catch(n){ra(e,`Branch diff failed: ${(n?.message??String(n)).slice(0,200)}`)}}async function _V(e,t){let r=eO(e.workspaceRoot);if(!r){ra(e,"Could not determine GitHub repository from the origin remote. Make sure `origin` points at github.com.");return}let n=await e.secrets.get("codeatlas.githubToken"),s=await dV(r.owner,r.repo,n);e.wsBridge.sendTo(t,{type:"showPrPicker",owner:r.owner,repo:r.repo,prs:s})}async function bV(e,t,r){let n=eO(e.workspaceRoot);if(!n){ra(e,"Could not determine GitHub repository from the origin remote.");return}try{let s=await e.secrets.get("codeatlas.githubToken"),a=await pV(n.owner,n.repo,r,s);try{tO(e.workspaceRoot,a.baseHash),tO(e.workspaceRoot,a.headHash)}catch(u){ra(e,`Couldn't fetch PR commits locally: ${u?.message??u}. If this is a fork-based PR, fetch the source branch manually.`);return}let o=await Kh(e.workspaceRoot,a.baseHash,a.headHash,e.log),c={baseHash:a.baseHash,headHash:a.headHash,baseLabel:`${a.baseRef} (base)`,headLabel:`PR #${a.prNumber}: ${a.prTitle}`};t.activeContext=c,ix(e,t).playFromDiffResult({diffedGraphs:o.diffedGraphs,...c}),e.wsBridge.broadcast({type:"replayStarted"})}catch(s){let a=s?.message??String(s);if(a.includes("not found")){let c=!!await e.secrets.get("codeatlas.githubToken")?" (token present \u2014 check that it has the `repo` scope for private repositories)":" Set GITHUB_TOKEN env var to read private repos.";ra(e,`PR #${r} not found${c}`)}else ra(e,`PR diff failed: ${a.slice(0,200)}`)}}function vV(e,t){t.activeContext=null,t.timeline?.stop(),e.wsBridge.broadcast({type:"clearGitDiffContext"}),e.wsBridge.broadcast({type:"replayStopped"})}function xV(e,t,r){try{let n=cv(e.workspaceRoot,50,r),s=sv(e.workspaceRoot),a=s.find(c=>c.name==="main"||c.name==="master")?.name,o=a&&a!==r?ov(e.workspaceRoot,a,r??"HEAD")??n[n.length-1]?.hash:n[n.length-1]?.hash;e.wsBridge.sendTo(t,{type:"showCommitRangePicker",commits:n,branches:s,currentBranch:r,baselineHash:o})}catch(n){ra(e,`Couldn't list commits: ${(n?.message??String(n)).slice(0,200)}`)}}async function SV(e,t,r){if(!Array.isArray(r)||r.length<2){rO(e,"Pick at least two commits to walk a timeline.");return}let n=ix(e,t);try{await n.play(r.map(s=>({hash:s.hash,shortHash:s.shortHash??s.hash.slice(0,7),subject:s.subject??"",author:s.author??"",relativeDate:s.relativeDate??""}))),e.wsBridge.broadcast({type:"replayStarted"})}catch(s){ra(e,`Timeline replay failed: ${(s?.message??String(s)).slice(0,200)}`)}}function TV(e,t){t.timeline?.skipCommit()}var z6e=["requestChangeLog","navigateToChangeEntry","playbackChangeLog","connectGitHub"],na="Feature not yet available in the standalone npm package \u2014 install the VS Code extension or wait for a follow-up release.";function nO(e){let t=e.editorOpener??L8,r=new Set(z6e),n=GN(),s=nV(),a=aV(),o=fV();async function c(l,u){if(!(!l||typeof l!="object"||typeof l.type!="string"))switch(l.type){case"ready":U6e(e,u);return;case"requestRoute":za(e,l);return;case"openFileDiagram":case"openFeatureDiagram":case"openFunctionFlow":case"openMicroserviceDiagram":{let d=l.graphId;if(!d)switch(l.type){case"openMicroserviceDiagram":d="microservice:workspace";break;case"openFeatureDiagram":{let p=l.serviceId?String(l.serviceId):"";d=p?`feature:${p}`:"feature:workspace";break}case"openFileDiagram":d=l.filePath?`file:${l.filePath}`:void 0;break;case"openFunctionFlow":d=l.filePath&&l.functionName?`flow:${l.filePath}:${l.functionName}`:void 0;break}za(e,{graphId:d});return}case"openApiList":za(e,{graphId:"api-list:workspace"});return;case"openSequence":{let d=Object.keys(e.snapshotStore.getWorking().graphs??{}).find(p=>p.startsWith("sequence:"));d?za(e,{graphId:d}):Sr(e,"info","No sequence diagrams yet \u2014 pick an API to view its sequence.")}return;case"openFunctionFlowChart":{let d=Object.keys(e.snapshotStore.getWorking().graphs??{}).find(p=>p.startsWith("flow:"));d?za(e,{graphId:d}):Sr(e,"info","No flow diagrams yet \u2014 pick a function to view its flow.")}return;case"nodeClicked":case"edgeClicked":await q6e(e,t,l);return;case"resolveComment":W6e(e,l);return;case"panelNavigated":return;case"toggleTheme":e.wsBridge.broadcast({type:"setTheme",theme:l.theme??"dark"});return;case"runCommand":V6e(e,l);return;case"setLlmConfig":K6e(e,l);return;case"requestExplorerData":G6e(e);return;case"searchSelected":case"functionSelected":case"fileSelectedForImpact":l.graphId&&za(e,{graphId:l.graphId});return;case"requestAiReview":if(!e.settings||!e.secrets){Sr(e,"warning",na);return}await ZN({snapshotStore:e.snapshotStore,wsBridge:e.wsBridge,settings:e.settings,secrets:e.secrets,log:e.log,workspaceRoot:e.workspaceRoot},n);return;case"clearAiReview":if(!e.settings||!e.secrets)return;HN({snapshotStore:e.snapshotStore,wsBridge:e.wsBridge,settings:e.settings,secrets:e.secrets,log:e.log,workspaceRoot:e.workspaceRoot},n);return;case"nlQuery":if(!e.settings||!e.secrets){Sr(e,"warning",na);return}await iV({snapshotStore:e.snapshotStore,wsBridge:e.wsBridge,settings:e.settings,secrets:e.secrets,log:e.log},s,String(l.query??""));return;case"clearNlQuery":if(!e.settings||!e.secrets)return;sV({snapshotStore:e.snapshotStore,wsBridge:e.wsBridge,settings:e.settings,secrets:e.secrets,log:e.log});return;case"replayWorkingDiff":case"replayCurrentDiff":oV({snapshotStore:e.snapshotStore,wsBridge:e.wsBridge,log:e.log},a);return;case"stopReplay":YN({snapshotStore:e.snapshotStore,wsBridge:e.wsBridge,log:e.log},a);return;case"timelineReplayControl":{let d=l.action;if(d==="skipCommit"){TV({workspaceRoot:e.workspaceRoot,snapshotStore:e.snapshotStore,wsBridge:e.wsBridge,secrets:e.secrets,log:e.log},o);return}if(d==="stop"){YN({snapshotStore:e.snapshotStore,wsBridge:e.wsBridge,log:e.log},a),o.timeline&&(o.timeline.stop(),e.wsBridge.broadcast({type:"replayStopped"}));return}if(cV({snapshotStore:e.snapshotStore,wsBridge:e.wsBridge,log:e.log},a,d),o.timeline)switch(d){case"pause":o.timeline.pause();break;case"resume":o.timeline.resume();break;case"next":o.timeline.nextStep();break;case"prev":o.timeline.prevStep();break}return}case"timelineReplaySpeed":{let d=Number(l.stepMs??l.speedMs??2e3);lV({snapshotStore:e.snapshotStore,wsBridge:e.wsBridge,log:e.log},a,d),o.timeline?.setSpeed(d);return}case"requestGitDiff":if(!e.secrets){Sr(e,"warning",na);return}hV({workspaceRoot:e.workspaceRoot,snapshotStore:e.snapshotStore,wsBridge:e.wsBridge,secrets:e.secrets,log:e.log},u);return;case"commitSelected":if(!e.secrets)return;await mV({workspaceRoot:e.workspaceRoot,snapshotStore:e.snapshotStore,wsBridge:e.wsBridge,secrets:e.secrets,log:e.log},o,String(l.baseHash),String(l.headHash));return;case"requestBranchDiff":case"requestBranchDiffReplay":if(!e.secrets){Sr(e,"warning",na);return}gV({workspaceRoot:e.workspaceRoot,snapshotStore:e.snapshotStore,wsBridge:e.wsBridge,secrets:e.secrets,log:e.log},u);return;case"branchSelected":if(!e.secrets)return;await yV({workspaceRoot:e.workspaceRoot,snapshotStore:e.snapshotStore,wsBridge:e.wsBridge,secrets:e.secrets,log:e.log},o,String(l.branchName??l.branch??""));return;case"requestPrDiffReplay":if(!e.secrets){Sr(e,"warning",na);return}await _V({workspaceRoot:e.workspaceRoot,snapshotStore:e.snapshotStore,wsBridge:e.wsBridge,secrets:e.secrets,log:e.log},u);return;case"prSelected":if(!e.secrets)return;await bV({workspaceRoot:e.workspaceRoot,snapshotStore:e.snapshotStore,wsBridge:e.wsBridge,secrets:e.secrets,log:e.log},o,Number(l.prNumber));return;case"clearGitDiff":if(!e.secrets)return;vV({workspaceRoot:e.workspaceRoot,snapshotStore:e.snapshotStore,wsBridge:e.wsBridge,secrets:e.secrets,log:e.log},o);return;case"requestTimelineCommits":if(!e.secrets){Sr(e,"warning",na);return}xV({workspaceRoot:e.workspaceRoot,snapshotStore:e.snapshotStore,wsBridge:e.wsBridge,secrets:e.secrets,log:e.log},u,typeof l.branch=="string"?l.branch:void 0);return;case"startTimelineReplay":if(!e.secrets){Sr(e,"warning",na);return}await SV({workspaceRoot:e.workspaceRoot,snapshotStore:e.snapshotStore,wsBridge:e.wsBridge,secrets:e.secrets,log:e.log},o,Array.isArray(l.commits)?l.commits:[]);return;case"requestReviewGuidelines":{let d=e.snapshotStore.getReviewGuidelines();e.wsBridge.broadcast({type:"reviewGuidelines",guidelines:d});return}case"saveReviewGuidelines":{let d=String(l.text??""),p=e.snapshotStore.setReviewGuidelines(d);e.wsBridge.broadcast({type:"reviewGuidelinesUpdated",guidelines:p}),Sr(e,"info","Review guidelines saved.");return}case"requestEvidenceGate":{let d=e.settings?.get("codeatlas.evidenceGateEnabled");e.wsBridge.broadcast({type:"evidenceGate",enabled:d!==!1});return}case"setEvidenceGate":{let d=!!l.enabled;e.settings&&e.settings.set("codeatlas.evidenceGateEnabled",d),e.wsBridge.broadcast({type:"evidenceGate",enabled:d}),Sr(e,"info",`Evidence gate ${d?"enabled":"disabled (debug)"}.`);return}case"requestAiFindings":{let d={};l.graphId&&(d.graphId=String(l.graphId)),l.entryPointId&&(d.entryPointId=String(l.entryPointId)),l.severity&&(d.severity=l.severity),l.status&&(d.status=l.status);let p=e.snapshotStore.listAiReviewFindings(d),f=e.snapshotStore.getAiReviewFindingCounts();e.wsBridge.broadcast({type:"aiFindings",items:p,counts:f,scope:l});return}case"requestAiFindingsForNode":{let d=e.snapshotStore.listAiReviewFindingsForEntity(String(l.graphId??""),String(l.nodeId??""));e.wsBridge.broadcast({type:"aiFindingsForNode",graphId:l.graphId,nodeId:l.nodeId,items:d});return}case"updateAiFindingStatus":{let d=e.snapshotStore.updateAiReviewFindingStatus(String(l.findingId??""),l.status);if(!d){Sr(e,"warning","Finding not found.");return}let p=e.snapshotStore.getAiReviewFindingCounts();e.wsBridge.broadcast({type:"aiFindingUpdated",finding:d,counts:p});return}case"searchAiFindings":{try{let{searchFindings:d}=await Promise.resolve().then(()=>(kb(),Ab)),p=d(e.snapshotStore,String(l.query??""),Number(l.limit)||20);e.wsBridge.broadcast({type:"aiFindingsSearchResult",result:p})}catch(d){Sr(e,"error",`Findings search failed: ${d.message??d}`)}return}case"requestFullReview":{if(!e.settings||!e.secrets){Sr(e,"warning",na);return}let{runFullReview:d}=await Promise.resolve().then(()=>(um(),rx));d({snapshotStore:e.snapshotStore,wsBridge:e.wsBridge,settings:e.settings,secrets:e.secrets,log:e.log,workspaceRoot:e.workspaceRoot},{kind:l.scope??"all",clusterId:l.clusterId,entryPointId:l.entryPointId});return}case"requestSpecificReview":{if(!e.settings||!e.secrets){Sr(e,"warning",na);return}let{runSpecificReview:d}=await Promise.resolve().then(()=>(um(),rx));d({snapshotStore:e.snapshotStore,wsBridge:e.wsBridge,settings:e.settings,secrets:e.secrets,log:e.log,workspaceRoot:e.workspaceRoot},String(l.prompt??""));return}case"cancelFullReview":case"cancelAiReview":{let{cancelCurrentReview:d}=await Promise.resolve().then(()=>(um(),rx));d()||Sr(e,"info","No AI Review is currently running.");return}case"clearFindings":{let d=l.scope&&(l.scope.entryPointId||l.scope.graphId)?{entryPointId:l.scope.entryPointId,graphId:l.scope.graphId}:void 0,p=e.snapshotStore.clearAiReviewFindings(d);try{e.snapshotStore.clearAiReviewSignature?.()}catch{}e.wsBridge.broadcast({type:"aiFindingsCleared",count:p,scope:l.scope??null});let f=e.snapshotStore.getAiReviewFindingCounts(),h=e.snapshotStore.listAiReviewFindings({status:"open"});e.wsBridge.broadcast({type:"aiFindings",items:h,counts:f}),Sr(e,"info",`Cleared ${p} finding${p===1?"":"s"}.`);return}default:if(r.has(l.type)){e.log(`[standalone] msg.${l.type}: unavailable in v1, sending toast`),Sr(e,"warning",na);return}e.log(`[standalone] unknown msg.type=${l.type}`)}}return{handle:c}}function U6e(e,t){let r=!!(e.settings&&e.secrets),n=!!e.secrets;e.wsBridge.broadcast({type:"capabilities",capabilities:{canSignIn:!1,canAiReview:r,canNlQuery:r,canSearch:r,canReplay:!0,canGitDiff:n,canEditCode:!0,canComment:!0,mode:"standalone"}});let s=e.snapshotStore.getWorking(),a=Object.keys(s.files??{}).length,o=Object.keys(s.apiIndex??{}).length,c=Object.keys(s.services??{}).length,l=Object.keys(s.clusters??{}).length,u=e.settings?.get("codeatlas.llmProvider"),d=e.settings?.get("codeatlas.llmModel"),p=e.settings?.get("codeatlas.llmEndpoint");e.wsBridge.broadcast({type:"workspaceInfo",name:require("path").basename(e.workspaceRoot),workspaceRoot:e.workspaceRoot,fileCount:a,apiCount:o,serviceCount:c,clusterCount:l,initialized:a>0,isAuthenticated:!1,hasGitRemote:!1,gitHubConnected:!1,editorUriScheme:"vscode",extensionId:"codeatlas.standalone",llmProvider:u,llmModel:d,llmEndpoint:p});let f=Z6e(e);f&&e.wsBridge.broadcast({type:"navigateTo",graphId:f.graphId,mode:f.type,graph:f,label:wV(f)})}function za(e,t){let r=t.graphId;if(!r)return;let s=e.snapshotStore.getWorking().graphs[r];if(!s){e.log(`[standalone] requestRoute: ${r} not found in working snapshot`),Sr(e,"warning",`Diagram not found: ${r}`);return}e.wsBridge.broadcast({type:"navigateTo",graphId:r,mode:s.type,graph:s,label:wV(s)})}async function q6e(e,t,r){let n=r.anchor?.filePath;if(!n)return;let s=n.startsWith("/")?n:`${e.workspaceRoot}/${n}`,a=r.anchor?.line,o=await t(s,a,{});Sr(e,o.spawned?"info":"warning",o.toast)}function W6e(e,t){let r=t.commentId;r&&(e.commentStore.resolve(r),e.wsBridge.broadcast({type:"commentResolved",commentId:r}))}function V6e(e,t){switch(t.command){case"codeatlas.lightMode":e.wsBridge.broadcast({type:"setTheme",theme:"light"});return;case"codeatlas.darkMode":e.wsBridge.broadcast({type:"setTheme",theme:"dark"});return;case"codeatlas.openApiExplorer":{let r=Object.keys(e.snapshotStore.getWorking().graphs??{}).find(n=>n.startsWith("api-list:"));r?za(e,{graphId:r}):Sr(e,"info",'No API-list diagrams yet \u2014 run "Initialize" to scan the workspace.');return}case"codeatlas.searchApiExplorer":case"codeatlas.openFunctionFlow":{let r=t.command==="codeatlas.openFunctionFlow"?"flow:":"sequence:",n=Object.keys(e.snapshotStore.getWorking().graphs??{}).find(s=>s.startsWith(r));n?za(e,{graphId:n}):Sr(e,"info",`No ${r.replace(":","")} diagrams yet \u2014 pick an API/function first.`);return}case"codeatlas.showHealthReport":za(e,{graphId:"health:report"});return;default:e.log(`[standalone] runCommand: ${t.command} unsupported in v1`),Sr(e,"info",`Command "${t.command}" not available in standalone v1.`)}}function K6e(e,t){if(!e.settings){Sr(e,"warning","Settings layer not initialised \u2014 restart the standalone server.");return}let r=[];if(typeof t.provider=="string"&&r.push(["codeatlas.llmProvider",t.provider]),typeof t.model=="string"&&r.push(["codeatlas.llmModel",t.model]),typeof t.endpoint=="string"&&r.push(["codeatlas.llmEndpoint",t.endpoint]),r.length===0){Sr(e,"info","No LLM config changes to apply.");return}let n=!0;for(let[s,a]of r)e.settings.set(s,a)||(n=!1);if(n){Sr(e,"info",`Saved LLM config (${r.map(([a])=>a.replace("codeatlas.","")).join(", ")}).`),e.wsBridge.broadcast({type:"llmConfigSaved"});let s=e.snapshotStore.getWorking();e.wsBridge.broadcast({type:"workspaceInfo",name:require("path").basename(e.workspaceRoot),workspaceRoot:e.workspaceRoot,fileCount:Object.keys(s.files??{}).length,apiCount:Object.keys(s.apiIndex??{}).length,serviceCount:Object.keys(s.services??{}).length,clusterCount:Object.keys(s.clusters??{}).length,initialized:Object.keys(s.files??{}).length>0,isAuthenticated:!1,hasGitRemote:!1,gitHubConnected:!1,editorUriScheme:"vscode",extensionId:"codeatlas.standalone",llmProvider:e.settings.get("codeatlas.llmProvider"),llmModel:e.settings.get("codeatlas.llmModel"),llmEndpoint:e.settings.get("codeatlas.llmEndpoint")})}else Sr(e,"error","Failed to write LLM config \u2014 check filesystem permissions on .codeatlas-sa/config.json.")}function G6e(e){let t=e.snapshotStore.getWorking(),r=Object.values(t.apiIndex??{}),n=Object.values(t.clusters??{}).map(s=>({id:s.id,label:s.label??s.name,files:s.files??[],apisInCluster:s.apisInCluster??[]}));e.wsBridge.broadcast({type:"explorerData",apis:r,clusters:n,files:Object.keys(t.files??{})})}function Z6e(e){let t=e.snapshotStore.getWorking();return t.graphs["microservice:workspace"]??Object.values(t.graphs).find(r=>r?.graphId?.startsWith("feature:"))??Object.values(t.graphs)[0]??null}function wV(e){let t=e.meta??{};return typeof t.label=="string"?t.label:typeof t.title=="string"?t.title:(e.nodes??[]).find(n=>n.type==="file"||n.type==="cluster"||n.type==="service")?.label??e.graphId}function Sr(e,t,r){e.wsBridge.broadcast({type:"clientToast",level:t,text:r})}var hl=Fe(require("node:fs")),PV=Fe(require("node:os")),fm=Fe(require("node:path")),iO=Object.freeze({"codeatlas.autoUpdateOnSave":!0,"codeatlas.maxFiles":2e3,"codeatlas.maxFileSize":5242880,"codeatlas.sequenceTraversalDepth":8,"codeatlas.browserPort":7742,"codeatlas.ignore":["**/node_modules/**","**/dist/**","**/build/**","**/.git/**","**/.codeatlas/**","**/.codeatlas-sa*/**"],"codeatlas.showUnchangedInDiagrams":!0,"codeatlas.lspFallback":!1,"codeatlas.lspTimeout":2e3,"codeatlas.llmNaming":!1,"codeatlas.llmProvider":"openrouter","codeatlas.llmModel":"openrouter/free","codeatlas.llmEndpoint":""});function IV(e){let t=e.env??process.env,r=e.homeDir??PV.homedir(),n=e.storageDirName??".codeatlas-sa",s=e.readFile??H6e,a=fm.join(e.workspaceRoot,n,"config.json"),o=fm.join(r,".codeatlas","config.json"),c=EV(s(a)),l=EV(s(o));function u(f){let h=f.replace(/([a-z0-9])([A-Z])/g,"$1_$2").replace(/\./g,"_").toUpperCase(),m=t[h];return m!==void 0?J6e(m,iO[f]):Object.prototype.hasOwnProperty.call(c,f)?c[f]:Object.prototype.hasOwnProperty.call(l,f)?l[f]:iO[f]}function d(){let f={};for(let h of Object.keys(iO))f[h]=u(h);return f}function p(f,h){try{hl.mkdirSync(fm.dirname(a),{recursive:!0});let m={};try{let g=hl.readFileSync(a,"utf-8"),y=JSON.parse(g);y&&typeof y=="object"&&(m=y)}catch{}return m[f]=h,hl.writeFileSync(a,JSON.stringify(m,null,2)+`
|
|
529
|
-
`),c[f]=h,!0}catch{return!1}}return{get:u,all:d,set:p}}function H6e(e){try{return hl.readFileSync(e,"utf-8")}catch{return null}}function EV(e){if(!e)return{};try{let t=JSON.parse(e);return t&&typeof t=="object"?t:{}}catch{return{}}}function J6e(e,t){if(typeof t=="boolean"){let r=e.toLowerCase();return r==="1"||r==="true"||r==="yes"||r==="on"}if(typeof t=="number"){let r=Number(e);return Number.isFinite(r)?r:t}if(Array.isArray(t)){if(e.startsWith("["))try{let r=JSON.parse(e);return Array.isArray(r)?r:t}catch{return t}return e.split(",").map(r=>r.trim()).filter(Boolean)}return e}var Ua=Fe(require("node:fs")),AV=Fe(require("node:os")),sx=Fe(require("node:path")),Y6e=Object.freeze({"codeatlas.openRouterApiKey":["OPENROUTER_API_KEY","OPENAI_API_KEY","ANTHROPIC_API_KEY","LLM_API_KEY"],"codeatlas.githubToken":["GITHUB_TOKEN","GH_TOKEN"]});function kV(e={}){let t=e.homeDir??AV.homedir(),r=e.env??process.env,n=e.log??(()=>{}),s=sx.join(t,".codeatlas","secrets.json");async function a(l){let u=Y6e[l]??[];for(let f of u){let h=r[f];if(h&&h.length>0)return h}let p=sO(s)[l];return typeof p=="string"&&p.length>0?p:void 0}async function o(l,u){let d=sO(s);d[l]=u;try{Ua.mkdirSync(sx.dirname(s),{recursive:!0,mode:448}),Ua.writeFileSync(s,JSON.stringify(d,null,2),{mode:384});try{Ua.chmodSync(s,384)}catch{}n(`[secrets] stored ${l} at ${s} (mode 0600)`)}catch(p){throw n(`[secrets] failed to persist ${l}: ${p?.message??p}`),p}}async function c(l){let u=sO(s);if(l in u){delete u[l];try{Ua.writeFileSync(s,JSON.stringify(u,null,2),{mode:384}),n(`[secrets] removed ${l} from ${s}`)}catch(d){throw n(`[secrets] failed to remove ${l}: ${d?.message??d}`),d}}}return{get:a,store:o,delete:c}}function sO(e){try{let t=Ua.readFileSync(e,"utf-8"),r=JSON.parse(t);return r&&typeof r=="object"?r:{}}catch{return{}}}async function OV(e){let t=e.log??Q6e,r=IV({workspaceRoot:e.workspaceRoot}),n=kV({log:t}),s=e.port??r.get("codeatlas.browserPort"),a=r.get("codeatlas.ignore"),o=new sd,c,l=nO({snapshotStore:e.snapshotStore,commentStore:o,wsBridge:void 0,workspaceRoot:e.workspaceRoot,log:t,settings:r,secrets:n});c=new Nv({port:s,extensionPath:e.distDir,messageHandler:(h,m)=>{l.handle(h,m)},getInitialData:()=>X6e(e.snapshotStore),log:t}),l.wsBridge=c,t9e(l,c,e.snapshotStore,o,e.workspaceRoot,t,r,n);let u=await c.start();t(`[standalone] webview-ui served at http://localhost:${u}`);let d;r.get("codeatlas.autoUpdateOnSave")?d=await D8({workspaceRoot:e.workspaceRoot,ignore:a,callbacks:{handleFileSave:e.handleFileSave,handleFileCreated:e.handleFileCreated,handleFileDeleted:e.handleFileDeleted,handleGitRefChange:e.handleGitRefChange},log:t}):t("[standalone] codeatlas.autoUpdateOnSave is false \u2014 file watcher disabled"),e.autoOpen&&e9e(`http://localhost:${u}`,t);let f=!1;return{port:u,settings:r,secrets:n,async stop(){if(!f){f=!0;try{await d?.stop()}catch{}try{await c?.stop()}catch{}t("[standalone] server stopped")}},notifyRefresh(h){let m=e.snapshotStore.getWorking();c?.broadcast({type:"workspaceInfo",name:require("path").basename(e.workspaceRoot),workspaceRoot:e.workspaceRoot,fileCount:Object.keys(m.files??{}).length,apiCount:Object.keys(m.apiIndex??{}).length,serviceCount:Object.keys(m.services??{}).length,clusterCount:Object.keys(m.clusters??{}).length,initialized:!0,isAuthenticated:!1,hasGitRemote:!1,gitHubConnected:!1,editorUriScheme:"vscode",extensionId:"codeatlas.standalone",llmProvider:r.get("codeatlas.llmProvider"),llmModel:r.get("codeatlas.llmModel"),llmEndpoint:r.get("codeatlas.llmEndpoint")}),c?.broadcast({type:"cascadeRefresh",changedFilePath:h})}}}function X6e(e){let t=e.getWorking(),r=["microservice:workspace","feature:workspace"];for(let s of r){let a=t.graphs[s];if(a)return{graphId:s,mode:a.type,graph:a,label:s}}let n=Object.values(t.graphs).find(Boolean);return n?{graphId:n.graphId,mode:n.type,graph:n,label:n.graphId}:null}function Q6e(e){process.stderr.write(`${e}
|
|
528
|
+
${t}`,r}function O6e(e){try{return JSON.parse(e)}catch{}let t=e.match(/```(?:json)?\s*\n?([\s\S]*?)\n?```/);if(t)try{return JSON.parse(t[1])}catch{}let r=e.match(/\{[\s\S]*\}/);if(r)try{return JSON.parse(r[0])}catch{}return null}var $6e=5*60*1e3,R6e=20,pm=new Map;function D6e(e,t){return`${e.toLowerCase().trim()}::${t}`}async function tV(e,t,r,n){let s=D6e(r,Object.keys(t.files).length),a=pm.get(s);if(a&&Date.now()-a.timestamp<$6e)return a.result;let o=k6e(t),c=_d(N6e(o,r)),l=await gd(e,[{role:"system",content:C6e},{role:"user",content:c}],n),u=O6e(l.text);if(!u)return{...A6e,error:"Failed to parse LLM response"};let d={matchedServices:Array.isArray(u.matchedServices)?u.matchedServices:[],matchedClusters:Array.isArray(u.matchedClusters)?u.matchedClusters:[],matchedApis:Array.isArray(u.matchedApis)?u.matchedApis:[],matchedFiles:Array.isArray(u.matchedFiles)?u.matchedFiles:[],matchedFunctions:Array.isArray(u.matchedFunctions)?u.matchedFunctions:[],matchedClasses:Array.isArray(u.matchedClasses)?u.matchedClasses:[],explanation:typeof u.explanation=="string"?u.explanation:""};if(pm.size>=R6e){let p=pm.keys().next().value;p!==void 0&&pm.delete(p)}return pm.set(s,{result:d,timestamp:Date.now()}),d}function rV(e,t){let r=new Set,n=[];function s(o,c,l){let u=`${o}::${c}`;r.has(u)||(r.add(u),n.push({filePath:o,functionName:c,impactKind:"nl-query",matchReason:l}))}function a(o,c){let l=t.files[o];if(l){if(l.symbols.functions.length===0){s(o,"*",c);return}for(let u of l.symbols.functions)s(o,u.name,c)}}for(let o of e.matchedFunctions){let c=o.indexOf("::");if(c>0){let l=o.slice(c+2);s(o.slice(0,c),l,`Matched function: ${l}`)}}for(let o of e.matchedClasses){let c=o.indexOf("::");if(c>0){let l=o.slice(c+2);s(o.slice(0,c),l,`Matched class: ${l}`)}}for(let o of e.matchedFiles)a(o,`File matched: ${o.split("/").pop()}`);for(let o of e.matchedApis){let c=t.apiIndex[o];c&&s(c.filePath,c.handlerName,`API handler: ${c.method} ${c.route}`)}for(let o of e.matchedClusters){let c=t.clusters?.[o];if(c){let l=c.name??c.label;for(let u of c.files)a(u,`In cluster: ${l}`)}}for(let o of e.matchedServices){let c=t.services?.[o];if(!c)continue;let l=c.name;for(let d of Object.values(t.clusters??{}))if(d.serviceId===o)for(let p of d.files)a(p,`In service: ${l}`);let u=c.rootPath.endsWith("/")?c.rootPath:c.rootPath+"/";for(let d of Object.keys(t.files))(d.startsWith(u)||d===c.rootPath)&&a(d,`In service: ${l}`)}return n}function nV(){return{requestId:0,inflight:null}}async function iV(e,t,r){t.inflight?.abort();let n=new AbortController;t.inflight=n;let s=++t.requestId;e.wsBridge.broadcast({type:"nlQueryLoading",loading:!0});try{let a=e.settings.get("codeatlas.llmProvider")||"openrouter",o=e.settings.get("codeatlas.llmEndpoint")||"",c=a==="ollama"||a==="custom",l=await e.secrets.get("codeatlas.openRouterApiKey")??"";if(!l&&!c){if(s!==t.requestId)return;e.wsBridge.broadcast({type:"nlQueryResult",result:{explanation:"",matchCount:0,error:"No API key configured. Set OPENROUTER_API_KEY env var or use a local LLM (provider=ollama / custom)."}});return}if(a==="custom"&&!o){if(s!==t.requestId)return;e.wsBridge.broadcast({type:"nlQueryResult",result:{explanation:"",matchCount:0,error:'Provider "custom" needs codeatlas.llmEndpoint set (e.g. http://localhost:8080/v1/chat/completions).'}});return}let u=a==="ollama"||a==="custom",d={apiKey:l,model:e.settings.get("codeatlas.llmModel")||"openrouter/free",timeoutMs:u?12e4:3e4,provider:a,endpoint:o,responseFormat:"json_object"},p=e.snapshotStore.getWorking(),f=await tV(d,p,r,n.signal);if(s!==t.requestId)return;let h=rV(f,p);e.wsBridge.broadcast({type:"clearHighlights"}),h.length>0&&e.wsBridge.broadcast({type:"highlightNodes",highlights:h}),e.wsBridge.broadcast({type:"nlQueryResult",result:{explanation:f.explanation,matchCount:h.length,error:f.error}})}catch(a){if(a?.name==="AbortError"||s!==t.requestId)return;let o=a?.message??String(a);e.log(`[nl-query] error: ${o}`),e.wsBridge.broadcast({type:"nlQueryResult",result:{explanation:"",matchCount:0,error:`Query failed: ${o.slice(0,200)}`}})}finally{s===t.requestId&&(t.inflight=null),e.wsBridge.broadcast({type:"nlQueryLoading",loading:!1})}}function sV(e){e.wsBridge.broadcast({type:"clearHighlights"})}var M6e=3,L6e=3,F6e=2,j6e=2,vd=class{constructor(t,r,n=2e3){this.callbacks=t;this.gitOps=r;this._isPlaying=!1;this._isPaused=!1;this.autoPlayTimer=null;this.allSteps=[];this.diffCache=new Map;this.pairContexts=new Map;this.currentStepIndex=-1;this.activeDiffPairIndex=-1;this.stepDurationMs=n}get isPlaying(){return this._isPlaying}get isPaused(){return this._isPaused}setSpeed(t){this.stepDurationMs=Math.max(500,Math.min(1e4,t))}async play(t){if(t.length<2)return;this.resetState(),this._isPlaying=!0,this._isPaused=!1;let r=t.length-1;try{for(let n=0;n<r;n++){if(!this._isPlaying)return;let s=t[n],a=t[n+1];this.callbacks.onCommitStart(n,r,a.hash,a.subject);let o=await this.gitOps.buildDiff(s.hash,a.hash);if(!this._isPlaying)return;this.diffCache.set(n,o),this.pairContexts.set(n,{baseHash:s.hash,headHash:a.hash,baseLabel:`${s.shortHash} ${s.subject}`,headLabel:`${a.shortHash} ${a.subject}`});let c=this.buildSteps(o,a,n,r);for(let l of c)this.allSteps.push({...l,diffPairIndex:n,globalIndex:0,totalSteps:0})}for(let n=0;n<this.allSteps.length;n++)this.allSteps[n].globalIndex=n,this.allSteps[n].totalSteps=this.allSteps.length;if(this.allSteps.length===0||!this._isPlaying){this._isPlaying=!1,this.callbacks.onReplayEnd();return}this.currentStepIndex=0,this.navigateToCurrentStep(),this.scheduleNextAdvance()}catch(n){throw this._isPlaying&&(this._isPlaying=!1,this._isPaused=!1,this.clearAutoPlayTimer(),this.callbacks.clearDiffContext(),this.callbacks.onReplayEnd()),n}}pause(){!this._isPlaying||this._isPaused||(this._isPaused=!0,this.clearAutoPlayTimer(),this.callbacks.onPaused())}resume(){!this._isPaused||!this._isPlaying||(this._isPaused=!1,this.callbacks.onResumed(),this.currentStepIndex<this.allSteps.length-1&&this.scheduleNextAdvance())}nextStep(){if(!this._isPlaying||this.currentStepIndex>=this.allSteps.length-1)return;let t=this._isPaused;this._isPaused=!0,this.clearAutoPlayTimer(),this.currentStepIndex++,this.navigateToCurrentStep(),t||this.callbacks.onPaused()}prevStep(){if(!this._isPlaying||this.currentStepIndex<=0)return;let t=this._isPaused;this._isPaused=!0,this.clearAutoPlayTimer(),this.currentStepIndex--,this.navigateToCurrentStep(),t||this.callbacks.onPaused()}skipCommit(){if(!this._isPlaying||this.allSteps.length===0)return;let t=this.allSteps[this.currentStepIndex];if(!t)return;let r=t.diffPairIndex+1,n=this.allSteps.findIndex(s=>s.diffPairIndex===r);if(n<0){this.currentStepIndex=this.allSteps.length-1,this.clearAutoPlayTimer(),this.navigateToCurrentStep(),this._isPaused||(this._isPaused=!0,this.callbacks.onPaused());return}this.clearAutoPlayTimer(),this.currentStepIndex=n,this.navigateToCurrentStep(),this._isPaused||this.scheduleNextAdvance()}stop(){let t=this._isPlaying,r=this.currentStepIndex,n=this.allSteps.length;this.resetState(),t&&(n>0&&r<n-1&&Gh.track("timeline_replay_abandoned",{exited_at_step:r,total_steps:n,progress_percent:Math.round(r/n*100)}),this.callbacks.clearDiffContext(),this.callbacks.onReplayEnd())}playFromDiffResult(t){this.resetState(),this._isPlaying=!0,this._isPaused=!1;let r={diffedGraphs:t.diffedGraphs,headSnapshot:{files:{},apiIndex:{},graphs:{}},baseSnapshot:{files:{},apiIndex:{},graphs:{}}};this.diffCache.set(0,r),this.pairContexts.set(0,{baseHash:t.baseHash,headHash:t.headHash,baseLabel:t.baseLabel,headLabel:t.headLabel});let n={hash:t.headHash,shortHash:t.headHash.slice(0,7),subject:t.headLabel,author:"",relativeDate:""},s=this.buildSteps(r,n,0,1);for(let a=0;a<s.length;a++)this.allSteps.push({...s[a],diffPairIndex:0,globalIndex:a,totalSteps:s.length});if(this.allSteps.length===0){this._isPlaying=!1,this.callbacks.onReplayEnd();return}this.currentStepIndex=0,this.callbacks.onCommitStart(0,1,t.headHash,t.headLabel),this.navigateToCurrentStep(),this.scheduleNextAdvance()}playFocused(t,r){this.resetState(),this._isPlaying=!0,this._isPaused=!1;let n={diffedGraphs:r.diffedGraphs,headSnapshot:{files:{},apiIndex:{},graphs:{}},baseSnapshot:{files:{},apiIndex:{},graphs:{}}};this.diffCache.set(0,n),this.pairContexts.set(0,{baseHash:r.baseHash,headHash:r.headHash,baseLabel:r.baseLabel,headLabel:r.headLabel});let s={hash:r.headHash,shortHash:r.headHash.slice(0,7),subject:r.headLabel,author:"",relativeDate:""},o=this.buildSteps(n,s,0,1).filter(c=>c.mode==="feature"||c.mode==="microservice"?!0:c.mode==="api-list"?r.diffedGraphs[c.graphId]?.meta?.files?.some(d=>d===t)??!1:c.graphId.includes(t));for(let c=0;c<o.length;c++)this.allSteps.push({...o[c],diffPairIndex:0,globalIndex:c,totalSteps:o.length});if(this.allSteps.length===0){this._isPlaying=!1,this.callbacks.onReplayEnd();return}this.currentStepIndex=0,this.callbacks.onCommitStart(0,1,r.headHash,r.headLabel),this.navigateToCurrentStep(),this.scheduleNextAdvance()}resetState(){this._isPlaying=!1,this._isPaused=!1,this.clearAutoPlayTimer(),this.allSteps=[],this.diffCache.clear(),this.pairContexts.clear(),this.currentStepIndex=-1,this.activeDiffPairIndex=-1}scheduleNextAdvance(){if(this.clearAutoPlayTimer(),!(!this._isPlaying||this._isPaused)){if(this.currentStepIndex>=this.allSteps.length-1){Gh.track("timeline_replay_completed",{total_steps:this.allSteps.length}),this._isPaused=!0,this.callbacks.onPaused();return}this.autoPlayTimer=setTimeout(()=>{this.autoPlayTimer=null,!(!this._isPlaying||this._isPaused)&&(this.currentStepIndex++,this.navigateToCurrentStep(),this.scheduleNextAdvance())},this.stepDurationMs)}}clearAutoPlayTimer(){this.autoPlayTimer&&(clearTimeout(this.autoPlayTimer),this.autoPlayTimer=null)}navigateToCurrentStep(){let t=this.allSteps[this.currentStepIndex];if(!t)return;if(t.diffPairIndex!==this.activeDiffPairIndex){let s=this.pairContexts.get(t.diffPairIndex);s&&(this.callbacks.setDiffContext(s.baseHash,s.headHash,s.baseLabel,s.headLabel),this.activeDiffPairIndex=t.diffPairIndex)}this.callbacks.onCommitStart(t.commitIndex,t.totalCommits,t.commitHash,t.commitSubject);let n=this.diffCache.get(t.diffPairIndex)?.diffedGraphs[t.graphId];n&&(this.callbacks.onStepStart(t),this.callbacks.navigate(t.graphId,t.mode,n,t.label))}buildSteps(t,r,n,s){let a=[],o={commitHash:r.hash,commitSubject:r.subject,commitIndex:n,totalCommits:s},c=[],l=[];for(let[f,h]of Object.entries(t.diffedGraphs)){if(f.startsWith("file:")){let m=f.slice(5);h.nodes.some(g=>g.diff&&g.diff!=="unchanged")&&c.push(m)}if(f.startsWith("flow:")){let m=f.slice(5),g=m.lastIndexOf(":");if(g>0){let y=m.slice(0,g),_=m.slice(g+1);h.nodes.some(v=>v.diff&&v.diff!=="unchanged")&&l.push({filePath:y,fnName:_})}}}for(let{filePath:f}of l){if(c.includes(f))continue;t.diffedGraphs[`file:${f}`]&&c.push(f)}for(let{filePath:f,fnName:h}of l.slice(0,M6e))a.push({...o,graphId:`flow:${f}:${h}`,mode:"flow",label:`Flow: ${h}`,layer:"L5 Flow",changedEntity:h});for(let f of c.slice(0,L6e))a.push({...o,graphId:`file:${f}`,mode:"file",label:`File: ${f.split("/").pop()}`,layer:"L4 File",changedEntity:f.split("/").pop()??f});let u=0;for(let[f,h]of Object.entries(t.diffedGraphs)){if(u>=F6e)break;if(f.startsWith("sequence:")&&h.nodes.some(m=>m.diff&&m.diff!=="unchanged")){let m=f.split(":").pop();a.push({...o,graphId:f,mode:"sequence",label:`Sequence: ${m}`,layer:"L3 Sequence",changedEntity:m}),u++}}let d=Object.keys(t.diffedGraphs).find(f=>f.startsWith("feature:"));d&&a.push({...o,graphId:d,mode:"feature",label:"Feature Areas",layer:"L2a Feature",changedEntity:"clusters"});let p=0;for(let[f,h]of Object.entries(t.diffedGraphs)){if(p>=j6e)break;if(f.startsWith("api-list:")&&h.meta?.apis?.some(g=>g.diff&&g.diff!=="unchanged")){let g=h.meta?.clusterLabel??f.slice(9);a.push({...o,graphId:f,mode:"api-list",label:`APIs: ${g}`,layer:"L2b API List",changedEntity:g}),p++}}return t.diffedGraphs["microservice:workspace"]&&a.push({...o,graphId:"microservice:workspace",mode:"microservice",label:"System Design",layer:"L1 System",changedEntity:"services"}),a}};DN();function aV(){return{timeline:null}}function B6e(e,t){return t.timeline||(t.timeline=new vd({navigate:(r,n,s,a)=>{e.wsBridge.broadcast({type:"navigateTo",graphId:r,mode:n,graph:s,label:a})},setDiffContext:(r,n,s,a)=>{e.wsBridge.broadcast({type:"setGitDiffContext",baseHash:r,headHash:n,baseLabel:s,headLabel:a})},clearDiffContext:()=>{e.wsBridge.broadcast({type:"clearGitDiffContext"})},onStepStart:r=>{e.wsBridge.broadcast({type:"replayStep",step:r})},onCommitStart:(r,n,s,a)=>{e.wsBridge.broadcast({type:"replayCommitStart",index:r,total:n,hash:s,subject:a})},onReplayEnd:()=>{e.wsBridge.broadcast({type:"replayEnded"})},onPaused:()=>{e.wsBridge.broadcast({type:"replayPaused"})},onResumed:()=>{e.wsBridge.broadcast({type:"replayResumed"})}},{buildDiff:async()=>{throw new Error("Commit-history replay not yet supported in standalone \u2014 use Replay Working Changes for now.")}})),t.timeline}function oV(e,t){let r=e.snapshotStore.getBaseline(),n=e.snapshotStore.getWorking();if(!Yv(r,n)){e.wsBridge.broadcast({type:"clientToast",level:"warning",text:"No working changes to replay \u2014 edit a file first."});return}let s=Xv(r,n);B6e(e,t).playFromDiffResult({diffedGraphs:s,baseHash:"baseline",headHash:"working",baseLabel:"Baseline",headLabel:"Working (uncommitted)"}),e.wsBridge.broadcast({type:"replayStarted"})}function YN(e,t){t.timeline?.stop(),e.wsBridge.broadcast({type:"replayStopped"})}function cV(e,t,r){let n=t.timeline;if(n)switch(r){case"pause":n.pause();break;case"resume":n.resume();break;case"next":n.nextStep();break;case"prev":n.prevStep();break;default:e.log(`[replay] unknown control action: ${r}`)}}function lV(e,t,r){t.timeline?.setSpeed(r)}uv();var uV=require("child_process"),QN=Fe(require("https"));function XN(e,t){return(0,uV.execSync)(e,{cwd:t,encoding:"utf-8",maxBuffer:10*1024*1024})}function eO(e){try{let r=XN("git remote get-url origin",e).trim().match(/github\.com[/:]([^/]+)\/([^/.]+?)(?:\.git)?$/);return r?{owner:r[1],repo:r[2]}:null}catch{return null}}function dV(e,t,r){return new Promise(n=>{let s={hostname:"api.github.com",path:`/repos/${e}/${t}/pulls?state=open&per_page=30&sort=updated&direction=desc`,headers:{"User-Agent":"codeatlas-vscode",Accept:"application/vnd.github+json",...r?{Authorization:`Bearer ${r}`}:{}}},a=QN.get(s,o=>{let c="";o.on("data",l=>{c+=l}),o.on("end",()=>{if(o.statusCode!==200){n([]);return}try{let l=JSON.parse(c);n(l.map(u=>({number:u.number,title:u.title??`PR #${u.number}`,author:u.user?.login??"unknown",branch:u.head?.ref??"",updatedAt:u.updated_at??"",isDraft:u.draft===!0})))}catch{n([])}})});a.on("error",()=>n([])),a.setTimeout(8e3,()=>{a.destroy(),n([])})})}function pV(e,t,r,n){return new Promise((s,a)=>{let o={hostname:"api.github.com",path:`/repos/${e}/${t}/pulls/${r}`,headers:{"User-Agent":"codeatlas-vscode",Accept:"application/vnd.github+json",...n?{Authorization:`Bearer ${n}`}:{}}};QN.get(o,l=>{let u="";l.on("data",d=>{u+=d}),l.on("end",()=>{let d=l.statusCode??0;if(d===401){a(new Error("GitHub authentication failed (401). Your token may be invalid or expired \u2014 re-sign in via VS Code's GitHub extension."));return}if(d===403){let m="";try{m=JSON.parse(u).message??""}catch{}m.toLowerCase().includes("rate limit")?a(new Error("GitHub API rate limit exceeded (403). Sign in to GitHub via VS Code for a higher limit (5000 req/hr).")):a(new Error(`GitHub access denied (403): ${m||'token may lack the "repo" scope needed for private repositories.'}`));return}if(d===404){let m=n?"":" If this is a private repository, sign in to GitHub via VS Code's GitHub extension first.";a(new Error(`PR #${r} not found in ${e}/${t}.${m}`));return}if(d!==200){let m="";try{m=JSON.parse(u).message??""}catch{}a(new Error(`GitHub API error ${d}: ${m||u.slice(0,200)}`));return}let p;try{p=JSON.parse(u)}catch{a(new Error("Failed to parse GitHub API response \u2014 unexpected non-JSON body."));return}let f=p?.base?.sha,h=p?.head?.sha;if(typeof f!="string"||typeof h!="string"){a(new Error("GitHub API response is missing base or head commit SHA."));return}s({prNumber:r,prTitle:p.title??`PR #${r}`,baseHash:f,headHash:h,baseRef:p.base.ref??"",headRef:p.head.ref??""})})}).on("error",l=>{a(new Error(`Network error contacting GitHub API: ${l.message}`))})})}function tO(e,t){try{XN(`git cat-file -e ${t}^{commit}`,e)}catch{try{XN("git fetch origin",e)}catch{}}}dv();function fV(){return{timeline:null,activeContext:null}}function ix(e,t){return t.timeline||(t.timeline=new vd({navigate:(r,n,s,a)=>e.wsBridge.broadcast({type:"navigateTo",graphId:r,mode:n,graph:s,label:a}),setDiffContext:(r,n,s,a)=>e.wsBridge.broadcast({type:"setGitDiffContext",baseHash:r,headHash:n,baseLabel:s,headLabel:a}),clearDiffContext:()=>e.wsBridge.broadcast({type:"clearGitDiffContext"}),onStepStart:r=>e.wsBridge.broadcast({type:"replayStep",step:r}),onCommitStart:(r,n,s,a)=>e.wsBridge.broadcast({type:"replayCommitStart",index:r,total:n,hash:s,subject:a}),onReplayEnd:()=>e.wsBridge.broadcast({type:"replayEnded"}),onPaused:()=>e.wsBridge.broadcast({type:"replayPaused"}),onResumed:()=>e.wsBridge.broadcast({type:"replayResumed"})},{buildDiff:(r,n)=>Kh(e.workspaceRoot,r,n,e.log)})),t.timeline}function ra(e,t){e.wsBridge.broadcast({type:"clientToast",level:"error",text:t})}function rO(e,t){e.wsBridge.broadcast({type:"clientToast",level:"warning",text:t})}function hV(e,t){let r=cv(e.workspaceRoot,100);if(r.length===0){rO(e,"No git commits found in this repository.");return}e.wsBridge.sendTo(t,{type:"showCommitPicker",commits:r.map(n=>({hash:n.hash,shortHash:n.shortHash,subject:n.subject,author:n.author,relativeDate:n.relativeDate})),mode:"both"})}async function mV(e,t,r,n){try{let s=await Kh(e.workspaceRoot,r,n,e.log),a=r.slice(0,7),o=n.slice(0,7),c={baseHash:r,headHash:n,baseLabel:`${a} (base)`,headLabel:`${o} (head)`};t.activeContext=c,ix(e,t).playFromDiffResult({diffedGraphs:s.diffedGraphs,...c}),e.wsBridge.broadcast({type:"replayStarted"})}catch(s){ra(e,`Commit diff failed: ${(s?.message??String(s)).slice(0,200)}`)}}function gV(e,t){let r=sv(e.workspaceRoot);if(r.length===0){rO(e,"No local branches found.");return}e.wsBridge.sendTo(t,{type:"showBranchPicker",branches:r.map(n=>({name:n.name,isCurrent:n.isCurrent,isRemote:n.isRemote}))})}async function yV(e,t,r){try{let n=av(e.workspaceRoot,r),s=av(e.workspaceRoot,"HEAD");if(!n||!s){ra(e,`Could not resolve branch ${r}.`);return}let a=ov(e.workspaceRoot,n,s)??n,o=await Kh(e.workspaceRoot,a,n,e.log),c={baseHash:a,headHash:n,baseLabel:`${a.slice(0,7)} (merge-base)`,headLabel:`${r} (${n.slice(0,7)})`};t.activeContext=c,ix(e,t).playFromDiffResult({diffedGraphs:o.diffedGraphs,...c}),e.wsBridge.broadcast({type:"replayStarted"})}catch(n){ra(e,`Branch diff failed: ${(n?.message??String(n)).slice(0,200)}`)}}async function _V(e,t){let r=eO(e.workspaceRoot);if(!r){ra(e,"Could not determine GitHub repository from the origin remote. Make sure `origin` points at github.com.");return}let n=await e.secrets.get("codeatlas.githubToken"),s=await dV(r.owner,r.repo,n);e.wsBridge.sendTo(t,{type:"showPrPicker",owner:r.owner,repo:r.repo,prs:s})}async function bV(e,t,r){let n=eO(e.workspaceRoot);if(!n){ra(e,"Could not determine GitHub repository from the origin remote.");return}try{let s=await e.secrets.get("codeatlas.githubToken"),a=await pV(n.owner,n.repo,r,s);try{tO(e.workspaceRoot,a.baseHash),tO(e.workspaceRoot,a.headHash)}catch(u){ra(e,`Couldn't fetch PR commits locally: ${u?.message??u}. If this is a fork-based PR, fetch the source branch manually.`);return}let o=await Kh(e.workspaceRoot,a.baseHash,a.headHash,e.log),c={baseHash:a.baseHash,headHash:a.headHash,baseLabel:`${a.baseRef} (base)`,headLabel:`PR #${a.prNumber}: ${a.prTitle}`};t.activeContext=c,ix(e,t).playFromDiffResult({diffedGraphs:o.diffedGraphs,...c}),e.wsBridge.broadcast({type:"replayStarted"})}catch(s){let a=s?.message??String(s);if(a.includes("not found")){let c=!!await e.secrets.get("codeatlas.githubToken")?" (token present \u2014 check that it has the `repo` scope for private repositories)":" Set GITHUB_TOKEN env var to read private repos.";ra(e,`PR #${r} not found${c}`)}else ra(e,`PR diff failed: ${a.slice(0,200)}`)}}function vV(e,t){t.activeContext=null,t.timeline?.stop(),e.wsBridge.broadcast({type:"clearGitDiffContext"}),e.wsBridge.broadcast({type:"replayStopped"})}function xV(e,t,r){try{let n=cv(e.workspaceRoot,50,r),s=sv(e.workspaceRoot),a=s.find(c=>c.name==="main"||c.name==="master")?.name,o=a&&a!==r?ov(e.workspaceRoot,a,r??"HEAD")??n[n.length-1]?.hash:n[n.length-1]?.hash;e.wsBridge.sendTo(t,{type:"showCommitRangePicker",commits:n,branches:s,currentBranch:r,baselineHash:o})}catch(n){ra(e,`Couldn't list commits: ${(n?.message??String(n)).slice(0,200)}`)}}async function SV(e,t,r){if(!Array.isArray(r)||r.length<2){rO(e,"Pick at least two commits to walk a timeline.");return}let n=ix(e,t);try{await n.play(r.map(s=>({hash:s.hash,shortHash:s.shortHash??s.hash.slice(0,7),subject:s.subject??"",author:s.author??"",relativeDate:s.relativeDate??""}))),e.wsBridge.broadcast({type:"replayStarted"})}catch(s){ra(e,`Timeline replay failed: ${(s?.message??String(s)).slice(0,200)}`)}}function TV(e,t){t.timeline?.skipCommit()}var z6e=["requestChangeLog","navigateToChangeEntry","playbackChangeLog","connectGitHub"],na="Feature not yet available in the standalone npm package \u2014 install the VS Code extension or wait for a follow-up release.";function nO(e){let t=e.editorOpener??L8,r=new Set(z6e),n=GN(),s=nV(),a=aV(),o=fV();async function c(l,u){if(!(!l||typeof l!="object"||typeof l.type!="string"))switch(l.type){case"ready":U6e(e,u);return;case"requestRoute":za(e,l);return;case"openFileDiagram":case"openFeatureDiagram":case"openFunctionFlow":case"openMicroserviceDiagram":{let d=l.graphId;if(!d)switch(l.type){case"openMicroserviceDiagram":d="microservice:workspace";break;case"openFeatureDiagram":{let p=l.serviceId?String(l.serviceId):"";d=p?`feature:${p}`:"feature:workspace";break}case"openFileDiagram":d=l.filePath?`file:${l.filePath}`:void 0;break;case"openFunctionFlow":d=l.filePath&&l.functionName?`flow:${l.filePath}:${l.functionName}`:void 0;break}za(e,{graphId:d});return}case"openApiList":za(e,{graphId:"api-list:workspace"});return;case"openSequence":{let d=Object.keys(e.snapshotStore.getWorking().graphs??{}).find(p=>p.startsWith("sequence:"));d?za(e,{graphId:d}):pr(e,"info","No sequence diagrams yet \u2014 pick an API to view its sequence.")}return;case"openFunctionFlowChart":{let d=Object.keys(e.snapshotStore.getWorking().graphs??{}).find(p=>p.startsWith("flow:"));d?za(e,{graphId:d}):pr(e,"info","No flow diagrams yet \u2014 pick a function to view its flow.")}return;case"nodeClicked":case"edgeClicked":await q6e(e,t,l);return;case"resolveComment":W6e(e,l);return;case"addComment":{try{let d=e.commentStore.add({layer:l.layer??"file",targetType:l.targetType??"node",targetId:String(l.targetId??""),anchor:l.anchor?{filePath:l.anchor.filePath??"",symbol:l.anchor.symbol}:{filePath:""},body:String(l.body??""),source:l.source==="ai"?"ai":void 0});e.snapshotStore.setComments(e.commentStore.toJSON()),e.wsBridge.broadcast({type:"commentAdded",comment:d}),e.wsBridge.broadcast({type:"commentsUpdated",comments:e.commentStore.getAll()}),pr(e,"info","Comment added.")}catch(d){pr(e,"error",`addComment failed: ${d?.message??d}`)}return}case"panelNavigated":return;case"toggleTheme":e.wsBridge.broadcast({type:"setTheme",theme:l.theme??"dark"});return;case"runCommand":V6e(e,l);return;case"setLlmConfig":K6e(e,l);return;case"requestExplorerData":G6e(e);return;case"searchSelected":case"functionSelected":case"fileSelectedForImpact":l.graphId&&za(e,{graphId:l.graphId});return;case"requestAiReview":if(!e.settings||!e.secrets){pr(e,"warning",na);return}await ZN({snapshotStore:e.snapshotStore,wsBridge:e.wsBridge,settings:e.settings,secrets:e.secrets,log:e.log,workspaceRoot:e.workspaceRoot},n);return;case"clearAiReview":if(!e.settings||!e.secrets)return;HN({snapshotStore:e.snapshotStore,wsBridge:e.wsBridge,settings:e.settings,secrets:e.secrets,log:e.log,workspaceRoot:e.workspaceRoot},n);return;case"nlQuery":if(!e.settings||!e.secrets){pr(e,"warning",na);return}await iV({snapshotStore:e.snapshotStore,wsBridge:e.wsBridge,settings:e.settings,secrets:e.secrets,log:e.log},s,String(l.query??""));return;case"clearNlQuery":if(!e.settings||!e.secrets)return;sV({snapshotStore:e.snapshotStore,wsBridge:e.wsBridge,settings:e.settings,secrets:e.secrets,log:e.log});return;case"replayWorkingDiff":case"replayCurrentDiff":oV({snapshotStore:e.snapshotStore,wsBridge:e.wsBridge,log:e.log},a);return;case"stopReplay":YN({snapshotStore:e.snapshotStore,wsBridge:e.wsBridge,log:e.log},a);return;case"timelineReplayControl":{let d=l.action;if(d==="skipCommit"){TV({workspaceRoot:e.workspaceRoot,snapshotStore:e.snapshotStore,wsBridge:e.wsBridge,secrets:e.secrets,log:e.log},o);return}if(d==="stop"){YN({snapshotStore:e.snapshotStore,wsBridge:e.wsBridge,log:e.log},a),o.timeline&&(o.timeline.stop(),e.wsBridge.broadcast({type:"replayStopped"}));return}if(cV({snapshotStore:e.snapshotStore,wsBridge:e.wsBridge,log:e.log},a,d),o.timeline)switch(d){case"pause":o.timeline.pause();break;case"resume":o.timeline.resume();break;case"next":o.timeline.nextStep();break;case"prev":o.timeline.prevStep();break}return}case"timelineReplaySpeed":{let d=Number(l.stepMs??l.speedMs??2e3);lV({snapshotStore:e.snapshotStore,wsBridge:e.wsBridge,log:e.log},a,d),o.timeline?.setSpeed(d);return}case"requestGitDiff":if(!e.secrets){pr(e,"warning",na);return}hV({workspaceRoot:e.workspaceRoot,snapshotStore:e.snapshotStore,wsBridge:e.wsBridge,secrets:e.secrets,log:e.log},u);return;case"commitSelected":if(!e.secrets)return;await mV({workspaceRoot:e.workspaceRoot,snapshotStore:e.snapshotStore,wsBridge:e.wsBridge,secrets:e.secrets,log:e.log},o,String(l.baseHash),String(l.headHash));return;case"requestBranchDiff":case"requestBranchDiffReplay":if(!e.secrets){pr(e,"warning",na);return}gV({workspaceRoot:e.workspaceRoot,snapshotStore:e.snapshotStore,wsBridge:e.wsBridge,secrets:e.secrets,log:e.log},u);return;case"branchSelected":if(!e.secrets)return;await yV({workspaceRoot:e.workspaceRoot,snapshotStore:e.snapshotStore,wsBridge:e.wsBridge,secrets:e.secrets,log:e.log},o,String(l.branchName??l.branch??""));return;case"requestPrDiffReplay":if(!e.secrets){pr(e,"warning",na);return}await _V({workspaceRoot:e.workspaceRoot,snapshotStore:e.snapshotStore,wsBridge:e.wsBridge,secrets:e.secrets,log:e.log},u);return;case"prSelected":if(!e.secrets)return;await bV({workspaceRoot:e.workspaceRoot,snapshotStore:e.snapshotStore,wsBridge:e.wsBridge,secrets:e.secrets,log:e.log},o,Number(l.prNumber));return;case"clearGitDiff":if(!e.secrets)return;vV({workspaceRoot:e.workspaceRoot,snapshotStore:e.snapshotStore,wsBridge:e.wsBridge,secrets:e.secrets,log:e.log},o);return;case"requestTimelineCommits":if(!e.secrets){pr(e,"warning",na);return}xV({workspaceRoot:e.workspaceRoot,snapshotStore:e.snapshotStore,wsBridge:e.wsBridge,secrets:e.secrets,log:e.log},u,typeof l.branch=="string"?l.branch:void 0);return;case"startTimelineReplay":if(!e.secrets){pr(e,"warning",na);return}await SV({workspaceRoot:e.workspaceRoot,snapshotStore:e.snapshotStore,wsBridge:e.wsBridge,secrets:e.secrets,log:e.log},o,Array.isArray(l.commits)?l.commits:[]);return;case"requestReviewGuidelines":{let d=e.snapshotStore.getReviewGuidelines();e.wsBridge.broadcast({type:"reviewGuidelines",guidelines:d});return}case"saveReviewGuidelines":{let d=String(l.text??""),p=e.snapshotStore.setReviewGuidelines(d);e.wsBridge.broadcast({type:"reviewGuidelinesUpdated",guidelines:p}),pr(e,"info","Review guidelines saved.");return}case"requestEvidenceGate":{let d=e.settings?.get("codeatlas.evidenceGateEnabled");e.wsBridge.broadcast({type:"evidenceGate",enabled:d!==!1});return}case"setEvidenceGate":{let d=!!l.enabled;e.settings&&e.settings.set("codeatlas.evidenceGateEnabled",d),e.wsBridge.broadcast({type:"evidenceGate",enabled:d}),pr(e,"info",`Evidence gate ${d?"enabled":"disabled (debug)"}.`);return}case"requestAiFindings":{let d={};l.graphId&&(d.graphId=String(l.graphId)),l.entryPointId&&(d.entryPointId=String(l.entryPointId)),l.severity&&(d.severity=l.severity),l.status&&(d.status=l.status);let p=e.snapshotStore.listAiReviewFindings(d),f=e.snapshotStore.getAiReviewFindingCounts();e.wsBridge.broadcast({type:"aiFindings",items:p,counts:f,scope:l});return}case"requestAiFindingsForNode":{let d=e.snapshotStore.listAiReviewFindingsForEntity(String(l.graphId??""),String(l.nodeId??""));e.wsBridge.broadcast({type:"aiFindingsForNode",graphId:l.graphId,nodeId:l.nodeId,items:d});return}case"updateAiFindingStatus":{let d=e.snapshotStore.updateAiReviewFindingStatus(String(l.findingId??""),l.status);if(!d){pr(e,"warning","Finding not found.");return}let p=e.snapshotStore.getAiReviewFindingCounts();e.wsBridge.broadcast({type:"aiFindingUpdated",finding:d,counts:p});return}case"searchAiFindings":{try{let{searchFindings:d}=await Promise.resolve().then(()=>(kb(),Ab)),p=d(e.snapshotStore,String(l.query??""),Number(l.limit)||20);e.wsBridge.broadcast({type:"aiFindingsSearchResult",result:p})}catch(d){pr(e,"error",`Findings search failed: ${d.message??d}`)}return}case"requestFullReview":{if(!e.settings||!e.secrets){pr(e,"warning",na);return}let{runFullReview:d}=await Promise.resolve().then(()=>(um(),rx));d({snapshotStore:e.snapshotStore,wsBridge:e.wsBridge,settings:e.settings,secrets:e.secrets,log:e.log,workspaceRoot:e.workspaceRoot},{kind:l.scope??"all",clusterId:l.clusterId,entryPointId:l.entryPointId});return}case"requestSpecificReview":{if(!e.settings||!e.secrets){pr(e,"warning",na);return}let{runSpecificReview:d}=await Promise.resolve().then(()=>(um(),rx));d({snapshotStore:e.snapshotStore,wsBridge:e.wsBridge,settings:e.settings,secrets:e.secrets,log:e.log,workspaceRoot:e.workspaceRoot},String(l.prompt??""));return}case"cancelFullReview":case"cancelAiReview":{let{cancelCurrentReview:d}=await Promise.resolve().then(()=>(um(),rx));d()||pr(e,"info","No AI Review is currently running.");return}case"clearFindings":{let d=l.scope&&(l.scope.entryPointId||l.scope.graphId)?{entryPointId:l.scope.entryPointId,graphId:l.scope.graphId}:void 0,p=e.snapshotStore.clearAiReviewFindings(d);try{e.snapshotStore.clearAiReviewSignature?.()}catch{}e.wsBridge.broadcast({type:"aiFindingsCleared",count:p,scope:l.scope??null});let f=e.snapshotStore.getAiReviewFindingCounts(),h=e.snapshotStore.listAiReviewFindings({status:"open"});e.wsBridge.broadcast({type:"aiFindings",items:h,counts:f}),pr(e,"info",`Cleared ${p} finding${p===1?"":"s"}.`);return}default:if(r.has(l.type)){e.log(`[standalone] msg.${l.type}: unavailable in v1, sending toast`),pr(e,"warning",na);return}e.log(`[standalone] unknown msg.type=${l.type}`)}}return{handle:c}}function U6e(e,t){let r=!!(e.settings&&e.secrets),n=!!e.secrets;e.wsBridge.broadcast({type:"capabilities",capabilities:{canSignIn:!1,canAiReview:r,canNlQuery:r,canSearch:r,canReplay:!0,canGitDiff:n,canEditCode:!0,canComment:!0,mode:"standalone"}});let s=e.snapshotStore.getWorking(),a=Object.keys(s.files??{}).length,o=Object.keys(s.apiIndex??{}).length,c=Object.keys(s.services??{}).length,l=Object.keys(s.clusters??{}).length,u=Object.keys(s.graphs??{}),d=u.filter(_=>_.startsWith("file:")).length,p=u.filter(_=>_.startsWith("flow:")).length,f=u.filter(_=>_.startsWith("sequence:")).length,h=e.settings?.get("codeatlas.llmProvider"),m=e.settings?.get("codeatlas.llmModel"),g=e.settings?.get("codeatlas.llmEndpoint");e.wsBridge.broadcast({type:"workspaceInfo",name:require("path").basename(e.workspaceRoot),workspaceRoot:e.workspaceRoot,fileCount:a,apiCount:o,serviceCount:c,clusterCount:l,fileGraphCount:d,flowGraphCount:p,sequenceGraphCount:f,initialized:a>0,isAuthenticated:!1,hasGitRemote:!1,gitHubConnected:!1,editorUriScheme:"vscode",extensionId:"codeatlas.standalone",llmProvider:h,llmModel:m,llmEndpoint:g});let y=Z6e(e);y&&e.wsBridge.broadcast({type:"navigateTo",graphId:y.graphId,mode:y.type,graph:y,label:wV(y)})}function za(e,t){let r=t.graphId;if(!r)return;let s=e.snapshotStore.getWorking().graphs[r];if(!s){e.log(`[standalone] requestRoute: ${r} not found in working snapshot`),pr(e,"warning",`Diagram not found: ${r}`);return}e.wsBridge.broadcast({type:"navigateTo",graphId:r,mode:s.type,graph:s,label:wV(s)})}async function q6e(e,t,r){let n=r.anchor?.filePath;if(!n)return;let s=n.startsWith("/")?n:`${e.workspaceRoot}/${n}`,a=r.anchor?.line,o=await t(s,a,{});pr(e,o.spawned?"info":"warning",o.toast)}function W6e(e,t){let r=t.commentId;r&&(e.commentStore.resolve(r),e.wsBridge.broadcast({type:"commentResolved",commentId:r}))}function V6e(e,t){switch(t.command){case"codeatlas.lightMode":e.wsBridge.broadcast({type:"setTheme",theme:"light"});return;case"codeatlas.darkMode":e.wsBridge.broadcast({type:"setTheme",theme:"dark"});return;case"codeatlas.openApiExplorer":{let r=Object.keys(e.snapshotStore.getWorking().graphs??{}).find(n=>n.startsWith("api-list:"));r?za(e,{graphId:r}):pr(e,"info",'No API-list diagrams yet \u2014 run "Initialize" to scan the workspace.');return}case"codeatlas.searchApiExplorer":case"codeatlas.openFunctionFlow":{let r=t.command==="codeatlas.openFunctionFlow"?"flow:":"sequence:",n=Object.keys(e.snapshotStore.getWorking().graphs??{}).find(s=>s.startsWith(r));n?za(e,{graphId:n}):pr(e,"info",`No ${r.replace(":","")} diagrams yet \u2014 pick an API/function first.`);return}case"codeatlas.showHealthReport":za(e,{graphId:"health:report"});return;default:e.log(`[standalone] runCommand: ${t.command} unsupported in v1`),pr(e,"info",`Command "${t.command}" not available in standalone v1.`)}}function K6e(e,t){if(!e.settings){pr(e,"warning","Settings layer not initialised \u2014 restart the standalone server.");return}let r=[];if(typeof t.provider=="string"&&r.push(["codeatlas.llmProvider",t.provider]),typeof t.model=="string"&&r.push(["codeatlas.llmModel",t.model]),typeof t.endpoint=="string"&&r.push(["codeatlas.llmEndpoint",t.endpoint]),r.length===0){pr(e,"info","No LLM config changes to apply.");return}let n=!0;for(let[s,a]of r)e.settings.set(s,a)||(n=!1);if(n){pr(e,"info",`Saved LLM config (${r.map(([o])=>o.replace("codeatlas.","")).join(", ")}).`),e.wsBridge.broadcast({type:"llmConfigSaved"});let s=e.snapshotStore.getWorking(),a=Object.keys(s.graphs??{});e.wsBridge.broadcast({type:"workspaceInfo",name:require("path").basename(e.workspaceRoot),workspaceRoot:e.workspaceRoot,fileCount:Object.keys(s.files??{}).length,apiCount:Object.keys(s.apiIndex??{}).length,serviceCount:Object.keys(s.services??{}).length,clusterCount:Object.keys(s.clusters??{}).length,fileGraphCount:a.filter(o=>o.startsWith("file:")).length,flowGraphCount:a.filter(o=>o.startsWith("flow:")).length,sequenceGraphCount:a.filter(o=>o.startsWith("sequence:")).length,initialized:Object.keys(s.files??{}).length>0,isAuthenticated:!1,hasGitRemote:!1,gitHubConnected:!1,editorUriScheme:"vscode",extensionId:"codeatlas.standalone",llmProvider:e.settings.get("codeatlas.llmProvider"),llmModel:e.settings.get("codeatlas.llmModel"),llmEndpoint:e.settings.get("codeatlas.llmEndpoint")})}else pr(e,"error","Failed to write LLM config \u2014 check filesystem permissions on .codeatlas-sa/config.json.")}function G6e(e){let t=e.snapshotStore.getWorking(),r=Object.values(t.apiIndex??{}),n=Object.values(t.clusters??{}).map(s=>({id:s.id,label:s.label??s.name,files:s.files??[],apisInCluster:s.apisInCluster??[]}));e.wsBridge.broadcast({type:"explorerData",apis:r,clusters:n,files:Object.keys(t.files??{})})}function Z6e(e){let t=e.snapshotStore.getWorking();return t.graphs["microservice:workspace"]??Object.values(t.graphs).find(r=>r?.graphId?.startsWith("feature:"))??Object.values(t.graphs)[0]??null}function wV(e){let t=e.meta??{};return typeof t.label=="string"?t.label:typeof t.title=="string"?t.title:(e.nodes??[]).find(n=>n.type==="file"||n.type==="cluster"||n.type==="service")?.label??e.graphId}function pr(e,t,r){e.wsBridge.broadcast({type:"clientToast",level:t,text:r})}var hl=Fe(require("node:fs")),PV=Fe(require("node:os")),fm=Fe(require("node:path")),iO=Object.freeze({"codeatlas.autoUpdateOnSave":!0,"codeatlas.maxFiles":2e3,"codeatlas.maxFileSize":5242880,"codeatlas.sequenceTraversalDepth":8,"codeatlas.browserPort":7742,"codeatlas.ignore":["**/node_modules/**","**/dist/**","**/build/**","**/.git/**","**/.codeatlas/**","**/.codeatlas-sa*/**"],"codeatlas.showUnchangedInDiagrams":!0,"codeatlas.lspFallback":!1,"codeatlas.lspTimeout":2e3,"codeatlas.llmNaming":!1,"codeatlas.llmProvider":"openrouter","codeatlas.llmModel":"openrouter/free","codeatlas.llmEndpoint":""});function IV(e){let t=e.env??process.env,r=e.homeDir??PV.homedir(),n=e.storageDirName??".codeatlas-sa",s=e.readFile??H6e,a=fm.join(e.workspaceRoot,n,"config.json"),o=fm.join(r,".codeatlas","config.json"),c=EV(s(a)),l=EV(s(o));function u(f){let h=f.replace(/([a-z0-9])([A-Z])/g,"$1_$2").replace(/\./g,"_").toUpperCase(),m=t[h];return m!==void 0?J6e(m,iO[f]):Object.prototype.hasOwnProperty.call(c,f)?c[f]:Object.prototype.hasOwnProperty.call(l,f)?l[f]:iO[f]}function d(){let f={};for(let h of Object.keys(iO))f[h]=u(h);return f}function p(f,h){try{hl.mkdirSync(fm.dirname(a),{recursive:!0});let m={};try{let g=hl.readFileSync(a,"utf-8"),y=JSON.parse(g);y&&typeof y=="object"&&(m=y)}catch{}return m[f]=h,hl.writeFileSync(a,JSON.stringify(m,null,2)+`
|
|
529
|
+
`),c[f]=h,!0}catch{return!1}}return{get:u,all:d,set:p}}function H6e(e){try{return hl.readFileSync(e,"utf-8")}catch{return null}}function EV(e){if(!e)return{};try{let t=JSON.parse(e);return t&&typeof t=="object"?t:{}}catch{return{}}}function J6e(e,t){if(typeof t=="boolean"){let r=e.toLowerCase();return r==="1"||r==="true"||r==="yes"||r==="on"}if(typeof t=="number"){let r=Number(e);return Number.isFinite(r)?r:t}if(Array.isArray(t)){if(e.startsWith("["))try{let r=JSON.parse(e);return Array.isArray(r)?r:t}catch{return t}return e.split(",").map(r=>r.trim()).filter(Boolean)}return e}var Ua=Fe(require("node:fs")),AV=Fe(require("node:os")),sx=Fe(require("node:path")),Y6e=Object.freeze({"codeatlas.openRouterApiKey":["OPENROUTER_API_KEY","OPENAI_API_KEY","ANTHROPIC_API_KEY","LLM_API_KEY"],"codeatlas.githubToken":["GITHUB_TOKEN","GH_TOKEN"]});function kV(e={}){let t=e.homeDir??AV.homedir(),r=e.env??process.env,n=e.log??(()=>{}),s=sx.join(t,".codeatlas","secrets.json");async function a(l){let u=Y6e[l]??[];for(let f of u){let h=r[f];if(h&&h.length>0)return h}let p=sO(s)[l];return typeof p=="string"&&p.length>0?p:void 0}async function o(l,u){let d=sO(s);d[l]=u;try{Ua.mkdirSync(sx.dirname(s),{recursive:!0,mode:448}),Ua.writeFileSync(s,JSON.stringify(d,null,2),{mode:384});try{Ua.chmodSync(s,384)}catch{}n(`[secrets] stored ${l} at ${s} (mode 0600)`)}catch(p){throw n(`[secrets] failed to persist ${l}: ${p?.message??p}`),p}}async function c(l){let u=sO(s);if(l in u){delete u[l];try{Ua.writeFileSync(s,JSON.stringify(u,null,2),{mode:384}),n(`[secrets] removed ${l} from ${s}`)}catch(d){throw n(`[secrets] failed to remove ${l}: ${d?.message??d}`),d}}}return{get:a,store:o,delete:c}}function sO(e){try{let t=Ua.readFileSync(e,"utf-8"),r=JSON.parse(t);return r&&typeof r=="object"?r:{}}catch{return{}}}async function OV(e){let t=e.log??Q6e,r=IV({workspaceRoot:e.workspaceRoot}),n=kV({log:t}),s=e.port??r.get("codeatlas.browserPort"),a=r.get("codeatlas.ignore"),o=new sd,c,l=nO({snapshotStore:e.snapshotStore,commentStore:o,wsBridge:void 0,workspaceRoot:e.workspaceRoot,log:t,settings:r,secrets:n});c=new Nv({port:s,extensionPath:e.distDir,messageHandler:(h,m)=>{l.handle(h,m)},getInitialData:()=>X6e(e.snapshotStore),log:t}),l.wsBridge=c,t9e(l,c,e.snapshotStore,o,e.workspaceRoot,t,r,n);let u=await c.start();t(`[standalone] webview-ui served at http://localhost:${u}`);let d;r.get("codeatlas.autoUpdateOnSave")?d=await D8({workspaceRoot:e.workspaceRoot,ignore:a,callbacks:{handleFileSave:e.handleFileSave,handleFileCreated:e.handleFileCreated,handleFileDeleted:e.handleFileDeleted,handleGitRefChange:e.handleGitRefChange},log:t}):t("[standalone] codeatlas.autoUpdateOnSave is false \u2014 file watcher disabled"),e.autoOpen&&e9e(`http://localhost:${u}`,t);let f=!1;return{port:u,settings:r,secrets:n,async stop(){if(!f){f=!0;try{await d?.stop()}catch{}try{await c?.stop()}catch{}t("[standalone] server stopped")}},notifyRefresh(h){let m=e.snapshotStore.getWorking(),g=Object.keys(m.graphs??{});c?.broadcast({type:"workspaceInfo",name:require("path").basename(e.workspaceRoot),workspaceRoot:e.workspaceRoot,fileCount:Object.keys(m.files??{}).length,apiCount:Object.keys(m.apiIndex??{}).length,serviceCount:Object.keys(m.services??{}).length,clusterCount:Object.keys(m.clusters??{}).length,fileGraphCount:g.filter(y=>y.startsWith("file:")).length,flowGraphCount:g.filter(y=>y.startsWith("flow:")).length,sequenceGraphCount:g.filter(y=>y.startsWith("sequence:")).length,initialized:!0,isAuthenticated:!1,hasGitRemote:!1,gitHubConnected:!1,editorUriScheme:"vscode",extensionId:"codeatlas.standalone",llmProvider:r.get("codeatlas.llmProvider"),llmModel:r.get("codeatlas.llmModel"),llmEndpoint:r.get("codeatlas.llmEndpoint")}),c?.broadcast({type:"cascadeRefresh",changedFilePath:h})}}}function X6e(e){let t=e.getWorking(),r=["microservice:workspace","feature:workspace"];for(let s of r){let a=t.graphs[s];if(a)return{graphId:s,mode:a.type,graph:a,label:s}}let n=Object.values(t.graphs).find(Boolean);return n?{graphId:n.graphId,mode:n.type,graph:n,label:n.graphId}:null}function Q6e(e){process.stderr.write(`${e}
|
|
530
530
|
`)}function e9e(e,t){let{spawn:r}=require("node:child_process"),n=NV.platform(),s="xdg-open",a=[e];n==="darwin"?(s="open",a=[e]):n==="win32"&&(s="cmd",a=["/c","start","",e]);try{let o=r(s,a,{detached:!0,stdio:"ignore"});o.on("error",c=>t(`[standalone] couldn't open browser via ${s}: ${c?.message??c}`));try{o.unref()}catch{}}catch(o){t(`[standalone] open-browser failed: ${o?.message??o}`)}}function t9e(e,t,r,n,s,a,o,c){let l=nO({snapshotStore:r,commentStore:n,wsBridge:t,workspaceRoot:s,log:a,settings:o,secrets:c});e.handle=l.handle}function $V(e){let t=ax.dirname(e),r=ax.join(t,"webview-ui","dist","index.html");return CV.existsSync(r)||process.stderr.write(`[standalone] WARNING: webview-ui/dist/index.html not found at ${r}
|
|
531
531
|
`),t}var aO=process.argv[2]||process.cwd(),r9e=process.argv.includes("--read-only"),n9e=process.argv.includes("--browser")||process.env.CODEATLAS_BROWSER==="1"||process.env.CODEATLAS_BROWSER==="true",i9e=process.argv.includes("--no-open");function s9e(){let e=process.argv.indexOf("--port");if(e===-1||e+1>=process.argv.length)return;let t=Number(process.argv[e+1]);return Number.isFinite(t)&&t>0?t:void 0}function a9e(){let e=process.argv.indexOf("--storage-dir");return e!==-1&&e+1<process.argv.length?process.argv[e+1]:".codeatlas-sa"}async function o9e(){let e=new Oy({name:"codeatlas-mcp",version:"0.2.0"},{capabilities:{resources:{},tools:{}}}),t=a9e(),r=new gv(aO,{readOnly:r9e,storageDirName:t}),n=await r.start(),s=r.getStore();s.__bootstrapStatus=()=>r.getStatus(),zF(e,s),iq(e,s),s.onFindingsChanged?.(d=>{try{e.notification?.({method:"notifications/codeatlas/findings_changed",params:d})}catch{}});let a=s.getWorking.bind(s);s.getWorking=()=>{try{s.refresh()}catch{}return a()};let o=new Ry;await e.connect(o);let c=n.status==="ready"?`mode=${n.mode}`:`status=${n.status}`;process.stderr.write(`CodeAtlas MCP Server running on stdio for workspace: ${aO} (${c}, storage=${t})
|
|
532
532
|
`);let l;if(n9e)try{let d=$V(__filename);l=await OV({workspaceRoot:aO,snapshotStore:s,distDir:d,port:s9e(),autoOpen:!i9e,log:p=>process.stderr.write(`${p}
|